From b9aef7289122cce32ac523ead047cb8c12d7faf9 Mon Sep 17 00:00:00 2001 From: Roberto Sassu Date: Wed, 24 Mar 2021 00:19:27 +0100 Subject: [PATCH] Pass custom passwd and group to gen_digest_lists --- ...passwd-and-group-to-gen_digest_lists.patch | 44 +++++++++++++++++++ openEuler-rpm-config.spec | 6 ++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 Pass-custom-passwd-and-group-to-gen_digest_lists.patch diff --git a/Pass-custom-passwd-and-group-to-gen_digest_lists.patch b/Pass-custom-passwd-and-group-to-gen_digest_lists.patch new file mode 100644 index 0000000..76d102d --- /dev/null +++ b/Pass-custom-passwd-and-group-to-gen_digest_lists.patch @@ -0,0 +1,44 @@ +From 8428bf9737f35fcdad8b76a438c9c7872de79512 Mon Sep 17 00:00:00 2001 +From: Roberto Sassu +Date: Wed, 24 Mar 2021 00:11:03 +0100 +Subject: [PATCH] Pass custom passwd and group to gen_digest_lists + +--- + brp-digest-list | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/brp-digest-list b/brp-digest-list +index c3b2156..f4bbe9a 100644 +--- a/brp-digest-list ++++ b/brp-digest-list +@@ -30,9 +30,19 @@ mkdir -p $DIGEST_LIST_DIR + mkdir -p $DIGEST_LIST_DIR.tlv + mkdir -p $DIGEST_LIST_DIR.sig + ++# Provide custom passwd and group if they exist ++if [ -f /usr/share/passwd_group_generator/passwd ]; then ++ PASSWD_OPT="-i U:/usr/share/passwd_group_generator/passwd" ++fi ++ ++if [ -f /usr/share/passwd_group_generator/group ]; then ++ GROUP_OPT="-i g:/usr/share/passwd_group_generator/group" ++fi ++ + # Generate digest list for the kernel + gen_digest_lists -i M: -t metadata -f compact -d $DIGEST_LIST_DIR -i l:policy \ + -i i: -o add -p -1 -m immutable -i L:$BIN_PKG_FILES -i u: \ ++ $PASSWD_OPT $GROUP_OPT \ + -A $RPM_BUILD_ROOT -i e: \ + -i F:/lib \ + -i F:/usr/lib \ +@@ -52,6 +62,7 @@ echo $f + # Generate TLV digest list to check metadata + gen_digest_lists -i M: -t metadata -f compact -d $DIGEST_LIST_DIR.tlv \ + -i l:policy -i i: -o add -p -1 -m immutable -i L:$BIN_PKG_FILES -i u: \ ++ $PASSWD_OPT $GROUP_OPT \ + -T -A $RPM_BUILD_ROOT -i e: \ + -i F:/lib \ + -i F:/usr/lib \ +-- +2.26.2 + diff --git a/openEuler-rpm-config.spec b/openEuler-rpm-config.spec index f13c06f..41d3017 100644 --- a/openEuler-rpm-config.spec +++ b/openEuler-rpm-config.spec @@ -9,7 +9,7 @@ Name: %{vendor}-rpm-config Version: 30 -Release: 19 +Release: 20 License: GPL+ Summary: specific rpm configuration files URL: https://gitee.com/openeuler/openEuler-rpm-config @@ -19,6 +19,7 @@ Source0: https://gitee.com/openeuler/openEuler-rpm-config/repository/arch Patch0: fix-error-message-for-kmodtool.patch Patch1: 0001-1-Add-riscv64-to-golang_arches.patch Patch2: Fix-a-typo-in-brp-digest-list.patch +Patch3: Pass-custom-passwd-and-group-to-gen_digest_lists.patch Patch9000: openEuler-replace-openEuler-with-_vendor-macro.patch %if %{vendor} != openEuler && %{change_vendor} == 1 @@ -150,6 +151,9 @@ popd %{_rpmconfigdir}/macros.d/macros.kmp %changelog +* Wed Mar 24 2021 Roberto Sassu - 30-20 +- Pass custom passwd and group to gen_digest_lists + * Wed Mar 17 2021 shenyangyang - 30-19 - Change the name of spec to openEuler-rpm-spec and fix few bugs -- Gitee