Reply
Thread Tools
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
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#2
If you run just the "Debian Chroot" icon you should get a terminal that shows a bunch of output..

Copy that output and show us here if you can..

Or if it disapears too fast... open a terminal; get to root; and just run "debian" ... see where the errors are.

U didn't need to modify the debian script at all.. if all you wanted to do was mount the img file and copy the data... as root you could have mount myext2.img /debian and copied .. that way not messing with the original scripts... But anyway.. the process you outlined should have been fine.

If you DO get into a chroot using just "debian"... then try launching something from the maemo user account in a terminal like: debbie abiword

Check the output from that command and see where it's failing.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following User Says Thank You to fatalsaint For This Useful Post:
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#3
Running 'debian' as root gives:

Code:
chroot set up already!
Everything set up, running chroot...
chroot: cannot execute /bin/sh: No such file or directory
Then running 'debbie abiword':

Code:
Starting Debian abiword
But nothing happens, it just goes back to the root prompt.
__________________
-Brent

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

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#4
Code:
chroot: cannot execute /bin/sh: No such file or directory
That's not good... the chroot is not working because it is saying it either can't find; or I'd venture can't execute the /bin/sh.

I think when you copied it it didn't copy over permissions... did you use cp -pr or just cp when you ran the copy from the image to the new ext2??

I think everything in your new debian is probably owner:group root:root and rw-r-r or something similar..

ETA: if this is the case.. it will be easier to start over and run the cp with -pr as root instead of fixing these permissions by hand.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#5
I used Emelfm2 as root to copy the files. For example, the files in /debian/bin are owner:root group:root and permissions:-rwxr-xr-x, but some files' permissions are different.
__________________
-Brent

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

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#6
specifically what are /debian/bin/sh?
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#7
/debian/bin/sh is owner:root group:root and permissions:lrwxrwxrwx.
__________________
-Brent

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

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#8
Sorry... what is the permissions on /debian/bin/bash .. sh is a link.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#9
/debian/bin/bash is owner:root group:root and permissions:-rwxr-xr-x.
__________________
-Brent

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

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#10
If you manually run:

chroot /debian

Do you get the same error?
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 
Reply

Tags
chroot, debian, easy debian


 
Forum Jump


All times are GMT. The time now is 21:14.