Magellan Linux

Diff of /alx-src/trunk/alxinstall-ng/bin/alxinstall-ng.sh.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

alx-src/trunk/alxinstall-ng/bin/alxinstall-ng.sh revision 280 by niro, Wed Aug 17 03:35:09 2005 UTC alx-src/trunk/alxinstall-ng/bin/alxinstall-ng.sh.in revision 3199 by niro, Wed Sep 14 11:11:55 2011 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2  #  #
3  # $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.5 2005-08-17 03:35:09 niro Exp $  # $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.15 2008-06-28 00:37:45 niro Exp $
4  #  #
5  # AutoSta_LX Installation Script  # AutoSta_LX Installation Script
 # version: 0.8b  
6  #  #
7  # Niels Rogalla <niro@magellan-linux.de>  # Niels Rogalla <niro@magellan-linux.de>
8  # <rogalla@augusta-bochum.de>  # <rogalla@augusta-bochum.de>
# Line 12  Line 11 
11  # Install Navigation Gui  # Install Navigation Gui
12  #  #
13    
 #source /etc/alx_version  
 #source /opt/alx-config/version  
   
 #source /etc/alx-config/config.rc  
   
14  #images: (get ${CDIMAGENAME})  #images: (get ${CDIMAGENAME})
15  source /mnt/cdrom/system/images.conf  source /mnt/cdrom/system/images.conf
16    
17  #Includes  #Includes
18  source /usr/lib/alxinstall-ng/functions/findhdd.sh > /dev/null  source /usr/lib/alxinstall-ng/functions/findhdd.sh > /dev/null
19  ### bugfix ###############################  ### bugfix ###############################
20  cdromdev="`echo $cdromdev|sed -e 's/ //'`"  cdromdev="$(echo ${cdromdev} | sed 's/ //')"
21  ########################################  ########################################
22    
23  ### System/Config Version  ### System/Config Version
24  VERSION="0.2"  VERSION="%VERSIONTAG%"
25  TITLE="alxinstall-ng - ${VERSION}"  TITLE="alxinstall-ng - ${VERSION}"
26    
 #CONFIGS_TEMPLATE="/opt/alx-config/configs"  
   
27  CDPATH="/mnt/cdrom"  CDPATH="/mnt/cdrom"
28  INSTALLPATH="/mnt/magellan"  INSTALLPATH="/mnt/magellan"
29    
# Line 39  INSTALLPATH="/mnt/magellan" Line 31  INSTALLPATH="/mnt/magellan"
31  CURRENTLINE=0  CURRENTLINE=0
32  #TOTALLINES=11072 # -> now in images.conf  #TOTALLINES=11072 # -> now in images.conf
33    
34    # standard kernel opts
35    KERNELOPTS="quiet video=1024x768"
36    
37    # grub options
38    GRUBLEGACYOPTS=""
39    GRUB2OPTS=""
40    
41    # fdisk options
42    FDISKPARTIONBELOW256MB=0
43    
44    # default specialdevices
45    SPECIALDEVICE=""
46    
47    # target filesystem
48    FORMAT_FILESYSTEM="ext4"
49    
50  #################################################  #################################################
51  #  DIALOG BOXEN #  #  DIALOG BOXEN #
52  #################################################  #################################################
53    
54  die() {  die()
55   #clear  {
  #echo -e "\nhuch, da ist ein script gestorben -> $?\n"  
  #read  
  #exit 0  
56   ERROR=$1   ERROR=$1
57   RETVAL=$?   RETVAL=$?
58   dialog_install_failure   dialog_install_failure
59   exit 1   exit 1
60  }  }
61    
62  dialog_warning() {  dialog_warning()
63    {
64   dialog \   dialog \
65   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
66   --colors \   --colors \
67   --defaultno \   --defaultno \
68   --yesno "\Z1 !!! Achtung !!! \Zn\n\n\   --yesno "\Z1 !!! Achtung !!! \Zn\n\n\
69   Diese Festplatte wird unwiederruflich geloescht werden.\n\n\   Diese Festplatte wird unwiederruflich geloescht werden.\n\n\
70   Soll ich wirklich fortfahren ?" 10 70   Soll ich wirklich fortfahren ?" 10 70
71   RES=$?   RES=$?
72   if [ "$RES" == "1" ]   if [[ ${RES} -eq 1 ]]
73   then   then
74   clear   clear
75   echo "Der Vorgang wurde abgebrochen."   echo "Der Vorgang wurde abgebrochen."
# Line 72  dialog_warning() { Line 77  dialog_warning() {
77   fi   fi
78  }  }
79    
80  dialog_setup_hdd_info(){  dialog_setup_hdd_info()
81   local SHDD="`echo $HDD|sed -e 's/\/dev\///'`"  {
82     local SHDD="$(echo ${HDD} | sed 's/\/dev\///')"
83    
84   dialog \   dialog \
85   --colors \   --colors \
86   --title "[ Festplatten Partitionierung ]" \   --title "[ Festplatten Partitionierung ]" \
87   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
88   --ok-label "Weiter" \   --ok-label "Weiter" \
89   --msgbox "\nBitte legen Sie 3 Partitionen an.\n\n\   --msgbox "\nBitte legen Sie 3 Partitionen an.\n\n\
90   [ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit ca. 50MB\n\   [ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit ca. 50MB\n\
# Line 87  dialog_setup_hdd_info(){ Line 93  dialog_setup_hdd_info(){
93   Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81   Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81
94  }  }
95    
96  dialog_setup_hdd_info_flash(){  dialog_setup_hdd_info_flash()
97   local SHDD="`echo $HDD|sed -e 's/\/dev\///'`"  {
98     local SHDD="$(echo $HDD | sed 's/\/dev\///')"
99    
100   dialog \   dialog \
101   --colors \   --colors \
102   --title "[ Festplatten Partitionierung ]" \   --title "[ Festplatten Partitionierung ]" \
103   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
104   --ok-label "Weiter" \   --ok-label "Weiter" \
105   --msgbox "\nBitte legen Sie 1 Partition an.\n\n\   --msgbox "\nBitte legen Sie 1 Partition an.\n\n\
106   [ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit dem gesamten Speicher\n\   [ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit dem gesamten Speicher\n\
107   Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81   Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81
108  }  }
109    
110  dialog_setup_system_menu() {  dialog_setup_hdd_info_auto()
111    {
112     local SHDD="$(echo $HDD | sed 's/\/dev\///')"
113    
114   I=`dialog \   dialog \
115   --backtitle "$TITLE" \   --colors \
116     --title "[ Festplatten Partitionierung ]" \
117     --backtitle "${TITLE}" \
118     --ok-label "Weiter" \
119     --msgbox "\nAchtung!\n\
120     Alle Daten werden von der Disk [ \Z3${HDD}\Zn ] gelöscht!" 12 81
121    }
122    
123    dialog_setup_system_menu()
124    {
125     local i
126    
127     i=$(dialog \
128     --backtitle "${TITLE}" \
129   --title "[ Festplatten Partitionierung ]" \   --title "[ Festplatten Partitionierung ]" \
130   --cancel-label "Abbrechen" \   --cancel-label "Abbrechen" \
131   --ok-label "Weiter" \   --ok-label "Weiter" \
132   --stdout \   --stdout \
133     --colors \
134   --menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \   --menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \
135   "1" "Normale IDE-Disk" \   "1" "Automatisches Setup (Empfohlen)" \
136   "2" "Flash-Speicher"`   "" "" \
137     "" "\Z1Experten Modi:\Zn" \
138     "2" "Normale IDE-Disk (Manuell)" \
139     "3" "Flash-Speicher (Manuell)")
140   RES=$?   RES=$?
141   if [ "$RES" == "1" ];then   [[ ${RES} -eq 1 ]] && return 1
142   return 1   if [[ ${RES} -eq 0 ]]
143   fi   then
144   if [ "$RES" == "0" ];then   case "${i}" in
145   case "$I" in   "1") run_install_auto ;;
146           "1")           "2") run_install_normal ;;
147   run_install_normal   "3") run_install_flash ;;
148   ;;   "") dialog_setup_system_menu;;
  "2")  
  run_install_flash  
  ;;  
149   esac   esac
150   fi   fi
151  }  }
152    
153  dialog_setup_hdd_found_manuell() {  dialog_hardware_detection()
154   if [ ! -z "$installdevs" ]  {
155     local i
156     local hwtmp
157    
158     if [ -x $(which mktemp &> /dev/null) ]
159   then   then
160   installdevs=""   hwtmp="$(mktemp)"
161     else
162     hwtmp="/tmp/hwtmp.sh"
163   fi   fi
164    
165   echo "dialog \\"  > /tmp/hddtmp.sh   [[ ! -z ${installdevs} ]] && installdevs=""
  echo "--backtitle \"$TITLE\" \\" >> /tmp/hddtmp.sh  
  echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh  
  echo "--stdout \\" >> /tmp/hddtmp.sh  
  echo "--colors \\" >> /tmp/hddtmp.sh  
  echo "--msgbox \"Gefundene Hardware:\n\n \\" >> /tmp/hddtmp.sh  
  echo " Festplatten:\n \\" >> /tmp/hddtmp.sh  
166    
167   if [ ! -z "$scsidisks" ]   echo "dialog \\"  > ${hwtmp}
168     echo "--backtitle \"${TITLE}\" \\" >> ${hwtmp}
169     echo "--ok-label \"Weiter\" \\" >> ${hwtmp}
170     echo "--stdout \\" >> ${hwtmp}
171     echo "--colors \\" >> ${hwtmp}
172     echo "--msgbox \"Gefundene Hardware:\n\n \\" >> ${hwtmp}
173     echo " Festplatten:\n \\" >> ${hwtmp}
174    
175     if [[ ! -z ${scsidisks} ]]
176   then   then
177   for I in $scsidisks   for i in ${scsidisks}
178   do   do
179   if [ "$I" != "$cdromdev" ]   if [[ ${i} != ${cdromdev} ]]
180   then   then
181   echo " \\Z7SCSI: \\Z3$I\\Zn\n \\" >> /tmp/hddtmp.sh   echo " \\Z7SCSI: \\Z3${i}\\Zn\n \\" >> ${hwtmp}
182   installdevs="$installdevs $I"   installdevs="${installdevs} ${i}"
183   fi   fi
184   done   done
185   fi   fi
186    
187   if [ ! -z "$idedisks" ]   if [[ ! -z ${idedisks} ]]
188   then   then
189   for I in $idedisks   for i in ${idedisks}
190   do   do
191   if [ "$I" != "$cdromdev" ]   if [[ ${i} != ${cdromdev} ]]
192   then   then
193   echo " \\Z7IDE:  \\Z3$I\\Zn\n \\" >> /tmp/hddtmp.sh   echo " \\Z7IDE:  \\Z3${i}\\Zn\n \\" >> ${hwtmp}
194   installdevs="$installdevs $I"   installdevs="${installdevs} ${i}"
195   fi   fi
196   done   done
197   fi   fi
198    
199   if [ ! -z "$cdromdev" ]   if [[ ! -z ${cdromdev} ]]
200   then   then
201   echo " \n \\" >> /tmp/hddtmp.sh   echo " \n \\" >> ${hwtmp}
202   echo " \\Z7andere Laufwerke:\n \\" >> /tmp/hddtmp.sh   echo " \\Z7andere Laufwerke:\n \\" >> ${hwtmp}
203   echo " CDROM: \\Z3$cdromdev\\Zn\n \\" >> /tmp/hddtmp.sh   echo " CDROM: \\Z3${cdromdev}\\Zn\n \\" >> ${hwtmp}
204     fi
205    
206     # other devices
207     run_hardware_detection
208     case "${SPECIALDEVICE}" in
209     zotac) echo " \n\n\n \\Z2Zotac Device erkannt!\\Zn \\" >> ${hwtmp} ;;
210     "rangee+256mb")  echo " \n\n\n \\Z2Rangee Device mit Flashdisk (=< 256MB) erkannt!\\Zn \\" >> ${hwtmp} ;;
211     rangee) echo " \n\n\n \\Z2Rangee Device erkannt!\\Zn \\" >> ${hwtmp} ;;
212     *) echo " \n\n\n \\ZnStandard Device erkannt!\\Zn \\" >> ${hwtmp} ;;
213     esac
214    
215     echo " \" 13 70" >> ${hwtmp}
216     chmod a+x ${hwtmp}
217     ${hwtmp}
218    
219     # remove tmp file
220     if [[ -f ${hwtmp} ]]
221     then
222     rm ${hwtmp}
223   fi   fi
  echo " \" 13 70" >> /tmp/hddtmp.sh  
  chmod a+x /tmp/hddtmp.sh  
  /tmp/hddtmp.sh  
224  }  }
225    
226  dialog_setup_hdd_partitions_manuell() {  dialog_setup_hdd_partitions_manuell()
227   if [ -z "$installdevs" ]  {
228     local i
229    
230     if [[ -z ${installdevs} ]]
231   then   then
232   dialog \   dialog \
233   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
234   --ok-label "Beenden" \   --ok-label "Beenden" \
235   --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70   --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70
236   exit 1   exit 1
237   else   else
238    
239   echo "dialog \\" > /tmp/hddtmp.sh   echo "dialog \\" > /tmp/hddtmp.sh
240   echo "--backtitle \"$TITLE\" \\" >> /tmp/hddtmp.sh   echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh
241   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh
242   echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh   echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh
243   echo "--stdout \\" >> /tmp/hddtmp.sh   echo "--stdout \\" >> /tmp/hddtmp.sh
244   echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh   echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh
245    
246   for I in $installdevs   for i in ${installdevs}
247   do   do
248   echo "\"$I\" \"\" \\" >> /tmp/hddtmp.sh   echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh
249   done   done
250   echo -e "\n" >> /tmp/hddtmp.sh   echo -e "\n" >> /tmp/hddtmp.sh
251    
252   chmod a+x /tmp/hddtmp.sh   chmod a+x /tmp/hddtmp.sh
253   HDD="`/tmp/hddtmp.sh`"   HDD="$(/tmp/hddtmp.sh)"
254   RES=$?   RES=$?
255   if [ "$RES" == "1" ]   [[ ${RES} -eq 1 ]] && return 1
256   then   if [[ ${RES} -eq 0 ]]
  return 1  
  fi  
  if [ "$RES" == "0" ]  
257   then   then
258   dialog_setup_hdd_info   dialog_setup_hdd_info
259   setup_hdd_partitions_manuell   setup_hdd_partitions_manuell
# Line 214  dialog_setup_hdd_partitions_manuell() { Line 261  dialog_setup_hdd_partitions_manuell() {
261   fi   fi
262  }  }
263    
264  dialog_setup_hdd_partitions_manuell_flash() {  dialog_setup_hdd_partitions_manuell_flash()
265   if [ -z "$installdevs" ]  {
266     local i
267    
268     if [[ -z ${installdevs} ]]
269   then   then
270   dialog \   dialog \
271   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
272   --ok-label "Beenden" \   --ok-label "Beenden" \
273   --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70   --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70
274   exit 1   exit 1
275   else   else
276    
277   echo "dialog \\" > /tmp/hddtmp.sh   echo "dialog \\" > /tmp/hddtmp.sh
278   echo "--backtitle \"$TITLE\" \\" >> /tmp/hddtmp.sh   echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh
279   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh
280   echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh   echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh
281   echo "--stdout \\" >> /tmp/hddtmp.sh   echo "--stdout \\" >> /tmp/hddtmp.sh
282   echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh   echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh
283    
284   for I in $installdevs   for i in ${installdevs}
285   do   do
286   echo "\"$I\" \"\" \\" >> /tmp/hddtmp.sh   echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh
287   done   done
288   echo -e "\n" >> /tmp/hddtmp.sh   echo -e "\n" >> /tmp/hddtmp.sh
289    
290   chmod a+x /tmp/hddtmp.sh   chmod a+x /tmp/hddtmp.sh
291   HDD="`/tmp/hddtmp.sh`"   HDD="$(/tmp/hddtmp.sh)"
292   RES=$?   RES=$?
293   if [ "$RES" == "1" ]   [[ ${RES} -eq 1 ]] && return 1
294   then   if [[ ${RES} -eq 0 ]]
  return 1  
  fi  
  if [ "$RES" == "0" ]  
295   then   then
296   dialog_setup_hdd_info_flash   dialog_setup_hdd_info_flash
297   setup_hdd_partitions_manuell_flash   setup_hdd_partitions_manuell_flash
# Line 252  dialog_setup_hdd_partitions_manuell_flas Line 299  dialog_setup_hdd_partitions_manuell_flas
299   fi   fi
300  }  }
301    
302  dialog_setup_hdd_partitions_silent() {  dialog_setup_hdd_partitions_auto()
303    {
304     local i
305    
306     if [[ -z ${installdevs} ]]
307     then
308     dialog \
309     --backtitle "${TITLE}" \
310     --ok-label "Beenden" \
311     --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70
312     exit 1
313     else
314    
315     echo "dialog \\" > /tmp/hddtmp.sh
316     echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh
317     echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh
318     echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh
319     echo "--stdout \\" >> /tmp/hddtmp.sh
320     echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh
321    
322     for i in ${installdevs}
323     do
324     echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh
325     done
326     echo -e "\n" >> /tmp/hddtmp.sh
327    
328     chmod a+x /tmp/hddtmp.sh
329     HDD="$(/tmp/hddtmp.sh)"
330     RES=$?
331     [[ ${RES} -eq 1 ]] && return 1
332     if [[ ${RES} -eq 0 ]]
333     then
334     dialog_setup_hdd_info_auto
335     dialog_setup_hdd_create_partitions
336     setup_hdd_partitions_auto
337     fi
338     fi
339    }
340    
341    dialog_setup_hdd_create_partitions()
342    {
343   dialog \   dialog \
344   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
345   --infobox "Erstelle Partitionen ..." 3 70   --infobox "Erstelle Disk Partitionen ..." 3 70
346  }  }
347    
348  dialog_setup_hdd_format() {  dialog_setup_hdd_format()
349    {
350   dialog \   dialog \
351   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
352   --infobox "Erstelle Datei-Systeme ..." 3 70   --infobox "Erstelle Datei-Systeme ..." 3 70
353  }  }
354    
355  dialog_install_settings() {  dialog_install_settings()
356    {
357   dialog \   dialog \
358   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
359   --infobox "Speichere System-Einstellungen ..." 3 70   --infobox "Speichere System-Einstellungen ..." 3 70
360  }  }
361    
362  dialog_install_system_image() {  dialog_install_system_image()
363    {
364   dialog \   dialog \
365   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
366   --gauge "Kopiere System-Image ..." 6 80   --gauge "Kopiere System-Image ..." 6 80
367  }  }
368    
369  dialog_install_meter() {  dialog_install_meter()
370   while [ "${CURRENTLINE}" != "${TOTALLINES}" ] ; do  {
371   CURRENTLINE=`grep --count . /tmp/install.log`   while [[ ${CURRENTLINE} != ${TOTALLINES} ]]
372   PERCENT=`expr ${CURRENTLINE} \* 100 / ${TOTALLINES}`   do
373     CURRENTLINE=$(grep -c . /tmp/install.log)
374     PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES}))
375   echo ${PERCENT}   echo ${PERCENT}
376   sleep 1   sleep 1
377   done   done
# Line 288  dialog_install_meter() { Line 380  dialog_install_meter() {
380  }  }
381    
382    
383  dialog_install_bootsector() {  dialog_install_bootsector()
384    {
385   dialog \   dialog \
386   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
387   --infobox "Schreibe den Bootsektor ..." 3 70   --infobox "Schreibe den Bootsektor ..." 3 70
388  }  }
389    
390  dialog_install_alxconfig() {  dialog_install_successful()
391    {
392   dialog \   dialog \
393   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
  --infobox "Installiere die ALX Setup-Tools ..." 3 70  
 }  
   
 dialog_install_kernel_image() {  
  dialog \  
  --backtitle "$TITLE" \  
  --infobox "Installiere den System-Kernel ..." 3 70  
   
 }  
   
 dialog_install_hotfixes() {  
  dialog \  
  --backtitle "$TITLE" \  
  --infobox "Installiere Hotfixes ..." 3 70  
   
 }  
   
 dialog_install_successful() {  
  dialog \  
  --backtitle "$TITLE" \  
394   --colors \   --colors \
395   --msgbox "Die Installation war \Z2erfolgreich\Zn." 5 81   --msgbox "Die Installation war \Z2erfolgreich\Zn." 5 81
396  }  }
397    
398  dialog_install_failure() {  dialog_install_failure()
399    {
400   dialog \   dialog \
401   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
402   --colors \   --colors \
403   --msgbox "Die Installation ist \Z1Fehlgeschlagen\Zn.\n\n\   --msgbox "Die Installation ist \Z1Fehlgeschlagen\Zn.\n\n\
404   Fehler bei $ERROR, RetVal: $RETVAL \   Fehler bei ${ERROR}, RetVal: ${RETVAL} \
405   " 10 81   " 10 81
406  }  }
407    
408  dialog_install_method() {  dialog_main()
409    {
  METHOD=`dialog \  
  --backtitle "$TITLE" \  
  --cancel-label "Abbrechen" \  
  --ok-label "Weiter" \  
  --stdout \  
  --menu "Konfiguration" 14 70 5 \  
  "1" "Normale Installation" \  
  "2" "Silent Installation"`  
  RES=$?  
  if [ "$RES" == "1" ];then  
  return 1  
  fi  
  if [ "$RES" == "0" ];then  
  case "$METHOD" in  
          "1")  
  run_install_normal  
  ;;  
  "2")  
  dialog_warning  
  run_install_silent  
      ;;  
  esac  
  fi  
 }  
   
 dialog_main() {  
410   METHOD=0   METHOD=0
411    
412   while [ $METHOD -le 2 ]   while [[ ${METHOD} -le 2 ]]
413   do   do
414   METHOD=`dialog \   METHOD=$(dialog \
415   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
416   --no-cancel \   --no-cancel \
417   --ok-label "Weiter" \   --ok-label "Weiter" \
418   --stdout \   --stdout \
# Line 371  dialog_main() { Line 420  dialog_main() {
420   "1" "AutoSta_LX installieren" \   "1" "AutoSta_LX installieren" \
421   "2" "Uebersicht gefundener Laufwerke" \   "2" "Uebersicht gefundener Laufwerke" \
422   "3" "Beenden und neustarten" \   "3" "Beenden und neustarten" \
423   "4" "Beenden und eine Shell starten" `   "4" "Beenden und eine Shell starten")
424   RES=$?   RES=$?
425   if [ "$RES" == "1" ];then   [[ ${RES} -eq 1 ]] && exit 1
426   exit 1   if [[ ${RES} -eq 0 ]]
427   fi   then
428   if [ "$RES" == "0" ];then   case ${METHOD} in
429   case "$METHOD" in           "1") dialog_setup_system_menu ;;
430           "1")   "2") dialog_hardware_detection ;;
431   #only for now later it will be used again   "3") install_do_reboot ;;
432   #with 6.1-r2 only one install method available   "4") /bin/bash --login -i ;;
  #dialog_install_method  
  #run_install_normal  
  dialog_setup_system_menu  
  ;;  
  "2") dialog_setup_hdd_found_manuell  
  ;;  
  "3") install_do_reboot  
  ;;  
  "4") /bin/bash --login -i  
  ;;  
433   esac   esac
434   fi   fi
435   done   done
# Line 399  dialog_main() { Line 438  dialog_main() {
438  #################################################  #################################################
439  # Install Komandos #  # Install Komandos #
440  #################################################  #################################################
441  setup_hdd_partitions_manuell() {  run_hardware_detection()
442    {
443     local hwinfo
444    
445     hwinfo="$(hwinfo --bios --storage)"
446    
447     # check for special devices/clients:
448     # if zotac a zotac and the disk is a removeable device, then add rootdelay to kernelcmd
449     local removable=0
450     if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]]
451     then
452     for i in /sys/block/[hs]d*/removable
453     do
454     if [[ $(< ${i}) = 1 ]]
455     then
456     removable=1
457     fi
458     done
459    
460     # only add this for grub legacy, grub2 detect these settings on its own
461     export GRUBLEGACYOPTS="rootdelay=8"
462     export SPECIALDEVICE="zotac"
463     fi
464    
465     # check for special devices/clients:
466     # if a rangee and disk ist smaller then 256mb move partion one block further ahead
467     if [[ ! -z $(echo "${hwinfo}" | grep -i CLE266) ]]
468     then
469     # for a rangee always define partion startblock +1
470     export FDISKPARTIONBELOW256MB="1"
471     export SPECIALDEVICE="rangee"
472     export GRUBLEGACYOPTS=""
473     fi
474    }
475    
476    hdd_size_below_256mb()
477    {
478     local hdd="$1"
479     local size
480     local retval
481     [[ -z ${hdd} ]] && die "Error: get_hdd_size() no \$hdd given!"
482    
483     size=$(fdisk -l ${hdd} | grep "Disk.*${hdd}" | sed 's:.*,\ \(.*\)\ byte.*:\1:')
484     if [[ ${size} -le 257000000 ]]
485     then
486     retval="0"
487     else
488     retval="1"
489     fi
490    
491     return "${retval}"
492    }
493    
494    setup_hdd_partitions_auto()
495    {
496     ROOTHDD="${HDD}1"
497    
498     # run this only if FDISKPARTITIONBELOW256MB is not already 1
499     if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]
500     then
501     if hdd_size_below_256mb ${HDD}
502     then
503     FDISKPARTIONBELOW256MB=1
504     else
505     FDISKPARTIONBELOW256MB=0
506     fi
507     fi
508    
509     ## delete disk
510     dd if=/dev/zero of=${HDD} count=1 &> /dev/null || die
511    
512     if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
513     then
514     ## setup one bootable partition
515     #1. n= new disk
516     #2. p= primary disk
517     #3. 1= first partition
518     #4. 2= default sector start // small disk needs more space for grub2 mbr sector
519     #5. ''= defaul sector end
520     #6. a= bootable flag
521     #7. 1= boot flag for partition 1
522     #8. w= write/quit
523     fdisk ${HDD} &> /dev/null << EOF
524    n
525    p
526    1
527    2
528    
529    a
530    1
531    w
532    EOF
533     else
534     ## setup one bootable partition
535     #1. n= new disk
536     #2. p= primary disk
537     #3. 1= first partition
538     #4. ''= default sector start
539     #5. ''= defaul sector end
540     #6. a= bootable flag
541     #7. 1= boot flag for partition 1
542     #8. w= write/quit
543     fdisk ${HDD} &> /dev/null << EOF
544    n
545    p
546    1
547    
548    
549    a
550    1
551    w
552    EOF
553     fi
554    }
555    
556    setup_hdd_partitions_manuell()
557    {
558   BOOTHDD="${HDD}1"   BOOTHDD="${HDD}1"
559   SWAPHDD="${HDD}2"   SWAPHDD="${HDD}2"
560   ROOTHDD="${HDD}3"   ROOTHDD="${HDD}3"
561    
562   ## hdds partitionieren manuell   ## hdds partitionieren manuell
563   cfdisk $HDD || die   cfdisk ${HDD} || die
564  }  }
565    
566  setup_hdd_partitions_manuell_flash() {  setup_hdd_partitions_manuell_flash()
567    {
568   ROOTHDD="${HDD}1"   ROOTHDD="${HDD}1"
569    
570   ## hdds partitionieren manuell   ## hdds partitionieren manuell
571   cfdisk $HDD || die   cfdisk ${HDD} || die
 }  
   
 setup_hdd_partitions_silent() {  
  ## hdds löschen  
  dd if=/dev/zero of=$HDD bs=1024k count=1 || die  
  ## hdds partitionieren silent  
  fdisk $HDD < $CONFIGS_TEMPLATE/fdisksettings #1> /dev/null 3> /dev/null || die  
   
  read  
572  }  }
573    
574  setup_hdd_format() {  setup_hdd_format()
575   mkswap $SWAPHDD || die  {
576   mke2fs -j -q $BOOTHDD || die   mkswap ${SWAPHDD} || die
577   mke2fs -j -q $ROOTHDD || die   mke2fs -j -q ${BOOTHDD} || die
578     mke2fs -j -q ${ROOTHDD} || die
579  }  }
580    
581  setup_hdd_format_flash() {  setup_hdd_format_flash()
582  # mkswap $SWAPHDD || die  {
583  # mke2fs -j -q $BOOTHDD || die   mke2fs -j -q ${ROOTHDD} || die
  mke2fs -j -q $ROOTHDD || die  
584  }  }
585    
586  install_mount_rootfs() {  install_mount_rootfs()
587   swapon $SWAPHDD || die  {
588   mount $ROOTHDD $INSTALLPATH || die   swapon ${SWAPHDD} || die
589   install -d $INSTALLPATH/boot || die   mount ${ROOTHDD} ${INSTALLPATH} || die
590   mount $BOOTHDD $INSTALLPATH/boot || die   install -d ${INSTALLPATH}/boot || die
591   cd $INSTALLPATH || die   mount ${BOOTHDD} ${INSTALLPATH}/boot || die
592     cd ${INSTALLPATH} || die
593  }  }
594    
595  install_mount_rootfs_flash() {  install_mount_rootfs_flash()
596  # swapon $SWAPHDD || die  {
597   mount $ROOTHDD $INSTALLPATH || die   mount ${ROOTHDD} ${INSTALLPATH} || die
598   install -d $INSTALLPATH/boot || die   install -d ${INSTALLPATH}/boot || die
599  # mount $BOOTHDD $INSTALLPATH/boot || die   cd ${INSTALLPATH} || die
  cd $INSTALLPATH || die  
600  }  }
601    
602  install_system_image() {  install_system_image()
603   #tar xvzpf $CDPATH/system/autosta_lx.tar.gz  {
604   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}
605  }  }
606    
607    install_bootsector_chroot()
608    {
609     local my_roothdd
610     local grubconf=${INSTALLPATH}/boot/grub/grub.conf
611     local grub2conf=/boot/grub/grub.cfg
612    
613  install_kernel_image() {   # check for grub2
614   declare -i CPUTYPE=`cat /proc/cpuinfo |grep "cpu family"|cut -d ' ' -f3`   if [[ -f ${INSTALLPATH}/sbin/grub-mkconfig ]]
   
  if [ $CPUTYPE -le 5 ];then  
                 #echo -e "\033[1;6m\033[36m""i386 Architektur gefunden.""\033[0m"  
                 #echo -e "Installiere i386 Kernel..."  
   
  lastdir="`pwd`"  
   
  mkdir -p $INSTALLPATH/INSTALL/kernel || die  
  cd $INSTALLPATH/INSTALL/kernel || die  
  tar xzpf $CDPATH/kernels/kernel-i386.tar.gz || die  
  source $INSTALLPATH/INSTALL/kernel/kernelversion || die  
   
  cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNLIB $INSTALLPATH/lib/modules || die  
  cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNIMG $INSTALLPATH/boot || die  
  cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNINITRD $INSTALLPATH/boot || die  
  cp -aRf $INSTALLPATH/INSTALL/kernel/kernelversion $INSTALLPATH/boot || die  
   
  cd $lastdir || die  
   
         elif [ $CPUTYPE -ge 6 ];then  
                 #echo -e "\033[1;6m\033[36m""i686 Architektur gefunden.""\033[0m"  
                 #echo -e "Installiere i686 Kernel..."  
   
  lastdir="`pwd`"  
   
  mkdir -p $INSTALLPATH/INSTALL/kernel || die  
  cd $INSTALLPATH/INSTALL/kernel || die  
  tar xzpf $CDPATH/kernels/kernel-i686.tar.gz || die  
  source $INSTALLPATH/INSTALL/kernel/kernelversion || die  
   
  cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNLIB $INSTALLPATH/lib/modules || die  
  cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNIMG $INSTALLPATH/boot || die  
  cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNINITRD $INSTALLPATH/boot || die  
  cp -aRf $INSTALLPATH/INSTALL/kernel/kernelversion $INSTALLPATH/boot || die  
   
  cd $lastdir || die  
         fi  
 }  
   
 install_bootsector() {  
  ### grubconf schreiben  
  source $INSTALLPATH/INSTALL/kernel/kernelversion  
   
  if [ -z $KRNVER ]  
  then  
  KRNVER="AutoSta_LX"  
  fi  
   
  if [ -z $KRNIMG ]  
615   then   then
616   KRNIMG="bzImage"   # needed by grub-mkconfig on the first run
617   fi   if [[ ! -f ${INSTALLPATH}/boot/grub/video.lst ]]
618     then
619     install -m0644 ${INSTALLPATH}/lib/grub/*/video.lst ${INSTALLPATH}/boot/grub/video.lst || die
620     fi
621    
622   if [ -z $KRNINITRD ]   # set kernelopts
623   then   if [[ -f ${INSTALLPATH}/etc/conf.d/grub ]]
624   KRNINITRD="initrd"   then
625   fi   sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLPATH}/etc/conf.d/grub || die
626     else
627     echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALLPATH}/etc/conf.d/grub || die
628     fi
629     echo 'grub-mkdevicemap' > ${INSTALLPATH}/root/.installrc || die
630     echo "LC_ALL=C grub-mkconfig -o ${grub2conf}  &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die
631     echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die
632     echo "exit 0" >> ${INSTALLPATH}/root/.installrc || die
633    
634   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die   # grub-legacy
635   echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die   else
636   #no support for splash image in 6.1-r2   ### grubconf schreiben
637   #echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die   source ${INSTALLPATH}/boot/kernelversion
  echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die  
  echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die  
   
  #s3 cards don't support this  
  #echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD vga=0x317 video:vesa:ywrap,mtrr splash=silent quiet" >> $INSTALLPATH/boot/grub/grub.conf || die  
  #that's more safer:  
  echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD quiet" >> $INSTALLPATH/boot/grub/grub.conf || die  
   
  #not needed without bootsplash support  
  #echo -e "initrd=/boot/${KRNINITRD}" >> $INSTALLPATH/boot/grub/grub.conf || die  
638    
639   ### bootsector schreiben   #for alx only
640   #grub --no-floppy < $CONFIGS_TEMPLATE/grubsettings || die   if [ -e ${INSTALLPATH}/etc/alx_version ]
641   /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null || die   then
642  root (hd0,0)   OLD_ALXVER="${ALXVER}"
643  setup (hd0)   source ${INSTALLPATH}/etc/alx_version
644  quit   KRNVER="ALX-${ALXVER}"
645  EOF   ALXVER="${OLD_ALXVER}"
646  }   fi
647    
648  install_bootsector_chroot() {   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"
649   ### grubconf schreiben   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"
650   #source $INSTALLPATH/INSTALL/kernel/kernelversion   [[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz"
  source $INSTALLPATH/boot/kernelversion  
   
  #for alx only  
  if [ -e ${INSTALLPATH}/etc/alx_version ]  
  then  
  OLD_ALXVER="${ALXVER}"  
  source ${INSTALLPATH}/etc/alx_version  
  KRNVER="ALX-${ALXVER}"  
  ALXVER="${OLD_ALXVER}"  
  fi  
   
  if [ -z "$KRNVER" ]  
  then  
  KRNVER="AutoSta_LX"  
  fi  
651    
652   if [ -z "$KRNIMG" ]   # uuid support
653   then   if is_uuid_supported
654   KRNIMG="bzImage"   then
655   fi   my_roothdd="UUID=$(get_uuid ${ROOTHDD})"
656     else
657     my_roothdd="${ROOTHDD}"
658     fi
659    
660   if [ -z "$KRNINITRD" ]   : > ${grubconf} || die
661   then   echo "default 0" >> ${grubconf} || die
662   KRNINITRD="initrd"   echo "timeout 3" >> ${grubconf} || die
663   fi   # using current root password
664     echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die
665    
666     echo  >> ${grubconf} || die
667     echo "# normal boot" >> ${grubconf} || die
668     echo "title ${KRNVER}" >> ${grubconf} || die
669     echo "root (hd0,0)" >> ${grubconf} || die
670     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" >> ${grubconf} || die
671     if is_initrd_supported
672     then
673     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
674     fi
675    
676   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die   echo >> ${grubconf} || die
677   echo -e "timeout 0" >> $INSTALLPATH/boot/grub/grub.conf ||die   echo "# admin boot" >> ${grubconf} || die
678     echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die
679   #no support for splash image in 6.1-r2   echo "lock"  >> ${grubconf} || die
680   #echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die   echo "root (hd0,0)" >> ${grubconf} || die
681     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" >> ${grubconf} || die
682   echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die   if is_initrd_supported
683   echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die   then
684     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
685   #s3 cards don't support this   fi
  #echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD vga=0x317 video:vesa:ywrap,mtrr splash=silent quiet" >> $INSTALLPATH/boot/grub/grub.conf || die  
  #that's more safer:  
  echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD quiet" >> $INSTALLPATH/boot/grub/grub.conf || die  
   
  #not needed without bootsplash support  
  #echo -e "initrd=/boot/${KRNINITRD}" >> $INSTALLPATH/boot/grub/grub.conf || die  
686    
687     echo >> ${grubconf} || die
688     echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die
689     echo "lock"  >> ${grubconf} || die
690     echo "root (hd0,0)" >> ${grubconf} || die
691     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" >> ${grubconf} || die
692     if is_initrd_supported
693     then
694     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
695     fi
696    
697   ### bootsector schreiben chrooted schreiben (gentoo)   # bootsector schreiben chrooted schreiben (lfs/magellan)
698   if [ -f $INSTALLPATH/sbin/grub ]   cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF
699   then  /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null
  cat > $INSTALLPATH/root/.bashrc << CHROOTEOF  
 /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null  
700  root (hd0,0)  root (hd0,0)
701  setup (hd0)  setup (hd0)
702  quit  quit
# Line 602  exit 0 Line 705  exit 0
705  CHROOTEOF  CHROOTEOF
706   fi   fi
707    
708   ### bootsector schreiben chrooted schreiben (lfs/magellan)   ## enters chroot
709   if [ -f $INSTALLPATH/usr/sbin/grub ]   mount -t proc proc ${INSTALLPATH}/proc
710   then   mount -t sysfs sysfs ${INSTALLPATH}/sys
711   cat > $INSTALLPATH/root/.bashrc << CHROOTEOF   mount -o bind /dev ${INSTALLPATH}/dev
712  /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null   chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i
713  root (hd0,0)   umount ${INSTALLPATH}/proc
714  setup (hd0)   umount ${INSTALLPATH}/sys
715  quit   umount ${INSTALLPATH}/dev
716  EOF   rm ${INSTALLPATH}/root/.installrc
717    }
718    
719    is_initrd_supported()
720    {
721     # only generate initrds if the cmd exists
722     [[ -x ${INSTALLPATH}/sbin/mkinitrd ]] && return 0
723     return 1
724    }
725    
726    install_initrd_chroot()
727    {
728     # only generate initrds if the cmd exists
729     is_initrd_supported || return 0
730    
731     DISKMODS="sd_mod"
732     OLDPATAMODS="amd74xx piix sis5513 via82cxxx"
733     PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via"
734     SATAMODS="sata_via sata_sis sata_nv"
735     DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via"
736     FBMODS="uvesafb"
737    
738     # install an appropriate uvesafb.conf
739     install -d ${INSTALLPATH}/etc/modprobe.d || die
740     echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLPATH}/etc/modprobe.d/uvesafb.conf || die
741    
742     cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF
743    echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS}\"" > /etc/conf.d/mkinitrd
744    mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null
745  exit 0  exit 0
746  CHROOTEOF  CHROOTEOF
747    
748     ## enters chroot
749     mount -t proc proc ${INSTALLPATH}/proc
750     mount -t sysfs sysfs ${INSTALLPATH}/sys
751     mount -o bind /dev ${INSTALLPATH}/dev
752     chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i
753     umount ${INSTALLPATH}/proc
754     umount ${INSTALLPATH}/sys
755     umount ${INSTALLPATH}/dev
756     rm ${INSTALLPATH}/root/.installrc
757    }
758    
759    is_uuid_supported()
760    {
761     if [[ -x $(which busybox.mkinitrd &> /dev/null) ]]
762     then
763     # only detect uuids if supported
764     if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]
765     then
766     return 0
767     fi
768   fi   fi
769    
770   ##enters chroot   return 1
  mount -t proc none $INSTALLPATH/proc  
  # bind /dev to get the devices right,  
  # if bootet from a 2.6 kernel with udev  
  mount -o bind /dev $INSTALLPATH/dev  
  chroot $INSTALLPATH /bin/bash --rcfile /root/.bashrc -i  
  umount $INSTALLPATH/proc  
  umount $INSTALLPATH/dev  
  rm $INSTALLPATH/root/.bashrc  
 }  
   
 install_alxconfig(){  
  lastdir="`pwd`"  
   
  mkdir -p $INSTALLPATH/opt/alx-config || die  
  cd $INSTALLPATH/opt/alx-config || die  
  tar xzpf $CDPATH/alx-config/alx-config.tar.gz || die  
  chmod a+x $INSTALLPATH/opt/alx-config/Configurator/config_functions.sh || die  
  chmod a+x $INSTALLPATH/opt/alx-config/Configurator/config_menu.sh || die  
  ln -sf /opt/alx-config/Configurator/config_menu.sh $INSTALLPATH/bin/ALXConfig || die  
   
  cd $lastdir || die  
771  }  }
772    
773    get_uuid()
774    {
775     local UUID
776     local SEC_TYPE
777     local TYPE
778    
779  install_system_settings(){   local dev="$1"
780   ### schreibe fstab   [[ -z ${dev} ]] && die "no dev given"
  echo -e "$BOOTHDD\t/boot\text3\tnoatime,noauto\t1 1" > $INSTALLPATH/etc/fstab || die  
  echo -e "$ROOTHDD\t/\text3\tnoatime\t0 0" >> $INSTALLPATH/etc/fstab || die  
  echo -e "$SWAPHDD\tswap\tswap\tpri=1\t0 0" >> $INSTALLPATH/etc/fstab || die  
  echo -e "none\t/proc\tproc\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die  
   
  #deprecated  
  #echo -e "devpts\t/dev/pts\tdevpts\tgid=4,mode=620\t0 0" >> $INSTALLPATH/etc/fstab || die  
781    
782   echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   # check if given device is already an UUID
783   echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   if [[ ${dev/UUID=/}x != ${dev}x ]]
784     then
785     eval "${dev}"
786     else
787     eval $(busybox.mkinitrd blkid ${dev} | grep "${dev}:" | sed 's/.*:\ //')
788     fi
789     echo "${UUID}"
790  }  }
791    
792  install_system_settings_flash(){  install_system_settings()
793   ### schreibe fstab  {
794  # echo -e "$BOOTHDD\t/boot\text3\tnoatime,noauto\t1 1" > $INSTALLPATH/etc/fstab || die   # schreibe fstab
795   echo -e "$ROOTHDD\t/\text3\tnoatime\t0 0" > $INSTALLPATH/etc/fstab || die   if is_uuid_supported
796  # echo -e "$SWAPHDD\tswap\tswap\tpri=1\t0 0" >> $INSTALLPATH/etc/fstab || die   then
797   echo -e "none\t/proc\tproc\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die
798     echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die
799   #deprecated   else
800   #echo -e "devpts\t/dev/pts\tdevpts\tgid=4,mode=620\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die
801     echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die
802     fi
803     # not needed busybox loads all with swapon -a, even if not mentioned in fstab
804     #echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die
805     echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
806     echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
807    
808   echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   # install network config skeleton
809   echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || die
810  }  }
811  install_hotfixes(){  
812   if [ -f $CDPATH/hotfixes/hotfixes.sh ]  install_system_settings_flash()
813    {
814     # schreibe fstab
815     if is_uuid_supported
816   then   then
817   dialog_hotfixes   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die
818   sleep1   else
819   $CDPATH/hotfixes/hotfixes.sh   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die
820   fi   fi
821     echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
822     echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
823  }  }
824    
825  install_umount_rootfs() {  install_umount_rootfs()
826    {
827   cd /   cd /
828   umount $INSTALLPATH/boot || die   umount ${INSTALLPATH}/boot || die
829   umount $INSTALLPATH || die   umount ${INSTALLPATH} || die
830   swapoff $SWAPHDD || die   swapoff ${SWAPHDD} || die
831  }  }
832    
833  install_umount_rootfs_flash() {  install_umount_rootfs_flash()
834    {
835   cd /   cd /
836  # umount $INSTALLPATH/boot || die   umount ${INSTALLPATH} || die
  umount $INSTALLPATH || die  
 # swapoff $SWAPHDD || die  
837  }  }
838    
839  install_do_reboot() {  install_do_reboot()
840    {
  #only for now later it will be used again  
  #with 6.1-r2 these options are not available  
  #cd /  
  #umount $CDPATH  
  #eject  
  #clear  
   
841   reboot   reboot
842  }  }
843    
# Line 706  install_do_reboot() { Line 845  install_do_reboot() {
845  #     Install Ablauf Scripte #  #     Install Ablauf Scripte #
846  #################################################  #################################################
847    
848  run_install_normal() {  run_install_normal()
849   #only for now later it will be used again  {
850   #with 6.1-r2 only one install method available   dialog_hardware_detection
851   #dialog_setup_hdd_menu  
  dialog_setup_hdd_found_manuell  
   
852   dialog_setup_hdd_partitions_manuell   dialog_setup_hdd_partitions_manuell
853   dialog_setup_hdd_format   dialog_setup_hdd_format
854   setup_hdd_format > /dev/null   setup_hdd_format > /dev/null
855   install_mount_rootfs   install_mount_rootfs
856   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
857    
  #only for now later it will be used again  
  #with 6.1-r2 variable kernels are not available  
  #dialog_install_kernel_image  
  #install_kernel_image  
   
  dialog_install_bootsector  
  install_bootsector_chroot  
   
  #only for now later it will be used again  
  #with 6.1-r2 highest version of alx-config is already included  
  #dialog_install_alxconfig  
  #sleep 1  
  #install_alxconfig  
   
858   dialog_install_settings   dialog_install_settings
859   sleep 1   sleep 1
860   install_system_settings   install_system_settings
861   install_hotfixes   install_initrd_chroot
862    
863     dialog_install_bootsector
864     install_bootsector_chroot
865    
866   install_umount_rootfs   install_umount_rootfs
867   dialog_install_successful   dialog_install_successful
868  }  }
869    
870  run_install_flash() {  run_install_flash()
871   #only for now later it will be used again  {
872   #with 6.1-r2 only one install method available   dialog_hardware_detection
873   #dialog_setup_hdd_menu  
  dialog_setup_hdd_found_manuell  
   
874   dialog_setup_hdd_partitions_manuell_flash   dialog_setup_hdd_partitions_manuell_flash
875   dialog_setup_hdd_format   dialog_setup_hdd_format
876   setup_hdd_format_flash > /dev/null   setup_hdd_format_flash > /dev/null
877   install_mount_rootfs_flash   install_mount_rootfs_flash
878   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
879    
  #only for now later it will be used again  
  #with 6.1-r2 variable kernels are not available  
  #dialog_install_kernel_image  
  #install_kernel_image  
   
  dialog_install_bootsector  
  install_bootsector_chroot  
   
  #only for now later it will be used again  
  #with 6.1-r2 highest version of alx-config is already included  
  #dialog_install_alxconfig  
  #sleep 1  
  #install_alxconfig  
   
880   dialog_install_settings   dialog_install_settings
881   sleep 1   sleep 1
882   install_system_settings_flash   install_system_settings_flash
883   install_hotfixes   install_initrd_chroot
884    
885     dialog_install_bootsector
886     install_bootsector_chroot
887    
888   install_umount_rootfs_flash   install_umount_rootfs_flash
889   dialog_install_successful   dialog_install_successful
890  }  }
891    
892  run_install_silent() {  run_install_auto()
893   echo "starting silent install ..."  {
894   sleep 1   dialog_hardware_detection
 }  
895    
896  run_install_unattended() {   dialog_setup_hdd_partitions_auto
897   echo "starting unattended install ..."   dialog_setup_hdd_format
898     setup_hdd_format_flash > /dev/null
899     install_mount_rootfs_flash
900     (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
901    
902     dialog_install_settings
903   sleep 1   sleep 1
904     install_system_settings_flash
905     install_initrd_chroot
906    
907     dialog_install_bootsector
908     install_bootsector_chroot
909    
910     install_umount_rootfs_flash
911     dialog_install_successful
912  }  }
913    
914  if [ "$1" == "unattended" ]  dialog_main
 then  
  run_install_unattended  
 else  
  dialog_main  
 fi  
915    
916  exit 0  exit 0

Legend:
Removed from v.280  
changed lines
  Added in v.3199