File: arch.sh

package info (click to toggle)
charliecloud 0.43-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 3,084 kB
  • sloc: python: 6,021; sh: 4,284; ansic: 3,863; makefile: 598
file content (17 lines) | stat: -rwxr-xr-x 370 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# Print architecture in a format that Docker / Silicon Valley understands.
# Don’t we love how uname(1), Docker, and nVidia all disagree on arch names?

case $(uname -m) in
    x86_64)
        echo amd64
        ;;
    aarch64)
        echo arm64
        ;;
    *)
        echo "error: unknown architecture: $(uname -m)" 1>&2
        exit 1
        ;;
esac