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