scripts: mkbootimg_rpi4.sh: Remove rename for kernel7l.img.
[platform/kernel/linux-rpi.git] / scripts / mkbootimg_rpi4.sh
1 #!/bin/bash
2
3 BOOT_PATH="rpi4/boot"
4 USER_ID=`id -u`
5 GROUP_ID=`id -g`
6
7 rm -f boot.img
8 rm -rf tmp
9 mkdir tmp
10
11 # Create boot.img
12 mkfs.vfat -F 16 -C -n BOOT boot.img 65536
13 sudo mount -o loop,uid=$USER_ID,gid=$GROUP_ID,showexec boot.img ./tmp
14
15 cp -a $BOOT_PATH/config.txt ./tmp
16 cp -a $BOOT_PATH/LICENCE.broadcom ./tmp
17 cp -a $BOOT_PATH/bootcode.bin ./tmp
18 cp -a $BOOT_PATH/start*.elf ./tmp
19 cp -a $BOOT_PATH/fixup*.dat ./tmp
20 cp -a $BOOT_PATH/cmdline.txt ./tmp
21 cp -a arch/arm/boot/zImage ./tmp
22 cp -a arch/arm/boot/dts/bcm*.dtb ./tmp
23
24 sync
25 sudo umount tmp
26
27 rm -f modules.img
28 mkdir -p tmp/lib/modules
29
30 # Create modules.img
31 dd if=/dev/zero of=modules.img bs=1024 count=20480
32 mkfs.ext4 -q -F -t ext4 -b 1024 -L modules modules.img
33 sudo mount -o loop modules.img ./tmp/lib/modules
34
35 sudo make modules_install ARCH=arm INSTALL_MOD_PATH=./tmp INSTALL_MOD_STRIP=1 CROSS_COMPILE=arm-linux-gnueabi-
36
37 sudo -n chown root:root ./tmp/lib/modules -R
38
39 sync
40 sudo umount tmp/lib/modules
41
42 rm -rf tmp