Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2761535e12 | ||
|
1a72589f6f | ||
|
df0b5d66d7 |
12
main.go
12
main.go
@@ -151,25 +151,27 @@ func exists(file string) bool {
|
||||
func getHookFiles(filesdir string) (files []string, err error) {
|
||||
fileInfo, err := os.ReadDir(filesdir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
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, err
|
||||
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 := getFiles([]string{s.Text()}, true); err != nil {
|
||||
return nil, fmt.Errorf("unable to find file %q required by %q", s.Text(), path)
|
||||
return nil, fmt.Errorf("getHookFiles: unable to find file %q required by %q", s.Text(), path)
|
||||
} else {
|
||||
files = append(files, filelist...)
|
||||
}
|
||||
}
|
||||
if err := s.Err(); err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("getHookFiles: uname to process hook file %q: %w", path, err)
|
||||
}
|
||||
}
|
||||
return files, nil
|
||||
@@ -485,7 +487,7 @@ func getInitfsFiles(devinfo deviceinfo.DeviceInfo) (files []string, err error) {
|
||||
"/bin/sh",
|
||||
"/bin/busybox-extras",
|
||||
"/usr/sbin/telnetd",
|
||||
"/sbin/kpartx",
|
||||
"/usr/sbin/kpartx",
|
||||
"/etc/deviceinfo",
|
||||
"/usr/bin/unudhcpd",
|
||||
}
|
||||
|
Reference in New Issue
Block a user