Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatcar-install: make sure blkid returns one device #125

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/flatcar-install
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,10 @@ function write_cloudinit() {
(
# The ROOT partition should be #9 but make no assumptions here!
# Also don't mount by label directly in case other devices conflict.
local ROOT_DEV=$(blkid -t "LABEL=ROOT" -o device "${DEVICE}"*)
local ROOT_DEV=$(blkid -l -t "LABEL=ROOT" -o device "${DEVICE}"*)

mkdir -p "${WORKDIR}/rootfs"
case $(blkid -t "LABEL=ROOT" -o value -s TYPE "${ROOT_DEV}") in
case $(blkid -l -t "LABEL=ROOT" -o value -s TYPE "${ROOT_DEV}") in
"btrfs") mount -t btrfs -o subvol=root "${ROOT_DEV}" "${WORKDIR}/rootfs" ;;
*) mount "${ROOT_DEV}" "${WORKDIR}/rootfs" ;;
esac
Expand All @@ -745,7 +745,7 @@ function write_ignition() {
(
# The OEM partition should be #6 but make no assumptions here!
# Also don't mount by label directly in case other devices conflict.
local OEM_DEV=$(blkid -t "LABEL=OEM" -o device "${DEVICE}"*)
local OEM_DEV=$(blkid -l -t "LABEL=OEM" -o device "${DEVICE}"*)

mkdir -p "${WORKDIR}/oemfs"
mount "${OEM_DEV}" "${WORKDIR}/oemfs" || { btrfstune -f -u "${OEM_DEV}" ; mount "${OEM_DEV}" "${WORKDIR}/oemfs" ; }
Expand Down