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/branches/unlabeled-1.1.1/alxinstall-ng/bin/alxinstall-ng.sh revision 258 by niro, Mon Apr 18 19:01:41 2005 UTC alx-src/trunk/alxinstall-ng/bin/alxinstall-ng.sh.in revision 3373 by niro, Wed Mar 28 09:50:05 2012 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.1.1.1 2005-04-18 19:01:41 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="%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_menu() {  dialog_setup_hdd_info_flash()
97    {
98     local SHDD="$(echo $HDD | sed 's/\/dev\///')"
99    
100     dialog \
101     --colors \
102     --title "[ Festplatten Partitionierung ]" \
103     --backtitle "${TITLE}" \
104     --ok-label "Weiter" \
105     --msgbox "\nBitte legen Sie 1 Partition an.\n\n\
106     [ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit dem gesamten Speicher\n\
107     Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81
108    }
109    
110    dialog_setup_hdd_info_auto()
111    {
112     local SHDD="$(echo $HDD | sed 's/\/dev\///')"
113    
114     dialog \
115     --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 \   i=$(dialog \
128   --backtitle "$TITLE" \   --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   --menu "\nWaehlen Sie zwischen Manuell und Automatisch" 14 70 5 \   --colors \
134   "1" "Manuell" \   --menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \
135   "2" "Automatisch"`   "1" "Automatisches Setup (Empfohlen)" \
136     "" "" \
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   dialog_setup_hdd_found_manuell   "3") run_install_flash ;;
148   ;;   "") dialog_setup_system_menu;;
  "2")  
  dialog_warning  
  setup_hdd_partitions_silent  
      ;;  
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=""
166   echo "--backtitle \"$TITLE\" \\" >> /tmp/hddtmp.sh  
167   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh   echo "dialog \\"  > ${hwtmp}
168   echo "--stdout \\" >> /tmp/hddtmp.sh   echo "--backtitle \"${TITLE}\" \\" >> ${hwtmp}
169   echo "--colors \\" >> /tmp/hddtmp.sh   echo "--ok-label \"Weiter\" \\" >> ${hwtmp}
170   echo "--msgbox \"Gefundene Hardware:\n\n \\" >> /tmp/hddtmp.sh   echo "--stdout \\" >> ${hwtmp}
171   echo " Festplatten:\n \\" >> /tmp/hddtmp.sh   echo "--colors \\" >> ${hwtmp}
172     echo "--msgbox \"Gefundene Hardware:\n\n \\" >> ${hwtmp}
173     echo " Festplatten:\n \\" >> ${hwtmp}
174    
175   if [ ! -z "$scsidisks" ]   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
201     echo " \n \\" >> ${hwtmp}
202     echo " \\Z7andere Laufwerke:\n \\" >> ${hwtmp}
203     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) echo " \n\n\n \\Z2Rangee Device erkannt!\\Zn \\" >> ${hwtmp} ;;
211     maxdata) echo " \n\n\n \\Z2Maxdata 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   then
222   echo " \n \\" >> /tmp/hddtmp.sh   rm ${hwtmp}
  echo " \\Z7andere Laufwerke:\n \\" >> /tmp/hddtmp.sh  
  echo " CDROM: \\Z3$cdromdev\\Zn\n \\" >> /tmp/hddtmp.sh  
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 202  dialog_setup_hdd_partitions_manuell() { Line 261  dialog_setup_hdd_partitions_manuell() {
261   fi   fi
262  }  }
263    
264  dialog_setup_hdd_partitions_silent() {  dialog_setup_hdd_partitions_manuell_flash()
265    {
266     local i
267    
268     if [[ -z ${installdevs} ]]
269     then
270     dialog \
271     --backtitle "${TITLE}" \
272     --ok-label "Beenden" \
273     --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70
274     exit 1
275     else
276    
277     echo "dialog \\" > /tmp/hddtmp.sh
278     echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh
279     echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh
280     echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh
281     echo "--stdout \\" >> /tmp/hddtmp.sh
282     echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh
283    
284     for i in ${installdevs}
285     do
286     echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh
287     done
288     echo -e "\n" >> /tmp/hddtmp.sh
289    
290     chmod a+x /tmp/hddtmp.sh
291     HDD="$(/tmp/hddtmp.sh)"
292     RES=$?
293     [[ ${RES} -eq 1 ]] && return 1
294     if [[ ${RES} -eq 0 ]]
295     then
296     dialog_setup_hdd_info_flash
297     setup_hdd_partitions_manuell_flash
298     fi
299     fi
300    }
301    
302    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 238  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   dialog \  {
  --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() {  
392   dialog \   dialog \
393   --backtitle "$TITLE" \   --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 321  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 ohne neustarten" `   "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  
  ;;  
  "2") dialog_setup_hdd_found_manuell  
  ;;  
  "3") install_do_reboot  
  ;;  
433   esac   esac
434   fi   fi
435   done   done
# Line 346  dialog_main() { Line 438  dialog_main() {
438  #################################################  #################################################
439  # Install Komandos #  # Install Komandos #
440  #################################################  #################################################
441  setup_hdd_partitions_manuell() {  run_hardware_detection()
442   BOOTHDD="${HDD}1"  {
443   SWAPHDD="${HDD}2"   local hwinfo
444   ROOTHDD="${HDD}3"  
445     hwinfo="$(hwinfo --bios --storage --pci)"
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   ## hdds partitionieren manuell   # only add this for grub legacy, grub2 detect these settings on its own
461   cfdisk $HDD || die   export GRUBLEGACYOPTS="rootdelay=8"
462  }   export SPECIALDEVICE="zotac"
463     fi
464    
465  setup_hdd_partitions_silent() {   # check for special devices/clients:
466   ## hdds löschen   # if a rangee and disk ist smaller then 256mb move partion one block further ahead
467   dd if=/dev/zero of=$HDD bs=1024k count=1 || die   if [[ ! -z $(echo "${hwinfo}" | grep -i CLE266) ]]
468   ## hdds partitionieren silent   then
469   fdisk $HDD < $CONFIGS_TEMPLATE/fdisksettings #1> /dev/null 3> /dev/null || die   # for a rangee always define partion startblock +1
470     export FDISKPARTIONBELOW256MB="1"
471   read   export SPECIALDEVICE="rangee"
472  }   export GRUBLEGACYOPTS=""
473     fi
474    
475  setup_hdd_format() {   # check for special devices/clients:
476   mkswap $SWAPHDD || die   # check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer
477   mke2fs -j -q $BOOTHDD || die   if [[ ! -z $(echo "${hwinfo}" | grep -i i810) ]] || [[ ! -z $(echo "${hwinfo}" | grep -i i815) ]]
478   mke2fs -j -q $ROOTHDD || die   then
479     export SPECIALDEVICE="maxdata"
480     export GRUBLEGACYOPTS=""
481     fi
482  }  }
483    
484  install_mount_rootfs() {  hdd_size_below_256mb()
485   swapon $SWAPHDD || die  {
486   mount $ROOTHDD $INSTALLPATH || die   local hdd="$1"
487   install -d $INSTALLPATH/boot || die   local size
488   mount $BOOTHDD $INSTALLPATH/boot || die   local retval
489   cd $INSTALLPATH || die   [[ -z ${hdd} ]] && die "Error: get_hdd_size() no \$hdd given!"
 }  
490    
491  install_system_image() {   size=$(fdisk -l ${hdd} | grep "Disk.*${hdd}" | sed 's:.*,\ \(.*\)\ byte.*:\1:')
492   #tar xvzpf $CDPATH/system/autosta_lx.tar.gz   if [[ ${size} -le 257000000 ]]
493   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}   then
494     retval="0"
495     else
496     retval="1"
497     fi
498    
499     return "${retval}"
500  }  }
501    
502    setup_hdd_partitions_auto()
503    {
504     ROOTHDD="${HDD}1"
505    
506  install_kernel_image() {   # run this only if FDISKPARTITIONBELOW256MB is not already 1
507   declare -i CPUTYPE=`cat /proc/cpuinfo |grep "cpu family"|cut -d ' ' -f3`   if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]
508     then
509     if hdd_size_below_256mb ${HDD}
510     then
511     FDISKPARTIONBELOW256MB=1
512     else
513     FDISKPARTIONBELOW256MB=0
514     fi
515     fi
516    
517   if [ $CPUTYPE -le 5 ];then   ## delete disk
518                  #echo -e "\033[1;6m\033[36m""i386 Architektur gefunden.""\033[0m"   dd if=/dev/zero of=${HDD} count=1 &> /dev/null || die
                 #echo -e "Installiere i386 Kernel..."  
519    
520   lastdir="`pwd`"   if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
521     then
522     ## setup one bootable partition
523     #1. n= new disk
524     #2. p= primary disk
525     #3. 1= first partition
526     #4. 2= default sector start // small disk needs more space for grub2 mbr sector
527     #5. ''= defaul sector end
528     #6. a= bootable flag
529     #7. 1= boot flag for partition 1
530     #8. w= write/quit
531     fdisk ${HDD} &> /dev/null << EOF
532    n
533    p
534    1
535    2
536    
537    a
538    1
539    w
540    EOF
541     else
542     ## setup one bootable partition
543     #1. n= new disk
544     #2. p= primary disk
545     #3. 1= first partition
546     #4. ''= default sector start
547     #5. ''= defaul sector end
548     #6. a= bootable flag
549     #7. 1= boot flag for partition 1
550     #8. w= write/quit
551     fdisk ${HDD} &> /dev/null << EOF
552    n
553    p
554    1
555    
556    
557    a
558    1
559    w
560    EOF
561     fi
562    }
563    
564   mkdir -p $INSTALLPATH/INSTALL/kernel || die  setup_hdd_partitions_manuell()
565   cd $INSTALLPATH/INSTALL/kernel || die  {
566   tar xzpf $CDPATH/kernels/kernel-i386.tar.gz || die   BOOTHDD="${HDD}1"
567   source $INSTALLPATH/INSTALL/kernel/kernelversion || die   SWAPHDD="${HDD}2"
568     ROOTHDD="${HDD}3"
569    
570   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNLIB $INSTALLPATH/lib/modules || die   ## hdds partitionieren manuell
571   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNIMG $INSTALLPATH/boot || die   cfdisk ${HDD} || die
572   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNINITRD $INSTALLPATH/boot || die  }
  cp -aRf $INSTALLPATH/INSTALL/kernel/kernelversion $INSTALLPATH/boot || die  
573    
574   cd $lastdir || die  setup_hdd_partitions_manuell_flash()
575    {
576     ROOTHDD="${HDD}1"
577    
578          elif [ $CPUTYPE -ge 6 ];then   ## hdds partitionieren manuell
579                  #echo -e "\033[1;6m\033[36m""i686 Architektur gefunden.""\033[0m"   cfdisk ${HDD} || die
580                  #echo -e "Installiere i686 Kernel..."  }
581    
582   lastdir="`pwd`"  setup_hdd_format()
583    {
584     mkswap ${SWAPHDD} || die
585     mke2fs -j -q ${BOOTHDD} || die
586     mke2fs -j -q ${ROOTHDD} || die
587    }
588    
589   mkdir -p $INSTALLPATH/INSTALL/kernel || die  setup_hdd_format_flash()
590   cd $INSTALLPATH/INSTALL/kernel || die  {
591   tar xzpf $CDPATH/kernels/kernel-i686.tar.gz || die   mke2fs -j -q ${ROOTHDD} || die
592   source $INSTALLPATH/INSTALL/kernel/kernelversion || die  }
593    
594   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNLIB $INSTALLPATH/lib/modules || die  install_mount_rootfs()
595   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNIMG $INSTALLPATH/boot || die  {
596   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNINITRD $INSTALLPATH/boot || die   swapon ${SWAPHDD} || die
597   cp -aRf $INSTALLPATH/INSTALL/kernel/kernelversion $INSTALLPATH/boot || die   mount ${ROOTHDD} ${INSTALLPATH} || die
598     install -d ${INSTALLPATH}/boot || die
599     mount ${BOOTHDD} ${INSTALLPATH}/boot || die
600     cd ${INSTALLPATH} || die
601    }
602    
603   cd $lastdir || die  install_mount_rootfs_flash()
604          fi  {
605     mount ${ROOTHDD} ${INSTALLPATH} || die
606     install -d ${INSTALLPATH}/boot || die
607     cd ${INSTALLPATH} || die
608  }  }
609    
610  install_bootsector() {  install_system_image()
611   ### grubconf schreiben  {
612   source $INSTALLPATH/INSTALL/kernel/kernelversion   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}
613    }
614    
615   if [ -z $KRNVER ]  install_bootsector_chroot()
616   then  {
617   KRNVER="AutoSta_LX"   local my_roothdd
618   fi   local grubconf=${INSTALLPATH}/boot/grub/grub.conf
619     local grub2conf=/boot/grub/grub.cfg
620    
621   if [ -z $KRNIMG ]   # check for grub2
622     if [[ -f ${INSTALLPATH}/sbin/grub-mkconfig ]]
623   then   then
624   KRNIMG="bzImage"   # needed by grub-mkconfig on the first run
625   fi   if [[ ! -f ${INSTALLPATH}/boot/grub/video.lst ]]
626     then
627     install -m0644 ${INSTALLPATH}/lib/grub/*/video.lst ${INSTALLPATH}/boot/grub/video.lst || die
628     fi
629    
630   if [ -z $KRNINITRD ]   # set kernelopts
631   then   if [[ -f ${INSTALLPATH}/etc/conf.d/grub ]]
632   KRNINITRD="initrd"   then
633   fi   sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLPATH}/etc/conf.d/grub || die
634     else
635     echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALLPATH}/etc/conf.d/grub || die
636     fi
637     echo 'grub-mkdevicemap' > ${INSTALLPATH}/root/.installrc || die
638     echo "LC_ALL=C grub-mkconfig -o ${grub2conf}  &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die
639     echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die
640     echo "exit 0" >> ${INSTALLPATH}/root/.installrc || die
641    
642   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die   # grub-legacy
643   echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die   else
644   #no support for splash image in 6.1-r2   ### grubconf schreiben
645   #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  
646    
647   ### bootsector schreiben   #for alx only
648   #grub --no-floppy < $CONFIGS_TEMPLATE/grubsettings || die   if [ -e ${INSTALLPATH}/etc/alx_version ]
649   /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null || die   then
650  root (hd0,0)   OLD_ALXVER="${ALXVER}"
651  setup (hd0)   source ${INSTALLPATH}/etc/alx_version
652  quit   KRNVER="ALX-${ALXVER}"
653  EOF   ALXVER="${OLD_ALXVER}"
654  }   fi
655    
656  install_bootsector_chroot() {   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"
657   ### grubconf schreiben   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"
658   #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  
659    
660   if [ -z "$KRNIMG" ]   # uuid support
661   then   if is_uuid_supported
662   KRNIMG="bzImage"   then
663   fi   my_roothdd="UUID=$(get_uuid ${ROOTHDD})"
664     else
665     my_roothdd="${ROOTHDD}"
666     fi
667    
668   if [ -z "$KRNINITRD" ]   : > ${grubconf} || die
669   then   echo "default 0" >> ${grubconf} || die
670   KRNINITRD="initrd"   echo "timeout 3" >> ${grubconf} || die
671   fi   # using current root password
672     echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die
673    
674     echo  >> ${grubconf} || die
675     echo "# normal boot" >> ${grubconf} || die
676     echo "title ${KRNVER}" >> ${grubconf} || die
677     echo "root (hd0,0)" >> ${grubconf} || die
678     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" >> ${grubconf} || die
679     if is_initrd_supported
680     then
681     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
682     fi
683    
684   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die   echo >> ${grubconf} || die
685   echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die   echo "# admin boot" >> ${grubconf} || die
686     echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die
687   #no support for splash image in 6.1-r2   echo "lock"  >> ${grubconf} || die
688   #echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die   echo "root (hd0,0)" >> ${grubconf} || die
689     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" >> ${grubconf} || die
690   echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die   if is_initrd_supported
691   echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die   then
692     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
693   #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  
694    
695     echo >> ${grubconf} || die
696     echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die
697     echo "lock"  >> ${grubconf} || die
698     echo "root (hd0,0)" >> ${grubconf} || die
699     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" >> ${grubconf} || die
700     if is_initrd_supported
701     then
702     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
703     fi
704    
705   ### bootsector schreiben chrooted schreiben (gentoo)   # bootsector schreiben chrooted schreiben (lfs/magellan)
706   if [ -f $INSTALLPATH/sbin/grub ]   cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF
707   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  
708  root (hd0,0)  root (hd0,0)
709  setup (hd0)  setup (hd0)
710  quit  quit
711  EOF  EOF
712  exit  exit 0
713  CHROOTEOF  CHROOTEOF
714   fi   fi
715    
716   ### bootsector schreiben chrooted schreiben (lfs/magellan)   ## enters chroot
717   if [ -f $INSTALLPATH/usr/sbin/grub ]   mount -t proc proc ${INSTALLPATH}/proc
718   then   mount -t sysfs sysfs ${INSTALLPATH}/sys
719   cat > $INSTALLPATH/root/.bashrc << CHROOTEOF   mount -o bind /dev ${INSTALLPATH}/dev
720  /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null   chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i
721  root (hd0,0)   umount ${INSTALLPATH}/proc
722  setup (hd0)   umount ${INSTALLPATH}/sys
723  quit   umount ${INSTALLPATH}/dev
724  EOF   rm ${INSTALLPATH}/root/.installrc
725  exit  }
726    
727    is_initrd_supported()
728    {
729     # only generate initrds if the cmd exists
730     [[ -x ${INSTALLPATH}/sbin/mkinitrd ]] && return 0
731     return 1
732    }
733    
734    install_initrd_chroot()
735    {
736     # only generate initrds if the cmd exists
737     is_initrd_supported || return 0
738    
739     DISKMODS="sd_mod"
740     OLDPATAMODS="amd74xx piix sis5513 via82cxxx"
741     PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via"
742     SATAMODS="sata_via sata_sis sata_nv"
743     DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via"
744     case ${SPECIALDEVICE} in
745     zotac) FBMODS="" ;;
746     rangee) FBMODS="" ;; ## fallback to vesafb, viafb does not run on all CLE266 boards
747     maxdata) FBMODS="i810fb" ;; ## check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer
748     *) FBMODS="uvesafb" ;;
749     esac
750    
751     # install an appropriate uvesafb.conf
752     install -d ${INSTALLPATH}/etc/modprobe.d || die
753     echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLPATH}/etc/modprobe.d/uvesafb.conf || die
754    
755     # install an appropriate viafb.conf
756     echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLPATH}/etc/modprobe.d/viafb.conf || die
757    
758     # install an appropriate i810fb.conf
759     echo "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60"  > ${INSTALLPATH}/etc/modprobe.d/i810fb.conf || die
760    
761     cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF
762    echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS}\"" > /etc/conf.d/mkinitrd
763    mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null
764    exit 0
765  CHROOTEOF  CHROOTEOF
766    
767     ## enters chroot
768     mount -t proc proc ${INSTALLPATH}/proc
769     mount -t sysfs sysfs ${INSTALLPATH}/sys
770     mount -o bind /dev ${INSTALLPATH}/dev
771     chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i
772     umount ${INSTALLPATH}/proc
773     umount ${INSTALLPATH}/sys
774     umount ${INSTALLPATH}/dev
775     rm ${INSTALLPATH}/root/.installrc
776    }
777    
778    is_uuid_supported()
779    {
780     if [[ -x $(which busybox.mkinitrd &> /dev/null) ]]
781     then
782     # only detect uuids if supported
783     if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]
784     then
785     return 0
786     fi
787   fi   fi
788    
789   ##enters chroot   return 1
  mount -t proc proc $INSTALLPATH/proc  
  chroot $INSTALLPATH /bin/bash  
  umount $INSTALLPATH/proc  
  rm $INSTALLPATH/root/.bashrc  
790  }  }
791    
792  install_alxconfig(){  get_uuid()
793   lastdir="`pwd`"  {
794     local UUID
795     local SEC_TYPE
796     local TYPE
797    
798   mkdir -p $INSTALLPATH/opt/alx-config || die   local dev="$1"
799   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  
800    
801   cd $lastdir || die   # check if given device is already an UUID
802     if [[ ${dev/UUID=/}x != ${dev}x ]]
803     then
804     eval "${dev}"
805     else
806     eval $(busybox.mkinitrd blkid ${dev} | grep "${dev}:" | sed 's/.*:\ //')
807     fi
808     echo "${UUID}"
809  }  }
810    
811    install_system_settings()
812    {
813     # schreibe fstab
814     if is_uuid_supported
815     then
816     echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die
817     echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die
818     else
819     echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die
820     echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die
821     fi
822     # not needed busybox loads all with swapon -a, even if not mentioned in fstab
823     #echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die
824     echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
825     echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
826    
827  install_system_settings(){   # install network config skeleton
828   ### 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  
829  }  }
830    
831  install_hotfixes(){  install_system_settings_flash()
832   if [ -f $CDPATH/hotfixes/hotfixes.sh ]  {
833     # schreibe fstab
834     if is_uuid_supported
835   then   then
836   dialog_hotfixes   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die
837   sleep1   else
838   $CDPATH/hotfixes/hotfixes.sh   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die
839   fi   fi
840     echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
841     echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
842  }  }
843    
844  install_umount_rootfs() {  install_umount_rootfs()
845    {
846   cd /   cd /
847   umount $INSTALLPATH/boot || die   umount ${INSTALLPATH}/boot || die
848   umount $INSTALLPATH || die   umount ${INSTALLPATH} || die
849   swapoff $SWAPHDD || die   swapoff ${SWAPHDD} || die
850  }  }
851    
852  install_do_reboot() {  install_umount_rootfs_flash()
853    {
854   #only for now later it will be used again   cd /
855   #with 6.1-r2 these options are not available   umount ${INSTALLPATH} || die
856   #cd /  }
857   #umount $CDPATH  
858   #eject  install_do_reboot()
859   #clear  {
   
860   reboot   reboot
861  }  }
862    
# Line 608  install_do_reboot() { Line 864  install_do_reboot() {
864  #     Install Ablauf Scripte #  #     Install Ablauf Scripte #
865  #################################################  #################################################
866    
867  run_install_normal() {  run_install_normal()
868   #only for now later it will be used again  {
869   #with 6.1-r2 only one install method available   dialog_hardware_detection
870   #dialog_setup_hdd_menu  
  dialog_setup_hdd_found_manuell  
   
871   dialog_setup_hdd_partitions_manuell   dialog_setup_hdd_partitions_manuell
872   dialog_setup_hdd_format   dialog_setup_hdd_format
873   setup_hdd_format > /dev/null   setup_hdd_format > /dev/null
874   install_mount_rootfs   install_mount_rootfs
875   (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
876    
  #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  
   
877   dialog_install_settings   dialog_install_settings
878   sleep 1   sleep 1
879   install_system_settings   install_system_settings
880   install_hotfixes   install_initrd_chroot
881    
882     dialog_install_bootsector
883     install_bootsector_chroot
884    
885   install_umount_rootfs   install_umount_rootfs
886   dialog_install_successful   dialog_install_successful
887  }  }
888    
889  run_install_silent() {  run_install_flash()
890   echo "starting silent install ..."  {
891     dialog_hardware_detection
892    
893     dialog_setup_hdd_partitions_manuell_flash
894     dialog_setup_hdd_format
895     setup_hdd_format_flash > /dev/null
896     install_mount_rootfs_flash
897     (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
898    
899     dialog_install_settings
900   sleep 1   sleep 1
901     install_system_settings_flash
902     install_initrd_chroot
903    
904     dialog_install_bootsector
905     install_bootsector_chroot
906    
907     install_umount_rootfs_flash
908     dialog_install_successful
909  }  }
910    
911  run_install_unattended() {  run_install_auto()
912   echo "starting unattended install ..."  {
913     dialog_hardware_detection
914    
915     dialog_setup_hdd_partitions_auto
916     dialog_setup_hdd_format
917     setup_hdd_format_flash > /dev/null
918     install_mount_rootfs_flash
919     (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
920    
921     dialog_install_settings
922   sleep 1   sleep 1
923     install_system_settings_flash
924     install_initrd_chroot
925    
926     dialog_install_bootsector
927     install_bootsector_chroot
928    
929     install_umount_rootfs_flash
930     dialog_install_successful
931  }  }
932    
933  if [ "$1" == "unattended" ]  dialog_main
 then  
  run_install_unattended  
 else  
  dialog_main  
 fi  
934    
935  exit 0  exit 0

Legend:
Removed from v.258  
changed lines
  Added in v.3373