Skip to content

Instantly share code, notes, and snippets.

@MRDGH2821
Last active March 20, 2025 07:17
Show Gist options
  • Save MRDGH2821/d11a8b4337f51c6d774760ee0e743055 to your computer and use it in GitHub Desktop.
Save MRDGH2821/d11a8b4337f51c6d774760ee0e743055 to your computer and use it in GitHub Desktop.
Firmware updater script for StarLite MK V tablet
#!/usr/bin/env bash
echo "Choose build type:"
echo "1. Stable build"
echo "2. Daily build"
echo "3. Exit"
read "Enter Choice:" -r BUILD_TYPE
flash_rom() {
echo "Flash the ROM? (Y/N)"
read -r FLASH_CONFIRM
if [[ $FLASH_CONFIRM =~ ^[Yy]$ ]]; then
sudo flashrom -p internal -w /tmp/coreboot.rom -i bios --ifd -n -N
echo "Firmware is flashed, please shutdown & disconnect power."
read -r "Press Enter to shutdown..."
sudo shutdown now
else
echo "Firmware update cancelled."
exit 0
fi
}
if [ "$BUILD_TYPE" == "1" ]; then
# Flash stable build
# # Query versions
VERSIONS=("24.06" "24.07" "24.08" "24.09" "24.10" "24.11" "24.12" "25.01" "25.02" "25.03")
echo "Available versions:"
i=1
declare -A version_map
for version in "${VERSIONS[@]}"; do
echo "$i. $version"
version_map[$i]=$version
((i++))
done
read -p "Choose version number: " version_choice
FIRMWARE_VERSION=${version_map[$version_choice]}
if [ -z "$FIRMWARE_VERSION" ]; then
echo "Invalid version selected"
exit 1
fi
# FIRMWARE_VERSION=25.03
wget https://github.com/StarLabsLtd/firmware/raw/main/StarLite/MkV/coreboot/"$FIRMWARE_VERSION"/"$FIRMWARE_VERSION".rom -O /tmp/coreboot.rom
flash_rom
elif [ "$BUILD_TYPE" == "2" ]; then
# Flash daily build
wget https://raw.githubusercontent.com/StarLabsLtd/firmware/refs/heads/main/daily_builds/"$(cat /sys/class/dmi/id/product_sku).rom" -O /tmp/coreboot.rom
flash_rom
elif [ "$BUILD_TYPE" == "3" ]; then
# Exit
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment