-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: dracutdevs/dracut#1681 (Cherry-picked commit: 062e739d89543a38d4b3e2cab155912bc4bf9e56) Resolves: #1968118
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
# 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 | ||
} |