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 2736 by niro, Thu Aug 11 14:58:15 2011 UTC revision 3202 by niro, Wed Sep 14 13:12:00 2011 UTC
# Line 38  KERNELOPTS="quiet video=1024x768" Line 38  KERNELOPTS="quiet video=1024x768"
38  GRUBLEGACYOPTS=""  GRUBLEGACYOPTS=""
39  GRUB2OPTS=""  GRUB2OPTS=""
40    
41    # fdisk options
42    FDISKPARTIONBELOW256MB=0
43    
44  # default specialdevices  # default specialdevices
45  SPECIALDEVICE=""  SPECIALDEVICE=""
46    
# Line 204  dialog_hardware_detection() Line 207  dialog_hardware_detection()
207   run_hardware_detection   run_hardware_detection
208   case "${SPECIALDEVICE}" in   case "${SPECIALDEVICE}" in
209   zotac) echo " \n\n\n \\Z2Zotac Device erkannt!\\Zn \\" >> ${hwtmp} ;;   zotac) echo " \n\n\n \\Z2Zotac Device erkannt!\\Zn \\" >> ${hwtmp} ;;
210     rangee) echo " \n\n\n \\Z2Rangee Device erkannt!\\Zn \\" >> ${hwtmp} ;;
211   *) echo " \n\n\n \\ZnStandard Device erkannt!\\Zn \\" >> ${hwtmp} ;;   *) echo " \n\n\n \\ZnStandard Device erkannt!\\Zn \\" >> ${hwtmp} ;;
212   esac   esac
213    
# Line 435  dialog_main() Line 439  dialog_main()
439  #################################################  #################################################
440  run_hardware_detection()  run_hardware_detection()
441  {  {
442     local hwinfo
443    
444     hwinfo="$(hwinfo --bios --storage)"
445    
446   # check for special devices/clients:   # check for special devices/clients:
447   # 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
448   local removable=0   local removable=0
449   if [[ ! -z $(hwinfo --bios --storage | grep -i zotac) ]]   if [[ ! -z $(echo "${hwinfo}" | grep -i zotac) ]]
450   then   then
451   for i in /sys/block/[hs]d*/removable   for i in /sys/block/[hs]d*/removable
452   do   do
# Line 452  run_hardware_detection() Line 460  run_hardware_detection()
460   export GRUBLEGACYOPTS="rootdelay=8"   export GRUBLEGACYOPTS="rootdelay=8"
461   export SPECIALDEVICE="zotac"   export SPECIALDEVICE="zotac"
462   fi   fi
463    
464     # check for special devices/clients:
465     # if a rangee and disk ist smaller then 256mb move partion one block further ahead
466     if [[ ! -z $(echo "${hwinfo}" | grep -i CLE266) ]]
467     then
468     # for a rangee always define partion startblock +1
469     export FDISKPARTIONBELOW256MB="1"
470     export SPECIALDEVICE="rangee"
471     export GRUBLEGACYOPTS=""
472     fi
473    }
474    
475    hdd_size_below_256mb()
476    {
477     local hdd="$1"
478     local size
479     local retval
480     [[ -z ${hdd} ]] && die "Error: get_hdd_size() no \$hdd given!"
481    
482     size=$(fdisk -l ${hdd} | grep "Disk.*${hdd}" | sed 's:.*,\ \(.*\)\ byte.*:\1:')
483     if [[ ${size} -le 257000000 ]]
484     then
485     retval="0"
486     else
487     retval="1"
488     fi
489    
490     return "${retval}"
491  }  }
492    
493  setup_hdd_partitions_auto()  setup_hdd_partitions_auto()
494  {  {
495   ROOTHDD="${HDD}1"   ROOTHDD="${HDD}1"
496    
497     # run this only if FDISKPARTITIONBELOW256MB is not already 1
498     if [[ ${FDISKPARTIONBELOW256MB} != 1 ]]
499     then
500     if hdd_size_below_256mb ${HDD}
501     then
502     FDISKPARTIONBELOW256MB=1
503     else
504     FDISKPARTIONBELOW256MB=0
505     fi
506     fi
507    
508   ## delete disk   ## delete disk
509   dd if=/dev/zero of=${HDD} count=1 &> /dev/null || die   dd if=/dev/zero of=${HDD} count=1 &> /dev/null || die
510    
511   ## setup one bootable partition   if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
512   #1. n= new disk   then
513   #2. p= primary disk   ## setup one bootable partition
514   #3. 1= first partition   #1. n= new disk
515   #4. ''= default sector start   #2. p= primary disk
516   #5. ''= defaul sector end   #3. 1= first partition
517   #6. a= bootable flag   #4. 2= default sector start // small disk needs more space for grub2 mbr sector
518   #7. 1= boot flag for partition 1   #5. ''= defaul sector end
519   #8. w= write/quit   #6. a= bootable flag
520   fdisk ${HDD} &> /dev/null << EOF   #7. 1= boot flag for partition 1
521     #8. w= write/quit
522     fdisk ${HDD} &> /dev/null << EOF
523    n
524    p
525    1
526    2
527    
528    a
529    1
530    w
531    EOF
532     else
533     ## setup one bootable partition
534     #1. n= new disk
535     #2. p= primary disk
536     #3. 1= first partition
537     #4. ''= default sector start
538     #5. ''= defaul sector end
539     #6. a= bootable flag
540     #7. 1= boot flag for partition 1
541     #8. w= write/quit
542     fdisk ${HDD} &> /dev/null << EOF
543  n  n
544  p  p
545  1  1
# Line 480  a Line 549  a
549  1  1
550  w  w
551  EOF  EOF
552     fi
553  }  }
554    
555  setup_hdd_partitions_manuell()  setup_hdd_partitions_manuell()
# Line 662  install_initrd_chroot() Line 732  install_initrd_chroot()
732   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"
733   SATAMODS="sata_via sata_sis sata_nv"   SATAMODS="sata_via sata_sis sata_nv"
734   DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via"   DRMMODS="i915 mga nouveau r128 radeon savage sis tdfx ttm via"
735   FBMODS="uvesafb"   case ${SPECIALDEVICE} in
736     zotac) FBMODS="" ;;
737     rangee) FBMODS="viafb" ;;
738     *) FBMODS="uvesafb" ;;
739     esac
740    
741   # install an appropriate uvesafb.conf   # install an appropriate uvesafb.conf
742   install -d ${INSTALLPATH}/etc/modprobe.d || die   install -d ${INSTALLPATH}/etc/modprobe.d || die
743   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
744    
745     # install an appropriate viafb.conf
746     echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLPATH}/etc/modprobe.d/viafb.conf || die
747    
748   cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF   cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF
749  echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS}\"" > /etc/conf.d/mkinitrd  echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS}\"" > /etc/conf.d/mkinitrd
750  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

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