Magellan Linux

Diff of /alx-src/trunk/alxinstall-ng/bin/alxinstall-ng.sh.in

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

revision 6836 by niro, Thu Jul 23 12:28:10 2015 UTC revision 6837 by niro, Thu Jul 23 12:49:52 2015 UTC
# Line 46  FORMFACTOR="" Line 46  FORMFACTOR=""
46  FORMAT_FILESYSTEM=""  FORMAT_FILESYSTEM=""
47  FDISKPARTIONBELOW256MB=0  FDISKPARTIONBELOW256MB=0
48  SPECIALDEVICE=""  SPECIALDEVICE=""
49    FLASHDISK=0
50  ### linecount of system.tar.gz -1 !  ### linecount of system.tar.gz -1 !
51  CURRENTLINE=0  CURRENTLINE=0
52  #TOTALLINES=11072 # -> now in images.conf  #TOTALLINES=11072 # -> now in images.conf
# Line 90  dialog_setup_hdd_info() Line 91  dialog_setup_hdd_info()
91   ;;   ;;
92   normal) dialog_setup_hdd_info_normal ;;   normal) dialog_setup_hdd_info_normal ;;
93   single) dialog_setup_hdd_info_single ;;   single) dialog_setup_hdd_info_single ;;
94     flash) dialog_setup_hdd_info_flash ;;
95   esac   esac
96  }  }
97    
# Line 123  dialog_setup_hdd_info_single() Line 125  dialog_setup_hdd_info_single()
125   Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81   Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81
126  }  }
127    
128    dialog_setup_hdd_info_flash()
129    {
130     local SHDD="$(echo ${HDD} | sed 's/\/dev\///')"
131    
132     dialog \
133     --colors \
134     --title "[ Festplatten Partitionierung ]" \
135     --backtitle "${TITLE}" \
136     --ok-label "Weiter" \
137     --msgbox "\nBitte legen Sie 2 Partitionen an.\n\n\
138     [ \Z3${SHDD}1\Zn ] Typ: \Z3Linux\Zn mit ca. 50MB\n\
139     [ \Z3${SHDD}2\Zn ] Typ: \Z3Linux \Zn mit dem Rest (min. 256MB)\n\n\
140     Bitte ${SHDD}1 als \Z3bootable\Zn markieren." 12 81
141    }
142    
143  dialog_setup_hdd_info_auto()  dialog_setup_hdd_info_auto()
144  {  {
145   local SHDD="$(echo $HDD | sed 's/\/dev\///')"   local SHDD="$(echo $HDD | sed 's/\/dev\///')"
# Line 152  dialog_setup_system_menu() Line 169  dialog_setup_system_menu()
169   "" "" \   "" "" \
170   "" "\Z1Experten Modi:\Zn" \   "" "\Z1Experten Modi:\Zn" \
171   "2" "Normale IDE-Disk (Manuell)" \   "2" "Normale IDE-Disk (Manuell)" \
172   "3" "Normale IDE Disk (Single)")   "3" "Normale IDE Disk (Single)" \
173     "4" "Flash SDHC/NAND oder USBStick (Manuell)")
174   RES=$?   RES=$?
175   [[ ${RES} -eq 1 ]] && return 1   [[ ${RES} -eq 1 ]] && return 1
176   if [[ ${RES} -eq 0 ]]   if [[ ${RES} -eq 0 ]]
# Line 161  dialog_setup_system_menu() Line 179  dialog_setup_system_menu()
179   "1") run_install auto ;;   "1") run_install auto ;;
180   "2") run_install normal ;;   "2") run_install normal ;;
181   "3") run_install single ;;   "3") run_install single ;;
182     "3") run_install flash ;;
183   "") dialog_setup_system_menu;;   "") dialog_setup_system_menu;;
184   esac   esac
185   fi   fi
# Line 219  dialog_hardware_detection() Line 238  dialog_hardware_detection()
238   then   then
239   echo " \n \\ZnFormfactor Laptop, Powersave Modus 'ondemand' wird aktiviert.\\Zn \\" >> ${hwtmp}   echo " \n \\ZnFormfactor Laptop, Powersave Modus 'ondemand' wird aktiviert.\\Zn \\" >> ${hwtmp}
240   fi   fi
241     if [[ ${FLASHDISK} = 1 ]]
242     then
243     echo " \n \\ZnFlash Speicher erkannt, F2FS wird als Dateisystem benutzt.\\Zn \\" >> ${hwtmp}
244     fi
245    
246   echo " \" 14 70" >> ${hwtmp}   echo " \" 14 70" >> ${hwtmp}
247   chmod a+x ${hwtmp}   chmod a+x ${hwtmp}
# Line 383  run_hardware_detection() Line 406  run_hardware_detection()
406   if [[ $(< ${i}) = 1 ]]   if [[ $(< ${i}) = 1 ]]
407   then   then
408   removable=1   removable=1
409     # we assume that all removable disks are flash disks
410     export FLASHDISK=1
411   fi   fi
412   done   done
413    
# Line 489  setup_hdd_partitions() Line 514  setup_hdd_partitions()
514   SWAPHDD=""   SWAPHDD=""
515   ROOTHDD="${HDD}1"   ROOTHDD="${HDD}1"
516   ;;   ;;
517    
518     flash)
519     BOOTHDD="${HDD}1"
520     SWAPHDD=""
521     ROOTHDD="${HDD}2"
522     ;;
523   esac   esac
524    
525   if [[ ${INSTALL_METHOD} = auto ]]   if [[ ${INSTALL_METHOD} = auto ]]
# Line 563  setup_hdd_format() Line 594  setup_hdd_format()
594   fi   fi
595   if [[ -n ${BOOTHDD} ]]   if [[ -n ${BOOTHDD} ]]
596   then   then
597   mkfs.${FORMAT_FILESYSTEM} -q ${BOOTHDD} || die   # f2fs is not grub/grub2 compatible
598     if [[ ${FORMAT_FILESYSTEM} = f2fs ]]
599     then
600     mkfs.ext2 -q ${BOOTHDD} || die
601     else
602     mkfs.${FORMAT_FILESYSTEM} -q ${BOOTHDD} || die
603     fi
604   fi   fi
605   if [[ -n ${ROOTHDD} ]]   if [[ -n ${ROOTHDD} ]]
606   then   then
# Line 573  setup_hdd_format() Line 610  setup_hdd_format()
610    
611  install_mount_rootfs()  install_mount_rootfs()
612  {  {
613     local opts
614    
615   if [[ -n ${SWAPHDD} ]]   if [[ -n ${SWAPHDD} ]]
616   then   then
617   swapon ${SWAPHDD} || die   swapon ${SWAPHDD} || die
618   fi   fi
619   if [[ -n ${ROOTHDD} ]]   if [[ -n ${ROOTHDD} ]]
620   then   then
621   mount ${ROOTHDD} ${INSTALL_ROOT} || die   # be safe here, append file system type to mount
622     # just in case the f2fs module was not autoloaded
623     [[ ${FORMAT_FILESYSTEM} = f2fs ]] && opts="-t fs2fs"
624     mount ${opts} ${ROOTHDD} ${INSTALL_ROOT} || die
625   fi   fi
626   if [[ -n ${BOOTHDD} ]]   if [[ -n ${BOOTHDD} ]]
627   then   then
# Line 717  install_initrd_chroot() Line 759  install_initrd_chroot()
759   # only generate initrds if the cmd exists   # only generate initrds if the cmd exists
760   is_initrd_supported || return 0   is_initrd_supported || return 0
761    
762     FSMODS="${FORMAT_FILESYSTEM}"
763   DISKMODS="sd_mod"   DISKMODS="sd_mod"
764   OLDPATAMODS="amd74xx piix sis5513 via82cxxx"   OLDPATAMODS="amd74xx piix sis5513 via82cxxx"
765   PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via"   PATAMODS="ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via"
# Line 733  install_initrd_chroot() Line 776  install_initrd_chroot()
776   *) FBMODS="uvesafb" ;;   *) FBMODS="uvesafb" ;;
777   esac   esac
778    
779     # add a filesystems recoqnized by the bootloader if the current ${FORMAT_FILESYSTEM} is not supported
780     case "${FORMAT_FILESYSTEM}" in
781     f2fs) FSMODS+=" ext2" ;;
782     esac
783    
784   if [[ ${FORMFACTOR} = laptop ]]   if [[ ${FORMFACTOR} = laptop ]]
785   then   then
786   OTHERMODS="acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave"   OTHERMODS="acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave"
# Line 755  install_initrd_chroot() Line 803  install_initrd_chroot()
803    
804   CONFIG=${INSTALL_ROOT}/.installrc   CONFIG=${INSTALL_ROOT}/.installrc
805   clearconfig   clearconfig
806   addconfig 'echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd'   addconfig 'echo "MODULES=\"${FSMODS} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd'
807   addconfig 'mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null'   addconfig 'mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null'
808   addconfig 'exit 0'   addconfig 'exit 0'
809   ## enter chroot   ## enter chroot
# Line 764  install_initrd_chroot() Line 812  install_initrd_chroot()
812    
813  is_uuid_supported()  is_uuid_supported()
814  {  {
815   if [[ -x $(which busybox.mkinitrd &> /dev/null) ]]   # f2fs needs special treatments as the old busybox does not support this fs
816     # use the blkid from util-linux instead of busybox
817     if [[ ${FORMAT_FILESYSTEM} = f2fs ]]
818   then   then
819   # only detect uuids if supported   if [[ -x $(which blkid &> /dev/null) ]]
  if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]  
820   then   then
821   return 0   return 0
822     fi
823     else
824     if [[ -x $(which busybox.mkinitrd &> /dev/null) ]]
825     then
826     # only detect uuids if supported
827     if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]
828     then
829     return 0
830     fi
831   fi   fi
832   fi   fi
833    
# Line 781  get_uuid() Line 839  get_uuid()
839   local UUID   local UUID
840   local SEC_TYPE   local SEC_TYPE
841   local TYPE   local TYPE
842     local blkidcmd
843    
844   local dev="$1"   local dev="$1"
845   [[ -z ${dev} ]] && die "no dev given"   [[ -z ${dev} ]] && die "no dev given"
# Line 790  get_uuid() Line 849  get_uuid()
849   then   then
850   eval "${dev}"   eval "${dev}"
851   else   else
852   eval $(busybox.mkinitrd blkid ${dev} | grep "${dev}:" | sed 's/.*:\ //')   # f2fs needs special treatments as the old busybox does not support this fs
853     # use the blkid from util-linux instead of busybox
854     if [[ ${FORMAT_FILESYSTEM} = f2fs ]]
855     then
856     blkidcmd="blkid"
857     else
858     blkidcmd="busybox.mkinitrd blkid"
859     fi
860     eval $(${blkidcmd} ${dev} | grep "${dev}:" | sed 's/.*:\ //')
861   fi   fi
862   echo "${UUID}"   echo "${UUID}"
863  }  }
# Line 888  run_install() Line 955  run_install()
955   single)   single)
956   export INSTALL_METHOD="${method}"   export INSTALL_METHOD="${method}"
957   ;;   ;;
958     flash)
959     export FORMAT_FILESYSTEM="f2fs"
960     export INSTALL_METHOD="${method}"
961     ;;
962   *)   *)
963   echo "Unknown install method '${method}', aborting."   echo "Unknown install method '${method}', aborting."
964   exit 1   exit 1

Legend:
Removed from v.6836  
changed lines
  Added in v.6837