#!/bin/sh # # Copyright (C) 2018 devolo AG # # Detect empty bootenv partition and populate it with default values. # This is necessary for fw_setenv to work properly, delos does not know the correct default bootenv otherwise. # (only zuse, turing, hamilton, auckland, hamming - all other devices should have a correct bootenv in the flash image) function get_baptization_config() { echo "$(baptization.config -k $1 | cut -d= -f2)" } function set_bootenv() { fw_setenv "$1" "$2" } DEVICETYPE="$(get_baptization_config DeviceType)" [ "$DEVICETYPE" = "zuse" ] || [ "$DEVICETYPE" = "turing" ] || [ "$DEVICETYPE" = "hamilton" ] || [ "$DEVICETYPE" = "auckland" ] || [ "$DEVICETYPE" = "hamming" ] || exit 0 [ -n "$(fw_printenv 2>&1 | grep '^Warning: Bad CRC')" ] || exit 0 cat <