Files
MicroPythonOS/scripts/install.sh
T

67 lines
1.5 KiB
Bash
Raw Normal View History

2025-04-22 13:34:38 +02:00
pkill -f "python.*mpremote"
2025-10-08 17:52:48 +02:00
target="$1"
appname="$2"
2025-05-07 10:38:40 +02:00
2025-10-19 11:59:47 +02:00
if [ -z "$target" ]; then
echo "Usage: $0 <target> [appname]"
echo "Example: $0 fri3d-2024"
echo "Example: $0 waveshare-esp32-s3-touch-lcd-2"
2025-10-08 17:52:48 +02:00
echo "Example: $0 fri3d-2024 appstore"
echo "Example: $0 waveshare-esp32-s3-touch-lcd-2 imu"
2025-10-19 11:59:47 +02:00
exit 1
2025-05-07 10:40:07 +02:00
fi
2025-10-08 17:52:48 +02:00
2025-10-13 18:47:51 +02:00
mpremote=$(readlink -f "../lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py")
2025-06-15 10:25:38 +02:00
2025-04-25 15:08:49 +02:00
pushd internal_filesystem/
2025-05-07 10:38:40 +02:00
if [ ! -z "$appname" ]; then
echo "Installing one app: $appname"
2025-06-02 19:52:27 +02:00
appdir="apps/$appname/"
2025-05-07 16:10:55 +02:00
target="apps/"
2025-05-07 10:38:40 +02:00
if [ ! -d "$appdir" ]; then
echo "$appdir doesn't exist so taking the builtin/"
2025-06-02 19:52:27 +02:00
appdir="builtin/apps/$appname/"
2025-05-07 16:10:55 +02:00
target="builtin/apps/"
2025-05-07 10:38:40 +02:00
if [ ! -d "$appdir" ]; then
echo "$appdir also doesn't exist, exiting..."
exit 1
fi
fi
2025-06-15 10:25:38 +02:00
$mpremote mkdir "/apps"
$mpremote mkdir "/builtin"
$mpremote mkdir "/builtin/apps"
$mpremote fs cp -r "$appdir" :/"$target"
2025-05-07 10:38:40 +02:00
echo "start_app(\"/$appdir\")"
2025-06-15 10:25:38 +02:00
$mpremote
2025-05-07 10:38:40 +02:00
popd
exit
fi
2025-10-08 17:52:48 +02:00
if [ -z "$target" -o "$target" == "waveshare-esp32-s3-touch-lcd-2" ]; then
$mpremote fs cp boot.py :/boot.py
else
$mpremote fs cp boot_"$target".py :/boot.py
fi
2025-06-15 10:25:38 +02:00
$mpremote fs cp main.py :/main.py
2025-05-06 15:56:40 +02:00
2025-06-15 10:25:38 +02:00
#$mpremote fs cp main.py :/system/button.py
#$mpremote fs cp autorun.py :/autorun.py
#$mpremote fs cp -r system :/
2025-04-22 11:54:36 +02:00
2025-06-15 10:25:38 +02:00
$mpremote fs cp -r apps :/
$mpremote fs cp -r builtin :/
$mpremote fs cp -r lib :/
$mpremote fs cp -r resources :/
2025-06-15 10:25:38 +02:00
#$mpremote fs cp -r data :/
#$mpremote fs cp -r data/images :/data/
2025-04-21 11:37:30 +02:00
2025-04-25 15:08:49 +02:00
popd
2025-06-15 10:25:38 +02:00
$mpremote reset