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

Poll for RAUC updates and show notifications #19

Merged
merged 26 commits into from May 30, 2023

Conversation

hnez
Copy link
Member

@hnez hnez commented May 9, 2023

This PR adds operating system update handling to the tacd.

What this means from an users point of view:

  1. Periodic polling of the enabled update channels found a new update available for installation:
    upgrade
  2. The user clicks "Install" on on either the web interface, the local display or via a rauc install … call on the commandline:
    installing
  3. Once the installation is complete a note urging the user to reboot is shown:
    reboot

The necessity to display new alerts/notifications on the local screen (Update available, Installing, Please Reboot) kicked up quite some dust in the src/ui/* part of the code, which is why a lot of commits happened there.
With these changes it is now (among other improvements) possible to have multiple active alerts/notifications at the same time and a concept of priorities on which should be shown first between them.

Related Pull Requests

Copy link
Member

@Emantor Emantor left a comment

Choose a reason for hiding this comment

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

Small nit, change at your own opinion.

src/ui/alerts.rs Show resolved Hide resolved
hnez added 21 commits May 30, 2023 07:35
This usecase comes up often enough that it makes sense to add this.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Multiple cases where topic.modify() is used actually only need this instead.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
The draw_fb is a bit hard to grasp on first sight and also implies that we
will keep using the fbdev backend forever (which we hopefully wont).

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
A normal reference is perfectly sufficient.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
We generally want to give exclusive ownership to the display to a single
screen at a time.
This does however collide with the need to have a second reference for
screen capturing.
Solve it with an owned Display type that you however still have to lock
to do actual drawing on it.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
With the renaming of draw_fb to display this feels natural to do.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
It takes a bit of time to start the tacd, get a hostname and start the
screensaver animation.
Fill the time using a splash screen.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Having an unmount(&mut self) method that handles the destruction of a screen
that does not _consume_ the screen (e.g. unmount(self)) is a bit unelegant.

This is the first step towards a design where the exclusive access to
resources like the display can be guaranteed by the type system.

E.g. something like this:

    let screen = ExampleScreen.new();
    let active_screen = screen.activate(display);
    ...
    let display = active_screen.deactivate();

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
This change has to major reasons:

 - The fact that we use RAUC is, at the display level, an implementation
   detail. The name should reflect what it is and not how it is implemented.
 - There will soon be another RAUC screen that notifies about updates,
   making the name ambiguous.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Nearly all screens need to keep track of a list of currently active widgets.
Add a convenience type to do this.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
This way we can use the type system to ensure that only one screen has
access to the display at any point in time and that there are no stray
widget redraws across screen transitions.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Having a task to handle button presses in every screen makes maintainance
hard.
It is also desirable to handle button events the same for all screens
from an UX standpoint.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Alerts are screens that have priority over all normal screens and some of
the other alerts.

This means the display will always show the highest priority alert (if one
is active) or one of the normal screens.

Having `NormalScreen`s and `AlertScreen`s separate also allows us to
centralize the handling of navigation for `NormalScreen`s, as they just
transition to the next screen in the list.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Having the locator in every normal screens code has always been a bit
of clutter.
Having it as an alert screen instead gets rid of that.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Now that we no longer need to reserve space on the display for the locator
animation we can start using it for other things.

Start with drawing the screen border just a tad further.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Some users have complained about long presses being annoying on the TAC.
This is due to them only registering once the user stops pressing the button.

Instead send out a long press event as soon as the button was pressed
long enough.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
On vanilla TACs we are going to have two official update channels
for operating system bundles, Stable and Testing.

In addition to that users may also choose to add their own custom
channels.

Add concept of these channels and a way to poll them to
check if a new update is available.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Display a notification on the screen once an update becomes available.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Previously the web interface could not show any kind of out-of-band
notifications to the user.
Change that.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
The locator feature of the TAC is quite hidden in the web interface.
Make it pop out more by using a notification.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
The fact that updates are implemented using RAUC is only an
implementation detail once the information is in the web interface.
Rename the components to a more generic name.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
hnez added 5 commits May 30, 2023 07:35
Once we add the list of update channels the UpdateContainer component will
be quite large and the actually interesting information -which slot is active-
may flow out of the screen.
Buy some more time until that happens by moving the rootfs slots above the
(less interesting) bootloader slot.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
While that is not quite decided yet, it is likely that we do not want to
enable installing just any bundle via the web interface (as long as the
signature works out) outside of setup_mode.

Remove the feature from the UI for now and instead rely on update
notifications.

Installation of any bundle for which the certificates work out is however
still possible via the API.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
A bundle installation being in progress is a rather important information.
Use a notficication to show it.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
This is intened to nag the user into rebooting after installing
a new bundle.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
This is intended to nag the user into installing updates once they become
available.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
@SmithChart
Copy link
Member

@hnez has rebased the PR on top of current main. This invalidated the review. But the review is still valid -> force-merging.

@SmithChart SmithChart merged commit 88d20f1 into linux-automation:main May 30, 2023
13 checks passed
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

3 participants