Changeset 13120
- Timestamp:
- 10/21/09 03:28:40 (1 month ago)
- Files:
-
- src/router/nvram/Makefile (modified) (3 diffs)
- src/router/nvram/nvram_linux.c (modified) (3 diffs)
- src/router/rc/Makefile (modified) (3 diffs)
- src/router/rc/init.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/router/nvram/Makefile
r11315 r13120 26 26 endif 27 27 #CFLAGS += -g -DDEBUG 28 CFLAGS += -s $(COPTS) -f pic28 CFLAGS += -s $(COPTS) -fPIC 29 29 LDFLAGS += -L. 30 30 ifeq ($(ARCH),powerpc) … … 60 60 CFLAGS += -DHAVE_X86 61 61 endif 62 ifeq ($(CONFIG_LSX),y) 63 CFLAGS += -DHAVE_LSX 64 endif 62 65 ifeq ($(CONFIG_NOWIFI),y) 63 66 CFLAGS += -DHAVE_NOWIFI … … 91 94 libnvram.so: nvram_linux.o nvram_convert.o 92 95 $(LD) -shared -o $@ $^ 96 $(AR) arc -o libnvram.a $^ 93 97 endif 94 98 ifeq ($(ARCH),armeb) 95 99 libnvram.so: nvram_linux.o nvram_convert.o 96 100 $(LD) -shared -o $@ $^ 101 $(AR) arc -o libnvram.a $^ 97 102 endif 98 103 ifeq ($(ARCH),arm) 99 104 libnvram.so: nvram_linux.o nvram_convert.o 100 105 $(LD) -shared -o $@ $^ 106 $(AR) arc -o libnvram.a $^ 101 107 endif 102 108 ifeq ($(ARCH),powerpc) 103 109 libnvram.so: nvram_linux.o nvram_convert.o 104 110 $(LD) -shared -o $@ $^ 111 $(AR) arc -o libnvram.a $^ 105 112 endif 106 113 ifeq ($(ARCH),mips) 107 114 libnvram.so: nvram_linux.o nvram_convert.o 108 115 $(LD) -shared -o $@ $^ 116 $(AR) arc -o libnvram.a $^ 109 117 endif 110 118 ifeq ($(ARCH),mipsel) 111 119 libnvram.so: nvram_linux.o nvram_convert.o 112 120 $(LD) -shared -o $@ $^ 121 $(AR) arc -o libnvram.a $^ 113 122 endif 114 123 convertnvram: convertnvram.o src/router/nvram/nvram_linux.c
r12921 r13120 63 63 while ((in = fopen("/tmp/.nvlock", "rb")) != NULL) { 64 64 fclose(in); 65 //cprintf ("nvram lock, waiting....\n");65 fprintf(stderr, "nvram lock, waiting....\n"); 66 66 lockwait++; 67 67 if (lockwait == 3) … … 226 226 exit(1); 227 227 } 228 #ifndef HAVE_LSX 228 229 system("/sbin/ledtool 1"); 229 //fprintf(stderr,"nvram_commit \n"); 230 #endif 230 231 lock(); 231 232 int ret; 232 //fprintf (stderr, "nvram_commit(): start\n");233 233 if (nvram_fd < 0) { 234 234 if ((ret = nvram_init(NULL))) { … … 244 244 perror(PATH_DEV_NVRAM); 245 245 } 246 247 fprintf(stderr, "nvram_commit(): end\n");248 246 unlock(); 249 247 sync(); src/router/rc/Makefile
r13110 r13120 31 31 endif 32 32 endif 33 34 cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ 35 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) 36 37 38 39 INITCFLAGS = $(call cc-option,-Os -fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer -ffunction-sections -fdata-sections,) 40 # -fno-guess-branch-probability: prohibit pseudo-random guessing 41 # of branch probabilities (hopefully makes bloatcheck more stable): 42 INITCFLAGS += $(call cc-option,-fno-guess-branch-probability,) 43 INITCFLAGS += $(call cc-option,-funsigned-char -static-libgcc,) 44 INITCFLAGS += $(call cc-option,-falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1,) 33 45 34 46 #LDFLAGS += -ffunction-sections -fdata-sections -Wl,--gc-sections … … 533 545 534 546 clean: 535 rm -f *.o *.arc547 rm -f *.o rc 536 548 rm -f *.c~ 537 549 … … 673 685 $(CC) $(CFLAGS) -o process_monitor process_monitor.c ntp.c $(LDFLAGS) 674 686 $(CC) $(CFLAGS) -o resetbutton resetbutton.c $(LDFLAGS) -lwireless 675 $(CC) $(CFLAGS) -o init init.c -L$(TOP)/nvram -I$(LINUXDIR) -L$(INSTALLDIR)/nvram/usr/lib -lnvram -L$(TOP)/libutils -ldl -lutils 687 ifeq ($(CONFIG_LSX),y) 688 $(CC) $(CFLAGS) $(INITCFLAGS) -L$(TOP)/libutils -L$(TOP)/nvram -I$(LINUXDIR) -L$(INSTALLDIR)/nvram/usr/lib -o init init.c $(TOP)/nvram/libnvram.a $(TOP)/libutils/libutils.a 689 else 690 $(CC) $(CFLAGS) $(INITCFLAGS) -L$(TOP)/libutils -L$(TOP)/nvram -I$(LINUXDIR) -L$(INSTALLDIR)/nvram/usr/lib -o init init.c -lnvram -lutils 691 endif 676 692 $(CC) $(CFLAGS) -o check_ps check_ps.c $(LDFLAGS) 677 693 $(CC) $(CFLAGS) -o nvram nvram.c -L../nvram -lnvram src/router/rc/init.c
r13109 r13120 29 29 #define _PATH_CONSOLE "/dev/console" 30 30 31 int sysprintf(const char *fmt, ...)32 {33 char varbuf[256];34 va_list args;35 36 va_start(args, (char *)fmt);37 vsnprintf(varbuf, sizeof(varbuf), fmt, args);38 va_end(args);39 return system(varbuf);40 }41 31 42 32 … … 583 573 #endif 584 574 cprintf("RESET NVRAM VARS\n"); 585 nvram_set("wl0_lazy_wds", 586 nvram_safe_get("wl_lazy_wds")); 575 nvram_set("wl0_lazy_wds",nvram_safe_get("wl_lazy_wds")); 587 576 588 577 cprintf("RESTART\n");
