freebsd / crochet

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

Wrong mountpoint when overriding WORKDIR #63

Closed smithwinston closed 10 years ago

smithwinston commented 10 years ago

If you override WORKDIR the image creation fails because it tries to mount the partitions in ./work (the default WORKDIR) rather than the overridden WORKDIR.

It looks like the BOARD_*_MOUNTPOINT_PREFIX variables used by board_mountpoint are created when lib/board.sh is loaded, which is before the user's config file is loaded.

I'm using crotchet-freebsd with Patrick Kelsey's BBB-multi-install-config.sh configuration file.

smithwinston commented 10 years ago

I was able to work around this issue by redefining the BOARD_*_MOUNTPOINT_PREFIX variables in my config file; I simply copied the definitions from lib/board.sh to just after where I had overridden WORKDIR:

WORKDIR=/root/Work/crotchet-freebsd/work-11-CURRENT
BOARD_UFS_MOUNTPOINT_PREFIX=${WORKDIR}/_.mount.ufs
BOARD_FREEBSD_MOUNTPOINT_PREFIX=${WORKDIR}/_.mount.freebsd
BOARD_FAT_MOUNTPOINT_PREFIX=${WORKDIR}/_.mount.fat
BOARD_BOOT_MOUNTPOINT_PREFIX=${WORKDIR}/_.mount.boot
smithwinston commented 10 years ago

NOTE: Although after running this build I was able to avoid the mount issue, I discovered that the default work directory had indeed been recreated with the following:

work/obj/arm.armv6/usr/src/FreeBSD-CURRENT/

So there's somewhere else in crotchet-freebsd (buildworld?) that's picking up the default WORKDIR.

kientzle commented 10 years ago

On May 1, 2014, at 2:29 PM, smithwinston notifications@github.com wrote:

NOTE: Although after running this build I was able to avoid the mount issue, I discovered that the default work directory had indeed been recreated with the following:

work/obj/arm.armv6/usr/src/FreeBSD-CURRENT/

So there's somewhere else in crotchet-freebsd that's picking up the default WORKDIR.

— Reply to this email directly or view it on GitHub.

Try this patch:

https://gist.github.com/kientzle/84c3a4c54140ca2569c2

It sets default values for a few variables after the config file is loaded.

Tim

smithwinston commented 10 years ago

Excellent, this resolved the issue (both the mount points, and the work/obj/arm.armv6/usr/src/FreeBSD-CURRENT one).

kientzle commented 10 years ago

Fixed.