install: add option to install system B for dual boot

https://onedigi.atlassian.net/browse/DEL-8232

Signed-off-by: Mike Engel <Mike.Engel@digi.com>
This commit is contained in:
Mike Engel 2023-01-03 16:17:25 +01:00
parent b90fcda302
commit a0fa0d3812
3 changed files with 105 additions and 65 deletions

View File

@ -51,12 +51,18 @@ echo " --------- --------"
echo " fsbl1 ${INSTALL_ATF_FILENAME}"
echo " fsbl2 ${INSTALL_ATF_FILENAME}"
echo " fip-a ${INSTALL_FIP_FILENAME}"
echo " fip-b ${INSTALL_FIP_FILENAME}"
if test "${install_dualboot}" = "yes"; then
echo " fip-b ${INSTALL_FIP_FILENAME}"
fi
if test "${dualboot}" = "yes"; then
echo " linux_a ${INSTALL_LINUX_FILENAME}"
echo " linux_b ${INSTALL_LINUX_FILENAME}"
if test "${install_dualboot}" = "yes"; then
echo " linux_b ${INSTALL_LINUX_FILENAME}"
fi
echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}"
echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}"
if test "${install_dualboot}" = "yes"; then
echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}"
fi
else
echo " linux ${INSTALL_LINUX_FILENAME}"
echo " recovery ${INSTALL_RECOVERY_FILENAME}"
@ -111,12 +117,14 @@ if test $? -eq 1; then
echo "Aborted.";
exit;
fi
update fip-b mmc ${INSTALL_MMCDEV} ${INSTALL_FIP_FILENAME}
if test $? -eq 1; then
echo "[ERROR] Failed to update fip-b!";
echo "";
echo "Aborted.";
exit;
if test "${install_dualboot}" = "yes"; then
update fip-b mmc ${INSTALL_MMCDEV} ${INSTALL_FIP_FILENAME}
if test $? -eq 1; then
echo "[ERROR] Failed to update fip-b!";
echo "";
echo "Aborted.";
exit;
fi
fi
# Check if uboot_config volume exists (U-Boot env)
@ -141,6 +149,7 @@ fi
setenv bootcmd "
env default -a;
setenv dualboot ${dualboot};
setenv install_dualboot ${install_dualboot};
run ubivolscript;
if test \"\$\{dualboot\}\" = yes; then
echo \"\";
@ -155,17 +164,19 @@ setenv bootcmd "
echo \"Aborted.\";
exit;
fi;
echo \"\";
echo \"\";
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\";
echo \"\";
echo \"\";
update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME} ${force_erase};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update linux_b!\";
if test \"\$\{install_dualboot\}\" = yes; then
echo \"\";
echo \"Aborted.\";
exit;
echo \"\";
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\";
echo \"\";
echo \"\";
update linux_b mmc ${INSTALL_MMCDEV} ${INSTALL_LINUX_FILENAME} ${force_erase};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update linux_b!\";
echo \"\";
echo \"Aborted.\";
exit;
fi;
fi;
echo \"\";
echo \"\";
@ -179,17 +190,19 @@ setenv bootcmd "
echo \"Aborted.\";
exit;
fi;
echo \"\";
echo \"\";
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\";
echo \"\";
echo \"\";
update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update rootfs_b partition!\";
if test \"\$\{install_dualboot\}\" = yes; then
echo \"\";
echo \"Aborted.\";
exit;
echo \"\";
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\";
echo \"\";
echo \"\";
update rootfs_b mmc ${INSTALL_MMCDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update rootfs_b partition!\";
echo \"\";
echo \"Aborted.\";
exit;
fi;
fi;
else
echo \"\";

View File

@ -51,12 +51,18 @@ echo " --------- --------"
echo " fsbl1 ${INSTALL_ATF_FILENAME}"
echo " fsbl2 ${INSTALL_ATF_FILENAME}"
echo " fip-a ${INSTALL_FIP_FILENAME}"
echo " fip-b ${INSTALL_FIP_FILENAME}"
if test "${install_dualboot}" = "yes"; then
echo " fip-b ${INSTALL_FIP_FILENAME}"
fi
if test "${dualboot}" = "yes"; then
echo " linux_a ${INSTALL_LINUX_FILENAME}"
echo " linux_b ${INSTALL_LINUX_FILENAME}"
if test "${install_dualboot}" = "yes"; then
echo " linux_b ${INSTALL_LINUX_FILENAME}"
fi
echo " rootfs_a ${INSTALL_ROOTFS_FILENAME}"
echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}"
if test "${install_dualboot}" = "yes"; then
echo " rootfs_b ${INSTALL_ROOTFS_FILENAME}"
fi
else
echo " linux ${INSTALL_LINUX_FILENAME}"
echo " recovery ${INSTALL_RECOVERY_FILENAME}"
@ -111,12 +117,14 @@ if test $? -eq 1; then
echo "Aborted.";
exit;
fi
update fip-b usb ${INSTALL_USBDEV} ${INSTALL_FIP_FILENAME}
if test $? -eq 1; then
echo "[ERROR] Failed to update fip-b!";
echo "";
echo "Aborted.";
exit;
if test "${install_dualboot}" = "yes"; then
update fip-b usb ${INSTALL_USBDEV} ${INSTALL_FIP_FILENAME}
if test $? -eq 1; then
echo "[ERROR] Failed to update fip-b!";
echo "";
echo "Aborted.";
exit;
fi
fi
# Check if uboot_config volume exists (U-Boot env)
@ -141,6 +149,7 @@ fi
setenv bootcmd "
env default -a;
setenv dualboot ${dualboot};
setenv install_dualboot ${install_dualboot};
run ubivolscript;
usb start;
if test \"\$\{dualboot\}\" = yes; then
@ -156,17 +165,19 @@ setenv bootcmd "
echo \"Aborted.\";
exit;
fi;
echo \"\";
echo \"\";
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\";
echo \"\";
echo \"\";
update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME} ${force_erase};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update linux_b!\";
if test \"\$\{install_dualboot\}\" = yes; then
echo \"\";
echo \"Aborted.\";
exit;
echo \"\";
echo \">> Installing file ${INSTALL_LINUX_FILENAME} on linux_b\";
echo \"\";
echo \"\";
update linux_b usb ${INSTALL_USBDEV} ${INSTALL_LINUX_FILENAME} ${force_erase};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update linux_b!\";
echo \"\";
echo \"Aborted.\";
exit;
fi;
fi;
echo \"\";
echo \"\";
@ -180,17 +191,19 @@ setenv bootcmd "
echo \"Aborted.\";
exit;
fi;
echo \"\";
echo \"\";
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\";
echo \"\";
echo \"\";
update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update rootfs_b partition!\";
if test \"\$\{install_dualboot\}\" = yes; then
echo \"\";
echo \"Aborted.\";
exit;
echo \"\";
echo \">> Installing file ${INSTALL_ROOTFS_FILENAME} on rootfs_b\";
echo \"\";
echo \"\";
update rootfs_b usb ${INSTALL_USBDEV} ${INSTALL_ROOTFS_FILENAME} ${force_erase};
if test \$? -eq 1; then
echo \"[ERROR] Failed to update rootfs_b partition!\";
echo \"\";
echo \"Aborted.\";
exit;
fi;
fi;
else
echo \"\";

View File

@ -47,6 +47,7 @@ show_usage()
echo " 'dey-image-webkit', 'core-image-base'..."
echo " Defaults to '##DEFAULT_IMAGE_NAME##' if not provided."
echo " -n No wait. Skips 10 seconds delay to stop script."
echo " -d Install firmware on dualboot partitions (system A and system B)."
exit 2
}
@ -79,10 +80,11 @@ echo "############################################################"
# -a <atf-filename>
# -f <fip-filename>
# -i <image-name>
while getopts 'a:f:hi:n' c
while getopts 'a:df:hi:n' c
do
case $c in
a) INSTALL_ATF_FILENAME=${OPTARG} ;;
d) INSTALL_DUALBOOT=true ;;
f) INSTALL_FIP_FILENAME=${OPTARG} ;;
h) show_usage ;;
i) IMAGE_NAME=${OPTARG} ;;
@ -169,12 +171,18 @@ if [ "${NOWAIT}" != true ]; then
printf " fsbl1\t${INSTALL_ATF_FILENAME}\n"
printf " fsbl2\t${INSTALL_ATF_FILENAME}\n"
printf " fip-a\t${INSTALL_FIP_FILENAME}\n"
printf " fip-b\t${INSTALL_FIP_FILENAME}\n"
if [ "${INSTALL_DUALBOOT}" = true ]; then
printf " fip-b\t${INSTALL_FIP_FILENAME}\n"
fi
if [ "${DUALBOOT}" = true ]; then
printf " ${LINUX_NAME}_a\t${INSTALL_LINUX_FILENAME}\n"
printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n"
if [ "${INSTALL_DUALBOOT}" = true ]; then
printf " ${LINUX_NAME}_b\t${INSTALL_LINUX_FILENAME}\n"
fi
printf " ${ROOTFS_NAME}_a\t${INSTALL_ROOTFS_FILENAME}\n"
printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n"
if [ "${INSTALL_DUALBOOT}" = true ]; then
printf " ${ROOTFS_NAME}_b\t${INSTALL_ROOTFS_FILENAME}\n"
fi
else
printf " ${LINUX_NAME}\t${INSTALL_LINUX_FILENAME}\n"
printf " ${RECOVERY_NAME}\t${INSTALL_RECOVERY_FILENAME}\n"
@ -204,7 +212,9 @@ part_update "fsbl2" "${INSTALL_ATF_FILENAME}" 5000
# Update FIP
part_update "fip-a" "${INSTALL_FIP_FILENAME}" 5000
part_update "fip-b" "${INSTALL_FIP_FILENAME}" 5000
if [ "${INSTALL_DUALBOOT}" = true ]; then
part_update "fip-b" "${INSTALL_FIP_FILENAME}" 5000
fi
# Environment volume does not exist and needs to be created
if [ "${RUNVOLS}" = true ]; then
@ -247,11 +257,15 @@ if [ "${DUALBOOT}" = true ]; then
# Update Linux A
part_update "${LINUX_NAME}_a" "${INSTALL_LINUX_FILENAME}" 15000
# Update Linux B
part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" 15000
if [ "${INSTALL_DUALBOOT}" = true ]; then
part_update "${LINUX_NAME}_b" "${INSTALL_LINUX_FILENAME}" 15000
fi
# Update Rootfs A
part_update "${ROOTFS_NAME}_a" "${INSTALL_ROOTFS_FILENAME}" 120000
# Update Rootfs B
part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" 120000
if [ "${INSTALL_DUALBOOT}" = true ]; then
part_update "${ROOTFS_NAME}_b" "${INSTALL_ROOTFS_FILENAME}" 120000
fi
else
# Update Linux
part_update "${LINUX_NAME}" "${INSTALL_LINUX_FILENAME}" 15000