aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/state.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-23 17:44:38 +0900
committerOphestra <cat@gensokyo.uk>2026-05-23 17:44:38 +0900
commit3f33b62dfdc9402eec55566204434efd6e842826 (patch)
treeba8150112f49e3c0b64b89bee4fc097e31ec6ce1 /internal/rosa/state.go
parentac5488eef61c8f7e8b5b677ceb85b69df7384f42 (diff)
internal/rosa/package: migrate system image
The overlay argument also enables migration of stage0. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/state.go')
-rw-r--r--internal/rosa/state.go29
1 files changed, 22 insertions, 7 deletions
diff --git a/internal/rosa/state.go b/internal/rosa/state.go
index 5c822426..888378d8 100644
--- a/internal/rosa/state.go
+++ b/internal/rosa/state.go
@@ -932,6 +932,7 @@ func (ctx *evalContext) pf(
output pkg.Artifact
sourceA any
helper Helper
+ overlay string
inputs, runtimes, extra azalea.Array
)
@@ -960,6 +961,7 @@ func (ctx *evalContext) pf(
k("inputs"): &inputs,
k("runtime"): &runtimes,
k("extra"): &extra,
+ k("overlay"): &overlay,
}); err != nil {
return
}
@@ -991,13 +993,26 @@ func (ctx *evalContext) pf(
})
}
- for _, h := range extraH {
- _, a := ctx.t.MustLoad(h)
- attr.Paths = append(attr.Paths, pkg.Path(
- AbsUsrSrc.Append("extra", h.String()),
- attr.Writable,
- a,
- ))
+ if overlay == "" {
+ for _, h := range extraH {
+ _, a := ctx.t.MustLoad(h)
+ attr.Paths = append(attr.Paths, pkg.Path(
+ AbsUsrSrc.Append("extra", h.String()),
+ attr.Writable,
+ a,
+ ))
+ }
+ } else {
+ var o pkg.ExecPath
+ if o.P, err = check.NewAbs(overlay); err != nil {
+ o.P = AbsUsrSrc.Append("extra", overlay)
+ }
+ o.A = make([]pkg.Artifact, len(extraH))
+ for i, h := range extraH {
+ _, a := ctx.t.MustLoad(h)
+ o.A[i] = a
+ }
+ attr.Paths = append(attr.Paths, o)
}
for _, pair := range files {