Package: pbuilder-uml
Version: 0.161
Severity: wishlist
Tags: patch

As rootstrap allows this configuration it would be nice if pbuilder-uml
was aware of it too and mount /lib/modules early enough to avoid errors
and warnings.

Thanks

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (990, 'testing'), (300, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.20-rc2-mm1-1
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages pbuilder-uml depends on:
ii  pbuilder                    0.161        personal package builder for Debia
ii  rootstrap                   0.3.24-2     A tool for building complete Linux
ii  user-mode-linux             2.6.18-1um-2 User-mode Linux (kernel)

pbuilder-uml recommends no packages.

-- no debconf information
-- 
mattia
:wq!
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} [EMAIL PROTECTED] --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 

Reply via email to