BPI-SINOVOIP / BPI-R3-OPENWRT-V21.02.3

BPI-R3-OPENWRT-V21.02.3
Other
45 stars 16 forks source link

How to build single image? #1

Open PzxAndHkq opened 1 year ago

PzxAndHkq commented 1 year ago

I have cloned source code, 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. ├── config.buildinfo ├── feeds.buildinfo ├── openwrt-mediatek-mt7986-BPI-R3-EMMC-WAN1-RJ45-initramfs-kernel.bin ├── openwrt-mediatek-mt7986-BPI-R3-EMMC-WAN1-RJ45-squashfs-sysupgrade.bin ├── openwrt-mediatek-mt7986-BPI-R3-EMMC-WAN1-SFP1-initramfs-kernel.bin ├── openwrt-mediatek-mt7986-BPI-R3-EMMC-WAN1-SFP1-squashfs-sysupgrade.bin ├── openwrt-mediatek-mt7986-BPI-R3-NAND-WAN1-RJ45-initramfs-kernel.bin ├── openwrt-mediatek-mt7986-BPI-R3-NAND-WAN1-RJ45-squashfs-factory.bin ├── openwrt-mediatek-mt7986-BPI-R3-NAND-WAN1-RJ45-squashfs-sysupgrade.bin ├── openwrt-mediatek-mt7986-BPI-R3-NAND-WAN1-SFP1-initramfs-kernel.bin ├── openwrt-mediatek-mt7986-BPI-R3-NAND-WAN1-SFP1-squashfs-factory.bin ├── openwrt-mediatek-mt7986-BPI-R3-NAND-WAN1-SFP1-squashfs-sysupgrade.bin ├── openwrt-mediatek-mt7986-BPI-R3-NOR-WAN1-RJ45-initramfs-kernel.bin ├── openwrt-mediatek-mt7986-BPI-R3-NOR-WAN1-RJ45-squashfs-sysupgrade.bin ├── openwrt-mediatek-mt7986-BPI-R3-NOR-WAN1-SFP1-initramfs-kernel.bin ├── openwrt-mediatek-mt7986-BPI-R3-NOR-WAN1-SFP1-squashfs-sysupgrade.bin ├── openwrt-mediatek-mt7986-BPI-R3-SD-WAN1-RJ45-initramfs-kernel.bin ├── openwrt-mediatek-mt7986-BPI-R3-SD-WAN1-RJ45-squashfs-sysupgrade.bin ├── openwrt-mediatek-mt7986-BPI-R3-SD-WAN1-SFP1-initramfs-kernel.bin ├── openwrt-mediatek-mt7986-BPI-R3-SD-WAN1-SFP1-squashfs-sysupgrade.bin ├── openwrt-mediatek-mt7986.manifest ├── packages ├── sha256sums └── version.buildinfo

Which should I use?

heartbreaker0 commented 1 year ago

Maybe, I just mean maybe, if you are going to boot from SD card, you can try these two files:

openwrt-mediatek-mt7986-BPI-R3-SD-WAN1-RJ45-initramfs-kernel.bin openwrt-mediatek-mt7986-BPI-R3-SD-WAN1-SFP1-initramfs-kernel.bin

heartbreaker0 commented 1 year ago

The naming convention for these files appears to be:

openwrt-mediatek-mt7986-BPI-R3|||||The name of OS -SD|||||boot device -WAN1-SFP1|||||which port is WAN1(RJ45 or SFP1) -initramfs-kernel.bin|||||image type

mosquito commented 1 year ago

@PzxAndHkq I wrote a python script with which I write the compiled images to the sd card.

You will need python 3.9+ and sfdisk binary.

To get started, download and extract files from following archive.

write-sd.zip

Following files are extracted from the original image and compressed with gz, decompressing them is not necessarily.

Don't let the lack of file number 5 and 7 bother you, that's right.

After you have prepared everything, insert the sd card into the computer and find out its name, for example it will be /dev/sdx

Now you need to run the script like this:

sudo python3 write-sd.py /dev/sdx \
   -K ~/path/to/openwrt-21.02.3-mediatek-mt7986-BPI-R3-SD-WAN1-RJ45-squashfs-sysupgrade.bin \
   -R ~/path/to/openwrt-21.02.3-mediatek-mt7986-BPI-R3-SD-WAN1-RJ45-squashfs-sysupgrade.bin

After this, the sd card will be formatted and the bootloader and everything necessary will be written to it so that the device can be booted from it.

@heartbreaker0 I think you could add this method to README.md

zuowei8 commented 1 year ago

you can find the single image from the below folder "build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7986/"

zuowei8 commented 1 year ago

mtk-bpi-r3-EMMC.img, mtk-bpi-r3-SD.img

vnpraveendesu commented 2 months ago

@zuowei8 I have update kernel version from 5.4.185 to 5.4.225 and resolved patch conflict . Images are generated in "build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7986/" and flashed the image into SD-Card.

Generated openwrt image on bananapi broad keeps on rebooting due to the below error [ 1.734416] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 1.746381] SMP: stopping secondary CPUs [ 1.750287] Kernel Offset: disabled [ 1.753758] CPU features: 0x00002,20002008 [ 1.757835] Memory Limit: none [ 1.760874] Rebooting in 1 seconds..

Please let me know how to resolve above error