Fix problem with mod_image_for_test leaving dangling chroot ref

Review URL: http://codereview.chromium.org/661061
This commit is contained in:
Ken Mixter 2010-02-24 19:15:14 -08:00
parent 213f8958aa
commit 89ae722a21
2 changed files with 5 additions and 9 deletions

View File

@ -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

View File

@ -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