gokrazy / tools

this repository contains the gok CLI tool of gokrazy
https://gokrazy.org
BSD 3-Clause "New" or "Revised" License
50 stars 26 forks source link

gokrazy packer is throwing error "" #35

Closed plkumar closed 2 years ago

plkumar commented 2 years ago

input command:

➜  hello gokr-packer \
  -update=yes \
  -overwrite=/dev/sde \
  github.com/gokrazy/hello \
  github.com/gokrazy/breakglass \
  github.com/gokrazy/serial-busybox \
  github.com/gokrazy/iptables \
  github.com/gokrazy/nsenter \
  github.com/gokrazy/podman

Expected Behavior: write to SD card.

Current Behavior:

gokrazy packer v0.0.0-20220501111923-8579a1abae08 on GOARCH=amd64 GOOS=linux

Updating gokrazy installation on http://gokrazy

Build target: CGO_ENABLED=0 GOARCH=arm64 GOOS=linux
Build timestamp: 2022-05-04T13:07:42+05:30
Loading system CA certificates from /etc/ssl/certs/ca-certificates.crt
Building 6 Go packages:

  github.com/gokrazy/hello

  github.com/gokrazy/breakglass

  github.com/gokrazy/serial-busybox

  github.com/gokrazy/iptables
    will include extra files in the root file system
      from /home/someuser/go/pkg/mod/github.com/gokrazy/iptables@v0.0.0-20220430161629-c06191ed169e/_gokrazy/extrafiles_arm64.tar
      last modified: 2022-04-30T00:01:36+05:30 (109h6m7s ago)

  github.com/gokrazy/nsenter

  github.com/gokrazy/podman
    will include extra files in the root file system
      from /home/someuser/go/pkg/mod/github.com/gokrazy/podman@v0.0.0-20220414153303-a16c9ff9f82c/_gokrazy/extrafiles_arm64.tar
      last modified: 2021-11-15T01:13:35+05:30 (4091h54m8s ago)

[done] in 2.93s                        
2022/05/04 13:07:47 Adding loadable kernel modules from modulesDir=/home/someuser/go/pkg/mod/github.com/gokrazy/kernel@v0.0.0-20220428074446-79ddc444cba0/lib/modules
[done] in 3.28s               
2022/05/04 13:07:50 probing url for https: Get "http://gokrazy": dial tcp 192.168.1.161:80: connect: no route to host

trying to reach the gokrazy host, while i'm trying to create new image on the existing SD Card, this behavior is reproducibple when using podman package.

stapelberg commented 2 years ago

Don’t use both -update=yes and -overwrite. Use only one of them. I’ll add a commit later to make the packer error more clearly in this situation.

plkumar commented 2 years ago

@stapelberg removing --update=yes worked.

will a simple check like below works? if yes, I can submit a PR.

    if *overwrite != "" && updateflag.NewInstallation() {
        flag.Usage();
    }