commit ecea705d6cb9ec87efe9bd24b6b3e604ed699dd6
parent 776eac4c0b8ccd7892162719a9ee02ae34069e60
Author: Jesus Galan Lopez (yiyus) <yiyu.jgl@gmail.com>
Date: Sun, 10 Oct 2010 16:25:29 +0200
configure default bootarg in the makefile
Diffstat:
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/9vx/Makefrag b/src/9vx/Makefrag
@@ -36,6 +36,9 @@ PLAN9BOOT=\
rootfs \
venti \
+# Default argument to boot
+PLAN9BOOTARG=local!/boot/rootfs
+
# If you don't have/want X11
#PLAN9GUI=nogui
@@ -65,9 +68,6 @@ $(BINDIR)/9vx: 9vx/9vx
$(BINDIR)/%: ../bin/%
$(INSTALL) $< $@
-9vx/bootinit.c: 9vx/mkbootinitc
- 9vx/mkbootinitc $(PLAN9BOOT) >$@
-
PLAN9_BOOT_OBJS = $(patsubst %,9vx/%.o,$(PLAN9BOOT))
PLAN9_OBJS = \
@@ -256,11 +256,14 @@ PLAN9_DEPS = \
$(HOST_CC) $(HOST_CFLAGS) -I. -I9vx -I9vx/a -Wall -Wno-missing-braces -c -o $@ $<
9vx/%.o: 9vx/%.c
- $(HOST_CC) $(HOST_CFLAGS) -I. -I9vx -I9vx/a -Wall -Wno-missing-braces -c -o $@ $<
+ $(HOST_CC) $(HOST_CFLAGS) -D "BOOTARG=\"$(PLAN9BOOTARG)\"" -I. -I9vx -I9vx/a -Wall -Wno-missing-braces -c -o $@ $<
9vx/%.o: 9vx/%.S
$(HOST_CC) $(HOST_CFLAGS) -I. -I9vx -I9vx/a -Wall -Wno-missing-braces -c -o $@ $<
+9vx/bootinit.c: 9vx/mkbootinitc
+ 9vx/mkbootinitc $(PLAN9BOOT) >$@
+
9vx/data2s: 9vx/data2s.c
$(HOST_CC) -o $@ $<
diff --git a/src/9vx/main.c b/src/9vx/main.c
@@ -50,7 +50,6 @@ int abortonfault;
int nocpuload;
char* argv0;
char* conffile = "9vx";
-char* defaultboot = "local!/boot/rootfs";
Conf conf;
static Mach mach0;
@@ -383,7 +382,7 @@ bootargs(void *base)
for(i = 0; i < bootargc && ac < 32; i++)
av[ac++] = pusharg(bootargv[i]);
if(i == 0)
- av[ac++] = pusharg(defaultboot);
+ av[ac++] = pusharg(BOOTARG);
/* 4 byte word align stack */
sp = (uchar*)((uintptr)sp & ~3);