Update necessary kuiper scripts

This commit is contained in:
Xianjun Jiao 2023-01-17 14:30:41 +01:00
parent 5a9ac0d13e
commit 6a4d7cea87
6 changed files with 191 additions and 25 deletions

View File

@ -15,7 +15,7 @@ OPENWIFI_HW_DIR=$1
XILINX_DIR=$2
BOARD_NAME=$3
if [ -d "$XILINX_DIR/SDK" ]; then
if [ -d "$XILINX_DIR/Vitis" ]; then
echo "\$XILINX_DIR is found!"
else
echo "\$XILINX_DIR is not correct. Please check!"
@ -38,11 +38,13 @@ fi
# uncompress the system.hdf and system_top.bit for use
mkdir -p hdf_and_bit
tar -zxvf $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/hdf_and_bit.tar.gz -C ./hdf_and_bit
cp ./hdf_and_bit/$BOARD_NAME/sdk/system_top_hw_platform_0/system.hdf $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/ -rf
cp ./hdf_and_bit/$BOARD_NAME/sdk/system_top_hw_platform_0/system_top.bit $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/ -rf
rm hdf_and_bit/* -rf
unzip $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top.xsa -d ./hdf_and_bit
# cp ./hdf_and_bit/$BOARD_NAME/sdk/system_top_hw_platform_0/system.hdf $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/ -rf
# cp ./hdf_and_bit/system_top.bit $OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/ -rf
BIT_FILENAME=$OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/system_top.bit
# BIT_FILENAME=$OPENWIFI_HW_DIR/boards/$BOARD_NAME/sdk/system_top_hw_platform_0/system_top.bit
BIT_FILENAME=./hdf_and_bit/system_top.bit
if [ -f "$BIT_FILENAME" ]; then
echo "\$BIT_FILENAME is found!"
@ -61,7 +63,7 @@ fi
# FINAL_BIT_FILENAME=$BOARD_NAME\_system_top_reload.bit.bin
source $XILINX_DIR/SDK/2018.3/settings64.sh
source $XILINX_DIR/Vitis/2021.1/settings64.sh
set -x

View File

@ -0,0 +1,50 @@
#!/bin/bash
# Author: Xianjun Jiao
# SPDX-FileCopyrightText: 2019 UGent
# SPDX-License-Identifier: AGPL-3.0-or-later
set -ex
MACHINE_TYPE=`uname -m`
mkdir -p kernel_modules
rm -rf kernel_modules/*
tar -zxvf kernel_modules.tar.gz
if [ ${MACHINE_TYPE} == 'aarch64' ]; then
IMAGE_FILENAME=Image
else
IMAGE_FILENAME=uImage
fi
rm -rf /lib/modules/$(uname -r)
# setup kernel module directory
# if [ -d "/lib/modules/$(uname -r)" ]; then
# echo "/lib/modules/$(uname -r) already exists."
# else
# if [ ${MACHINE_TYPE} == 'aarch64' ]; then
# ln -s /root/kernel_modules /lib/modules/$(uname -r)
# else
# ln -s /root/kernel_modules /lib/modules/$(uname -r)
# fi
ln -s /root/kernel_modules /lib/modules/$(uname -r)
# fi
depmod
# modprobe mac80211
umount /mnt || /bin/true
mount /dev/mmcblk0p1 /mnt
if test -f "./kernel_modules/$IMAGE_FILENAME"; then
cp ./kernel_modules/$IMAGE_FILENAME /mnt/
fi
if test -f "./kernel_modules/BOOT.BIN"; then
cp ./kernel_modules/BOOT.BIN /mnt/
fi
cd /mnt/
sync
cd ~
umount /mnt
reboot now

View File

@ -30,6 +30,8 @@ fi
# add gateway (PC) for internet access
route add default gw 192.168.10.1 || true
sudo apt update
chmod +x *.sh
# build sdrctl
@ -53,6 +55,7 @@ sudo apt-get -y install nano
sudo apt-get -y install tcpdump
sudo apt-get -y install webfs
sudo apt-get -y install iperf
sudo apt-get -y install iperf3
sudo apt-get -y install libpcap-dev
sudo apt-get -y install bridge-utils

View File

@ -5,8 +5,18 @@
# SPDX-FileCopyrightText: 2019 UGent
# SPDX-License-Identifier: AGPL-3.0-or-later
if [ "$#" -lt 2 ]; then
echo "You must enter at least 2 arguments: \$XILINX_DIR ARCH_BIT(32 or 64)"
# ATTENTION! You need Vitis, NOT Vitis_HLS, installed
# if [ "$#" -ne 1 ]; then
# echo "You must enter 1 arguments: ARCH_BIT(32 or 64)"
# exit 1
# fi
# OPENWIFI_DIR=$(pwd)/../
# ARCH_OPTION=$1
if [ "$#" -ne 2 ]; then
echo "You must enter 2 arguments: \$XILINX_DIR ARCH_BIT(32 or 64)"
exit 1
fi
@ -21,7 +31,7 @@ else
exit 1
fi
if [ -d "$XILINX_DIR/SDK" ]; then
if [ -d "$XILINX_DIR/Vitis" ]; then
echo "\$XILINX_DIR is found!"
else
echo "\$XILINX_DIR is not correct. Please check!"
@ -55,29 +65,38 @@ set -x
cd $OPENWIFI_DIR/
git submodule init $LINUX_KERNEL_SRC_DIR_NAME
cd $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME
git reset --hard
cd $OPENWIFI_DIR/
git submodule update $LINUX_KERNEL_SRC_DIR_NAME
cd $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME
git checkout 2019_R1
git pull origin 2019_R1
git reset --hard
# git reset --hard 4e81f0927cfb2fada92fc762dbd65d002848405a
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_conv.c $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME/drivers/iio/adc/ad9361_conv.c -rf
git fetch origin 2021_r1
git checkout 2021_r1
git pull origin 2021_r1
git reset --hard 2021_r1
source $XILINX_DIR/SDK/2018.3/settings64.sh
export ARCH=$ARCH_NAME
export CROSS_COMPILE=$CROSS_COMPILE_NAME
source $XILINX_DIR/Vitis/2021.1/settings64.sh
# if [ "$ARCH_OPTION" == "64" ]; then
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_conv.c $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME/drivers/iio/adc/ad9361_conv.c -rf
git apply ../kernel_boot/axi_hdmi_crtc.patch
git apply ../kernel_boot/ad9361.patch
git apply ../kernel_boot/ad9361_conv.patch
# else
# make zynq_xcomm_adv7511_defconfig
# fi
make oldconfig && make prepare && make modules_prepare
# make adi_zynqmp_defconfig
make prepare && make modules_prepare
if [ "$#" -gt 2 ]; 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."
# else
make -j12 $IMAGE_TYPE UIMAGE_LOADADDR=0x8000
make modules
# fi
fi
# if [ "$#" -gt 2 ]; then
make -j12 $IMAGE_TYPE UIMAGE_LOADADDR=0x8000
make modules
# fi
cd $home_dir

View File

@ -0,0 +1,37 @@
#!/bin/bash
# Author: Xianjun Jiao
# SPDX-FileCopyrightText: 2019 UGent
# SPDX-License-Identifier: AGPL-3.0-or-later
# Setup Eth connection before this script!
# Host: 192.168.10.1
# Board: 192.168.10.122
# Commands onboard to setup:
# ifconfig eth0 192.168.10.122 netmask 255.255.255.0
# ifconfig eth0 up
# route add default gw 192.168.10.1
# if [ "$#" -ne 2 ]; then
# echo "You have input $# arguments."
# echo "You must enter \$DIR_TO_ADI_LINUX_KERNEL and ARCH_BIT(32 or 64) as argument"
# exit 1
# fi
# DIR_TO_ADI_LINUX_KERNEL=$1
# ARCH_OPTION=$2
# if [ "$ARCH_OPTION" == "64" ]; then
# LINUX_KERNEL_IMAGE=$DIR_TO_ADI_LINUX_KERNEL/arch/arm64/boot/Image
# else
# LINUX_KERNEL_IMAGE=$DIR_TO_ADI_LINUX_KERNEL/arch/arm/boot/uImage
# fi
mkdir -p openwifi
rm -rf ./openwifi/*
find ../driver/ -name \*.ko -exec cp {} ./openwifi/ \;
tar -zcvf openwifi.tar.gz openwifi
scp openwifi.tar.gz root@192.168.10.122:

View File

@ -0,0 +1,55 @@
#!/bin/bash
# Author: Xianjun Jiao
# SPDX-FileCopyrightText: 2019 UGent
# SPDX-License-Identifier: AGPL-3.0-or-later
# Setup Eth connection before this script!
# Host: 192.168.10.1
# Board: 192.168.10.122
# Commands onboard to setup:
# ifconfig eth0 192.168.10.122 netmask 255.255.255.0
# ifconfig eth0 up
# route add default gw 192.168.10.1
if [ "$#" -ne 2 ]; then
echo "You have input $# arguments."
echo "You must enter \$DIR_TO_ADI_LINUX_KERNEL and \$BOARD_NAME as argument"
exit 1
fi
DIR_TO_ADI_LINUX_KERNEL=$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
echo "\$BOARD_NAME is not correct. Please check!"
exit 1
else
echo "\$BOARD_NAME is found!"
fi
if [ "$BOARD_NAME" == "zcu102_fmcs2" ] || [ "$BOARD_NAME" == "zcu102_9371" ]; then
LINUX_KERNEL_IMAGE=$DIR_TO_ADI_LINUX_KERNEL/arch/arm64/boot/Image
else
LINUX_KERNEL_IMAGE=$DIR_TO_ADI_LINUX_KERNEL/arch/arm/boot/uImage
fi
mkdir -p kernel_modules
rm -rf ./kernel_modules/*
find $DIR_TO_ADI_LINUX_KERNEL/ -name \*.ko -exec cp {} ./kernel_modules/ \;
if test -f "$LINUX_KERNEL_IMAGE"; then
cp $LINUX_KERNEL_IMAGE ./kernel_modules/
fi
if test -f "../kernel_boot/boards/$BOARD_NAME/output_boot_bin/BOOT.BIN"; then
cp ../kernel_boot/boards/$BOARD_NAME/output_boot_bin/BOOT.BIN ./kernel_modules/
fi
tar -zcvf kernel_modules.tar.gz kernel_modules
scp kernel_modules.tar.gz root@192.168.10.122:
# scp $LINUX_KERNEL_IMAGE root@192.168.10.122:
scp populate_kernel_image_module_reboot.sh root@192.168.10.122: