Created
June 16, 2024 13:47
-
-
Save devoxel/c5987f38749c0e7bb6a768f861dffeb0 to your computer and use it in GitHub Desktop.
utility to mount & flash glove80 keyboard on linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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