summaryrefslogtreecommitdiff
path: root/sys-boot/mbr-gpt
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-12-05 09:05:42 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-12-05 09:05:42 +0000
commitc3870d5920e6ee600e9360c3a5b004b7ad0c5abf (patch)
tree783e53d0526f67659a53911dd1dd9ca88eaad19a /sys-boot/mbr-gpt
parent94393d04ccce851b0084c650c99a2eca52f9d3bb (diff)
gentoo auto-resync : 05:12:2022 - 09:05:41
Diffstat (limited to 'sys-boot/mbr-gpt')
-rw-r--r--sys-boot/mbr-gpt/Manifest3
-rw-r--r--sys-boot/mbr-gpt/mbr-gpt-0.0.1-r1.ebuild5
-rw-r--r--sys-boot/mbr-gpt/mbr-gpt-0.0.1-r2.ebuild74
3 files changed, 81 insertions, 1 deletions
diff --git a/sys-boot/mbr-gpt/Manifest b/sys-boot/mbr-gpt/Manifest
index a8b3ae5cbe42..afc0d5a50821 100644
--- a/sys-boot/mbr-gpt/Manifest
+++ b/sys-boot/mbr-gpt/Manifest
@@ -1,3 +1,4 @@
DIST mbr-gpt_0.0.1.tar.gz 15861 BLAKE2B 00c6741fa5543af435cee97132510126d0301db2fb50712d438703165507125b4981844cb4a841b11bad075af5effb746fd3aa04e6834fb051536b250c01f7ad SHA512 eaabd84fc749ddee8fa40632ad49e15e894bf35a881fb7c35ba22796c2459a886e9bda601595e58d29567ff26959ae2befe6aec5db397d15e1dc5a292dafe165
-EBUILD mbr-gpt-0.0.1-r1.ebuild 1736 BLAKE2B fe763dc6620e620780b5b62b6e18b181de1d1e48611054a5423716fe289b432646e7c436ed5f5404fd1cda569f00ca4b1ab13bd26768cf138ea9e41806f4fefc SHA512 4cd5b1967c376b7209b7168587cfd162dad0be3ef22dbce63717b6aed269401c6a8bfbd8d3053594c8a7c760d94e7db3a69d29282051addfd00dbd6b28749c7e
+EBUILD mbr-gpt-0.0.1-r1.ebuild 1932 BLAKE2B 0efd6bf7919c1882c9684b10040cfd8f2e2f65062a05ca4d731aa7870e22b0f3f9fe7e428ea5e17015a0e1f6a156ec46c04a1ea6079b78d8a82d3dc51f68fc38 SHA512 9bd33644ba27a921ef98e9fe0a1128ed9c27e5069746db435d8d0cf49f62ffdee792171f72bfe470e0cda0bc38e70bad8f15626c5b78f05a5dcea1fc30ab1020
+EBUILD mbr-gpt-0.0.1-r2.ebuild 2121 BLAKE2B 4b9805ea0cf867b0b8960a0189ebe96ac38fbac1804ce7537d17ecf00997809e105ad65e610b8014a907913c42db29f9fa7f5512c7cead29596bf8f8809e59ae SHA512 da75367a3487383b62486099c04b913cc54248423dd548f4d2deab493642a98ff29684971e9193f08d1a1243d381de434d995f49b850adb36cc106edea03b2ce
MISC metadata.xml 552 BLAKE2B 3f8022fd0857c27de45191e309a20dd123c9a0657acd400fb469ff84ecdcd15d41ef0d08570468a301865fab0cedb631a7019448843443fdea762ea145bd4e97 SHA512 88d57d384b954da1a79182e1d5294f736bc44f5ff351d47c68407e27bb366e2ac432e3b7217d2cb0547ff2e19107545a245db6d5603dbfd20254c6850af77198
diff --git a/sys-boot/mbr-gpt/mbr-gpt-0.0.1-r1.ebuild b/sys-boot/mbr-gpt/mbr-gpt-0.0.1-r1.ebuild
index 3073a1e1cfed..1b062d5e5648 100644
--- a/sys-boot/mbr-gpt/mbr-gpt-0.0.1-r1.ebuild
+++ b/sys-boot/mbr-gpt/mbr-gpt-0.0.1-r1.ebuild
@@ -44,6 +44,11 @@ src_prepare() {
src_compile() {
emake CC="$(tc-getCC)"
+ # validate the size, it MUST fit into an MBR (440 bytes!)
+ size=$(stat --printf='%s' mbr)
+ if test $size -gt 440; then
+ die "Compiled MBR is too large! Must be at most 440 bytes, was $size"
+ fi
}
src_install() {
diff --git a/sys-boot/mbr-gpt/mbr-gpt-0.0.1-r2.ebuild b/sys-boot/mbr-gpt/mbr-gpt-0.0.1-r2.ebuild
new file mode 100644
index 000000000000..9359c8200a24
--- /dev/null
+++ b/sys-boot/mbr-gpt/mbr-gpt-0.0.1-r2.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="An MBR that can handle BIOS-based boot on GPT"
+MY_P="${PN}_${PV}"
+HOMEPAGE="https://web.archive.org/web/20080704173538/http://aybabtu.com/mbr-gpt/"
+SRC_URI="https://dev.gentoo.org/~robbat2/distfiles/${MY_P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+# This should probably NEVER go to stable. It's crazy advanced dangerous magic.
+# It's also pure ASM, so not suitable for elsewhere anyway.
+# Please don't remove it, robbat2 has a box that depends on it for # booting!
+KEYWORDS="~amd64 ~x86"
+
+# It only depends on binutils/gcc/make, and doesn't link against libc even.
+DEPEND=""
+RDEPEND=""
+
+# It's a mostly an MBR block and it does use the executable stack.
+QA_WX_LOAD="usr/lib/${PN}/boot.elf"
+QA_PRESTRIPPED="${QA_WX_LOAD}"
+QA_FLAGS_IGNORED="${QA_WX_LOAD}"
+
+# Don't strip it either; this binary reboots your host!
+RESTRICT="strip"
+
+src_prepare() {
+ default
+
+ # Messy upstream
+ emake clean
+
+ # Need to build it 32-bit for the MBR
+ # Btw, no CFLAGS are respected, it's ASM!
+ #
+ # This is not meant to be used by a dynamic linker either!
+ # https://inbox.sourceware.org/binutils/20200222023739.GB5570@bubble.grove.modra.org/T/#u
+ # Shows the --no-dynamic-linker option to ld
+ sed -i -e 's/-Wall/-Wall -m32 -Wl,--no-dynamic-linker/g' "${S}"/Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+ # validate the size, it MUST fit into an MBR (440 bytes!)
+ size=$(stat --printf='%s' mbr)
+ if test $size -gt 440; then
+ die "Compiled MBR is too large! Must be at most 440 bytes, was $size"
+ fi
+}
+
+src_install() {
+ # get_libdir is not correct here. We want this to go into a 32-bit library
+ # location.
+ insinto /usr/lib/${PN}
+ doins mbr
+
+ exeinto /usr/lib/${PN}
+ exeopts -m 700
+ doexe boot.elf
+
+ dodoc AUTHORS
+}
+
+pkg_postinst() {
+ einfo "See the instructions on the homepage, and make sure you know what"
+ einfo "you are doing before touching this. The mbr file does into your"
+ einfo "MBR, or alternatively you can do a creative reboot utilizing the"
+ einfo "boot.elf binary."
+}