[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transfering Data from GRUB to userspace?

From: Vladimir 'phcoder' Serbinenko
Subject: Re: Transfering Data from GRUB to userspace?
Date: Thu, 14 Nov 2019 03:18:40 -0800

Did you look at cpio generation facility in initrd command? This may be what your are looking for

On Mon, 28 Oct 2019, 03:59 Max Tottenham via Grub-devel, <address@hidden> wrote:
Hi Folks

I've often found myself in a position where I've needed to perform some
debugging of remote hardware that does not have a network accessible KVM
attached. To that end, being able to remotely log into a machine and
have some method of accessing GRUB2 boot time debug messages from
userspace (in my case linux), would be rather useful. It also dawned on
me that this capability might be the sort of thing that folks upstream
might be keen on.

I have done a little thinking and have thought of two possible

1. Perform some hacking of the grub environment block (load/save env)
handling to be able to write log data to either the same file in /boot,
or perhaps a separate distinct debug log file.

2. Export the debug log to a running kernel as another initrd image. In
other words, have GRUB2 buffer a bunch of log messages and then append
that log data as a separate initrd archive. Some early userspace program
would then be able to copy that archive to the real filesystem, or
stick it into the kernel log buffer. The logfile in the
initrd that GRUB generates could have either a configurable name based
on some setting in grub.cfg, or some well known default name (like

I initially started with 1, but I dislike the approach of having GRUB2
write to the filesystem, it's also a little cumbersome to setup,

Approach 2 seems like it would work (at least for linux, I've no
experience with the BSDs but presumably any OS that can load multiple
initrd's would be able to use this approach too), and has the advantage
that it doesn't have to touch any data on disk.

If there is no objection I can whip up a POC patch for 2 and post it to
the list?


Max Tottenham       | address@hidden
Senior Software Engineer, Server Platform Engineering
/(* Akamai Technologies

Grub-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]