From 73528d94e70d8b6cf04491a095e63c015d0b1413 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Tue, 3 Aug 2010 15:51:33 +0200 Subject: [PATCH] Mounts also /dev/pts automatically before running any hooks or rules Closes Debian bug #588783. --- bin/xen-create-image | 16 ++++++++++++++-- debian/changelog | 2 ++ hooks/common.sh | 2 -- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bin/xen-create-image b/bin/xen-create-image index bde74f4..959a68c 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -3619,7 +3619,7 @@ sub exportEnvironment Run the xt-customise-system script to customize our fresh installation. Before we do this we must pass all the relevant options into our - environment and mount /proc. + environment and mount /proc and /dev/pts. =end doc @@ -3637,6 +3637,17 @@ sub runCustomisationHooks # 2. Mount runCommand("mount -o bind /proc $MOUNT_POINT/proc"); + # + # Before running any scripts we'll mount /dev/pts in the guest, too. + # + # 1. Make sure there is a directory. + mkdir( $MOUNT_POINT . "/dev", 0755 ) if ( !-d $MOUNT_POINT . "/dev" ); + mkdir( $MOUNT_POINT . "/dev/pts", 0755 ) + if ( !-d $MOUNT_POINT . "/dev/pts" ); + + # 2. Mount + runCommand("mount -t devpts devpts $MOUNT_POINT/dev/pts"); + # # Now update the environment for each defined IP address. # these are handled specially since we use arrays. @@ -3701,9 +3712,10 @@ sub runCustomisationHooks } # - # Unmount /proc in the guest install. + # Unmount /proc and /dev/pts in the guest install. # runCommand("umount $MOUNT_POINT/proc"); + runCommand("umount $MOUNT_POINT/dev/pts"); } diff --git a/debian/changelog b/debian/changelog index 8cc35b0..ec9b735 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ xen-tools (4.2~rc1-1) UNRELEASED; urgency=low details. - Uses the same 15-disable-hwclock hook for Debian as for Ubuntu DomUs (Closes: #588880) + - Mounts not only /proc but also /dev/pts automatically before running + any customisation hooks (Closes: #588783) * Bump Standards-Version to 3.9.1 (no changes) -- Axel Beckert Wed, 02 Jun 2010 18:10:34 +0200 diff --git a/hooks/common.sh b/hooks/common.sh index e768ee6..7cfde99 100755 --- a/hooks/common.sh +++ b/hooks/common.sh @@ -98,9 +98,7 @@ installDebianPackage () # # Install the packages # - mount -t devpts devpts ${prefix}/dev/pts DEBIAN_FRONTEND=noninteractive chroot ${prefix} /usr/bin/apt-get --yes --force-yes install "$@" - umount ${prefix}/dev/pts # # Remove the policy-rc.d script.