Preface#
In downloading OpenWrt, what does the filename format actually mean, and how should I choose? Let’s briefly discuss the logic behind it, and I believe you will be able to make the right choice after reading.
Including filesystem, version number, format
SquashFS#
First, let's briefly understand that SquashFS is a read-only compressed filesystem that can significantly reduce the size of the filesystem. It is commonly used in embedded systems, including routers.
Specifically, SquashFS Overlay consists of two parts:
- LOWER
This is the basic read-only SquashFS filesystem, which contains all the default files of the operating system.
- UPPER
This is a writable overlay used to store all files that require write access, such as configuration files.
::: gallery
:::
When OpenWrt needs to access a certain file, it first looks in UPPER; if not found, it accesses the read-only SquashFS in LOWER. If it needs to write a file, it writes it into the UPPER overlay.
By combining the read-only SquashFS and the writable UPPER overlay, OpenWrt achieves a writable root filesystem while maintaining the space efficiency and reliability advantages of SquashFS.
This architecture gives OpenWrt the advantages of a smaller firmware size and a secure and reliable system, while also allowing for some runtime configuration modifications.
However, the downside is that most firmware will have fixed storage space, and generally, it requires expansion operations on the storage space size by creating EXT4 partitions to mount for expansion.
Purpose#
I have prepared the names of three firmware versions: CatWrt, Lean's LEDE, and ImmoralWrt.
CatWrt.v23.8.x86_64-squashfs-combined-efi.img.gz
openwrt-x64-R23.4.1-squashfs-combined-efi.img.gz
immortalwrt-23.05.1-x86-64-generic-squashfs-combined-efi.img.gz
CatWrt.v23.8.mt798x-filogic-xiaomi_redmi-router-ax6000-squashfs-sysupgrade.bin
CatWrt.v23.2.ARM-rockchip-armv8-fastrhino_r66s-squashfs-sysupgrade.img.gz
The different firmware names are easy to identify, so I won't elaborate further;
Name#
x86_64
and x64
refer to the 64-bit image of the x86 architecture, and generally, firmware is not 32-bit;
R23.4
and v23.8
indicate the version number, the closer they match, the newer it is;
generic
means a generic version;
combined
means a combined version including the boot system, etc.;
xiaomi_redmi-router-ax6000
and fastrhino_r68s
are product names and models, non-x86 models;
mt798x-filogic
and ramips-mt7621
refer to chip architectures or names or series;
Boot & Startup#
We recommend that all new machines use EFI for booting; subsequent tutorials will be primarily based on EFI;
New machines default to UEFI, and installing the BIOS version may cause boot issues; you can ask the customer service of the machine seller how to enable UEFI.
squashfs-combined
is for traditional BIOS boot;
squashfs-combined-efi
is for EFI boot;
EFI is an older version than UEFI that supports high-definition boot; older hardware or virtual machines may consider traditional BIOS boot for convenience, and general BIOS versions will not be marked separately;
Format#
The rootfs.img.gz
file is suitable for Docker and LXC container files, allowing for containerized deployment of the system;
The img.gz
file is a compressed file that can be decompressed into an img file, commonly used during downloads to reduce network load, and paired with online upgrades;
The img
file is an image used for single systems on physical machines or writing to virtual machines, which is the most common format;
It is recommended to use the IMG Writing Tool for installation in WEPE or StarWind V2V Converter for installation in virtual machines;
The vmdk
file is a virtual hard disk file for VMware virtual machines, which can also be used by other systems (PVE);
The qcow2
file is a virtual hard disk file for PVE or KVM virtual machines, which can be imported into PVE and converted to RAW files for use;
The vhdx
file is a virtual hard disk file for Hyper-V virtual machines, suitable for hosts running Windows Pro;
bin
is a binary image file
initramfs-kernel
is a temporary filesystem that includes the Linux kernel to complete basic functions, used to update the complete version of squashfs in the system;
squashfs
is the filesystem using SquashFS Overlay
rootfs0
is the root filesystem, similar to sqfs but without the kernel
kernel1
is the kernel
Partition Layout#
::: warning
Only for mt798x, requires UBOOT support; here is an example using Redmi AX6000.
:::
stock layout
is the original OpenWrt partition, a&b are the smallest partitions, roughly 50-60 MB when halved;
OpenWrt U-Boot layout
is the large partition version of 110MB, which is used by CatWrt;
custom U-Boot layout
can also be called ubootmod, slightly larger than the large partition version at 122.5MB, not including bad block management NMBM.
Putting It All Together#
CatWrt.v23.8.x86_64-squashfs-combined-efi.img.gz
= CatWrt distribution OpenWrt version v23.8 (released in August 2023), suitable for architecture x86 64-bit, the filesystem is a combined firmware of sqfs, using EFI for booting (high-definition boot), packaged in img, and finally compressed by gz.
CatWrt.v23.8.mt798x-filogic-xiaomi_redmi-router-ax6000-squashfs-sysupgrade.bin
= CatWrt distribution OpenWrt version v23.8 (released in August 2023), suitable for chip mt798x; here, x refers to a collection of various processors under mt79, which is the sqfs firmware for Redmi AX6000, upgraded in UBOOT or during system upgrades.
This article is synchronized and updated to xLog by Mix Space. The original link is https://www.miaoer.net/posts/blog/format-openwrt