I created a task ⚓ T5511 Cleanup of unused directories (and files) in order to shrink image-size (Cleanup of unused directories (and files) in order to shrink image-size) which today got merged (result will show up in next 1.4-rolling release).
That task along with ⚓ T5468 Remove unused manpages to free up space (Remove unused manpages to free up space) will save approx 13 + 11 = 24MB of space - that is the imagesize (iso) will shrink by approx 24MB (compared to the size before T5468 and T5511 were merged).
The files and directories being deleted are those who are either of no use for VyOS (like games, apt-cache etc) or that will be recreated anyway after boot. The result is that the iso-file will be as small as possible and not containing unused files or directories.
My question to the community but also the maintainers if this should be changed from specific deletes into wildcard deletes?
The reason why I choosed specific deletes to begin with is that we dont accidently delete something that shouldnt be deleted or that we wish to remain from the build into the created image.
However that list must be maintained over time and the way to do this properly is to extract the filesystem.squashfs from the iso and then run it through “unsquashfs” as root to get a full decompression.
And then search through that squashfs-root directory and compare with the current list of files and directories to be deleted during build. And finally commit any changes… so somewhat timeconsuming and somebody have to do it.
A more “self-sustained” approach would be to use wildcard deletes instead.
Basically search through squashfs-root and delete any files that matches:
*.log *.bak *.old *.*~
This way only the directories that needs to be deleted along with the above wildcard delete needs to exist in 80-delete-docs.chroot.
So whats your take on specific vs wildcard deletes?
If going the wildcard deletes route, any suggestion for how to properly do it?
I assume a multiline would be prefered in order to avoid number of scans through the chrooted directory.
- Suggestion(s) of file extensions to add to this wildcard delete?