From 89ab4301088df3d1f7c13d9a2d553f12bb07b3df Mon Sep 17 00:00:00 2001 From: OYTIS Date: Tue, 22 Nov 2016 18:24:54 +0100 Subject: Initial commit --- meta-sota-raspberrypi/LICENSE | 373 ++++++++++++++++++++++++++++++++++++++++ meta-sota-raspberrypi/README.md | 1 + 2 files changed, 374 insertions(+) create mode 100644 meta-sota-raspberrypi/LICENSE create mode 100644 meta-sota-raspberrypi/README.md diff --git a/meta-sota-raspberrypi/LICENSE b/meta-sota-raspberrypi/LICENSE new file mode 100644 index 0000000..a612ad9 --- /dev/null +++ b/meta-sota-raspberrypi/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/meta-sota-raspberrypi/README.md b/meta-sota-raspberrypi/README.md new file mode 100644 index 0000000..0b03b85 --- /dev/null +++ b/meta-sota-raspberrypi/README.md @@ -0,0 +1 @@ +# meta-updater-raspberrypi \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 58c68cd46c73c887485aaab440723a3f5d81c6fc Mon Sep 17 00:00:00 2001 From: OYTIS Date: Tue, 22 Nov 2016 18:31:24 +0100 Subject: Update README.md --- meta-sota-raspberrypi/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta-sota-raspberrypi/README.md b/meta-sota-raspberrypi/README.md index 0b03b85..050658a 100644 --- a/meta-sota-raspberrypi/README.md +++ b/meta-sota-raspberrypi/README.md @@ -1 +1,3 @@ -# meta-updater-raspberrypi \ No newline at end of file +# BSP layer for updating Raspberrypi with OSTree + +OSTree bootloader integration for Raspberry Pi. Add it to BBLAYERS when using [meta-updater](https://github.com/advancedtelematic/meta-updater) with [Raspberry Pi](https://github.com/agherzan/meta-raspberrypi). -- cgit v1.2.3-54-g00ecf From c51f5c98674883b75db0133693b00b99aa6efb7d Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Tue, 22 Nov 2016 18:39:02 +0100 Subject: OSTree bootloader integration --- meta-sota-raspberrypi/conf/layer.conf | 11 +++++ .../bootfiles/bcm2835-bootfiles.bbappend | 1 + .../recipes-bsp/bootfiles/rpi-config_git.bbappend | 15 +++++++ .../linux-raspberrypi/0002-faytech-fix-rpi.patch | 33 ++++++++++++++ .../linux/linux-raspberrypi_4.4.bbappend | 51 ++++++++++++++++++++++ 5 files changed, 111 insertions(+) create mode 100644 meta-sota-raspberrypi/conf/layer.conf create mode 100644 meta-sota-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend create mode 100644 meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend create mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch create mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend diff --git a/meta-sota-raspberrypi/conf/layer.conf b/meta-sota-raspberrypi/conf/layer.conf new file mode 100644 index 0000000..d3ade49 --- /dev/null +++ b/meta-sota-raspberrypi/conf/layer.conf @@ -0,0 +1,11 @@ +# 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 += "updater-raspberrypi" +BBFILE_PATTERN_agl = "^${LAYERDIR}/" +BBFILE_PRIORITY_updater-raspberrypi = "7" + diff --git a/meta-sota-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend b/meta-sota-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend new file mode 100644 index 0000000..adb19c0 --- /dev/null +++ b/meta-sota-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend @@ -0,0 +1 @@ +RDEPENDS_${PN}_append_sota += " u-boot-otascript" diff --git a/meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend new file mode 100644 index 0000000..ff14d36 --- /dev/null +++ b/meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend @@ -0,0 +1,15 @@ +DISABLE_OVERSCAN = "1" + +do_deploy_append() { + echo "avoid_warnings=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=vc4-kms-v3d-overlay,cma-256" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=rpi-ft5406-overlay" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtparam=audio=on" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt +} + +do_deploy_append_sota() { + echo "device_tree_address=0x0c800000" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt +} + +ENABLE_UART_raspberrypi3 = "1" diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch new file mode 100644 index 0000000..00e3692 --- /dev/null +++ b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch @@ -0,0 +1,33 @@ +From f9fefc63456dd50eeec727ae2fbc13b0d84eb44e Mon Sep 17 00:00:00 2001 +From: Tom Pollard +Date: Wed, 6 Apr 2016 07:47:25 +0000 +Subject: [PATCH 1/1] Fix lack of touch up for Faytech 10" Touchscreen MonitorV2 + +NOTE: This is a very temporary hack that is not in a state to be upstreamed yet. +--- +Index: a/drivers/hid/hid-multitouch.c +=================================================================== +--- a/drivers/hid/hid-multitouch.c 2016-07-05 08:45:06.006466000 +0000 ++++ b/drivers/hid/hid-multitouch.c 2016-07-05 08:48:44.574466000 +0000 +@@ -205,7 +205,6 @@ + { .name = MT_CLS_WIN_8, + .quirks = MT_QUIRK_ALWAYS_VALID | + MT_QUIRK_IGNORE_DUPLICATES | +- MT_QUIRK_HOVERING | + MT_QUIRK_CONTACT_CNT_ACCURATE }, + { .name = MT_CLS_EXPORT_ALL_INPUTS, + .quirks = MT_QUIRK_ALWAYS_VALID | +@@ -396,11 +395,6 @@ + td->is_buttonpad = true; + + break; +- case 0xff0000c5: +- /* Retrieve the Win8 blob once to enable some devices */ +- if (usage->usage_index == 0) +- mt_get_feature(hdev, field->report); +- break; + } + } + +-- +1.9.1 diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend new file mode 100644 index 0000000..0a0ddf8 --- /dev/null +++ b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend @@ -0,0 +1,51 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" + +LINUX_VERSION = "4.4.16" + +SRCREV = "26550dcfb86b0308a99f726abbfb55abb1b0f78c" + +SRC_URI_append = "\ + ${@base_conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \ +" + +do_configure_append_sota() { + # ramblk for inird + kernel_configure_variable BLK_DEV_RAM y +} + +do_configure_append() { + + # VC4 Wayland/Weston + kernel_configure_variable I2C_BCM2835 y + kernel_configure_variable DRM y + kernel_configure_variable DRM_PANEL_RASPBERRYPI_TOUCHSCREEN y + kernel_configure_variable DRM_VC4 y + kernel_configure_variable FB_BCM2708 n + + # Enable support for TP-Link TL-W722N USB Wifi adapter + kernel_configure_variable CONFIG_ATH_CARDS m + kernel_configure_variable CONFIG_ATH9K_HTC m + + # Enable support for RTLSDR + kernel_configure_variable CONFIG_MEDIA_USB_SUPPORT y + kernel_configure_variable CONFIG_MEDIA_DIGITAL_TV_SUPPORT y + kernel_configure_variable CONFIG_DVB_USB_V2 m + kernel_configure_variable CONFIG_DVB_USB_RTL28XXU m + + # KEEP until fixed upstream: + # Keep this the last line + # Remove all modified configs and add the rest to .config + sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config' + + yes '' | oe_runmake oldconfig + kernel_do_configure +} + + +CMDLINE_append = " usbhid.mousepoll=0" + +KERNEL_MODULE_AUTOLOAD += "snd-bcm2835" +KERNEL_MODULE_AUTOLOAD += "hid-multitouch" + +RDEPENDS_${PN} += "kernel-module-snd-bcm2835" +PACKAGES += "kernel-module-snd-bcm2835" -- cgit v1.2.3-54-g00ecf From 3346b90d501de083138b0fc4b9e0271db186170f Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Wed, 23 Nov 2016 11:56:49 +0100 Subject: Fix syntax bug --- meta-sota-raspberrypi/conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-sota-raspberrypi/conf/layer.conf b/meta-sota-raspberrypi/conf/layer.conf index d3ade49..c2c3542 100644 --- a/meta-sota-raspberrypi/conf/layer.conf +++ b/meta-sota-raspberrypi/conf/layer.conf @@ -6,6 +6,6 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/recipes-*/*/*.bbappend" BBFILE_COLLECTIONS += "updater-raspberrypi" -BBFILE_PATTERN_agl = "^${LAYERDIR}/" +BBFILE_PATTERN_updater-raspberrypi = "^${LAYERDIR}/" BBFILE_PRIORITY_updater-raspberrypi = "7" -- cgit v1.2.3-54-g00ecf From 78c6c6fc78521d1615138f306ef74f28224eae67 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Mon, 5 Dec 2016 16:14:03 +0100 Subject: Add configuration templates --- meta-sota-raspberrypi/conf/bblayers.conf.sample | 22 +++ meta-sota-raspberrypi/conf/local.conf.sample | 237 ++++++++++++++++++++++++ 2 files changed, 259 insertions(+) create mode 100644 meta-sota-raspberrypi/conf/bblayers.conf.sample create mode 100644 meta-sota-raspberrypi/conf/local.conf.sample diff --git a/meta-sota-raspberrypi/conf/bblayers.conf.sample b/meta-sota-raspberrypi/conf/bblayers.conf.sample new file mode 100644 index 0000000..85cc004 --- /dev/null +++ b/meta-sota-raspberrypi/conf/bblayers.conf.sample @@ -0,0 +1,22 @@ +# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +LCONF_VERSION = "6" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/meta-yocto \ + ##OEROOT##/meta-yocto-bsp \ + ##OEROOT##/../meta-raspberrypi \ + ##OEROOT##/../meta-updater \ + ##OEROOT##/../meta-updater-raspberrypi \ + ##OEROOT##/../meta-openembedded/meta-oe \ + ##OEROOT##/../meta-openembedded/meta-filesystems \ + ##OEROOT##/../meta-rust \ + " +BBLAYERS_NON_REMOVABLE ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/meta-yocto \ + " diff --git a/meta-sota-raspberrypi/conf/local.conf.sample b/meta-sota-raspberrypi/conf/local.conf.sample new file mode 100644 index 0000000..a6597db --- /dev/null +++ b/meta-sota-raspberrypi/conf/local.conf.sample @@ -0,0 +1,237 @@ +# +# This file is your local configuration file and is where all local user settings +# are placed. The comments in this file give some guide to the options a new user +# to the system might want to change but pretty much any configuration option can +# be set in this file. More adventurous users can look at local.conf.extended +# which contains other examples of configuration which can be placed in this file +# but new users likely won't need any of them initially. +# +# Lines starting with the '#' character are commented out and in some cases the +# default values are provided as comments to show people example syntax. Enabling +# the option is a question of removing the # character and making any change to the +# variable as required. + +# +# Machine Selection +# +# You need to select a specific machine to target the build with. There are a selection +# of emulated machines available which can boot and run in the QEMU emulator: +# +#MACHINE ?= "qemuarm" +#MACHINE ?= "qemumips" +#MACHINE ?= "qemuppc" +#MACHINE ?= "qemux86" +#MACHINE ?= "qemux86-64" +# +# There are also the following hardware board target machines included for +# demonstration purposes: +# +#MACHINE ?= "beaglebone" +#MACHINE ?= "genericx86" +#MACHINE ?= "genericx86-64" +#MACHINE ?= "mpc8315e-rdb" +#MACHINE ?= "edgerouter" +# +# This sets the default machine to be qemux86 if no other machine is selected: +MACHINE ??= "raspberrypi3" + +# +# Where to place downloads +# +# During a first build the system will download many different source code tarballs +# from various upstream projects. This can take a while, particularly if your network +# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you +# can preserve this directory to speed up this part of subsequent builds. This directory +# is safe to share between multiple builds on the same machine too. +# +# The default is a downloads directory under TOPDIR which is the build directory. +# +#DL_DIR ?= "${TOPDIR}/downloads" + +# +# Where to place shared-state files +# +# BitBake has the capability to accelerate builds based on previously built output. +# This is done using "shared state" files which can be thought of as cache objects +# and this option determines where those files are placed. +# +# You can wipe out TMPDIR leaving this directory intact and the build would regenerate +# from these files if no changes were made to the configuration. If changes were made +# to the configuration, only shared state files where the state was still valid would +# be used (done using checksums). +# +# The default is a sstate-cache directory under TOPDIR. +# +#SSTATE_DIR ?= "${TOPDIR}/sstate-cache" + +# +# Where to place the build output +# +# This option specifies where the bulk of the building work should be done and +# where BitBake should place its temporary files and output. Keep in mind that +# this includes the extraction and compilation of many applications and the toolchain +# which can use Gigabytes of hard disk space. +# +# The default is a tmp directory under TOPDIR. +# +#TMPDIR = "${TOPDIR}/tmp" + +# +# Default policy config +# +# The distribution setting controls which policy settings are used as defaults. +# The default value is fine for general Yocto project use, at least initially. +# Ultimately when creating custom policy, people will likely end up subclassing +# these defaults. +# +DISTRO ?= "poky-sota" +# As an example of a subclass there is a "bleeding" edge policy configuration +# where many versions are set to the absolute latest code from the upstream +# source control systems. This is just mentioned here as an example, its not +# useful to most new users. +# DISTRO ?= "poky-bleeding" + +# +# Package Management configuration +# +# This variable lists which packaging formats to enable. Multiple package backends +# can be enabled at once and the first item listed in the variable will be used +# to generate the root filesystems. +# Options are: +# - 'package_deb' for debian style deb files +# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager) +# - 'package_rpm' for rpm style packages +# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk" +# We default to rpm: +PACKAGE_CLASSES ?= "package_rpm" + +# +# SDK/ADT target architecture +# +# This variable specifies the architecture to build SDK/ADT items for and means +# you can build the SDK packages for architectures other than the machine you are +# running the build on (i.e. building i686 packages on an x86_64 host). +# Supported values are i686 and x86_64 +#SDKMACHINE ?= "i686" + +# +# Extra image configuration defaults +# +# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated +# images. Some of these options are added to certain image types automatically. The +# variable can contain the following options: +# "dbg-pkgs" - add -dbg packages for all installed packages +# (adds symbol information for debugging/profiling) +# "dev-pkgs" - add -dev packages for all installed packages +# (useful if you want to develop against libs in the image) +# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages +# (useful if you want to run the package test suites) +# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.) +# "tools-debug" - add debugging tools (gdb, strace) +# "eclipse-debug" - add Eclipse remote debugging support +# "tools-profile" - add profiling tools (oprofile, exmap, lttng, valgrind) +# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.) +# "debug-tweaks" - make an image suitable for development +# e.g. ssh root access has a blank password +# There are other application targets that can be used here too, see +# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details. + +# Poky normally enables debug-tweaks, but since we allow remote SSH access to +# OpenIVI over tor, disable it. empty-root-password but not debug-tweaks allows +# passwordless login locally only. + +EXTRA_IMAGE_FEATURES = "empty-root-password" + +# +# Additional image features +# +# The following is a list of additional classes to use when building images which +# enable extra features. Some available options which can be included in this variable +# are: +# - 'buildstats' collect build statistics +# - 'image-mklibs' to reduce shared library files size for an image +# - 'image-prelink' in order to prelink the filesystem image +# - 'image-swab' to perform host system intrusion detection +# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink +# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended +USER_CLASSES ?= "buildstats image-mklibs image-prelink" + +# +# Runtime testing of images +# +# The build system can test booting virtual machine images under qemu (an emulator) +# after any root filesystems are created and run tests against those images. To +# enable this uncomment this line. See classes/testimage(-auto).bbclass for +# further details. +#TEST_IMAGE = "1" +# +# Interactive shell configuration +# +# Under certain circumstances the system may need input from you and to do this it +# can launch an interactive shell. It needs to do this since the build is +# multithreaded and needs to be able to handle the case where more than one parallel +# process may require the user's attention. The default is iterate over the available +# terminal types to find one that works. +# +# Examples of the occasions this may happen are when resolving patches which cannot +# be applied, to use the devshell or the kernel menuconfig +# +# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none +# Note: currently, Konsole support only works for KDE 3.x due to the way +# newer Konsole versions behave +#OE_TERMINAL = "auto" +# By default disable interactive patch resolution (tasks will just fail instead): +PATCHRESOLVE = "noop" + +# +# Disk Space Monitoring during the build +# +# Monitor the disk space during the build. If there is less that 1GB of space or less +# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully +# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort +# of the build. The reason for this is that running completely out of space can corrupt +# files and damages the build in ways which may not be easily recoverable. +BB_DISKMON_DIRS = "\ + STOPTASKS,${TMPDIR},1G,100K \ + STOPTASKS,${DL_DIR},1G,100K \ + STOPTASKS,${SSTATE_DIR},1G,100K \ + ABORT,${TMPDIR},100M,1K \ + ABORT,${DL_DIR},100M,1K \ + ABORT,${SSTATE_DIR},100M,1K" + +# +# Shared-state files from other locations +# +# As mentioned above, shared state files are prebuilt cache data objects which can +# used to accelerate build time. This variable can be used to configure the system +# to search other mirror locations for these objects before it builds the data itself. +# +# This can be a filesystem directory, or a remote url such as http or ftp. These +# would contain the sstate-cache results from previous builds (possibly from other +# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the +# cache locations to check for the shared objects. +# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH +# at the end as shown in the examples below. This will be substituted with the +# correct path within the directory structure. +#SSTATE_MIRRORS ?= "\ +#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \ +#file://.* file:///some/local/dir/sstate/PATH" + + +# +# Qemu configuration +# +# By default qemu will build with a builtin VNC server where graphical output can be +# seen. The two lines below enable the SDL backend too. This assumes there is a +# libsdl library available on your build system. +PACKAGECONFIG_append_pn-qemu-native = " sdl" +PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl" + +# https://bugzilla.yoctoproject.org/show_bug.cgi?id=8553 +# ASSUME_PROVIDED += "libsdl-native" + + +# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to +# track the version of this file when it was generated. This can safely be ignored if +# this doesn't mean anything to you. +CONF_VERSION = "1" -- cgit v1.2.3-54-g00ecf From d4eebc9586518a042880dc51dce16ceb1fa8ec9a Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Wed, 21 Dec 2016 17:34:14 +0100 Subject: OSTree <-> Minnowboard integration --- meta-sota-minnowboard/.gitignore | 1 + meta-sota-minnowboard/LICENSE | 373 +++++++++++++++++++++ meta-sota-minnowboard/README.md | 3 + meta-sota-minnowboard/conf/bblayers.conf.sample | 22 ++ meta-sota-minnowboard/conf/layer.conf | 11 + meta-sota-minnowboard/conf/local.conf.sample | 241 +++++++++++++ .../recipes-bsp/intel-fsp/intel-fsp-native.bb | 17 + ...ps-with-built-in-code-to-remove-dependenc.patch | 138 ++++++++ .../recipes-bsp/u-boot/u-boot-ota_2015.07.bb | 35 ++ 9 files changed, 841 insertions(+) create mode 100644 meta-sota-minnowboard/.gitignore create mode 100644 meta-sota-minnowboard/LICENSE create mode 100644 meta-sota-minnowboard/README.md create mode 100644 meta-sota-minnowboard/conf/bblayers.conf.sample create mode 100644 meta-sota-minnowboard/conf/layer.conf create mode 100644 meta-sota-minnowboard/conf/local.conf.sample create mode 100644 meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb create mode 100644 meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch create mode 100644 meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb diff --git a/meta-sota-minnowboard/.gitignore b/meta-sota-minnowboard/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/meta-sota-minnowboard/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/meta-sota-minnowboard/LICENSE b/meta-sota-minnowboard/LICENSE new file mode 100644 index 0000000..a612ad9 --- /dev/null +++ b/meta-sota-minnowboard/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/meta-sota-minnowboard/README.md b/meta-sota-minnowboard/README.md new file mode 100644 index 0000000..6c377f2 --- /dev/null +++ b/meta-sota-minnowboard/README.md @@ -0,0 +1,3 @@ +# BSP layer for updating Minnowboard Max with OSTree + +OSTree bootloader integration for Minnowboard Max/Turbot. Add it to BBLAYERS when using [meta-updater](https://github.com/advancedtelematic/meta-updater) with [Minnowboard](http://www.elinux.org/Minnowboard:MinnowMax). diff --git a/meta-sota-minnowboard/conf/bblayers.conf.sample b/meta-sota-minnowboard/conf/bblayers.conf.sample new file mode 100644 index 0000000..fdc771a --- /dev/null +++ b/meta-sota-minnowboard/conf/bblayers.conf.sample @@ -0,0 +1,22 @@ +# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +LCONF_VERSION = "6" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/meta-yocto \ + ##OEROOT##/meta-yocto-bsp \ + ##OEROOT##/../meta-raspberrypi \ + ##OEROOT##/../meta-updater \ + ##OEROOT##/../meta-updater-minnowmax \ + ##OEROOT##/../meta-openembedded/meta-oe \ + ##OEROOT##/../meta-openembedded/meta-filesystems \ + ##OEROOT##/../meta-rust \ + " +BBLAYERS_NON_REMOVABLE ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/meta-yocto \ + " diff --git a/meta-sota-minnowboard/conf/layer.conf b/meta-sota-minnowboard/conf/layer.conf new file mode 100644 index 0000000..12b542c --- /dev/null +++ b/meta-sota-minnowboard/conf/layer.conf @@ -0,0 +1,11 @@ +# 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 += "updater-minnowboard" +BBFILE_PATTERN_updater-minnowboard = "^${LAYERDIR}/" +BBFILE_PRIORITY_updater-minnowboard = "7" + diff --git a/meta-sota-minnowboard/conf/local.conf.sample b/meta-sota-minnowboard/conf/local.conf.sample new file mode 100644 index 0000000..a437207 --- /dev/null +++ b/meta-sota-minnowboard/conf/local.conf.sample @@ -0,0 +1,241 @@ +# +# This file is your local configuration file and is where all local user settings +# are placed. The comments in this file give some guide to the options a new user +# to the system might want to change but pretty much any configuration option can +# be set in this file. More adventurous users can look at local.conf.extended +# which contains other examples of configuration which can be placed in this file +# but new users likely won't need any of them initially. +# +# Lines starting with the '#' character are commented out and in some cases the +# default values are provided as comments to show people example syntax. Enabling +# the option is a question of removing the # character and making any change to the +# variable as required. + +# +# Machine Selection +# +# You need to select a specific machine to target the build with. There are a selection +# of emulated machines available which can boot and run in the QEMU emulator: +# +#MACHINE ?= "qemuarm" +#MACHINE ?= "qemumips" +#MACHINE ?= "qemuppc" +#MACHINE ?= "qemux86" +#MACHINE ?= "qemux86-64" +# +# There are also the following hardware board target machines included for +# demonstration purposes: +# +#MACHINE ?= "beaglebone" +#MACHINE ?= "genericx86" +#MACHINE ?= "genericx86-64" +#MACHINE ?= "mpc8315e-rdb" +#MACHINE ?= "edgerouter" +# +# This sets the default machine to be qemux86 if no other machine is selected: +MACHINE ??= "intel-corei7-64" + +PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ota" +UBOOT_MACHINE = "minnowmax_defconfig" + +# +# Where to place downloads +# +# During a first build the system will download many different source code tarballs +# from various upstream projects. This can take a while, particularly if your network +# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you +# can preserve this directory to speed up this part of subsequent builds. This directory +# is safe to share between multiple builds on the same machine too. +# +# The default is a downloads directory under TOPDIR which is the build directory. +# +#DL_DIR ?= "${TOPDIR}/downloads" + +# +# Where to place shared-state files +# +# BitBake has the capability to accelerate builds based on previously built output. +# This is done using "shared state" files which can be thought of as cache objects +# and this option determines where those files are placed. +# +# You can wipe out TMPDIR leaving this directory intact and the build would regenerate +# from these files if no changes were made to the configuration. If changes were made +# to the configuration, only shared state files where the state was still valid would +# be used (done using checksums). +# +# The default is a sstate-cache directory under TOPDIR. +# +#SSTATE_DIR ?= "${TOPDIR}/sstate-cache" + +# +# Where to place the build output +# +# This option specifies where the bulk of the building work should be done and +# where BitBake should place its temporary files and output. Keep in mind that +# this includes the extraction and compilation of many applications and the toolchain +# which can use Gigabytes of hard disk space. +# +# The default is a tmp directory under TOPDIR. +# +#TMPDIR = "${TOPDIR}/tmp" + +# +# Default policy config +# +# The distribution setting controls which policy settings are used as defaults. +# The default value is fine for general Yocto project use, at least initially. +# Ultimately when creating custom policy, people will likely end up subclassing +# these defaults. +# +DISTRO ?= "poky-sota" +# As an example of a subclass there is a "bleeding" edge policy configuration +# where many versions are set to the absolute latest code from the upstream +# source control systems. This is just mentioned here as an example, its not +# useful to most new users. +# DISTRO ?= "poky-bleeding" + +# +# Package Management configuration +# +# This variable lists which packaging formats to enable. Multiple package backends +# can be enabled at once and the first item listed in the variable will be used +# to generate the root filesystems. +# Options are: +# - 'package_deb' for debian style deb files +# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager) +# - 'package_rpm' for rpm style packages +# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk" +# We default to rpm: +PACKAGE_CLASSES ?= "package_rpm" + +# +# SDK/ADT target architecture +# +# This variable specifies the architecture to build SDK/ADT items for and means +# you can build the SDK packages for architectures other than the machine you are +# running the build on (i.e. building i686 packages on an x86_64 host). +# Supported values are i686 and x86_64 +#SDKMACHINE ?= "i686" + +# +# Extra image configuration defaults +# +# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated +# images. Some of these options are added to certain image types automatically. The +# variable can contain the following options: +# "dbg-pkgs" - add -dbg packages for all installed packages +# (adds symbol information for debugging/profiling) +# "dev-pkgs" - add -dev packages for all installed packages +# (useful if you want to develop against libs in the image) +# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages +# (useful if you want to run the package test suites) +# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.) +# "tools-debug" - add debugging tools (gdb, strace) +# "eclipse-debug" - add Eclipse remote debugging support +# "tools-profile" - add profiling tools (oprofile, exmap, lttng, valgrind) +# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.) +# "debug-tweaks" - make an image suitable for development +# e.g. ssh root access has a blank password +# There are other application targets that can be used here too, see +# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details. + +# Poky normally enables debug-tweaks, but since we allow remote SSH access to +# OpenIVI over tor, disable it. empty-root-password but not debug-tweaks allows +# passwordless login locally only. + +EXTRA_IMAGE_FEATURES = "empty-root-password" + +# +# Additional image features +# +# The following is a list of additional classes to use when building images which +# enable extra features. Some available options which can be included in this variable +# are: +# - 'buildstats' collect build statistics +# - 'image-mklibs' to reduce shared library files size for an image +# - 'image-prelink' in order to prelink the filesystem image +# - 'image-swab' to perform host system intrusion detection +# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink +# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended +USER_CLASSES ?= "buildstats image-mklibs image-prelink" + +# +# Runtime testing of images +# +# The build system can test booting virtual machine images under qemu (an emulator) +# after any root filesystems are created and run tests against those images. To +# enable this uncomment this line. See classes/testimage(-auto).bbclass for +# further details. +#TEST_IMAGE = "1" +# +# Interactive shell configuration +# +# Under certain circumstances the system may need input from you and to do this it +# can launch an interactive shell. It needs to do this since the build is +# multithreaded and needs to be able to handle the case where more than one parallel +# process may require the user's attention. The default is iterate over the available +# terminal types to find one that works. +# +# Examples of the occasions this may happen are when resolving patches which cannot +# be applied, to use the devshell or the kernel menuconfig +# +# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none +# Note: currently, Konsole support only works for KDE 3.x due to the way +# newer Konsole versions behave +#OE_TERMINAL = "auto" +# By default disable interactive patch resolution (tasks will just fail instead): +PATCHRESOLVE = "noop" + +# +# Disk Space Monitoring during the build +# +# Monitor the disk space during the build. If there is less that 1GB of space or less +# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully +# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort +# of the build. The reason for this is that running completely out of space can corrupt +# files and damages the build in ways which may not be easily recoverable. +BB_DISKMON_DIRS = "\ + STOPTASKS,${TMPDIR},1G,100K \ + STOPTASKS,${DL_DIR},1G,100K \ + STOPTASKS,${SSTATE_DIR},1G,100K \ + ABORT,${TMPDIR},100M,1K \ + ABORT,${DL_DIR},100M,1K \ + ABORT,${SSTATE_DIR},100M,1K" + +# +# Shared-state files from other locations +# +# As mentioned above, shared state files are prebuilt cache data objects which can +# used to accelerate build time. This variable can be used to configure the system +# to search other mirror locations for these objects before it builds the data itself. +# +# This can be a filesystem directory, or a remote url such as http or ftp. These +# would contain the sstate-cache results from previous builds (possibly from other +# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the +# cache locations to check for the shared objects. +# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH +# at the end as shown in the examples below. This will be substituted with the +# correct path within the directory structure. +#SSTATE_MIRRORS ?= "\ +#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \ +#file://.* file:///some/local/dir/sstate/PATH" + + +# +# Qemu configuration +# +# By default qemu will build with a builtin VNC server where graphical output can be +# seen. The two lines below enable the SDL backend too. This assumes there is a +# libsdl library available on your build system. +PACKAGECONFIG_append_pn-qemu-native = " sdl" +PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl" + +# https://bugzilla.yoctoproject.org/show_bug.cgi?id=8553 +# ASSUME_PROVIDED += "libsdl-native" + + +# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to +# track the version of this file when it was generated. This can safely be ignored if +# this doesn't mean anything to you. +CONF_VERSION = "1" + diff --git a/meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb b/meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb new file mode 100644 index 0000000..6f87ffb --- /dev/null +++ b/meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb @@ -0,0 +1,17 @@ +S = "${WORKDIR}/git" + +LICENSE = "IntelFSPRULAC" +LIC_FILES_CHKSUM = "file://${S}/FspKitProductionRULACLicense.pdf;md5=37802f528bc83ad078606e5932e93e02" + +SRC_URI = "git://github.com/IntelFsp/FSP.git;branch=BayTrail" +SRCREV="187409120bcba0ccc3fb514deb3bb923e9723c0c" + +inherit native + +FILES_${PN} = "${datadir}/IntelFsp/BayTrailFSP.fd" + +do_install() { + install -d ${D}${datadir}/IntelFsp + install -m 0644 ${S}/BayTrailFspBinPkg/FspBin/BayTrailFSP.fd ${D}${datadir}/IntelFsp/BayTrailFSP.fd + install -m 0644 ${S}/BayTrailFspBinPkg/Vbios/Vga.dat ${D}${datadir}/IntelFsp/Vga.dat +} diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch new file mode 100644 index 0000000..7540b74 --- /dev/null +++ b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch @@ -0,0 +1,138 @@ +From ab0d7e270d89f6eb99582197d2d58bf60c9c3d26 Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Thu, 15 Sep 2016 16:49:32 +0200 +Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on + multilib + +--- + arch/x86/config.mk | 2 -- + arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++--------- + 2 files changed, 87 insertions(+), 19 deletions(-) + +diff --git a/arch/x86/config.mk b/arch/x86/config.mk +index 999143e..139576e 100644 +--- a/arch/x86/config.mk ++++ b/arch/x86/config.mk +@@ -22,5 +22,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden + PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386 + + LDFLAGS_FINAL += --gc-sections -pie +-LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 +-LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 +diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c +index 497ad75..c321b11 100644 +--- a/arch/x86/lib/gcc.c ++++ b/arch/x86/lib/gcc.c +@@ -19,22 +19,92 @@ + + #ifdef __GNUC__ + +-/* +- * GCC's libgcc handling is quite broken. While the libgcc functions +- * are always regparm(0) the code that calls them uses whatever the +- * compiler call specifies. Therefore we need a wrapper around those +- * functions. See gcc bug PR41055 for more information. +- */ +-#define WRAP_LIBGCC_CALL(type, name) \ +- type __normal_##name(type a, type b) __attribute__((regparm(0))); \ +- type __wrap_##name(type a, type b); \ +- type __attribute__((no_instrument_function)) \ +- __wrap_##name(type a, type b) \ +- { return __normal_##name(a, b); } +- +-WRAP_LIBGCC_CALL(long long, __divdi3) +-WRAP_LIBGCC_CALL(unsigned long long, __udivdi3) +-WRAP_LIBGCC_CALL(long long, __moddi3) +-WRAP_LIBGCC_CALL(unsigned long long, __umoddi3) ++#include ++#include ++ ++uint64_t __udivmoddi4 ( uint64_t num, ++ uint64_t den, ++ uint64_t *rem_p ) ++{ ++ uint64_t quot = 0, qbit = 1; ++ ++ if ( den == 0 ) { ++ return 1/((unsigned)den); /* Intentional divide by zero, without ++ triggering a compiler warning which ++ would abort the build */ ++ } ++ ++ /* Left-justify denominator and count shift */ ++ while ( (int64_t)den >= 0 ) { ++ den <<= 1; ++ qbit <<= 1; ++ } ++ ++ while ( qbit ) { ++ if ( den <= num ) { ++ num -= den; ++ quot += qbit; ++ } ++ den >>= 1; ++ qbit >>= 1; ++ } ++ ++ if ( rem_p ) ++ *rem_p = num; ++ ++ return quot; ++} ++uint64_t __udivdi3( uint64_t num, uint64_t den ) ++{ ++ return __udivmoddi4(num, den, NULL); ++} ++ ++uint64_t __umoddi3 ( uint64_t num, uint64_t den ) ++{ ++ uint64_t v; ++ ++ (void) __udivmoddi4(num, den, &v); ++ return v; ++} ++ ++int64_t __divmoddi4 ( int64_t num, ++ int64_t den, ++ int64_t* rem_p ) ++{ ++ int minus = 0; ++ int64_t v; ++ ++ if ( num < 0 ) { ++ num = -num; ++ minus = 1; ++ } ++ if ( den < 0 ) { ++ den = -den; ++ minus ^= 1; ++ } ++ ++ v = __udivmoddi4(num, den, (uint64_t *)rem_p); ++ if ( minus ) { ++ v = -v; ++ if ( rem_p ) ++ *rem_p = -(*rem_p); ++ } ++ ++ return v; ++} ++ ++ ++int64_t __moddi3 (int64_t num, int64_t den) ++{ ++ int64_t v; ++ ++ (void) __divmoddi4(num, den, &v); ++ return v; ++} ++ ++int64_t __divdi3(int64_t num, int64_t den) ++{ ++ return __divmoddi4(num, den, NULL); ++} + + #endif +-- +2.9.3 + diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb new file mode 100644 index 0000000..28b9369 --- /dev/null +++ b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb @@ -0,0 +1,35 @@ +include recipes-bsp/u-boot/u-boot.inc +DEPENDS += "dtc-native intel-fsp-native" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95" + +# This revision corresponds to the tag "v2015.07" +# We use the revision in order to avoid having to fetch it from the +# repo during parse +SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204" + +SRC_URI += "file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ + http://firmware.intel.com/sites/default/files/2014-WW42.4-MinnowBoardMax.73-64-bit.bin_Release.zip \ + " + +# Hashes for 2014-WW42.4-MinnowBoardMax.73-64-bit.bin_Release.zip +SRC_URI[md5sum] = "1a4256c64a0d846b81d2adf7ce07cce5" +SRC_URI[sha256sum] = "883b1399b89e8e13033367e911a1e69423dffa9a6c4b5d306fc070d9ed7412b7" + +PV = "v2015.07+git${SRCPV}" + +EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" + +UBOOT_SUFFIX = "rom" + +do_configure_prepend() { + make ${UBOOT_MACHINE} + make tools + ./tools/ifdtool -x ${WORKDIR}/MNW2MAX1.X64.0073.R02.1409160934.bin + cp flashregion_0_flashdescriptor.bin ./board/intel/minnowmax/descriptor.bin + cp flashregion_2_intel_me.bin ./board/intel/minnowmax/me.bin + cp ${STAGING_DIR_NATIVE}/${datadir}/IntelFsp/BayTrailFSP.fd ./board/intel/minnowmax/fsp.bin + cp ${STAGING_DIR_NATIVE}/${datadir}/IntelFsp/Vga.dat ./board/intel/minnowmax/vga.bin +} + -- cgit v1.2.3-54-g00ecf From 702291198ff828be18b2d3ee7a43ea0adb140be0 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Wed, 21 Dec 2016 17:45:32 +0100 Subject: OSTree <-> qemux86-64 integration --- meta-sota-qemux86-64/.gitignore | 1 + meta-sota-qemux86-64/LICENSE | 373 +++++++++++++++++++++ meta-sota-qemux86-64/README.md | 3 + meta-sota-qemux86-64/conf/bblayers.conf.sample | 22 ++ meta-sota-qemux86-64/conf/layer.conf | 11 + meta-sota-qemux86-64/conf/local.conf.sample | 241 +++++++++++++ ...Set-up-environment-for-OSTree-integration.patch | 41 +++ ...ps-with-built-in-code-to-remove-dependenc.patch | 138 ++++++++ .../recipes-bsp/u-boot/u-boot-ota_2015.07.bb | 22 ++ 9 files changed, 852 insertions(+) create mode 100644 meta-sota-qemux86-64/.gitignore create mode 100644 meta-sota-qemux86-64/LICENSE create mode 100644 meta-sota-qemux86-64/README.md create mode 100644 meta-sota-qemux86-64/conf/bblayers.conf.sample create mode 100644 meta-sota-qemux86-64/conf/layer.conf create mode 100644 meta-sota-qemux86-64/conf/local.conf.sample create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb diff --git a/meta-sota-qemux86-64/.gitignore b/meta-sota-qemux86-64/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/meta-sota-qemux86-64/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/meta-sota-qemux86-64/LICENSE b/meta-sota-qemux86-64/LICENSE new file mode 100644 index 0000000..a612ad9 --- /dev/null +++ b/meta-sota-qemux86-64/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/meta-sota-qemux86-64/README.md b/meta-sota-qemux86-64/README.md new file mode 100644 index 0000000..95ffe0c --- /dev/null +++ b/meta-sota-qemux86-64/README.md @@ -0,0 +1,3 @@ +# BSP layer for testing OSTree with QEMU on x86_64 host + +OSTree bootloader integration for qemu-x86-64. Add it to BBLAYERS when using [meta-updater](https://github.com/advancedtelematic/meta-updater) with [QEMU](https://www.qemu.org). diff --git a/meta-sota-qemux86-64/conf/bblayers.conf.sample b/meta-sota-qemux86-64/conf/bblayers.conf.sample new file mode 100644 index 0000000..fdc771a --- /dev/null +++ b/meta-sota-qemux86-64/conf/bblayers.conf.sample @@ -0,0 +1,22 @@ +# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +LCONF_VERSION = "6" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/meta-yocto \ + ##OEROOT##/meta-yocto-bsp \ + ##OEROOT##/../meta-raspberrypi \ + ##OEROOT##/../meta-updater \ + ##OEROOT##/../meta-updater-minnowmax \ + ##OEROOT##/../meta-openembedded/meta-oe \ + ##OEROOT##/../meta-openembedded/meta-filesystems \ + ##OEROOT##/../meta-rust \ + " +BBLAYERS_NON_REMOVABLE ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/meta-yocto \ + " diff --git a/meta-sota-qemux86-64/conf/layer.conf b/meta-sota-qemux86-64/conf/layer.conf new file mode 100644 index 0000000..12b542c --- /dev/null +++ b/meta-sota-qemux86-64/conf/layer.conf @@ -0,0 +1,11 @@ +# 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 += "updater-minnowboard" +BBFILE_PATTERN_updater-minnowboard = "^${LAYERDIR}/" +BBFILE_PRIORITY_updater-minnowboard = "7" + diff --git a/meta-sota-qemux86-64/conf/local.conf.sample b/meta-sota-qemux86-64/conf/local.conf.sample new file mode 100644 index 0000000..bf7500a --- /dev/null +++ b/meta-sota-qemux86-64/conf/local.conf.sample @@ -0,0 +1,241 @@ +# +# This file is your local configuration file and is where all local user settings +# are placed. The comments in this file give some guide to the options a new user +# to the system might want to change but pretty much any configuration option can +# be set in this file. More adventurous users can look at local.conf.extended +# which contains other examples of configuration which can be placed in this file +# but new users likely won't need any of them initially. +# +# Lines starting with the '#' character are commented out and in some cases the +# default values are provided as comments to show people example syntax. Enabling +# the option is a question of removing the # character and making any change to the +# variable as required. + +# +# Machine Selection +# +# You need to select a specific machine to target the build with. There are a selection +# of emulated machines available which can boot and run in the QEMU emulator: +# +#MACHINE ?= "qemuarm" +#MACHINE ?= "qemumips" +#MACHINE ?= "qemuppc" +#MACHINE ?= "qemux86" +#MACHINE ?= "qemux86-64" +# +# There are also the following hardware board target machines included for +# demonstration purposes: +# +#MACHINE ?= "beaglebone" +#MACHINE ?= "genericx86" +#MACHINE ?= "genericx86-64" +#MACHINE ?= "mpc8315e-rdb" +#MACHINE ?= "edgerouter" +# +# This sets the default machine to be qemux86 if no other machine is selected: +MACHINE ??= "qemux86-64" + +PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ota" +UBOOT_MACHINE = "qemu-x86_defconfig" + +# +# Where to place downloads +# +# During a first build the system will download many different source code tarballs +# from various upstream projects. This can take a while, particularly if your network +# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you +# can preserve this directory to speed up this part of subsequent builds. This directory +# is safe to share between multiple builds on the same machine too. +# +# The default is a downloads directory under TOPDIR which is the build directory. +# +#DL_DIR ?= "${TOPDIR}/downloads" + +# +# Where to place shared-state files +# +# BitBake has the capability to accelerate builds based on previously built output. +# This is done using "shared state" files which can be thought of as cache objects +# and this option determines where those files are placed. +# +# You can wipe out TMPDIR leaving this directory intact and the build would regenerate +# from these files if no changes were made to the configuration. If changes were made +# to the configuration, only shared state files where the state was still valid would +# be used (done using checksums). +# +# The default is a sstate-cache directory under TOPDIR. +# +#SSTATE_DIR ?= "${TOPDIR}/sstate-cache" + +# +# Where to place the build output +# +# This option specifies where the bulk of the building work should be done and +# where BitBake should place its temporary files and output. Keep in mind that +# this includes the extraction and compilation of many applications and the toolchain +# which can use Gigabytes of hard disk space. +# +# The default is a tmp directory under TOPDIR. +# +#TMPDIR = "${TOPDIR}/tmp" + +# +# Default policy config +# +# The distribution setting controls which policy settings are used as defaults. +# The default value is fine for general Yocto project use, at least initially. +# Ultimately when creating custom policy, people will likely end up subclassing +# these defaults. +# +DISTRO ?= "poky-sota" +# As an example of a subclass there is a "bleeding" edge policy configuration +# where many versions are set to the absolute latest code from the upstream +# source control systems. This is just mentioned here as an example, its not +# useful to most new users. +# DISTRO ?= "poky-bleeding" + +# +# Package Management configuration +# +# This variable lists which packaging formats to enable. Multiple package backends +# can be enabled at once and the first item listed in the variable will be used +# to generate the root filesystems. +# Options are: +# - 'package_deb' for debian style deb files +# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager) +# - 'package_rpm' for rpm style packages +# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk" +# We default to rpm: +PACKAGE_CLASSES ?= "package_rpm" + +# +# SDK/ADT target architecture +# +# This variable specifies the architecture to build SDK/ADT items for and means +# you can build the SDK packages for architectures other than the machine you are +# running the build on (i.e. building i686 packages on an x86_64 host). +# Supported values are i686 and x86_64 +#SDKMACHINE ?= "i686" + +# +# Extra image configuration defaults +# +# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated +# images. Some of these options are added to certain image types automatically. The +# variable can contain the following options: +# "dbg-pkgs" - add -dbg packages for all installed packages +# (adds symbol information for debugging/profiling) +# "dev-pkgs" - add -dev packages for all installed packages +# (useful if you want to develop against libs in the image) +# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages +# (useful if you want to run the package test suites) +# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.) +# "tools-debug" - add debugging tools (gdb, strace) +# "eclipse-debug" - add Eclipse remote debugging support +# "tools-profile" - add profiling tools (oprofile, exmap, lttng, valgrind) +# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.) +# "debug-tweaks" - make an image suitable for development +# e.g. ssh root access has a blank password +# There are other application targets that can be used here too, see +# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details. + +# Poky normally enables debug-tweaks, but since we allow remote SSH access to +# OpenIVI over tor, disable it. empty-root-password but not debug-tweaks allows +# passwordless login locally only. + +EXTRA_IMAGE_FEATURES = "empty-root-password" + +# +# Additional image features +# +# The following is a list of additional classes to use when building images which +# enable extra features. Some available options which can be included in this variable +# are: +# - 'buildstats' collect build statistics +# - 'image-mklibs' to reduce shared library files size for an image +# - 'image-prelink' in order to prelink the filesystem image +# - 'image-swab' to perform host system intrusion detection +# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink +# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended +USER_CLASSES ?= "buildstats image-mklibs image-prelink" + +# +# Runtime testing of images +# +# The build system can test booting virtual machine images under qemu (an emulator) +# after any root filesystems are created and run tests against those images. To +# enable this uncomment this line. See classes/testimage(-auto).bbclass for +# further details. +#TEST_IMAGE = "1" +# +# Interactive shell configuration +# +# Under certain circumstances the system may need input from you and to do this it +# can launch an interactive shell. It needs to do this since the build is +# multithreaded and needs to be able to handle the case where more than one parallel +# process may require the user's attention. The default is iterate over the available +# terminal types to find one that works. +# +# Examples of the occasions this may happen are when resolving patches which cannot +# be applied, to use the devshell or the kernel menuconfig +# +# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none +# Note: currently, Konsole support only works for KDE 3.x due to the way +# newer Konsole versions behave +#OE_TERMINAL = "auto" +# By default disable interactive patch resolution (tasks will just fail instead): +PATCHRESOLVE = "noop" + +# +# Disk Space Monitoring during the build +# +# Monitor the disk space during the build. If there is less that 1GB of space or less +# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully +# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort +# of the build. The reason for this is that running completely out of space can corrupt +# files and damages the build in ways which may not be easily recoverable. +BB_DISKMON_DIRS = "\ + STOPTASKS,${TMPDIR},1G,100K \ + STOPTASKS,${DL_DIR},1G,100K \ + STOPTASKS,${SSTATE_DIR},1G,100K \ + ABORT,${TMPDIR},100M,1K \ + ABORT,${DL_DIR},100M,1K \ + ABORT,${SSTATE_DIR},100M,1K" + +# +# Shared-state files from other locations +# +# As mentioned above, shared state files are prebuilt cache data objects which can +# used to accelerate build time. This variable can be used to configure the system +# to search other mirror locations for these objects before it builds the data itself. +# +# This can be a filesystem directory, or a remote url such as http or ftp. These +# would contain the sstate-cache results from previous builds (possibly from other +# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the +# cache locations to check for the shared objects. +# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH +# at the end as shown in the examples below. This will be substituted with the +# correct path within the directory structure. +#SSTATE_MIRRORS ?= "\ +#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \ +#file://.* file:///some/local/dir/sstate/PATH" + + +# +# Qemu configuration +# +# By default qemu will build with a builtin VNC server where graphical output can be +# seen. The two lines below enable the SDL backend too. This assumes there is a +# libsdl library available on your build system. +PACKAGECONFIG_append_pn-qemu-native = " sdl" +PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl" + +# https://bugzilla.yoctoproject.org/show_bug.cgi?id=8553 +# ASSUME_PROVIDED += "libsdl-native" + + +# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to +# track the version of this file when it was generated. This can safely be ignored if +# this doesn't mean anything to you. +CONF_VERSION = "1" + diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch new file mode 100644 index 0000000..5172fdd --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch @@ -0,0 +1,41 @@ +From ebb26338d0c2f436a86fd4d7cb8d723a90d6a369 Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Thu, 15 Sep 2016 17:52:41 +0200 +Subject: [PATCH 1/2] Set up environment for OSTree integration + +--- + include/configs/qemu-x86.h | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h +index 78c296f..79df455 100644 +--- a/include/configs/qemu-x86.h ++++ b/include/configs/qemu-x86.h +@@ -74,4 +74,24 @@ + #undef CONFIG_ENV_IS_IN_SPI_FLASH + #define CONFIG_ENV_IS_NOWHERE + ++#undef CONFIG_BOOTARGS ++#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run loadenv;" \ ++ "setenv bootargs $bootargs\" console=ttyS0 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda ramdisk_size=16384 \";" \ ++ "ext2load ide 0 $loadaddr \"/boot\"$kernel_image;" \ ++ "ext2load ide 0 $ramdiskaddr \"/boot\"$ramdisk_image;" \ ++ "zboot $loadaddr - $ramdiskaddr $filesize" ++ ++#undef CONFIG_EXTRA_ENV_SETTINGS ++#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \ ++ "ramdisk_image=/initrd\0" \ ++ "ramdiskaddr=0x4000000\0" \ ++ "bootdelay=3\0" \ ++ "loadenv=if ext2load ide 0 $loadaddr /boot/loader/uEnv.txt; then env import -t $loadaddr $filesize; fi;" ++ + #endif /* __CONFIG_H */ +-- +2.9.3 + diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch new file mode 100644 index 0000000..7540b74 --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch @@ -0,0 +1,138 @@ +From ab0d7e270d89f6eb99582197d2d58bf60c9c3d26 Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Thu, 15 Sep 2016 16:49:32 +0200 +Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on + multilib + +--- + arch/x86/config.mk | 2 -- + arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++--------- + 2 files changed, 87 insertions(+), 19 deletions(-) + +diff --git a/arch/x86/config.mk b/arch/x86/config.mk +index 999143e..139576e 100644 +--- a/arch/x86/config.mk ++++ b/arch/x86/config.mk +@@ -22,5 +22,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden + PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386 + + LDFLAGS_FINAL += --gc-sections -pie +-LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 +-LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 +diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c +index 497ad75..c321b11 100644 +--- a/arch/x86/lib/gcc.c ++++ b/arch/x86/lib/gcc.c +@@ -19,22 +19,92 @@ + + #ifdef __GNUC__ + +-/* +- * GCC's libgcc handling is quite broken. While the libgcc functions +- * are always regparm(0) the code that calls them uses whatever the +- * compiler call specifies. Therefore we need a wrapper around those +- * functions. See gcc bug PR41055 for more information. +- */ +-#define WRAP_LIBGCC_CALL(type, name) \ +- type __normal_##name(type a, type b) __attribute__((regparm(0))); \ +- type __wrap_##name(type a, type b); \ +- type __attribute__((no_instrument_function)) \ +- __wrap_##name(type a, type b) \ +- { return __normal_##name(a, b); } +- +-WRAP_LIBGCC_CALL(long long, __divdi3) +-WRAP_LIBGCC_CALL(unsigned long long, __udivdi3) +-WRAP_LIBGCC_CALL(long long, __moddi3) +-WRAP_LIBGCC_CALL(unsigned long long, __umoddi3) ++#include ++#include ++ ++uint64_t __udivmoddi4 ( uint64_t num, ++ uint64_t den, ++ uint64_t *rem_p ) ++{ ++ uint64_t quot = 0, qbit = 1; ++ ++ if ( den == 0 ) { ++ return 1/((unsigned)den); /* Intentional divide by zero, without ++ triggering a compiler warning which ++ would abort the build */ ++ } ++ ++ /* Left-justify denominator and count shift */ ++ while ( (int64_t)den >= 0 ) { ++ den <<= 1; ++ qbit <<= 1; ++ } ++ ++ while ( qbit ) { ++ if ( den <= num ) { ++ num -= den; ++ quot += qbit; ++ } ++ den >>= 1; ++ qbit >>= 1; ++ } ++ ++ if ( rem_p ) ++ *rem_p = num; ++ ++ return quot; ++} ++uint64_t __udivdi3( uint64_t num, uint64_t den ) ++{ ++ return __udivmoddi4(num, den, NULL); ++} ++ ++uint64_t __umoddi3 ( uint64_t num, uint64_t den ) ++{ ++ uint64_t v; ++ ++ (void) __udivmoddi4(num, den, &v); ++ return v; ++} ++ ++int64_t __divmoddi4 ( int64_t num, ++ int64_t den, ++ int64_t* rem_p ) ++{ ++ int minus = 0; ++ int64_t v; ++ ++ if ( num < 0 ) { ++ num = -num; ++ minus = 1; ++ } ++ if ( den < 0 ) { ++ den = -den; ++ minus ^= 1; ++ } ++ ++ v = __udivmoddi4(num, den, (uint64_t *)rem_p); ++ if ( minus ) { ++ v = -v; ++ if ( rem_p ) ++ *rem_p = -(*rem_p); ++ } ++ ++ return v; ++} ++ ++ ++int64_t __moddi3 (int64_t num, int64_t den) ++{ ++ int64_t v; ++ ++ (void) __divmoddi4(num, den, &v); ++ return v; ++} ++ ++int64_t __divdi3(int64_t num, int64_t den) ++{ ++ return __divmoddi4(num, den, NULL); ++} + + #endif +-- +2.9.3 + diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb new file mode 100644 index 0000000..e190137 --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb @@ -0,0 +1,22 @@ +include recipes-bsp/u-boot/u-boot.inc +DEPENDS += "dtc-native" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95" + +# This revision corresponds to the tag "v2015.07" +# We use the revision in order to avoid having to fetch it from the +# repo during parse +SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204" + +SRC_URI += "file://0001-Set-up-environment-for-OSTree-integration.patch \ + file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ + " + +PV = "v2015.07+git${SRCPV}" + +EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" + +UBOOT_SUFFIX = "bin" +UBOOT_SUFFIX_qemux86 = "rom" +UBOOT_SUFFIX_qemux86-64 = "rom" -- cgit v1.2.3-54-g00ecf From 9a33370f3529c147d2ce3c3d9a8d007a95b5970e Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Wed, 28 Dec 2016 14:18:28 +0100 Subject: Fixed u-boot, now can load non-OSTree image --- .../recipes-bsp/intel-fsp/intel-fsp-native.bb | 3 +- ...ps-with-built-in-code-to-remove-dependenc.patch | 18 ++++++----- .../recipes-bsp/u-boot/u-boot-ota_2015.07.bb | 35 ---------------------- .../recipes-bsp/u-boot/u-boot-ota_2016.11.bb | 35 ++++++++++++++++++++++ 4 files changed, 48 insertions(+), 43 deletions(-) delete mode 100644 meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb create mode 100644 meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb diff --git a/meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb b/meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb index 6f87ffb..a360ae1 100644 --- a/meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb +++ b/meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb @@ -8,7 +8,8 @@ SRCREV="187409120bcba0ccc3fb514deb3bb923e9723c0c" inherit native -FILES_${PN} = "${datadir}/IntelFsp/BayTrailFSP.fd" +FILES_${PN} = "${datadir}/IntelFsp/BayTrailFSP.fd \ + ${datadir}/IntelFsp/Vga.dat" do_install() { install -d ${D}${datadir}/IntelFsp diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch index 7540b74..f1fcd06 100644 --- a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch +++ b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch @@ -5,20 +5,24 @@ Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on multilib --- - arch/x86/config.mk | 2 -- + arch/x86/config.mk | 3 --- arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++--------- - 2 files changed, 87 insertions(+), 19 deletions(-) + 2 files changed, 87 insertions(+), 20 deletions(-) diff --git a/arch/x86/config.mk b/arch/x86/config.mk -index 999143e..139576e 100644 +index d7addd8..892e0fc 100644 --- a/arch/x86/config.mk +++ b/arch/x86/config.mk -@@ -22,5 +22,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden - PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386 - - LDFLAGS_FINAL += --gc-sections -pie +@@ -21,9 +21,6 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden + + PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions -m elf_i386 + -LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 -LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 +- + # This is used in the top-level Makefile which does not include + # PLATFORM_LDFLAGS + LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c index 497ad75..c321b11 100644 --- a/arch/x86/lib/gcc.c diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb deleted file mode 100644 index 28b9369..0000000 --- a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb +++ /dev/null @@ -1,35 +0,0 @@ -include recipes-bsp/u-boot/u-boot.inc -DEPENDS += "dtc-native intel-fsp-native" - -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95" - -# This revision corresponds to the tag "v2015.07" -# We use the revision in order to avoid having to fetch it from the -# repo during parse -SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204" - -SRC_URI += "file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ - http://firmware.intel.com/sites/default/files/2014-WW42.4-MinnowBoardMax.73-64-bit.bin_Release.zip \ - " - -# Hashes for 2014-WW42.4-MinnowBoardMax.73-64-bit.bin_Release.zip -SRC_URI[md5sum] = "1a4256c64a0d846b81d2adf7ce07cce5" -SRC_URI[sha256sum] = "883b1399b89e8e13033367e911a1e69423dffa9a6c4b5d306fc070d9ed7412b7" - -PV = "v2015.07+git${SRCPV}" - -EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" - -UBOOT_SUFFIX = "rom" - -do_configure_prepend() { - make ${UBOOT_MACHINE} - make tools - ./tools/ifdtool -x ${WORKDIR}/MNW2MAX1.X64.0073.R02.1409160934.bin - cp flashregion_0_flashdescriptor.bin ./board/intel/minnowmax/descriptor.bin - cp flashregion_2_intel_me.bin ./board/intel/minnowmax/me.bin - cp ${STAGING_DIR_NATIVE}/${datadir}/IntelFsp/BayTrailFSP.fd ./board/intel/minnowmax/fsp.bin - cp ${STAGING_DIR_NATIVE}/${datadir}/IntelFsp/Vga.dat ./board/intel/minnowmax/vga.bin -} - diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb new file mode 100644 index 0000000..fe60489 --- /dev/null +++ b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb @@ -0,0 +1,35 @@ +include recipes-bsp/u-boot/u-boot.inc +DEPENDS += "dtc-native intel-fsp-native iasl-native" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6" + +# This revision corresponds to the tag "v2016.11" +# We use the revision in order to avoid having to fetch it from the +# repo during parse +SRCREV = "29e0cfb4f77f7aa369136302cee14a91e22dca71" + +SRC_URI += "file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ + http://firmware.intel.com/sites/default/files/MinnowBoard.MAX_.X64.92.R01.zip \ + " + +# Hashes for MinnowBoard.MAX_.X64.92.R01.zip +SRC_URI[md5sum] = "236070e3d0fb193e03a102939822cf59" +SRC_URI[sha256sum] = "708f00d835cc9c49df4e937ef59852ccb6b95026291ac9779b5411dd09baed1f" + +PV = "v2016.11+git${SRCPV}" + +EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" + +UBOOT_SUFFIX = "rom" + +do_configure_prepend() { + make ${UBOOT_MACHINE} + make tools + ./tools/ifdtool -x ${WORKDIR}/MNW2MAX1.X64.0092.R01.1605221712.bin + cp flashregion_0_flashdescriptor.bin ./board/intel/minnowmax/descriptor.bin + cp flashregion_2_intel_me.bin ./board/intel/minnowmax/me.bin + cp ${STAGING_DIR_NATIVE}/${datadir}/IntelFsp/BayTrailFSP.fd ./board/intel/minnowmax/fsp.bin + cp ${STAGING_DIR_NATIVE}/${datadir}/IntelFsp/Vga.dat ./board/intel/minnowmax/vga.bin +} + -- cgit v1.2.3-54-g00ecf From c60ed2eaabd0dc81ab9084d64e64ccbc462c6a2a Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Wed, 28 Dec 2016 17:40:14 +0100 Subject: Add u-boot environment for OSTree --- .../recipes-bsp/bootfiles/files/uEnv-ota.txt | 17 +++++++++++++++ .../recipes-bsp/bootfiles/minnowboard-bootfiles.bb | 25 ++++++++++++++++++++++ ...-Load-environment-from-the-boot-partition.patch | 24 +++++++++++++++++++++ .../recipes-bsp/u-boot/u-boot-ota_2016.11.bb | 3 ++- 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 meta-sota-minnowboard/recipes-bsp/bootfiles/files/uEnv-ota.txt create mode 100644 meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-bootfiles.bb create mode 100644 meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0001-Load-environment-from-the-boot-partition.patch diff --git a/meta-sota-minnowboard/recipes-bsp/bootfiles/files/uEnv-ota.txt b/meta-sota-minnowboard/recipes-bsp/bootfiles/files/uEnv-ota.txt new file mode 100644 index 0000000..2b0f293 --- /dev/null +++ b/meta-sota-minnowboard/recipes-bsp/bootfiles/files/uEnv-ota.txt @@ -0,0 +1,17 @@ +bootkaddr=0x01000000 +bootiaddr=0x04000000 + +bootargs_console=console=ttyS0,115200 +bootargs_extra=rw rootfstype=ext4 rootwait rootdelay=2 + +bootargs_root=ostree_root=/dev/mmcblk0p2 root=/dev/ram0 ramdisk_size=16384 + +bootmmc=1:2 + +booteload_sd=ext4load mmc ${bootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize} + +bootkload_sd=ext4load mmc ${bootmmc} ${bootkaddr} boot/${kernel_image} +bootiload_sd=ext4load mmc ${bootmmc} ${bootiaddr} boot/${ramdisk_image} + +bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; zboot ${bootkaddr} - ${bootiaddr} ${filesize} + diff --git a/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-bootfiles.bb b/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-bootfiles.bb new file mode 100644 index 0000000..74d1f18 --- /dev/null +++ b/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-bootfiles.bb @@ -0,0 +1,25 @@ +DESCRIPTION = "Boot files (bootscripts etc.) for Minnowboard Max/Turbot" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +inherit deploy + +COMPATIBLE_MACHINE = "intel-corei7-64" + +S = "${WORKDIR}" + +SRC_URI_append_sota = "file://uEnv-ota.txt" + +do_deploy() { + install -d ${DEPLOYDIR}/${PN} +} + +do_deploy_append_sota() { + install -m 0755 ${WORKDIR}/uEnv-ota.txt ${DEPLOYDIR}/${PN}/uEnv.txt +} + +addtask deploy before do_package after do_install +do_deploy[dirs] += "${DEPLOYDIR}/${PN}" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0001-Load-environment-from-the-boot-partition.patch b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0001-Load-environment-from-the-boot-partition.patch new file mode 100644 index 0000000..02d0e4c --- /dev/null +++ b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0001-Load-environment-from-the-boot-partition.patch @@ -0,0 +1,24 @@ +From 0161adf28590d95eaf234acc97156bc7dd989c8c Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Wed, 28 Dec 2016 16:53:35 +0100 +Subject: [PATCH] Load environment from the boot partition + +--- + include/configs/minnowmax.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/include/configs/minnowmax.h b/include/configs/minnowmax.h +index 3aa22d2..02f6980 100644 +--- a/include/configs/minnowmax.h ++++ b/include/configs/minnowmax.h +@@ -41,4 +41,7 @@ + #define CONFIG_ENV_SECT_SIZE 0x1000 + #define CONFIG_ENV_OFFSET 0x006ef000 + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "fatload mmc 1:1 0x01000000 uEnv.txt; env import -t 0x01000000 ${filesize}; run bootcmd" ++ + #endif /* __CONFIG_H */ +-- +2.9.3 + diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb index fe60489..c0603f0 100644 --- a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb +++ b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb @@ -9,7 +9,8 @@ LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6" # repo during parse SRCREV = "29e0cfb4f77f7aa369136302cee14a91e22dca71" -SRC_URI += "file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ +SRC_URI += "file://0001-Load-environment-from-the-boot-partition.patch \ + file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ http://firmware.intel.com/sites/default/files/MinnowBoard.MAX_.X64.92.R01.zip \ " -- cgit v1.2.3-54-g00ecf From 514f21316381f1eaa6a5b76c13a4e53a6cce0aa6 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Mon, 2 Jan 2017 16:31:44 +0100 Subject: Make systemd distro default --- meta-sota-qemux86-64/conf/local.conf.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-sota-qemux86-64/conf/local.conf.sample b/meta-sota-qemux86-64/conf/local.conf.sample index bf7500a..7f33b83 100644 --- a/meta-sota-qemux86-64/conf/local.conf.sample +++ b/meta-sota-qemux86-64/conf/local.conf.sample @@ -87,7 +87,7 @@ UBOOT_MACHINE = "qemu-x86_defconfig" # Ultimately when creating custom policy, people will likely end up subclassing # these defaults. # -DISTRO ?= "poky-sota" +DISTRO ?= "poky-sota-systemd" # As an example of a subclass there is a "bleeding" edge policy configuration # where many versions are set to the absolute latest code from the upstream # source control systems. This is just mentioned here as an example, its not -- cgit v1.2.3-54-g00ecf From 391750c6dc697035b76e1398bb42bdca3c5b0d62 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Mon, 2 Jan 2017 16:32:16 +0100 Subject: Make systemd distro default --- meta-sota-minnowboard/conf/local.conf.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-sota-minnowboard/conf/local.conf.sample b/meta-sota-minnowboard/conf/local.conf.sample index a437207..597abe9 100644 --- a/meta-sota-minnowboard/conf/local.conf.sample +++ b/meta-sota-minnowboard/conf/local.conf.sample @@ -87,7 +87,7 @@ UBOOT_MACHINE = "minnowmax_defconfig" # Ultimately when creating custom policy, people will likely end up subclassing # these defaults. # -DISTRO ?= "poky-sota" +DISTRO ?= "poky-sota-systemd" # As an example of a subclass there is a "bleeding" edge policy configuration # where many versions are set to the absolute latest code from the upstream # source control systems. This is just mentioned here as an example, its not -- cgit v1.2.3-54-g00ecf From 7e11aad9ac155c740e820e01e124c3678ea57c21 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Mon, 2 Jan 2017 16:32:51 +0100 Subject: Make systemd distro default --- meta-sota-raspberrypi/conf/local.conf.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-sota-raspberrypi/conf/local.conf.sample b/meta-sota-raspberrypi/conf/local.conf.sample index a6597db..53b1b6b 100644 --- a/meta-sota-raspberrypi/conf/local.conf.sample +++ b/meta-sota-raspberrypi/conf/local.conf.sample @@ -84,7 +84,7 @@ MACHINE ??= "raspberrypi3" # Ultimately when creating custom policy, people will likely end up subclassing # these defaults. # -DISTRO ?= "poky-sota" +DISTRO ?= "poky-sota-systemd" # As an example of a subclass there is a "bleeding" edge policy configuration # where many versions are set to the absolute latest code from the upstream # source control systems. This is just mentioned here as an example, its not -- cgit v1.2.3-54-g00ecf From 0440d76b91de5e91fba107ea1eadbaff2f0eaa91 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Wed, 4 Jan 2017 10:38:53 +0100 Subject: Move RPi-specific u-boot script from meta-updater --- .../u-boot-otascript/u-boot-otascript.bb | 26 ++++++++++++++++++++++ .../u-boot-otascript/u-boot-otascript/boot.scr | 3 +++ .../u-boot-otascript/u-boot-otascript/uEnv.txt | 7 ++++++ 3 files changed, 36 insertions(+) create mode 100644 meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb create mode 100644 meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr create mode 100644 meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt diff --git a/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb new file mode 100644 index 0000000..9f5f0ca --- /dev/null +++ b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb @@ -0,0 +1,26 @@ +DESCRIPTION = "Boot script for launching OTA-enabled images on raspberrypi" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +DEPENDS = "u-boot-mkimage-native" + +COMPATIBLE_MACHINE = "raspberrypi" + +SRC_URI = "file://boot.scr \ + file://uEnv.txt" + +S = "${WORKDIR}" + +inherit deploy + +do_deploy() { + install -d ${DEPLOYDIR}/bcm2835-bootfiles + + mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Ostree boot script" -d ${S}/boot.scr ${DEPLOYDIR}/bcm2835-bootfiles/boot.scr + install -m 0755 ${S}/uEnv.txt ${DEPLOYDIR}/bcm2835-bootfiles/uEnv.txt +} + +addtask deploy before do_package after do_install +do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles" + +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr new file mode 100644 index 0000000..dc13f85 --- /dev/null +++ b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr @@ -0,0 +1,3 @@ +fatload mmc 0:1 $loadaddr /uEnv.txt +env import -t $loadaddr $filesize +run bootcmd diff --git a/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt new file mode 100644 index 0000000..f6c0570 --- /dev/null +++ b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt @@ -0,0 +1,7 @@ +fdt_addr_r=0x0c800000 +bootcmd_dtb=fdt addr $fdt_addr_r; fdt get value bootargs_fdt /chosen bootargs +bootcmd_otenv=ext2load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize +bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192" +bootcmd_load=ext2load mmc 0:2 $kernel_addr_r "/boot"$kernel_image; ext2load mmc 0:2 $ramdisk_addr_r "/boot"$ramdisk_image +bootcmd_run=bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r +bootcmd=run bootcmd_dtb; run bootcmd_otenv; run bootcmd_args; run bootcmd_load; run bootcmd_run -- cgit v1.2.3-54-g00ecf From 7c9244ee9686ee76df27309a540acfb9af760f22 Mon Sep 17 00:00:00 2001 From: Jon Oster Date: Wed, 18 Jan 2017 13:31:30 +0100 Subject: allow passwordless ssh by default --- meta-sota-raspberrypi/conf/local.conf.sample | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/meta-sota-raspberrypi/conf/local.conf.sample b/meta-sota-raspberrypi/conf/local.conf.sample index 53b1b6b..481850a 100644 --- a/meta-sota-raspberrypi/conf/local.conf.sample +++ b/meta-sota-raspberrypi/conf/local.conf.sample @@ -136,11 +136,7 @@ PACKAGE_CLASSES ?= "package_rpm" # There are other application targets that can be used here too, see # meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details. -# Poky normally enables debug-tweaks, but since we allow remote SSH access to -# OpenIVI over tor, disable it. empty-root-password but not debug-tweaks allows -# passwordless login locally only. - -EXTRA_IMAGE_FEATURES = "empty-root-password" +EXTRA_IMAGE_FEATURES = "debug-tweaks" # # Additional image features -- cgit v1.2.3-54-g00ecf From 2324fd91d7bf1dfc41398a354c72be46ece15ec4 Mon Sep 17 00:00:00 2001 From: Phil Wise Date: Thu, 16 Feb 2017 14:11:51 +0100 Subject: Fix up paths --- meta-sota-qemux86-64/conf/bblayers.conf.sample | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meta-sota-qemux86-64/conf/bblayers.conf.sample b/meta-sota-qemux86-64/conf/bblayers.conf.sample index fdc771a..8fa41b9 100644 --- a/meta-sota-qemux86-64/conf/bblayers.conf.sample +++ b/meta-sota-qemux86-64/conf/bblayers.conf.sample @@ -9,9 +9,8 @@ BBLAYERS ?= " \ ##OEROOT##/meta \ ##OEROOT##/meta-yocto \ ##OEROOT##/meta-yocto-bsp \ - ##OEROOT##/../meta-raspberrypi \ ##OEROOT##/../meta-updater \ - ##OEROOT##/../meta-updater-minnowmax \ + ##OEROOT##/../meta-updater-qemux86-64 \ ##OEROOT##/../meta-openembedded/meta-oe \ ##OEROOT##/../meta-openembedded/meta-filesystems \ ##OEROOT##/../meta-rust \ -- cgit v1.2.3-54-g00ecf From 94d3f04ee1f2e3761d663a89e708977bfbfdc480 Mon Sep 17 00:00:00 2001 From: Phil Wise Date: Thu, 16 Feb 2017 17:07:03 +0100 Subject: Add example run-qemu script --- meta-sota-qemux86-64/scripts/run-qemu | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 meta-sota-qemux86-64/scripts/run-qemu diff --git a/meta-sota-qemux86-64/scripts/run-qemu b/meta-sota-qemux86-64/scripts/run-qemu new file mode 100755 index 0000000..d4c0240 --- /dev/null +++ b/meta-sota-qemux86-64/scripts/run-qemu @@ -0,0 +1,17 @@ +DIR=tmp/deploy/images/qemux86-64 +IMAGE=$DIR/core-image-minimal-qemux86-64.otaimg + +qemu-system-x86_64 \ + -bios $DIR/u-boot-qemux86-64.rom \ + -drive file=$IMAGE,format=raw \ + -vga std -m 512 \ + -serial stdio \ + -serial tcp:127.0.0.1:8990,server,nowait \ + -net user,hostfwd=tcp:0.0.0.0:2222-:22,restrict=off \ + -net nic \ + -usb \ + -cpu core2duo \ + -nographic \ + -display none + +# -enable-kvm \ -- cgit v1.2.3-54-g00ecf From 7b31224b4f69c8a7f537a5b2bd3cb325765988e3 Mon Sep 17 00:00:00 2001 From: Phil Wise Date: Thu, 16 Feb 2017 17:22:35 +0100 Subject: Switch from empty-root-password to 'debug-tweaks' --- meta-sota-qemux86-64/conf/local.conf.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-sota-qemux86-64/conf/local.conf.sample b/meta-sota-qemux86-64/conf/local.conf.sample index 7f33b83..c893530 100644 --- a/meta-sota-qemux86-64/conf/local.conf.sample +++ b/meta-sota-qemux86-64/conf/local.conf.sample @@ -143,7 +143,7 @@ PACKAGE_CLASSES ?= "package_rpm" # OpenIVI over tor, disable it. empty-root-password but not debug-tweaks allows # passwordless login locally only. -EXTRA_IMAGE_FEATURES = "empty-root-password" +EXTRA_IMAGE_FEATURES = "debug-tweaks" # # Additional image features -- cgit v1.2.3-54-g00ecf From 34770e853734d7c29420ffa52b322fe9ca91d70d Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Mon, 3 Apr 2017 17:02:59 +0200 Subject: Syncronize with newer meta-raspberrypi (pulled from AGL) --- .../recipes-bsp/bootfiles/rpi-config_git.bbappend | 8 +++ .../0001-Smack-File-receive-for-sockets.patch | 65 +++++++++++++++++++ .../0002-smack-fix-cache-of-access-labels.patch | 43 +++++++++++++ ...ack-ignore-null-signal-in-smack_task_kill.patch | 39 ++++++++++++ ...n-smack_known_web-label-for-kernel-thread.patch | 49 +++++++++++++++ .../linux/linux-raspberrypi_%.bbappend | 72 ++++++++++++++++++++++ .../linux/linux-raspberrypi_4.4.bbappend | 58 +++-------------- .../linux/linux-raspberrypi_4.9.bbappend | 6 ++ 8 files changed, 290 insertions(+), 50 deletions(-) create mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch create mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch create mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch create mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch create mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend create mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend diff --git a/meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend index ff14d36..9222fd5 100644 --- a/meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend +++ b/meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend @@ -1,6 +1,14 @@ DISABLE_OVERSCAN = "1" do_deploy_append() { + if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_LWM}" ]; then + sed -i '/#cma_lwm/ c\cma_lwm=${CMA_LWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_HWM}" ]; then + sed -i '/#cma_hwm/ c\cma_hwm=${CMA_HWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + echo "avoid_warnings=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtoverlay=vc4-kms-v3d-overlay,cma-256" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch new file mode 100644 index 0000000..4021e5d --- /dev/null +++ b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch @@ -0,0 +1,65 @@ +From 2b206c36b16e72cfe41cd22448d8527359ffd962 Mon Sep 17 00:00:00 2001 +From: Casey Schaufler +Date: Mon, 7 Dec 2015 14:34:32 -0800 +Subject: [PATCH 1/4] Smack: File receive for sockets + +The existing file receive hook checks for access on +the file inode even for UDS. This is not right, as +the inode is not used by Smack to make access checks +for sockets. This change checks for an appropriate +access relationship between the receiving (current) +process and the socket. If the process can't write +to the socket's send label or the socket's receive +label can't write to the process fail. + +This will allow the legitimate cases, where the +socket sender and socket receiver can freely communicate. +Only strangly set socket labels should cause a problem. + +Signed-off-by: Casey Schaufler +--- + security/smack/smack_lsm.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c +index ff81026..b20ef06 100644 +--- a/security/smack/smack_lsm.c ++++ b/security/smack/smack_lsm.c +@@ -1860,12 +1860,34 @@ static int smack_file_receive(struct file *file) + int may = 0; + struct smk_audit_info ad; + struct inode *inode = file_inode(file); ++ struct socket *sock; ++ struct task_smack *tsp; ++ struct socket_smack *ssp; + + if (unlikely(IS_PRIVATE(inode))) + return 0; + + smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH); + smk_ad_setfield_u_fs_path(&ad, file->f_path); ++ ++ if (S_ISSOCK(inode->i_mode)) { ++ sock = SOCKET_I(inode); ++ ssp = sock->sk->sk_security; ++ tsp = current_security(); ++ /* ++ * If the receiving process can't write to the ++ * passed socket or if the passed socket can't ++ * write to the receiving process don't accept ++ * the passed socket. ++ */ ++ rc = smk_access(tsp->smk_task, ssp->smk_out, MAY_WRITE, &ad); ++ rc = smk_bu_file(file, may, rc); ++ if (rc < 0) ++ return rc; ++ rc = smk_access(ssp->smk_in, tsp->smk_task, MAY_WRITE, &ad); ++ rc = smk_bu_file(file, may, rc); ++ return rc; ++ } + /* + * This code relies on bitmasks. + */ +-- +2.7.4 + diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch new file mode 100644 index 0000000..c516f3a --- /dev/null +++ b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch @@ -0,0 +1,43 @@ +From 99267706991ab84bd44ceaea9a7ec886bbdd58e0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Bollo?= +Date: Tue, 12 Jan 2016 21:23:40 +0100 +Subject: [PATCH 2/4] smack: fix cache of access labels +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Before this commit, removing the access property of +a file, aka, the extended attribute security.SMACK64 +was not effictive until the cache had been cleaned. + +This patch fixes that problem. + +Signed-off-by: José Bollo +Acked-by: Casey Schaufler +--- + security/smack/smack_lsm.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c +index b20ef06..b2bcb14 100644 +--- a/security/smack/smack_lsm.c ++++ b/security/smack/smack_lsm.c +@@ -1444,9 +1444,13 @@ static int smack_inode_removexattr(struct dentry *dentry, const char *name) + * Don't do anything special for these. + * XATTR_NAME_SMACKIPIN + * XATTR_NAME_SMACKIPOUT +- * XATTR_NAME_SMACKEXEC + */ +- if (strcmp(name, XATTR_NAME_SMACK) == 0) ++ if (strcmp(name, XATTR_NAME_SMACK) == 0) { ++ struct super_block *sbp = d_backing_inode(dentry)->i_sb; ++ struct superblock_smack *sbsp = sbp->s_security; ++ ++ isp->smk_inode = sbsp->smk_default; ++ } else if (strcmp(name, XATTR_NAME_SMACKEXEC) == 0) + isp->smk_task = NULL; + else if (strcmp(name, XATTR_NAME_SMACKMMAP) == 0) + isp->smk_mmap = NULL; +-- +2.7.4 + diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch new file mode 100644 index 0000000..c9180bb --- /dev/null +++ b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch @@ -0,0 +1,39 @@ +From ec4eb03af07b0fbc330aecca6ac4ebd6accd8825 Mon Sep 17 00:00:00 2001 +From: Rafal Krypa +Date: Mon, 4 Apr 2016 11:14:53 +0200 +Subject: [PATCH 3/4] Smack: ignore null signal in smack_task_kill + +Kill with signal number 0 is commonly used for checking PID existence. +Smack treated such cases like any other kills, although no signal is +actually delivered when sig == 0. + +Checking permissions when sig == 0 didn't prevent an unprivileged caller +from learning whether PID exists or not. When it existed, kernel returned +EPERM, when it didn't - ESRCH. The only effect of policy check in such +case is noise in audit logs. + +This change lets Smack silently ignore kill() invocations with sig == 0. + +Signed-off-by: Rafal Krypa +Acked-by: Casey Schaufler +--- + security/smack/smack_lsm.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c +index b2bcb14..cf8a93f 100644 +--- a/security/smack/smack_lsm.c ++++ b/security/smack/smack_lsm.c +@@ -2239,6 +2239,9 @@ static int smack_task_kill(struct task_struct *p, struct siginfo *info, + struct smack_known *tkp = smk_of_task_struct(p); + int rc; + ++ if (!sig) ++ return 0; /* null signal; existence test */ ++ + smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK); + smk_ad_setfield_u_tsk(&ad, p); + /* +-- +2.7.4 + diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch new file mode 100644 index 0000000..a1eeac3 --- /dev/null +++ b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch @@ -0,0 +1,49 @@ +From c8bbb0f916de54610513e376070aea531af19dd6 Mon Sep 17 00:00:00 2001 +From: jooseong lee +Date: Thu, 3 Nov 2016 10:55:43 +0100 +Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook + +Creating struct sock by sk_alloc function in various kernel subsystems +like bluetooth dosen't call smack_socket_post_create(). In such case, +received sock label is the floor('_') label and makes access deny. + +Refers-to: https://review.tizen.org/gerrit/#/c/80717/4 + +Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8 +Signed-off-by: jooseong lee +Signed-off-by: José Bollo +--- + security/smack/smack_lsm.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c +index cf8a93f..21651bc 100644 +--- a/security/smack/smack_lsm.c ++++ b/security/smack/smack_lsm.c +@@ -2321,8 +2321,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags) + if (ssp == NULL) + return -ENOMEM; + +- ssp->smk_in = skp; +- ssp->smk_out = skp; ++ /* ++ * Sockets created by kernel threads receive web label. ++ */ ++ if (unlikely(current->flags & PF_KTHREAD)) { ++ ssp->smk_in = &smack_known_web; ++ ssp->smk_out = &smack_known_web; ++ } else { ++ ssp->smk_in = skp; ++ ssp->smk_out = skp; ++ } + ssp->smk_packet = NULL; + + sk->sk_security = ssp; +-- +2.7.4 + diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend new file mode 100644 index 0000000..1db6d42 --- /dev/null +++ b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend @@ -0,0 +1,72 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" + +SRC_URI_append = "\ + ${@base_conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \ +" + +do_configure_append_smack() { + # SMACK and Co + kernel_configure_variable IP_NF_SECURITY m + kernel_configure_variable IP6_NF_SECURITY m + kernel_configure_variable EXT2_FS_SECURITY y + kernel_configure_variable EXT3_FS_SECURITY y + kernel_configure_variable EXT4_FS_SECURITY y + kernel_configure_variable SECURITY y + kernel_configure_variable SECURITY_SMACK y + kernel_configure_variable TMPFS_XATTR y + kernel_configure_variable DEFAULT_SECURITY "smack" + kernel_configure_variable DEFAULT_SECURITY_SMACK y + kernel_configure_variable FANOTIFY_ACCESS_PERMISSIONS y +} + +do_configure_append_netboot() { + # NBD for netboot + kernel_configure_variable BLK_DEV_NBD y + # ramblk for inird + kernel_configure_variable BLK_DEV_RAM y +} + +do_configure_append_sota() { + # ramblk for inird + kernel_configure_variable BLK_DEV_RAM y +} + +do_configure_append() { + + # VC4 Wayland/Weston + kernel_configure_variable I2C_BCM2835 y + kernel_configure_variable DRM y + kernel_configure_variable DRM_PANEL_RASPBERRYPI_TOUCHSCREEN y + kernel_configure_variable DRM_VC4 y + kernel_configure_variable FB_BCM2708 n + + # Enable support for TP-Link TL-W722N USB Wifi adapter + kernel_configure_variable CONFIG_ATH_CARDS m + kernel_configure_variable CONFIG_ATH9K_HTC m + + # Enable support for RTLSDR + kernel_configure_variable CONFIG_MEDIA_USB_SUPPORT y + kernel_configure_variable CONFIG_MEDIA_DIGITAL_TV_SUPPORT y + kernel_configure_variable CONFIG_DVB_USB_V2 m + kernel_configure_variable CONFIG_DVB_USB_RTL28XXU m + + # KEEP until fixed upstream: + # Keep this the last line + # Remove all modified configs and add the rest to .config + sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config' + + yes '' | oe_runmake oldconfig + kernel_do_configure +} + +CMDLINE_DEBUG = "" +CMDLINE_append = " usbhid.mousepoll=0" + +# Add options to allow CMA to operate +CMDLINE_append = ' ${@base_conditional("ENABLE_CMA", "1", "coherent_pool=6M smsc95xx.turbo_mode=N", "", d)}' + +KERNEL_MODULE_AUTOLOAD += "snd-bcm2835" +KERNEL_MODULE_AUTOLOAD += "hid-multitouch" + +RDEPENDS_${PN} += "kernel-module-snd-bcm2835" +PACKAGES += "kernel-module-snd-bcm2835" diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend index 0a0ddf8..9879c6f 100644 --- a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend +++ b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend @@ -1,51 +1,9 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" - -LINUX_VERSION = "4.4.16" - -SRCREV = "26550dcfb86b0308a99f726abbfb55abb1b0f78c" - -SRC_URI_append = "\ - ${@base_conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \ +#------------------------------------------------------------------------- +# smack patches for handling bluetooth + +SRC_URI_append_smack = "\ + file://0001-Smack-File-receive-for-sockets.patch \ + file://0002-smack-fix-cache-of-access-labels.patch \ + file://0003-Smack-ignore-null-signal-in-smack_task_kill.patch \ + file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ " - -do_configure_append_sota() { - # ramblk for inird - kernel_configure_variable BLK_DEV_RAM y -} - -do_configure_append() { - - # VC4 Wayland/Weston - kernel_configure_variable I2C_BCM2835 y - kernel_configure_variable DRM y - kernel_configure_variable DRM_PANEL_RASPBERRYPI_TOUCHSCREEN y - kernel_configure_variable DRM_VC4 y - kernel_configure_variable FB_BCM2708 n - - # Enable support for TP-Link TL-W722N USB Wifi adapter - kernel_configure_variable CONFIG_ATH_CARDS m - kernel_configure_variable CONFIG_ATH9K_HTC m - - # Enable support for RTLSDR - kernel_configure_variable CONFIG_MEDIA_USB_SUPPORT y - kernel_configure_variable CONFIG_MEDIA_DIGITAL_TV_SUPPORT y - kernel_configure_variable CONFIG_DVB_USB_V2 m - kernel_configure_variable CONFIG_DVB_USB_RTL28XXU m - - # KEEP until fixed upstream: - # Keep this the last line - # Remove all modified configs and add the rest to .config - sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config' - - yes '' | oe_runmake oldconfig - kernel_do_configure -} - - -CMDLINE_append = " usbhid.mousepoll=0" - -KERNEL_MODULE_AUTOLOAD += "snd-bcm2835" -KERNEL_MODULE_AUTOLOAD += "hid-multitouch" - -RDEPENDS_${PN} += "kernel-module-snd-bcm2835" -PACKAGES += "kernel-module-snd-bcm2835" diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend new file mode 100644 index 0000000..206a8d0 --- /dev/null +++ b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend @@ -0,0 +1,6 @@ +#------------------------------------------------------------------------- +# smack patches for handling bluetooth + +SRC_URI_append_smack = "\ + file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ +" -- cgit v1.2.3-54-g00ecf From bfede3c84cb0568405273221864b133757262ad6 Mon Sep 17 00:00:00 2001 From: Andrea Galbusera Date: Fri, 7 Apr 2017 16:34:45 +0200 Subject: u-boot-ota: fix build error under gcc6 Fix the following build error under gcc6: | ../include/linux/compiler-gcc.h:114:30: fatal error: linux/compiler-gcc6.h: No such file or directory | #include gcc_header(__GNUC__) Signed-off-by: Andrea Galbusera --- .../u-boot-ota/fix-build-error-under-gcc6.patch | 86 ++++++++++++++++++++++ .../recipes-bsp/u-boot/u-boot-ota_2015.07.bb | 1 + 2 files changed, 87 insertions(+) create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch new file mode 100644 index 0000000..839cd7d --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch @@ -0,0 +1,86 @@ +fix build error under gcc6 + +Fix the following error: +| ../include/linux/compiler-gcc.h:114:30: fatal error: linux/compiler-gcc6.h: No such file or directory +| #include gcc_header(__GNUC__) + +Signed-off-by: Zhenhua Luo + +Upstream-Status: Pending +--- + include/linux/compiler-gcc6.h | 65 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 65 insertions(+) + create mode 100644 include/linux/compiler-gcc6.h + +diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h +new file mode 100644 +index 0000000..c8c5659 +--- /dev/null ++++ b/include/linux/compiler-gcc6.h +@@ -0,0 +1,65 @@ ++#ifndef __LINUX_COMPILER_H ++#error "Please don't include directly, include instead." ++#endif ++ ++#define __used __attribute__((__used__)) ++#define __must_check __attribute__((warn_unused_result)) ++#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) ++ ++/* Mark functions as cold. gcc will assume any path leading to a call ++ to them will be unlikely. This means a lot of manual unlikely()s ++ are unnecessary now for any paths leading to the usual suspects ++ like BUG(), printk(), panic() etc. [but let's keep them for now for ++ older compilers] ++ ++ Early snapshots of gcc 4.3 don't support this and we can't detect this ++ in the preprocessor, but we can live with this because they're unreleased. ++ Maketime probing would be overkill here. ++ ++ gcc also has a __attribute__((__hot__)) to move hot functions into ++ a special section, but I don't see any sense in this right now in ++ the kernel context */ ++#define __cold __attribute__((__cold__)) ++ ++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ++ ++#ifndef __CHECKER__ ++# define __compiletime_warning(message) __attribute__((warning(message))) ++# define __compiletime_error(message) __attribute__((error(message))) ++#endif /* __CHECKER__ */ ++ ++/* ++ * Mark a position in code as unreachable. This can be used to ++ * suppress control flow warnings after asm blocks that transfer ++ * control elsewhere. ++ * ++ * Early snapshots of gcc 4.5 don't support this and we can't detect ++ * this in the preprocessor, but we can live with this because they're ++ * unreleased. Really, we need to have autoconf for the kernel. ++ */ ++#define unreachable() __builtin_unreachable() ++ ++/* Mark a function definition as prohibited from being cloned. */ ++#define __noclone __attribute__((__noclone__)) ++ ++/* ++ * Tell the optimizer that something else uses this function or variable. ++ */ ++#define __visible __attribute__((externally_visible)) ++ ++/* ++ * GCC 'asm goto' miscompiles certain code sequences: ++ * ++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 ++ * ++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. ++ * ++ * (asm goto is automatically volatile - the naming reflects this.) ++ */ ++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) ++ ++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP ++#define __HAVE_BUILTIN_BSWAP32__ ++#define __HAVE_BUILTIN_BSWAP64__ ++#define __HAVE_BUILTIN_BSWAP16__ ++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ +-- diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb index e190137..c38f95e 100644 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb @@ -11,6 +11,7 @@ SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204" SRC_URI += "file://0001-Set-up-environment-for-OSTree-integration.patch \ file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ + file://fix-build-error-under-gcc6.patch \ " PV = "v2015.07+git${SRCPV}" -- cgit v1.2.3-54-g00ecf From bbac54c78a770731b134683ec28b042af2682634 Mon Sep 17 00:00:00 2001 From: Phil Wise Date: Mon, 10 Apr 2017 14:48:41 +0200 Subject: Replace runqemu with a nicer python script --- meta-sota-qemux86-64/scripts/run-qemu | 136 +++++++++++++++++++++++++++++----- 1 file changed, 119 insertions(+), 17 deletions(-) diff --git a/meta-sota-qemux86-64/scripts/run-qemu b/meta-sota-qemux86-64/scripts/run-qemu index d4c0240..b36e253 100755 --- a/meta-sota-qemux86-64/scripts/run-qemu +++ b/meta-sota-qemux86-64/scripts/run-qemu @@ -1,17 +1,119 @@ -DIR=tmp/deploy/images/qemux86-64 -IMAGE=$DIR/core-image-minimal-qemux86-64.otaimg - -qemu-system-x86_64 \ - -bios $DIR/u-boot-qemux86-64.rom \ - -drive file=$IMAGE,format=raw \ - -vga std -m 512 \ - -serial stdio \ - -serial tcp:127.0.0.1:8990,server,nowait \ - -net user,hostfwd=tcp:0.0.0.0:2222-:22,restrict=off \ - -net nic \ - -usb \ - -cpu core2duo \ - -nographic \ - -display none - -# -enable-kvm \ +#! /usr/bin/env python + +from argparse import ArgumentParser +from subprocess import Popen +from os.path import exists, join +import random +import sys +import socket + +DEFAULT_DIR = 'tmp/deploy/images/qemux86-64' + + +def find_local_port(start_port): + """" + Find the next free TCP port after 'start_port'. + """ + + for port in range(start_port, start_port + 10): + try: + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.bind(('', port)) + return port + except socket.error: + print("Skipping port %d" % port) + finally: + s.close() + raise Exception("Could not find a free TCP port") + + +def random_mac(): + """Return a random Ethernet MAC address + @link https://www.iana.org/assignments/ethernet-numbers/ethernet-numbers.xhtml#ethernet-numbers-2 + """ + head = "ca:fe:" + hex_digits = '0123456789abcdef' + tail = ':'.join([random.choice(hex_digits) + random.choice(hex_digits) for _ in range(4)]) + return head + tail + + +class QemuCommand(object): + def __init__(self, args): + self.uboot = join(args.dir, 'u-boot-qemux86-64.rom') + self.image = join(args.dir, args.imagename + '-qemux86-64.otaimg') + if args.mac: + self.mac_address = args.mac + else: + self.mac_address = random_mac() + self.serial_port = find_local_port(8990) + self.ssh_port = find_local_port(2222) + self.kvm = not args.no_kvm + self.gui = not args.no_gui + self.gdb = args.gdb + if not exists(self.uboot): + raise ValueError("U-Boot image %s does not exist" % self.uboot) + if not exists(self.image): + raise ValueError("OS image %s does not exist" % self.image) + + def command_line(self): + netuser = 'user,hostfwd=tcp:0.0.0.0:%d-:22,restrict=off' % self.ssh_port + if self.gdb: + netuser += ',hostfwd=tcp:0.0.0.0:2159-:2159' + cmdline = [ + "qemu-system-x86_64", + "-bios", self.uboot, + "-drive", "file=%s,if=ide,format=raw,snapshot=on" % self.image, + "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port, + "-m", "1G", + "-usb", + "-usbdevice", "tablet", + "-show-cursor", + "-vga", "std", + "-net", netuser, + "-net", "nic,macaddr=%s,model=virtio" % self.mac_address + ] + if self.gui: + cmdline += ["-serial", "stdio"] + else: + cmdline.append('-nographic') + if self.kvm: + cmdline.append('-enable-kvm') + return cmdline + + +def main(): + parser = ArgumentParser(description='Run meta-updater image in qemu') + parser.add_argument('imagename', default='core-image-minimal', nargs='?') + parser.add_argument('mac', default=None, nargs='?') + parser.add_argument('--dir', default=DEFAULT_DIR, + help='Path to build directory containing the image and u-boot-qemux86-64.rom') + parser.add_argument('--no-kvm', help='Disable KVM in QEMU', action='store_true') + parser.add_argument('--no-gui', help='Disable GUI', action='store_true') + parser.add_argument('--gdb', help='Export gdbserver port 2159 from the image', action='store_true') + parser.add_argument('-n', '--dry-run', help='Print qemu command line rather then run it', action='store_true') + args = parser.parse_args() + try: + qemu_command = QemuCommand(args) + except ValueError, e: + print(e.message) + sys.exit(1) + + print("Launching %s with mac address %s" % (args.imagename, qemu_command.mac_address)) + print("To connect via SSH:") + print(" ssh -o StrictHostKeyChecking=no root@localhost -p %d" % qemu_command.ssh_port) + print("To connect to the serial console:") + print(" nc localhost %d" % qemu_command.serial_port) + + cmdline = qemu_command.command_line() + if args.dry_run: + print(" ".join(cmdline)) + else: + s = Popen(cmdline) + try: + s.wait() + except KeyboardInterrupt: + pass + + +if __name__ == '__main__': + main() -- cgit v1.2.3-54-g00ecf From fc9b85c49f8a59010eab3b0484b3651513b0cc04 Mon Sep 17 00:00:00 2001 From: Phil Wise Date: Mon, 22 May 2017 08:41:42 +0200 Subject: Add --efi option to boot via EFI bios --- meta-sota-qemux86-64/scripts/run-qemu | 43 +++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/meta-sota-qemux86-64/scripts/run-qemu b/meta-sota-qemux86-64/scripts/run-qemu index b36e253..3b178ce 100755 --- a/meta-sota-qemux86-64/scripts/run-qemu +++ b/meta-sota-qemux86-64/scripts/run-qemu @@ -3,12 +3,17 @@ from argparse import ArgumentParser from subprocess import Popen from os.path import exists, join +from os import listdir import random import sys import socket -DEFAULT_DIR = 'tmp/deploy/images/qemux86-64' +DEFAULT_DIR = 'tmp/deploy/images' +EXTENSIONS = { + 'intel-corei7-64': 'wic', + 'qemux86-64': 'otaimg' +} def find_local_port(start_port): """" @@ -39,8 +44,25 @@ def random_mac(): class QemuCommand(object): def __init__(self, args): - self.uboot = join(args.dir, 'u-boot-qemux86-64.rom') - self.image = join(args.dir, args.imagename + '-qemux86-64.otaimg') + if args.machine: + self.machine = args.machine + else: + machines = listdir(args.dir) + if len(machines) == 1: + self.machine = machines[0] + else: + raise ValueError("Could not autodetect machine type from %s" % args.dir) + if args.efi: + self.bios = 'OVMF.fd' + else: + uboot = join(args.dir, self.machine, 'u-boot-qemux86-64.rom') + if not exists(uboot): + raise ValueError("U-Boot image %s does not exist" % uboot) + self.bios = uboot + ext = EXTENSIONS.get(self.machine, 'wic') + self.image = join(args.dir, self.machine, '%s-%s.%s' % (args.imagename, self.machine, ext)) + if not exists(self.image): + raise ValueError("OS image %s does not exist" % self.image) if args.mac: self.mac_address = args.mac else: @@ -50,10 +72,6 @@ class QemuCommand(object): self.kvm = not args.no_kvm self.gui = not args.no_gui self.gdb = args.gdb - if not exists(self.uboot): - raise ValueError("U-Boot image %s does not exist" % self.uboot) - if not exists(self.image): - raise ValueError("OS image %s does not exist" % self.image) def command_line(self): netuser = 'user,hostfwd=tcp:0.0.0.0:%d-:22,restrict=off' % self.ssh_port @@ -61,7 +79,7 @@ class QemuCommand(object): netuser += ',hostfwd=tcp:0.0.0.0:2159-:2159' cmdline = [ "qemu-system-x86_64", - "-bios", self.uboot, + "-bios", self.bios, "-drive", "file=%s,if=ide,format=raw,snapshot=on" % self.image, "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port, "-m", "1G", @@ -70,7 +88,7 @@ class QemuCommand(object): "-show-cursor", "-vga", "std", "-net", netuser, - "-net", "nic,macaddr=%s,model=virtio" % self.mac_address + "-net", "nic,macaddr=%s" % self.mac_address ] if self.gui: cmdline += ["-serial", "stdio"] @@ -87,6 +105,11 @@ def main(): parser.add_argument('mac', default=None, nargs='?') parser.add_argument('--dir', default=DEFAULT_DIR, help='Path to build directory containing the image and u-boot-qemux86-64.rom') + parser.add_argument('--efi', + help='Boot using UEFI rather than U-Boot. This requires the image to be built with ' + + 'OSTREE_BOOTLOADER = "grub" and OVMF.fd firmware to be installed (try "apt install ovmf")', + action='store_true') + parser.add_argument('--machine', default=None, help="Target MACHINE") parser.add_argument('--no-kvm', help='Disable KVM in QEMU', action='store_true') parser.add_argument('--no-gui', help='Disable GUI', action='store_true') parser.add_argument('--gdb', help='Export gdbserver port 2159 from the image', action='store_true') @@ -94,7 +117,7 @@ def main(): args = parser.parse_args() try: qemu_command = QemuCommand(args) - except ValueError, e: + except ValueError as e: print(e.message) sys.exit(1) -- cgit v1.2.3-54-g00ecf From f3041e0fb727c9b78684c85eaf64297cc9166e66 Mon Sep 17 00:00:00 2001 From: Jon Oster Date: Wed, 31 May 2017 14:19:24 +0200 Subject: PRO-3202 Add a script to flash disk images --- meta-sota-raspberrypi/scripts/flash-image.sh | 127 +++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100755 meta-sota-raspberrypi/scripts/flash-image.sh diff --git a/meta-sota-raspberrypi/scripts/flash-image.sh b/meta-sota-raspberrypi/scripts/flash-image.sh new file mode 100755 index 0000000..74707bc --- /dev/null +++ b/meta-sota-raspberrypi/scripts/flash-image.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +ask() { + # http://djm.me/ask + local prompt default REPLY + + while true; do + + if [ "${2:-}" = "Y" ]; then + prompt="Y/n" + default=Y + elif [ "${2:-}" = "N" ]; then + prompt="y/N" + default=N + else + prompt="y/n" + default= + fi + + # Ask the question (not using "read -p" as it uses stderr not stdout) + echo -n "$1 [$prompt] " + + # Read the answer (use /dev/tty in case stdin is redirected from somewhere else) + read REPLY &2 + echo "" + exit 1 +fi + +if [ -z "$1" ]; then + echo "" + echo " Flash a built image with an ATS Garage device config file baked in." + echo "" + echo " Usage: ./flash-configured-image.sh device [imagefile] " + echo "" + echo "" + echo " device : The device name to flash. Must be a removable device." + echo " Example: sdb" + echo "" + echo " imagefile : An image file generated by bitbake (optional)." + echo " Default: ./tmp/deploy/images/raspberrypi3/rpi-basic-image-raspberrypi3.rpi-sdimg-ota" + echo "" + echo " The following utilities are prerequisites:" + echo "" + echo " dd" + echo " parted" + echo " e2fsck" + echo " fdisk" + echo " resize2fs" + echo "" + exit 1 +fi + +set -euo pipefail + +DEVICE_TO_FLASH=$1 +IMAGE_TO_FLASH="${2-tmp/deploy/images/raspberrypi3/rpi-basic-image-raspberrypi3.rpi-sdimg-ota}" +DEVICE_IS_REMOVABLE=$(cat /sys/block/$DEVICE_TO_FLASH/removable) + +if [[ $DEVICE_IS_REMOVABLE != "1" ]]; then + echo "" + echo " For safety, this script will only flash removable block devices." + echo "" + echo " This check is implemented by reading /sys/block/$DEVICE_TO_FLASH/removable." + echo "" + exit 1 +fi + +echo " " +echo " Writing image file: $IMAGE_TO_FLASH " +echo " to device : $DEVICE_TO_FLASH " +echo " " +if ask "Do you want to continue?" N; then + echo " " +else + exit 1 +fi + +if [ ! -f "$IMAGE_TO_FLASH" ]; then + echo " " + echo " Error: $IMAGE_TO_FLASH doesn't exist" + echo "" + exit 1 +fi + +echo "Unmounting all partitions on $DEVICE_TO_FLASH" +umount /dev/$DEVICE_TO_FLASH* || true +sleep 2 + +echo "Writing image to $DEVICE_TO_FLASH..." +dd if=$IMAGE_TO_FLASH of=/dev/$DEVICE_TO_FLASH bs=32M && sync +sleep 2 + +# It turns out there are card readers that give their partitions funny names, like +# "/dev/mmcblk0" will be the device, but the partitions are called "/dev/mmcblk0p1" +# for example. Better to just get the name of the partition after we flash it. +SECOND_PARTITION=$(fdisk -l /dev/$DEVICE_TO_FLASH | tail -n 1 | awk '{print $1}') + +echo "Resizing rootfs partition to fill all of $DEVICE_TO_FLASH..." +parted -s /dev/$DEVICE_TO_FLASH resizepart 2 '100%' +sleep 2 +e2fsck -f $SECOND_PARTITION || true +sleep 2 + +echo "Resizing filesystem on $SECOND_PARTITION to match partition size..." +resize2fs -p $SECOND_PARTITION +sleep 2 + +echo "Done!" + -- cgit v1.2.3-54-g00ecf From 9eb9985bb0a2c830dd15c656400b038032289b32 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Tue, 4 Jul 2017 16:26:02 +0200 Subject: Remove bbappend for a deleted recipe --- .../recipes-kernel/linux/linux-raspberrypi_4.4.bbappend | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend deleted file mode 100644 index 9879c6f..0000000 --- a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.4.bbappend +++ /dev/null @@ -1,9 +0,0 @@ -#------------------------------------------------------------------------- -# smack patches for handling bluetooth - -SRC_URI_append_smack = "\ - file://0001-Smack-File-receive-for-sockets.patch \ - file://0002-smack-fix-cache-of-access-labels.patch \ - file://0003-Smack-ignore-null-signal-in-smack_task_kill.patch \ - file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ -" -- cgit v1.2.3-54-g00ecf From 46b636c8ade3cf1f417c70cf27dd4b9f8378ca60 Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Mon, 21 Aug 2017 12:02:36 +0300 Subject: u-boot-ota: Update SRC_URI for Pyro Update SRC_URI and add path to the git repository to ensure that U-Boot will be successfully built for release Pyro for QEMU. Signed-off-by: Leon Anavi --- meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb index c38f95e..6009685 100644 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb @@ -9,13 +9,17 @@ LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95" # repo during parse SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204" -SRC_URI += "file://0001-Set-up-environment-for-OSTree-integration.patch \ +SRC_URI=" \ + git://git.denx.de/u-boot.git;branch=master \ + file://0001-Set-up-environment-for-OSTree-integration.patch \ file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ file://fix-build-error-under-gcc6.patch \ " PV = "v2015.07+git${SRCPV}" +S = "${WORKDIR}/git" + EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" UBOOT_SUFFIX = "bin" -- cgit v1.2.3-54-g00ecf From 40ee5d8ab02d99ce146d93f7e42315d26f61c621 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Mon, 11 Sep 2017 17:32:26 +0200 Subject: meta-updater-qemux86-64/scripts/run-qemu is now obsolete and redundant. Use meta-updater/scripts/run-qemu-ota. --- meta-sota-qemux86-64/scripts/run-qemu | 142 ---------------------------------- 1 file changed, 142 deletions(-) delete mode 100755 meta-sota-qemux86-64/scripts/run-qemu diff --git a/meta-sota-qemux86-64/scripts/run-qemu b/meta-sota-qemux86-64/scripts/run-qemu deleted file mode 100755 index 3b178ce..0000000 --- a/meta-sota-qemux86-64/scripts/run-qemu +++ /dev/null @@ -1,142 +0,0 @@ -#! /usr/bin/env python - -from argparse import ArgumentParser -from subprocess import Popen -from os.path import exists, join -from os import listdir -import random -import sys -import socket - -DEFAULT_DIR = 'tmp/deploy/images' - -EXTENSIONS = { - 'intel-corei7-64': 'wic', - 'qemux86-64': 'otaimg' -} - -def find_local_port(start_port): - """" - Find the next free TCP port after 'start_port'. - """ - - for port in range(start_port, start_port + 10): - try: - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.bind(('', port)) - return port - except socket.error: - print("Skipping port %d" % port) - finally: - s.close() - raise Exception("Could not find a free TCP port") - - -def random_mac(): - """Return a random Ethernet MAC address - @link https://www.iana.org/assignments/ethernet-numbers/ethernet-numbers.xhtml#ethernet-numbers-2 - """ - head = "ca:fe:" - hex_digits = '0123456789abcdef' - tail = ':'.join([random.choice(hex_digits) + random.choice(hex_digits) for _ in range(4)]) - return head + tail - - -class QemuCommand(object): - def __init__(self, args): - if args.machine: - self.machine = args.machine - else: - machines = listdir(args.dir) - if len(machines) == 1: - self.machine = machines[0] - else: - raise ValueError("Could not autodetect machine type from %s" % args.dir) - if args.efi: - self.bios = 'OVMF.fd' - else: - uboot = join(args.dir, self.machine, 'u-boot-qemux86-64.rom') - if not exists(uboot): - raise ValueError("U-Boot image %s does not exist" % uboot) - self.bios = uboot - ext = EXTENSIONS.get(self.machine, 'wic') - self.image = join(args.dir, self.machine, '%s-%s.%s' % (args.imagename, self.machine, ext)) - if not exists(self.image): - raise ValueError("OS image %s does not exist" % self.image) - if args.mac: - self.mac_address = args.mac - else: - self.mac_address = random_mac() - self.serial_port = find_local_port(8990) - self.ssh_port = find_local_port(2222) - self.kvm = not args.no_kvm - self.gui = not args.no_gui - self.gdb = args.gdb - - def command_line(self): - netuser = 'user,hostfwd=tcp:0.0.0.0:%d-:22,restrict=off' % self.ssh_port - if self.gdb: - netuser += ',hostfwd=tcp:0.0.0.0:2159-:2159' - cmdline = [ - "qemu-system-x86_64", - "-bios", self.bios, - "-drive", "file=%s,if=ide,format=raw,snapshot=on" % self.image, - "-serial", "tcp:127.0.0.1:%d,server,nowait" % self.serial_port, - "-m", "1G", - "-usb", - "-usbdevice", "tablet", - "-show-cursor", - "-vga", "std", - "-net", netuser, - "-net", "nic,macaddr=%s" % self.mac_address - ] - if self.gui: - cmdline += ["-serial", "stdio"] - else: - cmdline.append('-nographic') - if self.kvm: - cmdline.append('-enable-kvm') - return cmdline - - -def main(): - parser = ArgumentParser(description='Run meta-updater image in qemu') - parser.add_argument('imagename', default='core-image-minimal', nargs='?') - parser.add_argument('mac', default=None, nargs='?') - parser.add_argument('--dir', default=DEFAULT_DIR, - help='Path to build directory containing the image and u-boot-qemux86-64.rom') - parser.add_argument('--efi', - help='Boot using UEFI rather than U-Boot. This requires the image to be built with ' + - 'OSTREE_BOOTLOADER = "grub" and OVMF.fd firmware to be installed (try "apt install ovmf")', - action='store_true') - parser.add_argument('--machine', default=None, help="Target MACHINE") - parser.add_argument('--no-kvm', help='Disable KVM in QEMU', action='store_true') - parser.add_argument('--no-gui', help='Disable GUI', action='store_true') - parser.add_argument('--gdb', help='Export gdbserver port 2159 from the image', action='store_true') - parser.add_argument('-n', '--dry-run', help='Print qemu command line rather then run it', action='store_true') - args = parser.parse_args() - try: - qemu_command = QemuCommand(args) - except ValueError as e: - print(e.message) - sys.exit(1) - - print("Launching %s with mac address %s" % (args.imagename, qemu_command.mac_address)) - print("To connect via SSH:") - print(" ssh -o StrictHostKeyChecking=no root@localhost -p %d" % qemu_command.ssh_port) - print("To connect to the serial console:") - print(" nc localhost %d" % qemu_command.serial_port) - - cmdline = qemu_command.command_line() - if args.dry_run: - print(" ".join(cmdline)) - else: - s = Popen(cmdline) - try: - s.wait() - except KeyboardInterrupt: - pass - - -if __name__ == '__main__': - main() -- cgit v1.2.3-54-g00ecf From 021d32ed4d945c27d2e9af63b4bfdd3114085242 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Tue, 12 Sep 2017 12:14:34 +0200 Subject: Recreate run-qemu as a softlink to the meta-updater version. --- meta-sota-qemux86-64/scripts/run-qemu | 1 + 1 file changed, 1 insertion(+) create mode 120000 meta-sota-qemux86-64/scripts/run-qemu diff --git a/meta-sota-qemux86-64/scripts/run-qemu b/meta-sota-qemux86-64/scripts/run-qemu new file mode 120000 index 0000000..8992a42 --- /dev/null +++ b/meta-sota-qemux86-64/scripts/run-qemu @@ -0,0 +1 @@ +../../meta-updater/scripts/run-qemu-ota \ No newline at end of file -- cgit v1.2.3-54-g00ecf From ea310def29cf99cda445b07676e2b2a48c3e8ad2 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Tue, 14 Nov 2017 12:13:44 +0100 Subject: Add fixes for compatibility with Rocko --- meta-sota-qemux86-64/conf/bblayers.conf.sample | 21 -- meta-sota-qemux86-64/conf/local.conf.sample | 241 --------------------- ...As-RAM-memory-from-area-mapped-to-ROM-in-.patch | 30 +++ ...ps-with-built-in-code-to-remove-dependenc.patch | 142 ++++++++++++ ...Set-up-environment-for-OSTree-integration.patch | 41 ++++ .../u-boot/files/fix-build-error-under-gcc6.patch | 86 ++++++++ ...Set-up-environment-for-OSTree-integration.patch | 41 ---- ...ps-with-built-in-code-to-remove-dependenc.patch | 138 ------------ .../u-boot-ota/fix-build-error-under-gcc6.patch | 86 -------- .../recipes-bsp/u-boot/u-boot-ota_2015.07.bb | 27 --- .../recipes-bsp/u-boot/u-boot_2017.09.bbappend | 15 ++ 11 files changed, 314 insertions(+), 554 deletions(-) delete mode 100644 meta-sota-qemux86-64/conf/bblayers.conf.sample delete mode 100644 meta-sota-qemux86-64/conf/local.conf.sample create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Move-Cache-As-RAM-memory-from-area-mapped-to-ROM-in-.patch create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Replace-wraps-with-built-in-code-to-remove-dependenc.patch create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Set-up-environment-for-OSTree-integration.patch create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend diff --git a/meta-sota-qemux86-64/conf/bblayers.conf.sample b/meta-sota-qemux86-64/conf/bblayers.conf.sample deleted file mode 100644 index 8fa41b9..0000000 --- a/meta-sota-qemux86-64/conf/bblayers.conf.sample +++ /dev/null @@ -1,21 +0,0 @@ -# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf -# changes incompatibly -LCONF_VERSION = "6" - -BBPATH = "${TOPDIR}" -BBFILES ?= "" - -BBLAYERS ?= " \ - ##OEROOT##/meta \ - ##OEROOT##/meta-yocto \ - ##OEROOT##/meta-yocto-bsp \ - ##OEROOT##/../meta-updater \ - ##OEROOT##/../meta-updater-qemux86-64 \ - ##OEROOT##/../meta-openembedded/meta-oe \ - ##OEROOT##/../meta-openembedded/meta-filesystems \ - ##OEROOT##/../meta-rust \ - " -BBLAYERS_NON_REMOVABLE ?= " \ - ##OEROOT##/meta \ - ##OEROOT##/meta-yocto \ - " diff --git a/meta-sota-qemux86-64/conf/local.conf.sample b/meta-sota-qemux86-64/conf/local.conf.sample deleted file mode 100644 index c893530..0000000 --- a/meta-sota-qemux86-64/conf/local.conf.sample +++ /dev/null @@ -1,241 +0,0 @@ -# -# This file is your local configuration file and is where all local user settings -# are placed. The comments in this file give some guide to the options a new user -# to the system might want to change but pretty much any configuration option can -# be set in this file. More adventurous users can look at local.conf.extended -# which contains other examples of configuration which can be placed in this file -# but new users likely won't need any of them initially. -# -# Lines starting with the '#' character are commented out and in some cases the -# default values are provided as comments to show people example syntax. Enabling -# the option is a question of removing the # character and making any change to the -# variable as required. - -# -# Machine Selection -# -# You need to select a specific machine to target the build with. There are a selection -# of emulated machines available which can boot and run in the QEMU emulator: -# -#MACHINE ?= "qemuarm" -#MACHINE ?= "qemumips" -#MACHINE ?= "qemuppc" -#MACHINE ?= "qemux86" -#MACHINE ?= "qemux86-64" -# -# There are also the following hardware board target machines included for -# demonstration purposes: -# -#MACHINE ?= "beaglebone" -#MACHINE ?= "genericx86" -#MACHINE ?= "genericx86-64" -#MACHINE ?= "mpc8315e-rdb" -#MACHINE ?= "edgerouter" -# -# This sets the default machine to be qemux86 if no other machine is selected: -MACHINE ??= "qemux86-64" - -PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ota" -UBOOT_MACHINE = "qemu-x86_defconfig" - -# -# Where to place downloads -# -# During a first build the system will download many different source code tarballs -# from various upstream projects. This can take a while, particularly if your network -# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you -# can preserve this directory to speed up this part of subsequent builds. This directory -# is safe to share between multiple builds on the same machine too. -# -# The default is a downloads directory under TOPDIR which is the build directory. -# -#DL_DIR ?= "${TOPDIR}/downloads" - -# -# Where to place shared-state files -# -# BitBake has the capability to accelerate builds based on previously built output. -# This is done using "shared state" files which can be thought of as cache objects -# and this option determines where those files are placed. -# -# You can wipe out TMPDIR leaving this directory intact and the build would regenerate -# from these files if no changes were made to the configuration. If changes were made -# to the configuration, only shared state files where the state was still valid would -# be used (done using checksums). -# -# The default is a sstate-cache directory under TOPDIR. -# -#SSTATE_DIR ?= "${TOPDIR}/sstate-cache" - -# -# Where to place the build output -# -# This option specifies where the bulk of the building work should be done and -# where BitBake should place its temporary files and output. Keep in mind that -# this includes the extraction and compilation of many applications and the toolchain -# which can use Gigabytes of hard disk space. -# -# The default is a tmp directory under TOPDIR. -# -#TMPDIR = "${TOPDIR}/tmp" - -# -# Default policy config -# -# The distribution setting controls which policy settings are used as defaults. -# The default value is fine for general Yocto project use, at least initially. -# Ultimately when creating custom policy, people will likely end up subclassing -# these defaults. -# -DISTRO ?= "poky-sota-systemd" -# As an example of a subclass there is a "bleeding" edge policy configuration -# where many versions are set to the absolute latest code from the upstream -# source control systems. This is just mentioned here as an example, its not -# useful to most new users. -# DISTRO ?= "poky-bleeding" - -# -# Package Management configuration -# -# This variable lists which packaging formats to enable. Multiple package backends -# can be enabled at once and the first item listed in the variable will be used -# to generate the root filesystems. -# Options are: -# - 'package_deb' for debian style deb files -# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager) -# - 'package_rpm' for rpm style packages -# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk" -# We default to rpm: -PACKAGE_CLASSES ?= "package_rpm" - -# -# SDK/ADT target architecture -# -# This variable specifies the architecture to build SDK/ADT items for and means -# you can build the SDK packages for architectures other than the machine you are -# running the build on (i.e. building i686 packages on an x86_64 host). -# Supported values are i686 and x86_64 -#SDKMACHINE ?= "i686" - -# -# Extra image configuration defaults -# -# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated -# images. Some of these options are added to certain image types automatically. The -# variable can contain the following options: -# "dbg-pkgs" - add -dbg packages for all installed packages -# (adds symbol information for debugging/profiling) -# "dev-pkgs" - add -dev packages for all installed packages -# (useful if you want to develop against libs in the image) -# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages -# (useful if you want to run the package test suites) -# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.) -# "tools-debug" - add debugging tools (gdb, strace) -# "eclipse-debug" - add Eclipse remote debugging support -# "tools-profile" - add profiling tools (oprofile, exmap, lttng, valgrind) -# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.) -# "debug-tweaks" - make an image suitable for development -# e.g. ssh root access has a blank password -# There are other application targets that can be used here too, see -# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details. - -# Poky normally enables debug-tweaks, but since we allow remote SSH access to -# OpenIVI over tor, disable it. empty-root-password but not debug-tweaks allows -# passwordless login locally only. - -EXTRA_IMAGE_FEATURES = "debug-tweaks" - -# -# Additional image features -# -# The following is a list of additional classes to use when building images which -# enable extra features. Some available options which can be included in this variable -# are: -# - 'buildstats' collect build statistics -# - 'image-mklibs' to reduce shared library files size for an image -# - 'image-prelink' in order to prelink the filesystem image -# - 'image-swab' to perform host system intrusion detection -# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink -# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended -USER_CLASSES ?= "buildstats image-mklibs image-prelink" - -# -# Runtime testing of images -# -# The build system can test booting virtual machine images under qemu (an emulator) -# after any root filesystems are created and run tests against those images. To -# enable this uncomment this line. See classes/testimage(-auto).bbclass for -# further details. -#TEST_IMAGE = "1" -# -# Interactive shell configuration -# -# Under certain circumstances the system may need input from you and to do this it -# can launch an interactive shell. It needs to do this since the build is -# multithreaded and needs to be able to handle the case where more than one parallel -# process may require the user's attention. The default is iterate over the available -# terminal types to find one that works. -# -# Examples of the occasions this may happen are when resolving patches which cannot -# be applied, to use the devshell or the kernel menuconfig -# -# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none -# Note: currently, Konsole support only works for KDE 3.x due to the way -# newer Konsole versions behave -#OE_TERMINAL = "auto" -# By default disable interactive patch resolution (tasks will just fail instead): -PATCHRESOLVE = "noop" - -# -# Disk Space Monitoring during the build -# -# Monitor the disk space during the build. If there is less that 1GB of space or less -# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully -# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort -# of the build. The reason for this is that running completely out of space can corrupt -# files and damages the build in ways which may not be easily recoverable. -BB_DISKMON_DIRS = "\ - STOPTASKS,${TMPDIR},1G,100K \ - STOPTASKS,${DL_DIR},1G,100K \ - STOPTASKS,${SSTATE_DIR},1G,100K \ - ABORT,${TMPDIR},100M,1K \ - ABORT,${DL_DIR},100M,1K \ - ABORT,${SSTATE_DIR},100M,1K" - -# -# Shared-state files from other locations -# -# As mentioned above, shared state files are prebuilt cache data objects which can -# used to accelerate build time. This variable can be used to configure the system -# to search other mirror locations for these objects before it builds the data itself. -# -# This can be a filesystem directory, or a remote url such as http or ftp. These -# would contain the sstate-cache results from previous builds (possibly from other -# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the -# cache locations to check for the shared objects. -# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH -# at the end as shown in the examples below. This will be substituted with the -# correct path within the directory structure. -#SSTATE_MIRRORS ?= "\ -#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \ -#file://.* file:///some/local/dir/sstate/PATH" - - -# -# Qemu configuration -# -# By default qemu will build with a builtin VNC server where graphical output can be -# seen. The two lines below enable the SDL backend too. This assumes there is a -# libsdl library available on your build system. -PACKAGECONFIG_append_pn-qemu-native = " sdl" -PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl" - -# https://bugzilla.yoctoproject.org/show_bug.cgi?id=8553 -# ASSUME_PROVIDED += "libsdl-native" - - -# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to -# track the version of this file when it was generated. This can safely be ignored if -# this doesn't mean anything to you. -CONF_VERSION = "1" - diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Move-Cache-As-RAM-memory-from-area-mapped-to-ROM-in-.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Move-Cache-As-RAM-memory-from-area-mapped-to-ROM-in-.patch new file mode 100644 index 0000000..d1e147c --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Move-Cache-As-RAM-memory-from-area-mapped-to-ROM-in-.patch @@ -0,0 +1,30 @@ +From 0aa919fbfb91d7ea433f790b10351654acfb52d9 Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Fri, 10 Nov 2017 18:41:02 +0100 +Subject: [PATCH] Move Cache-As-RAM memory from area mapped to ROM in QEMU + +ROM has been made read-only in qemu recently (namely commit +208fa0e43645edd0b0d8f838857dfc79daff40a8), so this patch restores +compatibility between u-boot and qemu. + +Signed-off-by: Anton Gerasimov +--- + arch/x86/cpu/qemu/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/cpu/qemu/Kconfig b/arch/x86/cpu/qemu/Kconfig +index 6808c9a6b9..f4b9922a34 100644 +--- a/arch/x86/cpu/qemu/Kconfig ++++ b/arch/x86/cpu/qemu/Kconfig +@@ -11,7 +11,7 @@ if QEMU + + config SYS_CAR_ADDR + hex +- default 0xd0000 ++ default 0x10000 + + config SYS_CAR_SIZE + hex +-- +2.14.1 + diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Replace-wraps-with-built-in-code-to-remove-dependenc.patch new file mode 100644 index 0000000..2bfafac --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Replace-wraps-with-built-in-code-to-remove-dependenc.patch @@ -0,0 +1,142 @@ +From ee87fe6e5b2dca342d7fe3efc2be285eb4179571 Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Tue, 31 Oct 2017 21:03:38 +0100 +Subject: [PATCH] Replace wraps with built in code to remove dependency on + multilib + +--- + arch/x86/config.mk | 3 -- + arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++--------- + 2 files changed, 87 insertions(+), 20 deletions(-) + +diff --git a/arch/x86/config.mk b/arch/x86/config.mk +index 8835dcf36f..472ada5490 100644 +--- a/arch/x86/config.mk ++++ b/arch/x86/config.mk +@@ -34,9 +34,6 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden + PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions + PLATFORM_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64) + +-LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 +-LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 +- + # This is used in the top-level Makefile which does not include + # PLATFORM_LDFLAGS + LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined +diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c +index 3c70d790d4..2aae611879 100644 +--- a/arch/x86/lib/gcc.c ++++ b/arch/x86/lib/gcc.c +@@ -8,22 +8,92 @@ + + #ifdef __GNUC__ + +-/* +- * GCC's libgcc handling is quite broken. While the libgcc functions +- * are always regparm(0) the code that calls them uses whatever the +- * compiler call specifies. Therefore we need a wrapper around those +- * functions. See gcc bug PR41055 for more information. +- */ +-#define WRAP_LIBGCC_CALL(type, name) \ +- type __normal_##name(type a, type b) __attribute__((regparm(0))); \ +- type __wrap_##name(type a, type b); \ +- type __attribute__((no_instrument_function)) \ +- __wrap_##name(type a, type b) \ +- { return __normal_##name(a, b); } +- +-WRAP_LIBGCC_CALL(long long, __divdi3) +-WRAP_LIBGCC_CALL(unsigned long long, __udivdi3) +-WRAP_LIBGCC_CALL(long long, __moddi3) +-WRAP_LIBGCC_CALL(unsigned long long, __umoddi3) ++#include ++#include ++ ++uint64_t __udivmoddi4 ( uint64_t num, ++ uint64_t den, ++ uint64_t *rem_p ) ++{ ++ uint64_t quot = 0, qbit = 1; ++ ++ if ( den == 0 ) { ++ return 1/((unsigned)den); /* Intentional divide by zero, without ++ triggering a compiler warning which ++ would abort the build */ ++ } ++ ++ /* Left-justify denominator and count shift */ ++ while ( (int64_t)den >= 0 ) { ++ den <<= 1; ++ qbit <<= 1; ++ } ++ ++ while ( qbit ) { ++ if ( den <= num ) { ++ num -= den; ++ quot += qbit; ++ } ++ den >>= 1; ++ qbit >>= 1; ++ } ++ ++ if ( rem_p ) ++ *rem_p = num; ++ ++ return quot; ++} ++uint64_t __udivdi3( uint64_t num, uint64_t den ) ++{ ++ return __udivmoddi4(num, den, NULL); ++} ++ ++uint64_t __umoddi3 ( uint64_t num, uint64_t den ) ++{ ++ uint64_t v; ++ ++ (void) __udivmoddi4(num, den, &v); ++ return v; ++} ++ ++int64_t __divmoddi4 ( int64_t num, ++ int64_t den, ++ int64_t* rem_p ) ++{ ++ int minus = 0; ++ int64_t v; ++ ++ if ( num < 0 ) { ++ num = -num; ++ minus = 1; ++ } ++ if ( den < 0 ) { ++ den = -den; ++ minus ^= 1; ++ } ++ ++ v = __udivmoddi4(num, den, (uint64_t *)rem_p); ++ if ( minus ) { ++ v = -v; ++ if ( rem_p ) ++ *rem_p = -(*rem_p); ++ } ++ ++ return v; ++} ++ ++ ++int64_t __moddi3 (int64_t num, int64_t den) ++{ ++ int64_t v; ++ ++ (void) __divmoddi4(num, den, &v); ++ return v; ++} ++ ++int64_t __divdi3(int64_t num, int64_t den) ++{ ++ return __divmoddi4(num, den, NULL); ++} + + #endif +-- +2.14.2 + diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Set-up-environment-for-OSTree-integration.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Set-up-environment-for-OSTree-integration.patch new file mode 100644 index 0000000..5172fdd --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Set-up-environment-for-OSTree-integration.patch @@ -0,0 +1,41 @@ +From ebb26338d0c2f436a86fd4d7cb8d723a90d6a369 Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Thu, 15 Sep 2016 17:52:41 +0200 +Subject: [PATCH 1/2] Set up environment for OSTree integration + +--- + include/configs/qemu-x86.h | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h +index 78c296f..79df455 100644 +--- a/include/configs/qemu-x86.h ++++ b/include/configs/qemu-x86.h +@@ -74,4 +74,24 @@ + #undef CONFIG_ENV_IS_IN_SPI_FLASH + #define CONFIG_ENV_IS_NOWHERE + ++#undef CONFIG_BOOTARGS ++#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run loadenv;" \ ++ "setenv bootargs $bootargs\" console=ttyS0 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda ramdisk_size=16384 \";" \ ++ "ext2load ide 0 $loadaddr \"/boot\"$kernel_image;" \ ++ "ext2load ide 0 $ramdiskaddr \"/boot\"$ramdisk_image;" \ ++ "zboot $loadaddr - $ramdiskaddr $filesize" ++ ++#undef CONFIG_EXTRA_ENV_SETTINGS ++#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \ ++ "ramdisk_image=/initrd\0" \ ++ "ramdiskaddr=0x4000000\0" \ ++ "bootdelay=3\0" \ ++ "loadenv=if ext2load ide 0 $loadaddr /boot/loader/uEnv.txt; then env import -t $loadaddr $filesize; fi;" ++ + #endif /* __CONFIG_H */ +-- +2.9.3 + diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch new file mode 100644 index 0000000..839cd7d --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch @@ -0,0 +1,86 @@ +fix build error under gcc6 + +Fix the following error: +| ../include/linux/compiler-gcc.h:114:30: fatal error: linux/compiler-gcc6.h: No such file or directory +| #include gcc_header(__GNUC__) + +Signed-off-by: Zhenhua Luo + +Upstream-Status: Pending +--- + include/linux/compiler-gcc6.h | 65 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 65 insertions(+) + create mode 100644 include/linux/compiler-gcc6.h + +diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h +new file mode 100644 +index 0000000..c8c5659 +--- /dev/null ++++ b/include/linux/compiler-gcc6.h +@@ -0,0 +1,65 @@ ++#ifndef __LINUX_COMPILER_H ++#error "Please don't include directly, include instead." ++#endif ++ ++#define __used __attribute__((__used__)) ++#define __must_check __attribute__((warn_unused_result)) ++#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) ++ ++/* Mark functions as cold. gcc will assume any path leading to a call ++ to them will be unlikely. This means a lot of manual unlikely()s ++ are unnecessary now for any paths leading to the usual suspects ++ like BUG(), printk(), panic() etc. [but let's keep them for now for ++ older compilers] ++ ++ Early snapshots of gcc 4.3 don't support this and we can't detect this ++ in the preprocessor, but we can live with this because they're unreleased. ++ Maketime probing would be overkill here. ++ ++ gcc also has a __attribute__((__hot__)) to move hot functions into ++ a special section, but I don't see any sense in this right now in ++ the kernel context */ ++#define __cold __attribute__((__cold__)) ++ ++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ++ ++#ifndef __CHECKER__ ++# define __compiletime_warning(message) __attribute__((warning(message))) ++# define __compiletime_error(message) __attribute__((error(message))) ++#endif /* __CHECKER__ */ ++ ++/* ++ * Mark a position in code as unreachable. This can be used to ++ * suppress control flow warnings after asm blocks that transfer ++ * control elsewhere. ++ * ++ * Early snapshots of gcc 4.5 don't support this and we can't detect ++ * this in the preprocessor, but we can live with this because they're ++ * unreleased. Really, we need to have autoconf for the kernel. ++ */ ++#define unreachable() __builtin_unreachable() ++ ++/* Mark a function definition as prohibited from being cloned. */ ++#define __noclone __attribute__((__noclone__)) ++ ++/* ++ * Tell the optimizer that something else uses this function or variable. ++ */ ++#define __visible __attribute__((externally_visible)) ++ ++/* ++ * GCC 'asm goto' miscompiles certain code sequences: ++ * ++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 ++ * ++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. ++ * ++ * (asm goto is automatically volatile - the naming reflects this.) ++ */ ++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) ++ ++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP ++#define __HAVE_BUILTIN_BSWAP32__ ++#define __HAVE_BUILTIN_BSWAP64__ ++#define __HAVE_BUILTIN_BSWAP16__ ++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ +-- diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch deleted file mode 100644 index 5172fdd..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch +++ /dev/null @@ -1,41 +0,0 @@ -From ebb26338d0c2f436a86fd4d7cb8d723a90d6a369 Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov -Date: Thu, 15 Sep 2016 17:52:41 +0200 -Subject: [PATCH 1/2] Set up environment for OSTree integration - ---- - include/configs/qemu-x86.h | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h -index 78c296f..79df455 100644 ---- a/include/configs/qemu-x86.h -+++ b/include/configs/qemu-x86.h -@@ -74,4 +74,24 @@ - #undef CONFIG_ENV_IS_IN_SPI_FLASH - #define CONFIG_ENV_IS_NOWHERE - -+#undef CONFIG_BOOTARGS -+#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0" -+ -+#undef CONFIG_BOOTDELAY -+#define CONFIG_BOOTDELAY 3 -+ -+#undef CONFIG_BOOTCOMMAND -+#define CONFIG_BOOTCOMMAND "run loadenv;" \ -+ "setenv bootargs $bootargs\" console=ttyS0 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda ramdisk_size=16384 \";" \ -+ "ext2load ide 0 $loadaddr \"/boot\"$kernel_image;" \ -+ "ext2load ide 0 $ramdiskaddr \"/boot\"$ramdisk_image;" \ -+ "zboot $loadaddr - $ramdiskaddr $filesize" -+ -+#undef CONFIG_EXTRA_ENV_SETTINGS -+#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \ -+ "ramdisk_image=/initrd\0" \ -+ "ramdiskaddr=0x4000000\0" \ -+ "bootdelay=3\0" \ -+ "loadenv=if ext2load ide 0 $loadaddr /boot/loader/uEnv.txt; then env import -t $loadaddr $filesize; fi;" -+ - #endif /* __CONFIG_H */ --- -2.9.3 - diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch deleted file mode 100644 index 7540b74..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch +++ /dev/null @@ -1,138 +0,0 @@ -From ab0d7e270d89f6eb99582197d2d58bf60c9c3d26 Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov -Date: Thu, 15 Sep 2016 16:49:32 +0200 -Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on - multilib - ---- - arch/x86/config.mk | 2 -- - arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++--------- - 2 files changed, 87 insertions(+), 19 deletions(-) - -diff --git a/arch/x86/config.mk b/arch/x86/config.mk -index 999143e..139576e 100644 ---- a/arch/x86/config.mk -+++ b/arch/x86/config.mk -@@ -22,5 +22,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden - PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386 - - LDFLAGS_FINAL += --gc-sections -pie --LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 --LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 -diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c -index 497ad75..c321b11 100644 ---- a/arch/x86/lib/gcc.c -+++ b/arch/x86/lib/gcc.c -@@ -19,22 +19,92 @@ - - #ifdef __GNUC__ - --/* -- * GCC's libgcc handling is quite broken. While the libgcc functions -- * are always regparm(0) the code that calls them uses whatever the -- * compiler call specifies. Therefore we need a wrapper around those -- * functions. See gcc bug PR41055 for more information. -- */ --#define WRAP_LIBGCC_CALL(type, name) \ -- type __normal_##name(type a, type b) __attribute__((regparm(0))); \ -- type __wrap_##name(type a, type b); \ -- type __attribute__((no_instrument_function)) \ -- __wrap_##name(type a, type b) \ -- { return __normal_##name(a, b); } -- --WRAP_LIBGCC_CALL(long long, __divdi3) --WRAP_LIBGCC_CALL(unsigned long long, __udivdi3) --WRAP_LIBGCC_CALL(long long, __moddi3) --WRAP_LIBGCC_CALL(unsigned long long, __umoddi3) -+#include -+#include -+ -+uint64_t __udivmoddi4 ( uint64_t num, -+ uint64_t den, -+ uint64_t *rem_p ) -+{ -+ uint64_t quot = 0, qbit = 1; -+ -+ if ( den == 0 ) { -+ return 1/((unsigned)den); /* Intentional divide by zero, without -+ triggering a compiler warning which -+ would abort the build */ -+ } -+ -+ /* Left-justify denominator and count shift */ -+ while ( (int64_t)den >= 0 ) { -+ den <<= 1; -+ qbit <<= 1; -+ } -+ -+ while ( qbit ) { -+ if ( den <= num ) { -+ num -= den; -+ quot += qbit; -+ } -+ den >>= 1; -+ qbit >>= 1; -+ } -+ -+ if ( rem_p ) -+ *rem_p = num; -+ -+ return quot; -+} -+uint64_t __udivdi3( uint64_t num, uint64_t den ) -+{ -+ return __udivmoddi4(num, den, NULL); -+} -+ -+uint64_t __umoddi3 ( uint64_t num, uint64_t den ) -+{ -+ uint64_t v; -+ -+ (void) __udivmoddi4(num, den, &v); -+ return v; -+} -+ -+int64_t __divmoddi4 ( int64_t num, -+ int64_t den, -+ int64_t* rem_p ) -+{ -+ int minus = 0; -+ int64_t v; -+ -+ if ( num < 0 ) { -+ num = -num; -+ minus = 1; -+ } -+ if ( den < 0 ) { -+ den = -den; -+ minus ^= 1; -+ } -+ -+ v = __udivmoddi4(num, den, (uint64_t *)rem_p); -+ if ( minus ) { -+ v = -v; -+ if ( rem_p ) -+ *rem_p = -(*rem_p); -+ } -+ -+ return v; -+} -+ -+ -+int64_t __moddi3 (int64_t num, int64_t den) -+{ -+ int64_t v; -+ -+ (void) __divmoddi4(num, den, &v); -+ return v; -+} -+ -+int64_t __divdi3(int64_t num, int64_t den) -+{ -+ return __divmoddi4(num, den, NULL); -+} - - #endif --- -2.9.3 - diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch deleted file mode 100644 index 839cd7d..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch +++ /dev/null @@ -1,86 +0,0 @@ -fix build error under gcc6 - -Fix the following error: -| ../include/linux/compiler-gcc.h:114:30: fatal error: linux/compiler-gcc6.h: No such file or directory -| #include gcc_header(__GNUC__) - -Signed-off-by: Zhenhua Luo - -Upstream-Status: Pending ---- - include/linux/compiler-gcc6.h | 65 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 65 insertions(+) - create mode 100644 include/linux/compiler-gcc6.h - -diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h -new file mode 100644 -index 0000000..c8c5659 ---- /dev/null -+++ b/include/linux/compiler-gcc6.h -@@ -0,0 +1,65 @@ -+#ifndef __LINUX_COMPILER_H -+#error "Please don't include directly, include instead." -+#endif -+ -+#define __used __attribute__((__used__)) -+#define __must_check __attribute__((warn_unused_result)) -+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) -+ -+/* Mark functions as cold. gcc will assume any path leading to a call -+ to them will be unlikely. This means a lot of manual unlikely()s -+ are unnecessary now for any paths leading to the usual suspects -+ like BUG(), printk(), panic() etc. [but let's keep them for now for -+ older compilers] -+ -+ Early snapshots of gcc 4.3 don't support this and we can't detect this -+ in the preprocessor, but we can live with this because they're unreleased. -+ Maketime probing would be overkill here. -+ -+ gcc also has a __attribute__((__hot__)) to move hot functions into -+ a special section, but I don't see any sense in this right now in -+ the kernel context */ -+#define __cold __attribute__((__cold__)) -+ -+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) -+ -+#ifndef __CHECKER__ -+# define __compiletime_warning(message) __attribute__((warning(message))) -+# define __compiletime_error(message) __attribute__((error(message))) -+#endif /* __CHECKER__ */ -+ -+/* -+ * Mark a position in code as unreachable. This can be used to -+ * suppress control flow warnings after asm blocks that transfer -+ * control elsewhere. -+ * -+ * Early snapshots of gcc 4.5 don't support this and we can't detect -+ * this in the preprocessor, but we can live with this because they're -+ * unreleased. Really, we need to have autoconf for the kernel. -+ */ -+#define unreachable() __builtin_unreachable() -+ -+/* Mark a function definition as prohibited from being cloned. */ -+#define __noclone __attribute__((__noclone__)) -+ -+/* -+ * Tell the optimizer that something else uses this function or variable. -+ */ -+#define __visible __attribute__((externally_visible)) -+ -+/* -+ * GCC 'asm goto' miscompiles certain code sequences: -+ * -+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 -+ * -+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. -+ * -+ * (asm goto is automatically volatile - the naming reflects this.) -+ */ -+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) -+ -+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP -+#define __HAVE_BUILTIN_BSWAP32__ -+#define __HAVE_BUILTIN_BSWAP64__ -+#define __HAVE_BUILTIN_BSWAP16__ -+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ --- diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb deleted file mode 100644 index 6009685..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb +++ /dev/null @@ -1,27 +0,0 @@ -include recipes-bsp/u-boot/u-boot.inc -DEPENDS += "dtc-native" - -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95" - -# This revision corresponds to the tag "v2015.07" -# We use the revision in order to avoid having to fetch it from the -# repo during parse -SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204" - -SRC_URI=" \ - git://git.denx.de/u-boot.git;branch=master \ - file://0001-Set-up-environment-for-OSTree-integration.patch \ - file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ - file://fix-build-error-under-gcc6.patch \ - " - -PV = "v2015.07+git${SRCPV}" - -S = "${WORKDIR}/git" - -EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" - -UBOOT_SUFFIX = "bin" -UBOOT_SUFFIX_qemux86 = "rom" -UBOOT_SUFFIX_qemux86-64 = "rom" diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend new file mode 100644 index 0000000..7a6c9a6 --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend @@ -0,0 +1,15 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +DEPENDS += "swig-native" + +SRC_URI +=" \ + file://0001-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ + file://0001-Set-up-environment-for-OSTree-integration.patch \ + file://0001-Move-Cache-As-RAM-memory-from-area-mapped-to-ROM-in-.patch \ + " + + +do_compile_prepend() { + export BUILD_ROM=y +} +UBOOT_SUFFIX = "rom" -- cgit v1.2.3-54-g00ecf From 351e5e79d30c076f57d983d5d54304659a7570bd Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Fri, 22 Dec 2017 00:17:46 +0200 Subject: u-boot-ota_2015.07.bb: Use u-boot-ota from Pyro Use version 2015.07 of u-boot-ota from branch Pyro and apply a patch for fixing the follow error: fatal error: linux/compiler-gcc7.h: No such file or directory Signed-off-by: Leon Anavi --- ...Set-up-environment-for-OSTree-integration.patch | 41 ++++++ ...ps-with-built-in-code-to-remove-dependenc.patch | 138 +++++++++++++++++++++ .../u-boot-ota/fix-build-error-under-gcc6.patch | 86 +++++++++++++ .../u-boot/u-boot-ota/fix-build-for-gcc7.patch | 101 +++++++++++++++ .../recipes-bsp/u-boot/u-boot-ota_2015.07.bb | 28 +++++ 5 files changed, 394 insertions(+) create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-for-gcc7.patch create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch new file mode 100644 index 0000000..5172fdd --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch @@ -0,0 +1,41 @@ +From ebb26338d0c2f436a86fd4d7cb8d723a90d6a369 Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Thu, 15 Sep 2016 17:52:41 +0200 +Subject: [PATCH 1/2] Set up environment for OSTree integration + +--- + include/configs/qemu-x86.h | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h +index 78c296f..79df455 100644 +--- a/include/configs/qemu-x86.h ++++ b/include/configs/qemu-x86.h +@@ -74,4 +74,24 @@ + #undef CONFIG_ENV_IS_IN_SPI_FLASH + #define CONFIG_ENV_IS_NOWHERE + ++#undef CONFIG_BOOTARGS ++#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run loadenv;" \ ++ "setenv bootargs $bootargs\" console=ttyS0 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda ramdisk_size=16384 \";" \ ++ "ext2load ide 0 $loadaddr \"/boot\"$kernel_image;" \ ++ "ext2load ide 0 $ramdiskaddr \"/boot\"$ramdisk_image;" \ ++ "zboot $loadaddr - $ramdiskaddr $filesize" ++ ++#undef CONFIG_EXTRA_ENV_SETTINGS ++#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \ ++ "ramdisk_image=/initrd\0" \ ++ "ramdiskaddr=0x4000000\0" \ ++ "bootdelay=3\0" \ ++ "loadenv=if ext2load ide 0 $loadaddr /boot/loader/uEnv.txt; then env import -t $loadaddr $filesize; fi;" ++ + #endif /* __CONFIG_H */ +-- +2.9.3 + diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch new file mode 100644 index 0000000..7540b74 --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch @@ -0,0 +1,138 @@ +From ab0d7e270d89f6eb99582197d2d58bf60c9c3d26 Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Thu, 15 Sep 2016 16:49:32 +0200 +Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on + multilib + +--- + arch/x86/config.mk | 2 -- + arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++--------- + 2 files changed, 87 insertions(+), 19 deletions(-) + +diff --git a/arch/x86/config.mk b/arch/x86/config.mk +index 999143e..139576e 100644 +--- a/arch/x86/config.mk ++++ b/arch/x86/config.mk +@@ -22,5 +22,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden + PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386 + + LDFLAGS_FINAL += --gc-sections -pie +-LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 +-LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 +diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c +index 497ad75..c321b11 100644 +--- a/arch/x86/lib/gcc.c ++++ b/arch/x86/lib/gcc.c +@@ -19,22 +19,92 @@ + + #ifdef __GNUC__ + +-/* +- * GCC's libgcc handling is quite broken. While the libgcc functions +- * are always regparm(0) the code that calls them uses whatever the +- * compiler call specifies. Therefore we need a wrapper around those +- * functions. See gcc bug PR41055 for more information. +- */ +-#define WRAP_LIBGCC_CALL(type, name) \ +- type __normal_##name(type a, type b) __attribute__((regparm(0))); \ +- type __wrap_##name(type a, type b); \ +- type __attribute__((no_instrument_function)) \ +- __wrap_##name(type a, type b) \ +- { return __normal_##name(a, b); } +- +-WRAP_LIBGCC_CALL(long long, __divdi3) +-WRAP_LIBGCC_CALL(unsigned long long, __udivdi3) +-WRAP_LIBGCC_CALL(long long, __moddi3) +-WRAP_LIBGCC_CALL(unsigned long long, __umoddi3) ++#include ++#include ++ ++uint64_t __udivmoddi4 ( uint64_t num, ++ uint64_t den, ++ uint64_t *rem_p ) ++{ ++ uint64_t quot = 0, qbit = 1; ++ ++ if ( den == 0 ) { ++ return 1/((unsigned)den); /* Intentional divide by zero, without ++ triggering a compiler warning which ++ would abort the build */ ++ } ++ ++ /* Left-justify denominator and count shift */ ++ while ( (int64_t)den >= 0 ) { ++ den <<= 1; ++ qbit <<= 1; ++ } ++ ++ while ( qbit ) { ++ if ( den <= num ) { ++ num -= den; ++ quot += qbit; ++ } ++ den >>= 1; ++ qbit >>= 1; ++ } ++ ++ if ( rem_p ) ++ *rem_p = num; ++ ++ return quot; ++} ++uint64_t __udivdi3( uint64_t num, uint64_t den ) ++{ ++ return __udivmoddi4(num, den, NULL); ++} ++ ++uint64_t __umoddi3 ( uint64_t num, uint64_t den ) ++{ ++ uint64_t v; ++ ++ (void) __udivmoddi4(num, den, &v); ++ return v; ++} ++ ++int64_t __divmoddi4 ( int64_t num, ++ int64_t den, ++ int64_t* rem_p ) ++{ ++ int minus = 0; ++ int64_t v; ++ ++ if ( num < 0 ) { ++ num = -num; ++ minus = 1; ++ } ++ if ( den < 0 ) { ++ den = -den; ++ minus ^= 1; ++ } ++ ++ v = __udivmoddi4(num, den, (uint64_t *)rem_p); ++ if ( minus ) { ++ v = -v; ++ if ( rem_p ) ++ *rem_p = -(*rem_p); ++ } ++ ++ return v; ++} ++ ++ ++int64_t __moddi3 (int64_t num, int64_t den) ++{ ++ int64_t v; ++ ++ (void) __divmoddi4(num, den, &v); ++ return v; ++} ++ ++int64_t __divdi3(int64_t num, int64_t den) ++{ ++ return __divmoddi4(num, den, NULL); ++} + + #endif +-- +2.9.3 + diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch new file mode 100644 index 0000000..839cd7d --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch @@ -0,0 +1,86 @@ +fix build error under gcc6 + +Fix the following error: +| ../include/linux/compiler-gcc.h:114:30: fatal error: linux/compiler-gcc6.h: No such file or directory +| #include gcc_header(__GNUC__) + +Signed-off-by: Zhenhua Luo + +Upstream-Status: Pending +--- + include/linux/compiler-gcc6.h | 65 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 65 insertions(+) + create mode 100644 include/linux/compiler-gcc6.h + +diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h +new file mode 100644 +index 0000000..c8c5659 +--- /dev/null ++++ b/include/linux/compiler-gcc6.h +@@ -0,0 +1,65 @@ ++#ifndef __LINUX_COMPILER_H ++#error "Please don't include directly, include instead." ++#endif ++ ++#define __used __attribute__((__used__)) ++#define __must_check __attribute__((warn_unused_result)) ++#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) ++ ++/* Mark functions as cold. gcc will assume any path leading to a call ++ to them will be unlikely. This means a lot of manual unlikely()s ++ are unnecessary now for any paths leading to the usual suspects ++ like BUG(), printk(), panic() etc. [but let's keep them for now for ++ older compilers] ++ ++ Early snapshots of gcc 4.3 don't support this and we can't detect this ++ in the preprocessor, but we can live with this because they're unreleased. ++ Maketime probing would be overkill here. ++ ++ gcc also has a __attribute__((__hot__)) to move hot functions into ++ a special section, but I don't see any sense in this right now in ++ the kernel context */ ++#define __cold __attribute__((__cold__)) ++ ++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ++ ++#ifndef __CHECKER__ ++# define __compiletime_warning(message) __attribute__((warning(message))) ++# define __compiletime_error(message) __attribute__((error(message))) ++#endif /* __CHECKER__ */ ++ ++/* ++ * Mark a position in code as unreachable. This can be used to ++ * suppress control flow warnings after asm blocks that transfer ++ * control elsewhere. ++ * ++ * Early snapshots of gcc 4.5 don't support this and we can't detect ++ * this in the preprocessor, but we can live with this because they're ++ * unreleased. Really, we need to have autoconf for the kernel. ++ */ ++#define unreachable() __builtin_unreachable() ++ ++/* Mark a function definition as prohibited from being cloned. */ ++#define __noclone __attribute__((__noclone__)) ++ ++/* ++ * Tell the optimizer that something else uses this function or variable. ++ */ ++#define __visible __attribute__((externally_visible)) ++ ++/* ++ * GCC 'asm goto' miscompiles certain code sequences: ++ * ++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 ++ * ++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. ++ * ++ * (asm goto is automatically volatile - the naming reflects this.) ++ */ ++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) ++ ++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP ++#define __HAVE_BUILTIN_BSWAP32__ ++#define __HAVE_BUILTIN_BSWAP64__ ++#define __HAVE_BUILTIN_BSWAP16__ ++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ +-- diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-for-gcc7.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-for-gcc7.patch new file mode 100644 index 0000000..fc7933e --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-for-gcc7.patch @@ -0,0 +1,101 @@ +From eea58226f0b604d3047c495985197113838d3a7a Mon Sep 17 00:00:00 2001 +From: Trevor Woerner +Date: Tue, 20 Jun 2017 13:25:20 -0400 +Subject: [PATCH] fix build for gcc7 + +| In file included from .../include/linux/compiler.h:54:0, +| from .../include/uapi/linux/stddef.h:1, +| from .../include/linux/stddef.h:4, +| from .../include/uapi/linux/posix_types.h:4, +| from .../include/uapi/linux/types.h:13, +| from .../include/linux/types.h:5, +| from .../include/linux/mod_devicetable.h:11, +| from .../scripts/mod/devicetable-offsets.c:2: +| .../include/linux/compiler-gcc.h:121:1: fatal error: linux/compiler-gcc7.h: No such file or directory +| #include gcc_header(__GNUC__) + +Upstream-Status: Pending + +Signed-off-by: Trevor Woerner +Signed-off-by: Fabio Berton +Signed-off-by: Leon Anavi +--- + include/linux/compiler-gcc7.h | 66 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 66 insertions(+) + create mode 100644 include/linux/compiler-gcc7.h + +diff --git a/include/linux/compiler-gcc7.h b/include/linux/compiler-gcc7.h +new file mode 100644 +index 0000000..cdd1cc2 +--- /dev/null ++++ b/include/linux/compiler-gcc7.h +@@ -0,0 +1,66 @@ ++#ifndef __LINUX_COMPILER_H ++#error "Please don't include directly, include instead." ++#endif ++ ++#define __used __attribute__((__used__)) ++#define __must_check __attribute__((warn_unused_result)) ++#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) ++ ++/* Mark functions as cold. gcc will assume any path leading to a call ++ to them will be unlikely. This means a lot of manual unlikely()s ++ are unnecessary now for any paths leading to the usual suspects ++ like BUG(), printk(), panic() etc. [but let's keep them for now for ++ older compilers] ++ ++ Early snapshots of gcc 4.3 don't support this and we can't detect this ++ in the preprocessor, but we can live with this because they're unreleased. ++ Maketime probing would be overkill here. ++ ++ gcc also has a __attribute__((__hot__)) to move hot functions into ++ a special section, but I don't see any sense in this right now in ++ the kernel context */ ++#define __cold __attribute__((__cold__)) ++ ++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ++ ++#ifndef __CHECKER__ ++# define __compiletime_warning(message) __attribute__((warning(message))) ++# define __compiletime_error(message) __attribute__((error(message))) ++#endif /* __CHECKER__ */ ++ ++/* ++ * Mark a position in code as unreachable. This can be used to ++ * suppress control flow warnings after asm blocks that transfer ++ * control elsewhere. ++ * ++ * Early snapshots of gcc 4.5 don't support this and we can't detect ++ * this in the preprocessor, but we can live with this because they're ++ * unreleased. Really, we need to have autoconf for the kernel. ++ */ ++#define unreachable() __builtin_unreachable() ++ ++/* Mark a function definition as prohibited from being cloned. */ ++#define __noclone __attribute__((__noclone__)) ++ ++/* ++ * Tell the optimizer that something else uses this function or variable. ++ */ ++#define __visible __attribute__((externally_visible)) ++ ++/* ++ * GCC 'asm goto' miscompiles certain code sequences: ++ * ++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 ++ * ++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. ++ * Fixed in GCC 4.8.2 and later versions. ++ * ++ * (asm goto is automatically volatile - the naming reflects this.) ++ */ ++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) ++ ++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP ++#define __HAVE_BUILTIN_BSWAP32__ ++#define __HAVE_BUILTIN_BSWAP64__ ++#define __HAVE_BUILTIN_BSWAP16__ ++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ +-- +2.7.4 + diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb new file mode 100644 index 0000000..47b2a54 --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb @@ -0,0 +1,28 @@ +include recipes-bsp/u-boot/u-boot.inc +DEPENDS += "dtc-native" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95" + +# This revision corresponds to the tag "v2015.07" +# We use the revision in order to avoid having to fetch it from the +# repo during parse +SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204" + +SRC_URI=" \ + git://git.denx.de/u-boot.git;branch=master \ + file://0001-Set-up-environment-for-OSTree-integration.patch \ + file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ + file://fix-build-error-under-gcc6.patch \ + file://fix-build-for-gcc7.patch \ + " + +PV = "v2015.07+git${SRCPV}" + +S = "${WORKDIR}/git" + +EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" + +UBOOT_SUFFIX = "bin" +UBOOT_SUFFIX_qemux86 = "rom" +UBOOT_SUFFIX_qemux86-64 = "rom" -- cgit v1.2.3-54-g00ecf From 88996900ffd2604778a7dca49b4099ef87fb18c8 Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Fri, 5 Jan 2018 16:49:38 +0200 Subject: bblayers.conf.sample: Add meta-python Add Yocto/OE layer meta-updater to bblayers as it required for building recipe rpi-gpio for Yocto/OE layer meta-raspberrypi. Signed-off-by: Leon Anavi --- meta-sota-raspberrypi/conf/bblayers.conf.sample | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-sota-raspberrypi/conf/bblayers.conf.sample b/meta-sota-raspberrypi/conf/bblayers.conf.sample index 85cc004..680e188 100644 --- a/meta-sota-raspberrypi/conf/bblayers.conf.sample +++ b/meta-sota-raspberrypi/conf/bblayers.conf.sample @@ -14,6 +14,7 @@ BBLAYERS ?= " \ ##OEROOT##/../meta-updater-raspberrypi \ ##OEROOT##/../meta-openembedded/meta-oe \ ##OEROOT##/../meta-openembedded/meta-filesystems \ + ##OEROOT##/../meta-openembedded/meta-python \ ##OEROOT##/../meta-rust \ " BBLAYERS_NON_REMOVABLE ?= " \ -- cgit v1.2.3-54-g00ecf From 18c67dcead8bb7eb0cfa9bb63196bb3159b8607a Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Tue, 16 Jan 2018 18:47:15 +0100 Subject: Deploy EFI startup.nsh for Minnowboard Max --- .../recipes-bsp/bootfiles/minnowboard-efi-startup.bb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-efi-startup.bb diff --git a/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-efi-startup.bb b/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-efi-startup.bb new file mode 100644 index 0000000..0ad740b --- /dev/null +++ b/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-efi-startup.bb @@ -0,0 +1,11 @@ +DESCRIPTION = "startup.nsh for minnowboard using grub" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +COMPATIBLE_MACHINE = "intel-corei7-64" +ALLOW_EMPTY_${PN} = "1" + +do_install() { + echo "fs0:\EFI\BOOT\bootx64.efi" > ${DEPLOY_DIR_IMAGE}/startup.nsh +} + -- cgit v1.2.3-54-g00ecf From 1072f3985c822c32fb0af8f00a17a8383b8c79d3 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Thu, 18 Jan 2018 11:00:59 +0100 Subject: Revert "u-boot-ota_2015.07.bb: Use u-boot-ota from Pyro" This reverts commit d535ae698ef2643d4b6ecb72a85376b1966ab723. --- ...Set-up-environment-for-OSTree-integration.patch | 41 ------ ...ps-with-built-in-code-to-remove-dependenc.patch | 138 --------------------- .../u-boot-ota/fix-build-error-under-gcc6.patch | 86 ------------- .../u-boot/u-boot-ota/fix-build-for-gcc7.patch | 101 --------------- .../recipes-bsp/u-boot/u-boot-ota_2015.07.bb | 28 ----- 5 files changed, 394 deletions(-) delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-for-gcc7.patch delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch deleted file mode 100644 index 5172fdd..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch +++ /dev/null @@ -1,41 +0,0 @@ -From ebb26338d0c2f436a86fd4d7cb8d723a90d6a369 Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov -Date: Thu, 15 Sep 2016 17:52:41 +0200 -Subject: [PATCH 1/2] Set up environment for OSTree integration - ---- - include/configs/qemu-x86.h | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h -index 78c296f..79df455 100644 ---- a/include/configs/qemu-x86.h -+++ b/include/configs/qemu-x86.h -@@ -74,4 +74,24 @@ - #undef CONFIG_ENV_IS_IN_SPI_FLASH - #define CONFIG_ENV_IS_NOWHERE - -+#undef CONFIG_BOOTARGS -+#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0" -+ -+#undef CONFIG_BOOTDELAY -+#define CONFIG_BOOTDELAY 3 -+ -+#undef CONFIG_BOOTCOMMAND -+#define CONFIG_BOOTCOMMAND "run loadenv;" \ -+ "setenv bootargs $bootargs\" console=ttyS0 root=/dev/ram0 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda ramdisk_size=16384 \";" \ -+ "ext2load ide 0 $loadaddr \"/boot\"$kernel_image;" \ -+ "ext2load ide 0 $ramdiskaddr \"/boot\"$ramdisk_image;" \ -+ "zboot $loadaddr - $ramdiskaddr $filesize" -+ -+#undef CONFIG_EXTRA_ENV_SETTINGS -+#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \ -+ "ramdisk_image=/initrd\0" \ -+ "ramdiskaddr=0x4000000\0" \ -+ "bootdelay=3\0" \ -+ "loadenv=if ext2load ide 0 $loadaddr /boot/loader/uEnv.txt; then env import -t $loadaddr $filesize; fi;" -+ - #endif /* __CONFIG_H */ --- -2.9.3 - diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch deleted file mode 100644 index 7540b74..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch +++ /dev/null @@ -1,138 +0,0 @@ -From ab0d7e270d89f6eb99582197d2d58bf60c9c3d26 Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov -Date: Thu, 15 Sep 2016 16:49:32 +0200 -Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on - multilib - ---- - arch/x86/config.mk | 2 -- - arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++--------- - 2 files changed, 87 insertions(+), 19 deletions(-) - -diff --git a/arch/x86/config.mk b/arch/x86/config.mk -index 999143e..139576e 100644 ---- a/arch/x86/config.mk -+++ b/arch/x86/config.mk -@@ -22,5 +22,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden - PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386 - - LDFLAGS_FINAL += --gc-sections -pie --LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 --LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 -diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c -index 497ad75..c321b11 100644 ---- a/arch/x86/lib/gcc.c -+++ b/arch/x86/lib/gcc.c -@@ -19,22 +19,92 @@ - - #ifdef __GNUC__ - --/* -- * GCC's libgcc handling is quite broken. While the libgcc functions -- * are always regparm(0) the code that calls them uses whatever the -- * compiler call specifies. Therefore we need a wrapper around those -- * functions. See gcc bug PR41055 for more information. -- */ --#define WRAP_LIBGCC_CALL(type, name) \ -- type __normal_##name(type a, type b) __attribute__((regparm(0))); \ -- type __wrap_##name(type a, type b); \ -- type __attribute__((no_instrument_function)) \ -- __wrap_##name(type a, type b) \ -- { return __normal_##name(a, b); } -- --WRAP_LIBGCC_CALL(long long, __divdi3) --WRAP_LIBGCC_CALL(unsigned long long, __udivdi3) --WRAP_LIBGCC_CALL(long long, __moddi3) --WRAP_LIBGCC_CALL(unsigned long long, __umoddi3) -+#include -+#include -+ -+uint64_t __udivmoddi4 ( uint64_t num, -+ uint64_t den, -+ uint64_t *rem_p ) -+{ -+ uint64_t quot = 0, qbit = 1; -+ -+ if ( den == 0 ) { -+ return 1/((unsigned)den); /* Intentional divide by zero, without -+ triggering a compiler warning which -+ would abort the build */ -+ } -+ -+ /* Left-justify denominator and count shift */ -+ while ( (int64_t)den >= 0 ) { -+ den <<= 1; -+ qbit <<= 1; -+ } -+ -+ while ( qbit ) { -+ if ( den <= num ) { -+ num -= den; -+ quot += qbit; -+ } -+ den >>= 1; -+ qbit >>= 1; -+ } -+ -+ if ( rem_p ) -+ *rem_p = num; -+ -+ return quot; -+} -+uint64_t __udivdi3( uint64_t num, uint64_t den ) -+{ -+ return __udivmoddi4(num, den, NULL); -+} -+ -+uint64_t __umoddi3 ( uint64_t num, uint64_t den ) -+{ -+ uint64_t v; -+ -+ (void) __udivmoddi4(num, den, &v); -+ return v; -+} -+ -+int64_t __divmoddi4 ( int64_t num, -+ int64_t den, -+ int64_t* rem_p ) -+{ -+ int minus = 0; -+ int64_t v; -+ -+ if ( num < 0 ) { -+ num = -num; -+ minus = 1; -+ } -+ if ( den < 0 ) { -+ den = -den; -+ minus ^= 1; -+ } -+ -+ v = __udivmoddi4(num, den, (uint64_t *)rem_p); -+ if ( minus ) { -+ v = -v; -+ if ( rem_p ) -+ *rem_p = -(*rem_p); -+ } -+ -+ return v; -+} -+ -+ -+int64_t __moddi3 (int64_t num, int64_t den) -+{ -+ int64_t v; -+ -+ (void) __divmoddi4(num, den, &v); -+ return v; -+} -+ -+int64_t __divdi3(int64_t num, int64_t den) -+{ -+ return __divmoddi4(num, den, NULL); -+} - - #endif --- -2.9.3 - diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch deleted file mode 100644 index 839cd7d..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-error-under-gcc6.patch +++ /dev/null @@ -1,86 +0,0 @@ -fix build error under gcc6 - -Fix the following error: -| ../include/linux/compiler-gcc.h:114:30: fatal error: linux/compiler-gcc6.h: No such file or directory -| #include gcc_header(__GNUC__) - -Signed-off-by: Zhenhua Luo - -Upstream-Status: Pending ---- - include/linux/compiler-gcc6.h | 65 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 65 insertions(+) - create mode 100644 include/linux/compiler-gcc6.h - -diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h -new file mode 100644 -index 0000000..c8c5659 ---- /dev/null -+++ b/include/linux/compiler-gcc6.h -@@ -0,0 +1,65 @@ -+#ifndef __LINUX_COMPILER_H -+#error "Please don't include directly, include instead." -+#endif -+ -+#define __used __attribute__((__used__)) -+#define __must_check __attribute__((warn_unused_result)) -+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) -+ -+/* Mark functions as cold. gcc will assume any path leading to a call -+ to them will be unlikely. This means a lot of manual unlikely()s -+ are unnecessary now for any paths leading to the usual suspects -+ like BUG(), printk(), panic() etc. [but let's keep them for now for -+ older compilers] -+ -+ Early snapshots of gcc 4.3 don't support this and we can't detect this -+ in the preprocessor, but we can live with this because they're unreleased. -+ Maketime probing would be overkill here. -+ -+ gcc also has a __attribute__((__hot__)) to move hot functions into -+ a special section, but I don't see any sense in this right now in -+ the kernel context */ -+#define __cold __attribute__((__cold__)) -+ -+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) -+ -+#ifndef __CHECKER__ -+# define __compiletime_warning(message) __attribute__((warning(message))) -+# define __compiletime_error(message) __attribute__((error(message))) -+#endif /* __CHECKER__ */ -+ -+/* -+ * Mark a position in code as unreachable. This can be used to -+ * suppress control flow warnings after asm blocks that transfer -+ * control elsewhere. -+ * -+ * Early snapshots of gcc 4.5 don't support this and we can't detect -+ * this in the preprocessor, but we can live with this because they're -+ * unreleased. Really, we need to have autoconf for the kernel. -+ */ -+#define unreachable() __builtin_unreachable() -+ -+/* Mark a function definition as prohibited from being cloned. */ -+#define __noclone __attribute__((__noclone__)) -+ -+/* -+ * Tell the optimizer that something else uses this function or variable. -+ */ -+#define __visible __attribute__((externally_visible)) -+ -+/* -+ * GCC 'asm goto' miscompiles certain code sequences: -+ * -+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 -+ * -+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. -+ * -+ * (asm goto is automatically volatile - the naming reflects this.) -+ */ -+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) -+ -+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP -+#define __HAVE_BUILTIN_BSWAP32__ -+#define __HAVE_BUILTIN_BSWAP64__ -+#define __HAVE_BUILTIN_BSWAP16__ -+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ --- diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-for-gcc7.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-for-gcc7.patch deleted file mode 100644 index fc7933e..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota/fix-build-for-gcc7.patch +++ /dev/null @@ -1,101 +0,0 @@ -From eea58226f0b604d3047c495985197113838d3a7a Mon Sep 17 00:00:00 2001 -From: Trevor Woerner -Date: Tue, 20 Jun 2017 13:25:20 -0400 -Subject: [PATCH] fix build for gcc7 - -| In file included from .../include/linux/compiler.h:54:0, -| from .../include/uapi/linux/stddef.h:1, -| from .../include/linux/stddef.h:4, -| from .../include/uapi/linux/posix_types.h:4, -| from .../include/uapi/linux/types.h:13, -| from .../include/linux/types.h:5, -| from .../include/linux/mod_devicetable.h:11, -| from .../scripts/mod/devicetable-offsets.c:2: -| .../include/linux/compiler-gcc.h:121:1: fatal error: linux/compiler-gcc7.h: No such file or directory -| #include gcc_header(__GNUC__) - -Upstream-Status: Pending - -Signed-off-by: Trevor Woerner -Signed-off-by: Fabio Berton -Signed-off-by: Leon Anavi ---- - include/linux/compiler-gcc7.h | 66 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 66 insertions(+) - create mode 100644 include/linux/compiler-gcc7.h - -diff --git a/include/linux/compiler-gcc7.h b/include/linux/compiler-gcc7.h -new file mode 100644 -index 0000000..cdd1cc2 ---- /dev/null -+++ b/include/linux/compiler-gcc7.h -@@ -0,0 +1,66 @@ -+#ifndef __LINUX_COMPILER_H -+#error "Please don't include directly, include instead." -+#endif -+ -+#define __used __attribute__((__used__)) -+#define __must_check __attribute__((warn_unused_result)) -+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) -+ -+/* Mark functions as cold. gcc will assume any path leading to a call -+ to them will be unlikely. This means a lot of manual unlikely()s -+ are unnecessary now for any paths leading to the usual suspects -+ like BUG(), printk(), panic() etc. [but let's keep them for now for -+ older compilers] -+ -+ Early snapshots of gcc 4.3 don't support this and we can't detect this -+ in the preprocessor, but we can live with this because they're unreleased. -+ Maketime probing would be overkill here. -+ -+ gcc also has a __attribute__((__hot__)) to move hot functions into -+ a special section, but I don't see any sense in this right now in -+ the kernel context */ -+#define __cold __attribute__((__cold__)) -+ -+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) -+ -+#ifndef __CHECKER__ -+# define __compiletime_warning(message) __attribute__((warning(message))) -+# define __compiletime_error(message) __attribute__((error(message))) -+#endif /* __CHECKER__ */ -+ -+/* -+ * Mark a position in code as unreachable. This can be used to -+ * suppress control flow warnings after asm blocks that transfer -+ * control elsewhere. -+ * -+ * Early snapshots of gcc 4.5 don't support this and we can't detect -+ * this in the preprocessor, but we can live with this because they're -+ * unreleased. Really, we need to have autoconf for the kernel. -+ */ -+#define unreachable() __builtin_unreachable() -+ -+/* Mark a function definition as prohibited from being cloned. */ -+#define __noclone __attribute__((__noclone__)) -+ -+/* -+ * Tell the optimizer that something else uses this function or variable. -+ */ -+#define __visible __attribute__((externally_visible)) -+ -+/* -+ * GCC 'asm goto' miscompiles certain code sequences: -+ * -+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 -+ * -+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. -+ * Fixed in GCC 4.8.2 and later versions. -+ * -+ * (asm goto is automatically volatile - the naming reflects this.) -+ */ -+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) -+ -+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP -+#define __HAVE_BUILTIN_BSWAP32__ -+#define __HAVE_BUILTIN_BSWAP64__ -+#define __HAVE_BUILTIN_BSWAP16__ -+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ --- -2.7.4 - diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb deleted file mode 100644 index 47b2a54..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot-ota_2015.07.bb +++ /dev/null @@ -1,28 +0,0 @@ -include recipes-bsp/u-boot/u-boot.inc -DEPENDS += "dtc-native" - -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95" - -# This revision corresponds to the tag "v2015.07" -# We use the revision in order to avoid having to fetch it from the -# repo during parse -SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204" - -SRC_URI=" \ - git://git.denx.de/u-boot.git;branch=master \ - file://0001-Set-up-environment-for-OSTree-integration.patch \ - file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ - file://fix-build-error-under-gcc6.patch \ - file://fix-build-for-gcc7.patch \ - " - -PV = "v2015.07+git${SRCPV}" - -S = "${WORKDIR}/git" - -EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" - -UBOOT_SUFFIX = "bin" -UBOOT_SUFFIX_qemux86 = "rom" -UBOOT_SUFFIX_qemux86-64 = "rom" -- cgit v1.2.3-54-g00ecf From c87cd245ca5686f61d527c1a53d43ed7db1d0f59 Mon Sep 17 00:00:00 2001 From: EpicNuts Date: Mon, 22 Jan 2018 14:19:44 +0100 Subject: swapped out the quotation marks. --- meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-efi-startup.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-efi-startup.bb b/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-efi-startup.bb index 0ad740b..4616c4f 100644 --- a/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-efi-startup.bb +++ b/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-efi-startup.bb @@ -6,6 +6,6 @@ COMPATIBLE_MACHINE = "intel-corei7-64" ALLOW_EMPTY_${PN} = "1" do_install() { - echo "fs0:\EFI\BOOT\bootx64.efi" > ${DEPLOY_DIR_IMAGE}/startup.nsh + echo 'fs0:\\EFI\\BOOT\\bootx64.efi' > ${DEPLOY_DIR_IMAGE}/startup.nsh } -- cgit v1.2.3-54-g00ecf From 6ee1425d08bcb056eb1b028af789f402ab24ca3a Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Tue, 23 Jan 2018 18:41:22 +0200 Subject: conf/bblayers.conf.sample: Remove meta-rust Recipe RVI SOTA Client has been removed form Yocto/OE meta-updater and layer meta-rust is no longer needed as a dependency. Signed-off-by: Leon Anavi --- meta-sota-raspberrypi/conf/bblayers.conf.sample | 1 - 1 file changed, 1 deletion(-) diff --git a/meta-sota-raspberrypi/conf/bblayers.conf.sample b/meta-sota-raspberrypi/conf/bblayers.conf.sample index 680e188..4dfaa22 100644 --- a/meta-sota-raspberrypi/conf/bblayers.conf.sample +++ b/meta-sota-raspberrypi/conf/bblayers.conf.sample @@ -15,7 +15,6 @@ BBLAYERS ?= " \ ##OEROOT##/../meta-openembedded/meta-oe \ ##OEROOT##/../meta-openembedded/meta-filesystems \ ##OEROOT##/../meta-openembedded/meta-python \ - ##OEROOT##/../meta-rust \ " BBLAYERS_NON_REMOVABLE ?= " \ ##OEROOT##/meta \ -- cgit v1.2.3-54-g00ecf From 695ed75e5cd454f92d25c6d16c4f962ab4dcbd7d Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Tue, 23 Jan 2018 18:49:40 +0200 Subject: conf/bblayers.conf.sample: Remove meta-rust Recipe RVI SOTA Client has been removed form Yocto/OE meta-updater and layer meta-rust is no longer needed as a dependency. Signed-off-by: Leon Anavi --- meta-sota-minnowboard/conf/bblayers.conf.sample | 1 - 1 file changed, 1 deletion(-) diff --git a/meta-sota-minnowboard/conf/bblayers.conf.sample b/meta-sota-minnowboard/conf/bblayers.conf.sample index fdc771a..89f0d2a 100644 --- a/meta-sota-minnowboard/conf/bblayers.conf.sample +++ b/meta-sota-minnowboard/conf/bblayers.conf.sample @@ -14,7 +14,6 @@ BBLAYERS ?= " \ ##OEROOT##/../meta-updater-minnowmax \ ##OEROOT##/../meta-openembedded/meta-oe \ ##OEROOT##/../meta-openembedded/meta-filesystems \ - ##OEROOT##/../meta-rust \ " BBLAYERS_NON_REMOVABLE ?= " \ ##OEROOT##/meta \ -- cgit v1.2.3-54-g00ecf From 1a0a9fc6e542cc2d98a40f2fcb38861087d57a10 Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Tue, 13 Feb 2018 17:26:50 +0200 Subject: linux-raspberrypi_%.bbappend: Use wrappers from utils.bbclass Replace base_conditional with oe.utils.conditional provided by utils.bbclass. Signed-off-by: Leon Anavi --- .../recipes-kernel/linux/linux-raspberrypi_%.bbappend | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend index 1db6d42..451aa94 100644 --- a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend +++ b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend @@ -1,7 +1,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" SRC_URI_append = "\ - ${@base_conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \ + ${@oe.utils.conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \ " do_configure_append_smack() { @@ -63,7 +63,7 @@ CMDLINE_DEBUG = "" CMDLINE_append = " usbhid.mousepoll=0" # Add options to allow CMA to operate -CMDLINE_append = ' ${@base_conditional("ENABLE_CMA", "1", "coherent_pool=6M smsc95xx.turbo_mode=N", "", d)}' +CMDLINE_append = ' ${@oe.utils.conditional("ENABLE_CMA", "1", "coherent_pool=6M smsc95xx.turbo_mode=N", "", d)}' KERNEL_MODULE_AUTOLOAD += "snd-bcm2835" KERNEL_MODULE_AUTOLOAD += "hid-multitouch" -- cgit v1.2.3-54-g00ecf From 41dc67d4a8b7ac74fb1c41db43d86064a762cbe2 Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Wed, 21 Feb 2018 11:25:51 +0200 Subject: u-boot_2017.09: Fix __udivdi3 issues Update U-Boot recipe with a patch that removes the inclusion of the libgcc math functions and replaces them by functions coded in C, taken from the U-Boot and coreboot projects. (From U-Boot: aa7839b39c2ee77f9ab8c393c56b8d812507dbb7) Signed-off-by: Leon Anavi --- ...ps-with-built-in-code-to-remove-dependenc.patch | 142 ------------- ...Set-up-environment-for-OSTree-integration.patch | 30 +-- ...lement-standalone-__udivdi3-etc-instead-o.patch | 232 +++++++++++++++++++++ .../recipes-bsp/u-boot/u-boot_2017.09.bbappend | 2 +- 4 files changed, 251 insertions(+), 155 deletions(-) delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Replace-wraps-with-built-in-code-to-remove-dependenc.patch create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-x86-lib-Implement-standalone-__udivdi3-etc-instead-o.patch diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Replace-wraps-with-built-in-code-to-remove-dependenc.patch deleted file mode 100644 index 2bfafac..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Replace-wraps-with-built-in-code-to-remove-dependenc.patch +++ /dev/null @@ -1,142 +0,0 @@ -From ee87fe6e5b2dca342d7fe3efc2be285eb4179571 Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov -Date: Tue, 31 Oct 2017 21:03:38 +0100 -Subject: [PATCH] Replace wraps with built in code to remove dependency on - multilib - ---- - arch/x86/config.mk | 3 -- - arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++--------- - 2 files changed, 87 insertions(+), 20 deletions(-) - -diff --git a/arch/x86/config.mk b/arch/x86/config.mk -index 8835dcf36f..472ada5490 100644 ---- a/arch/x86/config.mk -+++ b/arch/x86/config.mk -@@ -34,9 +34,6 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden - PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions - PLATFORM_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64) - --LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 --LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 -- - # This is used in the top-level Makefile which does not include - # PLATFORM_LDFLAGS - LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined -diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c -index 3c70d790d4..2aae611879 100644 ---- a/arch/x86/lib/gcc.c -+++ b/arch/x86/lib/gcc.c -@@ -8,22 +8,92 @@ - - #ifdef __GNUC__ - --/* -- * GCC's libgcc handling is quite broken. While the libgcc functions -- * are always regparm(0) the code that calls them uses whatever the -- * compiler call specifies. Therefore we need a wrapper around those -- * functions. See gcc bug PR41055 for more information. -- */ --#define WRAP_LIBGCC_CALL(type, name) \ -- type __normal_##name(type a, type b) __attribute__((regparm(0))); \ -- type __wrap_##name(type a, type b); \ -- type __attribute__((no_instrument_function)) \ -- __wrap_##name(type a, type b) \ -- { return __normal_##name(a, b); } -- --WRAP_LIBGCC_CALL(long long, __divdi3) --WRAP_LIBGCC_CALL(unsigned long long, __udivdi3) --WRAP_LIBGCC_CALL(long long, __moddi3) --WRAP_LIBGCC_CALL(unsigned long long, __umoddi3) -+#include -+#include -+ -+uint64_t __udivmoddi4 ( uint64_t num, -+ uint64_t den, -+ uint64_t *rem_p ) -+{ -+ uint64_t quot = 0, qbit = 1; -+ -+ if ( den == 0 ) { -+ return 1/((unsigned)den); /* Intentional divide by zero, without -+ triggering a compiler warning which -+ would abort the build */ -+ } -+ -+ /* Left-justify denominator and count shift */ -+ while ( (int64_t)den >= 0 ) { -+ den <<= 1; -+ qbit <<= 1; -+ } -+ -+ while ( qbit ) { -+ if ( den <= num ) { -+ num -= den; -+ quot += qbit; -+ } -+ den >>= 1; -+ qbit >>= 1; -+ } -+ -+ if ( rem_p ) -+ *rem_p = num; -+ -+ return quot; -+} -+uint64_t __udivdi3( uint64_t num, uint64_t den ) -+{ -+ return __udivmoddi4(num, den, NULL); -+} -+ -+uint64_t __umoddi3 ( uint64_t num, uint64_t den ) -+{ -+ uint64_t v; -+ -+ (void) __udivmoddi4(num, den, &v); -+ return v; -+} -+ -+int64_t __divmoddi4 ( int64_t num, -+ int64_t den, -+ int64_t* rem_p ) -+{ -+ int minus = 0; -+ int64_t v; -+ -+ if ( num < 0 ) { -+ num = -num; -+ minus = 1; -+ } -+ if ( den < 0 ) { -+ den = -den; -+ minus ^= 1; -+ } -+ -+ v = __udivmoddi4(num, den, (uint64_t *)rem_p); -+ if ( minus ) { -+ v = -v; -+ if ( rem_p ) -+ *rem_p = -(*rem_p); -+ } -+ -+ return v; -+} -+ -+ -+int64_t __moddi3 (int64_t num, int64_t den) -+{ -+ int64_t v; -+ -+ (void) __divmoddi4(num, den, &v); -+ return v; -+} -+ -+int64_t __divdi3(int64_t num, int64_t den) -+{ -+ return __divmoddi4(num, den, NULL); -+} - - #endif --- -2.14.2 - diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Set-up-environment-for-OSTree-integration.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Set-up-environment-for-OSTree-integration.patch index 5172fdd..60fabcf 100644 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Set-up-environment-for-OSTree-integration.patch +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Set-up-environment-for-OSTree-integration.patch @@ -1,21 +1,27 @@ -From ebb26338d0c2f436a86fd4d7cb8d723a90d6a369 Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov -Date: Thu, 15 Sep 2016 17:52:41 +0200 -Subject: [PATCH 1/2] Set up environment for OSTree integration +From 855282cc487f2afa6771d33b0d036ad637e87d1b Mon Sep 17 00:00:00 2001 +From: Leon Anavi +Date: Tue, 20 Feb 2018 19:31:55 +0200 +Subject: [PATCH] qemu-x86.h: Set up environment for OSTree integration +Rebase Anton's patch for setting up envieronment +for OSTree integration for QEMU. + +Co-Authored-By: Anton Gerasimov +Signed-off-by: Leon Anavi --- - include/configs/qemu-x86.h | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) + include/configs/qemu-x86.h | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h -index 78c296f..79df455 100644 +index 01072f8..755fb65 100644 --- a/include/configs/qemu-x86.h +++ b/include/configs/qemu-x86.h -@@ -74,4 +74,24 @@ - #undef CONFIG_ENV_IS_IN_SPI_FLASH - #define CONFIG_ENV_IS_NOWHERE +@@ -45,4 +45,25 @@ + #define CONFIG_SPL_BOARD_LOAD_IMAGE + #define BOOT_DEVICE_BOARD 11 +#undef CONFIG_BOOTARGS ++ +#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0" + +#undef CONFIG_BOOTDELAY @@ -33,9 +39,9 @@ index 78c296f..79df455 100644 + "ramdisk_image=/initrd\0" \ + "ramdiskaddr=0x4000000\0" \ + "bootdelay=3\0" \ -+ "loadenv=if ext2load ide 0 $loadaddr /boot/loader/uEnv.txt; then env import -t $loadaddr $filesize; fi;" ++ "loadenv=if ext2load ide 0 $loadaddr /boot/loader/uEnv.txt; then env import -t $loadaddr $filesize; fi;" + #endif /* __CONFIG_H */ -- -2.9.3 +2.7.4 diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-x86-lib-Implement-standalone-__udivdi3-etc-instead-o.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-x86-lib-Implement-standalone-__udivdi3-etc-instead-o.patch new file mode 100644 index 0000000..9511d6a --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-x86-lib-Implement-standalone-__udivdi3-etc-instead-o.patch @@ -0,0 +1,232 @@ +From aa7839b39c2ee77f9ab8c393c56b8d812507dbb7 Mon Sep 17 00:00:00 2001 +From: Stefan Roese +Date: Wed, 29 Nov 2017 16:23:31 +0100 +Subject: [PATCH] x86: lib: Implement standalone __udivdi3 etc instead of + libgcc ones + +This patch removes the inclusion of the libgcc math functions and +replaces them by functions coded in C, taken from the coreboot +project. This makes U-Boot building more independent from the toolchain +installed / available on the build system. + +The code taken from coreboot is authored from Vadim Bendebury + on 2014-11-28 and committed with commit +ID e63990ef [libpayload: provide basic 64bit division implementation] +(coreboot git repository located here [1]). + +I modified the code so that its checkpatch clean without any +functional changes. + +[1] git://github.com/coreboot/coreboot.git + +Signed-off-by: Stefan Roese +Cc: Simon Glass +Cc: Bin Meng +Reviewed-by: Bin Meng +Tested-by: Bin Meng +--- + arch/x86/config.mk | 3 -- + arch/x86/lib/Makefile | 8 +--- + arch/x86/lib/div64.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++ + arch/x86/lib/gcc.c | 29 ------------- + 4 files changed, 114 insertions(+), 39 deletions(-) + create mode 100644 arch/x86/lib/div64.c + delete mode 100644 arch/x86/lib/gcc.c + +diff --git a/arch/x86/config.mk b/arch/x86/config.mk +index 8835dcf..472ada5 100644 +--- a/arch/x86/config.mk ++++ b/arch/x86/config.mk +@@ -34,9 +34,6 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden + PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions + PLATFORM_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64) + +-LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 +-LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 +- + # This is used in the top-level Makefile which does not include + # PLATFORM_LDFLAGS + LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined +diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile +index fe00d75..7d729ea 100644 +--- a/arch/x86/lib/Makefile ++++ b/arch/x86/lib/Makefile +@@ -18,7 +18,6 @@ obj-$(CONFIG_SEABIOS) += coreboot_table.o + obj-y += early_cmos.o + obj-$(CONFIG_EFI) += efi/ + obj-y += e820.o +-obj-y += gcc.o + obj-y += init_helpers.o + obj-y += interrupts.o + obj-y += lpc-uclass.o +@@ -49,12 +48,7 @@ endif + obj-$(CONFIG_HAVE_FSP) += fsp/ + obj-$(CONFIG_SPL_BUILD) += spl.o + +-extra-$(CONFIG_USE_PRIVATE_LIBGCC) += lib.a +- +-NORMAL_LIBGCC = $(shell $(CC) $(PLATFORM_CPPFLAGS) -print-libgcc-file-name) +-OBJCOPYFLAGS := --prefix-symbols=__normal_ +-$(obj)/lib.a: $(NORMAL_LIBGCC) FORCE +- $(call if_changed,objcopy) ++lib-$(CONFIG_USE_PRIVATE_LIBGCC) += div64.o + + ifeq ($(CONFIG_$(SPL_)X86_64),) + obj-$(CONFIG_EFI_APP) += crt0_ia32_efi.o reloc_ia32_efi.o +diff --git a/arch/x86/lib/div64.c b/arch/x86/lib/div64.c +new file mode 100644 +index 0000000..4efed74 +--- /dev/null ++++ b/arch/x86/lib/div64.c +@@ -0,0 +1,113 @@ ++/* ++ * This file is copied from the coreboot repository as part of ++ * the libpayload project: ++ * ++ * Copyright 2014 Google Inc. ++ * ++ * SPDX-License-Identifier: BSD-3-Clause ++ */ ++ ++#include ++ ++union overlay64 { ++ u64 longw; ++ struct { ++ u32 lower; ++ u32 higher; ++ } words; ++}; ++ ++u64 __ashldi3(u64 num, unsigned int shift) ++{ ++ union overlay64 output; ++ ++ output.longw = num; ++ if (shift >= 32) { ++ output.words.higher = output.words.lower << (shift - 32); ++ output.words.lower = 0; ++ } else { ++ if (!shift) ++ return num; ++ output.words.higher = (output.words.higher << shift) | ++ (output.words.lower >> (32 - shift)); ++ output.words.lower = output.words.lower << shift; ++ } ++ return output.longw; ++} ++ ++u64 __lshrdi3(u64 num, unsigned int shift) ++{ ++ union overlay64 output; ++ ++ output.longw = num; ++ if (shift >= 32) { ++ output.words.lower = output.words.higher >> (shift - 32); ++ output.words.higher = 0; ++ } else { ++ if (!shift) ++ return num; ++ output.words.lower = output.words.lower >> shift | ++ (output.words.higher << (32 - shift)); ++ output.words.higher = output.words.higher >> shift; ++ } ++ return output.longw; ++} ++ ++#define MAX_32BIT_UINT ((((u64)1) << 32) - 1) ++ ++static u64 _64bit_divide(u64 dividend, u64 divider, u64 *rem_p) ++{ ++ u64 result = 0; ++ ++ /* ++ * If divider is zero - let the rest of the system care about the ++ * exception. ++ */ ++ if (!divider) ++ return 1 / (u32)divider; ++ ++ /* As an optimization, let's not use 64 bit division unless we must. */ ++ if (dividend <= MAX_32BIT_UINT) { ++ if (divider > MAX_32BIT_UINT) { ++ result = 0; ++ if (rem_p) ++ *rem_p = divider; ++ } else { ++ result = (u32)dividend / (u32)divider; ++ if (rem_p) ++ *rem_p = (u32)dividend % (u32)divider; ++ } ++ return result; ++ } ++ ++ while (divider <= dividend) { ++ u64 locald = divider; ++ u64 limit = __lshrdi3(dividend, 1); ++ int shifts = 0; ++ ++ while (locald <= limit) { ++ shifts++; ++ locald = locald + locald; ++ } ++ result |= __ashldi3(1, shifts); ++ dividend -= locald; ++ } ++ ++ if (rem_p) ++ *rem_p = dividend; ++ ++ return result; ++} ++ ++u64 __udivdi3(u64 num, u64 den) ++{ ++ return _64bit_divide(num, den, NULL); ++} ++ ++u64 __umoddi3(u64 num, u64 den) ++{ ++ u64 v = 0; ++ ++ _64bit_divide(num, den, &v); ++ return v; ++} +diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c +deleted file mode 100644 +index 3c70d79..0000000 +--- a/arch/x86/lib/gcc.c ++++ /dev/null +@@ -1,29 +0,0 @@ +-/* +- * This file is part of the coreboot project. +- * +- * Copyright (C) 2009 coresystems GmbH +- * +- * SPDX-License-Identifier: GPL-2.0 +- */ +- +-#ifdef __GNUC__ +- +-/* +- * GCC's libgcc handling is quite broken. While the libgcc functions +- * are always regparm(0) the code that calls them uses whatever the +- * compiler call specifies. Therefore we need a wrapper around those +- * functions. See gcc bug PR41055 for more information. +- */ +-#define WRAP_LIBGCC_CALL(type, name) \ +- type __normal_##name(type a, type b) __attribute__((regparm(0))); \ +- type __wrap_##name(type a, type b); \ +- type __attribute__((no_instrument_function)) \ +- __wrap_##name(type a, type b) \ +- { return __normal_##name(a, b); } +- +-WRAP_LIBGCC_CALL(long long, __divdi3) +-WRAP_LIBGCC_CALL(unsigned long long, __udivdi3) +-WRAP_LIBGCC_CALL(long long, __moddi3) +-WRAP_LIBGCC_CALL(unsigned long long, __umoddi3) +- +-#endif +-- +2.7.4 + diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend index 7a6c9a6..f56f565 100644 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend @@ -3,7 +3,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" DEPENDS += "swig-native" SRC_URI +=" \ - file://0001-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ + file://0001-x86-lib-Implement-standalone-__udivdi3-etc-instead-o.patch \ file://0001-Set-up-environment-for-OSTree-integration.patch \ file://0001-Move-Cache-As-RAM-memory-from-area-mapped-to-ROM-in-.patch \ " -- cgit v1.2.3-54-g00ecf From 3c25c32e7aa2913539406ed0ff8a32d405fc615c Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Wed, 21 Feb 2018 16:49:01 +0100 Subject: Add support to FIT images and don't use DTB provided by the bootloader --- .../recipes-bsp/bootfiles/rpi-config_git.bbappend | 6 ------ .../u-boot-otascript/u-boot-otascript/uEnv.txt | 4 ++-- .../recipes-bsp/u-boot/files/0001-Enable-FIT.patch | 23 ++++++++++++++++++++++ .../recipes-bsp/u-boot/u-boot_%.bbappend | 3 +++ 4 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 meta-sota-raspberrypi/recipes-bsp/u-boot/files/0001-Enable-FIT.patch create mode 100644 meta-sota-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend diff --git a/meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend index 9222fd5..5073560 100644 --- a/meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend +++ b/meta-sota-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend @@ -11,13 +11,7 @@ do_deploy_append() { echo "avoid_warnings=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt - echo "dtoverlay=vc4-kms-v3d-overlay,cma-256" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt - echo "dtoverlay=rpi-ft5406-overlay" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt echo "dtparam=audio=on" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt } -do_deploy_append_sota() { - echo "device_tree_address=0x0c800000" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt -} - ENABLE_UART_raspberrypi3 = "1" diff --git a/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt index f6c0570..ede4234 100644 --- a/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt +++ b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt @@ -3,5 +3,5 @@ bootcmd_dtb=fdt addr $fdt_addr_r; fdt get value bootargs_fdt /chosen bootargs bootcmd_otenv=ext2load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192" bootcmd_load=ext2load mmc 0:2 $kernel_addr_r "/boot"$kernel_image; ext2load mmc 0:2 $ramdisk_addr_r "/boot"$ramdisk_image -bootcmd_run=bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r -bootcmd=run bootcmd_dtb; run bootcmd_otenv; run bootcmd_args; run bootcmd_load; run bootcmd_run +bootcmd_run=bootm $kernel_addr_r $ramdisk_addr_r +bootcmd=run bootcmd_otenv; run bootcmd_args; run bootcmd_load; run bootcmd_run diff --git a/meta-sota-raspberrypi/recipes-bsp/u-boot/files/0001-Enable-FIT.patch b/meta-sota-raspberrypi/recipes-bsp/u-boot/files/0001-Enable-FIT.patch new file mode 100644 index 0000000..fb8fa09 --- /dev/null +++ b/meta-sota-raspberrypi/recipes-bsp/u-boot/files/0001-Enable-FIT.patch @@ -0,0 +1,23 @@ +From d6323c4aacff2922051cf801eb7c2661b437baf6 Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Tue, 13 Feb 2018 15:16:00 +0100 +Subject: [PATCH] Enable FIT + +--- + configs/rpi_3_32b_defconfig | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig +index bb56a9e4e1..b366a3a061 100644 +--- a/configs/rpi_3_32b_defconfig ++++ b/configs/rpi_3_32b_defconfig +@@ -36,3 +36,6 @@ CONFIG_SYS_WHITE_ON_BLACK=y + CONFIG_CONSOLE_SCROLL_LINES=10 + CONFIG_PHYS_TO_BUS=y + CONFIG_OF_LIBFDT_OVERLAY=y ++ ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y +-- +2.15.1 + diff --git a/meta-sota-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend b/meta-sota-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend new file mode 100644 index 0000000..b99397b --- /dev/null +++ b/meta-sota-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI_append = " file://0001-Enable-FIT.patch " -- cgit v1.2.3-54-g00ecf From 577c9a9f0ae197624f1872fe2d81db0728b4fe6a Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Thu, 1 Mar 2018 14:55:19 +0100 Subject: Fix typo (minnowboard instead of qemux86-64). Presumably just a copy-paste error from when this was written in 2016. --- meta-sota-qemux86-64/conf/layer.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meta-sota-qemux86-64/conf/layer.conf b/meta-sota-qemux86-64/conf/layer.conf index 12b542c..a682a40 100644 --- a/meta-sota-qemux86-64/conf/layer.conf +++ b/meta-sota-qemux86-64/conf/layer.conf @@ -5,7 +5,7 @@ BBPATH =. "${LAYERDIR}:" BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/recipes-*/*/*.bbappend" -BBFILE_COLLECTIONS += "updater-minnowboard" -BBFILE_PATTERN_updater-minnowboard = "^${LAYERDIR}/" -BBFILE_PRIORITY_updater-minnowboard = "7" +BBFILE_COLLECTIONS += "updater-qemux86-64" +BBFILE_PATTERN_updater-qemux86-64 = "^${LAYERDIR}/" +BBFILE_PRIORITY_updater-qemux86-64 = "7" -- cgit v1.2.3-54-g00ecf From 8db7c9833133f1b67d3a2b4d39ff8f0906bf2334 Mon Sep 17 00:00:00 2001 From: Phil Wise Date: Thu, 8 Mar 2018 11:50:03 +0100 Subject: Fix name of R-Pi image in flash-image.sh --- meta-sota-raspberrypi/scripts/flash-image.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-sota-raspberrypi/scripts/flash-image.sh b/meta-sota-raspberrypi/scripts/flash-image.sh index 74707bc..9692137 100755 --- a/meta-sota-raspberrypi/scripts/flash-image.sh +++ b/meta-sota-raspberrypi/scripts/flash-image.sh @@ -55,7 +55,7 @@ if [ -z "$1" ]; then echo " Example: sdb" echo "" echo " imagefile : An image file generated by bitbake (optional)." - echo " Default: ./tmp/deploy/images/raspberrypi3/rpi-basic-image-raspberrypi3.rpi-sdimg-ota" + echo " Default: ./tmp/deploy/images/raspberrypi3/rpi-basic-image-raspberrypi3.wic" echo "" echo " The following utilities are prerequisites:" echo "" @@ -71,7 +71,7 @@ fi set -euo pipefail DEVICE_TO_FLASH=$1 -IMAGE_TO_FLASH="${2-tmp/deploy/images/raspberrypi3/rpi-basic-image-raspberrypi3.rpi-sdimg-ota}" +IMAGE_TO_FLASH="${2-tmp/deploy/images/raspberrypi3/rpi-basic-image-raspberrypi3.wic}" DEVICE_IS_REMOVABLE=$(cat /sys/block/$DEVICE_TO_FLASH/removable) if [[ $DEVICE_IS_REMOVABLE != "1" ]]; then -- cgit v1.2.3-54-g00ecf From 860124ea7884bdcb772da27ff81cd5a5b367516e Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Mon, 30 Apr 2018 15:52:59 +0200 Subject: Remove AGL patches Some of them might be necessary to support smack, but meta-updater doesn't include smack support anyway, so they'd better been applied by external layers. Others disable framebuffer support which is really annoying for users. --- .../0001-Smack-File-receive-for-sockets.patch | 65 ---------------------- .../linux-raspberrypi/0002-faytech-fix-rpi.patch | 33 ----------- .../0002-smack-fix-cache-of-access-labels.patch | 43 -------------- ...ack-ignore-null-signal-in-smack_task_kill.patch | 39 ------------- ...n-smack_known_web-label-for-kernel-thread.patch | 49 ---------------- .../linux/linux-raspberrypi_%.bbappend | 65 ---------------------- .../linux/linux-raspberrypi_4.9.bbappend | 6 -- 7 files changed, 300 deletions(-) delete mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch delete mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch delete mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch delete mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch delete mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch delete mode 100644 meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch deleted file mode 100644 index 4021e5d..0000000 --- a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-Smack-File-receive-for-sockets.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 2b206c36b16e72cfe41cd22448d8527359ffd962 Mon Sep 17 00:00:00 2001 -From: Casey Schaufler -Date: Mon, 7 Dec 2015 14:34:32 -0800 -Subject: [PATCH 1/4] Smack: File receive for sockets - -The existing file receive hook checks for access on -the file inode even for UDS. This is not right, as -the inode is not used by Smack to make access checks -for sockets. This change checks for an appropriate -access relationship between the receiving (current) -process and the socket. If the process can't write -to the socket's send label or the socket's receive -label can't write to the process fail. - -This will allow the legitimate cases, where the -socket sender and socket receiver can freely communicate. -Only strangly set socket labels should cause a problem. - -Signed-off-by: Casey Schaufler ---- - security/smack/smack_lsm.c | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c -index ff81026..b20ef06 100644 ---- a/security/smack/smack_lsm.c -+++ b/security/smack/smack_lsm.c -@@ -1860,12 +1860,34 @@ static int smack_file_receive(struct file *file) - int may = 0; - struct smk_audit_info ad; - struct inode *inode = file_inode(file); -+ struct socket *sock; -+ struct task_smack *tsp; -+ struct socket_smack *ssp; - - if (unlikely(IS_PRIVATE(inode))) - return 0; - - smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH); - smk_ad_setfield_u_fs_path(&ad, file->f_path); -+ -+ if (S_ISSOCK(inode->i_mode)) { -+ sock = SOCKET_I(inode); -+ ssp = sock->sk->sk_security; -+ tsp = current_security(); -+ /* -+ * If the receiving process can't write to the -+ * passed socket or if the passed socket can't -+ * write to the receiving process don't accept -+ * the passed socket. -+ */ -+ rc = smk_access(tsp->smk_task, ssp->smk_out, MAY_WRITE, &ad); -+ rc = smk_bu_file(file, may, rc); -+ if (rc < 0) -+ return rc; -+ rc = smk_access(ssp->smk_in, tsp->smk_task, MAY_WRITE, &ad); -+ rc = smk_bu_file(file, may, rc); -+ return rc; -+ } - /* - * This code relies on bitmasks. - */ --- -2.7.4 - diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch deleted file mode 100644 index 00e3692..0000000 --- a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-faytech-fix-rpi.patch +++ /dev/null @@ -1,33 +0,0 @@ -From f9fefc63456dd50eeec727ae2fbc13b0d84eb44e Mon Sep 17 00:00:00 2001 -From: Tom Pollard -Date: Wed, 6 Apr 2016 07:47:25 +0000 -Subject: [PATCH 1/1] Fix lack of touch up for Faytech 10" Touchscreen MonitorV2 - -NOTE: This is a very temporary hack that is not in a state to be upstreamed yet. ---- -Index: a/drivers/hid/hid-multitouch.c -=================================================================== ---- a/drivers/hid/hid-multitouch.c 2016-07-05 08:45:06.006466000 +0000 -+++ b/drivers/hid/hid-multitouch.c 2016-07-05 08:48:44.574466000 +0000 -@@ -205,7 +205,6 @@ - { .name = MT_CLS_WIN_8, - .quirks = MT_QUIRK_ALWAYS_VALID | - MT_QUIRK_IGNORE_DUPLICATES | -- MT_QUIRK_HOVERING | - MT_QUIRK_CONTACT_CNT_ACCURATE }, - { .name = MT_CLS_EXPORT_ALL_INPUTS, - .quirks = MT_QUIRK_ALWAYS_VALID | -@@ -396,11 +395,6 @@ - td->is_buttonpad = true; - - break; -- case 0xff0000c5: -- /* Retrieve the Win8 blob once to enable some devices */ -- if (usage->usage_index == 0) -- mt_get_feature(hdev, field->report); -- break; - } - } - --- -1.9.1 diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch deleted file mode 100644 index c516f3a..0000000 --- a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0002-smack-fix-cache-of-access-labels.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 99267706991ab84bd44ceaea9a7ec886bbdd58e0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Bollo?= -Date: Tue, 12 Jan 2016 21:23:40 +0100 -Subject: [PATCH 2/4] smack: fix cache of access labels -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Before this commit, removing the access property of -a file, aka, the extended attribute security.SMACK64 -was not effictive until the cache had been cleaned. - -This patch fixes that problem. - -Signed-off-by: José Bollo -Acked-by: Casey Schaufler ---- - security/smack/smack_lsm.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c -index b20ef06..b2bcb14 100644 ---- a/security/smack/smack_lsm.c -+++ b/security/smack/smack_lsm.c -@@ -1444,9 +1444,13 @@ static int smack_inode_removexattr(struct dentry *dentry, const char *name) - * Don't do anything special for these. - * XATTR_NAME_SMACKIPIN - * XATTR_NAME_SMACKIPOUT -- * XATTR_NAME_SMACKEXEC - */ -- if (strcmp(name, XATTR_NAME_SMACK) == 0) -+ if (strcmp(name, XATTR_NAME_SMACK) == 0) { -+ struct super_block *sbp = d_backing_inode(dentry)->i_sb; -+ struct superblock_smack *sbsp = sbp->s_security; -+ -+ isp->smk_inode = sbsp->smk_default; -+ } else if (strcmp(name, XATTR_NAME_SMACKEXEC) == 0) - isp->smk_task = NULL; - else if (strcmp(name, XATTR_NAME_SMACKMMAP) == 0) - isp->smk_mmap = NULL; --- -2.7.4 - diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch deleted file mode 100644 index c9180bb..0000000 --- a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Smack-ignore-null-signal-in-smack_task_kill.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ec4eb03af07b0fbc330aecca6ac4ebd6accd8825 Mon Sep 17 00:00:00 2001 -From: Rafal Krypa -Date: Mon, 4 Apr 2016 11:14:53 +0200 -Subject: [PATCH 3/4] Smack: ignore null signal in smack_task_kill - -Kill with signal number 0 is commonly used for checking PID existence. -Smack treated such cases like any other kills, although no signal is -actually delivered when sig == 0. - -Checking permissions when sig == 0 didn't prevent an unprivileged caller -from learning whether PID exists or not. When it existed, kernel returned -EPERM, when it didn't - ESRCH. The only effect of policy check in such -case is noise in audit logs. - -This change lets Smack silently ignore kill() invocations with sig == 0. - -Signed-off-by: Rafal Krypa -Acked-by: Casey Schaufler ---- - security/smack/smack_lsm.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c -index b2bcb14..cf8a93f 100644 ---- a/security/smack/smack_lsm.c -+++ b/security/smack/smack_lsm.c -@@ -2239,6 +2239,9 @@ static int smack_task_kill(struct task_struct *p, struct siginfo *info, - struct smack_known *tkp = smk_of_task_struct(p); - int rc; - -+ if (!sig) -+ return 0; /* null signal; existence test */ -+ - smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK); - smk_ad_setfield_u_tsk(&ad, p); - /* --- -2.7.4 - diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch deleted file mode 100644 index a1eeac3..0000000 --- a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch +++ /dev/null @@ -1,49 +0,0 @@ -From c8bbb0f916de54610513e376070aea531af19dd6 Mon Sep 17 00:00:00 2001 -From: jooseong lee -Date: Thu, 3 Nov 2016 10:55:43 +0100 -Subject: [PATCH 4/4] Smack: Assign smack_known_web label for kernel thread's -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook - -Creating struct sock by sk_alloc function in various kernel subsystems -like bluetooth dosen't call smack_socket_post_create(). In such case, -received sock label is the floor('_') label and makes access deny. - -Refers-to: https://review.tizen.org/gerrit/#/c/80717/4 - -Change-Id: I2e5c9359bfede84a988fd4d4d74cdb9dfdfc52d8 -Signed-off-by: jooseong lee -Signed-off-by: José Bollo ---- - security/smack/smack_lsm.c | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c -index cf8a93f..21651bc 100644 ---- a/security/smack/smack_lsm.c -+++ b/security/smack/smack_lsm.c -@@ -2321,8 +2321,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags) - if (ssp == NULL) - return -ENOMEM; - -- ssp->smk_in = skp; -- ssp->smk_out = skp; -+ /* -+ * Sockets created by kernel threads receive web label. -+ */ -+ if (unlikely(current->flags & PF_KTHREAD)) { -+ ssp->smk_in = &smack_known_web; -+ ssp->smk_out = &smack_known_web; -+ } else { -+ ssp->smk_in = skp; -+ ssp->smk_out = skp; -+ } - ssp->smk_packet = NULL; - - sk->sk_security = ssp; --- -2.7.4 - diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend index 1db6d42..e2e7e60 100644 --- a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend +++ b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend @@ -1,72 +1,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" -SRC_URI_append = "\ - ${@base_conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \ -" - -do_configure_append_smack() { - # SMACK and Co - kernel_configure_variable IP_NF_SECURITY m - kernel_configure_variable IP6_NF_SECURITY m - kernel_configure_variable EXT2_FS_SECURITY y - kernel_configure_variable EXT3_FS_SECURITY y - kernel_configure_variable EXT4_FS_SECURITY y - kernel_configure_variable SECURITY y - kernel_configure_variable SECURITY_SMACK y - kernel_configure_variable TMPFS_XATTR y - kernel_configure_variable DEFAULT_SECURITY "smack" - kernel_configure_variable DEFAULT_SECURITY_SMACK y - kernel_configure_variable FANOTIFY_ACCESS_PERMISSIONS y -} - -do_configure_append_netboot() { - # NBD for netboot - kernel_configure_variable BLK_DEV_NBD y - # ramblk for inird - kernel_configure_variable BLK_DEV_RAM y -} - do_configure_append_sota() { # ramblk for inird kernel_configure_variable BLK_DEV_RAM y } -do_configure_append() { - - # VC4 Wayland/Weston - kernel_configure_variable I2C_BCM2835 y - kernel_configure_variable DRM y - kernel_configure_variable DRM_PANEL_RASPBERRYPI_TOUCHSCREEN y - kernel_configure_variable DRM_VC4 y - kernel_configure_variable FB_BCM2708 n - - # Enable support for TP-Link TL-W722N USB Wifi adapter - kernel_configure_variable CONFIG_ATH_CARDS m - kernel_configure_variable CONFIG_ATH9K_HTC m - - # Enable support for RTLSDR - kernel_configure_variable CONFIG_MEDIA_USB_SUPPORT y - kernel_configure_variable CONFIG_MEDIA_DIGITAL_TV_SUPPORT y - kernel_configure_variable CONFIG_DVB_USB_V2 m - kernel_configure_variable CONFIG_DVB_USB_RTL28XXU m - - # KEEP until fixed upstream: - # Keep this the last line - # Remove all modified configs and add the rest to .config - sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config' - - yes '' | oe_runmake oldconfig - kernel_do_configure -} - -CMDLINE_DEBUG = "" -CMDLINE_append = " usbhid.mousepoll=0" - -# Add options to allow CMA to operate -CMDLINE_append = ' ${@base_conditional("ENABLE_CMA", "1", "coherent_pool=6M smsc95xx.turbo_mode=N", "", d)}' - -KERNEL_MODULE_AUTOLOAD += "snd-bcm2835" -KERNEL_MODULE_AUTOLOAD += "hid-multitouch" - -RDEPENDS_${PN} += "kernel-module-snd-bcm2835" -PACKAGES += "kernel-module-snd-bcm2835" diff --git a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend b/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend deleted file mode 100644 index 206a8d0..0000000 --- a/meta-sota-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -#------------------------------------------------------------------------- -# smack patches for handling bluetooth - -SRC_URI_append_smack = "\ - file://0004-Smack-Assign-smack_known_web-label-for-kernel-thread.patch \ -" -- cgit v1.2.3-54-g00ecf From b35fe50cdcce8984c8e309d2212447a7a1ad81ed Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Wed, 9 May 2018 09:48:06 +0200 Subject: Remove patch unused in rocko. It was rendered obsolete in 4156c9db2f7d1ddef5fff41bb5617782c00cdc8a. --- .../u-boot/files/fix-build-error-under-gcc6.patch | 86 ---------------------- 1 file changed, 86 deletions(-) delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch deleted file mode 100644 index 839cd7d..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/fix-build-error-under-gcc6.patch +++ /dev/null @@ -1,86 +0,0 @@ -fix build error under gcc6 - -Fix the following error: -| ../include/linux/compiler-gcc.h:114:30: fatal error: linux/compiler-gcc6.h: No such file or directory -| #include gcc_header(__GNUC__) - -Signed-off-by: Zhenhua Luo - -Upstream-Status: Pending ---- - include/linux/compiler-gcc6.h | 65 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 65 insertions(+) - create mode 100644 include/linux/compiler-gcc6.h - -diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h -new file mode 100644 -index 0000000..c8c5659 ---- /dev/null -+++ b/include/linux/compiler-gcc6.h -@@ -0,0 +1,65 @@ -+#ifndef __LINUX_COMPILER_H -+#error "Please don't include directly, include instead." -+#endif -+ -+#define __used __attribute__((__used__)) -+#define __must_check __attribute__((warn_unused_result)) -+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) -+ -+/* Mark functions as cold. gcc will assume any path leading to a call -+ to them will be unlikely. This means a lot of manual unlikely()s -+ are unnecessary now for any paths leading to the usual suspects -+ like BUG(), printk(), panic() etc. [but let's keep them for now for -+ older compilers] -+ -+ Early snapshots of gcc 4.3 don't support this and we can't detect this -+ in the preprocessor, but we can live with this because they're unreleased. -+ Maketime probing would be overkill here. -+ -+ gcc also has a __attribute__((__hot__)) to move hot functions into -+ a special section, but I don't see any sense in this right now in -+ the kernel context */ -+#define __cold __attribute__((__cold__)) -+ -+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) -+ -+#ifndef __CHECKER__ -+# define __compiletime_warning(message) __attribute__((warning(message))) -+# define __compiletime_error(message) __attribute__((error(message))) -+#endif /* __CHECKER__ */ -+ -+/* -+ * Mark a position in code as unreachable. This can be used to -+ * suppress control flow warnings after asm blocks that transfer -+ * control elsewhere. -+ * -+ * Early snapshots of gcc 4.5 don't support this and we can't detect -+ * this in the preprocessor, but we can live with this because they're -+ * unreleased. Really, we need to have autoconf for the kernel. -+ */ -+#define unreachable() __builtin_unreachable() -+ -+/* Mark a function definition as prohibited from being cloned. */ -+#define __noclone __attribute__((__noclone__)) -+ -+/* -+ * Tell the optimizer that something else uses this function or variable. -+ */ -+#define __visible __attribute__((externally_visible)) -+ -+/* -+ * GCC 'asm goto' miscompiles certain code sequences: -+ * -+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 -+ * -+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. -+ * -+ * (asm goto is automatically volatile - the naming reflects this.) -+ */ -+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) -+ -+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP -+#define __HAVE_BUILTIN_BSWAP32__ -+#define __HAVE_BUILTIN_BSWAP64__ -+#define __HAVE_BUILTIN_BSWAP16__ -+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ --- -- cgit v1.2.3-54-g00ecf From 7cc4b5559428ed54511f7ac177d1a082328b985c Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Wed, 16 May 2018 16:47:47 +0200 Subject: Update our u-boot patches to sumo upstream's version Two of the patches are already upstreamed now --- ...As-RAM-memory-from-area-mapped-to-ROM-in-.patch | 30 --- ...lement-standalone-__udivdi3-etc-instead-o.patch | 232 --------------------- .../recipes-bsp/u-boot/u-boot_2017.09.bbappend | 15 -- .../recipes-bsp/u-boot/u-boot_2018.01.bbappend | 13 ++ 4 files changed, 13 insertions(+), 277 deletions(-) delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Move-Cache-As-RAM-memory-from-area-mapped-to-ROM-in-.patch delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-x86-lib-Implement-standalone-__udivdi3-etc-instead-o.patch delete mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend create mode 100644 meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2018.01.bbappend diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Move-Cache-As-RAM-memory-from-area-mapped-to-ROM-in-.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Move-Cache-As-RAM-memory-from-area-mapped-to-ROM-in-.patch deleted file mode 100644 index d1e147c..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-Move-Cache-As-RAM-memory-from-area-mapped-to-ROM-in-.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0aa919fbfb91d7ea433f790b10351654acfb52d9 Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov -Date: Fri, 10 Nov 2017 18:41:02 +0100 -Subject: [PATCH] Move Cache-As-RAM memory from area mapped to ROM in QEMU - -ROM has been made read-only in qemu recently (namely commit -208fa0e43645edd0b0d8f838857dfc79daff40a8), so this patch restores -compatibility between u-boot and qemu. - -Signed-off-by: Anton Gerasimov ---- - arch/x86/cpu/qemu/Kconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/x86/cpu/qemu/Kconfig b/arch/x86/cpu/qemu/Kconfig -index 6808c9a6b9..f4b9922a34 100644 ---- a/arch/x86/cpu/qemu/Kconfig -+++ b/arch/x86/cpu/qemu/Kconfig -@@ -11,7 +11,7 @@ if QEMU - - config SYS_CAR_ADDR - hex -- default 0xd0000 -+ default 0x10000 - - config SYS_CAR_SIZE - hex --- -2.14.1 - diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-x86-lib-Implement-standalone-__udivdi3-etc-instead-o.patch b/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-x86-lib-Implement-standalone-__udivdi3-etc-instead-o.patch deleted file mode 100644 index 9511d6a..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/files/0001-x86-lib-Implement-standalone-__udivdi3-etc-instead-o.patch +++ /dev/null @@ -1,232 +0,0 @@ -From aa7839b39c2ee77f9ab8c393c56b8d812507dbb7 Mon Sep 17 00:00:00 2001 -From: Stefan Roese -Date: Wed, 29 Nov 2017 16:23:31 +0100 -Subject: [PATCH] x86: lib: Implement standalone __udivdi3 etc instead of - libgcc ones - -This patch removes the inclusion of the libgcc math functions and -replaces them by functions coded in C, taken from the coreboot -project. This makes U-Boot building more independent from the toolchain -installed / available on the build system. - -The code taken from coreboot is authored from Vadim Bendebury - on 2014-11-28 and committed with commit -ID e63990ef [libpayload: provide basic 64bit division implementation] -(coreboot git repository located here [1]). - -I modified the code so that its checkpatch clean without any -functional changes. - -[1] git://github.com/coreboot/coreboot.git - -Signed-off-by: Stefan Roese -Cc: Simon Glass -Cc: Bin Meng -Reviewed-by: Bin Meng -Tested-by: Bin Meng ---- - arch/x86/config.mk | 3 -- - arch/x86/lib/Makefile | 8 +--- - arch/x86/lib/div64.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++ - arch/x86/lib/gcc.c | 29 ------------- - 4 files changed, 114 insertions(+), 39 deletions(-) - create mode 100644 arch/x86/lib/div64.c - delete mode 100644 arch/x86/lib/gcc.c - -diff --git a/arch/x86/config.mk b/arch/x86/config.mk -index 8835dcf..472ada5 100644 ---- a/arch/x86/config.mk -+++ b/arch/x86/config.mk -@@ -34,9 +34,6 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden - PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions - PLATFORM_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64) - --LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 --LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 -- - # This is used in the top-level Makefile which does not include - # PLATFORM_LDFLAGS - LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined -diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile -index fe00d75..7d729ea 100644 ---- a/arch/x86/lib/Makefile -+++ b/arch/x86/lib/Makefile -@@ -18,7 +18,6 @@ obj-$(CONFIG_SEABIOS) += coreboot_table.o - obj-y += early_cmos.o - obj-$(CONFIG_EFI) += efi/ - obj-y += e820.o --obj-y += gcc.o - obj-y += init_helpers.o - obj-y += interrupts.o - obj-y += lpc-uclass.o -@@ -49,12 +48,7 @@ endif - obj-$(CONFIG_HAVE_FSP) += fsp/ - obj-$(CONFIG_SPL_BUILD) += spl.o - --extra-$(CONFIG_USE_PRIVATE_LIBGCC) += lib.a -- --NORMAL_LIBGCC = $(shell $(CC) $(PLATFORM_CPPFLAGS) -print-libgcc-file-name) --OBJCOPYFLAGS := --prefix-symbols=__normal_ --$(obj)/lib.a: $(NORMAL_LIBGCC) FORCE -- $(call if_changed,objcopy) -+lib-$(CONFIG_USE_PRIVATE_LIBGCC) += div64.o - - ifeq ($(CONFIG_$(SPL_)X86_64),) - obj-$(CONFIG_EFI_APP) += crt0_ia32_efi.o reloc_ia32_efi.o -diff --git a/arch/x86/lib/div64.c b/arch/x86/lib/div64.c -new file mode 100644 -index 0000000..4efed74 ---- /dev/null -+++ b/arch/x86/lib/div64.c -@@ -0,0 +1,113 @@ -+/* -+ * This file is copied from the coreboot repository as part of -+ * the libpayload project: -+ * -+ * Copyright 2014 Google Inc. -+ * -+ * SPDX-License-Identifier: BSD-3-Clause -+ */ -+ -+#include -+ -+union overlay64 { -+ u64 longw; -+ struct { -+ u32 lower; -+ u32 higher; -+ } words; -+}; -+ -+u64 __ashldi3(u64 num, unsigned int shift) -+{ -+ union overlay64 output; -+ -+ output.longw = num; -+ if (shift >= 32) { -+ output.words.higher = output.words.lower << (shift - 32); -+ output.words.lower = 0; -+ } else { -+ if (!shift) -+ return num; -+ output.words.higher = (output.words.higher << shift) | -+ (output.words.lower >> (32 - shift)); -+ output.words.lower = output.words.lower << shift; -+ } -+ return output.longw; -+} -+ -+u64 __lshrdi3(u64 num, unsigned int shift) -+{ -+ union overlay64 output; -+ -+ output.longw = num; -+ if (shift >= 32) { -+ output.words.lower = output.words.higher >> (shift - 32); -+ output.words.higher = 0; -+ } else { -+ if (!shift) -+ return num; -+ output.words.lower = output.words.lower >> shift | -+ (output.words.higher << (32 - shift)); -+ output.words.higher = output.words.higher >> shift; -+ } -+ return output.longw; -+} -+ -+#define MAX_32BIT_UINT ((((u64)1) << 32) - 1) -+ -+static u64 _64bit_divide(u64 dividend, u64 divider, u64 *rem_p) -+{ -+ u64 result = 0; -+ -+ /* -+ * If divider is zero - let the rest of the system care about the -+ * exception. -+ */ -+ if (!divider) -+ return 1 / (u32)divider; -+ -+ /* As an optimization, let's not use 64 bit division unless we must. */ -+ if (dividend <= MAX_32BIT_UINT) { -+ if (divider > MAX_32BIT_UINT) { -+ result = 0; -+ if (rem_p) -+ *rem_p = divider; -+ } else { -+ result = (u32)dividend / (u32)divider; -+ if (rem_p) -+ *rem_p = (u32)dividend % (u32)divider; -+ } -+ return result; -+ } -+ -+ while (divider <= dividend) { -+ u64 locald = divider; -+ u64 limit = __lshrdi3(dividend, 1); -+ int shifts = 0; -+ -+ while (locald <= limit) { -+ shifts++; -+ locald = locald + locald; -+ } -+ result |= __ashldi3(1, shifts); -+ dividend -= locald; -+ } -+ -+ if (rem_p) -+ *rem_p = dividend; -+ -+ return result; -+} -+ -+u64 __udivdi3(u64 num, u64 den) -+{ -+ return _64bit_divide(num, den, NULL); -+} -+ -+u64 __umoddi3(u64 num, u64 den) -+{ -+ u64 v = 0; -+ -+ _64bit_divide(num, den, &v); -+ return v; -+} -diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c -deleted file mode 100644 -index 3c70d79..0000000 ---- a/arch/x86/lib/gcc.c -+++ /dev/null -@@ -1,29 +0,0 @@ --/* -- * This file is part of the coreboot project. -- * -- * Copyright (C) 2009 coresystems GmbH -- * -- * SPDX-License-Identifier: GPL-2.0 -- */ -- --#ifdef __GNUC__ -- --/* -- * GCC's libgcc handling is quite broken. While the libgcc functions -- * are always regparm(0) the code that calls them uses whatever the -- * compiler call specifies. Therefore we need a wrapper around those -- * functions. See gcc bug PR41055 for more information. -- */ --#define WRAP_LIBGCC_CALL(type, name) \ -- type __normal_##name(type a, type b) __attribute__((regparm(0))); \ -- type __wrap_##name(type a, type b); \ -- type __attribute__((no_instrument_function)) \ -- __wrap_##name(type a, type b) \ -- { return __normal_##name(a, b); } -- --WRAP_LIBGCC_CALL(long long, __divdi3) --WRAP_LIBGCC_CALL(unsigned long long, __udivdi3) --WRAP_LIBGCC_CALL(long long, __moddi3) --WRAP_LIBGCC_CALL(unsigned long long, __umoddi3) -- --#endif --- -2.7.4 - diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend deleted file mode 100644 index f56f565..0000000 --- a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2017.09.bbappend +++ /dev/null @@ -1,15 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -DEPENDS += "swig-native" - -SRC_URI +=" \ - file://0001-x86-lib-Implement-standalone-__udivdi3-etc-instead-o.patch \ - file://0001-Set-up-environment-for-OSTree-integration.patch \ - file://0001-Move-Cache-As-RAM-memory-from-area-mapped-to-ROM-in-.patch \ - " - - -do_compile_prepend() { - export BUILD_ROM=y -} -UBOOT_SUFFIX = "rom" diff --git a/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2018.01.bbappend b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2018.01.bbappend new file mode 100644 index 0000000..5b18ddb --- /dev/null +++ b/meta-sota-qemux86-64/recipes-bsp/u-boot/u-boot_2018.01.bbappend @@ -0,0 +1,13 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +DEPENDS += "swig-native" + +SRC_URI +=" \ + file://0001-Set-up-environment-for-OSTree-integration.patch \ + " + + +do_compile_prepend() { + export BUILD_ROM=y +} +UBOOT_SUFFIX = "rom" -- cgit v1.2.3-54-g00ecf From 408f130bda99b6628f07baded595346f6ac7eabd Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Thu, 17 May 2018 11:38:56 +0200 Subject: Set layer compability version to sumo --- meta-sota-qemux86-64/conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-sota-qemux86-64/conf/layer.conf b/meta-sota-qemux86-64/conf/layer.conf index a682a40..4043a8a 100644 --- a/meta-sota-qemux86-64/conf/layer.conf +++ b/meta-sota-qemux86-64/conf/layer.conf @@ -8,4 +8,4 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ BBFILE_COLLECTIONS += "updater-qemux86-64" BBFILE_PATTERN_updater-qemux86-64 = "^${LAYERDIR}/" BBFILE_PRIORITY_updater-qemux86-64 = "7" - +LAYERSERIES_COMPAT_updater-qemux86-64 = "sumo" -- cgit v1.2.3-54-g00ecf From 496bb502458ff1f209732e91112a2ce887e34887 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Thu, 17 May 2018 15:24:50 +0200 Subject: Set layer compatibility version to sumo --- meta-sota-raspberrypi/conf/layer.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-sota-raspberrypi/conf/layer.conf b/meta-sota-raspberrypi/conf/layer.conf index c2c3542..29e9a6c 100644 --- a/meta-sota-raspberrypi/conf/layer.conf +++ b/meta-sota-raspberrypi/conf/layer.conf @@ -9,3 +9,4 @@ BBFILE_COLLECTIONS += "updater-raspberrypi" BBFILE_PATTERN_updater-raspberrypi = "^${LAYERDIR}/" BBFILE_PRIORITY_updater-raspberrypi = "7" +LAYERSERIES_COMPAT_updater-raspberrypi = "sumo" -- cgit v1.2.3-54-g00ecf From 386dd637903de2f747512477dabf7a5278ebba41 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Fri, 18 May 2018 14:28:57 +0200 Subject: Remove u-boot support for minnowboard Was already broken --- .../recipes-bsp/bootfiles/files/uEnv-ota.txt | 17 --- .../recipes-bsp/bootfiles/minnowboard-bootfiles.bb | 25 ---- ...-Load-environment-from-the-boot-partition.patch | 24 ---- ...ps-with-built-in-code-to-remove-dependenc.patch | 142 --------------------- .../recipes-bsp/u-boot/u-boot-ota_2016.11.bb | 36 ------ 5 files changed, 244 deletions(-) delete mode 100644 meta-sota-minnowboard/recipes-bsp/bootfiles/files/uEnv-ota.txt delete mode 100644 meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-bootfiles.bb delete mode 100644 meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0001-Load-environment-from-the-boot-partition.patch delete mode 100644 meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch delete mode 100644 meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb diff --git a/meta-sota-minnowboard/recipes-bsp/bootfiles/files/uEnv-ota.txt b/meta-sota-minnowboard/recipes-bsp/bootfiles/files/uEnv-ota.txt deleted file mode 100644 index 2b0f293..0000000 --- a/meta-sota-minnowboard/recipes-bsp/bootfiles/files/uEnv-ota.txt +++ /dev/null @@ -1,17 +0,0 @@ -bootkaddr=0x01000000 -bootiaddr=0x04000000 - -bootargs_console=console=ttyS0,115200 -bootargs_extra=rw rootfstype=ext4 rootwait rootdelay=2 - -bootargs_root=ostree_root=/dev/mmcblk0p2 root=/dev/ram0 ramdisk_size=16384 - -bootmmc=1:2 - -booteload_sd=ext4load mmc ${bootmmc} ${bootkaddr} boot/loader/uEnv.txt; env import -t ${bootkaddr} ${filesize} - -bootkload_sd=ext4load mmc ${bootmmc} ${bootkaddr} boot/${kernel_image} -bootiload_sd=ext4load mmc ${bootmmc} ${bootiaddr} boot/${ramdisk_image} - -bootcmd=run booteload_sd; setenv bootargs ${bootargs} ${bootargs_console} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; zboot ${bootkaddr} - ${bootiaddr} ${filesize} - diff --git a/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-bootfiles.bb b/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-bootfiles.bb deleted file mode 100644 index 74d1f18..0000000 --- a/meta-sota-minnowboard/recipes-bsp/bootfiles/minnowboard-bootfiles.bb +++ /dev/null @@ -1,25 +0,0 @@ -DESCRIPTION = "Boot files (bootscripts etc.) for Minnowboard Max/Turbot" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -inherit deploy - -COMPATIBLE_MACHINE = "intel-corei7-64" - -S = "${WORKDIR}" - -SRC_URI_append_sota = "file://uEnv-ota.txt" - -do_deploy() { - install -d ${DEPLOYDIR}/${PN} -} - -do_deploy_append_sota() { - install -m 0755 ${WORKDIR}/uEnv-ota.txt ${DEPLOYDIR}/${PN}/uEnv.txt -} - -addtask deploy before do_package after do_install -do_deploy[dirs] += "${DEPLOYDIR}/${PN}" - -PACKAGE_ARCH = "${MACHINE_ARCH}" - diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0001-Load-environment-from-the-boot-partition.patch b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0001-Load-environment-from-the-boot-partition.patch deleted file mode 100644 index 02d0e4c..0000000 --- a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0001-Load-environment-from-the-boot-partition.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0161adf28590d95eaf234acc97156bc7dd989c8c Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov -Date: Wed, 28 Dec 2016 16:53:35 +0100 -Subject: [PATCH] Load environment from the boot partition - ---- - include/configs/minnowmax.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/include/configs/minnowmax.h b/include/configs/minnowmax.h -index 3aa22d2..02f6980 100644 ---- a/include/configs/minnowmax.h -+++ b/include/configs/minnowmax.h -@@ -41,4 +41,7 @@ - #define CONFIG_ENV_SECT_SIZE 0x1000 - #define CONFIG_ENV_OFFSET 0x006ef000 - -+#undef CONFIG_BOOTCOMMAND -+#define CONFIG_BOOTCOMMAND "fatload mmc 1:1 0x01000000 uEnv.txt; env import -t 0x01000000 ${filesize}; run bootcmd" -+ - #endif /* __CONFIG_H */ --- -2.9.3 - diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch deleted file mode 100644 index f1fcd06..0000000 --- a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch +++ /dev/null @@ -1,142 +0,0 @@ -From ab0d7e270d89f6eb99582197d2d58bf60c9c3d26 Mon Sep 17 00:00:00 2001 -From: Anton Gerasimov -Date: Thu, 15 Sep 2016 16:49:32 +0200 -Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on - multilib - ---- - arch/x86/config.mk | 3 --- - arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++--------- - 2 files changed, 87 insertions(+), 20 deletions(-) - -diff --git a/arch/x86/config.mk b/arch/x86/config.mk -index d7addd8..892e0fc 100644 ---- a/arch/x86/config.mk -+++ b/arch/x86/config.mk -@@ -21,9 +21,6 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden - - PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions -m elf_i386 - --LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 --LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 -- - # This is used in the top-level Makefile which does not include - # PLATFORM_LDFLAGS - LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined -diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c -index 497ad75..c321b11 100644 ---- a/arch/x86/lib/gcc.c -+++ b/arch/x86/lib/gcc.c -@@ -19,22 +19,92 @@ - - #ifdef __GNUC__ - --/* -- * GCC's libgcc handling is quite broken. While the libgcc functions -- * are always regparm(0) the code that calls them uses whatever the -- * compiler call specifies. Therefore we need a wrapper around those -- * functions. See gcc bug PR41055 for more information. -- */ --#define WRAP_LIBGCC_CALL(type, name) \ -- type __normal_##name(type a, type b) __attribute__((regparm(0))); \ -- type __wrap_##name(type a, type b); \ -- type __attribute__((no_instrument_function)) \ -- __wrap_##name(type a, type b) \ -- { return __normal_##name(a, b); } -- --WRAP_LIBGCC_CALL(long long, __divdi3) --WRAP_LIBGCC_CALL(unsigned long long, __udivdi3) --WRAP_LIBGCC_CALL(long long, __moddi3) --WRAP_LIBGCC_CALL(unsigned long long, __umoddi3) -+#include -+#include -+ -+uint64_t __udivmoddi4 ( uint64_t num, -+ uint64_t den, -+ uint64_t *rem_p ) -+{ -+ uint64_t quot = 0, qbit = 1; -+ -+ if ( den == 0 ) { -+ return 1/((unsigned)den); /* Intentional divide by zero, without -+ triggering a compiler warning which -+ would abort the build */ -+ } -+ -+ /* Left-justify denominator and count shift */ -+ while ( (int64_t)den >= 0 ) { -+ den <<= 1; -+ qbit <<= 1; -+ } -+ -+ while ( qbit ) { -+ if ( den <= num ) { -+ num -= den; -+ quot += qbit; -+ } -+ den >>= 1; -+ qbit >>= 1; -+ } -+ -+ if ( rem_p ) -+ *rem_p = num; -+ -+ return quot; -+} -+uint64_t __udivdi3( uint64_t num, uint64_t den ) -+{ -+ return __udivmoddi4(num, den, NULL); -+} -+ -+uint64_t __umoddi3 ( uint64_t num, uint64_t den ) -+{ -+ uint64_t v; -+ -+ (void) __udivmoddi4(num, den, &v); -+ return v; -+} -+ -+int64_t __divmoddi4 ( int64_t num, -+ int64_t den, -+ int64_t* rem_p ) -+{ -+ int minus = 0; -+ int64_t v; -+ -+ if ( num < 0 ) { -+ num = -num; -+ minus = 1; -+ } -+ if ( den < 0 ) { -+ den = -den; -+ minus ^= 1; -+ } -+ -+ v = __udivmoddi4(num, den, (uint64_t *)rem_p); -+ if ( minus ) { -+ v = -v; -+ if ( rem_p ) -+ *rem_p = -(*rem_p); -+ } -+ -+ return v; -+} -+ -+ -+int64_t __moddi3 (int64_t num, int64_t den) -+{ -+ int64_t v; -+ -+ (void) __divmoddi4(num, den, &v); -+ return v; -+} -+ -+int64_t __divdi3(int64_t num, int64_t den) -+{ -+ return __divmoddi4(num, den, NULL); -+} - - #endif --- -2.9.3 - diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb deleted file mode 100644 index c0603f0..0000000 --- a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2016.11.bb +++ /dev/null @@ -1,36 +0,0 @@ -include recipes-bsp/u-boot/u-boot.inc -DEPENDS += "dtc-native intel-fsp-native iasl-native" - -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6" - -# This revision corresponds to the tag "v2016.11" -# We use the revision in order to avoid having to fetch it from the -# repo during parse -SRCREV = "29e0cfb4f77f7aa369136302cee14a91e22dca71" - -SRC_URI += "file://0001-Load-environment-from-the-boot-partition.patch \ - file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \ - http://firmware.intel.com/sites/default/files/MinnowBoard.MAX_.X64.92.R01.zip \ - " - -# Hashes for MinnowBoard.MAX_.X64.92.R01.zip -SRC_URI[md5sum] = "236070e3d0fb193e03a102939822cf59" -SRC_URI[sha256sum] = "708f00d835cc9c49df4e937ef59852ccb6b95026291ac9779b5411dd09baed1f" - -PV = "v2016.11+git${SRCPV}" - -EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline BUILD_ROM=y" - -UBOOT_SUFFIX = "rom" - -do_configure_prepend() { - make ${UBOOT_MACHINE} - make tools - ./tools/ifdtool -x ${WORKDIR}/MNW2MAX1.X64.0092.R01.1605221712.bin - cp flashregion_0_flashdescriptor.bin ./board/intel/minnowmax/descriptor.bin - cp flashregion_2_intel_me.bin ./board/intel/minnowmax/me.bin - cp ${STAGING_DIR_NATIVE}/${datadir}/IntelFsp/BayTrailFSP.fd ./board/intel/minnowmax/fsp.bin - cp ${STAGING_DIR_NATIVE}/${datadir}/IntelFsp/Vga.dat ./board/intel/minnowmax/vga.bin -} - -- cgit v1.2.3-54-g00ecf From 0e8740e2e366d1fac7ca8d0bd4f0a4cdd00fc14d Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Fri, 18 May 2018 13:57:52 +0200 Subject: Remove reference to non-existing yocto layer --- meta-sota-minnowboard/conf/bblayers.conf.sample | 1 - 1 file changed, 1 deletion(-) diff --git a/meta-sota-minnowboard/conf/bblayers.conf.sample b/meta-sota-minnowboard/conf/bblayers.conf.sample index 89f0d2a..2ebec01 100644 --- a/meta-sota-minnowboard/conf/bblayers.conf.sample +++ b/meta-sota-minnowboard/conf/bblayers.conf.sample @@ -11,7 +11,6 @@ BBLAYERS ?= " \ ##OEROOT##/meta-yocto-bsp \ ##OEROOT##/../meta-raspberrypi \ ##OEROOT##/../meta-updater \ - ##OEROOT##/../meta-updater-minnowmax \ ##OEROOT##/../meta-openembedded/meta-oe \ ##OEROOT##/../meta-openembedded/meta-filesystems \ " -- cgit v1.2.3-54-g00ecf From 55fb80ff35d9b81593879924413b21a99011aed6 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Fri, 18 May 2018 14:15:33 +0200 Subject: Set layer compatibility to sumo --- meta-sota-minnowboard/conf/layer.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-sota-minnowboard/conf/layer.conf b/meta-sota-minnowboard/conf/layer.conf index 12b542c..b9fef34 100644 --- a/meta-sota-minnowboard/conf/layer.conf +++ b/meta-sota-minnowboard/conf/layer.conf @@ -9,3 +9,4 @@ BBFILE_COLLECTIONS += "updater-minnowboard" BBFILE_PATTERN_updater-minnowboard = "^${LAYERDIR}/" BBFILE_PRIORITY_updater-minnowboard = "7" +LAYERSERIES_COMPAT_updater-minnowboard = "sumo" -- cgit v1.2.3-54-g00ecf From eac1c63b0c78686766be1c70e3561d2233ec491b Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Tue, 22 May 2018 11:33:59 +0200 Subject: Rename sota-qemux86-64 layer --- meta-sota-qemux86-64/conf/layer.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta-sota-qemux86-64/conf/layer.conf b/meta-sota-qemux86-64/conf/layer.conf index 4043a8a..9bc1969 100644 --- a/meta-sota-qemux86-64/conf/layer.conf +++ b/meta-sota-qemux86-64/conf/layer.conf @@ -5,7 +5,7 @@ BBPATH =. "${LAYERDIR}:" BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/recipes-*/*/*.bbappend" -BBFILE_COLLECTIONS += "updater-qemux86-64" -BBFILE_PATTERN_updater-qemux86-64 = "^${LAYERDIR}/" -BBFILE_PRIORITY_updater-qemux86-64 = "7" -LAYERSERIES_COMPAT_updater-qemux86-64 = "sumo" +BBFILE_COLLECTIONS += "sota-qemux86-64" +BBFILE_PATTERN_sota-qemux86-64 = "^${LAYERDIR}/" +BBFILE_PRIORITY_sota-qemux86-64 = "7" +LAYERSERIES_COMPAT_sota-qemux86-64 = "sumo" -- cgit v1.2.3-54-g00ecf From fb1374e53f0d745a3cc4e7efbac7ab24f1a21499 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Tue, 22 May 2018 11:33:59 +0200 Subject: Rename sota-raspberrypi layer --- meta-sota-raspberrypi/conf/layer.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta-sota-raspberrypi/conf/layer.conf b/meta-sota-raspberrypi/conf/layer.conf index 29e9a6c..d2a0ce4 100644 --- a/meta-sota-raspberrypi/conf/layer.conf +++ b/meta-sota-raspberrypi/conf/layer.conf @@ -5,8 +5,8 @@ BBPATH =. "${LAYERDIR}:" BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/recipes-*/*/*.bbappend" -BBFILE_COLLECTIONS += "updater-raspberrypi" -BBFILE_PATTERN_updater-raspberrypi = "^${LAYERDIR}/" -BBFILE_PRIORITY_updater-raspberrypi = "7" +BBFILE_COLLECTIONS += "sota-raspberrypi" +BBFILE_PATTERN_sota-raspberrypi = "^${LAYERDIR}/" +BBFILE_PRIORITY_sota-raspberrypi = "7" -LAYERSERIES_COMPAT_updater-raspberrypi = "sumo" +LAYERSERIES_COMPAT_sota-raspberrypi = "sumo" -- cgit v1.2.3-54-g00ecf From 20cb4b9a4514b84554d0a828939e0a74849f378c Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Tue, 22 May 2018 11:33:59 +0200 Subject: Rename sota-minnowboard layer --- meta-sota-minnowboard/conf/layer.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta-sota-minnowboard/conf/layer.conf b/meta-sota-minnowboard/conf/layer.conf index b9fef34..3441582 100644 --- a/meta-sota-minnowboard/conf/layer.conf +++ b/meta-sota-minnowboard/conf/layer.conf @@ -5,8 +5,8 @@ BBPATH =. "${LAYERDIR}:" BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/recipes-*/*/*.bbappend" -BBFILE_COLLECTIONS += "updater-minnowboard" -BBFILE_PATTERN_updater-minnowboard = "^${LAYERDIR}/" -BBFILE_PRIORITY_updater-minnowboard = "7" +BBFILE_COLLECTIONS += "sota-minnowboard" +BBFILE_PATTERN_sota-minnowboard = "^${LAYERDIR}/" +BBFILE_PRIORITY_sota-minnowboard = "7" -LAYERSERIES_COMPAT_updater-minnowboard = "sumo" +LAYERSERIES_COMPAT_sota-minnowboard = "sumo" -- cgit v1.2.3-54-g00ecf