blob: 73e65ff798596ab8782a8f34f868ff0fd5c936a2 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From 98254e4798e79d52ac6b562616cd244120f6e239 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
4Subject: [PATCH 1/5] binfmt: Don't install dependency links at install time
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005 for the binfmt services
6
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>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021---
22 units/meson.build | 6 ++----
23 units/proc-sys-fs-binfmt_misc.automount | 3 +++
24 units/systemd-binfmt.service.in | 4 ++++
25 3 files changed, 9 insertions(+), 4 deletions(-)
26
27diff --git a/units/meson.build b/units/meson.build
Brad Bishopa34c0302019-09-23 22:34:48 -040028index e1ee9f86c3..6bb7771b36 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080029--- a/units/meson.build
30+++ b/units/meson.build
Brad Bishopa34c0302019-09-23 22:34:48 -040031@@ -46,8 +46,7 @@ units = [
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080032 ['poweroff.target', '',
33 'runlevel0.target'],
34 ['printer.target', ''],
35- ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT',
36- 'sysinit.target.wants/'],
37+ ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT'],
38 ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'],
39 ['reboot.target', '',
40 'runlevel6.target ctrl-alt-del.target'],
Brad Bishopa34c0302019-09-23 22:34:48 -040041@@ -130,8 +129,7 @@ in_units = [
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080042 ['systemd-ask-password-console.service', ''],
43 ['systemd-ask-password-wall.service', ''],
44 ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'],
45- ['systemd-binfmt.service', 'ENABLE_BINFMT',
46- 'sysinit.target.wants/'],
47+ ['systemd-binfmt.service', 'ENABLE_BINFMT'],
Brad Bishop19323692019-04-05 15:28:33 -040048 ['systemd-bless-boot.service', 'ENABLE_EFI HAVE_BLKID'],
49 ['systemd-boot-check-no-failures.service', ''],
Brad Bishopa34c0302019-09-23 22:34:48 -040050 ['systemd-boot-system-token.service', 'ENABLE_EFI',
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080051diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount
Brad Bishopa34c0302019-09-23 22:34:48 -040052index 30a6bc9918..4231f3b70f 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080053--- a/units/proc-sys-fs-binfmt_misc.automount
54+++ b/units/proc-sys-fs-binfmt_misc.automount
55@@ -18,3 +18,6 @@ ConditionPathIsReadWrite=/proc/sys/
56
57 [Automount]
58 Where=/proc/sys/fs/binfmt_misc
59+
60+[Install]
61+WantedBy=sysinit.target
62diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
Brad Bishopa34c0302019-09-23 22:34:48 -040063index e940c7c9ad..6be7f5cc9b 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080064--- a/units/systemd-binfmt.service.in
65+++ b/units/systemd-binfmt.service.in
66@@ -14,6 +14,7 @@ Documentation=https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.htm
67 Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
68 DefaultDependencies=no
69 Conflicts=shutdown.target
70+Wants=proc-sys-fs-binfmt_misc.automount
71 After=proc-sys-fs-binfmt_misc.automount
72 Before=sysinit.target shutdown.target
73 ConditionPathIsReadWrite=/proc/sys/
74@@ -28,3 +29,6 @@ Type=oneshot
75 RemainAfterExit=yes
76 ExecStart=@rootlibexecdir@/systemd-binfmt
77 TimeoutSec=90s
78+
79+[Install]
80+WantedBy=sysinit.target