View Single Post
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, 224 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!