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 [--nosign]
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.
16 if [[ $2 == "--nosign" ]] ; then
23 SBSign
=`which sbsign 2> /dev/null`
26 KeysInfo
=`df $KeysDir 2> /dev/null | grep $KeysDir`
28 if [[ ! -n $SBSign && $SignIt == 1 ]] ; then
29 echo "Can't find sbsign binary! Aborting!"
33 if [[ ! -n $KeysInfo && $SignIt == 1 ]] ; then
35 if [[ $?
-ne 0 ]] ; then
36 echo "Error mounting $KeysDir! Aborting!"
42 # From here on, if there's an error, abort immediately.
47 # Prepare a place and copy files there....
48 mkdir
-p ..
/snapshots
/$1/refind-
$1/icons
49 cp --preserve=timestamps icons
/*.icns ..
/snapshots
/$1/refind-
$1/icons
/
50 cp -a docs images keys fonts banners include EfiLib libeg mok refind filesystems refind.spec
install.sh mkrlconf.sh mvrefind.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
52 # Go there and prepare a souce code zip file....
54 zip -9r refind-src-
$1.
zip refind-
$1
56 # Build the IA32 binaries
60 mkdir
-p refind-bin-
$1/refind
/drivers_ia32
61 cp --preserve=timestamps drivers_ia32
/*_ia32.efi refind-bin-
$1/refind
/drivers_ia32
/
62 cp --preserve=timestamps filesystems
/LICENSE
*txt refind-bin-
$1/refind
/drivers_ia32
/
63 cp refind
/refind_ia32.efi refind-bin-
$1/refind
/refind_ia32.efi
64 cp refind
/refind_ia32.efi
$StartDir/
66 # Build the X64 binaries
70 mkdir
-p refind-bin-
$1/refind
/drivers_x64
71 cp -a icons refind-bin-
$1/refind
/
72 if [[ $SignIt == 1 ]] ; then
73 for File
in `ls drivers_x64/*_x64.efi` ; do
74 $SBSign --key $KeysDir/refind.key
--cert $KeysDir/refind.crt
--output refind-bin-
$1/refind
/$File $File
77 cp --preserve=timestamps drivers_x64
/*_x64.efi refind-bin-
$1/refind
/drivers_x64
/
79 cp --preserve=timestamps filesystems
/LICENSE
*txt refind-bin-
$1/refind
/drivers_x64
/
80 cp --preserve=timestamps refind.conf-sample refind-bin-
$1/refind
/
81 if [[ $SignIt == 1 ]] ; then
82 $SBSign --key $KeysDir/refind.key
--cert $KeysDir/refind.crt
--output refind-bin-
$1/refind
/refind_x64.efi refind
/refind_x64.efi
84 cp refind
/refind_x64.efi refind-bin-
$1/refind
/refind_x64.efi
86 cp refind-bin-
$1/refind
/refind_x64.efi
$StartDir
87 cp -a docs keys banners fonts COPYING.txt LICENSE.txt README.txt CREDITS.txt NEWS.txt
install.sh mkrlconf.sh mvrefind.sh refind-bin-
$1
89 # Prepare the final .zip file
90 zip -9r ..
/refind-bin-
$1.
zip refind-bin-
$1
94 # Prepare the RPM & Debian package files
95 cp refind-src-
$1.
zip ~
/rpmbuild
/SOURCES
/
96 rpmbuild
-ba $StartDir/refind.spec
97 mv ~
/rpmbuild
/RPMS
/*/refind-
$1* .
/
98 mv ~
/rpmbuild
/SRPMS
/refind-
$1* .
/
99 sudo alien
--to-deb -k -c refind-
$1*x86_64.rpm
100 sudo chown rodsmith
: refind
*deb
101 rm ~
/rpmbuild
/SOURCES
/refind-src-
$1.
zip
104 if [[ $SignIt == 1 ]] ; then