8000 GitHub - fred-corp/debian-xcenv: A Debian Cross-Compile Docker container
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fred-corp/debian-xcenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debian XCEnv

A Debian-based Cross-Compile Environment running in Docker.

Workflows :

GitHub Workflow Status

Summary

Create a container

Using Docker CLI

docker run -d --name debian-xcenv --hostname debian-xcenv -v ./exercises:/root/exercises --network=host --tty=true ghcr.io/fred-corp/debian-xcenv

Using Docker-Compose

YAML Example :

services:
    debian-xcenv:
        image: ghcr.io/fred-corp/debian-xcenv:latest
        container_name: debian-xcenv
        hostname: debian-xcenv
        restart: unless-stopped
        privileged: true
        tty: true
        stdin_open: true
     
8000
   network_mode: host
        ipc: host
        pid: host
        volumes:
            - "./exercices:/root/exercises"

Then, create the container with docker-compose :

docker-compose up -d

Note : You can also specify the architecture of the container by adding :arm64 or :amd64 to the image name.
Note : This commands will mount the exercices folder in the current directory to /root/exercises in the container. You can change this path to your needs.

Open a shell in the container

You can open a shell in the container using the following command :

docker exec -it -e "TERM=xterm-256color" debian-xcenv /bin/zsh

Install linux tools

Depending on your target, you'll need different linux tools.

Raspberry Pi

If you're building for Raspberry Pi, you'll need to install the following tools and files :

From the amazing guide from Jeff Geerling

git clone --depth=1 https://github.com/raspberrypi/linux ./rpi-linux
cd rpi-linux
KERNEL=kernel8

Create the .config file for the kernel:

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig

Then, you can build the kernel:

make -j$(nproc --all) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs

Beaglebone Black

If you're building for Beaglebone Black, you'll need to install the following tools and files :

From the amazing guide from Quentin Delhaye

If your host is an arm64/aarch64 machine

wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-linux-gnueabihf.tar.xz
mkdir -p /opt/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-linux-gnueabihf
chown $LOGNAME:$LOGNAME /opt/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-linux-gnueabihf
tar -xf arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-linux-gnueabihf.tar.xz -C /opt/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-linux-gnueabihf
echo "PATH=/opt/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-linux-gnueabihf/arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-linux-gnueabihf/bin/:$PATH" >> ~/.zshrc
source ~/.zshrc

If your host is an x86_64/amd64 machine

wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz
mkdir -p /opt/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf
chown $LOGNAME:$LOGNAME /opt/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf
tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz -C /opt/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf
echo "PATH=/opt/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-linux-gnueabihf/bin/:$PATH" >> ~/.zshrc
source ~/.zshrc

Verify the installation

arm-none-linux-gnueabihf-gcc -v

Note : You can then follow the rest of Quentin Delhaye's guide to build the kernel; steps should look like this :

Clone the kernel source code (4.19 branch only) :

git clone -b 4.19 --depth=1 https://github.com/beagleboard/linux.git ./bbb-linux
cd bbb-linux

Add a .config file for the kernel (you can do so by following this step), then compile :

make -j$(nproc --all) CROSS_COMPILE=arm-none-linux-gnueabihf- ARCH=arm

Building the image from scratch

If you want to build the image from scratch, you can do so by running the following command in the root of the repository:

docker-compose build

Then, you can run the image using the following command:

docker-compose up -d

License & Acknowledgements

Made with ❤️, lots of ☕️, and lack of 🛌

License: GPL v3
GNU GPLv3

About

A Debian Cross-Compile Docker container

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

 
 
 
0