flatcar-scripts/chroot_version_hooks.d/41_arm_new_hardfp_ldso
Mike Frysinger 3ba74cefcb update hooks: skip old dirs automatically
If we have old dirs (such as a previous migration), we might detect they
need migration for ldso too, but their name isn't a valid board.  So skip
those old dirs, and punt old ldso dirs in case they exist (failed previous
upgrade).

BUG=None
TEST=`./update_chroot` moved my old tegra2_kaen and arm-generic boards away, skipped the old softfloat ones, and deleted the previous ldso moves

Change-Id: I9ff316d6de2d9e982f93880426955bb0b49f00a1
Reviewed-on: https://gerrit.chromium.org/gerrit/24890
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2012-06-08 11:48:45 -07:00

36 lines
1.3 KiB
Plaintext

# 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##*/}
if [[ ${board} == *.* ]]; then
# For older dirs that have been migrated, skip them.
continue
fi
info "Migrating ${board} to ${board}.old.ldso"
info "If you don't need it, please run "
info "sudo rm -rf ${build}.old.ldso"
if [[ -e ${build}.old.ldso ]]; then
sudo rm -rf ${build}.old.ldso
fi
sudo mv ${build}{,.old.ldso}
info "Running setup_board --board=${board}"
~/trunk/src/scripts/setup_board --board=${board} --skip_chroot_upgrade
fi
done