#!/bin/sh -x
-# sudo apt-get install live-helper
+# sudo apt-get install live-helper nfs-kernel-server
-lh_config --binary-images net --net-root-path `pwd`/binary --net-root-server 172.16.10.1 --apt-http-proxy http://192.168.1.20:3142 \
-&& sudo lh_build
+mkdir binary/hosts
+
+sudo lh_clean
+lh_config --binary-images net \
+ --net-root-server 172.16.10.1 --net-root-path `pwd`/binary \
+ --union-filesystem unionfs \
+ --net-cow-server 172.16.10.1 --net-cow-path `pwd`/hosts/client_mac_address \
+ --apt-http-proxy http://192.168.1.20:3142 --apt-ftp-proxy http://192.168.1.20:3142 \
+|| exit
+
+time sudo lh_build || exit
+
+sudo chown dpavlin tftpboot/pxelinux.cfg/default
+cat > tftpboot/pxelinux.cfg/default << ____
+include debian-live/i386/boot-screens/live.cfg
+default debian-live/i386/boot-screens/vesamenu.c32
+prompt 0
+timeout 00
+____