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

alx-src/trunk/alxinstall-ng/bin/alxinstall-ng.sh revision 1574 by niro, Mon Oct 18 11:46:02 2010 UTC alx-src/trunk/alxinstall-ng/bin/alxinstall-ng.sh.in revision 2554 by niro, Mon Jul 4 18:06:45 2011 UTC
# Line 21  cdromdev="$(echo ${cdromdev} | sed 's/ / Line 21  cdromdev="$(echo ${cdromdev} | sed 's/ /
21  ########################################  ########################################
22    
23  ### System/Config Version  ### System/Config Version
24  VERSION="0.3.5"  VERSION="%VERSIONTAG%"
25  TITLE="alxinstall-ng - ${VERSION}"  TITLE="alxinstall-ng - ${VERSION}"
26    
27  CDPATH="/mnt/cdrom"  CDPATH="/mnt/cdrom"
# Line 37  KERNELOPTS="quiet" Line 37  KERNELOPTS="quiet"
37  # default specialdevices  # default specialdevices
38  SPECIALDEVICE=""  SPECIALDEVICE=""
39    
40    # target filesystem
41    FORMAT_FILESYSTEM="ext4"
42    
43  #################################################  #################################################
44  #  DIALOG BOXEN #  #  DIALOG BOXEN #
45  #################################################  #################################################
# Line 120  dialog_setup_system_menu() Line 123  dialog_setup_system_menu()
123   --cancel-label "Abbrechen" \   --cancel-label "Abbrechen" \
124   --ok-label "Weiter" \   --ok-label "Weiter" \
125   --stdout \   --stdout \
126     --colors \
127   --menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \   --menu "\nWaehlen Sie die Installations-Methode" 14 70 5 \
128   "1" "Automatisches Setup" \   "1" "Automatisches Setup (Empfohlen)" \
129   "2" "Normale IDE-Disk (manuell)" \   "" "" \
130   "3" "Flash-Speicher (manuell)")   "" "\Z1Experten Modi:\Zn" \
131     "2" "Normale IDE-Disk (Manuell)" \
132     "3" "Flash-Speicher (Manuell)")
133   RES=$?   RES=$?
134   [[ ${RES} -eq 1 ]] && return 1   [[ ${RES} -eq 1 ]] && return 1
135   if [[ ${RES} -eq 0 ]]   if [[ ${RES} -eq 0 ]]
# Line 132  dialog_setup_system_menu() Line 138  dialog_setup_system_menu()
138   "1") run_install_auto ;;   "1") run_install_auto ;;
139           "2") run_install_normal ;;           "2") run_install_normal ;;
140   "3") run_install_flash ;;   "3") run_install_flash ;;
141     "") dialog_setup_system_menu;;
142   esac   esac
143   fi   fi
144  }  }
# Line 427  run_hardware_detection() Line 434  run_hardware_detection()
434   # check for special devices/clients:   # check for special devices/clients:
435   # 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
436   local removable=0   local removable=0
437   if [[ ! -z $(lspci -v | grep -i zotac) ]]   if [[ ! -z $(hwinfo --bios --storage | grep -i zotac) ]]
438   then   then
439   for i in /sys/block/[hs]d*/removable   for i in /sys/block/[hs]d*/removable
440   do   do
# Line 524  install_system_image() Line 531  install_system_image()
531  install_bootsector_chroot()  install_bootsector_chroot()
532  {  {
533   local my_roothdd   local my_roothdd
534     local grubconf=${INSTALLPATH}/boot/grub/grub.conf
535     local grub2conf=${INSTALLPATH}/boot/grub/grub.cfg
536    
537   ### grubconf schreiben   # check for grub2
538   source ${INSTALLPATH}/boot/kernelversion   if [[ -f ${INSTALLPATH}/sbin/grub-mkconfig ]]
   
  #for alx only  
  if [ -e ${INSTALLPATH}/etc/alx_version ]  
539   then   then
540   OLD_ALXVER="${ALXVER}"   # needed by grub-mkconfig on the first run
541   source ${INSTALLPATH}/etc/alx_version   if [[ ! -f ${INSTALLPATH}/boot/grub/video.lst ]]
542   KRNVER="ALX-${ALXVER}"   then
543   ALXVER="${OLD_ALXVER}"   install -m0644 ${INSTALLPATH}/lib/grub/*/video.lst /boot/grub/video.lst
544   fi   fi
545     echo 'grub-mkdevicemap' > ${INSTALLPATH}/root/.bashrc
546   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"   echo "LC_ALL=C grub-mkconfig -o ${grub2conf}" >> ${INSTALLPATH}/root/.bashrc
547   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"   echo "grub-install --no-floppy ${HDD}" >> ${INSTALLPATH}/root/.bashrc
  [[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz"  
548    
549   # uuid support   # grub-legacy
  if is_uuid_supported  
  then  
  my_roothdd="UUID=$(get_uuid ${ROOTHDD})"  
550   else   else
551   my_roothdd="${ROOTHDD}"   ### grubconf schreiben
552   fi   source ${INSTALLPATH}/boot/kernelversion
553    
554   local grubconf=${INSTALLPATH}/boot/grub/grub.conf   #for alx only
555   : > ${grubconf} || die   if [ -e ${INSTALLPATH}/etc/alx_version ]
556   echo "default 0" >> ${grubconf} || die   then
557   echo "timeout 3" >> ${grubconf} || die   OLD_ALXVER="${ALXVER}"
558   # using current root password   source ${INSTALLPATH}/etc/alx_version
559   echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die   KRNVER="ALX-${ALXVER}"
560     ALXVER="${OLD_ALXVER}"
561     fi
562    
563   echo  >> ${grubconf} || die   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"
564   echo "# normal boot" >> ${grubconf} || die   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"
565   echo "title ${KRNVER}" >> ${grubconf} || die   [[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz"
  echo "root (hd0,0)" >> ${grubconf} || die  
  echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS}" >> ${grubconf} || die  
  if is_initrd_supported  
  then  
  echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die  
  fi  
566    
567   echo >> ${grubconf} || die   # uuid support
568   echo "# admin boot" >> ${grubconf} || die   if is_uuid_supported
569   echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die   then
570   echo "lock"  >> ${grubconf} || die   my_roothdd="UUID=$(get_uuid ${ROOTHDD})"
571   echo "root (hd0,0)" >> ${grubconf} || die   else
572   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} hardware-auto-detection" >> ${grubconf} || die   my_roothdd="${ROOTHDD}"
573   if is_initrd_supported   fi
  then  
  echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die  
  fi  
574    
575   echo >> ${grubconf} || die   : > ${grubconf} || die
576   echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die   echo "default 0" >> ${grubconf} || die
577   echo "lock"  >> ${grubconf} || die   echo "timeout 3" >> ${grubconf} || die
578   echo "root (hd0,0)" >> ${grubconf} || die   # using current root password
579   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} alx-reset-settings" >> ${grubconf} || die   echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die
580   if is_initrd_supported  
581   then   echo  >> ${grubconf} || die
582   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die   echo "# normal boot" >> ${grubconf} || die
583   fi   echo "title ${KRNVER}" >> ${grubconf} || die
584     echo "root (hd0,0)" >> ${grubconf} || die
585     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS}" >> ${grubconf} || die
586     if is_initrd_supported
587     then
588     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
589     fi
590    
591   # bootsector schreiben chrooted schreiben (lfs/magellan)   echo >> ${grubconf} || die
592   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF   echo "# admin boot" >> ${grubconf} || die
593     echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die
594     echo "lock"  >> ${grubconf} || die
595     echo "root (hd0,0)" >> ${grubconf} || die
596     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} hardware-auto-detection" >> ${grubconf} || die
597     if is_initrd_supported
598     then
599     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
600     fi
601    
602     echo >> ${grubconf} || die
603     echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die
604     echo "lock"  >> ${grubconf} || die
605     echo "root (hd0,0)" >> ${grubconf} || die
606     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} alx-reset-settings" >> ${grubconf} || die
607     if is_initrd_supported
608     then
609     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
610     fi
611    
612     # bootsector schreiben chrooted schreiben (lfs/magellan)
613     cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF
614  /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null  /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null
615  root (hd0,0)  root (hd0,0)
616  setup (hd0)  setup (hd0)
# Line 596  quit Line 618  quit
618  EOF  EOF
619  exit 0  exit 0
620  CHROOTEOF  CHROOTEOF
621     fi
622    
623   ## enters chroot   ## enters chroot
624   mount -t proc proc ${INSTALLPATH}/proc   mount -t proc proc ${INSTALLPATH}/proc
# Line 621  install_initrd_chroot() Line 644  install_initrd_chroot()
644   is_initrd_supported || return 0   is_initrd_supported || return 0
645    
646   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF
647  echo "MODULES=\"ext3 amd74xx piix sis5513 via82cxxx sd_mod ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via sata_via sata_sis sata_nv\"" > /etc/conf.d/mkinitrd  echo "MODULES=\"${FORMAT_FILESYSTEM} amd74xx piix sis5513 via82cxxx sd_mod ata_piix pata_amd pata_mpiix pata_oldpiix pata_sis pata_via sata_via sata_sis sata_nv\"" > /etc/conf.d/mkinitrd
648  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
649  exit 0  exit 0
650  CHROOTEOF  CHROOTEOF
# Line 675  install_system_settings() Line 698  install_system_settings()
698   # schreibe fstab   # schreibe fstab
699   if is_uuid_supported   if is_uuid_supported
700   then   then
701   echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\text3\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die   echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die
702   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\text3\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die
703   else   else
704   echo -e "${BOOTHDD}\t/boot\text3\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die   echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die
705   echo -e "${ROOTHDD}\t/\text3\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die
706   fi   fi
707   # 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
708   #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" >> ${INSTALLPATH}/etc/fstab || die
# Line 695  install_system_settings_flash() Line 718  install_system_settings_flash()
718   # schreibe fstab   # schreibe fstab
719   if is_uuid_supported   if is_uuid_supported
720   then   then
721   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\text3\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die
722   else   else
723   echo -e "${ROOTHDD}\t/\text3\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die
724   fi   fi
725   echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
726   echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die
# Line 736  run_install_normal() Line 759  run_install_normal()
759   install_mount_rootfs   install_mount_rootfs
760   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
761    
  dialog_install_bootsector  
  install_bootsector_chroot  
   
762   dialog_install_settings   dialog_install_settings
763   sleep 1   sleep 1
764   install_system_settings   install_system_settings
765   install_initrd_chroot   install_initrd_chroot
766    
767     dialog_install_bootsector
768     install_bootsector_chroot
769    
770   install_umount_rootfs   install_umount_rootfs
771   dialog_install_successful   dialog_install_successful
772  }  }
# Line 757  run_install_flash() Line 781  run_install_flash()
781   install_mount_rootfs_flash   install_mount_rootfs_flash
782   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
783    
  dialog_install_bootsector  
  install_bootsector_chroot  
   
784   dialog_install_settings   dialog_install_settings
785   sleep 1   sleep 1
786   install_system_settings_flash   install_system_settings_flash
787   install_initrd_chroot   install_initrd_chroot
788    
789     dialog_install_bootsector
790     install_bootsector_chroot
791    
792   install_umount_rootfs_flash   install_umount_rootfs_flash
793   dialog_install_successful   dialog_install_successful
794  }  }
# Line 778  run_install_auto() Line 803  run_install_auto()
803   install_mount_rootfs_flash   install_mount_rootfs_flash
804   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image   (install_system_image > /tmp/install.log) 2> /tmp/install_errors.log | dialog_install_meter | dialog_install_system_image
805    
  dialog_install_bootsector  
  install_bootsector_chroot  
   
806   dialog_install_settings   dialog_install_settings
807   sleep 1   sleep 1
808   install_system_settings_flash   install_system_settings_flash
809   install_initrd_chroot   install_initrd_chroot
810    
811     dialog_install_bootsector
812     install_bootsector_chroot
813    
814   install_umount_rootfs_flash   install_umount_rootfs_flash
815   dialog_install_successful   dialog_install_successful
816  }  }

Legend:
Removed from v.1574  
changed lines
  Added in v.2554