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:
@@ -16,7 +16,12 @@ case "$1" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
stop)
|
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}"
|
echo "Usage: $0 {start|stop}"
|
||||||
|
|||||||
Reference in New Issue
Block a user