The module-init-tools from kernel.org: modprobe, insmod, rmmod and lsmod. We have chosen to use these because we can compile modutils/modprobe to support compressed (.gz) modules to save space. To do this we use the option --enable-zlib, we then clean and copy the binaries. We do not take everything that has been created, only what we need: depmod, insmod, modinfo, modprobe and rmmod in /sbin and lsmod in /bin:
# cd ..
# wget http://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-3.2.tar.bz2
# tar xjf module-init-tools-3.2.tar.bz2
# cd module-init-tools-3.2
# ./configure --enable-zlib --prefix=/usr --sbindir=/sbin --bindir=/bin \
--sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man
# make
# make DESTDIR=$PWD/_pkg install
# strip -v _pkg/sbin/{depmod,insmod,modinfo,modprobe,rmmod}
# strip -v _pkg/bin/lsmod
# cp -i _pkg/sbin/{depmod,insmod,modinfo,modprobe,rmmod} $fs/sbin
# cp -i _pkg/bin/lsmod $fs/bin
# cd ..
Copy kernel modules
Copy files from linux-2.6.20/_pkg:
# cp -a linux-2.6.20/_pkg/lib/* $fs/lib
Compress kernel modules
Compress modules, this step will gain us back around 50% of available space. We begin by moving into the rootfs, then we search for all files with the .ko extension, and compress them.
# cd lib/modules/2.6.20-slitaz
# find . -name "*.ko" -exec gzip '{}' \;
# sed 's/\.ko/.ko.gz/g' modules.dep > tmp.dep
# rm modules.dep
# mv tmp.dep modules.dep
Sem comentários:
Enviar um comentário