Coral from Google - Camera Drivers - How to recompile kernel

From RidgeRun Developer Connection
< Coral from Google‎ | Camera Drivers
Revision as of 13:28, 4 May 2023 by Mherrera (talk | contribs) (Fix debootstrap deprecated url)
Jump to: navigation, search



Previous: Camera_Drivers/How_to_flash_Google_Coral Index Next: Camera_Drivers/Adding_a_new_camera_driver





Now you can install the kernel, first create a directory to download the python script used to download the source code

mkdir -p <PATH_SCRIPT>
export PATH=$PATH:PATH_SCRIPT
curl https://storage.googleapis.com/git-repo-downloads/repo > PATH_SCRIPT/repo
chmod a+x PATH_SCRIPT/repo

Now go to where the script was downloaded and run the repo script to initialize the code

cd PATH_SCRIPT
repo init -u https://coral.googlesource.com/manifest
repo sync -j$(nproc)

Install the dependencies to build the kernel

sudo apt-get install qemu-user-static
sudo apt-get install docker.io
sudo adduser $USER docker
sudo apt-get install android-tools-adb android-tools-fastboot
sudo apt-get install build-essential qemu-user-static bc

Now use the source and build the kernel

source build/setup.sh
m docker-linux-imx

If the following error comes up:

wget -O debbootstrap.deb http://ftp.us.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.89_all.deb
--2023-05-04 17:47:41--  http://ftp.us.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.89_all.deb
Resolving ftp.us.debian.org (ftp.us.debian.org)... 64.50.236.52, 64.50.233.100, 208.80.154.139, ...
Connecting to ftp.us.debian.org (ftp.us.debian.org)|64.50.236.52|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2023-05-04 17:47:42 ERROR 404: Not Found.

Replace the debootsrap URL with a working mirror in the build/prereqs.mk file, for example:

sed -i 's,http://ftp.us.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.89_all.deb,http://mirror.nus.edu.sg/Debian/pool/main/d/debootstrap/debootstrap_1.0.89_all.deb,g' build/prereqs.mk

After that, rebuild the kernel:

m docker-linux-imx

You are going to see in the output of the process the following lines, these are the packages that you can install on the board.

dpkg-deb: building package 'linux-headers-4.14.98-imx' in '../linux-headers-4.14.98-imx_12-4_arm64.deb'.
dpkg-deb: building package 'linux-kbuild-4.14.98-imx-dbgsym' in '../linux-kbuild-4.14.98-imx-dbgsym_12-4_arm64.deb'.
dpkg-deb: building package 'linux-kbuild-4.14.98-imx' in '../linux-kbuild-4.14.98-imx_12-4_arm64.deb'.
dpkg-deb: building package 'linux-image-4.14.98-imx' in '../linux-image-4.14.98-imx_12-4_arm64.deb'.

To install the new kernel you can run the following commands

j product
cd packages/bsp/
mdt install linux-image-4.14.98-imx_12-4_arm64.deb && \
mdt install linux-kbuild-4.14.98-imx_12-4_arm64.deb && \
mdt install linux-headers-4.14.98-imx_12-4_arm64.deb 

Now your driver should be installed in the system


Previous: Camera_Drivers/How_to_flash_Google_Coral Index Next: Camera_Drivers/Adding_a_new_camera_driver