From 3406431fc5135d1fe44e3932f36997c8fe6c6e26 Mon Sep 17 00:00:00 2001 From: zhipengl Date: Tue, 20 Nov 2018 18:15:13 +0800 Subject: [PATCH] Refactor patches for util-linux package Use util-linux-config package to package config files for util-linux. Remove util-linux package folder and use RPM instead of SRPM for util-linux. Deployment test and ping test between VMs pass Config file check pass. Story: 2003768 Task: 27595 Depends-on: https://review.openstack.org/#/c/618943/ Change-Id: If90ed6df4a875a576c7ac709589ac221bb0fa2e3 Signed-off-by: zhipengl --- base/util-linux/centos/build_srpm.data | 2 - ...te-package-versioning-for-TIS-format.patch | 27 ------------ .../0003-util-linux-login-pamd.patch | 38 ----------------- .../centos/meta_patches/PATCH_ORDER | 3 -- .../spec-use-su-file-from-shadow.patch | 33 --------------- base/util-linux/centos/srpm_path | 1 - centos_iso_image.inc | 3 ++ centos_pkg_dirs | 2 +- .../util-linux-config/centos/build_srpm.data | 2 + .../centos/util-linux-config.spec | 42 +++++++++++++++++++ .../util-linux-config/files/stx.login | 19 +++++++++ .../util-linux-config/files/stx.su | 4 +- 12 files changed, 69 insertions(+), 107 deletions(-) delete mode 100644 base/util-linux/centos/build_srpm.data delete mode 100644 base/util-linux/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch delete mode 100644 base/util-linux/centos/meta_patches/0003-util-linux-login-pamd.patch delete mode 100644 base/util-linux/centos/meta_patches/PATCH_ORDER delete mode 100644 base/util-linux/centos/meta_patches/spec-use-su-file-from-shadow.patch delete mode 100644 base/util-linux/centos/srpm_path create mode 100644 config-files/util-linux-config/centos/build_srpm.data create mode 100644 config-files/util-linux-config/centos/util-linux-config.spec create mode 100644 config-files/util-linux-config/files/stx.login rename base/util-linux/files/pam.d/su => config-files/util-linux-config/files/stx.su (97%) diff --git a/base/util-linux/centos/build_srpm.data b/base/util-linux/centos/build_srpm.data deleted file mode 100644 index 8f80fa06a..000000000 --- a/base/util-linux/centos/build_srpm.data +++ /dev/null @@ -1,2 +0,0 @@ -COPY_LIST="files/pam.d/su" -TIS_PATCH_VER=4 diff --git a/base/util-linux/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch b/base/util-linux/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch deleted file mode 100644 index 0bad3184f..000000000 --- a/base/util-linux/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9ca3c8b4c62532cfbcdf5b9bf1c24a5a53e4f619 Mon Sep 17 00:00:00 2001 -From: Scott Little -Date: Mon, 2 Oct 2017 14:55:36 -0400 -Subject: [PATCH] WRS: 0001-Update-package-versioning-for-TIS-format.patch - -Conflicts: - SPECS/util-linux.spec ---- - SPECS/util-linux.spec | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/SPECS/util-linux.spec b/SPECS/util-linux.spec -index 537a03c..3897c16 100644 ---- a/SPECS/util-linux.spec -+++ b/SPECS/util-linux.spec -@@ -2,7 +2,7 @@ - Summary: A collection of basic system utilities - Name: util-linux - Version: 2.23.2 --Release: 52%{?dist} -+Release: 52.el7%{?_tis_dist}.%{tis_patch_ver} - License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain - Group: System Environment/Base - URL: http://en.wikipedia.org/wiki/Util-linux --- -2.7.4 - diff --git a/base/util-linux/centos/meta_patches/0003-util-linux-login-pamd.patch b/base/util-linux/centos/meta_patches/0003-util-linux-login-pamd.patch deleted file mode 100644 index e013f0aa1..000000000 --- a/base/util-linux/centos/meta_patches/0003-util-linux-login-pamd.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 3db968a14a7a93d08d9d801e79d96d05dc100519 Mon Sep 17 00:00:00 2001 -From: Scott Little -Date: Mon, 2 Oct 2017 14:55:36 -0400 -Subject: WRS: 0003-util-linux-login-pamd.patch - ---- - SOURCES/util-linux-login.pamd | 1 + - SPECS/util-linux.spec | 2 +- - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/SOURCES/util-linux-login.pamd b/SOURCES/util-linux-login.pamd -index 3c03927..9c57d31 100644 ---- a/SOURCES/util-linux-login.pamd -+++ b/SOURCES/util-linux-login.pamd -@@ -7,6 +7,7 @@ account include system-auth - password include system-auth - # pam_selinux.so close should be the first session rule - session required pam_selinux.so close -+session required pam_mkhomedir.so skel=/etc/skel umask=0022 - session required pam_loginuid.so - session optional pam_console.so - # pam_selinux.so open should only be followed by sessions to be executed in the user context -diff --git a/SPECS/util-linux.spec b/SPECS/util-linux.spec -index 4b045fd..537a03c 100644 ---- a/SPECS/util-linux.spec -+++ b/SPECS/util-linux.spec -@@ -738,7 +738,7 @@ fi - - %config(noreplace) %{_sysconfdir}/pam.d/chfn - %config(noreplace) %{_sysconfdir}/pam.d/chsh --%config(noreplace) %{_sysconfdir}/pam.d/login -+%config %{_sysconfdir}/pam.d/login - %config(noreplace) %{_sysconfdir}/pam.d/remote - %config(noreplace) %{_sysconfdir}/pam.d/su - %config(noreplace) %{_sysconfdir}/pam.d/su-l --- -2.7.4 - diff --git a/base/util-linux/centos/meta_patches/PATCH_ORDER b/base/util-linux/centos/meta_patches/PATCH_ORDER deleted file mode 100644 index c841c9d00..000000000 --- a/base/util-linux/centos/meta_patches/PATCH_ORDER +++ /dev/null @@ -1,3 +0,0 @@ -spec-use-su-file-from-shadow.patch -0003-util-linux-login-pamd.patch -0001-Update-package-versioning-for-TIS-format.patch diff --git a/base/util-linux/centos/meta_patches/spec-use-su-file-from-shadow.patch b/base/util-linux/centos/meta_patches/spec-use-su-file-from-shadow.patch deleted file mode 100644 index 5386d4caa..000000000 --- a/base/util-linux/centos/meta_patches/spec-use-su-file-from-shadow.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 1b4403d3c5b9fc0f73e1af70e34deb2d54a9c686 Mon Sep 17 00:00:00 2001 -From: Scott Little -Date: Mon, 2 Oct 2017 14:55:36 -0400 -Subject: WRS: spec-use-su-file-from-shadow.patch - ---- - SPECS/util-linux.spec | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/SPECS/util-linux.spec b/SPECS/util-linux.spec -index 48100e4..4b045fd 100644 ---- a/SPECS/util-linux.spec -+++ b/SPECS/util-linux.spec -@@ -41,6 +41,7 @@ Source12: util-linux-su.pamd - Source13: util-linux-su-l.pamd - Source14: util-linux-runuser.pamd - Source15: util-linux-runuser-l.pamd -+Source16: su - - ### Obsoletes & Conflicts & Provides - Conflicts: bash-completion < 1:2.1-1 -@@ -612,7 +613,7 @@ chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/sunhostid - install -m 644 %{SOURCE2} ./remote - install -m 644 %{SOURCE3} ./chsh - install -m 644 %{SOURCE3} ./chfn -- install -m 644 %{SOURCE12} ./su -+ install -m 644 %{SOURCE16} ./su - install -m 644 %{SOURCE13} ./su-l - install -m 644 %{SOURCE14} ./runuser - install -m 644 %{SOURCE15} ./runuser-l --- -2.7.4 - diff --git a/base/util-linux/centos/srpm_path b/base/util-linux/centos/srpm_path deleted file mode 100644 index 4251ec851..000000000 --- a/base/util-linux/centos/srpm_path +++ /dev/null @@ -1 +0,0 @@ -mirror:Source/util-linux-2.23.2-52.el7.src.rpm diff --git a/centos_iso_image.inc b/centos_iso_image.inc index 41db1f18e..0f2e3366d 100644 --- a/centos_iso_image.inc +++ b/centos_iso_image.inc @@ -334,3 +334,6 @@ update-motd # python2-ruamel-yaml python2-ruamel-yaml + +# util-linux-config +util-linux-config diff --git a/centos_pkg_dirs b/centos_pkg_dirs index 6a5db9ed4..2fbd146b9 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -1,7 +1,6 @@ tools/vm-topology base/initscripts base/initscripts-config -base/util-linux base/setup utilities/namespace-utils ldap/nss-pam-ldapd @@ -113,6 +112,7 @@ config-files/ntp-config config-files/syslog-ng-config config-files/rsync-config config-files/pam-config +config-files/util-linux-config tools/collector grub/grubby utilities/platform-util diff --git a/config-files/util-linux-config/centos/build_srpm.data b/config-files/util-linux-config/centos/build_srpm.data new file mode 100644 index 000000000..da1e20bd8 --- /dev/null +++ b/config-files/util-linux-config/centos/build_srpm.data @@ -0,0 +1,2 @@ +SRC_DIR="files" +TIS_PATCH_VER=0 diff --git a/config-files/util-linux-config/centos/util-linux-config.spec b/config-files/util-linux-config/centos/util-linux-config.spec new file mode 100644 index 000000000..0c226f1bb --- /dev/null +++ b/config-files/util-linux-config/centos/util-linux-config.spec @@ -0,0 +1,42 @@ +Summary: util-linux-config +Name: util-linux-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: util-linux +Summary: package StarlingX configuration files of util-linux to system folder. + +%description +package StarlingX configuration files of util-linux to system folder. + +%prep +%setup + +%build + +%install +%{__install} -d 644 %{buildroot}%{_datadir}/starlingx/ +%{__install} -m 644 stx.su %{buildroot}%{_datadir}/starlingx/stx.su +%{__install} -m 644 stx.login %{buildroot}%{_datadir}/starlingx/stx.login + +%post +%define _pamconfdir %{_sysconfdir}/pam.d +if [ $1 -eq 1 ] ; then + cp -f %{_datadir}/starlingx/stx.su %{_pamconfdir}/su + cp -f %{_datadir}/starlingx/stx.login %{_pamconfdir}/login +fi + +%preun + +%postun + +%files +%defattr(-,root,root) +%{_datadir}/starlingx/stx.su +%{_datadir}/starlingx/stx.login diff --git a/config-files/util-linux-config/files/stx.login b/config-files/util-linux-config/files/stx.login new file mode 100644 index 000000000..7950a8c2c --- /dev/null +++ b/config-files/util-linux-config/files/stx.login @@ -0,0 +1,19 @@ +#%PA-1.0 +auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so +auth substack system-auth +auth include postlogin +account required pam_nologin.so +account include system-auth +password include system-auth +# pam_selinux.so close should be the first session rule +session required pam_selinux.so close +session required pam_mkhomedir.so skel=/etc/skel umask=0022 +session required pam_loginuid.so +session optional pam_console.so +# pam_selinux.so open should only be followed by sessions to be executed in the user context +session required pam_selinux.so open +session required pam_namespace.so +session optional pam_keyinit.so force revoke +session include system-auth +session include postlogin +-session optional pam_ck_connector.so diff --git a/base/util-linux/files/pam.d/su b/config-files/util-linux-config/files/stx.su similarity index 97% rename from base/util-linux/files/pam.d/su rename to config-files/util-linux-config/files/stx.su index 921f56cc7..1d4e12b1a 100644 --- a/base/util-linux/files/pam.d/su +++ b/config-files/util-linux-config/files/stx.su @@ -31,13 +31,13 @@ auth sufficient pam_rootok.so # This module parses environment configuration file(s) # and also allows you to use an extended config # file /etc/security/pam_env.conf. -# +# # parsing /etc/environment needs "readenv=1" session required pam_env.so readenv=1 # Defines the MAIL environment variable # However, userdel also needs MAIL_DIR and MAIL_FILE variables -# in /etc/login.defs to make sure that removing a user +# in /etc/login.defs to make sure that removing a user # also removes the user's mail spool file. # See comments in /etc/login.defs #