commit
d44bc5e699
73 changed files with 122 additions and 693 deletions
|
@ -1,5 +0,0 @@
|
|||
alias snd-card-0 snd-usb-audio
|
||||
alias snd-card-1 snd-hda-intel
|
||||
|
||||
options snd-usb-audio index=0
|
||||
options snd-hda-intel index=1,2
|
|
@ -1,16 +0,0 @@
|
|||
# INTEL HBR WORKAROUND FOR DTS-MA & Dolby TrueHD PLAYBACK
|
||||
|
||||
# Uncomment the following lines to disable any S/PDIF out to deliver
|
||||
# bitstreamed audio on Intel builds. This is a rough workaround for
|
||||
# users that have both S/PDIF and HDMI audio outputs on their motherboard
|
||||
# or motherboard+discrete graphics combo.
|
||||
|
||||
# EVEN IF YOU ARE NOT USING THE S/PDIF OUTPUT
|
||||
# but still have one, you will need to uncomment the lines below !
|
||||
|
||||
# after uncommenting these lines, you must reboot for these settings to take effect
|
||||
|
||||
# blacklist snd_hda_codec_realtek
|
||||
# blacklist snd_hda_codec_sigmatel
|
||||
# blacklist snd_hda_codec_cirrus
|
||||
|
|
@ -9,14 +9,14 @@ options saa7134-alsa index=-2
|
|||
options snd-atiixp-modem index=-2
|
||||
options snd-intel8x0m index=-2
|
||||
options snd-via82xx-modem index=-2
|
||||
options snd-usb-audio index=-2
|
||||
options snd-usb-usx2y index=-2
|
||||
options snd-usb-caiaq index=-2
|
||||
options snd-cmipci mpu_port=0x330 fm_port=0x388
|
||||
|
||||
# Some Toshiba laptops might require this
|
||||
# options snd-hda-intel model=toshiba
|
||||
options snd-hda-intel model=auto
|
||||
|
||||
options snd-hda-intel model=auto index=1,2
|
||||
|
||||
# RG552 shouldn't grab index 0
|
||||
options dw_hdmi_i2s_audio index=1
|
||||
|
|
|
@ -28,9 +28,3 @@ post_configure_target() {
|
|||
sed -i 's/.*PKGLIBDIR.*/#define PKGLIBDIR ""/' include/config.h
|
||||
}
|
||||
|
||||
post_makeinstall_target() {
|
||||
rm -rf ${INSTALL}/usr/bin
|
||||
|
||||
mkdir -p ${INSTALL}/usr/config
|
||||
cp -PR ${PKG_DIR}/config/modprobe.d ${INSTALL}/usr/config
|
||||
}
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
||||
|
||||
PKG_NAME="zlib"
|
||||
PKG_VERSION="1.2.11"
|
||||
PKG_SHA256="4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066"
|
||||
PKG_VERSION="1.2.12"
|
||||
PKG_LICENSE="OSS"
|
||||
PKG_SITE="http://www.zlib.net"
|
||||
PKG_URL="http://zlib.net/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
||||
|
|
|
@ -37,7 +37,7 @@ then
|
|||
PKG_DEPENDS_TARGET+=" vulkan-loader vulkan-headers"
|
||||
PKG_CMAKE_OPTS_TARGET+=" -DUSE_VULKAN_DISPLAY_KHR=ON \
|
||||
-DVULKAN=ON \
|
||||
-DUSING_X11_VULKAN=ON"
|
||||
-DUSING_X11_VULKAN=OFF"
|
||||
fi
|
||||
|
||||
PKG_CMAKE_OPTS_TARGET+="${PKG_CMAKE_OPTS_TARGET} \
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
PKG_NAME="mupen64plussa-audio-sdl"
|
||||
PKG_VERSION="df0770215f743f70244b09978c123a0a8b2a7d9d"
|
||||
PKG_SHA256="2d6da3935cfdca9ca19065ec1cd95a17ec8d53ba4995b043cd6a5ace3be49775"
|
||||
PKG_ARCH="any"
|
||||
PKG_ARCH="aarch64"
|
||||
PKG_LICENSE="GPLv2"
|
||||
PKG_SITE="https://github.com/mupen64plus/mupen64plus-audio-sdl"
|
||||
PKG_URL="https://github.com/mupen64plus/mupen64plus-audio-sdl/archive/${PKG_VERSION}.tar.gz"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
PKG_NAME="mupen64plussa-core"
|
||||
PKG_VERSION="f29984331b20de47fd1c2de776018fa40f50bac5"
|
||||
PKG_SHA256="2f53976ede7982e2e8d36a41721afca79109bda3f23c712953246b8d8d7313b6"
|
||||
PKG_ARCH="any"
|
||||
PKG_ARCH="aarch64"
|
||||
PKG_LICENSE="GPLv2"
|
||||
PKG_SITE="https://github.com/mupen64plus/mupen64plus-core"
|
||||
PKG_URL="https://github.com/mupen64plus/mupen64plus-core/archive/${PKG_VERSION}.tar.gz"
|
||||
|
@ -19,14 +19,13 @@ fi
|
|||
|
||||
if [ "${OPENGLES_SUPPORT}" = yes ]; then
|
||||
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
|
||||
PKG_MAKE_OPTS_TARGET+="USE_GLES=1"
|
||||
fi
|
||||
|
||||
make_target() {
|
||||
case ${ARCH} in
|
||||
arm|aarch64)
|
||||
export HOST_CPU=aarch64
|
||||
export USE_GLES=1
|
||||
export VC=0
|
||||
export CROSS_COMPILE="${TARGET_PREFIX}"
|
||||
BINUTILS="$(get_build_dir binutils)/.aarch64-libreelec-linux-gnueabi"
|
||||
;;
|
||||
|
@ -34,8 +33,9 @@ make_target() {
|
|||
|
||||
export SDL_CFLAGS="-I${SYSROOT_PREFIX}/usr/include/SDL2 -D_REENTRANT"
|
||||
export SDL_LDLIBS="-lSDL2_net -lSDL2"
|
||||
export USE_GLES=1
|
||||
export V=1
|
||||
export VC=0
|
||||
export OSD=0
|
||||
make -C projects/unix clean
|
||||
make -C projects/unix all ${PKG_MAKE_OPTS_TARGET}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
PKG_NAME="mupen64plussa-input-sdl"
|
||||
PKG_VERSION="9cbe63f8e80f4dfc6dcdd8408b51358d248a050e"
|
||||
PKG_SHA256="8c4c22dfb5b478b60a0059a38f7c0e2d01e9e9da65385340e0aa32b876cdc065"
|
||||
PKG_ARCH="any"
|
||||
PKG_ARCH="aarch64"
|
||||
PKG_LICENSE="GPLv2"
|
||||
PKG_SITE="https://github.com/mupen64plus/mupen64plus-input-sdl"
|
||||
PKG_URL="https://github.com/mupen64plus/mupen64plus-input-sdl/archive/${PKG_VERSION}.tar.gz"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
PKG_NAME="mupen64plussa-rsp-hle"
|
||||
PKG_VERSION="aa0ea78030d3c2b80184a35bbb36909fd7a28e70"
|
||||
PKG_SHA256="94acfd45c9b6974bde6ee38e9df60979cb906cec89efd37642be6f20f3737841"
|
||||
PKG_ARCH="any"
|
||||
PKG_ARCH="aarch64"
|
||||
PKG_LICENSE="GPLv2"
|
||||
PKG_SITE="https://github.com/mupen64plus/mupen64plus-rsp-hle"
|
||||
PKG_URL="https://github.com/mupen64plus/mupen64plus-rsp-hle/archive/${PKG_VERSION}.tar.gz"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
PKG_NAME="mupen64plussa-ui-console"
|
||||
PKG_VERSION="42546ab00b23a8052b9c974882628912609990c2"
|
||||
PKG_SHA256="210324e4ab3445e7891d999780106db0c2c96857b31a723eda61847ac0fdd745"
|
||||
PKG_ARCH="any"
|
||||
PKG_ARCH="aarch64"
|
||||
PKG_LICENSE="GPLv2"
|
||||
PKG_SITE="https://github.com/mupen64plus/mupen64plus-ui-console"
|
||||
PKG_URL="https://github.com/mupen64plus/mupen64plus-ui-console/archive/${PKG_VERSION}.tar.gz"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
PKG_NAME="mupen64plussa-video-glide64mk2"
|
||||
PKG_VERSION="79809753e83180e6bbc3b5b3dc65120fef3e7a43"
|
||||
PKG_SHA256="124cf056bed1534a95aee363cf7682095bfe8ef9580461fc26be834b8749ac04"
|
||||
PKG_ARCH="any"
|
||||
PKG_ARCH="aarch64"
|
||||
PKG_LICENSE="GPLv2"
|
||||
PKG_SITE="https://github.com/mupen64plus/mupen64plus-video-glide64mk2"
|
||||
PKG_URL="https://github.com/mupen64plus/mupen64plus-video-glide64mk2/archive/${PKG_VERSION}.tar.gz"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
PKG_NAME="mupen64plussa-video-gliden64"
|
||||
PKG_VERSION="2973f5351b6326ca588b60521522df34ed7a426e"
|
||||
PKG_ARCH="any"
|
||||
PKG_ARCH="aarch64"
|
||||
PKG_LICENSE="GPLv2"
|
||||
PKG_SITE="https://github.com/gonetz/GLideN64"
|
||||
PKG_URL="${PKG_SITE}.git"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
PKG_NAME="mupen64plussa-video-rice"
|
||||
PKG_VERSION="51582f9e62082f2937a17ac3acfaab08cb7f46ef"
|
||||
PKG_SHA256="e72f1c865cb4f7fff4691eaccbdd23c26638e3e2205ee7bceca9e3a33ada6e73"
|
||||
PKG_ARCH="any"
|
||||
PKG_ARCH="aarch64"
|
||||
PKG_LICENSE="GPLv2"
|
||||
PKG_SITE="https://github.com/mupen64plus/mupen64plus-video-rice"
|
||||
PKG_URL="https://github.com/mupen64plus/mupen64plus-video-rice/archive/${PKG_VERSION}.tar.gz"
|
||||
|
|
|
@ -23,6 +23,7 @@ PKG_NAME="flycast_libretro"
|
|||
PKG_VERSION="4c293f306bc16a265c2d768af5d0cea138426054"
|
||||
PKG_SHA256="7ce0bd97b095907fd4960c771364c549a54547877b5128af42c73a9257fbec6b"
|
||||
PKG_LICENSE="GPLv2"
|
||||
PKG_ARCH="aarch64"
|
||||
PKG_SITE="https://github.com/libretro/flycast"
|
||||
PKG_URL="${PKG_SITE}/archive/${PKG_VERSION}.tar.gz"
|
||||
PKG_DEPENDS_TARGET="toolchain"
|
||||
|
|
|
@ -24,7 +24,7 @@ PKG_NAME="gpsp"
|
|||
PKG_VERSION="81649a2c8075201bb823cce8fdf16a31c92a3b6c"
|
||||
PKG_SHA256="c1131811760dd78cbb8621b5845b4402a0801690facc77d4e8ea1292384bcd1b"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_ARCH="arm aarch64"
|
||||
PKG_LICENSE="GPLv2"
|
||||
PKG_SITE="https://github.com/libretro/gpsp"
|
||||
PKG_URL="${PKG_SITE}/archive/${PKG_VERSION}.tar.gz"
|
||||
|
|
|
@ -35,11 +35,15 @@ PKG_IS_ADDON="no"
|
|||
PKG_TOOLCHAIN="make"
|
||||
PKG_AUTORECONF="no"
|
||||
|
||||
if [ ${ARCH} = "aarch64" ]; then
|
||||
PKG_MAKE_OPTS_TARGET=" platform=emuelec"
|
||||
else
|
||||
PKG_MAKE_OPTS_TARGET=" platform=classic_armv8_a35"
|
||||
fi
|
||||
case ${ARCH} in
|
||||
aarch64)
|
||||
PKG_MAKE_OPTS_TARGET=" platform=emuelec"
|
||||
;;
|
||||
arm)
|
||||
PKG_MAKE_OPTS_TARGET=" platform=classic_armv8_a35"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
makeinstall_target() {
|
||||
mkdir -p $INSTALL/usr/lib/libretro
|
||||
|
|
|
@ -26,14 +26,15 @@ pre_make_target() {
|
|||
|
||||
cd ${PKG_BUILD}
|
||||
rm CMakeLists.txt
|
||||
|
||||
if [[ "${DEVICE}" =~ RG351 ]]
|
||||
then
|
||||
PKG_MAKE_OPTS_TARGET=" platform=odroidgoa"
|
||||
elif [[ "${DEVICE}" =~ RG552 ]]
|
||||
then
|
||||
PKG_MAKE_OPTS_TARGET=" platform=RK3399"
|
||||
fi
|
||||
|
||||
case ${DEVICE} in
|
||||
RG351P|RG351V|RG351MP)
|
||||
PKG_MAKE_OPTS_TARGET=" platform=odroidgoa"
|
||||
;;
|
||||
RG552)
|
||||
PKG_MAKE_OPTS_TARGET=" platform=RK3399"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
|
|
|
@ -40,11 +40,17 @@ PKG_USE_CMAKE="no"
|
|||
|
||||
make_target() {
|
||||
cd $PKG_BUILD
|
||||
if [[ "$ARCH" =~ "arm" ]]; then
|
||||
make -f Makefile.libretro platform=unix-armv HAVE_NEON=1
|
||||
else
|
||||
make -f Makefile.libretro platform=goadvance
|
||||
fi
|
||||
case ${ARCH} in
|
||||
arm)
|
||||
make -f Makefile.libretro platform=unix-armv HAVE_NEON=1
|
||||
;;
|
||||
aarch64)
|
||||
make -f Makefile.libretro platform=goadvance
|
||||
;;
|
||||
*)
|
||||
make -f Makefile.libretro
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
8bitdo_hack = "0"
|
|
@ -1 +0,0 @@
|
|||
connect_mode="default"
|
|
@ -385,7 +385,7 @@ if [ "${EES}" == "false" ] || [ "${EES}" == "none" ] || [ "${EES}" == "0" ]; the
|
|||
else
|
||||
echo "video_shader = \"${EES}\"" >> ${RAAPPENDCONF}
|
||||
echo 'video_shader_enable = "true"' >> ${RAAPPENDCONF}
|
||||
echo "--set-shader /usr/share/common-shaders/${EES}"
|
||||
echo "--set-shader /storage/shaders/${EES}"
|
||||
fi
|
||||
|
||||
## Filterset
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
set -e
|
||||
set -o pipefail
|
||||
|
||||
LOG="/var/log/$(basename "$0").log"
|
||||
|
||||
### Summary
|
||||
# This script listens to volume keys on the RG351MP and adjusts volume
|
||||
# Fn + Volume up/down will adjust brightness
|
||||
|
@ -18,9 +20,9 @@ set -o pipefail
|
|||
# type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
|
||||
# type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
|
||||
|
||||
DEVICE="${DEVICE_VOLUME_DEV}" # Device for volume key events
|
||||
#DEVICE="${DEVICE_VOLUME_DEV}" # Device for volume key events
|
||||
|
||||
CONTROLLER_DEVICE="${DEVICE_CONTROLLER_DEV}" # Joystick events (for Fn key)
|
||||
#CONTROLLER_DEVICE="${DEVICE_CONTROLLER_DEV}" # Joystick events (for Fn key)
|
||||
|
||||
VOL_EVENT='*(KEY_VOLUME*, value *' # This matches all volume events
|
||||
|
||||
|
@ -44,6 +46,19 @@ BRIGHTNESS_REPEAT_MOD=4
|
|||
FUNC_PRESSED=no
|
||||
|
||||
CONTROLLER_DISCONNECTED="*error reading: No such device"
|
||||
DEVICE_DISCONNECTED="*error reading: No such device"
|
||||
|
||||
# Detect input devices automatically
|
||||
for DEV in /dev/input/ev*
|
||||
do
|
||||
unset SUPPORTS
|
||||
SUPPORTS=$(udevadm info ${DEV} | awk '/ID_INPUT_KEYBOARD=|ID_INPUT_JOYSTICK=/ {print $2}')
|
||||
if [ -n "${SUPPORTS}" ]
|
||||
then
|
||||
DEVICE=$(udevadm info ${DEV} | awk 'BEGIN {FS="="} /DEVNAME=/ {print $2}')
|
||||
INPUT_DEVICES+=("${DEVICE}")
|
||||
fi
|
||||
done
|
||||
|
||||
# Logic:
|
||||
# - Listen to both:
|
||||
|
@ -54,24 +69,21 @@ CONTROLLER_DISCONNECTED="*error reading: No such device"
|
|||
# for all button pushes
|
||||
# - Using 'read' means the loop is idle when no button is pressed
|
||||
|
||||
# Wait for controller in case of restart, etc
|
||||
while true; do
|
||||
sleep 1
|
||||
if [[ ! -e "${CONTROLLER_DEVICE}" ]]; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
(
|
||||
|
||||
done
|
||||
(
|
||||
evtest "${DEVICE}" &
|
||||
evtest "${CONTROLLER_DEVICE}" 2>&1 &
|
||||
wait
|
||||
for INPUT_DEVICE in ${INPUT_DEVICES[@]}
|
||||
do
|
||||
evtest "${INPUT_DEVICE}" 2>&1 &
|
||||
done
|
||||
wait
|
||||
) | while read line; do
|
||||
case $line in
|
||||
(${CONTROLLER_DISCONNECTED})
|
||||
echo "Reloading due to controller reattach..."
|
||||
echo "Reloading due to ${CONTROLLER_DEVICE} reattach..." >${LOG} 2>&1
|
||||
exit 0
|
||||
;;
|
||||
(${DEVICE_DISCONNECTED})
|
||||
echo "Reloading due to ${DEVICE} reattach..." >${LOG} 2>&1
|
||||
exit 0
|
||||
;;
|
||||
(${VOL_EVENT})
|
||||
|
@ -95,7 +107,7 @@ done
|
|||
DOWN="-"
|
||||
REPEAT_MOD=${VOLUME_REPEAT_MOD}
|
||||
fi
|
||||
|
||||
|
||||
REPEAT_NUM=$(( ${REPEAT_NUM} + 1 ))
|
||||
|
||||
# This isn't time to evaluate repeat so just skip
|
||||
|
@ -116,7 +128,7 @@ done
|
|||
fi
|
||||
;;
|
||||
|
||||
(${V_FUNC_KEY_EVENT})
|
||||
(${V_FUNC_KEY_EVENT})
|
||||
|
||||
# We don't care about 'Fn' key repeats - continue
|
||||
if [[ "$line" == ${REPEAT_PRESS} ]]; then
|
|
@ -37,6 +37,8 @@ then
|
|||
### Link the ES splash to the distribution splash
|
||||
rm -f /storage/.config/emulationstation/resources/logo.png
|
||||
ln -sf /usr/config/splash/splash.png /storage/.config/emulationstation/resources/logo.png
|
||||
|
||||
mkdir -p /storage/.config/modprobe.d
|
||||
fi
|
||||
|
||||
if [ ! -e "/storage/.cache/ld.so.cache" ]
|
||||
|
|
|
@ -14,6 +14,7 @@ post_install() {
|
|||
mkdir -p ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/scripts/installer ${INSTALL}/usr/bin
|
||||
sed -e "s/@DISTRONAME@/${DISTRONAME}/g" \
|
||||
-e "s/@EXTRA_CMDLINE@/${EXTRA_CMDLINE}/g" \
|
||||
-i ${INSTALL}/usr/bin/installer
|
||||
|
||||
mkdir -p ${INSTALL}/etc
|
||||
|
|
|
@ -276,7 +276,7 @@ PROMPT 0
|
|||
|
||||
LABEL linux
|
||||
KERNEL /KERNEL
|
||||
APPEND boot=UUID=$UUID_SYSTEM disk=UUID=$UUID_STORAGE $SYSLINUX_PARAMETERS quiet
|
||||
APPEND boot=UUID=$UUID_SYSTEM disk=UUID=$UUID_STORAGE $SYSLINUX_PARAMETERS @EXTRA_CMDLINE@
|
||||
EOF
|
||||
|
||||
cat << EOF > $TMPDIR/part1/EFI/BOOT/grub.cfg
|
||||
|
@ -285,7 +285,7 @@ set default="${DISTRO}"
|
|||
|
||||
menuentry "${DISTRO}" {
|
||||
search --set -f /KERNEL
|
||||
linux /KERNEL boot=UUID=$UUID_SYSTEM disk=UUID=$UUID_STORAGE quiet
|
||||
linux /KERNEL boot=UUID=$UUID_SYSTEM disk=UUID=$UUID_STORAGE @EXTRA_CMDLINE@
|
||||
}
|
||||
EOF
|
||||
|
||||
|
|
18
packages/wayland/weston/config/kiosk.ini
Normal file
18
packages/wayland/weston/config/kiosk.ini
Normal file
|
@ -0,0 +1,18 @@
|
|||
[core]
|
||||
idle-time=0
|
||||
shell=kiosk-shell.so
|
||||
|
||||
[terminal]
|
||||
font-size=16
|
||||
|
||||
[shell]
|
||||
background-image=/usr/config/splash/splash.png
|
||||
background-type=scale-crop
|
||||
background-color=0x00000000
|
||||
clock-format=minutes-24h
|
||||
locking=false
|
||||
|
||||
[autolaunch]
|
||||
path=/usr/bin/start_es.sh
|
||||
icon=/usr/config/emulationstation/resources/window_icon_24.png
|
||||
watch=true
|
|
@ -5,7 +5,7 @@ idle-time=0
|
|||
font-size=16
|
||||
|
||||
[shell]
|
||||
background-image=/usr/share/weston/libreelec-wallpaper-2160.png
|
||||
background-image=/usr/config/splash/splash.png
|
||||
background-type=scale-crop
|
||||
background-color=0x00000000
|
||||
clock-format=minutes-24h
|
||||
|
|
|
@ -57,8 +57,7 @@ post_makeinstall_target() {
|
|||
cp ${PKG_DIR}/scripts/weston-config ${INSTALL}/usr/lib/weston
|
||||
|
||||
mkdir -p ${INSTALL}/usr/share/weston
|
||||
cp ${PKG_DIR}/config/weston.ini ${INSTALL}/usr/share/weston
|
||||
find_file_path "splash/splash.png" && cp ${FOUND_PATH} ${INSTALL}/usr/share/weston/libreelec-wallpaper-2160.png
|
||||
cp ${PKG_DIR}/config/*ini ${INSTALL}/usr/share/weston
|
||||
|
||||
safe_remove ${INSTALL}/usr/share/wayland-sessions
|
||||
}
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_AUDIO_MIXER="PCM"
|
||||
DEVICE_VOLUME_DEV="/dev/input/event4"
|
||||
|
||||
### Do all of this better
|
||||
DEVICE_VOL_MODIFIER="BTN_SELECT"
|
||||
DEVICE_CONTROLLER_DEV="/dev/input/event14"
|
||||
DEVICE_VOL_MODIFIER="ABS_RZ"
|
||||
|
||||
|
||||
DEVICE_BRIGHTNESS="100"
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
||||
|
||||
. /etc/profile
|
||||
|
||||
case $1 in
|
||||
pre)
|
||||
|
||||
if [ "${DEVICE_FAKE_JACKSENSE}" == "true" ]
|
||||
then
|
||||
nohup systemctl stop headphones &
|
||||
fi
|
||||
|
||||
if [ "${DEVICE_VOLUMECTL}" == "true" ]
|
||||
then
|
||||
nohup systemctl stop volume &
|
||||
fi
|
||||
|
||||
alsactl store -f /storage/.config/asound.state
|
||||
|
||||
touch /run/.last_sleep_time
|
||||
|
||||
;;
|
||||
post)
|
||||
alsactl restore -f /storage/.config/asound.state
|
||||
|
||||
if [ "${DEVICE_FAKE_JACKSENSE}" == "true" ]
|
||||
then
|
||||
nohup systemctl start headphones &
|
||||
fi
|
||||
|
||||
if [ "${DEVICE_VOLUMECTL}" == "true" ]
|
||||
then
|
||||
nohup systemctl start volume &
|
||||
fi
|
||||
|
||||
if [ "$(get_setting wifi.enabled)" == "1" ]
|
||||
then
|
||||
nohup wifictl reconnect &
|
||||
fi
|
||||
|
||||
DEVICE_VOLUME=$(get_setting "audio.volume" 2>/dev/null)
|
||||
amixer set "${DEVICE_AUDIO_MIXER}" ${DEVICE_VOLUME}% 2>&1 >/dev/null
|
||||
|
||||
### Call the brightness script to set to the last saved value.
|
||||
/usr/lib/autostart/common/006-brightness
|
||||
;;
|
||||
esac
|
|
@ -1,29 +0,0 @@
|
|||
# Copyright (C) 2021-present Fewtarius
|
||||
|
||||
PKG_NAME="system-utils"
|
||||
PKG_VERSION=""
|
||||
PKG_SHA256=""
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="mix"
|
||||
PKG_DEPENDS_TARGET="toolchain sleep"
|
||||
PKG_SITE=""
|
||||
PKG_URL=""
|
||||
PKG_LONGDESC="Support scripts for Generic devices"
|
||||
PKG_TOOLCHAIN="manual"
|
||||
|
||||
makeinstall_target() {
|
||||
|
||||
mkdir -p ${INSTALL}/usr/lib/autostart/common
|
||||
cp ${PKG_DIR}/sources/autostart/common/* ${INSTALL}/usr/lib/autostart/common
|
||||
|
||||
mkdir -p ${INSTALL}/usr/bin
|
||||
#cp ${PKG_DIR}/sources/scripts/fancontrol ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/headphone_sense ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/system_utils ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/volume_sense ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/internalwifi ${INSTALL}/usr/bin
|
||||
chmod 0755 ${INSTALL}/usr/bin/*
|
||||
|
||||
#mkdir -p ${INSTALL}/usr/config
|
||||
#cp ${PKG_DIR}/sources/config/fancontrol.conf ${INSTALL}/usr/config/fancontrol.conf.sample
|
||||
}
|
|
@ -1,136 +0,0 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2021-present Fewtarius
|
||||
# 2021-present pkegg
|
||||
|
||||
. /etc/profile
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
### Summary
|
||||
# This script listens to volume keys on the RG351MP and adjusts volume
|
||||
# Fn + Volume up/down will adjust brightness
|
||||
###
|
||||
|
||||
|
||||
# Event examples for reference
|
||||
# type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
|
||||
# type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
|
||||
|
||||
DEVICE="${DEVICE_VOLUME_DEV}" # Device for volume key events
|
||||
|
||||
CONTROLLER_DEVICE="${DEVICE_CONTROLLER_DEV}" # Joystick events (for Fn key)
|
||||
|
||||
VOL_EVENT='*(KEY_VOLUME*, value *' # This matches all volume events
|
||||
|
||||
VOL_UP='*UP), value *' # Differentiate 'up' volume event
|
||||
VOL_DOWN='*DOWN), value *' #Differentiate 'down' volume event
|
||||
|
||||
V_FUNC_KEY_EVENT='*('${DEVICE_VOL_MODIFIER}'), value *'
|
||||
|
||||
# Matches if a button was pressed (1), released (0) or held down (2)
|
||||
PRESS='*value 1'
|
||||
RELEASE='*value 0'
|
||||
REPEAT_PRESS="* value 2"
|
||||
|
||||
# Volume repeat
|
||||
VOLUME_REPEAT_MOD=4
|
||||
|
||||
# Brightness repeat
|
||||
BRIGHTNESS_REPEAT_MOD=4
|
||||
|
||||
# Variable to keep track of Fn being currently pressed
|
||||
FUNC_PRESSED=no
|
||||
|
||||
CONTROLLER_DISCONNECTED="*error reading: No such device"
|
||||
|
||||
# Logic:
|
||||
# - Listen to both:
|
||||
# - 'rg351' events to get volume keys (not part of the joystick api)
|
||||
# - 'joystick' events - as the V's 'fn' key is mapped to the joystick
|
||||
# - Switch statement keeps high level cases to only 'volume' and 'V function key'
|
||||
# this is to avoid processing for other events or creating a lot of cases as this will be called
|
||||
# for all button pushes
|
||||
# - Using 'read' means the loop is idle when no button is pressed
|
||||
|
||||
# Wait for controller in case of restart, etc
|
||||
while true; do
|
||||
sleep 1
|
||||
if [[ ! -e "${CONTROLLER_DEVICE}" ]]; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
|
||||
done
|
||||
(
|
||||
evtest "${DEVICE}" &
|
||||
evtest "${CONTROLLER_DEVICE}" 2>&1 &
|
||||
wait
|
||||
) | while read line; do
|
||||
case $line in
|
||||
(${CONTROLLER_DISCONNECTED})
|
||||
echo "Reloading due to controller reattach..."
|
||||
exit 0
|
||||
;;
|
||||
(${VOL_EVENT})
|
||||
|
||||
# We don't care when you 'let go' ('release') the volume button
|
||||
if [[ "$line" == ${RELEASE} ]]; then
|
||||
REPEAT_NUM=0
|
||||
continue
|
||||
fi
|
||||
|
||||
# Setup for 'brightness' if Fn pressed
|
||||
if [[ "${FUNC_PRESSED}" == "yes" ]]; then
|
||||
COMMAND=/usr/bin/brightness
|
||||
UP="up"
|
||||
DOWN="down"
|
||||
REPEAT_MOD=${BRIGHTNESS_REPEAT_MOD}
|
||||
# Default to 'volume' if Fn is not pressed
|
||||
else
|
||||
COMMAND="/usr/bin/system_utils vol"
|
||||
UP="+"
|
||||
DOWN="-"
|
||||
REPEAT_MOD=${VOLUME_REPEAT_MOD}
|
||||
fi
|
||||
|
||||
REPEAT_NUM=$(( ${REPEAT_NUM} + 1 ))
|
||||
|
||||
# This isn't time to evaluate repeat so just skip
|
||||
if [[ "$line" == ${REPEAT_PRESS} && $(( ${REPEAT_NUM} % ${REPEAT_MOD} )) != "0" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
INCREMENT_AMOUNT=5
|
||||
if [[ "${REPEAT_NUM}" -gt "20" ]]; then
|
||||
INCREMENT_AMOUNT=10
|
||||
fi
|
||||
# Run the commands to adjust volume/brightness
|
||||
if [[ "${line}" == ${VOL_UP} ]]; then
|
||||
${COMMAND} ${UP} ${INCREMENT_AMOUNT} > /dev/null
|
||||
elif [[ "${line}" == ${VOL_DOWN} ]]; then
|
||||
${COMMAND} ${DOWN} ${INCREMENT_AMOUNT} > /dev/null
|
||||
fi
|
||||
;;
|
||||
|
||||
(${V_FUNC_KEY_EVENT})
|
||||
|
||||
# We don't care about 'Fn' key repeats - continue
|
||||
if [[ "$line" == ${REPEAT_PRESS} ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
#Reset the number of repeats when Fn is pressed/release
|
||||
# as repeat speed is different between volume/brightness
|
||||
REPEAT_NUM=0
|
||||
|
||||
if [[ "${line}" == ${PRESS} ]]; then
|
||||
FUNC_PRESSED=yes
|
||||
elif [[ "${line}" == ${RELEASE} ]]; then
|
||||
FUNC_PRESSED=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
|
@ -6,9 +6,7 @@ DEVICE_FAKE_JACKSENSE=true
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_POWER_LED=true
|
||||
DEVICE_AUDIO_MIXER="Playback"
|
||||
DEVICE_VOLUME_DEV="/dev/input/by-path/platform-rg351-keys-event"
|
||||
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-rk817-sound-event"
|
||||
DEVICE_CONTROLLER_DEV="/dev/input/event2"
|
||||
DEVICE_BRIGHTNESS="70"
|
||||
SPLASH_LOADER="imagemagick"
|
||||
UI_SERVICE="systemctl start emustation.service"
|
||||
|
|
|
@ -6,9 +6,7 @@ DEVICE_FAKE_JACKSENSE=true
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_POWER_LED=true
|
||||
DEVICE_AUDIO_MIXER="Playback"
|
||||
DEVICE_VOLUME_DEV="/dev/input/by-path/platform-rg351-keys-event"
|
||||
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-rk817-sound-event"
|
||||
DEVICE_CONTROLLER_DEV="/dev/input/event2"
|
||||
DEVICE_BRIGHTNESS="70"
|
||||
SPLASH_LOADER="imagemagick"
|
||||
UI_SERVICE="systemctl start emustation.service"
|
||||
|
|
|
@ -6,9 +6,7 @@ DEVICE_FAKE_JACKSENSE=true
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_POWER_LED=true
|
||||
DEVICE_AUDIO_MIXER="Playback"
|
||||
DEVICE_VOLUME_DEV="/dev/input/by-path/platform-rg351-keys-event"
|
||||
DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-rk817-sound-event"
|
||||
DEVICE_CONTROLLER_DEV="/dev/input/event3"
|
||||
DEVICE_BRIGHTNESS="70"
|
||||
SPLASH_LOADER="imagemagick"
|
||||
UI_SERVICE="systemctl start emustation.service"
|
||||
|
|
|
@ -6,8 +6,6 @@ DEVICE_FAKE_JACKSENSE=false
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_POWER_LED=false
|
||||
DEVICE_AUDIO_MIXER="Master"
|
||||
DEVICE_VOLUME_DEV="/dev/input/by-path/platform-gpio-keys-event"
|
||||
DEVICE_CONTROLLER_DEV="/dev/input/by-path/platform-singleadc-joypad-event-joystick"
|
||||
#DEVICE_HEADPHONE_DEV=""
|
||||
DEVICE_BRIGHTNESS="30"
|
||||
SPLASH_LOADER="imagemagick"
|
||||
|
|
|
@ -6,8 +6,6 @@ DEVICE_FAKE_JACKSENSE=false
|
|||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_POWER_LED=false
|
||||
DEVICE_AUDIO_MIXER="Master"
|
||||
DEVICE_VOLUME_DEV="/dev/input/by-path/platform-gpio-keys-event"
|
||||
DEVICE_CONTROLLER_DEV="/dev/input/by-path/platform-singleadc-joypad-event-joystick"
|
||||
#DEVICE_HEADPHONE_DEV=""
|
||||
DEVICE_BRIGHTNESS="75"
|
||||
SPLASH_LOADER="imagemagick"
|
||||
|
|
|
@ -5,8 +5,6 @@ DEVICE_HAS_FAN=true
|
|||
DEVICE_FAKE_JACKSENSE=false
|
||||
DEVICE_VOLUMECTL=true
|
||||
DEVICE_AUDIO_MIXER="DAC"
|
||||
DEVICE_VOLUME_DEV="/dev/input/by-path/platform-volume-keys-event"
|
||||
DEVICE_CONTROLLER_DEV="/dev/input/by-path/platform-singleadc-joypad-event-joystick"
|
||||
DEVICE_BRIGHTNESS="50"
|
||||
SPLASH_LOADER="plymouth"
|
||||
UI_SERVICE="systemctl start emustation.service"
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
PKG_NAME="sleep"
|
||||
PKG_VERSION=""
|
||||
PKG_SHA256=""
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="OSS"
|
||||
PKG_DEPENDS_TARGET="systemd"
|
||||
PKG_SITE=""
|
||||
PKG_URL=""
|
||||
PKG_LONGDESC="Sleep configuration"
|
||||
PKG_TOOLCHAIN="manual"
|
||||
|
||||
makeinstall_target() {
|
||||
mkdir -p $INSTALL/usr/config/sleep.conf.d
|
||||
cp sleep.conf $INSTALL/usr/config/sleep.conf.d/sleep.conf
|
||||
|
||||
mkdir -p $INSTALL/usr/lib/systemd/system-sleep/
|
||||
cp sleep.sh $INSTALL/usr/lib/systemd/system-sleep/sleep
|
||||
chmod +x $INSTALL/usr/lib/systemd/system-sleep/sleep
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
# This file is part of systemd.
|
||||
#
|
||||
# systemd is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Entries in this file show the compile time defaults.
|
||||
# You can change settings by editing this file.
|
||||
# Defaults can be restored by simply deleting this file.
|
||||
#
|
||||
# See systemd-sleep.conf(5) for details
|
||||
|
||||
[Sleep]
|
||||
AllowSuspend=yes
|
||||
#AllowHibernation=yes
|
||||
#AllowSuspendThenHibernate=yes
|
||||
#AllowHybridSleep=yes
|
||||
#SuspendMode=suspend
|
||||
SuspendState=mem standby freeze
|
||||
#HibernateMode=platform shutdown
|
||||
#HibernateState=disk
|
||||
#HybridSleepMode=suspend platform shutdown
|
||||
#HybridSleepState=disk
|
||||
#HibernateDelaySec=180min
|
|
@ -1,33 +0,0 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
||||
|
||||
. /etc/profile
|
||||
|
||||
if [ "${DEVICE_HAS_FAN}" == "true" ]
|
||||
then
|
||||
nohup systemctl start fancontrol &
|
||||
else
|
||||
nohup systemctl stop fancontrol &
|
||||
fi
|
||||
|
||||
if [ "${DEVICE_POWER_LED}" == "true" ]
|
||||
then
|
||||
nohup systemctl start battery &
|
||||
else
|
||||
nohup systemctl stop battery &
|
||||
fi
|
||||
|
||||
if [ "${DEVICE_FAKE_JACKSENSE}" == "true" ]
|
||||
then
|
||||
nohup systemctl start headphones &
|
||||
else
|
||||
nohup systemctl stop headphones &
|
||||
fi
|
||||
|
||||
if [ "${DEVICE_VOLUMECTL}" == "true" ]
|
||||
then
|
||||
nohup systemctl start volume &
|
||||
else
|
||||
nohup systemctl stop volume &
|
||||
fi
|
|
@ -1,22 +0,0 @@
|
|||
# To enable custom fan control, set the cooling profile to custom, or run
|
||||
# set_setting cooling.profile custom
|
||||
#
|
||||
# Set to true or export it as a variable if you want debug output.
|
||||
# To test:
|
||||
#
|
||||
# systemctl stop fancontrol
|
||||
# /usr/bin/fancontrol
|
||||
#
|
||||
# To re-enable:
|
||||
#
|
||||
# systemctl start fancontrol
|
||||
|
||||
# Disable debugging by default
|
||||
DEBUG=false
|
||||
|
||||
## Fan speeds range from off (0) to full (255).
|
||||
## Define a speed for each temperature that you define. Order matters.
|
||||
SPEEDS=(255 127 85 0)
|
||||
|
||||
## Temperatures, 75000=75C. Map each to a speed above.
|
||||
TEMPS=(75000 65000 55000 0)
|
|
@ -1,64 +0,0 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
||||
|
||||
. /etc/profile
|
||||
|
||||
DEBUG=false
|
||||
COOLING_PROFILE=$(get_setting "cooling.profile")
|
||||
FAN_PWM="${DEVICE_PWM_FAN}"
|
||||
|
||||
$DEBUG && echo "Setting profile to ${COOLING_PROFILE}"
|
||||
|
||||
if [ -e "/storage/.config/fancontrol.conf" ] && [ "${COOLING_PROFILE}" = "custom" ]
|
||||
then
|
||||
$DEBUG && echo "Loading configuration file" 2>/dev/null
|
||||
source /storage/.config/fancontrol.conf
|
||||
if [ ! $? = 0 ]
|
||||
then
|
||||
WARN="Custom fan profile could not be loaded, defaulting to quiet."
|
||||
$DEBUG && echo "${WARN}"
|
||||
logger -t fancontrol "${WARN}"
|
||||
COOLING_PROFILE="quiet"
|
||||
set_setting cooling.profile quiet
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ ! "${COOLING_PROFILE}" = "custom" ]
|
||||
then
|
||||
if [ "${COOLING_PROFILE}" = "aggressive" ]
|
||||
then
|
||||
SPEEDS=(255 225 195)
|
||||
TEMPS=(55000 45000 0)
|
||||
elif [ "${COOLING_PROFILE}" = "moderate" ]
|
||||
then
|
||||
SPEEDS=(255 190 125 85)
|
||||
TEMPS=(65000 55000 45000 0)
|
||||
else
|
||||
# Quiet.
|
||||
SPEEDS=(255 127 85 0)
|
||||
TEMPS=(75000 65000 55000 0)
|
||||
fi
|
||||
fi
|
||||
|
||||
while true
|
||||
do
|
||||
INDEX=0
|
||||
CPU_TEMP=$(printf "%.0f" $(cat /sys/devices/virtual/thermal/thermal_zone*/temp | awk '{ total += $1; count++ } END { print total/count }'))
|
||||
$DEBUG && echo "CPU TEMP: ${CPU_TEMP}" 2>/dev/null
|
||||
for TEMP in "${TEMPS[@]}"
|
||||
do
|
||||
$DEBUG && echo "INDEX: ${INDEX}" 2>/dev/null
|
||||
$DEBUG && echo "CHK: ${TEMP}" 2>/dev/null
|
||||
if (( "${CPU_TEMP}" > "${TEMP}" ))
|
||||
then
|
||||
$DEBUG && echo "Setting PWM FAN to ${SPEEDS[${INDEX}]} (${TEMP})" 2>/dev/null
|
||||
echo ${SPEEDS[${INDEX}]} >${FAN_PWM}
|
||||
break
|
||||
fi
|
||||
INDEX=$(( $INDEX + 1 ))
|
||||
done
|
||||
sleep 2
|
||||
$DEBUG && echo "Loop" 2>/dev/null
|
||||
done
|
|
@ -1,35 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2020-present Shanti Gilbert (https://github.com/shantigilbert)
|
||||
|
||||
# Source predefined functions and variables
|
||||
. /etc/profile
|
||||
|
||||
# Switch to headphones if we have them already connected at boot
|
||||
GPIO=$(cat /sys/class/gpio/gpio${DEVICE_JACK}/value)
|
||||
[[ "$GPIO" == "0" ]] && set_setting "audio.device" "headphone" || set_setting "audio.device" "speakers"
|
||||
|
||||
if [ -e "/storage/.config/system/configs/system.cfg" ]; then
|
||||
/usr/bin/system_utils setaudio $(get_setting "audio.device")
|
||||
/usr/bin/system_utils vol $(get_setting "audio.volume")
|
||||
fi
|
||||
|
||||
# Headphone sensing
|
||||
DEVICE="${DEVICE_HEADPHONE_DEV}"
|
||||
|
||||
HP_ON='*(SW_HEADPHONE_INSERT), value 0*'
|
||||
HP_OFF='*(SW_HEADPHONE_INSERT), value 1*'
|
||||
|
||||
evtest "${DEVICE}" | while read line; do
|
||||
case $line in
|
||||
(${HP_ON})
|
||||
amixer cset name='Playback Path' HP
|
||||
set_setting "audio.device" "headphone"
|
||||
;;
|
||||
(${HP_OFF})
|
||||
amixer cset name='Playback Path' SPK
|
||||
set_setting "audio.device" "speakers"
|
||||
;;
|
||||
esac
|
||||
done
|
|
@ -1,27 +0,0 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
||||
|
||||
. /etc/profile
|
||||
|
||||
if [ -z "${DEVICE_INTERNAL_WIFI}" ] || [ "${DEVICE_INTERNAL_WIFI}" = false ]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
disable)
|
||||
connmanctl disable wifi
|
||||
rmmod ${DEVICE_WIFI_MODULE}
|
||||
echo 0 >/sys/class/gpio/gpio${DEVICE_WIFI}/value
|
||||
set_setting internal.wifi 0
|
||||
;;
|
||||
enable)
|
||||
echo 1 >/sys/class/gpio/gpio${DEVICE_WIFI}/value
|
||||
modprobe ${DEVICE_WIFI_MODULE}
|
||||
connmanctl enable wifi
|
||||
set_setting internal.wifi 1
|
||||
;;
|
||||
esac
|
||||
|
||||
systemctl restart connman
|
|
@ -1,87 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2020-present Shanti Gilbert (https://github.com/shantigilbert)
|
||||
|
||||
# THESE NEEDS TO BE CLEANED UP, MAYBE WITH CASE OR FUNCTIONS
|
||||
|
||||
# Source predefined functions and variables
|
||||
. /etc/profile
|
||||
|
||||
if [ "${1}" == "toggleaudio" ];then
|
||||
# Toggle audio output
|
||||
CURRENTAUDIO=$(get_setting "audio.device")
|
||||
case "${CURRENTAUDIO}" in
|
||||
"headphone")
|
||||
echo "setting speakers"
|
||||
amixer cset name='Playback Path' SPK
|
||||
set_setting "audio.device" "speakers"
|
||||
;;
|
||||
"auto"|"speakers"|*)
|
||||
echo "setting headphones"
|
||||
amixer cset name='Playback Path' HP
|
||||
set_setting "audio.device" "headphone"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ "${1}" == "setaudio" ];then
|
||||
# Set audio output second parameter is either headphones or speakers
|
||||
case "${2}" in
|
||||
"headphone")
|
||||
echo "setting headphones"
|
||||
amixer cset name='Playback Path' HP
|
||||
set_setting "audio.device" "headphone"
|
||||
;;
|
||||
"auto"|"speakers"|*)
|
||||
echo "setting speakers"
|
||||
amixer cset name='Playback Path' SPK
|
||||
set_setting "audio.device" "speakers"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ "${1}" == "vol" ];then
|
||||
VOLSTEP=1
|
||||
if [ -n "${3}" ]; then
|
||||
VOLSTEP="${3}"
|
||||
fi
|
||||
|
||||
CURRENTVOL=$(get_setting "audio.volume")
|
||||
MAXVOL=100
|
||||
MINVOL=0
|
||||
if [ "${2}" == "+" ]; then
|
||||
STEPVOL=$(($CURRENTVOL+$VOLSTEP))
|
||||
elif [ "${2}" == "-" ]; then
|
||||
STEPVOL=$(($CURRENTVOL-$VOLSTEP))
|
||||
else
|
||||
STEPVOL=${2}
|
||||
fi
|
||||
[ "$STEPVOL" -ge "$MAXVOL" ] && STEPVOL="$MAXVOL"
|
||||
[ "$STEPVOL" -le "$MINVOL" ] && STEPVOL="$MINVOL"
|
||||
amixer set "${DEVICE_AUDIO_MIXER}" ${STEPVOL}%
|
||||
alsactl store -f /storage/.config/asound.state
|
||||
set_setting "audio.volume" ${STEPVOL}
|
||||
fi
|
||||
|
||||
if [ "${1}" == "bright" ]; then
|
||||
STEPS="5"
|
||||
BRIGHTNESS_DEV="$(ls /sys/class/backlight)"
|
||||
CURRENTBRIGHT=$(cat /sys/class/backlight/${BRIGHTNESS_DEV}/brightness)
|
||||
MAXBRIGHT="100" #$(cat /sys/class/backlight/${BRIGHTNESS_DEV}/max_brightness)
|
||||
MINBRIGHT="2"
|
||||
if [ "${2}" == "+" ]; then
|
||||
STEPBRIGHT=$(($CURRENTBRIGHT+$STEPS))
|
||||
elif [ "${2}" == "-" ]; then
|
||||
STEPBRIGHT=$(($CURRENTBRIGHT-$STEPS))
|
||||
else
|
||||
STEPBRIGHT=${2}
|
||||
fi
|
||||
[ "$STEPBRIGHT" -ge "$MAXBRIGHT" ] && STEPBRIGHT="$MAXBRIGHT"
|
||||
[ "$STEPBRIGHT" -le "$MINBRIGHT" ] && STEPBRIGHT="$MINBRIGHT"
|
||||
#echo "Setting bright to $STEPBRIGHT"
|
||||
echo "${STEPBRIGHT}" > /sys/class/backlight/${BRIGHTNESS_DEV}/brightness
|
||||
set_setting "system.brightness" $(cat /sys/class/backlight/${BRIGHTNESS_DEV}/brightness)
|
||||
fi
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
[Unit]
|
||||
Description=RG351 Low Power monitor
|
||||
ConditionPathExists=/sys/class/power_supply/battery/capacity
|
||||
Before=jelos.target
|
||||
|
||||
[Service]
|
||||
Environment=HOME=/storage
|
||||
EnvironmentFile=/etc/profile
|
||||
ExecStart=/usr/bin/battery
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,13 +0,0 @@
|
|||
[Unit]
|
||||
Description=Simple Fan Control Service
|
||||
ConditionPathExists=/sys/class/hwmon/hwmon0/pwm1
|
||||
Before=jelos.target
|
||||
|
||||
[Service]
|
||||
Environment=HOME=/storage
|
||||
EnvironmentFile=/etc/profile
|
||||
ExecStart=/usr/bin/fancontrol
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,12 +0,0 @@
|
|||
[Unit]
|
||||
Description=Headphone Sense
|
||||
Before=jelos.target
|
||||
|
||||
[Service]
|
||||
Environment=HOME=/storage
|
||||
EnvironmentFile=/etc/profile
|
||||
ExecStart=/usr/bin/headphone_sense
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,15 +0,0 @@
|
|||
[Unit]
|
||||
Description=Volume button service
|
||||
After=headphones.service
|
||||
Before=jelos.target
|
||||
StartLimitIntervalSec=0
|
||||
|
||||
[Service]
|
||||
Environment=HOME=/storage
|
||||
EnvironmentFile=/etc/profile
|
||||
ExecStart=/usr/bin/volume_sense
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -62,17 +62,20 @@ fi
|
|||
PKG_CLEAN="${PKG_CLEAN} system-utils plymouth-lite initramfs busybox linux grub u-boot SDL2 modules \
|
||||
emulationstation retroarch lib32 splash jelos"
|
||||
|
||||
if [ -d "build.${DISTRO}-${DEVICE_ROOT}.${ARCH}/initramfs" ]
|
||||
if [ ! -n "${DIRTY}" ]
|
||||
then
|
||||
rm -rf build.${DISTRO}-${DEVICE_ROOT}.${ARCH}/initramfs
|
||||
fi
|
||||
if [ -d "build.${DISTRO}-${DEVICE_ROOT}.${ARCH}/initramfs" ]
|
||||
then
|
||||
rm -rf build.${DISTRO}-${DEVICE_ROOT}.${ARCH}/initramfs
|
||||
fi
|
||||
|
||||
# Clean a few packages to ensure the build date and version are updated
|
||||
for package in ${PKG_CLEAN}
|
||||
do
|
||||
echo "Clean: ${package}"
|
||||
./scripts/clean ${package}
|
||||
done
|
||||
# Clean a few packages to ensure the build date and version are updated
|
||||
for package in ${PKG_CLEAN}
|
||||
do
|
||||
echo "Clean: ${package}"
|
||||
./scripts/clean ${package}
|
||||
done
|
||||
fi
|
||||
|
||||
# Clean out old builds before starting the new one.
|
||||
echo "Prune old releases: ${DISTRO}-${DEVICE}.${ARCH}-*"
|
||||
|
|
|
@ -323,6 +323,13 @@ fi
|
|||
sha256sum $(basename "${DISK}").gz > $(basename "${DISK}").gz.sha256
|
||||
)
|
||||
|
||||
if [ -n "${JELOS_SSH_KEYS_FILE}" ] || \
|
||||
[ -n "${JELOS_WIFI_SSID}" ] || \
|
||||
[ -n "${JELOS_WIFI_KEY}" ]
|
||||
then
|
||||
echo "image: CONTAINS SENSITIVE DATA, DO NOT DISTRIBUTE."
|
||||
fi
|
||||
|
||||
# cleanup
|
||||
cleanup
|
||||
exit
|
||||
|
|
Loading…
Reference in a new issue