public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Adam Williamson <awilliam@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/lorax] f45: Backport PR #1525 to adjust to relocation of packaged repo configs
Date: Wed, 12 Aug 2026 17:17:46 GMT	[thread overview]
Message-ID: <178655506628.1.8742293652674706079.rpms-lorax-42808f096e87@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/lorax
Branch : f45
Commit : 42808f096e8790d537378481e397f44178c456c3
Author : Adam Williamson <awilliam@redhat.com>
Date   : 2026-08-12T10:17:20-07:00
Stats  : +141/-2 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/lorax/c/42808f096e8790d537378481e397f44178c456c3?branch=f45

Log:
Backport PR #1525 to adjust to relocation of packaged repo configs

---
diff --git a/0001-Handle-relocation-of-packaged-repo-configs-to-usr-sh.patch b/0001-Handle-relocation-of-packaged-repo-configs-to-usr-sh.patch
new file mode 100644
index 0000000..4d83643
--- /dev/null
+++ b/0001-Handle-relocation-of-packaged-repo-configs-to-usr-sh.patch
@@ -0,0 +1,131 @@
+From 5c1a038300b12dcb890d5d0412cf46252c9ebd13 Mon Sep 17 00:00:00 2001
+From: Adam Williamson <awilliam@redhat.com>
+Date: Wed, 12 Aug 2026 09:46:50 -0700
+Subject: [PATCH] Handle relocation of packaged repo configs to /usr/share/dnf5
+
+In Fedora 45+, packaged repo configs are moved to /usr/share/dnf5:
+https://fedoraproject.org/wiki/Changes/RelocateRpmRepoConfigsToUsr
+This adjusts lorax appropriately. We drop the renaming of the
+repo directory entirely because it is no longer needed. It was
+originally introduced in
+https://github.com/rhinstaller/anaconda/commit/c51389518415d9182f01757314c7cfa272534557
+to solve a problem involving upgrades. anaconda has not handled
+upgrades since 2012. anaconda will be updated to not expect this
+rename any more.
+
+Signed-off-by: Adam Williamson <awilliam@redhat.com>
+---
+ Makefile                                              | 8 +-------
+ share/templates.d/99-generic/runtime-postinstall.tmpl | 3 ---
+ test/README.md                                        | 8 --------
+ test/vm.install                                       | 8 ++++----
+ tests/lorax/test_build_bootiso.sh                     | 6 ++++--
+ 5 files changed, 9 insertions(+), 24 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index c7abbb5f..c114b6c8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,10 +23,6 @@ endif
+ export TEST_OS
+ VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
+ 
+-ifeq ($(REPOS_DIR),)
+-REPOS_DIR = /etc/yum.repos.d
+-endif
+-
+ default: all
+ 
+ src/pylorax/version.py: lorax.spec
+@@ -174,9 +170,7 @@ $(VM_IMAGE): srpm bots
+ vm: $(VM_IMAGE)
+ 	echo $(VM_IMAGE)
+ 
+-# grab all repositories from the host system, overwriting what's inside the VM
+-# and update the image. Mostly used when testing downstream snapshots to make
+-# sure VM_IMAGE is as close as possible to the host!
++# legacy compatibility, used to do different stuff with repos
+ vm-local-repos: vm
+ 
+ vm-reset:
+diff --git a/share/templates.d/99-generic/runtime-postinstall.tmpl b/share/templates.d/99-generic/runtime-postinstall.tmpl
+index 142b05a6..f2f2f0ad 100644
+--- a/share/templates.d/99-generic/runtime-postinstall.tmpl
++++ b/share/templates.d/99-generic/runtime-postinstall.tmpl
+@@ -11,9 +11,6 @@ SOURCE_DATE_EPOCH = os.environ.get('SOURCE_DATE_EPOCH', str(int(time.time())))
+ ## move_stubs()
+ move usr/share/anaconda/list-harddrives-stub usr/bin/list-harddrives
+ 
+-## move_repos()
+-move etc/yum.repos.d etc/anaconda.repos.d
+-
+ ## Setup mdadm config to turn off homehost
+ remove etc/mdadm.conf
+ append etc/mdadm.conf "HOMEHOST <ignore>\n"
+diff --git a/test/README.md b/test/README.md
+index 716be465..16377af5 100644
+--- a/test/README.md
++++ b/test/README.md
+@@ -41,14 +41,6 @@ To delete the generated image, run
+ Base images are stored in `bots/images`. Set `TEST_DATA` to override this
+ directory.
+ 
+-To configure the image with all repositories found on the host system use
+-
+-    $ make vm-local-repos
+-
+-You may also define `REPOS_DIR` variable to point to another directory
+-containing yum .repo files. By default the value is `/etc/yum.repos.d`!
+-This is mostly useful when running tests by hand on a downstream snapshot!
+-
+ ## Running tests
+ 
+ After building a test image, run
+diff --git a/test/vm.install b/test/vm.install
+index c1721130..437206e0 100644
+--- a/test/vm.install
++++ b/test/vm.install
+@@ -22,13 +22,13 @@ if ! rpm -q beakerlib; then
+ fi
+ 
+ # disable mirrors & re-enable direct download
+-sed -i "s/metalink.*//" /etc/yum.repos.d/*.repo
+-sed -i "s/#\(baseurl=.*\)/\1/" /etc/yum.repos.d/*.repo
+-sed -i "s/download.fedoraproject/dl.fedoraproject/" /etc/yum.repos.d/*.repo
++sed -i "s/metalink.*//" /etc/yum.repos.d/*.repo /usr/share/dnf5/repos.d/*.repo
++sed -i "s/#\(baseurl=.*\)/\1/" /etc/yum.repos.d/*.repo /usr/share/dnf5/repos.d/*.repo
++sed -i "s/download.fedoraproject/dl.fedoraproject/" /etc/yum.repos.d/*.repo /usr/share/dnf5/repos.d/*.repo
+ 
+ # HACK: Fedora ships baseurl with `example.com` as domain
+ # Example: `#baseurl=http://download.example/pub/fedora/linux/updates/$releasever/Everything/$basearch/`
+-sed -i "s/download.example/dl.fedoraproject.org/" /etc/yum.repos.d/*.repo
++sed -i "s/download.example/dl.fedoraproject.org/" /etc/yum.repos.d/*.repo /usr/share/dnf5/repos.d/*.repo
+ 
+ # Grow root partition on LVM test images to make room for built images
+ PVS=$(pvs --noheadings -opv_name)
+diff --git a/tests/lorax/test_build_bootiso.sh b/tests/lorax/test_build_bootiso.sh
+index dc1e008d..fa613ece 100755
+--- a/tests/lorax/test_build_bootiso.sh
++++ b/tests/lorax/test_build_bootiso.sh
+@@ -13,14 +13,16 @@ set -e
+ . "$(dirname $0)/lib/lib.sh"
+ 
+ CLI="${CLI:-./src/bin/lorax}"
++REPODIR="/etc/yum.repos.d"
++test -f /usr/share/dnf5/repos.d/fedora.repo && REPODIR="/usr/share/dnf5/repos.d"
+ 
+ # Make up a name (slightly unsafe), should not exist before running lorax so use -u
+ rlJournalStart
+     rlPhaseStartTest "Build lorax boot.iso"
+         rlAssertEquals "SELinux operates in enforcing mode" "$(getenforce)" "Enforcing"
+         lorax -p Fedora-Lorax-Test -v "$RELEASE" -r "$RELEASE" \
+-              --repo /etc/yum.repos.d/fedora.repo \
+-              --repo /etc/yum.repos.d/fedora-updates.repo \
++              --repo $REPODIR/fedora.repo \
++              --repo $REPODIR/fedora-updates.repo \
+               --sharedir "$SHARE_DIR" /var/tmp/test-results/
+         rlAssertEquals "exit code should be zero" $? 0
+         IMAGE="/var/tmp/test-results/images/boot.iso"
+-- 
+2.55.0
+

diff --git a/lorax.spec b/lorax.spec
index e95c63a..3c50aac 100644
--- a/lorax.spec
+++ b/lorax.spec
@@ -5,7 +5,7 @@
 
 Name:           lorax
 Version:        45.2
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Tool for creating the anaconda install images
 License:        GPL-2.0-or-later
 
@@ -17,6 +17,11 @@ ExcludeArch:    %{ix86}
 Url:            %{forgeurl}
 Source0:        %{forgesource}
 
+# Adjust to
+# https://fedoraproject.org/wiki/Changes/RelocateRpmRepoConfigsToUsr
+# https://github.com/weldr/lorax/pull/1525
+Patch:          0001-Handle-relocation-of-packaged-repo-configs-to-usr-sh.patch
+
 BuildRequires:  python3-devel
 BuildRequires:  python3-pip
 BuildRequires:  python3-setuptools
@@ -143,7 +148,7 @@ Lorax templates for creating the boot.iso and live isos are placed in
 /usr/share/lorax/templates.d/99-generic
 
 %prep
-%forgeautosetup
+%forgeautosetup -p1
 
 %build
 
@@ -187,6 +192,9 @@ make DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} install
 %{_datadir}/lorax/templates.d/*
 
 %changelog
+* Wed Aug 12 2026 Adam Williamson <awilliam@redhat.com> - 45.2-5
+- Backport PR #1525 to adjust to relocation of packaged repo configs
+
 * Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 45.2-4
 - Rebuilt for Python 3.15.0b4 ABI change
 

                 reply	other threads:[~2026-08-12 17:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178655506628.1.8742293652674706079.rpms-lorax-42808f096e87@fedoraproject.org \
    --to=awilliam@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox