dracut-057-44.git20230822

Resolves: #2233597
This commit is contained in:
Pavel Valena 2023-08-22 18:59:49 +02:00
parent ffffb5b27f
commit bb4193a909
2 changed files with 72 additions and 1 deletions

66
0043.patch Normal file
View File

@ -0,0 +1,66 @@
From bc525e2ef02bbcd09adfedb6c92213f1b84d4740 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Tue, 25 Apr 2023 14:56:59 +0200
Subject: [PATCH] feat(hwdb): install hwdb on demand when module is needed
Adding a module to install hwdb. Further extensions might make only selected
part of hwdb installable, to save space. The module is not included by default.
Including the module adds 2MB of compressed data (on Fedora, the file has 12MB).
hwdb is needed in case of custom HW, like a keyboard/mouse or various interfaces.
Original PR: https://github.com/dracutdevs/dracut/pull/1681
(Cherry-picked commit: 062e739d89543a38d4b3e2cab155912bc4bf9e56)
Resolves: #2233597
---
modules.d/95hwdb/module-setup.sh | 26 ++++++++++++++++++++++++++
pkgbuild/dracut.spec | 1 +
2 files changed, 27 insertions(+)
diff --git a/modules.d/95hwdb/module-setup.sh b/modules.d/95hwdb/module-setup.sh
new file mode 100755
index 00000000..16365377
--- /dev/null
+++ b/modules.d/95hwdb/module-setup.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+# This file is part of dracut.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+check() {
+ return 255
+}
+
+# called by dracut
+install() {
+ local hwdb_bin
+
+ # systemd-hwdb ships the file in /etc, with /usr/lib as an alternative.
+ # Therefore consider this location as preferred for configuration.
+ hwdb_bin="${udevdir}"/hwdb.bin
+
+ if [[ ! -r "${hwdb_bin}" ]]; then
+ hwdb_bin="${udevconfdir}"/hwdb.bin
+ fi
+
+ if [[ $hostonly ]]; then
+ inst_multiple -H "${hwdb_bin}"
+ else
+ inst_multiple "${hwdb_bin}"
+ fi
+}
diff --git a/pkgbuild/dracut.spec b/pkgbuild/dracut.spec
index b2d75951..1996f44d 100644
--- a/pkgbuild/dracut.spec
+++ b/pkgbuild/dracut.spec
@@ -367,6 +367,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/91tpm2-tss
%{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95fstab-sys
+%{dracutlibdir}/modules.d/95hwdb
%{dracutlibdir}/modules.d/95lunmask
%{dracutlibdir}/modules.d/95nvmf
%{dracutlibdir}/modules.d/95resume

View File

@ -5,7 +5,7 @@
# strip the automatically generated dep here and instead co-own the
# directory.
%global __requires_exclude pkg-config
%define dist_free_release 43.git20230816
%define dist_free_release 44.git20230822
Name: dracut
Version: 057
@ -71,6 +71,7 @@ Patch39: 0039.patch
Patch40: 0040.patch
Patch41: 0041.patch
Patch42: 0042.patch
Patch43: 0043.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
@ -410,6 +411,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/91tpm2-tss
%{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95fstab-sys
%{dracutlibdir}/modules.d/95hwdb
%{dracutlibdir}/modules.d/95lunmask
%{dracutlibdir}/modules.d/95nvmf
%{dracutlibdir}/modules.d/95resume
@ -520,6 +522,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
%changelog
* Tue Aug 22 2023 Pavel Valena <pvalena@redhat.com> - 057-44.git20230822
- feat(hwdb): install hwdb on demand when module is needed
* Wed Aug 16 2023 Pavel Valena <pvalena@redhat.com> - 057-43.git20230816
- feat(spec): include modules for IMA
- fix(dracut): there can be \ at the end on line in awk script