ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ltib] Building user application and "installing" to rootfs with lti


From: Stuart Hughes
Subject: Re: [Ltib] Building user application and "installing" to rootfs with ltib tools chain..
Date: Fri, 04 Jun 2010 18:08:56 +0100
User-agent: Thunderbird 2.0.0.16 (X11/20080707)

Hi Ayewin,

Yes, there's the example packages in dist/lfs-5.1/helloworld.spec,
hello_mod.spec

The first shows a userland c and c++ hello world example.
The second shows a simple kernel module (hello world).

To try this out:

1/ unpack:        $ ./ltib -p helloworld -m prep
2/ build/install: $ ./ltib -p helloworld
3/ test on target

Once you've done that you can edit: rpm/BUILD/helloworld-1.1/hello.c and
subvert it in any way you fell fit (add your own code).  Then if you
never make mistakes you can just build/install again by re-running steps
2/ and 3/.  If you're like me, you'll probably want to split 2/ into:

2a/ test build and fix compile errors: $ ./ltib -p helloworld -m scbuild

Fix compile errors: then:

2b/ install into the rootfs: $ ./ltib -p helloworld -m scdeploy

Once the code seems to work in the subverted example package, you then
need to make your own package (to give it it's own name, sources, build
order etc).  At this point you need to decide:

a/ Is this something that any board might want to use (hint, most
userspace is this way)

b/ This is something unique to my platform (usually driven by hardware,
or some proprietary factor).

If the answer is a/ then you should be thinking of creating a common
package, this means:

* your spec file goes in: dist/lfs-5.1/mypackage/mypackage.spec
* you need to add an entry in config/userspace/pkg_map (build order)
* you need to add an entry in config/userspace/packages.lkc (config)

If your answer is b/ then all your changes/additions should be in
config/platform/_target_/

add you new mypackage.spec to this directory
add/modify pkg_map/packages.lkc in this directory.


Once you've decided all this, you should copy
dist/lfs-5.1/template/template.spec to the appropriate destination and
using modify to reflect your package details.  To do this crib off the
helloworld.spec (remove parts you don't need, add new stuff if you
need), use your common sense to fill out packager etc.

Next mv rpm/BUILD/helloworld-1.1 rpm/BUILD/mynewpackage-x.y and clean up
any unneeded parts etc (remove object files etc).  Tar it up and then
copy the tarball to /opt/ltib/pkgs.  This is just to provide an initial
Source, which you should reference in your .spec file.  You can
overwrite it late (before you commit it to the GPP, or your
PPP).

Edit/add packages.lkc/pkg_map and then run ./ltib -m config, turn on
your package and see if it works as before with the mutated helloworld.


Take this as a "the example contains shortened and possibly incorrect
sequences due to it being 6.05pm on Friday eve and the pubs are open" :-)

Good luck, and if it is something that you want to publish to the
outside world, please send a patch when you're done.

Note: this is actually much easier than it sounds, I just wanted to give
some context of the choices you have, rather than be simplistic.

Regards, Stuart


Ayewin Oung wrote:
> 
> "Appologies if its not relavent to the list.."
> 
> Is there a way to build a user "hello world" program and "put it in"
> rootfs, using the same tool chain etc. Something similar to "How can I
> add a completely new package to the root filesystem" in
> <http://www.bitshrine.org/autodocs/LtibFag.html#ref_91";> but for simple
> progarms, demons etc..
> 
> It would simplify our development environment and both deployment and
> upgrades as well.
> 
> Thanks in advance..
> 
> A
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]