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 6827 by niro, Thu Jul 23 11:37:03 2015 UTC revision 6838 by niro, Thu Jul 23 12:51:57 2015 UTC
# Line 10  MLIBDIR="/usr/lib/alxinstall-ng" Line 10  MLIBDIR="/usr/lib/alxinstall-ng"
10  source /mnt/cdrom/system/images.conf  source /mnt/cdrom/system/images.conf
11    
12  # includes  # includes
13    source ${MLIBDIR}/functions/generic.sh
14  source ${MLIBDIR}/functions/hwdetection.sh  source ${MLIBDIR}/functions/hwdetection.sh
15    
16  ### System/Config Version  ### System/Config Version
# Line 18  TITLE="alxinstall-ng - ${VERSION}" Line 19  TITLE="alxinstall-ng - ${VERSION}"
19    
20  # locations  # locations
21  CDPATH="/mnt/cdrom"  CDPATH="/mnt/cdrom"
22  INSTALLPATH="/mnt/magellan"  INSTALL_ROOT="/mnt/magellan"
23    
24  # default system settings  # default system settings
25  # standard kernel opts  # standard kernel opts
# Line 45  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 58  die() Line 60  die()
60   ERROR=$1   ERROR=$1
61   RETVAL=$?   RETVAL=$?
62   dialog_install_failure   dialog_install_failure
63     trap_exit
64   exit 1   exit 1
65  }  }
66    
# Line 88  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 121  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 150  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 159  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 169  dialog_hardware_detection() Line 190  dialog_hardware_detection()
190   local i   local i
191   local hwtmp   local hwtmp
192    
193   if [ -x $(which mktemp &> /dev/null) ]   if [ -x $(type -P mktemp) ]
194   then   then
195   hwtmp="$(mktemp)"   hwtmp="$(mktemp)"
196   else   else
# Line 217  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 381  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 487  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 561  setup_hdd_format() Line 594  setup_hdd_format()
594   fi   fi
595   if [[ -n ${BOOTHDD} ]]   if [[ -n ${BOOTHDD} ]]
596   then   then
597   mke2fs -j -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
607   mke2fs -j -q ${ROOTHDD} || die   mkfs.${FORMAT_FILESYSTEM} -q ${ROOTHDD} || die
608   fi   fi
609  }  }
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} ${INSTALLPATH} || 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
628   install -d ${INSTALLPATH}/boot || die   install -d ${INSTALL_ROOT}/boot || die
629   mount ${BOOTHDD} ${INSTALLPATH}/boot || die   mount ${BOOTHDD} ${INSTALL_ROOT}/boot || die
630   fi   fi
631    
632   cd ${INSTALLPATH} || die   cd ${INSTALL_ROOT} || die
633  }  }
634    
635  install_system_image()  install_system_image()
636  {  {
637   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALL_ROOT}
638  }  }
639    
640  install_bootsector_chroot()  install_bootsector_chroot()
641  {  {
642   local my_roothdd   local my_roothdd
643   local grubconf=${INSTALLPATH}/boot/grub/grub.conf   local grubconf=${INSTALL_ROOT}/boot/grub/grub.conf
644   local grub2conf=/boot/grub/grub.cfg   local grub2conf=/boot/grub/grub.cfg
645     local CONFIG
646    
647   # check for grub2   # check for grub2
648   if [[ -f ${INSTALLPATH}/sbin/grub-mkconfig ]]   if [[ -f ${INSTALL_ROOT}/sbin/grub-mkconfig ]]
649   then   then
650   # needed by grub-mkconfig on the first run   # needed by grub-mkconfig on the first run
651   if [[ ! -f ${INSTALLPATH}/boot/grub/video.lst ]]   if [[ ! -f ${INSTALL_ROOT}/boot/grub/video.lst ]]
652   then   then
653   install -m0644 ${INSTALLPATH}/lib/grub/*/video.lst ${INSTALLPATH}/boot/grub/video.lst || die   install -m0644 ${INSTALL_ROOT}/lib/grub/*/video.lst ${INSTALL_ROOT}/boot/grub/video.lst || die
654   fi   fi
655    
656   # set kernelopts   # set kernelopts
657   if [[ -f ${INSTALLPATH}/etc/conf.d/grub ]]   if [[ -f ${INSTALL_ROOT}/etc/conf.d/grub ]]
658   then   then
659   sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLPATH}/etc/conf.d/grub || die   sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALL_ROOT}/etc/conf.d/grub || die
660   sed -i "s:^\(export GRUB_GFXPAYLOAD_LINUX=\).*:\1\"${GRUB2GFXPAYLOAD}\":" ${INSTALLPATH}/etc/conf.d/grub || die   sed -i "s:^\(export GRUB_GFXPAYLOAD_LINUX=\).*:\1\"${GRUB2GFXPAYLOAD}\":" ${INSTALL_ROOT}/etc/conf.d/grub || die
661   else   else
662   echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALLPATH}/etc/conf.d/grub || die   echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALL_ROOT}/etc/conf.d/grub || die
663   echo "export GRUB_GFXPAYLOAD_LINUX=\"${GRUB2GFXPAYLOAD}\"" >>  ${INSTALLPATH}/etc/conf.d/grub || die   echo "export GRUB_GFXPAYLOAD_LINUX=\"${GRUB2GFXPAYLOAD}\"" >>  ${INSTALL_ROOT}/etc/conf.d/grub || die
664   fi   fi
665   echo 'grub-mkdevicemap' > ${INSTALLPATH}/root/.installrc || die   CONFIG=${INSTALL_ROOT}/.installrc
666   echo "LC_ALL=C grub-mkconfig -o ${grub2conf}  &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die   clearconfig
667   echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die   addconfig 'grub-mkdevicemap'
668   echo "exit 0" >> ${INSTALLPATH}/root/.installrc || die   addconfig "LC_ALL=C grub-mkconfig -o ${grub2conf}  &> /dev/null"
669     addconfig "grub-install --no-floppy ${HDD} &> /dev/null"
670     addconfig "exit 0"
671    
672   # grub-legacy   # grub-legacy
673   else   else
674   ### grubconf schreiben   ### grubconf schreiben
675   source ${INSTALLPATH}/boot/kernelversion   source ${INSTALL_ROOT}/boot/kernelversion
676    
677   #for alx only   #for alx only
678   if [ -e ${INSTALLPATH}/etc/alx_version ]   if [ -e ${INSTALL_ROOT}/etc/alx_version ]
679   then   then
680   OLD_ALXVER="${ALXVER}"   OLD_ALXVER="${ALXVER}"
681   source ${INSTALLPATH}/etc/alx_version   source ${INSTALL_ROOT}/etc/alx_version
682   KRNVER="ALX-${ALXVER}"   KRNVER="ALX-${ALXVER}"
683   ALXVER="${OLD_ALXVER}"   ALXVER="${OLD_ALXVER}"
684   fi   fi
# Line 648  install_bootsector_chroot() Line 695  install_bootsector_chroot()
695   my_roothdd="${ROOTHDD}"   my_roothdd="${ROOTHDD}"
696   fi   fi
697    
698   : > ${grubconf} || die   CONFIG="${grubconf}"
699   echo "default 0" >> ${grubconf} || die   clearconfig
700   echo "timeout 3" >> ${grubconf} || die   addconfig "default 0"
701     addconfig "timeout 3"
702   # using current root password   # using current root password
703   echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die   addconfig "password --md5 $(cat ${INSTALL_ROOT}/etc/shadow | grep root | cut -d: -f2)"
704     addconfig
705   echo  >> ${grubconf} || die   addconfig "# normal boot"
706   echo "# normal boot" >> ${grubconf} || die   addconfig "title ${KRNVER}"
707   echo "title ${KRNVER}" >> ${grubconf} || die   addconfig "root (hd0,0)"
708   echo "root (hd0,0)" >> ${grubconf} || die   addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}"
  echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" >> ${grubconf} || die  
709   if is_initrd_supported   if is_initrd_supported
710   then   then
711   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die   addconfig "initrd /boot/${KRNINITRD}"
712   fi   fi
713     addconfig
714   echo >> ${grubconf} || die   addconfig "# admin boot"
715   echo "# admin boot" >> ${grubconf} || die   addconfig "title ${KRNVER} - Re-run hardware-detection"
716   echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die   addconfig "lock"
717   echo "lock"  >> ${grubconf} || die   addconfig "root (hd0,0)"
718   echo "root (hd0,0)" >> ${grubconf} || die   addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection"
  echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" >> ${grubconf} || die  
719   if is_initrd_supported   if is_initrd_supported
720   then   then
721   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die   addconfig "initrd /boot/${KRNINITRD}"
722   fi   fi
723     addconfig
724   echo >> ${grubconf} || die   addconfig "title ${KRNVER} - Reset *all* local settings"
725   echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die   addconfig "lock"
726   echo "lock"  >> ${grubconf} || die   addconfig "root (hd0,0)"
727   echo "root (hd0,0)" >> ${grubconf} || die   addconfig "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings"
  echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" >> ${grubconf} || die  
728   if is_initrd_supported   if is_initrd_supported
729   then   then
730   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die   addconfig "initrd /boot/${KRNINITRD}"
731   fi   fi
732    
733   # write bootsector chrooted (lfs/magellan)   # write bootsector chrooted (lfs/magellan)
734   cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF   CONFIG=${INSTALL_ROOT}/.installrc
735  /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null   clearconfig
736  root (hd0,0)   addconfig '/usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null'
737  setup (hd0)   addconfig 'root (hd0,0)'
738  quit   addconfig 'setup (hd0)'
739  EOF   addconfig 'quit'
740  exit 0   addconfig 'EOF'
741  CHROOTEOF   addconfig 'exit 0'
742   fi   fi
743    
744   ## enters chroot   ## enter chroot
745   mount -t proc proc ${INSTALLPATH}/proc   enter_chroot_installrc
  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  
746  }  }
747    
748  is_initrd_supported()  is_initrd_supported()
749  {  {
750   # only generate initrds if the cmd exists   # only generate initrds if the cmd exists
751   [[ -x ${INSTALLPATH}/sbin/mkinitrd ]] && return 0   [[ -x ${INSTALL_ROOT}/sbin/mkinitrd ]] && return 0
752   return 1   return 1
753  }  }
754    
755  install_initrd_chroot()  install_initrd_chroot()
756  {  {
757     local CONFIG
758    
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 735  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"
787   fi   fi
788    
789   # install an appropriate uvesafb.conf   # install an appropriate uvesafb.conf
790   install -d ${INSTALLPATH}/etc/modprobe.d || die   CONFIG=${INSTALL_ROOT}/etc/modprobe.d/uvesafb.conf
791   echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLPATH}/etc/modprobe.d/uvesafb.conf || die   clearconfig
792     addconfig "options uvesafb mode_option=1024x768-32@60 scroll=ywrap"
793    
794   # install an appropriate viafb.conf   # install an appropriate viafb.conf
795   echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLPATH}/etc/modprobe.d/viafb.conf || die   CONFIG=${INSTALL_ROOT}/etc/modprobe.d/viafb.conf
796     clearconfig
797     addconfig "options viafb viafb_mode=1024x768 viafb_refresh=60"
798    
799   # install an appropriate i810fb.conf   # install an appropriate i810fb.conf
800   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   CONFIG=${INSTALL_ROOT}/etc/modprobe.d/i810fb.conf
801     clearconfig
802   cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF   addconfig "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60"
803  echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd  
804  mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null   CONFIG=${INSTALL_ROOT}/.installrc
805  exit 0   clearconfig
806  CHROOTEOF   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'
808   ## enters chroot   addconfig 'exit 0'
809   mount -t proc proc ${INSTALLPATH}/proc   ## enter chroot
810   mount -t sysfs sysfs ${INSTALLPATH}/sys   enter_chroot_installrc
  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  
811  }  }
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 $(type -P blkid) ]]
820   if [[ ! -z $(busybox.mkinitrd | grep blkid) ]]   then
821     return 0
822     fi
823     else
824     if [[ -x $(type -P busybox.mkinitrd) ]]
825   then   then
826   return 0   # 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 786  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 795  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 807  install_system_settings() Line 869  install_system_settings()
869   then   then
870   if [[ -n ${BOOTHDD} ]]   if [[ -n ${BOOTHDD} ]]
871   then   then
872   echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die   echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALL_ROOT}/etc/fstab || die
873   fi   fi
874   if [[ -n ${ROOTHDD} ]]   if [[ -n ${ROOTHDD} ]]
875   then   then
876   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALL_ROOT}/etc/fstab || die
877   fi   fi
878   else   else
879   if [[ -n ${BOOTHDD} ]]   if [[ -n ${BOOTHDD} ]]
880   then   then
881   echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die   echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALL_ROOT}/etc/fstab || die
882   fi   fi
883   if [[ -n ${ROOTHDD} ]]   if [[ -n ${ROOTHDD} ]]
884   then   then
885   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALL_ROOT}/etc/fstab || die
886   fi   fi
887   fi   fi
888   # not needed busybox loads all with swapon -a, even if not mentioned in fstab   # not needed busybox loads all with swapon -a, even if not mentioned in fstab
889   #echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die   #echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALL_ROOT}/etc/fstab || die
890   echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALL_ROOT}/etc/fstab || die
891   echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALL_ROOT}/etc/fstab || die
892    
893   # install network config skeleton   # install network config skeleton
894   install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || die   install -m0644 ${INSTALL_ROOT}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALL_ROOT}/etc/conf.d/ || die
895    
896   # intel framebufer quirk   # intel framebufer quirk
897   if [[ -e /proc/fb ]]   if [[ -e /proc/fb ]]
# Line 839  install_system_settings() Line 901  install_system_settings()
901   fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')   fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')
902   if [[ ${fbdev} != 0 ]]   if [[ ${fbdev} != 0 ]]
903   then   then
904   sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLPATH}/etc/splash/splash.conf || die   sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALL_ROOT}/etc/splash/splash.conf || die
905   fi   fi
906   fi   fi
907   fi   fi
# Line 850  install_umount_rootfs() Line 912  install_umount_rootfs()
912   cd /   cd /
913   if [[ -n ${BOOTHDD} ]]   if [[ -n ${BOOTHDD} ]]
914   then   then
915   umount ${INSTALLPATH}/boot || die   umount ${INSTALL_ROOT}/boot || die
916   fi   fi
917   if [[ -n ${ROOTHDD} ]]   if [[ -n ${ROOTHDD} ]]
918   then   then
919   umount ${INSTALLPATH} || die   umount ${INSTALL_ROOT} || die
920   fi   fi
921   if [[ -n ${SWAPHDD} ]]   if [[ -n ${SWAPHDD} ]]
922   then   then
# Line 893  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
# Line 919  run_install() Line 985  run_install()
985   dialog_install_successful   dialog_install_successful
986  }  }
987    
988    # set some proper traps
989    trap "trap_exit" SIGINT SIGQUIT
990    
991  dialog_main  dialog_main
992    
993  exit 0  exit 0

Legend:
Removed from v.6827  
changed lines
  Added in v.6838