Exclude /var/lib/dkms/* from squashfs These files and directories are created by dkms while it builds modules on demand and are only relevant during the module build/installation process. The .ko files are then installed in /lib/modules; shipping /var/lib/dkms/* inside the squashfs only takes up space without providing a tangible benefit.