Check and mount boot volume for data extraction with nouuid
When building an image, say RHEL9, on a host installed with that same image, you will be blocked from mounting the filesystems to extract contents, as the host OS kernel will identify the duplicate UUIDs and error accordingly. This was previously fixed for the root filesystem, but not the boot filesystem. Change-Id: I63a34fba033ed1c459aeb9c201c8821fa38a36e9
This commit is contained in:
parent
62626521ad
commit
57149d9eb1
@ -156,7 +156,18 @@ function extract_image() {
|
||||
|
||||
if [ ! -z "$BOOT_LOOPDEV" ]; then
|
||||
# mount to /boot
|
||||
sudo mount $BOOT_LOOPDEV $WORKING/mnt/boot
|
||||
BOOT_FSTYPE=$(sudo blkid -o value -s TYPE $ROOT_LOOPDEV)
|
||||
if [ "xfs" = "$BOOT_FSTYPE" ]; then
|
||||
BOOT_MOUNTOPTS="-o nouuid,ro"
|
||||
# Similar to root filesystem, if the boot filesystem
|
||||
# is XFS and the base OS is the same as the image being
|
||||
# rebuilt, we need to pass "nouuid" to bypass UUID safety
|
||||
# checks and successfully mounts so we can extract the
|
||||
# contents.
|
||||
else
|
||||
BOOT_MOUNTOPTS=""
|
||||
fi
|
||||
sudo mount $BOOT_MOUNTOPTS $BOOT_LOOPDEV $WORKING/mnt/boot
|
||||
EACTION="sudo umount -f $BOOT_LOOPDEV ; $EACTION"
|
||||
trap "$EACTION" EXIT
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user