Simple Guide to Fedora19 Kernel Compilation (BFS + BFQ + UKSM patch)

Source: Internet
Author: User
Tags rpmbuild
Fedora19 compile the kernel (BFS + BFQ + UKSM patch) simple guide to prepare the work terminal for running, 1su-c & amp; #39; yuminstallrpmdevtoolsyum-utilsncurses-devel & amp; #39; my system is relatively small in SSD, so I put the RPM compilation home directory on the mobile hard disk (... fedora 19 compile the kernel (BFS + BFQ + UKSM patch) simple guide to prepare the work terminal for running, 1su-c 'yum install rpmdevtools yum-utils ncurses-devel 'my system is mounted on SSD, small, so I put the RPM compilation home directory on the mobile hard drive (/media/c/rpmbuild. Edit ~ /. Rpmmacros, modify the first behavior: 1% _ topdir/media/c/rpmbuild save and exit, and then run rpmdev-setuptree in the terminal. at this time,/media/c/rpmbuild is automatically generated, and there will be RPM, BUILD, BUILDROOT and other folders. Download the kernel source code used by Fedora (do not go to the source code on kernel.org. Ora uses a lot of patches for the kernel and may cause problems when downloading the original kernel compilation ). 123 yumdownloader -- sourcekernel -- enablerepo = updates-testingsu-c 'yum-builddep kernel- . Src. rpm 'rpm-Uvh kernel- . Src. rpm is the version number of the downloaded kernel SRPM. replace it accordingly. The third command rpm-Uvh may have a bunch of warnings, which can be ignored. Now you can prepare the kernel source code. run 12cd/media/c/rpmbuild/SPECSrpmbuild-bp -- target = $ (uname-m) kernel on the terminal. spec downloads the desired patch, such as the CK patch set (BFS), bfq io scheduler, and UKSM memory patch. Basically, these patches are installed with the following command. 12cd/media/c/rpmbuild/BUILD/kernel- /Linux- /Patch-p1-X86_64.config. configmakeoldconfigmakemenuconfig the First Command is to copy the default configuration (x86_64 is the configuration file of a 64-bit PC). after the second make oldconfig is executed, there will be a few options as needed, then, make menuconfig and start to make drastic changes to the Kernel configuration. here, we need to remind you to turn off the Kernel hacking-> Kernel debugging, otherwise, the modules folder will be super large (up to 1.7 GB by default !). In addition, control groups (cgroups) must be enabled, otherwise the systemd used by Fedora will not work. The rest is to streamline the kernel module and reduce the kernel size! After editing, remember to Save and Exit. unlike what is said on wiki, after all, we are not kernel developers who don't go to fedora to submit rpm patches, don't re-modify SPECS, and then rpm-bb or something, after running 1makerpm on a direct terminal (depending on the machine level, it may take several minutes to several minutes), run/media/c/rpmbuild/RPMS/x86_64 (assuming you are also a 64-bit machine) the rpm packages of kernel and kernel-headers are generated. Install it with rpm command: 1 rpm-ivh Prepare the new kernel for startup. I did not generate an initramfs image for me after installation, nor update the grub. cfg file of grub2. So I run the following command under the terminal to generate the initramfs image: 12cd/bootsu-c 'dracut initramfs-3.10.10-librehat.img 3.10.10-librehat 'where 3.10.10-librehat is the kernel name (/boot/vmlinuz-3.10.10-librehat ), then update grub. cfg File: 1su-c 'grub2-mkconfig>/boot/grub2/grub. cfg 'make sure that both vmlinuz and initramfs of the new kernel are found in the output. Now, you can restart and try the new compiled kernel !!! After I simplified/lib/modules/3.10.10-librehat, it only has 30 + MB (20 + MB at most ). Everything went smoothly, and you plan to stop yum from interfering with Kernel upgrade. in the future, the kernel upgrade package will be compiled manually! Edit/etc/yum. conf, add the kernel * in the exclude (manually add a row if there is no exclude), such as: 1 exclude = kernel, yum update or yum upgrade will skip the rpm package related to the kernel!
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.