Toybrick

标题: 除了拔电源还有其他关机的方式吗 [打印本页]

作者: zjj19941024    时间: 2019-7-7 20:29
标题: 除了拔电源还有其他关机的方式吗
长按PWRON有时候可以有时候不可以
作者: lihh    时间: 2019-8-1 13:27
Linux 系统可以使用命令  shutdown   来关机
作者: wb4916    时间: 2024-5-31 09:11
lihh 发表于 2019-8-1 13:27
Linux 系统可以使用命令  shutdown   来关机

在Debian11下确认不可以!



toybrick@debian:~$
toybrick@debian:~$
toybrick@debian:~$ shutdown -h now
-bash: shutdown: command not found
toybrick@debian:~$ busybox shutdown -h now
shutdown: applet not found
toybrick@debian:~$ su
Password:
root@debian:/home/toybrick#
root@debian:/home/toybrick# shutdown -h now
bash: shutdown: command not found
root@debian:/home/toybrick#
root@debian:/home/toybrick# reboot -p
bash: reboot: command not found
root@debian:/home/toybrick# su
root@debian:/home/toybrick# su toybrick
toybrick@debian:~$
toybrick@debian:~$ reboot -p
bash: reboot: command not found
toybrick@debian:~$ busybox reboot -p
reboot: invalid option -- 'p'
BusyBox v1.30.1 (Debian 1:1.30.1-6+b3) multi-call binary.

Usage: reboot [-d DELAY] [-n] [-f]

Reboot the system

        -d SEC        Delay interval
        -n        Do not sync
        -f        Force (don't go through init)
toybrick@debian:~$
toybrick@debian:~$ busybox reboot -d 1
reboot: Operation not permitted
toybrick@debian:~$
toybrick@debian:~$ sudo busybox reboot -d 1
toybrick@debian:~$ [  143.922115] systemd[1]: systemd 247.3-7+deb11u4 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified)
[  143.923213] systemd[1]: Detected architecture arm64.
[  144.036302] systemd[1]: /lib/systemd/system/plymouth-start.service:16: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed.

toybrick@debian:~$





作者: jefferyzhang    时间: 2024-5-31 11:10
本帖最后由 jefferyzhang 于 2024-5-31 11:37 编辑

首先确认你板子有没有物理开关,有的话直接关就可以;
其次,Power按键是接在CPU上的一个IO,你给CPU发指令下电容易,下完电CPU没电了怎么接收你POWER按键指令开机呢。
逻辑上明显不合理。

实际上手机和平板等嵌入式设备并没有真正关机这个概念,他关机后通过变量启动停在uboot或者其他小系统,进入充电模式,等待接收power按键消息(甚至是组合键消息)后继续往下启动kernel和system。用户在这种情况下看到屏幕是黑的就认为已经关机。

这些全部都是需要软件去实现的。但我们开发板没有自带电池,无法维持这种状态。
所以这种定制化需求需要自行产品定义来开发实现。当然也可以外部再加一个MCU来控制开关机按钮,这种就浪费成本了。





欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3