sartura / replica

Replica.one is an easy to use build system designed to deliver both secure and flexible firmware images.
MIT License
26 stars 12 forks source link

It spend too much time to build a rpi4 img #6

Closed kkcloudy closed 3 years ago

kkcloudy commented 3 years ago

Distribution: Ubuntu 20.04 RAM: 4g Docker daemon logs:

182452af7a4d3e496ba998d0f923c6d

hi, I start an rpi4 img building, but it has spend more than 12 hours and don,t finish, what should I do for this?

robimarko commented 3 years ago

Hi, unfortunately, it's most likely because of only 4GB of RAM. I would recommend 16GB of RAM and 8GB as a minimum. Can you check the RAM and swap usage with htop?

If I mind asking, what CPU do you have?

kkcloudy commented 3 years ago

@robimarko thanks for your reply, I have finished the rpi4 image building successfully, it spent almost 20 hours. maybe my internet is not good, it spent much time to download the source code from github. I will close this issue.

robimarko commented 3 years ago

Ok, so it was most likely trying to pull from the default Gentoo mirror, you can add: GENTOO_MIRRORS="http://gentoo.wheel.sk/ http://mirrors.evowise.com/gentoo/"

To the make command, just swap the mirrors with whatever is closest to you. The whole Gentoo mirrors list is here: https://www.gentoo.org/downloads/mirrors/

Sheng2216 commented 3 years ago

Ok, so it was most likely trying to pull from the default Gentoo mirror, you can add: GENTOO_MIRRORS="http://gentoo.wheel.sk/ http://mirrors.evowise.com/gentoo/"

To the make command, just swap the mirrors with whatever is closest to you. The whole Gentoo mirrors list is here: https://www.gentoo.org/downloads/mirrors/

Hi, I changed the mirror to the closest one and tried the following command, but it's still taking forever to build (at least 4 to 5 hours)

make GENTOO_MIRRORS="https://mirrors.tuna.tsinghua.edu.cn/gentoo http://mirrors.aliyun.com/gentoo/ https://mirrors.aliyun.com/gentoo/" J=6 CTARGET=aarch64-unknown-linux-gnu package_rpi4

I also tried to assign multiple cores to accelerate this process, but it seems the build process will not benefit a lot from that as it only consumes 1GB of the total 8GBs of RAM (I use free to check the RAM usage). Are there any other methods to accelerate this process besides assigning more ram/changing mirror addresses? And when I add multiple mirror addresses to the make command, which one will Gentoo use eventually?

robimarko commented 3 years ago

Builder will use all of the cores by default, it will use the mirrors in the order you put them. So if the first one does not have the archive it will check the second and so on.

Is this time a cached build or from scratch as only 1G of RAM indicates a cached one. If its a cached one then it should take way less, but what storage are you running this on?