Magellan Linux

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

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

revision 2480 by niro, Wed Jan 8 10:25:50 2014 UTC revision 2890 by niro, Fri Jul 31 11:11:58 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}"  LIVEROOT="${DEFAULT_LIVEROOT}"
50    IMAGEROOT="${DEFAULT_IMAGEROOT}"
51  INSTALLROOT="${DEFAULT_INSTALLROOT}"  INSTALLROOT="${DEFAULT_INSTALLROOT}"
52  KERNELPKG="${DEFAULT_KERNELPKG}"  KERNELPKG="${DEFAULT_KERNELPKG}"
53  KERNELOPTS="${DEFAULT_KERNELOPTS}"  KERNELOPTS="${DEFAULT_KERNELOPTS}"
# Line 71  FDISKPARTIONBELOW256MB=0 Line 57  FDISKPARTIONBELOW256MB=0
57  SPECIALDEVICE=""  SPECIALDEVICE=""
58  FORMFACTOR="${DEFAULT_FORMFACTOR}"  FORMFACTOR="${DEFAULT_FORMFACTOR}"
59  FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}"  FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}"
60    FLASHDISK=0
61    
62    # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !
63    # -> now in images.conf
64    CDIMAGENAME=""
65    TOTALLINES=""
66    CURRENTLINE=0
67    if [ -e ${IMAGEROOT}/images.conf ]
68    then
69     source ${IMAGEROOT}/images.conf
70     # check if all required variables are set
71     [[ -z ${CDIMAGENAME} ]] && die "CDIMAGENAME is empty in ${IMAGEROOT}/images.conf"
72     [[ -z ${TOTALLINES} ]] && die "TOTALLINES is empty in ${IMAGEROOT}/images.conf"
73    else
74     die "${IMAGEROOT}/images.conf not found"
75    fi
76    
77  #################################################  ### helper scripts ###
 #  DIALOG BOXEN #  
 #################################################  
78    
79  trap_exit()  trap_exit()
80  {  {
# Line 83  trap_exit() Line 83  trap_exit()
83   is_mounted --location "${INSTALLROOT}/sys" && umount ${INSTALLROOT}/sys   is_mounted --location "${INSTALLROOT}/sys" && umount ${INSTALLROOT}/sys
84   is_mounted --location "${INSTALLROOT}/boot" && umount ${INSTALLROOT}/boot   is_mounted --location "${INSTALLROOT}/boot" && umount ${INSTALLROOT}/boot
85   is_mounted --location "${INSTALLROOT}" && umount ${INSTALLROOT}   is_mounted --location "${INSTALLROOT}" && umount ${INSTALLROOT}
86     [[ -n ${SWAPHDD} ]] && swapoff ${SWAPHDD}
87    
88   echo $"Installation aborted."   echo $"Installation aborted."
89   exit 1   exit 1
90  }  }
91    
92  dialog_die()  install_meter()
 {  
  ERROR="$1"  
  RETVAL="$?"  
  dialog_install_failure  
  exit 1  
 }  
   
 dialog_warning()  
93  {  {
94   local retval   while [[ ${CURRENTLINE} != ${TOTALLINES} ]]
95     do
96   yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?"   CURRENTLINE=$(grep -c . /tmp/install.log)
97   retval=$?   PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES}))
98   if [[ ${retval} -eq 1 ]]   echo ${PERCENT}
99   then   sleep 1
100   clear   done
101   echo $"The process was aborted."   rm -f /tmp/install.log
102   exit 1   return 0
  fi  
103  }  }
104    
105  task_setup_system_menu()  mount_rootfs()
106  {  {
  local mode  
107   local retval   local retval
108    
109   mode="$(dialog_setup_system_menu)"   if [[ -n ${SWAPHDD} ]]
  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  
 }  
   
 dialog_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} ]]  
110   then   then
111   message+="\n"   swapon ${SWAPHDD} || dialog_die $"Could not enable swap space '${SWAPHDD}'"
  message+=$"Optical disk drives:\n"  
  for i in ${ALL_CDROMS}  
  do  
  message+="\Z3${i}\Zn"  
  done  
  message+="\n"  
112   fi   fi
113    
114   # other devices   if [[ -n ${ROOTHDD} ]]
  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 ]]  
115   then   then
116   message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn"   if is_mounted --location "${INSTALLROOT}"
117     then
118     echo $"${INSTALLROOT} already mounted" >&2
119     else
120     mount -t "${FORMAT_FILESYSTEM_ROOTHDD}" "${ROOTHDD}" "${INSTALLROOT}" || dialog_die $"Could not mount rootfs - drive '${ROOTHDD}' -> '${INSTALLROOT}'"
121     fi
122   fi   fi
123    
124   messagebox -y 12 -h $"Detected hardware:" "${message}"   [[ -d ${INSTALLROOT}/boot ]] || install -d ${INSTALLROOT}/boot
 }  
   
 task_setup_hdd_partitions_manual()  
 {  
  local i  
  local retval  
125    
126   if [[ -z ${ALL_DISKS} ]]   if [[ -n ${BOOTHDD} ]]
127   then   then
128   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 ]]  
129   then   then
130   dialog_setup_hdd_info   echo $"${INSTALLROOT}/boot already mounted" >&2
131   setup_hdd_partitions_manual   else
132     mount -t "${FORMAT_FILESYSTEM_BOOTHDD}" "${BOOTHDD}" "${INSTALLROOT}"/boot || dialog_die $"Could not mount bootfs - drive '${BOOTHDD}' -> '${INSTALLROOT}/boot'"
133   fi   fi
134   fi   fi
135  }  }
136    
137  task_setup_hdd_partitions_auto()  umount_rootfs()
138  {  {
139   local i   is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot
140   local retval   is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}
141    
142   if [[ -z ${ALL_DISKS} ]]   if [[ -n ${SWAPHDD} ]]
143   then   then
144   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  
145   fi   fi
146  }  }
147    
148  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()  
149  {  {
150   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") dialog_hardware_detection ;;  
  "3") install_do_reboot ;;  
  "4") /bin/bash --login -i ;;  
  esac  
  fi  
  done  
151  }  }
152    
 #################################################  
 # Install Komandos #  
 #################################################  
153  run_hardware_detection()  run_hardware_detection()
154  {  {
155   local hwinfo   local hwinfo
156    
157   hwinfo="$(hwinfo --bios --storage --pci --gfxcard --sys)"   hwinfo="$(hwinfo --bios --storage --pci --gfxcard --sys)"
158    
159   ## check for special devices/clients:   # check for special devices/clients:
160   ## 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
161   #local removable=0   local removable=0
162   #if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]]   if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]]
163   #then   then
164   #for i in /sys/block/[hs]d*/removable   for i in /sys/block/[hs]d*/removable
165   #do   do
166   #if [[ $(< ${i}) = 1 ]]   if [[ $(< ${i}) = 1 ]]
167   #then   then
168   #removable=1   removable=1
169   #fi   # we assume that all removable disks are flash disks on a zotac
170   #done   export FLASHDISK=1
171   ## smartcard = udevadm info -n /dev/sda -a | grep -i 'configuration.*card'   fi
172     done
173   ## only add this for grub legacy, grub2 detect these settings on its own   # smartcard = udevadm info -n /dev/sda -a | grep -i 'configuration.*card'
174   #export GRUBLEGACYOPTS="rootdelay=8"  
175   ## 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
176   #if [[ ! -z $(echo "${hwinfo}" | grep -i nouveau) ]]   export GRUBLEGACYOPTS="rootdelay=8"
177   #then   # there are to zotac types in the wild, nvidia based gfx and intel
178   #export SPECIALDEVICE="zotac_nvidia"   if [[ ! -z $(echo "${hwinfo}" | grep -i nouveau) ]]
179   #else   then
180   #export SPECIALDEVICE="zotac_intel"   export SPECIALDEVICE="zotac_nvidia"
181   #fi   else
182   #fi   export SPECIALDEVICE="zotac_intel"
183     fi
184     fi
185    
186   # check for special devices/clients:   # check for special devices/clients:
187   # 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 217  run_hardware_detection_disks()
217   # all disks but exclude ramdisks   # all disks but exclude ramdisks
218   export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d')   export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d')
219   # remove the boot device from ALL_DISKS if it was an usbstick   # remove the boot device from ALL_DISKS if it was an usbstick
220   if [[ $(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]   if [[ $(grep '[[:space:]]${LIVEROOT}[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]
221   then   then
222   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')
223   export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")   export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")
224   fi   fi
225   export ALL_CDROMS="$(get_hwinfo cdrom)"   export ALL_CDROMS="$(get_hwinfo cdrom)"
226  }  }
227    
228  setup_hdd_partitions_auto()  setup_hdd_partitions()
229  {  {
  ROOTHDD="${HDD}1"  
   
230   # sanity check - should not happen   # sanity check - should not happen
231   if is_mounted --device "${ROOTHDD}"   if is_mounted --device "${ROOTHDD}"
232   then   then
233   echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2   echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2
234   umount "${ROOTHDD}"   umount "${ROOTHDD}"
235   fi   fi
236     if [[ -n ${BOOTHDD} ]]
  # run this only if FDISKPARTITIONBELOW256MB is not already 1  
  if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]  
237   then   then
238   if hdd_size_below_256mb ${HDD}   if is_mounted --device "${BOOTHDD}"
239   then   then
240   FDISKPARTIONBELOW256MB=1   echo "partition: device ${BOOTHDD} is already mounted, umount it" >&2
241   else   umount "${BOOTHDD}"
  FDISKPARTIONBELOW256MB=0  
242   fi   fi
243   fi   fi
244    
245   ## delete disk   if [[ ${INSTALL_METHOD} = auto ]]
  dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die  
   
  if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]  
246   then   then
247   ## setup one bootable partition   # run this only if FDISKPARTITIONBELOW256MB is not already 1
248   #1. n= new disk   if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]
249   #2. p= primary disk   then
250   #3. 1= first partition   if device_minimum_size "${HDD}" 256
251   #4. 2= default sector start // small disk needs more space for grub2 mbr sector   then
252   #5. ''= defaul sector end   FDISKPARTIONBELOW256MB=1
253   #6. a= bootable flag   else
254   #7. 1= boot flag for partition 1   FDISKPARTIONBELOW256MB=0
255   #8. w= write/quit   fi
256   fdisk ${HDD} &> /dev/null << EOF   fi
257    
258     ## delete disk
259     dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die
260    
261     if [[ ${FLASHDISK} = 1 ]]
262     then
263     if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
264     then
265     ## setup one bootable partition
266     # 1. n= new disk
267     # 2. p= primary disk
268     # 3. 1= first partition
269     # 4. 2= default sector start // small disk needs more space for grub2 mbr sector
270     # 5. ''= defaul sector end
271     # 6. a= bootable flag
272     # 7. 1= boot flag for partition 1
273     # 8. n= new disk
274     #10. p= primary disk
275     #11. 2= second partition
276     #12. ''= default sector start
277     #13. ''= defaul sector end
278     #14. w= write/quit
279     fdisk ${HDD} &> /dev/null << EOF
280  n  n
281  p  p
282  1  1
283  2  2
284    +50M
285    a
286    1
287    n
288    p
289    2
290    
291    
292    w
293    EOF
294     else
295     ## setup one bootable partition
296     # 1. n= new disk
297     # 2. p= primary disk
298     # 3. 1= first partition
299     # 4. ''= default sector start
300     # 5. ''= defaul sector end
301     # 6. a= bootable flag
302     # 7. 1= boot flag for partition 1
303     # 8. n= new disk
304     #10. p= primary disk
305     #11. 2= second partition
306     #12. ''= default sector start
307     #13. ''= defaul sector end
308     #14. w= write/quit
309     fdisk ${HDD} &> /dev/null << EOF
310    n
311    p
312    1
313    
314    +50M
315  a  a
316  1  1
317    n
318    p
319    2
320    
321    
322  w  w
323  EOF  EOF
324   else   fi
325   ## setup one bootable partition   else
326   #1. n= new disk   if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
327   #2. p= primary disk   then
328   #3. 1= first partition   ## setup one bootable partition
329   #4. ''= default sector start   #1. n= new disk
330   #5. ''= defaul sector end   #2. p= primary disk
331   #6. a= bootable flag   #3. 1= first partition
332   #7. 1= boot flag for partition 1   #4. 2= default sector start // small disk needs more space for grub2 mbr sector
333   #8. w= write/quit   #5. ''= defaul sector end
334   fdisk ${HDD} &> /dev/null << EOF   #6. a= bootable flag
335     #7. 1= boot flag for partition 1
336     #8. w= write/quit
337     fdisk ${HDD} &> /dev/null << EOF
338    n
339    p
340    1
341    2
342    
343    a
344    1
345    w
346    EOF
347     else
348     ## setup one bootable partition
349     #1. n= new disk
350     #2. p= primary disk
351     #3. 1= first partition
352     #4. ''= default sector start
353     #5. ''= defaul sector end
354     #6. a= bootable flag
355     #7. 1= boot flag for partition 1
356     #8. w= write/quit
357     fdisk ${HDD} &> /dev/null << EOF
358  n  n
359  p  p
360  1  1
# Line 392  a Line 364  a
364  1  1
365  w  w
366  EOF  EOF
367     fi
368     fi
369     else
370     cfdisk ${HDD} || dialog_die
371   fi   fi
372  }  }
373    
 setup_hdd_partitions_manual()  
 {  
  ROOTHDD="${HDD}1"  
  SWAPHDD=""  
  BOOTHDD=""  
  cfdisk ${HDD} || dialog_die  
 }  
   
374  setup_hdd_format()  setup_hdd_format()
375  {  {
376   # sanity check - should not happen   install -d /tmp
377   if is_mounted --device "${ROOTHDD}"   :> /tmp/format.log
378    
379     if [[ -n ${SWAPHDD} ]]
380   then   then
381   echo "format: device ${ROOTHDD} is already mounted, umount it" >&2   # sanity check - should not happen
382   umount "${ROOTHDD}"   if is_mounted --device "${SWAPHDD}"
383     then
384     echo "format: device ${SWAPHDD} is already mounted, umount it" >&2
385     umount "${SWAPHDD}"
386     fi
387     mkswap ${SWAPHDD} || die
388   fi   fi
389    
390   mkfs."${FORMAT_FILESYSTEM}" -q "${ROOTHDD}" || dialog_die   if [[ -n ${BOOTHDD} ]]
391  }   then
392     # sanity check - should not happen
393     if is_mounted --device "${BOOTHDD}"
394     then
395     echo "format: device ${BOOTHDD} is already mounted, umount it" >&2
396     umount "${BOOTHDD}"
397     fi
398    
399  install_mount_rootfs()   mkfs."${FORMAT_FILESYSTEM_BOOTHDD}" "${BOOTHDD}" &>> /tmp/format.log || dialog_die
400  {   fi
401   is_mounted --location "${INSTALLROOT}" || mount "${ROOTHDD}" "${INSTALLROOT}"  
402   install -d ${INSTALLROOT}/boot || dialog_die   if [[ -n ${ROOTHDD} ]]
403     then
404     # sanity check - should not happen
405     if is_mounted --device "${ROOTHDD}"
406     then
407     echo "format: device ${ROOTHDD} is already mounted, umount it" >&2
408     umount "${ROOTHDD}"
409     fi
410    
411     mkfs."${FORMAT_FILESYSTEM_ROOTHDD}" "${ROOTHDD}" &>> /tmp/format.log || dialog_die
412     fi
413  }  }
414    
415  install_system_image()  install_system_image()
416  {  {
417   pushd ${INSTALLROOT} > /dev/null   pushd ${INSTALLROOT} > /dev/null
418   tar xvjpf ${CDROOT}/system/${CDIMAGENAME} -C ${INSTALLROOT}   tar xvjpf ${IMAGEROOT}/${CDIMAGENAME} -C ${INSTALLROOT}
419   popd > /dev/null   popd > /dev/null
420  }  }
421    
# Line 435  install_system_settings() Line 426  install_system_settings()
426   # write fstab   # write fstab
427   CONFIG="${INSTALLROOT}/etc/fstab"   CONFIG="${INSTALLROOT}/etc/fstab"
428   clearconfig   clearconfig
429   addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1"   if [[ -n ${BOOTHDD} ]]
430     then
431     addconfig -e "UUID=$(get_uuid ${BOOTHDD})\t/\t${FORMAT_FILESYSTEM_BOOTHDD}\tnoatime\t1 1"
432     fi
433     if [[ -n ${ROOTHDD} ]]
434     then
435     addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM_ROOTHDD}\tnoatime\t0 0"
436     fi
437     if [[ -n ${SWAPHDD} ]]
438     then
439     addconfig -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0"
440     fi
441   addconfig -e "proc\t/proc\tproc\tdefaults\t0 0"   addconfig -e "proc\t/proc\tproc\tdefaults\t0 0"
442   addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0"   addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0"
443    
# Line 446  install_system_settings() Line 448  install_system_settings()
448   addconfig 'NETWORKING="dhcp"'   addconfig 'NETWORKING="dhcp"'
449    
450   # intel framebuffer quirk   # intel framebuffer quirk
451   if [ -e ${INSTALLROOT}/etc/splash/splash.conf ]   CONFIG="${INSTALLROOT}/etc/splash/splash.conf"
452     if [ -e ${CONFIG} ] && [ -e /proc/fb ]
453   then   then
454   if [ -e /proc/fb ]   if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]
455   then   then
456   if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]   fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')
457   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  
458   fi   fi
459   fi   fi
460  }  }
461    
462  install_umount_rootfs()  
463    ### installer dialogs ###
464    
465    dialog_die()
466  {  {
467   is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot   ERROR="$1"
468   is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}   RETVAL="$?"
469     dialog_install_failure
470     exit 1
471  }  }
472    
473  install_do_reboot()  dialog_warning()
474  {  {
475   reboot   local retval
476    
477     yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?"
478     retval=$?
479     if [[ ${retval} -eq 1 ]]
480     then
481     clear
482     echo $"The process was aborted."
483     exit 1
484     fi
485  }  }
486    
 #################################################  
 #     Install Ablauf Scripte #  
 #################################################  
487    
488  run_install_normal()  ### installer tasks ###
489    
490    task_setup_system_menu()
491  {  {
492   dialog_hardware_detection   local mode
493     local retval
494    
495   task_setup_hdd_partitions_manual   mode="$(dialog_setup_system_menu)"
496   dialog_setup_hdd_format   retval=$?
497   setup_hdd_format > /dev/null   [[ ${retval} -eq 1 ]] && return 1
498   install_mount_rootfs   if [[ ${retval} -eq 0 ]]
499   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | install_meter | dialog_install_system_image   then
500     case "${mode}" in
501     "1") run_install auto ;;
502     "2") run_install normal ;;
503     "") task_setup_system_menu;;
504     esac
505     fi
506    }
507    
508   dialog_install_settings  task_hardware_detection()
509   sleep 1  {
510   install_system_settings   local message
511   if is_initrd_supported  
512     run_hardware_detection_disks
513    
514     message+=$"Harddrives:\n"
515    
516     if [[ ! -z ${ALL_DISKS} ]]
517   then   then
518   dialog_install_initrd   for i in ${ALL_DISKS}
519   initrd_config   do
520   initrd_install   message+="\Z3${i}\Zn "
521     done
522     message+="\n"
523   fi   fi
524    
525   dialog_install_bootsector   if [[ ! -z ${ALL_CDROMS} ]]
526   bootloader_config   then
527   bootloader_install   message+="\n"
528     message+=$"Optical disk drives:\n"
529     for i in ${ALL_CDROMS}
530     do
531     message+="\Z3${i}\Zn"
532     done
533     message+="\n"
534     fi
535    
536   install_umount_rootfs   # other devices
537   dialog_install_successful   run_hardware_detection
538     case "${SPECIALDEVICE}" in
539     zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;;
540     rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;;
541     maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;;
542     *) message+=$"\n\ZnCommon device detected.\Zn" ;;
543     esac
544     if [[ ${FORMFACTOR} = laptop ]]
545     then
546     message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn"
547     fi
548     if [[ ${FLASHDISK} = 1 ]]
549     then
550     message+=$"\n\ZnFlash memory detected.\Zn"
551     message+=$"\n\ZnF2FS will be used as default filesystem withn the auto installation mode.\Zn"
552     fi
553    
554     messagebox -y 12 -h $"Detected hardware:" "${message}"
555    }
556    
557    task_setup_hdd_partitions()
558    {
559     local i
560     local retval
561    
562     if [[ -z ${ALL_DISKS} ]]
563     then
564     dialog_no_harddrive_found
565     exit 1
566     else
567     HDD=$(dialog_select_target_harddrive)
568     retval=$?
569     [[ ${retval} -eq 1 ]] && return 1
570     if [[ ${retval} -eq 0 ]]
571     then
572     dialog_setup_hdd_info
573     setup_hdd_partitions
574     fi
575     fi
576  }  }
577    
578  run_install_auto()  task_main()
579  {  {
580   dialog_hardware_detection   local method=0
581     local retval
582    
583     while [[ ${method} -le 2 ]]
584     do
585     method=$(dialog_main)
586     retval=$?
587     [[ ${retval} -eq 1 ]] && exit 1
588     if [[ ${retval} -eq 0 ]]
589     then
590     case ${method} in
591     "1") task_setup_system_menu ;;
592     "2") task_hardware_detection ;;
593     "3") install_do_reboot ;;
594     "4") /bin/bash --login -i ;;
595     esac
596     fi
597     done
598    }
599    
600    run_install()
601    {
602     local method="$1"
603    
604     task_hardware_detection
605    
606     case "${method}" in
607     auto)
608     if [[ ${FLASHDISK} = 1 ]]
609     then
610     export BOOTHDD="${HDD}1"
611     export SWAPHDD=""
612     export ROOTHDD="${HDD}2"
613     export FORMAT_FILESYSTEM_BOOTHDD="f2fs"
614     export FORMAT_FILESYSTEM_ROOTHDD="ext2"
615     else
616     export BOOTHDD=""
617     export SWAPHDD=""
618     export ROOTHDD="${HDD}1"
619     export FORMAT_FILESYSTEM_BOOTHDD=""
620     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
621     fi
622     export INSTALL_METHOD="${method}"
623     ;;
624     normal)
625     export BOOTHDD="${HDD}1"
626     export SWAPHDD="${HDD}2"
627     export ROOTHDD="${HDD}3"
628     export FORMAT_FILESYSTEM_BOOTHDD="${FORMAT_FILESYSTEM}"
629     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
630     export INSTALL_METHOD="${method}"
631     ;;
632     single)
633     export BOOTHDD=""
634     export SWAPHDD=""
635     export ROOTHDD="${HDD}1"
636     export FORMAT_FILESYSTEM_BOOTHDD=""
637     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
638     export INSTALL_METHOD="${method}"
639     ;;
640     flash)
641     export BOOTHDD="${HDD}1"
642     export SWAPHDD=""
643     export ROOTHDD="${HDD}2"
644     export FORMAT_FILESYSTEM_BOOTHDD="${FORMAT_FILESYSTEM}"
645     export FORMAT_FILESYSTEM_ROOTHDD="f2fs"
646     export INSTALL_METHOD="${method}"
647     ;;
648     *)
649     die "Unknown install method '${method}', aborting."
650     ;;
651     esac
652    
653   task_setup_hdd_partitions_auto   task_setup_hdd_partitions
654   dialog_setup_hdd_format   dialog_setup_hdd_format
655   setup_hdd_format > /dev/null   setup_hdd_format > /dev/null
656   install_mount_rootfs   mount_rootfs
657   (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
658    
659   dialog_install_settings   dialog_install_settings
# Line 529  run_install_auto() Line 670  run_install_auto()
670   bootloader_config   bootloader_config
671   bootloader_install   bootloader_install
672    
673   install_umount_rootfs   umount_rootfs
674   dialog_install_successful   dialog_install_successful
675  }  }
676    

Legend:
Removed from v.2480  
changed lines
  Added in v.2890