summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/dnsmasq.conf5
-rwxr-xr-xsrc/qemu.sh15
2 files changed, 19 insertions, 1 deletions
diff --git a/conf/dnsmasq.conf b/conf/dnsmasq.conf
index 7200efc..5ab9008 100644
--- a/conf/dnsmasq.conf
+++ b/conf/dnsmasq.conf
@@ -4,6 +4,11 @@ dhcp-range=192.168.10.10,192.168.10.253,255.255.255.0,1h
4enable-tftp 4enable-tftp
5 5
6dhcp-host=52:54:00:12:34:56,samizdoot-vm,192.168.10.82 6dhcp-host=52:54:00:12:34:56,samizdoot-vm,192.168.10.82
7dhcp-host=52:54:00:12:34:57,samizdote-vm,192.168.10.83
8dhcp-host=52:54:00:12:34:58,samizdeet-vm,192.168.10.84
9dhcp-host=52:54:00:12:34:59,samizdite-vm,192.168.10.85
10dhcp-host=52:54:00:12:34:5A,samizdate-vm,192.168.10.86
11
7#dhcp-host=f0:de:f1:5a:ac:e8,samizdoot-irl,192.168.10.82 12#dhcp-host=f0:de:f1:5a:ac:e8,samizdoot-irl,192.168.10.82
8 13
9pxe-service=x86PC, "Samizdat", pxelinux 14pxe-service=x86PC, "Samizdat", pxelinux
diff --git a/src/qemu.sh b/src/qemu.sh
index 2ae982d..130b688 100755
--- a/src/qemu.sh
+++ b/src/qemu.sh
@@ -30,7 +30,20 @@ kcmdline_CDROM='boot=samizdat components quiet splash'
30kcmdline_CDROM_NET="${kcmdline_CDROM} nbdroot=,${nbd_filename}, nbddev=/dev/nbd0 ip=dhcp" 30kcmdline_CDROM_NET="${kcmdline_CDROM} nbdroot=,${nbd_filename}, nbddev=/dev/nbd0 ip=dhcp"
31kcmdline_NET="${kcmdline_CDROM_NET} netkeys" 31kcmdline_NET="${kcmdline_CDROM_NET} netkeys"
32 32
33MAC='52-54-00-12-34-56' 33find_mac()
34{
35 start_mac=$1
36 for mac in $(ip link show | grep link/ether | (read _ mac _; echo $mac | tr : -)); do
37 if [ "${mac%??}" = "${start_mac%??}" ]; then
38 prefix=${mac%??}
39 suffix=$(printf %x $(( 0x${mac##*-} + 1 )))
40 MAC=${prefix}${suffix}
41 return
42 fi
43 done
44 MAC=$start_mac
45}
46find_mac 52-54-00-12-34-56
34 47
35kcmdline_BOOTIF="BOOTIF=01-$MAC" 48kcmdline_BOOTIF="BOOTIF=01-$MAC"
36 49