how to package img file

don nguyen

n3wb
Joined
Jul 9, 2018
Messages
25
Reaction score
0
Location
ptit
i have extract file cramfs.img fw dvr hikvision. Now I want to repack the cramfs.img file to upgrade
that I do not know how? People guide me to do?
thank you!
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,972
Reaction score
6,795
Location
Scotland
Use the -p option in the @montecrypto hikpack tool, as shown in this command list :
help

**edit**
Or do you mean - how do I create a cramfs.img file?
If so, example here :
Code:
alastair@PC-I5 ~/cctv/NVRFirmware/3.4.80/NVR_78_79_EXX_V3.4.80_160718/custom $ ll build_from_this
total 14960
drwxr-xr-x  2 alastair alastair    4096 Aug 14  2016 ./
drwxr-xr-x 10 alastair alastair    4096 Aug 20  2016 ../
-rwxr-xr-x  1 alastair alastair    3365 Aug 14  2016 dec_newstart.sh*
-rw-r--r--  1 alastair alastair 1344480 Jul 31  2016 gui_res.tar.lzma
-rwxr-xr-x  1 alastair alastair     616 Aug 14  2016 new_10.bin*
-rwxrwxr-x  1 alastair alastair      48 Jan  3  2016 start.sh*
-rw-r--r--  1 alastair alastair 7650583 Aug 14  2016 sys_app.tar.lzma
-rwxr-xr-x  1 alastair alastair 3083056 Jul 31  2016 uImage*
-rw-r--r--  1 alastair alastair 3215032 Jul 31  2016 webs.tar.lzma
alastair@PC-I5 ~/cctv/NVRFirmware/3.4.80/NVR_78_79_EXX_V3.4.80_160718/custom $ mkcramfs build_from_this newcramfs.img
Directory data: 252 bytes
Everything: 14988 kilobytes
Super block: 76 bytes
CRC: 22a8a795
warning: gids truncated to 8 bits (this may be a security concern)
alastair@PC-I5 ~/cctv/NVRFirmware/3.4.80/NVR_78_79_EXX_V3.4.80_160718/custom $ file newcramfs.img
newcramfs.img: Linux Compressed ROM File System data, little endian size 15347712 version #2 sorted_dirs CRC 0x22a8a795, edition 0, 3738 blocks, 8 files
alastair@PC-I5 ~/cctv/NVRFirmware/3.4.80/NVR_78_79_EXX_V3.4.80_160718/custom $
 

don nguyen

n3wb
Joined
Jul 9, 2018
Messages
25
Reaction score
0
Location
ptit
thanks!
i want the package to img from files extracted files from the previous do not know how to create a file img
 

don nguyen

n3wb
Joined
Jul 9, 2018
Messages
25
Reaction score
0
Location
ptit
I have encoded the lzma file before packing the img file and the dav file but when uploading to the board it always reports the lzma file I want to change the logo in the logo.tar.gz file when changing and repacking is always error
 

don nguyen

n3wb
Joined
Jul 9, 2018
Messages
25
Reaction score
0
Location
ptit
When I changed the logo.tar.gz file and updated the sys_app.tar.lzma file, the board always rebooted. I think there was a problem where the lzma file
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,972
Reaction score
6,795
Location
Scotland
Isn't the problem due to the missing files?
Check the original, unchanged, archive and see if there are files in the lib folder.
OK, so my guess as to the cause of the problem was not correct.
I checked the stock firmware for the 7208HGHI DVR, and there are no files in the lib folder.

Have you tried unpacking and repacking with no changes to see if that works?
 

don nguyen

n3wb
Joined
Jul 9, 2018
Messages
25
Reaction score
0
Location
ptit
Tôi đã làm như vậy và không có vấn đề xảy ra cho đến khi tôi thay đổi tập tin sys_app.tar.lzma
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,972
Reaction score
6,795
Location
Scotland
Tôi đã làm như vậy và không có vấn đề xảy ra cho đến khi tôi thay đổi tập tin sys_app.tar.lzma
Nếu bạn thay đổi bất kỳ tập tin-các nội dung của các tập tin bảo mật new_10. bin cần phải được Cập Nhật với các giá trị MD5 Hash mới.
Và nếu bạn thay đổi cramfs. img nội dung của tệp bảo mật new_20. bin cũng cần phải được thay đổi.
Các montecrypto hikpack chương trình nên làm điều này cho bạn.
Các wzhick hiktools chương trình sẽ không làm điều này.
 
Top