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

Proposed by Mitchell Dzurick
Status: Merged
Merged at revision: cb2db284ecb14fc6d8c89701d40d9ffc952caa5f
Proposed branch: ~mitchdz/ubuntu/+source/ec2-hibinit-agent:mitch/fix-locale-quotes-jammy
Merge into: ubuntu/+source/ec2-hibinit-agent:ubuntu/jammy-devel
Diff against target: 107 lines (+68/-0)
5 files modified
debian/changelog (+10/-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
Michael Hudson-Doyle (community) Approve
git-ubuntu import Pending
Review via email: mp+445092@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
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 9b56463..cff04a2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
1ec2-hibinit-agent (1.0.0-0ubuntu11.22.04.3) jammy; 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/p/lp2024505-fix-locale-issue.patch: fixes an issue where certain locales
6 can cause an error when trying to decode the output of `df -P`
7 (LP: #2024505)
8
9 -- Mitchell Dzurick <mitchell.dzurick@canonical.com> Tue, 20 Jun 2023 17:01:17 -0700
10
1ec2-hibinit-agent (1.0.0-0ubuntu11.22.04.2) jammy; urgency=medium11ec2-hibinit-agent (1.0.0-0ubuntu11.22.04.2) jammy; urgency=medium
212
3 * d/p/lp1941785-Add-support-for-IMDSv2.patch: allow hibernation of13 * 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 10064414new 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 7412d06..0656b89 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,5 @@ detect-hibernate-cmd-by-default.patch
90010-Update-grub-configuration-when-it-needs-an-update.patch90010-Update-grub-configuration-when-it-needs-an-update.patch
10lp1968805-Swapon-with-maximum-priority-before-hibernation.patch10lp1968805-Swapon-with-maximum-priority-before-hibernation.patch
11lp1941785-Add-support-for-IMDSv2.patch11lp1941785-Add-support-for-IMDSv2.patch
12lp2023924-remove-quotes-from-state-dir.patch
13lp2024505-fix-locale-issue.patch
diff --git a/debian/postinst b/debian/postinst
index 382bb41..e86ae20 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-0ubuntu11.22.04.2" ]; 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