[elbe-devel] [PATCH v2 08/13] Debianize - Panel factory
dion at linutronix.de
dion at linutronix.de
Thu Aug 1 17:49:29 CEST 2019
From: Olivier Dion <dion at linutronix.de>
Simply register your panels so that it can automatically be detected.
Signed-off-by: Olivier Dion <dion at linutronix.de>
Reviewed-by: Bastian Germann <bage at linutronix.de>
---
elbepack/debianize/panels/factory.py | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100644 elbepack/debianize/panels/factory.py
diff --git a/elbepack/debianize/panels/factory.py b/elbepack/debianize/panels/factory.py
new file mode 100644
index 00000000..3234046a
--- /dev/null
+++ b/elbepack/debianize/panels/factory.py
@@ -0,0 +1,31 @@
+# ELBE - Debian Based Embedded Rootfilesystem Builder
+# Copyright (c) 2019 Olivier Dion <dion at linutronix.de>
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+
+import os
+
+from elbepack.debianize.panels.uboot import UBoot
+from elbepack.debianize.panels.kernel import Kernel
+from elbepack.debianize.panels.barebox import BareBox
+
+
+panels = [
+ UBoot,
+ Kernel,
+ BareBox
+]
+
+
+def detect_panel():
+ for panel in panels:
+ match = True
+ for f in panel.match_files:
+ if not os.path.exists(f):
+ match = False
+ break
+ if match:
+ return panel()
+
+ raise KeyError
--
2.11.0
More information about the elbe-devel
mailing list