Contents of /trunk/installer-simple/bin/installer.sh.in
Parent Directory | Revision Log
Revision 2476 -
(show annotations)
(download)
Wed Jan 8 09:15:14 2014 UTC (10 years, 8 months ago) by niro
File size: 16695 byte(s)
Wed Jan 8 09:15:14 2014 UTC (10 years, 8 months ago) by niro
File size: 16695 byte(s)
-moved hdd_size_below_256mb() to hwdetection.sh
1 | #!/bin/bash |
2 | # $Id$ |
3 | # |
4 | # Simple Installation Script |
5 | # merged from alxinstall-ng and mcore-installer |
6 | # |
7 | # Niels Rogalla <niro@magellan-linux.de> |
8 | # |
9 | |
10 | # setup locales |
11 | TEXTDOMAIN=installer |
12 | LC_MESSAGES=C |
13 | |
14 | # include dir |
15 | INSTALLER_LIBDIR="%LIBDIR%" |
16 | |
17 | # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 ! |
18 | # -> now in images.conf |
19 | CURRENTLINE=0 |
20 | |
21 | die() |
22 | { |
23 | echo "Error: $@" |
24 | exit 1 |
25 | } |
26 | |
27 | # load common includes |
28 | 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 | ${INSTALLER_LIBDIR}/functions/bootloader.sh \ |
33 | ${INSTALLER_LIBDIR}/functions/initrd-tools.sh \ |
34 | ${INSTALLER_LIBDIR}/functions/installer-dialogs.sh |
35 | do |
36 | if [ -e ${inc} ] |
37 | then |
38 | source "${inc}" |
39 | else |
40 | die "'${inc}' not found" |
41 | fi |
42 | done |
43 | |
44 | # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 ! |
45 | # -> now in images.conf |
46 | CDIMAGENAME="" |
47 | TOTALLINES="" |
48 | CURRENTLINE=0 |
49 | if [ -e /mnt/cdrom/system/images.conf ] |
50 | then |
51 | source /mnt/cdrom/system/images.conf |
52 | # 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 | else |
56 | die "/mnt/cdrom/system/images.conf not found" |
57 | fi |
58 | |
59 | ### System/Config Version |
60 | VERSION="%VERSIONTAG%" |
61 | TITLE="${DEFAULT_TITLE} - ${VERSION}" |
62 | |
63 | # some sane defaults |
64 | CDROOT="${DEFAULT_CDROOT}" |
65 | INSTALLROOT="${DEFAULT_INSTALLROOT}" |
66 | KERNELPKG="${DEFAULT_KERNELPKG}" |
67 | KERNELOPTS="${DEFAULT_KERNELOPTS}" |
68 | GRUBLEGACYOPTS="" |
69 | GRUB2OPTS="" |
70 | FDISKPARTIONBELOW256MB=0 |
71 | SPECIALDEVICE="" |
72 | FORMFACTOR="${DEFAULT_FORMFACTOR}" |
73 | FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}" |
74 | |
75 | ################################################# |
76 | # DIALOG BOXEN # |
77 | ################################################# |
78 | |
79 | 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 | dialog_die() |
92 | { |
93 | ERROR="$1" |
94 | RETVAL="$?" |
95 | dialog_install_failure |
96 | exit 1 |
97 | } |
98 | |
99 | dialog_warning() |
100 | { |
101 | 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 | then |
107 | clear |
108 | echo $"The process was aborted." |
109 | exit 1 |
110 | fi |
111 | } |
112 | |
113 | task_setup_system_menu() |
114 | { |
115 | local mode |
116 | local retval |
117 | |
118 | mode="$(dialog_setup_system_menu)" |
119 | retval=$? |
120 | [[ ${retval} -eq 1 ]] && return 1 |
121 | if [[ ${retval} -eq 0 ]] |
122 | then |
123 | case "${mode}" in |
124 | "1") run_install_auto ;; |
125 | "2") run_install_normal ;; |
126 | "") task_setup_system_menu;; |
127 | esac |
128 | fi |
129 | } |
130 | |
131 | dialog_hardware_detection() |
132 | { |
133 | local message |
134 | |
135 | run_hardware_detection_disks |
136 | |
137 | message+=$"Harddrives:\n" |
138 | |
139 | if [[ ! -z ${ALL_DISKS} ]] |
140 | then |
141 | for i in ${ALL_DISKS} |
142 | do |
143 | message+="\Z3${i}\Zn " |
144 | done |
145 | message+="\n" |
146 | fi |
147 | |
148 | if [[ ! -z ${ALL_CDROMS} ]] |
149 | then |
150 | message+="\n" |
151 | message+=$"Optical disk drives:\n" |
152 | for i in ${ALL_CDROMS} |
153 | do |
154 | message+="\Z3${i}\Zn" |
155 | done |
156 | message+="\n" |
157 | fi |
158 | |
159 | # other devices |
160 | run_hardware_detection |
161 | case "${SPECIALDEVICE}" in |
162 | zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;; |
163 | rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;; |
164 | maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;; |
165 | *) message+=$"\n\ZnCommon device detected.\Zn" ;; |
166 | esac |
167 | if [[ ${FORMFACTOR} = laptop ]] |
168 | then |
169 | message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn" |
170 | fi |
171 | |
172 | messagebox -y 12 -h $"Detected hardware:" "${message}" |
173 | } |
174 | |
175 | dialog_setup_hdd_partitions_manual() |
176 | { |
177 | local i |
178 | local retval |
179 | |
180 | if [[ -z ${ALL_DISKS} ]] |
181 | then |
182 | dialog_no_harddrive_found |
183 | exit 1 |
184 | else |
185 | HDD=$(dialog_select_target_harddrive) |
186 | retval=$? |
187 | [[ ${retval} -eq 1 ]] && return 1 |
188 | if [[ ${retval} -eq 0 ]] |
189 | then |
190 | dialog_setup_hdd_info |
191 | setup_hdd_partitions_manual |
192 | fi |
193 | fi |
194 | } |
195 | |
196 | dialog_setup_hdd_partitions_auto() |
197 | { |
198 | local i |
199 | local retval |
200 | |
201 | if [[ -z ${ALL_DISKS} ]] |
202 | then |
203 | dialog_no_harddrive_found |
204 | exit 1 |
205 | else |
206 | HDD=$(dialog_select_target_harddrive) |
207 | retval=$? |
208 | [[ ${retval} -eq 1 ]] && return 1 |
209 | if [[ ${retval} -eq 0 ]] |
210 | 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 | install_meter() |
219 | { |
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 | local method=0 |
234 | local retval |
235 | |
236 | while [[ ${method} -le 2 ]] |
237 | do |
238 | method=$(CANCEL_LABEL=$"Exit" menubox $"Configuration:" \ |
239 | $"1:Install system" \ |
240 | $"2:Show detected harddrives" \ |
241 | $"3:Exit and reboot" \ |
242 | $"4:Exit and drop into a shell") |
243 | retval=$? |
244 | [[ ${retval} -eq 1 ]] && exit 1 |
245 | if [[ ${retval} -eq 0 ]] |
246 | then |
247 | case ${method} in |
248 | "1") task_setup_system_menu ;; |
249 | "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 | ## 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 | ## smartcard = udevadm info -n /dev/sda -a | grep -i 'configuration.*card' |
279 | |
280 | ## 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 | |
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 | 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 | setup_hdd_partitions_auto() |
334 | { |
335 | ROOTHDD="${HDD}1" |
336 | |
337 | # sanity check - should not happen |
338 | if is_mounted --device "${ROOTHDD}" |
339 | then |
340 | echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2 |
341 | umount "${ROOTHDD}" |
342 | fi |
343 | |
344 | # run this only if FDISKPARTITIONBELOW256MB is not already 1 |
345 | if [[ ${FDISKPARTIONBELOW256MB} != 1 ]] |
346 | then |
347 | if hdd_size_below_256mb ${HDD} |
348 | then |
349 | FDISKPARTIONBELOW256MB=1 |
350 | else |
351 | FDISKPARTIONBELOW256MB=0 |
352 | fi |
353 | fi |
354 | |
355 | ## delete disk |
356 | dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die |
357 | |
358 | if [[ ${FDISKPARTIONBELOW256MB} = 1 ]] |
359 | then |
360 | ## setup one bootable partition |
361 | #1. n= new disk |
362 | #2. p= primary disk |
363 | #3. 1= first partition |
364 | #4. 2= default sector start // small disk needs more space for grub2 mbr sector |
365 | #5. ''= defaul sector end |
366 | #6. a= bootable flag |
367 | #7. 1= boot flag for partition 1 |
368 | #8. w= write/quit |
369 | fdisk ${HDD} &> /dev/null << EOF |
370 | n |
371 | p |
372 | 1 |
373 | 2 |
374 | |
375 | a |
376 | 1 |
377 | w |
378 | EOF |
379 | else |
380 | ## setup one bootable partition |
381 | #1. n= new disk |
382 | #2. p= primary disk |
383 | #3. 1= first partition |
384 | #4. ''= default sector start |
385 | #5. ''= defaul sector end |
386 | #6. a= bootable flag |
387 | #7. 1= boot flag for partition 1 |
388 | #8. w= write/quit |
389 | fdisk ${HDD} &> /dev/null << EOF |
390 | n |
391 | p |
392 | 1 |
393 | |
394 | |
395 | a |
396 | 1 |
397 | w |
398 | EOF |
399 | fi |
400 | } |
401 | |
402 | setup_hdd_partitions_manual() |
403 | { |
404 | ROOTHDD="${HDD}1" |
405 | SWAPHDD="" |
406 | BOOTHDD="" |
407 | cfdisk ${HDD} || dialog_die |
408 | } |
409 | |
410 | setup_hdd_format() |
411 | { |
412 | # sanity check - should not happen |
413 | if is_mounted --device "${ROOTHDD}" |
414 | then |
415 | echo "format: device ${ROOTHDD} is already mounted, umount it" >&2 |
416 | umount "${ROOTHDD}" |
417 | fi |
418 | |
419 | mkfs."${FORMAT_FILESYSTEM}" -q "${ROOTHDD}" || dialog_die |
420 | } |
421 | |
422 | install_mount_rootfs() |
423 | { |
424 | is_mounted --location "${INSTALLROOT}" || mount "${ROOTHDD}" "${INSTALLROOT}" |
425 | install -d ${INSTALLROOT}/boot || dialog_die |
426 | } |
427 | |
428 | install_system_image() |
429 | { |
430 | pushd ${INSTALLROOT} > /dev/null |
431 | tar xvjpf ${CDROOT}/system/${CDIMAGENAME} -C ${INSTALLROOT} |
432 | popd > /dev/null |
433 | } |
434 | |
435 | disabled_install_bootsector_chroot() |
436 | { |
437 | local my_roothdd |
438 | local grubconf="${INSTALLROOT}/boot/grub/grub.conf" |
439 | local grub2conf="/boot/grub/grub.cfg" |
440 | |
441 | # check for grub2 |
442 | if [[ -f ${INSTALLROOT}/sbin/grub-mkconfig ]] |
443 | then |
444 | # needed by grub-mkconfig on the first run |
445 | if [[ ! -f ${INSTALLROOT}/boot/grub/video.lst ]] |
446 | then |
447 | install -m0644 ${INSTALLROOT}/lib/grub/*/video.lst ${INSTALLROOT}/boot/grub/video.lst || dialog_die |
448 | fi |
449 | |
450 | # set kernelopts |
451 | if [[ -f ${INSTALLROOT}/etc/conf.d/grub ]] |
452 | then |
453 | sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLROOT}/etc/conf.d/grub || dialog_die |
454 | else |
455 | CONFIG="${INSTALLROOT}/etc/conf.d/grub" |
456 | clearconfig |
457 | addconfig "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" |
458 | fi |
459 | CONFIG="${INSTALLROOT}/root/.installrc" |
460 | clearconfig |
461 | # only grub 1.99 |
462 | addconfig 'type -P grub-mkdevicemap && grub-mkdevicemap' |
463 | addconfig "grub-install --no-floppy ${HDD} &> /dev/null" |
464 | addconfig "LC_ALL=C grub-mkconfig -o ${grub2conf} &> /dev/null" |
465 | addconfig "exit 0" |
466 | |
467 | # grub-legacy |
468 | else |
469 | source ${INSTALLROOT}/boot/kernelversion |
470 | |
471 | if [ -e ${INSTALLROOT}/etc/alx_version ] |
472 | then |
473 | OLD_ALXVER="${ALXVER}" |
474 | source ${INSTALLROOT}/etc/alx_version |
475 | KRNVER="ALX-${ALXVER}" |
476 | ALXVER="${OLD_ALXVER}" |
477 | fi |
478 | |
479 | [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX" |
480 | [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd" |
481 | [[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz" |
482 | |
483 | # uuid support |
484 | my_roothdd="UUID=$(get_uuid ${ROOTHDD})" |
485 | |
486 | CONFIG="${grubconf}" |
487 | clearconfig |
488 | addconfig "default 0" |
489 | addconfig "timeout 3" |
490 | # using current root password |
491 | addconfig "password --md5 $(cat ${INSTALLROOT}/etc/shadow | grep root | cut -d: -f2)" |
492 | |
493 | addconfig |
494 | addconfig "# normal boot" |
495 | addconfig "title ${KRNVER}" |
496 | addconfig "root (hd0,0)" |
497 | addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" |
498 | if is_initrd_supported |
499 | then |
500 | addconfig "initrd /boot/${KRNINITRD}" |
501 | fi |
502 | |
503 | addconfig |
504 | addconfig "# admin boot" |
505 | addconfig "title ${KRNVER} - Re-run hardware-detection" |
506 | addconfig "lock" |
507 | addconfig "root (hd0,0)" |
508 | addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" |
509 | if is_initrd_supported |
510 | then |
511 | addconfig "initrd /boot/${KRNINITRD}" |
512 | fi |
513 | |
514 | addconfig |
515 | addconfig "title ${KRNVER} - Reset *all* local settings" |
516 | addconfig "lock" |
517 | addconfig "root (hd0,0)" |
518 | addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" |
519 | if is_initrd_supported |
520 | then |
521 | addconfig "initrd /boot/${KRNINITRD}" |
522 | fi |
523 | |
524 | # bootsector schreiben chrooted schreiben (lfs/magellan) |
525 | cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF |
526 | /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null |
527 | root (hd0,0) |
528 | setup (hd0) |
529 | quit |
530 | EOF |
531 | exit 0 |
532 | CHROOTEOF |
533 | fi |
534 | |
535 | # run installrc |
536 | chrooted /bin/bash --rcfile /root/.installrc -i |
537 | rm ${INSTALLROOT}/root/.installrc |
538 | } |
539 | |
540 | disabled_install_initrd_chroot() |
541 | { |
542 | # only generate initrds if the cmd exists |
543 | is_initrd_supported || return 0 |
544 | |
545 | DISKMODS="sd_mod" |
546 | OLDPATAMODS="amd74xx piix sis5513 via82cxxx" |
547 | PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via" |
548 | SATAMODS="sata_via sata_sis sata_nv" |
549 | DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via" |
550 | OTHERMODS="" |
551 | case ${SPECIALDEVICE} in |
552 | zotac_intel) FBMODS=""; DRMMODS="i915" ;; |
553 | zotac_nvidia) FBMODS=""; DRMMODS="nouveau" ;; |
554 | rangee) FBMODS="" ;; ## fallback to vesafb, viafb does not run on all CLE266 boards |
555 | # not working with kms enabled drivers -> segfaults |
556 | #maxdata) FBMODS="i810fb" ;; ## check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer |
557 | maxdata) FBMODS="" ;; |
558 | *) FBMODS="uvesafb" ;; |
559 | esac |
560 | |
561 | if [[ ${FORMFACTOR} = laptop ]] |
562 | then |
563 | OTHERMODS="acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave" |
564 | fi |
565 | |
566 | # install an appropriate uvesafb.conf |
567 | install -d ${INSTALLROOT}/etc/modprobe.d || dialog_die |
568 | CONFIG="${INSTALLROOT}/etc/modprobe.d/uvesafb.conf" |
569 | clearconfig |
570 | addconfig "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" |
571 | |
572 | # install an appropriate viafb.conf |
573 | CONFIG="${INSTALLROOT}/etc/modprobe.d/viafb.conf" |
574 | clearconfig |
575 | addconfig "options viafb viafb_mode=1024x768 viafb_refresh=60" |
576 | |
577 | # install an appropriate i810fb.conf |
578 | CONFIG="${INSTALLROOT}/etc/modprobe.d/i810fb.conf" |
579 | clearconfig |
580 | addconfig "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60" |
581 | |
582 | cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF |
583 | echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd |
584 | mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null |
585 | exit 0 |
586 | CHROOTEOF |
587 | |
588 | # run installrc |
589 | chrooted /bin/bash --rcfile /root/.installrc -i |
590 | rm ${INSTALLROOT}/root/.installrc |
591 | } |
592 | |
593 | install_system_settings() |
594 | { |
595 | local CONFIG |
596 | |
597 | # write fstab |
598 | CONFIG="${INSTALLROOT}/etc/fstab" |
599 | clearconfig |
600 | addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" |
601 | addconfig -e "proc\t/proc\tproc\tdefaults\t0 0" |
602 | addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" |
603 | |
604 | # install network config skeleton |
605 | CONFIG="${INSTALLROOT}/etc/conf.d/net.eth0" |
606 | clearconfig |
607 | addconfig 'ONBOOT="yes"' |
608 | addconfig 'NETWORKING="dhcp"' |
609 | |
610 | # intel framebuffer quirk |
611 | if [ -e ${INSTALLROOT}/etc/splash/splash.conf ] |
612 | then |
613 | if [ -e /proc/fb ] |
614 | then |
615 | if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]] |
616 | then |
617 | fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:') |
618 | if [[ ${fbdev} != 0 ]] |
619 | then |
620 | sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLROOT}/etc/splash/splash.conf || dialog_die |
621 | fi |
622 | fi |
623 | fi |
624 | fi |
625 | } |
626 | |
627 | install_umount_rootfs() |
628 | { |
629 | is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot |
630 | is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT} |
631 | } |
632 | |
633 | install_do_reboot() |
634 | { |
635 | reboot |
636 | } |
637 | |
638 | ################################################# |
639 | # Install Ablauf Scripte # |
640 | ################################################# |
641 | |
642 | run_install_normal() |
643 | { |
644 | dialog_hardware_detection |
645 | |
646 | dialog_setup_hdd_partitions_manual |
647 | dialog_setup_hdd_format |
648 | setup_hdd_format > /dev/null |
649 | install_mount_rootfs |
650 | (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image |
651 | |
652 | dialog_install_settings |
653 | sleep 1 |
654 | install_system_settings |
655 | if is_initrd_supported |
656 | then |
657 | dialog_install_initrd |
658 | initrd_config |
659 | initrd_install |
660 | fi |
661 | |
662 | dialog_install_bootsector |
663 | bootloader_config |
664 | bootloader_install |
665 | |
666 | install_umount_rootfs |
667 | dialog_install_successful |
668 | } |
669 | |
670 | run_install_auto() |
671 | { |
672 | dialog_hardware_detection |
673 | |
674 | dialog_setup_hdd_partitions_auto |
675 | dialog_setup_hdd_format |
676 | setup_hdd_format > /dev/null |
677 | install_mount_rootfs |
678 | (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image |
679 | |
680 | dialog_install_settings |
681 | sleep 1 |
682 | install_system_settings |
683 | if is_initrd_supported |
684 | then |
685 | dialog_install_initrd |
686 | initrd_config |
687 | initrd_install |
688 | fi |
689 | |
690 | dialog_install_bootsector |
691 | bootloader_config |
692 | bootloader_install |
693 | |
694 | install_umount_rootfs |
695 | dialog_install_successful |
696 | } |
697 | |
698 | # set some proper traps |
699 | trap "trap_exit" SIGINT SIGQUIT |
700 | |
701 | dialog_main |
702 | |
703 | exit 0 |