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 280 by niro, Wed Aug 17 03:35:09 2005 UTC revision 519 by niro, Fri Jun 27 22:01:08 2008 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.5 2005-08-17 03:35:09 niro Exp $  # $Header: /home/cvsd/alx-cvs/alx-src/alxinstall-ng/bin/alxinstall-ng.sh,v 1.6 2008-06-27 22:01:08 niro Exp $
4  #  #
5  # AutoSta_LX Installation Script  # AutoSta_LX Installation Script
6  # version: 0.8b  # version: 0.9
7  #  #
8  # Niels Rogalla <niro@magellan-linux.de>  # Niels Rogalla <niro@magellan-linux.de>
9  # <rogalla@augusta-bochum.de>  # <rogalla@augusta-bochum.de>
# Line 12  Line 12 
12  # Install Navigation Gui  # Install Navigation Gui
13  #  #
14    
 #source /etc/alx_version  
 #source /opt/alx-config/version  
   
 #source /etc/alx-config/config.rc  
   
15  #images: (get ${CDIMAGENAME})  #images: (get ${CDIMAGENAME})
16  source /mnt/cdrom/system/images.conf  source /mnt/cdrom/system/images.conf
17    
# Line 45  CURRENTLINE=0 Line 40  CURRENTLINE=0
40  #################################################  #################################################
41    
42  die() {  die() {
  #clear  
  #echo -e "\nhuch, da ist ein script gestorben -> $?\n"  
  #read  
  #exit 0  
43   ERROR=$1   ERROR=$1
44   RETVAL=$?   RETVAL=$?
45   dialog_install_failure   dialog_install_failure
# Line 379  dialog_main() { Line 370  dialog_main() {
370   if [ "$RES" == "0" ];then   if [ "$RES" == "0" ];then
371   case "$METHOD" in   case "$METHOD" in
372           "1")           "1")
  #only for now later it will be used again  
  #with 6.1-r2 only one install method available  
  #dialog_install_method  
  #run_install_normal  
373   dialog_setup_system_menu   dialog_setup_system_menu
374   ;;   ;;
375   "2") dialog_setup_hdd_found_manuell   "2") dialog_setup_hdd_found_manuell
# Line 431  setup_hdd_format() { Line 418  setup_hdd_format() {
418  }  }
419    
420  setup_hdd_format_flash() {  setup_hdd_format_flash() {
 # mkswap $SWAPHDD || die  
 # mke2fs -j -q $BOOTHDD || die  
421   mke2fs -j -q $ROOTHDD || die   mke2fs -j -q $ROOTHDD || die
422  }  }
423    
# Line 445  install_mount_rootfs() { Line 430  install_mount_rootfs() {
430  }  }
431    
432  install_mount_rootfs_flash() {  install_mount_rootfs_flash() {
 # swapon $SWAPHDD || die  
433   mount $ROOTHDD $INSTALLPATH || die   mount $ROOTHDD $INSTALLPATH || die
434   install -d $INSTALLPATH/boot || die   install -d $INSTALLPATH/boot || die
 # mount $BOOTHDD $INSTALLPATH/boot || die  
435   cd $INSTALLPATH || die   cd $INSTALLPATH || die
436  }  }
437    
438  install_system_image() {  install_system_image() {
  #tar xvzpf $CDPATH/system/autosta_lx.tar.gz  
439   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}
440  }  }
441    
# Line 462  install_kernel_image() { Line 444  install_kernel_image() {
444   declare -i CPUTYPE=`cat /proc/cpuinfo |grep "cpu family"|cut -d ' ' -f3`   declare -i CPUTYPE=`cat /proc/cpuinfo |grep "cpu family"|cut -d ' ' -f3`
445    
446   if [ $CPUTYPE -le 5 ];then   if [ $CPUTYPE -le 5 ];then
                 #echo -e "\033[1;6m\033[36m""i386 Architektur gefunden.""\033[0m"  
                 #echo -e "Installiere i386 Kernel..."  
447    
448   lastdir="`pwd`"   lastdir="`pwd`"
449    
# Line 480  install_kernel_image() { Line 460  install_kernel_image() {
460   cd $lastdir || die   cd $lastdir || die
461    
462          elif [ $CPUTYPE -ge 6 ];then          elif [ $CPUTYPE -ge 6 ];then
                 #echo -e "\033[1;6m\033[36m""i686 Architektur gefunden.""\033[0m"  
                 #echo -e "Installiere i686 Kernel..."  
463    
464   lastdir="`pwd`"   lastdir="`pwd`"
465    
# Line 520  install_bootsector() { Line 498  install_bootsector() {
498    
499   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die
500   echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die   echo -e "timeout 03" >> $INSTALLPATH/boot/grub/grub.conf ||die
  #no support for splash image in 6.1-r2  
  #echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die  
501   echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die   echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die
502   echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die   echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die
503    
  #s3 cards don't support this  
  #echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD vga=0x317 video:vesa:ywrap,mtrr splash=silent quiet" >> $INSTALLPATH/boot/grub/grub.conf || die  
  #that's more safer:  
504   echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD quiet" >> $INSTALLPATH/boot/grub/grub.conf || die   echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD quiet" >> $INSTALLPATH/boot/grub/grub.conf || die
   
  #not needed without bootsplash support  
  #echo -e "initrd=/boot/${KRNINITRD}" >> $INSTALLPATH/boot/grub/grub.conf || die  
505    
506   ### bootsector schreiben   ### bootsector schreiben
  #grub --no-floppy < $CONFIGS_TEMPLATE/grubsettings || die  
507   /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null || die   /sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null || die
508  root (hd0,0)  root (hd0,0)
509  setup (hd0)  setup (hd0)
# Line 544  EOF Line 513  EOF
513    
514  install_bootsector_chroot() {  install_bootsector_chroot() {
515   ### grubconf schreiben   ### grubconf schreiben
  #source $INSTALLPATH/INSTALL/kernel/kernelversion  
516   source $INSTALLPATH/boot/kernelversion   source $INSTALLPATH/boot/kernelversion
517    
518   #for alx only   #for alx only
# Line 574  install_bootsector_chroot() { Line 542  install_bootsector_chroot() {
542   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die   echo -e "default 0" > $INSTALLPATH/boot/grub/grub.conf || die
543   echo -e "timeout 0" >> $INSTALLPATH/boot/grub/grub.conf ||die   echo -e "timeout 0" >> $INSTALLPATH/boot/grub/grub.conf ||die
544    
  #no support for splash image in 6.1-r2  
  #echo -e "splashimage=(hd0,0)/boot/grub/splash.xpm.gz" >> $INSTALLPATH/boot/grub/grub.conf || die  
   
545   echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die   echo -e "\ntitle=${KRNVER}" >> $INSTALLPATH/boot/grub/grub.conf || die
546   echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die   echo -e "root (hd0,0)" >> $INSTALLPATH/boot/grub/grub.conf || die
547    
  #s3 cards don't support this  
  #echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD vga=0x317 video:vesa:ywrap,mtrr splash=silent quiet" >> $INSTALLPATH/boot/grub/grub.conf || die  
  #that's more safer:  
548   echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD quiet" >> $INSTALLPATH/boot/grub/grub.conf || die   echo -e "kernel (hd0,0)/boot/${KRNIMG} root=$ROOTHDD quiet" >> $INSTALLPATH/boot/grub/grub.conf || die
549    
  #not needed without bootsplash support  
  #echo -e "initrd=/boot/${KRNINITRD}" >> $INSTALLPATH/boot/grub/grub.conf || die  
   
   
550   ### bootsector schreiben chrooted schreiben (gentoo)   ### bootsector schreiben chrooted schreiben (gentoo)
551   if [ -f $INSTALLPATH/sbin/grub ]   if [ -f $INSTALLPATH/sbin/grub ]
552   then   then
# Line 617  CHROOTEOF Line 575  CHROOTEOF
575    
576   ##enters chroot   ##enters chroot
577   mount -t proc none $INSTALLPATH/proc   mount -t proc none $INSTALLPATH/proc
  # bind /dev to get the devices right,  
  # if bootet from a 2.6 kernel with udev  
578   mount -o bind /dev $INSTALLPATH/dev   mount -o bind /dev $INSTALLPATH/dev
579   chroot $INSTALLPATH /bin/bash --rcfile /root/.bashrc -i   chroot $INSTALLPATH /bin/bash --rcfile /root/.bashrc -i
580   umount $INSTALLPATH/proc   umount $INSTALLPATH/proc
# Line 647  install_system_settings(){ Line 603  install_system_settings(){
603   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
604   echo -e "none\t/proc\tproc\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "none\t/proc\tproc\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die
605    
  #deprecated  
  #echo -e "devpts\t/dev/pts\tdevpts\tgid=4,mode=620\t0 0" >> $INSTALLPATH/etc/fstab || die  
   
606   echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die
607   echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die
608  }  }
609    
610  install_system_settings_flash(){  install_system_settings_flash(){
611   ### schreibe fstab   ### schreibe fstab
 # echo -e "$BOOTHDD\t/boot\text3\tnoatime,noauto\t1 1" > $INSTALLPATH/etc/fstab || die  
612   echo -e "$ROOTHDD\t/\text3\tnoatime\t0 0" > $INSTALLPATH/etc/fstab || die   echo -e "$ROOTHDD\t/\text3\tnoatime\t0 0" > $INSTALLPATH/etc/fstab || die
 # echo -e "$SWAPHDD\tswap\tswap\tpri=1\t0 0" >> $INSTALLPATH/etc/fstab || die  
613   echo -e "none\t/proc\tproc\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "none\t/proc\tproc\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die
614    
  #deprecated  
  #echo -e "devpts\t/dev/pts\tdevpts\tgid=4,mode=620\t0 0" >> $INSTALLPATH/etc/fstab || die  
   
615   echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "none\t/dev/shm\ttmpfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die
616   echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die   echo -e "none\t/proc/bus/usb\tusbfs\tdefaults\t0 0" >> $INSTALLPATH/etc/fstab || die
617  }  }
# Line 685  install_umount_rootfs() { Line 633  install_umount_rootfs() {
633    
634  install_umount_rootfs_flash() {  install_umount_rootfs_flash() {
635   cd /   cd /
 # umount $INSTALLPATH/boot || die  
636   umount $INSTALLPATH || die   umount $INSTALLPATH || die
 # swapoff $SWAPHDD || die  
637  }  }
638    
639  install_do_reboot() {  install_do_reboot() {
640    
  #only for now later it will be used again  
  #with 6.1-r2 these options are not available  
  #cd /  
  #umount $CDPATH  
  #eject  
  #clear  
   
641   reboot   reboot
642  }  }
643    
# Line 707  install_do_reboot() { Line 646  install_do_reboot() {
646  #################################################  #################################################
647    
648  run_install_normal() {  run_install_normal() {
  #only for now later it will be used again  
  #with 6.1-r2 only one install method available  
  #dialog_setup_hdd_menu  
649   dialog_setup_hdd_found_manuell   dialog_setup_hdd_found_manuell
650    
651   dialog_setup_hdd_partitions_manuell   dialog_setup_hdd_partitions_manuell
# Line 718  run_install_normal() { Line 654  run_install_normal() {
654   install_mount_rootfs   install_mount_rootfs
655   (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
656    
  #only for now later it will be used again  
  #with 6.1-r2 variable kernels are not available  
  #dialog_install_kernel_image  
  #install_kernel_image  
   
657   dialog_install_bootsector   dialog_install_bootsector
658   install_bootsector_chroot   install_bootsector_chroot
659    
  #only for now later it will be used again  
  #with 6.1-r2 highest version of alx-config is already included  
  #dialog_install_alxconfig  
  #sleep 1  
  #install_alxconfig  
   
660   dialog_install_settings   dialog_install_settings
661   sleep 1   sleep 1
662   install_system_settings   install_system_settings
# Line 741  run_install_normal() { Line 666  run_install_normal() {
666  }  }
667    
668  run_install_flash() {  run_install_flash() {
  #only for now later it will be used again  
  #with 6.1-r2 only one install method available  
  #dialog_setup_hdd_menu  
669   dialog_setup_hdd_found_manuell   dialog_setup_hdd_found_manuell
670    
671   dialog_setup_hdd_partitions_manuell_flash   dialog_setup_hdd_partitions_manuell_flash
# Line 752  run_install_flash() { Line 674  run_install_flash() {
674   install_mount_rootfs_flash   install_mount_rootfs_flash
675   (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
676    
  #only for now later it will be used again  
  #with 6.1-r2 variable kernels are not available  
  #dialog_install_kernel_image  
  #install_kernel_image  
677    
678   dialog_install_bootsector   dialog_install_bootsector
679   install_bootsector_chroot   install_bootsector_chroot
680    
  #only for now later it will be used again  
  #with 6.1-r2 highest version of alx-config is already included  
  #dialog_install_alxconfig  
  #sleep 1  
  #install_alxconfig  
   
681   dialog_install_settings   dialog_install_settings
682   sleep 1   sleep 1
683   install_system_settings_flash   install_system_settings_flash

Legend:
Removed from v.280  
changed lines
  Added in v.519