Changeset 3476 in MondoRescue
- Timestamp:
- Oct 14, 2015, 4:56:07 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi/mindi
r3474 r3476 525 525 [ ! -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.org/downloads.shtml" 526 526 LogFile "INFO: Found mboot.c32 at $MBOOTC32" 527 } 528 529 FindLdlinuxe64Binary() { 530 LDLINUXE64=/usr/share/syslinux/efi64/ldlinux.e64 531 [ ! -e "$LDLINUXE64" ] && LDLINUXE64=/usr/lib64/syslinux/efi64/ldlinux.e64 532 [ ! -e "$LDLINUXE64" ] && LDLINUXE64=/usr/share/lib/syslinux/efi64/ldlinux.e64 533 [ ! -e "$LDLINUXE64" ] && LDLINUXE64=/usr/share/lib64/syslinux/efi64/ldlinux.e64 534 [ ! -e "$LDLINUXE64" ] && LDLINUXE64=/usr/lib/syslinux/modules/efi64/ldlinux.e64 535 [ ! -e "$LDLINUXE64" ] && LDLINUXE64=/usr/lib64/syslinux/modules/efi64/ldlinux.e64 536 [ ! -e "$LDLINUXE64" ] && LDLINUXE64=`find / -name ldlinux.e64 | grep -x "/.*/ldlinux.e64"` 537 [ ! -e "$LDLINUXE64" ] && Die "Please install ldlinux.e64 first. If your syslinux RPM doesn't include ldlinux.e64, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml" 538 LogFile "INFO: Found ldlinux.e64 at $LDLINUXE64" 539 } 540 541 FindSyslinux64EFI() { 542 SYSLINUX64EFI=/usr/share/syslinux/efi64/syslinux.efi 543 [ ! -e "$SYSLINUX64EFI" ] && SYSLINUX64EFI=/usr/lib/syslinux/efi64/syslinux.efi 544 [ ! -e "$SYSLINUX64EFI" ] && SYSLINUX64EFI=/usr/lib64/syslinux/efi64/syslinux.efi 545 [ ! -e "$SYSLINUX64EFI" ] && SYSLINUX64EFI=/usr/share/syslinux/syslinux.efi 546 [ ! -e "$SYSLINUX64EFI" ] && SYSLINUX64EFI=/usr/share/lib64/syslinux/efi64/syslinux.efi 547 [ ! -e "$SYSLINUX64EFI" ] && SYSLINUX64EFI=/usr/lib/SYSLINUX/efi64/syslinux.efi 548 [ ! -e "$SYSLINUX64EFI" ] && SYSLINUX64EFI=`find / -name syslinux.efi | grep -x "/.*64/syslinux.efi"` 549 [ ! -e "$SYSLINUX64EFI" ] && Die "Please install syslinux first. If your syslinux RPM doesn't include syslinux, you may download an syslinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml" 550 LogFile "INFO: Found syslinux.efi at $SYSLINUX64EFI" 527 551 } 528 552 … … 1464 1488 fi 1465 1489 done 1490 1466 1491 MakeMessageFile $MINDI_TMP/iso | cut -c1-80 > $MINDI_TMP/iso/message.txt 1492 1467 1493 if [ $KERNEL_IS_XEN = "yes" ]; then 1468 1494 FindMboot32Binary … … 1470 1496 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?" 1471 1497 fi 1472 # Useful for syslinux 5.x 1473 FindLdlinux32Binary 1474 if [ -e $LDLINUXC32 ]; then 1475 cp $LDLINUXC32 $MINDI_TMP/iso/ldlinux.c32 2>> $LOGFILE || Die "Cannot copy ldlinux.c32 ($LDLINUXC32) to mindi tmp ($MINDI_TMP/iso/ldlinux.c32). Did you run out of disk space?" 1476 fi 1498 1477 1499 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?" 1478 1500 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?" 1479 1480 if [ _"$MONDO_SHARE" != _"" ]; then1481 if [ $KERNEL_IS_XEN = "yes" ]; then1482 cp $xenkernelpath $MONDO_ROOT/xen.gz 2>> $LOGFILE || Die "Cannot copy xen.gz ($xenkernelpath) to mindi tmp ($MONDO_ROOT/xen.gz). Did you run out of disk space?"1483 cp $MBOOTC32 $MONDO_ROOT/mboot.c32 2>> $LOGFILE || Die "Cannot copy mboot.c32 ($MBOOTC32) to mindi tmp ($MONDO_ROOT/mboot.c32). Did you run out of disk space?"1484 fi1485 if [ -e $LDLINUXC32 ]; then1486 cp $LDLINUXC32 $MONDO_ROOT/ldlinux.c32 2>> $LOGFILE || Die "Cannot copy ldlinux.c32 ($LDLINUXC32) to $MONDO_ROOT/ldlinux.c32. Did you run out of disk space?"1487 fi1488 cp $kernelpath $MONDO_ROOT/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?"1489 cp $MINDI_TMP/initrd.img $MONDO_ROOT/initrd.img 2>> $LOGFILE || Die "Cannot copy initrd.img ($MINDI_TMP/initrd.img) to $MONDO_ROOT/initrd.img. Did you run out of disk space?"1490 fi1491 MakeBootConfFile isolinux > $MINDI_TMP/iso/isolinux.cfg1492 1501 if [ "$ARCH" != "ia64" ] ; then 1493 1502 cp $ISOLINUX $MINDI_TMP/iso/isolinux.bin 2>> $LOGFILE || Die "Cannot copy isolinux.bin ($ISOLINUX) to $MINDI_TMP/iso - did you run out of disk space?" … … 1496 1505 # copy boot stuff now generated in PrepareDataDiskImage 1497 1506 if [ "$BOOT_TYPE" = "UEFI" ]; then 1507 FindLdlinuxe64Binary 1508 if [ -e $LDLINUXE64 ]; then 1509 cp $LDLINUXE64 $MINDI_TMP/iso/ 2>> $LOGFILE || Die "Cannot copy $LDLINUXE64 to mindi tmp ($MINDI_TMP/iso/). Did you run out of disk space?" 1510 fi 1498 1511 (cd $MINDI_TMP/iso ; tar xfz $MINDI_CACHE/all.tar.gz ./EFI) 1499 1512 tbc="EFI" 1500 1513 else 1514 # Useful for syslinux 5.x 1515 FindLdlinux32Binary 1516 if [ -e $LDLINUXC32 ]; then 1517 cp $LDLINUXC32 $MINDI_TMP/iso/ 2>> $LOGFILE || Die "Cannot copy $LDLINUXC32 to mindi tmp ($MINDI_TMP/iso/). Did you run out of disk space?" 1518 fi 1501 1519 (cd $MINDI_TMP/iso ; tar xfz $MINDI_CACHE/all.tar.gz ./boot) 1502 1520 tbc="boot" 1503 1521 fi 1504 1522 1523 if [ _"$MONDO_SHARE" != _"" ]; then 1524 if [ $KERNEL_IS_XEN = "yes" ]; then 1525 cp $xenkernelpath $MONDO_ROOT/xen.gz 2>> $LOGFILE || Die "Cannot copy $xenkernelpath to mondo tmp ($MONDO_ROOT/xen.gz). Did you run out of disk space?" 1526 cp $MBOOTC32 $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $MBOOTC32 to mondo tmp ($MONDO_ROOT/). Did you run out of disk space?" 1527 fi 1528 if [ -e $LDLINUXC32 ]; then 1529 cp $LDLINUXC32 $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $LDLINUXC32 to $MONDO_ROOT/. Did you run out of disk space?" 1530 fi 1531 if [ -e $LDLINUXE64 ]; then 1532 cp $LDLINUXE64 $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $LDLINUXE64 to $MONDO_ROOT/. Did you run out of disk space?" 1533 fi 1534 cp $kernelpath $MONDO_ROOT/vmlinuz 2>> $LOGFILE || Die "Cannot copy $kernelpath to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?" 1535 cp $MINDI_TMP/initrd.img $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $MINDI_TMP/initrd.img to $MONDO_ROOT/. Did you run out of disk space?" 1536 fi 1537 1538 1505 1539 old_pwd=`pwd` 1506 1540 cd "$MINDI_TMP/iso" 1507 1541 if [ "$ARCH" != "ia64" ] ; then 1508 1542 if [ _"$MONDO_SHARE" != _"" ]; then 1509 cp -rf $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt,boot*.txt,pxe.txt,$tbc} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?" 1510 if [ -e $MINDI_TMP/iso/ldlinux.c32 ]; then 1511 cp $MINDI_TMP/iso/ldlinux.c32 $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy ldlinux.c32 (from $MINDI_TMP/iso/$LDLINUXC32) to $MONDO_ROOT. Did you run out of disk space?" 1543 cp -rf $MINDI_TMP/iso/{initrd.img,vmlinuz,isolinux.bin,message.txt,boot*.txt,pxe.txt,$tbc} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?" 1544 cfgf=`find $MINDI_TMP/iso -name 'isolinux.cfg' | head -1` 1545 if [ -e $cfgf ]; then 1546 cp $cfgf $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy $cfgf to $MONDO_ROOT. Did you run out of disk space?" 1512 1547 fi 1513 1548 if [ $KERNEL_IS_XEN = "yes" ]; then 1514 cp -f $MINDI_TMP/iso/ {mboot.c32,xen.gz} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy Xen core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"1549 cp -f $MINDI_TMP/iso/xen.gz $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy Xen kernel to $MONDO_ROOT. Did you run out of disk space?" 1515 1550 fi 1516 1551 cp -f $MONDO_SHARE/autorun $MINDI_TMP/iso 2>> $LOGFILE 1517 1552 fi 1518 CMD="$ISO_CMD -U $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table ." 1553 CMD="$ISO_CMD -U $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table" 1554 if [ "$BOOT_TYPE" = "UEFI" ]; then 1555 # These options do not work for all genisoimage versions :-( 1556 CMD="$CMD -eltorito-alt-boot -efi-boot images/mindi-bootroot.img -no-emul-boot" 1557 fi 1519 1558 else 1520 CMD="$ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.img -c images/boot.cat -no-emul-boot ."1559 CMD="$ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.img -c images/boot.cat -no-emul-boot" 1521 1560 fi 1522 1561 LogFile "Invoking $CMD" 1523 $CMD > /dev/null 2> $MINDI_TMP/mkisofs.log1562 $CMD . > /dev/null 2> $MINDI_TMP/mkisofs.log 1524 1563 if [ "$?" -ne "0" ] ; then 1525 LogFile "----------- $ISO_CMD's errors --------------" 1526 LogAll "$ISO_CMD returned the following errors:" 1527 cat $MINDI_TMP/mkisofs.log | tee -a $LOGFILE 1528 LogAll "ERROR: Failed to create ISO image." 1564 if [ "$BOOT_TYPE" = "UEFI" ]; then 1565 CMD=`echo $CMD | perl -p -e 's|-efi-boot |-eltorito-platform 0xEF -eltorito-boot |'` 1566 $CMD . > /dev/null 2> $MINDI_TMP/mkisofs.log 1567 if [ "$?" -eq "0" ] ; then 1568 LogAll "INFO: Created bootable ISO image at $MINDI_CACHE/mindi.iso" 1569 else 1570 MakeISOErrors 1571 fi 1572 else 1573 MakeISOErrors 1574 fi 1529 1575 else 1530 1576 LogAll "INFO: Created bootable ISO image at $MINDI_CACHE/mindi.iso" … … 1532 1578 rm -f $MINDI_TMP/mkisofs.log 1533 1579 cd "$old_pwd" 1580 } 1581 1582 MakeISOErrors() { 1583 1584 LogFile "----------- $ISO_CMD's errors --------------" 1585 LogAll "$CMD returned the following errors:" 1586 cat $MINDI_TMP/mkisofs.log | tee -a $LOGFILE 1587 LogAll "ERROR: Failed to create ISO image." 1534 1588 } 1535 1589 … … 1868 1922 PrepareBootDiskImage() { 1869 1923 # LILO originally 1870 local dev imagefile fname i kernelpath cfg_file testpath options retval outstr old_pwd ooo max_kernel_size liloconf bootimage1924 local dev imagefile fname i kernelpath cfg_file testpath options retval outstr old_pwd ooo max_kernel_size bootconf bootimage 1871 1925 kernelpath=$1 1872 1926 retval=0 … … 2099 2153 fi 2100 2154 2101 # copy (e)lilo/ syslinux/grub/whatever stuff into it as well2155 # copy (e)lilo/isolinux/grub/whatever stuff into it as well 2102 2156 # to get it on the media (in addition to the boot part 2103 2157 # and also to support UEFI boot mechanism 2104 2158 bootdir=$bigdir/boot 2159 bootconf="$bootdir/syslinux.cfg" 2160 boottype=isolinux 2105 2161 mkdir -p $bootdir 2106 2162 if [ "$BOOT_TYPE" != "BIOS" ]; then … … 2113 2169 if [ "$BOOT_TYPE" = "UEFI" ]; then 2114 2170 # UEFI 2115 lilodir=$bigdir/EFI/BOOT 2116 mkdir -p $lilodir 2117 liloconf="$lilodir/grub.conf" 2118 # grub.efi for rhel6 and grubx64.efi for rhel7 2119 lilobin="grub*.efi" 2171 efidir=$bigdir/EFI/BOOT 2172 FindSyslinux64EFI 2173 bootbin=$SYSLINUX64EFI 2174 bootconf="$efidir/syslinux.cfg" 2120 2175 2121 MakeBootConfFile grub > $liloconf2122 2176 else 2123 2177 # EFI 2124 lilodir=$bootdir 2125 mkdir -p $lilodir 2126 liloconf="$lilodir/elilo.conf" 2127 lilobin="elilo.efi" 2128 2129 MakeBootConfFile elilo > $liloconf 2178 efidir=$bootdir 2179 bootbin=`find /boot/efi -iname "elilo.efi" | head -1` 2180 boottype=elilo 2181 bootconf="$efidir/elilo.conf" 2182 2130 2183 fi 2131 2184 … … 2141 2194 mountefi=1 2142 2195 fi 2143 el=`find /boot/efi -iname "$lilobin"`2144 cp $ el $lilodir2196 mkdir -p $efidir 2197 cp $bootbin $efidir 2145 2198 if [ $mountefi -eq 1 ]; then 2146 2199 umount /boot/efi 2>&1 > /dev/null 2147 2200 fi 2148 else 2149 MakeBootConfFile isolinux > $bootdir/syslinux.cfg 2150 fi 2201 fi 2202 MakeBootConfFile $boottype > $bootconf 2151 2203 2152 2204 echo -en "Tarring and zipping the data content..."
Note:
See TracChangeset
for help on using the changeset viewer.