Skip to content

Commit

Permalink
Merge pull request #4438 from lukewarmtemp/4054-more-override-example…
Browse files Browse the repository at this point in the history
…s-in-docs

Added more override examples
  • Loading branch information
HuijingHei authored Jun 7, 2023
2 parents 4d1f758 + cb04754 commit cf41f25
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/administrator-handbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,17 @@ For example, suppose you want to test a fix to `podman`. You can pass
both direct HTTP URLs as well as local files:

```
$ rpm-ostree override replace https://kojipkgs.fedoraproject.org//packages/podman/3.3.1/1.fc34/x86_64/podman-3.3.1-1.fc34.x86_64.rpm
$ sudo rpm-ostree override replace https://kojipkgs.fedoraproject.org//packages/podman/3.3.1/1.fc34/x86_64/podman-3.3.1-1.fc34.x86_64.rpm
```
```
$ curl https://rpmfind.net/linux/fedora/linux/updates/testing/38/Everything/x86_64/Packages/p/podman-4.5.1-1.fc38.x86_64.rpm --output podman.rpm
$ sudo rpm-ostree override replace ./podman.rpm
```

It is also supported to pull from the Fedora Koji/Bodhi systems. The following two examples override `podman` to a previous build listed in [Koji](https://koji.fedoraproject.org/koji/) and [Bodhi](https://bodhi.fedoraproject.org/updates/):
```
$ sudo rpm-ostree override replace https://koji.fedoraproject.org/koji/buildinfo?buildID=2150598
$ sudo rpm-ostree override replace https://bodhi.fedoraproject.org/updates/FEDORA-2023-130f786970
```

Another example with the kernel package; note you need to override exactly the set of installed packages:
Expand Down
65 changes: 65 additions & 0 deletions docs/ex-replace.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,71 @@ Deployments:
...
```

In this second example, we will override the `podman` rpm package with the version of the package used in the Fedora *updates-testing* repository. The repository can be found in `/etc/yum.repos.d/fedora-updates-testing.repo` but is not enabled by default:
```
[updates-testing]
name=Fedora $releasever - $basearch - Test Updates
#baseurl=http://download.example/pub/fedora/linux/updates/testing/$releasever/Everything/$basearch/
metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f$releasever&arch=$basearch
enabled=0
countme=1
repo_gpgcheck=0
type=rpm
gpgcheck=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
[...]
```
To enable the repository, we will use the `sed` command to set the first occurrence of the `enabled` flag to true:
```
$ sudo sed -i '0,/enabled=0/s//enabled=1/' /etc/yum.repos.d/fedora-updates-testing.repo
```

```
$ sudo rpm-ostree override replace podman --experimental --from repo='updates-testing'
Checking out tree e88367e... done
Enabled rpm-md repositories: fedora-cisco-openh264 fedora-modular updates-modular updates fedora updates-repo updates-archive
Importing rpm-md... done
rpm-md repo 'fedora-cisco-openh264' (cached); generated: 2023-03-14T10:56:46Z solvables: 4
rpm-md repo 'fedora-modular' (cached); generated: 2023-04-13T20:30:47Z solvables: 1082
rpm-md repo 'updates-modular' (cached); generated: 2018-02-20T19:18:14Z solvables: 0
rpm-md repo 'updates' (cached); generated: 2023-06-01T03:25:51Z solvables: 13930
rpm-md repo 'fedora' (cached); generated: 2023-04-13T20:37:10Z solvables: 69222
rpm-md repo 'updates-repo' (cached); generated: 2023-06-01T03:05:18Z solvables: 13082
rpm-md repo 'updates-archive' (cached); generated: 2023-06-01T03:49:37Z solvables: 14720
Resolving dependencies... done
Will download: 1 package (15.2 MB)
Downloading from 'updates-repo'... done
Importing packages... done
Applying 1 override
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: 2.1 MB (pkgcache branches: 0)
Upgraded:
podman 5:4.5.0-1.fc38 -> 5:4.5.1-1.fc38
Run "systemctl reboot" to start a reboot
```
Running the `rpm-ostree status` command shows that the `podman` package has undergone a remote override using the updates-repo repository we previously defined.
```
$ rpm-ostree status
State: idle
Deployments:
fedora:fedora/x86_64/coreos/testing-devel
Version: 38.20230601.dev.0 (2023-06-01T18:17:16Z)
BaseCommit: e88367e123c1858979bccb19ead16a3f353cd5fdfcf014218f25a5fd28cab611
GPGSignature: (unsigned)
Diff: 1 upgraded
RemoteOverrides: repo=updates-repo
└─ podman 5:4.5.0-1.fc38 -> 5:4.5.1-1.fc38
```
## Rolling back

You can rollback to the previous deployment:
Expand Down

0 comments on commit cf41f25

Please sign in to comment.