Lakka-LibreELEC/projects/L4T/devices/Switch/packages/switch-bootloader/package.mk
GavinDarkglider 4d743d3c68
Lakka v5.x switch 3 (#1895)
* Switch: Bootloader: Fix boot.scr issues, fix issue in updater, and bump package version

* Joycond: Switch: Update

* L4T: Switch: Retroarch: Add patch to fix single joycon detection

This patch is included in upstream PR #15818

* Lakka: Wii-u-gc-adapter: Enable service when building image

* L4T: Switch: Add wii-u-gc-adapter to build

* L4T: Switch: retroarch add canary support to updater

* Lakka: Retroarch: Add Canary path support for updater

* Retroarch: Switch: Add patch for canary builds

* L4T: BusyBox: Fix Password Generation

* Busybox: Make DISTRO user password creation match switch busybox package

* L4T: tegra-bsp: Update 10-monitor.conf to fix vsync/tearing issues
2023-10-29 22:58:45 +02:00

72 lines
4.1 KiB
Makefile

PKG_NAME="switch-bootloader"
PKG_VERSION="2.8"
PKG_ARCH="any"
PKG_DEPENDS_TARGET="switch-u-boot:host switch-u-boot:target switch-atf:target"
PKG_TOOLCHAIN="manual"
make_target() {
cat << EOF > ${PKG_BUILD}/${DISTRO}.ini
[${DISTRO}]
l4t=1
boot_prefixes=${DISTRO_PATH}/boot/
logopath=${DISTRO_PATH}/boot/splash.bmp
id=${ID}
icon=${DISTRO_PATH}/boot/${DISTRO_ICON}
EOF
cp ${PKG_DIR}/assets/README_CONFIG.txt ${PKG_BUILD}/
sed -i "s/@DISTRO_PATH@/${DISTRO_PATH}/g" ${PKG_BUILD}/README_CONFIG.txt
sed -i "s/@DISTRO_ID@/${ID}/g" ${PKG_BUILD}/README_CONFIG.txt
sed -i "s/@DISTRO@/${DISTRO}/g" ${PKG_BUILD}/README_CONFIG.txt
cp ${PKG_DIR}/assets/boot.txt ${PKG_BUILD}/
sed -i "s/@DISTRO_PATH@/${DISTRO_PATH}/g" ${PKG_BUILD}/boot.txt
sed -i "s/@DISTRO_ID@/${ID}/g" ${PKG_BUILD}/boot.txt
mkimage -A arm -T script -O linux -d ${PKG_BUILD}/boot.txt ${PKG_BUILD}/boot.scr
}
makeinstall_target() {
mkdir -p ${INSTALL}/usr/share/bootloader/boot
cp -Prv ${PKG_BUILD}/boot.scr ${INSTALL}/usr/share/bootloader/boot/boot.scr
cp -PRv ${PKG_BUILD}/${DISTRO}.ini ${INSTALL}/usr/share/bootloader/boot/${DISTRO}.ini
cp -PRv ${PKG_BUILD}/README_CONFIG.txt ${INSTALL}/usr/share/bootloader/boot/README_CONFIG.txt
cp -PRv ${PKG_DIR}/assets/${HEKATE_SPLASH} ${INSTALL}/usr/share/bootloader/boot/splash.bmp
cp -PRv ${PKG_DIR}/assets/${DISTRO_ICON} ${INSTALL}/usr/share/bootloader/boot/
#Create update.sh for updater
cat << EOF >> ${INSTALL}/usr/share/bootloader/update.sh
#/bin/sh
[ -z "\${BOOT_ROOT}" ] && BOOT_ROOT="/flash"
[ -z "\${SYSTEM_ROOT}" ] && SYSTEM_ROOT=""
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/boot.scr" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/boot.scr
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/coreboot.rom" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/coreboot.rom
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/uenv.txt" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/uenv.txt
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/tegra210-icosa.dtb" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/tegra210-icosa.dtb
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/uartb_logging.dtbo" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/uartb_logging.dtbo
[ -f "\${BOOT_ROOT}/bootloader/ini/${DISTRO}.ini" ] && grep "l4t=1" "\${BOOT_ROOT}/bootloader/ini/${DISTRO}.ini" && [ $? = "1" ] && rm \${BOOT_ROOT}/bootloader/ini/${DISTRO}.ini
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/nx-plat.dtimg" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/nx-plat.dtimg
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/boot/boot.scr" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/boot/boot.scr
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/boot/bl31.bin" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/boot/bl31.bin
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/boot/bl33.bin" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/boot/bl33.bin
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/nx-plat.dtimg" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/nx-plat.dtimg
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/${DISTRO_ICON}" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/${DISTRO_ICON}
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/splash.bmp" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/splash.bmp
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/README_CONFIG.txt" ] && rm \${BOOT_ROOT}/${DISTRO_PATH}/README_CONFIG.txt
mkdir -p \${BOOT_ROOT}/${DISTRO_PATH}/boot
[ -f "\${BOOT_ROOT}/${DISTRO_PATH}/storage/.config/retroarch/retroarch.cfg" ] && sed -i -e 's|input_player1_joypad_index = "2"|input_player1_joypad_index = "0"|' \${BOOT_ROOT}/${DISTRO_PATH}/storage/.config/retroarch/retroarch.cfg
cp \${SYSTEM_ROOT}/usr/share/bootloader/boot/nx-plat.dtimg \${BOOT_ROOT}/${DISTRO_PATH}/
cp \${SYSTEM_ROOT}/usr/share/bootloader/boot/README_CONFIG.txt \${BOOT_ROOT}/${DISTRO_PATH}/
cp \${SYSTEM_ROOT}/usr/share/bootloader/boot/boot.scr \${BOOT_ROOT}/${DISTRO_PATH}/boot/
cp \${SYSTEM_ROOT}/usr/share/bootloader/boot/bl31.bin \${BOOT_ROOT}/${DISTRO_PATH}/boot/
cp \${SYSTEM_ROOT}/usr/share/bootloader/boot/bl33.bin \${BOOT_ROOT}/${DISTRO_PATH}/boot/
[ ! -f "\${BOOT_ROOT}/bootloader/ini/${DISTRO}.ini" ] && cp \${SYSTEM_ROOT}/usr/share/bootloader/boot/${DISTRO}.ini \${BOOT_ROOT}/bootloader/ini/${DISTRO}.ini
cp \${SYSTEM_ROOT}/usr/share/bootloader/boot/splash.bmp \${BOOT_ROOT}/${DISTRO_PATH}/boot/
cp \${SYSTEM_ROOT}/usr/share/bootloader/boot/${DISTRO_ICON} \${BOOT_ROOT}/${DISTRO_PATH}/boot/
EOF
chmod +x ${INSTALL}/usr/share/bootloader/update.sh
}