NetworkManager/src/nm-initrd-generator
Thomas Haller b5e7e48bc1
glib-aux: add and use nm_uuid_generate_from_strings_old()
For a long time we have a function like nm_uuid_generate_from_strings().
This was recently reworked and renamed, but it preserved behavior. Preserving
behavior is important for this function, because for the existing users,
we need to keep generating the same UUIDs.

Originally, this function was a variadic function with NULL sentinel.
That means, when you write

  nm_uuid_generate_from_strings(uuid_type, type_arg, v1, v2, v3, NULL);

and v2 happens to be NULL, then v3 is ignored. That is most likely not
what the user intended. Maybe they had a bug and v2 should not be NULL.
But nm_uuid_generate_from_strings() should not require that all
arguments are non-NULL and it should not ignore arguments after the
first NULL.

For example, one user works around this via

    uuid = nm_uuid_generate_from_strings_old("ibft",
                                             s_hwaddr,
                                             s_vlanid ? "V" : "v",
                                             s_vlanid ? s_vlanid : "",
                                             s_ipaddr ? "A" : "DHCP",
                                             s_ipaddr ? s_ipaddr : "");

which is cumbersome and ugly.

That will be fixed next, by adding a function that doesn't suffer
from this problem. But "this problem" is part of the API of the
function, we cannot just change it. Instead, rename it and all
users, so they can keep doing the same.

New users of course should no longer use the "old" function.
2022-10-11 09:03:17 +02:00
..
tests initrd: add support for rd.znet_ifnames 2022-01-25 14:57:22 +01:00
meson.build build: fix linking libnm-log-null into different test programs 2021-07-05 14:51:27 +02:00
nm-initrd-generator.c all: use nm_g_array_{index,first,last,index_p}() instead of g_array_index() 2022-09-15 12:39:07 +02:00
nm-initrd-generator.h initrd: generate initrd generator profiles with autoconnect-priority -100 2022-09-15 18:23:57 +02:00
nmi-cmdline-reader.c initrd: generate initrd generator profiles with autoconnect-priority -100 2022-09-15 18:23:57 +02:00
nmi-dt-reader.c initrd: generate initrd generator profiles with autoconnect-priority -100 2022-09-15 18:23:57 +02:00
nmi-ibft-reader.c glib-aux: add and use nm_uuid_generate_from_strings_old() 2022-10-11 09:03:17 +02:00
README.md all: add some README.md files describing the purpose of our sources 2021-08-19 17:51:11 +02:00

nm-initrd-generator

A command line tool that generates NetworkManager configuration.

This is supposed to be run by dracut in initrd, before NetworkManager starts. It parses the kernel command line, generates configuration and quits.

See:

  • man 8 nm-initrd-generator ([www])
  • man 7 dracut.cmdline