首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我正在尝试创建自定义的centos 7 ISO,但是在我的ISO软件选择列表中是空的

我正在尝试创建自定义的centos 7 ISO,但是在我的ISO软件选择列表中是空的
EN

Server Fault用户
提问于 2018-01-16 06:24:04
回答 1查看 3.6K关注 0票数 0

我试图创建自定义Centos 7。我能够创建启动ISO,但安装时,在安装摘要页软件选择列表是空的。步骤:-

  1. 下载centos7 ISO。
  2. 在文件夹中提取ISO。
  3. 添加了ks.cfg文件。
  4. 运行createrepo命令。
  5. 运行mkiso命令。

(有关详细步骤,请参见以下链接:-我使用以下链接:- 如何在CentOS中创建自定义ISO映像 )

截图:-

EN

回答 1

Server Fault用户

发布于 2018-08-10 12:02:44

我得到了答案。

你需要考虑以下几点。

1)comps.xml。

2)createrepo命令。

3)ks.cfg文件

4)isolinux.cfg

1)更新comps.xml并重新分配rpms的所有依赖项。在comps.xml组中添加rpm名称。将您的ks.cfg文件保存在iso解压缩文件夹之外。

代码语言:javascript
复制
    <comps>
      <group>
         <id>core</id>
         <name>Core</name>
         <description>Smallest possible installation.</description>
         <default>false</default>
         <uservisible>false</uservisible>
         <packagelist>
            <packagereq type="mandatory">basesystem</packagereq>
            <packagereq type="mandatory">centos-logos</packagereq>
            <packagereq type="mandatory">bash</packagereq>
            .........
            <packagereq type="mandatory">[CUSTOM_PACKAGE_NAME]</packagereq>
         </packagelist>
      <group>
    <comps>

2)配置ks.cfg文件。创建ks.cfg文件并保存在isolinux/ks/ks.cfg位置上

代码语言:javascript
复制
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard 'us'
# Root password
#rootpw myPassword 
# System language
lang en_US
# Firewall configuration
firewall --disabled
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use CDROM installation media
cdrom
# Use text mode install(for graphical setup comment or remove below text word)
text
#cmdline
# SELinux configuration
#selinux --enforcing
selinux --disabled
# Do not configure the X Window System
skipx

# Network information
network  --bootproto=dhcp --device=dhcp
# Reboot after installation
reboot
# System timezone
timezone Asia/Kolkata
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
part /boot --fstype xfs --size=256
part swap --fstype swap --size=1024
part / --fstype xfs --grow --size=4000
reboot --eject
%packages
#below package name is you mention in comps.xml
@core
@core
%end
%post
mkdir /root/test/
%end

3)isolinux.cfg文件存在于isolinux文件夹中。

。您可以看到下面的代码

代码语言:javascript
复制
label linux
  menu label ^Install CentOS 7
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet

以上代码执行默认的ks.cfg文件。用下面的代码替换以配置自定义ks文件

代码语言:javascript
复制
label linux
  menu label ^Install CentOS 7
  kernel vmlinuz
  append initrd=initrd.img inst.ks=hd:LABEL=CentOS\x207\x20x86_64:/ks/ks-noraid.cfg inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet

4)创建回购命令。打开iso文件夹并执行以下命令。

代码语言:javascript
复制
createreop -g ../comps.xml

执行下面的命令来创建iso

代码语言:javascript
复制
mkisofs -o /root/centos7_test.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "CentOS 7 x86_64" -R -J -v -T isolinux/. .
票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/892372

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档