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

oem+drivers: fix wrong order or lower layers when building overlays #1780

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

ogayot
Copy link
Member

@ogayot ogayot commented Aug 31, 2023

When doing an offline install, ubuntu-drivers would sometimes list a package that is available in the archive but not present in the pool. This would lead to a failed install when trying to download/install such package.

This is not something we would expect since we run apt-get update (with only the pool configured when offline) in the install tree.

However, it turned out that we create the overlay with the lower layers specified in the wrong order - which essentially makes APT indexes visible in the source tree also visible in the OEM/third-party driver overlay.

When calling setup_overlay(lowers=[a, b, c]), Subiquity invokes mount with lowerdir=c:b:a (in the reverse order).

This means that c is top, b is middle and a is bottom.

For the OEM and third-party drivers, we build overlays that are based on:

  • the source tree
  • the configured tree
  • the install tree

Unfortunately, we were doing the opposite. Fixed by reversing the order of the lower layers.

When doing an offline install, ubuntu-drivers would sometimes list a
package that is available in the archive but not present in the pool.

This is not something we would expect since we run apt-get update (with
only the pool configured when offline) in the install tree.

However, it turned out that we create the overlay with the lower layers
specified in the wrong order - which essentially makes APT indexes
visible in the source tree also visible in the OEM/third-party driver
overlay.

When calling setup_overlay(lowers=[a, b, c]), Subiquity invokes mount
with lowerdir=c:b:a (in the reverse order).

This means that c is top, b is middle and a is bottom.

For the OEM and third-party drivers, we build overlays that are based
on:

 * the source tree
 * the configured tree
 * the install tree

Unfortunately, we were doing the opposite. Fixed by reversing the order of
the lower layers.

Signed-off-by: Olivier Gayot <[email protected]>
@ogayot
Copy link
Member Author

ogayot commented Aug 31, 2023

With this patch, I am able to make an offline install on certified hardware when the OEM meta-packages are not in the pool. Essentially, it treats the hardware as if it weren't certified.

Online installs still behave as expected (the OEM meta-package + kernel gets installed).

@ogayot ogayot marked this pull request as ready for review August 31, 2023 15:20
Copy link
Collaborator

@mwhudson mwhudson left a comment

Choose a reason for hiding this comment

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

Your logic seems sound and the change correct. The question I have is how on earth did we get away with this for so long???

Copy link
Collaborator

@dbungert dbungert left a comment

Choose a reason for hiding this comment

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

Fine to take the fix, but I think we soon want to have setup_overlay() take the list of lowers in the same order that the mount option expects. That reversed order detail would be quite the surprise to someone who hadn't read this comment yet.

@ogayot
Copy link
Member Author

ogayot commented Sep 1, 2023

The question I have is how on earth did we get away with this for so long???

Yeah that's difficult to imagine :D I guess nobody ever tested an offline install with an nvidia chip + "Search drivers [x]" selected? I can't test that scenario myself but I expect it would have failed too..

I think we soon want to have setup_overlay() take the list of lowers in the same order that the mount option expects. That reversed order detail would be quite the surprise to someone who hadn't read this comment yet.

Yes, I would not mind removing the reversed logic either. I agree that mount stacking lower layers from right to left can look strange though.

@ogayot ogayot merged commit e363ef5 into canonical:main Sep 1, 2023
10 checks passed
@ogayot ogayot deleted the oem-update-index branch September 1, 2023 07:20
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.

3 participants