util-linux/util-linux-2.11y-skipraid2.patch
cvsdist 67c293319c auto-import changelog data from util-linux-2.11y-9.src.rpm
Mon Feb 24 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt
Wed Feb 19 2003 Elliot Lee <sopwith@redhat.com> 2.11y-8
- ipcs-84243.patch to fix #84243
Thu Feb 13 2003 Yukihiro Nakai <ynakai@redhat.com> 2.11y-7
- Update moremisc patch to fix swprintf()'s minimum field (bug #83361).
Mon Feb 03 2003 Elliot Lee <sopwith@redhat.com> 2.11y-6
- Fix mcookie segfault on many 64-bit architectures (bug #83345).
Mon Feb 03 2003 Tim Waugh <twaugh@redhat.com> 2.11y-5
- Fix underlined multibyte characters (bug #83376).
Sun Feb 02 2003 Florian La Roche <Florian.LaRoche@redhat.de>
- rebuild to have again a s390 rpm
- disable some more apps for mainframe
Wed Jan 29 2003 Elliot Lee <sopwith@redhat.com> 2.11y-4
- util-linux-2.11y-umask-82552.patch
Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt
Mon Jan 13 2003 Elliot Lee <sopwith@redhat.com> 2.11y-2
- Fix #81069, #75421
Mon Jan 13 2003 Elliot Lee <sopwith@redhat.com> 2.11y-1
- Update to 2.11y
- Fix #80953
- Update patch0, patch107, patch117, patch120 for 2.11y
- Remove patch60, patch61, patch207, patch211, patch212, patch119, patch121
- Remove patch122, patch200
Wed Oct 30 2002 Elliot Lee <sopwith@redhat.com> 2.11w-2
- Remove some crack/unnecessary patches while submitting stuff upstream.
- Build with -D_FILE_OFFSET_BITS=64
Tue Oct 29 2002 Elliot Lee <sopwith@redhat.com> 2.11w-1
- Update to 2.11w, resolve patch conflicts
Tue Oct 08 2002 Phil Knirsch <pknirsch@redhat.com> 2.11r-10hammer.3
- Extended util-linux-2.11b-s390x patch to work again.
Thu Oct 03 2002 Elliot Lee <sopwith@redhat.com> 2.11r-10hammer.2
- Add patch122 for hwclock on x86_64
Thu Sep 12 2002 Than Ngo <than@redhat.com> 2.11r-10hammer.1
- Fixed pam config files
Wed Sep 11 2002 Bernhard Rosenkraenzer <bero@redhat.com> 2.11r-10hammer
- Port to hammer
2004-09-13 20:57:34 +00:00

110 lines
3.4 KiB
Diff

--- util-linux-2.11y/mount/linux_fs.h.skipraid2 2002-10-07 09:08:22.000000000 -0400
+++ util-linux-2.11y/mount/linux_fs.h 2003-01-13 14:42:57.000000000 -0500
@@ -13,6 +13,12 @@
#endif
#endif
+#include <inttypes.h>
+#ifndef BLKGETSIZE64
+#include <sys/ioctl.h>
+#define BLKGETSIZE64 _IOR(0x12,114,sizeof(uint64_t))
+#endif
+
#define MINIX_SUPER_MAGIC 0x137F /* minix v1, 14 char names */
#define MINIX_SUPER_MAGIC2 0x138F /* minix v1, 30 char names */
#define MINIX2_SUPER_MAGIC 0x2468 /* minix v2, 14 char names */
--- util-linux-2.11y/mount/get_label_uuid.c.skipraid2 2003-01-13 14:44:04.000000000 -0500
+++ util-linux-2.11y/mount/get_label_uuid.c 2003-01-13 14:46:34.000000000 -0500
@@ -6,6 +6,8 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include <endian.h>
+#include <sys/stat.h>
#include "linux_fs.h"
#include "get_label_uuid.h"
@@ -19,28 +21,62 @@
* not on the disks that form the raid array. This test causes a lot of
* problems when run on my striped promise fasttrak 100 array."
*/
-static inline int
-is_raid_partition(int fd) {
-#if 0
- struct mdp_super_block mdsb;
- int n;
-
- /* hardcode 4096 here in various places, because that's
- what it's defined to be. Note that even if we used
- the actual kernel headers, sizeof(mdp_super_t) is
- slightly larger in the 2.2 kernel on 64-bit archs,
- so using that wouldn't work. */
- lseek(fd, -4096, SEEK_END); /* Ignore possible error
- about return value overflow */
- n = 4096;
- if (sizeof(mdsb) < n)
- n = sizeof(mdsb);
- if (read(fd, &mdsb, n) != n)
- return 1; /* error */
- return (mdsbmagic(mdsb) == MD_SB_MAGIC);
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define INT32_FROM_LE(val) ((unsigned int) ( \
+ (((unsigned int) (val) & (unsigned int) 0x000000ffU) << 24) | \
+ (((unsigned int) (val) & (unsigned int) 0x0000ff00U) << 8) | \
+ (((unsigned int) (val) & (unsigned int) 0x00ff0000U) >> 8) | \
+ (((unsigned int) (val) & (unsigned int) 0xff000000U) >> 24)))
#else
- return 0;
+#define INT32_FROM_LE(val) (val)
+#endif
+
+typedef struct {
+ unsigned int md_magic;
+} mdp_super_t;
+#ifndef MD_SB_MAGIC
+#define MD_SB_MAGIC 0xa92b4efc
+#endif
+#ifndef MD_RESERVED_BYTES
+#define MD_RESERVED_BYTES 65536L
#endif
+#ifndef MD_NEW_SIZE_BYTES
+#define MD_NEW_SIZE_BYTES(x) ((x & ~(MD_RESERVED_BYTES - 1L)) - MD_RESERVED_BYTES)
+#endif
+
+static int
+is_raid_partition(int fd)
+{
+ mdp_super_t mdsb;
+ int n;
+ struct stat sbuf;
+ if(fstat(fd, &sbuf))
+ return 2;
+ if(!sbuf.st_size) {
+ uint64_t bsize64;
+ unsigned int bsize32;
+ if(!ioctl(fd, BLKGETSIZE64, &bsize64))
+ sbuf.st_size = bsize64;
+ else if(!ioctl(fd, BLKGETSIZE, &bsize32))
+ sbuf.st_size = bsize32;
+ }
+ if(!sbuf.st_size) return 3;
+ /* hardcode 4096 here in various places,
+ because that's what it's defined to be.
+ Note that even if we used the actual kernel headers,
+ sizeof(mdp_super_t) is slightly larger in the 2.2 kernel on 64-bit
+ archs, so using that wouldn't work. */
+ lseek(fd, MD_NEW_SIZE_BYTES(sbuf.st_size), SEEK_SET);
+ n = 4096; if(sizeof(mdsb) < n) n = sizeof(mdsb);
+ if(read(fd, &mdsb, n) != n)
+ return 4; /* error */
+ mdsb.md_magic = INT32_FROM_LE(mdsb.md_magic);
+ return (mdsb.md_magic == MD_SB_MAGIC); /* If this device has a
+ RAID superblock at
+ the end, it must be
+ part of a RAID
+ array. */
}
/* for now, only ext2, ext3, xfs, ocfs are supported */