On Mon, Dec 25, 2006 at 02:56:01PM -0500, Joey Hess wrote: > Here xen-create-image likes to copy over my dom0's /lib/modules, all 650 > mb of it (I have a "few" kernels installed).
Agreed. > Seems to me that for etch and up, a better approach when creating an > image is to install linux-modules-$(uname -r) I've thought about different solutions to this problem several times, but I can't quite convince myself that there is a perfect solution. I find that the Debian xen-kernels are unsuitable for me on a lot of machines, so I use custom kernels and source-compiles of Xen. I can see that copying /lib/modules/$(uname -r) might be OK since it will do the right thing on machines which are running a Debian image, or on a self-made Xen installation. If you could be happy with that not being controlled by dpkg then I'd make that change. Otherwise I think that adding a simple hook script would be simple enough. Something like: #!/bin/sh # role-script for purging modules prefix=$1 if [ ! -d "${prefix}/lib/modules" ]; then echo "No modules directory. Weirdness. Aborting" exit fi # remove all modules rm -rf "${prefix}/lib/modules"; # make a new directory mkdir ${prefix}/lib/modules # install package chroot ${prefix} /usr/bin/apt-get -q -q install linux-modules-$(uname -r) The only downside to that approach would be that you can only have one role script so using that one would rule out using others.. Steve -- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]