From 89ae722a219d34e72dabc96dc4e3da11096d2c4b Mon Sep 17 00:00:00 2001 From: Ken Mixter Date: Wed, 24 Feb 2010 19:15:14 -0800 Subject: [PATCH] Fix problem with mod_image_for_test leaving dangling chroot ref Review URL: http://codereview.chromium.org/661061 --- mod_for_test_scripts/700enableNewLoginManager | 9 --------- mod_image_for_test.sh | 5 +++++ 2 files changed, 5 insertions(+), 9 deletions(-) delete mode 100755 mod_for_test_scripts/700enableNewLoginManager diff --git a/mod_for_test_scripts/700enableNewLoginManager b/mod_for_test_scripts/700enableNewLoginManager deleted file mode 100755 index c2666377ed..0000000000 --- a/mod_for_test_scripts/700enableNewLoginManager +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2010 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. -# -# Modifies upstart for login manager to use new login manager - -sed -i 's?^#exec /sbin/session_manager_setup.sh?exec /sbin/session_manager_setup.sh?' /etc/init/ui.conf 2> /dev/null -sed -i 's?^expect fork?#expect fork?' /etc/init/ui.conf 2> /dev/null -sed -i 's?^exec /usr/bin/slim -d?#exec /usr/bin/slim -d?' /etc/init/ui.conf 2> /dev/null diff --git a/mod_image_for_test.sh b/mod_image_for_test.sh index 98706d92d2..ef783a98d0 100755 --- a/mod_image_for_test.sh +++ b/mod_image_for_test.sh @@ -50,6 +50,10 @@ cleanup_rootfs_mounts() { echo "Killing process that has open file on our rootfs: $cmdline" ! sudo kill $pid # Preceded by ! to disable ERR trap. done + if [[ -d "${ROOT_FS_DIR}/modify_scripts" ]]; then + echo "Cleaned up modify_scripts mount" + ! sudo umount "${ROOT_FS_DIR}/modify_scripts" + fi } cleanup_rootfs_loop() { @@ -97,6 +101,7 @@ fi MOD_SCRIPTS_ROOT="${GCLIENT_ROOT}/src/scripts/mod_for_test_scripts" sudo mkdir -p "${ROOT_FS_DIR}/modify_scripts" + sudo mount --bind "${MOD_SCRIPTS_ROOT}" "${ROOT_FS_DIR}/modify_scripts" # Run test setup script inside chroot jail to modify the image