diff options
Diffstat (limited to 'internal/rosa/etc.go')
| -rw-r--r-- | internal/rosa/etc.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/internal/rosa/etc.go b/internal/rosa/etc.go index 83c4ac4a..25ded51a 100644 --- a/internal/rosa/etc.go +++ b/internal/rosa/etc.go @@ -19,6 +19,11 @@ type cureEtc struct { minimal bool } +var _ pkg.RevisionArtifact = cureEtc{} + +// Revision satisfies [pkg.RevisionArtifact] for source directory replacement. +func (cureEtc) Revision() uint64 { return 0 } + // NewEtc returns a [pkg.Artifact] containing deterministic elements of /etc. func NewEtc(minimal bool) pkg.Artifact { return cureEtc{minimal} @@ -26,6 +31,13 @@ func NewEtc(minimal bool) pkg.Artifact { // Cure writes hardcoded configuration to files under etc. func (a cureEtc) Cure(t *pkg.FContext) (err error) { + if err = os.MkdirAll(t.GetWorkDir().Append( + prefixR, + "cure", + ).String(), 0700); err != nil { + return + } + etc := t.GetWorkDir().Append("etc") if err = os.MkdirAll(etc.String(), 0700); err != nil { return @@ -33,7 +45,7 @@ func (a cureEtc) Cure(t *pkg.FContext) (err error) { for _, f := range []KV{ {"hosts", "127.0.0.1 localhost cure cure-net\n"}, {"passwd", `root:x:0:0:System administrator:/proc/nonexistent:/bin/sh -cure:x:1023:1023:Cure:/usr/src:/bin/sh +cure:x:1023:1023:Cure:` + Prefix + `/cure:/bin/sh nobody:x:65534:65534:Overflow user:/proc/nonexistent:` + Prefix + `/bin/false `}, {"group", `root:x:0: |
