packaging: replace arch with uname -m

All instances of the deprecated `arch` command are now replaced with `uname -m`.

Bumps kernel/kata_config_version to 34.

Fixes: #423

Signed-off-by: Rasmus Moorats <me@neonsea.uk>
This commit is contained in:
Rasmus Moorats
2019-04-21 06:34:44 +01:00
parent f758083836
commit 3f6b64d805
7 changed files with 12 additions and 12 deletions

View File

@@ -30,7 +30,7 @@ install_yq() {
local yq_pkg="github.com/mikefarah/yq" local yq_pkg="github.com/mikefarah/yq"
[ -x "${yq_path}" ] && return [ -x "${yq_path}" ] && return
case "$(arch)" in case "$(uname -m)" in
"aarch64") "aarch64")
goarch=arm64 goarch=arm64
;; ;;
@@ -48,7 +48,7 @@ install_yq() {
;; ;;
"*") "*")
echo "Arch $(arch) not supported" echo "Arch $(uname -m) not supported"
exit exit
;; ;;
esac esac

View File

@@ -30,7 +30,7 @@ write_files:
runcmd: runcmd:
- {{beginTask . "Install kata"}} - {{beginTask . "Install kata"}}
- ARCH=$(arch) - ARCH=$(uname -m)
- sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/ /' > /etc/apt/sources.list.d/kata-containers.list" - sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/ /' > /etc/apt/sources.list.d/kata-containers.list"
- {{proxyVars .}} curl -sL http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/Release.key | sudo apt-key add - - {{proxyVars .}} curl -sL http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/Release.key | sudo apt-key add -
- sudo -E apt-get update - sudo -E apt-get update

View File

@@ -206,7 +206,7 @@ build_kernel() {
local kernel_path=${1:-} local kernel_path=${1:-}
[ -n "${kernel_path}" ] || die "kernel_path not provided" [ -n "${kernel_path}" ] || die "kernel_path not provided"
[ -d "${kernel_path}" ] || die "path to kernel does not exist, use ${script_name} setup" [ -d "${kernel_path}" ] || die "path to kernel does not exist, use ${script_name} setup"
[ -n "${arch_target}" ] || arch_target="$(arch)" [ -n "${arch_target}" ] || arch_target="$(uname -m)"
arch_target=$(arch_to_kernel "${arch_target}") arch_target=$(arch_to_kernel "${arch_target}")
pushd "${kernel_path}" >>/dev/null pushd "${kernel_path}" >>/dev/null
make -j $(nproc) ARCH="${arch_target}" make -j $(nproc) ARCH="${arch_target}"

View File

@@ -1 +1 @@
33 34

View File

@@ -176,7 +176,7 @@ main() {
[ -n "${kata_version}" ] || usage 1 [ -n "${kata_version}" ] || usage 1
info "Requested version: ${kata_version}" info "Requested version: ${kata_version}"
destdir="${workdir}/kata-static-${kata_version}-$(arch)" destdir="${workdir}/kata-static-${kata_version}-$(uname -m)"
info "DESTDIR ${destdir}" info "DESTDIR ${destdir}"
mkdir -p "${destdir}" mkdir -p "${destdir}"
install_image install_image

View File

@@ -16,7 +16,7 @@
script_name=${0##*/} script_name=${0##*/}
arch=$(arch) arch=$(uname -m)
# Array of configure options. # Array of configure options.
# #

View File

@@ -50,12 +50,12 @@ parts:
make \ make \
PREFIX=/snap/${SNAPCRAFT_PROJECT_NAME}/current/usr \ PREFIX=/snap/${SNAPCRAFT_PROJECT_NAME}/current/usr \
SKIP_GO_VERSION_CHECK=1 \ SKIP_GO_VERSION_CHECK=1 \
QEMUCMD=qemu-system-$(arch) QEMUCMD=qemu-system-$(uname -m)
make install \ make install \
PREFIX=/usr \ PREFIX=/usr \
DESTDIR=${SNAPCRAFT_PART_INSTALL} \ DESTDIR=${SNAPCRAFT_PART_INSTALL} \
SKIP_GO_VERSION_CHECK=1 \ SKIP_GO_VERSION_CHECK=1 \
QEMUCMD=qemu-system-$(arch) QEMUCMD=qemu-system-$(uname -m)
# A snap is read-only squashfs, unfourtunately it's not possible to use the rootfs image with DAX # A snap is read-only squashfs, unfourtunately it's not possible to use the rootfs image with DAX
# since rw access is required therefore initrd image must be used instead. # since rw access is required therefore initrd image must be used instead.
@@ -193,7 +193,7 @@ parts:
versions_url=https://raw.githubusercontent.com/kata-containers/runtime/${SNAPCRAFT_PROJECT_VERSION}/versions.yaml versions_url=https://raw.githubusercontent.com/kata-containers/runtime/${SNAPCRAFT_PROJECT_VERSION}/versions.yaml
version="$(curl -sSL ${versions_url} | yq r - assets.kernel.version | tr -d v)" version="$(curl -sSL ${versions_url} | yq r - assets.kernel.version | tr -d v)"
x_version="$(echo $version | sed -e 's|.[[:digit:]]*$||').x" x_version="$(echo $version | sed -e 's|.[[:digit:]]*$||').x"
case "$(arch)" in case "$(uname -m)" in
"x86_64") "x86_64")
config="x86_64_kata_kvm_${x_version}" config="x86_64_kata_kvm_${x_version}"
;; ;;
@@ -211,7 +211,7 @@ parts:
;; ;;
*) *)
echo "ERROR: Unsupported architecture $(arch)" echo "ERROR: Unsupported architecture $(uname -m)"
exit 1 exit 1
;; ;;
esac esac
@@ -279,7 +279,7 @@ parts:
versions_url=https://raw.githubusercontent.com/kata-containers/runtime/${SNAPCRAFT_PROJECT_VERSION}/versions.yaml versions_url=https://raw.githubusercontent.com/kata-containers/runtime/${SNAPCRAFT_PROJECT_VERSION}/versions.yaml
# arch-specific definition # arch-specific definition
case "$(arch)" in case "$(uname -m)" in
"aarch64") "aarch64")
branch="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu.architecture.aarch64.branch)" branch="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu.architecture.aarch64.branch)"
url="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu.url)" url="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu.url)"