SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "grub2-efi-x64"

# SliTaz package receipt.

PACKAGE="grub2-efi-x64"
VERSION="2.04"
CATEGORY="base-system"
SHORT_DESC="GRUB2 boot loader."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL3"
WEB_SITE="https://www.gnu.org/software/grub/"

SOURCE="grub"
TARBALL="$SOURCE-$VERSION.tar.xz"
WGET_URL="http://ftp.gnu.org/gnu/grub/$TARBALL"

DEPENDS="freetype grep libdevmapper libusb libusb-compat ncurses zlib"
BUILD_DEPENDS="bison flex freetype-dev fuse2-dev libdevmapper-dev \
libusb-compat-dev libusb-dev ncurses-dev xz-dev zlib-dev"

CONFIG_FILES="/etc/default/grub /etc/grub.d/40_custom"

#AUFS_NOT_RAMFS="uclibc-cross-compiler-x86_64 is not compatible with aufs+tmpfs 8("

# What is the latest version available today?
current_version()
{
    wget -O - ${WGET_URL%/*} 2>/dev/null | \
    sed "/$SOURCE-/!d;/tar/!d;s|.*$SOURCE-||;s|.tar.*||" | sort -Vr | sed q
}

# Rules to configure and make the package.
compile_rules()
{
    sed -i 's|sys/types.h>|&\n#include <sys/sysmacros.h>|' \
        util/getroot.c grub-core/kern/emu/hostdisk.c

    # CVE-2015-8370
    sed -i "s/'.b'/& \\&\\& cur_len/" grub-core/lib/crypto.c \
        grub-core/normal/auth.c

    # Fixes for flex 2.5.37
    export CFLAGS="-Wno-error=sign-compare -Wno-error=unused-value"
    sed -i 's/YY_FATAL_ERROR/REMOVED_&/' \
        grub-core/script/yylex.l

    export EFI_ARCH=x86_64
    sed -i 's/is_symbol_local /type == 2 || /' \
        util/grub-module-verifier*.c*
    sed -i 's/.*unsupported relocation.*/continue;/' \
        util/grub-module-verifier*.c*
    sed -i 's|.*add fixup entry for R_X86_64_32|// &|' \
        util/grub-mkimage*.c*

    # Use cross toolchain x86_64
    export PATH=$PATH:/cross/x86_64/tools/bin

    ./configure                        \
        BUILD_CC=gcc                    \
        CFLAGS="${CFLAGS/-march=i486/-g0}"        \
        TARGET_CC=x86_64-slitaz-linux-gcc        \
        TARGET_OBJCOPY=x86_64-slitaz-linux-objcopy    \
        TARGET_NM=x86_64-slitaz-linux-nm        \
        TARGET_STRIP=x86_64-slitaz-linux-strip        \
        TARGET_RANLIB='x86_64-slitaz-linux-ranlib'    \
        --prefix=/usr                    \
        --sysconfdir=/etc                \
        --with-platform=efi                \
        --target=${EFI_ARCH}                \
        --program-prefix=""                \
        --mandir=/usr/share/man $CONFIGURE_ARGS &&

    sed -i 's| -Werror||;s|-Wl,--copy-dt-needed-entries||' \
        Makefile grub-core/Makefile &&
    make $MAKEFLAGS &&

    cd grub-core &&
    ../grub-mkimage -d . -o ../bootx64.efi -O x86_64-efi -p /boot/grub \
        -c $stuff/grub.cfg \
        lsefisystab lssal lsefimmap lsacpi ls \
        ntfs hfs appleldr boot cat efi_gop efi_uga elf fat hfsplus \
        iso9660 linux keylayouts memdisk minicmd part_apple ext2 extcmd \
        xfs xnu part_bsd part_gpt search search_fs_file chain btrfs \
        loadbios loadenv lvm minix minix2 reiserfs memrw mmap msdospart \
        scsi loopback normal configfile gzio all_video efi_gop efi_uga \
        gfxterm gettext echo boot chain

    # Build grub bootloader for livecd
        ../grub-mkimage -d . -o ../bootx64-live.efi -O x86_64-efi -p /boot/grub \
                -c $stuff/grub-embed.cfg \
                lsefisystab lssal lsefimmap lsacpi ls \
                ntfs hfs appleldr boot cat efi_gop efi_uga elf fat hfsplus \
                iso9660 linux keylayouts memdisk minicmd part_apple ext2 extcmd \
                xfs xnu part_bsd part_gpt search search_fs_file chain btrfs \
                loadbios loadenv lvm minix minix2 reiserfs memrw mmap msdospart \
                scsi loopback normal configfile gzio all_video efi_gop efi_uga \
                gfxterm gettext echo boot chain
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/boot/efi/boot
    cp $src/bootx64.efi $fs/boot/efi/boot
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)