archive,hookfiles: convert paths to usr-merge when necessary (MR 39)

Co-authored-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Clayton Craft
2024-05-16 10:17:59 -07:00
parent af9a0f0ca5
commit 81de8b438d
4 changed files with 78 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import (
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/filelist"
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/misc"
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/osutil"
)
type HookFiles struct {
@@ -64,6 +65,9 @@ func slurpFiles(fd io.Reader) (*filelist.FileList, error) {
}
src, dest, has_dest := strings.Cut(line, ":")
if osutil.HasMergedUsr() {
src = osutil.MergeUsr(src)
}
fFiles, err := misc.GetFiles([]string{src}, true)
if err != nil {