mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.6 KiB

  1. gentoo's util-linux-2.12-linux-headers-2.6.0-fix.patch, with
  2. my_dev_t defined as __u32 not int (__kernel_dev_t is __u32)
  3. --- ./disk-utils/blockdev.c.orig 2002-03-09 00:57:02.000000000 +0200
  4. +++ ./disk-utils/blockdev.c 2004-04-14 20:02:17.000000000 +0300
  5. @@ -9,6 +9,7 @@
  6. #include <string.h>
  7. #include <unistd.h>
  8. #include <sys/ioctl.h>
  9. +#include <linux/version.h>
  10. #include "nls.h"
  11. @@ -24,8 +25,13 @@
  12. #define BLKRASET _IO(0x12,98)
  13. #define BLKRAGET _IO(0x12,99)
  14. #define BLKSSZGET _IO(0x12,104)
  15. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
  16. #define BLKBSZGET _IOR(0x12,112,sizeof(int))
  17. #define BLKBSZSET _IOW(0x12,113,sizeof(int))
  18. +#else
  19. +#define BLKBSZGET _IOR(0x12,112,int)
  20. +#define BLKBSZSET _IOW(0x12,113,int)
  21. +#endif
  22. #endif
  23. /* Maybe <linux/hdreg.h> could be included */
  24. --- ./disk-utils/elvtune.c.orig 2002-03-09 00:57:49.000000000 +0200
  25. +++ ./disk-utils/elvtune.c 2004-04-14 20:02:17.000000000 +0300
  26. @@ -26,6 +26,8 @@
  27. #include <sys/ioctl.h>
  28. #include <unistd.h>
  29. #include <stdlib.h>
  30. +#include <linux/version.h>
  31. +
  32. #include "nls.h"
  33. /* this has to match with the kernel structure */
  34. @@ -37,8 +39,13 @@
  35. int max_bomb_segments;
  36. } blkelv_ioctl_arg_t;
  37. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
  38. #define BLKELVGET _IOR(0x12,106,sizeof(blkelv_ioctl_arg_t))
  39. #define BLKELVSET _IOW(0x12,107,sizeof(blkelv_ioctl_arg_t))
  40. +#else
  41. +#define BLKELVGET _IOR(0x12,106,blkelv_ioctl_arg_t)
  42. +#define BLKELVSET _IOW(0x12,107,blkelv_ioctl_arg_t)
  43. +#endif
  44. static void
  45. usage(void) {
  46. --- ./fdisk/common.h.orig 2003-07-13 16:59:53.000000000 +0300
  47. +++ ./fdisk/common.h 2004-04-14 20:02:17.000000000 +0300
  48. @@ -2,11 +2,18 @@
  49. /* including <linux/fs.h> fails */
  50. #include <sys/ioctl.h>
  51. +#include <linux/version.h>
  52. +
  53. #define BLKRRPART _IO(0x12,95) /* re-read partition table */
  54. #define BLKGETSIZE _IO(0x12,96) /* return device size */
  55. #define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
  56. #define BLKSSZGET _IO(0x12,104) /* get block device sector size */
  57. +
  58. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
  59. #define BLKGETSIZE64 _IOR(0x12,114,8) /* 8 = sizeof(u64) */
  60. +#else
  61. +#define BLKGETSIZE64 _IOR(0x12,114,unsigned long long)
  62. +#endif
  63. /* including <linux/hdreg.h> also fails */
  64. struct hd_geometry {
  65. --- ./mount/my_dev_t.h.orig 2003-07-16 23:05:50.000000000 +0300
  66. +++ ./mount/my_dev_t.h 2004-04-14 20:05:59.000000000 +0300
  67. @@ -4,4 +4,11 @@
  68. /* for ancient systems use "unsigned short" */
  69. #include <linux/posix_types.h>
  70. +#include <linux/version.h>
  71. +
  72. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
  73. #define my_dev_t __kernel_dev_t
  74. +#else
  75. +#include <asm/types.h>
  76. +#define my_dev_t __u32
  77. +#endif