diff --git a/src/runtime/pkg/katatestutils/constraints_test.go b/src/runtime/pkg/katatestutils/constraints_test.go index 2a60bbe3e3..314d017c1e 100644 --- a/src/runtime/pkg/katatestutils/constraints_test.go +++ b/src/runtime/pkg/katatestutils/constraints_test.go @@ -42,6 +42,7 @@ type testDataDistro struct { var distros = []string{ "centos", "clear-linux-os", + "debian", "fedora", "opensuse", "rhel", diff --git a/tools/osbuilder/rootfs-builder/debian/Dockerfile-aarch64.in b/tools/osbuilder/rootfs-builder/debian/Dockerfile-aarch64.in new file mode 100644 index 0000000000..727506f47a --- /dev/null +++ b/tools/osbuilder/rootfs-builder/debian/Dockerfile-aarch64.in @@ -0,0 +1,34 @@ +# +# Copyright (c) 2020 ARM Limited +# +# SPDX-License-Identifier: Apache-2.0 + +ARG IMAGE_REGISTRY=docker.io +# NOTE: OS_VERSION is set according to config.sh +FROM ${IMAGE_REGISTRY}/debian:@OS_VERSION@ + +# RUN commands +RUN apt-get update && apt-get install -y \ + autoconf \ + automake \ + binutils \ + build-essential \ + chrony \ + coreutils \ + curl \ + debianutils \ + debootstrap \ + g++ \ + gcc \ + git \ + libc-dev \ + libstdc++-8-dev \ + m4 \ + make \ + sed \ + systemd \ + tar \ + vim +# This will install the proper packages to build Kata components +@INSTALL_MUSL@ +@INSTALL_RUST@ diff --git a/tools/osbuilder/rootfs-builder/debian/Dockerfile.in b/tools/osbuilder/rootfs-builder/debian/Dockerfile.in new file mode 100644 index 0000000000..685dd0f4d5 --- /dev/null +++ b/tools/osbuilder/rootfs-builder/debian/Dockerfile.in @@ -0,0 +1,40 @@ +# +# Copyright (c) 2018 SUSE +# +# SPDX-License-Identifier: Apache-2.0 + +ARG IMAGE_REGISTRY=docker.io +# NOTE: OS_VERSION is set according to config.sh +FROM ${IMAGE_REGISTRY}/debian:@OS_VERSION@ + +# RUN commands +RUN apt-get update && apt-get --no-install-recommends install -y \ + apt-utils \ + autoconf \ + automake \ + binutils \ + build-essential \ + ca-certificates \ + chrony \ + coreutils \ + curl \ + debianutils \ + debootstrap \ + g++ \ + gcc \ + git \ + libc-dev \ + libstdc++-8-dev \ + m4 \ + make \ + musl \ + musl-dev \ + musl-tools \ + sed \ + systemd \ + tar \ + vim \ + wget + +# This will install the proper packages to build Kata components +@INSTALL_RUST@ diff --git a/tools/osbuilder/rootfs-builder/debian/config.sh b/tools/osbuilder/rootfs-builder/debian/config.sh new file mode 100644 index 0000000000..f87370921d --- /dev/null +++ b/tools/osbuilder/rootfs-builder/debian/config.sh @@ -0,0 +1,20 @@ +# +# Copyright (c) 2018 SUSE +# +# SPDX-License-Identifier: Apache-2.0 + +OS_VERSION=${OS_VERSION:-10.11} + +# Set OS_NAME to the desired debian "codename" +OS_NAME=${OS_NAME:-"stretch"} + +PACKAGES="systemd coreutils init chrony kmod" + +# NOTE: Re-using ubuntu rootfs configuration, see 'ubuntu' folder for full content. +source $script_dir/ubuntu/$CONFIG_SH + +# Init process must be one of {systemd,kata-agent} +INIT_PROCESS=systemd +# List of zero or more architectures to exclude from build, +# as reported by `uname -m` +ARCH_EXCLUDE_LIST=() diff --git a/tools/osbuilder/rootfs-builder/debian/rootfs_lib.sh b/tools/osbuilder/rootfs-builder/debian/rootfs_lib.sh new file mode 100644 index 0000000000..f6aae26364 --- /dev/null +++ b/tools/osbuilder/rootfs-builder/debian/rootfs_lib.sh @@ -0,0 +1,7 @@ +# +# Copyright (c) 2018 SUSE +# +# SPDX-License-Identifier: Apache-2.0 + +# NOTE: Re-using ubuntu rootfs lib, see 'ubuntu' folder for details. +source ${script_dir}/ubuntu/$LIB_SH diff --git a/tools/osbuilder/rootfs-builder/rootfs.sh b/tools/osbuilder/rootfs-builder/rootfs.sh index f63e8aee65..ce17ba6cf5 100755 --- a/tools/osbuilder/rootfs-builder/rootfs.sh +++ b/tools/osbuilder/rootfs-builder/rootfs.sh @@ -193,7 +193,7 @@ docker_extra_args() args+=" -v ${gentoo_local_portage_dir}:/usr/portage/packages" args+=" --volumes-from ${gentoo_portage_container}" ;; - ubuntu | suse) + debian | ubuntu | suse) source /etc/os-release case "$ID" in @@ -520,8 +520,8 @@ EOT chrony_conf_file="${ROOTFS_DIR}/etc/chrony/chrony.conf" chrony_systemd_service="${ROOTFS_DIR}/lib/systemd/system/chronyd.service" ;; - "ubuntu") - echo "I am ubuntu" + "ubuntu" | "debian") + echo "I am ubuntu or debian" chrony_conf_file="${ROOTFS_DIR}/etc/chrony/chrony.conf" chrony_systemd_service="${ROOTFS_DIR}/lib/systemd/system/chrony.service" ;; diff --git a/tools/packaging/static-build/scripts/kata-configure-docker.sh b/tools/packaging/static-build/scripts/kata-configure-docker.sh index 43996b79ed..7c53090215 100644 --- a/tools/packaging/static-build/scripts/kata-configure-docker.sh +++ b/tools/packaging/static-build/scripts/kata-configure-docker.sh @@ -122,7 +122,7 @@ setup() case "$distro" in centos|rhel) $chronic sudo -E yum -y install "$pkg" ;; - ubuntu) $chronic sudo -E apt-get --no-install-recommends install -y "$pkg" ;; + debian|ubuntu) $chronic sudo -E apt-get --no-install-recommends install -y "$pkg" ;; fedora) $chronic sudo -E dnf -y install "$pkg" ;; opensuse|sles) $chronic sudo -E zypper -y install "$pkg" ;; *) die "do not know how to install command $pkg' for distro '$distro'" ;; diff --git a/utils/kata-manager.sh b/utils/kata-manager.sh index 732fb16ecb..7ed3b7fecd 100755 --- a/utils/kata-manager.sh +++ b/utils/kata-manager.sh @@ -289,7 +289,7 @@ check_deps() case "$ID" in centos|rhel) sudo yum -y install $packages ;; - ubuntu) sudo apt-get -y install $packages ;; + debian|ubuntu) sudo apt-get -y install $packages ;; fedora) sudo dnf -y install $packages ;; opensuse*|sles) sudo zypper install -y $packages ;; *) die "Unsupported distro: $ID"