simplify bootloader

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pull/8/head
Robert Nelson 13 years ago
parent 98fafe4e60
commit 110fb5deb6

@ -34,7 +34,6 @@ PARTITION_PREFIX=""
unset MMC
unset USE_BETA_BOOTLOADER
unset DD_UBOOT
unset ADDON
unset FIRMWARE
@ -208,17 +207,23 @@ function dl_bootloader {
ABI="ABI2"
fi
if [ "${SPL_BOOT}" ] ; then
MLO=$(cat ${TEMPDIR}/dl/bootloader | grep "${ABI}:${BOOTLOADER}:SPL" | awk '{print $2}')
wget --no-verbose --directory-prefix=${TEMPDIR}/dl/ ${MLO}
MLO=${MLO##*/}
echo "SPL Bootloader: ${MLO}"
fi
if [ "${spl_name}" ] ; then
MLO=$(cat ${TEMPDIR}/dl/bootloader | grep "${ABI}:${BOOTLOADER}:${SPL}" | awk '{print $2}')
wget --no-verbose --directory-prefix=${TEMPDIR}/dl/ ${MLO}
MLO=${MLO##*/}
echo "SPL Bootloader: ${MLO}"
else
unset MLO
fi
UBOOT=$(cat ${TEMPDIR}/dl/bootloader | grep "${ABI}:${BOOTLOADER}:BOOT" | awk '{print $2}')
wget --directory-prefix=${TEMPDIR}/dl/ ${UBOOT}
UBOOT=${UBOOT##*/}
echo "UBOOT Bootloader: ${UBOOT}"
if [ "${boot_name}" ] ; then
UBOOT=$(cat ${TEMPDIR}/dl/bootloader | grep "${ABI}:${BOOTLOADER}:BOOT" | awk '{print $2}')
wget --directory-prefix=${TEMPDIR}/dl/ ${UBOOT}
UBOOT=${UBOOT##*/}
echo "UBOOT Bootloader: ${UBOOT}"
else
unset UBOOT
fi
}
function dl_kernel_image {
@ -1065,11 +1070,14 @@ function format_boot_partition {
}
function create_partitions {
if [ "${DD_UBOOT}" ] ; then
dd_to_drive
else
case "${bootloader_location}" in
omap_fatfs_boot_part)
omap_fatfs_boot_part
fi
;;
dd_to_drive)
dd_to_drive
;;
esac
format_boot_partition
}
@ -1084,25 +1092,19 @@ function populate_boot {
if mount -t vfat ${MMC}${PARTITION_PREFIX}1 ${TEMPDIR}/disk; then
mkdir -p ${TEMPDIR}/disk/backup
if [ "${SPL_BOOT}" ] ; then
if [ "${spl_name}" ] ; then
if [ -f ${TEMPDIR}/dl/${MLO} ]; then
cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/MLO
cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/backup/MLO
cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/${spl_name}
cp -v ${TEMPDIR}/dl/${MLO} ${TEMPDIR}/disk/backup/${spl_name}
echo "-----------------------------"
fi
fi
if [ ! "${DD_UBOOT}" ] ; then
if [ "${boot_name}" ] ; then
if [ -f ${TEMPDIR}/dl/${UBOOT} ]; then
if echo ${UBOOT} | grep img > /dev/null 2>&1;then
cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/u-boot.img
cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/backup/u-boot.img
echo "-----------------------------"
else
cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/u-boot.bin
cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/backup/u-boot.bin
echo "-----------------------------"
fi
cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/${boot_name}
cp -v ${TEMPDIR}/dl/${UBOOT} ${TEMPDIR}/disk/backup/${boot_name}
echo "-----------------------------"
fi
fi
@ -1431,7 +1433,12 @@ function check_mmc {
function is_omap {
IS_OMAP=1
SPL_BOOT=1
bootloader_location="omap_fatfs_boot_part"
SPL="SPL"
spl_name="MLO"
boot_name="u-boot.img"
SUBARCH="omap"
kernel_addr="0x80300000"
@ -1460,6 +1467,11 @@ function is_omap {
function is_imx {
IS_IMX=1
bootloader_location="dd_to_drive"
SPL="BOOT"
spl_name="ignore"
SERIAL_CONSOLE="${SERIAL},115200"
SUBARCH="imx"
@ -1470,18 +1482,19 @@ function is_imx {
}
function check_uboot_type {
unset SPL_BOOT
unset DO_UBOOT
unset IN_VALID_UBOOT
unset SMSC95XX_MOREMEM
unset USE_ZIMAGE
unset USE_KMS
unset dtb_file
unset bootloader_location
unset spl_name
unset boot_name
case "${UBOOT_TYPE}" in
beagle_bx)
SYSTEM="beagle_bx"
DO_UBOOT=1
BOOTLOADER="BEAGLEBOARD_BX"
SERIAL="ttyO2"
is_omap
@ -1494,7 +1507,6 @@ function check_uboot_type {
;;
beagle_cx)
SYSTEM="beagle_cx"
DO_UBOOT=1
BOOTLOADER="BEAGLEBOARD_CX"
SERIAL="ttyO2"
is_omap
@ -1508,7 +1520,6 @@ function check_uboot_type {
;;
beagle_xm)
SYSTEM="beagle_xm"
DO_UBOOT=1
BOOTLOADER="BEAGLEBOARD_XM"
SERIAL="ttyO2"
is_omap
@ -1517,7 +1528,6 @@ function check_uboot_type {
;;
beagle_xm_kms)
SYSTEM="beagle_xm"
DO_UBOOT=1
BOOTLOADER="BEAGLEBOARD_XM"
SERIAL="ttyO2"
is_omap
@ -1531,7 +1541,6 @@ function check_uboot_type {
;;
bone)
SYSTEM="bone"
DO_UBOOT=1
BOOTLOADER="BEAGLEBONE_A"
SERIAL="ttyO0"
is_omap
@ -1545,7 +1554,6 @@ function check_uboot_type {
;;
bone_zimage)
SYSTEM="bone_zimage"
DO_UBOOT=1
BOOTLOADER="BEAGLEBONE_A"
SERIAL="ttyO0"
is_omap
@ -1562,7 +1570,6 @@ function check_uboot_type {
;;
igepv2)
SYSTEM="igepv2"
DO_UBOOT=1
BOOTLOADER="IGEP00X0"
SERIAL="ttyO2"
is_omap
@ -1572,7 +1579,6 @@ function check_uboot_type {
;;
panda)
SYSTEM="panda"
DO_UBOOT=1
BOOTLOADER="PANDABOARD"
SMSC95XX_MOREMEM=1
SERIAL="ttyO2"
@ -1584,7 +1590,6 @@ function check_uboot_type {
;;
panda_es)
SYSTEM="panda_es"
DO_UBOOT=1
BOOTLOADER="PANDABOARD_ES"
SMSC95XX_MOREMEM=1
SERIAL="ttyO2"
@ -1596,7 +1601,6 @@ function check_uboot_type {
;;
panda_kms)
SYSTEM="panda_es"
DO_UBOOT=1
BOOTLOADER="PANDABOARD_ES"
SMSC95XX_MOREMEM=1
SERIAL="ttyO2"
@ -1612,7 +1616,6 @@ function check_uboot_type {
;;
crane)
SYSTEM="crane"
DO_UBOOT=1
BOOTLOADER="CRANEBOARD"
SERIAL="ttyO2"
is_omap
@ -1623,8 +1626,6 @@ function check_uboot_type {
;;
mx51evk)
SYSTEM="mx51evk"
DO_UBOOT=1
DD_UBOOT=1
BOOTLOADER="MX51EVK"
SERIAL="ttymxc0"
is_imx
@ -1637,8 +1638,6 @@ function check_uboot_type {
;;
mx53loco)
SYSTEM="mx53loco"
DO_UBOOT=1
DD_UBOOT=1
BOOTLOADER="MX53LOCO"
SERIAL="ttymxc0"
is_imx

Loading…
Cancel
Save