freebsd / crochet

Build FreeBSD images for RaspberryPi, BeagleBone, PandaBoard, and others.
BSD 2-Clause "Simplified" License
611 stars 187 forks source link

[BeagleBone] build blank image "ubldr is not a directory" #120

Closed f-andrey closed 9 years ago

f-andrey commented 9 years ago

If build new image, this build blank, debug build

+ cd /usr/obj/_.mount.boot
+ shift
+ [ 0 -gt 0 ]
+ eval 'OPTION=' 'OPTIONDIR=' 'BOARDDIR=/root/crochet/board/BeagleBone' freebsd_ubldr_copy_ubldr ubldr
+ OPTION='' OPTIONDIR='' BOARDDIR=/root/crochet/board/BeagleBone freebsd_ubldr_copy_ubldr ubldr
+ echo 'Installing ubldr in ubldr'
Installing ubldr in ubldr
+ CONF=armv6-BEAGLEBONE-IPv6
+ cp /usr/obj/ubldr-armv6-BEAGLEBONE-IPv6/boot/ubldr /usr/obj/ubldr-armv6-BEAGLEBONE-IPv6/boot/ubldr.bin ubldr
cp: ubldr is not a directory
+ exit 1

after this buildenv not clean

root@des:/usr/src # mount | grep obj
localz1/ROOT/init/obj on /usr/obj (zfs, NFS exported, local, noatime, nfsv4acls)
/dev/md0s1 on /usr/obj/_.mount.boot (msdosfs, local)
/dev/md0s2a on /usr/obj/_.mount.freebsd (ufs, local, journaled soft-updates, nfsv4acls)
root@des:/usr/src # ls -la /usr/obj/ubldr-armv6-BEAGLEBONE-IPv6/boot/
total 816
...
-rwxr-xr-x  1 root  wheel  260674 Jul 22 08:31  ubldr
-rwxr-xr-x  1 root  wheel  218828 Jul 22 08:31  ubldr.bin
-rwxr-xr-x  1 root  wheel    3061 Jul 22 04:38  version.4th
root@des:/usr/src # umount /usr/obj/_.mount.freebsd
root@des:/usr/src # umount /usr/obj/_.mount.boot
root@des:/usr/src # mdconfig -d -u 0

If remove patch (dir) ubldr

diff --git a/board/BeagleBone/setup.sh b/board/BeagleBone/setup.sh
index 368721f..8d46bff 100644
--- a/board/BeagleBone/setup.sh
+++ b/board/BeagleBone/setup.sh
@@ -34,7 +34,7 @@ strategy_add $PHASE_BOOT_INSTALL beaglebone_uboot_install

 # Build and install a suitable ubldr
 strategy_add $PHASE_BUILD_OTHER freebsd_ubldr_build UBLDR_LOADADDR=0x88000000
-strategy_add $PHASE_BOOT_INSTALL freebsd_ubldr_copy_ubldr ubldr
+strategy_add $PHASE_BOOT_INSTALL freebsd_ubldr_copy_ubldr .

 # BeagleBone puts the kernel on the FreeBSD UFS partition.
 strategy_add $PHASE_FREEBSD_BOARD_INSTALL board_default_installkernel .

build fine and make bootable image, if mk dir ubldr with ubldr/ubldr.bin image not bootable (may be need change boot env)

+ cd /usr/obj/_.mount.boot
+ shift
+ [ 0 -gt 0 ]
+ eval 'OPTION=' 'OPTIONDIR=' 'BOARDDIR=/root/crochet/board/BeagleBone' freebsd_ubldr_co
py_ubldr .
+ OPTION='' OPTIONDIR='' BOARDDIR=/root/crochet/board/BeagleBone freebsd_ubldr_copy_ubld
r .
+ echo 'Installing ubldr in .'
Installing ubldr in .
+ CONF=armv6-BEAGLEBONE-IPv6
+ cp /usr/obj/ubldr-armv6-BEAGLEBONE-IPv6/boot/ubldr /usr/obj/ubldr-armv6-BEAGLEBONE-IPv
6/boot/ubldr.bin .
+ break

boot log if make dedicated ubldr dir

** Unable to read "u-boot.env" from mmc0:1 **
Using default environment

Net:   <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
reading uEnv.txt
Hit any key to stop autoboot:  0 
Booting from: mmc 0 ubldr
reading ubldr
U-Boot# ls mmc 0 
    78928   mlo 
   376732   u-boot.img 
        0   uenv.txt 
    38243   bbone.dts 
    30553   bbone.dtb 
    39275   bboneblk.dts 
    31366   bboneblk.dtb 
            ubldr/

7 file(s), 1 dir(s)

U-Boot# ls mmc 0 ubldr
            ./
            ../
   260674   ubldr 
   218828   ubldr.bin 

2 file(s), 2 dir(s)
kientzle commented 9 years ago

Thank you for the detailed bug report. I believe this is fixed in commit ebbe016.