Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 280 - (hide annotations) (download) (as text)
Wed Aug 17 03:35:09 2005 UTC (18 years, 8 months ago) by niro
Original Path: alx-src/trunk/alxinstall-ng/bin/alxinstall-ng.sh
File MIME type: application/x-sh
File size: 19275 byte(s)
added flash support; oh an i have to rewrite this crappy thing

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