Skip to content

Commit e168512

Browse files
committed
fix: apply 'ro' flag to iso9660 filesystems
Fixes #11807 Signed-off-by: Mateusz Urbanek <[email protected]>
1 parent 7f7acfb commit e168512

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

internal/app/machined/pkg/runtime/v1alpha1/platform/metal/metal.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ func readConfigFromISO(ctx context.Context, r state.State) ([]byte, error) {
180180
mount.WithFsopen(
181181
volumeStatus.TypedSpec().Filesystem.String(),
182182
fsopen.WithSource(volumeStatus.TypedSpec().MountLocation),
183-
fsopen.WithBoolParameter("ro"),
184183
fsopen.WithPrinter(log.Printf),
185184
),
186185
)

internal/pkg/xfs/fsopen/fsopen_linux.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,25 @@ func New(fstype string, opts ...Option) *FS {
5252
binaryParams: make(map[string][][]byte),
5353
}
5454

55-
for _, opt := range opts {
55+
for _, opt := range defaultOpts(fstype, opts...) {
5656
opt.set(fs)
5757
}
5858

5959
return fs
6060
}
6161

62+
// defaultOpts applies default options for filesystems.
63+
func defaultOpts(fstype string, opts ...Option) []Option {
64+
if fstype == "iso9660" {
65+
opts = append(
66+
opts,
67+
WithBoolParameter("ro"),
68+
)
69+
}
70+
71+
return opts
72+
}
73+
6274
// Open initializes the filesystem and returns the file descriptor for the mounted filesystem.
6375
// If the filesystem is already created, it returns the existing file descriptor.
6476
// This method is idempotent, meaning it can be called multiple times without side effects.

0 commit comments

Comments
 (0)