build/scripts/fel-hooks.sh.example
zador-blood-stained ba08617152 Cleanup
2016-08-09 18:26:22 +03:00

30 lines
1.2 KiB
Bash

#!/bin/bash
#
# fel-hooks.sh.example -- this file is an example how
# userpatches/fel-hooks.sh could be implemented.
#
# The following example assumes you use a Gembird power switch connected
# through USB to be able to power cycle the board you want to fel boot. You
# need the sispmctl package and use 'sispmctl -s' to get the ID of your
# power switch. And the fel_post_prepare function tries to adjust the
# boot environment for H3 boards on the fly.
fel_pre_load() {
# power cycle socket 1 of Gembird power switch
sispmctl -D01:01:51:23:cb -q -f1
# 5 seconds delay since PSUs don't like be being power cycled too fast
sleep 5
sispmctl -D01:01:51:23:cb -q -o1
# 3 seconds delay since the SoC has to initialise
sleep 3
} # fel_pre_load
fel_post_prepare() {
# This adds/adjusts necessary boot environment for H3 boards
if [ "$LINUXFAMILY" == "sun8i" ]; then
sed -i -e 's/\ disp.screen0_output_mode=1920x1080p60//' -e 's/\ hdmi.audio=EDID:0//' \
-e '1s/^/gpio set PL10\ngpio set PG11\nsetenv machid 1029\nsetenv bootm_boot_mode sec\n/' \
$FEL_ROOTFS/boot/boot.cmd
mkimage -C none -A arm -T script -d $FEL_ROOTFS/boot/boot.cmd $FEL_ROOTFS/boot/boot.scr > /dev/null
fi
} # fel_post_prepare