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.

137 lines
4.2 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
  78. --- util-linux-2.12a/disk-utils/fdformat.c~ 2002-07-07 14:38:24.000000000 +0200
  79. +++ util-linux-2.12a/disk-utils/fdformat.c 2004-06-22 05:03:03.607542024 +0200
  80. @@ -14,6 +14,7 @@
  81. #include <stdlib.h>
  82. #include <sys/stat.h>
  83. #include <sys/ioctl.h>
  84. +#include <linux/compiler.h>
  85. #include <linux/fd.h>
  86. #include "nls.h"
  87. --- util-linux-2.12a/disk-utils/setfdprm.c~ 2001-10-21 12:32:27.000000000 +0200
  88. +++ util-linux-2.12a/disk-utils/setfdprm.c 2004-06-22 05:25:44.739618496 +0200
  89. @@ -13,6 +13,7 @@
  90. #include <sys/types.h>
  91. #include <sys/stat.h>
  92. #include <sys/ioctl.h>
  93. +#include <linux/compiler.h>
  94. #include <linux/fd.h>
  95. #include "nls.h"
  96. --- util-linux-2.12a/partx/addpart.c~ 1999-07-09 04:56:36.000000000 +0200
  97. +++ util-linux-2.12a/partx/addpart.c 2004-06-22 05:28:41.731711608 +0200
  98. @@ -3,6 +3,7 @@
  99. #include <fcntl.h>
  100. #include <stdlib.h>
  101. #include <sys/ioctl.h>
  102. +#include <linux/compiler.h>
  103. #include <linux/blkpg.h>
  104. int
  105. --- util-linux-2.12a/partx/delpart.c~ 1999-07-09 04:56:36.000000000 +0200
  106. +++ util-linux-2.12a/partx/delpart.c 2004-06-22 05:30:16.806258080 +0200
  107. @@ -3,6 +3,7 @@
  108. #include <fcntl.h>
  109. #include <stdlib.h>
  110. #include <sys/ioctl.h>
  111. +#include <linux/compiler.h>
  112. #include <linux/blkpg.h>
  113. int
  114. --- util-linux-2.12a/partx/partx.c~ 2002-10-31 14:51:06.000000000 +0100
  115. +++ util-linux-2.12a/partx/partx.c 2004-06-22 05:32:07.710398088 +0200
  116. @@ -37,6 +37,7 @@
  117. #include <getopt.h>
  118. #include <unistd.h>
  119. #include <sys/ioctl.h>
  120. +#include <linux/compiler.h>
  121. #include <linux/hdreg.h> /* HDIO_GETGEO */
  122. #include <linux/blkpg.h>
  123. #define BLKGETSIZE _IO(0x12,96) /* return device size */