![]() |
Using a chroot shell to run non-Maemo text mode apps
I work in networking and my N800 (running OS2008) would be a lot more useful to me were I able to run any text mode app that's part of the Debian armel port. I've tried doing that by hacking at the package system to convince it that packages don't have dependencies they actually have (like a version of libc > 2.5, for example). This would usually end up with a N800 that wouldn't function well or wouldn't boot at all.
Then I came up with another idea. Find a more standardized armel install and create a chroot environment on a flash card. From this environment I can run "apt-get install <any package> without breaking any software on the N800. Some apps that aren't ported to OS2008 (btscanner, for example) run fine in such an environment[1]. I'm wondering if anyone else would be interested in having a similar set up. Just for the record, I'm not interested in replacing Maemo, I just want to be able to run apps, that I can't run currently[2]. 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? Thanks for reading, Jason M. (gjarboni) [1] Trying to control btscanner using a bluetooth keyboard didn't work. I don't know if that would work using the version of btscanner that runs on OS2007. [2] Apps like, nmap, tftpd, telnet, ftp, etherwake, vpnc. Some of these are available for OS2007 or OS2006, but it's hard to find all of them. With an armel chroot environment you can pull all of them from the debian armel repository using the apt-get install command. |
Re: Using a chroot shell to run non-Maemo text mode apps
It's a nice idea.
Without knowing anything about packages ... Can't we just hack away at the dependancies instead? Have 2 versions of libc installed for example? |
Re: Using a chroot shell to run non-Maemo text mode apps
The libraries have to be stored /lib or /usr/lib and are loaded by name. For example applications are linked against libc.so.6. In maemo that is a symlink to libc-2.5.so. So every app needs to use libc-2.5.so. The chroot environment gets around this limitation.
|
Re: Using a chroot shell to run non-Maemo text mode apps
I think I might be interested.
Would this allow me to install gphoto2? There is a package for the Linksys NSLU2, which I think is ARMEL. |
Re: Using a chroot shell to run non-Maemo text mode apps
gphoto2 seems to install, but one library doesnŽt get configured (output below). IŽd try to test it, but I think I need a special adapter to make the USB port on my n800 a host port.
Jason M. P.S. Ignore the perl errors. They happen with every package installation. root@Nokia-N800-50-2:/tftpboot# apt-get install gphoto2 Reading package lists... Done Building dependency tree... Done The following extra packages will be installed: libcdk5 libdbus-1-3 libexif12 libgphoto2-2 libgphoto2-port0 libhal1 libltdl3 Suggested packages: gtkam gthumb Recommended packages: dbus The following NEW packages will be installed: gphoto2 libcdk5 libdbus-1-3 libexif12 libgphoto2-2 libgphoto2-port0 libhal1 libltdl3 0 upgraded, 8 newly installed, 0 to remove and 115 not upgraded. Need to get 2673kB of archives. After unpacking 7860kB of additional disk space will be used. Do you want to continue [Y/n]? y WARNING: The following packages cannot be authenticated! libcdk5 libdbus-1-3 libexif12 libhal1 libltdl3 libgphoto2-port0 libgphoto2-2 gphoto2 Install these packages without verification [y/N]? y Get:1 http://www.gtlib.gatech.edu sid/main libcdk5 5.0.20060507-1 [111kB] Get:2 http://www.gtlib.gatech.edu sid/main libdbus-1-3 1.1.2-1 [132kB] Get:3 http://www.gtlib.gatech.edu sid/main libexif12 0.6.16-2.1 [236kB] Get:4 http://www.gtlib.gatech.edu sid/main libhal1 0.5.10-5 [394kB] Get:5 http://www.gtlib.gatech.edu sid/main libltdl3 1.5.26-1 [178kB] Get:6 http://www.gtlib.gatech.edu sid/main libgphoto2-port0 2.4.0-8 [129kB] Get:7 http://www.gtlib.gatech.edu sid/main libgphoto2-2 2.4.0-8 [1296kB] Get:8 http://www.gtlib.gatech.edu sid/main gphoto2 2.4.0-1 [197kB] Fetched 2673kB in 10s (265kB/s) perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_MESSAGES = "en_US", LANG = "en_US" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Selecting previously deselected package libcdk5. (Reading database ... 10999 files and directories currently installed.) Unpacking libcdk5 (from .../libcdk5_5.0.20060507-1_armel.deb) ... Selecting previously deselected package libdbus-1-3. Unpacking libdbus-1-3 (from .../libdbus-1-3_1.1.2-1_armel.deb) ... Selecting previously deselected package libexif12. Unpacking libexif12 (from .../libexif12_0.6.16-2.1_armel.deb) ... Selecting previously deselected package libhal1. Unpacking libhal1 (from .../libhal1_0.5.10-5_armel.deb) ... Selecting previously deselected package libltdl3. Unpacking libltdl3 (from .../libltdl3_1.5.26-1_armel.deb) ... Selecting previously deselected package libgphoto2-port0. Unpacking libgphoto2-port0 (from .../libgphoto2-port0_2.4.0-8_armel.deb) ... Selecting previously deselected package libgphoto2-2. Unpacking libgphoto2-2 (from .../libgphoto2-2_2.4.0-8_armel.deb) ... Selecting previously deselected package gphoto2. Unpacking gphoto2 (from .../gphoto2_2.4.0-1_armel.deb) ... Setting up libcdk5 (5.0.20060507-1) ... Setting up libdbus-1-3 (1.1.2-1) ... Setting up libexif12 (0.6.16-2.1) ... Setting up libhal1 (0.5.10-5) ... Setting up libltdl3 (1.5.26-1) ... Setting up libgphoto2-port0 (2.4.0-8) ... Setting up libgphoto2-2 (2.4.0-8) ... * udev requires a mounted sysfs, not started. failed! invoke-rc.d: initscript udev, action "reload" failed. Setting up gphoto2 (2.4.0-1) ... |
Re: Using a chroot shell to run non-Maemo text mode apps
Actually, I spent some time trying to get this to work in the chroot shell with no success. Even if I fix the install error for libgphoto2-2, gphoto2 still won't autodetect my camera. Gphoto2 works fine on my eee with my camera and I can use a USB Ethernet dongle on my N800, so I'm pretty confident the problem is in software.
|
Re: Using a chroot shell to run non-Maemo text mode apps
Hello, I was going to join in with some testing, but my n800 has just gone into "Not Charging" mode.
I had a few problems with gphoto2 not detecting the camera on my laptop, especially for Canon cameras. Excuse my dumbness, but which repo do I need to add in order to fetch gphoto2 with apt-get? |
Re: Using a chroot shell to run non-Maemo text mode apps
Quote:
Code:
Catalog name: Debian armel |
Re: Using a chroot shell to run non-Maemo text mode apps
Thanks.
I have a lot of "unmet dependencies" as I'm starting from a relatively clean OS2008 setup. But I guess I just install everything it tells me to. |
Re: Using a chroot shell to run non-Maemo text mode apps
I'm scared now. To meet all the dependencies, I need to install
I got the message: Quote:
I am doing this in sudo gainroot mode. I assumed that was the same as "chroot shell", but is it? |
Re: Using a chroot shell to run non-Maemo text mode apps
"
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. |
Re: Using a chroot shell to run non-Maemo text mode apps
Thanks.
I am clearly WAY out of my depth here, so I'll give up ... for now. |
Re: Using a chroot shell to run non-Maemo text mode apps
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/ |
Re: Using a chroot shell to run non-Maemo text mode apps
Ah, I see.
The original poster said: Quote:
Edit: found it! |
Re: Using a chroot shell to run non-Maemo text mode apps
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. |
Re: Using a chroot shell to run non-Maemo text mode apps
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. |
Re: Using a chroot shell to run non-Maemo text mode apps
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. |
Re: Using a chroot shell to run non-Maemo text mode apps
Quote:
|
Re: Using a chroot shell to run non-Maemo text mode apps
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...) |
Re: Using a chroot shell to run non-Maemo text mode apps
Yeah, chroot is not needed for 32bit programs in a 64bit environment. You just have to be careful not to mix the libs :)
|
All times are GMT. The time now is 16:07. |
vBulletin® Version 3.8.8