pi-config not working in UC 20

Bug #1909353 reported by Sergey Borovkov
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snapd
Fix Committed
High
Unassigned

Bug Description

When you do `snap system set pi-config.xxx` the change is reported to successfully apply, but config.txt is not actually modified.

https://github.com/snapcore/snapd/blob/30ef6dd52df387d359afdcd15f96210e6e0a1d71/overlord/configstate/configcore/picfg.go#L91

This code seems to be not adjusted to consider the new location and instead still tries to use /boot/uboot/config.txt.

Changed in snapd:
assignee: nobody → Samuele Pedroni (pedronis)
Changed in snapd:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Ian Johnson (anonymouse67) wrote :

Ideally, the bootloader setup on the pi would be such that the boot assets on ubuntu-boot would be what is used verbatim in the boot such that things like the DTB's, the config.txt, etc. that live on ubuntu-boot are read/used by the pi's bootloader during the boot process, however that is not currently the case, we still have the case that all boot assets like this with the exception of one file live on ubuntu-seed, which is not mounted at /boot, and instead is mounted at /var/lib/snapd/seed on UC20 (or alternatively at /run/mnt/ubuntu-seed).

It's unclear what the right thing for us to do in snapd is, whether we should have snapd pick the config.txt file based on which ubuntu core release snapd is running on, or if we should manipulate the mount layout of the system such that the /boot/uboot/config.txt file one sees during run mode is in actuality the /boot/uboot/config.txt that is used during boot. If that's the case, I think it would be misleading if we just bind-mounted /run/mnt/ubuntu-seed/config.txt at /boot/uboot/config.txt for example, as folks might think they can just put other files in /boot/uboot and have them be used by the bootloader when in fact they need to put the other files in /run/mnt/ubuntu-seed. An alternative is that on the pi specifically, /boot/uboot could be a bind-mount of /run/mnt/ubuntu-seed, but this is also confusing to make work, since we do have a single boot asset on ubuntu-boot, and where that file lives would become confusing (but not intractably so), and in addition we would have different mount layout setups for uboot different platforms, whereas today all uboot systems have /boot/uboot as a bind mount to /run/mnt/ubuntu-boot effectively.

IMHO, the easiest way to fix this is to have snapd pick the right file at /run/mnt/ubuntu-seed/config.txt now, and then if we do ever sort out the bootloader situation such that we can place real bootloader assets on ubuntu-boot separate from ubuntu-seed and have them be used, then we can change snapd to detect that new bootloader setup and go back to using /boot/uboot/config.txt directly.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

Another problem here that comes up with the proposed solution above is that if we make snapd modify the config.txt for a run mode system on ubuntu-seed, then booting into a recovery system on ubuntu-seed will use those settings as well, so if a user modifies something in config.txt that is i.e. kernel dependent or otherwise breaks something, they can't go back to recover mode and boot since those settings will still be active.

Changed in snapd:
assignee: Samuele Pedroni (pedronis) → Ian Johnson (anonymouse67)
Revision history for this message
Ian Johnson (anonymouse67) wrote :

First PR opened: https://github.com/snapcore/snapd/pull/9965

The next one after that depends on https://github.com/snapcore/snapd/pull/9914, which itself will require some additional ubuntu-image changes.

Changed in snapd:
status: Triaged → In Progress
Revision history for this message
Ian Johnson (anonymouse67) wrote :

We changed some things, the PR which will fix this is now: https://github.com/snapcore/snapd/pull/10088

Revision history for this message
Ian Johnson (anonymouse67) wrote :

This has slipped slightly to 2.51, but the fix will be available in edge shortly after we branch 2.50 in the next few days.

Changed in snapd:
assignee: Ian Johnson (anonymouse67) → nobody
status: In Progress → New
Changed in snapd:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers