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

New Firmware build issue in tn4810m/tn48m #47

Closed DhimanAirao closed 1 year ago

DhimanAirao commented 1 year ago

While compiling new firmware for tn4810m I faced the following issue. This might be because /bin/bash -l -c need commands in double-quotes. please help me debug it.

Screenshot from 2023-06-19 17-27-52

robimarko commented 1 year ago

Did you run git submodule init and then git submodule update after cloning the repo?

DhimanAirao commented 1 year ago

Yes, I performed git submodule init and git submodule update after cloning repo.

My make command is this: make J=8 V=10 NO_CACHE=1 CTARGET=aarch64-unknown-linux-gnu package_tn4810m

Is there any problem with make comamnd?

System Information: OS: Manjaro Linux(23.0.0) DISTRIBUTION: GNOME CPU cores: 8 RAM: 8GB

robimarko commented 1 year ago

Please use V=1 and dont use NO_CACHE. If that fails, can you post the whole log as its compiling fine for me.

DhimanAirao commented 1 year ago

Hii, this time I execute following command but still error persist. I attached log file for your reference.

make J=8 V=1 CTARGET=aarch64-unknown-linux-gnu package_tn4810m log.txt

robimarko commented 1 year ago

Ok, so its failling to download zlib. I would suggest passing Gentoo mirrors that are near you via GENTOO_MIRRORS= from: https://www.gentoo.org/downloads/mirrors/

DhimanAirao commented 1 year ago

I think this is not a issue related to mirror as when I tried to download zlib in my own system it still fails. As url(https://zlib.net/zlib-1.2.11.tar.gz) which replica uses to download zlib uses didn't exists.

Can you say how to change zlib download url in replica?

Screenshot from 2023-06-20 14-20-58 Screenshot from 2023-06-20 14-22-43

robimarko commented 1 year ago

That is exactly why I am saying to add mirrors as genkernel is using an older zlib version and zlib.net only hosts the latest version but mirrors should have the older version as well.

If that doesn't work, you can edit repos/gentoo/sys-kernel/genkernel/genkernel-4.3.2.ebuild to use https://www.zlib.net/fossils/zlib-1.2.11.tar.gz instead.

DhimanAirao commented 1 year ago

Hello, tried multiple mirrors(China, Japan ,US) still issue persist and also tried by modifying repos/gentoo/sys-kernel/genkernel/genkernel-4.3.2.ebuild then it was not able to extract ERROR: sys-kernel/genkernel-4.3.2::gentoo failed (unpack phase): Can you tell which mirrors you are using so I can try with it?

robimarko commented 1 year ago

I am using: GENTOO_MIRRORS="http://gentoo.wheel.sk/ http://mirrors.evowise.com/gentoo/"

As they are much faster than the default ones where I live

DhimanAirao commented 1 year ago

Hello, your mirrors worked for me too. Thank you for your help and support.

DhimanAirao commented 1 year ago

Can you please tell me how to add custom packages in firmware build as I cannot see any documentation related to it in repo?

paulmenzel commented 1 year ago

As a lurker, I’d appreciate it, if you opened a new issue for this.

robimarko commented 1 year ago

I dont think there are any docs for it, but you can just specify more packages in: https://github.com/sartura/replica-overlay-switch/blob/main/profiles/replica/armada7040-prestera/packages

Basically, docs for Gentoo apply here.

DhimanAirao commented 1 year ago

I think this will only provide us the packages which are available in Gentoo packages. What I want is if I have some custom package stored in my local machine. So how to add that during firmware build?

robimarko commented 1 year ago

For that, you can either add a custom ebuild to the switch ebuild repo or add your own ebuild repository and include it. Everything relating to ebuilds and ebuild repos is documented already in Gentoo docs

paulmenzel commented 1 year ago

With commit https://github.com/sartura/replica/commit/f01924d239f973d09e57b1b4e580e67eaf0ff34c I ran

make -j32 DOCKER_BUILDKIT=1 CTARGET=armv7a-unknown-linux-musleabihf package_tn4810m  GENTOO_MIRRORS="http://gentoo.wheel.sk/ http://mirrors.evowise.com/gentoo/"

but still got the error:

#13 1634.7 >>> Downloading 'https://zlib.net/zlib-1.2.11.tar.gz'
#13 1634.7 --2023-07-16 14:34:13--  https://zlib.net/zlib-1.2.11.tar.gz
#13 1634.7 Resolving zlib.net... 85.187.148.2
#13 1634.7 Connecting to zlib.net|85.187.148.2|:443... connected.
#13 1634.7 HTTP request sent, awaiting response... 404 Not Found
#13 1634.7 2023-07-16 14:34:13 ERROR 404: Not Found.
#13 1634.7
#13 1634.7 !!! Couldn't download 'zlib-1.2.11.tar.gz'. Aborting.
paulmenzel commented 1 year ago

Could you please share the correct line?

jpetrina commented 1 year ago

Could you please share the correct line?

Paul, could you please give us more details so we could follow up accordingly?

paulmenzel commented 1 year ago

Sorry, it worked trying it on the weekend. One mistake in my line is CTARGET=armv7a-unknown-linux-musleabihf, and should be CTARGET=aarch64-unknown-linux-gnu. From my side, I can’t reproduce it anymore with the command below:

make -j32 DOCKER_BUILDKIT=1 CTARGET=aarch64-unknown-linux-gnu package_tn48m GENTOO_MIRRORS=" http://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/ http://gentoo.wheel.sk/ http://mirrors.evowise.com/gentoo/"
jpetrina commented 1 year ago

Thanks, I am closing this issue.

@DhimanAirao, please feel free to open up a new issue regarding custom package integration though.