<commit_before>#!/bin/sh

export_f20x_uid_mac() {
	local count="$1"
	local uid_file="/sys/fsl_otp/HW_OCOTP_CFG1"
	local uid mac0 mac1 mac2 mac3
	local mac_base="b0c9"

	if [ -z "$count" ]; then
		echo "UNKNOWN COUNT"
		return 1
	fi
	if [ ! -e ${uid_file} ]; then
		echo "UNKNOWN UID FILE"
		return 2
	fi

	uid=$(cat ${uid_file})

	mac0="${uid:2:2}"
	mac1="${uid:4:2}"
	mac2="${uid:6:2}"
	mac3="${uid:8:2}"

	ret=""
	for i in $(seq ${count} -1 1)
	do
		mac_val="${mac_base:0:2}:${mac_base:2:2}:${mac0}:${mac1}:${mac2}:${mac3}"

		if [ -z "$ret" ]; then
			ret="${mac_val}"
		else
			ret="${ret} ${mac_val}"
		fi

		mac0_val=`expr ${mac0} + 1`
		mac0_val=$(( ${mac0_val} % 100 ))
		mac0=$(printf '%02d' ${mac0_val})
	done

	echo "${ret}"

	return 0
}

mac="$(export_f20x_uid_mac 2)"

echo ${mac}

write_mac.sh ${mac}

rm -f /mnt/sympad/device.lis

<commit_msg>factory-tlink: update F20X script for generating mac<commit_after>#!/bin/sh

export_f20x_uid_mac() {
	local count="$1"
	local uid_file="/sys/fsl_otp/HW_OCOTP_CFG1"
	local uid mac0 mac1 mac2 mac3 mac_val
	local mac_base="b0c9"

	if [ -z "$count" ]; then
		echo "UNKNOWN COUNT"
		return 1
	fi
	if [ ! -e ${uid_file} ]; then
		echo "UNKNOWN UID FILE"
		return 2
	fi

	uid=$(cat ${uid_file})

	mac0="${uid:2:2}"
	mac1="${uid:4:2}"
	mac2="${uid:6:2}"
	mac3="${uid:8:2}"

	ret=""
	for i in $(seq ${count} -1 1)
	do
		mac_val="${mac_base:0:2}:${mac_base:2:2}:${mac0}:${mac1}:${mac2}:${mac3}"

		if [ -z "$ret" ]; then
			ret="${mac_val}"
		else
			ret="${ret} ${mac_val}"
		fi

		mac0_val=`expr ${mac0} + 1`
		mac0_val=$(( ${mac0_val} % 100 ))
		mac0=$(printf '%02d' ${mac0_val})
	done

	echo "${ret}"

	return 0
}

mac_file="/sys/fsl_otp/HW_OCOTP_MAC0"
mac_0=$(cat ${mac_file})

if [ $mac_0 != "0x0" ]; then
	echo "MAC exists!"
	exit 0
fi

mac="$(export_f20x_uid_mac 2)"

echo ${mac}

write_mac.sh ${mac}

rm -f /mnt/sympad/device.lis


{'fraction_non_alphanumeric': 0.21927966101694915, 'fraction_numerical': 0.057203389830508475, 'mean_word_length': 4.050802139037433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '413893', 'n_tokens_mistral': 955, 'n_tokens_neox': 875, 'n_words': 186}