freebsd / crochet

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

Versioned uboot patches #50

Closed pkelsey closed 10 years ago

pkelsey commented 10 years ago

Until my disk_pull_request branch is merged into kientzle:master, the diffs for this feature are best viewed at https://github.com/pkelsey/crochet-freebsd/compare/disk_pull_request...versioned_uboot_patches.

This branch adds support for versioning uboot patch files so it's easier to maintain a set of uboot patch files against one uboot release while support for another uboot release, or master, is developed. Also, users may have achieved stability with a given uboot release and be reluctant to move ahead to a later version, in which case it is beneficial to be able to keep the older patchset around for continued used with the older uboot release.

uboot_set_patch_version <uboot_src_dir> [patch_version] must now be called before uboot_test or uboot_patch_files is called. This sets the new variable UBOOT_PATCH_VERSION to patch_version, if it is supplied, or otherwise extracts the version from the uboot_src_dir parameter. Failing that, the result will be "unknown". Typically, this call will look like uboot_set_patch_version ${<board>_UBOOT_SRC} ${<board>_UBOOT_PATCH_VERSION}, so the user can set <board>_UBOOT_PATCH_VERSION to select a specific set of patches.

uboot_patch_files returns the pattern that will identify the set of patch files corresponding to ${UBOOT_PATCH_VERSION}. The pattern is currently ${BOARDDIR}/files/uboot-${UBOOT_PATCH_VERSION}_*.patch.

uboot_test ... no longer requires the fetch instructions to be provided in common configurations, as _uboot_download_instructions is now capable of generating sensible instructions when the source version is a uboot release version number or is "master". Note that _uboot_download_instructions first examines the supplied source dir to determine the version to use in generating download instructions, and if that fails, it assumes that ${UBOOT_PATCH_VERSION} represents the uboot release that is being used under a non-standard directory name and gives instructions for fetching that version to the standard place.

board/BeagleBone/setup.sh will not try to use the sysutils/u-boot-beaglebone-eabi port unless BEAGLEBONE_UBOOT_PATCH_VERSION is empty.

All of the extant uboot patch files for each board have been renamed to use the appropriate uboot-<version>_ prefix. In the case of Wandboard, some of the patch files were further renamed to follow the convention used by the other boards where the path of the file being patched is included in the patch file name.

kientzle commented 10 years ago

On Mar 10, 2014, at 2:43 PM, Patrick Kelsey notifications@github.com wrote:

uboot_test ... no longer requires the fetch instructions to be provided in common configurations, as ubootdownload_instructions is now capable of generating sensible instructions when the source version is a uboot relase version number or is "master". Note that ubootdownload_instructions first examines the supplied source dir to determine the version to use in generating download instructions, and if that fails, it assumes that ${UBOOT_PATCH_VERSION} represents the uboot release that is being used under a non-standard directory name and gives instructions for fetching that version to the standard place.

Just want to make sure:

This does the right thing when U-Boot sources are coming from somewhere other than denx, right?

For BeagleBone, I think it was a full year before support was fully integrated into the denx sources. Before that, U-Boot sources for BeagleBone were only available from the BeagleBone source repos.

Tim

pkelsey commented 10 years ago

The standard case is considered to be that for a given board, there is a (possibly empty) set of patches to be applied against a denx u-boot release or denx master, and that any patches are named uboot-<version>_<rest of patch name>.patch.

The version string can really be anything that suitably differentiates the patchset. If you are using a source base from other-than-denx, you would explicitly set the uboot patch version in the board setup script and you would still provide custom fetch instructions to uboot_test. A current example of this can be seen in https://github.com/kientzle/crochet-freebsd/blob/master/board/RaspberryPi/setup.sh, where the version is set to "rpi" and custom instructions are specified in the call to uboot_test in raspberry_pi_check_uboot.