2016-07-26 14:01:58 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
echo "Replace ONIE reboot with Dell reset commands"
|
|
|
|
|
|
|
|
# set I2C GPIO mux
|
|
|
|
echo 1 > /sys/class/gpio/export
|
|
|
|
echo 2 > /sys/class/gpio/export
|
|
|
|
echo out > /sys/class/gpio/gpio1/direction
|
|
|
|
echo out > /sys/class/gpio/gpio2/direction
|
|
|
|
echo 0 > /sys/class/gpio/gpio1/value
|
|
|
|
echo 0 > /sys/class/gpio/gpio2/value
|
|
|
|
|
|
|
|
# replace the original reboot binary with the following command
|
2016-09-14 19:08:05 -05:00
|
|
|
# sync flushes file system buffers
|
|
|
|
# i2cset command triggers a hard system reboot, required by ASIC to operate correctly
|
2016-07-26 14:01:58 -05:00
|
|
|
rm /sbin/reboot
|
2016-09-12 19:49:15 -05:00
|
|
|
cat <<EOF >> /sbin/reboot
|
|
|
|
#!/bin/sh
|
|
|
|
sync
|
|
|
|
i2cset -y 0 0x31 1 0xfd
|
|
|
|
EOF
|
|
|
|
|
2016-07-26 14:01:58 -05:00
|
|
|
chmod a+x /sbin/reboot
|