radxa / debos-radxa

This repo is deprecated, please use https://github.com/radxa-repo/rbuild instead
https://github.com/radxa-repo/rbuild
131 stars 46 forks source link

Compilation own image #23

Open BartoszSoft opened 2 years ago

BartoszSoft commented 2 years ago

I tried to compile image like you describe in tutorial. I'm using Ubuntu 18 running at VirtualBox. After build command I can see the image but the size is less than 1MB so for sure is not correct :) Where is a problem?

I can see such error, maybe is a connection with it

Checking that ptrace can change system call numbers...OK Checking syscall emulation patch for ptrace...OK Checking advanced syscall emulation patch for ptrace...OK Checking environment variables for a tempdir...none found Checking if /dev/shm is on tmpfs...OK Checking PROT_EXEC mmap in /dev/shm...Operation not permitted /dev/shm must be not mounted noexec error starting uml backend: <nil> ====debos rockpi-4cplus-ubuntu-focal-server-arm64-gpt end==== TOP DIR = /home/user/debos-radxa System image rockpi-4cplus-ubuntu-focal-server-arm64-20220627-1144-gpt.img is generated. See it in /home/user/debos-radxa/output /home/user/debos-radxa ====Building board system image is done==== ====Start to clean system images====

RadxaStephen commented 2 years ago

Would you please show me your build commands?

RadxaStephen commented 2 years ago

I didn't run that at VirtualBox.

BartoszSoft commented 2 years ago

This is command from your instruction ./build.sh -c rk3566 -b radxa-cm3-io -m ubuntu -d focal -v server -a arm64 -f gpt or ./build.sh -c rk3566 -b radxa-cm3-io -m debian -d buster -v xfce4 -a arm64 -f gpt

BartoszSoft commented 2 years ago

Have you tried to compile system on existing cm3-io?

RadxaStephen commented 2 years ago

This is command from your instruction ./build.sh -c rk3566 -b radxa-cm3-io -m ubuntu -d focal -v server -a arm64 -f gpt or ./build.sh -c rk3566 -b radxa-cm3-io -m debian -d buster -v xfce4 -a arm64 -f gpt

Would you please add change file docker/dev-shell like this and build again?

diff --git a/docker/dev-shell b/docker/dev-shell
index 53555a4..2b69c87 100755
--- a/docker/dev-shell
+++ b/docker/dev-shell
@@ -15,7 +15,7 @@ case $(uname -s) in
     exec docker run \
       --rm \
       --interactive --tty \
-      --device /dev/kvm \
+      --tmpfs /dev/shm:rw,nosuid,nodev,exec,size=4g \
       --security-opt label=disable \
       --env HOME \
       --privileged \
BartoszSoft commented 2 years ago

Ok, compilation was ended but now it has 338MB, your compilation have more than 600MB, do you know why? In other hand, it looks that this is not compilation of the system but only prepare application, how can I modified the kernel code and compile?

RadxaStephen commented 2 years ago

From here, https://github.com/radxa/debos-radxa/releases, you can see that ubuntu and debian have different size.

To modify kernel source code and generate kernel package, please refer to this guide, https://wiki.radxa.com/Rock3/dev/Debian.

We only need two packages. Like

linux-headers-4.19.193-99-rockchip-g6bcb15a5b2d0_4.19.193-99-rockchip_arm64.deb
linux-image-4.19.193-99-rockchip-g6bcb15a5b2d0_4.19.193-99-rockchip_arm64.deb

Please ignore package 'linux-image--dbg.deb'

Put these two packages to debos-radxa repository. Location is rootfs/packages/arm64/kernel.

And start to build.

BartoszSoft commented 2 years ago

Ok, thanks, i will check and let you know ;) I see that CM4 IO have a button on the top to have possibility to flash. Do you know how can I flash device if iI don't have possibility to access tot his button?

RadxaStephen commented 2 years ago

I don't see any button on CM4 IO. Please show me what it looks like?

BartoszSoft commented 2 years ago

On CPU of course, not on the board.

BartoszSoft commented 2 years ago

Is it any way to connect device to pc and mount like a mass storage?

BartoszSoft commented 2 years ago

It looks that system don't have possibility to run application in 32 bits (can't run application from 32 bits on your system). I see that we don't have /lib/ld-linux-armhf.so.3, how can I add this? I

RadxaStephen commented 2 years ago

Try this:

$ sudo dpkg --add-architecture armhf $ sudo apt update $ sudo apt install bc:armhf

And you would see /lib/ld-linux-armhf.so.3

RadxaStephen commented 2 years ago

Another method is to build one 32bit system image.

Quick way. For example Radxa CM3 Ubuntu focal armhf image.

Change file, configs/boards/rk3566/config-radxa-cm3-io-ubuntu-focal-server-arm64-gpt.sh

Set ARCH=armhf

export ARCH=armhf

And run command.

./docker/dev-shell

# in docker container
./build.sh -c rk3566 -b radxa-cm3-io -m ubuntu -d focal -v server -a arm64 -f gpt
Web4ProGit commented 2 years ago

First answer fix my issue but do you know this error "uses deprecated CP15 Barrier instruction at 0x33ec0" ? It looks that this is another issue with 64bit or maybe this CPU, same application is working perfect on Compute module 4 from raspberry Pi.

Web4ProGit commented 2 years ago

Another issue, do you know why i received "ipc: Error: Send IPC message failed." when i run application which is normally working on raspberry cm4?