# EFI-boot CD...
ln ../../refind/refind_ia32.efi ./bootia32.efi
ln ../../refind/refind_x64.efi ./bootx64.efi
-ln ../../refind/refind.conf-sample ./refind.conf
+cp ../../refind/refind.conf-sample ./refind.conf
+sed -i '/#showtools/a showtools shell,memtest,gdisk,apple_recovery,csr_rotate,windows_recovery,mok_tool,about,shutdown,reboot,firmware' refind.conf
+sed -i '/#csr_values/a csr_values 10,77' refind.conf
mkdir icons
cd icons
ln ../../../refind/icons/* ./
cd ..
mkdir drivers_ia32
cd drivers_ia32
-ln ../../../refind/drivers_x64/* ./
+ln ../../../refind/drivers_ia32/* ./
cd ../../..
# Get the size of the binaries to go in the El Torito image in kB
mcopy -irefind-bin-$Version.img -s EFI shell*.efi ::/
# Make the ISO-9660 image file....
-mkisofs -A "Bootable rEFInd" -V "rEFInd $Version" -volset "rEFInd $Version" \
+mkisofs -A "Bootable rEFInd" -V "rEFInd_$Version" -volset "rEFInd_$Version" \
-J -r -v -x ./lost+found -o ../../refind-cd-$Version.iso \
-eltorito-alt-boot -efi-boot refind-bin-$Version.img \
-no-emul-boot ./
-# Below is like above, but also creates an El Torito entry for BIOS
-# booting. That's useless, but in case something flakes out without
-# it, I'll preserve this version for a while....
-#mkisofs -A "Bootable rEFInd" -V "rEFInd $Version" -volset "rEFInd $Version" \
-# -J -r -v -x ./lost+found -o ../../refind-cd-$Version.iso \
-# -b refind-bin-$Version.img -c boot.cat -no-emul-boot -boot-load-size 4 \
-# -eltorito-alt-boot -efi-boot refind-bin-$Version.img \
-# -no-emul-boot ./
-
# Create a bootable USB flash drive image, using the FAT filesystem
# created above and a stored partition table image (plus some empty
# sectors)....
#
-# Note: Seems to work on only a few systems, so I'm not distributing
-# the resulting images yet....
-#
-rm ../../refind-flashdrive-$Version.*
-cat $StartDir/flashparts.img refind-bin-$Version.img > refind-flashdrive-$Version.img
-cp $StartDir/README-flashdrive.txt ./
+rm -f ../../refind-flashdrive-$Version.*
+let FatSize=`du -s refind-bin-$Version.img | cut -f 1`
+let FatSize=($FatSize)+2048
+dd if=/dev/zero of=../../refind-flashdrive-$Version.img bs=1024 count=$FatSize
+sgdisk -n 1:2048:0 -t 1:EF00 -g ../../refind-flashdrive-$Version.img
+if [[ $? != 0 ]] ; then
+ echo "sgdisk failed! Exiting!"
+ exit 1
+fi
+dd if=refind-bin-$Version.img of=../../refind-flashdrive-$Version.img bs=512 seek=2048 conv=notrunc
+
cd ..
-mv refind-bin-$Version refind-flashdrive-$Version
-zip -9r ../refind-flashdrive-$Version.zip \
- refind-flashdrive-$Version/refind-flashdrive-$Version.img \
- refind-flashdrive-$Version/docs refind-flashdrive-$Version/LICENSE.txt \
- refind-flashdrive-$Version/install.sh \
- refind-flashdrive-$Version/COPYING.txt \
- refind-flashdrive-$Version/CREDITS.txt \
- refind-flashdrive-$Version/README.txt \
- refind-flashdrive-$Version/SHELLS.txt \
- refind-flashdrive-$Version/README-flashdrive.txt
-mv refind-flashdrive-$Version/refind-flashdrive-$Version.img ../
+mkdir refind-flashdrive-$Version
+ln ../refind-flashdrive-$Version.img refind-flashdrive-$Version
+cp $StartDir/README-flashdrive.txt $StartDir/COPYING.txt $StartDir/NEWS.txt \
+ $StartDir/CREDITS.txt $StartDir/LICENSE.txt $StartDir/SHELLS.txt refind-flashdrive-$Version
+zip -9r ../refind-flashdrive-$Version.zip refind-flashdrive-$Version
cd ../