unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tomas Volf <~@wolfsden.cz>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: 03/11: reconfigure: Support loading the system for kexec reboot.
Date: Sun, 05 Jan 2025 22:54:02 +0100	[thread overview]
Message-ID: <87a5c5ylj9.fsf@wolfsden.cz> (raw)
In-Reply-To: <87y0zqqyrr.fsf@gnu.org> ("Ludovic Courtès"'s message of "Sat, 04 Jan 2025 18:23:04 +0100")

[-- Attachment #1: Type: text/plain, Size: 2522 bytes --]

Ludovic Courtès <ludo@gnu.org> writes:

Hello :)

> Hi,
>
> Tomas Volf <~@wolfsden.cz> skribis:
>
>> thank you for this series, it looks quite useful, however couple of
>> questions about this commit are below. :)
>
> For me privately?  If not, feel free to share my reply with the list.

It just felt unnecessary to spam the whole list with these questions,
but I defer to your judgment here and will reply to the list.

>
>> Is it expected that I can call `reboot -k' without any system being
>> loaded for the kexec (yet)?  The VM I have tried it in seems to just
>> "shutdown" half-way and then hang, with last message being "Rebooting
>> via kexec" or something like that.  I am not sure if that is expected
>> (and the onus is on me to make sure I load the image before `reboot -k')
>> or if I should bug report it.
>
> It’s a bug fixed in Shepherd ‘main’ (bug-fix release will be out
> soon).

Nice.

>
>>> +    (program-file
>>> +     "kexec-load-system.scm"
>>> +     (with-imported-modules '((guix build syscalls))
>>> +       #~(begin
>>> +           (use-modules (guix build syscalls))
>>> +
>>> +           (let ((kernel (open-fdes #$(operating-system-kernel-file os)
>>> +                                    O_RDONLY))
>>> +                 (initrd (open-fdes #$(operating-system-initrd-file os)
>>> +                                    O_RDONLY)))
>>
>> Do I understand it right that this program basically loads just the
>> (initrd) field of the operating-system definitions, and ignores the
>> (extra-initrd) field?  If so, that is a shame.  Would have allowed
>> reboots of LUKS encrypted machines without entering the password at all.
>
> Good point!  kexec_file_load(2) can only be given one initrd, so I
> suppose it cannot support extra initrds.
>
> That’s something we should at least document and probably protect
> against.

Based on the kexec_file_load's man page it looks like it takes a file
descriptor.  Is there a technical reason why we cannot just construct
the unified initrd in memory by overlaying the extra-initrd over the
initrd (which is what GRUB does anyway) and feed the result to the
kernel via a pipe?

I am willing to give a shot writing the code for it (once the kexec
loading works at all on my machines, see #75320), assuming you consider
this approach sound.

Have a nice day,
Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]

       reply	other threads:[~2025-01-05 21:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <173542420171.3052447.14254740746301984406@vcs3.savannah.gnu.org>
     [not found] ` <20241228221642.E5EB9D3CB98@vcs3.savannah.gnu.org>
     [not found]   ` <87jzbi3f7f.fsf@wolfsden.cz>
     [not found]     ` <87y0zqqyrr.fsf@gnu.org>
2025-01-05 21:54       ` Tomas Volf [this message]
2025-01-07 17:50         ` 03/11: reconfigure: Support loading the system for kexec reboot Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5c5ylj9.fsf@wolfsden.cz \
    --to=~@wolfsden.cz \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).