mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 23:21:17 +02:00
build_image: filter out unused glibc files
This removes files only used at link time, or when manually debugging, or by glibc's charset routines (gconv) which are not used by Chromium. BUG=chromium-os:22939 BUG=chromium-os:23105 TEST=build_image for daisy works TEST=`cbuildbot {x86,x86_64,arm}-generic-full` worked TEST=`cbuildbot chromiumos-sdk` worked TEST=build_image boots & runs fine on an alex Change-Id: I68d848c2e307c98d53a8faa73924f57571f7887b Reviewed-on: https://gerrit.chromium.org/gerrit/37378 Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: David James <davidjames@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
22dc2ba9d9
commit
5ea15f8a38
@ -177,6 +177,21 @@ create_base_image() {
|
|||||||
'usr/include' 'sys-include'
|
'usr/include' 'sys-include'
|
||||||
# Link-time objects.
|
# Link-time objects.
|
||||||
'*.[ao]'
|
'*.[ao]'
|
||||||
|
# Link-time symlinks & linker scripts.
|
||||||
|
'usr/lib*/lib*.so'
|
||||||
|
# We mount /var manually so this gets thrown away.
|
||||||
|
'var'
|
||||||
|
# Debug commands not used by normal runtime code.
|
||||||
|
'usr/bin/'{getent,ldd}
|
||||||
|
# LD_PRELOAD objects for debugging.
|
||||||
|
'lib*/lib'{memusage,pcprofile,SegFault}.so 'usr/lib*/audit'
|
||||||
|
# Libraries used for translating between charsets -- but we use libicu
|
||||||
|
# in Chromium, so there's no need for these. http://crosbug.com/23105
|
||||||
|
'usr/*/gconv'
|
||||||
|
# We only use files & dns with nsswitch, so throw away the others.
|
||||||
|
'lib*/libnss_'{compat,db,hesiod,nis,nisplus}'*.so*'
|
||||||
|
# This is only for very old packages which we don't have.
|
||||||
|
'lib*/libBrokenLocale*.so*'
|
||||||
)
|
)
|
||||||
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} \
|
||||||
|
@ -60,12 +60,8 @@ install_dev_packages() {
|
|||||||
# Leave core files for developers to inspect.
|
# Leave core files for developers to inspect.
|
||||||
sudo touch "${root_fs_dir}/root/.leave_core"
|
sudo touch "${root_fs_dir}/root/.leave_core"
|
||||||
|
|
||||||
# This hack is only needed for devs who have old versions of glibc, which
|
# Release images do not include these, so install it for dev images.
|
||||||
# filtered out ldd when cross-compiling. TODO(davidjames): Remove this hack
|
sudo cp -a "${BOARD_ROOT}"/usr/bin/{getent,ldd} "${root_fs_dir}/usr/bin/"
|
||||||
# once everybody has upgraded to a new version of glibc.
|
|
||||||
if [[ ! -x "${root_fs_dir}/usr/bin/ldd" ]]; then
|
|
||||||
sudo cp -a "$(which ldd)" "${root_fs_dir}/usr/bin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If vim is installed, then a vi symlink would probably help.
|
# If vim is installed, then a vi symlink would probably help.
|
||||||
if [[ -x "${root_fs_dir}/usr/local/bin/vim" ]]; then
|
if [[ -x "${root_fs_dir}/usr/local/bin/vim" ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user