summaryrefslogtreecommitdiff
path: root/sys-boot/raspberrypi-mkimage
diff options
context:
space:
mode:
Diffstat (limited to 'sys-boot/raspberrypi-mkimage')
-rw-r--r--sys-boot/raspberrypi-mkimage/Manifest9
-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.patch48
-rw-r--r--sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py45
-rw-r--r--sys-boot/raspberrypi-mkimage/metadata.xml11
-rw-r--r--sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild56
8 files changed, 209 insertions, 0 deletions
diff --git a/sys-boot/raspberrypi-mkimage/Manifest b/sys-boot/raspberrypi-mkimage/Manifest
new file mode 100644
index 000000000000..1b892ecb7740
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/Manifest
@@ -0,0 +1,9 @@
+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 224 SHA256 8bcd4ed04b536d57ae3acbd24b5d5b6190074bfe12baaaa47c510445dd2b3af9 SHA512 338a39f6050b1f49640aa42b6100bdaea965d44f541d57ea5758efe83f0ba4749b135f20474a14d66ebd8c46a22d4db4ed87bdbd849b04421a067f5376dfa9dd WHIRLPOOL 62fbbf73d068b6f9fcf6d2d22a0793fe23959c393aa839e3ab81b929dc398e3c3f53bf83dc9c91f440b5e3d6b22b6d3923810b8cb08482199301024a0d8d93c1
+AUX raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch 1294 SHA256 b601110d6f83e5cb11b4787b28acb6aeac8a50f35d3e00221c1287c450362048 SHA512 71495224bbe3d5064eda438f2d5534422a5e94be8d0a47a4020feab62a67fdebe6a29ced6b97aea970e505edeebd43a8aa9642198979ad57293b6d6cf4221633 WHIRLPOOL e4d930b90085539a2a9c105e094463fc75db2f05c074be95bc7d79a2aa9a5e33421e47778d50126ef04a83d0cd7eb3fc1c5f644c8eccde2c234d21ad8e5c9f14
+AUX raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.py 822 SHA256 08979410301ea3737a4cf8b49e7440daf4ef3583941fcd5a0df0aa37da3db8d2 SHA512 00a3e1936b44e7a3c73b3ca0fc9597016a31dce869da04101785c1e5fd0987747a828092335402820cba96caae1c9d463a9bba6a5ec1e4ccc89bb6a31f025c5c WHIRLPOOL 1ae637d1f35bec54ee95f4b05c0a3e7d77dd50b9f9c540fb15bc206f0cd86c54fde85c7a9f0b08305f4d2d5fcb775c948c3e35eddbffbfc42809e52de5897662
+EBUILD raspberrypi-mkimage-0_p20120201.ebuild 1194 SHA256 8b17800e0b8af4c480bd209a2645386bb513becb607590e73f6e2fb0aacb7933 SHA512 29018cc42f1d43178adeb2c2030e642f8147da9cc82aafb9327c1d784dd1c3a26849c9cc02e6f33282a18684f896d15a33d53a23b8cee72433bda85fd0f787ed WHIRLPOOL 70f08b1b9f7e423c6b597971683e793d181ae04a87580346af7219c9f14b7b612111d9350ee062fd504f9658a73624c2b46a9fe4eba1ba7155ce19bb4f8879da
+MISC ChangeLog 2718 SHA256 7fc74ba672d97a138394c898edc5a023d04e99f02c79a3dadbc624025c11c942 SHA512 51984e9379d35589214756eb2df7a92090b436010309cd13e595285326eb78c399bc77f26d9f8a003b7bb83493db39c55b015ea95929b7c4908b22664671af55 WHIRLPOOL 1b5e9515b5eca7f1751725edb35d611a5ba275560cad65053cb72267cb9764d881c65f23d7a5ae608b24286fa9b42b2a3aa5ab08bcf160bdcb37c0025fcd8f1f
+MISC ChangeLog-2015 1138 SHA256 1d9aac7da589dd50d27ad27b117cc4ea4136c38435d7a0e33428864233caaed7 SHA512 4484e08339247854ff9e6a59097568ee6667c717285e247871005e82640820c9835a900d1b131f1449e96db0554d6ded1ef8e5aad24110a5ff89296f1aa5619d WHIRLPOOL dc138f992cbd9f0b1386df7f912a1e5f5f1264a6c06b27c88e83b49f31292ed5bb393dde1c2ce8820abaf94ef294274acdfdfe977a605c109ac9befbf5ebb7b3
+MISC metadata.xml 325 SHA256 6bc025a564a2dc54c02499e865bbda2d5c42247b7bbac92582a39ffe21ec42e4 SHA512 0b72cf51be51303a405f2b9caf872966249e1522def22364c4bd49352201de59706a2590fcc508a0e4a0bbe6f2cb4cbcc4bb062c7f5a0c2226c68c8c3d054432 WHIRLPOOL a127361f533a7037e52b1246f66ed4aecd4904634a40a5e2c31af12b19e8ad90863f6d9ed64acfd8133070e669707d38a06f7fa369b0c73b6db30617b64ea65e
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..28b8a6f3170f
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed-python3.patch
@@ -0,0 +1,11 @@
+--- a/imagetool-uncompressed.py
++++ b/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..adba8bbcdbbf
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/files/raspberrypi-mkimage-0_p20120201-imagetool-uncompressed.patch
@@ -0,0 +1,48 @@
+--- a/imagetool-uncompressed.py
++++ b/imagetool-uncompressed.py
+@@ -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..de18e3066ff4
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/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>xmw@gentoo.org</email>
+ <name>Michael Weber</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">raspberrypi/tools</remote-id>
+ </upstream>
+</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..202e65282d26
--- /dev/null
+++ b/sys-boot/raspberrypi-mkimage/raspberrypi-mkimage-0_p20120201.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+DISTUTILS_IN_SOURCE_BUILD=1
+
+inherit 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=""
+
+PATCHES=( "${FILESDIR}"/${P}-imagetool-uncompressed.patch )
+
+src_unpack() {
+ mkdir "${S}" || die
+ cp {"${FILESDIR}"/${P}-,"${S}"/}imagetool-uncompressed.py || die
+}
+
+python_prepare_all() {
+ sed -e '/^load_to_mem("/s:(":("'${EPREFIX}'/usr/share/'${PN}'/:' \
+ -e '1s:python2:python:' \
+ -i imagetool-uncompressed.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_prepare() {
+ if python_is_python3; then
+ eapply "${FILESDIR}"/${P}-imagetool-uncompressed-python3.patch
+ fi
+}
+
+python_compile() { :; }
+
+python_install() {
+ python_doscript imagetool-uncompressed.py
+}
+
+python_install_all() {
+ insinto /usr/share/${PN}
+ newins {"${FILESDIR}"/${P}-,}args-uncompressed.txt
+ newins {"${FILESDIR}"/${P}-,}boot-uncompressed.txt
+
+ distutils-r1_python_install_all
+}