- Timestamp:
- May 11, 2010, 4:41:06 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi/mindi
r2625 r2629 50 50 # If "yes" mindi will automatically use your own kernel. 51 51 52 KERNEL_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 52 56 MY_FSTAB=/etc/fstab 53 57 TAPE_MODS="ht st osst ide-tape ide_tape" … … 419 423 } 420 424 425 426 FindMboot32Binary() { 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 } 421 438 422 439 FindIsolinuxBinary() { … … 1408 1425 MakeMessageFile > $MINDI_TMP/iso/message.txt 1409 1426 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 1410 1432 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?" 1411 1433 if [ _"$MONDO_SHARE" != _"" ]; then … … 1421 1443 if [ "$ARCH" != "ia64" ] ; then 1422 1444 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 1424 1450 cp -f $MONDO_SHARE/autorun $MINDI_TMP/iso 2>> $LOGFILE 1425 1451 fi … … 1668 1694 ps="" 1669 1695 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 1671 1701 fi 1672 1702 echo -en "$outstr" 1673 1703 done 1674 1675 1704 if [ -e "$MINDI_LIB/memtest.img" ] ; then 1676 1705 if [ "$type" = "elilo" ]; then … … 1844 1873 dd if=/dev/zero of=$mountpoint/zero bs=1k count=16 &> /dev/null 1845 1874 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 1848 1888 echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE 1849 1889 du -sk $mountpoint/* >> $LOGFILE … … 2812 2852 2813 2853 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 2814 2873 ### 2815 2874 ### Sq-Modification... … … 2817 2876 ### if module path is found then use it other wise use uname -r to set it... 2818 2877 ### 2878 if [ $KERNEL_IS_XEN = "yes" ]; then 2879 LogIt "xenkernelpath = $xenkernelpath" 2880 LogIt "xenkernelname = $xenkernelname" 2881 fi 2819 2882 kernelname=`echo $kernelpath | cut -d'-' -f2-` 2820 2883 LogIt "kernelname = $kernelname"
Note:
See TracChangeset
for help on using the changeset viewer.