#!/usr/bin/env bash set -xeuf -o pipefail UNAME_R="$(> "/boot/efi/uEnv.txt" sed -i "s/setenvrootdev/setenv rootdev \"${BOOT_PART}\"/" "/boot/efi/boot.cmd" mkimage -A arm -T ramdisk -C none -n uInitrd -d "/boot/initramfs-${UNAME_R}.img" "/boot/uInitrd-${UNAME_R}" mkimage -C none -A arm -T script -d /boot/efi/boot.cmd /boot/efi/boot.scr pushd /boot ln -s "uInitrd-${UNAME_R}" uInitrd popd