In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces DIY how to make CentOS ISO, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Centos6.3 official DVD package is too large, which integrates a large number of software, but many of them are not used in the production environment, redundant installation will only cause a waste of resources, this document mainly introduces a basic method of system customization, and specifically points out some serious problems that will occur in system customization, if these problems are not paid attention to, it is likely to be wasted in many cases.
Customization based on centos6.3, you can integrate the lnmp environment, and some system monitoring software, the previous installation system plus lnmp environment are installed with installation scripts, source code installation takes too long, especially php compilation time is too long, so when customizing the system, you need to make some source software packages into rpm packages, so the production process of rpm package will be introduced at the beginning of the document.
1. Overview and use of RPM
1) RPM package management tool (RPM, full name The RPM Package Manager) is a widely used software package manager under Linux. Originally developed by Red Hat, it is now also developed by the open source community. RPM is usually shipped with Linux distributions, but there are also separate distributions of RPM as applications. RPM is only suitable for installing software packaged with RPM. It is currently the type of software package with the most abundant package resources under GNU/Linux.
Xxx-version.rpm-redhat suse....
Xxx-veriosn.deb-debian/ubuntu
2) specific purpose of RPM package management
1. Quickly install, remove, upgrade and manage software, and also support online installation and upgrade of software
2. Through RPM package management, you can know which files the package contains, and you can also know which package a file in the system belongs to.
3. You can query whether the software package in the system is installed and its version
4. As a developer, you can package and release your program as a RPM package to reduce the time it takes to configure and compile the software before installation.
5. Software package signature GPG and MD5 are imported, verified and signed to prevent software from being tampered with.
6. Check for dependencies to see if any software packages disrupt the system due to incompatibility
3) what should be paid attention to in RPM packaging
In order to make your own rpm package can be used in other systems, it is necessary to have a consistent system environment. Of course, the software you packaged on centos6.3 can also be installed and used normally on centos6.4 in some cases, but this is not recommended. Packaging host system consistency is the basic condition for rpm installation. In addition, the most difficult thing for rpm package to solve is the dependency problem, yes. Rpm packages can be installed through yum and automatically check for dependencies, but there is a problem, for example, when you package nginx, you rely on the gd library, and when you package it, you install a gd package through a network yum source, but when the host system is installed, there may be no network, but there is a gd package in the CD, maybe you can install the GD library through the shutdown. But you can't guarantee that the version of the GD library will be the same as when you packaged nginx. Generally speaking, most of the gd library in the CD is lower than the version of the network Yum source, so it can not guarantee the normal use of nginx, because we do not know what the upgrade of the gd library has upgraded. Our solution is to write down what packages he needs to rely on when packing, and download these packages. Install these packages on the host system, and of course the packages themselves have dependencies. So you have to find all the dependencies layer by layer and install them accordingly.
2. The process of making rpm package
1. Installation tool
Yum-y install rpm-build
two。 Create a directory
3. Introduction to packaged catalogue
BUILD-- source code decompression directory
RPMS--RPM package (finished product)
Directory of SOURCES-- source code (tar.gz)
SPECS--xx.spec (makefile)
SRPMS--src.rpm=xx.spec+tar.gz (we don't use it)
BUILDROOT-rpm package installation temporary directory, rpm packaging process is equivalent to installation, but the installation path will be in this directory, not to the system directory.
4. Spec file instance
Mkdir-p $HOME/rpmbuild/ {BUILD,RPMS,SOURCES,SPECS,SRPMS,BUILDROOT}
Although it is not recommended to use root users to package rpm packages in many documents, we still use root accounts for convenience. As long as we pay attention to it when packing, there will be no problems.
5. Start packing.
Execute rpmbuild-bb nginx.spec in the SPECS directory, and make a note of the packages that are prompted by the installation process. This command compiles the software as specified by our spec and generates the corresponding rpm package in the / root/rpmbuild/RPMS/x86_64/ directory. By default, this rpm package records which other software will be relied on during the software compilation process. Again, if the environment when you package is different from that when you install it, be sure to install the dependencies manually before installing rpm. Resolve possible issues where the version is too low.
6. Start customizing iso
1) download a complete centos CD on the centos website and mount it to the / mnt directory on the virtual machine
Mount-o loop / dev/cdrom / mnt
2). Copy CD file to custom iso directory. This copy is mainly due to the unwritable problem of CD mount directory, so it must be copied out.
Mkdir / iso
Cp / mnt/* / iso
The above copy does not copy hidden files by default, so there are two hidden files in the root directory of the shutdown, so you must copy them manually, not to mention here.
3) create a directory of your own software
Mkdir / iso/lnmp
Cp / root/rpmbuild/RPMS/x86_64/* / iso/lnmp
4) modify the files in the / iso/isolinux/ directory
Notice that we refer to a file of * .cfg, which is the key to our customization of the system.
This file will exist in the form of an attachment!
5) packing for the first time
Cd / iso
Mkisofs-o gzyouai_centos_6.4.iso-b isolinux/isolinux.bin-c isolinux/boot.cat-no-emul-boot-boot-load-size 4-boot-info-table-R-J-v-T. /
6) install the first packaging system
7) record the install.log file of the installed system
There are what software is installed in this installation, the contents need to be manually added. Rpm suffix, and there are some special lines need to be deleted, copy this file to the packaging system, find a way to kick out the useless package in / iso/Packages/! Delete the useless software package.
Cd / iso/Packages/
Createrepo. /
Follow step 5 to repackage and install. So that the system will not be so bloated.
Thank you for reading this article carefully. I hope the article "how to make CentOS ISO in DIY" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.