View Single Post
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#59
Sorry for all the posts. This is a different question, though.

I want to be able to chroot to my Debian partition and run X programs.

When I try running any kind of X program from the chroot, however, I get some variation on "cannot open display".

Anybody have any ideas? I've tried messing with xhost, the DISPLAY variable, etc. I just can't figure it out.
EDIT: I got it figured out!

I just needed to bind the /tmp and /dev/pts dirs.

Here's my chroot script. See below for notes.
Code:
###
#mount the Debian partition.
insmod /mnt/initfs/lib/modules/2.6.21-omap1/mbcache.ko
insmod /mnt/initfs/lib/modules/2.6.21-omap1/ext2.ko
mount /dev/mmcblk0p4 /opt -o noatime
###
#make the tablet's devices available to Debian.
mount --bind /dev /opt/dev
mount --bind /proc /opt/proc
###
#Gentoo wiki says this will make X work.
mount -t devpts none /opt/dev/pts
mount --bind /tmp /opt/tmp
###
#Mount various external devices (SD cards, USB devices)
mount --bind /media /opt/media
mount --bind /media/mmc1 /opt/media/mmc1
mount --bind /media/mmc2 /opt/media/mmc2
mount --bind /media/usb /opt/media/usb
###
#Make the Internet work.
cp /opt/etc/resolv.conf /opt/etc/resolv.conf.old
cp /etc/resolv.conf /opt/etc/resolv.conf
cp /opt/etc/hosts /opt/etc/hosts.old
cp /etc/hosts /opt/etc/hosts
###
#Custom prompt. Reduces confusion.
export PS1="[\u@Debian: \w]"
###
#Actually chroot. 
chroot /opt
Here's Debian armel XEyes running on my Hildon desktop.

Notes:
  • You will need to change /dev/mmcblk0p4 to your partition.
  • You may want to mount the partition somewhere other than /opt
  • The N810 will have a different internal SD card structure.
  • I have managed to make the standard Debian MPlayer display the feed from the built-in camera, using this trick.
  • Haven't done a huge amount of testing. Tried to install gedit, crashed the tablet.
__________________
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 06:56. Reason: fixed the SD card mounting