fixed kmod creation

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2023-09-29 09:37:12 +02:00
committed by Jonathon Anderson
parent 67e526d726
commit 36686d4455
3 changed files with 21 additions and 35 deletions

View File

@@ -289,6 +289,7 @@ func FindFilterFiles(
includeDirs := []string{}
ignoreDirs := []string{}
err = filepath.Walk(".", func(location string, info os.FileInfo, err error) error {
wwlog.Debug(location)
if err != nil {
return err
}
@@ -344,6 +345,8 @@ func FindFilterFiles(
ofiles = append(ofiles, location)
if info.IsDir() {
includeDirs = append(includeDirs, file)
} else {
wwlog.Debug("No matched (%d): %s", i, file)
}
return nil
}
@@ -690,17 +693,7 @@ func BuildFsImage(
if err != nil {
return errors.Wrapf(err, "Failed to create image directory for %s: %s", name, imagePath)
}
wwlog.Debug("Created image directory for %s: %s", name, imagePath)
// TODO: why is this done if the container must already exist?
err = os.MkdirAll(path.Dir(rootfsPath), 0755)
if err != nil {
return errors.Wrapf(err, "Failed to create fs directory for %s: %s", name, rootfsPath)
}
wwlog.Debug("Created fs directory for %s: %s", name, rootfsPath)
cwd, err := os.Getwd()
if err != nil {
return err
@@ -713,7 +706,7 @@ func BuildFsImage(
if err != nil {
return errors.Wrapf(err, "Failed chdir to fs directory for %s: %s", name, rootfsPath)
}
wwlog.Verbose("changed to: %s", rootfsPath)
files, err := FindFilterFiles(
".",
include,