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

Commit

Permalink
ignition-setup-user: for DM boot-device get path from lsblk, instead …
Browse files Browse the repository at this point in the history
…of using /dev/disk/by-label/boot

Signed-off-by: Nikita Dubrovskii <[email protected]>
  • Loading branch information
nikita-dubrovskii committed Apr 17, 2020
1 parent 6136be3 commit 2eba6c2
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="/dev/disk/by-label/boot"
if [ -d "/dev/mapper" ]; then
bootpath=`lsblk --list --paths --output LABEL,NAME | grep mapper | grep boot | awk '{print $2}'`
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 2eba6c2

Please sign in to comment.