From e4db61d315c2b44536050f0f8689c24d3c381b04 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Tue, 24 Jul 2012 14:57:06 -0500 Subject: [PATCH] bootloader: allow use of a local spl/bootloader for testing Signed-off-by: Robert Nelson --- mk_mmc.sh | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/mk_mmc.sh b/mk_mmc.sh index 0ad57e2..6f42b83 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -34,6 +34,8 @@ PARTITION_PREFIX="" unset MMC unset USE_BETA_BOOTLOADER +unset USE_LOCAL_BOOT +unset LOCAL_BOOTLOADER unset ADDON unset FIRMWARE @@ -179,6 +181,22 @@ function rcn-ee_down_use_mirror { RCNEEDOWN=1 } +function local_bootloader { + echo "" + echo "Using Locally Stored Device Bootloader" + echo "-----------------------------" + + if [ "${spl_name}" ] ; then + MLO=${LOCAL_SPL} + echo "SPL Bootloader: ${MLO}" + fi + + if [ "${boot_name}" ] ; then + UBOOT=${LOCAL_BOOTLOADER} + echo "UBOOT Bootloader: ${UBOOT}" + fi +} + function dl_bootloader { echo "" echo "Downloading Device's Bootloader" @@ -1045,7 +1063,11 @@ function dd_to_drive { echo "" echo "Using dd to place bootloader on drive" echo "-----------------------------" - dd if=${TEMPDIR}/dl/${UBOOT} of=${MMC} seek=1 bs=1024 + if [ ! "${LOCAL_BOOTLOADER}" ] ; then + dd if=${TEMPDIR}/dl/${UBOOT} of=${MMC} seek=1 bs=1024 + else + dd if=${UBOOT} of=${MMC} seek=1 bs=1024 + fi bootloader_installed=1 #For now, lets default to fat16, but this could be ext2/3/4 @@ -1871,6 +1893,16 @@ while [ ! -z "$1" ]; do --use-experimental-kernel) EXPERIMENTAL_KERNEL=1 ;; + --spl) + checkparm $2 + LOCAL_SPL="$2" + USE_LOCAL_BOOT=1 + ;; + --bootloader) + checkparm $2 + LOCAL_BOOTLOADER="$2" + USE_LOCAL_BOOT=1 + ;; --use-beta-bootloader) USE_BETA_BOOTLOADER=1 ;; @@ -1905,7 +1937,13 @@ fi check_root detect_software - dl_bootloader + +if [ "${USE_LOCAL_BOOT}" ] ; then + local_bootloader +else + dl_bootloader +fi + dl_kernel_image dl_netinstall_image