RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
...
In other terminal clone https://github.com/frank-w/u-boot/tree/mtk-atf, and copy all u-boot.* files from existing generated folder to this specific folder folder and make below mentioned changes, then execute build.sh script.
Build instructions for SD image for BPIR4.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
repodiff init --ugit https://code.rdkcentral.com/r/manifests -b kirkstone -m rdkb-bpi-extsrc.xml repo sync -j `nproc` --no-clone-bundle --no-tags MACHINE=bananapi4-rdk-broadband source meta-cmf-bananapi/setup-environment-refboard-rdkb #After giving machine command select the option based of your flashing mode. # Option 1 to generate sdcard image. jenkins@build-yocto-persistent-rdkm-hkumar343:~/jenkinsroot/workspace/Heam/BPIR4_SD$ MACHINE=bananapi4-rdk-broadband source meta-cmf-bananapi/setup-environment-refboard-rdkb You had no conf/local.conf file. This configuration file has therefore been created for you from /home/jenkins/jenkinsroot/workspace/Heam/BPIR4_SD/meta-rdk/conf/local.conf.sample You may wish to edit it to, for example, select a different MACHINE (target hardware). See conf/local.conf for more information as common configuration options are commented. You had no conf/bblayers.conf file. This configuration file has therefore been created for you from /home/jenkins/jenkinsroot/workspace/Heam/BPIR4_SD/meta-rdk/conf/bblayers.conf.sample To add additional metadata layers into your configuration please add entries to conf/bblayers.conf. The Yocto Project has extensive documentation about OE including a reference manual which can be found at: https://docs.yoctoproject.org For more information about OpenEmbedded see the website: https://www.openembedded.org/ Common targets are: core-image-minimal rdk-oss-image rdk-generic-hybrid-image rdk-generic-mediaclient-image rdk-generic-broadband-image rdk-generic-camera-image rdk-generic-broadband-tdk-image rdk-generic-broadband-dev-image rdk-generic-hybrid-dev-image rdk-generic-mediaclient-dev-image You can also run generated qemu images with a command like 'runqemu qemuarm' Configuration files have been created for the following configuration: DISTRO: rdkb MACHINE: bananapi4-rdk-broadband Manifest Name = rdkb-bpi-extsrc.xml kirkstone tune-cortexa53.inc kirkstone whitelist.inc ######################################################### ### Which Format image you want to generate for BPIR4 ### ######################################################### 1) SD 2) EMMC 3) NOR Choose image format(1-SD, 2-EMMC, 3-NOR): 1 bitbake rdk-generic-broadband-image |
Image generating steps for BPIR4
-Execute script in build folder to generate final sdcard image.
a/build.sh b/build.sh
index 6939bd1ee87..4a308ff03ac 100755
--- a/build.sh
+++ b/build.sh
@@ -3,9 +3,9 @@ export LANG=C
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
-board="bpi-r3"
+#board="bpi-r3"
#board="bpi-r64"
-#board="bpi-r4"
+board="bpi-r4"
device="sdmmc"
#device="emmc"
#device="spim-nand"
|
After completion of script execution we can see bl2.img and fip.bin files will be generated in build/mt7988/release path.
heam@Dell-OptiPlex-9020:~/bootloader/atf/u-boot/build/mt7988/release$ ls
bl2 bl2.bin bl2.img bl31 bl31.bin fdts fip.bin lib libc libfdt libwrapper romlib
2)Generate kernel and rdkb rootfs by following below mentioned build instructions where bl2.img and fip.bin files will be include which were generated using above mentioned u-boot code
Build instructions for SD image for BPIR4.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
repo init -u https://code.rdkcentral.com/r/manifests -b kirkstone -m rdkb-bpi-extsrc.xml
repo sync -j `nproc` --no-clone-bundle --no-tags
#Include PR mentioned changes to meta-cmf-bananapi PR: "https://github.com/rdkcentral/meta-cmf-bananapi/pull/27"
MACHINE=bananapi4-rdk-broadband source meta-cmf-bananapi/setup-environment-refboard-rdkb
#After giving machine command select the option based of your flashing mode.
# Option 1 to generate sdcard image.
jenkins@build-yocto-persistent-rdkm-hkumar343:~/jenkinsroot/workspace/Heam/BPIR4_SD$ MACHINE=bananapi4-rdk-broadband source meta-cmf-bananapi/setup-environment-refboard-rdkb
You had no conf/local.conf file. This configuration file has therefore been
created for you from /home/jenkins/jenkinsroot/workspace/Heam/BPIR4_SD/meta-rdk/conf/local.conf.sample
You may wish to edit it to, for example, select a different MACHINE (target
hardware). See conf/local.conf for more information as common configuration
options are commented.
You had no conf/bblayers.conf file. This configuration file has therefore been
created for you from /home/jenkins/jenkinsroot/workspace/Heam/BPIR4_SD/meta-rdk/conf/bblayers.conf.sample
To add additional metadata layers into your configuration please add entries
to conf/bblayers.conf.
The Yocto Project has extensive documentation about OE including a reference
manual which can be found at:
https://docs.yoctoproject.org
For more information about OpenEmbedded see the website:
https://www.openembedded.org/
Common targets are:
core-image-minimal
rdk-oss-image
rdk-generic-hybrid-image
rdk-generic-mediaclient-image
rdk-generic-broadband-image
rdk-generic-camera-image
rdk-generic-broadband-tdk-image
rdk-generic-broadband-dev-image
rdk-generic-hybrid-dev-image
rdk-generic-mediaclient-dev-image
You can also run generated qemu images with a command like 'runqemu qemuarm'
Configuration files have been created for the following configuration:
DISTRO: rdkb
MACHINE: bananapi4-rdk-broadband
Manifest Name = rdkb-bpi-extsrc.xml
kirkstone tune-cortexa53.inc
kirkstone whitelist.inc
#########################################################
### Which Format image you want to generate for BPIR4 ###
#########################################################
1) SD
2) EMMC
3) NOR
Choose image format(1-SD, 2-EMMC, 3-NOR): 1
bitbake rdk-generic-broadband-image |
Image generating steps for BPIR4
bpir4_sd_image_creater.sh" script file,
-After completion of build go to deploy folder and execute "to generate final sdcard image.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
bananapi4-rdk-broadband$ ./bpir4_sd_image_creater.sh
create bpi-r4_sdmmc_rdk-broadband-image.img
run losetup to assign image bpi-r4_sdmmc_rdk-broadband-image.img to loopdev /dev/loop24 (loop24)
Creating new GPT entries in memory.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 0
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 1
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 2
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 3
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
480+1 records in
480+1 records out
246069 bytes (246 kB, 240 KiB) copied, 0.165271 s, 1.5 MB/s
562+1 records in
562+1 records out
288153 bytes (288 kB, 281 KiB) copied, 0.0626902 s, 4.6 MB/s
mkfs.fat 4.2 (2021-01-31)
mke2fs 1.46.5 (30-Dec-2021)
Discarding device blocks: done
Creating filesystem with 1689600 4k blocks and 422656 inodes
Filesystem UUID: 2ec68480-e1a2-4c40-aadb-b739a3edf4af
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
539116+0 records in
539116+0 records out
276027392 bytes (276 MB, 263 MiB) copied, 2.14511 s, 129 MB/s
packing image...
heam@Dell-OptiPlex-9020:~/Downloads/BPIR4_latest_23_oct/bananapi4-rdk-broadband$ ls
atf
bpir4_sd_image_creater.sh
bpi-r4_sdmmc_rdk-broadband-image.img.gz
fitImage
fitImage-1-5.4.271+git0+feeb59687b_3fec063b05-r0-bananapi4-rdk-broadband-20241023065547.bin
fitImage-bananapi4-rdk-broadband.bin
fitImage-its-1-5.4.271+git0+feeb59687b_3fec063b05-r0-bananapi4-rdk-broadband-20241023065547.its
fitImage-its-bananapi4-rdk-broadband
fitImage-linux.bin-1-5.4.271+git0+feeb59687b_3fec063b05-r0-bananapi4-rdk-broadband-20241023065547.bin
fitImage-linux.bin-bananapi4-rdk-broadband
hash-summary
modules-1-5.4.271+git0+feeb59687b_3fec063b05-r0-bananapi4-rdk-broadband-20241023065547.tgz
modules-bananapi4-rdk-broadband.tgz
mt7988a-bananapi-bpi-r4-sd-1-5.4.271+git0+feeb59687b_3fec063b05-r0-bananapi4-rdk-broadband-20241023065547.dtb
mt7988a-bananapi-bpi-r4-sd-bananapi4-rdk-broadband.dtb
mt7988a-bananapi-bpi-r4-sd.dtb
rdkb-generic-broadband-image_rdk-next_20241023114221.bin.ext4
rdkb-generic-broadband-image_rdk-next_20241023114221.bin.manifest
rdkb-generic-broadband-image_rdk-next_20241023114221.bin.squashfs-xz
rdkb-generic-broadband-image_rdk-next_20241023114221.testdata.json
rdk-generic-broadband-image-bananapi4-rdk-broadband.ext4
rdk-generic-broadband-image-bananapi4-rdk-broadband.manifest
rdk-generic-broadband-image-bananapi4-rdk-broadband.squashfs-xz
rdk-generic-broadband-image-bananapi4-rdk-broadband-sysupgrade.bin
rdk-generic-broadband-image-bananapi4-rdk-broadband.testdata.json
heam@Dell-OptiPlex-9020:~/Downloads/BPIR4_latest_23_oct/bananapi4-rdk-broadband$
|
After completion of script execution final image will be generated with
bpi-r4_sdmmc_rdk-broadband-image.img.gz image name.
Flashing Steps of BPIR4 image to sdcard.
-Image can be flashed to sdcard using dd command or balenaEtcher.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#!/bin/bash
board="bpi-r4"
device="sdmmc"
OS="rdk-broadband-image"
IMGDIR=.
IMGNAME=${board}_${device}_${OS} --> Image name format
LDEV=`sudo losetup -f` | ||||||
Code Block | ||||||
| ||||||
bananapi4-rdk-broadband$ ./bpir4_sd_image_creater.sh create bpi-r4_sdmmc_rdk-broadband-image.img run losetup to assign image bpi-r4_sdmmc_rdk-broadband-image.img to loopdev /dev/loop24 (loop24) Creating new GPT entries in memory. Warning: The kernel is still using the old partition table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) The operation has completed successfully. Setting name! partNum is 0 Warning: The kernel is still using the old partition table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) The operation has completed successfully. Setting name! partNum is 1 Warning: The kernel is still using the old partition table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) The operation has completed successfully. Setting name! partNum is 2 Warning: The kernel is still using the old partition table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) The operation has completed successfully. Setting name! partNum is 3 Warning: The kernel is still using the old partition table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) The operation has completed successfully. 480+1 records in 480+1 records out 246069 bytes (246 kB, 240 KiB) copied, 0.165271 s, 1.5 MB/s 562+1 records in 562+1 records out 288153 bytes (288 kB, 281 KiB) copied, 0.0626902 s, 4.6 MB/s mkfs.fat 4.2 (2021-01-31) mke2fs 1.46.5 (30-Dec-2021) Discarding device blocks: done Creating filesystem with 1689600 4k blocks and 422656 inodes Filesystem UUID: 2ec68480-e1a2-4c40-aadb-b739a3edf4af Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Allocating group tables: done --> Command to find available loob device in pc. REALSIZE=7456 Writing inode tables: done echo Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done 539116+0 records in 539116+0 records out 276027392 bytes (276 MB, 263 MiB) copied, 2.14511 s, 129 MB/s packing image... heam@Dell-OptiPlex-9020:~/Downloads/BPIR4_latest_23_oct/bananapi4-rdk-broadband$ ls atf bpir4_sd_image_creater.sh bpi-r4_sdmmc_rdk-broadband-image.img.gz fitImage fitImage-1-5.4.271+git0+feeb59687b_3fec063b05-r0-bananapi4-rdk-broadband-20241023065547.bin fitImage-bananapi4-rdk-broadband.bin fitImage-its-1-5.4.271+git0+feeb59687b_3fec063b05-r0-bananapi4-rdk-broadband-20241023065547.its fitImage-its-bananapi4-rdk-broadband fitImage-linux.bin-1-5.4.271+git0+feeb59687b_3fec063b05-r0-bananapi4-rdk-broadband-20241023065547.bin fitImage-linux.bin-bananapi4-rdk-broadband hash-summary modules-1-5.4.271+git0+feeb59687b_3fec063b05-r0-bananapi4-rdk-broadband-20241023065547.tgz modules-bananapi4-rdk-broadband.tgz mt7988a-bananapi-bpi-r4-sd-1-5.4.271+git0+feeb59687b_3fec063b05-r0-bananapi4-rdk-broadband-20241023065547.dtb mt7988a-bananapi-bpi-r4-sd-bananapi4-rdk-broadband.dtb mt7988a-bananapi-bpi-r4-sd.dtb rdkb-generic-broadband-image_rdk-next_20241023114221.bin.ext4 rdkb-generic-broadband-image_rdk-next_20241023114221.bin.manifest rdkb-generic-broadband-image_rdk-next_20241023114221.bin.squashfs-xz rdkb-generic-broadband-image_rdk-next_20241023114221.testdata.json rdk-generic-broadband-image-bananapi4-rdk-broadband.ext4 rdk-generic-broadband-image-bananapi4-rdk-broadband.manifest rdk-generic-broadband-image-bananapi4-rdk-broadband.squashfs-xz rdk-generic-broadband-image-bananapi4-rdk-broadband-sysupgrade.bin rdk-generic-broadband-image-bananapi4-rdk-broadband.testdata.json heam@Dell-OptiPlex-9020:~/Downloads/BPIR4_latest_23_oct/bananapi4-rdk-broadband$ |
...
"create $IMGNAME.img"
dd if=/dev/zero of=$IMGDIR/$IMGNAME.img bs=1M count=$REALSIZE 1> /dev/null 2>&1
LDEV=`sudo losetup -f`
DEV=`echo $LDEV | cut -d "/" -f 3` #mount image to loop device
echo "run losetup to assign image $IMGNAME.img to loopdev $LDEV ($DEV)"
sudo losetup $LDEV $IMGDIR/$IMGNAME.img 1> /dev/null #2>&1
bootstart=17408
bootsize=100
rootsize=6600
bootend=$(( ${bootstart}+(${bootsize}*1024*2)-1 ))
rootstart=$(( ${bootend}+1 ))
rootend=$(( ${rootstart} + (${rootsize}*1024*2) ))
sudo sgdisk -o ${LDEV}
sudo sgdisk -a 1 -n 1:34:8191 -A 1:set:2 -t 1:8300 -c 1:"bl2" ${LDEV}
sudo sgdisk -a 1 -n 2:13312:17407 -A 2:set:63 -t 2:8300 -c 2:"fip" ${LDEV}
sudo sgdisk -a 1024 -n 3:17408:${bootend} -t 3:8300 -c 3:"boot" ${LDEV}
sudo sgdisk -a 1024 -n 4:${rootstart}:${rootend} -t 4:8300 -c 4:"rootfs" ${LDEV}
sudo losetup -d $LDEV
sudo losetup -P $LDEV $IMGDIR/$IMGNAME.img 1> /dev/null #2>&1
sudo dd if=atf/bpi-r4_sdmmc_bl2.img of=${LDEV}p1 conv=notrunc,fsync #1> /dev/null 2>&1
sudo dd if=atf/bpi-r4_sdmmc_fip.bin of=${LDEV}p2 conv=notrunc,fsync #1> /dev/null 2>&1
sudo mkfs.vfat "${LDEV}p3" -n BPI-BOOT #1> /dev/null 2>&1
sudo mkfs.ext4 -O ^metadata_csum,^64bit "${LDEV}p4" -L BPI-ROOT #1> /dev/null 2>&1
sudo mount "${LDEV}p3" /mnt/
sudo cp fitImage /mnt/
sudo cp mt7988a-bananapi-bpi-r4-sd.dtb /mnt/
sudo umount "${LDEV}p3"
sudo dd if=rdk-generic-broadband-image-bananapi4-rdk-broadband.ext4 of=${LDEV}p4
sudo losetup -d $LDEV
echo "packing image..."
gzip $IMGDIR/$IMGNAME.img
|