wok-next view grub2/receipt @ rev 20652

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