~pr0gg3d/ubuntu/oneiric/util-linux/bug-805886

« back to all changes in this revision

Viewing changes to shlibs/blkid/src/probers/minix.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2009-07-16 15:48:23 UTC
  • mfrom: (1.3.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090716154823-i26fshvs4v8h90qh
Tags: 2.16-1ubuntu1
* Merge from Debian, remaining changes:
  - Since udev is required in Ubuntu, the hwclock.sh init script is
    not called on startup and the hwclockfirst.sh init script is
    removed.
  - Remove /etc/adjtime on upgrade if it was not used.
  - Install custom blkid.conf to use /dev/.blkid.tab since we don't
    expect device names to survive a reboot
  - No lsb_release call in mount.preinst since we'd need Pre-Depends
    (LP: #383697).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 1999 by Andries Brouwer
 
3
 * Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
 
4
 * Copyright (C) 2001 by Andreas Dilger
 
5
 * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
 
6
 * Copyright (C) 2008 Karel Zak <kzak@redhat.com>
 
7
 *
 
8
 * This file may be redistributed under the terms of the
 
9
 * GNU Lesser General Public License.
 
10
 */
 
11
 
 
12
#include "blkidP.h"
 
13
 
 
14
static int probe_minix(blkid_probe pr, const struct blkid_idmag *mag)
 
15
{
 
16
        /* for more details see magic strings below */
 
17
        switch(mag->magic[1]) {
 
18
        case '\023':
 
19
                blkid_probe_set_version(pr, "1");
 
20
                break;
 
21
        case '\044':
 
22
                blkid_probe_set_version(pr, "2");
 
23
                break;
 
24
        case '\115':
 
25
                blkid_probe_set_version(pr, "3");
 
26
                break;
 
27
        }
 
28
        return 0;
 
29
}
 
30
 
 
31
const struct blkid_idinfo minix_idinfo =
 
32
{
 
33
        .name           = "minix",
 
34
        .usage          = BLKID_USAGE_FILESYSTEM,
 
35
        .probefunc      = probe_minix,
 
36
        .magics         =
 
37
        {
 
38
                /* version 1 */
 
39
                { .magic = "\177\023", .len = 2, .kboff = 1, .sboff = 0x10 },
 
40
                { .magic = "\217\023", .len = 2, .kboff = 1, .sboff = 0x10 },
 
41
 
 
42
                /* version 2 */
 
43
                { .magic = "\150\044", .len = 2, .kboff = 1, .sboff = 0x10 },
 
44
                { .magic = "\170\044", .len = 2, .kboff = 1, .sboff = 0x10 },
 
45
 
 
46
                /* version 3 */
 
47
                { .magic = "\132\115", .len = 2, .kboff = 1, .sboff = 0x18 },
 
48
                { NULL }
 
49
        }
 
50
};
 
51