Change MODLIB in $(TOPDIR)/Makefile (e.g. /usr/src/linux/Makefile). I do this
to compile the kernel and modules without root priviledges at all. make
modules_install will fail at the end when trying to run 'depmod', but that's
okay - you can do that yourself:
(TOPDIR=${HOME}/linux, MODLIB=${HOME}/kernel/<revision>/modules)
cd $TOPDIR
make config dep clean bzImage modules && cp arch/i386/boot/bzImage System.map \
${MODLIB}/../ && make modules_install || echo modules_install failed as expected
cd ${MODLIB}/../
mkdir -p lib/modules
ln -s ${PWD}/modules lib/modules/`uname -r`
depmod -F System.map -C /dev/null -b $PWD -r -a
Note that Joe Average user can do all of this, root need not be involved at
all.
Then fix up the resulting modules.dep with sed, I don't remember what depmod
gives you exactly so I can't type out the exact command.. then clean up:
rm lib/modules/`uname -r` ; rmdir lib/modules lib
Now you have a nice kernel package ready to go in $HOME/kernel. Don't forget
to copy $MODLIB into the right spot (rename the directory to the kernel's
revision) and chown -R root or modutils will pout, unless you are making a
romfs or such where the only user is root :-) nfs will work just fine without
security qualms since the kernel installation is non-root owned. (for
large-scale deployment, you probably can't beat having machines booting from
a server and fetching new romfs images each boot.)
btw, the abuse of depmod in this way isn't very nice, but afaics there is no
other way. I would personally like depmod to dump dependency information for
any valid module tree, expanding the definition of valid to include trees not
prefixed by /lib/modules/`uname -r`, but oh well, it gets by in the end as so
many other things do ;-)
Maciek
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/