-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: dnf
module
#377
Open
fiftydinar
wants to merge
76
commits into
main
Choose a base branch
from
dnf-module
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: dnf
module
#377
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
fd4ad28
feat: `dnf` module
fiftydinar cd91b05
chore: Add support for native installation of repos
fiftydinar cf3d495
docs: Revise the note about %OS_VERSION% in repos
fiftydinar 2f392e7
fix: missing quote in echo
fiftydinar 6d1047f
fix: Get raw COPR repos array elements without JSON brackets
fiftydinar 9d13c87
chore: Auto-confirm prompts (`-y`) when adding repos
fiftydinar 1396a18
fix: Accidental syntax error for `done`
fiftydinar b898af2
chore: Remove useless echo
fiftydinar 6523979
chore: Install & remove using `dnf` in single operation cases
fiftydinar 97566b8
docs: Add note that URL is not preferred for copr repos
fiftydinar 0bb79d0
fix: `/opt` symlink issue & migrate removal + install to `dnf`
fiftydinar 70c5766
chore: Document code some more
fiftydinar e01ed40
docs: Fix note about using install & remove at the same time
fiftydinar 7d4aff9
chore: Add `dnf` to `modules.json`
fiftydinar a4e9ba4
chore: Add support for replacing packages
fiftydinar 7da24f5
chore: Add option to enable or disable installation of weak dependencies
fiftydinar d495b6a
docs: Style backtick fix
fiftydinar 1137c8b
fix(rpm-ostree): Symlinking `/opt/` multiple times caused an error
fiftydinar eb522e3
chore: Rename `weak-dependencies` to `install-weak-dependencies` & ad…
fiftydinar 57f8b22
chore: Change `copr: user/project` formt to `COPR user/project`
fiftydinar 7a5bcea
fix: Syntax error due to redundant `fi`
fiftydinar c7ae430
fix: Restore logic about not removing any newlines to COPR repos
fiftydinar b1a7c6f
feat: Add removal & installation of RPM groups
fiftydinar b7c0206
docs: Style fix
fiftydinar feb0d71
chore: Make sorting order in typespec better
fiftydinar fba3840
typespec: Minor leftover fix
fiftydinar e27ba39
chore: Fix typespec replace definition
fiftydinar a53dd5b
chore: Add mutter-patched COPR to module.yml
fiftydinar 1a81609
fix: Forgot to replace `rpm-ostree` to `dnf` when checking for local …
fiftydinar a72ae5c
fix: Adding local file repos
fiftydinar 2790123
fix: Replacing packages
fiftydinar ecffeae
chore: Make error message consistent
fiftydinar 84f89d0
chore: Begin implementation of specific flag options for every instal…
fiftydinar 5d7f34b
chore: Simplify printing log message for install packages
fiftydinar 7fc5a24
feat: Add dnf flags to all operations
fiftydinar 63f745b
feat: Add `remove-unused-dependencies` option for package removal
fiftydinar b474a5a
chore: Fix group-remove typespec
fiftydinar 770bb33
chore: Fix group-install typespec
fiftydinar d8a9006
chore: Fix remove typespec
fiftydinar 33065b4
chore: Fix install typespec
fiftydinar 3423190
chore: Remove leftover global `install-weak-dependencies` option
fiftydinar f176120
chore: Remove redundant dnf5 plugin check
fiftydinar 7458b4b
fix: dnf group remove command missed `group` prefix
fiftydinar ce4163c
fix: Don't quote the flags, else dnf will see it as an empty argument…
fiftydinar c8043a4
fix: Don't quote the flags, else dnf will see it as an empty argument…
fiftydinar aa92eff
fix: Don't quote the flags, else dnf will see it as an empty argument…
fiftydinar 8265b85
fix: Don't quote the flags, else dnf will see it as an empty argument…
fiftydinar c9f4fb0
fix: Don't quote the flags, else dnf will see it as an empty argument…
fiftydinar 92df6a0
fix: Don't quote the flags, else dnf will see it as an empty argument…
fiftydinar e66b176
Merge branch 'main' into dnf-module
fiftydinar 4920cc4
chore: Add separate `copr` array
fiftydinar 7612cc2
fix: Assume yes for copr enable
gmpinder 4c17647
Merge branch 'main' into dnf-module
gmpinder f2d6adf
feat: Add optfix systemd service
gmpinder 72bd1db
chore: Update `rpm-ostree` from main
fiftydinar 533bc57
Start work on making this a nushell module
gmpinder e06e9d1
Merge branch 'main' into dnf-module
gmpinder 120285d
docs: create the skeleton for a new readme
xynydev 00d3ee6
Abstract the generation of install args
gmpinder dc051c0
fix: Optfix script dir changes and module.yml docs
gmpinder 0003b97
Merge branch 'main' into dnf-module
gmpinder e86be19
feat: Add nonfree repo additions
gmpinder 360c7e9
fix: Go back to removing repo files and clean up negativo repos befor…
gmpinder a2fd86f
chore: Update README documentation
gmpinder d967c53
Merge branch 'main' into dnf-module
fiftydinar 0e12722
docs: Add known issue about replacing kernel
fiftydinar 286ea43
docs: Reorder repo category according to module order
fiftydinar 919bfac
docs: Merge disabling & enabling repos section
fiftydinar 0d03d7b
chore: Fix grammar in log message about installing `from` repo
fiftydinar 0ac6938
docs: Add example of `old/new` replacement format
fiftydinar 8dd4e31
Merge branch 'main' into dnf-module
fiftydinar 425a55e
docs: Update module.yml to use old and new keys for replace
gmpinder 6557643
docs: Clean up example snippets
gmpinder 42db552
fix: Install dnf5 plugins when necessary if not installed
gmpinder 61c81e0
docs: Create a layout for the features
gmpinder d110cc5
docs: Add more descriptions
gmpinder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
# **`dnf` Module** | ||
|
||
The `dnf` module offers pseudo-declarative package and repository management using [`dnf5`](https://github.com/rpm-software-management/dnf). | ||
|
||
## Features | ||
|
||
This module is capable of: | ||
|
||
- Repository Management | ||
- Adding repo files via url or local files | ||
- Removing repos by specifying the repo name | ||
- Automatically cleaning up any repos added in the module | ||
- Adding keys for repos via url or local files | ||
- Enabling/disabling COPR repos | ||
- Adding non-free repos like `rpmfusion` and `negativo17` | ||
- Package Management | ||
- Installing packages via url, local rpm files, or repo packaging | ||
- Specifying repos from which to install packages | ||
- Removing packages | ||
- Replacing packages with ones from another repo | ||
- Optfix | ||
- Setup symlinks to `/opt/` to allow certain packages to install | ||
|
||
### Add Repository Files | ||
|
||
- Add repos from any `https://` or `http://` URL | ||
- Any `.repo` files located in `./files/dnf/` of your image repo | ||
|
||
```yaml | ||
type: dnf | ||
repos: | ||
files: | ||
- https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo | ||
- custom-file.repo # file path for /files/dnf/custom-file.repo | ||
``` | ||
|
||
### Add COPR Repositories | ||
```yaml | ||
type: dnf | ||
repos: | ||
copr: | ||
- atim/starship | ||
- trixieua/mutter-patched | ||
``` | ||
|
||
### Disable/Enable Repositories | ||
```yaml | ||
type: dnf | ||
repos: | ||
files: | ||
add: | ||
- repo1 | ||
- repo2 | ||
remove: | ||
- repo3 | ||
copr: | ||
enable: | ||
- ryanabx/cosmic-epoch | ||
disable: | ||
- kylegospo/oversteer | ||
``` | ||
|
||
### Add Repository Keys | ||
```yaml | ||
type: dnf | ||
repos: | ||
keys: | ||
- https://example.com/repo-1.asc | ||
- key2.asc | ||
``` | ||
|
||
### Packages | ||
```yaml | ||
type: dnf | ||
install: | ||
packages: | ||
- repo: repo-1 | ||
packages: | ||
- repo-1-package-1 | ||
- repo-1-package-2 | ||
- package-3 | ||
``` | ||
|
||
### Packages from URL or File | ||
```yaml | ||
type: dnf | ||
install: | ||
packages: | ||
- https://example.com/package-%OS_VERSION%.rpm | ||
- custom-file.rpm # file path for /files/dnf/custom-file.rpm | ||
``` | ||
|
||
### Install Packages from Specific Repositories | ||
```yaml | ||
type: dnf | ||
install: | ||
packages: | ||
- repo: copr:copr.fedorainfracloud.org:custom-user:custom-repo | ||
packages: | ||
- package1 | ||
``` | ||
|
||
### Remove Packages | ||
```yaml | ||
type: dnf | ||
remove: | ||
packages: | ||
- package1 | ||
- package-2 | ||
``` | ||
|
||
### Define Packages Groups | ||
```yaml | ||
type: dnf | ||
group-install: | ||
packages: | ||
- de-package-1 | ||
- wm-package-2 | ||
``` | ||
|
||
### Remove Packages Groups | ||
```yaml | ||
type: dnf | ||
group-remove: | ||
packages: | ||
- de-package-2 | ||
``` | ||
|
||
### Replace Packages | ||
```yaml | ||
type: dnf | ||
replace: | ||
- from-repo: copr:copr.fedorainfracloud.org:custom-user:custom-repo | ||
packages: | ||
- package-1 | ||
- from-repo: repo-1 | ||
packages: | ||
- old: old-package-2 | ||
new: new-package-2 | ||
``` | ||
|
||
### Optfix | ||
- Optfix is a script used to work around problems with certain packages that install into `/opt/` | ||
- These issues are caused by Fedora Atomic storing `/opt/` at the location `/var/opt/` by default, while `/var/` is only writeable on a live system | ||
- The script works around these issues by moving the folder to `/usr/lib/opt/` and creating the proper symlinks at runtime | ||
- Specify a list of folders inside `/opt/` | ||
|
||
```yaml | ||
type: dnf | ||
optfix: | ||
- package1 | ||
- package2 | ||
``` | ||
|
||
## Known issues | ||
|
||
Replacing the kernel with `dnf` module is not done cleanly & some remaints of old kernel will be present. | ||
Please use `rpm-ostree` module for this purpose until this `dnf` behavior is fixed. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Create symbolic links for directories in /usr/lib/opt/ to /var/opt/ | ||
After=multi-user.target | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/libexec/bluebuild/optfix.sh | ||
RemainAfterExit=no | ||
|
||
[Install] | ||
WantedBy=default.target |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this fixed already in some images? I think I remember hearing about this.