~ubuntu-branches/ubuntu/natty/partman-reiserfs/natty

« back to all changes in this revision

Viewing changes to fstab.d/reiserfs

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-03-04 20:22:36 UTC
  • Revision ID: james.westby@ubuntu.com-20080304202236-3eqvszfyldcnpulx
Tags: 39ubuntu1
* Add Choices-C entries for mount options.
* Default to mounting reiserfs with relatime (LP: #160450).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
 
3
 
. /lib/partman/definitions.sh
 
3
. /lib/partman/lib/base.sh
4
4
 
5
5
has_boot=no
6
6
for dev in $DEVICES/*; do
7
 
    [ -d $dev ] || continue
8
 
    cd $dev
9
 
    open_dialog PARTITIONS
10
 
    while { read_line num id size type fs path name; [ "$id" ]; }; do
11
 
        [ $fs != free ] || continue
12
 
        [ -f "$id/method" ] || continue
13
 
        [ -f "$id/acting_filesystem" ] || continue
14
 
        [ -f "$id/mountpoint" ] || continue
15
 
        mountpoint=$(cat $id/mountpoint)
16
 
        if [ "$mountpoint" = /boot ]; then
17
 
            has_boot=yes
18
 
        fi
19
 
    done
20
 
    close_dialog
 
7
        [ -d $dev ] || continue
 
8
        cd $dev
 
9
        open_dialog PARTITIONS
 
10
        while { read_line num id size type fs path name; [ "$id" ]; }; do
 
11
                [ $fs != free ] || continue
 
12
                [ -f "$id/method" ] || continue
 
13
                [ -f "$id/acting_filesystem" ] || continue
 
14
                [ -f "$id/mountpoint" ] || continue
 
15
                mountpoint=$(cat $id/mountpoint)
 
16
                if [ "$mountpoint" = /boot ]; then
 
17
                        has_boot=yes
 
18
                fi
 
19
        done
 
20
        close_dialog
21
21
done
22
22
 
23
23
for dev in $DEVICES/*; do
24
 
    [ -d $dev ] || continue
25
 
    cd $dev
26
 
    open_dialog PARTITIONS
27
 
    while { read_line num id size type fs path name; [ "$id" ]; }; do
28
 
        [ $fs != free ] || continue
29
 
        [ -f "$id/method" ] || continue
30
 
        [ -f "$id/acting_filesystem" ] || continue
31
 
        [ -f "$id/mountpoint" ] || continue
32
 
        mountpoint=$(cat $id/mountpoint)
33
 
        filesystem=$(cat $id/acting_filesystem)
34
 
        case "$filesystem" in
35
 
            reiserfs)
36
 
                # due to #249322, #255135, #258117:
37
 
                if [ "$mountpoint" = /tmp ]; then
38
 
                    rm -f $id/options/noexec
39
 
                fi
40
 
                if [ "$mountpoint" = /boot \
41
 
                     -o \( "$mountpoint" = / -a "$has_boot" = no \) ]; then
42
 
                        > $id/options/notail
43
 
                fi
44
 
                options=$(get_mountoptions $dev $id)
45
 
                if [ "$mountpoint" = / ]; then
46
 
                        pass=1
47
 
                else
48
 
                        pass=2
49
 
                fi
50
 
                echo "$path" "$mountpoint" reiserfs $options 0 $pass
51
 
                ;;
52
 
        esac
53
 
    done
54
 
    close_dialog
 
24
        [ -d $dev ] || continue
 
25
        cd $dev
 
26
        open_dialog PARTITIONS
 
27
        while { read_line num id size type fs path name; [ "$id" ]; }; do
 
28
                [ $fs != free ] || continue
 
29
                [ -f "$id/method" ] || continue
 
30
                [ -f "$id/acting_filesystem" ] || continue
 
31
                [ -f "$id/mountpoint" ] || continue
 
32
                mountpoint=$(cat $id/mountpoint)
 
33
                filesystem=$(cat $id/acting_filesystem)
 
34
                case "$filesystem" in
 
35
                    reiserfs)
 
36
                        # due to #249322, #255135, #258117:
 
37
                        if [ "$mountpoint" = /tmp ]; then
 
38
                                rm -f $id/options/noexec
 
39
                        fi
 
40
                        if [ "$mountpoint" = /boot ] || \
 
41
                           ([ "$mountpoint" = / ] && [ "$has_boot" = no ]); then
 
42
                                > $id/options/notail
 
43
                        fi
 
44
                        options=$(get_mountoptions $dev $id)
 
45
                        if [ "$mountpoint" = / ]; then
 
46
                                pass=1
 
47
                        else
 
48
                                pass=2
 
49
                        fi
 
50
                        echo "$path" "$mountpoint" reiserfs $options 0 $pass
 
51
                        ;;
 
52
                esac
 
53
        done
 
54
        close_dialog
55
55
done