cmd/mkinitfs: use filelist/hookfiles
This commit is contained in:
@@ -18,9 +18,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/archive"
|
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/archive"
|
||||||
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/filelist/osksdl"
|
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/filelist/hookfiles"
|
||||||
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/filelist/hookscripts"
|
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/filelist/hookscripts"
|
||||||
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/filelist/modules"
|
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/filelist/modules"
|
||||||
|
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/filelist/osksdl"
|
||||||
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/misc"
|
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/misc"
|
||||||
"gitlab.com/postmarketOS/postmarketos-mkinitfs/pkgs/deviceinfo"
|
"gitlab.com/postmarketOS/postmarketos-mkinitfs/pkgs/deviceinfo"
|
||||||
)
|
)
|
||||||
@@ -355,15 +356,12 @@ func getInitfsExtraFiles(devinfo deviceinfo.DeviceInfo) (files []string, err err
|
|||||||
// Hook files & scripts
|
// Hook files & scripts
|
||||||
if misc.Exists("/etc/postmarketos-mkinitfs/files-extra") {
|
if misc.Exists("/etc/postmarketos-mkinitfs/files-extra") {
|
||||||
log.Println("- Including hook files")
|
log.Println("- Including hook files")
|
||||||
var hookFiles []string
|
hookFiles := hookfiles.New("/etc/postmarketos-mkinitfs/files-extra")
|
||||||
hookFiles, err := getHookFiles("/etc/postmarketos-mkinitfs/files-extra")
|
|
||||||
if err != nil {
|
if list, err := hookFiles.List(); err != nil {
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if filelist, err := getFiles(hookFiles, true); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
files = append(files, filelist...)
|
files = append(files, list...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -404,14 +402,12 @@ func getInitfsFiles(devinfo deviceinfo.DeviceInfo) (files []string, err error) {
|
|||||||
// Hook files & scripts
|
// Hook files & scripts
|
||||||
if misc.Exists("/etc/postmarketos-mkinitfs/files") {
|
if misc.Exists("/etc/postmarketos-mkinitfs/files") {
|
||||||
log.Println("- Including hook files")
|
log.Println("- Including hook files")
|
||||||
if hookFiles, err := getHookFiles("/etc/postmarketos-mkinitfs/files"); err != nil {
|
hookFiles := hookfiles.New("/etc/postmarketos-mkinitfs/files")
|
||||||
|
|
||||||
|
if list, err := hookFiles.List(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
if filelist, err := getFiles(hookFiles, true); err != nil {
|
files = append(files, list...)
|
||||||
return nil, err
|
|
||||||
} else {
|
|
||||||
files = append(files, filelist...)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user