From 5b793ec158cedd2c4420ef02fd8a23f9f53b2723 Mon Sep 17 00:00:00 2001 From: Evan Deaubl Date: Fri, 4 Sep 2015 21:21:06 -0700 Subject: [PATCH] grub: Add subpackage build grub-i386-efi --- srcpkgs/grub-i386-efi | 1 + srcpkgs/grub/template | 36 ++++++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 120000 srcpkgs/grub-i386-efi diff --git a/srcpkgs/grub-i386-efi b/srcpkgs/grub-i386-efi new file mode 120000 index 00000000000..2c8276e741a --- /dev/null +++ b/srcpkgs/grub-i386-efi @@ -0,0 +1 @@ +grub \ No newline at end of file diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template index 48be3dfeede..30237dc547d 100644 --- a/srcpkgs/grub/template +++ b/srcpkgs/grub/template @@ -1,7 +1,7 @@ # Template file for 'grub' pkgname=grub version=2.00 -revision=21 +revision=22 hostmakedepends="flex" makedepends="libusb-compat-devel ncurses-devel freetype-devel liblzma-devel device-mapper-devel font-unifont-bdf fuse-devel" @@ -15,7 +15,7 @@ distfiles="$GNU_SITE/grub/grub-$version.tar.xz" checksum=784ec38e7edc32239ad75b8e66df04dc8bfb26d88681bc9f627133a6eb85c458 only_for_archs="i686 i686-musl x86_64 x86_64-musl" -subpackages="grub-utils" +subpackages="grub-utils grub-i386-efi" case "$XBPS_TARGET_MACHINE" in x86_64*) subpackages+=" grub-x86_64-efi"; _GRUBX64=1;; esac @@ -40,6 +40,12 @@ do_configure() { cd $wrksrc/bios_build ../configure ${configure_args} --with-platform=pc + # build i386 EFI version + mkdir $wrksrc/efi_i386_build + cd $wrksrc/efi_i386_build + ../configure ${configure_args} --with-platform=efi \ + --target=i386 --disable-efiemu --libdir=/usr/lib + if [ -n "${_GRUBX64}" ]; then mkdir $wrksrc/efi_build cd $wrksrc/efi_build @@ -56,6 +62,10 @@ do_build() { cd $wrksrc/bios_build make ${makejobs} + msg_normal "Building i386 EFI grub...\n" + cd $wrksrc/efi_i386_build + make ${makejobs} + if [ -n "${_GRUBX64}" ]; then msg_normal "Building EFI grub...\n" cd $wrksrc/efi_build @@ -74,9 +84,19 @@ do_install() { rm -rf ${DESTDIR}/efi/{boot,etc,usr/{share,bin}} rm -f ${DESTDIR}/efi/usr/lib/grub/x86_64-efi/x86_64-* rm -f ${DESTDIR}/efi/usr/lib/grub/x86_64-efi/*.{module,image} - mv ${DESTDIR}/efi/* ${DESTDIR} - rmdir ${DESTDIR}/efi + cp -r ${DESTDIR}/efi/* ${DESTDIR} + rm -rf ${DESTDIR}/efi fi + + cd $wrksrc/efi_i386_build + make DESTDIR=$DESTDIR/efi_i386 install + # Remove non-platform specific files + rm -rf ${DESTDIR}/efi_i386/{boot,etc,usr/{share,bin}} + rm -f ${DESTDIR}/efi_i386/usr/lib/grub/i386-efi/i386-* + rm -f ${DESTDIR}/efi_i386/usr/lib/grub/i386-efi/*.{module,image} + cp -r ${DESTDIR}/efi_i386/* ${DESTDIR} + rm -rf ${DESTDIR}/efi_i386 + cd $wrksrc/bios_build make DESTDIR=$DESTDIR install @@ -123,3 +143,11 @@ grub-x86_64-efi_package() { vmove usr/lib/grub/x86_64-efi } } +grub-i386-efi_package() { + noarch=yes + depends="grub>=$version dosfstools efibootmgr" + short_desc+=" - i386 EFI support" + pkg_install() { + vmove usr/lib/grub/i386-efi + } +}