sys-kernel/genkernel: revbump for several fixes

Fixes globbing bug, adds musl patches, and fixes lvm2 build for
non-systemd users.

Bug: https://bugs.gentoo.org/944499
Bug: https://bugs.gentoo.org/932907
Bug: https://bugs.gentoo.org/934773
Signed-off-by: Ben Kohler <bkohler@gentoo.org>
This commit is contained in:
Ben Kohler
2024-11-25 11:04:24 -06:00
parent c93f43e52c
commit 21da5b2fe8
7 changed files with 668 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ DIST dropbear-2022.83.tar.bz2 2322904 BLAKE2B 4e26667458fb068a8c997b44dfd3c4f151
DIST e2fsprogs-1.46.4.tar.xz 7035200 BLAKE2B 473f7fd3f521b94cdaa68e37784a518fc1919387dd114f31b5338f1b4c472f86b150229ec3dcae8b73eac95330c0dea729befc8cea08bcf1e455c0b6652d6d2b SHA512 7d9cfdf00ed58e66049585e8382fe4977088956421a0fb8155900c69afd8857309ad2b9301b3f74c9c0afa7287a0ddba2fd1538fcf57858b37a9ab712390016d
DIST e2fsprogs-1.47.0.tar.xz 7059372 BLAKE2B 84f58b05a9f0e14e1a66c6e5171ff23b022f51c4e9a02d4d6d1d26c91909f3c7ec9c9f0462663a4457b4479043774502b8891f691e58a61f4ef6bf9ba33f33aa SHA512 0e6d64c565b455becb84166b6a5c7090724bac5cfe69098657a31bf0481b4e2cace3de1363121b7d84820fbae85b7c83ac5f2a2b02bb36280f0e3ae83a934cec
DIST eudev-3.2.10.tar.gz 1961960 BLAKE2B 3708c78fad3abad6aa4b2beaaa325e25e118621aa2e6cb351732f6d8349dc17da9be852cab79045c7a513e927c2d1266c6443814fd264943765d98fb5b404e75 SHA512 d0a076d8a54e9d4ca9ca48cf885d082965144b322950d351b7ead4a5035c2dad6fd66b7f137d7281982876c3c50330cdd5e599788f23e1369388181dd178941d
DIST eudev-3.2.14.tar.gz 2188254 BLAKE2B 7d68e77012288ecfac43be31f724224d371cb1084238fe045df248927eff854dbb391ad501e2a36d9b5ea4eb0a8cba3f9f21ea668908584a24c2a65df93ffdf8 SHA512 1e7593b53c5508a99fe7ff5d24d1d09b3753d9cfba086e7d8cc6ab80cc88013ec687dc4f1eac7b7889051f4e5fd5c40d2b87f5f2d948479d679c8836014d08e0
DIST expat-2.5.0.tar.xz 460560 BLAKE2B 670298d076ff3b512a0212170d40cb04c601a11d6b152f215a5302ad3238c69c2386393d7a6c70bc284be35ce97bf27d87115c3391f4bc17406e509d739d3e31 SHA512 2da73b991b7c0c54440485c787e5edeb3567230204e31b3cac1c3a6713ec6f9f1554d3afffc0f8336168dfd5df02db4a69bcf21b4d959723d14162d13ab87516
DIST fuse-2.9.9.tar.gz 1813177 BLAKE2B 9e9141380bda46eb0bcce325c6fd293fe3844fe884a4952bb38d4b89dc48b728ffcc891038b3a7a861f05acfacce9dd7bb0e11d600609f3ad0ab278ccbe98847 SHA512 3d82fafd04f2924299bb09d2bb144935fa004a43fb9a6568e2e1cc5a60fded2efa1711029a0d7f12b3e6e4501f7217f2ee3545646d89da8dece083cb390f23e2
DIST genkernel-4.3.10.tar.xz 484664 BLAKE2B ec1c44e633927c2c2fa12e22f428f6667ff5a768071aeecafb370f0e5ba0953c694661048a25f904a602f5acfc3a07a2be7042f4c247ab483d7241452c8df77a SHA512 443bc5c1980271d958255089a7981738979672a540e803789ee4a08d16e69e2a866266ae566da78dc02a3f31a4a9d049d302cab14392e931028040936ea7a512

View File

@@ -0,0 +1,19 @@
diff '--color=auto' -urN genkernel-4.3.16.orig/gen_initramfs.sh genkernel-4.3.16/gen_initramfs.sh
--- genkernel-4.3.16.orig/gen_initramfs.sh 2024-06-11 20:35:25.000000000 +0200
+++ genkernel-4.3.16/gen_initramfs.sh 2024-11-23 19:44:41.674658947 +0100
@@ -1783,10 +1783,11 @@
myfw_f=( $(compgen -G "${FIRMWARE_DIR}/${myfw}*") )
- if [ ${#myfw_f[@]} -gt 1 ]
- then
- gen_die "excessive number of firmwares!"
- fi
+## see https://bugs.gentoo.org/932907
+# if [ ${#myfw_f[@]} -gt 1 ]
+# then
+# gen_die "excessive number of firmwares!"
+# fi
if [ ${#myfw_f[@]} -lt 1 ]
then

View File

@@ -0,0 +1,297 @@
https://bugs.gentoo.org/934773
https://github.com/gentoo/genkernel/pull/62
From 553ea48d2983f6febd142b97c5b7230d87cda661 Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Sun, 24 Nov 2024 07:33:09 -0800
Subject: [PATCH 1/3] patches/lvm: add missing musl patches
Gentoo-Issue: https://bugs.gentoo.org/934773
Signed-off-by: orbea <orbea@riseup.net>
---
.../lvm/2.03.22/lvm2-019-musl-basename.patch | 34 ++++++++++++
.../lvm/2.03.22/lvm2-020-freopen-musl.patch | 54 +++++++++++++++++++
2 files changed, 88 insertions(+)
create mode 100644 patches/lvm/2.03.22/lvm2-019-musl-basename.patch
create mode 100644 patches/lvm/2.03.22/lvm2-020-freopen-musl.patch
diff --git a/patches/lvm/2.03.22/lvm2-019-musl-basename.patch b/patches/lvm/2.03.22/lvm2-019-musl-basename.patch
new file mode 100644
index 00000000..2dd9f8ff
--- /dev/null
+++ b/patches/lvm/2.03.22/lvm2-019-musl-basename.patch
@@ -0,0 +1,34 @@
+https://bugs.gentoo.org/937239
+https://github.com/lvmteam/lvm2/commit/f98d2ffe8753895c84160a7abce4223bd127cd9e
+
+From f98d2ffe8753895c84160a7abce4223bd127cd9e Mon Sep 17 00:00:00 2001
+From: Zdenek Kabelac <zkabelac@redhat.com>
+Date: Wed, 27 Mar 2024 00:28:14 +0100
+Subject: [PATCH] device_id: use dm_basename
+
+Avoid problems for other libc like muslc and use dm_basename.
+
+Prototype for basename has been removed from string.h from latest musl [1]
+compilers e.g. clang-18 flags the absense of prototype as error. therefore
+include libgen.h for providing it.
+
+[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
+
+Reported-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/device/device_id.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/device/device_id.c b/lib/device/device_id.c
+index 7d67a1cb7..200d39432 100644
+--- a/lib/device/device_id.c
++++ b/lib/device/device_id.c
+@@ -740,7 +740,7 @@ static int _dev_read_sys_serial(struct cmd_context *cmd, struct device *dev,
+ int ret;
+
+ /* /dev/vda to vda */
+- base = basename(devname);
++ base = dm_basename(devname);
+
+ /* vda1 to vda */
+ for (i = 0; i < strlen(base); i++) {
diff --git a/patches/lvm/2.03.22/lvm2-020-freopen-musl.patch b/patches/lvm/2.03.22/lvm2-020-freopen-musl.patch
new file mode 100644
index 00000000..2b3f0a91
--- /dev/null
+++ b/patches/lvm/2.03.22/lvm2-020-freopen-musl.patch
@@ -0,0 +1,54 @@
+From 4cf08811e112100a2b10c60047f3c537ad21d674 Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Sat, 28 Jan 2023 14:22:42 +0100
+Subject: [PATCH] Use `freopen()` on {stdin,stdout,stderr}
+
+* ISO C does not guarantee that the standard streams are modifiable
+ lvalues. Glibc even calls out this behaviour as non-portable:
+ https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html
+--- a/lib/log/log.c
++++ b/lib/log/log.c
+@@ -208,7 +208,11 @@ int reopen_standard_stream(FILE **stream, const char *mode)
+
+ _check_and_replace_standard_log_streams(old_stream, new_stream);
+
++#ifdef __GLIBC__
+ *stream = new_stream;
++#else
++ freopen(NULL, mode, *stream);
++#endif
+ return 1;
+ }
+
+--- a/tools/lvmcmdline.c
++++ b/tools/lvmcmdline.c
+@@ -3422,7 +3422,7 @@ static int _check_standard_fds(void)
+ int err = is_valid_fd(STDERR_FILENO);
+
+ if (!is_valid_fd(STDIN_FILENO) &&
+- !(stdin = fopen(_PATH_DEVNULL, "r"))) {
++ !freopen(_PATH_DEVNULL, "r", stdin)) {
+ if (err)
+ perror("stdin stream open");
+ else
+@@ -3432,7 +3432,7 @@ static int _check_standard_fds(void)
+ }
+
+ if (!is_valid_fd(STDOUT_FILENO) &&
+- !(stdout = fopen(_PATH_DEVNULL, "w"))) {
++ !freopen(_PATH_DEVNULL, "w", stdout)) {
+ if (err)
+ perror("stdout stream open");
+ /* else no stdout */
+@@ -3440,7 +3440,7 @@ static int _check_standard_fds(void)
+ }
+
+ if (!is_valid_fd(STDERR_FILENO) &&
+- !(stderr = fopen(_PATH_DEVNULL, "w"))) {
++ !freopen(_PATH_DEVNULL, "w", stderr)) {
+ printf("stderr stream open: %s\n",
+ strerror(errno));
+ return 0;
+--
+2.39.2
+
From a9f818ab719c294a3bdd6b25730bb1b6ac6c2173 Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Sun, 24 Nov 2024 07:33:50 -0800
Subject: [PATCH 2/3] patches/kmod: add missing musl patch
Signed-off-by: orbea <orbea@riseup.net>
---
patches/kmod/31/kmod-31-musl-basename.patch | 113 ++++++++++++++++++++
1 file changed, 113 insertions(+)
create mode 100644 patches/kmod/31/kmod-31-musl-basename.patch
diff --git a/patches/kmod/31/kmod-31-musl-basename.patch b/patches/kmod/31/kmod-31-musl-basename.patch
new file mode 100644
index 00000000..f4839dad
--- /dev/null
+++ b/patches/kmod/31/kmod-31-musl-basename.patch
@@ -0,0 +1,113 @@
+https://github.com/kmod-project/kmod/pull/32
+
+From 721ed6040c7aa47070faf6378c433089e178bd43 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 9 Dec 2023 17:35:59 -0800
+Subject: [PATCH] Use portable implementation for basename API
+
+musl has removed the non-prototype declaration of basename from
+string.h [1] which now results in build errors with clang-17+ compiler
+
+Implement GNU basename behavior using strchr which is portable across libcs
+
+Fixes
+../git/tools/kmod.c:71:19: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
+71 | "Commands:\n", basename(argv[0]));
+| ^
+
+[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
+
+Suggested-by: Rich Felker
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+--- a/libkmod/libkmod-config.c
++++ b/libkmod/libkmod-config.c
+@@ -794,7 +794,7 @@ static int conf_files_insert_sorted(struct kmod_ctx *ctx,
+ bool is_single = false;
+
+ if (name == NULL) {
+- name = basename(path);
++ name = gnu_basename(path);
+ is_single = true;
+ }
+
+--- a/shared/util.c
++++ b/shared/util.c
+@@ -172,9 +172,9 @@ char *modname_normalize(const char *modname, char buf[static PATH_MAX], size_t *
+
+ char *path_to_modname(const char *path, char buf[static PATH_MAX], size_t *len)
+ {
+- char *modname;
++ const char *modname;
+
+- modname = basename(path);
++ modname = gnu_basename(path);
+ if (modname == NULL || modname[0] == '\0')
+ return NULL;
+
+--- a/shared/util.h
++++ b/shared/util.h
+@@ -5,6 +5,7 @@
+ #include <stdbool.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <string.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <time.h>
+@@ -76,6 +77,12 @@ do { \
+ __p->__v = (val); \
+ } while(0)
+
++static _always_inline_ const char *gnu_basename(const char *s)
++{
++ const char *p = strrchr(s, '/');
++ return p ? p+1 : s;
++}
++
+ static _always_inline_ unsigned int ALIGN_POWER2(unsigned int u)
+ {
+ return 1 << ((sizeof(u) * 8) - __builtin_clz(u - 1));
+--- a/testsuite/testsuite.c
++++ b/testsuite/testsuite.c
+@@ -70,7 +70,7 @@ static void help(void)
+
+ printf("Usage:\n"
+ "\t%s [options] <test>\n"
+- "Options:\n", basename(progname));
++ "Options:\n", gnu_basename(progname));
+
+ for (itr = options, itr_short = options_short;
+ itr->name != NULL; itr++, itr_short++)
+--- a/tools/depmod.c
++++ b/tools/depmod.c
+@@ -762,7 +762,7 @@ static int cfg_files_insert_sorted(struct cfg_file ***p_files, size_t *p_n_files
+ if (name != NULL)
+ namelen = strlen(name);
+ else {
+- name = basename(dir);
++ name = gnu_basename(dir);
+ namelen = strlen(name);
+ dirlen -= namelen + 1;
+ }
+--- a/tools/kmod.c
++++ b/tools/kmod.c
+@@ -68,7 +68,7 @@ static int kmod_help(int argc, char *argv[])
+ "Options:\n"
+ "\t-V, --version show version\n"
+ "\t-h, --help show this help\n\n"
+- "Commands:\n", basename(argv[0]));
++ "Commands:\n", gnu_basename(argv[0]));
+
+ for (i = 0; i < ARRAY_SIZE(kmod_cmds); i++) {
+ if (kmod_cmds[i]->help != NULL) {
+@@ -156,7 +156,7 @@ static int handle_kmod_compat_commands(int argc, char *argv[])
+ const char *cmd;
+ size_t i;
+
+- cmd = basename(argv[0]);
++ cmd = gnu_basename(argv[0]);
+
+ for (i = 0; i < ARRAY_SIZE(kmod_compat_cmds); i++) {
+ if (streq(kmod_compat_cmds[i]->name, cmd))
+
From 1c7bf8a58143807134f6427ab3d7e063df3038e6 Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Sun, 24 Nov 2024 07:34:47 -0800
Subject: [PATCH 3/3] Bump eudev to v3.2.14
Update to a version that builds with musl.
Signed-off-by: orbea <orbea@riseup.net>
---
.../eudev-3.2.14-static.patch} | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
rename patches/eudev/{3.2.10/eudev-3.2.10-static.patch => 3.2.14/eudev-3.2.14-static.patch} (81%)
diff --git a/patches/eudev/3.2.10/eudev-3.2.10-static.patch b/patches/eudev/3.2.14/eudev-3.2.14-static.patch
similarity index 81%
rename from patches/eudev/3.2.10/eudev-3.2.10-static.patch
rename to patches/eudev/3.2.14/eudev-3.2.14-static.patch
index fc36b547..88bc1e15 100644
--- a/patches/eudev/3.2.10/eudev-3.2.10-static.patch
+++ b/patches/eudev/3.2.14/eudev-3.2.14-static.patch
@@ -1,14 +1,14 @@
--- a/configure.ac
+++ b/configure.ac
-@@ -261,7 +261,7 @@ AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules s
+@@ -252,7 +252,7 @@ AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules s
if test "x$enable_kmod" != "xno"; then
- PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
- if test "x$have_kmod" = "xyes"; then
-- PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
-+ PKG_CHECK_MODULES_STATIC(KMOD, [ libkmod >= 15 ],
- [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
- AC_MSG_ERROR([*** kmod version >= 15 not found]))
- fi
+ PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
+ if test "x$have_kmod" = "xyes"; then
+- PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
++ PKG_CHECK_MODULES_STATIC(KMOD, [ libkmod >= 15 ],
+ [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
+ AC_MSG_ERROR([*** kmod version >= 15 not found]))
+ fi
--- a/src/ata_id/Makefile.am
+++ b/src/ata_id/Makefile.am
@@ -11,6 +11,8 @@ udevlibexec_PROGRAMS = \
@@ -94,4 +94,3 @@
v4l_id_LDADD = \
$(top_builddir)/src/libudev/libudev-private.la \
$(top_builddir)/src/udev/libudev-core.la
-

View File

@@ -0,0 +1,38 @@
https://github.com/gentoo/genkernel/pull/60
From c270c3667e04bc60fcdd9ffcc76d4d2c5a8b9d6d Mon Sep 17 00:00:00 2001
From: orbea <orbea@riseup.net>
Date: Sun, 12 May 2024 08:05:09 -0700
Subject: [PATCH] build: fix for POSIX shells
When building genkernel where /bin/sh is a POSIX shell such as lksh
(mksh) it will install a malformed software.sh. This is because 'echo
-e' is not portable shell. This can be fixed by using 'printf' instead.
Signed-off-by: orbea <orbea@riseup.net>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 1e20ef5d..637ef1e3 100644
--- a/Makefile
+++ b/Makefile
@@ -69,7 +69,7 @@ SOFTWARE = BCACHE_TOOLS \
ZLIB \
ZSTD
-SOFTWARE_VERSION = $(foreach entry, $(SOFTWARE), "VERSION_$(entry)=${VERSION_$(entry)}\n")
+SOFTWARE_VERSION = $(foreach entry, $(SOFTWARE), "VERSION_$(entry)=${VERSION_$(entry)}")
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
@@ -183,7 +183,7 @@ $(BUILD_DIR)/build-config:
$(BUILD_DIR)/software.sh:
install -d $(BUILD_DIR)/temp/
- echo -e $(SOFTWARE_VERSION) > $(BUILD_DIR)/temp/versions
+ printf '%s\n' $(SOFTWARE_VERSION) > $(BUILD_DIR)/temp/versions
cat $(BUILD_DIR)/temp/versions defaults/software.sh > $(BUILD_DIR)/software.sh
$(BUILD_DIR)/doc/genkernel.8.txt:

View File

@@ -0,0 +1,11 @@
--- a/udev/69-dm-lvm.rules.in
+++ b/udev/69-dm-lvm.rules.in
@@ -76,7 +76,7 @@
# it's better suited to appearing in the journal.
IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
-ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="(SYSTEMDRUN) --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} (LVM_EXEC)/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}"
+ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="(LVM_EXEC)/lvm vgchange -aay --nohints --autoactivation event $env{LVM_VG_NAME_COMPLETE}"
GOTO="lvm_end"
LABEL="lvm_end"

View File

@@ -0,0 +1,291 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# genkernel-9999 -> latest Git branch "master"
# genkernel-VERSION -> normal genkernel release
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
inherit bash-completion-r1 python-single-r1
# Whenever you bump a GKPKG, check if you have to move
# or add new patches!
VERSION_BCACHE_TOOLS="1.1_p20230217"
# boost-1.84.0 needs dev-build/b2 packaged
VERSION_BOOST="1.79.0"
VERSION_BTRFS_PROGS="6.7.1"
VERSION_BUSYBOX="1.36.1"
VERSION_COREUTILS="9.4"
VERSION_CRYPTSETUP="2.6.1"
VERSION_DMRAID="1.0.0.rc16-3"
VERSION_DROPBEAR="2022.83"
VERSION_EUDEV="3.2.10"
VERSION_EXPAT="2.5.0"
VERSION_E2FSPROGS="1.47.0"
VERSION_FUSE="2.9.9"
# gnupg-2.x needs several new deps packaged
VERSION_GPG="1.4.23"
VERSION_HWIDS="20210613"
# open-iscsi-2.1.9 static build not working yet
VERSION_ISCSI="2.1.8"
# json-c-0.17 needs gkbuild ported to meson
VERSION_JSON_C="0.17"
VERSION_KMOD="31"
VERSION_LIBAIO="0.3.113"
VERSION_LIBGCRYPT="1.10.3"
VERSION_LIBGPGERROR="1.47"
VERSION_LIBXCRYPT="4.4.36"
VERSION_LVM="2.03.22"
VERSION_LZO="2.10"
VERSION_MDADM="4.2"
VERSION_POPT="1.19"
VERSION_STRACE="6.7"
VERSION_THIN_PROVISIONING_TOOLS="0.9.0"
# unionfs-fuse-3.4 needs fuse:3
VERSION_UNIONFS_FUSE="2.0"
VERSION_USERSPACE_RCU="0.14.0"
VERSION_UTIL_LINUX="2.39.3"
VERSION_XFSPROGS="6.4.0"
VERSION_XZ="5.4.2"
VERSION_ZLIB="1.3.1"
VERSION_ZSTD="1.5.5"
VERSION_KEYUTILS="1.6.3"
COMMON_URI="
https://git.kernel.org/pub/scm/linux/kernel/git/colyli/bcache-tools.git/snapshot/a5e3753516bd39c431def86c8dfec8a9cea1ddd4.tar.gz -> bcache-tools-${VERSION_BCACHE_TOOLS}.tar.gz
https://boostorg.jfrog.io/artifactory/main/release/${VERSION_BOOST}/source/boost_${VERSION_BOOST//./_}.tar.bz2
https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${VERSION_BTRFS_PROGS}.tar.xz
https://www.busybox.net/downloads/busybox-${VERSION_BUSYBOX}.tar.bz2
mirror://gnu/coreutils/coreutils-${VERSION_COREUTILS}.tar.xz
https://www.kernel.org/pub/linux/utils/cryptsetup/v$(ver_cut 1-2 ${VERSION_CRYPTSETUP})/cryptsetup-${VERSION_CRYPTSETUP}.tar.xz
https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-${VERSION_DMRAID}.tar.bz2
https://matt.ucc.asn.au/dropbear/releases/dropbear-${VERSION_DROPBEAR}.tar.bz2
https://dev.gentoo.org/~blueness/eudev/eudev-${VERSION_EUDEV}.tar.gz
https://github.com/libexpat/libexpat/releases/download/R_${VERSION_EXPAT//\./_}/expat-${VERSION_EXPAT}.tar.xz
https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v${VERSION_E2FSPROGS}/e2fsprogs-${VERSION_E2FSPROGS}.tar.xz
https://github.com/libfuse/libfuse/releases/download/fuse-${VERSION_FUSE}/fuse-${VERSION_FUSE}.tar.gz
mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2
https://github.com/gentoo/hwids/archive/hwids-${VERSION_HWIDS}.tar.gz
https://github.com/open-iscsi/open-iscsi/archive/${VERSION_ISCSI}.tar.gz -> open-iscsi-${VERSION_ISCSI}.tar.gz
https://s3.amazonaws.com/json-c_releases/releases/json-c-${VERSION_JSON_C}.tar.gz
https://www.kernel.org/pub/linux/utils/kernel/kmod/kmod-${VERSION_KMOD}.tar.xz
https://releases.pagure.org/libaio/libaio-${VERSION_LIBAIO}.tar.gz
mirror://gnupg/libgcrypt/libgcrypt-${VERSION_LIBGCRYPT}.tar.bz2
mirror://gnupg/libgpg-error/libgpg-error-${VERSION_LIBGPGERROR}.tar.bz2
https://github.com/besser82/libxcrypt/releases/download/v${VERSION_LIBXCRYPT}/libxcrypt-${VERSION_LIBXCRYPT}.tar.xz
https://mirrors.kernel.org/sourceware/lvm2/LVM2.${VERSION_LVM}.tgz
https://www.oberhumer.com/opensource/lzo/download/lzo-${VERSION_LZO}.tar.gz
https://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
http://ftp.rpm.org/popt/releases/popt-1.x/popt-${VERSION_POPT}.tar.gz
https://github.com/strace/strace/releases/download/v${VERSION_STRACE}/strace-${VERSION_STRACE}.tar.xz
https://github.com/jthornber/thin-provisioning-tools/archive/v${VERSION_THIN_PROVISIONING_TOOLS}.tar.gz -> thin-provisioning-tools-${VERSION_THIN_PROVISIONING_TOOLS}.tar.gz
https://github.com/rpodgorny/unionfs-fuse/archive/v${VERSION_UNIONFS_FUSE}.tar.gz -> unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.gz
https://lttng.org/files/urcu/userspace-rcu-${VERSION_USERSPACE_RCU}.tar.bz2
https://www.kernel.org/pub/linux/utils/util-linux/v${VERSION_UTIL_LINUX:0:4}/util-linux-${VERSION_UTIL_LINUX}.tar.xz
https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-${VERSION_XFSPROGS}.tar.xz
https://tukaani.org/xz/xz-${VERSION_XZ}.tar.gz
https://zlib.net/zlib-${VERSION_ZLIB}.tar.gz
https://github.com/facebook/zstd/archive/v${VERSION_ZSTD}.tar.gz -> zstd-${VERSION_ZSTD}.tar.gz
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git/snapshot/keyutils-${VERSION_KEYUTILS}.tar.gz
"
if [[ ${PV} == 9999* ]] ; then
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
inherit git-r3
S="${WORKDIR}/${P}"
SRC_URI="${COMMON_URI}"
else
SRC_URI="https://dev.gentoo.org/~bkohler/dist/${P}.tar.xz
${COMMON_URI}"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
DESCRIPTION="Gentoo automatic kernel building scripts"
HOMEPAGE="https://wiki.gentoo.org/wiki/Genkernel https://gitweb.gentoo.org/proj/genkernel.git/"
LICENSE="GPL-2"
SLOT="0"
IUSE="ibm +firmware systemd"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
# Note:
# We need sys-devel/* deps like autoconf or automake at _runtime_
# because genkernel will usually build things like LVM2, cryptsetup,
# mdadm... during initramfs generation which will require these
# things.
DEPEND="
app-text/asciidoc
"
RDEPEND="${PYTHON_DEPS}
app-alternatives/cpio
>=app-misc/pax-utils-1.2.2
app-portage/elt-patches
app-portage/portage-utils
dev-util/gperf
sys-apps/sandbox
dev-build/autoconf
dev-build/autoconf-archive
dev-build/automake
app-alternatives/bc
app-alternatives/yacc
app-alternatives/lex
dev-build/libtool
virtual/pkgconfig
elibc_glibc? ( sys-libs/glibc[static-libs(+)] )
firmware? ( sys-kernel/linux-firmware )
"
PATCHES=(
"${FILESDIR}"/genkernel-4.3.16-globbing-workaround.patch
"${FILESDIR}"/${PN}-4.3.16-musl.patch
"${FILESDIR}"/${PN}-4.3.16-posix-shell.patch
)
src_unpack() {
if [[ ${PV} == 9999* ]]; then
git-r3_src_unpack
else
local gk_src_file
for gk_src_file in ${A} ; do
if [[ ${gk_src_file} == genkernel-* ]] ; then
unpack "${gk_src_file}"
fi
done
fi
}
src_prepare() {
default
if [[ ${PV} == 9999* ]] ; then
einfo "Updating version tag"
GK_V="$(git describe --tags | sed 's:^v::')-git"
sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
einfo "Producing ChangeLog from Git history..."
pushd "${S}/.git" >/dev/null || die
git log > "${S}"/ChangeLog || die
popd >/dev/null || die
fi
# Export all the versions that may be used by genkernel build.
for v in $(set |awk -F= '/^VERSION_/{print $1}') ; do
export ${v}
done
if use ibm ; then
cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
else
cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
fi
}
src_compile() {
emake PREFIX=/usr
}
src_install() {
emake DESTDIR="${D}" PREFIX=/usr install
dodoc AUTHORS ChangeLog README TODO
python_fix_shebang "${ED}"/usr/share/genkernel/path_expander.py
newbashcomp "${FILESDIR}"/genkernel-4.bash "${PN}"
insinto /etc
doins "${FILESDIR}"/initramfs.mounts
pushd "${DISTDIR}" &>/dev/null || die
insinto /usr/share/genkernel/distfiles
doins ${A/${P}.tar.xz/}
popd &>/dev/null || die
# Workaround for bug 944499, for now this patch will live in FILESDIR and is
# conditionally installed but we could add it to genkernel.git and conditionally
# remove it here instead.
if ! use systemd; then
insinto /usr/share/genkernel/patches/lvm/${VERSION_LVM}/
doins "${FILESDIR}"/lvm2-2.03.20-dm_lvm_rules_no_systemd.patch
fi
}
pkg_postinst() {
# Wiki is out of date
#echo
#elog 'Documentation is available in the genkernel manual page'
#elog 'as well as the following URL:'
#echo
#elog 'https://wiki.gentoo.org/wiki/Genkernel'
#echo
local replacing_version
for replacing_version in ${REPLACING_VERSIONS} ; do
if ver_test "${replacing_version}" -lt 4 ; then
# This is an upgrade which requires user review
ewarn ""
ewarn "Genkernel v4.x is a new major release which touches"
ewarn "nearly everything. Be careful, read updated manpage"
ewarn "and pay special attention to program output regarding"
ewarn "changed kernel command-line parameters!"
# Show this elog only once
break
fi
done
if [[ $(find /boot -name 'kernel-genkernel-*' 2>/dev/null | wc -l) -gt 0 ]] ; then
ewarn ''
ewarn 'Default kernel filename was changed from "kernel-genkernel-<ARCH>-<KV>"'
ewarn 'to "vmlinuz-<KV>". Please be aware that due to lexical ordering the'
ewarn '*default* boot entry in your boot manager could still point to last kernel'
ewarn 'built with genkernel before that name change, resulting in booting old'
ewarn 'kernel when not paying attention on boot.'
fi
# Show special warning for users depending on remote unlock capabilities
local gk_config="${EROOT}/etc/genkernel.conf"
if [[ -f "${gk_config}" ]] ; then
if grep -q -E "^SSH=[\"\']?yes" "${gk_config}" 2>/dev/null ; then
if ! grep -q dosshd /proc/cmdline 2>/dev/null ; then
ewarn ""
ewarn "IMPORTANT: SSH is currently enabled in your genkernel config"
ewarn "file (${gk_config}). However, 'dosshd' is missing from current"
ewarn "kernel command-line. You MUST add 'dosshd' to keep sshd enabled"
ewarn "in genkernel v4+ initramfs!"
fi
fi
if grep -q -E "^CMD_CALLBACK=.*emerge.*@module-rebuild" "${gk_config}" 2>/dev/null ; then
elog ""
elog "Please remove 'emerge @module-rebuild' from genkernel config"
elog "file (${gk_config}) and make use of new MODULEREBUILD option"
elog "instead."
fi
fi
local n_root_args=$(grep -o -- '\<root=' /proc/cmdline 2>/dev/null | wc -l)
if [[ ${n_root_args} -gt 1 ]] ; then
ewarn "WARNING: Multiple root arguments (root=) on kernel command-line detected!"
ewarn "If you are appending non-persistent device names to kernel command-line,"
ewarn "next reboot could fail in case running system and initramfs do not agree"
ewarn "on detected root device name!"
fi
if [[ -d /run ]] ; then
local permission_run_expected="drwxr-xr-x"
local permission_run=$(stat -c "%A" /run)
if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then
ewarn "Found the following problematic permissions:"
ewarn ""
ewarn " ${permission_run} /run"
ewarn ""
ewarn "Expected:"
ewarn ""
ewarn " ${permission_run_expected} /run"
ewarn ""
ewarn "This is known to be causing problems for any UDEV-enabled service."
fi
fi
}

View File

@@ -21,7 +21,7 @@ VERSION_COREUTILS="9.4"
VERSION_CRYPTSETUP="2.6.1"
VERSION_DMRAID="1.0.0.rc16-3"
VERSION_DROPBEAR="2022.83"
VERSION_EUDEV="3.2.10"
VERSION_EUDEV="3.2.14"
VERSION_EXPAT="2.5.0"
VERSION_E2FSPROGS="1.47.0"
VERSION_FUSE="2.9.9"
@@ -107,7 +107,7 @@ HOMEPAGE="https://wiki.gentoo.org/wiki/Genkernel https://gitweb.gentoo.org/proj/
LICENSE="GPL-2"
SLOT="0"
IUSE="ibm +firmware"
IUSE="ibm +firmware systemd"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
# Note:
@@ -138,6 +138,7 @@ RDEPEND="${PYTHON_DEPS}
"
PATCHES=(
"${FILESDIR}"/genkernel-4.3.16-globbing-workaround.patch
)
src_unpack() {
@@ -197,6 +198,14 @@ src_install() {
insinto /usr/share/genkernel/distfiles
doins ${A/${P}.tar.xz/}
popd &>/dev/null || die
# Workaround for bug 944499, for now this patch will live in FILESDIR and is
# conditionally installed but we could add it to genkernel.git and conditionally
# remove it here instead.
if ! use systemd; then
insinto /usr/share/genkernel/patches/lvm/${VERSION_LVM}/
doins "${FILESDIR}"/lvm2-2.03.20-dm_lvm_rules_no_systemd.patch
fi
}
pkg_postinst() {