~elementary-os/ubuntu-package-imports/ubiquity-bionic

« back to all changes in this revision

Viewing changes to d-i/source/partman-basicfilesystems/check.d/check_swap

  • Committer: RabbitBot
  • Date: 2018-02-05 14:44:42 UTC
  • Revision ID: rabbitbot@elementary.io-20180205144442-vt0fvth7zus90wjh
Initial import, version 17.10.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
. /lib/partman/lib/base.sh
 
4
 
 
5
swap=false
 
6
 
 
7
for dev in $DEVICES/*; do
 
8
        [ -d "$dev" ] || continue
 
9
        cd $dev
 
10
        partitions=
 
11
        open_dialog PARTITIONS
 
12
        while { read_line num id size type fs path name; [ "$id" ]; }; do
 
13
                [ "$fs" != free ] || continue
 
14
                partitions="$partitions $id,$num"
 
15
        done
 
16
        close_dialog
 
17
 
 
18
        for part in $partitions; do
 
19
                id=${part%,*}
 
20
                num=${part#*,}
 
21
                [ -f $id/method ] || continue
 
22
                method=$(cat $id/method)
 
23
                if [ "$method" = swap ]; then
 
24
                        swap=:
 
25
                fi
 
26
        done
 
27
done
 
28
 
 
29
if ! $swap; then
 
30
        db_input medium partman-basicfilesystems/no_swap || true
 
31
        db_go || true
 
32
        db_get partman-basicfilesystems/no_swap
 
33
        if [ "$RET" = true ]; then
 
34
                exit 1
 
35
        fi
 
36
fi