summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
diff options
context:
space:
mode:
authorMing Liu <peter.x.liu@external.atlascopco.com>2016-05-26 23:14:33 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-30 15:58:15 +0100
commitf053b5fac3c3b48439934ce75789d2e94e84957a (patch)
treeebc65a841a8614baf6a8989321840e5c1530ff53 /meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
parentb426b2bc1a954e05e5fcbc40e6ff39251075305d (diff)
downloadpoky-f053b5fac3c3b48439934ce75789d2e94e84957a.tar.gz
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>
Diffstat (limited to 'meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh')
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/checkroot.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh b/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
index dfee2afaad..02f0351fcb 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
@@ -69,7 +69,7 @@ fi
69# before fsck, since fsck can be quite memory-hungry. 69# before fsck, since fsck can be quite memory-hungry.
70# 70#
71test "$VERBOSE" != no && echo "Activating swap" 71test "$VERBOSE" != no && echo "Activating swap"
72swapon -a 2> /dev/null 72[ -x /sbin/swapon ] && swapon -a
73 73
74# 74#
75# Check the root filesystem. 75# Check the root filesystem.