generator: Generate guestfish-only commands.
[libguestfs.git] / recipes / clone.sh
1 #!/bin/sh -
2
3 preimage="$1"
4 newimage="$2"
5 root="$3"
6 nameserver="$4"
7 hostname="$5"
8
9 dd if="$preimage" of="$newimage"
10
11 guestfish -a "$newimage" -m "$root" <<EOF
12 write /etc/resolv.conf "nameserver $nameserver"
13 write /etc/HOSTNAME "$hostname"
14 sync
15 EOF