mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-04 12:02:13 +02:00
Most of the time the files in the chroot /etc/ are already changed to the proper owner. Only on the first run do they need to be changed. So check the owner before doing the sudo as that is a bit faster. If we do end up needing to run sudo, bundle the commands up to avoid having to execute sudo multiple times. BUG=None TEST=`sudo chown root chroot/etc/resolv.conf && cros_sdk --enter`; see /etc/resolv.conf owned by me Change-Id: Ifd974ace168ab309fdc2e7583d135ee23576a5bb Reviewed-on: http://gerrit.chromium.org/gerrit/8418 Reviewed-by: David James <davidjames@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>