在下载openwrt系统时,经常能看到initramfs-kernel.bin,squashfs-factory.bin,squashfs-sysupgrade.bin
等结尾的文件,factory适用于从原厂系统刷到openwrt,sysupgrade则是从openwrt刷到openwrt(已经是openwrt系统,在openwrt系统中更新自己),squashfs则是一种文件系统,适用于嵌入式设备。那么initramfs-kernel又是什么呢。
initramfs是放在内存RAM中的rootfs 映像文件,跟kernel放在一起。一般来说用不到initramfs-kernel.bin来刷机,因为启动后,所有的配置在路由器重启后都不能保留(毕竟ram文件系统,所有文件放在ram中,断电就没了)。但也有用到initramfs-kernel.bin的时候,就是在移植openwrt系统的时候,没有设备上的flash闪存的驱动的时候。
The initramfs
OpenWRT/LEDE kernel builds are including the rootfs image into initramfs
, attaching it to the kernel so it will put the filesystem in a ramdisk during bootup and utilize it as /
. You don't need such builds if the regular flash-based storage works for you, as it won't allow any persistent configuration by default. Such a configuration is useful during initial OpenWRT/LEDE porting efforts when you don't have the flash driver configured to use the flash chip on the device.
https://unix.stackexchange.com/questions/385863/wrt-openwrt-lede-initramfs