diff options
Diffstat (limited to 'sys-boot/arcload')
-rw-r--r-- | sys-boot/arcload/ChangeLog | 14 | ||||
-rw-r--r-- | sys-boot/arcload/Manifest | 24 | ||||
-rw-r--r-- | sys-boot/arcload/arcload-0.50-r2.ebuild (renamed from sys-boot/arcload/arcload-0.50-r1.ebuild) | 67 | ||||
-rw-r--r-- | sys-boot/arcload/files/arcload-0.50-makefile-targets.patch | 42 | ||||
-rw-r--r-- | sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch | 273 | ||||
-rw-r--r-- | sys-boot/arcload/files/arcload.8 | 65 |
6 files changed, 150 insertions, 335 deletions
diff --git a/sys-boot/arcload/ChangeLog b/sys-boot/arcload/ChangeLog index ae4e86a1597c..0b1db93c130a 100644 --- a/sys-boot/arcload/ChangeLog +++ b/sys-boot/arcload/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for sys-boot/arcload -# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/ChangeLog,v 1.16 2014/08/10 20:20:54 slyfox Exp $ +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/ChangeLog,v 1.17 2015/03/05 04:45:30 kumba Exp $ + +*arcload-0.50-r2 (05 Mar 2015) + + 05 Mar 2015; Joshua Kinard <kumba@gentoo.org> -arcload-0.50-r1.ebuild, + +arcload-0.50-r2.ebuild, -files/arcload-0.50-makefile-targets.patch, + -files/arcload-0.50-shut-gcc4x-up.patch, +files/arcload.8: + Big cleanup: Include some patches and a manpage from Debian, re-work the code + a little to compile under an n32-only system (should work for n64 as well), + silence many compiler warnings, and move patches to a tarball due to the size + of the changes. 10 Aug 2014; Sergei Trofimovich <slyfox@gentoo.org> arcload-0.50-r1.ebuild: QA: drop trailing '.' from DESCRIPTION diff --git a/sys-boot/arcload/Manifest b/sys-boot/arcload/Manifest index 778d58ffb8c8..5cf36bb50412 100644 --- a/sys-boot/arcload/Manifest +++ b/sys-boot/arcload/Manifest @@ -1,16 +1,26 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 -AUX arcload-0.50-makefile-targets.patch 928 SHA256 6f1b14403ee85e1f5397b8b4e1d873cbc67624ae3c0f09ae840788988784d846 SHA512 b5531d68b731a758af6f36c7fd6b5f78f41ce5186754949e9976a29fc1887e5ebd41829ec76c75c633bc8e17026c520f8445a975fae6f92d2b87997f98f7e5b9 WHIRLPOOL da8144ea651af98e7fca1cbf0369f30d1197ba4080c495c073a01369683f4391b79dfe39d3b035f8cfb188076a1eb50437e57795f90b4b98d3f91cf3194187d7 -AUX arcload-0.50-shut-gcc4x-up.patch 9385 SHA256 7fd5e671b5181f19bd5615d715f43c71ee95ed216fc989a93d276b08052f2335 SHA512 4cf51708aa4b65cc58c7ed4842b3e898fdb29e15fa4e809dbc0ef09f766ca0eccf035e405489c4711bb2fa31f8c1c28755d9d84ea7c9ed548761b2471330cfb9 WHIRLPOOL 903bee98f1dfb11afa1d5096db942f6cbea9551f3d579ae6290a9d07cb5df7eba1b375c12a56812eb7bc4a95dc7e02f44311860597a4d5397fa14c0a9d94c881 +AUX arcload.8 2068 SHA256 8aff3d9e0f2f476ada1e9564558ed7a032d98f4687f3f9ed95e99aa970b3696e SHA512 1b62e8116174d6909e947d88ef1a0ad0214b988c48f579eb9310984ad4e73b7c686e644be2b09dbab7dc2053fc36b1d80d272765c168dd8a662a6420e5ffcd75 WHIRLPOOL a86f92e6c5bc6d34785f60b60d3746f94aa1ac7a3f092df3f8e0f7ddf6db3635d66bb7a69178c4ccd19829e1fc8a16ab17d0d4fe7526ce24f24fae043c9ea5af DIST arcload-0.5.tar.bz2 47690 SHA256 69cc45f7d27b30256875ccda115b6f74dd3bd894033f0f81b6f87ea1d8f7a0ac -EBUILD arcload-0.50-r1.ebuild 2899 SHA256 af58a6dab0ef786f53bf1b9f6ebdfe3565f40239b28031ce3f743513ed419eed SHA512 9205a4830d4071247097cee99dd934940bd63012fc915cbe7ccb6c77b2b994b3726e6b3a09fd690000fc38eb09733cb079c47749628a458581c619862904fa37 WHIRLPOOL efdc85a6f94ceea48617296f74e64725ddb4c2f67069f75ff13bb1e17fb083fd8fbf4147c0669db4b732c574bc388412096f07f622b3ea1c64cd086fa310dce6 -MISC ChangeLog 3224 SHA256 eb778cb0cde464f7aef6d1049da7e71b0f775bd3e954921a7e7b72a59ff91b6c SHA512 e305ffb305474aa58810854bfb0511273128d161365f5e83f5e870ed10a59f40c01b4aeebb9f685df50bc0c9cd33dcecc46a49ca1839627d66865d16a72156aa WHIRLPOOL af2175467bfacf907abeb88dafc576e20076c78b39f291e514c47cad6c90d2b95d03851a58dabe9a9ad9a81489be5804d8ca5c14f16880789b95a76510978ef9 +DIST arcload-0.50-patches-v1.tar.xz 10320 SHA256 161ef360576e3af354022e1a7398ba3af2111f81bb6b6575db5e4c3cd93ce631 SHA512 7687b08bc70a96f8db9a620976b466ff4bb70c8ed77b0c241d060feb8dcab6019d753ac3b182a74139331c9d33f27e090897a0c7c41c1663e16575fef6e21bdf WHIRLPOOL 77b2e51035dcdc9c4f5cd621d2ad44023752e57e6fe7bc1589b365de473c3979eef85aa5391f6e6679993c67036b81895845338c35b1e23406a282b354bb1378 +EBUILD arcload-0.50-r2.ebuild 4392 SHA256 97b68685e3d1f6f23bb610e0706241f671e4fa24b2801e406e021aa5788930e5 SHA512 17889a67ebc2d1beefd973a75b51234ddcd7dc8fc6a4c414978c570c17fa3324b6c8fa7fd176ff34d8555f79fed1d5da74946d9ebb1d867b8d8ea6aefc4fb361 WHIRLPOOL 5d408d054e47c3d66c9b0d0494288ecf637b617172a6a3e8b59028e897dd6c4410a5a9463fce9810f4b5a1d6f5930c36e1891181a9ce812fdbd84a69de4cf065 +MISC ChangeLog 3717 SHA256 a1c85639e77d6f28760e1b54caf1160dec406a556dc46a7dfec918d18f47f8a0 SHA512 9b76782832451a9eab9e75f85e80276204c888dab63514aeda859134e2798f216065f97b89602885a0405eec618d6cf3d2232ea71ccab9b2d766289843fafd04 WHIRLPOOL 502877f34b353a55b3782761a3a6fe2daac19e1f59c5c6130debfa51001106d3f5d6dbf3978b48cf26c07a42d923329a3f7c2e9d6deb022910b9f25e217ee2d3 MISC metadata.xml 278 SHA256 8b9d1872cbd786725fe219abeb254e89529a7a7839bb207d6a005c73ba9ea12d SHA512 026b05e266dcad8e1b470ffe917554de4666504d4149bc6a5e5781fb8f49902c96c57e23cbef5dec387a202c0e6d6ec70a5594490a14c00b08b7d8379d5ee20e WHIRLPOOL 42fbf8cea3569fb772805bf29753e879ce6c8fe9c898eec7aede4a9714f90906fdb4f5f8cea0270a9ccbca83af1def382daed548c2b2d858fce06050a0558be7 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iEYEAREIAAYFAlPn1CcACgkQcaHudmEf86o1nACfUrpi1IeBD3ah280HHj9HFZEw -6SwAn2ruOtrioKvfBWNgahayOLUswSG9 -=3umT +iQIcBAEBCAAGBQJU9994AAoJENsjoH7SXZXjX08QAIUr0hhGd3f8TiBYloJLey7g +Lv+7XUIlohMSOg9R5FFTxBUYIrbmfr3RHKqyGpHil4SIU2WFznzUgQQ97nmrLEfF +xjvdqjLlCuWW8PVwHtIu5OFOlZ4mxrK4+gtUtuIvris9/BRhq5rLJlyDC/dndRwS +qHtiujH0Y6qzynxrHOuV+JwqpPJbTyusQ/De25hFa1nxdAg8f6VhB8p4xuk7mF7s +jVhgKDr+rfDl9H0mYhjhENG4KaMlKhoFZp2CEJzaB4fklku9f2AekbcGuAoMyaeX +9FLAc4BOHWl6P4X3T8BDN2BER+xdoOD3xK4knQgbe4EJ9cOh+1FlNHZUEy4nSSzt +8VDH3QK93cBbl4Lm1f+gseptK6ydxFbAmHIE8EnPqF0he81vASxwH5DQLeFo8tLH +NmtLuZhjHDsxJKvy7Qz2BFNL7uuV4piI7QGvF406SS3iUJLF1GTGTHfMHuWiPH/o +99gLYBpyyPWv+Cl3y5dTfI12h3yKnRGAyjR77/88J+d1UHEINaPlW3uk1fRHWkyT +UYjtm3scqcl7vaq/NoV9UiIUnGOSgTLlZ/SBja+2Bpr2Rw86DRFRxlkQj38a7uTc +RvlGmCLK6t2722gJ3wkIV/2iCHkWF29tZzWg2HKzucbdZH6Vz9y3QdJDQE/nMlCy +Xav6paMR8n7PxU+rxGHC +=AdPo -----END PGP SIGNATURE----- diff --git a/sys-boot/arcload/arcload-0.50-r1.ebuild b/sys-boot/arcload/arcload-0.50-r2.ebuild index b98e38cdb152..1e7340a6b34b 100644 --- a/sys-boot/arcload/arcload-0.50-r1.ebuild +++ b/sys-boot/arcload/arcload-0.50-r2.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/arcload-0.50-r1.ebuild,v 1.6 2014/08/10 20:20:54 slyfox Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/arcload-0.50-r2.ebuild,v 1.1 2015/03/05 04:45:30 kumba Exp $ EAPI=4 @@ -9,31 +9,73 @@ 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="http://www.linux-mips.org/wiki/index.php/ARCLoad" -SRC_URI="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/${PN}-${MY_PV}.tar.bz2" +SRC_URI="ftp://ftp.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="" -DEPEND="sys-boot/dvhtool" +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 - $(version_is_at_least "4.0" "$(gcc-version)") && \ - epatch "${FILESDIR}"/${P}-shut-gcc4x-up.patch + 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 "${FILESDIR}"/${P}-makefile-targets.patch + epatch "${PATCHDIR}"/${P}-makefile-targets.patch + + # Patches borrowed from Debian: + # - Load ELF64 images on 32-bit systems + # - 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. @@ -43,17 +85,17 @@ src_compile() { # 32bit copy (sashARCS for IP22/IP32) echo -e "" - einfo ">>> Building 32-bit version (sashARCS) for IP22/IP32 ..." + einfo ">>> Building 32-bit version (sashARCS) for IP22/IP32 with ${myCC} ..." cd "${S}" emake MODE=M32 bootloader_clean - emake CC=$(tc-getCC) LD=$(tc-getLD) MODE=M32 bootloader + 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 ..." + einfo ">>> Building 64-bit version (sash64) for IP27/IP28/IP30 ${myCC/mips/mips64} ..." emake MODE=M64 bootloader_clean - emake CC=$(tc-getCC) LD=$(tc-getLD) MODE=M64 bootloader + emake CC=${myCC64} LD=${myLD64} MODE=M64 bootloader cp "${S}"/arcload "${WORKDIR}"/sash64 } @@ -63,6 +105,9 @@ src_install() { 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() { diff --git a/sys-boot/arcload/files/arcload-0.50-makefile-targets.patch b/sys-boot/arcload/files/arcload-0.50-makefile-targets.patch deleted file mode 100644 index 9248ac4ccd9c..000000000000 --- a/sys-boot/arcload/files/arcload-0.50-makefile-targets.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -Naurp arcload-0.5.orig/Makefile arcload-0.5/Makefile ---- arcload-0.5.orig/Makefile 2006-01-17 03:53:29.000000000 -0500 -+++ arcload-0.5/Makefile 2009-03-01 20:18:14.699758276 -0500 -@@ -6,9 +6,6 @@ - # Default MODE - MODE ?= M64 - --CC=mips-linux-gcc --LD=mips-linux-ld -- - BUILD_DIRS=\ - arclib \ - arcgrub \ -@@ -16,10 +13,25 @@ BUILD_DIRS=\ - TOOL_DIRS=\ - ecoff - --all clean: -+bootloader: -+ for i in $(BUILD_DIRS); do \ -+ CC=${CC} LD=${LD} MODE=${MODE} $(MAKE) -C $$i all; \ -+ done -+ -+tools: - for i in $(TOOL_DIRS); do \ -- MODE=${MODE} $(MAKE) -C $$i $@; \ -+ $(MAKE) -C $$i all; \ - done -+ -+bootloader_clean: - for i in $(BUILD_DIRS); do \ -- CC=${CC} LD=${LD} MODE=${MODE} $(MAKE) -C $$i $@; \ -+ CC=${CC} LD=${LD} MODE=${MODE} $(MAKE) -C $$i clean; \ -+ done -+ -+tools_clean: -+ for i in $(TOOL_DIRS); do \ -+ CC=${CC} LD=${LD} $(MAKE) -C $$i clean; \ - done -+ -+clean: tools_clean bootloader_clean -+all: tools bootloader diff --git a/sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch b/sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch deleted file mode 100644 index 52ad5a107af1..000000000000 --- a/sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch +++ /dev/null @@ -1,273 +0,0 @@ -diff -Naurp arcload-0.5.orig/arcgrub/Makefile arcload-0.5/arcgrub/Makefile ---- arcload-0.5.orig/arcgrub/Makefile 2006-01-17 22:43:17.000000000 -0500 -+++ arcload-0.5/arcgrub/Makefile 2009-03-01 20:34:01.258690486 -0500 -@@ -2,11 +2,19 @@ - # Copyright 2004 Stanislaw Skowronek - # - ifeq ($(MODE),M32) --CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -I. -D$(MODE) -+CFLAGS = -O -march=mips3 -mabi=32 \ -+ -Wall -Wno-pointer-sign \ -+ -mno-abicalls -G 0 -fno-pic -fno-builtin \ -+ -I.. -I. \ -+ -D$(MODE) - ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic -D$(MODE) - OUTPUTFMT = elf32-tradbigmips - else --CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -I. -D$(MODE) -+CFLAGS = -O -march=mips3 -mabi=64 \ -+ -Wall -Wno-pointer-sign \ -+ -mno-abicalls -G 0 -fno-pic -fno-builtin \ -+ -I.. -I. \ -+ -D$(MODE) - ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic -D$(MODE) - OUTPUTFMT = elf64-tradbigmips - endif -diff -Naurp arcload-0.5.orig/arclib/Makefile arcload-0.5/arclib/Makefile ---- arcload-0.5.orig/arclib/Makefile 2006-01-19 23:09:21.000000000 -0500 -+++ arcload-0.5/arclib/Makefile 2009-03-01 20:35:21.407711034 -0500 -@@ -2,11 +2,19 @@ - # Copyright 1999 Silicon Graphics, Inc. - # - ifeq ($(MODE),M32) --CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE) -+CFLAGS = -O -march=mips3 -mabi=32 \ -+ -Wall -Wno-pointer-sign \ -+ -mno-abicalls -G 0 -fno-pic -fno-builtin \ -+ -I.. \ -+ -D$(MODE) - ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic - OUTPUTFMT = elf32-tradbigmips - else --CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE) -+CFLAGS = -O -march=mips3 -mabi=64 \ -+ -Wall -Wno-pointer-sign \ -+ -mno-abicalls -G 0 -fno-pic -fno-builtin \ -+ -I.. \ -+ -D$(MODE) - ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic - OUTPUTFMT = elf64-tradbigmips - endif -diff -Naurp arcload-0.5.orig/ecoff/Makefile arcload-0.5/ecoff/Makefile ---- arcload-0.5.orig/ecoff/Makefile 2005-05-31 03:08:10.000000000 -0400 -+++ arcload-0.5/ecoff/Makefile 2009-03-01 20:31:38.246701883 -0500 -@@ -5,7 +5,7 @@ - all: wreckoff - - wreckoff: ecoff.h elf32.h endian.h list.h wreckoff.c -- $(CC) -o $@ -O2 -Wall wreckoff.c -I.. -+ $(CC) -o $@ -O2 -Wall -Wno-pointer-sign wreckoff.c -I.. - - clean: - rm -f wreckoff -diff -Naurp arcload-0.5.orig/ecoff/wreckoff.c arcload-0.5/ecoff/wreckoff.c ---- arcload-0.5.orig/ecoff/wreckoff.c 2005-05-31 03:30:28.000000000 -0400 -+++ arcload-0.5/ecoff/wreckoff.c 2009-03-01 20:31:38.246701883 -0500 -@@ -112,6 +112,7 @@ void synthesize_ecoff(FILE *f) - int i, nsyms, nscns, vptr, rptr, sptr, align; - int strsize, sym_sc = scNil, sym_st = 0; - char *strtab; -+ size_t ret = 0; - - /* reindex sections and symbols */ - nscns = 0; -@@ -151,7 +152,7 @@ void synthesize_ecoff(FILE *f) - fhdr.f_opthdr = 56; - fhdr.f_flags = (F_EXEC | F_MIPS_NO_REORG); - swap_filehdr(&fhdr); -- fwrite(&fhdr, sizeof(struct filehdr), 1, f); -+ ret = fwrite(&fhdr, sizeof(struct filehdr), 1, f); - - /* write a.out header */ - ahdr.magic = OMAGIC; -@@ -196,7 +197,7 @@ void synthesize_ecoff(FILE *f) - - ahdr.gp_value = reginfo.ri_gp_value; - swap_aouthdr(&ahdr); -- fwrite(&ahdr, sizeof(struct aouthdr), 1, f); -+ ret = fwrite(&ahdr, sizeof(struct aouthdr), 1, f); - - LIST_FOR(section, sections) { - strncpy(shdr.s_name, section->name, 8); -@@ -229,23 +230,23 @@ void synthesize_ecoff(FILE *f) - shdr.s_flags = STYP_BSS; - - swap_scnhdr(&shdr); -- fwrite(&shdr, sizeof(struct scnhdr), 1, f); -+ ret = fwrite(&shdr, sizeof(struct scnhdr), 1, f); - } - - i = 0; - while(align--) -- fwrite(&i, 1, 1, f); -+ ret = fwrite(&i, 1, 1, f); - - /* save section contents */ - LIST_FOR(section, sections) - if(section->data) { - if(section->gccfix) { -- fwrite(section->data, (section->size - 0x10), 1, f); -+ ret = fwrite(section->data, (section->size - 0x10), 1, f); - align = 0; - for(i = 0; i < 4; i++) -- fwrite(&align, 4, 1, f); -+ ret = fwrite(&align, 4, 1, f); - } else -- fwrite(section->data, section->size, 1, f); -+ ret = fwrite(section->data, section->size, 1, f); - } - - /* save section relocs */ -@@ -275,7 +276,7 @@ void synthesize_ecoff(FILE *f) - rhdr.r_vaddr = reloc->offset; - rhdr.r = R_R(reloc->sym->index, i, 1); - swap_reloc(&rhdr); -- fwrite(&rhdr, sizeof(struct reloc), 1, f); -+ ret = fwrite(&rhdr, sizeof(struct reloc), 1, f); - } - - /* create strtab */ -@@ -302,10 +303,10 @@ void synthesize_ecoff(FILE *f) - ghdr.iextMax = nsyms; - ghdr.cbExtOffset = (sptr + sizeof(struct sgihdrr) + strsize); - swap_sgihdrr(&ghdr); -- fwrite(&ghdr, sizeof(struct sgihdrr), 1, f); -+ ret = fwrite(&ghdr, sizeof(struct sgihdrr), 1, f); - - /* save strtab */ -- fwrite(strtab, strsize, 1, f); -+ ret = fwrite(strtab, strsize, 1, f); - - /* save symbols */ - LIST_FOR(symbol, symbols) -@@ -331,7 +332,7 @@ void synthesize_ecoff(FILE *f) - mhdr.value = symbol->offset; - mhdr.data = S_DATA(sym_st, sym_sc, 0xFFFFF); - swap_sgiextr(&mhdr); -- fwrite(&mhdr, sizeof(struct sgiextr), 1, f); -+ ret = fwrite(&mhdr, sizeof(struct sgiextr), 1, f); - } - } - -@@ -340,8 +341,9 @@ void synthesize_ecoff(FILE *f) - char *load_strtab(FILE *f, unsigned off, int sz) - { - char *p = malloc(sz); -+ size_t ret = 0; - fseek(f, off, SEEK_SET); -- fread(p, sz, 1, f); -+ ret = fread(p, sz, 1, f); - return p; - } - -@@ -359,13 +361,14 @@ void analyze_elf32(FILE *f) - struct Reloc *reloc; - int i, j, symtab; - char **strtabs, **shnames; -+ size_t ret = 0; - - LIST_INIT(sections); - LIST_INIT(symbols); - - /* load ELF header */ - fseek(f, 0, SEEK_SET); -- fread(&ehdr, sizeof(Elf32_Ehdr), 1, f); -+ ret = fread(&ehdr, sizeof(Elf32_Ehdr), 1, f); - swap_Ehdr(&ehdr); - for(i = 0; i < 6; i++) - if(ehdr.e_ident[i] != elf32_ident[i]) -@@ -379,7 +382,7 @@ void analyze_elf32(FILE *f) - strtabs = calloc(sizeof(char *), ehdr.e_shnum); - for(i = 0; i < ehdr.e_shnum; i++) { - fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET); -- fread(&shdr, sizeof(Elf32_Shdr), 1, f); -+ ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f); - swap_Shdr(&shdr); - - if(shdr.sh_type == SHT_STRTAB) -@@ -396,14 +399,14 @@ void analyze_elf32(FILE *f) - shnames=calloc(sizeof(char *),ehdr.e_shnum); - for(i = 0; i < ehdr.e_shnum; i++) { - fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET); -- fread(&shdr, sizeof(Elf32_Shdr), 1, f); -+ ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f); - swap_Shdr(&shdr); - shnames[i] = (strtabs[ehdr.e_shstrndx] + shdr.sh_name); - - if((shdr.sh_flags & SHF_ALLOC)) { - if(shdr.sh_type == SHT_REGINFO) { - fseek(f, shdr.sh_offset, SEEK_SET); -- fread(®info, sizeof(Elf32_RegInfo), 1, f); -+ ret = fread(®info, sizeof(Elf32_RegInfo), 1, f); - swap_RegInfo(®info); - continue; - } -@@ -436,7 +439,7 @@ void analyze_elf32(FILE *f) - /* load symbols */ - if(symtab != -1) { - fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * symtab)), SEEK_SET); -- fread(&shdr, sizeof(Elf32_Shdr), 1, f); -+ ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f); - swap_Shdr(&shdr); - - if(!shdr.sh_entsize) -@@ -447,7 +450,7 @@ void analyze_elf32(FILE *f) - - for( i = 0; i < (shdr.sh_size / shdr.sh_entsize); i++) { - fseek(f, (shdr.sh_offset + (shdr.sh_entsize * i)), SEEK_SET); -- fread(&mhdr, sizeof(Elf32_Sym), 1, f); -+ ret = fread(&mhdr, sizeof(Elf32_Sym), 1, f); - swap_Sym(&mhdr); - symbol = calloc(sizeof(struct Symbol), 1); - symbol->name = (strtabs[shdr.sh_link] + mhdr.st_name); -@@ -470,7 +473,7 @@ void analyze_elf32(FILE *f) - /* load rels and decompose relas */ - for(i = 0; i < ehdr.e_shnum; i++) { - fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET); -- fread(&shdr, sizeof(Elf32_Shdr), 1, f); -+ ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f); - swap_Shdr(&shdr); - - if((shdr.sh_type != SHT_REL) && (shdr.sh_type != SHT_RELA)) -@@ -491,13 +494,13 @@ void analyze_elf32(FILE *f) - fseek(f, (shdr.sh_offset + (shdr.sh_entsize * j)), SEEK_SET); - - if(shdr.sh_type == SHT_REL) { -- fread(&qhdr, sizeof(Elf32_Rel), 1, f); -+ ret = fread(&qhdr, sizeof(Elf32_Rel), 1, f); - swap_Rel(&qhdr); - rhdr.r_offset = qhdr.r_offset; - rhdr.r_info = qhdr.r_info; - rhdr.r_addend = 0; - } else { -- fread(&rhdr, sizeof(Elf32_Rela), 1, f); -+ ret = fread(&rhdr, sizeof(Elf32_Rela), 1, f); - swap_Rela(&rhdr); - } - -diff -Naurp arcload-0.5.orig/loader/Makefile arcload-0.5/loader/Makefile ---- arcload-0.5.orig/loader/Makefile 2006-01-19 23:10:04.000000000 -0500 -+++ arcload-0.5/loader/Makefile 2009-03-01 20:37:21.376720711 -0500 -@@ -2,12 +2,20 @@ - # Copyright 2004 Stanislaw Skowronek - # - ifeq ($(MODE),M32) --CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE) -+CFLAGS = -O -march=mips3 -mabi=32 \ -+ -Wall -Wno-pointer-sign \ -+ -mno-abicalls -G 0 -fno-pic -fno-builtin \ -+ -I.. \ -+ -D$(MODE) - ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic -D$(MODE) - OUTPUTFMT = elf32-tradbigmips - TARGET = ../arcload.ecoff - else --CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE) -+CFLAGS = -O -march=mips3 -mabi=64 \ -+ -Wall -Wno-pointer-sign \ -+ -mno-abicalls -G 0 -fno-pic -fno-builtin \ -+ -I.. \ -+ -D$(MODE) - ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic -D$(MODE) - OUTPUTFMT = elf64-tradbigmips - TARGET = ../arcload 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. |