openwifi/user_space/sdcard_boot_update.sh

63 lines
1.6 KiB
Bash
Raw Normal View History

2019-12-10 13:03:47 +00:00
#!/bin/bash
2020-03-04 18:39:12 +00:00
if [ "$#" -ne 1 ]; then
echo "You must enter the \$BOARD_NAME as argument"
2020-04-27 07:37:04 +00:00
echo "Like: adrv9364z7020 adrv9361z7035 zc706_fmcs2 zed_fmcs2 zc702_fmcs2 zcu102_fmcs2 zcu102_9371"
2020-03-04 18:39:12 +00:00
exit 1
fi
BOARD_NAME=$1
2020-04-27 07:37:04 +00:00
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
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
dtb_filename="system.dtb"
image_filepath="arch/arm64/boot/"
image_filename="Image"
LINUX_KERNEL_SRC_DIR_NAME=adi-linux-64
else
dtb_filename="devicetree.dtb"
image_filepath="arch/arm/boot/"
image_filename="uImage"
LINUX_KERNEL_SRC_DIR_NAME=adi-linux
fi
echo $dtb_filename
echo $image_filepath
echo $image_filename
2019-12-10 13:03:47 +00:00
set -x
rm BOOT.BIN
sync
2020-03-04 18:39:12 +00:00
wget ftp://192.168.10.1/kernel_boot/boards/$BOARD_NAME/output_boot_bin/BOOT.BIN
2019-12-10 13:03:47 +00:00
sync
2020-04-27 07:37:04 +00:00
rm $image_filename
2019-12-10 13:03:47 +00:00
sync
2020-04-27 07:37:04 +00:00
wget ftp://192.168.10.1/$LINUX_KERNEL_SRC_DIR_NAME/$image_filepath/$image_filename
2019-12-10 13:03:47 +00:00
sync
2020-04-27 07:37:04 +00:00
rm $dtb_filename
2019-12-10 13:03:47 +00:00
sync
2020-04-27 07:37:04 +00:00
wget ftp://192.168.10.1/kernel_boot/boards/$BOARD_NAME/$dtb_filename
2019-12-10 13:03:47 +00:00
sync
#slepp 0.5
2020-03-04 18:39:12 +00:00
mount /dev/mmcblk0p1 /mnt
2019-12-10 13:03:47 +00:00
sync
#sleep 0.5
2020-03-04 18:39:12 +00:00
cp BOOT.BIN /mnt/ -f
2020-04-27 07:37:04 +00:00
rm /mnt/Image -f
rm /mnt/uImage -f
cp $image_filename /mnt/ -f
rm /mnt/*.dtb -f
cp $dtb_filename /mnt/ -f
cd /mnt/
sync
cd ~
2019-12-10 13:03:47 +00:00
#sleep 0.5
2020-03-04 18:39:12 +00:00
umount /mnt
2019-12-10 13:03:47 +00:00
sync
#sleep 3
sudo reboot now