diff mbox series

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

Message ID 20240715134630.1640160-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 15, 2024, 1:46 p.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.systemd.hook   | 1 +
 .../initramfs-crypt-hook/initramfs-crypt-hook_0.2.bb            | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Gylstorff Quirin July 16, 2024, 7:51 a.m. UTC | #1
On 7/15/24 3:46 PM, Stefan Koch wrote:
> - 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.systemd.hook   | 1 +
>   .../initramfs-crypt-hook/initramfs-crypt-hook_0.2.bb            | 2 +-
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> 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..1e8c74c 100755
> --- a/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.systemd.hook
> +++ b/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.systemd.hook
> @@ -47,6 +47,7 @@ copy_exec /usr/bin/sleep || hook_error "/usr/bin/sleep not found"
>   copy_exec /usr/sbin/e2fsck || hook_error "/usr/sbin/e2fsck not found"
>   copy_exec /usr/sbin/resize2fs || hook_error "/usr/sbin/resize2fs not found"
>   copy_exec /usr/sbin/cryptsetup || hook_error "/usr/sbin/cryptsetup not found" > +copy_exec /usr/sbin/losetup /usr/local/sbin/losetup || hook_error 
"/usr/sbin/losetup not found"
why copy to /usr/local/sbin/losetup? please don't add additional paths.

Quirin
>   copy_exec /usr/bin/systemd-cryptenroll || hook_error "/usr/bin/systemd-cryptenroll not found"
>   copy_exec /usr/lib/systemd/systemd-cryptsetup || hook_error "/usr/lib/systemd/systemd-cryptsetup not found"
>   copy_exec /usr/bin/tpm2_pcrread || hook_error "Unable to copy /usr/bin/tpm2_pcrread"
> 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"
Stefan Koch July 16, 2024, 11:43 a.m. UTC | #2
On Tue, 2024-07-16 at 09:51 +0200, Gylstorff Quirin wrote:
> 
> 
> On 7/15/24 3:46 PM, Stefan Koch wrote:
> > - 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.systemd.hook   |
> > 1 +
> >   .../initramfs-crypt-hook/initramfs-crypt-hook_0.2.bb            |
> > 2 +-
> >   2 files changed, 2 insertions(+), 1 deletion(-)
> > 
> > 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..1e8c74c 100755
> > --- a/recipes-initramfs/initramfs-crypt-
> > hook/files/encrypt_partition.systemd.hook
> > +++ b/recipes-initramfs/initramfs-crypt-
> > hook/files/encrypt_partition.systemd.hook
> > @@ -47,6 +47,7 @@ copy_exec /usr/bin/sleep || hook_error
> > "/usr/bin/sleep not found"
> >   copy_exec /usr/sbin/e2fsck || hook_error "/usr/sbin/e2fsck not
> > found"
> >   copy_exec /usr/sbin/resize2fs || hook_error "/usr/sbin/resize2fs
> > not found"
> >   copy_exec /usr/sbin/cryptsetup || hook_error
> > "/usr/sbin/cryptsetup not found" > +copy_exec /usr/sbin/losetup
> > /usr/local/sbin/losetup || hook_error 
> "/usr/sbin/losetup not found"
> why copy to /usr/local/sbin/losetup? please don't add additional
> paths.
> 
> Quirin
Ok, works even with using /usr/sbin/losetup as path.
Then the busybox losetup is not available, only the full one.
> >   copy_exec /usr/bin/systemd-cryptenroll || hook_error
> > "/usr/bin/systemd-cryptenroll not found"
> >   copy_exec /usr/lib/systemd/systemd-cryptsetup || hook_error
> > "/usr/lib/systemd/systemd-cryptsetup not found"
> >   copy_exec /usr/bin/tpm2_pcrread || hook_error "Unable to copy
> > /usr/bin/tpm2_pcrread"
> > 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"
diff mbox series

Patch

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..1e8c74c 100755
--- a/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.systemd.hook
+++ b/recipes-initramfs/initramfs-crypt-hook/files/encrypt_partition.systemd.hook
@@ -47,6 +47,7 @@  copy_exec /usr/bin/sleep || hook_error "/usr/bin/sleep not found"
 copy_exec /usr/sbin/e2fsck || hook_error "/usr/sbin/e2fsck not found"
 copy_exec /usr/sbin/resize2fs || hook_error "/usr/sbin/resize2fs not found"
 copy_exec /usr/sbin/cryptsetup || hook_error "/usr/sbin/cryptsetup not found"
+copy_exec /usr/sbin/losetup /usr/local/sbin/losetup || hook_error "/usr/sbin/losetup not found"
 copy_exec /usr/bin/systemd-cryptenroll || hook_error "/usr/bin/systemd-cryptenroll not found"
 copy_exec /usr/lib/systemd/systemd-cryptsetup || hook_error "/usr/lib/systemd/systemd-cryptsetup not found"
 copy_exec /usr/bin/tpm2_pcrread || hook_error "Unable to copy /usr/bin/tpm2_pcrread"
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"