[PATCH] meta: Add option to specify additional dependencies for package expand-on-first-boot in case an encrypted disk has to be resized

16 views
Skip to first unread message

alexander...@siemens.com

unread,
Sep 4, 2024, 1:16:46 PM9/4/24
to isar-...@googlegroups.com, quirin.g...@siemens.com, jan.k...@siemens.com, Alexander Heinisch
From: Alexander Heinisch <alexander...@siemens.com>

Although, disk encryption itself is not handled in isar (as of now), downstream projects
using disk encryption break this package. To mitigate this, we added an additional variable
to specify debian packages to be installed, when disk encryption is used. Depending on the
specific implementation (tpm, password prompt, ...) downstream projects can set the dependencies
needed for their strategy to handle the resize.

Note: We decided against fixing this by bbappending in downstream packages, because we believe
this approach scales better and is also easier to maintain.

Signed-off-by: Alexander Heinisch <alexander...@siemens.com>
---
.../expand-on-first-boot/expand-on-first-boot_1.5.bb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.5.bb b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.5.bb
index 1b5b066b..ea52ae9e 100644
--- a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.5.bb
+++ b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.5.bb
@@ -10,7 +10,9 @@ inherit dpkg-raw
DESCRIPTION = "This service grows the last partition to the full medium during first boot"
MAINTAINER = "isar-users <isar-...@googlegroups.com>"

-DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs, fdisk (>=2.29.2-3) | util-linux (<2.29.2-3), util-linux"
+# Additional packages that are needed to resize the disk if it is encrypted.
+ADDITIONAL_DISK_ENCRYPTION_PACKAGES ?= ""
+DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs, fdisk (>=2.29.2-3) | util-linux (<2.29.2-3), util-linux, ${ADDITIONAL_DISK_ENCRYPTION_PACKAGES}"

SRC_URI = " \
file://expand-on-first-boot.service \
--
2.43.0

Jan Kiszka

unread,
Sep 5, 2024, 12:51:59 AM9/5/24
to alexander...@siemens.com, isar-...@googlegroups.com, quirin.g...@siemens.com
Maybe time to start wrapping this long line around (I explained around
how ;)).

Jan

>
> SRC_URI = " \
> file://expand-on-first-boot.service \

--
Siemens AG, Technology
Linux Expert Center

alexander...@siemens.com

unread,
Sep 5, 2024, 3:21:41 AM9/5/24
to isar-...@googlegroups.com, quirin.g...@siemens.com, jan.k...@siemens.com, Alexander Heinisch
From: Alexander Heinisch <alexander...@siemens.com>

Although, disk encryption itself is not handled in isar (as of now), downstream projects
using disk encryption break this package. To mitigate this, we added an additional variable
to specify debian packages to be installed, when disk encryption is used. Depending on the
specific implementation (tpm, password prompt, ...) downstream projects can set the dependencies
needed for their strategy to handle the resize.

Note: We decided against fixing this by bbappending in downstream packages, because we believe
this approach scales better and is also easier to maintain.

Signed-off-by: Alexander Heinisch <alexander...@siemens.com>
---
.../expand-on-first-boot_1.5.bb | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.5.bb b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.5.bb
index 1b5b066b..ebb22c84 100644
--- a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.5.bb
+++ b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.5.bb
@@ -10,7 +10,19 @@ inherit dpkg-raw
DESCRIPTION = "This service grows the last partition to the full medium during first boot"
MAINTAINER = "isar-users <isar-...@googlegroups.com>"

-DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs, fdisk (>=2.29.2-3) | util-linux (<2.29.2-3), util-linux"
+# Additional packages that are needed to resize the disk if it is encrypted.
+ADDITIONAL_DISK_ENCRYPTION_PACKAGES ?= ""
+DEBIAN_DEPENDS = " \
+ systemd, \
+ sed, \
+ grep, \
+ coreutils, \
+ mount, \
+ e2fsprogs, \
+ fdisk (>=2.29.2-3) | util-linux (<2.29.2-3), \
+ util-linux, \
+ ${ADDITIONAL_DISK_ENCRYPTION_PACKAGES} \
+ "

SRC_URI = " \
file://expand-on-first-boot.service \
--
2.43.0

Jan Kiszka

unread,
Sep 5, 2024, 3:23:05 AM9/5/24
to alexander...@siemens.com, isar-...@googlegroups.com, quirin.g...@siemens.com
Reviewed-by: Jan Kiszka <jan.k...@siemes.com>

Thanks,
Jan

Uladzimir Bely

unread,
Sep 9, 2024, 10:38:35 AM9/9/24
to alexander...@siemens.com, isar-...@googlegroups.com
On Thu, 2024-09-05 at 09:21 +0200, alexander.heinisch via isar-users
wrote:
Applied to next, thanks.

--
Best regards,
Uladzimir.
Reply all
Reply to author
Forward
0 new messages