Skip to content

Commit

Permalink
Rename uroot package to uimage
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Koch <[email protected]>
  • Loading branch information
hugelgupf committed Feb 13, 2024
1 parent 3e95bfb commit b61ee0b
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 31 deletions.
16 changes: 8 additions & 8 deletions cmd/mkuimage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"github.com/hugelgupf/go-shlex"
"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/gobusybox/src/pkg/uflag"
"github.com/u-root/mkuimage/uroot"
"github.com/u-root/mkuimage/uroot/builder"
"github.com/u-root/mkuimage/uroot/initramfs"
"github.com/u-root/mkuimage/uimage"
"github.com/u-root/mkuimage/uimage/builder"
"github.com/u-root/mkuimage/uimage/initramfs"
"github.com/u-root/uio/llog"
)

Expand Down Expand Up @@ -225,7 +225,7 @@ func Main(l *llog.Logger, env *golang.Environ, buildOpts *golang.BuildOpts) erro
output := getWriter(*format, *outputPath)

var base initramfs.ReadOpener
base = &initramfs.Archive{Archive: uroot.DefaultRamfs()}
base = &initramfs.Archive{Archive: uimage.DefaultRamfs()}
if *basePath != "" {
base = getReader(*format, *basePath)
}
Expand All @@ -244,7 +244,7 @@ func Main(l *llog.Logger, env *golang.Environ, buildOpts *golang.BuildOpts) erro
}
}

var c []uroot.Commands
var c []uimage.Commands
if !*noCommands {
var b builder.Builder
switch *build {
Expand All @@ -261,14 +261,14 @@ func Main(l *llog.Logger, env *golang.Environ, buildOpts *golang.BuildOpts) erro
pkgs = []string{"github.com/u-root/u-root/cmds/core/*"}
}

c = append(c, uroot.Commands{
c = append(c, uimage.Commands{
Builder: b,
Packages: pkgs,
BuildOpts: buildOpts,
})
}

opts := uroot.Opts{
opts := uimage.Opts{
Env: env,
Commands: c,
UrootSource: *urootSourceDir,
Expand All @@ -287,5 +287,5 @@ func Main(l *llog.Logger, env *golang.Environ, buildOpts *golang.BuildOpts) erro
if len(uinitArgs) > 1 {
opts.UinitArgs = uinitArgs[1:]
}
return uroot.CreateInitramfs(l, opts)
return uimage.CreateInitramfs(l, opts)
}
2 changes: 1 addition & 1 deletion cmd/mkuimage/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/mkuimage/cpio"
itest "github.com/u-root/mkuimage/uroot/initramfs/test"
itest "github.com/u-root/mkuimage/uimage/initramfs/test"
"golang.org/x/sync/errgroup"
)

Expand Down
2 changes: 1 addition & 1 deletion uroot/builder/binary.go → uimage/builder/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"sync"

"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/mkuimage/uroot/initramfs"
"github.com/u-root/mkuimage/uimage/initramfs"
"github.com/u-root/uio/llog"
"golang.org/x/tools/go/packages"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/mkuimage/uroot/initramfs"
"github.com/u-root/mkuimage/uimage/initramfs"
"github.com/u-root/uio/llog"
)

Expand Down
2 changes: 1 addition & 1 deletion uroot/builder/builder.go → uimage/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"errors"

"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/mkuimage/uroot/initramfs"
"github.com/u-root/mkuimage/uimage/initramfs"
"github.com/u-root/uio/llog"
)

Expand Down
2 changes: 1 addition & 1 deletion uroot/builder/gbb.go → uimage/builder/gbb.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/u-root/gobusybox/src/pkg/bb"
"github.com/u-root/mkuimage/cpio"
"github.com/u-root/mkuimage/uroot/initramfs"
"github.com/u-root/mkuimage/uimage/initramfs"
"github.com/u-root/uio/llog"
)

Expand Down
2 changes: 1 addition & 1 deletion uroot/builder/gbb_test.go → uimage/builder/gbb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/mkuimage/cpio"
"github.com/u-root/mkuimage/uroot/initramfs"
"github.com/u-root/mkuimage/uimage/initramfs"
"github.com/u-root/uio/llog"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions uroot/uroot.go → uimage/uimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package uroot creates root file systems from Go programs.
// Package uimage creates root file systems from Go programs.
//
// uroot will appropriately compile the Go programs, create symlinks for their
// uimage will appropriately compile the Go programs, create symlinks for their
// names, and assemble an initramfs with additional files as specified.
package uroot
package uimage

import (
"debug/elf"
Expand All @@ -24,8 +24,8 @@ import (
"github.com/u-root/mkuimage/cpio"
"github.com/u-root/mkuimage/fileflag"
"github.com/u-root/mkuimage/ldd"
"github.com/u-root/mkuimage/uroot/builder"
"github.com/u-root/mkuimage/uroot/initramfs"
"github.com/u-root/mkuimage/uimage/builder"
"github.com/u-root/mkuimage/uimage/initramfs"
"github.com/u-root/uio/llog"
)

Expand Down
24 changes: 12 additions & 12 deletions uroot/uroot_test.go → uimage/uimage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package uroot
package uimage

import (
"errors"
Expand All @@ -14,9 +14,9 @@ import (

"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/mkuimage/cpio"
"github.com/u-root/mkuimage/uroot/builder"
"github.com/u-root/mkuimage/uroot/initramfs"
itest "github.com/u-root/mkuimage/uroot/initramfs/test"
"github.com/u-root/mkuimage/uimage/builder"
"github.com/u-root/mkuimage/uimage/initramfs"
itest "github.com/u-root/mkuimage/uimage/initramfs/test"
"github.com/u-root/uio/llog"
)

Expand Down Expand Up @@ -110,8 +110,8 @@ func TestCreateInitramfs(t *testing.T) {
somefile,
// Empty is ignored.
"",
"uroot_test.go",
filepath.Join(cwd, "uroot_test.go"),
"uimage_test.go",
filepath.Join(cwd, "uimage_test.go"),
// Parent directory is created.
somefile + ":somedir/somefile",
},
Expand All @@ -122,8 +122,8 @@ func TestCreateInitramfs(t *testing.T) {
itest.HasContent{Path: somefile, Content: "foobar"},
itest.HasContent{Path: "etc/somefile2", Content: "spongebob"},
// TODO: This behavior is weird.
itest.HasFile{Path: "uroot_test.go"},
itest.HasFile{Path: filepath.Join(cwd, "uroot_test.go")},
itest.HasFile{Path: "uimage_test.go"},
itest.HasFile{Path: filepath.Join(cwd, "uimage_test.go")},
itest.HasDir{Path: "somedir"},
itest.HasContent{Path: "somedir/somefile", Content: "foobar"},
},
Expand Down Expand Up @@ -560,8 +560,8 @@ func TestCreateInitramfsWithAPI(t *testing.T) {
somefile,
// Empty is ignored.
"",
"uroot_test.go",
filepath.Join(cwd, "uroot_test.go"),
"uimage_test.go",
filepath.Join(cwd, "uimage_test.go"),
// Parent directory is created.
somefile+":somedir/somefile",
),
Expand All @@ -572,8 +572,8 @@ func TestCreateInitramfsWithAPI(t *testing.T) {
itest.HasContent{Path: somefile, Content: "foobar"},
itest.HasContent{Path: "etc/somefile2", Content: "spongebob"},
// TODO: This behavior is weird.
itest.HasFile{Path: "uroot_test.go"},
itest.HasFile{Path: filepath.Join(cwd, "uroot_test.go")},
itest.HasFile{Path: "uimage_test.go"},
itest.HasFile{Path: filepath.Join(cwd, "uimage_test.go")},
itest.HasDir{Path: "somedir"},
itest.HasContent{Path: "somedir/somefile", Content: "foobar"},
},
Expand Down

0 comments on commit b61ee0b

Please sign in to comment.