diff --git a/internal/cmd/commands.go b/internal/cmd/commands.go index de44c2c..d66060e 100644 --- a/internal/cmd/commands.go +++ b/internal/cmd/commands.go @@ -33,16 +33,19 @@ Sends a generic event payload with the configuration found in the scanned direct debug := len(utils.ReadCMDLineArg("rd.immucore.debug")) > 0 log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).With().Logger() zerolog.SetGlobalLevel(zerolog.InfoLevel) - if debug { + debugFromEnv := os.Getenv("IMMUCORE_DEBUG") != "" + if debug || debugFromEnv { log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).With().Caller().Logger() zerolog.SetGlobalLevel(zerolog.DebugLevel) } // First set the sentinel file - err = utils.SetSentinelFile() - if err != nil { - log.Logger.Err(err).Send() - return err + if !c.Bool("dry-run") { + err = utils.SetSentinelFile() + if err != nil { + log.Logger.Err(err).Send() + return err + } } // If we boot from CD, we do nothing @@ -61,7 +64,7 @@ Sends a generic event payload with the configuration found in the scanned direct } } log.Debug().Strs("TargetImage", img).Msg("Target image") - g := herd.DAG() + g := herd.DAG(herd.EnableInit) s := &mount.State{ Logger: log.Logger, Rootdir: utils.GetRootDir(), diff --git a/pkg/mount/mount.go b/pkg/mount/mount.go index 7e68ae2..56c0db3 100644 --- a/pkg/mount/mount.go +++ b/pkg/mount/mount.go @@ -192,7 +192,6 @@ 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")