We also need to copy across the .diskinfo file that is not caught by our *:
需要copy这个文件.diskinfo
代码
cp /mnt/disk1/.diskinfo /data/isobuild/
The .diskinfo file identifies the CD as being a correct Red Hat Installer disk
and is checked by anaconda during the start of the install.
这个.diskinfo文件是在安装的时候,用于检测CD内容的必须文件。
We could now build the DVD as it is but we really should have a fiddle first :-)
老外的幽默,54。
Adding more software to the DVD
We could add some of our own rpms to /data/isobuild/RedHat/RPMS; however by just
doing this does not make them available at install time. There is an XML file
that is read and ensures that the packages are installed in the correct order.
Before we update the XML dependency file we need to sort out package orders.
If you have added a lot of new packages you may need to remove some old
packages that you have replaced with newer versions to stop conflicts.
So the first command is:
命令:
代码
PYTHONPATH=/usr/lib/anaconda /usr/lib/anaconda-runtime/pkgorder \
/data/isobuild/ i386 > /data/isobuild/xander-pkgorder
This creates a list of files in the order it needs to install them
in the file /data/isobuild/xander-pkgorder. Sometimes an occasional
RPM will not provide the information anaconda needs. You can edit
the file manually and insert your RPMs at the end.
You will probably have a few hiccoughs the first time you run these commands.
Most may be resolved by adding the missing entries to the pkgorder file or
deleting duplicate packages.
无关紧要
Creating an automated installer
We could *now* if we wanted to build our DVD; however we can make an
automated installer.
So crack open system-config-kickstart and create a kickstart file with
all the packages and partitioning etc you need for your systems.
开始创建DVD了。
copy the resulting file to /data/isobuild/ks.cfg
copy这个结果文件到/data/isobuild/ks.cfg
we can now edit the file /data/isobuild/isolinux/isolinux.cfg
然后编辑这个文件/data/isobuild/isolinux/isolinux.cfg
copy or change the three lines:
label linux
kernel vmlinuz
append initrd=initrd.img ramdisk_size=8192
to
label xander
kernel vmlinuz
append initrd=initrd.img ramdisk_size=8192 ks=cdrom:/ks.cfg
Then change the default at the top of the file to xander. This means that
the default action is to install directly from the DVD using your kickstart file.
Buring the DVD
Now we can burn the image to the CD. I assume the CD writer is already
set up on your system. We use cdrecord below, but you can use other
programs as well. The command is invoked as:
The speed and dev options depend on your system. The device for the dev
argument can be determined by using the -scanbus option to cdrecord:
cdrecord -scanbus
Using the DVD
Once the image is burned onto the DVD, insert the DVD into the target
machine and boot the machine. You should get the custom message that
you created earlier. At this point, you can either press Enter at the
boot prompt or let it timeout. When it times out it uses the default
label, which we specified as ks (Kickstart).
# A quick hack that will create a bootable DVD iso of a Red Hat Linux
# Distribution. Feed it either a directory containing the downloaded
# iso files of a distribution, or point it at a directory containing
# the "RedHat", "isolinux", and "images" directories.
# This version only works with "isolinux" based Red Hat Linux versions.
# Lots of disk space required to work, 3X the distribution size at least.
# GPL version 2 applies. No warranties, yadda, yadda. Have fun.
if [ $# -lt 2 ]; then
echo "Usage: `basename $0` source /destination/DVD.iso"
echo ""
echo " The 'source' can be either a directory containing a single"
echo " set of isos, or an exploded tree like an ftp site."
exit 1
fi