Compare commits
No commits in common. "rawhide" and "f39" have entirely different histories.
3 changed files with 2 additions and 151 deletions
|
|
@ -1,54 +0,0 @@
|
|||
From f75434659a731ebdfc259990eb37777700900ea2 Mon Sep 17 00:00:00 2001
|
||||
From: Dominik Wombacher <dominik@wombacher.cc>
|
||||
Date: Thu, 7 Nov 2024 15:27:03 +0000
|
||||
Subject: [PATCH 1/1] fix(rhel): Swapon with maximum priority before
|
||||
hibernation
|
||||
|
||||
Apply swapon high priority related changes from /acpid.sleep.sh to /packaging/rhel/acpid.sleep.sh
|
||||
|
||||
Refs: https://github.com/aws/amazon-ec2-hibinit-agent/commit/a2303d269610a6e7415c5045766da605eaa7e30f
|
||||
---
|
||||
packaging/rhel/acpid.sleep.sh | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/packaging/rhel/acpid.sleep.sh b/packaging/rhel/acpid.sleep.sh
|
||||
index ca3db22..9b381f9 100755
|
||||
--- a/packaging/rhel/acpid.sleep.sh
|
||||
+++ b/packaging/rhel/acpid.sleep.sh
|
||||
@@ -3,11 +3,14 @@
|
||||
PATH=/sbin:/bin:/usr/bin
|
||||
failed='false'
|
||||
|
||||
+# Hibernation selects the swapfile with highest priority. Since there may be
|
||||
+# other swapfiles configured, ensure /swap is selected as hibernation
|
||||
+# target by setting to maximum priority.
|
||||
+swap_priority=32767
|
||||
+
|
||||
hibernate()
|
||||
{
|
||||
- swapon /swap
|
||||
- systemctl hibernate
|
||||
-
|
||||
+ swapon --priority=$swap_priority /swap && systemctl hibernate
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
logger "Hibernation failed, Sleeping 2 mins before retry"
|
||||
@@ -15,6 +18,7 @@ hibernate()
|
||||
else
|
||||
failed='false'
|
||||
fi
|
||||
+ swapoff /swap
|
||||
}
|
||||
|
||||
case "$2" in
|
||||
@@ -26,6 +30,7 @@ case "$2" in
|
||||
hibernate
|
||||
if [ $failed == 'true' ];
|
||||
then
|
||||
+ swapoff /swap
|
||||
sleep 2m
|
||||
else
|
||||
break
|
||||
--
|
||||
2.47.0
|
||||
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
From 0197c7173a5ad1470060862a0be96b9a976bdf49 Mon Sep 17 00:00:00 2001
|
||||
From: Frank Liang <xiliang@redhat.com>
|
||||
Date: Thu, 2 Jan 2025 22:28:12 +0800
|
||||
Subject: [PATCH] rhel: fix swapoff breaks hibernate process
|
||||
|
||||
hibernate() always calling swapoff breaks hibernation process.
|
||||
The hibernation wont continue if call swapoff too fast in rhel or amazon
|
||||
linux.
|
||||
|
||||
"swapon --priority=32767 /swap && systemctl hibernate ;echo $?; swapoff /swap"
|
||||
|
||||
Signed-off-by: Frank Liang <xiliang@redhat.com>
|
||||
---
|
||||
packaging/rhel/acpid.sleep.sh | 17 ++++++-----------
|
||||
1 file changed, 6 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/packaging/rhel/acpid.sleep.sh b/packaging/rhel/acpid.sleep.sh
|
||||
index 9b381f9..1e55b51 100755
|
||||
--- a/packaging/rhel/acpid.sleep.sh
|
||||
+++ b/packaging/rhel/acpid.sleep.sh
|
||||
@@ -11,29 +11,24 @@ swap_priority=32767
|
||||
hibernate()
|
||||
{
|
||||
swapon --priority=$swap_priority /swap && systemctl hibernate
|
||||
- if [ $? -ne 0 ]
|
||||
- then
|
||||
+ if [ $? -ne 0 ]; then
|
||||
logger "Hibernation failed, Sleeping 2 mins before retry"
|
||||
failed='true'
|
||||
+ swapoff /swap
|
||||
+ sleep 2m
|
||||
else
|
||||
failed='false'
|
||||
fi
|
||||
- swapoff /swap
|
||||
}
|
||||
|
||||
case "$2" in
|
||||
SBTN)
|
||||
# The iteration had been placed here to add retry logic to hibernation
|
||||
# in case of failures and to avoid force stop of instances after 20min
|
||||
- for i in 1 2 3
|
||||
- do
|
||||
+ for i in 1 2 3; do
|
||||
hibernate
|
||||
- if [ $failed == 'true' ];
|
||||
- then
|
||||
- swapoff /swap
|
||||
- sleep 2m
|
||||
- else
|
||||
- break
|
||||
+ if [ $failed == 'false' ]; then
|
||||
+ break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
--
|
||||
2.48.1
|
||||
|
||||
|
|
@ -12,18 +12,13 @@
|
|||
|
||||
Name: ec2-hibinit-agent
|
||||
Version: 1.0.9
|
||||
Release: 11%{?dist}
|
||||
Release: 1%{?dist}
|
||||
Summary: Hibernation setup utility for Amazon EC2
|
||||
|
||||
License: Apache-2.0
|
||||
URL: https://github.com/aws/amazon-%{name}
|
||||
Source0: https://github.com/aws/%{project}/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||
|
||||
# Ensure swapon with maximum priority before hibernation
|
||||
# Upstream Patch: https://github.com/aws/amazon-ec2-hibinit-agent/pull/49)
|
||||
Patch1: 0001-swapon-with-maximum-priority-before-hibernation.patch
|
||||
Patch2: 0002-rhel-fix-swapoff-breaks-hibernate-process.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: make
|
||||
|
|
@ -43,7 +38,7 @@ Requires: tuned
|
|||
An EC2 agent that creates a setup for instance hibernation
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{project}-%{version}
|
||||
%autosetup -n %{project}-%{version}
|
||||
# Fix build with setuptools 62.1
|
||||
# https://github.com/aws/amazon-ec2-hibinit-agent/issues/24
|
||||
sed -i "20i packages=[]," setup.py
|
||||
|
|
@ -149,37 +144,6 @@ fi
|
|||
%selinux_relabel_post -s %{selinuxtype}
|
||||
|
||||
%changelog
|
||||
* Wed Jul 15 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
|
||||
|
||||
* Thu Jun 04 2026 Python Maint <python-maint@redhat.com> - 1.0.9-10
|
||||
- Rebuilt for Python 3.15
|
||||
|
||||
* Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
|
||||
|
||||
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Tue Jun 03 2025 Python Maint <python-maint@redhat.com> - 1.0.9-7
|
||||
- Rebuilt for Python 3.14
|
||||
|
||||
* Tue Mar 18 2025 Frank Liang <xiliang@redhat.com> - 1.0.9-6
|
||||
- Include upstream Patch to fix swapoff breaks hibernate process
|
||||
|
||||
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Fri Nov 08 2024 Dominik Wombacher <dominik@wombacher.cc> - 1.0.9-4
|
||||
- Include upstream Patch to ensure swapon with maximum priority before hibernation
|
||||
- Resolves rhbz#2322884
|
||||
|
||||
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||
|
||||
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 1.0.9-2
|
||||
- Rebuilt for Python 3.13
|
||||
|
||||
* Sun Jun 02 2024 Packit <hello@packit.dev> - 1.0.9-1
|
||||
- Update to version 1.0.9
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue