From ffe029ef99c501a0076ad6106a364bbb9c0d80ea Mon Sep 17 00:00:00 2001 From: zhipengl Date: Mon, 29 Oct 2018 04:41:59 +0800 Subject: [PATCH] Refactor patches for dhcp package. Use dhcp-config package to package config files for dhcp package. Rename files folder to patches Removed site.h which is not used Deployment test and ping test between VMs pass config and script files check pass. Story: 2003768 Task: 27582 Change-Id: Ib7fd3c0ed6d706f89d08890e90ccee42673b3679 Signed-off-by: zhipengl --- base/dhcp-config/centos/build_srpm.data | 2 + base/dhcp-config/centos/dhcp-config.spec | 36 +++++++++++++++ .../files/dhclient-enter-hooks | 0 .../files/dhclient.conf | 0 base/dhcp/centos/build_srpm.data | 3 +- base/dhcp/centos/files/site.h | 28 ------------ base/dhcp/centos/meta_patches/PATCH_ORDER | 3 -- .../dhclient-disable-NSUPDATE.patch | 8 ++-- .../mark-dhclient.conf-as-config.patch | 25 ----------- ...move-unecessary-dhcp-exit-hooks-file.patch | 44 ------------------- .../meta_patches/spec-dhcp-enter-hooks.patch | 41 ----------------- .../spec-include-TiS-patches.patch | 33 -------------- .../dhclient-dhcp6-wrs-install-uuid.patch | 0 .../dhclient-disable-NSUPDATE.patch | 0 .../dhclient-handle-wrs-install-uuid.patch | 0 .../dhclient-ipv6-bind-to-interface.patch | 0 ...ient-ipv6-conditionally-set-hostname.patch | 0 ...-restrict-interfaces-to-command-line.patch | 0 .../support-disable-nsupdate.patch | 0 centos_iso_image.inc | 1 + centos_pkg_dirs | 1 + 21 files changed, 45 insertions(+), 180 deletions(-) create mode 100644 base/dhcp-config/centos/build_srpm.data create mode 100644 base/dhcp-config/centos/dhcp-config.spec rename base/{dhcp/centos => dhcp-config}/files/dhclient-enter-hooks (100%) rename base/{dhcp/centos => dhcp-config}/files/dhclient.conf (100%) delete mode 100644 base/dhcp/centos/files/site.h delete mode 100644 base/dhcp/centos/meta_patches/mark-dhclient.conf-as-config.patch delete mode 100644 base/dhcp/centos/meta_patches/remove-unecessary-dhcp-exit-hooks-file.patch delete mode 100644 base/dhcp/centos/meta_patches/spec-dhcp-enter-hooks.patch rename base/dhcp/centos/{files => patches}/dhclient-dhcp6-wrs-install-uuid.patch (100%) rename base/dhcp/centos/{files => patches}/dhclient-disable-NSUPDATE.patch (100%) rename base/dhcp/centos/{files => patches}/dhclient-handle-wrs-install-uuid.patch (100%) rename base/dhcp/centos/{files => patches}/dhclient-ipv6-bind-to-interface.patch (100%) rename base/dhcp/centos/{files => patches}/dhclient-ipv6-conditionally-set-hostname.patch (100%) rename base/dhcp/centos/{files => patches}/dhclient-restrict-interfaces-to-command-line.patch (100%) rename base/dhcp/centos/{files => patches}/support-disable-nsupdate.patch (100%) diff --git a/base/dhcp-config/centos/build_srpm.data b/base/dhcp-config/centos/build_srpm.data new file mode 100644 index 000000000..2c3b2cb8b --- /dev/null +++ b/base/dhcp-config/centos/build_srpm.data @@ -0,0 +1,2 @@ +SRC_DIR="files" +TIS_PATCH_VER=1 diff --git a/base/dhcp-config/centos/dhcp-config.spec b/base/dhcp-config/centos/dhcp-config.spec new file mode 100644 index 000000000..1b9e66196 --- /dev/null +++ b/base/dhcp-config/centos/dhcp-config.spec @@ -0,0 +1,36 @@ +# Where dhcp configuration files are stored +%global dhcpconfdir %{_sysconfdir}/dhcp + +Summary: dhcp-config +Name: dhcp-config +Version: 1.0 +Release: %{tis_patch_ver}%{?_tis_dist} +License: Apache-2.0 +Group: base +Packager: StarlingX +URL: unknown +BuildArch: noarch +Source: %name-%version.tar.gz + +Requires: dhclient +Summary: package StarlingX configuration files of dhcp to system folder. + +%description +package StarlingX configuration files of dhcp to system folder. + +%prep +%setup + +%build + +%install +%{__install} -d %{buildroot}%{dhcpconfdir} +%{__install} -p -m 0755 dhclient-enter-hooks %{buildroot}%{dhcpconfdir}/dhclient-enter-hooks +%{__install} -p -m 0644 dhclient.conf %{buildroot}%{dhcpconfdir}/dhclient.conf + +%post + +%files +%config(noreplace) %{dhcpconfdir}/dhclient.conf +%{dhcpconfdir}/dhclient-enter-hooks + diff --git a/base/dhcp/centos/files/dhclient-enter-hooks b/base/dhcp-config/files/dhclient-enter-hooks similarity index 100% rename from base/dhcp/centos/files/dhclient-enter-hooks rename to base/dhcp-config/files/dhclient-enter-hooks diff --git a/base/dhcp/centos/files/dhclient.conf b/base/dhcp-config/files/dhclient.conf similarity index 100% rename from base/dhcp/centos/files/dhclient.conf rename to base/dhcp-config/files/dhclient.conf diff --git a/base/dhcp/centos/build_srpm.data b/base/dhcp/centos/build_srpm.data index b24625715..c428b1f1d 100644 --- a/base/dhcp/centos/build_srpm.data +++ b/base/dhcp/centos/build_srpm.data @@ -1,2 +1 @@ -COPY_LIST="$FILES_BASE/*" -TIS_PATCH_VER=8 +TIS_PATCH_VER=9 diff --git a/base/dhcp/centos/files/site.h b/base/dhcp/centos/files/site.h deleted file mode 100644 index 4c9392039..000000000 --- a/base/dhcp/centos/files/site.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * define config file location in ${S}/includes/site.h - * still need to take care of installation path (${sysconfdir}/dhcpd.conf) - * - * 7/22/2010 - qhe - */ - -/* Define this if you want DNS update functionality to be available. */ - -/* Enabling the DNS update functionality results in the creation of - two UDP sockets with random high port numbers, but these numbers - appear to ignore the configured net.ipv4.ip_local_port_range values. - As a result, there's potential for collision with ports reserved - for platform services. - Given that this functionality is not being used, disable it from - the build. */ -#undef NSUPDATE - -/* Define this if you aren't debugging and you want to save memory - (potentially a _lot_ of memory) by allocating leases in chunks rather - than one at a time. */ - -#define COMPACT_LEASES - - -/* local */ -#define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf" -#define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf" diff --git a/base/dhcp/centos/meta_patches/PATCH_ORDER b/base/dhcp/centos/meta_patches/PATCH_ORDER index 378deea32..a6d71d594 100644 --- a/base/dhcp/centos/meta_patches/PATCH_ORDER +++ b/base/dhcp/centos/meta_patches/PATCH_ORDER @@ -1,7 +1,4 @@ spec-include-TiS-patches.patch -spec-dhcp-enter-hooks.patch -remove-unecessary-dhcp-exit-hooks-file.patch dhclient-dhcp6-set-hostname.patch 0001-Update-package-versioning-for-TIS-format.patch -mark-dhclient.conf-as-config.patch dhclient-disable-NSUPDATE.patch diff --git a/base/dhcp/centos/meta_patches/dhclient-disable-NSUPDATE.patch b/base/dhcp/centos/meta_patches/dhclient-disable-NSUPDATE.patch index 021e0e793..f397b6798 100644 --- a/base/dhcp/centos/meta_patches/dhclient-disable-NSUPDATE.patch +++ b/base/dhcp/centos/meta_patches/dhclient-disable-NSUPDATE.patch @@ -11,7 +11,7 @@ diff --git a/SPECS/dhcp.spec b/SPECS/dhcp.spec index fc17edb..b0a385e 100644 --- a/SPECS/dhcp.spec +++ b/SPECS/dhcp.spec -@@ -122,6 +122,7 @@ Patch103: dhclient-ipv6-bind-to-interface.patch +@@ -118,6 +118,7 @@ Patch103: dhclient-ipv6-bind-to-interface.patch Patch104: dhclient-ipv6-conditionally-set-hostname.patch Patch105: dhclient-handle-wrs-install-uuid.patch Patch106: dhclient-dhcp6-wrs-install-uuid.patch @@ -19,7 +19,7 @@ index fc17edb..b0a385e 100644 BuildRequires: autoconf BuildRequires: automake -@@ -458,6 +459,7 @@ rm -rf includes/isc-dhcp +@@ -454,6 +455,7 @@ rm -rf includes/isc-dhcp %patch104 -p1 %patch105 -p1 %patch106 -p1 @@ -27,7 +27,7 @@ index fc17edb..b0a385e 100644 # Update paths in all man pages for page in client/dhclient.conf.5 client/dhclient.leases.5 \ -@@ -479,6 +481,7 @@ done +@@ -475,6 +477,7 @@ done #libtoolize --copy --force autoreconf --verbose --force --install @@ -35,7 +35,7 @@ index fc17edb..b0a385e 100644 CFLAGS="%{optflags} -fno-strict-aliasing" \ %configure \ --with-srv-lease-file=%{_localstatedir}/lib/dhcpd/dhcpd.leases \ -@@ -493,6 +496,7 @@ CFLAGS="%{optflags} -fno-strict-aliasing" \ +@@ -489,6 +492,7 @@ CFLAGS="%{optflags} -fno-strict-aliasing" \ --with-ldap \ --with-ldapcrypto \ --with-libbind=%{_includedir} --with-libbind-libs=%{_libdir} \ diff --git a/base/dhcp/centos/meta_patches/mark-dhclient.conf-as-config.patch b/base/dhcp/centos/meta_patches/mark-dhclient.conf-as-config.patch deleted file mode 100644 index cc2f74bdc..000000000 --- a/base/dhcp/centos/meta_patches/mark-dhclient.conf-as-config.patch +++ /dev/null @@ -1,25 +0,0 @@ -From fd8de766f09dd6cb836b7f9823eaa0ad17eaf2d3 Mon Sep 17 00:00:00 2001 -From: Scott Little -Date: Mon, 2 Oct 2017 15:25:05 -0400 -Subject: WRS: mark-dhclient.conf-as-config.patch - ---- - SPECS/dhcp.spec | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/SPECS/dhcp.spec b/SPECS/dhcp.spec -index 70c7a6d..fc17edb 100644 ---- a/SPECS/dhcp.spec -+++ b/SPECS/dhcp.spec -@@ -722,7 +722,7 @@ done - %attr(0644,root,root) %{_mandir}/man8/dhclient-script.8.gz - - # WRS --%{dhcpconfdir}/dhclient.conf -+%config(noreplace) %{dhcpconfdir}/dhclient.conf - %{dhcpconfdir}/dhclient-enter-hooks - - %files common --- -2.7.4 - diff --git a/base/dhcp/centos/meta_patches/remove-unecessary-dhcp-exit-hooks-file.patch b/base/dhcp/centos/meta_patches/remove-unecessary-dhcp-exit-hooks-file.patch deleted file mode 100644 index 0a0cfe8ab..000000000 --- a/base/dhcp/centos/meta_patches/remove-unecessary-dhcp-exit-hooks-file.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 238c53632f948d293cbcfb4c92fba29096808080 Mon Sep 17 00:00:00 2001 -From: Scott Little -Date: Mon, 2 Oct 2017 15:25:05 -0400 -Subject: WRS: remove-unecessary-dhcp-exit-hooks-file.patch - ---- - SPECS/dhcp.spec | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/SPECS/dhcp.spec b/SPECS/dhcp.spec -index fd66dc4..42409f6 100644 ---- a/SPECS/dhcp.spec -+++ b/SPECS/dhcp.spec -@@ -40,10 +40,10 @@ Source9: azure-cloud.sh - Source10: README.scripts - - # WRS --Source20: dhclient-exit-hooks - Source21: dhclient.conf - Source22: dhclient-enter-hooks - -+ - Patch0: dhcp-4.2.0-errwarn-message.patch - Patch1: dhcp-4.2.4-dhclient-options.patch - Patch2: dhcp-4.2.0-release-by-ifup.patch -@@ -603,7 +603,6 @@ EOF - find ${RPM_BUILD_ROOT}/%{_libdir} -name '*.la' -exec '/bin/rm' '-f' '{}' ';'; - - # WRS: Overwrite with our config --%{__install} -p -m 0755 %{SOURCE20} %{buildroot}%{dhcpconfdir}/dhclient-exit-hooks - %{__install} -p -m 0644 %{SOURCE21} %{buildroot}%{dhcpconfdir}/dhclient.conf - %{__install} -p -m 0755 %{SOURCE22} %{buildroot}%{dhcpconfdir}/dhclient-enter-hooks - -@@ -723,7 +722,6 @@ done - %attr(0644,root,root) %{_mandir}/man8/dhclient-script.8.gz - - # WRS --%{dhcpconfdir}/dhclient-exit-hooks - %{dhcpconfdir}/dhclient.conf - %{dhcpconfdir}/dhclient-enter-hooks - --- -2.7.4 - diff --git a/base/dhcp/centos/meta_patches/spec-dhcp-enter-hooks.patch b/base/dhcp/centos/meta_patches/spec-dhcp-enter-hooks.patch deleted file mode 100644 index 3b70c7290..000000000 --- a/base/dhcp/centos/meta_patches/spec-dhcp-enter-hooks.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 79b8e2f34a5746e43e64e375c4fbf236de064c63 Mon Sep 17 00:00:00 2001 -From: Scott Little -Date: Mon, 2 Oct 2017 15:25:05 -0400 -Subject: WRS: spec-dhcp-enter-hooks.patch - ---- - SPECS/dhcp.spec | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/SPECS/dhcp.spec b/SPECS/dhcp.spec -index 904e3ad..fd66dc4 100644 ---- a/SPECS/dhcp.spec -+++ b/SPECS/dhcp.spec -@@ -42,7 +42,7 @@ Source10: README.scripts - # WRS - Source20: dhclient-exit-hooks - Source21: dhclient.conf -- -+Source22: dhclient-enter-hooks - - Patch0: dhcp-4.2.0-errwarn-message.patch - Patch1: dhcp-4.2.4-dhclient-options.patch -@@ -605,6 +605,7 @@ find ${RPM_BUILD_ROOT}/%{_libdir} -name '*.la' -exec '/bin/rm' '-f' '{}' ';'; - # WRS: Overwrite with our config - %{__install} -p -m 0755 %{SOURCE20} %{buildroot}%{dhcpconfdir}/dhclient-exit-hooks - %{__install} -p -m 0644 %{SOURCE21} %{buildroot}%{dhcpconfdir}/dhclient.conf -+%{__install} -p -m 0755 %{SOURCE22} %{buildroot}%{dhcpconfdir}/dhclient-enter-hooks - - %pre - # /usr/share/doc/setup/uidgid -@@ -724,6 +725,7 @@ done - # WRS - %{dhcpconfdir}/dhclient-exit-hooks - %{dhcpconfdir}/dhclient.conf -+%{dhcpconfdir}/dhclient-enter-hooks - - %files common - %doc LICENSE README RELNOTES doc/References.txt --- -2.7.4 - diff --git a/base/dhcp/centos/meta_patches/spec-include-TiS-patches.patch b/base/dhcp/centos/meta_patches/spec-include-TiS-patches.patch index 1c7f41e71..7d0c8f0f9 100644 --- a/base/dhcp/centos/meta_patches/spec-include-TiS-patches.patch +++ b/base/dhcp/centos/meta_patches/spec-include-TiS-patches.patch @@ -11,17 +11,6 @@ diff --git a/SPECS/dhcp.spec b/SPECS/dhcp.spec index 14da097..904e3ad 100644 --- a/SPECS/dhcp.spec +++ b/SPECS/dhcp.spec -@@ -39,6 +39,10 @@ Source8: dhcrelay.service - Source9: azure-cloud.sh - Source10: README.scripts - -+# WRS -+Source20: dhclient-exit-hooks -+Source21: dhclient.conf -+ - - Patch0: dhcp-4.2.0-errwarn-message.patch - Patch1: dhcp-4.2.4-dhclient-options.patch @@ -111,6 +115,14 @@ Patch70: dhcp-4.2.5-reference_count_overflow.patch Patch71: dhcp-4.2.5-centos-branding.patch @@ -52,28 +41,6 @@ index 14da097..904e3ad 100644 # Update paths in all man pages for page in client/dhclient.conf.5 client/dhclient.leases.5 \ client/dhclient-script.8 client/dhclient.8 ; do -@@ -582,6 +602,10 @@ EOF - # Don't package libtool *.la files - find ${RPM_BUILD_ROOT}/%{_libdir} -name '*.la' -exec '/bin/rm' '-f' '{}' ';'; - -+# WRS: Overwrite with our config -+%{__install} -p -m 0755 %{SOURCE20} %{buildroot}%{dhcpconfdir}/dhclient-exit-hooks -+%{__install} -p -m 0644 %{SOURCE21} %{buildroot}%{dhcpconfdir}/dhclient.conf -+ - %pre - # /usr/share/doc/setup/uidgid - %global gid_uid 177 -@@ -697,6 +721,10 @@ done - %attr(0644,root,root) %{_mandir}/man8/dhclient.8.gz - %attr(0644,root,root) %{_mandir}/man8/dhclient-script.8.gz - -+# WRS -+%{dhcpconfdir}/dhclient-exit-hooks -+%{dhcpconfdir}/dhclient.conf -+ - %files common - %doc LICENSE README RELNOTES doc/References.txt - %attr(0644,root,root) %{_mandir}/man5/dhcp-options.5.gz -- 2.7.4 diff --git a/base/dhcp/centos/files/dhclient-dhcp6-wrs-install-uuid.patch b/base/dhcp/centos/patches/dhclient-dhcp6-wrs-install-uuid.patch similarity index 100% rename from base/dhcp/centos/files/dhclient-dhcp6-wrs-install-uuid.patch rename to base/dhcp/centos/patches/dhclient-dhcp6-wrs-install-uuid.patch diff --git a/base/dhcp/centos/files/dhclient-disable-NSUPDATE.patch b/base/dhcp/centos/patches/dhclient-disable-NSUPDATE.patch similarity index 100% rename from base/dhcp/centos/files/dhclient-disable-NSUPDATE.patch rename to base/dhcp/centos/patches/dhclient-disable-NSUPDATE.patch diff --git a/base/dhcp/centos/files/dhclient-handle-wrs-install-uuid.patch b/base/dhcp/centos/patches/dhclient-handle-wrs-install-uuid.patch similarity index 100% rename from base/dhcp/centos/files/dhclient-handle-wrs-install-uuid.patch rename to base/dhcp/centos/patches/dhclient-handle-wrs-install-uuid.patch diff --git a/base/dhcp/centos/files/dhclient-ipv6-bind-to-interface.patch b/base/dhcp/centos/patches/dhclient-ipv6-bind-to-interface.patch similarity index 100% rename from base/dhcp/centos/files/dhclient-ipv6-bind-to-interface.patch rename to base/dhcp/centos/patches/dhclient-ipv6-bind-to-interface.patch diff --git a/base/dhcp/centos/files/dhclient-ipv6-conditionally-set-hostname.patch b/base/dhcp/centos/patches/dhclient-ipv6-conditionally-set-hostname.patch similarity index 100% rename from base/dhcp/centos/files/dhclient-ipv6-conditionally-set-hostname.patch rename to base/dhcp/centos/patches/dhclient-ipv6-conditionally-set-hostname.patch diff --git a/base/dhcp/centos/files/dhclient-restrict-interfaces-to-command-line.patch b/base/dhcp/centos/patches/dhclient-restrict-interfaces-to-command-line.patch similarity index 100% rename from base/dhcp/centos/files/dhclient-restrict-interfaces-to-command-line.patch rename to base/dhcp/centos/patches/dhclient-restrict-interfaces-to-command-line.patch diff --git a/base/dhcp/centos/files/support-disable-nsupdate.patch b/base/dhcp/centos/patches/support-disable-nsupdate.patch similarity index 100% rename from base/dhcp/centos/files/support-disable-nsupdate.patch rename to base/dhcp/centos/patches/support-disable-nsupdate.patch diff --git a/centos_iso_image.inc b/centos_iso_image.inc index 3bc9a0ca5..6bf72f522 100644 --- a/centos_iso_image.inc +++ b/centos_iso_image.inc @@ -181,6 +181,7 @@ nfs-utils # dhcp dhcp dhclient +dhcp-config # openssh openssh diff --git a/centos_pkg_dirs b/centos_pkg_dirs index 105282e19..22e3c7a0c 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -7,6 +7,7 @@ ldap/nss-pam-ldapd base/centos-release filesystem/nfs-utils base/dhcp +base/dhcp-config base/openssh config/facter virt/qemu