3 # Script to create a bootable CD image file containing rEFInd.
6 # ./mkcdimage {version}
8 # where {version} is the rEFInd version number.
10 # This script relies on the mcopy utility.
12 # The script creates an image file from the binary package
13 # stored in ../snapshots/{version}/refind-bin-{version}.zip
14 # The resulting CD image file is stored in
15 # ../snapshots/{version}/refind-cd-{version}.iso
20 # Unzip the binary archive file....
21 cd ..
/snapshots
/$Version
25 unzip ..
/refind-bin-
$Version.
zip
26 cp $StartDir/SHELLS.txt .
/refind-bin-
$Version
28 # Create a boot directory and (temporarily) copy the EFI shell
30 mkdir
-p refind-bin-
$Version/EFI
/boot
31 cd refind-bin-
$Version/EFI
/boot
32 cp $StartDir/shell
*.efi .
/
34 # Create hard links to the rEFInd files so that they'll be suitable for an
36 ln ..
/..
/refind
/refind_ia32.efi .
/bootia32.efi
37 ln ..
/..
/refind
/refind_x64.efi .
/bootx64.efi
38 ln ..
/..
/refind
/refind.conf-sample .
/refind.conf
41 ln ..
/..
/..
/refind
/icons
/* .
/
44 # Get the size of the binaries to go in the El Torito image in kB
45 ToritoSize
=`du -s EFI | cut -f 1`
46 let ToritoSize
=($ToritoSize)/28
47 let ToritoSize
=($ToritoSize)*32
49 # Move the EFI shell files back to the root where they belong
50 # (They were in EFI/boot just so they'd get counted in ToritoSize)
51 mv EFI
/boot
/shell
*.efi .
/
53 # Prepare a FAT filesystem image and populate it with the
55 dd if=/dev
/zero of
=refind-bin-
$Version.img bs
=1024 count
=$ToritoSize
56 mkdosfs
-n "rEFInd.ET" refind-bin-
$Version.img
57 mcopy
-irefind-bin-$Version.img
-s EFI shell
*.efi
::/
59 # Make the ISO-9660 image file....
60 mkisofs
-A "Bootable rEFInd" -V "rEFInd $Version" -volset "rEFInd $Version" \
61 -J -r -v -x .
/lost
+found
-o ..
/..
/refind-cd-
$Version.iso \
62 -eltorito-alt-boot -efi-boot refind-bin-
$Version.img \
65 # Below is like above, but also creates an El Torito entry for BIOS
66 # booting. That's useless, but in case something flakes out without
67 # it, I'll preserve this version for a while....
68 #mkisofs -A "Bootable rEFInd" -V "rEFInd $Version" -volset "rEFInd $Version" \
69 # -J -r -v -x ./lost+found -o ../../refind-cd-$Version.iso \
70 # -b refind-bin-$Version.img -c boot.cat -no-emul-boot -boot-load-size 4 \
71 # -eltorito-alt-boot -efi-boot refind-bin-$Version.img \
74 # Create a bootable USB flash drive image, using the FAT filesystem
75 # created above and a stored partition table image (plus some empty
77 rm ..
/..
/refind-flashdrive-
$Version.
*
78 cat $StartDir/flashparts.img refind-bin-
$Version.img
> refind-flashdrive-
$Version.img
79 cp $StartDir/README-flashdrive.txt .
/
81 mv refind-bin-
$Version refind-flashdrive-
$Version
82 zip -9r ..
/refind-flashdrive-
$Version.
zip \
83 refind-flashdrive-
$Version/refind-flashdrive-
$Version.img \
84 refind-flashdrive-
$Version/docs refind-flashdrive-
$Version/LICENSE.txt \
85 refind-flashdrive-
$Version/COPYING.txt \
86 refind-flashdrive-
$Version/CREDITS.txt \
87 refind-flashdrive-
$Version/README.txt \
88 refind-flashdrive-
$Version/SHELLS.txt \
89 refind-flashdrive-
$Version/README-flashdrive.txt
90 mv refind-flashdrive-
$Version/refind-flashdrive-
$Version.img ..
/
94 # Zip up the optical disc image....
95 rm refind-cd-
$Version.
zip
96 zip -9 refind-cd-
$Version.
zip refind-cd-
$Version.iso