mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-02 21:30:29 +00:00
don't check if a file is gzipped (cannot manage correctly ramdisk), add "vga default" parameter
This commit is contained in:
parent
d9885d3bf2
commit
18f005c3a0
@ -150,23 +150,6 @@ int emile_floppy_create(char *image, char* first_level, char* second_level)
|
|||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int is_gzipped(char *name)
|
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
unsigned char magic[2];
|
|
||||||
|
|
||||||
magic[0] = magic[1] = 0;
|
|
||||||
|
|
||||||
fd = open(name, O_RDONLY);
|
|
||||||
if (fd == -1)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
read(fd, magic, 2);
|
|
||||||
close(fd);
|
|
||||||
|
|
||||||
return (magic[0] == 0x1f) && (magic[1] == 0x8b);
|
|
||||||
}
|
|
||||||
|
|
||||||
char* emile_floppy_add(int fd, char *image)
|
char* emile_floppy_add(int fd, char *image)
|
||||||
{
|
{
|
||||||
off_t offset;
|
off_t offset;
|
||||||
@ -183,10 +166,7 @@ char* emile_floppy_add(int fd, char *image)
|
|||||||
if (size == -1)
|
if (size == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (is_gzipped(image))
|
sprintf(buf, "block:(fd0)0x%lx,0x%zx", offset, size);
|
||||||
sprintf(buf, "block:(fd0)0x%lx", offset);
|
|
||||||
else
|
|
||||||
sprintf(buf, "block:(fd0)0x%lx,0x%zx", offset, size);
|
|
||||||
|
|
||||||
return strdup(buf);
|
return strdup(buf);
|
||||||
}
|
}
|
||||||
@ -242,7 +222,7 @@ int emile_floppy_create_image(char* first_level, char* second_level,
|
|||||||
|
|
||||||
/* set second level info */
|
/* set second level info */
|
||||||
|
|
||||||
ret = emile_second_set_param(fd, kernel_url, "", ramdisk_url);
|
ret = emile_second_set_param(fd, kernel_url, "vga default", ramdisk_url);
|
||||||
|
|
||||||
emile_floppy_close(fd);
|
emile_floppy_close(fd);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user