mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-28 22:12:10 +01:00
setup_board: Add ldconfig wrapper for non-native arches
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
This commit is contained in:
parent
688bb56a3d
commit
3c2a0527e0
18
setup_board
18
setup_board
@ -88,7 +88,11 @@ EOF
|
||||
|
||||
generate_all_wrappers() {
|
||||
local cmds=() wrappers=()
|
||||
local wrapper
|
||||
local wrapper qemu
|
||||
|
||||
# If the QEMU user space emulator is missing for this board arch, that implies
|
||||
# the board arch matches the SDK arch and therefore emulation is unnecessary.
|
||||
qemu=$(type -P "qemu-${BOARD_CHOST%%-*}") || unset qemu
|
||||
|
||||
info "Generating wrapper scripts"
|
||||
|
||||
@ -111,6 +115,18 @@ exec ${BOARD_CHOST}-gdb -iex 'set sysroot ${BOARD_ROOT}' "\$@"
|
||||
EOF
|
||||
wrappers+=( "${wrapper}" )
|
||||
|
||||
# ldconfig cannot generate caches for non-native arches. Use QEMU and the
|
||||
# native ldconfig to work around that.
|
||||
wrapper="/usr/local/sbin/ldconfig-${BOARD_VARIANT}"
|
||||
sudo_clobber "${wrapper}" <<EOF
|
||||
#!/bin/sh
|
||||
exec ${qemu-} "${BOARD_ROOT}"/sbin/ldconfig -r "${BOARD_ROOT}" "\$@"
|
||||
EOF
|
||||
wrappers+=( "${wrapper}" )
|
||||
|
||||
# Create a CHOST-based ldconfig symlink for Portage to call.
|
||||
sudo ln -sfT "ldconfig-${BOARD_VARIANT}" "/usr/local/sbin/${BOARD_CHOST}-ldconfig"
|
||||
|
||||
cmds+=(
|
||||
"chmod a+rx ${wrappers[*]}"
|
||||
"chown root:root ${wrappers[*]}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user