0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch 3.3 KB

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