1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-22 18:55:29 +03:00
aports/community/cloud-utils/04-set-sfdisk-lang.patch
Dermot Bradley f7cae14002 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.
2021-04-25 19:13:24 +00:00

34 lines
1 KiB
Diff

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, ...