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
Automatically sideload from inserted USB drives #3699
Conversation
Marked this as a draft because I'm not sure I got the automake parts right, but it can still be reviewed. |
I guess we will need a configure time option to enable this, since maybe every distribution doesn't want it. |
Shellcheck says (for flatpak-create-sideload-symlinks.sh):
|
|
Fixed this, and also changed it to link to all mounts found regardless of if there's a repo on them, because I think it's confusing to a user if a USB isn't being used because they have to remove and re-insert it. |
Currently we only support links in /var/lib/flatpak/sideload-repos, /run/flatpak/sideload-repos, etc. to be actual ostree repos, but this commit makes it so you can also link to the root directory of a USB, and Flatpak will check the subpaths "ostree/repo", ".ostree/repo", and ".ostree/repos.d" for compatibility with "flatpak create-usb". This will allow the logic in the following commit to be much simpler, where we're linking to hot-plugged drives in a script run by systemd. Note that we still only allow actual repos in the other places where a sideload path can be specified, such as the --sideload-repo CLI option.
1a8fe2e
to
175994d
Compare
Currently with the sideload implementation of offline updates you have to manually create a symlink to your USB drive to sideload from it, which is a regression compared to the previous implementation which scanned all mounted filesystems in OstreeRepoFinderMount in libostree. So this commit adds a few systemd units and a bash script so that any time a USB drive is plugged in and automatically mounted by udisks, a symlink to it is created in /run/flatpak/sideload-repos. When the drive is unplugged the symlink is removed. However this solution still has a lot of moving parts, so we may want to instead have libflatpak use GVolumeMonitor and find the mounted filesystems itself; see flatpak#3705 Fixes flatpak#3490
We only want the run dir to be overridable in unit tests because we depend on it being /run/flatpak in flatpak-create-sideload-symlinks.sh, so don't mention it in the flatpak man page.
175994d
to
a38ed2b
Compare
Fixes #3490