1#!/bin/bash 2 3# Author: Xianjun Jiao 4# SPDX-FileCopyrightText: 2023 UGent 5# SPDX-License-Identifier: AGPL-3.0-or-later 6 7set -ex 8 9cd /root/ 10 11MACHINE_TYPE=`uname -m` 12 13rm -rf kernel_modules 14mkdir -p kernel_modules 15 16# mkdir -p /lib/modules/$(uname -r) 17# rm -rf /lib/modules/$(uname -r) 18if [ ${MACHINE_TYPE} == 'aarch64' ]; then 19 cp /root/kernel_modules64/* /root/kernel_modules/ 20 cp /root/openwifi64/* /root/openwifi/ 21 # cp ./kernel_modules64/* /lib/modules/$(uname -r)/ 22else 23 cp /root/kernel_modules32/* /root/kernel_modules/ 24 cp /root/openwifi32/* /root/openwifi/ 25 # cp ./kernel_modules32/* /lib/modules/$(uname -r)/ 26fi 27 28mv /root/kernel_modules/ad9361_drv.ko /root/openwifi/ -f || true 29mv /root/kernel_modules/adi_axi_hdmi.ko /root/openwifi/ -f || true 30mv /root/kernel_modules/axidmatest.ko /root/openwifi/ -f || true 31mv /root/kernel_modules/lcd.ko /root/openwifi/ -f || true 32mv /root/kernel_modules/xilinx_dma.ko /root/openwifi/ -f || true 33 34rm -rf /lib/modules/$(uname -r) 35ln -s /root/kernel_modules /lib/modules/$(uname -r) 36sync 37depmod 38 39cd /root/openwifi/sdrctl_src 40make clean 41make 42cp sdrctl /root/openwifi/ 43cd /root/openwifi/side_ch_ctl_src/ 44gcc -o side_ch_ctl side_ch_ctl.c 45cp side_ch_ctl /root/openwifi/ 46cd /root/openwifi/inject_80211/ 47make clean 48make 49cd .. 50sync 51 52# reboot now 53