Skip to content

[pull] main from u-root:main #119

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

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
598c62a
pkg/securelaunch: use bytes.Equals instead bytes.Compare
binjip978 Apr 10, 2025
9640da5
cmds/exp/netbootxyz: fix staticcheck gosimple issues
binjip978 Apr 12, 2025
5b7ddb7
pkg/boot/universalpayload: omit comparison with boolean constant
binjip978 Apr 12, 2025
5b03078
pkg/boot/menu: omit redundant nil check
binjip978 Apr 12, 2025
c2c4fe8
cmds/exp/tcpdump: use String() instead of fmt.Sprintf
binjip978 Apr 12, 2025
1e6b090
cmds/core/netcat: eliminate dead condition
lersek Apr 11, 2025
54895c5
pkg/netcat: move SSLOptions.GenerateTLSConfiguration() to temporary s…
lersek Apr 11, 2025
b7e857a
netcat: clean up SSL option processing
lersek Apr 11, 2025
e3be209
integration/generic-tests/netcat_test: make netcatVM() variadic
lersek Apr 14, 2025
b5d4025
integration/generic-tests: add netcat SSL tests
lersek Apr 14, 2025
eb2382b
cmds/core/netcat: clean-up usage message
jensdrenhaus Apr 10, 2025
ee241b0
build(deps): bump golang.org/x/net from 0.37.0 to 0.38.0
dependabot[bot] Apr 16, 2025
b5e3690
pkg/watchdogd: remove cleanup loop
binjip978 Apr 13, 2025
98badbe
pkg/boot/bls: remove redundant brake
binjip978 Apr 17, 2025
665a02a
golangci: add gosimple (part of staticcheck) linter
binjip978 Apr 17, 2025
4606a94
cmds/core/echo: use ReplaceAll
binjip978 Apr 19, 2025
41e46d4
pkg/smbios: Provide a new method to get SMBIOS3 header size
AjanZhong Apr 3, 2025
443bcfe
pkg/boot/universalpayload: Provide SMBIO3 info in device tree
AjanZhong Apr 3, 2025
90ae175
pkg/boot/universalpayload: Separate Load method to Load and Exec
AjanZhong Apr 10, 2025
3331571
pkg/boot/universalpayload: Suppress warning message printing
AjanZhong Apr 10, 2025
85effb4
pkg/boot/universalpayload: Add test case to cover SMBIOS3 node
AjanZhong Apr 15, 2025
510c604
golangci: migrate to v2
binjip978 Apr 21, 2025
ac885c3
cmds/core/ip: add missing newline to print
quite Apr 22, 2025
f0e05c3
.circleci/images: enable the tc-u32 filter type in kernel configs
lersek Apr 22, 2025
783d474
.vmtest.yaml: advance to kernels with the tc-u32 filter type enabled
lersek Apr 25, 2025
3538648
pkg/tc: fix qdisc parent parsing
lersek Apr 16, 2025
6c598ca
pkg/tc: simplify ShowQdisc
lersek Apr 24, 2025
c5e2ab2
pkg/tc: print qdisc handle and parent in ShowQdisc
lersek Apr 24, 2025
54874cd
pkg/tc: print r2q, default, and direct_qlen for HTB qdisc
lersek Apr 24, 2025
769d565
pkg/tc: fix getTickInUsec and CalcXMitTime, for parsing HTB class args
lersek Apr 24, 2025
6629be8
pkg/tc: remove debug output from ParseHTBClassArgs
lersek Apr 24, 2025
dd14b99
pkg/tc: print class handle and parent in ShowClass
lersek Apr 24, 2025
3c4d7c2
pkg/tc: print prio, rate, ceil, burst, and cburst for HTB class
lersek Apr 24, 2025
530ebee
pkg/tc: slightly extend filter priority parsing
lersek Apr 16, 2025
1a3c738
pkg/tc: fix priority and EtherType management for filters
lersek Apr 22, 2025
58c921f
pkg/tc: remove debug output from AddFilter
lersek Apr 24, 2025
ab89420
pkg/tc: tweak ShowFilter output
lersek Apr 24, 2025
de2f62b
pkg/tc: add minimal tc-u32 filter parser and formatter
lersek Apr 17, 2025
73ac2c0
integration/generic-tests: add "tc" integration test
lersek Apr 16, 2025
881d56d
pkg/tftp: fix TransferMode
jensdrenhaus Apr 24, 2025
78890dc
pkg/tftp: fix upload multiple files
jensdrenhaus Apr 28, 2025
35c2a2f
cmds/exp/tftp: fix parsing port number
jensdrenhaus Apr 28, 2025
382310d
cmds/exp/tftp: clean up help text
jensdrenhaus Apr 28, 2025
b4be65d
cmds/exp/tftpd: Add a simple TFTP server
jensdrenhaus Apr 24, 2025
6408c2d
integration/generic-tests: Add tftp test
jensdrenhaus Apr 24, 2025
ba931e6
cmds/exp/tftp: remove markdown docu
jensdrenhaus Apr 29, 2025
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
1 change: 1 addition & 0 deletions .circleci/images/kernel-amd64/config_linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ CONFIG_NET_SCH_CODEL=y
CONFIG_NET_SCH_FQ_CODEL=y
CONFIG_NET_CLS=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_U32=y
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_GACT=y

Expand Down
1 change: 1 addition & 0 deletions .circleci/images/kernel-arm/config_linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ CONFIG_NET_SCH_CODEL=y
CONFIG_NET_SCH_FQ_CODEL=y
CONFIG_NET_CLS=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_U32=y
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_GACT=y

Expand Down
1 change: 1 addition & 0 deletions .circleci/images/kernel-arm64/config_linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ CONFIG_NET_SCH_CODEL=y
CONFIG_NET_SCH_FQ_CODEL=y
CONFIG_NET_CLS=y
CONFIG_NET_CLS_BASIC=y
CONFIG_NET_CLS_U32=y
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_GACT=y

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.24'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v7
with:
version: v1.64.5
args: --out-format=line-number --timeout=5m
version: v2.1.2
args: --timeout=5m
75 changes: 42 additions & 33 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
version: "2"
linters:
disable-all: true
default: none
enable:
- revive
- errorlint
- ineffassign
- revive
- staticcheck
- stylecheck
- errorlint

linters-settings:
staticcheck:
checks: ["all", "-SA1019"]
stylecheck:
checks: ["all", "-ST1003"]
errorlint:
errorf: true
asserts: false
comparison: false

issues:
exclude-dirs:
- pkg/uroot/test
exclude-rules:
- linters: [revive]
text: "don't use underscores"
- linters: [revive]
text: "don't use ALL_CAPS"
- linters: [revive]
text: "stutter"
- linters: [revive]
text: "unexported-return"
- linters: [revive]
text: "unused-parameter"
- linters: [revive]
text: "superfluous-else"
- linters: [revive]
text: "empty-block"
settings:
errorlint:
errorf: true
asserts: false
comparison: false
staticcheck:
checks:
- all
- -SA1019
- -ST1003
- -QF*
exclusions:
presets:
- comments
rules:
- linters:
- revive
text: don't use underscores
- linters:
- revive
text: don't use ALL_CAPS
- linters:
- revive
text: stutter
- linters:
- revive
text: unexported-return
- linters:
- revive
text: unused-parameter
- linters:
- revive
text: superfluous-else
- linters:
- revive
text: empty-block
paths:
- pkg/uroot/test
6 changes: 3 additions & 3 deletions .vmtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ amd64:
qemu: "/zqemu"

VMTEST_KERNEL:
container: "ghcr.io/u-root/u-root/test-kernel-amd64@sha256:0b4f399fd61f2f5e060c86216150ec12439851101921337add61402c185e8007"
container: "ghcr.io/u-root/u-root/test-kernel-amd64@sha256:f27fc07be718df785b2ce4a21a6eece6daf0532f7c971cec279d84806b0f04c3"
template: "{{.bzImage}}"
files:
bzImage: "/bzImage"
Expand All @@ -31,7 +31,7 @@ arm:
qemu: "/zqemu"

VMTEST_KERNEL:
container: "ghcr.io/u-root/u-root/test-kernel-arm@sha256:0429fa0ab8dbc4d1913f1c2b8ccc45fa8000897c801ed90b90c14a15e1f32020"
container: "ghcr.io/u-root/u-root/test-kernel-arm@sha256:9877321ee56df88e1cd9a19a3431d0952f27a997a5c182f66007ebc8b94df4e8"
template: "{{.zImage}}"
files:
zImage: "/zImage"
Expand All @@ -44,7 +44,7 @@ arm64:
qemu: "/zqemu"

VMTEST_KERNEL:
container: "ghcr.io/u-root/u-root/test-kernel-arm64@sha256:e48f32266071edaec44445da98375fe512b1532640e256f9f7138633e0000866"
container: "ghcr.io/u-root/u-root/test-kernel-arm64@sha256:9e861fbab497a182c8397a34d371d6924ac65e8a3f044343d87f3cdfaa8ae4a4"
template: "{{.Image}}"
files:
Image: "/Image"
2 changes: 1 addition & 1 deletion cmds/core/echo/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func escapeString(s string) (string, error) {
}

s = strings.Split(s, "\\c")[0]
s = strings.Replace(s, "\\0", "\\", -1)
s = strings.ReplaceAll(s, "\\0", "\\")

// Quote the string and scan it through %q to interpret backslash escapes
s = fmt.Sprintf("\"%s\"", s)
Expand Down
2 changes: 1 addition & 1 deletion cmds/core/ip/route_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (cmd *cmd) routeAdddefault() error {
}
switch nh {
case "via":
fmt.Fprintf(cmd.Out, "Add default route %v via %v", nhval, l.Attrs().Name)
fmt.Fprintf(cmd.Out, "Add default route %v via %v\n", nhval, l.Attrs().Name)
r := &netlink.Route{LinkIndex: l.Attrs().Index, Gw: nhval}
if err := cmd.handle.RouteAdd(r); err != nil {
return fmt.Errorf("error adding default route to %v: %w", l.Attrs().Name, err)
Expand Down
11 changes: 10 additions & 1 deletion cmds/core/kexec/kexec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,17 @@ func run(args []string) error {
return fmt.Errorf("usage: kexec [fs] kernelname OR kexec -e")
}

if err := universalpayload.Load(opts.kernelpath, linux.Debug); err != nil {
if err, warningMsg := universalpayload.Load(opts.kernelpath, linux.Debug); err != nil {
log.Printf("Failed to load universalpayload (%v), try legacy kernel..", err)
} else {
// universalpayload package suppresses warning message, we print messages here.
if warningMsg != nil {
log.Printf("Warning messages from universalpayload:\n%v\n", warningMsg)
}

if err := universalpayload.Exec(); err != nil {
log.Printf("Failed to execute universalpayload (%v), try legacy kernel..", err)
}
}

if opts.cmdline != "" && opts.reuseCmdline {
Expand Down
2 changes: 1 addition & 1 deletion cmds/core/netcat/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (c *cmd) establishConnection(network, address string) (net.Conn, error) {
} else {
// TLS Support
if c.config.SSLConfig.Enabled || c.config.SSLConfig.VerifyTrust {
tlsConfig, err := c.config.SSLConfig.GenerateTLSConfiguration()
tlsConfig, err := c.config.SSLConfig.GenerateTLSConfiguration(false)
if err != nil {
return nil, err
}
Expand Down
9 changes: 6 additions & 3 deletions cmds/core/netcat/listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,19 @@ func (c *cmd) setupListener(network, address string) (net.Listener, error) {
}

switch c.config.ProtocolOptions.SocketType {
case netcat.SOCKET_TYPE_TCP, netcat.SOCKET_TYPE_UNIX:
if c.config.SSLConfig.Enabled || c.config.SSLConfig.VerifyTrust {
tlsConfig, err := c.config.SSLConfig.GenerateTLSConfiguration()
case netcat.SOCKET_TYPE_TCP:
if c.config.SSLConfig.Enabled {
tlsConfig, err := c.config.SSLConfig.GenerateTLSConfiguration(true)
if err != nil {
return nil, fmt.Errorf("failed generating TLS configuration: %w", err)
}

return tls.Listen(network, address, tlsConfig)

}
fallthrough

case netcat.SOCKET_TYPE_UNIX:
return net.Listen(network, address)

case netcat.SOCKET_TYPE_UDP, netcat.SOCKET_TYPE_UDP_UNIX:
Expand Down
Loading