i have successfully restored factory firmware image by using these commands from windows
C:\python\braiins-os>python restore2factory.py backup/ 192.168.2.244 --factory-image backup/Antminer-S9-all-201711171757-autofreq-user-Update2UBI-NF.tar.gz
put the factory image in it, along with two more files: uEnv.txt and config.tar.gz (that contains mac adress)
You need to run:
python3 restore2factory.py path/to/backup hostname --factory-image path/to/Antminer-S9-all-201812051512-autofreq-user-Update2UBI-NF.tar.gz
you may need to use an older factory firmware as I cant remember whether the newest LPM firmwares are partial updates as opposed to full firmware images.
Here are the instructions for if you do not have a backup from when you upgraded to bOS
1.) create empty directory backup
2.) create text file mac (without any file extension)
3.) write one line with MAC address to the file mac (you can obtain your MAC address from web interface Network -> Interfaces -> MAC-Address)
4.) compress the file mac with tar using gzip compression and store it to the backup directory with a name config.tar.gz
5.) create a file called uEnv.txt in the back up directory containing the following information:
recovery_mtdparts=mtdparts=pl35x-nand:32m(BOOT.bin-env-dts-kernel),144m(angstram-rootfs),80m(upgrade-rootfs)
This is from the walkthrough given to me by Braiins support.