Skip to content

Commit

Permalink
compose: change opt_usrlocal_overlays to be an enum
Browse files Browse the repository at this point in the history
  • Loading branch information
cgwalters committed Mar 1, 2024
1 parent f5d1f40 commit 3301f8d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ci/prow/fcos-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ ls -al /usr/bin/rpm-ostree
rpm-ostree --version
cd $(mktemp -d)
cosa init https://github.com/coreos/fedora-coreos-config/
# let's turn on opt-usrlocal-overlays in this test since CoreOS CI already
# let's turn on stateoverlays in this test since CoreOS CI already
# covers the off path
echo -e '\nopt-usrlocal-overlays: true\n' >> src/config/manifest.yaml
echo -e '\nopt-usrlocal: "stateoverlay"\n' >> src/config/manifest.yaml
cp /cosa/component-rpms/*.rpm overrides/rpm
# XXX: temporarily import new ostree until it makes it into FCOS
(cd overrides/rpm && curl -L --remote-name-all https://kojipkgs.fedoraproject.org//packages/ostree/2024.2/1.fc39/x86_64/ostree-{,libs-}2024.2-1.fc39.x86_64.rpm)
Expand Down
13 changes: 7 additions & 6 deletions docs/treefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,10 @@ version of `rpm-ostree`.
names to use when substituting variables in yum repo files. The `releasever`
variable name is invalid. Use the `releasever` key instead. The `basearch`
name is invalid; it is filled in automatically.
* `opt-usrlocal-overlays`: boolean, optional: Defaults to `false`. By
default, `/opt` and `/usr/local` are symlinks to subdirectories in `/
var`. This prevents the ability to compose with packages that install in
those directories. If enabled, RPMs with `/opt` and `/usr/local` content
are allowed; client-side, both paths are writable overlay directories on.
Requires libostree v2023.9+.
* `opt-usrlocal`: enum, optional: Defaults to `var`. There are
three possible behaviors:
- `var`: `/opt` and `/usr/local` are symlinks to subdirectories in `/var`
and are purely machine-local state.
- `root`: These are plain directories; only use this with composefs enabled!
- `stateoverlay`: DO NOT USE THIS ONLY FOR TESTS

2 changes: 1 addition & 1 deletion rpmostree-cxxrs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@ struct Treefile final : public ::rust::Opaque
::rpmostreecxx::RepoMetadataTarget get_repo_metadata_target () const noexcept;
bool rpmdb_backend_is_target () const noexcept;
bool should_normalize_rpmdb () const noexcept;
bool get_opt_usrlocal_overlays () const noexcept;
bool get_opt_usrlocal () const noexcept;
::rust::Vec< ::rust::String> get_files_remove_regex (::rust::Str package) const noexcept;
::rust::String get_checksum (::rpmostreecxx::OstreeRepo const &repo) const;
::rust::String get_ostree_ref () const noexcept;
Expand Down
2 changes: 1 addition & 1 deletion tests/compose/test-state-overlays.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ln "$PWD/yumrepo.repo" config/yumrepo.repo
treefile_append "packages" '["test-opt", "test-usr-local"]'

# enable state overlays
treefile_set "opt-usrlocal-overlays" 'True'
treefile_set "opt-usrlocal" 'stateoverlay'

runcompose

Expand Down
2 changes: 1 addition & 1 deletion tests/kolainst/destructive/apply-live
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cd $(mktemp -d)

# apply-live is not yet compatible with state overlays
# https://github.com/coreos/rpm-ostree/pull/4810#issuecomment-1939351259
if jq -e '.["opt-usrlocal-overlays"]' /usr/share/rpm-ostree/treefile.json; then
if test $(jq -r '.["opt-usrlocal"]' /usr/share/rpm-ostree/treefile.json) = "stateoverlay"; then
echo "skip apply-live does not work currently with state overlays"
exit 0
fi
Expand Down
4 changes: 2 additions & 2 deletions tests/kolainst/destructive/state-overlays
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
rpm-ostree override replace https://bodhi.fedoraproject.org/updates/FEDORA-2024-6c7480dd2f
fi

# FCOS doesn't enable opt-usrlocal-overlays yet. It's on in Prow CI though.
# FCOS doesn't enable opt-usrlocal = stateoverlay yet. It's on in Prow CI though.
# Just check the treefile so we do the right thing regardless of CoreOS CI
# or Prow.
if ! jq -e '.["opt-usrlocal-overlays"]' /usr/share/rpm-ostree/treefile.json; then
if test $(jq -r '.["opt-usrlocal"]' /usr/share/rpm-ostree/treefile.json) = null; then
mkdir -p /etc/systemd/system/rpm-ostreed.service.d/
cat > /etc/systemd/system/rpm-ostreed.service.d/state-overlay.conf <<EOF
[Service]
Expand Down

0 comments on commit 3301f8d

Please sign in to comment.