Magellan Linux

Diff of /tags/installer-simple-0_4_90_20140703_1/bin/installer.sh.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2322 by niro, Fri Jan 3 13:18:57 2014 UTC revision 2344 by niro, Fri Jan 3 15:01:06 2014 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/bash
2  # $Id$  # $Id$
3  #  #
4  # Simple Installation Script  # Simple Installation Script
# Line 7  Line 7 
7  # Niels Rogalla <niro@magellan-linux.de>  # Niels Rogalla <niro@magellan-linux.de>
8  #  #
9    
10  #images: (get ${CDIMAGENAME})  # ignore the environment
11  source /mnt/cdrom/system/images.conf  LC_ALL=C
12    # include dir
13    INSTALLER_LIBDIR="%LIBDIR%"
14    
15  #Includes  # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !
16  source /usr/lib/installer/functions/findhdd.sh > /dev/null  # -> now in images.conf
17  ### bugfix ###############################  CURRENTLINE=0
18  cdromdev="$(echo ${cdromdev} | sed 's/ //')"  
19  ########################################  # configuration
20    if [ -e %SYSCONFDIR%/installer.conf ]
21    then
22     source %SYSCONFDIR%/installer.conf
23    else
24     die "/etc/installer.conf not found"
25    fi
26    
27    # TOTALLINES=linecount of ${CDIMAGENAME}-tarball -1 !
28    # -> now in images.conf
29    CDIMAGENAME=""
30    TOTALLINES=""
31    CURRENTLINE=0
32    if [ -e /mnt/cdrom/system/images.conf ]
33    then
34     source /mnt/cdrom/system/images.conf
35     # check if all required variables are set
36     [[ -z ${CDIMAGENAME} ]] && die "CDIMAGENAME is empty in /mnt/cdrom/system/images.conf"
37     [[ -z ${TOTALLINES} ]] && die "TOTALLINES is empty in /mnt/cdrom/system/images.conf"
38    else
39     die "/mnt/cdrom/system/images.conf not found"
40    fi
41    
42    # includes
43    source ${INSTALLER_LIBDIR}/functions/hwdetection.sh
44    
45  ### System/Config Version  ### System/Config Version
46  VERSION="%VERSIONTAG%"  VERSION="%VERSIONTAG%"
47  TITLE="Installer - ${VERSION}"  TITLE="${DEFAULT_TITLE} - ${VERSION}"
48    
49  CDPATH="/mnt/cdrom"  CDROOT="${DEFAULT_CDROOT}"
50  INSTALLPATH="/mnt/magellan"  INSTALLROOT="${DEFAULT_INSTALLROOT}"
   
 ### WICHTIG: anzahl lines in der autosta_lx.tar.gz -1  
 CURRENTLINE=0  
 #TOTALLINES=11072 # -> now in images.conf  
51    
52  # standard kernel opts  # standard kernel opts
53  KERNELOPTS="quiet video=1024x768"  KERNELOPTS="quiet video=1024x768"
# Line 42  SPECIALDEVICE="" Line 64  SPECIALDEVICE=""
64  FORMFACTOR="desktop"  FORMFACTOR="desktop"
65    
66  # target filesystem  # target filesystem
67  FORMAT_FILESYSTEM="ext4"  FORMAT_FILESYSTEM="${DEFAULT_FILESYSTEM}"
68    
69  #################################################  #################################################
70  #  DIALOG BOXEN #  #  DIALOG BOXEN #
# Line 50  FORMAT_FILESYSTEM="ext4" Line 72  FORMAT_FILESYSTEM="ext4"
72    
73  die()  die()
74  {  {
75   ERROR=$1   echo "Error: $@"
76   RETVAL=$?   exit 1
77    }
78    
79    dialog_die()
80    {
81     ERROR="$1"
82     RETVAL="$?"
83   dialog_install_failure   dialog_install_failure
84   exit 1   exit 1
85  }  }
# Line 140  dialog_setup_system_menu() Line 168  dialog_setup_system_menu()
168   then   then
169   case "${i}" in   case "${i}" in
170   "1") run_install_auto ;;   "1") run_install_auto ;;
171           "2") run_install_normal ;;   "2") run_install_normal ;;
172   "3") run_install_flash ;;   "3") run_install_flash ;;
173   "") dialog_setup_system_menu;;   "") dialog_setup_system_menu;;
174   esac   esac
# Line 159  dialog_hardware_detection() Line 187  dialog_hardware_detection()
187   hwtmp="/tmp/hwtmp.sh"   hwtmp="/tmp/hwtmp.sh"
188   fi   fi
189    
190   [[ ! -z ${installdevs} ]] && installdevs=""   run_hardware_detection_disks
191    
192   echo "dialog \\"  > ${hwtmp}   echo "dialog \\"  > ${hwtmp}
193   echo "--backtitle \"${TITLE}\" \\" >> ${hwtmp}   echo "--backtitle \"${TITLE}\" \\" >> ${hwtmp}
# Line 169  dialog_hardware_detection() Line 197  dialog_hardware_detection()
197   echo "--msgbox \"Gefundene Hardware:\n\n \\" >> ${hwtmp}   echo "--msgbox \"Gefundene Hardware:\n\n \\" >> ${hwtmp}
198   echo " Festplatten:\n \\" >> ${hwtmp}   echo " Festplatten:\n \\" >> ${hwtmp}
199    
200   if [[ ! -z ${scsidisks} ]]   if [[ ! -z ${ALL_DISKS} ]]
201   then   then
202   for i in ${scsidisks}   for i in ${ALL_DISKS}
203   do   do
204   if [[ ${i} != ${cdromdev} ]]   echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp}
  then  
  echo " \\Z7SCSI: \\Z3${i}\\Zn\n \\" >> ${hwtmp}  
  installdevs="${installdevs} ${i}"  
  fi  
205   done   done
206   fi   fi
207    
208   if [[ ! -z ${idedisks} ]]   if [[ ! -z ${ALL_CDROMS} ]]
209   then   then
210   for i in ${idedisks}   echo " \n \\" >> ${hwtmp}
211     echo " CDROM Laufwerke:\n \\" >> ${hwtmp}
212     for i in ${ALL_CDROMS}
213   do   do
214   if [[ ${i} != ${cdromdev} ]]   echo " \\Z3${i}\\Zn\n \\" >> ${hwtmp}
  then  
  echo " \\Z7IDE:  \\Z3${i}\\Zn\n \\" >> ${hwtmp}  
  installdevs="${installdevs} ${i}"  
  fi  
215   done   done
216   fi   fi
217    
  if [[ ! -z ${cdromdev} ]]  
  then  
  echo " \n \\" >> ${hwtmp}  
  echo " \\Z7andere Laufwerke:\n \\" >> ${hwtmp}  
  echo " CDROM: \\Z3${cdromdev}\\Zn\n \\" >> ${hwtmp}  
  fi  
   
218   # other devices   # other devices
219   run_hardware_detection   run_hardware_detection
220   case "${SPECIALDEVICE}" in   case "${SPECIALDEVICE}" in
# Line 339  dialog_setup_hdd_partitions_auto() Line 354  dialog_setup_hdd_partitions_auto()
354   fi   fi
355  }  }
356    
357    run_hardware_detection_disks()
358    {
359     local bootdev
360    
361     # all disks but exclude ramdisks
362     export ALL_DISKS=$(get_hwinfo disk | sed '/\/dev\/ram[0-9].*/d')
363     # remove the boot device from ALL_DISKS if it was an usbstick
364     if [[ $(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f3) != iso9660 ]]
365     then
366     bootdev="$(grep '[[:space:]]/mnt/cdrom[[:space:]]' /proc/mounts | cut -d' ' -f1 | sed 's:[0-9]::g')"
367     export ALL_DISKS=$(echo "${ALL_DISKS}" | grep -v "${bootdev}")
368     fi
369     export ALL_CDROMS="$(get_hwinfo cdrom)"
370    }
371    
372  dialog_setup_hdd_create_partitions()  dialog_setup_hdd_create_partitions()
373  {  {
374   dialog \   dialog \
# Line 427  dialog_main() Line 457  dialog_main()
457   if [[ ${RES} -eq 0 ]]   if [[ ${RES} -eq 0 ]]
458   then   then
459   case ${METHOD} in   case ${METHOD} in
460           "1") dialog_setup_system_menu ;;   "1") dialog_setup_system_menu ;;
461   "2") dialog_hardware_detection ;;   "2") dialog_hardware_detection ;;
462   "3") install_do_reboot ;;   "3") install_do_reboot ;;
463   "4") /bin/bash --login -i ;;   "4") /bin/bash --login -i ;;
# Line 501  hdd_size_below_256mb() Line 531  hdd_size_below_256mb()
531   local hdd="$1"   local hdd="$1"
532   local size   local size
533   local retval   local retval
534   [[ -z ${hdd} ]] && die "Error: get_hdd_size() no \$hdd given!"   [[ -z ${hdd} ]] && dialog_die "Error: get_hdd_size() no \$hdd given!"
535    
536   size=$(fdisk -l ${hdd} | grep "Disk.*${hdd}" | sed 's:.*,\ \(.*\)\ byte.*:\1:')   size=$(fdisk -l ${hdd} | grep "Disk.*${hdd}" | sed 's:.*,\ \(.*\)\ byte.*:\1:')
537   if [[ ${size} -le 257000000 ]]   if [[ ${size} -le 257000000 ]]
# Line 530  setup_hdd_partitions_auto() Line 560  setup_hdd_partitions_auto()
560   fi   fi
561    
562   ## delete disk   ## delete disk
563   dd if=/dev/zero of=${HDD} count=1 &> /dev/null || die   dd if=/dev/zero of=${HDD} count=1 &> /dev/null || dialog_die
564    
565   if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]   if [[ ${FDISKPARTIONBELOW256MB} = 1 ]]
566   then   then
# Line 583  setup_hdd_partitions_manuell() Line 613  setup_hdd_partitions_manuell()
613   ROOTHDD="${HDD}3"   ROOTHDD="${HDD}3"
614    
615   ## hdds partitionieren manuell   ## hdds partitionieren manuell
616   cfdisk ${HDD} || die   cfdisk ${HDD} || dialog_die
617  }  }
618    
619  setup_hdd_partitions_manuell_flash()  setup_hdd_partitions_manuell_flash()
# Line 591  setup_hdd_partitions_manuell_flash() Line 621  setup_hdd_partitions_manuell_flash()
621   ROOTHDD="${HDD}1"   ROOTHDD="${HDD}1"
622    
623   ## hdds partitionieren manuell   ## hdds partitionieren manuell
624   cfdisk ${HDD} || die   cfdisk ${HDD} || dialog_die
625  }  }
626    
627  setup_hdd_format()  setup_hdd_format()
628  {  {
629   mkswap ${SWAPHDD} || die   mkswap ${SWAPHDD} || dialog_die
630   mke2fs -j -q ${BOOTHDD} || die   mke2fs -j -q ${BOOTHDD} || dialog_die
631   mke2fs -j -q ${ROOTHDD} || die   mke2fs -j -q ${ROOTHDD} || dialog_die
632  }  }
633    
634  setup_hdd_format_flash()  setup_hdd_format_flash()
635  {  {
636   mke2fs -j -q ${ROOTHDD} || die   mke2fs -j -q ${ROOTHDD} || dialog_die
637  }  }
638    
639  install_mount_rootfs()  install_mount_rootfs()
640  {  {
641   swapon ${SWAPHDD} || die   swapon ${SWAPHDD} || dialog_die
642   mount ${ROOTHDD} ${INSTALLPATH} || die   mount ${ROOTHDD} ${INSTALLROOT} || dialog_die
643   install -d ${INSTALLPATH}/boot || die   install -d ${INSTALLROOT}/boot || dialog_die
644   mount ${BOOTHDD} ${INSTALLPATH}/boot || die   mount ${BOOTHDD} ${INSTALLROOT}/boot || dialog_die
645   cd ${INSTALLPATH} || die   cd ${INSTALLROOT} || dialog_die
646  }  }
647    
648  install_mount_rootfs_flash()  install_mount_rootfs_flash()
649  {  {
650   mount ${ROOTHDD} ${INSTALLPATH} || die   mount ${ROOTHDD} ${INSTALLROOT} || dialog_die
651   install -d ${INSTALLPATH}/boot || die   install -d ${INSTALLROOT}/boot || dialog_die
652   cd ${INSTALLPATH} || die   cd ${INSTALLROOT} || dialog_die
653  }  }
654    
655  install_system_image()  install_system_image()
656  {  {
657   tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH}   tar xvjpf ${CDROOT}/system/${CDIMAGENAME} -C ${INSTALLROOT}
658  }  }
659    
660  install_bootsector_chroot()  install_bootsector_chroot()
661  {  {
662   local my_roothdd   local my_roothdd
663   local grubconf=${INSTALLPATH}/boot/grub/grub.conf   local grubconf=${INSTALLROOT}/boot/grub/grub.conf
664   local grub2conf=/boot/grub/grub.cfg   local grub2conf=/boot/grub/grub.cfg
665    
666   # check for grub2   # check for grub2
667   if [[ -f ${INSTALLPATH}/sbin/grub-mkconfig ]]   if [[ -f ${INSTALLROOT}/sbin/grub-mkconfig ]]
668   then   then
669   # needed by grub-mkconfig on the first run   # needed by grub-mkconfig on the first run
670   if [[ ! -f ${INSTALLPATH}/boot/grub/video.lst ]]   if [[ ! -f ${INSTALLROOT}/boot/grub/video.lst ]]
671   then   then
672   install -m0644 ${INSTALLPATH}/lib/grub/*/video.lst ${INSTALLPATH}/boot/grub/video.lst || die   install -m0644 ${INSTALLROOT}/lib/grub/*/video.lst ${INSTALLROOT}/boot/grub/video.lst || dialog_die
673   fi   fi
674    
675   # set kernelopts   # set kernelopts
676   if [[ -f ${INSTALLPATH}/etc/conf.d/grub ]]   if [[ -f ${INSTALLROOT}/etc/conf.d/grub ]]
677   then   then
678   sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLPATH}/etc/conf.d/grub || die   sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLROOT}/etc/conf.d/grub || dialog_die
679   else   else
680   echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALLPATH}/etc/conf.d/grub || die   echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" >  ${INSTALLROOT}/etc/conf.d/grub || dialog_die
681   fi   fi
682   echo 'grub-mkdevicemap' > ${INSTALLPATH}/root/.installrc || die   echo 'grub-mkdevicemap' > ${INSTALLROOT}/root/.installrc || dialog_die
683   echo "LC_ALL=C grub-mkconfig -o ${grub2conf}  &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die   echo "LC_ALL=C grub-mkconfig -o ${grub2conf}  &> /dev/null" >> ${INSTALLROOT}/root/.installrc || dialog_die
684   echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLPATH}/root/.installrc || die   echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLROOT}/root/.installrc || dialog_die
685   echo "exit 0" >> ${INSTALLPATH}/root/.installrc || die   echo "exit 0" >> ${INSTALLROOT}/root/.installrc || dialog_die
686    
687   # grub-legacy   # grub-legacy
688   else   else
689   ### grubconf schreiben   ### grubconf schreiben
690   source ${INSTALLPATH}/boot/kernelversion   source ${INSTALLROOT}/boot/kernelversion
691    
692   #for alx only   #for alx only
693   if [ -e ${INSTALLPATH}/etc/alx_version ]   if [ -e ${INSTALLROOT}/etc/alx_version ]
694   then   then
695   OLD_ALXVER="${ALXVER}"   OLD_ALXVER="${ALXVER}"
696   source ${INSTALLPATH}/etc/alx_version   source ${INSTALLROOT}/etc/alx_version
697   KRNVER="ALX-${ALXVER}"   KRNVER="ALX-${ALXVER}"
698   ALXVER="${OLD_ALXVER}"   ALXVER="${OLD_ALXVER}"
699   fi   fi
# Line 680  install_bootsector_chroot() Line 710  install_bootsector_chroot()
710   my_roothdd="${ROOTHDD}"   my_roothdd="${ROOTHDD}"
711   fi   fi
712    
713   : > ${grubconf} || die   : > ${grubconf} || dialog_die
714   echo "default 0" >> ${grubconf} || die   echo "default 0" >> ${grubconf} || dialog_die
715   echo "timeout 3" >> ${grubconf} || die   echo "timeout 3" >> ${grubconf} || dialog_die
716   # using current root password   # using current root password
717   echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || die   echo "password --md5 $(cat ${INSTALLROOT}/etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf} || dialog_die
718    
719   echo  >> ${grubconf} || die   echo  >> ${grubconf} || dialog_die
720   echo "# normal boot" >> ${grubconf} || die   echo "# normal boot" >> ${grubconf} || dialog_die
721   echo "title ${KRNVER}" >> ${grubconf} || die   echo "title ${KRNVER}" >> ${grubconf} || dialog_die
722   echo "root (hd0,0)" >> ${grubconf} || die   echo "root (hd0,0)" >> ${grubconf} || dialog_die
723   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" >> ${grubconf} || die   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS}" >> ${grubconf} || dialog_die
724   if is_initrd_supported   if is_initrd_supported
725   then   then
726   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die
727   fi   fi
728    
729   echo >> ${grubconf} || die   echo >> ${grubconf} || dialog_die
730   echo "# admin boot" >> ${grubconf} || die   echo "# admin boot" >> ${grubconf} || dialog_die
731   echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || die   echo "title ${KRNVER} - Re-run hardware-detection" >> ${grubconf} || dialog_die
732   echo "lock"  >> ${grubconf} || die   echo "lock"  >> ${grubconf} || dialog_die
733   echo "root (hd0,0)" >> ${grubconf} || die   echo "root (hd0,0)" >> ${grubconf} || dialog_die
734   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" >> ${grubconf} || die   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} hardware-auto-detection" >> ${grubconf} || dialog_die
735   if is_initrd_supported   if is_initrd_supported
736   then   then
737   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die
738   fi   fi
739    
740   echo >> ${grubconf} || die   echo >> ${grubconf} || dialog_die
741   echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || die   echo "title ${KRNVER} - Reset *all* local settings" >> ${grubconf} || dialog_die
742   echo "lock"  >> ${grubconf} || die   echo "lock"  >> ${grubconf} || dialog_die
743   echo "root (hd0,0)" >> ${grubconf} || die   echo "root (hd0,0)" >> ${grubconf} || dialog_die
744   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" >> ${grubconf} || die   echo "kernel /boot/${KRNIMG} root=${my_roothdd} ${KERNELOPTS} ${GRUBLEGACYOPTS} alx-reset-settings" >> ${grubconf} || dialog_die
745   if is_initrd_supported   if is_initrd_supported
746   then   then
747   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || die   echo "initrd /boot/${KRNINITRD}" >> ${grubconf} || dialog_die
748   fi   fi
749    
750   # bootsector schreiben chrooted schreiben (lfs/magellan)   # bootsector schreiben chrooted schreiben (lfs/magellan)
751   cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF   cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF
752  /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
753  root (hd0,0)  root (hd0,0)
754  setup (hd0)  setup (hd0)
# Line 728  exit 0 Line 758  exit 0
758  CHROOTEOF  CHROOTEOF
759   fi   fi
760    
761   ## enters chroot   ## enter chroot
762   mount -t proc proc ${INSTALLPATH}/proc   mount -t proc proc ${INSTALLROOT}/proc
763   mount -t sysfs sysfs ${INSTALLPATH}/sys   mount -t sysfs sysfs ${INSTALLROOT}/sys
764   mount -o bind /dev ${INSTALLPATH}/dev   mount -o bind /dev ${INSTALLROOT}/dev
765   chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i   chroot ${INSTALLROOT} /bin/bash --rcfile /root/.installrc -i
766   umount ${INSTALLPATH}/proc   umount ${INSTALLROOT}/proc
767   umount ${INSTALLPATH}/sys   umount ${INSTALLROOT}/sys
768   umount ${INSTALLPATH}/dev   umount ${INSTALLROOT}/dev
769   rm ${INSTALLPATH}/root/.installrc   rm ${INSTALLROOT}/root/.installrc
770  }  }
771    
772  is_initrd_supported()  is_initrd_supported()
773  {  {
774   # only generate initrds if the cmd exists   # only generate initrds if the cmd exists
775   [[ -x ${INSTALLPATH}/sbin/mkinitrd ]] && return 0   [[ -x ${INSTALLROOT}/sbin/mkinitrd ]] && return 0
776   return 1   return 1
777  }  }
778    
# Line 773  install_initrd_chroot() Line 803  install_initrd_chroot()
803   fi   fi
804    
805   # install an appropriate uvesafb.conf   # install an appropriate uvesafb.conf
806   install -d ${INSTALLPATH}/etc/modprobe.d || die   install -d ${INSTALLROOT}/etc/modprobe.d || dialog_die
807   echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLPATH}/etc/modprobe.d/uvesafb.conf || die   echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLROOT}/etc/modprobe.d/uvesafb.conf || dialog_die
808    
809   # install an appropriate viafb.conf   # install an appropriate viafb.conf
810   echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLPATH}/etc/modprobe.d/viafb.conf || die   echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLROOT}/etc/modprobe.d/viafb.conf || dialog_die
811    
812   # install an appropriate i810fb.conf   # install an appropriate i810fb.conf
813   echo "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60"  > ${INSTALLPATH}/etc/modprobe.d/i810fb.conf || die   echo "options i810fb xres=1024 yres=768 bpp=16 mtrr=1 hsync1=30 hsync2=62 vsync1=30 vsync2=60"  > ${INSTALLROOT}/etc/modprobe.d/i810fb.conf || dialog_die
814    
815   cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF   cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF
816  echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd  echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd
817  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
818  exit 0  exit 0
819  CHROOTEOF  CHROOTEOF
820    
821   ## enters chroot   ## enters chroot
822   mount -t proc proc ${INSTALLPATH}/proc   mount -t proc proc ${INSTALLROOT}/proc
823   mount -t sysfs sysfs ${INSTALLPATH}/sys   mount -t sysfs sysfs ${INSTALLROOT}/sys
824   mount -o bind /dev ${INSTALLPATH}/dev   mount -o bind /dev ${INSTALLROOT}/dev
825   chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i   chroot ${INSTALLROOT} /bin/bash --rcfile /root/.installrc -i
826   umount ${INSTALLPATH}/proc   umount ${INSTALLROOT}/proc
827   umount ${INSTALLPATH}/sys   umount ${INSTALLROOT}/sys
828   umount ${INSTALLPATH}/dev   umount ${INSTALLROOT}/dev
829   rm ${INSTALLPATH}/root/.installrc   rm ${INSTALLROOT}/root/.installrc
830  }  }
831    
832  is_uuid_supported()  is_uuid_supported()
# Line 820  get_uuid() Line 850  get_uuid()
850   local TYPE   local TYPE
851    
852   local dev="$1"   local dev="$1"
853   [[ -z ${dev} ]] && die "no dev given"   [[ -z ${dev} ]] && dialog_die "no dev given"
854    
855   # check if given device is already an UUID   # check if given device is already an UUID
856   if [[ ${dev/UUID=/}x != ${dev}x ]]   if [[ ${dev/UUID=/}x != ${dev}x ]]
# Line 837  install_system_settings() Line 867  install_system_settings()
867   # schreibe fstab   # schreibe fstab
868   if is_uuid_supported   if is_uuid_supported
869   then   then
870   echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die   echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLROOT}/etc/fstab || dialog_die
871   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die
872   else   else
873   echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || die   echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLROOT}/etc/fstab || dialog_die
874   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die
875   fi   fi
876   # 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
877   #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" >> ${INSTALLROOT}/etc/fstab || dialog_die
878   echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die
879   echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die
880    
881   # install network config skeleton   # install network config skeleton
882   install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || die   install -m0644 ${INSTALLROOT}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLROOT}/etc/conf.d/ || dialog_die
883    
884   # intel framebufer quirk   # intel framebufer quirk
885   if [[ -e /proc/fb ]]   if [[ -e /proc/fb ]]
# Line 859  install_system_settings() Line 889  install_system_settings()
889   fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')   fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:')
890   if [[ ${fbdev} != 0 ]]   if [[ ${fbdev} != 0 ]]
891   then   then
892   sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLPATH}/etc/splash/splash.conf || die   sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLROOT}/etc/splash/splash.conf || dialog_die
893   fi   fi
894   fi   fi
895   fi   fi
# Line 870  install_system_settings_flash() Line 900  install_system_settings_flash()
900   # schreibe fstab   # schreibe fstab
901   if is_uuid_supported   if is_uuid_supported
902   then   then
903   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die   echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLROOT}/etc/fstab || dialog_die
904   else   else
905   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || die   echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLROOT}/etc/fstab || dialog_die
906   fi   fi
907   echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die
908   echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || die   echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die
909  }  }
910    
911  install_umount_rootfs()  install_umount_rootfs()
912  {  {
913   cd /   cd /
914   umount ${INSTALLPATH}/boot || die   umount ${INSTALLROOT}/boot || dialog_die
915   umount ${INSTALLPATH} || die   umount ${INSTALLROOT} || dialog_die
916   swapoff ${SWAPHDD} || die   swapoff ${SWAPHDD} || dialog_die
917  }  }
918    
919  install_umount_rootfs_flash()  install_umount_rootfs_flash()
920  {  {
921   cd /   cd /
922   umount ${INSTALLPATH} || die   umount ${INSTALLROOT} || dialog_die
923  }  }
924    
925  install_do_reboot()  install_do_reboot()

Legend:
Removed from v.2322  
changed lines
  Added in v.2344