Magellan Linux

Annotation of /trunk/installer-simple/bin/installer.sh.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2475 - (hide annotations) (download)
Wed Jan 8 08:59:52 2014 UTC (10 years, 4 months ago) by niro
File size: 17013 byte(s)
-split dialog_setup_system_menu() into task_setup_system_menu() and the dialog itself to dialog_setup_system_menu(), which moved to installer-dialogs.sh
1 niro 2323 #!/bin/bash
2 niro 2322 # $Id$
3 niro 2320 #
4 niro 2322 # Simple Installation Script
5     # merged from alxinstall-ng and mcore-installer
6 niro 2320 #
7     # Niels Rogalla <niro@magellan-linux.de>
8     #
9    
10 niro 2472 # setup locales
11     TEXTDOMAIN=installer
12     LC_MESSAGES=C
13    
14 niro 2340 # include dir
15 niro 2333 INSTALLER_LIBDIR="%LIBDIR%"
16    
17 niro 2340 # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !
18     # -> now in images.conf
19     CURRENTLINE=0
20    
21 niro 2397 die()
22     {
23     echo "Error: $@"
24     exit 1
25     }
26    
27 niro 2401 # load common includes
28 niro 2402 for inc in %SYSCONFDIR%/installer.conf \
29     ${INSTALLER_LIBDIR}/functions/common.sh \
30     ${INSTALLER_LIBDIR}/functions/common-dialogs.sh \
31     ${INSTALLER_LIBDIR}/functions/hwdetection.sh \
32 niro 2428 ${INSTALLER_LIBDIR}/functions/bootloader.sh \
33     ${INSTALLER_LIBDIR}/functions/initrd-tools.sh \
34 niro 2402 ${INSTALLER_LIBDIR}/functions/installer-dialogs.sh
35 niro 2401 do
36     if [ -e ${inc} ]
37     then
38     source "${inc}"
39     else
40     die "'${inc}' not found"
41     fi
42     done
43 niro 2332
44 niro 2340 # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !
45     # -> now in images.conf
46     CDIMAGENAME=""
47     TOTALLINES=""
48     CURRENTLINE=0
49 niro 2334 if [ -e /mnt/cdrom/system/images.conf ]
50     then
51     source /mnt/cdrom/system/images.conf
52 niro 2340 # check if all required variables are set
53     [[ -z ${CDIMAGENAME} ]] && die "CDIMAGENAME is empty in /mnt/cdrom/system/images.conf"
54     [[ -z ${TOTALLINES} ]] && die "TOTALLINES is empty in /mnt/cdrom/system/images.conf"
55 niro 2334 else
56     die "/mnt/cdrom/system/images.conf not found"
57     fi
58 niro 2320
59     ### System/Config Version
60     VERSION="%VERSIONTAG%"
61 niro 2332 TITLE="${DEFAULT_TITLE} - ${VERSION}"
62 niro 2320
63 niro 2404 # some sane defaults
64 niro 2343 CDROOT="${DEFAULT_CDROOT}"
65 niro 2342 INSTALLROOT="${DEFAULT_INSTALLROOT}"
66 niro 2404 KERNELPKG="${DEFAULT_KERNELPKG}"
67     KERNELOPTS="${DEFAULT_KERNELOPTS}"
68 niro 2320 GRUBLEGACYOPTS=""
69     GRUB2OPTS=""
70     FDISKPARTIONBELOW256MB=0
71     SPECIALDEVICE=""
72 niro 2404 FORMFACTOR="${DEFAULT_FORMFACTOR}"
73 niro 2332 FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}"
74 niro 2320
75     #################################################
76     # DIALOG BOXEN #
77     #################################################
78    
79 niro 2409 trap_exit()
80     {
81     is_mounted --location "${INSTALLROOT}/dev" && umount ${INSTALLROOT}/dev
82     is_mounted --location "${INSTALLROOT}/proc" && umount ${INSTALLROOT}/proc
83     is_mounted --location "${INSTALLROOT}/sys" && umount ${INSTALLROOT}/sys
84     is_mounted --location "${INSTALLROOT}/boot" && umount ${INSTALLROOT}/boot
85     is_mounted --location "${INSTALLROOT}" && umount ${INSTALLROOT}
86    
87     echo $"Installation aborted."
88     exit 1
89     }
90    
91 niro 2336 dialog_die()
92     {
93 niro 2341 ERROR="$1"
94     RETVAL="$?"
95 niro 2320 dialog_install_failure
96     exit 1
97     }
98    
99     dialog_warning()
100     {
101 niro 2398 local retval
102    
103     yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?"
104     retval=$?
105     if [[ ${retval} -eq 1 ]]
106 niro 2320 then
107     clear
108 niro 2398 echo $"The process was aborted."
109 niro 2320 exit 1
110     fi
111     }
112    
113 niro 2475 task_setup_system_menu()
114 niro 2320 {
115 niro 2412 local mode
116     local retval
117 niro 2320
118 niro 2475 mode="$(dialog_setup_system_menu)"
119 niro 2412 retval=$?
120     [[ ${retval} -eq 1 ]] && return 1
121     if [[ ${retval} -eq 0 ]]
122 niro 2320 then
123 niro 2415 case "${mode}" in
124 niro 2320 "1") run_install_auto ;;
125 niro 2341 "2") run_install_normal ;;
126 niro 2475 "") task_setup_system_menu;;
127 niro 2320 esac
128     fi
129     }
130    
131     dialog_hardware_detection()
132     {
133 niro 2417 local message
134 niro 2320
135 niro 2344 run_hardware_detection_disks
136 niro 2320
137 niro 2417 message+=$"Harddrives:\n"
138 niro 2320
139 niro 2344 if [[ ! -z ${ALL_DISKS} ]]
140 niro 2320 then
141 niro 2344 for i in ${ALL_DISKS}
142 niro 2320 do
143 niro 2417 message+="\Z3${i}\Zn "
144 niro 2320 done
145 niro 2417 message+="\n"
146 niro 2320 fi
147    
148 niro 2344 if [[ ! -z ${ALL_CDROMS} ]]
149 niro 2320 then
150 niro 2417 message+="\n"
151     message+=$"Optical disk drives:\n"
152 niro 2344 for i in ${ALL_CDROMS}
153 niro 2320 do
154 niro 2417 message+="\Z3${i}\Zn"
155 niro 2320 done
156 niro 2417 message+="\n"
157 niro 2320 fi
158    
159     # other devices
160     run_hardware_detection
161     case "${SPECIALDEVICE}" in
162 niro 2417 zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;;
163     rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;;
164     maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;;
165 niro 2470 *) message+=$"\n\ZnCommon device detected.\Zn" ;;
166 niro 2320 esac
167     if [[ ${FORMFACTOR} = laptop ]]
168     then
169 niro 2460 message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn"
170 niro 2320 fi
171    
172 niro 2467 messagebox -y 12 -h $"Detected hardware:" "${message}"
173 niro 2320 }
174    
175 niro 2413 dialog_setup_hdd_partitions_manual()
176 niro 2320 {
177     local i
178 niro 2422 local retval
179 niro 2320
180 niro 2418 if [[ -z ${ALL_DISKS} ]]
181 niro 2320 then
182 niro 2421 dialog_no_harddrive_found
183 niro 2320 exit 1
184     else
185 niro 2422 HDD=$(dialog_select_target_harddrive)
186     retval=$?
187     [[ ${retval} -eq 1 ]] && return 1
188     if [[ ${retval} -eq 0 ]]
189 niro 2320 then
190     dialog_setup_hdd_info
191 niro 2413 setup_hdd_partitions_manual
192 niro 2320 fi
193     fi
194     }
195    
196     dialog_setup_hdd_partitions_auto()
197     {
198     local i
199 niro 2422 local retval
200 niro 2320
201 niro 2419 if [[ -z ${ALL_DISKS} ]]
202 niro 2320 then
203 niro 2421 dialog_no_harddrive_found
204 niro 2320 exit 1
205     else
206 niro 2422 HDD=$(dialog_select_target_harddrive)
207     retval=$?
208     [[ ${retval} -eq 1 ]] && return 1
209     if [[ ${retval} -eq 0 ]]
210 niro 2320 then
211     dialog_setup_hdd_info_auto
212     dialog_setup_hdd_create_partitions
213     setup_hdd_partitions_auto
214     fi
215     fi
216     }
217    
218 niro 2423 install_meter()
219 niro 2320 {
220     while [[ ${CURRENTLINE} != ${TOTALLINES} ]]
221     do
222     CURRENTLINE=$(grep -c . /tmp/install.log)
223     PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES}))
224     echo ${PERCENT}
225     sleep 1
226     done
227     rm -f /tmp/install.log
228     return 0
229     }
230    
231     dialog_main()
232     {
233 niro 2424 local method=0
234     local retval
235 niro 2320
236 niro 2424 while [[ ${method} -le 2 ]]
237 niro 2320 do
238 niro 2471 method=$(CANCEL_LABEL=$"Exit" menubox $"Configuration:" \
239 niro 2425 $"1:Install system" \
240     $"2:Show detected harddrives" \
241     $"3:Exit and reboot" \
242     $"4:Exit and drop into a shell")
243 niro 2424 retval=$?
244     [[ ${retval} -eq 1 ]] && exit 1
245     if [[ ${retval} -eq 0 ]]
246 niro 2320 then
247 niro 2424 case ${method} in
248 niro 2475 "1") task_setup_system_menu ;;
249 niro 2320 "2") dialog_hardware_detection ;;
250     "3") install_do_reboot ;;
251     "4") /bin/bash --login -i ;;
252     esac
253     fi
254     done
255     }
256    
257     #################################################
258     # Install Komandos #
259     #################################################
260     run_hardware_detection()
261     {
262     local hwinfo
263    
264     hwinfo="$(hwinfo --bios --storage --pci --gfxcard --sys)"
265    
266 niro 2430 ## check for special devices/clients:
267     ## if zotac a zotac and the disk is a removeable device, then add rootdelay to kernelcmd
268     #local removable=0
269     #if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]]
270     #then
271     #for i in /sys/block/[hs]d*/removable
272     #do
273     #if [[ $(< ${i}) = 1 ]]
274     #then
275     #removable=1
276     #fi
277     #done
278 niro 2431 ## smartcard = udevadm info -n /dev/sda -a | grep -i 'configuration.*card'
279 niro 2320
280 niro 2430 ## only add this for grub legacy, grub2 detect these settings on its own
281     #export GRUBLEGACYOPTS="rootdelay=8"
282     ## there are to zotac types in the wild, nvidia based gfx and intel
283     #if [[ ! -z $(echo "${hwinfo}" | grep -i nouveau) ]]
284     #then
285     #export SPECIALDEVICE="zotac_nvidia"
286     #else
287     #export SPECIALDEVICE="zotac_intel"
288     #fi
289     #fi
290 niro 2320
291     # check for special devices/clients:
292     # if a rangee and disk ist smaller then 256mb move partion one block further ahead
293     if [[ ! -z $(echo "${hwinfo}" | grep -i CLE266) ]]
294     then
295     # for a rangee always define partion startblock +1
296     export FDISKPARTIONBELOW256MB="1"
297     export SPECIALDEVICE="rangee"
298     export GRUBLEGACYOPTS=""
299     fi
300    
301     # check for special devices/clients:
302     # check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer
303     if [[ ! -z $(echo "${hwinfo}" | grep -i i810) ]] || [[ ! -z $(echo "${hwinfo}" | grep -i i815) ]]
304     then
305     export SPECIALDEVICE="maxdata"
306     export GRUBLEGACYOPTS=""
307     fi
308    
309     # check for special devices/clients:
310     # check for laptops and activate cpufreq scaling
311     if [[ $(echo "${hwinfo}" | grep 'Formfactor:' | sed 's:.*Formfactor\:\ \"\(.*\)\":\1:') = laptop ]]
312     then
313     export FORMFACTOR="laptop"
314     export KERNELOPTS="${KERNELOPTS} cpufreq.governor=ondemand"
315     fi
316     }
317    
318 niro 2429 run_hardware_detection_disks()
319     {
320     local bootdev
321    
322     # all disks but exclude ramdisks
323     export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d')
324     # remove the boot device from ALL_DISKS if it was an usbstick
325     if [[ $(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]
326     then
327     bootdev="$(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g')"
328     export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")
329     fi
330     export ALL_CDROMS="$(get_hwinfo cdrom)"
331     }
332    
333 niro 2320 hdd_size_below_256mb()
334     {
335     local hdd="$1"
336     local size
337     local retval
338 niro 2336 [[ -z ${hdd} ]] && dialog_die "Error: get_hdd_size() no \$hdd given!"
339 niro 2320
340     size=$(fdisk -l ${hdd} | grep "Disk.*${hdd}" | sed 's:.*,\ \(.*\)\ byte.*:\1:')
341     if [[ ${size} -le 257000000 ]]
342     then
343     retval="0"
344     else
345     retval="1"
346     fi
347    
348     return "${retval}"
349     }
350    
351     setup_hdd_partitions_auto()
352     {
353     ROOTHDD="${HDD}1"
354    
355 niro 2435 # sanity check - should not happen
356     if is_mounted --device "${ROOTHDD}"
357     then
358     echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2
359     umount "${ROOTHDD}"
360     fi
361    
362 niro 2320 # run this only if FDISKPARTITIONBELOW256MB is not already 1
363     if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]
364     then
365     if hdd_size_below_256mb ${HDD}
366     then
367     FDISKPARTIONBELOW256MB=1
368     else
369     FDISKPARTIONBELOW256MB=0
370     fi
371     fi
372    
373     ## delete disk
374 niro 2336 dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die
375 niro 2320
376     if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
377     then
378     ## setup one bootable partition
379     #1. n= new disk
380     #2. p= primary disk
381     #3. 1= first partition
382     #4. 2= default sector start // small disk needs more space for grub2 mbr sector
383     #5. ''= defaul sector end
384     #6. a= bootable flag
385     #7. 1= boot flag for partition 1
386     #8. w= write/quit
387     fdisk ${HDD} &> /dev/null << EOF
388     n
389     p
390     1
391     2
392    
393     a
394     1
395     w
396     EOF
397     else
398     ## setup one bootable partition
399     #1. n= new disk
400     #2. p= primary disk
401     #3. 1= first partition
402     #4. ''= default sector start
403     #5. ''= defaul sector end
404     #6. a= bootable flag
405     #7. 1= boot flag for partition 1
406     #8. w= write/quit
407     fdisk ${HDD} &> /dev/null << EOF
408     n
409     p
410     1
411    
412    
413     a
414     1
415     w
416     EOF
417     fi
418     }
419    
420 niro 2413 setup_hdd_partitions_manual()
421 niro 2320 {
422     ROOTHDD="${HDD}1"
423 niro 2437 SWAPHDD=""
424     BOOTHDD=""
425 niro 2336 cfdisk ${HDD} || dialog_die
426 niro 2320 }
427    
428     setup_hdd_format()
429     {
430 niro 2435 # sanity check - should not happen
431     if is_mounted --device "${ROOTHDD}"
432     then
433     echo "format: device ${ROOTHDD} is already mounted, umount it" >&2
434     umount "${ROOTHDD}"
435     fi
436    
437 niro 2432 mkfs."${FORMAT_FILESYSTEM}" -q "${ROOTHDD}" || dialog_die
438 niro 2320 }
439    
440     install_mount_rootfs()
441     {
442 niro 2435 is_mounted --location "${INSTALLROOT}" || mount "${ROOTHDD}" "${INSTALLROOT}"
443 niro 2342 install -d ${INSTALLROOT}/boot || dialog_die
444 niro 2320 }
445    
446     install_system_image()
447     {
448 niro 2433 pushd ${INSTALLROOT} > /dev/null
449 niro 2343 tar xvjpf ${CDROOT}/system/${CDIMAGENAME} -C ${INSTALLROOT}
450 niro 2433 popd > /dev/null
451 niro 2320 }
452    
453 niro 2446 disabled_install_bootsector_chroot()
454 niro 2320 {
455     local my_roothdd
456 niro 2444 local grubconf="${INSTALLROOT}/boot/grub/grub.conf"
457     local grub2conf="/boot/grub/grub.cfg"
458 niro 2320
459     # check for grub2
460 niro 2342 if [[ -f ${INSTALLROOT}/sbin/grub-mkconfig ]]
461 niro 2320 then
462     # needed by grub-mkconfig on the first run
463 niro 2342 if [[ ! -f ${INSTALLROOT}/boot/grub/video.lst ]]
464 niro 2320 then
465 niro 2342 install -m0644 ${INSTALLROOT}/lib/grub/*/video.lst ${INSTALLROOT}/boot/grub/video.lst || dialog_die
466 niro 2320 fi
467    
468     # set kernelopts
469 niro 2342 if [[ -f ${INSTALLROOT}/etc/conf.d/grub ]]
470 niro 2320 then
471 niro 2342 sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLROOT}/etc/conf.d/grub || dialog_die
472 niro 2320 else
473 niro 2444 CONFIG="${INSTALLROOT}/etc/conf.d/grub"
474     clearconfig
475     addconfig "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\""
476 niro 2320 fi
477 niro 2444 CONFIG="${INSTALLROOT}/root/.installrc"
478     clearconfig
479     # only grub 1.99
480     addconfig 'type -P grub-mkdevicemap && grub-mkdevicemap'
481     addconfig "grub-install --no-floppy ${HDD} &> /dev/null"
482     addconfig "LC_ALL=C grub-mkconfig -o ${grub2conf} &> /dev/null"
483     addconfig "exit 0"
484 niro 2320
485     # grub-legacy
486     else
487 niro 2342 source ${INSTALLROOT}/boot/kernelversion
488 niro 2320
489 niro 2342 if [ -e ${INSTALLROOT}/etc/alx_version ]
490 niro 2320 then
491     OLD_ALXVER="${ALXVER}"
492 niro 2342 source ${INSTALLROOT}/etc/alx_version
493 niro 2320 KRNVER="ALX-${ALXVER}"
494     ALXVER="${OLD_ALXVER}"
495     fi
496    
497     [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"
498     [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"
499     [[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz"
500    
501     # uuid support
502 niro 2441 my_roothdd="UUID=$(get_uuid ${ROOTHDD})"
503 niro 2320
504 niro 2444 CONFIG="${grubconf}"
505     clearconfig
506     addconfig "default 0"
507     addconfig "timeout 3"
508 niro 2320 # using current root password
509 niro 2444 addconfig "password --md5 $(cat ${INSTALLROOT}/etc/shadow | grep root | cut -d: -f2)"
510 niro 2320
511 niro 2444 addconfig
512     addconfig "# normal boot"
513     addconfig "title ${KRNVER}"
514     addconfig "root (hd0,0)"
515     addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}"
516 niro 2320 if is_initrd_supported
517     then
518 niro 2444 addconfig "initrd /boot/${KRNINITRD}"
519 niro 2320 fi
520    
521 niro 2444 addconfig
522     addconfig "# admin boot"
523     addconfig "title ${KRNVER} - Re-run hardware-detection"
524     addconfig "lock"
525     addconfig "root (hd0,0)"
526     addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection"
527 niro 2320 if is_initrd_supported
528     then
529 niro 2444 addconfig "initrd /boot/${KRNINITRD}"
530 niro 2320 fi
531    
532 niro 2444 addconfig
533     addconfig "title ${KRNVER} - Reset *all* local settings"
534     addconfig "lock"
535     addconfig "root (hd0,0)"
536     addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings"
537 niro 2320 if is_initrd_supported
538     then
539 niro 2444 addconfig "initrd /boot/${KRNINITRD}"
540 niro 2320 fi
541    
542     # bootsector schreiben chrooted schreiben (lfs/magellan)
543 niro 2342 cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF
544 niro 2320 /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null
545     root (hd0,0)
546     setup (hd0)
547     quit
548     EOF
549     exit 0
550     CHROOTEOF
551     fi
552    
553 niro 2436 # run installrc
554     chrooted /bin/bash --rcfile /root/.installrc -i
555 niro 2342 rm ${INSTALLROOT}/root/.installrc
556 niro 2320 }
557    
558 niro 2446 disabled_install_initrd_chroot()
559 niro 2320 {
560     # only generate initrds if the cmd exists
561     is_initrd_supported || return 0
562    
563     DISKMODS="sd_mod"
564     OLDPATAMODS="amd74xx piix sis5513 via82cxxx"
565     PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via"
566     SATAMODS="sata_via sata_sis sata_nv"
567     DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via"
568     OTHERMODS=""
569     case ${SPECIALDEVICE} in
570     zotac_intel) FBMODS=""; DRMMODS="i915" ;;
571     zotac_nvidia) FBMODS=""; DRMMODS="nouveau" ;;
572     rangee) FBMODS="" ;; ## fallback to vesafb, viafb does not run on all CLE266 boards
573     # not working with kms enabled drivers -> segfaults
574     #maxdata) FBMODS="i810fb" ;; ## check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer
575     maxdata) FBMODS="" ;;
576     *) FBMODS="uvesafb" ;;
577     esac
578    
579     if [[ ${FORMFACTOR} = laptop ]]
580     then
581     OTHERMODS="acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave"
582     fi
583    
584     # install an appropriate uvesafb.conf
585 niro 2342 install -d ${INSTALLROOT}/etc/modprobe.d || dialog_die
586 niro 2444 CONFIG="${INSTALLROOT}/etc/modprobe.d/uvesafb.conf"
587     clearconfig
588     addconfig "options uvesafb mode_option=1024x768-32@60 scroll=ywrap"
589 niro 2320
590     # install an appropriate viafb.conf
591 niro 2444 CONFIG="${INSTALLROOT}/etc/modprobe.d/viafb.conf"
592     clearconfig
593     addconfig "options viafb viafb_mode=1024x768 viafb_refresh=60"
594 niro 2320
595     # install an appropriate i810fb.conf
596 niro 2444 CONFIG="${INSTALLROOT}/etc/modprobe.d/i810fb.conf"
597     clearconfig
598     addconfig "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60"
599 niro 2320
600 niro 2342 cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF
601 niro 2320 echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd
602     mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null
603     exit 0
604     CHROOTEOF
605    
606 niro 2436 # run installrc
607     chrooted /bin/bash --rcfile /root/.installrc -i
608 niro 2342 rm ${INSTALLROOT}/root/.installrc
609 niro 2320 }
610    
611     install_system_settings()
612     {
613 niro 2443 local CONFIG
614 niro 2320
615 niro 2443 # write fstab
616     CONFIG="${INSTALLROOT}/etc/fstab"
617     clearconfig
618     addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1"
619     addconfig -e "proc\t/proc\tproc\tdefaults\t0 0"
620     addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0"
621    
622 niro 2320 # install network config skeleton
623 niro 2443 CONFIG="${INSTALLROOT}/etc/conf.d/net.eth0"
624     clearconfig
625     addconfig 'ONBOOT="yes"'
626     addconfig 'NETWORKING="dhcp"'
627 niro 2320
628 niro 2442 # intel framebuffer quirk
629     if [ -e ${INSTALLROOT}/etc/splash/splash.conf ]
630 niro 2320 then
631 niro 2442 if [ -e /proc/fb ]
632 niro 2320 then
633 niro 2442 if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]
634 niro 2320 then
635 niro 2442 fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')
636     if [[ ${fbdev} != 0 ]]
637     then
638     sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLROOT}/etc/splash/splash.conf || dialog_die
639     fi
640 niro 2320 fi
641     fi
642     fi
643     }
644    
645     install_umount_rootfs()
646     {
647 niro 2435 is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot
648     is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}
649 niro 2320 }
650    
651     install_do_reboot()
652     {
653     reboot
654     }
655    
656     #################################################
657     # Install Ablauf Scripte #
658     #################################################
659    
660     run_install_normal()
661     {
662     dialog_hardware_detection
663    
664 niro 2413 dialog_setup_hdd_partitions_manual
665 niro 2320 dialog_setup_hdd_format
666     setup_hdd_format > /dev/null
667     install_mount_rootfs
668 niro 2423 (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image
669 niro 2320
670     dialog_install_settings
671     sleep 1
672     install_system_settings
673 niro 2440 if is_initrd_supported
674     then
675     dialog_install_initrd
676     initrd_config
677     initrd_install
678     fi
679 niro 2320
680     dialog_install_bootsector
681 niro 2440 bootloader_config
682     bootloader_install
683 niro 2320
684     install_umount_rootfs
685     dialog_install_successful
686     }
687    
688     run_install_auto()
689     {
690     dialog_hardware_detection
691    
692     dialog_setup_hdd_partitions_auto
693     dialog_setup_hdd_format
694 niro 2399 setup_hdd_format > /dev/null
695     install_mount_rootfs
696 niro 2423 (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image
697 niro 2320
698     dialog_install_settings
699     sleep 1
700 niro 2399 install_system_settings
701 niro 2440 if is_initrd_supported
702     then
703     dialog_install_initrd
704     initrd_config
705     initrd_install
706     fi
707 niro 2320
708     dialog_install_bootsector
709 niro 2440 bootloader_config
710     bootloader_install
711 niro 2320
712 niro 2399 install_umount_rootfs
713 niro 2320 dialog_install_successful
714     }
715    
716 niro 2409 # set some proper traps
717     trap "trap_exit" SIGINT SIGQUIT
718    
719 niro 2320 dialog_main
720    
721     exit 0