cmd/mkinitfs: drop getHookFiles
This commit is contained in:
@@ -4,10 +4,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"errors"
|
"errors"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
@@ -138,35 +136,6 @@ func bootDeploy(workDir string, outDir string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getHookFiles(filesdir string) (files []string, err error) {
|
|
||||||
fileInfo, err := os.ReadDir(filesdir)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("getHookFiles: unable to read hook file dir: %w", err)
|
|
||||||
}
|
|
||||||
for _, file := range fileInfo {
|
|
||||||
path := filepath.Join(filesdir, file.Name())
|
|
||||||
f, err := os.Open(path)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("getHookFiles: unable to open hook file: %w", err)
|
|
||||||
|
|
||||||
}
|
|
||||||
defer f.Close()
|
|
||||||
log.Printf("-- Including files from: %s\n", path)
|
|
||||||
s := bufio.NewScanner(f)
|
|
||||||
for s.Scan() {
|
|
||||||
if filelist, err := misc.GetFiles([]string{s.Text()}, true); err != nil {
|
|
||||||
return nil, fmt.Errorf("getHookFiles: unable to add file %q required by %q: %w", s.Text(), path, err)
|
|
||||||
} else {
|
|
||||||
files = append(files, filelist...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err := s.Err(); err != nil {
|
|
||||||
return nil, fmt.Errorf("getHookFiles: uname to process hook file %q: %w", path, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return files, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func getInitfsExtraFiles(devinfo deviceinfo.DeviceInfo) (files []string, err error) {
|
func getInitfsExtraFiles(devinfo deviceinfo.DeviceInfo) (files []string, err error) {
|
||||||
log.Println("== Generating initramfs extra ==")
|
log.Println("== Generating initramfs extra ==")
|
||||||
binariesExtra := []string{
|
binariesExtra := []string{
|
||||||
|
Reference in New Issue
Block a user