Help - Search - Members - Calendar
Full Version: Chrooted Debian The Other Easier? Way
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
pgas
A different way to access debian:

Notes:

* in the following, it assumes that your card is formatted using a unix friendly filesystem (ie ext2).

* /mnt/card is used because I install debian on a SD card, you need to change this if you install elsewhere.



STEP 1:
Download either the "base" or the "big" Debian package from http://pocketworkstation.org/files/ . The latest version is 0.18.


STEP 2:
Since this is real big stuff, we can't put it in the main memory but must let a memory card take it instead.

Make sure that your card is of 256MB at least.
Let's get started.

Start a terminal session.

Switch to /mnt/card, and

create a new directory called "debroot" by

CODE
cd /mnt/card
mkdir debroot


(Press ENTER once after each line.)


STEP 3:
Switch to this newly created debroot dir.

Put the debian package in this dir, and

extract it by:

CODE
tar -xvzpf zaurus-debian-*.tgz


This will take a few minutes. Just let it do its job. After this you'll see a whole bunch of files and dir created in /mnt/card/debroot.


STEP 4:
Download the attach files, remove the .txt (it's just added so that I can upload the files there) and copy these in /usr/bin/

make them executable:

CODE
chmod +x /usr/bin/startdebian.sh
chmod +x /usr/bin/stopdebian.sh
chmod +x /usr/bin/Crd



(Press ENTER once after each line.)

edit this files to change /mnt/card to whatever you use

STEP 5:

in a terminal run
CODE
startdebian.sh


This needs to be done only once, (ie everytime you reboot)

Optionnaly If you want to be able to access more than the sd card in debian copy the last 2 lines of
startdebian.sh and modify accordingly (ie replace /mnt/card by the path to the directory you want to be accessible in the debian chroot).

for instance if you want to access the cf cards add
QUOTE
mkdir -p ${DEBROOT}/mnt/cf
mount --rbind /mnt/cf ${DEBROOT}/mnt/cf


and in stopdebian.sh
QUOTE
umount ${DEBROOT}/mnt/cf



STEP 6:

in a terminal:

CODE
Crd aterm



STEP 7:

f you need to umount your card run stopdebian.sh
Don't run startdebian.sh stopdebian.sh everytime you want to launch an application.

(Yes I stole a part from Zdevil's post)

tell me if this works for you
ZDevil
Hey, this truly dummy guide should've appeared right from the beginning, so as to save the trouble of writing and making others read my still-not-so-easy post. wink.gif
Thank you, pgas!
(Well, in a way i'm also 'stealing' from the original debian post ... )
smuelas
[quote=pgas,Dec 13 2005, 12:54 PM]
A different way to access debian:

Notes:

* in the following, it assumes that your card is formatted using a unix friendly filesystem (ie ext2).

* /mnt/card is used because I install debian on a SD card, you need to change this if you install elsewhere.

[/quote]


STEP 6:

in a terminal:

CODE
Crd aterm



STEP 7:

f you need to umount your card run stopdebian.sh
Don't run startdebian.sh stopdebian.sh everytime you want to launch an application.

(Yes I stole a part from Zdevil's post)

tell me if this works for you
*

[/quote]

Hi pgas,
I've just tried your method on my 6000 and it works very well. It is a lot simpler than anything else and the result is as good as the best. Great job!
Now, a couple of questions:
1) What is the reason to link /mnt/cf/debroot/mnt/cf ?
When in Debian, I look at this place and there is nothing inside. Also, when I "stopdebian" I receive a message telling me that it is not possible to umount it as it is busy.
2) I have reflash everything and now I don't remember what I did before to have the second and middle button of the mouse using Fn and/or Shift. Do you remember what should be done?

Thanks for your very good help.

smuelas
pgas
thanks! I was wondering if this was working so well that nobody have a problem or so bad that nobody even bother with this.

1) you have to mount the cards or the other filesystem if you want to access something outside /mnt/cf/debroot/ while in debian.

I don't now for the busy message, maybe something is running in debian or your are in the folder. I'm also not sure if suspend/resume does not causes problem

2) It's by default on the clamshell, I'm not sure for the 6000, maybe via the inputhelper application in the settings?
smuelas
QUOTE(pgas @ Dec 19 2005, 08:09 AM)
thanks! I was wondering if this was working so well that nobody have a problem or so bad  that nobody even bother with this.

1) you have to mount  the cards or the other filesystem  if you want to access something outside /mnt/cf/debroot/ while in debian.

I don't now for the busy message, maybe something is running in debian or your are  in the  folder. I'm also not sure if suspend/resume does not causes problem

2) It's by default on the clamshell, I'm not sure for the 6000, maybe via the inputhelper application in the settings?
*


Well, it seems that Suspend, really causes problems. After it, the access to Debroot is finished and "Crd" hangs the console if writing in a console, or had no effect if clicking a button prepared for launching something with "Crd ###".
The mounting of the cards has no interest for those who use only one card with debroot ocupying the whole card, as I do.
In fact, one solution that I will find excellent would be to use pdaxrom to control the standard applications included in the ROM and launching the Xserver. Then, Debian could take the control for any other application wanted. It seems a lot of work to compile applications for pdaXrom when they are available with just apt-get. I have tested some applications in both ways and they run more or less equal: Firefox, Scite, Emacs, Gimp, Octave... It is like reinventing the wheel.
Anyway, up to now your approach seems to me the simplest, more rational and easy to implement.
We have to solve this problem with Suspend and everything would be perfect! Thanks for all.

smuelas
pgas
QUOTE
Well, it seems that Suspend, really causes problems. After it, the access to Debroot is finished and "Crd" hangs the console if writing in a console, or had no effect if clicking a button prepared for launching something with "Crd ###".

hmm It does not happen to me.
Maybe the problem is linked to the usage of the cf, I remember a post about squashfs stating that the cf card was causing problem because if I remember well it is mounted and unmounted during suspend.

QUOTE
hen, Debian could take the control for any other application wanted. It seems a lot of work to compile applications for pdaXrom when they are available with just apt-get. I have tested some applications in both ways and they run more or less equal: Firefox, Scite, Emacs, Gimp, Octave... It is like reinventing the wheel.
Anyway, up to now your approach seems to me the simplest, more rational and easy to implement.
We have to solve this problem with Suspend and everything would be perfect! Thanks for all.


This is the original goal of pocketworkstation.
If you use the installation describe on the site, it stops qtopia and starts an xserver over a virtual frame buffer. the "daemon" installed forwarded commands from the chrooted environement to the default qtopia environnement.

There is some info out there explaining how someone runs debian only on his c3000.
smuelas
QUOTE(pgas @ Dec 19 2005, 12:09 PM)
This is the original goal of pocketworkstation.
If you use the installation describe on the site, it stops qtopia and starts an xserver over a virtual  frame buffer. the "daemon" installed forwarded commands from the chrooted environement to the default qtopia environnement.

There is some info out there explaining how someone runs debian only on his c3000.
*


I have used the original pocketworkstation sometime. It is not the same...

When you say "out there" do you mean in the pocketworkstation site?

smuelas
Chero
QUOTE
It is like reinventing the wheel.


I don't agree here. Porting apps to pdaXrom makes them available for users that don't want to install the whole debian chroot or that just don't have the disk-space to install the chroot.
A second advantage of this "reinventing the wheel" is that most pdaX packages are a lot smaller compared to their debian brothers and sisters.

QUOTE
This is the original goal of pocketworkstation.


It is, but the way debian packages can work on pdaXrom, using the pdaXrom window manager, has a few advantages. I have the feeling they are faster than in the original pocketworkstation setup (it's been quite a long time since I've used it, but still...). When using debian this way, you can run debian apps and pdaX-apps at the same time.

just my 2 cents.

About the subject :
I had this resume thing when I had debian on my c860 (both on CF and SD). It was installed "the old way". My debian apps use to crash after long suspends. But I could still use Crd and if I was running a bash, it wouldn't hang. It were apps with open files on SD or CF that crashed.
It wasn't only like this with debian apps , pdaX-apps had the same behaviour. When running KDE from SD, it sometimes hung after a resume.
I didn't have this behaviour on my C3100, where everything runs from ide. I didn't do some real tests to "challenge" my Z. Just once I started KDE in the evening, suspended, resumed in the morning. The kde-panel crashed and restarted and I could continue. I just thought :"If it can do this, it can do anything".

Next week is holiday-time for me. If I have some time left, I might do some testing on the subject.

Have fun,
Chero
pgas
QUOTE
When you say "out there" do you mean in the pocketworkstation site?

I meant this:
http://www.eleves.ens.fr/home/leurent/zaurus.html
apink
Bonjour,

I am looking forward to getting debian going and have tried installing via these instructions twice. It seems that things have gone nicely for others so I was a little perplexed when it didn't work for me. The first time through I tried to erase the debroot contents so I could start over but ended up erasing pretty much everything on the Z along with the debroot stuff. Silly newb mistake but I am back up and running for the most part.

After following the instructions at the beginning of this thread I get to the command "startdebian.sh" and get the error:

mount: mount point /mnt/card/debroot/etc/resolve.conf does not exist.

Then I pretend that this is not important and try the "Crd aterm". This aborts witha message of

aterm: can't open pseudo-tty
aterm: aborting

Any help is appreciated.

george
pgas
QUOTE
mount: mount point /mnt/card/debroot/etc/resolve.conf does not exist.


hmm, maybe you need do do "touch /mnt/card/debroot/etc/resolve.conf"
This is used to have the right dns set in debian

QUOTE
aterm: can't open pseudo-tty
aterm: aborting

I was getting this when /dev was not mounted.
Where did you have your debroot?
Can you post the result of mount after startdebian?
Do you use a unix filesystem on your card?
Chero
QUOTE(pgas @ Dec 21 2005, 08:10 AM)
QUOTE
mount: mount point /mnt/card/debroot/etc/resolve.conf does not exist.


hmm, maybe you need do do "touch /mnt/card/debroot/etc/resolve.conf"
This is used to have the right dns set in debian


I think there is a typo in this, it should be "/etc/resolv.conf"
apink
QUOTE(pgas @ Dec 20 2005, 11:10 PM)
QUOTE
mount: mount point /mnt/card/debroot/etc/resolve.conf does not exist.


hmm, maybe you need do do "touch /mnt/card/debroot/etc/resolve.conf"
This is used to have the right dns set in debian

QUOTE
aterm: can't open pseudo-tty
aterm: aborting

I was getting this when /dev was not mounted.
Where did you have your debroot?
Can you post the result of mount after startdebian?
Do you use a unix filesystem on your card?
*



I tried touch /mnt/card/debroot/etc/resolve.conf but got the same results. I tried it several times. It seems that resolve.conf was not in there at first.

Here is the output from mount:

rootfs on / type rootfs (rw)
/dev/root on / type jffs2 (rw)
/proc on /proc type proc (rw)
none on /dev type tmpfs (rw)
/dev/mtdblock3 on /home type jffs2 (rw,noatime)
none on /dev/pts type devpts (rw)
/dev/mtdblock3 on /mnt/user type jffs2 (rw,noatime)
/dev/mmcda1 on /mnt/card type ext2 (rw)
none on /mnt/card/debroot/proc type proc (rw)
none on /mnt/card/debroot/dev type tmpfs (rw)
/dev/mtdblock3 on /mnt/card/debroot/home/root type jffs2 (rw,noatime)
none on /mnt/card/debroot/tmp type tmpfs (rw)
/dev/mmcda1 on /mnt/card/debroot/mnt/card type ext2 (rw)
none on /mnt/card/debroot/mnt/card/debroot/tmp type tmpfs (rw)
/dev/mtdblock3 on /mnt/card/debroot/mnt/card/debroot/home/root type jffs2 (rw,noatime)
none on /mnt/card/debroot/mnt/card/debroot/dev type tmpfs (rw)
none on /mnt/card/debroot/mnt/card/debroot/proc type proc (rw)
pgas
something is wrong ,
QUOTE
none on /mnt/card/debroot/dev type tmpfs

is mounted with the wrong type, it should be
QUOTE
none on /mnt/card/debroot/dev type devfs


perhaps change the script to add -t devfs ie
QUOTE
mount --bind /dev ${DEBROOT}/dev -t devfs


Did you copy the script by hand? maybe you made a typo and have
mount --bind /tmp ${DEBROOT}/dev in your script?

there is also a set of duplicate wrong entries:
it should be mnt/card/debroot/dev and not /mnt/card/debroot/mnt/card/debroot/dev (accordingly for the rest)

you should umount every /mnt/card/debroot, before remounting

and Chero is right it's resolv.conf not resolve.conf
apink
1) resolv.conf fixed the first error. (In the downloaded script there is a resolv.cong where there should be a resolv.conf.)

2) I tried
QUOTE
mount --bind /dev ${DEBROOT}/dev -t devfs

It didn't change the type to devfs. huh.gif

3) The issue with
QUOTE
/mnt/card/debroot/mnt/card/debroot/dev (accordingly for the rest)

is caused, I think, by the last line in the script:
QUOTE
mount --rbind /mnt/card ${DEBROOT}/mnt/card


I entered the script in manually and even had the shell expand the last line before executing it. ${DEBROOT} expanded appropriately. I don't know where the extra /mnt/card/debroots are coming from but they all show up only after the last line in the script is executed.

Here is my revised startdebian.sh script:

QUOTE
#!/bin/ash
DEBROOT=/mnt/card/debroot
#test
mount none ${DEBROOT}/proc -t proc
mount --bind /dev ${DEBROOT}/dev -t devfs
mkdir -p  ${DEBROOT}/home/root
mount --bind /home/root ${DEBROOT}/home/root
mount --bind /tmp ${DEBROOT}/tmp
mount --bind /etc/resolv.conf ${DEBROOT}/etc/resolv.conf
mkdir -p ${DEBROOT}/mnt/card
mount --rbind /mnt/card ${DEBROOT}/mnt/card



Here is the output of mount after this script.

QUOTE
rootfs on / type rootfs (rw)
/dev/root on / type jffs2 (rw)
/proc on /proc type proc (rw)
none on /dev type tmpfs (rw)
/dev/mtdblock3 on /home type jffs2 (rw,noatime)
none on /dev/pts type devpts (rw)
/dev/mtdblock3 on /mnt/user type jffs2 (rw,noatime)
/dev/mmcda1 on /mnt/card type ext2 (rw)
none on /mnt/card/debroot/proc type proc (rw)
none on /mnt/card/debroot/dev type tmpfs (rw)
/dev/mtdblock3 on /mnt/card/debroot/home/root type jffs2 (rw,noatime)
none on /mnt/card/debroot/tmp type tmpfs (rw)
/dev/root on /mnt/card/debroot/etc/resolv.conf type jffs2 (rw)
/dev/mmcda1 on /mnt/card/debroot/mnt/card type ext2 (rw)
/dev/root on /mnt/card/debroot/mnt/card/debroot/etc/resolv.conf type jffs2 (rw)
none on /mnt/card/debroot/mnt/card/debroot/tmp type tmpfs (rw)
/dev/mtdblock3 on /mnt/card/debroot/mnt/card/debroot/home/root type jffs2 (rw,noatime)
none on /mnt/card/debroot/mnt/card/debroot/dev type tmpfs (rw)
none on /mnt/card/debroot/mnt/card/debroot/proc type proc (rw)


I don't know if this will help.

Thanks
pgas
Sorry, I don't know what the problem is.

can you try

CODE
mount -o remount,suid,dev /mnt/card


And then startdebian.sh? (I suggest you first reboot you zaurus to be sure that there are no remaining mount point from a previous execution)

remounting like this had fixed a problem I had when I was creating a chroot jail for another program.

I have no clue as why you get the mnt/card/debroot/mnt/card/debroot/proc etc...

Has anybody else tried this method with a C1000 or 3100?, maybe the kernel doesn't allow this? maybe the kernel causes problem?

(If someone wants to donate a new Zaurus: you are welcome tongue.gif)
apink
-pgas, Thank you for your help so far. It is appreciated. If you have some time, could you post your output from mount after startdebian.sh so that I know what to aim for? No worries if you can't get to it. I am guessing that by doing a "mount -rbind /mnt/card . . ." as a last command, all of the /mnt/card/debroot/yadayada points already mounted get remounted, thus the mnt/card/debroot/mnt/card/debroot/yadayada.

Also, my output after reboot of mount before running startdebian.sh includes a line of

QUOTE
none on /dev type tmpfs (rw)


Could it be that devfs was replaced with tmpfs for the C1000?
pgas
after a second look at your list of mount points:

try to mount

/dev/pts on /mnt/card/debroot/dev/devpts
apink
QUOTE(pgas @ Dec 23 2005, 02:59 AM)
after a second look at your list of mount points:

try to mount

/dev/pts on /mnt/card/debroot/dev/devpts
*


Yes,

QUOTE
mount --bind /dev/pts ${DEBROOT}/dev/pts


worked.

I now have Crd aterm creating a new terminal with debian running. Thank you. cool.gif

I am still a little unclear about what to do about the

QUOTE
mount --rbind /mnt/card ${DEBROOT}/mnt/card


line at the end of your script. Right now I have changed --rbind to just --bind and that seems to work.
pgas
QUOTE
line at the end of your script. Right now I have changed --rbind to just --bind and that seems to work.


I read again the man page of mount, I must have read it too quickly the first time:

QUOTE
This call attaches only (part of) a  single  filesystem,  not  possible
      submounts.  The entire file hierarchy including submounts is attached a
      second place using
              mount --rbind olddir newdir


So rbind does the what you see, and bind should be used and rbind does not seems
to work as expected on the 860.

Thanks for beeing patient , I'll try to update the scripts
smuelas
QUOTE(pgas @ Dec 24 2005, 04:53 AM)
QUOTE
line at the end of your script. Right now I have changed --rbind to just --bind and that seems to work.


I read again the man page of mount, I must have read it too quickly the first time:

QUOTE
This call attaches only (part of) a  single  filesystem,  not  possible
      submounts.  The entire file hierarchy including submounts is attached a
      second place using
              mount --rbind olddir newdir


So rbind does the what you see, and bind should be used and rbind does not seems
to work as expected on the 860.

Thanks for beeing patient , I'll try to update the scripts
*



After a few days of testing different possibilities for mounting/unmounting Debian on pdaxrom, and for the specific problems created on the SL-6000, it is now clear the picture: Everything runs perfectly well if using an SD card. The problems arise with the microdrive that I have on the CF slot. And those are, as you suspected, the mounting/unmounting of /mnt/cf when suspending and resuming.
This is the "only" problem that I've found on the 6000. In a normal session, without using Suspend, everything works fine.
Now, what I do is to unmount /mnt/cf before suspending. For "Suspend" I don't need to click the button. I just use the ON/OFF key on the 6000, as in the original ROM. Another way is to include the unmounting of /mnt/cf on the Suspend icon, and this simplifies the process.
Nevertheless, there is still a "remaining" problem, referring to your scripts for Debian. And it is the fact that usually "stopdebian.sh" is not able to finish the whole process. More specifically, the "tmp" and "dev" mounted, produce a message of "/mnt/cf busy" and the final unmounting of /mnt/cf is impossible, what makes the solution above mentioned, useless.
Would it be any way of forcing unmounting of those two and include them in "stopdebian.sh"??

smuelas
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.