2015-05-08 15:23:21 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
EMBEDDEDBUILD=1
|
|
|
|
EMBEDDED_TARGET="arm"
|
|
|
|
EMBEDDED_TARGET_ARCH="armv6"
|
|
|
|
EMBEDDEDPORTS="sysutils/u-boot-wandboard"
|
2015-05-08 18:55:09 +00:00
|
|
|
KERNEL="IMX6"
|
2015-06-06 21:11:17 +00:00
|
|
|
WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000"
|
2015-06-18 10:26:27 +00:00
|
|
|
IMAGE_SIZE="1G"
|
2015-05-08 15:23:21 +00:00
|
|
|
PART_SCHEME="MBR"
|
2015-05-08 16:37:57 +00:00
|
|
|
FAT_SIZE="50m -b 16384"
|
|
|
|
FAT_TYPE="16"
|
2015-05-08 15:23:21 +00:00
|
|
|
MD_ARGS="-x 63 -y 255"
|
|
|
|
NODOC=1
|
2015-05-29 02:16:40 +00:00
|
|
|
export BOARDNAME="WANDBOARD"
|
2015-05-08 15:23:21 +00:00
|
|
|
|
|
|
|
arm_install_uboot() {
|
2015-05-09 21:08:12 +00:00
|
|
|
UBOOT_DIR="/usr/local/share/u-boot/u-boot-wandboard"
|
2015-05-08 15:23:21 +00:00
|
|
|
UBOOT_FILES="u-boot.imx"
|
2015-05-09 21:08:12 +00:00
|
|
|
FATMOUNT="${DESTDIR%${KERNEL}}/fat"
|
|
|
|
UFSMOUNT="${DESTDIR%${KERNEL}}/ufs"
|
|
|
|
chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
|
2015-05-08 15:23:21 +00:00
|
|
|
of=/dev/${mddev} bs=512 seek=2
|
|
|
|
chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}"
|
|
|
|
chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
|
|
|
|
chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT}
|
2015-05-09 21:08:12 +00:00
|
|
|
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr ${FATMOUNT}/ubldr
|
2015-09-29 16:09:59 +00:00
|
|
|
chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \
|
|
|
|
${FATMOUNT}/ubldr.bin
|
2015-05-09 21:08:12 +00:00
|
|
|
chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot
|
2015-05-08 15:23:21 +00:00
|
|
|
sync
|
|
|
|
umount_loop ${CHROOTDIR}/${FATMOUNT}
|
|
|
|
umount_loop ${CHROOTDIR}/${UFSMOUNT}
|
2015-05-09 21:08:12 +00:00
|
|
|
chroot ${CHROOTDIR} rmdir ${FATMOUNT}
|
|
|
|
chroot ${CHROOTDIR} rmdir ${UFSMOUNT}
|
2015-05-08 15:23:21 +00:00
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|