summaryrefslogtreecommitdiffstats
path: root/recipes/clone.sh
blob: d2b9d99d15db342541dd3a52396199ac050cfc83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 /etc/resolv.conf "nameserver $nameserver"
write /etc/HOSTNAME "$hostname"
sync
EOF