# Maintainer: Azkali Manad Name: switch-bootfiles Version: 5.1 Release: 3 License: GPL-3.0-only Summary: Nintendo Switch bootstack SOURCE0: https://gitlab.com/l4t-community/gnu-linux/switchroot-pipeline/-/jobs/artifacts/master/raw/switchroot-fedora-boot.zip?job=bootstack_full_fedora#/switchroot-fedora-boot.zip %prep unzip %{SOURCE0} %description %{summary}. %install mkdir -p %{buildroot}/.boot/bootloader/ %{buildroot}/boot/switchroot/ find %{_builddir}/switchroot/fedora/ -type f -exec install -m 644 "{}" "%{buildroot}/boot/switchroot/" \; cp -r %{_builddir}/bootloader/ini/ %{buildroot}/.boot/bootloader/ %pre if [[ ! $(ls /dev/mmcblk0*) ]]; then echo "Running in repo skipping boot dir mount"; exit 0; fi mkdir -p /boot/switchroot /.boot if ! mountpoint -q /.boot && ! mountpoint -q /boot/switchroot; then MMC_BLK="$(cat /proc/cmdline | awk -F 'boot_m=' '{print substr($2,0,1)}' | tr -d '\n')" MMC_PART="$(cat /proc/cmdline | awk -F 'boot_p=' '{print substr($2,0,1)}' | tr -d '\n')" [ -z "${MMC_PART}" ] && MMC_PART=1 if [ -e /dev/mmcblk1 ]; then if [ -n "${MMC_BLK}" ]; then umount /dev/mmcblk"${MMC_BLK}"p"${MMC_PART}" sleep 1 if mount /dev/mmcblk"${MMC_BLK}"p"${MMC_PART}" /.boot/; then BOOT_DEV_FOUND="true"; fi else umount /dev/mmcblk1p1 sleep 1 if mount /dev/mmcblk1p1 /.boot; then BOOT_DEV_FOUND="true"; fi fi else umount /dev/mmcblk0p"${MMC_PART}" sleep 1 if mount /dev/mmcblk0p"${MMC_PART}" /.boot; then BOOT_DEV_FOUND="true"; fi fi if [ "${BOOT_DEV_FOUND}" != "true" ]; then exit 1; fi mount --bind /.boot/switchroot/fedora /boot/switchroot || exit 1 fi if [ -e "/.boot/bootloader/ini/L4T-fedora.ini" ]; then cp /.boot/bootloader/ini/L4T-fedora.ini /.boot/bootloader/ini/L4T-fedora.ini.bak fi %posttrans if [ -e "/.boot/bootloader/ini/L4T-fedora.ini.bak" ]; then cp /.boot/bootloader/ini/L4T-fedora.ini.bak /.boot/bootloader/ini/L4T-fedora.ini rm -f /.boot/bootloader/ini/L4T-fedora.ini.bak fi %files /boot/switchroot/boot.scr /boot/switchroot/logo_fedora.bmp /boot/switchroot/icon_fedora_hue.bmp /boot/switchroot/bl31.bin /boot/switchroot/bl33.bin /.boot/bootloader/ini/* %changelog %{autochangelog}