xen/build: Use a distro version of figlet

It is quite inappropriate to keep a hacked up versions of figlet in our source
tree, especially when the purpose of the hackary is just to provide a text to
octal conversion.

This version of figlet contributes a surprisingly large proportion of the
Coverity issues found under xen/ (and therefore attributed against Xen)

Figlet can be found in all distros, so make use of it.  We keep xen.flf (being
the Xen figlet font) and replace the hacked up octal transform with a short
python script.

The Xen Makefile has been tweaked in such a way that it still prints the
figlet banner for the build.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
CC: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
This commit is contained in:
Andrew Cooper authored and Ian Campbell committed 2013-12-02 13:46:44 +00:00
1 parent 26b35b9ace
commit 3b47bcdb6d
6 files changed
+29 -11

No files matched your search

+1 -2
View File
@@ -292,7 +292,7 @@ tools/xm-test/lib/XmTestLib/config.py
tools/xm-test/lib/XmTestReport/xmtest.py
tools/xm-test/tests/*.test
tools/ocaml-xenstored*
xen/.banner*
xen/.banner
xen/System.map
xen/arch/arm/asm-offsets.s
xen/arch/arm/xen.lds
@@ -315,7 +315,6 @@ xen/include/linux
xen/include/public/public
xen/include/xen/*.new
xen/include/xen/acm_policy.h
xen/include/xen/banner.h
xen/include/xen/compile.h
xen/tools/figlet/figlet
xen/tools/symbols
+1
View File
@@ -71,6 +71,7 @@ disabled at compile time:
includes the alternative ocaml xenstored.
* cmake (if building vtpm stub domains)
* markdown
* figlet (for generating the traditional Xen start of day banner)
Second, you need to acquire a suitable kernel for use in domain 0. If
possible you should use a kernel provided by your OS distributor. If
+9 -7
View File
@@ -86,7 +86,7 @@ _clean: delete-unfresh-files
$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET)-syms *~ core
rm -f include/asm-*/asm-offsets.h
[ -d tools/figlet ] && rm -f .banner*
rm -f .banner
.PHONY: _distclean
_distclean: clean
@@ -114,10 +114,12 @@ delete-unfresh-files:
fi
.banner: Makefile
$(MAKE) -C tools
@tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) 2>$@2 >$@1
@cat $@1 $@2 >$@
@rm -f $@1 $@2
@if which figlet >/dev/null 2>&1 ; then \
echo " Xen $(XEN_FULLVERSION)" | figlet -f tools/xen.flf > $@.tmp; \
else \
echo " Xen $(XEN_FULLVERSION)" > $@.tmp; \
fi
@mv -f $@.tmp $@
# compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
include/xen/compile.h: include/xen/compile.h.in .banner
@@ -132,8 +134,8 @@ include/xen/compile.h: include/xen/compile.h.in .banner
-e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
-e 's!@@changeset@@!$(shell tools/scmversion $(XEN_ROOT) || echo "unavailable")!g' \
< include/xen/compile.h.in > $@.new
@grep \" .banner >> $@.new
@grep -v \" .banner
@cat .banner
@$(PYTHON) tools/fig-to-oct.py < .banner >> $@.new
@mv -f $@.new $@
include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
-2
View File
@@ -3,12 +3,10 @@ include $(XEN_ROOT)/Config.mk
.PHONY: default
default:
[ -d figlet ] && $(MAKE) -C figlet
$(MAKE) symbols
.PHONY: clean
clean:
[ -d figlet ] && $(MAKE) -C figlet clean
rm -f *.o symbols
symbols: symbols.c
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env python
import sys
chars_per_line = 18
chars_so_far = 0
sys.stdout.write('"')
for char in sys.stdin.read():
sys.stdout.write("\\%03o" % ord(char))
chars_so_far = chars_so_far + 1
if chars_so_far == chars_per_line:
chars_so_far = 0
sys.stdout.write('" \\\n"')
sys.stdout.write('"\n')
File renamed without changes.
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.