Skip to content

Commit b1b63f6

Browse files
committed
fix: mark overlay installer executable
Fixes #8603 P.S. There's one more issue with architecture mix that needs to be resolved as well. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 3433fa1 commit b1b63f6

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

pkg/imager/filemap/filemap.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
type File struct {
2121
ImagePath string
2222
SourcePath string
23+
ImageMode int64
2324
}
2425

2526
// Walk the filesystem generating a filemap.
@@ -75,6 +76,7 @@ func build(filemap []File) io.ReadCloser {
7576
if err = w.WriteHeader(&tar.Header{
7677
Name: entry.ImagePath,
7778
Size: st.Size(),
79+
Mode: entry.ImageMode,
7880
}); err != nil {
7981
return err
8082
}

pkg/imager/out.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -427,31 +427,33 @@ func (i *Imager) outInstaller(ctx context.Context, path string, report *reporter
427427
for _, extraArtifact := range []struct {
428428
sourcePath string
429429
imagePath string
430+
mode os.FileMode
430431
}{
431432
{
432433
sourcePath: filepath.Join(i.tempDir, constants.ImagerOverlayArtifactsPath),
433-
imagePath: constants.ImagerOverlayArtifactsPath,
434+
imagePath: strings.TrimLeft(constants.ImagerOverlayArtifactsPath, "/"),
434435
},
435436
{
436437
sourcePath: filepath.Join(i.tempDir, constants.ImagerOverlayInstallersPath, i.prof.Overlay.Name),
437-
imagePath: constants.ImagerOverlayInstallerDefaultPath,
438+
imagePath: strings.TrimLeft(constants.ImagerOverlayInstallerDefaultPath, "/"),
439+
mode: 0o755,
438440
},
439441
{
440442
sourcePath: filepath.Join(i.tempDir, constants.ImagerOverlayExtraOptionsPath),
441-
imagePath: constants.ImagerOverlayExtraOptionsPath,
443+
imagePath: strings.TrimLeft(constants.ImagerOverlayExtraOptionsPath, "/"),
442444
},
443445
} {
444-
if extraArtifact.sourcePath == "" {
445-
continue
446-
}
447-
448446
var extraFiles []filemap.File
449447

450448
extraFiles, err = filemap.Walk(extraArtifact.sourcePath, extraArtifact.imagePath)
451449
if err != nil {
452450
return fmt.Errorf("failed to walk extra artifact %s: %w", extraArtifact.sourcePath, err)
453451
}
454452

453+
for i := range extraFiles {
454+
extraFiles[i].ImageMode = int64(extraArtifact.mode)
455+
}
456+
455457
overlayArtifacts = append(overlayArtifacts, extraFiles...)
456458
}
457459

0 commit comments

Comments
 (0)