1
0
mirror of https://github.com/kata-containers/kata-containers.git synced 2025-05-08 00:17:31 +00:00

Merge pull request from zhaojizhuang/debianrootfs

osbuilder: Restore Debian as a rootfs
This commit is contained in:
Bin Liu 2022-01-05 10:27:47 +08:00 committed by GitHub
commit b2166560fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 107 additions and 5 deletions
src/runtime/pkg/katatestutils
tools
osbuilder/rootfs-builder
packaging/static-build/scripts
utils

View File

@ -42,6 +42,7 @@ type testDataDistro struct {
var distros = []string{
"centos",
"clear-linux-os",
"debian",
"fedora",
"opensuse",
"rhel",

View File

@ -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@

View File

@ -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@

View File

@ -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=()

View File

@ -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

View File

@ -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"
;;

View File

@ -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'" ;;

View File

@ -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"