[OE-core] [PATCH v2] systemd: Allow custom coredump config options

Alistair Francis alistair23 at gmail.com
Mon Jul 23 23:16:37 UTC 2018


On Wed, Jul 18, 2018 at 4:48 PM, Andre McCurdy <armccurdy at gmail.com> wrote:
> On Wed, Jul 18, 2018 at 3:53 PM, Alistair Francis
> <alistair.francis at wdc.com> wrote:
>> If the user has enabled coredump let's allow them to customise the
>> config options.
>>
>> Signed-off-by: Alistair Francis <alistair.francis at wdc.com>
>> ---
>>  meta/recipes-core/systemd/systemd_239.bb | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/meta/recipes-core/systemd/systemd_239.bb b/meta/recipes-core/systemd/systemd_239.bb
>> index 7822548993..a625d060a9 100644
>> --- a/meta/recipes-core/systemd/systemd_239.bb
>> +++ b/meta/recipes-core/systemd/systemd_239.bb
>> @@ -279,6 +279,18 @@ do_install() {
>>                         chown polkitd:root ${D}${datadir}/polkit-1/rules.d
>>                 fi
>>         fi
>> +
>> +  # If coredump was enabled, enable it in the config.
>> +  # This just sets the default, but can be used to customise the values.
>> +  if ${@bb.utils.contains('PACKAGECONFIG', 'coredump', 'true', 'false', d)}; then
>> +    sed 's|#Storage.*|Storage=external|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>> +    sed 's|#Compress.*|Compress=yes|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>> +    sed 's|#ProcessSizeMax.*|ProcessSizeMax=2G|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>> +    sed 's|#ExternalSizeMax.*|ExternalSizeMax=2G|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>> +    sed 's|#JournalSizeMax.*|JournalSizeMax=767M|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>> +    sed 's|#MaxUse.*|MaxUse=|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>> +    sed 's|#KeepFree.*|KeepFree=|g' -i ${D}${sysconfdir}/systemd/coredump.conf
>
> How does this allow the user to customise the config options?

They can edit the sed command line and have different options.

>
> By forcing the options to the _current_ default values you are
> creating a maintenance problem - ie you'll still be forcing these
> values even if/when the upstream defaults are changed.

That is a good point, is there a usual way to allow edits to config
files like this?

Alistair

>
>> +  fi
>>  }
>>
>>
>> --
>> 2.17.1
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core at lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list