update hooks: migrate arm boards to new ldso path

Now that glibc installs with the new arm hardfp ldso path, and gcc
generates ELFs with the new path, forcibly migrate existing boards
to the new path by having people rebuild everything.

BUG=None
TEST=`./update_chroot` moved my old tegra2_kaen and arm-generic boards away

Change-Id: I5fee57ff49a9533cc10cb82888014f7cb53033ac
Reviewed-on: https://gerrit.chromium.org/gerrit/24731
Reviewed-by: asharif <asharif@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Mike Frysinger 2012-06-07 14:01:49 -04:00 committed by Gerrit
parent 0103b59138
commit e1c7706041

View File

@ -0,0 +1,28 @@
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# For people who have arm builds with the old hardfp ldso name,
# automatically move them away so we can deploy them with the
# right path. This works in tandem with 34_arm_softfp_to_hardfp
# to make sure we don't rebuild multiple times.
# In case the dev has no arm boards.
shopt -s nullglob
# Old name: ld-linux.so.3
# New name: ld-linux-armhf.so.3
for ldso in /build/*/lib/ld-linux.so.3; do
# See if this is an ARM ldso (sanity check).
if LC_ALL=C readelf -h "${ldso}" | awk \
'$1 == "Machine:" && $2 == "ARM" { found=1 } END { exit !found }'; then
build=${ldso%/lib/*}
board=${build##*/}
info "Migrating ${board} to ${board}.old.ldso"
info "If you don't need it, please run "
info "sudo rm -rf ${build}.old.ldso"
sudo mv ${build}{,.old.ldso}
info "Running setup_board --board=${board}"
~/trunk/src/scripts/setup_board --board=${board} --skip_chroot_upgrade
fi
done