Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Try reading BOOT device-mapper path before using /dev/disk/by-label/boot
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Dubrovskii <[email protected]>
  • Loading branch information
nikita-dubrovskii committed Apr 16, 2020
1 parent 6136be3 commit 424abae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dracut/30ignition/ignition-setup-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ else
# under $bootmnt/ignition/config.ign. Note that we mount /boot
# but we don't unmount boot because we are run in a systemd unit
# with MountFlags=slave so it is unmounted for us.
bootpath=`lsblk --list -p --output LABEL,NAME | grep mapper | grep boot | awk '{print $2}'`
if [ -z $bootpath ]; then
bootpath="/dev/disk/by-label/boot"
fi
bootmnt=/mnt/boot_partition
mkdir -p $bootmnt
# mount as read-only since we don't strictly need write access and we may be
# running alongside other code that also has it mounted ro
mount -o ro /dev/disk/by-label/boot $bootmnt
mount -o ro $bootpath $bootmnt
copy_file_if_exists "${bootmnt}/ignition/config.ign" "${destination}/user.ign"
fi

0 comments on commit 424abae

Please sign in to comment.