Changeset 3419 in MondoRescue
- Timestamp:
- Aug 21, 2015, 1:42:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi/mindi
r3417 r3419 1553 1553 LogFile "INFO: Unmounting $USBPART just in case" 1554 1554 umount $USBPART 2>> $LOGFILE 1>> $LOGFILE 1555 if [ $BOOT_TYPE= "BIOS" ]; then1555 if [ "$BOOT_TYPE" = "BIOS" ]; then 1556 1556 # If your key has no MBR it may cause an issue 1557 1557 # Use dd if=mbr.bin of=$USBDEVICE or ms-sys -s $USBDEVICE … … 1865 1865 LogFile "INFO: Creating vfat filesystem on $imagefile" 1866 1866 mkfs.vfat $imagefile >> $LOGFILE 2>> $LOGFILE 1867 if [ $BOOT_TYPE= "BIOS" ]; then1867 if [ "$BOOT_TYPE" = "BIOS" ]; then 1868 1868 # syslinux should be run on a local file (doen't work through NFS Cf: #297) 1869 1869 syslinux $imagefile >> $LOGFILE 2>> $LOGFILE … … 1876 1876 mount -t vfat -o loop $imagefile $mountpoint || LogAll "ERROR: Cannot mount (PBDI)" 1877 1877 1878 # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it 1879 if [ $BOOT_TYPE != "BIOS" ]; then 1880 if [ $BOOT_TYPE = "UNKNOWN" ]; then 1881 LogAll "ERROR: UNKNOWN BOOT_TYPE. Please report upstream" 1882 MindiExit -1 1883 fi 1884 # EFI or UEFI 1885 # BCO names are hard-coded for now 1886 if [ $BOOT_TYPE = "UEFI" ]; then 1887 # UEFI 1888 lilodir=$mountpoint/EFI 1889 mkdir -p $lilodir 1890 liloconf="$lilodir/grub.conf" 1891 lilobin="grub.efi" 1892 1893 MakeBootConfFile grub > $liloconf 1894 else 1895 # EFI 1896 lilodir=$mountpoint 1897 mkdir -p $lilodir 1898 liloconf="$mountpoint/elilo.conf" 1899 lilobin="elilo.efi" 1900 1901 MakeBootConfFile elilo > $liloconf 1902 fi 1903 1904 # Copy it so that CD-ROM menu entry is satisfied 1905 mountefi=0 1906 df -T | grep /boot/efi | grep -qE 'vfat' 1907 if [ $? -ne 0 ]; then 1908 mount /boot/efi 1909 if [ $? -ne 0 ]; then 1910 echo "You have to mount your (U)EFI partition when using mindi" 1911 MindiExit -1 1912 fi 1913 mountefi=1 1914 fi 1915 el=`find /boot/efi -iname $lilobin` 1916 cp $el $lilodir 1917 if [ $mountefi -eq 1 ]; then 1918 umount /boot/efi 2>&1 > /dev/null 1919 fi 1920 else 1921 MakeBootConfFile isolinux > $mountpoint/syslinux.cfg 1922 fi 1878 # copy boot stuff into it now generated in PrepareDataDisk 1879 (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz boot) 1880 1923 1881 LogFile "INFO: Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..." 1924 1882 cp -f $MINDI_TMP/initrd.img $mountpoint/initrd.img 2>> $LOGFILE 1925 if [ $BOOT_TYPE = "UEFI" ]; then1926 # for grub 0.97 the conf file is not read with the grub.efi file :-(1927 cp $liloconf $MINDI_TMP1928 fi1929 1883 if [ "$?" -ne "0" ] ; then 1930 1884 LogAll "ERROR: Failed to copy $MINDI_TMP/initrd.img to $mountpoint" … … 2073 2027 fi 2074 2028 2075 if [ $BOOT_TYPE = "UEFI" ]; then2076 # for grub 0.97 the conf file is not read with the grub.efi file :-(2077 # Not very nice, but needed2078 if [ -f $MINDI_TMP/grub.conf ]; then2079 mkdir -p $bigdir/boot/grub2080 cp $MINDI_TMP/grub.conf $bigdir/boot/grub2081 fi2082 fi2083 2084 2029 old_pwd=`pwd` 2085 2030 cd "$bigdir" … … 2132 2077 cp -pRdf $MINDI_TMP/$q $bigdir/tmp 2>> $LOGFILE 2133 2078 done 2079 fi 2080 2081 # copy (e)lilo/syslinux/grub/whatever stuff into it as well 2082 # to get it on the media (in addition to the boot part 2083 # and also to support UEFI boot mechanism 2084 bootdir=$bigdir/boot 2085 mkdir -p $bootdir 2086 if [ "$BOOT_TYPE" != "BIOS" ]; then 2087 if [ "$BOOT_TYPE" = "UNKNOWN" ]; then 2088 LogAll "ERROR: UNKNOWN BOOT_TYPE. Please report upstream" 2089 MindiExit -1 2090 fi 2091 # EFI or UEFI 2092 # BCO names are hard-coded for now 2093 if [ "$BOOT_TYPE" = "UEFI" ]; then 2094 # UEFI 2095 lilodir=$bootdir/EFI 2096 mkdir -p $lilodir 2097 liloconf="$lilodir/grub.conf" 2098 lilobin="grub.efi" 2099 2100 MakeBootConfFile grub > $liloconf 2101 else 2102 # EFI 2103 lilodir=$bootdir 2104 mkdir -p $lilodir 2105 liloconf="$lilodir/elilo.conf" 2106 lilobin="elilo.efi" 2107 2108 MakeBootConfFile elilo > $liloconf 2109 fi 2110 2111 # Copy it so that CD-ROM menu entry is satisfied 2112 mountefi=0 2113 df -T | grep /boot/efi | grep -qE 'vfat' 2114 if [ $? -ne 0 ]; then 2115 mount /boot/efi 2116 if [ $? -ne 0 ]; then 2117 echo "You have to mount your (U)EFI partition when using mindi" 2118 MindiExit -1 2119 fi 2120 mountefi=1 2121 fi 2122 el=`find /boot/efi -iname $lilobin` 2123 cp $el $lilodir 2124 if [ $mountefi -eq 1 ]; then 2125 umount /boot/efi 2>&1 > /dev/null 2126 fi 2127 else 2128 MakeBootConfFile isolinux > $bootdir/syslinux.cfg 2129 fi 2130 2131 if [ "$BOOT_TYPE" = "UEFI"] && [ -f "$lilodir/grub.conf" ]; then 2132 # for grub 0.97 the conf file is not read with the grub.efi file :-( 2133 # Not very nice, but needed it seems 2134 LogFile "Copying grub.conf file as we use legacy grub on UEFI" 2135 mkdir -p $bootdir/boot/grub 2136 cp $lilodir/grub.conf $bootdir/boot/grub 2134 2137 fi 2135 2138
Note:
See TracChangeset
for help on using the changeset viewer.