mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-13 16:18:52 +01:00
Compare commits
No commits in common. "master" and "2.0.1" have entirely different histories.
30
.github/workflows/build_sdk.yml
vendored
30
.github/workflows/build_sdk.yml
vendored
@ -1,30 +0,0 @@
|
|||||||
name: FunKey SDK Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y -q --no-install-recommends make binutils build-essential gcc g++ patch bzip2 perl cpio unzip rsync file bc wget python python-dev xxd libncurses5-dev cvs git mercurial rsync liblscp-dev subversion python3 python3-dev python3-distutils python3-setuptools ca-certificates openssh-client expect locales sudo procps
|
|
||||||
sudo apt-get -y autoremove
|
|
||||||
sudo apt-get -y clean
|
|
||||||
sudo rm -rf /var/lib/apt/lists/*
|
|
||||||
sudo sed -i 's/# \(en_US.UTF-8\)/\1/' /etc/locale.gen
|
|
||||||
sudo locale-gen --purge --lang en_US.UTF-8
|
|
||||||
- name: Build SDK
|
|
||||||
run: make sdk
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: Upload artifacts
|
|
||||||
path: |
|
|
||||||
images/*
|
|
||||||
br.log
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
source "$BR2_EXTERNAL_FUNKEY_PATH/package/mednafen/Config.in"
|
source "$BR2_EXTERNAL_FUNKEY_PATH/package/mednafen/Config.in"
|
||||||
source "$BR2_EXTERNAL_FUNKEY_PATH/package/fkgpiod/Config.in"
|
source "$BR2_EXTERNAL_FUNKEY_PATH/package/FunKey-GPIO-Mapping/Config.in"
|
||||||
source "$BR2_EXTERNAL_FUNKEY_PATH/package/retrofe/Config.in"
|
source "$BR2_EXTERNAL_FUNKEY_PATH/package/retrofe/Config.in"
|
||||||
source "$BR2_EXTERNAL_FUNKEY_PATH/package/PCSX-ReARMed/Config.in"
|
source "$BR2_EXTERNAL_FUNKEY_PATH/package/PCSX-ReARMed/Config.in"
|
||||||
source "$BR2_EXTERNAL_FUNKEY_PATH/package/FCEUX/Config.in"
|
source "$BR2_EXTERNAL_FUNKEY_PATH/package/FCEUX/Config.in"
|
||||||
@ -17,5 +17,3 @@ source "$BR2_EXTERNAL_FUNKEY_PATH/package/gmenu2x/Config.in"
|
|||||||
source "$BR2_EXTERNAL_FUNKEY_PATH/package/agg/Config.in"
|
source "$BR2_EXTERNAL_FUNKEY_PATH/package/agg/Config.in"
|
||||||
source "$BR2_EXTERNAL_FUNKEY_PATH/package/fluidlite/Config.in"
|
source "$BR2_EXTERNAL_FUNKEY_PATH/package/fluidlite/Config.in"
|
||||||
source "$BR2_EXTERNAL_FUNKEY_PATH/package/libmikmod/Config.in"
|
source "$BR2_EXTERNAL_FUNKEY_PATH/package/libmikmod/Config.in"
|
||||||
source "$BR2_EXTERNAL_FUNKEY_PATH/package/commander/Config.in"
|
|
||||||
source "$BR2_EXTERNAL_FUNKEY_PATH/package/bibi/Config.in"
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Automatically generated make config: don't edit
|
# Automatically generated make config: don't edit
|
||||||
# Busybox version: 1.32.0
|
# Busybox version: 1.32.0
|
||||||
# Tue Apr 6 08:18:28 2021
|
# Fri Jan 15 10:58:20 2021
|
||||||
#
|
#
|
||||||
CONFIG_HAVE_DOT_CONFIG=y
|
CONFIG_HAVE_DOT_CONFIG=y
|
||||||
|
|
||||||
|
|||||||
@ -120,9 +120,6 @@ CONFIG_USB_ZERO=m
|
|||||||
CONFIG_USB_ETH=m
|
CONFIG_USB_ETH=m
|
||||||
CONFIG_USB_ETH_EEM=y
|
CONFIG_USB_ETH_EEM=y
|
||||||
CONFIG_USB_G_NCM=m
|
CONFIG_USB_G_NCM=m
|
||||||
CONFIG_USB_FUNCTIONFS=m
|
|
||||||
CONFIG_USB_FUNCTIONFS_ETH=y
|
|
||||||
CONFIG_USB_FUNCTIONFS_RNDIS=y
|
|
||||||
CONFIG_USB_MASS_STORAGE=m
|
CONFIG_USB_MASS_STORAGE=m
|
||||||
CONFIG_USB_G_SERIAL=m
|
CONFIG_USB_G_SERIAL=m
|
||||||
CONFIG_USB_G_ACM_MS=m
|
CONFIG_USB_G_ACM_MS=m
|
||||||
|
|||||||
@ -1,15 +0,0 @@
|
|||||||
pcm.monocard{
|
|
||||||
slave.pcm "hw:0"
|
|
||||||
slave.channels 2
|
|
||||||
type route
|
|
||||||
ttable {
|
|
||||||
# Copy both input channels to output channel 1 (Right).
|
|
||||||
0.1 1
|
|
||||||
1.1 1
|
|
||||||
# Send nothing to output channel 0 (Left).
|
|
||||||
0.0 0
|
|
||||||
1.0 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pcm.!default monocard
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
CLEAR
|
|
||||||
MAP FN TO KEY KEY_K
|
|
||||||
MAP START TO KEY KEY_S
|
|
||||||
MAP UP TO KEY KEY_U
|
|
||||||
MAP LEFT TO KEY KEY_L
|
|
||||||
MAP FN+LEFT TO KEY KEY_J
|
|
||||||
MAP DOWN TO KEY KEY_D
|
|
||||||
MAP FN+DOWN TO KEY KEY_H
|
|
||||||
MAP RIGHT TO KEY KEY_R
|
|
||||||
MAP FN+RIGHT TO KEY KEY_I
|
|
||||||
MAP R TO KEY KEY_N
|
|
||||||
MAP L TO KEY KEY_M
|
|
||||||
MAP A TO KEY KEY_A
|
|
||||||
MAP B TO KEY KEY_B
|
|
||||||
MAP X TO KEY KEY_X
|
|
||||||
MAP Y TO KEY KEY_Y
|
|
||||||
MAP MENU TO KEY KEY_Q
|
|
||||||
MAP FN+UP TO COMMAND snapshot
|
|
||||||
MAP FN+A TO COMMAND volume up
|
|
||||||
MAP FN+Y TO COMMAND volume down
|
|
||||||
MAP FN+X TO COMMAND brightness up
|
|
||||||
MAP FN+B TO COMMAND brightness down
|
|
||||||
MAP FN+L TO KEY KEY_V
|
|
||||||
MAP FN+R TO KEY KEY_O
|
|
||||||
MAP FN+L+R TO COMMAND system_stats toggle
|
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
####################################
|
||||||
|
# Funkey GPIO keymap config file #
|
||||||
|
####################################
|
||||||
|
# Format:
|
||||||
|
#
|
||||||
|
# - First all GPIO Pin numbers must be declared (integers separated by commas)
|
||||||
|
# By default, pins are declared active high, to declare them active low, add char '*'
|
||||||
|
# Example: 0,1,2,3,4,6,7,10*,11,12,13,14,15
|
||||||
|
#
|
||||||
|
# - Then the mapping can be done as follows (one line per mapping):
|
||||||
|
# Pin_number[+Pin_number...], type_mapping, value, str_help_name_pin, str_help_fct_pin
|
||||||
|
#
|
||||||
|
# args: * Pin_number is the pin number concerned by the maping,
|
||||||
|
# add +Pin_number for multiple touch mapping (not limited in nb of pins)
|
||||||
|
# * type_mapping can be KEYBOARD or SHELL_COMMAND
|
||||||
|
# * value is :
|
||||||
|
# if type_mapping==KEYBOARD: the keycode from /usr/include/linux/input.h]
|
||||||
|
# if type_mapping==SHELL_COMMAND: the shell command to exec
|
||||||
|
# * str_help_name_pin is a sweet name for the pin (ex: PB5)
|
||||||
|
# * str_help_fct_pin is an help str to indicate the function of this mapping
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################
|
||||||
|
# Pins declaration #
|
||||||
|
########################
|
||||||
|
0,1,2,3,4,6,7,10*,11,12,13,14,15
|
||||||
|
|
||||||
|
|
||||||
|
###############
|
||||||
|
# Mapping #
|
||||||
|
###############
|
||||||
|
#7, KEYBOARD, KEY_F, KEY_F, Fn
|
||||||
|
#7+6, KEYBOARD, KEY_K, KEY_K, Select
|
||||||
|
7, KEYBOARD, KEY_K, KEY_K, Select
|
||||||
|
6, KEYBOARD, KEY_S, KEY_S, Start
|
||||||
|
3, KEYBOARD, KEY_U, KEY_U, Up
|
||||||
|
4, KEYBOARD, KEY_L, KEY_L, Left
|
||||||
|
7+4, KEYBOARD, KEY_J, KEY_J, Aspect ratio factor --
|
||||||
|
1, KEYBOARD, KEY_D, KEY_D, Down
|
||||||
|
7+1, KEYBOARD, KEY_H, KEY_H, Aspect ratio mode change
|
||||||
|
0, KEYBOARD, KEY_R, KEY_R, Right
|
||||||
|
7+0, KEYBOARD, KEY_I, KEY_I, Aspect ratio factor ++
|
||||||
|
15, KEYBOARD, KEY_N, KEY_N, R1
|
||||||
|
7+15, KEYBOARD, KEY_O, KEY_O, R2
|
||||||
|
2, KEYBOARD, KEY_M, KEY_M, L1
|
||||||
|
7+2, KEYBOARD, KEY_V, KEY_V, L2
|
||||||
|
12, KEYBOARD, KEY_A, KEY_A, A
|
||||||
|
14, KEYBOARD, KEY_B, KEY_B, B
|
||||||
|
13, KEYBOARD, KEY_Y, KEY_Y, Y
|
||||||
|
11, KEYBOARD, KEY_X, KEY_X, X
|
||||||
|
|
||||||
|
7+3, SHELL_COMMAND, snap, Fn+Start, Snapshot
|
||||||
|
7+12, SHELL_COMMAND, quick_action_volume_up, Fn+Y, Volume++
|
||||||
|
7+13, SHELL_COMMAND, quick_action_volume_down, Fn+A, Volume--
|
||||||
|
7+11, SHELL_COMMAND, quick_action_bright_up, Fn+B, Brightness++
|
||||||
|
7+14, SHELL_COMMAND, quick_action_bright_down, Fn+X, Brightness--
|
||||||
|
10, SHELL_COMMAND, sched_shutdown 0.1, N_OE, Instant Play save and Poweroff because of N_OE
|
||||||
|
7+15+2, SHELL_COMMAND, display_notif_system_stats, Fn+L1+L2, display system cpu and ram usage
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1 +1 @@
|
|||||||
FunKey_S Rev.F
|
FunKey_S Rev.E
|
||||||
|
|||||||
@ -5,6 +5,6 @@
|
|||||||
|___| |_____|__|__||__|\__||_____|___ |
|
|___| |_____|__|__||__|\__||_____|___ |
|
||||||
FUN ON A KEYCHAIN |_____|
|
FUN ON A KEYCHAIN |_____|
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
Version 2.3.0
|
Version 2.0.1
|
||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
NAME="FunKey-OS"
|
NAME="FunKey-OS"
|
||||||
VERSION="2.3.0 (Zen Zebu)"
|
VERSION="2.0.1 (Defiant Dog)"
|
||||||
ID=funkey
|
ID=funkey
|
||||||
ID_LIKE=buildroot
|
ID_LIKE=buildroot
|
||||||
PRETTY_NAME="FunKey-OS 2.3.0"
|
PRETTY_NAME="FunKey-OS 2.0.1"
|
||||||
VERSION_ID="2.3.0"
|
VERSION_ID="2.0.1"
|
||||||
HOME_URL="https://www.funkey-project.com/"
|
HOME_URL="https://www.funkey-project.com/"
|
||||||
SUPPORT_URL="https://www.funkey-project.com/"
|
SUPPORT_URL="https://www.funkey-project.com/"
|
||||||
BUG_REPORT_URL="https://www.funkey-project.com/"
|
BUG_REPORT_URL="https://www.funkey-project.com/"
|
||||||
PRIVACY_POLICY_URL="https://www.funkey-project.com"
|
PRIVACY_POLICY_URL="https://www.funkey-project.com"
|
||||||
VERSION_CODENAME=Zen
|
VERSION_CODENAME=Defiant
|
||||||
UBUNTU_CODENAME=Zen
|
UBUNTU_CODENAME=Defiant
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
rootfs 2.3.0
|
rootfs 2.0.1
|
||||||
|
|||||||
@ -2,7 +2,7 @@ args_mmc=setenv bootargs console=ttyS0,115200 panic=5 rootwait fbcon=map:10 fbco
|
|||||||
baudrate=115200
|
baudrate=115200
|
||||||
bootcmd=run getbootpart; run check_keys; if test ${found} = 1; then setenv bootpart 1; fi; run args_mmc; run loadfdt; run loadimage; bootz ${loadaddr} - ${fdtaddr}
|
bootcmd=run getbootpart; run check_keys; if test ${found} = 1; then setenv bootpart 1; fi; run args_mmc; run loadfdt; run loadimage; bootz ${loadaddr} - ${fdtaddr}
|
||||||
bootdelay=0
|
bootdelay=0
|
||||||
check_keys=run probe_i2c; run set_pullups; setenv found 0; setenv timeout ${delay}; while test ${timeout} > 0; do run read_keys; echo ${keys}; if test ${keys} = f83f; then setenv found 1; setenv timeout 0; else setexpr timeout ${timeout} - 1; fi; done
|
check_keys=run set_pullups; setenv found 0; setenv timeout ${delay}; while test ${timeout} > 0; do run read_keys; if test ${keys} = f83f; then setenv found 1; setenv timeout 0; else setexpr timeout ${timeout} - 1; fi; done
|
||||||
console=ttyS0,115200
|
console=ttyS0,115200
|
||||||
delay=1
|
delay=1
|
||||||
fdt_high=0xffffffff
|
fdt_high=0xffffffff
|
||||||
@ -11,9 +11,8 @@ getbootpart=part list mmc 0 -bootable bootpart
|
|||||||
loadaddr=0x41000000
|
loadaddr=0x41000000
|
||||||
loadfdt=load mmc 0:${bootpart} ${fdtaddr} /boot/sun8i-v3s-funkey.dtb
|
loadfdt=load mmc 0:${bootpart} ${fdtaddr} /boot/sun8i-v3s-funkey.dtb
|
||||||
loadimage=load mmc 0:${bootpart} ${loadaddr} /boot/zImage
|
loadimage=load mmc 0:${bootpart} ${loadaddr} /boot/zImage
|
||||||
probe_i2c=if i2c probe 76; then setenv i2caddr 76; else setenv i2caddr 20; fi
|
read_keys=i2c read 20 0 2 1c20500; setexpr.w keys *1c20500
|
||||||
read_keys=i2c read ${i2caddr} 0 2 1c20500; setexpr.w keys *1c20500 \\& 0xf8ff
|
set_pullups=i2c mw 20 46 df; i2c mw 20 47 f8
|
||||||
set_pullups=i2c mw ${i2caddr} 46 df; i2c mw ${i2caddr} 47 f8
|
|
||||||
stderr=serial@01c28000
|
stderr=serial@01c28000
|
||||||
stdin=serial@01c28000
|
stdin=serial@01c28000
|
||||||
stdout=serial@01c28000
|
stdout=serial@01c28000
|
||||||
|
|||||||
@ -18,46 +18,13 @@ alias l='ls $LS_OPTIONS -lA'
|
|||||||
# alias cp='cp -i'
|
# alias cp='cp -i'
|
||||||
# alias mv='mv -i'
|
# alias mv='mv -i'
|
||||||
|
|
||||||
# Alias functions for compatibility
|
|
||||||
volume_get() {
|
|
||||||
volume get "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
volume_set() {
|
|
||||||
volume set "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
brightness_get() {
|
|
||||||
brightness get "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
brightness_set() {
|
|
||||||
brightness set "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
notif_set() {
|
|
||||||
notif set "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
start_audio_amp() {
|
|
||||||
audio_amp "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
cancel_sched_powerdown() {
|
|
||||||
powerdown handle
|
|
||||||
}
|
|
||||||
|
|
||||||
# Relocate HOME into the r/w partition
|
# Relocate HOME into the r/w partition
|
||||||
export HOME=/mnt/FunKey
|
export HOME=/mnt/FunKey
|
||||||
mkdir -p "${HOME}"
|
mkdir -p "${HOME}"
|
||||||
export MEDNAFEN_HOME=$HOME/.mednafen
|
export MEDNAFEN_HOME=$HOME/.mednafen
|
||||||
mkdir -p "${MEDNAFEN_HOME}"
|
mkdir -p "${MEDNAFEN_HOME}"
|
||||||
cp "/usr/games/lynxboot.img" "/usr/games/mednafen-09x.cfg" "${MEDNAFEN_HOME}/"
|
|
||||||
export GMENU2X_HOME="$HOME/.gmenu2x"
|
export GMENU2X_HOME="$HOME/.gmenu2x"
|
||||||
mkdir -p "${GMENU2X_HOME}"
|
mkdir -p "${GMENU2X_HOME}"
|
||||||
export RETROFE_HOME="$HOME/.retrofe"
|
|
||||||
mkdir -p "${RETROFE_HOME}"
|
|
||||||
mkdir -p "${RETROFE_HOME}/layouts"
|
|
||||||
|
|
||||||
# Resize the console to the terminal dimensions
|
# Resize the console to the terminal dimensions
|
||||||
resize() {
|
resize() {
|
||||||
@ -77,20 +44,22 @@ resize() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Restore saved volume
|
|
||||||
echo "Restore saved volume"
|
|
||||||
volume set $(volume get) >/dev/null 2>&1
|
|
||||||
|
|
||||||
# Restore saved brightness
|
# Start ampli
|
||||||
echo "Restore saved brightness"
|
echo "Start audio amplifier"
|
||||||
brightness set $(brightness get) >/dev/null 2>&1
|
start_audio_amp 1 >/dev/null 2>&1
|
||||||
|
|
||||||
|
# Force unmute sound card and reset volume
|
||||||
|
echo "Force unmute sound card and reset volume"
|
||||||
|
volume_set $(volume_get) >/dev/null 2>&1
|
||||||
|
|
||||||
|
# Reset saved brightness
|
||||||
|
echo "Reset saved brightness"
|
||||||
|
brightness_set $(brightness_get) >/dev/null 2>&1
|
||||||
|
|
||||||
# Start Assembly tests (blocking process)
|
# Start Assembly tests (blocking process)
|
||||||
assembly_tests >/dev/null 2>&1
|
assembly_tests >/dev/null 2>&1
|
||||||
|
|
||||||
# Restart saved application/game if any
|
# Start launcher
|
||||||
instant_play load
|
echo "Start launcher"
|
||||||
|
start_launcher >/dev/null 2>&1 &
|
||||||
# Start frontend
|
|
||||||
echo "Start frontend"
|
|
||||||
frontend init >/dev/null 2>&1 &
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# Uncomment and edit the following line to use a different ROM path.
|
# Uncomment and edit the following line to use a different ROM path.
|
||||||
list.path = %BASE_ITEM_PATH%/%ITEM_COLLECTION_NAME%
|
list.path = %BASE_ITEM_PATH%/%ITEM_COLLECTION_NAME%
|
||||||
list.includeMissingItems = false
|
list.includeMissingItems = false
|
||||||
list.extensions = gba,GBA,zip,ZIP
|
list.extensions = gba,GBA
|
||||||
list.menuSort = yes
|
list.menuSort = yes
|
||||||
|
|
||||||
launcher = gba
|
launcher = gba
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# Uncomment and edit the following line to use a different ROM path.
|
# Uncomment and edit the following line to use a different ROM path.
|
||||||
list.path = %BASE_ITEM_PATH%/%ITEM_COLLECTION_NAME%
|
list.path = %BASE_ITEM_PATH%/%ITEM_COLLECTION_NAME%
|
||||||
list.includeMissingItems = false
|
list.includeMissingItems = false
|
||||||
list.extensions = nes,NES,fds,FDS,zip,ZIP
|
list.extensions = nes,NES,fds,FDS
|
||||||
list.menuSort = yes
|
list.menuSort = yes
|
||||||
|
|
||||||
launcher = NES
|
launcher = NES
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# Uncomment and edit the following line to use a different ROM path.
|
# Uncomment and edit the following line to use a different ROM path.
|
||||||
list.path = %BASE_ITEM_PATH%/%ITEM_COLLECTION_NAME%
|
list.path = %BASE_ITEM_PATH%/%ITEM_COLLECTION_NAME%
|
||||||
list.includeMissingItems = false
|
list.includeMissingItems = false
|
||||||
list.extensions = zip,ZIP,pce,PCE,sgx,SGX,cue,CUE
|
list.extensions = zip,ZIP,pce,PCE,sgx,SGX
|
||||||
list.menuSort = yes
|
list.menuSort = yes
|
||||||
|
|
||||||
launcher = pce
|
launcher = pce
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# Uncomment and edit the following line to use a different ROM path.
|
# Uncomment and edit the following line to use a different ROM path.
|
||||||
list.path = %BASE_ITEM_PATH%/%ITEM_COLLECTION_NAME%
|
list.path = %BASE_ITEM_PATH%/%ITEM_COLLECTION_NAME%
|
||||||
list.includeMissingItems = false
|
list.includeMissingItems = false
|
||||||
list.extensions = sfc,SFC,smc,SMC,zip,ZIP
|
list.extensions = sfc,SFC,smc,SMC
|
||||||
list.menuSort = yes
|
list.menuSort = yes
|
||||||
|
|
||||||
launcher = snes
|
launcher = snes
|
||||||
|
|||||||
@ -19,7 +19,7 @@ list.includeMissingItems = true
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# Extensions are comma separated without spaces
|
# Extensions are comma separated without spaces
|
||||||
###############################################################################
|
###############################################################################
|
||||||
list.extensions = zip,ZIP,md,MD,bin,BIN,32x,32X,cue,CUE,cso,CSO,chd,CHD,smd,SMD
|
list.extensions = zip,ZIP,md,MD,bin,BIN,smd,SMD
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# If a menu.xml file exists, it will display the menu alphabetically. To
|
# If a menu.xml file exists, it will display the menu alphabetically. To
|
||||||
|
|||||||
@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
mednafen -fs 1 -gg.stretch full "$1"&
|
mednafen -fs 1 -gg.stretch full "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
sdlgnuboy --syncrtc --stereo=0 "$1"&
|
sdlgnuboy --syncrtc "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
cd ${HOME}
|
cd ${HOME}
|
||||||
gpsp "$1"&
|
gpsp "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,6 @@
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
gpsp "$1"&
|
gpsp "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
mednafen -fs 1 -lynx.stretch full "$1"&
|
mednafen -fs 1 -lynx.stretch full "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
mednafen -sound 1 -soundrate 22050 -soundbufsize 100 -vdriver sdl -frameskip 1 -fs 0 "$1"&
|
mednafen -sound 1 -soundrate 22050 -soundbufsize 100 -vdriver sdl -frameskip 1 -fs 0 "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -3,6 +3,6 @@
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
PicoDrive "$1"&
|
PicoDrive "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -3,6 +3,6 @@
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
fceux "$1"&
|
fceux "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
mednafen -fs 1 -ngp.stretch full "$1"&
|
mednafen -fs 1 -ngp.stretch full "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
mednafen -fs 1 -force_module pce_fast -pce_fast.stretch full "$1"&
|
mednafen -fs 1 -force_module pce_fast -pce_fast.stretch full "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -3,6 +3,6 @@
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
pcsx -frameskip -cdfile "$1"&
|
pcsx -frameskip -cdfile "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -3,6 +3,6 @@
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
pcsx -cdfile "$1"&
|
pcsx -cdfile "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -3,6 +3,6 @@
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
PicoDrive "$1"&
|
PicoDrive "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -3,6 +3,6 @@
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
psnes "$1"&
|
psnes "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -3,6 +3,6 @@
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
psnes "$1"&
|
psnes "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -5,6 +5,6 @@ cp /usr/games/mednafen-09x.cfg ${MEDNAFEN_HOME}/
|
|||||||
# Launch the process in background, record the PID into a file, wait
|
# Launch the process in background, record the PID into a file, wait
|
||||||
# for the process to terminate and erase the recorded PID
|
# for the process to terminate and erase the recorded PID
|
||||||
mednafen -fs 1 -wswan.stretch full "$1"&
|
mednafen -fs 1 -wswan.stretch full "$1"&
|
||||||
pid record $!
|
record_pid $!
|
||||||
wait $!
|
wait $!
|
||||||
pid erase
|
erase_pid
|
||||||
|
|||||||
@ -3021,10 +3021,10 @@ ngp.enable 1
|
|||||||
ngp.forcemono 1
|
ngp.forcemono 1
|
||||||
|
|
||||||
;ngp, Built-In, Gamepad: A
|
;ngp, Built-In, Gamepad: A
|
||||||
ngp.input.builtin.gamepad.a keyboard 98~keyboard 120
|
ngp.input.builtin.gamepad.a keyboard 97
|
||||||
|
|
||||||
;ngp, Built-In, Gamepad: B
|
;ngp, Built-In, Gamepad: B
|
||||||
ngp.input.builtin.gamepad.b keyboard 97~keyboard 121
|
ngp.input.builtin.gamepad.b keyboard 98
|
||||||
|
|
||||||
;ngp, Built-In, Gamepad: DOWN ↓
|
;ngp, Built-In, Gamepad: DOWN ↓
|
||||||
ngp.input.builtin.gamepad.down keyboard 100
|
ngp.input.builtin.gamepad.down keyboard 100
|
||||||
|
|||||||
@ -22,7 +22,16 @@ if [ $? -ne 0 ]; then
|
|||||||
local return_code=$1
|
local return_code=$1
|
||||||
shift
|
shift
|
||||||
warn "$@"
|
warn "$@"
|
||||||
notif set 0 "$@"
|
notif "$@"
|
||||||
exit $return_code
|
exit $return_code
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
notif () {
|
||||||
|
info "$@"
|
||||||
|
printf "$@" > /sys/class/graphics/fb0/notification
|
||||||
|
}
|
||||||
|
|
||||||
|
clear_notif () {
|
||||||
|
printf "clear" > /sys/class/graphics/fb0/notification
|
||||||
|
}
|
||||||
|
|||||||
@ -1,154 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
#set -xv
|
|
||||||
|
|
||||||
SELF=${SELF:-$(basename $0)}
|
|
||||||
|
|
||||||
source /usr/local/lib/utils
|
|
||||||
source usb_gadget
|
|
||||||
|
|
||||||
# The composite gadget directory
|
|
||||||
GADGET=/sys/kernel/config/usb_gadget/FunKey
|
|
||||||
|
|
||||||
# USB VID for Intel
|
|
||||||
ID_VENDOR="0x8087"
|
|
||||||
|
|
||||||
# USB PID for Multifunction Composite Gadget
|
|
||||||
ID_PRODUCT="0x011e"
|
|
||||||
|
|
||||||
# Get the CPU serial number
|
|
||||||
SERIAL="$(grep Serial /proc/cpuinfo | sed 's/Serial\s*: \(\w*\)/\1/')"
|
|
||||||
|
|
||||||
# Initialize the ADB
|
|
||||||
init_adb() {
|
|
||||||
|
|
||||||
# Don't proceed if existing gadget is present
|
|
||||||
if [ -e ${GADGET} ]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get the legacy drivers out of the way
|
|
||||||
modprobe -r g_ether
|
|
||||||
modprobe -r g_mass_storage
|
|
||||||
|
|
||||||
# Load the libcomposite USB driver, configfs and various other drivers
|
|
||||||
modprobe libcomposite
|
|
||||||
modprobe usb_f_serial
|
|
||||||
modprobe usb_f_fs
|
|
||||||
modprobe usb_f_acm
|
|
||||||
|
|
||||||
# USB Device Controller Driver
|
|
||||||
local udc_driver=$(ls /sys/class/udc | cut -f1 | head -n 1)
|
|
||||||
|
|
||||||
# Create our gadget directory
|
|
||||||
mkdir ${GADGET}
|
|
||||||
mkdir ${GADGET}/strings/0x409
|
|
||||||
mkdir ${GADGET}/configs/FunKey.1
|
|
||||||
mkdir ${GADGET}/configs/FunKey.1/strings/0x409
|
|
||||||
mkdir ${GADGET}/functions/acm.GS0
|
|
||||||
mkdir ${GADGET}/functions/ffs.adb
|
|
||||||
|
|
||||||
# USB VID and PID
|
|
||||||
echo ${ID_VENDOR} > ${GADGET}/idVendor
|
|
||||||
echo ${ID_PRODUCT} > ${GADGET}/idProduct
|
|
||||||
|
|
||||||
# Device String Descriptiors
|
|
||||||
echo "Intel" > ${GADGET}/strings/0x409/manufacturer
|
|
||||||
echo "FunKey S" > ${GADGET}/strings/0x409/product
|
|
||||||
echo ${SERIAL} > ${GADGET}/strings/0x409/serialnumber
|
|
||||||
|
|
||||||
# Configuration
|
|
||||||
|
|
||||||
# Maximum power is 120 mA
|
|
||||||
echo 120 > ${GADGET}/configs/FunKey.1/MaxPower
|
|
||||||
|
|
||||||
# Configuration String Descriptors
|
|
||||||
echo "ADB+CDC" > ${GADGET}/configs/FunKey.1/strings/0x409/configuration
|
|
||||||
|
|
||||||
# Add the ACM function to the FunKey.1 configuration
|
|
||||||
ln -s ${GADGET}/functions/acm.GS0 ${GADGET}/configs/FunKey.1
|
|
||||||
|
|
||||||
# Add the FunctionFS function to the FunKey.1 configuration
|
|
||||||
ln -s ${GADGET}/functions/ffs.adb ${GADGET}/configs/FunKey.1
|
|
||||||
|
|
||||||
# Create the function filesystem
|
|
||||||
mkdir /dev/usb-ffs
|
|
||||||
mkdir /dev/usb-ffs/adb
|
|
||||||
|
|
||||||
# Mount the ADB function filesystem
|
|
||||||
mount -t functionfs adb /dev/usb-ffs/adb
|
|
||||||
|
|
||||||
# Bring up the loopback network
|
|
||||||
ifup lo
|
|
||||||
|
|
||||||
# Launch the ADB daemon
|
|
||||||
adbd >/dev/null &
|
|
||||||
|
|
||||||
# Sleeping is required to wait for the UDC to come up
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
# Bind the USB Gadget
|
|
||||||
echo ${udc_driver} > ${GADGET}/UDC
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Deinitialize the ADB
|
|
||||||
deinit_adb() {
|
|
||||||
|
|
||||||
# Unbind the device
|
|
||||||
echo > ${GADGET}/UDC
|
|
||||||
|
|
||||||
# Kill the ADB daemon
|
|
||||||
killall adbd
|
|
||||||
|
|
||||||
# Bring down the local network
|
|
||||||
ifdown lo
|
|
||||||
|
|
||||||
# Unmount the ADB function filesystem
|
|
||||||
umount /dev/usb-ffs/adb
|
|
||||||
|
|
||||||
# Delete the function filesystem
|
|
||||||
rmdir /dev/usb-ffs/adb
|
|
||||||
rmdir /dev/usb-ffs
|
|
||||||
|
|
||||||
# Remove functions from configurations
|
|
||||||
rm ${GADGET}/configs/FunKey.1/acm.GS0
|
|
||||||
rm ${GADGET}/configs/FunKey.1/ffs.adb
|
|
||||||
|
|
||||||
# Remove string directories in configurations
|
|
||||||
rmdir ${GADGET}/configs/FunKey.1/strings/0x409
|
|
||||||
|
|
||||||
# Remove configurations
|
|
||||||
rmdir ${GADGET}/configs/FunKey.1
|
|
||||||
|
|
||||||
# Remove functions
|
|
||||||
rmdir ${GADGET}/functions/acm.GS0
|
|
||||||
rmdir ${GADGET}/functions/ffs.adb
|
|
||||||
|
|
||||||
# Remove strings
|
|
||||||
rmdir ${GADGET}/strings/0x409
|
|
||||||
|
|
||||||
# Finallyy remove the gadget
|
|
||||||
rmdir ${GADGET}
|
|
||||||
|
|
||||||
# Unload the kernel modules
|
|
||||||
modprobe -r usb_f_serial usb_f_fs usb_f_acm
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
|
|
||||||
start)
|
|
||||||
deinit_usb_gadget
|
|
||||||
init_adb
|
|
||||||
;;
|
|
||||||
|
|
||||||
stop)
|
|
||||||
deinit_adb
|
|
||||||
init_usb_gadget
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
die 15 "Usage $0 {start|stop}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit $?
|
|
||||||
@ -18,7 +18,7 @@ touch ${LOCK_FILE}
|
|||||||
|
|
||||||
## Register ourself as the running FunKey task for receiving USR1
|
## Register ourself as the running FunKey task for receiving USR1
|
||||||
## signal for shutting down
|
## signal for shutting down
|
||||||
pid record $$
|
echo $$ > "/var/run/funkey.pid"
|
||||||
|
|
||||||
## Binaries
|
## Binaries
|
||||||
PROD_SCREEN_BIN="/usr/local/sbin/funkey_prod_screens"
|
PROD_SCREEN_BIN="/usr/local/sbin/funkey_prod_screens"
|
||||||
@ -42,7 +42,7 @@ QR_CODE_IMG="/root/logs/assembly_tests/qrcode.png"
|
|||||||
## Function called when SIGURS1 is caught while waiting for it
|
## Function called when SIGURS1 is caught while waiting for it
|
||||||
function function_magnet_detected_ok {
|
function function_magnet_detected_ok {
|
||||||
## Kill scheduled shutdown
|
## Kill scheduled shutdown
|
||||||
pkill -f "powerdown schedule"
|
pkill sched_shutdown
|
||||||
|
|
||||||
## Write magnet_detected file
|
## Write magnet_detected file
|
||||||
if $test_failed; then
|
if $test_failed; then
|
||||||
@ -55,7 +55,7 @@ function function_magnet_detected_ok {
|
|||||||
## Clean shutdown
|
## Clean shutdown
|
||||||
echo " Caught SIGUSR1 signal: magnet detected"
|
echo " Caught SIGUSR1 signal: magnet detected"
|
||||||
echo " Rebooting now..."
|
echo " Rebooting now..."
|
||||||
powerdown now
|
shutdown_funkey
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ function launch_tests_up_until_magnet {
|
|||||||
termfix_all > /dev/null
|
termfix_all > /dev/null
|
||||||
|
|
||||||
## Clear all notifs
|
## Clear all notifs
|
||||||
notif clear
|
notif_clear
|
||||||
|
|
||||||
## Test if log file aleady exists
|
## Test if log file aleady exists
|
||||||
if [[ -f $LOG_FILE ]]; then
|
if [[ -f $LOG_FILE ]]; then
|
||||||
@ -99,7 +99,10 @@ function launch_tests_up_until_magnet {
|
|||||||
echo " OK"
|
echo " OK"
|
||||||
sync
|
sync
|
||||||
|
|
||||||
## Battery tests
|
## Check if battery present
|
||||||
|
if [[ $(cat /sys/class/power_supply/axp20x-battery/present) == "0" ]]; then
|
||||||
|
|
||||||
|
## Launch screen to wait for battery
|
||||||
echo "TEST BATTERY:"
|
echo "TEST BATTERY:"
|
||||||
sync
|
sync
|
||||||
$PROD_SCREEN_BIN WAIT_BATTERY 2>&1
|
$PROD_SCREEN_BIN WAIT_BATTERY 2>&1
|
||||||
@ -111,6 +114,10 @@ function launch_tests_up_until_magnet {
|
|||||||
echo " FAIL"
|
echo " FAIL"
|
||||||
test_failed=true
|
test_failed=true
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "TEST BATTERY:"
|
||||||
|
echo " OK"
|
||||||
|
fi
|
||||||
sync
|
sync
|
||||||
|
|
||||||
## Dump power info from AXP209
|
## Dump power info from AXP209
|
||||||
@ -158,7 +165,7 @@ function launch_tests_up_until_magnet {
|
|||||||
|
|
||||||
## Play 1kHz sine wave
|
## Play 1kHz sine wave
|
||||||
echo " Play 2kHz sine wave"
|
echo " Play 2kHz sine wave"
|
||||||
notif set 0 "^^^ PLAYING SINE WAVE...^^^ ...... ^ ... ...^ .. ..^.. .^. . .^ . ..^ .. ..^ ... ...^ .......^^"
|
notif_set 0 "^^^ PLAYING SINE WAVE...^^^ ...... ^ ... ...^ .. ..^.. .^. . .^ . ..^ .. ..^ ... ...^ .......^^"
|
||||||
speaker-test -t sine -s 1 -f 2000 >/dev/null 2>&1
|
speaker-test -t sine -s 1 -f 2000 >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo " ERROR: SPEAKER SINE"
|
echo " ERROR: SPEAKER SINE"
|
||||||
@ -166,7 +173,7 @@ function launch_tests_up_until_magnet {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
sync
|
sync
|
||||||
notif clear
|
notif_clear
|
||||||
|
|
||||||
## Launch prod screen test speaker
|
## Launch prod screen test speaker
|
||||||
$PROD_SCREEN_BIN SPEAKER 2>&1
|
$PROD_SCREEN_BIN SPEAKER 2>&1
|
||||||
@ -224,7 +231,7 @@ function launch_tests_up_until_magnet {
|
|||||||
|
|
||||||
## Register ourself back as the running FunKey task for receiving USR1
|
## Register ourself back as the running FunKey task for receiving USR1
|
||||||
## signal for shutting down
|
## signal for shutting down
|
||||||
pid record $$
|
echo $$ > "/var/run/funkey.pid"
|
||||||
|
|
||||||
# check magnet test result
|
# check magnet test result
|
||||||
if [[ "$res" == "0" ]]; then
|
if [[ "$res" == "0" ]]; then
|
||||||
@ -248,7 +255,7 @@ function launch_tests_after_magnet {
|
|||||||
#termfix_all > /dev/null
|
#termfix_all > /dev/null
|
||||||
|
|
||||||
## Clear all notifs
|
## Clear all notifs
|
||||||
#notif clear
|
#notif_clear
|
||||||
|
|
||||||
# Log from magnet file
|
# Log from magnet file
|
||||||
echo " Found file: " $MAGNET_DETECTED_FILE
|
echo " Found file: " $MAGNET_DETECTED_FILE
|
||||||
@ -370,6 +377,6 @@ if ! $test_failed; then
|
|||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
## Shutdown
|
## Shutdown
|
||||||
powerdown now &
|
shutdown_funkey &
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1,59 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Uncomment the following line to get debug info
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
SELF="$(basename ${0})"
|
|
||||||
SYSTEM_GPIO="/sys/class/gpio"
|
|
||||||
|
|
||||||
# Power Audio Amplifier enable GPIO (('F' - 'A') * 32 + 6 = 166)
|
|
||||||
GPIO_PF6=166
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
>2& echo "Usage: ${SELF} [1|on|ON|On for ON, 0|off|OFF|Off for OFF]"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check number of arguments
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
1|on|ON|On)
|
|
||||||
|
|
||||||
# Turn ON only if volume is not null
|
|
||||||
if [ "$(volume get)" -ne "0" ]; then
|
|
||||||
echo "Turning audio amplifier ON"
|
|
||||||
else
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
new_state=1
|
|
||||||
;;
|
|
||||||
|
|
||||||
0|off|OFF|Off)
|
|
||||||
echo "Turning audio amplifier OFF"
|
|
||||||
new_state=0
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Export the GPIO if necessary
|
|
||||||
if [ ! -d "${SYSTEM_GPIO}/gpio${GPIO_PF6}" ]; then
|
|
||||||
echo ${GPIO_PF6} > "${SYSTEM_GPIO}/export"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set the power audio amplifier GPIO as output
|
|
||||||
echo "out" > "${SYSTEM_GPIO}/gpio${GPIO_PF6}/direction"
|
|
||||||
|
|
||||||
# Read the current power audio amplifier state
|
|
||||||
current_state=$(cat "${SYSTEM_GPIO}/gpio${GPIO_PF6}/value")
|
|
||||||
|
|
||||||
# Enable/disable the power audio amplifier if necessary
|
|
||||||
if [ ${current_state} -ne ${new_state} ]; then
|
|
||||||
echo ${new_state} > "${SYSTEM_GPIO}/gpio${GPIO_PF6}/value"
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
@ -1,128 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Uncomment the following line to get debug info
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
SELF="$(basename ${0})"
|
|
||||||
SYSTEM_BRIGHTNESS="/sys/class/backlight/backlight/brightness"
|
|
||||||
DEFAULT_BRIGHTNESS_VALUE=100
|
|
||||||
BRIGHTNESS_STEP=10
|
|
||||||
NOTIF_DURATION=2
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
>&2 echo "Usage: ${SELF} get"
|
|
||||||
>&2 echo " ${SELF} set new_brightness_percentage"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
increase_brightness() {
|
|
||||||
|
|
||||||
# Get current value
|
|
||||||
local current_brightness=$(get_brightness)
|
|
||||||
|
|
||||||
# Compute new brightness value
|
|
||||||
local new_brightness=0
|
|
||||||
let new_brightness=${current_brightness}+${BRIGHTNESS_STEP}
|
|
||||||
if [ ${new_brightness} -gt 100 ]; then
|
|
||||||
new_brightness=100
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Change brightness
|
|
||||||
if [ ${new_brightness} -ne ${current_brightness} ]; then
|
|
||||||
set_brightness ${new_brightness}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Notif
|
|
||||||
notif set ${NOTIF_DURATION} " BRIGHTNESS: ${new_brightness}%%"
|
|
||||||
}
|
|
||||||
|
|
||||||
decrease_brightness() {
|
|
||||||
|
|
||||||
# Get current value
|
|
||||||
local current_brightness=$(get_brightness)
|
|
||||||
|
|
||||||
# Compute new brightness value
|
|
||||||
local new_brightness=0
|
|
||||||
if [ ${current_brightness} -gt ${BRIGHTNESS_STEP} ]; then
|
|
||||||
let new_brightness=${current_brightness}-${BRIGHTNESS_STEP}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Change brightness
|
|
||||||
if [ ${new_brightness} -ne ${current_brightness} ]; then
|
|
||||||
set_brightness ${new_brightness}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Notif
|
|
||||||
notif set ${NOTIF_DURATION} " BRIGHTNESS: ${new_brightness}%%"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_brightness() {
|
|
||||||
local brightness=$(fw_printenv -n brightness 2>/dev/null)
|
|
||||||
if ! [ ! "${brightness}" -ne "${brightness}" ] 2> /dev/null; then
|
|
||||||
brightness=${DEFAULT_BRIGHTNESS_VALUE}
|
|
||||||
fw_setenv brightness ${brightness}
|
|
||||||
fi
|
|
||||||
echo ${brightness}
|
|
||||||
}
|
|
||||||
|
|
||||||
set_brightness() {
|
|
||||||
|
|
||||||
# Set the new brightness percentage in the kernel driver
|
|
||||||
local brightness=${1}
|
|
||||||
local kernel_brightness
|
|
||||||
let kernel_brightness=${brightness}+10
|
|
||||||
let kernel_brightness/=10
|
|
||||||
echo ${kernel_brightness} > "${SYSTEM_BRIGHTNESS}"
|
|
||||||
|
|
||||||
# Set the new brightness value in a bootloader variable
|
|
||||||
if [ ${?} -eq 0 -a $(get_brightness) -ne ${brightness} ]; then
|
|
||||||
fw_setenv brightness ${brightness}
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check number of arguments
|
|
||||||
if [ ${#} -lt 1 -o ${#} -gt 2 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
up)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
increase_brightness
|
|
||||||
;;
|
|
||||||
|
|
||||||
down)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
decrease_brightness
|
|
||||||
;;
|
|
||||||
|
|
||||||
get)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
get_brightness
|
|
||||||
;;
|
|
||||||
|
|
||||||
set)
|
|
||||||
if [ ${#} -ne 2 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make sure the argument is a positive number <= 100
|
|
||||||
if [ -n "${2}" ] && [ "${2}" -eq "${2}" ] 2>/dev/null && \
|
|
||||||
[ "${2}" -ge 0 ] && [ "${2}" -le 100 ]; then
|
|
||||||
set_brightness "${2}"
|
|
||||||
else
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
||||||
18
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get
Executable file
18
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
BRIGHTNESS_DEFAULT_VALUE=100
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ ${#} -ne 0 ]; then
|
||||||
|
echo "Usage: $(basename ${0})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Sanity check: Check if integer
|
||||||
|
brightness=$(fw_printenv -n brightness 2>/dev/null)
|
||||||
|
if ! [ ! "${brightness}" -ne "${brightness}" ] 2> /dev/null; then
|
||||||
|
brightness=${BRIGHTNESS_DEFAULT_VALUE}
|
||||||
|
fw_setenv brightness ${brightness}
|
||||||
|
fi
|
||||||
|
echo ${brightness}
|
||||||
|
exit 0
|
||||||
13
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get_sysfs
Executable file
13
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_get_sysfs
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SYSTEM_BRIGHTNESS=/sys/class/backlight/backlight/brightness
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ ${#} -ne 0 ]; then
|
||||||
|
echo "Usage: $(basename ${0})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
let brightness=$(cat ${SYSTEM_BRIGHTNESS})*10-10
|
||||||
|
echo ${brightness}
|
||||||
|
exit 0
|
||||||
27
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_set
Executable file
27
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_set
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SYSTEM_BRIGHTNESS=/sys/class/backlight/backlight/brightness
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ ${#} -ne 1 ]; then
|
||||||
|
echo "Usage: $(basename ${0}) new_brightness_percentage"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check value's range
|
||||||
|
if [ ${1} -gt 100 ]; then
|
||||||
|
echo "Usage: Wrong brightness percentage (${1}), must be between 0 and 100"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
brightness_percentage=${1}
|
||||||
|
|
||||||
|
# Set new brightness percentage
|
||||||
|
let value=${1}+10
|
||||||
|
let value/=10
|
||||||
|
echo ${value} > ${SYSTEM_BRIGHTNESS}
|
||||||
|
|
||||||
|
# Set new brightness value in brightness file
|
||||||
|
if [ ${?} -eq 0 -a $(brightness_get) -ne ${brightness_percentage} ]; then
|
||||||
|
fw_setenv brightness ${brightness_percentage}
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
21
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_set_sysfs
Executable file
21
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/brightness_set_sysfs
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SYSTEM_BRIGHTNESS=/sys/class/backlight/backlight/brightness
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ ${#} -ne 1 ]; then
|
||||||
|
echo "Usage: $(basename ${0}) new_brightness_percentage"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check value's range
|
||||||
|
if [ ${1} -gt 100 ]; then
|
||||||
|
echo "Usage: Wrong brightness percentage (${1}), must be between 0 and 100"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set new brightness percentage
|
||||||
|
let value=${1}+10
|
||||||
|
let value/=10
|
||||||
|
echo ${value} > ${SYSTEM_BRIGHTNESS}
|
||||||
|
exit 0
|
||||||
11
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/cancel_sched_powerdown
Executable file
11
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/cancel_sched_powerdown
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Uncomment the following line to get debug info
|
||||||
|
#set -x
|
||||||
|
|
||||||
|
if [ ${#} != 0 ]; then
|
||||||
|
echo "Usage: $(basename ${0})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
pkill sched_powerdown
|
||||||
|
exit 0
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
notif_set 0 " Getting system stats..."
|
||||||
|
killall -s USR1 system_stats
|
||||||
|
exit 0
|
||||||
12
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/erase_pid
Executable file
12
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/erase_pid
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Uncomment the following line to get debug info
|
||||||
|
#set -x
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ ${#} -ne 0 ]; then
|
||||||
|
echo "Usage: $(basename ${0})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
rm -f /var/run/funkey.pid
|
||||||
|
exit 0
|
||||||
@ -201,44 +201,39 @@ copy_files_to_usb_partition () {
|
|||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
mount /mnt/ || die_notif 16 "Cannot mount /mnt"
|
mount /mnt/ || die_notif 16 "Cannot mount /mnt"
|
||||||
fi
|
fi
|
||||||
|
unzip -q -o /usr/local/share/mnt_freware_games.zip -d /mnt/
|
||||||
# Copy freware games and other necessary mnt files
|
mkdir -p /mnt/Emulators
|
||||||
unzip -q -o /usr/local/share/mnt_files.zip -d /mnt/
|
|
||||||
|
|
||||||
# Copy OPKs
|
|
||||||
set +f
|
set +f
|
||||||
cp -r /usr/local/share/OPKs/* /mnt
|
cp -f /usr/games/opk/*.opk /mnt/Emulators/
|
||||||
set -f
|
set -f
|
||||||
|
|
||||||
# Unmount USB partition
|
|
||||||
umount /mnt/ || die_notif 17 "Cannot unmount /mnt"
|
umount /mnt/ || die_notif 17 "Cannot unmount /mnt"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
check_root_id
|
check_root_id
|
||||||
notif set 0 " FIRST BOOT DETECTED"
|
notif " FIRST BOOT DETECTED"
|
||||||
|
|
||||||
notif set 0 " 1/6 RESIZE ROOT PARTITION"
|
notif " 1/6 RESIZE ROOT PARTITION"
|
||||||
resize_rootfs_partition
|
resize_rootfs_partition
|
||||||
|
|
||||||
notif set 0 " 2/6 RESIZE ROOT FILESYSTEM"
|
notif " 2/6 RESIZE ROOT FILESYSTEM"
|
||||||
resize_rootfs_filesystem
|
resize_rootfs_filesystem
|
||||||
|
|
||||||
notif set 0 " 3/6 CREATE SWAP"
|
notif " 3/6 CREATE SWAP"
|
||||||
create_swap
|
create_swap
|
||||||
|
|
||||||
notif set 0 " 4/6 CREATE USB PARTITION"
|
notif " 4/6 CREATE USB PARTITION"
|
||||||
create_usb_partition
|
create_usb_partition
|
||||||
|
|
||||||
notif set 0 " 5/6 FORMAT USB PARTITION"
|
notif " 5/6 FORMAT USB PARTITION"
|
||||||
format_usb_partition
|
format_usb_partition
|
||||||
|
|
||||||
notif set 0 " 6/6 COPY FILES TO ^ USB PARTITION"
|
notif " 6/6 COPY FILES TO ^ USB PARTITION"
|
||||||
copy_files_to_usb_partition
|
copy_files_to_usb_partition
|
||||||
|
|
||||||
notif set 0 " FIRST BOOT SETUP FINISHED!"
|
notif " FIRST BOOT SETUP FINISHED!"
|
||||||
|
|
||||||
fw_setenv first_boot_ok 1
|
fw_setenv first_boot_ok 1
|
||||||
|
|
||||||
sleep 1
|
sleep 1
|
||||||
notif clear
|
clear_notif
|
||||||
|
|||||||
@ -1,161 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Uncomment the following line to get debug info
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
SELF="$(basename ${0})"
|
|
||||||
LAUNCHER_FILE="$HOME/Launchers/launcher.txt"
|
|
||||||
FRONTEND_FILE="$HOME/.frontend"
|
|
||||||
PREVENT_LAUNCHER_FILE="/mnt/prevent_launcher"
|
|
||||||
DISABLE_FRONTEND_FILE="/mnt/disable_frontend"
|
|
||||||
DEFAULT_FRONTEND=retrofe
|
|
||||||
LOCK_FILE="/var/lock/frontend.lock"
|
|
||||||
REBOOTING_FILE="/run/rebooting"
|
|
||||||
LAST_OPK_FILE="/mnt/last_opk"
|
|
||||||
|
|
||||||
# Convert old launcher file to new frontend
|
|
||||||
if [ -f "${LAUNCHER_FILE}" ]; then
|
|
||||||
mv "${LAUNCHER_FILE}" "${FRONTEND_FILE}"
|
|
||||||
rm -rf $(dirname "${LAUNCHER_FILE}") 2>/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Convert old prevent launcher file to new frontend disable file
|
|
||||||
if [ -f "${PREVENT_LAUNCHER_FILE}" ]; then
|
|
||||||
mv "${PREVENT_LAUNCHER_FILE}" "${DISABLE_FRONTEND_FILE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
>&2 echo "Usage: ${SELF} init"
|
|
||||||
>&2 echo " ${SELF} get"
|
|
||||||
>&2 echo " ${SELF} set gmenu2x|retrofe|none"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
set_frontend() {
|
|
||||||
mkdir -p "$(dirname "$FRONTEND_FILE")"
|
|
||||||
local frontend=$(get_frontend)
|
|
||||||
local new_frontend="${1}"
|
|
||||||
echo "Setting frontend: ${new_frontend}"
|
|
||||||
if [ "${new_frontend}" = "none" ]; then
|
|
||||||
touch "${DISABLE_FRONTEND_FILE}"
|
|
||||||
else
|
|
||||||
rm -f "${DISABLE_FRONTEND_FILE}"
|
|
||||||
fi
|
|
||||||
if [ "${frontend}" != "none" ]; then
|
|
||||||
pkill "${frontend}"
|
|
||||||
fi
|
|
||||||
echo "${new_frontend}" > "${FRONTEND_FILE}"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_frontend() {
|
|
||||||
local frontend=$(cat "${FRONTEND_FILE}" 2>/dev/null | head -1)
|
|
||||||
|
|
||||||
# Check if not empty
|
|
||||||
if [ "x${frontend}" = "x" ]; then
|
|
||||||
frontend="${DEFAULT_FRONTEND}"
|
|
||||||
echo "${frontend}" > "${FRONTEND_FILE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Return frontend name
|
|
||||||
echo "${frontend}"
|
|
||||||
}
|
|
||||||
|
|
||||||
init_frontend() {
|
|
||||||
if [ -f "${LOCK_FILE}" ]; then
|
|
||||||
>&2 echo "${LOCK_FILE} already exists"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
touch "${LOCK_FILE}"
|
|
||||||
|
|
||||||
# Then loop to launch the frontend indefinitely
|
|
||||||
while true; do
|
|
||||||
|
|
||||||
# Check if frontend disable file is present
|
|
||||||
if [ -f "${DISABLE_FRONTEND_FILE}" -o -f "${REBOOTING_FILE}" ]; then
|
|
||||||
echo "${DISABLE_FRONTEND_FILE} file found, not starting frontend"
|
|
||||||
sleep 5
|
|
||||||
else
|
|
||||||
|
|
||||||
# Umount any remaining OPK, if any
|
|
||||||
umount /opk >/dev/null 2>&1
|
|
||||||
if [ -r "${LAST_OPK_FILE}" -a ! -f "${REBOOTING_FILE}" ]; then
|
|
||||||
rm "${LAST_OPK_FILE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Launch selected frontend
|
|
||||||
local frontend="$(get_frontend)"
|
|
||||||
case "${frontend}" in
|
|
||||||
gmenu2x|retrofe)
|
|
||||||
"${frontend}"&
|
|
||||||
;;
|
|
||||||
|
|
||||||
none)
|
|
||||||
echo "no frontend"
|
|
||||||
sleep 5
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
DEFAULT_FRONTEND=retrofe
|
|
||||||
echo "Unrecognized frontend: $frontend, setting $DEFAULT_FRONTEND"
|
|
||||||
set_frontend "${DEFAULT_FRONTEND}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Record the PID into a file, wait for the process to
|
|
||||||
# terminate and erase the recorded PID
|
|
||||||
pid record $!
|
|
||||||
wait $!
|
|
||||||
pid erase
|
|
||||||
|
|
||||||
# In case retrofe/opkrun quits with errors, clear graphic VT
|
|
||||||
termfix_all
|
|
||||||
|
|
||||||
# In case retrofe/opkrun quits with errors, reset default key mapping
|
|
||||||
keymap default
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Prevent 100% CPU usage
|
|
||||||
sleep 0.5
|
|
||||||
|
|
||||||
# Exit if console rebooting
|
|
||||||
if [ -f "${REBOOTING_FILE}" ]; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Remove lock file and exit
|
|
||||||
rm "${LOCK_FILE}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check number of arguments
|
|
||||||
if [ ${#} -lt 1 -o ${#} -gt 2 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
set)
|
|
||||||
if [ ${#} -ne 2 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
set_frontend "${2}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
get)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
get_frontend
|
|
||||||
;;
|
|
||||||
|
|
||||||
init)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
init_frontend
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
||||||
25
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/get_launcher
Executable file
25
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/get_launcher
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ ${#} -ne 0 ]; then
|
||||||
|
echo "Usage: $(basename ${0})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Launcher File
|
||||||
|
LAUNCHER_FILE=$HOME/Launchers/launcher.txt
|
||||||
|
DEFAULT_LAUNCHER=retrofe
|
||||||
|
|
||||||
|
# Check that file exists
|
||||||
|
[ -f "$LAUNCHER_FILE" ] || set_launcher $DEFAULT_LAUNCHER >/dev/null 2>&1
|
||||||
|
|
||||||
|
# Check Launcher
|
||||||
|
launcher=$(cat "$LAUNCHER_FILE" | head -1)
|
||||||
|
|
||||||
|
# Check not empty
|
||||||
|
[ -z "$LAUNCHER_FILE" ] && launcher=$DEFAULT_LAUNCHER; set_launcher $launcher >/dev/null 2>&1
|
||||||
|
|
||||||
|
# Return launcher name
|
||||||
|
echo $launcher
|
||||||
|
|
||||||
|
exit 0
|
||||||
@ -3,103 +3,35 @@
|
|||||||
# Uncomment the following line to get debug info
|
# Uncomment the following line to get debug info
|
||||||
#set -x
|
#set -x
|
||||||
|
|
||||||
SELF="$(basename ${0})"
|
# Check args
|
||||||
INSTANT_PLAY_FILE="/mnt/instant_play"
|
if [ ${#} -eq 0 ]; then
|
||||||
RESUME_PLAY_FILE="/mnt/resume_play"
|
echo "Usage: $(basename ${0}) args..."
|
||||||
LAST_OPK_FILE="/mnt/last_opk"
|
|
||||||
PID_PATH="/var/run/pid_path"
|
|
||||||
REBOOTING_FILE="/run/rebooting"
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
>&2 echo "Usage: ${SELF} load"
|
|
||||||
>&2 echo " ${SELF} save application args..."
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
|
||||||
|
|
||||||
# Check number of arguments
|
|
||||||
if [ ${#} -lt 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case ${1} in
|
INSTANT_PLAY_FILE="/mnt/instant_play"
|
||||||
load)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Umount any remaining OPK, if any
|
|
||||||
umount /opk >/dev/null 2>&1
|
|
||||||
|
|
||||||
# Mount last OPK, if any
|
|
||||||
if [ -r "${LAST_OPK_FILE}" ]; then
|
|
||||||
last_opk=$(cat "${LAST_OPK_FILE}")
|
|
||||||
mount -t squashfs "${last_opk}" /opk
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove unnecessary files
|
|
||||||
rm -f "${RESUME_PLAY_FILE}"
|
|
||||||
|
|
||||||
# Launch Previous Game if any
|
|
||||||
if [ -f "${INSTANT_PLAY_FILE}" ]; then
|
|
||||||
keymap resume
|
|
||||||
echo -n "Found Instant Play file, restarting previous game with command: "
|
|
||||||
cat "${INSTANT_PLAY_FILE}"
|
|
||||||
mv "${INSTANT_PLAY_FILE}" "${RESUME_PLAY_FILE}"
|
|
||||||
source "${RESUME_PLAY_FILE}"
|
|
||||||
rm -f "${RESUME_PLAY_FILE}"
|
|
||||||
keymap default
|
|
||||||
termfix_all
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Unmount last OPK, if any
|
|
||||||
if [ -r "${LAST_OPK_FILE}" -a ! -f "${REBOOTING_FILE}" ]; then
|
|
||||||
umount /opk
|
|
||||||
rm "${LAST_OPK_FILE}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
save)
|
|
||||||
if [ ${#} -lt 2 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
|
|
||||||
# Get curent binary real path
|
|
||||||
bin=$(printf %s "$1" | sed "s/'/'\\\\''/g")
|
|
||||||
bin_name=$(basename "$bin")
|
|
||||||
bin_path="$(cat $PID_PATH)"/"$bin_name"
|
|
||||||
|
|
||||||
# Write quick load file args
|
# Write quick load file args
|
||||||
echo -n "" > "${INSTANT_PLAY_FILE}"
|
echo -n "" > "${INSTANT_PLAY_FILE}"
|
||||||
printf "'" >> "${INSTANT_PLAY_FILE}"
|
for arg in "$@"; do
|
||||||
echo -n "$bin_path" >> "${INSTANT_PLAY_FILE}"
|
if $(echo "${arg}" | egrep -q '[[:space:]]'); then
|
||||||
printf "' " >> "${INSTANT_PLAY_FILE}"
|
|
||||||
shift
|
|
||||||
|
|
||||||
while [ "$#" != "0" ]
|
# Add quotes around arguments containing spaces
|
||||||
do
|
echo -n "\"${arg}\" " >> "${INSTANT_PLAY_FILE}"
|
||||||
printf "'" >> "${INSTANT_PLAY_FILE}"
|
else
|
||||||
printf %s "$1" | sed "s/'/'\\\\''/g" >> "${INSTANT_PLAY_FILE}"
|
echo -n "${arg} " >> "${INSTANT_PLAY_FILE}"
|
||||||
printf "' " >> "${INSTANT_PLAY_FILE}"
|
fi
|
||||||
shift
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Add the magic sauce to launch the process in background,
|
# Add the magic sauce to launch the process in background, record the
|
||||||
# record the PID into a file, wait for the process to
|
# PID into a file, wait for the process to terminate and erase the
|
||||||
# terminate and erase the recorded PID
|
# recorded PID
|
||||||
cat << EOF >> "${INSTANT_PLAY_FILE}"
|
cat << EOF >> "${INSTANT_PLAY_FILE}"
|
||||||
&
|
&
|
||||||
pid record \$!
|
record_pid \$!
|
||||||
wait \$!
|
wait \$!
|
||||||
pid erase
|
erase_pid
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Now terminate gracefully
|
# Now terminate gracefully
|
||||||
exec powerdown now
|
exec shutdown_funkey
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
||||||
|
|||||||
20
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/is_usb_data_connected
Executable file
20
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/is_usb_data_connected
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Uncomment the following line to get debug info
|
||||||
|
#set -x
|
||||||
|
|
||||||
|
# Get USB state
|
||||||
|
usb_present=$(cat /sys/class/power_supply/axp20x-usb/present)
|
||||||
|
|
||||||
|
# Get udc state
|
||||||
|
udc_state=$(cat /sys/class/udc/musb-hdrc.1.auto/state)
|
||||||
|
|
||||||
|
if [[ x"$udc_state" == "xconfigured" -a "$usb_present" == "1" ]]; then
|
||||||
|
|
||||||
|
# Connected succesfully to a host
|
||||||
|
echo "yes"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "no"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@ -1,116 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Uncomment the following line to get debug info
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
SELF=$(basename ${0})
|
|
||||||
LAST_MAPPING="/mnt/FunKey/.last_mapping.key"
|
|
||||||
FIFO="/tmp/fkgpiod.fifo"
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
echo "Usage: ${SELF} default"
|
|
||||||
echo " ${SELF} load <config_file>"
|
|
||||||
echo " ${SELF} resume"
|
|
||||||
echo " ${SELF} rom <rom_path>"
|
|
||||||
echo " ${SELF} save <config_file>"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
log() {
|
|
||||||
logger -t "${SELF}[$$]" "$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
write_fifo() {
|
|
||||||
echo "${1}" >"${FIFO}" 2>/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check number of args
|
|
||||||
if [ ${#} -lt 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create FIFO it it does not exist yet
|
|
||||||
if [ ! -p "${FIFO}" ]; then
|
|
||||||
rm -f "${FIFO}"
|
|
||||||
log "FIFO does not exist, create it"
|
|
||||||
mkfifo "${FIFO}"
|
|
||||||
chmod 0640 "${FIFO}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
default)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
log "default: LOAD /etc/fkgpiod.conf"
|
|
||||||
write_fifo "LOAD /etc/fkgpiod.conf"
|
|
||||||
;;
|
|
||||||
|
|
||||||
load)
|
|
||||||
if [ ${#} -ne 2 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
config_file="${2}"
|
|
||||||
log "load: LOAD ${config_file}"
|
|
||||||
write_fifo "LOAD ${config_file}"
|
|
||||||
log "load: SAVE ${LAST_MAPPING}"
|
|
||||||
write_fifo "SAVE ${LAST_MAPPING}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
resume)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
if [ -f "${LAST_MAPPING}" ]; then
|
|
||||||
log "resume: LOAD ${LAST_MAPPING}"
|
|
||||||
write_fifo "LOAD ${LAST_MAPPING}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
rom)
|
|
||||||
if [ ${#} -gt 2 ]; then
|
|
||||||
usage
|
|
||||||
elif [ ${#} -eq 1 ]; then
|
|
||||||
console_keymap=""
|
|
||||||
rom_keymap=""
|
|
||||||
else
|
|
||||||
rom_path="${2}"
|
|
||||||
console_keymap="$(dirname "${rom_path}")/default_config.key"
|
|
||||||
rom_keymap="${rom_path%.*}.key"
|
|
||||||
fi
|
|
||||||
if [ -f "${console_keymap}" ]; then
|
|
||||||
log "rom: LOAD ${console_keymap}"
|
|
||||||
write_fifo "LOAD ${console_keymap}"
|
|
||||||
fi
|
|
||||||
for desktop_file in $(ls /opk/*.desktop 2>/dev/null); do
|
|
||||||
opk_keymap=$(grep FK-Keymap= "${desktop_file}" | cut -d '=' -f 2)
|
|
||||||
if [ "${opk_keymap:0:1}" != "/" ]; then
|
|
||||||
opk_keymap="/opk/${opk_keymap}"
|
|
||||||
fi
|
|
||||||
if [ -f "${opk_keymap}" ]; then
|
|
||||||
log "rom: LOAD ${opk_keymap}"
|
|
||||||
write_fifo "LOAD ${opk_keymap}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ -f "${rom_keymap}" ]; then
|
|
||||||
log "rom: LOAD ${rom_keymap}"
|
|
||||||
write_fifo "LOAD ${rom_keymap}"
|
|
||||||
fi
|
|
||||||
log "rom: SAVE ${LAST_MAPPING}"
|
|
||||||
write_fifo "SAVE ${LAST_MAPPING}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
save)
|
|
||||||
if [ ${#} -ne 2 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
config_file="${2}"
|
|
||||||
log "save: SAVE ${config_file}"
|
|
||||||
write_fifo "SAVE ${config_file}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
||||||
@ -3,28 +3,32 @@
|
|||||||
# General constants declaration
|
# General constants declaration
|
||||||
THRESHOLD_PERCENT_LOW_BAT=5
|
THRESHOLD_PERCENT_LOW_BAT=5
|
||||||
THRESHOLD_PERCENT_EXTREMELY_LOW_BAT=2
|
THRESHOLD_PERCENT_EXTREMELY_LOW_BAT=2
|
||||||
MAX_LOW_BAT_COUNT=5
|
MAX_EXTREMELY_LOW_BAT_BEFORE_SHUTDOWN=5
|
||||||
SLEEP_SECS=2
|
SLEEP_SECS=2
|
||||||
RESCALE_MAX_PERCENTAGE=120
|
RESCALE_MAX_PERCENTAGE=120
|
||||||
|
|
||||||
# Blink Low bat constants declaration
|
# Blink Low bat constants declaration
|
||||||
BLINK_ICON=0
|
BLINK_ICON=0
|
||||||
LOW_BAT_DISPLAY_TIMEOUT=5
|
LOW_BAT_SECS_DISPLAYED=5
|
||||||
|
LOW_BAT_SECS_NOT_DISPLAYED=5
|
||||||
|
|
||||||
# Files and commands declaration
|
# Files and commands declaration
|
||||||
USB_PRESENT_FILE="/sys/class/power_supply/axp20x-usb/present"
|
USB_PRESENT_FILE=/sys/class/power_supply/axp20x-usb/present
|
||||||
|
|
||||||
# Cheat for no USB present simulation when debugging
|
# Cheat for no USB present simulation when debugging
|
||||||
BAT_PRESENT_FILE="/sys/class/power_supply/axp20x-battery/present"
|
#USB_PRESENT_FILE=/sys/class/power_supply/axp20x-ac/present
|
||||||
BAT_PERCENT_FILE="/sys/class/power_supply/axp20x-battery/capacity"
|
BAT_PRESENT_FILE=/sys/class/power_supply/axp20x-battery/present
|
||||||
BAT_PERCENT_RESCALED_FILE="/tmp/current_battery_percentage"
|
BAT_PERCENT_FILE=/sys/class/power_supply/axp20x-battery/capacity
|
||||||
LOW_BAT_ICON="/sys/class/graphics/fb0/low_battery"
|
BAT_PERCENT_RESCALED_FILE=/tmp/current_battery_percentage
|
||||||
|
LOW_BAT_ICON=/sys/class/graphics/fb0/low_battery
|
||||||
|
SCHEDULE_SHUTDOWN_CMD=sched_shutdown
|
||||||
|
SIGNAL_URS1_TO_EMULATORS_CMD=signal_usr1_to_emulators
|
||||||
|
|
||||||
# Variables declaration
|
# Variables declaration
|
||||||
low_bat_status=0
|
low_bat_status=0
|
||||||
low_bat_displayed=0
|
low_bat_displayed=0
|
||||||
cur_secs_disp=0
|
cur_secs_disp=0
|
||||||
low_bat_count=0
|
cur_nb_extremely_low_bat_before_shutdown=0
|
||||||
|
|
||||||
# Default: Hide Low Bat Icon
|
# Default: Hide Low Bat Icon
|
||||||
echo 0 > ${LOW_BAT_ICON}
|
echo 0 > ${LOW_BAT_ICON}
|
||||||
@ -69,7 +73,7 @@ while true; do
|
|||||||
|
|
||||||
# Reset status
|
# Reset status
|
||||||
low_bat_status=0
|
low_bat_status=0
|
||||||
low_bat_count=0
|
cur_nb_extremely_low_bat_before_shutdown=0
|
||||||
echo 0 > ${LOW_BAT_ICON}
|
echo 0 > ${LOW_BAT_ICON}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -78,7 +82,7 @@ while true; do
|
|||||||
|
|
||||||
# Reset status
|
# Reset status
|
||||||
low_bat_status=0
|
low_bat_status=0
|
||||||
low_bat_count=0
|
cur_nb_extremely_low_bat_before_shutdown=0
|
||||||
echo 0 > ${LOW_BAT_ICON}
|
echo 0 > ${LOW_BAT_ICON}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -88,24 +92,24 @@ while true; do
|
|||||||
|
|
||||||
# Check extremely low bat for clean shutdown
|
# Check extremely low bat for clean shutdown
|
||||||
if [ ${cur_bat_percent} -le ${THRESHOLD_PERCENT_EXTREMELY_LOW_BAT} ]; then
|
if [ ${cur_bat_percent} -le ${THRESHOLD_PERCENT_EXTREMELY_LOW_BAT} ]; then
|
||||||
let low_bat_count++
|
let cur_nb_extremely_low_bat_before_shutdown++
|
||||||
echo "low_bat_count = ${low_bat_count}"
|
echo "cur_nb_extremely_low_bat_before_shutdown = ${cur_nb_extremely_low_bat_before_shutdown}"
|
||||||
|
|
||||||
# Clean shutdown
|
# Clean shutdown
|
||||||
if [ ${low_bat_count} -ge ${MAX_LOW_BAT_COUNT} ]; then
|
if [ ${cur_nb_extremely_low_bat_before_shutdown} -ge ${MAX_EXTREMELY_LOW_BAT_BEFORE_SHUTDOWN} ]; then
|
||||||
echo "Battery extremely low, shutting down now..."
|
echo "Battery extremely low, shutting down now..."
|
||||||
powerdown schedule 1
|
sched_shutdown 1 & signal_usr1_to_emulators
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Blinking process
|
# Blinking process
|
||||||
if [ ${BLINK_ICON} -eq 1 ]; then
|
if [ ${BLINK_ICON} -eq 1 ]; then
|
||||||
if [ ${low_bat_displayed} -eq 1 -a ${cur_secs_disp} -ge ${LOW_BAT_DISPLAY_TIMEOUT} ]; then
|
if [ ${low_bat_displayed} -eq 1 -a ${cur_secs_disp} -ge ${LOW_BAT_SECS_DISPLAYED} ]; then
|
||||||
low_bat_displayed=0
|
low_bat_displayed=0
|
||||||
cur_secs_disp=0
|
cur_secs_disp=0
|
||||||
echo 0 > ${LOW_BAT_ICON}
|
echo 0 > ${LOW_BAT_ICON}
|
||||||
elif [ ${low_bat_displayed} -eq 0 -a ${cur_secs_disp} -ge ${LOW_BAT_DISPLAY_TIMEOUT} ]; then
|
elif [ ${low_bat_displayed} -eq 0 -a ${cur_secs_disp} -ge ${LOW_BAT_SECS_NOT_DISPLAYED} ]; then
|
||||||
low_bat_displayed=1
|
low_bat_displayed=1
|
||||||
cur_secs_disp=0
|
cur_secs_disp=0
|
||||||
echo 1 > ${LOW_BAT_ICON}
|
echo 1 > ${LOW_BAT_ICON}
|
||||||
|
|||||||
@ -1,78 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Uncomment the following line to get debug info
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
SELF="$(basename ${0})"
|
|
||||||
NOTIFICATION_DISPLAY=/sys/class/graphics/fb0/notification
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
>&2 echo "Usage: ${SELF} set duration message"
|
|
||||||
>&2 echo " ${SELF} display duration message"
|
|
||||||
>&2 echo " ${SELF} clear"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
notif_clear() {
|
|
||||||
|
|
||||||
printf "clear" > "${NOTIFICATION_DISPLAY}"
|
|
||||||
}
|
|
||||||
|
|
||||||
notif_display() {
|
|
||||||
local duration="${1}"
|
|
||||||
local message="${*:2}"
|
|
||||||
if ! [ ! "${duration}" -ne "${duration}" ] 2> /dev/null; then
|
|
||||||
>&2 echo "error: ${duration} is not a number"
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
printf "${message}" > "${NOTIFICATION_DISPLAY}"
|
|
||||||
if [ ${duration} -ne 0 ]; then
|
|
||||||
sleep ${duration}
|
|
||||||
notif_clear
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
notif_set() {
|
|
||||||
local duration="${1}"
|
|
||||||
local message="${*:2}"
|
|
||||||
if ! [ ! "${duration}" -ne "${duration}" ]; then
|
|
||||||
>&2 echo "error: ${duration} is not a number"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Kill previous notif disp process
|
|
||||||
pkill -f "notif display" 2> /dev/null
|
|
||||||
|
|
||||||
# Print new notif
|
|
||||||
notif display "${duration}" "${message}" &
|
|
||||||
}
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
set)
|
|
||||||
if [ ${#} -ne 3 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
notif_set "${1}" "${2}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
clear)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
notif_clear
|
|
||||||
;;
|
|
||||||
|
|
||||||
display)
|
|
||||||
if [ ${#} -ne 3 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
notif_display "${1}" "${2}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
||||||
8
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/notif_clear
Executable file
8
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/notif_clear
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Clear all current notifications
|
||||||
|
|
||||||
|
NOTIFICATION_DISPLAY=/sys/class/graphics/fb0/notification
|
||||||
|
|
||||||
|
printf "clear" > ${NOTIFICATION_DISPLAY}
|
||||||
|
|
||||||
|
exit 0
|
||||||
38
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/notif_disp
Executable file
38
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/notif_disp
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Display notification for a certain amount of time
|
||||||
|
# Special char: ^ to add a new line
|
||||||
|
# Set seconds to 0 to display indefinitely (until the next notif)
|
||||||
|
|
||||||
|
NOTIFICATION_DISPLAY=/sys/class/graphics/fb0/notification
|
||||||
|
|
||||||
|
display_usage() {
|
||||||
|
echo -e "Usage:\n$(basename ${0}) nb_seconds_display message_to_display\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
# If less than two arguments supplied, display usage
|
||||||
|
if [ ${#} -le 1 ]; then
|
||||||
|
echo "Display notification for a certain amount of time"
|
||||||
|
display_usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get number of seconds to display notif
|
||||||
|
nb_secs=${1}
|
||||||
|
if ! [ ! "${nb_secs}" -ne "${nb_secs}" ] 2> /dev/null; then
|
||||||
|
echo "error: ${nb_secs} is not a number" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Print notif
|
||||||
|
printf "${*:2}" > ${NOTIFICATION_DISPLAY}
|
||||||
|
|
||||||
|
# Clear notif if NB_SECS is not 0, otherwise never clear
|
||||||
|
if [ ${nb_secs} -ne 0 ]; then
|
||||||
|
|
||||||
|
# Wait time before clearing notif
|
||||||
|
sleep ${nb_secs}
|
||||||
|
|
||||||
|
# Clear notif
|
||||||
|
printf "clear" > ${NOTIFICATION_DISPLAY}
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
36
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/notif_set
Executable file
36
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/notif_set
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Erase previous notif and display new one in background process for a certain amount of seconds
|
||||||
|
# Special char: ^ to add a new line
|
||||||
|
# Set seconds to 0 to display indefinitely (until the next notif_set)
|
||||||
|
|
||||||
|
NOTIFICATION_DISPLAY=/sys/class/graphics/fb0/notification
|
||||||
|
|
||||||
|
display_usage() {
|
||||||
|
echo -e "Usage:\n$(basename ${0}) nb_seconds_display message_to_display\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
# If less than two arguments supplied, display usage
|
||||||
|
if [ ${#} -le 1 ]; then
|
||||||
|
echo "Erase previous notif and display new one in background process for a certain amount of time"
|
||||||
|
echo "Special char: ^ to add a new line"
|
||||||
|
echo "Set seconds to 0 to display indefinitely (until the next $(basename ${0}))"
|
||||||
|
display_usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get number of seconds to display notif
|
||||||
|
nb_secs=${1}
|
||||||
|
if ! [ ! "${nb_secs}" -ne "${nb_secs}" ]; then
|
||||||
|
echo "error: ${nb_secs} is not a number" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Kill previous notif_disp process
|
||||||
|
pkill notif_disp 2> /dev/null
|
||||||
|
|
||||||
|
## Clear previous notif
|
||||||
|
#printf "clear" > ${NOTIFICATION_DISPLAY}
|
||||||
|
|
||||||
|
# Print new notif
|
||||||
|
notif_disp "$@" &
|
||||||
|
exit 0
|
||||||
@ -1,59 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Uncomment the following line to get debug info
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
SELF="$(basename ${0})"
|
|
||||||
PID_FILE="/var/run/funkey.pid"
|
|
||||||
PID_PATH="/var/run/pid_path"
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
>&2 echo "Usage: ${SELF} record pid"
|
|
||||||
>&2 echo " ${SELF} erase"
|
|
||||||
>&2 echo " ${SELF} print"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
record_pid() {
|
|
||||||
local pid="${1}"
|
|
||||||
if ! [ ! "${pid}" -ne "${pid}" ]; then
|
|
||||||
>&2 echo "error: ${pid} is not a number"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Save PID
|
|
||||||
echo "${1}" > "${PID_FILE}"
|
|
||||||
|
|
||||||
# Save current pid path
|
|
||||||
pid_path=$(dirname $(readlink /proc/${pid}/exe))
|
|
||||||
echo -n "$pid_path" > "$PID_PATH"
|
|
||||||
}
|
|
||||||
|
|
||||||
erase_pid() {
|
|
||||||
rm -f "${PID_FILE}"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
record)
|
|
||||||
if [ ${#} -ne 2 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
record_pid "${2}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
erase)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
erase_pid
|
|
||||||
;;
|
|
||||||
|
|
||||||
print)
|
|
||||||
cat "${PID_FILE}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
||||||
@ -1,83 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Uncomment the following line to get debug info
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
SELF="$(basename ${0})"
|
|
||||||
REBOOTING_FILE="/run/rebooting"
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
>&2 echo "Usage: ${SELF} schedule delay"
|
|
||||||
>&2 echo " ${SELF} handle"
|
|
||||||
>&2 echo " ${SELF} now"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
schedule_powerdown() {
|
|
||||||
|
|
||||||
# Send USR1 signal to the running FunKey process to warn about
|
|
||||||
# impending shutdown
|
|
||||||
kill -USR1 "$(pid print)" > /dev/null 2>&1
|
|
||||||
|
|
||||||
# Delay for the given grace period seconds to catch signal USR2.
|
|
||||||
# If the signal is caught, then it means the running FunKey
|
|
||||||
# process canceled this shutdown and will handle it by itself.
|
|
||||||
sleep ${1}
|
|
||||||
|
|
||||||
# Delay expired, initiate final powerdown
|
|
||||||
powerdown_now
|
|
||||||
}
|
|
||||||
|
|
||||||
handle_powerdown() {
|
|
||||||
pkill -f "powerdown schedule"
|
|
||||||
}
|
|
||||||
|
|
||||||
powerdown_now() {
|
|
||||||
|
|
||||||
# Sync before all else
|
|
||||||
sync
|
|
||||||
|
|
||||||
# Notif fullscreen "Shutting down"
|
|
||||||
notif set 0 "^^^^^^^^ SHUTTING DOWN...^^^^^^^^"
|
|
||||||
|
|
||||||
# Notify system, reboot in progress
|
|
||||||
touch "${REBOOTING_FILE}"
|
|
||||||
|
|
||||||
# Shutdown amp
|
|
||||||
audio_amp off >/dev/null 2>&1
|
|
||||||
|
|
||||||
# Force Read Only
|
|
||||||
ro
|
|
||||||
|
|
||||||
# Poweroff
|
|
||||||
poweroff
|
|
||||||
}
|
|
||||||
|
|
||||||
action="${1:-now}"
|
|
||||||
case "${action}" in
|
|
||||||
schedule)
|
|
||||||
if [ ${#} != 2 -o "${2}" == "0" ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
schedule_powerdown ${2}
|
|
||||||
;;
|
|
||||||
|
|
||||||
handle)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
handle_powerdown
|
|
||||||
;;
|
|
||||||
|
|
||||||
now)
|
|
||||||
if [ ${#} -gt 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
powerdown_now
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
||||||
22
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/quick_action_bright_down
Executable file
22
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/quick_action_bright_down
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
STEP_BRIGHTNESS=10
|
||||||
|
NOTIF_DURATION=2
|
||||||
|
|
||||||
|
# Get current value
|
||||||
|
current_brightness=$(brightness_get)
|
||||||
|
|
||||||
|
# Compute new brightness value
|
||||||
|
new_brightness=0
|
||||||
|
if [ ${current_brightness} -gt ${STEP_BRIGHTNESS} ]; then
|
||||||
|
let new_brightness=${current_brightness}-${STEP_BRIGHTNESS}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Change brightness
|
||||||
|
if [ ${new_brightness} -ne ${current_brightness} ]; then
|
||||||
|
brightness_set ${new_brightness}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Notif
|
||||||
|
notif_set ${NOTIF_DURATION} " BRIGHTNESS: ${new_brightness}%%"
|
||||||
|
exit 0
|
||||||
22
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/quick_action_bright_up
Executable file
22
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/quick_action_bright_up
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
STEP_BRIGHTNESS=10
|
||||||
|
NOTIF_DURATION=2
|
||||||
|
|
||||||
|
# Get current value
|
||||||
|
current_brightness=$(brightness_get)
|
||||||
|
|
||||||
|
# Compute new brightness value
|
||||||
|
let new_brightness=${current_brightness}+${STEP_BRIGHTNESS}
|
||||||
|
if [ ${new_brightness} -gt 100 ]; then
|
||||||
|
new_brightness=100
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Change brightness
|
||||||
|
if [ ${new_brightness} -ne ${current_brightness} ]; then
|
||||||
|
brightness_set ${new_brightness}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Notif
|
||||||
|
notif_set ${NOTIF_DURATION} " BRIGHTNESS: ${new_brightness}%%"
|
||||||
|
exit 0
|
||||||
22
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/quick_action_volume_down
Executable file
22
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/quick_action_volume_down
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
STEP_VOLUME=10
|
||||||
|
NOTIF_DURATION=2
|
||||||
|
|
||||||
|
# Get current value
|
||||||
|
current_volume=$(volume_get)
|
||||||
|
|
||||||
|
# Compute new volume value
|
||||||
|
new_volume=0
|
||||||
|
if [ ${current_volume} -gt ${STEP_VOLUME} ]; then
|
||||||
|
let new_volume=${current_volume}-${STEP_VOLUME}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Change volume
|
||||||
|
if [ ${new_volume} -ne ${current_volume} ]; then
|
||||||
|
volume_set ${new_volume}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Notif
|
||||||
|
notif_set ${NOTIF_DURATION} " VOLUME: ${new_volume}%%"
|
||||||
|
exit 0
|
||||||
22
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/quick_action_volume_up
Executable file
22
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/quick_action_volume_up
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
STEP_VOLUME=10
|
||||||
|
NOTIF_DURATION=2
|
||||||
|
|
||||||
|
# Get current value
|
||||||
|
current_volume=$(volume_get)
|
||||||
|
|
||||||
|
# Compute new volume value
|
||||||
|
let new_volume=${current_volume}+${STEP_VOLUME}
|
||||||
|
if [ ${new_volume} -gt 100 ]; then
|
||||||
|
new_volume=100
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Change volume
|
||||||
|
if [ ${new_volume} -ne ${current_volume} ]; then
|
||||||
|
volume_set ${new_volume}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Notif
|
||||||
|
notif_set ${NOTIF_DURATION} " VOLUME: ${new_volume}%%"
|
||||||
|
exit 0
|
||||||
12
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/record_pid
Executable file
12
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/record_pid
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Uncomment the following line to get debug info
|
||||||
|
#set -x
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ ${#} -ne 1 ]; then
|
||||||
|
echo "Usage: $(basename ${0}) pid"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo ${1} > /var/run/funkey.pid
|
||||||
|
exit 0
|
||||||
22
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/sched_shutdown
Executable file
22
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/sched_shutdown
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Uncomment the following line to get debug info
|
||||||
|
#set -x
|
||||||
|
|
||||||
|
if [ ${#} != 1 -o "${1}" -eq 0 ]; then
|
||||||
|
echo "Usage: $(basename ${0}) grace_delay"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Send USR1 signal to the running FunKey process to warn about
|
||||||
|
# impending shutdown
|
||||||
|
pkill -USR1 -F /var/run/funkey.pid > /dev/null 2>&1
|
||||||
|
|
||||||
|
# Delay for the given grace period seconds to catch signal USR2.
|
||||||
|
# If the signal is caught, then it means the running FunKey process
|
||||||
|
# canceled this shutdown and will handle it by itself.
|
||||||
|
sleep ${1}
|
||||||
|
|
||||||
|
# Delay expired, initiate shutdown
|
||||||
|
shutdown_funkey
|
||||||
|
|
||||||
18
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/set_launcher
Executable file
18
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/set_launcher
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Check number of args
|
||||||
|
if [ ${#} -ne 1 ]; then
|
||||||
|
echo "Usage: $(basename ${0}) launcher"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Launcher File
|
||||||
|
LAUNCHER_FILE=$HOME/Launchers/launcher.txt
|
||||||
|
mkdir -p "$(dirname "$LAUNCHER_FILE")"
|
||||||
|
|
||||||
|
# Check Launcher
|
||||||
|
NEW_LAUNCHER=${1}
|
||||||
|
echo "Setting launcher: ${NEW_LAUNCHER}"
|
||||||
|
echo ${NEW_LAUNCHER} > "$LAUNCHER_FILE"
|
||||||
|
|
||||||
|
exit 0
|
||||||
@ -54,7 +54,7 @@ mount_share () {
|
|||||||
# Check if there is a firmware update file
|
# Check if there is a firmware update file
|
||||||
if [ -f /mnt/FunKey-*.fwu ]; then
|
if [ -f /mnt/FunKey-*.fwu ]; then
|
||||||
warn "found a firmware update file, going into recovery mode"
|
warn "found a firmware update file, going into recovery mode"
|
||||||
notif set 0 "^^^^^^^^ UPDATING...^^^^^^^^"
|
notif "^^^^^^^^ UPDATING...^^^^^^^^"
|
||||||
recovery_mode
|
recovery_mode
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -127,25 +127,6 @@ is_share_started () {
|
|||||||
return $res
|
return $res
|
||||||
}
|
}
|
||||||
|
|
||||||
is_usb_data_connected () {
|
|
||||||
|
|
||||||
# Get USB state
|
|
||||||
local usb_present=$(cat /sys/class/power_supply/axp20x-usb/present)
|
|
||||||
|
|
||||||
# Get udc state
|
|
||||||
local udc_state=$(cat /sys/class/udc/musb-hdrc.1.auto/state)
|
|
||||||
|
|
||||||
if [ "x${udc_state}" = "xconfigured" -a "${usb_present}" -eq 1 ]; then
|
|
||||||
|
|
||||||
# Connected succesfully to a host
|
|
||||||
echo "yes"
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
echo "no"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|
||||||
init)
|
init)
|
||||||
@ -164,9 +145,6 @@ case "$1" in
|
|||||||
is_share_started
|
is_share_started
|
||||||
;;
|
;;
|
||||||
|
|
||||||
is_usb_data_connected)
|
|
||||||
is_usb_data_connected
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
*)
|
||||||
die 15 "Usage $0 {init|start|stop|is_sharing}"
|
die 15 "Usage $0 {init|start|stop|is_sharing}"
|
||||||
|
|||||||
20
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/shutdown_funkey
Executable file
20
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/shutdown_funkey
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Sync before all else
|
||||||
|
sync
|
||||||
|
|
||||||
|
# Notif fullscreen "Shutting down"
|
||||||
|
notif_set 0 "^^^^^^^^ SHUTTING DOWN...^^^^^^^^"
|
||||||
|
|
||||||
|
# Notify system, reboot in progress
|
||||||
|
REBOOTING_FILE="/run/rebooting"
|
||||||
|
touch $REBOOTING_FILE
|
||||||
|
|
||||||
|
# Shutdown amp
|
||||||
|
start_audio_amp 0 >/dev/null 2>&1
|
||||||
|
|
||||||
|
# Force Read Only
|
||||||
|
ro
|
||||||
|
|
||||||
|
# Poweroff
|
||||||
|
poweroff
|
||||||
@ -24,7 +24,7 @@ mkdir -p "${SNAPSHOT_DIR}"
|
|||||||
last=$(cd ${SNAPSHOT_DIR}; ls IMG_*.${SNAPSHOT_EXT} 2> /dev/null | tail -1 | sed 's/^IMG_0*\([0-9]\+\)\.'${SNAPSHOT_EXT}'$/\1/')
|
last=$(cd ${SNAPSHOT_DIR}; ls IMG_*.${SNAPSHOT_EXT} 2> /dev/null | tail -1 | sed 's/^IMG_0*\([0-9]\+\)\.'${SNAPSHOT_EXT}'$/\1/')
|
||||||
let last=${last}+1
|
let last=${last}+1
|
||||||
snapshot_file=$(printf "IMG_%04d.${SNAPSHOT_EXT}" $last)
|
snapshot_file=$(printf "IMG_%04d.${SNAPSHOT_EXT}" $last)
|
||||||
notif set 2 " SCREENSHOT ${snapshot_file}"
|
notif_set 2 " SCREEENSHOT ${snapshot_file}"
|
||||||
fbgrab "${SNAPSHOT_DIR}/${snapshot_file}" >/dev/null 2>&1 &
|
fbgrab "${SNAPSHOT_DIR}/${snapshot_file}" >/dev/null 2>&1 &
|
||||||
|
|
||||||
# Remove lock file
|
# Remove lock file
|
||||||
37
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/start_audio_amp
Executable file
37
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/start_audio_amp
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Check number of args
|
||||||
|
if [ ${#} -ne 1 ]; then
|
||||||
|
echo "Usage: $(basename ${0}) [1 for on, 0 for off]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check enable arg
|
||||||
|
enable=${1}
|
||||||
|
if [ ${enable} -eq 1 ]; then
|
||||||
|
|
||||||
|
# Turn ON only if volume is not null
|
||||||
|
if [ "$(volume_get)" -ne "0" ]; then
|
||||||
|
echo "Turning audio amplifier ON"
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
elif [ ${enable} -eq 0 ]; then
|
||||||
|
echo "Turning audio amplifier OFF"
|
||||||
|
else
|
||||||
|
echo "Usage: $(basename ${0}) [1 for on, 0 for off]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# PA enable GPIO
|
||||||
|
GPIO_PF6=166
|
||||||
|
|
||||||
|
# Export GPIO
|
||||||
|
if [ ! -d /sys/class/gpio/gpio${GPIO_PF6} ]; then
|
||||||
|
echo ${GPIO_PF6} > /sys/class/gpio/export
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Enable/disable cmd
|
||||||
|
echo "out" > /sys/class/gpio/gpio${GPIO_PF6}/direction
|
||||||
|
echo ${enable} > /sys/class/gpio/gpio${GPIO_PF6}/value
|
||||||
|
exit 0
|
||||||
12
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/start_gpio_manager
Executable file
12
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/start_gpio_manager
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
LOCK_FILE=/var/lock/gpio_manager.lock
|
||||||
|
|
||||||
|
if [ -f ${LOCK_FILE} ]; then
|
||||||
|
echo "${LOCK_FILE} already exists"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
touch ${LOCK_FILE}
|
||||||
|
funkey_gpio_management
|
||||||
|
rm "${LOCK_FILE}"
|
||||||
|
exit 0
|
||||||
78
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/start_launcher
Executable file
78
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/start_launcher
Executable file
@ -0,0 +1,78 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Uncomment the following line to get debug info
|
||||||
|
#set -x
|
||||||
|
|
||||||
|
LOCK_FILE="/var/lock/launcher.lock"
|
||||||
|
INSTANT_PLAY_FILE="/mnt/instant_play"
|
||||||
|
RESUME_PLAY_FILE="/mnt/resume_play"
|
||||||
|
PREVENT_LAUNCHER_FILE="/mnt/prevent_launcher"
|
||||||
|
REBOOTING_FILE="/run/rebooting"
|
||||||
|
|
||||||
|
|
||||||
|
if [ -f "${LOCK_FILE}" ]; then
|
||||||
|
echo "${LOCK_FILE} already exists"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
touch "${LOCK_FILE}"
|
||||||
|
|
||||||
|
# Sanity cmd: in case these files do not exist
|
||||||
|
mkdir -p "${MEDNAFEN_HOME}"
|
||||||
|
cp "/usr/games/lynxboot.img" "/usr/games/mednafen-09x.cfg" "${MEDNAFEN_HOME}/"
|
||||||
|
|
||||||
|
# Launch Previous Game if any
|
||||||
|
if [ -f "${INSTANT_PLAY_FILE}" ]; then
|
||||||
|
echo "Found Instant Play file, restarting previous game with command: "$(head -n 1 "${INSTANT_PLAY_FILE}")
|
||||||
|
rm -f "${RESUME_PLAY_FILE}"
|
||||||
|
mv "${INSTANT_PLAY_FILE}" "${RESUME_PLAY_FILE}"
|
||||||
|
source "${RESUME_PLAY_FILE}"
|
||||||
|
rm -f "${RESUME_PLAY_FILE}"
|
||||||
|
termfix_all
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Then loop to launch the launcher indefinitely
|
||||||
|
while true; do
|
||||||
|
|
||||||
|
# Check if prevent launcher file present
|
||||||
|
if [ -f "${PREVENT_LAUNCHER_FILE}" ]; then
|
||||||
|
echo "${PREVENT_LAUNCHER_FILE} file found, not starting launcher"
|
||||||
|
sleep 5
|
||||||
|
else
|
||||||
|
LAUNCHER=$(get_launcher)
|
||||||
|
|
||||||
|
if [ ${LAUNCHER} == "gmenu2x" ]; then
|
||||||
|
|
||||||
|
# Launch gmenu2x
|
||||||
|
gmenu2x&
|
||||||
|
elif [ ${LAUNCHER} == "retrofe" ]; then
|
||||||
|
|
||||||
|
# Launch Retrofe
|
||||||
|
retrofe&
|
||||||
|
else
|
||||||
|
DEFAULT_LAUNCHER=retrofe
|
||||||
|
echo "Not recognized launcher: $LAUNCHER, setting $DEFAULT_LAUNCHER"
|
||||||
|
set_launcher $DEFAULT_LAUNCHER
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Record the PID into a file, wait for the
|
||||||
|
# process to terminate and erase the recorded PID
|
||||||
|
record_pid $!
|
||||||
|
wait $!
|
||||||
|
erase_pid
|
||||||
|
|
||||||
|
# In case retrofe quits with errors, clear graphic VT
|
||||||
|
termfix_all
|
||||||
|
fi
|
||||||
|
|
||||||
|
# WD to prevent 100% CPU
|
||||||
|
sleep 0.5
|
||||||
|
|
||||||
|
# Exit if console rebooting
|
||||||
|
if [ -f $REBOOTING_FILE ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Remove lock file and exit
|
||||||
|
rm "${LOCK_FILE}"
|
||||||
|
exit 0
|
||||||
@ -1,25 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Uncomment the following line to get debug info
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
SELF="$(basename ${0})"
|
|
||||||
UPDATE_PERIOD=2 #seconds
|
UPDATE_PERIOD=2 #seconds
|
||||||
|
|
||||||
usage() {
|
|
||||||
>2& echo "Usage: ${SELF} [toggle]"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check number of arguments
|
|
||||||
if [ ${#} -eq 1 -a "${1}" = "toggle" ]; then
|
|
||||||
notif set 0 " Getting system stats..."
|
|
||||||
killall -s USR1 "${SELF}"
|
|
||||||
exit 0
|
|
||||||
elif [ ${#} -ne 0 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
notif_dirty=0
|
notif_dirty=0
|
||||||
perform=0
|
perform=0
|
||||||
|
|
||||||
@ -28,7 +10,7 @@ function toggle_perform()
|
|||||||
{
|
{
|
||||||
let perform=1-${perform}
|
let perform=1-${perform}
|
||||||
if [ ${perform} -eq 0 ]; then
|
if [ ${perform} -eq 0 ]; then
|
||||||
notif clear
|
notif_clear
|
||||||
notif_dirty=1
|
notif_dirty=1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -45,13 +27,13 @@ while true; do
|
|||||||
|
|
||||||
# Notif
|
# Notif
|
||||||
if [ ${notif_dirty} -eq 1 ]; then
|
if [ ${notif_dirty} -eq 1 ]; then
|
||||||
notif clear
|
notif_clear
|
||||||
notif_dirty=0
|
notif_dirty=0
|
||||||
else
|
else
|
||||||
if [ "x${ip_addr}" != "x" ]; then
|
if [ "x${ip_addr}" != "x" ]; then
|
||||||
notif set 0 " CPU:${cpu}%% RAM:${ram_mem}%% SWAP:${ram_swap}%%^IP:${ip_addr}"
|
notif_set 0 " CPU:${cpu}%% RAM:${ram_mem}%% SWAP:${ram_swap}%%^IP:${ip_addr}"
|
||||||
else
|
else
|
||||||
notif set 0 " CPU:${cpu}%% RAM:${ram_mem}%% SWAP:${ram_swap}%%"
|
notif_set 0 " CPU:${cpu}%% RAM:${ram_mem}%% SWAP:${ram_swap}%%"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
@ -6,17 +6,13 @@ SELF=${SELF:-$(basename $0)}
|
|||||||
|
|
||||||
source /usr/local/lib/utils
|
source /usr/local/lib/utils
|
||||||
|
|
||||||
# The composite gadget directory
|
# The composite gadget directory
|
||||||
GADGET=/sys/kernel/config/usb_gadget/FunKey
|
GADGET=/sys/kernel/config/usb_gadget/FunKey
|
||||||
|
|
||||||
# Check if Ethernet over USB network is requested
|
# Check if Ethernet over USB network is requested
|
||||||
[ ! -f /mnt/usbnet ]
|
[ ! -f /mnt/usbnet ]
|
||||||
USBNET=${?}
|
USBNET=${?}
|
||||||
|
|
||||||
# Check if Android Debug Bridge is requested
|
|
||||||
[ ! -f /mnt/adb ]
|
|
||||||
ADB=${?}
|
|
||||||
|
|
||||||
# USB VID for Linux Foundation
|
# USB VID for Linux Foundation
|
||||||
ID_VENDOR="0x1d6b"
|
ID_VENDOR="0x1d6b"
|
||||||
|
|
||||||
@ -41,12 +37,6 @@ init_usb_gadget() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ADB has precedence over USB Mass Storage / Ethernet over USB
|
|
||||||
if [ ${ADB} -eq 1 ]; then
|
|
||||||
adb start
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get the legacy drivers out of the way
|
# Get the legacy drivers out of the way
|
||||||
modprobe -r g_ether
|
modprobe -r g_ether
|
||||||
modprobe -r g_mass_storage
|
modprobe -r g_mass_storage
|
||||||
@ -177,48 +167,3 @@ init_usb_gadget() {
|
|||||||
echo ${udc_driver} > ${GADGET}/UDC
|
echo ${udc_driver} > ${GADGET}/UDC
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Deinitialize the USB gadget
|
|
||||||
deinit_usb_gadget() {
|
|
||||||
|
|
||||||
# Unbind the device
|
|
||||||
echo > ${GADGET}/UDC
|
|
||||||
|
|
||||||
# Remove functions from configurations
|
|
||||||
rm ${GADGET}/configs/FunKey.1/mass_storage.mmcblk0p4
|
|
||||||
if [ ${USBNET} -eq 1 ]; then
|
|
||||||
rm ${GADGET}/configs/FunKey.1/rndis.usb0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove string directories in configurations
|
|
||||||
rmdir ${GADGET}/configs/FunKey.1/strings/0x409
|
|
||||||
|
|
||||||
# Remove configurations from OS descriptors
|
|
||||||
if [ ${USBNET} -eq 1 ]; then
|
|
||||||
rm ${GADGET}/os_desc/FunKey.1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove configurations
|
|
||||||
rmdir ${GADGET}/configs/FunKey.1
|
|
||||||
|
|
||||||
# Remove extended properties from OS descriptors
|
|
||||||
if [ ${USBNET} -eq 1 ]; then
|
|
||||||
rmdir ${GADGET}/functions/rndis.usb0/os_desc/interface.rndis/Icons
|
|
||||||
rmdir ${GADGET}/functions/rndis.usb0/os_desc/interface.rndis/Label
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove functions
|
|
||||||
rmdir ${GADGET}/functions/mass_storage.mmcblk0p4
|
|
||||||
if [ ${USBNET} -eq 1 ]; then
|
|
||||||
rmdir ${GADGET}/functions/rndis.usb0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove strings
|
|
||||||
rmdir ${GADGET}/strings/0x409
|
|
||||||
|
|
||||||
# Finallyy remove the gadget
|
|
||||||
rmdir ${GADGET}
|
|
||||||
|
|
||||||
# Unload the kernel modules
|
|
||||||
modprobe -r usb_f_mass_storage usb_f_rndis
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,136 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Uncomment the following line to get debug info
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
SELF="$(basename ${0})"
|
|
||||||
DEFAULT_VOLUME_VALUE=50
|
|
||||||
MINIMUM_VOLUME=16
|
|
||||||
VOLUME_STEP=10
|
|
||||||
NOTIF_DURATION=2
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
>&2 echo "Usage: ${SELF} get"
|
|
||||||
>&2 echo " ${SELF} set new_volume_percentage"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
increase_volume() {
|
|
||||||
|
|
||||||
# Get current value
|
|
||||||
local current_volume=$(get_volume)
|
|
||||||
|
|
||||||
# Compute new volume value
|
|
||||||
local new_volume=0
|
|
||||||
let new_volume=${current_volume}+${VOLUME_STEP}
|
|
||||||
if [ ${new_volume} -gt 100 ]; then
|
|
||||||
new_volume=100
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Change volume
|
|
||||||
if [ ${new_volume} -ne ${current_volume} ]; then
|
|
||||||
set_volume ${new_volume}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Notif
|
|
||||||
notif set ${NOTIF_DURATION} " VOLUME: ${new_volume}%%"
|
|
||||||
}
|
|
||||||
|
|
||||||
decrease_volume() {
|
|
||||||
|
|
||||||
# Get current value
|
|
||||||
local current_volume=$(get_volume)
|
|
||||||
|
|
||||||
# Compute new volume value
|
|
||||||
local new_volume=0
|
|
||||||
if [ ${current_volume} -gt ${VOLUME_STEP} ]; then
|
|
||||||
let new_volume=${current_volume}-${VOLUME_STEP}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Change volume
|
|
||||||
if [ ${new_volume} -ne ${current_volume} ]; then
|
|
||||||
set_volume ${new_volume}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Notif
|
|
||||||
notif set ${NOTIF_DURATION} " VOLUME: ${new_volume}%%"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_volume() {
|
|
||||||
local volume=$(fw_printenv -n volume 2>/dev/null)
|
|
||||||
if ! [ ! "${volume}" -ne "${volume}" ] 2> /dev/null; then
|
|
||||||
volume=${DEFAULT_VOLUME_VALUE}
|
|
||||||
fw_setenv volume ${volume}
|
|
||||||
fi
|
|
||||||
echo ${volume}
|
|
||||||
}
|
|
||||||
|
|
||||||
set_volume() {
|
|
||||||
|
|
||||||
local current_volume=$(get_volume)
|
|
||||||
|
|
||||||
# Set the new volume value (from 0 to 63) into ALSA
|
|
||||||
local new_volume=${1}
|
|
||||||
local alsa_volume=$(echo "a = $new_volume * (63 - $MINIMUM_VOLUME) / 100 + \
|
|
||||||
$MINIMUM_VOLUME + 0.5; scale = 0; a / 1" | bc -l)
|
|
||||||
amixer -q sset 'Headphone' ${alsa_volume} unmute
|
|
||||||
|
|
||||||
# Set the new volume value in a bootloader variable
|
|
||||||
if [ ${?} -eq 0 -a ${current_volume} -ne ${new_volume} ]; then
|
|
||||||
fw_setenv volume ${new_volume}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Turn on/off audio amplifier if necessary
|
|
||||||
if [ ${new_volume} -eq 0 ]; then
|
|
||||||
audio_amp off
|
|
||||||
else
|
|
||||||
audio_amp on
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check number of arguments
|
|
||||||
if [ ${#} -lt 1 -o ${#} -gt 2 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
up)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
increase_volume
|
|
||||||
;;
|
|
||||||
|
|
||||||
down)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
decrease_volume
|
|
||||||
;;
|
|
||||||
|
|
||||||
get)
|
|
||||||
if [ ${#} -ne 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
get_volume
|
|
||||||
;;
|
|
||||||
|
|
||||||
set)
|
|
||||||
if [ ${#} -ne 2 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make sure the argument is a positive number <= 100
|
|
||||||
if [ -n "${2}" ] && [ "${2}" -eq "${2}" ] 2>/dev/null && \
|
|
||||||
[ "${2}" -ge 0 ] && [ "${2}" -le 100 ]; then
|
|
||||||
set_volume "${2}"
|
|
||||||
else
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
usage
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
||||||
18
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_get
Executable file
18
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_get
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
VOLUME_DEFAULT_VALUE=50
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ ${#} -ne 0 ]; then
|
||||||
|
echo "Usage: $(basename ${0})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Sanity check: Check if integer
|
||||||
|
volume=$(fw_printenv -n volume 2>/dev/null)
|
||||||
|
if ! [ ! "${volume}" -ne "${volume}" ] 2> /dev/null; then
|
||||||
|
volume=${VOLUME_DEFAULT_VALUE}
|
||||||
|
fw_setenv volume ${volume}
|
||||||
|
fi
|
||||||
|
echo ${volume}
|
||||||
|
exit 0
|
||||||
4
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_get_alsa
Executable file
4
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_get_alsa
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
amixer sget 'Headphone' | tail -1 | cut -d' ' -f7 | sed 's/[^0-9]//g'
|
||||||
|
exit 0
|
||||||
39
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_set
Executable file
39
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_set
Executable file
@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ ${#} -ne 1 ]; then
|
||||||
|
echo "Usage: $(basename ${0}) new_volume_percentage"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check value's range
|
||||||
|
if [ ${1} -gt 100 ]; then
|
||||||
|
echo "Usage: Wrong volume percentage (${1}), must be between 0 and 100"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Scale new volume value between 0 and 63
|
||||||
|
volume_percent=${1}
|
||||||
|
vol_mini=16;
|
||||||
|
volume_scaled=$(echo "a = $volume_percent * (63 - $vol_mini) / 100 + $vol_mini + 0.5; scale = 0; a / 1" | bc -l)
|
||||||
|
#echo $volume_scaled
|
||||||
|
|
||||||
|
# Get current value
|
||||||
|
current_volume=$(volume_get)
|
||||||
|
|
||||||
|
# Set new volume
|
||||||
|
amixer -q sset 'Headphone' ${volume_scaled} unmute
|
||||||
|
|
||||||
|
# Change new volume value in volume file
|
||||||
|
if [ ${?} -eq 0 -a ${current_volume} -ne ${volume_percent} ]; then
|
||||||
|
fw_setenv volume ${volume_percent}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Turn on/off audio amplifier if necessary
|
||||||
|
if [ ${current_volume} -eq 0 -a ${volume_percent} -ne 0 ]; then
|
||||||
|
start_audio_amp 1
|
||||||
|
elif [ ${current_volume} -ne 0 -a ${volume_percent} -eq 0 ]; then
|
||||||
|
start_audio_amp 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
31
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_set_alsa
Executable file
31
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/volume_set_alsa
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Check args
|
||||||
|
if [ ${#} -ne 1 ]; then
|
||||||
|
echo "Usage: ${0} new_volume_percentage"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check value's range
|
||||||
|
if [ ${1} -gt 100 ]; then
|
||||||
|
echo "Usage: Wrong volume percentage (${1}), must be between 0 and 100"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Scale new volume value between 0 and 63
|
||||||
|
volume_percent=${1}
|
||||||
|
volume_scaled=$(echo "a = ${1} * 63 / 100 + 0.5; scale = 0; a / 1" | bc -l)
|
||||||
|
|
||||||
|
# Get current value
|
||||||
|
current_volume=$(volume_get)
|
||||||
|
|
||||||
|
# Turn on/off ampli if necessary
|
||||||
|
if [ ${current_volume} -eq 0 -a ${volume_scaled} -ne 0 ]; then
|
||||||
|
start_audio_amp 1
|
||||||
|
elif [ ${current_volume} -ne 0 -a ${volume_scaled} -eq 0 ]; then
|
||||||
|
start_audio_amp 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set new volume
|
||||||
|
amixer -q sset 'Headphone' ${volume_scaled} unmute
|
||||||
|
exit 0
|
||||||
18
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/write_args_quick_load_file
Executable file
18
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/write_args_quick_load_file
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Write quick load file args
|
||||||
|
QUICK_LOAD_FILE=/mnt/quick_load_cmd
|
||||||
|
|
||||||
|
echo -n "" > $QUICK_LOAD_FILE
|
||||||
|
for i in "$@"; do
|
||||||
|
if $(echo "$i" | egrep -q '[[:space:]]'); then
|
||||||
|
|
||||||
|
# Add quotes around arguments containing spaces
|
||||||
|
echo -n "\"$i\" " >> ${QUICK_LOAD_FILE}
|
||||||
|
else
|
||||||
|
echo -n "$i " >> ${QUICK_LOAD_FILE}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "" >> ${QUICK_LOAD_FILE}
|
||||||
|
|
||||||
|
exit 0
|
||||||
@ -1 +0,0 @@
|
|||||||
This is the folder where you can put all your standalone applications opks
|
|
||||||
@ -1 +0,0 @@
|
|||||||
This is the folder where you can put all your emulators opks
|
|
||||||
@ -1 +0,0 @@
|
|||||||
This is the folder where you can put all your standalone games opks
|
|
||||||
Binary file not shown.
@ -1,8 +1,8 @@
|
|||||||
software =
|
software =
|
||||||
{
|
{
|
||||||
version = "2.2.0";
|
version = "2.0.1";
|
||||||
|
|
||||||
hardware-compatibility = [ "#RE:^Rev\.[D-F]$" ];
|
hardware-compatibility = [ "#RE:^Rev\.[D-E]$" ];
|
||||||
|
|
||||||
images: (
|
images: (
|
||||||
{
|
{
|
||||||
@ -13,6 +13,12 @@ software =
|
|||||||
compressed = "zlib";
|
compressed = "zlib";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
files: (
|
||||||
|
{
|
||||||
|
filename = "funkey_gpio_management";
|
||||||
|
path = "/tmp/funkey_gpio_management";
|
||||||
|
}
|
||||||
|
);
|
||||||
scripts: (
|
scripts: (
|
||||||
{
|
{
|
||||||
filename = "update_partition";
|
filename = "update_partition";
|
||||||
|
|||||||
@ -7,74 +7,42 @@ root_part_num=2
|
|||||||
root_part=/dev/mmcblk0p${root_part_num}
|
root_part=/dev/mmcblk0p${root_part_num}
|
||||||
root_mount=/tmp/rootfs
|
root_mount=/tmp/rootfs
|
||||||
|
|
||||||
# Compatibility issue with older Recovery notifications
|
|
||||||
if [ -x /usr/local/sbin/notif ]; then
|
|
||||||
alias notif_set="notif set"
|
|
||||||
fi
|
|
||||||
|
|
||||||
do_preinst()
|
do_preinst()
|
||||||
{
|
{
|
||||||
notif_set 0 " 1/4 EXTRACT FIRMWARE UPDATE..^DO NOT TURN OFF THE CONSOLE"
|
notif " 1/5 EXTRACT FIRMWARE UPDATE..^DO NOT TURN OFF THE CONSOLE"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
do_postinst()
|
do_postinst()
|
||||||
{
|
{
|
||||||
|
notif " 2/5 FIX RECOVERY GPIO MANAGER"
|
||||||
#################
|
rw
|
||||||
# Resize Rootfs #
|
cp -a /tmp/funkey_gpio_management /usr/local/sbin/
|
||||||
#################
|
chmod +x /usr/local/sbin/funkey_gpio_management
|
||||||
notif_set 0 " 2/4 RESIZE ROOT FILESYSTEM^DO NOT TURN OFF THE CONSOLE"
|
ro
|
||||||
|
notif " 3/5 RESIZE ROOT FILESYSTEM^DO NOT TURN OFF THE CONSOLE"
|
||||||
resize2fs ${root_part}
|
resize2fs ${root_part}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
notif_set 0 " CANNOT RESIZE ROOT^FILESYSTEM"
|
notif " CANNOT RESIZE ROOT^FILESYSTEM"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
notif " 4/5 COPY OPKS TO USB MOUNT^DO NOT TURN OFF THE CONSOLE"
|
||||||
##############################
|
folder_opks_emulators=/mnt/Emulators
|
||||||
# SHARED PARTITION PROCESSES #
|
mkdir -p "$folder_opks_emulators"
|
||||||
##############################
|
|
||||||
notif_set 0 " 3/4 COPY FILES TO USB MOUNT^DO NOT TURN OFF THE CONSOLE"
|
|
||||||
|
|
||||||
# Mount Rootfs
|
|
||||||
mkdir -p ${root_mount}
|
mkdir -p ${root_mount}
|
||||||
mount -t ext4 ${root_part} ${root_mount}
|
mount -t ext4 ${root_part} ${root_mount}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
notif_set 0 "CANNOT MOUNT ROOT^FILESYSTEM"
|
notif "CANNOT MOUNT ROOT^FILESYSTEM"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
cp -f ${root_mount}/usr/games/opk/*.opk "$folder_opks_emulators"
|
||||||
# Copy OPKs
|
|
||||||
cp -r ${root_mount}/usr/local/share/OPKs/* /mnt
|
|
||||||
|
|
||||||
# Copy freware games and other necessary mnt files
|
|
||||||
unzip -q -o ${root_mount}/usr/local/share/mnt_files.zip -d /mnt/
|
|
||||||
|
|
||||||
# Fix PCE opk name if necessary
|
|
||||||
#mv /mnt/Emulators/pce_mednaefn_funkey-s.opk /mnt/Emulators/pce_mednafen_funkey-s.opk 1>/dev/null 2>&1
|
|
||||||
|
|
||||||
# Unmount Rootfs
|
|
||||||
umount ${root_mount}
|
umount ${root_mount}
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
notif_set 0 "CANNOT UNMOUNT ROOT^FILESYSTEM"
|
notif "CANNOT UNMOUNT ROOT^FILESYSTEM"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Change FunKey config files extension from .cfg to .fkcfg
|
|
||||||
#SAVEIFS=$IFS
|
|
||||||
#IFS=$(echo -en "\n\b")
|
|
||||||
#for FOLDER in "Atari lynx" "Game Boy" "Game Boy Advance" "Game Boy Color" "Game Gear" "Neo Geo Pocket" "NES" "PCE-TurboGrafx" "PS1" "Sega Genesis" "Sega Master System" "SNES" "WonderSwan"; do
|
|
||||||
# for FILE in $(ls /mnt/"${FOLDER}"/*.cfg 2>/dev/null); do
|
|
||||||
# mv "$FILE" "${FILE%.cfg}.fkcfg"
|
|
||||||
# done
|
|
||||||
#done
|
|
||||||
#IFS=$SAVEIFS
|
|
||||||
|
|
||||||
#####################
|
|
||||||
# Erase update file #
|
|
||||||
#####################
|
|
||||||
for file in $(ls /mnt/FunKey-*.fwu); do
|
for file in $(ls /mnt/FunKey-*.fwu); do
|
||||||
notif_set 0 " 4/4 ERASE UPDATE FILE^DO NOT TURN OFF THE CONSOLE"
|
notif " 5/5 ERASE UPDATE FILE^DO NOT TURN OFF THE CONSOLE"
|
||||||
rm -f "${file}"
|
rm -f "${file}"
|
||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@ -9,7 +9,7 @@ BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/patches"
|
|||||||
BR2_TOOLCHAIN_EXTERNAL=y
|
BR2_TOOLCHAIN_EXTERNAL=y
|
||||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
|
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
|
||||||
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
|
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
|
||||||
BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/FunKey-Project/FunKey-OS/releases/download/FunKey-OS-2.1.0/FunKey-sdk-2.1.0.tar.gz"
|
BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/FunKey-Project/FunKey-OS/releases/download/FunKey-OS-2.0.0/FunKey-sdk-2.0.0.tar.gz"
|
||||||
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_14=y
|
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_14=y
|
||||||
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
|
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
|
||||||
BR2_TOOLCHAIN_EXTERNAL_CXX=y
|
BR2_TOOLCHAIN_EXTERNAL_CXX=y
|
||||||
@ -26,7 +26,7 @@ BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/rootfs-overlay"
|
|||||||
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/post-build.sh"
|
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/post-build.sh"
|
||||||
BR2_LINUX_KERNEL=y
|
BR2_LINUX_KERNEL=y
|
||||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
||||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/FunKey-Project/linux/archive/refs/tags/linux-FunKey-1.0.2.tar.gz"
|
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/FunKey-Project/linux/archive/linux-FunKey-1.0.1.tar.gz"
|
||||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/linux.config"
|
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/linux.config"
|
||||||
BR2_LINUX_KERNEL_LZO=y
|
BR2_LINUX_KERNEL_LZO=y
|
||||||
@ -77,7 +77,6 @@ BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=y
|
|||||||
BR2_PACKAGE_LUA=y
|
BR2_PACKAGE_LUA=y
|
||||||
BR2_PACKAGE_LIBSAMPLERATE=y
|
BR2_PACKAGE_LIBSAMPLERATE=y
|
||||||
BR2_PACKAGE_LIBSNDFILE=y
|
BR2_PACKAGE_LIBSNDFILE=y
|
||||||
BR2_PACKAGE_LIBVORBIS=y
|
|
||||||
BR2_PACKAGE_OPENAL=y
|
BR2_PACKAGE_OPENAL=y
|
||||||
BR2_PACKAGE_TINYALSA=y
|
BR2_PACKAGE_TINYALSA=y
|
||||||
BR2_PACKAGE_TREMOR=y
|
BR2_PACKAGE_TREMOR=y
|
||||||
@ -85,7 +84,6 @@ BR2_PACKAGE_LIBARCHIVE=y
|
|||||||
BR2_PACKAGE_LIBARCHIVE_BSDTAR=y
|
BR2_PACKAGE_LIBARCHIVE_BSDTAR=y
|
||||||
BR2_PACKAGE_LIBARCHIVE_BSDCPIO=y
|
BR2_PACKAGE_LIBARCHIVE_BSDCPIO=y
|
||||||
BR2_PACKAGE_LIBARCHIVE_BSDCAT=y
|
BR2_PACKAGE_LIBARCHIVE_BSDCAT=y
|
||||||
BR2_PACKAGE_LZO=y
|
|
||||||
BR2_PACKAGE_LIBCONFIG=y
|
BR2_PACKAGE_LIBCONFIG=y
|
||||||
BR2_PACKAGE_LIBQRENCODE=y
|
BR2_PACKAGE_LIBQRENCODE=y
|
||||||
BR2_PACKAGE_LIBQRENCODE_TOOLS=y
|
BR2_PACKAGE_LIBQRENCODE_TOOLS=y
|
||||||
@ -97,7 +95,6 @@ BR2_PACKAGE_FMT=y
|
|||||||
BR2_PACKAGE_ICU=y
|
BR2_PACKAGE_ICU=y
|
||||||
BR2_PACKAGE_DHCPCD=y
|
BR2_PACKAGE_DHCPCD=y
|
||||||
BR2_PACKAGE_DROPBEAR=y
|
BR2_PACKAGE_DROPBEAR=y
|
||||||
BR2_PACKAGE_ANDROID_TOOLS=y
|
|
||||||
BR2_PACKAGE_PROCPS_NG=y
|
BR2_PACKAGE_PROCPS_NG=y
|
||||||
BR2_PACKAGE_SWUPDATE=y
|
BR2_PACKAGE_SWUPDATE=y
|
||||||
BR2_PACKAGE_SWUPDATE_CONFIG="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/swupdate.config"
|
BR2_PACKAGE_SWUPDATE_CONFIG="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/swupdate.config"
|
||||||
@ -106,7 +103,7 @@ BR2_PACKAGE_UTIL_LINUX_BINARIES=y
|
|||||||
BR2_PACKAGE_NANO=y
|
BR2_PACKAGE_NANO=y
|
||||||
BR2_TARGET_ROOTFS_EXT2=y
|
BR2_TARGET_ROOTFS_EXT2=y
|
||||||
BR2_TARGET_ROOTFS_EXT2_4=y
|
BR2_TARGET_ROOTFS_EXT2_4=y
|
||||||
BR2_TARGET_ROOTFS_EXT2_SIZE="220M"
|
BR2_TARGET_ROOTFS_EXT2_SIZE="160M"
|
||||||
# BR2_TARGET_ROOTFS_TAR is not set
|
# BR2_TARGET_ROOTFS_TAR is not set
|
||||||
BR2_PACKAGE_HOST_DOSFSTOOLS=y
|
BR2_PACKAGE_HOST_DOSFSTOOLS=y
|
||||||
BR2_PACKAGE_HOST_DTC=y
|
BR2_PACKAGE_HOST_DTC=y
|
||||||
@ -119,4 +116,3 @@ BR2_PACKAGE_GMENU2X=y
|
|||||||
BR2_PACKAGE_AGG=y
|
BR2_PACKAGE_AGG=y
|
||||||
BR2_PACKAGE_FLUIDLITE=y
|
BR2_PACKAGE_FLUIDLITE=y
|
||||||
BR2_PACKAGE_LIBMIKMOD=y
|
BR2_PACKAGE_LIBMIKMOD=y
|
||||||
BR2_PACKAGE_COMMANDER=y
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
FCEUX_VERSION = fceux-FunKey-1.2.2
|
FCEUX_VERSION = fceux-FunKey-1.1.0
|
||||||
FCEUX_SITE_METHOD = git
|
FCEUX_SITE_METHOD = git
|
||||||
FCEUX_SITE = https://github.com/FunKey-Project/fceux.git
|
FCEUX_SITE = https://github.com/FunKey-Project/fceux.git
|
||||||
FCEUX_LICENSE = GPL-2.0
|
FCEUX_LICENSE = GPL-2.0
|
||||||
@ -48,8 +48,8 @@ define FCEUX_INSTALL_TARGET_CMDS
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define FCEUX_CREATE_OPK
|
define FCEUX_CREATE_OPK
|
||||||
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/local/share/OPKs/Emulators
|
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/games/opk
|
||||||
$(HOST_DIR)/usr/bin/mksquashfs $(FCEUX_PKGDIR)/opk/nes $(TARGET_DIR)/usr/local/share/OPKs/Emulators/nes_fceux_funkey-s.opk -all-root -noappend -no-exports -no-xattrs
|
$(HOST_DIR)/usr/bin/mksquashfs $(FCEUX_PKGDIR)/opk/nes $(TARGET_DIR)/usr/games/opk/nes_fceux_funkey-s.opk -all-root -noappend -no-exports -no-xattrs
|
||||||
endef
|
endef
|
||||||
FCEUX_POST_INSTALL_TARGET_HOOKS += FCEUX_CREATE_OPK
|
FCEUX_POST_INSTALL_TARGET_HOOKS += FCEUX_CREATE_OPK
|
||||||
|
|
||||||
|
|||||||
@ -9,4 +9,4 @@ X-OD-NeedsDownscaling=true
|
|||||||
Categories=emulators;
|
Categories=emulators;
|
||||||
selectorbrowser=true
|
selectorbrowser=true
|
||||||
SelectorDir=/mnt/NES
|
SelectorDir=/mnt/NES
|
||||||
SelectorFilter=nes,NES,fds,FDS,zip,ZIP
|
SelectorFilter=nes,NES,fds,FDS
|
||||||
|
|||||||
5
FunKey/package/FunKey-GPIO-Mapping/Config.in
Normal file
5
FunKey/package/FunKey-GPIO-Mapping/Config.in
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
config BR2_PACKAGE_FUNKEY_GPIO_MAPPING
|
||||||
|
bool "FunKey GPIO Mapping"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
The FunKey GPIO mapping utility.
|
||||||
29
FunKey/package/FunKey-GPIO-Mapping/FunKey-GPIO-Mapping.mk
Normal file
29
FunKey/package/FunKey-GPIO-Mapping/FunKey-GPIO-Mapping.mk
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# FunKey-GPIO-mapping
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
FUNKEY_GPIO_MAPPING_VERSION = FunKey-GPIO-Mapping-FunKey-1.1.0
|
||||||
|
FUNKEY_GPIO_MAPPING_SITE_METHOD = git
|
||||||
|
FUNKEY_GPIO_MAPPING_SITE = https://github.com/FunKey-Project/FunKey-GPIO-Mapping.git
|
||||||
|
FUNKEY_GPIO_MAPPING_SITE_LICENSE = GPL-2.1+
|
||||||
|
FUNKEY_GPIO_MAPPING_SITE_LICENSE_FILES = COPYING
|
||||||
|
|
||||||
|
define FUNKEY_GPIO_MAPPING_BUILD_CMDS
|
||||||
|
$(TARGET_MAKE_ENV) CROSS_COMPILE=$(TARGET_CROSS) \
|
||||||
|
CC="$(TARGET_CC)" \
|
||||||
|
$(MAKE) -C $(@D) \
|
||||||
|
CFLAGS="$(TARGET_CFLAGS)" $(FUNKEY_GPIO_MAPPING_BUILD_TARGET)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define FUNKEY_GPIO_MAPPING_INSTALL_TARGET_CMDS
|
||||||
|
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/local/sbin
|
||||||
|
$(INSTALL) -m 0755 $(@D)/funkey_gpio_management $(TARGET_DIR)/usr/local/sbin/funkey_gpio_management
|
||||||
|
$(INSTALL) -m 0755 $(@D)/termfix $(TARGET_DIR)/usr/local/sbin/termfix
|
||||||
|
$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc
|
||||||
|
$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/init.d
|
||||||
|
$(INSTALL) -m 0755 $(FUNKEY_GPIO_MAPPING_PKGDIR)etc/init.d/S11funkey-gpio-management $(TARGET_DIR)/etc/init.d/S11funkey-gpio-management
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(generic-package))
|
||||||
36
FunKey/package/FunKey-GPIO-Mapping/etc/init.d/S11funkey-gpio-management
Executable file
36
FunKey/package/FunKey-GPIO-Mapping/etc/init.d/S11funkey-gpio-management
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Start/stop funkey_gpio_management
|
||||||
|
#
|
||||||
|
|
||||||
|
DAEMON=/usr/local/sbin/funkey_gpio_management
|
||||||
|
PIDFILE=/var/run/funkey_gpio_management.pid
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo -n "Starting funkey_gpio_management: "
|
||||||
|
start-stop-daemon -S -x ${DAEMON} -p ${PIDFILE} -m -b -- > /dev/null 2>&1
|
||||||
|
if [ ${?} -eq 0 ]; then
|
||||||
|
echo "OK"
|
||||||
|
else
|
||||||
|
echo "ERROR"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo -n "Stopping funkey_gpio_management: "
|
||||||
|
start-stop-daemon -K -x ${DAEMON} -p ${PIDFILE} -o > /dev/null 2>&1
|
||||||
|
if [ ${?} -eq 0 ]; then
|
||||||
|
echo "OK"
|
||||||
|
else
|
||||||
|
echo "ERROR"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
${0} stop
|
||||||
|
sleep 1 # Prevent race condition: ensure funkey_gpio_management stops before start.
|
||||||
|
${0} start
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: ${0} {start|stop|restart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
PCSX_REARMED_VERSION = pcsx_rearmed-FunKey-1.2.2
|
PCSX_REARMED_VERSION = pcsx_rearmed-FunKey-1.1.1
|
||||||
PCSX_REARMED_SITE_METHOD = git
|
PCSX_REARMED_SITE_METHOD = git
|
||||||
PCSX_REARMED_SITE = https://github.com/FunKey-Project/pcsx_rearmed.git
|
PCSX_REARMED_SITE = https://github.com/FunKey-Project/pcsx_rearmed.git
|
||||||
PCSX_REARMED_LICENSE = GPL-2.0
|
PCSX_REARMED_LICENSE = GPL-2.0
|
||||||
@ -48,8 +48,8 @@ define PCSX_REARMED_INSTALL_TARGET_CMDS
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define PCSX_REARMED_CREATE_OPK
|
define PCSX_REARMED_CREATE_OPK
|
||||||
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/local/share/OPKs/Emulators
|
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/games/opk
|
||||||
$(HOST_DIR)/usr/bin/mksquashfs $(PCSX_REARMED_PKGDIR)/opk/ps1 $(TARGET_DIR)/usr/local/share/OPKs/Emulators/ps1_pcsx_funkey-s.opk -all-root -noappend -no-exports -no-xattrs
|
$(HOST_DIR)/usr/bin/mksquashfs $(PCSX_REARMED_PKGDIR)/opk/ps1 $(TARGET_DIR)/usr/games/opk/ps1_pcsx_funkey-s.opk -all-root -noappend -no-exports -no-xattrs
|
||||||
endef
|
endef
|
||||||
PCSX_REARMED_POST_INSTALL_TARGET_HOOKS += PCSX_REARMED_CREATE_OPK
|
PCSX_REARMED_POST_INSTALL_TARGET_HOOKS += PCSX_REARMED_CREATE_OPK
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
POCKETSNES_VERSION = PocketSNES-FunKey-1.2.2
|
POCKETSNES_VERSION = PocketSNES-FunKey-1.1.0
|
||||||
POCKETSNES_SITE_METHOD = git
|
POCKETSNES_SITE_METHOD = git
|
||||||
POCKETSNES_SITE = https://github.com/FunKey-Project/PocketSNES.git
|
POCKETSNES_SITE = https://github.com/FunKey-Project/PocketSNES.git
|
||||||
POCKETSNES_LICENSE = GPL-2.0
|
POCKETSNES_LICENSE = GPL-2.0
|
||||||
@ -54,8 +54,8 @@ define POCKETSNES_INSTALL_TARGET_CMDS
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define POCKETSNES_CREATE_OPK
|
define POCKETSNES_CREATE_OPK
|
||||||
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/local/share/OPKs/Emulators
|
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/games/opk
|
||||||
$(HOST_DIR)/usr/bin/mksquashfs $(POCKETSNES_PKGDIR)/opk/snes $(TARGET_DIR)/usr/local/share/OPKs/Emulators/snes_pocketsnes_funkey-s.opk -all-root -noappend -no-exports -no-xattrs
|
$(HOST_DIR)/usr/bin/mksquashfs $(POCKETSNES_PKGDIR)/opk/snes $(TARGET_DIR)/usr/games/opk/snes_pocketsnes_funkey-s.opk -all-root -noappend -no-exports -no-xattrs
|
||||||
endef
|
endef
|
||||||
POCKETSNES_POST_INSTALL_TARGET_HOOKS += POCKETSNES_CREATE_OPK
|
POCKETSNES_POST_INSTALL_TARGET_HOOKS += POCKETSNES_CREATE_OPK
|
||||||
|
|
||||||
|
|||||||
@ -9,4 +9,4 @@ X-OD-NeedsDownscaling=true
|
|||||||
Categories=emulators;
|
Categories=emulators;
|
||||||
selectorbrowser=true
|
selectorbrowser=true
|
||||||
SelectorDir=/mnt/SNES
|
SelectorDir=/mnt/SNES
|
||||||
SelectorFilter=sfc,SFC,smc,SMC,zip,ZIP
|
SelectorFilter=sfc,SFC,smc,SMC
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
PRODSCREENS_VERSION = FunKey-ProdScreens-FunKey-1.1.2
|
PRODSCREENS_VERSION = FunKey-ProdScreens-FunKey-1.1.1
|
||||||
PRODSCREENS_SITE_METHOD = git
|
PRODSCREENS_SITE_METHOD = git
|
||||||
PRODSCREENS_SITE = https://github.com/FunKey-Project/FunKey-ProdScreens.git
|
PRODSCREENS_SITE = https://github.com/FunKey-Project/FunKey-ProdScreens.git
|
||||||
PRODSCREENS_SITE_LICENSE = GPL-2.1+
|
PRODSCREENS_SITE_LICENSE = GPL-2.1+
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
config BR2_PACKAGE_BIBI
|
|
||||||
bool "FunKey S - bibi"
|
|
||||||
default y
|
|
||||||
help
|
|
||||||
Bomberman game in c with SDL, readapted for the FunKey S.
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
################################################################################
|
|
||||||
#
|
|
||||||
# bibi
|
|
||||||
#
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
BIBI_VERSION = Bibi-FunKey-1.0.0
|
|
||||||
BIBI_SITE_METHOD = git
|
|
||||||
BIBI_SITE = https://github.com/FunKey-Project/Bibi.git
|
|
||||||
BIBI_SITE_LICENSE = GPL-2.1+
|
|
||||||
BIBI_SITE_LICENSE_FILES = COPYING
|
|
||||||
|
|
||||||
BIBI_DEPENDENCIES = sdl sdl_image sdl_ttf
|
|
||||||
|
|
||||||
BIBI_CFLAGS = $(TARGET_CFLAGS)
|
|
||||||
|
|
||||||
BIBI_SDL_CFLAGS += $(shell $(STAGING_DIR)/usr/bin/sdl-config --cflags)
|
|
||||||
BIBI_SDL_LIBS += $(shell $(STAGING_DIR)/usr/bin/sdl-config --libs)
|
|
||||||
BIBI_SDL_CFLAGS += $(shell $(STAGING_DIR)/usr/bin/libmikmod-config --cflags)
|
|
||||||
BIBI_SDL_LIBS += $(shell $(STAGING_DIR)/usr/bin/libmikmod-config --libs)
|
|
||||||
|
|
||||||
BIBI_CFLAGS += -ggdb -O3
|
|
||||||
BIBI_CFLAGS += $(BIBI_SDL_CFLAGS)
|
|
||||||
BIBI_CFLAGS += -DFUNKEY -DHW_SCREEN_RESIZE -DSOUND_SDL_ACTIVATED -DBYPASS_MENU -DFUNKEY_MENU
|
|
||||||
|
|
||||||
BIBI_LIBS += $(BIBI_SDL_LIBS)
|
|
||||||
BIBI_LIBS += -lSDL -lSDL_ttf -lSDL_image -lSDL_mixer
|
|
||||||
|
|
||||||
define BIBI_BUILD_CMDS
|
|
||||||
(cd $(@D); \
|
|
||||||
make \
|
|
||||||
CROSS_COMPILE=$(TARGET_CROSS) \
|
|
||||||
CFLAGS='$(BIBI_CFLAGS)' \
|
|
||||||
LDFLAGS='$(BIBI_LIBS)' \
|
|
||||||
SDL_INCLUDES='$(BIBI_SDL_CFLAGS)' \
|
|
||||||
SDL_LIBS='$(BIBI_SDL_LIBS)' \
|
|
||||||
)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define BIBI_INSTALL_TARGET_CMDS
|
|
||||||
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/games/bibi
|
|
||||||
$(INSTALL) -m 0755 $(@D)/bibi $(TARGET_DIR)/usr/games/bibi/bibi
|
|
||||||
$(INSTALL) -D -m 0755 -t $(TARGET_DIR)/usr/games/bibi/sprite $(@D)/sprite/*
|
|
||||||
$(INSTALL) -D -m 0755 -t $(TARGET_DIR)/usr/games/bibi/data $(@D)/data/*
|
|
||||||
$(INSTALL) -D -m 0755 -t $(TARGET_DIR)/usr/games/bibi/audio $(@D)/audio/*
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(generic-package))
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
config BR2_PACKAGE_COMMANDER
|
|
||||||
bool "commander"
|
|
||||||
select BR2_PACKAGE_LIBPNG
|
|
||||||
select BR2_PACKAGE_SDL
|
|
||||||
select BR2_PACKAGE_SDL_TTF
|
|
||||||
select BR2_PACKAGE_SDL_GFX
|
|
||||||
help
|
|
||||||
|
|
||||||
DinguxCommander is a file manager for RetroFW. It uses two
|
|
||||||
vertical panels side by side, one being the source and the
|
|
||||||
other the destination, like many 'commander-style' file
|
|
||||||
managers such as Norton Commander or Midnight
|
|
||||||
Commander.
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user