- Add wrapper for get-edid (bsc#1219395) * default to not calling VBE BIOS which may crash * print a warning message when i2c-dev driver is not loaded OBS-URL: https://build.opensuse.org/request/show/1143053 OBS-URL: https://build.opensuse.org/package/show/hardware/read-edid?expand=0&rev=9
38 lines
625 B
Bash
38 lines
625 B
Bash
#!/bin/sh
|
|
|
|
GET_EDID=@LIBEXECDIR@/get-edid
|
|
|
|
is_classic() {
|
|
while [ $# -gt 0 ] ; do
|
|
if [ "$1" = '-c' ] ; then
|
|
return 0
|
|
fi
|
|
if [ "$1" = '--classiconly' ] ; then
|
|
return 0
|
|
fi
|
|
shift
|
|
done
|
|
return 1
|
|
end
|
|
}
|
|
|
|
check_i2c() {
|
|
if lsmod | grep -Fe i2c_dev > /dev/null ; then
|
|
return 0
|
|
fi
|
|
if modinfo i2c-dev | grep -Fe '(builtin)' > /dev/null ; then
|
|
return 0
|
|
fi
|
|
echo Cannot find i2c-dev kernel module. Maybe it needs to be loaded first. >&2
|
|
return 1
|
|
}
|
|
|
|
|
|
if is_classic "$@" ; then
|
|
exec $GET_EDID "$@"
|
|
else
|
|
check_i2c
|
|
echo Using i2c bus only, use -c option to attempt a VBE BIOS call. >&2
|
|
exec $GET_EDID -i "$@"
|
|
fi
|