Just a heads up as I was having a similar issue above doing a manual install of PirateBox on my Series B RPi where I already knew about installing the correct hostapd for my Edimax USB wifi. I was still getting these errors when running:
pi@raspberrypi ~ $ /usr/sbin/hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=3
l2_packet_init: socket(PF_PACKET): Operation not permitted
rtl871xdrv driver initialization failed.
pi@raspberrypi ~ $ hostapd -dd /etc/hostapd/hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=3
l2_packet_init: socket(PF_PACKET): Operation not permitted
rtl871xdrv driver initialization failed.
But after manually just running: `sudo service hostapd start` connecting to my RiPi via wifi now works and I can upload and chat.
pi@raspberrypi ~ $ /usr/sbin/hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=3
l2_packet_init: socket(PF_PACKET): Operation not permitted
rtl871xdrv driver initialization failed.
pi@raspberrypi ~ $ hostapd -dd /etc/hostapd/hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=3
l2_packet_init: socket(PF_PACKET): Operation not permitted
rtl871xdrv driver initialization failed.
But after manually just running: `sudo service hostapd start` connecting to my RiPi via wifi now works and I can upload and chat.