From 4c534bc6bec13e4ea31a935e8b5fb0443fec0b47 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Tue, 8 Oct 2019 19:04:17 +0100 Subject: [PATCH] subiquity: Use LazyUnmount=yes on memorymapped /usr/lib/modules. Subiquity images mount /usr/lib/modules from a squashfs, which systemd tries to unmount on shutdown, whilst they are still being in use. As systemd-udevd kmod built-in's libkmod has modules.* files memorymapped. This produces an warning on shutdown, flooding the screen with messages as systemd switches to a more verbose output. Specify LazyUnmount=yes on that mount, such that unmount call succeeds without flooding the shutdown log. --- debian/changelog | 12 ++++++++++++ .../ubuntu-server/hooks/033-kernel-bits.binary | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1f5c4d38..885dc6dd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +livecd-rootfs (2.616) UNRELEASED; urgency=medium + + * Subiquity images mount /usr/lib/modules from a squashfs, which systemd + tries to unmount on shutdown, whilst they are still being in use. As + systemd-udevd kmod built-in's libkmod has modules.* files + memorymapped. This produces an warning on shutdown, flooding the + screen with messages as systemd switches to a more verbose + output. Specify LazyUnmount=yes on that mount, such that unmount call + succeeds without flooding the shutdown log. + + -- Dimitri John Ledkov Fri, 04 Oct 2019 19:35:56 +0100 + livecd-rootfs (2.615) eoan; urgency=medium * magic-proxy: dump proxy log to stdout on failure diff --git a/live-build/ubuntu-server/hooks/033-kernel-bits.binary b/live-build/ubuntu-server/hooks/033-kernel-bits.binary index 3506126e..4f7f9b95 100755 --- a/live-build/ubuntu-server/hooks/033-kernel-bits.binary +++ b/live-build/ubuntu-server/hooks/033-kernel-bits.binary @@ -67,8 +67,11 @@ prereqs) exit 0;; esac echo ${kernel_metapkg} > /run/kernel-meta-package -mkdir -p \$rootmnt/lib/modules -mount \$rootmnt/cdrom/casper/extras/modules.squashfs-$flavor \$rootmnt/lib/modules +mkdir -p \$rootmnt/usr/lib/modules +mount \$rootmnt/cdrom/casper/extras/modules.squashfs-$flavor \$rootmnt/usr/lib/modules +mkdir -p /run/systemd/system/usr-lib-modules.mount.d +echo '[Mount]' >> /run/systemd/system/usr-lib-modules.mount.d/lazy.conf +echo 'LazyUnmount=yes' >> /run/systemd/system/usr-lib-modules.mount.d/lazy.conf EOF chmod +x "$KERNEL_BITS_ROOT"/etc/initramfs-tools/scripts/init-bottom/live-server