Modify ubnt router firmware

When we upgrade ubntwhen the file system to make some changes before the router, we downloaded the firmware is often the tarfile, which is actually a package, can be used directly zip open, open real firmware where the file is squashfs.tmp, this document is the real The firmware is in squashfs format. If we want to modify the firmware, we need to decompress the squashfs file first, then package it, and then flash the machine.
To EdgeRouter ER-X/ER-X-SFP/EP-R6: 固件 v1.10.11an example

tar -xvf  ER-e50.v1.10.11.5274269.tar
unsquashfs  squashfs.tmp

At this time, a squashfs-rootfolder will appear next to the directory at the same level , which is the uncompressed file. If you want to change anything, you can change it here. For more options, enter unsquashfs --help

Repack after modification.

mksquashfs squashfs-root/ squashfs.tmp
md5sum squashfs.tmp >squashfs.tmp.md5

Finally squashfs.tmpand squashfs.tmp.md5replace the original tar package will be the same name as the file is complete modified image.

Published 57 original articles · praised 0 · visits 2186

Guess you like

Origin blog.csdn.net/zhidc/article/details/105282509