Lines 805-831
Link Here
|
805 |
} |
805 |
} |
806 |
|
806 |
|
807 |
int |
807 |
int |
808 |
load_initrd (char *initrd) |
808 |
load_initrd (char *initrd_list) |
809 |
{ |
809 |
{ |
810 |
int len; |
810 |
int flen, len; |
811 |
unsigned long moveto; |
811 |
unsigned long moveto; |
812 |
unsigned long max_addr; |
812 |
unsigned long max_addr; |
|
|
813 |
char *initrd = initrd_list; |
813 |
struct linux_kernel_header *lh |
814 |
struct linux_kernel_header *lh |
814 |
= (struct linux_kernel_header *) (cur_addr - LINUX_SETUP_MOVE_SIZE); |
815 |
= (struct linux_kernel_header *) (cur_addr - LINUX_SETUP_MOVE_SIZE); |
815 |
|
816 |
|
816 |
#ifndef NO_DECOMPRESSION |
817 |
#ifndef NO_DECOMPRESSION |
817 |
no_decompression = 1; |
818 |
no_decompression = 1; |
818 |
#endif |
819 |
#endif |
819 |
|
820 |
|
820 |
if (! grub_open (initrd)) |
821 |
if (lh->ramdisk_image) { |
|
|
822 |
errnum = ERR_ALREADY; |
821 |
goto fail; |
823 |
goto fail; |
|
|
824 |
} |
822 |
|
825 |
|
823 |
len = grub_read ((char *) cur_addr, -1); |
826 |
len = 0; |
824 |
if (! len) |
827 |
while (*initrd) { |
825 |
{ |
828 |
if (! grub_open (initrd)) |
826 |
grub_close (); |
|
|
827 |
goto fail; |
829 |
goto fail; |
828 |
} |
830 |
|
|
|
831 |
flen = grub_read ((char *) cur_addr + len, -1); |
832 |
grub_close (); |
833 |
if (! flen) |
834 |
goto fail; |
835 |
|
836 |
len += flen; |
837 |
|
838 |
/* Skip to the next filename */ |
839 |
while (! isspace(*initrd) && *initrd) |
840 |
initrd++; |
841 |
|
842 |
while (isspace(*initrd)) |
843 |
initrd++; |
844 |
} |
829 |
|
845 |
|
830 |
if (linux_mem_size) |
846 |
if (linux_mem_size) |
831 |
moveto = linux_mem_size; |
847 |
moveto = linux_mem_size; |
Lines 854-861
Link Here
|
854 |
lh->ramdisk_image = RAW_ADDR (moveto); |
870 |
lh->ramdisk_image = RAW_ADDR (moveto); |
855 |
lh->ramdisk_size = len; |
871 |
lh->ramdisk_size = len; |
856 |
|
872 |
|
857 |
grub_close (); |
|
|
858 |
|
859 |
fail: |
873 |
fail: |
860 |
|
874 |
|
861 |
#ifndef NO_DECOMPRESSION |
875 |
#ifndef NO_DECOMPRESSION |