Update AlmaLinux patch

This commit is contained in:
eabdullin 2023-05-12 15:54:05 +03:00
parent fd415762cc
commit 3717cd4682
1 changed files with 16 additions and 53 deletions

View File

@ -1,6 +1,6 @@
From 83bbecc74f3d31218ee0127c25c81fd20571d76f Mon Sep 17 00:00:00 2001
From 93aff1ae285938ed98d77bb8dfadbbc6f5d94dff Mon Sep 17 00:00:00 2001
From: Elkhan Mammadli <elkhan.mammadli@protonmail.com>
Date: Thu, 23 Feb 2023 16:53:38 +0400
Date: Tue, 21 Feb 2023 15:20:57 +0400
Subject: [PATCH] Fix and Improve AlmaLinux support
Add a new patch to fix some module errors and improve AlmaLinux support
@ -81,7 +81,7 @@ index 25bba76..a0c29c4 100644
"chrony": {
"confpath": "/etc/chrony/chrony.conf",
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
index 38a90b7..19b9cf1 100644
index 71672e1..e8224f8 100644
--- a/cloudinit/settings.py
+++ b/cloudinit/settings.py
@@ -58,7 +58,7 @@ CFG_BUILTIN = {
@ -107,54 +107,17 @@ index 14ac77e..7cd14a1 100644
for item in items:
try:
diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl
index 80ab4f9..ce63c1b 100644
--- a/config/cloud.cfg.tmpl
+++ b/config/cloud.cfg.tmpl
@@ -34,7 +34,7 @@ disable_root: true
{% if variant in ["almalinux", "alpine", "amazon", "centos", "cloudlinux", "eurolinux",
"fedora", "miraclelinux", "openEuler", "rhel", "rocky", "virtuozzo"] %}
-{% if variant == "rhel" %}
+{% if variant in ["almalinux", "rhel"] %}
mount_default_fields: [~, ~, 'auto', 'defaults,nofail,x-systemd.requires=cloud-init.service,_netdev', '0', '2']
{% else %}
mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2']
@@ -70,7 +70,7 @@ network:
config: disabled
{% endif %}
-{% if variant == "rhel" %}
+{% if variant in ["almalinux", "rhel"] %}
# Default redhat settings:
ssh_deletekeys: true
ssh_genkeytypes: ['rsa', 'ecdsa', 'ed25519']
@@ -119,7 +119,7 @@ cloud_config_modules:
{% endif %}
{% if variant not in ["photon"] %}
- ssh-import-id
-{% if variant not in ["rhel"] %}
+{% if variant not in ["almalinux", "rhel"] %}
- keyboard
{% endif %}
- locale
@@ -128,7 +128,7 @@ cloud_config_modules:
{% if variant in ["rhel"] %}
- rh_subscription
{% endif %}
-{% if variant in ["rhel", "fedora", "photon"] %}
+{% if variant in ["almalinux", "rhel", "fedora", "photon"] %}
{% if variant not in ["photon"] %}
- spacewalk
{% endif %}
@@ -275,7 +275,7 @@ system_info:
groups: [adm, sudo]
{% elif variant == "arch" %}
groups: [wheel, users]
-{% elif variant == "rhel" %}
+{% elif variant in ["almalinux", "rhel"] %}
groups: [adm, systemd-journal]
{% else %}
groups: [wheel, adm, systemd-journal]
@@ -2,7 +2,7 @@
# The top level settings are used as module
# and system configuration.
{% set is_bsd = variant in ["dragonfly", "freebsd", "netbsd", "openbsd"] %}
-{% set is_rhel = variant in ["rhel", "centos"] %}
+{% set is_rhel = variant in ["rhel", "centos", "almalinux"] %}
{% if is_bsd %}
syslog_fix_perms: root:wheel
{% elif variant in ["suse"] %}
diff --git a/packages/pkg-deps.json b/packages/pkg-deps.json
index eaf1346..0aa70f6 100644
--- a/packages/pkg-deps.json
@ -263,7 +226,7 @@ index a6b8265..29ac717 100644
ExecStartPre=/sbin/restorecon /run/cloud-init
ExecStartPre=/usr/bin/touch /run/cloud-init/enabled
diff --git a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl
index c170aef..08da708 100644
index fc984d5..92dd985 100644
--- a/systemd/cloud-init.service.tmpl
+++ b/systemd/cloud-init.service.tmpl
@@ -1,7 +1,7 @@
@ -275,7 +238,7 @@ index c170aef..08da708 100644
DefaultDependencies=no
{% endif %}
Wants=cloud-init-local.service
@@ -36,7 +36,7 @@ Before=shutdown.target
@@ -37,7 +37,7 @@ Before=shutdown.target
Conflicts=shutdown.target
{% endif %}
Before=systemd-user-sessions.service
@ -435,14 +398,14 @@ index 9f95d44..f1844e9 100644
"debian": "ubuntu",
"rhel": "cloud-user",
diff --git a/tools/read-dependencies b/tools/read-dependencies
index efa5879..2699ddd 100755
index efa5879..7888c8f 100755
--- a/tools/read-dependencies
+++ b/tools/read-dependencies
@@ -22,6 +22,7 @@ DEFAULT_REQUIREMENTS = 'requirements.txt'
# Map the appropriate package dir needed for each distro choice
DISTRO_PKG_TYPE_MAP = {
+ 'almalinux': 'almalinux',
+ 'almalinux': 'redhat',
'centos': 'redhat',
'eurolinux': 'redhat',
'miraclelinux': 'redhat',