public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 1/3] bootstrap: space-separate base packages
@ 2024-12-19 11:00 'Felix Moessbauer' via isar-users
  2024-12-19 11:00 ` [PATCH 2/3] bootstrap: make DISTRO_BOOTSTRAP_BASE_PACKAGES changeable 'Felix Moessbauer' via isar-users
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2024-12-19 11:00 UTC (permalink / raw)
  To: isar-users; +Cc: cedric.hombourger, srinuvasan.a, Felix Moessbauer

The variable DISTRO_BOOTSTRAP_BASE_PACKAGES contains a list of base
packages that need to be included when bootstrapping. This list was
comma separated for technical reasons, which made it hard to append or
remove from that list. Instead, we now make it space separated and join
it by comma where needed.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc   | 7 ++++---
 meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index f9dae26a..6a612852 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -14,8 +14,8 @@ PV = "1.0"
 DEBOOTSTRAP ?= "qemu-debootstrap"
 ROOTFSDIR = "${WORKDIR}/rootfs"
 DISTRO_BOOTSTRAP_BASE_PACKAGES = "locales"
-DISTRO_BOOTSTRAP_BASE_PACKAGES:append:gnupg = ",gnupg"
-DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = ",ca-certificates"
+DISTRO_BOOTSTRAP_BASE_PACKAGES:append:gnupg = " gnupg"
+DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = " ca-certificates"
 
 inherit deb-dl-dir
 
@@ -79,13 +79,14 @@ do_bootstrap[network] = "${TASK_USE_NETWORK_AND_SUDO}"
 
 inherit compat
 
+do_bootstrap[vardeps] += "DISTRO_BOOTSTRAP_BASE_PACKAGES"
 do_bootstrap() {
     if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
         if [ -z "${COMPAT_DISTRO_ARCH}" ]; then
             bbfatal "${DISTRO_ARCH} does not have a compat arch"
         fi
     fi
-    debootstrap_args="--verbose --variant=minbase --include=${DISTRO_BOOTSTRAP_BASE_PACKAGES}"
+    debootstrap_args="--verbose --variant=minbase --include=${@','.join(d.getVar('DISTRO_BOOTSTRAP_BASE_PACKAGES').split())}"
     if [ -f "${DISTRO_BOOTSTRAP_KEYRING}" ]; then
         debootstrap_args="$debootstrap_args --keyring=${DISTRO_BOOTSTRAP_KEYRING}"
     fi
diff --git a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
index d7ddffdc..0f2e6dc9 100644
--- a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
+++ b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
@@ -11,8 +11,8 @@ inherit deb-dl-dir
 
 FILESEXTRAPATHS:append = ":${LAYERDIR_core}/recipes-core/isar-bootstrap/files"
 
-DISTRO_BOOTSTRAP_BASE_PACKAGES = "locales,apt,usrmerge"
-DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = ",ca-certificates"
+DISTRO_BOOTSTRAP_BASE_PACKAGES = "locales apt usrmerge"
+DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = " ca-certificates"
 
 BOOTSTRAP_TMPDIR = "${WORKDIR}/tempdir"
 
@@ -85,13 +85,14 @@ do_bootstrap[network] = "${TASK_USE_NETWORK_AND_SUDO}"
 
 DEB_DL_LOCK ?= "${DEBDIR}/${BOOTSTRAP_BASE_DISTRO}-${BASE_DISTRO_CODENAME}.lock"
 
+do_bootstrap[vardeps] += "DISTRO_BOOTSTRAP_BASE_PACKAGES"
 do_bootstrap() {
     if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
         if [ -z "${COMPAT_DISTRO_ARCH}" ]; then
             bbfatal "${DISTRO_ARCH} does not have a compat arch"
         fi
     fi
-    bootstrap_args="--verbose --variant=minbase --include=${DISTRO_BOOTSTRAP_BASE_PACKAGES}"
+    bootstrap_args="--verbose --variant=minbase --include=${@','.join(d.getVar('DISTRO_BOOTSTRAP_BASE_PACKAGES').split())}"
     if [ -f "${DISTRO_BOOTSTRAP_KEYRING}" ]; then
         bootstrap_args="$bootstrap_args --keyring=${DISTRO_BOOTSTRAP_KEYRING}"
         cp "${DISTRO_BOOTSTRAP_KEYRING}" "${WORKDIR}/trusted.gpg.d/"
-- 
2.39.5

-- 
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/20241219110010.389690-1-felix.moessbauer%40siemens.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] bootstrap: make DISTRO_BOOTSTRAP_BASE_PACKAGES changeable
  2024-12-19 11:00 [PATCH 1/3] bootstrap: space-separate base packages 'Felix Moessbauer' via isar-users
@ 2024-12-19 11:00 ` 'Felix Moessbauer' via isar-users
  2024-12-19 11:00 ` [PATCH 3/3] make usage of usrmerge distro dependent 'Felix Moessbauer' via isar-users
  2024-12-24 11:58 ` [PATCH 1/3] bootstrap: space-separate base packages Uladzimir Bely
  2 siblings, 0 replies; 4+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2024-12-19 11:00 UTC (permalink / raw)
  To: isar-users; +Cc: cedric.hombourger, srinuvasan.a, Felix Moessbauer

To deal with the complex situation of usrmerge during bootstrapping,
we need to make DISTRO_BOOTSTRAP_BASE_PACKAGES modifyable in the distro
conf. For that, we just append to that variable in the bootstrap recipe
so we can define additional packages in the distro conf.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc   | 2 +-
 meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 6a612852..08d61a84 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -13,7 +13,7 @@ PV = "1.0"
 
 DEBOOTSTRAP ?= "qemu-debootstrap"
 ROOTFSDIR = "${WORKDIR}/rootfs"
-DISTRO_BOOTSTRAP_BASE_PACKAGES = "locales"
+DISTRO_BOOTSTRAP_BASE_PACKAGES += "locales"
 DISTRO_BOOTSTRAP_BASE_PACKAGES:append:gnupg = " gnupg"
 DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = " ca-certificates"
 
diff --git a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
index 0f2e6dc9..01ed1e59 100644
--- a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
+++ b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
@@ -11,7 +11,7 @@ inherit deb-dl-dir
 
 FILESEXTRAPATHS:append = ":${LAYERDIR_core}/recipes-core/isar-bootstrap/files"
 
-DISTRO_BOOTSTRAP_BASE_PACKAGES = "locales apt usrmerge"
+DISTRO_BOOTSTRAP_BASE_PACKAGES += "locales apt usrmerge"
 DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = " ca-certificates"
 
 BOOTSTRAP_TMPDIR = "${WORKDIR}/tempdir"
-- 
2.39.5

-- 
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/20241219110010.389690-2-felix.moessbauer%40siemens.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] make usage of usrmerge distro dependent
  2024-12-19 11:00 [PATCH 1/3] bootstrap: space-separate base packages 'Felix Moessbauer' via isar-users
  2024-12-19 11:00 ` [PATCH 2/3] bootstrap: make DISTRO_BOOTSTRAP_BASE_PACKAGES changeable 'Felix Moessbauer' via isar-users
@ 2024-12-19 11:00 ` 'Felix Moessbauer' via isar-users
  2024-12-24 11:58 ` [PATCH 1/3] bootstrap: space-separate base packages Uladzimir Bely
  2 siblings, 0 replies; 4+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2024-12-19 11:00 UTC (permalink / raw)
  To: isar-users; +Cc: cedric.hombourger, srinuvasan.a, Felix Moessbauer

The situation around usrmerge is complex: In older distro versions that
must be included to get the /{bin,sbin,lib} dirs symlinked to their
counterparts in /usr. In debian, the essential package
init-system-helpers depends on usrmerge from bookworm on, so it is
discouraged to manually include it (in the future it might be dropped
completely). In Ubuntu, the usrmerge package is already dropped from
noble on, currently breaking the build.

We now add the package using the distro conf just for the distros that
need it, restoring the ubuntu build and making it future-proof.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta-isar/conf/distro/raspios-bullseye.conf           | 1 +
 meta-isar/conf/distro/ubuntu-common.inc               | 4 ++++
 meta/conf/distro/debian-common.conf                   | 4 ++++
 meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc | 2 +-
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/meta-isar/conf/distro/raspios-bullseye.conf b/meta-isar/conf/distro/raspios-bullseye.conf
index 2515f0fd..a362289d 100644
--- a/meta-isar/conf/distro/raspios-bullseye.conf
+++ b/meta-isar/conf/distro/raspios-bullseye.conf
@@ -17,6 +17,7 @@ DISTRO_APT_SOURCES:arm64 ?= "conf/distro/raspios-bullseye-64.list"
 
 DISTRO_BOOTSTRAP_KEYS = "http://raspbian.raspberrypi.org/raspbian.public.key;sha256sum=ca59cd4f2bcbc3a1d41ba6815a02a8dc5c175467a59bd87edeac458f4a5345de"
 DISTRO_BOOTSTRAP_KEYS:arm64 = ""
+DISTRO_BOOTSTRAP_BASE_PACKAGES:append = " usrmerge"
 
 DISTRO_KERNELS ?= "kernel kernel7 kernel7l kernel8"
 
diff --git a/meta-isar/conf/distro/ubuntu-common.inc b/meta-isar/conf/distro/ubuntu-common.inc
index d3374baa..88a3b4f0 100644
--- a/meta-isar/conf/distro/ubuntu-common.inc
+++ b/meta-isar/conf/distro/ubuntu-common.inc
@@ -16,6 +16,10 @@ BOOTSTRAP_KEY = "file://${LAYERDIR_isar}/conf/distro/ubuntu.public.key;sha256sum
 DISTRO_BOOTSTRAP_KEYS += "${BOOTSTRAP_KEY}"
 HOST_DISTRO_BOOTSTRAP_KEYS += "${BOOTSTRAP_KEY}"
 
+# from noble on this package does not exist anymore, before it is needed
+DISTRO_BOOTSTRAP_BASE_PACKAGES:append:focal = " usrmerge"
+DISTRO_BOOTSTRAP_BASE_PACKAGES:append:jammy = " usrmerge"
+
 # kernel package name is linux-image-generic in Ubuntu
 KERNEL_NAME = "generic"
 
diff --git a/meta/conf/distro/debian-common.conf b/meta/conf/distro/debian-common.conf
index b5d8aa9a..8da17d6f 100644
--- a/meta/conf/distro/debian-common.conf
+++ b/meta/conf/distro/debian-common.conf
@@ -39,6 +39,10 @@ SYSTEMD_BOOTLOADER_INSTALL:buster = "systemd:${DISTRO_ARCH}"
 COMPAT_DISTRO_ARCH:amd64 = "i386"
 COMPAT_DISTRO_ARCH:arm64 = "armhf"
 
+# from debian 12 on, this is referenced by init-system-helpers, before it is needed
+DISTRO_BOOTSTRAP_BASE_PACKAGES:append:buster = " usrmerge"
+DISTRO_BOOTSTRAP_BASE_PACKAGES:append:bullseye = " usrmerge"
+
 # snapshot mirror for reproducible builds
 DISTRO_APT_SNAPSHOT_PREMIRROR ??= " \
     deb.debian.org/(debian-security)/? snapshot.debian.org/archive/\1/${@d.getVarFlag('ISAR_APT_SNAPSHOT_DATE', 'security')}\n \
diff --git a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
index 01ed1e59..931f6f13 100644
--- a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
+++ b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
@@ -11,7 +11,7 @@ inherit deb-dl-dir
 
 FILESEXTRAPATHS:append = ":${LAYERDIR_core}/recipes-core/isar-bootstrap/files"
 
-DISTRO_BOOTSTRAP_BASE_PACKAGES += "locales apt usrmerge"
+DISTRO_BOOTSTRAP_BASE_PACKAGES += "locales apt"
 DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = " ca-certificates"
 
 BOOTSTRAP_TMPDIR = "${WORKDIR}/tempdir"
-- 
2.39.5

-- 
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/20241219110010.389690-3-felix.moessbauer%40siemens.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] bootstrap: space-separate base packages
  2024-12-19 11:00 [PATCH 1/3] bootstrap: space-separate base packages 'Felix Moessbauer' via isar-users
  2024-12-19 11:00 ` [PATCH 2/3] bootstrap: make DISTRO_BOOTSTRAP_BASE_PACKAGES changeable 'Felix Moessbauer' via isar-users
  2024-12-19 11:00 ` [PATCH 3/3] make usage of usrmerge distro dependent 'Felix Moessbauer' via isar-users
@ 2024-12-24 11:58 ` Uladzimir Bely
  2 siblings, 0 replies; 4+ messages in thread
From: Uladzimir Bely @ 2024-12-24 11:58 UTC (permalink / raw)
  To: Felix Moessbauer, isar-users

On Thu, 2024-12-19 at 12:00 +0100, 'Felix Moessbauer' via isar-users
wrote:
> The variable DISTRO_BOOTSTRAP_BASE_PACKAGES contains a list of base
> packages that need to be included when bootstrapping. This list was
> comma separated for technical reasons, which made it hard to append
> or
> remove from that list. Instead, we now make it space separated and
> join
> it by comma where needed.
> 
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>  meta/recipes-core/isar-bootstrap/isar-bootstrap.inc   | 7 ++++---
>  meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc | 7 ++++---
>  2 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> index f9dae26a..6a612852 100644
> --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> @@ -14,8 +14,8 @@ PV = "1.0"
>  DEBOOTSTRAP ?= "qemu-debootstrap"
>  ROOTFSDIR = "${WORKDIR}/rootfs"
>  DISTRO_BOOTSTRAP_BASE_PACKAGES = "locales"
> -DISTRO_BOOTSTRAP_BASE_PACKAGES:append:gnupg = ",gnupg"
> -DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = ",ca-
> certificates"
> +DISTRO_BOOTSTRAP_BASE_PACKAGES:append:gnupg = " gnupg"
> +DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = " ca-
> certificates"
>  
>  inherit deb-dl-dir
>  
> @@ -79,13 +79,14 @@ do_bootstrap[network] =
> "${TASK_USE_NETWORK_AND_SUDO}"
>  
>  inherit compat
>  
> +do_bootstrap[vardeps] += "DISTRO_BOOTSTRAP_BASE_PACKAGES"
>  do_bootstrap() {
>      if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
>          if [ -z "${COMPAT_DISTRO_ARCH}" ]; then
>              bbfatal "${DISTRO_ARCH} does not have a compat arch"
>          fi
>      fi
> -    debootstrap_args="--verbose --variant=minbase --
> include=${DISTRO_BOOTSTRAP_BASE_PACKAGES}"
> +    debootstrap_args="--verbose --variant=minbase --
> include=${@','.join(d.getVar('DISTRO_BOOTSTRAP_BASE_PACKAGES').split(
> ))}"
>      if [ -f "${DISTRO_BOOTSTRAP_KEYRING}" ]; then
>          debootstrap_args="$debootstrap_args --
> keyring=${DISTRO_BOOTSTRAP_KEYRING}"
>      fi
> diff --git a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
> b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
> index d7ddffdc..0f2e6dc9 100644
> --- a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
> +++ b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
> @@ -11,8 +11,8 @@ inherit deb-dl-dir
>  
>  FILESEXTRAPATHS:append = ":${LAYERDIR_core}/recipes-core/isar-
> bootstrap/files"
>  
> -DISTRO_BOOTSTRAP_BASE_PACKAGES = "locales,apt,usrmerge"
> -DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = ",ca-
> certificates"
> +DISTRO_BOOTSTRAP_BASE_PACKAGES = "locales apt usrmerge"
> +DISTRO_BOOTSTRAP_BASE_PACKAGES:append:https-support = " ca-
> certificates"
>  
>  BOOTSTRAP_TMPDIR = "${WORKDIR}/tempdir"
>  
> @@ -85,13 +85,14 @@ do_bootstrap[network] =
> "${TASK_USE_NETWORK_AND_SUDO}"
>  
>  DEB_DL_LOCK ?= "${DEBDIR}/${BOOTSTRAP_BASE_DISTRO}-
> ${BASE_DISTRO_CODENAME}.lock"
>  
> +do_bootstrap[vardeps] += "DISTRO_BOOTSTRAP_BASE_PACKAGES"
>  do_bootstrap() {
>      if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
>          if [ -z "${COMPAT_DISTRO_ARCH}" ]; then
>              bbfatal "${DISTRO_ARCH} does not have a compat arch"
>          fi
>      fi
> -    bootstrap_args="--verbose --variant=minbase --
> include=${DISTRO_BOOTSTRAP_BASE_PACKAGES}"
> +    bootstrap_args="--verbose --variant=minbase --
> include=${@','.join(d.getVar('DISTRO_BOOTSTRAP_BASE_PACKAGES').split(
> ))}"
>      if [ -f "${DISTRO_BOOTSTRAP_KEYRING}" ]; then
>          bootstrap_args="$bootstrap_args --
> keyring=${DISTRO_BOOTSTRAP_KEYRING}"
>          cp "${DISTRO_BOOTSTRAP_KEYRING}" "${WORKDIR}/trusted.gpg.d/"
> -- 
> 2.39.5
> 

Applied to next, thanks.

-- 
Best regards,
Uladzimir.



-- 
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/4babb56c3c2f00234d63d5cea519dc9918a53487.camel%40ilbers.de.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-24 11:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-19 11:00 [PATCH 1/3] bootstrap: space-separate base packages 'Felix Moessbauer' via isar-users
2024-12-19 11:00 ` [PATCH 2/3] bootstrap: make DISTRO_BOOTSTRAP_BASE_PACKAGES changeable 'Felix Moessbauer' via isar-users
2024-12-19 11:00 ` [PATCH 3/3] make usage of usrmerge distro dependent 'Felix Moessbauer' via isar-users
2024-12-24 11:58 ` [PATCH 1/3] bootstrap: space-separate base packages Uladzimir Bely

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