Chroots? (Or Mr Rob's goes insane)


Mr Rob

Active Member
Joined
Apr 23, 2011
Messages
805
Age
38
Location
Fargo, North Dakota, USA.
Hey all:


I did a search on the boards, and didn't find much information about setting up chroots in the past....


Backstory: I used the 'install Debian to an SD card trick' which gives me access to Debian's massive repository for packages. Yay, games like PokerTH and Frozen Bubble play perfectly well on the Pandora in Debian. But you can't simply take all the libraries and binaries, reboot into Angstrom, and expect them to work (different versions of libc or something like that? I'm not enough of an expert) as they all simply segfault when you try to run them.


So, take the libraries and the binaries, fire up a chroot in Angstrom, and I can now play the two games just fine using the Debian files in a chrooted environment from within Angstrom. Beautifully in fact.


Now, I know you're all thinking this may cause a host of other problems (mount command to pass through necessary things to the chroot like /dev and such, bigger PND sizes as you'll need a lot more than usual inside the PND to make it go), but on the other hand, PokerTH is difficult to port (and no one has done it yet) due to QT not being nice to build/cross compile for my Pandora (for me at least), and some strange problem with Angstrom's version of Perl for Frozen Bubble leaves it unPND'ed at the moment.


So are there a host of problems that I don't see with chroots that make this impossible for our setup, or just a host of problems that make this impractical yet worth it as it brings more games to our devices?
 
There are already 2 of them made by other community members, personally I am using PanDebian. I think the CHROOT stuff can be found on gp32x.de , none are posted here I think.


PanDebian is in the repo. I have OpenOffice running under it.
 
Last edited by a moderator:
There are already 2 of them made by other community members, personally I am using PanDebian. I think the CHROOT stuff can be found on gp32x.de , none are posted here I think.


PanDebian is in the repo. I have OpenOffice running under it.

No, not 'how to get Debian working' cause that's fine. Perhaps I was vague. I'm talking about making a "Frozen Bubble" PND (for example, but any app would do) that creates a chroot environment with the Debian bits and uploading it for everyone to use, not just those who want to have a full Debian environment.
 
Last edited by a moderator:
A chroot is waaay too heavyweight for that sort of thing. You just want a tool to drag in all the dynamic dependencies that aren't already present on the Pandora.
 
A chroot is waaay too heavyweight for that sort of thing. You just want a tool to drag in all the dynamic dependencies that aren't already present on the Pandora.

And your solution to the following is...?



Code:
usr/games/pokerth: /lib/libc.so.6: version `GLIBC_2.10' not found (required by /media/LEFT/pth/usr/lib/libQtNetwork.so.4)


Pandora's libc is different than PanDebian (Debian 6.0.3)'s /lib/libc.so.6. And you can't simply add PanDebian's /lib/libc.so.6 to your path because that'll segfault (I understand why, though I doubt I could explain it intelligently tonight).


A chroot solves this problem.


Other ideas?
 
http://www.gp32x.de...-to-build-apps/


Where there is source, there is a way... surely? I'm going to try and compile Frozen Bubble on my Pandora for luls!

I do understand your point (and I do have the cross compiler on my laptop and a compiler set up on my Pandora), but still, sometimes there are incompatibilities that'll can't seem to be solved without being a master of space and time.


But let me know if you have any luck.

You can try, but pearl is your enemy here ;)
Exactly, I run into some wacky Perl error; according to the interwebs it is due to different versions of a Perl library and the underlying Perl itself in Angstrom's repos. If these were easy to fix, you'd assume that Frozen Bubble would already have been ported, since it's a pretty standard (and lovable) Linux game.

Tried messing around with LD_PRELOAD and the like?

Yep, no luck, but thanks for the thought.


Other ideas? I'm really tempted to make a PND for one of these that scripts up the chroot to see how well it can be packaged. The biggest issue is that you'll need root access to do the chroot and the mount --bind for /dev and other necessary filesystems to pass through, and I understand that it's dumb to have a PND prompt for your admin password all the time. This could be solved by sticky bits or sudoers access for chroot and mount and the like, but everyone would need that on their Pandora, which would involve a discussion as to whether it's safe enough to do, and a push out by another hotfix.
 
Last edited by a moderator:
If these were easy to fix, you'd assume that Frozen Bubble would already have been ported, since it's a pretty standard (and lovable) Linux game.

That's an extremely good point, and it had crossed my mind. I dived into setting up a build environment on my Pandora and bricked it faster than you could say "GAH!" Fortunately I had installed to SD and it was an easy fix ( curse you, ncurses! )


How difficult would it be to, first and foremost, isolate the libraries actually required to get, for example, Frozen Bubble up and running?


I'm probably in way over my depth here. If it weren't so painful to install a full Debian Chroot ( it takes hours, ugh ) then it wouldn't be much of an issue, as it's useful for quite a few apps.


Is it not possible to ask for root once, and then add the particular PND ( or the bit that makes it run ) as an always-run-as-root thing in sudoers?
 
If these were easy to fix, you'd assume that Frozen Bubble would already have been ported, since it's a pretty standard (and lovable) Linux game.
That's an extremely good point, and it had crossed my mind. I dived into setting up a build environment on my Pandora and bricked it faster than you could say "GAH!" Fortunately I had installed to SD and it was an easy fix ( curse you, ncurses! )
If you take the ncurses from the NAND and copy it over to the SD card after setting up the environment, all's well, I believe.

How difficult would it be to, first and foremost, isolate the libraries actually required to get, for example, Frozen Bubble up and running?
Isolating libraries is easy. The problem is the /lib/libc.so.6 that is bound to certain builds, I don't think you can dynamically link something as low level as that. Though I'll admit I'm not the expert on that....

I'm probably in way over my depth here. If it weren't so painful to install a full Debian Chroot ( it takes hours, ugh ) then it wouldn't be much of an issue, as it's useful for quite a few apps.
I didn't go with the full Debian Chroot, there's a pre-built Debian image floating around; just like running Angstrom from an SD Card, you just boot up into Debian. It's rather nice (small, too).

Is it not possible to ask for root once, and then add the particular PND ( or the bit that makes it run ) as an always-run-as-root thing in sudoers?
Yes, you're completely right. The script that runs the 'PND' could take care of some of the maintenance work first, so that's certainly an option. I just don't want to release a PND into the wild that does exactly that without first consulting some of the more veteran developers, as it sort of goes against the current design of things.
 
Is it not possible to ask for root once, and then add the particular PND ( or the bit that makes it run ) as an always-run-as-root thing in sudoers?
Yes, you're completely right. The script that runs the 'PND' could take care of some of the maintenance work first, so that's certainly an option. I just don't want to release a PND into the wild that does exactly that without first consulting some of the more veteran developers, as it sort of goes against the current design of things.
(I'm the pnd_run.sh maintainer) I for one will not add any feature allowing a PND to run as root without notifying the user (even if would realy be trivial).


If your PND need root privilieges see gparted PND ;)
 
(I'm the pnd_run.sh maintainer) I for one will not add any feature allowing a PND to run as root without notifying the user (even if would realy be trivial).


If your PND need root privilieges see gparted PND ;)

I completely agree with you; wayward PNDs are not the solution.


What do you think is best, setb (I'm using Frozen Bubble as the example here, but there are probably other applications in Debian's repo that aren't on the Pandora yet)?


1. PNDs can have multiple applications in them, one could be a setup script that (with permission) modifies /etc/sudoers so that mount and chroot run without prompting for passwords every time, and once a user runs it once, they can just run the Frozen Bubble after that. It would work, but I'm a bit leery of having a PND modify the system in such a way....


2. Or just one script that prompts for the password each time (like GParted). This is fine for GParted, as people should realize it needs it. Frozen Bubble prompting for the password may raise more eyebrows. We could then explain why Frozen Bubble needs root access on each run in the documentation, and if the user don't like the idea, it's their choice to play Frozen Bubble or not.


Of course the best course of action is to build it natively, but that's not always an option, and chroots would add some more applications, which is always good.
 
Current chromium PND is a repackaging of the debian stuff using LD_PRELOAD and LD_LIBRARY_PATH. It goes down to include the debian libc. No need for chroot there.


Also adding thing to the sudoers to play a _game_ is a _realy_ bad idea


For frozenBubble, it shouldnt be too hard to actually build perl and the requiered modules to make it run ;)
 
Current chromium PND is a repackaging of the debian stuff using LD_PRELOAD and LD_LIBRARY_PATH. It goes down to include the debian libc. No need for chroot there.


Also adding thing to the sudoers to play a _game_ is a _realy_ bad idea


For frozenBubble, it shouldnt be too hard to actually build perl and the requiered modules to make it run ;)

So you can go all the way down and LD_PRELOAD libc, too? I'll have to try that tonight. You're talking about chromium-dev in the repo, right? I'll open that up to see how it does it.
 
IT LIVES!!!! PokerTH from Debian is running like a charm on my Angstrom. Well, resolution issues, but it executes.


Did you know you can execute ld-linux.so.3? And pass it things? I didn't.
 
For frozenBubble, it shouldnt be too hard to actually build perl and the requiered modules to make it run ;)

ooooh, I tried... I tried hard ;)

Ooor, I take Debian 6's Perl binaries, wrap them up with Debian 6's Frozen-Bubble, and do the same hacks to get it to work just like PokerTH is now running (I should document this, too). Might be a day or two before I get around to it, but it's a solution.
 
Back
Top