From c8bb297f21e18d965dba2e8c8402639bf2ab89ea Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 19 Jul 2024 16:50:28 -0400 Subject: [PATCH] dracut: update to 105, switch to dracut-ng --- ...408c8644a0add1907b0593eb83f90d6247b1.patch | 45 -- srcpkgs/dracut/patches/amd-ucode-readme.patch | 26 -- srcpkgs/dracut/patches/crypt-openssl-3.patch | 24 -- srcpkgs/dracut/patches/fix-fsck.patch | 27 -- srcpkgs/dracut/patches/force_poweroff.patch | 30 -- .../dracut/patches/isoscan-udev-trigger.patch | 25 -- srcpkgs/dracut/patches/musl-1.1.patch | 97 +++++ srcpkgs/dracut/patches/network.patch | 37 -- .../dracut/patches/plymouth-udev-seat.patch | 9 +- .../dracut/patches/revert-fw_devlink.patch | 384 ++++++++++++++++++ srcpkgs/dracut/patches/silence-setfont.patch | 19 - srcpkgs/dracut/template | 33 +- 12 files changed, 499 insertions(+), 257 deletions(-) delete mode 100644 srcpkgs/dracut/patches/6c80408c8644a0add1907b0593eb83f90d6247b1.patch delete mode 100644 srcpkgs/dracut/patches/amd-ucode-readme.patch delete mode 100644 srcpkgs/dracut/patches/crypt-openssl-3.patch delete mode 100644 srcpkgs/dracut/patches/fix-fsck.patch delete mode 100644 srcpkgs/dracut/patches/force_poweroff.patch delete mode 100644 srcpkgs/dracut/patches/isoscan-udev-trigger.patch create mode 100644 srcpkgs/dracut/patches/musl-1.1.patch delete mode 100644 srcpkgs/dracut/patches/network.patch create mode 100644 srcpkgs/dracut/patches/revert-fw_devlink.patch delete mode 100644 srcpkgs/dracut/patches/silence-setfont.patch diff --git a/srcpkgs/dracut/patches/6c80408c8644a0add1907b0593eb83f90d6247b1.patch b/srcpkgs/dracut/patches/6c80408c8644a0add1907b0593eb83f90d6247b1.patch deleted file mode 100644 index 6d3295c8e26..00000000000 --- a/srcpkgs/dracut/patches/6c80408c8644a0add1907b0593eb83f90d6247b1.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 6c80408c8644a0add1907b0593eb83f90d6247b1 Mon Sep 17 00:00:00 2001 -From: Antonio Alvarez Feijoo -Date: Mon, 14 Aug 2023 12:28:11 +0200 -Subject: [PATCH] fix(dracut.sh): remove microcode check based on - CONFIG_MICROCODE_[AMD|INTEL] - -`CONFIG_MICROCODE_AMD` and `CONFIG_MICROCODE_INTEL` are hidden since -https://lore.kernel.org/all/20230810160805.081212701@linutronix.de/, therefore -this check is wrong and early microcode is always disabled. ---- - dracut.sh | 11 ++++------- - 1 file changed, 4 insertions(+), 7 deletions(-) - -diff --git a/dracut.sh b/dracut.sh -index e0abdb3b0..3b292910f 100755 ---- a/dracut.sh -+++ b/dracut.sh -@@ -1561,23 +1561,20 @@ fi - - if [[ $early_microcode == yes ]]; then - if [[ $hostonly ]]; then -- if [[ $(get_cpu_vendor) == "AMD" ]]; then -- check_kernel_config CONFIG_MICROCODE_AMD || unset early_microcode -- elif [[ $(get_cpu_vendor) == "Intel" ]]; then -- check_kernel_config CONFIG_MICROCODE_INTEL || unset early_microcode -+ if [[ $(get_cpu_vendor) == "AMD" || $(get_cpu_vendor) == "Intel" ]]; then -+ check_kernel_config CONFIG_MICROCODE || unset early_microcode - else - unset early_microcode - fi - else -- ! check_kernel_config CONFIG_MICROCODE_AMD \ -- && ! check_kernel_config CONFIG_MICROCODE_INTEL \ -+ ! check_kernel_config CONFIG_MICROCODE \ - && unset early_microcode - fi - # Do not complain on non-x86 architectures as it makes no sense - case "${DRACUT_ARCH:-$(uname -m)}" in - x86_64 | i?86) - [[ $early_microcode != yes ]] \ -- && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE_[AMD|INTEL]!=y" -+ && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE!=y" - ;; - *) ;; - esac diff --git a/srcpkgs/dracut/patches/amd-ucode-readme.patch b/srcpkgs/dracut/patches/amd-ucode-readme.patch deleted file mode 100644 index a2ea1288d23..00000000000 --- a/srcpkgs/dracut/patches/amd-ucode-readme.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c1a69b81f6ebd62a40054be2375cb77c040694aa Mon Sep 17 00:00:00 2001 -From: Antonio Alvarez Feijoo -Date: Mon, 30 Oct 2023 14:56:39 +0100 -Subject: [PATCH] fix(dracut.sh): skip README for AMD microcode generation - -This file was added in https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/amd-ucode/README?id=89ec6198f13d1007563ff87aae5de209e993be07 -and it should be skipped. - -Fixes #2541 ---- - dracut.sh | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/dracut.sh b/dracut.sh -index 3b292910f..bd730cbe9 100755 ---- a/dracut.sh -+++ b/dracut.sh -@@ -2154,6 +2154,8 @@ if [[ $early_microcode == yes ]]; then - done - for i in $_fwdir/$_fw/$_src; do - [[ -e $i ]] || continue -+ # skip README{.xz,.zst,...} -+ str_starts "$i" "$_fwdir/$_fw/README" && continue - # skip gpg files - str_ends "$i" ".asc" && continue - cat "$i" >> "$_dest_dir/${ucode_dest[$idx]}" diff --git a/srcpkgs/dracut/patches/crypt-openssl-3.patch b/srcpkgs/dracut/patches/crypt-openssl-3.patch deleted file mode 100644 index 39fd3dd3c65..00000000000 --- a/srcpkgs/dracut/patches/crypt-openssl-3.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 5996f6b5d9b0bb957b4bb02c49c95a057761cba5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= -Date: Mon, 13 Feb 2023 20:22:56 +0000 -Subject: [PATCH] fix(crypt): add missing libraries - -Add missing libraries, closes #2137 ---- - modules.d/90crypt/module-setup.sh | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/modules.d/90crypt/module-setup.sh -+++ b/modules.d/90crypt/module-setup.sh -@@ -176,5 +176,11 @@ install() { - systemd-ask-password systemd-tty-ask-password-agent - fi - -+ # Install required libraries. -+ _arch=${DRACUT_ARCH:-$(uname -m)} -+ inst_libdir_file \ -+ {"tls/$_arch/",tls/,"$_arch/",}"/ossl-modules/fips.so" \ -+ {"tls/$_arch/",tls/,"$_arch/",}"/ossl-modules/legacy.so" -+ - dracut_need_initqueue - } diff --git a/srcpkgs/dracut/patches/fix-fsck.patch b/srcpkgs/dracut/patches/fix-fsck.patch deleted file mode 100644 index 97c72d05e55..00000000000 --- a/srcpkgs/dracut/patches/fix-fsck.patch +++ /dev/null @@ -1,27 +0,0 @@ -https://github.com/dracutdevs/dracut/pull/2262 - -From 26990cb90bf0f516ccbd56583000d6d02ab18acd Mon Sep 17 00:00:00 2001 -From: Laszlo Gombos -Date: Sat, 4 Mar 2023 23:28:17 +0000 -Subject: [PATCH] fix(fs-lib): remove quoting form the first argument of the - e2fsck call - -Fix regression. ---- - modules.d/99fs-lib/fs-lib.sh | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/modules.d/99fs-lib/fs-lib.sh b/modules.d/99fs-lib/fs-lib.sh -index dd20731f2..c4640fa8a 100755 ---- a/modules.d/99fs-lib/fs-lib.sh -+++ b/modules.d/99fs-lib/fs-lib.sh -@@ -107,7 +107,8 @@ fsck_drv_com() { - - info "issuing $_drv $_fop $_dev" - # we enforce non-interactive run, so $() is fine -- _out=$($_drv "$_fop" "$_dev") -+ # shellcheck disable=SC2086 -+ _out=$($_drv $_fop "$_dev") - _ret=$? - fsck_tail - diff --git a/srcpkgs/dracut/patches/force_poweroff.patch b/srcpkgs/dracut/patches/force_poweroff.patch deleted file mode 100644 index 9056685e32b..00000000000 --- a/srcpkgs/dracut/patches/force_poweroff.patch +++ /dev/null @@ -1,30 +0,0 @@ -The shutdown binary is actually provided by runit and expects the runit -init to be running. This is not the case in the initramfs. Forcing the -shutdown, halt or reboot is necessary to ignore this requirement. - ---- - modules.d/99base/dracut-lib.sh | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh ---- a/modules.d/99base/dracut-lib.sh -+++ b/modules.d/99base/dracut-lib.sh -@@ -1004,13 +1004,13 @@ emergency_shell() { - - case "$_emergency_action" in - reboot) -- reboot || exit 1 -+ reboot -f || exit 1 - ;; - poweroff) -- poweroff || exit 1 -+ poweroff -f || exit 1 - ;; - halt) -- halt || exit 1 -+ halt -f || exit 1 - ;; - esac - } --- -2.37.3 diff --git a/srcpkgs/dracut/patches/isoscan-udev-trigger.patch b/srcpkgs/dracut/patches/isoscan-udev-trigger.patch deleted file mode 100644 index b80e966266b..00000000000 --- a/srcpkgs/dracut/patches/isoscan-udev-trigger.patch +++ /dev/null @@ -1,25 +0,0 @@ -This upstream accepted patch fixes a bug where the live images don't work when -booted from grub loopback (void-linux/void-mklive#294). - -From d880d62f5f81d7ec69555f5deb60694fdb693c01 Mon Sep 17 00:00:00 2001 -From: 0x5c -Date: Thu, 9 Feb 2023 05:26:30 -0500 -Subject: [PATCH] fix: make iso-scan trigger udev events - -Fixes #2183 ---- - modules.d/90dmsquash-live/iso-scan.sh | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/modules.d/90dmsquash-live/iso-scan.sh b/modules.d/90dmsquash-live/iso-scan.sh -index 886d23033..fa06b33cd 100755 ---- a/modules.d/90dmsquash-live/iso-scan.sh -+++ b/modules.d/90dmsquash-live/iso-scan.sh -@@ -22,6 +22,7 @@ do_iso_scan() { - mount -t auto -o ro "$dev" "/run/initramfs/isoscan" || continue - if [ -f "/run/initramfs/isoscan/$isofile" ]; then - losetup -f "/run/initramfs/isoscan/$isofile" -+ udevadm trigger --action=add > /dev/null 2>&1 - ln -s "$dev" /run/initramfs/isoscandev - rm -f -- "$job" - exit 0 diff --git a/srcpkgs/dracut/patches/musl-1.1.patch b/srcpkgs/dracut/patches/musl-1.1.patch new file mode 100644 index 00000000000..2c73d1c5bf0 --- /dev/null +++ b/srcpkgs/dracut/patches/musl-1.1.patch @@ -0,0 +1,97 @@ +From c52069f7a0adab4b5c5b911a44d65d3ba0989d7e Mon Sep 17 00:00:00 2001 +From: classabbyamp +Date: Sat, 12 Oct 2024 20:06:12 -0400 +Subject: [PATCH] Revert "perf(dracut-install): stat() w/unused buf -> + access(F_OK) in dracut-install" + +This reverts commit e7ed8337bb9fec0283af5dc745450394ba649a03. + +This commit broke compatibility with musl 1.1. +--- + src/install/dracut-install.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c +index 96bc2eb6..30c51a30 100644 +--- a/src/install/dracut-install.c ++++ b/src/install/dracut-install.c +@@ -812,7 +812,7 @@ static int dracut_mkdir(const char *src) + + static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir, bool resolvedeps, bool hashdst) + { +- struct stat sb; ++ struct stat sb, db; + _cleanup_free_ char *fullsrcpath = NULL; + _cleanup_free_ char *fulldstpath = NULL; + _cleanup_free_ char *fulldstdir = NULL; +@@ -898,7 +898,7 @@ static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir + return 1; + } + +- ret = access(fulldstdir, F_OK); ++ ret = stat(fulldstdir, &db); + + if (ret < 0) { + _cleanup_free_ char *dname = NULL; +@@ -958,12 +958,12 @@ static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir + return 1; + } + +- if (faccessat(AT_FDCWD, abspath, F_OK, AT_SYMLINK_NOFOLLOW) != 0) { ++ if (lstat(abspath, &sb) != 0) { + log_debug("lstat '%s': %m", abspath); + return 1; + } + +- if (faccessat(AT_FDCWD, fulldstpath, F_OK, AT_SYMLINK_NOFOLLOW) != 0) { ++ if (lstat(fulldstpath, &sb) != 0) { + _cleanup_free_ char *absdestpath = NULL; + + _asprintf(&absdestpath, "%s/%s", destrootdir, +@@ -1313,6 +1313,7 @@ static char **find_binary(const char *src) + char *newsrc = NULL; + + STRV_FOREACH(q, pathdirs) { ++ struct stat sb; + char *fullsrcpath; + + _asprintf(&newsrc, "%s/%s", *q, src); +@@ -1325,8 +1326,8 @@ static char **find_binary(const char *src) + continue; + } + +- if (faccessat(AT_FDCWD, fullsrcpath, F_OK, AT_SYMLINK_NOFOLLOW) != 0) { +- log_debug("lstat(%s) != 0", fullsrcpath); ++ if (lstat(fullsrcpath, &sb) != 0) { ++ log_debug("stat(%s) != 0", fullsrcpath); + free(newsrc); + newsrc = NULL; + free(fullsrcpath); +@@ -1441,8 +1442,9 @@ static int install_firmware_fullpath(const char *fwpath) + { + const char *fw = fwpath; + _cleanup_free_ char *fwpath_compressed = NULL; ++ struct stat sb; + int ret; +- if (access(fwpath, F_OK) != 0) { ++ if (stat(fwpath, &sb) != 0) { + _asprintf(&fwpath_compressed, "%s.zst", fwpath); + if (access(fwpath_compressed, F_OK) != 0) { + strcpy(fwpath_compressed + strlen(fwpath) + 1, "xz"); +@@ -1485,11 +1487,12 @@ static int install_firmware(struct kmod_module *mod) + ret = -1; + STRV_FOREACH(q, firmwaredirs) { + _cleanup_free_ char *fwpath = NULL; ++ struct stat sb; + + _asprintf(&fwpath, "%s/%s", *q, value); + + if (strpbrk(value, "*?[") != NULL +- && access(fwpath, F_OK) != 0) { ++ && stat(fwpath, &sb) != 0) { + size_t i; + _cleanup_globfree_ glob_t globbuf; + +-- +2.46.0 + diff --git a/srcpkgs/dracut/patches/network.patch b/srcpkgs/dracut/patches/network.patch deleted file mode 100644 index dce39fdc6f7..00000000000 --- a/srcpkgs/dracut/patches/network.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 11a34f6b55f91610effd79ff1bf6a4bb2db760d3 Mon Sep 17 00:00:00 2001 -From: Laszlo Gombos -Date: Wed, 18 Jan 2023 19:59:24 +0000 -Subject: [PATCH] meta module should check if module exists - -Bug: https://github.com/dracutdevs/dracut/issues/1756 ---- - modules.d/40network/module-setup.sh | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh -index 1ab13ef..078cb4b 100755 ---- a/modules.d/40network/module-setup.sh -+++ b/modules.d/40network/module-setup.sh -@@ -17,15 +17,15 @@ depends() { - done - - if [ -z "$network_handler" ]; then -- if [[ -e $dracutsysrootdir$systemdsystemunitdir/wicked.service ]]; then -+ if [[ -d "$dracutbasedir"/modules.d/35network-wicked ]] && [[ -e $dracutsysrootdir$systemdsystemunitdir/wicked.service ]]; then - network_handler="network-wicked" -- elif [[ -e $dracutsysrootdir$systemdsystemunitdir/connman.service ]]; then -+ elif [[ -d "$dracutbasedir"/modules.d/35connman ]] && [[ -e $dracutsysrootdir$systemdsystemunitdir/connman.service ]]; then - network_handler="connman" -- elif [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]] || [[ -x $dracutsysrootdir/usr/lib/nm-initrd-generator ]]; then -+ elif [[ -d "$dracutbasedir"/modules.d/35network-manager ]] && ( [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]] || [[ -x $dracutsysrootdir/usr/lib/nm-initrd-generator ]] ); then - network_handler="network-manager" -- elif [[ -x $dracutsysrootdir$systemdutildir/systemd-networkd ]]; then -+ elif [[ -d "$dracutbasedir"/modules.d/01systemd-networkd ]] && [[ -x $dracutsysrootdir$systemdutildir/systemd-networkd ]]; then - network_handler="systemd-networkd" -- else -+ elif [[ -d "$dracutbasedir"/modules.d/35network-legacy ]]; then - network_handler="network-legacy" - fi - fi --- -2.34.1 diff --git a/srcpkgs/dracut/patches/plymouth-udev-seat.patch b/srcpkgs/dracut/patches/plymouth-udev-seat.patch index 490dd63b310..1830b38644e 100644 --- a/srcpkgs/dracut/patches/plymouth-udev-seat.patch +++ b/srcpkgs/dracut/patches/plymouth-udev-seat.patch @@ -1,11 +1,12 @@ +adds udev rule that allows plymouth to work + --- a/modules.d/95udev-rules/module-setup.sh 2018-02-19 06:00:33.000000000 -0300 +++ b/modules.d/95udev-rules/module-setup.sh 2018-05-02 00:27:53.710253893 -0300 -@@ -39,6 +39,8 @@ - 60-persistent-storage.rules \ - 61-persistent-storage-edd.rules \ +@@ -49,6 +49,7 @@ + 70-mouse.rules \ + 70-touchpad.rules \ 70-uaccess.rules \ + 71-plymouth-seat.rules \ -+ 71-udev-seat.rules \ 71-seat.rules \ 73-seat-late.rules \ 75-net-description.rules \ diff --git a/srcpkgs/dracut/patches/revert-fw_devlink.patch b/srcpkgs/dracut/patches/revert-fw_devlink.patch new file mode 100644 index 00000000000..c34caa76451 --- /dev/null +++ b/srcpkgs/dracut/patches/revert-fw_devlink.patch @@ -0,0 +1,384 @@ +From daf80bbb8f8ca5c4ad56772f379110e7434cbc2c Mon Sep 17 00:00:00 2001 +From: classabbyamp +Date: Wed, 16 Oct 2024 13:45:35 -0400 +Subject: [PATCH] Revert "feat(dracut-install): add fw_devlink suppliers as + module dependencies" + +...and associated later changes, as they cause serious regressions with +aarch64 devices like the Lenovo X13s. + +see also https://github.com/dracut-ng/dracut-ng/issues/316 + +This reverts commit 8de0258d71dc5600d715d7534471e35b2b75c7be. +This reverts commit 07e2c4926780b672922563a6ea0bf1bd4bcfcd9f. +This reverts commit d71bec4aa444d92820e428c0629d0e75e268c815. +This reverts commit 6500e95494175819b382acbac8eafcdf72fabd6d. +This reverts commit 131822e26d76a3ce2028e9a545be2af066805629. +This reverts commit 3de4c7313260fb600507c9b87f780390b874c870. +--- + src/install/dracut-install.c | 245 +++-------------------------------- + 1 file changed, 15 insertions(+), 230 deletions(-) + +diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c +index 96bc2eb6..96644151 100644 +--- a/src/install/dracut-install.c ++++ b/src/install/dracut-install.c +@@ -83,9 +83,6 @@ FILE *logfile_f = NULL; + static Hashmap *items = NULL; + static Hashmap *items_failed = NULL; + static Hashmap *modules_loaded = NULL; +-static Hashmap *modules_suppliers = NULL; +-static Hashmap *processed_suppliers = NULL; +-static Hashmap *modalias_to_kmod = NULL; + static regex_t mod_filter_path; + static regex_t mod_filter_nopath; + static regex_t mod_filter_symbol; +@@ -98,7 +95,7 @@ static bool arg_mod_filter_nosymbol = false; + static bool arg_mod_filter_noname = false; + + static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst); +-static int install_dependent_modules(struct kmod_ctx *ctx, struct kmod_list *modlist, Hashmap *suppliers_paths); ++static int install_dependent_modules(struct kmod_list *modlist); + + static void item_free(char *i) + { +@@ -1571,164 +1568,7 @@ static bool check_module_path(const char *path) + return true; + } + +-static int find_kmod_module_from_sysfs_driver(struct kmod_ctx *ctx, const char *sysfs_node, int sysfs_node_len, +- struct kmod_module **module) +-{ +- char mod_path[PATH_MAX], mod_realpath[PATH_MAX]; +- const char *mod_name; +- if ((size_t)snprintf(mod_path, sizeof(mod_path), "%.*s/driver/module", +- sysfs_node_len, sysfs_node) >= sizeof(mod_path)) +- return -1; +- +- if (realpath(mod_path, mod_realpath) == NULL) +- return -1; +- +- if ((mod_name = basename(mod_realpath)) == NULL) +- return -1; +- +- return kmod_module_new_from_name(ctx, mod_name, module); +-} +- +-static int find_kmod_module_from_sysfs_modalias(struct kmod_ctx *ctx, const char *sysfs_node, int sysfs_node_len, +- struct kmod_list **modules) +-{ +- char modalias_path[PATH_MAX]; +- if ((size_t)snprintf(modalias_path, sizeof(modalias_path), "%.*s/modalias", sysfs_node_len, +- sysfs_node) >= sizeof(modalias_path)) +- return -1; +- +- _cleanup_close_ int modalias_file = -1; +- if ((modalias_file = open(modalias_path, O_RDONLY | O_CLOEXEC)) == -1) +- return 0; +- +- char alias[page_size()]; +- ssize_t len = read(modalias_file, alias, sizeof(alias)); +- alias[len - 1] = '\0'; +- +- void *list; +- +- if (hashmap_get_exists(modalias_to_kmod, alias, &list) == 1) { +- *modules = list; +- return 0; +- } +- +- int ret = kmod_module_new_from_lookup(ctx, alias, modules); +- if (!ret) { +- hashmap_put(modalias_to_kmod, strdup(alias), *modules); +- } +- +- return ret; +-} +- +-static int find_modules_from_sysfs_node(struct kmod_ctx *ctx, const char *sysfs_node, Hashmap *modules) +-{ +- _cleanup_kmod_module_unref_ struct kmod_module *drv = NULL; +- struct kmod_list *list = NULL; +- struct kmod_list *l = NULL; +- +- if (find_kmod_module_from_sysfs_driver(ctx, sysfs_node, strlen(sysfs_node), &drv) >= 0) { +- char *module = strdup(kmod_module_get_name(drv)); +- if (hashmap_put(modules, module, module) < 0) +- free(module); +- return 0; +- } +- +- if (find_kmod_module_from_sysfs_modalias(ctx, sysfs_node, strlen(sysfs_node), &list) >= 0) { +- kmod_list_foreach(l, list) { +- struct kmod_module *mod = kmod_module_get_module(l); +- char *module = strdup(kmod_module_get_name(mod)); +- kmod_module_unref(mod); +- +- if (hashmap_put(modules, module, module) < 0) +- free(module); +- } +- } +- +- return 0; +-} +- +-static void find_suppliers_for_sys_node(Hashmap *suppliers, const char *node_path_raw, +- size_t node_path_len) +-{ +- char node_path[PATH_MAX]; +- char real_path[PATH_MAX]; +- +- memcpy(node_path, node_path_raw, node_path_len); +- node_path[node_path_len] = '\0'; +- +- DIR *d; +- struct dirent *dir; +- while (realpath(node_path, real_path) != NULL && strcmp(real_path, "/sys/devices")) { +- d = opendir(node_path); +- if (d) { +- size_t real_path_len = strlen(real_path); +- while ((dir = readdir(d)) != NULL) { +- if (strstr(dir->d_name, "supplier:platform") != NULL) { +- if ((size_t)snprintf(real_path + real_path_len, sizeof(real_path) - real_path_len, "/%s/supplier", +- dir->d_name) < sizeof(real_path) - real_path_len) { +- char *real_supplier_path = realpath(real_path, NULL); +- if (real_supplier_path != NULL) +- if (hashmap_put(suppliers, real_supplier_path, real_supplier_path) < 0) +- free(real_supplier_path); +- } +- } +- } +- closedir(d); +- } +- strcat(node_path, "/.."); // Also find suppliers of parents +- } +-} +- +-static void find_suppliers(struct kmod_ctx *ctx) +-{ +- _cleanup_fts_close_ FTS *fts; +- char *paths[] = { "/sys/devices/platform", NULL }; +- fts = fts_open(paths, FTS_NOSTAT | FTS_PHYSICAL, NULL); +- +- for (FTSENT *ftsent = fts_read(fts); ftsent != NULL; ftsent = fts_read(fts)) { +- if (strcmp(ftsent->fts_name, "modalias") == 0) { +- _cleanup_kmod_module_unref_ struct kmod_module *drv = NULL; +- struct kmod_list *list = NULL; +- struct kmod_list *l; +- +- if (find_kmod_module_from_sysfs_driver(ctx, ftsent->fts_parent->fts_path, ftsent->fts_parent->fts_pathlen, &drv) >= 0) { +- const char *name = kmod_module_get_name(drv); +- Hashmap *suppliers = hashmap_get(modules_suppliers, name); +- if (suppliers == NULL) { +- suppliers = hashmap_new(string_hash_func, string_compare_func); +- hashmap_put(modules_suppliers, strdup(name), suppliers); +- } +- +- find_suppliers_for_sys_node(suppliers, ftsent->fts_parent->fts_path, ftsent->fts_parent->fts_pathlen); +- +- /* Skip modalias check */ +- continue; +- } +- +- if (find_kmod_module_from_sysfs_modalias(ctx, ftsent->fts_parent->fts_path, ftsent->fts_parent->fts_pathlen, &list) < 0) +- continue; +- +- kmod_list_foreach(l, list) { +- _cleanup_kmod_module_unref_ struct kmod_module *mod = kmod_module_get_module(l); +- const char *name = kmod_module_get_name(mod); +- Hashmap *suppliers = hashmap_get(modules_suppliers, name); +- if (suppliers == NULL) { +- suppliers = hashmap_new(string_hash_func, string_compare_func); +- hashmap_put(modules_suppliers, strdup(name), suppliers); +- } +- +- find_suppliers_for_sys_node(suppliers, ftsent->fts_parent->fts_path, ftsent->fts_parent->fts_pathlen); +- } +- } +- } +-} +- +-static Hashmap *find_suppliers_paths_for_module(const char *module) +-{ +- return hashmap_get(modules_suppliers, module); +-} +- +-static int install_dependent_module(struct kmod_ctx *ctx, struct kmod_module *mod, Hashmap *suppliers_paths, int *err) ++static int install_dependent_module(struct kmod_module *mod, int *err) + { + const char *path = NULL; + const char *name = NULL; +@@ -1762,13 +1602,13 @@ static int install_dependent_module(struct kmod_ctx *ctx, struct kmod_module *mo + log_debug("dracut_install '%s' '%s' OK", path, &path[kerneldirlen]); + install_firmware(mod); + modlist = kmod_module_get_dependencies(mod); +- *err = install_dependent_modules(ctx, modlist, suppliers_paths); ++ *err = install_dependent_modules(modlist); + if (*err == 0) { + *err = kmod_module_get_softdeps(mod, &modpre, &modpost); + if (*err == 0) { + int r; +- *err = install_dependent_modules(ctx, modpre, NULL); +- r = install_dependent_modules(ctx, modpost, NULL); ++ *err = install_dependent_modules(modpre); ++ r = install_dependent_modules(modpost); + *err = *err ? : r; + } + } +@@ -1786,7 +1626,7 @@ static int install_dependent_module(struct kmod_ctx *ctx, struct kmod_module *mo + return 0; + } + +-static int install_dependent_modules(struct kmod_ctx *ctx, struct kmod_list *modlist, Hashmap *suppliers_paths) ++static int install_dependent_modules(struct kmod_list *modlist) + { + struct kmod_list *itr = NULL; + int ret = 0; +@@ -1794,44 +1634,14 @@ static int install_dependent_modules(struct kmod_ctx *ctx, struct kmod_list *mod + kmod_list_foreach(itr, modlist) { + _cleanup_kmod_module_unref_ struct kmod_module *mod = NULL; + mod = kmod_module_get_module(itr); +- if (install_dependent_module(ctx, mod, find_suppliers_paths_for_module(kmod_module_get_name(mod)), &ret)) ++ if (install_dependent_module(mod, &ret)) + return -1; + } + +- const char *supplier_path; +- Iterator i; +- HASHMAP_FOREACH(supplier_path, suppliers_paths, i) { +- if (check_hashmap(processed_suppliers, supplier_path)) +- continue; +- +- char *path = strdup(supplier_path); +- hashmap_put(processed_suppliers, path, path); +- +- _cleanup_destroy_hashmap_ Hashmap *modules = hashmap_new(string_hash_func, string_compare_func); +- find_modules_from_sysfs_node(ctx, supplier_path, modules); +- +- _cleanup_destroy_hashmap_ Hashmap *suppliers = hashmap_new(string_hash_func, string_compare_func); +- find_suppliers_for_sys_node(suppliers, supplier_path, strlen(supplier_path)); +- +- if (!hashmap_isempty(modules)) { // Supplier is a module +- const char *module; +- Iterator j; +- HASHMAP_FOREACH(module, modules, j) { +- _cleanup_kmod_module_unref_ struct kmod_module *mod = NULL; +- if (!kmod_module_new_from_name(ctx, module, &mod)) { +- if (install_dependent_module(ctx, mod, suppliers, &ret)) +- return -1; +- } +- } +- } else { // Supplier is builtin +- install_dependent_modules(ctx, NULL, suppliers); +- } +- } +- + return ret; + } + +-static int install_module(struct kmod_ctx *ctx, struct kmod_module *mod) ++static int install_module(struct kmod_module *mod) + { + int ret = 0; + _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL; +@@ -1884,16 +1694,15 @@ static int install_module(struct kmod_ctx *ctx, struct kmod_module *mod) + } + install_firmware(mod); + +- Hashmap *suppliers = find_suppliers_paths_for_module(name); + modlist = kmod_module_get_dependencies(mod); +- ret = install_dependent_modules(ctx, modlist, suppliers); ++ ret = install_dependent_modules(modlist); + + if (ret == 0) { + ret = kmod_module_get_softdeps(mod, &modpre, &modpost); + if (ret == 0) { + int r; +- ret = install_dependent_modules(ctx, modpre, NULL); +- r = install_dependent_modules(ctx, modpost, NULL); ++ ret = install_dependent_modules(modpre); ++ r = install_dependent_modules(modpost); + ret = ret ? : r; + } + } +@@ -2012,9 +1821,6 @@ static int install_modules(int argc, char **argv) + if (p != NULL) + kerneldirlen = p - abskpath; + +- modules_suppliers = hashmap_new(string_hash_func, string_compare_func); +- find_suppliers(ctx); +- + if (arg_hostonly) { + char *modalias_file; + modalias_file = getenv("DRACUT_KERNEL_MODALIASES"); +@@ -2102,7 +1908,7 @@ static int install_modules(int argc, char **argv) + } + kmod_list_foreach(itr, modlist) { + mod = kmod_module_get_module(itr); +- r = install_module(ctx, mod); ++ r = install_module(mod); + kmod_module_unref(mod); + if ((r < 0) && !arg_optional) { + if (!arg_silent) +@@ -2181,7 +1987,7 @@ static int install_modules(int argc, char **argv) + } + kmod_list_foreach(itr, modlist) { + mod = kmod_module_get_module(itr); +- r = install_module(ctx, mod); ++ r = install_module(mod); + kmod_module_unref(mod); + if ((r < 0) && !arg_optional) { + if (!arg_silent) +@@ -2232,7 +2038,7 @@ static int install_modules(int argc, char **argv) + } + kmod_list_foreach(itr, modlist) { + mod = kmod_module_get_module(itr); +- r = install_module(ctx, mod); ++ r = install_module(mod); + kmod_module_unref(mod); + if ((r < 0) && !arg_optional) { + if (!arg_silent) +@@ -2333,10 +2139,8 @@ int main(int argc, char **argv) + + items = hashmap_new(string_hash_func, string_compare_func); + items_failed = hashmap_new(string_hash_func, string_compare_func); +- processed_suppliers = hashmap_new(string_hash_func, string_compare_func); +- modalias_to_kmod = hashmap_new(string_hash_func, string_compare_func); + +- if (!items || !items_failed || !processed_suppliers || !modules_loaded) { ++ if (!items || !items_failed || !modules_loaded) { + log_error("Out of memory"); + r = EXIT_FAILURE; + goto finish1; +@@ -2397,28 +2201,9 @@ finish2: + while ((i = hashmap_steal_first(items_failed))) + item_free(i); + +- Hashmap *h; +- while ((h = hashmap_steal_first(modules_suppliers))) { +- while ((i = hashmap_steal_first(h))) { +- item_free(i); +- } +- hashmap_free(h); +- } +- +- while ((i = hashmap_steal_first(processed_suppliers))) +- item_free(i); +- +- /* +- * Note: modalias_to_kmod's values are freed implicitly by the kmod context destruction +- * in kmod_unref(). +- */ +- + hashmap_free(items); + hashmap_free(items_failed); + hashmap_free(modules_loaded); +- hashmap_free(modules_suppliers); +- hashmap_free(processed_suppliers); +- hashmap_free(modalias_to_kmod); + + if (arg_mod_filter_path) + regfree(&mod_filter_path); +-- +2.46.0 + diff --git a/srcpkgs/dracut/patches/silence-setfont.patch b/srcpkgs/dracut/patches/silence-setfont.patch deleted file mode 100644 index 377c0f3a898..00000000000 --- a/srcpkgs/dracut/patches/silence-setfont.patch +++ /dev/null @@ -1,19 +0,0 @@ -https://github.com/void-linux/void-packages/issues/45216 - -I'm tired of seeing these setfont errors. This will hopefully/eventually be upstreamed, but I'm not holding my breath. - ---- - -diff --git a/modules.d/10i18n/console_init.sh b/modules.d/10i18n/console_init.sh -index 3fe3b673..0e19ae30 100755 ---- a/modules.d/10i18n/console_init.sh -+++ b/modules.d/10i18n/console_init.sh -@@ -49,7 +49,7 @@ set_font() { - setfont "${FONT-${DEFAULT_FONT}}" \ - -C "${1}" \ - ${FONT_MAP:+-m "${FONT_MAP}"} \ -- ${FONT_UNIMAP:+-u "${FONT_UNIMAP}"} -+ ${FONT_UNIMAP:+-u "${FONT_UNIMAP}"} 2>/dev/null - } - - dev_close() { diff --git a/srcpkgs/dracut/template b/srcpkgs/dracut/template index 313e2d98719..c21b1a38a57 100644 --- a/srcpkgs/dracut/template +++ b/srcpkgs/dracut/template @@ -1,7 +1,7 @@ # Template file for 'dracut' pkgname=dracut -version=059 -revision=7 +version=105 +revision=1 build_style=configure configure_args="--prefix=/usr --sysconfdir=/etc" conf_files="/etc/dracut.conf" @@ -11,10 +11,10 @@ depends="bash coreutils cpio eudev gzip kmod>=3.7 kpartx util-linux" short_desc="Low-level tool for generating an initramfs/initrd image" maintainer="Zach Dykstra " license="GPL-2.0-or-later, LGPL-2.0-or-later" -homepage="https://github.com/dracutdevs/dracut/wiki" -changelog="https://raw.githubusercontent.com/dracutdevs/dracut/master/NEWS.md" -distfiles="https://github.com/dracutdevs/dracut/archive/refs/tags/${version}.tar.gz" -checksum=eabf0bb685420c1e1d5475b6855ef787104508f0135ff570312845256e0fcecf +homepage="https://github.com/dracut-ng/dracut-ng/wiki" +changelog="https://raw.githubusercontent.com/dracut-ng/dracut-ng/master/NEWS.md" +distfiles="https://github.com/dracut-ng/dracut-ng/archive/refs/tags/${version}.tar.gz" +checksum=a5f94012873f589e2efc3659341f5e383ec90419f5c361a6fd3561f946133f69 alternatives=" initramfs:/etc/kernel.d/post-install/20-initramfs:/usr/libexec/dracut/kernel-hook-postinst initramfs:/etc/kernel.d/post-remove/20-initramfs:/usr/libexec/dracut/kernel-hook-postrm @@ -32,16 +32,11 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then fi case "$XBPS_TARGET_MACHINE" in - i686*|x86_64*) # archs supported by dracut for EFI bundle + i686*|x86_64*|aarch64*) # archs supported by dracut for EFI bundle subpackages+=" dracut-uefi" ;; esac -pre_build() { - # Upstream tarball is missing version information - DRACUT_VERSION="${version}" make dracut-version.sh -} - post_install() { # kernel hooks. vinstall ${FILESDIR}/kernel-hook-postinst 755 usr/libexec/dracut @@ -52,23 +47,21 @@ post_install() { # systemd dependent additional dracut modules for f in 06rngd 06dbus-broker 06dbus-daemon 09dbus \ - 35connman 35network-manager 35network-wicked 80lvmmerge \ - 99memstrack 99squash; do + 35connman 35network-manager 80lvmmerge \ + 91fido2 91pcsc 91pkcs11 91tpm2-tss 95squash* \ + 99memstrack 99squash*; do rm -r ${DESTDIR}/usr/lib/dracut/modules.d/${f} done # don't need s390x architecture dependent dracut modules for f in 80cms 81cio_ignore 91zipl 95dasd 95dasd_mod \ - 95dasd_rules 95dcssblk 95qeth_rules 95zfcp \ - 95zfcp_rules 95znet; do + 95dcssblk 95zfcp 95znet; do rm -r ${DESTDIR}/usr/lib/dracut/modules.d/${f} done - # ifcfg network-scripts dependent (RHEL-derived) - rm -r ${DESTDIR}/usr/lib/dracut/modules.d/45ifcfg - rm ${DESTDIR}/usr/share/man/man8/*.service.* rm -r ${DESTDIR}/usr/lib/kernel + rm -r "${DESTDIR}"/usr/lib/dracut/test } dracut-network_package() { @@ -84,7 +77,7 @@ dracut-network_package() { } dracut-uefi_package() { - depends="binutils gummiboot-efistub ${sourcepkg}>=${version}_${revision}" + depends="binutils systemd-boot-efistub ${sourcepkg}>=${version}_${revision}" short_desc+=" - UEFI bundle hook" conf_files="/etc/default/dracut-uefi-hook"