Skip to content

Commit

Permalink
Build a linux devkit Tools.gmk patch
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Leonard <[email protected]>
  • Loading branch information
andrew-m-leonard committed Mar 22, 2024
1 parent 37c03ab commit e0f7953
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions pipelines/build/devkit/Tools.gmk.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/make/devkit/Tools.gmk b/make/devkit/Tools.gmk
index 187320ca2..022d816f1 100644
index 187320ca2..c9d3f0076 100644
--- a/make/devkit/Tools.gmk
+++ b/make/devkit/Tools.gmk
@@ -62,6 +62,23 @@ ifeq ($(BASE_OS), OL)
Expand Down Expand Up @@ -66,29 +66,29 @@ index 187320ca2..022d816f1 100644
@@ -246,7 +283,13 @@ download-rpms:
# Only run this if rpm dir is empty.
ifeq ($(wildcard $(DOWNLOAD_RPMS)/*.rpm), )
cd $(DOWNLOAD_RPMS) && \
- wget -r -np -nd $(patsubst %, -A "*%*.rpm", $(RPM_LIST)) $(BASE_URL)
+ wget -e robots=off -r -np -nd $(patsubst %, -A "*%*.rpm", $(RPM_LIST)) $(BASE_URL)
+ gpg --keyserver keyserver.ubuntu.com --recv-keys \
+ $($(BASE_OS)_$(BASE_OS_MAJOR_VERSION)_GPG_KEY_$(ARCH))
+ rm -f $(DOWNLOAD_RPMS)/rpm.sig && gpg --armor --export \
+ $($(BASE_OS)_$(BASE_OS_MAJOR_VERSION)_GPG_KEY_$(ARCH)) > $(DOWNLOAD_RPMS)/rpm.sig
+ rpm --import $(DOWNLOAD_RPMS)/rpm.sig
+ rpm -K $(DOWNLOAD_RPMS)/*.rpm
cd $(DOWNLOAD_RPMS) && \
- wget -r -np -nd $(patsubst %, -A "*%*.rpm", $(RPM_LIST)) $(BASE_URL)
+ wget -e robots=off -r -np -nd $(patsubst %, -A "*%*.rpm", $(RPM_LIST)) $(BASE_URL)
+ gpg --keyserver keyserver.ubuntu.com --recv-keys \
+ $($(BASE_OS)_$(BASE_OS_MAJOR_VERSION)_GPG_KEY_$(ARCH))
+ rm -f $(DOWNLOAD_RPMS)/rpm.sig && gpg --armor --export \
+ $($(BASE_OS)_$(BASE_OS_MAJOR_VERSION)_GPG_KEY_$(ARCH)) > $(DOWNLOAD_RPMS)/rpm.sig
+ rpm --import $(DOWNLOAD_RPMS)/rpm.sig
+ rpm -K $(DOWNLOAD_RPMS)/*.rpm
endif

##########################################################################################
@@ -271,6 +314,14 @@ define Download

$$($(1)_FILE) :
wget -P $(DOWNLOAD) $$($(1))
wget -P $(DOWNLOAD) $$($(1))
+ ifeq ($(1),MPFR)
+ echo $($(1)_SHA256) $$@ | sha256sum -c
+ echo $($(1)_SHA256) $$@ | sha256sum -c
+ else
+ wget -P $(DOWNLOAD) $$($(1)).$($(1)_SIG)
+ gpg --keyserver keyserver.ubuntu.com --recv-keys $($(1)_GPG_KEY)
+ echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $($(1)_GPG_KEY) trust;
+ gpg --verify $$@.$($(1)_SIG) $$@
+ wget -P $(DOWNLOAD) $$($(1)).$($(1)_SIG)
+ gpg --keyserver keyserver.ubuntu.com --recv-keys $($(1)_GPG_KEY)
+ echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key $($(1)_GPG_KEY) trust;
+ gpg --verify $$@.$($(1)_SIG) $$@
+ endif
endef

Expand All @@ -103,13 +103,14 @@ index 187320ca2..022d816f1 100644
+# Assuming GNU sed for --in-place, hack socket.h to eliminate RHEL-7.6
+# to RHEL-7.9 line number shift.
$(libs) : $(rpms)
@echo Patching libc and pthreads
@(for f in `find $(SYSROOT) -name libc.so -o -name libpthread.so`; do \
@echo Patching libc and pthreads
@(for f in `find $(SYSROOT) -name libc.so -o -name libpthread.so`; do \
@@ -332,6 +388,8 @@ $(libs) : $(rpms)
-e 's|/lib/||g' ) > $$f.tmp ; \
mv $$f.tmp $$f ; \
done)
+ @find $(SYSROOT) -name '*.[ao]' -exec objcopy --remove-section .comment '{}' ';'
+ sed --in-place '/^#define [AP]F_\(IB\|MPLS\).*/d' $(SYSROOT)/usr/include/bits/socket.h
@mkdir -p $(SYSROOT)/usr/lib
@touch $@
-e 's|/lib/||g' ) > $$f.tmp ; \
mv $$f.tmp $$f ; \
done)
+ @find $(SYSROOT) -name '*.[ao]' -exec objcopy --remove-section .comment '{}' ';'
+ sed --in-place '/^#define [AP]F_\(IB\|MPLS\).*/d' $(SYSROOT)/usr/include/bits/socket.h
@mkdir -p $(SYSROOT)/usr/lib
@touch $@

0 comments on commit e0f7953

Please sign in to comment.