Sunday, March 27, 2016

tutorial: Branched workflow setup

This is a series of blogs (my self documentation) on using Nuttx in a branched workflow.
Hopefully its of some use to others.
This starts from the beginning and works through the commands to a built image

Nuttx.org  has a git submodule configuration that adds a layer of complexity to manage the submodules in  a branched workflow environment.
My development environment is Ubuntu 15.10, with Meld to do differencing. 
Meld required Ubunutu 15.10
The editing is done in Eclipse Mars on Windows8 over the network to Ubuntu. I login in remotely to the Ubuntu machine to compile.

Some references

To start sign into bitbucket.org , then clone the following into your <userSpace> on bitbucket
I use a prefix ZZ as you might want to experiment with different instances of Nuttx as the development progress
bitbucket.org/patacongo/nuttx  to ZZ_NuttX   Description: <your plans for the fork>
bitbucket.org/nuttx/apps             ZZ_nuttapps Description: <your plans for an apps>
bitbucket.org/nuttx/arch              ZZ_nuttx-arch Description: Required as part of nuttx
bitbucket.org/nuttx/boards         ZZ_nuttx-config “Nuttx boards definitions”


Then on local machine (mine Ubuntu15.10)
(either setup SSH or use the https form instead of git@bitbucket.org:.... )

cd git
mkdir nxYY    #my top level dir - YY userdefined eg nxwkA
cd nxYY

git clone git@bitbucket.org:<user>/ZZ_nuttapps.git  apps
git clone git@bitbucket.org:<user>/ZZ_nuttx.git nuttx
cd  nuttx
git remote –v (origin should be above)

#
#first time through 
echo "/configs/*" >> .gitignore
echo "/arch/*" >> .gitignore

git add  .gitignore
git commit -m "changed submodule arch configs to directory"
git push origin master   OR if fails or first time on branch   $git push origin <branch-name>

rm -rf arch
rm -rf configs

git clone git@bitbucket.org:<user>/ZZ_nuttx-configs.git  configs
git clone git@bitbucket.org:<user>/ZZ_nuttx-arch.git  arch
git status #shows arch and configs but git ignores any action on them 

#
#optionally should be able to do the following for submodules Documentation 
#- but doesn't work, some hidden submodule meta data still lying around
git submodule init 
#(has error "no submodule mapping found in .gitmodules for path 'arch'"??)
git submodule update  #populates

make distclean
cd  tools
#one of following
$ ./configure.sh stm32f429i-disco/nsh
$ ./configure.sh olimex-stm32-h407/nsh


cd ..
make menuconfig #Step into "Build Setup: ensure host is correct, save, exit to use latest format
#optionally, specify version info
tools/version.sh -v <major.minor> 

make #test build, should work and be tested before continuing

# Do the following for changes to any one of four "projects"
# nuttx   nuttx/arch nuttx/config apps
#eg for nuttx/arch (repeat for other projects as needed)

cd apps
git branch develop  #baseline for future: only first time through

git checkout -b work-<descriptive name>  #new branch eg work-modbusm
git status
<<make changes, build and test>>
git status eg
git add .
git commit -m "sensible comment"
git push origin work-<descriptive name> 

# On Bitbucket.org/<user> check commit is as expected.

No comments:

Post a Comment