| Prev |   6     7   8   9   | Next
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)

Benson 2008-08-07 17:33

Re: Running Debian in a chroot
 
So have you (qole, or actually anyone) tested that yet with a non-broken iceweasel? I'd like to know if it's working correctly.

(And I think I may have been a bit over-the-top with that post, actually. I'd forgotten about posting that when I went to set up my own chroot scripts from scratch on a clean flash (I was off-line, and hadn't got my backups handy), and even having looked at and tweaked your version previously, I only got perhaps over half the mounts and file clones right before I gave up a couple hours later. Major hat-tip for your success!)

qole 2008-08-07 17:55

Re: Running Debian in a chroot
 
Quote:

Originally Posted by Benson (Post 211179)
I will warn that iceweasel now looks horrible here, but I think that's because I clobbered something else, not from debbie.

Looks fine here. Thanks a lot.
(...I won't ask what you've clobbered now... :rolleyes:)

qole 2008-08-09 23:34

Re: Running Debian in a chroot
 
EDIT: Script attachment removed. See below for better scripts.

Ok, here are the new chroot scripts for beta testing.

The big news is that the chroot script is now BOOTABLE-DEBIAN-SAFE.

I have taken out all of the file copy commands and put them into a separate script, called "synchroot" which makes a unique backup of all copied files. This script is only run when the user creates an empty file called ~/.synchroot (which is deleted when the script completes). This way, the files are only copied into the chroot when the user requests it, which may be never, in the case of those with custom setups.

This will allow you to chroot into your OS2007 partition, for example, or into your bootable beta3 partition, without worrying about copying over any files. All you do is modify your ~/.chroot file.

I have also included a closechroot script, which closes all chroot apps and unmounts the chroot. This is useful for changing chroots, etc.

This also includes Benson's fixed debbie script.

qole 2008-08-10 06:39

Re: Running Debian in a chroot
 
Quote:

Originally Posted by Matan (Post 196824)
About unmounting: I found that killing all chrooted programs like this:


for i in [0-9]* ; do if ls -dl $i/root | grep -q /opt ; then kill $i ; fi ; done


And then unmounting in the correct order (basically reversed order of mounting), works everytime.

I used that line in my closechroot script, but it doesn't work. All I get is,
Code:

ls: [0-9]*/root: No such file or directory
What is that line supposed to do?

Stskeeps 2008-08-10 06:52

Re: Running Debian in a chroot
 
Quote:

Originally Posted by qole (Post 211962)
I used that line in my closechroot script, but it doesn't work. All I get is,
Code:

ls: [0-9]*/root: No such file or directory
What is that line supposed to do?

Can't you use 'fuser' or the likes instead of some voodoo solution of killing processes in chroot?

qole 2008-08-10 07:37

Re: Running Debian in a chroot
 
Quote:

Originally Posted by Stskeeps (Post 211964)
Can't you use 'fuser' or the likes instead of some voodoo solution of killing processes in chroot?

I don't know, can I? Please post the proper command.

EDIT: Thanks for the tip! I figured it out, it is really straightforward and "non-voodoo" :D

Code:

fuser -m "$CHROOT" -k
It's as simple as that, all chroot processes are killed!

EDIT2: For those of you trying this at home: DO NOT RUN THIS IF YOUR CHROOT IS NOT MOUNTED! The fuser command will say, "Oh, I need to kill all processes in the filesystem that the empty /debian directory is in. That would seem to be, um, everything." :eek:

qole 2008-08-10 08:56

Re: Running Debian in a chroot
 
1 Attachment(s)
HOORAY!

Here are even better scripts. I have fixed closechroot so it works every time (thanks Stskeeps!), and, thanks to a new USB drive, I finally cleaned up the external device mounting routine in debian; now it gets the list of devices mounted under /media and mounts them all in Debian, creating the directory if needed first. I believe that this closes the "FIXME" that Benson put on this section of the script.

Code:

#Any external devices
  MNTD=`cat /proc/mounts | grep ' /media/' | awk '{print $2}'`
  for MDRV in $MNTD ; do
    if [ ! -d "$CHROOT$MDRV" ] ; then
      mkdir "$CHROOT$MDRV"
    fi
    mount -o bind "$MDRV" "$CHROOT$MDRV"
  done

For the sake of completeness, I've included the /home/user/.chroot file, too, so in theory you can untar this as root into your root directory, and you are good to go.

Everything I said above applies here, too:
Quote:

Originally Posted by qole (Post 211922)
The big news is that the chroot script is now BOOTABLE-DEBIAN-SAFE.

I have taken out all of the file copy commands and put them into a separate script, called "synchroot" which makes a unique backup of all copied files. This script is only run when the user creates an empty file called ~/.synchroot (which is deleted when the script completes). This way, the files are only copied into the chroot when the user requests it, which may be never, in the case of those with custom setups.

This will allow you to chroot into your OS2007 partition, for example, or into your bootable beta3 partition, without worrying about copying over any files. All you do is modify your ~/.chroot file.

I have also included a closechroot script, which closes all chroot apps and unmounts the chroot. This is useful for changing chroots, etc.

This also includes Benson's fixed debbie script.


qole 2008-08-10 19:31

Re: Running Debian in a chroot
 
I guess the next thing to do is make the debian script check to see if $CHROOT and other variables are already there (perhaps set before running the script), and if they are, use those values. It would need to be crafted such that you could define one or more variables and only undefined variables are retrieved from the ~/.chroot file. However it is done, it would have to also be integrated into the closechroot script... Also, the "chroot-complete" marker file would have to be chroot-specific, so the debian script will properly mount multiple chroots.

I would like to be able to do something like:
Code:

sudo 'CHROOT=/debian IMGFILE=/dev/mmcblk0p4 debbie iceweasel'
This would run Debian Iceweasel.

And then, later, I could do...

Code:

'CHROOT=/os2007 IMGFILE=/dev/mmcblk0p3 debbie xmame froggers.zip'
This would run my OS2007 version of xmame to let me play frogger... :D

qole 2008-08-11 19:29

Re: Running Debian in a chroot
 
Ok, found another problem... Tried to use the scripts to mount the internal flash. It doesn't know the jffs2 file system type, so it falls back to ext2. Sigh...

WORKAROUND: mount the partition ahead of time, then run the script. It fails to mount, but it is already mounted, so the chroot proceeds as normal.

midwinter 2008-08-12 00:35

Re: Running Debian in a chroot
 
Hi all. I'm trying to track down some digitizer errors (presses not registering, presses registering in the wrong place) and would like to uninstall Debian. Can I just do it through the application manager, or do I need to do anything fancy?

qole 2008-08-12 02:36

Re: Running Debian in a chroot
 
Quote:

Originally Posted by midwinter (Post 212600)
Hi all. I'm trying to track down some digitizer errors (presses not registering, presses registering in the wrong place) and would like to uninstall Debian. Can I just do it through the application manager, or do I need to do anything fancy?

I don't think my scripts are your problem, but you should just be able to uninstall Easy Debian and things should be "as they were". You shouldn't have to delete the big image file; hopefully you'll re-install Easy Debian and start using it again...

midwinter 2008-08-12 03:01

Re: Running Debian in a chroot
 
Quote:

Originally Posted by qole (Post 212634)
I don't think my scripts are your problem, but you should just be able to uninstall Easy Debian and things should be "as they were". You shouldn't have to delete the big image file; hopefully you'll re-install Easy Debian and start using it again...

Thanks much. It's a weird error. Taps seem to register about two inches to the left and slightly down from where I tap.

qole 2008-08-13 04:28

Re: Running Debian in a chroot
 
I need to make the scripts non-dependent on gxmessage, too, it would seem. I forgot about gxmessage when I suggested that people use it to fix the broken Diablo SSU.

qole 2008-08-25 23:25

Re: Running Debian in a chroot
 
Quote:

Originally Posted by t3h (Post 186416)
Xnest won't behave, installed, and it's not there...

Quote:

Originally Posted by Benson (Post 204208)
Xnest is the only thing that comes to mind; you could run xnest with scrollbars (does xephyr do scrollbars, since it's already working?)

Well, it seems that the current version of Xnest starts up, but I can't seem to find anything about scrollbars. There's no mention of them in the command line options, nor does Googling do anything.

Benson, can you help out here? How do you get scrollbars in Xnest?

Benson 2008-08-26 01:31

Re: Running Debian in a chroot
 
I remember I used to "use" Xnest with scrollbars, and I thought the scrollbars came from Xnest. Of course, I never really did have much use for it; just cool to run a different desktop environment in there.

Maybe what I'm really remembering is running an Xnest in FVWM2, which can toss scrollbars on any window. It was some years ago last I messed with it, so that's a likely explanation. Sorry about the false lead. :o

qole 2008-08-26 16:25

Re: Running Debian in a chroot
 
Drat! I was really excited there for a while. Scrollbars would be so cool. I would love to have a big virtual desktop with a vertical scrollbar, just like I do with VNC.

fatalsaint 2008-08-26 16:28

Re: Running Debian in a chroot
 
Wouldn't a virtual desktop still be possible without scrollbars?? You'd have to click and drag to move the mouse but the screen should move with the mouse... same as a virtual desktop on a full size computer..

Stskeeps 2008-08-26 16:44

Re: Running Debian in a chroot
 
Quote:

Originally Posted by fatalsaint (Post 217728)
Wouldn't a virtual desktop still be possible without scrollbars?? You'd have to click and drag to move the mouse but the screen should move with the mouse... same as a virtual desktop on a full size computer..

Yeah, I wondered about if that was possible as well - doesn't the X configuration file have something for resolution and virtual resolution? But since we're using TinyX..

Doesn't one of the alternative OS projects have a Xomap that's X.org based or the likes? I heard a rumour that Freemantle might have this..

qole 2008-08-26 17:10

Re: Running Debian in a chroot
 
What lightweight WMs provide that virtual desktop functionality? How do you activate it?

qole 2008-08-26 18:26

Re: Running Debian in a chroot
 
Meh, Xnest is even flakier than Xephyr. The mouse pointer keeps wanting to move windows instead of select buttons or menus or whatever... Very frustrating! And it doesn't even have a third axis (pressure) listed for its pointer. At least Xephyr taunts and teases me by offering a third axis in pressure-sensitive apps... but then ignoring it.

I contacted Xephyr's writer about this:

Quote:

> I would like to know if there is any way to get pressure info (axis 3) from
> the Nokia N8×0’s touchscreen into Xephyr, perhaps using the -mouse
> parameter?

Not without modifying the source Im afraid. It shouldn't be too difficult however.
Hear that, coder-types? "It shouldn't be too difficult". Go and make it so! :D ;)

fatalsaint 2008-08-26 18:32

Re: Running Debian in a chroot
 
I tried passing -screen 1024x768@96 to Xomap just to see what happens :D... After about 25 minutes I got to the Enlightenment Splash screen... and 30 minutes after that hadn't moved lol..

Yeah.. that didn't work :). And now that I pulled the battery to shut off it wont boot into it anymore with the fsck enabled lol. So I had to modify the /etc/fstab so it doesn't fsck on boot until I can fix that.

qole 2008-08-26 18:53

Re: Running Debian in a chroot
 
Yeah, I think all you did there was make a really big physical X-Server, that went off the screen somewhere into the dark reaches of null-space.

What we need is a WM that handles a big virtual desktop. I suspect that fvwm2 probably does (I mean, it has Virtual in the name, right?) and I'm sure that metacity/Gnome can do it... How, I don't know... Drat, packages.debian.org is unresponsive for me right now, that's how I search for these things.

From the FVWM manual:
Quote:

31.9.3. DesktopSize

DesktopSize HorizontalxVertical

Defines the virtual desktop size in units of the physical screen size.
and...

Quote:

Fvwm provides multiple virtual desktops for users who wish to use them. The screen is a viewport onto a desktop which may be larger than the screen. Several distinct desktops can be accessed (concept: one desktop for each project, or one desktop for each application, when view applications are distinct). Since each desktop can be larger than the physical screen, divided into m by n pages which are each the size of the physical screen, windows which are larger than the screen or large groups of related windows can easily be viewed.

The (m by n) size (i.e. number of pages) of the virtual desktops can be changed any time, by using the DesktopSize command. All virtual desktops must be (are) the same size. The total number of distinct desktops does not need to be specified, but is limited to approximately 4 billion total. All windows on a range of desktops can be viewed in the FvwmPager, a miniature view of the desktops. The pager is an accessory program, called a module, which is not essential for the window manager to operate. Windows may also be listed, along with their geometries, in a window list, accessible as a pop-up menu, or as a separate window, called the FvwmWinList (another module).

Fvwm keeps the windows on the desktop in a layered stacking order; a window in a lower layer never obscures a window in a higher layer. The layer of a window can be changed by using the Layer command. The concept of layers is a generalization of the StaysOnTop flag of older fvwm versions. The StaysOnTop and StaysPut Style options are now implemented by putting the windows in suitable layers and the previously missing StaysOnBottom Style option has been added.

Sticky windows are windows which transcend the virtual desktop by "Sticking to the screen's glass". They always stay put on the screen. This is convenient for things like clocks and xbiffs, so you only need to run one such gadget and it always stays with you. Icons can also be made to stick to the glass, if desired.

fatalsaint 2008-08-26 18:57

Re: Running Debian in a chroot
 
FVWM probably sounds like the way to go... I was trying to figure out how to do it with Xomap or Xephyr but there isn't a lot of document on their CLI options that I can find..

I just want my Xorg >.>.

qole 2008-08-26 19:50

Re: Running Debian in a chroot
 
And the nice thing is that if I go with fvwm (which, so far, I like better than IceWM) I can "borrow" stuff from other places.

(hmm, for some reason I can't find the post where coffeedrinker posts some details of how he integrated the fvwm desktop and the OS2008 panels)

Benson 2008-08-26 21:13

Re: Running Debian in a chroot
 
Quote:

Originally Posted by qole (Post 217835)
And the nice thing is that if I go with fvwm (which, so far, I like better than IceWM) I can "borrow" stuff from other places.

(hmm, for some reason I can't find the post where coffeedrinker posts some details of how he integrated the fvwm desktop and the OS2008 panels)

It does that by itself; try it. (He may have some geometry settings to help out, but it's working out-of-box.)

I figured out the easy way of stopping matchbox, which was the hardest bit (for me). Mostly it just works.

Oh, here it is:
Quote:

Originally Posted by Benson (Post 204654)
Ok, or maybe one better... get the existing code to do all the work for us.

Code:

#!/bin/sh
. /etc/osso-af-init/af-defines.sh
. /etc/osso-af-init/matchbox.defs
. /etc/osso-af-init/matchbox.sh

Call that with either start or stop arguments to start or stop matchbox.


qole 2008-08-26 23:05

Re: Running Debian in a chroot
 
Hey yeah, that's the thread I was looking for! I'll steal borrow some ideas from that project to get a nice-looking Debian fvwm desktop.

At this point, I'm thinking fvwm2 is probably the icewm replacement for the final Easy Debian image file.

Benson, or someone else proficient in fvwm, could you help me get a config that has six desktops (2 high x 3 wide), with a tiny desktop switcher that sits tightly in the bottom right corner, and a nice theme with minimal window dressings (thin top bar, especially)? Perhaps some kind of thin launcher / status panel against the left or right side, too...

allnameswereout 2008-09-07 22:01

Re: Running Debian in a chroot
 
(I guess someone who'd do this would use Debian instead of ITOS so I ask this here.)

I wonder if anyone is using the NIT primarily for CLI, and what kind of modifications were made to make it running for this purpose easier. For example, I find the large font in osso-terminal together with the resolution difficult to deal with.

fatalsaint 2008-09-07 22:04

Re: Running Debian in a chroot
 
For Maemo I lowered the font settings by going into Menu->Tools->Settings.. 10 or 12 are more legible.

For Debian pretty much all of the default terminal's are pretty small and easier to read.

Isn't much we can do about the resolution yet.. until one of us put all our attention into the "virtual" desktop that was being mentioned in Easy Debian's arena.

I also find for advanced and long sessions either a USB keyboard (with adapter) or a BT keyboard is much preferred over the default on-screen or N810 hardware keyboard.

allnameswereout 2008-09-08 06:04

Re: Running Debian in a chroot
 
Wow I had not thought about lowering the font size yet thank you very much! :)

I put at 12. 10 was barily readable. However in the case where space is important, it might be temporarily doable.

I found this post from qwerty12: Some tiny osso-xterm mods... he provides a way to easily lower or increase the font size. That might be useful.

I'll look into the keyboard thing. I don't like to replace batteries though, its another point of failure and they keep costing money (and bad for environment). I'm also afraid the keyboard won't be supported well, while the Nokia SU-8W goes for approx 90 EUR which is a lot of money for a simple keyboard.

I'm seriously considering abolishing X and using screen and ssh solely on my NIT (using 'Debian'). The only thing I can think of I'd be missing would be pictures while browsing. I guess I'd need a framebuffer for that. Another thing I'd miss would be Navicore, but I don't like this application anyway, and will probably use a Nokia phone for this purpose in the near future. RSS would be perfect in console, and all kind of statistics as well. Besides, the applications keep running on a remote server. Add to that that the device becomes suitable to administer servers, with convenient copy/paste. Although maybe a very lightweight WM is also an option. Has anyone here gone through this path?

fatalsaint 2008-09-08 17:09

Re: Running Debian in a chroot
 
Quote:

Originally Posted by allnameswereout (Post 221869)
I'll look into the keyboard thing. I don't like to replace batteries though, its another point of failure and they keep costing money (and bad for environment). I'm also afraid the keyboard won't be supported well, while the Nokia SU-8W goes for approx 90 EUR which is a lot of money for a simple keyboard.

Get a USB keyboard.. no Batteries. For an N810 you need a F-F USB Coupler.. $3-$5.. and flip it into host mode (search around iTT). Acts just like a USB keyboard in a desktop.

I use a foldable plexi one that you can roll up (think Live Free or Die Hard)... I wouldn't recommend them.. sure they are portable and mobile but pressing the keys on them become a pain (you have to hit straight down.. pushing on the sides won't work.. slows me down a bit). Still.. I use it over the hardware keyboard on the N810.

Benson 2008-09-08 18:07

Re: Running Debian in a chroot
 
Quote:

Originally Posted by fatalsaint (Post 222042)
Quote:

I'll look into the keyboard thing. I don't like to replace batteries though, its another point of failure and they keep costing money (and bad for environment). I'm also afraid the keyboard won't be supported well, while the Nokia SU-8W goes for approx 90 EUR which is a lot of money for a simple keyboard.
Get a USB keyboard.. no Batteries. For an N810 you need a F-F USB Coupler.. $3-$5.. and flip it into host mode (search around iTT). Acts just like a USB keyboard in a desktop.

Well, that's one option; of course, then it drains the none-too-large battery of the NIT, instead. I'd just go with one of the dedicated OTG adapters, or if you're permanently dedicating the keyboard, replace the keyboard with a OTG pigtail. (Providing shipping from Canada to the Netherlands doesn't kill you...) Either way, you'll need the mini-micro pigtail, but to me that still beats the Nokia cable and a Lesbie adapter.

I've got two BT boards: an iGo BT, which is nice for walking around on account of the rigid locking, but is insanely cramped. I've also got a Palm 3245WW, which is a full 5-row, and works better on a desk. (The iGo rocks back and forth, as the ends are not supported.) Both of them work fine; I'm not sure what sort of support you're concerned about.

fatalsaint 2008-09-08 18:33

Re: Running Debian in a chroot
 
How does an OTG adapter take any less power than the Lesbie? You still need to power the USB keyboard which will drain the battery of the NIT. I don't see that as a "better" option?? Just same option with different dongles... What am I missing? The reason I went the Lesbie route is $5 for a lesbie or $20+ for a OTG Adapter/Mini-Micro converter.. more money and I saw no gain..

I think the only way you can avoid the battery drain is a powered USB hub .. either powered via Battery (back to batteries) or the Wall (in which case you could just plug in the NIT).

Benson 2008-09-08 19:11

Re: Running Debian in a chroot
 
No, the BT was the option that avoids that; the OTG adapter eliminates fooling with software (so I can connect the keyboard and start working without un-fullscreening), and reduces the amount of cable to manage.

Sorry for the confusion. :o

qole 2008-09-08 19:16

Re: Running Debian in a chroot
 
Ha! Lesbie adapter. I am SO using that term from now on.

qole 2008-09-09 14:45

Re: Running Debian in a chroot
 
As I'm building my Easy Debian Final image, I'm making backups along the way.

Here is a Debian Lenny root filesystem, suitable for chroot (a dedicated partition or an empty image file), all set up for installing lots of software with no hassles. Locales are installed and I've hacked and pinned hal and dbus, so they won't cause you any problems.

The tarball is quite small, relatively speaking, only 54 MB.

basic-debian-chroot-fs.tar.bz2

EDIT: Please note, you must run "apt-get update" after chrooting and before continuing.

I have included fatalsaint's repository (and key) in this version, too.

This version also has the default distro set to "Lenny" so, unless the program is not in Lenny, apt-get will always download the "safer" Lenny version.

qole 2008-09-14 21:59

Re: Running Debian in a chroot
 
1 Attachment(s)
Here are the chroot scripts that I'm using in Easy Debian Final. There are a couple of added speed hacks, some OpenOffice-related vars, and some other tweaks.

The /usr/bin/debbie script that was heavily modded by Benson is included.

This also includes the closechroot and synchroot scripts. They have proved very useful to me.

The .chroot file has a couple of example lines added for the image file. They are actual Debian partitions on my system :)

I've also attached a copyright notice and a GPL header to /sbin/debian, the core chroot script. Just to make it more like a Real Application. Benson, if you'd like some credit here, speak up!

If you use these scripts, especially /sbin/debian, in your own projects, please give some credit, and remember, the GPL requires that you make the modified code GPL as well.

Benson 2008-09-15 02:13

Re: Running Debian in a chroot
 
I'm fine with GPL for whatever I've contributed, but kinda like having things on a "no-credit, no-blame" basis. ;) Thanks for the offer, though!

b-man 2008-09-16 02:25

Re: Running Debian in a chroot
 
I will likely include this GPL in Cdeb2 when i release it, since it does use a hacked-up version of debbie (now cuser) and synkchroot (now csynk). Even if the other 90% of the code that makes up cdeb2 was written by me :p.

Btw, i'm allmost rety to release cdeb2~ still am doing some final tweeks here and there, also i am still working on image support.... But it won't be long before it is complete. :)

fatalsaint 2008-09-20 17:53

Re: Running Debian in a chroot
 
I must say...i tries this again today with deblet and lxde... running maemo side by side with debian really is the best of all worlds. Mplayer even worked in debian lol...full screen and all. Definitely missing something for the wm on deblet.

Good job again qole..these scripts are quite cool.

qole 2008-10-02 22:58

Re: Running Debian in a chroot
 
Quote:

Originally Posted by Benson (Post 205900)
FVWM/multi-Xomap
Separately, and if Darken doesn't beat me to it, I may be releasing an independent script-up for running a second N+1th Xomap on a second N+1th VC, and using native FVWM (with an N800-friendly config) on it. (If Darken beats me with the release, I'll just sit back and gripe about his... :D)

This is a separate project with no chroot required, more like PB's KDE, but much less ambitious. It does provide a dandy place to run some chroot apps, though, hence its mention here.

Any movement here? I'm curious about the whole chvt + xomap :1 thing... I'd like some help here, actually.


| Prev |   6     7   8   9   | Next
All times are GMT. The time now is 22:53.

vBulletin® Version 3.8.8