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