#!/bin/sh # Copyright (C) 2009-2010 OpenWrt.org # Copyright (C) 2010 Vertical Communications # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # . /lib/functions/block.sh blkdev=`dirname $DEVPATH` if [ `basename $blkdev` != "block" ]; then device=`basename $DEVPATH` case "$ACTION" in add) local from_fstab local anon_mount local anon_swap local anon_fsck local mds_mount_target local mds_mount_device local mds_mount_fstype local sds_swap_device local use_device local do_fsck=0 local fsck_type local autoswap_from_fstab local automount_from_fstab mount_dev_section_cb() { mds_mount_target="$2" mds_mount_device="$3" mds_mount_fstype="$4" mds_mount_enabled="$6" } swap_dev_section_cb() { sds_swap_device="$2" return 0 } config_get_automount automount_from_fstab="$from_fstab" [ "$automount_from_fstab" -eq 1 ] && { config_get_mount_section_by_device "/dev/$device" use_device="$mds_mount_device" [ "$mds_mount_enabled" -eq 1 ] && { if [ -n "$mds_mount_target" ]; then grep -q "/dev/$device" /proc/swaps || grep -q "/dev/$device" /proc/mounts || { ( mkdir -p "$mds_mount_target" && mount "$mds_mount_target" ) 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab' } else logger -t 'fstab' "Mount enabled for $mds_mount_device but it doesn't have a defined mountpoint (target)" fi } } [ -z "$use_device" ] && { config_get_autoswap autoswap_from_fstab="$from_fstab" [ "$autoswap_from_fstab" -eq 1 ] && { config_get_swap_section_by_device "/dev/$device" use_device="$sds_swap_device" } } grep -q "/dev/$device" /proc/swaps || grep -q "/dev/$device" /proc/mounts || { [ "$anon_mount" -eq 1 ] && [ -z "$use_device" ] && { ( mkdir -p /mnt/$device && mount /dev/$device /mnt/$device ) 2>&1 | tee /proc/self/fd/2 | logger -t 'fstab' } } reset_dev_section_cb ;; remove) umount /dev/$device ;; esac fi ass='active' href='/cgit.cgi/openwrt/upstream/tree/target/linux/brcm47xx/config-3.14?h=v21.02.0-rc2&id=e736343df98ef6768c8abcd703c49ea0496d489a'>treecommitdiffstats
path: root/target/linux/brcm47xx/config-3.14
blob: 5d0e7fe471a035b0676d89fefe23f3166e938e82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172