2023-10-23 22:44:47 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2023-10-24 16:00:57 +00:00
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
PKG_NAME="jelos"
|
2023-05-01 21:16:24 +00:00
|
|
|
PKG_VERSION=""
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_ARCH="any"
|
2023-10-23 22:44:47 +00:00
|
|
|
PKG_LICENSE="GPLv2"
|
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"
|
|
|
|
|
|
|
|
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/
|
|
|
|
|
2023-04-02 14:23:33 +00:00
|
|
|
### Compatibility links for ports
|
|
|
|
ln -s /storage/roms ${INSTALL}/roms
|
|
|
|
|
2022-06-03 18:15:01 +00:00
|
|
|
### Add some quality of life customizations for hardworking devs.
|
2023-03-16 22:14:48 +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
|
|
|
|
|
2023-03-16 22:14:48 +00:00
|
|
|
if [ -n "${LOCAL_WIFI_SSID}" ]
|
|
|
|
then
|
2023-02-16 22:40:39 +00:00
|
|
|
sed -i "s#network.enabled=0#network.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
2022-06-03 18:15:01 +00:00
|
|
|
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
|
|
|
|
|
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
|
2023-04-23 21:06:53 +00:00
|
|
|
BUILD_ID=$(git rev-parse HEAD)
|
2022-02-05 14:23:32 +00:00
|
|
|
cp ${PKG_DIR}/sources/issue ${INSTALL}/etc
|
|
|
|
ln -s /etc/issue ${INSTALL}/etc/motd
|
|
|
|
cat <<EOF >> ${INSTALL}/etc/issue
|
2023-10-16 22:17:12 +00:00
|
|
|
... Version: ${OS_VERSION} (${BUILD_ID:0:7})
|
|
|
|
... Built: ${BUILD_DATE}
|
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
|
2023-07-03 00:13:49 +00:00
|
|
|
chmod 0755 ${INSTALL}/usr/bin/* 2>/dev/null ||:
|
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
|
|
|
|
|
2023-04-23 13:44:13 +00:00
|
|
|
### Take a backup of the system configuration on shutdown
|
|
|
|
enable_service save-sysconfig.service
|
|
|
|
|
2022-03-28 21:12:31 +00:00
|
|
|
sed -i "s#@DEVICENAME@#${DEVICE}#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
|
2022-04-14 11:03:39 +00:00
|
|
|
### Defaults for non-main builds.
|
|
|
|
BUILD_BRANCH="$(git branch --show-current)"
|
2023-10-03 20:07:12 +00:00
|
|
|
if [ ! "${BUILD_BRANCH}" = "main" ]
|
2022-04-14 11:03:39 +00:00
|
|
|
then
|
|
|
|
sed -i "s#ssh.enabled=0#ssh.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
2023-03-08 17:34:56 +00:00
|
|
|
sed -i "s#network.enabled=0#network.enabled=1#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
2022-04-14 11:03:39 +00:00
|
|
|
fi
|
2022-10-14 20:51:45 +00:00
|
|
|
|
2023-04-23 00:19:52 +00:00
|
|
|
### Disable automount on AMD64
|
2023-04-23 01:44:25 +00:00
|
|
|
if [ "${DEVICE}" = "AMD64" ]
|
2023-04-23 00:19:52 +00:00
|
|
|
then
|
|
|
|
sed -i "s#system.automount=1#system.automount=0#g" ${INSTALL}/usr/config/system/configs/system.cfg
|
|
|
|
fi
|
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|