public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH proxmox-backup/proxmox-backup-restore-image] update and adapt to ZFS 2.3 and kernel 6.14
@ 2025-06-02  9:47 Stoiko Ivanov
  2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup-restore-image 1/5] build initramfs: usr-merge initramfs Stoiko Ivanov
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Stoiko Ivanov @ 2025-06-02  9:47 UTC (permalink / raw)
  To: pbs-devel, pve-devel

While checking our codebase for potential uses of non-usr-merged paths
for ZFS I noticed the file-restore uses absolute paths for most commands.

As the daemon runs in an isolated environment we provide sticking to
absolute paths, instead of adding a PATH variable for Command::new to
search seems a sensible option.

Instead this patch creates a usr-merged environment in the initramfs,
to prevent issues occuring with changed paths in future packages.

During testing a change in `zpool import` was found, resulting in the patch
for proxmox-backup.

Additionally I looked through the kernel config options for newly added
filesystems to add.

Tested minimally with a backup of a VM containing a zpool.

proxmox-backup-restore-image:
Stoiko Ivanov (5):
  build initramfs: usr-merge initramfs
  update ZFS to 2.3.2
  build initramfs: remove additional ZFS scripts
  update ubuntu-kernel to Ubuntu-6.14.0-22.22
  kernel: enable more filesystem options

 src/build_initramfs.sh       | 10 ++++++++--
 src/config-base              | 10 +++++++++-
 src/submodules/ubuntu-kernel |  2 +-
 src/submodules/zfsonlinux    |  2 +-
 4 files changed, 19 insertions(+), 5 deletions(-)

proxmox-backup:
Stoiko Ivanov (1):
  restore-daemon: adapt to zpool output changes in 2.3

 proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH proxmox-backup-restore-image 1/5] build initramfs: usr-merge initramfs
  2025-06-02  9:47 [pve-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
  2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup-restore-image 2/5] update ZFS to 2.3.2 Stoiko Ivanov
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stoiko Ivanov @ 2025-06-02  9:47 UTC (permalink / raw)
  To: pbs-devel, pve-devel

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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH proxmox-backup-restore-image 2/5] update ZFS to 2.3.2
  2025-06-02  9:47 [pve-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 ` [pve-devel] [PATCH proxmox-backup-restore-image 1/5] build initramfs: usr-merge initramfs Stoiko Ivanov
@ 2025-06-02  9:47 ` Stoiko Ivanov
  2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup-restore-image 3/5] build initramfs: remove additional ZFS scripts Stoiko Ivanov
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stoiko Ivanov @ 2025-06-02  9:47 UTC (permalink / raw)
  To: pbs-devel, pve-devel

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/submodules/zfsonlinux | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/submodules/zfsonlinux b/src/submodules/zfsonlinux
index 55dd24c..92f430b 160000
--- a/src/submodules/zfsonlinux
+++ b/src/submodules/zfsonlinux
@@ -1 +1 @@
-Subproject commit 55dd24c4ccee2da61d5396289ef560f9b7bc6a68
+Subproject commit 92f430b00f42964b63aee373fbf6598a20f6c0cc
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH proxmox-backup-restore-image 3/5] build initramfs: remove additional ZFS scripts
  2025-06-02  9:47 [pve-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 ` [pve-devel] [PATCH proxmox-backup-restore-image 1/5] build initramfs: usr-merge initramfs Stoiko Ivanov
  2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup-restore-image 2/5] update ZFS to 2.3.2 Stoiko Ivanov
@ 2025-06-02  9:47 ` Stoiko Ivanov
  2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup-restore-image 4/5] update ubuntu-kernel to Ubuntu-6.14.0-22.22 Stoiko Ivanov
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stoiko Ivanov @ 2025-06-02  9:47 UTC (permalink / raw)
  To: pbs-devel, pve-devel

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/build_initramfs.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/build_initramfs.sh b/src/build_initramfs.sh
index 52a50c3..0cccb90 100755
--- a/src/build_initramfs.sh
+++ b/src/build_initramfs.sh
@@ -104,6 +104,7 @@ if [ -z "$DOWNLOAD_ONLY" ]; then
     rm -rf ${ROOT:?}/usr/share # contains only docs and debian stuff
     rm -rf ${ROOT:?}/usr/local/include # header files
     rm -rf ${ROOT:?}/usr/local/share # mostly ZFS tests
+    rm -rf ${ROOT:?}/usr/lib/zfs-linux # zpool.d/zed.d snippets, zpool_influxdb
     rm -f ${ROOT:?}/lib/x86_64-linux-gnu/*.a # static libraries
     rm -f ${ROOT:?}/lib/x86_64-linux-gnu/*.la # libtool info files
     strip -s  ${ROOT:?}/sbin/* ||true
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH proxmox-backup-restore-image 4/5] update ubuntu-kernel to Ubuntu-6.14.0-22.22
  2025-06-02  9:47 [pve-devel] [PATCH proxmox-backup/proxmox-backup-restore-image] update and adapt to ZFS 2.3 and kernel 6.14 Stoiko Ivanov
                   ` (2 preceding siblings ...)
  2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup-restore-image 3/5] build initramfs: remove additional ZFS scripts Stoiko Ivanov
@ 2025-06-02  9:47 ` Stoiko Ivanov
  2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup-restore-image 5/5] kernel: enable more filesystem options Stoiko Ivanov
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stoiko Ivanov @ 2025-06-02  9:47 UTC (permalink / raw)
  To: pbs-devel, pve-devel

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/submodules/ubuntu-kernel | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/submodules/ubuntu-kernel b/src/submodules/ubuntu-kernel
index 9f8b45f..2591c2a 160000
--- a/src/submodules/ubuntu-kernel
+++ b/src/submodules/ubuntu-kernel
@@ -1 +1 @@
-Subproject commit 9f8b45f5f8dbd6093b7ff71750bc6eb762fc8b20
+Subproject commit 2591c2ac99fc6fcedb56aeba132d99351753f522
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH proxmox-backup-restore-image 5/5] kernel: enable more filesystem options
  2025-06-02  9:47 [pve-devel] [PATCH proxmox-backup/proxmox-backup-restore-image] update and adapt to ZFS 2.3 and kernel 6.14 Stoiko Ivanov
                   ` (3 preceding siblings ...)
  2025-06-02  9:47 ` [pve-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 ` Stoiko Ivanov
  2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup 1/1] restore-daemon: adapt to zpool output changes in 2.3 Stoiko Ivanov
  2025-06-03  8:59 ` [pve-devel] applied: [pbs-devel] [PATCH proxmox-backup/proxmox-backup-restore-image] update and adapt to ZFS 2.3 and kernel 6.14 Fabian Grünbichler
  6 siblings, 0 replies; 8+ messages in thread
From: Stoiko Ivanov @ 2025-06-02  9:47 UTC (permalink / raw)
  To: pbs-devel, pve-devel

options selected with looking through make menuconfig based on current
config-base in kernel 6.14.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/config-base | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/config-base b/src/config-base
index edd95c1..fcebf07 100644
--- a/src/config-base
+++ b/src/config-base
@@ -133,9 +133,13 @@ CONFIG_F2FS_FS_XATTR=y
 CONFIG_F2FS_FS_POSIX_ACL=y
 CONFIG_F2FS_FS_COMPRESSION=y
 CONFIG_F2FS_FS_LZO=y
+CONFIG_F2FS_FS_LZORLE=y
 CONFIG_F2FS_FS_LZ4=y
+CONFIG_F2FS_FS_LZ4HC=y
 CONFIG_F2FS_FS_ZSTD=y
-CONFIG_F2FS_FS_LZORLE=y
+CONFIG_BCACHEFS_FS=y
+CONFIG_BCACHEFS_ERASURE_CODING=y
+CONFIG_BCACHEFS_POSIX_ACL=y
 CONFIG_HFS_FS=y
 CONFIG_HFSPLUS_FS=y
 CONFIG_BEFS_FS=y
@@ -143,8 +147,12 @@ CONFIG_SYSV_FS=y
 CONFIG_UFS_FS=y
 CONFIG_ISO9660_FS=y
 CONFIG_NTFS3_FS=y
+CONFIG_NTFS3_LZX_XPRESS=y
+CONFIG_NTFS3_FS_POSIX_ACL=y
 CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
+CONFIG_EXFAT_FS=y
+CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"
 
 # memory hotplug
 CONFIG_MEMORY_HOTPLUG=y
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH proxmox-backup 1/1] restore-daemon: adapt to zpool output changes in 2.3
  2025-06-02  9:47 [pve-devel] [PATCH proxmox-backup/proxmox-backup-restore-image] update and adapt to ZFS 2.3 and kernel 6.14 Stoiko Ivanov
                   ` (4 preceding siblings ...)
  2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup-restore-image 5/5] kernel: enable more filesystem options Stoiko Ivanov
@ 2025-06-02  9:47 ` Stoiko Ivanov
  2025-06-03  8:59 ` [pve-devel] applied: [pbs-devel] [PATCH proxmox-backup/proxmox-backup-restore-image] update and adapt to ZFS 2.3 and kernel 6.14 Fabian Grünbichler
  6 siblings, 0 replies; 8+ messages in thread
From: Stoiko Ivanov @ 2025-06-02  9:47 UTC (permalink / raw)
  To: pbs-devel, pve-devel

the output of `zpool import` has changed, thus our current parser
failed to find a zpool with zfs userspace in version 2.3.2.

While ZFS 2.3 introduced JSON output for many commands `zpool import`
still lacks the option [0], thus I'd postpone this adapation once all
needed zfs/zpool commands provide JSON.

the change was probably introduced in zfs upstream commit:
5137c132a ("zpool import output is not formated properly.")

[0] https://github.com/openzfs/zfs/issues/17084
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs b/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs
index 50fbf315..e068ab9b 100644
--- a/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs
+++ b/proxmox-restore-daemon/src/proxmox_restore_daemon/disk.rs
@@ -17,7 +17,7 @@ use pbs_api_types::BLOCKDEVICE_NAME_REGEX;
 
 const_regex! {
     VIRTIO_PART_REGEX = r"^vd[a-z]+(\d+)$";
-    ZPOOL_POOL_NAME_REGEX = r"^ {3}pool: (.*)$";
+    ZPOOL_POOL_NAME_REGEX = r"^ {2,3}pool: (.*)$";
     ZPOOL_IMPORT_DISK_REGEX = r"^\t {2,4}(vd[a-z]+(?:\d+)?)\s+ONLINE$";
 }
 
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] applied: [pbs-devel] [PATCH proxmox-backup/proxmox-backup-restore-image] update and adapt to ZFS 2.3 and kernel 6.14
  2025-06-02  9:47 [pve-devel] [PATCH proxmox-backup/proxmox-backup-restore-image] update and adapt to ZFS 2.3 and kernel 6.14 Stoiko Ivanov
                   ` (5 preceding siblings ...)
  2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup 1/1] restore-daemon: adapt to zpool output changes in 2.3 Stoiko Ivanov
@ 2025-06-03  8:59 ` Fabian Grünbichler
  6 siblings, 0 replies; 8+ messages in thread
From: Fabian Grünbichler @ 2025-06-03  8:59 UTC (permalink / raw)
  To: pbs-devel, pve-devel, Stoiko Ivanov


On Mon, 02 Jun 2025 11:47:50 +0200, Stoiko Ivanov wrote:
> While checking our codebase for potential uses of non-usr-merged paths
> for ZFS I noticed the file-restore uses absolute paths for most commands.
> 
> As the daemon runs in an isolated environment we provide sticking to
> absolute paths, instead of adding a PATH variable for Command::new to
> search seems a sensible option.
> 
> [...]

Applied with a small (unrelated) fixup to unbreak building in sbuild, thanks!

[1/5] build initramfs: usr-merge initramfs
      commit: 80f9c6bb6c0f57335e668dd0d00047ecb0208e3b
[2/5] update ZFS to 2.3.2
      commit: 2e15f400e6cd1346eabd91173379c637656fb9f9
[3/5] build initramfs: remove additional ZFS scripts
      commit: 981c292d479e972a215e564822c8b0b865acfd2d
[4/5] update ubuntu-kernel to Ubuntu-6.14.0-22.22
      commit: e0e3f3a69b39cd9f6bdb5ba609fbcee3d147f315
[5/5] kernel: enable more filesystem options
      commit: 1bab5440e4bf7744d3418ede065c56463d385933

Best regards,
-- 
Fabian Grünbichler <f.gruenbichler@proxmox.com>


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

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

end of thread, other threads:[~2025-06-03  8:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-02  9:47 [pve-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 ` [pve-devel] [PATCH proxmox-backup-restore-image 1/5] build initramfs: usr-merge initramfs Stoiko Ivanov
2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup-restore-image 2/5] update ZFS to 2.3.2 Stoiko Ivanov
2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup-restore-image 3/5] build initramfs: remove additional ZFS scripts Stoiko Ivanov
2025-06-02  9:47 ` [pve-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 ` [pve-devel] [PATCH proxmox-backup-restore-image 5/5] kernel: enable more filesystem options Stoiko Ivanov
2025-06-02  9:47 ` [pve-devel] [PATCH proxmox-backup 1/1] restore-daemon: adapt to zpool output changes in 2.3 Stoiko Ivanov
2025-06-03  8:59 ` [pve-devel] applied: [pbs-devel] [PATCH proxmox-backup/proxmox-backup-restore-image] update and adapt to ZFS 2.3 and kernel 6.14 Fabian Grünbichler

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