Skip to content

Commit

Permalink
feat(hwdb): install hwdb on demand when module is needed
Browse files Browse the repository at this point in the history
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: dracutdevs/dracut#1681

(Cherry-picked commit: ae2ab8c8a65c4ea4f4ad4e8c8f99d493a8f686eb)

Resolves: #1968118
  • Loading branch information
pvalena committed Jul 23, 2023
1 parent 26c332c commit 378570d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions dracut.spec
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/91crypt-loop
%{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
Expand Down
16 changes: 16 additions & 0 deletions modules.d/95hwdb/module-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

check() {
return 255
}

# called by dracut
install() {
inst_multiple -o "${udevdir}"/hwdb.bin

if [[ $hostonly ]]; then
inst_multiple -H -o "${udevconfdir}"/hwdb.bin
fi
}

0 comments on commit 378570d

Please sign in to comment.