Como alterar o comportamento de desligamento para o comportamento do modo de suspensão?

0

Estou usando o Ubuntu 14.0 para o sistema operacional.

Minha imagem é construída com o Yocto Project e usando o i.MX6 sabreSD como meu processador.

Aqui está o problema agora.

No meu sistema eu terei o comando "poweroff" para desligar minha máquina.

Mas agora estou tentando mudar o comando, quando eu executo o comando "poweroff" no sistema eu preciso que ele entre no modo sleep.

Este é o log quando eu executo o poweroff agora.

Stopping Authorization Manager...
[ OK ] Stopped target Graphical Interface.
Stopping Light Display M Stopping Session c2 of user root.
[ OK ] Stopped target Timers.
Stopping User Manager for UID 1001...
Stopping User Manager for UID 0...
Stopping Session c1 of user hermes.
Stopping Disk Manager...
[ OK ] Stopped Daily Cleanup of Temporary Directories.
[ OK ] Stopped target Multi-User System.
Stopping LSB: Start busybox udhcpd at boot time...
Stopping LSB: Starts and stops Wicd...
Stopping Avahi mDNS/DNS-SD Stack...
Stopping LSB: Advanced IEEE 802.11 management daemon...
Stopping LSB: set CPUFreq kernel parameters...
Stopping LSB: Apache2 web server...
Stopping Modem Manager...
Stopping System Logging Service...
Starting Unattended Upgrades...
[ OK ] Stopped target Login Prompts.
Stopping Serial Getty on ttymxc0...
Stopping Getty on tty1...
Stopping OpenBSD Secure Shell server...
Stopping Regular background program processing daemon...
[ OK ] Stopped Session c3 of user root.
Stopping D-Bus System Message Bus...
[ OK ] Stopped D-Bus System Message Bus.
[ OK ] Stopped Regular background program processing daemon.
[ OK ] Stopped OpenBSD Secure Shell server.
[ OK ] Stopped Modem Manager.
[ OK ] Stopped System Logging Service.
[ OK ] Stopped Avahi mDNS/DNS-SD Stack.
[ OK ] Stopped Authorization Manager.
[ OK ] Stopped Serial Getty on ttymxc0.
[ OK ] Stopped Getty on tty1.
[ OK ] Stopped Light Display Manager.
[ OK ] Stopped User Manager for UID 1001.
[ OK ] Stopped Disk Manager.
[ OK ] Stopped User Manager for UID 0.
[ OK ] Stopped Session c2 of user root.
[ OK ] Stopped Session c1 of user hermes.
[ OK ] Stopped LSB: Advanced IEEE 802.11 management daemon.
[ OK ] Stopped LSB: Start busybox udhcpd at boot time.
[ OK ] Stopped LSB: Starts and stops Wicd.
[ OK ] Started Unattended Upgrades.
[ OK ] Stopped LSB: set CPUFreq kernel parameters.
Stopping LSB: Load kernel modules needed to enable cpufreq scaling...
[ OK ] Removed slice User Slice of root.
[ OK ] Removed slice User Slice of hermes.
Stopping Login Service...
[ OK ] Removed slice system-getty.slice.
[ OK ] Stopped /etc/rc.local Compatibility.
Stopping Permit User Sessions...
[ OK ] Removed slice system-serial\x2dgetty.slice.
[ OK ] Stopped Login Service.
[ OK ] Stopped Permit User Sessions.
[ OK ] Stopped LSB: Load kernel modules needed to enable cpufreq scaling.
[ OK ] Stopped LSB: Apache2 web server.
[ OK ] Stopped target Remote File Systems.
[ OK ] Stopped target Remote File Systems (Pre).
[ OK ] Stopped target Basic System.
[ OK ] Stopped target Slices.
[ OK ] Removed slice User and Session Slice.
[ OK ] Stopped target Sockets.
[ OK ] Closed D-Bus System Message Bus Socket.
[ OK ] Closed Avahi mDNS/DNS-SD Stack Activation Socket.
[ OK ] Stopped target System Initialization.
Stopping LSB: NFS support files common to client and server...
Stopping Load/Save Random Seed...
[ OK ] Stopped target Encrypted Volumes.
[ OK ] Stopped target Swap.
Stopping Update UTMP about System Boot/Shutdown...
[ OK ] Closed Syslog Socket.
[ OK ] Stopped target Paths.
[ OK ] Stopped Forward Password Requests to Wall Directory Watch.
[ OK ] Stopped Dispatch Password Requests to Console Directory Watch.
[ OK ] Stopped Load/Save Random Seed.
[ OK ] Stopped Update UTMP about System Boot/Shutdown.
[ OK ] Unmounted /run/rpc_pipefs.
[ OK ] Stopped LSB: NFS support files common to client and server.
[ OK ] Stopped target RPC Port Mapper.
Stopping LSB: RPC portmapper replacement...
[ OK ] Stopped target System Time Synchronized.
Stopping Network Time Synchronization...
[ OK ] Stopped Network Time Synchronization.
[ OK ] Stopped Create Volatile Files and Directories.
[ OK ] Stopped LSB: RPC portmapper replacement.
[ OK ] Stopped target Network is Online.
[ OK ] Stopped target Network.
Stopping Raise network interfaces...
[ OK ] Stopped Raise network interfaces.
[ OK ] Stopped Apply Kernel Variables.
[ OK ] Stopped target Local File Systems.
Unmounting /run/user/1001...
Unmounting /run/user/0...
Unmounting /media/hermes/0075-5826...
[ OK ] Unmounted /run/user/1001.
[ OK ] Unmounted /run/user/0.
[ OK ] Unmounted /media/hermes/0075-5826.
[ OK ] Reached target Unmount All Filesystems.
[ OK ] Stopped target Local File Systems (Pre).
[ OK ] Stopped Create Static Device Nodes in /dev.
[ OK ] Stopped Remount Root and Kernel File Systems.
[ OK ] Reached target Shutdown.
systemd-shutdown[1]: Sending SIGTERM to remaining processes...
systemd-journald[178]: Received SIGTERM from PID 1 (systemd-shutdow).
systemd-shutdown[1]: Sending SIGKILL to remaining processes...
systemd-shutdown[1]: Unmounting file systems.
systemd-shutdown[1]: Remounting '/' read-only with options 'data=ordered'.
EXT4-fs (mmcblk3p2): re-mounted. Opts: data=ordered
systemd-shutdown[1]: Remounting '/' read-only with options 'data=ordered'.
EXT4-fs (mmcblk3p2): re-mounted. Opts: data=ordered
systemd-shutdown[1]: All filesystems unmounted.
systemd-shutdown[1]: Deactivating swaps.
systemd-shutdown[1]: All swaps deactivated.
systemd-shutdown[1]: Detaching loop devices.
systemd-shutdown[1]: All loop devices detached.
systemd-shutdown[1]: Detaching DM devices.
systemd-shutdown[1]: All DM devices detached.
systemd-shutdown[1]: Powering off
reboot: Power down

Eu tinha tentado encontrar o arquivo no driver linux, quando ele desligou ele vai rodar nesse arquivo "kernel / reboot.c".

E descobri que funcionará abaixo da função.

void kernel_power_off(void)
{
kernel_shutdown_prepare(SYSTEM_POWER_OFF);
if (pm_power_off_prepare)
pm_power_off_prepare();
migrate_to_reboot_cpu();
syscore_shutdown();
pr_emerg("winmate victor Power down\n");
kmsg_dump(KMSG_DUMP_POWEROFF);
machine_power_off();
}
EXPORT_SYMBOL_GPL(kernel_power_off);

E se eu marcar o conteúdo em kernel_power_off, haverá kernel panic quando eu executar "poweroff".

Como posso alterar o desligamento para o modo de suspensão?

Obrigado em Avançado!

    
por victor 01.03.2018 / 04:10

0 respostas