2 #Synch a mounted chroot; this means copying some important files to the chroot.
4 #Try to get the chroot location from the config file...
5 if [ "x$CHROOT" = x ] ; then
6 #Pull in the config, if possible...
7 [ -f /home/user/.chroot ] && . /home/user/.chroot
8 #Still not set? Set to default
9 [ "x$CHROOT" != x ] || CHROOT=/debian
12 #Abort if chroot not mounted.
13 if [ ! -d "$CHROOT/etc/" ] ; then
14 echo "cannot sync; chroot not mounted!"
18 echo "synching the chroot..."
20 #Just a somewhat-readable uniquifier so backups don't overwrite other backups.
21 BOB=`date | awk '{print $1$2$3}'`
23 #Make the Internet work.
25 mv "$CHROOT/etc/resolv.conf" "$CHROOT/etc/resolv.conf.$BOB"
26 cp /etc/resolv.conf "$CHROOT/etc/resolv.conf"
27 mv "$CHROOT/etc/hosts" "$CHROOT/etc/hosts.$BOB"
28 cp /etc/hosts "$CHROOT/etc/hosts"
30 #Make permissions work.
31 mv "$CHROOT/etc/group" "$CHROOT/etc/group.$BOB"
32 cp /etc/group "$CHROOT/etc/group"
33 mv "$CHROOT/etc/passwd" "$CHROOT/etc/passwd.$BOB"
34 cp /etc/passwd "$CHROOT/etc/passwd"
36 #Set the correct time.
37 mv "$CHROOT/etc/localtime" "$CHROOT/etc/localtime.$BOB"
38 cp -a /etc/localtime "$CHROOT/etc/localtime"
40 #Help make N810 F-keys work
41 mv "$CHROOT/usr/share/X11/xkb" "$CHROOT/usr/share/X11/xkb.$BOB"
42 cp -r /usr/share/X11/xkb "$CHROOT/usr/share/X11"