-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New dracut 95nbft module #2620
base: master
Are you sure you want to change the base?
New dracut 95nbft module #2620
Conversation
Intended to create udev network link files (see systemd.link(5)) from ACPI NBFT tables present in the system, typically called during early boot process. A semi-predictable interface naming is proposed to accurately identify HFI that the interface is set up for. The syntax is as follows: nbftXhY where X is the NBFT table index (filename, defaults to 0) and Y is the HFI record index. Signed-off-by: Tomas Bzatek <[email protected]>
This is a minimal dracut module providing Boot from NVMe/TCP functionality. Consisting of two simple systemd units to set up networking and perform actual connections afterwards. Requires the NetworkManager nm-initrd-generator NBFT support. Signed-off-by: Tomas Bzatek <[email protected]>
In case the `nvme connect-all --nbft` call fails, respawn the service after 10 seconds and try again. Depends on nvme-cli to return non-zero status in case of any of the SSNS records that are not marked as 'unavailable' fails to connect. The respawn cycle is broken by stopping the unit once rootfs is mounted and system switches the root. Signed-off-by: Tomas Bzatek <[email protected]>
5d23b62
to
3fdb4b9
Compare
Very interesting. The timing is kind of unfortunate for me. I'll not be able to do an in-depth review until the beginning of next year. Some quick questions / remarks. I've only glanced about this quickly, so I hope I'm not getting it all wrong.
|
In my mind, the current "API" of nvme-cli wrt NBFT is the JSON format. I am aware that that's subobtimal if you want to build a minimal initramfs, as it requires either a JSON library or something like jq, which is rather big. Still, discuss carefully if we want replace this by something else. |
One thing I'd like to bring up, is that I think we should reconsider the Almost all other commands by nvme-cli are just simple commands which do one thing. I think it should be possible build any complex logic ontop of it, e.g. using scripts. My goal would be to move the missing parts of This is obviously all v3 material. |
Cc: @mwilck
-- Please check the included README.md first
This started as an experiment from an idea coming from our inhouse dracut and systemd developers. I kinda like the result even though there are many loose ends - read on. There's an unpublished internal plan to slim dracut down in the mid-term and while I can't speak of the details one major argument was something like "dracut was born before systemd" and "systemd nowadays can take over many tasks dracut is doing". Add embedded, automotive and otherwise resource-restricted environments and the push for minimization grows further.
This experiment was about creating specially crafted systemd units injected at the right place with as little dracut involvement as possible. I admit all this work may speak itself a little of a NIH syndrome, still I hope it becomes useful.
There are some loose ends here:
95nvmf
dracut module. Haven't approached dracut upstream yet.nbft
plugin command, at least for now. We can move this somewhere else as the only entry point is the systemd service here. Also the commandline arguments and help strings may need some tweaks. It was strongly suggested to use systemd link files instead of udev rules for interface renaming. However during my experiments with VLANs this appears to have some drawbacks, so this is still undecided and may opt for udev rules instead. TBD.Needs #2614 (already merged).
This work also gives answer for #2179 and includes the files we've kept downstream so far.
And some more wild ideas:
libnvme
NBFT parser in a separate, independent library (just like the -mi one) that would be small and suitable for initramfs, or statically linked. One suggestion was to have native udev support for nbft interface naming within builtin-net_id.c however the parser dependencies were a problem. The ACPI NBFT table is not a fixed-size struct and is not so trivial to parse if somebody wanted to reimplement the parser just to extract the HFI descriptors.