Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #4

Merged
merged 5 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpio/fs_plan9.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"syscall"
"time"

"github.com/u-root/mkuimage/cpio/internal/upath"
"github.com/u-root/uio/uio"
"github.com/u-root/mkuimage/upath"
)

// A Recorder is a structure that contains variables used to calculate
Expand Down
2 changes: 1 addition & 1 deletion cpio/fs_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"path/filepath"
"syscall"

"github.com/u-root/mkuimage/upath"
"github.com/u-root/mkuimage/cpio/internal/upath"
"github.com/u-root/uio/uio"
"golang.org/x/sys/unix"
)
Expand Down
2 changes: 1 addition & 1 deletion cpio/fs_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"syscall"
"time"

"github.com/u-root/mkuimage/cpio/internal/upath"
"github.com/u-root/uio/uio"
"github.com/u-root/mkuimage/upath"
)

// A Recorder is a structure that contains variables used to calculate
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions uflag/flagfile.go → fileflag/flagfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package uflag supports u-root-custom flags as well as flag files.
package uflag
// Package fileflag supports flag files.
package fileflag

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion uflag/flagfile_test.go → fileflag/flagfile_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 uflag
package fileflag

import (
"reflect"
Expand Down
61 changes: 0 additions & 61 deletions upath/symlink.go

This file was deleted.

57 changes: 0 additions & 57 deletions upath/symlink_test.go

This file was deleted.

24 changes: 0 additions & 24 deletions upath/urootpath.go

This file was deleted.

29 changes: 0 additions & 29 deletions upath/urootpath_test.go

This file was deleted.

6 changes: 3 additions & 3 deletions uroot/builder/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"path/filepath"
"sync"

gbbgolang "github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/uio/ulog"
"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/mkuimage/uroot/initramfs"
"github.com/u-root/uio/ulog"
"golang.org/x/tools/go/packages"
)

func dirFor(env *gbbgolang.Environ, pkg string) (string, error) {
func dirFor(env *golang.Environ, pkg string) (string, error) {
pkgs, err := env.Lookup(packages.NeedName|packages.NeedFiles, "", pkg)
if err != nil {
return "", fmt.Errorf("failed to look up package %q: %v", pkg, err)
Expand Down
18 changes: 9 additions & 9 deletions uroot/uroot.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import (
"strings"

"github.com/u-root/gobusybox/src/pkg/bb/findpkg"
gbbgolang "github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/mkuimage/cpio"
"github.com/u-root/mkuimage/fileflag"
"github.com/u-root/mkuimage/ldd"
"github.com/u-root/mkuimage/uflag"
"github.com/u-root/mkuimage/uroot/builder"
"github.com/u-root/mkuimage/uroot/initramfs"
"github.com/u-root/uio/ulog"
Expand All @@ -41,7 +41,7 @@ const (
// If an OS is not known it will return a reasonable u-root specific
// default.
func DefaultRamfs() *cpio.Archive {
switch gbbgolang.Default().GOOS {
switch golang.Default().GOOS {
case "linux":
a, _ := cpio.ArchiveFromRecords([]cpio.Record{
cpio.Directory("bin", 0o755),
Expand Down Expand Up @@ -120,8 +120,8 @@ func (c Commands) TargetDir() string {
type Opts struct {
// Env is the Golang build environment (GOOS, GOARCH, etc).
//
// If nil, gbbgolang.Default is used.
Env *gbbgolang.Environ
// If nil, golang.Default is used.
Env *golang.Environ

// Commands specify packages to build using a specific builder.
//
Expand Down Expand Up @@ -227,7 +227,7 @@ type Opts struct {

// Build options for building go binaries. Ultimate this holds all the
// args that end up being passed to `go build`.
BuildOpts *gbbgolang.BuildOpts
BuildOpts *golang.BuildOpts
}

// CreateInitramfs creates an initramfs built to opts' specifications.
Expand All @@ -239,12 +239,12 @@ func CreateInitramfs(logger ulog.Logger, opts Opts) error {
return fmt.Errorf("must give output file")
}

env := gbbgolang.Default()
env := golang.Default()
if opts.Env != nil {
env = opts.Env
}
if opts.BuildOpts == nil {
opts.BuildOpts = &gbbgolang.BuildOpts{}
opts.BuildOpts = &golang.BuildOpts{}
}

files := initramfs.NewFiles()
Expand Down Expand Up @@ -297,7 +297,7 @@ func CreateInitramfs(logger ulog.Logger, opts Opts) error {
return fmt.Errorf("%v: specify -uinitcmd=\"\" to ignore this error and build without a uinit", err)
}
if len(opts.UinitArgs) > 0 {
if err := archive.AddRecord(cpio.StaticFile("etc/uinit.flags", uflag.ArgvToFile(opts.UinitArgs), 0o444)); err != nil {
if err := archive.AddRecord(cpio.StaticFile("etc/uinit.flags", fileflag.ArgvToFile(opts.UinitArgs), 0o444)); err != nil {
return fmt.Errorf("%v: could not add uinit arguments from UinitArgs (-uinitcmd) to initramfs", err)
}
}
Expand Down
27 changes: 0 additions & 27 deletions uroot/util/usage.go

This file was deleted.

Loading