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 2388 by niro, Wed Jun 15 08:51:38 2011 UTC alx-src/trunk/alxinstall-ng/bin/alxinstall-ng.sh.in revision 2557 by niro, Mon Jul 4 18:24:30 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.6"  VERSION="%VERSIONTAG%"
25  TITLE="alxinstall-ng - ${VERSION}"  TITLE="alxinstall-ng - ${VERSION}"
26    
27  CDPATH="/mnt/cdrom"  CDPATH="/mnt/cdrom"
# Line 31  INSTALLPATH="/mnt/magellan" Line 31  INSTALLPATH="/mnt/magellan"
31  CURRENTLINE=0  CURRENTLINE=0
32  #TOTALLINES=11072 # -> now in images.conf  #TOTALLINES=11072 # -> now in images.conf
33    
34  # standart kernel opts  # standard kernel opts
35  KERNELOPTS="quiet"  KERNELOPTS="quiet video=1024x768"
36    
37  # default specialdevices  # default specialdevices
38  SPECIALDEVICE=""  SPECIALDEVICE=""
# 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 || die
544   fi   fi
545    
546   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"   # set kernelopts
547   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"   if [[ -f ${INSTALLPATH}/etc/conf.d/grub ]]
548   [[ -z ${KRNIMG} ]] && KRNIMG="vmlinuz"   then
549     sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT\)=.*:\1\"${KERNELOPTS}\":" ${INSTALLPATH}/etc/conf.d/grub || die
550     else
551     echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALLPATH}/etc/conf.d/grub || die
552     fi
553     echo 'grub-mkdevicemap' > ${INSTALLPATH}/root/.bashrc || die
554     echo "LC_ALL=C grub-mkconfig -o ${grub2conf}" >> ${INSTALLPATH}/root/.bashrc || die
555     echo "grub-install --no-floppy ${HDD}" >> ${INSTALLPATH}/root/.bashrc || die
556    
557   # uuid support   # grub-legacy
  if is_uuid_supported  
  then  
  my_roothdd="UUID=$(get_uuid ${ROOTHDD})"  
558   else   else
559   my_roothdd="${ROOTHDD}"   ### grubconf schreiben
560   fi   source ${INSTALLPATH}/boot/kernelversion
561    
562   local grubconf=${INSTALLPATH}/boot/grub/grub.conf   #for alx only
563   : > ${grubconf} || die   if [ -e ${INSTALLPATH}/etc/alx_version ]
564   echo "default 0" >> ${grubconf} || die   then
565   echo "timeout 3" >> ${grubconf} || die   OLD_ALXVER="${ALXVER}"
566   # using current root password   source ${INSTALLPATH}/etc/alx_version
567   echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die   KRNVER="ALX-${ALXVER}"
568     ALXVER="${OLD_ALXVER}"
569     fi
570    
571   echo  >> ${grubconf} || die   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"
572   echo "# normal boot" >> ${grubconf} || die   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"
573   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  
574    
575   echo >> ${grubconf} || die   # uuid support
576   echo "# admin boot" >> ${grubconf} || die   if is_uuid_supported
577   echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die   then
578   echo "lock"  >> ${grubconf} || die   my_roothdd="UUID=$(get_uuid ${ROOTHDD})"
579   echo "root (hd0,0)" >> ${grubconf} || die   else
580   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} hardware-auto-detection" >> ${grubconf} || die   my_roothdd="${ROOTHDD}"
581   if is_initrd_supported   fi
  then  
  echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die  
  fi  
582    
583   echo >> ${grubconf} || die   : > ${grubconf} || die
584   echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die   echo "default 0" >> ${grubconf} || die
585   echo "lock"  >> ${grubconf} || die   echo "timeout 3" >> ${grubconf} || die
586   echo "root (hd0,0)" >> ${grubconf} || die   # using current root password
587   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
588   if is_initrd_supported  
589   then   echo  >> ${grubconf} || die
590   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die   echo "# normal boot" >> ${grubconf} || die
591   fi   echo "title ${KRNVER}" >> ${grubconf} || die
592     echo "root (hd0,0)" >> ${grubconf} || die
593     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS}" >> ${grubconf} || die
594     if is_initrd_supported
595     then
596     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
597     fi
598    
599   # bootsector schreiben chrooted schreiben (lfs/magellan)   echo >> ${grubconf} || die
600   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF   echo "# admin boot" >> ${grubconf} || die
601     echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die
602     echo "lock"  >> ${grubconf} || die
603     echo "root (hd0,0)" >> ${grubconf} || die
604     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} hardware-auto-detection" >> ${grubconf} || die
605     if is_initrd_supported
606     then
607     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
608     fi
609    
610     echo >> ${grubconf} || die
611     echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die
612     echo "lock"  >> ${grubconf} || die
613     echo "root (hd0,0)" >> ${grubconf} || die
614     echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} alx-reset-settings" >> ${grubconf} || die
615     if is_initrd_supported
616     then
617     echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die
618     fi
619    
620     # bootsector schreiben chrooted schreiben (lfs/magellan)
621     cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF
622  /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
623  root (hd0,0)  root (hd0,0)
624  setup (hd0)  setup (hd0)
# Line 603  quit Line 626  quit
626  EOF  EOF
627  exit 0  exit 0
628  CHROOTEOF  CHROOTEOF
629     fi
630    
631   ## enters chroot   ## enters chroot
632   mount -t proc proc ${INSTALLPATH}/proc   mount -t proc proc ${INSTALLPATH}/proc
# Line 743  run_install_normal() Line 767  run_install_normal()
767   install_mount_rootfs   install_mount_rootfs
768   (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
769    
  dialog_install_bootsector  
  install_bootsector_chroot  
   
770   dialog_install_settings   dialog_install_settings
771   sleep 1   sleep 1
772   install_system_settings   install_system_settings
773   install_initrd_chroot   install_initrd_chroot
774    
775     dialog_install_bootsector
776     install_bootsector_chroot
777    
778   install_umount_rootfs   install_umount_rootfs
779   dialog_install_successful   dialog_install_successful
780  }  }
# Line 764  run_install_flash() Line 789  run_install_flash()
789   install_mount_rootfs_flash   install_mount_rootfs_flash
790   (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
791    
  dialog_install_bootsector  
  install_bootsector_chroot  
   
792   dialog_install_settings   dialog_install_settings
793   sleep 1   sleep 1
794   install_system_settings_flash   install_system_settings_flash
795   install_initrd_chroot   install_initrd_chroot
796    
797     dialog_install_bootsector
798     install_bootsector_chroot
799    
800   install_umount_rootfs_flash   install_umount_rootfs_flash
801   dialog_install_successful   dialog_install_successful
802  }  }
# Line 785  run_install_auto() Line 811  run_install_auto()
811   install_mount_rootfs_flash   install_mount_rootfs_flash
812   (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
813    
  dialog_install_bootsector  
  install_bootsector_chroot  
   
814   dialog_install_settings   dialog_install_settings
815   sleep 1   sleep 1
816   install_system_settings_flash   install_system_settings_flash
817   install_initrd_chroot   install_initrd_chroot
818    
819     dialog_install_bootsector
820     install_bootsector_chroot
821    
822   install_umount_rootfs_flash   install_umount_rootfs_flash
823   dialog_install_successful   dialog_install_successful
824  }  }

Legend:
Removed from v.2388  
changed lines
  Added in v.2557