That is likely too old. What system are you running? Debian stable has udev 252. According to the systemd NEWS file, at least version 250 is required. I should add these checks into the script.
diff --git a/reform2-keyboard-fw/flash.sh b/reform2-keyboard-fw/flash.sh
index bd3c058..c18b0b5 100755
--- a/reform2-keyboard-fw/flash.sh
+++ b/reform2-keyboard-fw/flash.sh
@@ -12,6 +12,17 @@ if [ "$(id -u)" -ne 0 ]; then
exit 1
fi
+get_property() {
+ path="$1"
+ property="$2"
+ if [ "$(udevadm --version)" -lt 250 ]; then
+ # no udevadm --property before version 250
+ udevadm info --query=property "$path" | sed -ne "s/^$property=//p"
+ else
+ udevadm info --query=property --property="$property" --value "$path"
+ fi
+}
+
find_usb_device() {
result=
for p in /sys/bus/usb/devices/*; do
@@ -19,7 +30,7 @@ find_usb_device() {
[ "$(cat "$p/idVendor")" = "$1" ] || continue
[ -e "$p/idProduct" ] || continue
[ "$(cat "$p/idProduct")" = "$2" ] || continue
- [ "$(udevadm info --query=property --property=ID_MODEL --value "$p")" = "$3" ] || continue
+ [ "$(get_property "$p" "ID_MODEL")" = "$3" ] || continue
if [ -n "$result" ]; then
echo "found more than one device matching $1 $2 $3" >&2
exit 1
@@ -46,8 +57,8 @@ path_keyboard=$(find_usb_device 03eb 2042 Reform_Keyboard)
busnum_keyboard=
devnum_keyboard=
if [ -n "$path_keyboard" ] && [ -e "$path_keyboard" ]; then
- busnum_keyboard="$(udevadm info --query=property --property=BUSNUM --value "$path_keyboard")"
- devnum_keyboard="$(udevadm info --query=property --property=DEVNUM --value "$path_keyboard")"
+ busnum_keyboard="$(get_property "$path_keyboard" "BUSNUM")"
+ devnum_keyboard="$(get_property "$path_keyboard" "DEVNUM")"
echo " 1. Find out your keyboard firmware version in the 'System Status' by pressing" >&2
echo " the circle key followed by the S key. The keyboard firmware version is on" >&2
echo " on the last line in a date-based format YYYYMMDD. Then either:"
@@ -86,8 +97,8 @@ if [ -z "$path" ] || [ ! -e "$path" ]; then
exit 1
fi
-busnum="$(udevadm info --query=property --property=BUSNUM --value "$path")"
-devnum="$(udevadm info --query=property --property=DEVNUM --value "$path")"
+busnum="$(get_property "$path" "BUSNUM")"
+devnum="$(get_property "$path" "DEVNUM")"
# do some extra checks if we saw the usb device as a keyboard before
if [ -n "$path_keyboard" ] && [ -e "$path_keyboard" ]; then