From 445937a4af3026d877ab42181e8626dce22c49b3 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Sat, 9 May 2026 15:27:09 +0000 Subject: [PATCH] linux-fresnel-fourier: bootstrap extlinux-add.sh --- arch/linux-fresnel-fourier/extlinux-add.sh | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 arch/linux-fresnel-fourier/extlinux-add.sh diff --git a/arch/linux-fresnel-fourier/extlinux-add.sh b/arch/linux-fresnel-fourier/extlinux-add.sh new file mode 100644 index 000000000..339a85464 --- /dev/null +++ b/arch/linux-fresnel-fourier/extlinux-add.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# Add / update / remove the linux-fresnel-fourier entry in /boot/extlinux/extlinux.conf +# Idempotent. Coexists with the existing linux-eos-arm entry; never edits it. + +set -eu + +CONF="/boot/extlinux/extlinux.conf" +TAG_BEGIN="# >>> linux-fresnel-fourier (managed) >>>" +TAG_END="# <<< linux-fresnel-fourier (managed) <<<" + +# What the entry should look like. APPEND copied from the existing +# linux-eos-arm entry where possible; otherwise sane PBP default. +EOS_APPEND=$(awk '/^[[:space:]]*APPEND/{print substr($0,index($0,"APPEND")+7); exit}' "$CONF" 2>/dev/null || true) +APPEND="${EOS_APPEND:-console=ttyS2,1500000 root=PARTLABEL=root rw rootwait}" + +ENTRY=$(cat < "$TMP" + +# If the kernel files no longer exist (post-Remove), don't re-add the entry. +if [ -f "/boot/Image-fresnel-fourier" ] && [ -f "/boot/dtbs-fresnel-fourier/rockchip/rk3399-pinebook-pro.dtb" ]; then + printf '%s\n' "$ENTRY" >> "$TMP" + echo "linux-fresnel-fourier: extlinux entry updated" +else + echo "linux-fresnel-fourier: kernel files absent, entry removed" +fi + +mv "$TMP" "$CONF"