![Embedded Linux Development Using Yocto Project Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/294/36700294/b_36700294.jpg)
上QQ阅读APP看书,第一时间看更新
There's more...
To maintain build history, it's important to optimize it and prevent it from growing over time. Periodic backups of build history and clean-ups of older data are important to keep the build history repository at a manageable size.
Once the buildhistory directory has been backed up, the following process will trim it and keep only the most recent history:
- Copy your repository to a temporary RAM filesystem (tmpfs) to speed things up. Check the output of the df -h command to see which directories are tmpfs filesystems and how much space they have available, and use one. For example, in Ubuntu 16.04, the /run/ directory is available.
- Copy build history to the /run directory as follows:
$ sudo mkdir /run/workspace $ sudo chown ${USER} /run/workspace/ $ cp -r /opt/yocto/fsl-community-bsp/wandboard/buildhistory/ /run/workspace/ $ cd /run/workspace/buildhistory/
- Add a graft point for a commit 1 month ago with no parents:
$ git rev-parse "HEAD@{1 month ago}" > .git/info/grafts
- Make the graft point permanent:
$ git filter-branch
- Clone a new repository to clean up the remaining Git objects:
$ git clone file://${tmpfs}/buildhistory buildhistory.new
- Replace the old buildhistory directory with the new cleaned one:
$ rm -rf buildhistory $ mv buildhistory.new /opt/yocto/fsl-community-bsp/wandboard/buildhistory/
- And finally, remove the workspace:
$ rm -rf /run/workspace/