af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * CDDL HEADER START
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * The contents of this file are subject to the terms of the
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * Common Development and Distribution License (the "License").
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * You may not use this file except in compliance with the License.
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * or http://www.opensolaris.org/os/licensing.
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * See the License for the specific language governing permissions
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * and limitations under the License.
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * When distributing Covered Code, include this CDDL HEADER in each
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * If applicable, add the following below this CDDL HEADER, with the
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * fields enclosed by brackets "[]" replaced with your own identifying
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * information: Portions Copyright [yyyy] [name of copyright owner]
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * CDDL HEADER END
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
9890706ed36aa6bfca8ad283fbe4dac12ecd692bHans Rosenfeld * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#include "./../common/bblk_einfo.h"
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystemstypedef struct _device_data {
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems char boot_sector[SECTOR_SIZE];
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystemstypedef struct _stage2_data {
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems uint32_t pcfs_first_sectors[2];
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems char stage1_buf[SECTOR_SIZE];
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define is_bootpar(type) (type == IG_DEV_X86BOOTPAR)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define STAGE2_MEMADDR (0x8000) /* loading addr of stage2 */
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define STAGE1_BPB_OFFSET (0x3)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define STAGE1_BPB_SIZE (0x3B)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define STAGE1_BOOT_DRIVE (0x40)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define STAGE1_FORCE_LBA (0x41)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define STAGE1_STAGE2_ADDRESS (0x42)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define STAGE1_STAGE2_SECTOR (0x44)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define STAGE1_STAGE2_SEGMENT (0x48)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define STAGE2_BLOCKLIST (SECTOR_SIZE - 0x8)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define STAGE2_INSTALLPART (SECTOR_SIZE + 0x8)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define STAGE2_FORCE_LBA (SECTOR_SIZE + 0x11)
1a902ef8628b0dffd6df5442354ab59bb8530962Hans Rosenfeld (is_efi(type) ? 1024 : 50) /* offset from start of part */
9348d232b12debc31fa8e694c517ad8ecfd54bdaHans Rosenfeld * Maximum size of stage2 on EFI-labeled disks. Must not be larger than
9348d232b12debc31fa8e694c517ad8ecfd54bdaHans Rosenfeld * VDEV_BOOT_SIZE, defined in usr/src/uts/common/fs/zfs/sys/vdev_impl.h
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#endif /* _INSTALLGRUB_H */