psolyca / Yi_4k_ROOTFS

Yi 4k file system optimisation and debug
39 stars 3 forks source link

pack firmware #7

Open V1lu0 opened 2 years ago

V1lu0 commented 2 years ago

Is there a way to pack the firmware back to use it on the camera?

psolyca commented 2 years ago

Hey, Yes, use my script https://github.com/psolyca/Yi_4k_ROOTFS/blob/dev/build.sh There are comments and help message.

V1lu0 commented 2 years ago

Thanks for the quick reply, I failed to extract the firmware using amba_FWpack_yi.py. Then unpacker.c of Xiaomi_Yi_4k_Camera can be unpacked successfully, but he does not provide pack file, so the file I modified cannot be packed and used. Does the build.sh you provided allow you to generate new firmware files directly? (Note: I want to change the firmware to add FRP program in it)

psolyca commented 2 years ago

To unpack, you should use the amba_fwpack_yi.py in the firmware_unpacker branch, https://github.com/psolyca/Xiaomi_Yi_4k_Camera/tree/unpacker/firmware_unpacker. When you have all your files, unsquash and modify _part_rfs.a9s. Then you can use my script but not as-is. You have to modify it cause I add lots of custom files to it. Everything from line 102 to 109 are my own addition. You must keep 93 to 100 otherwise you will not be able to boot. These are important files and links. My script use the original firmware as a base and the unsquashed folder to create the firmware.

V1lu0 commented 2 years ago

Thank you.This problem have solved.

psolyca commented 2 years ago

Please tell me how ? Maybe I can update or write something about it.

V1lu0 commented 2 years ago

Ok, wait me sometime. tomorrow I will do it