[Nix-dev] How to plug systemd-bootchart into kernel args?

Mateusz Czaplinski czapkofan at gmail.com
Mon Jul 11 02:31:24 CEST 2016


I've read that for detailed boot time instrumentation, one is advised
to use 'init=/usr/lib/systemd/systemd-bootchart' kernel param.

I've already:
- found out that with systemd-230, systemd-bootchart was moved out to
a separate project (github.com/systemd/systemd-bootchart);
- built a derivation for it and made it to compile successfully;
(running systemd-bootchart --help prints help info);
- tried to pass it into /etc/nixos/configuration.nix as:

  kernelParams = [
    "init=${systemd-bootchart}/lib/systemd/systemd-bootchart"
  ];

- but I'm getting a kernel panic on boot.

What should I do? Also, I don't know how to retrieve the exact
contents of the panic message from the "previous boot" (i.e. the
panicked one), after I hard-reboot and pick a last-working
configuration in GRUB menu. Dmesg seems to show only the successful
one, journalctl doesn't seem to be aware of the panic either with -b
-1.

I've also noticed, that /boot/grub/grub.cfg actually contains two
init= arguments, as the new one is only appended (the old one is still
kept); can this be the reason? If yes, is there some reasonable hack I
could try to fix that?

Also, I've read that I should maybe pass -i option to bootchart, to
inform it what init script it should pass control to. But I don't know
how to retrieve the path dynamically in Nix expression? it looks to me
it's available only temporarily as a let-expression, which is used in
some advanced expression and thus doesn't escape into "global scope".
Still, when I tried to hardcode it as:
"init=${systemd-bootchart}/.../systemd-bootchart -i
/nix/store/.../init", it panicked anyway (that said, in grub.cfg, it
seems the spaces are not escaped around -i here; is that ok?), so I
assume I haven't even reached this phase yet.

I'd be grateful for any help!

Thanks & Best Regards,
/Mateusz Czapliński.


More information about the nix-dev mailing list