View Single Post
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#1
What I'm trying to do is use Debian in a chroot from an ext2 partition. Now I know how to install Debian to a partition, and I know how to install Easy-Debian, but not install Easy-Debian to a ext2 partition [not an img file].

You may ask why?

Well, chrooting Debian from an actual partition is waaaaaay faster than from an img file, and Qole's img files are ~1GB -- I can have a partition as large as I want.

You may also ask, why not just install regular Debian to a partition, like Johnx's one for example, and chroot into it?

I tried this, and it just didn't work well. For one, APT was broken, and it just seems that except for being slow, Qole's Easy-Debian just 'works'.

So what I did was freshly format my ext2 partition, and edited /sbin/debian and removed all the mount lines. Like:

Code:
#Make the tablet's devices available to Debian
  echo .
  mount -o bind /dev "$CHROOT/dev"
  mount -o bind /proc "$CHROOT/proc"

  #Gentoo wiki says this will make X work
  echo ..
  mount -t devpts none "$CHROOT/dev/pts"
  mount -o bind /tmp "$CHROOT/tmp"

  #Various external devices
  echo ...
  #FIXME: Should get these from /proc/mounts...
  mount -o bind /media/mmc1 "$CHROOT/media/mmc1"
  mount -o bind /media/mmc2 "$CHROOT/media/mmc2"
  mount -o bind /media/usb "$CHROOT/media/usb"

  #Mount the user's home dir
  echo ....
  mount -o bind /home/user "$CHROOT/home/user"
I got ride of all that.

I then ran Debian-Chroot from the application launcher, and let it mount the debian-img.ext2 image to /debian/

I then copied everything from /debian/ to my ect2 partition.

I then edited the /home/user/.chroot file to look like this:

Code:
# Sample config for chroot 

# Device or image containing Debian filesystem.
# Default: first in /media/mmc[12]/debian*.img*
IMGFILE=/dev/mmcblk1p2

# Filesystem used; must always be set when using a partition.
# Default: from extension of IMGFILE, or ext2.
IMGFS=ext2

# Mount point for Debian.
# Default: /debian
CHROOT=/debian

# New /tmp dir size for printing / PDF creation
# Default: 2M
TMPSIZE=2M

# Debian user to drop privileges
# Default: user
DEBUSER=user
I basically just pointed it to my ext2 partition (/dev/mmcblk1p2).

I then rebooted, and changed /sbin/debian back to what it was originally, and tried my chroot out.

It seemingly mounts my ext2 partition to /debian/, but NOTHING WORKS! Gah!

What did I do wrong? Is my whole logic wrong? Help...
__________________
-Brent

Author of TouchSearch -- web searching software for Maemo 5.

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900