diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 21:29:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 21:29:23 +0000 |
commit | e22458791b17a7cc55d865006dcc66a70b69b6c8 (patch) | |
tree | 895518de19c38fe9df6fe2b9bdb1f46d75f76d81 /debian | |
parent | Reserving virtual terminal on position 2 in logind. (diff) | |
download | systemd-e22458791b17a7cc55d865006dcc66a70b69b6c8.tar.xz systemd-e22458791b17a7cc55d865006dcc66a70b69b6c8.zip |
Mounting /etc/hostname as /run/host/hostname in systemd-nspawn container.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian')
-rw-r--r-- | debian/patches/progress-linux/0005-nspawn-hostname.patch | 17 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/debian/patches/progress-linux/0005-nspawn-hostname.patch b/debian/patches/progress-linux/0005-nspawn-hostname.patch new file mode 100644 index 0000000..275ed17 --- /dev/null +++ b/debian/patches/progress-linux/0005-nspawn-hostname.patch @@ -0,0 +1,17 @@ +Author: Daniel Baumann <daniel.baumann@progress-linux.org> +Description: Mount /etc/hostname as /run/host/hostname in systemd-nspawn container. + +diff -Naurp systemd.orig/src/nspawn/nspawn-mount.c systemd/src/nspawn/nspawn-mount.c +--- systemd.orig/src/nspawn/nspawn-mount.c ++++ systemd/src/nspawn/nspawn-mount.c +@@ -553,6 +553,10 @@ int mount_all(const char *dest, + MOUNT_FATAL|MOUNT_MKDIR }, + { "/run/host", "/run/host", NULL, NULL, MS_BIND, + MOUNT_FATAL|MOUNT_MKDIR|MOUNT_PREFIX_ROOT }, /* Prepare this so that we can make it read-only when we are done */ ++ { "/etc/hostname", "/run/host/hostname", NULL, NULL, MS_BIND, ++ MOUNT_TOUCH }, /* As per kernel interface requirements, bind mount first (creating mount points) and make read-only later */ ++ { NULL, "/run/host/hostname", NULL, NULL, MS_BIND|MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REMOUNT, ++ MOUNT_FATAL }, + { "/etc/os-release", "/run/host/os-release", NULL, NULL, MS_BIND, + MOUNT_TOUCH }, /* As per kernel interface requirements, bind mount first (creating mount points) and make read-only later */ + { "/usr/lib/os-release", "/run/host/os-release", NULL, NULL, MS_BIND, diff --git a/debian/patches/series b/debian/patches/series index a151663..ef33560 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -22,3 +22,4 @@ progress-linux/0001-agetty-nohostname.patch progress-linux/0002-proc-hidepid.patch progress-linux/0003-logind-noautovts.patch progress-linux/0004-logind-reservevt.patch +progress-linux/0005-nspawn-hostname.patch |