-
Notifications
You must be signed in to change notification settings - Fork 77
Creating your Distro Layer
Creating your own layer for this distro can be done by using create-distro-layer script.
To create a custom distro layer named meta-my-layer
with distro name as my-layer
, run (from the root of tegra-demo-distro)
./scripts-setup/create-distro-layer -d my-layer
This script will setup the initial metadata for your layer to integrate with meta-tegra and meta-tegra-support. Note that this script takes layers/meta-tegrademo
as a template.
This will create a layers/meta-my-layer
directory as follows
$ tree meta-my-layer
meta-my-layer
├── classes
│ ├── mender-workarounds.bbclass
│ └── rootfs-postcommands-overrides.bbclass
├── conf
│ ├── distro
│ │ └── my-layer.conf
│ ├── layer.conf
│ └── template-my-layer
│ ├── bblayers.conf.sample
│ ├── conf-notes.txt
│ └── local.conf.sample
└── scripts
├── buildenv-host-gcc-check
└── layer-setup-env
conf/distro/my-layer.conf
will contain distro specific settings for your layer. It is recommended that you should change the following attributes with your custom values:
DISTRO = "my-layer"
DISTRO_NAME = "My-Layer Test Script Distribution"
DISTRO_VERSION_BASE = "X.X"
DISTRO_VERSION = "${DISTRO_VERSION_BASE}+snapshot-${DATE}"
DISTRO_CODENAME = "master"
SDK_VENDOR = "-tdsdk"
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
MAINTAINER = "Test User <test@oe4t>"
TARGET_VENDOR = "-oe4t"
conf/template-my-layer/local.conf.sample
- This file will be used to create a conf/local.conf
for your build directory. Hence, make sure you tweak the settings in this file. Review local.conf.sample for creating your own template.
Ex. You might want to disable debug-tweaks
for production setup. You will need to change EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
to EXTRA_IMAGE_FEATURES ?= ""
in your local.conf.sample
file.
tegra-demo-distro
also includes Mender OTA support. To leverage this support while making your distribution, Use:
./scripts-setup/create-distro-layer -d my-mender -m
This will add mender related settings in your conf/distro/my-mender.conf
. Additionally, it will include mender layers into your conf/template-my-mender/bblayers.conf.sample
to include these layers while you are building your distribution.
NOTE - Executing ./scripts-setup/create-distro-layer --help
will print a help message for more information
If you choose, you can keep all of your customizations in separate layer(s), then easily rebase your work and customizations on top of changes in tegra-demo-distro
to pull in the latest software used here. Here's one way you can accomplish this:
- Get the latest upstream branches by running
git remote add oe4t https://github.com/OE4T/tegra-demo-distro.git
andgit pull oe4t
-
git rebase oe4t/targetbranch
wheretargetbranch
is the branch you want to rebase your work on top of, for instance dunfell-l4t-r32.4.3 - Squash every commit since the latest commit since the the commit at the
HEAD
ofoe4t/targetbranch
withgit rebase -i oe4t/targetbranch
. Vim%s:/pick/squash/g
is useful for this. - Rename your old main branch on your origin repo, something like
git branch -m mymainbranch mymainbranch-release-XXX-and-earlier
followed bygit push origin :mymainbranch mymainbranch-release-XXX-and-earlier
. This keeps the commit history for your customizations of the sharedtegra-demo-distro
project in your private repository trackingtegra-demo-distro
upstream in a new branch calledmymainbranch-release-XXX-and-earlier
. You might need to configure permissions on your git repository to allow renaming main branches. - Rename your current working branch as the main branch, using something like
git branch -m mymainbranch
from within your new working branch and push that back to your local private repository trackingtegra-demo-distro
. - Inform your team members of the need to
git reset --hard origin/mymainbranch
to synchronize theirtegra-demo-distro
clone, since you've rewritten branch history (the old history is still there but moved tomymainbranch-release-XXX-and-earlier