With Buildroot I'm making images for my Embedded Linux Hardware. Mainly I'm trying to speed up the boot sequence (and on the way lower the memory usage), where I've tried many techniques successfully.
What I'd like to do: Recently I've heared about removing duplicated files in a directory (by e.g. replacing those files with symbolic links) and I'd like to apply this method to my rootfs
The surroundings: With Buildroot I can have many different types of rootfs formats (cramfs, cpio, ext2/3/4, etc.), which are created during make as 1 (packed) file (e.g.: rootfs.cpio). Now I don't really know how to:
- open up the image
- remove duplicated files (well I know how to remove duplicated files in general)
- pack the rootfs again - so that I still can use it to flash and execute it on my hardware
Maybe it's not even possible at all. I believe at least when using static libraries, many files can be replaced.
Has somebody an idea?
md5sumof files to find duplicates. I don't know much about embedded systems, but I know that specialized filesystems such assquashfsdo this kind of deduplication automatically. You might want to consider "hard" links instead of symbolic ones in case of picky software that expects to find a real binary.