diff options
author | Ming Liu <peter.x.liu@external.atlascopco.com> | 2016-05-26 23:14:33 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-30 09:30:33 +0100 |
commit | 2cb1142710cc2beb762c4c2b8edd44d3a97dafa0 (patch) | |
tree | 556f9c90d73645c618e0f827a9c6f92d216d3f5d /meta/recipes-core/initscripts/initscripts-1.0/umountfs | |
parent | 4afee787e455ce1d4c002cd5c003182f1fc50028 (diff) | |
download | openembedded-core-2cb1142710cc2beb762c4c2b8edd44d3a97dafa0.tar.gz openembedded-core-2cb1142710cc2beb762c4c2b8edd44d3a97dafa0.tar.bz2 openembedded-core-2cb1142710cc2beb762c4c2b8edd44d3a97dafa0.zip |
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.
Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-core/initscripts/initscripts-1.0/umountfs')
-rwxr-xr-x | meta/recipes-core/initscripts/initscripts-1.0/umountfs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/umountfs b/meta/recipes-core/initscripts/initscripts-1.0/umountfs index 61324c630b..7fb5c58b3e 100755 --- a/meta/recipes-core/initscripts/initscripts-1.0/umountfs +++ b/meta/recipes-core/initscripts/initscripts-1.0/umountfs @@ -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..." |