fix: picoreplayer remove device as no longer needed

This commit is contained in:
2025-05-24 11:18:47 +02:00
parent cbde498ae8
commit 8e52274edd

View File

@@ -19,11 +19,9 @@ DOWNLOAD_URL="${BASE_URL}/${IMG_ZIP}"
# Print usage
usage() {
cat <<EOF
Usage: sudo $0 --device <rpi-4|rpi-zero|rpi-zero-2> \
--sdcard </dev/sdX> \
Usage: sudo $0 --sdcard </dev/sdX> \
[--env-file /path/to/.env]
--device Target board (rpi-4, rpi-zero, rpi-zero-2)
--sdcard Device node of the SD card (e.g. /dev/sdb)
--env-file File containing WIFI_SSID and WIFI_PSK (defaults to ./.env)
EOF
@@ -31,10 +29,9 @@ EOF
}
# Parse args
DEVICE="" SDCARD=""
SDCARD=""
while [[ $# -gt 0 ]]; do
case "$1" in
--device) DEVICE="$2"; shift 2;;
--sdcard) SDCARD="$2"; shift 2;;
--env-file) ENV_FILE="$2"; shift 2;;
-h|--help) usage;;
@@ -43,7 +40,7 @@ while [[ $# -gt 0 ]]; do
done
# Validate
if [[ -z "$DEVICE" || -z "$SDCARD" ]]; then
if [[ -z "$SDCARD" ]]; then
usage
fi
if [[ ! -b "$SDCARD" ]]; then
@@ -103,20 +100,11 @@ network={
}
EOF
# If a Zero device, enable Hifiberry DAC+ and disable onboard audio
if [[ "$DEVICE" == "rpi-zero" || "$DEVICE" == "rpi-zero-2" ]]; then
cat >> "$BOOT_MNT/config.txt" <<EOF
# Hifiberry DAC+ overlay for Zero models
dtoverlay=hifiberry-dacplus-std
EOF
fi
# Cleanup
umount "$BOOT_MNT" "$ROOT_MNT"
rmdir "$BOOT_MNT" "$ROOT_MNT"
echo "Done! SD card is ready with PiCorePlayer ${PCP_VERSION} on $DEVICE,"
echo "Done! SD card is ready with PiCorePlayer ${PCP_VERSION},"
echo "hidden Wi-Fi '$WIFI_SSID'."
echo "Insert the SD card into the Pi and power it on."
echo "You can now connect to the PiCorePlayer web interface at http://pcp.local"