免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: 383228273
打印 上一主题 下一主题

在笔记本电脑上用 Linux 系统的同胞们进来下~~~ [复制链接]

论坛徽章:
0
21 [报告]
发表于 2010-06-29 00:56 |只看该作者
本帖最后由 383228273 于 2010-06-29 01:27 编辑
  1. #! /bin/bash

  2. PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

  3. # 测试如果没有需要用到的文件就直接退出该脚本程序.
  4. [ -e '/proc/acpi/ibm/fan' ] && [ -e '/proc/acpi/ibm/thermal' ] || exit 0
  5. [ $(grep 'commands:' /proc/acpi/ibm/fan | wc -l) -eq '3' ] || exit 0

  6. # 下面 TEMP_1~10 为温度设置,其对应关系与 sensors 命令输出相同;
  7. # 高于设置温度则 FAN(风扇)设置为 auto 模式;
  8. # 低于设置温度则 FAN(风扇)设置为 1 运行等级.

  9. TEMP_01='45'        # CPU
  10. TEMP_02='45'        # ???
  11. TEMP_04='45'        # GPU
  12. TEMP_05='45'        # ???
  13. TEMP_07='45'        # ???
  14. TEMP_09='45'        # ???
  15. TEMP_10='45'        # ???

  16. SET_T="$TEMP_01 $TEMP_02 -128 $TEMP_04 $TEMP_05 -128 $TEMP_07 -128 $TEMP_09 $TEMP_10 -128 -128 -128 -128 -128 -128"
  17. SET_LEVEL=''

  18. # 用 SYS_T 变量获取当前系统的温度值.
  19. SYS_T=$(sed 's/temperatures:\t//g' /proc/acpi/ibm/thermal)

  20. # 用 SYS_LEVEL 变量获取当前系统散热风扇的运行等级.
  21. SYS_LEVEL=$(grep '^level' /proc/acpi/ibm/fan | sed 's/level:\t\t//g')

  22. # 定义 SHOW_SYS_SET 函数来显示设置温度和系统温度.
  23. SHOW_SYS_SET () {
  24.         echo $SET_T
  25.         echo $SYS_T
  26. }

  27. # 定义 SET_SYS_LEVEL 函数为 SET_LEVEL 变量设置运行等级参数.
  28. SET_SYS_LEVEL () {
  29.         I='1'
  30.         for T in $SET_T
  31.         do
  32.                 # 用 if 语句判断 SYS_T 变量中的温度值如果高于相对应的 SET_T 中设置的温度值,
  33.                 # 则 SET_LEVEL 变量设置为 'auto' 并 return 退出该函数,没必要再在继续比较了.
  34.                 if [ $(echo $SYS_T | cut -d ' ' -f $I) -gt $T ]; then
  35.                         [ 'auto' = $SYS_LEVEL ] || SET_LEVEL='auto'
  36.                         return
  37.                 fi
  38.                 I=$(($I+1))
  39.         done
  40.         # 如果没有被 for 中的 return 退出函数,顺利的走出了 for 循环来到这里,
  41.         # 则说明 SYS_T 中的温度值都低于相对应的 SET_T 的值,
  42.         # 则 SET_LEVEL 变量设置为 '1' 把风扇转速降下来.
  43.         SET_LEVEL='1'
  44. }

  45. # 定义 HELP 帮助函数
  46. _HELP () {
  47.         echo "
  48.         用法: $0 [选项]

  49.         可用选项:
  50.                 -t,--show-thermal        显示设置温度和系统温度
  51.                 -l,--show-level                显示该脚本设置风扇运行等级( level 1 或 level auto)
  52.                 -s,--set-level                比较设置温度和系统温度后设置风扇运行等级( level 1 或 level auto )
  53. "
  54.         exit 1
  55. }


  56. # 定义 MAIN 主函数
  57. _MAIN () {
  58.         case $1 in
  59.                 '-t' | '--show-thermal')
  60.                         SHOW_SYS_SET
  61.                         ;;
  62.                 '-l' | '--show-level')
  63.                         SET_SYS_LEVEL
  64.                         echo "level $SET_LEVEL"
  65.                         ;;
  66.                 '-s' | '--set-level')
  67.                         SET_SYS_LEVEL
  68.                         echo "level $SET_LEVEL" > /proc/acpi/ibm/fan
  69.                         ;;
  70.                 '-h' | '--help')
  71.                         _HELP
  72.                         ;;
  73.         esac
  74. }

  75. _MAIN $1
复制代码




改进了下,感觉还行 {:3_200:}
把这个散热风扇控制脚本加入 cron 中每几分钟就执行下,应该就行了吧 {:3_199:}

论坛徽章:
0
22 [报告]
发表于 2010-06-29 09:23 |只看该作者
呵呵

论坛徽章:
59
2015七夕节徽章
日期:2015-08-24 11:17:25ChinaUnix专家徽章
日期:2015-07-20 09:19:30每周论坛发贴之星
日期:2015-07-20 09:19:42ChinaUnix元老
日期:2015-07-20 11:04:38荣誉版主
日期:2015-07-20 11:05:19巳蛇
日期:2015-07-20 11:05:26CU十二周年纪念徽章
日期:2015-07-20 11:05:27IT运维版块每日发帖之星
日期:2015-07-20 11:05:34操作系统版块每日发帖之星
日期:2015-07-20 11:05:36程序设计版块每日发帖之星
日期:2015-07-20 11:05:40数据库技术版块每日发帖之星
日期:2015-07-20 11:05:432015年辞旧岁徽章
日期:2015-07-20 11:05:44
23 [报告]
发表于 2010-06-29 10:54 |只看该作者
本人还没有本本啊。只是在台式机里跑VMWARE。

论坛徽章:
0
24 [报告]
发表于 2010-06-29 11:03 |只看该作者
联想朝阳笔记本

电池满时xpsp2可用1.5小时,极限2.5小时;跑大型3D时cpu过热自动断电
红旗Linux7可以用2.5小时,极限4小时。不能很好的跑3D,风扇出口恒温不烫手

其余应该不用比了

论坛徽章:
0
25 [报告]
发表于 2010-06-29 18:31 |只看该作者

论坛徽章:
0
26 [报告]
发表于 2010-06-30 14:07 |只看该作者
回复 24# xiaoxiaou0


偏题了,不是电池用多久,只是想了解下电脑运行时,大伙们的机器各温度传感器的温度是多少? 和散热风扇的运行情况? {:3_200:}

来 CU 论坛同胞们,相信都已接触过 Linux 系统,但真正在自己电脑安装 Linux 系统并使用的人却很少,大部分同胞们都选择通过虚拟机来用或学习 Linux 系统。 {:3_198:}

论坛徽章:
0
27 [报告]
发表于 2010-06-30 14:18 |只看该作者
本帖最后由 383228273 于 2010-06-30 14:20 编辑

风扇运行等级为 1 时,有 1000RPM 多(在 2000RPM 以下)
风扇运行等级为 2 时,有 3000RPM 多(在 3500RPM 以下)
风扇运行等级为 3 时,有 3000RPM 多(在 3700RPM 左右)
... ...
一共有 0 ~ 7 个等级,后面的就没试了,如果设置为 auto 模式,我的散热风扇一般在 3300RPM 左右,风扇的运行等级应该是 2 吧;风扇到了 3000RPM 以上就听得到风扇呼呼的声音了,只有在 2000RPM 以下(运行等级为 1)时感觉安静,这样的散热能力又不够。

{:3_199:}

论坛徽章:
0
28 [报告]
发表于 2010-06-30 16:18 |只看该作者
Head of PMO (Asia Pacific) / Software Engineering 招聘


各位,最近我公司正在招聘软件项目管理人才,详情请看JD或咨询,如考虑者,请发一份个人简历到fankie.feng@c-russell.com   谢谢!
TITLE:                        Head of PMO (Asia Pacific) / Software Engineering
                                Manager
LOCATION:                Guangzhou, China

This is a senior appointment.  Our client is the IT arm of a famous global leader in the financial field.  They are looking for the Head of PMO to:

Introduction:

APAC PMO has three major responsibilities:
1.        Planning and Resource Management for the team in the region;
2.        Portfolio Management for the region;
3.        Align the strategy of Global PMO (GPMO) for the region.  Its vision is to instill the best Project Management methodologies in APAC region and enrich the core Project Management knowledge base.

Job Duties:

The job holder will have the following duties:
1.        Main conduit for the AOP process within the region;
2.        Interface relationship to HTSA PMO to align the business development direction and transparent the resource demand and supply;
3.        Govern APAC in-plan resource management to ensure the delivery of the division’s programmes, Regional Flagships and other project initiatives;
4.        Track and report APAC delivery teams’ budgets and resource capacity ensuring that resources are able to support the business demand, and is aligned with the business development direction;
5.        Provide in-plan guidance to the APAC delivery teams through active engagement and communication;
6.        Build a billable pool of project managers and project assistants;
7.        Carry out the GPMO initiatives to the PM community in APAC region;
8.        Obtain the pulse of the PM community in APAC region on the various GPMO initiatives, provide and carry out recommendations which will further incorporate GPMO within the division;
9.        Interact with the PM community in APAC region to understand their needs and working with the GPMO generate solutions for these needs;
10.        Drive the PM knowledge sharing in the PM community.                             

Key Requirements:

        Candidates should possess the following skills or qualification:
1.        Proven program/project and general management skills;
2.        Excellent written/verbal communication skills;
3.        Strong coordination skills;
4.        Good networking skill to build up relationships with key stakeholders rapidly;
5.        Strong sense on data;
6.        A detail person to analysis data in the mean while a big picture person to draw simple and accurate conclusion;
7.        Good presentation skill to prepare the report to Senior Management;
8.        Ability to work well under pressure;
9.        Project Management Professional (PMP) is definitely an advantage;
10.        Knowledge on the charge settlement system, i.e. Webplan/GPDM, Clarity and management information system i.e. GMIS is definitely an advantage.

论坛徽章:
0
29 [报告]
发表于 2010-07-01 09:14 |只看该作者
我的控制逻辑是这样的:
total=CPU+GPU+(无线网卡高于50度的部分,低于50则忽略不计)+(PCI高于50度的值,低于50则忽略不计)
1.初始状态是level 1
2.如果任意一个传感器的温度大于54度,忽略3和4,直接设置成auto
3.如果total大于98,设置为level 2
4.如果total大于90,并且当前风扇为非level 1,设置为level 2


也就是说,如果total曾经升高至98,导致fan level 2那么total必须降到90以下才会触发fan level 1
而从fan level 1 跃至fan level 2 的条件是total大于 98
这是为了避免频繁的level切换


一般机器负载不高的时候是规则1/3/4在起作用.负载高或者温度异常的时候规则2起作用..

论坛徽章:
0
30 [报告]
发表于 2010-07-01 11:57 |只看该作者
若果是用thinkpad 的, tp_thinkpad 可以控制.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP