-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try to mount oem under livemedia #110
Conversation
Tested cloud images + recovery: works Missing testing netboot+iso boot, which should not trigger the oem mount but should pick the live_media DAG |
pkg/mount/dag_uki_boot.go
Outdated
@@ -20,7 +20,7 @@ func (s *State) RegisterUKI(g *herd.Graph) error { | |||
s.LogIfError(s.UKIUdevDaemon(g), "udev") | |||
|
|||
// Run rootfs stage | |||
s.LogIfError(s.RootfsStageDagStep(g, cnst.OpSentinel, cnst.OpUkiUdev), "uki rootfs") | |||
s.LogIfError(s.RootfsStageDagStep(g, herd.WithDeps(cnst.OpSentinel, cnst.OpUkiUdev), herd.WithWeakDeps()), "uki rootfs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty weakdeps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, signature of the call has changed to be able to pass an optional number of deps and weakdeps
pkg/mount/dag_steps.go
Outdated
@@ -102,8 +102,8 @@ func (s *State) MountRootDagStep(g *herd.Graph) error { | |||
} | |||
|
|||
// RootfsStageDagStep will add the rootfs stage. | |||
func (s *State) RootfsStageDagStep(g *herd.Graph, deps ...string) error { | |||
return g.Add(cnst.OpRootfsHook, herd.WithDeps(deps...), herd.WithCallback(s.RunStageOp("rootfs"))) | |||
func (s *State) RootfsStageDagStep(g *herd.Graph, deps herd.OpOption, weakDeps herd.OpOption) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (s *State) RootfsStageDagStep(g *herd.Graph, deps herd.OpOption, weakDeps herd.OpOption) error { | |
func (s *State) RootfsStageDagStep(g *herd.Graph, opts ...herd.OpOption) error { |
pkg/mount/dag_steps.go
Outdated
func (s *State) RootfsStageDagStep(g *herd.Graph, deps ...string) error { | ||
return g.Add(cnst.OpRootfsHook, herd.WithDeps(deps...), herd.WithCallback(s.RunStageOp("rootfs"))) | ||
func (s *State) RootfsStageDagStep(g *herd.Graph, deps herd.OpOption, weakDeps herd.OpOption) error { | ||
return g.Add(cnst.OpRootfsHook, deps, weakDeps, herd.WithCallback(s.RunStageOp("rootfs"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return g.Add(cnst.OpRootfsHook, deps, weakDeps, herd.WithCallback(s.RunStageOp("rootfs"))) | |
return g.Add(cnst.OpRootfsHook, herd.WithCallback(s.RunStageOp("rootfs")), opts... ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait...can you pass the callback anywhere???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, you cant:
Invalid use of '...', the corresponding parameter is non-variadic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, you can but have to append the withCallback to the slice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argh yep I've messed it up while adding the suggestion
pkg/mount/dag_uki_boot.go
Outdated
@@ -20,7 +20,7 @@ func (s *State) RegisterUKI(g *herd.Graph) error { | |||
s.LogIfError(s.UKIUdevDaemon(g), "udev") | |||
|
|||
// Run rootfs stage | |||
s.LogIfError(s.RootfsStageDagStep(g, cnst.OpSentinel, cnst.OpUkiUdev), "uki rootfs") | |||
s.LogIfError(s.RootfsStageDagStep(g, herd.WithDeps(cnst.OpSentinel, cnst.OpUkiUdev), herd.WithWeakDeps()), "uki rootfs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s.LogIfError(s.RootfsStageDagStep(g, herd.WithDeps(cnst.OpSentinel, cnst.OpUkiUdev), herd.WithWeakDeps()), "uki rootfs") | |
s.LogIfError(s.RootfsStageDagStep(g, herd.WithDeps(cnst.OpSentinel, cnst.OpUkiUdev)), "uki rootfs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beside small code nitpicks looks good here! good catch!
fd111ea
to
a4e1fd5
Compare
pkg/mount/dag_steps.go
Outdated
func (s *State) RootfsStageDagStep(g *herd.Graph, deps ...string) error { | ||
return g.Add(cnst.OpRootfsHook, herd.WithDeps(deps...), herd.WithCallback(s.RunStageOp("rootfs"))) | ||
func (s *State) RootfsStageDagStep(g *herd.Graph, opts ...herd.OpOption) error { | ||
opts = append(opts, herd.WithCallback(s.RunStageOp("rootfs"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you know this can be a oneline.. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¬_¬
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
a4e1fd5
to
7d0581c
Compare
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
Manually tested:
|
func (s *State) RootfsStageDagStep(g *herd.Graph, deps ...string) error { | ||
return g.Add(cnst.OpRootfsHook, herd.WithDeps(deps...), herd.WithCallback(s.RunStageOp("rootfs"))) | ||
func (s *State) RootfsStageDagStep(g *herd.Graph, opts ...herd.OpOption) error { | ||
return g.Add(cnst.OpRootfsHook, append(opts, herd.WithCallback(s.RunStageOp("rootfs")))...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows recovery squashfs to have oem mounted on boot so the stages runs correctly with user provided configs.