Using copy-firmware.sh to copy firmware instead of using PRODUCT_COPY_FILES

189 views
Skip to first unread message

Huy Minh Bùi (HMTheBoy154)

unread,
Dec 22, 2022, 3:02:32 PM12/22/22
to Android-x86
Traditionally Android-x86 use `PRODUCT_COPY_FILES` to copy firmware to /system/lib/firmware. This still being used today, however it have a few issues, especially if you use this method with newer linux-firmware repo: 
- It doesn't symlinks all the firmware, especially with brcm and nvidia
- It will create errors, especially with newer AOSP builds like s-x86 or t-x86 due to the fact that some brcm firmware have spaces.

Thankfully, on linux-firmware repo there is a script called copy-firmware.sh. What this script does is that it will read a file inside called WHENCE to check which file need to copy or which file need to symlink and then do all of that in a specified output. I tried this script and it works perfectly with BlissOS 15.8.2 (s-x86) so far. If anyone interested in using it here's what I did :

- For r-x86 and above, whitelist "install" command

- Remove firmware.mk and Android.mk out from device/generic/firmware 


- Include it in kernel.mk and remove firmware.mk out from device.mk

Huy Minh Bùi (HMTheBoy154)

unread,
Dec 22, 2022, 3:08:45 PM12/22/22
to Android-x86
here is my $(TARGET_OUT)/lib/firmware/brcm after using the script :
https://i.ibb.co/7z7nf6S/image.png

This is also handy to cut out the firmware we don't need. Instead of cherry-picking commits to update the firmware we can just edit WHENCE instead
Vào lúc 03:02:32 UTC+7 ngày Thứ Sáu, 23 tháng 12, 2022, Huy Minh Bùi đã viết:
Reply all
Reply to author
Forward
0 new messages