From e1c7706041ea7580159f2b4b28d4fd363f77d03d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 7 Jun 2012 14:01:49 -0400 Subject: [PATCH] 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 Reviewed-by: David James Tested-by: Mike Frysinger Commit-Ready: Mike Frysinger --- chroot_version_hooks.d/41_arm_new_hardfp_ldso | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 chroot_version_hooks.d/41_arm_new_hardfp_ldso diff --git a/chroot_version_hooks.d/41_arm_new_hardfp_ldso b/chroot_version_hooks.d/41_arm_new_hardfp_ldso new file mode 100644 index 0000000000..dd7690b7c9 --- /dev/null +++ b/chroot_version_hooks.d/41_arm_new_hardfp_ldso @@ -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