wok-next annotate grub2/receipt @ rev 20643
fix grub2-efi arch for x86_64 (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue May 01 15:46:52 2018 +0200 (2018-05-01) |
parents | b127c8621a46 |
children | 507b798ce12b |
rev | line source |
---|---|
pascal@20355 | 1 # SliTaz package receipt v2. |
pascal@4478 | 2 |
pascal@4478 | 3 PACKAGE="grub2" |
pascal@20355 | 4 VERSION="2.02" |
pascal@4478 | 5 CATEGORY="base-system" |
pascal@20355 | 6 SHORT_DESC="GRUB2 boot loader" |
pascal@4478 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@14999 | 8 LICENSE="GPL3" |
pascal@14999 | 9 WEB_SITE="http://www.gnu.org/software/grub/" |
al@20436 | 10 LFS="http://www.linuxfromscratch.org/lfs/view/stable/chapter06/grub.html" |
al@20436 | 11 |
al@20436 | 12 TARBALL="grub-$VERSION.tar.xz" |
pascal@14999 | 13 WGET_URL="ftp://ftp.gnu.org/gnu/grub/$TARBALL" |
pascal@14999 | 14 |
pascal@13115 | 15 BUILD_DEPENDS="flex bison zlib-dev xz-dev freetype-dev ncurses-dev \ |
pascal@13115 | 16 libusb-compat-dev libusb-dev libdevmapper-dev" |
al@20436 | 17 SPLIT="grub2 grub2-efi:efi" |
pascal@4478 | 18 |
al@20436 | 19 compile_rules() { |
pascal@20355 | 20 sed -i 's|sys/types.h>|&\n#include <sys/sysmacros.h>|' \ |
pascal@20356 | 21 util/getroot.c grub-core/kern/emu/hostdisk.c |
pascal@20355 | 22 |
pascal@18709 | 23 # CVE-2015-8370 |
pascal@18710 | 24 sed -i "s/'.b'/& \\&\\& cur_len/" grub-core/lib/crypto.c grub-core/normal/auth.c |
pascal@18709 | 25 |
pascal@13386 | 26 # Fixes for flex 2.5.37 |
al@20436 | 27 export CFLAGS="-Wno-error=sign-compare -Wno-error=unused-value" |
pascal@20355 | 28 sed -i '/#undef gets/{N;s/.*/#ifdef gets\n&\n#endif/}' grub-core/gnulib/stdio*h |
pascal@13386 | 29 sed -i 's/YY_FATAL_ERROR/REMOVED_&/' grub-core/script/yylex.l |
pascal@20355 | 30 |
al@20436 | 31 case $SET in |
al@20436 | 32 '') |
al@20436 | 33 #chmod +x install-sh |
al@20436 | 34 ./configure $CONFIGURE_ARGS && |
al@20436 | 35 make $MAKEFLAGS && |
al@20436 | 36 make DESTDIR=$DESTDIR install || return 1 |
pascal@4478 | 37 |
al@20436 | 38 # Example config file (grub.cfg) |
al@20436 | 39 install -Dm0644 $stuff/example-grub.cfg $install/boot/grub/example-grub.cfg |
al@20436 | 40 ;; |
al@20436 | 41 efi) |
pascal@20642 | 42 case $ARCH in |
pascal@20642 | 43 i?86) bootimg=bootia32.efi |
pascal@20642 | 44 EFI_ARCH=i386;; |
pascal@20642 | 45 x86_64) bootimg=bootx64.efi |
pascal@20642 | 46 EFI_ARCH=x86_64;; |
pascal@20642 | 47 esac |
pascal@20642 | 48 export EFI_ARCH |
al@20436 | 49 ./configure \ |
al@20436 | 50 --with-platform=efi \ |
al@20436 | 51 --target=$EFI_ARCH \ |
al@20436 | 52 --program-prefix="" \ |
al@20436 | 53 $CONFIGURE_ARGS && |
al@20436 | 54 make clean && |
al@20436 | 55 make $MAKEFLAGS || return 1 |
al@20436 | 56 |
al@20436 | 57 cd grub-core |
al@20436 | 58 ../grub-mkimage \ |
al@20436 | 59 -d . \ |
pascal@20642 | 60 -o ../$bootimg \ |
pascal@20642 | 61 -O $EFI_ARCH-efi \ |
al@20436 | 62 -p /boot/grub \ |
al@20436 | 63 ntfs hfs appleldr boot cat efi_gop efi_uga elf fat hfsplus \ |
al@20436 | 64 iso9660 linux keylayouts memdisk minicmd part_apple ext2 extcmd \ |
al@20436 | 65 xfs xnu part_bsd part_gpt search search_fs_file chain btrfs \ |
al@20436 | 66 loadbios loadenv lvm minix minix2 reiserfs memrw mmap msdospart \ |
al@20436 | 67 scsi loopback normal configfile gzio all_video efi_gop efi_uga \ |
al@20436 | 68 gfxterm gettext echo boot chain || return 1 |
al@20436 | 69 |
pascal@20643 | 70 install -Dm644 $src/$bootimg $install/boot/efi/boot/$bootimg |
al@20436 | 71 ;; |
pascal@20355 | 72 esac |
pascal@13842 | 73 } |
pascal@13842 | 74 |
al@20436 | 75 genpkg_rules() { |
al@20436 | 76 case $PACKAGE in |
al@20436 | 77 grub2) |
al@20436 | 78 copy @std |
al@20436 | 79 DEPENDS="zlib freetype ncurses libusb-compat grep libusb libdevmapper" |
al@20436 | 80 TAGS="LFS" |
al@20436 | 81 ;; |
al@20436 | 82 grub2-efi) |
al@20436 | 83 copy @std |
al@20436 | 84 DEPENDS=" " |
al@20436 | 85 ;; |
al@20436 | 86 esac |
al@20436 | 87 } |
pascal@13841 | 88 |
al@20436 | 89 post_install_grub2() { |
al@20436 | 90 [ -n "$quiet" ] || cat <<EOT |
pascal@13841 | 91 |
al@20436 | 92 .-------------------------------------------------------. |
al@20436 | 93 | # To install grub to your sda MBR | |
al@20436 | 94 | grub-install /dev/sda | |
al@20436 | 95 |-------------------------------------------------------| |
al@20436 | 96 | # To generate a configuration file | |
al@20436 | 97 | grub-mkconfig -o /boot/grub/grub.cfg | |
al@20436 | 98 |-------------------------------------------------------| |
al@20436 | 99 | # You can learn from /boot/grub/example-grub.cfg too. | |
al@20436 | 100 '-------------------------------------------------------' |
pascal@13841 | 101 EOT |
pascal@4478 | 102 } |