yumdownloader -c $yumconf $p
rpm2cpio *firmware*.rpm | (cd $KERNELROOT; cpio --quiet -iumd)
rm -f *firmware*.rpm
done
if [ ! -d "$KERNELROOT/lib/modules/$version" ]; then
echo "$KERNELROOT/lib/modules/$version is not a valid modules directory" 2>&1
exit 1
fi
if [ ! -f "$KERNELROOT/$KERNELDIR/${KERNELNAME}-$version" ]; then
echo "$KERNELROOT/$KERNELDIR/${KERNELNAME}-$version does not exist"
exit 1
fi
allmods=$(find $KERNELROOT/lib/modules/$version -name *.ko)
rundepmod $KERNELROOT
$GENMODINFO $KERNELROOT/lib/modules/$version > $MODINFO
# make the boot images
makeBootImages
makeEfiImages $yumconf
done
done
if [ -n "$foundakernel" ]; then
makeSecondStage
rm -rf $KERNELBASE
fi
doPostImages
cd $TOPDIR
#
# mk-images.x86
#
# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
SYSLINUX=$IMGPATH/usr/share/syslinux/syslinux-nomtools
if [ ! -f $SYSLINUX ]; then
echo "Warning: nomtools syslinux doesn't exist"
SYSLINUX=$IMGPATH/usr/bin/syslinux
if [ ! -f $SYSLINUX ]; then
echo "$SYSLINUX doesn't exist"
exit 1
fi
fi
# prepare a directory with the kernel, initrd, and various message files
# used to populate a boot image
prepareBootTree() {
(cd $BOOTDISKDIR; find . -maxdepth 1 ! -name "*.msg" ! -type d | cpio --quiet -p $MBD_BOOTTREE)
ln $MBD_FSIMAGE $MBD_BOOTTREE/initrd.img
cp $KERNELROOT/boot/vmlinuz-* $MBD_BOOTTREE/vmlinuz
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
cp $IMGPATH/usr/share/syslinux/vesamenu.c32 $MBD_BOOTTREE/vesamenu.c32
sed -i s'/default linux/default vesamenu.c32/g' $MBD_BOOTTREE/syslinux.cfg
sed -i 's/prompt 1/#prompt 1/g' $MBD_BOOTTREE/syslinux.cfg
elif [ -x $IMGPATH/usr/lib/anaconda-runtime/splashtolss.sh ]; then
$IMGPATH/usr/lib/anaconda-runtime/splashtolss.sh $BOOTDISKDIR/syslinux-splash.png $BOOTDISKDIR/splash.lss
if [ $? != 0 ]; then
echo $0: Failed to create splash.lss
exit 1
fi
cp $BOOTDISKDIR/splash.lss $MBD_BOOTTREE/splash.lss
elif [ -f $IMGPATH/usr/lib/anaconda-runtime/splash.lss ]; then
cp $IMGPATH/usr/lib/anaconda-runtime/splash.lss $MBD_BOOTTREE/splash.lss
fi
rm -f $MBD_BOOTTREE/syslinux-splash.png
sed -i "s/@PRODUCT@/$PRODUCT/g" $MBD_BOOTTREE/syslinux.cfg
sed -i "s/@VERSION@/$VERSION/g" $MBD_BOOTTREE/syslinux.cfg
rm -f $MBD_BOOTTREE/memtest*
for file in $BOOTDISKDIR/*.msg; do
filename=`basename $file`
sed -e "s/@VERSION@/$VERSION/g" $file > $MBD_BOOTTREE/$filename
done
if [ $? != 0 ]; then
echo $0: Failed to copy messages from $BOOTDISKDIR to $MBD_BOOTTREE.
umount $MBD_BOOTTREE
rm -rf $MBD_BOOTTREE $MBD_TMPIMAGE
exit 1
fi
}
mkdir -p $TOPDESTPATH/images/pxeboot
cat > $TOPDESTPATH/images/README <> $MBD_BOOTTREE/isolinux.cfg
fi
else
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 <> $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
}
doPostImages() {
if [ -n "$BOOTISO" ]; then
EFIARGS=""
EFIGRAFT=""
if [ -f $TOPDESTPATH/images/pxeboot/efiboot.img ]; then
cp $TOPDESTPATH/images/pxeboot/efiboot.img $TOPDESTPATH/isolinux/efiboot.img
EFIARGS="-eltorito-alt-boot -e isolinux/efiboot.img -no-emul-boot"
EFIGRAFT="EFI/boot=$TOPDESTPATH/EFI/boot"
fi
BIOSARGS="-b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table"
echo $PWD:\$ mkisofs -o $TOPDESTPATH/images/$BOOTISO $BIOSARGS $EFIARGS -R -J -V "$PRODUCT" -T -graft-points isolinux=$TOPDESTPATH/isolinux images/install.img=$TOPDESTPATH/images/install.img $EFIGRAFT
mkisofs -o $TOPDESTPATH/images/$BOOTISO $BIOSARGS $EFIARGS -R -J -V "$PRODUCT" -T -graft-points isolinux=$TOPDESTPATH/isolinux images/install.img=$TOPDESTPATH/images/install.img $EFIGRAFT
implantisomd5 $TOPDESTPATH/images/$BOOTISO
fi
}
. .. Makefile iscsi.py __init__.py miscutils.py storage_log.py formats errors.py
errors.pyc
devicelibs
devices.py
devicetree.py zfcp.py udev.py deviceaction.pyc deviceaction.py partitioning.py #
# Makefile
#
# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
include ../Makefile.inc
all:
echo "nothing to make"
install:
mkdir -p $(DESTDIR)/$(PYTHONLIBDIR)/storage
install -p -m 644 *.py $(DESTDIR)/$(PYTHONLIBDIR)/storage
../py-compile --basedir $(DESTDIR)/$(PYTHONLIBDIR)/storage $(DESTDIR)/$(PYTHONLIBDIR)/storage/*.py
clean:
rm -f *.o *.so *.pyc
depend:
#
# iscsi.py - iscsi class
#
# Copyright (C) 2005, 2006 IBM, Inc. All rights reserved.
# Copyright (C) 2006 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
from constants import *
import os
import errno
import string
import signal
import iutil
import isys
from flags import flags
import logging
import shutil
import time
import hashlib
import random
log = logging.getLogger("anaconda")
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
has_libiscsi = True
try:
import libiscsi
except:
has_libiscsi = False
# Note that stage2 copies all files under /sbin to /usr/sbin
global ISCSID
ISCSID=""
INITIATOR_FILE="/etc/iscsi/initiatorname.iscsi"
def find_iscsi_files():
global ISCSID
if ISCSID == "":
for dir in ("/usr/sbin", "/tmp/updates", "/mnt/source/RHupdates"):
path="%s/iscsid" % (dir,)
if os.access(path, os.X_OK):
ISCSID=path
def has_iscsi():
find_iscsi_files()
if ISCSID == "" or not has_libiscsi:
return False
log.info("ISCSID is %s" % (ISCSID,))
# make sure the module is loaded
if not os.access("/sys/module/iscsi_tcp", os.X_OK):
return False
return True
def iscsi_get_node_record(node_settings, record):
for line in node_settings:
if line.startswith(record):
words = line.split(" = ")
if len(words) == 2:
return words[1]
#