Help - Search - Members - Calendar
Full Version: Chrooted Debian Made Easy
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
ZDevil
So here is an absolute dummy guide to setting up the fantastic chrooted Debian in 14 steps (and a few more -- just read on).
Well, it's NOT my work at all. The whole thing is nothing new but a summary and collection of the main information stretched out in this thread: http://www.oesf.org/forums/index.php?showtopic=9654 , after getting some good advice from Chero and rehorrericha in particular.
Then why do I post this and in a new thread? Because I guess dummies may find it easier to read a separate summary than to wade through the dozens of pages and >100 posts of discussions.
Most, if not all, of the content of this summary is already included in CyberWolf's excellent guide in the very first post of thread above, plus the gems of thoughts of many others there. I hope I didn't miss anything, despite the fact that I still consider myself a dummy. Please correct me if I'm wrong in any place. Thank you! smile.gif


rolleyes.gif How to set up chrooted Debian environment in pdaXrom: an absolute dummy guide rolleyes.gif


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:
Now you have to configure Debian and install a few important files to the main memory. The files are going to be very small so no need to worry about the space in the main memory.

Stay put in /mnt/card/debroot and do this

CODE
./INSTALL.d/postinst.sh


And ...


STEP 5:
Phew! What? A questionnaire? Don't panic. It's just a few "Yes/No" questions. There may be some actions going on between the questions, as the setup will respond and take actions immediately after each of your answers.

The "model answers" are simply: "Yes" (press y and ENTER) to all questions, BUT say "No" (press n and ENTER) to the last two questions asking you whether you want to start vncserver and fbvnc.

After the last question, the installation process finishes and returns you to the command prompt (the "#" sign).


STEP 6:
Now it's time to go to do something about the files in the main memory. Go to your root directory by
CODE
cd ~



STEP 7:
Now go check and see whether you've got these three files in the main memory (use a file manager to help you find them):

/etc/debroot.conf
/usr/local/bin/Crd
/etc/rc.d/init.d/zdebian

If any of them is missing, then something may have gone wrong blink.gif and you'll have to repeat steps 3, 4 and 5.


STEP 8:
Now we are going to make some important changes in the first two files mentioned in STEP 7 by editing them with an editor (am I being too dummy here?)

Don't worry too much. What we mean by "editing" here simply means adding one symbol or some words or a line somewhere in the files.

Being a dummy myself, I prefer using nano (hey guys, c'mon don't fire at me please ~ tongue.gif ).

First, open /etc/debroot.conf with nano by
CODE
nano /etc/debroot.conf

Don't freak out when you see the mysterious codes and messages. Just do three simple things:


1. Locate the statement "#The chroot directory for the Debian installation", make sure that it gets the correct path as
CODE
DEBROOT=/mnt/card/debroot


2. Comment out (i.e. put a "#" symbol in front of) all these lines:
DEB_RUN_VNCSERVER,
DEB_RUN_FBVNC,
DEB_RUN_ZAPM_PROXY,
DEB_RUN_ZAPMD.
(In my case I also have to comment out DEB_RUN_SERVICES="ssh", although it's not mentioned in the CyberWolf's original guide. Still dunno why coz I'm just a dummy.)

3. Go to the bottom of the file, start a line afresh and type the following:
CODE
DEB_DISPLAY=127.0.0.1:0


After these three things are done, press Ctrl and o together to save the file (you'll be asked for a filename; just ENTER to confirm to use the existing one), followed by Ctrl and x together to exit nano.


STEP 9:
Now we head to the second file. Again use nano to open it:
CODE
/usr/local/bin/Crd

Go to the bottom and look for the line that begins with "PATH=...".
Add the string DISPLAY=$DEB_DISPLAY at the end of the line,
followed by Ctrl-o (save) and Ctrl-x (exit nano)


STEP 10:
Now we need to edit one more file. Use nano again to open /usr/X11R6/bin/startx
CODE
nano /usr/X11R6/bin/startx


Locate the line(s) beginning with "defaultserverargs=...".
Comment out the line(s) if you see "-nolisten tcp"
CODE
#defaultserverargs=" -nolisten tcp"
#defaultserverargs=" -nolisten tcp -kb"


Next, add a new line right above or below these lines (use your cursor key to move around, ENTER to add a new line) and type this down:
CODE
defaultserverargs=" -kb"


When it's done, Ctrl-o and then Ctrl-x.

[A NOTE for users of more than one window manager (wm):
The default window manager is called Matchbox, and the initial script (i.e. the file that brings it up and tells it to do and display things in the way you want) is called "startx" and its path is /etc/X11R6/bin/startx.
Oh, yes, that's the one you have just edited.
And...
If you also use other window managers, you'll have to do the same change to their initial scripts. For example, the initial script of Xfce4 is called "startxfce4" and has a different path /usr/local/bin/startxfce4. If you forget to edit this you will only get chrooted Debian to work in Matchbox but not in Xfce4.]


STEP 11:
Quit the terminal session.
Exit the current window manager and restart it. (If you don't know how then you won't be reading this!)


STEP 12:
Start a terminal session again.
Copy a file called .Xauthority to the root directory of debroot by running this command:
CODE
cp .Xauthority /mnt/card/debroot/home/root


(In case you don't have the root dir under /mnt/card/debroot/home, (just like in my case), you must create it first before copying .Xauthority to there. Or just run mkdir -p /mnt/card/debroot/home/root to fix that.)


STEP 13:
Start the chrooted Debian enviroment with
CODE
/etc/rc.d/init.d/zdebian start


If you get back to the usual prompt in 1 or 2 seconds, that is a good sign, meaning your chrooted Debian environment is (almost) ready to roll out.


STEP 14:
Finally, give your chrooted Debian environment a test drive. Try
CODE
Crd aterm


Then you'll see a different terminal window pop up, with a slightly different prompt as "/#".

And as CyberWolf says, "If it works, congratulations, you've done it... "


Plus...

You can go three more steps further (by Chero):
STEP 15:
Go connected!
Copy /etc/resolv.conf to /mnt/card/debroot/etc/resolv.conf to enable networking


STEP 16:
Eat a lot without getting overweight?
Use the debshrink command (a real space-saver !!)


(STEP 17: to be clarified ...
Find the way to your /mnt/cf and or /mnt/card: (I think I described them in the Xqt/debian forum - in a thread related to xfce4) -- Chero said he's come up with an easy mounting script but it takes some time to recover it from the X/Qt page...)


Corrections, clarifications and reminders are always welcome. Thank you all! smile.gif
Chero
QUOTE(ZDevil @ Nov 1 2005, 10:42 PM)
(STEP 17: to be clarified ...
Find the way to your /mnt/cf and or /mnt/card: (I think I described them in the Xqt/debian forum - in a thread related to xfce4) -- Chero said he's come up with an easy mounting script but it takes some time to recover it from the X/Qt page...)


Corrections, clarifications and reminders are always welcome.  Thank you all!  smile.gif
*


The syntax is :
CODE
mount -o bind olddir newdir


In case you are running on SD, this is :
CODE
mount -o bind /mnt/cf /mnt/card/debroot/mnt/cf
mount -o bind /mnt/card /mnt/card/debroot/mnt/card
mount -o bind /home/root /mnt/card/debroot/mnt/home


At least, if you want to access your cf, sd and home-dir.
Just make sure the dirs (mountpoints) exist.

Have fun,
Chero.
pgas
I think that if you have your debroot on /mnt/card you should use

CODE
mount  --rbind  /mnt/card /mnt/card/debroot/mnt/card


(to avoid recursion in the filesystem)

Note that if you mount the /tmp and the home directory this way, you can run directly X without the xhost, exporting the display etc...
I will post instructions for this when I have time....

Also the posintall script starts a small loop that forward command to the "native" environement, I think that this is not needed when we use pocketworkstation this way as it is easy to open a "native" terminal.
So this could be disable.
ShiroiKuma
QUOTE(pgas @ Nov 2 2005, 02:49 PM)
Note that if you mount the /tmp and the home directory this way, you can run directly X without the xhost, exporting the display etc...
I will post instructions for this when I have time....

Also the posintall script starts a small loop that forward command to the "native" environement, I think that this is not needed when we use pocketworkstation this way as it is easy to open a "native" terminal.
So this could be disable.
*

Yes, please do... I'm experimenting with this... I'd like to see your instructions.
stac
Can we get this pinned? Nice job - looking forward to going through this today...

Stac
GadgetGuy
I have followed the instructions step by step.

When I get to the point

cp .Xauthority /mnt/card/debroot/home/root

my Z tells me, that there is no .Xautority file...

If I still continue, and start
" /etc/rc.d/init.d/zdebian start "

Then when I try

" Crd aterm "

I get:

" bad option "DISPLAY=127.0.0.1:0"

What is going on?
Chero
QUOTE(GadgetGuy @ Nov 3 2005, 07:10 PM)
I have followed the instructions step by step.

When I get to the point

cp .Xauthority /mnt/card/debroot/home/root

my Z tells me, that there is no .Xautority file...

If I still continue, and start
" /etc/rc.d/init.d/zdebian start "

Then when I try

" Crd aterm "

I get:

" bad option "DISPLAY=127.0.0.1:0"

What is going on?
*


Try :
cp /home/root/.Xauthority /mnt/card/debroot/home/root/
GadgetGuy
QUOTE(Chero @ Nov 3 2005, 02:08 PM)
Try :
cp /home/root/.Xauthority /mnt/card/debroot/home/root/
*


Still no luck. If I do a file search starting on root, no such file is found anywhere on my Z...

I am just thinking: is this maybe a pdaXrom related file - as I am running Cacko?
ZDevil
QUOTE(GadgetGuy @ Nov 3 2005, 09:29 PM)
QUOTE(Chero @ Nov 3 2005, 02:08 PM)
Try :
cp /home/root/.Xauthority /mnt/card/debroot/home/root/
*


Still no luck. If I do a file search starting on root, no such file is found anywhere on my Z...

I am just thinking: is this maybe a pdaXrom related file - as I am running Cacko?
*



Oh sorry forgot to mention that this summary is for chrooted debian on pdaXrom. Not sure if it works on Sharp/Cacko (probably not). Maybe X/Qt is still the way for you.
Chero
QUOTE(GadgetGuy @ Nov 3 2005, 08:29 PM)
QUOTE(Chero @ Nov 3 2005, 02:08 PM)
Try :
cp /home/root/.Xauthority /mnt/card/debroot/home/root/
*


Still no luck. If I do a file search starting on root, no such file is found anywhere on my Z...

I am just thinking: is this maybe a pdaXrom related file - as I am running Cacko?
*



Yes, it is.

To get it going on cacko or sharp-rom :
www.pocketworkstation.org
or
http://zaurusfun.4t.com/index.html
or
Meanie's website

but it won't be as fast wink.gif
takuan
I'm having trouble upgrading to the latest "testing" packages with apt-get upgrade. I have to run apt-get upgrade -o APT::Force-LoopBreak=1 to force it to upgrade some things. Everything still runs after that but some tools just stop working right. Particularly i would like nmap 2.93 to work but with the latest version from testing it runs but doesn't work right. It can't even ping another host..it says its always down.

Has anybody gotten this to work for them?
scoutme
QUOTE(Chero @ Nov 3 2005, 11:08 AM)
QUOTE(GadgetGuy @ Nov 3 2005, 07:10 PM)
I have followed the instructions step by step.

When I get to the point

cp .Xauthority /mnt/card/debroot/home/root

my Z tells me, that there is no .Xautority file...

If I still continue, and start
" /etc/rc.d/init.d/zdebian start "

Then when I try

" Crd aterm "

I get:

" bad option "DISPLAY=127.0.0.1:0"

What is going on?
*


Try :
cp /home/root/.Xauthority /mnt/card/debroot/home/root/
*




I'm having the very same problem with RC12 sad.gif
cannot get it properly running sad.gif
Chero
QUOTE(scoutme @ Nov 8 2005, 04:15 PM)
QUOTE(Chero @ Nov 3 2005, 11:08 AM)
QUOTE(GadgetGuy @ Nov 3 2005, 07:10 PM)
I have followed the instructions step by step.

When I get to the point

cp .Xauthority /mnt/card/debroot/home/root

my Z tells me, that there is no .Xautority file...

If I still continue, and start
" /etc/rc.d/init.d/zdebian start "

Then when I try

" Crd aterm "

I get:

" bad option "DISPLAY=127.0.0.1:0"

What is going on?
*


Try :
cp /home/root/.Xauthority /mnt/card/debroot/home/root/
*




I'm having the very same problem with RC12 sad.gif
cannot get it properly running sad.gif
*



I'll have to give it a try on rc12.
I could always solve the display problem by removing the "nolisten" thing and copying the .Xauthority to /mnt/card/debroot/home/root/ and /mnt/card/debroot/root/, then leave X, start again and off you go.
smuelas
[quote=Chero,Nov 8 2005, 04:30 PM]
[quote=scoutme,Nov 8 2005, 04:15 PM][quote=Chero,Nov 3 2005, 11:08 AM][quote=GadgetGuy,Nov 3 2005, 07:10 PM]I have followed the instructions step by step.

When I get to the point

I get:

" bad option "DISPLAY=127.0.0.1:0"

What is going on?
*

[/quote]

Yesterday I installed pdaXrom. Before I used the original Qtopia plus Debian+Xqt.
I didn't modify anything on my "debroot" on the microdrive.
Then, from one of this "not-so-nice" console from openbox, that I have already changed, I simply tiped:
chroot /mnt/cf/debroot
and I was in Debian. When I try to launch any application, I had my "ERROR display 0:0 not available" or something similar.
I looked at "startx" and see this "-nolisten" story. Then I run out of the X's and on once more, but this time I didn't write "startx" but "xinit".
This is all the story. After that, everything (with the Java exception) was working perfectly and, I think, quicker.
smuelas
whit
QUOTE(ZDevil @ Nov 1 2005, 01:42 PM)
STEP 14:
Finally, give your chrooted Debian environment a test drive.  Try
CODE
Crd aterm


Then you'll see a different terminal window pop up, with a slightly different prompt as "/#".


Nice guide. Yet ...

When I get to this point on a 3100 running rc12 I get

aterm: bad option "DISPLAY=127.0.0.1:0"
whit
QUOTE(smuelas @ Nov 15 2005, 05:30 AM)
chroot /mnt/cf/debroot
and I was in Debian.


Yeah, that works for me as a start. Thanks.
whit
QUOTE(smuelas @ Nov 15 2005, 05:30 AM)
Then I run out of the X's and on once more, but this time I didn't write "startx" but "xinit".


Well, xinit hilariously brings up X sideways, and then rotate turns it upside down ... didn't test beyond that that way.
Chero
QUOTE(whit @ Dec 12 2005, 06:42 AM)
QUOTE(smuelas @ Nov 15 2005, 05:30 AM)
Then I run out of the X's and on once more, but this time I didn't write "startx" but "xinit".


Well, xinit hilariously brings up X sideways, and then rotate turns it upside down ... didn't test beyond that that way.
*



"xrandr" can solve this.
I don't know the exact command-options, but there has been written about it in the forums.
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.