--- trunk/installer-simple/bin/installer.sh.in 2014/01/03 14:38:46 2341 +++ trunk/installer-simple/bin/installer.sh.in 2014/01/03 14:57:23 2342 @@ -47,7 +47,7 @@ TITLE="${DEFAULT_TITLE} - ${VERSION}" CDPATH="${DEFAULT_CDPATH}" -INSTALLPATH="${DEFAULT_INSTALLPATH}" +INSTALLROOT="${DEFAULT_INSTALLROOT}" # standard kernel opts KERNELOPTS="quiet video=1024x768" @@ -637,61 +637,61 @@ install_mount_rootfs() { swapon ${SWAPHDD} || dialog_die - mount ${ROOTHDD} ${INSTALLPATH} || dialog_die - install -d ${INSTALLPATH}/boot || dialog_die - mount ${BOOTHDD} ${INSTALLPATH}/boot || dialog_die - cd ${INSTALLPATH} || dialog_die + mount ${ROOTHDD} ${INSTALLROOT} || dialog_die + install -d ${INSTALLROOT}/boot || dialog_die + mount ${BOOTHDD} ${INSTALLROOT}/boot || dialog_die + cd ${INSTALLROOT} || dialog_die } install_mount_rootfs_flash() { - mount ${ROOTHDD} ${INSTALLPATH} || dialog_die - install -d ${INSTALLPATH}/boot || dialog_die - cd ${INSTALLPATH} || dialog_die + mount ${ROOTHDD} ${INSTALLROOT} || dialog_die + install -d ${INSTALLROOT}/boot || dialog_die + cd ${INSTALLROOT} || dialog_die } install_system_image() { - tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLPATH} + tar xvjpf ${CDPATH}/system/${CDIMAGENAME} -C ${INSTALLROOT} } install_bootsector_chroot() { local my_roothdd - local grubconf=${INSTALLPATH}/boot/grub/grub.conf + local grubconf=${INSTALLROOT}/boot/grub/grub.conf local grub2conf=/boot/grub/grub.cfg # check for grub2 - if [[ -f ${INSTALLPATH}/sbin/grub-mkconfig ]] + if [[ -f ${INSTALLROOT}/sbin/grub-mkconfig ]] then # needed by grub-mkconfig on the first run - if [[ ! -f ${INSTALLPATH}/boot/grub/video.lst ]] + if [[ ! -f ${INSTALLROOT}/boot/grub/video.lst ]] then - install -m0644 ${INSTALLPATH}/lib/grub/*/video.lst ${INSTALLPATH}/boot/grub/video.lst || dialog_die + install -m0644 ${INSTALLROOT}/lib/grub/*/video.lst ${INSTALLROOT}/boot/grub/video.lst || dialog_die fi # set kernelopts - if [[ -f ${INSTALLPATH}/etc/conf.d/grub ]] + if [[ -f ${INSTALLROOT}/etc/conf.d/grub ]] then - sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLPATH}/etc/conf.d/grub || dialog_die + sed -i "s:^\(export GRUB_CMDLINE_LINUX_DEFAULT=\).*:\1\"${KERNELOPTS}\":" ${INSTALLROOT}/etc/conf.d/grub || dialog_die else - echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" > ${INSTALLPATH}/etc/conf.d/grub || dialog_die + echo "export GRUB_CMDLINE_LINUX_DEFAULT=\"${KERNELOPTS}\"" > ${INSTALLROOT}/etc/conf.d/grub || dialog_die fi - echo 'grub-mkdevicemap' > ${INSTALLPATH}/root/.installrc || dialog_die - echo "LC_ALL=C grub-mkconfig -o ${grub2conf} &> /dev/null" >> ${INSTALLPATH}/root/.installrc || dialog_die - echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLPATH}/root/.installrc || dialog_die - echo "exit 0" >> ${INSTALLPATH}/root/.installrc || dialog_die + echo 'grub-mkdevicemap' > ${INSTALLROOT}/root/.installrc || dialog_die + echo "LC_ALL=C grub-mkconfig -o ${grub2conf} &> /dev/null" >> ${INSTALLROOT}/root/.installrc || dialog_die + echo "grub-install --no-floppy ${HDD} &> /dev/null" >> ${INSTALLROOT}/root/.installrc || dialog_die + echo "exit 0" >> ${INSTALLROOT}/root/.installrc || dialog_die # grub-legacy else ### grubconf schreiben - source ${INSTALLPATH}/boot/kernelversion + source ${INSTALLROOT}/boot/kernelversion #for alx only - if [ -e ${INSTALLPATH}/etc/alx_version ] + if [ -e ${INSTALLROOT}/etc/alx_version ] then OLD_ALXVER="${ALXVER}" - source ${INSTALLPATH}/etc/alx_version + source ${INSTALLROOT}/etc/alx_version KRNVER="ALX-${ALXVER}" ALXVER="${OLD_ALXVER}" fi @@ -712,7 +712,7 @@ echo "default 0" >> ${grubconf} || dialog_die echo "timeout 3" >> ${grubconf} || dialog_die # using current root password - echo "password --md5 $(cat ${INSTALLPATH}/etc/shadow | grep root | cut -d: -f2)" >> ${grubconf} || dialog_die + echo "password --md5 $(cat ${INSTALLROOT}/etc/shadow | grep root | cut -d: -f2)" >> ${grubconf} || dialog_die echo >> ${grubconf} || dialog_die echo "# normal boot" >> ${grubconf} || dialog_die @@ -746,7 +746,7 @@ fi # bootsector schreiben chrooted schreiben (lfs/magellan) - cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF + cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF /usr/sbin/grub --no-floppy --batch << "EOF" 1> /dev/null 2> /dev/null root (hd0,0) setup (hd0) @@ -757,20 +757,20 @@ fi ## enter chroot - mount -t proc proc ${INSTALLPATH}/proc - mount -t sysfs sysfs ${INSTALLPATH}/sys - mount -o bind /dev ${INSTALLPATH}/dev - chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i - umount ${INSTALLPATH}/proc - umount ${INSTALLPATH}/sys - umount ${INSTALLPATH}/dev - rm ${INSTALLPATH}/root/.installrc + mount -t proc proc ${INSTALLROOT}/proc + mount -t sysfs sysfs ${INSTALLROOT}/sys + mount -o bind /dev ${INSTALLROOT}/dev + chroot ${INSTALLROOT} /bin/bash --rcfile /root/.installrc -i + umount ${INSTALLROOT}/proc + umount ${INSTALLROOT}/sys + umount ${INSTALLROOT}/dev + rm ${INSTALLROOT}/root/.installrc } is_initrd_supported() { # only generate initrds if the cmd exists - [[ -x ${INSTALLPATH}/sbin/mkinitrd ]] && return 0 + [[ -x ${INSTALLROOT}/sbin/mkinitrd ]] && return 0 return 1 } @@ -801,30 +801,30 @@ fi # install an appropriate uvesafb.conf - install -d ${INSTALLPATH}/etc/modprobe.d || dialog_die - echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLPATH}/etc/modprobe.d/uvesafb.conf || dialog_die + install -d ${INSTALLROOT}/etc/modprobe.d || dialog_die + echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" > ${INSTALLROOT}/etc/modprobe.d/uvesafb.conf || dialog_die # install an appropriate viafb.conf - echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLPATH}/etc/modprobe.d/viafb.conf || dialog_die + echo "options viafb viafb_mode=1024x768 viafb_refresh=60" > ${INSTALLROOT}/etc/modprobe.d/viafb.conf || dialog_die # install an appropriate i810fb.conf - 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 || dialog_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 - cat > ${INSTALLPATH}/root/.installrc << CHROOTEOF + cat > ${INSTALLROOT}/root/.installrc << CHROOTEOF echo "MODULES=\"${FORMAT_FILESYSTEM} ${DISKMODS} ${OLDATAMODS} ${PATAMODS} ${SATAMODS} ${DRMMODS} ${FBMODS} ${OTHERMODS}\"" > /etc/conf.d/mkinitrd mkinitrd -f /boot/$(readlink /boot/initrd) $(readlink /boot/vmlinuz | sed "s:kernel-::g") > /dev/null exit 0 CHROOTEOF ## enters chroot - mount -t proc proc ${INSTALLPATH}/proc - mount -t sysfs sysfs ${INSTALLPATH}/sys - mount -o bind /dev ${INSTALLPATH}/dev - chroot ${INSTALLPATH} /bin/bash --rcfile /root/.installrc -i - umount ${INSTALLPATH}/proc - umount ${INSTALLPATH}/sys - umount ${INSTALLPATH}/dev - rm ${INSTALLPATH}/root/.installrc + mount -t proc proc ${INSTALLROOT}/proc + mount -t sysfs sysfs ${INSTALLROOT}/sys + mount -o bind /dev ${INSTALLROOT}/dev + chroot ${INSTALLROOT} /bin/bash --rcfile /root/.installrc -i + umount ${INSTALLROOT}/proc + umount ${INSTALLROOT}/sys + umount ${INSTALLROOT}/dev + rm ${INSTALLROOT}/root/.installrc } is_uuid_supported() @@ -865,19 +865,19 @@ # schreibe fstab if is_uuid_supported then - echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || dialog_die - echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || dialog_die + echo -e "UUID=$(get_uuid ${BOOTHDD})\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLROOT}/etc/fstab || dialog_die + echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die else - echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLPATH}/etc/fstab || dialog_die - echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLPATH}/etc/fstab || dialog_die + echo -e "${BOOTHDD}\t/boot\t${FORMAT_FILESYSTEM}\tnoatime,noauto\t1 1" > ${INSTALLROOT}/etc/fstab || dialog_die + echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die fi # not needed busybox loads all with swapon -a, even if not mentioned in fstab - #echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALLPATH}/etc/fstab || dialog_die - echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || dialog_die - echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || dialog_die + #echo -e "UUID='$(get_uuid ${SWAPHDD})'\tswap\tswap\tpri=1\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die + echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die + echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die # install network config skeleton - install -m0644 ${INSTALLPATH}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLPATH}/etc/conf.d/ || dialog_die + install -m0644 ${INSTALLROOT}/etc/alxconfig-ng/skel/net/net.eth0 ${INSTALLROOT}/etc/conf.d/ || dialog_die # intel framebufer quirk if [[ -e /proc/fb ]] @@ -887,7 +887,7 @@ fbdev=$(grep 'inteldrmfb' /proc/fb | sed 's:\([0-9]\).*:\1:') if [[ ${fbdev} != 0 ]] then - sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLPATH}/etc/splash/splash.conf || dialog_die + sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${INSTALLROOT}/etc/splash/splash.conf || dialog_die fi fi fi @@ -898,26 +898,26 @@ # schreibe fstab if is_uuid_supported then - echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || dialog_die + echo -e "UUID=$(get_uuid ${ROOTHDD})\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLROOT}/etc/fstab || dialog_die else - echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLPATH}/etc/fstab || dialog_die + echo -e "${ROOTHDD}\t/\t${FORMAT_FILESYSTEM}\tnoatime\t0 0" > ${INSTALLROOT}/etc/fstab || dialog_die fi - echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || dialog_die - echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLPATH}/etc/fstab || dialog_die + echo -e "proc\t/proc\tproc\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die + echo -e "shm\t/dev/shm\ttmpfs\tdefaults\t0 0" >> ${INSTALLROOT}/etc/fstab || dialog_die } install_umount_rootfs() { cd / - umount ${INSTALLPATH}/boot || dialog_die - umount ${INSTALLPATH} || dialog_die + umount ${INSTALLROOT}/boot || dialog_die + umount ${INSTALLROOT} || dialog_die swapoff ${SWAPHDD} || dialog_die } install_umount_rootfs_flash() { cd / - umount ${INSTALLPATH} || dialog_die + umount ${INSTALLROOT} || dialog_die } install_do_reboot()