Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't rely on /etc/install.inf being available [15-SP4] #613

Merged
merged 2 commits into from
Apr 27, 2022

Conversation

shundhammer
Copy link
Contributor

@shundhammer shundhammer commented Apr 26, 2022

Target Branch / Product

This is for SLE-15-SP4. A port to master will follow.

Bugzilla

https://bugzilla.suse.com/show_bug.cgi?id=1198560

Trello

https://trello.com/c/AXWDv2jh/

Problem

When migrating from Leap 15.4 to SLE-15 SP4 on the installed system, YaST crashes with an exception "The installation URL is not set" in https://github.com/yast/yast-packager/blob/master/src/lib/y2packager/installation_medium.rb#L48-L50 .

Cause

It tried to read /etc/install.inf (the config file that linuxrc writes for YaST to consume) to check if the installation media has several products or just one. But in this scenario, the migration started from the installed system, not from an inst-sys on installation media; so there was no /etc/install.inf.

Fix

Check if there is an install.inf; more precisely, if any data from that could be read, i.e. if there was any content at all from such a file.

If there is none, read the products from libzypp: In this scenario, the old repos from the system that we want to migrate away from were just removed, and the ones from the new one (that we want to migrate to) were added. Those repos are what we need here.

Notice that in this scenario it does not make sense to read a repo URL from a control.xml file: While there is one in /etc/YaST2/control.xml, that is not the default path on installation media, so it won't be found; and, worse, that file contains the URL of the old repo, the system that we are migrating away from.

Related PR

PR for master: #615

@shundhammer shundhammer changed the title Don't Rely on /etc/install.inf being Available Don't Rely on /etc/install.inf being Available [15-SP4] Apr 26, 2022
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 36.827% when pulling 040d66f on huha-install-inf-sp4 into fb65bf8 on master.

@shundhammer shundhammer changed the base branch from master to SLE-15-SP4 April 26, 2022 13:28
Copy link
Member

@lslezak lslezak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shundhammer shundhammer merged commit 7d0088e into SLE-15-SP4 Apr 27, 2022
@shundhammer shundhammer deleted the huha-install-inf-sp4 branch April 27, 2022 13:36
@yast-bot
Copy link
Contributor

✔️ Internal Jenkins job #6 successfully finished
✔️ Created IBS submit request #270980

@shundhammer shundhammer changed the title Don't Rely on /etc/install.inf being Available [15-SP4] Don't rely on /etc/install.inf being available [15-SP4] Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants