mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00: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:
@@ -33,7 +33,7 @@ kill -USR1 1
|
||||
# Execute swapon command again, in case we want to swap to
|
||||
# a file on a now mounted filesystem.
|
||||
#
|
||||
swapon -a 2> /dev/null
|
||||
[ -x /sbin/swapon ] && swapon -a
|
||||
|
||||
: exit 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user