2 # Copyright (C) 2009-2010 OpenWrt.org
3 # Copyright (C) 2010 Vertical Communications
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 .
/lib
/functions
/block.sh
9 .
/lib
/functions
/fsck.sh
11 blkdev
=`dirname $DEVPATH`
13 if [ `basename $blkdev` != "block" ]; then
15 device
=`basename $DEVPATH`
23 local mds_mount_target
24 local mds_mount_device
25 local mds_mount_fstype
26 local mds_mount_enabled_fsck
32 local autoswap_from_fstab
33 local automount_from_fstab
34 local hotplug_blkid_fstype_match
36 mount_dev_section_cb
() {
39 mds_mount_enabled_fsck
="$7"
42 swap_dev_section_cb
() {
48 automount_from_fstab
="$from_fstab"
50 [ "$automount_from_fstab" -eq 1 ] && {
51 config_get_mount_section_by_device
"/dev/$device"
52 use_device
="$mds_mount_device"
53 [ "$mds_mount_enabled_fsck" -eq 1 ] && {
55 fsck_type
="$mds_mount_fstype"
59 [ -z "$use_device" ] && {
61 autoswap_from_fstab
="$from_fstab"
63 [ "$autoswap_from_fstab" -eq 1 ] && {
64 config_get_swap_section_by_device
"/dev/$device"
65 use_device
="$sds_swap_device" && do_fsck
=0
69 grep -q "/dev/$device" /proc
/swaps ||
grep -q "/dev/$device" /proc
/mounts ||
{
70 [ "$anon_fsck" -eq 1 ] && [ -z "$use_device" ] && {
71 use_device
="/dev/$device" && do_fsck
=1 && mds_mount_fstype
="" && hotplug_blkid_fstype_match
=0
75 [ "$do_fsck" -eq 1 ] && {
76 libmount_fsck
"$use_device" "$fsck_type" "$do_fsck"