Magellan Linux

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

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

revision 261 by niro, Mon Apr 18 21:28:22 2005 UTC revision 520 by niro, Fri Jun 27 22:27:46 2008 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.3 2005-04-18 21:28:22 niro Exp $  # $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.7 2008-06-27 22:27:46 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    
# Line 27  cdromdev="`echo $cdromdev|sed -e 's/ //' Line 21  cdromdev="`echo $cdromdev|sed -e 's/ //'
21  ########################################  ########################################
22    
23  ### System/Config Version  ### System/Config Version
24  VERSION="0.1"  VERSION="0.3"
25  TITLE="alxinstall-ng - ${VERSION}"  TITLE="alxinstall-ng - ${VERSION}"
26    
27  #CONFIGS_TEMPLATE="/opt/alx-config/configs"  #CONFIGS_TEMPLATE="/opt/alx-config/configs"
# Line 44  CURRENTLINE=0 Line 38  CURRENTLINE=0
38  #  DIALOG BOXEN #  #  DIALOG BOXEN #
39  #################################################  #################################################
40    
41  die() {  die()
42   #clear  {
  #echo -e "\nhuch, da ist ein script gestorben -> $?\n"  
  #read  
  #exit 0  
43   ERROR=$1   ERROR=$1
44   RETVAL=$?   RETVAL=$?
45   dialog_install_failure   dialog_install_failure
46   exit 1   exit 1
47  }  }
48    
49  dialog_warning() {  dialog_warning()
50    {
51   dialog \   dialog \
52   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
53   --colors \   --colors \
54   --defaultno \   --defaultno \
55   --yesno "\Z1 !!! Achtung !!! \Zn\n\n\   --yesno "\Z1 !!! Achtung !!! \Zn\n\n\
56   Diese Festplatte wird unwiederruflich geloescht werden.\n\n\   Diese Festplatte wird unwiederruflich geloescht werden.\n\n\
57   Soll ich wirklich fortfahren ?" 10 70   Soll ich wirklich fortfahren ?" 10 70
58   RES=$?   RES=$?
59   if [ "$RES" == "1" ]   if [[ ${RES} -eq 1 ]]
60   then   then
61   clear   clear
62   echo "Der Vorgang wurde abgebrochen."   echo "Der Vorgang wurde abgebrochen."
# Line 72  dialog_warning() { Line 64  dialog_warning() {
64   fi   fi
65  }  }
66    
67  dialog_setup_hdd_info(){  dialog_setup_hdd_info()
68   local SHDD="`echo $HDD|sed -e 's/\/dev\///'`"  {
69     local SHDD="$(echo ${HDD} | sed 's/\/dev\///')"
70    
71   dialog \   dialog \
72   --colors \   --colors \
73   --title "[ Festplatten Partitionierung ]" \   --title "[ Festplatten Partitionierung ]" \
74   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
75   --ok-label "Weiter" \   --ok-label "Weiter" \
76   --msgbox "\nBitte legen Sie 3 Partitionen an.\n\n\   --msgbox "\nBitte legen Sie 3 Partitionen an.\n\n\
77   [ \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 80  dialog_setup_hdd_info(){
80   Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81   Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81
81  }  }
82    
83  dialog_setup_hdd_menu() {  dialog_setup_hdd_info_flash()
84    {
85     local SHDD="$(echo $HDD | sed 's/\/dev\///')"
86    
87     dialog \
88     --colors \
89     --title "[ Festplatten Partitionierung ]" \
90     --backtitle "${TITLE}" \
91     --ok-label "Weiter" \
92     --msgbox "\nBitte legen Sie 1 Partition an.\n\n\
93     [ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit dem gesamten Speicher\n\
94     Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81
95    }
96    
97    dialog_setup_system_menu()
98    {
99     local i
100    
101   I=`dialog \   i=$(dialog \
102   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
103   --title "[ Festplatten Partitionierung ]" \   --title "[ Festplatten Partitionierung ]" \
104   --cancel-label "Abbrechen" \   --cancel-label "Abbrechen" \
105   --ok-label "Weiter" \   --ok-label "Weiter" \
106   --stdout \   --stdout \
107   --menu "\nWaehlen Sie zwischen Manuell und Automatisch" 14 70 5 \   --menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \
108   "1" "Manuell" \   "1" "Normale IDE-Disk" \
109   "2" "Automatisch"`   "2" "Flash-Speicher")
110   RES=$?   RES=$?
111   if [ "$RES" == "1" ];then   [[ ${RES} -eq 1 ]] && return 1
112   return 1   if [[ ${RES} -eq 0 ]]
113   fi   then
114   if [ "$RES" == "0" ];then   case "${i}" in
115   case "$I" in           "1") run_install_normal ;;
116           "1")   "2") run_install_flash ;;
  dialog_setup_hdd_found_manuell  
  ;;  
  "2")  
  dialog_warning  
  setup_hdd_partitions_silent  
      ;;  
117   esac   esac
118   fi   fi
119  }  }
120    
121  dialog_setup_hdd_found_manuell() {  dialog_setup_hdd_found_manuell()
122   if [ ! -z "$installdevs" ]  {
123   then   local i
124   installdevs=""  
125   fi   [[ ! -z ${installdevs} ]] && installdevs=""
126    
127   echo "dialog \\"  > /tmp/hddtmp.sh   echo "dialog \\"  > /tmp/hddtmp.sh
128   echo "--backtitle \"$TITLE\" \\" >> /tmp/hddtmp.sh   echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh
129   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh
130   echo "--stdout \\" >> /tmp/hddtmp.sh   echo "--stdout \\" >> /tmp/hddtmp.sh
131   echo "--colors \\" >> /tmp/hddtmp.sh   echo "--colors \\" >> /tmp/hddtmp.sh
132   echo "--msgbox \"Gefundene Hardware:\n\n \\" >> /tmp/hddtmp.sh   echo "--msgbox \"Gefundene Hardware:\n\n \\" >> /tmp/hddtmp.sh
133   echo " Festplatten:\n \\" >> /tmp/hddtmp.sh   echo " Festplatten:\n \\" >> /tmp/hddtmp.sh
134    
135   if [ ! -z "$scsidisks" ]   if [[ ! -z ${scsidisks} ]]
136   then   then
137   for I in $scsidisks   for i in ${scsidisks}
138   do   do
139   if [ "$I" != "$cdromdev" ]   if [[ ${i} != ${cdromdev} ]]
140   then   then
141   echo " \\Z7SCSI: \\Z3$I\\Zn\n \\" >> /tmp/hddtmp.sh   echo " \\Z7SCSI: \\Z3${i}\\Zn\n \\" >> /tmp/hddtmp.sh
142   installdevs="$installdevs $I"   installdevs="${installdevs} ${i}"
143   fi   fi
144   done   done
145   fi   fi
146    
147   if [ ! -z "$idedisks" ]   if [[ ! -z ${idedisks} ]]
148   then   then
149   for I in $idedisks   for i in ${idedisks}
150   do   do
151   if [ "$I" != "$cdromdev" ]   if [[ ${i} != ${cdromdev} ]]
152   then   then
153   echo " \\Z7IDE:  \\Z3$I\\Zn\n \\" >> /tmp/hddtmp.sh   echo " \\Z7IDE:  \\Z3${i}\\Zn\n \\" >> /tmp/hddtmp.sh
154   installdevs="$installdevs $I"   installdevs="${installdevs} ${i}"
155   fi   fi
156   done   done
157   fi   fi
158    
159   if [ ! -z "$cdromdev" ]   if [[ ! -z ${cdromdev} ]]
160   then   then
161   echo " \n \\" >> /tmp/hddtmp.sh   echo " \n \\" >> /tmp/hddtmp.sh
162   echo " \\Z7andere Laufwerke:\n \\" >> /tmp/hddtmp.sh   echo " \\Z7andere Laufwerke:\n \\" >> /tmp/hddtmp.sh
163   echo " CDROM: \\Z3$cdromdev\\Zn\n \\" >> /tmp/hddtmp.sh   echo " CDROM: \\Z3${cdromdev}\\Zn\n \\" >> /tmp/hddtmp.sh
164   fi   fi
165   echo " \" 13 70" >> /tmp/hddtmp.sh   echo " \" 13 70" >> /tmp/hddtmp.sh
166   chmod a+x /tmp/hddtmp.sh   chmod a+x /tmp/hddtmp.sh
167   /tmp/hddtmp.sh   /tmp/hddtmp.sh
168  }  }
169    
170  dialog_setup_hdd_partitions_manuell() {  dialog_setup_hdd_partitions_manuell()
171   if [ -z "$installdevs" ]  {
172     local i
173    
174     if [[ -z ${installdevs} ]]
175   then   then
176   dialog \   dialog \
177   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
178   --ok-label "Beenden" \   --ok-label "Beenden" \
179   --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70   --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70
180   exit 1   exit 1
181   else   else
182    
183   echo "dialog \\" > /tmp/hddtmp.sh   echo "dialog \\" > /tmp/hddtmp.sh
184   echo "--backtitle \"$TITLE\" \\" >> /tmp/hddtmp.sh   echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh
185   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh   echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh
186   echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh   echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh
187   echo "--stdout \\" >> /tmp/hddtmp.sh   echo "--stdout \\" >> /tmp/hddtmp.sh
188   echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh   echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh
189    
190   for I in $installdevs   for i in ${installdevs}
191   do   do
192   echo "\"$I\" \"\" \\" >> /tmp/hddtmp.sh   echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh
193   done   done
194   echo -e "\n" >> /tmp/hddtmp.sh   echo -e "\n" >> /tmp/hddtmp.sh
195    
196   chmod a+x /tmp/hddtmp.sh   chmod a+x /tmp/hddtmp.sh
197   HDD="`/tmp/hddtmp.sh`"   HDD="$(/tmp/hddtmp.sh)"
198   RES=$?   RES=$?
199   if [ "$RES" == "1" ]   [[ ${RES} -eq 1 ]] && return 1
200   then   if [[ ${RES} -eq 0 ]]
  return 1  
  fi  
  if [ "$RES" == "0" ]  
201   then   then
202   dialog_setup_hdd_info   dialog_setup_hdd_info
203   setup_hdd_partitions_manuell   setup_hdd_partitions_manuell
# Line 202  dialog_setup_hdd_partitions_manuell() { Line 205  dialog_setup_hdd_partitions_manuell() {
205   fi   fi
206  }  }
207    
208  dialog_setup_hdd_partitions_silent() {  dialog_setup_hdd_partitions_manuell_flash()
209    {
210     local i
211    
212     if [[ -z ${installdevs} ]]
213     then
214     dialog \
215     --backtitle "${TITLE}" \
216     --ok-label "Beenden" \
217     --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70
218     exit 1
219     else
220    
221     echo "dialog \\" > /tmp/hddtmp.sh
222     echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh
223     echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh
224     echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh
225     echo "--stdout \\" >> /tmp/hddtmp.sh
226     echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh
227    
228     for i in ${installdevs}
229     do
230     echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh
231     done
232     echo -e "\n" >> /tmp/hddtmp.sh
233    
234     chmod a+x /tmp/hddtmp.sh
235     HDD="$(/tmp/hddtmp.sh)"
236     RES=$?
237     [[ ${RES} -eq 1 ]] && return 1
238     if [[ ${RES} -eq 0 ]]
239     then
240     dialog_setup_hdd_info_flash
241     setup_hdd_partitions_manuell_flash
242     fi
243     fi
244    }
245    
246    dialog_setup_hdd_partitions_silent()
247    {
248   dialog \   dialog \
249   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
250   --infobox "Erstelle Partitionen ..." 3 70   --infobox "Erstelle Partitionen ..." 3 70
251  }  }
252    
253  dialog_setup_hdd_format() {  dialog_setup_hdd_format()
254    {
255   dialog \   dialog \
256   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
257   --infobox "Erstelle Datei-Systeme ..." 3 70   --infobox "Erstelle Datei-Systeme ..." 3 70
258  }  }
259    
260  dialog_install_settings() {  dialog_install_settings()
261    {
262   dialog \   dialog \
263   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
264   --infobox "Speichere System-Einstellungen ..." 3 70   --infobox "Speichere System-Einstellungen ..." 3 70
265  }  }
266    
267  dialog_install_system_image() {  dialog_install_system_image()
268    {
269   dialog \   dialog \
270   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
271   --gauge "Kopiere System-Image ..." 6 80   --gauge "Kopiere System-Image ..." 6 80
272  }  }
273    
274  dialog_install_meter() {  dialog_install_meter()
275   while [ "${CURRENTLINE}" != "${TOTALLINES}" ] ; do  {
276   CURRENTLINE=`grep --count . /tmp/install.log`   while [[ ${CURRENTLINE} != ${TOTALLINES} ]]
277   PERCENT=`expr ${CURRENTLINE} \* 100 / ${TOTALLINES}`   do
278     CURRENTLINE=$(grep --count . /tmp/install.log)
279     PERCENT=$(expr ${CURRENTLINE} \* 100 / ${TOTALLINES})
280   echo ${PERCENT}   echo ${PERCENT}
281   sleep 1   sleep 1
282   done   done
# Line 238  dialog_install_meter() { Line 285  dialog_install_meter() {
285  }  }
286    
287    
288  dialog_install_bootsector() {  dialog_install_bootsector()
289    {
290   dialog \   dialog \
291   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
292   --infobox "Schreibe den Bootsektor ..." 3 70   --infobox "Schreibe den Bootsektor ..." 3 70
293  }  }
294    
295  dialog_install_alxconfig() {  dialog_install_alxconfig()
296    {
297   dialog \   dialog \
298   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
299   --infobox "Installiere die ALX Setup-Tools ..." 3 70   --infobox "Installiere die ALX Setup-Tools ..." 3 70
300  }  }
301    
302  dialog_install_kernel_image() {  dialog_install_kernel_image()
303    {
304   dialog \   dialog \
305   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
306   --infobox "Installiere den System-Kernel ..." 3 70   --infobox "Installiere den System-Kernel ..." 3 70
307    
308  }  }
309    
310  dialog_install_hotfixes() {  dialog_install_hotfixes()
311    {
312   dialog \   dialog \
313   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
314   --infobox "Installiere Hotfixes ..." 3 70   --infobox "Installiere Hotfixes ..." 3 70
315    
316  }  }
317    
318  dialog_install_successful() {  dialog_install_successful()
319    {
320   dialog \   dialog \
321   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
322   --colors \   --colors \
323   --msgbox "Die Installation war \Z2erfolgreich\Zn." 5 81   --msgbox "Die Installation war \Z2erfolgreich\Zn." 5 81
324  }  }
325    
326  dialog_install_failure() {  dialog_install_failure()
327    {
328   dialog \   dialog \
329   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
330   --colors \   --colors \
331   --msgbox "Die Installation ist \Z1Fehlgeschlagen\Zn.\n\n\   --msgbox "Die Installation ist \Z1Fehlgeschlagen\Zn.\n\n\
332   Fehler bei $ERROR, RetVal: $RETVAL \   Fehler bei ${ERROR}, RetVal: ${RETVAL} \
333   " 10 81   " 10 81
334  }  }
335    
336  dialog_install_method() {  dialog_install_method()
337    {
338    
339   METHOD=`dialog \   METHOD=$(dialog \
340   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
341   --cancel-label "Abbrechen" \   --cancel-label "Abbrechen" \
342   --ok-label "Weiter" \   --ok-label "Weiter" \
343   --stdout \   --stdout \
344   --menu "Konfiguration" 14 70 5 \   --menu "Konfiguration" 14 70 5 \
345   "1" "Normale Installation" \   "1" "Normale Installation" \
346   "2" "Silent Installation"`   "2" "Silent Installation")
347   RES=$?   RES=$?
348   if [ "$RES" == "1" ];then   [[ ${RES} -eq 1 ]] && return 1
349   return 1   if [[ ${RES} -eq 0 ]]
350   fi   then
351   if [ "$RES" == "0" ];then   case ${METHOD} in
352   case "$METHOD" in           "1") run_install_normal ;;
353           "1")   "2") dialog_warning ; run_install_silent ;;
  run_install_normal  
  ;;  
  "2")  
  dialog_warning  
  run_install_silent  
      ;;  
354   esac   esac
355   fi   fi
356  }  }
357    
358  dialog_main() {  dialog_main()
359    {
360   METHOD=0   METHOD=0
361    
362   while [ $METHOD -le 2 ]   while [[ ${METHOD} -le 2 ]]
363   do   do
364   METHOD=`dialog \   METHOD=$(dialog \
365   --backtitle "$TITLE" \   --backtitle "${TITLE}" \
366   --no-cancel \   --no-cancel \
367   --ok-label "Weiter" \   --ok-label "Weiter" \
368   --stdout \   --stdout \
# Line 321  dialog_main() { Line 370  dialog_main() {
370   "1" "AutoSta_LX installieren" \   "1" "AutoSta_LX installieren" \
371   "2" "Uebersicht gefundener Laufwerke" \   "2" "Uebersicht gefundener Laufwerke" \
372   "3" "Beenden und neustarten" \   "3" "Beenden und neustarten" \
373   "4" "Beenden und eine Shell starten" `   "4" "Beenden und eine Shell starten")
374   RES=$?   RES=$?
375   if [ "$RES" == "1" ];then   if [[ ${RES} -eq 1 ]] && exit 1
376   exit 1   if [[ ${RES} -eq 0 ]]
377   fi   then
378   if [ "$RES" == "0" ];then   case ${METHOD} in
379   case "$METHOD" in           "1") dialog_setup_system_menu ;;
380           "1")   "2") dialog_setup_hdd_found_manuell ;;
381   #only for now later it will be used again   "3") install_do_reboot ;;
382   #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  
  ;;  
383   esac   esac
384   fi   fi
385   done   done
# Line 348  dialog_main() { Line 388  dialog_main() {
388  #################################################  #################################################
389  # Install Komandos #  # Install Komandos #
390  #################################################  #################################################
391  setup_hdd_partitions_manuell() {  setup_hdd_partitions_manuell()
392    {
393   BOOTHDD="${HDD}1"   BOOTHDD="${HDD}1"
394   SWAPHDD="${HDD}2"   SWAPHDD="${HDD}2"
395   ROOTHDD="${HDD}3"   ROOTHDD="${HDD}3"
396    
397   ## hdds partitionieren manuell   ## hdds partitionieren manuell
398   cfdisk $HDD || die   cfdisk ${HDD} || die
399  }  }
400    
401  setup_hdd_partitions_silent() {  setup_hdd_partitions_manuell_flash()
402    {
403     ROOTHDD="${HDD}1"
404    
405     ## hdds partitionieren manuell
406     cfdisk ${HDD} || die
407    }
408    
409    setup_hdd_partitions_silent()
410    {
411   ## hdds löschen   ## hdds löschen
412   dd if=/dev/zero of=$HDD bs=1024k count=1 || die   dd if=/dev/zero of=${HDD} bs=1024k count=1 || die
413   ## hdds partitionieren silent   ## hdds partitionieren silent
414   fdisk $HDD < $CONFIGS_TEMPLATE/fdisksettings #1> /dev/null 3> /dev/null || die   fdisk ${HDD} < ${CONFIGS_TEMPLATE}/fdisksettings
415    
416   read   read
417  }  }
418    
419  setup_hdd_format() {  setup_hdd_format()
420   mkswap $SWAPHDD || die  {
421   mke2fs -j -q $BOOTHDD || die   mkswap ${SWAPHDD} || die
422   mke2fs -j -q $ROOTHDD || die   mke2fs -j -q ${BOOTHDD} || die
423  }   mke2fs -j -q ${ROOTHDD} || die
   
 install_mount_rootfs() {  
  swapon $SWAPHDD || die  
  mount $ROOTHDD $INSTALLPATH || die  
  install -d $INSTALLPATH/boot || die  
  mount $BOOTHDD $INSTALLPATH/boot || die  
  cd $INSTALLPATH || die  
424  }  }
425    
426  install_system_image() {  setup_hdd_format_flash()
427   #tar xvzpf $CDPATH/system/autosta_lx.tar.gz  {
428   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}   mke2fs -j -q ${ROOTHDD} || die
429    }
430    
431    install_mount_rootfs()
432    {
433     swapon ${SWAPHDD} || die
434     mount ${ROOTHDD} ${INSTALLPATH} || die
435     install -d ${INSTALLPATH}/boot || die
436     mount ${BOOTHDD} ${INSTALLPATH}/boot || die
437     cd ${INSTALLPATH} || die
438  }  }
439    
440    install_mount_rootfs_flash()
441    {
442     mount ${ROOTHDD} ${INSTALLPATH} || die
443     install -d ${INSTALLPATH}/boot || die
444     cd ${INSTALLPATH} || die
445    }
446    
447  install_kernel_image() {  install_system_image()
448   declare -i CPUTYPE=`cat /proc/cpuinfo |grep "cpu family"|cut -d ' ' -f3`  {
449     tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}
450    }
451    
  if [ $CPUTYPE -le 5 ];then  
                 #echo -e "\033[1;6m\033[36m""i386 Architektur gefunden.""\033[0m"  
                 #echo -e "Installiere i386 Kernel..."  
452    
453   lastdir="`pwd`"  install_kernel_image()
454    {
455     declare -i CPUTYPE=$(cat /proc/cpuinfo | grep "cpu family" | cut -d ' ' -f3)
456    
457   mkdir -p $INSTALLPATH/INSTALL/kernel || die   if [[ ${CPUTYPE} -le 5 ]]
458   cd $INSTALLPATH/INSTALL/kernel || die   then
459   tar xzpf $CDPATH/kernels/kernel-i386.tar.gz || die   lastdir="$(pwd)"
  source $INSTALLPATH/INSTALL/kernel/kernelversion || die  
460    
461   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNLIB $INSTALLPATH/lib/modules || die   mkdir -p ${INSTALLPATH}/INSTALL/kernel || die
462   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNIMG $INSTALLPATH/boot || die   cd ${INSTALLPATH}/INSTALL/kernel || die
463   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNINITRD $INSTALLPATH/boot || die   tar xzpf ${CDPATH}/kernels/kernel-i386.tar.gz || die
464   cp -aRf $INSTALLPATH/INSTALL/kernel/kernelversion $INSTALLPATH/boot || die   source ${INSTALLPATH}/INSTALL/kernel/kernelversion || die
465    
466   cd $lastdir || die   cp -aRf ${INSTALLPATH}/INSTALL/kernel/${KRNLIB} ${INSTALLPATH}/lib/modules || die
467     cp -aRf ${INSTALLPATH}/INSTALL/kernel/${KRNIMG} ${INSTALLPATH}/boot || die
468     cp -aRf ${INSTALLPATH}/INSTALL/kernel/${KRNINITRD} ${INSTALLPATH}/boot || die
469     cp -aRf ${INSTALLPATH}/INSTALL/kernel/kernelversion ${INSTALLPATH}/boot || die
470    
471          elif [ $CPUTYPE -ge 6 ];then   cd ${lastdir} || die
                 #echo -e "\033[1;6m\033[36m""i686 Architektur gefunden.""\033[0m"  
                 #echo -e "Installiere i686 Kernel..."  
472    
473   lastdir="`pwd`"          elif [[ ${CPUTYPE} -ge 6 ]]
474     then
475     lastdir="$(pwd)"
476    
477   mkdir -p $INSTALLPATH/INSTALL/kernel || die   mkdir -p ${INSTALLPATH}/INSTALL/kernel || die
478   cd $INSTALLPATH/INSTALL/kernel || die   cd ${INSTALLPATH}/INSTALL/kernel || die
479   tar xzpf $CDPATH/kernels/kernel-i686.tar.gz || die   tar xzpf ${CDPATH}/kernels/kernel-i686.tar.gz || die
480   source $INSTALLPATH/INSTALL/kernel/kernelversion || die   source ${INSTALLPATH}/INSTALL/kernel/kernelversion || die
481    
482   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNLIB $INSTALLPATH/lib/modules || die   cp -aRf ${INSTALLPATH}/INSTALL/kernel/${KRNLIB} ${INSTALLPATH}/lib/modules || die
483   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNIMG $INSTALLPATH/boot || die   cp -aRf ${INSTALLPATH}/INSTALL/kernel/${KRNIMG} ${INSTALLPATH}/boot || die
484   cp -aRf $INSTALLPATH/INSTALL/kernel/$KRNINITRD $INSTALLPATH/boot || die   cp -aRf ${INSTALLPATH}/INSTALL/kernel/${KRNINITRD} ${INSTALLPATH}/boot || die
485   cp -aRf $INSTALLPATH/INSTALL/kernel/kernelversion $INSTALLPATH/boot || die   cp -aRf ${INSTALLPATH}/INSTALL/kernel/kernelversion ${INSTALLPATH}/boot || die
486    
487   cd $lastdir || die   cd ${lastdir} || die
488          fi          fi
489  }  }
490    
491  install_bootsector() {  install_bootsector()
492    {
493   ### grubconf schreiben   ### grubconf schreiben
494   source $INSTALLPATH/INSTALL/kernel/kernelversion   source ${INSTALLPATH}/INSTALL/kernel/kernelversion
495    
496   if [ -z $KRNVER ]   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"
497   then   [[ -z ${KRNIMG} ]] && KRNIMG="bzImage"
498   KRNVER="AutoSta_LX"   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"
  fi  
499    
  if [ -z $KRNIMG ]  
  then  
  KRNIMG="bzImage"  
  fi  
500    
501   if [ -z $KRNINITRD ]   echo -e "default 0" > ${INSTALLPATH}/boot/grub/grub.conf || die
502   then   echo -e "timeout 03" >> ${INSTALLPATH}/boot/grub/grub.conf ||die
503   KRNINITRD="initrd"   echo -e "\ntitle=${KRNVER}" >> ${INSTALLPATH}/boot/grub/grub.conf || die
504   fi   echo -e "root (hd0,0)" >> ${INSTALLPATH}/boot/grub/grub.conf || die
505    
506   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die   echo -e "kernel (hd0,0)/boot/${KRNIMG} root=${ROOTHDD} quiet" >> ${INSTALLPATH}/boot/grub/grub.conf || die
  echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die  
  #no support for splash image in 6.1-r2  
  #echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die  
  echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die  
  echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die  
   
  #s3 cards don't support this  
  #echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD vga=0x317 video:vesa:ywrap,mtrr splash=silent quiet" >> $INSTALLPATH/boot/grub/grub.conf || die  
  #that's more safer:  
  echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD quiet" >> $INSTALLPATH/boot/grub/grub.conf || die  
   
  #not needed without bootsplash support  
  #echo -e "initrd=/boot/${KRNINITRD}" >> $INSTALLPATH/boot/grub/grub.conf || die  
507    
508   ### bootsector schreiben   ### bootsector schreiben
  #grub --no-floppy < $CONFIGS_TEMPLATE/grubsettings || die  
509   /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null || die   /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null || die
510  root (hd0,0)  root (hd0,0)
511  setup (hd0)  setup (hd0)
# Line 470  quit Line 513  quit
513  EOF  EOF
514  }  }
515    
516  install_bootsector_chroot() {  install_bootsector_chroot()
517    {
518   ### grubconf schreiben   ### grubconf schreiben
519   #source $INSTALLPATH/INSTALL/kernel/kernelversion   source ${INSTALLPATH}/boot/kernelversion
  source $INSTALLPATH/boot/kernelversion  
520    
521   #for alx only   #for alx only
522   if [ -e ${INSTALLPATH}/etc/alx_version ]   if [ -e ${INSTALLPATH}/etc/alx_version ]
# Line 484  install_bootsector_chroot() { Line 527  install_bootsector_chroot() {
527   ALXVER="${OLD_ALXVER}"   ALXVER="${OLD_ALXVER}"
528   fi   fi
529    
530   if [ -z "$KRNVER" ]   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"
531   then   [[ -z ${KRNIMG} ]] && KRNIMG="bzImage"
532   KRNVER="AutoSta_LX"   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"
  fi  
   
  if [ -z "$KRNIMG" ]  
  then  
  KRNIMG="bzImage"  
  fi  
   
  if [ -z "$KRNINITRD" ]  
  then  
  KRNINITRD="initrd"  
  fi  
533    
534   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die   echo -e "default 0" > ${INSTALLPATH}/boot/grub/grub.conf || die
535   echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die   echo -e "timeout 0" >> ${INSTALLPATH}/boot/grub/grub.conf ||die
536    
537   #no support for splash image in 6.1-r2   echo -e "\ntitle=${KRNVER}" >> ${INSTALLPATH}/boot/grub/grub.conf || die
538   #echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die   echo -e "root (hd0,0)" >> ${INSTALLPATH}/boot/grub/grub.conf || die
539    
540   echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die   echo -e "kernel (hd0,0)/boot/${KRNIMG} root=${ROOTHDD} quiet" >> ${INSTALLPATH}/boot/grub/grub.conf || die
  echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die  
541    
  #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  
   
   
542   ### bootsector schreiben chrooted schreiben (gentoo)   ### bootsector schreiben chrooted schreiben (gentoo)
543   if [ -f $INSTALLPATH/sbin/grub ]   if [ -f ${INSTALLPATH}/sbin/grub ]
544   then   then
545   cat > $INSTALLPATH/root/.bashrc << CHROOTEOF   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF
546  /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null  /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null
547  root (hd0,0)  root (hd0,0)
548  setup (hd0)  setup (hd0)
# Line 531  CHROOTEOF Line 553  CHROOTEOF
553   fi   fi
554    
555   ### bootsector schreiben chrooted schreiben (lfs/magellan)   ### bootsector schreiben chrooted schreiben (lfs/magellan)
556   if [ -f $INSTALLPATH/usr/sbin/grub ]   if [ -f ${INSTALLPATH}/usr/sbin/grub ]
557   then   then
558   cat > $INSTALLPATH/root/.bashrc << CHROOTEOF   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF
559  /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null  /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null
560  root (hd0,0)  root (hd0,0)
561  setup (hd0)  setup (hd0)
# Line 544  CHROOTEOF Line 566  CHROOTEOF
566   fi   fi
567    
568   ##enters chroot   ##enters chroot
569   mount -t proc none $INSTALLPATH/proc   mount -t proc none ${INSTALLPATH}/proc
570   # bind /dev to get the devices right,   mount -o bind /dev ${INSTALLPATH}/dev
571   # if bootet from a 2.6 kernel with udev   chroot ${INSTALLPATH} /bin/bash --rcfile /root/.bashrc -i
572   mount -o bind /dev $INSTALLPATH/dev   umount ${INSTALLPATH}/proc
573   chroot $INSTALLPATH /bin/bash --rcfile /root/.bashrc -i   umount ${INSTALLPATH}/dev
574   umount $INSTALLPATH/proc   rm ${INSTALLPATH}/root/.bashrc
  umount $INSTALLPATH/dev  
  rm $INSTALLPATH/root/.bashrc  
575  }  }
576    
577  install_alxconfig(){  install_alxconfig()
578   lastdir="`pwd`"  {
579     lastdir="$(pwd)"
580    
581   mkdir -p $INSTALLPATH/opt/alx-config || die   mkdir -p ${INSTALLPATH}/opt/alx-config || die
582   cd $INSTALLPATH/opt/alx-config || die   cd ${INSTALLPATH}/opt/alx-config || die
583   tar xzpf $CDPATH/alx-config/alx-config.tar.gz || die   tar xzpf ${CDPATH}/alx-config/alx-config.tar.gz || die
584   chmod a+x $INSTALLPATH/opt/alx-config/Configurator/config_functions.sh || die   chmod a+x ${INSTALLPATH}/opt/alx-config/Configurator/config_functions.sh || die
585   chmod a+x $INSTALLPATH/opt/alx-config/Configurator/config_menu.sh || die   chmod a+x ${INSTALLPATH}/opt/alx-config/Configurator/config_menu.sh || die
586   ln -sf /opt/alx-config/Configurator/config_menu.sh $INSTALLPATH/bin/ALXConfig || die   ln -sf /opt/alx-config/Configurator/config_menu.sh ${INSTALLPATH}/bin/ALXConfig || die
587    
588   cd $lastdir || die   cd ${lastdir} || die
589  }  }
590    
591    
592  install_system_settings(){  install_system_settings()
593    {
594   ### schreibe fstab   ### schreibe fstab
595   echo -e "$BOOTHDD\t/\text3\tnoatime,noauto\t1 1" > $INSTALLPATH/etc/fstab || die   echo -e "${BOOTHDD}\t/boot\text3\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die
596   echo -e "$ROOTHDD\t/\text3\tnoatime\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "${ROOTHDD}\t/\text3\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die
597   echo -e "$SWAPHDD\tswap\tswap\tpri=1\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "${SWAPHDD}\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die
598   echo -e "none\t/proc\tproc\tdefaults\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  
599    
600   echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
601   echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
602  }  }
603    
604  install_hotfixes(){  install_system_settings_flash()
605   if [ -f $CDPATH/hotfixes/hotfixes.sh ]  {
606     ### schreibe fstab
607     echo -e "${ROOTHDD}\t/\text3\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die
608     echo -e "none\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
609    
610     echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
611     echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
612    }
613    
614    install_hotfixes()
615    {
616     if [ -f ${CDPATH}/hotfixes/hotfixes.sh ]
617   then   then
618   dialog_hotfixes   dialog_hotfixes
619   sleep1   sleep1
620   $CDPATH/hotfixes/hotfixes.sh   ${CDPATH}/hotfixes/hotfixes.sh
621   fi   fi
622  }  }
623    
624  install_umount_rootfs() {  install_umount_rootfs()
625    {
626   cd /   cd /
627   umount $INSTALLPATH/boot || die   umount ${INSTALLPATH}/boot || die
628   umount $INSTALLPATH || die   umount ${INSTALLPATH} || die
629   swapoff $SWAPHDD || die   swapoff ${SWAPHDD} || die
630  }  }
631    
632  install_do_reboot() {  install_umount_rootfs_flash()
633    {
634   #only for now later it will be used again   cd /
635   #with 6.1-r2 these options are not available   umount ${INSTALLPATH} || die
636   #cd /  }
637   #umount $CDPATH  
638   #eject  install_do_reboot()
639   #clear  {
   
640   reboot   reboot
641  }  }
642    
# Line 614  install_do_reboot() { Line 644  install_do_reboot() {
644  #     Install Ablauf Scripte #  #     Install Ablauf Scripte #
645  #################################################  #################################################
646    
647  run_install_normal() {  run_install_normal()
648   #only for now later it will be used again  {
  #with 6.1-r2 only one install method available  
  #dialog_setup_hdd_menu  
649   dialog_setup_hdd_found_manuell   dialog_setup_hdd_found_manuell
650    
651   dialog_setup_hdd_partitions_manuell   dialog_setup_hdd_partitions_manuell
652   dialog_setup_hdd_format   dialog_setup_hdd_format
653   setup_hdd_format > /dev/null   setup_hdd_format > /dev/null
654   install_mount_rootfs   install_mount_rootfs
655   (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
656    
  #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  
   
657   dialog_install_bootsector   dialog_install_bootsector
658   install_bootsector_chroot   install_bootsector_chroot
659    
  #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  
   
660   dialog_install_settings   dialog_install_settings
661   sleep 1   sleep 1
662   install_system_settings   install_system_settings
# Line 648  run_install_normal() { Line 665  run_install_normal() {
665   dialog_install_successful   dialog_install_successful
666  }  }
667    
668  run_install_silent() {  run_install_flash()
669    {
670     dialog_setup_hdd_found_manuell
671    
672     dialog_setup_hdd_partitions_manuell_flash
673     dialog_setup_hdd_format
674     setup_hdd_format_flash > /dev/null
675     install_mount_rootfs_flash
676     (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
677    
678     dialog_install_bootsector
679     install_bootsector_chroot
680    
681     dialog_install_settings
682     sleep 1
683     install_system_settings_flash
684     install_hotfixes
685     install_umount_rootfs_flash
686     dialog_install_successful
687    }
688    
689    run_install_silent()
690    {
691   echo "starting silent install ..."   echo "starting silent install ..."
692   sleep 1   sleep 1
693  }  }
694    
695  run_install_unattended() {  run_install_unattended()
696    {
697   echo "starting unattended install ..."   echo "starting unattended install ..."
698   sleep 1   sleep 1
699  }  }
700    
701  if [ "$1" == "unattended" ]  if [[ $1 = unattended ]]
702  then  then
703   run_install_unattended   run_install_unattended
704  else  else

Legend:
Removed from v.261  
changed lines
  Added in v.520