--- trunk/installer-simple/bin/installer.sh.in 2015/07/31 11:11:58 2890 +++ trunk/installer-simple/bin/installer.sh.in 2016/06/13 12:29:59 2942 @@ -40,15 +40,50 @@ fi done +# fetch cmdline +for argv in $* +do + case $1 in + --liveroot) shift; cmdliveroot="$1" ;; + --imageroot) shift; cmdimageroot="$1" ;; + --installroot) shift; cmdinstallroot="$1" ;; + --filesystem) shift; cmdformatfilesystem="$1" ;; + --help) + echo "$0 options:" + echo " --liveroot [path] - override default liveroot" + echo " --imageroot [path] - override default imageroot" + echo " --installroot [path] - override default installroot" + echo " --filesystem [fstype] - override default filesystem used to format the disk" + exit 0 ;; + esac + shift +done + ### System/Config Version VERSION="%VERSIONTAG%" TITLE="${DEFAULT_TITLE} - ${VERSION}" # initialize global variables so they are exportable # some sane defaults -LIVEROOT="${DEFAULT_LIVEROOT}" -IMAGEROOT="${DEFAULT_IMAGEROOT}" -INSTALLROOT="${DEFAULT_INSTALLROOT}" +INSTALL_METHOD="" +if [[ -n ${cmdliveroot} ]] +then + LIVEROOT="${cmdliveroot}" +else + LIVEROOT="${DEFAULT_LIVEROOT}" +fi +if [[ -n ${cmdimageroot} ]] +then + IMAGEROOT="${cmdimageroot}" +else + IMAGEROOT="${DEFAULT_IMAGEROOT}" +fi +if [[ -n ${cmdinstallroot} ]] +then + INSTALLROOT="${cmdinstallroot}" +else + INSTALLROOT="${DEFAULT_INSTALLROOT}" +fi KERNELPKG="${DEFAULT_KERNELPKG}" KERNELOPTS="${DEFAULT_KERNELOPTS}" GRUBLEGACYOPTS="" @@ -56,7 +91,12 @@ FDISKPARTIONBELOW256MB=0 SPECIALDEVICE="" FORMFACTOR="${DEFAULT_FORMFACTOR}" -FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}" +if [[ -n ${cmdformatfilesystem} ]] +then + FORMAT_FILESYSTEM="${cmdformatfilesystem}" +else + FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}" +fi FLASHDISK=0 # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 ! @@ -153,7 +193,6 @@ run_hardware_detection() { local hwinfo - hwinfo="$(hwinfo --bios --storage --pci --gfxcard --sys)" # check for special devices/clients: @@ -201,6 +240,32 @@ export GRUBLEGACYOPTS="" fi + # check for i845 Chipsets and enable KMS and use 915 drm driver later in initrd + if [[ ! -z $(echo "${hwinfo}" | grep -i i845) ]] + then + export SPECIALDEVICE="i845" + # unset default video=1024x768 opt or the drm driver breaks + export KERNELOPTS="quiet" + export GRUBLEGACYOPTS="" + # enable full kms support + export GRUB2GFXPAYLOAD="keep" + fi + + # check for radeon gfxcards + if [[ ! -z $(echo "${hwinfo}" | grep -i radeon) ]] + then + # enable full kms support + export GRUB2GFXPAYLOAD="keep" + fi + + # requires nomsi to prevent massive IRQ error spam + # see: http://ubuntuforums.org/showthread.php?t=1234983 + if [[ ! -z $(echo "${hwinfo}" | grep -i 'P5VD2-X') ]] || [[ ! -z $(echo "${hwinfo}" | grep -i 'VT8237') ]] || [[ ! -z $(echo "${hwinfo}" | grep -i 'VX700') ]] + then + export SPECIALDEVICE="nomsi" + export KERNELOPTS="${KERNELOPTS} pci=nomsi,noaer" + fi + # check for special devices/clients: # check for laptops and activate cpufreq scaling if [[ $(echo "${hwinfo}" | grep 'Formfactor:' | sed 's:.*Formfactor\:\ \"\(.*\)\":\1:') = laptop ]] @@ -539,6 +604,9 @@ zotac*) message+=$"\n\Z2Zotac device detected.\Zn" ;; rangee) message+=$"\n\Z2Rangee device detected.\Zn" ;; maxdata) message+=$"\n\Z2Maxdata device detected.\Zn" ;; + i845) message+=$"\n\Z2Intel i845 VGA device detected.\Zn" ;; + nomsi) message+=$"\n\Z2Mainboard with P5VD2-X/VT8237/VX700 chipset detected.\Zn" + message+=$"\n\Z2Disabling Message Signaled Interrupts (MSI) capability of the kernel.\Zn" ;; *) message+=$"\n\ZnCommon device detected.\Zn" ;; esac if [[ ${FORMFACTOR} = laptop ]] @@ -548,30 +616,34 @@ if [[ ${FLASHDISK} = 1 ]] then message+=$"\n\ZnFlash memory detected.\Zn" - message+=$"\n\ZnF2FS will be used as default filesystem withn the auto installation mode.\Zn" + message+=$"\n\ZnF2FS will be used as default filesystem within the auto installation mode.\Zn" fi messagebox -y 12 -h $"Detected hardware:" "${message}" } +task_select_target_hdd() +{ + if [[ -z ${ALL_DISKS} ]] + then + dialog_no_harddrive_found + exit 1 + else + export HDD=$(dialog_select_target_harddrive) + fi +} + task_setup_hdd_partitions() { - local i local retval - if [[ -z ${ALL_DISKS} ]] + if [[ -z ${HDD} ]] then dialog_no_harddrive_found exit 1 else - HDD=$(dialog_select_target_harddrive) - retval=$? - [[ ${retval} -eq 1 ]] && return 1 - if [[ ${retval} -eq 0 ]] - then - dialog_setup_hdd_info - setup_hdd_partitions - fi + dialog_setup_hdd_info + setup_hdd_partitions fi } @@ -602,6 +674,7 @@ local method="$1" task_hardware_detection + task_select_target_hdd case "${method}" in auto) @@ -610,14 +683,24 @@ export BOOTHDD="${HDD}1" export SWAPHDD="" export ROOTHDD="${HDD}2" - export FORMAT_FILESYSTEM_BOOTHDD="f2fs" - export FORMAT_FILESYSTEM_ROOTHDD="ext2" + export FORMAT_FILESYSTEM_BOOTHDD="ext2" + export FORMAT_FILESYSTEM_ROOTHDD="f2fs" else - export BOOTHDD="" - export SWAPHDD="" - export ROOTHDD="${HDD}1" - export FORMAT_FILESYSTEM_BOOTHDD="" - export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" + # ext4 seems not to be compatible again + if [[ ${FORMAT_FILESYSTEM} = ext4 ]] + then + export BOOTHDD="${HDD}1" + export SWAPHDD="" + export ROOTHDD="${HDD}2" + export FORMAT_FILESYSTEM_BOOTHDD="ext2" + export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" + else + export BOOTHDD="" + export SWAPHDD="" + export ROOTHDD="${HDD}1" + export FORMAT_FILESYSTEM_BOOTHDD="" + export FORMAT_FILESYSTEM_ROOTHDD="${FORMAT_FILESYSTEM}" + fi fi export INSTALL_METHOD="${method}" ;; @@ -641,7 +724,7 @@ export BOOTHDD="${HDD}1" export SWAPHDD="" export ROOTHDD="${HDD}2" - export FORMAT_FILESYSTEM_BOOTHDD="${FORMAT_FILESYSTEM}" + export FORMAT_FILESYSTEM_BOOTHDD="ext2" export FORMAT_FILESYSTEM_ROOTHDD="f2fs" export INSTALL_METHOD="${method}" ;;