]> code.delx.au - refind/blob - mkcdimage
Added remaining main project files
[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
27 # Create hard links to the files so that they'll be suitable for an
28 # EFI-boot CD...
29 mkdir -p refind-bin-$Version/EFI/boot
30 cd refind-bin-$Version/EFI/boot
31 ln ../../refind/refind_ia32.efi ./bootia32.efi
32 ln ../../refind/refind_x64.efi ./bootx64.efi
33 ln ../../refind/refind.conf-sample ./refind.conf
34 mkdir icons
35 cd icons
36 ln ../../../refind/icons/* ./
37 cd ../../..
38
39 # Get the size of the binaries to go in the El Torito image in kB
40 ToritoSize=`du -s EFI | cut -f 1`
41 let ToritoSize=($ToritoSize)/28
42 let ToritoSize=($ToritoSize)*32
43
44 # Prepare a FAT filesystem image and populate it with the
45 # EFI boot files....
46 dd if=/dev/zero of=refind-bin-$Version.img bs=1024 count=$ToritoSize
47 mkdosfs -n "rEFInd.ET" refind-bin-$Version.img
48 mcopy -irefind-bin-$Version.img -s EFI ::/
49
50 # Make the ISO-9660 image file....
51 mkisofs -A "Bootable rEFInd" -V "rEFInd $Version" -volset "rEFInd $Version" \
52 -J -r -v -x ./lost+found -o ../../refind-cd-$Version.iso \
53 -b refind-bin-$Version.img -c boot.cat -no-emul-boot -boot-load-size 4 \
54 -eltorito-alt-boot -efi-boot refind-bin-$Version.img \
55 -no-emul-boot ./
56
57 cd ../../
58 rm -r temp/