CentOS6でカスタムインストールDVD作成


CentOS6.3ベースでひとまずある程度までパッケージ選択済みでインストールできるkickstartを書いた。
(「CentOS6ベースでカスタムLiveCDを作るという記事もあります)
具体的にはファイルサーバっぽい感じの設定を考えている。

しかし、実際にブートしてみるとパーテーション選択の次で、止まる。

Alt+F2でコンソールを切り替えてみると、以下のエラーが出力されていることがわかった。

ERROR: Error downloading treeinfo file: [Error 14] PYCURL ERROR 6 - "Couldn't resolve host 'cdrom:sr0'"

しかし、dfで見てみると「/mnt/source」にDVDはマウントされている状況。

ぐぐってみると答えを発見。
serverfault:「PyCURL couldn’t resolve “cdrom:sr0” during CentOS 6.2 kickstart installation

上記ページの要約
「repo –name=”CentOS” –baseurl=cdrom:sr0 –cost=100」ってなってるのを「repo –name=”CentOS” –baseurl=file:///mnt/source –cost=100」に変更しろ。

実際、その通りにしたところ、正常に動作した。

以下は、カスタムインストールDVDを作成するにあたり、実行したコマンドを順に書いていったもの。

 [/root]# mkdir mnt
[/root]# mount -o ro,loop CentOS-6.3-x86_64-bin-DVD1.iso mnt
[/root]# mkdir CentOS
[/root]# cd mnt
[/root/mnt]# tar cf - . |(cd ../CentOS;tar xpf -)
[/root]# cd ..
[/root]# cp anadonda-ks.cfg CentOS/isolinux/ks.cfg
[/root]# cp -r custom CentOS
[/root]# cd CentOS
[/root/CentOS]# cd isolinux
[/root/CentOS/isolinux]# vi isolinux.cfg
[/root/CentOS/isolinux]# cat isolinux.cfg
default vesamenu.c32
#prompt 1
timeout 600

display boot.msg

menu background splash.jpg
menu title Welcome to CentOS 6.3!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000

label linux
  menu label ^Install or upgrade an existing system
  kernel vmlinuz
  append initrd=initrd.img
label vesa
  menu label Install system with ^basic video driver
  kernel vmlinuz
  append initrd=initrd.img xdriver=vesa nomodeset
label rescue
  menu label ^Rescue installed system
  kernel vmlinuz
  append initrd=initrd.img rescue
label local
  menu label Boot from ^local drive
  localboot 0xffff
label memtest86
  menu label ^Memory test
  kernel memtest
  append -
label nas
  menu label ^Install or upgrade a CentOS custom OS
  menu default
  kernel vmlinuz
  append initrd=initrd.img ks=cdrom:/isolinux/ks.cfg
[/root/CentOS/isolinux]# cat ks.cfg
# Kickstart file automatically generated by anaconda.

#version=DEVEL
install
cdrom
text
lang en_US.UTF-8
keyboard jp106
network --onboot yes --device eth0 --bootproto dhcp --noipv6
network --onboot no --device eth1 --bootproto dhcp --noipv6
rootpw  --plaintext password
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone --utc Asia/Tokyo
bootloader --location=mbr --driveorder=sda,sdb --append="crashkernel=auto"
firstboot --disabled
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work

#repo --name="CentOS"  --baseurl=cdrom:sr0 --cost=100
repo --name="CentOS"  --baseurl=file:///mnt/source --cost=100

%packages
@core
@server-policy
crypto-utils
perl-DBD-SQLite
perl-CGI
wget
parted
ypbind
yp-tools
xfsdump
xfsprogs
iscsi-initiator-utils
ntpdate
openssh-clients
screen
unzip
man
nfs-utils
samba
autofs
lm_sensors
dmidecode
i2c-tools
lm_sensors-sensord
%end
%post --nochroot
cd /mnt/stage2/custom
# Areca RAID setup
cp cli64 archttp64 archttpsrv.conf /mnt/sysimage/root/
chmod a+x /mnt/sysimage/root/cli64 /mnt/sysimage/root/archttp64
cp init.d-archttp /mnt/sysimage/etc/init.d/archttp
chmod a+x /mnt/sysimage/etc/init.d/archttp
cp logrotate.d-archttp /mnt/sysimage/etc/logrotate.d/archttp
chroot /mnt/sysimage /sbin/chkconfig --add archttp
chroot /mnt/sysimage /sbin/chkconfig archttp on

# system mod
chroot /mnt/sysimage /sbin/chkconfig iptables off
chroot /mnt/sysimage /sbin/chkconfig mcelogd off
chroot /mnt/sysimage /sbin/chkconfig autofs off
chroot /mnt/sysimage /sbin/chkconfig cups off
# nfs mod
mv /mnt/sysimage/etc/sysconfig/nfs /mnt/sysimage/etc/sysconfig/nfs.org
sed s/#RPCNFSDCOUNT=8/RPCNFSDCOUNT=32/ig /mnt/sysimage/etc/sysconfig/nfs.org > /mnt/sysimage/etc/sysconfig/nfs
chroot /mnt/sysimage /sbin/chkconfig nfs on
cat nfs.mod >> /mnt/sysimage/etc/sysctl.cfg

# lm_sensor
mv /mnt/sysimage/etc/sensors3.conf /mnt/sysimage/etc/sensors3.conf.org
cp sensors3.conf /mnt/sysimage/etc/sensors3.conf
mv /mnt/sysimage/etc/sysconfig/lm_sensors /mnt/sysimage/etc/sysconfig/lm_sensors.org
cp lm_sensors /mnt/sysimage/etc/sysconfig/lm_sensors
mv /mnt/sysimage/etc/sysconfig/sensord /mnt/sysimage/etc/sysconfig/sensord.org
cp sensord /mnt/sysimage/etc/sysconfig/sensord
chroot /mnt/sysimage /sbin/chkconfig lm_sensors on
chroot /mnt/sysimage /sbin/chkconfig sensord on

%end
[/root/CentOS/isolinux]# cd ..
[/root/CentOS]# cat custom/nfs.mod

## add for NFS server start
# increase TCP max buffer size
net.core.rmem_max = 33554432
net.core.wmem_max = 33554432
net.core.rmem_default = 65536
net.core.wmem_default = 65536
# increase Linux autotuning TCP buffer limits
# min, default, and max number of bytes to use
net.ipv4.tcp_rmem = 4096 33554432 33554432
net.ipv4.tcp_wmem = 4096 33554432 33554432
net.ipv4.tcp_mem= 33554432 33554432 33554432
net.ipv4.route.flush=1
net.core.netdev_max_backlog=1500
## add for NFS server end
[/root/CentOS]# cd Packages
[/root/CentOS/Packages]# cp /mnt/Packages/lm_sensors-sensord-3.1.1-10.el6.x86_64.rpm .
[/root/CentOS/Packages]# rm -f eclipse* 
[/root/CentOS/Packages]# cd ..
[/root/CentOS]# mkisofs -r -l -J -o ../Custom.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .
[/root/CentOS]# 

“CentOS6でカスタムインストールDVD作成” への1件の返信

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください