Skip to content

Commit cf4a5ee

Browse files
authored
Fixes for error logs when building UKI (#485)
* Changed error messages to warnings in buildImageUKI, UKI fixes. * Formatted imageos.go with gofmt Signed-off-by: Cherng Xi Chia <cherng.xi.chia@intel.com> --------- Signed-off-by: Cherng Xi Chia <cherng.xi.chia@intel.com>
1 parent df1bc09 commit cf4a5ee

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

internal/image/imageos/imageos.go

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,36 +1065,31 @@ func buildImageUKI(installRoot string, template *config.ImageTemplate) error {
10651065
if _, err := os.Stat(installRoot); err == nil {
10661066
log.Infof("Install Root Exists at %s", installRoot)
10671067
} else {
1068-
log.Errorf("Install Root does not exist at %s", installRoot)
1069-
}
1070-
if _, err := os.Stat(kernelPath); err == nil {
1071-
log.Infof("kernelPath Exists at %s", kernelPath)
1072-
} else {
1073-
log.Errorf("Install Root does not exist at %s", installRoot)
1068+
log.Warnf("Install Root does not exist at %s", installRoot)
10741069
}
10751070

1076-
if _, err := os.Stat(kernelPath); err == nil {
1071+
if _, err := os.Stat(filepath.Join(installRoot, kernelPath)); err == nil {
10771072
log.Infof("kernelPath Exists at %s", kernelPath)
10781073
} else {
1079-
log.Errorf("kernelPath does not exist at %s", kernelPath)
1074+
log.Warnf("kernelPath does not exist at %s", kernelPath)
10801075
}
10811076

1082-
if _, err := os.Stat(initrdPath); err == nil {
1077+
if _, err := os.Stat(filepath.Join(installRoot, initrdPath)); err == nil {
10831078
log.Infof("initrdPath Exists at %s", initrdPath)
10841079
} else {
1085-
log.Errorf("initrdPath does not exist at %s", initrdPath)
1080+
log.Warnf("initrdPath does not exist at %s", initrdPath)
10861081
}
1087-
if _, err := os.Stat(cmdlineFile); err == nil {
1082+
1083+
if _, err := os.Stat(filepath.Join(installRoot, cmdlineFile)); err == nil {
10881084
log.Infof("cmdlineFile Exists at %s", cmdlineFile)
1089-
return nil
10901085
} else {
1091-
log.Errorf("cmdlineFile does not exist at %s", cmdlineFile)
1086+
log.Warnf("cmdlineFile does not exist at %s", cmdlineFile)
10921087
}
1093-
if _, err := os.Stat(outputPath); err == nil {
1088+
1089+
if _, err := os.Stat(filepath.Join(installRoot, outputPath)); err == nil {
10941090
log.Infof("outputPath Exists at %s", outputPath)
1095-
return nil
10961091
} else {
1097-
log.Errorf("outputPath does not exist at %s", outputPath)
1092+
log.Warnf("outputPath does not exist at %s", outputPath)
10981093
}
10991094

11001095
if err := buildUKI(installRoot, kernelPath, initrdPath, cmdlineFile, outputPath, template); err != nil {

0 commit comments

Comments
 (0)