archive: create symlinks for /bin, /sbin, /lib (MR 39)

This commit is contained in:
Caleb Connolly
2024-05-16 10:22:30 -07:00
committed by Clayton Craft
parent 014563fdbc
commit af9a0f0ca5

View File

@@ -413,6 +413,12 @@ func (archive *Archive) writeCompressed(path string, mode os.FileMode) (err erro
}
func (archive *Archive) writeCpio() error {
// Just in case
if osutil.HasMergedUsr() {
archive.addSymlink("/bin", "/bin")
archive.addSymlink("/sbin", "/sbin")
archive.addSymlink("/lib", "/lib")
}
// having a transient function for actually adding files to the archive
// allows the deferred fd.close to run after every copy and prevent having
// tons of open file handles until the copying is all done