yum install kernel-devel kernel-headers
cd /tmp
wget kernel-3.10.0-64.el7.x86_64.rpm
rpm -ivh kernel-3.10.0-64.el7.x86_64.rpm (这时会在/root/rpmbuild/SOURCES下生成tar包)
cd ~/rpmbuild/SOURCES
tar jxf kernel-3.10.0-64.el7.x86_64.tar -C /usr/src/kernels/
cd /usr/src/kernels
mv $(uname -r) $(uname -r)-old
mv linux-2.6.32-220.4.2.el6 $(uname -r)
cd $(uname -r)
make mrproper
cp ../$(uname -r)-old/Module.symvers .
cp /boot/config-$(uname -r) ./.config
make oldconfig
make prepare
make scripts
make CONFIG_BLK_DEV_NBD=m M=drivers/block
cp drivers/block/nbd.ko /lib/modules/$(uname -r)/kernel/drivers/block/
depmod -a
modprobe nbd 启用nbd模块
阅读(1801) | 评论(3) | 转发(0) |