Merge ~mitchdz/ubuntu/+source/ec2-hibinit-agent:mitch/arm-focal into ubuntu/+source/ec2-hibinit-agent:ubuntu/focal-devel

Proposed by Mitchell Dzurick
Status: Merged
Merged at revision: d76e1086246e72d047874d7f0afbf5ff07700908
Proposed branch: ~mitchdz/ubuntu/+source/ec2-hibinit-agent:mitch/arm-focal
Merge into: ubuntu/+source/ec2-hibinit-agent:ubuntu/focal-devel
Diff against target: 71 lines (+49/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/0015-ignore-setting-resume-offset-again-if-dev-snapshot-d.patch (+40/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Lena Voytek (community) Approve
git-ubuntu import Pending
Review via email: mp+466349@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Due to this MP being the same for multiple release, check the testing results in the bug report at https://bugs.launchpad.net/bugs/2066999

Revision history for this message
Lena Voytek (lvoytek) wrote :

LGTM

dput ubuntu ../ec2-hibinit-agent_1.0.0-0ubuntu9.6_source.changes
D: Setting host argument.
Checking signature on .changes
gpg: ../ec2-hibinit-agent_1.0.0-0ubuntu9.6_source.changes: Valid signature from 34B8AD7D9529E793
Checking signature on .dsc
gpg: ../ec2-hibinit-agent_1.0.0-0ubuntu9.6.dsc: Valid signature from 34B8AD7D9529E793
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading ec2-hibinit-agent_1.0.0-0ubuntu9.6.dsc: done.
  Uploading ec2-hibinit-agent_1.0.0-0ubuntu9.6.debian.tar.xz: done.
  Uploading ec2-hibinit-agent_1.0.0-0ubuntu9.6_source.buildinfo: done.
  Uploading ec2-hibinit-agent_1.0.0-0ubuntu9.6_source.changes: done.
Successfully uploaded packages.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index a8c5080..70c86b4 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+ec2-hibinit-agent (1.0.0-0ubuntu9.6) focal; urgency=medium
7+
8+ * d/p/0015-ignore-setting-resume-offset-again-if-dev-snapshot-d.patch: do
9+ not set the snapshot swap area if /dev/snapshot does not exist. This is
10+ necessary to enable ARM hibernation. (LP: #2066999)
11+
12+ -- Mitchell Dzurick <mitchell.dzurick@canonical.com> Thu, 23 May 2024 16:39:47 -0700
13+
14 ec2-hibinit-agent (1.0.0-0ubuntu9.5) focal; urgency=medium
15
16 * d/p/lp2031345-recreate-swap-file.patch: Reduce SWAP size if current SWAP
17diff --git a/debian/patches/0015-ignore-setting-resume-offset-again-if-dev-snapshot-d.patch b/debian/patches/0015-ignore-setting-resume-offset-again-if-dev-snapshot-d.patch
18new file mode 100644
19index 0000000..65ddd69
20--- /dev/null
21+++ b/debian/patches/0015-ignore-setting-resume-offset-again-if-dev-snapshot-d.patch
22@@ -0,0 +1,40 @@
23+Description: Do not set snapshot swap area if it does not exist
24+Author: Carolan <secarola@88665a58a118.ant.amazon.com>
25+Origin: upstream, https://github.com/aws/amazon-ec2-hibinit-agent/commit/ab70d14fce4d9f05d54b363a0d849c5169e01ffa
26+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2066999
27+Forwarded: not-needed
28+Last-Update: 2024-05-23
29+---
30+ agent/hibinit-agent | 18 +++++++++---------
31+ 1 file changed, 9 insertions(+), 9 deletions(-)
32+
33+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
34+diff --git a/agent/hibinit-agent b/agent/hibinit-agent
35+index 2cc97ce..e36150e 100755
36+--- a/agent/hibinit-agent
37++++ b/agent/hibinit-agent
38+@@ -130,15 +130,15 @@ def update_kernel_swap_offset(swapon, swapoff, filename, grub_update):
39+ else:
40+ log("Skipping GRUB configuration update")
41+
42+- log("Setting swap device to %d with offset %d" % (dev, offset))
43+-
44+- # Set the kernel swap offset, see https://www.kernel.org/doc/Documentation/power/userland-swsusp.txt
45+- # From linux/suspend_ioctls.h
46+- SNAPSHOT_SET_SWAP_AREA = 0x400C330D
47+- buf = struct.pack('LI', offset, dev)
48+- with open('/dev/snapshot', 'r') as snap:
49+- fcntl.ioctl(snap, SNAPSHOT_SET_SWAP_AREA, buf)
50+- log("Done updating the swap offset. Turning swapoff")
51++ if os.path.exists("/dev/snapshot"):
52++ log("Setting swap device to %d with offset %d" % (dev, offset))
53++ # Set the kernel swap offset, see https://www.kernel.org/doc/Documentation/power/userland-swsusp.txt
54++ # From linux/suspend_ioctls.h
55++ SNAPSHOT_SET_SWAP_AREA = 0x400C330D
56++ buf = struct.pack('LI', offset, dev)
57++ with open('/dev/snapshot', 'r') as snap:
58++ fcntl.ioctl(snap, SNAPSHOT_SET_SWAP_AREA, buf)
59++ log("Done updating the swap offset. Turning swapoff")
60+ swapoff = swapoff.format(swapfile=filename)
61+ log("Running: %s" % swapoff)
62+ check_call(swapoff, shell=True)
63diff --git a/debian/patches/series b/debian/patches/series
64index f66ab04..8e12c8a 100644
65--- a/debian/patches/series
66+++ b/debian/patches/series
67@@ -12,3 +12,4 @@ lp1941785-Add-support-for-IMDSv2.patch
68 lp2023924-remove-quotes-from-state-dir.patch
69 lp2024505-fix-locale-issue.patch
70 lp2031345-recreate-swap-file.patch
71+0015-ignore-setting-resume-offset-again-if-dev-snapshot-d.patch

Subscribers

People subscribed via source and target branches