diff options
author | Dermot Bradley <dermot_bradley@yahoo.com> | 2021-04-25 18:23:25 +0100 |
---|---|---|
committer | Michał Polański <michal@polanski.me> | 2021-04-25 19:13:24 +0000 |
commit | f7cae140021d3872a0e619889dfd46a3cd51c60e (patch) | |
tree | 14e141156a15eb84d871e58daeab5cd23a7e738b | |
parent | a682714fd6da79a268cd4be930a1646a0e65110f (diff) |
community/cloud-utils: add growpart reliability patch
Add patch from upstream to ensure that sfdisk is always called using
C locale to prevent parsing problems.
-rw-r--r-- | community/cloud-utils/04-set-sfdisk-lang.patch | 34 | ||||
-rwxr-xr-x | community/cloud-utils/APKBUILD | 6 |
2 files changed, 38 insertions, 2 deletions
diff --git a/community/cloud-utils/04-set-sfdisk-lang.patch b/community/cloud-utils/04-set-sfdisk-lang.patch new file mode 100644 index 00000000000..3724985e18d --- /dev/null +++ b/community/cloud-utils/04-set-sfdisk-lang.patch @@ -0,0 +1,34 @@ +Upstream patch #28 from git master. Will be present in next release. + + +Use LANG=C to parse sfdisk output + +This will prevent failure to parse output of in non-C locales leading to +failure to resize partition. + +Alternative would be to use sfdisk --dump, but this misses some +importants informations such as the sectors size + +Reported in: +https://bugs.launchpad.net/cloud-utils/+bug/1860479 + +This was tested on centos7 with sfdisk 2.23.2 and +centos8 with sfdisk 2.32.1 + +Reported-by: https://launchpad.net/~pickadi +Signed-off-by: Nicolas Chauvet <kwizart@gmail.com> + +--- + +diff -rau a/bin/growpart b/bin/growpart +--- a/bin/growpart ++++ b/bin/growpart +@@ -292,7 +292,7 @@ + local pt_start pt_size pt_end max_end new_size change_info dpart + local sector_num sector_size disk_size tot out + +- rqe sfd_list sfdisk --list --unit=S "$DISK" >"$tmp" || ++ LANG=C rqe sfd_list sfdisk --list --unit=S "$DISK" >"$tmp" || + fail "failed: sfdisk --list $DISK" + if [ "${SFDISK_VERSION}" -lt ${SFDISK_2_26} ]; then + # exected output contains: Units: sectors of 512 bytes, ... diff --git a/community/cloud-utils/APKBUILD b/community/cloud-utils/APKBUILD index fb4e0d69965..18ecac91a35 100755 --- a/community/cloud-utils/APKBUILD +++ b/community/cloud-utils/APKBUILD @@ -3,7 +3,7 @@ # Maintainer: Dermot Bradley <dermot_bradley@yahoo.com> pkgname=cloud-utils pkgver=0.32 -pkgrel=3 +pkgrel=4 pkgdesc="Utilities for interacting with cloud VM images" url="https://launchpad.net/cloud-utils/" arch="noarch !mips !mips64 !s390x" # tests are broken on big-endian @@ -26,6 +26,7 @@ source="cloud-utils-$pkgver.tar.gz::https://github.com/canonical/cloud-utils/arc 01-minor-corrections.patch 02-make-udev-optional.patch 03-growpart-flock.patch + 04-set-sfdisk-lang.patch " build() { @@ -76,4 +77,5 @@ growpart() { sha512sums="62bc07759c9c74397cd16a6a0781efb50803efc9f59969e16943fcab0d73ef96966c6abfe21edd17c15ac96dbffaaffa594b3abc0d3fab23102d2d6e7f380a7d cloud-utils-0.32.tar.gz 0efa8170b41cb5b6799fda9de3d3054aab1f765dfc46d1bada11edb103797ddd8153582dbfa1b4c22fd088d4cbf3a1f0729ff708f128d899645f988a8bc4c35e 01-minor-corrections.patch 83275289265f9a754bc49262133c3cbb42683f42e58de05fc446e9411be457f012edad7058325bbaae2ba8aa7fb7e42698df94f28682b0869d7f15956bde8f2a 02-make-udev-optional.patch -2a3802364f46c3144d06736dc5719378e6e7bd8635e2a625387d4b5ad0f9e8d1e76c3e9bccd3b87a224e3b8a6563cb4c61f41be6d4c3fc23780f538d56b733b4 03-growpart-flock.patch" +2a3802364f46c3144d06736dc5719378e6e7bd8635e2a625387d4b5ad0f9e8d1e76c3e9bccd3b87a224e3b8a6563cb4c61f41be6d4c3fc23780f538d56b733b4 03-growpart-flock.patch +5ed0c747a9383021cb393187045c52bce5e5470d542a3d69e05ab4d51c06926c6f983ebed308eed8f0a110916cf03af11d391e596b911ce84bf13f933d7baab2 04-set-sfdisk-lang.patch" |