~ubuntu-branches/ubuntu/hardy/partman-basicfilesystems/hardy-updates

« back to all changes in this revision

Viewing changes to fstab.d/basic

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2004-10-06 02:44:52 UTC
  • Revision ID: james.westby@ubuntu.com-20041006024452-dqyxcwf0tarnj0qr
Tags: 26ubuntu1
Set pass field to 0 for FAT filesystems, to prevent filesystem checks
that sometimes behave strangely (closes: Ubuntu #1912).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
. /lib/partman/definitions.sh
 
4
 
 
5
for dev in $DEVICES/*; do
 
6
        [ -d $dev ] || continue
 
7
        cd $dev
 
8
        open_dialog PARTITIONS
 
9
        while { read_line num id size type fs path name; [ "$id" ]; }; do
 
10
            [ $fs != free ] || continue
 
11
            [ -f "$id/method" ] || continue
 
12
            [ -f "$id/acting_filesystem" ] || continue
 
13
            method=$(cat $id/method)
 
14
            filesystem=$(cat $id/acting_filesystem)
 
15
            if [ "$method" = swap ]; then
 
16
                echo "$path" none swap sw 0 0
 
17
            fi
 
18
            case "$filesystem" in
 
19
                ext2)
 
20
                    [ -f "$id/mountpoint" ] || continue
 
21
                    mountpoint=$(cat $id/mountpoint)
 
22
                    if [ -f "$id/mountoptions" ]; then
 
23
                        options=$(cat $id/mountoptions | sed 's/ //g')
 
24
                    else
 
25
                        options=''
 
26
                    fi
 
27
                    if [ -z "$options" ]; then
 
28
                        options=defaults
 
29
                    fi
 
30
                    if [ "$mountpoint" = / ]; then
 
31
                        options="${options},errors=remount-ro"
 
32
                        pass=1
 
33
                    else
 
34
                        pass=2
 
35
                    fi
 
36
                    echo "$path" "$mountpoint" ext2 $options 0 $pass
 
37
                    ;;
 
38
                fat16|fat32)
 
39
                    [ -f "$id/mountpoint" ] || continue
 
40
                    mountpoint=$(cat $id/mountpoint)
 
41
                    options=''
 
42
                    if [ -f "$id/fatmountoptions" ]; then
 
43
                        options=$(cat $id/fatmountoptions | sed 's/ //g')
 
44
                    fi
 
45
                    if [ -z "$options" ]; then
 
46
                        options=defaults
 
47
                    fi
 
48
                    echo "$path" "$mountpoint" vfat $options 0 0
 
49
                    ;;
 
50
            esac
 
51
        done
 
52
        close_dialog
 
53
done
 
54