blob: 2676c144f2f0f4b371af15136e8ed61e38780e20 [file] [log] [blame]
Andrew Geissler4ed12e12020-06-05 18:00:41 -05001From 564830719be2017c4953589d50f21a9e856a4ecc Mon Sep 17 00:00:00 2001
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08002From: Chen Qi <Qi.Chen@windriver.com>
Brad Bishop19323692019-04-05 15:28:33 -04003Date: Thu, 21 Feb 2019 16:23:24 +0800
Andrew Geissler82c905d2020-04-13 13:39:40 -05004Subject: [PATCH] binfmt: Don't install dependency links at install time for
5 the binfmt services
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08006
7use [Install] blocks so that they get created when the service is enabled
8like a traditional service.
9
10The [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,
12only masked. We however can do that in a postinst.
13
14Upstream-Status: Denied
15
16Signed-off-by: Ross Burton <ross.burton@intel.com>
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Brad Bishopa34c0302019-09-23 22:34:48 -040019[rebased for systemd 243]
20Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Andrew Geissler82c905d2020-04-13 13:39:40 -050021
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080022---
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
Andrew Geissler635e0e42020-08-21 15:58:33 -050028Index: systemd-stable/units/meson.build
29===================================================================
30--- systemd-stable.orig/units/meson.build
31+++ systemd-stable/units/meson.build
Andrew Geissler706d5aa2021-02-12 15:55:30 -060032@@ -54,8 +54,7 @@ units = [
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033 ['poweroff.target', '',
Andrew Geissler635e0e42020-08-21 15:58:33 -050034 (with_runlevels ? 'runlevel0.target' : '')],
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080035 ['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 Geissler706d5aa2021-02-12 15:55:30 -060041 (with_runlevels ? 'runlevel6.target ctrl-alt-del.target' : 'ctrl-alt-del.target')],
42@@ -162,8 +161,7 @@ in_units = [
Andrew Geissler82c905d2020-04-13 13:39:40 -050043 ['rc-local.service', 'HAVE_SYSV_COMPAT'],
44 ['rescue.service', ''],
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080045 ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'],
46- ['systemd-binfmt.service', 'ENABLE_BINFMT',
47- 'sysinit.target.wants/'],
48+ ['systemd-binfmt.service', 'ENABLE_BINFMT'],
Brad Bishop19323692019-04-05 15:28:33 -040049 ['systemd-bless-boot.service', 'ENABLE_EFI HAVE_BLKID'],
50 ['systemd-boot-check-no-failures.service', ''],
Andrew Geissler82c905d2020-04-13 13:39:40 -050051 ['systemd-coredump@.service', 'ENABLE_COREDUMP'],
Andrew Geissler635e0e42020-08-21 15:58:33 -050052Index: systemd-stable/units/proc-sys-fs-binfmt_misc.automount
53===================================================================
54--- systemd-stable.orig/units/proc-sys-fs-binfmt_misc.automount
55+++ systemd-stable/units/proc-sys-fs-binfmt_misc.automount
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080056@@ -18,3 +18,6 @@ ConditionPathIsReadWrite=/proc/sys/
57
58 [Automount]
59 Where=/proc/sys/fs/binfmt_misc
60+
61+[Install]
62+WantedBy=sysinit.target
Andrew Geissler635e0e42020-08-21 15:58:33 -050063Index: systemd-stable/units/systemd-binfmt.service.in
64===================================================================
65--- systemd-stable.orig/units/systemd-binfmt.service.in
66+++ systemd-stable/units/systemd-binfmt.service.in
Andrew Geissler706d5aa2021-02-12 15:55:30 -060067@@ -14,6 +14,7 @@ Documentation=https://www.kernel.org/doc
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080068 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 Geissler82c905d2020-04-13 13:39:40 -050073 After=proc-sys-fs-binfmt_misc.mount
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080074 Before=sysinit.target shutdown.target
Andrew Geissler4ed12e12020-06-05 18:00:41 -050075@@ -30,3 +31,6 @@ RemainAfterExit=yes
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080076 ExecStart=@rootlibexecdir@/systemd-binfmt
Andrew Geissler4ed12e12020-06-05 18:00:41 -050077 ExecStop=@rootlibexecdir@/systemd-binfmt --unregister
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080078 TimeoutSec=90s
79+
80+[Install]
81+WantedBy=sysinit.target