From 117c2c04fdd341920f97ab5bea043102fd3cdc3f Mon Sep 17 00:00:00 2001 From: bill-auger Date: Sat, 21 Dec 2019 04:42:50 -0500 Subject: [PATCH] generalize /boot search --- src/pvm2tarball.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/pvm2tarball.sh b/src/pvm2tarball.sh index 6860a04..997d631 100755 --- a/src/pvm2tarball.sh +++ b/src/pvm2tarball.sh @@ -70,17 +70,21 @@ pvm_mount() { fi # find the boot partition - bootpart="$(findmnt -senF "$workdir"/etc/fstab /boot | awk '{print $2}')" - - if [ -n "$bootpart" ]; then - msg "found boot filesystem partition: %s" "$bootpart" + if (( $(find /boot/ -name initramfs-* | wc -l) > 0 )) && \ + (( $(find /boot/ -name vmlinuz-* | wc -l) > 0 )); then + msg "found /boot on root filesystem partition" else - error "%s: unable to determine boot partition." "$imagefile" - return "$EXIT_FAILURE" - fi + bootpart="$(findmnt -senF "$workdir"/etc/fstab /boot | awk '{print $2}')" - # mount and be happy - sudo mount "$bootpart" "$workdir"/boot || return + if [ -n "$bootpart" ]; then + # mount and be happy + msg "found boot filesystem partition: %s" "$bootpart" + sudo mount "$bootpart" "$workdir"/boot || return "$EXIT_FAILURE" + else + error "%s: unable to determine boot filesystem partition." "$imagefile" + return "$EXIT_FAILURE" + fi + fi } pvm_umount() {