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.

93 lines
2.8 KiB

  1. Submitted by: Jeremy Utley <jeremy@linuxfromscratch.org>
  2. Date: 2004-12-25
  3. Initial Package Version: 2.12p (should apply to versions back to at least k)
  4. Upstream Status: Not Submitted - Test Version
  5. Origin: Alexander Patrakov, adapted from debian build of cramfs utilities
  6. Description: Util-Linux fails in cramfs compilation due to changes in the
  7. linux-libc-headers package 2.6.9 and after. This patch is a proper fix to the
  8. problem, but may in fact not be accepted upstream.
  9. diff -Naur util-linux-2.12p/disk-utils/fsck.cramfs.c util-linux-2.12p-new/disk-utils/fsck.cramfs.c
  10. --- util-linux-2.12p/disk-utils/fsck.cramfs.c 2004-12-11 14:53:16.000000000 +0000
  11. +++ util-linux-2.12p-new/disk-utils/fsck.cramfs.c 2004-12-26 00:53:10.665199086 +0000
  12. @@ -76,16 +76,7 @@
  13. #define PAD_SIZE 512
  14. -#include <asm/page.h>
  15. -#ifdef PAGE_SIZE
  16. -#define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
  17. -#elif defined __ia64__
  18. -#define PAGE_CACHE_SIZE (16384)
  19. -#elif defined __alpha__
  20. -#define PAGE_CACHE_SIZE (8192)
  21. -#else
  22. -#define PAGE_CACHE_SIZE (4096)
  23. -#endif
  24. +#define PAGE_CACHE_SIZE page_size
  25. /* Guarantee access to at least 8kB at a time */
  26. #define ROMBUFFER_BITS 13
  27. @@ -95,11 +86,13 @@
  28. static unsigned long read_buffer_block = ~0UL;
  29. /* Uncompressing data structures... */
  30. -static char outbuffer[PAGE_CACHE_SIZE*2];
  31. +static char *outbuffer;
  32. z_stream stream;
  33. #endif /* INCLUDE_FS_TESTS */
  34. +static size_t page_size;
  35. +
  36. /* Input status of 0 to print help and exit without an error. */
  37. static void usage(int status)
  38. {
  39. @@ -464,9 +457,17 @@
  40. int c; /* for getopt */
  41. int start = 0;
  42. + page_size = sysconf(_SC_PAGESIZE);
  43. +
  44. if (argc)
  45. progname = argv[0];
  46. + outbuffer = malloc(page_size * 2);
  47. + if (!outbuffer) {
  48. + fprintf(stderr, _("failed to allocate outbuffer\n"));
  49. + exit(8);
  50. + }
  51. +
  52. /* command line options */
  53. while ((c = getopt(argc, argv, "hx:v")) != EOF) {
  54. switch (c) {
  55. diff -Naur util-linux-2.12p/disk-utils/mkfs.cramfs.c util-linux-2.12p-new/disk-utils/mkfs.cramfs.c
  56. --- util-linux-2.12p/disk-utils/mkfs.cramfs.c 2004-12-11 14:56:01.000000000 +0000
  57. +++ util-linux-2.12p-new/disk-utils/mkfs.cramfs.c 2004-12-26 00:53:10.666198928 +0000
  58. @@ -46,16 +46,8 @@
  59. static const char *progname = "mkcramfs";
  60. static int verbose = 0;
  61. -#ifdef __ia64__
  62. -#define PAGE_CACHE_SIZE (16384)
  63. -#elif defined __alpha__
  64. -#define PAGE_CACHE_SIZE (8192)
  65. -#else
  66. -#define PAGE_CACHE_SIZE (4096)
  67. -#endif
  68. -
  69. /* The kernel assumes PAGE_CACHE_SIZE as block size. */
  70. -static unsigned int blksize = PAGE_CACHE_SIZE; /* settable via -b option */
  71. +static unsigned int blksize; /* settable via -b option */
  72. static long total_blocks = 0, total_nodes = 1; /* pre-count the root node */
  73. static int image_length = 0;
  74. @@ -730,6 +722,7 @@
  75. u32 crc = crc32(0L, Z_NULL, 0);
  76. int c;
  77. + blksize = sysconf(_SC_PAGESIZE);
  78. total_blocks = 0;
  79. if (argc) {