X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=fremantle%2Feasy-chroot%2F.py2deb_build_folder%2Feasy-chroot%2Fsrc%2Fsbin%2Fsynchroot;fp=fremantle%2Feasy-chroot%2F.py2deb_build_folder%2Feasy-chroot%2Fsrc%2Fsbin%2Fsynchroot;h=c8dbe71d6d90cfd74854ffe0cc1f63369a4f4fa4;hb=d17ba37c01c5014a82c318b8dfeb09bd27cf209b;hp=0000000000000000000000000000000000000000;hpb=af7fe7476a5e0a0bdb128020fe30522b15c070e7;p=easy-deb-chroot diff --git a/fremantle/easy-chroot/.py2deb_build_folder/easy-chroot/src/sbin/synchroot b/fremantle/easy-chroot/.py2deb_build_folder/easy-chroot/src/sbin/synchroot new file mode 100755 index 0000000..c8dbe71 --- /dev/null +++ b/fremantle/easy-chroot/.py2deb_build_folder/easy-chroot/src/sbin/synchroot @@ -0,0 +1,42 @@ +#!/bin/sh +#Synch a mounted chroot; this means copying some important files to the chroot. + +#Try to get the chroot location from the config file... +if [ "x$CHROOT" = x ] ; then + #Pull in the config, if possible... + [ -f /home/user/.chroot ] && . /home/user/.chroot + #Still not set? Set to default + [ "x$CHROOT" != x ] || CHROOT=/debian +fi + +#Abort if chroot not mounted. +if [ ! -d "$CHROOT/etc/" ] ; then + echo "cannot sync; chroot not mounted!" + exit 99 +fi + +echo "synching the chroot..." + +#Just a somewhat-readable uniquifier so backups don't overwrite other backups. +BOB=`date | awk '{print $1$2$3}'` + +#Make the Internet work. + +mv "$CHROOT/etc/resolv.conf" "$CHROOT/etc/resolv.conf.$BOB" +cp /etc/resolv.conf "$CHROOT/etc/resolv.conf" +mv "$CHROOT/etc/hosts" "$CHROOT/etc/hosts.$BOB" +cp /etc/hosts "$CHROOT/etc/hosts" + +#Make permissions work. +mv "$CHROOT/etc/group" "$CHROOT/etc/group.$BOB" +cp /etc/group "$CHROOT/etc/group" +mv "$CHROOT/etc/passwd" "$CHROOT/etc/passwd.$BOB" +cp /etc/passwd "$CHROOT/etc/passwd" + +#Set the correct time. +mv "$CHROOT/etc/localtime" "$CHROOT/etc/localtime.$BOB" +cp -a /etc/localtime "$CHROOT/etc/localtime" + +#Help make N810 F-keys work +mv "$CHROOT/usr/share/X11/xkb" "$CHROOT/usr/share/X11/xkb.$BOB" +cp -r /usr/share/X11/xkb "$CHROOT/usr/share/X11" \ No newline at end of file