Passing boot logs to Linux?

Sean Anderson seanga2 at gmail.com
Wed Dec 20 21:03:12 CET 2023


On 12/20/23 14:24, Csókás Bence wrote:
> On 2023. 12. 20. 9:29, Dragan Simic wrote:
>> On 2023-12-20 08:52, Csókás Bence wrote:
>>> On 2023. 12. 20. 8:09, Dragan Simic wrote:
>>>> On 2023-12-20 07:49, Csókás Bence wrote:
>>>>> I don't think that would be a huge problem, Linux userspace can filter
>>>>> ANSI control codes if it wants to. For now, I'd like a byte-for-byte
>>>>> copy of the console, as-is, presented to Linux.
>>>>
>>>> But wouldn't recording the control sequences as-is actually be pretty
>>>> much useless?  For example, some user can spend a few minutes
>>>> scrolling through the boot menu, which would produce a fair amount of
>>>> nearly useless recorded data.
>>>>
>>>> Moreover, if I'm not wrong, viewing or parsing such as-is data would
>>>> actually require replaying the control sequences, to reproduce the
>>>> actual console contents as it was recorded, which would be quite
>>>> cumbersome.
>>>
>>> It *is* useless, but most of the times the user won't be scrolling at
>>> all anyways, that's why I don't think these few extra bytes would be a
>>> problem.
>>
>> Quite frankly, when it comes to computing in general, taking the "ah, it
>> probably won't happen" approach isn't the best thing to do.  We should
>> aim toward covering properly even the edge cases, if you agree.
> 
> You're absolutely right; however, I did not say "it won't happen", I
> said that Linux userspace can go deal with it if it happens, and if it
> wants to. And that in my opinion, the best course of action for U-Boot
> is to record *everything* (as it does now), and then userspace can
> decide to filter it for eg. ANSI codes. But I think it's best to keep
> the U-Boot code dead simple, and also supply the most data to userspace.
> 
> 
>>> That's what I read as well. Is there support for U-boot to write and
>>> Linux to read PStores?
>>
>> No and yes, but U-Boot can already read pstore.  Please see
>> doc/usage/cmd/pstore.rst for the U-Boot part, and
>> Documentation/admin-guide/pstore-blk.rst for the Linux kernel part.
> 
> Irrelevant, as we only want to write out the console log to U-Boot, and
> not the other way around (that's for collecting panic logs, which is
> already implemented).
> 
>> Another benefit of using pstore would be no permanently wasted RAM for
>> the recorded console contents.  Also, having the data recorded to a
>> storage device also goes along with providing permanent records.
> 
> I'm positively *not gonna save boot logs to disk*, as most embedded
> systems have Flash-based storage media; writing to them on every boot
> would be devastating. Plus, I don't want the console subsystem to depend
> on any file/disk operations/drivers.

pstore is agnostic to the backend used. In U-Boot we only support RAM
backends at the moment.

--Sean



More information about the U-Boot mailing list