Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ CentOS How quickly customize kernel binary RPM package     - Two alert log ORA Errors (Database)

- Oracle conditional select statements and looping statements (Database)

- MySQL loose index scan (Database)

- CentOS 6.5 / Linux restart network card being given Determining if ip address x.x.x.x is already in use (Linux)

- To install PostgreSQL 9.4 (Database)

- Let CentOS perform PPPoE dial-up, ADSL can be used in a network environment! (Linux)

- 5 fast Node.js application performance tips (Programming)

- To install CentOS 6.5 on your hard drive under Windows 7 (Linux)

- Java polymorphic methods inside constructors complete analysis (Programming)

- Installation JDK 1.8 under CentOS7 (Linux)

- Oracle 12c of the auto-increment Identity Columns (Database)

- SA weak password security system of the security risks posed (Linux)

- Detailed software to run UnixBench (Linux)

- Let 32 Linux / CentOS system to support more than 4G memory (Linux)

- Python format string (Programming)

- How to make a U disk to install Ubuntu (Linux)

- Ubuntu 12.04 installation NVIDIA GTX750 graphics driver (Linux)

- Modern Objective-C syntax and new features (Programming)

- Java framework for parallel study - ForkJoin (Programming)

- Tune in high resolution to 1280x800 in Fedora 14 (Linux)

 
         
  CentOS How quickly customize kernel binary RPM package
     
  Add Date : 2016-10-23      
         
         
         
  As more and more Linux server, underlying kernel version you want to keep the unity we need specialized custom binary packages to manage and easy to upgrade. RedHat-based course is to use rpmbuild do custom managed.

Today we divided two parts (root and ordinary users) to explain how to make the kernel binary rpm packages.

Building the host system environment conventions:

OS: CentOS release 6.6

Arch: i686

One, rpm package simple customization

Note: Here we first have to set aside at least 20GB of space for temporary files.

1, rpm pre-production environment to prepare:

yum -y groupinstall "Development Tools"
yum -y install ncurses-devel qt-devel
yum -y install rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed xmlto
yum -y install audit-libs-devel binutils-devel elfutils-devel elfutils-libelf-devel
yum -y install newt-devel python-devel zlib-devel bc
2. Prepare the kernel source code components

cd / usr / src
wget -c https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.19.1.tar.xz
tar -Jxvf linux-3.19.1.tar.xz
ln -s linux-3.19.1 linux
cd linux
make oldconfig # verify and update the configuration .config configuration file (if you want to modify some small place on the basis of the original kernel configuration)
make menuconfig # simple graphical kernel configuration management
3. At this point, we can begin to compile a new kernel rpm package

make rpm # generated automatically rpmtree, kernel.spec file, automatically compiles, generates all rpm package components, including debug package.
This time we wait, or a cup of tea or something.

Well, we find some precompiled kernel rpm package.

cd / root / rpmbuild / RPMS / `uname -m` /
tree RPMS /
RPMS /
 i386
 kernel-3.19.1-2.i386.rpm
 kernel-devel-3.19.1-2.i386.rpm
 kernel-headers-3.19.1-2.i386.rpm
1 directory, 3 files
4, install the new kernel

rpm -Uvh kernel - * -. rpm
5, reboot, verify the kernel version

uname -a
Two, rpm package depth customization

1, we first created rpm of "production workshop" (I think this is some of the image may be more).

yum install rpmdevtools # rpm tool to quickly create a production workshop
useradd -m builder # Create a temporary user to create RPM packages, if an error occurs, the builder does not destroy the existing system environment.
su - builder
rpmdev-setuptree # Create "workshop production"
It will generate the following directory structure in the builder user's home directory:

tree -L 1 ~ / rpmbuild /
rpmbuild /
 BUILD
 RPMS
 SOURCES
 SPECS
 SRPMS
2, preparation before compiling

At this point we need to collect the package with the new kernel source package into the / home / builder / rpmbuild / SOURCES directory

su - builder
cd ~ / rpmbuild / SOURCES
wget -c https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.19.1.tar.xz
# Note: rpmbuild is done by building source packages before gzip decompression work, it is required to convert the compressed .tar.gz package format.
# Here do not record
cp / boot / config-`uname -r`. # existing kernel configuration file config-`uname -r` copied to the SOURCES directory
Switch to the SPECS directory, generate kernel.spec:

tar Jxvf ../ SOURCES / linux-3.19.1.tar.xz -C.
bash ../linux-3.19.1/scripts/package/mkspec> ./ kernel.spec
rm -rf linux-3.19.1
# Here we need to use the manual source package provides a script file generated kernel.spec
# Remember after generation after kernel.spec, clean out the linux-3.19.1 folder
vim kernel.spec # can do the depth of customization based on individual circumstances
At this point, our preparation work is substantially complete, the directory structure and contents are as follows:

tree rpmbuild / -a
rpmbuild /
 BUILD
 RPMS
 SOURCES
& Nbsp; & nbsp; config-`uname -r`
& Nbsp; & nbsp; linux-3.19.1.tar.gz
SPECS
& Nbsp; & nbsp; kernel.spec
SRPMS
5 directories, 3 files
3, well, now we start compiling the kernel binary rpm package:

rpmbuild -bb --with baseonly --without debug --without debuginfo --target = `uname -m` kernel.spec
rpmbuild parameters:

(1) --with < option> specified compile a particular kernel, alternative option has baseonly, smponly and xenonly like.

(2) --without < option> specified remove some functional modules, optional option has xen, smp, up, pae, kdump, debug and debuginfo like. Wherein, debug options eliminate kernel debugging code, debuginfo option would prohibit the establishment of kernel-debuginfo packages.

After completion, go to ~ / rpmbuild / RPMS / `uname -m` / directory Get rpm installation package.
     
         
         
         
  More:      
 
- Ubuntu 15.04 installed Nvidia Quadro series graphics driver (Linux)
- Analyzing Linux server architecture is 32-bit / 64-bit (Server)
- Boot-Repair Tool - repair of frequent start-up problems (Linux)
- How to achieve the MySQL Oracle table associated with the two operations update (Database)
- The Linux C truncate function clears the file notes (Programming)
- How to force Linux users to change the initial password the first time you log in (Linux)
- Articles do not resolve after opening under Ubuntu WordPress setting a fixed link (Server)
- Ubuntu 14.04 VirtualBox can not start solution (Linux)
- PostgreSQL with the C Completing the storage process instances (Database)
- SSH without password (Linux)
- linux firewall configuration (Linux)
- How SSHfs mount a remote file system on Linux (Linux)
- Binary search and modification (Programming)
- Linux system security configuration (Linux)
- Source encountered problems and solutions when installing SaltStack (Server)
- Linux server operating system security configuration (Linux)
- Linux awk text analysis tool (Linux)
- mysqldump issue a note (Database)
- Ubuntu 14.04 LTS next upgrade gcc to gcc-4.9, gcc-5 version (Linux)
- SecureCRT 7.0 Log Ubuntu 12.04 server via SSH service under Vmware (Server)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.