Merge pull request #1461 from marineam/grub

Update GRUB and OVMF
This commit is contained in:
Michael Marineau 2015-08-14 13:24:51 -07:00
commit 8436371d7c
7 changed files with 11 additions and 336 deletions

View File

@ -1,325 +0,0 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999-r1.ebuild,v 1.21 2014/10/19 01:51:58 floppym Exp $
EAPI=5
if [[ ${PV} == 9999 ]]; then
AUTOTOOLS_AUTORECONF=1
GRUB_AUTOGEN=1
fi
if [[ -n ${GRUB_AUTOGEN} ]]; then
PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3,3_4} )
inherit python-any-r1
fi
inherit autotools-utils bash-completion-r1 eutils flag-o-matic mount-boot multibuild pax-utils toolchain-funcs versionator
if [[ ${PV} != 9999 ]]; then
if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
# The quote style is to work with <=bash-4.2 and >=bash-4.3 #503860
MY_P=${P/_/'~'}
#SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
SRC_URI="http://storage.core-os.net/mirror/snapshots/${MY_P}.tar.gz"
S=${WORKDIR}/${MY_P}
else
SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
mirror://gentoo/${P}.tar.xz
http://dev.gentoo.org/~floppym/dist/${P}.tar.xz"
S=${WORKDIR}/${P%_*}
fi
KEYWORDS="amd64 x86"
PATCHES=()
else
inherit git-r3
EGIT_REPO_URI="git://git.sv.gnu.org/grub.git
http://git.savannah.gnu.org/r/grub.git"
fi
DEJAVU=dejavu-sans-ttf-2.34
UNIFONT=unifont-7.0.05
SRC_URI+=" mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz
truetype? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )"
DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
# Includes licenses for dejavu and unifont
LICENSE="GPL-3 truetype? ( BitstreamVera GPL-2-with-font-exception )"
SLOT="2"
IUSE="debug device-mapper doc efiemu mount +multislot nls static sdl test truetype libzfs"
GRUB_ALL_PLATFORMS=(
# everywhere:
emu
# mips only:
qemu-mips loongson
# amd64, x86, ppc, ppc64:
ieee1275
# amd64, x86:
coreboot multiboot efi-32 pc qemu xen
# amd64, ia64:
efi-64
)
IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}"
# os-prober: Used on runtime to detect other OSes
# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
RDEPEND="
app-arch/xz-utils
>=sys-libs/ncurses-5.2-r5
debug? (
sdl? ( media-libs/libsdl )
)
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
libzfs? ( sys-fs/zfs )
mount? ( sys-fs/fuse )
truetype? ( media-libs/freetype:2= )
ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
"
DEPEND="${RDEPEND}
${PYTHON_DEPS}
app-misc/pax-utils
sys-devel/flex
sys-devel/bison
sys-apps/help2man
sys-apps/texinfo
grub_platforms_coreboot? ( media-libs/freetype:2 )
grub_platforms_qemu? ( media-libs/freetype:2 )
grub_platforms_ieee1275? ( media-libs/freetype:2 )
grub_platforms_loongson? ( media-libs/freetype:2 )
grub_platforms_xen? ( app-emulation/xen-tools )
static? (
app-arch/xz-utils[static-libs(+)]
truetype? (
app-arch/bzip2[static-libs(+)]
media-libs/freetype[static-libs(+)]
sys-libs/zlib[static-libs(+)]
)
)
test? (
dev-libs/libisoburn
app-emulation/qemu
)
truetype? ( app-arch/unzip )
"
RDEPEND+="
kernel_linux? (
grub_platforms_efi-32? ( sys-boot/efibootmgr )
grub_platforms_efi-64? ( sys-boot/efibootmgr )
)
!multislot? ( !sys-boot/grub:0 )
nls? ( sys-devel/gettext )
"
STRIP_MASK="*/grub/*/*.{mod,img}"
RESTRICT="test"
QA_EXECSTACK="
usr/bin/grub*-emu*
usr/lib*/grub/*/*.mod
usr/lib*/grub/*/*.module
usr/lib*/grub/*/kernel.exec
usr/lib*/grub/*/kernel.img
"
QA_WX_LOAD="
usr/lib*/grub/*/kernel.exec
usr/lib*/grub/*/kernel.img
usr/lib*/grub/*/*.image
"
QA_PRESTRIPPED="
usr/lib.*/grub/.*/kernel.img
"
pkg_pretend() {
if [[ ${MERGE_TYPE} != binary ]]; then
# Bug 439082
if ! version_is_at_least 4.8 "$(gcc-version)" &&
$(tc-getLD) --version | grep -q "GNU gold"; then
eerror "GRUB does not function correctly when built with the gold linker."
eerror "Please select the bfd linker with binutils-config."
die "GNU gold detected"
fi
fi
}
src_unpack() {
if [[ ${PV} == 9999 ]]; then
git-r3_src_unpack
fi
default_src_unpack
}
src_prepare() {
[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
sed -i -e /autoreconf/d autogen.sh || die
if use multislot; then
# fix texinfo file name, bug 416035
sed -i -e 's/^\* GRUB:/* GRUB2:/' -e 's/(grub)/(grub2)/' docs/grub.texi || die
fi
epatch_user
if [[ -n ${GRUB_AUTOGEN} ]]; then
python_setup
bash autogen.sh || die
fi
if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
autopoint() { return 0; }
eautoreconf
fi
}
setup_fonts() {
ln -s "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die
if use truetype; then
ln -s "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die
fi
}
grub_configure() {
local platform
case ${MULTIBUILD_VARIANT} in
efi-32)
platform=efi
if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then
local CTARGET=${CTARGET:-i386}
fi ;;
efi-64)
platform=efi
if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then
local CTARGET=${CTARGET:-x86_64}
local TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
export TARGET_CFLAGS TARGET_CPPFLAGS
fi ;;
guessed) ;;
*) platform=${MULTIBUILD_VARIANT} ;;
esac
local myeconfargs=(
--disable-werror
--program-prefix=
--libdir="${EPREFIX}"/usr/lib
--htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
$(use_enable debug mm-debug)
$(use_enable debug grub-emu-usb)
$(use_enable device-mapper)
$(use_enable mount grub-mount)
$(use_enable nls)
$(use_enable truetype grub-mkfont)
$(use_enable libzfs)
$(use sdl && use_enable debug grub-emu-sdl)
${platform:+--with-platform=}${platform}
# Let configure detect this where supported
$(usex efiemu '' '--disable-efiemu')
)
if use multislot; then
myeconfargs+=( --program-transform-name="s,grub,grub2," )
fi
mkdir -p "${BUILD_DIR}" || die
run_in_build_dir setup_fonts
autotools-utils_src_configure
}
src_configure() {
# Bug 508758.
replace-flags -O3 -O2
# We don't want to leak flags onto boot code.
export HOST_CCASFLAGS=${CCASFLAGS}
export HOST_CFLAGS=${CFLAGS}
export HOST_CPPFLAGS=${CPPFLAGS}
export HOST_LDFLAGS=${LDFLAGS}
unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
use static && HOST_LDFLAGS+=" -static"
if version_is_at_least 4.8 "$(gcc-version)"; then
export TARGET_LDFLAGS+=" -fuse-ld=bfd"
fi
tc-export CC NM OBJCOPY STRIP
export TARGET_CC=${TARGET_CC:-${CC}}
tc-export BUILD_CC # Bug 485592
# Portage will take care of cleaning up GRUB_PLATFORMS
MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
multibuild_parallel_foreach_variant grub_configure
}
src_compile() {
# Sandbox bug 404013.
use libzfs && addpredict /etc/dfs:/dev/zfs
multibuild_foreach_variant autotools-utils_src_compile
use doc && multibuild_for_best_variant \
autotools-utils_src_compile -C docs html
}
src_test() {
# The qemu dependency is a bit complex.
# You will need to adjust QEMU_SOFTMMU_TARGETS to match the cpu/platform.
multibuild_foreach_variant autotools-utils_src_test
}
src_install() {
multibuild_foreach_variant autotools-utils_src_install \
bashcompletiondir="$(get_bashcompdir)"
use doc && multibuild_for_best_variant run_in_build_dir \
emake -C docs DESTDIR="${D}" install-html
if use multislot; then
mv "${ED%/}"/usr/share/info/grub{,2}.info || die
fi
insinto /etc/default
newins "${FILESDIR}"/grub.default-3 grub
}
pkg_postinst() {
mount-boot_mount_boot_partition
if [[ -e "${ROOT%/}/boot/grub2/grub.cfg" ]]; then
ewarn "The grub directory has changed from /boot/grub2 to /boot/grub."
ewarn "Please run grub2-install and grub2-mkconfig -o /boot/grub/grub.cfg."
if [[ ! -e "${ROOT%/}/boot/grub/grub.cfg" ]]; then
mkdir -p "${ROOT%/}/boot/grub"
ln -s ../grub2/grub.cfg "${ROOT%/}/boot/grub/grub.cfg"
fi
fi
mount-boot_pkg_postinst
elog "For information on how to configure GRUB2 please refer to the guide:"
elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
if has_version 'sys-boot/grub:0'; then
elog "A migration guide for GRUB Legacy users is available:"
elog " http://www.gentoo.org/doc/en/grub2-migration.xml"
fi
if [[ -z ${REPLACING_VERSIONS} ]]; then
if ! has_version sys-boot/os-prober; then
elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
fi
if ! has_version dev-libs/libisoburn; then
elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
fi
fi
}

View File

@ -12,7 +12,7 @@ PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3,3_4} )
if [[ "${PV}" == 9999 ]]; then if [[ "${PV}" == 9999 ]]; then
KEYWORDS="~amd64 ~x86" KEYWORDS="~amd64 ~x86"
else else
CROS_WORKON_COMMIT="adf8c776a147d65ad53fd28c809ab8189283a99b" CROS_WORKON_COMMIT="91391dc52b0d1559ec589ec304a434ed12e92b3e"
KEYWORDS="amd64 x86" KEYWORDS="amd64 x86"
fi fi

View File

@ -1,2 +1,2 @@
DIST edk2-16301.tar.xz 16921196 SHA256 79aa32fafc28a700b571186942fd9008ff0ecdc8fa533a75748f761c53e106c8 SHA512 4ceb9bae39a6db836277fb26de5f84bc22af6afd1f1dfb488650ad437ca34d4d80afe579e462b3edb7db70b38bd0a0b4b871e62bded8fb69e39ecab4cf54b123 WHIRLPOOL 5d72efba117a89c343c3d3abe3f378a048b478a4c67a925524d09e62d1de13adfa5a03cfb5a0a2f6e5b73f9380e0fdda1c485c206aa6b20059d9d7f65c7e313c DIST edk2-18219.tar.xz 18537400 SHA256 fc5b5eae45f62993390f141af1f632045eb9e7c0ee009a15788d081f5e37b703 SHA512 8f9ec10b23940f2176576c3c2767407f3de2562a46c177912ed551d63b4049948a91cb757aa3a968ddeb8ccaff138b8fc171789bd150ea3496ff25c6dda923c5 WHIRLPOOL 4c5eb8628a4558e4e7ab41ded5877676eb4d3b51e4ba4869fd451e727f6503dbb8fd71667db75935c44f490048e882bd1d983890d80e239c913748d747e5d41b
DIST openssl-0.9.8zb.tar.gz 3727934 SHA256 950e2298237de1697168debd42860bf41ead618e0c03dc9a3a56e23258e435be SHA512 b563a7d9c7ae602aefb3ba8e5cd54d0460c805b7a4ef0b1b369907d6447f5b1977ebb1e261d37254a487d74d56f40bf825e2a279c6ae56ffcc9b7fd785dc7dbd WHIRLPOOL 60aeeb8171222d358c26361494c2d06f3cc6d66a385f3fcd58005e1220c3819add0e952cd4add16457191d8317b11efcdb7f6ae4696880d21a77c95df2c56a6a DIST openssl-1.0.2d.tar.gz 5295447 SHA256 671c36487785628a703374c652ad2cebea45fa920ae5681515df25d9f2c9a8c8 SHA512 68a051e92aaed0e7a8b218c185427c534c32f30f50c45f5d2c1f5b7a26d1416e83863d2953c77486acde3b636a148f39faf48246d28a207607ec069f62b13d75 WHIRLPOOL e3d8f0784903c8d6aa05ada7b8b410517c99157a3c2f4ac34c8a9d80c77408bd6ff9e820ded47f6223ccac4a77413174aa625303166ec28fdbf8374a7d4659ec

View File

@ -24,7 +24,7 @@ else
KEYWORDS="-* amd64" KEYWORDS="-* amd64"
fi fi
OPENSSL_PV="0.9.8zb" OPENSSL_PV="1.0.2d"
OPENSSL_P="openssl-${OPENSSL_PV}" OPENSSL_P="openssl-${OPENSSL_PV}"
SRC_URI+=" mirror://openssl/source/${OPENSSL_P}.tar.gz" SRC_URI+=" mirror://openssl/source/${OPENSSL_P}.tar.gz"

View File

@ -1,8 +1,8 @@
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index f88f860..6c67ffd 100644 index 859fbe1..3731150 100644
--- a/BaseTools/Conf/tools_def.template --- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template
@@ -3814,7 +3814,7 @@ NOOPT_DDK3790xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF @@ -3807,7 +3807,7 @@ NOOPT_DDK3790xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF
DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug
RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG = RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG =
@ -11,17 +11,17 @@ index f88f860..6c67ffd 100644
DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
@@ -3841,7 +3841,7 @@ DEFINE GCC_IPF_RC_FLAGS = -I binary -O elf64-ia64-little -B ia64 @@ -3838,7 +3838,7 @@ DEFINE GCC_IPF_RC_FLAGS = -I binary -O elf64-ia64-little -B ia64
DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm --rename-section .data=.hii DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm --rename-section .data=.hii
DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
-DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -nopie +DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -nopie
DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -malign-double -fno-stack-protector -D EFI32 DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables
DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS -mno-red-zone -Wno-address -mcmodel=large DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS -mno-red-zone -Wno-address -mcmodel=large -fno-asynchronous-unwind-tables
DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -n -q --gc-sections --script=$(EDK_TOOLS_PATH)/Scripts/gcc4.4-ld-script DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -n -q --gc-sections -z common-page-size=0x20
diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
index 6a759d9..ec2fbb0 100644 index 09d2bff..f3ca05d 100644
--- a/BaseTools/Source/C/Makefiles/header.makefile --- a/BaseTools/Source/C/Makefiles/header.makefile
+++ b/BaseTools/Source/C/Makefiles/header.makefile +++ b/BaseTools/Source/C/Makefiles/header.makefile
@@ -51,7 +51,7 @@ CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-de @@ -51,7 +51,7 @@ CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-de