summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weber <xmw@gentoo.org>2013-07-19 14:28:39 +0000
committerMichael Weber <xmw@gentoo.org>2013-07-19 14:28:39 +0000
commit4412f39a1195afbe21c0a587ecfcd0b9964b7aaf (patch)
tree550169f638c1ce22456085fb098b7e64c4108b76 /sys-boot/raspberrypi-mkimage
parentInitial import (bug 421681) (diff)
downloadhistorical-4412f39a1195afbe21c0a587ecfcd0b9964b7aaf.tar.gz
historical-4412f39a1195afbe21c0a587ecfcd0b9964b7aaf.tar.bz2
historical-4412f39a1195afbe21c0a587ecfcd0b9964b7aaf.zip
Initial import (bug 421681)
Package-Manager: portage-2.2.0_alpha188/cvs/Linux x86_64 Manifest-Sign-Key: 0x62EEF090
Diffstat (limited to 'sys-boot/raspberrypi-mkimage')
-rw-r--r--sys-boot/raspberrypi-mkimage/Manifest13
-rw-r--r--sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-args-uncompressed.txt12
-rw-r--r--sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-boot-uncompressed.txt17
-rw-r--r--sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch11
-rw-r--r--sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch49
-rw-r--r--sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py45
-rw-r--r--sys-boot/raspberrypi-mkimage/metadata.xml9
-rw-r--r--sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild55
8 files changed, 210 insertions, 1 deletions
diff --git a/sys-boot/raspberrypi-mkimage/Manifest b/sys-boot/raspberrypi-mkimage/Manifest
index 5d865c76c06b..e7ef27ce03b4 100644
--- a/sys-boot/raspberrypi-mkimage/Manifest
+++ b/sys-boot/raspberrypi-mkimage/Manifest
@@ -1,7 +1,18 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
AUX raspberrypi-mkimage-0_p20120201-args-uncompressed.txt 157 SHA256 f6085b24ab74440159a836713620ca3193df9da365884f6b56917655898f00dc SHA512 f9f3ad4640ae4973b97924f08ded2a6fad4f8fea576715053d860a15e2ba3dfc39c5082eee95ef0f7fa4ccb36e9a39d9d2f2e90ab7d0550a0a51d6b31cf6030d WHIRLPOOL 3a220b2310540c4d8558f48b1645ec01e3062670a1e1bc095ae0c9ef43de121c370cb1e96fecd8c73ca1480c4a32da62ff70ea81366738f5f7509b48f1d1c04c
AUX raspberrypi-mkimage-0_p20120201-boot-uncompressed.txt 201 SHA256 4af6e284f892cdf6960874cc176d8a16ee2d812ebffb1aa46ebf1b6927a20ce7 SHA512 cc0ce918e1533222be481aade51fd7ec2ba6b41a23470517efb1260d790ff958c8f4c6232e632faf8be4664a264d12034c4f01a67ef29d9124cafd4f58d94ebd WHIRLPOOL 4511e32ff969c36c7111678e0ac260ef9e132631cd2fe6cf5bfdf0e2f5826d2018e310025561c78a2731804f019726659e80b65ca425c57e77e7b39b9d8fa8d8
AUX raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch 236 SHA256 7ed22ff112551aff0d37f82d16fc6a5f70fcf45474926d672da532a46540d112 SHA512 a1f732eb4ffd80f432721a018bf0644611deb7da9c71571688da3ae3ba278454864227b0de9088af72d214e7034a2e5ddf50601a42a3b1e4a86b93a8afdf0dc4 WHIRLPOOL ab22d36d5e23fbfe132eb166dbca78a94b55f77af03089ac652bb800169c268dab4f72182bd723992e8e69c696de2969768087ee29de6f61916e2c15646f9ccb
AUX raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch 1561 SHA256 74fe57c8b5ea3c004cc35b5c8eac821eb06dda3596db66c0017a957d7e02e2af SHA512 22afaa909a6aa3340ab49f68e43e16f279369df272fe2a61f68ca58529e8166fec34518da0ca626392d8df143a49db1a7f819e0e577c8ddafd685caeed04950e WHIRLPOOL 6c92fb23e8f75cb32c37513253e5b5ecab241b82b1b50756d32b6b5be33752345124afb2567035b8a4e2931314404a5fc565b8bcfad6d5d2fc22a10b16c9e2cd
AUX raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py 822 SHA256 08979410301ea3737a4cf8b49e7440daf4ef3583941fcd5a0df0aa37da3db8d2 SHA512 00a3e1936b44e7a3c73b3ca0fc9597016a31dce869da04101785c1e5fd0987747a828092335402820cba96caae1c9d463a9bba6a5ec1e4ccc89bb6a31f025c5c WHIRLPOOL 1ae637d1f35bec54ee95f4b05c0a3e7d77dd50b9f9c540fb15bc206f0cd86c54fde85c7a9f0b08305f4d2d5fcb775c948c3e35eddbffbfc42809e52de5897662
-EBUILD raspberrypi-mkimage-0_p20120201.ebuild 1241 SHA256 1ab7b669250c373a2a583c4f77e505333e6aece68fb32959cc1c27dc0d0abf3a SHA512 dac0d72f609c95b1622e014a844728817384c4748f38480ab772e9d11a61a2a9818365f64be30e45a3e8e95e81e61b3d88c744b3edf4a6dabd4c396ebdeb2c3d WHIRLPOOL 2c806cdbf596ae946adcbcac37757baf7fcbce246503320f370cd7467dea07c90cfe26a90b236913a8c87fea5d3aa2aeb70acbbc6d445e213f83d1a156c7630d
+EBUILD raspberrypi-mkimage-0_p20120201.ebuild 1367 SHA256 72feaf5398714b6e4fd5409f5d5b8bfadf6f5ede35a1bac25351710604eb1386 SHA512 d50643110217159526d085f2806a2044f8d5095270d14a35c7e44909045cc836a918051d2168e2fda6039b6f5f3f6cedb51a4659ce26b1cf3df35cec7f53c163 WHIRLPOOL 52574b7e34e06fc5c9bac9d754727ff0a99575d52302879cf1d103b621fff85f1262ad167bce6cec73da6c8d5c95e1955294604fcc6b008271857096469fdf34
+MISC ChangeLog 754 SHA256 08d19223f8563337df49c315f115b4207a3ef9cc36690eee41bed07d1e69c0a0 SHA512 a17c7089dbdc92c8311cc36751dd37751ce835f9366ed0c41afd904d1ce598d09860eaba9f80db73f95b929863bfefba053bf2013a49f4c3cb0e33e32366ef63 WHIRLPOOL d0c5b45ce466aabb8a7948914ffa861d7717aa0e0349bfec1e0ea0d7c02597bf1a48c596faed45c35e2f5dbb1bc406f8ea8d8340787e1f7d7c835cfd5385d884
MISC metadata.xml 224 SHA256 f810c6de744adceee241992d3f713142db3e7025986f6cc5898cfe3c9cb2f4a7 SHA512 4f78d959809ec0db2f9be2a7747d572fa8ee03d177044dd46574881a6ee83736510b76062c12daecae609282d197ba466e8a3e3a654b1383e04c659acd41bef5 WHIRLPOOL 0300a228d371c918b051bc24859dfe4e5d0d2a71b80f697f202749c5aca69efcee4be6e69454c9abfa4ced28e19a9d1f71d6d7eaf54290b8d03b5c04fd209868
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.20 (GNU/Linux)
+
+iF4EAREIAAYFAlHpTQ8ACgkQknrdDGLu8JDlxgD9HgfpbKgRRtMx8Knv4SX0+Gt7
+iLgoEBJt1PhFY9BUcQoBAJCqVZnZh500wHOXeDZyaoTQfygHe8GFP73c8Cpqp2RT
+=7tSk
+-----END PGP SIGNATURE-----
diff --git a/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-args-uncompressed.txt b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-args-uncompressed.txt
new file mode 100644
index 000000000000..09398b47eee8
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-args-uncompressed.txt
@@ -0,0 +1,12 @@
+; kernel args (place at 0x00000100)
+0x00000005
+0x54410001
+0x00000001
+0x00001000
+0x00000000
+0x00000004
+0x54410002
+0x08000000
+0x00000000
+0x00000000
+0x00000000
diff --git a/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-boot-uncompressed.txt b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-boot-uncompressed.txt
new file mode 100644
index 000000000000..1cf5888278af
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-boot-uncompressed.txt
@@ -0,0 +1,17 @@
+; bootloader (place at 0x00000000)
+0xea000006
+0xe1a00000
+0xe1a00000
+0xe1a00000
+0xe1a00000
+0xe1a00000
+0xe1a00000
+0xe1a00000
+
+0xe3a00000
+0xe3a01042
+0xe3811c0c
+0xe59f2000
+0xe59ff000
+0x00000100
+0x00008000
diff --git a/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch
new file mode 100644
index 000000000000..f9d0c00602c8
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch
@@ -0,0 +1,11 @@
+--- mkimage/imagetool-uncompressed.py
++++ mkimage/imagetool-uncompressed.py
+@@ -46,7 +47,7 @@
+ f = open(args.bootimage, "wb")
+
+ for m in mem:
+- f.write(chr(m))
++ f.write(chr(m).encode('latin1'))
+
+ f.write(kernel_image)
+ f.close()
diff --git a/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch
new file mode 100644
index 000000000000..6b12c95c0fbe
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch
@@ -0,0 +1,49 @@
+diff -ru raspberrypi-mkimage-0_p20120201.orig/imagetool-uncompressed.py raspberrypi-mkimage-0_p20120201/imagetool-uncompressed.py
+--- raspberrypi-mkimage-0_p20120201.orig/imagetool-uncompressed.py 2013-07-19 15:11:23.373837900 +0200
++++ raspberrypi-mkimage-0_p20120201/imagetool-uncompressed.py 2013-07-19 15:31:56.495421758 +0200
+@@ -3,15 +3,23 @@
+ import os
+ import re
+ import sys
++import argparse
+
+-try:
+- kernel_image = sys.argv[1]
+-except:
+- kernel_image = ""
+-
+-if kernel_image == "":
+- print("usage : imagetool-uncompressed.py <kernel image>");
+- sys.exit(0)
++parser = argparse.ArgumentParser(description='Prepare kernel files for Raspberry Pi bootloader')
++parser.add_argument('--force', '-f', action='store_true', default=False,
++ help='overwrite target file')
++parser.add_argument('kernel',
++ help='kernel file from /usr/src/linux*/arch/arm/boot/Image')
++parser.add_argument('bootimage',
++ help='file to be placed in /boot/kernel.img')
++args = parser.parse_args()
++if os.path.exists(args.bootimage) and not args.force:
++ print('Target file exists, use --force to override')
++ sys.exit(1)
++
++f = open(args.kernel, 'rb')
++kernel_image = f.read()
++f.close()
+
+ re_line = re.compile(r"0x(?P<value>[0-9a-f]{8})")
+
+@@ -35,11 +43,10 @@
+ load_to_mem("boot-uncompressed.txt", 0x00000000)
+ load_to_mem("args-uncompressed.txt", 0x00000100)
+
+-f = open("first32k.bin", "wb")
++f = open(args.bootimage, "wb")
+
+ for m in mem:
+ f.write(chr(m))
+
++f.write(kernel_image)
+ f.close()
+-
+-os.system("cat first32k.bin " + kernel_image + " > kernel.img")
diff --git a/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py
new file mode 100644
index 000000000000..46ff4fc8ea6b
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python2
+
+import os
+import re
+import sys
+
+try:
+ kernel_image = sys.argv[1]
+except:
+ kernel_image = ""
+
+if kernel_image == "":
+ print("usage : imagetool-uncompressed.py <kernel image>");
+ sys.exit(0)
+
+re_line = re.compile(r"0x(?P<value>[0-9a-f]{8})")
+
+mem = [0 for i in range(32768)]
+
+def load_to_mem(name, addr):
+ f = open(name)
+
+ for l in f.readlines():
+ m = re_line.match(l)
+
+ if m:
+ value = int(m.group("value"), 16)
+
+ for i in range(4):
+ mem[addr] = int(value >> i * 8 & 0xff)
+ addr += 1
+
+ f.close()
+
+load_to_mem("boot-uncompressed.txt", 0x00000000)
+load_to_mem("args-uncompressed.txt", 0x00000100)
+
+f = open("first32k.bin", "wb")
+
+for m in mem:
+ f.write(chr(m))
+
+f.close()
+
+os.system("cat first32k.bin " + kernel_image + " > kernel.img")
diff --git a/sys-boot/raspberrypi-mkimage/metadata.xml b/sys-boot/raspberrypi-mkimage/metadata.xml
new file mode 100644
index 000000000000..59acc2cc580e
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/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>
+<email>xmw@gentoo.org</email>
+<name>Michael Weber</name>
+</maintainer>
+</pkgmetadata>
+
diff --git a/sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild b/sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild
new file mode 100644
index 000000000000..8f9850c3c41d
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild,v 1.1 2013/07/19 14:28:35 xmw Exp $
+
+EAPI=5
+PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2,3_3} )
+
+inherit eutils distutils-r1
+
+DESCRIPTION="Raspberry Pi kernel mangling tool mkimage/imagetool-uncompressed.py"
+HOMEPAGE="https://github.com/raspberrypi/tools/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${PYTHON_DEPS}"
+
+src_unpack() {
+ mkdir "${S}" || die
+ cp {"${FILESDIR}"/${P}-,"${S}"/}imagetool-uncompressed.py || die
+}
+
+python_prepare_all() {
+ epatch "${FILESDIR}"/${P}-imagetool-uncompressed.patch
+ sed -e '/^load_to_mem("/s:(":("'${EPREFIX}'/usr/share/'${PN}'/:' \
+ -e '1s:python2:python:' \
+ -i imagetool-uncompressed.py || die
+ python_copy_sources
+}
+
+python_prepare() {
+ cd "${BUILD_DIR}" || die
+ case ${EPYTHON} in
+ python3.1|python3.2|python3.3)
+ epatch "${FILESDIR}"/${P}-imagetool-uncompressed-python3.patch
+ ;;
+ esac
+}
+
+python_compile() { :; }
+
+python_install() {
+ cd "${BUILD_DIR}" || die
+ python_doscript imagetool-uncompressed.py
+}
+
+python_install_all() {
+ insinto /usr/share/${PN}
+ newins {"${FILESDIR}"/${P}-,}args-uncompressed.txt
+ newins {"${FILESDIR}"/${P}-,}boot-uncompressed.txt
+}