3 # Script to prepare source code and binary distribution files of rEFInd.
4 # By Rod Smith, 3/11/2012
5 # Updated 11/8/2012 to do more things automatically
6 # Updated 12/6/2012 to sign binaries with the rEFInd MOK
8 # Usage: ./mkdistrib version
9 # where "version" is a version number
10 # MUST be run from an x86-64 system, on which the TianoCore build
11 # includes both X64 and IA32 build support ("TARGET_ARCH = IA32 X64"
12 # in Conf/target.txt). The MOK files must be available from a disk
13 # partition to be mounted via /etc/fstab at /mnt/refind.
17 SBSign
=`which sbsign 2> /dev/null`
20 KeysInfo
=`df $KeysDir 2> /dev/null | grep $KeysDir`
22 if [[ ! -n $SBSign ]] ; then
23 echo "Can't find sbsign binary! Aborting!"
27 if [[ ! -n $KeysInfo ]] ; then
31 if [[ $?
-ne 0 ]] ; then
32 echo "Error mounting $KeysDir! Aborting!"
37 # From here on, if there's an error, abort immediately.
42 # Prepare a place and copy files there....
43 mkdir
-p ..
/snapshots
/$1/refind-
$1/icons
44 cp --preserve=timestamps icons
/*icns ..
/snapshots
/$1/refind-
$1/icons
/
45 cp -a docs images include EfiLib libeg refind filesystems
install.sh mkrlconf.sh CREDITS.txt NEWS.txt BUILDING.txt COPYING.txt LICENSE.txt README.txt refind.inf Make.tiano Make.common Makefile refind.conf-sample ..
/snapshots
/$1/refind-
$1
46 cp $KeysDir/refind.cer
$KeysDir/refind.crt ..
/snapshots
/$1/refind-
$1/
48 # Go there and prepare a souce code zip file....
50 zip -9r refind-src-
$1.
zip refind-
$1
52 # Build the IA32 binaries
56 mkdir
-p refind-bin-
$1/refind
/drivers_ia32
57 cp --preserve=timestamps drivers_ia32
/*_ia32.efi refind-bin-
$1/refind
/drivers_ia32
/
58 cp --preserve=timestamps filesystems
/LICENSE
*txt refind-bin-
$1/refind
/drivers_ia32
/
59 cp refind
/refind_ia32.efi refind-bin-
$1/refind
/refind_ia32.efi
60 cp refind
/refind_ia32.efi
$StartDir/
62 # Build the X64 binaries
66 mkdir
-p refind-bin-
$1/refind
/drivers_x64
67 cp -a icons refind-bin-
$1/refind
/
68 for File
in `ls drivers_x64/*_x64.efi` ; do
69 $SBSign --key $KeysDir/refind.key
--cert $KeysDir/refind.crt
--output refind-bin-
$1/refind
/$File $File
71 cp --preserve=timestamps filesystems
/LICENSE
*txt refind-bin-
$1/refind
/drivers_x64
/
72 cp --preserve=timestamps refind.conf-sample refind-bin-
$1/refind
/
73 $SBSign --key $KeysDir/refind.key
--cert $KeysDir/refind.crt
--output refind-bin-
$1/refind
/refind_x64.efi refind
/refind_x64.efi
74 cp refind-bin-
$1/refind
/refind_x64.efi
$StartDir
75 cp -a COPYING.txt LICENSE.txt README.txt docs CREDITS.txt
install.sh mkrlconf.sh refind-bin-
$1
77 # Prepare the final .zip file and clean up
78 cp $KeysDir/refind.cer
$KeysDir/refind.crt refind-bin-
$1/
79 zip -9r ..
/refind-bin-
$1.
zip refind-bin-
$1