Reply
Thread Tools
Posts: 41 | Thanked: 8 times | Joined on Mar 2008
#51
Thanks for the reply Qole. When I look at the .chroot file all the lines are commented out. Is this normal?

Originally Posted by qole View Post
you have to mount the partition, then extract the data. Best thing to do is to modify your /home/user/.chroot file to say the following:
Code:
IMGFILE=/dev/mmcblk0p2
 
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#52
Originally Posted by slick204 View Post
Thanks for the reply Qole. When I look at the .chroot file all the lines are commented out. Is this normal?
Yes it is normal. I think that is a customization file for the chroot scripts, and until you want to change something (like from using the img file to an ext partition), it is commented out. What you want to do is remove the pound sign in front of the stuff you changed. (i.e. the IMGFILE=/dev/mmcblk0p2 line).
__________________
-Brent

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

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
Posts: 37 | Thanked: 5 times | Joined on Feb 2007
#53
Hi everyone!

I finally got everything working (ie. from Qole's Debian image to using it from an EXT2 partition). I thought I might provide a "simple" step-by-step how to, it might help other people.

Of course, all credits go to Qole and BrentDC.

Here are the 8 steps I followed to get me "extract" and use Easy Debian from an ext2 partition, without any problem:



We are assuming you are using (as in: installed and working) Qole's Debian image (debian.img.ext2, that can be downloaded from here: http://qole.maemobox.org/easy-deb-ch....6-2_armel.deb ).


1 --------

First step: create a new partition/format your memory card.
(easiest way: mount your card on a linux box, use GParted to resize/create the new ext2 partition)

Put back the card in your device, boot it up.

2 --------

Backup first, then edit /sbin/debian (as root: "vi /sbin/debian" )
Remove these lines (not more, not less):

#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"

3 --------

Mount the current Debian image:

You can do it by starting Qole's "Debian chroot" menu item.
Alternatively, you can do so with this command (as root):

Code:
mount -o loop /path/to/currentimgfile /debian

Mount the new formated partition:

Code:
mount /dev/mmcblkxxxx /media/mmc1
4 --------

Copy the whole content of /debian to your freshly formatted partition.
In the present case:

Code:
cd /debian
/home/user/img-install/tar cf - . | (cd /media/mmc1/; tar xvf -)
5 --------

Restart device

6 --------

Edit /home/user/.chroot (as root: "vi /home/user/.chroot" ). Note that "IMGFILE=/dev/mmcblk1p1" needs to be modified to meet your needs (ie. replace "mmcblk1p1" to the ext2 partition you created)

# Sample config for chroot

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

# 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

7 --------

Copy back your backup of /sbin/debian (as root: "cp /path/to/backupfile /sbin/" )
(you can remove the debian.img.ext2, as it's no longer needed)

8 --------

Tap on the "Debian chroot" menu item. If everything went well, you should see it mount the Debian image from: /dev/mmcblk1p1 (or whatever partition you have chosen)

Last edited by Maxoueb; 2008-08-17 at 05:38.
 

The Following User Says Thank You to Maxoueb For This Useful Post:
Posts: 41 | Thanked: 8 times | Joined on Mar 2008
#54
OK, I modified the .chroot file as shown (do I need to make the other changes noted by Maxoueb?). When I do "sudo debian" as user I get a boat load of errors. So I figured I need to be root. When I enter "sudo debian" I just get the prompt back and nothing happens. I tried rebooting and it does the same thing.

Also, if I ever get my ext2 partition mounted it should be completely empty. Are you saying I should create a /debian folder to extract the filesystem into?

Or am I just way the heck in too deep!

Originally Posted by qole View Post
you have to mount the partition, then extract the data. Best thing to do is to modify your /home/user/.chroot file to say the following:
Code:
IMGFILE=/dev/mmcblk0p2
Then do "sudo debian" to mount the filesystem (and chroot into it). Just type "exit" to get back out of the (empty) chroot. (Do a "ls" just to make sure that it IS empty. If it isn't empty, you may have already mounted your img file, and so you may need to reboot and type "sudo debian" again) Now you've got your partition mounted and you can "cd /debian" and extract the tarball there. Once the file is extracted, you can do "sudo debian" and you're in your new Debian chroot!
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#55
Originally Posted by Maxoueb View Post
3 --------

Mount the current Debian image:

You can do it by starting Qole's "Debian chroot" menu item.
Alternatively, you can do so with this command (as root):

Code:
mount -o loop /path/to/currentimgfile /debian
Mount the new formated partition:

Code:
mount /dev/mmcblkxxxx /media/mmc1
I would recommend using the "mount -o loop" command used in this step, and skip step #2 entirely. That's a lot of extra editing if you just mount the partition without the script after all.

I would also recommend mounting your new formatted partition under /opt instead of /media/mmc1 because /opt will most likely be unused, while /media/mmc1 could very well have something mounted there already.

slick204: "sudo debian" runs the debian chroot script as root. So it won't work if you are already root. If you are already root, just type "debian"...

Also, I'm not entirely sure where you are in your copy process. Do you have the empty partition ready?
__________________
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-08-18 at 17:27.
 
Posts: 41 | Thanked: 8 times | Joined on Mar 2008
#56
Yeah, I realized that later. I don't know what I was thinking.
I have the empty partition already made, I just can't seem to mount it.
Since I've already modified my .chroot file, when I run "sudo debian" there's nothing in the partition. I get the following error:
insmod: cannot insert '/mnt/initfs/lib/modules/2.6.21-omap1/mbcache.ko': File exists (-1): File exists.

If I'm going to extract the tar file to the new ext2 partition do I need to mount the debian image I have now?

OK, I now have mmcblk0p2 mounted both as /debian and /opt!

I'll try extracting the tar file to /debian....

Originally Posted by qole View Post
slick204: "sudo debian" runs the debian chroot script as root. So it won't work if you are already root. If you are already root, just type "debian"...

Also, I'm not entirely sure where you are in your copy process. Do you have the empty partition ready?
 
Posts: 186 | Thanked: 56 times | Joined on Mar 2008
#57
I managed to do this almost entire via my Ubuntu install. I reformatted the card to ext3 via gparted. I then mounted the image file on my desktop PC, copying it over like so:
Code:
debian
sudo mount -o loop debian.img.ext2 debian
cd debian
sudo cp -R --preserve=all * /media/disk-1
Simply edited .chroot (no need to touch /sbin/debian) and it fit like a glove!
In my case I formatted an entire 2 GB microsd card to ext3. I noticed that I had to restart my tablet again for the partition to mount; initially, it complained that it could not read the disk.

Definitely way faster than the old image file. This is a fine middle ground from dual booting (which was killing my battery and breaking my heart). Truth is I had managed to annihilate my dual booted Debian by piling way too much junk on it and somehow breaking my swap partition. (I also came to the realization that Hildon is actually a pretty good desktop environment).
Thanks for this, Maxoueb and BrentDC.

BTW: Someone should create a definitive guide to this and post it as a new thread

Last edited by Picklesworth; 2008-08-19 at 06:40.
 
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#58
Simply edited .chroot (no need to touch /sbin/debian) and it fit like a glove!
In my case I formatted an entire 2 GB microsd card to ext3. I noticed that I had to restart my tablet again for the partition to mount; initially, it complained that it could not read the disk.
I have heard that if you format a card 100% ect2/3, Maemo will complain at startup; what you want to do is create a "token" fat partition as the first partition on the card (any size will do) just to shut Maemo up.
__________________
-Brent

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

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
Posts: 186 | Thanked: 56 times | Joined on Mar 2008
#59
Strange. Maybe nobody has played with this in Diablo? Maybe there are problems when the card has more than one partition?
It's even reading the ext3 disk from Maemo's built in file manager.
I'll let you know if anything weird happens.

Edit:
OMG this hardware simulator works in openjdk-jre! Now that I've spent 2 weeks trying to make myself more productive, I can finally get back to that book...
 
Posts: 41 | Thanked: 8 times | Joined on Mar 2008
#60
It's me again. I can't seem to get the tarball to extract. I tried the built-in tar but got the invalid option --j error like I expected.

I tried using tar from from the debian image, but it didn't work either. Is this the correct usage:

/home/user/img-install/tar xjvf /media/mmc1/debian-chroot-apps-040608.tar.bz2

I installed bzip2 per Maxoueb then tried again but it still didn't like the j option.

I tried to bunzip2 the tarball but after 15 minutes of random letters, numbers and symbols flying by on the screen, it mercifully crashed.

I suppose I could copy the image like others are doing, but I'd really like to know what I'm doing wrong.
 
Reply

Tags
chroot, debian, easy debian


 
Forum Jump


All times are GMT. The time now is 01:38.