Skip to content

Commit bc35b7e

Browse files
committed
save last OPK for instant_play
Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
1 parent 50d83ed commit bc35b7e

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

FunKey/board/funkey/rootfs-overlay/usr/local/sbin/frontend

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ DISABLE_FRONTEND_FILE="/mnt/disable_frontend"
1111
DEFAULT_FRONTEND=retrofe
1212
LOCK_FILE="/var/lock/frontend.lock"
1313
REBOOTING_FILE="/run/rebooting"
14+
LAST_OPK_FILE="/mnt/last_opk"
1415

1516
# Convert old launcher file to new frontend
1617
if [ -f "${LAUNCHER_FILE}" ]; then
@@ -74,6 +75,11 @@ init_frontend() {
7475
echo "${DISABLE_FRONTEND_FILE} file found, not starting frontend"
7576
sleep 5
7677
else
78+
79+
# Umount any remaining OPK, if any
80+
umount /opk >/dev/null 2>&1
81+
rm -f "${LAST_OPK_FILE}"
82+
7783
local frontend="$(get_frontend)"
7884
case "${frontend}" in
7985
gmenu2x|retrofe)

FunKey/board/funkey/rootfs-overlay/usr/local/sbin/instant_play

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
SELF="$(basename ${0})"
77
INSTANT_PLAY_FILE="/mnt/instant_play"
88
RESUME_PLAY_FILE="/mnt/resume_play"
9+
LAST_OPK_FILE="/mnt/last_opk"
910

1011
usage() {
1112
>&2 echo "Usage: ${SELF} load"
@@ -24,6 +25,15 @@ case ${1} in
2425
usage
2526
fi
2627

28+
# Umount any remaining OPK, if any
29+
umount /opk >/dev/null 2>&1
30+
31+
# Mount last OPK, if any
32+
if [ -r "${LAST_OPK_FILE}" ]; then
33+
last_opk=$(cat "${LAST_OPK_FILE}")
34+
mount -t squashfs "${last_opk}" /opk
35+
fi
36+
2737
# Launch Previous Game if any
2838
if [ -f "${INSTANT_PLAY_FILE}" ]; then
2939
keymap resume
@@ -33,6 +43,10 @@ case ${1} in
3343
mv "${INSTANT_PLAY_FILE}" "${RESUME_PLAY_FILE}"
3444
source "${RESUME_PLAY_FILE}"
3545
rm -f "${RESUME_PLAY_FILE}"
46+
if [ -r "${LAST_OPK_FILE}" ]; then
47+
umount /opk
48+
rm "${LAST_OPK_FILE}"
49+
fi
3650
keymap default
3751
termfix_all
3852
fi

FunKey/package/libopk/libopk.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# libopk
44
#
55
#############################################################
6-
LIBOPK_VERSION = 1396aaa
6+
7+
LIBOPK_VERSION = a4bbf06
78
LIBOPK_SITE_METHOD = git
89
LIBOPK_SITE = https://github.com/FunKey-Project/libopk.git
910

0 commit comments

Comments
 (0)