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 4853 by niro, Wed May 15 07:25:12 2013 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   I=`dialog \   dialog \
101   --backtitle "$TITLE" \   --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 \
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   --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=""
  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
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() {  
  dialog \  
  --backtitle "$TITLE" \  
  --infobox "Installiere Hotfixes ..." 3 70  
   
 }  
   
 dialog_install_successful() {  
392   dialog \   dialog \
393   --backtitle "$TITLE" \   --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 --gfxcard)"
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  }   # there are to zotac types in the wild, nvidia based gfx and intel
463     if [[ ! -z $(echo "${hwinfo}" | grep -i nouveau) ]]
464     then
465     export SPECIALDEVICE="zotac_nvidia"
466     else
467     export SPECIALDEVICE="zotac_intel"
468     fi
469     fi
470    
471  setup_hdd_partitions_silent() {   # check for special devices/clients:
472   ## hdds löschen   # if a rangee and disk ist smaller then 256mb move partion one block further ahead
473   dd if=/dev/zero of=$HDD bs=1024k count=1 || die   if [[ ! -z $(echo "${hwinfo}" | grep -i CLE266) ]]
474   ## hdds partitionieren silent   then
475   fdisk $HDD < $CONFIGS_TEMPLATE/fdisksettings #1> /dev/null 3> /dev/null || die   # for a rangee always define partion startblock +1
476     export FDISKPARTIONBELOW256MB="1"
477   read   export SPECIALDEVICE="rangee"
478  }   export GRUBLEGACYOPTS=""
479     fi
480    
481  setup_hdd_format() {   # check for special devices/clients:
482   mkswap $SWAPHDD || die   # check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer
483   mke2fs -j -q $BOOTHDD || die   if [[ ! -z $(echo "${hwinfo}" | grep -i i810) ]] || [[ ! -z $(echo "${hwinfo}" | grep -i i815) ]]
484   mke2fs -j -q $ROOTHDD || die   then
485     export SPECIALDEVICE="maxdata"
486     export GRUBLEGACYOPTS=""
487     fi
488  }  }
489    
490  install_mount_rootfs() {  hdd_size_below_256mb()
491   swapon $SWAPHDD || die  {
492   mount $ROOTHDD $INSTALLPATH || die   local hdd="$1"
493   install -d $INSTALLPATH/boot || die   local size
494   mount $BOOTHDD $INSTALLPATH/boot || die   local retval
495   cd $INSTALLPATH || die   [[ -z ${hdd} ]] && die "Error: get_hdd_size() no \$hdd given!"
 }  
496    
497  install_system_image() {   size=$(fdisk -l ${hdd} | grep "Disk.*${hdd}" | sed 's:.*,\ \(.*\)\ byte.*:\1:')
498   #tar xvzpf $CDPATH/system/autosta_lx.tar.gz   if [[ ${size} -le 257000000 ]]
499   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}   then
500     retval="0"
501     else
502     retval="1"
503     fi
504    
505     return "${retval}"
506  }  }
507    
508    setup_hdd_partitions_auto()
509    {
510     ROOTHDD="${HDD}1"
511    
512  install_kernel_image() {   # run this only if FDISKPARTITIONBELOW256MB is not already 1
513   declare -i CPUTYPE=`cat /proc/cpuinfo |grep "cpu family"|cut -d ' ' -f3`   if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]
514     then
515     if hdd_size_below_256mb ${HDD}
516     then
517     FDISKPARTIONBELOW256MB=1
518     else
519     FDISKPARTIONBELOW256MB=0
520     fi
521     fi
522    
523   if [ $CPUTYPE -le 5 ];then   ## delete disk
524                  #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..."  
525    
526   lastdir="`pwd`"   if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
527     then
528     ## setup one bootable partition
529     #1. n= new disk
530     #2. p= primary disk
531     #3. 1= first partition
532     #4. 2= default sector start // small disk needs more space for grub2 mbr sector
533     #5. ''= defaul sector end
534     #6. a= bootable flag
535     #7. 1= boot flag for partition 1
536     #8. w= write/quit
537     fdisk ${HDD} &> /dev/null << EOF
538    n
539    p
540    1
541    2
542    
543    a
544    1
545    w
546    EOF
547     else
548     ## setup one bootable partition
549     #1. n= new disk
550     #2. p= primary disk
551     #3. 1= first partition
552     #4. ''= default sector start
553     #5. ''= defaul sector end
554     #6. a= bootable flag
555     #7. 1= boot flag for partition 1
556     #8. w= write/quit
557     fdisk ${HDD} &> /dev/null << EOF
558    n
559    p
560    1
561    
562    
563    a
564    1
565    w
566    EOF
567     fi
568    }
569    
570   mkdir -p $INSTALLPATH/INSTALL/kernel || die  setup_hdd_partitions_manuell()
571   cd $INSTALLPATH/INSTALL/kernel || die  {
572   tar xzpf $CDPATH/kernels/kernel-i386.tar.gz || die   BOOTHDD="${HDD}1"
573   source $INSTALLPATH/INSTALL/kernel/kernelversion || die   SWAPHDD="${HDD}2"
574     ROOTHDD="${HDD}3"
575    
576   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNLIB $INSTALLPATH/lib/modules || die   ## hdds partitionieren manuell
577   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNIMG $INSTALLPATH/boot || die   cfdisk ${HDD} || die
578   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNINITRD $INSTALLPATH/boot || die  }
  cp -aRf $INSTALLPATH/INSTALL/kernel/kernelversion $INSTALLPATH/boot || die  
579    
580   cd $lastdir || die  setup_hdd_partitions_manuell_flash()
581    {
582     ROOTHDD="${HDD}1"
583    
584          elif [ $CPUTYPE -ge 6 ];then   ## hdds partitionieren manuell
585                  #echo -e "\033[1;6m\033[36m""i686 Architektur gefunden.""\033[0m"   cfdisk ${HDD} || die
586                  #echo -e "Installiere i686 Kernel..."  }
587    
588   lastdir="`pwd`"  setup_hdd_format()
589    {
590     mkswap ${SWAPHDD} || die
591     mke2fs -j -q ${BOOTHDD} || die
592     mke2fs -j -q ${ROOTHDD} || die
593    }
594    
595   mkdir -p $INSTALLPATH/INSTALL/kernel || die  setup_hdd_format_flash()
596   cd $INSTALLPATH/INSTALL/kernel || die  {
597   tar xzpf $CDPATH/kernels/kernel-i686.tar.gz || die   mke2fs -j -q ${ROOTHDD} || die
598   source $INSTALLPATH/INSTALL/kernel/kernelversion || die  }
599    
600   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNLIB $INSTALLPATH/lib/modules || die  install_mount_rootfs()
601   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNIMG $INSTALLPATH/boot || die  {
602   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNINITRD $INSTALLPATH/boot || die   swapon ${SWAPHDD} || die
603   cp -aRf $INSTALLPATH/INSTALL/kernel/kernelversion $INSTALLPATH/boot || die   mount ${ROOTHDD} ${INSTALLPATH} || die
604     install -d ${INSTALLPATH}/boot || die
605     mount ${BOOTHDD} ${INSTALLPATH}/boot || die
606     cd ${INSTALLPATH} || die
607    }
608    
609   cd $lastdir || die  install_mount_rootfs_flash()
610          fi  {
611     mount ${ROOTHDD} ${INSTALLPATH} || die
612     install -d ${INSTALLPATH}/boot || die
613     cd ${INSTALLPATH} || die
614  }  }
615    
616  install_bootsector() {  install_system_image()
617   ### grubconf schreiben  {
618   source $INSTALLPATH/INSTALL/kernel/kernelversion   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}
619    }
620    
621   if [ -z $KRNVER ]  install_bootsector_chroot()
622   then  {
623   KRNVER="AutoSta_LX"   local my_roothdd
624   fi   local grubconf=${INSTALLPATH}/boot/grub/grub.conf
625     local grub2conf=/boot/grub/grub.cfg
626    
627   if [ -z $KRNIMG ]   # check for grub2
628     if [[ -f ${INSTALLPATH}/sbin/grub-mkconfig ]]
629   then   then
630   KRNIMG="bzImage"   # needed by grub-mkconfig on the first run
631   fi   if [[ ! -f ${INSTALLPATH}/boot/grub/video.lst ]]
632     then
633     install -m0644 ${INSTALLPATH}/lib/grub/*/video.lst ${INSTALLPATH}/boot/grub/video.lst || die
634     fi
635    
636   if [ -z $KRNINITRD ]   # set kernelopts
637   then   if [[ -f ${INSTALLPATH}/etc/conf.d/grub ]]
638   KRNINITRD="initrd"   then
639   fi   sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLPATH}/etc/conf.d/grub || die
640     else
641     echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALLPATH}/etc/conf.d/grub || die
642     fi
643     echo 'grub-mkdevicemap' > ${INSTALLPATH}/root/.installrc || die
644     echo "LC_ALL=C grub-mkconfig -o ${grub2conf}  &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die
645     echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die
646     echo "exit 0" >> ${INSTALLPATH}/root/.installrc || die
647    
648   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die   # grub-legacy
649   echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die   else
650   #no support for splash image in 6.1-r2   ### grubconf schreiben
651   #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  
652    
653   ### bootsector schreiben   #for alx only
654   #grub --no-floppy < $CONFIGS_TEMPLATE/grubsettings || die   if [ -e ${INSTALLPATH}/etc/alx_version ]
655   /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null || die   then
656  root (hd0,0)   OLD_ALXVER="${ALXVER}"
657  setup (hd0)   source ${INSTALLPATH}/etc/alx_version
658  quit   KRNVER="ALX-${ALXVER}"
659  EOF   ALXVER="${OLD_ALXVER}"
660  }   fi
661    
662  install_bootsector_chroot() {   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"
663   ### grubconf schreiben   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"
664   #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  
665    
666   if [ -z "$KRNIMG" ]   # uuid support
667   then   if is_uuid_supported
668   KRNIMG="bzImage"   then
669   fi   my_roothdd="UUID=$(get_uuid ${ROOTHDD})"
670     else
671     my_roothdd="${ROOTHDD}"
672     fi
673    
674   if [ -z "$KRNINITRD" ]   : > ${grubconf} || die
675   then   echo "default 0" >> ${grubconf} || die
676   KRNINITRD="initrd"   echo "timeout 3" >> ${grubconf} || die
677   fi   # using current root password
678     echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die
679    
680     echo  >> ${grubconf} || die
681     echo "# normal boot" >> ${grubconf} || die
682     echo "title ${KRNVER}" >> ${grubconf} || die
683     echo "root (hd0,0)" >> ${grubconf} || die
684     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" >> ${grubconf} || die
685     if is_initrd_supported
686     then
687     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
688     fi
689    
690   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die   echo >> ${grubconf} || die
691   echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die   echo "# admin boot" >> ${grubconf} || die
692     echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die
693   #no support for splash image in 6.1-r2   echo "lock"  >> ${grubconf} || die
694   #echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die   echo "root (hd0,0)" >> ${grubconf} || die
695     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" >> ${grubconf} || die
696   echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die   if is_initrd_supported
697   echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die   then
698     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
699   #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  
700    
701     echo >> ${grubconf} || die
702     echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die
703     echo "lock"  >> ${grubconf} || die
704     echo "root (hd0,0)" >> ${grubconf} || die
705     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" >> ${grubconf} || die
706     if is_initrd_supported
707     then
708     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
709     fi
710    
711   ### bootsector schreiben chrooted schreiben (gentoo)   # bootsector schreiben chrooted schreiben (lfs/magellan)
712   if [ -f $INSTALLPATH/sbin/grub ]   cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF
713   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  
714  root (hd0,0)  root (hd0,0)
715  setup (hd0)  setup (hd0)
716  quit  quit
717  EOF  EOF
718  exit  exit 0
719  CHROOTEOF  CHROOTEOF
720   fi   fi
721    
722   ### bootsector schreiben chrooted schreiben (lfs/magellan)   ## enters chroot
723   if [ -f $INSTALLPATH/usr/sbin/grub ]   mount -t proc proc ${INSTALLPATH}/proc
724   then   mount -t sysfs sysfs ${INSTALLPATH}/sys
725   cat > $INSTALLPATH/root/.bashrc << CHROOTEOF   mount -o bind /dev ${INSTALLPATH}/dev
726  /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null   chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i
727  root (hd0,0)   umount ${INSTALLPATH}/proc
728  setup (hd0)   umount ${INSTALLPATH}/sys
729  quit   umount ${INSTALLPATH}/dev
730  EOF   rm ${INSTALLPATH}/root/.installrc
731  exit  }
732    
733    is_initrd_supported()
734    {
735     # only generate initrds if the cmd exists
736     [[ -x ${INSTALLPATH}/sbin/mkinitrd ]] && return 0
737     return 1
738    }
739    
740    install_initrd_chroot()
741    {
742     # only generate initrds if the cmd exists
743     is_initrd_supported || return 0
744    
745     DISKMODS="sd_mod"
746     OLDPATAMODS="amd74xx piix sis5513 via82cxxx"
747     PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via"
748     SATAMODS="sata_via sata_sis sata_nv"
749     DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via"
750     case ${SPECIALDEVICE} in
751     zotac_intel) FBMODS=""; DRMMODS="i915" ;;
752     zotac_nvidia) FBMODS=""; DRMMODS="nouveau" ;;
753     rangee) FBMODS="" ;; ## fallback to vesafb, viafb does not run on all CLE266 boards
754     # not working with kms enabled drivers -> segfaults
755     #maxdata) FBMODS="i810fb" ;; ## check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer
756     maxdata) FBMODS="" ;;
757     *) FBMODS="uvesafb" ;;
758     esac
759    
760     # install an appropriate uvesafb.conf
761     install -d ${INSTALLPATH}/etc/modprobe.d || die
762     echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLPATH}/etc/modprobe.d/uvesafb.conf || die
763    
764     # install an appropriate viafb.conf
765     echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLPATH}/etc/modprobe.d/viafb.conf || die
766    
767     # install an appropriate i810fb.conf
768     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
769    
770     cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF
771    echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS}\"" > /etc/conf.d/mkinitrd
772    mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null
773    exit 0
774  CHROOTEOF  CHROOTEOF
775    
776     ## enters chroot
777     mount -t proc proc ${INSTALLPATH}/proc
778     mount -t sysfs sysfs ${INSTALLPATH}/sys
779     mount -o bind /dev ${INSTALLPATH}/dev
780     chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i
781     umount ${INSTALLPATH}/proc
782     umount ${INSTALLPATH}/sys
783     umount ${INSTALLPATH}/dev
784     rm ${INSTALLPATH}/root/.installrc
785    }
786    
787    is_uuid_supported()
788    {
789     if [[ -x $(which busybox.mkinitrd &> /dev/null) ]]
790     then
791     # only detect uuids if supported
792     if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]
793     then
794     return 0
795     fi
796   fi   fi
797    
798   ##enters chroot   return 1
  mount -t proc proc $INSTALLPATH/proc  
  chroot $INSTALLPATH /bin/bash  
  umount $INSTALLPATH/proc  
  rm $INSTALLPATH/root/.bashrc  
799  }  }
800    
801  install_alxconfig(){  get_uuid()
802   lastdir="`pwd`"  {
803     local UUID
804     local SEC_TYPE
805     local TYPE
806    
807   mkdir -p $INSTALLPATH/opt/alx-config || die   local dev="$1"
808   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  
809    
810   cd $lastdir || die   # check if given device is already an UUID
811     if [[ ${dev/UUID=/}x != ${dev}x ]]
812     then
813     eval "${dev}"
814     else
815     eval $(busybox.mkinitrd blkid ${dev} | grep "${dev}:" | sed 's/.*:\ //')
816     fi
817     echo "${UUID}"
818  }  }
819    
820    install_system_settings()
821    {
822     # schreibe fstab
823     if is_uuid_supported
824     then
825     echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die
826     echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die
827     else
828     echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die
829     echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die
830     fi
831     # not needed busybox loads all with swapon -a, even if not mentioned in fstab
832     #echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die
833     echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
834     echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
835    
836  install_system_settings(){   # install network config skeleton
837   ### 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  
838    
839   echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   # intel framebufer quirk
840   echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   if [[ -e /proc/fb ]]
841     then
842     if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]
843     then
844     fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')
845     if [[ ${fbdev} != 0 ]]
846     then
847     sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLPATH}/etc/splash/splash.conf || die
848     fi
849     fi
850     fi
851  }  }
852    
853  install_hotfixes(){  install_system_settings_flash()
854   if [ -f $CDPATH/hotfixes/hotfixes.sh ]  {
855     # schreibe fstab
856     if is_uuid_supported
857   then   then
858   dialog_hotfixes   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die
859   sleep1   else
860   $CDPATH/hotfixes/hotfixes.sh   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die
861   fi   fi
862     echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
863     echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
864  }  }
865    
866  install_umount_rootfs() {  install_umount_rootfs()
867    {
868   cd /   cd /
869   umount $INSTALLPATH/boot || die   umount ${INSTALLPATH}/boot || die
870   umount $INSTALLPATH || die   umount ${INSTALLPATH} || die
871   swapoff $SWAPHDD || die   swapoff ${SWAPHDD} || die
872  }  }
873    
874  install_do_reboot() {  install_umount_rootfs_flash()
875    {
876   #only for now later it will be used again   cd /
877   #with 6.1-r2 these options are not available   umount ${INSTALLPATH} || die
878   #cd /  }
879   #umount $CDPATH  
880   #eject  install_do_reboot()
881   #clear  {
   
882   reboot   reboot
883  }  }
884    
# Line 608  install_do_reboot() { Line 886  install_do_reboot() {
886  #     Install Ablauf Scripte #  #     Install Ablauf Scripte #
887  #################################################  #################################################
888    
889  run_install_normal() {  run_install_normal()
890   #only for now later it will be used again  {
891   #with 6.1-r2 only one install method available   dialog_hardware_detection
892   #dialog_setup_hdd_menu  
  dialog_setup_hdd_found_manuell  
   
893   dialog_setup_hdd_partitions_manuell   dialog_setup_hdd_partitions_manuell
894   dialog_setup_hdd_format   dialog_setup_hdd_format
895   setup_hdd_format > /dev/null   setup_hdd_format > /dev/null
896   install_mount_rootfs   install_mount_rootfs
897   (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
898    
  #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  
   
899   dialog_install_settings   dialog_install_settings
900   sleep 1   sleep 1
901   install_system_settings   install_system_settings
902   install_hotfixes   install_initrd_chroot
903    
904     dialog_install_bootsector
905     install_bootsector_chroot
906    
907   install_umount_rootfs   install_umount_rootfs
908   dialog_install_successful   dialog_install_successful
909  }  }
910    
911  run_install_silent() {  run_install_flash()
912   echo "starting silent install ..."  {
913     dialog_hardware_detection
914    
915     dialog_setup_hdd_partitions_manuell_flash
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  run_install_unattended() {  run_install_auto()
934   echo "starting unattended install ..."  {
935     dialog_hardware_detection
936    
937     dialog_setup_hdd_partitions_auto
938     dialog_setup_hdd_format
939     setup_hdd_format_flash > /dev/null
940     install_mount_rootfs_flash
941     (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
942    
943     dialog_install_settings
944   sleep 1   sleep 1
945     install_system_settings_flash
946     install_initrd_chroot
947    
948     dialog_install_bootsector
949     install_bootsector_chroot
950    
951     install_umount_rootfs_flash
952     dialog_install_successful
953  }  }
954    
955  if [ "$1" == "unattended" ]  dialog_main
 then  
  run_install_unattended  
 else  
  dialog_main  
 fi  
956    
957  exit 0  exit 0

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