Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 1 | From 08cd165f5db0e68a499b80c4b1744a4206948259 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 2 | From: Chen Qi <Qi.Chen@windriver.com> |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 3 | Date: Thu, 21 Feb 2019 16:23:24 +0800 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 4 | Subject: [PATCH] binfmt: Don't install dependency links at install time for |
| 5 | the binfmt services |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 6 | |
| 7 | use [Install] blocks so that they get created when the service is enabled |
| 8 | like a traditional service. |
| 9 | |
| 10 | The [Install] blocks were rejected upstream as they don't have a way to |
| 11 | "enable" it on install without static symlinks which can't be disabled, |
| 12 | only masked. We however can do that in a postinst. |
| 13 | |
| 14 | Upstream-Status: Denied |
| 15 | |
| 16 | Signed-off-by: Ross Burton <ross.burton@intel.com> |
| 17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 18 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 19 | [rebased for systemd 243] |
| 20 | Signed-off-by: Scott Murray <scott.murray@konsulko.com> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 21 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 22 | --- |
| 23 | units/meson.build | 6 ++---- |
| 24 | units/proc-sys-fs-binfmt_misc.automount | 3 +++ |
| 25 | units/systemd-binfmt.service.in | 4 ++++ |
| 26 | 3 files changed, 9 insertions(+), 4 deletions(-) |
| 27 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 28 | diff --git a/units/meson.build b/units/meson.build |
| 29 | index 17e9ead9c1..e5502be620 100644 |
| 30 | --- a/units/meson.build |
| 31 | +++ b/units/meson.build |
| 32 | @@ -59,8 +59,7 @@ units = [ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 33 | ['poweroff.target', '', |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 34 | (with_runlevels ? 'runlevel0.target' : '')], |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 35 | ['printer.target', ''], |
| 36 | - ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT', |
| 37 | - 'sysinit.target.wants/'], |
| 38 | + ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT'], |
| 39 | ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'], |
| 40 | ['reboot.target', '', |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 41 | 'ctrl-alt-del.target' + (with_runlevels ? ' runlevel6.target' : '')], |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 42 | @@ -178,8 +177,7 @@ in_units = [ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 43 | ['rescue.service', ''], |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 44 | ['serial-getty@.service', ''], |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 45 | ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'], |
| 46 | - ['systemd-binfmt.service', 'ENABLE_BINFMT', |
| 47 | - 'sysinit.target.wants/'], |
| 48 | + ['systemd-binfmt.service', 'ENABLE_BINFMT'], |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 49 | ['systemd-bless-boot.service', 'ENABLE_EFI HAVE_BLKID'], |
| 50 | ['systemd-boot-check-no-failures.service', ''], |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 51 | ['systemd-coredump@.service', 'ENABLE_COREDUMP'], |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 52 | diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount |
| 53 | index 172c8757ab..f65d8930c6 100644 |
| 54 | --- a/units/proc-sys-fs-binfmt_misc.automount |
| 55 | +++ b/units/proc-sys-fs-binfmt_misc.automount |
| 56 | @@ -19,3 +19,6 @@ ConditionPathIsReadWrite=/proc/sys/ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 57 | |
| 58 | [Automount] |
| 59 | Where=/proc/sys/fs/binfmt_misc |
| 60 | + |
| 61 | +[Install] |
| 62 | +WantedBy=sysinit.target |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 63 | diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in |
| 64 | index fdafce7ff7..4efc05e495 100644 |
| 65 | --- a/units/systemd-binfmt.service.in |
| 66 | +++ b/units/systemd-binfmt.service.in |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 67 | @@ -14,6 +14,7 @@ Documentation=https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.htm |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 68 | Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems |
| 69 | DefaultDependencies=no |
| 70 | Conflicts=shutdown.target |
| 71 | +Wants=proc-sys-fs-binfmt_misc.automount |
| 72 | After=proc-sys-fs-binfmt_misc.automount |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 73 | After=proc-sys-fs-binfmt_misc.mount |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 74 | Before=sysinit.target shutdown.target |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 75 | @@ -30,3 +31,6 @@ RemainAfterExit=yes |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame^] | 76 | ExecStart={{ROOTLIBEXECDIR}}/systemd-binfmt |
| 77 | ExecStop={{ROOTLIBEXECDIR}}/systemd-binfmt --unregister |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 78 | TimeoutSec=90s |
| 79 | + |
| 80 | +[Install] |
| 81 | +WantedBy=sysinit.target |