[OE-core] [PATCH] systemd: Enable coredump if it is in PACKAGECONFIG

Alistair Francis alistair.francis at wdc.com
Mon Jul 16 22:50:09 UTC 2018


Previously if coredump was enabled in PACKAGECONFIG the user would still
need to modify the conf file to enable it. Now the config will be
enabled if coredump is enalbed in the PACKAGECONFIG.

Signed-off-by: Alistair Francis <alistair.francis at wdc.com>
---
 .../systemd/systemd/coredump.conf             | 21 +++++++++++++++++++
 meta/recipes-core/systemd/systemd_237.bb      |  5 +++++
 2 files changed, 26 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/coredump.conf

diff --git a/meta/recipes-core/systemd/systemd/coredump.conf b/meta/recipes-core/systemd/systemd/coredump.conf
new file mode 100644
index 0000000000..4cbc19cdc5
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/coredump.conf
@@ -0,0 +1,21 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+#
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
+#
+# See coredump.conf(5) for details.
+
+[Coredump]
+Storage=external
+Compress=yes
+ProcessSizeMax=2G
+ExternalSizeMax=2G
+#JournalSizeMax=767M
+#MaxUse=
+#KeepFree=
diff --git a/meta/recipes-core/systemd/systemd_237.bb b/meta/recipes-core/systemd/systemd_237.bb
index 3efca33e73..db2848fd65 100644
--- a/meta/recipes-core/systemd/systemd_237.bb
+++ b/meta/recipes-core/systemd/systemd_237.bb
@@ -276,6 +276,11 @@ do_install() {
 			chown polkitd:root ${D}${datadir}/polkit-1/rules.d
 		fi
 	fi
+
+  # If coredump was enalbed, enable it in the config
+  if ${@bb.utils.contains('PACKAGECONFIG', 'coredump', 'true', 'false', d)}; then
+    install -Dm 0755 ${FILE_DIRNAME}/${BPN}/coredump.conf ${D}${sysconfdir}/systemd/
+  fi
 }
 
 
-- 
2.17.1



More information about the Openembedded-core mailing list