canonical / pi-gadget

Universal pi (pi2,pi3,pi4,cm3,cm4 and future) gadget snap for Ubuntu Core and classic systems.
36 stars 62 forks source link

Not able to build pi-gadget classic #89

Open Rahul-Ravichandran opened 2 years ago

Rahul-Ravichandran commented 2 years ago

Hi, I tried build pi-gadget classic on amd64 Ubuntu 20.04 , it never builds and always hangs. sudo SERIES=focal ARCH=arm64 make

So, i tried it on arm64 and it worked. It created a stage folder. how am i supposed to used this to create classic gadget?

I also tried running snapcraft --use-lxd on both architectures. But it always fails giving:

Building gadget ++ arch ++ arch

Rahul-Ravichandran commented 2 years ago

when i run a clean run snapcraft --use-lxd. It always fail saying:

apt-cache -o APT::Architecture=arm64 -o Dir::Etc::sourcelist=""/root/project/stage"/apt/restricted.sources.list" -o Dir::State::status="/root/project/stage"/tmp/status showpkg linux-firmware-raspi | sed -n -e 's/^Package: *//p' | sort -V | tail -1 ); ) E: Handler silently failed make: *** [Makefile:95: firmware] Error 100 make: Leaving directory '/root/project'

Meulengracht commented 2 years ago

Someone might correct me here, but I'm pretty sure the pi-gadget can only be built on arm architecture. If you want to build it on your amd64 you need to use snapcraft remote-build to build for arm when your host in amd64.

I can see from the build instructions this is very unclear, and maybe even incorrect. Could you try to see if it helps?

Rahul-Ravichandran commented 2 years ago

Hi @Meulengracht ,

I did run it on arm64 system . It always return this error:

apt-cache -o APT::Architecture=arm64 -o Dir::Etc::sourcelist=""/root/project/stage"/apt/restricted.sources.list" -o Dir::State::status="/root/project/stage"/tmp/status showpkg linux-firmware-raspi | sed -n -e 's/^Package: *//p' | sort -V | tail -1 ); ) E: Handler silently failed make: *** [Makefile:95: firmware] Error 100 make: Leaving directory '/root/project'

Meulengracht commented 2 years ago

Could you clarify exactly how you produced that error? In your original message you mentioned you tried to build on arm64 and that it worked, but now it is not working?

And did you get that same error with snapcraft remote-build?

Rahul-Ravichandran commented 2 years ago

Sorry, if i was unclear on the first message. I tried "sudo SERIES=focal make" on arm64 and that worked.

But when i run snapcraft --use-lxd that never worked

How do i specify the ARCH and SERIES when using remote-build on amd64, because when i changed it in make file, it did not reflect in the build process.

When i run snapcraft remote-build , it mentions that its building for amd64 instead of arm64

Also, even the remote build failed with error:

Snap file not available for arch 'amd64'. Build log available at 'pi_amd64.1.txt' Build failed for arch 'amd64'.

Meulengracht commented 2 years ago

try this command for remote-build snapcraft remote-build --build-on=arm64, the documentation for this command is here https://snapcraft.io/docs/remote-build

That could be an issue with lxd, I'll try to see if I can reeproduce this and look into it.