First you'll need to create a regular initrd. If you don't know exactly what that is or how it's created, check the documentation for your distribution (then ask here if something's still not entirely clear).
When you have the initrd, you will need to make the following modifications:
- add any utilities you need to perform the system erase, like dd, shutdown etc.
- modify the startup script to run the erase commands instead of actually booting the system
Once this is done, the configuration file of the bootloader (grub or lilo) must be modified to use this initrd. In the case of lilo, the lilo
command must be run to update the boot sector.
I would recommend testing this on a virtual machine before deploying, to make sure the target system gets properly erased. Just remember to take a snapshot of the VM before reconfiguring the bootloader; that way you can simply roll back the changes should somthing go wrong.