diff --git a/chroot_version_hooks.d/17_sudo_90_cros b/chroot_version_hooks.d/17_sudo_90_cros index 7f664d54c2..ce2ce99bfb 100644 --- a/chroot_version_hooks.d/17_sudo_90_cros +++ b/chroot_version_hooks.d/17_sudo_90_cros @@ -2,31 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# Older chroots used to tweak /etc/sudoers directly, but we split that -# off into files in /etc/sudoers.d/. One of those is handled by the -# make_chroot helper, so make sure we upgrade old chroots which missed -# the migration to /etc/sudoers.d/90_cros. -frag="/etc/sudoers.d/90_cros" -if [ ! -e ${frag} ]; then - tmp=$(mktemp 2>/dev/null || echo /tmp/17_upgrade_hook.$$) - cat < "${tmp}" || exit 1 -Defaults env_keep += CROS_WORKON_SRCROOT -Defaults env_keep += CHROMEOS_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 +# This upgrade is a dummy since there was a mid air collision; moved to 19_* exit 0 diff --git a/chroot_version_hooks.d/17_grub_upgrade b/chroot_version_hooks.d/18_grub_upgrade similarity index 79% rename from chroot_version_hooks.d/17_grub_upgrade rename to chroot_version_hooks.d/18_grub_upgrade index 18e15c8685..27c7a0b823 100644 --- a/chroot_version_hooks.d/17_grub_upgrade +++ b/chroot_version_hooks.d/18_grub_upgrade @@ -4,5 +4,4 @@ CLEAN_DELAY=0 sudo emerge --unmerge =sys-boot/grub-1.97-r2 -info "Chroot upgraded to version 17: Removed old grub install" exit 0 diff --git a/chroot_version_hooks.d/19_sudo_90_cros b/chroot_version_hooks.d/19_sudo_90_cros new file mode 100644 index 0000000000..7f664d54c2 --- /dev/null +++ b/chroot_version_hooks.d/19_sudo_90_cros @@ -0,0 +1,32 @@ +# 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. + +# Older chroots used to tweak /etc/sudoers directly, but we split that +# off into files in /etc/sudoers.d/. One of those is handled by the +# make_chroot helper, so make sure we upgrade old chroots which missed +# the migration to /etc/sudoers.d/90_cros. +frag="/etc/sudoers.d/90_cros" +if [ ! -e ${frag} ]; then + tmp=$(mktemp 2>/dev/null || echo /tmp/17_upgrade_hook.$$) + cat < "${tmp}" || exit 1 +Defaults env_keep += CROS_WORKON_SRCROOT +Defaults env_keep += CHROMEOS_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