mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
'added copy-mountpoint.sh script for system moving'
This commit is contained in:
parent
557cd0c189
commit
4a3492acb9
3 changed files with 33 additions and 1 deletions
|
@ -65,7 +65,6 @@ install ()
|
||||||
add_file "/etc/rc.d/functions"
|
add_file "/etc/rc.d/functions"
|
||||||
add_file "/usr/share/archboot/base/etc/rc.conf" "/etc/rc.conf"
|
add_file "/usr/share/archboot/base/etc/rc.conf" "/etc/rc.conf"
|
||||||
add_file "/etc/rc.d/syslog-ng"
|
add_file "/etc/rc.d/syslog-ng"
|
||||||
|
|
||||||
### adding config files of installation system
|
### adding config files of installation system
|
||||||
for i in $(find /usr/share/archboot/base/etc/*); do
|
for i in $(find /usr/share/archboot/base/etc/*); do
|
||||||
add_file "$i" "/etc/$(basename $i)"
|
add_file "$i" "/etc/$(basename $i)"
|
||||||
|
@ -74,6 +73,8 @@ install ()
|
||||||
### fixing network support
|
### fixing network support
|
||||||
add_file "/lib/libnss_files.so.2"
|
add_file "/lib/libnss_files.so.2"
|
||||||
add_file "/lib/libnss_dns.so.2"
|
add_file "/lib/libnss_dns.so.2"
|
||||||
|
### add copy-mountpoint.sh
|
||||||
|
add_file "/usr/bin/copy-mountpoint.sh"
|
||||||
}
|
}
|
||||||
|
|
||||||
help ()
|
help ()
|
||||||
|
|
|
@ -58,6 +58,8 @@ install ()
|
||||||
### fixing network support
|
### fixing network support
|
||||||
add_file "/lib/libnss_files.so.2"
|
add_file "/lib/libnss_files.so.2"
|
||||||
add_file "/lib/libnss_dns.so.2"
|
add_file "/lib/libnss_dns.so.2"
|
||||||
|
### add copy-mountpoint.sh
|
||||||
|
add_file "/usr/bin/copy-mountpoint.sh"
|
||||||
}
|
}
|
||||||
|
|
||||||
help ()
|
help ()
|
||||||
|
|
29
usr/bin/copy-mountpoint.sh
Executable file
29
usr/bin/copy-mountpoint.sh
Executable 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 -
|
Loading…
Reference in a new issue