Implement better integration with Mac firmware.

This commit is contained in:
Vladimir Serbinenko 2013-12-17 15:21:02 +01:00
parent 1f032575bb
commit b8765fa082
15 changed files with 835 additions and 39 deletions

View file

@ -38,7 +38,9 @@ struct grub_dirhook_info
unsigned dir:1;
unsigned mtimeset:1;
unsigned case_insensitive:1;
unsigned inodeset:1;
grub_int32_t mtime;
grub_uint64_t inode;
};
typedef int (*grub_fs_dir_hook_t) (const char *filename,

View file

@ -50,11 +50,20 @@ struct grub_hfs_sblock
/* A pascal style string that holds the volumename. */
grub_uint8_t volname[28];
grub_uint8_t unused5[52];
grub_uint8_t unused5[28];
grub_uint32_t ppc_bootdir;
grub_uint32_t intel_bootfile;
/* Folder opened when disk is mounted. Unused by GRUB. */
grub_uint32_t showfolder;
grub_uint32_t os9folder;
grub_uint8_t unused6[4];
grub_uint32_t osxfolder;
grub_uint64_t num_serial;
grub_uint16_t embed_sig;
struct grub_hfs_extent embed_extent;
grub_uint8_t unused6[4];
grub_uint8_t unused7[4];
grub_hfs_datarecord_t extent_recs;
grub_uint32_t catalog_size;
grub_hfs_datarecord_t catalog_recs;

View file

@ -1,7 +1,28 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2006,2007,2008,2009,2012,2013 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/types.h>
#include <grub/disk.h>
#define GRUB_HFSPLUS_MAGIC 0x482B
#define GRUB_HFSPLUSX_MAGIC 0x4858
#define GRUB_HFSPLUS_SBLOCK 2
/* A HFS+ extent. */
struct grub_hfsplus_extent
{
@ -30,7 +51,16 @@ struct grub_hfsplus_volheader
grub_uint32_t utime;
grub_uint8_t unused2[16];
grub_uint32_t blksize;
grub_uint8_t unused3[60];
grub_uint8_t unused3[36];
grub_uint32_t ppc_bootdir;
grub_uint32_t intel_bootfile;
/* Folder opened when disk is mounted. Unused by GRUB. */
grub_uint32_t showfolder;
grub_uint32_t os9folder;
grub_uint8_t unused4[4];
grub_uint32_t osxfolder;
grub_uint64_t num_serial;
struct grub_hfsplus_forkdata allocations_file;
struct grub_hfsplus_forkdata extents_file;
@ -216,3 +246,8 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
struct grub_hfsplus_key_internal *keyb),
struct grub_hfsplus_btnode **matchnode,
grub_off_t *keyoffset);
grub_err_t
grub_mac_bless_inode (grub_device_t dev, grub_uint64_t inode, int is_dir,
int intel);
grub_err_t
grub_mac_bless_file (grub_device_t dev, const char *path_in, int intel);