Reverse mkimage effects to get the original gzip-enabled file

We are developing for a specific embedded device in our company, and part of this is the first root disks that are downloaded to devices via ethernet via netboot. We ran into some problems, and as a result, the original folder with the contents of the original root disks was lost along with its backups, but we still have initrd images that were created using the gzipping contents of the ramdisk which was installed as the local loop device, and then run mkimage in the gzip file. Is there a way to undo the effects of mkimage and get the original gzipped content so that we can restore the original images?

+7
gzip embedded-linux initrd
source share
1 answer

Are you talking about u-boot mkimage? If so, you can restore the original by deleting the first 64 bytes.

dd if=<image> of=<recovered file> bs=64 skip=1 
+6
source share

All Articles