Skip to content

Commit

Permalink
feat(hwdb): add hwdb module to install hwdb.bin on demand
Browse files Browse the repository at this point in the history
Module to install hwdb.bin. 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).

Installing hwdb.bin is needed in case of custom HW like a keyboard/mouse, or various interfaces.

Original PR: dracutdevs/dracut#1681
  • Loading branch information
pvalena committed May 15, 2024
1 parent 21dd382 commit 489e779
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,10 @@ fstab-sys:
- changed-files:
- any-glob-to-any-file: 'modules.d/95fstab-sys/*'

hwdb:
- changed-files:
- any-glob-to-any-file: 'modules.d/95hwdb/*'

iscsi:
- changed-files:
- any-glob-to-any-file: 'modules.d/95iscsi/*'
Expand Down
26 changes: 26 additions & 0 deletions modules.d/95hwdb/module-setup.sh
Original file line number Diff line number Diff line change
@@ -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

# Follow the same priority as `systemd-hwdb`; `/etc` is the default
# and `/usr/lib` an alternative location.
hwdb_bin="${udevconfdir}"/hwdb.bin

if [[ ! -r ${hwdb_bin} ]]; then
hwdb_bin="${udevdir}"/hwdb.bin
fi

if [[ $hostonly ]]; then
inst_multiple -H "${hwdb_bin}"
else
inst_multiple "${hwdb_bin}"
fi
}

0 comments on commit 489e779

Please sign in to comment.