Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] /etc//init.d init scripts in buildroot
@ 2017-07-14 10:16 Oscar Gomez Fuente
  2017-07-14 12:38 ` Peter Korsgaard
  0 siblings, 1 reply; 8+ messages in thread
From: Oscar Gomez Fuente @ 2017-07-14 10:16 UTC (permalink / raw)
  To: buildroot

Hi everyone,

I'm trying to use init scripts from /etc/init.d to activate one gpio just
before to halt my HW platform (a raspberry Pi): S00gpioff

I've created a script like this:

#!/bin/sh
#
# S00gpioff
#

GPIO_CMD_OFF=13

case "$1" in
start)
        echo $GPIO_CMD_OFF > /sys/class/gpio/export
        ;;
stop)
        echo "Activated CMD OFF output"
        echo 1 > /sys/class/gpio$GPIO_CMD_OFF/value
        ;;
*)
exit 1
;;

esac

The problem is I need to activate the gpio just before halt:

# halt
# Stopping dropbear sshd: OK
Stopping network...[  419.714234] smsc95xx 1-1.1:1.0 eth0: hardware isn't
capable of remote wakeup
ifdown: interface wlan0 not configured
Saving random seed... done.
Stopping logging: OK
Activated CMD OFF output <--------------------------------------------
umount: tmpfs busy - remounted read-only
umount: devpts busy - remounted read-only
umount: devtmpfs busy - remounted read-only
[  420.807391] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
The system is g[  420.816829] watchdog watchdog0: Watchdog timer stopped
oing down NOW!
Sent SIGTERM to all processes
Sent SIGKILL to all processes
Requesting system halt
[  422.818879] watchdog watchdog0: Watchdog timer stopped
[  422.824050] reboot: System halted

Does anyone how to delay a bit the activation of the GPIO?


Best regards.

Oscar Gomez Fuente.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170714/13266866/attachment.html>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-07-19 15:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-14 10:16 [Buildroot] /etc//init.d init scripts in buildroot Oscar Gomez Fuente
2017-07-14 12:38 ` Peter Korsgaard
2017-07-14 13:18   ` Thomas Petazzoni
2017-07-14 13:31     ` Peter Korsgaard
2017-07-14 13:31   ` Oscar Gomez Fuente
2017-07-14 13:42     ` Oscar Gomez Fuente
2017-07-19 15:00       ` Oscar Gomez Fuente
2017-07-19 15:03         ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox