From 789c4182bfe3ddedc6e9e7f254f1ac53b706e1c8 Mon Sep 17 00:00:00 2001 From: Andrei Gherzan Date: Thu, 30 Mar 2023 15:32:06 +0100 Subject: [PATCH] UBUNTU: [Packaging] Copy expoline.o only when produced by the build BugLink: https://bugs.launchpad.net/bugs/2013209 CONFIG_EXPOLINE_EXTERN has been enabled for s390x [LP:#2013209]. While this works as expected on the base kernels, it might not work on some derivatives: for example focal:hwe-5.15 (derived from Jammy). On Focal, this config can't be enabled due to the GCC version it comes with. CONFIG_EXPOLINE_EXTERN requires >= 110200 while Focal comes with 90400. This change adds a check on the existence of the expoline object file(s) that are packaged later. This also makes the code more robust generally. Signed-off-by: Andrei Gherzan Signed-off-by: Andrea Righi --- debian/rules.d/2-binary-arch.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index a11aaa5d3bf7d..35661b61c9c3a 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -349,8 +349,10 @@ ifeq ($(build_arch),powerpc) cp $(builddir)/build-$*/arch/powerpc/lib/*.o $(hdrdir)/arch/powerpc/lib endif ifeq ($(build_arch),s390) - mkdir -p $(hdrdir)/arch/s390/lib/expoline/ - cp $(builddir)/build-$*/arch/s390/lib/expoline/*.o $(hdrdir)/arch/s390/lib/expoline/ + if [ -n "$$(find $(builddir)/build-$*/arch/s390/lib/expoline -maxdepth 1 -name '*.o' -print -quit)" ]; then \ + mkdir -p $(hdrdir)/arch/s390/lib/expoline/; \ + cp $(builddir)/build-$*/arch/s390/lib/expoline/*.o $(hdrdir)/arch/s390/lib/expoline/; \ + fi endif # Copy over scripts/module.lds for building external modules cp $(builddir)/build-$*/scripts/module.lds $(hdrdir)/scripts