mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 21:16:57 +02:00
Mid air collision of upgrade script 17_*
Move grub upgrade to 18_ Move sudo upgrade to 19_ Empty out old 17_ BUG=chromium-os:21244 TEST=manual inspection Change-Id: Iaffbe75022e3287f2071dae46d5010a1b10d27d3 Reviewed-on: https://gerrit.chromium.org/gerrit/11971 Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Ready: Anush Elangovan <anush@chromium.org> Tested-by: Anush Elangovan <anush@chromium.org>
This commit is contained in:
parent
8d3ea4b7e8
commit
7f15be2102
@ -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 <<EOF > "${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
|
||||
|
@ -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
|
32
chroot_version_hooks.d/19_sudo_90_cros
Normal file
32
chroot_version_hooks.d/19_sudo_90_cros
Normal file
@ -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 <<EOF > "${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
|
Loading…
Reference in New Issue
Block a user