From a03aa5ee7137dee0663b1813e1974d1a81f81f0c Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Wed, 1 Jun 2022 00:53:52 +1200 Subject: [PATCH] Add module for the xradio - WIP. Issue #7 --- Dockerfile | 18 ++++++++++++++++++ kernel/update_kernel_config.sh | 15 ++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index fe92d1b..a7c65c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,6 +73,9 @@ WORKDIR /build RUN make ARCH=riscv -C linux O=../linux-build nezha_defconfig RUN make -j `nproc` -C linux-build ARCH=riscv $CROSS V=0 # Files reside in /build/linux-build/arch/riscv/boot/Image.gz +RUN apt-get install -y kmod +RUN make -j `nproc` -C linux-build ARCH=riscv $CROSS INSTALL_MOD_PATH=/build/modules modules_install + # @@ -85,6 +88,15 @@ RUN make -j `nproc` ARCH=riscv $CROSS KSRC=../linux-build modules RUN ls -l # Module resides in /build/rtl8723ds/8723ds.ko +WORKDIR /build +COPY kernel/xradio/ ./xradio/ +WORKDIR /build/xradio +RUN make ARCH=riscv $CROSS -C /build/linux-build M=$PWD KBUILD_MODPOST_WARN=Y modules +RUN ls -l +# Module resides in /build/xr829/xr829.ko + + + ############################################################################################ # @@ -159,21 +171,27 @@ WORKDIR /build COPY --from=build_kernel /build/linux-build/ ./linux-build/ COPY --from=build_kernel /build/linux/ ./linux/ COPY --from=build_kernel /build/rtl8723ds/8723ds.ko . +COPY --from=build_kernel /build/xradio/xradio_wlan.ko . WORKDIR /build/linux-build RUN make ARCH=riscv INSTALL_MOD_PATH=/port/rv64-port modules_install + RUN ls /port/rv64-port/lib/modules/ > /kernel_ver RUN echo "export MODDIR=$(ls /port/rv64-port/lib/modules/)" > /moddef RUN ls /port/rv64-port/lib/modules/ RUN . /moddef; echo "Creating wireless module in ${MODDIR}" RUN . /moddef; install -v -D -p -m 644 /build/8723ds.ko /port/rv64-port/lib/modules/${MODDIR}/kernel/drivers/net/wireless/8723ds.ko +RUN . /moddef; install -v -D -p -m 644 /build/xradio_wlan.ko /port/rv64-port/lib/modules/${MODDIR}/kernel/drivers/net/wireless/xradio_wlan.ko + + RUN . /moddef; rm /port/rv64-port/lib/modules/${MODDIR}/build RUN . /moddef; rm /port/rv64-port/lib/modules/${MODDIR}/source RUN . /moddef; depmod -a -b /port/rv64-port "${MODDIR}" RUN echo '8723ds' >> /port/rv64-port/etc/modules +RUN echo 'xradio_wlan' >> /port/rv64-port/etc/modules # This may not be needed as it should be done by the networking setup. # RUN cp /etc/resolv.conf /port/rv64-port/etc/resolv.conf diff --git a/kernel/update_kernel_config.sh b/kernel/update_kernel_config.sh index 1dc72f6..3b78481 100755 --- a/kernel/update_kernel_config.sh +++ b/kernel/update_kernel_config.sh @@ -13,7 +13,7 @@ function add_config() { add_config 'CONFIG_DEFAULT_HOSTNAME' '"lichee"' # enable WiFi add_config 'CONFIG_WIRELESS' 'y' -add_config 'CONFIG_CFG80211' 'm' +add_config 'CONFIG_CFG80211' 'y' # enable /proc/config.gz add_config 'CONFIG_IKCONFIG_PROC' 'y' # There is no LAN. so let there be USB-LAN @@ -91,10 +91,15 @@ add_config 'CONFIG_VIDEO_SUNXI_CEDRUS' 'y' # 1.14" 135×240 SPI LCD screen. # Sitronix ST7789V controller # -add_config 'CONFIG_GPIOLIB' 'y' -add_config 'CONFIG_FB' 'y' -add_config 'CONFIG_FB_TFT' 'y' -add_config 'CONFIG_FB_TFT_ST7789V' 'y' +add_config 'DRM_PANEL_MIPI_DBI' 'y' +add_config 'MAC80211' 'y' +add_config 'CRYPTO' 'y' +add_config 'CRYPTO_LIB_ARC4' 'y' +add_config 'CRYPTO_AES' 'y' +add_config 'CRYPTO_CCM' 'y' +add_config 'CRYPTO_GCM' 'y' +add_config 'CRYPTO_CMAC' 'y' +add_config 'CRC32' 'y' echo "Config File Follows #####################" cat ${CONF_FILE}