Closed Totodebrant closed 1 year ago
It seems that go
binary cannot be found. Does go version
in your shell works or you have a command not found
?
Seems to work:
toto@toto:~/0-initramfs$ go version
go version go1.19 linux/amd64
Note that all theses scripts are made to be run as root
. Can you try everything as root
?
Yes, same result unfortunately.
What does arch
command returns ?
toto@toto:~/0-initramfs$ arch
x86_64
And command -v go
?
toto@toto:~/0-initramfs$ command -v go
/usr/local/go/bin/go
if [ -z $GOPATH ]; then
if command -v go > /dev/null; then
export GOPATH=$(go env GOPATH)
else
echo "[-] variable GOPATH not defined"
exit 1
fi
fi
That's exactly what the scripts does. So it seems that your environment is not correct when running the script. I guess your PATH
and GOPATH
are reset when executing bash
.
Or try to execute the script without spawning a new bash process:
. ./initramfs.sh
Or try to export variables first:
export PATH
export GOPATH
bash -x initramfs.sh
But this should have been done by . autobuild/tf-build-settings.sh
, this script is there for that purpose exactly.
Both give the same exact issue, also on the m1 mac docker.
I'll try that on my Mac M1, never installed docker on it, will give it a try.
Well sorry, it works fine for me, using the same command:
docker run --platform=linux/amd64 -ti ubuntu:18.04 /bin/bash
apt-get update
apt-get install -y git build-essential curl
cd
git clone -b development-zos-v3-build-m1 https://github.com/threefoldtech/0-initramfs
cd 0-initramfs/
. ./autobuild/tf-build-deps.sh
. ./autobuild/tf-build-settings.sh
bash initramfs.sh
I made a new branch with a fix for the cpuinfo
issue, but there is no other changes.
Will try using Ubuntu 22.04
now but that's not supposedly supported.
Could not reproduce on Ubuntu 22.04
neither so far.
Ubuntu 22.04 is on bare metal x86_64 (desktop with intel processor). Will try your exact procedure on the mac m1 later, thank you for checking so fast, I will report back.
I guess build-essential was missing since it works fine now, don't have time to deep dive into what exactly the issue was. Thanks!
Following the readme:
. autobuild/tf-build-deps.sh
. autobuild/tf-build-settings.sh
bash -x initramfs.s
Gives the following output:
But the path is defined:
Tested on Ubuntu 22.04.1 LTS x86 & in a docker running Ubuntu 18.04 on an m1 mac (see my last comment in #67).