Changeset 2629 in MondoRescue


Ignore:
Timestamp:
May 11, 2010, 4:41:06 AM (14 years ago)
Author:
Bruno Cornec
Message:

Integrate Michael Shapiro's patch on Xen Kernel support for RHEL 5 (only atm) and fixes #418 (Michael Shapiro)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi/mindi

    r2625 r2629  
    5050    # If "yes" mindi will automatically use your own kernel.
    5151
     52KERNEL_IS_XEN="no"
     53    # If set to "no", the kernel is not a Xen kernel
     54    # If "yes", mindi will modify isolinux.cfg for the Xen kernel.
     55 
    5256MY_FSTAB=/etc/fstab
    5357TAPE_MODS="ht st osst ide-tape ide_tape"
     
    419423}
    420424
     425
     426FindMboot32Binary() {
     427    MBOOTC32=/usr/lib/syslinux/mboot.c32
     428    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib/syslinux/mboot.c32
     429    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib64/syslinux/mboot.c32
     430    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/syslinux/mboot.c32
     431    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/lib/syslinux/mboot.c32
     432    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/lib64/syslinux/mboot.c32
     433    [ ! -e "$MBOOTC32" ] && MBOOTC32=`find / -name mboot.c32 | grep -x "/.*/mboot.c32"`
     434    [ ! -e "$MBOOTC32" ] && Die "Please install mboot.c32 first. If your syslinux RPM doesn't include mboot.c32, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.com and click on 'Download'"
     435    echo "Found mboot.c32 at $MBOOTC32" >> $LOGFILE
     436    LogIt "  Found mboot.c32 at $MBOOTC32"
     437}
    421438
    422439FindIsolinuxBinary() {
     
    14081425    MakeMessageFile > $MINDI_TMP/iso/message.txt
    14091426    cp $kernelpath $MINDI_TMP/iso/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/iso/vmlinuz). Did you run out of disk space?"
     1427    if [ $KERNEL_IS_XEN = "yes" ]; then
     1428        cp $xenkernelpath $MINDI_TMP/iso/xen.gz 2>> $LOGFILE || Die "Cannot copy xen.gz ($xenkernelpath) to mindi tmp ($MINDI_TMP/iso/xen.gz). Did you run out of disk space?"
     1429        cp $MBOOTC32 $MINDI_TMP/iso/mboot.c32  2>> $LOGFILE || Die "Cannot copy mboot.c32 ($MBOOTC32) to mindi tmp ($MINDI_TMP/iso/mboot.c32). Did you run out of disk space?"
     1430    fi
     1431
    14101432    cp $MINDI_TMP/initrd.img $MINDI_TMP/iso/initrd.img 2>> $LOGFILE || Die "Cannot copy initrd.img ($MINDI_TMP/initrd.img) to $MINDI_TMP/iso/initrd.img. Did you run out of disk space?"
    14111433    if [ _"$MONDO_SHARE" != _"" ]; then
     
    14211443    if [ "$ARCH" != "ia64" ] ; then
    14221444        if [ _"$MONDO_SHARE" != _"" ]; then
    1423             cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
     1445            if [ $KERNEL_IS_XEN = "no" ]; then
     1446                cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
     1447            else
     1448                cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt,mboot.c32,xen.gz} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
     1449            fi
    14241450            cp -f $MONDO_SHARE/autorun $MINDI_TMP/iso 2>> $LOGFILE
    14251451        fi
     
    16681694                ps=""
    16691695            fi
    1670             outstr="label $i\n\tkernel ${ps}vmlinuz\n\tappend initrd=${ps}initrd.img root=/dev/ram0 rw ramdisk_size=$ramdisk_size ${ooo} $MINDI_ADDITIONAL_BOOT_PARAMS\n"
     1696            if [ $KERNEL_IS_XEN = "no" ]; then
     1697                outstr="label $i\n\tkernel ${ps}vmlinuz\n\tappend initrd=${ps}initrd.img root=/dev/ram0 rw ramdisk_size=$ramdisk_size ${ooo} $MINDI_ADDITIONAL_BOOT_PARAMS\n"
     1698            else
     1699                outstr="label $i\n\tkernel ${ps}mboot.c32\n\tappend ${ps}xen.gz --- ${ps}vmlinuz root=/dev/ram0 rw ramdisk_size=$ramdisk_size  ${ooo} $MINDI_ADDITIONAL_BOOT_PARAMS --- ${ps}initrd.img\n"
     1700            fi
    16711701        fi
    16721702        echo -en "$outstr"
    16731703    done
    1674 
    16751704    if [ -e "$MINDI_LIB/memtest.img" ] ; then
    16761705        if [ "$type" = "elilo" ]; then
     
    18441873    dd if=/dev/zero of=$mountpoint/zero bs=1k count=16 &> /dev/null
    18451874    free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4`
    1846     cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null
    1847     if [ "$?" -ne "0" ] ; then
     1875         
     1876    retval=0
     1877    if [ $KERNEL_IS_XEN = "no" ]; then
     1878        cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null
     1879        retval=$?
     1880    else
     1881        cp -f $xenkernelpath $mountpoint/xenkernel &> /dev/null
     1882        retval=$?
     1883        cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null
     1884        let retval+=$?
     1885    fi
     1886 
     1887    if [ "$retval" -ne "0" ] ; then
    18481888        echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE
    18491889        du -sk $mountpoint/* >> $LOGFILE
     
    28122852
    28132853        kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath=""
     2854        # See if it's a Xen kernel
     2855        if [ -n "$kernelpath" ]; then
     2856            strings $kernelpath | grep -iq xen 2>/dev/null
     2857            if [ $? -eq 0 ]; then
     2858                # It's a Xen kernel
     2859                KERNEL_IS_XEN=yes
     2860                LogIt "It's a Xen kernel..."
     2861                # WARNING: This will only work for RHEL 5
     2862                # TODO: SLES and others
     2863                # Use TryToFindKernelPath ?
     2864                xenkernelpath="/boot/`uname -r | awk '{sub("[Xx][Ee][Nn]",""); printf("xen.gz-%s",$0)}'`"
     2865                if [[ -z "$xenkernelpath" || ! -f "$xenkernelpath" ]]; then
     2866                    Die "Cannot find Xen kernel $xenkernelpath, aborting"
     2867                fi
     2868                xenkernelname=`basename $xenkernelpath`
     2869                FindMboot32Binary
     2870            fi
     2871        fi
     2872
    28142873###
    28152874### Sq-Modification...
     
    28172876### if module path is found then use it other wise use uname -r to set it...
    28182877###
     2878        if [ $KERNEL_IS_XEN = "yes" ]; then
     2879            LogIt "xenkernelpath = $xenkernelpath"
     2880            LogIt "xenkernelname = $xenkernelname"
     2881        fi
    28192882        kernelname=`echo $kernelpath | cut -d'-' -f2-`
    28202883        LogIt "kernelname = $kernelname"
Note: See TracChangeset for help on using the changeset viewer.