openwifi/user_space/populate_kernel_image_module_reboot.sh
Xianjun Jiao b72abc1703 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/...)
2023-01-27 22:31:22 +01:00

46 lines
952 B
Bash
Executable File

#!/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
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)
ln -s /root/kernel_modules /lib/modules/$(uname -r)
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
cd /mnt/
sync
cd ~
umount /mnt
reboot now