mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00

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>
540 B
Executable File
540 B
Executable File
#!/bin/sh
BEGIN INIT INFO
Provides: umountfs
Required-Start:
Required-Stop:
Default-Start:
Default-Stop: 0 6
Short-Description: Turn off swap and unmount all local file systems.
Description:
END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
echo "Deactivating swap..." [ -x /sbin/swapoff ] && swapoff -a
We leave /proc mounted.
echo "Unmounting local filesystems..." grep -q /mnt/ram /proc/mounts && mount -o remount,ro /mnt/ram mount -o remount,ro /
- umount -f -a -r > /dev/null 2>&1
-
exit 0