Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 1 | From 564830719be2017c4953589d50f21a9e856a4ecc 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 | |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 28 | Index: systemd-stable/units/meson.build |
| 29 | =================================================================== |
| 30 | --- systemd-stable.orig/units/meson.build |
| 31 | +++ systemd-stable/units/meson.build |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 32 | @@ -55,8 +55,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' : '')], |
| 42 | @@ -166,8 +165,7 @@ in_units = [ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 43 | ['rc-local.service', 'HAVE_SYSV_COMPAT'], |
| 44 | ['rescue.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'], |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 52 | Index: 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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 56 | @@ -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 Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 63 | Index: 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 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 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 76 | ExecStart=@rootlibexecdir@/systemd-binfmt |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 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 |