CentOS 7 ISO Kickstart 安装 - “Pane is dead”

Tre*_*nin 4 linux iso kickstart centos7

编辑:我一般地重试了这个,并看到了同样的问题。要重现,请按照以下步骤操作。我开始认为这可能是硬件问题,但我不确定。

使用 kickstart 安装 CentOS 7 ISO 时,我收到一条错误消息,提示“Pane is dead”且没有其他日志。基本上,我使用 CentOS 7 ISO 并添加了一个 kickstart 文件。在 VirtualBox 上安装时,一切正常。当我尝试在具有多个接口的真实硬件上安装它时,在安装所有软件包后出现“Pane is dead”错误。

在此处输入图片说明

我不知道可能是什么问题。我尝试过的一些事情:

  • 没有生成指示问题的日志。我什logging --level=debug至在kickstart 中添加了这条线,但没有任何价值可看。
  • 没有安装后步骤(我从 ks 中删除了它,因为这是出现问题之前的最后一个日志),所以这不是问题。
  • 我确实在网络上的某个地方看到有人说 CentOS 6 和 7 ISO 之间存在差异,但是没有额外的信息来定量指出这些差异可能是什么。

以下是有关如何复制的完整说明。如果您能看到我做错了什么,我将不胜感激。

谢谢!

如何复制的完整说明

我的生产机器是最新的 CentOS 7 服务器。如果您缺少任何应用程序,我相信您可以使用 yum 轻松安装它们。

基本步骤是:

  • 创建工作目录
  • 创建一个 kickstart 文件
  • 更新isolinux.cfg
  • 下载包
  • 创建存储库
  • 创建 ISO

创建工作目录

我将 CentOS 7 ISO 复制到我的临时目录并挂载它以获取所有文件:

>cd /tmp
>wget http://centos.mirror.iweb.ca/7/isos/x86_64/CentOS-7-x86_64-DVD-1503-01.iso
... hours later ...
>mkdir CentOS7-CD
>sudo mount -l /tmp/CentOS-7-x86_64-DVD-1503-01.iso /tmp/CentOS7-CD
mount: block device /tmp/CentOS-7-x86_64-DVD-1503-01.iso is write-protected, mounting read-only
Run Code Online (Sandbox Code Playgroud)

我将所有文件复制到工作目录中。

>cd /tmp/
>cp -r CentOS7-CD/ CentOS7
Run Code Online (Sandbox Code Playgroud)

启动文件

添加我的 kickstart 文件:

>cat << @@EOF@@ > /tmp/CentOS7/ks.cfg
#version=RHEL7
# System authorization information
auth --enableshadow --enablemd5
# Install OS instead of upgrade
install
# Reboot after installation
reboot --eject
# License agreement
eula --agreed
# Use text mode install
text
# Firewall configuration
firewall --disabled
firstboot --disable
ignoredisk --only-use=sda
# Keyboard layouts
# old format: keyboard us
# new format:
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_CA.UTF-8
# Installation logging level
logging --level=debug
# Network information
%include /tmp/network.ks

# Use CDROM installation media
cdrom
repo --name="CentOS" --baseurl=cdrom:sr0
# Use Network installation
#url --url=http://centos.mirror.iweb.ca/7/os/x86_64/

# Root password
rootpw --plaintext password
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone Etc/UTC --isUtc
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel 
# Disk partitioning information
part / --fstype="ext4" --size=10000
part /data --fstype="ext4" --size=18461
part /info --fstype="ext4" --size=2000
part /boot --fstype="ext3" --size=256
part swap --fstype="swap" --size=2048

%packages --nobase --excludedocs
@core
-aic94xx-firmware
-alsa-*
-iwl*-firmware
-ivtv-firmware
-libertas-*-firmware
-btrfs-progs
-cronie-anacron
-cronie
-crontabs
-ModemManager-glib
-NetworkManager*
-postfix
-wpa_supplicant
%end

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end

%pre
interface=$(ip addr | grep -i broadcast | awk '{ print $2 }' | head -1 | sed 's/://g')
echo "network --bootproto=dhcp --device=${interface} --onboot=on" > /tmp/network.ks
%end
@@EOF@@
Run Code Online (Sandbox Code Playgroud)

注意:如果使用这些说明并剪切和粘贴,您可能会在每一行前加上“>”。使用以下方法删除它们。

>sed -i 's|^> ||' /tmp/CentOS7/ks.cfg
Run Code Online (Sandbox Code Playgroud)

我试图限制安装的软件包数量,因此本%packages节中的所有排除项。

配置文件

接下来,编辑我的 isolinux.cfg 文件并添加inst.ks=cdrom:/dev/cdrom:/ks.cfg到每个附加行并使非测试版本成为默认版本。

>cd /tmp/CentOS7/isolinux/
>sed -i 's|\(LABEL=\S*\)|\1 inst.ks=cdrom:/dev/cdrom:/ks.cfg|' isolinux.cfg
# Delete the old default (check)
>sed -i '/menu default/d' isolinux.cfg
# Add the new default (linux)
>sed -i '0,/  kernel vmlinuz/s//  menu default\n&/' isolinux.cfg
Run Code Online (Sandbox Code Playgroud)

添加包

我凭经验确定我的最小安装需要添加 240 个包。我通过在 VirtualBox 上执行网络安装来完成此操作,并对 kickstart 文件进行以下更改:

# Use CDROM installation media
#cdrom                                    # <-- comment this out for ntwk install
#repo --name="CentOS" --baseurl=cdrom:sr0 # <-- comment this out for ntwk install
# Use Network installation
url --url=http://centos.mirror.iweb.ca/7/os/x86_64/
Run Code Online (Sandbox Code Playgroud)

所以我注释掉了CDROM安装,而是使用了网络存储库。安装耗时 10 分钟。完成后,我登录以获取已安装软件包的列表:

VB> rpm -qa > pkg.list
Run Code Online (Sandbox Code Playgroud)

我将此文件复制回我的生产机器并获得了下载这些文件的位置:

> cd /tmp/CentOS7
> rm -rf Packages
> cd Packages
# Copy the pkg.list from the VB server to this location
> cat pkg.list | xargs yumdownloader --urls | grep "^http" > pkg.urls
> wget -nv -nc -i pkg.urls
Run Code Online (Sandbox Code Playgroud)

这需要几分钟才能完成,因为它会下载所有软件包。

创建存储库

创建存储库是一项简单的任务。

>cd /tmp/CentOS7
>mv repodata/*comps.xml.gz comps.xml.gz
>gzip -d comps.xml
>rm -rf repodata
>mkdir repodata
>cp comps.xml repodata/
>createrepo -g repodata/comps.xml .
Run Code Online (Sandbox Code Playgroud)

创建 ISO

>cd /tmp
>mkisofs -o custom.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -V 'CentOS 7 x86_64' -boot-load-size 4 -boot-info-table -R -J -v -T CentOS7/
Run Code Online (Sandbox Code Playgroud)

Tre*_*nin 5

我终于解决了我自己的问题!我会把它作为一个答案,这样如果其他人看到它,他们就会知道原因。但是,我认为只有加拿大人会受到影响......

事实证明,问题出lang en_CA.UTF-8在 kickstart 文件中的那一行。我将其更改为lang en_US.UTF-8,安装正常完成。我可能会问另一个关于如何使用的问题,en_CA但至少我解决了这个问题。

谢谢!

对于任何感兴趣的人,我是如何通过这样做来解决它的:

  • 我制作了一张带有 CentOS-7-x86_64-DVD-1503-01.iso 的 DVD
  • 把它放在我的服务器上并启动
  • 当被问到时,更改了 grub 配置行并添加text到其中
  • 在 anaconda 安装期间,我通过网络配置了最小安装。
  • 安装完成并anaconda-ks.cfg创建了一个文件/root/
  • 我复制了这个文件并将它完全用作我自己的ks.cfg文件模板。
  • 我还根据此安装中已安装的软件包集重新创建了Packagesrepodata目录。
  • 使用新的 kickstart 文件创建了一个新的 iso 并且安装成功了!
  • 我一行一行地更改了新 ks.cfg 文件中的差异以匹配旧的(有问题的),重新创建 ISO 并尝试安装。
  • 痛苦地发现唯一导致错误的lang en_CA.UTF-8行是行。