Patchwork [V3,1/5] systemd: add 'less' to its RRECOMMENDS

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Jan. 20, 2014, 2:22 a.m.
Message ID <a023434c6cc916907f190acd62af34ea5a6eaca0.1390184362.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/65205/
State New
Headers show

Comments

Qi.Chen@windriver.com - Jan. 20, 2014, 2:22 a.m.
The less command provided by busybox cannot interpret the control
character, resulting in obscure output of the journalctl command
in a systemd based image.

Add the 'less' package to systemd's RRECOMMENDS so that the output
of 'journalctl' looks clear to users.

[YOCTO #5723]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/systemd/systemd_208.bb |    2 ++
 1 file changed, 2 insertions(+)
Bernhard Reutner-Fischer - Jan. 20, 2014, 8:06 a.m.
On 20 January 2014 03:23:02 Chen Qi <Qi.Chen@windriver.com> wrote:

> The less command provided by busybox cannot interpret the control
> character, resulting in obscure output of the journalctl command
> in a systemd based image.

Can you send me the input containing this control character, please?

Perhaps we can do something sensible about it..
TIA,
>
> Add the 'less' package to systemd's RRECOMMENDS so that the output
> of 'journalctl' looks clear to users.
>
> [YOCTO #5723]
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  meta/recipes-core/systemd/systemd_208.bb |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-core/systemd/systemd_208.bb 
> b/meta/recipes-core/systemd/systemd_208.bb
> index 6590235..3c44dec 100644
> --- a/meta/recipes-core/systemd/systemd_208.bb
> +++ b/meta/recipes-core/systemd/systemd_208.bb
> @@ -219,10 +219,12 @@ FILES_${PN}-dev += "${base_libdir}/security/*.la 
> ${datadir}/dbus-1/interfaces/ $
>
>  RDEPENDS_${PN} += "kmod dbus util-linux-mount"
>
> +# Recommend the less package to correctly display the contents of 'journalctl'
>  RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
>                        util-linux-agetty \
>                        util-linux-fsck e2fsprogs-e2fsck \
>                        kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
> +                      less \
>  "
>
>  PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb"
> --
> 1.7.9.5
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



Sent with AquaMail for Android
http://www.aqua-mail.com
Qi.Chen@windriver.com - Jan. 20, 2014, 8:35 a.m.
On 01/20/2014 04:06 PM, Bernhard Reutner-Fischer wrote:
> On 20 January 2014 03:23:02 Chen Qi <Qi.Chen@windriver.com> wrote:
>
>> The less command provided by busybox cannot interpret the control
>> character, resulting in obscure output of the journalctl command
>> in a systemd based image.
>
> Can you send me the input containing this control character, please?
>
> Perhaps we can do something sensible about it..
> TIA,

For more details, please refer to 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=5723.
You can also add you comments there.

Best Regards,
Chen Qi

>>
>> Add the 'less' package to systemd's RRECOMMENDS so that the output
>> of 'journalctl' looks clear to users.
>>
>> [YOCTO #5723]
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>>  meta/recipes-core/systemd/systemd_208.bb |    2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/recipes-core/systemd/systemd_208.bb 
>> b/meta/recipes-core/systemd/systemd_208.bb
>> index 6590235..3c44dec 100644
>> --- a/meta/recipes-core/systemd/systemd_208.bb
>> +++ b/meta/recipes-core/systemd/systemd_208.bb
>> @@ -219,10 +219,12 @@ FILES_${PN}-dev += 
>> "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ $
>>
>>  RDEPENDS_${PN} += "kmod dbus util-linux-mount"
>>
>> +# Recommend the less package to correctly display the contents of 
>> 'journalctl'
>>  RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
>>                        util-linux-agetty \
>>                        util-linux-fsck e2fsprogs-e2fsck \
>>                        kernel-module-autofs4 kernel-module-unix 
>> kernel-module-ipv6 \
>> +                      less \
>>  "
>>
>>  PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb"
>> -- 
>> 1.7.9.5
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>
>
> Sent with AquaMail for Android
> http://www.aqua-mail.com
>
>
>
>
Bernhard Reutner-Fischer - Jan. 22, 2014, 10 a.m.
On 20 January 2014 09:35, ChenQi <Qi.Chen@windriver.com> wrote:
> On 01/20/2014 04:06 PM, Bernhard Reutner-Fischer wrote:
>>
>> On 20 January 2014 03:23:02 Chen Qi <Qi.Chen@windriver.com> wrote:
>>
>>> The less command provided by busybox cannot interpret the control
>>> character, resulting in obscure output of the journalctl command
>>> in a systemd based image.
>>
>>
>> Can you send me the input containing this control character, please?
>>
>> Perhaps we can do something sensible about it..
>> TIA,
>
>
> For more details, please refer to
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=5723.
> You can also add you comments there.

Can you please try:
http://marc.info/?l=busybox&m=139038437907397&w=2
and let me know if this fixes your issue?

thanks,
Qi.Chen@windriver.com - Jan. 23, 2014, 8:23 a.m.
On 01/22/2014 06:18 PM, Bernhard Reutner-Fischer wrote:
> On 22 January 2014 11:08, ChenQi <Qi.Chen@windriver.com> wrote:
>> On 01/22/2014 06:00 PM, Bernhard Reutner-Fischer wrote:
>>> On 20 January 2014 09:35, ChenQi <Qi.Chen@windriver.com> wrote:
>>>> On 01/20/2014 04:06 PM, Bernhard Reutner-Fischer wrote:
>>>>> On 20 January 2014 03:23:02 Chen Qi <Qi.Chen@windriver.com> wrote:
>>>>>
>>>>>> The less command provided by busybox cannot interpret the control
>>>>>> character, resulting in obscure output of the journalctl command
>>>>>> in a systemd based image.
>>>>>
>>>>> Can you send me the input containing this control character, please?
>>>>>
>>>>> Perhaps we can do something sensible about it..
>>>>> TIA,
>>>>
>>>> For more details, please refer to
>>>> https://bugzilla.yoctoproject.org/show_bug.cgi?id=5723.
>>>> You can also add you comments there.
>>> Can you please try:
>>> http://marc.info/?l=busybox&m=139038437907397&w=2
>>> and let me know if this fixes your issue?
>>>
>>> thanks,
>>>
>>>
>> Hi,
>>
>> I cannot open the link.
>> Could you please send me your patches as attachment? I'll try them out
>> tomorrow and let you know the results.
> http://marc.info/?l=busybox&m=139038437907397&q=raw
> or, just for you:
> http://busybox.net/~aldot/tmp/0001-less-Add-R.patch
>
> thanks,

Hi Bernhard,

I just tried this patch out.

1) Test 1
Command: journalctl
Result: control characters not interpreted
Log:
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: RSDP 000f1610 00014 (v00 
BOCHS )[[
0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: RSDT 0fffe450 00034 (v01 
BOCHS  BX
PCRSDT 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: FACP 0fffff80 00074 (v01 
BOCHS  BX
PCFACP 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: DSDT 0fffe490 01137 (v01   
BXPC
BXDSDT 00000001 INTL 20120913)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: FACS 0fffff40 00040[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: SSDT 0ffff700 00838 (v01 
BOCHS  BX
PCSSDT 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: APIC 0ffff610 00078 (v01 
BOCHS  BX
PCAPIC 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: HPET 0ffff5d0 00038 (v01 
BOCHS  BX
PCHPET 00000001 BXPC 00000001)[[0m
Jan 23 07:35:49 qemux86 kernel: ACPI: Local APIC address 0xfee00000
Jan 23 07:35:49 qemux86 kernel: [[1;39m0MB HIGHMEM available.[[0m
Jan 23 07:35:49 qemux86 kernel: [[1;39m255MB LOWMEM available.[[0m

2) Test 2
Command: export SYSTEMD_PAGER="less -R"; journalctl
Result: control characters interpreted

I know the behavior of `less' command from busybox is different from 
that of the 'less' package. And we can't ask too much.
But do you think it's possible to make 'journalctl' work correctly 
without setting SYSTEMD_PAGER to "less -R"? I'm wondering why busybox's 
'less' doesn't use the '-R' behaviour as its default. If so, we would 
not need this '-R' option at all.

Best Regards,
Chen Qi
Bernhard Reutner-Fischer - Jan. 23, 2014, 8:41 p.m.
On 23 January 2014 09:23:18 ChenQi <Qi.Chen@windriver.com> wrote:

> On 01/22/2014 06:18 PM, Bernhard Reutner-Fischer wrote:
> > On 22 January 2014 11:08, ChenQi <Qi.Chen@windriver.com> wrote:
> >> On 01/22/2014 06:00 PM, Bernhard Reutner-Fischer wrote:
> >>> On 20 January 2014 09:35, ChenQi <Qi.Chen@windriver.com> wrote:
> >>>> On 01/20/2014 04:06 PM, Bernhard Reutner-Fischer wrote:
> >>>>> On 20 January 2014 03:23:02 Chen Qi <Qi.Chen@windriver.com> wrote:
> >>>>>
> >>>>>> The less command provided by busybox cannot interpret the control
> >>>>>> character, resulting in obscure output of the journalctl command
> >>>>>> in a systemd based image.
> >>>>>
> >>>>> Can you send me the input containing this control character, please?
> >>>>>
> >>>>> Perhaps we can do something sensible about it..
> >>>>> TIA,
> >>>>
> >>>> For more details, please refer to
> >>>> https://bugzilla.yoctoproject.org/show_bug.cgi?id=5723.
> >>>> You can also add you comments there.
> >>> Can you please try:
> >>> http://marc.info/?l=busybox&m=139038437907397&w=2
> >>> and let me know if this fixes your issue?
> >>>
> >>> thanks,
> >>>
> >>>
> >> Hi,
> >>
> >> I cannot open the link.
> >> Could you please send me your patches as attachment? I'll try them out
> >> tomorrow and let you know the results.
> > http://marc.info/?l=busybox&m=139038437907397&q=raw
> > or, just for you:
> > http://busybox.net/~aldot/tmp/0001-less-Add-R.patch
> >
> > thanks,
>
> Hi Bernhard,
>
> I just tried this patch out.
>
> 1) Test 1
> Command: journalctl
> Result: control characters not interpreted
> Log:
> Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: RSDP 000f1610 00014 (v00 BOCHS )[[
> 0m
> Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: RSDT 0fffe450 00034 (v01 BOCHS  BX
> PCRSDT 00000001 BXPC 00000001)[[0m
> Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: FACP 0fffff80 00074 (v01 BOCHS  BX
> PCFACP 00000001 BXPC 00000001)[[0m
> Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: DSDT 0fffe490 01137 (v01 BXPC
> BXDSDT 00000001 INTL 20120913)[[0m
> Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: FACS 0fffff40 00040[[0m
> Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: SSDT 0ffff700 00838 (v01 BOCHS  BX
> PCSSDT 00000001 BXPC 00000001)[[0m
> Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: APIC 0ffff610 00078 (v01 BOCHS  BX
> PCAPIC 00000001 BXPC 00000001)[[0m
> Jan 23 07:35:49 qemux86 kernel: [[1;39mACPI: HPET 0ffff5d0 00038 (v01 BOCHS  BX
> PCHPET 00000001 BXPC 00000001)[[0m
> Jan 23 07:35:49 qemux86 kernel: ACPI: Local APIC address 0xfee00000
> Jan 23 07:35:49 qemux86 kernel: [[1;39m0MB HIGHMEM available.[[0m
> Jan 23 07:35:49 qemux86 kernel: [[1;39m255MB LOWMEM available.[[0m
>
> 2) Test 2
> Command: export SYSTEMD_PAGER="less -R"; journalctl
> Result: control characters interpreted
>
> I know the behavior of `less' command from busybox is different from that 
> of the 'less' package. And we can't ask too much.
> But do you think it's possible to make 'journalctl' work correctly without 
> setting SYSTEMD_PAGER to "less -R"? I'm wondering why busybox's 'less' 
> doesn't use the '-R' behaviour as its default. If so, we would not need 
> this '-R' option at all.

Apparently Denys does not like the idea of having -R in there at all but 
even if it gets in, defaulting to -R is not acceptable I think. We could, 
however, add parsing the LESS env var as the big less does. I guess that 
would add another 30-40 bytes to the 300-ish for the -R itself, though.
Plain -r was much smaller, but I dropped it due to paranoia, fwiw.

To some extent I do agree with Denys that journalctl should only print ANSI 
colors if it's stdout isatty.

Thanks,

Sent with AquaMail for Android
http://www.aqua-mail.com

Patch

diff --git a/meta/recipes-core/systemd/systemd_208.bb b/meta/recipes-core/systemd/systemd_208.bb
index 6590235..3c44dec 100644
--- a/meta/recipes-core/systemd/systemd_208.bb
+++ b/meta/recipes-core/systemd/systemd_208.bb
@@ -219,10 +219,12 @@  FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ $
 
 RDEPENDS_${PN} += "kmod dbus util-linux-mount"
 
+# Recommend the less package to correctly display the contents of 'journalctl'
 RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
                       util-linux-agetty \
                       util-linux-fsck e2fsprogs-e2fsck \
                       kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
+                      less \
 "
 
 PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb"