uname-r#->3.10.0-123.el7.x86_64
yuminstallkernel-develkernel-headers
cd/tmp
wget/7.0.1406/os/Source/SPackages/kernel-3.10.0-123.el7.src.rpm
rpm-ihvkernel-3.10.0-123.el7.src.rpm(这时会在/root/rpmbuild/SOURCES下生成tar.xz包)
cd~/rpmbuild/SOURCES
tarJxvflinux-3.10.0-123.el7.tar.xz-C/usr/src/kernels/
cd/usr/src/kernels/
mv$(uname-r)$(uname-r)-old
mvlinux-3.10.0-123.el7$(uname-r)
cd$(uname-r)
makemrproper
cp../$(uname-r)-old/Module.symvers./
cp/boot/config-$(uname-r)./.config
makeoldconfig
makeprepare
makescripts
makeCONFIG_BLK_DEV_NBD=mM=drivers/block
cpdrivers/block/nbd.ko/lib/modules/$(uname-r)/kernel/drivers/block/
depmod-a
modprobe nbd 启用nbd模块