M7350/oe-core/meta-msm/recipes/initscripts/initscripts-1.0/umountfs
2024-09-09 08:57:42 +00:00

32 lines
655 B
Bash
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..."
swapoff -a
# We leave /proc mounted.
echo "Unmounting local filesystems..."
grep -q /mnt/ram /proc/mounts && mount -o remount,ro /mnt/ram
sync
mount -o remount,ro /
echo "Remounted / as RO..."
sync
umount -f -a -r > /dev/null 2>&1
mount -t sysfs none /sys
echo "Running ubidetach commands..."
ubidetach -d 2
ubidetach -d 1
umount /sys -f
: exit 0