[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug in lh_mount_devpts



Hello,

I found a bug in lh_mount_devpts. When I was trying to build a
live-image, I got the following:

...
P: Begin unmounting /sys...
P: Begin unmounting /proc...
P: Begin unmounting /dev/pts...
P: Begin caching chroot stage...
P: Begin copying chroot...
P: This may take a while.
P: Begin mounting /dev/pts...
mount: devpts-live already mounted or chroot/dev/pts busy
mount: according to mtab, devpts-live is mounted on
/fs0/debianlive/ookjij/chroot/dev/pts

I turns out than lh_mount_devpts is checking whether chroot/dev/pts/0
exists before umounting. In this case there was no pts/0, so devpts was
not umounted. However, devpts was mounted and pts/[1-6] existed. I
patched lh_mount_devpts with something that works better, I hope.

--- lh_chroot_devpts.orig       2007-11-30 09:34:09.000000000 +0100
+++ lh_chroot_devpts    2007-11-30 09:36:28.000000000 +0100
@@ -77,7 +77,7 @@
 		# Unmounting /dev/pts
 		if [ "${LH_USE_FAKEROOT}" != "enabled" ]
 		then
-			if [ -e chroot/dev/pts/0 ]
+			if ls /dev/pts/[0-9] > /dev/null 2>&1
 			then
 				${LH_ROOT_COMMAND} umount chroot/dev/pts
 			fi

Greetings,
Ben.



Reply to: