On Sep 30, 2008, at 8:09 AM, ext Lauri Leukkunen wrote:

On Tue, Sep 30, 2008 at 7:04 AM, E Robertson <[EMAIL PROTECTED] > wrote:
Hi all,

Could someone shed some light on using sb2-init? What is the mapping_mode (-m
option) for? How is this used?

The mapping mode controls how the various paths are translated at
runtime for the different tools. There are three or four interesting
ones, namely: maemo, simple, emulate and install

A mapping mode contains rules which define different "personalities" for different purposes. Note that while the old scratchbox is always used "in the same mode", this is not the case with sb2.
There are at least two common use cases with different requirements:

First, sb2 is used to virtualize the development environment. The "simple" and "maemo" modes have been created for this purpose. Basically, the requirement is that the environment created by sb2 should resemble a fictional development machine, while still allowing easy access to files in your familiar host machine. And the "maemo" mode is also trying to protect against accidents: This means that the user should be able to do similar things that are possible for normal user in a normal unix/linux box, but not able to do things that require superuser rights. (we think that the old scratchbox fails in both of these areas).

The second case is that sb2 can be used to create an illusion about the target device execution environment (the "emulate" mode does this). This is the mode that should also be used for things that you normally do as "root" on a normal linux host. And note that this "illusion" is a different thing than a full virtual target device, but it is still enough for most purposes, like trying out ordinary applications that don't need direct access to the HW.

maemo does a lot of stuff, it basically re-creates SB1 level of
functionality for SB2. I somewhat disagree with its design goals, in
my opinion SB2 should do as little as possible, but that's the
strength of having configurable modes, if someone needs SB2 to deal
with everything, it's possible.

Well, the maemo mode is a bit complex, but not without good reasons. I'd say that the "simple" mode is what we need in theory, but "maemo" is what we got in practice after countless experiments with tools and source packages that don't follow the nice theory. (n.b. We are not trying to achieve 100% compatibility with sb1. But we are trying to get it close enough, while still doing as little as possible).

BTW, "maemo" is not the best possible name for that mode. 99% of it is quite generic, and the remaining 1% should not cause any harm if one is not developing for Maemo. Maybe we should think about renaming it..

Is their a way to set up sb2 such that a "make install" will install to the
target root instead of taking care of doing it during configure?

See above.

one of the latest additions to the maemo mode was that path prefix "/ target_root" now points to the target root, and you should be able to install things by using it as the destdir (you won't be able to see that as a subdirectory in the / directory, but it works - kind of a virtual symlink)

However, I think that one should never install the compiled stuff directly to the target root which is being used in the development environment without testing it somewhere else before that. It is quite easy to create another target for testing (i.e. create copy of the target root directory, and use sb2-init to initialize it to be used in the "emulate" mode. Compile in "maemo", and install separately to the second target for testing)

        Lauri

_______________________________________________
Scratchbox-devel mailing list
[email protected]
http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-devel

Reply via email to