--- trunk/installer-simple/bin/installer.sh.in 2014/01/07 14:20:31 2434 +++ trunk/installer-simple/bin/installer.sh.in 2014/01/07 14:23:24 2435 @@ -370,6 +370,13 @@ { ROOTHDD="${HDD}1" + # sanity check - should not happen + if is_mounted --device "${ROOTHDD}" + then + echo "partition: device ${ROOTHDD} is already mounted, umount it" >&2 + umount "${ROOTHDD}" + fi + # run this only if FDISKPARTITIONBELOW256MB is not already 1 if [[ ${FDISKPARTIONBELOW256MB} != 1 ]] then @@ -438,12 +445,19 @@ setup_hdd_format() { + # sanity check - should not happen + if is_mounted --device "${ROOTHDD}" + then + echo "format: device ${ROOTHDD} is already mounted, umount it" >&2 + umount "${ROOTHDD}" + fi + mkfs."${FORMAT_FILESYSTEM}" -q "${ROOTHDD}" || dialog_die } install_mount_rootfs() { - mount ${ROOTHDD} ${INSTALLROOT} || dialog_die + is_mounted --location "${INSTALLROOT}" || mount "${ROOTHDD}" "${INSTALLROOT}" install -d ${INSTALLROOT}/boot || dialog_die } @@ -692,8 +706,8 @@ install_umount_rootfs() { - umount ${INSTALLROOT}/boot || dialog_die - umount ${INSTALLROOT} || dialog_die + is_mounted --location ${INSTALLROOT}/boot && umount ${INSTALLROOT}/boot + is_mounted --location ${INSTALLROOT} && umount ${INSTALLROOT} } install_do_reboot()