fix burn error

This commit is contained in:
hyx 2026-05-30 18:25:05 +08:00
parent 609d5dc6af
commit 8e53df49f7
7 changed files with 32 additions and 17 deletions

Binary file not shown.

View File

@ -63,7 +63,7 @@ set_nand_mtdargs=env delete mtdparts
set_nand_bootargs=run set_nand_mtdargs; \ set_nand_bootargs=run set_nand_mtdargs; \
run set_commonargs; \ run set_commonargs; \
setenv bootargs ${bootargs} mtdparts=${MTD} ubi.mtd=${ubi_rootfs_mtd} ubi.mtd=11 root=${nand_root} rootfstype=${nand_rootfstype} setenv bootargs ${bootargs} mtdparts=${MTD} ubi.mtd=${ubi_rootfs_mtd} ubi.mtd=11 ubi.mtd=12 root=${nand_root} rootfstype=${nand_rootfstype}
set_nand_bootargs_recovery=run set_nand_mtdargs; \ set_nand_bootargs_recovery=run set_nand_mtdargs; \
run set_commonargs_recovery; \ run set_commonargs_recovery; \

View File

@ -1,6 +1,6 @@
{ {
"spi-nand": { // Device, The name should be the same with string in image:info:media:type "spi-nand": { // Device, The name should be the same with string in image:info:media:type
"size": "244m", // Size of SPI NAND "size": "256m", // Size of SPI NAND
"partitions": { "partitions": {
"spl": { "size": "1m" }, "spl": { "size": "1m" },
"uboot": { "size": "1m" }, "uboot": { "size": "1m" },
@ -19,9 +19,14 @@
}, },
}, },
"ubisystem": { "ubisystem": {
"size": "8m",
"ubi": { // Volume in UBI device
"system": { "size": "-" },
},
},
"ubidata": {
"size": "-", "size": "-",
"ubi": { // Volume in UBI device "ubi": { // Volume in UBI device
"system": { "size": "8m" },
"data": { "size": "-" }, "data": { "size": "-" },
}, },
}, },
@ -112,7 +117,7 @@
"data": { "data": {
"file": "data*.ubifs", "file": "data*.ubifs",
"attr": ["ubi", "optional"], "attr": ["ubi", "optional"],
"part": ["ubisystem:data"] "part": ["ubidata:data"]
}, },
}, },
}, },

View File

@ -8,4 +8,4 @@ tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0
sysfs /sys sysfs defaults 0 0 sysfs /sys sysfs defaults 0 0
ubi1:system /system ubifs ro,defaults 0 0 ubi1:system /system ubifs ro,defaults 0 0
ubi1:data /data ubifs defaults 0 0 ubi2:data /data ubifs defaults 0 0

View File

@ -11,6 +11,10 @@ start() {
echo "ubi1 device not found, skipping..." echo "ubi1 device not found, skipping..."
return 0 return 0
fi fi
if [ ! -e /dev/ubi2 ]; then
echo "ubi2 device not found, skipping..."
return 0
fi
# Create mount points # Create mount points
mkdir -p /system /data mkdir -p /system /data
@ -24,7 +28,7 @@ start() {
# Mount data (read-write) # Mount data (read-write)
if ! mountpoint -q /data; then if ! mountpoint -q /data; then
echo "Mounting /data..." echo "Mounting /data..."
mount -t ubifs ubi1:data /data 2>/dev/null || echo "Failed to mount /data" mount -t ubifs ubi2:data /data 2>/dev/null || echo "Failed to mount /data"
fi fi
echo "UBI volumes initialized" echo "UBI volumes initialized"

View File

@ -1,6 +1,6 @@
{ {
"spi-nand": { // Device, The name should be the same with string in image:info:media:type "spi-nand": { // Device, The name should be the same with string in image:info:media:type
"size": "128m", // Size of SPI NAND "size": "256m", // Size of SPI NAND
"partitions": { "partitions": {
"spl": { "size": "1m" }, "spl": { "size": "1m" },
"uboot": { "size": "1m" }, "uboot": { "size": "1m" },
@ -13,16 +13,21 @@
"kernel": { "size": "12m" }, "kernel": { "size": "12m" },
"recovery": { "size": "16m" }, "recovery": { "size": "16m" },
"ubiroot": { "ubiroot": {
"size": "64m", "size": "40m",
"ubi": { // Volume in UBI device "ubi": { // Volume in UBI device
"rootfs": { "size": "-" }, "rootfs": { "size": "-" },
}, },
}, },
"ubisystem": { "ubisystem": {
"size": "8m",
"ubi": { // Volume in UBI device
"system": { "size": "-" },
},
},
"ubidata": {
"size": "-", "size": "-",
"ubi": { // Volume in UBI device "ubi": { // Volume in UBI device
"ota": { "size": "32m" }, "data": { "size": "-" },
"user": { "size": "-" },
}, },
}, },
} }
@ -104,15 +109,15 @@
"attr": ["ubi", "required"], "attr": ["ubi", "required"],
"part": ["ubiroot:rootfs"] "part": ["ubiroot:rootfs"]
}, },
"ota": { "system": {
"file": "ota*.ubifs", "file": "system*.ubifs",
"attr": ["ubi", "optional"], "attr": ["ubi", "optional"],
"part": ["ubisystem:ota"] "part": ["ubisystem:system"]
}, },
"app": { "data": {
"file": "user*.ubifs", "file": "data*.ubifs",
"attr": ["ubi", "optional"], "attr": ["ubi", "optional"],
"part": ["ubisystem:user"] "part": ["ubidata:data"]
}, },
}, },
}, },

View File

@ -117,12 +117,13 @@ case "$1" in
# ubi1:data (ubisystem) -- holds the .swu package # ubi1:data (ubisystem) -- holds the .swu package
attach_ubi_by_name "ubiroot" attach_ubi_by_name "ubiroot"
attach_ubi_by_name "ubisystem" attach_ubi_by_name "ubisystem"
attach_ubi_by_name "ubidata"
# Mount ubi*:data so we can read the .swu placed there by main system. # Mount ubi*:data so we can read the .swu placed there by main system.
mkdir -p /data mkdir -p /data
if ! mountpoint -q /data; then if ! mountpoint -q /data; then
# Try ubi0 then ubi1 — depending on attach order data may be on either. # Try ubi0 then ubi1 — depending on attach order data may be on either.
for d in /dev/ubi1 /dev/ubi0; do for d in /dev/ubi2 /dev/ubi1 /dev/ubi0; do
[ -e "$d" ] || continue [ -e "$d" ] || continue
idx=$(echo "$d" | sed 's|.*ubi||') idx=$(echo "$d" | sed 's|.*ubi||')
if mount -t ubifs "ubi${idx}:data" /data 2>/dev/null; then if mount -t ubifs "ubi${idx}:data" /data 2>/dev/null; then