From f1d2fe438d1ea0f227f85ffc86f99426ffd5b18c Mon Sep 17 00:00:00 2001 From: Jacek Konieczny Date: Thu, 5 Oct 2017 09:55:07 +0200 Subject: [PATCH] initrd-fstab-generator.patchfix fstab-generator for dracut Fixes bug which causes dracut-generated initramfs to fail with 'cannot mount /sysroot/sysroot/usr' on some systems. https://github.com/systemd/systemd/pull/6411 --- initrd-fstab-generator.patch | 29 +++++++++++++++++++++++++++++ systemd.spec | 4 +++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 initrd-fstab-generator.patch diff --git a/initrd-fstab-generator.patch b/initrd-fstab-generator.patch new file mode 100644 index 0000000..45b2fed --- /dev/null +++ b/initrd-fstab-generator.patch @@ -0,0 +1,29 @@ +From c7b2630c9154722e2295f3dbfbb19f3305676ecf Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 20 Jul 2017 13:38:46 +0200 +Subject: [PATCH] call chase_symlinks without the /sysroot prefix + +In case fstab-generator is called in the initrd, chase_symlinks() +returns with a canonical path "/sysroot/sysroot/", if the +"/sysroot" prefix is present in the path. + +This patch skips the "/sysroot" prefix for the chase_symlinks() call, +because "/sysroot" is already the root directory and chase_symlinks() +prepends the root directory in the canonical path returned. +--- + src/fstab-generator/fstab-generator.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c +index ea5ceb39ca..8fc4c8d179 100644 +--- a/src/fstab-generator/fstab-generator.c ++++ b/src/fstab-generator/fstab-generator.c +@@ -526,7 +526,7 @@ static int parse_fstab(bool initrd) { + continue; + } + +- where = initrd ? strappend("/sysroot/", me->mnt_dir) : strdup(me->mnt_dir); ++ where = strdup(me->mnt_dir); + if (!where) + return log_oom(); + diff --git a/systemd.spec b/systemd.spec index 07f5d2e..0e34af1 100644 --- a/systemd.spec +++ b/systemd.spec @@ -26,7 +26,7 @@ Summary(pl.UTF-8): systemd - zarządca systemu i usług dla Linuksa Name: systemd # Verify ChangeLog and NEWS when updating (since there are incompatible/breaking changes very often) Version: 234 -Release: 2 +Release: 3 Epoch: 1 License: GPL v2+ (udev), LGPL v2.1+ (the rest) Group: Base @@ -75,6 +75,7 @@ Patch14: pld-pam-%{name}-user.patch Patch15: %{name}-seccomp_disable_on_i386.patch Patch16: %{name}-path.patch Patch17: cryptsetup-fix-infinite-timeout-6486.patch +Patch18: initrd-fstab-generator.patch URL: http://www.freedesktop.org/wiki/Software/systemd BuildRequires: acl-devel %{?with_audit:BuildRequires: audit-libs-devel} @@ -642,6 +643,7 @@ Uzupełnianie parametrów w zsh dla poleceń udev. %patch15 -p1 %patch16 -p1 %patch17 -p1 +%patch18 -p1 cp -p %{SOURCE2} src/systemd_booted.c -- 2.44.0