Move the log routines to the petitboot library. The log
routines are generic enough to be used for both server and
client. Does not change the log source.
jk: move to lib/log/ instead of lib/
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
12 files changed:
PKG_CHECK_MODULES([twin], [libtwin])
mkdir -p discover ui/test ui/common lib/talloc lib/pb-protocol lib/list \
PKG_CHECK_MODULES([twin], [libtwin])
mkdir -p discover ui/test ui/common lib/talloc lib/pb-protocol lib/list \
#include <talloc/talloc.h>
#include <list/list.h>
#include <talloc/talloc.h>
#include <list/list.h>
#include <pb-protocol/pb-protocol.h>
#include "device-handler.h"
#include "discover-server.h"
#include "parser.h"
#include "udev.h"
#include <pb-protocol/pb-protocol.h>
#include "device-handler.h"
#include "discover-server.h"
#include "parser.h"
#include "udev.h"
#include "paths.h"
#define MOUNT_BIN "/bin/mount"
#include "paths.h"
#define MOUNT_BIN "/bin/mount"
#include <talloc/talloc.h>
#include <waiter/waiter.h>
#include <talloc/talloc.h>
#include <waiter/waiter.h>
#include "pb-protocol/pb-protocol.h"
#include "list/list.h"
#include "pb-protocol/pb-protocol.h"
#include "list/list.h"
#include "device-handler.h"
#include "discover-server.h"
#include "device-handler.h"
#include "discover-server.h"
#include <sys/stat.h>
#include <talloc/talloc.h>
#include <sys/stat.h>
#include <talloc/talloc.h>
#include "pb-protocol/pb-protocol.h"
#include "paths.h"
#include "params.h"
#include "pb-protocol/pb-protocol.h"
#include "paths.h"
#include "params.h"
+++ /dev/null
-
-#include <stdarg.h>
-
-#include "log.h"
-
-static FILE *logf;
-
-void pb_log(const char *fmt, ...)
-{
- va_list ap;
- FILE *stream;
-
- stream = logf ? logf : stdout;
-
- va_start(ap, fmt);
- vfprintf(stream, fmt, ap);
- va_end(ap);
-}
-
-void pb_log_set_stream(FILE *stream)
-{
- logf = stream;
-}
+++ /dev/null
-#ifndef _LOG_H
-#define _LOG_H
-
-#include <stdio.h>
-
-void pb_log(const char *fmt, ...);
-void pb_log_set_stream(FILE *stream);
-
-#endif /* _LOG_H */
#include <stdlib.h>
#include "pb-protocol/pb-protocol.h"
#include <stdlib.h>
#include "pb-protocol/pb-protocol.h"
#include "device-handler.h"
#include "device-handler.h"
#include "parser.h"
#include "parser-utils.h"
#include "parser.h"
#include "parser-utils.h"
#include <signal.h>
#include <waiter/waiter.h>
#include <signal.h>
#include <waiter/waiter.h>
#include "udev.h"
#include "discover-server.h"
#include "device-handler.h"
#include "udev.h"
#include "discover-server.h"
#include "device-handler.h"
#include <talloc/talloc.h>
#include <waiter/waiter.h>
#include <talloc/talloc.h>
#include <waiter/waiter.h>
#include "pb-discover.h"
#include "device-handler.h"
#include "pb-discover.h"
#include "device-handler.h"
--- /dev/null
+
+#include <stdarg.h>
+
+#include "log.h"
+
+static FILE *logf;
+
+void pb_log(const char *fmt, ...)
+{
+ va_list ap;
+ FILE *stream;
+
+ stream = logf ? logf : stdout;
+
+ va_start(ap, fmt);
+ vfprintf(stream, fmt, ap);
+ va_end(ap);
+}
+
+void pb_log_set_stream(FILE *stream)
+{
+ logf = stream;
+}
--- /dev/null
+#ifndef _LOG_H
+#define _LOG_H
+
+#include <stdio.h>
+
+void pb_log(const char *fmt, ...);
+void pb_log_set_stream(FILE *stream);
+
+#endif /* _LOG_H */
VPATH = $(srcdir)
CPPFLAGS += -I$(top_srcdir) -I$(top_srcdir)/lib -I$(builddir)
VPATH = $(srcdir)
CPPFLAGS += -I$(top_srcdir) -I$(top_srcdir)/lib -I$(builddir)
parsers = kboot
artwork = background.jpg cdrom.png hdd.png usbpen.png tux.png cursor.gz
parsers = kboot
artwork = background.jpg cdrom.png hdd.png usbpen.png tux.png cursor.gz
+log_objs = lib/log/log.o
talloc_objs = lib/talloc/talloc.o
list_objs = lib/list/list.o
waiter_objs = lib/waiter/waiter.o
talloc_objs = lib/talloc/talloc.o
list_objs = lib/list/list.o
waiter_objs = lib/waiter/waiter.o
# test ui
pb_test_objs = ui/test/pb-test.o ui/common/discover-client.o \
# test ui
pb_test_objs = ui/test/pb-test.o ui/common/discover-client.o \
- $(talloc_objs) $(server_objs) $(list_objs)
+ $(log_objs) $(talloc_objs) $(server_objs) $(list_objs)
ui/test/pb-test: $(pb_test_objs)
$(LINK.o) -o $@ $^
ui/test/pb-test: $(pb_test_objs)
$(LINK.o) -o $@ $^
# discover/yaboot-cfg.o \
# $(foreach p,$(parsers),discover/$(p)-parser.o)
# discover/yaboot-cfg.o \
# $(foreach p,$(parsers),discover/$(p)-parser.o)
-pb_discover_objs = discover/pb-discover.o discover/udev.o discover/log.o \
+pb_discover_objs = discover/pb-discover.o discover/udev.o \
discover/discover-server.o discover/device-handler.o \
discover/paths.o $(talloc_objs) $(server_objs) \
discover/discover-server.o discover/device-handler.o \
discover/paths.o $(talloc_objs) $(server_objs) \
- $(parser_objs) $(list_objs) $(waiter_objs)
+ $(parser_objs) $(list_objs) $(waiter_objs) $(log_objs)
discover/pb-discover: $(pb_discover_objs)
$(LINK.o) -o $@ $^
discover/pb-discover: $(pb_discover_objs)
$(LINK.o) -o $@ $^