-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Red Hat's Atomic OS is a read-only filesystem that uses ostree underneath. Installing packages using dnf does not work. Instead use the native package installer 'rpm-ostree install' if an ostree booted filesystem is detected. Utilize various options -y: always install --apply-live: apply changes now instead of waiting for a reboot --idempotent: do not error if package is already installed --allow-inactive: do not error if package is already committed Split out the '--apply-live' option as that is an install only option and will not work with remove. Also include detection of CentOS Stream and leverage the same plugins. Signed-off-by: Don Zickus <[email protected]>
- Loading branch information
Showing
3 changed files
with
27 additions
and
4 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
. /etc/os-release | ||
|
||
if [ -f "/run/ostree-booted" ];then | ||
# OSTree based filesystems are read-only and install with rpm-ostree | ||
RSTRNT_PKG_CMD=${RSTRNT_PKG_CMD:-rpm-ostree} | ||
RSTRNT_PKG_ARGS=${RSTRNT_PKG_ARGS:--y --idempotent --allow-inactive} | ||
RSTRNT_PKG_INSTALL=${RSTRNT_PKG_INSTALL:-install --apply-live} | ||
elif [ 0"$(echo $VERSION_ID | cut -d'.' -f1)" -ge 8 ]; then | ||
# CentOS 8 and newer use dnf as default | ||
RSTRNT_PKG_CMD=${RSTRNT_PKG_CMD:-dnf} | ||
fi |
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