Active Topics

 


Reply
Thread Tools
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#281
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!)
 

The Following User Says Thank You to Benson For This Useful Post:
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#282
Originally Posted by Benson View Post
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... )
__________________
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!
 

The Following User Says Thank You to qole For This Useful Post:
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#283
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.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-12 at 02:38.
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#284
Originally Posted by Matan View Post
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?
__________________
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!
 
Stskeeps's Avatar
Posts: 1,671 | Thanked: 11,478 times | Joined on Jun 2008 @ Warsaw, Poland
#285
Originally Posted by qole View Post
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?
 

The Following User Says Thank You to Stskeeps For This Useful Post:
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#286
Originally Posted by Stskeeps View Post
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"

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."
__________________
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-10 at 09:02. Reason: Figured it out
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#287
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:
Originally Posted by qole View Post
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.
Attached Files
File Type: gz debscripts.tar.gz (3.2 KB, 212 views)
__________________
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!
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#288
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...
__________________
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-10 at 19:35.
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#289
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.
__________________
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!
 
Posts: 96 | Thanked: 1 time | Joined on Jul 2007 @ Utah
#290
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?
 
Reply

Tags
chroot, debian, easy debian


 
Forum Jump


All times are GMT. The time now is 02:50.