From 2d91cebc1ef1cd68b99a48e98e5419a4f6db380e Mon Sep 17 00:00:00 2001 From: dancer Date: Wed, 20 Aug 2003 14:44:26 +0000 Subject: + * 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) --- pbuilder-user-mode-linux | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'pbuilder-user-mode-linux') 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=$? -- cgit v1.2.3