|
2010-11-23
, 23:38
|
Posts: 346 |
Thanked: 271 times |
Joined on Jan 2010
|
#72
|
echo ":qemu-i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff\xff:/home/user/qemu-i386:" > /proc/sys/fs/binfmt_misc/register
chroot ./ chroot: cannot execute /bin/bash: No such file or directory file bin/bash bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped (On my PC): ldd /media/00558657-94dd-411e-9a75-b5ad64e5e8dc/bin/bash libncurses.so.5 => /lib/libncurses.so.5 (0x00848000) libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x00432000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x009dd000) /lib/ld-linux.so.2 (0x0011a000) ls -l lib/libncurses.so.5 lib/tls/i686/cmov/libdl.so.2 lib/tls/i686/cmov/libc.so.6 lrwxrwxrwx 1 root root 17 2010-11-07 18:06 lib/libncurses.so.5 -> libncurses.so.5.6 lrwxrwxrwx 1 root root 14 2010-11-07 18:06 lib/tls/i686/cmov/libc.so.6 -> libc-2.8.90.so lrwxrwxrwx 1 root root 15 2010-11-07 18:06 lib/tls/i686/cmov/libdl.so.2 -> libdl-2.8.90.so
|
2011-01-12
, 13:33
|
Posts: 1,522 |
Thanked: 392 times |
Joined on Jul 2010
@ São Paulo, Brazil
|
#73
|
|
2011-03-07
, 01:39
|
|
Posts: 21 |
Thanked: 15 times |
Joined on Jan 2011
|
#74
|
Nokia-N900:/.maewine# chroot . chroot: cannot execute /bin/sh: No such file or directory Nokia-N900:/.maewine# bin/sh /lib/ld-linux.so.2: No such file or directory Nokia-N900:/.maewine# file bin/sh bin/sh: symbolic link to `bash' Nokia-N900:/.maewine# file bin/bash bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.15, dynamically linked (uses shared libs), stripped Nokia-N900:/.maewine# lib/ld-linux.so.2 Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...] <SNIP> Nokia-N900:/.maewine# lib/ld-linux.so.2 --library-path lib bin/bash Nokia-N900:/.maewine# ls bash: fork: Invalid argument Nokia-N900:/.maewine#
|
2011-04-14
, 16:15
|
Posts: 22 |
Thanked: 12 times |
Joined on Mar 2011
|
#75
|
|
2011-04-15
, 01:06
|
Posts: 395 |
Thanked: 509 times |
Joined on Jan 2011
@ Brisbane, Australia
|
#76
|
# HOWTO:
# I've put hashes at the start of the line, so you could practically execute
# This file and expect it to work to a degree.
# bring up a terminal and from within /home/user (the default):
wget http://a.trap.me.uk/qemu-i386
chmod 755 ./qemu-i386
# test it works
./qemu-i386
# If this seems to output directions for use, this is working.
sudo gainroot
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
# Your phone can now execute arbitrary statically linked x86 binaries
# or with some effort, (./ld-linux.so.2 --library-path `pwd` ./filename)
# any x86 linux binary.
# Set up the chroot with wine...
# I tarred up /etc /usr/lib /usr/X11/lib /usr/X11/bin /usr/bin /lib /bin /sbin
# from (it turns out) an old slackware 10.2 install that had had wine
# installed at some point in the past, ~version 0.9.14.
# extract the chroot in to /chroot (or wherever you want that has space)
# ... actually DON'T use rootfs space, but I'll use /chroot for ease of
# writing this.
# as root
cd /chroot
mkdir -p proc dev tmp/.X11-unix
chmod 777 tmp && chmod +t tmp
# I can't remember the octal for sticky in one go
# copy the phone's /dev, something like:
tar cf blah.tar /dev && tar xf blah.tar
# by default tar strips the leading / so this probably works.
mount -o bind /tmp/.X11-unix tmp/.X11-unix
mount -t proc none proc
mount -t devpts dev/pts
vi etc/mtab etc/passwd
# ... edit to suit your needs. mtab should be small with mainly just /
# referenced, in passwd put a user:29999 account
# TEST full x86 chroot!!!
chroot /chroot
# You should see: bash-2.0# Or similar, and stuff like ls should work!
su - user
export DISPLAY=:0
/usr/X11/bin/xterm
# Oh I needed a symblink for X11 to X11R6 too, I also think I edited
# /etc/ld.so.conf to contain X libs, also I lack terminal definition files
# from that list of directories so I can't do some curses stuff.
# After your success running xterm as x86, which itself fork()ed bash
# again and showed a pretty impressive speed, you're 95% of the way
# there.
# Copy existing known .wine/ hierarchy ??? I think I happened to have
# one in /home/damion from where I nabbed the x86 chroot stuff.
# Then...
wine-pthread ./sol.exe
# Obviously you'll need sol.exe from XP or something and obviously you
# can use whatever wine stuff you need, not just sol You need
# wine-pthread, wine on its own segvs for me. I used to run wineserver
# 1st, but wine-pthread can successfully fork wineserver within this
# chroot without issue for me.
# Profit.
|
2011-04-16
, 05:16
|
Posts: 395 |
Thanked: 509 times |
Joined on Jan 2011
@ Brisbane, Australia
|
#77
|
Nokia-N900:/opt/chroot# chroot . chroot: cannot execute /bin/sh: Exec format error
|
2011-06-02
, 12:22
|
Posts: 173 |
Thanked: 160 times |
Joined on Jan 2010
@ London, UK
|
#78
|
|
2011-06-03
, 12:09
|
Posts: 162 |
Thanked: 351 times |
Joined on Apr 2006
@ Cotswolds, UK
|
#79
|
Anyone?Code:Nokia-N900:/opt/chroot# chroot . chroot: cannot execute /bin/sh: Exec format error
|
2011-06-07
, 12:12
|
Posts: 173 |
Thanked: 160 times |
Joined on Jan 2010
@ London, UK
|
#80
|
The Following User Says Thank You to damion For This Useful Post: | ||
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
did not return errors.
What could be wrong here ?
Edit: wait, the command
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
don't prints on stderr but returns an error code of 1
strace says:
write(1, ":i386:M::\\x7fELF\\x01\\x00\\x00\\x00"..., 179) = -1 EINVAL (Invalid argument)
Last edited by Megaltariak; 2010-11-23 at 21:17.