2023-10-07 16:22:18 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -xeuf -o pipefail
|
|
|
|
|
|
|
|
BOOT_PART="$(grep '/ ' /etc/fstab | awk '{print $1}')"
|
|
|
|
|
2023-10-08 11:32:56 +00:00
|
|
|
cp /opt/opi5-efi/boot.cmd boot/efi/boot.cmd
|
|
|
|
cp /opt/opi5-efi/uEnv.txt boot/efi/uEnv.txt
|
2023-10-07 16:22:18 +00:00
|
|
|
|
2023-10-15 03:36:37 +00:00
|
|
|
if [ ! -f "/boot/initramfs.img" ]; then
|
|
|
|
echo "Initramfs not found."
|
2023-10-07 16:22:18 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-10-08 08:00:58 +00:00
|
|
|
echo "rootdev=${BOOT_PART}" >> "/boot/efi/uEnv.txt"
|
|
|
|
sed -i "s/setenvrootdev/setenv rootdev \"${BOOT_PART}\"/" "/boot/efi/boot.cmd"
|
2023-10-07 16:22:18 +00:00
|
|
|
|
2023-10-15 03:36:37 +00:00
|
|
|
mkimage -A arm -T ramdisk -C none -n uInitrd -d /boot/initramfs.img /boot/uInitrd
|
2023-10-08 11:32:56 +00:00
|
|
|
mkimage -C none -A arm -T script -d /boot/efi/boot.cmd /boot/efi/boot.scr
|