maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Alternatives (https://talk.maemo.org/forumdisplay.php?f=36)
-   -   [Debian] Running Debian in a chroot (https://talk.maemo.org/showthread.php?t=20342)

qole 2008-05-22 19:48

[Debian] Running Debian in a chroot
 
This is a technical discussion thread about running Debian in a chroot. Please post questions about custom setups or technical problems here.

UPDATE, AUGUST 10 2008:

I have posted the newest versions of the chroot scripts (/sbin/debian, /sbin/closechroot, /sbin/synchroot, /usr/bin/debbie) and the chroot config file (/home/user/.chroot) in this post. You can use these scripts to set up your own custom chroot solution. If you just wish to have the applications that Debian gives you (OpenOffice, Firefox, etc) without the hassle, use the Easy Debian package.

UPDATE, JULY 3 2008:

The post with the first installable .deb files and a link to the first version of the chroot image file is here on page 9, and there is an empty 1GB image file with some cool ideas for other chroot options a few posts later, here.

I posted a smaller image file (730MB) with all of the applications installed a bit later, here.

Lastly, I posted a 1GB image file with only minimal applications installed here, so that those who want to experiment with installing lots of different apps can have more "play-space".

The rest of the thread is a bunch of hardcore Debian chroot enthusiasts trying to get stuff working and keeping each other up to date.

Oh yes, and one very cool video.

ORIGINAL POST FOLLOWS:

Hi all,

I have a wiki entry, Running Debian in a chroot

This method allows you to install and run any of the thousands of applications, including things like Gimp and OpenOffice, compiled for the Debian armel port, without rebooting your tablet. Many of them run under the default OS, but you may need to use penguinbait's KDE to run some of the apps, because they are designed for a desktop OS and they have problems like dialog boxes that don't fit on the standard tablet operating system's screen.

I have posted about this in various threads, but I wanted to start a new thread so that people can discuss this in one place and propose better ways to do it. I would love to see a simple, newbie-friendly way to set this up so that anyone can install and run Debian apps with a minimum of hassle. This thread might help to make that happen.

Also, if you find Debian apps that work particularly well, apps that totally crash the system, or tricks for getting certain Debian apps to work on the tablet (eg. make sure you install esound support to get sound working on several apps), you can report your findings here.

EDIT: The "Discussion" tab on the wiki now links back to this thread. Nice.

debernardis 2008-05-27 05:29

Re: Running Debian in a chroot
 
Hello qole my friend,

in order to avoid fiddling with passwordless ssh, I changed the /usr/bin/debbie script as follows:

Code:

#!/bin/sh

if [ `id -u` != 0 ] ; then
#if not already root, call itself as root
        sudo gainroot <<EOF
exec $0 $*
EOF
        exit
fi

exec /home/user/MyDocs/bin/debian hilda $*

Took the code for re-executing as root elsewhere on the forums.

This seems OK BUT I haven't been able to make hildon menu items work.
If your menus do their job indeed, would you please try this modified script to see if it makes them not functional? Thanks

qole 2008-05-27 18:32

Re: Running Debian in a chroot
 
I have added a bit to the wiki from Benson, he pointed me to using visudo to make it possible to run anything as root just by typing sudo <command>, so now I just make the exec line in my menu item look something like:

Quote:

exec=sudo debian hilda abiword
That is a tested line. I just opened abiword with it.

You can make the "debbie" script just say "sudo debian hilda $*", that works too.

I found Personal Menu to be great for running these programs too; you don't have to mess around with a text editor and .desktop files. Also, there's a "run as root" checkbox.

t3h 2008-05-28 01:28

Re: Running Debian in a chroot
 
Xnest won't behave, installed, and it's not there...

qole 2008-05-28 17:24

Re: Running Debian in a chroot
 
Xephyr works. Try it instead of Xnest.

debernardis 2008-05-29 05:40

Re: Running Debian in a chroot
 
This is great news.
I installed xserver-xephyr on the debian chroot, then started xephyr in fullscreen as display :1.
Then in the Debian prompt exported display to :1
Then started xfce4-session.

Ta-dah! Full screen xfce4 (with abiword, openoffice and all the band) along with hildon-matchbox and those other odd things. Two worlds together! I am verrrrry happy :-)

Now I need a new 8gigs transflash. The one I had from Sandisk was fridged by the tablet and I was never able to restore it. My present 6gigs has become insufficient for that debianosaurus.

qole 2008-05-29 09:45

XFCE4 in Xephyr on top of OS2008
 
Quote:

Originally Posted by debernardis (Post 186794)
Ta-dah! Full screen xfce4 (with abiword, openoffice and all the band) along with hildon-matchbox and those other odd things. Two worlds together! I am verrrrry happy :-)

Don't you find two windows managers to be terribly slow? I do.

But, if you want to go the two-WM route, I suggest looking into the VNC method:

VNC METHOD
  • Install tightvncserver in Debian
  • Install VNC Viewer in OS2008
  • Run the following command in Debian: vncserver -geometry 770x770
  • Use VNC Viewer to view localhost:1
  • When you're done with xfce4, in Debian: vncserver -kill :1

This method has the following advantages:
  • Full Hildon virtual keyboard support
  • Right-click support
  • Large virtual desktop (with a convenient vertical scroll-bar)

However, for anyone interested in getting this to work with Xephyr (come on, you know you do), within Debian you'll need to:

XEPHYR METHOD

Code:

apt-get install xserver-xephyr
apt-get install wmctrl

I assume you already have xfce4 installed, since it comes as default for the current Debian install.

Then, I suggest a little script (/usr/bin/xephce4 ? ;) ) with something like the following:
Code:

#!/bin/sh
#---------------------------------------
#Start the Xephyr server. Don't use host-cursor! There is none!

export DISPLAY=:0
Xephyr :1 -screen 800x480x16 -dpi 96 -ac &

#---------------------------------------
#Make Xephyr full screen and bring it to the front.

wmctrl -r Xephyr -b toggle,fullscreen
wmctrl -a Xephyr

#---------------------------------------
#Make a bunch of important files writable
#by the user. Maybe not needed in all setups.

chown user /home/user/.ICEauthority
chgrp users /home/user/.ICEauthority
chown user /home/user/.cache
chgrp users /home/user/.cache
chown user /home/user/.dbus/session-bus
chgrp users /home/user/.dbus/session-bus

#---------------------------------------
#run xfce4 as user.
su user -c 'export DISPLAY=:1; xfce4-session' &

As always, remember to chmod +x /usr/bin/xephce4. Also, you need to run this as root in Debian, so don't use the "hilda" script. You should just do (from OS2008):

Code:

sudo debian xephce4
You'll need to use wmctrl -a Xephyr or that kciconsbox program to get back to your xfce4 desktop when you "lose" it.

Advantages of this method:
  • Very cool.
  • It seems faster. Anyone want to do time trials?
  • Pressure sensitivity should work Nope.

http://farm3.static.flickr.com/2059/...4603f6b4d1.jpg

Quote:

Originally Posted by debernardis (Post 186794)
My present 6gigs has become insufficient for that debianosaurus.

That's a good word for it. I constantly have to free up space by looking through my installed packages and removing stuff that I tried once and haven't used again... I'm still trying to find a good media player.

BruceL 2008-05-29 18:03

Re: Running Debian in a chroot
 
Could one of you guys post a quick recipe for getting Abiword to work through Debian on maemo and/or KDE?

If so, thanks!

qole 2008-05-29 19:12

Re: Running Debian in a chroot
 
Once you have your chroot scripts set up as I describe in the wiki, you go into Debian and "apt-get install abiword", and abiword should run from the Debian prompt. Then you just have to run "sudo debian hilda abiword" from a maemo terminal or put that line into a .desktop file.

Could you be more specific as to what your problem is? I can give better help if I know what's wrong.

debernardis 2008-05-30 05:54

Re: Running Debian in a chroot
 
From my approximate evaluation, calling openoffice or abiword in hildon windows (the "debbie abiword" method) is much quicker than calling them under xfce4 in a Xephyr window.
At present I don't know if that depends on Xephyr or on xfce4. I'll experiment more - with JWM I presume, a very light WM.

qole 2008-05-30 22:43

Re: Running Debian in a chroot
 
When I said "it seems faster" I only meant that it seems faster running xfce4 via Xephyr than running it via VNC. I think it's going to be slow no matter what WM you use.

debernardis 2008-06-02 07:43

Re: Running Debian in a chroot
 
JWM is easy to achieve - just apt-get install. It seems quite quick, too.

I have a question: when I call these windows managers in a Xephyr windows *as root* there's no problem in opening other applications like the console terminal.
But, if I call the window manager *as user* there are dbus problems for several apps.
Do you see such a behavior too?

Also, when opening another window manager in a Xephyr window, I lose the ability of getting "blue" function keys like numbers, and that's quite unpractical. Unless there's a workaround, I'll stick to hildon.

hans-castorp 2008-06-02 17:22

Re: Running Debian in a chroot
 
sylpheed works very well when you put it in vertical mode. very suitable to the tablet. xchat in debian is much better than that in maemo imo. i'll be using dillo for all of my browsing from now on methinks.

also, abiword, when you turn off real time spell checking is really very snappy.

qole 2008-06-03 19:07

Re: Running Debian in a chroot
 
Dillo, while very fast, seems a bit on the spartan side for me. It seems to have a similar feature set to links2; good for simple web sites, but not much use for modern web application sites.

qole 2008-06-03 19:48

Re: Running Debian in a chroot
 
Quote:

Originally Posted by debernardis (Post 187887)
I have a question: when I call these windows managers in a Xephyr windows *as root* there's no problem in opening other applications like the console terminal.
But, if I call the window manager *as user* there are dbus problems for several apps.
Do you see such a behavior too?

No, I don't. Can you give specific times when this happens, and what the errors look like?

This may be a problem with permissions. The application may have created some settings files when you were root, and then when you try running it as user, it can't read or write to the settings files. I know that's what happened with Xephyr, that's why my script has those chmod and chgrp lines in it. Also, make sure your chroot script copies the hildon /etc/group and /etc/passwd files so that your chroot "user" account is the same "user" as in hildon. Otherwise you won't be able to share tmp files between hildon and debian.

Quote:

Originally Posted by debernardis (Post 187887)
Also, when opening another window manager in a Xephyr window, I lose the ability of getting "blue" function keys like numbers, and that's quite unpractical. Unless there's a workaround, I'll stick to hildon.

Xephyr, XFCE4 and AbiWord seem to have no problems with my BT keyboard. I can access all of the keys, including the blue numbers and the green symbols. I don't know what's happening there to you.

The biggest problem I have with the Xephyr WM method is that it just seems slow.

Benson 2008-06-03 19:54

Re: Running Debian in a chroot
 
Dillo is real nice; it's a shame about the developer needing to eat... It got put on the back burner, and will probably never be brought up to speed now. CSS and such were supposed to arrive right after the version which is now in perpetual alpha.

I find it (the GTK version, I haven't tried the FLTK alpha) better than links2, overall... I think it misses "proper" frames support, but frames are rarely a good idea anyway, IMHO.

But of course, modern web apps are designed around modern web browsers, and no light-weight will ever be caught up on enough features to do well on them.

qole 2008-06-03 23:17

Re: Running Debian in a chroot
 
I got all excited when summatusmentis posted an expanded icon .desktop file that included the line
Quote:

X-HildonDesk-ShowInToolbar=true
... but OpenOffice still has no sidebar icon. Anyone know what the two lines he added are for?

qole 2008-06-03 23:19

Re: Running Debian in a chroot
 
Quote:

Originally Posted by Benson (Post 188417)
I find it (the GTK version, I haven't tried the FLTK alpha) better than links2, overall...

I think you're right.

Quote:

Originally Posted by Benson (Post 188417)
But of course, modern web apps are designed around modern web browsers, and no light-weight will ever be caught up on enough features to do well on them.

I think the best bet is to go backwards, like MicroB or Fennec. Take a modern standards-compliant browser engine and aggressively optimize it and strip it down.

qole 2008-06-05 21:55

Re: Running Debian in a chroot
 
Quote:

Originally Posted by debernardis (Post 187887)
But, if I call the window manager *as user* there are dbus problems for several apps.
Do you see such a behavior too?

I just noticed that epiphany complained of dbus errors when called as a user. Doesn't matter if it is in Xephyr or in Hildon.

FIXED: When your application complains of dbus errors, then, as root, do the following:
Quote:

chown user /home/user/.dbus/session-bus/*
chgrp users /home/user/.dbus/session-bus/*
That should fix things. It's a permissions problem again; these files are being created as root/root and you need it set to user/users.

I think it wouldn't hurt to put those lines in the hilda and xephce4 scripts. Anyone else have any ideas?

qole 2008-06-06 22:48

Re: Running Debian in a chroot
 
I have been able to get Gnash to display Flash videos (albeit slowly), and gappletviewer can run Java applets, but I can't seem to get a browser to run either the Gnash plugin or the java plugin.

I currently believe the best bet for a browser to do these things would be kazehakase, since it is a small, fast gecko (xulrunner) based browser that supposedly can run mozilla plugins. Epiphany-webkit doesn't do plugins, and installing konqueror means installing the whole KDE ball of wax.

Here are some screenshots. The first is the Gnash standalone player running a flash video:

http://farm4.static.flickr.com/3258/...6f54bb65_o.png

Here is gappletviewer (found in the Debian classpath package) running this java applet, standalone:

http://farm4.static.flickr.com/3127/...82f57d51_o.png

debernardis 2008-06-07 03:30

Re: Running Debian in a chroot
 
That dbus chown does the trick, thanks.
Now, there is the keyboard problem, I think you have the n800 plus BT kbd so you don't see it, but with the n810 only first function chars do work, not 2nd function (blue) chars. This happens only inside a Xephyr window.
Must be some specific keyboard config to be copied between the maemo root and the debian chroot. Unfortunately at present I have no clue where to look for.

By the way, JWM is really cool, very minimalist and quick. Try it...

debernardis 2008-06-07 08:01

Re: Running Debian in a chroot
 
Tip #1 - shorten openoffice.org startup. Fire up an openoffice instance (ex. writer), go to tools / options, then in the list look for openoffice.org and memory. Change "use for openoffice.org" to 30MB and "memory per object" to 2MB. Seems to work in my hands albeit I did no measures (placebo is enough for me :-).
Taken from http://www.linuxformat.co.uk/pdfs/do...feat_speed.pdf which is a very interesting source of speeding advices.

Tip #2 - move around windows in matchbox. Very useful with debian apps windows under hildon/matchbox. See http://www.internettablettalk.com/fo...cking+matchbox - thanks to Anakin -
and apply the "DIALOGMODE = free" hack. I already posted it in another, more obscure, thread, but this is relevant also in this debian chroot thread.

Tip #3 - toggle maximization of debian apps windows with n810 keyboard. If you are already using keylaunch to get mouse right click, add the following line to your /etc/keylaunchrc file
Code:

key=*...Pressed F6:/home/user/togglewindowstate
and make a /home/user/togglewindowstate like that:
Code:

#!/bin/sh
wmctrl -r :ACTIVE: -b toggle,fullscreen
exit 0

Then, when you press shift+the hardware maximize button, you'll toggle the maximized state of any window including debian apps.

debernardis 2008-06-10 05:55

Re: Running Debian in a chroot
 
Quote:

Originally Posted by qole (Post 188481)
I got all excited when summatusmentis posted an expanded icon .desktop file that included the line


... but OpenOffice still has no sidebar icon. Anyone know what the two lines he added are for?

By the way, did you notice that if you call synaptic with
Code:

sudo debian synaptic
you get a sidebar icon? But there is no synaptic.desktop under /usr/share/application/hildon so it's the .desktop file inside the chroot that's ruling.
There must be some fundamental difference in ooo, then.

qole 2008-06-10 16:15

Re: Running Debian in a chroot
 
Quote:

Originally Posted by debernardis (Post 190334)
By the way, did you notice that if you call synaptic with
Code:

sudo debian synaptic
you get a sidebar icon? But there is no synaptic.desktop under /usr/share/application/hildon so it's the .desktop file inside the chroot that's ruling.
There must be some fundamental difference in ooo, then.

I think Synaptic, Abiword, Gimp, and other Debian apps that have sidebar icons are better integrated with GTK+, the graphics toolkit used in OS2008. I've installed the ooo GTK package, but it doesn't help here.

qole 2008-06-10 16:47

Re: Running Debian in a chroot
 
I installed the Debian beta3 version and I've discovered that it doesn't work as smoothly with my chroot scripts. In particular, the mpd (music player daemon) is installed, and it adds the mpd user. The users from the original install are overwritten by the default OS2008 users when you copy the /etc/passwd file in the chroot script, and then apt-get complains a lot that the mpd user is missing. I guess you need to purge mpd before copying over the passwd file.

Benson 2008-06-10 17:46

Re: Running Debian in a chroot
 
Yeah, I'm using a modified version of the script that backs up the passwd and group files...

So I'll just put them back, but I have made no effort to install packages since then; I was just more cautious. (Because I'm using it for boot as well as chroot...)

qole 2008-06-10 17:53

Re: Running Debian in a chroot
 
Quote:

Originally Posted by Benson (Post 190564)
...I have made no effort to install packages since then...

I can't stop installing packages. It's some sort of compulsion with me.

Maybe part of my compulsive apt-getting is that every time I do an
Code:

apt-get update
apt-get upgrade

... it seems like a dozen central packages have been updated, including classpath and epiphany.

debernardis 2008-06-10 17:53

Re: Running Debian in a chroot
 
Yes, I deleted the mpd user. I thought it was some mistake of mine when I first installed the thing. Now I think that should be added to the wiki.

Concerning packages, did you have success with iceape? It crashes in my hands, but who knows...

qole 2008-06-10 18:17

Re: Running Debian in a chroot
 
No, iceape is a no-go here too. It would have been nice, though, wouldn't it?

qole 2008-06-10 19:37

Firefox 3
 
Gecko based browser news: Minimo and Icehamster have Zaurus Debian ports. They install fine with "dpkg -i <package.deb>" in my Debian chroot, and they both run. I think Icehamster is better than Kazehakase. Neither of them do flash or java, however. I still think I've got something set up wrongly. I wish someone else was working on this.

The ArmEabiHowto page has two new repositories for your /etc/apt/sources.list
Quote:

deb http://simplemachines.it/debian armel-sid/
deb http://simplemachines.it/debian armel-experimental/
The armel-experimental repository, in particular, is interesting because it contains the iceweasel package! It is Firefox 3.0. It installs xulrunner-1.9.

Put those in your /etc/apt/sources.list, run
Code:

apt-get update
apt-get install iceweasel
iceweasel

Aaannd... It runs! Hooray! Full-blown Firefox 3.0 running on the NIT! Is that another first for me?

EDIT: It looks like it uses the Gnash and Java plugins. We now have in-browser Java applets.

http://farm4.static.flickr.com/3072/...9e99a465_o.png

Benson 2008-06-10 22:29

Re: Running Debian in a chroot
 
That's not FireFox; that's IceWeasel... Sheesh!

hans-castorp 2008-06-11 05:55

Re: Running Debian in a chroot
 
wow iceweasel 3 is pretty sweet. i'm booting into debian and after the initial slow startup this provides a very pleasant browsing experience. All the sites which I tried work well and load very quickly including google docs.

debernardis 2008-06-11 06:31

Re: Running Debian in a chroot
 
Those *sicilianazzi* from simplemachines.it is remind us that is possible to propagate a debian system with debootstrap - in the last few minutes I made an arm lenny minbase system which is only 96.9 megabytes and includes apt - then I'll populate it with openoffice.org only. Let's see how big it gets.

qole 2008-06-11 18:46

Re: Running Debian in a chroot
 
Mr. Bernardis, I think you (and those other guys on your active-volcano island*) might be on to something there. A minimal Debian system built with debootstrap might be just the thing for our chroot, rather than working with the necessarily-larger bootable Debian. And it might just be the best thing for a .deb install. I would suggest sid over lenny, however. The package versions seem consistently newer in sid.

* I love volcanoes. I went to visit Etna in 1992 to watch the lava crawling down the hillside.

Benson 2008-06-11 19:34

Re: Running Debian in a chroot
 
Quote:

Originally Posted by qole (Post 191056)
The package versions seem consistently newer in sid.

Qolling again? :p

qole 2008-06-11 20:28

Re: Running Debian in a chroot
 
Quote:

Originally Posted by Benson (Post 191083)
Qolling again? :p

I don't understand what you mean. Maybe I'm being ignorant, but that's not qolling.

I'm serious. Compare the package versions for OpenOffice.org. And I just chose that one because we've been talking about it.

Lenny: 1:2.4.0-5 (no package for armel)
Sid: 1:2.4.0-6

EDIT: I've decided qolling actually does require a healthy dose of ignorance on the part of the qoller.

EDIT2: OK, this is all obvious after reading Debian's releases page. Sid packages, by definition, will always be higher numbers, since Lenny is going to be the next stable release and the packages are all in the queue for that goal, and Sid is under active development.

Benson 2008-06-11 20:43

Re: Running Debian in a chroot
 
I was joking; the thing is, I thought that newer packages in sid was completely obvious; lenny's currently testing (not released as stable yet, but not unstable), sid's unstable... Etch, the current stable release, doesn't exist for armel, and is thus out of the question.

qole 2008-06-12 00:09

Re: Running Debian in a chroot
 
News from the same category as OpenOffice.org:

Evolution runs, it just doesn't run very well (kinda slow and layout is poor for tablet). But if you need that precious MS Exchange (or Novell Groupware) compatibility, then you might put up with the headaches.

http://farm4.static.flickr.com/3071/...877e57b4_o.png

qole 2008-06-12 18:22

Re: Running Debian in a chroot
 
UPDATE: Please see this post for a larger (42MB) tarball that works much better for installing things like OpenOffice, AbiWord, and Firefox / Iceweasel.

I did four different debootstrap variants (lenny, sid, minbase lenny, minbase sid), and the minbase sid was the smallest. I tarred up each of my variants, and I've uploaded the tiny minbase sid one for you-all. It is just over 28mb.

You download the tarball, make a directory (like /debian) in your big SD clone partition, and then
Code:

tar xjvf debian-minsid-armel-chroot.tgz /debian
mkdir /debian/home/user
chown user /debian/home/user
chgrp users /debian/home/user
mkdir /debian/media/mmc1
mkdir /debian/media/mmc2
mkdir /debian/media/usb

to set up the chroot.

Use the chroot script from the wiki to "get into" the chroot, and then you'll have to
Code:

apt-get update
to start installing stuff.

As for installing OpenOffice.org, I found I couldn't just install the big meta-package, it gave errors about dependencies not being installed. So I had to work my way back to the openoffice.org-core package. It gave me a full page of package names to be installed, and told me that it would use 250MB on the disk! :eek:

EDIT: OK, this is weird. I installed the openoffice.org-core package. It claims to be the 1:2.4.0-6 package. When I try to install anything "above" that, however, (e.g. openoffice.org-writer) it says that it needs openoffice.org-core = 1:2.4.0-6, which is not going to be installed.

EDIT2: After downloading the package and doing a
Code:

dpkg -i openoffice.org-writer_2.4.0-6_armel.deb
I found out that somebody's recently screwed up the openoffice.org package. The high-level packages are "conflicting" with openoffice-common. Looks like they've got a broken version number in there (1:2.4.1), from one of the Intel architectures, probably. Sigh. I got it installed, but it sure is ugly. I hope they get this fixed soon.

EDIT3: OK this is just wacky. There's something wrong with the versioning in this chroot in the ooo packages.

Benson 2008-06-12 19:36

Re: Running Debian in a chroot
 
Just over 28 MB (bzipped), eh?

Wonder if it fits in flash memory (jffs2, so some compression, but it won't be as good as bz2), for chroot... probably not that hot, really; it'd be better, if you're trying for something useful in flash, to strip down JohnX's build and obliterate ITOS. But it'd be cool, anyway. I might try this on my internal memory.


All times are GMT. The time now is 08:15.

vBulletin® Version 3.8.8