If the boot partition is not found just log a message and carry on.

This commit is contained in:
jumperfly 2016-11-16 20:02:16 +00:00 committed by Sam Liddell
parent 4017e4178b
commit bd7fd3cc84
1 changed files with 8 additions and 4 deletions

View File

@ -56,11 +56,15 @@ fi
mount -t ext4 -o ro $IMG_DEVICE /mnt/img
# Mount boot device and load squashfs module if present
mount -t vfat -o ro $BOOT_DEVICE /boot
if [[ -e /boot/modules/$(uname -r)/squashfs.ko ]]; then
insmod /boot/modules/$(uname -r)/squashfs.ko
if findfs $BOOT_DEVIC &> /dev/null; then
mount -t vfat -o ro $BOOT_DEVICE /boot
if [[ -e /boot/modules/$(uname -r)/squashfs.ko ]]; then
insmod /boot/modules/$(uname -r)/squashfs.ko
fi
umount /boot
else
echo "The 'boot' partition was not detected, not checking for squashfs kernel module."
fi
umount /boot
# Mount OS image
mount -t squashfs -o ro /mnt/img/root-squash.img /mnt/lower