You are not logged in.

#1 2010-04-15 10:30:05

passbe
Member
Registered: 2009-03-14
Posts: 74
Website

chroot possibility?

I have an embedded linux device that i would like to install certain programs on. These programs have dependencies that conflict with the base system, therefore I cannot use a package management system or build from source. So my question,

Is is possible to chroot an application, so that the application looks at the physical / partition except for certain directories. In my case /usr/bin or /usr/local/bin.

What i would like to do is get several programs running on different versions of /usr/bin or /usr/local/bin.

Am I understanding chroot correctly? Is there an alternative?

any help is greatly appreciated.

Offline

#2 2010-04-15 11:44:48

Ber
Member
From: Belgium
Registered: 2006-07-05
Posts: 80
Website

Re: chroot possibility?

I don't know if it's possible to do that with chroot, but I don't think it would be a good idea...  If these programs conflict with the base system it's for a good reason.  But I must stay I don't see where the problem is.  What exactly does conflict with what?


V=RI sweet V=RI

Offline

#3 2010-04-15 14:37:25

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: chroot possibility?

You could do something like this:

mkdir /newplace/{root,usrbin,usrlocalbin}
mount -o bind / /newplace/root
mount -o bind /newplace/usrbin /newplace/root/usr/bin
mount -o bind /newplace/usrlocalbin /newplace/root/usr/local/bin
chroot /newplace/root /bin/bash

Then you'll be chrooted into a live copy of your filesystem, with an empty /usr/bin and /usr/local/bin layered on top. To leave, do:

exit
umount /newplace/root{/usr/local/bin,/usr/bin,/}

Offline

#4 2010-04-16 02:18:27

passbe
Member
Registered: 2009-03-14
Posts: 74
Website

Re: chroot possibility?

@Ber: it is a Debian based system, in which certain versions of libraries cannot be updated because it breaks the device itself. (eg. libc6). And these programs im trying to install on it require a higher version that is currently supported.

@Profjim: that looks exactly like what im trying to achieve, I wonder, can I symlink everything from /usr/bin to /opt/[appname]/usrbin apart from those individual libraries that need to be updated.

Of course the next step is trying to figure out how i can compile these libraries in those directories. If i do a "make" and then copy the binary file across, should that work?

Thanks guys.

Offline

Board footer

Powered by FluxBB