开机自启CPU设置定频

sudo apt-get install expect
sudo apt-get install cpufrequtils

具体步骤如下:

  1. 安装 cpufrequtils 工具
    ⚫ sudo apt-get install cpufrequtils
    ⚫ 需要联网下载
  2. 修改配置文件
    ⚫ sudo vi /etc/init.d/cpufrequtils
    ⚫ 将 GOVERNOR=“ondemand” 改为: > GOVERNOR=“performance”
    ⚫ 保存后执行如下命令即可生效: /etc/init.d/cpufrequtils restart
    ⚫ 修改此文件需要以 sudo 的权限执行
    2.1. 禁用 ondemand 守护程序
    ⚫ 将 sudo update-rc.d ondemand disabled

在这里插入图片描述

1.rc-local.service拷贝到/etc/systemd/system
2.root.sh 和 auto_service.sh 拷贝到/home/ztl/Documents
3.sudo chmod +x auto_service.sh root.sh
4.sudo systemctl enable rc-local.service
5.systemctl status rc-local.service

auto_service.sh RK3588

echo userspace > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor
echo 2016000 > /sys/devices/system/cpu/cpufreq/policy4/scaling_setspeed
echo userspace > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor
echo 2016000 > /sys/devices/system/cpu/cpufreq/policy6/scaling_setspeed
echo userspace > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo 1800000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_setspeed

auto_service.sh RK3399

echo user_space > /sys/class/thermal/thermal_zone0/policy #关闭温控
# 以rk3399为例,rk3399有两个核,一个A53,一个A72,这两个需要分开操作
# A53
echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor #切换变频策略
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies #查看支持哪些频率
echo 1512000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed #定频到1512000
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq #查看当前频率
# A72
echo userspace > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor #切换变频策略
cat /sys/devices/system/cpu/cpu4/cpufreq/scaling_available_frequencies #查看支持哪些频率
echo 1512000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_setspeed #定频到1512000
cat /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq #查看当前频率

rc-local.service

[Unit]
Description=service
[Service]
Type=forking
User=ztl
Restart=on-failure
RestartSec=60
LimitNOFILE=65535
ExecStart=/home/ztl/Documents/root.sh
ExecReload=/home/ztl/Documents/root.sh
[Install]
WantedBy=multi-user.target

root.sh

#!/usr/bin/expect

spawn sudo /home/ztl/Documents/auto_service.sh  #执行auto_service.sh
expect {
"password*"
	{
		send "root密码\r" 
	    exp_continue	
	}
}

udp丢包率设置socket缓存

参考

参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值