#!/bin/bash # supposedly needed for usb storage, but works anyway #/etc/init.d/S50usbdevice start #run only on first boot #if [ -e "/etc/.firstboot" ]; then # /usr/local/bin/femto-runonce.sh #fi #luckfox-config load # try enable RTC echo 'ds1307 0x68' | sudo tee /sys/class/i2c-adapter/i2c-3/new_device > /dev/null 2>&1 # activating USER LED echo 34 > /sys/class/gpio/export && echo out > /sys/class/gpio/gpio34/direction # necessary for internet over usb in otg mode (see https://web.archive.org/web/20241006173648/https://wiki.luckfox.com/Luckfox-Pico/Luckfox-Pico-Network-Sharing-1/) #sleep 5 && route add default gw 172.32.0.100 && echo "nameserver 8.8.8.8" >> /etc/resolv.conf # does not appear to lower power consumption, but needs more testing #(sleep 5 && cpufreq-set -u 408000 && echo "Boot complete, setting CPU frequency to 408mhz.") & # run USB automount and config tool #/usr/local/bin/femto-usb-config-tool.sh # boot complete #( # echo "Disabling ACT LED..." # echo "none" > /sys/class/leds/work/trigger & # sleep 1 # # # blink successful boot code # for i in $(seq 1 5); do # echo 1 > /sys/class/gpio/gpio34/value; # sleep 0.5; # echo 0 > /sys/class/gpio/gpio34/value; # sleep 0.5; # done #) & exit 0