Skip to content

Commit

Permalink
Remove old bb code
Browse files Browse the repository at this point in the history
This removes the old bb code in favor of using gbb isntead.
As we"re moving away from bb and fully to gbb, there is no point
in keeping the legacy code now as it won't work anymore.

Signed-off-by: Marvin Drees <[email protected]>
  • Loading branch information
MDr164 committed Jun 7, 2022
1 parent 25bfb95 commit b57b2bb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 137 deletions.
86 changes: 0 additions & 86 deletions pkg/uroot/builder/bb.go

This file was deleted.

46 changes: 0 additions & 46 deletions pkg/uroot/builder/bb_test.go

This file was deleted.

5 changes: 5 additions & 0 deletions pkg/uroot/builder/gbb.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import (
"github.com/u-root/u-root/pkg/uroot/initramfs"
)

// Commands to skip building in bb mode.
var skip = map[string]struct{}{
"bb": {},
}

// GBBBuilder is an implementation of Builder that compiles many Go commands
// into one busybox-style binary.
//
Expand Down
8 changes: 3 additions & 5 deletions u-root.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func init() {
sh = "elvish"
}

build = flag.String("build", "gbb", "u-root build format (e.g. bb or binary).")
build = flag.String("build", "gbb", "u-root build format (e.g. bb/gbb or binary).")
format = flag.String("format", "cpio", "Archival format.")

tmpDir = flag.String("tmpdir", "", "Temporary directory to put binaries in.")
Expand Down Expand Up @@ -272,10 +272,8 @@ func Main(l ulog.Logger, buildOpts *gbbgolang.BuildOpts) error {
if !*noCommands {
var b builder.Builder
switch *build {
case "bb":
b = builder.BBBuilder{ShellBang: *shellbang}
case "gbb":
l.Printf("NOTE: building with the new gobusybox; to get old behavior, use -build=bb")
case "bb", "gbb":
l.Printf("NOTE: building with the new gobusybox; to get the old behavior check out version XXX") // TODO(MDr164): Find consensus on a "legacy" version
b = builder.GBBBuilder{ShellBang: *shellbang}
case "binary":
b = builder.BinaryBuilder{}
Expand Down

0 comments on commit b57b2bb

Please sign in to comment.