diff --git a/internal/cmd/commands.go b/internal/cmd/commands.go index ba7fa7c..de44c2c 100644 --- a/internal/cmd/commands.go +++ b/internal/cmd/commands.go @@ -52,14 +52,9 @@ Sends a generic event payload with the configuration found in the scanned direct return err } - if cdBoot { - log.Info().Msg("Seems we booted from CD, doing nothing. Bye!") - return nil - } - img := utils.ReadCMDLineArg("cos-img/filename=") if len(img) == 0 { - if c.Bool("dry-run") { + if c.Bool("dry-run") || cdBoot { img = []string{"fake"} } else { log.Logger.Fatal().Msg("Could not get the image name from cmdline (i.e. cos-img/filename=/cOS/active.img)") diff --git a/pkg/mount/mount.go b/pkg/mount/mount.go index da91345..7e68ae2 100644 --- a/pkg/mount/mount.go +++ b/pkg/mount/mount.go @@ -52,6 +52,7 @@ const ( opRootfsHook = "rootfs-hook" opLoadConfig = "load-config" + opMountTmpfs = "mount-tmpfs" ) func (s *State) path(p ...string) string { @@ -192,6 +193,17 @@ func (s *State) Register(g *herd.Graph) error { // TODO: add hooks, fstab (might have missed some), systemd compat // TODO: We should also set tmpfs here (not -related) + err = g.Add(opMountTmpfs, herd.WithCallback(s.MountOP("tmpfs", "/tmp", "tmpfs", []string{"rw"}, 10*time.Second))) + if err != nil { + s.Logger.Debug().Err(err).Msg("tmpfs mount") + return err + } + + if runtime.BootState == state.LiveCD { + s.Logger.Info().Msg("Booting from LiveCD") + return nil + } + // All of this below need to run after rootfs stage runs (so the layout file is created) // This is legacy - in UKI we don't need to found the img, this needs to run in a conditional if s.MountRoot {