ccmp1: remove usage of $singlemtdsys variable

On the CCMP1 SOMs, we only consider a single system partition called UBI,
with many UBI volumes.
The variable 'singlemtdsys' allowed to change between this and
a system with multiple MTD partitions with one UBI volume each
(old approach on CC6UL).
This commit removes the variable and uses the logic as if it was set.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
This commit is contained in:
Hector Palacios 2022-10-19 14:25:33 +02:00
parent 30022f556b
commit e346958131
4 changed files with 8 additions and 43 deletions

View File

@ -128,7 +128,7 @@ fi
# Set 'bootcmd' to the second part of the script that will
# - Reset environment to defaults
# - Restore 'singlemtdsys' and 'dualboot' if previously set
# - Restore 'dualboot' if previously set
# - Run 'partition_nand_linux' script to re-partition the NAND if needed
# - Save the environment
# - If Dual Boot
@ -140,15 +140,10 @@ fi
# - Run 'recovery' and let the system boot after
setenv bootcmd "
env default -a;
setenv singlemtdsys ${singlemtdsys};
setenv dualboot ${dualboot};
run partition_nand_linux;
saveenv;
if test \"\$\{singlemtdsys\}\" = yes; then
run ubivolscript;
else
force_erase="-e";
fi;
run ubivolscript;
if test \"\$\{dualboot\}\" = yes; then
echo \"\";
echo \"\";
@ -236,9 +231,6 @@ setenv bootcmd "
exit;
fi;
echo \"\";
if test \"\$\{singlemtdsys\}\" != yes; then
nand erase.part update;
fi;
setenv boot_recovery yes;
setenv recovery_command wipe_update;
fi;

View File

@ -128,7 +128,7 @@ fi
# Set 'bootcmd' to the second part of the script that will
# - Reset environment to defaults
# - Restore 'singlemtdsys' and 'dualboot' if previously set
# - Restore 'dualboot' if previously set
# - Run 'partition_nand_linux' script to re-partition the NAND if needed
# - Save the environment
# - If Dual Boot
@ -140,15 +140,10 @@ fi
# - Run 'recovery' and let the system boot after
setenv bootcmd "
env default -a;
setenv singlemtdsys ${singlemtdsys};
setenv dualboot ${dualboot};
run partition_nand_linux;
saveenv;
if test \"\$\{singlemtdsys\}\" = yes; then
run ubivolscript;
else
force_erase="-e";
fi;
run ubivolscript;
usb start;
if test \"\$\{dualboot\}\" = yes; then
echo \"\";
@ -237,9 +232,6 @@ setenv bootcmd "
exit;
fi;
echo \"\";
if test \"\$\{singlemtdsys\}\" != yes; then
nand erase.part update;
fi;
setenv boot_recovery yes;
setenv recovery_command wipe_update;
fi;

View File

@ -58,14 +58,6 @@ part_update()
echo "====================================================================================="
echo "\033[0m"
# When in Multi-MTD mode, pass -e to update command to force the erase
# of the MTD partition before programming. This is usually done by
# 'update' command except when a UBI volume is already found.
# On the install script, the MTD partition table may have changed, so
# we'd better clean the partition.
if [ "${SINGLEMTDSYS}" != true ]; then
ERASE="-e"
fi
uuu fb: download -f "${2}"
uuu "fb[-t ${3}]:" ucmd update "${1}" ram \${fastboot_buffer} \${fastboot_bytes} ${ERASE}
}
@ -97,12 +89,6 @@ if [ "${dualboot}" = "yes" ]; then
DUALBOOT=true;
fi
# Check if singlemtdsys variable is active
singlemtdsys=$(getenv "singlemtdsys")
if [ "${singlemtdsys}" = "yes" ]; then
SINGLEMTDSYS=true;
fi
echo ""
echo "Determining image files to use..."
@ -238,7 +224,6 @@ part_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000
uuu fb: ucmd setenv bootcmd "
env default -a;
setenv dualboot \${dualboot};
setenv singlemtdsys \${singlemtdsys};
saveenv;
echo \"\";
echo \"\";
@ -260,10 +245,8 @@ uuu fb: ucmd setenv fastboot_buffer \${loadaddr}
# Create partition table
uuu "fb[-t 10000]:" ucmd run partition_nand_linux
if [ "${SINGLEMTDSYS}" = true ]; then
uuu "fb[-t 30000]:" ucmd nand erase.part system
uuu "fb[-t 10000]:" ucmd run ubivolscript
fi
uuu "fb[-t 30000]:" ucmd nand erase.part system
uuu "fb[-t 10000]:" ucmd run ubivolscript
if [ "${DUALBOOT}" = true ]; then
# Update Linux A
@ -283,7 +266,7 @@ else
part_update "${ROOTFS_NAME}" "${INSTALL_ROOTFS_FILENAME}" 90000
fi
if [ "${SINGLEMTDSYS}" != true ] && [ "${DUALBOOT}" != true ]; then
if [ "${DUALBOOT}" != true ]; then
# Erase the 'Update' partition
uuu "fb[-t 20000]:" ucmd nand erase.part update
fi

View File

@ -56,8 +56,6 @@ else
fi
fi
SINGLEMTDSYS="$(fw_printenv -n singlemtdsys 2>/dev/null)"
# Create mount point if needed
MOUNTPOINT="/mnt/${PARTNAME}"
[ -d "${MOUNTPOINT}" ] || mkdir -p ${MOUNTPOINT}
@ -93,7 +91,7 @@ elif [ "${SUBSYSTEM}" = "mtd" ]; then
logger -t udev "ERROR: Could not mount '${PARTNAME}' partition, volume not found"
rmdir --ignore-fail-on-non-empty ${MOUNTPOINT}
fi
elif [ "${SUBSYSTEM}" = "ubi" ] && [ "${SINGLEMTDSYS}" = "yes" ]; then
elif [ "${SUBSYSTEM}" = "ubi" ]; then
# In the case of a 'system' partition with many UBI volumes, the device
# is always /dev/ubi0
# Mount the volume.