diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/nslu2-binary-only/unslung-rootfs/slingover | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) | |
download | openembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/nslu2-binary-only/unslung-rootfs/slingover')
-rwxr-xr-x | recipes/nslu2-binary-only/unslung-rootfs/slingover | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/recipes/nslu2-binary-only/unslung-rootfs/slingover b/recipes/nslu2-binary-only/unslung-rootfs/slingover new file mode 100755 index 0000000000..51f03316e5 --- /dev/null +++ b/recipes/nslu2-binary-only/unslung-rootfs/slingover @@ -0,0 +1,83 @@ +#!/bin/sh + +usage="Usage: $0 disk1|disk2" + +if [ $# -gt 1 ] ; then + echo $usage + exit 1 +fi + +if [ $# -lt 1 ] ; then + echo $usage + exit 1 +fi + +if [ "$1" = "disk1" ] ; then + source=/share/hdd/conf + target=/share/hdd/data +elif [ "$1" = "disk2" ] ; then + source=/share/flash/conf + target=/share/flash/data +else + echo $usage + exit 1 +fi + +# Check it's a real mount point + +if grep $source /proc/mounts >/dev/null 2>&1 ; then + echo "Source disk is $source" +else + echo "Error: $source is not a mounted disk" + exit 1 +fi + +if grep $target /proc/mounts >/dev/null 2>&1 ; then + echo "Target disk is $target" +else + echo "Error: $target is not a mounted disk" + exit 1 +fi + +if [ -d $source/opt ] ; then + if [ -d $target/opt.old -a -h $target/opt ] ; then + echo "Reverting old /opt symlink on $target." + rm -f $target/opt + mv $target/opt.old $target/opt + fi + echo "Copying /opt directory from $source to $target." + ( cd $source ; tar cf - opt ) | ( cd $target ; tar xf - ) + rm -rf $source/opt.old + mv $source/opt $source/opt.old +fi + +if [ -d $source/usr ] ; then + if [ -d $target/usr/lib/ipkg.old -a -h $target/usr/lib/ipkg ] ; then + echo "Reverting old /usr/lib/ipkg symlink on $target." + rm -f $target/usr/lib/ipkg + mv $target/usr/lib/ipkg.old $target/usr/lib/ipkg + fi + echo "Copying /usr directory from $source to $target." + ( cd $source ; tar cf - usr ) | ( cd $target ; tar xf - ) + rm -rf $source/usr.old + mv $source/usr $source/usr.old +fi + +if [ -d $source/unslung ] ; then + echo "Copying /unslung directory from $source to $target." + ( cd $source ; tar cf - unslung ) | ( cd $target ; tar xf - ) + rm -rf $source/unslung.old + mv $source/unslung $source/unslung.old +fi + +if [ -f $target/opt/bin/perl ] ; then + echo "Replicating /usr/bin/perl symlink." + ln -s /opt/bin/perl $target/usr/bin/perl +fi + +if [ -f $target/opt/bin/bash ] ; then + echo "Replicating /bin/bash symlink." + ln -s /opt/bin/bash $target/bin/bash +fi + +exit 0 |