Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove no unneeded debug bits from script to build mac80211_hwsim kernel module #36

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions .docker/netremote-dev/build-mac80211_hwsim-kmod.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash
#
# Compiles the mac80211_hwsim driver as a module for the WSL2 kernel.
#
# Inspired by:
# - https://gist.github.com/charlie-x/96a92aaaa04346bdf1fb4c3621f3e392
# - https://github.com/microsoft/WSL2-Linux-Kernel#build-instructions
#

set -euxo pipefail

Expand Down Expand Up @@ -30,16 +37,6 @@ WSL_KERNEL_COMPILE_ARG_PARALLEL="-j $(expr $(nproc) - 1)"
# Mostly used for testing.
WGET_XTRA_ARGS=

# Print debug information if DEBUG is set to 1.
if [[ $DEBUG -eq 1 ]]; then
echo "DEBUG: KERNEL_VERSION=${KERNEL_VERSION}"
echo "DEBUG: KERNEL_FILE_NAME=${KERNEL_FILE_NAME}"
echo "DEBUG: KERNEL_URL_FILE=${KERNEL_URL_FILE}"
echo "DEBUG: WSL_SRC_DIRECTORY=${WSL_SRC_DIRECTORY}"
echo "DEBUG: WSL_SRC_CONFIG_FILE_NAME=${WSL_SRC_CONFIG_FILE_NAME}"
echo "DEBUG: WSL_SRC_CONFIG=${WSL_SRC_CONFIG}"
fi

# Install dependencies for building kernel modules.
# (see https://github.com/microsoft/WSL2-Linux-Kernel)
# added bc, python-is-python3
Expand All @@ -63,17 +60,11 @@ if [[ ! -f ${WSL_SRC_CONFIG} ]]; then
cat /proc/config.gz | gzip -d > ${WSL_SRC_CONFIG}
fi

# Create a link to where the kernel build expects the config file.
if [[ ! -f .config ]]; then
ln -s ${WSL_SRC_CONFIG} .config
fi

# Supply defaults for any new/unspecified options in the configuration.
make olddefconfig

# Prepare the source tree for building external modules.
echo "Preparing kernel source tree for building external modules..."
make prepare modules_prepare ${WSL_KERNEL_COMPILE_ARG_PARALLEL}

# Update the configuration to build the mac80211_hwsim module and its dependencies.
echo "Updating kernel configuration to build mac80211_hwsim module and its dependencies..."
${KERNEL_CONFIG_UTIL} \
Expand All @@ -82,6 +73,12 @@ ${KERNEL_CONFIG_UTIL} \
--module CONFIG_MAC80211 \
--module CONFIG_MAC80211_HWSIM

# Supply defaults for any new/unspecified options in the configuration.
make olddefconfig

echo "Preparing kernel source tree for building external modules..."
make prepare modules_prepare ${WSL_KERNEL_COMPILE_ARG_PARALLEL}

echo "Building kernel modules..."
make modules ${WSL_KERNEL_COMPILE_ARG_PARALLEL}

Expand Down