From e7cbe925fe1a4465dc3fbec56a55b771e1463479 Mon Sep 17 00:00:00 2001 From: Andrew Phelps Date: Wed, 3 Nov 2021 11:35:50 -0700 Subject: [PATCH] update gen-ld-script.sh (#1610) --- SPECS/mariner-rpm-macros/gen-ld-script.sh | 11 +++++++---- .../mariner-rpm-macros.signatures.json | 2 +- SPECS/mariner-rpm-macros/mariner-rpm-macros.spec | 6 +++++- .../manifests/package/pkggen_core_aarch64.txt | 4 ++-- .../manifests/package/pkggen_core_x86_64.txt | 4 ++-- .../resources/manifests/package/toolchain_aarch64.txt | 4 ++-- .../resources/manifests/package/toolchain_x86_64.txt | 4 ++-- 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/SPECS/mariner-rpm-macros/gen-ld-script.sh b/SPECS/mariner-rpm-macros/gen-ld-script.sh index 081165b8a8..559e62f806 100755 --- a/SPECS/mariner-rpm-macros/gen-ld-script.sh +++ b/SPECS/mariner-rpm-macros/gen-ld-script.sh @@ -9,8 +9,8 @@ # /usr/lib/rpm/mariner/gen-ld-script.sh %{name} %{version} echo "gen-ld-script.sh name($1) version($2)" -OS_ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"') -OS_VERSION=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"') +OS_ID=$(sed -En 's/^ID="?([^"]+)"?/\1/p' /etc/os-release) +OS_VERSION=$(sed -En 's/^VERSION_ID="?([^"]+)"?/\1/p' /etc/os-release) # Count number of dot separators in $2 (version) NUM_DOT_SEPARATORS="${2//[^.]}" @@ -30,6 +30,10 @@ case ${#NUM_DOT_SEPARATORS} in ;; esac +MODULE_INFO_DIR="/usr/src/mariner/BUILD/" + +mkdir -pv $MODULE_INFO_DIR + /usr/lib/rpm/mariner/generate-package-note.py \ --os "$OS_ID" \ --osVersion "$OS_VERSION" \ @@ -38,9 +42,8 @@ esac --version "$2" \ --moduleVersion "$MODULEVERSION" \ --stamp "LinkerOnly" \ - --outdir "/usr/src/mariner/BUILD/" + --outdir $MODULE_INFO_DIR # Verify if .note.package is properly included in a binary # /usr/lib/rpm/mariner/verify-package-notes.sh .note.package - diff --git a/SPECS/mariner-rpm-macros/mariner-rpm-macros.signatures.json b/SPECS/mariner-rpm-macros/mariner-rpm-macros.signatures.json index e10d1ec707..cd82f6046e 100644 --- a/SPECS/mariner-rpm-macros/mariner-rpm-macros.signatures.json +++ b/SPECS/mariner-rpm-macros/mariner-rpm-macros.signatures.json @@ -7,7 +7,7 @@ "default-hardened-cc1": "2102bdfbb06934d95ceb3c81f789c59c9f77f91b0f996fd39588e0aa052d6f77", "default-hardened-ld": "4dbb822a27eed292759bc4e9cabb4b84f34fc6701535fcac2fdddac33328678b", "forge.lua": "7390af6e81d8d61bc6957127fe9ebdbf5223e96d3810855641bdecc2a03800b4", - "gen-ld-script.sh": "ee9ac71a5f55752520967e08ed3e30e5430a9d2780b834d5d79c1a55373e90d5", + "gen-ld-script.sh": "5d1df54acd8cebd736037f6992b73b407c9ff230e805ac847fef0a2d2f6c07ae", "generate-package-note.py": "cf2dec2cc315581e9eb1c1952f40636f61615a4ac621b983e27513276c28818d", "gpgverify": "db0e050f56b694497d70603a6f5c17dd60ddbcf7cee670616851cd389f6767c4", "macros": "0db278ad00670f210c07ef23defe359b430767b9140d51c25115435ec3a16c3a", diff --git a/SPECS/mariner-rpm-macros/mariner-rpm-macros.spec b/SPECS/mariner-rpm-macros/mariner-rpm-macros.spec index c1a51afce6..e623275d4d 100644 --- a/SPECS/mariner-rpm-macros/mariner-rpm-macros.spec +++ b/SPECS/mariner-rpm-macros/mariner-rpm-macros.spec @@ -6,7 +6,7 @@ Summary: Mariner specific rpm macro files Name: mariner-rpm-macros Version: 2.0 -Release: 6%{?dist} +Release: 7%{?dist} License: GPL+ AND MIT Vendor: Microsoft Corporation Distribution: Mariner @@ -123,6 +123,10 @@ install -p -m 644 -t %{buildroot}%{rcluadir}/srpm forge.lua %{_rpmconfigdir}/macros.d/macros.check %changelog +* Tue Nov 02 2021 Andrew Phelps - 2.0-7 +- Update linker script to use sed instead of "grep -P" and "tr" +- Create linker script output directory as needed + * Thu Oct 21 2021 Ismail Kose - 2.0-6 - Update generate-package-note.py tool to 2.1.2 - Add verify-package-notes.sh tool diff --git a/toolkit/resources/manifests/package/pkggen_core_aarch64.txt b/toolkit/resources/manifests/package/pkggen_core_aarch64.txt index 763302c08e..72a08a6553 100644 --- a/toolkit/resources/manifests/package/pkggen_core_aarch64.txt +++ b/toolkit/resources/manifests/package/pkggen_core_aarch64.txt @@ -208,8 +208,8 @@ pcre-libs-8.44-3.cm2.aarch64.rpm krb5-1.18-1.cm2.aarch64.rpm lua-5.3.5-11.cm2.aarch64.rpm lua-libs-5.3.5-11.cm2.aarch64.rpm -mariner-rpm-macros-2.0-6.cm2.noarch.rpm -mariner-check-macros-2.0-6.cm2.noarch.rpm +mariner-rpm-macros-2.0-7.cm2.noarch.rpm +mariner-check-macros-2.0-7.cm2.noarch.rpm libassuan-2.5.1-5.cm2.aarch64.rpm libgpg-error-1.32-6.cm2.aarch64.rpm libgcrypt-1.8.7-3.cm2.aarch64.rpm diff --git a/toolkit/resources/manifests/package/pkggen_core_x86_64.txt b/toolkit/resources/manifests/package/pkggen_core_x86_64.txt index a4b04cf213..99792399c9 100644 --- a/toolkit/resources/manifests/package/pkggen_core_x86_64.txt +++ b/toolkit/resources/manifests/package/pkggen_core_x86_64.txt @@ -208,8 +208,8 @@ pcre-libs-8.44-3.cm2.x86_64.rpm krb5-1.18-1.cm2.x86_64.rpm lua-5.3.5-11.cm2.x86_64.rpm lua-libs-5.3.5-11.cm2.x86_64.rpm -mariner-rpm-macros-2.0-6.cm2.noarch.rpm -mariner-check-macros-2.0-6.cm2.noarch.rpm +mariner-rpm-macros-2.0-7.cm2.noarch.rpm +mariner-check-macros-2.0-7.cm2.noarch.rpm libassuan-2.5.1-5.cm2.x86_64.rpm libgpg-error-1.32-6.cm2.x86_64.rpm libgcrypt-1.8.7-3.cm2.x86_64.rpm diff --git a/toolkit/resources/manifests/package/toolchain_aarch64.txt b/toolkit/resources/manifests/package/toolchain_aarch64.txt index 412386169f..882c916b44 100644 --- a/toolkit/resources/manifests/package/toolchain_aarch64.txt +++ b/toolkit/resources/manifests/package/toolchain_aarch64.txt @@ -244,7 +244,7 @@ m4-1.4.18-4.cm2.aarch64.rpm m4-debuginfo-1.4.18-4.cm2.aarch64.rpm make-4.2.1-5.cm2.aarch64.rpm make-debuginfo-4.2.1-5.cm2.aarch64.rpm -mariner-check-macros-2.0-6.cm2.noarch.rpm +mariner-check-macros-2.0-7.cm2.noarch.rpm mariner-release-2.0-1.cm2.noarch.rpm mariner-repos-2.0-1.cm2.noarch.rpm mariner-repos-extras-2.0-1.cm2.noarch.rpm @@ -254,7 +254,7 @@ mariner-repos-microsoft-preview-2.0-1.cm2.noarch.rpm mariner-repos-preview-2.0-1.cm2.noarch.rpm mariner-repos-ui-2.0-1.cm2.noarch.rpm mariner-repos-ui-preview-2.0-1.cm2.noarch.rpm -mariner-rpm-macros-2.0-6.cm2.noarch.rpm +mariner-rpm-macros-2.0-7.cm2.noarch.rpm meson-0.57.1-2.cm2.noarch.rpm mpfr-4.0.1-3.cm2.aarch64.rpm mpfr-debuginfo-4.0.1-3.cm2.aarch64.rpm diff --git a/toolkit/resources/manifests/package/toolchain_x86_64.txt b/toolkit/resources/manifests/package/toolchain_x86_64.txt index 2996be1ba3..d6195ca96d 100644 --- a/toolkit/resources/manifests/package/toolchain_x86_64.txt +++ b/toolkit/resources/manifests/package/toolchain_x86_64.txt @@ -244,7 +244,7 @@ m4-1.4.18-4.cm2.x86_64.rpm m4-debuginfo-1.4.18-4.cm2.x86_64.rpm make-4.2.1-5.cm2.x86_64.rpm make-debuginfo-4.2.1-5.cm2.x86_64.rpm -mariner-check-macros-2.0-6.cm2.noarch.rpm +mariner-check-macros-2.0-7.cm2.noarch.rpm mariner-release-2.0-1.cm2.noarch.rpm mariner-repos-2.0-1.cm2.noarch.rpm mariner-repos-extras-2.0-1.cm2.noarch.rpm @@ -254,7 +254,7 @@ mariner-repos-microsoft-preview-2.0-1.cm2.noarch.rpm mariner-repos-preview-2.0-1.cm2.noarch.rpm mariner-repos-ui-2.0-1.cm2.noarch.rpm mariner-repos-ui-preview-2.0-1.cm2.noarch.rpm -mariner-rpm-macros-2.0-6.cm2.noarch.rpm +mariner-rpm-macros-2.0-7.cm2.noarch.rpm meson-0.57.1-2.cm2.noarch.rpm mpfr-4.0.1-3.cm2.x86_64.rpm mpfr-debuginfo-4.0.1-3.cm2.x86_64.rpm