mirror of
https://github.com/kairos-io/immucore.git
synced 2025-07-31 22:16:43 +00:00
Always mount tmpfs
Even on cd boot. Also delay the cdboot check a bit so we can mount tmpfs also on cdboot Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
This commit is contained in:
parent
2aee7ab5a0
commit
3ef3ac0251
@ -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)")
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user