diff --git a/debian/patches/apertis/Add-usr-to-non-unmountable-list.patch b/debian/patches/apertis/Add-usr-to-non-unmountable-list.patch new file mode 100644 index 0000000000000000000000000000000000000000..6f25ee5b44a706a6bbb313c8e0e968b1a6d0ab7c --- /dev/null +++ b/debian/patches/apertis/Add-usr-to-non-unmountable-list.patch @@ -0,0 +1,42 @@ +From 753dadfde295b15826a414757c664c6a760e979b Mon Sep 17 00:00:00 2001 +From: Denis Pynkin <denis.pynkin@collabora.com> +Date: Wed, 10 Mar 2021 01:58:37 +0300 +Subject: [PATCH] Add /usr to non-unmountable list + +Debians systemd has split-usr enabled as both Debian and in principle Apertis +support both a split and a merged-usr setup. This mostly adds search paths to +system (e.g. to look at both `/bin/` and `/usr/bin`) however it also means that +if `/usr` is a mountpoint system will try to unmount it. Unfortunately this causes +issues at shutdown for systems with a merged-usr layout as basic libraries (e.g. libc) +are located in `/usr` making it impossible to unmount. + +For Apertis we don't support `/usr` being a seperate partition, the only time +`/usr` is on a mountpoint is when using ostree images (where it is a bind mount +and which use a merged-usr layout). So also add `/usr` to the list of paths that +are considered unmountable even with split-usr support enabled in systemd. + +Adding `/usr` to the non-unmountable list allows to avoid problems with +unmounting it for Apertis images. + +Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com> +--- + src/core/umount.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/core/umount.c b/src/core/umount.c +index 7af0195..26f4c11 100644 +--- a/src/core/umount.c ++++ b/src/core/umount.c +@@ -382,9 +382,7 @@ static int delete_dm(dev_t devnum) { + + static bool nonunmountable_path(const char *path) { + return path_equal(path, "/") +-#if ! HAVE_SPLIT_USR + || path_equal(path, "/usr") +-#endif + || path_startswith(path, "/run/initramfs"); + } + +-- +2.25.4 + diff --git a/debian/patches/series b/debian/patches/series index cc34f9607ce2a9aee0c0e5c09a43e7c7e0f967f2..52137f4559efce75f9e4fc10ee23d711e7e9e504 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -88,3 +88,4 @@ apertis/journalctl-add-new-relinquish-and-smart-relinquish-option.patch apertis/units-automatically-revert-to-run-logging-on-shutdown-if-.patch sd-boot-fix-menu-ordering-with-boot-counting.patch apertis/Force-the-call-of-systemd-journal-flush-before-var-u.patch +apertis/Add-usr-to-non-unmountable-list.patch