mirror of
https://github.com/open-sdr/openwifi.git
synced 2025-01-18 18:56:24 +00:00
Resolve the potential re-booting issue:
1. issue: booting halt at Found device /dev/ttyPS0. Found device /dev/disk/by-partuuid/f7eeebee-01. 2. solution action 1. BOOT partition is full, more space needs to be released 3. solution action 2. move ad9361_drv/adi_axi_hdmi/axidmatest/lcd/xilinx_dma.ko outside kernel_modules (<-- lib/modules/...)
This commit is contained in:
parent
4443c30616
commit
b72abc1703
@ -18,21 +18,16 @@ else
|
||||
IMAGE_FILENAME=uImage
|
||||
fi
|
||||
|
||||
mv ./kernel_modules/ad9361_drv.ko ./openwifi/ -f
|
||||
mv ./kernel_modules/adi_axi_hdmi.ko ./openwifi/ -f
|
||||
mv ./kernel_modules/axidmatest.ko ./openwifi/ -f
|
||||
mv ./kernel_modules/lcd.ko ./openwifi/ -f
|
||||
mv ./kernel_modules/xilinx_dma.ko ./openwifi/ -f
|
||||
|
||||
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
|
||||
ln -s /root/kernel_modules /lib/modules/$(uname -r)
|
||||
|
||||
depmod
|
||||
# modprobe mac80211
|
||||
|
||||
umount /mnt || /bin/true
|
||||
mount /dev/mmcblk0p1 /mnt
|
||||
|
@ -1,4 +1,4 @@
|
||||
!/bin/bash
|
||||
#!/bin/bash
|
||||
|
||||
# Author: Xianjun Jiao
|
||||
# SPDX-FileCopyrightText: 2023 UGent
|
||||
@ -16,29 +16,34 @@ mkdir -p kernel_modules
|
||||
# mkdir -p /lib/modules/$(uname -r)
|
||||
# rm -rf /lib/modules/$(uname -r)
|
||||
if [ ${MACHINE_TYPE} == 'aarch64' ]; then
|
||||
cp ./kernel_modules64/* ./kernel_modules/
|
||||
cp ./openwifi64/* ./openwifi/
|
||||
cp /root/kernel_modules64/* /root/kernel_modules/
|
||||
cp /root/openwifi64/* /root/openwifi/
|
||||
# cp ./kernel_modules64/* /lib/modules/$(uname -r)/
|
||||
else
|
||||
cp ./kernel_modules32/* ./kernel_modules/
|
||||
cp ./openwifi32/* ./openwifi/
|
||||
cp /root/kernel_modules32/* /root/kernel_modules/
|
||||
cp /root/openwifi32/* /root/openwifi/
|
||||
# cp ./kernel_modules32/* /lib/modules/$(uname -r)/
|
||||
fi
|
||||
|
||||
mv /root/kernel_modules/ad9361_drv.ko /root/openwifi/ -f || true
|
||||
mv /root/kernel_modules/adi_axi_hdmi.ko /root/openwifi/ -f || true
|
||||
mv /root/kernel_modules/axidmatest.ko /root/openwifi/ -f || true
|
||||
mv /root/kernel_modules/lcd.ko /root/openwifi/ -f || true
|
||||
mv /root/kernel_modules/xilinx_dma.ko /root/openwifi/ -f || true
|
||||
|
||||
rm -rf /lib/modules/$(uname -r)
|
||||
ln -s /root/kernel_modules /lib/modules/$(uname -r)
|
||||
sync
|
||||
depmod
|
||||
|
||||
cd ./openwifi/
|
||||
cd sdrctl_src
|
||||
cd /root/openwifi/sdrctl_src
|
||||
make clean
|
||||
make
|
||||
cp sdrctl ../
|
||||
cd ../side_ch_ctl_src/
|
||||
cp sdrctl /root/openwifi/
|
||||
cd /root/openwifi/side_ch_ctl_src/
|
||||
gcc -o side_ch_ctl side_ch_ctl.c
|
||||
cp side_ch_ctl ../
|
||||
cd ../inject_80211/
|
||||
cp side_ch_ctl /root/openwifi/
|
||||
cd /root/openwifi/inject_80211/
|
||||
make clean
|
||||
make
|
||||
cd ..
|
||||
|
@ -39,6 +39,11 @@ mkdir -p kernel_modules
|
||||
rm -rf ./kernel_modules/*
|
||||
find $DIR_TO_ADI_LINUX_KERNEL/ -name \*.ko -exec cp {} ./kernel_modules/ \;
|
||||
|
||||
cp $DIR_TO_ADI_LINUX_KERNEL/Module.symvers ./kernel_modules/
|
||||
cp $DIR_TO_ADI_LINUX_KERNEL/modules.builtin ./kernel_modules/
|
||||
cp $DIR_TO_ADI_LINUX_KERNEL/modules.builtin.modinfo ./kernel_modules/
|
||||
cp $DIR_TO_ADI_LINUX_KERNEL/modules.order ./kernel_modules/
|
||||
|
||||
if test -f "$LINUX_KERNEL_IMAGE"; then
|
||||
cp $LINUX_KERNEL_IMAGE ./kernel_modules/
|
||||
fi
|
||||
|
@ -14,8 +14,16 @@ if [ "$#" -lt 3 ]; then
|
||||
fi
|
||||
|
||||
SKIP_KERNEL_BUILD=0
|
||||
SKIP_BOOT=0
|
||||
SKIP_rootfs=0
|
||||
if [ "$#" -eq 4 ]; then
|
||||
SKIP_KERNEL_BUILD=1
|
||||
SKIP_KERNEL_BUILD=$(( ($4 >> 0) & 1 ))
|
||||
SKIP_BOOT=$(( ($4 >> 1) & 1 ))
|
||||
SKIP_rootfs=$(( ($4 >> 2) & 1 ))
|
||||
echo $4
|
||||
echo SKIP_KERNEL_BUILD $SKIP_KERNEL_BUILD
|
||||
echo SKIP_BOOT $SKIP_BOOT
|
||||
echo SKIP_rootfs $SKIP_rootfs
|
||||
fi
|
||||
|
||||
OPENWIFI_HW_IMG_DIR=$1
|
||||
@ -51,9 +59,10 @@ fi
|
||||
# detect SD card mounting status
|
||||
if [ -d "$SDCARD_DIR/BOOT/" ]; then
|
||||
echo "$SDCARD_DIR/BOOT/"
|
||||
sudo rm -rf $SDCARD_DIR/BOOT/openwifi/
|
||||
sudo mkdir -p $SDCARD_DIR/BOOT/openwifi
|
||||
sudo rm -f $SDCARD_DIR/BOOT/README.txt
|
||||
# to save some space
|
||||
sudo rm -rf $SDCARD_DIR/BOOT/socfpga_*
|
||||
sudo rm -rf $SDCARD_DIR/BOOT/versal-*
|
||||
else
|
||||
echo "$SDCARD_DIR/BOOT/ does not exist!"
|
||||
exit 1
|
||||
@ -83,81 +92,90 @@ if [ "$SKIP_KERNEL_BUILD" == "0" ]; then
|
||||
sudo true
|
||||
fi
|
||||
|
||||
BOARD_NAME_ALL="sdrpi antsdr antsdr_e200 zc706_fmcs2 zed_fmcs2 zc702_fmcs2 adrv9361z7035 adrv9364z7020 zcu102_fmcs2 neptunesdr"
|
||||
for BOARD_NAME_TMP in $BOARD_NAME_ALL
|
||||
do
|
||||
if [ "$BOARD_NAME_TMP" == "zcu102_fmcs2" ] || [ "$BOARD_NAME_TMP" == "zcu102_9371" ]; then
|
||||
dtb_filename_tmp="system.dtb"
|
||||
dts_filename_tmp="system.dts"
|
||||
kernel_img_filename_tmp=$OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/arch/arm64/boot/Image
|
||||
else
|
||||
dtb_filename_tmp="devicetree.dtb"
|
||||
dts_filename_tmp="devicetree.dts"
|
||||
kernel_img_filename_tmp=$OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/arch/arm/boot/uImage
|
||||
fi
|
||||
./boot_bin_gen.sh $XILINX_DIR $BOARD_NAME_TMP $OPENWIFI_HW_IMG_DIR/boards/$BOARD_NAME_TMP/sdk/system_top.xsa
|
||||
echo $dtb_filename_tmp
|
||||
echo $dts_filename_tmp
|
||||
if [ "$SKIP_BOOT" == "0" ]; then
|
||||
sudo rm -rf $SDCARD_DIR/BOOT/openwifi/
|
||||
sudo mkdir -p $SDCARD_DIR/BOOT/openwifi
|
||||
BOARD_NAME_ALL="sdrpi antsdr antsdr_e200 zc706_fmcs2 zed_fmcs2 zc702_fmcs2 adrv9361z7035 adrv9364z7020 zcu102_fmcs2 neptunesdr"
|
||||
for BOARD_NAME_TMP in $BOARD_NAME_ALL
|
||||
do
|
||||
if [ "$BOARD_NAME_TMP" == "zcu102_fmcs2" ] || [ "$BOARD_NAME_TMP" == "zcu102_9371" ]; then
|
||||
dtb_filename_tmp="system.dtb"
|
||||
dts_filename_tmp="system.dts"
|
||||
else
|
||||
dtb_filename_tmp="devicetree.dtb"
|
||||
dts_filename_tmp="devicetree.dts"
|
||||
kernel_img_filename_tmp=$OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/arch/arm/boot/uImage
|
||||
fi
|
||||
./boot_bin_gen.sh $XILINX_DIR $BOARD_NAME_TMP $OPENWIFI_HW_IMG_DIR/boards/$BOARD_NAME_TMP/sdk/system_top.xsa
|
||||
echo $dtb_filename_tmp
|
||||
echo $dts_filename_tmp
|
||||
|
||||
dtc -I dts -O dtb -o $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dtb_filename_tmp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dts_filename_tmp
|
||||
sudo rm -rf $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP/
|
||||
sudo mkdir -p $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP
|
||||
sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dtb_filename_tmp $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP/
|
||||
sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/output_boot_bin/BOOT.BIN $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP/
|
||||
sudo cp $kernel_img_filename_tmp $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP/
|
||||
sudo true
|
||||
done
|
||||
dtc -I dts -O dtb -o $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dtb_filename_tmp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dts_filename_tmp
|
||||
sudo mkdir -p $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP
|
||||
sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dtb_filename_tmp $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP/
|
||||
sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/output_boot_bin/BOOT.BIN $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP/
|
||||
sudo true
|
||||
done
|
||||
|
||||
sudo rm -rf $SDCARD_DIR/rootfs/root/openwifi/
|
||||
sudo mkdir -p $SDCARD_DIR/rootfs/root/openwifi
|
||||
kernel_img_filename_tmp=$OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/arch/arm64/boot/Image
|
||||
sudo cp $kernel_img_filename_tmp $SDCARD_DIR/BOOT/
|
||||
kernel_img_filename_tmp=$OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/arch/arm/boot/uImage
|
||||
sudo cp $kernel_img_filename_tmp $SDCARD_DIR/BOOT/
|
||||
fi
|
||||
|
||||
saved_dir=$(pwd)
|
||||
cd $OPENWIFI_DIR/user_space/
|
||||
git clean -dxf ./
|
||||
cd $saved_dir
|
||||
sudo cp $OPENWIFI_DIR/user_space/* $SDCARD_DIR/rootfs/root/openwifi/ -rf
|
||||
sudo mv $SDCARD_DIR/rootfs/root/openwifi/system_top.bit.bin $SDCARD_DIR/rootfs/root/openwifi/system_top.bit.bin.bak
|
||||
sudo wget -P $SDCARD_DIR/rootfs/root/openwifi/webserver/ https://users.ugent.be/~xjiao/openwifi-low-aac.mp4
|
||||
if [ "$SKIP_rootfs" == "0" ]; then
|
||||
sudo rm -rf $SDCARD_DIR/rootfs/root/openwifi/
|
||||
sudo mkdir -p $SDCARD_DIR/rootfs/root/openwifi
|
||||
|
||||
ARCH_OPTION_ALL="32 64"
|
||||
for ARCH_OPTION_TMP in $ARCH_OPTION_ALL
|
||||
do
|
||||
# build openwifi driver
|
||||
saved_dir=$(pwd)
|
||||
cd $OPENWIFI_DIR/driver/
|
||||
cd $OPENWIFI_DIR/user_space/
|
||||
git clean -dxf ./
|
||||
sync
|
||||
./make_all.sh $XILINX_DIR $ARCH_OPTION_TMP
|
||||
cd $saved_dir
|
||||
sudo cp $OPENWIFI_DIR/user_space/* $SDCARD_DIR/rootfs/root/openwifi/ -rf
|
||||
sudo mv $SDCARD_DIR/rootfs/root/openwifi/system_top.bit.bin $SDCARD_DIR/rootfs/root/openwifi/system_top.bit.bin.bak
|
||||
sudo wget -P $SDCARD_DIR/rootfs/root/openwifi/webserver/ https://users.ugent.be/~xjiao/openwifi-low-aac.mp4
|
||||
|
||||
# Copy files to SD card rootfs partition
|
||||
sudo rm -rf $SDCARD_DIR/rootfs/root/openwifi$ARCH_OPTION_TMP/
|
||||
sudo mkdir -p $SDCARD_DIR/rootfs/root/openwifi$ARCH_OPTION_TMP
|
||||
sudo find $OPENWIFI_DIR/driver/ -name \*.ko -exec cp {} $SDCARD_DIR/rootfs/root/openwifi$ARCH_OPTION_TMP \;
|
||||
ARCH_OPTION_ALL="32 64"
|
||||
for ARCH_OPTION_TMP in $ARCH_OPTION_ALL
|
||||
do
|
||||
# build openwifi driver
|
||||
saved_dir=$(pwd)
|
||||
cd $OPENWIFI_DIR/driver/
|
||||
git clean -dxf ./
|
||||
sync
|
||||
./make_all.sh $XILINX_DIR $ARCH_OPTION_TMP
|
||||
cd $saved_dir
|
||||
|
||||
sudo rm -rf $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo mkdir -p $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP
|
||||
# Copy files to SD card rootfs partition
|
||||
sudo rm -rf $SDCARD_DIR/rootfs/root/openwifi$ARCH_OPTION_TMP/
|
||||
sudo mkdir -p $SDCARD_DIR/rootfs/root/openwifi$ARCH_OPTION_TMP
|
||||
sudo find $OPENWIFI_DIR/driver/ -name \*.ko -exec cp {} $SDCARD_DIR/rootfs/root/openwifi$ARCH_OPTION_TMP \;
|
||||
|
||||
if [ "$ARCH_OPTION_TMP" == "32" ]; then
|
||||
sudo find $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32 -name \*.ko -exec cp {} $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/ \;
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/Module.symvers $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/modules.builtin $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/modules.builtin.modinfo $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/modules.order $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
else
|
||||
sudo find $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64 -name \*.ko -exec cp {} $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/ \;
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/Module.symvers $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/modules.builtin $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/modules.builtin.modinfo $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/modules.order $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
fi
|
||||
sudo rm -rf $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo mkdir -p $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP
|
||||
|
||||
sudo rm -rf $SDCARD_DIR/rootfs/lib/modules/*dirty*
|
||||
sudo rm -rf $SDCARD_DIR/rootfs/root/kernel_modules
|
||||
if [ "$ARCH_OPTION_TMP" == "32" ]; then
|
||||
sudo find $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32 -name \*.ko -exec cp {} $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/ \;
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/Module.symvers $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/modules.builtin $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/modules.builtin.modinfo $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/modules.order $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
else
|
||||
sudo find $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64 -name \*.ko -exec cp {} $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/ \;
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/Module.symvers $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/modules.builtin $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/modules.builtin.modinfo $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/modules.order $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/
|
||||
fi
|
||||
|
||||
# sudo rm $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/axidmatest.ko -f
|
||||
# sudo rm $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/adi_axi_hdmi.ko -f
|
||||
done
|
||||
sudo rm -rf $SDCARD_DIR/rootfs/lib/modules/*dirty*
|
||||
sudo rm -rf $SDCARD_DIR/rootfs/root/kernel_modules
|
||||
|
||||
# sudo rm $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/axidmatest.ko -f
|
||||
# sudo rm $SDCARD_DIR/rootfs/root/kernel_modules$ARCH_OPTION_TMP/adi_axi_hdmi.ko -f
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
cd $SDCARD_DIR/BOOT
|
||||
sync
|
||||
|
@ -64,8 +64,10 @@ insert_check_module () {
|
||||
|
||||
print_usage
|
||||
|
||||
modprobe ad9361_drv
|
||||
modprobe xilinx_dma
|
||||
insmod ad9361_drv.ko
|
||||
insmod xilinx_dma.ko
|
||||
# modprobe ad9361_drv
|
||||
# modprobe xilinx_dma
|
||||
modprobe mac80211
|
||||
lsmod
|
||||
|
||||
@ -138,7 +140,6 @@ killall wpa_supplicant
|
||||
ifconfig sdr0 down
|
||||
|
||||
rmmod sdr
|
||||
# insert_check_module ./ ad9361_drv
|
||||
|
||||
if [ $DOWNLOAD_FLAG -eq 1 ]; then
|
||||
download_module fpga $TARGET_DIR
|
||||
@ -152,11 +153,6 @@ else
|
||||
fi
|
||||
|
||||
./rf_init_11n.sh
|
||||
# insert_check_module ./ xilinx_dma
|
||||
|
||||
# depmod
|
||||
# modprobe mac80211
|
||||
# lsmod
|
||||
|
||||
MODULE_ALL="tx_intf rx_intf openofdm_tx openofdm_rx xpu sdr"
|
||||
for MODULE in $MODULE_ALL
|
||||
|
Loading…
Reference in New Issue
Block a user