#!/bin/sh
# p76 pmOS_boot -> bootlader-Direktboot einrichten (extlinux) + Bootlog.
# ABLAUF: extlinux.conf auf p76 legen, md5-check, reboot.
# ACHTUNG: XBL-Logo (2-5 s, signiert) bleibt; danach schwarz + Bootlog.
MT=/tmp/b76
P=/dev/mmcblk1p76
SRC=/mnt/marlonivo.com/home/ivo/ongoing/code/baby/rb/extlinux/extlinux.conf
if ! mountpoint -q "$MT" 2>/dev/null; then
  mount -o ro "$P" "$MT" 2>/dev/null || mount -o rw "$P" "$MT"
fi
mkdir -p "$MT/extlinux"
cp -v "$SRC" "$MT/extlinux/extlinux.conf"
echo "verify:"
md5sum "$SRC" "$MT/extlinux/extlinux.conf"
ls -la "$MT/extlinux/"
echo "Die alte systemd-boot Kette (loader/entries/pmos.conf, BOOTAA64.EFI) bleibt liegen als Fallback."
echo "Reboot jetzt? druecke dann power off/power on."