[BPI-R3] How to build single image

I have cloned source code from github, and it has compile successful, but I do not find *.img file in the bin/targets/mediatek/mt7986/, I have these files in that directory.

Which one should I use to flashing the firmware?

I’d use official OpenWrt which by now supports BPi-R3. Ie.

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
make menuconfig
# Select MediaTek ARM -> Filogic -> BananaPi R3
make -j$(nproc)

This will give you an SD card image which can be used to install OpenWrt to either NAND or NOR flash of the BPi-R3. If then booting from NAND, you can also install to eMMC.

I will try it, thanks! By the way, I want to know if I can updating firmware by sysupgrade command?

If you are using official OpenWrt, then yes. sysupgrade commands works with the same *sysupgrade.itb image for all boot media, ie. NOR, NAND and MMC (SD card, eMMC).

I have clone the latest official OpenWrt and compiled it. I used sysypgrade command to upgrading firmware by *.itb file. Also, I have create a new file named my_version under the folder package/base-files/files/etc/, it will indicate that firmware has upgrade successed. But when I using the *.itb file after modifies to upgrade, I don’t find my_version under the /etc folder.

Which step have I missed?

Maybe

make package/base-files/clean

to have the package re-built? If you just want to add files to your build, you can also just use the files/ folder, see https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem#custom_files

Thanks, I will try it.

By the way, I want to confirm that if I do some modifies on the device, it will take effect by updating the *.itb file, am I right?

I don’t really understand what you are trying to do.

If you modify any file on the device, unless it is in the list of files to backup/restore during sysupgrade (ie. /etc/config/* and some more), it will be wiped.

If you place a file in files/ directory in OpenWrt buildroot in will end up in the generated sysupgrade image. Once you flash this image, you will see these files on the device.

Sorry, I mean that modify the device tree, *.dts file. It is about the modification of the kernel.

Ok, now I understand even less. What do you want to modify exactly? Device tree or kernel? Up to now you were talking about modifying files in rootfs…

The reason why I modifying files in rootfs is that my modifies with dts file is not effect. So I use a file to mark my version, to make sure the firmware is upgrade success.

Hey, in the official build there are 2 files for emmc image, a .fib file and a .bin . How do you flash them exactly?

@dangowrt followed your recommendation, using SD image to install to NAND, eMMC succesfully, however, only issue is that the storage is same as SD partition. Isn’t that eMMC should have plenty of space left? Any idea on how to reclaim the space?

emmc-main emmc-software

This should do what you want:

1 Like

@frank-w thank you Frank, good finding, will take time to read it. here is another one that I found.

for anyone who has across same scenario, please follow the link and have a good read.

As the title, I would like to know how img is compiled and generated, such as the mtk-bpi-r3-SD-WAN1-RJ45-20220720-single-image.img on the official website of bpi-rs(https://wiki.banana-pi.org/Banana_Pi_BPI-R3 Release image).

I saw a couple of similar questions, but they didn’t get a response. Why.