From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pbs-devel@lists.proxmox.com, pve-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup-restore-image 1/5] build initramfs: usr-merge initramfs
Date: Mon, 2 Jun 2025 11:47:51 +0200 [thread overview]
Message-ID: <20250602094756.519927-2-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20250602094756.519927-1-s.ivanov@proxmox.com>
usr-merged systems are default since bookworm [0].
the proxmox-restore-daemon otoh uses absolute paths to execute
commands inside the initramfs, without having a PATH set (which would
be used by Command::new (and execvpe(2) to resolve a relative
command).
merging all directories as on regular debian system ensures that the
restore-daemon does not need adapations based on the paths used in
upstream (and our) debian packages.
Found while looking through potential pitfalls due to ZFS usrmerge.
The change to the dpkg-deb invocation is based on what a quick look
through dpkg-sources [1] say dpkg does to unpack archives, as
`dpkg-deb -x` removed the symlinks to create a directory.
[0] https://wiki.debian.org/UsrMerge
[1] https://salsa.debian.org/dpkg-team/dpkg/-/blob/main/src/main/unpack.c?ref_type=heads#L1544
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
src/build_initramfs.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/build_initramfs.sh b/src/build_initramfs.sh
index 1ed0177..52a50c3 100755
--- a/src/build_initramfs.sh
+++ b/src/build_initramfs.sh
@@ -15,7 +15,12 @@ if [ -d pkgs ]; then
NO_DOWNLOAD="1"
fi
cd "$BUILDDIR"
-mkdir "$ROOT"
+mkdir -p "$ROOT/usr"
+
+for dir in "bin" "sbin" "lib" "lib32" "lib64" ; do
+ mkdir "$ROOT/usr/$dir"
+ ln -sr "$ROOT/usr/$dir" "$ROOT/$dir"
+done
# adds necessary packages to initramfs build root folder
add_pkgs() {
@@ -44,7 +49,7 @@ add_pkgs() {
fi
if [ -z "$DOWNLOAD_ONLY" ]; then
for deb in pkgs/$debdir/*.deb; do
- dpkg-deb -x "$deb" "$ROOT"
+ dpkg-deb --fsys-tarfile "$deb" |tar -C "$ROOT" --keep-directory-symlink -x
done
fi
}
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2025-06-02 9:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-02 9:47 [pbs-devel] [PATCH proxmox-backup/proxmox-backup-restore-image] update and adapt to ZFS 2.3 and kernel 6.14 Stoiko Ivanov
2025-06-02 9:47 ` Stoiko Ivanov [this message]
2025-06-02 9:47 ` [pbs-devel] [PATCH proxmox-backup-restore-image 2/5] update ZFS to 2.3.2 Stoiko Ivanov
2025-06-02 9:47 ` [pbs-devel] [PATCH proxmox-backup-restore-image 3/5] build initramfs: remove additional ZFS scripts Stoiko Ivanov
2025-06-02 9:47 ` [pbs-devel] [PATCH proxmox-backup-restore-image 4/5] update ubuntu-kernel to Ubuntu-6.14.0-22.22 Stoiko Ivanov
2025-06-02 9:47 ` [pbs-devel] [PATCH proxmox-backup-restore-image 5/5] kernel: enable more filesystem options Stoiko Ivanov
2025-06-02 9:47 ` [pbs-devel] [PATCH proxmox-backup 1/1] restore-daemon: adapt to zpool output changes in 2.3 Stoiko Ivanov
2025-06-03 8:59 ` [pbs-devel] applied: [PATCH proxmox-backup/proxmox-backup-restore-image] update and adapt to ZFS 2.3 and kernel 6.14 Fabian Grünbichler
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=20250602094756.519927-2-s.ivanov@proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
--cc=pve-devel@lists.proxmox.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal