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 525 by niro, Fri Jun 27 23:31:48 2008 UTC revision 1169 by niro, Tue Aug 4 22:39:22 2009 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2  #  #
3  # $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.11 2008-06-27 23:31:48 niro Exp $  # $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.15 2008-06-28 00:37:45 niro Exp $
4  #  #
5  # AutoSta_LX Installation Script  # AutoSta_LX Installation Script
6  #  #
# 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"  VERSION="0.3.3"
25  TITLE="alxinstall-ng - ${VERSION}"  TITLE="alxinstall-ng - ${VERSION}"
26    
27  CDPATH="/mnt/cdrom"  CDPATH="/mnt/cdrom"
# Line 402  install_bootsector_chroot() Line 402  install_bootsector_chroot()
402   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"   [[ -z ${KRNVER} ]] && KRNVER="AutoSta_LX"
403   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"   [[ -z ${KRNINITRD} ]] && KRNINITRD="initrd"
404    
405   echo "default 0" > ${INSTALLPATH}/boot/grub/grub.conf || die   local grubconf=${INSTALLPATH}/boot/grub/grub.conf
406   echo "timeout 0" >> ${INSTALLPATH}/boot/grub/grub.conf ||die   : > ${grubconf} || die
407     echo "default 0" >> ${grubconf} || die
408     echo "timeout 3" >> ${grubconf} || die
409     # using current root password
410     echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die
411    
412     echo  >> ${grubconf} || die
413     echo "# normal boot" >> ${grubconf} || die
414     echo "title ${KRNVER}" >> ${grubconf} || die
415     echo "root (hd0,0)" >> ${grubconf} || die
416     echo "kernel /boot/vmlinuz root=${ROOTHDD} quiet" >> ${grubconf} || die
417     echo "initrd /boot/initrd" >> ${grubconf} || die
418    
419     echo >> ${grubconf} || die
420     echo "# admin boot" >> ${grubconf} || die
421     echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die
422     echo "lock"  >> ${grubconf} || die
423     echo "root (hd0,0)" >> ${grubconf} || die
424     echo "kernel /boot/vmlinuz root=${ROOTHDD} quiet hardware-auto-detection" >> ${grubconf} || die
425     echo "initrd /boot/initrd" >> ${grubconf} || die
426    
427     echo >> ${grubconf} || die
428     echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die
429     echo "lock"  >> ${grubconf} || die
430     echo "root (hd0,0)" >> ${grubconf} || die
431     echo "kernel /boot/vmlinuz root=${ROOTHDD} quiet alx-reset-settings" >> ${grubconf} || die
432     echo "initrd /boot/initrd" >> ${grubconf} || die
433    
  echo -e "\ntitle=${KRNVER}" >> ${INSTALLPATH}/boot/grub/grub.conf || die  
  echo "root (hd0,0)" >> ${INSTALLPATH}/boot/grub/grub.conf || die  
   
  echo "kernel /boot/vmlinuz root=${ROOTHDD} quiet" >> ${INSTALLPATH}/boot/grub/grub.conf || die  
  echo "initrd /boot/initrd" >> ${INSTALLPATH}/boot/grub/grub.conf || die  
   
434   # bootsector schreiben chrooted schreiben (lfs/magellan)   # bootsector schreiben chrooted schreiben (lfs/magellan)
435   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF   cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF
436  /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
# Line 418  root (hd0,0) Line 438  root (hd0,0)
438  setup (hd0)  setup (hd0)
439  quit  quit
440  EOF  EOF
 echo "MODULES=\"ext3 amd74xx piix sis5513 via82cxxx\" > /etc/conf.d/mkinitrd  
 mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g")  
441  exit 0  exit 0
442  CHROOTEOF  CHROOTEOF
443    
444   ## enters chroot   ## enters chroot
445   mount -t proc proc ${INSTALLPATH}/proc   mount -t proc proc ${INSTALLPATH}/proc
446   mount -t sysfs sysfs ${INSTALLPATH}/sysfs   mount -t sysfs sysfs ${INSTALLPATH}/sys
447     mount -o bind /dev ${INSTALLPATH}/dev
448     chroot ${INSTALLPATH} /bin/bash --rcfile /root/.bashrc -i
449     umount ${INSTALLPATH}/proc
450     umount ${INSTALLPATH}/sys
451     umount ${INSTALLPATH}/dev
452     rm ${INSTALLPATH}/root/.bashrc
453    }
454    
455    install_mkinitrd_chroot()
456    {
457     cat > ${INSTALLPATH}/root/.bashrc << CHROOTEOF
458    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
459    mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null
460    exit 0
461    CHROOTEOF
462    
463     ## enters chroot
464     mount -t proc proc ${INSTALLPATH}/proc
465     mount -t sysfs sysfs ${INSTALLPATH}/sys
466   mount -o bind /dev ${INSTALLPATH}/dev   mount -o bind /dev ${INSTALLPATH}/dev
467   chroot ${INSTALLPATH} /bin/bash --rcfile /root/.bashrc -i   chroot ${INSTALLPATH} /bin/bash --rcfile /root/.bashrc -i
468   umount ${INSTALLPATH}/proc   umount ${INSTALLPATH}/proc
# Line 442  install_system_settings() Line 479  install_system_settings()
479   echo -e "${SWAPHDD}\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "${SWAPHDD}\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || die
480   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
481   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
482    
483     # install network config skeleton
484     install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || die
485  }  }
486    
487  install_system_settings_flash()  install_system_settings_flash()
# Line 491  run_install_normal() Line 531  run_install_normal()
531   dialog_install_settings   dialog_install_settings
532   sleep 1   sleep 1
533   install_system_settings   install_system_settings
534     install_mkinitrd_chroot
535   install_umount_rootfs   install_umount_rootfs
536   dialog_install_successful   dialog_install_successful
537  }  }
# Line 511  run_install_flash() Line 552  run_install_flash()
552   dialog_install_settings   dialog_install_settings
553   sleep 1   sleep 1
554   install_system_settings_flash   install_system_settings_flash
555     install_mkinitrd_chroot
556   install_umount_rootfs_flash   install_umount_rootfs_flash
557   dialog_install_successful   dialog_install_successful
558  }  }

Legend:
Removed from v.525  
changed lines
  Added in v.1169