diff options
author | Thomas Haller <thaller@redhat.com> | 2018-10-24 09:38:34 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-10-31 13:47:17 +0100 |
commit | 7d883c200009d0e0f3ecadd63ccda979b61149fd (patch) | |
tree | e37b44741c418a158c92699c846d9a4433585a06 | |
parent | b32545badc408d948a9c8542828a2a8bfc94999c (diff) | |
download | NetworkManager-th/dhcp-match-spec.tar.gz |
contrib/rpm: add "00-server-dhcp-client-id.conf"th/dhcp-match-spec
While this is packaged also in "NetworkManager-config-server.rpm"
sub-package, it's not in "00-server.conf" file. The reason
is that a convenient way to disable configuration from
"/usr/lib/NetworkManager/conf.d", is by putting a (possibly empty)
file into /etc directory with the same name. If the sub-package
only provides one "00-server.conf" file, this is no longer possible
at a granular level.
-rw-r--r-- | contrib/fedora/rpm/00-server-dhcp-client-id.conf | 6 | ||||
-rw-r--r-- | contrib/fedora/rpm/NetworkManager.spec | 11 | ||||
-rwxr-xr-x | contrib/fedora/rpm/build.sh | 4 | ||||
-rw-r--r-- | src/tests/config/test-config.c | 2 |
4 files changed, 18 insertions, 5 deletions
diff --git a/contrib/fedora/rpm/00-server-dhcp-client-id.conf b/contrib/fedora/rpm/00-server-dhcp-client-id.conf new file mode 100644 index 0000000000..afaf0ca9a1 --- /dev/null +++ b/contrib/fedora/rpm/00-server-dhcp-client-id.conf @@ -0,0 +1,6 @@ +# default the DHCP client-id to MAC (instead of type 255, node-specific RFC 4361). +# But don't do so for dhclient DHCP plugin, as the default of dhclient may +# be specified via /etc/dhcp (and anyway defaults to "hardware" already). +[connection-00-server-dhcp-client-id] +match-device=except:dhcp-plugin:dhclient +ipv4.dhcp-client-id=mac diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index fdb68a0ee1..9c323c540d 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -117,8 +117,9 @@ URL: http://www.gnome.org/projects/NetworkManager/ Source: __SOURCE1__ Source1: NetworkManager.conf Source2: 00-server.conf -Source3: 20-connectivity-fedora.conf -Source4: 20-connectivity-redhat.conf +Source3: 00-server-dhcp-client-id.conf +Source4: 20-connectivity-fedora.conf +Source5: 20-connectivity-redhat.conf #Patch1: 0001-some.patch @@ -677,13 +678,14 @@ make install DESTDIR=%{buildroot} cp %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/ cp %{SOURCE2} %{buildroot}%{nmlibdir}/conf.d/ +cp %{SOURCE3} %{buildroot}%{nmlibdir}/conf.d/ %if %{with connectivity_fedora} -cp %{SOURCE3} %{buildroot}%{nmlibdir}/conf.d/ +cp %{SOURCE4} %{buildroot}%{nmlibdir}/conf.d/ %endif %if %{with connectivity_redhat} -cp %{SOURCE4} %{buildroot}%{nmlibdir}/conf.d/ +cp %{SOURCE5} %{buildroot}%{nmlibdir}/conf.d/ %endif cp examples/dispatcher/10-ifcfg-rh-routes.sh %{buildroot}%{_sysconfdir}/%{name}/dispatcher.d/ @@ -961,6 +963,7 @@ fi %dir %{nmlibdir} %dir %{nmlibdir}/conf.d %{nmlibdir}/conf.d/00-server.conf +%{nmlibdir}/conf.d/00-server-dhcp-client-id.conf %files dispatcher-routing-rules diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh index 017aab9c30..375c97eeec 100755 --- a/contrib/fedora/rpm/build.sh +++ b/contrib/fedora/rpm/build.sh @@ -18,6 +18,7 @@ # SOURCE_FROM_GIT=|1|0 # SOURCE_NETWORKMANAGER_CONF= # SOURCE_CONFIG_SERVER= +# SOURCE_CONFIG_SERVER_DHCP_CLIENT_ID= # SOURCE_CONFIG_CONNECTIVITY_FEDORA= # SOURCE_CONFIG_CONNECTIVITY_REDHAT= @@ -121,6 +122,7 @@ fi SOURCE_NETWORKMANAGER_CONF="$(abs_path "$SOURCE_NETWORKMANAGER_CONF" "$SCRIPTDIR/NetworkManager.conf")" || die "invalid \$SOURCE_NETWORKMANAGER_CONF argument" SOURCE_CONFIG_SERVER="$(abs_path "$SOURCE_CONFIG_SERVER" "$SCRIPTDIR/00-server.conf")" || die "invalid \$SOURCE_CONFIG_SERVER argument" +SOURCE_CONFIG_SERVER_DHCP_CLIENT_ID="$(abs_path "$SOURCE_CONFIG_SERVER_DHCP_CLIENT_ID" "$SCRIPTDIR/00-server-dhcp-client-id.conf")" || die "invalid \$SOURCE_CONFIG_SERVER_DHCP_CLIENT_ID argument" SOURCE_CONFIG_CONNECTIVITY_FEDORA="$(abs_path "$SOURCE_CONFIG_CONNECTIVITY_FEDORA" "$SCRIPTDIR/20-connectivity-fedora.conf")" || die "invalid \$SOURCE_CONFIG_CONNECTIVITY_FEDORA argument" SOURCE_CONFIG_CONNECTIVITY_REDHAT="$(abs_path "$SOURCE_CONFIG_CONNECTIVITY_REDHAT" "$SCRIPTDIR/20-connectivity-redhat.conf")" || die "invalid \$SOURCE_CONFIG_CONNECTIVITY_REDHAT argument" @@ -144,6 +146,7 @@ LOG "SOURCE=$SOURCE" LOG "SOURCE_FROM_GIT=$SOURCE_FROM_GIT" LOG "SOURCE_NETWORKMANAGER_CONF=$SOURCE_NETWORKMANAGER_CONF" LOG "SOURCE_CONFIG_SERVER=$SOURCE_CONFIG_SERVER" +LOG "SOURCE_CONFIG_SERVER_DHCP_CLIENT_ID=$SOURCE_CONFIG_SERVER_DHCP_CLIENT_ID" LOG "SOURCE_CONFIG_CONNECTIVITY_FEDORA=$SOURCE_CONFIG_CONNECTIVITY_FEDORA" LOG "SOURCE_CONFIG_CONNECTIVITY_REDHAT=$SOURCE_CONFIG_CONNECTIVITY_REDHAT" LOG "BUILDTYPE=$BUILDTYPE" @@ -164,6 +167,7 @@ if [[ "$(dirname "$SOURCE")" != "$TEMP/SOURCES" ]]; then fi cp "$SOURCE_NETWORKMANAGER_CONF" "$TEMP/SOURCES/NetworkManager.conf" || die "Could not copy source $SOURCE_NETWORKMANAGER_CONF to $TEMP/SOURCES" cp "$SOURCE_CONFIG_SERVER" "$TEMP/SOURCES/00-server.conf" || die "Could not copy source $SOURCE_CONFIG_SERVER to $TEMP/SOURCES" +cp "$SOURCE_CONFIG_SERVER_DHCP_CLIENT_ID" "$TEMP/SOURCES/00-server-dhcp-client-id.conf" || die "Could not copy source $SOURCE_CONFIG_SERVER_DHCP_CLIENT_ID to $TEMP/SOURCES" cp "$SOURCE_CONFIG_CONNECTIVITY_FEDORA" "$TEMP/SOURCES/20-connectivity-fedora.conf" || die "Could not copy source $SOURCE_CONFIG_CONNECTIVITY_FEDORA to $TEMP/SOURCES" cp "$SOURCE_CONFIG_CONNECTIVITY_REDHAT" "$TEMP/SOURCES/20-connectivity-redhat.conf" || die "Could not copy source $SOURCE_CONFIG_CONNECTIVITY_REDHAT to $TEMP/SOURCES" diff --git a/src/tests/config/test-config.c b/src/tests/config/test-config.c index 3050e6fa52..20a05df137 100644 --- a/src/tests/config/test-config.c +++ b/src/tests/config/test-config.c @@ -129,7 +129,7 @@ setup_config (GError **error, const char *config_file, const char *intern_config NMDhcpManager *dhcp_manager; gpointer logging_old_state; - logging_old_state = nmtst_logging_disable (); + logging_old_state = nmtst_logging_disable (FALSE); dhcp_manager = nm_dhcp_manager_get (); g_test_assert_expected_messages (); |