diff --git a/.github/labeler.yml b/.github/labeler.yml index b8146a09..772e2764 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -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/*' diff --git a/modules.d/95hwdb/module-setup.sh b/modules.d/95hwdb/module-setup.sh new file mode 100755 index 00000000..5d3250f3 --- /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 + + # 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 +}