summaryrefslogtreecommitdiffstats
path: root/recipes/clone.sh
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-12-21 17:23:08 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-12-21 17:23:08 +0000
commit49b2ae2e69e1a273b4d4a8746a872ec00b91c86f (patch)
treefad603e2bc2455e11e6ce65fc3e8acb3acc9389f /recipes/clone.sh
parentb1ca8b5fbb263fd945f21d0ccff99f40a59d562b (diff)
downloadlibguestfs-49b2ae2e69e1a273b4d4a8746a872ec00b91c86f.tar.gz
libguestfs-49b2ae2e69e1a273b4d4a8746a872ec00b91c86f.tar.xz
libguestfs-49b2ae2e69e1a273b4d4a8746a872ec00b91c86f.zip
recipes: Refresh guestfish recipes.
Diffstat (limited to 'recipes/clone.sh')
-rwxr-xr-xrecipes/clone.sh17
1 files changed, 8 insertions, 9 deletions
diff --git a/recipes/clone.sh b/recipes/clone.sh
index d2b9d99d..85acf1f3 100755
--- a/recipes/clone.sh
+++ b/recipes/clone.sh
@@ -1,15 +1,14 @@
#!/bin/sh -
-preimage="$1"
-newimage="$2"
-root="$3"
-nameserver="$4"
-hostname="$5"
+preimage="$1" ;# original guest
+newimage="$2" ;# new guest
+root="$3" ;# root filesystem
+nameserver="$4" ;# new nameserver
+hostname="$5" ;# new hostname
-dd if="$preimage" of="$newimage"
+dd if="$preimage" of="$newimage" bs=1M
guestfish -a "$newimage" -m "$root" <<EOF
-write /etc/resolv.conf "nameserver $nameserver"
-write /etc/HOSTNAME "$hostname"
-sync
+ write /etc/resolv.conf "nameserver $nameserver"
+ write /etc/HOSTNAME "$hostname"
EOF