Magellan Linux

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

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

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

Legend:
Removed from v.268  
changed lines
  Added in v.6817