From dab1f8c765a57fee51cb2fcaa7224477d1541a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Virtus?= Date: Wed, 24 Jan 2024 11:20:26 +0100 Subject: [PATCH] feat: mount_disk_image: Add rootpart parameter mount_disk_image function expects root partition to be at number 1. But some images require the root partition to be at other some other number. For example, EKS Anywhere images for bare metal are used with Tinkerbell deployment with a default configuration that expects the root device to be found at /dev/sda2. The knowledge of the root device path is needed to modify certain files in the root filesystem (e.g. cloud-init configs) for the machine to join Kubernetes cluster control plane. The partition number can be changed in the hook by "sgidsk --transpose". Allow the hook to use mount_disk_image with custom root partition number by making it an optional third parameter that defaults to 1. --- debian/changelog | 6 ++++++ live-build/functions | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 42c70398..d6bffcc8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (24.04.20) noble; urgency=medium + + * live-build/functions: mount_disk_image: add rootpart parameter + + -- Tomáš Virtus Wed, 24 Jan 2024 12:52:29 +0000 + livecd-rootfs (24.04.19) noble; urgency=medium * live-build/auto/config: don't repeatedly add the same pass name to the diff --git a/live-build/functions b/live-build/functions index fe93c71f..bea7b967 100644 --- a/live-build/functions +++ b/live-build/functions @@ -207,7 +207,8 @@ get_lowerdirs_for_pass () { mount_disk_image() { local disk_image=${1} local mountpoint=${2} - mount_image ${disk_image} 1 + local rootpart=${3:-1} + mount_image ${disk_image} "${rootpart}" mount_partition "${rootfs_dev_mapper}" $mountpoint local boot_dev="${loop_device}p16"