2022-02-05 14:23:32 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Copyright (C) 2020-present Fewtarius
|
|
|
|
|
|
|
|
PKG_NAME="jelos"
|
2022-03-01 22:06:41 +00:00
|
|
|
PKG_VERSION="$(date +%Y%m%d)"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_ARCH="any"
|
2022-02-09 01:27:20 +00:00
|
|
|
PKG_LICENSE="apache2"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_SITE=""
|
|
|
|
PKG_URL=""
|
2022-07-11 12:08:11 +00:00
|
|
|
PKG_DEPENDS_TARGET="toolchain"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_SHORTDESC="JELOS Meta Package"
|
|
|
|
PKG_LONGDESC="JELOS Meta Package"
|
|
|
|
PKG_IS_ADDON="no"
|
|
|
|
PKG_AUTORECONF="no"
|
|
|
|
PKG_TOOLCHAIN="make"
|
|
|
|
|
2022-07-11 12:08:11 +00:00
|
|
|
if [ ! "${OPENGL}" = "no" ]; then
|
|
|
|
PKG_DEPENDS_TARGET+=" ${OPENGL} glu libglvnd"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${OPENGLES_SUPPORT}" = yes ]; then
|
|
|
|
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
|
|
|
|
fi
|
|
|
|
|
2022-06-07 23:00:45 +00:00
|
|
|
PKG_BASEOS="plymouth-lite grep wget libjpeg-turbo util-linux xmlstarlet bluetool gnupg gzip patchelf \
|
2022-03-13 10:58:41 +00:00
|
|
|
imagemagick terminus-font vim bash pyudev dialog six git dbus-python coreutils miniupnpc \
|
2023-01-19 11:14:52 +00:00
|
|
|
nss-mdns avahi alsa-ucm-conf MC fbgrab modules system-utils autostart powerstate powertop"
|
2022-03-13 10:58:41 +00:00
|
|
|
|
2022-08-04 11:34:13 +00:00
|
|
|
PKG_UI="emulationstation es-themes"
|
|
|
|
|
|
|
|
PKG_SOFTWARE=""
|
2022-02-05 14:23:32 +00:00
|
|
|
|
2022-07-03 01:23:36 +00:00
|
|
|
PKG_COMPAT=""
|
2022-02-08 11:44:54 +00:00
|
|
|
|
2023-01-08 22:49:32 +00:00
|
|
|
PKG_MULTIMEDIA="ffmpeg vlc"
|
2022-11-05 16:19:29 +00:00
|
|
|
|
2023-01-08 22:49:32 +00:00
|
|
|
### Splitting out MPV
|
2022-10-17 21:39:43 +00:00
|
|
|
case "${DEVICE}" in
|
2022-12-30 12:17:07 +00:00
|
|
|
handheld)
|
2023-01-08 22:49:32 +00:00
|
|
|
PKG_MULTIMEDIA="mpv"
|
2022-10-17 21:39:43 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2023-01-16 12:30:21 +00:00
|
|
|
PKG_TOOLS="i2c-tools syncthing rclone jslisten evtest tailscale pygobject mesa-demos"
|
2023-01-08 22:49:32 +00:00
|
|
|
|
2022-08-04 11:34:13 +00:00
|
|
|
### Project specific variables
|
|
|
|
case "${PROJECT}" in
|
|
|
|
Rockchip)
|
|
|
|
PKG_EMUS+=" retropie-shaders"
|
|
|
|
PKG_COMPAT+=" lib32"
|
|
|
|
;;
|
|
|
|
PC)
|
|
|
|
PKG_BASEOS+=" installer"
|
|
|
|
;;
|
|
|
|
esac
|
2022-03-13 11:32:16 +00:00
|
|
|
|
2022-02-10 00:43:47 +00:00
|
|
|
if [ ! -z "${BASE_ONLY}" ]
|
|
|
|
then
|
2022-08-04 11:34:13 +00:00
|
|
|
PKG_DEPENDS_TARGET+=" ${PKG_BASEOS} ${PKG_TOOLS} ${PKG_UI}"
|
2022-02-10 00:43:47 +00:00
|
|
|
else
|
2022-11-05 16:19:29 +00:00
|
|
|
PKG_DEPENDS_TARGET+=" ${PKG_BASEOS} ${PKG_TOOLS} ${PKG_UI} ${PKG_COMPAT} ${PKG_MULTIMEDIA} ${PKG_SOFTWARE}"
|
2022-02-10 00:43:47 +00:00
|
|
|
fi
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
make_target() {
|
|
|
|
:
|
|
|
|
}
|
|
|
|
|
|
|
|
makeinstall_target() {
|
|
|
|
|
|
|
|
mkdir -p ${INSTALL}/usr/config/
|
|
|
|
rsync -av ${PKG_DIR}/config/* ${INSTALL}/usr/config/
|
2022-02-27 02:40:30 +00:00
|
|
|
ln -sf /storage/.config/system ${INSTALL}/system
|
|
|
|
find ${INSTALL}/usr/config/system/ -type f -exec chmod o+x {} \;
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
mkdir -p ${INSTALL}/usr/bin/
|
|
|
|
|
|
|
|
## Compatibility links for ports
|
|
|
|
ln -s /storage/roms ${INSTALL}/roms
|
|
|
|
ln -sf /storage/roms/opt ${INSTALL}/opt
|
|
|
|
|
2022-06-03 18:15:01 +00:00
|
|
|
### Add some quality of life customizations for hardworking devs.
|
2022-12-04 00:47:39 +00:00
|
|
|
if [ -n "${LOCAL_SSH_KEYS_FILE}" ]; then
|
2022-06-06 18:09:55 +00:00
|
|
|
mkdir -p ${INSTALL}/usr/config/ssh
|
2022-12-04 00:47:39 +00:00
|
|
|
cp ${LOCAL_SSH_KEYS_FILE} ${INSTALL}/usr/config/ssh/authorized_keys
|
2022-06-03 18:15:01 +00:00
|
|
|
fi
|
|
|
|
|
2022-12-04 00:47:39 +00:00
|
|
|
if [ -n "${LOCAL_WIFI_SSID}" ]; then
|
2022-06-03 18:15:01 +00:00
|
|
|
sed -i "s#wifi.enabled=0#wifi.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
cat <<EOF >> ${INSTALL}/usr/config/system/configs/system.cfg
|
2022-12-04 00:47:39 +00:00
|
|
|
wifi.ssid=${LOCAL_WIFI_SSID}
|
|
|
|
wifi.key=${LOCAL_WIFI_KEY}
|
2022-06-03 18:15:01 +00:00
|
|
|
EOF
|
|
|
|
fi
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
post_install() {
|
|
|
|
ln -sf jelos.target ${INSTALL}/usr/lib/systemd/system/default.target
|
|
|
|
|
|
|
|
mkdir -p ${INSTALL}/etc/profile.d
|
|
|
|
cp ${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}/device.config ${INSTALL}/etc/profile.d/01-deviceconfig
|
|
|
|
|
2022-03-16 22:03:28 +00:00
|
|
|
if [ ! -d "${INSTALL}/usr/share" ]
|
|
|
|
then
|
|
|
|
mkdir "${INSTALL}/usr/share"
|
|
|
|
fi
|
|
|
|
cp ${PKG_DIR}/sources/post-update ${INSTALL}/usr/share
|
|
|
|
chmod 755 ${INSTALL}/usr/share/post-update
|
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
# Issue banner
|
|
|
|
cp ${PKG_DIR}/sources/issue ${INSTALL}/etc
|
|
|
|
ln -s /etc/issue ${INSTALL}/etc/motd
|
|
|
|
cat <<EOF >> ${INSTALL}/etc/issue
|
|
|
|
==> Build Date: ${BUILD_DATE}
|
|
|
|
==> Version: ${OS_VERSION}
|
2022-04-14 11:56:57 +00:00
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
cp ${PKG_DIR}/sources/scripts/* ${INSTALL}/usr/bin
|
2022-12-07 05:15:00 +00:00
|
|
|
chmod 0755 ${INSTALL}/usr/bin/* ||:
|
2022-10-14 20:51:45 +00:00
|
|
|
enable_service jelos-automount.service
|
2022-02-10 21:39:12 +00:00
|
|
|
|
2022-12-19 22:14:32 +00:00
|
|
|
### Fix and migrate to autostart package
|
|
|
|
enable_service jelos-autostart.service
|
|
|
|
|
2022-03-28 21:12:31 +00:00
|
|
|
sed -i "s#@DEVICENAME@#${DEVICE}#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
|
2022-09-05 13:28:59 +00:00
|
|
|
if [[ "${DEVICE}" =~ handheld ]]
|
|
|
|
then
|
2022-12-04 20:46:38 +00:00
|
|
|
sed -i "s#system.automount=1#system.automount=0#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
2022-09-24 13:16:28 +00:00
|
|
|
sed -i "s#fstrim.enabled=0#fstrim.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
2022-12-21 22:24:01 +00:00
|
|
|
sed -i "s#3do.cpugovernor=performance#3do.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#arcade.cpugovernor=performance#arcade.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#atarijaguar.cpugovernor=performance#atarijaguar.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#atomiswave.cpugovernor=performance#atomiswave.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#dreamcast.cpugovernor=performance#dreamcast.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#j2me.cpugovernor=performance#j2me.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#mame.cpugovernor=performance#mame.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#n64.cpugovernor=performance#n64.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#naomi.cpugovernor=performance#naomi.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#nds.cpugovernor=performance#nds.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#pcfx.cpugovernor=performance#pcfx.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#pc.cpugovernor=performance#pc.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#psp.cpugovernor=performance#psp.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#pspminis.cpugovernor=performance#pspminis.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
sed -i "s#virtualboy.cpugovernor=performance#virtualboy.cpugovernor=schedutil#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
2022-09-05 13:28:59 +00:00
|
|
|
fi
|
|
|
|
|
2022-04-14 11:03:39 +00:00
|
|
|
### Defaults for non-main builds.
|
|
|
|
BUILD_BRANCH="$(git branch --show-current)"
|
|
|
|
if [[ ! "${BUILD_BRANCH}" =~ main ]]
|
|
|
|
then
|
|
|
|
sed -i "s#ssh.enabled=0#ssh.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
fi
|
2022-10-14 20:51:45 +00:00
|
|
|
|
2022-10-27 21:40:02 +00:00
|
|
|
enable_service bluetooth-agent.service
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|