Skip to content

Instantly share code, notes, and snippets.

@devoxel
Created June 16, 2024 13:47
Show Gist options
  • Save devoxel/c5987f38749c0e7bb6a768f861dffeb0 to your computer and use it in GitHub Desktop.
Save devoxel/c5987f38749c0e7bb6a768f861dffeb0 to your computer and use it in GitHub Desktop.
utility to mount & flash glove80 keyboard on linux
#!/bin/bash
set -e
FIRMWARE="$1"
if [ ! -f "$FIRMWARE" ]; then
echo "usage: $0 <firmware file>"
exit 1
fi
writefirm() {
LABEL="$1"
DISK="/dev/disk/by-label/$LABEL"
MNT="/mnt/$LABEL"
until [ -e "$DISK" ]
do
sleep 2
done
mkdir -p "$MNT"
mount "$DISK" "$MNT"
echo "+$MNT"
cp "$FIRMWARE" "$MNT"
umount "$MNT"
echo "-$MNT"
rmdir "$MNT"
}
echo "setup RH keyboard for flash (hold magic+I while booting)"
writefirm GLV80RHBOOT
echo "setup LH keyboard for flash (hold magic+E while booting)"
writefirm GLV80LHBOOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment