diff options
| author | Palica <palica+gitlab@liguros.net> | 2020-06-23 22:35:08 +0200 |
|---|---|---|
| committer | Palica <palica+gitlab@liguros.net> | 2020-06-23 22:35:08 +0200 |
| commit | ecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch) | |
| tree | b89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /sys-boot | |
| parent | 1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff) | |
| download | baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip | |
Updating liguros repo
Diffstat (limited to 'sys-boot')
226 files changed, 12826 insertions, 0 deletions
diff --git a/sys-boot/aboot/Manifest b/sys-boot/aboot/Manifest new file mode 100644 index 000000000000..b25b4ab2df86 --- /dev/null +++ b/sys-boot/aboot/Manifest @@ -0,0 +1,3 @@ +DIST aboot-1.0_pre20040408.tar.bz2 115062 BLAKE2B 49f1b45abcd4726fd036e24709d10bbfea42cee03293e31b2deb3aec383c1c438602aa97d3909516ec9864986dfcf82612fe7644b47e3e2760bdf377313446a0 SHA512 b1fff7ce806336f89efe8239108a8547053f22727cba93cea742995432c4f35133f8dc619588390ba6e0d114e2fd62b80b730443e6c18900aa2a8832ddd4ebfc +DIST aboot_gentoo.diff.bz2 9527 BLAKE2B 2492b456f7411630b6ecfb19db775969b69a35c0ef31b2146fd353aac78cf4d3c9ef2162cf54ab4ac025c65607219b3a33a74d2105be196e6dda54dd2509c1f8 SHA512 868a73fee56e9bf6d986175a6a4dc321ed12fb78d74dfb8f1a3e35274577ddc9ea0820768b44836403587b3976ad8dacdcf6562a9ce5c45981c752670901155f +DIST gentoo-headers-base-2.6.22.tar.bz2 4700338 BLAKE2B a264d7999ed7735e42ea21f8cf96b60ca1bdbfcb76dbdfcba14a849043e1f6a9109cd72bf5b91b9ab877dc3025ce6a9270ea914cf277b8f77cecff703646a7ec SHA512 99849928eede0c4b101ddc9179c0974cac6b4f18803dc98b72dcbe80cea88d3062f709beaa1b890edbed9c147be0dd516065d4cee945164b5d9f19f7a3cf249d diff --git a/sys-boot/aboot/aboot-1.0_pre20040408-r3.ebuild b/sys-boot/aboot/aboot-1.0_pre20040408-r3.ebuild new file mode 100644 index 000000000000..78aa508f1e0f --- /dev/null +++ b/sys-boot/aboot/aboot-1.0_pre20040408-r3.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit eutils toolchain-funcs + +KERN_VER="2.6.22" + +DESCRIPTION="Alpha Linux boot loader for SRM" +HOMEPAGE="http://aboot.sourceforge.net/" +SRC_URI="http://aboot.sourceforge.net/tarballs/${P}.tar.bz2 + mirror://gentoo/gentoo-headers-base-${KERN_VER}.tar.bz2 + mirror://gentoo/${PN}_gentoo.diff.bz2 + https://dev.gentoo.org/~armin76/dist/${PN}_gentoo.diff.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~alpha" +IUSE="" + +DEPEND="" +RDEPEND="" + +src_unpack() { + unpack ${A} + # setup local copies of kernel headers since we rely so + # heavily on linux internals. + mv gentoo-headers-base-${KERN_VER}/include/{linux,asm-generic,asm-alpha} "${S}"/include/ || die + cd "${S}"/include + ln -s asm-alpha asm || die + touch linux/config.h || die +} + +src_prepare() { + eapply "${FILESDIR}/aboot-gcc-3.4.patch" + eapply "${FILESDIR}/aboot-pt_note.patch" + # Bug 364697 + eapply "${FILESDIR}/aboot-define_stat_only_in_userspace.patch" + eapply "${FILESDIR}"/aboot-respect-AR.patch + eapply "${FILESDIR}"/aboot-gnu90.patch + + # Modified patch from Debian to add netboot support + eapply "${WORKDIR}"/aboot_gentoo.diff + + eapply_user +} + +src_compile() { + # too many problems with parallel building + emake -j1 AR=$(tc-getAR) CC=$(tc-getCC) LD=$(tc-getLD) +} + +src_install() { + dodir /boot /sbin /usr/share/man/man{1,5,8} + make \ + root="${D}" \ + bindir="${D}"/sbin \ + bootdir="${D}"/boot \ + mandir="${D}"/usr/share/man \ + install + + insinto /boot + doins net_aboot.nh + dobin netabootwrap + dodoc ChangeLog INSTALL README TODO aboot.conf + + insinto /etc + newins "${FILESDIR}"/aboot.conf aboot.conf.example + +} + +pkg_postinst() { + einfo "To make aboot install a new bootloader on your harddisk follow" + einfo "these steps:" + einfo "" + einfo " - edit the file /etc/aboot.conf" + einfo " - cd /boot" + einfo " - swriteboot -c2 /dev/sda bootlx" + einfo " This will install a new bootsector on /dev/sda and aboot will" + einfo " use the second partition on this device to lookup kernel and " + einfo " initrd (as described in the aboot.conf file)" + einfo "" + einfo "IMPORTANT :" + einfo "" + einfo "The partition table of your boot device has to contain " + einfo "a BSD-DISKLABEL and the first 12 megabytes of your boot device" + einfo "must not be part of a partition as aboot will write its bootloader" + einfo "in there and not as with most x86 bootloaders into the " + einfo "master boot sector. If your partition table does not reflect this" + einfo "you are going to destroy your installation !" + einfo "Also note that aboot currently only supports ext2/3 partitions" + einfo "to boot from." +} diff --git a/sys-boot/aboot/files/aboot-define_stat_only_in_userspace.patch b/sys-boot/aboot/files/aboot-define_stat_only_in_userspace.patch new file mode 100644 index 000000000000..5b0b5e0efedf --- /dev/null +++ b/sys-boot/aboot/files/aboot-define_stat_only_in_userspace.patch @@ -0,0 +1,35 @@ +# Patch by Sergei Trofimovich +# http://bugs.gentoo.org/364697 + +diff --git a/Makefile b/Makefile +index bbe3b60..b4245af 100644 +--- a/Makefile ++++ b/Makefile +@@ -138,10 +138,10 @@ distclean: clean + find . -name \*~ | xargs rm -f + + lib/%: +- make -C lib $* CPPFLAGS="$(CPPFLAGS)" TESTING="$(TESTING)" ++ make -C lib $* CPPFLAGS="$(CPPFLAGS) -D__KERNEL__" TESTING="$(TESTING)" + + tools/%: +- make -C tools $* CPPFLAGS="$(CPPFLAGS)" ++ make -C tools $* CPPFLAGS="$(CPPFLAGS) -U__KERNEL__" + + sdisklabel/%: + make -C sdisklabel $* CPPFLAGS="$(CPPFLAGS)" +diff --git a/include/isolib.h b/include/isolib.h +index 392327a..0ef6e2a 100644 +--- a/include/isolib.h ++++ b/include/isolib.h +@@ -7,7 +7,10 @@ + # define fd_set kernel_fd_set + #endif + ++#ifdef __KERNEL__ ++/* userspace stuff has it's own struct stat */ + #include <asm/stat.h> ++#endif + + extern int iso_read_super (void * data, int quiet); + extern int iso_open (const char * filename); diff --git a/sys-boot/aboot/files/aboot-gcc-3.4.patch b/sys-boot/aboot/files/aboot-gcc-3.4.patch new file mode 100644 index 000000000000..24da18ce8190 --- /dev/null +++ b/sys-boot/aboot/files/aboot-gcc-3.4.patch @@ -0,0 +1,31 @@ +--- aboot-1.0_pre20040408/cons.c ++++ aboot-1.0_pre20040408/cons.c +@@ -20,7 +20,6 @@ + #endif + + long cons_dev; /* console device */ +-extern long int dispatch(); /* Need the full 64 bit return here...*/ + + long + cons_puts(const char *str, long len) +--- aboot-1.0_pre20040408/fs/ext2.c ++++ aboot-1.0_pre20040408/fs/ext2.c +@@ -6,6 +6,7 @@ + * This file has been ported from the DEC 32-bit Linux version + * by David Mosberger (davidm@cs.arizona.edu). + */ ++#include <string.h> + #include <linux/stat.h> + #include <linux/types.h> + #include <linux/version.h> +--- aboot-1.0_pre20040408/include/cons.h ++++ aboot-1.0_pre20040408/include/cons.h +@@ -3,7 +3,7 @@ + + extern long cons_dev; /* console device */ + +-extern long dispatch(long proc, ...); ++extern long int dispatch(long proc, ...); + + #ifdef TESTING + #define STRINGIFY(sym) #sym diff --git a/sys-boot/aboot/files/aboot-gnu90.patch b/sys-boot/aboot/files/aboot-gnu90.patch new file mode 100644 index 000000000000..2fb4b87f6b2c --- /dev/null +++ b/sys-boot/aboot/files/aboot-gnu90.patch @@ -0,0 +1,26 @@ +This patch fixes multiple definitions of 'extern inline' functions. + +c99 and gnu90 have slightly different semantics +WRT symbol definition: http://www.greenend.org.uk/rjk/tech/inline.html + +gcc-4 defaults to gnu90 and works, gcc-6 defaults to gnu-99 +and fails to link aboot as: + alpha-unknown-linux-gnu-ld: Disabling relaxation: it will not work with multiple definitions + lib/libaboot.a(isolib.o): In function `prefetchw': + (.text+0x60): multiple definition of `prefetchw' + fs/ext2.o:(.text+0xe68): first defined here + +The change is to force gnu90 explicitly. +diff --git a/Makefile b/Makefile +index b4245af..634ac87 100644 +--- a/Makefile ++++ b/Makefile +@@ -40,6 +40,6 @@ ifeq ($(TESTING),) + CPPFLAGS = $(CFGDEFS) -I$(TOP)/include -I$(KSRC)/include +-CFLAGS = $(CPPFLAGS) -D__KERNEL__ -Os -Wall -fno-builtin -mno-fp-regs ++CFLAGS = $(CPPFLAGS) -std=gnu90 -D__KERNEL__ -Os -Wall -fno-builtin -mno-fp-regs + else + CPPFLAGS = -DTESTING $(CFGDEFS) -I$(TOP)/include -I$(KSRC)/include +-CFLAGS = $(CPPFLAGS) -O -g3 -Wall -D__KERNEL__ -ffixed-8 ++CFLAGS = $(CPPFLAGS) -std=gnu90 -O -g3 -Wall -D__KERNEL__ -ffixed-8 + endif diff --git a/sys-boot/aboot/files/aboot-pt_note.patch b/sys-boot/aboot/files/aboot-pt_note.patch new file mode 100644 index 000000000000..d28527ad5b0c --- /dev/null +++ b/sys-boot/aboot/files/aboot-pt_note.patch @@ -0,0 +1,308 @@ +Recent build changes have added a PT_NOTE entry to the kernel's +ELF header. A perfectly valid change, but Alpha's aboot loader +is none too bright about examining these headers. + +The following patch to aboot-1.0_pre20040408.tar.bz2 makes it +so that only PT_LOAD entries are considered for loading, as well +as several other changes required to get the damned thing to +build again. + +--- aboot-1.0_pre20040408/Makefile ++++ aboot-1.0_pre20040408/Makefile +@@ -32,15 +32,15 @@ export + # + LOADADDR = 20000000 + +-ABOOT_LDFLAGS = -static -N -Taboot.lds ++ABOOT_LDFLAGS = -static -N -Taboot.lds --relax + + CC = gcc + TOP = $(shell pwd) + ifeq ($(TESTING),) +-CPPFLAGS = $(CFGDEFS) -I$(TOP)/include +-CFLAGS = $(CPPFLAGS) -D__KERNEL__ -Os -Wall -fno-builtin -mno-fp-regs -ffixed-8 ++CPPFLAGS = $(CFGDEFS) -I$(TOP)/include -I$(KSRC)/include ++CFLAGS = $(CPPFLAGS) -D__KERNEL__ -Os -Wall -fno-builtin -mno-fp-regs + else +-CPPFLAGS = -DTESTING $(CFGDEFS) -I$(TOP)/include ++CPPFLAGS = -DTESTING $(CFGDEFS) -I$(TOP)/include -I$(KSRC)/include + CFLAGS = $(CPPFLAGS) -O -g3 -Wall -D__KERNEL__ -ffixed-8 + endif + ASFLAGS = $(CPPFLAGS) + +--- aboot-1.0_pre20040408/aboot.c ++++ aboot-1.0_pre20040408/aboot.c +@@ -19,7 +19,6 @@ + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +-#include <linux/elf.h> + #include <linux/kernel.h> + #include <linux/version.h> + +@@ -27,6 +26,7 @@ + #include <asm/hwrpb.h> + #include <asm/system.h> + ++#include <elf.h> + #include <alloca.h> + #include <errno.h> + +@@ -37,16 +37,6 @@ + #include "utils.h" + #include "string.h" + +-#ifndef elf_check_arch +-# define aboot_elf_check_arch(e) 1 +-#else +-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) +-# define aboot_elf_check_arch(e) elf_check_arch(e) +-# else +-# define aboot_elf_check_arch(e) elf_check_arch(e->e_machine) +-# endif +-#endif +- + struct bootfs * bfs = 0; /* filesystem to boot from */ + char * dest_addr = 0; + jmp_buf jump_buffer; +@@ -83,77 +73,89 @@ static unsigned long entry_addr = START_ADDR; + long + first_block (const char *buf, long blocksize) + { +- struct elfhdr *elf; +- struct elf_phdr *phdrs; ++ Elf64_Ehdr *elf; ++ Elf64_Phdr *phdrs; ++ int i, j; + +- elf = (struct elfhdr *) buf; ++ elf = (Elf64_Ehdr *) buf; + +- if (elf->e_ident[0] == 0x7f +- && strncmp(elf->e_ident + 1, "ELF", 3) == 0) +- { +- int i; +- /* looks like an ELF binary: */ +- if (elf->e_type != ET_EXEC) { +- printf("aboot: not an executable ELF file\n"); +- return -1; +- } +- if (!aboot_elf_check_arch(elf)) { +- printf("aboot: ELF executable not for this machine\n"); +- return -1; +- } +- if (elf->e_phoff + elf->e_phnum * sizeof(*phdrs) > (unsigned) blocksize) { +- printf("aboot: " +- "ELF program headers not in first block (%ld)\n", +- (long) elf->e_phoff); ++ if (elf->e_ident[0] != 0x7f ++ || elf->e_ident[1] != 'E' ++ || elf->e_ident[2] != 'L' ++ || elf->e_ident[3] != 'F') { ++ /* Fail silently, it might be a compressed file */ ++ return -1; ++ } ++ if (elf->e_ident[EI_CLASS] != ELFCLASS64 ++ || elf->e_ident[EI_DATA] != ELFDATA2LSB ++ || elf->e_machine != EM_ALPHA) { ++ printf("aboot: ELF executable not for this machine\n"); ++ return -1; ++ } ++ ++ /* Looks like an ELF binary. */ ++ if (elf->e_type != ET_EXEC) { ++ printf("aboot: not an executable ELF file\n"); ++ return -1; ++ } ++ ++ if (elf->e_phoff + elf->e_phnum * sizeof(*phdrs) ++ > (unsigned) blocksize) { ++ printf("aboot: ELF program headers not in first block (%ld)\n", ++ (long) elf->e_phoff); ++ return -1; ++ } ++ ++ phdrs = (struct elf_phdr *) (buf + elf->e_phoff); ++ chunks = malloc(sizeof(struct segment) * elf->e_phnum); ++ start_addr = phdrs[0].p_vaddr; /* assume they are sorted */ ++ entry_addr = elf->e_entry; ++ ++ for (i = j = 0; i < elf->e_phnum; ++i) { ++ int status; ++ ++ if (phdrs[i].p_type != PT_LOAD) ++ continue; ++ ++ chunks[j].addr = phdrs[i].p_vaddr; ++ chunks[j].offset = phdrs[i].p_offset; ++ chunks[j].size = phdrs[i].p_filesz; ++ printf("aboot: PHDR %d vaddr %#lx offset %#lx size %#lx\n", ++ i, chunks[j].addr, chunks[j].offset, chunks[j].size); ++ ++ status = check_memory(chunks[j].addr, chunks[j].size); ++ if (status) { ++ printf("aboot: Can't load kernel.\n" ++ " Memory at %lx - %lx (PHDR %i) " ++ "is %s\n", ++ chunks[j].addr, ++ chunks[j].addr + chunks[j].size - 1, ++ i, ++ (status == -ENOMEM) ? ++ "Not Found" : ++ "Busy (Reserved)"); + return -1; + } +- phdrs = (struct elf_phdr *) (buf + elf->e_phoff); +- chunks = malloc(sizeof(struct segment) * elf->e_phnum); +- nchunks = elf->e_phnum; +- start_addr = phdrs[0].p_vaddr; /* assume they are sorted */ +- entry_addr = elf->e_entry; +-#ifdef DEBUG +- printf("aboot: %d program headers, start address %#lx, entry %#lx\n", +- nchunks, start_addr, entry_addr); +-#endif +- for (i = 0; i < elf->e_phnum; ++i) { +- int status; +- +- chunks[i].addr = phdrs[i].p_vaddr; +- chunks[i].offset = phdrs[i].p_offset; +- chunks[i].size = phdrs[i].p_filesz; +-#ifdef DEBUG +- printf("aboot: segment %d vaddr %#lx offset %#lx size %#lx\n", +- i, chunks[i].addr, chunks[i].offset, chunks[i].size); +-#endif +- +-#ifndef TESTING +- status = check_memory(chunks[i].addr, chunks[i].size); +- if (status) { ++ ++ if (phdrs[i].p_memsz > phdrs[i].p_filesz) { ++ if (bss_size > 0) { + printf("aboot: Can't load kernel.\n" +- " Memory at %lx - %lx (chunk %i) " +- "is %s\n", +- chunks[i].addr, +- chunks[i].addr + chunks[i].size - 1, +- i, +- (status == -ENOMEM) ? +- "Not Found" : +- "Busy (Reserved)"); ++ " Multiple BSS segments" ++ " (PHDR %d)\n", i); + return -1; + } +-#endif ++ ++ bss_start = (char *) (phdrs[i].p_vaddr + ++ phdrs[i].p_filesz); ++ bss_size = phdrs[i].p_memsz - phdrs[i].p_filesz; ++ + } +- bss_start = (char *) (phdrs[elf->e_phnum - 1].p_vaddr + +- phdrs[elf->e_phnum - 1].p_filesz); +- bss_size = (phdrs[elf->e_phnum - 1].p_memsz - +- phdrs[elf->e_phnum - 1].p_filesz); +-#ifdef DEBUG +- printf("aboot: bss at 0x%p, size %#lx\n", bss_start, bss_size); +-#endif +- } else { +- /* Fail silently, it might be a compressed file */ +- return -1; ++ ++ j++; + } ++ ++ nchunks = j; ++ printf("aboot: bss at 0x%p, size %#lx\n", bss_start, bss_size); + + return 0; + } + +--- aboot-1.0_pre20040408/aboot.lds ++++ aboot-1.0_pre20040408/aboot.lds +@@ -1,22 +1,25 @@ + OUTPUT_FORMAT("elf64-alpha") + ENTRY(__start) ++PHDRS { kernel PT_LOAD; } + SECTIONS + { + . = 0x20000000; +- .text : { *(.text) } ++ .text : { *(.text) } :kernel + _etext = .; + PROVIDE (etext = .); +- .rodata : { *(.rodata) } +- .data : { *(.data) CONSTRUCTORS } +- .got : { *(.got) } +- .sdata : { *(.sdata) } ++ .rodata : { *(.rodata*) } :kernel ++ .data : { *(.data*) } :kernel ++ .got : { *(.got) } :kernel ++ .sdata : { *(.sdata) } :kernel + _edata = .; + PROVIDE (edata = .); +- .sbss : { *(.sbss) *(.scommon) } +- .bss : { *(.bss) *(COMMON) } ++ .sbss : { *(.sbss) *(.scommon) } :kernel ++ .bss : { *(.bss) *(COMMON) } :kernel + _end = . ; + PROVIDE (end = .); + ++ /DISCARD/ : { *(.eh_frame) } ++ + .mdebug 0 : { *(.mdebug) } + .note 0 : { *(.note) } + .comment 0 : { *(.comment) } + +--- aboot-1.0_pre20040408/cons.c ++++ aboot-1.0_pre20040408/cons.c +@@ -82,7 +81,7 @@ cons_getenv(long index, char *envval, long maxlen) + * allocated on the stack (which guaranteed to by 8 byte + * aligned). + */ +- char * tmp = alloca(maxlen); ++ char tmp[maxlen]; + long len; + + len = dispatch(CCB_GET_ENV, index, tmp, maxlen - 1); + +--- aboot-1.0_pre20040408/disk.c ++++ aboot-1.0_pre20040408/disk.c +@@ -113,7 +113,7 @@ int + load_uncompressed (int fd) + { + long nread, nblocks; +- unsigned char *buf; ++ char *buf; + int i; + + buf = malloc(bfs->blocksize); +@@ -131,7 +131,7 @@ load_uncompressed (int fd) + + for(i = 0; i < 16; i++) { + for (j = 0; j < 16; j++) +- printf("%02X ", buf[j+16*i]); ++ printf("%02X ", (unsigned char) buf[j+16*i]); + for(j = 0; j < 16; j++) { + c = buf[j+16*i]; + printf("%c", (c >= ' ') ? c : ' '); + +--- aboot-1.0_pre20040408/head.S ++++ aboot-1.0_pre20040408/head.S +@@ -19,8 +19,7 @@ __start: + .quad 0,0,0,0,0,0,0,0 + 1: br $27,2f + 2: ldgp $29,0($27) +- lda $27,main_ +- jsr $26,($27),main_ ++ bsr $26,main_ !samegp + call_pal PAL_halt + .end __start + +@@ -170,4 +169,4 @@ run_kernel: + mov $16,$27 + mov $17,$30 + jmp $31,($27) +- .end run_kernel +\ No newline at end of file ++ .end run_kernel diff --git a/sys-boot/aboot/files/aboot-respect-AR.patch b/sys-boot/aboot/files/aboot-respect-AR.patch new file mode 100644 index 000000000000..44e4a2a52063 --- /dev/null +++ b/sys-boot/aboot/files/aboot-respect-AR.patch @@ -0,0 +1,13 @@ +diff --git a/lib/Makefile b/lib/Makefile +index e3a2247..c137b53 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -13,6 +13,6 @@ libaboot.a: vsprintf.o memcpy.o memset.o string.o _setjmp.o \ + __remlu.o +- ar cru $@ $? ++ $(AR) cru $@ $? + else + libaboot.a: isolib.o +- ar cru $@ $? ++ $(AR) cru $@ $? + endif diff --git a/sys-boot/aboot/files/aboot.conf b/sys-boot/aboot/files/aboot.conf new file mode 100644 index 000000000000..02114138e938 --- /dev/null +++ b/sys-boot/aboot/files/aboot.conf @@ -0,0 +1,10 @@ +# +# aboot default configurations +# +0:3/vmlinux.gz ro root=/dev/sda2 +1:3/vmlinux.old.gz ro root=/dev/sda2 +2:3/vmlinux.new.gz ro root=/dev/sda2 +3:3/vmlinux ro root=/dev/sda2 +8:- ro root=/dev/sda2 # fs less boot of raw kernel +9:0/- ro root=/dev/sda2 # fs less boot of (compressed) ECOFF kernel +- diff --git a/sys-boot/aboot/metadata.xml b/sys-boot/aboot/metadata.xml new file mode 100644 index 000000000000..17b575c8ea17 --- /dev/null +++ b/sys-boot/aboot/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>alpha@gentoo.org</email> + <name>Gentoo Linux Alpha Development</name> + </maintainer> + <upstream> + <remote-id type="sourceforge">aboot</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/arcload/Manifest b/sys-boot/arcload/Manifest new file mode 100644 index 000000000000..71e15d21c80a --- /dev/null +++ b/sys-boot/arcload/Manifest @@ -0,0 +1,2 @@ +DIST arcload-0.5.tar.bz2 47690 BLAKE2B c58318f2f1eb71c4ad36c50e2f7e1f3fc2bf12a459336cf2aa27984700f10d135eea97e2e853b37de3e1c8d80b267d3232a3c24439473844acc9bce78b9e1e7f SHA512 b4f7186a6e75baa0cde06451a8011769f200d4cc353495dbfeb9c9ffe3ac09b8bbba357e83441e1fe2344c651068fafda7881864d8bf09f221ddae8170cc7b2e +DIST arcload-0.50-patches-v1.tar.xz 10320 BLAKE2B 854d82ae850f31ae8585b3c37416380457526de236ce70cc5f7280ecde46e1d8b33bb3f57cf551e7862a17618d71b60073d3df65a7aa97bf6bac07bef639ded9 SHA512 7687b08bc70a96f8db9a620976b466ff4bb70c8ed77b0c241d060feb8dcab6019d753ac3b182a74139331c9d33f27e090897a0c7c41c1663e16575fef6e21bdf diff --git a/sys-boot/arcload/arcload-0.50-r1.ebuild b/sys-boot/arcload/arcload-0.50-r1.ebuild new file mode 100644 index 000000000000..4a25aaf3d135 --- /dev/null +++ b/sys-boot/arcload/arcload-0.50-r1.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 + +inherit eutils toolchain-funcs versionator + +# Hack until upstream renames from 0.5 to 0.50 +MY_PV="${PV/50/5}" + +DESCRIPTION="ARCLoad - SGI Multi-bootloader. Able to bootload many different SGI Systems" +HOMEPAGE="https://www.linux-mips.org/wiki/ARCLoad" +SRC_URI="https://www.linux-mips.org/pub/linux/mips/people/skylark/arcload-${MY_PV}.tar.bz2" +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="-* ~mips" +IUSE="" +DEPEND="sys-boot/dvhtool" +RDEPEND="" +RESTRICT="strip" + +S="${WORKDIR}/${PN}-${MY_PV}" + +src_prepare() { + # For gcc-4.x, quiet down some of the warnings + $(version_is_at_least "4.0" "$(gcc-version)") && \ + epatch "${FILESDIR}"/${P}-shut-gcc4x-up.patch + + # Redefine the targets in the primary Makefile to give us + # finer control over building the tools. This is for properly + # cross-compiling arcload + epatch "${FILESDIR}"/${P}-makefile-targets.patch +} + +src_compile() { + # Build the wreckoff tool first. It converts a 32bit MIPS ELF + # into a relocatable ECOFF image. We call for BUILD_CC + # on the offchance that we're cross-compiling. + echo -e "" + einfo ">>> Building the 'wreckoff' utility with $(tc-getBUILD_CC) ..." + emake CC=$(tc-getBUILD_CC) tools_clean tools + + # 32bit copy (sashARCS for IP22/IP32) + echo -e "" + einfo ">>> Building 32-bit version (sashARCS) for IP22/IP32 ..." + cd "${S}" + emake MODE=M32 bootloader_clean + emake CC=$(tc-getCC) LD=$(tc-getLD) MODE=M32 bootloader + cp "${S}"/arcload.ecoff "${WORKDIR}"/sashARCS + + # 64bit copy (sash64 for IP27/IP28/IP30) + echo -e "" + einfo ">>> Building 64-bit version (sash64) for IP27/IP28/IP30 ..." + emake MODE=M64 bootloader_clean + emake CC=$(tc-getCC) LD=$(tc-getLD) MODE=M64 bootloader + cp "${S}"/arcload "${WORKDIR}"/sash64 +} + +src_install() { + dodir /usr/lib/arcload + cp "${WORKDIR}"/sashARCS "${D}"/usr/lib/arcload + cp "${WORKDIR}"/sash64 "${D}"/usr/lib/arcload + cp "${S}"/arc.cf-bootcd "${D}"/usr/lib/arcload/arc-bootcd.cf + cp "${S}"/arc.cf-octane "${D}"/usr/lib/arcload/arc-octane.cf +} + +pkg_postinst() { + echo -e "" + einfo "ARCLoad binaries copied to: /usr/lib/arcload" + echo -e "" + einfo "Use of ARCLoad is relatively easy:" + einfo "\t1) Determine which version you need" + einfo "\t\tA) sashARCS for IP22/IP32" + einfo "\t\tB) sash64 for IP27/IP28/IP30" + einfo "\t2) Copy that to the volume header using 'dvhtool'" + einfo "\t3) Edit /usr/lib/arcload/arc-*.cf to fit your specific system" + einfo "\t (See ${HOMEPAGE} for" + einfo "\t an explanation of the format of the config file)" + einfo "\t4) Copy the config file to the volume header with 'dvhtool' as 'arc.cf'" + einfo "\t5) Copy any kernels to the volume header that you want to be bootable" + einfo "\t6) Reboot, and enjoy!" + echo -e "" +} diff --git a/sys-boot/arcload/arcload-0.50-r3.ebuild b/sys-boot/arcload/arcload-0.50-r3.ebuild new file mode 100644 index 000000000000..b35a574efcf1 --- /dev/null +++ b/sys-boot/arcload/arcload-0.50-r3.ebuild @@ -0,0 +1,128 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 + +inherit eutils toolchain-funcs versionator + +# Hack until upstream renames from 0.5 to 0.50 +MY_PV="${PV/50/5}" + +PATCHREV="1" +DESCRIPTION="ARCLoad - SGI Multi-bootloader. Able to bootload many different SGI Systems" +HOMEPAGE="https://www.linux-mips.org/wiki/ARCLoad" +SRC_URI="https://www.linux-mips.org/pub/linux/mips/people/skylark/${PN}-${MY_PV}.tar.bz2 + mirror://gentoo/${P}-patches-v${PATCHREV}.tar.xz" +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="-* ~mips" +IUSE="abi_mips_o32" +DEPEND="sys-boot/dvhtool + abi_mips_o32? ( sys-devel/kgcc64 )" +RDEPEND="" +RESTRICT="strip" + +S="${WORKDIR}/${PN}-${MY_PV}" +PATCHDIR="${WORKDIR}/${P}-patches" + +src_prepare() { + # For gcc-4.x, quiet down some of the warnings + epatch "${PATCHDIR}"/${P}-shut-gcc4x-up.patch + + # Redefine the targets in the primary Makefile to give us + # finer control over building the tools. This is for properly + # cross-compiling arcload + epatch "${PATCHDIR}"/${P}-makefile-targets.patch + + # Patches borrowed from Debian: + # - Load ELF64 images on 32-bit systems - XXX: #543978 + # - Pass an arcload label name directly on the PROM cmdline. + # - Look for arc.cf in /etc and fallback to /. +# epatch "${PATCHDIR}"/${P}_deb-elf64-on-m32.patch + epatch "${PATCHDIR}"/${P}_deb-cmdline-config.patch + epatch "${PATCHDIR}"/${P}_deb-config-in-etc.patch + + # Building arcload on different MIPS ABIs can be difficult, + # so we include specific bits from standard system headers + # to make the compiler happy. These should rarely, if ever, + # change... + epatch "${PATCHDIR}"/${P}-local-elf_h.patch + + # Patch wreckoff.c to handle the new .MIPS.abiflags section. + epatch "${PATCHDIR}"/${P}-wreckoff-abiflags-fix.patch + + # In order to convert from ELF to ECOFF, we need to disable + # SSP, as that adds additional program headers that I don't + # know how to handle in wreckoff.c. + epatch "${PATCHDIR}"/${P}-disable-ssp.patch + + # The code is old and has a lot of issues. But it's just a + # simple bootloader, so silence the various warnings until + # it can be re-written. + epatch "${PATCHDIR}"/${P}-silence-warnings.patch +} + +src_compile() { + local myCC myCC64 myLD myLD64 + + myCC="$(tc-getCC)" + myLD="$(tc-getLD)" + if use abi_mips_o32; then + myCC64=${myCC/mips/mips64} + myLD64=${myLD/mips/mips64} + else + myCC64=${myCC} + myLD64=${myLD} + fi + + # Build the wreckoff tool first. It converts a 32bit MIPS ELF + # into a relocatable ECOFF image. We call for BUILD_CC + # on the offchance that we're cross-compiling. + echo -e "" + einfo ">>> Building the 'wreckoff' utility with $(tc-getBUILD_CC) ..." + emake CC=$(tc-getBUILD_CC) tools_clean tools + + # 32bit copy (sashARCS for IP22/IP32) + echo -e "" + einfo ">>> Building 32-bit version (sashARCS) for IP22/IP32 with ${myCC} ..." + cd "${S}" + emake MODE=M32 bootloader_clean + emake CC=${myCC} LD=${myLD} MODE=M32 bootloader + cp "${S}"/arcload.ecoff "${WORKDIR}"/sashARCS + + # 64bit copy (sash64 for IP27/IP28/IP30) + echo -e "" + einfo ">>> Building 64-bit version (sash64) for IP27/IP28/IP30 ${myCC/mips/mips64} ..." + emake MODE=M64 bootloader_clean + emake CC=${myCC64} LD=${myLD64} MODE=M64 bootloader + cp "${S}"/arcload "${WORKDIR}"/sash64 +} + +src_install() { + dodir /usr/lib/arcload + cp "${WORKDIR}"/sashARCS "${D}"/usr/lib/arcload + cp "${WORKDIR}"/sash64 "${D}"/usr/lib/arcload + cp "${S}"/arc.cf-bootcd "${D}"/usr/lib/arcload/arc-bootcd.cf + cp "${S}"/arc.cf-octane "${D}"/usr/lib/arcload/arc-octane.cf + + # Add a manpage for arcload(8) from the Debian Project. + doman "${FILESDIR}/arcload.8" +} + +pkg_postinst() { + echo -e "" + einfo "ARCLoad binaries copied to: /usr/lib/arcload" + echo -e "" + einfo "Use of ARCLoad is relatively easy:" + einfo "\t1) Determine which version you need" + einfo "\t\tA) sashARCS for IP22/IP32" + einfo "\t\tB) sash64 for IP27/IP28/IP30" + einfo "\t2) Copy that to the volume header using 'dvhtool'" + einfo "\t3) Edit /usr/lib/arcload/arc-*.cf to fit your specific system" + einfo "\t (See ${HOMEPAGE} for" + einfo "\t an explanation of the format of the config file)" + einfo "\t4) Copy the config file to the volume header with 'dvhtool' as 'arc.cf'" + einfo "\t5) Copy any kernels to the volume header that you want to be bootable" + einfo "\t6) Reboot, and enjoy!" + echo -e "" +} diff --git a/sys-boot/arcload/files/arcload.8 b/sys-boot/arcload/files/arcload.8 new file mode 100644 index 000000000000..6d72dd5c5d78 --- /dev/null +++ b/sys-boot/arcload/files/arcload.8 @@ -0,0 +1,65 @@ +.TH "ARCLOAD" "8" "25 November 2007" "" "" +.SH NAME +arcload \- bootloader for SGI/ARCS machines +.SH SYNOPSIS + +\fBarcload\fR \fIdevice\fR + +.SH "DESCRIPTION" +.PP +\fBarcload\fR is a bootloader designed to load any Linux kernel on any +SGI/ARCS machine. It supports booting the kernel from a variety of +filesystems; currently, the following filesystems are supported: +\fBext2\fR (\fBext3\fR), \fBfat\fR, \fBiso9660\fR, \fBjfs\fR, +\fBminix\fR, \fBufs\fR, \fBxfs\fR and the \fB*arcfs\fR +pseudo-filesystem. + +\fBarcload\fP usually resides in the volume header of a disk with an +SGI disklabel. +.SH "USAGE" +.PP +\fIdevice\fR is the device name of the disk containing the volume header +\fBarcload\fR should go into. To use \fBarcload\fR you have to modify +the following PROM variables: +.P +\fIsetenv OSLoader arcload\fR +.P +\fIsetenv SystemPartition dksc(c,d,8)\fR +.P +\fIsetenv OSLoadPartition dksc(c,d,p)\fR +.P +\fIsetenv OSLoadFilename label(option1,option2,...)\fR +.P +where \fIc\fR is the ID of the SCSI controller, \fId\fR the SCSI ID +of the disk \fBarcload\fR resides on and \fIp\fR the partition number +of the partition \fBarc.cf\fR and the kernels reside on (counting +from 0). Note that \fBarc.cf\fR and the directory your kernels are in +(usually / or /boot) have to be on the same partition. On boot, +\fBarcload\fR looks at the \fIOSLoadFilename\fR PROM variable and +tries to find a label with the same name in \fBarc.cf\fR. + +\fBarc.cf\fP can reside either in /etc or at the root of the partition pointed +to by the \fIOSLoadFilename\fP variable. + +.SH "NOTES" +\fBarcload\fR only loads ELF kernels. + +.SH "FILES" +.BR /arc.cf +\fBarcload\fR's configuration file +.P +.BR /usr/share/doc/arcload/examples +configuration file examples +.P +.BR /usr/share/doc/arcload/README.Debian +some notes about arcload for Debian +.PP +.SH "SEE ALSO" +.PP +dvhtool(1) + +.SH "AUTHORS" +ARCLoad was written by Stanislaw Skowronek +<skylark@linux-mips.org>. This manual page was written by Julien +BLACHE <jblache@debian.org> for the Debian Project (but may be used by +others), based on the arcboot(8) manpage. diff --git a/sys-boot/arcload/metadata.xml b/sys-boot/arcload/metadata.xml new file mode 100644 index 000000000000..73d71c655059 --- /dev/null +++ b/sys-boot/arcload/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>mips@gentoo.org</email> + <name>Gentoo/MIPS Port</name> + </maintainer> + <longdescription> + ARCLoad - SGI Multi-bootloader. Able to bootload many different SGI Systems. + </longdescription> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/bootcreator/Manifest b/sys-boot/bootcreator/Manifest new file mode 100644 index 000000000000..af7b46ef78d5 --- /dev/null +++ b/sys-boot/bootcreator/Manifest @@ -0,0 +1 @@ +DIST bootcreator-src.tar.gz 18881 BLAKE2B 5f6375b16d7d676c50d0b61aed5706dbe972bb2eff98e3870df58fc03cf00050788ab1f2da12bb37a839c525bdfa926fcccea5638532454704c3c961a4600a59 SHA512 53a17cc6b6ec9eea06b4162f32068d5f6c86ff066cc152e30c346010b197a88f3266315295c90b7123a68e81fb4ee95e4b0b341ef666df2eaa230ac762892d0e diff --git a/sys-boot/bootcreator/bootcreator-1.1.ebuild b/sys-boot/bootcreator/bootcreator-1.1.ebuild new file mode 100644 index 000000000000..5f9a3fcc145e --- /dev/null +++ b/sys-boot/bootcreator/bootcreator-1.1.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +DESCRIPTION="Simple generator for Forth based BootMenu scripts for Pegasos machines" +HOMEPAGE="http://tbs-software.com/morgoth/projects.html" +SRC_URI="http://tbs-software.com/morgoth/files/bootcreator-src.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ppc" +IUSE="" + +DEPEND="" + +S=${WORKDIR} + +src_compile() { + emake all +} + +src_install() { + dosbin src/bootcreator + dodoc doc/README + + insinto /etc + newins examples/example.bc bootmenu.example +} diff --git a/sys-boot/bootcreator/bootcreator-1.2.ebuild b/sys-boot/bootcreator/bootcreator-1.2.ebuild new file mode 100644 index 000000000000..5f9a3fcc145e --- /dev/null +++ b/sys-boot/bootcreator/bootcreator-1.2.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +DESCRIPTION="Simple generator for Forth based BootMenu scripts for Pegasos machines" +HOMEPAGE="http://tbs-software.com/morgoth/projects.html" +SRC_URI="http://tbs-software.com/morgoth/files/bootcreator-src.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ppc" +IUSE="" + +DEPEND="" + +S=${WORKDIR} + +src_compile() { + emake all +} + +src_install() { + dosbin src/bootcreator + dodoc doc/README + + insinto /etc + newins examples/example.bc bootmenu.example +} diff --git a/sys-boot/bootcreator/metadata.xml b/sys-boot/bootcreator/metadata.xml new file mode 100644 index 000000000000..efd95fbe2be1 --- /dev/null +++ b/sys-boot/bootcreator/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ppc@gentoo.org</email> + <name>Gentoo Linux PowerPC Development</name> + </maintainer> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/colo/Manifest b/sys-boot/colo/Manifest new file mode 100644 index 000000000000..8de2a6b1ba6f --- /dev/null +++ b/sys-boot/colo/Manifest @@ -0,0 +1 @@ +DIST colo-1.22.tar.gz 257968 BLAKE2B f7c8f97b3fed2d2071b89f84e3e78e814914999a3038c854d92e651e4c3a1aa1889e3486f2de94c561475befe4e4a4606e4873c4174ff0b24dcc290f494f5acb SHA512 c983f36991a6275d4864cbd12e00f4e73d3b722746b3d3c8442afc8fe00d5432772c93007999858afb0993e1a4917f94bc9803f017ace3e65535cad7e8fb9b1e diff --git a/sys-boot/colo/colo-1.22.ebuild b/sys-boot/colo/colo-1.22.ebuild new file mode 100644 index 000000000000..36e97640d16e --- /dev/null +++ b/sys-boot/colo/colo-1.22.ebuild @@ -0,0 +1,119 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit eutils toolchain-funcs + +DESCRIPTION="CObalt LOader - Modern bootloader for Cobalt MIPS machines" +HOMEPAGE="https://www.colonel-panic.org/cobalt-mips/" +SRC_URI="https://www.colonel-panic.org/cobalt-mips/colo/colo-${PV}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~mips" +IUSE="" +DEPEND="" +RDEPEND="" +RESTRICT="strip" + +src_prepare() { + epatch "${FILESDIR}"/colo-stage2_src_heap-fix.patch + default +} + +src_compile() { + echo -e "" + einfo ">>> Building the CoLo Bootloader ..." + + # Remove -Werror from CFLAGS + # gcc-4.3.x is more strict; We'll go back and fix later + cd "${S}" + for x in $(grep -rl "Werror" "${S}"/*); do + sed -i -e 's/\-Werror//g' "${x}" + done + + # Keep elf2rfx from automatically building via the Makefile + sed -i -e 's/tools\/elf2rfx //' "${S}"/Makefile + + # Build it first with BUILD_CC in case of cross-compiles + cd "${S}"/tools/elf2rfx + make CC="$(tc-getBUILD_CC)" || die + + # Build the rest + cd "${S}" + make clean || die # emake breaks the build + make CC="$(tc-getCC)" OBJCOPY="$(tc-getOBJCOPY)" \ + STRIP="$(tc-getSTRIP)" || die + + # Now rebuild elf2rfx again with CC so it can be installed + cd "${S}"/tools/elf2rfx + make clean || die + make CC="$(tc-getCC)" || die +} + +src_install() { + # bins + dodir /usr/lib/colo + cp binaries/colo-chain.elf "${D}"/usr/lib/colo + cp binaries/colo-rom-image.bin "${D}"/usr/lib/colo + + # docs + dodoc CHANGES INSTALL README README.{restore,shell,netcon} tools/README.tools TODO + + # all tools except lcdtools (see below) + local tool + for tool in flash-tool colo-perm copy-rom elf2rfx; do + + einfo "Installing ${tool} binary to ${D}/usr/sbin" + dosbin tools/${tool}/${tool} + if [ -f tools/${tool}/${tool}.8 ]; then + einfo "Installing ${tool} manpage to ${D}/usr/share/man" + doman tools/flash-tool/flash-tool.8 + fi + + done + + # lcdtools + for tool in paneld putlcd e2fsck-lcd; do + einfo "Installing ${tool} binary and manpage to ${D}/usr/sbin" + dosbin tools/lcdtools/${tool}/${tool} + doman tools/lcdtools/${tool}/${tool}.8 + done + dolib.a tools/lcdtools/liblcd/liblcd.a + + # bootscripts + dodir /usr/lib/colo/scripts + cp "${FILESDIR}"/*.colo "${D}"/usr/lib/colo/scripts +} + +pkg_postinst() { + echo -e "" + einfo "Install locations:" + einfo " Binaries:\t/usr/lib/${PN}" + einfo " Docs:\t/usr/share/doc/${PF}" + einfo " Tools:\t/usr/sbin/{flash-tool,colo-perm,copy-rom," + einfo " \tputlcd,paneld,e2fsck-lcd,elf2rfx}" + einfo " Scripts:\t/usr/lib/${PN}/scripts" + echo -e "" + einfo "Please read the docs to fully understand the behavior of this bootloader, and" + einfo "edit the boot scripts to suit your needs." + echo -e "" + ewarn "Users installing ${PN} for the first time need to be aware that newer" + ewarn "versions of ${PN} disable the serial port by default. If the serial port" + ewarn "is needed, select it from the boot menu. Users using the example boot" + ewarn "scripts provided will have the serial port automatically enabled." + echo -e "" + ewarn "Note: It is HIGHLY recommended that you use the chain" + ewarn "bootloader (colo-chain.elf) first before attempting to" + ewarn "write the bootloader to the flash chip to verify that" + ewarn "it will work for you. It is also recommended that" + ewarn "you read the documentation in /usr/share/doc/${PF}" + ewarn "as it explains how to properly use this package." + echo -e "" + eerror "Warning: Make sure that IF you plan on flashing the" + eerror "bootloader into the flash chip that you are using a" + eerror "modern 2.4 Linux kernel (i.e., >2.4.18), otherwise" + eerror "you run a risk of destroying the contents of the" + eerror "flash chip and rendering the machine unusable." + echo -e "" + echo -e "" +} diff --git a/sys-boot/colo/files/colo-stage2_src_heap-fix.patch b/sys-boot/colo/files/colo-stage2_src_heap-fix.patch new file mode 100644 index 000000000000..6cd4e3a2a226 --- /dev/null +++ b/sys-boot/colo/files/colo-stage2_src_heap-fix.patch @@ -0,0 +1,24 @@ +diff -Naurp colo-1.22.orig/stage2/src/heap.c colo-1.22/stage2/src/heap.c +--- colo-1.22.orig/stage2/src/heap.c 2006-01-22 10:26:56.000000000 -0500 ++++ colo-1.22/stage2/src/heap.c 2019-10-20 23:20:17.167266445 -0400 +@@ -25,16 +25,16 @@ static size_t next_size; + void heap_reset(void) + { + extern char __text; +- void *restrict; ++ void *restrict2; + + assert(!((unsigned long) &__text & 15)); + + free_lo = KSEG0(0); + free_hi = KSEG0(&__text) - (32 << 10); // XXX + +- restrict = KSEG0(ram_restrict) - (16 << 10); // XXX +- if(free_hi > restrict) +- free_hi = restrict; ++ restrict2 = KSEG0(ram_restrict) - (16 << 10); // XXX ++ if(free_hi > restrict2) ++ free_hi = restrict2; + + image_size = 0; + image_size_mark = 0; diff --git a/sys-boot/colo/files/default.colo b/sys-boot/colo/files/default.colo new file mode 100644 index 000000000000..676a038388d1 --- /dev/null +++ b/sys-boot/colo/files/default.colo @@ -0,0 +1,25 @@ +#:CoLo:# + +# Turn on the serial port +-serial on + +# Generate a menu to select the appropriate kernel image on the LCD Screen +# Format is: +# menu "<message>" <time out> <menu text 1> <menu option 1> <menu text 2> <menu option 2> ... +# +# Where <menu text> is the item displayed, and <menu option> is the item +# that the text corresponds to. When a menu item is selected, the env variable +# {menu-option} gets set to the value of <menu option>. +# +# Please note, no sample script has been provided for a backup script (linuxold). +# You will need to create one yourself if you require this. +menu "colo-@COLOVER@" 100 Linux linux Linux-OLD linuxold + +# Loads the corresponding script depending on the selected value from the menu +-load /boot/menu-{menu-option}.colo +-script + +# Incase of failure, return to the menu +load /boot/default.colo +script + diff --git a/sys-boot/colo/files/menu.colo b/sys-boot/colo/files/menu.colo new file mode 100644 index 000000000000..ddc76135d450 --- /dev/null +++ b/sys-boot/colo/files/menu.colo @@ -0,0 +1,60 @@ +#:CoLo:# +# Example configuration file for CoLo, version 1.16 or above. +# + +# Turn on the serial port; if possible. - means to ignore the error and keep +# going. Without this, execution would halt here if this command failed (e.g. +# on Qube 2700; which lacks serial ports) +-serial on + +# Mount the hard drive +lcd "Mounting hda1" +mount hda1 + +# Ask the user... which kernel? +# Timeout; 50/10 seconds +# +# The format is: +# select "Message Goes Here" TimeOut label1 [label2 ... [labelN]] +# +# This will set the {menu-option} variable to the entry corresponding to the +# selected value, or 0 if no option is selected. +select "Which Kernel?" 50 Working New + +# Now... jump to the line corresponding to the selection... +# +# Explaination of the goto command... +# goto [-]numMarks -- prefixing with - means jump backwards +# or +# goto numMarks{b|f} -- b == jump back, f == jump forward +# +# Marks are indicated by a line starting with a @ symbol. +# +# We use this jump to set the {image-name} variable to a kernel image. +# +# Explaination of the var command: +# var VariableName Value +# + +goto {menu-option} + +# {menu-option} = 0; TimeOut or Cancel +var image-name vmlinux.gz.working + +# Skip to the next two @ lines, start at the third @ line. +goto 3f + +# {menu-option} = 1; "Working" selected. +@var image-name vmlinux.gz.working + +goto 2f +@var image-name vmlinux.gz.new + +# Load the requested image +@lcd "Loading Linux" {image-name} +load /{image-name} + +# Boot +lcd "Booting..." +execute root=/dev/hda5 ro console=ttyS0,115200 +boot diff --git a/sys-boot/colo/files/simple.colo b/sys-boot/colo/files/simple.colo new file mode 100644 index 000000000000..05574454e811 --- /dev/null +++ b/sys-boot/colo/files/simple.colo @@ -0,0 +1,19 @@ +#:CoLo:# +# +# Simple CoLo boot script. + +# Turn serial on; if possible +# - means: "ignore any failure", so if the machine has no serial device (such as +# a Qube 2700), it will simply pretend the command never happened. +-serial on + +# Mount the hard drive +mount hda1 + +# Loads the kernel into memory (and unzips if needed) +# Makes sure this points at the correct kernel image +load /boot/kernel.gz + +# Executes the loaded image with the specified command args +# Change these args to suit your purposes +execute root=/dev/hda5 console=ttyS0,115200 diff --git a/sys-boot/colo/metadata.xml b/sys-boot/colo/metadata.xml new file mode 100644 index 000000000000..988fa03edd7c --- /dev/null +++ b/sys-boot/colo/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>mips@gentoo.org</email> + <name>Mips Team</name> + </maintainer> + + <longdescription> + COLO is CObalt Linux lOader - a Modern Bootloader for Cobalt MIPS machines. + </longdescription> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/cromwell-bin/Manifest b/sys-boot/cromwell-bin/Manifest new file mode 100644 index 000000000000..4b5a97deb499 --- /dev/null +++ b/sys-boot/cromwell-bin/Manifest @@ -0,0 +1 @@ +DIST cromwell-2.40.tar.gz 541204 BLAKE2B b10db3a636c3638aeac71747f9b217acbeab52d19733c6581c369762ff339fd1eb5e6392be9e409f6e278a72b989ba84d81f000f6e1ff2d5ade00b6ce75f7d91 SHA512 492441ea24f8b17b3de2c896b03d823d7a97eac85c07768ea4490c0351c71e80f697caf8b469852213763b8a38a058475f8b78f51523197d10a006deaf461f24 diff --git a/sys-boot/cromwell-bin/cromwell-bin-2.40-r1.ebuild b/sys-boot/cromwell-bin/cromwell-bin-2.40-r1.ebuild new file mode 100644 index 000000000000..1fa0ddde26c7 --- /dev/null +++ b/sys-boot/cromwell-bin/cromwell-bin-2.40-r1.ebuild @@ -0,0 +1,27 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit mount-boot + +DESCRIPTION="Xbox boot loader precompiled binaries from xbox-linux.org" +HOMEPAGE="https://sourceforge.net/projects/xbox-linux/" +SRC_URI="mirror://sourceforge/xbox-linux/cromwell-${PV}.tar.gz" +LICENSE="GPL-2" + +SLOT="0" +KEYWORDS="-* x86" +IUSE="" +RESTRICT="${RESTRICT} strip" + +DEPEND="" +RDEPEND="" + +S=${WORKDIR}/cromwell-${PV} + +src_install() { + dodir /boot/${PN} + insinto /boot/${PN} + doins cromwell{,_1024}.bin xromwell.xbe +} diff --git a/sys-boot/cromwell-bin/metadata.xml b/sys-boot/cromwell-bin/metadata.xml new file mode 100644 index 000000000000..f5547e7794f4 --- /dev/null +++ b/sys-boot/cromwell-bin/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <longdescription>Xbox boot loader (prebuilt binary)</longdescription> + <upstream> + <remote-id type="sourceforge">xbox-linux</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/cromwell/Manifest b/sys-boot/cromwell/Manifest new file mode 100644 index 000000000000..3963a0d14017 --- /dev/null +++ b/sys-boot/cromwell/Manifest @@ -0,0 +1,2 @@ +DIST cromwell-2.40-r3-cvs-fixes.patch.lzma 7075 BLAKE2B 25a499c49822b7b4f8f6ac0a1c531c3545c4dcc76f776c257cf4112ad5f80b7708a80c2d870bcdd30f4a1322267952fe6081d280ef21b6b169cef0f3c7914fa4 SHA512 b5d7c37024562a8a5ee8b1bf560f852ac43e0a0fbae0d3a8aa55aceab9f56cee5e80bcedad12bb64160ceb33a79fbb86f10cd6d5efeede6a5433d825aa853114 +DIST cromwell-2.40.tar.bz2 943015 BLAKE2B 37978a46ddac6acc6881e37a566c669aba8d576f8c3fe703a3bc03d7f977cc7fd8b877694d47ffca967d4d2109104838bf02ae7511184fe0aaae39502c82e8bd SHA512 ed5833281fbe82dfad0a195f57f127cfcfb1d3fb7ff7179dccf59dea3c3a945d874d0d87c21fc2af641de5a39b9cc8a8703fa17edd43973ef526d368e21ddb37 diff --git a/sys-boot/cromwell/cromwell-2.40-r3.ebuild b/sys-boot/cromwell/cromwell-2.40-r3.ebuild new file mode 100644 index 000000000000..7ce7e1fd24b1 --- /dev/null +++ b/sys-boot/cromwell/cromwell-2.40-r3.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="4" + +inherit eutils mount-boot toolchain-funcs flag-o-matic + +DESCRIPTION="Xbox boot loader" +HOMEPAGE="http://www.xbox-linux.org/wiki/Cromwell" +SRC_URI="mirror://gentoo/${P}.tar.bz2 + mirror://gentoo/${PF}-cvs-fixes.patch.lzma" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* x86" +IUSE="" +RESTRICT="strip" + +src_prepare() { + epatch "${WORKDIR}"/${PF}-cvs-fixes.patch + epatch "${FILESDIR}"/${P}-gcc-4.6.patch #363535 + sed -i 's:-Werror:-m32:' Makefile Rules.make || die + sed -i '/^EXTRA_CFLAGS/s:$: -m32:' Rules.make boot_rom/Makefile || die + sed -i \ + -e '/^bin.imagebld:/,$s:\<gcc\>:${CC}:' \ + Makefile || die + append-flags -m32 +} + +src_compile() { + emake -j1 CC="$(tc-getCC)" LD="$(tc-getLD)" +} + +src_install() { + insinto /boot/${PN} + doins image/cromwell{,_1024}.bin xbe/xromwell.xbe +} diff --git a/sys-boot/cromwell/files/cromwell-2.40-gcc-4.6.patch b/sys-boot/cromwell/files/cromwell-2.40-gcc-4.6.patch new file mode 100644 index 000000000000..92de3b014b61 --- /dev/null +++ b/sys-boot/cromwell/files/cromwell-2.40-gcc-4.6.patch @@ -0,0 +1,39 @@ +newer gcc versions will output .text.unlikely which this linker script +doesn't expect + +https://bugs.gentoo.org/363535 + +--- a/scripts/ldscript-crom.ld ++++ b/scripts/ldscript-crom.ld +@@ -21,7 +21,7 @@ SECTIONS { + + .text LOW_ROM : AT ( 0 ){ + _start_low_rom = . ; +- *(.text); ++ *(.text .text.*); + _end_low_rom = . ; + } + +@@ -67,4 +67,5 @@ SECTIONS { + + _end_complete_rom = SIZEOF(.text) + SIZEOF(.rodata) + SIZEOF(.data) + SIZEOF(.bss); + ++ /DISCARD/ : { *(.eh_frame) } + } +--- a/boot_rom/bootrom.ld ++++ b/boot_rom/bootrom.ld +@@ -31,7 +31,7 @@ SECTIONS { + .text (RAM_CODE) : AT( SIZEOF(.low_rom) ) { + _ram_location = .; + _start_ramcopy = _end_rom; +- *(.text); ++ *(.text .text.*); + _start_checksum = _start_ramcopy - LOW_ROM; + } + +@@ -74,4 +74,5 @@ SECTIONS { + } = 0x90909090 + */ + ++ /DISCARD/ : { *(.eh_frame) } + } diff --git a/sys-boot/cromwell/metadata.xml b/sys-boot/cromwell/metadata.xml new file mode 100644 index 000000000000..1ea63b162422 --- /dev/null +++ b/sys-boot/cromwell/metadata.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <longdescription>Xbox boot loader</longdescription> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/dvhtool/Manifest b/sys-boot/dvhtool/Manifest new file mode 100644 index 000000000000..3c6f389ba248 --- /dev/null +++ b/sys-boot/dvhtool/Manifest @@ -0,0 +1 @@ +DIST dvhtool_1.0.1.orig.tar.gz 53283 BLAKE2B 7268d3bda57988ab9432d88c3c220a450a4726fd5b2560315e731b50d9088f66821a2629f7d0059305c880e429b77f40f609ea0798d362fb7b5831002a453967 SHA512 e81c4427f98a7aa79b9e8cee6fad35822d5fa48fda17f656407d1d6de50658ff2c8b6c3a890ae07afafebf126b5388c98ebf63af4a93bf1091161a27ea09d140 diff --git a/sys-boot/dvhtool/dvhtool-1.0.1-r2.ebuild b/sys-boot/dvhtool/dvhtool-1.0.1-r2.ebuild new file mode 100644 index 000000000000..784aecf4b352 --- /dev/null +++ b/sys-boot/dvhtool/dvhtool-1.0.1-r2.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 + +inherit autotools eutils toolchain-funcs + +DESCRIPTION="Tool to copy kernel(s) into the volume header on SGI MIPS-based workstations" +HOMEPAGE="http://packages.debian.org/unstable/utils/dvhtool" +SRC_URI="mirror://debian/pool/main/d/dvhtool/dvhtool_1.0.1.orig.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~mips ~x86" +IUSE="" +DEPEND="" +RDEPEND="" + +S="${S}.orig" + +src_prepare() { + # several applicable hunks from a debian patch + epatch "${FILESDIR}"/${P}-debian.diff + + # Newer minor patches from Debian + epatch "${FILESDIR}"/${P}-debian-warn_type_guess.diff + epatch "${FILESDIR}"/${P}-debian-xopen_source.diff + + # Allow dvhtool to recognize Linux RAID and Linux LVM partitions + epatch "${FILESDIR}"/${P}-add-raid-lvm-parttypes.patch + + eautoreconf +} + +src_configure() { + CC=$(tc-getCC) LD=$(tc-getLD) \ + econf +} + +src_compile() { + CC=$(tc-getCC) LD=$(tc-getLD) \ + emake +} diff --git a/sys-boot/dvhtool/files/dvhtool-1.0.1-add-raid-lvm-parttypes.patch b/sys-boot/dvhtool/files/dvhtool-1.0.1-add-raid-lvm-parttypes.patch new file mode 100644 index 000000000000..2a3cd753252b --- /dev/null +++ b/sys-boot/dvhtool/files/dvhtool-1.0.1-add-raid-lvm-parttypes.patch @@ -0,0 +1,24 @@ +diff -Naurp dvhtool-1.0.1.orig-A/dvh.h dvhtool-1.0.1.orig/dvh.h +--- dvhtool-1.0.1.orig-A/dvh.h 2005-09-28 02:45:56 -0400 ++++ dvhtool-1.0.1.orig/dvh.h 2005-09-28 02:41:15 -0400 +@@ -129,6 +129,8 @@ struct partition_table { /* one per log + #define PTYPE_XVM 13 /* partition is sgi XVM */ + #define PTYPE_LSWAP 0x82 /* partition is Linux swap */ + #define PTYPE_LINUX 0x83 /* partition is Linux native */ ++#define PTYPE_LLVM 0x8e /* partition is Linux LVM */ ++#define PTYPE_LRAID 0xfd /* partition is Linux RAID */ + #define NPTYPES 16 + + #define VHMAGIC 0xbe5a941 /* randomly chosen value */ +diff -Naurp dvhtool-1.0.1.orig-A/dvhlib.c dvhtool-1.0.1.orig/dvhlib.c +--- dvhtool-1.0.1.orig-A/dvhlib.c 2005-09-28 02:45:56 -0400 ++++ dvhtool-1.0.1.orig/dvhlib.c 2005-09-28 02:41:45 -0400 +@@ -52,6 +52,8 @@ ptype2str(int ptype) + case PTYPE_XVM: return "XVM Volume"; + case PTYPE_LSWAP: return "Linux Swap"; + case PTYPE_LINUX: return "Linux Native"; ++ case PTYPE_LLVM: return "Linux LVM"; ++ case PTYPE_LRAID: return "Linux RAID"; + } + return "Unknown Partition Type"; + } diff --git a/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-warn_type_guess.diff b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-warn_type_guess.diff new file mode 100644 index 000000000000..bab2a305be92 --- /dev/null +++ b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-warn_type_guess.diff @@ -0,0 +1,12 @@ +--- a/dvhlib.h ++++ b/dvhlib.h +@@ -3,7 +3,8 @@ #include "config.h" + #ifdef HAVE_INTTYPES_H + #include <inttypes.h> + #else +-typedef unsigned int uint32_t; /* A guess ... */ ++ #warning Guessing type of uint32_t ++ typedef unsigned int uint32_t; /* A guess ... */ + #endif + + #include "dvh.h" diff --git a/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-xopen_source.diff b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-xopen_source.diff new file mode 100644 index 000000000000..333eb2a74064 --- /dev/null +++ b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian-xopen_source.diff @@ -0,0 +1,11 @@ +diff --git a/dvhlib.c b/dvhlib.c +--- a/dvhlib.c ++++ b/dvhlib.c +@@ -1,6 +1,7 @@ + /* + * Disk Volume Header Library + */ ++#define _XOPEN_SOURCE 500 + #include <stdio.h> + #include <stdlib.h> + #include <string.h> diff --git a/sys-boot/dvhtool/files/dvhtool-1.0.1-debian.diff b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian.diff new file mode 100644 index 000000000000..43f33ffc2596 --- /dev/null +++ b/sys-boot/dvhtool/files/dvhtool-1.0.1-debian.diff @@ -0,0 +1,135 @@ +--- dvhtool-1.0.1.orig/dvh.h ++++ dvhtool-1.0.1/dvh.h +@@ -127,6 +127,8 @@ + #define PTYPE_XFSLOG 11 /* partition is sgi XFS log */ + #define PTYPE_XLV 12 /* partition is part of an XLV vol */ + #define PTYPE_XVM 13 /* partition is sgi XVM */ ++#define PTYPE_LSWAP 0x82 /* partition is Linux swap */ ++#define PTYPE_LINUX 0x83 /* partition is Linux native */ + #define NPTYPES 16 + + #define VHMAGIC 0xbe5a941 /* randomly chosen value */ +--- dvhtool-1.0.1.orig/dvhlib.c ++++ dvhtool-1.0.1/dvhlib.c +@@ -50,6 +50,8 @@ + case PTYPE_XFSLOG: return "XFS Log"; + case PTYPE_XLV: return "XLV Volume"; + case PTYPE_XVM: return "XVM Volume"; ++ case PTYPE_LSWAP: return "Linux Swap"; ++ case PTYPE_LINUX: return "Linux Native"; + } + return "Unknown Partition Type"; + } +@@ -325,8 +327,10 @@ + if (res == -1) + die("Couldn't stat source file"); + +- /* XXX pad to blocksize? */ +- size = vh->vh_pt[8].pt_nblks * blksize - istat.st_size; ++ /* calculate free blocks in vh */ ++ size = vh->vh_pt[8].pt_nblks /* total vh size */ ++ - ( vh->vh_pt[8].pt_firstlbn + 4 ) /* reserved area */ ++ - (( istat.st_size + blksize - 1 ) / blksize ); /* pad to blocksize */ + /* + * Are we replacing an existing file, check for enough space and free + * entry in volume header +@@ -336,16 +340,15 @@ + /* It's an existing file, delete it. */ + memset(vd->vd_name, 0, VDNAMESIZE); + vd->vd_nbytes = 0; +- break; + } + if ( vd->vd_nbytes ) { +- size -= vd->vd_nbytes; ++ size -= (vd->vd_nbytes + blksize - 1 ) / blksize; /* pad to blocksize */ + num++; + } + vd++; + } + +- if ( num == NVDIR ) ++ if ( num == NVDIR ) + die("No more free entries in volume header"); + if ( size <= 0 ) + die("Not enough space left in volume header"); +@@ -403,7 +406,7 @@ + die("Short write"); + } + } +- dest += (vd->vd_nbytes + 511) / 512; /* XXX Blocksize */ ++ dest += (vd->vd_nbytes + blksize - 1) / blksize; + vd++; + } + +--- dvhtool-1.0.1.orig/dvhtool.8 ++++ dvhtool-1.0.1/dvhtool.8 +@@ -1,4 +1,4 @@ +-.TH DVHTOOL 1 "July 2000" ++.TH DVHTOOL 8 "July 2000" + .UC 4 + .SH NAME + dvhtool \- Disk volume header manipulation tool +@@ -85,4 +85,4 @@ + .PP + .I dvhtool + was written by Ralf Baechle <ralf@oss.sgi.com>, Keith M. Wesolowski <wesolows@foobazco.org>, +-Tor Arntsen <tor@spacetec.no>, Guido Guenther <guido.guenther@gmx.net>. ++Tor Arntsen <tor@spacetec.no>, Guido Guenther <agx@debian.org>. +--- dvhtool-1.0.1.orig/Makefile.in ++++ dvhtool-1.0.1/Makefile.in +@@ -1,4 +1,4 @@ +-# Makefile.in generated automatically by automake 1.4a from Makefile.am ++# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am + + # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation +@@ -46,10 +46,9 @@ + AUTOHEADER = @AUTOHEADER@ + + INSTALL = @INSTALL@ +-INSTALL_PROGRAM = @INSTALL_PROGRAM@ ++INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_SCRIPT = @INSTALL_SCRIPT@ +-INSTALL_STRIP_FLAG = + transform = @program_transform_name@ + + NORMAL_INSTALL = : +@@ -104,7 +103,7 @@ + + DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +-TAR = gtar ++TAR = tar + GZIP_ENV = --best + DEP_FILES = .deps/dvhlib.P .deps/dvhtool.P .deps/getopt.P \ + .deps/getopt1.P .deps/pread.P +@@ -124,7 +123,7 @@ + $(ACLOCAL_M4): configure.in acinclude.m4 + cd $(srcdir) && $(ACLOCAL) + +-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) ++config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) +@@ -173,8 +172,8 @@ + $(mkinstalldirs) $(DESTDIR)$(sbindir) + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ +- echo " $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ +- $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ ++ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ ++ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +@@ -382,7 +381,7 @@ + all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS) config.h + all-redirect: all-am + install-strip: +- $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install ++ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install + installdirs: + $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8 + diff --git a/sys-boot/dvhtool/metadata.xml b/sys-boot/dvhtool/metadata.xml new file mode 100644 index 000000000000..1f8feffa60a3 --- /dev/null +++ b/sys-boot/dvhtool/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>mips@gentoo.org</email> + <name>Gentoo/MIPS Port</name> +</maintainer> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/efibootmgr/Manifest b/sys-boot/efibootmgr/Manifest new file mode 100644 index 000000000000..299c980bdb86 --- /dev/null +++ b/sys-boot/efibootmgr/Manifest @@ -0,0 +1,3 @@ +DIST efibootmgr-14.tar.bz2 34972 BLAKE2B 78490756c5fd449f4319b79e0818e9d80340bd487f57d0de34f79f48cc24eb7b9c7309b535d00efad4babd40904d4cfb085cca278170625a1e875961e423f5dd SHA512 97935f8752440ce236162e174ea3404e907ebddc5877d597a97813da76ad580689fc2e97044885fc860a12a473af7183242b6120e78e53243d35e569fb002baf +DIST efibootmgr-15.tar.bz2 35476 BLAKE2B 19b7c9ce51f3b930b2d59fa4a594c7a8bf5f1c7aa3224049e88cdafe82991799b1b719ec68c80131027f70c16bd19e38157f5d0bc7761843959410c667aa4070 SHA512 d9d9eef14d373d5da88141e8105f754fea4c039755ed0a0cb9b3c9c2bb285733ad930fd912df42075fe2cf750585699307b067f594d8e65269b3b8a5a00b1cd1 +DIST efibootmgr-16.tar.bz2 36603 BLAKE2B 3d09a9d3c4ecd48010315fccae60ab408c0d08e9c734e86a944130ea03e038835fa08745819f5353efbbe36f5017be64faded4b625ef0a0b55d4ca0d612ef232 SHA512 936318c7163c07b716f89be3d830957d9db68ba1b059223f7ea3d9eafe0dbf1c91b9aee096f5aed70955c6052c3b8547295c0a47f17cdf43788259d87d1990b9 diff --git a/sys-boot/efibootmgr/efibootmgr-14.ebuild b/sys-boot/efibootmgr/efibootmgr-14.ebuild new file mode 100644 index 000000000000..8266a96d6802 --- /dev/null +++ b/sys-boot/efibootmgr/efibootmgr-14.ebuild @@ -0,0 +1,28 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit toolchain-funcs + +DESCRIPTION="User-space application to modify the EFI boot manager" +HOMEPAGE="https://github.com/rhinstaller/efibootmgr" +SRC_URI="https://github.com/rhinstaller/efibootmgr/releases/download/${PV}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 ~ia64 x86" +IUSE="" + +RDEPEND="sys-apps/pciutils + >=sys-libs/efivar-25:=" +DEPEND="${RDEPEND}" + +src_prepare() { + default + sed -i -e s/-Werror// Make.defaults || die +} + +src_configure() { + tc-export CC +} diff --git a/sys-boot/efibootmgr/efibootmgr-15.ebuild b/sys-boot/efibootmgr/efibootmgr-15.ebuild new file mode 100644 index 000000000000..b51f8d148de9 --- /dev/null +++ b/sys-boot/efibootmgr/efibootmgr-15.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit toolchain-funcs + +DESCRIPTION="User-space application to modify the EFI boot manager" +HOMEPAGE="https://github.com/rhinstaller/efibootmgr" +SRC_URI="https://github.com/rhinstaller/efibootmgr/releases/download/${PV}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 ~ia64 x86" +IUSE="" + +RDEPEND="sys-apps/pciutils + >=sys-libs/efivar-25:=" +DEPEND="${RDEPEND}" + +src_prepare() { + default + sed -i -e s/-Werror// Make.defaults || die +} + +src_configure() { + tc-export CC + export EFIDIR="Gentoo" +} diff --git a/sys-boot/efibootmgr/efibootmgr-16.ebuild b/sys-boot/efibootmgr/efibootmgr-16.ebuild new file mode 100644 index 000000000000..70350fc76a42 --- /dev/null +++ b/sys-boot/efibootmgr/efibootmgr-16.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit toolchain-funcs + +DESCRIPTION="User-space application to modify the EFI boot manager" +HOMEPAGE="https://github.com/rhinstaller/efibootmgr" +SRC_URI="https://github.com/rhinstaller/efibootmgr/releases/download/${PV}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 ~ia64 x86" +IUSE="" + +RDEPEND="sys-apps/pciutils + >=sys-libs/efivar-25:=" +DEPEND="${RDEPEND}" + +src_prepare() { + default + sed -i -e 's/-Werror //' Make.defaults || die +} + +src_configure() { + tc-export CC + export EFIDIR="Gentoo" +} + +src_compile() { + emake PKG_CONFIG="$(tc-getPKG_CONFIG)" +} diff --git a/sys-boot/efibootmgr/metadata.xml b/sys-boot/efibootmgr/metadata.xml new file mode 100644 index 000000000000..8329db4fda00 --- /dev/null +++ b/sys-boot/efibootmgr/metadata.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>floppym@gentoo.org</email> + <name>Mike Gilbert</name> + </maintainer> + <longdescription> + This is efibootmgr, a Linux user-space application to modify the Intel + Extensible Firmware Interface (EFI) Boot Manager. This application + can create and destroy boot entries, change the boot order, change + the next running boot option, and more. + </longdescription> + <upstream> + <remote-id type="github">rhinstaller/efibootmgr</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/elilo/Manifest b/sys-boot/elilo/Manifest new file mode 100644 index 000000000000..41b5e2e78a3e --- /dev/null +++ b/sys-boot/elilo/Manifest @@ -0,0 +1,2 @@ +DIST elilo-3.16-all.tar.gz 485844 BLAKE2B 813762ffef32a640c074973a07d886e0de137be10ff08e9375cd894b0d83dd8bc96cc33f80da1e698db49cc9f105a905abb2fa04048eaca394d3d70e79cb8534 SHA512 4289b45f2e40b2a12167f2efd9a482cf97baedb13fc24813f360f375296d0d3f107d6c980b4b31262816f664a2536353fa124e689cbd65093da9b16fdddaf842 +DIST elilo_3.14-3.debian.tar.gz 32179 BLAKE2B 84f8055d3e33b99ce91079768da80a8800c3c2f569ce5619641a983efb943055dfd9a8fb2fda8e5e6d60009ffefbcc1573098f022f06635d4d5304bc3bfddf1e SHA512 b2d5927bf84d61cc432fc916301ddb3be74db16d3e5ba4f13039e2925606b8870991fbb17f837005d8f2b655b7dcd2b2311dfacd7f02183762caf7081ede638f diff --git a/sys-boot/elilo/elilo-3.16-r3.ebuild b/sys-boot/elilo/elilo-3.16-r3.ebuild new file mode 100644 index 000000000000..e9dc2ce50c70 --- /dev/null +++ b/sys-boot/elilo/elilo-3.16-r3.ebuild @@ -0,0 +1,90 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit toolchain-funcs eutils multilib + +DESCRIPTION="Linux boot loader for EFI-based systems such as IA-64" +HOMEPAGE="https://sourceforge.net/projects/elilo/" +SRC_URI="mirror://sourceforge/elilo/${P}-all.tar.gz + mirror://debian/pool/main/e/elilo/elilo_3.14-3.debian.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ia64 ~x86" +IUSE="" + +# gnu-efi contains only static libs, so there's no run-time dep on it +DEPEND=">=sys-boot/gnu-efi-3.0g + dev-util/patchutils" +# dosfstools[compat] to enable 'dosfsck' symlink +RDEPEND="sys-boot/efibootmgr + sys-fs/dosfstools[compat]" + +S="${WORKDIR}/${P}-source" + +PATCHES=( + "${FILESDIR}"/${PN}-3.16-elilo-loop.patch #299665 + "${FILESDIR}"/${PN}-3.16-gnu-efi-3.0.6-ia64.patch + "${FILESDIR}"/${PN}-3.16-strncpy-clash.patch +) + +src_unpack() { + unpack ${A} ./${P}-source.tar.gz + mv debian "${S}"/ || die +} + +src_prepare() { + default + + case $(tc-arch) in + ia64) iarch=ia64 ;; + x86) iarch=ia32 ;; + amd64) iarch=x86_64 ;; + *) die "unknown architecture: $(tc-arch)" ;; + esac + + # Now Gentooize it. + sed -i \ + -e '1s:/bin/sh:/bin/bash:' \ + -e "s:##VERSION##:${PV}:" \ + -e 's:Debian GNU/:Gentoo :g' \ + -e 's:Debian:Gentoo:g' \ + -e 's:debian:gentoo:g' \ + -e "s:dpkg --print-architecture:echo ${iarch}:" \ + debian/elilo.sh || die +} + +src_compile() { + # "prefix" on the next line specifies where to find gcc, as, ld, + # etc. It's not the usual meaning of "prefix". By blanking it we + # allow PATH to be searched. + local libdir="${SYSROOT}${EPREFIX}/usr/$(get_libdir)" + emake -j1 \ + prefix= \ + AS="$(tc-getAS)" \ + CC="$(tc-getCC)" \ + LD="$(tc-getLD)" \ + OBJCOPY="$(tc-getOBJCOPY)" \ + HOSTARCH=${iarch} \ + ARCH=${iarch} \ + EFIINC="${SYSROOT}${EPREFIX}/usr/include/efi" \ + GNUEFILIB="${libdir}" \ + EFILIB="${libdir}" \ + EFICRT0="${libdir}" +} + +src_install() { + exeinto /usr/lib/elilo + doexe elilo.efi + + newsbin debian/elilo.sh elilo + dosbin tools/eliloalt + + insinto /etc + newins "${FILESDIR}"/elilo.conf.sample elilo.conf + + dodoc docs/* "${FILESDIR}"/elilo.conf.sample + doman debian/*.[0-9] +} diff --git a/sys-boot/elilo/files/elilo-3.16-elilo-loop.patch b/sys-boot/elilo/files/elilo-3.16-elilo-loop.patch new file mode 100644 index 000000000000..b574c29f220b --- /dev/null +++ b/sys-boot/elilo/files/elilo-3.16-elilo-loop.patch @@ -0,0 +1,15 @@ +https://bugs.gentoo.org/299665 + +patch by Dennis Schridde <devurandom@gmx.net> + +--- a/debian/elilo.sh ++++ b/debian/elilo.sh +@@ -321,6 +321,8 @@ + + mnt() + { ++ local loop ++ + ## we can even create bootstrap filesystem images directly if you + ## ever wanted too. + if [ -f "$boot" ] ; then diff --git a/sys-boot/elilo/files/elilo-3.16-gnu-efi-3.0.6-ia64.patch b/sys-boot/elilo/files/elilo-3.16-gnu-efi-3.0.6-ia64.patch new file mode 100644 index 000000000000..21f10f316441 --- /dev/null +++ b/sys-boot/elilo/files/elilo-3.16-gnu-efi-3.0.6-ia64.patch @@ -0,0 +1,112 @@ +Disambiguate setpjmp()/longjmp()/jmp_buf across elilo copy and gnu-efi-3.0.6. + +In order not to chang the behaviour I'm keeping elilo's implementation +as the jmp_buf passing ABI is slightly different scross the two. + + setjmp.h:25:14: error: conflicting types for 'jmp_buf' + typedef long jmp_buf[_JBLEN] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */ + ^~~~~~~ + In file included from /usr/include/efi/efisetjmp.h:5:0, + from /usr/include/efi/efi.h:60, + from gzip.c:29: + /usr/include/efi/ia64/efisetjmp_arch.h:45:23: note: previous declaration of 'jmp_buf' was here + } ALIGN(JMPBUF_ALIGN) jmp_buf; + ^~~~~~~ +diff --git a/ia64/gzip.c b/ia64/gzip.c +index cc0c943..e2d40f6 100644 +--- a/ia64/gzip.c ++++ b/ia64/gzip.c +@@ -138,3 +138,3 @@ static void error(char *m); + +-static jmp_buf jbuf; ++static jmp_buf_ia64_elilo jbuf; + static int error_return; +@@ -598,3 +598,3 @@ load_abort: + error_return = ELILO_LOAD_ABORTED; +- longjmp(jbuf, 1); ++ longjmp_ia64_elilo(jbuf, 1); + } +@@ -606,3 +606,3 @@ error(char *x) + /* will eventually exit with error from gunzip() */ +- longjmp(jbuf,1); ++ longjmp_ia64_elilo(jbuf,1); + } +@@ -645,3 +645,3 @@ gunzip_kernel(fops_fd_t fd, kdesc_t *kd) + +- if (setjmp(jbuf) == 1) goto error; ++ if (setjmp_ia64_elilo(jbuf) == 1) goto error; + +diff --git a/ia64/longjmp.S b/ia64/longjmp.S +index 23dec86..5341632 100644 +--- a/ia64/longjmp.S ++++ b/ia64/longjmp.S +@@ -18,5 +18,5 @@ + +- Note that __sigsetjmp() did NOT flush the register stack. Instead, +- we do it here since __longjmp() is usually much less frequently +- invoked than __sigsetjmp(). The only difficulty is that __sigsetjmp() ++ Note that __sigsetjmp_ia64_elilo() did NOT flush the register stack. Instead, ++ we do it here since __longjmp_ia64_elilo() is usually much less frequently ++ invoked than __sigsetjmp(). The only difficulty is that __sigsetjmp_ia64_elilo() + didn't (and wouldn't be able to) save ar.rnat either. This is a problem +@@ -40,8 +40,8 @@ + +- /* __longjmp(__jmp_buf buf, int val) */ ++ /* __longjmp_ia64_elilo(__jmp_buf_ia64_elilo buf, int val) */ + + .text +- .global longjmp +- .proc longjmp +-longjmp: ++ .global longjmp_ia64_elilo ++ .proc longjmp_ia64_elilo ++longjmp_ia64_elilo: + alloc r8=ar.pfs,2,1,0,0 +@@ -161,2 +161,2 @@ longjmp: + br.ret.dptk.few rp +- .endp longjmp ++ .endp longjmp_ia64_elilo +diff --git a/ia64/setjmp.S b/ia64/setjmp.S +index 4c83d03..57f5542 100644 +--- a/ia64/setjmp.S ++++ b/ia64/setjmp.S +@@ -70,14 +70,14 @@ + .text +- .global setjmp +- .proc setjmp +-setjmp: ++ .global setjmp_ia64_elilo ++ .proc setjmp_ia64_elilo ++setjmp_ia64_elilo: + alloc r8=ar.pfs,2,0,0,0 + mov in1=1 +- br.cond.sptk.many __sigsetjmp +- .endp setjmp ++ br.cond.sptk.many __sigsetjmp_ia64_elilo ++ .endp setjmp_ia64_elilo + +- /* __sigsetjmp(__jmp_buf buf, int savemask) */ ++ /* __sigsetjmp_ia64_elilo(__jmp_buf buf, int savemask) */ + +- .proc __sigsetjmp +-__sigsetjmp: ++ .proc __sigsetjmp_ia64_elilo ++__sigsetjmp_ia64_elilo: + //.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2) +@@ -173,2 +173,2 @@ __sigsetjmp: + +- .endp __sigsetjmp ++ .endp __sigsetjmp_ia64_elilo +diff --git a/ia64/setjmp.h b/ia64/setjmp.h +index 91bbfc1..f9e654d 100644 +--- a/ia64/setjmp.h ++++ b/ia64/setjmp.h +@@ -24,5 +24,5 @@ + /* the __jmp_buf element type should be __float80 per ABI... */ +-typedef long jmp_buf[_JBLEN] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */ ++typedef long jmp_buf_ia64_elilo[_JBLEN] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */ + +-extern int setjmp (jmp_buf __env); +-extern void longjmp (jmp_buf __env, int __val); ++extern int setjmp_ia64_elilo (jmp_buf_ia64_elilo __env); ++extern void longjmp_ia64_elilo (jmp_buf_ia64_elilo __env, int __val); diff --git a/sys-boot/elilo/files/elilo-3.16-strncpy-clash.patch b/sys-boot/elilo/files/elilo-3.16-strncpy-clash.patch new file mode 100644 index 000000000000..fb2f6878be03 --- /dev/null +++ b/sys-boot/elilo/files/elilo-3.16-strncpy-clash.patch @@ -0,0 +1,23 @@ +gnu-efi-3.0.8 added StrnCpy. This caused conflict with elilo's definition: + ./../fs/../strops.h:30:16: error: conflicting types for 'StrnCpy' + extern CHAR16 *StrnCpy(OUT CHAR16 *dst, IN const CHAR16 *src, UINTN count); + ^~~~~~~ + +Work it around by always using private copy. + +Reported-by: Bill Glessner +--- a/strops.h ++++ b/strops.h +@@ -29,3 +29,4 @@ + extern CHAR16 *StrChr(IN const CHAR16 *s, const CHAR16 c); ++#define StrnCpy elilo_StrnCpy + extern CHAR16 *StrnCpy(OUT CHAR16 *dst, IN const CHAR16 *src, UINTN count); + extern CHAR8 *StrnXCpy(OUT CHAR8 *dst, IN const CHAR16 *src, UINTN count); +--- a/strops.c ++++ b/strops.c +@@ -27,4 +27,6 @@ + #include <efilib.h> + ++#include "strops.h" ++ + //#define CHAR_NULL (CHAR16)'\0' diff --git a/sys-boot/elilo/files/elilo.conf.sample b/sys-boot/elilo/files/elilo.conf.sample new file mode 100644 index 000000000000..ed97975c69d7 --- /dev/null +++ b/sys-boot/elilo/files/elilo.conf.sample @@ -0,0 +1,9 @@ +boot=/dev/sda1 +install=/usr/lib/elilo/elilo.efi +delay=20 +default=gentoo + +image=/boot/kernel-2.6.12-gentoo-r6 + label=gentoo + root=/dev/sda3 + read-only diff --git a/sys-boot/elilo/metadata.xml b/sys-boot/elilo/metadata.xml new file mode 100644 index 000000000000..c5e406a7fdf9 --- /dev/null +++ b/sys-boot/elilo/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ia64@gentoo.org</email> + <name>Gentoo Linux IA-64 Development</name> + </maintainer> + <upstream> + <remote-id type="sourceforge">elilo</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/gnu-efi/Manifest b/sys-boot/gnu-efi/Manifest new file mode 100644 index 000000000000..0e4ed33baf64 --- /dev/null +++ b/sys-boot/gnu-efi/Manifest @@ -0,0 +1 @@ +DIST gnu-efi-3.0.11.tar.bz2 154456 BLAKE2B dd8d5100ee65e2f94d6b67f0d2236674c7c2b6f553ac0b2d8fdc83e49c69bec0dce1e2e8730705f70b3b7b0a61e4f065773667945ffc92a6f40eba381fcf6723 SHA512 1a6b06b69eb95e03c00fb1c476bf346ab2cb0ecca9a44e163f52f2aa4b9837d3dd2d3ed8b4ce77aaf32a66e49f826ea5b43a97c8c7c56aaa030bc20b3415122a diff --git a/sys-boot/gnu-efi/files/gnu-efi-3.0.9-fix-clang-build.patch b/sys-boot/gnu-efi/files/gnu-efi-3.0.9-fix-clang-build.patch new file mode 100644 index 000000000000..0e4ec7d77b0c --- /dev/null +++ b/sys-boot/gnu-efi/files/gnu-efi-3.0.9-fix-clang-build.patch @@ -0,0 +1,19 @@ +Bug: https://bugs.gentoo.org/695612 +Upstream: https://sourceforge.net/p/gnu-efi/patches/70/ + +--- a/Make.defaults ++++ b/Make.defaults +@@ -110,10 +110,10 @@ + || ( [ $(GCCVERSION) -eq "4" ] \ + && [ $(GCCMINOR) -ge "7" ] ) ) \ + && echo 1) +- ifeq ($(GCCNEWENOUGH),1) +- CPPFLAGS += -DGNU_EFI_USE_MS_ABI -maccumulate-outgoing-args --std=c11 +- else ifeq ($(USING_CLANG),clang) ++ ifeq ($(USING_CLANG),clang) + CPPFLAGS += -DGNU_EFI_USE_MS_ABI --std=c11 ++ else ifeq ($(GCCNEWENOUGH),1) ++ CPPFLAGS += -DGNU_EFI_USE_MS_ABI -maccumulate-outgoing-args --std=c11 + endif + + CFLAGS += -mno-red-zone diff --git a/sys-boot/gnu-efi/gnu-efi-3.0.11.ebuild b/sys-boot/gnu-efi/gnu-efi-3.0.11.ebuild new file mode 100644 index 000000000000..27742adc9b20 --- /dev/null +++ b/sys-boot/gnu-efi/gnu-efi-3.0.11.ebuild @@ -0,0 +1,87 @@ +# Copyright 2004-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic toolchain-funcs + +DESCRIPTION="Library for build EFI Applications" +HOMEPAGE="http://gnu-efi.sourceforge.net/" +SRC_URI="mirror://sourceforge/gnu-efi/${P}.tar.bz2" + +# inc/, lib/ dirs (README.efilib) +# - BSD-2 +# gnuefi dir: +# - BSD (3-cluase): crt0-efi-ia32.S +# - GPL-2+ : setjmp_ia32.S +LICENSE="GPL-2+ BSD BSD-2" +SLOT="0" +KEYWORDS="-* amd64 arm arm64 ~ia64 x86" +IUSE="abi_x86_32 abi_x86_64 custom-cflags" + +# These objects get run early boot (i.e. not inside of Linux), +# so doing these QA checks on them doesn't make sense. +QA_EXECSTACK="usr/*/lib*efi.a:* usr/*/crt*.o" +RESTRICT="strip" + +PATCHES=( "${FILESDIR}"/${PN}-3.0.9-fix-clang-build.patch ) + +src_prepare() { + default + sed -i -e "s/-Werror//" Make.defaults || die +} + +efimake() { + local arch= + case ${CHOST} in + arm*) arch=arm ;; + aarch64*) arch=aarch64 ;; + ia64*) arch=ia64 ;; + i?86*) arch=ia32 ;; + x86_64*) arch=x86_64 ;; + *) die "Unknown CHOST" ;; + esac + + local args=( + ARCH="${arch}" + HOSTCC="${BUILD_CC}" + CC="${CC}" + AS="${AS}" + LD="${LD}" + AR="${AR}" + PREFIX="${EPREFIX}/usr" + LIBDIR='$(PREFIX)'/$(get_libdir) + ) + emake -j1 "${args[@]}" "$@" +} + +src_compile() { + tc-export BUILD_CC AR AS CC LD + + if use custom-cflags; then + # https://bugs.gentoo.org/607992 + filter-mfpmath sse + + # https://bugs.gentoo.org/619628 + append-flags $(test-flags-CC -mno-avx) + else + unset CFLAGS CPPFLAGS LDFLAGS + fi + + if [[ ${CHOST} == x86_64* ]]; then + use abi_x86_32 && CHOST=i686 ABI=x86 efimake + use abi_x86_64 && efimake + else + efimake + fi +} + +src_install() { + if [[ ${CHOST} == x86_64* ]]; then + use abi_x86_32 && CHOST=i686 ABI=x86 efimake INSTALLROOT="${D}" install + use abi_x86_64 && efimake INSTALLROOT="${D}" install + else + efimake INSTALLROOT="${D}" install + fi + einstalldocs +} diff --git a/sys-boot/gnu-efi/metadata.xml b/sys-boot/gnu-efi/metadata.xml new file mode 100644 index 000000000000..badd74d5c112 --- /dev/null +++ b/sys-boot/gnu-efi/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>floppym@gentoo.org</email> + <name>Mike Gilbert</name> + </maintainer> + <maintainer type="project"> + <email>ia64@gentoo.org</email> + <name>Gentoo Linux IA-64 Development</name> + </maintainer> + <upstream> + <remote-id type="sourceforge">gnu-efi</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest new file mode 100644 index 000000000000..a3833c2a78f4 --- /dev/null +++ b/sys-boot/grub/Manifest @@ -0,0 +1,4 @@ +DIST dejavu-sans-ttf-2.37.zip 417746 BLAKE2B c8904f3cd5a49370a7dc10e456684c88aeae998a99090bf4d0a5baa4f36cc8fb8f70586cf6d610a5ffeee97261d28c80f55bbe9dcfc3ed796d5c2d60e79adb58 SHA512 ede5899daa1984c5aa8cacb1c850eb53f189dddef3d9bb78bf9774d8976b7c0d6eb0bcf86237cd7d11f5b36cf5b5058d42cd94d3bd76f2bd0931c7ceb1271fae +DIST grub-2.04.tar.xz 6393864 BLAKE2B 413ffb9aaeae1ee3128032914ca426a1a5adb3737895dfe563fdde5a7e0386ac2dbc2f7ddfc4e0a67b3ad90494985d6886c20054b038701feb743e67e2eed9d0 SHA512 9c15c42d0cf5d61446b752194e3b628bb04be0fe6ea0240ab62b3d753784712744846e1f7c3651d8e0968d22012e6d713c38c44936d4004ded3ca4d4007babbb +DIST grub-2.05_alpha20200310.tar.xz 6671372 BLAKE2B 2b9006fe486bb3195f34a3e5d34eaa923e1f295fbb7b815b0adf70ca3000531ff0c250c300f21103cf24144f9e51b96cefc860b7a46c6e31b96d4566db08b027 SHA512 7ddcb7524a4fa60754e3053aae4b033b17ffd740f220d3cbc1e25167ce823c42b1795b4767dabb8920027134769de8cacdafc9a6fe26b4d242590809e3db8725 +DIST unifont-12.1.02.pcf.gz 1335424 BLAKE2B 97080312468e3f3c8aa6f49cef08f5622641e8c9c035f3ede1e09d8d98de4e78d3b23c8aba2e8070eb46cbebd2d55e8568e467d7f15f35aa8fc8db792b7e5f14 SHA512 b280b2db7cf5f480b0668c331130dede2c0cc87d5e02e44566b77787113d0f6604d0105522858288f2ac6b8e77df7a2d9878725013a6c778dc5bfb183156e2f0 diff --git a/sys-boot/grub/files/2.04-sparc64-bios-boot.patch b/sys-boot/grub/files/2.04-sparc64-bios-boot.patch new file mode 100644 index 000000000000..8fd00d497ad8 --- /dev/null +++ b/sys-boot/grub/files/2.04-sparc64-bios-boot.patch @@ -0,0 +1,50 @@ +From 4e75b2ae313b13b5bfb54cc5e5c53368d6eb2a08 Mon Sep 17 00:00:00 2001 +From: James Clarke <jrtc27@jrtc27.com> +Date: Thu, 18 Jul 2019 14:31:55 +0200 +Subject: [PATCH] sparc64: Fix BIOS Boot Partition support + +Currently, gpt_offset is uninitialised when using a BIOS Boot Partition +but is used unconditionally inside save_blocklists. Instead, ensure it +is always initialised to 0 (note that there is already separate code to +do the equivalent adjustment after we call save_blocklists on this code +path). + +This patch has been tested on a T5-2 LDOM. + +Signed-off-by: James Clarke <jrtc27@jrtc27.com> +Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> +Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com> +Reviewed-by: Eric Snowberg <eric.snowberg@oracle.com> + +--- + util/setup.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) +--- + util/setup.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/util/setup.c b/util/setup.c +index 6f88f3c..3be88aa 100644 +--- a/util/setup.c ++++ b/util/setup.c +@@ -271,6 +271,9 @@ SETUP (const char *dir, + bl.current_segment = + GRUB_BOOT_I386_PC_KERNEL_SEG + (GRUB_DISK_SECTOR_SIZE >> 4); + #endif ++#ifdef GRUB_SETUP_SPARC64 ++ bl.gpt_offset = 0; ++#endif + bl.last_length = 0; + + /* Read the boot image by the OS service. */ +@@ -730,7 +733,6 @@ unable_to_embed: + #ifdef GRUB_SETUP_SPARC64 + { + grub_partition_t container = root_dev->disk->partition; +- bl.gpt_offset = 0; + + if (grub_strstr (container->partmap->name, "gpt")) + bl.gpt_offset = grub_partition_get_start (container); +-- +cgit v1.0-41-gc330 + diff --git a/sys-boot/grub/files/gfxpayload.patch b/sys-boot/grub/files/gfxpayload.patch new file mode 100644 index 000000000000..6c63ef88b09e --- /dev/null +++ b/sys-boot/grub/files/gfxpayload.patch @@ -0,0 +1,29 @@ +From e2d5bf1bc6aaaabeba538c1ca94ea8601e4e1474 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Thu, 16 Oct 2014 23:43:51 -0400 +Subject: [PATCH] 10_linux: Default gfxpayload=keep only when booting using efi + +vesafb seems to be unreliable when using BIOS compat mode. + +--- + util/grub.d/10_linux.in | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index d2e2a8f..a54b888 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -104,7 +104,9 @@ linux_entry () + echo " load_video" | sed "s/^/$submenu_indentation/" + if grep -qx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \ + && grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then +- echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/" ++ echo ' if [ "x$grub_platform" = xefi ]; then' | sed "s/^/$submenu_indentation/" ++ echo " set gfxpayload=keep" | sed "s/^/$submenu_indentation/" ++ echo ' fi' | sed "s/^/$submenu_indentation/" + fi + else + if [ "x$GRUB_GFXPAYLOAD_LINUX" != xtext ]; then +-- +2.7.2 + diff --git a/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch b/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch new file mode 100644 index 000000000000..c66ee68dc8de --- /dev/null +++ b/sys-boot/grub/files/grub-2.02_beta2-KERNEL_GLOBS.patch @@ -0,0 +1,67 @@ +From 43e3295aaad5278a1e53c5282e2660b72cd76d28 Mon Sep 17 00:00:00 2001 +From: "Robin H. Johnson" <robbat2@gentoo.org> +Date: Tue, 29 Dec 2015 15:29:14 -0800 +Subject: [PATCH] GRUB_LINUX_KERNEL_GLOBS: configurable kernel selection + +* util/grub.d/10_linux.in: Implement GRUB_LINUX_KERNEL_GLOBS +* docs/grub.texi: Document GRUB_LINUX_KERNEL_GLOBS + +Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> +--- + docs/grub.texi | 5 +++++ + util/grub.d/10_linux.in | 21 +++++++++++---------- + 2 files changed, 16 insertions(+), 10 deletions(-) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 9a25a0b..d1129ec 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -1490,6 +1490,11 @@ This option may be set to a list of GRUB module names separated by spaces. + Each module will be loaded as early as possible, at the start of + @file{grub.cfg}. + ++@item GRUB_LINUX_KERNEL_GLOBS ++This option may be set to override the list of path globs used to find Linux ++kernels. The defaults vary by architecture, and generally include both ++@file{/boot} and @file{/}. ++ + @end table + + The following options are still accepted for compatibility with existing +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 859b608..e5ac11d 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -145,18 +145,19 @@ EOF + } + + machine=`uname -m` +-case "x$machine" in ++globs="$GRUB_LINUX_KERNEL_GLOBS" ++[ -z "$globs" ] && case "x$machine" in + xi?86 | xx86_64) +- list= +- for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do +- if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi +- done ;; +- *) +- list= +- for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do +- if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi +- done ;; ++ globs="/boot/vmlinuz-* /vmlinuz-* /boot/kernel-*" ++ ;; ++ *) ++ globs="/boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-*" ++ ;; + esac ++list= ++for i in ${globs} ; do ++ if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi ++done + + case "$machine" in + i?86) GENKERNEL_ARCH="x86" ;; +-- +2.3.0 + diff --git a/sys-boot/grub/files/grub.default-3 b/sys-boot/grub/files/grub.default-3 new file mode 100644 index 000000000000..3faabf9c6ea9 --- /dev/null +++ b/sys-boot/grub/files/grub.default-3 @@ -0,0 +1,73 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 +# +# To populate all changes in this file you need to regenerate your +# grub configuration file afterwards: +# 'grub-mkconfig -o /boot/grub/grub.cfg' +# +# See the grub info page for documentation on possible variables and +# their associated values. + +GRUB_DISTRIBUTOR="Gentoo" + +# Default menu entry +#GRUB_DEFAULT=0 + +# Boot the default entry this many seconds after the menu is displayed +#GRUB_TIMEOUT=5 +#GRUB_TIMEOUT_STYLE=menu + +# Append parameters to the linux kernel command line +#GRUB_CMDLINE_LINUX="" +# +# Examples: +# +# Boot with network interface renaming disabled +# GRUB_CMDLINE_LINUX="net.ifnames=0" +# +# Boot with systemd instead of sysvinit (openrc) +# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd" + +# Append parameters to the linux kernel command line for non-recovery entries +#GRUB_CMDLINE_LINUX_DEFAULT="" + +# Uncomment to disable graphical terminal (grub-pc only) +#GRUB_TERMINAL=console + +# The resolution used on graphical terminal. +# Note that you can use only modes which your graphic card supports via VBE. +# You can see them in real GRUB with the command `vbeinfo'. +#GRUB_GFXMODE=640x480 + +# Set to 'text' to force the Linux kernel to boot in normal text +# mode, 'keep' to preserve the graphics mode set using +# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular +# graphics mode, or a sequence of these separated by commas or +# semicolons to try several modes in sequence. +#GRUB_GFXPAYLOAD_LINUX= + +# Path to theme spec txt file. +# The starfield is by default provided with use truetype. +# NOTE: when enabling custom theme, ensure you have required font/etc. +#GRUB_THEME="/boot/grub/themes/starfield/theme.txt" + +# Background image used on graphical terminal. +# Can be in various bitmap formats. +#GRUB_BACKGROUND="/boot/grub/mybackground.png" + +# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel +#GRUB_DISABLE_LINUX_UUID=true + +# Uncomment to disable generation of recovery mode menu entries +#GRUB_DISABLE_RECOVERY=true + +# Uncomment to disable generation of the submenu and put all choices on +# the top-level menu. +# Besides the visual affect of no sub menu, this makes navigation of the +# menu easier for a user who can't see the screen. +#GRUB_DISABLE_SUBMENU=y + +# Uncomment to play a tone when the main menu is displayed. +# This is useful, for example, to allow users who can't see the screen +# to know when they can make a choice on the menu. +#GRUB_INIT_TUNE="60 800 1" diff --git a/sys-boot/grub/grub-2.04-r1.ebuild b/sys-boot/grub/grub-2.04-r1.ebuild new file mode 100644 index 000000000000..5d09c7bf0cff --- /dev/null +++ b/sys-boot/grub/grub-2.04-r1.ebuild @@ -0,0 +1,296 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +if [[ ${PV} == 9999 ]]; then + GRUB_AUTORECONF=1 + GRUB_BOOTSTRAP=1 +fi + +if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then + PYTHON_COMPAT=( python{2_7,3_{6,7,8}} ) + inherit python-any-r1 +fi + +if [[ -n ${GRUB_AUTORECONF} ]]; then + WANT_LIBTOOL=none + inherit autotools +fi + +inherit bash-completion-r1 eutils flag-o-matic multibuild pax-utils toolchain-funcs + +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" + S=${WORKDIR}/${MY_P} + else + SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" + S=${WORKDIR}/${P%_*} + fi + KEYWORDS="amd64 ~arm ~arm64 ~ia64 ppc ppc64 x86" +else + inherit git-r3 + EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git" +fi + +PATCHES=( + "${FILESDIR}"/gfxpayload.patch + "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch + "${FILESDIR}"/2.04-sparc64-bios-boot.patch +) + +DEJAVU=dejavu-sans-ttf-2.37 +UNIFONT=unifont-12.1.02 +SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz ) + themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )" + +DESCRIPTION="GNU GRUB boot loader" +HOMEPAGE="https://www.gnu.org/software/grub/" + +# Includes licenses for dejavu and unifont +LICENSE="GPL-3+ BSD MIT fonts? ( GPL-2-with-font-exception ) themes? ( CC-BY-SA-3.0 BitstreamVera )" +SLOT="2/${PVR}" +IUSE="device-mapper doc efiemu +fonts mount nls sdl test +themes truetype libzfs" + +GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot qemu qemu-mips pc uboot xen xen-32 xen-pvh ) +IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}" + +REQUIRED_USE=" + grub_platforms_coreboot? ( fonts ) + grub_platforms_qemu? ( fonts ) + grub_platforms_ieee1275? ( fonts ) + grub_platforms_loongson? ( fonts ) +" + +BDEPEND=" + ${PYTHON_DEPS} + app-misc/pax-utils + sys-devel/flex + sys-devel/bison + sys-apps/help2man + sys-apps/texinfo + fonts? ( + media-libs/freetype:2 + virtual/pkgconfig + ) + test? ( + app-admin/genromfs + app-arch/cpio + app-arch/lzop + app-emulation/qemu + dev-libs/libisoburn + sys-apps/miscfiles + sys-block/parted + sys-fs/squashfs-tools + ) + themes? ( + app-arch/unzip + media-libs/freetype:2 + virtual/pkgconfig + ) + truetype? ( virtual/pkgconfig ) +" +DEPEND=" + app-arch/xz-utils + >=sys-libs/ncurses-5.2-r5:0= + sdl? ( media-libs/libsdl ) + device-mapper? ( >=sys-fs/lvm2-2.02.45 ) + libzfs? ( sys-fs/zfs ) + mount? ( sys-fs/fuse:0 ) + truetype? ( media-libs/freetype:2= ) + ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) + ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) +" +RDEPEND="${DEPEND} + kernel_linux? ( + grub_platforms_efi-32? ( sys-boot/efibootmgr ) + grub_platforms_efi-64? ( sys-boot/efibootmgr ) + ) + !sys-boot/grub:0 !sys-boot/grub-static + nls? ( sys-devel/gettext ) +" + +RESTRICT="!test? ( test )" + +QA_EXECSTACK="usr/bin/grub-emu* usr/lib/grub/*" +QA_PRESTRIPPED="usr/lib/grub/.*" +QA_MULTILIB_PATHS="usr/lib/grub/.*" +QA_WX_LOAD="usr/lib/grub/*" + +src_unpack() { + if [[ ${PV} == 9999 ]]; then + git-r3_src_unpack + pushd "${P}" >/dev/null || die + local GNULIB_URI="https://git.savannah.gnu.org/git/gnulib.git" + local GNULIB_REVISION=$(source bootstrap.conf >/dev/null; echo "${GNULIB_REVISION}") + git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}" + git-r3_checkout "${GNULIB_URI}" gnulib + popd >/dev/null || die + fi + default +} + +src_prepare() { + default + + sed -i -e /autoreconf/d autogen.sh || die + + # Nothing in Gentoo packages 'american-english' in the exact path + # wanted for the test, but all that is needed is a compressible text + # file, and we do have 'words' from miscfiles in the same path. + sed -i \ + -e '/CFILESSRC.*=/s,american-english,words,' \ + tests/util/grub-fs-tester.in \ + || die + + if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then + python_setup + fi + + if [[ -n ${GRUB_BOOTSTRAP} ]]; then + eautopoint --force + AUTOPOINT=: AUTORECONF=: ./bootstrap || die + elif [[ -n ${GRUB_AUTOGEN} ]]; then + ./autogen.sh || die + fi + + if [[ -n ${GRUB_AUTORECONF} ]]; then + eautoreconf + fi +} + +grub_do() { + multibuild_foreach_variant run_in_build_dir "$@" +} + +grub_do_once() { + multibuild_for_best_variant run_in_build_dir "$@" +} + +grub_configure() { + local platform + + case ${MULTIBUILD_VARIANT} in + efi*) platform=efi ;; + xen-pvh) platform=xen_pvh ;; + xen*) platform=xen ;; + guessed) ;; + *) platform=${MULTIBUILD_VARIANT} ;; + esac + + case ${MULTIBUILD_VARIANT} in + *-32) + if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then + local CTARGET=i386 + fi ;; + *-64) + if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then + local CTARGET=x86_64 + local -x TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}" + local -x TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}" + fi ;; + esac + + local myeconfargs=( + --disable-werror + --program-prefix= + --libdir="${EPREFIX}"/usr/lib + $(use_enable device-mapper) + $(use_enable mount grub-mount) + $(use_enable nls) + $(use_enable themes grub-themes) + $(use_enable truetype grub-mkfont) + $(use_enable libzfs) + $(use_enable sdl grub-emu-sdl) + ${platform:+--with-platform=}${platform} + + # Let configure detect this where supported + $(usex efiemu '' '--disable-efiemu') + ) + + if use fonts; then + ln -rs "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die + fi + + if use themes; then + ln -rs "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die + fi + + local ECONF_SOURCE="${S}" + econf "${myeconfargs[@]}" +} + +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 + + tc-ld-disable-gold #439082 #466536 #526348 + export TARGET_LDFLAGS="${TARGET_LDFLAGS} ${LDFLAGS}" + unset LDFLAGS + + tc-export CC NM OBJCOPY RANLIB STRIP + tc-export BUILD_CC # Bug 485592 + + MULTIBUILD_VARIANTS=() + local p + for p in "${GRUB_ALL_PLATFORMS[@]}"; do + use "grub_platforms_${p}" && MULTIBUILD_VARIANTS+=( "${p}" ) + done + [[ ${#MULTIBUILD_VARIANTS[@]} -eq 0 ]] && MULTIBUILD_VARIANTS=( guessed ) + grub_do grub_configure +} + +src_compile() { + # Sandbox bug 404013. + use libzfs && addpredict /etc/dfs:/dev/zfs + + grub_do emake + use doc && grub_do_once emake -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. + grub_do emake check +} + +src_install() { + grub_do emake install DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)" + use doc && grub_do_once emake -C docs install-html DESTDIR="${D}" + + einstalldocs + + insinto /etc/default + newins "${FILESDIR}"/grub.default-3 grub + + # https://bugs.gentoo.org/231935 + dostrip -x /usr/lib/grub +} + +pkg_postinst() { + elog "For information on how to configure GRUB2 please refer to the guide:" + elog " https://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 " https://wiki.gentoo.org/wiki/GRUB2_Migration" + fi + + if [[ -z ${REPLACING_VERSIONS} ]]; then + elog + elog "You may consider installing the following optional packages:" + optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober + optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn + optfeature "Enable RAID device detection" sys-fs/mdadm + fi +} diff --git a/sys-boot/grub/grub-2.05_alpha20200310.ebuild b/sys-boot/grub/grub-2.05_alpha20200310.ebuild new file mode 100644 index 000000000000..aeab60f11e11 --- /dev/null +++ b/sys-boot/grub/grub-2.05_alpha20200310.ebuild @@ -0,0 +1,287 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +if [[ ${PV} == 9999 ]]; then + GRUB_AUTORECONF=1 + GRUB_BOOTSTRAP=1 +fi + +if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then + PYTHON_COMPAT=( python{2_7,3_{6,7,8}} ) + inherit python-any-r1 +fi + +if [[ -n ${GRUB_AUTORECONF} ]]; then + WANT_LIBTOOL=none + inherit autotools +fi + +inherit bash-completion-r1 eutils flag-o-matic multibuild pax-utils toolchain-funcs + +if [[ ${PV} != 9999 ]]; then + SRC_URI="https://dev.gentoo.org/~floppym/dist/${P}.tar.xz" + KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" +else + inherit git-r3 + EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git" +fi + +PATCHES=( + "${FILESDIR}"/gfxpayload.patch + "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch +) + +DEJAVU=dejavu-sans-ttf-2.37 +UNIFONT=unifont-12.1.02 +SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz ) + themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )" + +DESCRIPTION="GNU GRUB boot loader" +HOMEPAGE="https://www.gnu.org/software/grub/" + +# Includes licenses for dejavu and unifont +LICENSE="GPL-3+ BSD MIT fonts? ( GPL-2-with-font-exception ) themes? ( CC-BY-SA-3.0 BitstreamVera )" +SLOT="2/${PVR}" +IUSE="device-mapper doc efiemu +fonts mount nls sdl test +themes truetype libzfs" + +GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot qemu qemu-mips pc uboot xen xen-32 xen-pvh ) +IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}" + +REQUIRED_USE=" + grub_platforms_coreboot? ( fonts ) + grub_platforms_qemu? ( fonts ) + grub_platforms_ieee1275? ( fonts ) + grub_platforms_loongson? ( fonts ) +" + +BDEPEND=" + ${PYTHON_DEPS} + app-misc/pax-utils + sys-devel/flex + sys-devel/bison + sys-apps/help2man + sys-apps/texinfo + fonts? ( + media-libs/freetype:2 + virtual/pkgconfig + ) + test? ( + app-admin/genromfs + app-arch/cpio + app-arch/lzop + app-emulation/qemu + dev-libs/libisoburn + sys-apps/miscfiles + sys-block/parted + sys-fs/squashfs-tools + ) + themes? ( + app-arch/unzip + media-libs/freetype:2 + virtual/pkgconfig + ) + truetype? ( virtual/pkgconfig ) +" +DEPEND=" + app-arch/xz-utils + >=sys-libs/ncurses-5.2-r5:0= + sdl? ( media-libs/libsdl ) + device-mapper? ( >=sys-fs/lvm2-2.02.45 ) + libzfs? ( sys-fs/zfs ) + mount? ( sys-fs/fuse:0 ) + truetype? ( media-libs/freetype:2= ) + ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) + ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) +" +RDEPEND="${DEPEND} + kernel_linux? ( + grub_platforms_efi-32? ( sys-boot/efibootmgr ) + grub_platforms_efi-64? ( sys-boot/efibootmgr ) + ) + !sys-boot/grub:0 !sys-boot/grub-static + nls? ( sys-devel/gettext ) +" + +RESTRICT="!test? ( test )" + +QA_EXECSTACK="usr/bin/grub-emu* usr/lib/grub/*" +QA_PRESTRIPPED="usr/lib/grub/.*" +QA_MULTILIB_PATHS="usr/lib/grub/.*" +QA_WX_LOAD="usr/lib/grub/*" + +src_unpack() { + if [[ ${PV} == 9999 ]]; then + git-r3_src_unpack + pushd "${P}" >/dev/null || die + local GNULIB_URI="https://git.savannah.gnu.org/git/gnulib.git" + local GNULIB_REVISION=$(source bootstrap.conf >/dev/null; echo "${GNULIB_REVISION}") + git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}" + git-r3_checkout "${GNULIB_URI}" gnulib + popd >/dev/null || die + fi + default +} + +src_prepare() { + default + + sed -i -e /autoreconf/d autogen.sh || die + + # Nothing in Gentoo packages 'american-english' in the exact path + # wanted for the test, but all that is needed is a compressible text + # file, and we do have 'words' from miscfiles in the same path. + sed -i \ + -e '/CFILESSRC.*=/s,american-english,words,' \ + tests/util/grub-fs-tester.in \ + || die + + if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then + python_setup + fi + + if [[ -n ${GRUB_BOOTSTRAP} ]]; then + eautopoint --force + AUTOPOINT=: AUTORECONF=: ./bootstrap || die + elif [[ -n ${GRUB_AUTOGEN} ]]; then + ./autogen.sh || die + fi + + if [[ -n ${GRUB_AUTORECONF} ]]; then + eautoreconf + fi +} + +grub_do() { + multibuild_foreach_variant run_in_build_dir "$@" +} + +grub_do_once() { + multibuild_for_best_variant run_in_build_dir "$@" +} + +grub_configure() { + local platform + + case ${MULTIBUILD_VARIANT} in + efi*) platform=efi ;; + xen-pvh) platform=xen_pvh ;; + xen*) platform=xen ;; + guessed) ;; + *) platform=${MULTIBUILD_VARIANT} ;; + esac + + case ${MULTIBUILD_VARIANT} in + *-32) + if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then + local CTARGET=i386 + fi ;; + *-64) + if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then + local CTARGET=x86_64 + local -x TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}" + local -x TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}" + fi ;; + esac + + local myeconfargs=( + --disable-werror + --program-prefix= + --libdir="${EPREFIX}"/usr/lib + $(use_enable device-mapper) + $(use_enable mount grub-mount) + $(use_enable nls) + $(use_enable themes grub-themes) + $(use_enable truetype grub-mkfont) + $(use_enable libzfs) + $(use_enable sdl grub-emu-sdl) + ${platform:+--with-platform=}${platform} + + # Let configure detect this where supported + $(usex efiemu '' '--disable-efiemu') + ) + + if use fonts; then + ln -rs "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die + fi + + if use themes; then + ln -rs "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die + fi + + local ECONF_SOURCE="${S}" + econf "${myeconfargs[@]}" +} + +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 + + tc-ld-disable-gold #439082 #466536 #526348 + export TARGET_LDFLAGS="${TARGET_LDFLAGS} ${LDFLAGS}" + unset LDFLAGS + + tc-export CC NM OBJCOPY RANLIB STRIP + tc-export BUILD_CC # Bug 485592 + + MULTIBUILD_VARIANTS=() + local p + for p in "${GRUB_ALL_PLATFORMS[@]}"; do + use "grub_platforms_${p}" && MULTIBUILD_VARIANTS+=( "${p}" ) + done + [[ ${#MULTIBUILD_VARIANTS[@]} -eq 0 ]] && MULTIBUILD_VARIANTS=( guessed ) + grub_do grub_configure +} + +src_compile() { + # Sandbox bug 404013. + use libzfs && addpredict /etc/dfs:/dev/zfs + + grub_do emake + use doc && grub_do_once emake -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. + grub_do emake check +} + +src_install() { + grub_do emake install DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)" + use doc && grub_do_once emake -C docs install-html DESTDIR="${D}" + + einstalldocs + + insinto /etc/default + newins "${FILESDIR}"/grub.default-3 grub + + # https://bugs.gentoo.org/231935 + dostrip -x /usr/lib/grub +} + +pkg_postinst() { + elog "For information on how to configure GRUB2 please refer to the guide:" + elog " https://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 " https://wiki.gentoo.org/wiki/GRUB2_Migration" + fi + + if [[ -z ${REPLACING_VERSIONS} ]]; then + elog + elog "You may consider installing the following optional packages:" + optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober + optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn + optfeature "Enable RAID device detection" sys-fs/mdadm + fi +} diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild new file mode 100644 index 000000000000..d94f9b724644 --- /dev/null +++ b/sys-boot/grub/grub-9999.ebuild @@ -0,0 +1,295 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +if [[ ${PV} == 9999 ]]; then + GRUB_AUTORECONF=1 + GRUB_BOOTSTRAP=1 +fi + +if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then + PYTHON_COMPAT=( python{2_7,3_{6,7,8}} ) + inherit python-any-r1 +fi + +if [[ -n ${GRUB_AUTORECONF} ]]; then + WANT_LIBTOOL=none + inherit autotools +fi + +inherit bash-completion-r1 eutils flag-o-matic multibuild pax-utils toolchain-funcs + +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" + S=${WORKDIR}/${MY_P} + else + SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" + S=${WORKDIR}/${P%_*} + fi + KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" +else + inherit git-r3 + EGIT_REPO_URI="https://git.savannah.gnu.org/git/grub.git" +fi + +PATCHES=( + "${FILESDIR}"/gfxpayload.patch + "${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch +) + +DEJAVU=dejavu-sans-ttf-2.37 +UNIFONT=unifont-12.1.02 +SRC_URI+=" fonts? ( mirror://gnu/unifont/${UNIFONT}/${UNIFONT}.pcf.gz ) + themes? ( mirror://sourceforge/dejavu/${DEJAVU}.zip )" + +DESCRIPTION="GNU GRUB boot loader" +HOMEPAGE="https://www.gnu.org/software/grub/" + +# Includes licenses for dejavu and unifont +LICENSE="GPL-3+ BSD MIT fonts? ( GPL-2-with-font-exception ) themes? ( CC-BY-SA-3.0 BitstreamVera )" +SLOT="2/${PVR}" +IUSE="device-mapper doc efiemu +fonts mount nls sdl test +themes truetype libzfs" + +GRUB_ALL_PLATFORMS=( coreboot efi-32 efi-64 emu ieee1275 loongson multiboot qemu qemu-mips pc uboot xen xen-32 xen-pvh ) +IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}" + +REQUIRED_USE=" + grub_platforms_coreboot? ( fonts ) + grub_platforms_qemu? ( fonts ) + grub_platforms_ieee1275? ( fonts ) + grub_platforms_loongson? ( fonts ) +" + +BDEPEND=" + ${PYTHON_DEPS} + app-misc/pax-utils + sys-devel/flex + sys-devel/bison + sys-apps/help2man + sys-apps/texinfo + fonts? ( + media-libs/freetype:2 + virtual/pkgconfig + ) + test? ( + app-admin/genromfs + app-arch/cpio + app-arch/lzop + app-emulation/qemu + dev-libs/libisoburn + sys-apps/miscfiles + sys-block/parted + sys-fs/squashfs-tools + ) + themes? ( + app-arch/unzip + media-libs/freetype:2 + virtual/pkgconfig + ) + truetype? ( virtual/pkgconfig ) +" +DEPEND=" + app-arch/xz-utils + >=sys-libs/ncurses-5.2-r5:0= + sdl? ( media-libs/libsdl ) + device-mapper? ( >=sys-fs/lvm2-2.02.45 ) + libzfs? ( sys-fs/zfs ) + mount? ( sys-fs/fuse:0 ) + truetype? ( media-libs/freetype:2= ) + ppc? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) + ppc64? ( >=sys-apps/ibm-powerpc-utils-1.3.5 ) +" +RDEPEND="${DEPEND} + kernel_linux? ( + grub_platforms_efi-32? ( sys-boot/efibootmgr ) + grub_platforms_efi-64? ( sys-boot/efibootmgr ) + ) + !sys-boot/grub:0 !sys-boot/grub-static + nls? ( sys-devel/gettext ) +" + +RESTRICT="!test? ( test )" + +QA_EXECSTACK="usr/bin/grub-emu* usr/lib/grub/*" +QA_PRESTRIPPED="usr/lib/grub/.*" +QA_MULTILIB_PATHS="usr/lib/grub/.*" +QA_WX_LOAD="usr/lib/grub/*" + +src_unpack() { + if [[ ${PV} == 9999 ]]; then + git-r3_src_unpack + pushd "${P}" >/dev/null || die + local GNULIB_URI="https://git.savannah.gnu.org/git/gnulib.git" + local GNULIB_REVISION=$(source bootstrap.conf >/dev/null; echo "${GNULIB_REVISION}") + git-r3_fetch "${GNULIB_URI}" "${GNULIB_REVISION}" + git-r3_checkout "${GNULIB_URI}" gnulib + popd >/dev/null || die + fi + default +} + +src_prepare() { + default + + sed -i -e /autoreconf/d autogen.sh || die + + # Nothing in Gentoo packages 'american-english' in the exact path + # wanted for the test, but all that is needed is a compressible text + # file, and we do have 'words' from miscfiles in the same path. + sed -i \ + -e '/CFILESSRC.*=/s,american-english,words,' \ + tests/util/grub-fs-tester.in \ + || die + + if [[ -n ${GRUB_AUTOGEN} || -n ${GRUB_BOOTSTRAP} ]]; then + python_setup + fi + + if [[ -n ${GRUB_BOOTSTRAP} ]]; then + eautopoint --force + AUTOPOINT=: AUTORECONF=: ./bootstrap || die + elif [[ -n ${GRUB_AUTOGEN} ]]; then + ./autogen.sh || die + fi + + if [[ -n ${GRUB_AUTORECONF} ]]; then + eautoreconf + fi +} + +grub_do() { + multibuild_foreach_variant run_in_build_dir "$@" +} + +grub_do_once() { + multibuild_for_best_variant run_in_build_dir "$@" +} + +grub_configure() { + local platform + + case ${MULTIBUILD_VARIANT} in + efi*) platform=efi ;; + xen-pvh) platform=xen_pvh ;; + xen*) platform=xen ;; + guessed) ;; + *) platform=${MULTIBUILD_VARIANT} ;; + esac + + case ${MULTIBUILD_VARIANT} in + *-32) + if [[ ${CTARGET:-${CHOST}} == x86_64* ]]; then + local CTARGET=i386 + fi ;; + *-64) + if [[ ${CTARGET:-${CHOST}} == i?86* ]]; then + local CTARGET=x86_64 + local -x TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}" + local -x TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}" + fi ;; + esac + + local myeconfargs=( + --disable-werror + --program-prefix= + --libdir="${EPREFIX}"/usr/lib + $(use_enable device-mapper) + $(use_enable mount grub-mount) + $(use_enable nls) + $(use_enable themes grub-themes) + $(use_enable truetype grub-mkfont) + $(use_enable libzfs) + $(use_enable sdl grub-emu-sdl) + ${platform:+--with-platform=}${platform} + + # Let configure detect this where supported + $(usex efiemu '' '--disable-efiemu') + ) + + if use fonts; then + ln -rs "${WORKDIR}/${UNIFONT}.pcf" unifont.pcf || die + fi + + if use themes; then + ln -rs "${WORKDIR}/${DEJAVU}/ttf/DejaVuSans.ttf" DejaVuSans.ttf || die + fi + + local ECONF_SOURCE="${S}" + econf "${myeconfargs[@]}" +} + +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 + + tc-ld-disable-gold #439082 #466536 #526348 + export TARGET_LDFLAGS="${TARGET_LDFLAGS} ${LDFLAGS}" + unset LDFLAGS + + tc-export CC NM OBJCOPY RANLIB STRIP + tc-export BUILD_CC # Bug 485592 + + MULTIBUILD_VARIANTS=() + local p + for p in "${GRUB_ALL_PLATFORMS[@]}"; do + use "grub_platforms_${p}" && MULTIBUILD_VARIANTS+=( "${p}" ) + done + [[ ${#MULTIBUILD_VARIANTS[@]} -eq 0 ]] && MULTIBUILD_VARIANTS=( guessed ) + grub_do grub_configure +} + +src_compile() { + # Sandbox bug 404013. + use libzfs && addpredict /etc/dfs:/dev/zfs + + grub_do emake + use doc && grub_do_once emake -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. + grub_do emake check +} + +src_install() { + grub_do emake install DESTDIR="${D}" bashcompletiondir="$(get_bashcompdir)" + use doc && grub_do_once emake -C docs install-html DESTDIR="${D}" + + einstalldocs + + insinto /etc/default + newins "${FILESDIR}"/grub.default-3 grub + + # https://bugs.gentoo.org/231935 + dostrip -x /usr/lib/grub +} + +pkg_postinst() { + elog "For information on how to configure GRUB2 please refer to the guide:" + elog " https://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 " https://wiki.gentoo.org/wiki/GRUB2_Migration" + fi + + if [[ -z ${REPLACING_VERSIONS} ]]; then + elog + elog "You may consider installing the following optional packages:" + optfeature "Detect other operating systems (grub-mkconfig)" sys-boot/os-prober + optfeature "Create rescue media (grub-mkrescue)" dev-libs/libisoburn + optfeature "Enable RAID device detection" sys-fs/mdadm + fi +} diff --git a/sys-boot/grub/metadata.xml b/sys-boot/grub/metadata.xml new file mode 100644 index 000000000000..89f7c8dea463 --- /dev/null +++ b/sys-boot/grub/metadata.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> + <email>floppym@gentoo.org</email> + <name>Mike Gilbert</name> +</maintainer> +<maintainer type="project"> + <email>base-system@gentoo.org</email> + <name>Gentoo Base System</name> +</maintainer> +<use> + <flag name="device-mapper"> + Enable support for device-mapper from <pkg>sys-fs/lvm2</pkg> + </flag> + <flag name="efiemu"> + Build and install the efiemu runtimes + </flag> + <flag name="fonts">Build and install fonts for the gfxterm module</flag> + <flag name="mount"> + Build and install the grub-mount utility + </flag> + <flag name="libzfs"> + Enable support for <pkg>sys-fs/zfs</pkg> + </flag> + <flag name="themes">Build and install GRUB themes (starfield)</flag> + <flag name="truetype">Build and install grub-mkfont conversion utility</flag> +</use> +<upstream> + <remote-id type="sourceforge">dejavu</remote-id> + <remote-id type="cpe">cpe:/a:gnu:grub</remote-id> +</upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/lilo/Manifest b/sys-boot/lilo/Manifest new file mode 100644 index 000000000000..39d90b9ba384 --- /dev/null +++ b/sys-boot/lilo/Manifest @@ -0,0 +1,4 @@ +DIST dolilo-0.6.tar.bz2 3817 BLAKE2B 35c41f5eac8e02d4381db517a9b230d037da184f9ae409bc76307e689ad6b82928ea3794db54c3137afe6c770db86ba0cde78c33d89e775ddea464905070bfd6 SHA512 1b59ea5f2e2ac52d62635c9f7d5fb5b2aff6757e6ea6c0950480d8a11832b872115907abe6d8fb3fa5436e2e8971d9a1dda103dc6a15db6fc310c8f4730ab936 +DIST lilo-24.0.tar.gz 768631 BLAKE2B 09f6520e16a90eab5f44af440f1e2c2d05abb56e954dbb0237700d8e99f017bab279fa8a5c535114ec58be7416123ea51e91311255ed3036199f3565eec5a3f7 SHA512 4158a0f7ab085da063938df2bc77356f9536aa78208a902561f9e61ec478fb17f204f68407f6809638aea9d2e0c88ffc701548291c1635ab40f5b18a7be6bae7 +DIST lilo-24.1.tar.gz 773223 BLAKE2B ceaeaf6696b7b15d95cc6c90c6de63ad731f4d0f6d9e42fea4a245219d446cbecdb7d372ef4cb31dce26c7e149723779244f0319939343edf971ac1a19ba5063 SHA512 d1375cac9654fcb3934e7e5e0533e126ff8700a48154eb5019cf62e4b89f14d2ce7a17b6324795d9b60b37ab7656bfb2c9467f6e9d3540095f5c294579e83883 +DIST lilo-24.2.tar.gz 777400 BLAKE2B 71c74235d5df10eed65b67dc1ce2af21163651c752d799da419077025304abf9352535a70f3fb60d086609d8a1c25bf394e29453c338ab022cb2be3cb21af75f SHA512 4437cae21345f483194a5dc95f686f3f3cb2beec78faae3fba959db25eae29fe2c56732e055c05f1d101682c5d442cdc9561fae8074f61f5537dde0413204c54 diff --git a/sys-boot/lilo/files/lilo-24.0-novga.patch b/sys-boot/lilo/files/lilo-24.0-novga.patch new file mode 100644 index 000000000000..ebb06b486818 --- /dev/null +++ b/sys-boot/lilo/files/lilo-24.0-novga.patch @@ -0,0 +1,12 @@ +diff -ur lilo-23.2/make.vars lilo-23.2.new/make.vars +--- lilo-23.2/make.vars 2013-01-18 11:33:02.438628138 -0600 ++++ lilo-23.2.new/make.vars 2013-01-18 11:34:03.960697091 -0600 +@@ -71,7 +71,7 @@ + + CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DNOKEYBOARD -DONE_SHOT \ + -DPASS160 -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL \ +- -DMDPRAID -DDEVMAPPER ++ -DMDPRAID -DDEVMAPPER -DNOVGA + + # set the following if you wish LILO.COM to be installed + DOS_DIR=/dosC/boot diff --git a/sys-boot/lilo/files/lilo-24.1-novga.patch b/sys-boot/lilo/files/lilo-24.1-novga.patch new file mode 100644 index 000000000000..512fac694fdb --- /dev/null +++ b/sys-boot/lilo/files/lilo-24.1-novga.patch @@ -0,0 +1,12 @@ +diff -uNr lilo-24.1.ORIG/make.vars lilo-24.1/make.vars +--- lilo-24.1.ORIG/make.vars 2015-01-22 10:36:54.656904227 +0000 ++++ lilo-24.1/make.vars 2015-01-22 10:37:16.516903935 +0000 +@@ -71,7 +71,7 @@ + + CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DNOKEYBOARD -DONE_SHOT \ + -DPASS160 -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL \ +- -DMDPRAID -DDEVMAPPER ++ -DMDPRAID -DDEVMAPPER -DNOVGA + + # set the following if you wish LILO.COM to be installed + DOS_DIR=/dosC/boot diff --git a/sys-boot/lilo/files/lilo.conf b/sys-boot/lilo/files/lilo.conf new file mode 100644 index 000000000000..3848f779029b --- /dev/null +++ b/sys-boot/lilo/files/lilo.conf @@ -0,0 +1,72 @@ +# Author: Ultanium + +# +# Start LILO global section +# + +# Faster, but won't work on all systems: +#compact +# Should work for most systems, and do not have the sector limit: +lba32 +# If lba32 do not work, use linear: +#linear + +# MBR to install LILO to: +boot = /dev/hda +map = /boot/.map + +# If you are having problems booting from a hardware raid-array +# or have a unusual setup, try this: +#disk=/dev/ataraid/disc0/disc bios=0x80 # see this as the first BIOS disk +#disk=/dev/sda bios=0x81 # see this as the second BIOS disk +#disk=/dev/hda bios=0x82 # see this as the third BIOS disk + +# Here you can select the secondary loader to install. A few +# examples is: +# +# boot-text.b +# boot-menu.b +# boot-bmp.b +# +install = /boot/boot-menu.b # Note that for lilo-22.5.5 or later you + # do not need boot-{text,menu,bmp}.b in + # /boot, as they are linked into the lilo + # binary. + +menu-scheme=Wb +prompt +# If you always want to see the prompt with a 15 second timeout: +#timeout=150 +delay = 50 +# Normal VGA console +vga = normal +# VESA console with size 1024x768x16: +#vga = 791 + +# +# End LILO global section +# + +# +# Linux bootable partition config begins +# +image = /boot/bzImage + root = /dev/hda3 + #root = /devices/discs/disc0/part3 + label = Gentoo + read-only # read-only for checking +# +# Linux bootable partition config ends +# + +# +# DOS bootable partition config begins +# +other = /dev/hda1 + #other = /devices/discs/disc0/part1 + label = Windows + table = /dev/hda +# +# DOS bootable partition config ends +# + diff --git a/sys-boot/lilo/lilo-24.0-r1.ebuild b/sys-boot/lilo/lilo-24.0-r1.ebuild new file mode 100644 index 000000000000..becc561f7416 --- /dev/null +++ b/sys-boot/lilo/lilo-24.0-r1.ebuild @@ -0,0 +1,171 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit eutils flag-o-matic toolchain-funcs + +DOLILO_V="0.6" +IUSE="static minimal pxeserial device-mapper" + +DESCRIPTION="Standard Linux boot loader" +HOMEPAGE="https://alioth.debian.org/projects/lilo/" + +DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2" +SRC_URI=" + http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz + mirror://gentoo/${DOLILO_TAR} +" + +SLOT="0" +LICENSE="BSD GPL-2" +KEYWORDS="-* amd64 x86" + +DEPEND=">=sys-devel/bin86-0.15.5" +RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )" + +src_prepare() { + # this patch is needed when booting PXE and the device you're using + # emulates vga console via serial console. + # IE.. B.B.o.o.o.o.t.t.i.i.n.n.g.g....l.l.i.i.n.n.u.u.x.x and stair stepping. + use pxeserial && epatch "${FILESDIR}/${P}-novga.patch" + + # Do not strip and have parallel make + # FIXME: images/Makefile does weird stuff + sed -i Makefile src/Makefile \ + -e '/strip/d;s|^ make| $(MAKE)|g' \ + -e '/images install/d' \ + -e '/images all/d' \ + || die "sed strip failed" +} + +src_configure() { + if ! use device-mapper; then + sed -i make.vars -e 's|-DDEVMAPPER||g' || die + fi +} + +src_compile() { + # lilo needs this. bug #140209 + export LC_ALL=C + + # we explicitly prevent the custom CFLAGS for stability reasons + if use static; then + local target=alles + else + local target=all + fi + + emake CC="$(tc-getCC) ${LDFLAGS}" ${target} +} + +src_install() { + keepdir /boot + emake DESTDIR="${D}" install + + if use !minimal; then + into / + dosbin "${WORKDIR}"/dolilo/dolilo + + into /usr + dosbin keytab-lilo.pl + + insinto /etc + newins "${FILESDIR}"/lilo.conf lilo.conf.example + + newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example + + dodoc CHANGELOG* readme/README.* readme/INCOMPAT README + docinto samples ; dodoc sample/* + fi +} + +# Check whether LILO is installed +# This function is from /usr/sbin/mkboot from debianutils, with copyright: +# +# Debian GNU/Linux +# Copyright 1996-1997 Guy Maor <maor@debian.org> +# +# Modified for Gentoo for use with the lilo ebuild by: +# Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003) +# +lilocheck() { + local bootpart= + local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")" + + echo + einfon "Checking for LILO ..." + + if [ "$(whoami)" != "root" ] + then + echo; echo + eerror "Only root can check for LILO!" + return 1 + fi + + if [ -z "${rootpart}" ] + then + echo; echo + eerror "Could not determine root partition!" + return 1 + fi + + if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ] + then + echo " No" + return 1 + fi + + bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)" + + if [ -z "${bootpart}" ] + then + # lilo defaults to current root when 'boot=' is not present + bootpart="${rootpart}" + fi + + if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO' + then + echo; echo + ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}" + ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand." + return 1 + fi + + echo " Yes, on ${bootpart}" + + return 0 +} + +pkg_postinst() { + if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ] + then + [ -f "${ROOT}/boot/boot-menu.b" ] && \ + ln -snf boot-menu.b "${ROOT}/boot/boot.b" + fi + + if [ "${ROOT}" = "/" ] && use !minimal; + then + if lilocheck + then + einfo "Running DOLILO to complete the install ..." + # do not redirect to /dev/null because it may display some input + # prompt + /sbin/dolilo + if [ "$?" -ne 0 ] + then + echo + eerror "Running /sbin/dolilo failed! Please check what the problem is" + eerror "before your next reboot." + fi + fi + echo + fi + if use !minimal; then + echo + einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that" + einfo "handles mounting and unmounting /boot for you. It can do more then" + einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential." + echo + fi +} diff --git a/sys-boot/lilo/lilo-24.1.ebuild b/sys-boot/lilo/lilo-24.1.ebuild new file mode 100644 index 000000000000..aa4787b06c10 --- /dev/null +++ b/sys-boot/lilo/lilo-24.1.ebuild @@ -0,0 +1,178 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit eutils flag-o-matic toolchain-funcs + +DOLILO_V="0.6" +IUSE="static minimal pxeserial device-mapper" + +DESCRIPTION="Standard Linux boot loader" +HOMEPAGE="https://alioth.debian.org/projects/lilo/" + +DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2" +SRC_URI=" + http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz + mirror://gentoo/${DOLILO_TAR} +" + +SLOT="0" +LICENSE="BSD GPL-2" +KEYWORDS="-* ~amd64 ~x86" + +DEPEND=">=sys-devel/bin86-0.15.5" +RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )" + +src_prepare() { + # this patch is needed when booting PXE and the device you're using + # emulates vga console via serial console. + # IE.. B.B.o.o.o.o.t.t.i.i.n.n.g.g....l.l.i.i.n.n.u.u.x.x and stair stepping. + use pxeserial && epatch "${FILESDIR}/${P}-novga.patch" + + # Do not strip and have parallel make + # FIXME: images/Makefile does weird stuff + sed -i Makefile src/Makefile \ + -e '/strip/d;s|^ make| $(MAKE)|g' \ + -e '/images install/d' \ + -e '/images all/d' \ + || die "sed strip failed" +} + +src_configure() { + if ! use device-mapper; then + sed -i make.vars -e 's|-DDEVMAPPER||g' || die + fi +} + +src_compile() { + # lilo needs this. bug #140209 + export LC_ALL=C + + # we explicitly prevent the custom CFLAGS for stability reasons + if use static; then + local target=alles + else + local target=all + fi + + emake CC="$(tc-getCC) ${LDFLAGS}" ${target} +} + +src_install() { + keepdir /boot + emake DESTDIR="${D}" install + + if use !minimal; then + into / + dosbin "${WORKDIR}"/dolilo/dolilo + + into /usr + dosbin keytab-lilo.pl + + insinto /etc + newins "${FILESDIR}"/lilo.conf lilo.conf.example + + newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example + + dodoc CHANGELOG* readme/README.* readme/INCOMPAT README + docinto samples ; dodoc sample/* + fi +} + +# Check whether LILO is installed +# This function is from /usr/sbin/mkboot from debianutils, with copyright: +# +# Debian GNU/Linux +# Copyright 1996-1997 Guy Maor <maor@debian.org> +# +# Modified for Gentoo for use with the lilo ebuild by: +# Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003) +# +lilocheck() { + local bootpart= + local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")" + + echo + ebegin "Checking whether LILO can be safely updated" + + if [ "$(whoami)" != "root" ] + then + eend 1 + eerror "Only root can check for LILO" + return 1 + fi + + if [ -z "${rootpart}" ] + then + eend 1 + eerror "Could not determine root partition" + return 1 + fi + + if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ] + then + eend 1 + eerror "No LILO configuration in place" + return 1 + fi + + bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)" + + if [ -z "${bootpart}" ] + then + # lilo defaults to current root when 'boot=' is not present + bootpart="${rootpart}" + fi + + if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO' + then + eend 1 + eerror "No LILO signature on ${bootpart}" + ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand." + return 1 + fi + + if grep -q "^[[:space:]]*password[[:space:]]*=[[:space:]]*\"\"" /etc/lilo.conf + then + eend 1 + eerror "Interactive password entry configured" + ewarn "Run /sbin/lilo -p by hand." + return 1 + fi + + einfo "LILO on ${bootpart} is safe to update" + eend 0 + return 0 +} + +pkg_postinst() { + if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ] + then + [ -f "${ROOT}/boot/boot-menu.b" ] && \ + ln -snf boot-menu.b "${ROOT}/boot/boot.b" + fi + + if [ "${ROOT}" = "/" ] && use !minimal; + then + if lilocheck + then + einfo "Running DOLILO to complete the install" + # do not redirect to /dev/null because it may display some input + # prompt + /sbin/dolilo + if [ "$?" -ne 0 ] + then + eerror "You must manually configure and run LILO" + fi + fi + echo + fi + if use !minimal; then + echo + einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that" + einfo "handles mounting and unmounting /boot for you. It can do more, " + einfo "edit /etc/conf.d/dolilo to harness its full potential." + echo + fi +} diff --git a/sys-boot/lilo/lilo-24.2.ebuild b/sys-boot/lilo/lilo-24.2.ebuild new file mode 100644 index 000000000000..c84d6257d959 --- /dev/null +++ b/sys-boot/lilo/lilo-24.2.ebuild @@ -0,0 +1,178 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit eutils flag-o-matic toolchain-funcs + +DOLILO_V="0.6" +IUSE="static minimal pxeserial device-mapper" + +DESCRIPTION="Standard Linux boot loader" +HOMEPAGE="https://alioth.debian.org/projects/lilo/" + +DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2" +SRC_URI=" + http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz + mirror://gentoo/${DOLILO_TAR} +" + +SLOT="0" +LICENSE="BSD GPL-2" +KEYWORDS="-* ~amd64 ~x86" + +DEPEND=">=sys-devel/bin86-0.15.5" +RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )" + +src_prepare() { + # this patch is needed when booting PXE and the device you're using + # emulates vga console via serial console. + # IE.. B.B.o.o.o.o.t.t.i.i.n.n.g.g....l.l.i.i.n.n.u.u.x.x and stair stepping. + use pxeserial && epatch "${FILESDIR}/${PN}-24.1-novga.patch" + + # Do not strip and have parallel make + # FIXME: images/Makefile does weird stuff + sed -i Makefile src/Makefile \ + -e '/strip/d;s|^ make| $(MAKE)|g' \ + -e '/images install/d' \ + -e '/images all/d' \ + || die "sed strip failed" +} + +src_configure() { + if ! use device-mapper; then + sed -i make.vars -e 's|-DDEVMAPPER||g' || die + fi +} + +src_compile() { + # lilo needs this. bug #140209 + export LC_ALL=C + + # we explicitly prevent the custom CFLAGS for stability reasons + if use static; then + local target=alles + else + local target=all + fi + + emake CC="$(tc-getCC) ${LDFLAGS}" ${target} +} + +src_install() { + keepdir /boot + emake DESTDIR="${D}" install + + if use !minimal; then + into / + dosbin "${WORKDIR}"/dolilo/dolilo + + into /usr + dosbin keytab-lilo.pl + + insinto /etc + newins "${FILESDIR}"/lilo.conf lilo.conf.example + + newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example + + dodoc CHANGELOG* readme/README.* readme/INCOMPAT README + docinto samples ; dodoc sample/* + fi +} + +# Check whether LILO is installed +# This function is from /usr/sbin/mkboot from debianutils, with copyright: +# +# Debian GNU/Linux +# Copyright 1996-1997 Guy Maor <maor@debian.org> +# +# Modified for Gentoo for use with the lilo ebuild by: +# Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003) +# +lilocheck() { + local bootpart= + local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")" + + echo + ebegin "Checking whether LILO can be safely updated" + + if [ "$(whoami)" != "root" ] + then + eend 1 + eerror "Only root can check for LILO" + return 1 + fi + + if [ -z "${rootpart}" ] + then + eend 1 + eerror "Could not determine root partition" + return 1 + fi + + if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ] + then + eend 1 + eerror "No LILO configuration in place" + return 1 + fi + + bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)" + + if [ -z "${bootpart}" ] + then + # lilo defaults to current root when 'boot=' is not present + bootpart="${rootpart}" + fi + + if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO' + then + eend 1 + eerror "No LILO signature on ${bootpart}" + ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand." + return 1 + fi + + if grep -q "^[[:space:]]*password[[:space:]]*=[[:space:]]*\"\"" /etc/lilo.conf + then + eend 1 + eerror "Interactive password entry configured" + ewarn "Run /sbin/lilo -p by hand." + return 1 + fi + + einfo "LILO on ${bootpart} is safe to update" + eend 0 + return 0 +} + +pkg_postinst() { + if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ] + then + [ -f "${ROOT}/boot/boot-menu.b" ] && \ + ln -snf boot-menu.b "${ROOT}/boot/boot.b" + fi + + if [ "${ROOT}" = "/" ] && use !minimal; + then + if lilocheck + then + einfo "Running DOLILO to complete the install" + # do not redirect to /dev/null because it may display some input + # prompt + /sbin/dolilo + if [ "$?" -ne 0 ] + then + eerror "You must manually configure and run LILO" + fi + fi + echo + fi + if use !minimal; then + echo + einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that" + einfo "handles mounting and unmounting /boot for you. It can do more, " + einfo "edit /etc/conf.d/dolilo to harness its full potential." + echo + fi +} diff --git a/sys-boot/lilo/metadata.xml b/sys-boot/lilo/metadata.xml new file mode 100644 index 000000000000..d414bba04d95 --- /dev/null +++ b/sys-boot/lilo/metadata.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> + <email>chainsaw@gentoo.org</email> +</maintainer> +<maintainer type="project"> + <email>base-system@gentoo.org</email> + <name>Gentoo Base System</name> +</maintainer> +<use> + <flag name="device-mapper">Enable support for device-mapper from <pkg>sys-fs/lvm2</pkg></flag> + <flag name="minimal">Do not install the dolilo helper script</flag> + <flag name="pxeserial">Avoid character echo on PXE serial console</flag> +</use> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/makebootfat/Manifest b/sys-boot/makebootfat/Manifest new file mode 100644 index 000000000000..5da07ab2d5ee --- /dev/null +++ b/sys-boot/makebootfat/Manifest @@ -0,0 +1 @@ +DIST makebootfat-1.4.tar.gz 146722 BLAKE2B 00ad12565951691df2e7af90ae1777c6c6e2253efc61350046cc3ece3342054267f8bdf7ec2303ee203f7af757e7bbda7843104480fb4529eeed2a33456b7f22 SHA512 638356c951670187960d0050d963116391d4b494bc9b082b3d4673188450e47f22fda5733aa09b15cfbb1640807676f5f8743dd094b9931f150b445eb8d335dd diff --git a/sys-boot/makebootfat/makebootfat-1.4.ebuild b/sys-boot/makebootfat/makebootfat-1.4.ebuild new file mode 100644 index 000000000000..5482bdde364a --- /dev/null +++ b/sys-boot/makebootfat/makebootfat-1.4.ebuild @@ -0,0 +1,27 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Command line utility able to create bootable USB disks" +HOMEPAGE="http://advancemame.sourceforge.net/boot-readme.html" +SRC_URI="mirror://sourceforge/advancemame/${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +RDEPEND="sys-boot/syslinux" +DEPEND="${RDEPEND}" + +src_install() { + default + + insinto /usr/share/makebootfat + doins mbrfat.bin + + dodoc doc/*.txt + docinto html + dodoc doc/*.html +} diff --git a/sys-boot/makebootfat/metadata.xml b/sys-boot/makebootfat/metadata.xml new file mode 100644 index 000000000000..154e50a12692 --- /dev/null +++ b/sys-boot/makebootfat/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>jlec@gentoo.org</email> + </maintainer> + <upstream> + <remote-id type="sourceforge">advancemame</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/mbr-gpt/Manifest b/sys-boot/mbr-gpt/Manifest new file mode 100644 index 000000000000..11ccdc8ea92d --- /dev/null +++ b/sys-boot/mbr-gpt/Manifest @@ -0,0 +1 @@ +DIST mbr-gpt_0.0.1.tar.gz 15861 BLAKE2B 00c6741fa5543af435cee97132510126d0301db2fb50712d438703165507125b4981844cb4a841b11bad075af5effb746fd3aa04e6834fb051536b250c01f7ad SHA512 eaabd84fc749ddee8fa40632ad49e15e894bf35a881fb7c35ba22796c2459a886e9bda601595e58d29567ff26959ae2befe6aec5db397d15e1dc5a292dafe165 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 new file mode 100644 index 000000000000..8df1596c6403 --- /dev/null +++ b/sys-boot/mbr-gpt/mbr-gpt-0.0.1-r1.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit eutils flag-o-matic 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" +IUSE="" +# 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="binchecks 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! + use amd64 && sed -i -e 's/-Wall/-Wall -m32/g' "${S}"/Makefile +} + +src_compile() { + emake CC="$(tc-getCC)" +} + +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." +} diff --git a/sys-boot/mbr-gpt/metadata.xml b/sys-boot/mbr-gpt/metadata.xml new file mode 100644 index 000000000000..d5ff2ea44659 --- /dev/null +++ b/sys-boot/mbr-gpt/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> + <email>robbat2@gentoo.org</email> +</maintainer> +<maintainer type="project"> + <email>base-system@gentoo.org</email> + <name>Gentoo Base System</name> +</maintainer> +<longdescription lang="en"> + Bootable MBR including fake partition records, for legacy BIOS without any GPT support, and usable without hybrid disk layouts. + Install directly at the start of a disk, create GPT, ensure at least one partition has GUID set to BIOS Boot Partition (21686148-6449-6e6f-744e-656564454649). +</longdescription> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/mbr/Manifest b/sys-boot/mbr/Manifest new file mode 100644 index 000000000000..384778a68e9e --- /dev/null +++ b/sys-boot/mbr/Manifest @@ -0,0 +1 @@ +DIST mbr-1.1.11.tar.gz 132060 BLAKE2B 1e7d8267bf4bc4b09a69a61ecf20c82533b4ed879bdaf94c65e361d2e48d7399e41a7c25da757a0f287e33fbb051b6a3bfa038b64f287ddab52b1f1f2529dad0 SHA512 27637b7c37be22ec7947b73684156a38c76dd1d37fad12133dd614ac4b98b578b30a758e6179a7cd62f6044dde2dce19a1e28234aa4bd0d848ef97b44d6cd8f9 diff --git a/sys-boot/mbr/mbr-1.1.11-r1.ebuild b/sys-boot/mbr/mbr-1.1.11-r1.ebuild new file mode 100644 index 000000000000..81c9c11d3b42 --- /dev/null +++ b/sys-boot/mbr/mbr-1.1.11-r1.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +DESCRIPTION="A replacement master boot record for IBM-PC compatible computers" +HOMEPAGE="https://www.chiark.greenend.org.uk/~neilt/mbr/" +SRC_URI="https://www.chiark.greenend.org.uk/~neilt/mbr/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-alpha amd64 -ppc -sparc x86" +IUSE="test" +RESTRICT="!test? ( test )" + +DEPEND=" + sys-devel/bin86 + test? ( dev-vcs/rcs )" +RDEPEND="" + +src_prepare() { + # do not treat warnings as errors + sed -i -e "s: -Werror::" {,harness/}Makefile.{in,am} || die + default +} + +src_install() { + dosbin install-mbr + doman install-mbr.8 + dodoc AUTHORS ChangeLog install-mbr.8 NEWS README TODO +} + +pkg_postinst() { + elog "To install the MBR, run /sbin/install-mbr" +} diff --git a/sys-boot/mbr/metadata.xml b/sys-boot/mbr/metadata.xml new file mode 100644 index 000000000000..d85b4252fc33 --- /dev/null +++ b/sys-boot/mbr/metadata.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<!-- maintainer-needed --> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/metadata.xml b/sys-boot/metadata.xml new file mode 100644 index 000000000000..2d91fb22ab0d --- /dev/null +++ b/sys-boot/metadata.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<catmetadata> + <longdescription lang="en"> + The sys-boot category contains bootloaders and related tools. + </longdescription> + <longdescription lang="es"> + La categoría sys-boot contiene algunos cargadores de arranque y + herramientas relacionadas. + </longdescription> + <longdescription lang="ja"> + sys-bootカテゴリにはブートとブート関連ツールが含まれます。 + </longdescription> + <longdescription lang="de"> + Die Kategorie sys-boot enthält Bootloader sowie damit in + Zusammenhang stehende Programme. + </longdescription> + <longdescription lang="nl"> + De sys-boot categorie bevat bootloaders en bijbehorende gereedschappen. + </longdescription> + <longdescription lang="vi"> + Nhóm sys-boot chứa các bootloader và công cụ liên quan. + </longdescription> + <longdescription lang="it"> + La categoria sys-boot contiene bootloaders e strumenti correlati al boot del sistema. + </longdescription> + <longdescription lang="pt"> + A categoria sys-boot contém gerenciadores de inicialização e + ferramentas relacionadas. + </longdescription> + <longdescription lang="pl"> + Kategoria sys-boot zawiera programy ładujące (bootloadery) i związane z + nimi pakiety. + </longdescription> +</catmetadata> + diff --git a/sys-boot/milo/Manifest b/sys-boot/milo/Manifest new file mode 100644 index 000000000000..dd08781bb887 --- /dev/null +++ b/sys-boot/milo/Manifest @@ -0,0 +1,6 @@ +DIST MILO-HOWTO 52455 BLAKE2B f476cb2a9b362c520dc4c00b493c05a650208d8ea004427ed710bd59919b4773b45f02b8a62ffdb0e7ac11ac51c521bb27d4d7ee0046bc29a46dca9d558d257e SHA512 81e0fdc12a1e56af14af4a4167ccc9d6ffefa265fad3328c27b7640b51b07012870c0e57497d83084d1ff9c3681ceb617a4ff25f87e12d109c34df062a0c1432 +DIST ldmilo-patched-20010430 18944 BLAKE2B 563ccc51e1f227232af60ba9bc76f6717b6a77814c1452d0209e439c3a07dfd53a850a8ba07983bb6a2493cde4204366f47b790a53c8063db0063effb739a8c6 SHA512 c02ba8805b0d28516534d679fef7073e6c2adea30d41a8bf9e40c48c57a889e5122f475970c6afe9ddd894970dfc2504ea89c276d920a1fbd88c3abc3eaa1e01 +DIST linload.exe 7168 BLAKE2B 393696c987b771a75c5c0a04a6f82999189ecb60067464e8073bf392670162ebcea9b40ed5a08fca6e46b307a4ac50be10312fa4e6da525b60fa1f393c23d996 SHA512 604b1937d751b18a9204681a248ce9557912c10b2e2c68e5f9ce33030d5b0d8721f1afafaf22d6326bc4514a09a72696c4917d893a9e64ac44b61e563caac96c +DIST linux-2.2.20-reiserfs-3.5.35.diff.bz2 154943 BLAKE2B 6226321438bed88bc31fb151a28157dda811a2c7ce6c543564f2ef183489b20f2b7f6df903f63aadaa8196ba10bd54df4c7069e448bb456474bccf64770a666e SHA512 b63d03d605d65cb7a15020ad38b80d77b810963edbdc0b5ccaf1706347de5026e390d8c2a5315f1d2734b793903c1a407b4db4129d11b7d5ff2ad9dc8f2137aa +DIST linux-2.2.25.tar.bz2 15791211 BLAKE2B 5b4b416c41b2277c4e509e7c0003d1ba0bd26e1bbb03a30bdb9d44f9211f6edb593bbca158379ea565e2f35d01e128590971ea85220baec06c23ae15e3942f1b SHA512 63e83f4f184cdd09f39c24e2023fce3562ea550db7182ae94e36ce30c6b2415bac970306cd60c1d1a89a1a3b54ad957094629557a5782f181939efb219ad41bb +DIST milo-2.2-18.tar.bz2 1074725 BLAKE2B 7e7cac8ec2ee8246f21f5ea0f1d497dd6234ed67dad0a340e0183abec2f7a4f694b48eb87ba65ef97e967918c55c9fbfdd56e502f21fc47f8d053d0353758f1c SHA512 1ccc86c83d520d07040ba44d14e7e9353cf364bf5b83ba4df14b0560769643ce07f89feeab468144fe17b7bf482beb7480f5dad1a0e9b574e6e6150bb72aae93 diff --git a/sys-boot/milo/files/README-gentoo b/sys-boot/milo/files/README-gentoo new file mode 100644 index 000000000000..5ad8c753ba09 --- /dev/null +++ b/sys-boot/milo/files/README-gentoo @@ -0,0 +1,98 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# +############################################## +# Gentoo Linux MILO images. +#################################################### +# +# What is MILO? +# +### + +MILO is an AlphaLinux bootloader, which is usually used to load the Linux +Operating System on Alpha machines that dont have SRM. + +There are two families of firmware on Alpha, ARC and SRM. ARC was developed +for use with Windows NT, and cannot support Linux. Some Alpha's were +distributed with only ARC firmware, for use specifically with Windows NT, +these machines would not be able to run any OS except for Windows NT without +MILO. + +If you do have SRM, or the option of using SRM, you should be using the aboot +bootloader, unless you really know what you are doing. + +NOTE: if you have srm, but would like to dual boot with Windows NT, or use ARC + firmware, you might find MILO more useful than aboot. There are other + reasons also, booting a kernel from a reiserfs partition, for example. + +NOTE: The Gentoo MILO images are slightly different to the standard + MILO images, they have been patched to compile with gcc3 and + work with the latest linux-2.2 kernel and drivers. You can + also optimise your MILO image, to maximise the performance of the + MILO pager! woooo! + +FIXME: will there be a boot speed improvement from optimising MILO? +FIXME: what about performance of the call_pal routines (or at least the + overhead of calling them, as they are hand coded asm), will + that improve system performance? + +##################################################### +# +# How do i use these images to boot? +# +#### + +NOTE: Read the MILO-HOWTO in this directory now! + There is an explanation and description of all the ways you can + start MILO, including SRM, Floppy, Flash and Debug Monitor. + +In this directory you will find the MILO images, you can use these to +make MILO boot floppies, or install them to a FAT partition. + +There are instructions below for making a MILO boot floppy. + + +1. insert the disk you would like to make a MILO floppy. + +2. fdformat /dev/fd0 + + Obviously, if the disk is already formatted you can skip + this step. + +3. mformat a: + + this will create a MSDOS file system (FAT) on the floppy. + +4. mcopy milo-2.4.18-gentoo-<your alpha> a:\milo + + install the milo image for your machine onto the new floppy. + +5. mcopy linload.exe a:\linload.exe + _OR_ if you have a Ruffian machine: + mcopy ldmilo.exe a:\ldmilo.exe + + install the milo loader, note that ruffians dont use ldlinux.exe + by default, if your system expects ldlinux.exe, just copy that file + instead. the ldmilo included in this ebuild contains the fixes by Jay + Eastabrook, sometimes called "Jay's Hacked Version". + +6. echo -ne '\125\252' | dd of=/dev/fd0 bs=1 seek=510 count=2 conv=notrunc + + this might not be nescessary on all machines, but some ARCs expect the + floppy to be marked bootable, this fakes the magic. + +7. reboot, and set ARCs to boot your shiny new MILO floppy! + +##################################################### +# +# BUGS +# +#### + +These MILO images are not extensively tested, if you use one +PLEASE, PLEASE, PLEASE tell me! i need to know which systems +it works on and which ones it doesnt. + +if you dont want to enter a bug in http://bugs.gentoo.org/ + +you can just email me a quick note to taviso@gentoo.org diff --git a/sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff b/sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff new file mode 100644 index 000000000000..d99769f91c9f --- /dev/null +++ b/sys-boot/milo/files/linux-2.2.25-gcc3-milo.diff @@ -0,0 +1,123 @@ +diff -ru --minimal linux/arch/alpha/kernel/process.c linux/arch/alpha/kernel/process.c +--- linux/arch/alpha/kernel/process.c 2001-03-25 17:37:29.000000000 +0100 ++++ linux/arch/alpha/kernel/process.c 2003-06-02 20:20:19.000000000 +0100 +@@ -57,7 +57,7 @@ + static struct fs_struct init_fs = INIT_FS; + static struct files_struct init_files = INIT_FILES; + static struct signal_struct init_signals = INIT_SIGNALS; +-struct mm_struct init_mm = INIT_MM; ++struct mm_struct init_mm; + + union task_union init_task_union __attribute__((section("init_task"))) + = { task: INIT_TASK }; +diff -ru --minimal linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c +--- linux/drivers/char/tty_io.c 2002-05-21 00:32:34.000000000 +0100 ++++ linux/drivers/char/tty_io.c 2003-06-02 20:05:08.000000000 +0100 +@@ -756,15 +756,17 @@ + } + + /* Semaphore to protect creating and releasing a tty */ +-static struct semaphore tty_sem = MUTEX; ++static struct semaphore tty_sem; + + static void down_tty_sem(int index) + { ++ tty_sem = MUTEX; + down(&tty_sem); + } + + static void up_tty_sem(int index) + { ++ tty_sem = MUTEX; + up(&tty_sem); + } + +@@ -785,6 +787,7 @@ + int retval=0; + int idx; + ++ tty_sem = MUTEX; + driver = get_tty_driver(device); + if (!driver) + return -ENODEV; +diff -ru --minimal linux/fs/super.c linux/fs/super.c +--- linux/fs/super.c 2001-11-02 16:39:08.000000000 +0000 ++++ linux/fs/super.c 2003-06-02 20:13:53.000000000 +0100 +@@ -42,7 +42,7 @@ + * unmounting a filesystem and re-mounting it (or something + * else). + */ +-static struct semaphore mount_sem = MUTEX; ++static struct semaphore mount_sem; + + extern void wait_for_keypress(void); + extern struct file_operations * get_blkfops(unsigned int major); +@@ -730,6 +730,7 @@ + int retval; + struct inode * inode = get_empty_inode(); + ++ mount_sem = MUTEX; + retval = -ENOMEM; + if (!inode) + goto out; +@@ -859,6 +860,7 @@ + struct vfsmount *vfsmnt; + int error; + ++ mount_sem = MUTEX; + error = -EACCES; + if (!(flags & MS_RDONLY) && dev && is_read_only(dev)) + goto out; +diff -ru --minimal linux/kernel/sys.c linux/kernel/sys.c +--- linux/kernel/sys.c 2002-09-16 17:26:33.000000000 +0100 ++++ linux/kernel/sys.c 2003-06-02 20:00:20.000000000 +0100 +@@ -866,12 +866,13 @@ + * rather than a semaphore. Anybody want to implement + * one? + */ +-struct semaphore uts_sem = MUTEX; ++struct semaphore uts_sem; + + asmlinkage int sys_newuname(struct new_utsname * name) + { + int errno = 0; + ++ uts_sem = MUTEX; + down(&uts_sem); + if (copy_to_user(name,&system_utsname,sizeof *name)) + errno = -EFAULT; +@@ -883,6 +884,7 @@ + { + int errno; + ++ uts_sem = MUTEX; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + if (len < 0 || len > __NEW_UTS_LEN) +@@ -901,6 +903,7 @@ + { + int i, errno; + ++ uts_sem = MUTEX; + if (len < 0) + return -EINVAL; + down(&uts_sem); +@@ -922,6 +925,7 @@ + { + int errno; + ++ uts_sem = MUTEX; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + if (len < 0 || len > __NEW_UTS_LEN) +diff -ru --minimal linux/include/asm-alpha/errno.h linux/include/asm-alpha/errno.h +--- linux/include/asm-alpha/errno.h 2001-03-25 17:31:06.000000000 +0100 ++++ linux/include/asm-alpha/errno.h 2003-06-02 23:48:45.000000000 +0100 +@@ -134,6 +134,7 @@ + #define ELIBMAX 125 /* Attempting to link in too many shared libraries */ + #define ELIBEXEC 126 /* Cannot exec a shared library directly */ + #define ERESTART 127 /* Interrupted system call should be restarted */ ++#define EHASHCOLLISION 127 /* reiserfs hash collision */ + #define ESTRPIPE 128 /* Streams pipe error */ + + #define ENOMEDIUM 129 /* No medium found */ diff --git a/sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff b/sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff new file mode 100644 index 000000000000..2fa897df6e90 --- /dev/null +++ b/sys-boot/milo/files/milo-2.2-18-gcc3-gentoo.diff @@ -0,0 +1,174 @@ +diff -u -r --minimal milo-2.2-18.orig/config.in milo-2.2-18/config.in +--- milo-2.2-18.orig/config.in 2001-07-18 15:58:30.000000000 +0100 ++++ milo-2.2-18/config.in 2003-06-05 18:52:06.000000000 +0100 +@@ -5,7 +5,7 @@ + + comment 'Alpha Linux Miniloader setup' + # +-string 'Path to kernel sources' KSRC /usr/src/linux ++string 'Path to kernel sources' KSRC ${WORKDIR}/linux + choice 'Alpha system type' \ + "Alpha-XLT MINI_ALPHA_XLT \ + Alpha-XL MINI_ALPHA_XL \ +diff -u -r --minimal milo-2.2-18.orig/devices.c milo-2.2-18/devices.c +--- milo-2.2-18.orig/devices.c 2001-07-18 16:59:38.000000000 +0100 ++++ milo-2.2-18/devices.c 2003-06-05 18:52:06.000000000 +0100 +@@ -98,7 +98,7 @@ + struct fs_struct init_fs = INIT_FS; + struct files_struct init_files = INIT_FILES; + struct signal_struct init_signals = INIT_SIGNALS; +-struct mm_struct init_mm = INIT_MM; ++struct mm_struct init_mm; + + unsigned securebits = SECUREBITS_DEFAULT; /* systemwide security settings */ + +@@ -1213,7 +1213,7 @@ + } + + +-void __wake_up(struct wait_queue **p, unsigned int mode, unsigned int wq_mode) ++void __wake_up(struct wait_queue **p, unsigned int mode) + { + wake_up(p); + } +diff -u -r --minimal milo-2.2-18.orig/Documentation/defconfig.milo milo-2.2-18/Documentation/defconfig.milo +--- milo-2.2-18.orig/Documentation/defconfig.milo 2001-07-19 10:59:45.000000000 +0100 ++++ milo-2.2-18/Documentation/defconfig.milo 2003-06-05 18:52:06.000000000 +0100 +@@ -5,7 +5,7 @@ + # + # Alpha Linux Miniloader setup + # +-KSRC=/usr/src/linux ++KSRC=${WORKDIR}/linux + # MINI_ALPHA_XLT is not set + # MINI_ALPHA_XL is not set + # MINI_ALPHA_BOOK1 is not set +@@ -36,7 +36,7 @@ + # MINI_VGA_RAW2 is not set + MINI_TGA_CONSOLE=y + MINI_EXTERNAL_FONT=y +-MINI_FONT_FILE=/usr/lib/kbd/consolefonts/default8x16.gz ++MINI_FONT_FILE=/usr/share/consolefonts/default8x16.psfu.gz + MILO_CONFIG_EXT2FS=y + MILO_CONFIG_MSDOSFS=y + MILO_CONFIG_REISERFS=y +diff -u -r --minimal milo-2.2-18.orig/hwrpb.c milo-2.2-18/hwrpb.c +--- milo-2.2-18.orig/hwrpb.c 2001-07-18 14:38:38.000000000 +0100 ++++ milo-2.2-18/hwrpb.c 2003-06-05 18:52:06.000000000 +0100 +@@ -368,9 +368,17 @@ + percpu = + (struct percpu_struct *) (((char *) hwrpb) + + hwrpb->processor_offset); +- percpu->serial_no[0] = 0x73695f78756e694c; ++#ifndef MILO_SERIAL_NUMBER0 ++#define MILO_SERIAL_NUMBER0 0x73695f78756e694c ++#endif /* MILO_SERIAL_NUMBER0 */ ++ ++#ifndef MILO_SERIAL_NUMBER1 ++#define MILO_SERIAL_NUMBER1 0x002174616572475f; ++#endif /* MILO_SERIAL_NUMBER1 */ ++ ++ percpu->serial_no[0] = MILO_SERIAL_NUMBER0; + /* :-) */ +- percpu->serial_no[1] = 0x002174616572475f; ++ percpu->serial_no[1] = MILO_SERIAL_NUMBER1; + percpu->type = cpuid(); + + /* +diff -u -r --minimal milo-2.2-18.orig/Makefile milo-2.2-18/Makefile +--- milo-2.2-18.orig/Makefile 2001-07-18 17:15:31.000000000 +0100 ++++ milo-2.2-18/Makefile 2003-06-05 18:52:06.000000000 +0100 +@@ -54,8 +54,8 @@ + # + + LINKFLAGS = -non_shared -N -T milo.lds +-CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \ +- -fno-strict-aliasing -mcpu=ev5 -pipe -mno-fp-regs \ ++CFLAGS += -Wall -Wstrict-prototypes -fomit-frame-pointer \ ++ -fno-strict-aliasing -pipe -mno-fp-regs \ + -ffixed-8 -Wa,-mev6 -D__KERNEL__ -D__linux__ \ + -I$(KSRC)/include + +diff -u -r --minimal milo-2.2-18.orig/milo.c milo-2.2-18/milo.c +--- milo-2.2-18.orig/milo.c 2001-07-18 14:38:38.000000000 +0100 ++++ milo-2.2-18/milo.c 2003-06-05 19:16:16.000000000 +0100 +@@ -1436,9 +1436,10 @@ + { + extern U64 milo_memory_size; + +- printk("MILO (%s):\n", alpha_mv.vector_name); +- printk(" Built against Linux " UTS_RELEASE "\n"); ++ printk("Gentoo MILO (%s):\n", alpha_mv.vector_name); ++ printk(" Built against Gentoo Linux Kernel " UTS_RELEASE "\n"); + printk(" Using compiler " LINUX_COMPILER "\n"); ++ printk("\nWelcome to the Gentoo Linux MIniLOader\n"); + + #if 0 + /* what sort of video do we have? */ +@@ -1792,7 +1793,7 @@ + /* parse commands forever */ + while (1) { + +- printk("MILO> "); ++ printk("MILO > "); + + kbd_gets(command_string, 256); + printk_rows = 0; +diff -u -r --minimal milo-2.2-18.orig/tools/scripts/allfiles milo-2.2-18/tools/scripts/allfiles +--- milo-2.2-18.orig/tools/scripts/allfiles 2001-07-11 18:27:02.000000000 +0100 ++++ milo-2.2-18/tools/scripts/allfiles 2003-06-05 18:52:06.000000000 +0100 +@@ -1,7 +1,7 @@ + #!/bin/bash + + LOC=kernel/objs +-KSRC=/usr/src/linux/ ++KSRC=${WORKDIR}/linux + + rm -rf $LOC + +diff -u -r --minimal milo-2.2-18.orig/tools/scripts/build milo-2.2-18/tools/scripts/build +--- milo-2.2-18.orig/tools/scripts/build 2001-07-18 16:58:29.000000000 +0100 ++++ milo-2.2-18/tools/scripts/build 2003-06-05 19:14:25.000000000 +0100 +@@ -1,29 +1,9 @@ + #!/bin/bash + set -e + +-RELEASE=2.2-17 ++RELEASE=2.2-18-Gentoo + +-for i in \ +- "Alpha-XLT XLT" \ +- "Alpha-XL XL" \ +- "AlphaBook1 BOOK1" \ +- "Avanti AVANTI" \ +- "Cabriolet CABRIOLET" \ +- "EB66 EB66" \ +- "EB66+ EB66P" \ +- "EB64+ EB64P" \ +- "EB164 EB164" \ +- "PC164 PC164" \ +- "LX164 LX164" \ +- "SX164 SX164" \ +- "Noname NONAME" \ +- "Takara TAKARA" \ +- "Mikasa MIKASA" \ +- "Alcor ALCOR" \ +- "Miata MIATA" \ +- "Ruffian RUFFIAN" \ +- "Platform2000 P2K" \ +- "UDB UDB" ++for i in __MILO_ARCHES__ + do + short=`echo $i | awk '{print $1}'` + long=`echo $i | awk '{print $2}'` +diff -u -r --minimal milo-2.2-18.orig/tools/scripts/buildkernels milo-2.2-18/tools/scripts/buildkernels +--- milo-2.2-18.orig/tools/scripts/buildkernels 1999-08-19 14:08:55.000000000 +0100 ++++ milo-2.2-18/tools/scripts/buildkernels 2003-06-05 18:52:06.000000000 +0100 +@@ -1,6 +1,6 @@ + #!/bin/bash + +-LINUX=/usr/src/linux ++LINUX=${WORKDIR}/linux + KOUT=$(dirname `pwd`)/linux + + set -e diff --git a/sys-boot/milo/files/mkserial_no.c b/sys-boot/milo/files/mkserial_no.c new file mode 100644 index 000000000000..b4650447584f --- /dev/null +++ b/sys-boot/milo/files/mkserial_no.c @@ -0,0 +1,45 @@ +#include <stdio.h> + +/* some example serial numbers for the MILO bootloader */ +/* gcc -o mkserial_no mkserial_no.c */ +/* taviso@gentoo.org 2003 */ + +/* NOTE: remember you need a 0x00 (NULL terminator) at the end */ + +int main() +{ + long long serial_no[2]; + + /* 1) Linux_is_Great! */ + /* s i _ x u n i L */ + serial_no[0] = 0x73695f78756e694c; + /* ! t a e r G _ */ + serial_no[1] = 0x002174616572475f; + + /* 2) Gentoo Linux. */ + /* L o o t n e G */ + serial_no[0] = 0x4c206f6f746e6547; + /* . x u n i */ + serial_no[1] = 0x0000002e78756e69; + + /* 3) Gentoo/Alpha. */ + /* A / o o t n e G */ + serial_no[0] = 0x412f6f6f746e6547; + /* .a h p l */ + serial_no[1] = 0x0000002e6168706c; + + /* 4) Gentoo MILO. */ + /* M o o t n e G */ + serial_no[0] = 0x4d206f6f746e6547; + /* . O L I */ + serial_no[1] = 0x000000002e4f4c49; + + /* 5) |d|i|g|i|t|a|l| */ + /* i | g | i | d | */ + serial_no[0] = 0x697c677c697c647c; + /* | l | a | t | */ + serial_no[1] = 0x007c6c7c617c747c; + + printf ("serial number:\t%s\n", (char*) serial_no); + return (0); +} diff --git a/sys-boot/milo/files/objstrip.c b/sys-boot/milo/files/objstrip.c new file mode 100644 index 000000000000..bbda40330708 --- /dev/null +++ b/sys-boot/milo/files/objstrip.c @@ -0,0 +1,282 @@ +/* + * arch/alpha/boot/tools/objstrip.c + * + * Strip the object file headers/trailers from an executable (ELF or ECOFF). + * + * Copyright (C) 1996 David Mosberger-Tang. + */ +/* + * Converts an ECOFF or ELF object file into a bootable file. The + * object file must be a OMAGIC file (i.e., data and bss follow immediatly + * behind the text). See DEC "Assembly Language Programmer's Guide" + * documentation for details. The SRM boot process is documented in + * the Alpha AXP Architecture Reference Manual, Second Edition by + * Richard L. Sites and Richard T. Witek. + */ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <unistd.h> + +#include <sys/fcntl.h> +#include <sys/stat.h> +#include <sys/types.h> + +#include <linux/a.out.h> +#include <linux/coff.h> +#include <linux/param.h> +#include <linux/string.h> +#ifdef __ELF__ +# include <asm/elf.h> +# include <linux/elf.h> +#endif + +/* bootfile size must be multiple of BLOCK_SIZE: */ +#define BLOCK_SIZE 512 + +const char * prog_name; + + +void +usage (void) +{ + fprintf(stderr, + "usage: %s [-v] -p file primary\n" + " %s [-vb] file [secondary]\n", prog_name, prog_name); + exit(1); +} + + +int +main (int argc, char *argv[]) +{ + size_t nwritten, tocopy, n, mem_size, fil_size, pad = 0; + int fd, ofd, i, j, verbose = 0, primary = 0; + char buf[8192], *inname; + struct exec * aout; /* includes file & aout header */ + long offset; +#ifdef __ELF__ + struct elfhdr *elf; + struct elf_phdr *elf_phdr; /* program header */ + unsigned long long e_entry; +#endif + + prog_name = argv[0]; + + for (i = 1; i < argc && argv[i][0] == '-'; ++i) { + for (j = 1; argv[i][j]; ++j) { + switch (argv[i][j]) { + case 'v': + verbose = ~verbose; + break; + + case 'b': + pad = BLOCK_SIZE; + break; + + case 'p': + primary = 1; /* make primary bootblock */ + break; + } + } + } + + if (i >= argc) { + usage(); + } + inname = argv[i++]; + + fd = open(inname, O_RDONLY); + if (fd == -1) { + perror("open"); + exit(1); + } + + ofd = 1; + if (i < argc) { + ofd = open(argv[i++], O_WRONLY | O_CREAT | O_TRUNC, 0666); + if (fd == -1) { + perror("open"); + exit(1); + } + } + + if (primary) { + /* generate bootblock for primary loader */ + + unsigned long bb[64], sum = 0; + struct stat st; + off_t size; + int i; + + if (ofd == 1) { + usage(); + } + + if (fstat(fd, &st) == -1) { + perror("fstat"); + exit(1); + } + + size = (st.st_size + BLOCK_SIZE - 1) & ~(BLOCK_SIZE - 1); + memset(bb, 0, sizeof(bb)); + strcpy((char *) bb, "Linux SRM bootblock"); + bb[60] = size / BLOCK_SIZE; /* count */ + bb[61] = 1; /* starting sector # */ + bb[62] = 0; /* flags---must be 0 */ + for (i = 0; i < 63; ++i) { + sum += bb[i]; + } + bb[63] = sum; + if (write(ofd, bb, sizeof(bb)) != sizeof(bb)) { + perror("boot-block write"); + exit(1); + } + printf("%lu\n", size); + return 0; + } + + /* read and inspect exec header: */ + + if (read(fd, buf, sizeof(buf)) < 0) { + perror("read"); + exit(1); + } + +#ifdef __ELF__ + elf = (struct elfhdr *) buf; + + if (elf->e_ident[0] == 0x7f && strncmp(elf->e_ident + 1, "ELF", 3) == 0) { + if (elf->e_type != ET_EXEC) { + fprintf(stderr, "%s: %s is not an ELF executable\n", + prog_name, inname); + exit(1); + } + if (!elf_check_arch(elf)) { + fprintf(stderr, "%s: is not for this processor (e_machine=%d)\n", + prog_name, elf->e_machine); + exit(1); + } + if (elf->e_phnum != 1) { + fprintf(stderr, + "%s: %d program headers (forgot to link with -N?)\n", + prog_name, elf->e_phnum); + } + + e_entry = elf->e_entry; + + lseek(fd, elf->e_phoff, SEEK_SET); + if (read(fd, buf, sizeof(*elf_phdr)) != sizeof(*elf_phdr)) { + perror("read"); + exit(1); + } + + elf_phdr = (struct elf_phdr *) buf; + offset = elf_phdr->p_offset; + mem_size = elf_phdr->p_memsz; + fil_size = elf_phdr->p_filesz; + + /* work around ELF bug: */ + if (elf_phdr->p_vaddr < e_entry) { + unsigned long delta = e_entry - elf_phdr->p_vaddr; + offset += delta; + mem_size -= delta; + fil_size -= delta; + elf_phdr->p_vaddr += delta; + } + + if (verbose) { + fprintf(stderr, "%s: extracting %#016lx-%#016lx (at %lx)\n", + prog_name, (long) elf_phdr->p_vaddr, + elf_phdr->p_vaddr + fil_size, offset); + } + } else +#endif + { + aout = (struct exec *) buf; + + if (!(aout->fh.f_flags & COFF_F_EXEC)) { + fprintf(stderr, "%s: %s is not in executable format\n", + prog_name, inname); + exit(1); + } + + if (aout->fh.f_opthdr != sizeof(aout->ah)) { + fprintf(stderr, "%s: %s has unexpected optional header size\n", + prog_name, inname); + exit(1); + } + + if (N_MAGIC(*aout) != OMAGIC) { + fprintf(stderr, "%s: %s is not an OMAGIC file\n", + prog_name, inname); + exit(1); + } + offset = N_TXTOFF(*aout); + fil_size = aout->ah.tsize + aout->ah.dsize; + mem_size = fil_size + aout->ah.bsize; + + if (verbose) { + fprintf(stderr, "%s: extracting %#016lx-%#016lx (at %lx)\n", + prog_name, aout->ah.text_start, + aout->ah.text_start + fil_size, offset); + } + } + + if (lseek(fd, offset, SEEK_SET) != offset) { + perror("lseek"); + exit(1); + } + + if (verbose) { + fprintf(stderr, "%s: copying %lu byte from %s\n", + prog_name, (unsigned long) fil_size, inname); + } + + tocopy = fil_size; + while (tocopy > 0) { + n = tocopy; + if (n > sizeof(buf)) { + n = sizeof(buf); + } + tocopy -= n; + if ((size_t) read(fd, buf, n) != n) { + perror("read"); + exit(1); + } + do { + nwritten = write(ofd, buf, n); + if ((ssize_t) nwritten == -1) { + perror("write"); + exit(1); + } + n -= nwritten; + } while (n > 0); + } + + if (pad) { + mem_size = ((mem_size + pad - 1) / pad) * pad; + } + + tocopy = mem_size - fil_size; + if (tocopy > 0) { + fprintf(stderr, + "%s: zero-filling bss and aligning to %lu with %lu bytes\n", + prog_name, pad, (unsigned long) tocopy); + + memset(buf, 0x00, sizeof(buf)); + do { + n = tocopy; + if (n > sizeof(buf)) { + n = sizeof(buf); + } + nwritten = write(ofd, buf, n); + if ((ssize_t) nwritten == -1) { + perror("write"); + exit(1); + } + tocopy -= nwritten; + } while (tocopy > 0); + } + return 0; +} diff --git a/sys-boot/milo/metadata.xml b/sys-boot/milo/metadata.xml new file mode 100644 index 000000000000..9f8addc79c4e --- /dev/null +++ b/sys-boot/milo/metadata.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>alpha@gentoo.org</email> + <name>Gentoo Linux Alpha Development</name> + </maintainer> + <longdescription lang="en"> + On Intel based PC systems, the BIOS firmware sets up the system and + then loads the image to be run from the boot block of a DOS file + system. This is more or less what MILO does on an Alpha based system, + however there are several interesting differences between BIOS firmware + and MILO, not least of which is that MILO includes and uses standard + Linux device drivers unmodified. MILO is firmware, unlike LILO, which + relies on the BIOS firmware to get itself loaded. + </longdescription> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/milo/milo-2.4.18.ebuild b/sys-boot/milo/milo-2.4.18.ebuild new file mode 100644 index 000000000000..e6bee2b3f6c6 --- /dev/null +++ b/sys-boot/milo/milo-2.4.18.ebuild @@ -0,0 +1,234 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic eutils + +# Currently tested Systems: +# +# Ruffian: UX164, BX164 +# + +DESCRIPTION="The Alpha MIniLOader, for Alpha Machines without SRM" +HOMEPAGE="http://milo.core-systems.de/" + +# ive tested this, and it seems to make little difference +# which kernel version you use, so it makes sense to use the +# latest available 2.2 kernel with the latest bugfixes/drivers/etc. + +kernel_version="2.2.25" +milo_version="2.2-18" +ldmilo_patch="20010430" + +# milo-2.2-18.tar.bz2 :- latest milo sources +# linux-2.2.25.tar.bz2 :- latest linux 2.2 kernel sources +# ldmilo-patched-20010430 :- Ruffian ldmilo utility, with bugfixes by Jay Eastabrook +# linload.exe :- linload utility (ldmilo equivalent for non-ruffians). + +SRC_URI="http://www.suse.de/~stepan/source/milo-${milo_version}.tar.bz2 + https://www.kernel.org/pub/linux/kernel/v2.2/linux-${kernel_version}.tar.bz2 + https://dev.gentoo.org/~taviso/milo/ldmilo-patched-${ldmilo_patch} + http://ftp.namesys.com/pub/reiserfs-for-2.2/linux-2.2.20-reiserfs-3.5.35.diff.bz2 + https://dev.gentoo.org/~taviso/milo/linload.exe + http://www.ibiblio.org/pub/Linux/docs/HOWTO/MILO-HOWTO" + +# +# milo license is dec palcode license, dec bios emulation license, and gpl-2 rolled +# into one big ugly package. +# +# the dec licenses say you can basically do anything you like, including modify +# and redistribute for profit or non-profit, as long as its for use with Alpha +# architecture. +# + +LICENSE="MILO" +SLOT="0" + +KEYWORDS="-* ~alpha" +IUSE="" + +DEPEND="sys-apps/kbd + >=sys-apps/sed-4" +RDEPEND="sys-fs/mtools" + +S=${WORKDIR}/milo-${milo_version} + +# You can change the default MILO serial +# number here, the MILO default is "Linux_is_Great!". +# There are some below that i have made you can +# use if you want, just uncomment the one you like. +# +# if you want to see how this works, to make your own +# look at mkserial_no.c in the filesdir. +# +##### Linux_is_Great! ################### +#milo_serial_number0=0x73695f78756e694c +#milo_serial_number1=0x002174616572475f +# +##### Gentoo Linux. ##################### +milo_serial_number0=0x4c206f6f746e6547 +milo_serial_number1=0x0000002e78756e69 +# +##### Gentoo/Alpha. ##################### +#milo_serial_number0=0x412f6f6f746e6547 +#milo_serial_number1=0x0000002e6168706c +# +##### Gentoo MILO. ###################### +#milo_serial_number0=0x4d206f6f746e6547 +#milo_serial_number1=0x000000002e4f4c49 +# +##### |d|i|g|i|t|a|l| ################### +#milo_serial_number0=0x697c677c697c647c +#milo_serial_number1=0x007c6c7c617c747c; +# + +src_unpack() { + # unpack everything the kernel and milo sources + unpack linux-${kernel_version}.tar.bz2 + unpack milo-${milo_version}.tar.bz2 + unpack linux-2.2.20-reiserfs-3.5.35.diff.bz2 +} + +src_prepare() { + # gcc3 fixes, and some tweaks to get a build, also + # reiserfs support for the kernel (and milo). + cd ${WORKDIR}/linux; eapply "${FILESDIR}"/linux-${kernel_version}-gcc3-milo.diff || die + cd ${WORKDIR}/linux; eapply "${WORKDIR}"/linux-2.2.20-reiserfs-3.5.35.diff || die + cd ${S}; eapply "${FILESDIR}"/milo-${milo_version}-gcc3-gentoo.diff || die + eapply_user +} + +src_compile() { + unset MILO_ARCH + for arches in "Alpha-XLT XLT" \ + "Alpha-XL XL" \ + "AlphaBook1 BOOK1" \ + "Avanti AVANTI" \ + "Cabriolet CABRIOLET" \ + "EB66 EB66" \ + "EB66+ EB66P" \ + "EB64+ EB64P" \ + "EB164 EB164" \ + "PC164 PC164" \ + "LX164 LX164" \ + "SX164 SX164" \ + "Noname NONAME" \ + "Takara TAKARA" \ + "Mikasa MIKASA" \ + "Alcor ALCOR" \ + "Miata MIATA" \ + "Ruffian RUFFIAN" \ + "Platform2000 P2K" \ + "UDB UDB" + do + if [ -z "${MILO_IMAGE}" ]; then + MILO_ARCH="${MILO_ARCH} \"${arches}\"" + else + if echo ${arches} | grep -i ${MILO_IMAGE}; then + MILO_ARCH="\"${arches}\"" + fi + fi + done + + if [ -z "${MILO_ARCH}" ]; then + eerror "Sorry, but ${MILO_IMAGE} doesnt look valid to me" + eerror "Consult the Alpha installation guide, or the ebuild" + eerror "for a list of available Alphas." + die "${MILO_IMAGE} not supported, or not recognised." + fi + + sed -i "s!__MILO_ARCHES__!${MILO_ARCH}!g" ${S}/tools/scripts/build + + ewarn + ewarn "seriously, this is going to take a while, go get some coffee..." + ewarn + einfo "this ebuild will build the standard MILO images, similar to those" + einfo "distributed with some distributions, and the images provided with" + einfo "the official MILO sources." + einfo + einfo "of course, the beauty of MILO is it can support any device supported" + einfo "by the linux kernel, so if you need support for non-standard hardware" + einfo "set the path to the .config you want in \$custom_milo_kernel_config and" + einfo "i will use it instead of the default." + ewarn + + # get kernel configured + cp ${custom_milo_kernel_config:-${S}/Documentation/config/linux-2.2.19-SuSE.config} \ + ${WORKDIR}/linux/.config + cd ${WORKDIR}/linux; yes n | make oldconfig || die "unable to configure kernel." + + # we're building a generic kernel that defaults to ev5, but theres no + # reason why we cant tweak the instruction set. + # im not sure if you can actually pull a system performance gain/faster + # boot from optimising milo, but at least you'll get a faster milo pager ;) + mcpu_flag="`get-flag mcpu`" + if [ ! -z "${mcpu_flag}" ]; then + sed -i "s/\(CFLAGS := \$(CFLAGS) \)-mcpu=ev5$/\1-mcpu=${mcpu_flag:-ev5}/g" \ + ${WORKDIR}/linux/arch/alpha/Makefile + fi + + # build the generic linux kernel, of course if you have + # hardware not supported by this generic kernel, you are free + # to hack it (or the .config used here). + einfo "building a generic kernel for use with milo..." + unset CC DISTCC_HOSTS; make dep vmlinux || die "unable to build generic kernel for milo." + cat ${FILESDIR}/objstrip.c > ${WORKDIR}/linux/arch/alpha/boot/tools/objstrip.c + + # make the objstrip utility. + gcc ${WORKDIR}/linux/arch/alpha/boot/tools/objstrip.c -o \ + ${WORKDIR}/linux/arch/alpha/boot/tools/objstrip || die "couldnt build objstrip." + einfo "kernel build complete." + einfo "building milo images..." + + # we have a choice here, milo can set the serial number to just about + # anything we like, the milo author has chosen "Linux_is_Great!", which + # is a bit cheesy, but we will leave it as default if user hasnt chosen + # something else. + # see above for options. + + append-flags -DMILO_SERIAL_NUMBER0="${milo_serial_number0:-0x73695f78756e694c}" + append-flags -DMILO_SERIAL_NUMBER1="${milo_serial_number1:-0x002174616572475f}" + + # the Makefile missed this :-/ + cd ${S}/tools/common; make || die "couldnt make commonlib." + + # build all the milo images. + cd ${S}; tools/scripts/build || die "failed to build milo images." + + # put the ldmilo utility there. + cp ${DISTDIR}/ldmilo-patched-${ldmilo_patch} ${S}/binaries/ldmilo.exe + cp ${DISTDIR}/linload.exe ${S}/binaries/linload.exe + +} + +src_install() { + + cd ${S}; dodir /opt/milo + insinto /opt/milo + + einfo "Installing MILO images..." + for i in binaries/* + do + einfo " ${i}" + doins ${i} + done + + cd ${S}/Documentation + + dodoc ChangeLog filesystem Nikita.Todo README.milo Todo README.BSD Stuff WhatIsMilo \ + ${FILESDIR}/README-gentoo ${FILESDIR}/mkserial_no.c ${DISTDIR}/MILO-HOWTO + +} + +pkg_postinst() { + einfo "The MILO images have been installed into /opt/milo." + einfo "There are instructions in /usr/share/doc/${P} for making MILO boot floppies." + einfo "Alternative methods, (flash, srm, debug monitor, etc) are described in the MILO-HOWTO." + einfo + einfo "The important docs to read are the README-gentoo and the MILO-HOWTO." + einfo + ewarn "PLEASE, PLEASE, PLEASE, let me know if this works or not, i need to know which systems" + ewarn "need tweaking, and which ones are good to go. You can email me at taviso@gentoo.org" + einfo +} diff --git a/sys-boot/mokutil/Manifest b/sys-boot/mokutil/Manifest new file mode 100644 index 000000000000..b9f69c820d32 --- /dev/null +++ b/sys-boot/mokutil/Manifest @@ -0,0 +1 @@ +DIST mokutil-0.3.0_p20170404.tar.gz 32590 BLAKE2B 867574b05a7a7c842869f75bd3b6a0cd0af083862ffc912b25b12fe6283946968ac6872b25a727d37185fb821871d5a2f958afddbb7e2bfefde854c6f434ab8f SHA512 ee64627089efe341bff466249a126dcdcc4a53878b17f651b17423650c3aea76d52dcae01ed689ba5bd317125dd9a669816563aa676d46d8ac36863f38f9ea16 diff --git a/sys-boot/mokutil/metadata.xml b/sys-boot/mokutil/metadata.xml new file mode 100644 index 000000000000..b33476f0db7f --- /dev/null +++ b/sys-boot/mokutil/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>zerochaos@gentoo.org</email> + <name>Rick Farina</name> + </maintainer> + <upstream> + <remote-id type="github">rapid7/metasploit-framework</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/mokutil/mokutil-0.3.0_p20170404.ebuild b/sys-boot/mokutil/mokutil-0.3.0_p20170404.ebuild new file mode 100644 index 000000000000..d50f17eba469 --- /dev/null +++ b/sys-boot/mokutil/mokutil-0.3.0_p20170404.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit autotools + +DESCRIPTION="The utility to manipulate machines owner keys which managed in shim" +HOMEPAGE="https://github.com/lcp/mokutil" +GIT_HASH="e19adc575c1f9d8f08b7fbc594a0887ace63f83f" +SRC_URI="https://github.com/lcp/mokutil/archive/${GIT_HASH}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND="dev-libs/openssl:= + sys-libs/efivar:=" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${PN}-${GIT_HASH}" + +src_prepare() { + default + eautoreconf +} diff --git a/sys-boot/netboot/Manifest b/sys-boot/netboot/Manifest new file mode 100644 index 000000000000..7ba28c1e5c8b --- /dev/null +++ b/sys-boot/netboot/Manifest @@ -0,0 +1 @@ +DIST netboot-0.10.2.tar.gz 1457791 BLAKE2B bd7fbaa1c87990ebac3dfb22f947146b19c199ceb579d32ded9a58bed6bcae34b02a1bf9cf5c079ba389ba24ca6f89fb6b4faf0b3ed028f9fe56b8dc083d8507 SHA512 422e78833c36e9975a77226523e14ebf8b5af5c02e98628ee030459ebf9f26d020551265899e84ea27bf6ab43c4d9bf8edc6722f942f49103bac897c7cc4fa3e diff --git a/sys-boot/netboot/files/netboot-0.10.2-ldflags.patch b/sys-boot/netboot/files/netboot-0.10.2-ldflags.patch new file mode 100644 index 000000000000..2cb245076d90 --- /dev/null +++ b/sys-boot/netboot/files/netboot-0.10.2-ldflags.patch @@ -0,0 +1,38 @@ +--- netboot-0.10.2/make.config.in.org 2007-02-01 13:09:18.000000000 +0100 ++++ netboot-0.10.2/make.config.in 2010-02-09 00:34:15.000000000 +0100 +@@ -105,7 +105,7 @@ + INCLUDE = $(patsubst %,-I%,$(subst :, ,$(VPATH))) + CDEFS = @DEFS@ -DNETBOOT + CFLAGS = @CFLAGS@ $(CDEBUG) $(CDEFS) $(INCLUDE) +-LDFLAGS = -s ++LDFLAGS = @LDFLAGS@ + SYSLIBS = @LIBS@ + BDBLIB = @BDBLIB@ + ODBCLIB = @ODBCLIB@ +--- netboot-0.10.2/misc/Makefile.org 2007-02-01 19:42:10.000000000 +0100 ++++ netboot-0.10.2/misc/Makefile 2010-02-09 00:39:21.000000000 +0100 +@@ -76,7 +76,7 @@ + + gccrules: $(LIBTOOL) gccrules.o $(LIBNBA) + @$(LIBTOOL) --mode=link \ +- $(CC) $(CFLAGS) -o gccrules gccrules.o $(LIBS) \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -o gccrules gccrules.o $(LIBS) \ + -no-install + + +@@ -89,13 +89,13 @@ + + gccopt: $(LIBTOOL) gccopt.o $(LIBNBA) + @$(LIBTOOL) --mode=link \ +- $(CC) $(CFLAGS) -o gccopt gccopt.o $(LIBS) \ ++ $(CC) $(CFLAGS) $(LDFLAGS) -o gccopt gccopt.o $(LIBS) \ + -no-install + + + nbmd5: $(LIBTOOL) nbmd5.o $(LIBNBA) + @$(LIBTOOL) --mode=link \ +- $(CC) $(CFLAGS) -o nbmd5 nbmd5.o $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o nbmd5 nbmd5.o $(LIBS) + + + instdrv: instdrv.in diff --git a/sys-boot/netboot/metadata.xml b/sys-boot/netboot/metadata.xml new file mode 100644 index 000000000000..b9725fb53497 --- /dev/null +++ b/sys-boot/netboot/metadata.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>conikost@gentoo.org</email> + <name>Conrad Kostecki</name> + </maintainer> + <longdescription> + Netboot enables a computer with a compatible CPU to boot without access to a hdd or floppy. + The computer has to be equipped so it can load the operating system over an IP network from a server. + All tools required for this are included in the netboot package. + </longdescription> + <upstream> + <bugs-to>https://sourceforge.net/p/netboot/bugs/</bugs-to> + <remote-id type="sourceforge">netboot</remote-id> + </upstream> + <use> + <flag name="bootrom">Install the bootrom binary for creation of rom files, which can be used for booting via floppy or rom.</flag> + </use> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/netboot/netboot-0.10.2-r1.ebuild b/sys-boot/netboot/netboot-0.10.2-r1.ebuild new file mode 100644 index 000000000000..64a626b55466 --- /dev/null +++ b/sys-boot/netboot/netboot-0.10.2-r1.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +DESCRIPTION="Allows to remote boot a computer over an IP network" +HOMEPAGE="http://netboot.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="berkdb +bootrom +lzo odbc static-libs" + +DEPEND=" + berkdb? ( sys-libs/db:= ) + lzo? ( dev-libs/lzo:2= ) + odbc? ( dev-db/unixODBC:= ) +" + +RDEPEND="${DEPEND}" + +src_prepare() { + default + + # Respect users LDFLAGS + eapply "${FILESDIR}"/"${P}"-ldflags.patch + + # Don't install support binaries into libdir + sed -e "152s:nblibdir:bindir:" -e "153s:nblibdir:bindir:" -i misc/Makefile || die + + # Don't install perl script into libdir + sed -e 's/nblibdir/nbmiscdir/g' -i mknbi-dos/utils/Makefile || die + + # Don't install vim syntax file, as it will be installed manually + sed -e '/mgl.vim/d' -i mknbi-mgl/Makefile || die +} + +src_configure() { + local myeconfargs=( + --datadir="/usr/share/netboot" + $(use_with berkdb berkeley-db) + $(use_enable bootrom) + $(use_with lzo) + $(use_with odbc) + $(use_enable static-libs static) + --with-gnu-as86="$(tc-getAS)" + --with-gnu-cc86="$(tc-getCC)" + --with-gnu-ld86="$(tc-getLD)" + ) + + econf "${myeconfargs[@]}" +} + +src_compile() { + # mknbi fails with parallel build + emake -j1 +} + +src_install() { + emake DESTDIR="${ED}" install + + insinto /usr/share/vim/vimfiles/syntax + doins "${S}"/mknbi-mgl/misc/mgl.vim + + dodoc README doc/{HISTORY,PROBLEMS,README.*,Spec.doc} + + docinto flashcard + dodoc FlashCard/README FlashCard/*.ps + + find "${D}" -name '*.la' -type f -delete || die +} diff --git a/sys-boot/nettrom/Manifest b/sys-boot/nettrom/Manifest new file mode 100644 index 000000000000..7b18284583d7 --- /dev/null +++ b/sys-boot/nettrom/Manifest @@ -0,0 +1 @@ +DIST nettrom-2.3.3.tar.gz 801683 BLAKE2B 86c28e901b6cec2a708f4d52f304b4996e3f98d9faeef511f65965e3881a08f56dc7c39a6bb8056e09c08e377f8d318949fa8324b1ea75a464eb71f4ef4169c9 SHA512 7b8b85d7a0cda8c5860663e19ce75223d667eeb1997b28eaa2ce67d3c14e609cf98706d54f86b0e91e3dac0570d0ffee7f1737f21bac774a1150e58d783bc925 diff --git a/sys-boot/nettrom/metadata.xml b/sys-boot/nettrom/metadata.xml new file mode 100644 index 000000000000..b471e0d835ee --- /dev/null +++ b/sys-boot/nettrom/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>embedded@gentoo.org</email> + <name>Embedded Gentoo</name> +</maintainer> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/nettrom/nettrom-2.3.3.ebuild b/sys-boot/nettrom/nettrom-2.3.3.ebuild new file mode 100644 index 000000000000..a0311ddca387 --- /dev/null +++ b/sys-boot/nettrom/nettrom-2.3.3.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="NetWinder ARM bootloader and utilities" +HOMEPAGE="http://www.netwinder.org/" +SRC_URI="http://wh0rd.org/gentoo/${P}.tar.gz" + +LICENSE="all-rights-reserved" +SLOT="0" +KEYWORDS="-* arm" +RESTRICT="mirror bindist" + +S=${WORKDIR} + +QA_PREBUILT=" + /sbin/flashwrite + /usr/sbin/logowrite + /usr/sbin/logoread" +QA_PRESTRIPPED="${QA_PREBUILT}" + +src_install() { + doman usr/man/man8/flashwrite.8 + rm -r usr/man || die + + insinto / + doins -r . +} diff --git a/sys-boot/os-prober/Manifest b/sys-boot/os-prober/Manifest new file mode 100644 index 000000000000..7773f73ff5db --- /dev/null +++ b/sys-boot/os-prober/Manifest @@ -0,0 +1 @@ +DIST os-prober_1.77.tar.xz 26660 BLAKE2B cff8d96927cf251e9d8ee95561289e9c49a89fbcf9045e7c7169f73b1eeb151797db7b075ebc14dbbdd96996d007b07001e2843cf835defd675f63595614297b SHA512 4d9c22ccc4d950644a06a17ec4424aca5ff82aeb20052dc389dd451b6b9a1799c5a9438644a29093153730af42066abbbbb78f593f2564314c9adbd43f60e39b diff --git a/sys-boot/os-prober/files/os-prober-1.76-exherbo.patch b/sys-boot/os-prober/files/os-prober-1.76-exherbo.patch new file mode 100644 index 000000000000..6ef83dca223f --- /dev/null +++ b/sys-boot/os-prober/files/os-prober-1.76-exherbo.patch @@ -0,0 +1,26 @@ +From 09fefdb360b69c2de03a2f1c881db87f924d3c76 Mon Sep 17 00:00:00 2001 +From: Timo Gurr <timo.gurr@gmail.com> +Date: Mon, 20 Feb 2017 17:33:14 +0100 +Subject: [PATCH] Add Exherbo Linux detection + +--- + os-probes/mounted/common/90linux-distro | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/os-probes/mounted/common/90linux-distro b/os-probes/mounted/common/90linux-distro +index badfbb1..41a5553 100755 +--- a/os-probes/mounted/common/90linux-distro ++++ b/os-probes/mounted/common/90linux-distro +@@ -137,6 +137,9 @@ if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*) + elif [ -e "$dir/etc/devuan_version" ]; then + short="Devuan" + long="$(printf "Devuan GNU/Linux (%s)\n" "$(cat "$dir/etc/devuan_version")")" ++ elif [ -e "$dir/etc/exherbo-release" ]; then ++ short="Exherbo" ++ long="Exherbo Linux" + else + short="Linux" + long="unknown Linux distribution" +-- +2.11.1 + diff --git a/sys-boot/os-prober/metadata.xml b/sys-boot/os-prober/metadata.xml new file mode 100644 index 000000000000..d85b4252fc33 --- /dev/null +++ b/sys-boot/os-prober/metadata.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<!-- maintainer-needed --> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/os-prober/os-prober-1.77.ebuild b/sys-boot/os-prober/os-prober-1.77.ebuild new file mode 100644 index 000000000000..7c4cb9daf1b6 --- /dev/null +++ b/sys-boot/os-prober/os-prober-1.77.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit readme.gentoo-r1 toolchain-funcs + +DESCRIPTION="Utility to detect other OSs on a set of drives" +HOMEPAGE="https://packages.debian.org/source/sid/os-prober" +SRC_URI="mirror://debian/pool/main/${PN::1}/${PN}/${PN}_${PV}.tar.xz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="" + +# grub-mount needed per bug #607518 +RDEPEND="sys-boot/grub:2[mount]" +DEPEND="" + +# bug 594250 +QA_MULTILIB_PATHS="usr/lib/os-prober/.*" + +PATCHES=( "${FILESDIR}"/${PN}-1.76-exherbo.patch ) + +DOC_CONTENTS=" + If you intend for os-prober to detect versions of Windows installed on + NTFS-formatted partitions, your system must be capable of reading the + NTFS filesystem. One way to do this is by installing sys-fs/ntfs3g +" + +src_prepare() { + default + # use default GNU rules + rm Makefile || die 'rm Makefile failed' +} + +src_compile() { + tc-export CC + emake newns +} + +src_install() { + dobin os-prober linux-boot-prober + + # Note: as no shared libraries are installed, /usr/lib is correct + exeinto /usr/lib/os-prober + doexe newns + + insinto /usr/share/os-prober + doins common.sh + + keepdir /var/lib/os-prober + + local debarch=${ARCH%-*} dir + + case ${debarch} in + amd64) debarch=x86 ;; + ppc|ppc64) debarch=powerpc ;; + esac + + for dir in os-probes{,/mounted,/init} linux-boot-probes{,/mounted}; do + exeinto /usr/lib/${dir} + doexe ${dir}/common/* + if [[ -d ${dir}/${debarch} ]]; then + doexe ${dir}/${debarch}/* + fi + if [[ -d ${dir}/${debarch}/efi ]]; then + exeinto /usr/lib/${dir}/efi + doexe ${dir}/${debarch}/efi/* + fi + done + + if use amd64 || use x86; then + exeinto /usr/lib/os-probes/mounted + doexe os-probes/mounted/powerpc/20macosx + fi + + einstalldocs + dodoc debian/changelog + + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog +} diff --git a/sys-boot/palo/Manifest b/sys-boot/palo/Manifest new file mode 100644 index 000000000000..d3c403304eee --- /dev/null +++ b/sys-boot/palo/Manifest @@ -0,0 +1,3 @@ +DIST palo-2.12.tar.gz 124911 BLAKE2B 79fa572e118e77114dcb3b888abc65163bd56cb44cf69cd25bcaa33a7c6151b8254bf00c459ad17ca1d948f9b440378133f048e2add123a757908c108b802703 SHA512 6ea20490b84bf18a1d1e8037de453f5f480cba8403b267d4d63fceceffb39e18545c6d20c8dd7b07044ff5567eedd2c58b2a626971b53d1d35c5b3a4e8fefbf0 +DIST palo-2.13.tar.gz 125108 BLAKE2B 9c73e66be7950ae6e7fd0a5dcb9cf460dfcb469580a25c121eb7ffc41aaf4a0b67d7f77ddf7a12479718c6ffc64a3a9327ab8c92cc73e79cffad07d61c6fd120 SHA512 6ecde0720fcf672cd7baf71bb04e16f2a1412d958ec35c4e2c9a7a3b372dab1a12ce6e47198ac8500aca750cbbb7190c3476ea626007c3418eb6c23f06011d37 +DIST palo-2.14.tar.gz 125207 BLAKE2B fcbc7e59552d83828c07acb055429c1155b738dd12e22c9fc81759b9f84382e3ea793e957421d420c93fa5818d5ad8f12b5317cfe6d5d45d95fc15b272c6fe8c SHA512 9d22ea2826a69a9bb661a4c17aaa78d648f0684b96c2dc0f164d2086f48fc85207e40c69227dd76d153dd171574dd62f6e5e90dd415209de372b4d7d8ab40f57 diff --git a/sys-boot/palo/files/99palo b/sys-boot/palo/files/99palo new file mode 100644 index 000000000000..8caea49f51ad --- /dev/null +++ b/sys-boot/palo/files/99palo @@ -0,0 +1,3 @@ +#!/bin/sh + +palo -v diff --git a/sys-boot/palo/files/palo-2.00-toolchain.patch b/sys-boot/palo/files/palo-2.00-toolchain.patch new file mode 100644 index 000000000000..168031714bc9 --- /dev/null +++ b/sys-boot/palo/files/palo-2.00-toolchain.patch @@ -0,0 +1,22 @@ +--- a/palo/Makefile ++++ b/palo/Makefile +@@ -10,9 +10,9 @@ + OS := $(shell uname -s) + CC?=cc + ifeq ($(strip ${OS}),HP-UX) +-CFLAGS=-g -O -I../include -I../lib -I$(PA)/include ++CFLAGS=-O -I../include -I../lib -I$(PA)/include + else +-CFLAGS=-g -O -I../include -I../lib -D_FILE_OFFSET_BITS=64 ++CFLAGS=-O -I../include -I../lib -D_FILE_OFFSET_BITS=64 + endif + + ifneq ("$(wildcard /etc/debian_version)","") +@@ -22,7 +22,6 @@ + endif + + # LDFLAGS=-Wl,-Bstatic +-LDFLAGS= + + OFILES2=mkbootable.o elf64.o load.o paloio.o elf32.o error.o gzip.o + diff --git a/sys-boot/palo/files/palo-2.12-gcc10.patch b/sys-boot/palo/files/palo-2.12-gcc10.patch new file mode 100644 index 000000000000..7832fbeac942 --- /dev/null +++ b/sys-boot/palo/files/palo-2.12-gcc10.patch @@ -0,0 +1,11 @@ +--- a/ipl/Makefile ++++ b/ipl/Makefile +@@ -39,7 +39,7 @@ endif + VPATH=../lib:. + + AFLAGS = -I../lib +-CFLAGS = -DIPL_LOADER -I. -I../lib -I../include -O2 -mdisable-fpregs -Wall -fno-delete-null-pointer-checks ++CFLAGS = -DIPL_LOADER -I. -I../lib -I../include -O2 -mdisable-fpregs -Wall -fno-delete-null-pointer-checks -fno-builtin + LDFLAGS = -N --section-start .init=0x60000 -e '$$START$$' + + all: iplelf diff --git a/sys-boot/palo/files/palo.conf b/sys-boot/palo/files/palo.conf new file mode 100644 index 000000000000..8880b50b5f1f --- /dev/null +++ b/sys-boot/palo/files/palo.conf @@ -0,0 +1,8 @@ +# Please read the palo --help output for more info +# Non-commented lines are treated as command line arguments + +--commandline=2/vmlinux root=/dev/sda4 +--init-partitioned=/dev/sda + +#Uncomment this if you want a rescue kernel +#--recoverykernel=/boot/vmlinux.old diff --git a/sys-boot/palo/metadata.xml b/sys-boot/palo/metadata.xml new file mode 100644 index 000000000000..80c60e9ab4f7 --- /dev/null +++ b/sys-boot/palo/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> +<email>hppa@gentoo.org</email> +<name>Gentoo Linux HPPA Development</name> +</maintainer> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/palo/palo-2.12-r1.ebuild b/sys-boot/palo/palo-2.12-r1.ebuild new file mode 100644 index 000000000000..8e24e8531b2e --- /dev/null +++ b/sys-boot/palo/palo-2.12-r1.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit toolchain-funcs + +DESCRIPTION="PALO : PArisc Linux Loader" +HOMEPAGE="http://parisc-linux.org/ https://parisc.wiki.kernel.org/" +SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/deller/${PN}.git/snapshot/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* hppa" + +PATCHES=( + "${FILESDIR}"/${PN}-2.00-toolchain.patch + "${FILESDIR}"/${PN}-2.12-gcc10.patch +) + +src_compile() { + local target + for target in '-C palo' '-C ipl' 'iplboot'; do + emake AR=$(tc-getAR) CC=$(tc-getCC) LD=$(tc-getLD) ${target} + done +} + +src_install() { + into / + dosbin palo/palo + + insinto /usr/share/palo + doins iplboot + + insinto /etc + doins "${FILESDIR}"/palo.conf + + insinto /etc/kernel/postinst.d + insopts -m 0744 + doins "${FILESDIR}"/99palo + + doman palo.8 + + dodoc TODO debian/changelog README.html +} diff --git a/sys-boot/palo/palo-2.13.ebuild b/sys-boot/palo/palo-2.13.ebuild new file mode 100644 index 000000000000..17741656154b --- /dev/null +++ b/sys-boot/palo/palo-2.13.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit toolchain-funcs + +DESCRIPTION="PALO : PArisc Linux Loader" +HOMEPAGE="http://parisc-linux.org/ https://parisc.wiki.kernel.org/" +SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/deller/${PN}.git/snapshot/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~hppa" + +PATCHES=( + "${FILESDIR}"/${PN}-2.00-toolchain.patch +) + +src_compile() { + local target + for target in '-C palo' '-C ipl' 'iplboot'; do + emake AR=$(tc-getAR) CC=$(tc-getCC) LD=$(tc-getLD) ${target} + done +} + +src_install() { + into / + dosbin palo/palo + + insinto /usr/share/palo + doins iplboot + + insinto /etc + doins "${FILESDIR}"/palo.conf + + insinto /etc/kernel/postinst.d + insopts -m 0744 + doins "${FILESDIR}"/99palo + + doman palo.8 + + dodoc TODO debian/changelog README.html +} diff --git a/sys-boot/palo/palo-2.14.ebuild b/sys-boot/palo/palo-2.14.ebuild new file mode 100644 index 000000000000..17741656154b --- /dev/null +++ b/sys-boot/palo/palo-2.14.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit toolchain-funcs + +DESCRIPTION="PALO : PArisc Linux Loader" +HOMEPAGE="http://parisc-linux.org/ https://parisc.wiki.kernel.org/" +SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/deller/${PN}.git/snapshot/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~hppa" + +PATCHES=( + "${FILESDIR}"/${PN}-2.00-toolchain.patch +) + +src_compile() { + local target + for target in '-C palo' '-C ipl' 'iplboot'; do + emake AR=$(tc-getAR) CC=$(tc-getCC) LD=$(tc-getLD) ${target} + done +} + +src_install() { + into / + dosbin palo/palo + + insinto /usr/share/palo + doins iplboot + + insinto /etc + doins "${FILESDIR}"/palo.conf + + insinto /etc/kernel/postinst.d + insopts -m 0744 + doins "${FILESDIR}"/99palo + + doman palo.8 + + dodoc TODO debian/changelog README.html +} diff --git a/sys-boot/palo/palo-9999.ebuild b/sys-boot/palo/palo-9999.ebuild new file mode 100644 index 000000000000..1c733273f096 --- /dev/null +++ b/sys-boot/palo/palo-9999.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit git-r3 toolchain-funcs + +DESCRIPTION="PALO : PArisc Linux Loader" +HOMEPAGE="http://parisc-linux.org/ https://parisc.wiki.kernel.org/" +EGIT_REPO_URI="https://git.kernel.org/pub/scm/linux/kernel/git/deller/palo.git" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="" + +PATCHES=( + "${FILESDIR}"/${PN}-2.00-toolchain.patch +) + +src_compile() { + local target + for target in '-C palo' '-C ipl' 'iplboot'; do + emake AR=$(tc-getAR) CC=$(tc-getCC) LD=$(tc-getLD) ${target} + done +} + +src_install() { + into / + dosbin palo/palo + + insinto /usr/share/palo + doins iplboot + + insinto /etc + doins "${FILESDIR}"/palo.conf + + insinto /etc/kernel/postinst.d + insopts -m 0744 + doins "${FILESDIR}"/99palo + + doman palo.8 + + dodoc TODO debian/changelog README.html +} diff --git a/sys-boot/plymouth-calculate-plugin/Manifest b/sys-boot/plymouth-calculate-plugin/Manifest new file mode 100644 index 000000000000..8c959d026235 --- /dev/null +++ b/sys-boot/plymouth-calculate-plugin/Manifest @@ -0,0 +1 @@ +DIST plymouth-0.9.4.tar.xz 1103496 BLAKE2B abad2cefb89e9d17b77113396d7203090544759b3dd7f73f67153d9f126db28e5366d36aa11e2335566bf4046bebd50d8d9dd47c75634446fb3a0314cd458925 SHA512 83eb2de7e6d0980e9f7fa4e0b0f20c46a8238051d84bc38dbbb5dfa438e41c1a39846dcd652374256d9f1fe79967b154a3576cd9c433ef816b6c962be2d31e93 diff --git a/sys-boot/plymouth-calculate-plugin/files/0.9.3-glibc-sysmacros.patch b/sys-boot/plymouth-calculate-plugin/files/0.9.3-glibc-sysmacros.patch new file mode 100644 index 000000000000..8969161bb195 --- /dev/null +++ b/sys-boot/plymouth-calculate-plugin/files/0.9.3-glibc-sysmacros.patch @@ -0,0 +1,45 @@ +From f8d7813b32dfe129d1e5718719ee3eff131f4fac Mon Sep 17 00:00:00 2001 +From: Kjell Claesson <kjell.claesson@epost.tidanet.se> +Date: Fri, 18 Aug 2017 00:25:56 +0200 +Subject: [PATCH] Fix build with newer glibc + +Signed-off-by: Gilles Dartiguelongue <eva@gentoo.org> +--- + configure.ac | 1 + + src/libply-splash-core/ply-terminal.c | 8 ++++++++ + 2 files changed, 9 insertions(+) + +diff --git a/configure.ac b/configure.ac +index c32697f..8376789 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5,6 +5,7 @@ AC_CONFIG_AUX_DIR(build-tools) + + AC_USE_SYSTEM_EXTENSIONS + AC_SYS_LARGEFILE ++AC_HEADER_MAJOR + AC_PROG_AWK + AC_PROG_CC_STDC + AM_PROG_CC_C_O +diff --git a/src/libply-splash-core/ply-terminal.c b/src/libply-splash-core/ply-terminal.c +index a0954f2..ef62bf8 100644 +--- a/src/libply-splash-core/ply-terminal.c ++++ b/src/libply-splash-core/ply-terminal.c +@@ -36,6 +36,14 @@ + #include <unistd.h> + #include <wchar.h> + ++/* major()/minor() */ ++#ifdef MAJOR_IN_MKDEV ++# include <sys/mkdev.h> ++#endif ++#ifdef MAJOR_IN_SYSMACROS ++# include <sys/sysmacros.h> ++#endif ++ + #include <linux/kd.h> + #include <linux/major.h> + #include <linux/vt.h> +-- +2.14.1 + diff --git a/sys-boot/plymouth-calculate-plugin/files/calculate.plymouth b/sys-boot/plymouth-calculate-plugin/files/calculate.plymouth new file mode 100644 index 000000000000..e9a940639d8d --- /dev/null +++ b/sys-boot/plymouth-calculate-plugin/files/calculate.plymouth @@ -0,0 +1,14 @@ +[Plymouth Theme] +Name=Calculate +Description=Simple theme that shows progressbar, image and text +ModuleName=calculate + +[calculate] +ImageDir=/usr/share/plymouth/themes/calculate +BackgroundStartColor=0x000000 +BackgroundEndColor=0x000000 +BootImage=/usr/share/plymouth/themes/calculate/boot +ShutdownImage=/usr/share/plymouth/themes/calculate/shutdown +ShutdownText=Shutdown... +ShutdownFont=DroidSand 30 +ShutdownTextColor=0xaaaaaa diff --git a/sys-boot/plymouth-calculate-plugin/files/plugin.c b/sys-boot/plymouth-calculate-plugin/files/plugin.c new file mode 100644 index 000000000000..9caf9fc5c246 --- /dev/null +++ b/sys-boot/plymouth-calculate-plugin/files/plugin.c @@ -0,0 +1,1267 @@ +/* calculate.c - boot splash plugin + * + * Copyright (C) 2007, 2008 Red Hat, Inc. + * Copyright (C) 2019, Mir Calculate Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Written by: Ray Strode <rstrode@redhat.com> + * Will Woods <wwoods@redhat.com> + * Modified by: Mir Calculate <support@calculate.ru> + */ +#include "config.h" + +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <math.h> +#include <signal.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <sys/ioctl.h> +#include <sys/stat.h> +#include <sys/time.h> +#include <sys/types.h> +#include <values.h> +#include <unistd.h> +#include <wchar.h> + +#include "ply-boot-splash-plugin.h" +#include "ply-buffer.h" +#include "ply-entry.h" +#include "ply-event-loop.h" +#include "ply-key-file.h" +#include "ply-label.h" +#include "ply-list.h" +#include "ply-logger.h" +#include "ply-image.h" +#include "ply-trigger.h" +#include "ply-pixel-buffer.h" +#include "ply-pixel-display.h" +#include "ply-utils.h" + +#include "ply-throbber.h" +#include "ply-array.h" +#include <dirent.h> + +struct _ply_progress_bar +{ + ply_pixel_display_t *display; + ply_rectangle_t area; + + double percent_done; + + uint32_t is_hidden : 1; +}; + +#include "ply-progress-bar.h" + + +void +ply_progress_bar_draw_area_color (ply_progress_bar_t *progress_bar, + ply_pixel_buffer_t *buffer, + long x, + long y, + unsigned long width, + unsigned long height, + uint32_t progressbar_color) +{ + ply_rectangle_t paint_area; + + if (progress_bar->is_hidden) + return; + + paint_area.x = x; + paint_area.y = y; + paint_area.width = width; + paint_area.height = height; + + ply_rectangle_intersect (&progress_bar->area, &paint_area, &paint_area); + ply_pixel_buffer_fill_with_hex_color (buffer, + &paint_area, + progressbar_color); +} + +struct _ply_throbber +{ + ply_array_t *frames; + ply_event_loop_t *loop; + char *image_dir; + char *frames_prefix; + + ply_pixel_display_t *display; + ply_rectangle_t frame_area; + ply_trigger_t *stop_trigger; + + long x, y; + long width, height; + double start_time, now; + + int frame_number; + uint32_t is_stopped : 1; +}; + +#ifndef FRAMES_PER_SECOND +#define FRAMES_PER_SECOND 30 +#endif + +#define BAR_HEIGHT 3 + +typedef enum +{ + PLY_BOOT_SPLASH_DISPLAY_NORMAL, + PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY, + PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY +} ply_boot_splash_display_type_t; + +typedef struct +{ + ply_boot_splash_plugin_t *plugin; + ply_pixel_display_t *display; + ply_entry_t *entry; + ply_throbber_t *throbber; + ply_progress_bar_t *progress_bar; + ply_label_t *label; + ply_label_t *message_label; + ply_label_t *shutdown_label; + ply_rectangle_t box_area, lock_area, logo_area, bar_area; +} view_t; + +struct _ply_boot_splash_plugin +{ + ply_event_loop_t *loop; + ply_boot_splash_mode_t mode; + ply_image_t *logo_image; + ply_image_t *lock_image; + ply_image_t *box_image; + ply_list_t *views; + + char *image_dir; + char *shutdown_font; + char *shutdown_text; + char *boot_image; + char *shutdown_image; + ply_boot_splash_display_type_t state; + + uint32_t background_start_color; + uint32_t background_end_color; + uint32_t shutdown_background_start_color; + uint32_t shutdown_background_end_color; + uint32_t boot_progressbar_color; + uint32_t shutdown_progressbar_color; + uint32_t shutdown_color; + + ply_trigger_t *idle_trigger; + + uint32_t root_is_mounted : 1; + uint32_t is_visible : 1; + uint32_t is_animating : 1; + uint32_t is_idle : 1; + uint32_t is_boot_progressbar : 1; + uint32_t is_shutdown_progressbar : 1; + uint32_t is_progressbar : 1; +}; + +bool is_dir(const char* path) { + struct stat path_stat; + stat(path, &path_stat); + return S_ISDIR(path_stat.st_mode); +} + +void image_get_res(const char *basedir, int *xres, int *yres) +{ + FILE *fp; + char buf[512]; + int oxres, oyres; + + oxres = *xres; + oyres = *yres; + snprintf(buf, 512, "%s/%dx%d.png", basedir, oxres, oyres); + + fp = fopen(buf, "r"); + if (!fp) { + *xres = 1024; + *yres = 768; + unsigned int t, tx, ty, mdist = 0xffffffff; + struct dirent *dent; + DIR *tdir; + + snprintf(buf, 512, "%s", basedir); + tdir = opendir(buf); + if (!tdir) { + *xres = 0; + *yres = 0; + return; + } + while ((dent = readdir(tdir))) { + if (sscanf(dent->d_name, "%dx%d.png", &tx, &ty) != 2) + continue; + + /* We only want configs for resolutions smaller than the current one, + * so that we can actually fit the image on the screen. */ + if (tx >= oxres || ty >= oyres) + continue; + + t = (tx - oxres) * (tx - oxres) + (ty - oyres) * (ty - oyres); + + /* Penalize configs for resolutions with different aspect ratios. */ + if (oxres / oyres != tx / ty) + t *= 10; + + if (t < mdist) { + *xres = tx; + *yres = ty; + mdist = t; + } + } + closedir(tdir); + } else { + fclose(fp); + } +} + +char *detect_image(const char *logo_image, int xres, int yres) { + char *buf; + if(logo_image != NULL) { + if(is_dir(logo_image)) { + image_get_res(logo_image, &xres, &yres); + if(asprintf(&buf, "%s/%dx%d.png", logo_image, xres, yres) != -1) + return buf; + } else { + return strdup (logo_image); + } + } + return NULL; +} + +ply_boot_splash_plugin_interface_t *ply_boot_splash_plugin_get_interface (void); +static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin); + +static void become_idle (ply_boot_splash_plugin_t *plugin, + ply_trigger_t *idle_trigger); + +static view_t * +view_new (ply_boot_splash_plugin_t *plugin, + ply_pixel_display_t *display) +{ + view_t *view; + + view = calloc (1, sizeof(view_t)); + view->plugin = plugin; + view->display = display; + + view->entry = ply_entry_new (plugin->image_dir); + view->throbber = ply_throbber_new (plugin->image_dir, + "throbber-"); + view->progress_bar = ply_progress_bar_new (); + view->label = ply_label_new (); + view->message_label = ply_label_new (); + view->shutdown_label = ply_label_new (); + + return view; +} + +static void +view_free (view_t *view) +{ + ply_entry_free (view->entry); + ply_throbber_free (view->throbber); + ply_progress_bar_free (view->progress_bar); + ply_label_free (view->label); + ply_label_free (view->message_label); + ply_label_free (view->shutdown_label); + + free (view); +} + +static void +free_views (ply_boot_splash_plugin_t *plugin) +{ + ply_list_node_t *node; + + node = ply_list_get_first_node (plugin->views); + + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + view_free (view); + ply_list_remove_node (plugin->views, node); + + node = next_node; + } + + ply_list_free (plugin->views); + plugin->views = NULL; +} + +static bool +view_load (view_t *view) +{ + ply_trace ("loading entry"); + if (!ply_entry_load (view->entry)) + return false; + + ply_trace ("loading throbber"); + if (!ply_throbber_load (view->throbber)) + return true; + + return true; +} + +static bool +load_views (ply_boot_splash_plugin_t *plugin) +{ + ply_list_node_t *node; + bool view_loaded; + + view_loaded = false; + node = ply_list_get_first_node (plugin->views); + + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + if (view_load (view)) + view_loaded = true; + + node = next_node; + } + + return view_loaded; +} + +static void +view_redraw (view_t *view) +{ + unsigned long screen_width, screen_height; + + screen_width = ply_pixel_display_get_width (view->display); + screen_height = ply_pixel_display_get_height (view->display); + + ply_pixel_display_draw_area (view->display, 0, 0, + screen_width, screen_height); +} + +static void +redraw_views (ply_boot_splash_plugin_t *plugin) +{ + ply_list_node_t *node; + + node = ply_list_get_first_node (plugin->views); + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + view_redraw (view); + + node = next_node; + } +} + +static void +pause_views (ply_boot_splash_plugin_t *plugin) +{ + ply_list_node_t *node; + + ply_trace ("pausing views"); + + node = ply_list_get_first_node (plugin->views); + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + ply_pixel_display_pause_updates (view->display); + + node = next_node; + } +} + +static void +unpause_views (ply_boot_splash_plugin_t *plugin) +{ + ply_list_node_t *node; + + ply_trace ("unpausing views"); + + node = ply_list_get_first_node (plugin->views); + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + ply_pixel_display_unpause_updates (view->display); + + node = next_node; + } +} + +static void +view_start_animation (view_t *view) +{ + ply_boot_splash_plugin_t *plugin; + + unsigned long screen_width, screen_height; + long width, height; + long x,y; + int number_of_frames; + int yoffset = 0; + + assert (view != NULL); + + plugin = view->plugin; + + assert (plugin != NULL); + assert (plugin->loop != NULL); + + screen_width = ply_pixel_display_get_width (view->display); + screen_height = ply_pixel_display_get_height (view->display); + + ply_pixel_display_draw_area (view->display, 0, 0, + screen_width, screen_height); + + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN && + plugin->shutdown_font != NULL && plugin->shutdown_text != NULL) { + ply_label_set_text (view->shutdown_label, plugin->shutdown_text); + ply_label_set_font (view->shutdown_label, plugin->shutdown_font); + ply_label_set_color(view->shutdown_label, + ((plugin->shutdown_color >> 16) & 0xff) / 255.0f, + ((plugin->shutdown_color >> 8) & 0xff) / 255.0f, + (plugin->shutdown_color & 0xff) / 255.0f, + 1.0f); + int label_width = screen_width; + ply_label_set_width (view->shutdown_label, label_width); + ply_label_set_alignment (view->shutdown_label, PLY_LABEL_ALIGN_CENTER); + + x = 0; + y = screen_height / 2; + ply_label_show (view->shutdown_label, view->display, x, y); + yoffset = ply_label_get_height(view->shutdown_label) * 2; + } + + plugin->is_idle = false; + + number_of_frames = ply_array_get_size (view->throbber->frames); + + if (number_of_frames > 0) { + width = ply_throbber_get_width (view->throbber); + height = ply_throbber_get_height (view->throbber); + y = view->logo_area.y + view->logo_area.height + height / 2; + + ply_throbber_start (view->throbber, + plugin->loop, + view->display, + screen_width / 2.0 - width / 2.0, + (y + height < screen_height) ? y : (screen_height / 2 + yoffset)); + } + view_redraw (view); +} + +static void +view_show_prompt (view_t *view, + const char *prompt) +{ + ply_boot_splash_plugin_t *plugin; + int x, y; + int entry_width, entry_height; + + assert (view != NULL); + + plugin = view->plugin; + + if (ply_entry_is_hidden (view->entry)) { + unsigned long screen_width, screen_height; + + screen_width = ply_pixel_display_get_width (view->display); + screen_height = ply_pixel_display_get_height (view->display); + + view->box_area.width = ply_image_get_width (plugin->box_image); + view->box_area.height = ply_image_get_height (plugin->box_image); + view->box_area.x = screen_width / 2.0 - view->box_area.width / 2.0; + view->box_area.y = screen_height / 2.0 - view->box_area.height / 2.0; + + view->lock_area.width = ply_image_get_width (plugin->lock_image); + view->lock_area.height = ply_image_get_height (plugin->lock_image); + + entry_width = ply_entry_get_width (view->entry); + entry_height = ply_entry_get_height (view->entry); + + x = screen_width / 2.0 - (view->lock_area.width + entry_width) / 2.0 + view->lock_area.width; + y = screen_height / 2.0 - entry_height / 2.0; + + view->lock_area.x = screen_width / 2.0 - (view->lock_area.width + entry_width) / 2.0; + view->lock_area.y = screen_height / 2.0 - view->lock_area.height / 2.0; + + ply_entry_show (view->entry, plugin->loop, view->display, x, y); + } + + if (prompt != NULL) { + ply_label_set_text (view->label, prompt); + + x = view->box_area.x + view->lock_area.width / 2; + y = view->box_area.y + view->box_area.height; + + ply_label_show (view->label, view->display, x, y); + } +} + +static void +view_hide_prompt (view_t *view) +{ + assert (view != NULL); + + ply_entry_hide (view->entry); + ply_label_hide (view->label); +} + +static ply_boot_splash_plugin_t * +create_plugin (ply_key_file_t *key_file) +{ + ply_boot_splash_plugin_t *plugin; + char *image_dir, *image_path; + char *color; + + srand ((int) ply_get_timestamp ()); + plugin = calloc (1, sizeof(ply_boot_splash_plugin_t)); + + image_dir = ply_key_file_get_value (key_file, "calculate", "ImageDir"); + + plugin->logo_image = NULL; + plugin->boot_image = ply_key_file_get_value (key_file, "calculate", "BootImage"); + plugin->shutdown_image = ply_key_file_get_value (key_file, "calculate", "ShutdownImage"); + + plugin->shutdown_font = ply_key_file_get_value (key_file, "calculate", "ShutdownFont"); + plugin->shutdown_text = ply_key_file_get_value (key_file, "calculate", "ShutdownText"); + color = ply_key_file_get_value (key_file, "calculate", "ShutdownTextColor"); + if (color != NULL) + plugin->shutdown_color = strtol (color, NULL, 0); + else + plugin->shutdown_color = 0xffffff; + free(color); + + if (asprintf (&image_path, "%s/lock.png", image_dir) != -1) { + plugin->lock_image = ply_image_new (image_path); + free (image_path); + } + + if (asprintf (&image_path, "%s/box.png", image_dir) != -1) { + plugin->box_image = ply_image_new (image_path); + free (image_path); + } + + plugin->image_dir = image_dir; + plugin->views = ply_list_new (); + + color = ply_key_file_get_value (key_file, "calculate", "BootBackgroundStartColor"); + + if (color != NULL) + plugin->background_start_color = strtol (color, NULL, 0); + else + plugin->background_start_color = 0x000000; + + free (color); + + color = ply_key_file_get_value (key_file, "calculate", "BootBackgroundEndColor"); + + if (color != NULL) + plugin->background_end_color = strtol (color, NULL, 0); + else + plugin->background_end_color = 0x000000; + + free (color); + + color = ply_key_file_get_value (key_file, "calculate", "ShutdownBackgroundStartColor"); + + if (color != NULL) + plugin->shutdown_background_start_color = strtol (color, NULL, 0); + else + plugin->shutdown_background_start_color = 0x000000; + + free (color); + + color = ply_key_file_get_value (key_file, "calculate", "ShutdownBackgroundEndColor"); + + if (color != NULL) + plugin->shutdown_background_end_color = strtol (color, NULL, 0); + else + plugin->shutdown_background_end_color = 0x000000; + + free (color); + + plugin->is_boot_progressbar = false; + plugin->is_shutdown_progressbar = false; + plugin->boot_progressbar_color = 0xffffff; + plugin->shutdown_progressbar_color = 0xffffff; + plugin->is_progressbar = false; + + return plugin; +} + +static void +destroy_plugin (ply_boot_splash_plugin_t *plugin) +{ + if (plugin == NULL) + return; + + ply_trace ("destroying plugin"); + + if (plugin->loop != NULL) { + ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t) + detach_from_event_loop, + plugin); + detach_from_event_loop (plugin); + } + + ply_image_free (plugin->logo_image); + ply_image_free (plugin->box_image); + ply_image_free (plugin->lock_image); + + + free (plugin->boot_image); + free (plugin->shutdown_image); + free (plugin->shutdown_text); + free (plugin->shutdown_font); + + free_views (plugin); + + free (plugin); +} + +static void +draw_background (view_t *view, + ply_pixel_buffer_t *pixel_buffer, + int x, + int y, + int width, + int height) +{ + uint32_t start_color; + uint32_t end_color; + ply_boot_splash_plugin_t *plugin; + ply_rectangle_t area; + + plugin = view->plugin; + + area.x = x; + area.y = y; + area.width = width; + area.height = height; + + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) { + start_color = plugin->shutdown_background_start_color; + end_color = plugin->shutdown_background_end_color; + } else { + start_color = plugin->background_start_color; + end_color = plugin->background_end_color; + } + + if (start_color != end_color) + ply_pixel_buffer_fill_with_gradient (pixel_buffer, &area, start_color, end_color); + else + ply_pixel_buffer_fill_with_hex_color (pixel_buffer, &area, start_color); +} + +static void +draw_logo (view_t *view, + ply_pixel_buffer_t *pixel_buffer) +{ + ply_boot_splash_plugin_t *plugin; + uint32_t *logo_data; + unsigned long screen_width, screen_height; + long width, height; + char *image_path; + + plugin = view->plugin; + + screen_width = ply_pixel_display_get_width (view->display); + screen_height = ply_pixel_display_get_height (view->display); + + if(plugin->logo_image == NULL) { + ply_trace ("loading logo image"); + int xres = screen_width; + int yres = screen_height; + + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN && plugin->shutdown_image) { + image_path = detect_image(plugin->shutdown_image, xres, yres); + plugin->logo_image = ply_image_new (image_path); + free (image_path); + if (!ply_image_load (plugin->logo_image)) + return; + } else if (plugin->mode == PLY_BOOT_SPLASH_MODE_BOOT_UP && plugin->boot_image) { + image_path = detect_image(plugin->boot_image, xres, yres); + plugin->logo_image = ply_image_new (image_path); + free (image_path); + if (!ply_image_load (plugin->logo_image)) + return; + } else { + plugin->logo_image = ply_image_new (""); + } + + } + + if(ply_image_get_buffer(plugin->logo_image)) { + width = ply_image_get_width (plugin->logo_image); + height = ply_image_get_height (plugin->logo_image); + logo_data = ply_image_get_data (plugin->logo_image); + view->logo_area.x = (screen_width / 2) - (width / 2); + view->logo_area.y = (screen_height / 2) - (height / 2); + view->logo_area.width = width; + view->logo_area.height = height; + + ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, + &view->logo_area, + logo_data); + } +} + +static void +start_animation (ply_boot_splash_plugin_t *plugin) +{ + ply_list_node_t *node; + + if (plugin->is_animating) + return; + + ply_trace ("starting animation"); + + node = ply_list_get_first_node (plugin->views); + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + view_start_animation (view); + + node = next_node; + } + + plugin->is_animating = true; + + if (plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN) + plugin->is_idle = true; +} + +static void +stop_animation (ply_boot_splash_plugin_t *plugin, + ply_trigger_t *trigger) +{ + ply_list_node_t *node; + + assert (plugin != NULL); + assert (plugin->loop != NULL); + + if (!plugin->is_animating) + return; + + ply_trace ("stopping animation%s", + trigger != NULL ? " with trigger" : ""); + + plugin->is_animating = false; + + node = ply_list_get_first_node (plugin->views); + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + ply_progress_bar_hide (view->progress_bar); + if (trigger != NULL) + ply_trigger_ignore_next_pull (trigger); + ply_throbber_stop (view->throbber, trigger); + + node = next_node; + } + + if (trigger != NULL) + ply_trigger_pull (trigger, NULL); +} + +static void +detach_from_event_loop (ply_boot_splash_plugin_t *plugin) +{ + plugin->loop = NULL; +} + +static void +on_draw (view_t *view, + ply_pixel_buffer_t *pixel_buffer, + int x, + int y, + int width, + int height) +{ + ply_boot_splash_plugin_t *plugin; + + plugin = view->plugin; + + draw_background (view, pixel_buffer, x, y, width, height); + + if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY || + plugin->state == PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY) { + uint32_t *box_data, *lock_data; + + box_data = ply_image_get_data (plugin->box_image); + ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, + &view->box_area, + box_data); + ply_entry_draw_area (view->entry, pixel_buffer, x, y, width, height); + ply_label_draw_area (view->label, pixel_buffer, x, y, width, height); + lock_data = ply_image_get_data (plugin->lock_image); + ply_pixel_buffer_fill_with_argb32_data (pixel_buffer, + &view->lock_area, + lock_data); + } else { + draw_logo (view, pixel_buffer); + ply_throbber_draw_area (view->throbber, + pixel_buffer, x, y, width, height); + ply_progress_bar_draw_area_color (view->progress_bar, + pixel_buffer, x, y, width, height, + plugin->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN ? + plugin->shutdown_progressbar_color : + plugin->boot_progressbar_color); + } + ply_label_draw_area (view->message_label, + pixel_buffer, + x, y, width, height); + + ply_label_draw_area (view->shutdown_label, + pixel_buffer, + x, y, width, height); +} + +static void +add_pixel_display (ply_boot_splash_plugin_t *plugin, + ply_pixel_display_t *display) +{ + view_t *view; + + ply_trace ("adding pixel display to plugin"); + view = view_new (plugin, display); + + ply_pixel_display_set_draw_handler (view->display, + (ply_pixel_display_draw_handler_t) + on_draw, view); + + if (plugin->is_visible) { + if (view_load (view)) + ply_list_append_data (plugin->views, view); + else + view_free (view); + } else { + ply_list_append_data (plugin->views, view); + } +} + +static void +remove_pixel_display (ply_boot_splash_plugin_t *plugin, + ply_pixel_display_t *display) +{ + ply_list_node_t *node; + + ply_trace ("removing pixel display from plugin"); + node = ply_list_get_first_node (plugin->views); + while (node != NULL) { + view_t *view; + ply_list_node_t *next_node; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + if (view->display == display) { + ply_pixel_display_set_draw_handler (view->display, NULL, NULL); + view_free (view); + ply_list_remove_node (plugin->views, node); + return; + } + + node = next_node; + } +} + +static bool +show_splash_screen (ply_boot_splash_plugin_t *plugin, + ply_event_loop_t *loop, + ply_buffer_t *boot_buffer, + ply_boot_splash_mode_t mode) +{ + assert (plugin != NULL); + //assert (plugin->logo_image != NULL); + + plugin->loop = loop; + plugin->mode = mode; + + ply_trace ("loading lock image"); + if (!ply_image_load (plugin->lock_image)) + return false; + + ply_trace ("loading box image"); + if (!ply_image_load (plugin->box_image)) + return false; + + if (!load_views (plugin)) { + ply_trace ("couldn't load views"); + return false; + } + + ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t) + detach_from_event_loop, + plugin); + + ply_trace ("starting boot animation"); + start_animation (plugin); + + plugin->is_visible = true; + + return true; +} + +static void +update_status (ply_boot_splash_plugin_t *plugin, + const char *status) +{ + assert (plugin != NULL); +} + +static void +on_boot_progress (ply_boot_splash_plugin_t *plugin, + double duration, + double percent_done) +{ + ply_list_node_t *node; + double total_duration; + + if (plugin->mode == PLY_BOOT_SPLASH_MODE_UPDATES) + return; + + total_duration = duration / percent_done; + + /* Fun made-up smoothing function to make the growth asymptotic: + * fraction(time,estimate)=1-2^(-(time^1.45)/estimate) */ + percent_done = 1.0 - pow (2.0, -pow (duration, 1.45) / total_duration) * (1.0 - percent_done); + + node = ply_list_get_first_node (plugin->views); + + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + ply_progress_bar_set_percent_done (view->progress_bar, percent_done); + ply_progress_bar_draw (view->progress_bar); + + node = next_node; + } +} + +static void +hide_splash_screen (ply_boot_splash_plugin_t *plugin, + ply_event_loop_t *loop) +{ + assert (plugin != NULL); + + ply_trace ("hiding splash"); + if (plugin->loop != NULL) { + stop_animation (plugin, NULL); + + ply_event_loop_stop_watching_for_exit (plugin->loop, (ply_event_loop_exit_handler_t) + detach_from_event_loop, + plugin); + detach_from_event_loop (plugin); + } + + plugin->is_visible = false; +} + +static void +show_password_prompt (ply_boot_splash_plugin_t *plugin, + const char *text, + int number_of_bullets) +{ + ply_list_node_t *node; + + ply_trace ("showing password prompt"); + node = ply_list_get_first_node (plugin->views); + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + view_show_prompt (view, text); + ply_entry_set_bullet_count (view->entry, number_of_bullets); + + node = next_node; + } +} + +static void +show_prompt (ply_boot_splash_plugin_t *plugin, + const char *prompt, + const char *entry_text) +{ + ply_list_node_t *node; + + ply_trace ("showing prompt"); + node = ply_list_get_first_node (plugin->views); + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + view_show_prompt (view, prompt); + ply_entry_set_text (view->entry, entry_text); + + node = next_node; + } +} + +static void +on_root_mounted (ply_boot_splash_plugin_t *plugin) +{ + ply_trace ("root filesystem mounted"); + plugin->root_is_mounted = true; +} + +static void +become_idle (ply_boot_splash_plugin_t *plugin, + ply_trigger_t *idle_trigger) +{ + ply_trace ("deactivation requested"); + if (plugin->is_idle) { + ply_trace ("plugin is already idle"); + ply_trigger_pull (idle_trigger, NULL); + return; + } + + stop_animation (plugin, idle_trigger); + plugin->is_idle = true; +} + +static void +hide_prompt (ply_boot_splash_plugin_t *plugin) +{ + ply_list_node_t *node; + + ply_trace ("hiding prompt"); + node = ply_list_get_first_node (plugin->views); + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + + view_hide_prompt (view); + + node = next_node; + } +} + + +static void +show_message (ply_boot_splash_plugin_t *plugin, + const char *message) +{ + ply_trace ("Showing message '%s'", message); + ply_list_node_t *node; + node = ply_list_get_first_node (plugin->views); + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + ply_label_set_text (view->message_label, message); + ply_label_show (view->message_label, view->display, 10, 10); + + ply_pixel_display_draw_area (view->display, 10, 10, + ply_label_get_width (view->message_label), + ply_label_get_height (view->message_label)); + node = next_node; + } +} + +static void +display_normal (ply_boot_splash_plugin_t *plugin) +{ + pause_views (plugin); + if (plugin->state != PLY_BOOT_SPLASH_DISPLAY_NORMAL) + hide_prompt (plugin); + + plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL; + start_animation (plugin); + redraw_views (plugin); + unpause_views (plugin); +} + +static void +display_password (ply_boot_splash_plugin_t *plugin, + const char *prompt, + int bullets) +{ + pause_views (plugin); + if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) + stop_animation (plugin, NULL); + + plugin->state = PLY_BOOT_SPLASH_DISPLAY_PASSWORD_ENTRY; + show_password_prompt (plugin, prompt, bullets); + redraw_views (plugin); + unpause_views (plugin); +} + +static void +display_question (ply_boot_splash_plugin_t *plugin, + const char *prompt, + const char *entry_text) +{ + pause_views (plugin); + if (plugin->state == PLY_BOOT_SPLASH_DISPLAY_NORMAL) + stop_animation (plugin, NULL); + + plugin->state = PLY_BOOT_SPLASH_DISPLAY_QUESTION_ENTRY; + show_prompt (plugin, prompt, entry_text); + redraw_views (plugin); + unpause_views (plugin); +} + +static void +display_message (ply_boot_splash_plugin_t *plugin, + const char *message) +{ + show_message (plugin, message); +} + +static void +system_update (ply_boot_splash_plugin_t *plugin, + int progress) +{ + ply_list_node_t *node; + + if (plugin->mode != PLY_BOOT_SPLASH_MODE_UPDATES) + return; + + node = ply_list_get_first_node (plugin->views); + while (node != NULL) { + ply_list_node_t *next_node; + view_t *view; + + view = ply_list_node_get_data (node); + next_node = ply_list_get_next_node (plugin->views, node); + ply_progress_bar_set_percent_done (view->progress_bar, (double) progress / 100.f); + ply_progress_bar_draw (view->progress_bar); + node = next_node; + } +} + +ply_boot_splash_plugin_interface_t * +ply_boot_splash_plugin_get_interface (void) +{ + static ply_boot_splash_plugin_interface_t plugin_interface = + { + .create_plugin = create_plugin, + .destroy_plugin = destroy_plugin, + .add_pixel_display = add_pixel_display, + .remove_pixel_display = remove_pixel_display, + .show_splash_screen = show_splash_screen, + .update_status = update_status, + .on_boot_progress = on_boot_progress, + .hide_splash_screen = hide_splash_screen, + .on_root_mounted = on_root_mounted, + .become_idle = become_idle, + .display_normal = display_normal, + .display_password = display_password, + .display_question = display_question, + .display_message = display_message, + .system_update = system_update, + }; + + return &plugin_interface; +} + +/* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */ + +#define FRAMES_PER_SECOND 30 + +ply_progress_bar_t * +ply_progress_bar_new (void) +{ + ply_progress_bar_t *progress_bar; + + progress_bar = calloc (1, sizeof(ply_progress_bar_t)); + + progress_bar->is_hidden = true; + progress_bar->percent_done = 0.0; + progress_bar->area.x = 0; + progress_bar->area.y = 0; + progress_bar->area.width = 0; + progress_bar->area.height = BAR_HEIGHT; + + return progress_bar; +} +static void +ply_progress_bar_update_area (ply_progress_bar_t *progress_bar, + long x, + long y) +{ + unsigned long display_width; + + progress_bar->area.x = x; + progress_bar->area.y = y; + progress_bar->area.height = BAR_HEIGHT; + + display_width = ply_pixel_display_get_width (progress_bar->display); + progress_bar->area.width = (long) (display_width * progress_bar->percent_done); +} + +void +ply_progress_bar_draw (ply_progress_bar_t *progress_bar) +{ + if (progress_bar->is_hidden) + return; + + ply_progress_bar_update_area (progress_bar, progress_bar->area.x, progress_bar->area.y); + ply_pixel_display_draw_area (progress_bar->display, + progress_bar->area.x, + progress_bar->area.y, + progress_bar->area.width, + progress_bar->area.height); +} diff --git a/sys-boot/plymouth-calculate-plugin/plymouth-calculate-plugin-0.9.4-r3.ebuild b/sys-boot/plymouth-calculate-plugin/plymouth-calculate-plugin-0.9.4-r3.ebuild new file mode 100644 index 000000000000..64b4fc69f5b4 --- /dev/null +++ b/sys-boot/plymouth-calculate-plugin/plymouth-calculate-plugin-0.9.4-r3.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic + +MY_P=plymouth-${PV} + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://anongit.freedesktop.org/git/plymouth" +else + SRC_URI="${SRC_URI} https://www.freedesktop.org/software/plymouth/releases/${MY_P}.tar.xz" + KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc x86" +fi + +inherit autotools readme.gentoo-r1 systemd toolchain-funcs + +DESCRIPTION="Calculate plugin for plymouth" +HOMEPAGE="https://www.calculate-linux.org" + +LICENSE="GPL-2" +SLOT="0" +IUSE="debug gdm +gtk +libkms +pango +split-usr static-libs" + +CDEPEND=" + ~sys-boot/${MY_P}[debug?,gdm?,gtk?,libkms?,pango?,split-usr?,static-libs?] +" +DEPEND="${CDEPEND} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" +RDEPEND="${CDEPEND} + virtual/udev + !<sys-kernel/dracut-0.37-r3 +" + +PATCHES=( + "${FILESDIR}"/0.9.3-glibc-sysmacros.patch +) + +S="${WORKDIR}/${MY_P}" + +src_prepare() { + default + cp ${FILESDIR}/plugin.c ${S}/src/plugins/splash/throbgress + sed -i 's/throbgress/calculate/g' ${S}/src/plugins/splash/throbgress/Makefile.* + eautoreconf +} + + +src_configure() { + local myconf=( + --with-system-root-install=no + --localstatedir=/var + --without-rhgb-compat-link + --enable-documentation + --enable-systemd-integration + --with-systemdunitdir="$(systemd_get_systemunitdir)" + $(use_enable !static-libs shared) + $(use_enable static-libs static) + $(use_enable debug tracing) + $(use_enable gtk gtk) + $(use_enable libkms drm) + $(use_enable pango) + $(use_enable gdm gdm-transition) + ) + econf "${myconf[@]}" +} + +src_compile() { + cd src/libply + emake + cd ../libply-splash-core + emake + cd ../libply-splash-graphics + emake + cd ../plugins/splash/throbgress + emake +} + +src_install() { + cd ${S}/src/plugins/splash/throbgress + emake DESTDIR="${D}" install + + cd ${S}/themes/spinfinity + + insinto /usr/share/plymouth/themes/calculate + doins box.png bullet.png entry.png lock.png + + cd ${S}/themes/spinner + doins throbber-00*.png + + doins ${FILESDIR}/calculate.plymouth +} diff --git a/sys-boot/plymouth-openrc-plugin/Manifest b/sys-boot/plymouth-openrc-plugin/Manifest new file mode 100644 index 000000000000..64681ef62cef --- /dev/null +++ b/sys-boot/plymouth-openrc-plugin/Manifest @@ -0,0 +1 @@ +DIST plymouth-openrc-plugin-0.1.2.tar.bz2 8909 BLAKE2B 0ddebeb0d957cea672eca2faa4c4f12d348e38bf5e5d2947585bdc12c0f9188920a2359a88b2ada5c7872400c12fb224aca24e78ec2ac6bc7fba9bcdd2a0c5bc SHA512 a6c578dcdcc770cf55cf150fbf67e99ef4fac08db17fd8a84ec5f76f96172aa4cb071a0ee695a6d6fe6883e5117c95b096ba5ce8260d71bea33a26909719457d diff --git a/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-disable-messages.patch b/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-disable-messages.patch new file mode 100644 index 000000000000..308a72305156 --- /dev/null +++ b/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-disable-messages.patch @@ -0,0 +1,30 @@ +# Calculate format=diff +commit a2683bffa4c506fcf2ec440f7b482191ed37fd27 +Author: Mir Calculate <support@calculate.ru> +Date: Wed Feb 13 16:29:33 2019 +0300 + + Отключено сообщение о запускаемой/останавливаемой службе + +diff --git a/plymouth.c b/plymouth.c +index e9c925b..57a4b7f 100644 +--- a/plymouth.c ++++ b/plymouth.c +@@ -85,7 +85,7 @@ int commandf(const char* cmd, ...) + + bool ply_message(const char* hook, const char* name) + { +- return (commandf("/bin/plymouth message --text=\"%s %s\"", hook, name) == 0); ++ return true; + } + + +@@ -145,7 +145,8 @@ bool ply_start(int mode) + + bool ply_update_status(int hook, const char* name) + { +- return (commandf("/bin/plymouth update --status=%d-%s", hook, name) == 0); ++ //return (commandf("/bin/plymouth update --status=%d-%s", hook, name) == 0); ++ return true; + } + + diff --git a/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-exit-at-mount-ro.patch b/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-exit-at-mount-ro.patch new file mode 100644 index 000000000000..7dc5feb2fc1f --- /dev/null +++ b/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-exit-at-mount-ro.patch @@ -0,0 +1,25 @@ +From 9d3485d73244eea61205c4c84b2c37d489d5bbcb Mon Sep 17 00:00:00 2001 +From: tlhonmey <lperkins@zagmail.gonzaga.edu> +Date: Wed, 31 Jan 2018 11:10:48 -0800 +Subject: [PATCH] Exit plymouth when we hit mount-ro rather than localmount. + +Newer versions of openrc appear to run localmount almost immediately upon shutdown, causing the plugin to send Plymouth the quit command before the splash is even displayed, resulting in no splash on shutdown. + +The job that cuts us off from writing to /var is now mount-ro, which runs near the end like it should and gives Plymouth time to show the splash. +--- + plymouth.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plymouth.c b/plymouth.c +index e657e82..e9c925b 100644 +--- a/plymouth.c ++++ b/plymouth.c +@@ -240,7 +240,7 @@ int rc_plugin_hook(RC_HOOK hook, const char *name) + + case RC_HOOK_SERVICE_STOP_IN: + /* Quit Plymouth when we're going to lost write access to /var/... */ +- if(strcmp(name, "localmount") == 0 && ++ if(strcmp(name, "mount-ro") == 0 && + strcmp(runlevel, RC_LEVEL_SHUTDOWN) == 0) { + DBG("ply_quit(PLY_MODE_SHUTDOWN)"); + if(!ply_quit(PLY_MODE_SHUTDOWN)) diff --git a/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-restart-consolefont.patch b/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-restart-consolefont.patch new file mode 100644 index 000000000000..7ed4575793ee --- /dev/null +++ b/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-restart-consolefont.patch @@ -0,0 +1,31 @@ +# Calculate format=diff +commit ebd632e188b9d647e31989f27c80124a8899cc33 +Author: Mir Calculate <support@calculate.ru> +Date: Wed Feb 13 16:43:33 2019 +0300 + + Добавлен перезапуск consolefont в конце загрузки системы + +diff --git a/plymouth.c b/plymouth.c +index ab25871..7089150 100644 +--- a/plymouth.c ++++ b/plymouth.c +@@ -82,6 +82,11 @@ int commandf(const char* cmd, ...) + return command(buffer); + } + ++void restart_console_font() ++{ ++ if(RC_SERVICE_STARTED == rc_service_state("consolefont")) ++ command("/etc/init.d/consolefont restart"); ++} + + bool ply_message(const char* hook, const char* name) + { +@@ -237,6 +242,7 @@ int rc_plugin_hook(RC_HOOK hook, const char *name) + DBG("ply_quit(PLY_MODE_BOOT)"); + if(!ply_quit(PLY_MODE_BOOT)) + rv = 1; ++ restart_console_font(); + } + break; + diff --git a/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-silent-shutdown.patch b/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-silent-shutdown.patch new file mode 100644 index 000000000000..1ac22d4ca8e2 --- /dev/null +++ b/sys-boot/plymouth-openrc-plugin/files/plymouth-openrc-plugin-0.1.2-silent-shutdown.patch @@ -0,0 +1,80 @@ +# Calculate format=diff +commit aaa3f2214e88374475adde0af0a6916f114a0b4d +Author: Mir Calculate <support@calculate.ru> +Date: Tue Feb 19 11:51:06 2019 +0300 + + Изменены условия запуск plymouthd + + Запускать plymouthd при загрузке если есть параметр splash или + splash=silent + Запускать plymouthd при выключении если есть параметр splash или + splash=shutdown + +diff --git a/plymouth.c b/plymouth.c +index f2658f6..48a69e8 100644 +--- a/plymouth.c ++++ b/plymouth.c +@@ -22,6 +22,8 @@ + #include <stdarg.h> + #include <stdio.h> + #include <stdlib.h> ++#include <fcntl.h> ++#include <ctype.h> + #include <string.h> + #include <unistd.h> + #include <sys/stat.h> +@@ -174,6 +176,30 @@ bool ply_update_status(int hook, const char* name) + return true; + } + ++bool kernel_command_has_argument(const char *argument) ++{ ++ char buf[4096]; ++ int fd; ++ fd = open("/proc/cmdline", O_RDONLY); ++ ++ if( fd < 0 ) { ++ return false; ++ } ++ if(read(fd, buf, 4095) < 0) { ++ close(fd); ++ return false; ++ } ++ close(fd); ++ char *found_arg = strstr(buf, argument); ++ if(found_arg == NULL) ++ return false; ++ ++ if(found_arg == buf || found_arg[-1] == ' ') { ++ char endch = *(found_arg+strlen(argument)); ++ return (isspace(endch) || endch == '\0') ? true : false; ++ } ++ return false; ++} + + bool ply_update_rootfs_rw() + { +@@ -236,7 +262,10 @@ int rc_plugin_hook(RC_HOOK hook, const char *name) + case RC_HOOK_RUNLEVEL_STOP_IN: + /* Start the Plymouth daemon and show splash when system is being shut + * down. */ +- if(strcmp(name, RC_LEVEL_SHUTDOWN) == 0) { ++ if(strcmp(name, RC_LEVEL_SHUTDOWN) == 0 && ++ (kernel_command_has_argument("splash") || ++ kernel_command_has_argument("splash=shutdown"))) ++ { + DBG("ply_start(PLY_MODE_SHUTDOWN)"); + if(!ply_start(PLY_MODE_SHUTDOWN) + || !ply_update_rootfs_rw()) +@@ -249,7 +278,10 @@ int rc_plugin_hook(RC_HOOK hook, const char *name) + /* Start the Plymouth daemon and show splash when entering the boot + * runlevel. Required /proc and /sys should already be mounted in + * sysinit runlevel. */ +- if(strcmp(name, bootlevel) == 0) { ++ if(strcmp(name, bootlevel) == 0 && ++ (kernel_command_has_argument("splash") || ++ kernel_command_has_argument("splash=silent"))) ++ { + DBG("ply_start(PLY_MODE_BOOT)"); + if(!ply_start(PLY_MODE_BOOT)) + rv = 1; diff --git a/sys-boot/plymouth-openrc-plugin/plymouth-openrc-plugin-0.1.2-r2.ebuild b/sys-boot/plymouth-openrc-plugin/plymouth-openrc-plugin-0.1.2-r2.ebuild new file mode 100644 index 000000000000..d76a866d451a --- /dev/null +++ b/sys-boot/plymouth-openrc-plugin/plymouth-openrc-plugin-0.1.2-r2.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Plymouth plugin for OpenRC" +HOMEPAGE="https://github.com/aidecoe/plymouth-openrc-plugin" +SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/${P}.tar.bz2" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc x86" +IUSE="" + +DEPEND="sys-apps/openrc:=" +RDEPEND="${DEPEND} + sys-boot/plymouth" + +PATCHES=( "${FILESDIR}/${P}-exit-at-mount-ro.patch" + "${FILESDIR}/${P}-disable-messages.patch" + "${FILESDIR}/${P}-restart-consolefont.patch" + "${FILESDIR}/${P}-silent-shutdown.patch" ) + +src_install() { + insinto /$(get_libdir)/rc/plugins + doins plymouth.so +} + +pkg_postinst() { + ewarn "You need to disable 'rc_interactive' feature in /etc/rc.conf to make" + ewarn "Plymouth work properly with OpenRC init system." + + if has_version sys-apps/systemd; then + eerror "sys-apps/systemd is installed, please uninstall this package if you" + eerror "are booting with systemd" + fi +} diff --git a/sys-boot/plymouth/Manifest b/sys-boot/plymouth/Manifest new file mode 100644 index 000000000000..9e889ee2efe9 --- /dev/null +++ b/sys-boot/plymouth/Manifest @@ -0,0 +1,3 @@ +DIST gentoo-logo.png 14501 BLAKE2B e7236c16b96a2d35a6f062b89bc0a6c6fc696a803b7da734ff9ae255fcd65e549d9bc3d510c283e235a770f42edcbdffc1d5cc4c2fcdec9cc931eb0acf504859 SHA512 059a555931b6d2a910bcd887f5ea0cc17c6edf2d2d45c03a1fec1bdda0138ba6bca6bdf90a65c6520a3f8f1b51ecf6f7956098f45ed6c1276f29c835e729163c +DIST plymouth-0.9.3.tar.xz 1102724 BLAKE2B 7ee17cc785e6197cc9488afe6ceae27541992872813a9f937211930f653207d77c1a331cb093156af5ec9502a04cf1f9e4123c42e07931eaf270fefedcc03700 SHA512 d7b9ba97485cdac7ad6bcaf5a7f1a9c84ece54b8d46d5efce4170294c0aa6571656d7d9957b53aed9c1e51d4d525714f54b7dbb08d8ec0b196a1a4419fd186ed +DIST plymouth-0.9.4.tar.xz 1103496 BLAKE2B abad2cefb89e9d17b77113396d7203090544759b3dd7f73f67153d9f126db28e5366d36aa11e2335566bf4046bebd50d8d9dd47c75634446fb3a0314cd458925 SHA512 83eb2de7e6d0980e9f7fa4e0b0f20c46a8238051d84bc38dbbb5dfa438e41c1a39846dcd652374256d9f1fe79967b154a3576cd9c433ef816b6c962be2d31e93 diff --git a/sys-boot/plymouth/files/0.9.3-glibc-sysmacros.patch b/sys-boot/plymouth/files/0.9.3-glibc-sysmacros.patch new file mode 100644 index 000000000000..8969161bb195 --- /dev/null +++ b/sys-boot/plymouth/files/0.9.3-glibc-sysmacros.patch @@ -0,0 +1,45 @@ +From f8d7813b32dfe129d1e5718719ee3eff131f4fac Mon Sep 17 00:00:00 2001 +From: Kjell Claesson <kjell.claesson@epost.tidanet.se> +Date: Fri, 18 Aug 2017 00:25:56 +0200 +Subject: [PATCH] Fix build with newer glibc + +Signed-off-by: Gilles Dartiguelongue <eva@gentoo.org> +--- + configure.ac | 1 + + src/libply-splash-core/ply-terminal.c | 8 ++++++++ + 2 files changed, 9 insertions(+) + +diff --git a/configure.ac b/configure.ac +index c32697f..8376789 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5,6 +5,7 @@ AC_CONFIG_AUX_DIR(build-tools) + + AC_USE_SYSTEM_EXTENSIONS + AC_SYS_LARGEFILE ++AC_HEADER_MAJOR + AC_PROG_AWK + AC_PROG_CC_STDC + AM_PROG_CC_C_O +diff --git a/src/libply-splash-core/ply-terminal.c b/src/libply-splash-core/ply-terminal.c +index a0954f2..ef62bf8 100644 +--- a/src/libply-splash-core/ply-terminal.c ++++ b/src/libply-splash-core/ply-terminal.c +@@ -36,6 +36,14 @@ + #include <unistd.h> + #include <wchar.h> + ++/* major()/minor() */ ++#ifdef MAJOR_IN_MKDEV ++# include <sys/mkdev.h> ++#endif ++#ifdef MAJOR_IN_SYSMACROS ++# include <sys/sysmacros.h> ++#endif ++ + #include <linux/kd.h> + #include <linux/major.h> + #include <linux/vt.h> +-- +2.14.1 + diff --git a/sys-boot/plymouth/metadata.xml b/sys-boot/plymouth/metadata.xml new file mode 100644 index 000000000000..884d61fca002 --- /dev/null +++ b/sys-boot/plymouth/metadata.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>prometheanfire@gentoo.org</email> + <name>Matthew Thode</name> + </maintainer> + <use> + <flag name="gdm">Enables smooth transition to GDM</flag> + <flag name="libkms">Provides abstraction to the DRM drivers (intel, + nouveau and vmwgfx at this moment)</flag> + <flag name="pango">Adds support for printing text on splash screen and + text prompts, e.g. for password</flag> + <flag name="split-usr">Enable this if /bin and /usr/bin are separate + directories</flag> + </use> + <longdescription lang="en"> + Plymouth is an application that runs very early in the boot process + (even before the root filesystem is mounted!) that provides a graphical + boot animation while the boot process happens in the background. + + It is designed to work on systems with DRM modesetting drivers. Ideally, + the goal is to get rid of all flicker during startup. For systems that + don't have DRM mode settings drivers, plymouth falls back to text mode. + </longdescription> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/plymouth/plymouth-0.9.3-r1.ebuild b/sys-boot/plymouth/plymouth-0.9.3-r1.ebuild new file mode 100644 index 000000000000..a27ceaae5232 --- /dev/null +++ b/sys-boot/plymouth/plymouth-0.9.3-r1.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png" + +if [[ ${PV} == 9999 ]]; then + EGIT_REPO_URI="git://anongit.freedesktop.org/plymouth" + inherit git-r3 +else + SRC_URI="${SRC_URI} https://www.freedesktop.org/software/plymouth/releases/${P}.tar.xz" +fi + +inherit autotools readme.gentoo-r1 systemd toolchain-funcs + +DESCRIPTION="Graphical boot animation (splash) and logger" +HOMEPAGE="https://cgit.freedesktop.org/plymouth/" + +LICENSE="GPL-2" +SLOT="0" +[[ ${PV} == 9999 ]] || \ +KEYWORDS="~alpha amd64 arm ~ia64 ppc ppc64 sparc x86" +IUSE="debug gdm +gtk +libkms +pango static-libs" + +CDEPEND=" + >=media-libs/libpng-1.2.16:= + gtk? ( + dev-libs/glib:2 + >=x11-libs/gtk+-3.14:3 + x11-libs/cairo ) + libkms? ( x11-libs/libdrm[libkms] ) + pango? ( >=x11-libs/pango-1.21 ) +" +DEPEND="${CDEPEND} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" +# Block due bug #383067 +RDEPEND="${CDEPEND} + virtual/udev + !<sys-kernel/dracut-0.37-r3 +" + +DOC_CONTENTS=" + Follow the following instructions to set up Plymouth:\n + https://wiki.gentoo.org/wiki/Plymouth#Configuration +" + +PATCHES=( + "${FILESDIR}"/0.9.3-glibc-sysmacros.patch +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + local myconf=( + --with-system-root-install=no + --localstatedir=/var + --without-rhgb-compat-link + --enable-documentation + --enable-systemd-integration + --with-systemdunitdir="$(systemd_get_systemunitdir)" + $(use_enable !static-libs shared) + $(use_enable static-libs static) + $(use_enable debug tracing) + $(use_enable gtk gtk) + $(use_enable libkms drm) + $(use_enable pango) + $(use_enable gdm gdm-transition) + ) + econf "${myconf[@]}" +} + +src_install() { + default + + insinto /usr/share/plymouth + newins "${DISTDIR}"/gentoo-logo.png bizcom.png + + # Install compatibility symlinks as some rdeps hardcode the paths + dosym /usr/bin/plymouth /bin/plymouth + dosym /usr/sbin/plymouth-set-default-theme /sbin/plymouth-set-default-theme + dosym /usr/sbin/plymouthd /sbin/plymouthd + + readme.gentoo_create_doc + + # looks like make install create /var/run/plymouth + # this is not needed for systemd, same should hold for openrc + # so remove + rm -rf "${D}"/var/run +} + +pkg_postinst() { + readme.gentoo_print_elog + if ! has_version "sys-kernel/dracut" && ! has_version "sys-kernel/genkernel-next[plymouth]"; then + ewarn "If you want initramfs builder with plymouth support, please emerge" + ewarn "sys-kernel/dracut or sys-kernel/genkernel-next[plymouth]." + fi +} diff --git a/sys-boot/plymouth/plymouth-0.9.3-r2.ebuild b/sys-boot/plymouth/plymouth-0.9.3-r2.ebuild new file mode 100644 index 000000000000..5ffedf306a90 --- /dev/null +++ b/sys-boot/plymouth/plymouth-0.9.3-r2.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit flag-o-matic +SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://anongit.freedesktop.org/git/plymouth" +else + SRC_URI="${SRC_URI} https://www.freedesktop.org/software/plymouth/releases/${P}.tar.xz" + KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86" +fi + +inherit autotools readme.gentoo-r1 systemd toolchain-funcs + +DESCRIPTION="Graphical boot animation (splash) and logger" +HOMEPAGE="https://cgit.freedesktop.org/plymouth/" + +LICENSE="GPL-2" +SLOT="0" +IUSE="debug gdm +gtk +libkms +pango static-libs" + +CDEPEND=" + >=media-libs/libpng-1.2.16:= + gtk? ( + dev-libs/glib:2 + >=x11-libs/gtk+-3.14:3 + x11-libs/cairo + ) + libkms? ( x11-libs/libdrm[libkms] ) + pango? ( >=x11-libs/pango-1.21 ) +" +DEPEND="${CDEPEND} + elibc_musl? ( sys-libs/rpmatch-standalone ) + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" +# Block due bug #383067 +RDEPEND="${CDEPEND} + virtual/udev + !<sys-kernel/dracut-0.37-r3 +" + +DOC_CONTENTS=" + Follow the following instructions to set up Plymouth:\n + https://wiki.gentoo.org/wiki/Plymouth#Configuration +" + +PATCHES=( + "${FILESDIR}"/0.9.3-glibc-sysmacros.patch +) + +src_prepare() { + use elibc_musl && append-ldflags -lrpmatch + default + eautoreconf +} + +src_configure() { + local myconf=( + --with-system-root-install=no + --localstatedir=/var + --without-rhgb-compat-link + --enable-documentation + --enable-systemd-integration + --with-systemdunitdir="$(systemd_get_systemunitdir)" + $(use_enable !static-libs shared) + $(use_enable static-libs static) + $(use_enable debug tracing) + $(use_enable gtk gtk) + $(use_enable libkms drm) + $(use_enable pango) + $(use_enable gdm gdm-transition) + ) + econf "${myconf[@]}" +} + +src_install() { + default + + insinto /usr/share/plymouth + newins "${DISTDIR}"/gentoo-logo.png bizcom.png + + # Install compatibility symlinks as some rdeps hardcode the paths + dosym /usr/bin/plymouth /bin/plymouth + dosym /usr/sbin/plymouth-set-default-theme /sbin/plymouth-set-default-theme + dosym /usr/sbin/plymouthd /sbin/plymouthd + + readme.gentoo_create_doc + + # looks like make install create /var/run/plymouth + # this is not needed for systemd, same should hold for openrc + # so remove + rm -rf "${D}"/var/run +} + +pkg_postinst() { + readme.gentoo_print_elog + if ! has_version "sys-kernel/dracut" && ! has_version "sys-kernel/genkernel-next[plymouth]"; then + ewarn "If you want initramfs builder with plymouth support, please emerge" + ewarn "sys-kernel/dracut or sys-kernel/genkernel-next[plymouth]." + fi +} diff --git a/sys-boot/plymouth/plymouth-0.9.4-r1.ebuild b/sys-boot/plymouth/plymouth-0.9.4-r1.ebuild new file mode 100644 index 000000000000..1ade24f98db6 --- /dev/null +++ b/sys-boot/plymouth/plymouth-0.9.4-r1.ebuild @@ -0,0 +1,110 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic +SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://anongit.freedesktop.org/git/plymouth" +else + SRC_URI="${SRC_URI} https://www.freedesktop.org/software/plymouth/releases/${P}.tar.xz" + KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~ppc ~ppc64 ~sparc x86" +fi + +inherit autotools readme.gentoo-r1 systemd toolchain-funcs + +DESCRIPTION="Graphical boot animation (splash) and logger" +HOMEPAGE="https://cgit.freedesktop.org/plymouth/" + +LICENSE="GPL-2" +SLOT="0" +IUSE="debug gdm +gtk +libkms +pango +split-usr static-libs +udev" + +CDEPEND=" + >=media-libs/libpng-1.2.16:= + gtk? ( + dev-libs/glib:2 + >=x11-libs/gtk+-3.14:3 + x11-libs/cairo + ) + libkms? ( x11-libs/libdrm[libkms] ) + pango? ( >=x11-libs/pango-1.21 ) +" +DEPEND="${CDEPEND} + elibc_musl? ( sys-libs/rpmatch-standalone ) + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" +# Block due bug #383067 +RDEPEND="${CDEPEND} + udev? ( virtual/udev ) + !<sys-kernel/dracut-0.37-r3 +" + +DOC_CONTENTS=" + Follow the following instructions to set up Plymouth:\n + https://wiki.gentoo.org/wiki/Plymouth#Configuration +" + +PATCHES=( + "${FILESDIR}"/0.9.3-glibc-sysmacros.patch +) + +src_prepare() { + use elibc_musl && append-ldflags -lrpmatch + default + eautoreconf +} + +src_configure() { + local myconf=( + --with-system-root-install=no + --localstatedir=/var + --without-rhgb-compat-link + --enable-documentation + --enable-systemd-integration + --with-systemdunitdir="$(systemd_get_systemunitdir)" + $(use_enable !static-libs shared) + $(use_enable static-libs static) + $(use_enable debug tracing) + $(use_enable gtk gtk) + $(use_enable libkms drm) + $(use_enable pango) + $(use_enable gdm gdm-transition) + $(use_with udev) + ) + econf "${myconf[@]}" +} + +src_install() { + default + + insinto /usr/share/plymouth + newins "${DISTDIR}"/gentoo-logo.png bizcom.png + + if use split-usr ; then + # Install compatibility symlinks as some rdeps hardcode the paths + dosym ../usr/bin/plymouth /bin/plymouth + dosym ../usr/sbin/plymouth-set-default-theme /sbin/plymouth-set-default-theme + dosym ../usr/sbin/plymouthd /sbin/plymouthd + fi + + readme.gentoo_create_doc + + # looks like make install create /var/run/plymouth + # this is not needed for systemd, same should hold for openrc + # so remove + rm -rf "${D}"/var/run +} + +pkg_postinst() { + readme.gentoo_print_elog + if ! has_version "sys-kernel/dracut" && ! has_version "sys-kernel/genkernel-next[plymouth]"; then + ewarn "If you want initramfs builder with plymouth support, please emerge" + ewarn "sys-kernel/dracut or sys-kernel/genkernel-next[plymouth]." + fi +} diff --git a/sys-boot/plymouth/plymouth-9999.ebuild b/sys-boot/plymouth/plymouth-9999.ebuild new file mode 100644 index 000000000000..f833e4ef1b55 --- /dev/null +++ b/sys-boot/plymouth/plymouth-9999.ebuild @@ -0,0 +1,108 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic +SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://anongit.freedesktop.org/git/plymouth" +else + SRC_URI="${SRC_URI} https://www.freedesktop.org/software/plymouth/releases/${P}.tar.xz" + KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86" +fi + +inherit autotools readme.gentoo-r1 systemd toolchain-funcs + +DESCRIPTION="Graphical boot animation (splash) and logger" +HOMEPAGE="https://cgit.freedesktop.org/plymouth/" + +LICENSE="GPL-2" +SLOT="0" +IUSE="debug gdm +gtk +libkms +pango static-libs +udev" + +CDEPEND=" + >=media-libs/libpng-1.2.16:= + gtk? ( + dev-libs/glib:2 + >=x11-libs/gtk+-3.14:3 + x11-libs/cairo + ) + libkms? ( x11-libs/libdrm[libkms] ) + pango? ( >=x11-libs/pango-1.21 ) +" +DEPEND="${CDEPEND} + elibc_musl? ( sys-libs/rpmatch-standalone ) + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" +# Block due bug #383067 +RDEPEND="${CDEPEND} + udev? ( virtual/udev ) + !<sys-kernel/dracut-0.37-r3 +" + +DOC_CONTENTS=" + Follow the following instructions to set up Plymouth:\n + https://wiki.gentoo.org/wiki/Plymouth#Configuration +" + +PATCHES=( + "${FILESDIR}"/0.9.3-glibc-sysmacros.patch +) + +src_prepare() { + use elibc_musl && append-ldflags -lrpmatch + default + eautoreconf +} + +src_configure() { + local myconf=( + --with-system-root-install=no + --localstatedir=/var + --without-rhgb-compat-link + --enable-documentation + --enable-systemd-integration + --with-systemdunitdir="$(systemd_get_systemunitdir)" + $(use_enable !static-libs shared) + $(use_enable static-libs static) + $(use_enable debug tracing) + $(use_enable gtk gtk) + $(use_enable libkms drm) + $(use_enable pango) + $(use_enable gdm gdm-transition) + $(use_with udev) + ) + econf "${myconf[@]}" +} + +src_install() { + default + + insinto /usr/share/plymouth + newins "${DISTDIR}"/gentoo-logo.png bizcom.png + + # Install compatibility symlinks as some rdeps hardcode the paths + dosym ../usr/bin/plymouth /bin/plymouth + dosym ..../usr/sbin/plymouth-set-default-theme /sbin/plymouth-set-default-theme + dosym ../usr/sbin/plymouthd /sbin/plymouthd + + readme.gentoo_create_doc + + # looks like make install create /var/run/plymouth + # this is not needed for systemd, same should hold for openrc + # so remove + rm -rf "${D}"/var/run +} + +pkg_postinst() { + readme.gentoo_print_elog + if ! has_version "sys-kernel/dracut" && ! has_version "sys-kernel/genkernel-next[plymouth]"; then + ewarn "If you want initramfs builder with plymouth support, please emerge" + ewarn "sys-kernel/dracut or sys-kernel/genkernel-next[plymouth]." + fi +} diff --git a/sys-boot/raspberrypi-firmware/Manifest b/sys-boot/raspberrypi-firmware/Manifest new file mode 100644 index 000000000000..2570229caf31 --- /dev/null +++ b/sys-boot/raspberrypi-firmware/Manifest @@ -0,0 +1,3 @@ +DIST raspberrypi-firmware-1.20190215.tar.gz 123074917 BLAKE2B cefedb5c979db7dfd47938aad37a567d91d3ad78247c7a63f789362768ab7a39a1967ac116b4b0475e3b210ab11f6474706df042af85a622e8e7905c85ec7498 SHA512 082f26caf427222d838881e5f1e9fa0136765b3eaf74a84877fc33616fd07e49085db0889226c40c655039a9d41a10566510c7d752cfc48a67b4683616a51193 +DIST raspberrypi-firmware-1.20190709.tar.gz 158835870 BLAKE2B 4e63b3308adcd75f69f66966f1c927449aa8dc65211e6ca5a27dd2a0ed6ed32cc85ad42221308f4fb3a852d9f278400cfe4f723f306abe102341568408027174 SHA512 6a0610c97db47441ede8e4f8436958899f678bf065a0fbde06de7945a1ac4d5f754a0e10d928d77759ba1cbf82654d85d9cb9c91b970c3fe9590560267033522 +DIST raspberrypi-firmware-1.20190925.tar.gz 185571086 BLAKE2B c3a9b2760fa853fbd1dd09bc4048c9e78594f88da5af608c3a761554d4046a4c869db8981c64140a24e82e0a61b8dc776bb8d895df60c6424e44780f78b18cb0 SHA512 4b7b29cc6c2a33d7a37987c492034d9afbb2220364c50cf265e0adf8e5f393c2275dcffaa77c89b3f43b2e98d199741b67590cb60ff8beae8ef677852f63b4a0 diff --git a/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-cmdline.txt b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-cmdline.txt new file mode 100644 index 000000000000..39112a2dba61 --- /dev/null +++ b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-cmdline.txt @@ -0,0 +1 @@ +ipv6.disable=0 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=noop rootwait diff --git a/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-config.txt b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-config.txt new file mode 100644 index 000000000000..9401530925de --- /dev/null +++ b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-config.txt @@ -0,0 +1,81 @@ +#from archlinux arm sdcard image +# uncomment if you get no picture on HDMI for a default "safe" mode +#hdmi_safe=1 + +# uncomment this if your display has a black border of unused pixels visible +# and your display can output without overscan +#disable_overscan=1 + +# uncomment the following to adjust overscan. Use positive numbers if console +# goes off screen, and negative if there is too much border +#overscan_left=16 +#overscan_right=16 +#overscan_top=16 +#overscan_bottom=16 + +# uncomment to force a console size. By default it will be display's size minus +# overscan. +#framebuffer_width=1280 +#framebuffer_height=720 + +# uncomment if hdmi display is not detected and composite is being output +#hdmi_force_hotplug=1 + +# uncomment to force a specific HDMI mode (this will force VGA) +#hdmi_group=1 +#hdmi_mode=1 + +# uncomment to force a HDMI mode rather than DVI. This can make audio work in +# DMT (computer monitor) modes +#hdmi_drive=2 + +# uncomment to increase signal to HDMI, if you have interference, blanking, or +# no display +#config_hdmi_boost=4 + +# uncomment for composite PAL +#sdtv_mode=2 + +#uncomment to overclock the arm. 700 MHz is the default. +#arm_freq=800 + +# for more options see http://elinux.org/RPi_config.txt + +## Some over clocking settings, govenor already set to ondemand + +##None +#arm_freq=700 +#core_freq=250 +#sdram_freq=400 +#over_voltage=0 + +##Modest +#arm_freq=800 +#core_freq=300 +#sdram_freq=400 +#over_voltage=0 + +##Medium +#arm_freq=900 +#core_freq=333 +#sdram_freq=450 +#over_voltage=2 + +##High +#arm_freq=950 +#core_freq=450 +#sdram_freq=450 +#over_voltage=6 + +##Turbo +#arm_freq=1000 +#core_freq=500 +#sdram_freq=500 +#over_voltage=6 + +gpu_mem_512=316 +gpu_mem_256=128 +cma_lwm=16 +cma_hwm=32 +cma_offline_start=16 + diff --git a/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-envd b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-envd new file mode 100644 index 000000000000..22ed09320464 --- /dev/null +++ b/sys-boot/raspberrypi-firmware/files/raspberrypi-firmware-0_p20130711-envd @@ -0,0 +1,2 @@ +CONFIG_PROTECT="/boot/config.txt /boot/cmdline.txt" + diff --git a/sys-boot/raspberrypi-firmware/metadata.xml b/sys-boot/raspberrypi-firmware/metadata.xml new file mode 100644 index 000000000000..130e25f2559d --- /dev/null +++ b/sys-boot/raspberrypi-firmware/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>andrey_utkin@gentoo.org</email> + <name>Andrey Utkin</name> + </maintainer> + <upstream> + <remote-id type="github">raspberrypi/firmware</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20190215.ebuild b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20190215.ebuild new file mode 100644 index 000000000000..4b06dfa49939 --- /dev/null +++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20190215.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit mount-boot readme.gentoo-r1 + +DESCRIPTION="Raspberry Pi (all versions) bootloader and GPU firmware" +HOMEPAGE="https://github.com/raspberrypi/firmware" +LICENSE="GPL-2 raspberrypi-videocore-bin" +SLOT="0" + +if [[ "${PV}" == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/raspberrypi/firmware" + EGIT_CLONE_TYPE="shallow" +else + SRC_URI="https://github.com/raspberrypi/firmware/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="-* ~arm" + S="${WORKDIR}/firmware-${PV}" +fi + +RESTRICT="binchecks strip" + +pkg_preinst() { + if [ -z "${REPLACING_VERSIONS}" ] ; then + local msg="" + if [ -e "${D}"/boot/cmdline.txt -a -e /boot/cmdline.txt ] ; then + msg+="/boot/cmdline.txt " + fi + if [ -e "${D}"/boot/config.txt -a -e /boot/config.txt ] ; then + msg+="/boot/config.txt " + fi + if [ -n "${msg}" ] ; then + msg="This package installs following files: ${msg}." + msg="${msg} Please remove(backup) your copies durning install" + msg="${msg} and merge settings afterwards." + msg="${msg} Further updates will be CONFIG_PROTECTed." + die "${msg}" + fi + fi +} + +src_install() { + insinto /boot + cd boot || die + doins bootcode.bin fixup*.dat start*elf + doins *.dtb + doins -r overlays + newins "${FILESDIR}"/${PN}-0_p20130711-config.txt config.txt + newins "${FILESDIR}"/${PN}-0_p20130711-cmdline.txt cmdline.txt + newenvd "${FILESDIR}"/${PN}-0_p20130711-envd 90${PN} + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog +} + +DOC_CONTENTS="Please configure your ram setup by editing /boot/config.txt" diff --git a/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20190709.ebuild b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20190709.ebuild new file mode 100644 index 000000000000..4b06dfa49939 --- /dev/null +++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20190709.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit mount-boot readme.gentoo-r1 + +DESCRIPTION="Raspberry Pi (all versions) bootloader and GPU firmware" +HOMEPAGE="https://github.com/raspberrypi/firmware" +LICENSE="GPL-2 raspberrypi-videocore-bin" +SLOT="0" + +if [[ "${PV}" == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/raspberrypi/firmware" + EGIT_CLONE_TYPE="shallow" +else + SRC_URI="https://github.com/raspberrypi/firmware/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="-* ~arm" + S="${WORKDIR}/firmware-${PV}" +fi + +RESTRICT="binchecks strip" + +pkg_preinst() { + if [ -z "${REPLACING_VERSIONS}" ] ; then + local msg="" + if [ -e "${D}"/boot/cmdline.txt -a -e /boot/cmdline.txt ] ; then + msg+="/boot/cmdline.txt " + fi + if [ -e "${D}"/boot/config.txt -a -e /boot/config.txt ] ; then + msg+="/boot/config.txt " + fi + if [ -n "${msg}" ] ; then + msg="This package installs following files: ${msg}." + msg="${msg} Please remove(backup) your copies durning install" + msg="${msg} and merge settings afterwards." + msg="${msg} Further updates will be CONFIG_PROTECTed." + die "${msg}" + fi + fi +} + +src_install() { + insinto /boot + cd boot || die + doins bootcode.bin fixup*.dat start*elf + doins *.dtb + doins -r overlays + newins "${FILESDIR}"/${PN}-0_p20130711-config.txt config.txt + newins "${FILESDIR}"/${PN}-0_p20130711-cmdline.txt cmdline.txt + newenvd "${FILESDIR}"/${PN}-0_p20130711-envd 90${PN} + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog +} + +DOC_CONTENTS="Please configure your ram setup by editing /boot/config.txt" diff --git a/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20190925.ebuild b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20190925.ebuild new file mode 100644 index 000000000000..3b499cf2ad55 --- /dev/null +++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-1.20190925.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit mount-boot readme.gentoo-r1 + +DESCRIPTION="Raspberry Pi (all versions) bootloader and GPU firmware" +HOMEPAGE="https://github.com/raspberrypi/firmware" +LICENSE="GPL-2 raspberrypi-videocore-bin" +SLOT="0" + +# Temporary safety measure to prevent ending up with a pair of +# sys-kernel/raspberrypi-image and sys-boot/raspberrypi-firmware +# none of which installed device tree files. +# Remove when the mentioned version and all older ones are deleted. +RDEPEND="!<=sys-kernel/raspberrypi-image-4.19.57_p20190709" + +if [[ "${PV}" == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/raspberrypi/firmware" + EGIT_CLONE_TYPE="shallow" +else + SRC_URI="https://github.com/raspberrypi/firmware/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="-* ~arm ~arm64" + S="${WORKDIR}/firmware-${PV}" +fi + +RESTRICT="binchecks strip" + +pkg_preinst() { + if [ -z "${REPLACING_VERSIONS}" ] ; then + local msg="" + if [ -e "${D}"/boot/cmdline.txt -a -e /boot/cmdline.txt ] ; then + msg+="/boot/cmdline.txt " + fi + if [ -e "${D}"/boot/config.txt -a -e /boot/config.txt ] ; then + msg+="/boot/config.txt " + fi + if [ -n "${msg}" ] ; then + msg="This package installs following files: ${msg}." + msg="${msg} Please remove(backup) your copies durning install" + msg="${msg} and merge settings afterwards." + msg="${msg} Further updates will be CONFIG_PROTECTed." + die "${msg}" + fi + fi +} + +src_install() { + insinto /boot + cd boot || die + doins bootcode.bin fixup*.dat start*elf + newins "${FILESDIR}"/${PN}-0_p20130711-config.txt config.txt + newins "${FILESDIR}"/${PN}-0_p20130711-cmdline.txt cmdline.txt + newenvd "${FILESDIR}"/${PN}-0_p20130711-envd 90${PN} + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog +} + +DOC_CONTENTS="Please configure your ram setup by editing /boot/config.txt" diff --git a/sys-boot/raspberrypi-firmware/raspberrypi-firmware-9999.ebuild b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-9999.ebuild new file mode 100644 index 000000000000..3b499cf2ad55 --- /dev/null +++ b/sys-boot/raspberrypi-firmware/raspberrypi-firmware-9999.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit mount-boot readme.gentoo-r1 + +DESCRIPTION="Raspberry Pi (all versions) bootloader and GPU firmware" +HOMEPAGE="https://github.com/raspberrypi/firmware" +LICENSE="GPL-2 raspberrypi-videocore-bin" +SLOT="0" + +# Temporary safety measure to prevent ending up with a pair of +# sys-kernel/raspberrypi-image and sys-boot/raspberrypi-firmware +# none of which installed device tree files. +# Remove when the mentioned version and all older ones are deleted. +RDEPEND="!<=sys-kernel/raspberrypi-image-4.19.57_p20190709" + +if [[ "${PV}" == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/raspberrypi/firmware" + EGIT_CLONE_TYPE="shallow" +else + SRC_URI="https://github.com/raspberrypi/firmware/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="-* ~arm ~arm64" + S="${WORKDIR}/firmware-${PV}" +fi + +RESTRICT="binchecks strip" + +pkg_preinst() { + if [ -z "${REPLACING_VERSIONS}" ] ; then + local msg="" + if [ -e "${D}"/boot/cmdline.txt -a -e /boot/cmdline.txt ] ; then + msg+="/boot/cmdline.txt " + fi + if [ -e "${D}"/boot/config.txt -a -e /boot/config.txt ] ; then + msg+="/boot/config.txt " + fi + if [ -n "${msg}" ] ; then + msg="This package installs following files: ${msg}." + msg="${msg} Please remove(backup) your copies durning install" + msg="${msg} and merge settings afterwards." + msg="${msg} Further updates will be CONFIG_PROTECTed." + die "${msg}" + fi + fi +} + +src_install() { + insinto /boot + cd boot || die + doins bootcode.bin fixup*.dat start*elf + newins "${FILESDIR}"/${PN}-0_p20130711-config.txt config.txt + newins "${FILESDIR}"/${PN}-0_p20130711-cmdline.txt cmdline.txt + newenvd "${FILESDIR}"/${PN}-0_p20130711-envd 90${PN} + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog +} + +DOC_CONTENTS="Please configure your ram setup by editing /boot/config.txt" diff --git a/sys-boot/refind/Manifest b/sys-boot/refind/Manifest new file mode 100644 index 000000000000..698924ad273f --- /dev/null +++ b/sys-boot/refind/Manifest @@ -0,0 +1,2 @@ +DIST refind-src-0.11.4.tar.gz 3812192 BLAKE2B 7219eeffffb63961a7ba8f7617546a12021cfe80df80a83c4dbd47cd40b0d8afbdc510abb44de3029ff15ed49372bd59e0b156f4c27eab3ef7bd6ccc3c7e02db SHA512 529962ae432edaf1895ba98deb00a23c66bd742578e1a367f70f7ed22dd7be7daf1960df8af410fba79ca775169120499a4c10119331b2b12b55a002d4354de1 +DIST refind-src-0.12.0.tar.gz 3898337 BLAKE2B 1197049fb7d91db64135dafda7488bdb1da4997ce6a6d49dfe635526240e3193d8c7c22597aee0f2d6754ce6061b4127d8aa21d43c9f061501de98e25de609d3 SHA512 3ade9642d7acf31097daa5308acb96a9fa3371314073b5a09601a886fc30444752efa08ed9fb35e421efb0b4eb9efbccd7b5c9bd6b3b9ed4af74c58f22a74729 diff --git a/sys-boot/refind/files/makefile.patch b/sys-boot/refind/files/makefile.patch new file mode 100644 index 000000000000..5db6f75b1919 --- /dev/null +++ b/sys-boot/refind/files/makefile.patch @@ -0,0 +1,27 @@ +diff --git a/Makefile b/Makefile +--- a/Makefile ++++ b/Makefile +@@ -161,8 +161,9 @@ fs_edk2: build_edk2 + done + + build_edk2: $(EDK2BASE)/RefindPkg +- cd $(EDK2BASE) && \ +- . ./edksetup.sh BaseTools && \ ++ +cd $(EDK2BASE) && \ ++ . udk-workspace && \ ++ build -a $(UC_ARCH) -p MdePkg/MdePkg.dsc && \ + build -a $(UC_ARCH) -p RefindPkg/RefindPkg.dsc + mkdir -p ./drivers_$(FILENAME_CODE) + +diff --git a/filesystems/Makefile b/filesystems/Makefile +index 99452ed..9bc984d 100644 +--- a/filesystems/Makefile ++++ b/filesystems/Makefile +@@ -5,6 +5,7 @@ + # name of the driver to be built. This is done because of a dependency + # in the fsw_efi.c file on the filesystem type; this file must be + # recompiled for each new filesystem built. ++.NOTPARALLEL: + + # This program is licensed under the terms of the GNU GPL, version 3, + # or (at your option) any later version. diff --git a/sys-boot/refind/metadata.xml b/sys-boot/refind/metadata.xml new file mode 100644 index 000000000000..20f5241a3d02 --- /dev/null +++ b/sys-boot/refind/metadata.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>sveyret@gmail.com</email> + <name>Stéphane Veyret</name> + </maintainer> + <maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <longdescription lang="en"> +A graphical boot manager for EFI- and UEFI-based computers, such as all +Intel-based Macs and recent (most 2011 and later) PCs. rEFInd presents a +boot menu showing all the EFI boot loaders on the EFI-accessible +partitions, and optionally BIOS-bootable partitions on Macs and BIOS boot +entries on UEFI PCs with CSMs. EFI-compatbile OSes, including Linux, +provide boot loaders that rEFInd can detect and launch. rEFInd can launch +Linux EFI boot loaders such as ELILO, GRUB Legacy, GRUB 2, and 3.3.0 and +later kernels with EFI stub support. EFI filesystem drivers for ext2/3/4fs, +ReiserFS, Btrfs, NTFS, HFS+, and ISO-9660 enable rEFInd to read boot +loaders from these filesystems, too. rEFInd's ability to detect boot +loaders at runtime makes it very easy to use, particularly when paired with +Linux kernels that provide EFI stub support. + </longdescription> + <longdescription lang="fr"> +Un gestionnaire d'amorçage pour ordinateur EFI ou UEFI tel que tous les Macs +contenant un processeur Intel et les PC récents (2011 et après). rEFInd affiche +un menu d'amorçage montrant tous les gestionnaires d'amorçage sur les +partitions EFI accessibles et optionnellement les partitions amorçable en BIOS +sur Macs et les entrées BIOS sur les PC UEFI avec CSM. Les systèmes +d'exploitation compatibles EFI, incluant Linux, fournissent des gestionnaires +d'amorçage que rEFInd détecte et démarre. rEFInd peut démarrer les +gestionnaires d'amorçage EFI Linux tel que ELILO, GRUB Legacy, GRUB 2 ainsi que +les noyaux 3.3.0 et suivants avec le support EFI stub. Les pilotes EFI pour les +sytèmes de fichiers ext2/3/4fs, ReiserFS, Btrfs, NTFS, HFS+ et ISO-9660 +permettent à rEFInd de lire les gestionnaires d'amorçage également depuis ces +systèmes de fichiers. La capacité de rEFInd à détecter les gestionnaires +d'amorçage au moment de l'exécution le rend très facile à utiliser, en +particulier associé à des noyau Linux qui fournissent un support EFI stub. + </longdescription> + <use lang="en"> + <flag name="ext2">Builds the EFI binary ext2 filesystem driver</flag> + <flag name="ext4">Builds the EFI binary ext4 filesystem driver</flag> + <flag name="reiserfs">Builds the EFI binary reiserfs filesystem driver</flag> + <flag name="iso9660">Builds the EFI binary iso9660 filesystem driver</flag> + <flag name="hfs">Builds the EFI binary hfs filesystem driver</flag> + <flag name="btrfs">Builds the EFI binary btrfs filesystem driver</flag> + <flag name="ntfs">Builds the EFI binary ntfs filesystem driver</flag> + <flag name="gnuefi">Compile using GNU-EFI instead of Tianocore</flag> + </use> + <use lang="fr"> + <flag name="ext2">Construire le gestionnaire EFI pour le système de fichier ext2</flag> + <flag name="ext4">Construire le gestionnaire EFI pour le système de fichier ext4</flag> + <flag name="reiserfs">Construire le gestionnaire EFI pour le système de fichier reiserfs</flag> + <flag name="iso9660">Construire le gestionnaire EFI pour le système de fichier iso9660</flag> + <flag name="hfs">Construire le gestionnaire EFI pour le système de fichier hfs</flag> + <flag name="btrfs">Construire le gestionnaire EFI pour le système de fichier btrfs</flag> + <flag name="ntfs">Construire le gestionnaire EFI pour le système de fichier ntfs</flag> + <flag name="gnuefi">Compiler en utilisant GNU-EFI au lieu de Tianocore</flag> + </use> + <upstream> + <remote-id type="sourceforge">refind</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/refind/refind-0.11.4.ebuild b/sys-boot/refind/refind-0.11.4.ebuild new file mode 100644 index 000000000000..139bf622501d --- /dev/null +++ b/sys-boot/refind/refind-0.11.4.ebuild @@ -0,0 +1,168 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit multiprocessing toolchain-funcs + +DESCRIPTION="The UEFI Boot Manager by Rod Smith" +HOMEPAGE="https://www.rodsbooks.com/refind/" +SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz" + +LICENSE="BSD GPL-2 GPL-3 FDL-1.3" +SLOT="0" +KEYWORDS="amd64 x86" +FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs" +IUSE="${FS_USE} custom-cflags doc gnuefi" + +DEPEND="gnuefi? ( >=sys-boot/gnu-efi-3.0.2 ) + !gnuefi? ( >=sys-boot/udk-2018-r1 )" + +DOCS=(README.txt) +PATCHES=("${FILESDIR}/makefile.patch") +UDK_WORKSPACE="${T}/udk" + +pkg_pretend() { + if use custom-cflags; then + ewarn + ewarn "You have enabled building with USE=custom-cflags. Be aware that" + ewarn "using this can result in EFI binaries that fail to run and may" + ewarn "fail to build at all. This is strongly advised against by upstream." + ewarn + ewarn "See https://bugs.gentoo.org/598587#c3 for more information" + ewarn + fi +} + +pkg_setup() { + if use x86; then + export EFIARCH=ia32 + export BUILDARCH=ia32 + elif use amd64; then + export EFIARCH=x64 + export BUILDARCH=x86_64 + fi +} + +src_prepare() { + default + + # bug 598647 - PIE not supported + sed -e '/^CFLAGS/s:$: -fno-PIE:' -i Make.common || die + + # Prepare UDK workspace + if ! use gnuefi; then + mkdir "${UDK_WORKSPACE}" || die + ln -s "${EPREFIX}/usr/lib/udk/"{Mde,IntelFramework}{,Module}Pkg \ + "${UDK_WORKSPACE}" || die "Could not link UDK files" + fi +} + +src_configure() { + if ! use gnuefi; then + # Use the side effect of the script which will create configuration files + (. udk-workspace "${UDK_WORKSPACE}" || die) + sed -e "s:^#\?\s*\(MAX_CONCURRENT_THREAD_NUMBER\s*=\).*$:\1 $(makeopts_jobs):" \ + -i "${UDK_WORKSPACE}/Conf/target.txt" || die "Failed to configure target file" + sed -e "s:\(_\(CC\|ASM\|PP\|VFRPP\|ASLCC\|ASLPP\|DLINK\)_PATH\s*=\).*$:\1 $(tc-getCC):" \ + -e "s:\(_ASLDLINK_PATH\s*=\).*$:\1 $(tc-getLD):" \ + -e "s:\(_OBJCOPY_PATH\s*=\).*$:\1 $(tc-getOBJCOPY):" \ + -e "s:\(_RC_PATH\s*=\).*$:\1 $(tc-getOBJCOPY):" \ + -e "s:\(_SLINK_PATH\s*=\).*$:\1 $(tc-getAR):" \ + -e "s:-Werror::" \ + -i "${UDK_WORKSPACE}/Conf/tools_def.txt" \ + || die "Failed to prepare tools definition file" + fi +} + +src_compile() { + # Update fs targets depending on uses + local fs fs_names=() + for fs in ${FS_USE}; do + fs=${fs#+} + if use "${fs}"; then + fs_names+=(${fs}) + fi + done + use gnuefi && fs_names=("${fs_names[@]/%/_gnuefi}") + + # Prepare flags + local make_flags=( + ARCH="${BUILDARCH}" + CC="$(tc-getCC)" + AS="$(tc-getAS)" + LD="$(tc-getLD)" + AR="$(tc-getAR)" + RANLIB="$(tc-getRANLIB)" + OBJCOPY="$(tc-getOBJCOPY)" + GNUEFILIB="/usr/$(get_libdir)" + EFILIB="/usr/$(get_libdir)" + EFICRT0="/usr/$(get_libdir)" + EDK2BASE="${UDK_WORKSPACE}" + EDK2_DRIVER_BASENAMES="${fs_names[@]}" + FILESYSTEMS="${fs_names[@]}" + FILESYSTEMS_GNUEFI="${fs_names[@]}" + ) + if use custom-cflags; then + make_flags=(CFLAGS="${CFLAGS}" "${make_flags[@]}") + fi + + emake "${make_flags[@]}" all_$(usex gnuefi gnuefi edk2) +} + +src_install() { + exeinto "/usr/lib/${PN}" + doexe refind-install + dosym "../lib/${PN}/refind-install" "/usr/sbin/refind-install" + + if use doc; then + doman "docs/man/"* + DOCS+=(NEWS.txt docs/refind docs/Styles) + fi + einstalldocs + + insinto "/usr/lib/${PN}/refind" + doins "refind/refind_${EFIARCH}.efi" + doins "refind.conf-sample" + doins -r images icons fonts banners + + if [[ -d "drivers_${EFIARCH}" ]]; then + doins -r "drivers_${EFIARCH}" + fi + + insinto "/usr/lib/${PN}/refind/tools_${EFIARCH}" + doins "gptsync/gptsync_${EFIARCH}.efi" + + insinto "/etc/refind.d" + doins -r "keys" + + dosbin "mkrlconf" + dosbin "mvrefind" + dosbin "refind-mkdefault" +} + +pkg_postinst() { + elog "rEFInd has been built and installed into ${EROOT}/usr/lib/${PN}" + elog "You will need to use the command 'refind-install' to install" + elog "the binaries into your EFI System Partition" + elog "" + if [[ -z "${REPLACING_VERSIONS}" ]]; then + elog "refind-install requires additional packages to be fully functional:" + elog " app-crypt/sbsigntools for binary signing for use with SecureBoot" + elog " sys-boot/efibootmgr for writing to NVRAM" + elog " sys-block/parted for automatic ESP location and mount" + elog "" + elog "refind-mkdefault requires >=dev-lang/python-3" + elog "" + elog "A sample configuration can be found at" + elog "${EROOT}/usr/lib/${PN}/refind/refind.conf-sample" + else + if ver_test "${REPLACING_VERSIONS}" -lt "0.10.3"; then + elog "The new refind-mkdefault script requires >=dev-lang/python-3" + elog "to be installed" + elog "" + fi + ewarn "Note that this installation will not update any EFI binaries" + ewarn "on your EFI System Partition - this needs to be done manually" + fi +} diff --git a/sys-boot/refind/refind-0.12.0.ebuild b/sys-boot/refind/refind-0.12.0.ebuild new file mode 100644 index 000000000000..9091a88cfcb1 --- /dev/null +++ b/sys-boot/refind/refind-0.12.0.ebuild @@ -0,0 +1,168 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit multiprocessing toolchain-funcs + +DESCRIPTION="The UEFI Boot Manager by Rod Smith" +HOMEPAGE="https://www.rodsbooks.com/refind/" +SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz" + +LICENSE="BSD GPL-2 GPL-3 FDL-1.3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs" +IUSE="${FS_USE} custom-cflags doc gnuefi" + +DEPEND="gnuefi? ( >=sys-boot/gnu-efi-3.0.2 ) + !gnuefi? ( >=sys-boot/udk-2018-r1 )" + +DOCS=(README.txt) +PATCHES=("${FILESDIR}/makefile.patch") +UDK_WORKSPACE="${T}/udk" + +pkg_pretend() { + if use custom-cflags; then + ewarn + ewarn "You have enabled building with USE=custom-cflags. Be aware that" + ewarn "using this can result in EFI binaries that fail to run and may" + ewarn "fail to build at all. This is strongly advised against by upstream." + ewarn + ewarn "See https://bugs.gentoo.org/598587#c3 for more information" + ewarn + fi +} + +pkg_setup() { + if use x86; then + export EFIARCH=ia32 + export BUILDARCH=ia32 + elif use amd64; then + export EFIARCH=x64 + export BUILDARCH=x86_64 + fi +} + +src_prepare() { + default + + # bug 598647 - PIE not supported + sed -e '/^CFLAGS/s:$: -fno-PIE:' -i Make.common || die + + # Prepare UDK workspace + if ! use gnuefi; then + mkdir "${UDK_WORKSPACE}" || die + ln -s "${EPREFIX}/usr/lib/udk/"{Mde,IntelFramework}{,Module}Pkg \ + "${UDK_WORKSPACE}" || die "Could not link UDK files" + fi +} + +src_configure() { + if ! use gnuefi; then + # Use the side effect of the script which will create configuration files + (. udk-workspace "${UDK_WORKSPACE}" || die) + sed -e "s:^#\?\s*\(MAX_CONCURRENT_THREAD_NUMBER\s*=\).*$:\1 $(makeopts_jobs):" \ + -i "${UDK_WORKSPACE}/Conf/target.txt" || die "Failed to configure target file" + sed -e "s:\(_\(CC\|ASM\|PP\|VFRPP\|ASLCC\|ASLPP\|DLINK\)_PATH\s*=\).*$:\1 $(tc-getCC):" \ + -e "s:\(_ASLDLINK_PATH\s*=\).*$:\1 $(tc-getLD):" \ + -e "s:\(_OBJCOPY_PATH\s*=\).*$:\1 $(tc-getOBJCOPY):" \ + -e "s:\(_RC_PATH\s*=\).*$:\1 $(tc-getOBJCOPY):" \ + -e "s:\(_SLINK_PATH\s*=\).*$:\1 $(tc-getAR):" \ + -e "s:-Werror::" \ + -i "${UDK_WORKSPACE}/Conf/tools_def.txt" \ + || die "Failed to prepare tools definition file" + fi +} + +src_compile() { + # Update fs targets depending on uses + local fs fs_names=() + for fs in ${FS_USE}; do + fs=${fs#+} + if use "${fs}"; then + fs_names+=(${fs}) + fi + done + use gnuefi && fs_names=("${fs_names[@]/%/_gnuefi}") + + # Prepare flags + local make_flags=( + ARCH="${BUILDARCH}" + CC="$(tc-getCC)" + AS="$(tc-getAS)" + LD="$(tc-getLD)" + AR="$(tc-getAR)" + RANLIB="$(tc-getRANLIB)" + OBJCOPY="$(tc-getOBJCOPY)" + GNUEFILIB="/usr/$(get_libdir)" + EFILIB="/usr/$(get_libdir)" + EFICRT0="/usr/$(get_libdir)" + EDK2BASE="${UDK_WORKSPACE}" + EDK2_DRIVER_BASENAMES="${fs_names[@]}" + FILESYSTEMS="${fs_names[@]}" + FILESYSTEMS_GNUEFI="${fs_names[@]}" + ) + if use custom-cflags; then + make_flags=(CFLAGS="${CFLAGS}" "${make_flags[@]}") + fi + + emake "${make_flags[@]}" all_$(usex gnuefi gnuefi edk2) +} + +src_install() { + exeinto "/usr/lib/${PN}" + doexe refind-install + dosym "../lib/${PN}/refind-install" "/usr/sbin/refind-install" + + if use doc; then + doman "docs/man/"* + DOCS+=(NEWS.txt docs/refind docs/Styles) + fi + einstalldocs + + insinto "/usr/lib/${PN}/refind" + doins "refind/refind_${EFIARCH}.efi" + doins "refind.conf-sample" + doins -r images icons fonts banners + + if [[ -d "drivers_${EFIARCH}" ]]; then + doins -r "drivers_${EFIARCH}" + fi + + insinto "/usr/lib/${PN}/refind/tools_${EFIARCH}" + doins "gptsync/gptsync_${EFIARCH}.efi" + + insinto "/etc/refind.d" + doins -r "keys" + + dosbin "mkrlconf" + dosbin "mvrefind" + dosbin "refind-mkdefault" +} + +pkg_postinst() { + elog "rEFInd has been built and installed into ${EROOT}/usr/lib/${PN}" + elog "You will need to use the command 'refind-install' to install" + elog "the binaries into your EFI System Partition" + elog "" + elog "refind-install requires additional packages to be fully functional:" + elog " app-crypt/sbsigntools for binary signing for use with SecureBoot" + elog " sys-boot/efibootmgr for writing to NVRAM" + elog " sys-apps/gptfdisk for ESP management" + elog "" + elog "refind-mkdefault requires >=dev-lang/python-3" + elog "" + if [[ -z "${REPLACING_VERSIONS}" ]]; then + elog "A sample configuration can be found at" + elog "${EROOT}/usr/lib/${PN}/refind/refind.conf-sample" + else + if ver_test "${REPLACING_VERSIONS}" -lt "0.12.0"; then + ewarn "This new version uses sys-apps/gptfdisk instead of sys-block/parted" + ewarn "to manage ESP" + ewarn "" + fi + ewarn "Note that this installation will not update any EFI binaries" + ewarn "on your EFI System Partition - this needs to be done manually" + fi +} diff --git a/sys-boot/sgibootcd/Manifest b/sys-boot/sgibootcd/Manifest new file mode 100644 index 000000000000..828a3fbd7a5b --- /dev/null +++ b/sys-boot/sgibootcd/Manifest @@ -0,0 +1 @@ +DIST sgibootcd-0.12.tar.bz2 3810 BLAKE2B 973c6e01f1e90b9009b57725e59e295e8cbdcc30595735eab1a4cd3929aa71edde66d352bb04b61670eb7ad464916d0e4b83f6fabbc8f641c150edcf96f4985c SHA512 180e4f5a185b14c0b2c8158b368a50a3a55673fa86760e2a424c9533b1bb8ec37824c715ba02fd264621e2e31906ddd310398e9f24cf19147bce3e49fc62da3e diff --git a/sys-boot/sgibootcd/metadata.xml b/sys-boot/sgibootcd/metadata.xml new file mode 100644 index 000000000000..db7016bc1a58 --- /dev/null +++ b/sys-boot/sgibootcd/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>mips@gentoo.org</email> + <name>Mips Team</name> + </maintainer> + + <longdescription> + sgibootcd - Creates a burnable CD image for SGI LiveCDs + </longdescription> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/sgibootcd/sgibootcd-0.12.ebuild b/sys-boot/sgibootcd/sgibootcd-0.12.ebuild new file mode 100644 index 000000000000..c2b3c0449c57 --- /dev/null +++ b/sys-boot/sgibootcd/sgibootcd-0.12.ebuild @@ -0,0 +1,28 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" +inherit eutils toolchain-funcs + +DESCRIPTION="Creates burnable CD images for SGI LiveCDs" +HOMEPAGE="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/" +SRC_URI="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/${P}.tar.bz2" +LICENSE="all-rights-reserved" +SLOT="0" +KEYWORDS="-* ~mips" +IUSE="" +RDEPEND="" +DEPEND="" +RESTRICT="" + +src_compile() { + local mycc="$(tc-getCC) ${CFLAGS}" + + [ -f "${S}/sgibootcd" ] && rm -f "${S}"/sgibootcd + einfo "${mycc} sgibootcd.c -o sgibootcd" + ${mycc} sgibootcd.c -o sgibootcd +} + +src_install() { + dobin "${S}"/sgibootcd +} diff --git a/sys-boot/shim/Manifest b/sys-boot/shim/Manifest new file mode 100644 index 000000000000..1271dd5a569d --- /dev/null +++ b/sys-boot/shim/Manifest @@ -0,0 +1,3 @@ +DIST shim-aa64-15-5.aarch64.rpm 397028 BLAKE2B 4e89dd2029238e9b455c469b2857610bfa0d686c43a6f93b7daa70625317c68552967e6761e2c4912b098880c2ccf04278736ca51b7c2e95bcfc700a716bf69d SHA512 1d27ec70bf8b18777bb38cec6769172bd56aa72e9f910e9fa21039dc1c133ebf789fe46fbfe079df6167c3982f6c47bdcad26d3175d6cf9494f89dc9a8a0c823 +DIST shim-ia32-15-5.x86_64.rpm 1026312 BLAKE2B 42f018888463b0da1edbb2ae7379e63b79cea84208ef7ce069c3753bad2f232cb156d73e16864da279c31e8f8f25daa01d6ccc16a6fd13daa286d88460232f9b SHA512 a5d297265480b6a77f05050ecb31b31d2275df0b2f9bfa5ef1a4851163501f295fb81c142aa9fd30826b9e001f876c3d864b3d7b2f89575e6839f3939bca4755 +DIST shim-x64-15-5.x86_64.rpm 669944 BLAKE2B 25d7fb6a4869212610158313f9b8d55f102d6d4e8fc562a43b4654e29fcdb6cef4ba4421d56afb1ad98b7df1c7fe121558a757f06db86cc391ea0ad3e2f9982e SHA512 4888e9422d71f4f8f05343e8dc161f8e48a31ba28469fe3671ce20283e5f7fced656f2d0583d76532dddecc49c2a8504a504b5da951a1e2c6302bf38fac5048e diff --git a/sys-boot/shim/metadata.xml b/sys-boot/shim/metadata.xml new file mode 100644 index 000000000000..3e555bdf5d89 --- /dev/null +++ b/sys-boot/shim/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>zerochaos@gentoo.org</email> + <name>Rick Farina</name> + </maintainer> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/shim/shim-15.5-r1.ebuild b/sys-boot/shim/shim-15.5-r1.ebuild new file mode 100644 index 000000000000..0cb553a678af --- /dev/null +++ b/sys-boot/shim/shim-15.5-r1.ebuild @@ -0,0 +1,28 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit rpm + +DESCRIPTION="Fedora's signed UEFI shim" +HOMEPAGE="https://apps.fedoraproject.org/packages/shim/" +MY_PV="${PV/./-}" +SRC_URI="amd64? ( https://kojipkgs.fedoraproject.org//packages/shim/15/5/x86_64/shim-x64-${MY_PV}.x86_64.rpm + https://kojipkgs.fedoraproject.org//packages/shim/15/5/x86_64/shim-ia32-${MY_PV}.x86_64.rpm ) + x86? ( https://kojipkgs.fedoraproject.org//packages/shim/15/5/x86_64/shim-x64-${MY_PV}.x86_64.rpm + https://kojipkgs.fedoraproject.org//packages/shim/15/5/x86_64/shim-ia32-${MY_PV}.x86_64.rpm ) + arm64? ( https://kojipkgs.fedoraproject.org//packages/shim/15/5/aarch64/shim-aa64-${MY_PV}.aarch64.rpm )" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="amd64 arm64 x86" +IUSE="" + +S="${WORKDIR}/boot/efi/EFI" + +src_install() { + insinto /usr/share/${PN} + doins BOOT/BOOT*.EFI + doins fedora/mm*.efi +} diff --git a/sys-boot/silo/Manifest b/sys-boot/silo/Manifest new file mode 100644 index 000000000000..70de039c9579 --- /dev/null +++ b/sys-boot/silo/Manifest @@ -0,0 +1,4 @@ +DIST silo-1.4.14_p20170829.tar.gz 183612 BLAKE2B 88fb4b0ce4e9b8fa9518bcb6226f4fe9ec7011bf3f73d9f0f1562ff837217ca8d54ee783eed0b50096b009fc56527be8e4211623f5b0e4ef5372c38c0fe304f1 SHA512 bda31084ba2ee5b01d331fd390cbccf039dc812debe25f3af97dd5d2855668cbe7e160dee4ca45c16af1fa4aa86224daf3b474fd49b22a8b7f453584a12f3c2b +DIST silo-1.4.14_p20200602.tar.gz 183668 BLAKE2B e229cdb9fbc5f0111aa49919f4b3b91c0770492fa06f91bda15c65af160b728b9409365c3ff0a93091b1e3011c60d0b0bec1101ffabaddbaef7e1083158830b1 SHA512 7a70fe25c1bb3ce655e4fbb85b00fe0d29fe0a6f98b80c1b8267b72bc9324ac0749cd050921163cc286e094f7d9bc81315d63ff02d2442b5c30ce350a537fcc1 +DIST silo_1.4.14+git20120819-1.diff.gz 10711 BLAKE2B c44a0204e3aece4eec8355f88b3a195c1ba7019c0aa648cc4e28ff6cb85fc6d96634bd282e5aaea9123dbc5835820acf2fc15054c91842d6b1040fc13cb0033b SHA512 60719b672a0f1dd2a005e763efd232bbf7aeb00198e0b46827208b78f1b32acc3a730d43944382dec4b95fddfbb373b1eb69dc911ad28ec9d1d1e6c45d84db20 +DIST silo_1.4.14+git20120819.orig.tar.gz 755510 BLAKE2B f1185086671c12c901704c2aa1f582a4e983d2d4a2d5ec18194aebcd43a7bdf9e7ad329efebaf4911d40f8a417ff8c8566b61be4eac5fea13235ac44d0edf852 SHA512 2d1dd8f805fb0a272877b5e8e19e5a645aa9fe02cf2b5ef43b5d2894c0c6a5a82483a0e41556af50f01dc795dc5e43350ae92139485c19d64cda75c2aca01a38 diff --git a/sys-boot/silo/files/silo-1.4.14_p20120819-gnu90-inline.patch b/sys-boot/silo/files/silo-1.4.14_p20120819-gnu90-inline.patch new file mode 100644 index 000000000000..bf6add0ce104 --- /dev/null +++ b/sys-boot/silo/files/silo-1.4.14_p20120819-gnu90-inline.patch @@ -0,0 +1,20 @@ +--- a/Rules.make ++++ b/Rules.make +@@ -26,2 +26,7 @@ CFLAGS += -fno-stack-protector + endif ++ifeq ($(call cc-option-yn, -std=gnu90),y) ++# In gcc-5+ c99 changed inline rules by forbidding ++# multiple extern definitions. Fall back to gnu90 ++CFLAGS += -std=gnu90 ++endif + +--- a/silo/Makefile ++++ b/silo/Makefile +@@ -6,2 +6,7 @@ UFSDEPS= + CFLAGS=-O2 -Wall -I. -I../include ++ifeq ($(call cc-option-yn, -std=gnu90),y) ++# In gcc-5+ c99 changed inline rules by forbidding ++# multiple extern definitions. Fall back to gnu90 ++CFLAGS += -std=gnu90 ++endif + diff --git a/sys-boot/silo/metadata.xml b/sys-boot/silo/metadata.xml new file mode 100644 index 000000000000..afd1e4de9aeb --- /dev/null +++ b/sys-boot/silo/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>sparc@gentoo.org</email> + <name>Gentoo Linux SPARC Development</name> +</maintainer> +<use> + <flag name="tilo-only">Install only the tilo netboot tool</flag> +</use> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/silo/silo-1.4.14_p20120819-r1.ebuild b/sys-boot/silo/silo-1.4.14_p20120819-r1.ebuild new file mode 100644 index 000000000000..946707a29471 --- /dev/null +++ b/sys-boot/silo/silo-1.4.14_p20120819-r1.ebuild @@ -0,0 +1,71 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit mount-boot flag-o-matic toolchain-funcs eutils + +DEB_PL="1" +MY_PV="${PV##*_p}" +MY_GIT="git${MY_PV%%_*}" +MY_PV="${PV%%_*}" +MY_P="${PN}_${MY_PV}+${MY_GIT}" + +DESCRIPTION="SPARC/UltraSPARC Improved Loader, a boot loader for sparc" +SRC_URI="mirror://debian/pool/main/s/${PN}/${MY_P}.orig.tar.gz + mirror://debian/pool/main/s/${PN}/${MY_P}-${DEB_PL}.diff.gz" +HOMEPAGE="https://git.kernel.org/?p=linux/kernel/git/davem/silo.git;a=summary" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="-* sparc" +IUSE="" + +DEPEND="sys-fs/e2fsprogs + sys-apps/sparc-utils" +RDEPEND="" + +ABI_ALLOW="sparc32" + +S="${WORKDIR}/${PN}" + +PATCHES=( + "${FILESDIR}"/${P}-gnu90-inline.patch +) + +src_prepare() { + default + + #Set the correct version + sed -i -e "s/1.4.14/1.4.14_git20120819_p1/g" Rules.make || die + + # Fix build failure + # -fno-PIC is needed to shrink silo size back to manageable on + # profiles where gcc has -fPIC default (via --enable-default-pie). + sed -i -e "s/-fno-strict-aliasing/-fno-strict-aliasing -U_FORTIFY_SOURCE -mcpu=v9 -fno-PIC/g" Rules.make || die +} + +src_compile() { + filter-flags "-fstack-protector" + + emake CC="$(tc-getCC)" +} + +src_install() { + default + + dodoc first-isofs/README.SILO_ISOFS docs/README* + + # Fix maketilo manpage + rm "${D}"/usr/share/man/man1/maketilo.1 + dosym tilo.1 /usr/share/man/man1/maketilo.1 +} + +pkg_postinst() { + mount-boot_pkg_postinst + ewarn "NOTE: If this is an upgrade to an existing SILO install," + ewarn " you will need to re-run silo as the /boot/second.b" + ewarn " file has changed, else the system will fail to load" + ewarn " SILO at the next boot." + ewarn +} diff --git a/sys-boot/silo/silo-1.4.14_p20170829.ebuild b/sys-boot/silo/silo-1.4.14_p20170829.ebuild new file mode 100644 index 000000000000..9fe244c7d56f --- /dev/null +++ b/sys-boot/silo/silo-1.4.14_p20170829.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit mount-boot flag-o-matic toolchain-funcs vcs-snapshot + +MY_SNAPSHOT="${PN}-2506051d55dd5cb9fe10b4e978e22fa00363044b" + +DESCRIPTION="SPARC/UltraSPARC Improved Loader, a boot loader for sparc" +SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/davem/silo.git/snapshot/${MY_SNAPSHOT}.tar.gz -> ${P}.tar.gz" +HOMEPAGE="https://git.kernel.org/?p=linux/kernel/git/davem/silo.git;a=summary" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="-* sparc" +IUSE="" + +DEPEND="sys-fs/e2fsprogs + sys-apps/sparc-utils" +RDEPEND="" + +ABI_ALLOW="sparc32" + +src_prepare() { + default + + # Set the correct version + sed -i -e "s/1.4.14/1.4.14_git20170829/g" Rules.make || die + + # Fix build failure + # -fno-PIC is needed to shrink silo size back to manageable on + # profiles where gcc has -fPIC default (via --enable-default-pie). + sed -i -e "s/-fno-strict-aliasing/-fno-strict-aliasing -U_FORTIFY_SOURCE -mcpu=v9 -fno-PIC/g" Rules.make || die + + # Don't strip ieee32.b during compile + sed -i -e '/^ $(STRIP) ieee32.b/d' first/Makefile || die +} + +src_compile() { + filter-flags "-fstack-protector" + + emake CC="$(tc-getCC)" \ + STRIP="$(tc-getSTRIP)" \ + NM="$(tc-getNM)" \ + LD="$(tc-getLD)" +} + +src_install() { + default + + dodoc first-isofs/README.SILO_ISOFS docs/README* + + # Fix maketilo manpage + rm "${D}"/usr/share/man/man1/maketilo.1 + dosym tilo.1 /usr/share/man/man1/maketilo.1 +} + +pkg_postinst() { + mount-boot_pkg_postinst + ewarn "NOTE: If this is an upgrade to an existing SILO install," + ewarn " you will need to re-run silo as the /boot/second.b" + ewarn " file has changed, else the system will fail to load" + ewarn " SILO at the next boot." + ewarn +} diff --git a/sys-boot/silo/silo-1.4.14_p20200602.ebuild b/sys-boot/silo/silo-1.4.14_p20200602.ebuild new file mode 100644 index 000000000000..deeed7b293d6 --- /dev/null +++ b/sys-boot/silo/silo-1.4.14_p20200602.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit mount-boot flag-o-matic toolchain-funcs vcs-snapshot + +MY_SNAPSHOT="${PN}-9277bfd433e398d0a6eabec79edead52d4cb8125" + +DESCRIPTION="SPARC/UltraSPARC Improved Loader, a boot loader for sparc" +SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/davem/silo.git/snapshot/${MY_SNAPSHOT}.tar.gz -> ${P}.tar.gz" +HOMEPAGE="https://git.kernel.org/?p=linux/kernel/git/davem/silo.git;a=summary" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="-* ~sparc" +IUSE="tilo-only" + +DEPEND="sys-fs/e2fsprogs + sys-apps/sparc-utils" +RDEPEND="" + +src_prepare() { + default + + # Set the correct version + sed -i -e "s/1.4.14/1.4.14_git20200602/g" Rules.make || die + + # Fix build failure + sed -i -e "s/-fno-strict-aliasing/-fno-strict-aliasing -mcpu=v9/g" Rules.make || die + + # Don't strip ieee32.b during compile + sed -i -e '/^ $(STRIP) ieee32.b/d' first/Makefile || die +} + +src_compile() { + filter-flags "-fstack-protector" + + CC="$(tc-getCC)" \ + STRIP="$(tc-getSTRIP)" \ + NM="$(tc-getNM)" \ + LD="$(tc-getLD)" \ + emake $(usex tilo-only '-C tilo' '') +} + +src_install() { + default + + dodoc first-isofs/README.SILO_ISOFS docs/README* + + # Fix maketilo manpage + rm "${D}"/usr/share/man/man1/maketilo.1 + dosym tilo.1 /usr/share/man/man1/maketilo.1 +} + +pkg_postinst() { + use tilo-only && return + + mount-boot_pkg_postinst + ewarn "NOTE: If this is an upgrade to an existing SILO install," + ewarn " you will need to re-run silo as the /boot/second.b" + ewarn " file has changed, else the system will fail to load" + ewarn " SILO at the next boot." + ewarn +} diff --git a/sys-boot/syslinux/Manifest b/sys-boot/syslinux/Manifest new file mode 100644 index 000000000000..b9ab5dc8f249 --- /dev/null +++ b/sys-boot/syslinux/Manifest @@ -0,0 +1,3 @@ +DIST syslinux-5.10.tar.xz 5315660 BLAKE2B 19d6861bb6220fe57e12d8d6118d37b197c3c771e4d2e7a51ce7db39219e3c837e6d1543d7a3927820f3a34da34ce849f9badbaf9cd83cb5ee24fd5ed7b705f2 SHA512 56422e14b4aa53ca1a5811da0582dbbb349aa52b9e78868bbedc24c67ef2420c4d0ac63fd68c7f0adc2c22606196276265d503b5b6f9d3d796d9ce42845bbdb5 +DIST syslinux-6.03.tar.xz 6855224 BLAKE2B 9caccf8bed4e3c3e87393c9dc8f3b3d267c14469bbf8135a648ea41d8a43a4aedbf2b007c6b9a6853de8866152f5bc33e5ea85fca1db86c5f2fac88d97189b0f SHA512 dd2b2916962b9e93bc1e714182e3ca2a727a229b8afabe913050bcfdd43ee2af51ee3acf79121d8c20caf434583efaa7f3196871e0e07c04d82191323a50fe31 +DIST syslinux-6.04-pre1.tar.xz 5283272 BLAKE2B 800e5977ed13b26a1756c33d8625e850631b642e26a86e3328196ddd998596693c3a26db0ada4c0ba78a4ba692a1cc01886b6eb693d877ddafcfb325ecdeb639 SHA512 7927dd39be8e2dcf4138a6fea33def67d19d938379d694f15b48fdd2f5924c028b7a9e7bd71d0c7c6630c203e9e2a54296628e530632ad5e6f55b1ebefe8fc98 diff --git a/sys-boot/syslinux/files/syslinux-4.05-nopie.patch b/sys-boot/syslinux/files/syslinux-4.05-nopie.patch new file mode 100644 index 000000000000..b50b6b476895 --- /dev/null +++ b/sys-boot/syslinux/files/syslinux-4.05-nopie.patch @@ -0,0 +1,12 @@ +diff -ur a/mk/com32.mk b/mk/com32.mk +--- a/mk/com32.mk 2011-12-09 19:28:17.000000000 +0100 ++++ b/mk/com32.mk 2011-12-18 18:22:11.032342645 +0100 +@@ -24,6 +24,8 @@ + GCCOPT += $(call gcc_ok,-freg-struct-return,) + GCCOPT += -mregparm=3 -DREGPARM=3 -march=i386 -Os + GCCOPT += $(call gcc_ok,-fPIE,-fPIC) ++GCCOPT += $(call gcc_ok,-nopie,) ++GCCOPT += $(call gcc_ok,-fno-pie,) + GCCOPT += $(call gcc_ok,-fno-exceptions,) + GCCOPT += $(call gcc_ok,-fno-asynchronous-unwind-tables,) + GCCOPT += $(call gcc_ok,-fno-strict-aliasing,) diff --git a/sys-boot/syslinux/files/syslinux-6.03-sysmacros.patch b/sys-boot/syslinux/files/syslinux-6.03-sysmacros.patch new file mode 100644 index 000000000000..af464fe534e1 --- /dev/null +++ b/sys-boot/syslinux/files/syslinux-6.03-sysmacros.patch @@ -0,0 +1,34 @@ +https://bugs.gentoo.org/579928 + +From d84db34dbe39d55b4d7e868764c056689aa0793b Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Tue, 19 Apr 2016 01:56:41 -0400 +Subject: [PATCH] extlinux: pull in sys/sysmacros.h for major/minor/makedev + +These functions are defined in sys/sysmacros.h, so add the include to +main.c. This is already handled correctly in mountinfo.c. Otherwise +we get build failures like: + +main.o: In function 'find_device_sysfs': +extlinux/main.c:1131: undefined reference to 'minor' + +Signed-off-by: Mike Frysinger <vapier@gentoo.org> +--- + extlinux/main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/extlinux/main.c b/extlinux/main.c +index a7ebd49..ebff7ea 100644 +--- a/extlinux/main.c ++++ b/extlinux/main.c +@@ -38,6 +38,7 @@ + #include <sysexits.h> + #include <sys/ioctl.h> + #include <sys/stat.h> ++#include <sys/sysmacros.h> + #include <sys/types.h> + #include <sys/mount.h> + #include <sys/vfs.h> +-- +2.7.4 + diff --git a/sys-boot/syslinux/files/syslinux-6.04_pre1-fcommon.patch b/sys-boot/syslinux/files/syslinux-6.04_pre1-fcommon.patch new file mode 100644 index 000000000000..7d061db26563 --- /dev/null +++ b/sys-boot/syslinux/files/syslinux-6.04_pre1-fcommon.patch @@ -0,0 +1,54 @@ +https://bugs.gentoo.org/705730 + +gcc-10 enabled f-no-common by default. Broke syslinux linking. +--- a/mk/com32.mk ++++ b/mk/com32.mk +@@ -47,6 +47,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0) + GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) + GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0) + GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0) ++GCCOPT += $(call gcc_ok,-fcommon) + + ifeq ($(FWCLASS),EFI) + GCCOPT += -mno-red-zone +--- a/mk/elf.mk ++++ b/mk/elf.mk +@@ -42,6 +42,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0) + GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) + GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0) + GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0) ++GCCOPT += $(call gcc_ok,-fcommon) + + com32 = $(topdir)/com32 + core = $(topdir)/core +--- a/mk/embedded.mk ++++ b/mk/embedded.mk +@@ -51,6 +51,7 @@ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) + GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0) + GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0) + GCCOPT += $(call gcc_ok,-fvisibility=hidden) ++GCCOPT += $(call gcc_ok,-fcommon) + + LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc) + +--- a/mk/lib.mk ++++ b/mk/lib.mk +@@ -28,6 +28,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0) + GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) + GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0) + GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0) ++GCCOPT += $(call gcc_ok,-fcommon) + + INCLUDE = -I$(SRC) + STRIP = strip --strip-all -R .comment -R .note +--- a/mk/efi.mk ++++ b/mk/efi.mk +@@ -7,7 +7,7 @@ core = $(topdir)/core + # Set up architecture specifics; for cross compilation, set ARCH as apt + # gnuefi sets up architecture specifics in ia32 or x86_64 sub directories + # set up the LIBDIR and EFIINC for building for the appropriate architecture +-GCCOPT := $(call gcc_ok,-fno-stack-protector,) ++GCCOPT := $(call gcc_ok,-fno-stack-protector,) $(call gcc_ok,-fcommon) + EFIINC = $(objdir)/include/efi + LIBDIR = $(objdir)/lib + diff --git a/sys-boot/syslinux/files/syslinux-6.04_pre1-singleloadsegment.patch b/sys-boot/syslinux/files/syslinux-6.04_pre1-singleloadsegment.patch new file mode 100644 index 000000000000..db9b7d0a137b --- /dev/null +++ b/sys-boot/syslinux/files/syslinux-6.04_pre1-singleloadsegment.patch @@ -0,0 +1,304 @@ +Author: Lukas Schwaighofer <lukas@schwaighofer.name> +Description: Force the linker to put all sections into a single PT_LOAD + segment. This is required when using binutils >= 2.31 which writes two PT_LOAD + segments by default. This is not supported by the wrapper.c script used to + convert the shared object into an elf binary. +Forwarded: https://www.syslinux.org/archives/2018-August/026167.html + +--- + efi/i386/syslinux.ld | 37 +++++++++++++++++++++---------------- + efi/x86_64/syslinux.ld | 37 +++++++++++++++++++++---------------- + 2 files changed, 42 insertions(+), 32 deletions(-) + +diff --git a/efi/i386/syslinux.ld b/efi/i386/syslinux.ld +index bab3fc7..5b4589d 100644 +--- a/efi/i386/syslinux.ld ++++ b/efi/i386/syslinux.ld +@@ -19,6 +19,11 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") + OUTPUT_ARCH(i386) + ENTRY(_start) + ++PHDRS ++{ ++ all PT_LOAD ; ++} ++ + SECTIONS + { + . = 0; +@@ -31,7 +36,7 @@ SECTIONS + *(.text) + *(.text.*) + __text_end = .; +- } ++ } :all + + . = ALIGN(16); + +@@ -40,7 +45,7 @@ SECTIONS + *(.rodata) + *(.rodata.*) + __rodata_end = .; +- } ++ } :all + + . = ALIGN(4); + +@@ -49,14 +54,14 @@ SECTIONS + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + __ctors_end = .; +- } ++ } :all + + .dtors : { + __dtors_start = .; + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + __dtors_end = .; +- } ++ } :all + + . = ALIGN(4096); + .rel : { +@@ -64,7 +69,7 @@ SECTIONS + *(.rel.data) + *(.rel.data.*) + *(.rel.ctors) +- } ++ } :all + + . = ALIGN(4); + +@@ -72,14 +77,14 @@ SECTIONS + __gnu_hash_start = .; + *(.gnu.hash) + __gnu_hash_end = .; +- } ++ } :all + + + .dynsym : { + __dynsym_start = .; + *(.dynsym) + __dynsym_end = .; +- } ++ } :all + + . = ALIGN(4); + +@@ -87,7 +92,7 @@ SECTIONS + __dynstr_start = .; + *(.dynstr) + __dynstr_end = .; +- } ++ } :all + + . = ALIGN(4); + +@@ -104,7 +109,7 @@ SECTIONS + KEEP (*(.got.plt)) + KEEP (*(.got)) + __got_end = .; +- } ++ } :all + + . = ALIGN(4); + +@@ -112,7 +117,7 @@ SECTIONS + __dynamic_start = .; + *(.dynamic) + __dynamic_end = .; +- } ++ } :all + + . = ALIGN(16); + +@@ -122,19 +127,19 @@ SECTIONS + *(.data.*) + *(.lowmem) + __data_end = .; +- } ++ } :all + + .reloc : { + *(.reloc) +- } ++ } :all + + .symtab : { + *(.symtab) +- } ++ } :all + + .strtab : { + *(.strtab) +- } ++ } :all + + .bss (NOLOAD) : { + /* the EFI loader doesn't seem to like a .bss section, +@@ -148,7 +153,7 @@ SECTIONS + __bss_end = .; + *(.sbss) + *(.scommon) +- } ++ } :all + __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start); + __bss_dwords = (__bss_len + 3) >> 2; + +@@ -161,7 +166,7 @@ SECTIONS + *(.hugebss) + *(.hugebss.*) + __hugebss_end = .; +- } ++ } :all + + _end = .; + +diff --git a/efi/x86_64/syslinux.ld b/efi/x86_64/syslinux.ld +index 450641c..cad28a8 100644 +--- a/efi/x86_64/syslinux.ld ++++ b/efi/x86_64/syslinux.ld +@@ -19,6 +19,11 @@ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") + OUTPUT_ARCH(i386:x86-64) + ENTRY(_start) + ++PHDRS ++{ ++ all PT_LOAD ; ++} ++ + SECTIONS + { + . = 0; +@@ -31,7 +36,7 @@ SECTIONS + *(.text) + *(.text.*) + __text_end = .; +- } ++ } :all + + . = ALIGN(16); + +@@ -40,7 +45,7 @@ SECTIONS + *(.rodata) + *(.rodata.*) + __rodata_end = .; +- } ++ } :all + + . = ALIGN(4); + +@@ -49,14 +54,14 @@ SECTIONS + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + __ctors_end = .; +- } ++ } :all + + .dtors : { + __dtors_start = .; + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + __dtors_end = .; +- } ++ } :all + + . = ALIGN(4096); + .rel : { +@@ -64,7 +69,7 @@ SECTIONS + *(.rel.data) + *(.rel.data.*) + *(.rel.ctors) +- } ++ } :all + + . = ALIGN(4); + +@@ -72,14 +77,14 @@ SECTIONS + __gnu_hash_start = .; + *(.gnu.hash) + __gnu_hash_end = .; +- } ++ } :all + + + .dynsym : { + __dynsym_start = .; + *(.dynsym) + __dynsym_end = .; +- } ++ } :all + + . = ALIGN(4); + +@@ -87,7 +92,7 @@ SECTIONS + __dynstr_start = .; + *(.dynstr) + __dynstr_end = .; +- } ++ } :all + + . = ALIGN(4); + +@@ -104,7 +109,7 @@ SECTIONS + KEEP (*(.got.plt)) + KEEP (*(.got)) + __got_end = .; +- } ++ } :all + + . = ALIGN(4); + +@@ -112,7 +117,7 @@ SECTIONS + __dynamic_start = .; + *(.dynamic) + __dynamic_end = .; +- } ++ } :all + + . = ALIGN(16); + +@@ -122,19 +127,19 @@ SECTIONS + *(.data.*) + *(.lowmem) + __data_end = .; +- } ++ } :all + + .reloc : { + *(.reloc) +- } ++ } :all + + .symtab : { + *(.symtab) +- } ++ } :all + + .strtab : { + *(.strtab) +- } ++ } :all + + .bss (NOLOAD) : { + /* the EFI loader doesn't seem to like a .bss section, +@@ -148,7 +153,7 @@ SECTIONS + __bss_end = .; + *(.sbss) + *(.scommon) +- } ++ } :all + __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start); + __bss_dwords = (__bss_len + 3) >> 2; + +@@ -161,7 +166,7 @@ SECTIONS + *(.hugebss) + *(.hugebss.*) + __hugebss_end = .; +- } ++ } :all + + _end = .; + diff --git a/sys-boot/syslinux/metadata.xml b/sys-boot/syslinux/metadata.xml new file mode 100644 index 000000000000..ac81d58a45c2 --- /dev/null +++ b/sys-boot/syslinux/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> + <email>chithanh@gentoo.org</email> +</maintainer> +<maintainer type="project"> + <email>base-system@gentoo.org</email> + <name>Gentoo Base System</name> +</maintainer> +<upstream> + <remote-id type="cpe">cpe:/a:gentoo:syslinux</remote-id> +</upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/syslinux/syslinux-5.10.ebuild b/sys-boot/syslinux/syslinux-5.10.ebuild new file mode 100644 index 000000000000..bc99bbf6c4e2 --- /dev/null +++ b/sys-boot/syslinux/syslinux-5.10.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 + +inherit eutils toolchain-funcs + +DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders" +HOMEPAGE="https://www.syslinux.org/" +SRC_URI="https://www.kernel.org/pub/linux/utils/boot/syslinux/${PV:0:1}.xx/${P/_/-}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* amd64 x86" +IUSE="custom-cflags" + +RDEPEND="sys-fs/mtools + dev-perl/Crypt-PasswdMD5 + dev-perl/Digest-SHA1" +DEPEND="${RDEPEND} + dev-lang/nasm + virtual/os-headers" + +S=${WORKDIR}/${P/_/-} + +# This ebuild is a departure from the old way of rebuilding everything in syslinux +# This departure is necessary since hpa doesn't support the rebuilding of anything other +# than the installers. + +# These are executables which come precompiled and are run by the boot loader +QA_PREBUILT="usr/share/${PN}/*.c32" + +# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore + +src_prepare() { + # Fix building on hardened + epatch "${FILESDIR}"/${PN}-4.05-nopie.patch + + rm -f gethostip #bug 137081 + + # Don't prestrip or override user LDFLAGS, bug #305783 + local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \ + sample/Makefile utils/Makefile" + sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed" + + if use custom-cflags; then + sed -i ${SYSLINUX_MAKEFILES} \ + -e 's|-g -Os||g' \ + -e 's|-Os||g' \ + -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \ + || die "sed custom-cflags failed" + else + QA_FLAGS_IGNORED=" + /sbin/extlinux + /usr/bin/memdiskfind + /usr/bin/gethostip + /usr/bin/isohybrid + /usr/bin/syslinux + " + fi + +} + +src_compile() { + emake CC="$(tc-getCC)" installer +} + +src_install() { + emake INSTALLSUBDIRS=utils INSTALLROOT="${D}" MANDIR=/usr/share/man install + dodoc README NEWS doc/*.txt +} + +pkg_postinst() { + # print warning for users upgrading from the previous stable version + if has 4.07 ${REPLACING_VERSIONS}; then + ewarn "syslinux now uses dynamically linked ELF executables. Before you reboot," + ewarn "ensure that needed dependencies are fulfilled. For example, run from your" + ewarn "syslinux directory:" + ewarn + ewarn "LD_LIBRARY_PATH=\".\" ldd menu.c32" + fi +} diff --git a/sys-boot/syslinux/syslinux-6.03.ebuild b/sys-boot/syslinux/syslinux-6.03.ebuild new file mode 100644 index 000000000000..c82f18d21b88 --- /dev/null +++ b/sys-boot/syslinux/syslinux-6.03.ebuild @@ -0,0 +1,112 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit eutils toolchain-funcs + +DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders" +HOMEPAGE="https://www.syslinux.org/" +# Final releases in 6.xx/$PV.tar.* (literal "xx") +# Testing releases in Testing/$PV/$PV.tar.* +SRC_URI_DIR=${PV:0:1}.xx +SRC_URI_TESTING=Testing/${PV:0:4} +[[ ${PV/_alpha} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_beta} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_pre} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_rc} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +SRC_URI="https://www.kernel.org/pub/linux/utils/boot/syslinux/${SRC_URI_DIR}/${P/_/-}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86" +IUSE="custom-cflags" + +RDEPEND="sys-fs/mtools + dev-perl/Crypt-PasswdMD5 + dev-perl/Digest-SHA1" +DEPEND="${RDEPEND} + dev-lang/nasm + >=sys-boot/gnu-efi-3.0u + virtual/os-headers" + +S=${WORKDIR}/${P/_/-} + +# This ebuild is a departure from the old way of rebuilding everything in syslinux +# This departure is necessary since hpa doesn't support the rebuilding of anything other +# than the installers. + +# These are executables which come precompiled and are run by the boot loader +QA_PREBUILT="usr/share/${PN}/*.c32" + +# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore + +src_prepare() { + rm -f gethostip #bug 137081 + + epatch "${FILESDIR}"/${PN}-6.03-sysmacros.patch #579928 + + # Don't prestrip or override user LDFLAGS, bug #305783 + local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \ + sample/Makefile utils/Makefile" + sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed" + + if use custom-cflags; then + sed -i ${SYSLINUX_MAKEFILES} \ + -e 's|-g -Os||g' \ + -e 's|-Os||g' \ + -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \ + || die "sed custom-cflags failed" + else + QA_FLAGS_IGNORED=" + /sbin/extlinux + /usr/bin/memdiskfind + /usr/bin/gethostip + /usr/bin/isohybrid + /usr/bin/syslinux + " + fi + case ${ARCH} in + amd64) loaderarch="efi64" ;; + x86) loaderarch="efi32" ;; + *) ewarn "Unsupported architecture, building installers only." ;; + esac + + # building with ld.gold causes problems, bug #563364 + if tc-ld-is-gold; then + ewarn "Building syslinux with the gold linker may cause problems, see bug #563364" + if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then + tc-ld-disable-gold + ewarn "set I_KNOW_WHAT_I_AM_DOING=1 to override this." + else + ewarn "Continuing anyway as requested." + fi + fi +} + +src_compile() { + # build system abuses the LDFLAGS variable to pass arguments to ld + unset LDFLAGS + if [[ ! -z ${loaderarch} ]]; then + emake CC="$(tc-getCC)" LD="$(tc-getLD)" ${loaderarch} + fi + emake CC="$(tc-getCC)" LD="$(tc-getLD)" ${loaderarch} installer +} + +src_install() { + # parallel install fails sometimes + einfo "loaderarch=${loaderarch}" + emake -j1 LD="$(tc-getLD)" INSTALLROOT="${D}" MANDIR=/usr/share/man bios ${loaderarch} install + dodoc README NEWS doc/*.txt +} + +pkg_postinst() { + # print warning for users upgrading from the previous stable version + if has 4.07 ${REPLACING_VERSIONS}; then + ewarn "syslinux now uses dynamically linked ELF executables. Before you reboot," + ewarn "ensure that needed dependencies are fulfilled. For example, run from your" + ewarn "syslinux directory:" + ewarn + ewarn "LD_LIBRARY_PATH=\".\" ldd menu.c32" + fi +} diff --git a/sys-boot/syslinux/syslinux-6.04_pre1-r1.ebuild b/sys-boot/syslinux/syslinux-6.04_pre1-r1.ebuild new file mode 100644 index 000000000000..194db71f6e57 --- /dev/null +++ b/sys-boot/syslinux/syslinux-6.04_pre1-r1.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit eutils toolchain-funcs + +DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders" +HOMEPAGE="https://www.syslinux.org/" +# Final releases in 6.xx/$PV.tar.* (literal "xx") +# Testing releases in Testing/$PV/$PV.tar.* +SRC_URI_DIR=${PV:0:1}.xx +SRC_URI_TESTING=Testing/${PV:0:4} +[[ ${PV/_alpha} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_beta} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_pre} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_rc} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +SRC_URI="https://www.kernel.org/pub/linux/utils/boot/syslinux/${SRC_URI_DIR}/${P/_/-}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86" +IUSE="custom-cflags" + +RDEPEND="sys-fs/mtools + dev-perl/Crypt-PasswdMD5 + dev-perl/Digest-SHA1" +DEPEND="${RDEPEND} + dev-lang/nasm + >=sys-boot/gnu-efi-3.0u + virtual/os-headers" + +S=${WORKDIR}/${P/_/-} + +# This ebuild is a departure from the old way of rebuilding everything in syslinux +# This departure is necessary since hpa doesn't support the rebuilding of anything other +# than the installers. + +# These are executables which come precompiled and are run by the boot loader +QA_PREBUILT="usr/share/${PN}/*.c32" + +# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore + +PATCHES=( + "${FILESDIR}"/${PN}-6.03-sysmacros.patch #579928 + "${FILESDIR}"/${P}-singleloadsegment.patch #662678 + "${FILESDIR}"/${P}-fcommon.patch #705730 +) + +src_prepare() { + default + + rm -f gethostip #bug 137081 + + # Don't prestrip or override user LDFLAGS, bug #305783 + local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \ + sample/Makefile utils/Makefile" + sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed" + + if use custom-cflags; then + sed -i ${SYSLINUX_MAKEFILES} \ + -e 's|-g -Os||g' \ + -e 's|-Os||g' \ + -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \ + || die "sed custom-cflags failed" + else + QA_FLAGS_IGNORED=" + /sbin/extlinux + /usr/bin/memdiskfind + /usr/bin/gethostip + /usr/bin/isohybrid + /usr/bin/syslinux + " + fi + case ${ARCH} in + amd64) loaderarch="efi64" ;; + x86) loaderarch="efi32" ;; + *) ewarn "Unsupported architecture, building installers only." ;; + esac + + # building with ld.gold causes problems, bug #563364 + if tc-ld-is-gold; then + ewarn "Building syslinux with the gold linker may cause problems, see bug #563364" + if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then + tc-ld-disable-gold + ewarn "set I_KNOW_WHAT_I_AM_DOING=1 to override this." + else + ewarn "Continuing anyway as requested." + fi + fi +} + +src_compile() { + # build system abuses the LDFLAGS variable to pass arguments to ld + unset LDFLAGS + if [[ ! -z ${loaderarch} ]]; then + emake CC="$(tc-getCC)" LD="$(tc-getLD)" ${loaderarch} + fi + emake CC="$(tc-getCC)" LD="$(tc-getLD)" ${loaderarch} installer +} + +src_install() { + # parallel install fails sometimes + einfo "loaderarch=${loaderarch}" + emake -j1 CC="$(tc-getCC)" LD="$(tc-getLD)" INSTALLROOT="${D}" MANDIR=/usr/share/man bios ${loaderarch} install + dodoc README NEWS doc/*.txt +} diff --git a/sys-boot/syslinux/syslinux-6.04_pre1-r2.ebuild b/sys-boot/syslinux/syslinux-6.04_pre1-r2.ebuild new file mode 100644 index 000000000000..415672bbf778 --- /dev/null +++ b/sys-boot/syslinux/syslinux-6.04_pre1-r2.ebuild @@ -0,0 +1,119 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit eutils toolchain-funcs + +DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders" +HOMEPAGE="https://www.syslinux.org/" +# Final releases in 6.xx/$PV.tar.* (literal "xx") +# Testing releases in Testing/$PV/$PV.tar.* +SRC_URI_DIR=${PV:0:1}.xx +SRC_URI_TESTING=Testing/${PV:0:4} +[[ ${PV/_alpha} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_beta} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_pre} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_rc} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +SRC_URI="https://www.kernel.org/pub/linux/utils/boot/syslinux/${SRC_URI_DIR}/${P/_/-}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86" +IUSE="custom-cflags" + +RDEPEND="sys-fs/mtools + dev-perl/Crypt-PasswdMD5 + dev-perl/Digest-SHA1" +DEPEND="${RDEPEND} + dev-lang/nasm + >=sys-boot/gnu-efi-3.0u + virtual/os-headers" + +S=${WORKDIR}/${P/_/-} + +# This ebuild is a departure from the old way of rebuilding everything in syslinux +# This departure is necessary since hpa doesn't support the rebuilding of anything other +# than the installers. + +# These are executables which come precompiled and are run by the boot loader +QA_PREBUILT="usr/share/${PN}/*.c32" + +# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore + +PATCHES=( + "${FILESDIR}"/${PN}-6.03-sysmacros.patch #579928 + "${FILESDIR}"/${P}-singleloadsegment.patch #662678 + "${FILESDIR}"/${P}-fcommon.patch #705730 +) + +src_prepare() { + default + + rm -f gethostip #bug 137081 + + # Don't prestrip or override user LDFLAGS, bug #305783 + local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \ + sample/Makefile utils/Makefile" + sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed" + + if use custom-cflags; then + sed -i ${SYSLINUX_MAKEFILES} \ + -e 's|-g -Os||g' \ + -e 's|-Os||g' \ + -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \ + || die "sed custom-cflags failed" + else + QA_FLAGS_IGNORED=" + /sbin/extlinux + /usr/bin/memdiskfind + /usr/bin/gethostip + /usr/bin/isohybrid + /usr/bin/syslinux + " + fi + case ${ARCH} in + amd64) loaderarch="efi64" ;; + x86) loaderarch="efi32" ;; + *) ewarn "Unsupported architecture, building installers only." ;; + esac + + # building with ld.gold causes problems, bug #563364 + if tc-ld-is-gold; then + ewarn "Building syslinux with the gold linker may cause problems, see bug #563364" + if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then + tc-ld-disable-gold + ewarn "set I_KNOW_WHAT_I_AM_DOING=1 to override this." + else + ewarn "Continuing anyway as requested." + fi + fi + + tc-export AR CC LD OBJCOPY RANLIB +} + +_emake() { + emake \ + AR="${AR}" \ + CC="${CC}" \ + LD="${LD}" \ + OBJCOPY="${OBJCOPY}" \ + RANLIB="${RANLIB}" \ + "$@" +} + +src_compile() { + # build system abuses the LDFLAGS variable to pass arguments to ld + unset LDFLAGS + if [[ ! -z ${loaderarch} ]]; then + _emake ${loaderarch} + fi + _emake ${loaderarch} installer +} + +src_install() { + # parallel install fails sometimes + einfo "loaderarch=${loaderarch}" + _emake -j1 INSTALLROOT="${D}" MANDIR=/usr/share/man bios ${loaderarch} install + dodoc README NEWS doc/*.txt +} diff --git a/sys-boot/syslinux/syslinux-6.04_pre1.ebuild b/sys-boot/syslinux/syslinux-6.04_pre1.ebuild new file mode 100644 index 000000000000..3fb6b3a94cc3 --- /dev/null +++ b/sys-boot/syslinux/syslinux-6.04_pre1.ebuild @@ -0,0 +1,115 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit eutils toolchain-funcs + +DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders" +HOMEPAGE="https://www.syslinux.org/" +# Final releases in 6.xx/$PV.tar.* (literal "xx") +# Testing releases in Testing/$PV/$PV.tar.* +SRC_URI_DIR=${PV:0:1}.xx +SRC_URI_TESTING=Testing/${PV:0:4} +[[ ${PV/_alpha} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_beta} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_pre} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +[[ ${PV/_rc} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING +SRC_URI="https://www.kernel.org/pub/linux/utils/boot/syslinux/${SRC_URI_DIR}/${P/_/-}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* amd64 x86" +IUSE="custom-cflags" + +RDEPEND="sys-fs/mtools + dev-perl/Crypt-PasswdMD5 + dev-perl/Digest-SHA1" +DEPEND="${RDEPEND} + dev-lang/nasm + >=sys-boot/gnu-efi-3.0u + virtual/os-headers" + +S=${WORKDIR}/${P/_/-} + +# This ebuild is a departure from the old way of rebuilding everything in syslinux +# This departure is necessary since hpa doesn't support the rebuilding of anything other +# than the installers. + +# These are executables which come precompiled and are run by the boot loader +QA_PREBUILT="usr/share/${PN}/*.c32" + +# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore + +src_prepare() { + rm -f gethostip #bug 137081 + + epatch "${FILESDIR}"/${PN}-6.03-sysmacros.patch #579928 + epatch "${FILESDIR}"/${P}-singleloadsegment.patch #662678 + + # Don't prestrip or override user LDFLAGS, bug #305783 + local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \ + sample/Makefile utils/Makefile" + sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed" + + if use custom-cflags; then + sed -i ${SYSLINUX_MAKEFILES} \ + -e 's|-g -Os||g' \ + -e 's|-Os||g' \ + -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \ + || die "sed custom-cflags failed" + else + QA_FLAGS_IGNORED=" + /sbin/extlinux + /usr/bin/memdiskfind + /usr/bin/gethostip + /usr/bin/isohybrid + /usr/bin/syslinux + " + fi + case ${ARCH} in + amd64) loaderarch="efi64" ;; + x86) loaderarch="efi32" ;; + *) ewarn "Unsupported architecture, building installers only." ;; + esac + + # building with ld.gold causes problems, bug #563364 + if tc-ld-is-gold; then + ewarn "Building syslinux with the gold linker may cause problems, see bug #563364" + if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then + tc-ld-disable-gold + ewarn "set I_KNOW_WHAT_I_AM_DOING=1 to override this." + else + ewarn "Continuing anyway as requested." + fi + fi + + epatch_user +} + +src_compile() { + # build system abuses the LDFLAGS variable to pass arguments to ld + unset LDFLAGS + if [[ ! -z ${loaderarch} ]]; then + emake CC="$(tc-getCC)" LD="$(tc-getLD)" ${loaderarch} + fi + emake CC="$(tc-getCC)" LD="$(tc-getLD)" ${loaderarch} installer +} + +src_install() { + # parallel install fails sometimes + einfo "loaderarch=${loaderarch}" + emake -j1 LD="$(tc-getLD)" INSTALLROOT="${D}" MANDIR=/usr/share/man bios ${loaderarch} install + dodoc README NEWS doc/*.txt +} + +pkg_postinst() { + # print warning for users upgrading from the previous stable version + if has 4.07 ${REPLACING_VERSIONS}; then + ewarn "syslinux now uses dynamically linked ELF executables. Before you reboot," + ewarn "ensure that needed dependencies are fulfilled. For example, run from your" + ewarn "syslinux directory:" + ewarn + ewarn "LD_LIBRARY_PATH=\".\" ldd menu.c32" + fi +} diff --git a/sys-boot/systemd-boot/Manifest b/sys-boot/systemd-boot/Manifest new file mode 100644 index 000000000000..abc1d65828e9 --- /dev/null +++ b/sys-boot/systemd-boot/Manifest @@ -0,0 +1,2 @@ +DIST systemd-243.tar.gz 8242522 BLAKE2B 89e3ebbea5a99061329f7c78220a66c1e075d5ba90dfdf5ee8d0d9b762ef4600dc82d8ca2054632e5e343b6272cd8046c92f7f99dcfa8287c5ef2b42fb96d4cb SHA512 56b52a297aa5ac04d9667eb3afb1598725b197de73ff72baa1aabbc2844e36fba7b7fccdf6d214ae8b5b926616b2b7e15772763aaa80ec938d74333ff9c8673e +DIST systemd-245.tar.gz 8993479 BLAKE2B be0b1fca5ba8585978f570868bc9135c1fee78ea64dcdf8b1a3419e856a83da90104ed2f86e5f3e5b0b6f29d4b34f603bfe1e4cbc61ccf71bedce547db62ff35 SHA512 1b80d0e02472dfc4197f11dab4f56cf90e8a6e105ce19f837cb11335b6d8577ed49031dad94cdb41aa9bdc06ec8eec62c8e9246272b83935e7bb9dcd3cd8c012 diff --git a/sys-boot/systemd-boot/files/237-libshared-static.patch b/sys-boot/systemd-boot/files/237-libshared-static.patch new file mode 100644 index 000000000000..9966a5f79162 --- /dev/null +++ b/sys-boot/systemd-boot/files/237-libshared-static.patch @@ -0,0 +1,15 @@ +diff --git a/meson.build b/meson.build +index 36a62d280..87f8da29b 100644 +--- a/meson.build ++++ b/meson.build +@@ -1662,9 +1662,8 @@ if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1 + exe = executable('bootctl', + 'src/boot/bootctl.c', + include_directories : includes, +- link_with : [libshared], ++ link_with : [libshared_static, libsystemd_static], + dependencies : [libblkid], +- install_rpath : rootlibexecdir, + install : true) + public_programs += [exe] + endif diff --git a/sys-boot/systemd-boot/metadata.xml b/sys-boot/systemd-boot/metadata.xml new file mode 100644 index 000000000000..a4053affe26e --- /dev/null +++ b/sys-boot/systemd-boot/metadata.xml @@ -0,0 +1,12 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>floppym@gentoo.org</email> + <name>Mike Gilbert</name> + </maintainer> + <upstream> + <remote-id type="github">systemd/systemd</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/systemd-boot/systemd-boot-243.ebuild b/sys-boot/systemd-boot/systemd-boot-243.ebuild new file mode 100644 index 000000000000..99dbbaa4668a --- /dev/null +++ b/sys-boot/systemd-boot/systemd-boot-243.ebuild @@ -0,0 +1,114 @@ +# Copyright 2016-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit meson toolchain-funcs + +DESCRIPTION="UEFI boot manager from systemd (formerly gummiboot)" +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/" +SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> systemd-${PV}.tar.gz" + +LICENSE="GPL-2 LGPL-2.1 MIT public-domain" +SLOT="0" +KEYWORDS="~amd64" +IUSE="" +RESTRICT="test" + +BDEPEND=" + app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd:4.5 + app-text/docbook-xsl-stylesheets + dev-libs/libxslt:0 + >=dev-util/intltool-0.50 + dev-util/gperf + >=dev-util/patchelf-0.10 + virtual/pkgconfig +" +COMMON_DEPEND=" + >=sys-apps/util-linux-2.30 +" +DEPEND="${COMMON_DEPEND} + >=sys-boot/gnu-efi-3.0.2 + sys-libs/libcap +" +RDEPEND="${COMMON_DEPEND} + !sys-apps/systemd +" + +S="${WORKDIR}/systemd-${PV}" + +PATCHES=( + "${FILESDIR}/237-libshared-static.patch" +) + +src_configure() { + local emesonargs=( + -Dblkid=true + -Defi=true + -Dgnu-efi=true + -Defi-cc="$(tc-getCC)" + -Defi-ld="$(tc-getLD)" + -Dsplit-usr=true + -Drootprefix="${EPREFIX:-/}" + + -Dacl=false + -Dapparmor=false + -Daudit=false + -Dbzip2=false + -Delfutils=false + -Dgcrypt=false + -Dgnutls=false + -Dkmod=false + -Dlibcryptsetup=false + -Dlibcurl=false + -Dlibidn=false + -Dlibidn2=false + -Dlibiptc=false + -Dlz4=false + -Dmicrohttpd=false + -Dpam=false + -Dqrencode=false + -Dseccomp=false + -Dselinux=false + -Dxkbcommon=false + -Dxz=false + ) + meson_src_configure +} + +set_efi_arch() { + case "$(tc-arch)" in + amd64) efi_arch=x64 ;; + arm) efi_arch=arm ;; + arm64) efi_arch=aa64 ;; + x86) efi_arch=x86 ;; + esac +} + +src_compile() { + local efi_arch + set_efi_arch + local targets=( + bootctl + man/bootctl.1 + man/kernel-install.8 + src/boot/efi/linux${efi_arch}.efi.stub + src/boot/efi/systemd-boot${efi_arch}.efi + ) + cd "${BUILD_DIR}" || die + eninja "${targets[@]}" + patchelf --remove-rpath bootctl || die +} + +src_install() { + local efi_arch + set_efi_arch + dobin "${BUILD_DIR}"/bootctl src/kernel-install/kernel-install + doman "${BUILD_DIR}"/man/{bootctl.1,kernel-install.8} + exeinto usr/lib/kernel/install.d + doexe src/kernel-install/{50-depmod,90-loaderentry}.install + insinto usr/lib/systemd/boot/efi + doins "${BUILD_DIR}"/src/boot/efi/{linux${efi_arch}.efi.stub,systemd-boot${efi_arch}.efi} + einstalldocs +} diff --git a/sys-boot/systemd-boot/systemd-boot-245.ebuild b/sys-boot/systemd-boot/systemd-boot-245.ebuild new file mode 100644 index 000000000000..df34ee3df7f0 --- /dev/null +++ b/sys-boot/systemd-boot/systemd-boot-245.ebuild @@ -0,0 +1,114 @@ +# Copyright 2016-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit meson toolchain-funcs + +DESCRIPTION="UEFI boot manager from systemd (formerly gummiboot)" +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/" +SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> systemd-${PV}.tar.gz" + +LICENSE="GPL-2 LGPL-2.1 MIT public-domain" +SLOT="0" +KEYWORDS="~amd64" +IUSE="" +RESTRICT="test" + +BDEPEND=" + app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd:4.5 + app-text/docbook-xsl-stylesheets + dev-libs/libxslt:0 + >=dev-util/intltool-0.50 + dev-util/gperf + >=dev-util/patchelf-0.10 + virtual/pkgconfig +" +COMMON_DEPEND=" + >=sys-apps/util-linux-2.30 +" +DEPEND="${COMMON_DEPEND} + >=sys-boot/gnu-efi-3.0.2 + sys-libs/libcap +" +RDEPEND="${COMMON_DEPEND} + !sys-apps/systemd +" + +S="${WORKDIR}/systemd-${PV}" + +PATCHES=( + "${FILESDIR}/237-libshared-static.patch" +) + +src_configure() { + local emesonargs=( + -Dblkid=true + -Defi=true + -Dgnu-efi=true + -Defi-cc="$(tc-getCC)" + -Defi-ld="$(tc-getLD)" + -Dsplit-usr=true + -Drootprefix="${EPREFIX:-/}" + + -Dacl=false + -Dapparmor=false + -Daudit=false + -Dbzip2=false + -Delfutils=false + -Dgcrypt=false + -Dgnutls=false + -Dkmod=false + -Dlibcryptsetup=false + -Dlibcurl=false + -Dlibidn=false + -Dlibidn2=false + -Dlibiptc=false + -Dlz4=false + -Dmicrohttpd=false + -Dpam=false + -Dqrencode=false + -Dseccomp=false + -Dselinux=false + -Dxkbcommon=false + -Dxz=false + ) + meson_src_configure +} + +set_efi_arch() { + case "$(tc-arch)" in + amd64) efi_arch=x64 ;; + arm) efi_arch=arm ;; + arm64) efi_arch=aa64 ;; + x86) efi_arch=x86 ;; + esac +} + +src_compile() { + local efi_arch + set_efi_arch + local targets=( + bootctl + man/bootctl.1 + man/kernel-install.8 + src/boot/efi/linux${efi_arch}.efi.stub + src/boot/efi/systemd-boot${efi_arch}.efi + ) + cd "${BUILD_DIR}" || die + eninja "${targets[@]}" + patchelf --remove-rpath bootctl || die +} + +src_install() { + local efi_arch + set_efi_arch + dobin "${BUILD_DIR}"/bootctl src/kernel-install/kernel-install + doman "${BUILD_DIR}"/man/{bootctl.1,kernel-install.8} + exeinto usr/lib/kernel/install.d + doexe src/kernel-install/{50-depmod,90-loaderentry}.install + insinto usr/lib/systemd/boot/efi + doins "${BUILD_DIR}"/src/boot/efi/{linux${efi_arch}.efi.stub,systemd-boot${efi_arch}.efi} + einstalldocs +} diff --git a/sys-boot/tboot/Manifest b/sys-boot/tboot/Manifest new file mode 100644 index 000000000000..e82f629d1eb6 --- /dev/null +++ b/sys-boot/tboot/Manifest @@ -0,0 +1 @@ +DIST tboot-1.9.11.tar.gz 709092 BLAKE2B 97b6ea5a09e1adbf1fbdc36516e0e80d3acc67469f297603125542aed8235e6533afb96e6c38885b87e4584392da40d9f65d00eced2b8a87a2ecf61a17c3a985 SHA512 5c2466438ad3ab95ca66fe4d460f4e6b31ccd3c6ac79221b129883df4180fce4878dd07a5f180bb79fae13b59fa90c05aeda7339159d1d950011a59645024b8a diff --git a/sys-boot/tboot/files/tboot-1.9.11-genkernel-path.patch b/sys-boot/tboot/files/tboot-1.9.11-genkernel-path.patch new file mode 100644 index 000000000000..b2459816068b --- /dev/null +++ b/sys-boot/tboot/files/tboot-1.9.11-genkernel-path.patch @@ -0,0 +1,62 @@ +diff -r 9998b2fb83fd tboot/20_linux_tboot +--- a/tboot/20_linux_tboot Wed Apr 10 11:47:06 2019 +0200 ++++ b/tboot/20_linux_tboot Tue Jul 23 22:42:00 2019 -0500 +@@ -173,7 +173,16 @@ + EOF + } + +-linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do ++machine=`uname -m` ++case "$machine" in ++ i?86) GENKERNEL_ARCH="x86" ;; ++ mips|mips64) GENKERNEL_ARCH="mips" ;; ++ mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;; ++ arm*) GENKERNEL_ARCH="arm" ;; ++ *) GENKERNEL_ARCH="$machine" ;; ++esac ++ ++linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do + basename=$(basename $i) + version=$(echo $basename | sed -e "s,^[^0-9]*-,,g") + if grub_file_is_not_garbage "$i" && grep -qx "CONFIG_INTEL_TXT=y" /boot/config-${version} 2> /dev/null ; then echo -n "$i " ; fi +@@ -219,7 +228,9 @@ + "initrd.img-${alt_version}" "initrd-${alt_version}.img" \ + "initrd-${alt_version}" "initramfs-${alt_version}.img" \ + "initramfs-genkernel-${version}" \ +- "initramfs-genkernel-${alt_version}"; do ++ "initramfs-genkernel-${alt_version}" \ ++ "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ ++ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do + if test -e "${dirname}/${i}" ; then + initrd="$i" + break +diff -r 9998b2fb83fd tboot/20_linux_xen_tboot +--- a/tboot/20_linux_xen_tboot Wed Apr 10 11:47:06 2019 +0200 ++++ b/tboot/20_linux_xen_tboot Tue Jul 23 22:42:00 2019 -0500 +@@ -167,6 +167,15 @@ + EOF + } + ++machine=`uname -m` ++case "$machine" in ++ i?86) GENKERNEL_ARCH="x86" ;; ++ mips|mips64) GENKERNEL_ARCH="mips" ;; ++ mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;; ++ arm*) GENKERNEL_ARCH="arm" ;; ++ *) GENKERNEL_ARCH="$machine" ;; ++esac ++ + linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do + if grub_file_is_not_garbage "$i"; then + basename=$(basename $i) +@@ -234,7 +243,9 @@ + "initrd-${version}" "initrd.img-${alt_version}" \ + "initrd-${alt_version}.img" "initrd-${alt_version}" \ + "initramfs-genkernel-${version}" \ +- "initramfs-genkernel-${alt_version}" ; do ++ "initramfs-genkernel-${alt_version}" \ ++ "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \ ++ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do + if test -e "${dirname}/${i}" ; then + initrd="$i" + break diff --git a/sys-boot/tboot/metadata.xml b/sys-boot/tboot/metadata.xml new file mode 100644 index 000000000000..f12139065c14 --- /dev/null +++ b/sys-boot/tboot/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>perfinion@gentoo.org</email> + <name>Jason Zaman</name> + </maintainer> + <longdescription lang="en"> + A pre-kernel/VMM module that uses Intel(R) Trusted Execution Technology to perform a measured and verified launch of an OS kernel/VMM. + </longdescription> + <upstream> + <remote-id type="sourceforge">tboot</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/tboot/tboot-1.9.11.ebuild b/sys-boot/tboot/tboot-1.9.11.ebuild new file mode 100644 index 000000000000..4778e6215bb4 --- /dev/null +++ b/sys-boot/tboot/tboot-1.9.11.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic mount-boot + +DESCRIPTION="Performs a measured and verified boot using Intel Trusted Execution Technology" +HOMEPAGE="https://sourceforge.net/projects/tboot/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86" +IUSE="custom-cflags libressl selinux" + +# requires patching the kernel src +RESTRICT="test" + +DEPEND="app-crypt/trousers +app-crypt/tpm-tools +!libressl? ( dev-libs/openssl:0=[-bindist] ) +libressl? ( dev-libs/libressl:0= )" + +RDEPEND="${DEPEND} +sys-boot/grub:2 +selinux? ( sec-policy/selinux-tboot )" + +DOCS=( README COPYING CHANGELOG ) +PATCHES=( "${FILESDIR}/${PN}-1.9.11-genkernel-path.patch" ) + +src_prepare() { + sed -i 's/ -Werror//g' Config.mk || die + sed -i 's/^INSTALL_STRIP = -s$//' Config.mk || die # QA Errors + + default +} + +src_compile() { + use custom-cflags && export TBOOT_CFLAGS=${CFLAGS} || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS + + if use amd64; then + export MAKEARGS="TARGET_ARCH=x86_64" + else + export MAKEARGS="TARGET_ARCH=i686" + fi + + default +} + +src_install() { + emake DISTDIR="${D}" install + + dodoc "${DOCS[@]}" + dodoc docs/*.txt lcptools/*.pdf || die "docs failed" + + cd "${D}" + mkdir -p usr/lib/tboot/ || die + mv boot usr/lib/tboot/ || die +} + +pkg_postinst() { + cp "${ROOT}/usr/lib/tboot/boot/*" "${ROOT}/boot/" || die + + ewarn "Please remember to download the SINIT AC Module relevant" + ewarn "for your platform from:" + ewarn "http://software.intel.com/en-us/articles/intel-trusted-execution-technology/" +} diff --git a/sys-boot/udk/Manifest b/sys-boot/udk/Manifest new file mode 100644 index 000000000000..5b45c5e5d81f --- /dev/null +++ b/sys-boot/udk/Manifest @@ -0,0 +1,3 @@ +DIST UDK2015.Complete.MyWorkSpace.zip 121736982 BLAKE2B b37bd9ead6ce2c665128199249483ecbcb0f410077d0ca61820bdccb7ae71f6dad870a3cf2dad79f997ad9114678fab3c15a17227ae33aa1ff66f9187aa3a568 SHA512 7856a8f29296f817e8fd09d8eaf7207f4e25a13faa10936d1ceb10cb6a900be265379722c0ade0ef93b1c640fef8693667d2567962e3288b20ae77f607f03d39 +DIST udk-2018-docs.zip 79352781 BLAKE2B 9d08579d4645121cabb7ac52850de6492f9990240da9236064352df0595867bfc6952c9858865a8ce1d81982ec0e2440dc19930a75595454257294462adc60d6 SHA512 6ba2d961f20267cafb94bd020e8fe71e1392f1f2cdbc5c9f0a43212253ddf137b3e12cc789299dfd1ea099bb1541703b995ae20d28f0275395f5f85ed0656954 +DIST udk-2018.tar.gz 38642782 BLAKE2B a10171659451d7d3df737066ec0471db1e5055bd52556d4d0654b244e827512db8d88e2b74b4dfe0189f768e0eab7a705aa32a720e047555995cf339ea50c62f SHA512 8fd9316f08a5c30f8684b2fde73906a943bb067ec91699f41796e27679af73dbc38efaa100a57d4b835656b402d9c08896abc5c10fd0d607a7e0173b3d7a60b2 diff --git a/sys-boot/udk/files/2015-makefile.template b/sys-boot/udk/files/2015-makefile.template new file mode 100644 index 000000000000..c8ae8b6b420e --- /dev/null +++ b/sys-boot/udk/files/2015-makefile.template @@ -0,0 +1,54 @@ +TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) +EXEC = «MODULE».efi +SRC = $(shell find $(TOP) -type f -name '*.c') +OBJ = $(SRC:.c=.o) +INC_DIR = /usr/include/«PACKAGE_NAME» +LIB_DIR = /usr/lib +«STATIC_LIBS» + +EFI_LDS = $(LIB_DIR)/GccBase.lds + +«MODULE_TYPE» +«IMAGE_ENTRY_POINT» + +«CP» +«RM» +«CC» +«DLINK» +«OBJCOPY» +«GENFW» + +CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror \ + -Wno-array-bounds -ffunction-sections -fdata-sections -c -iquote$(TOP) \ + -include AutoGen.h -I$(INC_DIR) -DSTRING_ARRAY_NAME=«MODULE»Strings -m64 \ + -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS \ + -mno-red-zone -Wno-address -mcmodel=large -Wno-address \ + -Wno-unused-but-set-variable +DLINK_FLAGS=-nostdlib -n -q --gc-sections --entry $(IMAGE_ENTRY_POINT) \ + -u $(IMAGE_ENTRY_POINT) -melf_x86_64 --oformat=elf64-x86-64 -L $(LIB_DIR) \ + --script=$(EFI_LDS) --defsym=PECOFF_HEADER_SIZE=«PECOFF_HEADER_SIZE» +«OBJCOPY_FLAGS» +«GENFW_FLAGS» + +all: $(EXEC) + +%.efi: $(OBJ) + $(DLINK) -o $(@:.efi=.dll) $(DLINK_FLAGS) \ + --start-group $(STATIC_LIBRARY_FILES) $^ --end-group + $(OBJCOPY) $(OBJCOPY_FLAGS) $(@:.efi=.dll) + $(CP) $(@:.efi=.dll) $(@:.efi=.debug) + $(OBJCOPY) --strip-unneeded -R .eh_frame $(@:.efi=.dll) + $(OBJCOPY) --add-gnu-debuglink=$(@:.efi=.debug) $(@:.efi=.dll) + $(GENFW) -e $(MODULE_TYPE) -o $@ $(@:.efi=.dll) $(GENFW_FLAGS) + $(RM) $(@:.efi=.dll) + +%.o: %.c + $(CC) $(CC_FLAGS) -o $@ $^ + +clean: + $(RM) *.o + +mrproper: clean + $(RM) $(EXEC) $(EXEC:.efi=.debug) + +.PHONY: all clean mrproper diff --git a/sys-boot/udk/files/2015-tools_def.template b/sys-boot/udk/files/2015-tools_def.template new file mode 100644 index 000000000000..5c866354a85c --- /dev/null +++ b/sys-boot/udk/files/2015-tools_def.template @@ -0,0 +1,42 @@ + +################# +# My custom toolchain +################# +*_CUSTOM_*_*_FAMILY = GCC +*_CUSTOM_*_MAKE_PATH = make +*_CUSTOM_*_ASL_PATH = DEF(UNIX_IASL_BIN) +*_CUSTOM_*_OBJCOPY_PATH = «OBJCOPY» +*_CUSTOM_*_CC_PATH = «CC» +*_CUSTOM_*_SLINK_PATH = «AR» +*_CUSTOM_*_DLINK_PATH = «LD» +*_CUSTOM_*_ASLDLINK_PATH = «LD» +*_CUSTOM_*_ASM_PATH = «CC» +*_CUSTOM_*_PP_PATH = «CC» +*_CUSTOM_*_VFRPP_PATH = «CC» +*_CUSTOM_*_ASLCC_PATH = «CC» +*_CUSTOM_*_ASLPP_PATH = «CC» +*_CUSTOM_*_RC_PATH = «OBJCOPY» +*_CUSTOM_*_PP_FLAGS = DEF(GCC_PP_FLAGS) +*_CUSTOM_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) +*_CUSTOM_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) +*_CUSTOM_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS) +*_CUSTOM_*_APP_FLAGS = +*_CUSTOM_*_ASL_FLAGS = DEF(IASL_FLAGS) +*_CUSTOM_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS) +*_CUSTOM_*_OBJCOPY_FLAGS = +*_CUSTOM_IA32_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m32 +*_CUSTOM_IA32_ASM_FLAGS = DEF(GCC_ASM_FLAGS) -m32 -march=i386 +*_CUSTOM_IA32_CC_FLAGS = «CFLAGS» -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -D EFI32 +*_CUSTOM_IA32_ASLDLINK_FLAGS = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry ReferenceAcpiTable -u ReferenceAcpiTable -m elf_i386 +*_CUSTOM_IA32_DLINK_FLAGS = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map -m elf_i386 --oformat=elf32-i386 +*_CUSTOM_IA32_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) --defsym=PECOFF_HEADER_SIZE=0x220 +*_CUSTOM_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) +*_CUSTOM_IA32_NASM_FLAGS = -f elf32 +*_CUSTOM_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64 +*_CUSTOM_X64_ASM_FLAGS = DEF(GCC_ASM_FLAGS) -m64 +*_CUSTOM_X64_CC_FLAGS = «CFLAGS» -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS +*_CUSTOM_X64_ASLDLINK_FLAGS = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry ReferenceAcpiTable -u ReferenceAcpiTable -m elf_x86_64 +*_CUSTOM_X64_DLINK_FLAGS = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map -m elf_x86_64 --oformat=elf64-x86-64 +*_CUSTOM_X64_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) --defsym=PECOFF_HEADER_SIZE=0x228 +*_CUSTOM_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) +*_CUSTOM_X64_NASM_FLAGS = -f elf64 diff --git a/sys-boot/udk/files/2018-makefile.template b/sys-boot/udk/files/2018-makefile.template new file mode 100644 index 000000000000..049a94facd81 --- /dev/null +++ b/sys-boot/udk/files/2018-makefile.template @@ -0,0 +1,41 @@ +TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) +BASE_NAME = «MODULE» +EXEC = «MODULE».efi +SRC = $(shell find $(TOP) -type f -name '*.c') +OBJ = $(SRC:.c=.o) +INC_DIR = /usr/include/«PACKAGE_NAME» +LIB_DIR = «LIB_DIR» +DEST_DIR_DEBUG = . +«STATIC_LIBS» + +EFI_LDS = «EFI_LDS» +«MODULE_TYPE» +«VARIABLES» + +comma:= , +empty:= +space:= $(empty) $(empty) + +all: $(EXEC) + +%.efi: $(OBJ) + $(DLINK) -o $(@:.efi=.dll) $(DLINK_FLAGS) \ + -Wl,--script,$(EFI_LDS) -Wl,--defsym=PECOFF_HEADER_SIZE=«PECOFF_HEADER_SIZE» \ + -Wl,$(subst $(space),$(comma),--start-group $(STATIC_LIBRARY_FILES)$^ --end-group) + $(OBJCOPY) $(OBJCOPY_FLAGS) $(@:.efi=.dll) + $(CP) $(@:.efi=.dll) $(@:.efi=.debug) + $(OBJCOPY) --strip-unneeded -R .eh_frame $(@:.efi=.dll) + $(OBJCOPY) --add-gnu-debuglink=$(@:.efi=.debug) $(@:.efi=.dll) + $(GENFW) -e $(MODULE_TYPE) -o $@ $(@:.efi=.dll) $(GENFW_FLAGS) + $(RM) $(@:.efi=.dll) + +%.o: %.c + $(CC) $(CC_FLAGS) -I$(INC_DIR) -iquote$(TOP) -c -o $@ $^ + +clean: + $(RM) *.o + +mrproper: clean + $(RM) $(EXEC) $(EXEC:.efi=.debug) + +.PHONY: all clean mrproper diff --git a/sys-boot/udk/files/udk-workspace.template b/sys-boot/udk/files/udk-workspace.template new file mode 100644 index 000000000000..e119c3ae1a36 --- /dev/null +++ b/sys-boot/udk/files/udk-workspace.template @@ -0,0 +1,63 @@ +#!/bin/bash +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +SCRIPT_NAME='udk-workspace' +[ -n "${BASH_SOURCE}" ] && SCRIPT_NAME="${BASH_SOURCE}" + +show_usage() { + if [ ! -z "${1}" ]; then + echo "${1}" >&2 + echo >&2 + fi + echo "Usage:" + echo ". ${SCRIPT_NAME} [folder]" + echo "where folder is the workspace folder - current directory is used if unspecified" +} + +create_workspace() { + local workspace_dir="${PWD}" + if [ ! -z "${1}" ]; then + workspace_dir="${1}" + if ! mkdir -p "${1}"; then + show_usage "Cannot create directory ${1}" + return 1 + fi + fi + + pushd "${workspace_dir}" >/dev/null + if ! mkdir -p Conf; then + show_usage "Cannot create configuration directory" + return 1 + fi + export WORKSPACE="${PWD}" + popd >/dev/null +} + +if [ "${1}" = "-h" ] || [ "${1}" = "--help" ]; then + show_usage + # Script may have been sourced + return 0 2>/dev/null + exit 0 +elif [ "${SCRIPT_NAME}" = "${0}" ]; then + show_usage "Script must be sourced" + exit 1 +elif [ $# -gt 1 ]; then + show_usage "Too many arguments" + return 1 +fi + +if ! create_workspace "${1}"; then + return 1 +fi +unset -f show_usage +unset -f create_workspace +shift $# + +export EDK_TOOLS_PATH="{EDK_BASE}/BaseTools" +. "{EDK_BASE}/edksetup.sh" + +echo "Do not forget to call this script each time you open a new terminal or work on" +echo "another workspace." +echo "For more information, type:" +echo "${SCRIPT_NAME} --help" diff --git a/sys-boot/udk/metadata.xml b/sys-boot/udk/metadata.xml new file mode 100644 index 000000000000..60370684a1b3 --- /dev/null +++ b/sys-boot/udk/metadata.xml @@ -0,0 +1,16 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>sveyret@gmail.com</email> + <name>Stéphane Veyret</name> + </maintainer> + <maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <upstream> + <remote-id type="github">tianocore/udk</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/udk/udk-2015-r1.ebuild b/sys-boot/udk/udk-2015-r1.ebuild new file mode 100644 index 000000000000..0e6388c5e43c --- /dev/null +++ b/sys-boot/udk/udk-2015-r1.ebuild @@ -0,0 +1,203 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) +PYTHON_REQ_USE="sqlite" + +inherit flag-o-matic multiprocessing python-single-r1 toolchain-funcs + +MY_V="${PN^^}${PV}" + +DESCRIPTION="Tianocore UEFI Development kit" +HOMEPAGE=" https://github.com/tianocore/tianocore.github.io/wiki/EDK-II" +SRC_URI="https://github.com/tianocore/${PN}/releases/download/${MY_V}/${MY_V}.Complete.MyWorkSpace.zip" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc examples" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +RESTRICT="strip" + +RDEPEND="${PYTHON_DEPS}" +DEPEND="${RDEPEND} + app-arch/unzip + dev-lang/nasm" + +S="${WORKDIR}/MyWorkSpace" + +# Generated libs for EFI can contain WX sections +QA_EXECSTACK="usr/lib*/libBaseLib.a:*" + +pkg_setup() { + python_setup 'python2.7' + + if [[ ${ARCH} == "amd64" ]]; then + ARCH=X64 + elif [[ ${ARCH} == "x86" ]]; then + ARCH=IA32 + fi + + # We will create a custom toolchain with user defined settings + TOOLCHAIN_TAG="CUSTOM" +} + +src_unpack() { + unpack ${A} + unpack "${WORKDIR}/${MY_V}.MyWorkSpace.zip" + + pushd "${S}" || die + unpack "${WORKDIR}/BaseTools(Unix).tar" + + local doc_name + local f + if use doc; then + mkdir -p "${S}/doc" || die + pushd "${S}/doc" >/dev/null || die + for f in "${WORKDIR}/Documents/"*" Document.zip"; do + doc_name=${f##*/} + doc_name=${doc_name% Document.zip} + if [[ -f "${WORKDIR}/Documents/${doc_name} Document.zip" ]]; then + unpack "${WORKDIR}/Documents/${doc_name} Document.zip" + mv "html" "${doc_name}" || die + fi + done + popd >/dev/null || die + fi + + popd >/dev/null || die +} + +src_configure() { + # Patch source file for permissive error (issue #639080) + sed -e "s/\(mStringFileName == \)'\\\\0'/\1NULL/" \ + -i "${S}/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp" \ + || die "Failed to patch source file" + sed -e "s/\((StringPtr != \)L'\\\\0'/\1NULL/" \ + -i "${S}/MdeModulePkg/Library/UefiHiiLib/HiiLib.c" \ + || die "Failed to patch source file" + # Compile of Base Tools is required for further setting up the environment + # Base tools does not like parallel make + sed -e "s|^\(CFLAGS\s*=\).*$|\1 ${CFLAGS} -MD -fshort-wchar -fno-strict-aliasing -nostdlib -c -fPIC|" \ + -i "${S}/BaseTools/Source/C/Makefiles/header.makefile" \ + || die "Failed to update makefile header" + local make_flags=( + CC="$(tc-getCC)" + CXX="$(tc-getCXX)" + AS="$(tc-getAS)" + AR="$(tc-getAR)" + LD="$(tc-getLD)" + ) + emake "${make_flags[@]}" -j1 -C BaseTools + . edksetup.sh BaseTools + + # Update flags in UDK parameter files + append-cflags -fshort-wchar -fno-strict-aliasing -c + append-cflags $(test-flags-CC -ffunction-sections) + append-cflags $(test-flags-CC -fdata-sections) + append-cflags $(test-flags-CC -fno-stack-protector) + append-cflags $(test-flags-CC -fno-asynchronous-unwind-tables) + if [[ "${ARCH}" == "X64" ]]; then + append-cflags $(test-flags-CC -m64) $(test-flags-CC -mno-red-zone) + append-cflags $(test-flags-CC -mcmodel=large) + else + append-cflags $(test-flags-CC -m32) $(test-flags-CC -malign-double) + fi + sed -e "s|^\(ACTIVE_PLATFORM\s*=\).*$|\1 MdeModulePkg/MdeModulePkg.dsc|" \ + -e "s|^\(TARGET\s*=\).*$|\1 RELEASE|" \ + -e "s|^\(TARGET_ARCH\s*=\).*$|\1 ${ARCH}|" \ + -e "s|^\(TOOL_CHAIN_TAG\s*=\).*$|\1 ${TOOLCHAIN_TAG}|" \ + -e "s|^\(MAX_CONCURRENT_THREAD_NUMBER\s*=\).*$|\1 $(makeopts_jobs)|" \ + -i "${S}/Conf/target.txt" || die "Failed to configure target file" + sed -e "s|«CC»|$(tc-getCC)|" \ + -e "s|«AR»|$(tc-getAR)|" \ + -e "s|«LD»|$(tc-getLD)|" \ + -e "s|«OBJCOPY»|$(tc-getOBJCOPY)|" \ + -e "s|«CFLAGS»|${CFLAGS}|" \ + "${FILESDIR}/${PV}-tools_def.template" >>"${S}/Conf/tools_def.txt" \ + || die "Failed to prepare tools definition file" +} + +src_compile() { + if use examples; then + ewarn "Examples installation does not work anymore" + ewarn "Try with a most recent version of the package" + fi + + build libraries || die "Failed to compile environment" +} + +src_install() { + local f + local build_dir="${S}/Build/MdeModule/RELEASE_${TOOLCHAIN_TAG}/${ARCH}" + + for f in "${build_dir}"/*/Library/*/*/OUTPUT/*.lib; do + local fn="lib${f##*/}" + newlib.a "${f}" "${fn%.lib}.a" + done + dolib.a "${S}/BaseTools/Scripts/GccBase.lds" + + insinto "/usr/include/${PN}" + doins "${S}/MdePkg/Include/"*.h + doins -r "${S}/MdePkg/Include/"{${ARCH}/.,Guid,IndustryStandard,Library,Pi,Ppi,Protocol,Uefi} + local hfile + while read -d '' -r hfile; do + doins -r "${hfile}/." + done < <(find "${S}" -name 'BaseTools' -prune -o -name 'MdePkg' -prune -o \ + -name 'CryptoPkg' -prune -o -type d -name Include -print0) + + dobin "${S}/BaseTools/Source/C/bin/GenFw" + + if use doc; then + docinto "html" + # Document installation may be very long, so split it and display message + for f in "${S}"/doc/*; do + ebegin "Install documentation for ${f##*/}" + dodoc -r "${f}" + eend $? + done + fi +} + +## +# Parameters: +# 1 - Path where to search for source files. +# 2 - Path where source files must be copied. +copySourceFiles() { + local dest_file + while read -d '' -r filename; do + dest_file="${2}${filename#${1}}" + mkdir -p "${dest_file%/*}" || die + mv "${filename}" "${dest_file}" || die + done < <(find "${1}" -name '*.h' -print0 -o -name '*.c' -print0) +} + +## +# Parameters: +# 1 - Path of the file to create. +# 2 - Name of the module. +# 3 - Path of the generated Makefile. +createMakefile() { + local static_libs=$(sed -n '/^STATIC_LIBRARY_FILES\s*=/,/^\s*\$(OUTPUT_DIR)/{/^\s*\$(OUTPUT_DIR)/b;p}' ${3} \ + | sed -e 's|^\s*\$(BIN_DIR).*/\([^/]*\)\.lib|\t-l\1|' -e 's|\\$|\\\\\\n|' | tr --delete '\n') + local pecoff_header_size; + [[ $ARCH == X64 ]] && pecoff_header_size='0x228' || pecoff_header_size='0x220' + sed -e "s|«MODULE»|${2}|" \ + -e "s|«PACKAGE_NAME»|${PN}|" \ + -e "s|«STATIC_LIBS»|${static_libs}|" \ + -e "s|«MODULE_TYPE»|$(grep -e '^MODULE_TYPE\s*=' ${3} | tail -1)|" \ + -e "s|«IMAGE_ENTRY_POINT»|$(grep -e '^IMAGE_ENTRY_POINT\s*=' ${3})|" \ + -e "s|«CP»|$(grep -e '^CP\s*=' ${3})|" \ + -e "s|«RM»|$(grep -e '^RM\s*=' ${3})|" \ + -e "s|«CC»|$(grep -e '^CC\s*=' ${3})|" \ + -e "s|«DLINK»|$(grep -e '^DLINK\s*=' ${3})|" \ + -e "s|«OBJCOPY»|$(grep -e '^OBJCOPY\s*=' ${3})|" \ + -e "s|«GENFW»|$(grep -e '^GENFW\s*=' ${3})|" \ + -e "s|«PECOFF_HEADER_SIZE»|${pecoff_header_size}|" \ + -e "s|«OBJCOPY_FLAGS»|$(grep -e '^OBJCOPY_FLAGS\s*=' ${3})|" \ + -e "s|«GENFW_FLAGS»|$(grep -e '^GENFW_FLAGS\s*=' ${3})|" \ + "${FILESDIR}/${PV}-makefile.template" >${1} \ + || die "Failed to create Makefile" +} diff --git a/sys-boot/udk/udk-2018-r1.ebuild b/sys-boot/udk/udk-2018-r1.ebuild new file mode 100644 index 000000000000..3ad3971c96a4 --- /dev/null +++ b/sys-boot/udk/udk-2018-r1.ebuild @@ -0,0 +1,146 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) +PYTHON_REQ_USE="sqlite" + +inherit multiprocessing python-single-r1 toolchain-funcs + +DESCRIPTION="Tianocore UEFI Development kit" +HOMEPAGE="https://github.com/tianocore/tianocore.github.io/wiki/EDK-II" + +if [[ ${PV} == *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/tianocore/edk2.git" + KEYWORDS="" +else + MY_V="${PN^^}${PV}" + SRC_URI="https://github.com/tianocore/edk2/archive/v${MY_V}.tar.gz -> ${P}.tar.gz + doc? ( https://github.com/tianocore/edk2/releases/download/v${MY_V}/${MY_V}.Documents.zip -> ${P}-docs.zip )" + S="${WORKDIR}/edk2-v${MY_V}" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="BSD-2" +SLOT="0" +IUSE="doc" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +RESTRICT="strip" + +RDEPEND="${PYTHON_DEPS}" +DEPEND="${RDEPEND} + >=dev-lang/nasm-2.14.02 + >=sys-power/iasl-20160729 + doc? ( app-arch/unzip )" + +DOCDIR="${WORKDIR}/Documents" + +# EFI pre-build libs +QA_PREBUILT=" + usr/lib/${P}/BeagleBoardPkg/Debugger_scripts/rvi_dummy.axf + usr/lib/${P}/ArmPkg/Library/GccLto/*.a +" +# GenBiosId is built upstream +# VfrCompile does not use LDFLAGS but next upsteam version should change this +QA_FLAGS_IGNORED=" + usr/lib/udk-2018/BaseTools/Source/C/bin/VfrCompile + usr/lib/${P}/Vlv2TbltDevicePkg/GenBiosId +" + +pkg_setup() { + if use x86; then + EFIARCH=IA32 + elif use amd64; then + EFIARCH=X64 + fi + + # Select toolchain within predefined ones + if tc-is-gcc; then + TOOLCHAIN_TAG="GCC5" + elif tc-is-clang; then + TOOLCHAIN_TAG="CLANG38" + else + TOOLCHAIN_TAG="ELFGCC" + fi +} + +src_unpack() { + default + + local doc_name + local f + if use doc; then + pushd "${DOCDIR}" >/dev/null || die + rm -f *.chm || die + for f in *.zip; do + unpack "${DOCDIR}/${f}" + mv html "${f%.zip}" || die + done + rm -f *.zip || die + popd >/dev/null || die + fi +} + +src_configure() { + sed -e "s|^\(BUILD_CFLAGS\s*=\).*$|\1 ${CFLAGS} -MD -fshort-wchar -fno-strict-aliasing -nostdlib -c -fPIC|" \ + -e "s|^\(BUILD_LFLAGS\s*=\).*$|\1 ${LDFLAGS}|" \ + -e "s|^\(BUILD_CXXFLAGS\s*=\).*$|\1 ${CXXFLAGS} -Wno-unused-result|" \ + -i "BaseTools/Source/C/Makefiles/header.makefile" \ + || die "Failed to update makefile header" +} + +src_compile() { + local make_flags=( + BUILD_CC="$(tc-getBUILD_CC)" + BUILD_CXX="$(tc-getBUILD_CXX)" + BUILD_AS="$(tc-getBUILD_AS)" + BUILD_AR="$(tc-getBUILD_AR)" + BUILD_LD="$(tc-getBUILD_LD)" + ) + # Base tools does not like parallel make + emake "${make_flags[@]}" -j1 -C BaseTools + + # Update template parameter files + sed -e "s|^\(ACTIVE_PLATFORM\s*=\).*$|\1 MdeModulePkg/MdeModulePkg.dsc|" \ + -e "s|^\(TARGET\s*=\).*$|\1 RELEASE|" \ + -e "s|^\(TARGET_ARCH\s*=\).*$|\1 ${EFIARCH}|" \ + -e "s|^\(TOOL_CHAIN_TAG\s*=\).*$|\1 ${TOOLCHAIN_TAG}|" \ + -e "s|^\(MAX_CONCURRENT_THREAD_NUMBER\s*=\).*$|\1 $(makeopts_jobs)|" \ + -i "BaseTools/Conf/target.template" || die "Failed to configure target file" + + # Clean unneeded files + find . -name '*.bat' -o -name '*.exe' -exec rm -f {} \; || die + find ./BaseTools/Source/C -mindepth 1 -maxdepth 1 \! -name 'bin' -exec rm -rf {} \; || die + + # Upsteam hack (symbolic link) should only be created if needed + rm "${S}/EmulatorPkg/Unix/Host/X11IncludeHack" || die + + # Create workspace script file + sed -e "s|{EDK_BASE}|${EPREFIX}/usr/lib/${P}|" \ + "${FILESDIR}"/udk-workspace.template \ + > "${T}/udk-workspace" || die "Failed to build udk-workspace" +} + +src_install() { + dobin "${T}/udk-workspace" + + # Use mkdir && cp here as doins does not preserve execution bits + mkdir -p "${ED}/usr/lib/${P}" || die + cp -pR "${S}"/* "${D}/usr/lib/${P}" || die + dosym "${P}" "/usr/lib/${PN}" + + local HTML_DOCS + use doc && HTML_DOCS=( "${DOCDIR}"/. ) + einstalldocs +} + +pkg_postinst() { + elog "To create a new workspace, execute:" + elog " . udk-workspace [workspace_dir]" + elog "You can link appropriate packages to your workspace. For example," + elog "in order to build MdeModulePkg and examples, you can try:" + elog " ln -s \"${EROOT}/usr/lib/${P}/\"Mde{Module,}Pkg ." + elog " build -a ${EFIARCH} all" +} diff --git a/sys-boot/unetbootin/Manifest b/sys-boot/unetbootin/Manifest new file mode 100644 index 000000000000..27e5e95bad9d --- /dev/null +++ b/sys-boot/unetbootin/Manifest @@ -0,0 +1,6 @@ +DIST unetbootin-661-qt5.patch.tar.xz 8060 BLAKE2B 58cb323166e344ecabf5d372e80ff0367a1344866a6e8dea4b2677a85ea6ae0b5591480a3bcbbfc3a51d391b07adf0d5f370ee77e4c7e1d6f2b727aedf274cf0 SHA512 c1226575484fa63c94ca4da875a26c7bd64bcb27d8e07ea5b67bb3f2546f31d1360d10c363cd7301476811e332c9524c96d6ba482c894b86a5b28ca8a1c8b385 +DIST unetbootin-661.tar.gz 16257579 BLAKE2B 2f92cf286c8010a80d4d4cc48a7ece55e159af9f3729277d97eb99ef2ebe8945023d03c51d6e97d7101d8547240e3c2152004222ec4c825ef4ab954c4018e7b0 SHA512 bbf74a4c4ca9b52f4da672eb54524b7fcb796c65ba80700dc3c6f2677bde37574f42a11c213cc4d4eee38783aed650beee1e2894f60185745e509a2e9571f70a +DIST unetbootin-675-qt5.patch.xz 7636 BLAKE2B f8c475491e6cf0557a192380726376c1dadba2e52478139d42023e867de86c5c1727719fa123fb412dbb20fca5763a3192889618e75ef6d8bba2d20eb1cf9403 SHA512 da636a3f6cd6a45d6786d92e94741d74f6c5de7d74570af45eac08718a822cdef5baac6c62d7ed68a788e9518e050f3a48a46f8f374c07e0b4c0d90c3613185d +DIST unetbootin-675.tar.gz 23221792 BLAKE2B fb3a6fce9d2a47b83e2e4c1a579d20594a637215b7c6456d6b0a59a592da660b13bdbea52aa5a4f902e410e9d0e2d447d085f040d321029a96b7ff957a59d11e SHA512 7cb5da4a876125ff010fc6a5aab2b5bb6eeec0f1ac6f2dd86efa2c3eaebaedff8c2167f9dc77053936955703cd2a98dd11a84b8de930dcfc1c2b0f6aeaf7ee61 +DIST unetbootin-677.tar.gz 23479226 BLAKE2B b5a5b111c5f96cc603975f535b55dd8e6191cc92972f54591ae6673394abae15e2652f737b8dc02f8b26a1247a9663cbda3b0d2d7b8b8dfe9eb117711f08d053 SHA512 f86b25dabc27f12bdb65a590c4ffa25aa509a78aa29cecde73918d8bc36dc3e6597b2b7e1803f7fa86a884347506e9c25b361ce89c26e0f6449e0c1ef29355d1 +DIST unetbootin-681.tar.gz 23481527 BLAKE2B b8c75156539a07bdacf1185ed898867b1e3df91a87486b7291e4bffc0c754c1ea3fe8a13a2ade5507a886e05904daa90877d29bd72ae1c353cb20dd64264e391 SHA512 9ac8c51f3b65bd6f051caa0270c239ec8aaabb2d3b92bec7b18803d3dcfdbe2bbca4e25124477f4e7b83ee10ba2aa08cdf055e8c9bb042cbebcd3ff6a96315b9 diff --git a/sys-boot/unetbootin/files/unetbootin-581-desktop.patch b/sys-boot/unetbootin/files/unetbootin-581-desktop.patch new file mode 100644 index 000000000000..ab1912b2e8a0 --- /dev/null +++ b/sys-boot/unetbootin/files/unetbootin-581-desktop.patch @@ -0,0 +1,24 @@ + * unetbootin.desktop: error: key "GenericName[en_US]" in group "Desktop Entry" + is a localized key, but there is no non-localized key "GenericName" + * unetbootin.desktop: warning: value "Application;System;" for key + "Categories" in group "Desktop Entry" contains a deprecated value + * "Application" + + + +--- a/unetbootin.desktop ++++ b/unetbootin.desktop +@@ -2,11 +2,11 @@ + Version=1.0 + Name=UNetbootin + Comment=Tool for creating Live USB drives +-Categories=Application;System; ++Categories=System; + Exec=/usr/bin/unetbootin + Terminal=false + Type=Application + Name[en_US]=UNetbootin +-GenericName[en_US]=UNetbootin ++GenericName=UNetbootin + Comment[en_US]=Tool for creating Live USB drives + Icon=unetbootin diff --git a/sys-boot/unetbootin/files/unetbootin-675-desktop.patch b/sys-boot/unetbootin/files/unetbootin-675-desktop.patch new file mode 100644 index 000000000000..b71907db38d8 --- /dev/null +++ b/sys-boot/unetbootin/files/unetbootin-675-desktop.patch @@ -0,0 +1,23 @@ + * unetbootin.desktop: error: key "GenericName[en_US]" in group "Desktop Entry" + is a localized key, but there is no non-localized key "GenericName" + * unetbootin.desktop: warning: value "Application;System;" for key + "Categories" in group "Desktop Entry" contains a deprecated value + * "Application" + +--- a/unetbootin.desktop ++++ b/unetbootin.desktop +@@ -2,11 +2,9 @@ + Version=1.0 + Name=UNetbootin + Comment=Tool for creating Live USB drives +-Categories=Application;System; +-Exec=/usr/bin/unetbootin_asroot ++Categories=System; ++Exec=/usr/bin/unetbootin + Terminal=false + Type=Application +-Name[en_US]=UNetbootin +-GenericName[en_US]=UNetbootin +-Comment[en_US]=Tool for creating Live USB drives ++GenericName=UNetbootin + Icon=unetbootin diff --git a/sys-boot/unetbootin/metadata.xml b/sys-boot/unetbootin/metadata.xml new file mode 100644 index 000000000000..b345cb312bee --- /dev/null +++ b/sys-boot/unetbootin/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>jer@gentoo.org</email> + <name>Jeroen Roovers</name> + </maintainer> + <upstream> + <remote-id type="sourceforge">unetbootin</remote-id> + <remote-id type="github">unetbootin/unetbootin</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/unetbootin/unetbootin-661.ebuild b/sys-boot/unetbootin/unetbootin-661.ebuild new file mode 100644 index 000000000000..e91aabaaf4d8 --- /dev/null +++ b/sys-boot/unetbootin/unetbootin-661.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PATCHSET="${P}-qt5.patch.tar.xz" +inherit desktop qmake-utils + +DESCRIPTION="UNetbootin installs Linux/BSD distributions to a partition or USB drive" +HOMEPAGE="https://github.com/unetbootin/unetbootin" +SRC_URI="https://github.com/unetbootin/unetbootin/archive/${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~asturm/distfiles/${PATCHSET}" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="amd64 x86" + +UNBI_LINGUAS=" + am ar ast be bg bn ca cs da de el eo es et eu fa fi fo fr gl he hr hu id it + ja lt lv ml ms nan nb nl nn pl pt_BR pt ro ru si sk sl sr sv sw tr uk ur vi + zh_CN zh_TW +" + +for lingua in ${UNBI_LINGUAS}; do + IUSE="${IUSE} l10n_${lingua/_/-}" +done + +S=${WORKDIR}/${P}/src/${PN} + +COMMON_DEPEND=" + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5 + dev-qt/qtwidgets:5 +" +DEPEND="${COMMON_DEPEND} + dev-qt/linguist-tools:5 +" +RDEPEND="${COMMON_DEPEND} + app-arch/p7zip + sys-boot/syslinux + sys-fs/mtools +" + +PATCHES=( + "${FILESDIR}/${PN}-581-desktop.patch" + "${WORKDIR}"/${PATCHSET/.tar.xz/} +) + +src_prepare() { + default + + # QA check in case linguas are added or removed + enum() { + echo ${#} + } + [[ $(enum ${UNBI_LINGUAS}) -eq $(( $(enum $(echo ${PN}_*.ts) ) -1 )) ]] \ + || die "Numbers of recorded and actual linguas do not match" + unset enum + + # Remove localisations + local lingua + for lingua in ${UNBI_LINGUAS}; do + if ! use l10n_${lingua/_/-}; then + sed -i ${PN}.pro -e "/\.*${PN}_${lingua}\.ts.*/d" || die + rm ${PN}_${lingua}.ts || die + fi + done +} + +src_configure() { + sed -i -e '/^RESOURCES/d' unetbootin.pro || die + + UNBN_QTPATH="$(qt5_get_bindir)/" + "${UNBN_QTPATH}"lrelease ${PN}.pro || die + + eqmake5 ${PN}.pro || die +} + +src_install() { + dobin ${PN} + + domenu ${PN}.desktop + + for file in ${PN}*.png; do + size="${file/${PN}_}" + size="${size/.png}x${size/.png}" + insinto /usr/share/icons/hicolor/${size}/apps + newins ${file} ${PN}.png + done + + local lingua + for lingua in ${UNBI_LINGUAS}; do + if use l10n_${lingua/_/-}; then + insinto /usr/share/${PN} + doins ${PN}_${lingua}.qm + fi + done +} diff --git a/sys-boot/unetbootin/unetbootin-675.ebuild b/sys-boot/unetbootin/unetbootin-675.ebuild new file mode 100644 index 000000000000..627b3c0182a6 --- /dev/null +++ b/sys-boot/unetbootin/unetbootin-675.ebuild @@ -0,0 +1,103 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit desktop flag-o-matic qmake-utils + +DESCRIPTION="UNetbootin installs Linux/BSD distributions to a partition or USB drive" +HOMEPAGE="https://github.com/unetbootin/unetbootin" +SRC_URI=" + https://github.com/unetbootin/unetbootin/archive/${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~jer/${P}-qt5.patch.xz +" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~x86" + +UNBI_LINGUAS=" + am ar ast be bg bn ca cs da de el eo es et eu fa fi fo fr gl he hr hu id it + ja lt lv ml ms nan nb nl nn pl pt_BR pt ro ru si sk sl sr sv sw tr uk ur vi + zh_CN zh_TW +" + +for lingua in ${UNBI_LINGUAS}; do + IUSE="${IUSE} l10n_${lingua/_/-}" +done + +S=${WORKDIR}/${P}/src/${PN} + +COMMON_DEPEND=" + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5 + dev-qt/qtwidgets:5 +" +BDEPEND=" + ${COMMON_DEPEND} + dev-qt/linguist-tools:5 +" +RDEPEND=" + ${COMMON_DEPEND} + app-arch/p7zip + sys-boot/syslinux + sys-fs/mtools +" + +PATCHES=( + "${FILESDIR}"/${PN}-675-desktop.patch + "${WORKDIR}"/${PN}-675-qt5.patch +) + +src_prepare() { + default + + # QA check in case linguas are added or removed + enum() { + echo ${#} + } + [[ $(enum ${UNBI_LINGUAS}) -eq $(( $(enum $(echo ${PN}_*.ts) ) -1 )) ]] \ + || die "Numbers of recorded and actual linguas do not match" + unset enum + + # Remove localisations + local lingua + for lingua in ${UNBI_LINGUAS}; do + if ! use l10n_${lingua/_/-}; then + sed -i ${PN}.pro -e "/\.*${PN}_${lingua}\.ts.*/d" || die + rm ${PN}_${lingua}.ts || die + fi + done + append-cflags -DNOSTATIC + append-cxxflags -DNOSTATIC +} + +src_configure() { + sed -i -e '/^RESOURCES/d' unetbootin.pro || die + + UNBN_QTPATH="$(qt5_get_bindir)/" + "${UNBN_QTPATH}"lrelease ${PN}.pro || die + + eqmake5 ${PN}.pro || die +} + +src_install() { + dobin ${PN} + + domenu ${PN}.desktop + + for file in ${PN}*.png; do + size="${file/${PN}_}" + size="${size/.png}x${size/.png}" + insinto /usr/share/icons/hicolor/${size}/apps + newins ${file} ${PN}.png + done + + local lingua + for lingua in ${UNBI_LINGUAS}; do + if use l10n_${lingua/_/-}; then + insinto /usr/share/${PN} + doins ${PN}_${lingua}.qm + fi + done +} diff --git a/sys-boot/unetbootin/unetbootin-677-r1.ebuild b/sys-boot/unetbootin/unetbootin-677-r1.ebuild new file mode 100644 index 000000000000..0a9a25ac4678 --- /dev/null +++ b/sys-boot/unetbootin/unetbootin-677-r1.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit desktop flag-o-matic qmake-utils xdg-utils + +DESCRIPTION="UNetbootin installs Linux/BSD distributions to a partition or USB drive" +HOMEPAGE="https://github.com/unetbootin/unetbootin" +SRC_URI=" + https://github.com/unetbootin/unetbootin/archive/${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~jer/${PN}-675-qt5.patch.xz +" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~x86" + +UNBI_LINGUAS=" + am ar ast be bg bn ca cs da de el eo es et eu fa fi fo fr gl he hr hu id it + ja lt lv ml ms nan nb nl nn pl pt_BR pt ro ru si sk sl sr sv sw tr uk ur vi + zh_CN zh_TW +" + +for lingua in ${UNBI_LINGUAS}; do + IUSE="${IUSE} l10n_${lingua/_/-}" +done + +S=${WORKDIR}/${P}/src/${PN} + +COMMON_DEPEND=" + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5 + dev-qt/qtwidgets:5 +" +BDEPEND=" + ${COMMON_DEPEND} + dev-qt/linguist-tools:5 +" +RDEPEND=" + ${COMMON_DEPEND} + app-arch/p7zip + sys-boot/syslinux + sys-fs/mtools +" + +PATCHES=( + "${FILESDIR}"/${PN}-675-desktop.patch + "${WORKDIR}"/${PN}-675-qt5.patch +) + +src_prepare() { + default + + # QA check in case linguas are added or removed + enum() { + echo ${#} + } + [[ $(enum ${UNBI_LINGUAS}) -eq $(( $(enum $(echo ${PN}_*.ts) ) -1 )) ]] \ + || die "Numbers of recorded and actual linguas do not match" + unset enum + + # Remove localisations + local lingua + for lingua in ${UNBI_LINGUAS}; do + if ! use l10n_${lingua/_/-}; then + sed -i ${PN}.pro -e "/\.*${PN}_${lingua}\.ts.*/d" || die + rm ${PN}_${lingua}.ts || die + fi + done + append-cflags -DNOSTATIC + append-cxxflags -DNOSTATIC +} + +src_configure() { + sed -i -e '/^RESOURCES/d' unetbootin.pro || die + + UNBN_QTPATH="$(qt5_get_bindir)/" + "${UNBN_QTPATH}"lrelease ${PN}.pro || die + + eqmake5 ${PN}.pro || die +} + +src_install() { + dobin ${PN} + + domenu ${PN}.desktop + + for file in ${PN}*.png; do + size="${file/${PN}_}" + size="${size/.png}x${size/.png}" + insinto /usr/share/icons/hicolor/${size}/apps + newins ${file} ${PN}.png + done + + local lingua + for lingua in ${UNBI_LINGUAS}; do + if use l10n_${lingua/_/-}; then + insinto /usr/share/${PN} + doins ${PN}_${lingua}.qm + fi + done +} + +pkg_postinst() { + xdg_icon_cache_update +} + +pkg_postrm() { + xdg_icon_cache_update +} diff --git a/sys-boot/unetbootin/unetbootin-681.ebuild b/sys-boot/unetbootin/unetbootin-681.ebuild new file mode 100644 index 000000000000..4f0db3c3d742 --- /dev/null +++ b/sys-boot/unetbootin/unetbootin-681.ebuild @@ -0,0 +1,113 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit desktop flag-o-matic qmake-utils xdg-utils toolchain-funcs + +DESCRIPTION="UNetbootin installs Linux/BSD distributions to a partition or USB drive" +HOMEPAGE="https://github.com/unetbootin/unetbootin" +SRC_URI=" + https://github.com/unetbootin/unetbootin/archive/${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~jer/${PN}-675-qt5.patch.xz +" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~x86" + +UNBI_LINGUAS=" + am ar ast be bg bn ca cs da de el eo es et eu fa fi fo fr gl he hr hu id it + ja lt lv ml ms nan nb nl nn pl pt_BR pt ro ru si sk sl sr sv sw tr uk ur vi + zh_CN zh_TW +" + +for lingua in ${UNBI_LINGUAS}; do + IUSE="${IUSE} l10n_${lingua/_/-}" +done + +S=${WORKDIR}/${P}/src/${PN} + +COMMON_DEPEND=" + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5 + dev-qt/qtwidgets:5 +" +BDEPEND=" + ${COMMON_DEPEND} + dev-qt/linguist-tools:5 +" +RDEPEND=" + ${COMMON_DEPEND} + app-arch/p7zip + sys-boot/syslinux + sys-fs/mtools +" + +PATCHES=( + "${FILESDIR}"/${PN}-675-desktop.patch + "${WORKDIR}"/${PN}-675-qt5.patch +) + +src_prepare() { + default + + # QA check in case linguas are added or removed + enum() { + echo ${#} + } + [[ $(enum ${UNBI_LINGUAS}) -eq $(( $(enum $(echo ${PN}_*.ts) ) -1 )) ]] \ + || die "Numbers of recorded and actual linguas do not match" + unset enum + + # Remove localisations + local lingua + for lingua in ${UNBI_LINGUAS}; do + if ! use l10n_${lingua/_/-}; then + sed -i ${PN}.pro -e "/\.*${PN}_${lingua}\.ts.*/d" || die + rm ${PN}_${lingua}.ts || die + fi + done + append-cflags -DNOSTATIC + append-cxxflags -DNOSTATIC +} + +src_configure() { + sed -i -e '/^RESOURCES/d' unetbootin.pro || die + + export QMAKE_CXX="$(tc-getCXX)" + + UNBN_QTPATH="$(qt5_get_bindir)/" + "${UNBN_QTPATH}"lrelease ${PN}.pro || die + + eqmake5 ${PN}.pro || die +} + +src_install() { + dobin ${PN} + + domenu ${PN}.desktop + + for file in ${PN}*.png; do + size="${file/${PN}_}" + size="${size/.png}x${size/.png}" + insinto /usr/share/icons/hicolor/${size}/apps + newins ${file} ${PN}.png + done + + local lingua + for lingua in ${UNBI_LINGUAS}; do + if use l10n_${lingua/_/-}; then + insinto /usr/share/${PN} + doins ${PN}_${lingua}.qm + fi + done +} + +pkg_postinst() { + xdg_icon_cache_update +} + +pkg_postrm() { + xdg_icon_cache_update +} diff --git a/sys-boot/vboot-utils/Manifest b/sys-boot/vboot-utils/Manifest new file mode 100644 index 000000000000..94f473c34d7f --- /dev/null +++ b/sys-boot/vboot-utils/Manifest @@ -0,0 +1,2 @@ +DIST vboot-utils-72_p20181229.tar.xz 18489004 BLAKE2B 444eb0bc2c571ad79d26d473da724016d6d041207beaae161f6c1155768ff9d0b1c8b7b070b828083cc1396266cc77175a75e8067ce22613c75b4d77780dda75 SHA512 41df034dc5498bcbec0d49a472331ceb2fbc2eb3b4173d5c56e920d65ae485382b3d811e5f2c13cf45a1b05a5d6a24197924fa1c76ada9c3aac14fa3c4c363fe +DIST vboot-utils-80_p20200108.tar.xz 18448212 BLAKE2B f7e375133fb6dc90def1e22c42c7511a3b649c34d067a447f44fb99c1ec37a73d034837c2212e5d6ad368a4f4b011c8cb9eb479e81db4a52b1160cda99382a77 SHA512 077d137d8fe89f35b6f7ec6408b2e9fc7a28765b0987646c1964e6e0c039e359711ab79958c45ee555a0fe810997217225d072a7f1011b1c73c4aefb4e57fcc1 diff --git a/sys-boot/vboot-utils/files/vboot-utils-72_p20181229-libressl.patch b/sys-boot/vboot-utils/files/vboot-utils-72_p20181229-libressl.patch new file mode 100644 index 000000000000..6702a9f590bc --- /dev/null +++ b/sys-boot/vboot-utils/files/vboot-utils-72_p20181229-libressl.patch @@ -0,0 +1,11 @@ +--- a/host/include/openssl_compat.h 2019-01-03 17:32:20.000000000 -0500 ++++ b/host/include/openssl_compat.h 2019-02-23 13:40:27.521664838 -0500 +@@ -12,7 +12,7 @@ + + #include <openssl/rsa.h> + +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || LIBRESSL_VERSION_NUMBER < 0x2080000L + + static inline void RSA_get0_key(const RSA *rsa, const BIGNUM **n, + const BIGNUM **e, const BIGNUM **d) diff --git a/sys-boot/vboot-utils/files/vboot-utils-80-musl-fts.patch b/sys-boot/vboot-utils/files/vboot-utils-80-musl-fts.patch new file mode 100644 index 000000000000..bd291f9138e1 --- /dev/null +++ b/sys-boot/vboot-utils/files/vboot-utils-80-musl-fts.patch @@ -0,0 +1,17 @@ +--- a/Makefile ++++ b/Makefile +@@ -231,4 +231,7 @@ + ifndef HAVE_MUSL + CFLAGS += -DHAVE_EXECINFO_H ++# Musl doesn't have fts.h so enable linking to the standalone lib. ++else ++ MUSL_LIBS := -lfts + endif + +@@ -1043,5 +1046,5 @@ + + # FUTIL_LIBS is shared by FUTIL_BIN and TEST_FUTIL_BINS. +-FUTIL_LIBS = ${CRYPTO_LIBS} ${LIBZIP_LIBS} ++FUTIL_LIBS = ${CRYPTO_LIBS} ${LIBZIP_LIBS} ${MUSL_LIBS} + + ${FUTIL_BIN}: LDLIBS += ${FUTIL_LIBS} diff --git a/sys-boot/vboot-utils/metadata.xml b/sys-boot/vboot-utils/metadata.xml new file mode 100644 index 000000000000..f6df648d355a --- /dev/null +++ b/sys-boot/vboot-utils/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <upstream> + <bugs-to>http://crbug.com</bugs-to> + <changelog>https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+log/master</changelog> + <doc>https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/master/README</doc> + </upstream> + <maintainer type="person"> + <email>zmedico@gentoo.org</email> + </maintainer> + <use> + <flag name="libzip">Use dev-libs/libzip.</flag> + </use> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/vboot-utils/vboot-utils-72_p20181229-r1.ebuild b/sys-boot/vboot-utils/vboot-utils-72_p20181229-r1.ebuild new file mode 100644 index 000000000000..34a78cf8d7f3 --- /dev/null +++ b/sys-boot/vboot-utils/vboot-utils-72_p20181229-r1.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils toolchain-funcs + +# This is the latest commit in the latest branch. +GIT_SHA1="a32c930e8c46424a3bba3c296fd78b3e60f50aeb" + +DESCRIPTION="Chrome OS verified boot tools" +HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/ http://dev.chromium.org/chromium-os/chromiumos-design-docs/verified-boot" +# Can't use gitiles directly until b/19710536 is fixed. +#SRC_URI="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+archive/${GIT_SHA1}.tar.gz -> ${P}.tar.gz" +SRC_URI="mirror://gentoo/${P}.tar.xz + https://dev.gentoo.org/~zmedico/dist/${P}.tar.xz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" +IUSE="libressl minimal static" + +LIB_DEPEND=" + dev-libs/libyaml:=[static-libs(+)] + app-arch/xz-utils:=[static-libs(+)]" +LIB_DEPEND_MINIMAL=" + !libressl? ( dev-libs/openssl:0=[static-libs(+)] ) + libressl? ( dev-libs/libressl:0=[static-libs(+)] ) + sys-apps/util-linux:=[static-libs(+)] + dev-libs/libzip:=[static-libs(+)]" +RDEPEND="!static? ( + ${LIB_DEPEND_MINIMAL//\[static-libs(+)]} + !minimal? ( ${LIB_DEPEND//\[static-libs(+)]} ) + ) + elibc_musl? ( sys-libs/fts-standalone )" +DEPEND="${RDEPEND} + static? ( + ${LIB_DEPEND_MINIMAL} + !minimal? ( ${LIB_DEPEND} ) + ) + app-crypt/trousers" + +S=${WORKDIR} + +src_prepare() { + eapply "${FILESDIR}"/${P}-libressl.patch + + default + sed -i \ + -e 's:${DESTDIR}/\(bin\|${LIBDIR}\):${DESTDIR}/usr/\1:g' \ + -e 's:${DESTDIR}/default:${DESTDIR}/etc/default:g' \ + -e 's:${TEST_INSTALL_DIR}/bin:${TEST_INSTALL_DIR}/usr/bin:' \ + -e '/cgpt -D 358400/d' \ + Makefile || die + sed -e 's:^BIN_DIR=${BUILD_DIR}/install_for_test/bin:BIN_DIR=${BUILD_DIR}/install_for_test/usr/bin:' \ + -i tests/common.sh || die + sed -e "s:/mnt/host/source/src/platform/vboot_reference:${S}:" \ + -i tests/futility/expect_output/* || die +} + +_emake() { + local arch=$(tc-arch) + emake \ + V=1 \ + QEMU_ARCH= \ + ARCH=${arch} \ + HOST_ARCH=${arch} \ + LIBDIR="$(get_libdir)" \ + DEBUG_FLAGS= \ + WERROR= \ + MINIMAL=$(usev minimal) \ + STATIC=$(usev static) \ + $(usex elibc_musl HAVE_MUSL=1 "") \ + "$@" +} + +src_compile() { + tc-export CC AR CXX PKG_CONFIG + _emake TEST_BINS= all +} + +src_test() { + _emake runtests +} + +src_install() { + _emake DESTDIR="${ED}" install + + insinto /usr/share/vboot/devkeys + doins tests/devkeys/* + + insinto /usr/include/vboot + doins host/include/* \ + firmware/include/gpt.h \ + firmware/include/tlcl.h \ + firmware/include/tss_constants.h + + dolib.a build/libvboot_host.a + + dodoc README +} diff --git a/sys-boot/vboot-utils/vboot-utils-80_p20200108.ebuild b/sys-boot/vboot-utils/vboot-utils-80_p20200108.ebuild new file mode 100644 index 000000000000..41a810546177 --- /dev/null +++ b/sys-boot/vboot-utils/vboot-utils-80_p20200108.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +# Can't use gitiles directly until b/19710536 is fixed. +# This is the name of the latest release branch. +#RELEASE="release-R80-12739.B" +# This is the latest commit in the release-R80-12739.B branch. +#GIT_SHA1="236bd46bfb59f0262dcb1771a108ebb5e90df578" + +DESCRIPTION="Chrome OS verified boot tools" +HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/ https://dev.chromium.org/chromium-os/chromiumos-design-docs/verified-boot" +# Can't use gitiles directly until b/19710536 is fixed. +#SRC_URI="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+archive/refs/heads/${RELEASE}.tar.gz -> ${P}.tar.gz" +#SRC_URI="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+archive/${GIT_SHA1}.tar.gz -> ${P}.tar.gz" +SRC_URI="mirror://gentoo/${P}.tar.xz + https://dev.gentoo.org/~zmedico/dist/${P}.tar.xz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" +IUSE="libressl +libzip minimal static" + +LIB_DEPEND=" + dev-libs/libyaml:=[static-libs(+)] + app-arch/xz-utils:=[static-libs(+)]" +LIB_DEPEND_MINIMAL=" + elibc_musl? ( sys-libs/fts-standalone:=[static-libs(+)] ) + !libressl? ( dev-libs/openssl:0=[static-libs(+)] ) + libressl? ( dev-libs/libressl:0=[static-libs(+)] ) + libzip? ( dev-libs/libzip:=[static-libs(+)] ) + sys-apps/util-linux:=[static-libs(+)]" +RDEPEND="!static? ( + ${LIB_DEPEND_MINIMAL//\[static-libs(+)]} + !minimal? ( ${LIB_DEPEND//\[static-libs(+)]} ) + )" +DEPEND="${RDEPEND} + static? ( + ${LIB_DEPEND_MINIMAL} + !minimal? ( ${LIB_DEPEND} ) + ) + app-crypt/trousers" +BDEPEND="virtual/pkgconfig" + +S=${WORKDIR} + +PATCHES=( + # Bug #687820 + "${FILESDIR}"/${PN}-80-musl-fts.patch +) + +src_prepare() { + default + + # Bug #687008 + if ! use libzip; then + sed -e 's|^\(LIBZIP_VERSION :=\).*|\1|' -i Makefile || die + fi + + sed -i \ + -e 's:${DESTDIR}/\(bin\|include\|${LIBDIR}\|share\):${DESTDIR}/usr/\1:g' \ + -e 's:${DESTDIR}/default:${DESTDIR}/etc/default:g' \ + -e 's:${TEST_INSTALL_DIR}/bin:${TEST_INSTALL_DIR}/usr/bin:' \ + Makefile || die + sed -e 's:^BIN_DIR=${BUILD_DIR}/install_for_test/bin:BIN_DIR=${BUILD_DIR}/install_for_test/usr/bin:' \ + -i tests/common.sh || die +} + +_emake() { + local arch=$(tc-arch) + emake \ + V=1 \ + QEMU_ARCH= \ + ARCH=${arch} \ + HOST_ARCH=${arch} \ + LIBDIR="$(get_libdir)" \ + DEBUG_FLAGS= \ + WERROR= \ + MINIMAL=$(usev minimal) \ + STATIC=$(usev static) \ + $(usex elibc_musl HAVE_MUSL=1 "") \ + "$@" +} + +src_compile() { + tc-export CC AR CXX PKG_CONFIG + _emake FUZZ_TEST_BINS= TEST_BINS= all +} + +src_test() { + _emake runtests +} + +src_install() { + _emake DESTDIR="${ED}" install install_dev + + insinto /usr/share/vboot/devkeys + doins tests/devkeys/* + + dodoc README +} diff --git a/sys-boot/woeusb/Manifest b/sys-boot/woeusb/Manifest new file mode 100644 index 000000000000..8bb853f6f1a5 --- /dev/null +++ b/sys-boot/woeusb/Manifest @@ -0,0 +1 @@ +DIST woeusb-3.3.1.tar.gz 386399 BLAKE2B 1423ecca39018c674b0eea36de732f54cfcdd14b8cc465e6d3c0639192cbd8355436b7a39ba453b19fa6f1c5b1f6938ef12f49710bc2a4af0f2eaed967e03ce7 SHA512 e3460efabaee199eb5ffc73ca99fe2d9141ed3a5f72acd2f8910b093b2b3a93928ee4eeb27d634293448f036101d8bf24aef65dc338c80e6e3e1738004594d52 diff --git a/sys-boot/woeusb/metadata.xml b/sys-boot/woeusb/metadata.xml new file mode 100644 index 000000000000..b71f2c328a31 --- /dev/null +++ b/sys-boot/woeusb/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> + <email>pacho@gentoo.org</email> +</maintainer> +<use> + <flag name="minimal">Install only woeusb tool</flag> +</use> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/woeusb/woeusb-3.3.1.ebuild b/sys-boot/woeusb/woeusb-3.3.1.ebuild new file mode 100644 index 000000000000..a07611f43779 --- /dev/null +++ b/sys-boot/woeusb/woeusb-3.3.1.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +WX_GTK_VER="3.0-gtk3" + +inherit autotools wxwidgets + +DESCRIPTION="Creates windows installer on usb media from an iso image" +HOMEPAGE="https://github.com/slacka/WoeUSB" +SRC_URI="https://github.com/slacka/WoeUSB/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="minimal" + +RDEPEND=" + sys-apps/util-linux + sys-block/parted + sys-fs/dosfstools + sys-fs/ntfs3g + sys-boot/grub:2[grub_platforms_pc] + !minimal? ( x11-libs/wxGTK:${WX_GTK_VER}[X] ) +" +DEPEND="${RDEPEND}" +BDEPEND="" + +S="${WORKDIR}/WoeUSB-${PV}" + +src_prepare() { + default + find . -type f -print0 | xargs -0 sed -i "s/@@WOEUSB_VERSION@@/${PV}/" || die + if ! use minimal; then + setup-wxwidgets + eautoreconf + fi +} + +src_configure() { + ! use minimal && default +} + +src_compile() { + ! use minimal && default +} + +src_test() { + ! use minimal && default +} + +src_install() { + if use minimal; then + dosbin src/woeusb + einstalldocs + else + default + fi +} diff --git a/sys-boot/yaboot-static/Manifest b/sys-boot/yaboot-static/Manifest new file mode 100644 index 000000000000..f45d6aaae944 --- /dev/null +++ b/sys-boot/yaboot-static/Manifest @@ -0,0 +1,3 @@ +DIST yaboot-static-1.3.14.tbz2 154587 BLAKE2B 258641b2c12bd7877976d7b22b23a15443327f34c7a07bb60675e040e4b9ba1a9deff56d64c391761d2fafbf830fec7172164e0786beb0cd2971179444d3dcd8 SHA512 e175fd3b31c8e26dd7177ab3c995015ebeb34f2877e1e64eabb3cbb21d0cb0e41e9c60c423e07ebb48f43ccd60ff1ff95a2001d0af220531be1bd25e04cf9bdc +DIST yaboot-static-1.3.16.tbz2 159798 BLAKE2B 8ca04f7c2a43444898c3b057860ccc295c6aa2739fed5aff430563cdfa7395885176a0b8cd8f0e2e00effbd42bcc1f76c6502cf367594c83ffa71f8682dca120 SHA512 9aaf4432764631db923638d11d87868e9774ea6bec875110af1cd21a818c59781b7beebac4848a6a32aa592816fded214f5c6b159ecbd1654a0c6051c42dd580 +DIST yaboot-static-1.3.17.tbz2 162142 BLAKE2B ddaa1e01c08b926a0fb295e350ba8a80a0b2c5d0cc7a8346d05e7e6c7441b9748f781a82382afcaad770ed04ebd4e3032bd16e605b8ad984b13ab9564500890a SHA512 23caf8d7308aba7402f13fc558e2182f63317fa7cf502899503247d2d2b8741b8327b447a50edce775eed0ea02fed5b675f4b40c8bafd956cbd25662c9f2ad72 diff --git a/sys-boot/yaboot-static/files/new-ofpath-devspec.patch b/sys-boot/yaboot-static/files/new-ofpath-devspec.patch new file mode 100644 index 000000000000..f225e8e1bb4b --- /dev/null +++ b/sys-boot/yaboot-static/files/new-ofpath-devspec.patch @@ -0,0 +1,30 @@ +Fix the devspec path on newer kernels + +--- usr/sbin/ofpath ++++ usr/sbin/ofpath +@@ -85,11 +85,20 @@ + [ "$DEBUG" = 1 ] && echo "Devpath is: $DEVPATH" + + ### Get the OF Path of the controller +-case ${DISK_NAME} in +- sd*|sg*|sr*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec) ;; +- hd*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec) ;; +- *) CONTROLLER_PATH="" ;; +-esac ++if [ -e "${DEVPATH}/../../devspec" ]; then ++ ### /dev/hd* ++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec); ++elif [ -e "${DEVPATH}/../../../devspec" ]; then ++ ### /dev/sd* on kernel <3.3 ++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec); ++elif [ -e "${DEVPATH}/../../../../devspec" ]; then ++ ### /dev/sd* on kernel 3.3+ ++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../../devspec); ++else ++ ### None of the above... ++ CONTROLLER_PATH=""; ++fi ++ + if [ -z "$CONTROLLER_PATH" ]; then + echo "Unable to determine controller path!" + exit 1 diff --git a/sys-boot/yaboot-static/files/sysfs-ofpath.patch b/sys-boot/yaboot-static/files/sysfs-ofpath.patch new file mode 100644 index 000000000000..7a3659100495 --- /dev/null +++ b/sys-boot/yaboot-static/files/sysfs-ofpath.patch @@ -0,0 +1,105 @@ +--- usr/sbin/ofpath 2008-08-03 04:00:35.000000000 -0400 ++++ usr/sbin/ofpath 2009-01-09 13:46:12.000000000 -0500 +@@ -337,15 +337,18 @@ + + ide_ofpath() + { +- if [ ! -L "/proc/ide/$DEVNODE" ] ; then ++ if [ ! -L "/proc/ide/$DEVNODE" ] && [ ! -e "/sys/block/$DEVNODE" ] ; then + echo 1>&2 "$PRG: /dev/$DEVNODE: Device not configured" + return 1 + fi + +- local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )" +- if [ -z "$IDEBUS" ] ; then +- echo 1>&2 "$PRG: BUG: IDEBUS == NULL" +- return 1 ++ if [ -L "/proc/ide/$DEVNODE" ] ; then ++ local USE_OLD_PROC=1 ++ local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )" ++ if [ -z "$IDEBUS" ] ; then ++ echo 1>&2 "$PRG: BUG: IDEBUS == NULL" ++ return 1 ++ fi + fi + + case "$(uname -r)" in +@@ -363,7 +366,8 @@ + echo 1>&2 "$PRG: Unable to determine sysfs mountpoint" + return 1 + fi +- local OF1275IDE="${SYS}/block/${DEVNODE}/device/../../devspec" ++ local OF1275IDE=$(cd -P "${SYS}/block/${DEVNODE}/device" && pwd) ++ OF1275IDE="${OF1275IDE}/../../devspec" + ;; + *) + local OF1275IDE="/proc/ide/$IDEBUS/devspec" +@@ -402,34 +406,41 @@ + return 1 + fi + +- if [ ! -f "/proc/ide/${IDEBUS}/channel" ] ; then +- echo 1>&2 "$PRG: KERNEL BUG: /proc/ide/${IDEBUS}/channel does not exist" +- return 1 +- fi +- +- case "$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)" in +- ide|ata) +- local MASTER="/disk@0" +- local SLAVE="/disk@1" +- ;; +- pci-ide|pci-ata) +- local MASTER="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@0" +- local SLAVE="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@1" +- ;; +- scsi) ## some lame controllers pretend they are scsi, hopefully all kludges are created equal. +- local MASTER="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 0))" +- local SLAVE="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 1))" +- ;; +- spi) +- local MASTER="/disk@$(cat /proc/ide/${IDEBUS}/channel),0" +- local SLAVE="/disk@$(cat /proc/ide/${IDEBUS}/channel),1" +- ;; +- *) +- echo 1>&2 "$PRG: Unsupported IDE device type: \"$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)\"" +- return 1 +- ;; +- esac ++ ++ if [ "${USE_OLD_PROC}" = "1" ] ; then ++ if [ ! -f "/proc/ide/${IDEBUS}/channel" ] ; then ++ echo 1>&2 "$PRG: KERNEL BUG: /proc/ide/${IDEBUS}/channel does not exist" ++ return 1 ++ fi + ++ case "$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)" in ++ ide|ata) ++ local MASTER="/disk@0" ++ local SLAVE="/disk@1" ++ ;; ++ pci-ide|pci-ata) ++ local MASTER="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@0" ++ local SLAVE="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@1" ++ ;; ++ scsi) ## some lame controllers pretend they are scsi, hopefully all kludges are created equal. ++ local MASTER="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 0))" ++ local SLAVE="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 1))" ++ ;; ++ spi) ++ local MASTER="/disk@$(cat /proc/ide/${IDEBUS}/channel),0" ++ local SLAVE="/disk@$(cat /proc/ide/${IDEBUS}/channel),1" ++ ;; ++ *) ++ echo 1>&2 "$PRG: Unsupported IDE device type: \"$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)\"" ++ return 1 ++ ;; ++ esac ++ else ++ ### I don't know what other disks would look like... FIXME ++ local MASTER="/disk@0" ++ local SLAVE="/disk@1" ++ fi ++ + case "$DEVNODE" in + hda|hdc|hde|hdg|hdi|hdk|hdm|hdo) + echo "${DEVSPEC}${MASTER}:$PARTITION" diff --git a/sys-boot/yaboot-static/metadata.xml b/sys-boot/yaboot-static/metadata.xml new file mode 100644 index 000000000000..4940e80d1b3e --- /dev/null +++ b/sys-boot/yaboot-static/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>ppc@gentoo.org</email> + <name>Gentoo Linux PowerPC Development</name> +</maintainer> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/yaboot-static/yaboot-static-1.3.14-r1.ebuild b/sys-boot/yaboot-static/yaboot-static-1.3.14-r1.ebuild new file mode 100644 index 000000000000..72f3850f3c17 --- /dev/null +++ b/sys-boot/yaboot-static/yaboot-static-1.3.14-r1.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# Generated by using quickpkg on a ppc32 machine, compiled with -O2 -pipe. + +EAPI="5" + +inherit eutils + +DESCRIPTION="Static yaboot ppc boot loader for machines with open firmware" +HOMEPAGE="http://yaboot.ozlabs.org/" +SRC_URI="mirror://gentoo/yaboot-static-${PV}.tbz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ppc ppc64" +IUSE="ibm" + +DEPEND="sys-apps/powerpc-utils" +RDEPEND="!sys-boot/yaboot + !ibm? ( + sys-fs/hfsutils + sys-fs/hfsplusutils + sys-fs/mac-fdisk + )" + +S=${WORKDIR} + +QA_PRESTRIPPED=" + /usr/lib/yaboot/yaboot + /usr/lib/yaboot/yaboot.chrp + /usr/lib/yaboot/addnote +" + +src_prepare() { + epatch "${FILESDIR}"/sysfs-ofpath.patch +} + +src_install() { + # don't blow away the user's old conf file + mv "${WORKDIR}"/etc/yaboot.conf{,.sample} || die + cp -pPR "${WORKDIR}"/* "${D}" || die +} diff --git a/sys-boot/yaboot-static/yaboot-static-1.3.16-r1.ebuild b/sys-boot/yaboot-static/yaboot-static-1.3.16-r1.ebuild new file mode 100644 index 000000000000..4ed2be3006cb --- /dev/null +++ b/sys-boot/yaboot-static/yaboot-static-1.3.16-r1.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# Generated by using quickpkg on a ppc32 machine, compiled with -O2 -pipe. + +EAPI="5" + +inherit eutils + +DESCRIPTION="Static yaboot ppc boot loader for machines with open firmware" +HOMEPAGE="http://yaboot.ozlabs.org/" +SRC_URI="mirror://gentoo/yaboot-static-${PV}.tbz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ppc ppc64" +IUSE="ibm" + +DEPEND="sys-apps/powerpc-utils" +RDEPEND="!sys-boot/yaboot + !ibm? ( + sys-fs/hfsutils + sys-fs/hfsplusutils + sys-fs/mac-fdisk + )" + +S=${WORKDIR} + +QA_PRESTRIPPED=" + /usr/lib/yaboot/yaboot + /usr/lib/yaboot/yaboot.chrp + /usr/lib/yaboot/addnote +" + +src_install() { + cp -pPR "${WORKDIR}"/* "${D}" || die +} diff --git a/sys-boot/yaboot-static/yaboot-static-1.3.17-r1.ebuild b/sys-boot/yaboot-static/yaboot-static-1.3.17-r1.ebuild new file mode 100644 index 000000000000..531874033bde --- /dev/null +++ b/sys-boot/yaboot-static/yaboot-static-1.3.17-r1.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# Generated by using quickpkg on a ppc32 machine, compiled with -O2 -pipe. + +EAPI="5" + +inherit eutils + +DESCRIPTION="Static yaboot ppc boot loader for machines with open firmware" +HOMEPAGE="http://yaboot.ozlabs.org/" +SRC_URI="mirror://gentoo/yaboot-static-${PV}.tbz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ppc ppc64" +IUSE="ibm" + +DEPEND="sys-apps/powerpc-utils" +RDEPEND="!sys-boot/yaboot + !ibm? ( + sys-fs/hfsutils + sys-fs/hfsplusutils + sys-fs/mac-fdisk + )" + +S=${WORKDIR} + +QA_PRESTRIPPED=" + /usr/lib/yaboot/yaboot + /usr/lib/yaboot/yaboot.chrp + /usr/lib/yaboot/addnote +" + +src_prepare() { + epatch "${FILESDIR}/new-ofpath-devspec.patch" +} + +src_install() { + cp -pPR "${WORKDIR}"/* "${D}" || die +} diff --git a/sys-boot/yaboot/Manifest b/sys-boot/yaboot/Manifest new file mode 100644 index 000000000000..65faee106071 --- /dev/null +++ b/sys-boot/yaboot/Manifest @@ -0,0 +1,4 @@ +DIST e2fsprogs-1.42.13.tar.gz 6511931 BLAKE2B 2f849e82ad366f86d9d166f1901a99a8ac0ddc94471a29fb0de9132ae2ba8f8dc0f4c143acf889afdaa1daf1c57e7bf545a2b4e15ebb8463667f2768a8bc2ebb SHA512 d341790f55c3bff34425369063757280b9ba6ac08f405e14f94f299345ae76c0dc6e90871b746cc98c73467448d888fe5bc029688b5eed5fd22c3c37bf285cd0 +DIST yaboot-1.3.14.tar.gz 219089 BLAKE2B e9f71476502dd61e1e277980eab486b35675f809249e27d72627f6469c75c7ea43740898cc8dc58196bb70d08dce52ef334fcd035ac92c66a4f77236a0371049 SHA512 7542073159a15787e27fd8246fe4c84c48cec5cc6fe76be06f4591bb9ca459ad0c81f0085f08d944745a186da005a5ace0d3d0b2598711ca3309fad1c5a00e74 +DIST yaboot-1.3.16.tar.gz 220360 BLAKE2B e717b101f14b6178f9fdcd4cf45077c1b9c5db91504f8a000710c02d8b35f6094deb590710c09352fcd18385122a1824b99de5600b176c79da0937fa5b287b0b SHA512 9cd98335c8b32787567253e628549fe88af5ebe4b81fb6b99741fbbcc0ae3b44dc4fdad527ed27da00103bc0482d9a33d3f128f542884387f5aa754546624e14 +DIST yaboot-1.3.17.tar.gz 224325 BLAKE2B 41f96266f2342eebbfdc3c0eb64eeaf59e55a31d7388f86839cf9318d231ef808d3aa16fb3b3fdfe85a6fca743e191d064f0ed633723f135a7ca25483e460566 SHA512 da910c4c6ca2de817342bf4dbcefe2857606043e614782581a86bae206cf6cfe5597ad47aea15369feb60e02d8a4f9f4aa3b12863d715c757584c1f4d7ffb9de diff --git a/sys-boot/yaboot/files/chrpfix.patch b/sys-boot/yaboot/files/chrpfix.patch new file mode 100644 index 000000000000..59ea7a072633 --- /dev/null +++ b/sys-boot/yaboot/files/chrpfix.patch @@ -0,0 +1,23 @@ +--- a/Makefile.orig 2004-03-22 12:04:32.056149336 -0600 ++++ b/Makefile 2004-03-22 12:05:51.824138328 -0600 +@@ -103,9 +103,11 @@ + + all: yaboot addnote mkofboot + +-yaboot: $(OBJS) ++yaboot: $(OBJS) addnote + $(LD) $(LFLAGS) $(OBJS) $(LLIBS) $(lgcc) -o second/$@ + chmod -x second/yaboot ++ cp second/yaboot second/yaboot.chrp ++ util/addnote second/yaboot.chrp + + addnote: + $(CC) $(UCFLAGS) -o util/addnote util/addnote.c +@@ -185,6 +187,7 @@ + install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man5/ + install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man8/ + install -o root -g root -m 0644 second/yaboot ${ROOT}/$(PREFIX)/lib/yaboot ++ install -o root -g root -m 0644 second/yaboot.chrp ${ROOT}/$(PREFIX)/lib/yaboot + install -o root -g root -m 0755 util/addnote ${ROOT}/${PREFIX}/lib/yaboot/addnote + install -o root -g root -m 0644 first/ofboot ${ROOT}/${PREFIX}/lib/yaboot/ofboot + install -o root -g root -m 0755 ybin/ofpath ${ROOT}/${PREFIX}/sbin/ofpath diff --git a/sys-boot/yaboot/files/e2fsprogs-1.42.13-sysmacros.h.patch b/sys-boot/yaboot/files/e2fsprogs-1.42.13-sysmacros.h.patch new file mode 100644 index 000000000000..8bf887026ead --- /dev/null +++ b/sys-boot/yaboot/files/e2fsprogs-1.42.13-sysmacros.h.patch @@ -0,0 +1,85 @@ +From 3fb715b55426875902dfef3056b2cf7335953178 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Fri, 19 May 2017 13:25:59 -0400 +Subject: [PATCH] include sys/sysmacros.h as needed + +The minor/major/makedev macros are not entirely standard. glibc has had +the definitions in sys/sysmacros.h since the start, and wants to move away +from always defining them implicitly via sys/types.h (as this pollutes the +namespace in violation of POSIX). Other C libraries have already dropped +them. Since the configure script already checks for this header, use that +to pull in the header in files that use these macros. + +Signed-off-by: Mike Frysinger <vapier@gentoo.org> +Signed-off-by: Theodore Ts'o <tytso@mit.edu> +--- + lib/blkid/devname.c | 3 +++ + lib/blkid/devno.c | 3 +++ + lib/ext2fs/finddev.c | 3 +++ + lib/ext2fs/ismounted.c | 3 +++ + misc/mk_hugefiles.c | 3 +++ + 7 files changed, 22 insertions(+) + +--- a/lib/blkid/devname.c ++++ b/lib/blkid/devname.c +@@ -36,6 +36,9 @@ + #if HAVE_SYS_MKDEV_H + #include <sys/mkdev.h> + #endif ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif + #include <time.h> + + #include "blkidP.h" +--- a/lib/blkid/devno.c ++++ b/lib/blkid/devno.c +@@ -31,6 +31,9 @@ + #if HAVE_SYS_MKDEV_H + #include <sys/mkdev.h> + #endif ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif + + #include "blkidP.h" + +--- a/lib/ext2fs/finddev.c ++++ b/lib/ext2fs/finddev.c +@@ -31,6 +31,9 @@ + #if HAVE_SYS_MKDEV_H + #include <sys/mkdev.h> + #endif ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif + + #include "ext2_fs.h" + #include "ext2fs.h" +--- a/lib/ext2fs/ismounted.c ++++ b/lib/ext2fs/ismounted.c +@@ -49,6 +49,9 @@ + #endif /* HAVE_GETMNTINFO */ + #include <string.h> + #include <sys/stat.h> ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif + + #include "ext2_fs.h" + #include "ext2fs.h" +--- a/misc/mk_hugefiles.c ++++ b/misc/mk_hugefiles.c +@@ -35,6 +35,9 @@ extern int optind; + #include <sys/ioctl.h> + #include <sys/types.h> + #include <sys/stat.h> ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif + #include <libgen.h> + #include <limits.h> + #include <blkid/blkid.h> +-- +2.20.1 + diff --git a/sys-boot/yaboot/files/new-ofpath b/sys-boot/yaboot/files/new-ofpath new file mode 100644 index 000000000000..5e395b251a8e --- /dev/null +++ b/sys-boot/yaboot/files/new-ofpath @@ -0,0 +1,143 @@ +#!/bin/sh +############################################################################### +# Determines the Open Firmware path based on the linux device name +# +# Joseph Jezak <josejx@gentoo.org> Copyright (C) 2010 +# Rewrite of OFPath for newer kernels/scsi configurations +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################### + +### Set this to 1 to turn on debugging messages +DEBUG=0 + +### Find the device tree +if [ ! -e /proc/device-tree ]; then + echo 1>&2 "ofpath: Cannot find the device tree!" + exit 1 +fi +DEV_TREE="/proc/device-tree" + +### Check if sys is mounted +if ! (grep -q '.* .* sysfs ' /proc/mounts 2> /dev/null) ; then + echo 1>&2 "ofpath: sysfs must be mounted for ofpath to support this system" + exit 1 +fi + +### Get the sysfs mount point +SYS="$(m=`grep '.* .* sysfs ' /proc/mounts | head -n 1` ; echo `d=${m#* };echo ${d%% *}`)" +if [ -z "$SYS" -o ! -d "$SYS" ] ; then + echo 1>&2 "ofpath: Unable to determine sysfs mountpoint" + exit 1 +fi + + +### Get the device from the user +### We dereference links to support devices like /dev/cdrom1 +DEVICE=$1 +if [ -z "$DEVICE" ]; then + echo 1>&2 "ofpath: No device specified!" + exit 1 +fi +DEVICE=$(readlink -f "$DEVICE") +DEVICE=$(basename $DEVICE) +if [ -z "$DEVICE" ] || [ ! -e "/dev/$DEVICE" ]; then + echo 1>&2 "ofpath: Invalid device: /dev/$DEVICE" + exit 1 +fi +[ "$DEBUG" = 1 ] && echo "Device is: $DEVICE" + +### Get the partition if we have it +case ${DEVICE} in + sd*) PARTITION="${DEVICE#sd?}" ;; + ### No partition for sr/sg devices + sr*|sg*) PARTITION="${DEVICE#sr?}" ;; + hd*) PARTITION="${DEVICE#hd?}" ;; + *) echo "Unknown device string."; exit 1;; +esac +if [ ! -z "$PARTITION" ] && [ "$DEBUG" = 1 ]; then + echo "Partition: $PARTITION" +fi + +### Get the disk device name +DISK_NAME="${DEVICE%%${PARTITION}}" +[ "$DEBUG" = 1 ] && echo "Disk Name: $DISK_NAME" + +### Find the devspec for the controller +DEVPATH=$(cd -P "$SYS/block/${DISK_NAME}/device" && pwd) +if [ -z "$DEVPATH" ]; then + echo "Unable to determine device path!" + exit 1 +fi +[ "$DEBUG" = 1 ] && echo "Devpath is: $DEVPATH" + +### Get the OF Path of the controller +case ${DISK_NAME} in + sd*|sg*|sr*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec) ;; + hd*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec) ;; + *) CONTROLLER_PATH="" ;; +esac +if [ -z "$CONTROLLER_PATH" ]; then + echo "Unable to determine controller path!" + exit 1 +fi +[ "$DEBUG" = 1 ] && echo "Controller Path is: $CONTROLLER_PATH" + +### Generate the disk number and partition info +case ${DISK_NAME} in + sd*|sg*|sr*) + DISK_NO="$(cd ${DEVPATH}/../; pwd)"; + DISK_NO="${DISK_NO##*:}"; + ;; + hd*) + DISK_NO="$(cd ${DEVPATH}/../; pwd)"; + DISK_NO="${DISK_NO##*ide}"; + ;; + *) echo "Unsupported disk type!"; exit 1 ;; +esac +DISK_NO="disk@${DISK_NO}:" +[ "$DEBUG" = 1 ] && echo "Disk Number: ${DISK_NO}" + +### We need to get the controller port path (if it has one) +if [ ! -d "$DEV_TREE/$CONTROLLER_PATH/disk" ] && [ ! -d "$DEV_TREE/$CONTROLLER_PATH/$DISK_NO" ]; then + ### FIXME I don't know if every scsi device uses the host nomenclature + case ${DISK_NAME} in + sd*|sg*|sr*) + PORT="$(cd ${DEVPATH}/../../; pwd)"; + PORT="${PORT##*host}"; + CTL_PORT="${CONTROLLER_PATH##*/}"; + CTL_PORT="${CTL_PORT%%-root*}"; + PORT="$CTL_PORT@$PORT" + [ "$DEBUG" = 1 ] && echo "Port: $PORT" + ;; + *) echo "Unsupported disk type!"; exit 1 ;; + esac +fi + +### Add the partition information if required +if [ ! -z $PARTITION ]; then + DISK_NO="$DISK_NO$PARTITION" +fi + +### Build the OF Path +if [ -z "$PORT" ]; then + OFPATH="$CONTROLLER_PATH/$DISK_NO" +else + OFPATH="$CONTROLLER_PATH/${PORT}/$DISK_NO" +fi + +### Print out the ofpath +echo $OFPATH diff --git a/sys-boot/yaboot/files/new-ofpath-devspec.patch b/sys-boot/yaboot/files/new-ofpath-devspec.patch new file mode 100644 index 000000000000..e9ad749d8f06 --- /dev/null +++ b/sys-boot/yaboot/files/new-ofpath-devspec.patch @@ -0,0 +1,28 @@ +--- a/ybin/ofpath.bak 2012-05-09 12:24:51.709911981 -0400 ++++ b/ybin/ofpath 2012-05-09 12:32:19.661560544 -0400 +@@ -85,11 +85,20 @@ + [ "$DEBUG" = 1 ] && echo "Devpath is: $DEVPATH" + + ### Get the OF Path of the controller +-case ${DISK_NAME} in +- sd*|sg*|sr*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec) ;; +- hd*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec) ;; +- *) CONTROLLER_PATH="" ;; +-esac ++if [ -e "${DEVPATH}/../../devspec" ]; then ++ ### /dev/hd* ++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec); ++elif [ -e "${DEVPATH}/../../../devspec" ]; then ++ ### /dev/sd* on kernel <3.3 ++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec); ++elif [ -e "${DEVPATH}/../../../../devspec" ]; then ++ ### /dev/sd* on kernel 3.3+ ++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../../devspec); ++else ++ ### None of the above... ++ CONTROLLER_PATH=""; ++fi ++ + if [ -z "$CONTROLLER_PATH" ]; then + echo "Unable to determine controller path!" + exit 1 diff --git a/sys-boot/yaboot/files/sysfs-ofpath.patch b/sys-boot/yaboot/files/sysfs-ofpath.patch new file mode 100644 index 000000000000..7ebc0bfac86f --- /dev/null +++ b/sys-boot/yaboot/files/sysfs-ofpath.patch @@ -0,0 +1,105 @@ +--- ybin/ofpath 2008-08-03 04:00:35.000000000 -0400 ++++ ybin/ofpath 2009-01-09 13:46:12.000000000 -0500 +@@ -337,15 +337,18 @@ + + ide_ofpath() + { +- if [ ! -L "/proc/ide/$DEVNODE" ] ; then ++ if [ ! -L "/proc/ide/$DEVNODE" ] && [ ! -e "/sys/block/$DEVNODE" ] ; then + echo 1>&2 "$PRG: /dev/$DEVNODE: Device not configured" + return 1 + fi + +- local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )" +- if [ -z "$IDEBUS" ] ; then +- echo 1>&2 "$PRG: BUG: IDEBUS == NULL" +- return 1 ++ if [ -L "/proc/ide/$DEVNODE" ] ; then ++ local USE_OLD_PROC=1 ++ local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )" ++ if [ -z "$IDEBUS" ] ; then ++ echo 1>&2 "$PRG: BUG: IDEBUS == NULL" ++ return 1 ++ fi + fi + + case "$(uname -r)" in +@@ -363,7 +366,8 @@ + echo 1>&2 "$PRG: Unable to determine sysfs mountpoint" + return 1 + fi +- local OF1275IDE="${SYS}/block/${DEVNODE}/device/../../devspec" ++ local OF1275IDE=$(cd -P "${SYS}/block/${DEVNODE}/device" && pwd) ++ OF1275IDE="${OF1275IDE}/../../devspec" + ;; + *) + local OF1275IDE="/proc/ide/$IDEBUS/devspec" +@@ -402,34 +406,41 @@ + return 1 + fi + +- if [ ! -f "/proc/ide/${IDEBUS}/channel" ] ; then +- echo 1>&2 "$PRG: KERNEL BUG: /proc/ide/${IDEBUS}/channel does not exist" +- return 1 +- fi +- +- case "$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)" in +- ide|ata) +- local MASTER="/disk@0" +- local SLAVE="/disk@1" +- ;; +- pci-ide|pci-ata) +- local MASTER="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@0" +- local SLAVE="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@1" +- ;; +- scsi) ## some lame controllers pretend they are scsi, hopefully all kludges are created equal. +- local MASTER="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 0))" +- local SLAVE="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 1))" +- ;; +- spi) +- local MASTER="/disk@$(cat /proc/ide/${IDEBUS}/channel),0" +- local SLAVE="/disk@$(cat /proc/ide/${IDEBUS}/channel),1" +- ;; +- *) +- echo 1>&2 "$PRG: Unsupported IDE device type: \"$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)\"" +- return 1 +- ;; +- esac ++ ++ if [ "${USE_OLD_PROC}" = "1" ] ; then ++ if [ ! -f "/proc/ide/${IDEBUS}/channel" ] ; then ++ echo 1>&2 "$PRG: KERNEL BUG: /proc/ide/${IDEBUS}/channel does not exist" ++ return 1 ++ fi + ++ case "$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)" in ++ ide|ata) ++ local MASTER="/disk@0" ++ local SLAVE="/disk@1" ++ ;; ++ pci-ide|pci-ata) ++ local MASTER="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@0" ++ local SLAVE="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@1" ++ ;; ++ scsi) ## some lame controllers pretend they are scsi, hopefully all kludges are created equal. ++ local MASTER="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 0))" ++ local SLAVE="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 1))" ++ ;; ++ spi) ++ local MASTER="/disk@$(cat /proc/ide/${IDEBUS}/channel),0" ++ local SLAVE="/disk@$(cat /proc/ide/${IDEBUS}/channel),1" ++ ;; ++ *) ++ echo 1>&2 "$PRG: Unsupported IDE device type: \"$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)\"" ++ return 1 ++ ;; ++ esac ++ else ++ ### I don't know what other disks would look like... FIXME ++ local MASTER="/disk@0" ++ local SLAVE="/disk@1" ++ fi ++ + case "$DEVNODE" in + hda|hdc|hde|hdg|hdi|hdk|hdm|hdo) + echo "${DEVSPEC}${MASTER}:$PARTITION" diff --git a/sys-boot/yaboot/files/yaboot-1.3.16-memalign.patch b/sys-boot/yaboot/files/yaboot-1.3.16-memalign.patch new file mode 100644 index 000000000000..0fe4e250f292 --- /dev/null +++ b/sys-boot/yaboot/files/yaboot-1.3.16-memalign.patch @@ -0,0 +1,41 @@ +diff -uNr yaboot/lib/malloc.c yaboot-1.3.16//lib/malloc.c +--- yaboot/lib/malloc.c 2010-07-09 03:18:17.000000000 +0100 ++++ yaboot-1.3.16//lib/malloc.c 2011-01-23 16:57:13.000000000 +0000 +@@ -42,6 +42,37 @@ + last_alloc = 0; + } + ++static char *align_ptr_to(char *ptr, unsigned long align) ++{ ++ return (char *)((((unsigned long)ptr) + (align - 1UL)) & ++ ~(align - 1UL)); ++} ++ ++int posix_memalign(void **memptr, unsigned long alignment, unsigned long size) ++{ ++ char *caddr; ++ ++ if (alignment & (alignment - 1UL)) ++ return -1; ++ ++ if (alignment & (sizeof(void *) - 1UL)) ++ return -1; ++ ++ if (size == 0) ++ { ++ *memptr = (void *)0; ++ return 0; ++ } ++ ++ caddr = align_ptr_to(malloc_ptr, alignment); ++ malloc_ptr = (caddr + size); ++ last_alloc = caddr; ++ malloc_ptr = align_ptr_to(malloc_ptr, 8UL); ++ ++ *memptr = caddr; ++ return 0; ++} ++ + void *malloc (unsigned int size) + { + char *caddr; diff --git a/sys-boot/yaboot/files/yaboot-1.3.17-nopiessp-gcc4.patch b/sys-boot/yaboot/files/yaboot-1.3.17-nopiessp-gcc4.patch new file mode 100644 index 000000000000..1ab2a3eecc3e --- /dev/null +++ b/sys-boot/yaboot/files/yaboot-1.3.17-nopiessp-gcc4.patch @@ -0,0 +1,38 @@ +disable ssp usage in yaboot itself + +unfortunately, since we link against external libs that themselves were built +with ssp turned on, we have to provide stubs to keep the linking from failing + +--- yaboot-1.3.13/Config.gentoo ++++ yaboot-1.3.13/Config.gentoo +@@ -0,0 +1,6 @@ ++check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ ++ then echo "$(1)"; else echo "$(2)"; fi) ++ ++CFLAGS += $(call check_gcc, -fno-stack-protector) ++CFLAGS += $(call check_gcc, --nopie) ++ +--- yaboot-1.3.13/Makefile ++++ yaboot-1.3.13/Makefile +@@ -1,6 +1,7 @@ + ## Setup + + include Config ++include Config.gentoo + + VERSION = 1.3.13 + # Debug mode (spam/verbose) +@@ -79,7 +80,7 @@ HOSTCFLAGS = -O2 $(CFLAGS) -Wall -I/usr/ + second/fs_of.o second/fs_ext2.o second/fs_iso.o second/fs_swap.o \ + second/iso_util.o \ + lib/nonstd.o \ +- lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o ++ lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o lib/ssp.o + + ifeq ($(USE_MD5_PASSWORDS),y) + OBJS += second/md5.o +--- yaboot-1.3.14/lib/ssp.c ++++ yaboot-1.3.14/lib/ssp.c +@@ -0,0 +1,2 @@ ++void __stack_chk_fail(void) {} ++void __stack_chk_fail_local(void) {} diff --git a/sys-boot/yaboot/files/yaboot-nopiessp-gcc4.patch b/sys-boot/yaboot/files/yaboot-nopiessp-gcc4.patch new file mode 100644 index 000000000000..ed1755b72b33 --- /dev/null +++ b/sys-boot/yaboot/files/yaboot-nopiessp-gcc4.patch @@ -0,0 +1,38 @@ +disable ssp usage in yaboot itself + +unfortunately, since we link against external libs that themselves were built +with ssp turned on, we have to provide stubs to keep the linking from failing + +--- yaboot-1.3.13/Config.gentoo ++++ yaboot-1.3.13/Config.gentoo +@@ -0,0 +1,6 @@ ++check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ ++ then echo "$(1)"; else echo "$(2)"; fi) ++ ++CFLAGS += $(call check_gcc, -fno-stack-protector) ++CFLAGS += $(call check_gcc, --nopie) ++ +--- yaboot-1.3.13/Makefile ++++ yaboot-1.3.13/Makefile +@@ -1,6 +1,7 @@ + ## Setup + + include Config ++include Config.gentoo + + VERSION = 1.3.13 + # Debug mode (spam/verbose) +@@ -79,7 +80,7 @@ HOSTCFLAGS = -O2 $(CFLAGS) -Wall -I/usr/ + OBJS = second/crt0.o second/yaboot.o second/cache.o second/prom.o second/file.o \ + second/partition.o second/fs.o second/cfg.o second/setjmp.o second/cmdline.o \ + second/fs_of.o second/fs_ext2.o second/fs_iso.o second/iso_util.o \ +- lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o ++ lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o lib/ssp.o + + ifeq ($(USE_MD5_PASSWORDS),y) + OBJS += second/md5.o +--- yaboot-1.3.14/lib/ssp.c ++++ yaboot-1.3.14/lib/ssp.c +@@ -0,0 +1,2 @@ ++void __stack_chk_fail(void) {} ++void __stack_chk_fail_local(void) {} diff --git a/sys-boot/yaboot/files/yaboot-stubfuncs.patch b/sys-boot/yaboot/files/yaboot-stubfuncs.patch new file mode 100644 index 000000000000..ba6fcc7b3606 --- /dev/null +++ b/sys-boot/yaboot/files/yaboot-stubfuncs.patch @@ -0,0 +1,231 @@ +Stub out some functions that are not provided (and unneeded) + +--- a/lib/malloc.c ++++ b/lib/malloc.c +@@ -64,6 +64,15 @@ void *malloc (unsigned int size) + return caddr; + } + ++/* Calloc wrapper for malloc */ ++void *memset(void *s, int c, size_t n); ++void *calloc(size_t nmemb, size_t size) { ++ void *caddr; ++ caddr = malloc(nmemb * size); ++ memset(caddr, 0, nmemb * size); ++ return caddr; ++} ++ + /* Do not fall back to the malloc above as posix_memalign is needed by + * external libraries not yaboot */ + int posix_memalign(void **memptr, size_t alignment, size_t size) +--- a/lib/nonstd.c ++++ b/lib/nonstd.c +@@ -65,3 +65,208 @@ + { + return NULL; + } ++ ++int lseek(int fd, int offset, int whence) { ++ // XXX: This whence addition seems wrong .. ++ return prom_lseek((void *)fd, whence + offset); ++} ++ ++int lseek64(int fd, int64_t offset, int whence) { ++ return lseek(fd, offset, whence); ++} ++ ++int open(const char *pathname, int flags) { ++ return (int) prom_open((char *)pathname); ++} ++ ++int open64(const char *pathname, int flags) { ++ return open(pathname, flags); ++} ++ ++// Internal glibc fortify calls. ++int __open64_2(const char *path, int flags) { ++ return open64(path, flags); ++} ++ ++int read(int fd, void *buf, size_t count) { ++ return prom_read((void *)fd, buf, count); ++} ++ ++int write(int fd, const void *buf, size_t count) { ++ return prom_write((void *)fd, (void *)buf, count); ++} ++ ++int close(int fd) { ++ prom_close((void *)fd); ++ return 0; ++} ++ ++int pread(int fd, void *buf, size_t count, int32_t offset) { ++ int curr = lseek(fd, 0, 0 /*SEEK_CUR*/); ++ lseek(fd, offset, 0 /*SEEK_SET*/); ++ int ret = read(fd, buf, count); ++ lseek(fd, curr, 0 /*SEEK_SET*/); ++ return ret; ++} ++ ++int pread64(int fd, void *buf, int64_t count, int64_t offset) { ++ return pread(fd, buf, count, offset); ++} ++ ++int pwrite(int fd, const void *buf, size_t count, int32_t offset) { ++ int curr = lseek(fd, 0, 0 /*SEEK_CUR*/); ++ lseek(fd, offset, 0 /*SEEK_SET*/); ++ int ret = write(fd, buf, count); ++ lseek(fd, curr, 0 /*SEEK_SET*/); ++ return ret; ++} ++ ++int pwrite64(int fd, const void *buf, int64_t count, int64_t offset) { ++ return pwrite(fd, buf, count, offset); ++} ++ ++// No fsync, just assume we've sync'd ++int fsync(int fd) { ++ return 0; ++} ++ ++// ext2 libs only use this to turn off caches currently ++int fcntl(int fd, int cmd, ...) { ++ return 0; ++} ++ ++void exit(int status) { ++ prom_exit(); ++} ++ ++int __printf_chk(int flag, const char *format, ...) { ++ va_list ap; ++ va_start (ap, format); ++ prom_vfprintf (prom_stdout, format, ap); ++ va_end (ap); ++ ++ return 0; ++} ++ ++int __sprintf_chk(char * str, int flag, size_t strlen, const char * format, ...) { ++ va_list ap; ++ va_start(ap, format); ++ // No sprintf? :( ++ va_end(ap); ++ return 0; ++ ++} ++ ++int __fprintf_chk(FILE *stream, int flag, const char *format, ...) { ++ va_list ap; ++ va_start (ap, format); ++ prom_vfprintf (prom_stdout, format, ap); ++ va_end (ap); ++ ++ return 0; ++} ++ ++void *memcpy(void *dest, const void *src, size_t n); ++void *__memcpy_chk(void *dest, const void *src, size_t n, size_t destlen) { ++ return memcpy(dest, src, n); ++} ++ ++// But these are all dummy functions ++int __xstat64 (int __ver, const char *__filename, void *__stat_buf) { ++ return 0; ++} ++ ++int stat64(const char *path, void *stat_buf) { ++ return 0; ++} ++ ++int fstat64(int fildes, void *stat_buf) { ++ return 0; ++} ++ ++int __fxstat64 (int __ver, int __filedesc, void *__stat_buf) { ++ return 0; ++} ++ ++signed int random(void) { ++ return 0; ++} ++ ++void srandom(unsigned int seed) { ++ return; ++} ++ ++int rand(void) { ++ return 0; ++} ++ ++void srand(unsigned int seed) { ++ return; ++} ++ ++unsigned int sleep(unsigned int seconds) { ++ return 0; ++} ++ ++int gettimeofday(void *tv, void *tz) { ++ return 0; ++} ++ ++long sysconf(int name) { ++ return 0; ++} ++ ++int getpagesize(void) { ++ return 0; ++} ++ ++int gethostname(char *name, size_t len) { ++ return 0; ++} ++ ++int getpid(void) { ++ return 0; ++} ++ ++int getuid(void) { ++ return 0; ++} ++ ++void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)) { ++ return; ++} ++ ++int * __errno_location(void) { ++ return 0; ++} ++ ++size_t fwrite(const void *ptr, size_t size, size_t nmemb, void *stream) { ++ return 0; ++} ++ ++int ioctl(int d, int request, ...) { ++ return 0; ++} ++ ++int fallocate(int fd, int mode, unsigned int offset, unsigned int len) { ++ return 0; ++} ++ ++int uname(void *buf) { ++ return 0; ++} ++ ++int setrlimit(int resource, void *rlim) { ++ return 0; ++} ++ ++unsigned long long int strtoull(const char *nptr, char **endptr, int base) { ++ return 0; ++} ++ ++int getrlimit(int resource, void *rlim) { ++ return 0; ++} ++ ++int stderr = 0; ++int perror = 0; diff --git a/sys-boot/yaboot/files/yabootconfig-1.3.13.patch b/sys-boot/yaboot/files/yabootconfig-1.3.13.patch new file mode 100644 index 000000000000..4bc13eef8b18 --- /dev/null +++ b/sys-boot/yaboot/files/yabootconfig-1.3.13.patch @@ -0,0 +1,42 @@ +--- yaboot-1.3.13.orig/ybin/yabootconfig 2004-11-04 21:57:17.000000000 -0500 ++++ yaboot-1.3.13/ybin/yabootconfig 2004-11-04 22:40:45.503060512 -0500 +@@ -5,6 +5,8 @@ + ## yabootconfig generates a simple /etc/yaboot.conf + ## Copyright (C) 2001, 2002, 2003 Ethan Benson + ## ++## Patched for Gentoo and dual boot - Mark Guertin <gerk@gentoo.org> ++## + ## This program is free software; you can redistribute it and/or + ## modify it under the terms of the GNU General Public License + ## as published by the Free Software Foundation; either version 2 +@@ -264,6 +266,30 @@ + return 0 + } + ++dualboot() ++{ ++ DRIVELIST=`ls -d /dev/?d?* | grep "[sh]d[abcdefghijkl]" | cut -b 6-8 | sort -u` ++ ++ for i in $DRIVELIST ++ do ++ HFS=`mac-fdisk -l "/dev/$i" | grep '\<Apple_HFS\>' | grep -v "CDROM" | cut -d" " -f1` ++ for h in $HFS ++ do ++ if [ !-x `hpmount -r $h` > /dev/null 2>&1 ] ; then ++ if [ `hpls mach_kernel 2>/dev/null` ] ; then ++ [ "$QUIET" = 0 ] && echo "Found possible OS X/Darwin partition at $h" ++ OSX=$h ++ fi ++ if [ "`hpls "System Folder" 2>/dev/null`" ] ; then ++ [ "$QUIET" = 0 ] && echo "Found possible Mac OS partition at $h" ++ MACOS=$h ++ fi ++ hpumount $h > /dev/null 2>&1 ++ fi ++ done ++ done ++} ++ + ########## + ## Main ## + ########## diff --git a/sys-boot/yaboot/metadata.xml b/sys-boot/yaboot/metadata.xml new file mode 100644 index 000000000000..4940e80d1b3e --- /dev/null +++ b/sys-boot/yaboot/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>ppc@gentoo.org</email> + <name>Gentoo Linux PowerPC Development</name> +</maintainer> + <origin>gentoo-staging</origin> +</pkgmetadata> diff --git a/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild b/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild new file mode 100644 index 000000000000..dae3363bec71 --- /dev/null +++ b/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit eutils toolchain-funcs + +DESCRIPTION="PPC Bootloader" +HOMEPAGE="http://yaboot.ozlabs.org" +SRC_URI="http://yaboot.ozlabs.org/releases/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ppc -ppc64" +IUSE="ibm" + +DEPEND="sys-apps/powerpc-utils + sys-fs/e2fsprogs[static-libs]" +RDEPEND="!sys-boot/yaboot-static + !ibm? ( + sys-fs/hfsutils + sys-fs/hfsplusutils + sys-fs/mac-fdisk + )" + +src_prepare() { + # No need to hardcode this path -- the compiler already knows to use it. + sed -i \ + -e 's:-I/usr/include::' \ + Makefile || die + + # dual boot patch + epatch "${FILESDIR}/yabootconfig-1.3.13.patch" + epatch "${FILESDIR}/chrpfix.patch" + epatch "${FILESDIR}/yaboot-nopiessp-gcc4.patch" + epatch "${FILESDIR}/sysfs-ofpath.patch" +} + +src_compile() { + unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS + emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" LD="$(tc-getLD)" +} + +src_install() { + sed -i -e 's/\/local//' etc/yaboot.conf + emake ROOT="${D}" PREFIX=/usr MANDIR=share/man install +} diff --git a/sys-boot/yaboot/yaboot-1.3.16.ebuild b/sys-boot/yaboot/yaboot-1.3.16.ebuild new file mode 100644 index 000000000000..d7c35c1ef85b --- /dev/null +++ b/sys-boot/yaboot/yaboot-1.3.16.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit eutils toolchain-funcs + +DESCRIPTION="PPC Bootloader" +HOMEPAGE="http://yaboot.ozlabs.org" +SRC_URI="http://yaboot.ozlabs.org/releases/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ppc -ppc64" +IUSE="ibm" + +DEPEND="sys-apps/powerpc-utils + sys-fs/e2fsprogs[static-libs]" +RDEPEND="!sys-boot/yaboot-static + !ibm? ( + sys-fs/hfsutils + sys-fs/hfsplusutils + sys-fs/mac-fdisk + )" + +src_unpack() { + default + cd "${S}" + cp "${FILESDIR}/new-ofpath" "${S}/ybin/ofpath" +} + +src_prepare() { + # No need to hardcode this path -- the compiler already knows to use it. + sed -i \ + -e 's:-I/usr/include::' \ + Makefile || die + + # dual boot patch + epatch "${FILESDIR}/yabootconfig-1.3.13.patch" + epatch "${FILESDIR}/chrpfix.patch" + epatch "${FILESDIR}/yaboot-nopiessp-gcc4.patch" + + # e2fsprogs memalign patch + epatch "${FILESDIR}/${P}-memalign.patch" +} + +src_compile() { + unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS + emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" LD="$(tc-getLD)" +} + +src_install() { + sed -i -e 's/\/local//' etc/yaboot.conf || die + emake ROOT="${D}" PREFIX=/usr MANDIR=share/man install + mv "${ED}"/etc/yaboot.conf{,.sample} || die +} diff --git a/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild b/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild new file mode 100644 index 000000000000..388d67bca957 --- /dev/null +++ b/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit eutils toolchain-funcs + +DESCRIPTION="PPC Bootloader" +HOMEPAGE="http://yaboot.ozlabs.org" +SRC_URI="http://yaboot.ozlabs.org/releases/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ppc -ppc64" +IUSE="ibm" + +DEPEND="sys-apps/powerpc-utils + sys-fs/e2fsprogs[static-libs]" +RDEPEND="!sys-boot/yaboot-static + !ibm? ( + sys-fs/hfsutils + sys-fs/hfsplusutils + sys-fs/mac-fdisk + )" + +src_unpack() { + default + cd "${S}" + cp "${FILESDIR}/new-ofpath" "${S}/ybin/ofpath" +} + +src_prepare() { + # No need to hardcode this path -- the compiler already knows to use it. + # Error only on real errors, for prom printing format compile failure. + sed -i \ + -e 's:-I/usr/include::' \ + -e 's:-Werror:-Wno-error:g' \ + Makefile || die + + # dual boot patch + epatch "${FILESDIR}/yabootconfig-1.3.13.patch" + epatch "${FILESDIR}/chrpfix.patch" + epatch "${FILESDIR}/${P}-nopiessp-gcc4.patch" + epatch "${FILESDIR}/${PN}-stubfuncs.patch" + + # Fix the devspec path on newer kernels + epatch "${FILESDIR}/new-ofpath-devspec.patch" +} + +src_compile() { + unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS + emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" LD="$(tc-getLD)" +} + +src_install() { + sed -i -e 's/\/local//' etc/yaboot.conf || die + emake ROOT="${D}" PREFIX=/usr MANDIR=share/man install + mv "${ED}"/etc/yaboot.conf{,.sample} || die +} diff --git a/sys-boot/yaboot/yaboot-1.3.17-r3.ebuild b/sys-boot/yaboot/yaboot-1.3.17-r3.ebuild new file mode 100644 index 000000000000..832df154e076 --- /dev/null +++ b/sys-boot/yaboot/yaboot-1.3.17-r3.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic toolchain-funcs + +# yaboot is sensitive to external libc dependencies +# of e2fsprogs. Pin to known working versions. +# As a bonus we can control CFLAGS used to build e2fsprogs. +# See compile_bundled_e2fsprogs() below and https://bugs.gentoo.org/641560 +E2FS_P="e2fsprogs-1.42.13" + +DESCRIPTION="PPC Bootloader" +HOMEPAGE="http://yaboot.ozlabs.org" +SRC_URI=" + http://yaboot.ozlabs.org/releases/${P}.tar.gz + mirror://sourceforge/e2fsprogs/${E2FS_P}.tar.gz +" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~ppc -ppc64" +IUSE="ibm" + +DEPEND=" + sys-apps/powerpc-utils +" +RDEPEND="!sys-boot/yaboot-static + !ibm? ( + sys-fs/hfsutils + sys-fs/hfsplusutils + sys-fs/mac-fdisk + )" + +PATCHES=( + # dual boot patch + "${FILESDIR}/yabootconfig-1.3.13.patch" + "${FILESDIR}/chrpfix.patch" + "${FILESDIR}/${P}-nopiessp-gcc4.patch" + "${FILESDIR}/${PN}-stubfuncs.patch" + + # Fix the devspec path on newer kernels + "${FILESDIR}/new-ofpath-devspec.patch" +) + +src_prepare() { + # has to be copied before 'new-ofpath-devspec' + cp "${FILESDIR}/new-ofpath" "${S}/ybin/ofpath" || die + default + + pushd "${WORKDIR}/${E2FS_P}" + eapply "${FILESDIR}"/e2fsprogs-1.42.13-sysmacros.h.patch + popd + + # No need to hardcode this path -- the compiler already knows to use it. + # Error only on real errors, for prom printing format compile failure. + sed -i \ + -e 's:-I/usr/include::' \ + -e 's:-Werror:-Wno-error:g' \ + Makefile || die + + # We'll install bundled libext2fs.a here + DEPS_DIR="${T}"/bundled-deps + export DEPS_DIR +} + +src_configure() { + # ld.gold fails to link yaboot as: + # sorry, I can't find space in second/yaboot.chrp to put the note + # bug #678710 + tc-ld-disable-gold + + pushd "${WORKDIR}/${E2FS_P}" || die + econf \ + --enable-libblkid \ + --enable-libuuid \ + --disable-fsck \ + --disable-quota + popd + + default +} + +src_compile() { + # Note: we use unmodified host's CFLAGS to build depends. + emake -C "${WORKDIR}/${E2FS_P}" V=1 + # install-libs to install libext2fs.a for yaboot to statically link against + emake -C "${WORKDIR}/${E2FS_P}" DESTDIR="${DEPS_DIR}" install-libs V=1 + + unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS + # -std=gnu90 is needed to preserve 'inline' semantics + # of pre-c99 (always-inline) to avoid duplicate symbol + # definition, bug #641560. + # -L${deps_prefix}/usr/lib is needed to inject known + # working libext2fs.a as yaboot bundles header overrides + # that assume matcking implementation. System's version + # frequently does not work like in bug #641560. + emake \ + PREFIX=/usr \ + MANDIR=share/man \ + CC="$(tc-getCC) -std=gnu90" \ + LD="$(tc-getLD) -L${DEPS_DIR}/usr/lib" +} + +src_install() { + sed -i -e 's/\/local//' etc/yaboot.conf || die + emake \ + ROOT="${D}" \ + PREFIX=/usr \ + MANDIR=share/man \ + CC="$(tc-getCC) -std=gnu90" \ + LD="$(tc-getLD) -L${DEPS_DIR}/usr/lib" \ + \ + install + mv "${ED}"/etc/yaboot.conf{,.sample} || die +} |
