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

revision 260 by niro, Mon Apr 18 20:27:57 2005 UTC revision 1579 by niro, Mon Oct 18 14:21:27 2010 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.2 2005-04-18 20:27:57 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.1"  VERSION="0.3.6"
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    # standart kernel opts
35    KERNELOPTS="quiet"
36    
37    # default specialdevices
38    SPECIALDEVICE=""
39    
40  #################################################  #################################################
41  #  DIALOG BOXEN #  #  DIALOG BOXEN #
42  #################################################  #################################################
43    
44  die() {  die()
45   #clear  {
  #echo -e "\nhuch, da ist ein script gestorben -> $?\n"  
  #read  
  #exit 0  
46   ERROR=$1   ERROR=$1
47   RETVAL=$?   RETVAL=$?
48   dialog_install_failure   dialog_install_failure
49   exit 1   exit 1
50  }  }
51    
52  dialog_warning() {  dialog_warning()
53    {
54   dialog \   dialog \
55   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
56   --colors \   --colors \
57   --defaultno \   --defaultno \
58   --yesno "\Z1 !!! Achtung !!! \Zn\n\n\   --yesno "\Z1 !!! Achtung !!! \Zn\n\n\
59   Diese Festplatte wird unwiederruflich geloescht werden.\n\n\   Diese Festplatte wird unwiederruflich geloescht werden.\n\n\
60   Soll ich wirklich fortfahren ?" 10 70   Soll ich wirklich fortfahren ?" 10 70
61   RES=$?   RES=$?
62   if [ "$RES" == "1" ]   if [[ ${RES} -eq 1 ]]
63   then   then
64   clear   clear
65   echo "Der Vorgang wurde abgebrochen."   echo "Der Vorgang wurde abgebrochen."
# Line 72  dialog_warning() { Line 67  dialog_warning() {
67   fi   fi
68  }  }
69    
70  dialog_setup_hdd_info(){  dialog_setup_hdd_info()
71   local SHDD="`echo $HDD|sed -e 's/\/dev\///'`"  {
72     local SHDD="$(echo ${HDD} | sed 's/\/dev\///')"
73    
74   dialog \   dialog \
75   --colors \   --colors \
76   --title "[ Festplatten Partitionierung ]" \   --title "[ Festplatten Partitionierung ]" \
77   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
78   --ok-label "Weiter" \   --ok-label "Weiter" \
79   --msgbox "\nBitte legen Sie 3 Partitionen an.\n\n\   --msgbox "\nBitte legen Sie 3 Partitionen an.\n\n\
80   [ \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 83  dialog_setup_hdd_info(){
83   Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81   Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81
84  }  }
85    
86  dialog_setup_hdd_menu() {  dialog_setup_hdd_info_flash()
87    {
88     local SHDD="$(echo $HDD | sed 's/\/dev\///')"
89    
90     dialog \
91     --colors \
92     --title "[ Festplatten Partitionierung ]" \
93     --backtitle "${TITLE}" \
94     --ok-label "Weiter" \
95     --msgbox "\nBitte legen Sie 1 Partition an.\n\n\
96     [ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit dem gesamten Speicher\n\
97     Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81
98    }
99    
100    dialog_setup_hdd_info_auto()
101    {
102     local SHDD="$(echo $HDD | sed 's/\/dev\///')"
103    
104     dialog \
105     --colors \
106     --title "[ Festplatten Partitionierung ]" \
107     --backtitle "${TITLE}" \
108     --ok-label "Weiter" \
109     --msgbox "\nAchtung!\n\
110     Alle Daten werden von der Disk [ \Z3${HDD}\Zn ] gelöscht!" 12 81
111    }
112    
113    dialog_setup_system_menu()
114    {
115     local i
116    
117   I=`dialog \   i=$(dialog \
118   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
119   --title "[ Festplatten Partitionierung ]" \   --title "[ Festplatten Partitionierung ]" \
120   --cancel-label "Abbrechen" \   --cancel-label "Abbrechen" \
121   --ok-label "Weiter" \   --ok-label "Weiter" \
122   --stdout \   --stdout \
123   --menu "\nWaehlen Sie zwischen Manuell und Automatisch" 14 70 5 \   --colors \
124   "1" "Manuell" \   --menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \
125   "2" "Automatisch"`   "1" "Automatisches Setup (Empfohlen)" \
126     "" "" \
127     "" "\Z1Experten Modi:\Zn" \
128     "2" "Normale IDE-Disk (Manuell)" \
129     "3" "Flash-Speicher (Manuell)")
130   RES=$?   RES=$?
131   if [ "$RES" == "1" ];then   [[ ${RES} -eq 1 ]] && return 1
132   return 1   if [[ ${RES} -eq 0 ]]
133   fi   then
134   if [ "$RES" == "0" ];then   case "${i}" in
135   case "$I" in   "1") run_install_auto ;;
136           "1")           "2") run_install_normal ;;
137   dialog_setup_hdd_found_manuell   "3") run_install_flash ;;
138   ;;   "") dialog_setup_system_menu;;
  "2")  
  dialog_warning  
  setup_hdd_partitions_silent  
      ;;  
139   esac   esac
140   fi   fi
141  }  }
142    
143  dialog_setup_hdd_found_manuell() {  dialog_hardware_detection()
144   if [ ! -z "$installdevs" ]  {
145     local i
146     local hwtmp
147    
148     if [ -x $(which mktemp &> /dev/null) ]
149   then   then
150   installdevs=""   hwtmp="$(mktemp)"
151     else
152     hwtmp="/tmp/hwtmp.sh"
153   fi   fi
154    
155   echo "dialog \\"  > /tmp/hddtmp.sh   [[ ! -z ${installdevs} ]] && installdevs=""
156   echo "--backtitle \"$TITLE\" \\" >> /tmp/hddtmp.sh  
157   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh   echo "dialog \\"  > ${hwtmp}
158   echo "--stdout \\" >> /tmp/hddtmp.sh   echo "--backtitle \"${TITLE}\" \\" >> ${hwtmp}
159   echo "--colors \\" >> /tmp/hddtmp.sh   echo "--ok-label \"Weiter\" \\" >> ${hwtmp}
160   echo "--msgbox \"Gefundene Hardware:\n\n \\" >> /tmp/hddtmp.sh   echo "--stdout \\" >> ${hwtmp}
161   echo " Festplatten:\n \\" >> /tmp/hddtmp.sh   echo "--colors \\" >> ${hwtmp}
162     echo "--msgbox \"Gefundene Hardware:\n\n \\" >> ${hwtmp}
163     echo " Festplatten:\n \\" >> ${hwtmp}
164    
165   if [ ! -z "$scsidisks" ]   if [[ ! -z ${scsidisks} ]]
166   then   then
167   for I in $scsidisks   for i in ${scsidisks}
168   do   do
169   if [ "$I" != "$cdromdev" ]   if [[ ${i} != ${cdromdev} ]]
170   then   then
171   echo " \\Z7SCSI: \\Z3$I\\Zn\n \\" >> /tmp/hddtmp.sh   echo " \\Z7SCSI: \\Z3${i}\\Zn\n \\" >> ${hwtmp}
172   installdevs="$installdevs $I"   installdevs="${installdevs} ${i}"
173   fi   fi
174   done   done
175   fi   fi
176    
177   if [ ! -z "$idedisks" ]   if [[ ! -z ${idedisks} ]]
178   then   then
179   for I in $idedisks   for i in ${idedisks}
180   do   do
181   if [ "$I" != "$cdromdev" ]   if [[ ${i} != ${cdromdev} ]]
182   then   then
183   echo " \\Z7IDE:  \\Z3$I\\Zn\n \\" >> /tmp/hddtmp.sh   echo " \\Z7IDE:  \\Z3${i}\\Zn\n \\" >> ${hwtmp}
184   installdevs="$installdevs $I"   installdevs="${installdevs} ${i}"
185   fi   fi
186   done   done
187   fi   fi
188    
189   if [ ! -z "$cdromdev" ]   if [[ ! -z ${cdromdev} ]]
190   then   then
191   echo " \n \\" >> /tmp/hddtmp.sh   echo " \n \\" >> ${hwtmp}
192   echo " \\Z7andere Laufwerke:\n \\" >> /tmp/hddtmp.sh   echo " \\Z7andere Laufwerke:\n \\" >> ${hwtmp}
193   echo " CDROM: \\Z3$cdromdev\\Zn\n \\" >> /tmp/hddtmp.sh   echo " CDROM: \\Z3${cdromdev}\\Zn\n \\" >> ${hwtmp}
194     fi
195    
196     # other devices
197     run_hardware_detection
198     case "${SPECIALDEVICE}" in
199     zotac) echo " \n\n\n \\Z2Zotac Device erkannt!\\Zn \\" >> ${hwtmp} ;;
200     *) echo " \n\n\n \\ZnStandard Device erkannt!\\Zn \\" >> ${hwtmp} ;;
201     esac
202    
203     echo " \" 13 70" >> ${hwtmp}
204     chmod a+x ${hwtmp}
205     ${hwtmp}
206    
207     # remove tmp file
208     if [[ -f ${hwtmp} ]]
209     then
210     rm ${hwtmp}
211   fi   fi
  echo " \" 13 70" >> /tmp/hddtmp.sh  
  chmod a+x /tmp/hddtmp.sh  
  /tmp/hddtmp.sh  
212  }  }
213    
214  dialog_setup_hdd_partitions_manuell() {  dialog_setup_hdd_partitions_manuell()
215   if [ -z "$installdevs" ]  {
216     local i
217    
218     if [[ -z ${installdevs} ]]
219   then   then
220   dialog \   dialog \
221   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
222   --ok-label "Beenden" \   --ok-label "Beenden" \
223   --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70   --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70
224   exit 1   exit 1
225   else   else
226    
227   echo "dialog \\" > /tmp/hddtmp.sh   echo "dialog \\" > /tmp/hddtmp.sh
228   echo "--backtitle \"$TITLE\" \\" >> /tmp/hddtmp.sh   echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh
229   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh
230   echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh   echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh
231   echo "--stdout \\" >> /tmp/hddtmp.sh   echo "--stdout \\" >> /tmp/hddtmp.sh
232   echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh   echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh
233    
234   for I in $installdevs   for i in ${installdevs}
235   do   do
236   echo "\"$I\" \"\" \\" >> /tmp/hddtmp.sh   echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh
237   done   done
238   echo -e "\n" >> /tmp/hddtmp.sh   echo -e "\n" >> /tmp/hddtmp.sh
239    
240   chmod a+x /tmp/hddtmp.sh   chmod a+x /tmp/hddtmp.sh
241   HDD="`/tmp/hddtmp.sh`"   HDD="$(/tmp/hddtmp.sh)"
242   RES=$?   RES=$?
243   if [ "$RES" == "1" ]   [[ ${RES} -eq 1 ]] && return 1
244   then   if [[ ${RES} -eq 0 ]]
  return 1  
  fi  
  if [ "$RES" == "0" ]  
245   then   then
246   dialog_setup_hdd_info   dialog_setup_hdd_info
247   setup_hdd_partitions_manuell   setup_hdd_partitions_manuell
# Line 202  dialog_setup_hdd_partitions_manuell() { Line 249  dialog_setup_hdd_partitions_manuell() {
249   fi   fi
250  }  }
251    
252  dialog_setup_hdd_partitions_silent() {  dialog_setup_hdd_partitions_manuell_flash()
253    {
254     local i
255    
256     if [[ -z ${installdevs} ]]
257     then
258     dialog \
259     --backtitle "${TITLE}" \
260     --ok-label "Beenden" \
261     --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70
262     exit 1
263     else
264    
265     echo "dialog \\" > /tmp/hddtmp.sh
266     echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh
267     echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh
268     echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh
269     echo "--stdout \\" >> /tmp/hddtmp.sh
270     echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh
271    
272     for i in ${installdevs}
273     do
274     echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh
275     done
276     echo -e "\n" >> /tmp/hddtmp.sh
277    
278     chmod a+x /tmp/hddtmp.sh
279     HDD="$(/tmp/hddtmp.sh)"
280     RES=$?
281     [[ ${RES} -eq 1 ]] && return 1
282     if [[ ${RES} -eq 0 ]]
283     then
284     dialog_setup_hdd_info_flash
285     setup_hdd_partitions_manuell_flash
286     fi
287     fi
288    }
289    
290    dialog_setup_hdd_partitions_auto()
291    {
292     local i
293    
294     if [[ -z ${installdevs} ]]
295     then
296     dialog \
297     --backtitle "${TITLE}" \
298     --ok-label "Beenden" \
299     --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70
300     exit 1
301     else
302    
303     echo "dialog \\" > /tmp/hddtmp.sh
304     echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh
305     echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh
306     echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh
307     echo "--stdout \\" >> /tmp/hddtmp.sh
308     echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh
309    
310     for i in ${installdevs}
311     do
312     echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh
313     done
314     echo -e "\n" >> /tmp/hddtmp.sh
315    
316     chmod a+x /tmp/hddtmp.sh
317     HDD="$(/tmp/hddtmp.sh)"
318     RES=$?
319     [[ ${RES} -eq 1 ]] && return 1
320     if [[ ${RES} -eq 0 ]]
321     then
322     dialog_setup_hdd_info_auto
323     dialog_setup_hdd_create_partitions
324     setup_hdd_partitions_auto
325     fi
326     fi
327    }
328    
329    dialog_setup_hdd_create_partitions()
330    {
331   dialog \   dialog \
332   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
333   --infobox "Erstelle Partitionen ..." 3 70   --infobox "Erstelle Disk Partitionen ..." 3 70
334  }  }
335    
336  dialog_setup_hdd_format() {  dialog_setup_hdd_format()
337    {
338   dialog \   dialog \
339   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
340   --infobox "Erstelle Datei-Systeme ..." 3 70   --infobox "Erstelle Datei-Systeme ..." 3 70
341  }  }
342    
343  dialog_install_settings() {  dialog_install_settings()
344    {
345   dialog \   dialog \
346   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
347   --infobox "Speichere System-Einstellungen ..." 3 70   --infobox "Speichere System-Einstellungen ..." 3 70
348  }  }
349    
350  dialog_install_system_image() {  dialog_install_system_image()
351    {
352   dialog \   dialog \
353   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
354   --gauge "Kopiere System-Image ..." 6 80   --gauge "Kopiere System-Image ..." 6 80
355  }  }
356    
357  dialog_install_meter() {  dialog_install_meter()
358   while [ "${CURRENTLINE}" != "${TOTALLINES}" ] ; do  {
359   CURRENTLINE=`grep --count . /tmp/install.log`   while [[ ${CURRENTLINE} != ${TOTALLINES} ]]
360   PERCENT=`expr ${CURRENTLINE} \* 100 / ${TOTALLINES}`   do
361     CURRENTLINE=$(grep -c . /tmp/install.log)
362     PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES}))
363   echo ${PERCENT}   echo ${PERCENT}
364   sleep 1   sleep 1
365   done   done
# Line 238  dialog_install_meter() { Line 368  dialog_install_meter() {
368  }  }
369    
370    
371  dialog_install_bootsector() {  dialog_install_bootsector()
372    {
373   dialog \   dialog \
374   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
375   --infobox "Schreibe den Bootsektor ..." 3 70   --infobox "Schreibe den Bootsektor ..." 3 70
376  }  }
377    
378  dialog_install_alxconfig() {  dialog_install_successful()
379    {
380   dialog \   dialog \
381   --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" \  
382   --colors \   --colors \
383   --msgbox "Die Installation war \Z2erfolgreich\Zn." 5 81   --msgbox "Die Installation war \Z2erfolgreich\Zn." 5 81
384  }  }
385    
386  dialog_install_failure() {  dialog_install_failure()
387    {
388   dialog \   dialog \
389   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
390   --colors \   --colors \
391   --msgbox "Die Installation ist \Z1Fehlgeschlagen\Zn.\n\n\   --msgbox "Die Installation ist \Z1Fehlgeschlagen\Zn.\n\n\
392   Fehler bei $ERROR, RetVal: $RETVAL \   Fehler bei ${ERROR}, RetVal: ${RETVAL} \
393   " 10 81   " 10 81
394  }  }
395    
396  dialog_install_method() {  dialog_main()
397    {
  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() {  
398   METHOD=0   METHOD=0
399    
400   while [ $METHOD -le 2 ]   while [[ ${METHOD} -le 2 ]]
401   do   do
402   METHOD=`dialog \   METHOD=$(dialog \
403   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
404   --no-cancel \   --no-cancel \
405   --ok-label "Weiter" \   --ok-label "Weiter" \
406   --stdout \   --stdout \
# Line 321  dialog_main() { Line 408  dialog_main() {
408   "1" "AutoSta_LX installieren" \   "1" "AutoSta_LX installieren" \
409   "2" "Uebersicht gefundener Laufwerke" \   "2" "Uebersicht gefundener Laufwerke" \
410   "3" "Beenden und neustarten" \   "3" "Beenden und neustarten" \
411   "4" "Beenden und eine Shell starten" `   "4" "Beenden und eine Shell starten")
412   RES=$?   RES=$?
413   if [ "$RES" == "1" ];then   [[ ${RES} -eq 1 ]] && exit 1
414   exit 1   if [[ ${RES} -eq 0 ]]
415   fi   then
416   if [ "$RES" == "0" ];then   case ${METHOD} in
417   case "$METHOD" in           "1") dialog_setup_system_menu ;;
418           "1")   "2") dialog_hardware_detection ;;
419   #only for now later it will be used again   "3") install_do_reboot ;;
420   #with 6.1-r2 only one install method available   "4") /bin/bash --login -i ;;
  #dialog_install_method  
  run_install_normal  
  ;;  
  "2") dialog_setup_hdd_found_manuell  
  ;;  
  "3") install_do_reboot  
  ;;  
  "4") /bin/bash --login -i  
  ;;  
421   esac   esac
422   fi   fi
423   done   done
# Line 348  dialog_main() { Line 426  dialog_main() {
426  #################################################  #################################################
427  # Install Komandos #  # Install Komandos #
428  #################################################  #################################################
429  setup_hdd_partitions_manuell() {  run_hardware_detection()
430    {
431     # check for special devices/clients:
432     # if zotac a zotac and the disk is a removeable device, then add rootdelay to kernelcmd
433     local removable=0
434     if [[ ! -z $(lspci -v | grep -i zotac) ]]
435     then
436     for i in /sys/block/[hs]d*/removable
437     do
438     if [[ $(< ${i}) = 1 ]]
439     then
440     removable=1
441     fi
442     done
443    
444     export KERNELOPTS="${KERNELOPTS} rootdelay=8"
445     export SPECIALDEVICE="zotac"
446     fi
447    }
448    
449    setup_hdd_partitions_auto()
450    {
451     ROOTHDD="${HDD}1"
452    
453     ## delete disk
454     dd if=/dev/zero of=${HDD} count=1 &> /dev/null || die
455    
456     ## setup one bootable partition
457     #1. n= new disk
458     #2. p= primary disk
459     #3. 1= first partition
460     #4. ''= default sector start
461     #5. ''= defaul sector end
462     #6. a= bootable flag
463     #7. 1= boot flag for partition 1
464     #8. w= write/quit
465     fdisk ${HDD} &> /dev/null << EOF
466    n
467    p
468    1
469    
470    
471    a
472    1
473    w
474    EOF
475    }
476    
477    setup_hdd_partitions_manuell()
478    {
479   BOOTHDD="${HDD}1"   BOOTHDD="${HDD}1"
480   SWAPHDD="${HDD}2"   SWAPHDD="${HDD}2"
481   ROOTHDD="${HDD}3"   ROOTHDD="${HDD}3"
482    
483   ## hdds partitionieren manuell   ## hdds partitionieren manuell
484   cfdisk $HDD || die   cfdisk ${HDD} || die
485  }  }
486    
487  setup_hdd_partitions_silent() {  setup_hdd_partitions_manuell_flash()
488   ## hdds löschen  {
489   dd if=/dev/zero of=$HDD bs=1024k count=1 || die   ROOTHDD="${HDD}1"
  ## hdds partitionieren silent  
  fdisk $HDD < $CONFIGS_TEMPLATE/fdisksettings #1> /dev/null 3> /dev/null || die  
   
  read  
 }  
490    
491  setup_hdd_format() {   ## hdds partitionieren manuell
492   mkswap $SWAPHDD || die   cfdisk ${HDD} || die
  mke2fs -j -q $BOOTHDD || die  
  mke2fs -j -q $ROOTHDD || die  
493  }  }
494    
495  install_mount_rootfs() {  setup_hdd_format()
496   swapon $SWAPHDD || die  {
497   mount $ROOTHDD $INSTALLPATH || die   mkswap ${SWAPHDD} || die
498   install -d $INSTALLPATH/boot || die   mke2fs -j -q ${BOOTHDD} || die
499   mount $BOOTHDD $INSTALLPATH/boot || die   mke2fs -j -q ${ROOTHDD} || die
  cd $INSTALLPATH || die  
500  }  }
501    
502  install_system_image() {  setup_hdd_format_flash()
503   #tar xvzpf $CDPATH/system/autosta_lx.tar.gz  {
504   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}   mke2fs -j -q ${ROOTHDD} || die
505  }  }
506    
507    install_mount_rootfs()
508  install_kernel_image() {  {
509   declare -i CPUTYPE=`cat /proc/cpuinfo |grep "cpu family"|cut -d ' ' -f3`   swapon ${SWAPHDD} || die
510     mount ${ROOTHDD} ${INSTALLPATH} || die
511   if [ $CPUTYPE -le 5 ];then   install -d ${INSTALLPATH}/boot || die
512                  #echo -e "\033[1;6m\033[36m""i386 Architektur gefunden.""\033[0m"   mount ${BOOTHDD} ${INSTALLPATH}/boot || die
513                  #echo -e "Installiere i386 Kernel..."   cd ${INSTALLPATH} || die
   
  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  
514  }  }
515    
516  install_bootsector() {  install_mount_rootfs_flash()
517   ### grubconf schreiben  {
518   source $INSTALLPATH/INSTALL/kernel/kernelversion   mount ${ROOTHDD} ${INSTALLPATH} || die
519     install -d ${INSTALLPATH}/boot || die
520   if [ -z $KRNVER ]   cd ${INSTALLPATH} || die
521   then  }
  KRNVER="AutoSta_LX"  
  fi  
   
  if [ -z $KRNIMG ]  
  then  
  KRNIMG="bzImage"  
  fi  
   
  if [ -z $KRNINITRD ]  
  then  
  KRNINITRD="initrd"  
  fi  
   
  echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die  
  echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die  
  #no support for splash image in 6.1-r2  
  #echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die  
  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  
522    
523   ### bootsector schreiben  install_system_image()
524   #grub --no-floppy < $CONFIGS_TEMPLATE/grubsettings || die  {
525   /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null || die   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}
 root (hd0,0)  
 setup (hd0)  
 quit  
 EOF  
526  }  }
527    
528  install_bootsector_chroot() {  install_bootsector_chroot()
529    {
530     local my_roothdd
531    
532   ### grubconf schreiben   ### grubconf schreiben
533   #source $INSTALLPATH/INSTALL/kernel/kernelversion   source ${INSTALLPATH}/boot/kernelversion
  source $INSTALLPATH/boot/kernelversion  
534    
535   #for alx only   #for alx only
536   if [ -e ${INSTALLPATH}/etc/alx_version ]   if [ -e ${INSTALLPATH}/etc/alx_version ]
# Line 483  install_bootsector_chroot() { Line 540  install_bootsector_chroot() {
540   KRNVER="ALX-${ALXVER}"   KRNVER="ALX-${ALXVER}"
541   ALXVER="${OLD_ALXVER}"   ALXVER="${OLD_ALXVER}"
542   fi   fi
543    
544   if [ -z "$KRNVER" ]   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"
545     [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"
546     [[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz"
547    
548     # uuid support
549     if is_uuid_supported
550   then   then
551   KRNVER="AutoSta_LX"   my_roothdd="UUID=$(get_uuid ${ROOTHDD})"
552     else
553     my_roothdd="${ROOTHDD}"
554   fi   fi
555    
556   if [ -z "$KRNIMG" ]   local grubconf=${INSTALLPATH}/boot/grub/grub.conf
557     : > ${grubconf} || die
558     echo "default 0" >> ${grubconf} || die
559     echo "timeout 3" >> ${grubconf} || die
560     # using current root password
561     echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die
562    
563     echo  >> ${grubconf} || die
564     echo "# normal boot" >> ${grubconf} || die
565     echo "title ${KRNVER}" >> ${grubconf} || die
566     echo "root (hd0,0)" >> ${grubconf} || die
567     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS}" >> ${grubconf} || die
568     if is_initrd_supported
569   then   then
570   KRNIMG="bzImage"   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
571   fi   fi
572    
573   if [ -z "$KRNINITRD" ]   echo >> ${grubconf} || die
574     echo "# admin boot" >> ${grubconf} || die
575     echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die
576     echo "lock"  >> ${grubconf} || die
577     echo "root (hd0,0)" >> ${grubconf} || die
578     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} hardware-auto-detection" >> ${grubconf} || die
579     if is_initrd_supported
580   then   then
581   KRNINITRD="initrd"   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
582   fi   fi
583    
584   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die   echo >> ${grubconf} || die
585   echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die   echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die
586     echo "lock"  >> ${grubconf} || die
587   #no support for splash image in 6.1-r2   echo "root (hd0,0)" >> ${grubconf} || die
588   #echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} alx-reset-settings" >> ${grubconf} || die
589     if is_initrd_supported
  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  
   
   
  ### bootsector schreiben chrooted schreiben (gentoo)  
  if [ -f $INSTALLPATH/sbin/grub ]  
590   then   then
591   cat > $INSTALLPATH/root/.bashrc << CHROOTEOF   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
 /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null  
 root (hd0,0)  
 setup (hd0)  
 quit  
 EOF  
 exit 0  
 CHROOTEOF  
592   fi   fi
593    
594   ### bootsector schreiben chrooted schreiben (lfs/magellan)   # bootsector schreiben chrooted schreiben (lfs/magellan)
595   if [ -f $INSTALLPATH/usr/sbin/grub ]   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF
  then  
  cat > $INSTALLPATH/root/.bashrc << CHROOTEOF  
596  /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null  /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null
597  root (hd0,0)  root (hd0,0)
598  setup (hd0)  setup (hd0)
# Line 541  quit Line 600  quit
600  EOF  EOF
601  exit 0  exit 0
602  CHROOTEOF  CHROOTEOF
603    
604     ## enters chroot
605     mount -t proc proc ${INSTALLPATH}/proc
606     mount -t sysfs sysfs ${INSTALLPATH}/sys
607     mount -o bind /dev ${INSTALLPATH}/dev
608     chroot ${INSTALLPATH} /bin/bash --rcfile /root/.bashrc -i
609     umount ${INSTALLPATH}/proc
610     umount ${INSTALLPATH}/sys
611     umount ${INSTALLPATH}/dev
612     rm ${INSTALLPATH}/root/.bashrc
613    }
614    
615    is_initrd_supported()
616    {
617     # only generate initrds if the cmd exists
618     [[ -x ${INSTALLPATH}/sbin/mkinitrd ]] && return 0
619     return 1
620    }
621    
622    install_initrd_chroot()
623    {
624     # only generate initrds if the cmd exists
625     is_initrd_supported || return 0
626    
627     cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF
628    echo "MODULES=\"ext3 amd74xx piix sis5513 via82cxxx sd_mod ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via sata_via sata_sis sata_nv\"" > /etc/conf.d/mkinitrd
629    mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null
630    exit 0
631    CHROOTEOF
632    
633     ## enters chroot
634     mount -t proc proc ${INSTALLPATH}/proc
635     mount -t sysfs sysfs ${INSTALLPATH}/sys
636     mount -o bind /dev ${INSTALLPATH}/dev
637     chroot ${INSTALLPATH} /bin/bash --rcfile /root/.bashrc -i
638     umount ${INSTALLPATH}/proc
639     umount ${INSTALLPATH}/sys
640     umount ${INSTALLPATH}/dev
641     rm ${INSTALLPATH}/root/.bashrc
642    }
643    
644    is_uuid_supported()
645    {
646     if [[ -x $(which busybox.mkinitrd &> /dev/null) ]]
647     then
648     # only detect uuids if supported
649     if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]
650     then
651     return 0
652     fi
653   fi   fi
654    
655   ##enters chroot   return 1
  mount -t proc proc $INSTALLPATH/proc  
  chroot $INSTALLPATH /bin/bash --rcfile /root/.bashrc -i  
  umount $INSTALLPATH/proc  
  rm $INSTALLPATH/root/.bashrc  
656  }  }
657    
658  install_alxconfig(){  get_uuid()
659   lastdir="`pwd`"  {
660     local UUID
661     local SEC_TYPE
662     local TYPE
663    
664   mkdir -p $INSTALLPATH/opt/alx-config || die   local dev="$1"
665   cd $INSTALLPATH/opt/alx-config || die   [[ -z ${dev} ]] && die "no dev given"
  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  
666    
667   cd $lastdir || die   # check if given device is already an UUID
668     if [[ ${dev/UUID=/}x != ${dev}x ]]
669     then
670     eval "${dev}"
671     else
672     eval $(busybox.mkinitrd blkid ${dev} | grep "${dev}:" | sed 's/.*:\ //')
673     fi
674     echo "${UUID}"
675  }  }
676    
677    install_system_settings()
678    {
679     # schreibe fstab
680     if is_uuid_supported
681     then
682     echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\text3\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die
683     echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\text3\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die
684     else
685     echo -e "${BOOTHDD}\t/boot\text3\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die
686     echo -e "${ROOTHDD}\t/\text3\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die
687     fi
688     # not needed busybox loads all with swapon -a, even if not mentioned in fstab
689     #echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die
690     echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
691     echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
692    
693  install_system_settings(){   # install network config skeleton
694   ### schreibe fstab   install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || die
  echo -e "$BOOTHDD\t/\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  
   
  echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die  
  echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die  
695  }  }
696    
697  install_hotfixes(){  install_system_settings_flash()
698   if [ -f $CDPATH/hotfixes/hotfixes.sh ]  {
699     # schreibe fstab
700     if is_uuid_supported
701   then   then
702   dialog_hotfixes   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\text3\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die
703   sleep1   else
704   $CDPATH/hotfixes/hotfixes.sh   echo -e "${ROOTHDD}\t/\text3\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die
705   fi   fi
706     echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
707     echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
708    }
709    
710    install_umount_rootfs()
711    {
712     cd /
713     umount ${INSTALLPATH}/boot || die
714     umount ${INSTALLPATH} || die
715     swapoff ${SWAPHDD} || die
716  }  }
717    
718  install_umount_rootfs() {  install_umount_rootfs_flash()
719    {
720   cd /   cd /
721   umount $INSTALLPATH/boot || die   umount ${INSTALLPATH} || die
  umount $INSTALLPATH || die  
  swapoff $SWAPHDD || die  
722  }  }
723    
724  install_do_reboot() {  install_do_reboot()
725    {
  #only for now later it will be used again  
  #with 6.1-r2 these options are not available  
  #cd /  
  #umount $CDPATH  
  #eject  
  #clear  
   
726   reboot   reboot
727  }  }
728    
# Line 610  install_do_reboot() { Line 730  install_do_reboot() {
730  #     Install Ablauf Scripte #  #     Install Ablauf Scripte #
731  #################################################  #################################################
732    
733  run_install_normal() {  run_install_normal()
734   #only for now later it will be used again  {
735   #with 6.1-r2 only one install method available   dialog_hardware_detection
736   #dialog_setup_hdd_menu  
  dialog_setup_hdd_found_manuell  
   
737   dialog_setup_hdd_partitions_manuell   dialog_setup_hdd_partitions_manuell
738   dialog_setup_hdd_format   dialog_setup_hdd_format
739   setup_hdd_format > /dev/null   setup_hdd_format > /dev/null
740   install_mount_rootfs   install_mount_rootfs
741   (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
742    
  #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  
   
743   dialog_install_bootsector   dialog_install_bootsector
744   install_bootsector_chroot   install_bootsector_chroot
745    
  #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  
   
746   dialog_install_settings   dialog_install_settings
747   sleep 1   sleep 1
748   install_system_settings   install_system_settings
749   install_hotfixes   install_initrd_chroot
750   install_umount_rootfs   install_umount_rootfs
751   dialog_install_successful   dialog_install_successful
752  }  }
753    
754  run_install_silent() {  run_install_flash()
755   echo "starting silent install ..."  {
756     dialog_hardware_detection
757    
758     dialog_setup_hdd_partitions_manuell_flash
759     dialog_setup_hdd_format
760     setup_hdd_format_flash > /dev/null
761     install_mount_rootfs_flash
762     (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
763    
764     dialog_install_bootsector
765     install_bootsector_chroot
766    
767     dialog_install_settings
768   sleep 1   sleep 1
769     install_system_settings_flash
770     install_initrd_chroot
771     install_umount_rootfs_flash
772     dialog_install_successful
773  }  }
774    
775  run_install_unattended() {  run_install_auto()
776   echo "starting unattended install ..."  {
777     dialog_hardware_detection
778    
779     dialog_setup_hdd_partitions_auto
780     dialog_setup_hdd_format
781     setup_hdd_format_flash > /dev/null
782     install_mount_rootfs_flash
783     (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
784    
785     dialog_install_bootsector
786     install_bootsector_chroot
787    
788     dialog_install_settings
789   sleep 1   sleep 1
790     install_system_settings_flash
791     install_initrd_chroot
792     install_umount_rootfs_flash
793     dialog_install_successful
794  }  }
795    
796  if [ "$1" == "unattended" ]  dialog_main
 then  
  run_install_unattended  
 else  
  dialog_main  
 fi  
797    
798  exit 0  exit 0

Legend:
Removed from v.260  
changed lines
  Added in v.1579