diff mbox series

[v3,2/4] initramfs-crypt-hook: Provide full losetup executable

Message ID 20240718103214.1583403-2-stefan-koch@siemens.com (mailing list archive)
State New
Headers show
Series [v3,1/4] initramfs-crypt-hook: Do not attempt to repair a partially encrypted filesystem | expand

Commit Message

Stefan Koch July 18, 2024, 10:32 a.m. UTC
- Avoids using a busybox losetup executable that
  doesn't support the "--sizelimit" parameter
- The "--sizelimit" parameter is needed for introducing
  speed-up of disk reencryption with the following commit

Signed-off-by: Stefan Koch <stefan-koch@siemens.com>
---
 .../initramfs-crypt-hook/files/encrypt_partition.clevis.hook    | 1 +
 .../initramfs-crypt-hook/files/encrypt_partition.systemd.hook   | 1 +
 .../initramfs-crypt-hook/initramfs-crypt-hook_0.2.bb            | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.clevis.hook b/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.clevis.hook
index 4e62ef7..4fbf830 100755
--- a/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.clevis.hook
+++ b/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.clevis.hook
@@ -74,6 +74,7 @@  copy_exec /usr/bin/file || hook_error "Unable to copy /usr/bin/file "
 copy_exec /usr/lib/*/libgcc_s.so.1 || hook_error "Unable to copy /usr/lib/*/libgcc_s.so.1 "
 copy_exec /usr/bin/uuidparse || hook_error "Unable to copy /usr/bin/uuidparse"
 copy_exec /usr/bin/mountpoint || hook_error "Unable to copy /usr/bin/mountpoint"
+copy_exec /usr/sbin/losetup || hook_error "/usr/sbin/losetup not found"
 
 if [ -x /usr/sbin/cryptsetup-reencrypt ]; then
     copy_exec /usr/sbin/cryptsetup-reencrypt
diff --git a/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.systemd.hook b/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.systemd.hook
index be8c117..b331a58 100755
--- a/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.systemd.hook
+++ b/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.systemd.hook
@@ -54,6 +54,7 @@  copy_exec /usr/bin/tpm2_testparms || hook_error "Unable to copy /usr/bin/tpm2_te
 copy_exec /usr/bin/basename || hook_error "Unable to copy /usr/bin/basename"
 copy_exec /usr/bin/uuidparse || hook_error "Unable to copy /usr/bin/uuidparse"
 copy_exec /usr/bin/mountpoint || hook_error "Unable to copy /usr/bin/mountpoint"
+copy_exec /usr/sbin/losetup || hook_error "/usr/sbin/losetup not found"
 
 copy_exec /usr/lib/*/cryptsetup/libcryptsetup-token-systemd-tpm2.so || hook_error "/usr/lib/*/cryptsetup/libcryptsetup-token-systemd-tpm2.so not found"
 if [ -x /usr/sbin/cryptsetup-reencrypt ]; then
diff --git a/recipes-initramfs/initramfs-crypt-hook/initramfs-crypt-hook_0.2.bb b/recipes-initramfs/initramfs-crypt-hook/initramfs-crypt-hook_0.2.bb
index 72de5b6..3497d95 100644
--- a/recipes-initramfs/initramfs-crypt-hook/initramfs-crypt-hook_0.2.bb
+++ b/recipes-initramfs/initramfs-crypt-hook/initramfs-crypt-hook_0.2.bb
@@ -9,7 +9,7 @@ 
 # SPDX-License-Identifier: MIT
 
 inherit dpkg-raw
-DEBIAN_DEPENDS = "initramfs-tools, cryptsetup, \
+DEBIAN_DEPENDS = "initramfs-tools, mount, cryptsetup, \
     awk, openssl, libtss2-esys-3.0.2-0 | libtss2-esys0, \
     libtss2-rc0 | libtss2-esys0, libtss2-mu0 | libtss2-esys0, \
     e2fsprogs, tpm2-tools, coreutils, uuid-runtime"