Magellan Linux

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

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

revision 2342 by niro, Fri Jan 3 14:57:23 2014 UTC revision 2398 by niro, Tue Jan 7 13:06:55 2014 UTC
# Line 16  INSTALLER_LIBDIR="%LIBDIR%" Line 16  INSTALLER_LIBDIR="%LIBDIR%"
16  # -> now in images.conf  # -> now in images.conf
17  CURRENTLINE=0  CURRENTLINE=0
18    
19    die()
20    {
21     echo "Error: $@"
22     exit 1
23    }
24    
25  # configuration  # configuration
26  if [ -e %SYSCONFDIR%/installer.conf ]  if [ -e %SYSCONFDIR%/installer.conf ]
27  then  then
# Line 46  source ${INSTALLER_LIBDIR}/functions/hwd Line 52  source ${INSTALLER_LIBDIR}/functions/hwd
52  VERSION="%VERSIONTAG%"  VERSION="%VERSIONTAG%"
53  TITLE="${DEFAULT_TITLE} - ${VERSION}"  TITLE="${DEFAULT_TITLE} - ${VERSION}"
54    
55  CDPATH="${DEFAULT_CDPATH}"  CDROOT="${DEFAULT_CDROOT}"
56  INSTALLROOT="${DEFAULT_INSTALLROOT}"  INSTALLROOT="${DEFAULT_INSTALLROOT}"
57    
58  # standard kernel opts  # standard kernel opts
# Line 70  FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM} Line 76  FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}
76  #  DIALOG BOXEN #  #  DIALOG BOXEN #
77  #################################################  #################################################
78    
 die()  
 {  
  echo "Error: $@"  
  exit 1  
 }  
   
79  dialog_die()  dialog_die()
80  {  {
81   ERROR="$1"   ERROR="$1"
# Line 86  dialog_die() Line 86  dialog_die()
86    
87  dialog_warning()  dialog_warning()
88  {  {
89   dialog \   local retval
90   --backtitle "${TITLE}" \  
91   --colors \   yesnobox $"\Z1 !!! Warning !!! \Zn\n\n\This harddrive will be irreversibly erased.\n\n\Do you want to continue ?"
92   --defaultno \   retval=$?
93   --yesno "\Z1 !!! Achtung !!! \Zn\n\n\   if [[ ${retval} -eq 1 ]]
  Diese Festplatte wird unwiederruflich geloescht werden.\n\n\  
  Soll ich wirklich fortfahren ?" 10 70  
  RES=$?  
  if [[ ${RES} -eq 1 ]]  
94   then   then
95   clear   clear
96   echo "Der Vorgang wurde abgebrochen."   echo $"The process was aborted."
97   exit 1   exit 1
98   fi   fi
99  }  }
# Line 180  dialog_hardware_detection() Line 176  dialog_hardware_detection()
176   local i   local i
177   local hwtmp   local hwtmp
178    
179   if [ -x $(which mktemp &> /dev/null) ]   if [ -x $(type -P mktemp) ]
180   then   then
181   hwtmp="$(mktemp)"   hwtmp="$(mktemp)"
182   else   else
183   hwtmp="/tmp/hwtmp.sh"   hwtmp="/tmp/hwtmp.sh"
184   fi   fi
185    
186   [[ ! -z ${installdevs} ]] && installdevs=""   run_hardware_detection_disks
187    
188   echo "dialog \\"  > ${hwtmp}   echo "dialog \\"  > ${hwtmp}
189   echo "--backtitle \"${TITLE}\" \\" >> ${hwtmp}   echo "--backtitle \"${TITLE}\" \\" >> ${hwtmp}
# Line 197  dialog_hardware_detection() Line 193  dialog_hardware_detection()
193   echo "--msgbox \"Gefundene Hardware:\n\n \\" >> ${hwtmp}   echo "--msgbox \"Gefundene Hardware:\n\n \\" >> ${hwtmp}
194   echo " Festplatten:\n \\" >> ${hwtmp}   echo " Festplatten:\n \\" >> ${hwtmp}
195    
196   if [[ ! -z ${scsidisks} ]]   if [[ ! -z ${ALL_DISKS} ]]
197   then   then
198   for i in ${scsidisks}   for i in ${ALL_DISKS}
199   do   do
200   if [[ ${i} != ${cdromdev} ]]   echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp}
  then  
  echo " \\Z7SCSI: \\Z3${i}\\Zn\n \\" >> ${hwtmp}  
  installdevs="${installdevs} ${i}"  
  fi  
201   done   done
202   fi   fi
203    
204   if [[ ! -z ${idedisks} ]]   if [[ ! -z ${ALL_CDROMS} ]]
205   then   then
206   for i in ${idedisks}   echo " \n \\" >> ${hwtmp}
207     echo " CDROM Laufwerke:\n \\" >> ${hwtmp}
208     for i in ${ALL_CDROMS}
209   do   do
210   if [[ ${i} != ${cdromdev} ]]   echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp}
  then  
  echo " \\Z7IDE:  \\Z3${i}\\Zn\n \\" >> ${hwtmp}  
  installdevs="${installdevs} ${i}"  
  fi  
211   done   done
212   fi   fi
213    
  if [[ ! -z ${cdromdev} ]]  
  then  
  echo " \n \\" >> ${hwtmp}  
  echo " \\Z7andere Laufwerke:\n \\" >> ${hwtmp}  
  echo " CDROM: \\Z3${cdromdev}\\Zn\n \\" >> ${hwtmp}  
  fi  
   
214   # other devices   # other devices
215   run_hardware_detection   run_hardware_detection
216   case "${SPECIALDEVICE}" in   case "${SPECIALDEVICE}" in
# Line 367  dialog_setup_hdd_partitions_auto() Line 350  dialog_setup_hdd_partitions_auto()
350   fi   fi
351  }  }
352    
353    run_hardware_detection_disks()
354    {
355     local bootdev
356    
357     # all disks but exclude ramdisks
358     export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d')
359     # remove the boot device from ALL_DISKS if it was an usbstick
360     if [[ $(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]
361     then
362     bootdev="$(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g')"
363     export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")
364     fi
365     export ALL_CDROMS="$(get_hwinfo cdrom)"
366    }
367    
368  dialog_setup_hdd_create_partitions()  dialog_setup_hdd_create_partitions()
369  {  {
370   dialog \   dialog \
# Line 652  install_mount_rootfs_flash() Line 650  install_mount_rootfs_flash()
650    
651  install_system_image()  install_system_image()
652  {  {
653   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLROOT}   tar xvjpf ${CDROOT}/system/${CDIMAGENAME} -C ${INSTALLROOT}
654  }  }
655    
656  install_bootsector_chroot()  install_bootsector_chroot()
# Line 829  CHROOTEOF Line 827  CHROOTEOF
827    
828  is_uuid_supported()  is_uuid_supported()
829  {  {
830   if [[ -x $(which busybox.mkinitrd &> /dev/null) ]]   if [[ -x $(type -P busybox.mkinitrd) ]]
831   then   then
832   # only detect uuids if supported   # only detect uuids if supported
833   if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]   if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]

Legend:
Removed from v.2342  
changed lines
  Added in v.2398