Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ CentOS How quickly customize kernel binary RPM package     - ntop monitoring software configuration and installation (Linux)

- CentOS yum source deployment (Linux)

- Let Mac OS X dedicated high-speed mobile hard disk can also be read in Linux (Linux)

- How to install and use the Snort in Ubuntu 15.04 (Linux)

- Category prevent DoS attacks against Linux (Linux)

- Large computer network security policy Experience (Linux)

- Import and export myloader accelerate mydumper (Database)

- CentOS and RHEL installation under GAMIT10.6 (Linux)

- Oracle restrict certain IP, the malicious user actions on important table (Database)

- Make command Detailed Tutorial (Programming)

- Depth understanding of C language (Programming)

- Ubuntu clean up unnecessary disk space usage (Linux)

- Thrift 0.9.3 compiler installation under Ubuntu (Linux)

- shell script: MySQL startup script simple (Database)

- AngularJS (Programming)

- Linux common network tools: traceroute routing of scanned (Linux)

- Linux initialization init systems - Systemd (Linux)

- C language preprocessor command (Programming)

- Report generation CPU, memory, and input and output ports with the sar command (Linux)

- Intrusion analysis and prevention tools Knark under Linux platform (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:      
 
- Commonly used Linux system camouflage method (Linux)
- MySQL primary and secondary replicate data inconsistencies (Database)
- Ubuntu 14.04 VirtualBox can not start solution (Linux)
- Based on a complete solution RMI service to transfer large files (Programming)
- Installation Mesos + Marathon + Zookeeper under CentOS 7 (Server)
- Windows 7 hard disk to install Ubuntu 15.04 (Linux)
- Repair Raspbian Encountered a section with no Package (Linux)
- Spring Data MongoDB combat (Database)
- Java String and StringBuffer and StringBuilder Comments (Programming)
- Redis is installed and set up Ubuntu 14.04 from the environment under the main ssdb (Server)
- Expand an existing RAID arrays and remove the failed disk in a RAID (Linux)
- MySQL import large amounts of data (Database)
- Depth understanding of JavaScript new mechanism (Programming)
- Nine trick to let you speed up the old machine running Ubuntu Linux (Linux)
- Python format string (Programming)
- Use HttpClient remote interface testing (Programming)
- To install and configure the Jetty server and JDK under Ubuntu 14.04.2 (Server)
- Ubuntu derivative version of the user and how to install SmartGit / HG 6.0.0 (Linux)
- GNU / Linux system, how to clean up memory space (Linux)
- Elixir: the future of programming languages (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.