fwstamp=$( strings /usr/share/hwm-bw-rk3399/bootloader-firmware/*img | grep -E 'Slackware$' | tail -n1 | sed 's?^U-Boot ??g' | cut -d '-' -f1 | tr -d '(' | sed 's? ?_?g' | sed 's?_$??g' ) mkdir -vpm755 $fwstamp cp -fav /usr/share/hwm-bw-rk3399/bootloader-firmware/*img $fwstamp