package: starfive: Optimize the swapoff partition

Check if the swap partition ("hibernation") exist or not
before swapoff command.

Signed-off-by: Mason Huo <mason.huo@starfivetech.com>
This commit is contained in:
Mason Huo
2023-04-24 11:38:28 +08:00
parent 6d540bf363
commit 8b0d868279
+6 -1
View File
@@ -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}"