From 1f00f0725912a131451990c7c308c7202d86de61 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 13 Mar 2014 01:50:24 +0000 Subject: [PATCH 1/4] fix(sys-apps/systemd) allow booting without /etc/os-release systemd will not boot if /etc/os-release is not present. We "know" better, and can recover from a lost /etc/ directory, so patch out the test. This is only for "real" booting, not for nspawn containers at this point in time as we aren't booting full system images that way. Yet. --- .../files/handle-empty-etc-os-release.patch | 25 +++++++++++++++++++ ...stemd-211.ebuild => systemd-211-r1.ebuild} | 4 +++ 2 files changed, 29 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/handle-empty-etc-os-release.patch rename sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/{systemd-211.ebuild => systemd-211-r1.ebuild} (99%) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/handle-empty-etc-os-release.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/handle-empty-etc-os-release.patch new file mode 100644 index 0000000000..c4c7654e3c --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/handle-empty-etc-os-release.patch @@ -0,0 +1,25 @@ +From foo@baz Wed Mar 12 23:13:38 +0000 +Date: Wed, 12 Mar 2014 23:13:38 +0000 +From: Greg Kroah-Hartman +Subject: Handle empty /etc/os-release + +systemd uses /etc/os-release as a "flag" file to see if the filesystem +really is an operating system image or not. As we "know" we will always +boot a valid filesystem, and we want to be able to handle an empty /etc +directory (tmpfiles will recreate it, it is a symlink) just comment out +the check and move on with our lives. + + +diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c +index 30f28b6e2cd6..a270834f47d8 100644 +--- a/src/core/dbus-manager.c ++++ b/src/core/dbus-manager.c +@@ -1133,7 +1133,7 @@ static int method_switch_root(sd_bus *bus, sd_bus_message *message, void *userda + + /* Safety check */ + if (isempty(init)) { +- if (! path_is_os_tree(root)) ++ if (0) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Specified switch root path %s does not seem to be an OS tree. /etc/os-release is missing.", root); + } else { + _cleanup_free_ char *p = NULL; diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211-r1.ebuild similarity index 99% rename from sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211.ebuild rename to sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211-r1.ebuild index 1fbbc7fda4..c48f056633 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211-r1.ebuild @@ -105,6 +105,10 @@ KEYWORDS= fi src_prepare() { + # CoreOs specific hacks^Wfeatures + epatch "${FILESDIR}"/211-handle-empty-etc-os-release.patch + + # upstream fixes not yet in the release epatch "${FILESDIR}"/211-tmpfiles.patch if [[ ${PV} == *9999 ]]; then From 06b3b6fee86ffa8cad62488e7275d40ac2ca7128 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 13 Mar 2014 23:11:02 +0000 Subject: [PATCH 2/4] bump(sys-apps/systemd) Manifest update --- .../src/third_party/coreos-overlay/sys-apps/systemd/Manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/Manifest b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/Manifest index f41718aae1..b3c4bf25f2 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/Manifest +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/Manifest @@ -1,2 +1,2 @@ DIST systemd-207.tar.xz 2363804 SHA256 ac1f8120315e7969063bbb0c181c8dc59509aeaf10c4266077c257a182ad5942 SHA512 566c6126fea038cb182608f7b9c3bb4410d0622cb637f30c60fba73c9052f7a36d2b0f790e3d94bb751080448ba14cee600481da378f5e97b0f5becfc849be54 WHIRLPOOL 823c3064e1e961599011d4cd027f5e2d0ba3b434c67b880d1a541720220f40c7cc82211f3f086042dbb440b2c7e11e1379aa0d656e33a2a7ba5b1d7e45b904f7 -DIST systemd-209.tar.xz 2607304 SHA256 4cadef26adcd846e3f2b90502e64f590430baf59aea87491d25aac2e50b23d18 SHA512 0d9a4f1f69b51da0621f15c2e0fde94540be767117b97298a66eab79ecb8bc0288fd7c568253be3a48a4c6d4881a822bf84434dc17028fc6f8a94fa1cc1b27cb WHIRLPOOL bebcb5fa76f91788c30ce6320e9c51325dd3b2f9ce81509e822f3f2a510b252c38aa3de19f429db6fbb2d7f0be9cfb6e7c6908041361fcd3f0350482a78e7d20 +DIST systemd-211.tar.xz 2664508 SHA256 f278c1ff6f0f0efadf0f7fff01ed6a0ead1a7868b5a9e1baa240e1673e516648 SHA512 fd33920825d0b63bf6e6a583cbfbf44fe577428f5fa6993b659d7f310f8fbdb3f5b22d585818ec4b834fd0703bc5d6bf93e6925e5c391f14ee65f44c0878d5e5 WHIRLPOOL 26205fc02cb13fb8f43c23888d83c31daa676c117a32e65adbc372e8eb974fe7e37f560b85b72abb4cfc832a45a6658858a1cca17a526baa967ba2d95904a448 From 99ab86de80115edab51c38a4b6449ace8a6a66a2 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 13 Mar 2014 23:11:41 +0000 Subject: [PATCH 3/4] fix(sys-apps/systemd) move the patch to the proper filename The ebuild was expecting a different name for this patch, so fix it. --- ...etc-os-release.patch => 211-handle-empty-etc-os-release.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/{handle-empty-etc-os-release.patch => 211-handle-empty-etc-os-release.patch} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/handle-empty-etc-os-release.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/211-handle-empty-etc-os-release.patch similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/handle-empty-etc-os-release.patch rename to sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/211-handle-empty-etc-os-release.patch From 082e4ab8c572c1ff2e0d77708c35f48994d453d1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 13 Mar 2014 23:13:13 +0000 Subject: [PATCH 4/4] fix(sys-apps/systemd) add mkdir bugfix from @philips --- ...-allow-EEXIST-on-mkdir_safe-home-uid.patch | 28 +++++++++++++++++++ .../sys-apps/systemd/systemd-211-r1.ebuild | 1 + 2 files changed, 29 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/211-0001-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/211-0001-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/211-0001-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch new file mode 100644 index 0000000000..856dde869c --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/files/211-0001-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch @@ -0,0 +1,28 @@ +From aca07d5e53da1970b31907fc07237800424e84f1 Mon Sep 17 00:00:00 2001 +From: Brandon Philips +Date: Thu, 13 Mar 2014 15:19:40 -0700 +Subject: [PATCH] nspawn: allow -EEXIST on mkdir_safe /home/${uid} + +With systemd 211 nspawn attempts to create the home directory for the +given uid. However, if the home directory already exists then it will +fail. Don't error out on -EEXIST. +--- + src/nspawn/nspawn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c +index b637b51..7c3d7b8 100644 +--- a/src/nspawn/nspawn.c ++++ b/src/nspawn/nspawn.c +@@ -2543,7 +2543,7 @@ static int change_uid_gid(char **_home) { + } + + r = mkdir_safe(home, 0755, uid, gid); +- if (r < 0) { ++ if (r < 0 && r != -EEXIST) { + log_error("Failed to make home directory: %s", strerror(-r)); + return r; + } +-- +1.8.5.2 (Apple Git-48) + diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211-r1.ebuild index c48f056633..d7770e34d2 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-211-r1.ebuild @@ -110,6 +110,7 @@ src_prepare() { # upstream fixes not yet in the release epatch "${FILESDIR}"/211-tmpfiles.patch + epatch "${FILESDIR}"/211-0001-nspawn-allow-EEXIST-on-mkdir_safe-home-uid.patch if [[ ${PV} == *9999 ]]; then if use doc; then