diff --git a/target/d211/common/Recovery.gz b/target/d211/common/Recovery.gz index e6ce1ff7a..f863ee863 100644 Binary files a/target/d211/common/Recovery.gz and b/target/d211/common/Recovery.gz differ diff --git a/target/d211/common/env.txt b/target/d211/common/env.txt index 0ee5f8707..5a398e6f9 100644 --- a/target/d211/common/env.txt +++ b/target/d211/common/env.txt @@ -63,7 +63,7 @@ set_nand_mtdargs=env delete mtdparts set_nand_bootargs=run set_nand_mtdargs; \ 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; \ run set_commonargs_recovery; \ diff --git a/target/d211/demo128_nand/image_cfg.json b/target/d211/demo128_nand/image_cfg.json index 964d165fb..bc82304ae 100644 --- a/target/d211/demo128_nand/image_cfg.json +++ b/target/d211/demo128_nand/image_cfg.json @@ -1,6 +1,6 @@ { "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": { "spl": { "size": "1m" }, "uboot": { "size": "1m" }, @@ -19,9 +19,14 @@ }, }, "ubisystem": { + "size": "8m", + "ubi": { // Volume in UBI device + "system": { "size": "-" }, + }, + }, + "ubidata": { "size": "-", "ubi": { // Volume in UBI device - "system": { "size": "8m" }, "data": { "size": "-" }, }, }, @@ -112,7 +117,7 @@ "data": { "file": "data*.ubifs", "attr": ["ubi", "optional"], - "part": ["ubisystem:data"] + "part": ["ubidata:data"] }, }, }, diff --git a/target/d211/demo128_nand/rootfs_overlay/etc/fstab b/target/d211/demo128_nand/rootfs_overlay/etc/fstab index 75c2c3e56..ef9caa7a2 100644 --- a/target/d211/demo128_nand/rootfs_overlay/etc/fstab +++ b/target/d211/demo128_nand/rootfs_overlay/etc/fstab @@ -8,4 +8,4 @@ tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0 sysfs /sys sysfs 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 diff --git a/target/d211/demo128_nand/rootfs_overlay/etc/init.d/S01ubivol b/target/d211/demo128_nand/rootfs_overlay/etc/init.d/S01ubivol index 2b9478759..a096c7f9d 100755 --- a/target/d211/demo128_nand/rootfs_overlay/etc/init.d/S01ubivol +++ b/target/d211/demo128_nand/rootfs_overlay/etc/init.d/S01ubivol @@ -11,6 +11,10 @@ start() { echo "ubi1 device not found, skipping..." return 0 fi + if [ ! -e /dev/ubi2 ]; then + echo "ubi2 device not found, skipping..." + return 0 + fi # Create mount points mkdir -p /system /data @@ -24,7 +28,7 @@ start() { # Mount data (read-write) if ! mountpoint -q /data; then 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 echo "UBI volumes initialized" diff --git a/target/d211/ota/image_cfg.json b/target/d211/ota/image_cfg.json index 8c0085a85..1d828e27a 100644 --- a/target/d211/ota/image_cfg.json +++ b/target/d211/ota/image_cfg.json @@ -1,6 +1,6 @@ { "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": { "spl": { "size": "1m" }, "uboot": { "size": "1m" }, @@ -13,16 +13,21 @@ "kernel": { "size": "12m" }, "recovery": { "size": "16m" }, "ubiroot": { - "size": "64m", + "size": "40m", "ubi": { // Volume in UBI device "rootfs": { "size": "-" }, }, }, "ubisystem": { + "size": "8m", + "ubi": { // Volume in UBI device + "system": { "size": "-" }, + }, + }, + "ubidata": { "size": "-", "ubi": { // Volume in UBI device - "ota": { "size": "32m" }, - "user": { "size": "-" }, + "data": { "size": "-" }, }, }, } @@ -104,15 +109,15 @@ "attr": ["ubi", "required"], "part": ["ubiroot:rootfs"] }, - "ota": { - "file": "ota*.ubifs", + "system": { + "file": "system*.ubifs", "attr": ["ubi", "optional"], - "part": ["ubisystem:ota"] + "part": ["ubisystem:system"] }, - "app": { - "file": "user*.ubifs", + "data": { + "file": "data*.ubifs", "attr": ["ubi", "optional"], - "part": ["ubisystem:user"] + "part": ["ubidata:data"] }, }, }, diff --git a/target/d211/ota/rootfs_overlay/etc/init.d/S91swupdate_ota b/target/d211/ota/rootfs_overlay/etc/init.d/S91swupdate_ota index c967d9101..74fc915f8 100755 --- a/target/d211/ota/rootfs_overlay/etc/init.d/S91swupdate_ota +++ b/target/d211/ota/rootfs_overlay/etc/init.d/S91swupdate_ota @@ -117,12 +117,13 @@ case "$1" in # ubi1:data (ubisystem) -- holds the .swu package attach_ubi_by_name "ubiroot" attach_ubi_by_name "ubisystem" + attach_ubi_by_name "ubidata" # Mount ubi*:data so we can read the .swu placed there by main system. mkdir -p /data if ! mountpoint -q /data; then # 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 idx=$(echo "$d" | sed 's|.*ubi||') if mount -t ubifs "ubi${idx}:data" /data 2>/dev/null; then