From 74c4f21b6858c6c3c583937206b1b68cebc574de Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 6 Aug 2013 13:54:18 -0400 Subject: [PATCH] fix(update_chroot): Replace old chroot version scheme. The old chroot version system we inherited from Chromium OS always assumes that a newly unpacked tarball is the latest and greatest but since we version the SDK in the same way as target builds we can use that version for these sorts of upgrade scripts and not make assumptions about how late and great the starting tarball was. The first upgrade script simply aborts to force the user to recreate their chroot when moving from python 2.6 to 2.7. --- chroot_version_hooks.d/10_default_locales | 16 -- chroot_version_hooks.d/11_rm_bad_directory | 8 - .../12_clean_old_config_files | 24 --- chroot_version_hooks.d/13_enable_gold | 10 -- chroot_version_hooks.d/14_board_portage_env | 19 --- .../15_board_portage_env_undo | 19 --- chroot_version_hooks.d/16_localtime | 9 - chroot_version_hooks.d/17_sudo_90_cros | 7 - chroot_version_hooks.d/18_noop | 6 - chroot_version_hooks.d/19_sudo_90_cros | 32 ---- chroot_version_hooks.d/1_init | 6 - .../20_board_portage_bashrc | 9 - chroot_version_hooks.d/21_grub_downgrade | 8 - chroot_version_hooks.d/22_trim_bashrc | 24 --- chroot_version_hooks.d/23_vcs_migration | 13 -- chroot_version_hooks.d/24_distfiles_migration | 33 ---- ...5_suppress_incremental_build_across_chroot | 37 ----- chroot_version_hooks.d/26_scrub_old_pkgs | 28 ---- chroot_version_hooks.d/27_64bit_convert_lumpy | 19 --- .../28_deselect_cross_compilers | 14 -- .../29_64bit_convert_stumpy | 19 --- chroot_version_hooks.d/2_path_update | 15 -- chroot_version_hooks.d/30_crossdev_metadata | 28 ---- chroot_version_hooks.d/31_64bit_convert_atom | 20 --- chroot_version_hooks.d/32_scrub_old_pkgs | 28 ---- chroot_version_hooks.d/33_remove_requests | 12 -- .../34_arm_softfp_to_hardfp | 26 --- .../35_64bit_convert_2gb_boards | 20 --- chroot_version_hooks.d/36_rebuild_openssl | 9 - .../37_remove_conflicting_linux_headers | 21 --- chroot_version_hooks.d/38_host_userpriv | 7 - .../39_host_userpriv_better | 17 -- chroot_version_hooks.d/3_libtool_update | 53 ------ chroot_version_hooks.d/40_kernel_headers | 38 ----- chroot_version_hooks.d/41_arm_new_hardfp_ldso | 35 ---- .../42_arm_new_hardfp_ldso_daisy | 14 -- chroot_version_hooks.d/43_64bit_convert_kiev | 20 --- chroot_version_hooks.d/44_fix_gerrit_chrome | 36 ---- chroot_version_hooks.d/45_rewrite_sudoers.d | 42 ----- .../46_64bit_convert_butterfly | 28 ---- chroot_version_hooks.d/47_path_overrides | 5 - chroot_version_hooks.d/48_old_host_pkgs | 18 -- chroot_version_hooks.d/49_update_libtool | 12 -- chroot_version_hooks.d/4_policykit_removal | 18 -- chroot_version_hooks.d/50_add_chromite_link | 13 -- .../51_new_style_virtual_chromeos-bsp | 33 ---- chroot_version_hooks.d/5_symlink_pc_update | 15 -- .../6_mobile_broadband_removal | 16 -- chroot_version_hooks.d/7_host_gcc_upgrade | 54 ------ chroot_version_hooks.d/8_unmerge_gmp | 18 -- chroot_version_hooks.d/9_board_makeconf_setup | 24 --- run_chroot_version_hooks | 154 ------------------ .../updates/36.0.0_python_upgrade_required.sh | 21 +++ update_chroot | 25 ++- 54 files changed, 45 insertions(+), 1210 deletions(-) delete mode 100644 chroot_version_hooks.d/10_default_locales delete mode 100644 chroot_version_hooks.d/11_rm_bad_directory delete mode 100644 chroot_version_hooks.d/12_clean_old_config_files delete mode 100644 chroot_version_hooks.d/13_enable_gold delete mode 100644 chroot_version_hooks.d/14_board_portage_env delete mode 100644 chroot_version_hooks.d/15_board_portage_env_undo delete mode 100644 chroot_version_hooks.d/16_localtime delete mode 100644 chroot_version_hooks.d/17_sudo_90_cros delete mode 100644 chroot_version_hooks.d/18_noop delete mode 100644 chroot_version_hooks.d/19_sudo_90_cros delete mode 100644 chroot_version_hooks.d/1_init delete mode 100644 chroot_version_hooks.d/20_board_portage_bashrc delete mode 100644 chroot_version_hooks.d/21_grub_downgrade delete mode 100644 chroot_version_hooks.d/22_trim_bashrc delete mode 100644 chroot_version_hooks.d/23_vcs_migration delete mode 100644 chroot_version_hooks.d/24_distfiles_migration delete mode 100644 chroot_version_hooks.d/25_suppress_incremental_build_across_chroot delete mode 100644 chroot_version_hooks.d/26_scrub_old_pkgs delete mode 100644 chroot_version_hooks.d/27_64bit_convert_lumpy delete mode 100644 chroot_version_hooks.d/28_deselect_cross_compilers delete mode 100644 chroot_version_hooks.d/29_64bit_convert_stumpy delete mode 100644 chroot_version_hooks.d/2_path_update delete mode 100644 chroot_version_hooks.d/30_crossdev_metadata delete mode 100644 chroot_version_hooks.d/31_64bit_convert_atom delete mode 100644 chroot_version_hooks.d/32_scrub_old_pkgs delete mode 100644 chroot_version_hooks.d/33_remove_requests delete mode 100644 chroot_version_hooks.d/34_arm_softfp_to_hardfp delete mode 100644 chroot_version_hooks.d/35_64bit_convert_2gb_boards delete mode 100644 chroot_version_hooks.d/36_rebuild_openssl delete mode 100644 chroot_version_hooks.d/37_remove_conflicting_linux_headers delete mode 100644 chroot_version_hooks.d/38_host_userpriv delete mode 100644 chroot_version_hooks.d/39_host_userpriv_better delete mode 100644 chroot_version_hooks.d/3_libtool_update delete mode 100644 chroot_version_hooks.d/40_kernel_headers delete mode 100644 chroot_version_hooks.d/41_arm_new_hardfp_ldso delete mode 100644 chroot_version_hooks.d/42_arm_new_hardfp_ldso_daisy delete mode 100644 chroot_version_hooks.d/43_64bit_convert_kiev delete mode 100644 chroot_version_hooks.d/44_fix_gerrit_chrome delete mode 100644 chroot_version_hooks.d/45_rewrite_sudoers.d delete mode 100644 chroot_version_hooks.d/46_64bit_convert_butterfly delete mode 100644 chroot_version_hooks.d/47_path_overrides delete mode 100644 chroot_version_hooks.d/48_old_host_pkgs delete mode 100644 chroot_version_hooks.d/49_update_libtool delete mode 100644 chroot_version_hooks.d/4_policykit_removal delete mode 100644 chroot_version_hooks.d/50_add_chromite_link delete mode 100644 chroot_version_hooks.d/51_new_style_virtual_chromeos-bsp delete mode 100644 chroot_version_hooks.d/5_symlink_pc_update delete mode 100644 chroot_version_hooks.d/6_mobile_broadband_removal delete mode 100644 chroot_version_hooks.d/7_host_gcc_upgrade delete mode 100644 chroot_version_hooks.d/8_unmerge_gmp delete mode 100644 chroot_version_hooks.d/9_board_makeconf_setup delete mode 100755 run_chroot_version_hooks create mode 100644 sdk_lib/updates/36.0.0_python_upgrade_required.sh diff --git a/chroot_version_hooks.d/10_default_locales b/chroot_version_hooks.d/10_default_locales deleted file mode 100644 index 51d573ba07..0000000000 --- a/chroot_version_hooks.d/10_default_locales +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2011 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. - -# Make sure existing chroot's have default locales enabled -# to match the new make_chroot behavior -# http://crosbug.com/20378 -if ! grep -q -v -e '^#' -e '^$' /etc/locale.gen ; then - sudo_append /etc/locale.gen </dev/null || echo /tmp/17_upgrade_hook.$$) - cat < "${tmp}" || exit 1 -Defaults env_keep += CROS_WORKON_SRCROOT -Defaults env_keep += COREOS_OFFICIAL -Defaults env_keep += PORTAGE_USERNAME -Defaults env_keep += http_proxy -Defaults env_keep += ftp_proxy -Defaults env_keep += all_proxy -%adm ALL=(ALL) ALL -root ALL=(ALL) ALL -$USER ALL=NOPASSWD: ALL -EOF - cmds=( - "mkdir -p -m 0750 '${frag%/*}'" - "chmod 0440 '${tmp}'" - "chown root:root '${tmp}'" - "mv '${tmp}' '${frag}'" - ) - sudo_multi "${cmds[@]}" -fi - -exit 0 diff --git a/chroot_version_hooks.d/1_init b/chroot_version_hooks.d/1_init deleted file mode 100644 index dad7d515d2..0000000000 --- a/chroot_version_hooks.d/1_init +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2011 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. - -info "You have just been upgraded to chroot version 1! Congratulations!" -exit 0 diff --git a/chroot_version_hooks.d/20_board_portage_bashrc b/chroot_version_hooks.d/20_board_portage_bashrc deleted file mode 100644 index 3606516961..0000000000 --- a/chroot_version_hooks.d/20_board_portage_bashrc +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2011 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. - -# Punt the old board's /etc/portage/bashrc as we don't use it anymore, -# and it conflicts with newer bashrc stacking. -sudo rm -f /build/*/etc/portage/bashrc - -exit 0 diff --git a/chroot_version_hooks.d/21_grub_downgrade b/chroot_version_hooks.d/21_grub_downgrade deleted file mode 100644 index bcf6117a7c..0000000000 --- a/chroot_version_hooks.d/21_grub_downgrade +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright (c) 2011 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. - -CLEAN_DELAY=0 sudo emerge --unmerge =sys-boot/grub-1.99-r2 - -exit 0 - diff --git a/chroot_version_hooks.d/22_trim_bashrc b/chroot_version_hooks.d/22_trim_bashrc deleted file mode 100644 index 68a01c6f71..0000000000 --- a/chroot_version_hooks.d/22_trim_bashrc +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2011 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. - -# We used to place bashrc niceties into the user's .bashrc. Use -# profile.d instead. - -sudo_clobber /etc/profile.d/chromiumos-niceties.sh << EOF -# Niceties for interactive logins. (cr) denotes this is a chroot, the -# __git_branch_ps1 prints current git branch in ./ . The $r behavior is to -# make sure we don't reset the previous $? value which later formats in -# $PS1 might rely on. -PS1='\$(r=\$?; __git_branch_ps1 "(%s) "; exit \$r)'"\${PS1}" -PS1="(cr) \${PS1}" -EOF - -# Also, get rid of the leftover stuff in the user's .bashrc. -# These are the two originally added lines: -STR1='export PS1='"'"'$(r=$?; __git_branch_ps1 "(%s) "; exit $r)'"'"'"${PS1}"' -STR2='export PS1="(cr) ${PS1}"' - -sed -e "/${STR1}/d" -e "/${STR2}/d" -i ~/.bashrc - -exit 0 diff --git a/chroot_version_hooks.d/23_vcs_migration b/chroot_version_hooks.d/23_vcs_migration deleted file mode 100644 index 5a2d7ff1f5..0000000000 --- a/chroot_version_hooks.d/23_vcs_migration +++ /dev/null @@ -1,13 +0,0 @@ -# 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. - -# The dev-util -> dev-vcs migration isn't as smooth as we'd like due to -# the profiles/updates/ files only applying to packages installed from -# that overlay. Force unmerge the old packages if they were not auto -# migrated for the user. See https://gerrit.chromium.org/gerrit/13148 -# for some in-depth details. - -sudo CLEAN_DELAY=0 emerge -C dev-util/{git,subversion} net-misc/neon - -exit 0 diff --git a/chroot_version_hooks.d/24_distfiles_migration b/chroot_version_hooks.d/24_distfiles_migration deleted file mode 100644 index fcd16660c7..0000000000 --- a/chroot_version_hooks.d/24_distfiles_migration +++ /dev/null @@ -1,33 +0,0 @@ -# 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. - -# Previously distfiles were stored entirely in the chroot, forcing us -# to download it everytime. This content is now stored externally, exposed -# to the chroot via mount binds. -# -# What we're doing here is moving any existing content from the old locations, -# into the new locations- which will already have a mount bind in place. -# If it *doesn't*, meaning parallel cros_sdk usage, we just wipe the content -# (user can redownload it after all). -# -# Once that's done, upgrade the chroot directory structure installing -# syms pointing back to the new location. - -upgrade_path() { - local src="/var/lib/portage/$1" - local dest="/var/cache/distfiles/$2" - if [ -L "$src" ]; then - # Already upgraded- skip this one. - return 0 - fi - # Suppress failures. User just has to download in that case. - sudo find "$src"/ -maxdepth 1 -mindepth 1 -exec sudo mv -t "$dest/" {} + || : - sudo rm -rf "$src" - sudo ln -s ../../cache/distfiles/"$2" "$src" -} - -upgrade_path distfiles host -upgrade_path distfiles-target target - -exit 0 diff --git a/chroot_version_hooks.d/25_suppress_incremental_build_across_chroot b/chroot_version_hooks.d/25_suppress_incremental_build_across_chroot deleted file mode 100644 index ecba4865d9..0000000000 --- a/chroot_version_hooks.d/25_suppress_incremental_build_across_chroot +++ /dev/null @@ -1,37 +0,0 @@ -# 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. - -# As of update 24, we preserve distfiles across chroot rebuilds via storing -# the content outside of the chroot, and binding it in. -# -# chromeos-chrome stores its build output in distdir however, which we -# don't currently want preserved across chroot builds, thus this script -# pulls the content out to the new location within the chroot. - -upgrade_path() { - local src="/var/cache/distfiles/target/$2" - local dest="/var/cache/chromeos-chrome/$2" - - info "[$1/4] Checking $src vs $dest" - if [ -d "$src" ]; then - if [ -d "$dest" ]; then - # User has already built it- thus wipe the src and use what's in - # the chrome specific cache. - info "[$1/4] Cleaning $src; this could take a while" - sudo rm -rf "$src" - else - sudo mv "$src" "$dest" - fi - fi -} - -sudo mkdir -p 0775 /var/cache/chromeos-chrome/ -sudo chown "$USER:portage" /var/cache/chromeos-chrome/ - -upgrade_path 1 chrome-src -upgrade_path 2 chrome-src-internal -upgrade_path 3 chrome-src-custom -upgrade_path 4 chrome-src-custom-internal - -exit 0 diff --git a/chroot_version_hooks.d/26_scrub_old_pkgs b/chroot_version_hooks.d/26_scrub_old_pkgs deleted file mode 100644 index 829e5b9315..0000000000 --- a/chroot_version_hooks.d/26_scrub_old_pkgs +++ /dev/null @@ -1,28 +0,0 @@ -# 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. - -# We've been dropping packages of late from the target, so make sure the -# old stuff gets cleaned out. - -pkgs=( - dev-libs/shflags - mail-mta/ssmtp - net-libs/gssdp - net-libs/gupnp - net-mail/mailbase - sys-fs/sysfsutils - sys-process/cronbase - sys-process/vixie-cron -) - -for board_root in /build/* ; do - board=${board_root##*/} - emerge_board=$(type -P emerge-${board} 2>/dev/null || true) - if [[ -x "${emerge_board}" ]]; then - CLEAN_DELAY=0 ${emerge_board} -q --unmerge ${pkgs[@]} || true - eclean-${board} -d packages || true - fi -done - -exit 0 diff --git a/chroot_version_hooks.d/27_64bit_convert_lumpy b/chroot_version_hooks.d/27_64bit_convert_lumpy deleted file mode 100644 index 690508135a..0000000000 --- a/chroot_version_hooks.d/27_64bit_convert_lumpy +++ /dev/null @@ -1,19 +0,0 @@ -# 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. - -# This is meant to happen immediately after we update these boards -# from 32bit to 64bit. It moves the existing build root out of the -# way and re-creates the build root. The user must remove the copy -# of the old build root manually if it is not needed. - -board="lumpy" -build="/build/${board}" -if [[ -d ${build} ]] ; then - info "Moving 32bit ${board} to ${board}.32bit" - info "If you don't need it, please run " - info "sudo rm -rf ${build}.32bit" - sudo mv ${build}{,.32bit} - info "Running setup_board --board=${board}" - ~/trunk/src/scripts/setup_board --board=${board} --skip_chroot_upgrade -fi diff --git a/chroot_version_hooks.d/28_deselect_cross_compilers b/chroot_version_hooks.d/28_deselect_cross_compilers deleted file mode 100644 index 1db382ee68..0000000000 --- a/chroot_version_hooks.d/28_deselect_cross_compilers +++ /dev/null @@ -1,14 +0,0 @@ -# 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. - -# There was a bug in the setup_board script where it added the cross-compilers -# to the @world set. Make sure we don't do that since letting emerge do the -# upgrade rather than crossdev (currently) doesn't work. - -world="/var/lib/portage/world" -if [[ -e ${world} ]] ; then - sudo sed -i '/^cross-/d' "${world}" -fi - -exit 0 diff --git a/chroot_version_hooks.d/29_64bit_convert_stumpy b/chroot_version_hooks.d/29_64bit_convert_stumpy deleted file mode 100644 index 1541cd278f..0000000000 --- a/chroot_version_hooks.d/29_64bit_convert_stumpy +++ /dev/null @@ -1,19 +0,0 @@ -# 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. - -# This is meant to happen immediately after we update these boards -# from 32bit to 64bit. It moves the existing build root out of the -# way and re-creates the build root. The user must remove the copy -# of the old build root manually if it is not needed. - -board="stumpy" -build="/build/${board}" -if [[ -d ${build} ]] ; then - info "Moving 32bit ${board} to ${board}.32bit" - info "If you don't need it, please run " - info "sudo rm -rf ${build}.32bit" - sudo mv ${build}{,.32bit} - info "Running setup_board --board=${board}" - ~/trunk/src/scripts/setup_board --board=${board} --skip_chroot_upgrade -fi diff --git a/chroot_version_hooks.d/2_path_update b/chroot_version_hooks.d/2_path_update deleted file mode 100644 index 6372e5fdac..0000000000 --- a/chroot_version_hooks.d/2_path_update +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2011 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. - -target="/etc/env.d/99chromiumos" -sudo_clobber "${target}" </dev/null || true) - if [[ -x "${emerge_board}" ]]; then - CLEAN_DELAY=0 ${emerge_board} -q --unmerge "${pkgs[@]}" || true - eclean-${board} -d packages || true - fi -done - -exit 0 diff --git a/chroot_version_hooks.d/33_remove_requests b/chroot_version_hooks.d/33_remove_requests deleted file mode 100644 index 48f0de7861..0000000000 --- a/chroot_version_hooks.d/33_remove_requests +++ /dev/null @@ -1,12 +0,0 @@ -# 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. - -# We intended to use some extra python modules for autotest in the chroot, -# but decided against it. They're removed from hard-host-depends in -# https://gerrit.chromium.org/gerrit/21816 - - -pkgs=( dev-python/requests dev-python/chardet dev-python/certifi ) -sudo CLEAN_DELAY=0 emerge -q --unmerge "${pkgs[@]}" -exit 0 diff --git a/chroot_version_hooks.d/34_arm_softfp_to_hardfp b/chroot_version_hooks.d/34_arm_softfp_to_hardfp deleted file mode 100644 index e3a2db61cf..0000000000 --- a/chroot_version_hooks.d/34_arm_softfp_to_hardfp +++ /dev/null @@ -1,26 +0,0 @@ -# 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 softfp, automatically move them -# away so we can deploy them with hardfp. -# See also 29_64bit_convert_stumpy. - -# In case the dev has no arm boards. -shopt -s nullglob - -for ldso in /build/*/lib/ld-linux.so.3; do - # See if this is an ARM softfp ldso. - if ! readelf -A "${ldso}" | grep -q Tag_ABI_VFP_args; then - build=${ldso%/lib/*} - board=${build##*/} - info "Migrating ${board} to ${board}.softfp" - info "If you don't need it, please run " - info "sudo rm -rf ${build}.softfp" - sudo mv ${build}{,.softfp} - info "Running setup_board --board=${board}" - ~/trunk/src/scripts/setup_board \ - --board=${board} \ - --skip_chroot_upgrade - fi -done diff --git a/chroot_version_hooks.d/35_64bit_convert_2gb_boards b/chroot_version_hooks.d/35_64bit_convert_2gb_boards deleted file mode 100644 index 506231d463..0000000000 --- a/chroot_version_hooks.d/35_64bit_convert_2gb_boards +++ /dev/null @@ -1,20 +0,0 @@ -# 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. - -# This is meant to happen immediately after we update these boards -# from 64bit to 32bit. It moves the existing build root out of the -# way and re-creates the build root. The user must remove the copy -# of the old build root manually if it is not needed. - -for board in x86-mario x86-alex x86-zgb x86-alex_he x86-zgb_he kiev; do - build="/build/${board}" - if [[ -d ${build} ]] ; then - info "Moving 64bit ${board} to ${board}.64bit" - info "If you don't need it, please run " - info "sudo rm -rf ${build}.64bit" - sudo mv ${build}{,.64bit} - info "Running setup_board --board=${board}" - ~/trunk/src/scripts/setup_board --board=${board} --skip_chroot_upgrade - fi -done diff --git a/chroot_version_hooks.d/36_rebuild_openssl b/chroot_version_hooks.d/36_rebuild_openssl deleted file mode 100644 index 82e7dd8bdc..0000000000 --- a/chroot_version_hooks.d/36_rebuild_openssl +++ /dev/null @@ -1,9 +0,0 @@ -# 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. - -# Rebuild openssl to pick up the 0.9.8 -> 1.0.1 ABI change. Fetch everything -# first, since this upgrade will break curl. -sudo ~/trunk/chromite/bin/parallel_emerge -uDNvgf --rebuilt-binaries world -sudo ~/trunk/chromite/bin/parallel_emerge -uDNvg --rebuilt-binaries world -sudo update-ca-certificates diff --git a/chroot_version_hooks.d/37_remove_conflicting_linux_headers b/chroot_version_hooks.d/37_remove_conflicting_linux_headers deleted file mode 100644 index 938dd31181..0000000000 --- a/chroot_version_hooks.d/37_remove_conflicting_linux_headers +++ /dev/null @@ -1,21 +0,0 @@ -# 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. - -# This fixes a problem, where some chroots have old cross linux-headers -# installed with invalid slot settings, conflicting with the proper new -# ones. - -TARGETS="arm-none-eabi -armv7a-cros-linux-gnueabi -i686-pc-linux-gnu -x86_64-cros-linux-gnu -x86_64-pc-linux-gnu" - -VERSION=3.4 - -ATOMS=( - $(printf "/dev/null | grep -q '^/lib/ld-linux.so.3'; then - info "You have a stale daisy build; punting!" - sudo rm -rf /build/daisy/ - info "Running setup_board --board=daisy" - ~/trunk/src/scripts/setup_board --board=daisy --skip_chroot_upgrade -fi diff --git a/chroot_version_hooks.d/43_64bit_convert_kiev b/chroot_version_hooks.d/43_64bit_convert_kiev deleted file mode 100644 index c3c60fb68a..0000000000 --- a/chroot_version_hooks.d/43_64bit_convert_kiev +++ /dev/null @@ -1,20 +0,0 @@ -# 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. - -# This is meant to happen immediately after we update these boards -# from 32bit to 64bit. It moves the existing build root out of the -# way and re-creates the build root. The user must remove the copy -# of the old build root manually if it is not needed. - -for board in kiev; do - build="/build/${board}" - if [[ -d ${build} ]] ; then - info "Moving 32bit ${board} to ${board}.32bit" - info "If you don't need it, please run " - info "sudo rm -rf ${build}.32bit" - sudo mv ${build}{,.32bit} - info "Running setup_board --board=${board}" - ~/trunk/src/scripts/setup_board --board=${board} --skip_chroot_upgrade - fi -done diff --git a/chroot_version_hooks.d/44_fix_gerrit_chrome b/chroot_version_hooks.d/44_fix_gerrit_chrome deleted file mode 100644 index 0213af27f5..0000000000 --- a/chroot_version_hooks.d/44_fix_gerrit_chrome +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -# Move users of CHROME_ORIGIN=GERRIT_SOURCE to the new gerrit-source.xml -# manifest, as well as setting up the chromium/src repository properly for -# submodules. crosbug.com/32963. - -# We only want to run this hook once. Since this also gets called from -# enter_chroot, look for the marker. -MARKER="/tmp/44_fix_gerrit_chrome" -if [ -e "${MARKER}" ]; then - exit 0 -fi - -chrome_workon="=chromeos-base/chromeos-chrome-9999" -cros_workon_dir="${HOME}/trunk/.config/cros_workon/*" -manifest="${HOME}/trunk/.repo/manifest.xml" - -if grep -q "${chrome_workon}" ${cros_workon_dir} &> /dev/null; then - if [ $(readlink "${manifest}") != "manifests/minilayout.xml" ]; then - repo selfupdate && repo init -m gerrit-source.xml - fi -fi - -chromium_dir="${HOME}/trunk/chromium/src" -if [ -d "${chromium_dir}" ]; then - ( - cd "${chromium_dir}" - ignore_cmd='git config -f $toplevel/.git/config submodule.$name.ignore all' - git submodule foreach "${ignore_cmd}" &> /dev/null - ) -fi - -touch "${MARKER}" -exit 0 diff --git a/chroot_version_hooks.d/45_rewrite_sudoers.d b/chroot_version_hooks.d/45_rewrite_sudoers.d deleted file mode 100644 index 941a5948bd..0000000000 --- a/chroot_version_hooks.d/45_rewrite_sudoers.d +++ /dev/null @@ -1,42 +0,0 @@ -# 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. - -# Note that this script is invoked by make_chroot in addition -# to normal upgrade pathways. - -if [ "${UID:-$(id -u)}" != 0 ]; then - # Note that since we're screwing w/ sudo variables, this script - # explicitly bounces up to root for everything it does- that way - # if anyone introduces a temp depriving in the sudo setup, it can't break - # mid upgrade. - load_environment_whitelist - exec sudo bash -e "${VERSION_HOOKS_DIR}/45_rewrite_sudoers.d" \ - / "${USER}" "${ENVIRONMENT_WHITELIST[@]}" - exit 1 -fi - -# Reaching here means we're root. - -if [ $# -lt 2 ]; then - echo "Invoked with wrong number of args; expected root USER [variables]*" - exit 1 -fi - -root=$1 -username=$2 -shift -shift -set -- "${@}" CROS_WORKON_SRCROOT PORTAGE_USERNAME - -cat > "${root}/etc/sudoers.d/90_cros" < polkit" -exit 0 diff --git a/chroot_version_hooks.d/50_add_chromite_link b/chroot_version_hooks.d/50_add_chromite_link deleted file mode 100644 index 38b0c5530e..0000000000 --- a/chroot_version_hooks.d/50_add_chromite_link +++ /dev/null @@ -1,13 +0,0 @@ -# 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. -python_path=$(python -c 'import sys;print sys.version[:3]') -python_path="/usr/lib/python${python_path}/site-packages/chromite" -if [ ! -L "${python_path}" ]; then - sudo rm -rf "${python_path}" \ - "/home/${PORTAGE_USERNAME:-${SUDO_USER:-${USER}}}/.local/lib/python2.6/site-packages/chromite" - sudo mkdir -p "$(dirname "${python_path}")" - sudo ln -s "${CHROOT_TRUNK_DIR}"/chromite "${python_path}" -fi - -exit 0 diff --git a/chroot_version_hooks.d/51_new_style_virtual_chromeos-bsp b/chroot_version_hooks.d/51_new_style_virtual_chromeos-bsp deleted file mode 100644 index 8d4cdf2a50..0000000000 --- a/chroot_version_hooks.d/51_new_style_virtual_chromeos-bsp +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2013 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. - -# Upgrade people to the new style generic virtual/chromeos-bsp. - -opkg="chromeos-base/chromeos-bsp-null" - -export CLEAN_DELAY=0 - -update() { - local root=$1 board=$2 emerge - - if [[ -z ${board} ]]; then - board="root" - emerge="sudo -E emerge" - else - emerge="emerge-${board}" - fi - - if portageq has_version ${root} ${opkg}; then - ${emerge} -Cq ${opkg} - fi -} - -update / & - -for board_root in /build/*; do - board=${board_root##*/} - update ${board_root} ${board} & -done - -wait diff --git a/chroot_version_hooks.d/5_symlink_pc_update b/chroot_version_hooks.d/5_symlink_pc_update deleted file mode 100644 index f6668378f9..0000000000 --- a/chroot_version_hooks.d/5_symlink_pc_update +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2011 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 board_root in /build/*; do - if [ -h "${board_root}" ]; then - board=$(basename "${board_root}") - info "Removing hard-coded paths to ${board_root} in *.pc files" - sudo find "${board_root}/usr" -type f -name '*.pc' | xargs sudo \ - sed -i -e "s|${board_root}/|/|g" - fi -done - -info "Chroot upgraded to version 5: fix symlinked *.pc files" -exit 0 diff --git a/chroot_version_hooks.d/6_mobile_broadband_removal b/chroot_version_hooks.d/6_mobile_broadband_removal deleted file mode 100644 index 5d3806c8b3..0000000000 --- a/chroot_version_hooks.d/6_mobile_broadband_removal +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2011 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. - -# Unmerge net-misc/mobile-broadband-provider-info because it's -# been replaced by chromeos-base/mobile-providers. -for board_root in /build/*; do - if [ -d "${board_root}" ]; then - board=$(basename "${board_root}") - CLEAN_DELAY=0 emerge-${board} \ - --unmerge net-misc/mobile-broadband-provider-info || true - fi -done - -info "Chroot upgraded to version 6: mobile-broadband-provider-info removed" -exit 0 diff --git a/chroot_version_hooks.d/7_host_gcc_upgrade b/chroot_version_hooks.d/7_host_gcc_upgrade deleted file mode 100644 index 099c6eafc1..0000000000 --- a/chroot_version_hooks.d/7_host_gcc_upgrade +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2011 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. - -# This is a generic script for upgrading the host toolchain. It should: -# - be able to run repeatedly, in case someone has ancient chroot with -# several missed gcc upgrades -# - be easily tweakable for future upgrades of the same kind, if needed - -CHOST="$(portageq envvar CHOST)" - -# This is the lowest we want to go in this particular case. -MINIMUM_GCC="4.4.6" - -env_setup() { - GCC_VERSIONS="$(gcc-config -l | grep "${CHOST}" | \ - cut -f3 -d' ')" - GCC_LATEST="$(gcc-config -l | grep "${CHOST}" | tail -n1 | \ - cut -f3 -d' ')" -} - -env_setup - -if ! [ "$(portageq match / ">=sys-devel/gcc-${MINIMUM_GCC}")" ]; -then - info "You don't have the latest gcc installed, trying to build it" - if ! sudo emerge -u --getbinpkg sys-devel/gcc; then - error "Emerging gcc failed. Please recreate your chroot." - exit 1 - fi - if ! [ "$(portageq match / ">=sys-devel/gcc-${MINIMUM_GCC}")" ]; - then - error "You still don't have the latest gcc. Something is very" - error "wrong with your tree. Recreating your chroot will likely fix it." - exit 1 - fi -fi - -env_setup - -info "Updating the host toolchain. crosbug.com/19613" -info "Currently installed host gcc versions: $(echo -n ${GCC_VERSIONS})" - -if ! sudo gcc-config "${GCC_LATEST}"; then - error "gcc-config failed. This is really bad. Recreate your chroot." - exit 1 -fi - -info "Cleaning up the old toolchain" -sudo emerge --unmerge "/dev/null || true) - scanelf_out=$(scanelf -qn ${board_root}/usr/lib/libgmpxx.so.4 || true) - if [ -x "${emerge_board}" ] && [[ "$scanelf_out" == *libgmp.so.3* ]]; then - CLEAN_DELAY=0 ${emerge_board} --unmerge dev-libs/gmp || true - eclean-${board} -d packages || true - fi -done - -info "Chroot upgraded to version 8: Unmerge old dev-libs/gmp" -exit 0 diff --git a/chroot_version_hooks.d/9_board_makeconf_setup b/chroot_version_hooks.d/9_board_makeconf_setup deleted file mode 100644 index c8b724727b..0000000000 --- a/chroot_version_hooks.d/9_board_makeconf_setup +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2011 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. - -# Make sure the BOARD_USE variable is set in make.conf.board_setup. -for board_root in /build/*; do - board=$(basename "${board_root}") - - # Make sure this is a real board by looking for emerge-. - emerge_board=$(which emerge-${board} 2>/dev/null || true) - if [ -x "${emerge_board}" ]; then - board_setup="/build/${board}/etc/make.conf.board_setup" - if [ -f "${board_setup}" ] && ! grep -q BOARD_USE "${board_setup}"; then - sudo_append "${board_setup}" << EOF -BOARD_USE="${board}" -EOF - info "Added BOARD_USE to ${board_setup}" - fi - fi -done - -info "Chroot upgraded to version 9: Insert BOARD_USE in make.conf.board_setup" -exit 0 - diff --git a/run_chroot_version_hooks b/run_chroot_version_hooks deleted file mode 100755 index d4b1aa232e..0000000000 --- a/run_chroot_version_hooks +++ /dev/null @@ -1,154 +0,0 @@ -#!/bin/bash - -# 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. - -# Load common CrOS utilities. Inside the chroot this file is installed in -# /usr/lib/crosutils. Outside the chroot we find it relative to the script's -# location. -. "$(dirname "$0")/common.sh" || exit 1 - -# Script must run inside the chroot. -assert_inside_chroot - -# May not be run as root. -assert_not_root_user - -DEFINE_string version "" \ - "Assume current chroot version is this." -DEFINE_boolean force_latest "${FLAGS_FALSE}" \ - "Assume latest version and recreate the version file" -DEFINE_boolean skipfirst "${FLAGS_FALSE}" \ - "Skip the first upgrade. This may be dangerous." - -FLAGS "$@" || exit 1 - -VERSION_FILE=/etc/cros_chroot_version -VERSION_HOOKS_DIR="$(dirname "$(readlink -f "${0}")")/chroot_version_hooks.d" - -update_version() { - sudo touch ${VERSION_FILE} - sudo chown ${USER} ${VERSION_FILE} - echo "${1}" > "${VERSION_FILE}" -} - -###################################################################### - -# Sanity checks: -if [ -n "${FLAGS_version}" ] && \ - ( [ "${FLAGS_skipfirst}" == "${FLAGS_TRUE}" ] || \ - [ "${FLAGS_force_latest}" == "${FLAGS_TRUE}" ] ); then - error "The option --version cannot be combined with either" - error "--skipfirst or --force_latest." - exit 1 -fi - -if [ "${FLAGS_skipfirst}" == "${FLAGS_TRUE}" ] && - [ "${FLAGS_force_latest}" == "${FLAGS_TRUE}" ]; then - error "--skipfirst and --force_latest cannot be combined." - exit 1 -fi - -# Latest version is the version of last upgrade.d file. -# Name format is ${number}_${short_description} -# Versions must be -n sorted, that is, the first continuous sequence -# of numbers is what counts. 12_ is before 111_, etc. -LATEST_VERSION=$( - cd "${VERSION_HOOKS_DIR}" - ls [0-9]*_* | cut -d_ -f1 | sort -rn | head -n1) - -if [ "${FLAGS_force_latest}" == "${FLAGS_TRUE}" ]; then - update_version "${LATEST_VERSION}" - exit 0 -fi - -# If the file does not exist at all, chroot is old and does not have a version. -# default goes here -if ! [ -f "${VERSION_FILE}" ]; then - info "Chroot of unknown version, initializing to 0" - update_version 0 -fi - -CHROOT_VERSION=$(<"${VERSION_FILE}") -# Check if version is a number. -if ! [ "${CHROOT_VERSION}" -ge "0" ] &> /dev/null; then - error "Your chroot version file ${VERSION_FILE} is bogus: ${CHROOT_VERSION}" - exit 1 -fi - -if [ "${FLAGS_skipfirst}" == "${FLAGS_TRUE}" ]; then - if [ "${CHROOT_VERSION}" -lt "${LATEST_VERSION}" ]; then - # if the new one is latest, this becomes noop - CHROOT_VERSION=$(expr ${CHROOT_VERSION} + 1) - update_version "${CHROOT_VERSION}" - else - error "Nothing to skip" - exit 1 - fi -fi - -if [ -n "${FLAGS_version}" ]; then - # Check if it's a number. - if ! [ "${FLAGS_version}" -ge "0" ] &> /dev/null; then - error "Trying to force invalid version: ${FLAGS_version}" - exit 1 - fi - - if [ "${FLAGS_version}" -gt "${LATEST_VERSION}" ]; then - error "Forcing nonexistant version: ${FLAGS_version}" - exit 1 - fi - - CHROOT_VERSION="${FLAGS_version}" -fi - - -if [ "${LATEST_VERSION}" -gt "${CHROOT_VERSION}" ]; then - info "Old chroot version (${CHROOT_VERSION}) found, running upgrade hooks" - - pushd "${VERSION_HOOKS_DIR}" 1> /dev/null - for n in $(seq "$(expr ${CHROOT_VERSION} + 1)" "${LATEST_VERSION}"); do - hook=(${n}_*) - - # Sanity check: if there are multiple ${n}_* files, then CL's landed - # at the same time and people didn't notice. Let's notice for them. - if [ ${#hook[@]} -gt 1 ]; then - error "Fatal: Upgrade ${n} has multiple hooks:" - error " ${hook[*]}" - error "Connor MacLeod knows: There can be only one." - exit 1 - fi - hook=${hook[0]} - - # Deprecation check; Deprecation can be done by removing old upgrade - # scripts and causing too old chroots to have to start over. - # Upgrades have to form a continuous sequence. - if ! [ -f ${hook} ]; then - error "Fatal: Upgrade ${n} doesn't exist." - error "Your chroot is so old, that some updates have been deprecated!" - error "You need to re-create it!" - exit 1 - fi - - info "Rollup ${hook}" - - # Attempt the upgrade. - # NOTE: We source the upgrade scripts because: - # 1) We can impose set -something on them. - # 2) They can reuse local variables and functions (fe. from common.sh) - # 3) They're allowed to use VERSION_HOOKS_DIR and VERSION_FILE. - # Note that the upgrade scripts have to be subshelled to protect ourselves, - # else a script running exit would stop the upgrade process entirely. - if ! ( source ${hook} ); then - error "Fatal: failed to upgrade ${n}!" - exit 1 - fi - # Each upgrade is atomic. If a middle upgrade fails, we won't retry - # all the ones that passed on a previous run. - update_version "${n}" - done - popd 1> /dev/null -fi - -command_completed diff --git a/sdk_lib/updates/36.0.0_python_upgrade_required.sh b/sdk_lib/updates/36.0.0_python_upgrade_required.sh new file mode 100644 index 0000000000..99b04a817c --- /dev/null +++ b/sdk_lib/updates/36.0.0_python_upgrade_required.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Copyright (c) 2013 The CoreOS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +cat >&2 <