Skip to content

Commit

Permalink
fix: mount pseudo sub-mountpoints in init
Browse files Browse the repository at this point in the history
Mount them early, they will be moved to the new root in switch root
process as they're under.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Oct 31, 2024
1 parent 7aeb15f commit b54d26c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 4 additions & 0 deletions internal/app/init/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ func run() error {
return err
}

if _, err := mount.PseudoSubMountPoints().Mount(); err != nil {
return err
}

// Setup logging to /dev/kmsg.
if err := kmsg.SetupLogger(nil, "[talos] [initramfs]", nil); err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func (*Sequencer) Initialize(r runtime.Runtime) []runtime.Phase {
EnforceKSPPRequirements,
SetupSystemDirectory,
MountCgroups,
MountPseudoFilesystems,
SetRLimit,
InitVolumeLifecycle,
).Append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,6 @@ func MountCgroups(runtime.Sequence, any) (runtime.TaskExecutionFunc, string) {
}, "mountCgroups"
}

// MountPseudoFilesystems represents the MountPseudoFilesystems task.
func MountPseudoFilesystems(runtime.Sequence, any) (runtime.TaskExecutionFunc, string) {
return func(ctx context.Context, logger *log.Logger, r runtime.Runtime) error {
_, err := mountv2.PseudoSubMountPoints().Mount()

return err
}, "mountPseudoFilesystems"
}

// SetRLimit represents the SetRLimit task.
func SetRLimit(runtime.Sequence, any) (runtime.TaskExecutionFunc, string) {
return func(ctx context.Context, logger *log.Logger, r runtime.Runtime) (err error) {
Expand Down

0 comments on commit b54d26c

Please sign in to comment.