grub-devel
[Top][All Lists]
Advanced

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

Transfering Data from GRUB to userspace?


From: Max Tottenham
Subject: Transfering Data from GRUB to userspace?
Date: Mon, 28 Oct 2019 10:58:21 +0000
User-agent: Mutt/1.9.4 (2018-02-28)

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
approaches:


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
/grub2-debug.log)


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?

Regards

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



reply via email to

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