百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 技术文章 > 正文

定制centos7.7安装镜像默认内核5.5去除默认3.10内核

nanshan 2024-10-13 03:48 26 浏览 0 评论

镜像定制内容:

  • 定制镜像内容
  • 基于官方镜像minimal版定制
  • 禁用自带的 nouveau nvidia驱动(Linux安装显卡驱动免重启即时生效),为自动化部署脚本提供便携.

检查方式:

[root@localhost ~]# cat /etc/modprobe.d/blacklist.conf

blacklist nouveau

[root@localhost ~]#

  • 内置5.5.7-1.el7.elrepo.x86_64 内核,去除官方默认自带3.10.0-957.el7.x86_64内核.
  • 内置ntfs-3g插件(支持直接插ntfs格式的u盘拷贝)
  • 以内置以下常用命令/开发调试工具包

telnet,lrzsz,htop,iftop,git,vim,tree,wget,gcc-c++,openssl-devel,expect,rpm,ntpdate,nmap-ncat,net-tools,unzip,yum-utils,device-mapper-persistent-data,bash-completion,bash-completion-extras,libcurl,openssl,ncurses-devel,gcc,kernel-ml,kernel-ml-devel,kernel-ml-headers,kernel-ml-tools-libs,kernel-ml-tool,kernel-ml-tools-libs-devel

优化Centos系统

  1. 更换yum源默认为 阿里源,增加docker-ce国内源CentOS-Base.repo docker-ce.repo epel.repo
  2. /etc/rc.local默认给执行权限
  3. 优化sshd----------->>> UseDNS no
  4. 关闭firewalld防火墙
  5. 关闭Selinux开机自启
  6. 默认开启命令行tab键补齐功能
  7. 内核参数优化如下


准备环境

yum install  createrepo  genisoimage   -y

第一:准备完整的安装镜像CentOS-7,挂载到虚拟机,并同时创建一个用于编辑存放的目录centos7

	mkdir -p /home/centos7
	mount /dev/cdrom /mnt
	
	cd /mnt && ls -l

第二:复制光盘文件到可编辑目录centos7

cp -rfv /mnt/* /home/centos7	

第三:编辑bios引导文件

[root@localhost ~]# cat  /home/centos7/isolinux/isolinux.cfg
default vesamenu.c32
timeout 600

display boot.msg

# Clear the screen when exiting the menu, instead of leaving the menu displayed.
# For vesamenu, this means the graphical background is still displayed without
# the menu itself for as long as the screen remains in graphics mode.
menu clear
menu background splash.png
menu title CentOS 7
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13

# Border Area
menu color border * #00000000 #00000000 none

# Selected item
menu color sel 0 #ffffffff #00000000 none

# Title bar
menu color title 0 #ff7ba3d0 #00000000 none

# Press [Tab] message
menu color tabmsg 0 #ff3a6496 #00000000 none

# Unselected menu item
menu color unsel 0 #84b8ffff #00000000 none

# Selected hotkey
menu color hotsel 0 #84b8ffff #00000000 none

# Unselected hotkey
menu color hotkey 0 #ffffffff #00000000 none

# Help text
menu color help 0 #ffffffff #00000000 none

# A scrollbar of some type? Not sure.
menu color scrollbar 0 #ffffffff #ff355594 none

# Timeout msg
menu color timeout 0 #ffffffff #00000000 none
menu color timeout_msg 0 #ffffffff #00000000 none

# Command prompt text
menu color cmdmark 0 #84b8ffff #00000000 none
menu color cmdline 0 #ffffffff #00000000 none

# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.

menu tabmsg Press Tab for full configuration options on menu items.

menu separator # insert an empty line
menu separator # insert an empty line

label linux
  menu label ^Install CentOS 7.7 ( Kernel-5.5.7-1)
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS7 quiet

label check
  menu label Test this ^media & install CentOS 7
  menu default
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet

menu separator # insert an empty line

# utilities submenu
menu begin ^Troubleshooting
  menu title Troubleshooting

label vesa
  menu indent count 5
  menu label Install CentOS 7 in ^basic graphics mode
  text help
	Try this option out if you're having trouble installing
	CentOS 7.
  endtext
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 xdriver=vesa nomodeset quiet

label rescue
  menu indent count 5
  menu label ^Rescue a CentOS system
  text help
	If the system will not boot, this lets you access files
	and edit config files to try to get it booting again.
  endtext
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rescue quiet

label memtest
  menu label Run a ^memory test
  text help
	If your system is having issues, a problem with your
	system's memory may be the cause. Use this utility to
	see if the memory is working correctly.
  endtext
  kernel memtest

menu separator # insert an empty line

label local
  menu label Boot from ^local drive
  localboot 0xffff

menu separator # insert an empty line
menu separator # insert an empty line

label returntomain
  menu label Return to ^main menu
  menu exit

menu end
[root@localhost ~]#


第四:编辑EFI引导文件/home/centos7/EFI/BOOT/grub.cfg

[root@localhost ~]# cat /home/centos7/EFI/BOOT/grub.cfg
set default="1"

function load_video {
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
  insmod all_video
}

load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2

set timeout=60
### END /etc/grub.d/00_header ###

search --no-floppy --set=root -l 'CentOS 7 x86_64'

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install CentOS 7.7( Kernel-5.5.7-1)' --class fedora --class gnu-linux --class gnu --class os {
	linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS7 quiet
	initrdefi /images/pxeboot/initrd.img
}
}
[root@localhost ~]#


第五:编辑/home/centos7/comps.xml文件增加自定义软件/5.5内核

[root@localhost ~]# cat /home/centos7/comps.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE comps PUBLIC "-//CentOS//DTD Comps info//EN" "comps.dtd">
<comps>
  <group>
    <id>core</id>
    <name>Core</name>
    <name xml:lang="af">Kern</name>
    <name xml:lang="af_ZA">Kern</name>
    <name xml:lang="am">????? ??</name>
    <name xml:lang="ar">?????</name>
    <name xml:lang="as">??????</name>
    <name xml:lang="bal">????</name>
    <name xml:lang="be">Падмурак</name>
    <name xml:lang="bg">Основа</name>
    <name xml:lang="bn">???</name>
    <name xml:lang="bn_IN">???</name>
    <name xml:lang="bs">Jezgra</name>
    <name xml:lang="ca">Nucli</name>
    <name xml:lang="cs">úplny základ</name>
    <name xml:lang="cs_CZ">úplny základ</name>
    <name xml:lang="cy">Craidd</name>
    <name xml:lang="da">Grundl?ggende</name>
    <name xml:lang="de">Kern</name>
    <name xml:lang="de_CH">Kern</name>
    <name xml:lang="el">Πυρ?να?</name>
    <name xml:lang="en_GB">Core</name>
    <name xml:lang="es">Núcleo</name>
    <name xml:lang="es_ES">Núcleo</name>
    <name xml:lang="et">Tuum</name>
    <name xml:lang="fa">???</name>
    <name xml:lang="fa_IR">???</name>
    <name xml:lang="fi">Keskeiset</name>
    <name xml:lang="fr">Core</name>
    <name xml:lang="gl">Núcleo</name>
    <name xml:lang="gu">???</name>
    <name xml:lang="he">????</name>
    <name xml:lang="hi">???</name>
    <name xml:lang="hr">Jezgra</name>
    <name xml:lang="hr_HR">Jezgra</name>
    <name xml:lang="hu">Mag</name>
    <name xml:lang="hy">????</name>
    <name xml:lang="ia">Nucleo</name>
    <name xml:lang="id">Inti</name>
    <name xml:lang="ilo">Bugas</name>
    <name xml:lang="is">Lágmarkskerfi</name>
    <name xml:lang="it">Principale</name>
    <name xml:lang="it_IT">Principale</name>
    <name xml:lang="ja">コア</name>
    <name xml:lang="ja_JP">コア</name>
    <name xml:lang="ka">??????</name>
    <name xml:lang="kn">????????</name>
    <name xml:lang="ko">??</name>
    <name xml:lang="lv">Pamatsistēma</name>
    <name xml:lang="mai">???</name>
    <name xml:lang="mk">Основни</name>
    <name xml:lang="ml">?????</name>
    <name xml:lang="mr">???</name>
    <name xml:lang="ms">Teras</name>
    <name xml:lang="ms_MY">Teras</name>
    <name xml:lang="nb">Kjerne</name>
    <name xml:lang="ne">???</name>
    <name xml:lang="nl">Kern</name>
    <name xml:lang="no">Kjerne</name>
    <name xml:lang="nso">Bogare</name>
    <name xml:lang="or">??????</name>
    <name xml:lang="pa">???</name>
    <name xml:lang="pl">Rdzeń</name>
    <name xml:lang="pt">Núcleo</name>
    <name xml:lang="pt_BR">Núcleo</name>
    <name xml:lang="ro">Nucleu</name>
    <name xml:lang="ru">Основа</name>
    <name xml:lang="ru_RU">Основа</name>
    <name xml:lang="si">?????????</name>
    <name xml:lang="sk">Jadro</name>
    <name xml:lang="sl">Jedro</name>
    <name xml:lang="sq">B?rthama</name>
    <name xml:lang="sr">Срж</name>
    <name xml:lang="sr@latin">Sr?</name>
    <name xml:lang="sr@Latn">Sr?</name>
    <name xml:lang="sv">Grund</name>
    <name xml:lang="ta">????</name>
    <name xml:lang="ta_IN">????</name>
    <name xml:lang="te">?????????</name>
    <name xml:lang="tg">Система</name>
    <name xml:lang="th">???????</name>
    <name xml:lang="tr">?ekirdek</name>
    <name xml:lang="uk">Основа</name>
    <name xml:lang="uk_UA">Основа</name>
    <name xml:lang="ur">????</name>
    <name xml:lang="vi">L?i</name>
    <name xml:lang="zh">核心</name>
    <name xml:lang="zh_CN">核心</name>
    <name xml:lang="zh_TW">核心</name>
    <name xml:lang="zu">Okuyikhona</name>
    <description>Smallest possible installation.</description>
    <description xml:lang="as">??????? ???????</description>
    <description xml:lang="bn">??????? ??????????</description>
    <description xml:lang="bn_IN">??????? ??????????</description>
    <description xml:lang="cs">Nejmen?í mo?ná instalace.</description>
    <description xml:lang="cs_CZ">Nejmen?í mo?ná instalace.</description>
    <description xml:lang="de">Kleinstm?gliche Installation.</description>
    <description xml:lang="de_CH">Kleinstm?gliche Installation.</description>
    <description xml:lang="es">La instalación más peque?a posible.</description>
    <description xml:lang="es_ES">La instalación más peque?a posible.</description>
    <description xml:lang="fr">Plus petite installation possible.</description>
    <description xml:lang="gu">??????? ???? ???? ??????.</description>
    <description xml:lang="hi">????? ??????? ????????.</description>
    <description xml:lang="ia">Le minime possibile installation.</description>
    <description xml:lang="it">Minima installazione possibile.</description>
    <description xml:lang="it_IT">Minima installazione possibile.</description>
    <description xml:lang="ja">最小限のインストール</description>
    <description xml:lang="ja_JP">最小限のインストール</description>
    <description xml:lang="kn">???????????? ??????????.</description>
    <description xml:lang="ko">??? ?? ??</description>
    <description xml:lang="ml">???????? ??????? ????? ???????????????.</description>
    <description xml:lang="mr">??????? ?????? ???? ???????????.</description>
    <description xml:lang="or">????????? ???????? ????????</description>
    <description xml:lang="pa">????-??? ???? ??????????</description>
    <description xml:lang="pl">Najmniejsza mo?liwa instalacja.</description>
    <description xml:lang="pt_BR">Menor instala??o possível</description>
    <description xml:lang="ru">Минимально возможная установка</description>
    <description xml:lang="ru_RU">Минимально возможная установка</description>
    <description xml:lang="sv">Minsta m?jliga installation</description>
    <description xml:lang="ta">????? ????? ?????????????????? ???????.</description>
    <description xml:lang="ta_IN">????? ????? ?????????????????? ???????.</description>
    <description xml:lang="te">???????? ???????? ????????.</description>
    <description xml:lang="uk">М?н?мально можливе встановлення.</description>
    <description xml:lang="uk_UA">М?н?мально можливе встановлення.</description>
    <description xml:lang="zh">最小型安裝。</description>
    <description xml:lang="zh_CN">最小可能安装。</description>
    <description xml:lang="zh_TW">最小型安裝。</description>
    <default>false</default>
    <uservisible>false</uservisible>
    <packagelist>
      <packagereq type="mandatory">audit</packagereq>
      <packagereq type="mandatory">basesystem</packagereq>
      <packagereq type="mandatory">bash</packagereq>
      <packagereq type="mandatory">btrfs-progs</packagereq>
      <packagereq type="mandatory">coreutils</packagereq>
      <packagereq type="mandatory">cronie</packagereq>
      <packagereq type="mandatory">curl</packagereq>
      <packagereq type="mandatory">dhclient</packagereq>
      <packagereq type="mandatory">e2fsprogs</packagereq>
      <packagereq type="mandatory">filesystem</packagereq>
      <packagereq type="mandatory">firewalld</packagereq>
      <packagereq type="mandatory">glibc</packagereq>
      <packagereq type="mandatory">hostname</packagereq>
      <packagereq type="mandatory">initscripts</packagereq>
      <packagereq type="mandatory">iproute</packagereq>
      <packagereq type="mandatory">iprutils</packagereq>
      <packagereq type="mandatory">iptables</packagereq>
      <packagereq type="mandatory">iputils</packagereq>
      <packagereq type="mandatory">irqbalance</packagereq>
      <packagereq type="mandatory">kbd</packagereq>
      <packagereq type="mandatory">kexec-tools</packagereq>
      <packagereq type="mandatory">less</packagereq>
      <packagereq type="mandatory">man-db</packagereq>
      <packagereq type="mandatory">ncurses</packagereq>
      <packagereq type="mandatory">openssh-clients</packagereq>
      <packagereq type="mandatory">openssh-server</packagereq>
      <packagereq type="mandatory">parted</packagereq>
      <packagereq type="mandatory">passwd</packagereq>
      <packagereq type="mandatory">plymouth</packagereq>
      <packagereq type="mandatory">policycoreutils</packagereq>
      <packagereq type="mandatory">procps-ng</packagereq>
      <packagereq type="mandatory">rootfiles</packagereq>
      <packagereq type="mandatory">rpm</packagereq>
      <packagereq type="mandatory">rsyslog</packagereq>
      <packagereq type="mandatory">selinux-policy-targeted</packagereq>
      <packagereq type="mandatory">setup</packagereq>
      <packagereq type="mandatory">shadow-utils</packagereq>
      <packagereq type="mandatory">sudo</packagereq>
      <packagereq type="mandatory">systemd</packagereq>
      <packagereq type="mandatory">tar</packagereq>
      <packagereq type="mandatory">tuned</packagereq>
      <packagereq type="mandatory">util-linux</packagereq>
      <packagereq type="mandatory">vim-minimal</packagereq>
      <packagereq type="mandatory">xfsprogs</packagereq>
      <packagereq type="mandatory">yum</packagereq>
      <packagereq type="default">aic94xx-firmware</packagereq>
      <packagereq type="default">alsa-firmware</packagereq>
      <packagereq type="default">biosdevname</packagereq>
      <packagereq type="default">dracut-config-rescue</packagereq>
      <packagereq type="default">ivtv-firmware</packagereq>
      <packagereq type="default">iwl100-firmware</packagereq>
      <packagereq type="default">iwl1000-firmware</packagereq>
      <packagereq type="default">iwl105-firmware</packagereq>
      <packagereq type="default">iwl135-firmware</packagereq>
      <packagereq type="default">iwl2000-firmware</packagereq>
      <packagereq type="default">iwl2030-firmware</packagereq>
      <packagereq type="default">iwl3160-firmware</packagereq>
      <packagereq type="default">iwl3945-firmware</packagereq>
      <packagereq type="default">iwl4965-firmware</packagereq>
      <packagereq type="default">iwl5000-firmware</packagereq>
      <packagereq type="default">iwl5150-firmware</packagereq>
      <packagereq type="default">iwl6000-firmware</packagereq>
      <packagereq type="default">iwl6000g2a-firmware</packagereq>
      <packagereq type="default">kernel-tools</packagereq>
      <packagereq type="default">iwl6000g2b-firmware</packagereq>
      <packagereq type="default">iwl6050-firmware</packagereq>
      <packagereq type="default">iwl7260-firmware</packagereq>
      <packagereq type="default">iwl7265-firmware</packagereq>
      <packagereq type="default">libsysfs</packagereq>
      <packagereq type="default">linux-firmware</packagereq>
      <packagereq type="default">lshw</packagereq>
      <packagereq type="default">microcode_ctl</packagereq>
      <packagereq type="default">NetworkManager</packagereq>
      <packagereq type="default">NetworkManager-team</packagereq>
      <packagereq type="default">NetworkManager-tui</packagereq>
      <packagereq type="default">postfix</packagereq>
      <packagereq type="default">sg3_utils</packagereq>
      <packagereq type="default">sg3_utils-libs</packagereq>
      <packagereq type="optional">dracut-config-generic</packagereq>
      <packagereq type="optional">dracut-fips</packagereq>
      <packagereq type="optional">dracut-fips-aesni</packagereq>
      <packagereq type="optional">dracut-network</packagereq>
      <packagereq type="optional">initial-setup</packagereq>
      <packagereq type="optional">openssh-keycat</packagereq>
      <packagereq type="optional">rdma-core</packagereq>
      <packagereq type="optional">selinux-policy-mls</packagereq>
      <packagereq type="optional">tboot</packagereq>
      <packagereq type="mandatory">lrzsz</packagereq>
      <packagereq type="mandatory">tree</packagereq>
      <packagereq type="mandatory">wget</packagereq>
      <packagereq type="mandatory">gcc-c++</packagereq>
      <packagereq type="mandatory">openssl-devel</packagereq>
      <packagereq type="mandatory">expect</packagereq>
      <packagereq type="mandatory">rpm</packagereq>
      <packagereq type="mandatory">ntpdate</packagereq>
      <packagereq type="mandatory">nmap-ncat</packagereq>
      <packagereq type="mandatory">net-tools</packagereq>
      <packagereq type="mandatory">ntfs-3g</packagereq>
      <packagereq type="mandatory">telnet</packagereq>
      <packagereq type="mandatory">ntfs-3g</packagereq>
      <packagereq type="mandatory">iotop</packagereq>
      <packagereq type="mandatory">yum-utils</packagereq>
      <packagereq type="mandatory">device-mapper-persistent-data</packagereq>
      <packagereq type="mandatory">bash-completion</packagereq>
      <packagereq type="mandatory">bash-completion-extras</packagereq>
      <packagereq type="mandatory">kernel-ml-devel</packagereq>
      <packagereq type="mandatory">kernel-ml</packagereq>
      <packagereq type="mandatory">kernel-ml-headers</packagereq>
      <packagereq type="mandatory">libcurl</packagereq>
      <packagereq type="mandatory">openssl</packagereq>
      <packagereq type="mandatory">unzip</packagereq>
      <packagereq type="mandatory">ncurses-devel</packagereq>
      <packagereq type="mandatory">htop</packagereq>
      <packagereq type="mandatory">pbzip2</packagereq>
      <packagereq type="mandatory">hdparm</packagereq>
      <packagereq type="mandatory">dmidecode</packagereq>
      <packagereq type="mandatory">pciutils</packagereq>
      <packagereq type="mandatory">iftop</packagereq>
      <packagereq type="mandatory">git</packagereq>
      <packagereq type="mandatory">centos7init</packagereq>
    </packagelist>
  </group>
<environment>
    <id>minimal</id>
    <name>Minimal Install</name>
    <name xml:lang="as">??????? ??????</name>
    <name xml:lang="cs">Minimální instalace</name>
    <name xml:lang="cs_CZ">Minimální instalace</name>
    <name xml:lang="de">Minimale Installation</name>
    <name xml:lang="de_CH">Minimale Installation</name>
    <name xml:lang="es">Instalación mínima</name>
    <name xml:lang="es_ES">Instalación mínima</name>
    <name xml:lang="fr">Installation minimale</name>
    <name xml:lang="gu">??????? ??????</name>
    <name xml:lang="hi">??????? ????????</name>
    <name xml:lang="it">Installazione minima</name>
    <name xml:lang="it_IT">Installazione minima</name>
    <name xml:lang="ja">最小限のインストール</name>
    <name xml:lang="ja_JP">最小限のインストール</name>
    <name xml:lang="kn">?????? ??????????</name>
    <name xml:lang="ko">?? ??</name>
    <name xml:lang="ml">??????? ?????? ?????????????</name>
    <name xml:lang="mr">????? ???????</name>
    <name xml:lang="or">????????? ??????</name>
    <name xml:lang="pa">??? ??? ??? ??????</name>
    <name xml:lang="pl">Minimalna instalacja</name>
    <name xml:lang="pt">Instala??es Mínimas</name>
    <name xml:lang="pt_BR">Instala??es Mínimas</name>
    <name xml:lang="ru">Минимальная установка</name>
    <name xml:lang="ru_RU">Минимальная установка</name>
    <name xml:lang="ta">??????????? ???????</name>
    <name xml:lang="ta_IN">??????????? ???????</name>
    <name xml:lang="te">?????? ????????</name>
    <name xml:lang="uk">М?н?мальна система</name>
    <name xml:lang="uk_UA">М?н?мальна система</name>
    <name xml:lang="zh">最小型安裝</name>
    <name xml:lang="zh_CN">最小安装</name>
    <name xml:lang="zh_TW">最小型安裝</name>
    <description>Basic functionality.</description>
    <description xml:lang="as">???? ?????????????</description>
    <description xml:lang="cs">Základní funkcionalita.</description>
    <description xml:lang="cs_CZ">Základní funkcionalita.</description>
    <description xml:lang="de">Grundlegende Funktionalit?t.</description>
    <description xml:lang="de_CH">Grundlegende Funktionalit?t.</description>
    <description xml:lang="es">Funcionalidad básica.</description>
    <description xml:lang="es_ES">Funcionalidad básica.</description>
    <description xml:lang="fr">Fonctionnalité de base.</description>
    <description xml:lang="gu">?????? ?????.</description>
    <description xml:lang="hi">????? ???????????????.</description>
    <description xml:lang="it">Funzione di base.</description>
    <description xml:lang="it_IT">Funzione di base.</description>
    <description xml:lang="ja">基本的な機能です。</description>
    <description xml:lang="ja_JP">基本的な機能です。</description>
    <description xml:lang="kn">?????? ???????????.</description>
    <description xml:lang="ko">???? ?????.</description>
    <description xml:lang="ml">???????? ????????????????.</description>
    <description xml:lang="mr">??? ???????????.</description>
    <description xml:lang="or">?????? ??????????????</description>
    <description xml:lang="pa">?????? ??????????</description>
    <description xml:lang="pl">Podstawowa funkcjonalno??.</description>
    <description xml:lang="pt">Fun??o básica</description>
    <description xml:lang="pt_BR">Fun??o básica</description>
    <description xml:lang="ru">Базовая функциональность.</description>
    <description xml:lang="ru_RU">Базовая функциональность.</description>
    <description xml:lang="ta">???????? ?????????.</description>
    <description xml:lang="ta_IN">???????? ?????????.</description>
    <description xml:lang="te">???????? ???????????.</description>
    <description xml:lang="uk">Основн? можливост?.</description>
    <description xml:lang="uk_UA">Основн? можливост?.</description>
    <description xml:lang="zh">基本功能。</description>
    <description xml:lang="zh_CN">基本功能。</description>
    <description xml:lang="zh_TW">基本功能。</description>
    <display_order>5</display_order>
    <grouplist>
      <groupid>core</groupid>
      <groupid>core</groupid>
    </grouplist>
    <optionlist>
      <groupid>debugging</groupid>
      <groupid>debugging</groupid>
    </optionlist>
  </environment>
  <environment>
</comps>

[root@localhost ~]#


第六:把准备好的 rpm包拷贝到/home/centos7/Packages/

提取rpm包不下载用以下命令

yum install --downloadonly    wget
find  /var/cache/  -name  "*.rpm"  -exec  \cp -av  {}  /root/kernel-5.5/  \;

\cp -rav /root/kernel-5.5/*  /home/centos7/Packages/



[root@localhost ~]# ls /root/kernel-5.5/*
/root/kernel-5.5/kernel-ml-5.5.7-1.el7.elrepo.x86_64.rpm
/root/kernel-5.5/kernel-ml-devel-5.5.7-1.el7.elrepo.x86_64.rpm
/root/kernel-5.5/kernel-ml-doc-5.5.7-1.el7.elrepo.noarch.rpm
/root/kernel-5.5/kernel-ml-headers-5.5.7-1.el7.elrepo.x86_64.rpm
/root/kernel-5.5/kernel-ml-tools-5.5.7-1.el7.elrepo.x86_64.rpm
/root/kernel-5.5/kernel-ml-tools-libs-5.5.7-1.el7.elrepo.x86_64.rpm
/root/kernel-5.5/kernel-ml-tools-libs-devel-5.5.7-1.el7.elrepo.x86_64.rpm
/root/kernel-5.5/perf-5.5.7-1.el7.elrepo.x86_64.rpm
/root/kernel-5.5/perl-5.16.3-294.el7_6.x86_64.rpm
/root/kernel-5.5/perl-Carp-1.26-244.el7.noarch.rpm
/root/kernel-5.5/perl-constant-1.27-2.el7.noarch.rpm
/root/kernel-5.5/perl-Data-Dumper-2.145-3.el7.x86_64.rpm
/root/kernel-5.5/perl-Encode-2.51-7.el7.x86_64.rpm
/root/kernel-5.5/perl-Exporter-5.68-3.el7.noarch.rpm
/root/kernel-5.5/perl-File-Path-2.09-2.el7.noarch.rpm
/root/kernel-5.5/perl-File-Temp-0.23.01-3.el7.noarch.rpm
/root/kernel-5.5/perl-Filter-1.49-3.el7.x86_64.rpm
/root/kernel-5.5/perl-Getopt-Long-2.40-3.el7.noarch.rpm
/root/kernel-5.5/perl-HTTP-Tiny-0.033-3.el7.noarch.rpm
/root/kernel-5.5/perl-libs-5.16.3-294.el7_6.x86_64.rpm
/root/kernel-5.5/perl-macros-5.16.3-294.el7_6.x86_64.rpm
/root/kernel-5.5/perl-parent-0.225-244.el7.noarch.rpm
/root/kernel-5.5/perl-PathTools-3.40-5.el7.x86_64.rpm
/root/kernel-5.5/perl-Pod-Escapes-1.04-294.el7_6.noarch.rpm
/root/kernel-5.5/perl-podlators-2.5.1-3.el7.noarch.rpm
/root/kernel-5.5/perl-Pod-Perldoc-3.20-4.el7.noarch.rpm
/root/kernel-5.5/perl-Pod-Simple-3.28-4.el7.noarch.rpm
/root/kernel-5.5/perl-Pod-Usage-1.63-3.el7.noarch.rpm
/root/kernel-5.5/perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm
/root/kernel-5.5/perl-Socket-2.010-4.el7.x86_64.rpm
/root/kernel-5.5/perl-Storable-2.45-3.el7.x86_64.rpm
/root/kernel-5.5/perl-Text-ParseWords-3.29-4.el7.noarch.rpm
/root/kernel-5.5/perl-threads-1.87-4.el7.x86_64.rpm
/root/kernel-5.5/perl-threads-shared-1.43-6.el7.x86_64.rpm
/root/kernel-5.5/perl-Time-HiRes-1.9725-3.el7.x86_64.rpm
/root/kernel-5.5/perl-Time-Local-1.2300-2.el7.noarch.rpm
/root/kernel-5.5/python-perf-5.5.7-1.el7.elrepo.x86_64.rpm
[root@localhost ~]#


第六:生成iso镜像,在当前目录下

cd /home/centos7/
createrepo  -g  comps.xml   ./
genisoimage -joliet-long -V CentOS7 -o CentOS-7.7-kernel-5.5.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -cache-inodes -T -eltorito-alt-boot -e images/efiboot.img -no-emul-boot /home/centos7


效果



相关推荐

Linux 的磁盘系统,和你了解的Windows差别很大

我的C盘去哪了?一个系统,如果没有存储,那么也就不能称之为系统。存储性是一个完整系统的重要组成部分。例如AWS最开始的服务就是S3(用来存储数据的云服务),足以见得存储对于一个应用平台是多么的重要。...

一文读懂 Linux 硬盘挂载:从问题到解决方案

各位互联网大厂的后端开发伙伴们!在咱们日常工作中,操作Linux系统是常有的事儿吧。你们有没有遇到过这样的场景:新添加了一块硬盘,满心欢喜准备用来存储重要数据或者部署新的应用服务,却突然发现不知道...

硬盘分区(硬盘分区格式)

 磁盘(硬盘)分区,可以分C、D、E等分区,大家可能都会用,会根据自已的需要确定所需的空间,但分区是如何工作的呢,内容如下。Windows中有3类:MBR分区:MasterBootRecord,也...

parted命令工具分区介绍(particle命令)

linux系统磁盘分区通常可以使用fdisk和parted命令,当分区大小小于2TB的时候,两种皆可以使用,当分区大于2TB的话,就需要用parted分区。以下介绍parted命令相关使用,以sdb为...

Linux 服务器上查看磁盘类型的方法

方法1:使用lsblk命令lsblk输出说明:TYPE列显示设备类型,如disk(物理磁盘)、part(分区)、rom(只读存储)等。NAME列显示设备名称(如sda、nvme0n1)。TR...

Linux分区命令fdisk和parted使用介绍

摘要:一般情况下,Linux分区都是选择fdisk工具,要求硬盘格式为MBR格式,能支持的最大分区空间为2T。但是目前在实际生产环境中使用的磁盘空间越来越大,呈TB级别增长;而常用的fdisk这个工具...

linux 分区原理与名词解释(linux操作系统中的分区类型)

分区的意义将磁盘分成几份,每份挂在到文件系统的那个目录在linux里的文件系统Ext2:早期的格式,不支持日志功能Ext3:ext2改良版,增加了日志功能,是最基本且最常用的使用格式了Ext4:针对e...

linux 分区合并(linux合理分区)

查看虚拟机当前磁盘挂载情况fdisk-l选择磁盘fdisk/dev/sda查看磁盘分区情况p重新选择分区n选择主分区p保存w创建物理卷pvcreate/dev/sda3查看物理卷信息pvdi...

如何在 Linux 系统中永久禁用交换分区 ?

Linux操作系统中的交换分区或交换文件充当硬盘上的临时存储区域,当物理内存(RAM)满时,系统使用该存储区域。它用于交换较少使用的内存页,这样系统就不会因为运行应用程序而耗尽物理内存。随着技术的发...

Linux 如何知道硬盘已用多少空间、未用多少空间

刚出社会时,去了一家公司上班,老板为了省钱,买的服务器是低配的,硬盘大小只有40G,有一次网站突然不能访问了,排查半天才知道原来服务器的硬盘空间已用完,已无可用空间。第一步是查看硬盘的使用情况,第二步...

用Linux系统管理磁盘空间 就该这么来

要想充分有效的管理使用Linux系统中的存储空间,用户必须要做的就是双管齐下,一边扩充空间一边限制空间。不得不说的就是很多时候磁盘空间就像水资源,需节制水流。说到要如何实现限制空间就离不开使用LVM技...

Windows 11 磁盘怎么分区?(windows11磁盘怎么分区)

Windows11磁盘分区技术解析与操作指南:构建高效存储体系一、磁盘分区的技术本质与系统价值磁盘分区作为存储系统的基础架构,通过逻辑划分实现数据隔离与管理优化。Windows11采用NTF...

linux上创建多个文件分区,格式化为 ext2、ext3、ext4、XFS 文件

以下是在Linux系统上创建多个20GB文件分区并格式化为不同文件系统的分步指南:步骤1:创建基础文件(4个20GB文件)bash#创建4个20GB稀疏文件(实际占用空间随写入量增长)ddif=/...

救命的U盘低格哪家最强?(低格优盘)

周二时有位童鞋留言说U盘之前做过引导盘,现在格式化不了,用各种工具都不行,而且因为U盘厂商的关系,查不到U盘主控,无法量产恢复,特来求助。小编花了点时间特意弄坏一个U盘分区,终于试出方法了,特来分享一...

Linux 查看硬件磁盘存储大小和磁盘阵列(RAID)的组合方式

一、查看硬件磁盘存储大小查看所有磁盘信息:#lsblk该命令会列出所有磁盘(如/dev/sda、/dev/nvme0n1)及其分区和挂载点。查看磁盘总容量:fdisk-l#或parted-...

取消回复欢迎 发表评论: