Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2151)

Unified Diff: bin/cros_package_to_live

Issue 3439012: Add "--mount" option to package_to_live (Closed) Base URL: ssh://gitrw.chromium.org/crosutils.git
Patch Set: D'ing TRT Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cros_package_to_live
diff --git a/bin/cros_package_to_live b/bin/cros_package_to_live
index d1d9480448c1290709931424eabb0ee9f4d6e5b7..6b8ec623693b52157816793c79c90a6e34ec7659 100755
--- a/bin/cros_package_to_live
+++ b/bin/cros_package_to_live
@@ -33,8 +33,11 @@ FLAGS "$@" || exit 1
TMP=$(mktemp -d /tmp/cros_package_to_live.XXXX)
function cleanup {
- cleanup_remote_access
- rm -rf "${TMP}"
+ if [ "${mount_type}" = ro ]; then
+ remote_sh "mount -o remount,ro /" || /bin/true
+ fi
+ cleanup_remote_access
+ rm -rf "${TMP}"
}
# Make sure we have a package name
@@ -62,6 +65,13 @@ fi
PKGROOT="${FLAGS_build_root}/${FLAGS_board}/packages"
+remote_sh "grep '\S* / ' /proc/mounts | tail -1 | awk '{ print \$4 }' |
+ cut -d, -f1"
+mount_type=$REMOTE_OUT
+if [ "${mount_type}" = ro ]; then
+ remote_sh "mount -o remount,rw /"
+fi
+
for pkg in $@; do
latest_pkg=$(ls -tr $PKGROOT/*/${pkg}-[0-9]* | tail -1)
if [ -z "${latest_pkg}" ]; then
@@ -75,12 +85,10 @@ for pkg in $@; do
remote_sh "mktemp -d /tmp/cros_package_to_live.XXXX"
temp_dir=$REMOTE_OUT
remote_cp_to "${latest_pkg}" "${temp_dir}"
- remote_sh "mount -o remount,rw /"
remote_sh "mkdir -p /usr/portage/packages/${pkg_dir} &&
mv ${temp_dir}/${pkg_name} /usr/portage/packages/${pkg_dir} &&
env FEATURES=-sandbox emerge --usepkg \
/usr/portage/packages/${pkg_dir}/${pkg_name} 1>&2"
echo "${pkg} has been installed"
remote_sh "rm -rf ${temp_dir}"
- remote_sh "mount -o remount,ro /" || /bin/true
done
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698