From b2722219e7fcfa01d9e74e703cccb58c0efdb375 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 24 Oct 2018 09:38:34 +0200 Subject: [PATCH] contrib/rpm: add "00-server-dhcp-client-id.conf" While this is packaged 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 large "00-server.conf" file, this is no longer possible at a granular level. (cherry picked from commit 7a46ccff00858e23ecb0615ee46c812337dc2501) --- contrib/fedora/rpm/00-server-dhcp-client-id.conf | 6 ++++++ contrib/fedora/rpm/NetworkManager.spec | 11 +++++++---- contrib/fedora/rpm/build.sh | 4 ++++ 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 contrib/fedora/rpm/00-server-dhcp-client-id.conf 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 e9aa69ee3d..80fdb3ff02 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 @@ -675,13 +676,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/ @@ -960,6 +962,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 bd92f1eb2c..921718b01c 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"