~ubuntu-branches/ubuntu/quantal/aufs/quantal

« back to all changes in this revision

Viewing changes to util/mount.aufs

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2008-04-01 18:26:37 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080401182637-ujuqq47eiggw4y5w
Tags: 0+20080401-1
* New upstream snapshot
  - Remove bashisms in script (Closes: #471288)
* debian/conf.mk, linux-patch-aufs.kpatches.sysfs_get_dentry:
  - Remove support for this patch, no longer used
* debian/conf.mk:
  - Add hacks for arm to armel (Closes: #473767)
* debian/control:
  - Add Dm-Upload-Allowed
* debian/copyright:
  - Use http://wiki.debian.org/Proposals/CopyrightFormat
* debian/linux-patch-aufs.kpatches.{splice,put_filp}:
  - Add support for Kernel 2.6.24 (and 2.6.25)
* debian/patches:
  - 01_vserver_apparmor: Update patch
  - 06_rt: Add patch for realtime kernel
  - 07_splice_hack: Add hack to support splice operations (Closes: #473430)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
# along with this program; if not, write to the Free Software
17
17
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 
19
 
# $Id: mount.aufs,v 1.16 2007/07/02 05:11:51 sfjro Exp $
 
19
# $Id: mount.aufs,v 1.17 2008/03/31 07:44:10 sfjro Exp $
20
20
 
21
21
#
22
22
# The main purpose of this script is updating /etc/mtab and calling auplilnk.
69
69
test "$1" = "-o" || { eecho Bad arg. "$@"; exit 1; }
70
70
shift
71
71
 
72
 
brs=/sys/fs/aufs/brs
73
 
for f in /proc/mounts #$brs
74
 
do
 
72
f=/proc/mounts
75
73
test \( $do_update -eq 1 -o $verbose -eq 1 \) -a ! -r $f &&
76
74
eecho ${f}: Permission denied. &&
77
75
exit 1
78
 
done
79
76
 
80
77
f=/etc/mtab
81
78
test ! -r $f -o \( $do_update -eq 1 -a ! -w $f \) &&
88
85
s:^'"$dev $mntpnt $fstype"' ::
89
86
s/\( [0-9]*\)\{2\}$//
90
87
' | tr ',' '\n' > $tmp.old_opt
91
 
test -r $brs &&
92
 
grep "^$e_dev $e_mntpnt " $brs | tail -n 1 | cut -f4- -d' ' >> $tmp.old_opt
93
 
test -w $brs && >> $brs
94
 
#cat $tmp.old_opt; rm -f $tmp $tmp.*; exit
 
88
 
 
89
# append brs from sysfs
 
90
sbi=/sys/fs/aufs/sbi
 
91
sbi_dir=
 
92
if [ -r $sbi ]
 
93
then
 
94
        # pay attention to the order in $sbi
 
95
        for id in $(cat $sbi)
 
96
        do
 
97
                d=/sys/fs/aufs/sbi_$id
 
98
                grep -q "^$mntpnt$" $d/mntpnt1 &&
 
99
                sbi_dir=$d &&
 
100
                break
 
101
        done
 
102
        test "$sbi_dir" -a -r $sbi_dir/br0 &&
 
103
        {
 
104
                cd $sbi_dir
 
105
                ls -1 br* |
 
106
                cut -c3- |
 
107
                sort -n |
 
108
                sed -e 's/^/br/' |
 
109
                xargs -n 200 sed -e 's/^/:/' |
 
110
                tr -d '\n' |
 
111
                sed -e 's/^/br/'
 
112
                echo # last newline
 
113
                cd $OLDPWD
 
114
        } >> $tmp.old_opt
 
115
        #cat $tmp.old_opt; #rm -f $tmp $tmp.*; exit
 
116
fi
95
117
 
96
118
echo "$@" | tr ',' '\n' > $tmp.new_opt
97
119
remount=
178
200
rm $lock || failure "removing lockfile"
179
201
fi
180
202
 
181
 
if [ $verbose -eq 1 ]
182
 
then
 
203
test $verbose -eq 1 &&
183
204
echo "$dev" on "$mntpnt" type "$fstype" \(`echo "$newmtab" | cut -f4 -d' '`\)
184
 
#grep "^$e_dev $e_mntpnt " $brs | tail -n 1 | cut -f4- -d' '
185
 
test -w $brs && >> $brs
186
 
fi
187
205
exit $err