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 3202 by niro, Wed Sep 14 13:12:00 2011 UTC revision 5575 by niro, Tue Apr 22 10:55:06 2014 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 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   *) echo " \n\n\n \\ZnStandard Device erkannt!\\Zn \\" >> ${hwtmp} ;;   maxdata) echo " \n\n\n \\Z2Maxdata Device erkannt.\\Zn \\" >> ${hwtmp} ;;
214     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 441  run_hardware_detection() Line 449  run_hardware_detection()
449  {  {
450   local hwinfo   local hwinfo
451    
452   hwinfo="$(hwinfo --bios --storage)"   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 458  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   export SPECIALDEVICE="zotac"   # there are two zotac types in the wild, nvidia based gfx and intel
470     if [[ ! -z $(echo "${hwinfo}" | grep -i nouveau) ]]
471     then
472     export SPECIALDEVICE="zotac_nvidia"
473     else
474     export SPECIALDEVICE="zotac_intel"
475     fi
476   fi   fi
477    
478   # check for special devices/clients:   # check for special devices/clients:
# Line 470  run_hardware_detection() Line 484  run_hardware_detection()
484   export SPECIALDEVICE="rangee"   export SPECIALDEVICE="rangee"
485   export GRUBLEGACYOPTS=""   export GRUBLEGACYOPTS=""
486   fi   fi
487    
488     # check for special devices/clients:
489     # check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer
490     if [[ ! -z $(echo "${hwinfo}" | grep -i i810) ]] || [[ ! -z $(echo "${hwinfo}" | grep -i i815) ]]
491     then
492     export SPECIALDEVICE="maxdata"
493     export GRUBLEGACYOPTS=""
494     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 622  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 732  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) FBMODS="" ;;   zotac_intel|i845) FBMODS=""; DRMMODS="i915" ;;
781   rangee) FBMODS="viafb" ;;   zotac_nvidia) FBMODS=""; DRMMODS="nouveau" ;;
782     rangee) FBMODS="" ;; ## fallback to vesafb, viafb does not run on all CLE266 boards
783     # not working with kms enabled drivers -> segfaults
784     #maxdata) FBMODS="i810fb" ;; ## check for maxdata / i810/ i815 Chipsets and disable KMS and use i810fb frambuffer
785     maxdata) FBMODS="" ;;
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 745  install_initrd_chroot() Line 798  install_initrd_chroot()
798   # install an appropriate viafb.conf   # install an appropriate viafb.conf
799   echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLPATH}/etc/modprobe.d/viafb.conf || die   echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLPATH}/etc/modprobe.d/viafb.conf || die
800    
801     # install an appropriate i810fb.conf
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
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
# Line 813  install_system_settings() Line 869  install_system_settings()
869    
870   # install network config skeleton   # install network config skeleton
871   install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || die   install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || die
872    
873     # intel framebufer quirk
874     if [[ -e /proc/fb ]]
875     then
876     if [[ ! -z $(grep 'inteldrmfb' /proc/fb) ]]
877     then
878     fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')
879     if [[ ${fbdev} != 0 ]]
880     then
881     sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLPATH}/etc/splash/splash.conf || die
882     fi
883     fi
884     fi
885  }  }
886    
887  install_system_settings_flash()  install_system_settings_flash()

Legend:
Removed from v.3202  
changed lines
  Added in v.5575