mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 21:49:33 +02:00
initscripts: check if swapon/swapoff exists before executing them
Not all built images contain swapon/swapoff, for instance, it is configurable with or without them in busybox. So it'd better to check if they exist or not before executing them. Redirecting the potential errors to /dev/null is not good enough, which might suppress the *real* errors. (From OE-Core rev: 2cb1142710cc2beb762c4c2b8edd44d3a97dafa0) Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
echo "Deactivating swap..."
|
||||
swapoff -a
|
||||
[ -x /sbin/swapoff ] && swapoff -a
|
||||
|
||||
# We leave /proc mounted.
|
||||
echo "Unmounting local filesystems..."
|
||||
|
||||
Reference in New Issue
Block a user