Added XEN support to mk-images.x86. Removed PXE support.

This commit is contained in:
Tomasz Sterna 2011-01-18 04:28:26 -05:00
parent 7ff1623d2d
commit d50bfb7501
2 changed files with 21 additions and 58 deletions

View File

@ -100,13 +100,14 @@ USBMODS="ohci-hcd uhci-hcd ehci-hcd usbhid mousedev usb-storage sd_mod sr_mod ub
FIREWIREMODS="ohci1394 sbp2 fw-ohci fw-sbp2 firewire-sbp2 firewire-ohci"
SDMODS="mmc-block sdhci sdhci-pci"
IDEMODS="ide-cd ide-cd_mod"
ATAMODS="ata_generic ata_piix sata_nv sata_via sata_promise pata_via"
SCSIMODS="sr_mod sg st sd_mod scsi_mod iscsi_tcp iscsi_ibft"
FSMODS="fat msdos vfat ext2 ext3 ext4 reiserfs jfs xfs gfs2 cifs fuse btrfs hfsplus"
LVMMODS="dm-mod dm-zero dm-snapshot dm-mirror dm-multipath dm-round-robin dm-crypt"
RAIDMODS="raid0 raid1 raid5 raid6 raid456 raid10 linear"
CRYPTOMODS="sha256_generic cbc xts lrw aes_generic crypto_blkcipher crc32c ecb arc4"
PCMCIASOCKMODS="yenta_socket i82365 tcic pcmcia"
INITRDMODS="$USBMODS $FIREWIREMODS $IDEMODS $SCSIMODS $FSMODS $LVMMODS $RAIDMODS $CRYPTOMODS $COMMONMODS $PCMCIASOCKMODS $SDMODS =scsi =net =drm"
INITRDMODS="$USBMODS $FIREWIREMODS $IDEMODS $ATAMODS $SCSIMODS $FSMODS $LVMMODS $RAIDMODS $CRYPTOMODS $COMMONMODS $PCMCIASOCKMODS $SDMODS =scsi =net =drm"
. $(dirname $0)/buildinstall.functions
@ -343,7 +344,7 @@ EOF
find -H $MMB_DIR/lib/modules -type f -name *.ko -exec gzip -9 {} \;
rundepmod $MMB_DIR
rm -f $MMB_DIR/lib/modules/*/modules.*map
rm -f $MMB_DIR/lib/modules/*/{build,source}
rm -rf $MMB_DIR/lib/modules/*/{build,source}
# create the pci.ids, from modules.alias and the X driver aliases
awk '!/^(\t\t|#)/ { print ;if ($0 == "ffff Illegal Vendor ID") nextfile; }' < $PCIIDS | \
@ -1103,6 +1104,12 @@ for KERNELARCH in $arches; do
rpm2cpio *firmware*.rpm | (cd $KERNELROOT; cpio --quiet -iumd)
rm -f *firmware*.rpm
done
# and get XEN Hypervisor
for p in $(repoquery -c $yumconf 'xen-hypervisor') ; do
yumdownloader -c $yumconf $p
rpm2cpio xen-hypervisor*.rpm | (cd $KERNELROOT; cpio --quiet -iumd)
rm -f xen-hypervisor*.rpm
done
if [ ! -d "$KERNELROOT/lib/modules/$version" ]; then
echo "$KERNELROOT/lib/modules/$version is not a valid modules directory" 2>&1

View File

@ -36,6 +36,7 @@ prepareBootTree() {
ln $MBD_FSIMAGE $MBD_BOOTTREE/initrd.img
cp $KERNELROOT/boot/vmlinuz-* $MBD_BOOTTREE/vmlinuz
cp $KERNELROOT/boot/xen-[0-9]* $MBD_BOOTTREE/xen.gz
if [ -f $IMGPATH/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg ]; then
cp $IMGPATH/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg $MBD_BOOTTREE/splash.jpg
@ -70,30 +71,10 @@ prepareBootTree() {
fi
}
mkdir -p $TOPDESTPATH/images/pxeboot
cat > $TOPDESTPATH/images/README <<EOF
This directory contains image files that can be used to create media
capable of starting the $PRODUCT installation process.
The boot.iso file is an ISO 9660 image of a bootable CD-ROM. It is useful
in cases where the CD-ROM installation method is not desired, but the
CD-ROM's boot speed would be an advantage.
To use this image file, burn the file onto CD-R (or CD-RW) media as you
normally would.
EOF
makeBootImages() {
local initrd="initrd.img"
local kernelimage="vmlinuz"
if [ "$kernelvers" = "$kernelxen" ] ; then
local tag="${kernelvers#kernel}"
if [ -n "$tag" -a "$tag" != "$kernelvers" ] ; then
initrd="initrd${tag}.img"
kernelimage="vmlinuz${tag}"
fi
fi
local xenimage="xen.gz"
echo "Building $initrd"
makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/$initrd \
@ -102,13 +83,13 @@ makeBootImages() {
--modules "$INITRDMODS"
[ $? = 0 ] || exit 1
if [ "$kernelvers" != "$kernelxen" ] ; then
if [ -f $IMGPATH/usr/share/syslinux/isolinux.bin ]; then
echo "Building isolinux directory"
MBD_BOOTTREE=$TOPDESTPATH/isolinux
MBD_FSIMAGE=$TOPDESTPATH/images/pxeboot/initrd.img
mkdir $MBD_BOOTTREE
cp $IMGPATH/usr/share/syslinux/isolinux.bin $MBD_BOOTTREE/isolinux.bin
cp $IMGPATH/usr/share/syslinux/mboot.c32 $MBD_BOOTTREE/mboot.c32
prepareBootTree
@ -116,7 +97,10 @@ makeBootImages() {
mv $MBD_BOOTTREE/syslinux.cfg $MBD_BOOTTREE/isolinux.cfg
# set up the label for finding stage2 with a hybrid iso
sed -i "s/initrd=initrd.img/initrd=initrd.img stage2=hd:LABEL=\"$CDLABEL\"/" $MBD_BOOTTREE/isolinux.cfg
# insert XEN boot options
sed -i 's/kernel vmlinuz/kernel mboot.c32/' $MBD_BOOTTREE/isolinux.cfg
sed -i "s/append initrd=.*/append $xenimage --- $kernelimage stage2=hd:LABEL=\"$CDLABEL\" rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM --- $initrd/" $MBD_BOOTTREE/isolinux.cfg
# copy in memtest if present
if [ -f $IMGPATH/usr/lib/anaconda-runtime/boot/memtest* ]; then
@ -127,35 +111,7 @@ makeBootImages() {
echo "No isolinux binaries. Skipping isolinux creation"
fi
# symlink the kernel for pxe dir
ln $TOPDESTPATH/isolinux/vmlinuz $TOPDESTPATH/images/pxeboot/vmlinuz
cat > $TOPDESTPATH/images/pxeboot/README <<EOF
The files in this directory are useful for booting a machine via PXE.
The following files are available:
vmlinuz - the kernel used for the installer
initrd.img - an initrd with support for all install methods and
drivers supported for installation of $PRODUCT
EOF
cat << __EOT__ >> $TOPDESTPATH/.treeinfo
[images-$BASEARCH]
kernel = images/pxeboot/vmlinuz
initrd = images/pxeboot/initrd.img
__EOT__
if [ -n "$BOOTISO" ]; then echo "boot.iso = images/$BOOTISO" >> $TOPDESTPATH/.treeinfo ; fi
fi
# set up the boot stuff for the xen guest kernel
if [ -z "$kernelxen" -o "$kernelvers" = "$kernelxen" ] ; then
cp $KERNELROOT/boot/vmlinuz-$version $TOPDESTPATH/images/pxeboot/$kernelimage
cat << __EOT__ >> $TOPDESTPATH/.treeinfo
[images-xen]
kernel = images/pxeboot/$kernelimage
initrd = images/pxeboot/$initrd
__EOT__
fi
}