source: patches/util-linux-2.12q-cramfs-1.patch@ 873009c

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 873009c was 617118d, checked in by Jim Gifford <clfs@…>, 19 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • Property mode set to 100644
File size: 2.8 KB
  • disk-utils/fsck.cramfs.c

    Submitted by: Jeremy Utley <jeremy@linuxfromscratch.org>
    Date: 2004-12-25
    Initial Package Version: 2.12p (should apply to versions back to at least k)
    Upstream Status: Not Submitted - Test Version
    Origin: Alexander Patrakov, adapted from debian build of cramfs utilities
    Description: Util-Linux fails in cramfs compilation due to changes in the
    linux-libc-headers package 2.6.9 and after.  This patch is a proper fix to the
    problem, but may in fact not be accepted upstream.
    
    
    diff -Naur util-linux-2.12p/disk-utils/fsck.cramfs.c util-linux-2.12p-new/disk-utils/fsck.cramfs.c
    old new  
    7676
    7777#define PAD_SIZE 512
    7878
    79 #include <asm/page.h>
    80 #ifdef PAGE_SIZE
    81 #define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
    82 #elif defined __ia64__
    83 #define PAGE_CACHE_SIZE (16384)
    84 #elif defined __alpha__
    85 #define PAGE_CACHE_SIZE (8192)
    86 #else
    87 #define PAGE_CACHE_SIZE (4096)
    88 #endif
     79#define PAGE_CACHE_SIZE  page_size
    8980
    9081/* Guarantee access to at least 8kB at a time */
    9182#define ROMBUFFER_BITS  13
     
    9586static unsigned long read_buffer_block = ~0UL;
    9687
    9788/* Uncompressing data structures... */
    98 static char outbuffer[PAGE_CACHE_SIZE*2];
     89static char *outbuffer;
    9990z_stream stream;
    10091
    10192#endif /* INCLUDE_FS_TESTS */
    10293
     94static size_t page_size;
     95
    10396/* Input status of 0 to print help and exit without an error. */
    10497static void usage(int status)
    10598{
     
    464457        int c;                  /* for getopt */
    465458        int start = 0;
    466459
     460        page_size = sysconf(_SC_PAGESIZE);
     461       
    467462        if (argc)
    468463                progname = argv[0];
    469464
     465        outbuffer = malloc(page_size * 2);
     466        if (!outbuffer) {
     467                fprintf(stderr, _("failed to allocate outbuffer\n"));
     468                exit(8);
     469        }
     470
    470471        /* command line options */
    471472        while ((c = getopt(argc, argv, "hx:v")) != EOF) {
    472473                switch (c) {
  • disk-utils/mkfs.cramfs.c

    diff -Naur util-linux-2.12p/disk-utils/mkfs.cramfs.c util-linux-2.12p-new/disk-utils/mkfs.cramfs.c
    old new  
    4646static const char *progname = "mkcramfs";
    4747static int verbose = 0;
    4848
    49 #ifdef __ia64__
    50 #define PAGE_CACHE_SIZE (16384)
    51 #elif defined __alpha__
    52 #define PAGE_CACHE_SIZE (8192)
    53 #else
    54 #define PAGE_CACHE_SIZE (4096)
    55 #endif
    56 
    5749/* The kernel assumes PAGE_CACHE_SIZE as block size. */
    58 static unsigned int blksize = PAGE_CACHE_SIZE; /* settable via -b option */
     50static unsigned int blksize;                  /* settable via -b option */
    5951static long total_blocks = 0, total_nodes = 1; /* pre-count the root node */
    6052static int image_length = 0;
    6153
     
    730722        u32 crc = crc32(0L, Z_NULL, 0);
    731723        int c;
    732724
     725        blksize = sysconf(_SC_PAGESIZE);
    733726        total_blocks = 0;
    734727
    735728        if (argc) {
Note: See TracBrowser for help on using the repository browser.