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 1579 by niro, Mon Oct 18 14:21:27 2010 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=""
39    
40    # target filesystem
41    FORMAT_FILESYSTEM="ext4"
42    
43  #################################################  #################################################
44  #  DIALOG BOXEN #  #  DIALOG BOXEN #
45  #################################################  #################################################
# Line 431  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 528  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 600  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 625  install_initrd_chroot() Line 652  install_initrd_chroot()
652   is_initrd_supported || return 0   is_initrd_supported || return 0
653    
654   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF
655  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
656  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
657  exit 0  exit 0
658  CHROOTEOF  CHROOTEOF
# Line 679  install_system_settings() Line 706  install_system_settings()
706   # schreibe fstab   # schreibe fstab
707   if is_uuid_supported   if is_uuid_supported
708   then   then
709   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
710   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
711   else   else
712   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
713   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
714   fi   fi
715   # 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
716   #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 699  install_system_settings_flash() Line 726  install_system_settings_flash()
726   # schreibe fstab   # schreibe fstab
727   if is_uuid_supported   if is_uuid_supported
728   then   then
729   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
730   else   else
731   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
732   fi   fi
733   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
734   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 740  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 761  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 782  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.1579  
changed lines
  Added in v.2557