In Incoming now... -- Steve McIntyre, Cambridge, UK. [EMAIL PROTECTED] "Since phone messaging became popular, the young generation has lost the ability to read or write anything that is longer than one hundred and sixty characters." -- Ignatios Souvatzis
diff -u gpart-0.1h/debian/changelog gpart-0.1h/debian/changelog --- gpart-0.1h/debian/changelog +++ gpart-0.1h/debian/changelog @@ -1,3 +1,18 @@ +gpart (0.1h-4.1) unstable; urgency=medium + + * NMU from the Cambridge BSP + * Rather than attempt to use the syscall(!) interface for 64-bit lseek, + simply compile to use the 64-bit VFS interface and use the normal + lseek calls. Let libc deal with the issues... + Closes: #225578, #294836, #393039. + * Applied the reiserfs 3.6 recognition patch from + ftp://ftp.namesys.com/pub/misc-patches/gpart-0.1h-reiserfs-3.6.patch.gz + Closes: #246989, #322256 + * Recogniise ext3 filesystems as well as ext2. Thanks to Xisco Calafat + for the patch. Closes: #212989 + + -- Steve McIntyre <[EMAIL PROTECTED]> Sat, 28 Oct 2006 22:50:42 +0100 + gpart (0.1h-4) unstable; urgency=low * recompile to resolve errno problem; no changes required only in patch2: unchanged: --- gpart-0.1h.orig/src/l64seek.c +++ gpart-0.1h/src/l64seek.c @@ -25,30 +25,11 @@ } ostck[OSTACKLEN]; static int osptr = -1; -#if defined(__linux__) && defined(__i386__) -_syscall5(int,_llseek,uint,fd,ulong,hi,ulong,lo,loff_t *,res,uint,wh) -#endif - - - off64_t l64seek(int fd,off64_t offset,int whence) { off64_t ret = (off64_t)-1; -#if defined(__linux__) && defined(__i386__) - int iret; - unsigned long ohi, olo; - - ohi = (unsigned long)((offset >> 32) & 0xFFFFFFFF); - olo = (unsigned long)(offset & 0xFFFFFFFF); - iret = _llseek(fd,ohi,olo,&ret,whence); - if (iret == -1) - ret = (off64_t)-1; -#endif - -#if defined(__FreeBSD__) || (defined(__linux__) && defined(__alpha__)) ret = lseek(fd,offset,whence); -#endif return (ret); } only in patch2: unchanged: --- gpart-0.1h.orig/src/l64seek.h +++ gpart-0.1h/src/l64seek.h @@ -17,6 +17,8 @@ #ifndef _L64SEEK_H #define _L64SEEK_H +#include <sys/stat.h> +#include <sys/types.h> #include <unistd.h> /* @@ -25,19 +27,7 @@ * offsets. */ - -#if defined(__linux__) -# include <linux/unistd.h> -# include <sys/types.h> - typedef int64_t off64_t; -#endif - - -#if defined(__FreeBSD__) - typedef off_t off64_t; -#endif - - +typedef loff_t off64_t; typedef off64_t s64_t; off64_t l64seek(int fd, off64_t offset, int whence); @@ -45,5 +35,4 @@ int l64opush(int); s64_t l64opop(int); - #endif only in patch2: unchanged: --- gpart-0.1h.orig/src/gmodules.c +++ gpart-0.1h/src/gmodules.c @@ -154,7 +154,7 @@ GMODINS(bsddl); GMODINS(lswap); GMODINS(qnx4); - GMODINS(rfs); + GMODINS(reiserfs); GMODINS(ntfs); GMODINS(hpfs); GMODINS(minix); only in patch2: unchanged: --- gpart-0.1h.orig/src/disku.c +++ gpart-0.1h/src/disku.c @@ -19,6 +19,7 @@ #include <stdio.h> #include <string.h> #include <sys/ioctl.h> +#include <errno.h> #include "gpart.h" #if defined(__linux__) only in patch2: unchanged: --- gpart-0.1h.orig/src/Makefile +++ gpart-0.1h/src/Makefile @@ -7,6 +7,8 @@ CFLAGS+=-DVERSION=\"$(version)\" ifeq ($(shell uname),Linux) LIBS=-ldl +CFLAGS += -D__USE_FILE_OFFSET64 -D__USE_LARGEFILE64 +CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 endif ifdef DEBUG @@ -19,7 +21,7 @@ endif -mod=ext2 lswap fat bsddl ntfs hpfs s86dl minix rfs hmlvm qnx4 beos xfs +mod=ext2 lswap fat bsddl ntfs hpfs s86dl minix reiserfs hmlvm qnx4 beos xfs modobj=$(foreach m,$(mod),gm_$(m).o) obj=gpart.o gmodules.o disku.o l64seek.o $(modobj) src=$(obj:.o=.c) only in patch2: unchanged: --- gpart-0.1h.orig/src/gm_ext2.c +++ gpart-0.1h/src/gm_ext2.c @@ -121,9 +121,10 @@ /* * current mount count shouldn't be greater than max+20 + * but ext3 usually has s_max_mnt_count==-1 */ - if (sb->s_mnt_count > sb->s_max_mnt_count + 20) + if ((sb->s_max_mnt_count!=-1)&&(sb->s_mnt_count > sb->s_max_mnt_count + 20)) return (1); /* only in patch2: unchanged: --- gpart-0.1h.orig/src/gmodules.h +++ gpart-0.1h/src/gmodules.h @@ -63,7 +63,7 @@ GMODDECL(bsddl); GMODDECL(ext2); GMODDECL(fat); GMODDECL(hpfs); GMODDECL(lswap); GMODDECL(ntfs); -GMODDECL(s86dl); GMODDECL(minix); GMODDECL(rfs); +GMODDECL(s86dl); GMODDECL(minix); GMODDECL(reiserfs); GMODDECL(hmlvm); GMODDECL(qnx4); GMODDECL(beos); GMODDECL(xfs); only in patch2: unchanged: --- gpart-0.1h.orig/src/gm_reiserfs.c +++ gpart-0.1h/src/gm_reiserfs.c @@ -0,0 +1,91 @@ +/* + * gm_reiserfs.c -- gpart ReiserFS guessing module + * + * gpart (c) 1999-2001 Michail Brzitwa <[EMAIL PROTECTED]> + * Guess PC-type hard disk partitions. + * + * gpart is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * Created: 21.01.1999 <[EMAIL PROTECTED]> + * Modified: 26.12.2000 Francis Devereux <[EMAIL PROTECTED]> + * Added reiserfs 3.5.28 support. + * Modified: 10.01.2003 Yury Umanets <[EMAIL PROTECTED]> + * Added reiserfs 3.6.x support. + * + */ + +#include <string.h> +#include <errno.h> +#include "gpart.h" +#include "gm_reiserfs.h" + +static const char rcsid[] = "$Id: gm_reiserfs.c,v 1.5 2003/01/10 16:38:08 mb Exp mb $"; + + +int reiserfs_init(disk_desc *d,g_module *m) +{ + if ((d == 0) || (m == 0)) + return (0); + + m->m_desc = "ReiserFS filesystem"; + return (REISERFS_FIRST_BLOCK * 1024 + SB_V35_SIZE); +} + + + +int reiserfs_term(disk_desc *d) +{ + return (1); +} + + + +int reiserfs_gfun(disk_desc *d,g_module *m) +{ + struct reiserfs_super_block_v35 *sb; + dos_part_entry *pt = &m->m_part; + s64_t size; + + m->m_guess = GM_NO; + sb = (struct reiserfs_super_blockv35 *)(d->d_sbuf + REISERFS_FIRST_BLOCK * 1024); + if (strncmp(sb->s_magic,REISERFS_SUPER_V35_MAGIC,12) == 0 || + strncmp(sb->s_magic,REISERFS_SUPER_V36_MAGIC,12) == 0) + { + /* + * sanity checks. + */ + + if (sb->s_block_count < sb->s_free_blocks) + return (1); + + if (sb->s_block_count < REISERFS_MIN_BLOCK_AMOUNT) + return (1); + + if ((sb->s_state != REISERFS_VALID_FS) && + (sb->s_state != REISERFS_ERROR_FS)) + return (1); + + if (sb->s_oid_maxsize % 2) /* must be even */ + return (1); + + if (sb->s_oid_maxsize < sb->s_oid_cursize) + return (1); + + if ((sb->s_blocksize != 4096) && (sb->s_blocksize != 8192)) + return (1); + + /* + * ok. + */ + + m->m_guess = GM_YES; + pt->p_start = d->d_nsb; + size = sb->s_block_count; size *= sb->s_blocksize; size /= d->d_ssize; + pt->p_size = (unsigned long)size; + pt->p_typ = 0x83; + } + return (1); +} only in patch2: unchanged: --- gpart-0.1h.orig/src/gm_reiserfs.h +++ gpart-0.1h/src/gm_reiserfs.h @@ -0,0 +1,82 @@ +/* + * gm_reiserfs.h -- gpart ReiserFS guessing module header + * + * gpart (c) 1999-2001 Michail Brzitwa <[EMAIL PROTECTED]> + * Guess PC-type hard disk partitions. + * + * gpart is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * Created: 21.01.1999 <[EMAIL PROTECTED]> + * Modified: 26.12.2000 Francis Devereux <[EMAIL PROTECTED]> + * Update support reiserfs version 3.5.28 + * Modified: 10.01.2003 Yury Umanets <[EMAIL PROTECTED]> + * Added reiserfs 3.6.x support. + * + */ + +#ifndef _GM_reiserfs_H +#define _GM_reiserfs_H + +/* imported from asm/types.h */ +typedef __signed__ char __s8; +typedef unsigned char __u8; + +typedef __signed__ short __s16; +typedef unsigned short __u16; + +typedef __signed__ int __s32; +typedef unsigned int __u32; + +/* + * taken from ReiserFS v3.5.28, v3.6.x. Reiserfs Copyright 1996-2000 Hans Reiser + */ + +#define REISERFS_SUPER_V35_MAGIC "ReIsErFs" +#define REISERFS_SUPER_V36_MAGIC "ReIsEr2Fs" + +#define REISERFS_FIRST_BLOCK 64 +#define REISERFS_VALID_FS 1 +#define REISERFS_ERROR_FS 2 +#define REISERFS_MIN_BLOCK_AMOUNT 100 + +struct reiserfs_super_block_v35 +{ + __u32 s_block_count; /* blocks count */ + __u32 s_free_blocks; /* free blocks count */ + __u32 s_root_block; /* root block number */ + __u32 s_journal_block; /* journal block number */ + __u32 s_journal_dev; /* journal device number */ + __u32 s_orig_journal_size; /* size of the journal on FS creation. used to make sure they don't overflow it */ + __u32 s_journal_trans_max; /* max number of blocks in a transaction. */ + __u32 s_journal_block_count; /* total size of the journal. can change over time */ + __u32 s_journal_max_batch; /* max number of blocks to batch into a trans */ + __u32 s_journal_max_commit_age; /* in seconds, how old can an async commit be */ + __u32 s_journal_max_trans_age; /* in seconds, how old can a transaction be */ + __u16 s_blocksize; /* block size */ + __u16 s_oid_maxsize; /* max size of object id array, see get_objectid() commentary */ + __u16 s_oid_cursize; /* current size of object id array */ + __u16 s_state; /* valid or error */ + char s_magic[12]; /* reiserfs magic string indicates that file system is reiserfs */ + __u32 s_hash_function_code; /* indicate, what hash fuction is being use to sort names in a directory*/ + __u16 s_tree_height; /* height of disk tree */ + __u16 s_bmap_nr; /* amount of bitmap blocks needed to address each block of file system */ + __u16 s_reserved; +}; + +#define SB_V35_SIZE (sizeof(struct reiserfs_super_block_v35)) + +struct reiserfs_super_block_v36 { + struct reiserfs_super_block_v35 s_v35; + __u32 s_inode_generation; + __u32 s_flags; + char s_uuid[16]; + char s_label[16]; + char s_unused[88]; +}; + +#define SB_V36_SIZE (sizeof(struct reiserfs_super_block_v36)) + +#endif /* _GM_REISERFS_H */ only in patch2: unchanged: --- gpart-0.1h.orig/man/gpart.man +++ gpart-0.1h/man/gpart.man @@ -63,8 +63,8 @@ .I qnx4 QNX 4.x filesystem. .TP -.I rfs -The Reiser filesystem (version 3.5.X, X > 11). +.I reiserfs +The Reiser filesystem (version 3.5.X, X > 11, 3.6.X). .TP .I s86dl Sun Solaris on Intel platforms uses a sub-partitioning only in patch2: unchanged: --- gpart-0.1h.orig/README +++ gpart-0.1h/README @@ -24,25 +24,25 @@ - Currently recognized partitions/filesystems types --------------------- - Modname Typ Description - fat 0x01 "Primary DOS with 12 bit FAT" - 0x04 "Primary DOS with 16 bit FAT (<= 32MB)" - 0x06 "Primary 'big' DOS (> 32MB)" - 0x0B "DOS or Windows 95 with 32 bit FAT" - 0x0C "DOS or Windows 95 with 32 bit FAT, LBA" - ntfs 0x07 "OS/2 HPFS, NTFS, QNX or Advanced UNIX" - hpfs 0x07 "OS/2 HPFS, NTFS, QNX or Advanced UNIX" - ext2 0x83 "Linux ext2 filesystem" - lswap 0x82 "Linux swap" - bsddl 0xA5 "FreeBSD/NetBSD/386BSD" - s86dl 0x82 "Solaris/x86 disklabel" - minix 0x80 "Minix V1" - 0x81 "Minix V2" - rfs 0x83 "Reiser filesystem" - hmlvm 0xFE "Linux LVM physical volumes" - qnx4 0x4F "QNX 4.x" - beos 0xEB "BeOS fs" - xfs 0x83 "SGI XFS filesystem" + Modname Typ Description + fat 0x01 "Primary DOS with 12 bit FAT" + 0x04 "Primary DOS with 16 bit FAT (<= 32MB)" + 0x06 "Primary 'big' DOS (> 32MB)" + 0x0B "DOS or Windows 95 with 32 bit FAT" + 0x0C "DOS or Windows 95 with 32 bit FAT, LBA" + ntfs 0x07 "OS/2 HPFS, NTFS, QNX or Advanced UNIX" + hpfs 0x07 "OS/2 HPFS, NTFS, QNX or Advanced UNIX" + ext2 0x83 "Linux ext2 filesystem" + lswap 0x82 "Linux swap" + bsddl 0xA5 "FreeBSD/NetBSD/386BSD" + s86dl 0x82 "Solaris/x86 disklabel" + minix 0x80 "Minix V1" + 0x81 "Minix V2" + reiserfs 0x83 "ReiserFS filesystem" + hmlvm 0xFE "Linux LVM physical volumes" + qnx4 0x4F "QNX 4.x" + beos 0xEB "BeOS fs" + xfs 0x83 "SGI XFS filesystem"
signature.asc
Description: Digital signature