forked from Antho91/Circuit-Sword
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
50 lines (36 loc) · 1.2 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM debian:buster AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean && apt-get update && \
apt-get install -y \
git bc bison flex libssl-dev python3 make kmod libc6-dev libncurses5-dev \
crossbuild-essential-armhf \
crossbuild-essential-arm64 \
vim wget kpartx rsync sudo util-linux cloud-guest-utils
RUN mkdir /build
RUN mkdir -p /mnt/fat32
RUN mkdir -p /mnt/ext4
WORKDIR /build
CMD ["bash"]
# Cross compile kernel
FROM base AS build-kernel
ARG BRANCH
VOLUME /build/images
WORKDIR /usr/src
COPY sound-module/snd-usb-audio-0.1/patches/fix-volume.patch .
RUN --mount=type=cache,target=/usr/src/linux/ \
rm -rf linux/* linux/.[!.]*; \
git clone --depth=1 https://github.com/raspberrypi/linux --branch ${BRANCH}
RUN --mount=type=cache,target=/usr/src/linux/ \
patch -p1 -d linux/sound/usb < fix-volume.patch
COPY cross-build/build-kernel.sh .
COPY cross-build/compile-kernel.sh .
COPY cross-build/install-kernel.sh .
RUN --mount=type=cache,target=/usr/src/linux/ \
./compile-kernel.sh -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
CMD ["bash"]
# Extend image for CSO CM3
FROM base AS build-image
VOLUME /build/images
COPY build/build-image.sh .
COPY install.sh /
CMD ["bash"]