aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-user-mode-linux
diff options
context:
space:
mode:
authorJunichi Uekawa <dancer@dancer64.netfort.gr.jp>2007-01-30 23:36:33 +0900
committerJunichi Uekawa <dancer@dancer64.netfort.gr.jp>2007-01-30 23:36:33 +0900
commit32b292e4068352b99d4130393c2ef149bd49de30 (patch)
tree376b84cddfabe7a259cf76135141f8de917adfe2 /pbuilder-user-mode-linux
parentde15913fe95c7157b0232f54e75b34298680dff9 (diff)
downloadpbuilder-32b292e4068352b99d4130393c2ef149bd49de30.tar
pbuilder-32b292e4068352b99d4130393c2ef149bd49de30.tar.gz
406845: allow pbuilder-user-mode-linux to mount /lib/modules on the host
Diffstat (limited to 'pbuilder-user-mode-linux')
-rwxr-xr-xpbuilder-user-mode-linux9
1 files changed, 9 insertions, 0 deletions
diff --git a/pbuilder-user-mode-linux b/pbuilder-user-mode-linux
index 1085b02..41fe070 100755
--- a/pbuilder-user-mode-linux
+++ b/pbuilder-user-mode-linux
@@ -75,6 +75,12 @@ if ! mount -t ext2 /dev/ubdb ${UML_CHROOT_MOUNTPOINT}; then
fi
mount --bind ${UML_CHROOT_MOUNTPOINT}/dev /dev
+# mount /lib/modules on the hostfs
+kernel_modules=\$(sed -ne 's\$.*/lib/modules.*hostfs.*defaults,ro,\([^[:space:]]*\).*\$\1\$p' ${UML_CHROOT_MOUNTPOINT}/etc/fstab)
+if [ -n "\${kernel_modules}" ] ; then
+ echo " -> Mount /lib/modules on the host \${kernel_modules}"
+ mount -t hostfs -o ro,\${kernel_modules} hostfs /lib/modules
+fi
export LOGNAME="${LOGNAME}"
export HOME="${HOME}"
@@ -133,6 +139,9 @@ 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
+if [ -n "\${kernel_modules}" ] ; then
+ umount /lib/modules
+fi
umount /dev
umount ${UML_CHROOT_MOUNTPOINT}
/sbin/halt -d -f