blob: 00670ca2b12317845a579bbfa48c4cb87c7c1463 [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>
19---
20 units/meson.build | 6 ++----
21 units/proc-sys-fs-binfmt_misc.automount | 3 +++
22 units/systemd-binfmt.service.in | 4 ++++
23 3 files changed, 9 insertions(+), 4 deletions(-)
24
25diff --git a/units/meson.build b/units/meson.build
Brad Bishop19323692019-04-05 15:28:33 -040026index d695084..7b1f14a 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080027--- a/units/meson.build
28+++ b/units/meson.build
Brad Bishop19323692019-04-05 15:28:33 -040029@@ -47,8 +47,7 @@ units = [
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080030 ['poweroff.target', '',
31 'runlevel0.target'],
32 ['printer.target', ''],
33- ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT',
34- 'sysinit.target.wants/'],
35+ ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT'],
36 ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'],
37 ['reboot.target', '',
38 'runlevel6.target ctrl-alt-del.target'],
Brad Bishop19323692019-04-05 15:28:33 -040039@@ -134,8 +133,7 @@ in_units = [
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080040 ['systemd-ask-password-console.service', ''],
41 ['systemd-ask-password-wall.service', ''],
42 ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'],
43- ['systemd-binfmt.service', 'ENABLE_BINFMT',
44- 'sysinit.target.wants/'],
45+ ['systemd-binfmt.service', 'ENABLE_BINFMT'],
Brad Bishop19323692019-04-05 15:28:33 -040046 ['systemd-bless-boot.service', 'ENABLE_EFI HAVE_BLKID'],
47 ['systemd-boot-check-no-failures.service', ''],
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080048 ['systemd-coredump@.service', 'ENABLE_COREDUMP'],
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080049diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount
Brad Bishop19323692019-04-05 15:28:33 -040050index 30a6bc9..4231f3b 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080051--- a/units/proc-sys-fs-binfmt_misc.automount
52+++ b/units/proc-sys-fs-binfmt_misc.automount
53@@ -18,3 +18,6 @@ ConditionPathIsReadWrite=/proc/sys/
54
55 [Automount]
56 Where=/proc/sys/fs/binfmt_misc
57+
58+[Install]
59+WantedBy=sysinit.target
60diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
Brad Bishop19323692019-04-05 15:28:33 -040061index e940c7c..6be7f5c 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080062--- a/units/systemd-binfmt.service.in
63+++ b/units/systemd-binfmt.service.in
64@@ -14,6 +14,7 @@ Documentation=https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.htm
65 Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
66 DefaultDependencies=no
67 Conflicts=shutdown.target
68+Wants=proc-sys-fs-binfmt_misc.automount
69 After=proc-sys-fs-binfmt_misc.automount
70 Before=sysinit.target shutdown.target
71 ConditionPathIsReadWrite=/proc/sys/
72@@ -28,3 +29,6 @@ Type=oneshot
73 RemainAfterExit=yes
74 ExecStart=@rootlibexecdir@/systemd-binfmt
75 TimeoutSec=90s
76+
77+[Install]
78+WantedBy=sysinit.target
79--
Brad Bishop19323692019-04-05 15:28:33 -0400802.7.4
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080081