From 13f78f79f27f7ce315e9dc75e3a4fc574e1c5c18937ab81af31b385bed722eab Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 31 May 2023 08:46:22 +0000 Subject: [PATCH] Accepting request 1089937 from home:michals Split off patch to build correctly on Leap * testsuite-Move-setup-rootfs-logic-from-Makefile-to-s.patch OBS-URL: https://build.opensuse.org/request/show/1089937 OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=215 --- kmod-testsuite.spec | 5 +- kmod.changes | 1 + kmod.spec | 5 +- ...etup-rootfs-logic-from-Makefile-to-s.patch | 90 ++++++++++++++++++ usr-lib-modules.patch | 94 +------------------ 5 files changed, 98 insertions(+), 97 deletions(-) create mode 100644 testsuite-Move-setup-rootfs-logic-from-Makefile-to-s.patch diff --git a/kmod-testsuite.spec b/kmod-testsuite.spec index dd1fda8..d527f1c 100644 --- a/kmod-testsuite.spec +++ b/kmod-testsuite.spec @@ -43,7 +43,8 @@ Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch Patch9: 0001-testsuite-repair-read-of-uninitialized-memory.patch -Patch10: usr-lib-modules.patch +Patch10: testsuite-Move-setup-rootfs-logic-from-Makefile-to-s.patch +Patch11: usr-lib-modules.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook-xsl-stylesheets @@ -74,7 +75,7 @@ buildloop with the kernel. %setup -q -n kmod-%version %autopatch -p1 %if 0%{?suse_version} < 1550 -%patch10 -p1 -R +%patch11 -p1 -R %endif %build diff --git a/kmod.changes b/kmod.changes index 99553d1..a53433f 100644 --- a/kmod.changes +++ b/kmod.changes @@ -3,6 +3,7 @@ Fri May 26 10:22:03 UTC 2023 - Michal Suchanek - On usrmerged system move kernel modules into /usr as well (boo#1211796) * usr-lib-modules.patch + * testsuite-Move-setup-rootfs-logic-from-Makefile-to-s.patch - Refresh usr-lib-modprobe.patch - Refresh no-stylesheet-download.patch diff --git a/kmod.spec b/kmod.spec index f794ccd..8661f88 100644 --- a/kmod.spec +++ b/kmod.spec @@ -43,7 +43,8 @@ Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch Patch9: 0001-testsuite-repair-read-of-uninitialized-memory.patch -Patch10: usr-lib-modules.patch +Patch10: testsuite-Move-setup-rootfs-logic-from-Makefile-to-s.patch +Patch11: usr-lib-modules.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook-xsl-stylesheets @@ -116,7 +117,7 @@ in %lname. %prep %autosetup -p1 %if 0%{?suse_version} < 1550 -%patch10 -p1 -R +%patch11 -p1 -R %endif %build diff --git a/testsuite-Move-setup-rootfs-logic-from-Makefile-to-s.patch b/testsuite-Move-setup-rootfs-logic-from-Makefile-to-s.patch new file mode 100644 index 0000000..baaf762 --- /dev/null +++ b/testsuite-Move-setup-rootfs-logic-from-Makefile-to-s.patch @@ -0,0 +1,90 @@ +From 846439397efd9fa54763cc80da0e6d8bdf27c0e5 Mon Sep 17 00:00:00 2001 +From: Lucas De Marchi +Date: Thu, 9 Feb 2023 11:19:45 -0800 +Subject: [PATCH] testsuite: Move setup-rootfs logic from Makefile to script + +It's easier to implement the logic outside of the Makefile, so rename +the populate-modules.sh script to setup-rootfs.sh and move the +additional logic from the makefile to the script. + +Signed-off-by: Lucas De Marchi +Reviewed-by: Emil Velikov +--- + Makefile.am | 10 ++-------- + .../{populate-modules.sh => setup-rootfs.sh} | 19 +++++++++++++++++-- + 2 files changed, 19 insertions(+), 10 deletions(-) + rename testsuite/{populate-modules.sh => setup-rootfs.sh} (94%) + +diff --git a/Makefile.am b/Makefile.am +index e7313fa8a33e..32f4b80e9870 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -240,18 +240,12 @@ endif + # TESTSUITE + # ------------------------------------------------------------------------------ + +-EXTRA_DIST += testsuite/populate-modules.sh ++EXTRA_DIST += testsuite/setup-rootfs.sh + + MODULE_PLAYGROUND = testsuite/module-playground + ROOTFS = testsuite/rootfs + ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine +-CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) && \ +- cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \ +- find $(ROOTFS) -type d -exec chmod +w {} \; && \ +- find $(ROOTFS) -type f -name .gitignore -exec rm -f {} \; && \ +- $(top_srcdir)/testsuite/populate-modules.sh \ +- $(MODULE_PLAYGROUND) $(ROOTFS) $(top_builddir)/config.h ) && \ +- touch testsuite/stamp-rootfs ++CREATE_ROOTFS = $(AM_V_GEN) $(top_srcdir)/testsuite/setup-rootfs.sh $(ROOTFS_PRISTINE) $(ROOTFS) $(MODULE_PLAYGROUND) $(top_builddir)/config.h + + build-module-playground: + $(AM_V_GEN)if test "$(top_srcdir)" != "$(top_builddir)"; then \ +diff --git a/testsuite/populate-modules.sh b/testsuite/setup-rootfs.sh +similarity index 94% +rename from testsuite/populate-modules.sh +rename to testsuite/setup-rootfs.sh +index 099f02669156..d9cc627f7224 100755 +--- a/testsuite/populate-modules.sh ++++ b/testsuite/setup-rootfs.sh +@@ -2,9 +2,20 @@ + + set -e + +-MODULE_PLAYGROUND=$1 ++ROOTFS_PRISTINE=$1 + ROOTFS=$2 +-CONFIG_H=$3 ++MODULE_PLAYGROUND=$3 ++CONFIG_H=$4 ++ ++# create rootfs from rootfs-pristine ++ ++create_rootfs() { ++ rm -rf "$ROOTFS" ++ mkdir -p $(dirname "$ROOTFS") ++ cp -r "$ROOTFS_PRISTINE" "$ROOTFS" ++ find "$ROOTFS" -type d -exec chmod +w {} \; ++ find "$ROOTFS" -type f -name .gitignore -exec rm -f {} \; ++} + + feature_enabled() { + local feature=$1 +@@ -94,6 +105,8 @@ attach_pkcs7_array=( + "test-modinfo/mod-simple-pkcs7.ko" + ) + ++create_rootfs ++ + for k in "${!map[@]}"; do + dst=${ROOTFS}/$k + src=${MODULE_PLAYGROUND}/${map[$k]} +@@ -138,3 +151,5 @@ done + for m in "${attach_pkcs7_array[@]}"; do + cat "${MODULE_PLAYGROUND}/dummy.pkcs7" >>"${ROOTFS}/$m" + done ++ ++touch testsuite/stamp-rootfs +-- +2.40.0 + diff --git a/usr-lib-modules.patch b/usr-lib-modules.patch index 8ace7b5..ccdd56a 100644 --- a/usr-lib-modules.patch +++ b/usr-lib-modules.patch @@ -1,99 +1,7 @@ -From 846439397efd9fa54763cc80da0e6d8bdf27c0e5 Mon Sep 17 00:00:00 2001 -From: Lucas De Marchi -Date: Thu, 9 Feb 2023 11:19:45 -0800 -Subject: [PATCH 1/2] testsuite: Move setup-rootfs logic from Makefile to - script - -It's easier to implement the logic outside of the Makefile, so rename -the populate-modules.sh script to setup-rootfs.sh and move the -additional logic from the makefile to the script. - -Signed-off-by: Lucas De Marchi -Reviewed-by: Emil Velikov ---- - Makefile.am | 10 ++-------- - .../{populate-modules.sh => setup-rootfs.sh} | 19 +++++++++++++++++-- - 2 files changed, 19 insertions(+), 10 deletions(-) - rename testsuite/{populate-modules.sh => setup-rootfs.sh} (94%) - -diff --git a/Makefile.am b/Makefile.am -index e7313fa8a33e..32f4b80e9870 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -240,18 +240,12 @@ endif - # TESTSUITE - # ------------------------------------------------------------------------------ - --EXTRA_DIST += testsuite/populate-modules.sh -+EXTRA_DIST += testsuite/setup-rootfs.sh - - MODULE_PLAYGROUND = testsuite/module-playground - ROOTFS = testsuite/rootfs - ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine --CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) && \ -- cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \ -- find $(ROOTFS) -type d -exec chmod +w {} \; && \ -- find $(ROOTFS) -type f -name .gitignore -exec rm -f {} \; && \ -- $(top_srcdir)/testsuite/populate-modules.sh \ -- $(MODULE_PLAYGROUND) $(ROOTFS) $(top_builddir)/config.h ) && \ -- touch testsuite/stamp-rootfs -+CREATE_ROOTFS = $(AM_V_GEN) $(top_srcdir)/testsuite/setup-rootfs.sh $(ROOTFS_PRISTINE) $(ROOTFS) $(MODULE_PLAYGROUND) $(top_builddir)/config.h - - build-module-playground: - $(AM_V_GEN)if test "$(top_srcdir)" != "$(top_builddir)"; then \ -diff --git a/testsuite/populate-modules.sh b/testsuite/setup-rootfs.sh -similarity index 94% -rename from testsuite/populate-modules.sh -rename to testsuite/setup-rootfs.sh -index 099f02669156..d9cc627f7224 100755 ---- a/testsuite/populate-modules.sh -+++ b/testsuite/setup-rootfs.sh -@@ -2,9 +2,20 @@ - - set -e - --MODULE_PLAYGROUND=$1 -+ROOTFS_PRISTINE=$1 - ROOTFS=$2 --CONFIG_H=$3 -+MODULE_PLAYGROUND=$3 -+CONFIG_H=$4 -+ -+# create rootfs from rootfs-pristine -+ -+create_rootfs() { -+ rm -rf "$ROOTFS" -+ mkdir -p $(dirname "$ROOTFS") -+ cp -r "$ROOTFS_PRISTINE" "$ROOTFS" -+ find "$ROOTFS" -type d -exec chmod +w {} \; -+ find "$ROOTFS" -type f -name .gitignore -exec rm -f {} \; -+} - - feature_enabled() { - local feature=$1 -@@ -94,6 +105,8 @@ attach_pkcs7_array=( - "test-modinfo/mod-simple-pkcs7.ko" - ) - -+create_rootfs -+ - for k in "${!map[@]}"; do - dst=${ROOTFS}/$k - src=${MODULE_PLAYGROUND}/${map[$k]} -@@ -138,3 +151,5 @@ done - for m in "${attach_pkcs7_array[@]}"; do - cat "${MODULE_PLAYGROUND}/dummy.pkcs7" >>"${ROOTFS}/$m" - done -+ -+touch testsuite/stamp-rootfs --- -2.40.0 - - From 220ef8e24e731da2d435ae85ad3003d1f215ef2f Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Fri, 26 May 2023 10:38:05 +0200 -Subject: [PATCH 2/2] libkmod: Search for kernel modules under $prefix +Subject: [PATCH] libkmod: Search for kernel modules under $prefix modprobe.d is now searched under /usr/lib, search kernel modules there as well.