Building dtc etc. for packaging

Nate Case ncase at xes-inc.com
Wed Nov 12 05:00:37 EST 2008


On Tue, 2008-11-11 at 11:29 -0600, Matt Sealey wrote:
> (the other tool we need is mkimage from U-Boot, I noticed Debian uses
> this
> same command name inside jigdo etc. too, sigh.. also you can't build
> the
> tools without the rest of U-Boot which is hard to envision doing just
> to
> get one command out of it - "make tools/mkimage" doesn't work and I
> got
> tired of reverse engineering the chickenscratch..)

This is a bit off-topic, but here is my ugly hack to compile a
statically linked 'mkimage' from the U-Boot tree:

Place this file, 'Makefile.mkimage' in u-boot/tools/
---[snip]---
CFLAGS = -O2 -static -I../include -DUSE_HOSTCC -I.
ASMDIR = ../include/asm

CFILES = ../lib_generic/crc32.c ../libfdt/fdt_strerror.c \
         ../lib_generic/sha1.c ../lib_generic/md5.c ../common/image.c \
         ../libfdt/fdt_wip.c ../libfdt/fdt.c ../libfdt/fdt_ro.c \
         ../libfdt/fdt_rw.c

mkimage: mkimage.c
        mv $(ASMDIR) $(ASMDIR).back
        ln -s $(ASMDIR)-i386 $(ASMDIR)
        gcc $(CFLAGS) $(CFILES) mkimage.c -o mkimage
        rm -f $(ASMDIR)
        mv $(ASMDIR).back $(ASMDIR)
        strip mkimage

default: mkimage
---[snip]---

Then just run 'make -f Makefile.mkimage' from within tools/.  Of course
this uses some nasty tricks that will only work on i386 host.  I don't
think I'm the first person to have this need, so others here may have
better solutions.

-- 
Nate Case <ncase at xes-inc.com>




More information about the Linuxppc-dev mailing list