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 2553 by niro, Wed Jun 15 08:59:22 2011 UTC revision 2554 by niro, Mon Jul 4 18:06:45 2011 UTC
# Line 531  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   echo  >> ${grubconf} || die   fi
  echo "# normal boot" >> ${grubconf} || die  
  echo "title ${KRNVER}" >> ${grubconf} || die  
  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  
562    
563   echo >> ${grubconf} || die   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"
564   echo "# admin boot" >> ${grubconf} || die   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"
565   echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die   [[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz"
  echo "lock"  >> ${grubconf} || die  
  echo "root (hd0,0)" >> ${grubconf} || die  
  echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} hardware-auto-detection" >> ${grubconf} || die  
  if is_initrd_supported  
  then  
  echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die  
  fi  
566    
567   echo >> ${grubconf} || die   # uuid support
568   echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die   if is_uuid_supported
569   echo "lock"  >> ${grubconf} || die   then
570   echo "root (hd0,0)" >> ${grubconf} || die   my_roothdd="UUID=$(get_uuid ${ROOTHDD})"
571   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} alx-reset-settings" >> ${grubconf} || die   else
572   if is_initrd_supported   my_roothdd="${ROOTHDD}"
573   then   fi
  echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die  
  fi  
574    
575   # bootsector schreiben chrooted schreiben (lfs/magellan)   : > ${grubconf} || die
576   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF   echo "default 0" >> ${grubconf} || die
577     echo "timeout 3" >> ${grubconf} || die
578     # using current root password
579     echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die
580    
581     echo  >> ${grubconf} || die
582     echo "# normal boot" >> ${grubconf} || die
583     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     echo >> ${grubconf} || die
592     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 603  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 743  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 764  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 785  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.2553  
changed lines
  Added in v.2554