initrd: add devicetree support

System Internals / NetworkManager - Lubomir Rintel [v3.sk] - 10 September 2019 09:04 EDT

This adds capability to hand over the network configuration from OpenFirmware (and potentially other boot loaders with openfirmware support such as U-Boot) to NetworkManager.

It's done analogously to ACPI/iBFT. In fact, the same ip=ibft command line option is used, adding a more general ip=fw alias. This probably deserves some documentation, but I'm not adding any at this time.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/257

7a72c705a initrd: add devicetree support
.gitignore | 1 +
Makefile.am | 22 ++
src/devices/wwan/tests/test-service-providers | Bin 0 -> 10070856 bytes
src/initrd/meson.build | 1 +
src/initrd/nm-initrd-generator.h | 2 +
src/initrd/nmi-cmdline-reader.c | 10 +-
src/initrd/nmi-dt-reader.c | 411 +++++++++++++++++++++
src/initrd/tests/meson.build | 1 +
.../firmware/devicetree/base/chosen/bootpath | Bin 0 -> 108 bytes
.../firmware/devicetree/base/chosen/bootp-request | Bin 0 -> 273 bytes
.../firmware/devicetree/base/chosen/bootp-response | Bin 0 -> 300 bytes
.../firmware/devicetree/base/chosen/bootpath | Bin 0 -> 37 bytes
.../firmware/devicetree/base/chosen/broadcast-ip | 1 +
.../firmware/devicetree/base/chosen/client-ip | 2 +
.../firmware/devicetree/base/chosen/client-name | Bin 0 -> 9 bytes
.../firmware/devicetree/base/chosen/domain-name | Bin 0 -> 15 bytes
.../firmware/devicetree/base/chosen/gateway-ip | 2 +
.../sysfs-dt/firmware/devicetree/base/chosen/name | Bin 0 -> 7 bytes
.../firmware/devicetree/base/chosen/netmask-ip | Bin 0 -> 4 bytes
.../firmware/devicetree/base/chosen/root-path | Bin 0 -> 1 bytes
.../firmware/devicetree/base/chosen/server-ip | 2 +
.../firmware/devicetree/base/chosen/tftp-file | Bin 0 -> 11 bytes
.../firmware/devicetree/base/chosen/vendor-options | Bin 0 -> 1 bytes
.../firmware/devicetree/base/ethernet/device_type | Bin 0 -> 8 bytes
.../devicetree/base/ethernet/local-mac-address | 1 +
.../firmware/devicetree/base/ethernet/mac-address | 1 +
.../firmware/devicetree/base/ethernet/name | Bin 0 -> 9 bytes
src/initrd/tests/test-dt-reader.c | 147 ++++++++
28 files changed, 603 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share