Commit Graph

26 Commits

Author SHA1 Message Date
Jussi Kukkonen 31943a7ecf linux-dtb: Add PACKAGE_WRITE_DEP for postinstall
update-alternatives is used in postinstall.

(From OE-Core rev: ca2626a78f44a253adf4e93a1eae0ea323a0196f)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:50 +00:00
Denys Dmytriyenko a17171ad66 linux-dtb: strip DTB extension properly in postinst/postrm
The use of awk -F "." in do_install/do_deploy to strip filename extension
was deprecated long time ago in 72980d5bb465f0640ed451d1ebb9c5d2a210ad0c.

Make a similar change in postinst/postrm to properly use basename command.

Otherwise DTB files that contain dots in the name result in broken symlinks
that point to non-existent truncated files.

(From OE-Core rev: 40c2addf0f0ee16b1c1334cf00f1490ffeaac475)

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-09 13:39:11 +00:00
David Vincent de807c7820 kernel: Fix symlinks
When installing a kernel package, the symlinks created by
update-alternatives should point to a path relative to KERNEL_IMAGEDEST
and not an absolute path to '/boot'.

Failing to do so causes problems when resolving the symlink inside some
bootloaders which mount the boot partition elsewhere.

(From OE-Core rev: c7bc46b9bc29dd0953ab8d63b50fa105bb66892e)

Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-22 08:50:17 +00:00
Herve Jourdain d90eaa8518 linux-dtb.inc: Support for .dtbo files for dtb overlays
(From OE-Core rev: 831207ee8fa6fedd6080191bb77a871b0f33e1c1)

Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
He Zhe 0437a59e3c kernel: Add KERNEL_IMAGETYPES to build multi types kernel at one time
Add KERNEL_IMAGETYPES to support building packaging and installing
multi types of kernel images, such as zImage uImage, at one time.

KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE work as before.

(From OE-Core rev: 849b67b2e4820564b5e5c9bd4bb293c44351c5f3)

Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30 15:58:11 +01:00
Christopher Larson c3b96fffac linux-dtb.inc: use absolute upd-alt paths
This works around a limitation of the chkconfig update-alternatives, so it
works with all our update-alternatives providers.

(From OE-Core rev: f78c640f1f41eb12ef7919e7dc99aae7db6f6b17)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-11 23:26:29 +00:00
Stefan Christ dcc446fee0 linux-dtb.inc: refactor common code to function get_real_dtb_path_in_kernel
(From OE-Core rev: 04ed298520d38e0b078723b1b45368b7037cf6e0)

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:31 +00:00
Stefan Christ af9c7a4c57 linux-dtb.inc: refactor common code to function normalize_dtb
(From OE-Core rev: 5dfa10978ef540a7a8cd89766c40625ccfeffda2)

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:31 +00:00
Stefan Christ 7eecb81b6d linux-dtb.inc: explicit test for empty string not needed
The for loop already handles the case when KERNEL_DEVICETREE is empty.

(From OE-Core rev: 49010f4a1ae9570e96691c9faeb17808174488fe)

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:31 +00:00
Stefan Christ 3a0bd40dfc linux-dtb.inc: use same variable name DTB for all elements of KERNEL_DEVICETREE
(From OE-Core rev: 1e9ac2c4970b2fc7f8ed939bce7cf0a5c7715ca3)

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:28 +00:00
Stefan Christ a879312713 linux-dtb.inc: remove unneeded 'cd'
(From OE-Core rev: 2d7680a104e2910c90d8aceeb12c24dfde2cd2d6)

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-11-16 11:39:28 +00:00
Marek Vasut d2e26ef348 kernel: Build DTBs early
Pull out the compilation of the DTB blobs right after the kernel's
own do_compile function finishes. This makes them available just in
time for the kernel image construction functions.

(From OE-Core rev: 86b3f29f93e3f87903668ea317c6bd97be4cdf62)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Koen Kooi <koen@dominion.thruhere.net>
Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: Ross Burton <ross.burton@intel.com>
Cc: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:57:51 +01:00
Otavio Salvador 3c1f166ce5 linux-dtb.inc: Fix dtb generation for kernels newer than 3.8
The 3.8 kernel has change the default directory where the dtb file is
stored. The change has been done at:

,----[ Quote of 3.8 kernel change ]
| commit 499cd8298628eeabf0eb5eb6525d4faa0eec80d8
| Author: Grant Likely <grant.likely@secretlab.ca>
| Date:   Tue Nov 27 16:29:11 2012 -0700
|
|     ARM: dt: change .dtb build rules to build in dts directory
|
|     The current rules have the .dtb files build in a different directory
|     from the .dts files. The only reason for this is that it was what
|     PowerPC has done historically. This patch changes ARM to use the generic
|     dtb rule which builds .dtb files in the same directory as the source .dts.
|
|     Cc: Russell King <linux@arm.linux.org.uk>
|     Cc: Arnd Bergmann <arnd@arndb.de>
|     Acked-by: Olof Johansson <olof@lixom.net>
|     Cc: linux-arm-kernel@lists.infradead.org
|     Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
|     [swarren: added rm command for old stale .dtb files]
|     Signed-off-by: Stephen Warren <swarren@nvidia.com>
|     Signed-off-by: Rob Herring <rob.herring@calxeda.com>
`----

This change adds support for both places to backward and forward
compatibility.

(From OE-Core rev: 0ec3710b8dcae311e8d9d676d5f1c6843a81383b)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-20 15:31:25 +01:00
Otavio Salvador 03b3e4b62f linux-dtb: Use kernel build system to generate the dtb files
As the Linux kernel, unconditionally, builds the dtc application and
it is the compatible version with the DeviceTree files shipped within
the kernel it is better to use it and the kernel build system to
generate the dtb files.

Some DeviceTree files rely on CPP and kernel headers to be able to
generate the dtb binary contents and it is harder to replicate it
outside of Linux kernel build system so we /use/ it.

To comply with these assumptions we need to use the dtb file when
calling 'make' instead of pointing to the DeviceTree source file; the
code has been made backward compatible but it is advised to move to
the new definition to avoid warnings as:

,----[ Original definition ]
| KERNEL_DEVICETREE = "${S}/arch/arm/boot/dts/imx6q-sabresd.dts"
`----

Becomes:

,----[ New definition ]
| KERNEL_DEVICETREE = "imx6q-sabresd.dtb"
`----

(From OE-Core rev: 72980d5bb465f0640ed451d1ebb9c5d2a210ad0c)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-16 11:14:30 +01:00
Mike Looijmans 5bac0df201 linux-dtb.inc: Replace /boot/ with /${KERNEL_IMAGEDEST}/
Devicetree files were installed hard-coded in /boot. When KERNEL_IMAGEDEST
is anything else but "boot", the postinstall script and the file locations
no longer match and the postinstall will fail.

Replace "boot" with "${KERNEL_IMAGEDEST}" to fix this problem, and to allow
the devicetree files to be installed in another location.

(From OE-Core rev: 0f589b9a38397fdf55025062a45889b19d1c83c4)

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-13 23:06:01 +01:00
Richard Purdie c3d18afaa5 classes/recipes/lib: Fix various python whitespace issues
There are some left over tab characters in the python functions. This
removes them and resolves python 3 errors.

(From OE-Core rev: fafeb381c48291fa65c634c01c244843c8d7fad3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09 14:06:51 +01:00
Chase Maupin 824856181b linux-dtb: fix whitespace in bash functions
* Fix the whitespace in the base functions to use TAB instead
  of spaces.  This is to address feedback from:
        Darren Hart <dvhart@linux.intel.com>

(From OE-Core rev: ab6630df4d100ff501b33a1c7ec9d1e6a2d4f0ee)

Signed-off-by: Chase Maupin <Chase.Maupin@ti.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-04 14:08:06 +01:00
Chase Maupin e16dc3d7fc linux-dtb: Add simple DTB symlinks for devicetree
* This is similar to the symlinks provided for the kernel image
  in the /boot directory of a file system.  The goal is to have
  simply named symlinks in /boot that mirror the device tree
  name in the kernel sources.  This is so that programs like
  U-Boot can easily find the default device tree binary in the
  /boot directory and use that when booting the kernel.
* Use update-alternatives to handle proper creation and removal
  of the symlinks.

(From OE-Core rev: 750a9554e1b85d9bd23d18e0630723c3c193c604)

Signed-off-by: Chase Maupin <Chase.Maupin@ti.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-04 14:08:06 +01:00
Anders Roxell f841c83c8f linux-dtc: Make KERNEL_DEVICETREE_FLAGS configurable
(From OE-Core rev: f46c5714bc23a50a207c03cc20c3a6aebe8c5df0)

Signed-off-by: Anders Roxell <anders.roxell@enea.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-22 06:09:23 -08:00
Richard Purdie 73cf0335c4 Remove a number of unneeded import os/bb calls
The bb and os modules are always imported so having these extra import calls
are a waste of space/execution time. They also set a bad example for people
copy and pasting code so clean them up.

(From OE-Core rev: 7d674820958be3a7051ea619effe1a6061d9cbe2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 12:24:50 +01:00
Zhenhua Luo 8c904eb643 linux-dtb: add multi-dtb build support
including following enhancement:
    * support multi-dtb build
    * skip dtb build and install when KERNEL_DEVICETREE is empty
    * print a warning message when specified dts file is not available

(From OE-Core rev: 66f7921f34dfa8b3c7f8f7184715214164f3f8b0)

Signed-off-by: Zhenhua Luo <b19537@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-06-28 16:26:44 +01:00
Richard Purdie b2ae65f7d1 linux-dtb: Ensure dtb files are covered by sstate
The dtb files were not being installed into a location compatible with sstate and
the do_deploy task. This means in builds just using sstate, the dtb files disappeared.

This patch fixes the code to use the correct location for deploy files.

[YOCTO #2190]

(From OE-Core rev: 9815b7a95ac33d3234073cdd204d9389b4241189)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-12 12:37:52 +01:00
Richard Purdie 06f2f8ce0a meta: Convert getVar/getVarFlag(xxx, 1) -> (xxx, True)
Using "1" with getVar is bad coding style and "True" is preferred.
This patch is a sed over the meta directory of the form:

sed \
 -e 's:\(\.getVar([^,()]*, \)1 *):\1True):g' \
 -e 's:\(\.getVarFlag([^,()]*, [^,()]*, \)1 *):\1True):g' \
 -i `grep -ril getVar *`

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-05 10:22:56 -08:00
Richard Purdie c8dee9b92d Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:

sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`

(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-10 11:51:19 +00:00
Richard Purdie 8e93b533ab linux-dtb.inc: Fix package name to match PACKAGES
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-11 10:27:22 +00:00
Bruce Ashfield 970f3959d3 linux: factor dts/dtc/dtb handling into a specific include
Fixes [BUGID #610]

The powerpc linux-yocto kernels were not creating dtb images
in the deploy directories. This was due to two problems:

  - the dtb generation rules were not being configured
  - the boards were not specifying a device tree in their config

This change addresses the first point by factoring out the
dtb generation routines into a new include that can be used by
multiple recipes.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2011-02-09 11:16:34 +00:00