Magellan Linux

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

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

revision 2323 by niro, Fri Jan 3 13:19:11 2014 UTC revision 2885 by niro, Fri Jul 31 10:09:08 2015 UTC
# Line 7  Line 7 
7  # Niels Rogalla <niro@magellan-linux.de>  # Niels Rogalla <niro@magellan-linux.de>
8  #  #
9    
10  #images: (get ${CDIMAGENAME})  # setup locales
11  source /mnt/cdrom/system/images.conf  TEXTDOMAIN=installer
12    
13  #Includes  # include dir
14  source /usr/lib/installer/functions/findhdd.sh > /dev/null  INSTALLER_LIBDIR="%LIBDIR%"
 ### bugfix ###############################  
 cdromdev="$(echo ${cdromdev} | sed 's/ //')"  
 ########################################  
15    
16  ### System/Config Version  # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !
17  VERSION="%VERSIONTAG%"  # -> now in images.conf
 TITLE="Installer - ${VERSION}"  
   
 CDPATH="/mnt/cdrom"  
 INSTALLPATH="/mnt/magellan"  
   
 ### WICHTIG: anzahl lines in der autosta_lx.tar.gz -1  
18  CURRENTLINE=0  CURRENTLINE=0
 #TOTALLINES=11072 # -> now in images.conf  
   
 # standard kernel opts  
 KERNELOPTS="quiet video=1024x768"  
   
 # grub options  
 GRUBLEGACYOPTS=""  
 GRUB2OPTS=""  
   
 # fdisk options  
 FDISKPARTIONBELOW256MB=0  
   
 # default specialdevices  
 SPECIALDEVICE=""  
 FORMFACTOR="desktop"  
   
 # target filesystem  
 FORMAT_FILESYSTEM="ext4"  
   
 #################################################  
 #  DIALOG BOXEN #  
 #################################################  
19    
20  die()  die()
21  {  {
22   ERROR=$1   echo "Error: $@"
  RETVAL=$?  
  dialog_install_failure  
23   exit 1   exit 1
24  }  }
25    
26  dialog_warning()  # load common includes
27  {  for inc in %SYSCONFDIR%/installer.conf \
28   dialog \   ${INSTALLER_LIBDIR}/functions/common.sh \
29   --backtitle "${TITLE}" \   ${INSTALLER_LIBDIR}/functions/common-dialogs.sh \
30   --colors \   ${INSTALLER_LIBDIR}/functions/hwdetection.sh \
31   --defaultno \   ${INSTALLER_LIBDIR}/functions/bootloader.sh \
32   --yesno "\Z1 !!! Achtung !!! \Zn\n\n\   ${INSTALLER_LIBDIR}/functions/initrd-tools.sh \
33   Diese Festplatte wird unwiederruflich geloescht werden.\n\n\   ${INSTALLER_LIBDIR}/functions/installer-dialogs.sh
34   Soll ich wirklich fortfahren ?" 10 70  do
35   RES=$?   if [ -e ${inc} ]
  if [[ ${RES} -eq 1 ]]  
36   then   then
37   clear   source "${inc}"
38   echo "Der Vorgang wurde abgebrochen."   else
39   exit 1   die "'${inc}' not found"
40   fi   fi
41  }  done
42    
43  dialog_setup_hdd_info()  ### System/Config Version
44  {  VERSION="%VERSIONTAG%"
45   local SHDD="$(echo ${HDD} | sed 's/\/dev\///')"  TITLE="${DEFAULT_TITLE} - ${VERSION}"
   
  dialog \  
  --colors \  
  --title "[ Festplatten Partitionierung ]" \  
  --backtitle "${TITLE}" \  
  --ok-label "Weiter" \  
  --msgbox "\nBitte legen Sie 3 Partitionen an.\n\n\  
  [ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit ca. 50MB\n\  
  [ \Z3${SHDD}2\Zn ] Typ: \Z3Linux Swap\Zn mit ca. 256MB\n\  
  [ \Z3${SHDD}3\Zn ] Typ: \Z3Linux \Zn mit dem Rest (min. 256MB)\n\n\  
  Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81  
 }  
   
 dialog_setup_hdd_info_flash()  
 {  
  local SHDD="$(echo $HDD | sed 's/\/dev\///')"  
46    
47   dialog \  # some sane defaults
48   --colors \  LIVEROOT="${DEFAULT_LIVEROOT}"
49   --title "[ Festplatten Partitionierung ]" \  IMAGEROOT="${DEFAULT_IMAGEROOT}"
50   --backtitle "${TITLE}" \  INSTALLROOT="${DEFAULT_INSTALLROOT}"
51   --ok-label "Weiter" \  KERNELPKG="${DEFAULT_KERNELPKG}"
52   --msgbox "\nBitte legen Sie 1 Partition an.\n\n\  KERNELOPTS="${DEFAULT_KERNELOPTS}"
53   [ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit dem gesamten Speicher\n\  GRUBLEGACYOPTS=""
54   Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81  GRUB2OPTS=""
55  }  FDISKPARTIONBELOW256MB=0
56    SPECIALDEVICE=""
57    FORMFACTOR="${DEFAULT_FORMFACTOR}"
58    FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}"
59    
60  dialog_setup_hdd_info_auto()  # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !
61  {  # -> now in images.conf
62   local SHDD="$(echo $HDD | sed 's/\/dev\///')"  CDIMAGENAME=""
63    TOTALLINES=""
64    CURRENTLINE=0
65    if [ -e ${IMAGEROOT}/images.conf ]
66    then
67     source ${IMAGEROOT}/images.conf
68     # check if all required variables are set
69     [[ -z ${CDIMAGENAME} ]] && die "CDIMAGENAME is empty in ${IMAGEROOT}/images.conf"
70     [[ -z ${TOTALLINES} ]] && die "TOTALLINES is empty in ${IMAGEROOT}/images.conf"
71    else
72     die "${IMAGEROOT}/images.conf not found"
73    fi
74    
75    ### helper scripts ###
76    
77    trap_exit()
78    {
79     is_mounted --location "${INSTALLROOT}/dev" && umount ${INSTALLROOT}/dev
80     is_mounted --location "${INSTALLROOT}/proc" && umount ${INSTALLROOT}/proc
81     is_mounted --location "${INSTALLROOT}/sys" && umount ${INSTALLROOT}/sys
82     is_mounted --location "${INSTALLROOT}/boot" && umount ${INSTALLROOT}/boot
83     is_mounted --location "${INSTALLROOT}" && umount ${INSTALLROOT}
84    
85   dialog \   echo $"Installation aborted."
86   --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  
87  }  }
88    
89  dialog_setup_system_menu()  install_meter()
90  {  {
91   local i   while [[ ${CURRENTLINE} != ${TOTALLINES} ]]
92     do
93   i=$(dialog \   CURRENTLINE=$(grep -c . /tmp/install.log)
94   --backtitle "${TITLE}" \   PERCENT=$(( ${CURRENTLINE} * 100 / ${TOTALLINES}))
95   --title "[ Festplatten Partitionierung ]" \   echo ${PERCENT}
96   --cancel-label "Abbrechen" \   sleep 1
97   --ok-label "Weiter" \   done
98   --stdout \   rm -f /tmp/install.log
99   --colors \   return 0
  --menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \  
  "1" "Automatisches Setup (Empfohlen)" \  
  "" "" \  
  "" "\Z1Experten Modi:\Zn" \  
  "2" "Normale IDE-Disk (Manuell)" \  
  "3" "Flash-Speicher (Manuell)")  
  RES=$?  
  [[ ${RES} -eq 1 ]] && return 1  
  if [[ ${RES} -eq 0 ]]  
  then  
  case "${i}" in  
  "1") run_install_auto ;;  
          "2") run_install_normal ;;  
  "3") run_install_flash ;;  
  "") dialog_setup_system_menu;;  
  esac  
  fi  
100  }  }
101    
102  dialog_hardware_detection()  mount_rootfs()
103  {  {
104   local i   local retval
  local hwtmp  
   
  if [ -x $(which mktemp &> /dev/null) ]  
  then  
  hwtmp="$(mktemp)"  
  else  
  hwtmp="/tmp/hwtmp.sh"  
  fi  
   
  [[ ! -z ${installdevs} ]] && installdevs=""  
   
  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 ${scsidisks} ]]  
  then  
  for i in ${scsidisks}  
  do  
  if [[ ${i} != ${cdromdev} ]]  
  then  
  echo " \\Z7SCSI: \\Z3${i}\\Zn\n \\" >> ${hwtmp}  
  installdevs="${installdevs} ${i}"  
  fi  
  done  
  fi  
   
  if [[ ! -z ${idedisks} ]]  
  then  
  for i in ${idedisks}  
  do  
  if [[ ${i} != ${cdromdev} ]]  
  then  
  echo " \\Z7IDE:  \\Z3${i}\\Zn\n \\" >> ${hwtmp}  
  installdevs="${installdevs} ${i}"  
  fi  
  done  
  fi  
   
  if [[ ! -z ${cdromdev} ]]  
  then  
  echo " \n \\" >> ${hwtmp}  
  echo " \\Z7andere Laufwerke:\n \\" >> ${hwtmp}  
  echo " CDROM: \\Z3${cdromdev}\\Zn\n \\" >> ${hwtmp}  
  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}  
105    
106   # remove tmp file   if [[ -n ${SWAPHDD} ]]
  if [[ -f ${hwtmp} ]]  
107   then   then
108   rm ${hwtmp}   swapon ${SWAPHDD} || dialog_die $"Could not enable swap space '${SWAPHDD}'"
109   fi   fi
 }  
   
 dialog_setup_hdd_partitions_manuell()  
 {  
  local i  
110    
111   if [[ -z ${installdevs} ]]   if [[ -n ${ROOTHDD} ]]
112   then   then
113   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 ]]  
114   then   then
115   dialog_setup_hdd_info   echo $"${INSTALLROOT} already mounted" >&2
116   setup_hdd_partitions_manuell   else
117     mount "${ROOTHDD}" "${INSTALLROOT}" || dialog_die $"Could not mount rootfs - drive '${ROOTHDD}' -> '${INSTALLROOT}'"
118   fi   fi
119   fi   fi
 }  
120    
121  dialog_setup_hdd_partitions_manuell_flash()   [[ -d ${INSTALLROOT}/boot ]] || install -d ${INSTALLROOT}/boot
 {  
  local i  
122    
123   if [[ -z ${installdevs} ]]   if [[ -n ${BOOTHDD} ]]
124   then   then
125   dialog \   if is_mounted --location "${INSTALLROOT}"/boot
  --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 ]]  
126   then   then
127   dialog_setup_hdd_info_flash   echo $"${INSTALLROOT}/boot already mounted" >&2
128   setup_hdd_partitions_manuell_flash   else
129     mount "${BOOTHDD}" "${INSTALLROOT}"/boot || dialog_die $"Could not mount bootfs - drive '${BOOTHDD}' -> '${INSTALLROOT}/boot'"
130   fi   fi
131   fi   fi
132  }  }
133    
134  dialog_setup_hdd_partitions_auto()  umount_rootfs()
135  {  {
136   local i   is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot
137     is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT}
138    
139   if [[ -z ${installdevs} ]]   if [[ -n ${SWAPHDD} ]]
140   then   then
141   dialog \   swapoff ${SWAPHDD} || die
  --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 ]]  
  then  
  dialog_setup_hdd_info_auto  
  dialog_setup_hdd_create_partitions  
  setup_hdd_partitions_auto  
  fi  
142   fi   fi
143  }  }
144    
145  dialog_setup_hdd_create_partitions()  install_do_reboot()
 {  
  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  
 }  
   
 dialog_install_system_image()  
 {  
  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()  
146  {  {
147   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  
148  }  }
149    
 #################################################  
 # Install Komandos #  
 #################################################  
150  run_hardware_detection()  run_hardware_detection()
151  {  {
152   local hwinfo   local hwinfo
# Line 450  run_hardware_detection() Line 158  run_hardware_detection()
158   local removable=0   local removable=0
159   if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]]   if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]]
160   then   then
161   for i in /sys/block/[hs]d*/removable   #for i in /sys/block/[hs]d*/removable
162   do   #do
163   if [[ $(< ${i}) = 1 ]]   # if [[ $(< ${i}) = 1 ]]
164   then   # then
165   removable=1   # removable=1
166   fi   # fi
167   done   #done
168     # smartcard = udevadm info -n /dev/sda -a | grep -i 'configuration.*card'
169    
170   # 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
171   export GRUBLEGACYOPTS="rootdelay=8"   export GRUBLEGACYOPTS="rootdelay=8"
# Line 496  run_hardware_detection() Line 205  run_hardware_detection()
205   fi   fi
206  }  }
207    
208  hdd_size_below_256mb()  run_hardware_detection_disks()
209  {  {
210   local hdd="$1"   local bootdev
  local size  
  local retval  
  [[ -z ${hdd} ]] && die "Error: get_hdd_size() no \$hdd given!"  
211    
212   size=$(fdisk -l ${hdd} | grep "Disk.*${hdd}" | sed 's:.*,\ \(.*\)\ byte.*:\1:')   # all disks but exclude ramdisks
213   if [[ ${size} -le 257000000 ]]   export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d')
214     # remove the boot device from ALL_DISKS if it was an usbstick
215     if [[ $(grep '[[:space:]]${LIVEROOT}[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]
216     then
217     bootdev=$(grep "[[:space:]]${LIVEROOT}[[:space:]]" /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g')
218     export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")
219     fi
220     export ALL_CDROMS="$(get_hwinfo cdrom)"
221    }
222    
223    setup_hdd_partitions()
224    {
225     case "${INSTALL_METHOD}" in
226     auto)
227     BOOTHDD=""
228     SWAPHDD=""
229     ROOTHDD="${HDD}1"
230     ;;
231     normal)
232     BOOTHDD="${HDD}1"
233     SWAPHDD="${HDD}2"
234     ROOTHDD="${HDD}3"
235     ;;
236     esac
237    
238     # sanity check - should not happen
239     if is_mounted --device "${ROOTHDD}"
240   then   then
241   retval="0"   echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2
242   else   umount "${ROOTHDD}"
  retval="1"  
243   fi   fi
244     if [[ -n ${BOOTHDD} ]]
  return "${retval}"  
 }  
   
 setup_hdd_partitions_auto()  
 {  
  ROOTHDD="${HDD}1"  
   
  # run this only if FDISKPARTITIONBELOW256MB is not already 1  
  if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]  
245   then   then
246   if hdd_size_below_256mb ${HDD}   if is_mounted --device "${BOOTHDD}"
247   then   then
248   FDISKPARTIONBELOW256MB=1   echo "partition: device ${BOOTHDD} is already mounted, umount it" >&2
249   else   umount "${BOOTHDD}"
  FDISKPARTIONBELOW256MB=0  
250   fi   fi
251   fi   fi
252    
253   ## delete disk   if [[ ${INSTALL_METHOD} = auto ]]
  dd if=/dev/zero of=${HDD} count=1 &> /dev/null || die  
   
  if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]  
254   then   then
255   ## setup one bootable partition   # run this only if FDISKPARTITIONBELOW256MB is not already 1
256   #1. n= new disk   if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]
257   #2. p= primary disk   then
258   #3. 1= first partition   if device_minimum_size "${HDD}" 256
259   #4. 2= default sector start // small disk needs more space for grub2 mbr sector   then
260   #5. ''= defaul sector end   FDISKPARTIONBELOW256MB=1
261   #6. a= bootable flag   else
262   #7. 1= boot flag for partition 1   FDISKPARTIONBELOW256MB=0
263   #8. w= write/quit   fi
264   fdisk ${HDD} &> /dev/null << EOF   fi
265    
266     ## delete disk
267     dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die
268    
269     if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
270     then
271     ## setup one bootable partition
272     #1. n= new disk
273     #2. p= primary disk
274     #3. 1= first partition
275     #4. 2= default sector start // small disk needs more space for grub2 mbr sector
276     #5. ''= defaul sector end
277     #6. a= bootable flag
278     #7. 1= boot flag for partition 1
279     #8. w= write/quit
280     fdisk ${HDD} &> /dev/null << EOF
281  n  n
282  p  p
283  1  1
# Line 553  a Line 287  a
287  1  1
288  w  w
289  EOF  EOF
290   else   else
291   ## setup one bootable partition   ## setup one bootable partition
292   #1. n= new disk   #1. n= new disk
293   #2. p= primary disk   #2. p= primary disk
294   #3. 1= first partition   #3. 1= first partition
295   #4. ''= default sector start   #4. ''= default sector start
296   #5. ''= defaul sector end   #5. ''= defaul sector end
297   #6. a= bootable flag   #6. a= bootable flag
298   #7. 1= boot flag for partition 1   #7. 1= boot flag for partition 1
299   #8. w= write/quit   #8. w= write/quit
300   fdisk ${HDD} &> /dev/null << EOF   fdisk ${HDD} &> /dev/null << EOF
301  n  n
302  p  p
303  1  1
# Line 573  a Line 307  a
307  1  1
308  w  w
309  EOF  EOF
310     fi
311     else
312     cfdisk ${HDD} || dialog_die
313   fi   fi
314  }  }
315    
 setup_hdd_partitions_manuell()  
 {  
  BOOTHDD="${HDD}1"  
  SWAPHDD="${HDD}2"  
  ROOTHDD="${HDD}3"  
   
  ## hdds partitionieren manuell  
  cfdisk ${HDD} || die  
 }  
   
 setup_hdd_partitions_manuell_flash()  
 {  
  ROOTHDD="${HDD}1"  
   
  ## hdds partitionieren manuell  
  cfdisk ${HDD} || die  
 }  
   
316  setup_hdd_format()  setup_hdd_format()
317  {  {
318   mkswap ${SWAPHDD} || die   install -d /tmp
319   mke2fs -j -q ${BOOTHDD} || die   :> /tmp/format.log
  mke2fs -j -q ${ROOTHDD} || die  
 }  
   
 setup_hdd_format_flash()  
 {  
  mke2fs -j -q ${ROOTHDD} || die  
 }  
320    
321  install_mount_rootfs()   if [[ -n ${SWAPHDD} ]]
 {  
  swapon ${SWAPHDD} || die  
  mount ${ROOTHDD} ${INSTALLPATH} || die  
  install -d ${INSTALLPATH}/boot || die  
  mount ${BOOTHDD} ${INSTALLPATH}/boot || die  
  cd ${INSTALLPATH} || die  
 }  
   
 install_mount_rootfs_flash()  
 {  
  mount ${ROOTHDD} ${INSTALLPATH} || die  
  install -d ${INSTALLPATH}/boot || die  
  cd ${INSTALLPATH} || die  
 }  
   
 install_system_image()  
 {  
  tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}  
 }  
   
 install_bootsector_chroot()  
 {  
  local my_roothdd  
  local grubconf=${INSTALLPATH}/boot/grub/grub.conf  
  local grub2conf=/boot/grub/grub.cfg  
   
  # check for grub2  
  if [[ -f ${INSTALLPATH}/sbin/grub-mkconfig ]]  
322   then   then
323   # needed by grub-mkconfig on the first run   # sanity check - should not happen
324   if [[ ! -f ${INSTALLPATH}/boot/grub/video.lst ]]   if is_mounted --device "${SWAPHDD}"
325   then   then
326   install -m0644 ${INSTALLPATH}/lib/grub/*/video.lst ${INSTALLPATH}/boot/grub/video.lst || die   echo "format: device ${SWAPHDD} is already mounted, umount it" >&2
327     umount "${SWAPHDD}"
328   fi   fi
329     mkswap ${SWAPHDD} || die
330     fi
331    
332   # set kernelopts   if [[ -n ${BOOTHDD} ]]
333   if [[ -f ${INSTALLPATH}/etc/conf.d/grub ]]   then
334     # sanity check - should not happen
335     if is_mounted --device "${BOOTHDD}"
336   then   then
337   sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLPATH}/etc/conf.d/grub || die   echo "format: device ${BOOTHDD} is already mounted, umount it" >&2
338   else   umount "${BOOTHDD}"
  echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALLPATH}/etc/conf.d/grub || die  
339   fi   fi
  echo 'grub-mkdevicemap' > ${INSTALLPATH}/root/.installrc || die  
  echo "LC_ALL=C grub-mkconfig -o ${grub2conf}  &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die  
  echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die  
  echo "exit 0" >> ${INSTALLPATH}/root/.installrc || die  
340    
341   # grub-legacy   mkfs."${FORMAT_FILESYSTEM_BOOTHDD}" "${BOOTHDD}" &>> /tmp/format.log || dialog_die
342   else   fi
  ### grubconf schreiben  
  source ${INSTALLPATH}/boot/kernelversion  
343    
344   #for alx only   if [[ -n ${ROOTHDD} ]]
345   if [ -e ${INSTALLPATH}/etc/alx_version ]   then
346     # sanity check - should not happen
347     if is_mounted --device "${ROOTHDD}"
348   then   then
349   OLD_ALXVER="${ALXVER}"   echo "format: device ${ROOTHDD} is already mounted, umount it" >&2
350   source ${INSTALLPATH}/etc/alx_version   umount "${ROOTHDD}"
  KRNVER="ALX-${ALXVER}"  
  ALXVER="${OLD_ALXVER}"  
351   fi   fi
352    
353   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"   mkfs."${FORMAT_FILESYSTEM_ROOTHDD}" "${ROOTHDD}" &>> /tmp/format.log || dialog_die
354   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"   fi
355   [[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz"  }
   
  # uuid support  
  if is_uuid_supported  
  then  
  my_roothdd="UUID=$(get_uuid ${ROOTHDD})"  
  else  
  my_roothdd="${ROOTHDD}"  
  fi  
356    
357   : > ${grubconf} || die  install_system_image()
358   echo "default 0" >> ${grubconf} || die  {
359   echo "timeout 3" >> ${grubconf} || die   pushd ${INSTALLROOT} > /dev/null
360   # using current root password   tar xvjpf ${IMAGEROOT}/${CDIMAGENAME} -C ${INSTALLROOT}
361   echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die   popd > /dev/null
362    }
363    
364   echo  >> ${grubconf} || die  install_system_settings()
365   echo "# normal boot" >> ${grubconf} || die  {
366   echo "title ${KRNVER}" >> ${grubconf} || die   local CONFIG
  echo "root (hd0,0)" >> ${grubconf} || die  
  echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" >> ${grubconf} || die  
  if is_initrd_supported  
  then  
  echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die  
  fi  
367    
368   echo >> ${grubconf} || die   # write fstab
369   echo "# admin boot" >> ${grubconf} || die   CONFIG="${INSTALLROOT}/etc/fstab"
370   echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die   clearconfig
371   echo "lock"  >> ${grubconf} || die   if [[ -n ${BOOTHDD} ]]
372   echo "root (hd0,0)" >> ${grubconf} || die   then
373   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" >> ${grubconf} || die   addconfig -e "UUID=$(get_uuid ${BOOTHDD})\t/\t${FORMAT_FILESYSTEM_BOOTHDD}\tnoatime\t1 1"
374   if is_initrd_supported   fi
375   then   if [[ -n ${ROOTHDD} ]]
376   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die   then
377   fi   addconfig -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM_ROOTHDD}\tnoatime\t0 0"
378     fi
379     if [[ -n ${SWAPHDD} ]]
380     then
381     addconfig -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0"
382     fi
383     addconfig -e "proc\t/proc\tproc\tdefaults\t0 0"
384     addconfig -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0"
385    
386   echo >> ${grubconf} || die   # install network config skeleton
387   echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die   CONFIG="${INSTALLROOT}/etc/conf.d/net.eth0"
388   echo "lock"  >> ${grubconf} || die   clearconfig
389   echo "root (hd0,0)" >> ${grubconf} || die   addconfig 'ONBOOT="yes"'
390   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" >> ${grubconf} || die   addconfig 'NETWORKING="dhcp"'
391   if is_initrd_supported  
392     # intel framebuffer quirk
393     CONFIG="${INSTALLROOT}/etc/splash/splash.conf"
394     if [ -e ${CONFIG} ] && [ -e /proc/fb ]
395     then
396     if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]
397   then   then
398   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die   fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')
399     [[ ${fbdev} != 0 ]] && sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${CONFIG} || dialog_die
400   fi   fi
   
  # bootsector schreiben chrooted schreiben (lfs/magellan)  
  cat > ${INSTALLPATH}/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  
401   fi   fi
402    }
403    
  ## enters chroot  
  mount -t proc proc ${INSTALLPATH}/proc  
  mount -t sysfs sysfs ${INSTALLPATH}/sys  
  mount -o bind /dev ${INSTALLPATH}/dev  
  chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i  
  umount ${INSTALLPATH}/proc  
  umount ${INSTALLPATH}/sys  
  umount ${INSTALLPATH}/dev  
  rm ${INSTALLPATH}/root/.installrc  
 }  
   
 is_initrd_supported()  
 {  
  # only generate initrds if the cmd exists  
  [[ -x ${INSTALLPATH}/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  
404    
405   if [[ ${FORMFACTOR} = laptop ]]  ### installer dialogs ###
  then  
  OTHERMODS="acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave"  
  fi  
406    
407   # install an appropriate uvesafb.conf  dialog_die()
408   install -d ${INSTALLPATH}/etc/modprobe.d || die  {
409   echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLPATH}/etc/modprobe.d/uvesafb.conf || die   ERROR="$1"
410     RETVAL="$?"
411     dialog_install_failure
412     exit 1
413    }
414    
415   # install an appropriate viafb.conf  dialog_warning()
416   echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLPATH}/etc/modprobe.d/viafb.conf || die  {
417     local retval
418    
419   # install an appropriate i810fb.conf   yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?"
420   echo "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60"  > ${INSTALLPATH}/etc/modprobe.d/i810fb.conf || die   retval=$?
421     if [[ ${retval} -eq 1 ]]
422     then
423     clear
424     echo $"The process was aborted."
425     exit 1
426     fi
427    }
428    
  cat > ${INSTALLPATH}/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  
429    
430   ## enters chroot  ### installer tasks ###
  mount -t proc proc ${INSTALLPATH}/proc  
  mount -t sysfs sysfs ${INSTALLPATH}/sys  
  mount -o bind /dev ${INSTALLPATH}/dev  
  chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i  
  umount ${INSTALLPATH}/proc  
  umount ${INSTALLPATH}/sys  
  umount ${INSTALLPATH}/dev  
  rm ${INSTALLPATH}/root/.installrc  
 }  
431    
432  is_uuid_supported()  task_setup_system_menu()
433  {  {
434   if [[ -x $(which busybox.mkinitrd &> /dev/null) ]]   local mode
435   then   local retval
  # only detect uuids if supported  
  if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]  
  then  
  return 0  
  fi  
  fi  
436    
437   return 1   mode="$(dialog_setup_system_menu)"
438     retval=$?
439     [[ ${retval} -eq 1 ]] && return 1
440     if [[ ${retval} -eq 0 ]]
441     then
442     case "${mode}" in
443     "1") run_install auto ;;
444     "2") run_install normal ;;
445     "") task_setup_system_menu;;
446     esac
447     fi
448  }  }
449    
450  get_uuid()  task_hardware_detection()
451  {  {
452   local UUID   local message
453   local SEC_TYPE  
454   local TYPE   run_hardware_detection_disks
455    
456   local dev="$1"   message+=$"Harddrives:\n"
  [[ -z ${dev} ]] && die "no dev given"  
457    
458   # check if given device is already an UUID   if [[ ! -z ${ALL_DISKS} ]]
  if [[ ${dev/UUID=/}x != ${dev}x ]]  
459   then   then
460   eval "${dev}"   for i in ${ALL_DISKS}
461   else   do
462   eval $(busybox.mkinitrd blkid ${dev} | grep "${dev}:" | sed 's/.*:\ //')   message+="\Z3${i}\Zn "
463     done
464     message+="\n"
465   fi   fi
  echo "${UUID}"  
 }  
466    
467  install_system_settings()   if [[ ! -z ${ALL_CDROMS} ]]
 {  
  # schreibe fstab  
  if is_uuid_supported  
468   then   then
469   echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die   message+="\n"
470   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die   message+=$"Optical disk drives:\n"
471   else   for i in ${ALL_CDROMS}
472   echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die   do
473   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die   message+="\Z3${i}\Zn"
474     done
475     message+="\n"
476   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" >> ${INSTALLPATH}/etc/fstab || die  
  echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die  
  echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die  
477    
478   # install network config skeleton   # other devices
479   install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || die   run_hardware_detection
480     case "${SPECIALDEVICE}" in
481   # intel framebufer quirk   zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;;
482   if [[ -e /proc/fb ]]   rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;;
483     maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;;
484     *) message+=$"\n\ZnCommon device detected.\Zn" ;;
485     esac
486     if [[ ${FORMFACTOR} = laptop ]]
487   then   then
488   if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]   message+=$"\n\ZnFormfactor Laptop, activating 'ondemand' powersaving mode.\Zn"
  then  
  fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')  
  if [[ ${fbdev} != 0 ]]  
  then  
  sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLPATH}/etc/splash/splash.conf || die  
  fi  
  fi  
489   fi   fi
490    
491     messagebox -y 12 -h $"Detected hardware:" "${message}"
492  }  }
493    
494  install_system_settings_flash()  task_setup_hdd_partitions()
495  {  {
496   # schreibe fstab   local i
497   if is_uuid_supported   local retval
498    
499     if [[ -z ${ALL_DISKS} ]]
500   then   then
501   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die   dialog_no_harddrive_found
502     exit 1
503   else   else
504   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die   HDD=$(dialog_select_target_harddrive)
505     retval=$?
506     [[ ${retval} -eq 1 ]] && return 1
507     if [[ ${retval} -eq 0 ]]
508     then
509     dialog_setup_hdd_info
510     setup_hdd_partitions
511     fi
512   fi   fi
  echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die  
  echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die  
513  }  }
514    
515  install_umount_rootfs()  task_main()
516  {  {
517   cd /   local method=0
518   umount ${INSTALLPATH}/boot || die   local retval
  umount ${INSTALLPATH} || die  
  swapoff ${SWAPHDD} || die  
 }  
519    
520  install_umount_rootfs_flash()   while [[ ${method} -le 2 ]]
521  {   do
522   cd /   method=$(dialog_main)
523   umount ${INSTALLPATH} || die   retval=$?
524     [[ ${retval} -eq 1 ]] && exit 1
525     if [[ ${retval} -eq 0 ]]
526     then
527     case ${method} in
528     "1") task_setup_system_menu ;;
529     "2") task_hardware_detection ;;
530     "3") install_do_reboot ;;
531     "4") /bin/bash --login -i ;;
532     esac
533     fi
534     done
535  }  }
536    
537  install_do_reboot()  run_install()
538  {  {
539   reboot   local method="$1"
 }  
540    
541  #################################################   task_hardware_detection
 #     Install Ablauf Scripte #  
 #################################################  
542    
543  run_install_normal()   case "${method}" in
544  {   auto)
545   dialog_hardware_detection   export FORMAT_FILESYSTEM_BOOTHDD=""
546     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
547     export INSTALL_METHOD="${method}"
548     ;;
549     normal)
550     export FORMAT_FILESYSTEM_BOOTHDD="${FORMAT_FILESYSTEM}"
551     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
552     export INSTALL_METHOD="${method}"
553     ;;
554     single)
555     export FORMAT_FILESYSTEM_BOOTHDD=""
556     export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}"
557     export INSTALL_METHOD="${method}"
558     ;;
559     *)
560     die "Unknown install method '${method}', aborting."
561     ;;
562     esac
563    
564   dialog_setup_hdd_partitions_manuell   task_setup_hdd_partitions
565   dialog_setup_hdd_format   dialog_setup_hdd_format
566   setup_hdd_format > /dev/null   setup_hdd_format > /dev/null
567   install_mount_rootfs   mount_rootfs
568   (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
569    
570   dialog_install_settings   dialog_install_settings
571   sleep 1   sleep 1
572   install_system_settings   install_system_settings
573   install_initrd_chroot   if is_initrd_supported
574     then
575   dialog_install_bootsector   dialog_install_initrd
576   install_bootsector_chroot   initrd_config
577     initrd_install
578   install_umount_rootfs   fi
  dialog_install_successful  
 }  
   
 run_install_flash()  
 {  
  dialog_hardware_detection  
   
  dialog_setup_hdd_partitions_manuell_flash  
  dialog_setup_hdd_format  
  setup_hdd_format_flash > /dev/null  
  install_mount_rootfs_flash  
  (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image  
   
  dialog_install_settings  
  sleep 1  
  install_system_settings_flash  
  install_initrd_chroot  
579    
580   dialog_install_bootsector   dialog_install_bootsector
581   install_bootsector_chroot   bootloader_config
582     bootloader_install
583    
584   install_umount_rootfs_flash   umount_rootfs
585   dialog_install_successful   dialog_install_successful
586  }  }
587    
588  run_install_auto()  # set some proper traps
589  {  trap "trap_exit" SIGINT SIGQUIT
  dialog_hardware_detection  
   
  dialog_setup_hdd_partitions_auto  
  dialog_setup_hdd_format  
  setup_hdd_format_flash > /dev/null  
  install_mount_rootfs_flash  
  (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image  
   
  dialog_install_settings  
  sleep 1  
  install_system_settings_flash  
  install_initrd_chroot  
   
  dialog_install_bootsector  
  install_bootsector_chroot  
   
  install_umount_rootfs_flash  
  dialog_install_successful  
 }  
590    
591  dialog_main  task_main
592    
593  exit 0  exit 0

Legend:
Removed from v.2323  
changed lines
  Added in v.2885