Rpm-ostree quirks

I learned today you cannot do rpm-ostree install to install a couple of apps followed by sudo rpm-ostree usroverlay --hotfix to add a file in the /var directory, then reboot.
A new deployment will be created and you end up with only the hotfix, not the installed apps in that deployment or the rollback deployment.

I just wanted to share, if you need to perform both actions: first hotfix, then install applications.
Same would apply for remove override; --hotfix first.

Example (after I installed 6 apps via rpm-ostree install, then ran ... --hotfix, then ran remove override). Notice the output at the end does not mention the installed apps:

rpm-ostree usroverlay --hotfix
note: Deploying commit d01f845bea95fb7e215efb02b73e84809d30118b3a32221b626e6f5f57759c71 which contains content in /var/lib that will be ignored.
Copying /etc changes: 24 modified, 0 removed, 70 added
Transaction complete; bootconfig swap: yes; bootversion: boot.0.1, deployment count change: 0
Freed objects: 2.5?GB
Hotfix mode enabled.  A writable overlayfs is now mounted on /usr
for this booted deployment.  A non-hotfixed clone has been created
as the non-default rollback target.

Check with:

rpm-ostree status
State: idle
Deployments:
● fedora:fedora/38/x86_64/silverblue
                  Version: 38.20231010.0 (2023-10-10T00:50:07Z)
               BaseCommit: 387ed5053178e5957d2ef8cc10c6fa8e75cf0381e547724b31ee8a765fdf66d9
             GPGSignature: Valid signature by 6A51BBABBA3D5467B6171221809A8D7CEB10B464
          LayeredPackages: langpacks-en_GB
                 Unlocked: hotfix

  fedora:fedora/38/x86_64/silverblue
                  Version: 38.20231010.0 (2023-10-10T00:50:07Z)
               BaseCommit: 387ed5053178e5957d2ef8cc10c6fa8e75cf0381e547724b31ee8a765fdf66d9
             GPGSignature: Valid signature by 6A51BBABBA3D5467B6171221809A8D7CEB10B464
          LayeredPackages: langpacks-en_GB
[asterix@fedora Downloads]$ rpm-ostree override remove firefox-langpacks firefox
Checking out tree 387ed50... done
Resolving dependencies... done
Applying 2 overrides and 3 overlays
Processing packages... done
Running pre scripts... done
Running post scripts... done
Running posttrans scripts... done
Writing rpmdb... done
Writing OSTree commit... done
Staging deployment... done
Freed: 379.8 MB (pkgcache branches: 148)
Removed:
  firefox-118.0.1-7.fc38.x86_64
  firefox-langpacks-118.0.1-7.fc38.x86_64
Use "rpm-ostree override reset" to undo overrides
Run "systemctl reboot" to start a reboot

It’s because you layered apps and did not reboot before going into “hotfix mode”.

In general, you should not be using hotfix anymore. Either the changes are temporary until the next boot and usroverlay will do or you want something permanent and you should either overlay an RPM or create a derived image.

Note that /var is always writable so you don’t need to involve rpm-ostree at all to change things in /var.

That’s good info to know.

And you don’t need to remove Firefox from the image, you can hide it if you don’t use it: Tips and Tricks :: Fedora Docs

I know I did not reboot after hotfix, simply because I use a post-install script, so I cannot reboot in between.

But hotfix is the only way to apply Firefox default preferences globally. Also see here and the link to Mozilla documentation: Apply custom global gnome and firefox configuration - /etc and /usr/lib64 folders in Silverblue
You need to write to /usr/lib64/firefox/ which is a read-only file system.
The file I create should be persistent using --hotfix, even after upgrades, if I understood this reply correctly: How to install Gnome Extensions globally and allow automatic updates? - #10 by jakfrost

@siosm I am no expert but the recommendation in other topics here is if you go for Firefox Flathub edition, remove override is the way to go…