mirror of
https://github.com/stich86/UF-Instant-Mod.git
synced 2025-01-22 00:55:39 +00:00
Merge pull request #16 from d3vi1/newreleases230611-pr
Added missing releases
This commit is contained in:
commit
b695e40818
Binary file not shown.
102
Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/fwu.sh
Executable file
102
Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/fwu.sh
Executable file
|
@ -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!!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
v4.1.0.359-b87.191101.0940
|
|
@ -0,0 +1,4 @@
|
|||
0829b8500c38b2d77fedf70efdfdf4f0 fwu.sh
|
||||
3b6d0a970f181ef04c0145d8d4e10e1d rootfs
|
||||
d1fb3d2a83be1d734cfa3b5d713e3d4f uImage
|
||||
0d36ffa33ab69151f38370ab9e38436f fwu_ver
|
BIN
Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/rootfs
Executable file
BIN
Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/rootfs
Executable file
Binary file not shown.
BIN
Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/uImage
Normal file
BIN
Original Firmwares/v4.1.0.359-b87.191101.0940/extracted/uImage
Normal file
Binary file not shown.
Binary file not shown.
133
Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/fwu.sh
Executable file
133
Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/fwu.sh
Executable file
|
@ -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!!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
v4.3.0.810-29d.210105.1122
|
|
@ -0,0 +1,5 @@
|
|||
c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh
|
||||
3acab9b33e06f4550a26092193ce59fd rootfs
|
||||
29c13d96dc536e815c9f590293db4c2b uImage
|
||||
1c28aad0bdf10dbd22c8c8499e30b5e4 fwu_ver
|
||||
1041797d8f2c31e294c1ff1f7517caef plr.img
|
BIN
Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/plr.img
Normal file
BIN
Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/plr.img
Normal file
Binary file not shown.
BIN
Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/rootfs
Executable file
BIN
Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/rootfs
Executable file
Binary file not shown.
BIN
Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/uImage
Normal file
BIN
Original Firmwares/v4.3.0.810-29d.210105.1122/extracted/uImage
Normal file
Binary file not shown.
133
Original Firmwares/v4.3.1.913-d48.210415.0811/extracted/fwu.sh
Executable file
133
Original Firmwares/v4.3.1.913-d48.210415.0811/extracted/fwu.sh
Executable file
|
@ -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!!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
v4.3.1.913-d48.210415.0811
|
|
@ -0,0 +1,5 @@
|
|||
c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh
|
||||
df5cef2909ac7391df86c98ad01297ef rootfs
|
||||
28c02939cae41a2752cea677f1075b85 uImage
|
||||
c5718e8819a8593a7e0fba3c08deef03 fwu_ver
|
||||
1041797d8f2c31e294c1ff1f7517caef plr.img
|
Binary file not shown.
133
Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/fwu.sh
Executable file
133
Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/fwu.sh
Executable file
|
@ -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!!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
v4.4.0.1118-2f5.211102.0822
|
|
@ -0,0 +1,5 @@
|
|||
c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh
|
||||
d8ba4477de5399ab7e714602a6c4c1aa rootfs
|
||||
5375853973963e9144e5f45d8a160112 uImage
|
||||
56ae3075c085202dc89f35903edeeb37 fwu_ver
|
||||
1041797d8f2c31e294c1ff1f7517caef plr.img
|
BIN
Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/plr.img
Normal file
BIN
Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/plr.img
Normal file
Binary file not shown.
BIN
Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/rootfs
Executable file
BIN
Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/rootfs
Executable file
Binary file not shown.
BIN
Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/uImage
Normal file
BIN
Original Firmwares/v4.4.0.1118-2f5.211102.0822/extracted/uImage
Normal file
Binary file not shown.
133
Original Firmwares/v4.4.2.1248-550.220304.1317/extracted/fwu.sh
Executable file
133
Original Firmwares/v4.4.2.1248-550.220304.1317/extracted/fwu.sh
Executable file
|
@ -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!!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
v4.4.2.1248-550.220304.1317
|
|
@ -0,0 +1,5 @@
|
|||
c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh
|
||||
88b02bc6355d79766fea0ff89b0b16e4 rootfs
|
||||
52ffde66f636db3876fd909b2a46cbfc uImage
|
||||
79d0bf57e9b3165bb5a56e850df53084 fwu_ver
|
||||
1041797d8f2c31e294c1ff1f7517caef plr.img
|
Binary file not shown.
133
Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/fwu.sh
Executable file
133
Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/fwu.sh
Executable file
|
@ -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!!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
v4.4.3.1442-23c.220908.1227
|
|
@ -0,0 +1,5 @@
|
|||
c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh
|
||||
d67c507c13ab49afdde80a5834ef79ea rootfs
|
||||
990c941aaf96fc72e3a925108eaae8e9 uImage
|
||||
1bfcb774fef7d6429f5941ab0eb2f9de fwu_ver
|
||||
1041797d8f2c31e294c1ff1f7517caef plr.img
|
BIN
Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/plr.img
Normal file
BIN
Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/plr.img
Normal file
Binary file not shown.
BIN
Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/rootfs
Executable file
BIN
Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/rootfs
Executable file
Binary file not shown.
BIN
Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/uImage
Normal file
BIN
Original Firmwares/v4.4.3.1442-23c.220908.1227/extracted/uImage
Normal file
Binary file not shown.
Binary file not shown.
133
Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/fwu.sh
Executable file
133
Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/fwu.sh
Executable file
|
@ -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!!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
v4.4.6.1547-4f3.221219.0950
|
|
@ -0,0 +1,5 @@
|
|||
c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh
|
||||
4df9efa06e43000d3f49886931465b75 rootfs
|
||||
daf8dc1aa87b52662b31f5c3d25139dd uImage
|
||||
518fb53a50a9d3d41225b75f8055a87b fwu_ver
|
||||
1041797d8f2c31e294c1ff1f7517caef plr.img
|
BIN
Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/plr.img
Normal file
BIN
Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/plr.img
Normal file
Binary file not shown.
BIN
Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/rootfs
Executable file
BIN
Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/rootfs
Executable file
Binary file not shown.
BIN
Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/uImage
Normal file
BIN
Original Firmwares/v4.4.6.1547-4f3.221219.0950/extracted/uImage
Normal file
Binary file not shown.
133
Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/fwu.sh
Executable file
133
Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/fwu.sh
Executable file
|
@ -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!!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
v4.4.8.1577-1e5.230117.0910
|
|
@ -0,0 +1,5 @@
|
|||
c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh
|
||||
e8da1b30c1883d4d19d58ab7b625bd52 rootfs
|
||||
7c7045349952a25ab6e1353474ed8508 uImage
|
||||
0d1ff38105de4e88e6ab3b6be1c8b522 fwu_ver
|
||||
1041797d8f2c31e294c1ff1f7517caef plr.img
|
BIN
Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/plr.img
Normal file
BIN
Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/plr.img
Normal file
Binary file not shown.
BIN
Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/rootfs
Executable file
BIN
Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/rootfs
Executable file
Binary file not shown.
BIN
Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/uImage
Normal file
BIN
Original Firmwares/v4.4.8.1577-1e5.230117.0910/extracted/uImage
Normal file
Binary file not shown.
Binary file not shown.
133
Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/fwu.sh
Executable file
133
Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/fwu.sh
Executable file
|
@ -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!!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
v4.4.9.1623-46a.230301.1135
|
|
@ -0,0 +1,5 @@
|
|||
c5a5eb8526f42cb3f7efb9bf88c315ed fwu.sh
|
||||
bac7d1e39669070b16448e46b6d8f4c2 rootfs
|
||||
813047506b56d4b5b6a19cd798a38ed6 uImage
|
||||
78be7f5c3b339fdc89f4f3de9b07b470 fwu_ver
|
||||
1041797d8f2c31e294c1ff1f7517caef plr.img
|
BIN
Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/plr.img
Normal file
BIN
Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/plr.img
Normal file
Binary file not shown.
BIN
Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/rootfs
Executable file
BIN
Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/rootfs
Executable file
Binary file not shown.
BIN
Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/uImage
Normal file
BIN
Original Firmwares/v4.4.9.1623-46a.230301.1135/extracted/uImage
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user