diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/fw_saveenv b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/fw_saveenv deleted file mode 100755 index 8c51727..0000000 --- a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/fw_saveenv +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -# Uncomment the following line to get debug info -#set -xv - -source /usr/local/lib/utils - -fw_saveenv () { - - # Check arguments - if [ $# -ne 1 ]; then - die 1 "usage: fw_saveenv filename" - fi - - # Save the input file name - local input_file="${1}" - - # Read the fw_env config file - local config=$(sed -e 's/#.*$//' -e '/^$/d' /etc/fw_env.config) - set ${config} - local of=${1} - local seek=$((${2} / 1024)) - local count=$((${3} / 1024)) - - # Create 2 temporary files - local blob_file=$(mktemp /tmp/fw_saveenv.XXXXXX) - local env_file=$(mktemp /tmp/fw_saveenv.XXXXXX) - - # Convert the provided file to a null-terminated string blob - cat "${input_file}" | tr '\n' '\0' > ${blob_file} - - # Compute the blob length in bytes - set -- $(ls -l ${blob_file}) - local length=${5} - - # Compute the padding size in bytes - let padding=${count}*1024-4-${length} - - # Pad the blob file with zeros up to the total size - dd if=/dev/zero bs=1 count=${padding} >>${blob_file} 2>/dev/null - - # Compute the CRC32 for the padded blob and store it at the beginning of the env file - set $(cat ${blob_file} | gzip -1 | tail -c 8 | head -c 4 | hexdump -e '4/1 "%02X "') - printf "\\x$1\\x$2\\x$3\\x$4" > ${env_file} - - # Append the binary blob file to the env file - cat ${blob_file} >> ${env_file} - - # Write the final env file to the raw device - dd if=${env_file} of=${of} bs=1k count=${count} seek=${seek} 2>/dev/null - - # Remove the temporay files - rm ${blob_file} ${env_file} - return 0 -} - -fw_saveenv $* diff --git a/FunKey/configs/funkey_defconfig b/FunKey/configs/funkey_defconfig index 8f30de4..392c477 100644 --- a/FunKey/configs/funkey_defconfig +++ b/FunKey/configs/funkey_defconfig @@ -64,6 +64,7 @@ BR2_PACKAGE_GPTFDISK_SGDISK=y BR2_PACKAGE_PARTED=y BR2_PACKAGE_SYSSTAT=y BR2_PACKAGE_UBOOT_TOOLS=y +BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=y BR2_PACKAGE_LIBQRENCODE=y BR2_PACKAGE_LIBQRENCODE_TOOLS=y BR2_PACKAGE_LIBNL=y