Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #227 from jodh-intel/remove-arch-calls
Browse files Browse the repository at this point in the history
arch: Remove calls to arch command
  • Loading branch information
grahamwhaley authored Feb 28, 2019
2 parents 56f1044 + f38c67d commit da9f541
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion image-builder/image_builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ MAX_IMG_SIZE_MB=2048
FS_TYPE=${FS_TYPE:-"ext4"}

# In order to support memory hotplug, image must be aligned to memory section(size in MB) according to different architecture.
ARCH=$(arch)
ARCH=$(uname -m)
case "$ARCH" in
aarch64) MEM_BOUNDARY_MB=1024 ;;
*) MEM_BOUNDARY_MB=128 ;;
Expand Down
4 changes: 1 addition & 3 deletions rootfs-builder/alpine/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@

From golang:@[email protected]

# The "coreutils" package on alpine for reasons unknown does not provide arch(1), so simulate it.
RUN apk update && apk add git make bash gcc musl-dev linux-headers apk-tools-static libseccomp libseccomp-dev && \
echo -e '#!/bin/sh\nuname -m' > /usr/bin/arch && chmod +x /usr/bin/arch
RUN apk update && apk add git make bash gcc musl-dev linux-headers apk-tools-static libseccomp libseccomp-dev
4 changes: 2 additions & 2 deletions rootfs-builder/rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ lib_file="${script_dir}/../scripts/lib.sh"
source "$lib_file"

# Default architecture
ARCH=$(arch)
ARCH=$(uname -m)

# Load default versions for golang and other componets
source "${script_dir}/versions.txt"
Expand Down Expand Up @@ -162,7 +162,7 @@ generate_dockerfile()
{
dir="$1"

case "$(arch)" in
case "$(uname -m)" in
"ppc64le")
goarch=ppc64le
;;
Expand Down
4 changes: 2 additions & 2 deletions rootfs-builder/ubuntu/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ PACKAGES="systemd iptables init"

DEBOOTSTRAP=${PACKAGE_MANAGER:-"debootstrap"}

case $(arch) in
case $(uname -m) in
x86_64) ARCHITECTURE="amd64";;
ppc64le) ARCHITECTURE="ppc64el";;
aarch64) ARCHITECTURE="arm64";;
s390x) ARCHITECTURE="s390x";;
(*) die "$(arch) not supported "
(*) die "$(uname -m) not supported "
esac

# Init process must be one of {systemd,kata-agent}
Expand Down

0 comments on commit da9f541

Please sign in to comment.