Reply
Thread Tools
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#11
"
I am doing this in sudo gainroot mode. I assumed that was the same as "chroot shell", but is it?"

No. AFAIK.

"I got the message:
Quote:
WARNING: The following packages will be removed.
This should NOT be done unless you know exactly what you are doing!
busybox sysvinit
Is this OK?"

It's ok if you want to kill your internet tablet... They make up core components.
 

The Following User Says Thank You to qwerty12 For This Useful Post:
dormant's Avatar
Posts: 332 | Thanked: 76 times | Joined on Oct 2007 @ St. Augustine, Trinidad and Tobago
#12
Thanks.

I am clearly WAY out of my depth here, so I'll give up ... for now.
__________________
  • N900
  • N800
  • LD-3W
  • two magic OTG USB adapters
  • crossed fingers
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#13
A chroot shell means a shell obtained by chrooting.

The chroot command (implementing the chroot call) makes all processes spawned by it (typically a shell, and whatever is run from that shell) see something other than the real root directory ( / ) as the root directory.

Perhaps the most common use of chroot is on rescue CDs for fixing broken Linux installs, which boot up using an image on the CD, mount your harddrive somewhere, and chroot there. It's also used for running things (daemons, typically) in a "chroot jail", so that any exploits that compromise that service can't propagate upward and compromise the whole machine. A particularly famous instance of that use is in the iPhone, hence the term "jailbroken" for an iPhone from whose chroot jail has been compromised. But it's also used for running similar, but different, systems on the same machine. The kernel has to be the same, since there's only one kernel running, but system libraries can differ.

So you could set up a debian root filesystem on your SD card, then
Code:
chroot /media/mmc2/debroot/
would start /media/mmc2/debroot/bin/sh (which would think it was /bin/sh) thinking that /media/mmc2/debroot/ was /. And you could have completely different libraries in that filesystem, and programs linked against them rather than the N800 versions, and they'd run just fine.
 

The Following 2 Users Say Thank You to Benson For This Useful Post:
dormant's Avatar
Posts: 332 | Thanked: 76 times | Joined on Oct 2007 @ St. Augustine, Trinidad and Tobago
#14
Ah, I see.

The original poster said:

You'd need a SD card formated ext2 or ext3 that has at least 500Mbytes of free space. It would probably be easiest to format the card and unpack the file on another computer running linux, but everything can be done on the N800. There are various articles that explain how to do that and I can provide pointers. The only other thing is the gzipped environment is 90Mbytes. Any ideas where I could post it?
I could do all that, but where to find the files?

Edit: found it!
__________________
  • N900
  • N800
  • LD-3W
  • two magic OTG USB adapters
  • crossed fingers

Last edited by dormant; 2008-03-18 at 20:18.
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#15
gjarboni has the files, but is apparently still looking for someplace to host them.

Alternatively, the debian sneak preview thread has links, I believe. That image would probably work too.
 
Posts: 7 | Thanked: 0 times | Joined on Jul 2007
#16
Actually, I finally did manage to get gphoto2 to detect my camera. The problem was that the /dev directory in the chroot directory didn't have entries for the usb camera (or the usb adapter in host mode, I'm not sure which). Once I did that I can run gphoto2 -L (or -P) once with no problem. However the second command always causes the tablet to reboot. I just tried with a clean installation of the latest release of OS2008 (with becomeroot as the only package installed) and I'm getting the same results. So there's either something wrong with the OS2008 kernel, something inherently wrong with two different applications (using different libraries) trying to access the same USB port.

If someone wants to try the chroot environment that Dormant found, after doing a few apt-get install commands you will reach a point where you'll have to remove a key package and type in the phrase "Yes, do as I say!". This is fine AS LONG AS YOU ARE INSIDE THE CHROOT JAIL. The worst thing that can happen is that you'd break the armel-root-fs directory and have to unpack it again. I did such an update/upgrade and the chroot jail still worked fine. I believe I installed, joe, bash, & some of the networking utilities that I mentioned before to get to that point.

I might try to download the NSLU2 version of gphoto2 to see if that makes any difference. Actually, could someone point me to a link for that? Thanks.
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#17
Hi, I have a working Debian chroot, just as you describe. It uses Johnx's bootable Debian install, and then, with a small script that mounts the partition, binds /dev and /proc and then chroots into Debian, I can apt-get anything in the Debian armel repositories (which need to be updated in the linked install that I gave you), and run it on the command line or, if I need a desktop, I've installed XFce4 and tightvncserver in the chroot so I can start that up and use VNC Viewer to use the app.

EDIT: I got X applications working, too. They won't be "hildonized" but they work! Check this post for details.
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!

Last edited by qole; 2008-05-09 at 00:24.
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#18
Originally Posted by Benson View Post
Perhaps the most common use of chroot is on rescue CDs for fixing broken Linux installs, which boot up using an image on the CD, mount your harddrive somewhere, and chroot there. It's also used for running things (daemons, typically) in a "chroot jail", so that any exploits that compromise that service can't propagate upward and compromise the whole machine. A particularly famous instance of that use is in the iPhone, hence the term "jailbroken" for an iPhone from whose chroot jail has been compromised. But it's also used for running similar, but different, systems on the same machine. The kernel has to be the same, since there's only one kernel running, but system libraries can differ.
chroot is very commonly used for exactly what we want to do here, which is running applications from a different variation of the OS. For instance, people who install 64-bit Linux on their desktop machines soon discover that many programs don't work with their OS. So they install a 32-bit version of Linux in a chroot and then they can run both 32-bit and 64-bit applications. That's where I learned how to do the tricks I mention in the linked post above.
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!

Last edited by qole; 2008-05-11 at 02:58.
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#19
Interesting; in most of what I'm familiar with, people install full 32-bit and 64-bit userlands in the same fs hierarchy. Most 64-bit distros (that I know about) put 64-bit libraries in /lib64/, /usr/lib64/, etc., and 32-bit libraries in the usual places.

If your distro had 64-bit libs in /lib/, then that would definitely be the way to go, if you need 32-bit programs. (If you can duck proprietary software, you can just compile all the extra stuff from source...)
 
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#20
Yeah, chroot is not needed for 32bit programs in a 64bit environment. You just have to be careful not to mix the libs
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 08:42.