Skip to content

Add support for PhotonOS #96

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion files/bash/available_updates_rh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
# Security: kernel-3.14.2-200.fc20.x86_64 is the currently running version
# ---
# We need to filter those out as they screw up the package listing
PKGS=$(yum -q check-update 2>/dev/null | egrep -v "is broken|^Security:|^Loaded plugins" | awk '/^[[:alnum:]]/ {print $0}' | sort)
#
# Also the PhotonOS version of tdnf generates lines by printing spaces, the
# repository, a carriage return, (less) spaces, the version, a carriage return,
# the package name and a line feed. The human output is unchanged but this
# confuse the rest of the tooling, so "fix" the output to have the expected
# format.
PKGS=$(yum -q check-update 2>/dev/null | egrep -v "is broken|^Security:|^Loaded plugins" | awk '{ split($0, r, "\x0d"); res = r[1]; for (f in r) { keep = substr(res, 1 + length(r[f])); res = r[f] keep }; print res }' | grep -e '^[[:alnum:]]' | sort)
cat <<EOF
{
"updates": [
Expand Down
2 changes: 1 addition & 1 deletion tasks/available_updates_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "${PT__installdir}/patching/files/bash/os_test.sh"

case $OS_RELEASE in
################################################################################
RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX)
RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX | PHOTON)
# RedHat variant
source "${PT__installdir}/patching/files/bash/available_updates_rh.sh"
;;
Expand Down
2 changes: 1 addition & 1 deletion tasks/cache_remove_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "${PT__installdir}/patching/files/bash/os_test.sh"

case $OS_RELEASE in
################################################################################
RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX)
RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX | PHOTON)
# RedHat variant
# clean yum cache
OUTPUT=$(yum clean all 2>&1)
Expand Down
2 changes: 1 addition & 1 deletion tasks/cache_update_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source "${PT__installdir}/patching/files/bash/os_test.sh"

case $OS_RELEASE in
################################################################################
RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX)
RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX | PHOTON)
# RedHat variant
# update yum cache
OUTPUT=$(yum clean expire-cache 2>&1)
Expand Down
2 changes: 1 addition & 1 deletion tasks/reboot_required_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export REBOOT_REQUIRED="false"

case $OS_RELEASE in
################################################################################
RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX)
RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX | PHOTON)
# RedHat variant
source "${PT__installdir}/patching/files/bash/reboot_required_rh.sh"
;;
Expand Down
2 changes: 1 addition & 1 deletion tasks/update_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ STATUS=0

case $OS_RELEASE in
################################################################################
RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX)
RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX | PHOTON)
# RedHat variant
source "${PT__installdir}/patching/files/bash/update_rh.sh"
STATUS=$?
Expand Down