#!/bin/bash # # fel-hooks.sh.example -- this file is an example how # userpatches/fel-hooks.sh could be implemented. Basics first: # https://github.com/igorpecovnik/lib/blob/master/documentation/fel-boot.md # # 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