From bd7fd3cc84aa2b5640412547dee79e892ff0d7d1 Mon Sep 17 00:00:00 2001 From: jumperfly Date: Wed, 16 Nov 2016 20:02:16 +0000 Subject: [PATCH] If the boot partition is not found just log a message and carry on. --- src/init | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/init b/src/init index 549d6db..7059b23 100755 --- a/src/init +++ b/src/init @@ -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