Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2491 by niro, Wed Jan 8 12:22:26 2014 UTC revision 2892 by niro, Fri Jul 31 11:40:56 2015 UTC
# Line 9  Line 9 
9    
10  # setup locales  # setup locales
11  TEXTDOMAIN=installer  TEXTDOMAIN=installer
 LC_MESSAGES=C  
12    
13  # include dir  # include dir
14  INSTALLER_LIBDIR="%LIBDIR%"  INSTALLER_LIBDIR="%LIBDIR%"
# Line 41  do Line 40  do
40   fi   fi
41  done  done
42    
 # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !  
 # -> now in images.conf  
 CDIMAGENAME=""  
 TOTALLINES=""  
 CURRENTLINE=0  
 if [ -e /mnt/cdrom/system/images.conf ]  
 then  
  source /mnt/cdrom/system/images.conf  
  # check if all required variables are set  
  [[ -z ${CDIMAGENAME} ]] && die "CDIMAGENAME is empty in /mnt/cdrom/system/images.conf"  
  [[ -z ${TOTALLINES} ]] && die "TOTALLINES is empty in /mnt/cdrom/system/images.conf"  
 else  
  die "/mnt/cdrom/system/images.conf not found"  
 fi  
   
43  ### System/Config Version  ### System/Config Version
44  VERSION="%VERSIONTAG%"  VERSION="%VERSIONTAG%"
45  TITLE="${DEFAULT_TITLE} - ${VERSION}"  TITLE="${DEFAULT_TITLE} - ${VERSION}"
46    
47    # initialize global variables so they are exportable
48  # some sane defaults  # some sane defaults
49  CDROOT="${DEFAULT_CDROOT}"  INSTALL_METHOD=""
50    LIVEROOT="${DEFAULT_LIVEROOT}"
51    IMAGEROOT="${DEFAULT_IMAGEROOT}"
52  INSTALLROOT="${DEFAULT_INSTALLROOT}"  INSTALLROOT="${DEFAULT_INSTALLROOT}"
53  KERNELPKG="${DEFAULT_KERNELPKG}"  KERNELPKG="${DEFAULT_KERNELPKG}"
54  KERNELOPTS="${DEFAULT_KERNELOPTS}"  KERNELOPTS="${DEFAULT_KERNELOPTS}"
# Line 71  FDISKPARTIONBELOW256MB=0 Line 58  FDISKPARTIONBELOW256MB=0
58  SPECIALDEVICE=""  SPECIALDEVICE=""
59  FORMFACTOR="${DEFAULT_FORMFACTOR}"  FORMFACTOR="${DEFAULT_FORMFACTOR}"
60  FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}"  FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}"
61    FLASHDISK=0
62    
63    # 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    
78  ### helper scripts ###  ### helper scripts ###
79    
# Line 82  trap_exit() Line 84  trap_exit()
84   is_mounted --location "${INSTALLROOT}/sys" && umount ${INSTALLROOT}/sys   is_mounted --location "${INSTALLROOT}/sys" && umount ${INSTALLROOT}/sys
85   is_mounted --location "${INSTALLROOT}/boot" && umount ${INSTALLROOT}/boot   is_mounted --location "${INSTALLROOT}/boot" && umount ${INSTALLROOT}/boot
86   is_mounted --location "${INSTALLROOT}" && umount ${INSTALLROOT}   is_mounted --location "${INSTALLROOT}" && umount ${INSTALLROOT}
87     [[ -n ${SWAPHDD} ]] && swapoff ${SWAPHDD}
88    
89   echo $"Installation aborted."   echo $"Installation aborted."
90   exit 1   exit 1
# Line 104  mount_rootfs() Line 107  mount_rootfs()
107  {  {
108   local retval   local retval
109    
110   if is_mounted --location "${INSTALLROOT}"   if [[ -n ${SWAPHDD} ]]
111   then   then
112   echo $"${INSTALLROOT} already mounted" >&2   swapon ${SWAPHDD} || dialog_die $"Could not enable swap space '${SWAPHDD}'"
113   else   fi
114   mount "${ROOTHDD}" "${INSTALLROOT}" || dialog_die $"Could not mount rootfs - drive'${ROOTHDD}' -> '${INSTALLROOT}'"  
115     if [[ -n ${ROOTHDD} ]]
116     then
117     if is_mounted --location "${INSTALLROOT}"
118     then
119     echo $"${INSTALLROOT} already mounted" >&2
120     else
121     mount -t "${FORMAT_FILESYSTEM_ROOTHDD}" "${ROOTHDD}" "${INSTALLROOT}" || dialog_die $"Could not mount rootfs - drive '${ROOTHDD}' -> '${INSTALLROOT}'"
122     fi
123   fi   fi
124    
125   [[ -d ${INSTALLROOT}/boot ]] || install -d ${INSTALLROOT}/boot   [[ -d ${INSTALLROOT}/boot ]] || install -d ${INSTALLROOT}/boot
126    
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     mount -t "${FORMAT_FILESYSTEM_BOOTHDD}" "${BOOTHDD}" "${INSTALLROOT}"/boot || dialog_die $"Could not mount bootfs - drive '${BOOTHDD}' -> '${INSTALLROOT}/boot'"
134     fi
135     fi
136  }  }
137    
138  umount_rootfs()  umount_rootfs()
139  {  {
140   is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot   is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot
141   is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}   is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}
142    
143     if [[ -n ${SWAPHDD} ]]
144     then
145     swapoff ${SWAPHDD} || die
146     fi
147  }  }
148    
149  install_do_reboot()  install_do_reboot()
# Line 130  run_hardware_detection() Line 157  run_hardware_detection()
157    
158   hwinfo="$(hwinfo --bios --storage --pci --gfxcard --sys)"   hwinfo="$(hwinfo --bios --storage --pci --gfxcard --sys)"
159    
160   ## check for special devices/clients:   # check for special devices/clients:
161   ## if zotac a zotac and the disk is a removeable device, then add rootdelay to kernelcmd   # if zotac a zotac and the disk is a removeable device, then add rootdelay to kernelcmd
162   #local removable=0   local removable=0
163   #if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]]   if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]]
164   #then   then
165   #for i in /sys/block/[hs]d*/removable   for i in /sys/block/[hs]d*/removable
166   #do   do
167   #if [[ $(< ${i}) = 1 ]]   if [[ $(< ${i}) = 1 ]]
168   #then   then
169   #removable=1   removable=1
170   #fi   # we assume that all removable disks are flash disks on a zotac
171   #done   export FLASHDISK=1
172   ## smartcard = udevadm info -n /dev/sda -a | grep -i 'configuration.*card'   fi
173     done
174   ## only add this for grub legacy, grub2 detect these settings on its own   # smartcard = udevadm info -n /dev/sda -a | grep -i 'configuration.*card'
175   #export GRUBLEGACYOPTS="rootdelay=8"  
176   ## there are to zotac types in the wild, nvidia based gfx and intel   # only add this for grub legacy, grub2 detect these settings on its own
177   #if [[ ! -z $(echo "${hwinfo}" | grep -i nouveau) ]]   export GRUBLEGACYOPTS="rootdelay=8"
178   #then   # there are to zotac types in the wild, nvidia based gfx and intel
179   #export SPECIALDEVICE="zotac_nvidia"   if [[ ! -z $(echo "${hwinfo}" | grep -i nouveau) ]]
180   #else   then
181   #export SPECIALDEVICE="zotac_intel"   export SPECIALDEVICE="zotac_nvidia"
182   #fi   else
183   #fi   export SPECIALDEVICE="zotac_intel"
184     fi
185     fi
186    
187   # check for special devices/clients:   # check for special devices/clients:
188   # if a rangee and disk ist smaller then 256mb move partion one block further ahead   # if a rangee and disk ist smaller then 256mb move partion one block further ahead
# Line 173  run_hardware_detection() Line 202  run_hardware_detection()
202   export GRUBLEGACYOPTS=""   export GRUBLEGACYOPTS=""
203   fi   fi
204    
205     # check for i845 Chipsets and enable KMS and use 915 drm driver later in initrd
206     if [[ ! -z $(echo "${hwinfo}" | grep -i i845) ]]
207     then
208     export SPECIALDEVICE="i845"
209     # unset default video=1024x768 opt or the drm driver breaks
210     export KERNELOPTS="quiet"
211     export GRUBLEGACYOPTS=""
212     # enable full kms support
213     export GRUB2GFXPAYLOAD="keep"
214     fi
215    
216     # check for radeon gfxcards
217     if [[ ! -z $(echo "${hwinfo}" | grep -i radeon) ]]
218     then
219     # enable full kms support
220     export GRUB2GFXPAYLOAD="keep"
221     fi
222    
223     # requires nomsi to prevent massive IRQ error spam
224     # see: http://ubuntuforums.org/showthread.php?t=1234983
225     if [[ ! -z $(echo "${hwinfo}" | grep -i 'P5VD2-X') ]] || [[ ! -z $(echo "${hwinfo}" | grep -i 'VT8237') ]] || [[ ! -z $(echo "${hwinfo}" | grep -i 'VX700') ]]
226     then
227     export SPECIALDEVICE="nomsi"
228     export KERNELOPTS="${KERNELOPTS} pci=nomsi,noaer"
229     fi
230    
231   # check for special devices/clients:   # check for special devices/clients:
232   # check for laptops and activate cpufreq scaling   # check for laptops and activate cpufreq scaling
233   if [[ $(echo "${hwinfo}" | grep 'Formfactor:' | sed 's:.*Formfactor\:\ \"\(.*\)\":\1:') = laptop ]]   if [[ $(echo "${hwinfo}" | grep 'Formfactor:' | sed 's:.*Formfactor\:\ \"\(.*\)\":\1:') = laptop ]]
# Line 189  run_hardware_detection_disks() Line 244  run_hardware_detection_disks()
244   # all disks but exclude ramdisks   # all disks but exclude ramdisks
245   export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d')   export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d')
246   # remove the boot device from ALL_DISKS if it was an usbstick   # remove the boot device from ALL_DISKS if it was an usbstick
247   if [[ $(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]   if [[ $(grep '[[:space:]]${LIVEROOT}[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]
248   then   then
249   bootdev="$(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g')"   bootdev=$(grep "[[:space:]]${LIVEROOT}[[:space:]]" /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g')
250   export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")   export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")
251   fi   fi
252   export ALL_CDROMS="$(get_hwinfo cdrom)"   export ALL_CDROMS="$(get_hwinfo cdrom)"
253  }  }
254    
255  setup_hdd_partitions_auto()  setup_hdd_partitions()
256  {  {
  ROOTHDD="${HDD}1"  
   
257   # sanity check - should not happen   # sanity check - should not happen
258   if is_mounted --device "${ROOTHDD}"   if is_mounted --device "${ROOTHDD}"
259   then   then
260   echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2   echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2
261   umount "${ROOTHDD}"   umount "${ROOTHDD}"
262   fi   fi
263     if [[ -n ${BOOTHDD} ]]
  # run this only if FDISKPARTITIONBELOW256MB is not already 1  
  if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]  
264   then   then
265   if device_minimum_size "${HDD}" 256   if is_mounted --device "${BOOTHDD}"
266   then   then
267   FDISKPARTIONBELOW256MB=1   echo "partition: device ${BOOTHDD} is already mounted, umount it" >&2
268   else   umount "${BOOTHDD}"
  FDISKPARTIONBELOW256MB=0  
269   fi   fi
270   fi   fi
271    
272   ## delete disk   if [[ ${INSTALL_METHOD} = auto ]]
  dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die  
   
  if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]  
273   then   then
274   ## setup one bootable partition   # run this only if FDISKPARTITIONBELOW256MB is not already 1
275   #1. n= new disk   if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]
276   #2. p= primary disk   then
277   #3. 1= first partition   if device_minimum_size "${HDD}" 256
278   #4. 2= default sector start // small disk needs more space for grub2 mbr sector   then
279   #5. ''= defaul sector end   FDISKPARTIONBELOW256MB=1
280   #6. a= bootable flag   else
281   #7. 1= boot flag for partition 1   FDISKPARTIONBELOW256MB=0
282   #8. w= write/quit   fi
283   fdisk ${HDD} &> /dev/null << EOF   fi
284    
285     ## delete disk
286     dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die
287    
288     if [[ ${FLASHDISK} = 1 ]]
289     then
290     if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
291     then
292     ## setup one bootable partition
293     # 1. n= new disk
294     # 2. p= primary disk
295     # 3. 1= first partition
296     # 4. 2= default sector start // small disk needs more space for grub2 mbr sector
297     # 5. ''= defaul sector end
298     # 6. a= bootable flag
299     # 7. 1= boot flag for partition 1
300     # 8. n= new disk
301     #10. p= primary disk
302     #11. 2= second partition
303     #12. ''= default sector start
304     #13. ''= defaul sector end
305     #14. w= write/quit
306     fdisk ${HDD} &> /dev/null << EOF
307    n
308    p
309    1
310    2
311    +50M
312    a
313    1
314    n
315    p
316    2
317    
318    
319    w
320    EOF
321     else
322     ## setup one bootable partition
323     # 1. n= new disk
324     # 2. p= primary disk
325     # 3. 1= first partition
326     # 4. ''= default sector start
327     # 5. ''= defaul sector end
328     # 6. a= bootable flag
329     # 7. 1= boot flag for partition 1
330     # 8. n= new disk
331     #10. p= primary disk
332     #11. 2= second partition
333     #12. ''= default sector start
334     #13. ''= defaul sector end
335     #14. w= write/quit
336     fdisk ${HDD} &> /dev/null << EOF
337    n
338    p
339    1
340    
341    +50M
342    a
343    1
344    n
345    p
346    2
347    
348    
349    w
350    EOF
351     fi
352     else
353     if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
354     then
355     ## setup one bootable partition
356     #1. n= new disk
357     #2. p= primary disk
358     #3. 1= first partition
359     #4. 2= default sector start // small disk needs more space for grub2 mbr sector
360     #5. ''= defaul sector end
361     #6. a= bootable flag
362     #7. 1= boot flag for partition 1
363     #8. w= write/quit
364     fdisk ${HDD} &> /dev/null << EOF
365  n  n
366  p  p
367  1  1
# Line 243  a Line 371  a
371  1  1
372  w  w
373  EOF  EOF
374   else   else
375   ## setup one bootable partition   ## setup one bootable partition
376   #1. n= new disk   #1. n= new disk
377   #2. p= primary disk   #2. p= primary disk
378   #3. 1= first partition   #3. 1= first partition
379   #4. ''= default sector start   #4. ''= default sector start
380   #5. ''= defaul sector end   #5. ''= defaul sector end
381   #6. a= bootable flag   #6. a= bootable flag
382   #7. 1= boot flag for partition 1   #7. 1= boot flag for partition 1
383   #8. w= write/quit   #8. w= write/quit
384   fdisk ${HDD} &> /dev/null << EOF   fdisk ${HDD} &> /dev/null << EOF
385  n  n
386  p  p
387  1  1
# Line 263  a Line 391  a
391  1  1
392  w  w
393  EOF  EOF
394     fi
395     fi
396     else
397     cfdisk ${HDD} || dialog_die
398   fi   fi
399  }  }
400    
 setup_hdd_partitions_manual()  
 {  
  ROOTHDD="${HDD}1"  
  SWAPHDD=""  
  BOOTHDD=""  
  cfdisk ${HDD} || dialog_die  
 }  
   
401  setup_hdd_format()  setup_hdd_format()
402  {  {
403   # sanity check - should not happen   install -d /tmp
404   if is_mounted --device "${ROOTHDD}"   :> /tmp/format.log
405    
406     if [[ -n ${SWAPHDD} ]]
407   then   then
408   echo "format: device ${ROOTHDD} is already mounted, umount it" >&2   # sanity check - should not happen
409   umount "${ROOTHDD}"   if is_mounted --device "${SWAPHDD}"
410     then
411     echo "format: device ${SWAPHDD} is already mounted, umount it" >&2
412     umount "${SWAPHDD}"
413     fi
414     mkswap ${SWAPHDD} || die
415   fi   fi
416    
417   mkfs."${FORMAT_FILESYSTEM}" -q "${ROOTHDD}" || dialog_die   if [[ -n ${BOOTHDD} ]]
418     then
419     # sanity check - should not happen
420     if is_mounted --device "${BOOTHDD}"
421     then
422     echo "format: device ${BOOTHDD} is already mounted, umount it" >&2
423     umount "${BOOTHDD}"
424     fi
425    
426     mkfs."${FORMAT_FILESYSTEM_BOOTHDD}" "${BOOTHDD}" &>> /tmp/format.log || dialog_die
427     fi
428    
429     if [[ -n ${ROOTHDD} ]]
430     then
431     # sanity check - should not happen
432     if is_mounted --device "${ROOTHDD}"
433     then
434     echo "format: device ${ROOTHDD} is already mounted, umount it" >&2
435     umount "${ROOTHDD}"
436     fi
437    
438     mkfs."${FORMAT_FILESYSTEM_ROOTHDD}" "${ROOTHDD}" &>> /tmp/format.log || dialog_die
439     fi
440  }  }
441    
442  install_system_image()  install_system_image()
443  {  {
444   pushd ${INSTALLROOT} > /dev/null   pushd ${INSTALLROOT} > /dev/null
445   tar xvjpf ${CDROOT}/system/${CDIMAGENAME} -C ${INSTALLROOT}   tar xvjpf ${IMAGEROOT}/${CDIMAGENAME} -C ${INSTALLROOT}
446   popd > /dev/null   popd > /dev/null
447  }  }
448    
# Line 300  install_system_settings() Line 453  install_system_settings()
453   # write fstab   # write fstab
454   CONFIG="${INSTALLROOT}/etc/fstab"   CONFIG="${INSTALLROOT}/etc/fstab"
455   clearconfig   clearconfig
456   addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1"   if [[ -n ${BOOTHDD} ]]
457     then
458     addconfig -e "UUID=$(get_uuid ${BOOTHDD})\t/\t${FORMAT_FILESYSTEM_BOOTHDD}\tnoatime\t1 1"
459     fi
460     if [[ -n ${ROOTHDD} ]]
461     then
462     addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM_ROOTHDD}\tnoatime\t0 0"
463     fi
464     if [[ -n ${SWAPHDD} ]]
465     then
466     addconfig -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0"
467     fi
468   addconfig -e "proc\t/proc\tproc\tdefaults\t0 0"   addconfig -e "proc\t/proc\tproc\tdefaults\t0 0"
469   addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0"   addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0"
470    
# Line 311  install_system_settings() Line 475  install_system_settings()
475   addconfig 'NETWORKING="dhcp"'   addconfig 'NETWORKING="dhcp"'
476    
477   # intel framebuffer quirk   # intel framebuffer quirk
478   if [ -e ${INSTALLROOT}/etc/splash/splash.conf ]   CONFIG="${INSTALLROOT}/etc/splash/splash.conf"
479     if [ -e ${CONFIG} ] && [ -e /proc/fb ]
480   then   then
481   if [ -e /proc/fb ]   if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]
482   then   then
483   if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]   fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')
484   then   [[ ${fbdev} != 0 ]] && sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${CONFIG} || dialog_die
  fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')  
  if [[ ${fbdev} != 0 ]]  
  then  
  sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLROOT}/etc/splash/splash.conf || dialog_die  
  fi  
  fi  
485   fi   fi
486   fi   fi
487  }  }
# Line 366  task_setup_system_menu() Line 525  task_setup_system_menu()
525   if [[ ${retval} -eq 0 ]]   if [[ ${retval} -eq 0 ]]
526   then   then
527   case "${mode}" in   case "${mode}" in
528   "1") run_install_auto ;;   "1") run_install auto ;;
529   "2") run_install_normal ;;   "2") run_install normal ;;
530   "") task_setup_system_menu;;   "") task_setup_system_menu;;
531   esac   esac
532   fi   fi
# Line 407  task_hardware_detection() Line 566  task_hardware_detection()
566   zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;;   zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;;
567   rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;;   rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;;
568   maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;;   maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;;
569     i845) message+=$"\n\Z2Intel i845 VGA device detected.\Zn" ;;
570     nomsi) message+=$"\n\Z2Mainboard with P5VD2-X/VT8237/VX700 chipset detected.\Zn"
571     message+=$"\n\Z2Disabling Message Signaled Interrupts (MSI) capability of the kernel.\Zn" ;;
572   *) message+=$"\n\ZnCommon device detected.\Zn" ;;   *) message+=$"\n\ZnCommon device detected.\Zn" ;;
573   esac   esac
574   if [[ ${FORMFACTOR} = laptop ]]   if [[ ${FORMFACTOR} = laptop ]]
575   then   then
576   message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn"   message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn"
577   fi   fi
578     if [[ ${FLASHDISK} = 1 ]]
579     then
580     message+=$"\n\ZnFlash memory detected.\Zn"
581     message+=$"\n\ZnF2FS will be used as default filesystem withn the auto installation mode.\Zn"
582     fi
583    
584   messagebox -y 12 -h $"Detected hardware:" "${message}"   messagebox -y 12 -h $"Detected hardware:" "${message}"
585  }  }
586    
587  task_setup_hdd_partitions_manual()  task_setup_hdd_partitions()
588  {  {
589   local i   local i
590   local retval   local retval
# Line 433  task_setup_hdd_partitions_manual() Line 600  task_setup_hdd_partitions_manual()
600   if [[ ${retval} -eq 0 ]]   if [[ ${retval} -eq 0 ]]
601   then   then
602   dialog_setup_hdd_info   dialog_setup_hdd_info
603   setup_hdd_partitions_manual   setup_hdd_partitions
  fi  
  fi  
 }  
   
 task_setup_hdd_partitions_auto()  
 {  
  local i  
  local retval  
   
  if [[ -z ${ALL_DISKS} ]]  
  then  
  dialog_no_harddrive_found  
  exit 1  
  else  
  HDD=$(dialog_select_target_harddrive)  
  retval=$?  
  [[ ${retval} -eq 1 ]] && return 1  
  if [[ ${retval} -eq 0 ]]  
  then  
  dialog_setup_hdd_info_auto  
  dialog_setup_hdd_create_partitions  
  setup_hdd_partitions_auto  
604   fi   fi
605   fi   fi
606  }  }
# Line 482  task_main() Line 627  task_main()
627   done   done
628  }  }
629    
630  run_install_normal()  run_install()
631  {  {
632   task_hardware_detection   local method="$1"
   
  task_setup_hdd_partitions_manual  
  dialog_setup_hdd_format  
  setup_hdd_format > /dev/null  
  mount_rootfs  
  (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image  
   
  dialog_install_settings  
  sleep 1  
  install_system_settings  
  if is_initrd_supported  
  then  
  dialog_install_initrd  
  initrd_config  
  initrd_install  
  fi  
   
  dialog_install_bootsector  
  bootloader_config  
  bootloader_install  
   
  umount_rootfs  
  dialog_install_successful  
 }  
633    
 run_install_auto()  
 {  
634   task_hardware_detection   task_hardware_detection
635    
636   task_setup_hdd_partitions_auto   case "${method}" in
637     auto)
638     if [[ ${FLASHDISK} = 1 ]]
639     then
640     export BOOTHDD="${HDD}1"
641     export SWAPHDD=""
642     export ROOTHDD="${HDD}2"
643     export FORMAT_FILESYSTEM_BOOTHDD="f2fs"
644     export FORMAT_FILESYSTEM_ROOTHDD="ext2"
645     else
646     export BOOTHDD=""
647     export SWAPHDD=""
648     export ROOTHDD="${HDD}1"
649     export FORMAT_FILESYSTEM_BOOTHDD=""
650     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
651     fi
652     export INSTALL_METHOD="${method}"
653     ;;
654     normal)
655     export BOOTHDD="${HDD}1"
656     export SWAPHDD="${HDD}2"
657     export ROOTHDD="${HDD}3"
658     export FORMAT_FILESYSTEM_BOOTHDD="${FORMAT_FILESYSTEM}"
659     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
660     export INSTALL_METHOD="${method}"
661     ;;
662     single)
663     export BOOTHDD=""
664     export SWAPHDD=""
665     export ROOTHDD="${HDD}1"
666     export FORMAT_FILESYSTEM_BOOTHDD=""
667     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
668     export INSTALL_METHOD="${method}"
669     ;;
670     flash)
671     export BOOTHDD="${HDD}1"
672     export SWAPHDD=""
673     export ROOTHDD="${HDD}2"
674     export FORMAT_FILESYSTEM_BOOTHDD="${FORMAT_FILESYSTEM}"
675     export FORMAT_FILESYSTEM_ROOTHDD="f2fs"
676     export INSTALL_METHOD="${method}"
677     ;;
678     *)
679     die "Unknown install method '${method}', aborting."
680     ;;
681     esac
682    
683     task_setup_hdd_partitions
684   dialog_setup_hdd_format   dialog_setup_hdd_format
685   setup_hdd_format > /dev/null   setup_hdd_format > /dev/null
686   mount_rootfs   mount_rootfs

Legend:
Removed from v.2491  
changed lines
  Added in v.2892