rockbox/packaging/rgnano/run.sh
Hairo R. Carela 48392bab94 New port: Anbernic RG Nano
A bit of context, this device is a clone of the FunKey-S with a different form factor, hardware is mostly identical, the relevant difference is it has audio out (via usb-c, adapter to 3.5mm is included), this is the reason why the FunKey-SDK is needed for bulding.

This port is based on the old SDL 1.2 code because the device doesn't have SDL2 support. Alongside what was supported in the SDL 1.2 builds this port supports battery level, charging status and backlight control.

Change-Id: I7fcb85be62748644b667c0efebabf59d6e9c5ade
2025-07-29 21:01:53 -04:00

38 lines
847 B
Bash
Executable file

#!/bin/sh
RBDIR=/mnt/FunKey/rockbox
CFGFILE=$RBDIR/config.cfg
BLPATH=/sys/class/backlight/backlight/brightness
# Install the rockbox folder
if [ ! -d $RBDIR ]; then
notif set 0 " Installing rockbox..."
mkdir -p $RBDIR
cp -r ./install/* $RBDIR
notif clear
else
OPKV=$(cat ./install/rockbox-info.txt | grep Version: | cut -d'-' -f2)
SDV=$(cat $RBDIR/rockbox-info.txt | grep Version: | cut -d'-' -f2)
if [[ $OPKV -gt $SDV ]]; then
notif set 0 " Updating rockbox..."
cp -r -f -u ./install/* $RBDIR
notif clear
fi
fi
# Copy default config
if [ ! -f $CFGFILE ]; then
mkdir -p $(dirname $CFGFILE)
cp ./config.cfg $CFGFILE
fi
# Get current volume/brightness -> launch rockbox -> restore previous values
CUR_VOL=$(volume get)
CUR_BL=$(cat $BLPATH)
volume set 100
./rockbox
volume set $CUR_VOL
echo $CUR_BL > $BLPATH