Package: release.debian.org
Severity: normal
Tags: bullseye
User: release.debian....@packages.debian.org
Usertags: pu
X-Debbugs-Cc: l...@packages.debian.org, alk...@gmail.com, vagr...@debian.org
Control: affects -1 + src:ltsp

Similar to the bookworm-pu #1050090 for ltsp, the same fix needs to land
in Debian bullseye. However, we gained more knowledge about it (see under
IMPORTANT below).

While preparing the initial Debian Edu 12 release, we came across a problem in
LTSP. Thin client machines and diskless workstations started failing to boot
from NFS-located chroot environments.

[ Reason ]
The underlying cause is a regression in the linux kernel since version 5.15
(see #1049885 [1]) for details.

A workaround could be found for LTSP in Debian 12 (it is not just a
Debian Edu problem). This upload provides this workaround and brings
back above named functionality (PXE-booting Debian systems via LTSP
when the system is a chroot tree on NFS).

IMPORTANT: Why provide this fix for bullseye then? The design in recent LTSP
is that the LTSP host creates a kind of ltsp-initrd containing the LTSP
software. This ltsp-initrd gets created by the host and is then used for
whatever target OS shall be booted. The kernel comes from the target OS, but
the ltsp-initrd comes from the LTSP host.

If one want to boot into a bookworm LTSP system (e.g. via PXE) and this bookworm
system gets served by a bullseye LTSP host, then the startup failed as described
in [1] occurs. So, the ltsp-initrd needs the proposed patch which needs to be
shipped in the Debian version of the LTSP host, thus (in this example) Debian
bullseye.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1049885

[ Impact ]
LTSP clients with a rootfs containing a kernel newer than 5.15 can't be booted
with LTSP (from a bullseye LTSP host) if rootfs is on NFS.

[ Tests ]
Manual tests on a Debian Edu 11 network.

[ Risks ]
Another regression might have been introduced into LTSP with that workaround.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]

+  * debian/patches:
+    + Add 0001_Avoid-mv-on-init-symlink-in-order-to-work-around-ove.patch
+      (cherry-picked from upstream). Avoid mv on init symlink in order to
+      work around overlayfs issue. (Closes: #1049397).

[ Other info ]
This issue has been discussed with and approved by LTSP upstream.

See: https://github.com/ltsp/ltsp/issues/860#issuecomment-1682047744
diff -Nru ltsp-21.01/debian/changelog ltsp-21.01/debian/changelog
--- ltsp-21.01/debian/changelog 2021-01-11 23:22:12.000000000 +0100
+++ ltsp-21.01/debian/changelog 2023-08-22 18:32:24.000000000 +0200
@@ -1,3 +1,12 @@
+ltsp (21.01-1+deb11u1) bullseye; urgency=medium
+
+  * debian/patches:
+    + Add 0001_Avoid-mv-on-init-symlink-in-order-to-work-around-ove.patch
+      (cherry-picked from upstream). Avoid mv on init symlink in order to
+      work around overlayfs issue. (Closes: #1049397).
+
+ -- Mike Gabriel <sunwea...@debian.org>  Tue, 22 Aug 2023 18:32:24 +0200
+
 ltsp (21.01-1) unstable; urgency=medium
 
   [ Alkis Georgopoulos ]
diff -Nru 
ltsp-21.01/debian/patches/0001_Avoid-mv-on-init-symlink-in-order-to-work-around-ove.patch
 
ltsp-21.01/debian/patches/0001_Avoid-mv-on-init-symlink-in-order-to-work-around-ove.patch
--- 
ltsp-21.01/debian/patches/0001_Avoid-mv-on-init-symlink-in-order-to-work-around-ove.patch
   1970-01-01 01:00:00.000000000 +0100
+++ 
ltsp-21.01/debian/patches/0001_Avoid-mv-on-init-symlink-in-order-to-work-around-ove.patch
   2023-08-22 18:32:24.000000000 +0200
@@ -0,0 +1,26 @@
+From 19ccbb7c4a5daeebacb4157bea772e26c3fb0f44 Mon Sep 17 00:00:00 2001
+From: gber <guido+github....@berhoerster.name>
+Date: Thu, 17 Aug 2023 09:45:49 +0200
+Subject: [PATCH] Avoid mv on init symlink in order to work around overlayfs
+ issue (#860)
+
+Signed-off-by: Mike Gabriel <mike.gabr...@das-netzwerkteam.de>
+---
+ ltsp/client/initrd-bottom/55-initrd-bottom.sh | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/ltsp/client/initrd-bottom/55-initrd-bottom.sh
++++ b/ltsp/client/initrd-bottom/55-initrd-bottom.sh
+@@ -80,8 +80,10 @@
+     fi
+     # To avoid specifying an init=, we override the real init.
+     # We can't mount --bind as it's in use by libraries and can't be 
unmounted.
+-    re mv "$rootmnt/sbin/init" "$rootmnt/sbin/init.ltsp"
+-    re ln -s ../../usr/share/ltsp/client/init/init "$rootmnt/sbin/init"
++    # With Linux 6.1 rename(2) on the symlink fails with ENXIO, so do not use
++    # mv for now (see #860).
++    re cp -a "$rootmnt/sbin/init" "$rootmnt/sbin/init.ltsp"
++    re ln -sf ../../usr/share/ltsp/client/init/init "$rootmnt/sbin/init"
+     # Jessie needs a 3.18+ kernel and this initramfs-tools hack:
+     if grep -qs jessie /etc/os-release; then
+         echo "init=${init:-/sbin/init}" >> /scripts/init-bottom/ORDER
diff -Nru ltsp-21.01/debian/patches/README ltsp-21.01/debian/patches/README
--- ltsp-21.01/debian/patches/README    1970-01-01 01:00:00.000000000 +0100
+++ ltsp-21.01/debian/patches/README    2023-08-22 18:30:35.000000000 +0200
@@ -0,0 +1,3 @@
+0xxx: Grabbed from upstream development.
+1xxx: Possibly relevant for upstream adoption.
+2xxx: Only relevant for official Debian release.
diff -Nru ltsp-21.01/debian/patches/series ltsp-21.01/debian/patches/series
--- ltsp-21.01/debian/patches/series    2021-01-11 20:45:10.000000000 +0100
+++ ltsp-21.01/debian/patches/series    2023-08-22 18:30:46.000000000 +0200
@@ -1 +1,2 @@
 0001-Prefer-resolvectl-over-systemd-resolve-367.patch
+0001_Avoid-mv-on-init-symlink-in-order-to-work-around-ove.patch

Reply via email to