summaryrefslogtreecommitdiffstats
path: root/recipes/clone.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/clone.sh')
-rwxr-xr-xrecipes/clone.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/recipes/clone.sh b/recipes/clone.sh
new file mode 100755
index 00000000..e3fc11cf
--- /dev/null
+++ b/recipes/clone.sh
@@ -0,0 +1,15 @@
+#!/bin/sh -
+
+preimage="$1"
+newimage="$2"
+root="$3"
+nameserver="$4"
+hostname="$5"
+
+dd if="$preimage" of="$newimage"
+
+guestfish -a "$newimage" -m "$root" <<EOF
+write-file /etc/resolv.conf "nameserver $nameserver" 0
+write-file /etc/HOSTNAME "$hostname" 0
+sync
+EOF