Files
MicroPythonOS/scripts/install.sh
T

60 lines
1.3 KiB
Bash
Raw Normal View History

2025-04-22 13:34:38 +02:00
pkill -f "python.*mpremote"
2025-05-07 10:38:40 +02:00
appname="$1"
2025-05-07 10:40:07 +02:00
if [ -z "$appname" ]; then
echo "Usage: $0 [appname]"
echo "Example: $0"
echo "Example: $0 launcher"
echo "Example: $0 wificonf"
echo "Example: $0 appstore"
sleep 2
fi
2025-06-19 20:09:50 +02:00
mpremote=~/projects/MicroPythonOS/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-06-15 10:25:38 +02:00
$mpremote fs cp boot.py :/boot.py
$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