#!/bin/sh ############################################################ if [ $(dpkg-query --show |grep atftp|wc -l) -eq 0 ] ; then echo "Not Building Voyage Live CD. Exit" exit fi ############################################################ # initramfs-tools sed -i -e 's/debian/voyage/' \ -e 's/Debian Live user/root/' \ -e 's/debian/root/' \ /etc/live.conf LIVE_DIR=/usr/share/initramfs-tools/scripts/live-bottom if [ -d $LIVE_DIR ] ; then #disable casper init scripts chmod -x $LIVE_DIR/??adduser #chmod -x $LIVE_DIR/??networking chmod -x $LIVE_DIR/??autologin chmod -x $LIVE_DIR/??accessibility chmod -x $LIVE_DIR/??gnome_panel_data chmod -x $LIVE_DIR/3?* chmod -x $LIVE_DIR/4?* fi chown root:root $LIVE_DIR/* ############################################################ # config dnsmasq cat <>/etc/dnsmasq.more.conf conf-file=/etc/dnsmasq.pxe.conf EOF ############################################################ SERVER_IP=192.168.1.200 # !!!!!!!!!!!! CHANGE THIS! NET_RANGE=192.168.1.10,192.168.1.20 # !!!!!!!!!!!! CHANGE THIS! DEFAULT_GW=192.168.1.1 # !!!!!!!!!!!! CHANGE THIS! DNS_SERVER=192.168.1.1 # !!!!!!!!!!!! CHANGE THIS! cat </etc/dnsmasq.pxe.conf dhcp-range=$NET_RANGE,60m dhcp-boot=pxelinux.0,$SERVER_IP dhcp-option=3,$DEFAULT_GW dhcp-option=6,$DNS_SERVER EOF ############################################################ # config syslinux and tftpboot cp /usr/lib/syslinux/pxelinux.0 /tftpboot/ ln -s /vmlinuz /tftpboot/linux ln -s /initrd.img /tftpboot/initrd.img chown root:root -R /tftpboot/* chmod u+r -R /tftpboot/* ############################################################ # config nfs export cat << EOF >> /etc/exports /live/image 192.168.1.0/255.255.255.0(ro,fsid=42,no_subtree_check,insecure,no_root_squash,async) EOF ############################################################ # config atftpd - the below won't work for inetd #sed -i -e '/^tftp/ s/\/var\/lib//' /etc/inetd.conf ############################################################ # config atftpd sed -i -e 's/^tftp/#tftp/' /etc/inetd.conf sed -i 's/USE_INETD=true/USE_INETD=false/' /etc/default/atftpd cat << EOF >> /etc/default/atftpd OPTIONS="-t 300 -r 5 -m 100 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --verbose=5 --user=root.root --daemon /tftpboot" EOF ############################################################ # config inittab - enable serial sed -i -e "s/^#T0:/T0:/" /etc/inittab ############################################################ # disable dhcp3-server #update-rc.d -f dhcp3-server remove ############################################################ # disable atftpd update-rc.d -f atftpd remove ############################################################ # disable nfs-user-server update-rc.d -f nfs-user-server remove ############################################################ # disable nfs-kernel-server update-rc.d -f nfs-kernel-server remove # Re-creating initrd.img #for KVERS in $(dpkg-query --show | grep linux-image | tr -s "\t" " " | cut -d " " -f 1 | sed -s "s/linux-image-//" ) #do # update-initramfs -k $KVERS -d # update-initramfs -k $KVERS -c #done rm -f /boot/*.bak /*.bak