Building dtc etc. for packaging

5 messages, 5 authors, 2008-11-11 · open the first message on its own page

Building dtc etc. for packaging

From: Matt Sealey <hidden>
Date: 2008-11-11 17:30:02

For some of what we're doing with SUSE now I've determined we should really
be packaging the device tree compiler (and libfdt) so that we can install and
script it, along with some other stuff from U-Boot (not for this mail).

I was wondering if the recommended way would be to use the dtc found in
the kernel-source or to use the git repo at git.jdl.com to grab it and
build it. The one in the kernel is seemingly impossible to build without
some tweaking around (I can't find a target for make that does it) so
I also wonder about a hint here on what to do to create it from the
kernel source so we can pull it out for a local system install.

(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..)

-- 
Matt Sealey [off-list ref]
Genesi, Manager, Developer Relations

Re: Building dtc etc. for packaging

From: Nate Case <hidden>
Date: 2008-11-11 18:00:44

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 [off-list ref]

Re: Building dtc etc. for packaging

From: Simon Richter <hidden>
Date: 2008-11-11 21:02:24

Hi,

On Tue, Nov 11, 2008 at 11:29:57AM -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..)
I have a Debian package that basically just builds the tools into one binary
package, and the source tarball into another.

Didn't upload it back then, but I can see if I can find the time to get it
up to date.

   Simon

Re: Building dtc etc. for packaging

From: David Gibson <hidden>
Date: 2008-11-11 22:39:03

On Tue, Nov 11, 2008 at 11:29:57AM -0600, Matt Sealey wrote:
For some of what we're doing with SUSE now I've determined we should really
be packaging the device tree compiler (and libfdt) so that we can install and
script it, along with some other stuff from U-Boot (not for this mail).

I was wondering if the recommended way would be to use the dtc found in
the kernel-source or to use the git repo at git.jdl.com to grab it and
build it. The one in the kernel is seemingly impossible to build without
some tweaking around (I can't find a target for make that does it) so
I also wonder about a hint here on what to do to create it from the
kernel source so we can pull it out for a local system install.
Use the tree from jdl.org.  Either the git tree if you really need an
up-to-date snahpshot, or one of the actual release tarballs.

Apart from being the official upstream version, the tree there has
make install targets, the full testsuite and other conveniences which
will help for packaging.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Re: Building dtc etc. for packaging

From: Jon Loeliger <hidden>
Date: 2008-11-11 23:10:56

On Wed, 2008-11-12 at 09:39 +1100, David Gibson wrote:
Use the tree from jdl.org.  Either the git tree if you really need an
up-to-date snahpshot, or one of the actual release tarballs.
The tree from jdl.com will work better. :-)

jdl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help