diff options
author | Alban Bedel <alban.bedel@aerq.com> | 2020-11-03 16:13:34 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-11-13 14:32:00 +0000 |
commit | 35a939b7bae5c1ec683ef2a5c2f56a136ae34950 (patch) | |
tree | 963735ddca5f4203263caa0f49ae27dabdbbc2dc /meta | |
parent | f35343550ad11c8484f7e9d2c164a487c8fecc2a (diff) | |
download | poky-35a939b7bae5c1ec683ef2a5c2f56a136ae34950.tar.gz |
systemd: Fix systemd when used with busybox less
Per default systemd use a pager for the output of most of its tools
and it expect this pager to be color capable. But that is not the case
when the busybox `less` is used, which lead to output garbled by color
escape sequences.
To fix this issue add a profile frament that disable the systemd pager
when busybox `less` is detected.
(From OE-Core rev: de7e36a7858ebca4615975967fcad1c399eacdb0)
Signed-off-by: Alban Bedel <alban.bedel@aerq.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-core/systemd/systemd/systemd-pager.sh | 7 | ||||
-rw-r--r-- | meta/recipes-core/systemd/systemd_246.6.bb | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/systemd-pager.sh b/meta/recipes-core/systemd/systemd/systemd-pager.sh new file mode 100644 index 0000000000..86e3e0ab78 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pager.sh | |||
@@ -0,0 +1,7 @@ | |||
1 | # Systemd expect a color capable pager, however the less provided | ||
2 | # by busybox is not. This make many interaction with systemd pretty | ||
3 | # annoying. As a workaround we disable the systemd pager if less | ||
4 | # is not the GNU version. | ||
5 | if ! less -V > /dev/null 2>&1 ; then | ||
6 | export SYSTEMD_PAGER= | ||
7 | fi | ||
diff --git a/meta/recipes-core/systemd/systemd_246.6.bb b/meta/recipes-core/systemd/systemd_246.6.bb index 78990f41ec..1d1ff34d89 100644 --- a/meta/recipes-core/systemd/systemd_246.6.bb +++ b/meta/recipes-core/systemd/systemd_246.6.bb | |||
@@ -18,6 +18,7 @@ SRC_URI += "file://touchscreen.rules \ | |||
18 | file://00-create-volatile.conf \ | 18 | file://00-create-volatile.conf \ |
19 | file://init \ | 19 | file://init \ |
20 | file://99-default.preset \ | 20 | file://99-default.preset \ |
21 | file://systemd-pager.sh \ | ||
21 | file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ | 22 | file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ |
22 | file://0003-implment-systemd-sysv-install-for-OE.patch \ | 23 | file://0003-implment-systemd-sysv-install-for-OE.patch \ |
23 | file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \ | 24 | file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \ |
@@ -306,6 +307,9 @@ do_install() { | |||
306 | # install default policy for presets | 307 | # install default policy for presets |
307 | # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto | 308 | # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto |
308 | install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset | 309 | install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset |
310 | |||
311 | # add a profile fragment to disable systemd pager with busybox less | ||
312 | install -Dm 0644 ${WORKDIR}/systemd-pager.sh ${D}${sysconfdir}/profile.d/systemd-pager.sh | ||
309 | } | 313 | } |
310 | 314 | ||
311 | python populate_packages_prepend (){ | 315 | python populate_packages_prepend (){ |
@@ -539,6 +543,7 @@ FILES_${PN} = " ${base_bindir}/* \ | |||
539 | ${sysconfdir}/dbus-1/ \ | 543 | ${sysconfdir}/dbus-1/ \ |
540 | ${sysconfdir}/modules-load.d/ \ | 544 | ${sysconfdir}/modules-load.d/ \ |
541 | ${sysconfdir}/pam.d/ \ | 545 | ${sysconfdir}/pam.d/ \ |
546 | ${sysconfdir}/profile.d/ \ | ||
542 | ${sysconfdir}/sysctl.d/ \ | 547 | ${sysconfdir}/sysctl.d/ \ |
543 | ${sysconfdir}/systemd/ \ | 548 | ${sysconfdir}/systemd/ \ |
544 | ${sysconfdir}/tmpfiles.d/ \ | 549 | ${sysconfdir}/tmpfiles.d/ \ |