File editbootinstall_nxp.sh of Package kiwi-templates-Minimal

#!/bin/bash
set -euxo pipefail

diskname=$1
devname="$2"
loopname="${devname%*p?}"
loopdev=/dev/${loopname#/dev/mapper/*}

#==========================================
# Copy DeviceTree to EFI partition
#------------------------------------------
echo "Installing devicetree files on ESP"
mkdir -p ./mnt-efi
mount ${loopname}p1 ./mnt-efi
cp -v boot/*dtb ./mnt-efi
umount ./mnt-efi
rmdir ./mnt-efi

#==========================================
# The GPT spans the first 33 sectors
# Bootloader starts at sector 64 (32K bytes offset)
# and has size more than 1MB. Pelase make sure that
# first parttion should start at 4096 sector
# see: disk_start_sector in kiwi file
#------------------------------------------

#==========================================
# Installing All-in-one U-Boot/SPL
#------------------------------------------
echo "Installing All-in-one U-Boot/SPL..."
if ! dd if=boot/u-boot-imx8qm-var-som-sim.bin of=$loopdev bs=1K seek=32; then
	echo "Couldn't install SPL on $loopdev"
	exit 1
fi
openSUSE Build Service is sponsored by