This repository has been archived by the owner on Jan 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
classes/kernel: add useflag kernel_dts_vendor #193
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ | |
## @var KERNEL_IMAGE_DEPLOY_LINK The link name of the symlink to | ||
## KERNEL_IMAGE_DEPLOY_FILE. | ||
## @var KERNEL_DTB_DIR Location of the compiled devicetree. | ||
## @var KERNEL_DTB_VENDOR Vendor subdir of the compiled devicetree. | ||
## @var KERNEL_DTB_FILE Name of the compiled devicetree | ||
## @var KERNEL_DTB_DEPLOY_NAME name of the deployed devicetree. Used in | ||
## KERNEL_DTB_DEPLOY_FILE and in | ||
|
@@ -248,18 +249,20 @@ UIMAGE_KERNEL_OUTPUT = "" | |
UIMAGE_KERNEL_OUTPUT:USE_kernel_uimage = "arch/${KERNEL_ARCH}/boot/uImage" | ||
KERNEL_OUTPUT += "${UIMAGE_KERNEL_OUTPUT}" | ||
|
||
CLASS_FLAGS += "kernel_external_dtb kernel_dtc kernel_dtc_flags kernel_dts" | ||
CLASS_FLAGS += "kernel_external_dtb kernel_dtc kernel_dtc_flags kernel_dts_vendor kernel_dts" | ||
DEFAULT_USE_kernel_dtc_flags = "-R 8 -p 0x3000" | ||
|
||
KERNEL_DTS_DIR = "arch/${KERNEL_ARCH}/boot/dts/" | ||
KERNEL_DTS_DIR:USE_kernel_dts_dir = "${USE_kernel_dts_dir}" | ||
KERNEL_DTS_FILE = "${MACHINE}.dts" | ||
KERNEL_DTS_NAME = "${MACHINE}" | ||
KERNEL_DTB_VENDOR = "" | ||
KERNEL_DTB_FILE = "" | ||
|
||
addhook kernel_devicetree_init to post_recipe_parse after set_useflags | ||
def kernel_devicetree_init(d): | ||
kernel_dtb = d.get('USE_kernel_external_dtb') | ||
kernel_dts_vendor = d.get('USE_kernel_dts_vendor') | ||
kernel_dts = d.get('USE_kernel_dts') | ||
if (kernel_dts and kernel_dts != "1"): | ||
if(kernel_dtb): | ||
|
@@ -268,6 +271,8 @@ def kernel_devicetree_init(d): | |
" and USE_kernel_dts makes no sense") | ||
dts_name,ext = os.path.splitext(kernel_dts) | ||
d.set('KERNEL_DTS_FILE', kernel_dts) | ||
if (kernel_dts_vendor and kernel_dts_vendor != "1"): | ||
d.set('KERNEL_DTB_VENDOR', kernel_dts_vendor) | ||
d.set('KERNEL_DTB_FILE',dts_name+'.dtb') | ||
d.set('KERNEL_DTS_NAME',dts_name) | ||
d.set('KERNEL_DTB_TARGET',dts_name) | ||
|
@@ -287,12 +292,12 @@ do_compile_kernel_dtc() { | |
|
||
KERNEL_COMPILE_POSTFUNCS:>USE_kernel_dts += " do_compile_kernel_dts" | ||
do_compile_kernel_dts() { | ||
oe_runmake "${KERNEL_DTB_FILE}" | ||
oe_runmake "${KERNEL_DTB_VENDOR}/${KERNEL_DTB_FILE}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was afraid the this would break if
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right its not very pretty there... I'll look into it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really mind the heading slash... |
||
} | ||
|
||
KERNEL_COMPILE_POSTFUNCS:>USE_kernel_external_dtb += " do_compile_kernel_external_dtb" | ||
do_compile_kernel_external_dtb() { | ||
cp ${SRCDIR}/${KERNEL_DTB_FILE} ${S}/${KERNEL_DTS_DIR}/${KERNEL_DTB_FILE} | ||
cp ${SRCDIR}/${KERNEL_DTB_FILE} ${S}/${KERNEL_DTS_DIR}/${KERNEL_DTB_VENDOR}/${KERNEL_DTB_FILE} | ||
} | ||
|
||
CLASS_FLAGS += "kernel_perf" | ||
|
@@ -325,7 +330,7 @@ do_install_kernel () { | |
install -m 0644 ${KERNEL_IMAGE} ${D}${bootdir}/${KERNEL_IMAGE_FILENAME} | ||
|
||
if [ -n "${KERNEL_DTB_FILE}" ] ; then | ||
install -m 0644 ${KERNEL_DTS_DIR}/${KERNEL_DTB_FILE} ${D}${bootdir}/${KERNEL_DTB_FILENAME} | ||
install -m 0644 ${KERNEL_DTS_DIR}/${KERNEL_DTB_VENDOR}/${KERNEL_DTB_FILE} ${D}${bootdir}/${KERNEL_DTB_FILENAME} | ||
fi | ||
|
||
if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then | ||
|
@@ -407,9 +412,9 @@ do_deploy() { | |
>${IMAGE_DEPLOY_DIR}/${KERNEL_IMAGE_DEPLOY_FILE}.md5 | ||
|
||
if [ -n "${KERNEL_DTB_FILE}" ] ; then | ||
install -m 0644 "${KERNEL_DTS_DIR}/${KERNEL_DTB_FILE}" \ | ||
install -m 0644 "${KERNEL_DTS_DIR}/${KERNEL_DTB_VENDOR}/${KERNEL_DTB_FILE}" \ | ||
${IMAGE_DEPLOY_DIR}/${KERNEL_DTB_DEPLOY_FILE} | ||
md5sum <"${KERNEL_DTS_DIR}/${KERNEL_DTB_FILE}" \ | ||
md5sum <"${KERNEL_DTS_DIR}/${KERNEL_DTB_VENDOR}/${KERNEL_DTB_FILE}" \ | ||
>${IMAGE_DEPLOY_DIR}/${KERNEL_DTB_DEPLOY_FILE}.md5 | ||
fi | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without any setting of USE_kernel_dts_vendor, will we end up with None? And how is that handled later on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the @mnhu comments answer this question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That depends on how
d.set('KERNEL_DTB_VENDOR', kernel_dts_vendor)
is handled by oe-lite...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will re-formulate. Have you tested this change with USE_kernel_dts set, but without USE_kernel_dts_vendor set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and it fails 👎
CRITICAL: bake failed: Exception: Cannot expand variable ${KERNEL_DTB_VENDOR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now have tested this with and without USE_kernel_dts_vendor set...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better do
kernel_dts_vendor = d.get('USE_kernel_dts_vendor') or ''
instead of the conditional below.