containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.83k stars 2.42k forks source link

Architecture / Variant Detection on Raspberry Pi 1 based SOCs #22380

Closed timway closed 7 months ago

timway commented 7 months ago

Issue Description

I recently have been playing with a Raspberry Pi Zero W with the official Raspberry Pi OS (32-bit) on it. This uses the same SOC as the original Raspberry Pi and is only armv6l from arch or uname -m. After installing podman from the repositories images silently fail to run in most causes. Manually specifying an linux/arm/v6 image works as expected, like podman run --rm --tty docker.io/arm32v6/hello-world@sha256:3ed0980a51d56657fce781ac8581ca6a94f4fd0d24a298b930dde0db8d7d17da

Steps to reproduce the issue

Steps to reproduce the issue

  1. Acquire a Raspberry Zero W or similar and use Raspberry Pi OS 32-bit Bookworm OS
  2. Install podman from the OS repositories with apt install podman
  3. Run podman run --rm --tty docker.io/hello-world

Describe the results you received

It just silently fails, more complex binaries that actually call instructions not available cause segfaults. I'd expect it to detect that the architecture is not correct at least and refuse to run an image (without installing qemu and doing emulation).

Describe the results you expected

It works like any other podman run ... on different architectures.

podman info output

$ podman info
host:
  arch: arm
  buildahVersion: 1.28.2
  cgroupControllers:
  - cpu
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon_2.1.6+ds1-1_armhf
    path: /usr/bin/conmon
    version: 'conmon version 2.1.6, commit: unknown'
  cpuUtilization:
    idlePercent: 98.98
    systemPercent: 0.29
    userPercent: 0.73
  cpus: 1
  distribution:
    codename: bookworm
    distribution: raspbian
    version: "12"
  eventLogger: journald
  hostname: woodstock
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 6.6.20+rpt-rpi-v6
  linkmode: dynamic
  logDriver: journald
  memFree: 95354880
  memTotal: 448712704
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun_1.8.1-1+deb12u1_armhf
    path: /usr/bin/crun
    version: |-
      crun version 1.8.1
      commit: f8a096be060b22ccd3d5f3ebe44108517fbf6c30
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns_1.2.0-1_armhf
    version: |-
      slirp4netns version 1.2.0
      commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.4
  swapFree: 77066240
  swapTotal: 104853504
  uptime: 265h 48m 47.00s (Approximately 11.04 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/notroot/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: vfs
  graphOptions: {}
  graphRoot: /home/notroot/.local/share/containers/storage
  graphRootAllocated: 503310581760
  graphRootUsed: 5413261312
  graphStatus: {}
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 10
  runRoot: /run/user/1000/containers
  volumePath: /home/notroot/.local/share/containers/storage/volumes
version:
  APIVersion: 4.3.1
  Built: 0
  BuiltTime: Wed Dec 31 18:00:00 1969
  GitCommit: ""
  GoVersion: go1.19.8
  Os: linux
  OsArch: linux/arm
  Version: 4.3.1

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

No

Additional environment details

$ arch
armv6l
$ uname -a
Linux woodstock 6.6.20+rpt-rpi-v6 #1 Raspbian 1:6.6.20-1+rpt1 (2024-03-07) armv6l GNU/Linux
$ uname -m
armv6l

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

afbjorklund commented 7 months ago

It is important that the "arm/v6" notation is used here, since "arm" nowadays default to using "arm/v7" (or arm64/v8)

I'm not sure that the older arm32 is correctly supported by the Podman ecosystem, you might need to get a Zero 2 W.

https://fedoraproject.org/wiki/Architectures/ARM/Raspberry_Pi

Fedora doesn't, and NEVER will, support ARMv6 processors. There's been a number of attempts to support these over the years, none are currently active.

afbjorklund commented 7 months ago

Specifically code like this is wrong:

libpod/define/version.go:               OsArch:     runtime.GOOS + "/" + runtime.GOARCH,
pkg/bindings/system/system.go:          OsArch:     fmt.Sprintf("%s/%s", component.Os, component.Arch),

Since it is missing the Variant (v6)

Luap99 commented 7 months ago

This was fixed in https://github.com/containers/image/pull/2086 (podman 5.0)

timway commented 7 months ago

Thanks @Luap99 I obviously missed that in my pre-issue search.