diff --git a/fixups/S90-fstab b/fixups/S90-fstab index a6aa4ad..a64b24f 100755 --- a/fixups/S90-fstab +++ b/fixups/S90-fstab @@ -1,7 +1,12 @@ #!/bin/sh -sed -i "/ \/boot /d" /etc/fstab -sed -i "/ \/ /d" /etc/fstab +if [ -f /etc/fstab ]; then + # Remove BOOT/ROOTFS mount points + sed -i "/ \/boot /d" /etc/fstab + sed -i "/ \/ /d" /etc/fstab + # Remove EFI partition not to mount + sed -i "/\/boot\/efi/d" /etc/fstab +fi if [ "x@@DEFAULT_DEV_ROOTFS@@" != "x" ]; then cat <<__EOF | tee -a /etc/fstab >/dev/null @@ -15,7 +20,4 @@ UUID="@@DEFAULT_DEV_BOOT@@" /boot ext2 rw,relatime,errors=continue 0 0 __EOF fi -# Remove EFI partition not to mount -sed -i "/\/boot\/efi/d" /etc/fstab - update-initramfs -u diff --git a/functions b/functions index 4427e6c..1eb22fd 100644 --- a/functions +++ b/functions @@ -242,7 +242,10 @@ do_mount() { } get_uuid_by_path() { - grep " ${1} " ${rootfs_mnt}/etc/fstab | cut -d' ' -f1 | cut -d'=' -f2 | tr -d '"' + if [ -f ${rootfs_mnt}/etc/fstab ]; then + grep " ${1} " ${rootfs_mnt}/etc/fstab \ + | cut -d' ' -f1 | cut -d'=' -f2 | tr -d '"' + fi } do_create_squashfs() {