Commit graph

8 commits

Author SHA1 Message Date
Beniamino Galvani
2e5d0f3046 initrd: cmdline-reader: fix setting uint properties
Previously a uint property was assigned with a guint64 value, which
has a different size. Fix this and add a warning when the read value
can't be converted.

Fixes: ecc074b2f8

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/66
(cherry picked from commit d0a99176a7)
2018-10-23 13:24:42 +02:00
Thomas Haller
095bac3019 initrd: add .nmconnection extension when writing keyfiles
initrd does not use keyfile API from "src/settings/plugins/keyfile",
hence it does not use nms_keyfile_utils_escape_filename() to add
the ".nmconnection" file extension.

I think that is problematic, because it also misses escapings which
are necessary so that NetworkManager will accept the file.

Anyway, the proper solution here would be to move the keyfile utility
functions to libnm-core, alongside base keyfile API. That way, it
could be used by initrd generator.

For now, just dirty fix the generated filename.

Fixes: 648c256b90
(cherry picked from commit 4ca7fa7f4a)
2018-10-19 12:39:53 +02:00
Lubomir Rintel
7f173bcfdf initrd/cmdline-reader: fix whitespace errors
Detected by checkpatch.pl

(cherry picked from commit ecde3e9034)
2018-10-17 17:13:01 +02:00
Beniamino Galvani
065551c634 initrd: enable meson builds
(cherry picked from commit 470c5c0a82)
2018-10-17 17:13:00 +02:00
Lubomir Rintel
45f7d05629 initrd-generator: add a missing include
(cherry picked from commit 7c270f0860)
2018-10-17 17:07:57 +02:00
Lubomir Rintel
bfd7d79fe1 initrd: add configuration generator
nm-initrd-generator scans the command line for options relevant to network
configuration and creates configuration files for an early instance of
NetworkManager run from the initial ramdisk during early boot.

(cherry picked from commit 9f9609555d)
2018-10-17 17:07:21 +02:00
Lubomir Rintel
2a65d1bb80 initrd: add command line parser
(cherry picked from commit ecc074b2f8)
2018-10-17 17:06:29 +02:00
Lubomir Rintel
c24e505b6a initrd: add iBFT reader
This is loosely based on nms-ibft-reader, but with some significant
changes. Notably, it parses /sys/firmware/ibft directly instead of
iscsiadm output.

iscsiadm is not available on early boot (perhaps it's too large) and
turns out that parsing sysfs directly is easier and more
straightforwared anyways. A win-win situation.

It is not useful alone, it's in a separate commit just for the sake of
easier review.

(cherry picked from commit b544f7243d)
2018-10-17 17:06:29 +02:00