Skip to content

Commit

Permalink
Deprecated: pour one out for source mode
Browse files Browse the repository at this point in the history
Source mode becomes harder to maintain with Go modules. We're getting
ready to add Go module support.

Goodbye, source mode. Go is not what it used to be!

Signed-off-by: Chris Koch <[email protected]>
  • Loading branch information
hugelgupf committed Jun 9, 2021
1 parent ffd18dd commit 5611826
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 592 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ jobs:
# Fails because of dups. Is this supposed to work?
#$goruncmd -build=bb all core
#$goruncmd all core
go run u-root.go templates.go -fourbins minimal
GOOS=plan9 $goruncmd -defaultsh=/bbin/rush plan9
cat /tmp/stats.json
- store_artifacts:
Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ u-root core boot
u-root cmds/core/{init,ls,ip,dhclient,wget,cat,elvish}

# Generate an archive with all of the core tools with some exceptions
u-root core -cmds/core/{installcommand,losetup}
u-root core -cmds/core/{ls,losetup}

# Generate an archive with a tool outside of u-root
u-root cmds/core/{init,ls,elvish} github.com/u-root/cpu/cmds/cpud
Expand Down Expand Up @@ -375,22 +375,17 @@ assuming your kernel is configured to work that way.

## Build Modes

u-root can create an initramfs in two different modes:
u-root can create an initramfs in two different modes, specified by `-build`:

* source mode includes Go toolchain binaries + simple shell + Go source files
in the initramfs archive. Tools are compiled from source on the fly by the
shell.

When you try to run a command that is not built, it is compiled first and
stored in tmpfs. From that point on, when you run the command, you get the
one in tmpfs. Don't worry: the Go compiler is pretty fast.

* bb mode: One busybox-like binary comprising all the Go tools you ask to
* `bb` mode: One busybox-like binary comprising all the Go tools you ask to
include. See [here for how it works](pkg/bb/README.md).

In this mode, u-root copies and rewrites the source of the tools you asked
to include to be able to compile everything into one busybox-like binary.

* `binary` mode: each specified binary is compiled separately and all binaries
are added to the initramfs.

## Updating Dependencies

```shell
Expand Down
77 changes: 0 additions & 77 deletions cmds/core/init/bgbuild.go

This file was deleted.

5 changes: 0 additions & 5 deletions cmds/core/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ func main() {
// to be used in the rest of init.
ic := osInitGo()

// Start background build.
if isBgBuildEnabled() {
go startBgBuild()
}

cmdCount := libinit.RunCommands(debug, ic.cmds...)
if cmdCount == 0 {
log.Printf("No suitable executable found in %v", ic.cmds)
Expand Down
176 changes: 0 additions & 176 deletions cmds/core/installcommand/installcommand.go

This file was deleted.

19 changes: 0 additions & 19 deletions cmds/core/installcommand/installcommand_linux.go

This file was deleted.

23 changes: 0 additions & 23 deletions cmds/core/installcommand/installcommand_plan9.go

This file was deleted.

1 change: 0 additions & 1 deletion pkg/uroot/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

var (
BusyBox = BBBuilder{}
Source = SourceBuilder{}
Binary = BinaryBuilder{}
)

Expand Down
Loading

0 comments on commit 5611826

Please sign in to comment.