Show
Ignore:
Timestamp:
09/27/08 12:08:28 (3 months ago)
Author:
stepan
Message:

Add string support to nvramtool.

To add a string to your cmos.layout, you need to specify type 's':

#start len type unused name
416 512 s 0 boot_devices

With this patch you can do

$ nvramtool -w boot_devices="(hd0,0);(hd2,1);(hd3)"

And FILO will attempt to load a menu.lst from any of these devices in that
order.

The patch is not exactly pretty, but a cleaner solution might have resulted in
a complete rewrite of the tool, which I did not want.

Signed-off-by: Stefan Reinauer <stepan@…>
Acked-by: Joseph Smith <joe@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/util/nvramtool/Makefile

    r3122 r3613  
    1 # $Id$ 
     1# 
     2# Makefile for nvram utility 
     3#  
     4# (C) 2005-2008 coresystems GmbH 
     5# written by Stefan Reinauer <stepan@coresystems.de> 
     6# 
    27 
    3 PROJECT = nvramtool 
    4 CC = gcc 
    5 CFLAGS = -O2 -W -Wall 
    6 LDFLAGS = 
    7 OBJS = common.o compute_ip_checksum.o hexdump.o cmos_lowlevel.o \ 
    8        reg_expr.o layout.o layout_file.o lbtable.o cmos_ops.o input_file.o \ 
    9        opts.o nvramtool.o 
    10 HEADERS = common.h ip_checksum.h coreboot_tables.h hexdump.h \ 
    11           cmos_lowlevel.h reg_expr.h layout.h layout_file.h lbtable.h \ 
    12           cmos_ops.h input_file.h opts.h 
     8PROGRAM = nvramtool 
    139 
    14 all: nvramtool man 
     10CC      = gcc 
     11STRIP   = strip 
     12INSTALL = /usr/bin/install 
     13PREFIX  = /usr/local 
     14CFLAGS  = -O2 -g -Wall -W 
     15#CFLAGS  = -Os -Wall 
    1516 
    16 nvramtool: $(OBJS) 
    17         $(CC) $(LDFLAGS) -o $@ $(OBJS) 
     17OBJS =  cmos_lowlevel.o cmos_ops.o common.o compute_ip_checksum.o \ 
     18        hexdump.o input_file.o layout.o layout_file.o lbtable.o   \ 
     19        nvramtool.o opts.o reg_expr.o 
    1820 
    19 man: nvramtool.1.gz 
     21all: dep $(PROGRAM) 
    2022 
    21 $(OBJS): $(HEADERS) 
    22  
    23 nvramtool.1.gz: nvramtool.1 
    24         gzip -c --best nvramtool.1 > nvramtool.1.gz 
     23$(PROGRAM): $(OBJS) 
     24        $(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS) 
     25        $(STRIP) $(STRIP_ARGS) $(PROGRAM) 
    2526 
    2627clean: 
    27         rm -f *.o nvramtool nvramtool.1.gz 
     28        rm -f $(PROGRAM) *.o 
    2829 
     30distclean: clean 
     31        rm -f .dependencies 
     32 
     33dep: 
     34        @$(CC) -MM *.c > .dependencies 
     35 
     36install: $(PROGRAM) 
     37        $(INSTALL) $(PROGRAM) $(PREFIX)/sbin 
     38        mkdir -p $(PREFIX)/share/man/man1 
     39        $(INSTALL) $(PROGRAM).1 $(PREFIX)/share/man/man1 
     40 
     41.PHONY: all clean distclean dep 
     42 
     43-include .dependencies