Magellan Linux

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

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

revision 2481 by niro, Wed Jan 8 10:27:55 2014 UTC revision 2891 by niro, Fri Jul 31 11:13:02 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  #  DIALOG BOXEN #  # -> 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 ###
79    
80  trap_exit()  trap_exit()
81  {  {
# Line 83  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
91  }  }
92    
93  dialog_die()  install_meter()
94  {  {
95   ERROR="$1"   while [[ ${CURRENTLINE} != ${TOTALLINES} ]]
96   RETVAL="$?"   do
97   dialog_install_failure   CURRENTLINE=$(grep -c . /tmp/install.log)
98   exit 1   PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES}))
99     echo ${PERCENT}
100     sleep 1
101     done
102     rm -f /tmp/install.log
103     return 0
104  }  }
105    
106  dialog_warning()  mount_rootfs()
107  {  {
108   local retval   local retval
109    
110   yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?"   if [[ -n ${SWAPHDD} ]]
  retval=$?  
  if [[ ${retval} -eq 1 ]]  
111   then   then
112   clear   swapon ${SWAPHDD} || dialog_die $"Could not enable swap space '${SWAPHDD}'"
  echo $"The process was aborted."  
  exit 1  
113   fi   fi
 }  
114    
115  task_setup_system_menu()   if [[ -n ${ROOTHDD} ]]
 {  
  local mode  
  local retval  
   
  mode="$(dialog_setup_system_menu)"  
  retval=$?  
  [[ ${retval} -eq 1 ]] && return 1  
  if [[ ${retval} -eq 0 ]]  
  then  
  case "${mode}" in  
  "1") run_install_auto ;;  
  "2") run_install_normal ;;  
  "") task_setup_system_menu;;  
  esac  
  fi  
 }  
   
 task_hardware_detection()  
 {  
  local message  
   
  run_hardware_detection_disks  
   
  message+=$"Harddrives:\n"  
   
  if [[ ! -z ${ALL_DISKS} ]]  
  then  
  for i in ${ALL_DISKS}  
  do  
  message+="\Z3${i}\Zn "  
  done  
  message+="\n"  
  fi  
   
  if [[ ! -z ${ALL_CDROMS} ]]  
  then  
  message+="\n"  
  message+=$"Optical disk drives:\n"  
  for i in ${ALL_CDROMS}  
  do  
  message+="\Z3${i}\Zn"  
  done  
  message+="\n"  
  fi  
   
  # other devices  
  run_hardware_detection  
  case "${SPECIALDEVICE}" in  
  zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;;  
  rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;;  
  maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;;  
  *) message+=$"\n\ZnCommon device detected.\Zn" ;;  
  esac  
  if [[ ${FORMFACTOR} = laptop ]]  
116   then   then
117   message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn"   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   messagebox -y 12 -h $"Detected hardware:" "${message}"   [[ -d ${INSTALLROOT}/boot ]] || install -d ${INSTALLROOT}/boot
 }  
   
 task_setup_hdd_partitions_manual()  
 {  
  local i  
  local retval  
126    
127   if [[ -z ${ALL_DISKS} ]]   if [[ -n ${BOOTHDD} ]]
128   then   then
129   dialog_no_harddrive_found   if is_mounted --location "${INSTALLROOT}"/boot
  exit 1  
  else  
  HDD=$(dialog_select_target_harddrive)  
  retval=$?  
  [[ ${retval} -eq 1 ]] && return 1  
  if [[ ${retval} -eq 0 ]]  
130   then   then
131   dialog_setup_hdd_info   echo $"${INSTALLROOT}/boot already mounted" >&2
132   setup_hdd_partitions_manual   else
133     mount -t "${FORMAT_FILESYSTEM_BOOTHDD}" "${BOOTHDD}" "${INSTALLROOT}"/boot || dialog_die $"Could not mount bootfs - drive '${BOOTHDD}' -> '${INSTALLROOT}/boot'"
134   fi   fi
135   fi   fi
136  }  }
137    
138  task_setup_hdd_partitions_auto()  umount_rootfs()
139  {  {
140   local i   is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot
141   local retval   is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}
142    
143   if [[ -z ${ALL_DISKS} ]]   if [[ -n ${SWAPHDD} ]]
144   then   then
145   dialog_no_harddrive_found   swapoff ${SWAPHDD} || die
  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  
  fi  
146   fi   fi
147  }  }
148    
149  install_meter()  install_do_reboot()
 {  
  while [[ ${CURRENTLINE} != ${TOTALLINES} ]]  
  do  
  CURRENTLINE=$(grep -c . /tmp/install.log)  
  PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES}))  
  echo ${PERCENT}  
  sleep 1  
  done  
  rm -f /tmp/install.log  
  return 0  
 }  
   
 task_main()  
150  {  {
151   local method=0   reboot
  local retval  
   
  while [[ ${method} -le 2 ]]  
  do  
  method=$(dialog_main)  
  retval=$?  
  [[ ${retval} -eq 1 ]] && exit 1  
  if [[ ${retval} -eq 0 ]]  
  then  
  case ${method} in  
  "1") task_setup_system_menu ;;  
  "2") task_hardware_detection ;;  
  "3") install_do_reboot ;;  
  "4") /bin/bash --login -i ;;  
  esac  
  fi  
  done  
152  }  }
153    
 #################################################  
 # Install Komandos #  
 #################################################  
154  run_hardware_detection()  run_hardware_detection()
155  {  {
156   local hwinfo   local hwinfo
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 318  run_hardware_detection_disks() Line 218  run_hardware_detection_disks()
218   # all disks but exclude ramdisks   # all disks but exclude ramdisks
219   export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d')   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   # remove the boot device from ALL_DISKS if it was an usbstick
221   if [[ $(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]   if [[ $(grep '[[:space:]]${LIVEROOT}[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]
222   then   then
223   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')
224   export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")   export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")
225   fi   fi
226   export ALL_CDROMS="$(get_hwinfo cdrom)"   export ALL_CDROMS="$(get_hwinfo cdrom)"
227  }  }
228    
229  setup_hdd_partitions_auto()  setup_hdd_partitions()
230  {  {
  ROOTHDD="${HDD}1"  
   
231   # sanity check - should not happen   # sanity check - should not happen
232   if is_mounted --device "${ROOTHDD}"   if is_mounted --device "${ROOTHDD}"
233   then   then
234   echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2   echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2
235   umount "${ROOTHDD}"   umount "${ROOTHDD}"
236   fi   fi
237     if [[ -n ${BOOTHDD} ]]
  # run this only if FDISKPARTITIONBELOW256MB is not already 1  
  if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]  
238   then   then
239   if hdd_size_below_256mb ${HDD}   if is_mounted --device "${BOOTHDD}"
240   then   then
241   FDISKPARTIONBELOW256MB=1   echo "partition: device ${BOOTHDD} is already mounted, umount it" >&2
242   else   umount "${BOOTHDD}"
  FDISKPARTIONBELOW256MB=0  
243   fi   fi
244   fi   fi
245    
246   ## delete disk   if [[ ${INSTALL_METHOD} = auto ]]
  dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die  
   
  if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]  
247   then   then
248   ## setup one bootable partition   # run this only if FDISKPARTITIONBELOW256MB is not already 1
249   #1. n= new disk   if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]
250   #2. p= primary disk   then
251   #3. 1= first partition   if device_minimum_size "${HDD}" 256
252   #4. 2= default sector start // small disk needs more space for grub2 mbr sector   then
253   #5. ''= defaul sector end   FDISKPARTIONBELOW256MB=1
254   #6. a= bootable flag   else
255   #7. 1= boot flag for partition 1   FDISKPARTIONBELOW256MB=0
256   #8. w= write/quit   fi
257   fdisk ${HDD} &> /dev/null << EOF   fi
258    
259     ## delete disk
260     dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die
261    
262     if [[ ${FLASHDISK} = 1 ]]
263     then
264     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    n
282    p
283    1
284    2
285    +50M
286    a
287    1
288    n
289    p
290    2
291    
292    
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    a
317    1
318    n
319    p
320    2
321    
322    
323    w
324    EOF
325     fi
326     else
327     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  n  n
340  p  p
341  1  1
# Line 372  a Line 345  a
345  1  1
346  w  w
347  EOF  EOF
348   else   else
349   ## setup one bootable partition   ## setup one bootable partition
350   #1. n= new disk   #1. n= new disk
351   #2. p= primary disk   #2. p= primary disk
352   #3. 1= first partition   #3. 1= first partition
353   #4. ''= default sector start   #4. ''= default sector start
354   #5. ''= defaul sector end   #5. ''= defaul sector end
355   #6. a= bootable flag   #6. a= bootable flag
356   #7. 1= boot flag for partition 1   #7. 1= boot flag for partition 1
357   #8. w= write/quit   #8. w= write/quit
358   fdisk ${HDD} &> /dev/null << EOF   fdisk ${HDD} &> /dev/null << EOF
359  n  n
360  p  p
361  1  1
# Line 392  a Line 365  a
365  1  1
366  w  w
367  EOF  EOF
368     fi
369     fi
370     else
371     cfdisk ${HDD} || dialog_die
372   fi   fi
373  }  }
374    
 setup_hdd_partitions_manual()  
 {  
  ROOTHDD="${HDD}1"  
  SWAPHDD=""  
  BOOTHDD=""  
  cfdisk ${HDD} || dialog_die  
 }  
   
375  setup_hdd_format()  setup_hdd_format()
376  {  {
377   # sanity check - should not happen   install -d /tmp
378   if is_mounted --device "${ROOTHDD}"   :> /tmp/format.log
379    
380     if [[ -n ${SWAPHDD} ]]
381   then   then
382   echo "format: device ${ROOTHDD} is already mounted, umount it" >&2   # sanity check - should not happen
383   umount "${ROOTHDD}"   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   fi   fi
390    
391   mkfs."${FORMAT_FILESYSTEM}" -q "${ROOTHDD}" || dialog_die   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  install_mount_rootfs()   mkfs."${FORMAT_FILESYSTEM_BOOTHDD}" "${BOOTHDD}" &>> /tmp/format.log || dialog_die
401  {   fi
402   is_mounted --location "${INSTALLROOT}" || mount "${ROOTHDD}" "${INSTALLROOT}"  
403   install -d ${INSTALLROOT}/boot || dialog_die   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     mkfs."${FORMAT_FILESYSTEM_ROOTHDD}" "${ROOTHDD}" &>> /tmp/format.log || dialog_die
413     fi
414  }  }
415    
416  install_system_image()  install_system_image()
417  {  {
418   pushd ${INSTALLROOT} > /dev/null   pushd ${INSTALLROOT} > /dev/null
419   tar xvjpf ${CDROOT}/system/${CDIMAGENAME} -C ${INSTALLROOT}   tar xvjpf ${IMAGEROOT}/${CDIMAGENAME} -C ${INSTALLROOT}
420   popd > /dev/null   popd > /dev/null
421  }  }
422    
# Line 435  install_system_settings() Line 427  install_system_settings()
427   # write fstab   # write fstab
428   CONFIG="${INSTALLROOT}/etc/fstab"   CONFIG="${INSTALLROOT}/etc/fstab"
429   clearconfig   clearconfig
430   addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1"   if [[ -n ${BOOTHDD} ]]
431     then
432     addconfig -e "UUID=$(get_uuid ${BOOTHDD})\t/\t${FORMAT_FILESYSTEM_BOOTHDD}\tnoatime\t1 1"
433     fi
434     if [[ -n ${ROOTHDD} ]]
435     then
436     addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM_ROOTHDD}\tnoatime\t0 0"
437     fi
438     if [[ -n ${SWAPHDD} ]]
439     then
440     addconfig -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0"
441     fi
442   addconfig -e "proc\t/proc\tproc\tdefaults\t0 0"   addconfig -e "proc\t/proc\tproc\tdefaults\t0 0"
443   addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0"   addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0"
444    
# Line 446  install_system_settings() Line 449  install_system_settings()
449   addconfig 'NETWORKING="dhcp"'   addconfig 'NETWORKING="dhcp"'
450    
451   # intel framebuffer quirk   # intel framebuffer quirk
452   if [ -e ${INSTALLROOT}/etc/splash/splash.conf ]   CONFIG="${INSTALLROOT}/etc/splash/splash.conf"
453     if [ -e ${CONFIG} ] && [ -e /proc/fb ]
454   then   then
455   if [ -e /proc/fb ]   if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]
456   then   then
457   if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]   fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')
458   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  
459   fi   fi
460   fi   fi
461  }  }
462    
463  install_umount_rootfs()  
464    ### installer dialogs ###
465    
466    dialog_die()
467  {  {
468   is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot   ERROR="$1"
469   is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}   RETVAL="$?"
470     dialog_install_failure
471     exit 1
472  }  }
473    
474  install_do_reboot()  dialog_warning()
475  {  {
476   reboot   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    
 #################################################  
 #     Install Ablauf Scripte #  
 #################################################  
488    
489  run_install_normal()  ### installer tasks ###
490    
491    task_setup_system_menu()
492  {  {
493   task_hardware_detection   local mode
494     local retval
495    
496   task_setup_hdd_partitions_manual   mode="$(dialog_setup_system_menu)"
497   dialog_setup_hdd_format   retval=$?
498   setup_hdd_format > /dev/null   [[ ${retval} -eq 1 ]] && return 1
499   install_mount_rootfs   if [[ ${retval} -eq 0 ]]
500   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image   then
501     case "${mode}" in
502     "1") run_install auto ;;
503     "2") run_install normal ;;
504     "") task_setup_system_menu;;
505     esac
506     fi
507    }
508    
509   dialog_install_settings  task_hardware_detection()
510   sleep 1  {
511   install_system_settings   local message
512   if is_initrd_supported  
513     run_hardware_detection_disks
514    
515     message+=$"Harddrives:\n"
516    
517     if [[ ! -z ${ALL_DISKS} ]]
518   then   then
519   dialog_install_initrd   for i in ${ALL_DISKS}
520   initrd_config   do
521   initrd_install   message+="\Z3${i}\Zn "
522     done
523     message+="\n"
524   fi   fi
525    
526   dialog_install_bootsector   if [[ ! -z ${ALL_CDROMS} ]]
527   bootloader_config   then
528   bootloader_install   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   install_umount_rootfs   # other devices
538   dialog_install_successful   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     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    
555     messagebox -y 12 -h $"Detected hardware:" "${message}"
556    }
557    
558    task_setup_hdd_partitions()
559    {
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     setup_hdd_partitions
575     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  run_install_auto()  run_install()
602  {  {
603     local method="$1"
604    
605   task_hardware_detection   task_hardware_detection
606    
607   task_setup_hdd_partitions_auto   case "${method}" in
608     auto)
609     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     export INSTALL_METHOD="${method}"
624     ;;
625     normal)
626     export BOOTHDD="${HDD}1"
627     export SWAPHDD="${HDD}2"
628     export ROOTHDD="${HDD}3"
629     export FORMAT_FILESYSTEM_BOOTHDD="${FORMAT_FILESYSTEM}"
630     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
631     export INSTALL_METHOD="${method}"
632     ;;
633     single)
634     export BOOTHDD=""
635     export SWAPHDD=""
636     export ROOTHDD="${HDD}1"
637     export FORMAT_FILESYSTEM_BOOTHDD=""
638     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
639     export INSTALL_METHOD="${method}"
640     ;;
641     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     *)
650     die "Unknown install method '${method}', aborting."
651     ;;
652     esac
653    
654     task_setup_hdd_partitions
655   dialog_setup_hdd_format   dialog_setup_hdd_format
656   setup_hdd_format > /dev/null   setup_hdd_format > /dev/null
657   install_mount_rootfs   mount_rootfs
658   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image
659    
660   dialog_install_settings   dialog_install_settings
# Line 529  run_install_auto() Line 671  run_install_auto()
671   bootloader_config   bootloader_config
672   bootloader_install   bootloader_install
673    
674   install_umount_rootfs   umount_rootfs
675   dialog_install_successful   dialog_install_successful
676  }  }
677    

Legend:
Removed from v.2481  
changed lines
  Added in v.2891