Scripts are adapted for SW HW decouple

To avoid openwifi-hw github submodule in openwifi. More flexible now.
This commit is contained in:
Jiao Xianjun 2021-10-20 22:50:30 +02:00 committed by GitHub
parent b1d5889fb5
commit abdb610f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 128 additions and 109 deletions

3
.gitmodules vendored
View File

@ -4,6 +4,3 @@
[submodule "adi-linux-64"] [submodule "adi-linux-64"]
path = adi-linux-64 path = adi-linux-64
url = https://github.com/analogdevicesinc/linux.git url = https://github.com/analogdevicesinc/linux.git
[submodule "openwifi-hw"]
path = openwifi-hw
url = https://github.com/open-sdr/openwifi-hw.git

View File

@ -126,20 +126,19 @@ Since the pre-built SD card image might not have the latest bug-fixes/updates, i
- Setup environment variables (use absolute path): - Setup environment variables (use absolute path):
``` ```
export XILINX_DIR=your_Xilinx_directory export XILINX_DIR=your_Xilinx_directory
export OPENWIFI_DIR=your_openwifi_directory export OPENWIFI_HW_DIR=your_openwifi-hw_directory
export BOARD_NAME=your_board_name export BOARD_NAME=your_board_name
``` ```
- Get the latest FPGA bitstream from openwifi-hw, generate BOOT.BIN and transfer it on board via ssh channel: - Pick the FPGA bitstream from openwifi-hw, and generate BOOT.BIN and transfer it on board via ssh channel:
``` ```
$OPENWIFI_DIR/user_space/get_fpga.sh $OPENWIFI_DIR
For Zynq 7000: For Zynq 7000:
$OPENWIFI_DIR/user_space/boot_bin_gen.sh $OPENWIFI_DIR $XILINX_DIR $BOARD_NAME
cd openwifi/user_space; ./boot_bin_gen.sh $OPENWIFI_HW_DIR $XILINX_DIR $BOARD_NAME
For Zynq MPSoC (like zcu102 board): For Zynq MPSoC (like zcu102 board):
$OPENWIFI_DIR/user_space/boot_bin_gen_zynqmp.sh $OPENWIFI_DIR $XILINX_DIR $BOARD_NAME cd openwifi/user_space; ./boot_bin_gen_zynqmp.sh $OPENWIFI_HW_DIR $XILINX_DIR $BOARD_NAME
scp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME/output_boot_bin/BOOT.BIN root@192.168.10.122: cd openwifi/kernel_boot/boards/$BOARD_NAME/output_boot_bin; scp ./BOOT.BIN root@192.168.10.122:
``` ```
- On board: Put the BOOT.BIN into the BOOT partition. - On board: Put the BOOT.BIN into the BOOT partition.
``` ```
@ -154,18 +153,18 @@ Since the pre-built SD card image might not have the latest bug-fixes/updates, i
Since the pre-built SD card image might not have the latest bug-fixes/updates, it is recommended to update the driver on board. Since the pre-built SD card image might not have the latest bug-fixes/updates, it is recommended to update the driver on board.
- Prepare Analog Devices Linux kernel source code (only need to run once): - Prepare Analog Devices Linux kernel source code (only need to run once):
``` ```
$OPENWIFI_DIR/user_space/prepare_kernel.sh $OPENWIFI_DIR $XILINX_DIR ARCH_BIT cd openwifi/user_space; ./prepare_kernel.sh $XILINX_DIR ARCH_BIT build
(For Zynq 7000, ARCH_BIT should be 32, for Zynq MPSoC, ARCH_BIT should be 64) (For Zynq 7000, ARCH_BIT should be 32, for Zynq MPSoC, ARCH_BIT should be 64)
``` ```
**Note**: In Ubuntu, gcc-10 might have issue ('yylloc' error), so use gcc-9 if you encounter error. **Note**: In Ubuntu, gcc-10 might have issue ('yylloc' error), so use gcc-9 if you encounter error.
- Compile the latest openwifi driver - Compile the latest openwifi driver
``` ```
$OPENWIFI_DIR/driver/make_all.sh $OPENWIFI_DIR $XILINX_DIR ARCH_BIT cd openwifi/driver; ./make_all.sh $XILINX_DIR ARCH_BIT
(For Zynq 7000, ARCH_BIT should be 32, for Zynq MPSoC, ARCH_BIT should be 64) (For Zynq 7000, ARCH_BIT should be 32, for Zynq MPSoC, ARCH_BIT should be 64)
``` ```
- Copy the driver files to the board via ssh channel - Copy the driver files to the board via ssh channel
``` ```
scp `find $OPENWIFI_DIR/driver/ -name \*.ko` root@192.168.10.122:openwifi/ cd openwifi/driver; scp `find ./ -name \*.ko` root@192.168.10.122:openwifi/
``` ```
Now you can use **wgd.sh** on board to load the new openwifi driver. Now you can use **wgd.sh** on board to load the new openwifi driver.
**Note**: If you have symbol or version error while loadng the driver, it could be because the kernel in the SD card image is too old. In this case, you need to follow [[Build openwifi Linux img from scratch](#Build-openwifi-Linux-img-from-scratch)] to generate your new SD card image. **Note**: If you have symbol or version error while loadng the driver, it could be because the kernel in the SD card image is too old. In this case, you need to follow [[Build openwifi Linux img from scratch](#Build-openwifi-Linux-img-from-scratch)] to generate your new SD card image.
@ -173,7 +172,7 @@ Since the pre-built SD card image might not have the latest bug-fixes/updates, i
## Update sdrctl ## Update sdrctl
- Copy the sdrctl source files to the board via ssh channel - Copy the sdrctl source files to the board via ssh channel
``` ```
scp `find $OPENWIFI_DIR/user_space/sdrctl_src/ -name \*` root@192.168.10.122:openwifi/sdrctl_src/ cd openwifi/user_space/sdrctl_src; scp `find ./ -name \*` root@192.168.10.122:openwifi/sdrctl_src/
``` ```
- Compile the sdrctl **on board**: - Compile the sdrctl **on board**:
``` ```
@ -182,7 +181,7 @@ Since the pre-built SD card image might not have the latest bug-fixes/updates, i
## Easy Access and etc ## Easy Access and etc
- FPGA and driver on board update scripts - FPGA and driver on board update scripts
- Setup [ftp server](https://help.ubuntu.com/lts/serverguide/ftp-server.html) on PC, allow anonymous and change ftp root directory to $OPENWIFI_DIR. - Setup [ftp server](https://help.ubuntu.com/lts/serverguide/ftp-server.html) on PC, allow anonymous and change ftp root directory to the openwifi directory.
- On board: - On board:
``` ```
./sdcard_boot_update.sh $BOARD_NAME ./sdcard_boot_update.sh $BOARD_NAME
@ -200,12 +199,12 @@ Since the pre-built SD card image might not have the latest bug-fixes/updates, i
``` ```
export SDCARD_DIR=sdcard_mount_point export SDCARD_DIR=sdcard_mount_point
export XILINX_DIR=your_Xilinx_directory export XILINX_DIR=your_Xilinx_directory
export OPENWIFI_DIR=your_openwifi_directory export OPENWIFI_HW_DIR=your_openwifi-hw_directory
export BOARD_NAME=your_board_name export BOARD_NAME=your_board_name
``` ```
- Run script to update SD card: - Run script to update SD card:
``` ```
$OPENWIFI_DIR/user_space/update_sdcard.sh $OPENWIFI_DIR $XILINX_DIR $BOARD_NAME $SDCARD_DIR cd openwifi/user_space; ./update_sdcard.sh $OPENWIFI_HW_DIR $XILINX_DIR $BOARD_NAME $SDCARD_DIR
``` ```
- Config your board to SD card boot mode (check the board manual). Insert the SD card to the board. Power on. - Config your board to SD card boot mode (check the board manual). Insert the SD card to the board. Power on.
- Login to the board from your PC (PC Ethernet should have IP 192.168.10.1) with one time password **analog**. - Login to the board from your PC (PC Ethernet should have IP 192.168.10.1) with one time password **analog**.
@ -238,7 +237,7 @@ For hostapd program, 802.11b rates can be suppressed using configuration command
On the other hand, the wpa_supplicant program on the client side (commercial Wi-Fi dongle/board) cannot suppress 802.11b rates out of the box in 2.4GHz band, so there will be an issue when connecting openwifi (OFDM only). A patched wpa_supplicant should be used at the client side. On the other hand, the wpa_supplicant program on the client side (commercial Wi-Fi dongle/board) cannot suppress 802.11b rates out of the box in 2.4GHz band, so there will be an issue when connecting openwifi (OFDM only). A patched wpa_supplicant should be used at the client side.
``` ```
sudo apt-get install libssl1.0-dev sudo apt-get install libssl1.0-dev
$OPENWIFI_DIR/user_space/build_wpa_supplicant_wo11b.sh $OPENWIFI_DIR cd openwifi/user_space; ./build_wpa_supplicant_wo11b.sh
``` ```
## Porting guide ## Porting guide

View File

@ -4,14 +4,14 @@
# SPDX-FileCopyrightText: 2019 UGent # SPDX-FileCopyrightText: 2019 UGent
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
if [ "$#" -ne 3 ]; then if [ "$#" -ne 2 ]; then
echo "You must enter exactly 3 arguments: \$OPENWIFI_DIR \$XILINX_DIR ARCH_BIT(32 or 64)" echo "You must enter exactly 2 arguments: \$XILINX_DIR ARCH_BIT(32 or 64)"
exit 1 exit 1
fi fi
OPENWIFI_DIR=$1 OPENWIFI_DIR=$(pwd)/../
XILINX_DIR=$2 XILINX_DIR=$1
ARCH_OPTION=$3 ARCH_OPTION=$2
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
echo "\$OPENWIFI_DIR is found!" echo "\$OPENWIFI_DIR is found!"

View File

@ -4,14 +4,14 @@
# SPDX-FileCopyrightText: 2019 UGent # SPDX-FileCopyrightText: 2019 UGent
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
if [ "$#" -ne 3 ]; then if [ "$#" -ne 2 ]; then
echo "You must enter exactly 3 arguments: \$OPENWIFI_DIR \$XILINX_DIR ARCH_BIT(32 or 64)" echo "You must enter exactly 2 arguments: \$XILINX_DIR ARCH_BIT(32 or 64)"
exit 1 exit 1
fi fi
OPENWIFI_DIR=$1 OPENWIFI_DIR=$(pwd)/../../
XILINX_DIR=$2 XILINX_DIR=$1
ARCH_OPTION=$3 ARCH_OPTION=$2
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
echo "\$OPENWIFI_DIR is found!" echo "\$OPENWIFI_DIR is found!"

View File

@ -4,15 +4,15 @@
# SPDX-FileCopyrightText: 2019 UGent # SPDX-FileCopyrightText: 2019 UGent
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
if [ "$#" -ne 3 ]; then if [ "$#" -ne 2 ]; then
echo "You must enter exactly 3 arguments: \$OPENWIFI_DIR \$XILINX_DIR \$ARCH(32 or 64)" echo "You must enter exactly 2 arguments: \$XILINX_DIR \$ARCH(32 or 64)"
exit 1 exit 1
fi fi
WORKDIR=$PWD WORKDIR=$PWD
OPENWIFI_DIR=$1 OPENWIFI_DIR=$(pwd)/../../
XILINX_DIR=$2 XILINX_DIR=$1
ARCH_OPTION=$3 ARCH_OPTION=$2
set -x set -x

View File

@ -5,12 +5,14 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms2-ebz/software/linux/zynq_2014r2 # https://wiki.analog.com/resources/eval/user-guides/ad-fmcomms2-ebz/software/linux/zynq_2014r2
if [ "$#" -ne 1 ]; then if [ "$#" -ne 2 ]; then
echo "You must enter the \$BOARD_NAME as argument" echo "You must enter the \$OPENWIFI_HW_DIR \$BOARD_NAME as argument"
echo "Like: antsdr adrv9364z7020 adrv9361z7035 zc706_fmcs2 zed_fmcs2 zc702_fmcs2 zcu102_fmcs2 zcu102_9371" echo "BOARD_NAME Like: antsdr adrv9364z7020 adrv9361z7035 zc706_fmcs2 zed_fmcs2 zc702_fmcs2 zcu102_fmcs2 zcu102_9371"
exit 1 exit 1
fi fi
BOARD_NAME=$1
OPENWIFI_HW_DIR=$1
BOARD_NAME=$2
if [ "$BOARD_NAME" != "antsdr" ] && [ "$BOARD_NAME" != "zc706_fmcs2" ] && [ "$BOARD_NAME" != "zc702_fmcs2" ] && [ "$BOARD_NAME" != "zed_fmcs2" ] && [ "$BOARD_NAME" != "adrv9361z7035" ] && [ "$BOARD_NAME" != "adrv9364z7020" ] && [ "$BOARD_NAME" != "zcu102_fmcs2" ] && [ "$BOARD_NAME" != "zcu102_9371" ]; then if [ "$BOARD_NAME" != "antsdr" ] && [ "$BOARD_NAME" != "zc706_fmcs2" ] && [ "$BOARD_NAME" != "zc702_fmcs2" ] && [ "$BOARD_NAME" != "zed_fmcs2" ] && [ "$BOARD_NAME" != "adrv9361z7035" ] && [ "$BOARD_NAME" != "adrv9364z7020" ] && [ "$BOARD_NAME" != "zcu102_fmcs2" ] && [ "$BOARD_NAME" != "zcu102_9371" ]; then
echo "\$BOARD_NAME is not correct. Please check!" echo "\$BOARD_NAME is not correct. Please check!"
@ -19,10 +21,9 @@ else
echo "\$BOARD_NAME is found!" echo "\$BOARD_NAME is found!"
fi fi
set -ex set -ex
HDF_FILE=../openwifi-hw/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/system.hdf HDF_FILE=$OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/system.hdf
UBOOT_FILE=./boards/$BOARD_NAME/u-boot.elf UBOOT_FILE=./boards/$BOARD_NAME/u-boot.elf
BUILD_DIR=./boards/$BOARD_NAME/build_boot_bin BUILD_DIR=./boards/$BOARD_NAME/build_boot_bin
OUTPUT_DIR=./boards/$BOARD_NAME/output_boot_bin OUTPUT_DIR=./boards/$BOARD_NAME/output_boot_bin

View File

@ -5,14 +5,19 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
if [ "$#" -ne 3 ]; then if [ "$#" -ne 3 ]; then
echo "You must enter exactly 3 arguments: \$OPENWIFI_DIR \$XILINX_DIR \$BOARD_NAME" echo "You must enter exactly 3 arguments: \$OPENWIFI_HW_DIR \$XILINX_DIR \$BOARD_NAME"
exit 1 exit 1
fi fi
OPENWIFI_DIR=$1 OPENWIFI_HW_DIR=$1
XILINX_DIR=$2 XILINX_DIR=$2
BOARD_NAME=$3 BOARD_NAME=$3
OPENWIFI_DIR=$(pwd)/../
echo OPENWIFI_DIR $OPENWIFI_DIR
echo OPENWIFI_HW_DIR $OPENWIFI_HW_DIR
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
echo "\$OPENWIFI_DIR is found!" echo "\$OPENWIFI_DIR is found!"
else else
@ -34,6 +39,13 @@ else
echo "\$BOARD_NAME is found!" echo "\$BOARD_NAME is found!"
fi fi
if [ -d "$OPENWIFI_HW_DIR/boards/$BOARD_NAME" ]; then
echo "\$OPENWIFI_HW_DIR is found!"
else
echo "\$OPENWIFI_HW_DIR is not correct. Please check!"
exit 1
fi
home_dir=$(pwd) home_dir=$(pwd)
set -ex set -ex
@ -43,6 +55,6 @@ source $XILINX_DIR/SDK/2018.3/settings64.sh
cd $OPENWIFI_DIR/kernel_boot cd $OPENWIFI_DIR/kernel_boot
./build_boot_bin.sh $BOARD_NAME ./build_boot_bin.sh $OPENWIFI_HW_DIR $BOARD_NAME
cd $home_dir cd $home_dir

View File

@ -5,14 +5,19 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
if [ "$#" -ne 3 ]; then if [ "$#" -ne 3 ]; then
echo "You must enter exactly 3 arguments: \$OPENWIFI_DIR \$XILINX_DIR \$BOARD_NAME" echo "You must enter exactly 3 arguments: \$OPENWIFI_HW_DIR \$XILINX_DIR \$BOARD_NAME"
exit 1 exit 1
fi fi
OPENWIFI_DIR=$1 OPENWIFI_HW_DIR=$1
XILINX_DIR=$2 XILINX_DIR=$2
BOARD_NAME=$3 BOARD_NAME=$3
OPENWIFI_DIR=$(pwd)/../
echo OPENWIFI_DIR $OPENWIFI_DIR
echo OPENWIFI_HW_DIR $OPENWIFI_HW_DIR
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
echo "\$OPENWIFI_DIR is found!" echo "\$OPENWIFI_DIR is found!"
else else
@ -34,6 +39,13 @@ else
echo "\$BOARD_NAME is found!" echo "\$BOARD_NAME is found!"
fi fi
if [ -d "$OPENWIFI_HW_DIR/boards/$BOARD_NAME" ]; then
echo "\$OPENWIFI_HW_DIR is found!"
else
echo "\$OPENWIFI_HW_DIR is not correct. Please check!"
exit 1
fi
home_dir=$(pwd) home_dir=$(pwd)
set -ex set -ex
@ -43,8 +55,8 @@ source $XILINX_DIR/SDK/2018.3/settings64.sh
cd $OPENWIFI_DIR/kernel_boot cd $OPENWIFI_DIR/kernel_boot
./build_zynqmp_boot_bin.sh ../openwifi-hw/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/system.hdf boards/$BOARD_NAME/u-boot-zcu.elf boards/$BOARD_NAME/bl31.elf ./build_zynqmp_boot_bin.sh $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/system.hdf boards/$BOARD_NAME/u-boot-zcu.elf boards/$BOARD_NAME/bl31.elf
# ./build_zynqmp_boot_bin.sh ../openwifi-hw/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/system.hdf boards/$BOARD_NAME/u-boot-zcu.elf download
rm -rf build_boot_bin rm -rf build_boot_bin
rm -rf boards/$BOARD_NAME/output_boot_bin rm -rf boards/$BOARD_NAME/output_boot_bin
mv output_boot_bin boards/$BOARD_NAME/ mv output_boot_bin boards/$BOARD_NAME/

View File

@ -4,12 +4,12 @@
# SPDX-FileCopyrightText: 2019 UGent # SPDX-FileCopyrightText: 2019 UGent
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
if [ "$#" -ne 1 ]; then # if [ "$#" -ne 1 ]; then
echo "You must enter exactly 1 arguments: \$OPENWIFI_DIR" # echo "You must enter exactly 1 arguments: \$OPENWIFI_DIR"
exit 1 # exit 1
fi # fi
OPENWIFI_DIR=$1 OPENWIFI_DIR=$(pwd)/../
set -x set -x

View File

@ -1,32 +0,0 @@
#!/bin/bash
# Author: Xianjun Jiao
# SPDX-FileCopyrightText: 2019 UGent
# SPDX-License-Identifier: AGPL-3.0-or-later
if [ "$#" -ne 1 ]; then
echo "You must enter the \$OPENWIFI_DIR (the openwifi root directory) as argument"
exit 1
fi
OPENWIFI_DIR=$1
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
echo "\$OPENWIFI_DIR is found!"
else
echo "\$OPENWIFI_DIR is not correct. Please check!"
exit 1
fi
home_dir=$(pwd)
set -ex
cd $OPENWIFI_DIR/
git submodule init openwifi-hw
git submodule update openwifi-hw
cd openwifi-hw
git checkout master
git pull
cd $home_dir

View File

@ -53,5 +53,14 @@ sudo apt-get -y install webfs
sudo apt-get -y install iperf sudo apt-get -y install iperf
sudo apt-get -y install libpcap-dev sudo apt-get -y install libpcap-dev
# change the password to openwifi # change the root password to openwifi
cat /etc/passwd
sed -i 's/root:x:0:0:root:\/root:\/bin\/bash/root::0:0:root:\/root:\/bin\/bash/' /etc/passwd
sync
sleep 1
cat /etc/passwd
echo -e "openwifi\nopenwifi" | passwd echo -e "openwifi\nopenwifi" | passwd
sync
sleep 1
cat /etc/passwd

View File

@ -5,14 +5,14 @@
# SPDX-FileCopyrightText: 2019 UGent # SPDX-FileCopyrightText: 2019 UGent
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
if [ "$#" -lt 3 ]; then if [ "$#" -lt 2 ]; then
echo "You must enter at least 3 arguments: \$OPENWIFI_DIR \$XILINX_DIR ARCH_BIT(32 or 64)" echo "You must enter at least 2 arguments: \$XILINX_DIR ARCH_BIT(32 or 64)"
exit 1 exit 1
fi fi
OPENWIFI_DIR=$1 OPENWIFI_DIR=$(pwd)/../
XILINX_DIR=$2 XILINX_DIR=$1
ARCH_OPTION=$3 ARCH_OPTION=$2
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
echo "\$OPENWIFI_DIR is found!" echo "\$OPENWIFI_DIR is found!"
@ -59,7 +59,8 @@ git submodule update $LINUX_KERNEL_SRC_DIR_NAME
cd $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME cd $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME
git checkout 2019_R1 git checkout 2019_R1
git pull origin 2019_R1 git pull origin 2019_R1
# git reset --hard 4fea7c5 git reset --hard
# git reset --hard 4e81f0927cfb2fada92fc762dbd65d002848405a
cp $LINUX_KERNEL_CONFIG_FILE ./.config cp $LINUX_KERNEL_CONFIG_FILE ./.config
cp $OPENWIFI_DIR/driver/ad9361/ad9361.c $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME/drivers/iio/adc/ad9361.c -rf cp $OPENWIFI_DIR/driver/ad9361/ad9361.c $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME/drivers/iio/adc/ad9361.c -rf
@ -69,13 +70,13 @@ export CROSS_COMPILE=$CROSS_COMPILE_NAME
make oldconfig && make prepare && make modules_prepare make oldconfig && make prepare && make modules_prepare
if [ "$#" -gt 3 ]; then if [ "$#" -gt 2 ]; then
if [ -f "$OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME/arch/$ARCH_NAME/boot/$IMAGE_TYPE" ]; then # if [ -f "$OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME/arch/$ARCH_NAME/boot/$IMAGE_TYPE" ]; then
echo "Kernel found! Skip the time costly Linux kernel compiling." # echo "Kernel found! Skip the time costly Linux kernel compiling."
else # else
make -j12 $IMAGE_TYPE UIMAGE_LOADADDR=0x8000 make -j12 $IMAGE_TYPE UIMAGE_LOADADDR=0x8000
make modules make modules
fi # fi
fi fi
cd $home_dir cd $home_dir

View File

@ -6,12 +6,12 @@
if [ "$#" -ne 1 ]; then if [ "$#" -ne 1 ]; then
echo "You must enter the \$BOARD_NAME as argument" echo "You must enter the \$BOARD_NAME as argument"
echo "Like: adrv9364z7020 adrv9361z7035 zc706_fmcs2 zed_fmcs2 zc702_fmcs2 zcu102_fmcs2 zcu102_9371" echo "Like: antsdr adrv9364z7020 adrv9361z7035 zc706_fmcs2 zed_fmcs2 zc702_fmcs2 zcu102_fmcs2 zcu102_9371"
exit 1 exit 1
fi fi
BOARD_NAME=$1 BOARD_NAME=$1
if [ "$BOARD_NAME" != "zc706_fmcs2" ] && [ "$BOARD_NAME" != "zc702_fmcs2" ] && [ "$BOARD_NAME" != "zed_fmcs2" ] && [ "$BOARD_NAME" != "adrv9361z7035" ] && [ "$BOARD_NAME" != "adrv9364z7020" ] && [ "$BOARD_NAME" != "zcu102_fmcs2" ] && [ "$BOARD_NAME" != "zcu102_9371" ]; then if [ "$BOARD_NAME" != "antsdr" ] && [ "$BOARD_NAME" != "zc706_fmcs2" ] && [ "$BOARD_NAME" != "zc702_fmcs2" ] && [ "$BOARD_NAME" != "zed_fmcs2" ] && [ "$BOARD_NAME" != "adrv9361z7035" ] && [ "$BOARD_NAME" != "adrv9364z7020" ] && [ "$BOARD_NAME" != "zcu102_fmcs2" ] && [ "$BOARD_NAME" != "zcu102_9371" ]; then
echo "\$BOARD_NAME is not correct. Please check!" echo "\$BOARD_NAME is not correct. Please check!"
exit 1 exit 1
else else

View File

@ -7,15 +7,20 @@
if [ "$#" -ne 4 ]; then if [ "$#" -ne 4 ]; then
echo "You have input $# arguments." echo "You have input $# arguments."
echo "You must enter exactly 4 arguments: \$OPENWIFI_DIR \$XILINX_DIR \$BOARD_NAME \$SDCARD_DIR" echo "You must enter exactly 4 arguments: \$OPENWIFI_HW_DIR \$XILINX_DIR \$BOARD_NAME \$SDCARD_DIR"
exit 1 exit 1
fi fi
OPENWIFI_DIR=$1 OPENWIFI_HW_DIR=$1
XILINX_DIR=$2 XILINX_DIR=$2
BOARD_NAME=$3 BOARD_NAME=$3
SDCARD_DIR=$4 SDCARD_DIR=$4
OPENWIFI_DIR=$(pwd)/../
echo OPENWIFI_DIR $OPENWIFI_DIR
echo OPENWIFI_HW_DIR $OPENWIFI_HW_DIR
if [ -f "$OPENWIFI_DIR/LICENSE" ]; then if [ -f "$OPENWIFI_DIR/LICENSE" ]; then
echo "\$OPENWIFI_DIR is found!" echo "\$OPENWIFI_DIR is found!"
else else
@ -37,6 +42,13 @@ else
echo "\$BOARD_NAME is found!" echo "\$BOARD_NAME is found!"
fi fi
if [ -d "$OPENWIFI_HW_DIR/boards/$BOARD_NAME" ]; then
echo "\$OPENWIFI_HW_DIR is found!"
else
echo "\$OPENWIFI_HW_DIR is not correct. Please check!"
exit 1
fi
# detect SD card mounting status # detect SD card mounting status
if [ -d "$SDCARD_DIR/BOOT/" ]; then if [ -d "$SDCARD_DIR/BOOT/" ]; then
echo "$SDCARD_DIR/BOOT/" echo "$SDCARD_DIR/BOOT/"
@ -74,13 +86,11 @@ LINUX_KERNEL_SRC_DIR_NAME32=adi-linux
LINUX_KERNEL_SRC_DIR_NAME64=adi-linux-64 LINUX_KERNEL_SRC_DIR_NAME64=adi-linux-64
cd $OPENWIFI_DIR/user_space/ cd $OPENWIFI_DIR/user_space/
./prepare_kernel.sh $OPENWIFI_DIR $XILINX_DIR 32 build ./prepare_kernel.sh $XILINX_DIR 32 build
sudo true sudo true
./prepare_kernel.sh $OPENWIFI_DIR $XILINX_DIR 64 build ./prepare_kernel.sh $XILINX_DIR 64 build
sudo true sudo true
$OPENWIFI_DIR/user_space/get_fpga.sh $OPENWIFI_DIR
BOARD_NAME_ALL="antsdr zc706_fmcs2 zed_fmcs2 zc702_fmcs2 adrv9361z7035 adrv9364z7020 zcu102_fmcs2 zcu102_9371" BOARD_NAME_ALL="antsdr zc706_fmcs2 zed_fmcs2 zc702_fmcs2 adrv9361z7035 adrv9364z7020 zcu102_fmcs2 zcu102_9371"
# BOARD_NAME_ALL="zcu102_fmcs2" # BOARD_NAME_ALL="zcu102_fmcs2"
# BOARD_NAME_ALL="adrv9361z7035" # BOARD_NAME_ALL="adrv9361z7035"
@ -89,11 +99,11 @@ do
if [ "$BOARD_NAME_TMP" == "zcu102_fmcs2" ] || [ "$BOARD_NAME_TMP" == "zcu102_9371" ]; then if [ "$BOARD_NAME_TMP" == "zcu102_fmcs2" ] || [ "$BOARD_NAME_TMP" == "zcu102_9371" ]; then
dtb_filename_tmp="system.dtb" dtb_filename_tmp="system.dtb"
dts_filename_tmp="system.dts" dts_filename_tmp="system.dts"
$OPENWIFI_DIR/user_space/boot_bin_gen_zynqmp.sh $OPENWIFI_DIR $XILINX_DIR $BOARD_NAME_TMP ./boot_bin_gen_zynqmp.sh $OPENWIFI_HW_DIR $XILINX_DIR $BOARD_NAME_TMP
else else
dtb_filename_tmp="devicetree.dtb" dtb_filename_tmp="devicetree.dtb"
dts_filename_tmp="devicetree.dts" dts_filename_tmp="devicetree.dts"
$OPENWIFI_DIR/user_space/boot_bin_gen.sh $OPENWIFI_DIR $XILINX_DIR $BOARD_NAME_TMP ./boot_bin_gen.sh $OPENWIFI_HW_DIR $XILINX_DIR $BOARD_NAME_TMP
fi fi
echo $dtb_filename_tmp echo $dtb_filename_tmp
echo $dts_filename_tmp echo $dts_filename_tmp
@ -129,15 +139,25 @@ sudo cp $OPENWIFI_DIR/user_space/* $SDCARD_DIR/rootfs/root/openwifi/ -rf
sudo wget -P $SDCARD_DIR/rootfs/root/openwifi/webserver/ https://users.ugent.be/~xjiao/openwifi-low-aac.mp4 sudo wget -P $SDCARD_DIR/rootfs/root/openwifi/webserver/ https://users.ugent.be/~xjiao/openwifi-low-aac.mp4
# build openwifi driver # build openwifi driver
$OPENWIFI_DIR/driver/make_all.sh $OPENWIFI_DIR $XILINX_DIR 32 saved_dir=$(pwd)
$OPENWIFI_DIR/driver/side_ch/make_driver.sh $OPENWIFI_DIR $XILINX_DIR 32 cd $OPENWIFI_DIR/driver
./make_all.sh $XILINX_DIR 32
cd $OPENWIFI_DIR/driver/side_ch
./make_driver.sh $XILINX_DIR 32
cd $saved_dir
# Copy files to SD card rootfs partition # Copy files to SD card rootfs partition
sudo mkdir $SDCARD_DIR/rootfs/root/openwifi/drv32 sudo mkdir $SDCARD_DIR/rootfs/root/openwifi/drv32
sudo find $OPENWIFI_DIR/driver -name \*.ko -exec cp {} $SDCARD_DIR/rootfs/root/openwifi/drv32 \; sudo find $OPENWIFI_DIR/driver -name \*.ko -exec cp {} $SDCARD_DIR/rootfs/root/openwifi/drv32 \;
# build openwifi driver # build openwifi driver
$OPENWIFI_DIR/driver/make_all.sh $OPENWIFI_DIR $XILINX_DIR 64 saved_dir=$(pwd)
$OPENWIFI_DIR/driver/side_ch/make_driver.sh $OPENWIFI_DIR $XILINX_DIR 64 cd $OPENWIFI_DIR/driver
./make_all.sh $XILINX_DIR 64
cd $OPENWIFI_DIR/driver/side_ch
./make_driver.sh $XILINX_DIR 64
cd $saved_dir
# Copy files to SD card rootfs partition # Copy files to SD card rootfs partition
sudo mkdir $SDCARD_DIR/rootfs/root/openwifi/drv64 sudo mkdir $SDCARD_DIR/rootfs/root/openwifi/drv64
sudo find $OPENWIFI_DIR/driver -name \*.ko -exec cp {} $SDCARD_DIR/rootfs/root/openwifi/drv64 \; sudo find $OPENWIFI_DIR/driver -name \*.ko -exec cp {} $SDCARD_DIR/rootfs/root/openwifi/drv64 \;