From b54d26c2c3f3a52c6d1ec3fddb7a373175815de3 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Thu, 31 Oct 2024 21:44:12 +0400 Subject: [PATCH] fix: mount pseudo sub-mountpoints in init Mount them early, they will be moved to the new root in switch root process as they're under. Signed-off-by: Andrey Smirnov --- internal/app/init/main.go | 4 ++++ .../machined/pkg/runtime/v1alpha1/v1alpha1_sequencer.go | 1 - .../pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go | 9 --------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/internal/app/init/main.go b/internal/app/init/main.go index 227316dd6f..c60f8ee27b 100644 --- a/internal/app/init/main.go +++ b/internal/app/init/main.go @@ -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 diff --git a/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer.go b/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer.go index 994591df94..7dae1d1b3b 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer.go @@ -95,7 +95,6 @@ func (*Sequencer) Initialize(r runtime.Runtime) []runtime.Phase { EnforceKSPPRequirements, SetupSystemDirectory, MountCgroups, - MountPseudoFilesystems, SetRLimit, InitVolumeLifecycle, ).Append( diff --git a/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go b/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go index ddf9e3f26e..02a93cdbda 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/v1alpha1_sequencer_tasks.go @@ -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) {