'added copy-mountpoint.sh script for system moving'

This commit is contained in:
Tobias Powalowski 2009-04-26 15:09:49 +02:00
parent 557cd0c189
commit 4a3492acb9
3 changed files with 33 additions and 1 deletions

View file

@ -65,7 +65,6 @@ install ()
add_file "/etc/rc.d/functions"
add_file "/usr/share/archboot/base/etc/rc.conf" "/etc/rc.conf"
add_file "/etc/rc.d/syslog-ng"
### adding config files of installation system
for i in $(find /usr/share/archboot/base/etc/*); do
add_file "$i" "/etc/$(basename $i)"
@ -74,6 +73,8 @@ install ()
### fixing network support
add_file "/lib/libnss_files.so.2"
add_file "/lib/libnss_dns.so.2"
### add copy-mountpoint.sh
add_file "/usr/bin/copy-mountpoint.sh"
}
help ()

View file

@ -58,6 +58,8 @@ install ()
### fixing network support
add_file "/lib/libnss_files.so.2"
add_file "/lib/libnss_dns.so.2"
### add copy-mountpoint.sh
add_file "/usr/bin/copy-mountpoint.sh"
}
help ()

29
usr/bin/copy-mountpoint.sh Executable file
View file

@ -0,0 +1,29 @@
#!/bin/bash
#
# copy-mointpoint.sh - copy recursivly a mountpoint using tar
# by Tobias Powalowski <tpowa@archlinux.org>
# usage(exitvalue)
# outputs a usage message and exits with value
APPNAME=$(basename "${0}")
usage()
{
echo "COPY MOUNTPOINTS:"
echo "- Copy mountpoint recursivly from one mountpoint to an other one,"
echo " using tar utility."
echo "- For system copying start with mounted / and then invoke this script"
echo " for each additional mountpoint eg. /boot or /home."
echo ""
echo "usage: ${APPNAME} <oldmountpoint> <newmountpoint>"
exit $1
}
##################################################
if [ $# -ne 2 ]; then
usage 1
fi
NEWMOUNTPOINT="${2}"
OLDMOUNTPOINT="${1}"
tar -C $OLDMOUNTPOINT -clspf - . | tar -C $NEWMOUNTPOINT -vxlspf -