From 712c376857dd029d1df9ea7ca14e14163b9ff61f Mon Sep 17 00:00:00 2001 From: Justin Schneck Date: Tue, 1 Nov 2022 10:14:08 -0400 Subject: [PATCH] v0.1.0 --- .circleci/config.yml | 42 ++ .formatter.exs | 4 + .gitignore | 22 + CHANGELOG.md | 17 + Config.in | 1 + LICENSE | 201 +++++++ README.md | 1 + VERSION | 1 + fwup-revert.conf | 155 ++++++ fwup.conf | 376 +++++++++++++ fwup_include/provisioning.conf | 6 + ...uitous-and-regulatory_hint_user_supp.patch | 165 ++++++ linux/0002-wpa3_external_auth_support.patch | 39 ++ ...ros-to-indicate-backport-support-for.patch | 37 ++ ...-backing_dev_info-in-order-to-disabl.patch | 121 +++++ linux/linux-5.10.defconfig | 508 ++++++++++++++++++ mix.exs | 140 +++++ mix.lock | 15 + nerves_defconfig | 78 +++ ...upplicant-Wifi-Cert-P2P-TC-5.1.9-Fix.patch | 82 +++ post-build.sh | 11 + post-createfs.sh | 8 + rootfs_overlay/etc/boardid.config | 16 + rootfs_overlay/etc/erlinit.config | 73 +++ rootfs_overlay/etc/fw_env.config | 6 + rootfs_overlay/mnt/boot/.empty | 0 uboot/uboot.defconfig | 68 +++ uboot/uboot.env | 145 +++++ 28 files changed, 2338 insertions(+) create mode 100644 .circleci/config.yml create mode 100644 .formatter.exs create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 Config.in create mode 100644 LICENSE create mode 100644 README.md create mode 100644 VERSION create mode 100644 fwup-revert.conf create mode 100644 fwup.conf create mode 100644 fwup_include/provisioning.conf create mode 100755 linux/0001-cfg80211_is_gratuitous-and-regulatory_hint_user_supp.patch create mode 100755 linux/0002-wpa3_external_auth_support.patch create mode 100755 linux/0003-cfg80211-Add-macros-to-indicate-backport-support-for.patch create mode 100644 linux/0003-squashfs-provide-backing_dev_info-in-order-to-disabl.patch create mode 100644 linux/linux-5.10.defconfig create mode 100644 mix.exs create mode 100644 mix.lock create mode 100644 nerves_defconfig create mode 100644 patches/wpa_supplicant/wpa_supplicant-Wifi-Cert-P2P-TC-5.1.9-Fix.patch create mode 100755 post-build.sh create mode 100755 post-createfs.sh create mode 100644 rootfs_overlay/etc/boardid.config create mode 100644 rootfs_overlay/etc/erlinit.config create mode 100644 rootfs_overlay/etc/fw_env.config create mode 100644 rootfs_overlay/mnt/boot/.empty create mode 100644 uboot/uboot.defconfig create mode 100644 uboot/uboot.env diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..2cd90b3 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,42 @@ +exec: &exec + name: build-tools/nerves-system-br + version: 1.21.1 + elixir: 1.14.0-otp-25 + +version: 2.1 + +orbs: + build-tools: nerves-project/build-tools@0.2.2 + +workflows: + version: 2 + build_test_deploy: + jobs: + - build-tools/get-br-dependencies: + exec: + <<: *exec + context: org-global + filters: + tags: + only: /.*/ + - build-tools/build-system: + exec: + <<: *exec + resource-class: large + context: org-global + requires: + - build-tools/get-br-dependencies + filters: + tags: + only: /.*/ + - build-tools/deploy-system: + exec: + <<: *exec + context: org-global + requires: + - build-tools/build-system + filters: + branches: + ignore: /.*/ + tags: + only: /v.*/ diff --git a/.formatter.exs b/.formatter.exs new file mode 100644 index 0000000..525446d --- /dev/null +++ b/.formatter.exs @@ -0,0 +1,4 @@ +# Used by "mix format" +[ + inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"] +] diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a1fe8f --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# The directory Mix will write compiled artifacts to. +/_build/ + +# If you run "mix test --cover", coverage assets end up here. +/cover/ + +# The directory Mix downloads your dependencies sources to. +/deps/ + +# Where 3rd-party dependencies like ExDoc output generated docs. +/doc/ + +# Ignore .fetch files in case you like to edit your project deps locally. +/.fetch + +# If the VM crashes, it generates a dump, let's ignore it too. +erl_crash.dump + +# Ignore our generated files +/build.log +/archive.log +/.nerves diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4c7a582 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +This project does NOT follow semantic versioning. The version increases as +follows: + +1. Major version updates are breaking updates to the build infrastructure. + These should be very rare. +2. Minor version updates are made for every major Buildroot release. This + may also include Erlang/OTP and Linux kernel updates. These are made four + times a year shortly after the Buildroot releases. +3. Patch version updates are made for Buildroot minor releases, Erlang/OTP + releases, and Linux kernel updates. They're also made to fix bugs and add + features to the build infrastructure. + +## v0.1.0 + +Initial Release diff --git a/Config.in b/Config.in new file mode 100644 index 0000000..2db3eb0 --- /dev/null +++ b/Config.in @@ -0,0 +1 @@ +# Add project-specific packages for Buildroot here diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5e0fd33 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, patent, trademark, and +attribution notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE text file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "{}" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + +Copyright {yyyy} {name of copyright owner} + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..f48c70c --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# iMX6ULL EVK Support diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/fwup-revert.conf b/fwup-revert.conf new file mode 100644 index 0000000..301a394 --- /dev/null +++ b/fwup-revert.conf @@ -0,0 +1,155 @@ +# Revert firmware on the Beaglebone Black +# +# To use: +# 1. Run `fwup -c -f fwup-revert.conf -o revert.fw` and copy revert.fw to +# the device. This is done automatically as part of the Nerves system +# build process. The file is stored in `/usr/share/fwup/revert.fw`. +# 2. On the device, run `fwup -t revert revert.fw -d $NERVES_FW_DEVPATH`. If +# it succeeds, reboot. If not, then it's possible that there isn't a previous +# firmware or the metadata about what's stored where is corrupt or out of +# sync. +# +# It is critical that this is kept in sync with the main fwup.conf. + +require-fwup-version="1.0.0" + +# +# Firmware metadata +# + +# All of these can be overriden using environment variables of the same name. +# +# Run 'fwup -m' to query values in a .fw file. +# Use 'fw_printenv' to query values on the target. +# +# These are used by Nerves libraries to introspect. +define(NERVES_FW_PRODUCT, "Nerves Firmware") +define(NERVES_FW_DESCRIPTION, "") +define(NERVES_FW_VERSION, "${NERVES_SDK_VERSION}") +define(NERVES_FW_PLATFORM, "nerves_imx6ull_EVK") +define(NERVES_FW_ARCHITECTURE, "arm") +define(NERVES_FW_AUTHOR, "Very") + +# This configuration file will create an image that +# has an MBR and the following layout: +# +# +----------------------------+ +# | MBR | +# +----------------------------+ +# | u-boot-dtb.imx | +# +----------------------------+ +# | U-Boot environment | +# +----------------------------+ +# | p0: Boot partition (FAT32) | +# | zImage.a | +# | zImage.b | +# +----------------------------+ +# | p1: Rootfs A (squashfs) | +# +----------------------------+ +# | p2: Rootfs B (squashfs) | +# +----------------------------+ +# | p3: Application (f2fs) | +# +----------------------------+ + +# The U-Boot environment is written directly to the SDCard/eMMC. It is not +# in any partition +define(UBOOT_ENV_OFFSET, 1792) +define(UBOOT_ENV_COUNT, 256) # 128 KB + +# Firmware archive metadata +meta-product = ${NERVES_FW_PRODUCT} +meta-description = ${NERVES_FW_DESCRIPTION} +meta-version = ${NERVES_FW_VERSION} +meta-platform = ${NERVES_FW_PLATFORM} +meta-architecture = ${NERVES_FW_ARCHITECTURE} +meta-author = ${NERVES_FW_AUTHOR} +meta-vcs-identifier = ${NERVES_FW_VCS_IDENTIFIER} +meta-misc = ${NERVES_FW_MISC} + +# Location where installed firmware information is stored. +uboot-environment uboot-env { + block-offset = ${UBOOT_ENV_OFFSET} + block-count = ${UBOOT_ENV_COUNT} +} + +task revert.a { + # This task reverts to the A partition, so check that we're running on B + require-uboot-variable(uboot-env, "nerves_fw_active", "b") + + # Verify that partition A has the expected platform/architecture + require-uboot-variable(uboot-env, "a.nerves_fw_platform", "${NERVES_FW_PLATFORM}") + require-uboot-variable(uboot-env, "a.nerves_fw_architecture", "${NERVES_FW_ARCHITECTURE}") + + on-init { + info("Reverting to partition A") + + # Switch over + uboot_setenv(uboot-env, "nerves_fw_active", "a") + uboot_setenv(uboot-env, "nerves_fw_validated", "1") + } +} + +task revert.b { + # This task reverts to the B partition, so check that we're running on A + require-uboot-variable(uboot-env, "nerves_fw_active", "a") + + # Verify that partition B has the expected platform/architecture + require-uboot-variable(uboot-env, "b.nerves_fw_platform", "${NERVES_FW_PLATFORM}") + require-uboot-variable(uboot-env, "b.nerves_fw_architecture", "${NERVES_FW_ARCHITECTURE}") + + on-init { + info("Reverting to partition B") + + # Switch over + uboot_setenv(uboot-env, "nerves_fw_active", "b") + uboot_setenv(uboot-env, "nerves_fw_validated", "1") + } +} + +task revert.unexpected.a { + require-uboot-variable(uboot-env, "a.nerves_fw_platform", "${NERVES_FW_PLATFORM}") + require-uboot-variable(uboot-env, "a.nerves_fw_architecture", "${NERVES_FW_ARCHITECTURE}") + on-init { + # Case where A is good, and the desire is to go to B. + error("It doesn't look like there's anything to revert to in partition B.") + } +} +task revert.unexpected.b { + require-uboot-variable(uboot-env, "b.nerves_fw_platform", "${NERVES_FW_PLATFORM}") + require-uboot-variable(uboot-env, "b.nerves_fw_architecture", "${NERVES_FW_ARCHITECTURE}") + on-init { + # Case where B is good, and the desire is to go to A. + error("It doesn't look like there's anything to revert to in partition A.") + } +} + +task revert.wrongplatform { + on-init { + error("Expecting platform=${NERVES_FW_PLATFORM} and architecture=${NERVES_FW_ARCHITECTURE}") + } +} + +# Run "fwup /usr/share/fwup/revert.fw -t status -d /dev/mmcblk1 -q -U" to check the status. +task status.aa { + require-path-on-device("/", "/dev/mmcblk1p2") + require-uboot-variable(uboot-env, "nerves_fw_active", "a") + on-init { info("a") } +} +task status.ab { + require-path-on-device("/", "/dev/mmcblk1p2") + require-uboot-variable(uboot-env, "nerves_fw_active", "b") + on-init { info("a->b") } +} +task status.bb { + require-path-on-device("/", "/dev/mmcblk1p3") + require-uboot-variable(uboot-env, "nerves_fw_active", "b") + on-init { info("b") } +} +task status.ba { + require-path-on-device("/", "/dev/mmcblk1p3") + require-uboot-variable(uboot-env, "nerves_fw_active", "a") + on-init { info("b->a") } +} +task status.fail { + on-init { error("fail") } +} diff --git a/fwup.conf b/fwup.conf new file mode 100644 index 0000000..ec4ca10 --- /dev/null +++ b/fwup.conf @@ -0,0 +1,376 @@ +# Firmware configuration file for the i.MX6ULL EVK + +require-fwup-version="1.0.0" + +# +# Firmware metadata +# + +# All of these can be overriden using environment variables of the same name. +# +# Run 'fwup -m' to query values in a .fw file. +# Use 'fw_printenv' to query values on the target. +# +# These are used by Nerves libraries to introspect. +define(NERVES_FW_PRODUCT, "Nerves Firmware") +define(NERVES_FW_DESCRIPTION, "") +define(NERVES_FW_VERSION, "${NERVES_SDK_VERSION}") +define(NERVES_FW_PLATFORM, "nerves_imx6ull_evk") +define(NERVES_FW_ARCHITECTURE, "arm") +define(NERVES_FW_AUTHOR, "Very") + +define(NERVES_FW_DEVPATH, "/dev/mmcblk1") +define(NERVES_FW_APPLICATION_PART0_DEVPATH, "/dev/mmcblk1p4") # Linux part number is 1-based +define(NERVES_FW_APPLICATION_PART0_FSTYPE, "f2fs") +define(NERVES_FW_APPLICATION_PART0_TARGET, "/root") +define(NERVES_PROVISIONING, "${NERVES_SYSTEM}/images/fwup_include/provisioning.conf") + +# Default paths if not specified via the commandline +define(ROOTFS, "${NERVES_SYSTEM}/images/rootfs.squashfs") + +# This configuration file will create an image that +# has an MBR and the following layout: +# +# +----------------------------+ +# | MBR | +# +----------------------------+ +# | u-boot-dtb.imx | +# +----------------------------+ +# | U-Boot environment | +# +----------------------------+ +# | p0: Boot partition (FAT32) | +# | zImage.a | +# | zImage.b | +# +----------------------------+ +# | p1: Rootfs A (squashfs) | +# +----------------------------+ +# | p2: Rootfs B (squashfs) | +# +----------------------------+ +# | p3: Application (f2fs) | +# +----------------------------+ + +define(UBOOT_OFFSET, 2) +define(UBOOT_COUNT, 1790) # 895 KB (up to hardcoded U-Boot environment offset + +# The U-Boot environment is written directly to the SDCard/eMMC. It is not +# in any partition +define(UBOOT_ENV_OFFSET, 1792) +define(UBOOT_ENV_COUNT, 256) # 128 KB + +# The boot partition contains zImage and device tree files +define(BOOT_PART_OFFSET, 4096) +define(BOOT_PART_COUNT, 28672) + +# Let the rootfs have room to grow up to 140 MiB and align it to the nearest 1 +# MB boundary +define(ROOTFS_A_PART_OFFSET, 63488) +define(ROOTFS_A_PART_COUNT, 286720) +define-eval(ROOTFS_B_PART_OFFSET, "${ROOTFS_A_PART_OFFSET} + ${ROOTFS_A_PART_COUNT}") +define(ROOTFS_B_PART_COUNT, ${ROOTFS_A_PART_COUNT}) + +# Application partition. This partition can occupy all of the remaining space. +# Size it to fit the destination. +define-eval(APP_PART_OFFSET, "${ROOTFS_B_PART_OFFSET} + ${ROOTFS_B_PART_COUNT}") +define(APP_PART_COUNT, 1048576) + +# Firmware archive metadata +meta-product = ${NERVES_FW_PRODUCT} +meta-description = ${NERVES_FW_DESCRIPTION} +meta-version = ${NERVES_FW_VERSION} +meta-platform = ${NERVES_FW_PLATFORM} +meta-architecture = ${NERVES_FW_ARCHITECTURE} +meta-author = ${NERVES_FW_AUTHOR} +meta-vcs-identifier = ${NERVES_FW_VCS_IDENTIFIER} +meta-misc = ${NERVES_FW_MISC} + +# File resources are listed in the order that they are included in the .fw file +# This is important, since this is the order that they're written on a firmware +# update due to the event driven nature of the update system. +file-resource u-boot-dtb.imx { + host-path = "${NERVES_SYSTEM}/images/u-boot-dtb.imx" +} +file-resource uboot-env.bin { + host-path = "${NERVES_SYSTEM}/images/uboot-env.bin" +} +file-resource zImage { + host-path = "${NERVES_SYSTEM}/images/zImage" +} +file-resource imx6ull-14x14-evk.dtb { + host-path = "${NERVES_SYSTEM}/images/imx6ull-14x14-evk.dtb" +} +file-resource imx6ull-14x14-evk-emmc.dtb { + host-path = "${NERVES_SYSTEM}/images/imx6ull-14x14-evk-emmc.dtb" +} +file-resource imx6ull-14x14-evk-gpmi-weim.dtb { + host-path = "${NERVES_SYSTEM}/images/imx6ull-14x14-evk-gpmi-weim.dtb" +} +file-resource imx6ull-14x14-evk-btwifi.dtb { + host-path = "${NERVES_SYSTEM}/images/imx6ull-14x14-evk-btwifi.dtb" +} +file-resource imx6ull-14x14-evk-btwifi-oob.dtb { + host-path = "${NERVES_SYSTEM}/images/imx6ull-14x14-evk-btwifi-oob.dtb" +} +file-resource rootfs.img { + host-path = ${ROOTFS} + + # Error out if the rootfs size exceeds the partition size + assert-size-lte = ${ROOTFS_A_PART_COUNT} +} + +mbr mbr { + partition 0 { + block-offset = ${BOOT_PART_OFFSET} + block-count = ${BOOT_PART_COUNT} + type = 0xc # FAT32 + boot = true + } + partition 1 { + block-offset = ${ROOTFS_A_PART_OFFSET} + block-count = ${ROOTFS_A_PART_COUNT} + type = 0x83 # Linux + } + partition 2 { + block-offset = ${ROOTFS_B_PART_OFFSET} + block-count = ${ROOTFS_B_PART_COUNT} + type = 0x83 # Linux + } + partition 3 { + block-offset = ${APP_PART_OFFSET} + block-count = ${APP_PART_COUNT} + type = 0x83 # Linux + expand = true + } +} + +# Location where installed firmware information is stored. +uboot-environment uboot-env { + block-offset = ${UBOOT_ENV_OFFSET} + block-count = ${UBOOT_ENV_COUNT} +} + +# This firmware task writes everything to the destination media. +# This should only be run at the factory to initialize a board! +task complete { + # Only match if not mounted + require-unmounted-destination = true + + on-init { + mbr_write(mbr) + + fat_mkfs(${BOOT_PART_OFFSET}, ${BOOT_PART_COUNT}) + fat_setlabel(${BOOT_PART_OFFSET}, "BOOT") + } + + on-resource u-boot-dtb.imx { raw_write(${UBOOT_OFFSET}) } + on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage.a") } + + on-resource imx6ull-14x14-evk.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk.dtb") } + on-resource imx6ull-14x14-evk-emmc.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-emmc.dtb") } + on-resource imx6ull-14x14-evk-gpmi-weim.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-gpmi-weim.dtb") } + on-resource imx6ull-14x14-evk-btwifi.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-btwifi.dtb" ) } + on-resource imx6ull-14x14-evk-btwifi-oob.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-btwifi-oob.dtb" ) } + + on-resource uboot-env.bin { + # Boot to the A partition first and don't fail back. + # If this fails, we bricked the board with no recovery. + raw_write(${UBOOT_ENV_OFFSET}) + + # Include provisioning instructions + include("${NERVES_PROVISIONING}") + + # Add in the generic Nerves metadata variables. + uboot_setenv(uboot-env, "nerves_fw_active", "a") + uboot_setenv(uboot-env, "nerves_fw_devpath", ${NERVES_FW_DEVPATH}) + uboot_setenv(uboot-env, "a.nerves_fw_application_part0_devpath", ${NERVES_FW_APPLICATION_PART0_DEVPATH}) + uboot_setenv(uboot-env, "a.nerves_fw_application_part0_fstype", ${NERVES_FW_APPLICATION_PART0_FSTYPE}) + uboot_setenv(uboot-env, "a.nerves_fw_application_part0_target", ${NERVES_FW_APPLICATION_PART0_TARGET}) + uboot_setenv(uboot-env, "a.nerves_fw_product", ${NERVES_FW_PRODUCT}) + uboot_setenv(uboot-env, "a.nerves_fw_description", ${NERVES_FW_DESCRIPTION}) + uboot_setenv(uboot-env, "a.nerves_fw_version", ${NERVES_FW_VERSION}) + uboot_setenv(uboot-env, "a.nerves_fw_platform", ${NERVES_FW_PLATFORM}) + uboot_setenv(uboot-env, "a.nerves_fw_architecture", ${NERVES_FW_ARCHITECTURE}) + uboot_setenv(uboot-env, "a.nerves_fw_author", ${NERVES_FW_AUTHOR}) + uboot_setenv(uboot-env, "a.nerves_fw_vcs_identifier", ${NERVES_FW_VCS_IDENTIFIER}) + uboot_setenv(uboot-env, "a.nerves_fw_misc", ${NERVES_FW_MISC}) + uboot_setenv(uboot-env, "a.nerves_fw_uuid", "\${FWUP_META_UUID}") + } + on-resource rootfs.img { + # write to the first rootfs partition + raw_write(${ROOTFS_A_PART_OFFSET}) + } + + on-finish { + # Clear out any old data in the B partition that might be mistaken for + # a file system. This is mostly to avoid confusion in humans when + # reprogramming SDCards with unknown contents. + raw_memset(${ROOTFS_B_PART_OFFSET}, 256, 0xff) + + # Invalidate the application data partition so that it is guaranteed to + # trigger the corrupt filesystem detection code on first boot and get + # formatted. If this isn't done and an old SDCard is reused, the + # application data could be in a weird state. + raw_memset(${APP_PART_OFFSET}, 256, 0xff) + } +} + +task upgrade.a { + # This task upgrades the A partition + require-uboot-variable(uboot-env, "nerves_fw_active", "b") + + # Require that the running version of firmware has been validated. + # If it has not, then failing back is not guaranteed to work. + require-uboot-variable(uboot-env, "nerves_fw_validated", "1") + + # Verify the expected platform/architecture + require-uboot-variable(uboot-env, "b.nerves_fw_platform", "${NERVES_FW_PLATFORM}") + require-uboot-variable(uboot-env, "b.nerves_fw_architecture", "${NERVES_FW_ARCHITECTURE}") + + on-init { + info("Upgrading partition A") + + # Clear some firmware information just in case this update gets + # interrupted midway. If this partition was bootable, it's not going to + # be soon. + uboot_unsetenv(uboot-env, "a.nerves_fw_version") + uboot_unsetenv(uboot-env, "a.nerves_fw_platform") + uboot_unsetenv(uboot-env, "a.nerves_fw_architecture") + uboot_unsetenv(uboot-env, "a.nerves_fw_uuid") + + # Indicate that the entire partition can be cleared + trim(${ROOTFS_A_PART_OFFSET}, ${ROOTFS_A_PART_COUNT}) + } + + # Write the new firmware and Linux images, but don't + # commit them. That way if the user aborts midway, we + # still are using the original firmware. + on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage.a") } + on-resource imx6ull-14x14-evk.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk.dtb") } + on-resource imx6ull-14x14-evk-emmc.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-emmc.dtb") } + on-resource imx6ull-14x14-evk-gpmi-weim.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-gpmi-weim.dtb") } + on-resource imx6ull-14x14-evk-btwifi.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-btwifi.dtb" ) } + on-resource imx6ull-14x14-evk-btwifi-oob.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-btwifi-oob.dtb" ) } + on-resource rootfs.img { + delta-source-raw-offset=${ROOTFS_B_PART_OFFSET} + delta-source-raw-count=${ROOTFS_B_PART_COUNT} + raw_write(${ROOTFS_A_PART_OFFSET}) + } + + on-finish { + # Update firmware metadata + uboot_setenv(uboot-env, "a.nerves_fw_application_part0_devpath", ${NERVES_FW_APPLICATION_PART0_DEVPATH}) + uboot_setenv(uboot-env, "a.nerves_fw_application_part0_fstype", ${NERVES_FW_APPLICATION_PART0_FSTYPE}) + uboot_setenv(uboot-env, "a.nerves_fw_application_part0_target", ${NERVES_FW_APPLICATION_PART0_TARGET}) + uboot_setenv(uboot-env, "a.nerves_fw_product", ${NERVES_FW_PRODUCT}) + uboot_setenv(uboot-env, "a.nerves_fw_description", ${NERVES_FW_DESCRIPTION}) + uboot_setenv(uboot-env, "a.nerves_fw_version", ${NERVES_FW_VERSION}) + uboot_setenv(uboot-env, "a.nerves_fw_platform", ${NERVES_FW_PLATFORM}) + uboot_setenv(uboot-env, "a.nerves_fw_architecture", ${NERVES_FW_ARCHITECTURE}) + uboot_setenv(uboot-env, "a.nerves_fw_author", ${NERVES_FW_AUTHOR}) + uboot_setenv(uboot-env, "a.nerves_fw_vcs_identifier", ${NERVES_FW_VCS_IDENTIFIER}) + uboot_setenv(uboot-env, "a.nerves_fw_misc", ${NERVES_FW_MISC}) + uboot_setenv(uboot-env, "a.nerves_fw_uuid", "\${FWUP_META_UUID}") + + # Reset the validation status and boot to A + # next time. + uboot_setenv(uboot-env, "nerves_fw_active", "a") + uboot_setenv(uboot-env, "nerves_fw_validated", "0") + uboot_setenv(uboot-env, "nerves_fw_booted", "0") + } + + on-error { + } +} + +task upgrade.b { + # This task upgrades the B partition + require-uboot-variable(uboot-env, "nerves_fw_active", "a") + require-uboot-variable(uboot-env, "nerves_fw_validated", "1") + + # Verify the expected platform/architecture + require-uboot-variable(uboot-env, "a.nerves_fw_platform", "${NERVES_FW_PLATFORM}") + require-uboot-variable(uboot-env, "a.nerves_fw_architecture", "${NERVES_FW_ARCHITECTURE}") + + on-init { + info("Upgrading partition B") + + # Clear some firmware information just in case this update gets + # interrupted midway. + uboot_unsetenv(uboot-env, "b.nerves_fw_version") + uboot_unsetenv(uboot-env, "b.nerves_fw_platform") + uboot_unsetenv(uboot-env, "b.nerves_fw_architecture") + uboot_unsetenv(uboot-env, "b.nerves_fw_uuid") + + trim(${ROOTFS_B_PART_OFFSET}, ${ROOTFS_B_PART_COUNT}) + } + + on-resource zImage { fat_write(${BOOT_PART_OFFSET}, "zImage.b") } + on-resource imx6ull-14x14-evk.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk.dtb") } + on-resource imx6ull-14x14-evk-emmc.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-emmc.dtb") } + on-resource imx6ull-14x14-evk-gpmi-weim.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-gpmi-weim.dtb") } + on-resource imx6ull-14x14-evk-btwifi.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-btwifi.dtb" ) } + on-resource imx6ull-14x14-evk-btwifi-oob.dtb { fat_write(${BOOT_PART_OFFSET}, "imx6ull-14x14-evk-btwifi-oob.dtb" ) } + on-resource rootfs.img { + delta-source-raw-offset=${ROOTFS_A_PART_OFFSET} + delta-source-raw-count=${ROOTFS_A_PART_COUNT} + raw_write(${ROOTFS_B_PART_OFFSET}) + } + + on-finish { + # Update firmware metadata + uboot_setenv(uboot-env, "b.nerves_fw_application_part0_devpath", ${NERVES_FW_APPLICATION_PART0_DEVPATH}) + uboot_setenv(uboot-env, "b.nerves_fw_application_part0_fstype", ${NERVES_FW_APPLICATION_PART0_FSTYPE}) + uboot_setenv(uboot-env, "b.nerves_fw_application_part0_target", ${NERVES_FW_APPLICATION_PART0_TARGET}) + uboot_setenv(uboot-env, "b.nerves_fw_product", ${NERVES_FW_PRODUCT}) + uboot_setenv(uboot-env, "b.nerves_fw_description", ${NERVES_FW_DESCRIPTION}) + uboot_setenv(uboot-env, "b.nerves_fw_version", ${NERVES_FW_VERSION}) + uboot_setenv(uboot-env, "b.nerves_fw_platform", ${NERVES_FW_PLATFORM}) + uboot_setenv(uboot-env, "b.nerves_fw_architecture", ${NERVES_FW_ARCHITECTURE}) + uboot_setenv(uboot-env, "b.nerves_fw_author", ${NERVES_FW_AUTHOR}) + uboot_setenv(uboot-env, "b.nerves_fw_vcs_identifier", ${NERVES_FW_VCS_IDENTIFIER}) + uboot_setenv(uboot-env, "b.nerves_fw_misc", ${NERVES_FW_MISC}) + uboot_setenv(uboot-env, "b.nerves_fw_uuid", "\${FWUP_META_UUID}") + + # Reset the validation status and boot to B next time. + uboot_setenv(uboot-env, "nerves_fw_active", "b") + uboot_setenv(uboot-env, "nerves_fw_validated", "0") + uboot_setenv(uboot-env, "nerves_fw_booted", "0") + } + + on-error { + } +} + +task upgrade.unvalidated { + require-uboot-variable(uboot-env, "nerves_fw_validated", "0") + + on-init { + error("Please validate the running firmware before upgrading it again.") + } +} + +task upgrade.unexpected { + require-uboot-variable(uboot-env, "a.nerves_fw_platform", "${NERVES_FW_PLATFORM}") + require-uboot-variable(uboot-env, "a.nerves_fw_architecture", "${NERVES_FW_ARCHITECTURE}") + on-init { + error("Please check the media being upgraded. It doesn't look like either the A or B partitions are active.") + } +} + +task upgrade.wrongplatform { + on-init { + error("Expecting platform=${NERVES_FW_PLATFORM} and architecture=${NERVES_FW_ARCHITECTURE}") + } +} + +task provision { + require-uboot-variable(uboot-env, "a.nerves_fw_platform", "${NERVES_FW_PLATFORM}") + require-uboot-variable(uboot-env, "a.nerves_fw_architecture", "${NERVES_FW_ARCHITECTURE}") + on-init { + include("${NERVES_PROVISIONING}") + } +} +task provision.wrongplatform { + on-init { + error("Expecting platform=${NERVES_FW_PLATFORM} and architecture=${NERVES_FW_ARCHITECTURE}") + } +} diff --git a/fwup_include/provisioning.conf b/fwup_include/provisioning.conf new file mode 100644 index 0000000..5b029ed --- /dev/null +++ b/fwup_include/provisioning.conf @@ -0,0 +1,6 @@ +# Support setting device serial numbers when creating MicroSD cards. +# Note that the '$' is escaped so that environment variable replacement +# happens at "burn" time rather than at firmware creation time. No +# serial numbers are stored in the .fw file. If left blank, the device +# will default to a built-in ID. +uboot_setenv(uboot-env, "nerves_serial_number", "\${NERVES_SERIAL_NUMBER}") diff --git a/linux/0001-cfg80211_is_gratuitous-and-regulatory_hint_user_supp.patch b/linux/0001-cfg80211_is_gratuitous-and-regulatory_hint_user_supp.patch new file mode 100755 index 0000000..512086a --- /dev/null +++ b/linux/0001-cfg80211_is_gratuitous-and-regulatory_hint_user_supp.patch @@ -0,0 +1,165 @@ +From 4a9f6462c2ac8815b38cab07f52ea1e875a9e408 Mon Sep 17 00:00:00 2001 +From: Pandi Vijayaraj +Date: Mon, 20 Jun 2022 10:35:16 +0530 +Subject: [PATCH] cfg80211_is_gratuitous-and-regulatory_hint_user_supported + +--- + include/net/cfg80211.h | 37 ++++++++++++++++++++++++++++++ + net/wireless/chan.c | 3 ++- + net/wireless/reg.c | 1 + + net/wireless/util.c | 51 ++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 91 insertions(+), 1 deletion(-) + +diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h +index d5ab8d99739f..a97b3da77772 100644 +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -4326,6 +4326,7 @@ enum wiphy_flags { + WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22), + WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(23), + WIPHY_FLAG_HAS_STATIC_WEP = BIT(24), ++ WIPHY_FLAG_DFS_OFFLOAD = BIT(25) + }; + + /** +@@ -5908,6 +5909,32 @@ void cfg80211_send_layer2_update(struct net_device *dev, const u8 *addr); + */ + int regulatory_hint(struct wiphy *wiphy, const char *alpha2); + ++/** ++ * regulatory_hint_user - hint to the wireless core a regulatory domain ++ * which the driver has received from an application ++ * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain ++ * should be in. If @rd is set this should be NULL. Note that if you ++ * set this to NULL you should still set rd->alpha2 to some accepted ++ * alpha2. ++ * @user_reg_hint_type: the type of user regulatory hint. ++ * ++ * Wireless drivers can use this function to hint to the wireless core ++ * the current regulatory domain as specified by trusted applications, ++ * it is the driver's responsibilty to estbalish which applications it ++ * trusts. ++ * ++ * The wiphy should be registered to cfg80211 prior to this call. ++ * For cfg80211 drivers this means you must first use wiphy_register(), ++ * for mac80211 drivers you must first use ieee80211_register_hw(). ++ * ++ * Drivers should check the return value, its possible you can get ++ * an -ENOMEM or an -EINVAL. ++ * ++ * Return: 0 on success. -ENOMEM, -EINVAL. ++ */ ++int regulatory_hint_user(const char *alpha2, ++ enum nl80211_user_reg_hint_type user_reg_hint_type); ++ + /** + * regulatory_set_wiphy_regd - set regdom info for self managed drivers + * @wiphy: the wireless device we want to process the regulatory domain on +@@ -7909,6 +7936,16 @@ void cfg80211_nan_func_terminated(struct wireless_dev *wdev, + /* ethtool helper */ + void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info); + ++/** ++ * cfg80211_is_gratuitous_arp_unsolicited_na - packet is grat. ARP/unsol. NA ++ * @skb: the input packet, must be an ethernet frame already ++ * ++ * Return: %true if the packet is a gratuitous ARP or unsolicited NA packet. ++ * This is used to drop packets that shouldn't occur because the AP implements ++ * a proxy service. ++ */ ++bool cfg80211_is_gratuitous_arp_unsolicited_na(struct sk_buff *skb); ++ + /** + * cfg80211_external_auth_request - userspace request for authentication + * @netdev: network device +diff --git a/net/wireless/chan.c b/net/wireless/chan.c +index 22d1779ab2b1..b7c4c8ad77d3 100644 +--- a/net/wireless/chan.c ++++ b/net/wireless/chan.c +@@ -874,7 +874,8 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy, + + for (freq = start_freq; freq <= end_freq; freq += MHZ_TO_KHZ(20)) { + c = ieee80211_get_channel_khz(wiphy, freq); +- if (!c || c->flags & prohibited_flags) ++ if (!c || ((c->flags & prohibited_flags) && ++ !(wiphy->flags & WIPHY_FLAG_DFS_OFFLOAD))) + return false; + } + +diff --git a/net/wireless/reg.c b/net/wireless/reg.c +index a04fdfb35f07..4ec31b36e899 100644 +--- a/net/wireless/reg.c ++++ b/net/wireless/reg.c +@@ -3171,6 +3171,7 @@ int regulatory_hint_user(const char *alpha2, + + return 0; + } ++EXPORT_SYMBOL(regulatory_hint_user); + + int regulatory_hint_indoor(bool is_indoor, u32 portid) + { +diff --git a/net/wireless/util.c b/net/wireless/util.c +index e4247c354356..3158b152326d 100644 +--- a/net/wireless/util.c ++++ b/net/wireless/util.c +@@ -2070,6 +2070,57 @@ const unsigned char bridge_tunnel_header[] __aligned(2) = + { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; + EXPORT_SYMBOL(bridge_tunnel_header); + ++bool cfg80211_is_gratuitous_arp_unsolicited_na(struct sk_buff *skb) ++{ ++ const struct ethhdr *eth = (void *)skb->data; ++ const struct { ++ struct arphdr hdr; ++ u8 ar_sha[ETH_ALEN]; ++ u8 ar_sip[4]; ++ u8 ar_tha[ETH_ALEN]; ++ u8 ar_tip[4]; ++ } __packed *arp; ++ const struct ipv6hdr *ipv6; ++ const struct icmp6hdr *icmpv6; ++ ++ switch (eth->h_proto) { ++ case cpu_to_be16(ETH_P_ARP): ++ /* can't say - but will probably be dropped later anyway */ ++ if (!pskb_may_pull(skb, sizeof(*eth) + sizeof(*arp))) ++ return false; ++ ++ arp = (void *)(eth + 1); ++ ++ if ((arp->hdr.ar_op == cpu_to_be16(ARPOP_REPLY) || ++ arp->hdr.ar_op == cpu_to_be16(ARPOP_REQUEST)) && ++ !memcmp(arp->ar_sip, arp->ar_tip, sizeof(arp->ar_sip))) ++ return true; ++ break; ++ case cpu_to_be16(ETH_P_IPV6): ++ /* can't say - but will probably be dropped later anyway */ ++ if (!pskb_may_pull(skb, sizeof(*eth) + sizeof(*ipv6) + ++ sizeof(*icmpv6))) ++ return false; ++ ++ ipv6 = (void *)(eth + 1); ++ icmpv6 = (void *)(ipv6 + 1); ++ ++ if (icmpv6->icmp6_type == NDISC_NEIGHBOUR_ADVERTISEMENT && ++ !memcmp(&ipv6->saddr, &ipv6->daddr, sizeof(ipv6->saddr))) ++ return true; ++ break; ++ default: ++ /* ++ * no need to support other protocols, proxy service isn't ++ * specified for any others ++ */ ++ break; ++ } ++ ++ return false; ++} ++EXPORT_SYMBOL(cfg80211_is_gratuitous_arp_unsolicited_na); ++ + /* Layer 2 Update frame (802.2 Type 1 LLC XID Update response) */ + struct iapp_layer2_update { + u8 da[ETH_ALEN]; /* broadcast */ +-- +2.25.1 + diff --git a/linux/0002-wpa3_external_auth_support.patch b/linux/0002-wpa3_external_auth_support.patch new file mode 100755 index 0000000..447feb3 --- /dev/null +++ b/linux/0002-wpa3_external_auth_support.patch @@ -0,0 +1,39 @@ +From f99ab9dc97c2cddf8fc22333b86a5b563030079e Mon Sep 17 00:00:00 2001 +From: Pandi Vijayaraj +Date: Mon, 20 Jun 2022 10:37:04 +0530 +Subject: [PATCH] wpa3_external_auth_support + +--- + include/net/cfg80211.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h +index a97b3da77772..271c7108d4a1 100644 +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -22,6 +22,12 @@ + #include + #include + ++/* Indicate backport support for external authentication in AP mode */ ++#define CFG80211_EXTERNAL_AUTH_AP_SUPPORT 1 ++ ++/* Indicate backport support for DH IE creation/update*/ ++#define CFG80211_EXTERNAL_DH_UPDATE_SUPPORT 1 ++ + /** + * DOC: Introduction + * +@@ -65,6 +71,9 @@ struct wiphy; + * wireless hardware capability structures + */ + ++/* Indicate backport support for external authentication*/ ++#define CFG80211_EXTERNAL_AUTH_SUPPORT 1 ++ + /** + * enum ieee80211_channel_flags - channel flags + * +-- +2.25.1 + diff --git a/linux/0003-cfg80211-Add-macros-to-indicate-backport-support-for.patch b/linux/0003-cfg80211-Add-macros-to-indicate-backport-support-for.patch new file mode 100755 index 0000000..d082407 --- /dev/null +++ b/linux/0003-cfg80211-Add-macros-to-indicate-backport-support-for.patch @@ -0,0 +1,37 @@ +From 1ce054cb806bb30791b0af35aacd41b94cfd232c Mon Sep 17 00:00:00 2001 +From: Pandi Vijayaraj +Date: Mon, 20 Jun 2022 10:38:47 +0530 +Subject: [PATCH] cfg80211: Add macros to indicate backport support for FILS + +This change adds three macros, one to indicate backport support for the +new connect done event which takes connection response parameters as a +structure instead of function arguments. Second macro is to indicate +backport support for FILS shared key authentication offload to +driver and last is to indicate the use of new connect response api. +Changes pulled from msm4.4 branch with following Change-Id: +I6fb562741bb2abacbe1c7c7ffbf4b2afb25e555b +--- + include/net/cfg80211.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h +index 271c7108d4a1..26404d47c392 100644 +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -65,6 +65,13 @@ + * structures here describe these capabilities in detail. + */ + ++/* Indicate backport support for the new connect done api */ ++#define CFG80211_CONNECT_DONE 1 ++/* Indicate backport support for FILS SK offload in cfg80211 */ ++#define CFG80211_FILS_SK_OFFLOAD_SUPPORT 1 ++/* Indicate support for new cfg80211_connect_bss api */ ++#define CFG80211_CONNECT_BSS 1 ++ + struct wiphy; + + /* +-- +2.25.1 + diff --git a/linux/0003-squashfs-provide-backing_dev_info-in-order-to-disabl.patch b/linux/0003-squashfs-provide-backing_dev_info-in-order-to-disabl.patch new file mode 100644 index 0000000..94bd143 --- /dev/null +++ b/linux/0003-squashfs-provide-backing_dev_info-in-order-to-disabl.patch @@ -0,0 +1,121 @@ +From 9eec1d897139e5de287af5d559a02b811b844d82 Mon Sep 17 00:00:00 2001 +From: Zheng Liang +Date: Fri, 14 Jan 2022 14:03:31 -0800 +Subject: [PATCH] squashfs: provide backing_dev_info in order to disable + read-ahead + +Commit c1f6925e1091 ("mm: put readahead pages in cache earlier") causes +the read performance of squashfs to deteriorate.Through testing, we find +that the performance will be back by closing the readahead of squashfs. + +So we want to learn the way of ubifs, provides backing_dev_info and +disable read-ahead + +We tested the following data by fio. +squashfs image blocksize=128K +test command: + + fio --name basic --bs=? --filename="/mnt/test_file" --rw=? --iodepth=1 --ioengine=psync --runtime=200 --time_based + + turn on squashfs readahead in 5.10 kernel + bs(k) read/randread MB/s + 4 randread 271 + 128 randread 231 + 1024 randread 246 + 4 read 310 + 128 read 245 + 1024 read 247 + + turn off squashfs readahead in 5.10 kernel + bs(k) read/randread MB/s + 4 randread 293 + 128 randread 330 + 1024 randread 363 + 4 read 338 + 128 read 360 + 1024 read 365 + + turn on squashfs readahead and revert the + commit c1f6925e1091("mm: put readahead + pages in cache earlier") in 5.10 kernel + bs(k) read/randread MB/s + 4 randread 289 + 128 randread 306 + 1024 randread 335 + 4 read 337 + 128 read 336 + 1024 read 338 + +Link: https://lkml.kernel.org/r/20211116113141.1391026-1-zhengliang6@huawei.com +Signed-off-by: Zheng Liang +Reviewed-by: Phillip Lougher +Cc: Zhang Yi +Cc: Hou Tao +Cc: Miao Xie +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +--- + fs/squashfs/super.c | 33 +++++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c +index bb44ff4c5cc6..b1b556dbce12 100644 +--- a/fs/squashfs/super.c ++++ b/fs/squashfs/super.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + + #include "squashfs_fs.h" + #include "squashfs_fs_sb.h" +@@ -112,6 +113,24 @@ static const struct squashfs_decompressor *supported_squashfs_filesystem( + return decompressor; + } + ++static int squashfs_bdi_init(struct super_block *sb) ++{ ++ int err; ++ unsigned int major = MAJOR(sb->s_dev); ++ unsigned int minor = MINOR(sb->s_dev); ++ ++ bdi_put(sb->s_bdi); ++ sb->s_bdi = &noop_backing_dev_info; ++ ++ err = super_setup_bdi_name(sb, "squashfs_%u_%u", major, minor); ++ if (err) ++ return err; ++ ++ sb->s_bdi->ra_pages = 0; ++ sb->s_bdi->io_pages = 0; ++ ++ return 0; ++} + + static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc) + { +@@ -127,6 +146,20 @@ static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc) + + TRACE("Entered squashfs_fill_superblock\n"); + ++ /* ++ * squashfs provides 'backing_dev_info' in order to disable read-ahead. For ++ * squashfs, I/O is not deferred, it is done immediately in readpage, ++ * which means the user would always have to wait their own I/O. So the effect ++ * of readahead is very weak for squashfs. squashfs_bdi_init will set ++ * sb->s_bdi->ra_pages and sb->s_bdi->io_pages to 0 and close readahead for ++ * squashfs. ++ */ ++ err = squashfs_bdi_init(sb); ++ if (err) { ++ errorf(fc, "squashfs init bdi failed"); ++ return err; ++ } ++ + sb->s_fs_info = kzalloc(sizeof(*msblk), GFP_KERNEL); + if (sb->s_fs_info == NULL) { + ERROR("Failed to allocate squashfs_sb_info\n"); +-- +2.25.1 + diff --git a/linux/linux-5.10.defconfig b/linux/linux-5.10.defconfig new file mode 100644 index 0000000..84c0651 --- /dev/null +++ b/linux/linux-5.10.defconfig @@ -0,0 +1,508 @@ +CONFIG_KERNEL_XZ=y +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_PREEMPT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=18 +CONFIG_CGROUPS=y +CONFIG_MEMCG=y +CONFIG_CGROUP_SCHED=y +CONFIG_CGROUP_PIDS=y +CONFIG_CGROUP_FREEZER=y +CONFIG_CGROUP_DEVICE=y +CONFIG_NAMESPACES=y +CONFIG_USER_NS=y +CONFIG_RELAY=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_EXPERT=y +CONFIG_PERF_EVENTS=y +# CONFIG_SLUB_DEBUG is not set +# CONFIG_COMPAT_BRK is not set +CONFIG_ARCH_MXC=y +CONFIG_SOC_IMX6Q=y +CONFIG_SOC_IMX6SL=y +CONFIG_SOC_IMX6SLL=y +CONFIG_SOC_IMX6SX=y +CONFIG_SOC_IMX6UL=y +CONFIG_SOC_IMX7D=y +CONFIG_SOC_IMX7ULP=y +CONFIG_SMP=y +CONFIG_VMSPLIT_2G=y +CONFIG_ARM_PSCI=y +CONFIG_HIGHMEM=y +CONFIG_FORCE_MAX_ZONEORDER=14 +CONFIG_CMDLINE="noinitrd console=ttymxc0,115200" +CONFIG_KEXEC=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_CPUFREQ_DT=y +CONFIG_ARM_IMX6Q_CPUFREQ=y +CONFIG_ARM_IMX_CPUFREQ_DT=y +CONFIG_CPU_IDLE=y +CONFIG_ARM_CPUIDLE=y +CONFIG_ARM_PSCI_CPUIDLE=y +CONFIG_VFP=y +CONFIG_NEON=y +CONFIG_PM_DEBUG=y +CONFIG_PM_TEST_SUSPEND=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODVERSIONS=y +CONFIG_MODULE_SRCVERSION_ALL=y +# CONFIG_BLK_DEV_BSG is not set +CONFIG_BINFMT_MISC=m +CONFIG_CMA=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_NETFILTER=y +CONFIG_VLAN_8021Q=m +CONFIG_LLC2=y +CONFIG_CAN=y +CONFIG_CAN_FLEXCAN=y +CONFIG_BT=y +CONFIG_BT_RFCOMM=y +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=y +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=y +CONFIG_BT_HCIBTUSB=y +CONFIG_BT_HCIUART=y +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_LL=y +CONFIG_BT_HCIUART_3WIRE=y +CONFIG_BT_HCIUART_MRVL=y +CONFIG_BT_HCIVHCI=y +CONFIG_BT_MRVL=y +CONFIG_BT_MRVL_SDIO=y +CONFIG_CFG80211=y +CONFIG_NL80211_TESTMODE=y +CONFIG_CFG80211_WEXT=y +CONFIG_MAC80211=y +CONFIG_PCI=y +CONFIG_PCI_MSI=y +CONFIG_PCI_IMX6_HOST=y +CONFIG_PCI_IMX6_EP=y +CONFIG_PCI_ENDPOINT=y +CONFIG_PCI_ENDPOINT_CONFIGFS=y +CONFIG_PCI_EPF_TEST=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +# CONFIG_STANDALONE is not set +CONFIG_IMX_WEIM=y +CONFIG_CONNECTOR=y +CONFIG_MTD=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_CFI=y +CONFIG_MTD_JEDECPROBE=y +CONFIG_MTD_CFI_INTELEXT=y +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_CFI_STAA=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_OF=y +CONFIG_MTD_DATAFLASH=y +CONFIG_MTD_SST25L=y +CONFIG_MTD_RAW_NAND=y +CONFIG_MTD_NAND_GPMI_NAND=y +CONFIG_MTD_NAND_MXC=y +CONFIG_MTD_SPI_NOR=y +# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_FASTMAP=y +CONFIG_MTD_UBI_BLOCK=y +CONFIG_OF_OVERLAY=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_PCI_ENDPOINT_TEST=y +CONFIG_EEPROM_AT24=y +CONFIG_EEPROM_AT25=y +# CONFIG_SCSI_PROC_FS is not set +CONFIG_BLK_DEV_SD=y +CONFIG_SCSI_CONSTANTS=y +CONFIG_SCSI_LOGGING=y +CONFIG_SCSI_SCAN_ASYNC=y +# CONFIG_SCSI_LOWLEVEL is not set +CONFIG_ATA=y +CONFIG_SATA_AHCI_PLATFORM=y +CONFIG_AHCI_IMX=m +CONFIG_PATA_IMX=y +CONFIG_MD=y +CONFIG_BLK_DEV_MD=m +CONFIG_BLK_DEV_DM=m +CONFIG_DM_CRYPT=m +CONFIG_NETDEVICES=y +# CONFIG_ETHERNET is not set +# CONFIG_USB_NET_DRIVERS is not set +CONFIG_HOSTAP=y +CONFIG_WL12XX=m +CONFIG_WL18XX=m +CONFIG_WLCORE_SDIO=m +# CONFIG_WILINK_PLATFORM_DATA is not set +CONFIG_INPUT_EVDEV=y +CONFIG_INPUT_EVBUG=m +CONFIG_KEYBOARD_GPIO=y +CONFIG_KEYBOARD_RPMSG=y +CONFIG_KEYBOARD_IMX=y +CONFIG_MOUSE_PS2=m +CONFIG_MOUSE_PS2_ELANTECH=y +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_ADS7846=y +CONFIG_TOUCHSCREEN_AD7879=y +CONFIG_TOUCHSCREEN_AD7879_I2C=y +CONFIG_TOUCHSCREEN_ATMEL_MXT=y +CONFIG_TOUCHSCREEN_DA9052=y +CONFIG_TOUCHSCREEN_EGALAX=y +CONFIG_TOUCHSCREEN_ELAN_TS=y +CONFIG_TOUCHSCREEN_GOODIX=y +CONFIG_TOUCHSCREEN_ILI210X=y +CONFIG_TOUCHSCREEN_MAX11801=y +CONFIG_TOUCHSCREEN_IMX6UL_TSC=y +CONFIG_TOUCHSCREEN_EDT_FT5X06=y +CONFIG_TOUCHSCREEN_MC13783=y +CONFIG_TOUCHSCREEN_TSC2004=y +CONFIG_TOUCHSCREEN_TSC2007=y +CONFIG_TOUCHSCREEN_STMPE=y +CONFIG_TOUCHSCREEN_SX8654=y +CONFIG_TOUCHSCREEN_COLIBRI_VF50=y +CONFIG_TOUCHSCREEN_FTS=y +CONFIG_INPUT_MISC=y +CONFIG_INPUT_MMA8450=y +CONFIG_INPUT_MPL3115=y +CONFIG_SENSOR_FXLS8471=y +CONFIG_SENSOR_IMX_RPMSG=y +CONFIG_INPUT_ISL29023=y +CONFIG_SERIO_SERPORT=m +# CONFIG_LEGACY_PTYS is not set +CONFIG_SERIAL_IMX=y +CONFIG_SERIAL_IMX_CONSOLE=y +CONFIG_SERIAL_FSL_LPUART=y +CONFIG_SERIAL_FSL_LPUART_CONSOLE=y +CONFIG_SERIAL_DEV_BUS=y +# CONFIG_I2C_COMPAT is not set +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_GPIO=y +# CONFIG_I2C_HELPER_AUTO is not set +CONFIG_I2C_ALGOPCF=m +CONFIG_I2C_ALGOPCA=m +CONFIG_I2C_GPIO=y +CONFIG_I2C_IMX=y +CONFIG_I2C_IMX_LPI2C=y +CONFIG_SPI=y +CONFIG_SPI_FSL_LPSPI=y +CONFIG_SPI_FSL_QUADSPI=y +CONFIG_SPI_GPIO=y +CONFIG_SPI_IMX=y +CONFIG_SPI_SPIDEV=y +CONFIG_SPI_SLAVE=y +CONFIG_SPI_SLAVE_TIME=y +CONFIG_SPI_SLAVE_SYSTEM_CONTROL=y +CONFIG_PTP_1588_CLOCK=y +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_MXC=y +CONFIG_GPIO_SIOX=m +CONFIG_GPIO_IMX_RPMSG=y +CONFIG_GPIO_MAX732X=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCF857X=y +CONFIG_GPIO_STMPE=y +CONFIG_GPIO_74X164=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_SYSCON=y +CONFIG_POWER_RESET_SYSCON_POWEROFF=y +CONFIG_POWER_SUPPLY=y +CONFIG_SABRESD_MAX8903=y +CONFIG_SENSORS_MC13783_ADC=y +CONFIG_SENSORS_GPIO_FAN=y +CONFIG_SENSORS_IIO_HWMON=y +CONFIG_SENSORS_MAX17135=y +CONFIG_SENSORS_MAG3110=y +CONFIG_THERMAL=y +CONFIG_THERMAL_STATISTICS=y +CONFIG_THERMAL_WRITABLE_TRIPS=y +CONFIG_CPU_THERMAL=y +CONFIG_IMX_THERMAL=y +CONFIG_DEVICE_THERMAL=y +CONFIG_WATCHDOG=y +CONFIG_DA9063_WATCHDOG=m +CONFIG_DA9062_WATCHDOG=y +CONFIG_RN5T618_WATCHDOG=y +CONFIG_IMX2_WDT=y +CONFIG_IMX7ULP_WDT=y +CONFIG_MFD_DA9052_I2C=y +CONFIG_MFD_DA9062=y +CONFIG_MFD_DA9063=y +CONFIG_MFD_MC13XXX_SPI=y +CONFIG_MFD_MC13XXX_I2C=y +CONFIG_MFD_MAX17135=y +CONFIG_MFD_RN5T618=y +CONFIG_MFD_SI476X_CORE=y +CONFIG_MFD_STMPE=y +CONFIG_MFD_WM8994=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_ANATOP=y +CONFIG_REGULATOR_DA9052=y +CONFIG_REGULATOR_DA9062=y +CONFIG_REGULATOR_DA9063=y +CONFIG_REGULATOR_GPIO=y +CONFIG_REGULATOR_MAX17135=y +CONFIG_REGULATOR_MC13783=y +CONFIG_REGULATOR_MC13892=y +CONFIG_REGULATOR_PF1550_RPMSG=y +CONFIG_REGULATOR_PFUZE100=y +CONFIG_REGULATOR_RN5T618=y +CONFIG_RC_CORE=y +CONFIG_RC_DEVICES=y +CONFIG_IR_GPIO_CIR=y +CONFIG_DRM=y +CONFIG_DRM_PANEL_LVDS=y +CONFIG_DRM_PANEL_SIMPLE=y +CONFIG_DRM_PANEL_SEIKO_43WVF1G=y +CONFIG_DRM_TI_TFP410=y +CONFIG_FB_MXS=y +CONFIG_FB_MXC_SYNC_PANEL=y +CONFIG_FB_MXC_OVERLAY=y +CONFIG_FB_MXC_MIPI_DSI_NORTHWEST=y +CONFIG_FB_MXC_ADV7535=y +CONFIG_FB_MXC_TRULY_PANEL_TFT3P5581E=y +CONFIG_FB_MXC_TRULY_WVGA_SYNC_PANEL=y +CONFIG_FB_MXC_RK_PANEL_RK055AHD042=y +CONFIG_FB_MXC_RK_PANEL_RK055IQH042=y +CONFIG_FB_MXC_MIPI_DSI_SAMSUNG=y +CONFIG_FB_MXC_MIPI_DSI=y +CONFIG_FB_MXC_LDB=y +CONFIG_FB_MXC_EINK_PANEL=y +CONFIG_FB_MXC_EINK_V2_PANEL=y +CONFIG_FB_MXC_HDMI=y +CONFIG_FB_MXS_SII902X=y +CONFIG_FB_MXC_DCIC=y +CONFIG_LCD_CLASS_DEVICE=y +CONFIG_LCD_L4F00242T03=y +CONFIG_LCD_PLATFORM=y +CONFIG_BACKLIGHT_PWM=y +CONFIG_BACKLIGHT_GPIO=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_LOGO=y +CONFIG_HID_MULTITOUCH=y +CONFIG_USB=y +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_MXC=y +CONFIG_USB_HCD_TEST_MODE=y +CONFIG_USB_ACM=m +CONFIG_USB_STORAGE=y +CONFIG_USB_CHIPIDEA=y +CONFIG_USB_CHIPIDEA_UDC=y +CONFIG_USB_CHIPIDEA_HOST=y +CONFIG_USB_SERIAL=m +CONFIG_USB_SERIAL_GENERIC=y +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_OPTION=m +CONFIG_USB_TEST=m +CONFIG_USB_EHSET_TEST_FIXTURE=m +CONFIG_NOP_USB_XCEIV=y +CONFIG_USB_MXS_PHY=y +CONFIG_USB_GADGET=y +CONFIG_USB_FSL_USB2=y +CONFIG_USB_CONFIGFS=y +CONFIG_USB_CONFIGFS_SERIAL=y +CONFIG_USB_CONFIGFS_ACM=y +CONFIG_USB_CONFIGFS_OBEX=y +CONFIG_USB_CONFIGFS_NCM=y +CONFIG_USB_CONFIGFS_ECM=y +CONFIG_USB_CONFIGFS_ECM_SUBSET=y +CONFIG_USB_CONFIGFS_RNDIS=y +CONFIG_USB_CONFIGFS_EEM=y +CONFIG_USB_CONFIGFS_MASS_STORAGE=y +CONFIG_USB_CONFIGFS_F_LB_SS=y +CONFIG_USB_CONFIGFS_F_FS=y +CONFIG_USB_CONFIGFS_F_HID=y +CONFIG_USB_CONFIGFS_F_PRINTER=y +CONFIG_USB_ZERO=m +CONFIG_USB_ETH=m +CONFIG_USB_G_NCM=m +CONFIG_USB_GADGETFS=m +CONFIG_USB_FUNCTIONFS=m +CONFIG_USB_MASS_STORAGE=m +CONFIG_USB_G_SERIAL=m +CONFIG_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_SDHCI_ESDHC_IMX=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_PWM=y +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=y +CONFIG_LEDS_TRIGGER_ONESHOT=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_BACKLIGHT=y +CONFIG_LEDS_TRIGGER_GPIO=y +CONFIG_LEDS_TRIGGER_DEFAULT_ON=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_INTF_DEV_UIE_EMUL=y +CONFIG_RTC_DRV_DS1307=y +CONFIG_RTC_DRV_ISL1208=y +CONFIG_RTC_DRV_PCF8523=y +CONFIG_RTC_DRV_PCF8563=y +CONFIG_RTC_DRV_M41T80=y +CONFIG_RTC_DRV_RC5T619=y +CONFIG_RTC_DRV_DA9063=y +CONFIG_RTC_DRV_MC13XXX=y +CONFIG_RTC_DRV_MXC=y +CONFIG_RTC_DRV_MXC_V2=y +CONFIG_RTC_DRV_SNVS=y +CONFIG_RTC_DRV_IMX_RPMSG=y +CONFIG_DMADEVICES=y +CONFIG_FSL_EDMA=y +CONFIG_IMX_SDMA=y +CONFIG_MXS_DMA=y +CONFIG_MXC_PXP_V2=y +CONFIG_MXC_PXP_V3=y +CONFIG_DMATEST=m +CONFIG_COMMON_CLK_PWM=y +CONFIG_MAILBOX=y +CONFIG_REMOTEPROC=y +CONFIG_IMX_REMOTEPROC=y +CONFIG_EXTCON_USB_GPIO=y +CONFIG_IIO=y +CONFIG_IMX7D_ADC=y +CONFIG_RN5T618_ADC=y +CONFIG_VF610_ADC=y +CONFIG_PWM=y +CONFIG_PWM_FSL_FTM=y +CONFIG_PWM_IMX27=y +CONFIG_PWM_IMX_TPM=y +CONFIG_PHY_MIXEL_LVDS=y +CONFIG_PHY_MIXEL_LVDS_COMBO=y +CONFIG_NVMEM_IMX_OCOTP=y +CONFIG_NVMEM_SNVS_LPGPR=y +CONFIG_TEE=y +CONFIG_OPTEE=y +CONFIG_SIOX=m +CONFIG_SIOX_BUS_GPIO=m +CONFIG_MXC_SIM=y +CONFIG_MXC_IPU=y +CONFIG_MXC_SIMv2=y +CONFIG_MXC_MLB150=y +CONFIG_MXC_IPU_V3_PRE=y +CONFIG_MXC_HDMI_CEC=y +CONFIG_MXC_MIPI_CSI2=y +CONFIG_EXT2_FS=y +CONFIG_EXT2_FS_XATTR=y +CONFIG_EXT2_FS_POSIX_ACL=y +CONFIG_EXT2_FS_SECURITY=y +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_POSIX_ACL=y +CONFIG_EXT3_FS_SECURITY=y +CONFIG_F2FS_FS=y +CONFIG_QUOTA=y +CONFIG_QUOTA_NETLINK_INTERFACE=y +# CONFIG_PRINT_QUOTA_WARNING is not set +CONFIG_AUTOFS4_FS=y +CONFIG_FUSE_FS=y +CONFIG_OVERLAY_FS=y +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +CONFIG_UDF_FS=m +CONFIG_MSDOS_FS=m +CONFIG_VFAT_FS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_JFFS2_FS=y +CONFIG_UBIFS_FS=y +CONFIG_SQUASHFS=y +CONFIG_SQUASHFS_FILE_DIRECT=y +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y +CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFS_V4_1=y +CONFIG_NFS_V4_2=y +CONFIG_ROOT_NFS=y +CONFIG_NLS_DEFAULT="cp437" +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_UTF8=y +CONFIG_SECURITYFS=y +CONFIG_CRYPTO_USER=y +CONFIG_CRYPTO_TEST=m +CONFIG_CRYPTO_ECHAINIV=m +CONFIG_CRYPTO_TLS=m +CONFIG_CRYPTO_CFB=m +CONFIG_CRYPTO_CTS=m +CONFIG_CRYPTO_LRW=m +CONFIG_CRYPTO_OFB=m +CONFIG_CRYPTO_PCBC=m +CONFIG_CRYPTO_XCBC=m +CONFIG_CRYPTO_VMAC=m +CONFIG_CRYPTO_MD4=m +CONFIG_CRYPTO_MD5=m +CONFIG_CRYPTO_RMD128=m +CONFIG_CRYPTO_RMD160=m +CONFIG_CRYPTO_RMD256=m +CONFIG_CRYPTO_RMD320=m +CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m +CONFIG_CRYPTO_SM3=m +CONFIG_CRYPTO_STREEBOG=m +CONFIG_CRYPTO_TGR192=m +CONFIG_CRYPTO_WP512=m +CONFIG_CRYPTO_ANUBIS=m +CONFIG_CRYPTO_ARC4=m +CONFIG_CRYPTO_BLOWFISH=m +CONFIG_CRYPTO_CAMELLIA=m +CONFIG_CRYPTO_CAST5=m +CONFIG_CRYPTO_CAST6=m +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_FCRYPT=m +CONFIG_CRYPTO_KHAZAD=m +CONFIG_CRYPTO_SALSA20=m +CONFIG_CRYPTO_SEED=m +CONFIG_CRYPTO_SERPENT=m +CONFIG_CRYPTO_SM4=m +CONFIG_CRYPTO_TEA=m +CONFIG_CRYPTO_TWOFISH=m +CONFIG_CRYPTO_ANSI_CPRNG=m +CONFIG_CRYPTO_USER_API_RNG=m +CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=m +CONFIG_CRYPTO_DEV_FSL_CAAM=m +CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=m +CONFIG_CRYPTO_DEV_SAHARA=y +CONFIG_CRYPTO_DEV_MXS_DCP=y +CONFIG_CRC_CCITT=m +CONFIG_CRC_T10DIF=y +CONFIG_CRC7=m +CONFIG_LIBCRC32C=m +CONFIG_DMA_CMA=y +CONFIG_FONTS=y +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_PRINTK_TIME=y +# CONFIG_DEBUG_BUGVERBOSE is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_DEBUG_FS=y +# CONFIG_SCHED_DEBUG is not set +# CONFIG_DEBUG_PREEMPT is not set +# CONFIG_FTRACE is not set diff --git a/mix.exs b/mix.exs new file mode 100644 index 0000000..3e407de --- /dev/null +++ b/mix.exs @@ -0,0 +1,140 @@ +defmodule NervesSystemIMX6ULLEVK.MixProject do + use Mix.Project + + @github_organization "verypossible" + @app :nerves_system_imx6ull_evk + @source_url "https://github.com/#{@github_organization}/#{@app}" + @version Path.join(__DIR__, "VERSION") + |> File.read!() + |> String.trim() + + def project do + [ + app: @app, + version: @version, + elixir: "~> 1.9", + compilers: Mix.compilers() ++ [:nerves_package], + nerves_package: nerves_package(), + description: description(), + package: package(), + deps: deps(), + aliases: [loadconfig: [&bootstrap/1]], + docs: docs(), + preferred_cli_env: %{ + docs: :docs, + "hex.build": :docs, + "hex.publish": :docs + } + ] + end + + def application do + [] + end + + defp bootstrap(args) do + set_target() + Application.start(:nerves_bootstrap) + Mix.Task.run("loadconfig", args) + end + + defp nerves_package do + [ + type: :system, + artifact_sites: [ + {:github_releases, "#{@github_organization}/#{@app}"} + ], + build_runner_opts: build_runner_opts(), + platform: Nerves.System.BR, + platform_config: [ + defconfig: "nerves_defconfig" + ], + # The :env key is an optional experimental feature for adding environment + # variables to the crosscompile environment. These are intended for + # llvm-based tooling that may need more precise processor information. + env: [ + {"TARGET_ARCH", "arm"}, + {"TARGET_CPU", "cortex_a7"}, + {"TARGET_OS", "linux"}, + {"TARGET_ABI", "gnueabihf"}, + {"TARGET_GCC_FLAGS", + "-mabi=aapcs-linux -mfpu=neon-vfpv4 -marm -fstack-protector-strong -mfloat-abi=hard -mcpu=cortex-a7 -fPIE -pie -Wl,-z,now -Wl,-z,relro"} + ], + checksum: package_files() + ] + end + + defp deps do + [ + {:nerves, "~> 1.9.0", runtime: false}, + {:nerves_system_br, "1.21.1", runtime: false}, + {:nerves_toolchain_armv7_nerves_linux_gnueabihf, "~> 1.6.0", runtime: false}, + {:nerves_system_linter, "~> 0.4", only: [:dev, :test], runtime: false}, + {:ex_doc, "~> 0.22", only: :docs, runtime: false} + ] + end + + defp description do + """ + Nerves System - i.MX6ULL EVK + """ + end + + defp docs do + [ + extras: ["README.md", "CHANGELOG.md"], + main: "readme", + assets: "assets", + source_ref: "v#{@version}", + source_url: @source_url, + skip_undefined_reference_warnings_on: ["CHANGELOG.md"] + ] + end + + defp package do + [ + files: package_files(), + licenses: ["Apache-2.0"], + links: %{"GitHub" => @source_url} + ] + end + + defp package_files do + [ + "fwup_include", + "linux", + "rootfs_overlay", + "uboot", + "CHANGELOG.md", + "fwup-revert.conf", + "fwup.conf", + "LICENSE", + "mix.exs", + "nerves_defconfig", + "post-build.sh", + "post-createfs.sh", + "README.md", + "VERSION" + ] + end + + defp build_runner_opts() do + # Download source files first to get download errors right away. + [make_args: primary_site() ++ ["source", "all", "legal-info"]] + end + + defp primary_site() do + case System.get_env("BR2_PRIMARY_SITE") do + nil -> [] + primary_site -> ["BR2_PRIMARY_SITE=#{primary_site}"] + end + end + + defp set_target() do + if function_exported?(Mix, :target, 1) do + apply(Mix, :target, [:target]) + else + System.put_env("MIX_TARGET", "target") + end + end +end diff --git a/mix.lock b/mix.lock new file mode 100644 index 0000000..637d971 --- /dev/null +++ b/mix.lock @@ -0,0 +1,15 @@ +%{ + "castore": {:hex, :castore, "0.1.18", "deb5b9ab02400561b6f5708f3e7660fc35ca2d51bfc6a940d2f513f89c2975fc", [:mix], [], "hexpm", "61bbaf6452b782ef80b33cdb45701afbcf0a918a45ebe7e73f1130d661e66a06"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.28", "0bf6546eb7cd6185ae086cbc5d20cd6dbb4b428aad14c02c49f7b554484b4586", [:mix], [], "hexpm", "501cef12286a3231dc80c81352a9453decf9586977f917a96e619293132743fb"}, + "elixir_make": {:hex, :elixir_make, "0.6.3", "bc07d53221216838d79e03a8019d0839786703129599e9619f4ab74c8c096eac", [:mix], [], "hexpm", "f5cbd651c5678bcaabdbb7857658ee106b12509cd976c2c2fca99688e1daf716"}, + "ex_doc": {:hex, :ex_doc, "0.28.6", "2bbd7a143d3014fc26de9056793e97600ae8978af2ced82c2575f130b7c0d7d7", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "bca1441614654710ba37a0e173079273d619f9160cbcc8cd04e6bd59f1ad0e29"}, + "makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"}, + "makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"}, + "nerves": {:hex, :nerves, "1.9.1", "09cfd3589af81c4b1ac35179aee5f6d94bde36548a905c2d4d4efa9ff311222e", [:make, :mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "011409116923e1dbab250a6dc241ab529790163233c44e374ff352af72d09a56"}, + "nerves_system_br": {:hex, :nerves_system_br, "1.21.1", "5c6f4fe6c504500e9d995b9b6e9648e7eedd84a8979efb1d3e029c87bef9d8c2", [:mix], [], "hexpm", "43dd3e5c41eb928ce3d8913e46d93000967d1bed6a6a2c2c50769750ee37aaee"}, + "nerves_system_linter": {:hex, :nerves_system_linter, "0.4.0", "81e9a6f5018fe5fb67d7b43a04dca36156f62b55b5554eb2fa3964d3889d09cd", [:mix], [], "hexpm", "b5bd8480ce7a6317f4601ff41fd2f594bdf76aff0bdf6dcfac571c3fa1ec5f82"}, + "nerves_toolchain_armv7_nerves_linux_gnueabihf": {:hex, :nerves_toolchain_armv7_nerves_linux_gnueabihf, "1.6.1", "4014bc32142ef980e39af90e1377747095f3f3f8517e41815a23638ef1711702", [:mix], [{:nerves, "~> 1.0", [hex: :nerves, repo: "hexpm", optional: false]}, {:nerves_toolchain_ctng, "~> 1.9.0", [hex: :nerves_toolchain_ctng, repo: "hexpm", optional: false]}], "hexpm", "20a529ce1ab54677f121ac97333cc6b7c32f75ebb4b83cee7e0934867d61bbb5"}, + "nerves_toolchain_ctng": {:hex, :nerves_toolchain_ctng, "1.9.1", "89b4aa1eaa0ac2e248403ec85a5ff96f372cb4ddd2b327e76f953d0a2018e74e", [:mix], [{:nerves, "~> 1.0", [hex: :nerves, repo: "hexpm", optional: false]}], "hexpm", "5a9012b82c848626cfd00b69d104011fd1c5768c7b778d24f2caa3827c116b77"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"}, +} diff --git a/nerves_defconfig b/nerves_defconfig new file mode 100644 index 0000000..72a6a5c --- /dev/null +++ b/nerves_defconfig @@ -0,0 +1,78 @@ +BR2_arm=y +BR2_cortex_a7=y +BR2_ARM_FPU_NEON_VFPV4=y +BR2_TAR_OPTIONS="--no-same-owner" +BR2_BACKUP_SITE="http://dl.nerves-project.org" +BR2_ENABLE_DEBUG=y +BR2_OPTIMIZE_2=y +BR2_GLOBAL_PATCH_DIR="${BR2_EXTERNAL_NERVES_PATH}/patches" +BR2_REPRODUCIBLE=y +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y +BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y +BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/nerves-project/toolchains/releases/download/v1.6.1/nerves_toolchain_armv7_nerves_linux_gnueabihf-linux_x86_64-1.6.1-B60C2B2.tar.xz" +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="armv7-nerves-linux-gnueabihf" +BR2_TOOLCHAIN_EXTERNAL_GCC_11=y +BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y +# BR2_TOOLCHAIN_EXTERNAL_INET_RPC is not set +BR2_TOOLCHAIN_EXTERNAL_CXX=y +BR2_TOOLCHAIN_EXTERNAL_OPENMP=y +BR2_ROOTFS_SKELETON_CUSTOM=y +BR2_ROOTFS_SKELETON_CUSTOM_PATH="${BR2_EXTERNAL_NERVES_PATH}/board/nerves-common/skeleton" +BR2_INIT_NONE=y +BR2_ROOTFS_DEVICE_TABLE="${BR2_EXTERNAL_NERVES_PATH}/board/nerves-common/device_table.txt" +BR2_ENABLE_LOCALE_WHITELIST="locale-archive" +BR2_GENERATE_LOCALE="en_US.UTF-8" +BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_NERVES_PATH}/board/nerves-common/rootfs_overlay ${NERVES_DEFCONFIG_DIR}/rootfs_overlay" +BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_NERVES_PATH}/board/nerves-common/post-build.sh ${NERVES_DEFCONFIG_DIR}/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="${NERVES_DEFCONFIG_DIR}/post-createfs.sh" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/linux-imx.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="lf-5.10.y-1.0.0" +BR2_LINUX_KERNEL_PATCH="${NERVES_DEFCONFIG_DIR}/linux" +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${NERVES_DEFCONFIG_DIR}/linux/linux-5.10.defconfig" +BR2_LINUX_KERNEL_XZ=y +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6ull-14x14-evk imx6ull-14x14-evk-emmc imx6ull-14x14-evk-gpmi-weim imx6ull-14x14-evk-btwifi imx6ull-14x14-evk-btwifi-oob" +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +BR2_PACKAGE_BUSYBOX_CONFIG="${BR2_EXTERNAL_NERVES_PATH}/board/nerves-common/busybox.config" +BR2_PACKAGE_F2FS_TOOLS=y +BR2_PACKAGE_FREESCALE_IMX=y +BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL=y +BR2_PACKAGE_FIRMWARE_IMX=y +# BR2_PACKAGE_RNG_TOOLS_JITTERENTROPY_LIBRARY is not set +BR2_PACKAGE_LIBP11=y +BR2_PACKAGE_UNIXODBC=y +BR2_PACKAGE_LIBMNL=y +BR2_PACKAGE_WIRELESS_REGDB=y +BR2_PACKAGE_WPA_SUPPLICANT=y +BR2_PACKAGE_WPA_SUPPLICANT_IBSS_RSN=y +BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y +BR2_PACKAGE_WPA_SUPPLICANT_WIFI_DISPLAY=y +BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING=y +BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT=y +BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG=y +BR2_PACKAGE_WPA_SUPPLICANT_WPA3=y +BR2_PACKAGE_WPA_SUPPLICANT_CTRL_IFACE=y +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_GIT=y +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx.git" +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="lf-5.10.y-1.0.0" +BR2_TARGET_UBOOT_PATCH="${NERVES_DEFCONFIG_DIR}/uboot" +BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y +BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="${NERVES_DEFCONFIG_DIR}/uboot/uboot.defconfig" +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y +# BR2_TARGET_UBOOT_FORMAT_BIN is not set +BR2_TARGET_UBOOT_FORMAT_DTB_IMX=y +BR2_PACKAGE_HOST_UBOOT_TOOLS=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE="${NERVES_DEFCONFIG_DIR}/uboot/uboot.env" +BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE="131072" +BR2_NERVES_SYSTEM_NAME="nerves_system_imx6ull_evk" +BR2_PACKAGE_NBTTY=y +BR2_PACKAGE_NERVES_CONFIG=y diff --git a/patches/wpa_supplicant/wpa_supplicant-Wifi-Cert-P2P-TC-5.1.9-Fix.patch b/patches/wpa_supplicant/wpa_supplicant-Wifi-Cert-P2P-TC-5.1.9-Fix.patch new file mode 100644 index 0000000..57a4eba --- /dev/null +++ b/patches/wpa_supplicant/wpa_supplicant-Wifi-Cert-P2P-TC-5.1.9-Fix.patch @@ -0,0 +1,82 @@ +From e6045d2e8021a414eded280701cd94cdf0b2be6d Mon Sep 17 00:00:00 2001 +From: Suresh Kumar Gautam +Date: Mon, 6 Nov 2017 15:25:36 +0530 +Subject: [PATCH] Increased delay for disconnecting client to 1 sec,as 10ms is + too aggressive for stations. Cancel disconnect timer from Deauth/Disassoc + Event handler. + +--- + src/ap/ieee802_1x.c | 2 +- + src/ap/sta_info.c | 22 ++++++++++++++++++++-- + 2 files changed, 21 insertions(+), 3 deletions(-) + +diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c +index ae38f6c..7d7f27d 100644 +--- a/src/ap/ieee802_1x.c ++++ b/src/ap/ieee802_1x.c +@@ -2370,7 +2370,7 @@ int ieee802_1x_eapol_tx_status(struct hostapd_data *hapd, struct sta_info *sta, + ap_sta_pending_delayed_1x_auth_fail_disconnect(hapd, sta)) { + wpa_printf(MSG_DEBUG, + "WPS: Indicate EAP completion on ACK for EAP-Failure"); +- hostapd_wps_eap_completed(hapd); ++ //hostapd_wps_eap_completed(hapd); + } + #endif /* CONFIG_WPS */ + +diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c +index ea217f3..4feab63 100644 +--- a/src/ap/sta_info.c ++++ b/src/ap/sta_info.c +@@ -1296,6 +1296,15 @@ void ap_sta_deauth_cb(struct hostapd_data *hapd, struct sta_info *sta) + sta->flags &= ~WLAN_STA_PENDING_DEAUTH_CB; + eloop_cancel_timeout(ap_sta_deauth_cb_timeout, hapd, sta); + ap_sta_deauth_cb_timeout(hapd, sta); ++ if (eloop_cancel_timeout(ap_sta_delayed_1x_auth_fail_cb, hapd, sta) > 0) ++ { ++ wpa_printf(MSG_DEBUG, ++ "%s: Removed ap_sta_delayed_1x_auth_fail_cb timeout for " ++ MACSTR, ++ hapd->conf->iface, MAC2STR(sta->addr)); ++ if (sta->flags & WLAN_STA_WPS) ++ hostapd_wps_eap_completed(hapd); ++ } + } + + +@@ -1308,6 +1317,15 @@ void ap_sta_disassoc_cb(struct hostapd_data *hapd, struct sta_info *sta) + sta->flags &= ~WLAN_STA_PENDING_DISASSOC_CB; + eloop_cancel_timeout(ap_sta_disassoc_cb_timeout, hapd, sta); + ap_sta_disassoc_cb_timeout(hapd, sta); ++ if (eloop_cancel_timeout(ap_sta_delayed_1x_auth_fail_cb, hapd, sta) > 0) ++ { ++ wpa_printf(MSG_DEBUG, ++ "%s: Removed ap_sta_delayed_1x_auth_fail_cb timeout for " ++ MACSTR, ++ hapd->conf->iface, MAC2STR(sta->addr)); ++ if (sta->flags & WLAN_STA_WPS) ++ hostapd_wps_eap_completed(hapd); ++ } + } + + +@@ -1390,7 +1408,7 @@ void ap_sta_delayed_1x_auth_fail_disconnect(struct hostapd_data *hapd, + { + wpa_dbg(hapd->msg_ctx, MSG_DEBUG, + "IEEE 802.1X: Force disconnection of " MACSTR +- " after EAP-Failure in 10 ms", MAC2STR(sta->addr)); ++ " after EAP-Failure in 1 sec", MAC2STR(sta->addr)); + + /* + * Add a small sleep to increase likelihood of previously requested +@@ -1398,7 +1416,7 @@ void ap_sta_delayed_1x_auth_fail_disconnect(struct hostapd_data *hapd, + * operations. + */ + eloop_cancel_timeout(ap_sta_delayed_1x_auth_fail_cb, hapd, sta); +- eloop_register_timeout(0, 10000, ap_sta_delayed_1x_auth_fail_cb, ++ eloop_register_timeout(1, 10000, ap_sta_delayed_1x_auth_fail_cb, + hapd, sta); + } + +-- +1.9.1 + diff --git a/post-build.sh b/post-build.sh new file mode 100755 index 0000000..d5c2435 --- /dev/null +++ b/post-build.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +# Create the revert script for manually switching back to the previously +# active firmware. +mkdir -p $TARGET_DIR/usr/share/fwup +$HOST_DIR/usr/bin/fwup -c -f $NERVES_DEFCONFIG_DIR/fwup-revert.conf -o $TARGET_DIR/usr/share/fwup/revert.fw + +# Copy the fwup includes to the images dir +cp -rf $NERVES_DEFCONFIG_DIR/fwup_include $BINARIES_DIR diff --git a/post-createfs.sh b/post-createfs.sh new file mode 100755 index 0000000..e836794 --- /dev/null +++ b/post-createfs.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +FWUP_CONFIG=$NERVES_DEFCONFIG_DIR/fwup.conf + +# Run the common post-image processing for nerves +$BR2_EXTERNAL_NERVES_PATH/board/nerves-common/post-createfs.sh $TARGET_DIR $FWUP_CONFIG diff --git a/rootfs_overlay/etc/boardid.config b/rootfs_overlay/etc/boardid.config new file mode 100644 index 0000000..3d288f0 --- /dev/null +++ b/rootfs_overlay/etc/boardid.config @@ -0,0 +1,16 @@ +# boardid.config + +# Please consider using an ATECCx08 or NervesKey rather than storing serial +# numbers in U-Boot environment blocks. Override this file in your project's +# rootfs_overlay directory and uncomment the following line if you go this +# route: +# -b nerves_key -f /dev/i2c-1 + +# Read the serial number from the U-boot environment block. The variable +# "nerves_serial_number" is the desired variable to use. "serial_number" is +# checked as a backup. +-b uboot_env -u nerves_serial_number +-b uboot_env -u serial_number + +# Use 4 digits of the iMX6's serial number +-b cpuinfo -n 4 diff --git a/rootfs_overlay/etc/erlinit.config b/rootfs_overlay/etc/erlinit.config new file mode 100644 index 0000000..d1fe844 --- /dev/null +++ b/rootfs_overlay/etc/erlinit.config @@ -0,0 +1,73 @@ +# Additional configuration for erlinit + +# Turn on the debug prints +#-v + +# Specify where erlinit should send the IEx prompt. Only one may be enabled at +# a time. +-c ttymxc0 # UART pins on the GPIO connector +#-c tty1 # HDMI output + +# If more than one tty are available, always warn if the user is looking at the +# wrong one. +--warn-unused-tty + +# Use nbtty to improve terminal handling on serial ports. It's a noop on HDMI. +-s "/usr/bin/nbtty" + +# There's a call to getrandom(2) when loading the crypto NIF that's before +# nerves_runtime can start rngd. This syscall can block the BEAM indefinitely +# if there's not enough entropy in the kernel. We have not observed blocking on +# this platform. However, we don't know that getrandom(2) will always have +# enough entropy, so start rngd here to be safe. +--pre-run-exec /usr/sbin/rngd + +# Specify the user and group IDs for the Erlang VM +#--uid 100 +#--gid 200 + +# Uncomment to ensure that the system clock is set to at least the Nerves +# System's build date/time. If you enable this, you'll still need to use NTP or +# another mechanism to set the clock, but it won't be decades off. +#--update-clock + +# Uncomment to hang the board rather than rebooting when Erlang exits +# NOTE: Do not enable on production boards +#--hang-on-exit + +# Change the graceful shutdown time. If 10 seconds isn't long enough between +# calling "poweroff", "reboot", or "halt" and :init.stop/0 stopping all OTP +# applications, enable this option with a new timeout in milliseconds. +#--graceful-shutdown-timeout 15000 + +# Optionally run a program if the Erlang VM exits +#--run-on-exit /bin/sh + +# Enable UTF-8 filename handling in Erlang and custom inet configuration +-e LANG=en_US.UTF-8;LANGUAGE=en;ERL_INETRC=/etc/erl_inetrc;ERL_CRASH_DUMP=/root/crash.dump + +# Mount the application partition (run "man fstab" for field names) +# NOTE: This must match the location in the fwup.conf. If it doesn't the system +# will probably still work fine, but you won't get shell history since +# shoehorn/nerves_runtime can't mount the application filesystem before +# the history is loaded. If this mount fails due to corruption, etc., +# nerves_runtime will auto-format it. Your applications will need to handle +# initializing any expected files and folders. +-m /dev/mmcblk1p1:/mnt/boot:vfat:ro,nodev,noexec,nosuid: +-m /dev/mmcblk1p4:/root:f2fs:nodev: +-m tmpfs:/sys/fs/cgroup:tmpfs:nodev,noexec,nosuid:mode=755,size=1024k +-m cpu:/sys/fs/cgroup/cpu:cgroup:nodev,noexec,nosuid:cpu +-m memory:/sys/fs/cgroup/memory:cgroup:nodev,noexec,nosuid:memory + +# Erlang release search path +-r /srv/erlang + +# Assign a hostname of the form "nerves-". +# See /etc/boardid.config for locating the serial number. +-d /usr/bin/boardid +-n nerves-%s + +# If using shoehorn (https://github.com/nerves-project/shoehorn), start the +# shoehorn OTP release up first. If shoehorn isn't around, erlinit fails back +# to the main OTP release. +--boot shoehorn diff --git a/rootfs_overlay/etc/fw_env.config b/rootfs_overlay/etc/fw_env.config new file mode 100644 index 0000000..7a10a96 --- /dev/null +++ b/rootfs_overlay/etc/fw_env.config @@ -0,0 +1,6 @@ +# fw_printenv and fw_setenv configuration +# +# See fwup.conf for offset and size + +# Device name Device offset Env. size +/dev/mmcblk1 0xE0000 0x20000 diff --git a/rootfs_overlay/mnt/boot/.empty b/rootfs_overlay/mnt/boot/.empty new file mode 100644 index 0000000..e69de29 diff --git a/uboot/uboot.defconfig b/uboot/uboot.defconfig new file mode 100644 index 0000000..ad2c5a0 --- /dev/null +++ b/uboot/uboot.defconfig @@ -0,0 +1,68 @@ +CONFIG_ARM=y +CONFIG_ARCH_MX6=y +CONFIG_TARGET_MX6ULL_14X14_EVK=y +CONFIG_ENV_SIZE=0x20000 +CONFIG_ENV_OFFSET=0xE0000 +CONFIG_DM_GPIO=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6ullevk/imximage.cfg" +CONFIG_SD_BOOT=y +CONFIG_BOOTDELAY=-2 +CONFIG_SUPPORT_RAW_INITRD=y +CONFIG_BOUNCE_BUFFER=y +CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_MEMTEST=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_PING=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_OF_CONTROL=y +CONFIG_DEFAULT_DEVICE_TREE="imx6ull-14x14-evk" +CONFIG_ENV_IS_IN_MMC=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x83800000 +CONFIG_FASTBOOT_BUF_SIZE=0x40000000 +CONFIG_FASTBOOT_FLASH=y +CONFIG_DM_74X164=y +CONFIG_DM_I2C=y +CONFIG_DM_MMC=y +CONFIG_FSL_USDHC=y +CONFIG_MTD=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SF_DEFAULT_MODE=0 +CONFIG_SF_DEFAULT_SPEED=40000000 +CONFIG_SPI_FLASH_STMICRO=y +# CONFIG_NETDEVICES is not set +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_DM_REGULATOR_GPIO=y +CONFIG_SPI=y +CONFIG_DM_SPI=y +CONFIG_SOFT_SPI=y +CONFIG_FSL_QSPI=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_STORAGE=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_MANUFACTURER="FSL" +CONFIG_USB_GADGET_VENDOR_NUM=0x0525 +CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 +CONFIG_CI_UDC=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_ASIX=y +CONFIG_SYS_WHITE_ON_BLACK=y diff --git a/uboot/uboot.env b/uboot/uboot.env new file mode 100644 index 0000000..f016cde --- /dev/null +++ b/uboot/uboot.env @@ -0,0 +1,145 @@ +# Custom U-Boot base environment for Nerves + +# This environment is a majorly trimmed down version of the default +# one that ships with the i.MX6ULL EVK. +# +# Why? +# 1. We want to store settings in the U-boot environment so that they're +# accessible both to Elixir and U-boot. +# 2. This makes us add an environment block. +# 3. Unfortunately, if we point U-Boot to this block, it replaces its +# default environment settings which contain all of the logic to +# boot the boards. Therefore we have to copy/paste the relevant +# parts here. +# 4. We can support more complicated firmware validation methods by +# deferring validation of new software to the application. The +# default below is to automatically validate new software. +# +# IMPORTANT: +# Calling saveenv saves everything. Some of the variables it saves override +# automatically detected defaults and you can't know whether the variable was +# supplied automatically or via the saved environment. There is no way to +# selectively save environment variables. Here are problematic variables: +# +# * ethaddr +# * eth1addr +# * board_name +# * board_rev +# * board_serial +# +# If you move MicroSD cards around between boards, you currently need to clear +# those variables out so that they're detected again. The most visible issue is +# that Ethernet MAC addresses will travel with MicroSD cards. See +# https://github.com/nerves-project/nerves_system_bbb/issues/151. + + +# +# Nerves variables +# + +nerves_fw_active=a + +# nerves_fw_autovalidate controls whether updates are considered valid once +# applied. If set to 0, the user needs to set nerves_fw_validated to 1 in their +# application. If they don't set it before a reboot, then the previous software +# is run. If 1, then no further action needs to be taken. +nerves_fw_autovalidate=1 + +# nerves_fw_validated is 1 if the current boot selection is accepted It is set +# to 1 here, since this environment is written in the factory, so it is +# implicitly valid. +nerves_fw_validated=1 + +# nerves_fw_booted is 0 for the first boot and 1 for all reboots after that. +# NOTE: Keep this '0' so that all new boards run a 'saveenv' to exercise the +# code that writes back to the eMMC early on. +nerves_fw_booted=0 + +# The nerves initialization logic +# +# The nerves_init code is run at boot (see the last line of the file). It +# checks whether this is a first boot or not. If it's not the first boot, then +# the firmware better be validated or it reverts to running the firmware on +# the opposite partition. +nerves_revert=\ + if test ${nerves_fw_active} = "a"; then\ + echo "Reverting to partition B";\ + setenv nerves_fw_active "b";\ + else\ + echo "Reverting to partition A";\ + setenv nerves_fw_active "a";\ + fi + +nerves_init=\ + if test ${nerves_fw_booted} = 1; then\ + if test ${nerves_fw_validated} = 0; then\ + run nerves_revert;\ + setenv nerves_fw_validated 1;\ + saveenv;\ + fi;\ + else\ + setenv nerves_fw_booted 1;\ + if test ${nerves_fw_autovalidate} = 1; then\ + setenv nerves_fw_validated 1;\ + fi;\ + saveenv;\ + fi;\ + setenv bootfile zImage.${nerves_fw_active};\ + if test ${nerves_fw_active} = "a"; then\ + setenv uenv_root /dev/mmcblk1p2;\ + else\ + setenv uenv_root /dev/mmcblk1p3;\ + fi + +# +# Default Linux commandline: +# +# coherent_pool=1M - copied from iMX6ULL defaults. It's needed for some WiFi drivers. +# vt.global_cursor_default=0 - copied from iMX6ULL defaults +# quiet - limit kernel prints to the console +cmdline=coherent_pool=1M vt.global_cursor_default=0 + +# Defaults +console=ttymxc0,115200n8 +bootdir= +fdtdir= +fdtfile=imx6ull-14x14-evk.dtb + +dtb_overlay= + +devtype=mmc +# TODO: Bump U-Boot to be able to load from squashfs +bootpart=1:1 + +# Values from mx6ullevk.h (quite a few of these look like they can be cleaned up) +initrd_addr=0x86800000 +initrd_high=0xffffffff +emmc_dev=1 +emmc_ack=1 +sd_dev=1 +panel=TFT43AB +fdt_addr=0x83000000 +fdt_addr_r=0x83000000 +fdtaddr=0x83000000 +fdt_high=0xffffffff +tee_addr=0x84000000 +loadaddr=0x80800000 +fdt_buffer=0x60000 +rdaddr=0x88000000 + +# Helper functions +args_uenv_root=setenv bootargs console=${console} root=${uenv_root} rootfstype=squashfs rootwait ${cmdline} + +loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile} +loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdt_addr} ${fdtdir}/${fdtfile} + +uname_boot=\ + run args_uenv_root;\ + run loadimage;\ + run loadfdt;\ + echo debug: [${bootargs}] ... ;\ + echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;\ + bootz ${loadaddr} - ${fdt_addr}; + +# Boot +bootcmd=run nerves_init uname_boot