filelist/hookscripts: use the correct path for scripts
This commit is contained in:
@@ -100,8 +100,8 @@ func main() {
|
|||||||
hookdirs.New("/etc/mkinitfs/dirs"),
|
hookdirs.New("/etc/mkinitfs/dirs"),
|
||||||
hookfiles.New("/usr/share/mkinitfs/files"),
|
hookfiles.New("/usr/share/mkinitfs/files"),
|
||||||
hookfiles.New("/etc/mkinitfs/files"),
|
hookfiles.New("/etc/mkinitfs/files"),
|
||||||
hookscripts.New("/usr/share/mkinitfs/hooks"),
|
hookscripts.New("/usr/share/mkinitfs/hooks", "/hooks"),
|
||||||
hookscripts.New("/etc/mkinitfs/hooks"),
|
hookscripts.New("/etc/mkinitfs/hooks", "/hooks"),
|
||||||
modules.New(strings.Fields(devinfo.ModulesInitfs), "/usr/share/mkinitfs/modules"),
|
modules.New(strings.Fields(devinfo.ModulesInitfs), "/usr/share/mkinitfs/modules"),
|
||||||
modules.New([]string{}, "/etc/mkinitfs/modules"),
|
modules.New([]string{}, "/etc/mkinitfs/modules"),
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
@@ -116,8 +116,8 @@ func main() {
|
|||||||
if err := generateArchive("initramfs-extra", compressionFormat, compressionLevel, workDir, []filelist.FileLister{
|
if err := generateArchive("initramfs-extra", compressionFormat, compressionLevel, workDir, []filelist.FileLister{
|
||||||
hookfiles.New("/usr/share/mkinitfs/files-extra"),
|
hookfiles.New("/usr/share/mkinitfs/files-extra"),
|
||||||
hookfiles.New("/etc/mkinitfs/files-extra"),
|
hookfiles.New("/etc/mkinitfs/files-extra"),
|
||||||
hookscripts.New("/usr/share/mkinitfs/hooks-extra"),
|
hookscripts.New("/usr/share/mkinitfs/hooks-extra", "/hooks-extra"),
|
||||||
hookscripts.New("/etc/mkinitfs/hooks-extra"),
|
hookscripts.New("/etc/mkinitfs/hooks-extra", "/hooks-extra"),
|
||||||
modules.New([]string{}, "/usr/share/mkinitfs/modules-extra"),
|
modules.New([]string{}, "/usr/share/mkinitfs/modules-extra"),
|
||||||
modules.New([]string{}, "/etc/mkinitfs/modules-extra"),
|
modules.New([]string{}, "/etc/mkinitfs/modules-extra"),
|
||||||
osksdl.New(devinfo.MesaDriver),
|
osksdl.New(devinfo.MesaDriver),
|
||||||
|
@@ -9,13 +9,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type HookScripts struct {
|
type HookScripts struct {
|
||||||
|
destPath string
|
||||||
scriptsDir string
|
scriptsDir string
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new HookScripts that will use the given path to provide a list
|
// New returns a new HookScripts that will use the given path to provide a list
|
||||||
// of script files.
|
// of script files. The destination for each script it set to destPath, using
|
||||||
func New(scriptsDir string) *HookScripts {
|
// the original file name.
|
||||||
|
func New(scriptsDir string, destPath string) *HookScripts {
|
||||||
return &HookScripts{
|
return &HookScripts{
|
||||||
|
destPath: destPath,
|
||||||
scriptsDir: scriptsDir,
|
scriptsDir: scriptsDir,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,7 +35,8 @@ func (h *HookScripts) List() (*filelist.FileList, error) {
|
|||||||
}
|
}
|
||||||
for _, file := range fileInfo {
|
for _, file := range fileInfo {
|
||||||
path := filepath.Join(h.scriptsDir, file.Name())
|
path := filepath.Join(h.scriptsDir, file.Name())
|
||||||
files.Add(path, path)
|
log.Printf("-- Including script: %s\n", path)
|
||||||
|
files.Add(path, filepath.Join(h.destPath, file.Name()))
|
||||||
}
|
}
|
||||||
return files, nil
|
return files, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user