Can any one tell me how to execute bash scripts via pxe boot. What I am trying to do is when Raw Server boots up I want to deploy cloned image over hard disk via PXE boot. I am aware that there are some tools like Fog which does similar thing. But I am trying to do this by dd as part of university project. Any kind of help is appreciated.
Edit:
I followed following procedure.
1. Copied vmlinuz and initrd to tftp directory
2. Unpacked initrd (Using https://www.novell.com/documentation/zenworks7/dm7admin/data/b2cdjzb.html)
3. Added following lines in init script
echo "Deploying image of an ESXi Hypervisor"
echo "Downloading image"
wget http://192.168.1.250/backup/esxi -O /bin/esxi
echo "Deploying image"
sudo dd if=~/bin/esxi of=/dev/rdisk2 bs=1m
echo "Process Complete"
4. Repacked initrd
5. Added both files initrd and vmlinuz under boot folder /tftpboot/boot
6. Added following lines in pxe default file
label VMware ESXi (Last Backup 1)
KERNEL boot/vmlinuz
APPEND initrd=boot/initrd
But it still gives error "mountinng /sys on /root/sys failed"
What I am missing here?