Skip to content

Commit

Permalink
rootfs-builder: only look for AGENT_POLICY_FILE if AGENT_POLICY=yes
Browse files Browse the repository at this point in the history
When the rootfs is built with AGENT_POLICY=no, the build fails at
line 36 for us, since our package build does not have access to the
entire source at once. Rather, we only copy the directories that we
think we'll need (and we missed that one). TBA in a future packaging
change. Upstream isn't affected as they build with the whole code base.

Signed-off-by: Aurelien Bombo <abombo@microsoft.com>
  • Loading branch information
sprt committed Jan 30, 2024
1 parent fb4c887 commit 7729400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/osbuilder/rootfs-builder/rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ AGENT_POLICY_FILE=${AGENT_POLICY_FILE:-"allow-all.rego"}
lib_file="${script_dir}/../scripts/lib.sh"
source "$lib_file"

agent_policy_file="$(readlink -f "${script_dir}/../../../src/kata-opa/${AGENT_POLICY_FILE}")"
[ "${AGENT_POLICY}" == "yes" ] && agent_policy_file="$(readlink -f "${script_dir}/../../../src/kata-opa/${AGENT_POLICY_FILE}")"

#For cross build
CROSS_BUILD=${CROSS_BUILD:-false}
Expand Down Expand Up @@ -330,7 +330,7 @@ check_env_variables()

[ -n "${KERNEL_MODULES_DIR}" ] && [ ! -d "${KERNEL_MODULES_DIR}" ] && die "KERNEL_MODULES_DIR defined but is not an existing directory"

[ ! -f "${agent_policy_file}" ] && die "agent policy file not found in '${agent_policy_file}'"
[ "${AGENT_POLICY}" == "yes" ] && [ ! -f "${agent_policy_file}" ] && die "agent policy file not found in '${agent_policy_file}'"

[ -n "${OSBUILDER_VERSION}" ] || die "need osbuilder version"
}
Expand Down

0 comments on commit 7729400

Please sign in to comment.