aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/etc.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-02-05 17:50:48 +0900
committerOphestra <cat@gensokyo.uk>2026-02-05 17:50:48 +0900
commit6ad21e22881640eb488799848168dbbdcd299268 (patch)
treec89683722687131965cc8f3e017765818a379fa6 /internal/rosa/etc.go
parent27e2e3f996b79d879e91455d2730acecbb8422e2 (diff)
internal/rosa: register custom artifacts
This also encodes extra information for iana-etc. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/etc.go')
-rw-r--r--internal/rosa/etc.go23
1 files changed, 21 insertions, 2 deletions
diff --git a/internal/rosa/etc.go b/internal/rosa/etc.go
index 11687295..f94e63c0 100644
--- a/internal/rosa/etc.go
+++ b/internal/rosa/etc.go
@@ -86,8 +86,27 @@ nobody:x:65534:
// Kind returns the hardcoded [pkg.Kind] value.
func (cureEtc) Kind() pkg.Kind { return kindEtc }
-// Params is a noop.
-func (cureEtc) Params(*pkg.IContext) {}
+// Params writes whether iana-etc is populated.
+func (a cureEtc) Params(ctx *pkg.IContext) {
+ if a.iana != nil {
+ ctx.WriteUint32(1)
+ } else {
+ ctx.WriteUint32(0)
+ }
+}
+
+func init() {
+ pkg.Register(kindEtc, func(r *pkg.IRReader) pkg.Artifact {
+ a := cureEtc{}
+ if r.ReadUint32() != 0 {
+ a.iana = r.Next()
+ }
+ if _, ok := r.Finalise(); ok {
+ panic(pkg.ErrUnexpectedChecksum)
+ }
+ return a
+ })
+}
// IsExclusive returns false: Cure performs a few trivial filesystem writes.
func (cureEtc) IsExclusive() bool { return false }