mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-02 17:34:18 +00:00
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:
@@ -30,7 +30,7 @@ install_yq() {
|
||||
local yq_pkg="github.com/mikefarah/yq"
|
||||
[ -x "${yq_path}" ] && return
|
||||
|
||||
case "$(arch)" in
|
||||
case "$(uname -m)" in
|
||||
"aarch64")
|
||||
goarch=arm64
|
||||
;;
|
||||
@@ -48,7 +48,7 @@ install_yq() {
|
||||
;;
|
||||
|
||||
"*")
|
||||
echo "Arch $(arch) not supported"
|
||||
echo "Arch $(uname -m) not supported"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
@@ -30,7 +30,7 @@ write_files:
|
||||
runcmd:
|
||||
|
||||
- {{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"
|
||||
- {{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
|
||||
|
@@ -206,7 +206,7 @@ build_kernel() {
|
||||
local kernel_path=${1:-}
|
||||
[ -n "${kernel_path}" ] || die "kernel_path not provided"
|
||||
[ -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}")
|
||||
pushd "${kernel_path}" >>/dev/null
|
||||
make -j $(nproc) ARCH="${arch_target}"
|
||||
|
@@ -1 +1 @@
|
||||
33
|
||||
34
|
||||
|
@@ -176,7 +176,7 @@ main() {
|
||||
[ -n "${kata_version}" ] || usage 1
|
||||
info "Requested version: ${kata_version}"
|
||||
|
||||
destdir="${workdir}/kata-static-${kata_version}-$(arch)"
|
||||
destdir="${workdir}/kata-static-${kata_version}-$(uname -m)"
|
||||
info "DESTDIR ${destdir}"
|
||||
mkdir -p "${destdir}"
|
||||
install_image
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
script_name=${0##*/}
|
||||
|
||||
arch=$(arch)
|
||||
arch=$(uname -m)
|
||||
|
||||
# Array of configure options.
|
||||
#
|
||||
|
@@ -50,12 +50,12 @@ parts:
|
||||
make \
|
||||
PREFIX=/snap/${SNAPCRAFT_PROJECT_NAME}/current/usr \
|
||||
SKIP_GO_VERSION_CHECK=1 \
|
||||
QEMUCMD=qemu-system-$(arch)
|
||||
QEMUCMD=qemu-system-$(uname -m)
|
||||
make install \
|
||||
PREFIX=/usr \
|
||||
DESTDIR=${SNAPCRAFT_PART_INSTALL} \
|
||||
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
|
||||
# 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
|
||||
version="$(curl -sSL ${versions_url} | yq r - assets.kernel.version | tr -d v)"
|
||||
x_version="$(echo $version | sed -e 's|.[[:digit:]]*$||').x"
|
||||
case "$(arch)" in
|
||||
case "$(uname -m)" in
|
||||
"x86_64")
|
||||
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
|
||||
;;
|
||||
esac
|
||||
@@ -279,7 +279,7 @@ parts:
|
||||
|
||||
versions_url=https://raw.githubusercontent.com/kata-containers/runtime/${SNAPCRAFT_PROJECT_VERSION}/versions.yaml
|
||||
# arch-specific definition
|
||||
case "$(arch)" in
|
||||
case "$(uname -m)" in
|
||||
"aarch64")
|
||||
branch="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu.architecture.aarch64.branch)"
|
||||
url="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu.url)"
|
||||
|
Reference in New Issue
Block a user