diff --git a/Original Firmwares/v4.1.0.359-b87.191101.0940/UF-ONU.UF-INSTANT.v4.1.0.359-b87.191101.0940.img b/Original Firmwares/v4.1.0.359-b87.191101.0940/UF-ONU.UF-INSTANT.v4.1.0.359-b87.191101.0940.img new file mode 100644 index 0000000..f543263 Binary files /dev/null and b/Original Firmwares/v4.1.0.359-b87.191101.0940/UF-ONU.UF-INSTANT.v4.1.0.359-b87.191101.0940.img differ diff --git a/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/fwu.sh b/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/fwu.sh new file mode 100755 index 0000000..fae76e3 --- /dev/null +++ b/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/fwu.sh @@ -0,0 +1,102 @@ +#!/bin/sh + +# luna firmware upgrade script +# $1 image destination (0 or 1) +# Kernel and root file system images are assumed to be located at the same directory named uImage and rootfs respectively +# ToDo: use arugements to refer to kernel/rootfs location. + +k_img="uImage" +r_img="rootfs" +img_ver="fwu_ver" +md5_cmp="md5.txt" +md5_cmd="/bin/md5sum" +#md5 run-time result +md5_tmp="md5_tmp" +md5_rt_result="md5_rt_result.txt" + +# Stop this script upon any error +#set -e + +echo "Updating image $1 with file $2 offset $3" +img=$2 +img_offset=$3 + +# Find out kernel/rootfs mtd partition according to image destination +k_mtd="/dev/"`cat /proc/mtd | grep \"k"$1"\" | sed 's/:.*$//g'` +r_mtd="/dev/"`cat /proc/mtd | grep \"r"$1"\" | sed 's/:.*$//g'` +echo "kernel image is located at $k_mtd" +echo "rootfs image is located at $r_mtd" + +# Extract kernel image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O | md5sum | sed 's/-/'$k_img'/g' > $md5_rt_result +# Check integrity +grep $k_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + echo "$k_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract rootfs image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O | md5sum | sed 's/-/'$r_img'/g' > $md5_rt_result +# Check integrity +grep $r_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + # rm $r_img + echo "$r_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +echo "Integrity of $k_img & $r_img is okay, start updating" + +k_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $k_img | awk '{print $3}') +r_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $r_img | awk '{print $3}') + +echo "$k_img size $k_img_size_dec, $r_img size $r_img_size_dec" + +if [ -z "$k_img_size_dec" -o -z "$r_img_size_dec" ]; then + echo "Invalid sizes" + exit 1 +fi + +erase_mtd() +{ + # get erase block size and test support of -x argument + eb_size=$(flash_erase -q -x -s $1 0 1 2>/dev/null) + if [ $? -eq 0 ]; then + erase_args=-x + else + erase_args= + eb_size=4096 + fi + + flash_erase $erase_args $1 0 $(((($2 - 1) / $eb_size) + 1)) +} + +# Erase kernel partition +erase_mtd $k_mtd $k_img_size_dec +# Write kernel partition +echo "Writing $k_img to $k_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O > $k_mtd + +# Erase rootfs partition +erase_mtd $r_mtd $r_img_size_dec +# Write rootfs partition +echo "Writing $r_img to $r_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O > $r_mtd + + +# Write image version information +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $img_ver +nv setenv sw_version"$1" "`cat $img_ver`" + +# Clean up temporary files +rm -f $md5_cmp $md5_tmp $md5_rt_result $img_ver $2 + +# Post processing (for future extension consideration) + +echo "Successfully updated image $1!!" + diff --git a/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/fwu_ver b/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/fwu_ver new file mode 100644 index 0000000..3de199a --- /dev/null +++ b/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/fwu_ver @@ -0,0 +1 @@ +v4.1.0.359-b87.191101.0940 diff --git a/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/md5.txt b/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/md5.txt new file mode 100644 index 0000000..ba7992f --- /dev/null +++ b/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/md5.txt @@ -0,0 +1,4 @@ +0829b8500c38b2d77fedf70efdfdf4f0 fwu.sh +3b6d0a970f181ef04c0145d8d4e10e1d rootfs +d1fb3d2a83be1d734cfa3b5d713e3d4f uImage +0d36ffa33ab69151f38370ab9e38436f fwu_ver diff --git a/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/rootfs b/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/rootfs new file mode 100755 index 0000000..03672c8 Binary files /dev/null and b/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/rootfs differ diff --git a/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/uImage b/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/uImage new file mode 100644 index 0000000..683b6db Binary files /dev/null and b/Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/uImage differ diff --git a/Original Firmwares/v4.3.0.810-29d.210105.1122/UF-ONU.UF-INSTANT.v4.3.0.810-29d.210105.1122.img b/Original Firmwares/v4.3.0.810-29d.210105.1122/UF-ONU.UF-INSTANT.v4.3.0.810-29d.210105.1122.img new file mode 100644 index 0000000..4468d96 Binary files /dev/null and b/Original Firmwares/v4.3.0.810-29d.210105.1122/UF-ONU.UF-INSTANT.v4.3.0.810-29d.210105.1122.img differ diff --git a/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/fwu.sh b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/fwu.sh new file mode 100755 index 0000000..63edd86 --- /dev/null +++ b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/fwu.sh @@ -0,0 +1,133 @@ +#!/bin/sh + +# luna firmware upgrade script +# $1 image destination (0 or 1) +# Kernel and root file system images are assumed to be located at the same directory named uImage and rootfs respectively +# ToDo: use arugements to refer to kernel/rootfs location. + +k_img="uImage" +r_img="rootfs" +u_img="plr.img" +img_ver="fwu_ver" +md5_cmp="md5.txt" +md5_cmd="/bin/md5sum" +#md5 run-time result +md5_tmp="md5_tmp" +md5_rt_result="md5_rt_result.txt" + +# Stop this script upon any error +#set -e + +echo "Updating image $1 with file $2 offset $3" +img=$2 +img_offset=$3 + +# Find out kernel/rootfs mtd partition according to image destination +k_mtd="/dev/"`cat /proc/mtd | grep \"k"$1"\" | sed 's/:.*$//g'` +r_mtd="/dev/"`cat /proc/mtd | grep \"r"$1"\" | sed 's/:.*$//g'` +u_mtd="/dev/mtd0" +echo "kernel image is located at $k_mtd" +echo "rootfs image is located at $r_mtd" + +k_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $k_img | awk '{print $3}') +r_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $r_img | awk '{print $3}') +u_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $u_img | awk '{print $3}') +echo "$k_img size $k_img_size_dec, $r_img size $r_img_size_dec, $u_img size $u_img_size_dec" + +if [ -z "$k_img_size_dec" -o -z "$r_img_size_dec" ]; then + echo "Invalid sizes" + exit 1 +fi + +# Extract kernel image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O | md5sum | sed 's/-/'$k_img'/g' > $md5_rt_result +# Check integrity +grep $k_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + echo "$k_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract rootfs image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O | md5sum | sed 's/-/'$r_img'/g' > $md5_rt_result +# Check integrity +grep $r_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + # rm $r_img + echo "$r_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract uboot image +if [ -n "$u_img_size_dec" ]; then + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + # Check integrity + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "$u_img""md5_sum inconsistent, aborted image updating !" + exit 1 + fi +fi + +echo "Integrity of $k_img & $r_img is okay, start updating" + +erase_mtd() +{ + # get erase block size and test support of -x argument + eb_size=$(flash_erase -q -x -s $1 0 1 2>/dev/null) + if [ $? -eq 0 ]; then + erase_args=-x + else + erase_args= + eb_size=4096 + fi + + flash_erase $erase_args $1 0 $(((($2 - 1) / $eb_size) + 1)) +} + +# Upgrade uboot +if [ -n "$u_img_size_dec" ]; then + echo "Checking uboot version" + dd if=$u_mtd bs=$u_img_size_dec count=1 2>/dev/null | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "Upgrading uboot" + erase_mtd $u_mtd $u_img_size_dec + echo "Writing $u_img to $u_mtd" + #dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O |wc -c + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O > $u_mtd + else + echo "Uboot is up to date" + fi +fi + +# Erase kernel partition +erase_mtd $k_mtd $k_img_size_dec +# Write kernel partition +echo "Writing $k_img to $k_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O > $k_mtd + +# Erase rootfs partition +erase_mtd $r_mtd $r_img_size_dec +# Write rootfs partition +echo "Writing $r_img to $r_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O > $r_mtd + + +# Write image version information +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $img_ver +nv setenv sw_version"$1" "`cat $img_ver`" + +# Clean up temporary files +rm -f $md5_cmp $md5_tmp $md5_rt_result $img_ver $2 + +# Post processing (for future extension consideration) + +echo "Successfully updated image $1!!" + diff --git a/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/fwu_ver b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/fwu_ver new file mode 100644 index 0000000..b577456 --- /dev/null +++ b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/fwu_ver @@ -0,0 +1 @@ +v4.3.0.810-29d.210105.1122 diff --git a/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/md5.txt b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/md5.txt new file mode 100644 index 0000000..076dc40 --- /dev/null +++ b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/md5.txt @@ -0,0 +1,5 @@ +c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh +3acab9b33e06f4550a26092193ce59fd rootfs +29c13d96dc536e815c9f590293db4c2b uImage +1c28aad0bdf10dbd22c8c8499e30b5e4 fwu_ver +1041797d8f2c31e294c1ff1f7517caef plr.img diff --git a/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/plr.img b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/plr.img new file mode 100644 index 0000000..a924c7c Binary files /dev/null and b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/plr.img differ diff --git a/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/rootfs b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/rootfs new file mode 100755 index 0000000..9428e5f Binary files /dev/null and b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/rootfs differ diff --git a/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/uImage b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/uImage new file mode 100644 index 0000000..4863bb6 Binary files /dev/null and b/Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/uImage differ diff --git a/Original Firmwares/v4.3.1.913-d48.210415.0811/extracted/fwu.sh b/Original Firmwares/v4.3.1.913-d48.210415.0811/extracted/fwu.sh new file mode 100755 index 0000000..63edd86 --- /dev/null +++ b/Original Firmwares/v4.3.1.913-d48.210415.0811/extracted/fwu.sh @@ -0,0 +1,133 @@ +#!/bin/sh + +# luna firmware upgrade script +# $1 image destination (0 or 1) +# Kernel and root file system images are assumed to be located at the same directory named uImage and rootfs respectively +# ToDo: use arugements to refer to kernel/rootfs location. + +k_img="uImage" +r_img="rootfs" +u_img="plr.img" +img_ver="fwu_ver" +md5_cmp="md5.txt" +md5_cmd="/bin/md5sum" +#md5 run-time result +md5_tmp="md5_tmp" +md5_rt_result="md5_rt_result.txt" + +# Stop this script upon any error +#set -e + +echo "Updating image $1 with file $2 offset $3" +img=$2 +img_offset=$3 + +# Find out kernel/rootfs mtd partition according to image destination +k_mtd="/dev/"`cat /proc/mtd | grep \"k"$1"\" | sed 's/:.*$//g'` +r_mtd="/dev/"`cat /proc/mtd | grep \"r"$1"\" | sed 's/:.*$//g'` +u_mtd="/dev/mtd0" +echo "kernel image is located at $k_mtd" +echo "rootfs image is located at $r_mtd" + +k_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $k_img | awk '{print $3}') +r_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $r_img | awk '{print $3}') +u_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $u_img | awk '{print $3}') +echo "$k_img size $k_img_size_dec, $r_img size $r_img_size_dec, $u_img size $u_img_size_dec" + +if [ -z "$k_img_size_dec" -o -z "$r_img_size_dec" ]; then + echo "Invalid sizes" + exit 1 +fi + +# Extract kernel image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O | md5sum | sed 's/-/'$k_img'/g' > $md5_rt_result +# Check integrity +grep $k_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + echo "$k_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract rootfs image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O | md5sum | sed 's/-/'$r_img'/g' > $md5_rt_result +# Check integrity +grep $r_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + # rm $r_img + echo "$r_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract uboot image +if [ -n "$u_img_size_dec" ]; then + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + # Check integrity + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "$u_img""md5_sum inconsistent, aborted image updating !" + exit 1 + fi +fi + +echo "Integrity of $k_img & $r_img is okay, start updating" + +erase_mtd() +{ + # get erase block size and test support of -x argument + eb_size=$(flash_erase -q -x -s $1 0 1 2>/dev/null) + if [ $? -eq 0 ]; then + erase_args=-x + else + erase_args= + eb_size=4096 + fi + + flash_erase $erase_args $1 0 $(((($2 - 1) / $eb_size) + 1)) +} + +# Upgrade uboot +if [ -n "$u_img_size_dec" ]; then + echo "Checking uboot version" + dd if=$u_mtd bs=$u_img_size_dec count=1 2>/dev/null | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "Upgrading uboot" + erase_mtd $u_mtd $u_img_size_dec + echo "Writing $u_img to $u_mtd" + #dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O |wc -c + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O > $u_mtd + else + echo "Uboot is up to date" + fi +fi + +# Erase kernel partition +erase_mtd $k_mtd $k_img_size_dec +# Write kernel partition +echo "Writing $k_img to $k_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O > $k_mtd + +# Erase rootfs partition +erase_mtd $r_mtd $r_img_size_dec +# Write rootfs partition +echo "Writing $r_img to $r_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O > $r_mtd + + +# Write image version information +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $img_ver +nv setenv sw_version"$1" "`cat $img_ver`" + +# Clean up temporary files +rm -f $md5_cmp $md5_tmp $md5_rt_result $img_ver $2 + +# Post processing (for future extension consideration) + +echo "Successfully updated image $1!!" + diff --git a/Original Firmwares/v4.3.1.913-d48.210415.0811/extracted/fwu_ver b/Original Firmwares/v4.3.1.913-d48.210415.0811/extracted/fwu_ver new file mode 100644 index 0000000..aed8857 --- /dev/null +++ b/Original Firmwares/v4.3.1.913-d48.210415.0811/extracted/fwu_ver @@ -0,0 +1 @@ +v4.3.1.913-d48.210415.0811 diff --git a/Original Firmwares/v4.3.1.913-d48.210415.0811/extracted/md5.txt b/Original Firmwares/v4.3.1.913-d48.210415.0811/extracted/md5.txt new file mode 100644 index 0000000..f8e48f0 --- /dev/null +++ b/Original Firmwares/v4.3.1.913-d48.210415.0811/extracted/md5.txt @@ -0,0 +1,5 @@ +c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh +df5cef2909ac7391df86c98ad01297ef rootfs +28c02939cae41a2752cea677f1075b85 uImage +c5718e8819a8593a7e0fba3c08deef03 fwu_ver +1041797d8f2c31e294c1ff1f7517caef plr.img diff --git a/Original Firmwares/v4.4.0.1118-2f5.211102.0822/UF-ONU.UF-INSTANT.v4.4.0.1118-2f5.211102.0822.img b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/UF-ONU.UF-INSTANT.v4.4.0.1118-2f5.211102.0822.img new file mode 100644 index 0000000..5227ce7 Binary files /dev/null and b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/UF-ONU.UF-INSTANT.v4.4.0.1118-2f5.211102.0822.img differ diff --git a/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/fwu.sh b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/fwu.sh new file mode 100755 index 0000000..63edd86 --- /dev/null +++ b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/fwu.sh @@ -0,0 +1,133 @@ +#!/bin/sh + +# luna firmware upgrade script +# $1 image destination (0 or 1) +# Kernel and root file system images are assumed to be located at the same directory named uImage and rootfs respectively +# ToDo: use arugements to refer to kernel/rootfs location. + +k_img="uImage" +r_img="rootfs" +u_img="plr.img" +img_ver="fwu_ver" +md5_cmp="md5.txt" +md5_cmd="/bin/md5sum" +#md5 run-time result +md5_tmp="md5_tmp" +md5_rt_result="md5_rt_result.txt" + +# Stop this script upon any error +#set -e + +echo "Updating image $1 with file $2 offset $3" +img=$2 +img_offset=$3 + +# Find out kernel/rootfs mtd partition according to image destination +k_mtd="/dev/"`cat /proc/mtd | grep \"k"$1"\" | sed 's/:.*$//g'` +r_mtd="/dev/"`cat /proc/mtd | grep \"r"$1"\" | sed 's/:.*$//g'` +u_mtd="/dev/mtd0" +echo "kernel image is located at $k_mtd" +echo "rootfs image is located at $r_mtd" + +k_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $k_img | awk '{print $3}') +r_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $r_img | awk '{print $3}') +u_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $u_img | awk '{print $3}') +echo "$k_img size $k_img_size_dec, $r_img size $r_img_size_dec, $u_img size $u_img_size_dec" + +if [ -z "$k_img_size_dec" -o -z "$r_img_size_dec" ]; then + echo "Invalid sizes" + exit 1 +fi + +# Extract kernel image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O | md5sum | sed 's/-/'$k_img'/g' > $md5_rt_result +# Check integrity +grep $k_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + echo "$k_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract rootfs image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O | md5sum | sed 's/-/'$r_img'/g' > $md5_rt_result +# Check integrity +grep $r_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + # rm $r_img + echo "$r_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract uboot image +if [ -n "$u_img_size_dec" ]; then + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + # Check integrity + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "$u_img""md5_sum inconsistent, aborted image updating !" + exit 1 + fi +fi + +echo "Integrity of $k_img & $r_img is okay, start updating" + +erase_mtd() +{ + # get erase block size and test support of -x argument + eb_size=$(flash_erase -q -x -s $1 0 1 2>/dev/null) + if [ $? -eq 0 ]; then + erase_args=-x + else + erase_args= + eb_size=4096 + fi + + flash_erase $erase_args $1 0 $(((($2 - 1) / $eb_size) + 1)) +} + +# Upgrade uboot +if [ -n "$u_img_size_dec" ]; then + echo "Checking uboot version" + dd if=$u_mtd bs=$u_img_size_dec count=1 2>/dev/null | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "Upgrading uboot" + erase_mtd $u_mtd $u_img_size_dec + echo "Writing $u_img to $u_mtd" + #dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O |wc -c + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O > $u_mtd + else + echo "Uboot is up to date" + fi +fi + +# Erase kernel partition +erase_mtd $k_mtd $k_img_size_dec +# Write kernel partition +echo "Writing $k_img to $k_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O > $k_mtd + +# Erase rootfs partition +erase_mtd $r_mtd $r_img_size_dec +# Write rootfs partition +echo "Writing $r_img to $r_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O > $r_mtd + + +# Write image version information +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $img_ver +nv setenv sw_version"$1" "`cat $img_ver`" + +# Clean up temporary files +rm -f $md5_cmp $md5_tmp $md5_rt_result $img_ver $2 + +# Post processing (for future extension consideration) + +echo "Successfully updated image $1!!" + diff --git a/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/fwu_ver b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/fwu_ver new file mode 100644 index 0000000..a28ee32 --- /dev/null +++ b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/fwu_ver @@ -0,0 +1 @@ +v4.4.0.1118-2f5.211102.0822 diff --git a/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/md5.txt b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/md5.txt new file mode 100644 index 0000000..9861fb3 --- /dev/null +++ b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/md5.txt @@ -0,0 +1,5 @@ +c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh +d8ba4477de5399ab7e714602a6c4c1aa rootfs +5375853973963e9144e5f45d8a160112 uImage +56ae3075c085202dc89f35903edeeb37 fwu_ver +1041797d8f2c31e294c1ff1f7517caef plr.img diff --git a/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/plr.img b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/plr.img new file mode 100644 index 0000000..a924c7c Binary files /dev/null and b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/plr.img differ diff --git a/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/rootfs b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/rootfs new file mode 100755 index 0000000..f761070 Binary files /dev/null and b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/rootfs differ diff --git a/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/uImage b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/uImage new file mode 100644 index 0000000..6fdbd7e Binary files /dev/null and b/Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/uImage differ diff --git a/Original Firmwares/v4.4.2.1248-550.220304.1317/extracted/fwu.sh b/Original Firmwares/v4.4.2.1248-550.220304.1317/extracted/fwu.sh new file mode 100755 index 0000000..63edd86 --- /dev/null +++ b/Original Firmwares/v4.4.2.1248-550.220304.1317/extracted/fwu.sh @@ -0,0 +1,133 @@ +#!/bin/sh + +# luna firmware upgrade script +# $1 image destination (0 or 1) +# Kernel and root file system images are assumed to be located at the same directory named uImage and rootfs respectively +# ToDo: use arugements to refer to kernel/rootfs location. + +k_img="uImage" +r_img="rootfs" +u_img="plr.img" +img_ver="fwu_ver" +md5_cmp="md5.txt" +md5_cmd="/bin/md5sum" +#md5 run-time result +md5_tmp="md5_tmp" +md5_rt_result="md5_rt_result.txt" + +# Stop this script upon any error +#set -e + +echo "Updating image $1 with file $2 offset $3" +img=$2 +img_offset=$3 + +# Find out kernel/rootfs mtd partition according to image destination +k_mtd="/dev/"`cat /proc/mtd | grep \"k"$1"\" | sed 's/:.*$//g'` +r_mtd="/dev/"`cat /proc/mtd | grep \"r"$1"\" | sed 's/:.*$//g'` +u_mtd="/dev/mtd0" +echo "kernel image is located at $k_mtd" +echo "rootfs image is located at $r_mtd" + +k_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $k_img | awk '{print $3}') +r_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $r_img | awk '{print $3}') +u_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $u_img | awk '{print $3}') +echo "$k_img size $k_img_size_dec, $r_img size $r_img_size_dec, $u_img size $u_img_size_dec" + +if [ -z "$k_img_size_dec" -o -z "$r_img_size_dec" ]; then + echo "Invalid sizes" + exit 1 +fi + +# Extract kernel image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O | md5sum | sed 's/-/'$k_img'/g' > $md5_rt_result +# Check integrity +grep $k_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + echo "$k_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract rootfs image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O | md5sum | sed 's/-/'$r_img'/g' > $md5_rt_result +# Check integrity +grep $r_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + # rm $r_img + echo "$r_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract uboot image +if [ -n "$u_img_size_dec" ]; then + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + # Check integrity + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "$u_img""md5_sum inconsistent, aborted image updating !" + exit 1 + fi +fi + +echo "Integrity of $k_img & $r_img is okay, start updating" + +erase_mtd() +{ + # get erase block size and test support of -x argument + eb_size=$(flash_erase -q -x -s $1 0 1 2>/dev/null) + if [ $? -eq 0 ]; then + erase_args=-x + else + erase_args= + eb_size=4096 + fi + + flash_erase $erase_args $1 0 $(((($2 - 1) / $eb_size) + 1)) +} + +# Upgrade uboot +if [ -n "$u_img_size_dec" ]; then + echo "Checking uboot version" + dd if=$u_mtd bs=$u_img_size_dec count=1 2>/dev/null | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "Upgrading uboot" + erase_mtd $u_mtd $u_img_size_dec + echo "Writing $u_img to $u_mtd" + #dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O |wc -c + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O > $u_mtd + else + echo "Uboot is up to date" + fi +fi + +# Erase kernel partition +erase_mtd $k_mtd $k_img_size_dec +# Write kernel partition +echo "Writing $k_img to $k_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O > $k_mtd + +# Erase rootfs partition +erase_mtd $r_mtd $r_img_size_dec +# Write rootfs partition +echo "Writing $r_img to $r_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O > $r_mtd + + +# Write image version information +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $img_ver +nv setenv sw_version"$1" "`cat $img_ver`" + +# Clean up temporary files +rm -f $md5_cmp $md5_tmp $md5_rt_result $img_ver $2 + +# Post processing (for future extension consideration) + +echo "Successfully updated image $1!!" + diff --git a/Original Firmwares/v4.4.2.1248-550.220304.1317/extracted/fwu_ver b/Original Firmwares/v4.4.2.1248-550.220304.1317/extracted/fwu_ver new file mode 100644 index 0000000..86e1f12 --- /dev/null +++ b/Original Firmwares/v4.4.2.1248-550.220304.1317/extracted/fwu_ver @@ -0,0 +1 @@ +v4.4.2.1248-550.220304.1317 diff --git a/Original Firmwares/v4.4.2.1248-550.220304.1317/extracted/md5.txt b/Original Firmwares/v4.4.2.1248-550.220304.1317/extracted/md5.txt new file mode 100644 index 0000000..7136342 --- /dev/null +++ b/Original Firmwares/v4.4.2.1248-550.220304.1317/extracted/md5.txt @@ -0,0 +1,5 @@ +c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh +88b02bc6355d79766fea0ff89b0b16e4 rootfs +52ffde66f636db3876fd909b2a46cbfc uImage +79d0bf57e9b3165bb5a56e850df53084 fwu_ver +1041797d8f2c31e294c1ff1f7517caef plr.img diff --git a/Original Firmwares/v4.4.3.1442-23c.220908.1227/UF-ONU.UF-INSTANT.v4.4.3.1442-23c.220908.1227.img b/Original Firmwares/v4.4.3.1442-23c.220908.1227/UF-ONU.UF-INSTANT.v4.4.3.1442-23c.220908.1227.img new file mode 100644 index 0000000..66edf86 Binary files /dev/null and b/Original Firmwares/v4.4.3.1442-23c.220908.1227/UF-ONU.UF-INSTANT.v4.4.3.1442-23c.220908.1227.img differ diff --git a/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/fwu.sh b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/fwu.sh new file mode 100755 index 0000000..63edd86 --- /dev/null +++ b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/fwu.sh @@ -0,0 +1,133 @@ +#!/bin/sh + +# luna firmware upgrade script +# $1 image destination (0 or 1) +# Kernel and root file system images are assumed to be located at the same directory named uImage and rootfs respectively +# ToDo: use arugements to refer to kernel/rootfs location. + +k_img="uImage" +r_img="rootfs" +u_img="plr.img" +img_ver="fwu_ver" +md5_cmp="md5.txt" +md5_cmd="/bin/md5sum" +#md5 run-time result +md5_tmp="md5_tmp" +md5_rt_result="md5_rt_result.txt" + +# Stop this script upon any error +#set -e + +echo "Updating image $1 with file $2 offset $3" +img=$2 +img_offset=$3 + +# Find out kernel/rootfs mtd partition according to image destination +k_mtd="/dev/"`cat /proc/mtd | grep \"k"$1"\" | sed 's/:.*$//g'` +r_mtd="/dev/"`cat /proc/mtd | grep \"r"$1"\" | sed 's/:.*$//g'` +u_mtd="/dev/mtd0" +echo "kernel image is located at $k_mtd" +echo "rootfs image is located at $r_mtd" + +k_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $k_img | awk '{print $3}') +r_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $r_img | awk '{print $3}') +u_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $u_img | awk '{print $3}') +echo "$k_img size $k_img_size_dec, $r_img size $r_img_size_dec, $u_img size $u_img_size_dec" + +if [ -z "$k_img_size_dec" -o -z "$r_img_size_dec" ]; then + echo "Invalid sizes" + exit 1 +fi + +# Extract kernel image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O | md5sum | sed 's/-/'$k_img'/g' > $md5_rt_result +# Check integrity +grep $k_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + echo "$k_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract rootfs image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O | md5sum | sed 's/-/'$r_img'/g' > $md5_rt_result +# Check integrity +grep $r_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + # rm $r_img + echo "$r_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract uboot image +if [ -n "$u_img_size_dec" ]; then + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + # Check integrity + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "$u_img""md5_sum inconsistent, aborted image updating !" + exit 1 + fi +fi + +echo "Integrity of $k_img & $r_img is okay, start updating" + +erase_mtd() +{ + # get erase block size and test support of -x argument + eb_size=$(flash_erase -q -x -s $1 0 1 2>/dev/null) + if [ $? -eq 0 ]; then + erase_args=-x + else + erase_args= + eb_size=4096 + fi + + flash_erase $erase_args $1 0 $(((($2 - 1) / $eb_size) + 1)) +} + +# Upgrade uboot +if [ -n "$u_img_size_dec" ]; then + echo "Checking uboot version" + dd if=$u_mtd bs=$u_img_size_dec count=1 2>/dev/null | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "Upgrading uboot" + erase_mtd $u_mtd $u_img_size_dec + echo "Writing $u_img to $u_mtd" + #dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O |wc -c + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O > $u_mtd + else + echo "Uboot is up to date" + fi +fi + +# Erase kernel partition +erase_mtd $k_mtd $k_img_size_dec +# Write kernel partition +echo "Writing $k_img to $k_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O > $k_mtd + +# Erase rootfs partition +erase_mtd $r_mtd $r_img_size_dec +# Write rootfs partition +echo "Writing $r_img to $r_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O > $r_mtd + + +# Write image version information +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $img_ver +nv setenv sw_version"$1" "`cat $img_ver`" + +# Clean up temporary files +rm -f $md5_cmp $md5_tmp $md5_rt_result $img_ver $2 + +# Post processing (for future extension consideration) + +echo "Successfully updated image $1!!" + diff --git a/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/fwu_ver b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/fwu_ver new file mode 100644 index 0000000..cc095f0 --- /dev/null +++ b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/fwu_ver @@ -0,0 +1 @@ +v4.4.3.1442-23c.220908.1227 diff --git a/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/md5.txt b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/md5.txt new file mode 100644 index 0000000..5e7a35a --- /dev/null +++ b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/md5.txt @@ -0,0 +1,5 @@ +c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh +d67c507c13ab49afdde80a5834ef79ea rootfs +990c941aaf96fc72e3a925108eaae8e9 uImage +1bfcb774fef7d6429f5941ab0eb2f9de fwu_ver +1041797d8f2c31e294c1ff1f7517caef plr.img diff --git a/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/plr.img b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/plr.img new file mode 100644 index 0000000..a924c7c Binary files /dev/null and b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/plr.img differ diff --git a/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/rootfs b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/rootfs new file mode 100755 index 0000000..f64969f Binary files /dev/null and b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/rootfs differ diff --git a/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/uImage b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/uImage new file mode 100644 index 0000000..9881b6c Binary files /dev/null and b/Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/uImage differ diff --git a/Original Firmwares/v4.4.6.1547-4f3.221219.0950/UF-ONU.UF-INSTANT.v4.4.6.1547-4f3.221219.0950.img b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/UF-ONU.UF-INSTANT.v4.4.6.1547-4f3.221219.0950.img new file mode 100644 index 0000000..fa91496 Binary files /dev/null and b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/UF-ONU.UF-INSTANT.v4.4.6.1547-4f3.221219.0950.img differ diff --git a/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/fwu.sh b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/fwu.sh new file mode 100755 index 0000000..63edd86 --- /dev/null +++ b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/fwu.sh @@ -0,0 +1,133 @@ +#!/bin/sh + +# luna firmware upgrade script +# $1 image destination (0 or 1) +# Kernel and root file system images are assumed to be located at the same directory named uImage and rootfs respectively +# ToDo: use arugements to refer to kernel/rootfs location. + +k_img="uImage" +r_img="rootfs" +u_img="plr.img" +img_ver="fwu_ver" +md5_cmp="md5.txt" +md5_cmd="/bin/md5sum" +#md5 run-time result +md5_tmp="md5_tmp" +md5_rt_result="md5_rt_result.txt" + +# Stop this script upon any error +#set -e + +echo "Updating image $1 with file $2 offset $3" +img=$2 +img_offset=$3 + +# Find out kernel/rootfs mtd partition according to image destination +k_mtd="/dev/"`cat /proc/mtd | grep \"k"$1"\" | sed 's/:.*$//g'` +r_mtd="/dev/"`cat /proc/mtd | grep \"r"$1"\" | sed 's/:.*$//g'` +u_mtd="/dev/mtd0" +echo "kernel image is located at $k_mtd" +echo "rootfs image is located at $r_mtd" + +k_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $k_img | awk '{print $3}') +r_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $r_img | awk '{print $3}') +u_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $u_img | awk '{print $3}') +echo "$k_img size $k_img_size_dec, $r_img size $r_img_size_dec, $u_img size $u_img_size_dec" + +if [ -z "$k_img_size_dec" -o -z "$r_img_size_dec" ]; then + echo "Invalid sizes" + exit 1 +fi + +# Extract kernel image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O | md5sum | sed 's/-/'$k_img'/g' > $md5_rt_result +# Check integrity +grep $k_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + echo "$k_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract rootfs image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O | md5sum | sed 's/-/'$r_img'/g' > $md5_rt_result +# Check integrity +grep $r_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + # rm $r_img + echo "$r_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract uboot image +if [ -n "$u_img_size_dec" ]; then + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + # Check integrity + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "$u_img""md5_sum inconsistent, aborted image updating !" + exit 1 + fi +fi + +echo "Integrity of $k_img & $r_img is okay, start updating" + +erase_mtd() +{ + # get erase block size and test support of -x argument + eb_size=$(flash_erase -q -x -s $1 0 1 2>/dev/null) + if [ $? -eq 0 ]; then + erase_args=-x + else + erase_args= + eb_size=4096 + fi + + flash_erase $erase_args $1 0 $(((($2 - 1) / $eb_size) + 1)) +} + +# Upgrade uboot +if [ -n "$u_img_size_dec" ]; then + echo "Checking uboot version" + dd if=$u_mtd bs=$u_img_size_dec count=1 2>/dev/null | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "Upgrading uboot" + erase_mtd $u_mtd $u_img_size_dec + echo "Writing $u_img to $u_mtd" + #dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O |wc -c + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O > $u_mtd + else + echo "Uboot is up to date" + fi +fi + +# Erase kernel partition +erase_mtd $k_mtd $k_img_size_dec +# Write kernel partition +echo "Writing $k_img to $k_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O > $k_mtd + +# Erase rootfs partition +erase_mtd $r_mtd $r_img_size_dec +# Write rootfs partition +echo "Writing $r_img to $r_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O > $r_mtd + + +# Write image version information +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $img_ver +nv setenv sw_version"$1" "`cat $img_ver`" + +# Clean up temporary files +rm -f $md5_cmp $md5_tmp $md5_rt_result $img_ver $2 + +# Post processing (for future extension consideration) + +echo "Successfully updated image $1!!" + diff --git a/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/fwu_ver b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/fwu_ver new file mode 100644 index 0000000..3870fd3 --- /dev/null +++ b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/fwu_ver @@ -0,0 +1 @@ +v4.4.6.1547-4f3.221219.0950 diff --git a/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/md5.txt b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/md5.txt new file mode 100644 index 0000000..895231a --- /dev/null +++ b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/md5.txt @@ -0,0 +1,5 @@ +c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh +4df9efa06e43000d3f49886931465b75 rootfs +daf8dc1aa87b52662b31f5c3d25139dd uImage +518fb53a50a9d3d41225b75f8055a87b fwu_ver +1041797d8f2c31e294c1ff1f7517caef plr.img diff --git a/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/plr.img b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/plr.img new file mode 100644 index 0000000..a924c7c Binary files /dev/null and b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/plr.img differ diff --git a/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/rootfs b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/rootfs new file mode 100755 index 0000000..4f48a10 Binary files /dev/null and b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/rootfs differ diff --git a/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/uImage b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/uImage new file mode 100644 index 0000000..a61b3d1 Binary files /dev/null and b/Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/uImage differ diff --git a/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/fwu.sh b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/fwu.sh new file mode 100755 index 0000000..63edd86 --- /dev/null +++ b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/fwu.sh @@ -0,0 +1,133 @@ +#!/bin/sh + +# luna firmware upgrade script +# $1 image destination (0 or 1) +# Kernel and root file system images are assumed to be located at the same directory named uImage and rootfs respectively +# ToDo: use arugements to refer to kernel/rootfs location. + +k_img="uImage" +r_img="rootfs" +u_img="plr.img" +img_ver="fwu_ver" +md5_cmp="md5.txt" +md5_cmd="/bin/md5sum" +#md5 run-time result +md5_tmp="md5_tmp" +md5_rt_result="md5_rt_result.txt" + +# Stop this script upon any error +#set -e + +echo "Updating image $1 with file $2 offset $3" +img=$2 +img_offset=$3 + +# Find out kernel/rootfs mtd partition according to image destination +k_mtd="/dev/"`cat /proc/mtd | grep \"k"$1"\" | sed 's/:.*$//g'` +r_mtd="/dev/"`cat /proc/mtd | grep \"r"$1"\" | sed 's/:.*$//g'` +u_mtd="/dev/mtd0" +echo "kernel image is located at $k_mtd" +echo "rootfs image is located at $r_mtd" + +k_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $k_img | awk '{print $3}') +r_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $r_img | awk '{print $3}') +u_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $u_img | awk '{print $3}') +echo "$k_img size $k_img_size_dec, $r_img size $r_img_size_dec, $u_img size $u_img_size_dec" + +if [ -z "$k_img_size_dec" -o -z "$r_img_size_dec" ]; then + echo "Invalid sizes" + exit 1 +fi + +# Extract kernel image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O | md5sum | sed 's/-/'$k_img'/g' > $md5_rt_result +# Check integrity +grep $k_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + echo "$k_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract rootfs image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O | md5sum | sed 's/-/'$r_img'/g' > $md5_rt_result +# Check integrity +grep $r_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + # rm $r_img + echo "$r_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract uboot image +if [ -n "$u_img_size_dec" ]; then + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + # Check integrity + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "$u_img""md5_sum inconsistent, aborted image updating !" + exit 1 + fi +fi + +echo "Integrity of $k_img & $r_img is okay, start updating" + +erase_mtd() +{ + # get erase block size and test support of -x argument + eb_size=$(flash_erase -q -x -s $1 0 1 2>/dev/null) + if [ $? -eq 0 ]; then + erase_args=-x + else + erase_args= + eb_size=4096 + fi + + flash_erase $erase_args $1 0 $(((($2 - 1) / $eb_size) + 1)) +} + +# Upgrade uboot +if [ -n "$u_img_size_dec" ]; then + echo "Checking uboot version" + dd if=$u_mtd bs=$u_img_size_dec count=1 2>/dev/null | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "Upgrading uboot" + erase_mtd $u_mtd $u_img_size_dec + echo "Writing $u_img to $u_mtd" + #dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O |wc -c + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O > $u_mtd + else + echo "Uboot is up to date" + fi +fi + +# Erase kernel partition +erase_mtd $k_mtd $k_img_size_dec +# Write kernel partition +echo "Writing $k_img to $k_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O > $k_mtd + +# Erase rootfs partition +erase_mtd $r_mtd $r_img_size_dec +# Write rootfs partition +echo "Writing $r_img to $r_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O > $r_mtd + + +# Write image version information +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $img_ver +nv setenv sw_version"$1" "`cat $img_ver`" + +# Clean up temporary files +rm -f $md5_cmp $md5_tmp $md5_rt_result $img_ver $2 + +# Post processing (for future extension consideration) + +echo "Successfully updated image $1!!" + diff --git a/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/fwu_ver b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/fwu_ver new file mode 100644 index 0000000..bed26ef --- /dev/null +++ b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/fwu_ver @@ -0,0 +1 @@ +v4.4.8.1577-1e5.230117.0910 diff --git a/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/md5.txt b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/md5.txt new file mode 100644 index 0000000..0a415db --- /dev/null +++ b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/md5.txt @@ -0,0 +1,5 @@ +c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh +e8da1b30c1883d4d19d58ab7b625bd52 rootfs +7c7045349952a25ab6e1353474ed8508 uImage +0d1ff38105de4e88e6ab3b6be1c8b522 fwu_ver +1041797d8f2c31e294c1ff1f7517caef plr.img diff --git a/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/plr.img b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/plr.img new file mode 100644 index 0000000..a924c7c Binary files /dev/null and b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/plr.img differ diff --git a/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/rootfs b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/rootfs new file mode 100755 index 0000000..4cb60b5 Binary files /dev/null and b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/rootfs differ diff --git a/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/uImage b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/uImage new file mode 100644 index 0000000..76c6daa Binary files /dev/null and b/Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/uImage differ diff --git a/Original Firmwares/v4.4.9.1623-46a.230301.1135/UF-ONU.UF-INSTANT.v4.4.9.1623-46a.230301.1135.img b/Original Firmwares/v4.4.9.1623-46a.230301.1135/UF-ONU.UF-INSTANT.v4.4.9.1623-46a.230301.1135.img new file mode 100644 index 0000000..1e9843b Binary files /dev/null and b/Original Firmwares/v4.4.9.1623-46a.230301.1135/UF-ONU.UF-INSTANT.v4.4.9.1623-46a.230301.1135.img differ diff --git a/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/fwu.sh b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/fwu.sh new file mode 100755 index 0000000..63edd86 --- /dev/null +++ b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/fwu.sh @@ -0,0 +1,133 @@ +#!/bin/sh + +# luna firmware upgrade script +# $1 image destination (0 or 1) +# Kernel and root file system images are assumed to be located at the same directory named uImage and rootfs respectively +# ToDo: use arugements to refer to kernel/rootfs location. + +k_img="uImage" +r_img="rootfs" +u_img="plr.img" +img_ver="fwu_ver" +md5_cmp="md5.txt" +md5_cmd="/bin/md5sum" +#md5 run-time result +md5_tmp="md5_tmp" +md5_rt_result="md5_rt_result.txt" + +# Stop this script upon any error +#set -e + +echo "Updating image $1 with file $2 offset $3" +img=$2 +img_offset=$3 + +# Find out kernel/rootfs mtd partition according to image destination +k_mtd="/dev/"`cat /proc/mtd | grep \"k"$1"\" | sed 's/:.*$//g'` +r_mtd="/dev/"`cat /proc/mtd | grep \"r"$1"\" | sed 's/:.*$//g'` +u_mtd="/dev/mtd0" +echo "kernel image is located at $k_mtd" +echo "rootfs image is located at $r_mtd" + +k_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $k_img | awk '{print $3}') +r_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $r_img | awk '{print $3}') +u_img_size_dec=$(dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -tv $u_img | awk '{print $3}') +echo "$k_img size $k_img_size_dec, $r_img size $r_img_size_dec, $u_img size $u_img_size_dec" + +if [ -z "$k_img_size_dec" -o -z "$r_img_size_dec" ]; then + echo "Invalid sizes" + exit 1 +fi + +# Extract kernel image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O | md5sum | sed 's/-/'$k_img'/g' > $md5_rt_result +# Check integrity +grep $k_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + echo "$k_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract rootfs image +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O | md5sum | sed 's/-/'$r_img'/g' > $md5_rt_result +# Check integrity +grep $r_img $md5_cmp > $md5_tmp +diff $md5_rt_result $md5_tmp + +if [ $? != 0 ]; then + # rm $r_img + echo "$r_img""md5_sum inconsistent, aborted image updating !" + exit 1 +fi + +# Extract uboot image +if [ -n "$u_img_size_dec" ]; then + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + # Check integrity + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "$u_img""md5_sum inconsistent, aborted image updating !" + exit 1 + fi +fi + +echo "Integrity of $k_img & $r_img is okay, start updating" + +erase_mtd() +{ + # get erase block size and test support of -x argument + eb_size=$(flash_erase -q -x -s $1 0 1 2>/dev/null) + if [ $? -eq 0 ]; then + erase_args=-x + else + erase_args= + eb_size=4096 + fi + + flash_erase $erase_args $1 0 $(((($2 - 1) / $eb_size) + 1)) +} + +# Upgrade uboot +if [ -n "$u_img_size_dec" ]; then + echo "Checking uboot version" + dd if=$u_mtd bs=$u_img_size_dec count=1 2>/dev/null | md5sum | sed 's/-/'$u_img'/g' > $md5_rt_result + grep $u_img $md5_cmp > $md5_tmp + diff $md5_rt_result $md5_tmp + if [ $? != 0 ]; then + echo "Upgrading uboot" + erase_mtd $u_mtd $u_img_size_dec + echo "Writing $u_img to $u_mtd" + #dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O |wc -c + dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $u_img -O > $u_mtd + else + echo "Uboot is up to date" + fi +fi + +# Erase kernel partition +erase_mtd $k_mtd $k_img_size_dec +# Write kernel partition +echo "Writing $k_img to $k_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $k_img -O > $k_mtd + +# Erase rootfs partition +erase_mtd $r_mtd $r_img_size_dec +# Write rootfs partition +echo "Writing $r_img to $r_mtd" +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $r_img -O > $r_mtd + + +# Write image version information +dd if=$img bs=$img_offset skip=1 2>/dev/null | tar -x $img_ver +nv setenv sw_version"$1" "`cat $img_ver`" + +# Clean up temporary files +rm -f $md5_cmp $md5_tmp $md5_rt_result $img_ver $2 + +# Post processing (for future extension consideration) + +echo "Successfully updated image $1!!" + diff --git a/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/fwu_ver b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/fwu_ver new file mode 100644 index 0000000..0eacf83 --- /dev/null +++ b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/fwu_ver @@ -0,0 +1 @@ +v4.4.9.1623-46a.230301.1135 diff --git a/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/md5.txt b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/md5.txt new file mode 100644 index 0000000..ef8c1f4 --- /dev/null +++ b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/md5.txt @@ -0,0 +1,5 @@ +c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh +bac7d1e39669070b16448e46b6d8f4c2 rootfs +813047506b56d4b5b6a19cd798a38ed6 uImage +78be7f5c3b339fdc89f4f3de9b07b470 fwu_ver +1041797d8f2c31e294c1ff1f7517caef plr.img diff --git a/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/plr.img b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/plr.img new file mode 100644 index 0000000..a924c7c Binary files /dev/null and b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/plr.img differ diff --git a/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/rootfs b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/rootfs new file mode 100755 index 0000000..b4aafc8 Binary files /dev/null and b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/rootfs differ diff --git a/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/uImage b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/uImage new file mode 100644 index 0000000..3645ba2 Binary files /dev/null and b/Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/uImage differ