sys-boot/raspberrypi-mkimage: Remove last-rited pkg

Closes: https://bugs.gentoo.org/718530
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2020-05-23 11:40:27 +02:00
parent bf069f689f
commit e20a0fe53f
8 changed files with 0 additions and 202 deletions

View File

@@ -518,11 +518,6 @@ media-gfx/svg2rlg
# release. Bug 718326. Removal whenever it becomes an issue.
mail-filter/pyzor
# Michał Górny <mgorny@gentoo.org> (2020-04-19)
# Unmaintained. Stuck on Python 3.6.
# Removal in 30 days. Bug #718530.
sys-boot/raspberrypi-mkimage
# Michał Górny <mgorny@gentoo.org> (2020-04-19)
# Unmaintained. Stuck on Python 3.6. Needs version bump.
# Removal in 30 days. Bug #718458.

View File

@@ -1,12 +0,0 @@
; kernel args (place at 0x00000100)
0x00000005
0x54410001
0x00000001
0x00001000
0x00000000
0x00000004
0x54410002
0x08000000
0x00000000
0x00000000
0x00000000

View File

@@ -1,17 +0,0 @@
; bootloader (place at 0x00000000)
0xea000006
0xe1a00000
0xe1a00000
0xe1a00000
0xe1a00000
0xe1a00000
0xe1a00000
0xe1a00000
0xe3a00000
0xe3a01042
0xe3811c0c
0xe59f2000
0xe59ff000
0x00000100
0x00008000

View File

@@ -1,11 +0,0 @@
--- 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()

View File

@@ -1,48 +0,0 @@
--- 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")

View File

@@ -1,45 +0,0 @@
#!/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")

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
<upstream>
<remote-id type="github">raspberrypi/tools</remote-id>
</upstream>
</pkgmetadata>

View File

@@ -1,56 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python3_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
}