diff --git a/lib/initcpio/install/arch_base b/lib/initcpio/install/arch_base index 3ffe49cfc..ac6f9a84b 100644 --- a/lib/initcpio/install/arch_base +++ b/lib/initcpio/install/arch_base @@ -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 () diff --git a/lib/initcpio/install/arch_base_lowmem b/lib/initcpio/install/arch_base_lowmem index 5e65cb031..9b5fd03f2 100644 --- a/lib/initcpio/install/arch_base_lowmem +++ b/lib/initcpio/install/arch_base_lowmem @@ -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 () diff --git a/usr/bin/copy-mountpoint.sh b/usr/bin/copy-mountpoint.sh new file mode 100755 index 000000000..7ed349512 --- /dev/null +++ b/usr/bin/copy-mountpoint.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# copy-mointpoint.sh - copy recursivly a mountpoint using tar +# by Tobias Powalowski +# 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} " + exit $1 +} + +################################################## + +if [ $# -ne 2 ]; then + usage 1 +fi + +NEWMOUNTPOINT="${2}" +OLDMOUNTPOINT="${1}" + +tar -C $OLDMOUNTPOINT -clspf - . | tar -C $NEWMOUNTPOINT -vxlspf - \ No newline at end of file