Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2891 - (hide annotations) (download)
Fri Jul 31 11:13:02 2015 UTC (8 years, 9 months ago) by niro
File size: 14910 byte(s)
-variable INSTALL_METHOD was not initialized
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    
13 niro 2340 # include dir
14 niro 2333 INSTALLER_LIBDIR="%LIBDIR%"
15    
16 niro 2340 # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !
17     # -> now in images.conf
18     CURRENTLINE=0
19    
20 niro 2397 die()
21     {
22     echo "Error: $@"
23     exit 1
24     }
25    
26 niro 2401 # load common includes
27 niro 2402 for inc in %SYSCONFDIR%/installer.conf \
28     ${INSTALLER_LIBDIR}/functions/common.sh \
29     ${INSTALLER_LIBDIR}/functions/common-dialogs.sh \
30     ${INSTALLER_LIBDIR}/functions/hwdetection.sh \
31 niro 2428 ${INSTALLER_LIBDIR}/functions/bootloader.sh \
32     ${INSTALLER_LIBDIR}/functions/initrd-tools.sh \
33 niro 2402 ${INSTALLER_LIBDIR}/functions/installer-dialogs.sh
34 niro 2401 do
35     if [ -e ${inc} ]
36     then
37     source "${inc}"
38     else
39     die "'${inc}' not found"
40     fi
41     done
42 niro 2332
43 niro 2320 ### System/Config Version
44     VERSION="%VERSIONTAG%"
45 niro 2332 TITLE="${DEFAULT_TITLE} - ${VERSION}"
46 niro 2320
47 niro 2890 # initialize global variables so they are exportable
48 niro 2404 # some sane defaults
49 niro 2891 INSTALL_METHOD=""
50 niro 2653 LIVEROOT="${DEFAULT_LIVEROOT}"
51 niro 2642 IMAGEROOT="${DEFAULT_IMAGEROOT}"
52 niro 2342 INSTALLROOT="${DEFAULT_INSTALLROOT}"
53 niro 2404 KERNELPKG="${DEFAULT_KERNELPKG}"
54     KERNELOPTS="${DEFAULT_KERNELOPTS}"
55 niro 2320 GRUBLEGACYOPTS=""
56     GRUB2OPTS=""
57     FDISKPARTIONBELOW256MB=0
58     SPECIALDEVICE=""
59 niro 2404 FORMFACTOR="${DEFAULT_FORMFACTOR}"
60 niro 2332 FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}"
61 niro 2890 FLASHDISK=0
62 niro 2320
63 niro 2642 # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !
64     # -> now in images.conf
65     CDIMAGENAME=""
66     TOTALLINES=""
67     CURRENTLINE=0
68     if [ -e ${IMAGEROOT}/images.conf ]
69     then
70     source ${IMAGEROOT}/images.conf
71     # check if all required variables are set
72     [[ -z ${CDIMAGENAME} ]] && die "CDIMAGENAME is empty in ${IMAGEROOT}/images.conf"
73     [[ -z ${TOTALLINES} ]] && die "TOTALLINES is empty in ${IMAGEROOT}/images.conf"
74     else
75     die "${IMAGEROOT}/images.conf not found"
76     fi
77 niro 2320
78 niro 2482 ### helper scripts ###
79    
80 niro 2409 trap_exit()
81     {
82     is_mounted --location "${INSTALLROOT}/dev" && umount ${INSTALLROOT}/dev
83     is_mounted --location "${INSTALLROOT}/proc" && umount ${INSTALLROOT}/proc
84     is_mounted --location "${INSTALLROOT}/sys" && umount ${INSTALLROOT}/sys
85     is_mounted --location "${INSTALLROOT}/boot" && umount ${INSTALLROOT}/boot
86     is_mounted --location "${INSTALLROOT}" && umount ${INSTALLROOT}
87 niro 2889 [[ -n ${SWAPHDD} ]] && swapoff ${SWAPHDD}
88 niro 2409
89     echo $"Installation aborted."
90     exit 1
91     }
92    
93 niro 2423 install_meter()
94 niro 2320 {
95     while [[ ${CURRENTLINE} != ${TOTALLINES} ]]
96     do
97     CURRENTLINE=$(grep -c . /tmp/install.log)
98     PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES}))
99     echo ${PERCENT}
100     sleep 1
101     done
102     rm -f /tmp/install.log
103     return 0
104     }
105    
106 niro 2485 mount_rootfs()
107 niro 2484 {
108 niro 2489 local retval
109    
110 niro 2882 if [[ -n ${SWAPHDD} ]]
111 niro 2489 then
112 niro 2882 swapon ${SWAPHDD} || dialog_die $"Could not enable swap space '${SWAPHDD}'"
113 niro 2489 fi
114 niro 2882
115     if [[ -n ${ROOTHDD} ]]
116     then
117     if is_mounted --location "${INSTALLROOT}"
118     then
119     echo $"${INSTALLROOT} already mounted" >&2
120     else
121 niro 2888 mount -t "${FORMAT_FILESYSTEM_ROOTHDD}" "${ROOTHDD}" "${INSTALLROOT}" || dialog_die $"Could not mount rootfs - drive '${ROOTHDD}' -> '${INSTALLROOT}'"
122 niro 2882 fi
123     fi
124    
125 niro 2486 [[ -d ${INSTALLROOT}/boot ]] || install -d ${INSTALLROOT}/boot
126 niro 2882
127     if [[ -n ${BOOTHDD} ]]
128     then
129     if is_mounted --location "${INSTALLROOT}"/boot
130     then
131     echo $"${INSTALLROOT}/boot already mounted" >&2
132     else
133 niro 2888 mount -t "${FORMAT_FILESYSTEM_BOOTHDD}" "${BOOTHDD}" "${INSTALLROOT}"/boot || dialog_die $"Could not mount bootfs - drive '${BOOTHDD}' -> '${INSTALLROOT}/boot'"
134 niro 2882 fi
135     fi
136 niro 2484 }
137    
138 niro 2485 umount_rootfs()
139 niro 2484 {
140     is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot
141     is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}
142 niro 2882
143     if [[ -n ${SWAPHDD} ]]
144     then
145     swapoff ${SWAPHDD} || die
146     fi
147 niro 2484 }
148    
149     install_do_reboot()
150     {
151     reboot
152     }
153    
154 niro 2320 run_hardware_detection()
155     {
156     local hwinfo
157    
158     hwinfo="$(hwinfo --bios --storage --pci --gfxcard --sys)"
159    
160 niro 2654 # check for special devices/clients:
161     # if zotac a zotac and the disk is a removeable device, then add rootdelay to kernelcmd
162     local removable=0
163     if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]]
164     then
165 niro 2890 for i in /sys/block/[hs]d*/removable
166     do
167     if [[ $(< ${i}) = 1 ]]
168     then
169     removable=1
170     # we assume that all removable disks are flash disks on a zotac
171     export FLASHDISK=1
172     fi
173     done
174 niro 2654 # smartcard = udevadm info -n /dev/sda -a | grep -i 'configuration.*card'
175 niro 2320
176 niro 2654 # only add this for grub legacy, grub2 detect these settings on its own
177     export GRUBLEGACYOPTS="rootdelay=8"
178     # there are to zotac types in the wild, nvidia based gfx and intel
179     if [[ ! -z $(echo "${hwinfo}" | grep -i nouveau) ]]
180     then
181     export SPECIALDEVICE="zotac_nvidia"
182     else
183     export SPECIALDEVICE="zotac_intel"
184     fi
185     fi
186 niro 2320
187     # check for special devices/clients:
188     # if a rangee and disk ist smaller then 256mb move partion one block further ahead
189     if [[ ! -z $(echo "${hwinfo}" | grep -i CLE266) ]]
190     then
191     # for a rangee always define partion startblock +1
192     export FDISKPARTIONBELOW256MB="1"
193     export SPECIALDEVICE="rangee"
194     export GRUBLEGACYOPTS=""
195     fi
196    
197     # check for special devices/clients:
198     # check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer
199     if [[ ! -z $(echo "${hwinfo}" | grep -i i810) ]] || [[ ! -z $(echo "${hwinfo}" | grep -i i815) ]]
200     then
201     export SPECIALDEVICE="maxdata"
202     export GRUBLEGACYOPTS=""
203     fi
204    
205     # check for special devices/clients:
206     # check for laptops and activate cpufreq scaling
207     if [[ $(echo "${hwinfo}" | grep 'Formfactor:' | sed 's:.*Formfactor\:\ \"\(.*\)\":\1:') = laptop ]]
208     then
209     export FORMFACTOR="laptop"
210     export KERNELOPTS="${KERNELOPTS} cpufreq.governor=ondemand"
211     fi
212     }
213    
214 niro 2429 run_hardware_detection_disks()
215     {
216     local bootdev
217    
218     # all disks but exclude ramdisks
219     export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d')
220     # remove the boot device from ALL_DISKS if it was an usbstick
221 niro 2653 if [[ $(grep '[[:space:]]${LIVEROOT}[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]
222 niro 2429 then
223 niro 2653 bootdev=$(grep "[[:space:]]${LIVEROOT}[[:space:]]" /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g')
224 niro 2429 export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")
225     fi
226     export ALL_CDROMS="$(get_hwinfo cdrom)"
227     }
228    
229 niro 2882 setup_hdd_partitions()
230 niro 2320 {
231 niro 2435 # sanity check - should not happen
232     if is_mounted --device "${ROOTHDD}"
233     then
234     echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2
235     umount "${ROOTHDD}"
236     fi
237 niro 2882 if [[ -n ${BOOTHDD} ]]
238 niro 2320 then
239 niro 2882 if is_mounted --device "${BOOTHDD}"
240 niro 2320 then
241 niro 2882 echo "partition: device ${BOOTHDD} is already mounted, umount it" >&2
242     umount "${BOOTHDD}"
243 niro 2320 fi
244     fi
245    
246 niro 2882 if [[ ${INSTALL_METHOD} = auto ]]
247     then
248     # run this only if FDISKPARTITIONBELOW256MB is not already 1
249     if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]
250     then
251     if device_minimum_size "${HDD}" 256
252     then
253     FDISKPARTIONBELOW256MB=1
254     else
255     FDISKPARTIONBELOW256MB=0
256     fi
257     fi
258 niro 2320
259 niro 2882 ## delete disk
260     dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die
261    
262 niro 2890 if [[ ${FLASHDISK} = 1 ]]
263 niro 2882 then
264 niro 2890 if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
265     then
266     ## setup one bootable partition
267     # 1. n= new disk
268     # 2. p= primary disk
269     # 3. 1= first partition
270     # 4. 2= default sector start // small disk needs more space for grub2 mbr sector
271     # 5. ''= defaul sector end
272     # 6. a= bootable flag
273     # 7. 1= boot flag for partition 1
274     # 8. n= new disk
275     #10. p= primary disk
276     #11. 2= second partition
277     #12. ''= default sector start
278     #13. ''= defaul sector end
279     #14. w= write/quit
280     fdisk ${HDD} &> /dev/null << EOF
281 niro 2320 n
282     p
283     1
284     2
285 niro 2890 +50M
286     a
287     1
288     n
289     p
290     2
291 niro 2320
292 niro 2890
293     w
294     EOF
295     else
296     ## setup one bootable partition
297     # 1. n= new disk
298     # 2. p= primary disk
299     # 3. 1= first partition
300     # 4. ''= default sector start
301     # 5. ''= defaul sector end
302     # 6. a= bootable flag
303     # 7. 1= boot flag for partition 1
304     # 8. n= new disk
305     #10. p= primary disk
306     #11. 2= second partition
307     #12. ''= default sector start
308     #13. ''= defaul sector end
309     #14. w= write/quit
310     fdisk ${HDD} &> /dev/null << EOF
311     n
312     p
313     1
314    
315     +50M
316 niro 2320 a
317     1
318 niro 2890 n
319     p
320     2
321    
322    
323 niro 2320 w
324     EOF
325 niro 2890 fi
326 niro 2882 else
327 niro 2890 if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
328     then
329     ## setup one bootable partition
330     #1. n= new disk
331     #2. p= primary disk
332     #3. 1= first partition
333     #4. 2= default sector start // small disk needs more space for grub2 mbr sector
334     #5. ''= defaul sector end
335     #6. a= bootable flag
336     #7. 1= boot flag for partition 1
337     #8. w= write/quit
338     fdisk ${HDD} &> /dev/null << EOF
339 niro 2320 n
340     p
341     1
342 niro 2890 2
343 niro 2320
344 niro 2890 a
345     1
346     w
347     EOF
348     else
349     ## setup one bootable partition
350     #1. n= new disk
351     #2. p= primary disk
352     #3. 1= first partition
353     #4. ''= default sector start
354     #5. ''= defaul sector end
355     #6. a= bootable flag
356     #7. 1= boot flag for partition 1
357     #8. w= write/quit
358     fdisk ${HDD} &> /dev/null << EOF
359     n
360     p
361     1
362 niro 2320
363 niro 2890
364 niro 2320 a
365     1
366     w
367     EOF
368 niro 2890 fi
369 niro 2882 fi
370     else
371     cfdisk ${HDD} || dialog_die
372 niro 2320 fi
373     }
374    
375     setup_hdd_format()
376     {
377 niro 2883 install -d /tmp
378     :> /tmp/format.log
379    
380 niro 2882 if [[ -n ${SWAPHDD} ]]
381 niro 2435 then
382 niro 2882 # sanity check - should not happen
383     if is_mounted --device "${SWAPHDD}"
384     then
385     echo "format: device ${SWAPHDD} is already mounted, umount it" >&2
386     umount "${SWAPHDD}"
387     fi
388     mkswap ${SWAPHDD} || die
389 niro 2435 fi
390    
391 niro 2882 if [[ -n ${BOOTHDD} ]]
392     then
393     # sanity check - should not happen
394     if is_mounted --device "${BOOTHDD}"
395     then
396     echo "format: device ${BOOTHDD} is already mounted, umount it" >&2
397     umount "${BOOTHDD}"
398     fi
399    
400 niro 2885 mkfs."${FORMAT_FILESYSTEM_BOOTHDD}" "${BOOTHDD}" &>> /tmp/format.log || dialog_die
401 niro 2882 fi
402    
403     if [[ -n ${ROOTHDD} ]]
404     then
405     # sanity check - should not happen
406     if is_mounted --device "${ROOTHDD}"
407     then
408     echo "format: device ${ROOTHDD} is already mounted, umount it" >&2
409     umount "${ROOTHDD}"
410     fi
411    
412 niro 2885 mkfs."${FORMAT_FILESYSTEM_ROOTHDD}" "${ROOTHDD}" &>> /tmp/format.log || dialog_die
413 niro 2882 fi
414 niro 2320 }
415    
416     install_system_image()
417     {
418 niro 2433 pushd ${INSTALLROOT} > /dev/null
419 niro 2655 tar xvjpf ${IMAGEROOT}/${CDIMAGENAME} -C ${INSTALLROOT}
420 niro 2433 popd > /dev/null
421 niro 2320 }
422    
423     install_system_settings()
424     {
425 niro 2443 local CONFIG
426 niro 2320
427 niro 2443 # write fstab
428     CONFIG="${INSTALLROOT}/etc/fstab"
429     clearconfig
430 niro 2882 if [[ -n ${BOOTHDD} ]]
431     then
432 niro 2885 addconfig -e "UUID=$(get_uuid ${BOOTHDD})\t/\t${FORMAT_FILESYSTEM_BOOTHDD}\tnoatime\t1 1"
433 niro 2882 fi
434     if [[ -n ${ROOTHDD} ]]
435     then
436 niro 2885 addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM_ROOTHDD}\tnoatime\t0 0"
437 niro 2882 fi
438     if [[ -n ${SWAPHDD} ]]
439     then
440     addconfig -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0"
441     fi
442 niro 2443 addconfig -e "proc\t/proc\tproc\tdefaults\t0 0"
443     addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0"
444    
445 niro 2320 # install network config skeleton
446 niro 2443 CONFIG="${INSTALLROOT}/etc/conf.d/net.eth0"
447     clearconfig
448     addconfig 'ONBOOT="yes"'
449     addconfig 'NETWORKING="dhcp"'
450 niro 2320
451 niro 2442 # intel framebuffer quirk
452 niro 2500 CONFIG="${INSTALLROOT}/etc/splash/splash.conf"
453     if [ -e ${CONFIG} ] && [ -e /proc/fb ]
454 niro 2320 then
455 niro 2500 if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]
456 niro 2320 then
457 niro 2500 fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')
458     [[ ${fbdev} != 0 ]] && sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${CONFIG} || dialog_die
459 niro 2320 fi
460     fi
461     }
462    
463    
464 niro 2482 ### installer dialogs ###
465    
466     dialog_die()
467     {
468     ERROR="$1"
469     RETVAL="$?"
470     dialog_install_failure
471     exit 1
472     }
473    
474     dialog_warning()
475     {
476     local retval
477    
478     yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?"
479     retval=$?
480     if [[ ${retval} -eq 1 ]]
481     then
482     clear
483     echo $"The process was aborted."
484     exit 1
485     fi
486     }
487    
488    
489     ### installer tasks ###
490    
491     task_setup_system_menu()
492     {
493     local mode
494     local retval
495    
496     mode="$(dialog_setup_system_menu)"
497     retval=$?
498     [[ ${retval} -eq 1 ]] && return 1
499     if [[ ${retval} -eq 0 ]]
500     then
501     case "${mode}" in
502 niro 2882 "1") run_install auto ;;
503     "2") run_install normal ;;
504 niro 2482 "") task_setup_system_menu;;
505     esac
506     fi
507     }
508    
509     task_hardware_detection()
510     {
511     local message
512    
513     run_hardware_detection_disks
514    
515     message+=$"Harddrives:\n"
516    
517     if [[ ! -z ${ALL_DISKS} ]]
518     then
519     for i in ${ALL_DISKS}
520     do
521     message+="\Z3${i}\Zn "
522     done
523     message+="\n"
524     fi
525    
526     if [[ ! -z ${ALL_CDROMS} ]]
527     then
528     message+="\n"
529     message+=$"Optical disk drives:\n"
530     for i in ${ALL_CDROMS}
531     do
532     message+="\Z3${i}\Zn"
533     done
534     message+="\n"
535     fi
536    
537     # other devices
538     run_hardware_detection
539     case "${SPECIALDEVICE}" in
540     zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;;
541     rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;;
542     maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;;
543     *) message+=$"\n\ZnCommon device detected.\Zn" ;;
544     esac
545     if [[ ${FORMFACTOR} = laptop ]]
546     then
547     message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn"
548     fi
549 niro 2890 if [[ ${FLASHDISK} = 1 ]]
550     then
551     message+=$"\n\ZnFlash memory detected.\Zn"
552     message+=$"\n\ZnF2FS will be used as default filesystem withn the auto installation mode.\Zn"
553     fi
554 niro 2482
555     messagebox -y 12 -h $"Detected hardware:" "${message}"
556     }
557    
558 niro 2882 task_setup_hdd_partitions()
559 niro 2482 {
560     local i
561     local retval
562    
563     if [[ -z ${ALL_DISKS} ]]
564     then
565     dialog_no_harddrive_found
566     exit 1
567     else
568     HDD=$(dialog_select_target_harddrive)
569     retval=$?
570     [[ ${retval} -eq 1 ]] && return 1
571     if [[ ${retval} -eq 0 ]]
572     then
573     dialog_setup_hdd_info
574 niro 2882 setup_hdd_partitions
575 niro 2482 fi
576     fi
577     }
578    
579     task_main()
580     {
581     local method=0
582     local retval
583    
584     while [[ ${method} -le 2 ]]
585     do
586     method=$(dialog_main)
587     retval=$?
588     [[ ${retval} -eq 1 ]] && exit 1
589     if [[ ${retval} -eq 0 ]]
590     then
591     case ${method} in
592     "1") task_setup_system_menu ;;
593     "2") task_hardware_detection ;;
594     "3") install_do_reboot ;;
595     "4") /bin/bash --login -i ;;
596     esac
597     fi
598     done
599     }
600    
601 niro 2882 run_install()
602 niro 2320 {
603 niro 2882 local method="$1"
604    
605 niro 2481 task_hardware_detection
606 niro 2320
607 niro 2882 case "${method}" in
608     auto)
609 niro 2890 if [[ ${FLASHDISK} = 1 ]]
610     then
611     export BOOTHDD="${HDD}1"
612     export SWAPHDD=""
613     export ROOTHDD="${HDD}2"
614     export FORMAT_FILESYSTEM_BOOTHDD="f2fs"
615     export FORMAT_FILESYSTEM_ROOTHDD="ext2"
616     else
617     export BOOTHDD=""
618     export SWAPHDD=""
619     export ROOTHDD="${HDD}1"
620     export FORMAT_FILESYSTEM_BOOTHDD=""
621     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
622     fi
623 niro 2882 export INSTALL_METHOD="${method}"
624     ;;
625     normal)
626 niro 2886 export BOOTHDD="${HDD}1"
627     export SWAPHDD="${HDD}2"
628     export ROOTHDD="${HDD}3"
629 niro 2885 export FORMAT_FILESYSTEM_BOOTHDD="${FORMAT_FILESYSTEM}"
630     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
631 niro 2882 export INSTALL_METHOD="${method}"
632     ;;
633 niro 2885 single)
634 niro 2886 export BOOTHDD=""
635     export SWAPHDD=""
636     export ROOTHDD="${HDD}1"
637 niro 2885 export FORMAT_FILESYSTEM_BOOTHDD=""
638     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
639     export INSTALL_METHOD="${method}"
640     ;;
641 niro 2887 flash)
642     export BOOTHDD="${HDD}1"
643     export SWAPHDD=""
644     export ROOTHDD="${HDD}2"
645     export FORMAT_FILESYSTEM_BOOTHDD="${FORMAT_FILESYSTEM}"
646     export FORMAT_FILESYSTEM_ROOTHDD="f2fs"
647     export INSTALL_METHOD="${method}"
648     ;;
649 niro 2882 *)
650     die "Unknown install method '${method}', aborting."
651     ;;
652     esac
653 niro 2320
654 niro 2882 task_setup_hdd_partitions
655 niro 2320 dialog_setup_hdd_format
656 niro 2399 setup_hdd_format > /dev/null
657 niro 2485 mount_rootfs
658 niro 2423 (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image
659 niro 2320
660     dialog_install_settings
661     sleep 1
662 niro 2399 install_system_settings
663 niro 2440 if is_initrd_supported
664     then
665     dialog_install_initrd
666     initrd_config
667     initrd_install
668     fi
669 niro 2320
670     dialog_install_bootsector
671 niro 2440 bootloader_config
672     bootloader_install
673 niro 2320
674 niro 2485 umount_rootfs
675 niro 2320 dialog_install_successful
676     }
677    
678 niro 2409 # set some proper traps
679     trap "trap_exit" SIGINT SIGQUIT
680    
681 niro 2477 task_main
682 niro 2320
683     exit 0