lkml.org 
[lkml]   [1996]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectBad comment in drivers/block/rd.c?

drivers/block/rd.c (from the 2.0.25 source tree) says:

[...]
> #ifdef RD_LOADER
> /*
> * This routine tries to a ramdisk image to load, and returns the
> * number of blocks to read for a non-compressed image, 0 if the image
^^^^^^^^^^^^^^
> * is a compressed image, and -1 if an image with the right magic
^^^^^^^^^^^^^^^^^^^^^
> * numbers could not be found.
> *
> * We currently check for the following magic numbers:
> * minix
> * ext2
> * gzip
> */
> int
> identify_ramdisk_image(kdev_t device, struct file *fp, int start_block)
> {
[...]
> /*
> * Read block 0 to test for gzipped kernel
> */
[...]
> /*
> * If it matches the gzip magic numbers, return -1
^^^^^^^^^
> */
> if (buf[0] == 037 && ((buf[1] == 0213) || (buf[1] == 0236))) {
> printk(KERN_NOTICE
> "RAMDISK: Compressed image found at block %d\n",
> start_block);
> nblocks = 0;
^^^^^^^^^^^^
> goto done;
> }
[...]
> return nblocks;
^^^^^^^
> }
[...]

Shouldn't the comment say "if it matches the gzip magic numbers, return 0"
rather than "return -1"?

BTW, if I want to make a bootable floppy that contains a compressed initrd
image, how do I have to do this? Is it possible at all? I think initrd.txt
says it is, but it only describes how to put an uncompressed image to the
disk. (I want to use /dev/ram as root device)

TIA,
Christian


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.065 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site