diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-08-17 22:31:25 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-08-22 19:43:26 +0300 |
commit | 60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch) | |
tree | ecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta-skeleton | |
parent | e18c61205e0234b03697129c20cc69c9b3940efc (diff) | |
download | openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.xz |
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to
hold all of the layers that we import with git-subtree.
Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta-skeleton')
24 files changed, 915 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta-skeleton/COPYING.MIT b/import-layers/yocto-poky/meta-skeleton/COPYING.MIT new file mode 100644 index 000000000..fb950dc69 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/COPYING.MIT @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/import-layers/yocto-poky/meta-skeleton/conf/layer.conf b/import-layers/yocto-poky/meta-skeleton/conf/layer.conf new file mode 100644 index 000000000..aca163342 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/conf/layer.conf @@ -0,0 +1,15 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "skeleton" +BBFILE_PATTERN_skeleton = "^${LAYERDIR}/" +BBFILE_PRIORITY_skeleton = "1" + +# This should only be incremented on significant changes that will +# cause compatibility issues with other layers +LAYERVERSION_skeleton = "1" + +LAYERDEPENDS_skeleton = "core" diff --git a/import-layers/yocto-poky/meta-skeleton/conf/multilib-example.conf b/import-layers/yocto-poky/meta-skeleton/conf/multilib-example.conf new file mode 100644 index 000000000..da6da7f1f --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/conf/multilib-example.conf @@ -0,0 +1,13 @@ +# +# Sample multilib configuration which the user can either add in local.conf +# or specific in an configuration file like this, then require it. +# +# This configuration specifies an x86 64 bit machine as the main machine +# type and then adds a multilib in the "lib32" directory where those +# libraries are compiled with the "x86" tune. +# + +MACHINE = "qemux86-64" +require conf/multilib.conf +MULTILIBS = "multilib:lib32" +DEFAULTTUNE_virtclass-multilib-lib32 = "x86" diff --git a/import-layers/yocto-poky/meta-skeleton/conf/multilib-example2.conf b/import-layers/yocto-poky/meta-skeleton/conf/multilib-example2.conf new file mode 100644 index 000000000..2596f61d9 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/conf/multilib-example2.conf @@ -0,0 +1,13 @@ +# +# Sample multilib configuration which the user can either add in local.conf +# or specific in an configuration file like this, then require it. +# +# This configuration specifies an x86 64 bit machine as the main machine +# type and then adds a multilib in the "libx32" directory where those +# libraries are compiled with the "x86-64-x32" tune. +# + +MACHINE = "qemux86-64" +require conf/multilib.conf +MULTILIBS = "multilib:libx32" +DEFAULTTUNE_virtclass-multilib-libx32 = "x86-64-x32" diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox/no_rfkill.cfg b/import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox/no_rfkill.cfg new file mode 100644 index 000000000..f840ecd26 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox/no_rfkill.cfg @@ -0,0 +1 @@ +# CONFIG_RFKILL is not set diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox_%.bbappend b/import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox_%.bbappend new file mode 100644 index 000000000..64cdefc76 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-core/busybox/busybox_%.bbappend @@ -0,0 +1,12 @@ +# Example use of configuration fragments for busybox, which uses the same +# mechanism as the linux-yocto kernel recipe. +# +# The entries here will override any entries in the base busybox recipe +# +# More details can be found in the Kernel Dev Manual +# http://www.yoctoproject.org/docs/current/kernel-dev/kernel-dev.html#changing-the-configuration +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += " \ + file://no_rfkill.cfg \ + " diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/COPYING b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/COPYING new file mode 100644 index 000000000..6d45519c8 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/Makefile b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/Makefile new file mode 100644 index 000000000..4ded35fbc --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/Makefile @@ -0,0 +1,14 @@ +obj-m := hello.o + +SRC := $(shell pwd) + +all: + $(MAKE) -C $(KERNEL_SRC) M=$(SRC) + +modules_install: + $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install + +clean: + rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c + rm -f Module.markers Module.symvers modules.order + rm -rf .tmp_versions Modules.symvers diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/hello.c b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/hello.c new file mode 100644 index 000000000..f3c0d372e --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/files/hello.c @@ -0,0 +1,33 @@ +/****************************************************************************** + * + * Copyright (C) 2011 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + *****************************************************************************/ + +#include <linux/module.h> + +int init_module(void) +{ + printk("Hello World!\n"); + return 0; +} + +void cleanup_module(void) +{ + printk("Goodbye Cruel World!\n"); +} + +MODULE_LICENSE("GPL"); diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb new file mode 100644 index 000000000..b140b0ac8 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb @@ -0,0 +1,15 @@ +SUMMARY = "Example of how to build an external Linux kernel module" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e" + +inherit module + +SRC_URI = "file://Makefile \ + file://hello.c \ + file://COPYING \ + " + +S = "${WORKDIR}" + +# The inherit of module.bbclass will automatically name module packages with +# "kernel-module-" prefix as required by the oe-core build environment. diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb new file mode 100644 index 000000000..6194d4f8d --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb @@ -0,0 +1,71 @@ +# linux-yocto-custom.bb: +# +# An example kernel recipe that uses the linux-yocto and oe-core +# kernel classes to apply a subset of yocto kernel management to git +# managed kernel repositories. +# +# To use linux-yocto-custom in your layer, copy this recipe (optionally +# rename it as well) and modify it appropriately for your machine. i.e.: +# +# COMPATIBLE_MACHINE_yourmachine = "yourmachine" +# +# You must also provide a Linux kernel configuration. The most direct +# method is to copy your .config to files/defconfig in your layer, +# in the same directory as the copy (and rename) of this recipe and +# add file://defconfig to your SRC_URI. +# +# To use the yocto kernel tooling to generate a BSP configuration +# using modular configuration fragments, see the yocto-bsp and +# yocto-kernel tools documentation. +# +# Warning: +# +# Building this example without providing a defconfig or BSP +# configuration will result in build or boot errors. This is not a +# bug. +# +# +# Notes: +# +# patches: patches can be merged into to the source git tree itself, +# added via the SRC_URI, or controlled via a BSP +# configuration. +# +# defconfig: When a defconfig is provided, the linux-yocto configuration +# uses the filename as a trigger to use a 'allnoconfig' baseline +# before merging the defconfig into the build. +# +# If the defconfig file was created with make_savedefconfig, +# not all options are specified, and should be restored with their +# defaults, not set to 'n'. To properly expand a defconfig like +# this, specify: KCONFIG_MODE="--alldefconfig" in the kernel +# recipe. +# +# example configuration addition: +# SRC_URI += "file://smp.cfg" +# example patch addition (for kernel v4.x only): +# SRC_URI += "file://0001-linux-version-tweak.patch" +# example feature addition (for kernel v4.x only): +# SRC_URI += "file://feature.scc" +# + +inherit kernel +require recipes-kernel/linux/linux-yocto.inc + +# Override SRC_URI in a copy of this recipe to point at a different source +# tree if you do not want to build from Linus' tree. +SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol=git;nocheckout=1;name=machine" + +LINUX_VERSION ?= "4.2" +LINUX_VERSION_EXTENSION_append = "-custom" + +# Modify SRCREV to a different commit hash in a copy of this recipe to +# build a different release of the Linux kernel. +# tag: v4.2 64291f7db5bd8150a74ad2036f1037e6a0428df2 +SRCREV_machine="64291f7db5bd8150a74ad2036f1037e6a0428df2" + +PV = "${LINUX_VERSION}+git${SRCPV}" + +# Override COMPATIBLE_MACHINE to include your machine in a copy of this recipe +# file. Leaving it empty here ensures an early explicit build failure. +COMPATIBLE_MACHINE = "(^$)" diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/0001-linux-version-tweak.patch b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/0001-linux-version-tweak.patch new file mode 100644 index 000000000..1c88315cd --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/0001-linux-version-tweak.patch @@ -0,0 +1,29 @@ +From fb2c401374d4efe89e8da795e21d96fac038639d Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield <bruce.ashfield@windriver.com> +Date: Mon, 11 Jun 2012 15:31:42 -0400 +Subject: [PATCH] linux: version tweak + +Upstream-Status: Inappropriate [example code] + +Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> +Signed-off-by: Saul Wold <sgw@linux.intel.com> +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index c361593..099e8ff 100644 +--- a/Makefile ++++ b/Makefile +@@ -2,7 +2,7 @@ VERSION = 4 + PATCHLEVEL = 2 + SUBLEVEL = 0 + EXTRAVERSION = +-NAME = Hurr durr I'ma sheep ++NAME = Hurr durr I'ma customized sheep + + # *DOCUMENTATION* + # To see a list of typical targets execute "make help" +-- +2.1.4 + diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/feature.scc b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/feature.scc new file mode 100644 index 000000000..aad5af49f --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/feature.scc @@ -0,0 +1 @@ +patch 0001-linux-version-tweak.patch diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/smp.cfg b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/smp.cfg new file mode 100644 index 000000000..0c26a8626 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/smp.cfg @@ -0,0 +1 @@ +# CONFIG_SMP is not set diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-multilib/images/core-image-multilib-example.bb b/import-layers/yocto-poky/meta-skeleton/recipes-multilib/images/core-image-multilib-example.bb new file mode 100644 index 000000000..f13186f93 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-multilib/images/core-image-multilib-example.bb @@ -0,0 +1,13 @@ +# +# An example of a multilib image +# +# This example includes a lib32 version of bash into an otherwise standard +# sato image. It assumes a "lib32" multilib has been enabled in the user's +# configuration (see the example conf files for examples of this.) +# + +# First include a base image to base things off +require recipes-sato/images/core-image-sato.bb + +# Now add the multilib packages we want to install +IMAGE_INSTALL += "lib32-bash" diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/COPYRIGHT b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/COPYRIGHT new file mode 100644 index 000000000..ec3e17113 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/COPYRIGHT @@ -0,0 +1,15 @@ +Sysvinit is Copyright (C) 1991-2004 Miquel van Smoorenburg + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton new file mode 100644 index 000000000..a3edc9d08 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton @@ -0,0 +1,193 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: skeleton +# Required-Start: $local_fs +# Should-Start: +# Required-Stop: $local_fs +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Example initscript +# Description: This file should be used to construct scripts to be +# placed in /etc/init.d +### END INIT INFO + +# The definition of actions: (From LSB 3.1.0) +# start start the service +# stop stop the service +# restart stop and restart the service if the service is already running, +# otherwise start the service +# try-restart restart the service if the service is already running +# reload cause the configuration of the service to be reloaded without +# actually stopping and restarting the service +# force-reload cause the configuration to be reloaded if the service supports +# this, otherwise restart the service if it is running +# status print the current status of the service + +# The start, stop, restart, force-reload, and status actions shall be supported +# by all init scripts; the reload and the try-restart actions are optional + +# Common steps to convert this skeleton into a real init script +# 1) cp skeleton <the_real_name> +# 2) Set DESC and NAME +# 3) Check whether the daemon app is /usr/sbin/$NAME, if not, set it. +# 4) Set DAEMON_ARGS if there is any +# 5) Remove the useless code + +# NOTE: The skeleton doesn't support the daemon which is a script unless the +# pidof supports "-x" option, please see more comments for pidofproc () +# in /etc/init.d/functions + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +DESC="skeleton" +NAME="skeleton-test" +DAEMON=/usr/sbin/$NAME +DAEMON_ARGS="" +PIDFILE=/var/run/$NAME.pid + +. /etc/init.d/functions || exit 1 + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Read configuration variable file if it is present +[ -r /etc/default/$NAME ] && . /etc/default/$NAME + +# +# Function that starts the daemon/service +# +do_start() { + local status pid + + status=0 + pid=`pidofproc $NAME` || status=$? + case $status in + 0) + echo "$DESC already running ($pid)." + exit 1 + ;; + *) + echo "Starting $DESC ..." + exec $DAEMON $DAEMON_ARGS >/dev/null 2>&1 || status=$? + echo "ERROR: Failed to start $DESC." + exit $status + ;; + esac + + # Add code here, if necessary, that waits for the process to be ready + # to handle requests from services started subsequently which depend + # on this one. As a last resort, sleep for some time. +} + +# +# Function that stops the daemon/service +# +do_stop() { + local pid status + + status=0 + pid=`pidofproc $NAME` || status=$? + case $status in + 0) + # Exit when fail to stop, the kill would complain when fail + kill -s 15 $pid >/dev/null && rm -f $PIDFILE && \ + echo "Stopped $DESC ($pid)." || exit $? + ;; + *) + echo "$DESC is not running; none killed." >&2 + ;; + esac + + # Wait for children to finish too if this is a daemon that forks + # and if the daemon is only ever run from this initscript. + # If the above conditions are not satisfied then add some other code + # that waits for the process to drop all resources that could be + # needed by services started subsequently. A last resort is to + # sleep for some time. + return $status +} + +# +# Function that sends a SIGHUP to the daemon/service +# +do_reload() { + local pid status + + status=0 + # If the daemon can reload its configuration without + # restarting (for example, when it is sent a SIGHUP), + # then implement that here. + pid=`pidofproc $NAME` || status=$? + case $status in + 0) + echo "Reloading $DESC ..." + kill -s 1 $pid || exit $? + ;; + *) + echo "$DESC is not running; none reloaded." >&2 + ;; + esac + exit $status +} + + +# +# Function that shows the daemon/service status +# +status_of_proc () { + local pid status + + status=0 + # pidof output null when no program is running, so no "2>/dev/null". + pid=`pidofproc $NAME` || status=$? + case $status in + 0) + echo "$DESC is running ($pid)." + exit 0 + ;; + *) + echo "$DESC is not running." >&2 + exit $status + ;; + esac +} + +case "$1" in +start) + do_start + ;; +stop) + do_stop || exit $? + ;; +status) + status_of_proc + ;; +restart) + # Always start the service regardless the status of do_stop + do_stop + do_start + ;; +try-restart|force-reload) + # force-reload is the same as reload or try-restart according + # to its definition, the reload is not implemented here, so + # force-reload is the alias of try-restart here, but it should + # be the alias of reload if reload is implemented. + # + # Only start the service when do_stop succeeds + do_stop && do_start + ;; +#reload) + # If the "reload" action is implemented properly, then let the + # force-reload be the alias of reload, and remove it from + # try-restart|force-reload) + # + #do_reload + #;; +*) + echo "Usage: $0 {start|stop|status|restart|try-restart|force-reload}" >&2 + exit 3 + ;; +esac + diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c new file mode 100644 index 000000000..96c67ac11 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c @@ -0,0 +1,12 @@ +#include <unistd.h> + +/* This demo does nothing except for testing /etc/init.d/skeleton */ + +int main(int argc, char *argv[]) +{ + daemon(0, 0); + while (1) { + sleep(1); + } + return 0; +} diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service_0.1.bb b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service_0.1.bb new file mode 100644 index 000000000..c5cd7a97b --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/service/service_0.1.bb @@ -0,0 +1,31 @@ +SUMMARY = "The canonical example of init scripts" +SECTION = "base" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4" + +SRC_URI = "file://skeleton \ + file://skeleton_test.c \ + file://COPYRIGHT \ + " + +do_compile () { + ${CC} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test +} + +do_install () { + install -d ${D}${sysconfdir}/init.d + cat ${WORKDIR}/skeleton | \ + sed -e 's,/etc,${sysconfdir},g' \ + -e 's,/usr/sbin,${sbindir},g' \ + -e 's,/var,${localstatedir},g' \ + -e 's,/usr/bin,${bindir},g' \ + -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/skeleton + chmod a+x ${D}${sysconfdir}/init.d/skeleton + + install -d ${D}${sbindir} + install -m 0755 ${WORKDIR}/skeleton-test ${D}${sbindir}/ +} + +RDEPENDS_${PN} = "initscripts" + +CONFFILES_${PN} += "${sysconfdir}/init.d/skeleton" diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb new file mode 100644 index 000000000..d3c02d5d6 --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb @@ -0,0 +1,76 @@ +SUMMARY = "Example recipe for using inherit useradd" +DESCRIPTION = "This recipe serves as an example for using features from useradd.bbclass" +SECTION = "examples" +PR = "r1" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ + file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +SRC_URI = "file://file1 \ + file://file2 \ + file://file3 \ + file://file4" + +S = "${WORKDIR}" + +PACKAGES =+ "${PN}-user3" + +inherit useradd + +# You must set USERADD_PACKAGES when you inherit useradd. This +# lists which output packages will include the user/group +# creation code. +USERADD_PACKAGES = "${PN} ${PN}-user3" + +# You must also set USERADD_PARAM and/or GROUPADD_PARAM when +# you inherit useradd. + +# USERADD_PARAM specifies command line options to pass to the +# useradd command. Multiple users can be created by separating +# the commands with a semicolon. Here we'll create two users, +# user1 and user2: +USERADD_PARAM_${PN} = "-u 1200 -d /home/user1 -r -s /bin/bash user1; -u 1201 -d /home/user2 -r -s /bin/bash user2" + +# user3 will be managed in the useradd-example-user3 pacakge: +# As an example, we use the -P option to set clear text password for user3 +USERADD_PARAM_${PN}-user3 = "-u 1202 -d /home/user3 -r -s /bin/bash -P 'user3' user3" + +# GROUPADD_PARAM works the same way, which you set to the options +# you'd normally pass to the groupadd command. This will create +# groups group1 and group2: +GROUPADD_PARAM_${PN} = "-g 880 group1; -g 890 group2" + +# Likewise, we'll manage group3 in the useradd-example-user3 package: +GROUPADD_PARAM_${PN}-user3 = "-g 900 group3" + +do_install () { + install -d -m 755 ${D}${datadir}/user1 + install -d -m 755 ${D}${datadir}/user2 + install -d -m 755 ${D}${datadir}/user3 + + install -p -m 644 file1 ${D}${datadir}/user1/ + install -p -m 644 file2 ${D}${datadir}/user1/ + + install -p -m 644 file2 ${D}${datadir}/user2/ + install -p -m 644 file3 ${D}${datadir}/user2/ + + install -p -m 644 file3 ${D}${datadir}/user3/ + install -p -m 644 file4 ${D}${datadir}/user3/ + + # The new users and groups are created before the do_install + # step, so you are now free to make use of them: + chown -R user1 ${D}${datadir}/user1 + chown -R user2 ${D}${datadir}/user2 + chown -R user3 ${D}${datadir}/user3 + + chgrp -R group1 ${D}${datadir}/user1 + chgrp -R group2 ${D}${datadir}/user2 + chgrp -R group3 ${D}${datadir}/user3 +} + +FILES_${PN} = "${datadir}/user1/* ${datadir}/user2/*" +FILES_${PN}-user3 = "${datadir}/user3/*" + +# Prevents do_package failures with: +# debugsources.list: No such file or directory: +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file1 b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file1 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file1 diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file2 b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file2 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file2 diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file3 b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file3 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file3 diff --git a/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file4 b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file4 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/import-layers/yocto-poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file4 |