From 6374376f7c127f5ad34491dd7da9640a5faa323b Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Mon, 8 Aug 2022 16:04:52 -0700 Subject: [PATCH] add README support for isos --- .../empanadas/templates/ISOREADME.tmpl | 35 +++++++++++++++++++ iso/empanadas/empanadas/util/iso_utils.py | 11 ++++++ 2 files changed, 46 insertions(+) create mode 100644 iso/empanadas/empanadas/templates/ISOREADME.tmpl diff --git a/iso/empanadas/empanadas/templates/ISOREADME.tmpl b/iso/empanadas/empanadas/templates/ISOREADME.tmpl new file mode 100644 index 0000000..f5cafa9 --- /dev/null +++ b/iso/empanadas/empanadas/templates/ISOREADME.tmpl @@ -0,0 +1,35 @@ +This directory contains ISO's for the {{ arch }} architecture. You will see +multiple types of ISO's, including accompanying manifests and CHECKSUM files +that match the given ISO. You will see the following formats: + +* Rocky-X.Y-ARCH-TYPE (ISO File) +* Rocky-X.Y-DATE-ARCH-TYPE (ISO File) +* Rocky-ARCH-TYPE (Symlink) + +X will be the major release. +Y will be the minor release. +ARCH is the given architecture. +DATE will be the date the ISO was built (if applicable) +TYPE will be the type of ISO (boot, dvd, minimal) + +The third format in the list is a symlink to the "latest" ISO. Currently, this +is not advertised on the main site, but there may be potential for this in +the future. + +This is "unversioned" ISO symlink is for these cases: + +* A pre-determined download location for users/mirrors/service providers who + want an always available and deterministic download location, which can be + easier to script + +* osinfo database / libvirt use where if a user selects Rocky Linux X, it + should be aware of and be able to download from that location. This should + be fully supported in Rocky Linux 8.7 and 9.1, and future Fedora versions. + +If you have any questions, please reach out to us: + +* https://chat.rockylinux.org ~Development, ~Infrastructure, ~General +* https://forums.rockylinux.org +* https://lists.resf.org/mailman3/lists/rocky.lists.resf.org/ - Rocky General Mail List +* https://lists.resf.org/mailman3/lists/rocky-mirror.lists.resf.org/ - Mirror Mail List + diff --git a/iso/empanadas/empanadas/util/iso_utils.py b/iso/empanadas/empanadas/util/iso_utils.py index 1a64238..9d9faa2 100644 --- a/iso/empanadas/empanadas/util/iso_utils.py +++ b/iso/empanadas/empanadas/util/iso_utils.py @@ -782,11 +782,14 @@ class IsoBuild: mock_sh_template = self.tmplenv.get_template('extraisobuild.tmpl.sh') iso_template = self.tmplenv.get_template('buildExtraImage.tmpl.sh') xorriso_template = self.tmplenv.get_template('xorriso.tmpl.txt') + iso_readme_template = self.tmplenv.get_template('ISOREADME.tmpl') mock_iso_path = '/var/tmp/lorax-{}.cfg'.format(self.major_version) mock_sh_path = '{}/extraisobuild-{}-{}.sh'.format(entries_dir, arch, image) iso_template_path = '{}/buildExtraImage-{}-{}.sh'.format(entries_dir, arch, image) xorriso_template_path = '{}/xorriso-{}-{}.txt'.format(entries_dir, arch, image) + iso_readme_path = '{}/{}/README'.format(self.iso_work_dir, arch) + print(iso_readme_path) log_root = os.path.join( work_root, @@ -917,6 +920,10 @@ class IsoBuild: generic_isoname=generic_isoname, ) + iso_readme_template_output = iso_readme_template.render( + arch=arch + ) + mock_iso_entry = open(mock_iso_path, "w+") mock_iso_entry.write(mock_iso_template_output) mock_iso_entry.close() @@ -929,6 +936,10 @@ class IsoBuild: iso_template_entry.write(iso_template_output) iso_template_entry.close() + iso_readme_entry = open(iso_readme_path, "w+") + iso_readme_entry.write(iso_readme_template_output) + iso_readme_entry.close() + os.chmod(mock_sh_path, 0o755) os.chmod(iso_template_path, 0o755)