2008-06-13 Bean <bean123ch@gmail.com>
* commands/hexdump.c (grub_cmd_hexdump): Adjust offset for partition. * fs/ext2.c (grub_ext3_get_journal): Fix revoke block handling. * fs/fshelp.c (grub_fshelp_map_block): Don't map block 0 as it's used to indicate sparse block.
This commit is contained in:
parent
e6d1a308ed
commit
dfe9ddd4cb
4 changed files with 25 additions and 10 deletions
|
@ -25,6 +25,7 @@
|
|||
#include <grub/misc.h>
|
||||
#include <grub/gzio.h>
|
||||
#include <grub/hexdump.h>
|
||||
#include <grub/partition.h>
|
||||
|
||||
static const struct grub_arg_option options[] = {
|
||||
{"skip", 's', 0, "skip offset bytes from the beginning of file.", 0,
|
||||
|
@ -84,7 +85,7 @@ grub_cmd_hexdump (struct grub_arg_list *state, int argc, char **args)
|
|||
{
|
||||
char buf[GRUB_DISK_SECTOR_SIZE * 4];
|
||||
grub_ssize_t size, length;
|
||||
unsigned long skip;
|
||||
grub_disk_addr_t skip;
|
||||
int namelen;
|
||||
|
||||
if (argc != 1)
|
||||
|
@ -107,6 +108,9 @@ grub_cmd_hexdump (struct grub_arg_list *state, int argc, char **args)
|
|||
if (! disk)
|
||||
return 0;
|
||||
|
||||
if (disk->partition)
|
||||
skip += grub_partition_get_start (disk->partition) << GRUB_DISK_SECTOR_BITS;
|
||||
|
||||
sector = (skip >> (GRUB_DISK_SECTOR_BITS + 2)) * 4;
|
||||
ofs = skip & (GRUB_DISK_SECTOR_SIZE * 4 - 1);
|
||||
while (length)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue