Reply
Thread Tools
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#51
If you don't accidentally overwrite anything you just need to reboot your phone to revert the changes you made by chrooting and mounting.
Huh? You can always exit your chroot:ed evironment and use umount to unmount whatever has been mounted. Rebooting is ... just wrong.
 
Marshall Banana's Avatar
Posts: 94 | Thanked: 209 times | Joined on Oct 2009 @ Germany
#52
Originally Posted by Joorin View Post
Huh? You can always exit your chroot:ed evironment and use umount to unmount whatever has been mounted. Rebooting is ... just wrong.
y, that's a good point. I'm not a diligent unmounter
 
Posts: 255 | Thanked: 61 times | Joined on Feb 2010
#53
Can I use ubuntu 10.04 (i386) for this?
 
Posts: 173 | Thanked: 160 times | Joined on Jan 2010 @ London, UK
#54
Latest Ubuntu should be okay, I've been meaning to try a newer chroot base and wine as I think lack of NPTL should be okay not a forced requiement.

I've had mixed results so far, with many windows apps never opening up a window, for example wordvrw.exe. I'm not sure why much would fail. I though the main disadvantage would just be resources like cpu speed, ram and screen size.
 
Posts: 173 | Thanked: 160 times | Joined on Jan 2010 @ London, UK
#55
Originally Posted by Marshall Banana View Post
First thank you again for your present work and the howto

Here is what i tried:
I downloaded your qemu-Build and registered it to run i386-binaries.

I tried to run a static linked i386-binary and a dynamic linked binary, they both worked but for the dynamic linked one i had to execute qemu explicitly:
Code:
../qemu-386 ./ld-linux.so.2 --library-path `pwd` ./otrdecoder
because
Code:
/ld-linux.so.2 --library-path `pwd` ./otrdecoder
just gave me: ./ld-linux.so.2: line 1: syntax error: "(" unexpected
Yeah I had it work on an ubuntu ld-liux.so but not slackware, I suspect just differing magic sequence of bytes in the ELF header.
otrdecoder is a closed source downloader/decoder for an internet tv recorder service: www.onlinetvrecorder.com). I can execute them and the tell me about their command line arguments but they complain that they can't connect to the server. I guess that's because qemu doesn't provide network access.

Did you leave out the networking functionality of qemu in your build or did i just not configure it properly?

I just missed a few networking libraries (libresolv, libnss*), now i can run & use otrdecoder on the n900 .
You also need to be online 1st. I run an auto idling script fm the if-up.d myself.

I did not create a full chroot environment with wine yet. Collecting all the libraries for the dynamically linked binary was enough work for me . So i can't say if that part of your howto works.
Edit: i'm doing this right now
Good luck. One thing I mean try try is touching a file before testing on a normal x86 system, then using find / -anewer /fileyoutouched
to create a list of files for a very minimal chroot.
 

The Following 3 Users Say Thank You to damion For This Useful Post:
Posts: 173 | Thanked: 160 times | Joined on Jan 2010 @ London, UK
#56
Originally Posted by Marshall Banana View Post
"
The hardest part will be to "fill" up your chroot environment. You need an old i386 linux installation with a working xserver and wine (like i. e. slackware 10.2) and copy all the stuff that is necessary to run the xserver and wine (/etc /usr/lib /usr/X11/lib /usr/X11/bin /usr/bin /lib /bin /sbin).
You do not need an xserver, you should be able to talk to the existing one. In fact given time I'd investigate what the easy arm debian chroot is doing.

My tip: Don't be a chicken and try it out . Make a backup before you start in case you need to reflash.
If you always stay as a user and use ./qemu itself to envoke stuff, I'd go as far as to say that this is pretty much zero risk. There is always some risk doing anything as root, that you delete or overwrite something by mistake if you're new and make a mistake. But there aren't any flash requiring kernel changing weirdnesses here to make this ricky. It is however, fairly UNIXy and technical, hard for anyone who isn't experienced to follow.


Put your chroot directory in /opt and be careful not to overwrite anything (like /dev on your phone or /etc). If you don't accidentally overwrite anything you just need to reboot your phone to revert the changes you made by chrooting and mounting.
I using mount -o bind a few times so I was adding a smidgen of risk that I'd go near my own filesystem.
 
Marshall Banana's Avatar
Posts: 94 | Thanked: 209 times | Joined on Oct 2009 @ Germany
#57
You do not need an xserver, you should be able to talk to the existing one. In fact given time I'd investigate what the easy arm debian chroot is doing.
Good to know, thx! So the x86 x11 libraries that wine or x86-xterm call use the existing xserver on the n900?

Good luck. One thing I mean try try is touching a file before testing on a normal x86 system, then using find / -anewer /fileyoutouched
to create a list of files for a very minimal chroot.
My approach for creating a minimal chroot environment with i386 Ubuntu 8.04:
I use strace and call the x86 binary i want to run on the n900 and filter out all the "open" calls:
Code:
strace xterm 2>&1 | grep 'open("' | grep -o '"/.*",' | grep -o '[^"]*' | sort | uniq | grep -v "/dev" | grep -v "/proc" > list_xterm.txt
I add some more stuff to that list (i.e. output of dpkg -L xterm or /home/user/.wine) and create a tar with it. Hopefully i get a working minimal chroot environment out of this.
 
Posts: 173 | Thanked: 160 times | Joined on Jan 2010 @ London, UK
#58
Yeah, strace is another good way to achieve good results. Of course you might want a shell and other utilities as basic as ls, which if you're not run under strace or relying on an atime enabled mount and use find, then you realise you've missed them all too late :-/ It's a pity it takes so long to copy a large dist over to the phone, otherwise I wouldn't skimp so much.

The instructions with a mount -o bind /tmp/.X11-unix/. provide access to the X0 socket in that directory which is what X11 libs use when DISPLAY=:0, if the X server isn't run with -nolisten tcp then localhost:0 would work (127.0.0.1 port 6000) using tcp. I suspect easy debian chroot is using one of those two techniques. Frankly the idea of tweaking my X server start up scripts and rebooting scares the hell out of me, that IS a sure fire way to risk bricking.
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#59
Hm.... Doesn't system qemu have a "-L" option for setting the dynamic loader's library path? And doesn't recent versions of qemu support NPTL? At least I've seen a few x86 patches for it.
 
Posts: 36 | Thanked: 11 times | Joined on Nov 2009
#60
Is it possible to run Blade Runner that way?
 
Reply


 
Forum Jump


All times are GMT. The time now is 19:32.