public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 2/2] Revert "expand-on-first-boot: Expand crypto_LUKS partition"
       [not found] <fdfafbd0-741c-4c39-85b1-4e0878fbf90a@siemens.com>
@ 2024-11-08 11:27 ` 'Jan Kiszka' via isar-users
  0 siblings, 0 replies; only message in thread
From: 'Jan Kiszka' via isar-users @ 2024-11-08 11:27 UTC (permalink / raw)
  To: isar-users; +Cc: Quirin Gylstorff, Heinisch, Alexander (T CED SES-AT)

From: Jan Kiszka <jan.kiszka@siemens.com>

This reverts commit c44c088cd224e44a401410c860bd625f28950ac3.

Same argument as for reverting 8b30a4f86cb3: This does not work when the
initramfs properly hides the encryption secret after using it.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../files/expand-last-partition.sh            | 22 ++++---------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
index c66d7627..2c4326c1 100755
--- a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
+++ b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
@@ -78,28 +78,14 @@ fi
 # some filesystems need to be mounted i.e. btrfs, but mounting also helps
 # detect the filesystem type without having to wait for udev
 # mount $LAST_PART out of tree, so we won't conflict with other mounts
-ret=0
-# Determine the filesystem type and perform the appropriate resize function
-FS_TYPE=$(blkid --output value --match-tag TYPE "${LAST_PART}" )
 MOUNT_POINT=$(mktemp -d -p "" "$(basename "$0").XXXXXXXXXX")
-if [ "$FS_TYPE" = "crypto_LUKS" ]; then
-	if [ ! -x /usr/sbin/cryptsetup ]; then
-		echo "'cryptsetup' is missing cannot resize last partition as it is from type 'crypto_LUKS'"
-		exit 1
-	fi
-	last_part_device_name=${LAST_PART#\/dev/}
+mount "${LAST_PART}" "${MOUNT_POINT}"
 
-	mapping_name=$(cat /sys/class/block/"$last_part_device_name"/holders/*/dm/name)
-	cryptsetup resize "$mapping_name"
-	mount /dev/mapper/"$mapping_name" "${MOUNT_POINT}"
-	FS_TYPE=$(findmnt -fno FSTYPE "${MOUNT_POINT}" )
-	LAST_PART=/dev/mapper/"$mapping_name"
-else
-	mount "${LAST_PART}" "${MOUNT_POINT}"
-fi
+ret=0
+# Determine the filesystem type and perform the appropriate resize function
+FS_TYPE=$(findmnt -fno FSTYPE "${MOUNT_POINT}" )
 case ${FS_TYPE} in
 ext*)
-
 	# Do not fail resize2fs if no mtab entry is found, e.g.,
 	# when using systemd mount units.
 	export EXT2FS_NO_MTAB_OK=1
-- 
2.43.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/d9255a29-23b3-44bf-a66f-e974a96af7fa%40siemens.com.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-11-08 11:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <fdfafbd0-741c-4c39-85b1-4e0878fbf90a@siemens.com>
2024-11-08 11:27 ` [PATCH 2/2] Revert "expand-on-first-boot: Expand crypto_LUKS partition" 'Jan Kiszka' via isar-users

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox