aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-10-15 14:05:53 +0000
committerMattia Rizzolo <mattia@mapreri.org>2015-10-15 14:05:53 +0000
commit1b0e726f0edc9d474a6245a2a55b317ab9ac3fc9 (patch)
tree4060c49fc4e30a2e6b98fe0be3cdedf18fda272b
parentfb76f5158450f988f1def4ef6bb994840a530513 (diff)
downloadpbuilder-1b0e726f0edc9d474a6245a2a55b317ab9ac3fc9.tar
pbuilder-1b0e726f0edc9d474a6245a2a55b317ab9ac3fc9.tar.gz
uml: stop networking before quitting, so that the whole thing can exit properly
Closes: #416918 Thanks: Paul TBBle Hampson <Paul.Hampson@Pobox.com> for the patch
-rwxr-xr-xpbuilder-user-mode-linux11
1 files changed, 11 insertions, 0 deletions
diff --git a/pbuilder-user-mode-linux b/pbuilder-user-mode-linux
index 48ce023..1e940dc 100755
--- a/pbuilder-user-mode-linux
+++ b/pbuilder-user-mode-linux
@@ -150,6 +150,17 @@ else
fi
pbuilder "$1" ${UML_EXTRAOPT} \${EXTRAOPT[@]} --buildresult "\${BUILDRESULT}" --buildplace "${UML_CHROOT_MOUNTPOINT}" --internal-build-uml ${UML_DEBUGMODE:+--debug} ${BUILDING_DSC_FILE} ${UML_EXECUTE_EXTRAOPT}
echo \$? > /proc/exitcode
+cat <<SHELL > ${UML_CHROOT_MOUNTPOINT}/tmp/chrootshell
+#! /bin/bash
+${UML_DEBUGMODE}
+# the shell executed inside chroot inside UML
+ echo Stopping network inside the chroot
+ mount -t proc /proc /proc
+ /etc/init.d/networking stop
+ umount /proc
+SHELL
+chmod a+x ${UML_CHROOT_MOUNTPOINT}/tmp/chrootshell
+chroot ${UML_CHROOT_MOUNTPOINT} /tmp/chrootshell
if [ -n "\${kernel_modules}" ] ; then
umount /lib/modules