# 1.1 kernel update
1. yum groupinstall 'development tools'
-- yum install yum install xmlto asciidoc hmaccalc python-devel newt-devel \ perl pesign elfutils-devel zlib-devel binutils-devel audit-libs-devel \ numactl-devel pciutils-devel ncurses-develes-deve perl-ExtUtils-Embed
-- yumdownloader --source kernel-3.10.0-327.4.5.el7
-- rpm -ivh "your kernel source rpm". if root user, it's installed in \/root\/rpmbuild.
-- rpmbuild -bp kernel.spec . unpack sources and applies patches. "BUILD, BUILDROOT, RPMS, SRPMS" folders 會被建起來.
-- go to \/root\/rpmbuild\/BUILD\/kernel-3.10.0-327.4.5.el7\/linux-3.10.0-327.4.5.el7.x86_64,
- make menuconfig
- go to General setup-->Local version 然後設你自己的 kernel 名稱(prefix 3.10.0 的名稱 always 存在).
- enable debug mode, 3.1 Kernel hacking ---> [*]kernel debugging, Kernel hacking ---> [*]Compile the kernel with debug info, Kernel hacking ---> KGDB: kernel debugging with remote gdb
-- make all
-- make modules_install
-- cp System.map \/root\/img\/System.map-3.10.0-327.4.5.ByDamon
-- cp .config \/root\/img\/config-3.10.0-327.4.5.ByDamon
-- cp arch\/x86_64\/boot\/bzImage \/root\/img\/vmlinuz-3.10.0-327.4.5.ByDamon
-- mkinitrd \/root\/img\/initramfs-3.10.0-327.4.5.ByDamon 3.10.0-327.4.5.ByDamon, 將 \/lib\/modules\/3.10.0-327.4.5.ByDamon 打包成initramfs-3.10.0-327.4.5.ByDamon
-- cd \/lib\/modules, tar -czf \/root\/img\/3.10.0-327.4.5.ByDamon.tgz 3.10.0-327.4.5.ByDamon
-- on target machine,
- use sftp 從build-server將 System.map-3.10.0.ByDamon, config-3.10.0.ByDamon initramfs-3.10.03.10.0-327.4.5.ByDamon, vmlinuz-3.10.0.ByDamon 複製到 \/boot ,
- 從build-server將3.10.03.10.0-327.4.5.ByDamon.tgz 複製到 \/lib\/modules, 然後 tar -xzf 3.10.03.10.0-327.4.5.ByDamon.tgz
add entry to grub.cfg (\/boot\/grub2\/),
reboot system.