cd /usr/src

wget --no-check-certificate https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.12.tar.bz2

apt-get install bzip2 gcc g++ make bc ncurses-devel

tar -xvjf linux-3.12.tar.bz2

cd linux-3.12

cp /boot/config-3.2.0-4-686-pae .config

make menuconfig

选择load加载.config,然后返回保存。

make dep 读取配置文件,创建对应于配置的依赖关系树,从而决定哪些需要编译
make clean 删除大多数编译生成的文件,但是会保留内核配置文件.config,还有足够的编译支持来建立扩展模块
make zImage
make bzImage
make modules
make modules_install

depmod -a 生成模块间的依赖关系,启动新内核之后,使用modprobe命令加载模块时可以正确地定位模块。
make mrproper 删除所有编译生成的文件,内核配置文件,再加上各种备份文件
make distclean mrproper删除的文件,加上备份文件和一些补丁文件。
删除的文件范围从小到大依次为:make clean < make mrproper < make distclean。
执行make mrproper,会先执行make clean,执行make distclean之前,会先执行make mrproper。
make headers_install
make headers_check ???

dpkg -P kernel-image-xxxx
apt-get remove --purge kernel-image-xxxx

kernel panic - not syncing:VFS:unable to mount root fs on unknown block (0,0)
debian:/boot# update-initramfs -d -k 3.2.0-2-amd64
update-initramfs: Deleting /boot/initrd.img-3.2.0-2-amd64
debian:/boot# update-initramfs -c -k 3.2.0-4-amd64
update-initramfs: Generating /boot/initrd.img-3.2.0-4-amd64

Logo

更多推荐