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

Loading…
Cancel
Save