Magellan Linux

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

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

revision 2399 by niro, Tue Jan 7 13:13:26 2014 UTC revision 2891 by niro, Fri Jul 31 11:13:02 2015 UTC
# Line 7  Line 7 
7  # Niels Rogalla <niro@magellan-linux.de>  # Niels Rogalla <niro@magellan-linux.de>
8  #  #
9    
10  # ignore the environment  # setup locales
11  LC_ALL=C  TEXTDOMAIN=installer
12    
13  # include dir  # include dir
14  INSTALLER_LIBDIR="%LIBDIR%"  INSTALLER_LIBDIR="%LIBDIR%"
15    
# Line 22  die() Line 23  die()
23   exit 1   exit 1
24  }  }
25    
26  # configuration  # load common includes
27  if [ -e %SYSCONFDIR%/installer.conf ]  for inc in %SYSCONFDIR%/installer.conf \
28  then   ${INSTALLER_LIBDIR}/functions/common.sh \
29   source %SYSCONFDIR%/installer.conf   ${INSTALLER_LIBDIR}/functions/common-dialogs.sh \
30  else   ${INSTALLER_LIBDIR}/functions/hwdetection.sh \
31   die "/etc/installer.conf not found"   ${INSTALLER_LIBDIR}/functions/bootloader.sh \
32  fi   ${INSTALLER_LIBDIR}/functions/initrd-tools.sh \
33     ${INSTALLER_LIBDIR}/functions/installer-dialogs.sh
34  # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !  do
35  # -> now in images.conf   if [ -e ${inc} ]
36  CDIMAGENAME=""   then
37  TOTALLINES=""   source "${inc}"
38  CURRENTLINE=0   else
39  if [ -e /mnt/cdrom/system/images.conf ]   die "'${inc}' not found"
40  then   fi
41   source /mnt/cdrom/system/images.conf  done
  # 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  
   
 # includes  
 source ${INSTALLER_LIBDIR}/functions/hwdetection.sh  
42    
43  ### System/Config Version  ### System/Config Version
44  VERSION="%VERSIONTAG%"  VERSION="%VERSIONTAG%"
45  TITLE="${DEFAULT_TITLE} - ${VERSION}"  TITLE="${DEFAULT_TITLE} - ${VERSION}"
46    
47  CDROOT="${DEFAULT_CDROOT}"  # initialize global variables so they are exportable
48    # some sane defaults
49    INSTALL_METHOD=""
50    LIVEROOT="${DEFAULT_LIVEROOT}"
51    IMAGEROOT="${DEFAULT_IMAGEROOT}"
52  INSTALLROOT="${DEFAULT_INSTALLROOT}"  INSTALLROOT="${DEFAULT_INSTALLROOT}"
53    KERNELPKG="${DEFAULT_KERNELPKG}"
54  # standard kernel opts  KERNELOPTS="${DEFAULT_KERNELOPTS}"
 KERNELOPTS="quiet video=1024x768"  
   
 # grub options  
55  GRUBLEGACYOPTS=""  GRUBLEGACYOPTS=""
56  GRUB2OPTS=""  GRUB2OPTS=""
   
 # fdisk options  
57  FDISKPARTIONBELOW256MB=0  FDISKPARTIONBELOW256MB=0
   
 # default specialdevices  
58  SPECIALDEVICE=""  SPECIALDEVICE=""
59  FORMFACTOR="desktop"  FORMFACTOR="${DEFAULT_FORMFACTOR}"
   
 # target filesystem  
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  dialog_die()  CURRENTLINE=0
68  {  if [ -e ${IMAGEROOT}/images.conf ]
69   ERROR="$1"  then
70   RETVAL="$?"   source ${IMAGEROOT}/images.conf
71   dialog_install_failure   # check if all required variables are set
72   exit 1   [[ -z ${CDIMAGENAME} ]] && die "CDIMAGENAME is empty in ${IMAGEROOT}/images.conf"
73  }   [[ -z ${TOTALLINES} ]] && die "TOTALLINES is empty in ${IMAGEROOT}/images.conf"
74    else
75  dialog_warning()   die "${IMAGEROOT}/images.conf not found"
76  {  fi
  local retval  
   
  yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?"  
  retval=$?  
  if [[ ${retval} -eq 1 ]]  
  then  
  clear  
  echo $"The process was aborted."  
  exit 1  
  fi  
 }  
   
 dialog_setup_hdd_info()  
 {  
  local SHDD="$(echo $HDD | sed 's/\/dev\///')"  
77    
78   dialog \  ### helper scripts ###
  --colors \  
  --title "[ Festplatten Partitionierung ]" \  
  --backtitle "${TITLE}" \  
  --ok-label "Weiter" \  
  --msgbox "\nBitte legen Sie 1 Partition an.\n\n\  
  [ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit dem gesamten Speicher\n\  
  Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81  
 }  
79    
80  dialog_setup_hdd_info_auto()  trap_exit()
81  {  {
82   local SHDD="$(echo $HDD | sed 's/\/dev\///')"   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     [[ -n ${SWAPHDD} ]] && swapoff ${SWAPHDD}
88    
89   dialog \   echo $"Installation aborted."
90   --colors \   exit 1
  --title "[ Festplatten Partitionierung ]" \  
  --backtitle "${TITLE}" \  
  --ok-label "Weiter" \  
  --msgbox "\nAchtung!\n\  
  Alle Daten werden von der Disk [ \Z3${HDD}\Zn ] gelöscht!" 12 81  
91  }  }
92    
93  dialog_setup_system_menu()  install_meter()
94  {  {
95   local i   while [[ ${CURRENTLINE} != ${TOTALLINES} ]]
96     do
97   i=$(dialog \   CURRENTLINE=$(grep -c . /tmp/install.log)
98   --backtitle "${TITLE}" \   PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES}))
99   --title "[ Festplatten Partitionierung ]" \   echo ${PERCENT}
100   --cancel-label "Abbrechen" \   sleep 1
101   --ok-label "Weiter" \   done
102   --stdout \   rm -f /tmp/install.log
103   --colors \   return 0
  --menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \  
  "1" "Automatisches Setup (Empfohlen)" \  
  "" "" \  
  "" "\Z1Experten Modi:\Zn" \  
  "2" "Normale IDE-Disk (Manuell)" \  
  RES=$?  
  [[ ${RES} -eq 1 ]] && return 1  
  if [[ ${RES} -eq 0 ]]  
  then  
  case "${i}" in  
  "1") run_install_auto ;;  
  "2") run_install_normal ;;  
  "") dialog_setup_system_menu;;  
  esac  
  fi  
104  }  }
105    
106  dialog_hardware_detection()  mount_rootfs()
107  {  {
108   local i   local retval
  local hwtmp  
   
  if [ -x $(type -P mktemp) ]  
  then  
  hwtmp="$(mktemp)"  
  else  
  hwtmp="/tmp/hwtmp.sh"  
  fi  
   
  run_hardware_detection_disks  
   
  echo "dialog \\"  > ${hwtmp}  
  echo "--backtitle \"${TITLE}\" \\" >> ${hwtmp}  
  echo "--ok-label \"Weiter\" \\" >> ${hwtmp}  
  echo "--stdout \\" >> ${hwtmp}  
  echo "--colors \\" >> ${hwtmp}  
  echo "--msgbox \"Gefundene Hardware:\n\n \\" >> ${hwtmp}  
  echo " Festplatten:\n \\" >> ${hwtmp}  
   
  if [[ ! -z ${ALL_DISKS} ]]  
  then  
  for i in ${ALL_DISKS}  
  do  
  echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp}  
  done  
  fi  
   
  if [[ ! -z ${ALL_CDROMS} ]]  
  then  
  echo " \n \\" >> ${hwtmp}  
  echo " CDROM Laufwerke:\n \\" >> ${hwtmp}  
  for i in ${ALL_CDROMS}  
  do  
  echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp}  
  done  
  fi  
   
  # other devices  
  run_hardware_detection  
  case "${SPECIALDEVICE}" in  
  zotac*) echo " \n\n\n \\Z2Zotac Device erkannt.\\Zn \\" >> ${hwtmp} ;;  
  rangee) echo " \n\n\n \\Z2Rangee Device erkannt.\\Zn \\" >> ${hwtmp} ;;  
  maxdata) echo " \n\n\n \\Z2Maxdata Device erkannt.\\Zn \\" >> ${hwtmp} ;;  
  *) echo " \n\n\n \\ZnStandard Device erkannt.\\Zn \\" >> ${hwtmp} ;;  
  esac  
  if [[ ${FORMFACTOR} = laptop ]]  
  then  
  echo " \n \\ZnFormfactor Laptop, Powersave Modus 'ondemand' wird aktiviert.\\Zn \\" >> ${hwtmp}  
  fi  
   
  echo " \" 14 70" >> ${hwtmp}  
  chmod a+x ${hwtmp}  
  ${hwtmp}  
109    
110   # remove tmp file   if [[ -n ${SWAPHDD} ]]
  if [[ -f ${hwtmp} ]]  
111   then   then
112   rm ${hwtmp}   swapon ${SWAPHDD} || dialog_die $"Could not enable swap space '${SWAPHDD}'"
113   fi   fi
 }  
   
 dialog_setup_hdd_partitions_manuell()  
 {  
  local i  
114    
115   if [[ -z ${installdevs} ]]   if [[ -n ${ROOTHDD} ]]
116   then   then
117   dialog \   if is_mounted --location "${INSTALLROOT}"
  --backtitle "${TITLE}" \  
  --ok-label "Beenden" \  
  --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70  
  exit 1  
  else  
   
  echo "dialog \\" > /tmp/hddtmp.sh  
  echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh  
  echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh  
  echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh  
  echo "--stdout \\" >> /tmp/hddtmp.sh  
  echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh  
   
  for i in ${installdevs}  
  do  
  echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh  
  done  
  echo -e "\n" >> /tmp/hddtmp.sh  
   
  chmod a+x /tmp/hddtmp.sh  
  HDD="$(/tmp/hddtmp.sh)"  
  RES=$?  
  [[ ${RES} -eq 1 ]] && return 1  
  if [[ ${RES} -eq 0 ]]  
118   then   then
119   dialog_setup_hdd_info   echo $"${INSTALLROOT} already mounted" >&2
120   setup_hdd_partitions_manuell   else
121     mount -t "${FORMAT_FILESYSTEM_ROOTHDD}" "${ROOTHDD}" "${INSTALLROOT}" || dialog_die $"Could not mount rootfs - drive '${ROOTHDD}' -> '${INSTALLROOT}'"
122   fi   fi
123   fi   fi
 }  
124    
125  dialog_setup_hdd_partitions_auto()   [[ -d ${INSTALLROOT}/boot ]] || install -d ${INSTALLROOT}/boot
 {  
  local i  
126    
127   if [[ -z ${installdevs} ]]   if [[ -n ${BOOTHDD} ]]
128   then   then
129   dialog \   if is_mounted --location "${INSTALLROOT}"/boot
130   --backtitle "${TITLE}" \   then
131   --ok-label "Beenden" \   echo $"${INSTALLROOT}/boot already mounted" >&2
132   --msgbox "Kein geeignetes Laufwerk gefunden.\nDie Installation ist fehlgeschlagen." 6 70   else
133   exit 1   mount -t "${FORMAT_FILESYSTEM_BOOTHDD}" "${BOOTHDD}" "${INSTALLROOT}"/boot || dialog_die $"Could not mount bootfs - drive '${BOOTHDD}' -> '${INSTALLROOT}/boot'"
  else  
   
  echo "dialog \\" > /tmp/hddtmp.sh  
  echo "--backtitle \"${TITLE}\" \\" >> /tmp/hddtmp.sh  
  echo "--ok-label \"Weiter\" \\" >> /tmp/hddtmp.sh  
  echo "--cancel-label \"Beenden\" \\" >> /tmp/hddtmp.sh  
  echo "--stdout \\" >> /tmp/hddtmp.sh  
  echo "--menu \"Installations Laufwerk auswaehlen:\" 10 70 3 \\" >> /tmp/hddtmp.sh  
   
  for i in ${installdevs}  
  do  
  echo "\"${i}\" \"\" \\" >> /tmp/hddtmp.sh  
  done  
  echo -e "\n" >> /tmp/hddtmp.sh  
   
  chmod a+x /tmp/hddtmp.sh  
  HDD="$(/tmp/hddtmp.sh)"  
  RES=$?  
  [[ ${RES} -eq 1 ]] && return 1  
  if [[ ${RES} -eq 0 ]]  
  then  
  dialog_setup_hdd_info_auto  
  dialog_setup_hdd_create_partitions  
  setup_hdd_partitions_auto  
134   fi   fi
135   fi   fi
136  }  }
137    
138  run_hardware_detection_disks()  umount_rootfs()
139  {  {
140   local bootdev   is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot
141     is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}
142    
143   # all disks but exclude ramdisks   if [[ -n ${SWAPHDD} ]]
  export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d')  
  # remove the boot device from ALL_DISKS if it was an usbstick  
  if [[ $(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]  
144   then   then
145   bootdev="$(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g')"   swapoff ${SWAPHDD} || die
  export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")  
146   fi   fi
  export ALL_CDROMS="$(get_hwinfo cdrom)"  
 }  
   
 dialog_setup_hdd_create_partitions()  
 {  
  dialog \  
  --backtitle "${TITLE}" \  
  --infobox "Erstelle Disk Partitionen ..." 3 70  
 }  
   
 dialog_setup_hdd_format()  
 {  
  dialog \  
  --backtitle "${TITLE}" \  
  --infobox "Erstelle Datei-Systeme ..." 3 70  
 }  
   
 dialog_install_settings()  
 {  
  dialog \  
  --backtitle "${TITLE}" \  
  --infobox "Speichere System-Einstellungen ..." 3 70  
147  }  }
148    
149  dialog_install_system_image()  install_do_reboot()
 {  
  dialog \  
  --backtitle "${TITLE}" \  
  --gauge "Kopiere System-Image ..." 6 80  
 }  
   
 dialog_install_meter()  
 {  
  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  
 }  
   
   
 dialog_install_bootsector()  
 {  
  dialog \  
  --backtitle "${TITLE}" \  
  --infobox "Schreibe den Bootsektor ..." 3 70  
 }  
   
 dialog_install_successful()  
 {  
  dialog \  
  --backtitle "${TITLE}" \  
  --colors \  
  --msgbox "Die Installation war \Z2erfolgreich\Zn." 5 81  
 }  
   
 dialog_install_failure()  
 {  
  dialog \  
  --backtitle "${TITLE}" \  
  --colors \  
  --msgbox "Die Installation ist \Z1Fehlgeschlagen\Zn.\n\n\  
  Fehler bei ${ERROR}, RetVal: ${RETVAL} \  
  " 10 81  
 }  
   
 dialog_main()  
150  {  {
151   METHOD=0   reboot
   
  while [[ ${METHOD} -le 2 ]]  
  do  
  METHOD=$(dialog \  
  --backtitle "${TITLE}" \  
  --no-cancel \  
  --ok-label "Weiter" \  
  --stdout \  
  --menu "Konfiguration" 14 70 5 \  
  "1" "AutoSta_LX installieren" \  
  "2" "Uebersicht gefundener Laufwerke" \  
  "3" "Beenden und neustarten" \  
  "4" "Beenden und eine Shell starten")  
  RES=$?  
  [[ ${RES} -eq 1 ]] && exit 1  
  if [[ ${RES} -eq 0 ]]  
  then  
  case ${METHOD} in  
  "1") dialog_setup_system_menu ;;  
  "2") dialog_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
# Line 425  run_hardware_detection() Line 167  run_hardware_detection()
167   if [[ $(< ${i}) = 1 ]]   if [[ $(< ${i}) = 1 ]]
168   then   then
169   removable=1   removable=1
170     # we assume that all removable disks are flash disks on a zotac
171     export FLASHDISK=1
172   fi   fi
173   done   done
174     # smartcard = udevadm info -n /dev/sda -a | grep -i 'configuration.*card'
175    
176   # only add this for grub legacy, grub2 detect these settings on its own   # only add this for grub legacy, grub2 detect these settings on its own
177   export GRUBLEGACYOPTS="rootdelay=8"   export GRUBLEGACYOPTS="rootdelay=8"
# Line 466  run_hardware_detection() Line 211  run_hardware_detection()
211   fi   fi
212  }  }
213    
214  hdd_size_below_256mb()  run_hardware_detection_disks()
215  {  {
216   local hdd="$1"   local bootdev
  local size  
  local retval  
  [[ -z ${hdd} ]] && dialog_die "Error: get_hdd_size() no \$hdd given!"  
217    
218   size=$(fdisk -l ${hdd} | grep "Disk.*${hdd}" | sed 's:.*,\ \(.*\)\ byte.*:\1:')   # all disks but exclude ramdisks
219   if [[ ${size} -le 257000000 ]]   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     if [[ $(grep '[[:space:]]${LIVEROOT}[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]
222   then   then
223   retval="0"   bootdev=$(grep "[[:space:]]${LIVEROOT}[[:space:]]" /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g')
224   else   export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")
  retval="1"  
225   fi   fi
226     export ALL_CDROMS="$(get_hwinfo cdrom)"
  return "${retval}"  
227  }  }
228    
229  setup_hdd_partitions_auto()  setup_hdd_partitions()
230  {  {
231   ROOTHDD="${HDD}1"   # sanity check - should not happen
232     if is_mounted --device "${ROOTHDD}"
  # run this only if FDISKPARTITIONBELOW256MB is not already 1  
  if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]  
233   then   then
234   if hdd_size_below_256mb ${HDD}   echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2
235     umount "${ROOTHDD}"
236     fi
237     if [[ -n ${BOOTHDD} ]]
238     then
239     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  n
282  p  p
283  1  1
284  2  2
285    +50M
286  a  a
287  1  1
288    n
289    p
290    2
291    
292    
293  w  w
294  EOF  EOF
295   else   else
296   ## setup one bootable partition   ## setup one bootable partition
297   #1. n= new disk   # 1. n= new disk
298   #2. p= primary disk   # 2. p= primary disk
299   #3. 1= first partition   # 3. 1= first partition
300   #4. ''= default sector start   # 4. ''= default sector start
301   #5. ''= defaul sector end   # 5. ''= defaul sector end
302   #6. a= bootable flag   # 6. a= bootable flag
303   #7. 1= boot flag for partition 1   # 7. 1= boot flag for partition 1
304   #8. w= write/quit   # 8. n= new disk
305   fdisk ${HDD} &> /dev/null << EOF   #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  n
312  p  p
313  1  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
340    p
341    1
342    2
343    
344  a  a
345  1  1
346  w  w
347  EOF  EOF
348   fi   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    
 setup_hdd_partitions_manuell()  
 {  
  ROOTHDD="${HDD}1"  
363    
364   ## hdds partitionieren manuell  a
365   cfdisk ${HDD} || dialog_die  1
366    w
367    EOF
368     fi
369     fi
370     else
371     cfdisk ${HDD} || dialog_die
372     fi
373  }  }
374    
375  setup_hdd_format()  setup_hdd_format()
376  {  {
377   mke2fs -j -q ${ROOTHDD} || dialog_die   install -d /tmp
378  }   :> /tmp/format.log
   
 install_mount_rootfs()  
 {  
  mount ${ROOTHDD} ${INSTALLROOT} || dialog_die  
  install -d ${INSTALLROOT}/boot || dialog_die  
  cd ${INSTALLROOT} || dialog_die  
 }  
   
 install_system_image()  
 {  
  tar xvjpf ${CDROOT}/system/${CDIMAGENAME} -C ${INSTALLROOT}  
 }  
   
 install_bootsector_chroot()  
 {  
  local my_roothdd  
  local grubconf=${INSTALLROOT}/boot/grub/grub.conf  
  local grub2conf=/boot/grub/grub.cfg  
379    
380   # check for grub2   if [[ -n ${SWAPHDD} ]]
  if [[ -f ${INSTALLROOT}/sbin/grub-mkconfig ]]  
381   then   then
382   # needed by grub-mkconfig on the first run   # sanity check - should not happen
383   if [[ ! -f ${INSTALLROOT}/boot/grub/video.lst ]]   if is_mounted --device "${SWAPHDD}"
384   then   then
385   install -m0644 ${INSTALLROOT}/lib/grub/*/video.lst ${INSTALLROOT}/boot/grub/video.lst || dialog_die   echo "format: device ${SWAPHDD} is already mounted, umount it" >&2
386     umount "${SWAPHDD}"
387   fi   fi
388     mkswap ${SWAPHDD} || die
389     fi
390    
391   # set kernelopts   if [[ -n ${BOOTHDD} ]]
392   if [[ -f ${INSTALLROOT}/etc/conf.d/grub ]]   then
393     # sanity check - should not happen
394     if is_mounted --device "${BOOTHDD}"
395   then   then
396   sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLROOT}/etc/conf.d/grub || dialog_die   echo "format: device ${BOOTHDD} is already mounted, umount it" >&2
397   else   umount "${BOOTHDD}"
  echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALLROOT}/etc/conf.d/grub || dialog_die  
398   fi   fi
  echo 'grub-mkdevicemap' > ${INSTALLROOT}/root/.installrc || dialog_die  
  echo "LC_ALL=C grub-mkconfig -o ${grub2conf}  &> /dev/null" >> ${INSTALLROOT}/root/.installrc || dialog_die  
  echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLROOT}/root/.installrc || dialog_die  
  echo "exit 0" >> ${INSTALLROOT}/root/.installrc || dialog_die  
399    
400   # grub-legacy   mkfs."${FORMAT_FILESYSTEM_BOOTHDD}" "${BOOTHDD}" &>> /tmp/format.log || dialog_die
401   else   fi
  ### grubconf schreiben  
  source ${INSTALLROOT}/boot/kernelversion  
402    
403   #for alx only   if [[ -n ${ROOTHDD} ]]
404   if [ -e ${INSTALLROOT}/etc/alx_version ]   then
405     # sanity check - should not happen
406     if is_mounted --device "${ROOTHDD}"
407   then   then
408   OLD_ALXVER="${ALXVER}"   echo "format: device ${ROOTHDD} is already mounted, umount it" >&2
409   source ${INSTALLROOT}/etc/alx_version   umount "${ROOTHDD}"
  KRNVER="ALX-${ALXVER}"  
  ALXVER="${OLD_ALXVER}"  
410   fi   fi
411    
412   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"   mkfs."${FORMAT_FILESYSTEM_ROOTHDD}" "${ROOTHDD}" &>> /tmp/format.log || dialog_die
413   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"   fi
414   [[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz"  }
   
  # uuid support  
  if is_uuid_supported  
  then  
  my_roothdd="UUID=$(get_uuid ${ROOTHDD})"  
  else  
  my_roothdd="${ROOTHDD}"  
  fi  
415    
416   : > ${grubconf} || dialog_die  install_system_image()
417   echo "default 0" >> ${grubconf} || dialog_die  {
418   echo "timeout 3" >> ${grubconf} || dialog_die   pushd ${INSTALLROOT} > /dev/null
419   # using current root password   tar xvjpf ${IMAGEROOT}/${CDIMAGENAME} -C ${INSTALLROOT}
420   echo "password --md5 $(cat ${INSTALLROOT}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || dialog_die   popd > /dev/null
421    }
422    
423   echo  >> ${grubconf} || dialog_die  install_system_settings()
424   echo "# normal boot" >> ${grubconf} || dialog_die  {
425   echo "title ${KRNVER}" >> ${grubconf} || dialog_die   local CONFIG
  echo "root (hd0,0)" >> ${grubconf} || dialog_die  
  echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" >> ${grubconf} || dialog_die  
  if is_initrd_supported  
  then  
  echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die  
  fi  
426    
427   echo >> ${grubconf} || dialog_die   # write fstab
428   echo "# admin boot" >> ${grubconf} || dialog_die   CONFIG="${INSTALLROOT}/etc/fstab"
429   echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || dialog_die   clearconfig
430   echo "lock"  >> ${grubconf} || dialog_die   if [[ -n ${BOOTHDD} ]]
431   echo "root (hd0,0)" >> ${grubconf} || dialog_die   then
432   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" >> ${grubconf} || dialog_die   addconfig -e "UUID=$(get_uuid ${BOOTHDD})\t/\t${FORMAT_FILESYSTEM_BOOTHDD}\tnoatime\t1 1"
433   if is_initrd_supported   fi
434   then   if [[ -n ${ROOTHDD} ]]
435   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die   then
436   fi   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"
443     addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0"
444    
445   echo >> ${grubconf} || dialog_die   # install network config skeleton
446   echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || dialog_die   CONFIG="${INSTALLROOT}/etc/conf.d/net.eth0"
447   echo "lock"  >> ${grubconf} || dialog_die   clearconfig
448   echo "root (hd0,0)" >> ${grubconf} || dialog_die   addconfig 'ONBOOT="yes"'
449   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" >> ${grubconf} || dialog_die   addconfig 'NETWORKING="dhcp"'
450   if is_initrd_supported  
451     # intel framebuffer quirk
452     CONFIG="${INSTALLROOT}/etc/splash/splash.conf"
453     if [ -e ${CONFIG} ] && [ -e /proc/fb ]
454     then
455     if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]
456   then   then
457   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die   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   fi   fi
   
  # bootsector schreiben chrooted schreiben (lfs/magellan)  
  cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF  
 /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null  
 root (hd0,0)  
 setup (hd0)  
 quit  
 EOF  
 exit 0  
 CHROOTEOF  
460   fi   fi
461    }
462    
  ## enter chroot  
  mount -t proc proc ${INSTALLROOT}/proc  
  mount -t sysfs sysfs ${INSTALLROOT}/sys  
  mount -o bind /dev ${INSTALLROOT}/dev  
  chroot ${INSTALLROOT} /bin/bash --rcfile /root/.installrc -i  
  umount ${INSTALLROOT}/proc  
  umount ${INSTALLROOT}/sys  
  umount ${INSTALLROOT}/dev  
  rm ${INSTALLROOT}/root/.installrc  
 }  
   
 is_initrd_supported()  
 {  
  # only generate initrds if the cmd exists  
  [[ -x ${INSTALLROOT}/sbin/mkinitrd ]] && return 0  
  return 1  
 }  
   
 install_initrd_chroot()  
 {  
  # only generate initrds if the cmd exists  
  is_initrd_supported || return 0  
   
  DISKMODS="sd_mod"  
  OLDPATAMODS="amd74xx piix sis5513 via82cxxx"  
  PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via"  
  SATAMODS="sata_via sata_sis sata_nv"  
  DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via"  
  OTHERMODS=""  
  case ${SPECIALDEVICE} in  
  zotac_intel) FBMODS=""; DRMMODS="i915" ;;  
  zotac_nvidia) FBMODS=""; DRMMODS="nouveau" ;;  
  rangee) FBMODS="" ;; ## fallback to vesafb, viafb does not run on all CLE266 boards  
  # not working with kms enabled drivers -> segfaults  
  #maxdata) FBMODS="i810fb" ;; ## check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer  
  maxdata) FBMODS="" ;;  
  *) FBMODS="uvesafb" ;;  
  esac  
463    
464   if [[ ${FORMFACTOR} = laptop ]]  ### installer dialogs ###
  then  
  OTHERMODS="acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave"  
  fi  
465    
466   # install an appropriate uvesafb.conf  dialog_die()
467   install -d ${INSTALLROOT}/etc/modprobe.d || dialog_die  {
468   echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLROOT}/etc/modprobe.d/uvesafb.conf || dialog_die   ERROR="$1"
469     RETVAL="$?"
470     dialog_install_failure
471     exit 1
472    }
473    
474   # install an appropriate viafb.conf  dialog_warning()
475   echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLROOT}/etc/modprobe.d/viafb.conf || dialog_die  {
476     local retval
477    
478   # install an appropriate i810fb.conf   yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?"
479   echo "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60"  > ${INSTALLROOT}/etc/modprobe.d/i810fb.conf || dialog_die   retval=$?
480     if [[ ${retval} -eq 1 ]]
481     then
482     clear
483     echo $"The process was aborted."
484     exit 1
485     fi
486    }
487    
  cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF  
 echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd  
 mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null  
 exit 0  
 CHROOTEOF  
488    
489   ## enters chroot  ### installer tasks ###
  mount -t proc proc ${INSTALLROOT}/proc  
  mount -t sysfs sysfs ${INSTALLROOT}/sys  
  mount -o bind /dev ${INSTALLROOT}/dev  
  chroot ${INSTALLROOT} /bin/bash --rcfile /root/.installrc -i  
  umount ${INSTALLROOT}/proc  
  umount ${INSTALLROOT}/sys  
  umount ${INSTALLROOT}/dev  
  rm ${INSTALLROOT}/root/.installrc  
 }  
490    
491  is_uuid_supported()  task_setup_system_menu()
492  {  {
493   if [[ -x $(type -P busybox.mkinitrd) ]]   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   then
501   # only detect uuids if supported   case "${mode}" in
502   if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]   "1") run_install auto ;;
503   then   "2") run_install normal ;;
504   return 0   "") task_setup_system_menu;;
505   fi   esac
506   fi   fi
   
  return 1  
507  }  }
508    
509  get_uuid()  task_hardware_detection()
510  {  {
511   local UUID   local message
  local SEC_TYPE  
  local TYPE  
512    
513   local dev="$1"   run_hardware_detection_disks
514   [[ -z ${dev} ]] && dialog_die "no dev given"  
515     message+=$"Harddrives:\n"
516    
517   # check if given device is already an UUID   if [[ ! -z ${ALL_DISKS} ]]
  if [[ ${dev/UUID=/}x != ${dev}x ]]  
518   then   then
519   eval "${dev}"   for i in ${ALL_DISKS}
520   else   do
521   eval $(busybox.mkinitrd blkid ${dev} | grep "${dev}:" | sed 's/.*:\ //')   message+="\Z3${i}\Zn "
522     done
523     message+="\n"
524   fi   fi
  echo "${UUID}"  
 }  
525    
526  install_system_settings()   if [[ ! -z ${ALL_CDROMS} ]]
 {  
  # schreibe fstab  
  if is_uuid_supported  
527   then   then
528   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die   message+="\n"
529   else   message+=$"Optical disk drives:\n"
530   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die   for i in ${ALL_CDROMS}
531     do
532     message+="\Z3${i}\Zn"
533     done
534     message+="\n"
535   fi   fi
  # not needed busybox loads all with swapon -a, even if not mentioned in fstab  
  #echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die  
  echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die  
  echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die  
536    
537   # install network config skeleton   # other devices
538   install -m0644 ${INSTALLROOT}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLROOT}/etc/conf.d/ || dialog_die   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   # intel framebufer quirk  task_setup_hdd_partitions()
559   if [[ -e /proc/fb ]]  {
560     local i
561     local retval
562    
563     if [[ -z ${ALL_DISKS} ]]
564   then   then
565   if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]   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   then
573   fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')   dialog_setup_hdd_info
574   if [[ ${fbdev} != 0 ]]   setup_hdd_partitions
  then  
  sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLROOT}/etc/splash/splash.conf || dialog_die  
  fi  
575   fi   fi
576   fi   fi
577  }  }
578    
579  install_umount_rootfs()  task_main()
580  {  {
581   cd /   local method=0
582   umount ${INSTALLROOT}/boot || dialog_die   local retval
  umount ${INSTALLROOT} || dialog_die  
 }  
583    
584  install_do_reboot()   while [[ ${method} -le 2 ]]
585  {   do
586   reboot   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()
 #     Install Ablauf Scripte #  
 #################################################  
   
 run_install_normal()  
602  {  {
603   dialog_hardware_detection   local method="$1"
   
  dialog_setup_hdd_partitions_manuell  
  dialog_setup_hdd_format  
  setup_hdd_format > /dev/null  
  install_mount_rootfs  
  (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image  
604    
605   dialog_install_settings   task_hardware_detection
  sleep 1  
  install_system_settings  
  install_initrd_chroot  
606    
607   dialog_install_bootsector   case "${method}" in
608   install_bootsector_chroot   auto)
609     if [[ ${FLASHDISK} = 1 ]]
610   install_umount_rootfs   then
611   dialog_install_successful   export BOOTHDD="${HDD}1"
612  }   export SWAPHDD=""
613     export ROOTHDD="${HDD}2"
614  run_install_auto()   export FORMAT_FILESYSTEM_BOOTHDD="f2fs"
615  {   export FORMAT_FILESYSTEM_ROOTHDD="ext2"
616   dialog_hardware_detection   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   dialog_setup_hdd_partitions_auto   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 | dialog_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
661   sleep 1   sleep 1
662   install_system_settings   install_system_settings
663   install_initrd_chroot   if is_initrd_supported
664     then
665     dialog_install_initrd
666     initrd_config
667     initrd_install
668     fi
669    
670   dialog_install_bootsector   dialog_install_bootsector
671   install_bootsector_chroot   bootloader_config
672     bootloader_install
673    
674   install_umount_rootfs   umount_rootfs
675   dialog_install_successful   dialog_install_successful
676  }  }
677    
678  dialog_main  # set some proper traps
679    trap "trap_exit" SIGINT SIGQUIT
680    
681    task_main
682    
683  exit 0  exit 0

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