Merge ~mitchdz/ubuntu/+source/ec2-hibinit-agent:mitch/fix-locale-quotes-lunar into ubuntu/+source/ec2-hibinit-agent:ubuntu/lunar-devel

Proposed by Mitchell Dzurick
Status: Merged
Merged at revision: 4605476a144d7747b972177bae901236efab0f61
Proposed branch: ~mitchdz/ubuntu/+source/ec2-hibinit-agent:mitch/fix-locale-quotes-lunar
Merge into: ubuntu/+source/ec2-hibinit-agent:ubuntu/lunar-devel
Diff against target: 108 lines (+69/-0)
5 files modified
debian/changelog (+11/-0)
debian/patches/lp2023924-remove-quotes-from-state-dir.patch (+19/-0)
debian/patches/lp2024505-fix-locale-issue.patch (+18/-0)
debian/patches/series (+2/-0)
debian/postinst (+19/-0)
Reviewer Review Type Date Requested Status
Dan Bungert (community) Approve
Steve Langasek (community) Approve
Michael Hudson-Doyle (community) Approve
git-ubuntu import Pending
Review via email: mp+445090@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Thanks uploaded

review: Approve
Revision history for this message
Steve Langasek (vorlon) wrote :

LGTM

review: Approve
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

This MP + Jammy/Kinetic/Focal need to be re-uploaded because a small change was made.

Revision history for this message
Dan Bungert (dbungert) wrote :

Uploaded, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index c1277de..471c96f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
1ec2-hibinit-agent (1.0.0-0ubuntu13.2) lunar; urgency=medium
2
3 * d/p/lp2023924-remove-quotes-from-state-dir.patch: fixes an issue where a
4 weird directory would be created in root (LP: #2023924)
5 * d/preinst: remove the directory /" if it exists
6 * d/p/lp2024505-fix-locale-issue.patch: fixes an issue where certain locales
7 can cause an error when trying to decode the output of `df -P`
8 (LP: #2024505)
9
10 -- Mitchell Dzurick <mitchell.dzurick@canonical.com> Tue, 20 Jun 2023 17:01:17 -0700
11
1ec2-hibinit-agent (1.0.0-0ubuntu13.1) lunar; urgency=medium12ec2-hibinit-agent (1.0.0-0ubuntu13.1) lunar; urgency=medium
213
3 * d/p/lp1941785-Add-support-for-IMDSv2.patch: allow hibernation of14 * d/p/lp1941785-Add-support-for-IMDSv2.patch: allow hibernation of
diff --git a/debian/patches/lp2023924-remove-quotes-from-state-dir.patch b/debian/patches/lp2023924-remove-quotes-from-state-dir.patch
4new file mode 10064415new file mode 100644
index 0000000..d178d21
--- /dev/null
+++ b/debian/patches/lp2023924-remove-quotes-from-state-dir.patch
@@ -0,0 +1,19 @@
1Description: Remove quotes in config file for state_dir value
2It creates strange directory /"
3Author: Anchal Agarwal <anchalag@amazon.com>
4Origin: backport, https://github.com/aws/amazon-ec2-hibinit-agent/commit/d87d6365009f1663247fd8595b487c59d9b121f1
5Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ec2-hibinit-agent/+bug/2023924
6Last-Update: 2023-06-20
7---
8This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
9--- a/etc/hibinit-config.cfg
10+++ b/etc/hibinit-config.cfg
11@@ -12,7 +12,7 @@
12 touch-swap = False
13
14 # Location where to create any state files
15-state-dir = "/var/lib/hibinit-agent"
16+state-dir = /var/lib/hibinit-agent
17
18 [swap]
19 # If there's no swap then we create it to be equal to the specified
diff --git a/debian/patches/lp2024505-fix-locale-issue.patch b/debian/patches/lp2024505-fix-locale-issue.patch
0new file mode 10064420new file mode 100644
index 0000000..15a0a0d
--- /dev/null
+++ b/debian/patches/lp2024505-fix-locale-issue.patch
@@ -0,0 +1,18 @@
1Description: Change encoding to use the system locale instead of ascii.
2Author: einynot <111812541+einynot@users.noreply.github.com>
3Origin: backport, https://github.com/aws/amazon-ec2-hibinit-agent/commit/2392e860c7a75c2b61baef749bb90e79a2a3e81e
4Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ec2-hibinit-agent/+bug/2024505
5Last-Update: 2023-06-20
6---
7This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
8--- a/agent/hibinit-agent
9+++ b/agent/hibinit-agent
10@@ -145,7 +145,7 @@
11
12 def find_device_for_file(filename):
13 # Find the mount point for the swap file ('df -P /swap')
14- df_out = check_output(['df', '-P', filename]).decode('ascii')
15+ df_out = check_output(['df', '-P', filename]).decode(sys.getfilesystemencoding())
16 dev_str = df_out.split("\n")[1].split()[0]
17 return dev_str
18
diff --git a/debian/patches/series b/debian/patches/series
index 043841d..0dce030 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,5 @@ detect-hibernate-cmd-by-default.patch
10lp1968805-Swapon-with-maximum-priority-before-hibernation.patch10lp1968805-Swapon-with-maximum-priority-before-hibernation.patch
11fix-setuptools-package-discovery.patch11fix-setuptools-package-discovery.patch
12lp1941785-Add-support-for-IMDSv2.patch12lp1941785-Add-support-for-IMDSv2.patch
13lp2023924-remove-quotes-from-state-dir.patch
14lp2024505-fix-locale-issue.patch
diff --git a/debian/postinst b/debian/postinst
index 382bb41..bef2969 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -2,6 +2,25 @@
22
3set -e3set -e
44
5PREVIOUS_VERSION="$2"
6
7# https://bugs.launchpad.net/ubuntu/+source/ec2-hibinit-agent/+bug/2023924
8if [ "$PREVIOUS_VERSION" = "1.0.0-0ubuntu13.1" ]; then
9 dirpath="/\"/var/lib/hibinit-agent\""
10 filenamepath="${dirpath}/hibernation-enabled"
11
12 # If system has this package, but hibernation is not enabled, then
13 # $filenamepath will not exist, but $dirpath will
14 if [ -f "$filenamepath" ]; then
15 echo "Removing file $filenamepath"
16 rm -f $filenamepath
17 fi
18 if [ -d "$dirpath" ]; then
19 echo "Recursively removing directories $dirpath"
20 rmdir -p $dirpath --ignore-fail-on-non-empty
21 fi
22fi
23
5#DEBHELPER#24#DEBHELPER#
625
7case "$1" in26case "$1" in

Subscribers

People subscribed via source and target branches