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 4853 by niro, Wed May 15 07:25:12 2013 UTC revision 6770 by niro, Tue Jul 21 12:25:48 2015 UTC
# Line 37  KERNELOPTS="quiet video=1024x768" Line 37  KERNELOPTS="quiet video=1024x768"
37  # grub options  # grub options
38  GRUBLEGACYOPTS=""  GRUBLEGACYOPTS=""
39  GRUB2OPTS=""  GRUB2OPTS=""
40    GRUB2GFXPAYLOAD="1024x768x16,1024x768"
41    
42  # fdisk options  # fdisk options
43  FDISKPARTIONBELOW256MB=0  FDISKPARTIONBELOW256MB=0
44    
45  # default specialdevices  # default specialdevices
46  SPECIALDEVICE=""  SPECIALDEVICE=""
47    FORMFACTOR="desktop"
48    
49  # target filesystem  # target filesystem
50  FORMAT_FILESYSTEM="ext4"  FORMAT_FILESYSTEM="ext4"
# Line 143  dialog_setup_system_menu() Line 145  dialog_setup_system_menu()
145   then   then
146   case "${i}" in   case "${i}" in
147   "1") run_install_auto ;;   "1") run_install_auto ;;
148           "2") run_install_normal ;;   "2") run_install_normal ;;
149   "3") run_install_flash ;;   "3") run_install_flash ;;
150   "") dialog_setup_system_menu;;   "") dialog_setup_system_menu;;
151   esac   esac
# Line 206  dialog_hardware_detection() Line 208  dialog_hardware_detection()
208   # other devices   # other devices
209   run_hardware_detection   run_hardware_detection
210   case "${SPECIALDEVICE}" in   case "${SPECIALDEVICE}" in
211   zotac*) echo " \n\n\n \\Z2Zotac Device erkannt!\\Zn \\" >> ${hwtmp} ;;   zotac*) echo " \n\n\n \\Z2Zotac Device erkannt.\\Zn \\" >> ${hwtmp} ;;
212   rangee) echo " \n\n\n \\Z2Rangee Device erkannt!\\Zn \\" >> ${hwtmp} ;;   rangee) echo " \n\n\n \\Z2Rangee Device erkannt.\\Zn \\" >> ${hwtmp} ;;
213   maxdata) echo " \n\n\n \\Z2Maxdata Device erkannt!\\Zn \\" >> ${hwtmp} ;;   maxdata) echo " \n\n\n \\Z2Maxdata Device erkannt.\\Zn \\" >> ${hwtmp} ;;
214   *) echo " \n\n\n \\ZnStandard Device erkannt!\\Zn \\" >> ${hwtmp} ;;   i845) echo " \n\n\n \\Z2Intel i845 Device erkannt.\\Zn \\" >> ${hwtmp} ;;
215     *) echo " \n\n\n \\ZnStandard Device erkannt.\\Zn \\" >> ${hwtmp} ;;
216   esac   esac
217     if [[ ${FORMFACTOR} = laptop ]]
218     then
219     echo " \n \\ZnFormfactor Laptop, Powersave Modus 'ondemand' wird aktiviert.\\Zn \\" >> ${hwtmp}
220     fi
221    
222   echo " \" 13 70" >> ${hwtmp}   echo " \" 14 70" >> ${hwtmp}
223   chmod a+x ${hwtmp}   chmod a+x ${hwtmp}
224   ${hwtmp}   ${hwtmp}
225    
# Line 426  dialog_main() Line 433  dialog_main()
433   if [[ ${RES} -eq 0 ]]   if [[ ${RES} -eq 0 ]]
434   then   then
435   case ${METHOD} in   case ${METHOD} in
436           "1") dialog_setup_system_menu ;;   "1") dialog_setup_system_menu ;;
437   "2") dialog_hardware_detection ;;   "2") dialog_hardware_detection ;;
438   "3") install_do_reboot ;;   "3") install_do_reboot ;;
439   "4") /bin/bash --login -i ;;   "4") /bin/bash --login -i ;;
# Line 442  run_hardware_detection() Line 449  run_hardware_detection()
449  {  {
450   local hwinfo   local hwinfo
451    
452   hwinfo="$(hwinfo --bios --storage --pci --gfxcard)"   hwinfo="$(hwinfo --bios --storage --pci --gfxcard --sys)"
453    
454   # check for special devices/clients:   # check for special devices/clients:
455   # if zotac a zotac and the disk is a removeable device, then add rootdelay to kernelcmd   # if zotac a zotac and the disk is a removeable device, then add rootdelay to kernelcmd
# Line 459  run_hardware_detection() Line 466  run_hardware_detection()
466    
467   # 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
468   export GRUBLEGACYOPTS="rootdelay=8"   export GRUBLEGACYOPTS="rootdelay=8"
469   # there are to zotac types in the wild, nvidia based gfx and intel   # there are two zotac types in the wild, nvidia based gfx and intel
470   if [[ ! -z $(echo "${hwinfo}" | grep -i nouveau) ]]   if [[ ! -z $(echo "${hwinfo}" | grep -i nouveau) ]]
471   then   then
472   export SPECIALDEVICE="zotac_nvidia"   export SPECIALDEVICE="zotac_nvidia"
# Line 485  run_hardware_detection() Line 492  run_hardware_detection()
492   export SPECIALDEVICE="maxdata"   export SPECIALDEVICE="maxdata"
493   export GRUBLEGACYOPTS=""   export GRUBLEGACYOPTS=""
494   fi   fi
495    
496     # check for i845 Chipsets and disable KMS and use 915 drm driver
497     if [[ ! -z $(echo "${hwinfo}" | grep -i i845) ]]
498     then
499     export SPECIALDEVICE="i845"
500     # unset default video=1024x768 opt or the drm driver breaks
501     export KERNELOPTS="quiet"
502     export GRUBLEGACYOPTS=""
503     # enable full kms support
504     export GRUB2GFXPAYLOAD="keep"
505     fi
506    
507     # check for special devices/clients:
508     # check for laptops and activate cpufreq scaling
509     if [[ $(echo "${hwinfo}" | grep 'Formfactor:' | sed 's:.*Formfactor\:\ \"\(.*\)\":\1:') = laptop ]]
510     then
511     export FORMFACTOR="laptop"
512     export KERNELOPTS="${KERNELOPTS} cpufreq.governor=ondemand"
513     fi
514  }  }
515    
516  hdd_size_below_256mb()  hdd_size_below_256mb()
# Line 637  install_bootsector_chroot() Line 663  install_bootsector_chroot()
663   if [[ -f ${INSTALLPATH}/etc/conf.d/grub ]]   if [[ -f ${INSTALLPATH}/etc/conf.d/grub ]]
664   then   then
665   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}\":" ${INSTALLPATH}/etc/conf.d/grub || die
666     sed -i "s:^\(export GRUB_GFXPAYLOAD_LINUX=\).*:\1\"${GRUB2GFXPAYLOAD}\":" ${INSTALLPATH}/etc/conf.d/grub || die
667   else   else
668   echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALLPATH}/etc/conf.d/grub || die   echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALLPATH}/etc/conf.d/grub || die
669     echo "export GRUB_GFXPAYLOAD_LINUX=\"${GRUB2GFXPAYLOAD}\"" >>  ${INSTALLPATH}/etc/conf.d/grub || die
670   fi   fi
671   echo 'grub-mkdevicemap' > ${INSTALLPATH}/root/.installrc || die   echo 'grub-mkdevicemap' > ${INSTALLPATH}/root/.installrc || die
672   echo "LC_ALL=C grub-mkconfig -o ${grub2conf}  &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die   echo "LC_ALL=C grub-mkconfig -o ${grub2conf}  &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die
# Line 747  install_initrd_chroot() Line 775  install_initrd_chroot()
775   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"
776   SATAMODS="sata_via sata_sis sata_nv"   SATAMODS="sata_via sata_sis sata_nv"
777   DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via"   DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via"
778     OTHERMODS=""
779   case ${SPECIALDEVICE} in   case ${SPECIALDEVICE} in
780   zotac_intel) FBMODS=""; DRMMODS="i915" ;;   zotac_intel|i845) FBMODS=""; DRMMODS="i915" ;;
781   zotac_nvidia) FBMODS=""; DRMMODS="nouveau" ;;   zotac_nvidia) FBMODS=""; DRMMODS="nouveau" ;;
782   rangee) FBMODS="" ;; ## fallback to vesafb, viafb does not run on all CLE266 boards   rangee) FBMODS="" ;; ## fallback to vesafb, viafb does not run on all CLE266 boards
783   # not working with kms enabled drivers -> segfaults   # not working with kms enabled drivers -> segfaults
# Line 757  install_initrd_chroot() Line 786  install_initrd_chroot()
786   *) FBMODS="uvesafb" ;;   *) FBMODS="uvesafb" ;;
787   esac   esac
788    
789     if [[ ${FORMFACTOR} = laptop ]]
790     then
791     OTHERMODS="acpi-cpufreq cpufreq_ondemand cpufreq_conservative cpufreq_powersave"
792     fi
793    
794   # install an appropriate uvesafb.conf   # install an appropriate uvesafb.conf
795   install -d ${INSTALLPATH}/etc/modprobe.d || die   install -d ${INSTALLPATH}/etc/modprobe.d || die
796   echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLPATH}/etc/modprobe.d/uvesafb.conf || die   echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLPATH}/etc/modprobe.d/uvesafb.conf || die
# Line 768  install_initrd_chroot() Line 802  install_initrd_chroot()
802   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   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
803    
804   cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF   cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF
805  echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS}\"" > /etc/conf.d/mkinitrd  echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd
806  mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null  mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null
807  exit 0  exit 0
808  CHROOTEOF  CHROOTEOF

Legend:
Removed from v.4853  
changed lines
  Added in v.6770