如何写个命令让他开机启动
Tofloor
poster avatar
feihong001
deepin
2018-03-26 01:52
Author
本帖最后由 feihong001 于 2018-3-25 17:59 编辑

我的笔记本不知为什么每次开机都要输入一下这两条命令才可以使用触摸板
sudo modprobe -r psmouse
sudo modprobe psmouse proto=imps每次关机一定要重新输入才可以使用,加入合起来的话有时也会不能使用 触摸板,网上试了很多方法都不行我想写个代码让他开机自动运行一遍这两条命令可以实现吗?

Reply Favorite View the author
All Replies
avatar
辉夜
deepin
2018-03-26 02:28
#1
脚本自启动
Reply View the author
avatar
feihong001
deepin
2018-03-26 03:36
#2

应该怎么写呀,小白不懂
Reply View the author
avatar
lulinux
deepin
2018-03-26 04:41
#3
了解一下rc.local
Reply View the author
avatar
字甲达宾
deepin
2018-03-26 05:25
#4
https://bbs.deepin.org/post/154658
应该怎么写呀,小白不懂

分三步操作:

1. 以 root 用户创建一个可执行的脚本程序:
暂定程序的文件名为 /usr/sbin/psmouse-patch.sh

命令:
  1. sudo gedit /usr/sbin/psmouse-patch.sh &
Copy the Code


在打的 gedit 文本编辑器中,加入以下3行内容

  1. #!/bin/sh
  2. modprobe -r psmouse
  3. modprobe psmouse proto=imps
Copy the Code


保存文件,并关闭。

2. 再给这个文件可执行权限:

  1. sudo chmod 755 /usr/sbin/psmouse-patch.sh
Copy the Code


755 的意思,可以理解为就是可以当成程序来执行

3. 在 /etc/profile 文件中,加入自动运行指令:

  1. sudo gedit  /etc/profile &
Copy the Code


在打开的文件的最后面,加入一行内容

  1. /usr/sbin/psmouse-patch.sh
Copy the Code


保存并退出。

下次重新启动,应该就可以了。


----------------

Reply View the author
Comments
sonichy
2018-03-26 06:32
学习......
avatar
aksss
deepin
2018-03-26 05:59
#5
Reply View the author
avatar
feihong001
deepin
2018-03-26 09:14
#6
https://bbs.deepin.org/post/154658
分三步操作:

1. 以 root 用户创建一个可执行的脚本程序:

/home/huangzuxiong/微信图片/微信图片_20180326005827.jpg
Reply View the author
avatar
feihong001
deepin
2018-03-26 09:24
#7
https://bbs.deepin.org/post/154658
分三步操作:

1. 以 root 用户创建一个可执行的脚本程序:

谢谢大佬指点,现在开机可以了,不过现在开机会显示一个提示框
Error found when loading/etc/profile:
modprobe:ERROR: ../libkmod/libkmod/libkmod-module.c:793 kmod_module_remove_module()could not remove'psmouse':Operation not permitted
As a result the session will not be configured correctly.
You should fix the problem as soon as feasible.
Reply View the author
avatar
feihong001
deepin
2018-03-26 09:29
#8
https://bbs.deepin.org/post/154658
分三步操作:

1. 以 root 用户创建一个可执行的脚本程序:

谢谢大佬回贴,虽然没有解决
Reply View the author
avatar
DebuggerX
deepin
2018-03-26 09:42
#9
个人推荐利用crontab的@reboot选项来启动一个自定义的脚本,然后所有想要开机执行的命令和脚本都放到那个自定义脚本里,方便统一管理,而且便于迁移
Reply View the author
avatar
feihong001
deepin
2018-03-26 10:16
#10
https://bbs.deepin.org/post/154658
个人推荐利用crontab的@reboot选项来启动一个自定义的脚本,然后所有想要开机执行的命令和脚本都放到那个自 ...

大神,那要怎么做呀?
Reply View the author
avatar
cattial
deepin
2018-03-27 19:58
#11
写个 conf文件放到放到modprobe.d里
Reply View the author
avatar
feihong001
deepin
2018-03-28 21:54
#12
https://bbs.deepin.org/post/154658
写个 conf文件放到放到modprobe.d里

怎么写,按照楼上的写法吗?
Reply View the author
avatar
cattial
deepin
2018-07-13 03:10
#13
https://bbs.deepin.org/post/154658
怎么写,按照楼上的写法吗?

options xxxxxx xxxxx
Reply View the author