[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. 2022-11-08%20161256

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?