Simple ybd workflow for working on local changes in-place

You will have a definitions checkout, and have successfully built the baserock system.

1. Get the repo

Clone the git repo to a local location for you to make changes, e.g.

cd /src && git clone git://git.baserock.org/delta/genivi/genivi-demo-platform-hmi

2. Make local changes

Enter the local repo, make changes, and commit them, e.g.

cd /src/genivi-demo-platform-hmi
git checkout hack
vim app/gdp-hmi-launcher2/content/ContentModel.qml # comment-out the Fuel Stop Advisor's entry
git add .
git commit -m "Remove Fuel Stop Advisor"

3. Refer to your local changes

From your definitions checkout, find the chunk in your strata, and change the repo and ref to your local versions, e.g. in strata/genivi-demo-platform.morph, the chunk "genivi-demo-platform-hmi" has been replaced with

- name: genivi-demo-platform-hmi
  morph: strata/genivi-demo-platform/genivi-demo-platform-hmi.morph
  repo: file:///src/genivi-demo-platform-hmi
  ref: hack

4. Build just that chunk

In ybd, this is, for example:

cd /src/definitions
/src/ybd/ybd.py strata/genivi-demo-platform/genivi-demo-platform-hmi.morph armv7lhf | tee ybd.log

5. Extract that chunk onto your rootfs

WARNING: This is a risky thing to do and may lead to unpredictable behaviour. For example, it will not work properly at all, if your changes are based on moving or deleting files that are produced by that chunk.

Near the end of ybd's output, it will name the chunk that it just finished building, e.g.

15-10-16 00:02:19 [1/1/313] [genivi-demo-platform-hmi] Now cached 1763943 bytes as genivi-demo-platform-hmi.d7857e45cec7b2893db7dbae409b7925950bc224e5a765e92c1176bcb5938e2b

Go to your artifact cache dir (common places to find this are $HOME/.cache/ybd/artifacts, or $BASE/artifacts (where $BASE is the value of the ybd config variable "base"). In my case, it's "/src/artifacts". Extract it with the tar command

tar -zxvf $BASE/artifacts/$ARTIFACT/$ARTIFACT -C /

For example...

tar -zxvf /src/artifacts/genivi-demo-platform-hmi.d7857e45cec7b2893db7dbae409b7925950bc224e5a765e92c1176bcb5938e2b/genivi-demo-platform-hmi.d7857e45cec7b2893db7dbae409b7925950bc224e5a765e92c1176bcb5938e2b -C /

6. Reboot

For the sake of convenience, the simplest way to see whether changes to the HMI have worked is to reboot your system