From 8b0d868279fdce12fe75ccd7049f293d22367e12 Mon Sep 17 00:00:00 2001 From: Mason Huo Date: Mon, 24 Apr 2023 11:38:28 +0800 Subject: [PATCH] package: starfive: Optimize the swapoff partition Check if the swap partition ("hibernation") exist or not before swapoff command. Signed-off-by: Mason Huo --- package/starfive/pm/S99hibernation | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package/starfive/pm/S99hibernation b/package/starfive/pm/S99hibernation index ac5a09fc..90b61fce 100644 --- a/package/starfive/pm/S99hibernation +++ b/package/starfive/pm/S99hibernation @@ -16,7 +16,12 @@ case "$1" in fi ;; stop) - swapoff PARTLABEL="hibernation" + FILE=/dev/disk/by-partlabel/hibernation + if [ -b "$FILE" ];then + swapoff PARTLABEL="hibernation" + else + echo "No PARTLABEL=hibernation!" + fi ;; *) echo "Usage: $0 {start|stop}"