2023-01-17 13:30:41 +00:00
|
|
|
#!/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
|
2023-02-03 15:26:09 +00:00
|
|
|
DTB_FILENAME="system.dtb"
|
2023-01-17 13:30:41 +00:00
|
|
|
else
|
|
|
|
IMAGE_FILENAME=uImage
|
2023-02-03 15:26:09 +00:00
|
|
|
DTB_FILENAME="devicetree.dtb"
|
2023-01-17 13:30:41 +00:00
|
|
|
fi
|
|
|
|
|
2023-01-30 12:48:50 +00:00
|
|
|
mv ./kernel_modules/ad9361_drv.ko ./openwifi/ -f || true
|
|
|
|
mv ./kernel_modules/adi_axi_hdmi.ko ./openwifi/ -f || true
|
|
|
|
mv ./kernel_modules/axidmatest.ko ./openwifi/ -f || true
|
|
|
|
mv ./kernel_modules/lcd.ko ./openwifi/ -f || true
|
|
|
|
mv ./kernel_modules/xilinx_dma.ko ./openwifi/ -f || true
|
2023-01-27 21:31:22 +00:00
|
|
|
|
2023-01-17 13:30:41 +00:00
|
|
|
rm -rf /lib/modules/$(uname -r)
|
2023-01-27 21:31:22 +00:00
|
|
|
ln -s /root/kernel_modules /lib/modules/$(uname -r)
|
2023-01-17 13:30:41 +00:00
|
|
|
|
|
|
|
depmod
|
|
|
|
|
|
|
|
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
|
2023-02-03 15:26:09 +00:00
|
|
|
if test -f "./kernel_modules/$DTB_FILENAME"; then
|
|
|
|
cp ./kernel_modules/$DTB_FILENAME /mnt/
|
|
|
|
fi
|
2023-01-17 13:30:41 +00:00
|
|
|
cd /mnt/
|
|
|
|
sync
|
|
|
|
cd ~
|
|
|
|
umount /mnt
|
|
|
|
|
|
|
|
reboot now
|