|
|
(4 intermediate revisions not shown) |
Line 1: |
Line 1: |
- | ==Scripts used to test RPMs, create repo, and build ISO==
| + | Check the other page, please: [[CentOS 5.5 x86 64 Hypervisor Edition (Minimal)]] |
- | <pre>
| + | |
- | [root@buildhost-64 tmp]# cat testrun.sh
| + | |
- | #!/bin/bash
| + | |
- | TESTDIR=$1
| + | |
- | if [ "$TESTDIR" == "" ] ; then
| + | |
- | echo "You should provide the name of test directory containing RPMS. Please specify full path."
| + | |
- | exit 1
| + | |
- | fi
| + | |
- | RPMTEST="/tmp/RPMtest"
| + | |
- | rpm --initdb --dbpath ${RPMTEST}
| + | |
- | rpm --test --dbpath ${RPMTEST} --root ${RPMTEST} -ivh ${TESTDIR}/*.rpm
| + | |
- | | + | |
- | [root@buildhost-64 tmp]# cat creaerepo.sh
| + | |
- | #!/bin/bash
| + | |
- | BUILDDIR=$1
| + | |
- | if [ "${BUILDDIR}" == "" ]; then
| + | |
- | echo "Build Directory cannot be empty. Please specify full path."
| + | |
- | exit 1
| + | |
- | fi
| + | |
- | | + | |
- | CURRENTDIR=$(pwd)
| + | |
- | #COMPSFILE="/tmp/comps.xml-hypervisor"
| + | |
- | COMPSFILE="/tmp/comps.xml-no-lang-groups"
| + | |
- | | + | |
- | ## cd ${BUILDDIR}/
| + | |
- | export DISCINFO=$(head -1 ${BUILDDIR}/.discinfo)
| + | |
- | | + | |
- | echo "Doing: rm -f /${BUILDDIR}/repodata/*"
| + | |
- | rm -f ${BUILDDIR}/repodata/*
| + | |
- | | + | |
- | echo "Doing: cp -v ${COMPSFILE} ${BUILDDIR}/repodata/comps.xml"
| + | |
- | cp -v ${COMPSFILE} ${BUILDDIR}/repodata/comps.xml
| + | |
- | echo "Doing: createrepo -u "media://${DISCINFO}" -g ${BUILDDIR}/repodata/comps.xml ${BUILDDIR}/"
| + | |
- | ## echo "Doing: createrepo -u "media://${DISCINFO}" -g repodata/comps.xml ${BUILDDIR}/"
| + | |
- | createrepo -u "media://${DISCINFO}" -g ${BUILDDIR}/repodata/comps.xml ${BUILDDIR}/
| + | |
- | ## createrepo -u "media://${DISCINFO}" -g repodata/comps.xml ${BUILDDIR}/
| + | |
- | ## cd -
| + | |
- | [root@buildhost-64 tmp]# cat buildiso.sh | + | |
- | #!/bin/bash
| + | |
- | BUILDDIR=$1
| + | |
- | if [ "${BUILDDIR}" == "" ]; then
| + | |
- | echo "Build Directory cannot be empty. Please specify full path."
| + | |
- | exit 1
| + | |
- | fi
| + | |
- | ISODIR="/mnt/cdimages/"
| + | |
- | ISOFILE="CentOS-5.5-x86_64-HypervisorEdition.iso"
| + | |
- | | + | |
- | # Remove the non-english RELEASE-NOTES.
| + | |
- | rm -f ${BUILDDIR}/RELEASE-NOTES-[a-d,f-z]*
| + | |
- | | + | |
- | # Remove NOTES directory, which contains RELEASE-NOTES in plathora of different languages.
| + | |
- | rm -f ${BUILDDIR}/NOTES*
| + | |
- | | + | |
- | # Remove the target ISO file, if it already exists.
| + | |
- | rm ${ISODIR}/${ISOFILE}
| + | |
- | | + | |
- | # Create the README file in the CD root:
| + | |
- | cat > ${BUILDDIR}/README << EOFREADME
| + | |
- | ################################################################################################
| + | |
- | # README : Contains summary about this CD
| + | |
- | # Author : Muhammad Kamran Azeem (kamran@wbitt.com)
| + | |
- | # Created : 20110103
| + | |
- | # Revision: 20110103
| + | |
- | # Summary : This CD is CENTOS 5.5 x86_64 (64 bit), rebuilt by WBITT team, as Hypervisor Edition.
| + | |
- | #################################################################################################
| + | |
- | Detail:-
| + | |
- | 1) This is a bootable CD. (Of-course ;)
| + | |
- | 2) The CD contains four groups only:
| + | |
- | * core [Not visible in installer.]
| + | |
- | * base
| + | |
- | * xen (Named/shown as group: Virtualization)
| + | |
- | * kvm (Named/shown as group: KVM)
| + | |
- | | + | |
- | 3) These groups can be used in your kickstart files.
| + | |
- | 4) The groups are designed in such a way, that if you do not select any group (uncheck all of them at the time of installation),
| + | |
- | you will get a minimal installation, containing yum and wget. In minimal install you won't get any protection.
| + | |
- | 5) SELINUX and IPTABLES are not installed in the minimal (@core) installation.
| + | |
- | all other packages if needed must be copied, or installed from the CD directly.
| + | |
- | Or whatever way you prefer, including, but not limiting to using YUM.
| + | |
- | 6) The base contains xterm. If you select that, xterm and its (minimal) necessary X packages will also get installed automatically. (Vesa drivers)
| + | |
- | 7) If you decide to use kickstart, then please note, that the software in this CD is (should be) compatible with your current kickstarts.
| + | |
- | 8) The complete CD can be copied to an NFS/HTTP/FTP server, and can in-turn be used for network based installations, of the same.
| + | |
- | 9) The CD has both KVM and XEN hypervisors. Includes kernel-xen.
| + | |
- | 10) If you select the category "Virtualization" at the install time, and do not check "customize software selection", XEN will be installed.
| + | |
- | | + | |
- | End of README file.
| + | |
- | EOFREADME
| + | |
- | | + | |
- | # Create a sample kickstart file in the CD root:
| + | |
- | cat > ${BUILDDIR}/sample-kickstart.ks << EOFKS
| + | |
- | ################################################################################################
| + | |
- | # Author : Muhammad Kamran Azeem (kamran@wbitt.com)
| + | |
- | # Created: 2011-01-03
| + | |
- | # Revised: 2011-01-03
| + | |
- | # Summary: A minimalistic kickstart file by WBITT Team
| + | |
- | # Note : USE AT YOUR OWN RISK. Adjust as per your requirements.
| + | |
- | ################################################################################################
| + | |
- | install
| + | |
- | text
| + | |
- | # url --url http://192.168.122.1/CentOS-5.5-x86_64-Hypervisor/
| + | |
- | lang en_US.UTF-8
| + | |
- | keyboard us
| + | |
- | network --device eth0 --bootproto dhcp --hostname centos-55-64-hypervisor --noipv6
| + | |
- | # The password below is actually redhat
| + | |
- | rootpw --iscrypted $1$Q6duWtpC$OcyfP8NCdH1EZBxHmM/tL0
| + | |
- | firewall --enabled --port=22:tcp
| + | |
- | authconfig --enableshadow --enablemd5
| + | |
- | selinux --enabled
| + | |
- | timezone Asia/Riyadh
| + | |
- | # I prefer you create at least a 2 GB disk for the minimal install.
| + | |
- | # Adjust the following three lines as needed.
| + | |
- | # zerombr
| + | |
- | # bootloader --location=mbr --append=""
| + | |
- | # clearpart --all --initlabel
| + | |
- | # part / --fstype=ext3 --size=200 --grow
| + | |
- | # part swap --fstype=swap --size=256
| + | |
- | reboot
| + | |
- | | + | |
- | %packages
| + | |
- | # The options for groups are: core, base, xen, kvm
| + | |
- | @core
| + | |
- | | + | |
- | %post
| + | |
- | # chkconfig --level 35 sendmail off
| + | |
- | # chkconfig --level 35 cups off
| + | |
- | EOFKS
| + | |
- | | + | |
- | | + | |
- | # Finally, create the ISO.
| + | |
- | mkisofs -r -R -J -T -v \
| + | |
- | -no-emul-boot -boot-load-size 4 -boot-info-table \
| + | |
- | -V "CentOS-5.5-Hypervisor 64-bit" -p "KamranAzeem (kamran@wbitt.com)" -A "CentOS-5.5-Hypervisor-Edition 64 bit-2011/01/03" \
| + | |
- | -b isolinux/isolinux.bin -c isolinux/boot.cat -x "lost+found" \
| + | |
- | -o ${ISODIR}/${ISOFILE} ${BUILDDIR}
| + | |
- | | + | |
- | [root@buildhost-64 tmp]#
| + | |
- | | + | |
- | </pre>
| + | |