Rename lxbios to nvramtool.
This is step 1 in a three-step commit: 1. Apply patch, commit. 2. Rename some files: $ svn mv lxbios.c nvramtool.c $ svn mv lxbios.1 nvramtool.c $ svn mv lxbios.spec nvramtool.spec $ svn ci 3. Rename lxbios directory: $ svn mv lxbios/ nvramtool/ $ svn ci Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3122 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
eec5ff4ccb
commit
6e565947a5
@ -8,9 +8,9 @@ Written by David S. Peterson <dsp@llnl.gov>.
|
|||||||
UCRL-CODE-2003-012
|
UCRL-CODE-2003-012
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
This file is part of lxbios, a utility for reading/writing coreboot
|
This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
parameters and displaying information from the coreboot table.
|
parameters and displaying information from the coreboot table.
|
||||||
For details, see http://coreboot.org/Lxbios.
|
For details, see http://coreboot.org/nvramtool.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
This program is free software; you can redistribute it and/or modify it
|
||||||
under the terms of the GNU General Public License (as published by the
|
under the terms of the GNU General Public License (as published by the
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
PROJECT = lxbios
|
PROJECT = nvramtool
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O2 -W -Wall
|
CFLAGS = -O2 -W -Wall
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
OBJS = common.o compute_ip_checksum.o hexdump.o cmos_lowlevel.o \
|
OBJS = common.o compute_ip_checksum.o hexdump.o cmos_lowlevel.o \
|
||||||
reg_expr.o layout.o layout_file.o lbtable.o cmos_ops.o input_file.o \
|
reg_expr.o layout.o layout_file.o lbtable.o cmos_ops.o input_file.o \
|
||||||
opts.o lxbios.o
|
opts.o nvramtool.o
|
||||||
HEADERS = common.h ip_checksum.h coreboot_tables.h hexdump.h \
|
HEADERS = common.h ip_checksum.h coreboot_tables.h hexdump.h \
|
||||||
cmos_lowlevel.h reg_expr.h layout.h layout_file.h lbtable.h \
|
cmos_lowlevel.h reg_expr.h layout.h layout_file.h lbtable.h \
|
||||||
cmos_ops.h input_file.h opts.h
|
cmos_ops.h input_file.h opts.h
|
||||||
|
|
||||||
all: lxbios man
|
all: nvramtool man
|
||||||
|
|
||||||
lxbios: $(OBJS)
|
nvramtool: $(OBJS)
|
||||||
$(CC) $(LDFLAGS) -o $@ $(OBJS)
|
$(CC) $(LDFLAGS) -o $@ $(OBJS)
|
||||||
|
|
||||||
man: lxbios.1.gz
|
man: nvramtool.1.gz
|
||||||
|
|
||||||
$(OBJS): $(HEADERS)
|
$(OBJS): $(HEADERS)
|
||||||
|
|
||||||
lxbios.1.gz: lxbios.1
|
nvramtool.1.gz: nvramtool.1
|
||||||
gzip -c --best lxbios.1 > lxbios.1.gz
|
gzip -c --best nvramtool.1 > nvramtool.1.gz
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o lxbios lxbios.1.gz
|
rm -f *.o nvramtool nvramtool.1.gz
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ $Id$
|
|||||||
|
|
||||||
Summary of Operation
|
Summary of Operation
|
||||||
--------------------
|
--------------------
|
||||||
lxbios is a utility for reading/writing coreboot parameters and
|
nvramtool is a utility for reading/writing coreboot parameters and
|
||||||
displaying information from the coreboot table. It is intended for x86-based
|
displaying information from the coreboot table. It is intended for x86-based
|
||||||
systems (both 32-bit and 64-bit) that use coreboot.
|
systems (both 32-bit and 64-bit) that use coreboot.
|
||||||
|
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -29,8 +29,8 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||||
\*****************************************************************************/
|
\*****************************************************************************/
|
||||||
|
|
||||||
#ifndef LXBIOS_CMOS_LOWLEVEL_H
|
#ifndef NVRAMTOOL_CMOS_LOWLEVEL_H
|
||||||
#define LXBIOS_CMOS_LOWLEVEL_H
|
#define NVRAMTOOL_CMOS_LOWLEVEL_H
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
@ -59,4 +59,4 @@ int verify_cmos_op (unsigned bit, unsigned length);
|
|||||||
static inline int verify_cmos_byte_index (unsigned index)
|
static inline int verify_cmos_byte_index (unsigned index)
|
||||||
{ return (index < CMOS_RTC_AREA_SIZE) || (index >= CMOS_SIZE); }
|
{ return (index < CMOS_RTC_AREA_SIZE) || (index >= CMOS_SIZE); }
|
||||||
|
|
||||||
#endif /* LXBIOS_CMOS_LOWLEVEL_H */
|
#endif /* NVRAMTOOL_CMOS_LOWLEVEL_H */
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -29,8 +29,8 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||||
\*****************************************************************************/
|
\*****************************************************************************/
|
||||||
|
|
||||||
#ifndef LXBIOS_CMOS_OPS_H
|
#ifndef CMOS_OPS_H
|
||||||
#define LXBIOS_CMOS_OPS_H
|
#define CMOS_OPS_H
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "layout.h"
|
#include "layout.h"
|
||||||
@ -50,4 +50,4 @@ void cmos_checksum_write (uint16_t checksum);
|
|||||||
uint16_t cmos_checksum_compute (void);
|
uint16_t cmos_checksum_compute (void);
|
||||||
void cmos_checksum_verify (void);
|
void cmos_checksum_verify (void);
|
||||||
|
|
||||||
#endif /* LXBIOS_CMOS_OPS_H */
|
#endif /* CMOS_OPS_H */
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -32,7 +32,7 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
/* basename of this program, as reported by argv[0] */
|
/* basename of this program, as reported by argv[0] */
|
||||||
const char prog_name[] = "lxbios";
|
const char prog_name[] = "nvramtool";
|
||||||
|
|
||||||
/* version of this program */
|
/* version of this program */
|
||||||
const char prog_version[] = "2.0.1";
|
const char prog_version[] = "2.0.1";
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -29,8 +29,8 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||||
\*****************************************************************************/
|
\*****************************************************************************/
|
||||||
|
|
||||||
#ifndef LXBIOS_COMMON_H
|
#ifndef COMMON_H
|
||||||
#define LXBIOS_COMMON_H
|
#define COMMON_H
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -69,4 +69,4 @@ int get_line_from_file (FILE *f, char line[], int line_buf_size);
|
|||||||
void out_of_memory (void);
|
void out_of_memory (void);
|
||||||
void usage (FILE *outfile);
|
void usage (FILE *outfile);
|
||||||
|
|
||||||
#endif /* LXBIOS_COMMON_H */
|
#endif /* COMMON_H */
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -29,8 +29,8 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||||
\*****************************************************************************/
|
\*****************************************************************************/
|
||||||
|
|
||||||
#ifndef LXBIOS_INPUT_FILE_H
|
#ifndef INPUT_FILE_H
|
||||||
#define LXBIOS_INPUT_FILE_H
|
#define INPUT_FILE_H
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
@ -53,4 +53,4 @@ void do_cmos_writes (cmos_write_t *list);
|
|||||||
|
|
||||||
extern const char assignment_regex[];
|
extern const char assignment_regex[];
|
||||||
|
|
||||||
#endif /* LXBIOS_INPUT_FILE_H */
|
#endif /* INPUT_FILE_H */
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -29,8 +29,8 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||||
\*****************************************************************************/
|
\*****************************************************************************/
|
||||||
|
|
||||||
#ifndef LXBIOS_LAYOUT_H
|
#ifndef LAYOUT_H
|
||||||
#define LXBIOS_LAYOUT_H
|
#define LAYOUT_H
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "coreboot_tables.h"
|
#include "coreboot_tables.h"
|
||||||
@ -111,4 +111,4 @@ int is_checksum_name (const char name[]);
|
|||||||
int checksum_layout_to_bytes (cmos_checksum_layout_t *layout);
|
int checksum_layout_to_bytes (cmos_checksum_layout_t *layout);
|
||||||
void checksum_layout_to_bits (cmos_checksum_layout_t *layout);
|
void checksum_layout_to_bits (cmos_checksum_layout_t *layout);
|
||||||
|
|
||||||
#endif /* LXBIOS_LAYOUT_H */
|
#endif /* LAYOUT_H */
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -29,8 +29,8 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||||
\*****************************************************************************/
|
\*****************************************************************************/
|
||||||
|
|
||||||
#ifndef LXBIOS_LAYOUT_FILE_H
|
#ifndef LAYOUT_FILE_H
|
||||||
#define LXBIOS_LAYOUT_FILE_H
|
#define LAYOUT_FILE_H
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "coreboot_tables.h"
|
#include "coreboot_tables.h"
|
||||||
@ -39,4 +39,4 @@ void set_layout_filename (const char filename[]);
|
|||||||
void get_layout_from_file (void);
|
void get_layout_from_file (void);
|
||||||
void write_cmos_layout (FILE *f);
|
void write_cmos_layout (FILE *f);
|
||||||
|
|
||||||
#endif /* LXBIOS_LAYOUT_FILE_H */
|
#endif /* LAYOUT_FILE_H */
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -29,8 +29,8 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||||
\*****************************************************************************/
|
\*****************************************************************************/
|
||||||
|
|
||||||
#ifndef LXBIOS_LBTABLE_H
|
#ifndef LBTABLE_H
|
||||||
#define LXBIOS_LBTABLE_H
|
#define LBTABLE_H
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
@ -40,4 +40,4 @@ void dump_lbtable (void);
|
|||||||
void list_lbtable_choices (void);
|
void list_lbtable_choices (void);
|
||||||
void list_lbtable_item (const char item[]);
|
void list_lbtable_item (const char item[]);
|
||||||
|
|
||||||
#endif /* LXBIOS_LBTABLE_H */
|
#endif /* LBTABLE_H */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.\"***************************************************************************\
|
.\"***************************************************************************\
|
||||||
.\" lxbios.1
|
.\" nvramtool.1
|
||||||
.\" $Id$
|
.\" $Id$
|
||||||
.\"***************************************************************************
|
.\"***************************************************************************
|
||||||
.\" Copyright (C) 2002, 2003 The Regents of the University of California.
|
.\" Copyright (C) 2002, 2003 The Regents of the University of California.
|
||||||
@ -8,9 +8,9 @@
|
|||||||
.\" UCRL-CODE-2003-012
|
.\" UCRL-CODE-2003-012
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
.\"
|
.\"
|
||||||
.\" This file is part of lxbios, a utility for reading/writing coreboot
|
.\" This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
.\" parameters and displaying information from the coreboot table.
|
.\" parameters and displaying information from the coreboot table.
|
||||||
.\" For details, see http://coreboot.org/Lxbios.
|
.\" For details, see http://coreboot.org/nvramtool.
|
||||||
.\"
|
.\"
|
||||||
.\" Please also read the file DISCLAIMER which is included in this software
|
.\" Please also read the file DISCLAIMER which is included in this software
|
||||||
.\" distribution.
|
.\" distribution.
|
||||||
@ -28,43 +28,43 @@
|
|||||||
.\" with this program; if not, write to the Free Software Foundation, Inc.,
|
.\" with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
.\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
.\" 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||||
.\"***************************************************************************/
|
.\"***************************************************************************/
|
||||||
.TH LXBIOS 1 "January 2008" Linux
|
.TH NVRAMTOOL 1 "January 2008" Linux
|
||||||
.SH NAME
|
.SH NAME
|
||||||
lxbios \- read/write coreboot-related information
|
nvramtool \- read/write coreboot-related information
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B "lxbios [OPTS] [-n] -r NAME"
|
.B "nvramtool [OPTS] [-n] -r NAME"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -e NAME"
|
.B "nvramtool [OPTS] -e NAME"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -a"
|
.B "nvramtool [OPTS] -a"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -w NAME=VALUE"
|
.B "nvramtool [OPTS] -w NAME=VALUE"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -p INPUT_FILE"
|
.B "nvramtool [OPTS] -p INPUT_FILE"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -i"
|
.B "nvramtool [OPTS] -i"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -c [VALUE]"
|
.B "nvramtool [OPTS] -c [VALUE]"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -l [ARG]"
|
.B "nvramtool [OPTS] -l [ARG]"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -d"
|
.B "nvramtool [OPTS] -d"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -Y"
|
.B "nvramtool [OPTS] -Y"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -b OUTPUT_FILE"
|
.B "nvramtool [OPTS] -b OUTPUT_FILE"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -B INPUT_FILE"
|
.B "nvramtool [OPTS] -B INPUT_FILE"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -x"
|
.B "nvramtool [OPTS] -x"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -X DUMPFILE"
|
.B "nvramtool [OPTS] -X DUMPFILE"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -v"
|
.B "nvramtool [OPTS] -v"
|
||||||
.br
|
.br
|
||||||
.B "lxbios [OPTS] -h"
|
.B "nvramtool [OPTS] -h"
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B "lxbios"
|
.B "nvramtool"
|
||||||
is a utility for reading/writing coreboot parameters and displaying
|
is a utility for reading/writing coreboot parameters and displaying
|
||||||
information from the coreboot table.
|
information from the coreboot table.
|
||||||
|
|
||||||
@ -180,11 +180,11 @@ evaluates to the following:
|
|||||||
|
|
||||||
The
|
The
|
||||||
.B "'-y LAYOUT_FILE'"
|
.B "'-y LAYOUT_FILE'"
|
||||||
option tells lxbios to obtain CMOS layout information from the contents of
|
option tells nvramtool to obtain CMOS layout information from the contents of
|
||||||
.B "LAYOUT_FILE."
|
.B "LAYOUT_FILE."
|
||||||
Likewise, the
|
Likewise, the
|
||||||
.B "'-t'"
|
.B "'-t'"
|
||||||
option tells lxbios to obtain CMOS layout information from the CMOS option
|
option tells nvramtool to obtain CMOS layout information from the CMOS option
|
||||||
table (contained within the coreboot table). If neither option is
|
table (contained within the coreboot table). If neither option is
|
||||||
specified, the CMOS option table is used by default.
|
specified, the CMOS option table is used by default.
|
||||||
.B "LAYOUT_FILE"
|
.B "LAYOUT_FILE"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************\
|
/*****************************************************************************\
|
||||||
* lxbios.c
|
* nvramtool.c
|
||||||
* $Id$
|
* $Id$
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 2002-2005 The Regents of the University of California.
|
* Copyright (C) 2002-2005 The Regents of the University of California.
|
||||||
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -96,18 +96,18 @@ static const hexdump_format_t cmos_dump_format =
|
|||||||
int main (int argc, char *argv[])
|
int main (int argc, char *argv[])
|
||||||
{ cmos_layout_get_fn_t fn;
|
{ cmos_layout_get_fn_t fn;
|
||||||
|
|
||||||
parse_lxbios_args(argc, argv);
|
parse_nvramtool_args(argc, argv);
|
||||||
|
|
||||||
if (lxbios_op_modifiers[LXBIOS_MOD_USE_CMOS_LAYOUT_FILE].found)
|
if (nvramtool_op_modifiers[NVRAMTOOL_MOD_USE_CMOS_LAYOUT_FILE].found)
|
||||||
{ set_layout_filename(
|
{ set_layout_filename(
|
||||||
lxbios_op_modifiers[LXBIOS_MOD_USE_CMOS_LAYOUT_FILE].param);
|
nvramtool_op_modifiers[NVRAMTOOL_MOD_USE_CMOS_LAYOUT_FILE].param);
|
||||||
fn = get_layout_from_file;
|
fn = get_layout_from_file;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fn = get_layout_from_cmos_table;
|
fn = get_layout_from_cmos_table;
|
||||||
|
|
||||||
register_cmos_layout_get_fn(fn);
|
register_cmos_layout_get_fn(fn);
|
||||||
op_fns[lxbios_op.op]();
|
op_fns[nvramtool_op.op]();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,11 +140,11 @@ static void op_show_usage (void)
|
|||||||
* Else show all possible values for ARG.
|
* Else show all possible values for ARG.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static void op_lbtable_show_info (void)
|
static void op_lbtable_show_info (void)
|
||||||
{ if (lxbios_op.param == NULL)
|
{ if (nvramtool_op.param == NULL)
|
||||||
list_lbtable_choices();
|
list_lbtable_choices();
|
||||||
else
|
else
|
||||||
{ get_lbtable();
|
{ get_lbtable();
|
||||||
list_lbtable_item(lxbios_op.param);
|
list_lbtable_item(nvramtool_op.param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ static void op_lbtable_dump (void)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static void op_show_param_values (void)
|
static void op_show_param_values (void)
|
||||||
{ get_cmos_layout();
|
{ get_cmos_layout();
|
||||||
list_param_enums(lxbios_op.param);
|
list_param_enums(nvramtool_op.param);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -184,8 +184,8 @@ static void op_cmos_show_one_param (void)
|
|||||||
{ int result;
|
{ int result;
|
||||||
|
|
||||||
get_cmos_layout();
|
get_cmos_layout();
|
||||||
result = list_one_param(lxbios_op.param,
|
result = list_one_param(nvramtool_op.param,
|
||||||
!lxbios_op_modifiers[LXBIOS_MOD_SHOW_VALUE_ONLY].found);
|
!nvramtool_op_modifiers[NVRAMTOOL_MOD_SHOW_VALUE_ONLY].found);
|
||||||
cmos_checksum_verify();
|
cmos_checksum_verify();
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
@ -225,7 +225,7 @@ static void op_cmos_set_one_param (void)
|
|||||||
/* Separate 'NAME=VALUE' syntax into two strings representing NAME and
|
/* Separate 'NAME=VALUE' syntax into two strings representing NAME and
|
||||||
* VALUE.
|
* VALUE.
|
||||||
*/
|
*/
|
||||||
parse_assignment(lxbios_op.param, &name, &value);
|
parse_assignment(nvramtool_op.param, &name, &value);
|
||||||
|
|
||||||
set_one_param(name, value);
|
set_one_param(name, value);
|
||||||
}
|
}
|
||||||
@ -252,9 +252,9 @@ static void op_cmos_set_params_stdin (void)
|
|||||||
static void op_cmos_set_params_file (void)
|
static void op_cmos_set_params_file (void)
|
||||||
{ FILE *f;
|
{ FILE *f;
|
||||||
|
|
||||||
if ((f = fopen(lxbios_op.param, "r")) == NULL)
|
if ((f = fopen(nvramtool_op.param, "r")) == NULL)
|
||||||
{ fprintf(stderr, "%s: Can not open file %s for reading: %s\n",
|
{ fprintf(stderr, "%s: Can not open file %s for reading: %s\n",
|
||||||
prog_name, lxbios_op.param, strerror(errno));
|
prog_name, nvramtool_op.param, strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,14 +276,14 @@ static void op_cmos_checksum (void)
|
|||||||
|
|
||||||
get_cmos_layout();
|
get_cmos_layout();
|
||||||
|
|
||||||
if (lxbios_op.param == NULL)
|
if (nvramtool_op.param == NULL)
|
||||||
{ set_iopl(3);
|
{ set_iopl(3);
|
||||||
checksum = cmos_checksum_read();
|
checksum = cmos_checksum_read();
|
||||||
set_iopl(0);
|
set_iopl(0);
|
||||||
printf("0x%x\n", checksum);
|
printf("0x%x\n", checksum);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ checksum = convert_checksum_value(lxbios_op.param);
|
{ checksum = convert_checksum_value(nvramtool_op.param);
|
||||||
set_iopl(3);
|
set_iopl(3);
|
||||||
cmos_checksum_write(checksum);
|
cmos_checksum_write(checksum);
|
||||||
set_iopl(0);
|
set_iopl(0);
|
||||||
@ -313,9 +313,9 @@ static void op_write_cmos_dump (void)
|
|||||||
{ unsigned char data[CMOS_SIZE];
|
{ unsigned char data[CMOS_SIZE];
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
if ((f = fopen(lxbios_op.param, "w")) == NULL)
|
if ((f = fopen(nvramtool_op.param, "w")) == NULL)
|
||||||
{ fprintf(stderr, "%s: Can not open file %s for writing: %s\n",
|
{ fprintf(stderr, "%s: Can not open file %s for writing: %s\n",
|
||||||
prog_name, lxbios_op.param, strerror(errno));
|
prog_name, nvramtool_op.param, strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,7 +325,7 @@ static void op_write_cmos_dump (void)
|
|||||||
|
|
||||||
if (fwrite(data, 1, CMOS_SIZE, f) != CMOS_SIZE)
|
if (fwrite(data, 1, CMOS_SIZE, f) != CMOS_SIZE)
|
||||||
{ fprintf(stderr, "%s: Error writing CMOS data to file %s: %s\n",
|
{ fprintf(stderr, "%s: Error writing CMOS data to file %s: %s\n",
|
||||||
prog_name, lxbios_op.param, strerror(errno));
|
prog_name, nvramtool_op.param, strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,16 +344,16 @@ static void op_read_cmos_dump (void)
|
|||||||
size_t nr_bytes;
|
size_t nr_bytes;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
if ((f = fopen(lxbios_op.param, "r")) == NULL)
|
if ((f = fopen(nvramtool_op.param, "r")) == NULL)
|
||||||
{ fprintf(stderr, "%s: Can not open file %s for reading: %s\n",
|
{ fprintf(stderr, "%s: Can not open file %s for reading: %s\n",
|
||||||
prog_name, lxbios_op.param, strerror(errno));
|
prog_name, nvramtool_op.param, strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((nr_bytes = fread(data, 1, CMOS_SIZE, f)) != CMOS_SIZE)
|
if ((nr_bytes = fread(data, 1, CMOS_SIZE, f)) != CMOS_SIZE)
|
||||||
{ fprintf(stderr, "%s: Error: Only able to read %d bytes of CMOS data "
|
{ fprintf(stderr, "%s: Error: Only able to read %d bytes of CMOS data "
|
||||||
"from file %s. CMOS data is unchanged.\n", prog_name,
|
"from file %s. CMOS data is unchanged.\n", prog_name,
|
||||||
(int) nr_bytes, lxbios_op.param);
|
(int) nr_bytes, nvramtool_op.param);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,9 +392,9 @@ static void op_show_cmos_dumpfile (void)
|
|||||||
size_t nr_bytes;
|
size_t nr_bytes;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
if ((f = fopen(lxbios_op.param, "r")) == NULL)
|
if ((f = fopen(nvramtool_op.param, "r")) == NULL)
|
||||||
{ fprintf(stderr, "%s: Can not open file %s for reading: %s\n",
|
{ fprintf(stderr, "%s: Can not open file %s for reading: %s\n",
|
||||||
prog_name, lxbios_op.param, strerror(errno));
|
prog_name, nvramtool_op.param, strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,21 +2,21 @@
|
|||||||
# $Id$
|
# $Id$
|
||||||
##
|
##
|
||||||
|
|
||||||
Name: lxbios
|
Name: nvramtool
|
||||||
Version: 2.0.1
|
Version: 2.0.1
|
||||||
Release: 0
|
Release: 0
|
||||||
|
|
||||||
Summary: coreboot utility program
|
Summary: coreboot utility program
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
License: GPL
|
License: GPL
|
||||||
Provides: lxbios
|
Provides: nvramtool
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}
|
BuildRoot: %{_tmppath}/%{name}-%{version}
|
||||||
|
|
||||||
Source0: %{name}-%{version}.tgz
|
Source0: %{name}-%{version}.tgz
|
||||||
|
|
||||||
%description
|
%description
|
||||||
lxbios is a utility for reading/writing coreboot parameters and displaying
|
nvramtool is a utility for reading/writing coreboot parameters and displaying
|
||||||
information from the coreboot table.
|
information from the coreboot table.
|
||||||
|
|
||||||
At boot time, coreboot places a table (known as the coreboot table) in low
|
At boot time, coreboot places a table (known as the coreboot table) in low
|
||||||
@ -36,8 +36,8 @@ make
|
|||||||
rm -rf "$RPM_BUILD_ROOT"
|
rm -rf "$RPM_BUILD_ROOT"
|
||||||
mkdir -p "$RPM_BUILD_ROOT/usr/bin"
|
mkdir -p "$RPM_BUILD_ROOT/usr/bin"
|
||||||
mkdir -p "$RPM_BUILD_ROOT/usr/man/man1"
|
mkdir -p "$RPM_BUILD_ROOT/usr/man/man1"
|
||||||
cp lxbios "$RPM_BUILD_ROOT/usr/bin"
|
cp nvramtool "$RPM_BUILD_ROOT/usr/bin"
|
||||||
cp lxbios.1.gz $RPM_BUILD_ROOT/usr/man/man1
|
cp nvramtool.1.gz $RPM_BUILD_ROOT/usr/man/man1
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf "$RPM_BUILD_ROOT"
|
rm -rf "$RPM_BUILD_ROOT"
|
||||||
@ -46,5 +46,5 @@ rm -rf "$RPM_BUILD_ROOT"
|
|||||||
%defattr(-,root,root,0755)
|
%defattr(-,root,root,0755)
|
||||||
%doc ChangeLog README
|
%doc ChangeLog README
|
||||||
%doc README
|
%doc README
|
||||||
/usr/bin/lxbios
|
/usr/bin/nvramtool
|
||||||
/usr/man/man1/lxbios.1.gz
|
/usr/man/man1/nvramtool.1.gz
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -32,30 +32,30 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "opts.h"
|
#include "opts.h"
|
||||||
|
|
||||||
lxbios_op_info_t lxbios_op;
|
nvramtool_op_info_t nvramtool_op;
|
||||||
|
|
||||||
lxbios_op_modifier_info_t lxbios_op_modifiers[LXBIOS_NUM_OP_MODIFIERS];
|
nvramtool_op_modifier_info_t nvramtool_op_modifiers[NVRAMTOOL_NUM_OP_MODIFIERS];
|
||||||
|
|
||||||
static char * handle_optional_arg (int argc, char *argv[]);
|
static char * handle_optional_arg (int argc, char *argv[]);
|
||||||
static void register_op (int *op_found, lxbios_op_t op, char op_param[]);
|
static void register_op (int *op_found, nvramtool_op_t op, char op_param[]);
|
||||||
static void register_op_modifier (lxbios_op_modifier_t mod, char mod_param[]);
|
static void register_op_modifier (nvramtool_op_modifier_t mod, char mod_param[]);
|
||||||
static void resolve_op_modifiers (void);
|
static void resolve_op_modifiers (void);
|
||||||
static void sanity_check_args (void);
|
static void sanity_check_args (void);
|
||||||
|
|
||||||
static const char getopt_string[] = "-ab:B:c::de:hil::np:r:tvw:xX:y:Y";
|
static const char getopt_string[] = "-ab:B:c::de:hil::np:r:tvw:xX:y:Y";
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* parse_lxbios_args
|
* parse_nvramtool_args
|
||||||
*
|
*
|
||||||
* Parse command line arguments.
|
* Parse command line arguments.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
void parse_lxbios_args (int argc, char *argv[])
|
void parse_nvramtool_args (int argc, char *argv[])
|
||||||
{ lxbios_op_modifier_info_t *mod_info;
|
{ nvramtool_op_modifier_info_t *mod_info;
|
||||||
int i, op_found;
|
int i, op_found;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
for (i = 0, mod_info = lxbios_op_modifiers;
|
for (i = 0, mod_info = nvramtool_op_modifiers;
|
||||||
i < LXBIOS_NUM_OP_MODIFIERS;
|
i < NVRAMTOOL_NUM_OP_MODIFIERS;
|
||||||
i++, mod_info++)
|
i++, mod_info++)
|
||||||
{ mod_info->found = FALSE;
|
{ mod_info->found = FALSE;
|
||||||
mod_info->found_seq = 0;
|
mod_info->found_seq = 0;
|
||||||
@ -68,63 +68,63 @@ void parse_lxbios_args (int argc, char *argv[])
|
|||||||
do
|
do
|
||||||
{ switch (c = getopt(argc, argv, getopt_string))
|
{ switch (c = getopt(argc, argv, getopt_string))
|
||||||
{ case 'a':
|
{ case 'a':
|
||||||
register_op(&op_found, LXBIOS_OP_CMOS_SHOW_ALL_PARAMS, NULL);
|
register_op(&op_found, NVRAMTOOL_OP_CMOS_SHOW_ALL_PARAMS, NULL);
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
register_op(&op_found, LXBIOS_OP_WRITE_CMOS_DUMP, optarg);
|
register_op(&op_found, NVRAMTOOL_OP_WRITE_CMOS_DUMP, optarg);
|
||||||
break;
|
break;
|
||||||
case 'B':
|
case 'B':
|
||||||
register_op(&op_found, LXBIOS_OP_READ_CMOS_DUMP, optarg);
|
register_op(&op_found, NVRAMTOOL_OP_READ_CMOS_DUMP, optarg);
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
register_op(&op_found, LXBIOS_OP_CMOS_CHECKSUM,
|
register_op(&op_found, NVRAMTOOL_OP_CMOS_CHECKSUM,
|
||||||
handle_optional_arg(argc, argv));
|
handle_optional_arg(argc, argv));
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
register_op(&op_found, LXBIOS_OP_LBTABLE_DUMP, NULL);
|
register_op(&op_found, NVRAMTOOL_OP_LBTABLE_DUMP, NULL);
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
register_op(&op_found, LXBIOS_OP_SHOW_PARAM_VALUES, optarg);
|
register_op(&op_found, NVRAMTOOL_OP_SHOW_PARAM_VALUES, optarg);
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
register_op(&op_found, LXBIOS_OP_SHOW_USAGE, NULL);
|
register_op(&op_found, NVRAMTOOL_OP_SHOW_USAGE, NULL);
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
register_op(&op_found, LXBIOS_OP_CMOS_SET_PARAMS_STDIN, NULL);
|
register_op(&op_found, NVRAMTOOL_OP_CMOS_SET_PARAMS_STDIN, NULL);
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
register_op(&op_found, LXBIOS_OP_LBTABLE_SHOW_INFO,
|
register_op(&op_found, NVRAMTOOL_OP_LBTABLE_SHOW_INFO,
|
||||||
handle_optional_arg(argc, argv));
|
handle_optional_arg(argc, argv));
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
register_op_modifier(LXBIOS_MOD_SHOW_VALUE_ONLY, NULL);
|
register_op_modifier(NVRAMTOOL_MOD_SHOW_VALUE_ONLY, NULL);
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
register_op(&op_found, LXBIOS_OP_CMOS_SET_PARAMS_FILE, optarg);
|
register_op(&op_found, NVRAMTOOL_OP_CMOS_SET_PARAMS_FILE, optarg);
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
register_op(&op_found, LXBIOS_OP_CMOS_SHOW_ONE_PARAM, optarg);
|
register_op(&op_found, NVRAMTOOL_OP_CMOS_SHOW_ONE_PARAM, optarg);
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
register_op_modifier(LXBIOS_MOD_USE_CMOS_OPT_TABLE, NULL);
|
register_op_modifier(NVRAMTOOL_MOD_USE_CMOS_OPT_TABLE, NULL);
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
register_op(&op_found, LXBIOS_OP_SHOW_VERSION, NULL);
|
register_op(&op_found, NVRAMTOOL_OP_SHOW_VERSION, NULL);
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
register_op(&op_found, LXBIOS_OP_CMOS_SET_ONE_PARAM, optarg);
|
register_op(&op_found, NVRAMTOOL_OP_CMOS_SET_ONE_PARAM, optarg);
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
register_op(&op_found, LXBIOS_OP_SHOW_CMOS_HEX_DUMP, NULL);
|
register_op(&op_found, NVRAMTOOL_OP_SHOW_CMOS_HEX_DUMP, NULL);
|
||||||
break;
|
break;
|
||||||
case 'X':
|
case 'X':
|
||||||
register_op(&op_found, LXBIOS_OP_SHOW_CMOS_DUMPFILE, optarg);
|
register_op(&op_found, NVRAMTOOL_OP_SHOW_CMOS_DUMPFILE, optarg);
|
||||||
break;
|
break;
|
||||||
case 'y':
|
case 'y':
|
||||||
register_op_modifier(LXBIOS_MOD_USE_CMOS_LAYOUT_FILE, optarg);
|
register_op_modifier(NVRAMTOOL_MOD_USE_CMOS_LAYOUT_FILE, optarg);
|
||||||
break;
|
break;
|
||||||
case 'Y':
|
case 'Y':
|
||||||
register_op(&op_found, LXBIOS_OP_SHOW_LAYOUT, NULL);
|
register_op(&op_found, NVRAMTOOL_OP_SHOW_LAYOUT, NULL);
|
||||||
break;
|
break;
|
||||||
case -1: /* no more command line args */
|
case -1: /* no more command line args */
|
||||||
break;
|
break;
|
||||||
@ -178,13 +178,13 @@ static char * handle_optional_arg (int argc, char *argv[])
|
|||||||
*
|
*
|
||||||
* Store the user's selection of which operation this program should perform.
|
* Store the user's selection of which operation this program should perform.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static void register_op (int *op_found, lxbios_op_t op, char op_param[])
|
static void register_op (int *op_found, nvramtool_op_t op, char op_param[])
|
||||||
{ if (*op_found && (op != lxbios_op.op))
|
{ if (*op_found && (op != nvramtool_op.op))
|
||||||
usage(stderr);
|
usage(stderr);
|
||||||
|
|
||||||
*op_found = TRUE;
|
*op_found = TRUE;
|
||||||
lxbios_op.op = op;
|
nvramtool_op.op = op;
|
||||||
lxbios_op.param = op_param;
|
nvramtool_op.param = op_param;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -193,11 +193,11 @@ static void register_op (int *op_found, lxbios_op_t op, char op_param[])
|
|||||||
* Store information regarding an optional argument specified in addition to
|
* Store information regarding an optional argument specified in addition to
|
||||||
* the user's selection of which operation this program should perform.
|
* the user's selection of which operation this program should perform.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static void register_op_modifier (lxbios_op_modifier_t mod, char mod_param[])
|
static void register_op_modifier (nvramtool_op_modifier_t mod, char mod_param[])
|
||||||
{ static int found_seq = 0;
|
{ static int found_seq = 0;
|
||||||
lxbios_op_modifier_info_t *mod_info;
|
nvramtool_op_modifier_info_t *mod_info;
|
||||||
|
|
||||||
mod_info = &lxbios_op_modifiers[mod];
|
mod_info = &nvramtool_op_modifiers[mod];
|
||||||
mod_info->found = TRUE;
|
mod_info->found = TRUE;
|
||||||
mod_info->found_seq = ++found_seq;
|
mod_info->found_seq = ++found_seq;
|
||||||
mod_info->param = mod_param;
|
mod_info->param = mod_param;
|
||||||
@ -210,13 +210,13 @@ static void register_op_modifier (lxbios_op_modifier_t mod, char mod_param[])
|
|||||||
* the last specified argument overrides previous conflicting arguments.
|
* the last specified argument overrides previous conflicting arguments.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static void resolve_op_modifiers (void)
|
static void resolve_op_modifiers (void)
|
||||||
{ if (lxbios_op_modifiers[LXBIOS_MOD_USE_CMOS_LAYOUT_FILE].found &&
|
{ if (nvramtool_op_modifiers[NVRAMTOOL_MOD_USE_CMOS_LAYOUT_FILE].found &&
|
||||||
lxbios_op_modifiers[LXBIOS_MOD_USE_CMOS_OPT_TABLE].found)
|
nvramtool_op_modifiers[NVRAMTOOL_MOD_USE_CMOS_OPT_TABLE].found)
|
||||||
{ if (lxbios_op_modifiers[LXBIOS_MOD_USE_CMOS_LAYOUT_FILE].found_seq >
|
{ if (nvramtool_op_modifiers[NVRAMTOOL_MOD_USE_CMOS_LAYOUT_FILE].found_seq >
|
||||||
lxbios_op_modifiers[LXBIOS_MOD_USE_CMOS_OPT_TABLE].found_seq)
|
nvramtool_op_modifiers[NVRAMTOOL_MOD_USE_CMOS_OPT_TABLE].found_seq)
|
||||||
lxbios_op_modifiers[LXBIOS_MOD_USE_CMOS_OPT_TABLE].found = FALSE;
|
nvramtool_op_modifiers[NVRAMTOOL_MOD_USE_CMOS_OPT_TABLE].found = FALSE;
|
||||||
else
|
else
|
||||||
lxbios_op_modifiers[LXBIOS_MOD_USE_CMOS_LAYOUT_FILE].found = FALSE;
|
nvramtool_op_modifiers[NVRAMTOOL_MOD_USE_CMOS_LAYOUT_FILE].found = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ static void resolve_op_modifiers (void)
|
|||||||
* Perform sanity checking on command line arguments.
|
* Perform sanity checking on command line arguments.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static void sanity_check_args (void)
|
static void sanity_check_args (void)
|
||||||
{ if ((lxbios_op_modifiers[LXBIOS_MOD_SHOW_VALUE_ONLY].found) &&
|
{ if ((nvramtool_op_modifiers[NVRAMTOOL_MOD_SHOW_VALUE_ONLY].found) &&
|
||||||
(lxbios_op.op != LXBIOS_OP_CMOS_SHOW_ONE_PARAM))
|
(nvramtool_op.op != NVRAMTOOL_OP_CMOS_SHOW_ONE_PARAM))
|
||||||
usage(stderr);
|
usage(stderr);
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -29,56 +29,56 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||||
\*****************************************************************************/
|
\*****************************************************************************/
|
||||||
|
|
||||||
#ifndef LXBIOS_OPTS_H
|
#ifndef OPTS_H
|
||||||
#define LXBIOS_OPTS_H
|
#define OPTS_H
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{ LXBIOS_OP_SHOW_VERSION = 0,
|
{ NVRAMTOOL_OP_SHOW_VERSION = 0,
|
||||||
LXBIOS_OP_SHOW_USAGE,
|
NVRAMTOOL_OP_SHOW_USAGE,
|
||||||
LXBIOS_OP_LBTABLE_SHOW_INFO,
|
NVRAMTOOL_OP_LBTABLE_SHOW_INFO,
|
||||||
LXBIOS_OP_LBTABLE_DUMP,
|
NVRAMTOOL_OP_LBTABLE_DUMP,
|
||||||
LXBIOS_OP_SHOW_PARAM_VALUES,
|
NVRAMTOOL_OP_SHOW_PARAM_VALUES,
|
||||||
LXBIOS_OP_CMOS_SHOW_ONE_PARAM,
|
NVRAMTOOL_OP_CMOS_SHOW_ONE_PARAM,
|
||||||
LXBIOS_OP_CMOS_SHOW_ALL_PARAMS,
|
NVRAMTOOL_OP_CMOS_SHOW_ALL_PARAMS,
|
||||||
LXBIOS_OP_CMOS_SET_ONE_PARAM,
|
NVRAMTOOL_OP_CMOS_SET_ONE_PARAM,
|
||||||
LXBIOS_OP_CMOS_SET_PARAMS_STDIN,
|
NVRAMTOOL_OP_CMOS_SET_PARAMS_STDIN,
|
||||||
LXBIOS_OP_CMOS_SET_PARAMS_FILE,
|
NVRAMTOOL_OP_CMOS_SET_PARAMS_FILE,
|
||||||
LXBIOS_OP_CMOS_CHECKSUM,
|
NVRAMTOOL_OP_CMOS_CHECKSUM,
|
||||||
LXBIOS_OP_SHOW_LAYOUT,
|
NVRAMTOOL_OP_SHOW_LAYOUT,
|
||||||
LXBIOS_OP_WRITE_CMOS_DUMP,
|
NVRAMTOOL_OP_WRITE_CMOS_DUMP,
|
||||||
LXBIOS_OP_READ_CMOS_DUMP,
|
NVRAMTOOL_OP_READ_CMOS_DUMP,
|
||||||
LXBIOS_OP_SHOW_CMOS_HEX_DUMP,
|
NVRAMTOOL_OP_SHOW_CMOS_HEX_DUMP,
|
||||||
LXBIOS_OP_SHOW_CMOS_DUMPFILE
|
NVRAMTOOL_OP_SHOW_CMOS_DUMPFILE
|
||||||
}
|
}
|
||||||
lxbios_op_t;
|
nvramtool_op_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{ lxbios_op_t op;
|
{ nvramtool_op_t op;
|
||||||
char *param;
|
char *param;
|
||||||
}
|
}
|
||||||
lxbios_op_info_t;
|
nvramtool_op_info_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{ LXBIOS_MOD_SHOW_VALUE_ONLY = 0,
|
{ NVRAMTOOL_MOD_SHOW_VALUE_ONLY = 0,
|
||||||
LXBIOS_MOD_USE_CMOS_LAYOUT_FILE,
|
NVRAMTOOL_MOD_USE_CMOS_LAYOUT_FILE,
|
||||||
LXBIOS_MOD_USE_CMOS_OPT_TABLE,
|
NVRAMTOOL_MOD_USE_CMOS_OPT_TABLE,
|
||||||
LXBIOS_NUM_OP_MODIFIERS /* must always be last */
|
NVRAMTOOL_NUM_OP_MODIFIERS /* must always be last */
|
||||||
}
|
}
|
||||||
lxbios_op_modifier_t;
|
nvramtool_op_modifier_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{ int found;
|
{ int found;
|
||||||
int found_seq;
|
int found_seq;
|
||||||
char *param;
|
char *param;
|
||||||
}
|
}
|
||||||
lxbios_op_modifier_info_t;
|
nvramtool_op_modifier_info_t;
|
||||||
|
|
||||||
extern lxbios_op_info_t lxbios_op;
|
extern nvramtool_op_info_t nvramtool_op;
|
||||||
|
|
||||||
extern lxbios_op_modifier_info_t lxbios_op_modifiers[];
|
extern nvramtool_op_modifier_info_t nvramtool_op_modifiers[];
|
||||||
|
|
||||||
void parse_lxbios_args (int argc, char *argv[]);
|
void parse_nvramtool_args (int argc, char *argv[]);
|
||||||
|
|
||||||
#endif /* LXBIOS_OPTS_H */
|
#endif /* OPTS_H */
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* UCRL-CODE-2003-012
|
* UCRL-CODE-2003-012
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This file is part of lxbios, a utility for reading/writing coreboot
|
* This file is part of nvramtool, a utility for reading/writing coreboot
|
||||||
* parameters and displaying information from the coreboot table.
|
* parameters and displaying information from the coreboot table.
|
||||||
* For details, see http://coreboot.org/Lxbios.
|
* For details, see http://coreboot.org/nvramtool.
|
||||||
*
|
*
|
||||||
* Please also read the file DISCLAIMER which is included in this software
|
* Please also read the file DISCLAIMER which is included in this software
|
||||||
* distribution.
|
* distribution.
|
||||||
@ -29,8 +29,8 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||||
\*****************************************************************************/
|
\*****************************************************************************/
|
||||||
|
|
||||||
#ifndef LXBIOS_REG_EXPR_H
|
#ifndef REG_EXPR_H
|
||||||
#define LXBIOS_REG_EXPR_H
|
#define REG_EXPR_H
|
||||||
|
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
@ -39,4 +39,4 @@ void compile_reg_exprs (int cflags, int num_exprs,
|
|||||||
/* const char *expr1, regex_t *reg1, */ ...);
|
/* const char *expr1, regex_t *reg1, */ ...);
|
||||||
void free_reg_exprs (int num_exprs, /* regex_t *reg1, */ ...);
|
void free_reg_exprs (int num_exprs, /* regex_t *reg1, */ ...);
|
||||||
|
|
||||||
#endif /* LXBIOS_REG_EXPR_H */
|
#endif /* REG_EXPR_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user