Compare commits

...

No commits in common. 'i9' and 'c9-beta' have entirely different histories.
i9 ... c9-beta

@ -1,34 +0,0 @@
From f04d4c94d77f644d4a9cfe25d708789c4334c25a Mon Sep 17 00:00:00 2001
From: Eugene Zamriy <eugene@zamriy.info>
Date: Thu, 6 Apr 2023 21:16:26 +0300
Subject: [PATCH 1/3] Backport dracut chroot umount fix
---
src/pylorax/imgutils.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/pylorax/imgutils.py b/src/pylorax/imgutils.py
index d713e4c..80e8c2f 100644
--- a/src/pylorax/imgutils.py
+++ b/src/pylorax/imgutils.py
@@ -498,12 +498,14 @@ class DracutChroot(object):
return self
def __exit__(self, exc_type, exc_value, tracebk):
- runcmd(["umount", self.root + "/proc" ])
- runcmd(["umount", self.root + "/dev" ])
+ umount(self.root + '/proc', delete=False)
+ umount(self.root + '/dev', delete=False)
# cleanup bind mounts
for _, d in self.bind:
- runcmd(["umount", self.root + d ])
+ # In case parallel building of two or more images
+ # some mounts in /var/tmp/lorax can be busy at the moment of unmounting
+ umount(self.root + d, maxretry=200, retrysleep=5, delete=False)
def Run(self, args):
runcmd(["dracut"] + args, root=self.root)
--
2.40.1

@ -1,27 +0,0 @@
From 5aed220986528c282c92125fc11e61ee67031555 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
Date: Mon, 9 Dec 2024 13:22:40 +0300
Subject: [PATCH] Our isolinux.cfg is in cp866 encoding
---
src/bin/mkksiso | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bin/mkksiso b/src/bin/mkksiso
index 42cdbfb..c9cfedd 100755
--- a/src/bin/mkksiso
+++ b/src/bin/mkksiso
@@ -294,8 +294,8 @@ def EditIsolinux(rm_args, add_args, new_volid, old_volid, tmpdir):
change_volid = old_volid != new_volid
# Edit the config file, save the new one as .new
- with open(orig_cfg, "r") as in_fp:
- with open(orig_cfg + ".new", "w") as out_fp:
+ with open(orig_cfg, "r", encoding="cp866") as in_fp:
+ with open(orig_cfg + ".new", "w", encoding="cp866") as out_fp:
for line in in_fp:
if change_volid and old_volid in line:
line = line.replace(old_volid, new_volid)
--
2.47.1

@ -1,51 +0,0 @@
From de825e84964d0145c46d77433cb08ee8c4640843 Mon Sep 17 00:00:00 2001
From: Eugene Zamriy <evgeniy.zamriy@softline.com>
Date: Wed, 26 Jul 2023 22:45:32 +0300
Subject: [PATCH 2/3] Fix replace command utf8 handling
This change allows using non-latin UTF-8 symbols in files modified
from Lorax templates using the "replace" command.
Note: fileinput.input doesn't support encoding argument in the
in-place mode, so we replaced it with StringIO.
---
src/pylorax/sysutils.py | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/pylorax/sysutils.py b/src/pylorax/sysutils.py
index 35f8b0f..81dc20a 100644
--- a/src/pylorax/sysutils.py
+++ b/src/pylorax/sysutils.py
@@ -25,7 +25,7 @@ __all__ = ["joinpaths", "touch", "replace", "chown_", "chmod_", "remove",
import sys
import os
import re
-import fileinput
+import io
import pwd
import grp
import glob
@@ -50,14 +50,13 @@ def touch(fname):
def replace(fname, find, sub):
- fin = fileinput.input(fname, inplace=1)
pattern = re.compile(find)
-
- for line in fin:
- line = pattern.sub(sub, line)
- sys.stdout.write(line)
-
- fin.close()
+ with open(fname, "r", encoding="utf-8") as fd:
+ fin = io.StringIO(fd.read())
+ with open(fname, "w", encoding="utf-8") as fd:
+ for line in fin:
+ line = pattern.sub(sub, line)
+ fd.write(line)
def chown_(path, user=None, group=None, recursive=False):
--
2.40.1

@ -1,41 +0,0 @@
From 9b34c5ad852edd1eb68d78363e3be12ac49b44ce Mon Sep 17 00:00:00 2001
From: Eugene Zamriy <evgeniy.zamriy@softline.com>
Date: Wed, 26 Jul 2023 22:55:04 +0300
Subject: [PATCH 3/3] Add iconv template command
Adds the "iconv" template command that converts file(s) from UTF-8
to a specified encoding. This change was required to add Russian
localization to the BIOS mode bootloader.
---
src/pylorax/ltmpl.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/pylorax/ltmpl.py b/src/pylorax/ltmpl.py
index 36e09e9..7c5b56f 100644
--- a/src/pylorax/ltmpl.py
+++ b/src/pylorax/ltmpl.py
@@ -273,6 +273,21 @@ class LoraxTemplateRunner(TemplateRunner):
f.write("\n".join(sorted(debug_pkgs)))
f.write("\n")
+ def iconv(self, encoding, *fileglobs):
+ '''
+ iconv ENCODING [FILEGLOB ...]
+ Convert given files from UTF-8 to a specified encoding.
+
+ Examples:
+ iconv 'cp866' ${BOOTDIR}/isolinux.cfg
+ '''
+ for g in fileglobs:
+ for f in rglob(self._out(g)):
+ with open(f, "r", encoding="utf-8") as fd:
+ content = fd.read()
+ with open(f, "wb") as fd:
+ fd.write(content.encode(encoding))
+
def install(self, srcglob, dest):
'''
install SRC DEST
--
2.40.1

@ -1,28 +0,0 @@
From 850c748ef3d7ad4e4cd36216d797736e450fba08 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
Date: Mon, 12 Aug 2024 12:15:27 +0300
Subject: [PATCH 4/4] Set latarcyrheb-sun16 as default font instead of eurlatgr
---
share/templates.d/99-generic/config_files/common/i18n | 2 +-
share/templates.d/99-generic/config_files/common/vconsole.conf | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/share/templates.d/99-generic/config_files/common/i18n b/share/templates.d/99-generic/config_files/common/i18n
index b254232..7b4682c 100644
--- a/share/templates.d/99-generic/config_files/common/i18n
+++ b/share/templates.d/99-generic/config_files/common/i18n
@@ -1 +1 @@
-SYSFONT="eurlatgr"
+SYSFONT="LatGrkCyr-8x16"
diff --git a/share/templates.d/99-generic/config_files/common/vconsole.conf b/share/templates.d/99-generic/config_files/common/vconsole.conf
index 2bd7892..1456d03 100644
--- a/share/templates.d/99-generic/config_files/common/vconsole.conf
+++ b/share/templates.d/99-generic/config_files/common/vconsole.conf
@@ -1,2 +1,2 @@
KEYMAP=us
-FONT=eurlatgr
+FONT=latarcyrheb-sun16
--
2.46.0

@ -4,7 +4,7 @@
Name: lorax Name: lorax
Version: 34.9.26 Version: 34.9.26
Release: 1%{?dist}.inferit.1 Release: 1%{?dist}
Summary: Tool for creating the anaconda install images Summary: Tool for creating the anaconda install images
License: GPLv2+ License: GPLv2+
@ -15,25 +15,14 @@ URL: https://github.com/weldr/lorax
# tito build --tgz # tito build --tgz
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
# MSVSphere patches
Patch1001: 0001-Backport-dracut-chroot-umount-fix.patch
Patch1002: 0002-Fix-replace-command-utf8-handling.patch
Patch1003: 0003-Add-iconv-template-command.patch
Patch1004: 0004-Set-LatGrkCyr-8x16-as-default-font-instead-of-eurlat.patch
Patch1005: 0001-Our-isolinux.cfg-is-in-cp866-encoding.patch
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: make BuildRequires: make
BuildRequires: systemd-rpm-macros BuildRequires: systemd-rpm-macros
Requires: lorax-templates Requires: lorax-templates
%if 0%{?msvsphere} >= 9
Requires: lorax-templates-msvsphere
%else
%if 0%{?rhel} >= 9 %if 0%{?rhel} >= 9
Requires: lorax-templates-rhel Requires: lorax-templates-rhel
%endif %endif
%endif
Requires: cpio Requires: cpio
Requires: device-mapper Requires: device-mapper
@ -196,12 +185,6 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
%{_datadir}/lorax/templates.d/* %{_datadir}/lorax/templates.d/*
%changelog %changelog
* Mon Dec 09 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 34.9.26-1.inferit.1
- Our isolinux.cfg is in cp866 encoding
* Mon Aug 12 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 34.9.26-1.inferit
- Set latarcyrheb-sun16 as default font instead of eurlatg
* Thu Jul 18 2024 Brian C. Lane <bcl@redhat.com> 34.9.26-1 * Thu Jul 18 2024 Brian C. Lane <bcl@redhat.com> 34.9.26-1
- monitor: Skip repo errors involving CDROM/file source (bcl) (bcl) - monitor: Skip repo errors involving CDROM/file source (bcl) (bcl)
Resolves: RHEL-4658 Resolves: RHEL-4658
@ -212,19 +195,9 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
- templates: Remove libreport bugzilla plugins (bcl) - templates: Remove libreport bugzilla plugins (bcl)
Resolves: RHEL-24420 Resolves: RHEL-24420
* Fri Jan 19 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 34.9.23-1.inferit.2 * Fri Nov 03 2023 Brian C. Lane <bcl@redhat.com> 34.9.24-1
- bump retries count - Add setpriv as ostree containers dependency (jkonecny) (jkonecny)
Resolves: RHEL-15123
* Wed Jul 26 2023 Eugene Zamriy <ezamriy@msvsphere.ru> - 34.9.20-1.inferit.1
- templates: Fixed UTF-8 handling in replace command
- templates: Added iconv command to convert from UTF-8 to another encoding
* Thu Apr 06 2023 Eugene Zamriy <ezamriy@msvsphere.ru> - 34.9.20-1.inferit
- Backported DracutChroot dirs umount patch from upstream
Without that patch pungi fails on building an EL9 image
- lorax-templates-rhel requirement replaced with lorax-templates-msvsphere
- Rebuilt for MSVSphere 9.1
* Wed Jan 11 2023 Brian C. Lane <bcl@redhat.com> 34.9.23-1 * Wed Jan 11 2023 Brian C. Lane <bcl@redhat.com> 34.9.23-1
- rsyslog.conf: Set WorkDirectory to /var/lib/rsyslog (bcl) - rsyslog.conf: Set WorkDirectory to /var/lib/rsyslog (bcl)
Resolves: rhbz#2158731 Resolves: rhbz#2158731

Loading…
Cancel
Save