--- /etc/rc.d/swap1.orig	2016-03-13 18:54:23.000000000 +0100
+++ /etc/rc.d/swap1	2016-03-18 22:32:20.000000000 +0100
@@ -13,6 +13,15 @@
 start_cmd="swap1_start"
 stop_cmd="swap1_stop"
 
+dev_free_tmpfs()
+{
+	for fs in $(mount -t tmpfs | cut -f 3 -d ' ')
+	do
+		find -x ${fs} \( -type b -or -type c \) -exit 1 && echo ${fs}
+	done
+}
+
+
 #		Add all block-type swap devices; these might be necessary
 #		during disk checks.
 #
@@ -30,9 +39,21 @@
 #
 swap1_stop()
 {
+	local fs_to_umount
 	if checkyesno swapoff || [ -n "$rc_force" ]; then
-		echo "Forcibly unmounting tmpfs filesystems"
-		umount -aft tmpfs
+		case ${swapoff_umount} in
+			auto)
+				fs_to_umount="$(dev_free_tmpfs)"
+				;;
+			*)
+				fs_to_umount="${swapoff_umount}"
+				;;
+		esac
+		for fs in ${fs_to_umount}
+		do
+			echo "Forcibly unmounting ${fs}"
+			umount -ft tmpfs ${fs}
+		done
 		echo "Removing block-type swap devices"
 		swapctl -U -t blk || [ $? = 2 ]
 	fi
