diff --git a/0001-support-loongarch-for-lorax.patch b/0001-support-loongarch-for-lorax.patch new file mode 100644 index 0000000000000000000000000000000000000000..f0bc1c0e7708d8ffc324035fce9a0156d3806929 --- /dev/null +++ b/0001-support-loongarch-for-lorax.patch @@ -0,0 +1,50 @@ +From adb3a4a4dcdbcd5965efa662bd9b3c9377b589f4 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Sun, 16 Oct 2022 23:10:03 +0000 +Subject: [PATCH] support loongarch for lorax + +--- + src/pylorax/__init__.py | 7 +++++-- + src/pylorax/treebuilder.py | 1 + + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py +index 8700ff5..e757cad 100644 +--- a/src/pylorax/__init__.py ++++ b/src/pylorax/__init__.py +@@ -64,7 +64,7 @@ DRACUT_DEFAULT = ["--xz", "--install", "/.buildstamp", "--no-early-microcode", " + DEFAULT_PLATFORM_ID = "platform:f32" + + class ArchData(DataHolder): +- lib64_arches = ("x86_64", "ppc64le", "s390x", "ia64", "aarch64") ++ lib64_arches = ("x86_64", "ppc64le", "s390x", "ia64", "aarch64", "loongarch64") + bcj_arch = dict(i386="x86", x86_64="x86", + ppc64le="powerpc", + arm="arm", armhfp="arm") +@@ -351,7 +351,10 @@ class Lorax(BaseLoraxClass): + for arg in user_dracut_args: + dracut_args += arg.split(" ", 1) + +- anaconda_args = dracut_args + ["--add", "anaconda pollcdrom qemu qemu-net"] ++ if self.arch.basearch == "loongarch64": ++ anaconda_args = dracut_args + ["--add", "anaconda pollcdrom qemu qemu-net"] ++ else: ++ anaconda_args = dracut_args + ["--add", "anaconda pollcdrom qemu qemu-net prefixdevname-tools"] + + logger.info("dracut args = %s", dracut_args) + logger.info("anaconda args = %s", anaconda_args) +diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py +index 2e8d152..039109e 100644 +--- a/src/pylorax/treebuilder.py ++++ b/src/pylorax/treebuilder.py +@@ -42,6 +42,7 @@ templatemap = { + 'aarch64': 'aarch64.tmpl', + 'arm': 'arm.tmpl', + 'armhfp': 'arm.tmpl', ++ 'loongarch64': 'loongarch64.tmpl', + } + + def generate_module_info(moddir, outfile=None): +-- +2.33.0 + diff --git a/lorax.spec b/lorax.spec index 5e32f359300987a1ac8d9f3d44a16debb7419346..8a8bbb84a84033f8abeb516c294f5e4aefd50266 100644 --- a/lorax.spec +++ b/lorax.spec @@ -3,7 +3,7 @@ Name: lorax Version: 33.6 -Release: 6 +Release: 7 Summary: A set of tools used to create bootable images License: GPLv2+ URL: https://github.com/weldr/lorax @@ -25,6 +25,7 @@ Patch12: backport-Improve-lmc-no-virt-error-handling.patch Patch13: backport-Add-POSTIN-scriptlet-error-to-the-log-monitor-list.patch Patch14: backport-Remove-LD_PRELOAD-libgomp.so.1-from-lmc-no-virt.patch Patch15: backport-runtime-install-don-t-install-notification-daemon.patch +Patch100: 0001-support-loongarch-for-lorax.patch BuildRequires: python3-devel python3-sphinx_rtd_theme python3-magic BuildRequires: python3-pytest-mock python3-pocketlint python3-gevent @@ -133,6 +134,10 @@ build images, etc. from the command line. %patch14 -p1 %patch15 -p1 +%ifarch loongarch64 +%patch100 -p1 +%endif + %build %make_build @@ -213,6 +218,11 @@ getent passwd weldr >/dev/null 2>&1 || useradd -r -g weldr -d / -s /sbin/nologin %{_mandir}/man1/*.1* %changelog +* Mon Mar 28 2022 Wenlong Zhang - 33.6-7 +- ID:NA +- SUG:NA +- DESC: add loongarch support for lorax + * Sat Jan 08 2022 xihaochen - 33.6-6 - Type:requriements - Id:NA