<commit_before>#!/bin/bash
set -e

if [ $# -lt 1 ] || [ $# -gt 2 ] ; then
    echo "USAGE <path to rootfs> [version]"
	exit 1
fi

set_fdt() {
    echo "fdt_file=/boot/dtbs/${1}.dtb" > ${2}/boot/uEnv.txt
}

ROOTFS=$1

VERSION=`cat "$ROOTFS/etc/wb-fw-version"` || die "Unable to get firmware version"
echo "FW version: $VERSION"

if [ ! -z "$2" ]; then
    VERSION=$2
    echo "FW version overriden: $VERSION"
fi

REVISIONS="52 55"
OUT_DIR="image/wb5/${VERSION}"
mkdir -p ${OUT_DIR}
for ver in ${REVISIONS}; do
    set_fdt imx28-wirenboard${ver} ${ROOTFS}
    IMG_NAME="${OUT_DIR}/${VERSION}_emmc_wb${ver}.img"
    WEBUPD_NAME="${OUT_DIR}/${VERSION}_webupd_wb${ver}.fit"

    rm -f ${IMG_NAME}
    ./create_image.sh mx28 ${ROOTFS} ../contrib/u-boot/u-boot.wb5.sd  ${IMG_NAME}
    zip ${IMG_NAME}.zip ${IMG_NAME}
    ./create_update.sh ${ROOTFS} ${WEBUPD_NAME}
done

echo "Done"
echo  ${OUT_DIR}

<commit_msg>restore old behaviour of the script<commit_after>#!/bin/bash
set -e

if [ $# -lt 2 ] || [ $# -gt 3 ] ; then
    echo "USAGE <path to rootfs> <tag> [fw version]"
	exit 1
fi

set_fdt() {
    echo "fdt_file=/boot/dtbs/${1}.dtb" > ${2}/boot/uEnv.txt
}

ROOTFS=$1
TAG=$2

VERSION=`cat "$ROOTFS/etc/wb-fw-version"` || die "Unable to get firmware version"
echo "FW version: $VERSION"

if [ ! -z "$3" ]; then
    VERSION=$3
    echo "FW version overriden: $VERSION"
fi


OUT_DIR="image/wb5/${VERSION}"
mkdir -p ${OUT_DIR}
IMG_NAME="${OUT_DIR}/${VERSION}_emmc_wb${TAG}.img"
WEBUPD_NAME="${OUT_DIR}/${VERSION}_webupd_wb${TAG}.fit"

rm -f ${IMG_NAME}
./create_image.sh mx28 ${ROOTFS} ../contrib/u-boot/u-boot.wb5.sd  ${IMG_NAME}
zip ${IMG_NAME}.zip ${IMG_NAME}
./create_update.sh ${ROOTFS} ${WEBUPD_NAME}

echo "Done"
echo  ${OUT_DIR}
{'fraction_non_alphanumeric': 0.2012724117987276, 'fraction_numerical': 0.017929438982070563, 'mean_word_length': 3.859550561797753, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '893139', 'n_tokens_mistral': 757, 'n_tokens_neox': 728, 'n_words': 159}