From 0de3c332d5f531e9b10a1e3463b8c5aa77714c56 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 9 Jul 2026 18:31:41 +0000 Subject: [PATCH] armbian_rootenc_setup: new `boot_uuid`, `root_uid`, `rootdev_uid` vars --- scripts/armbian_rootenc_setup.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/armbian_rootenc_setup.sh b/scripts/armbian_rootenc_setup.sh index 839c692..9fd59a9 100755 --- a/scripts/armbian_rootenc_setup.sh +++ b/scripts/armbian_rootenc_setup.sh @@ -1013,8 +1013,7 @@ _copy_to_target() { } create_etc_crypttab() { - local root_uuid="$(lsblk --noheadings --list --nodeps --output=UUID /dev/$ROOT_DEVNAME)" - echo "$ROOTFS_NAME UUID=$root_uuid none initramfs,luks" > "$TARGET_ROOT/etc/crypttab" + echo "$ROOTFS_NAME UUID=$rootdev_uuid none initramfs,luks" > "$TARGET_ROOT/etc/crypttab" _display_file "$TARGET_ROOT/etc/crypttab" } @@ -1040,6 +1039,9 @@ _print_net_dev() { _set_target_vars() { + boot_uuid="$(lsblk --noheadings --list --nodeps --output=UUID /dev/$BOOT_DEVNAME)" + rootdev_uuid="$(lsblk --noheadings --list --nodeps --output=UUID /dev/$ROOT_DEVNAME)" + root_uuid="$(lsblk --noheadings --list --nodeps --output=UUID /dev/mapper/$ROOTFS_NAME)" target_distro=$(chroot $TARGET_ROOT 'lsb_release' '--short' '--codename') target_kernel=$(chroot $TARGET_ROOT 'ls' '/boot' | egrep '^vmlinu[xz]') target_armbian_keyring_signed= @@ -1234,9 +1236,8 @@ copy_authorized_keys() { } create_fstab() { - local boot_uuid="$(lsblk --noheadings --list --output=UUID /dev/$BOOT_DEVNAME)" local file="$TARGET_ROOT/etc/fstab" - local text="/dev/mapper/$ROOTFS_NAME / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1 + local text="UUID=$root_uuid / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1 UUID=$boot_uuid /boot ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 2 tmpfs /tmp tmpfs defaults,nosuid 0 0" rm -rf $file # existing file could have incorrect permissions @@ -1486,6 +1487,9 @@ configure_target() { 'APT_UPGRADE' \ 'eth_dev' \ 'netplan_pkgs' \ + 'rootdev_uuid' \ + 'root_uuid' \ + 'boot_uuid' \ 'dropbear_dir' chroot $TARGET_ROOT "./$PROGNAME" $ORIG_OPTS 'in_target'