rootfs: Conditionally add libseccomp support in rootfs image

If the rootfs is built with SECCOMP=yes environment
variable then include libseccomp package inside the
rootfs image. Else do not include it.

Fixes: #155

Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
This commit is contained in:
Nitesh Konkar 2018-11-09 00:27:44 +05:30
parent a588140bc6
commit 7f2371858c
7 changed files with 14 additions and 1 deletions

View File

@ -22,3 +22,5 @@ INIT_PROCESS=kata-agent
# List of zero or more architectures to exclude from build, # List of zero or more architectures to exclude from build,
# as reported by `uname -m` # as reported by `uname -m`
ARCH_EXCLUDE_LIST=() ARCH_EXCLUDE_LIST=()
[ "$SECCOMP" = "yes" ] && PACKAGES+=" libseccomp" || true

View File

@ -34,3 +34,5 @@ INIT_PROCESS=systemd
# List of zero or more architectures to exclude from build, # List of zero or more architectures to exclude from build,
# as reported by `uname -m` # as reported by `uname -m`
ARCH_EXCLUDE_LIST=() ARCH_EXCLUDE_LIST=()
[ "$SECCOMP" = "yes" ] && PACKAGES+=" libseccomp" || true

View File

@ -27,3 +27,5 @@ INIT_PROCESS=systemd
# List of zero or more architectures to exclude from build, # List of zero or more architectures to exclude from build,
# as reported by `uname -m` # as reported by `uname -m`
ARCH_EXCLUDE_LIST=(ppc64le) ARCH_EXCLUDE_LIST=(ppc64le)
[ "$SECCOMP" = "yes" ] && PACKAGES+=" libseccomp" || true

View File

@ -25,3 +25,5 @@ ARCH_EXCLUDE_LIST=()
# Allow the build to fail without generating an error. # Allow the build to fail without generating an error.
# For more info see: https://github.com/kata-containers/osbuilder/issues/190 # For more info see: https://github.com/kata-containers/osbuilder/issues/190
BUILD_CAN_FAIL=1 BUILD_CAN_FAIL=1
[ "$SECCOMP" = "yes" ] && PACKAGES+=" libseccomp" || true

View File

@ -19,3 +19,5 @@ PACKAGES="iptables"
# Init process must be one of {systemd,kata-agent} # Init process must be one of {systemd,kata-agent}
INIT_PROCESS=systemd INIT_PROCESS=systemd
ARCH_EXCLUDE_LIST=() ARCH_EXCLUDE_LIST=()
[ "$SECCOMP" = "yes" ] && PACKAGES+=" libseccomp" || true

View File

@ -326,6 +326,7 @@ if [ -n "${USE_DOCKER}" ] ; then
--env EXTRA_PKGS="${EXTRA_PKGS}" \ --env EXTRA_PKGS="${EXTRA_PKGS}" \
--env OSBUILDER_VERSION="${OSBUILDER_VERSION}" \ --env OSBUILDER_VERSION="${OSBUILDER_VERSION}" \
--env INSIDE_CONTAINER=1 \ --env INSIDE_CONTAINER=1 \
--env SECCOMP="${SECCOMP}" \
-v "${script_dir}":"/osbuilder" \ -v "${script_dir}":"/osbuilder" \
-v "${ROOTFS_DIR}":"/rootfs" \ -v "${ROOTFS_DIR}":"/rootfs" \
-v "${script_dir}/../scripts":"/scripts" \ -v "${script_dir}/../scripts":"/scripts" \
@ -352,7 +353,7 @@ pushd "${GOPATH_LOCAL}/src/${GO_AGENT_PKG}"
[ -n "${AGENT_VERSION}" ] && git checkout "${AGENT_VERSION}" && OK "git checkout successful" [ -n "${AGENT_VERSION}" ] && git checkout "${AGENT_VERSION}" && OK "git checkout successful"
make clean make clean
make INIT=${AGENT_INIT} make INIT=${AGENT_INIT}
make install DESTDIR="${ROOTFS_DIR}" INIT=${AGENT_INIT} make install DESTDIR="${ROOTFS_DIR}" INIT=${AGENT_INIT} SECCOMP=${SECCOMP}
popd popd
AGENT_DIR="${ROOTFS_DIR}/usr/bin" AGENT_DIR="${ROOTFS_DIR}/usr/bin"

View File

@ -28,3 +28,5 @@ INIT_PROCESS=systemd
# List of zero or more architectures to exclude from build, # List of zero or more architectures to exclude from build,
# as reported by `uname -m` # as reported by `uname -m`
ARCH_EXCLUDE_LIST=() ARCH_EXCLUDE_LIST=()
[ "$SECCOMP" = "yes" ] && PACKAGES+=" libseccomp2" || true