Files
TowerOptoSifAndSpectral/dpkg/postinst
2025-11-27 18:50:16 +08:00

35 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
##安装完执行
echo "install airbornesystem ok"
sed -i '/\/root\/start/d' /etc/rc.local
sed -i '/^exit 0/i/root/start.sh &' /etc/rc.local
#sudo apt-get install -y timedatectl
timedatectl set-timezone Asia/Shanghai
date -R
sudo hwclock -w -f /dev/rtc1
#echo "/home/pi/AirbroneSystem/lib" > /etc/ld.so.conf.d/mylib.conf
#echo "/home/pi/AirbroneSystem/libreh" > /etc/ld.so.conf.d/mylib1.conf
## 获取系统内存信息,并提取总内存大小
#total_memory=$(free -m | awk 'NR==2{print $2}')
#
## 设置阈值3GB对应的是3072MB
#threshold=3072
#
## 判断总内存是否大于3GB
#if [ "$total_memory" -gt "$threshold" ]; then
# echo "Memory is greater than 3GB"
# rm /etc/udev/rules.d/12*
# echo 'ACTION=="add",KERNELS=="6-1:1.0",SUBSYSTEMS=="usb",MODE:="0777",SYMLINK+="ttySBGport"' > /etc/udev/rules.d/12-mybasem.rules
#else
# echo "Memory is not greater than 3GB Mybe M4B"
# rm /etc/udev/rules.d/12*
# echo 'ACTION=="add",KERNELS=="3-1:1.0",SUBSYSTEMS=="usb",MODE:="0777",SYMLINK+="ttySBGport"' > /etc/udev/rules.d/12-mybasem4b.rules
#
#fi
#
#
#
#
# ldconfig
#