]> code.delx.au - refind/blob - mkcdimage
Added max_tags option; new shell filenames; new rEFIt icon
[refind] / mkcdimage
1 #!/bin/bash
2 #
3 # Script to create a bootable CD image file containing rEFInd.
4 # Usage:
5 #
6 # ./mkcdimage {version}
7 #
8 # where {version} is the rEFInd version number.
9 #
10 # This script relies on the mcopy utility.
11 #
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
16
17 StartDir=`pwd`
18 Version=$1
19
20 # Unzip the binary archive file....
21 cd ../snapshots/$Version
22 rm -rf temp
23 mkdir temp
24 cd temp
25 unzip ../refind-bin-$Version.zip
26 cp $StartDir/SHELLS.txt ./refind-bin-$Version
27
28 # Create a boot directory and (temporarily) copy the EFI shell
29 # files to it....
30 mkdir -p refind-bin-$Version/EFI/boot
31 cd refind-bin-$Version/EFI/boot
32 cp $StartDir/shell*.efi ./
33
34 # Create hard links to the rEFInd files so that they'll be suitable for an
35 # EFI-boot CD...
36 ln ../../refind/refind_ia32.efi ./bootia32.efi
37 ln ../../refind/refind_x64.efi ./bootx64.efi
38 ln ../../refind/refind.conf-sample ./refind.conf
39 mkdir icons
40 cd icons
41 ln ../../../refind/icons/* ./
42 cd ../../..
43
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
48
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 ./
52
53 # Prepare a FAT filesystem image and populate it with the
54 # EFI boot files....
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 ::/
58
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 \
63 -no-emul-boot ./
64
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 \
72 # -no-emul-boot ./
73
74 cd ../../
75 rm -r temp/