mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-01 09:42:45 +00:00
rootfs: Add template files for new distros
Add template to add new distros. Added a Makefile to initialize new environment. Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
parent
75a9d5eab7
commit
206db3d585
15
rootfs-builder/template/Makefile
Normal file
15
rootfs-builder/template/Makefile
Normal file
@ -0,0 +1,15 @@
|
||||
# Copyright (c) 2017 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
#
|
||||
MK_DIR :=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
## Default destdir is one level up where is rootfs.sh script
|
||||
DESTDIR ?= "$(realpath $(MK_DIR)/../)/$(ROOTFS_BASE_NAME)"
|
||||
all:
|
||||
ifndef ROOTFS_BASE_NAME
|
||||
$(error ROOTFS_BASE_NAME is not set, use $ make ROOTFS_BASE_NAME=new_supported_os)
|
||||
endif
|
||||
mkdir -p $(DESTDIR)
|
||||
cp "$(MK_DIR)/rootfs_lib_template.sh" "$(DESTDIR)/rootfs_lib.sh"
|
||||
cp "$(MK_DIR)/config_template.sh" "$(DESTDIR)/config.sh"
|
15
rootfs-builder/template/config_template.sh
Normal file
15
rootfs-builder/template/config_template.sh
Normal file
@ -0,0 +1,15 @@
|
||||
# This is a configuration file add extra variables to
|
||||
# be used by build_rootfs() from rootfs_lib.sh the variables will be
|
||||
# loaded just before call the function.
|
||||
|
||||
# Here there are a couple of variables you may need.
|
||||
# Remove them or add more
|
||||
|
||||
#Use it rootfs is based in a system has different versions
|
||||
OS_VERSION=${OS_VERSION:-DEFAULT_VERSION}
|
||||
|
||||
#Mandatory Packages that must be installed
|
||||
# systemd: An init system that will start kata-agent
|
||||
# iptables: Need by Kata agent
|
||||
# udevlib.so: Need by Kata agent
|
||||
PACKAGES="systemd iptables udevlib.so"
|
43
rootfs-builder/template/rootfs_lib_template.sh
Normal file
43
rootfs-builder/template/rootfs_lib_template.sh
Normal file
@ -0,0 +1,43 @@
|
||||
# - Arguments
|
||||
# rootfs_dir=$1
|
||||
#
|
||||
# - Optional environment variables
|
||||
#
|
||||
# EXTRA_PKGS: Variable to add extra PKGS provided by the user
|
||||
#
|
||||
# BIN_AGENT: Name of the Kata-Agent binary
|
||||
#
|
||||
# REPO_URL: URL to distribution repository ( should be configured in
|
||||
# config.sh file)
|
||||
#
|
||||
# Any other configuration variable for a specific distro must be added
|
||||
# and documented on its own config.sh
|
||||
#
|
||||
# - Expected result
|
||||
#
|
||||
# rootfs_dir populated with rootfs pkgs
|
||||
# It must provide a binary in /sbin/init
|
||||
build_rootfs() {
|
||||
# Mandatory
|
||||
local ROOTFS_DIR=$1
|
||||
|
||||
#Name of the Kata-Agent binary
|
||||
local BIN_AGENT=${BIN_AGENT}
|
||||
|
||||
# In case of support EXTRA packages, use it to allow
|
||||
# users add more packages to the base rootfs
|
||||
local EXTRA_PKGS=${EXTRA_PKGS:-}
|
||||
|
||||
#In case rootfs is created usign repositories allow user to modify
|
||||
# the default URL
|
||||
local REPO_URL=${REPO_URL:-YOUR_REPO}
|
||||
|
||||
#PATH where files this script is placed
|
||||
#Use it to refer to files in the same directory
|
||||
#Exmaple: ${CONFIG_DIR}/foo
|
||||
local CONFIG_DIR=${CONFIG_DIR}
|
||||
|
||||
|
||||
# Populate ROOTFS_DIR
|
||||
# Must provide /sbin/init and /bin/${BIN_AGENT}
|
||||
}
|
Loading…
Reference in New Issue
Block a user