blob: 59cb8b1a1f28c3655e78c96b46b4d4e232994c37 [file] [log] [blame]
KERNEL_OUTDIR=.output
# Make wrapper
mu() {
make O=$KERNEL_OUTDIR CROSS_COMPILE=aarch64-linux-gnu- -j"$(nproc --all)" $@
}
# Make and generate boot image wrapper
budt() {
mu || return 1
rm "$KERNEL_OUTDIR"/u-boot-nodtb.bin.gz 2>/dev/null || true
gzip "$KERNEL_OUTDIR"/u-boot-nodtb.bin
rm -f /tmp/dt.dtb
for DT in "$@"; do
cat "$KERNEL_OUTDIR"/arch/arm/dts/"$DT".dtb >> /tmp/dt.dtb
done
cat $KERNEL_OUTDIR/u-boot-nodtb.bin.gz /tmp/dt.dtb > /tmp/kernel-dtb
mkbootimg --base '0x00000000' \
--kernel_offset '0x00008000' \
--ramdisk_offset '0x01000000' \
--tags_offset '0x00000100' \
--pagesize '4096' \
--kernel /tmp/kernel-dtb -o '/tmp/u-boot.img'
}