Skip to content

Commit 153ebd7

Browse files
committed
mantle/platform: make copied ISO file writable for tests
Since we are going to modify it let's ensure it's writable. We are changing up some of the code that builds the Live artifacts and it exposed the fact that we are relying here on the files in the builddir to have the writable bit set. Let's not rely on that.
1 parent b76ab0f commit 153ebd7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

mantle/platform/metal.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,10 @@ func (inst *Install) InstallViaISOEmbed(kargs []string, liveIgnition, targetIgni
668668
if err := cmd.Run(); err != nil {
669669
return nil, errors.Wrapf(err, "copying iso")
670670
}
671+
// Make it writable so we can modify it
672+
if err := os.Chmod(newIso, 0644); err != nil {
673+
return nil, errors.Wrapf(err, "setting permissions on iso")
674+
}
671675
srcisopath = newIso
672676

673677
var metalimg string

mantle/platform/qemu.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,10 @@ func (builder *QemuBuilder) setupIso() error {
15001500
if err := cpcmd.Run(); err != nil {
15011501
return errors.Wrapf(err, "copying iso")
15021502
}
1503+
// Make it writable so we can modify it
1504+
if err := os.Chmod(isoEmbeddedPath, 0644); err != nil {
1505+
return errors.Wrapf(err, "setting permissions on iso")
1506+
}
15031507
if builder.ConfigFile != "" {
15041508
if builder.configInjected {
15051509
panic("config already injected?")

0 commit comments

Comments
 (0)