]>
git.ipfire.org Git - thirdparty/systemd.git/blob - test/hwdb-test.sh
2 # call built systemd-hwdb update on our hwdb files to ensure that they parse
5 # (C) 2016 Canonical Ltd.
6 # Author: Martin Pitt <martin.pitt@ubuntu.com>
8 # systemd is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU Lesser General Public License as published by
10 # the Free Software Foundation; either version 2.1 of the License, or
11 # (at your option) any later version.
13 # systemd is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public License
19 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ROOTDIR
=$
(dirname $
(dirname $
(readlink
-f $0)))
24 SYSTEMD_HWDB
=${builddir:-.}/systemd-hwdb
26 if [ ! -x "$SYSTEMD_HWDB" ]; then
27 echo "$SYSTEMD_HWDB does not exist, please build first"
31 D
=$
(mktemp
--directory)
32 trap "rm -rf '$D'" EXIT INT QUIT PIPE
33 mkdir
-p "$D/etc/udev"
34 ln -s "$ROOTDIR/hwdb" "$D/etc/udev/hwdb.d"
36 err
=$
("$SYSTEMD_HWDB" update
--root "$D" 2>&1 >/dev
/null
) && rc
= || rc
=$?
37 if [ -n "$err" ]; then
42 echo "$SYSTEMD_HWDB returned $rc"
46 if [ ! -e "$D/etc/udev/hwdb.bin" ]; then
47 echo "$D/etc/udev/hwdb.bin was not generated"