Skip to content

Commit

Permalink
Merge branch 'main' into wip/obbardc/image-partition-hex
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoerdsimons authored Dec 30, 2023
2 parents 0a13528 + 7969a64 commit aa282b0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 19 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
variant:
- arch
- bookworm
- bullseye
- trixie
runs-on: ubuntu-latest
defaults:
Expand Down
5 changes: 3 additions & 2 deletions actions/debootstrap_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import (
"os"
"path"
"strings"
"runtime"

"github.com/go-debos/debos"
"github.com/go-debos/fakemachine"
Expand Down Expand Up @@ -212,8 +213,8 @@ func (d *DebootstrapAction) Run(context *debos.DebosContext) error {
cmdline = append(cmdline, fmt.Sprintf("--components=%s", s))
}

/* FIXME drop the hardcoded amd64 assumption" */
foreign := context.Architecture != "amd64"
/* Only works for amd64, arm64 and riscv64 hosts, which should be enough */
foreign := context.Architecture != runtime.GOARCH

if foreign {
cmdline = append(cmdline, "--foreign")
Expand Down
31 changes: 24 additions & 7 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os"
"os/exec"
"path"
"runtime"
)

type ChrootEnterMethod int
Expand Down Expand Up @@ -292,19 +293,35 @@ func newQemuHelper(c Command) qemuHelper {

switch c.Architecture {
case "armhf", "armel", "arm":
q.qemusrc = "/usr/bin/qemu-arm-static"
if runtime.GOARCH != "arm64" && runtime.GOARCH != "arm" {
q.qemusrc = "/usr/bin/qemu-arm-static"
}
case "arm64":
q.qemusrc = "/usr/bin/qemu-aarch64-static"
if runtime.GOARCH != "arm64" {
q.qemusrc = "/usr/bin/qemu-aarch64-static"
}
case "mips":
q.qemusrc = "/usr/bin/qemu-mips-static"
case "mipsel":
q.qemusrc = "/usr/bin/qemu-mipsel-static"
if runtime.GOARCH != "mips64le" && runtime.GOARCH != "mipsle" {
q.qemusrc = "/usr/bin/qemu-mipsel-static"
}
case "mips64el":
q.qemusrc = "/usr/bin/qemu-mips64el-static"
if runtime.GOARCH != "mips64le" {
q.qemusrc = "/usr/bin/qemu-mips64el-static"
}
case "riscv64":
q.qemusrc = "/usr/bin/qemu-riscv64-static"
case "amd64", "i386":
/* Dummy, no qemu */
if runtime.GOARCH != "riscv64" {
q.qemusrc = "/usr/bin/qemu-riscv64-static"
}
case "i386":
if runtime.GOARCH != "amd64" && runtime.GOARCH != "386" {
q.qemusrc = "/usr/bin/qemu-i386-static"
}
case "amd64":
if runtime.GOARCH != "amd64" {
q.qemusrc = "/usr/bin/qemu-x86_64-static"
}
default:
log.Panicf("Don't know qemu for Architecture %s", c.Architecture)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/14rcole/gopopulate v0.0.0-20180821133914-b175b219e774 // indirect
github.com/alessio/shellescape v1.4.2
github.com/docker/go-units v0.5.0
github.com/go-debos/fakemachine v0.0.7
github.com/go-debos/fakemachine v0.0.8
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/google/uuid v1.4.0
github.com/jessevdk/go-flags v1.5.0
Expand Down
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/go-debos/fakemachine v0.0.7-0.20231110164520-5b4b7a21f3f6 h1:SEK7MCa4Ea9JisNgcDbMdK0TMczXLGZPiXtJJkNxY2g=
github.com/go-debos/fakemachine v0.0.7-0.20231110164520-5b4b7a21f3f6/go.mod h1:FJxCgej/pEl7zHZ4xUrVncvjAQ2oMyQ/zQcMKpjST2o=
github.com/go-debos/fakemachine v0.0.7 h1:TyAnZZvlfyWSzT93gMNgMfHijL9guVoNt40IaHV/Xuk=
github.com/go-debos/fakemachine v0.0.7/go.mod h1:FJxCgej/pEl7zHZ4xUrVncvjAQ2oMyQ/zQcMKpjST2o=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/go-debos/fakemachine v0.0.8 h1:qCQLQ+dKLQE4ZMbJLMP+vnSrNiFuIBJjP5pnbLT4xpg=
github.com/go-debos/fakemachine v0.0.8/go.mod h1:65Ym4PfsS5ayO0trZ8UoJZFriIBLqbwjrcMKqoaUQoQ=
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
github.com/klauspost/compress v1.15.3 h1:wmfu2iqj9q22SyMINp1uQ8C2/V4M1phJdmH9fG4nba0=
github.com/klauspost/compress v1.15.3/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sjoerdsimons/ostree-go v0.0.0-20201014091107-8fae757256f8 h1:fLxnJNJ++tkunS7BATed+mFqhA8KZYG7kT+WYEarYU4=
Expand All @@ -38,8 +36,8 @@ github.com/surma/gocpio v1.1.0/go.mod h1:zaLNaN+EDnfSnNdWPJJf9OZxWF817w5dt8JNzF9
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/freddierice/go-losetup.v1 v1.0.0-20170407175016-fc9adea44124 h1:aPcd9iBdqpFyYkoGRQbQd+asp162GIRDvAVB0FhLxhc=
Expand Down

0 comments on commit aa282b0

Please sign in to comment.