/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright 2016 Toomas Soome <tsoome@me.com>.
*/
#ifndef _BOOTADM_H
#define _BOOTADM_H
#ifdef __cplusplus
extern "C" {
#endif
#include <assert.h>
#include <libintl.h>
#ifndef TEXT_DOMAIN
#endif /* TEXT_DOMAIN */
#ifndef lint
#define _(x) gettext(x)
#else
#define _(x) (x)
#endif
/* Type definitions */
/* GRUB menu per-line classification */
typedef enum {
BAM_INVALID = 0,
} menu_flag_t;
/* struct for menu.lst contents */
typedef struct line {
char *cmd;
char *sep;
char *arg;
char *line;
} line_t;
typedef struct entry {
int entryNum;
} entry_t;
/* For flags value in entry_t */
typedef struct {
} menu_t;
typedef enum {
BAM_SUCCESS = 0,
} error_t;
/*
* Menu related
* menu_cmd_t and menu_cmds must be kept in sync
*
* The *_DOLLAR_CMD values must be 1 greater than the
* respective [KERNEL|MODULE]_CMD values.
*/
typedef enum {
DEFAULT_CMD = 0,
} menu_cmd_t;
extern char *menu_cmds[];
/* For multi- or direct-boot */
typedef enum {
/* Is there a hypervisor present? */
typedef enum {
} hv_t;
/* Is there findroot capability present ? */
typedef enum {
} findroot_t;
typedef enum {
} option_t;
typedef struct {
char *subcmd;
typedef enum zfs_mnted {
} zfs_mnted_t;
extern int bam_verbose;
extern int bam_force;
extern direct_or_multi_t bam_direct;
extern findroot_t bam_is_findroot;
extern int bam_debug;
extern void elide_trailing_slash(const char *, char *, size_t);
extern int umount_top_dataset(char *, zfs_mnted_t, char *);
extern void bam_exit(int);
extern void bam_print(char *, ...);
extern void bam_print_stderr(char *format, ...);
extern void bam_derror(char *format, ...);
extern error_t bam_loader_menu(char *, char *, int, char *[]);
extern char *get_special(char *);
extern char *os_to_grubdisk(char *, int);
extern void update_line(line_t *);
extern int add_boot_entry(menu_t *, char *, char *, char *, char *, char *,
char *);
extern int is_grub(const char *);
extern char *s_strdup(char *);
extern int is_sparc(void);
extern int is_pcfs(char *);
extern int is_zfs(char *);
extern int bootadm_digest(const char *, char **);
/* menu.lst comments created by bootadm */
/*
* menu.lst comments create by Live Upgrade. Note that these are the end of
* the comment strings - there will be other text before them.
*/
/*
* menu.lst comment created by libbe
*/
/* Title used for failsafe entries */
/* Title used for hv entries */
/* ZFS boot option */
/* multiboot */
/* directboot kernels */
#define DIRECT_BOOT_FAILSAFE_KERNEL \
/* xVM kernels */
/* Boot archives */
/* Hypervisors */
#define XEN_KERNEL_MODULE_LINE_ZFS \
/* Helpers */
/* A first guess at the number of entries in a menu */
/* toggle for whether delete_boot_entry prints an error message or not */
#define DBE_PRINTERR 0
/*
* Debugging defines
*/
#define INJECT_ERROR1(x, y) \
{ \
if (bam_debug) { \
y; \
} \
} \
}
#define INJECT_ERROR2(x, y, z) \
{ \
if (bam_debug) { \
y; \
z; \
} \
} \
}
#ifdef __cplusplus
}
#endif
#endif /* _BOOTADM_H */