fix lvm extension and fs-cryptroot extension #7527
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
lvm.sh
extension failed as it was refering to the root filesystem in${LOOP}p${rootpart}
- which does not live there when the lvm extension is enabled. The lvm extension replaces the contents of$rootdevice
(defined in partitioning:280) with a reference to the device mapper, but in partitioning.sh:303 the $rootdevice was not used so it failed.stacktrace
(2nd commit)
While working on that Issue I stumbled over leftovers from a/the previous executions and had to remove the lvm volume group + loopdevices manually so I added a cleanup handler to the extension in case of errors.
In the meantime i.e. revelations/discoveries while creating this PR:
Seems this is a regression bug as this line of code was already adapted in #7217
But reintroduced in 8175192 while fixing the fs-cryptroot extension (from the commit naming - as I stumbled over the messed up UUID myself multiple weeks ago and it was working after git pull this seems reasonable)
And it seems this https://armbian.atlassian.net/browse/AR-2489 can be closed afterwards?
I will try to make both extensions work as they seem to interfere with each other.
To do that I introduced another variable
$physical_root_part_uuid
which gets its value from$physical_root_device
which can point to the same content as$root_device
but e.g. in lvm, fs-cryptroot rootdevice gets replaced, while e.g. in /etc/crypttab the UUID of the physical partition is needed and not the one of the mapper.How Has This Been Tested?
only lvm
./compile.sh BOARD=rock-3a RELEASE=bookworm BRANCH=vendor DEB_COMPRESS=xz KERNEL_CONFIGURE=no KERNEL_GIT=shallow BUILD_DESKTOP=no BUILD_MINIMAL=no ENABLE_EXTENSIONS="lvm"
cryptroot
./compile.sh BOARD=rock-3a RELEASE=bookworm BRANCH=vendor DEB_COMPRESS=xz KERNEL_CONFIGURE=no KERNEL_GIT=shallow BUILD_DESKTOP=no BUILD_MINIMAL=no CRYPTROOT_ENABLE=yes CRYPTROOT_PASSPHRASE=1234 ENABLE_EXTENSIONS=""
lvm+cryptroot
./compile.sh BOARD=rock-3a RELEASE=bookworm BRANCH=vendor DEB_COMPRESS=xz KERNEL_CONFIGURE=no KERNEL_GIT=shallow BUILD_DESKTOP=no BUILD_MINIMAL=no CRYPTROOT_ENABLE=yes CRYPTROOT_PASSPHRASE=1234 ENABLE_EXTENSIONS="lvm"
Checklist: