I'm creating a QEMU startup script in which I compile a rootfs to cpio.gz each time I launch the env. This is fine for the moment, but when the rootfs gets bigger in size, it is going to be a problem. Is there any way to check if a given directory structure and a compiled xxx.cpio.gz are different? I mean, if a file is added to the base rootfs directory structure, then a new cpio.gz must be created, but if its not the case, the one compiled in a previous launch would be fine.
Thanks in advance.
                        
You can use
diffbetween the rootfs dir and the cpio.gz to find files that exist only in the rootfs dir.For example, given the following directories
aandb:the output will be:
Then you can know which files to copy instead of copying the whole directory. Note that
diffhas many options, so be sure runningdiff --helpbefore using it.