blob: 8b3f5de791fe58494e3110f09846807797473b36 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001#!/bin/sh
Brad Bishopc342db32019-05-15 21:57:59 -04002#
3# SPDX-License-Identifier: MIT
4#
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08005
6set -e
7
Andrew Geissler82c905d2020-04-13 13:39:40 -05008case "${PREFERRED_PROVIDER_udev}" in
9 systemd)
10 UDEV_EXTRA_ARGS="--usr"
11 UDEVLIBDIR="${rootlibexecdir}"
Patrick Williams03907ee2022-05-01 06:28:52 -050012 UDEVADM="${base_bindir}/udevadm"
Andrew Geissler82c905d2020-04-13 13:39:40 -050013 ;;
14
15 *)
16 UDEV_EXTRA_ARGS=""
17 UDEVLIBDIR="${sysconfdir}"
Patrick Williams03907ee2022-05-01 06:28:52 -050018 UDEVADM="${bindir}/udevadm"
Andrew Geissler82c905d2020-04-13 13:39:40 -050019 ;;
20esac
21
Andrew Geissler6ce62a22020-11-30 19:58:47 -060022rm -f $D${UDEVLIBDIR}/udev/hwdb.bin
Patrick Williams03907ee2022-05-01 06:28:52 -050023PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${UDEVADM} hwdb --update --root $D ${UDEV_EXTRA_ARGS} ||
24 PSEUDO_UNLOAD=1 qemuwrapper -L $D $D${UDEVADM} hwdb --update --root $D ${UDEV_EXTRA_ARGS}
Andrew Geissler82c905d2020-04-13 13:39:40 -050025chown root:root $D${UDEVLIBDIR}/udev/hwdb.bin