2011-08-08 19:29:08 +08:00
|
|
|
# Maintainer: Ronald van Haren <ronald.chakra.org>
|
|
|
|
# Contributor: Keshav P R <skodabenz at rocketmail dot com>
|
|
|
|
|
|
|
|
# The src pkg includes grub2_bzr_export.sh to create newer grub-extras snapshots. Modify the paths in it accordingly.
|
2010-11-14 06:20:42 +08:00
|
|
|
|
2011-06-12 21:55:37 +08:00
|
|
|
# _grub2_rev=3238
|
2010-11-14 06:20:42 +08:00
|
|
|
|
2011-06-12 21:55:37 +08:00
|
|
|
_grub2_lua_ver=20
|
|
|
|
_grub2_gpxe_ver=12
|
|
|
|
_grub2_ntldr_ver=17
|
|
|
|
_grub2_915_ver=7
|
|
|
|
|
2011-08-17 07:04:18 +08:00
|
|
|
pkgname=('grub2-common' 'grub2-bios' 'grub2-efi-x32')
|
2011-06-12 21:55:37 +08:00
|
|
|
pkgbase="grub2"
|
|
|
|
pkgver='1.99'
|
2011-12-05 02:29:32 +08:00
|
|
|
pkgrel=6
|
2010-11-14 06:20:42 +08:00
|
|
|
url="http://www.gnu.org/software/grub/"
|
|
|
|
arch=('i686' 'x86_64')
|
|
|
|
license=('GPL3')
|
2011-08-08 19:29:08 +08:00
|
|
|
epoch=1
|
2011-06-12 21:55:37 +08:00
|
|
|
makedepends=('bdf-unifont' 'python2' 'xz' 'autogen' 'texinfo' 'help2man' 'gettext' 'device-mapper')
|
|
|
|
options=(strip purge docs zipman !emptydirs)
|
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
# "http://alpha.gnu.org/gnu/grub/grub-${pkgver}.tar.xz"
|
2011-06-12 21:55:37 +08:00
|
|
|
source=("ftp://ftp.gnu.org/gnu/grub/grub-1.99.tar.xz"
|
2011-12-01 00:36:11 +08:00
|
|
|
"http://chakra-linux.org/sources/grub2/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz"
|
|
|
|
"http://chakra-linux.org/sources/grub2/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz"
|
|
|
|
"http://chakra-linux.org/sources/grub2/grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz"
|
|
|
|
"http://chakra-linux.org/sources/grub2/grub2_extras_915resolution_r${_grub2_915_ver}.tar.xz"
|
|
|
|
'chakra_grub2_mkconfig_fixes.patch'
|
|
|
|
'grub.default'
|
|
|
|
'grub.cfg'
|
|
|
|
'20_memtest86+'
|
|
|
|
'grub2_bzr_export.sh'
|
2011-08-08 19:29:08 +08:00
|
|
|
'update-grub')
|
2011-06-12 21:55:37 +08:00
|
|
|
|
|
|
|
noextract=("grub2_extras_lua_r${_grub2_lua_ver}.tar.xz"
|
2011-12-01 00:36:11 +08:00
|
|
|
"grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz"
|
|
|
|
"grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz"
|
|
|
|
"grub2_extras_915resolution_r${_grub2_915_ver}.tar.xz")
|
2011-06-12 21:55:37 +08:00
|
|
|
|
|
|
|
sha1sums=('a5ae9558f30ce7757a76aa130088b053a87e2fb6'
|
|
|
|
'd21ca5033f7069cbb36934cdb71f57a1c7829234'
|
|
|
|
'6c58eee654fa4eb7f057275b330710ffd4a9e989'
|
|
|
|
'0e50955141a45918fcf56f3a5e15fb477f0448a7'
|
|
|
|
'f2a5f1d5b75bd3286b63aefaf5e6553aa03e772b'
|
2011-12-04 05:49:36 +08:00
|
|
|
'd44bb9c9b95a6999560d3b7300e05e14e85fcfc6'
|
|
|
|
'b517e8ce88e2edfdf97129a03a747258d4a2b44d'
|
2011-08-08 19:29:08 +08:00
|
|
|
'8948d89537c12a4202df7c001e65a77030bbe5a3'
|
|
|
|
'82a27eca5277218cf57c6c5767e0b17a72f62229'
|
|
|
|
'beb31419045db70fee7401aa6448c220a491e2a3'
|
|
|
|
'5770fbb559b1f463e1a735a1463d24af489bcc3e')
|
2010-11-14 06:20:42 +08:00
|
|
|
|
|
|
|
build() {
|
2011-12-01 00:36:11 +08:00
|
|
|
# set architecture dependent variables
|
|
|
|
_HOST="${CARCH}"
|
|
|
|
[ "${CARCH}" = 'i686' ] && _EFIEMU="--disable-efiemu"
|
|
|
|
[ "${CARCH}" = 'x86_64' ] && _EFIEMU="--enable-efiemu"
|
|
|
|
|
|
|
|
build_grub2-common_and_bios
|
|
|
|
build_grub2-efi
|
2010-11-14 06:20:42 +08:00
|
|
|
}
|
|
|
|
|
2011-06-12 21:55:37 +08:00
|
|
|
build_grub2-common_and_bios() {
|
2011-12-01 00:36:11 +08:00
|
|
|
# copy the source for building the common/bios package
|
|
|
|
cp -r "${srcdir}/grub-${pkgver}" "${srcdir}/grub2_bios-${pkgver}"
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
## Apply Chakra specific fixes to enable grub2-mkconfig detect Chakra kernels and initramfs
|
|
|
|
cd "${srcdir}/grub2_bios-${pkgver}"
|
|
|
|
patch -Np1 -i "${srcdir}/chakra_grub2_mkconfig_fixes.patch"
|
|
|
|
|
|
|
|
# add the grub-extra sources
|
|
|
|
export GRUB_CONTRIB="${srcdir}/grub2_bios-${pkgver}/grub2-extras"
|
|
|
|
install -d "${srcdir}/grub2_bios-${pkgver}/grub2-extras"
|
|
|
|
bsdtar xf "${srcdir}/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz" \
|
|
|
|
-C "${srcdir}/grub2_bios-${pkgver}/grub2-extras"
|
|
|
|
bsdtar xf "${srcdir}/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz" \
|
|
|
|
-C "${srcdir}/grub2_bios-${pkgver}/grub2-extras"
|
|
|
|
bsdtar xf "${srcdir}/grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz" \
|
|
|
|
-C "${srcdir}/grub2_bios-${pkgver}/grub2-extras"
|
|
|
|
bsdtar xf "${srcdir}/grub2_extras_915resolution_r${_grub2_915_ver}.tar.xz" \
|
|
|
|
-C "${srcdir}/grub2_bios-${pkgver}/grub2-extras"
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
cd "${srcdir}/grub2_bios-${pkgver}"
|
2010-11-14 06:20:42 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
## Need to use python2
|
|
|
|
sed -i 's|python|python2|' autogen.sh
|
|
|
|
|
|
|
|
# start the actual build process
|
|
|
|
./autogen.sh
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-05 02:29:32 +08:00
|
|
|
## fix unifont.bdf location so grub-mkfont can create *.pf2 files
|
|
|
|
sed -i 's|/usr/share/fonts/unifont|/usr/share/fonts/misc|' configure
|
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
# mkdir ${srcdir}/grub2_bios-${pkgver}/BUILD_BIOS
|
|
|
|
# cd ${srcdir}/grub2_bios-${pkgver}/BUILD_BIOS
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
CFLAGS="" ./configure \
|
|
|
|
--with-platform=pc --enable-mm-debug \
|
|
|
|
"${_EFIEMU}" --host="${CARCH}-unknown-linux-gnu" \
|
|
|
|
--enable-grub-mkfont --prefix=/usr \
|
|
|
|
--bindir=/bin --sbindir=/sbin \
|
|
|
|
--mandir=/usr/share/man --infodir=/usr/share/info \
|
|
|
|
--sysconfdir=/etc --enable-nls \
|
|
|
|
--program-transform-name=s,grub,grub,
|
|
|
|
|
|
|
|
CFLAGS="" make
|
2011-06-12 21:55:37 +08:00
|
|
|
}
|
2010-11-14 06:20:42 +08:00
|
|
|
|
2011-06-12 21:55:37 +08:00
|
|
|
build_grub2-efi() {
|
2011-12-01 00:36:11 +08:00
|
|
|
# copy the source for building the efi package
|
|
|
|
cp -r "${srcdir}/grub-${pkgver}" "${srcdir}/grub2_efi-${pkgver}"
|
|
|
|
|
|
|
|
# add the grub-extra sources
|
|
|
|
export GRUB_CONTRIB="${srcdir}/grub2_efi-${pkgver}/grub2-extras"
|
|
|
|
install -d "${srcdir}/grub2_efi-${pkgver}/grub2-extras"
|
|
|
|
bsdtar xf "${srcdir}/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz" \
|
|
|
|
-C "${srcdir}/grub2_efi-${pkgver}/grub2-extras"
|
|
|
|
bsdtar xf "${srcdir}/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz" \
|
|
|
|
-C "${srcdir}/grub2_efi-${pkgver}/grub2-extras"
|
|
|
|
|
|
|
|
cd "${srcdir}/grub2_efi-${pkgver}"
|
|
|
|
|
|
|
|
## Need to use python2
|
|
|
|
sed -i 's|python|python2|' autogen.sh
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
# start the actual build process
|
|
|
|
./autogen.sh
|
|
|
|
|
|
|
|
CFLAGS="" ./configure \
|
|
|
|
--with-platform=efi --target=i386 \
|
|
|
|
--enable-mm-debug --disable-efiemu \
|
|
|
|
--host="${CARCH}-unknown-linux-gnu" \
|
|
|
|
--prefix=/usr --bindir=/bin \
|
|
|
|
--sbindir=/sbin --mandir=/usr/share/man \
|
|
|
|
--infodir=/usr/share/info --sysconfdir=/etc \
|
|
|
|
--enable-nls --program-transform-name=s,grub,grub,
|
|
|
|
|
|
|
|
CFLAGS="" make
|
2010-11-14 06:20:42 +08:00
|
|
|
}
|
|
|
|
|
2011-06-12 21:55:37 +08:00
|
|
|
package_grub2-common() {
|
2011-12-01 00:36:11 +08:00
|
|
|
pkgdesc="The GNU GRand Unified Bootloader version 2 - Files common for all platforms"
|
|
|
|
install="grub2.install"
|
|
|
|
depends=('xz' 'freetype2' 'device-mapper' 'gettext' 'texinfo')
|
|
|
|
conflicts=('grub')
|
|
|
|
backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
|
|
|
|
|
|
|
|
cd "${srcdir}/grub2_bios-${pkgver}"
|
|
|
|
make DESTDIR="${pkgdir}" install
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
install -Dm755 "${pkgdir}/sbin/grub-install" "${pkgdir}/sbin/grub_bios-install"
|
|
|
|
install -Dm755 "${pkgdir}/sbin/grub-install" "${pkgdir}/sbin/grub_efi_x86_64-install"
|
|
|
|
install -Dm755 "${pkgdir}/sbin/grub-install" "${pkgdir}/sbin/grub_efi_i386-install"
|
|
|
|
|
|
|
|
# install update-burg script
|
|
|
|
install -Dm755 "${srcdir}/update-grub" "${pkgdir}/sbin/update-grub"
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
sed -i "s|^\(target_cpu\)=.*|\1=i386|; \
|
|
|
|
s|^\(platform\)=.*|\1=pc|" \
|
|
|
|
"${pkgdir}/sbin/grub_bios-install"
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
sed -i "s|^\(target_cpu\)=.*|\1=x86_64|; \
|
|
|
|
s|^\(platform\)=.*|\1=efi|" \
|
|
|
|
"${pkgdir}/sbin/grub_efi_x86_64-install"
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
sed -i "s|^\(target_cpu\)=.*|\1=i386|; \
|
|
|
|
s|^\(platform\)=.*|\1=efi|" \
|
|
|
|
"${pkgdir}/sbin/grub_efi_i386-install"
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
## install extra /etc/grub.d/ files
|
|
|
|
install -Dm755 "${srcdir}/20_memtest86+" "${pkgdir}/etc/grub.d/20_memtest86+"
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
## install /etc/default/grub (used by grub-mkconfig)
|
|
|
|
install -Dm644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub"
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
## install grub.cfg (needed so it doesn't get removed on upgrading because it was previously here)
|
|
|
|
install -Dm644 "${srcdir}/grub.cfg" "${pkgdir}/boot/grub/grub.cfg"
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
# remove platform specific files
|
|
|
|
rm -rf "${pkgdir}/usr/lib/grub/i386-pc"
|
2011-06-12 21:55:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
package_grub2-bios() {
|
2011-12-01 00:36:11 +08:00
|
|
|
pkgdesc="The GNU GRand Unified Bootloader version 2 - Built for PC BIOS"
|
2011-12-01 00:39:40 +08:00
|
|
|
depends=("grub2-common=${pkgver}")
|
2011-12-01 00:36:11 +08:00
|
|
|
replaces=('grub2')
|
|
|
|
provides=('grub2')
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
cd "${srcdir}/grub2_bios-${pkgver}"
|
|
|
|
make DESTDIR="${pkgdir}" install
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
## remove non platform-specific files
|
|
|
|
rm -rf "${pkgdir}"/{boot,bin,sbin,etc,usr/share}
|
|
|
|
rm "${pkgdir}/usr/lib/grub"/{grub-mkconfig_lib,update-grub_lib}
|
2011-06-12 21:55:37 +08:00
|
|
|
}
|
|
|
|
|
2011-08-17 07:04:18 +08:00
|
|
|
package_grub2-efi-x32() {
|
2011-12-01 00:36:11 +08:00
|
|
|
pkgdesc="The GNU GRand Unified Bootloader version 2 - i386 UEFI version"
|
2011-12-01 00:39:40 +08:00
|
|
|
depends=("grub2-common=${pkgver}" 'dosfstools' 'efibootmgr')
|
2011-12-01 00:36:11 +08:00
|
|
|
optdepends=('mtools')
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
cd "${srcdir}/grub2_efi-${pkgver}"
|
|
|
|
make DESTDIR="${pkgdir}" install
|
2011-06-12 21:55:37 +08:00
|
|
|
|
2011-12-01 00:36:11 +08:00
|
|
|
## remove non platform-specific files
|
|
|
|
rm -rf "${pkgdir}"/{boot,bin,sbin,etc,usr/share}
|
|
|
|
rm "${pkgdir}/usr/lib/grub"/{grub-mkconfig_lib,update-grub_lib}
|
2011-06-12 21:55:37 +08:00
|
|
|
}
|
2011-12-01 00:36:11 +08:00
|
|
|
|
|
|
|
# vim:set ts=2 sw=2 et:
|