blob: 59cb8b1a1f28c3655e78c96b46b4d4e232994c37 [file] [log] [blame]
Amit Pundirc7afae12024-01-15 22:16:15 +05301KERNEL_OUTDIR=.output
2
3# Make wrapper
4mu() {
5 make O=$KERNEL_OUTDIR CROSS_COMPILE=aarch64-linux-gnu- -j"$(nproc --all)" $@
6}
7
8# Make and generate boot image wrapper
9budt() {
10 mu || return 1
11 rm "$KERNEL_OUTDIR"/u-boot-nodtb.bin.gz 2>/dev/null || true
12 gzip "$KERNEL_OUTDIR"/u-boot-nodtb.bin
13 rm -f /tmp/dt.dtb
14 for DT in "$@"; do
15 cat "$KERNEL_OUTDIR"/arch/arm/dts/"$DT".dtb >> /tmp/dt.dtb
16 done
17 cat $KERNEL_OUTDIR/u-boot-nodtb.bin.gz /tmp/dt.dtb > /tmp/kernel-dtb
18
19 mkbootimg --base '0x00000000' \
20 --kernel_offset '0x00008000' \
21 --ramdisk_offset '0x01000000' \
22 --tags_offset '0x00000100' \
23 --pagesize '4096' \
24 --kernel /tmp/kernel-dtb -o '/tmp/u-boot.img'
25}