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

Fix issue 7210, rootdevice altering extensions #7217

Merged
merged 2 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions extensions/lvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ function post_create_partitions__setup_lvm() {
}

function prepare_root_device__create_volume_group() {

LOOP=$(losetup -f)
[[ -z $LOOP ]] && exit_with_error "Unable to find free loop device"
check_loop_device "$LOOP"
losetup $LOOP ${SDCARD}.raw
partprobe $LOOP

display_alert "Using LVM root" "${EXTENSION}" "info"
vgscan
vgchange -a y ${LVM_VG_NAME}
Expand Down
2 changes: 1 addition & 1 deletion lib/functions/image/partitioning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ function prepare_partitions() {
wait_for_disk_sync "after mkfs" # force writes to be really flushed

# store in readonly global for usage in later hooks
root_part_uuid="$(blkid -s UUID -o value ${LOOP}p${rootpart})"
root_part_uuid="$(blkid -s UUID -o value ${rootdevice})"
declare -g -r ROOT_PART_UUID="${root_part_uuid}"

display_alert "Mounting rootfs" "$rootdevice (UUID=${ROOT_PART_UUID})"
Expand Down