Skip to content

chzigotzky/kernels

Repository files navigation

amilinux1

Linux kernels for X1000 and e5500 (X5000/20, X5000/40, Mirari, and QEMU VMs) PowerPC computers.

Older Linux kernels and further downloads for X1000 and X5000 computers:

http://www.supertuxkart-amiga.de/amiga/x1000.html#downloads

Linux kernels for the A1222:

http://www.fun-kart-racer.de/2bb57b2bbf87b668a94c/lxtest.html

User Name: tabor

Password: amigaone

Clone this git repository with branches:

  1. git clone git@github.com:chzigotzky/kernels.git
  2. cd kernels
  3. git branch --track 5_10 origin/5_10
  4. git branch --track 6_12 origin/6_12

Using the Dockerfile for building the Linux PPC cross compiling image:

Local (You must be in the directory containing the Dockerfile) docker build -t ubuntu_kernel_dev .

From git: docker build -t ubuntu_kernel_dev https://github.com/chzigotzky/kernels.git#main

From git with buildx: docker buildx build -t ubuntu_kernel_dev https://github.com/chzigotzky/kernels.git#main

Using the Dockerfile_kernel_test for the Linux PPC kernel test image:

Local (You must be in the directory containing the Dockerfile) docker build -t ubuntu_kernel_test -f Dockerfile_kernel_test .

From git: docker build -t ubuntu_kernel_test -f Dockerfile_kernel_test https://github.com/chzigotzky/kernels.git#main

From git with buildx: docker buildx build -t ubuntu_kernel_test -f Dockerfile_kernel_test https://github.com/chzigotzky/kernels.git#main

Network between ubuntu_kernel_dev and ubuntu_kernel_test:

  1. docker network create my-network
  2. docker run -d -p 9090:8080 --name ubuntu_kernel_dev-container --network my-network -v /kernel_dev:/kernel_dev ubuntu_kernel_dev
  3. docker run -d -p 9080:3389 -p 9091:8080 --name ubuntu_kernel_test-container --network my-network -v /kernel_dev:/kernel_dev ubuntu_kernel_test

With Docker compose:

  1. docker compose up -d --build (In the directory where the compose.yaml file is located. --build deletes also the cache)
  2. docker compose push (Push the images to the local registry)
  3. curl http://localhost:5000/v2/_catalog (Display the images in the local registry)

Delete the complete local registry volume:

  1. docker ps -a
  2. docker stop f352821ed760
  3. docker inspect f352821ed760 | grep -A5 Mounts
  4. docker volume ls
  5. docker rm f352821ed760
  6. docker volume rm 0a3510ae1c236f3fc856f403b3a411446a7ad4a880da879b25fc3f3b68c2e1b0

Minikube (Kubernetes):

  1. minikube start
  2. minikube image load ubuntu_kernel_dev:latest
  3. minikube image ls
  4. minikube mount /kernel_dev:/kernel_dev &
  5. Deployment: kubectl apply -f Kubernetes.yaml
  6. Check default namespace: kubectl get pods && kubectl get deployments && kubectl get services
  7. Check all namespaces: kubectl get pods -A && kubectl get deployments -A && kubectl get services -A
  8. Check LoadBalancer: kubectl get services
  9. kubectl port-forward 9090:8080 & or kubectl proxy --address='0.0.0.0' --accept-hosts='^.*$' and http://:8001/api/v1/namespaces/default/services/kernel-dev-service:9090/proxy/
  10. Connect to a pod: kubectl exec -it -- bash
  11. Delete deployment: kubectl delete deployment kernel-dev
  12. Delete pod: kubectl delete pod
  13. Delete service: kubectl delete service kernel-dev-service
  14. minikube image ls
  15. minikube image remove image:tag
  16. minikube dashboard

Dockerfile for building the Linux PPC cross compiling image:

# Base image: Ubuntu 20.04
FROM ubuntu:20.04

# Deactivate interactive inputs
ENV DEBIAN_FRONTEND=noninteractive

# Upgrading the userland and installing the kernel cross compiling environment 
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
bash \
vim \
git \
curl \
gcc-9-powerpc-linux-gnu \
g++-9-powerpc-linux-gnu \
build-essential \
libncurses5-dev \
u-boot-tools \
flex \
bison \
libssl-dev \
bc \
linux-firmware \
kmod \
libelf-dev \
neofetch \
wget \
tree \
ncat \
sysstat \
&& update-alternatives --install /usr/bin/powerpc-linux-gnu-gcc powerpc-linux-gnu-gcc /usr/bin/powerpc-linux-gnu-gcc-9 10 \
&& update-alternatives --install /usr/bin/powerpc-linux-gnu-g++ powerpc-linux-gnu-g++ /usr/bin/powerpc-linux-gnu-g++-9 10 \
&& useradd -m -d /home/amigaone -p $(openssl passwd -1 --salt xyz amigaone) amigaone \
&& echo "patch -p0 <" >> /home/amigaone/.bash_history \
&& echo "nproc" >> /home/amigaone/.bash_history \
&& echo "make CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc oldconfig" >> /home/amigaone/.bash_history \
&& echo "time make -j$(nproc) CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc vmlinux" >> /home/amigaone/.bash_history \
&& echo "make CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc zImage" >> /home/amigaone/.bash_history \
&& echo "gzip -9 vmlinux.strip" >> /home/amigaone/.bash_history \
&& echo "time make -j$(nproc) CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc modules" >> /home/amigaone/.bash_history \
&& echo "# make CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc modules_install" >> /home/amigaone/.bash_history \
&& echo "time make -j$(nproc) CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc uImage" >> /home/amigaone/.bash_history \
&& echo "time make -j$(nproc) CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc modules" >> /home/amigaone/.bash_history \
&& echo "# make CROSS_COMPILE=powerpc-linux-gnu- ARCH=powerpc modules_install" >> /home/amigaone/.bash_history

# A good directory for the volume mount point in the container
WORKDIR /kernel_dev

# Creating a volume (This has nothing to do with the mount (-v) in docker run.)
# VOLUME ["/kernel_dev"]

COPY firmwares/renesas_usb_fw.mem /lib/firmware/

# Preparing kernel compilation
RUN export KERNEL_SRC_LINK="https://git.kernel.org/torvalds/t/linux-6.19-rc8.tar.gz" \
&& export KERNEL_SRC_FILE="/root/kernel_src.tar.xz" \
&& export KERNEL_SRC_DEST="/root/" \
&& wget -O ${KERNEL_SRC_FILE} ${KERNEL_SRC_LINK} \
&& tar xvf ${KERNEL_SRC_FILE} -C ${KERNEL_SRC_DEST}

CMD ["sh", "-c", "while true; do BODY=\"The Docker container for the cross compiling of A-EON PowerPC Linux kernels works!\n\n$(uname -a)\n\n$(free -m)\n\n$(lscpu | grep Model)\n\n$(LC_ALL=C mpstat -P ALL 1 1 | awk '$0 !~ /Average/ && $0 ~ /[0-9]+/ && $NF ~ /^[0-9.]+$/ { cpu=$(NF-10); if (cpu ~ /^[0-9]+$/) printf \"CPU%s: %.1f%%\\n\", cpu, 100-$NF }')\"; { printf \"HTTP/1.1 200 OK\\r\\nContent-Type: text/plain\\r\\nContent-Length: %s\\r\\nConnection: close\\r\\n\\r\\n%s\" \"${#BODY}\" \"$BODY\"; } | nc -l -p 8080; done"]
 
# sudo usermod -aG docker $USER
# Local (You must be in the directory containing the Dockerfile) docker build -t ubuntu_kernel_dev .
# From git: docker build -t ubuntu_kernel_dev https://github.com/chzigotzky/kernels.git#main
# From git with buildx: docker buildx build -t ubuntu_kernel_dev https://github.com/chzigotzky/kernels.git#main
# Create a container and start it (Container status: <HOSTNAME/FQDN/IP ADDRESS>:9090): docker run -d -p 9090:8080 --name ubuntu_kernel_dev-container -v /kernel_dev:/kernel_dev ubuntu_kernel_dev
# Volume mount explanation: -v /path/on/host:/path/in/container
# List all Docker containers: docker ps -a
# Connect to a container: docker exec -it ubuntu_kernel_dev-container bash
# Stop a docker container: docker stop <CONTAINER ID> (Changes remain in the image) 
# Start a docker container: docker start <CONTAINER ID>  
# Delete all Docker containers: docker rm $(docker ps -aq)
# Delete all Docker images: docker rmi $(docker images -q)
#

Building the images with Docker compose:

Docker_compose_with_local_registry

Monitoring the Docker container while compiling the kernel:

Dockerfile_for_a_Linux_PPC_cross_compiling_image

Monitoring the Docker containers while compiling and testing the kernel (Docker Swarm):

Kernel_6 12 67_PowerPC

Monitoring the Kubernetes pod while compiling the kernel:

Kernel_6 12 64_PowerPC

Monitoring the Docker containers in Portainer while compiling the kernel for e5500 machines (1600% = 16 CPU cores fully utilized):

Kernel_6 12 65_PowerPC-2

Testing the Linux PPC kernel in a Docker container:

Linux_PPC_kernel_test_docker_image

About

Linux kernels for X1000 and e5500 (X5000/20, X5000/40, Mirari, and QEMU VMs) PowerPC computers

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published