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

« back to all changes in this revision

Viewing changes to init.d/autouse_swap

  • 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
# Only run the first time.
 
4
if [ -f /var/lib/partman/autouse_swap ]; then
 
5
    exit 0
 
6
fi
 
7
[ -d /var/lib/partman ] || mkdir /var/lib/partman
 
8
touch /var/lib/partman/autouse_swap
 
9
 
 
10
. /lib/partman/definitions.sh
 
11
 
 
12
partitions=
 
13
for dev in /var/lib/partman/devices/*; do
 
14
    [ -d "$dev" ] || continue
 
15
    cd $dev
 
16
    open_dialog PARTITIONS
 
17
    while { read_line num id size type fs path name; [ "$id" ]; }; do
 
18
        [ -f $id/detected_filesystem ] || continue
 
19
        fs=$(cat $id/detected_filesystem)
 
20
        if [ "$fs" = linux-swap ]; then
 
21
            partitions="$partitions $dev,$id"
 
22
        fi
 
23
    done
 
24
    close_dialog
 
25
done
 
26
 
 
27
for part in $partitions; do
 
28
    dev=${part%,*}
 
29
    id=${part#*,}
 
30
    [ -d $dev/$id ] || continue
 
31
    echo swap >$dev/$id/method
 
32
    update_partition $dev $id
 
33
done
 
34