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

Re: native vs emulated configuration


On Sat, Jul 09, 2011 at 09:18:06AM +0100, Neil Williams wrote:
> Hmm, why would the tarball need to be created from inside a fake
> chroot call? Look at the multistrap tarball functionality, it packs up
> the tarball from the directory above. tar has good support for this
> kind of operation.

It is because of fakechroot. A symlink you create like this:

sudo chroot mychroot ln -s /foo bar

Will be a symlink bar pointing to /foo, will be retained by tar as such
and will point to the correct location when chrooting in that directory
or when the directory is the root on the target device.

But with fakechroot, when a symlink is created like this:

fakeroot fakechroot mychroot ln -s /foo bar

Then a symlink bar will be created that points to /path/to/mychroot/foo.
When fakechrooting into mychroot, this will be translated to /foo but
when not using fakechroot but a real chroot or on the target device,
this symlink will point to a non existing location.

It took me quite some while to figure out why some stuff was failing on
my target platform until I found out about the broken symlinks. What I
was doing first was to use find(1) and readlink(1) to translate every
symlink to it's real absolute target path but later found out that it is
much easier and less error prone when just using tar from inside the

This problem is of course not showing up with multistrap tarball
creation, as a real chroot call is used to configure the rootfs on
native architectures.

cheers, josch

Reply to: