build_image: use an array for excludes

This makes a follow up commit easier to document excludes.

BUG=chromium-os:22939
TEST=build_image for daisy installs same set of files

Change-Id: I09a9b3fe6f8c1d1fd9dd4d094f2fb7c81ce24880
Reviewed-on: https://gerrit.chromium.org/gerrit/37377
Reviewed-by: David James <davidjames@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Mike Frysinger 2012-11-05 16:28:30 -05:00 committed by Gerrit
parent 3e759d9e7d
commit 215f906123

View File

@ -170,10 +170,16 @@ create_base_image() {
"--board=${BOARD} to update the version of libc installed on that board." "--board=${BOARD} to update the version of libc installed on that board."
fi fi
# Strip out files we don't need in the final image at runtime.
local libc_excludes=(
# Compile-time headers.
'usr/include' 'sys-include'
# Link-time objects.
'*.[ao]'
)
pbzip2 -dc --ignore-trailing-garbage=1 "${LIBC_PATH}" | \ pbzip2 -dc --ignore-trailing-garbage=1 "${LIBC_PATH}" | \
sudo tar xpf - -C "${root_fs_dir}" ./usr/${CHOST} \ sudo tar xpf - -C "${root_fs_dir}" ./usr/${CHOST} \
--strip-components=3 --exclude=usr/include --exclude=sys-include \ --strip-components=3 "${libc_excludes[@]/#/--exclude=}"
--exclude=*.a --exclude=*.o
board_ctarget=$(get_ctarget_from_board "${BOARD}") board_ctarget=$(get_ctarget_from_board "${BOARD}")
for atom in $(portageq match / cross-$board_ctarget/gcc); do for atom in $(portageq match / cross-$board_ctarget/gcc); do