From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH v8 3/8] meta: Fix missing dpkg available
Date: Mon, 11 Mar 2024 17:31:06 +0200 [thread overview]
Message-ID: <20240311153111.3772144-4-amikan@ilbers.de> (raw)
In-Reply-To: <20240311153111.3772144-1-amikan@ilbers.de>
In some distros /var/lib/dpkg/available is required for
do_rootfs_install task.
The fix for it is present in jessie-or-older mmdebstrap hook in
Bookworm and later, but maybe-jessie-or-older wrapper do not handle
distro version check correctly.
That's why we need to check and apply hook manually or create
/var/lib/dpkg/available by hand for older distros.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 80a7e90d..9c161aab 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -37,6 +37,17 @@ FILESEXTRAPATHS:append = ":${BBPATH}"
inherit deb-dl-dir
+# Fix for /var/lib/apt/available while maybe-jessie-or-older hook do not work
+MM_HOOK_JESSIE = "/usr/share/mmdebstrap/hooks/jessie-or-older"
+DPKG_HOOKS ?= "${@'--hook-dir='+d.getVar('MM_HOOK_JESSIE') \
+ if os.path.isdir(d.getVar('MM_HOOK_JESSIE')) \
+ else '--customize-hook=\'touch /var/lib/dpkg/available\''}"
+MMHOOKS:ubuntu-focal ?= "${DPKG_HOOKS}"
+MMHOOKS:debian-buster ?= "${DPKG_HOOKS}"
+
+def get_distro_suite(d):
+ return get_distro_primary_source_entry(d)[1]
+
python () {
distro_bootstrap_keys = (d.getVar("DISTRO_BOOTSTRAP_KEYS") or "").split()
third_party_apt_keys = (d.getVar("THIRD_PARTY_APT_KEYS") or "").split()
@@ -303,6 +314,7 @@ do_bootstrap() {
sudo TMPDIR="${BOOTSTRAP_TMPDIR}" mmdebstrap $bootstrap_args \
$arch_param \
--mode=unshare \
+ ${MMHOOKS} \
${@get_distro_components_argument(d)} \
"${@get_distro_suite(d)}" \
"${WORKDIR}/rootfs.tar.zst" \
--
2.34.1
next prev parent reply other threads:[~2024-03-11 15:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 15:31 [PATCH v8 0/8] Migrate to mmdebstrap Anton Mikanovich
2024-03-11 15:31 ` [PATCH v8 1/8] meta: Preinstall apt for Ubuntu and RPi targets Anton Mikanovich
2024-03-11 15:31 ` [PATCH v8 2/8] meta: Switch to mmdebstrap Anton Mikanovich
2024-03-11 15:31 ` Anton Mikanovich [this message]
2024-03-11 15:31 ` [PATCH v8 4/8] isar-bootstrap: Move preparations to hooks Anton Mikanovich
2024-03-11 15:31 ` [PATCH v8 5/8] isar-bootstrap: Use tar output instead of directory Anton Mikanovich
2024-03-11 15:31 ` [PATCH v8 6/8] user_manual.md: Replace debootstrap with mmdebstrap Anton Mikanovich
2024-03-11 15:31 ` [PATCH v8 7/8] user_manual.md: Update minimal host requirements Anton Mikanovich
2024-03-11 15:31 ` [PATCH v8 8/8] isar-bootstrap: Remove unused code Anton Mikanovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240311153111.3772144-4-amikan@ilbers.de \
--to=amikan@ilbers.de \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox