Amit Pundir | c7afae1 | 2024-01-15 22:16:15 +0530 | [diff] [blame] | 1 | KERNEL_OUTDIR=.output |
| 2 | |
| 3 | # Make wrapper |
| 4 | mu() { |
| 5 | make O=$KERNEL_OUTDIR CROSS_COMPILE=aarch64-linux-gnu- -j"$(nproc --all)" $@ |
| 6 | } |
| 7 | |
| 8 | # Make and generate boot image wrapper |
| 9 | budt() { |
| 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 | } |