source: scripts/patches/util-linux-2.12q-cramfs-1.patch@ da1d069

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since da1d069 was 7f65c0e, checked in by Jim Gifford <clfs@…>, 19 years ago

r625@server (orig r623): jim | 2005-10-31 12:43:24 -0800
Final Move

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