1
0
mirror of https://github.com/kata-containers/kata-containers.git synced 2025-05-07 16:07:37 +00:00
kata-containers/tools/osbuilder/rootfs-builder/template/rootfs_lib_template.sh
Salvador Fuentes 715d342519 osbuilder: move code into tools directory
move all osbuilder files into `tools` directory to be able
to merge this into kata-containers repo.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-04-29 16:45:00 -05:00

50 lines
1.3 KiB
Bash

# - 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
#
# Note: For some distros, the build_rootfs() function provided in scripts/lib.sh
# will suffice. If a new distro is introduced with a special requirement,
# then, a rootfs_builder/<distro>/rootfs_lib.sh file should be created
# using this template.
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}
}