aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mbf/main.go34
1 files changed, 30 insertions, 4 deletions
diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go
index 83bb6714..9828a8f1 100644
--- a/cmd/mbf/main.go
+++ b/cmd/mbf/main.go
@@ -111,15 +111,31 @@ func main() {
{
var (
+ flagGentoo string
+ flagChecksum string
+
flagStage0 bool
)
c.NewCommand(
"stage3",
"Check for toolchain 3-stage non-determinism",
func(args []string) (err error) {
- _, _, _, stage1 := (rosa.Std - 2).NewLLVM()
- _, _, _, stage2 := (rosa.Std - 1).NewLLVM()
- _, _, _, stage3 := rosa.Std.NewLLVM()
+ std := rosa.Std
+ if flagGentoo != "" {
+ std -= 3 // magic number to discourage misuse
+
+ var checksum pkg.Checksum
+ if len(flagChecksum) != 0 {
+ if err = pkg.Decode(&checksum, flagChecksum); err != nil {
+ return
+ }
+ }
+ rosa.SetGentooStage3(flagGentoo, checksum)
+ }
+
+ _, _, _, stage1 := (std - 2).NewLLVM()
+ _, _, _, stage2 := (std - 1).NewLLVM()
+ _, _, _, stage3 := std.NewLLVM()
var (
pathname *check.Absolute
checksum [2]unique.Handle[pkg.Checksum]
@@ -153,7 +169,7 @@ func main() {
if flagStage0 {
if pathname, _, err = cache.Cure(
- rosa.Std.Load(rosa.Stage0),
+ std.Load(rosa.Stage0),
); err != nil {
return err
}
@@ -164,6 +180,16 @@ func main() {
},
).
Flag(
+ &flagGentoo,
+ "gentoo", command.StringFlag(""),
+ "Bootstrap from a Gentoo stage3 tarball",
+ ).
+ Flag(
+ &flagChecksum,
+ "checksum", command.StringFlag(""),
+ "Checksum of Gentoo stage3 tarball",
+ ).
+ Flag(
&flagStage0,
"stage0", command.BoolFlag(false),
"Create bootstrap stage0 tarball",