Skip to content

Commit 8521010

Browse files
committed
build_library/catalyst_toolchains: Install baselayout first
Previously it was not needed - the toolchains didn't have even an indirect dependency on baselayout. With switching to the selinux profile which enables a couple of additional USE flags (selinux, caps, audit), baselayout ends up being pulled in too. This in turn required fixing copying of stuff from sysroot - <SYSROOT>/lib cannot be copied to <ROOT>, because <ROOT>/lib already exists (installed by baselayout) and is a symlink.
1 parent 86d18a7 commit 8521010

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

build_library/catalyst_toolchains.sh

+20-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,26 @@ build_target_toolchain() {
2929
local ROOT="/build/${board}"
3030
local SYSROOT="/usr/$(get_board_chost "${board}")"
3131

32-
mkdir -p "${ROOT}/usr"
33-
cp -at "${ROOT}" "${SYSROOT}"/lib*
34-
cp -at "${ROOT}"/usr "${SYSROOT}"/usr/include "${SYSROOT}"/usr/lib*
32+
# install baselayout first, with the selinux profile, this seems
33+
# to be pulled into the dependency chain now
34+
PORTAGE_CONFIGROOT="$ROOT" run_merge --root="$ROOT" --sysroot="$ROOT" --oneshot --nodeps sys-apps/baselayout
35+
36+
(
37+
shopt -s nullglob
38+
local d f
39+
local -a files
40+
for d in "${SYSROOT}"/lib* "${SYSROOT}"/usr/lib*; do
41+
if [[ ! -d ${d} ]]; then
42+
continue
43+
fi
44+
files=( "${d}"/* )
45+
if [[ ${#files[@]} -gt 0 ]]; then
46+
f=${d##*/}
47+
cp -at "${ROOT}/usr/${f}" "${files[@]}"
48+
fi
49+
done
50+
)
51+
cp -at "${ROOT}"/usr "${SYSROOT}"/usr/include
3552

3653
local -a args_for_bdl=()
3754
if [[ -n ${clst_VERBOSE} ]]; then

0 commit comments

Comments
 (0)