mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
merge trunk
This commit is contained in:
commit
2e0fbe00d2
319 files changed
+12002
-1453
No files matched your search
@@ -23,6 +23,9 @@
|
||||
#include <grub/misc.h>
|
||||
#include <grub/fs.h>
|
||||
#include <grub/bufio.h>
|
||||
#include <grub/dl.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#define GRUB_BUFIO_DEF_SIZE 8192
|
||||
#define GRUB_BUFIO_MAX_SIZE 1048576
|
||||
@@ -74,7 +77,7 @@ grub_bufio_open (grub_file_t io, int size)
|
||||
file->data = bufio;
|
||||
file->read_hook = 0;
|
||||
file->fs = &grub_bufio_fs;
|
||||
file->not_easly_seekable = io->not_easly_seekable;
|
||||
file->not_easily_seekable = io->not_easily_seekable;
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
+15
-14
@@ -44,6 +44,8 @@
|
||||
#include <grub/disk.h>
|
||||
#include <grub/deflate.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
/*
|
||||
* Window Size
|
||||
*
|
||||
@@ -220,19 +222,18 @@ test_gzip_header (grub_file_t file)
|
||||
|
||||
gzio->data_offset = grub_file_tell (gzio->file);
|
||||
|
||||
grub_file_seek (gzio->file, grub_file_size (gzio->file) - 4);
|
||||
|
||||
if (grub_file_seekable (gzio->file))
|
||||
{
|
||||
if (grub_file_read (gzio->file, &orig_len, 4) != 4)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_FILE_TYPE, "unsupported gzip format");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/* FIXME: this does not handle files whose original size is over 4GB.
|
||||
But how can we know the real original size? */
|
||||
file->size = grub_le_to_cpu32 (orig_len);
|
||||
/* FIXME: don't do this on not easily seekable files. */
|
||||
{
|
||||
grub_file_seek (gzio->file, grub_file_size (gzio->file) - 4);
|
||||
if (grub_file_read (gzio->file, &orig_len, 4) != 4)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_FILE_TYPE, "unsupported gzip format");
|
||||
return 0;
|
||||
}
|
||||
/* FIXME: this does not handle files whose original size is over 4GB.
|
||||
But how can we know the real original size? */
|
||||
file->size = grub_le_to_cpu32 (orig_len);
|
||||
}
|
||||
|
||||
initialize_tables (gzio);
|
||||
|
||||
@@ -1171,7 +1172,7 @@ grub_gzio_open (grub_file_t io)
|
||||
file->data = gzio;
|
||||
file->read_hook = 0;
|
||||
file->fs = &grub_gzio_fs;
|
||||
file->not_easly_seekable = 1;
|
||||
file->not_easily_seekable = 1;
|
||||
|
||||
if (! test_gzip_header (file))
|
||||
{
|
||||
|
||||
+5
-2
@@ -24,6 +24,8 @@
|
||||
#include <grub/fs.h>
|
||||
#include <grub/dl.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#include "xz.h"
|
||||
#include "xz_stream.h"
|
||||
|
||||
@@ -200,7 +202,7 @@ grub_xzio_open (grub_file_t io)
|
||||
file->read_hook = 0;
|
||||
file->fs = &grub_xzio_fs;
|
||||
file->size = GRUB_FILE_SIZE_UNKNOWN;
|
||||
file->not_easly_seekable = 1;
|
||||
file->not_easily_seekable = 1;
|
||||
|
||||
if (grub_file_tell (xzio->file) != 0)
|
||||
grub_file_seek (xzio->file, 0);
|
||||
@@ -222,7 +224,8 @@ grub_xzio_open (grub_file_t io)
|
||||
xzio->buf.out_pos = 0;
|
||||
xzio->buf.out_size = XZBUFSIZ;
|
||||
|
||||
if (!test_header (file) || !(grub_file_seekable (io) && test_footer (file)))
|
||||
/* FIXME: don't test footer on not easily seekable files. */
|
||||
if (!test_header (file) || !test_footer (file))
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
grub_file_seek (io, 0);
|
||||
|
||||
Reference in new issue
Block a user