[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH initramfs-tools 1/9] hooks/resume: Use correct sort options to select the biggest swap partition



We need a reverse *numeric* sort.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 hooks/resume | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hooks/resume b/hooks/resume
index 657775e4a465..c43badd03f71 100755
--- a/hooks/resume
+++ b/hooks/resume
@@ -29,7 +29,7 @@ if [ ! -r /proc/swaps ]; then
 fi
 
 # Try to autodetect the RESUME partition, using biggest swap?
-RESUME=$(grep ^/dev/ /proc/swaps | sort -rk3 | head -n 1 | cut -d " " -f 1)
+RESUME=$(grep ^/dev/ /proc/swaps | sort -rnk3 | head -n 1 | cut -d " " -f 1)
 if [ -n "$RESUME" ]; then
 	UUID=$(blkid -s UUID -o value "$RESUME" || true)
 	if [ -n "$UUID" ]; then

Attachment: signature.asc
Description: Digital signature


Reply to: