wok-next view grub2/receipt @ rev 21159
updated diffutils (3.6 -> 3.7)
author | Hans-G?nter Theisgen |
---|---|
date | Wed Feb 20 08:46:59 2019 +0100 (2019-02-20) |
parents | d5aab818505e |
children | 8016a8b90a2d |
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"
11 REPOLOGY="grub"
13 TARBALL="grub-$VERSION.tar.xz"
14 WGET_URL="ftp://ftp.gnu.org/gnu/grub/$TARBALL"
16 BUILD_DEPENDS="flex bison zlib-dev xz-dev freetype-dev ncurses-dev \
17 libusb-compat-dev libusb-dev libdevmapper-dev"
18 SPLIT="$PACKAGE-efi:efi $PACKAGE-efi-modules:efi"
20 compile_rules() {
21 sed -i 's|sys/types.h>|&\n#include <sys/sysmacros.h>|' \
22 util/getroot.c grub-core/kern/emu/hostdisk.c
24 # CVE-2015-8370
25 sed -i "s/'.b'/& \\&\\& cur_len/" grub-core/lib/crypto.c grub-core/normal/auth.c
27 # Fixes for flex 2.5.37
28 export CFLAGS="-Wno-error=sign-compare -Wno-error=unused-value"
29 sed -i '/#undef gets/{N;s/.*/#ifdef gets\n&\n#endif/}' grub-core/gnulib/stdio*h
30 sed -i 's/YY_FATAL_ERROR/REMOVED_&/' grub-core/script/yylex.l
32 case $SET in
33 '')
34 #chmod +x install-sh
35 ./configure \
36 --disable-werror \
37 $CONFIGURE_ARGS &&
38 make $MAKEFLAGS &&
39 make DESTDIR=$install install || return 1
41 # Example config file (grub.cfg)
42 install -Dm0644 $stuff/example-grub.cfg $install/boot/grub/example-grub.cfg
43 ;;
44 efi)
45 case $ARCH in
46 i?86)
47 bootimg=bootia32.efi
48 EFI_ARCH=i386;;
49 x86_64)
50 bootimg=bootx64.efi
51 EFI_ARCH=x86_64;;
52 esac
53 export EFI_ARCH
54 ./configure \
55 --with-platform=efi \
56 --target=$EFI_ARCH \
57 --program-prefix="" \
58 $CONFIGURE_ARGS &&
59 make clean &&
60 make $MAKEFLAGS || return 1
62 cd grub-core
63 ../grub-mkimage \
64 -d . \
65 -o ../$bootimg \
66 -O $EFI_ARCH-efi \
67 -p /boot/grub \
68 lsefisystab lssal lsefimmap lsacpi ls \
69 ntfs hfs appleldr boot cat efi_gop efi_uga elf fat hfsplus \
70 iso9660 linux keylayouts memdisk minicmd part_apple ext2 extcmd \
71 xfs xnu part_bsd part_gpt search search_fs_file chain btrfs \
72 loadbios loadenv lvm minix minix2 reiserfs memrw mmap msdospart \
73 scsi loopback normal configfile gzio all_video \
74 gfxterm gettext echo || return 1
76 install -Dm644 $src/$bootimg $install/boot/efi/boot/$bootimg
77 ;;
78 esac
79 }
81 genpkg_rules() {
82 case $PACKAGE in
83 grub2)
84 copy @std
85 DEPENDS="zlib freetype ncurses libusb-compat grep libusb libdevmapper"
86 TAGS="LFS"
87 ;;
88 grub2-efi)
89 copy @std
90 DEPENDS=" "
91 ;;
92 grub2-efi-modules)
93 DEPENDS="grub2-efi"
94 case $ARCH in
95 i?86) efi_path=boot/efi/grub/i386-efi;;
96 x86_64) efi_path=boot/efi/grub/x86_64-efi;;
97 esac
98 mkdir -p $fs/$efi_path
99 cp $src/grub-core/*.mod $src/grub-core/*.lst $fs/$efi_path
100 ;;
101 esac
102 }
104 post_install_grub2() {
105 [ -n "$quiet" ] || cat <<EOT
107 .-------------------------------------------------------.
108 | # To install grub to your sda MBR |
109 | grub-install /dev/sda |
110 |-------------------------------------------------------|
111 | # To generate a configuration file |
112 | grub-mkconfig -o /boot/grub/grub.cfg |
113 |-------------------------------------------------------|
114 | # You can learn from /boot/grub/example-grub.cfg too. |
115 '-------------------------------------------------------'
116 EOT
117 }