Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
Update build-kernel.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
okrc authored Jul 8, 2024
1 parent 55ef1f1 commit 8aac9ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
FROM debian:stable-slim
ARG LLVM_VERSION=18
ARG LLVM_VERSION=14
ENV LLVM_VERSION=${LLVM_VERSION}
ARG TZ=Etc/GMT-8
ENV TZ=${TZ}
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
curl ca-certificates gpg xz-utils make flex bison libssl-dev libelf-dev bc python3-minimal dwarves tzdata cpio; \
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | \
gpg --dearmor -o /usr/share/keyrings/llvm-apt-archive-keyring.gpg; \
. /etc/os-release; \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/llvm-apt-archive-keyring.gpg] \
https://apt.llvm.org/$VERSION_CODENAME llvm-toolchain-$VERSION_CODENAME-$LLVM_VERSION main" | \
tee /etc/apt/sources.list.d/llvm-apt.list >/dev/null; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
clang-$LLVM_VERSION lld-$LLVM_VERSION llvm-$LLVM_VERSION; \
curl ca-certificates gpg xz-utils make flex bison libssl-dev libelf-dev bc python3-minimal dwarves tzdata cpio clang-${LLVM_VERSION} lld-${LLVM_VERSION} llvm-${LLVM_VERSION}; \
# curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | \
# gpg --dearmor -o /usr/share/keyrings/llvm-apt-archive-keyring.gpg; \
# . /etc/os-release; \
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/llvm-apt-archive-keyring.gpg] \
# https://apt.llvm.org/$VERSION_CODENAME llvm-toolchain-$VERSION_CODENAME-$LLVM_VERSION main" | \
# tee /etc/apt/sources.list.d/llvm-apt.list >/dev/null; \
# apt-get update; \
# DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
# clang-$LLVM_VERSION lld-$LLVM_VERSION llvm-$LLVM_VERSION; \
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-$LLVM_VERSION 100; \
rm -rf /var/lib/apt/lists/*
4 changes: 2 additions & 2 deletions build-kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fi

TMPDIR=$(mktemp -d)
tar xf kernel.tar.xz --strip-components=1 -C $TMPDIR
curl --silent --remote-name-all https://raw.githubusercontent.com/microsoft/WSL2-Linux-Kernel/linux-msft-wsl-5.15.y/arch/{x86/configs/config-wsl,arm64/configs/config-wsl-arm64}
curl --silent --remote-name-all https://raw.githubusercontent.com/microsoft/WSL2-Linux-Kernel/linux-msft-wsl-6.1.y/arch/{x86/configs/config-wsl,arm64/configs/config-wsl-arm64}

build_config() {
if [ -f "$1" ]; then
Expand All @@ -33,7 +33,7 @@ build_amd64_kernel() {
sh <(curl -fsSL https://sh.rustup.rs) --quiet -y --default-toolchain $(scripts/min-tool-version.sh rustc) --profile minimal --component rust-src
. "$HOME/.cargo/env"
cargo install --locked --version $(scripts/min-tool-version.sh bindgen) bindgen-cli
make LLVM=-${LLVM_VERSION} rustavailable
make -j$(nproc) ARCH=x86_64 LLVM=-${LLVM_VERSION} rustavailable
fi

make -j$(nproc) ARCH=x86_64 LLVM=-${LLVM_VERSION}
Expand Down

0 comments on commit 8aac9ef

Please sign in to comment.