2005-12-25 Marco Gerards <marco@gnu.org>
Add support for Apple HFS+ filesystems. * fs/hfsplus.c: New file. * DISTLIST: Added `fs/hfsplus.c'. * conf/common.rmk (pkgdata_MODULES): Add `hfsplus.mod'. (hfsplus_mod_SOURCES): New variable. (hfsplus_mod_CFLAGS): Likewise. (hfsplus_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (grub_setup_SOURCES): Add `fs/hfsplus.c'. (grub_setup_SOURCES): Likewise. (grub_mkdevicemap_SOURCES): Likewise. (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * fs/fshelp.c (grub_fshelp_log2blksize): New function. * include/grub/fshelp.h (grub_fshelp_log2blksize): new prototype.
This commit is contained in:
parent
befaed6ce7
commit
502141992c
12 changed files with 1081 additions and 33 deletions
24
fs/fshelp.c
24
fs/fshelp.c
|
@ -1,7 +1,7 @@
|
|||
/* fshelp.c -- Filesystem helper functions */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -275,6 +275,7 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
|
|||
if (blknr)
|
||||
{
|
||||
disk->read_hook = read_hook;
|
||||
|
||||
grub_disk_read (disk, blknr, skipfirst,
|
||||
blockend, buf);
|
||||
disk->read_hook = 0;
|
||||
|
@ -289,3 +290,24 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node,
|
|||
|
||||
return len;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
grub_fshelp_log2blksize (unsigned int blksize, unsigned int *pow)
|
||||
{
|
||||
int mod;
|
||||
|
||||
*pow = 0;
|
||||
while (blksize > 1)
|
||||
{
|
||||
mod = blksize - ((blksize >> 1) << 1);
|
||||
blksize >>= 1;
|
||||
|
||||
/* Check if it really is a power of two. */
|
||||
if (mod)
|
||||
return grub_error (GRUB_ERR_BAD_NUMBER,
|
||||
"the blocksize is not a power of two");
|
||||
(*pow)++;
|
||||
}
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue