From 2aef4e0d72ceae90fd03eb835ea86a0fe9ac7e61f1b2ca1271942604a732242f Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Wed, 20 Jun 2012 08:46:14 +0000 Subject: [PATCH 1/3] - Update to new upstream release 9 * build-sys: allow compressed modules in testsuite * build-sys: Make dirs writable on rootfs creation * depmod: use ferror and fclose to check for error * depmod: return error when index is truncated due to ENOSPC * depmod: fix coding-style issue in array declaration * depmod: fail if any index could not be created * depmod: don't return error if modules.builtin don't exist * libkmod-util: split function for usec conversion * libkmod-util: add missing stdbool.h include OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=30 --- kmod-8.tar.sign | 17 ----------------- kmod-8.tar.xz | 3 --- kmod-9.tar.sign | 17 +++++++++++++++++ kmod-9.tar.xz | 3 +++ kmod-so-version.diff | 23 ++++------------------- kmod.changes | 14 ++++++++++++++ kmod.spec | 4 ++-- 7 files changed, 40 insertions(+), 41 deletions(-) delete mode 100644 kmod-8.tar.sign delete mode 100644 kmod-8.tar.xz create mode 100644 kmod-9.tar.sign create mode 100644 kmod-9.tar.xz diff --git a/kmod-8.tar.sign b/kmod-8.tar.sign deleted file mode 100644 index e81b422..0000000 --- a/kmod-8.tar.sign +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.19 (GNU/Linux) - -iQIcBAABAgAGBQJPkB+LAAoJEJuipaYwy+pTceMP/R9gUY1h5mpShASzcRe50te2 -o8V/hiR83lbOAMWbmS9WSFnR6LWsP5zKO+HjcRMD38PkPFhSWtMjFhmsHFPtFoPj -5L4TaxFE/cqwzAwlwnBl1m8mGBtHvhVtxnwANm6LQ3f7yGjlLONrUBDTZ/XmGzSQ -s4a2csFU0Y+2FChpBRyiZmHRuY7ACZJdLPzw5UtVWQBay4mCo9AgQLDiE7LQb90F -h7ENgUPawxkVGUfIbqUgeWuFVg1ZYdqnSZ6GlJpAFQJRLlidSFuCvycICTnsI2pS -r6ddzDF6gMdzJhw51oTyl52Ith5AHuE4ZC847CUKFE1jPuakYINq/5Zll50SJZhM -wVh7KYydD3CYZlu+lTWsVpdT/orycxt+8etVsaOjNo/ZARnpnNTy9bGY2nGFpWoP -9VR22cHk/eXGzV7ngjP1bDdAWbRHQlE/NtRoF2jmuGlajISgjULkyAG82nVhuehz -zqiDph6wMYNjQC0PZF25AVmp+bSanyIPJvDkuigRBDVVPw9gKX392BcGNN6tlThf -cGMlry5UkHEiDElnaRnHGmvxlDYNISZYYYkRvR6RZZgMhL9q8HUNbcEILfvloMmd -IagHSAMGf62TRXq9KpzETJCPMBP6xA6Keic8Urd9XmLJlKx9yydeeoRW0AaBQ30m -NiyGC5z+z1GIM2mT7a0s -=oTaf ------END PGP SIGNATURE----- diff --git a/kmod-8.tar.xz b/kmod-8.tar.xz deleted file mode 100644 index f683f98..0000000 --- a/kmod-8.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:35f7d1dfcf62ea3d6da1ed0ee41a7997333680033609c5e9658f4fe8d997734d -size 986632 diff --git a/kmod-9.tar.sign b/kmod-9.tar.sign new file mode 100644 index 0000000..d73b8cc --- /dev/null +++ b/kmod-9.tar.sign @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.19 (GNU/Linux) + +iQIcBAABAgAGBQJP4QHcAAoJEJuipaYwy+pT9cYP/ig2VPtHtgONZkF99dcaPjVU +CZDa5tFbmwNYmV08ufPSDX1Dnz2x9TnlJQyOwR8PgOK0VSjqgAeVZhyMy2FDz7Iu +0QTFg3VhbFMYZbmvBEXuNw6ljIkmOk1BSMocbFJEaRSn19feW+JvlVugPOY+P9sM +/ySGPyz8r8DztbA6DA9QlICPl6/+AdxRMnkMp/ZGKChg72o7UgHwkebVZ4LaZ/gw +cbq4gvoiqsScfoaWjmXHexDAhmhw+uyvBOGLDCJI2UgnZtHawiBmpC7c7M38t8YJ +REySLixnmbL3jo5k2WMbYF2Q4rWoS8zyQtQHlyZznO31bXU8ma9he3vHHsrM2evO +yhIDm0eSJvFl2/qwBDUP8C92ekj7DoUFbs6BRAJoda+tmcmAVepg0P5kjmiYxMzC +BbscpRh3vBJ+/MSWsPAcT3OXQKBStwenfc2VN63hoS4ghIXFJDYeCmR2yM+UWsrr +SYjn5+Gs0cNO/mVxHILW9SHioUA+oJ8x4/ns6NUuVonBn2Itk4NdI6GoMM3hS3X8 +WT5WlqmvUCV6cb04Xh+N5ZoE0vRKCDJNN8Nye1XtHUUctZPrjmb7HwNUVwEFyQVt +RObsxQtsxpPUFNh5V8MQAxt2PVcW9K1xPPJNSBMQc+RLSBB5AjEzLDKkcNzHmcWo +oEDOGRlbO2Mgpu2gXD/3 +=wsDr +-----END PGP SIGNATURE----- diff --git a/kmod-9.tar.xz b/kmod-9.tar.xz new file mode 100644 index 0000000..de4dc19 --- /dev/null +++ b/kmod-9.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0607267cb62dbc9009d0719f442a56f97f64d9983e20dbcaedfff9073abdcecf +size 1122668 diff --git a/kmod-so-version.diff b/kmod-so-version.diff index 7e38cea..8c2e55f 100644 --- a/kmod-so-version.diff +++ b/kmod-so-version.diff @@ -1,28 +1,13 @@ -From: Jan Engelhardt -Upstream: this patch is too complex for upstream to handle - -Change the kmod Makefile from using -version-info to -version-number -to make it clear that the kmod project is not trying to subvert the -libtool "interface" number concept, but in fact does not do -libtool-style counting. - -References: -References: http://lists.gnu.org/archive/html/libtool/2012-02/msg00011.html - ---- - Makefile.am | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -Index: kmod-8/Makefile.am +Index: kmod-9/Makefile.am =================================================================== ---- kmod-8.orig/Makefile.am -+++ kmod-8/Makefile.am +--- kmod-9.orig/Makefile.am ++++ kmod-9/Makefile.am @@ -33,10 +33,6 @@ SED_PROCESS = \ %.pc: %.pc.in Makefile $(SED_PROCESS) -LIBKMOD_CURRENT=3 --LIBKMOD_REVISION=2 +-LIBKMOD_REVISION=3 -LIBKMOD_AGE=1 - noinst_LTLIBRARIES = libkmod/libkmod-util.la diff --git a/kmod.changes b/kmod.changes index 7c5406e..8282e5a 100644 --- a/kmod.changes +++ b/kmod.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Wed Jun 20 08:41:03 UTC 2012 - rmilasan@suse.com + +- Update to new upstream release 9 +* build-sys: allow compressed modules in testsuite +* build-sys: Make dirs writable on rootfs creation +* depmod: use ferror and fclose to check for error +* depmod: return error when index is truncated due to ENOSPC +* depmod: fix coding-style issue in array declaration +* depmod: fail if any index could not be created +* depmod: don't return error if modules.builtin don't exist +* libkmod-util: split function for usec conversion +* libkmod-util: add missing stdbool.h include + ------------------------------------------------------------------- Sat Apr 21 01:55:30 UTC 2012 - jengelh@medozas.de diff --git a/kmod.spec b/kmod.spec index 894e537..4025601 100644 --- a/kmod.spec +++ b/kmod.spec @@ -21,7 +21,7 @@ Name: kmod Summary: Utilities to load modules into the kernel License: LGPL-2.1+ and GPL-2.0+ Group: System/Kernel -Version: 8 +Version: 9 Release: 0 Url: http://www.politreco.com/2011/12/announce-kmod-2/ @@ -86,7 +86,7 @@ in %lname. %prep %setup -q -%patch -P 1 -p1 +%patch1 -p1 %build autoreconf -fi From 87a9c849bd00708826c303743f634c1d79452a6f2422a82c1a36fe671a704ed8 Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Wed, 20 Jun 2012 13:11:38 +0000 Subject: [PATCH 2/3] * libkmod-util: add missing stdbool.h include - Don't assert mkdir_p, it fails on 32bit systems. add: dont-assert-mkdir_p.patch OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=31 --- dont-assert-mkdir_p.patch | 15 +++++++++++++++ kmod.changes | 5 +++-- kmod.spec | 6 +++++- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 dont-assert-mkdir_p.patch diff --git a/dont-assert-mkdir_p.patch b/dont-assert-mkdir_p.patch new file mode 100644 index 0000000..6cfe9c6 --- /dev/null +++ b/dont-assert-mkdir_p.patch @@ -0,0 +1,15 @@ +Index: kmod-9/testsuite/init_module.c +=================================================================== +--- kmod-9.orig/testsuite/init_module.c ++++ kmod-9/testsuite/init_module.c +@@ -147,7 +147,9 @@ static int create_sysfs_files(const char + strcpy(buf + len, modname); + len += strlen(modname); + +- assert(mkdir_p(buf, 0755) >= 0); ++ // This fails on 32bit systems, we can't use assert ++ // assert(mkdir_p(buf, 0755) >= 0); ++ mkdir_p(buf, 0755); + + strcpy(buf + len, "/initstate"); + return write_one_line_file(buf, "live\n", strlen("live\n")); diff --git a/kmod.changes b/kmod.changes index 8282e5a..e2fe6f1 100644 --- a/kmod.changes +++ b/kmod.changes @@ -10,8 +10,9 @@ Wed Jun 20 08:41:03 UTC 2012 - rmilasan@suse.com * depmod: fail if any index could not be created * depmod: don't return error if modules.builtin don't exist * libkmod-util: split function for usec conversion -* libkmod-util: add missing stdbool.h include - +* libkmod-util: add missing stdbool.h include +- Don't assert mkdir_p, it fails on 32bit systems. + add: dont-assert-mkdir_p.patch ------------------------------------------------------------------- Sat Apr 21 01:55:30 UTC 2012 - jengelh@medozas.de diff --git a/kmod.spec b/kmod.spec index 4025601..93d5f72 100644 --- a/kmod.spec +++ b/kmod.spec @@ -30,6 +30,7 @@ Url: http://www.politreco.com/2011/12/announce-kmod-2/ Source: %name-%version.tar.xz Source2: %name-%version.tar.sign Patch1: kmod-so-version.diff +Patch2: dont-assert-mkdir_p.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf @@ -87,6 +88,7 @@ in %lname. %prep %setup -q %patch1 -p1 +%patch2 -p1 %build autoreconf -fi @@ -97,7 +99,7 @@ autoreconf -fi --with-zlib \ --includedir=%_includedir/%{name}-%{version} \ --with-rootlibdir=%{_libdir} \ - --bindir=%{_bindir} + --bindir=%{_bindir} make %{?_smp_mflags} %install @@ -130,6 +132,8 @@ make check %postun -n %lname -p /sbin/ldconfig +%clean + %files %defattr(-,root,root) %{_bindir}/kmod From 4c5553e792b9ad37634f68776607311d37ce4b19aec21f7e0772f92f2e738fe8 Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Thu, 21 Jun 2012 06:38:18 +0000 Subject: [PATCH 3/3] - Fix broken testsuites on 32bit systems. add: fix-32bits.diff OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=32 --- dont-assert-mkdir_p.patch | 15 -------- fix-32bits.diff | 79 +++++++++++++++++++++++++++++++++++++++ kmod.changes | 4 +- kmod.spec | 2 +- 4 files changed, 82 insertions(+), 18 deletions(-) delete mode 100644 dont-assert-mkdir_p.patch create mode 100644 fix-32bits.diff diff --git a/dont-assert-mkdir_p.patch b/dont-assert-mkdir_p.patch deleted file mode 100644 index 6cfe9c6..0000000 --- a/dont-assert-mkdir_p.patch +++ /dev/null @@ -1,15 +0,0 @@ -Index: kmod-9/testsuite/init_module.c -=================================================================== ---- kmod-9.orig/testsuite/init_module.c -+++ kmod-9/testsuite/init_module.c -@@ -147,7 +147,9 @@ static int create_sysfs_files(const char - strcpy(buf + len, modname); - len += strlen(modname); - -- assert(mkdir_p(buf, 0755) >= 0); -+ // This fails on 32bit systems, we can't use assert -+ // assert(mkdir_p(buf, 0755) >= 0); -+ mkdir_p(buf, 0755); - - strcpy(buf + len, "/initstate"); - return write_one_line_file(buf, "live\n", strlen("live\n")); diff --git a/fix-32bits.diff b/fix-32bits.diff new file mode 100644 index 0000000..20cafcc --- /dev/null +++ b/fix-32bits.diff @@ -0,0 +1,79 @@ +diff --git a/testsuite/init_module.c b/testsuite/init_module.c +index 814998a..ed8b9fc 100644 +--- a/testsuite/init_module.c ++++ b/testsuite/init_module.c +@@ -16,6 +16,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -206,6 +207,12 @@ static inline bool module_is_inkernel(const char *modname) + return ret; + } + ++static uint8_t elf_identify(void *mem) ++{ ++ uint8_t *p = mem; ++ return p[EI_CLASS]; ++} ++ + TS_EXPORT long init_module(void *mem, unsigned long len, const char *args); + + /* +@@ -225,6 +232,8 @@ long init_module(void *mem, unsigned long len, const char *args) + const void *buf; + uint64_t bufsize; + int err; ++ uint8_t class; ++ off_t offset; + + init_retcodes(); + +@@ -237,13 +246,20 @@ long init_module(void *mem, unsigned long len, const char *args) + kmod_elf_unref(elf); + + /* +- * We couldn't find the module's name inside the ELF file. Just exit +- * as if it was successful ++ * We couldn't find the parse the ELF file. Just exit as if it was ++ * successful + */ + if (err < 0) + return 0; + +- modname = (char *)buf + offsetof(struct module, name); ++ /* We need to open both 32 and 64 bits module - hack! */ ++ class = elf_identify(mem); ++ if (class == ELFCLASS64) ++ offset = MODULE_NAME_OFFSET_64; ++ else ++ offset = MODULE_NAME_OFFSET_32; ++ ++ modname = (char *)buf + offset; + mod = find_module(modules, modname); + if (mod != NULL) { + errno = mod->errcode; +diff --git a/testsuite/stripped-module.h b/testsuite/stripped-module.h +index 9f97dae..19862f3 100644 +--- a/testsuite/stripped-module.h ++++ b/testsuite/stripped-module.h +@@ -13,6 +13,7 @@ struct list_head { + }; + + #define MODULE_NAME_LEN (64 - sizeof(unsigned long)) ++ + struct module + { + enum module_state state; +@@ -24,4 +25,8 @@ struct module + char name[MODULE_NAME_LEN]; + }; + ++/* padding */ ++#define MODULE_NAME_OFFSET_64 4 + 4 + 2 * 8 ++#define MODULE_NAME_OFFSET_32 4 + 2 * 4 ++ + #endif diff --git a/kmod.changes b/kmod.changes index e2fe6f1..7c2757d 100644 --- a/kmod.changes +++ b/kmod.changes @@ -11,8 +11,8 @@ Wed Jun 20 08:41:03 UTC 2012 - rmilasan@suse.com * depmod: don't return error if modules.builtin don't exist * libkmod-util: split function for usec conversion * libkmod-util: add missing stdbool.h include -- Don't assert mkdir_p, it fails on 32bit systems. - add: dont-assert-mkdir_p.patch +- Fix broken testsuites on 32bit systems. + add: fix-32bits.diff ------------------------------------------------------------------- Sat Apr 21 01:55:30 UTC 2012 - jengelh@medozas.de diff --git a/kmod.spec b/kmod.spec index 93d5f72..88c1c16 100644 --- a/kmod.spec +++ b/kmod.spec @@ -30,7 +30,7 @@ Url: http://www.politreco.com/2011/12/announce-kmod-2/ Source: %name-%version.tar.xz Source2: %name-%version.tar.sign Patch1: kmod-so-version.diff -Patch2: dont-assert-mkdir_p.patch +Patch2: fix-32bits.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf