Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 49732
Collapse All | Expand All

(-)./gpart-0.1h.orig/README (-19 / +19 lines)
Lines 24-48 Link Here
24
24
25
 - Currently recognized partitions/filesystems types ---------------------
25
 - Currently recognized partitions/filesystems types ---------------------
26
26
27
   Modname Typ   Description
27
   Modname  Typ   Description
28
   fat     0x01  "Primary DOS with 12 bit FAT"
28
   fat      0x01  "Primary DOS with 12 bit FAT"
29
           0x04  "Primary DOS with 16 bit FAT (<= 32MB)"
29
    	    0x04  "Primary DOS with 16 bit FAT (<= 32MB)"
30
           0x06  "Primary 'big' DOS (> 32MB)"
30
            0x06  "Primary 'big' DOS (> 32MB)"
31
           0x0B  "DOS or Windows 95 with 32 bit FAT"
31
            0x0B  "DOS or Windows 95 with 32 bit FAT"
32
           0x0C  "DOS or Windows 95 with 32 bit FAT, LBA"
32
            0x0C  "DOS or Windows 95 with 32 bit FAT, LBA"
33
   ntfs    0x07  "OS/2 HPFS, NTFS, QNX or Advanced UNIX"
33
   ntfs     0x07  "OS/2 HPFS, NTFS, QNX or Advanced UNIX"
34
   hpfs    0x07  "OS/2 HPFS, NTFS, QNX or Advanced UNIX"
34
   hpfs     0x07  "OS/2 HPFS, NTFS, QNX or Advanced UNIX"
35
   ext2    0x83  "Linux ext2 filesystem"
35
   ext2     0x83  "Linux ext2 filesystem"
36
   lswap   0x82  "Linux swap"
36
   lswap    0x82  "Linux swap"
37
   bsddl   0xA5  "FreeBSD/NetBSD/386BSD"
37
   bsddl    0xA5  "FreeBSD/NetBSD/386BSD"
38
   s86dl   0x82  "Solaris/x86 disklabel"
38
   s86dl    0x82  "Solaris/x86 disklabel"
39
   minix   0x80  "Minix V1"
39
   minix    0x80  "Minix V1"
40
           0x81  "Minix V2"
40
            0x81  "Minix V2"
41
   rfs     0x83  "Reiser filesystem"
41
   reiserfs 0x83  "ReiserFS filesystem"
42
   hmlvm   0xFE  "Linux LVM physical volumes"
42
   hmlvm    0xFE  "Linux LVM physical volumes"
43
   qnx4    0x4F  "QNX 4.x"
43
   qnx4     0x4F  "QNX 4.x"
44
   beos    0xEB  "BeOS fs"
44
   beos     0xEB  "BeOS fs"
45
   xfs     0x83  "SGI XFS filesystem"
45
   xfs      0x83  "SGI XFS filesystem"
46
46
47
47
48
48
(-)./gpart-0.1h.orig/man/gpart.man (-2 / +2 lines)
Lines 63-70 MS Windows NT/2000 filesystem. Link Here
63
.I qnx4
63
.I qnx4
64
QNX 4.x filesystem.
64
QNX 4.x filesystem.
65
.TP
65
.TP
66
.I rfs
66
.I reiserfs
67
The Reiser filesystem (version 3.5.X, X > 11).
67
The Reiser filesystem (version 3.5.X, X > 11, 3.6.X).
68
.TP
68
.TP
69
.I s86dl
69
.I s86dl
70
Sun Solaris on Intel platforms uses a sub-partitioning
70
Sun Solaris on Intel platforms uses a sub-partitioning
(-)./gpart-0.1h.orig/src/Makefile (-1 / +1 lines)
Lines 19-25 CFLAGS+=-DGPART_LANG=\'$(GPART_LANG)\' Link Here
19
endif
19
endif
20
20
21
21
22
mod=ext2 lswap fat bsddl ntfs hpfs s86dl minix rfs hmlvm qnx4 beos xfs
22
mod=ext2 lswap fat bsddl ntfs hpfs s86dl minix reiserfs hmlvm qnx4 beos xfs
23
modobj=$(foreach m,$(mod),gm_$(m).o)
23
modobj=$(foreach m,$(mod),gm_$(m).o)
24
obj=gpart.o gmodules.o disku.o l64seek.o $(modobj)
24
obj=gpart.o gmodules.o disku.o l64seek.o $(modobj)
25
src=$(obj:.o=.c)
25
src=$(obj:.o=.c)
(-)./gpart-0.1h.orig/src/gm_reiserfs.c (+91 lines)
Line 0 Link Here
1
/*      
2
 * gm_reiserfs.c -- gpart ReiserFS guessing module
3
 *
4
 * gpart (c) 1999-2001 Michail Brzitwa <mb@ichabod.han.de>
5
 * Guess PC-type hard disk partitions.
6
 *
7
 * gpart is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published
9
 * by the Free Software Foundation; either version 2, or (at your
10
 * option) any later version.
11
 *
12
 * Created:   21.01.1999 <mb@ichabod.han.de>
13
 * Modified:  26.12.2000 Francis Devereux <francis@devereux.tc>
14
 *            Added reiserfs 3.5.28 support.
15
 * Modified:  10.01.2003 Yury Umanets <umka@namesys.com>
16
 *            Added reiserfs 3.6.x support.
17
 *
18
 */
19
20
#include <string.h>
21
#include <errno.h>
22
#include "gpart.h"
23
#include "gm_reiserfs.h"
24
25
static const char	rcsid[] = "$Id: gm_reiserfs.c,v 1.5 2003/01/10 16:38:08 mb Exp mb $";
26
27
28
int reiserfs_init(disk_desc *d,g_module *m)
29
{
30
	if ((d == 0) || (m == 0))
31
		return (0);
32
33
	m->m_desc = "ReiserFS filesystem";
34
	return (REISERFS_FIRST_BLOCK * 1024 + SB_V35_SIZE);
35
}
36
37
38
39
int reiserfs_term(disk_desc *d)
40
{
41
	return (1);
42
}
43
44
45
46
int reiserfs_gfun(disk_desc *d,g_module *m)
47
{
48
	struct reiserfs_super_block_v35	*sb;
49
	dos_part_entry			*pt = &m->m_part;
50
	s64_t				size;
51
52
	m->m_guess = GM_NO;
53
	sb = (struct reiserfs_super_blockv35 *)(d->d_sbuf + REISERFS_FIRST_BLOCK * 1024);
54
	if (strncmp(sb->s_magic,REISERFS_SUPER_V35_MAGIC,12) == 0 || 
55
	    strncmp(sb->s_magic,REISERFS_SUPER_V36_MAGIC,12) == 0)
56
	{
57
		/*
58
		 * sanity checks.
59
		 */
60
61
		if (sb->s_block_count < sb->s_free_blocks)
62
			return (1);
63
64
		if (sb->s_block_count < REISERFS_MIN_BLOCK_AMOUNT)
65
			return (1);
66
67
		if ((sb->s_state != REISERFS_VALID_FS) &&
68
		    (sb->s_state != REISERFS_ERROR_FS))
69
			return (1);
70
71
		if (sb->s_oid_maxsize % 2) /* must be even */
72
			return (1);
73
74
		if (sb->s_oid_maxsize < sb->s_oid_cursize)
75
			return (1);
76
77
		if ((sb->s_blocksize != 4096) && (sb->s_blocksize != 8192))
78
			return (1);
79
80
		/*
81
		 * ok.
82
		 */
83
84
		m->m_guess = GM_YES;
85
		pt->p_start = d->d_nsb;
86
		size = sb->s_block_count; size *= sb->s_blocksize; size /= d->d_ssize;
87
		pt->p_size = (unsigned long)size;
88
		pt->p_typ = 0x83;
89
	}
90
	return (1);
91
}
(-)./gpart-0.1h.orig/src/gm_reiserfs.h (+82 lines)
Line 0 Link Here
1
/*
2
 * gm_reiserfs.h -- gpart ReiserFS guessing module header
3
 * 
4
 * gpart (c) 1999-2001 Michail Brzitwa <mb@ichabod.han.de>
5
 * Guess PC-type hard disk partitions.
6
 *
7
 * gpart is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published
9
 * by the Free Software Foundation; either version 2, or (at your
10
 * option) any later version.
11
 *
12
 * Created:   21.01.1999 <mb@ichabod.han.de>
13
 * Modified:  26.12.2000 Francis Devereux <francis@devereux.tc>
14
 *            Update support reiserfs version 3.5.28
15
 * Modified:  10.01.2003 Yury Umanets <umka@namesys.com>
16
 *            Added reiserfs 3.6.x support.
17
 *
18
 */
19
20
#ifndef _GM_reiserfs_H
21
#define _GM_reiserfs_H
22
23
/* imported from asm/types.h */
24
typedef __signed__ char __s8;
25
typedef unsigned char __u8;
26
27
typedef __signed__ short __s16;
28
typedef unsigned short __u16;
29
30
typedef __signed__ int __s32;
31
typedef unsigned int __u32;
32
33
/*
34
 * taken from ReiserFS v3.5.28, v3.6.x. Reiserfs Copyright 1996-2000 Hans Reiser
35
 */
36
37
#define REISERFS_SUPER_V35_MAGIC	"ReIsErFs"
38
#define REISERFS_SUPER_V36_MAGIC	"ReIsEr2Fs"
39
40
#define REISERFS_FIRST_BLOCK		64
41
#define REISERFS_VALID_FS		1
42
#define REISERFS_ERROR_FS		2
43
#define REISERFS_MIN_BLOCK_AMOUNT	100
44
45
struct reiserfs_super_block_v35
46
{
47
	__u32 s_block_count;		/* blocks count         */
48
	__u32 s_free_blocks;		/* free blocks count    */
49
	__u32 s_root_block;		/* root block number    */
50
	__u32 s_journal_block;		/* journal block number    */
51
	__u32 s_journal_dev;		/* journal device number  */
52
	__u32 s_orig_journal_size;	/* size of the journal on FS creation.  used to make sure they don't overflow it */
53
	__u32 s_journal_trans_max;	/* max number of blocks in a transaction.  */
54
	__u32 s_journal_block_count;	/* total size of the journal. can change over time  */
55
	__u32 s_journal_max_batch;	/* max number of blocks to batch into a trans */
56
	__u32 s_journal_max_commit_age;	/* in seconds, how old can an async commit be */
57
	__u32 s_journal_max_trans_age;	/* in seconds, how old can a transaction be */
58
	__u16 s_blocksize;		/* block size           */
59
	__u16 s_oid_maxsize;		/* max size of object id array, see get_objectid() commentary  */
60
	__u16 s_oid_cursize;		/* current size of object id array */
61
	__u16 s_state;			/* valid or error       */
62
	char s_magic[12];		/* reiserfs magic string indicates that file system is reiserfs */
63
	__u32 s_hash_function_code;	/* indicate, what hash fuction is being use to sort names in a directory*/
64
	__u16 s_tree_height;		/* height of disk tree */
65
	__u16 s_bmap_nr;		/* amount of bitmap blocks needed to address each block of file system */
66
	__u16 s_reserved;
67
};
68
69
#define SB_V35_SIZE (sizeof(struct reiserfs_super_block_v35))
70
71
struct reiserfs_super_block_v36 {
72
	struct reiserfs_super_block_v35 s_v35;
73
	__u32 s_inode_generation; 
74
	__u32 s_flags;
75
	char s_uuid[16];
76
	char s_label[16];
77
	char s_unused[88];
78
};
79
80
#define SB_V36_SIZE (sizeof(struct reiserfs_super_block_v36))
81
82
#endif /* _GM_REISERFS_H */
(-)./gpart-0.1h.orig/src/gm_rfs.c (-88 lines)
Lines 1-88 Link Here
1
/*      
2
 * gm_rfs.c -- gpart ReiserFS guessing module
3
 *
4
 * gpart (c) 1999-2001 Michail Brzitwa <mb@ichabod.han.de>
5
 * Guess PC-type hard disk partitions.
6
 *
7
 * gpart is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published
9
 * by the Free Software Foundation; either version 2, or (at your
10
 * option) any later version.
11
 *
12
 * Created:   21.01.1999 <mb@ichabod.han.de>
13
 * Modified:  26.12.2000 Francis Devereux <francis@devereux.tc>
14
 *            Added reiserfs 3.5.28 support.
15
 *
16
 */
17
18
#include <string.h>
19
#include <errno.h>
20
#include "gpart.h"
21
#include "gm_rfs.h"
22
23
static const char	rcsid[] = "$Id: gm_rfs.c,v 1.5 2001/02/07 18:08:08 mb Exp mb $";
24
25
26
int rfs_init(disk_desc *d,g_module *m)
27
{
28
	if ((d == 0) || (m == 0))
29
		return (0);
30
31
	m->m_desc = "Reiser filesystem";
32
	return (REISERFS_FIRST_BLOCK * 1024 + SB_SIZE);
33
}
34
35
36
37
int rfs_term(disk_desc *d)
38
{
39
	return (1);
40
}
41
42
43
44
int rfs_gfun(disk_desc *d,g_module *m)
45
{
46
	struct reiserfs_super_block	*sb;
47
	dos_part_entry			*pt = &m->m_part;
48
	s64_t				size;
49
50
	m->m_guess = GM_NO;
51
	sb = (struct reiserfs_super_block *)(d->d_sbuf + REISERFS_FIRST_BLOCK * 1024);
52
	if (strncmp(sb->s_magic,REISERFS_SUPER_MAGIC,12) == 0)
53
	{
54
		/*
55
		 * sanity checks.
56
		 */
57
58
		if (sb->s_block_count < sb->s_free_blocks)
59
			return (1);
60
61
		if (sb->s_block_count < REISERFS_MIN_BLOCK_AMOUNT)
62
			return (1);
63
64
		if ((sb->s_state != REISERFS_VALID_FS) &&
65
		    (sb->s_state != REISERFS_ERROR_FS))
66
			return (1);
67
68
		if (sb->s_oid_maxsize % 2) /* must be even */
69
			return (1);
70
71
		if (sb->s_oid_maxsize < sb->s_oid_cursize)
72
			return (1);
73
74
		if ((sb->s_blocksize != 4096) && (sb->s_blocksize != 8192))
75
			return (1);
76
77
		/*
78
		 * ok.
79
		 */
80
81
		m->m_guess = GM_YES;
82
		pt->p_start = d->d_nsb;
83
		size = sb->s_block_count; size *= sb->s_blocksize; size /= d->d_ssize;
84
		pt->p_size = (unsigned long)size;
85
		pt->p_typ = 0x83;
86
	}
87
	return (1);
88
}
(-)./gpart-0.1h.orig/src/gm_rfs.h (-68 lines)
Lines 1-68 Link Here
1
/*
2
 * gm_rfs.h -- gpart ReiserFS guessing module header
3
 * 
4
 * gpart (c) 1999-2001 Michail Brzitwa <mb@ichabod.han.de>
5
 * Guess PC-type hard disk partitions.
6
 *
7
 * gpart is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published
9
 * by the Free Software Foundation; either version 2, or (at your
10
 * option) any later version.
11
 *
12
 * Created:   21.01.1999 <mb@ichabod.han.de>
13
 * Modified:  26.12.2000 Francis Devereux <francis@devereux.tc>
14
 *            Update support reiserfs version 3.5.28
15
 *
16
 */
17
18
#ifndef _GM_RFS_H
19
#define _GM_RFS_H
20
21
/* imported from asm/types.h */
22
typedef __signed__ char __s8;
23
typedef unsigned char __u8;
24
25
typedef __signed__ short __s16;
26
typedef unsigned short __u16;
27
28
typedef __signed__ int __s32;
29
typedef unsigned int __u32;
30
31
/*
32
 * taken from ReiserFS v3.5.28. Reiserfs Copyright 1996-2000 Hans Reiser
33
 */
34
35
#define REISERFS_SUPER_MAGIC		"ReIsErFs"
36
#define REISERFS_FIRST_BLOCK		64
37
#define REISERFS_VALID_FS		1
38
#define REISERFS_ERROR_FS		2
39
#define REISERFS_MIN_BLOCK_AMOUNT	100
40
41
struct reiserfs_super_block
42
{
43
	__u32 s_block_count;		/* blocks count         */
44
	__u32 s_free_blocks;		/* free blocks count    */
45
	__u32 s_root_block;		/* root block number    */
46
	__u32 s_journal_block;		/* journal block number    */
47
	__u32 s_journal_dev;		/* journal device number  */
48
	__u32 s_orig_journal_size;	/* size of the journal on FS creation.  used to make sure they don't overflow it */
49
	__u32 s_journal_trans_max;	/* max number of blocks in a transaction.  */
50
	__u32 s_journal_block_count;	/* total size of the journal. can change over time  */
51
	__u32 s_journal_max_batch;	/* max number of blocks to batch into a trans */
52
	__u32 s_journal_max_commit_age;	/* in seconds, how old can an async commit be */
53
	__u32 s_journal_max_trans_age;	/* in seconds, how old can a transaction be */
54
	__u16 s_blocksize;		/* block size           */
55
	__u16 s_oid_maxsize;		/* max size of object id array, see get_objectid() commentary  */
56
	__u16 s_oid_cursize;		/* current size of object id array */
57
	__u16 s_state;			/* valid or error       */
58
	char s_magic[12];		/* reiserfs magic string indicates that file system is reiserfs */
59
	__u32 s_hash_function_code;	/* indicate, what hash fuction is being use to sort names in a directory*/
60
	__u16 s_tree_height;		/* height of disk tree */
61
	__u16 s_bmap_nr;		/* amount of bitmap blocks needed to address each block of file system */
62
	__u16 s_reserved;
63
};
64
65
#define SB_SIZE (sizeof(struct reiserfs_super_block))
66
67
68
#endif /* _GM_RFS_H */
(-)./gpart-0.1h.orig/src/gmodules.c (-1 / +1 lines)
Lines 154-160 void g_mod_addinternals() Link Here
154
	GMODINS(bsddl);
154
	GMODINS(bsddl);
155
	GMODINS(lswap);
155
	GMODINS(lswap);
156
	GMODINS(qnx4);
156
	GMODINS(qnx4);
157
	GMODINS(rfs);
157
	GMODINS(reiserfs);
158
	GMODINS(ntfs);
158
	GMODINS(ntfs);
159
	GMODINS(hpfs);
159
	GMODINS(hpfs);
160
	GMODINS(minix);
160
	GMODINS(minix);
(-)./gpart-0.1h.orig/src/gmodules.h (-1 / +1 lines)
Lines 63-69 g_module *g_mod_setweight(char *,float); Link Here
63
63
64
GMODDECL(bsddl); GMODDECL(ext2); GMODDECL(fat);
64
GMODDECL(bsddl); GMODDECL(ext2); GMODDECL(fat);
65
GMODDECL(hpfs); GMODDECL(lswap); GMODDECL(ntfs);
65
GMODDECL(hpfs); GMODDECL(lswap); GMODDECL(ntfs);
66
GMODDECL(s86dl); GMODDECL(minix); GMODDECL(rfs);
66
GMODDECL(s86dl); GMODDECL(minix); GMODDECL(reiserfs);
67
GMODDECL(hmlvm); GMODDECL(qnx4); GMODDECL(beos);
67
GMODDECL(hmlvm); GMODDECL(qnx4); GMODDECL(beos);
68
GMODDECL(xfs);
68
GMODDECL(xfs);
69
69

Return to bug 49732