aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordancer <dancer>2003-08-20 14:44:26 +0000
committerdancer <dancer>2003-08-20 14:44:26 +0000
commit2d91cebc1ef1cd68b99a48e98e5419a4f6db380e (patch)
treefb38b4455274757a46bd3900a28b7a3181761952
parent4a013986624c22d0496f8c74eeb49bad8315d72f (diff)
downloadpbuilder-2d91cebc1ef1cd68b99a48e98e5419a4f6db380e.tar
pbuilder-2d91cebc1ef1cd68b99a48e98e5419a4f6db380e.tar.gz
+ * pbuilder-user-mode-linux: Give warning when ran as root.
+ * Give more meaningful message when there is problem accessing the root + filesystem from inside user-mode-linux. (closes: #206292)
-rw-r--r--ChangeLog3
-rw-r--r--debian/changelog7
-rwxr-xr-xpbuilder-user-mode-linux9
3 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3931255..ee47bdc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2003-08-20 Junichi Uekawa <dancer@debian.org>
+ * pbuilder-user-mode-linux: give a more helpful message when /dev/ubd/1 is not mountable.
+ Give a warning message that running as uid=0 is not supported.
+
* pbuilder-buildpackage (BUILD_PID): Use chown "userid:" instead of
"userid"
diff --git a/debian/changelog b/debian/changelog
index fc2624c..7bee4c7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,11 @@
-pbuilder (0.82) UNRELEASED; urgency=low
+pbuilder (0.82) unstable; urgency=low
* Change use of chown.
+ * pbuilder-user-mode-linux: Give warning when ran as root.
+ * Give more meaningful message when there is problem accessing the root
+ filesystem from inside user-mode-linux. (closes: #206292)
- -- Junichi Uekawa <dancer@debian.org> Wed, 20 Aug 2003 23:23:49 +0900
+ -- Junichi Uekawa <dancer@debian.org> Wed, 20 Aug 2003 23:43:06 +0900
pbuilder (0.81) unstable; urgency=low
diff --git a/pbuilder-user-mode-linux b/pbuilder-user-mode-linux
index 616ab85..5e80149 100755
--- a/pbuilder-user-mode-linux
+++ b/pbuilder-user-mode-linux
@@ -60,7 +60,10 @@ ${UML_DEBUGMODE}
mount -t proc /proc /proc
mount -t tmpfs /tmp /tmp
-mount -t ext2 /dev/ubd/1 ${UML_CHROOT_MOUNTPOINT}
+if ! mount -t ext2 /dev/ubd/1 ${UML_CHROOT_MOUNTPOINT}; then
+ echo "E: Cannot mount /dev/ubd/1, is UML root image accessible as current user?"
+ exit 1
+fi
export LOGNAME="${LOGNAME}"
export HOME="${HOME}"
hostname "${UML_HOSTNAME}"
@@ -121,6 +124,10 @@ EOF
chmod a+x ${INSIDE_PBUILDER}
+ if [ $( id -u ) = 0 ]; then
+ echo "W: You are uid=0. Don't run UML as uid=0, it's not supported."
+ fi
+
echo Invoking: "linux mem=${UML_MEM} eth0=${MY_ETH0} con0=fd:0,fd:1 con=pty root=/dev/root rootflags=/ rootfstype=hostfs ubd1=${PBUILDER_COW}${PBUILDER_UML_IMAGE} devfs=mount init=${INSIDE_PBUILDER} rw"
if linux mem=${UML_MEM} eth0=${MY_ETH0} con0=fd:0,fd:1 con=pty root=/dev/root rootflags=/ rootfstype=hostfs ubd1="${PBUILDER_COW}${PBUILDER_UML_IMAGE}" devfs=mount init=${INSIDE_PBUILDER} rw ; then
UML_EXITCODE=$?