sofiactl
sofiactl copied to clipboard
Is it possible to get a full firmware backup
I have full access to my camera (telnet root) which uses sofia. I would like to extract the full firmware bin. Is this possible with sofiactl or by some other means?
You could configure NFS server, mount nfs from cam and dump MTD partitions using dd or similar. Here is a steps which I used for restoring accounts by replacing files on mounted NFS partition (Ubuntu), but didn't tried to dump MTD. And you still need to create files in firmware update format from dumps if you are going to use firmware upgrade for your device. Be careful with preparing own firmware upgrade - you can kill your device.
On server:
- apt-get install nfs-common nfs-server -y
- mkdir -p /home/nfs
- chmod 777 /home/nfs
- add to /etc/exports
/home/nfs *(rw,sync,no_root_squash,fsid=0,crossmnt,no_subtree_check)
-
exportfs -a
-
service rpcnind start
On DVR/IPC:
- telnet as root
- mkdir -p /var/tmp/nfs
- mount -t nfs <SERVER IP>:/home/nfs -o nolock /var/tmp/nfs
Thanks for the info. I'll definitely work on that. I figured I needed to dump mtd partitions, but my goal is to have a full firmware backup. I have 5 cameras that are the same hardware but 2 of them are a different firmware with less features. My hope is to extract the firmware from one camera to use on another. I'm having a difficult time sourcing the target firmware. V5.00.R02.00030665.10010.245306.00000 (RA50X20).
The firmware is a archive with partition images. If you are able to dump mtd partitions I think it is possible to repack the firmware, but it is a risk operation. Currently the problem that camera shell is missing dd command. I was able to dump partitions following way:
- mount nfs partition on your local server to /var/tmp/nfs per instructions above
- get list of partitions:
cat /proc/partitions
- show mounted filesystems parameters:
mount
- for each /dev/mtdblock device execute following:
cat /dev/mtdblockX > /var/tmp/nfs/mtdblockX.img
(X - mtd partition number)
The images could be mounted:
mount -t filesystem -o ro,loop mtdblockX.img
(filesystem - from mount on camera output for that mtdblock, X - mtdblock partition number)
On my camera root partition is mtdblock2, filesystem type cramfs
mount -t filesystem -o ro,lool mtdblockX.img Thanks for the info. Is lool correct or a typo for loop?
Yes, correct loop