diff --git a/common.sh b/common.sh index 879ebb3829..4af1b3bd05 100644 --- a/common.sh +++ b/common.sh @@ -564,26 +564,6 @@ print_time_elapsed() { echo "Elapsed time: ${minutes}m${seconds}s" } -# This function is a place to put code to incrementally update the -# chroot so that users don't need to fully re-make it. It should -# be called from scripts that are run _outside_ the chroot. -# -# Please put date information so it's easy to keep track of when -# old hacks can be retired and so that people can detect when a -# hack triggered when it shouldn't have. -# -# ${1} specifies the location of the chroot. -chroot_hacks_from_outside() { - # Give args better names. - local chroot_dir=$1 - - # Add root as a sudoer if not already done. - if ! sudo grep -q '^root ALL=(ALL) ALL$' "${chroot_dir}/etc/sudoers" ; then - info "Upgrading old chroot (pre 2010-10-19) - adding root to sudoers" - sudo bash -c "echo root ALL=\(ALL\) ALL >> \"${chroot_dir}/etc/sudoers\"" - fi -} - # The board and variant command line options can be used in a number of ways # to specify the board and variant. The board can encode both pieces of # information separated by underscores. Or the variant can be passed using diff --git a/enter_chroot.sh b/enter_chroot.sh index c642b7b04c..6515015f75 100755 --- a/enter_chroot.sh +++ b/enter_chroot.sh @@ -336,37 +336,6 @@ function teardown_env { ) 200>>"$LOCKFILE" || die "teardown_env failed" } -# This function does extra "fixups" of the chroot. It's a lot like -# chroot_hacks_from_outside() in common.sh, except that it is only called -# from enter_chroot.sh (chroot_hacks_from_outside is also called from -# make_chroot.sh). This function was created because common.sh is on lockdown -# and can't be changed. -# -# NOTE: the need for this type of "fixup" should be going away. If everything -# in the chroot is versioned and nothing is generated, there is no need to -# handle partly fixing up generated files. -# -# Please put date information so it's easy to keep track of when -# old hacks can be retired and so that people can detect when a -# hack triggered when it shouldn't have. -function chroot_hacks_too() { - local chroot_home="${FLAGS_chroot}/home/${USER}" - - # Add chromite stuff if not already done. - if ! grep -q "^PATH=.*/trunk/chromite/bin" "${chroot_home}/.bashrc"; then - info "Upgrading old chroot (pre 2011-02-09) - adding chromite to path" - echo "PATH=\$PATH:/home/${USER}/trunk/chromite/bin" >> \ - "${chroot_home}/.bashrc" - fi - if ! [ -L "${chroot_home}/.local/lib/python2.6/site-packages/chromite" ]; then - info "Upgrading old chroot (pre 2011-02-09) - add chromite to site-packages" - mkdir -p "${chroot_home}/.local/lib/python2.6/site-packages" - ln -s ../../../../trunk/chromite \ - "${chroot_home}/.local/lib/python2.6/site-packages/" - fi -} - - if [ $FLAGS_mount -eq $FLAGS_TRUE ]; then setup_env info "Make sure you run" @@ -381,11 +350,6 @@ if [ $FLAGS_unmount -eq $FLAGS_TRUE ]; then exit 0 fi -# Apply any hacks needed to update the chroot. -chroot_hacks_from_outside "${FLAGS_chroot}" -chroot_hacks_too - - # Make sure we unmount before exiting trap teardown_env EXIT setup_env