On 04.03.24 08:22, Chris Johns wrote:
diff --git a/spec/build/bsps/powerpc/qoriq/mkimage.yml
b/spec/build/bsps/powerpc/qoriq/mkimage.yml
new file mode 100644
index 0000000000..712fd237b1
--- /dev/null
+++ b/spec/build/bsps/powerpc/qoriq/mkimage.yml
@@ -0,0 +1,39 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+build-type: mkimage
+content: |
+ #!${PYTHON}
+
+ import gzip
+ import os
+ import shutil
+ import subprocess
+ import sys
+ import tempfile
+
+ with tempfile.TemporaryDirectory() as tmp_dir:
+ bin_path = os.path.join(tmp_dir, "bin")
+ gz_path = os.path.join(tmp_dir, "gz")
+ subprocess.run([
+ "${OBJCOPY}",
+ "-O", "binary", sys.argv[1], bin_path
+ ],
+ check=True)
+ with open(bin_path, "rb") as f_bin:
+ with gzip.open(gz_path, "wb") as f_gz:
+ shutil.copyfileobj(f_bin, f_gz)
+ subprocess.run([
+ "${U_BOOT_MKIMAGE}",
+ "-A", "ppc", "-O", "linux", "-T", "kernel", "-a", "0x4000", "-e",
+ "0x4000", "-n", "RTEMS", "-d", gz_path, sys.argv[2]
+ ],
+ check=True)
Sorry this patch is a no from me and adding python like this with such limited
error checking is something I am not comfortable with.
I am OK wih a python module that something robust can import and validate giving
the user consistent and meaningful error messages but as I have just said whole
programs in spec files like this, sorry thet is no from me.
Python exceptions usually give a lot of context, but sure you always can
improve things. If someone doesn't like the error handling in a mkimage
script he can improve it through patches.
The script may have to know details of the BSP configuration, so what
would be your approach to address this? With the script in the build
specification item you can simply use the variable substitution. I don't
think these scripts will be super complex, just a sequence of commands.
--
embedded brains GmbH & Co. KG
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax: +49-89-18 94 741 - 08
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel