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

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