diff --git a/.gitignore b/.gitignore index b8bc1fefd767a2e449e145c2d497eca408b4ecbb..aa16c209e742b39e949fa83da5d4fd218e52e4bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,13 @@ +## no documentation built files docs/build +# no python cache +*.pyc +*.log + +# no vim cache +*.swp +*.swo + +# no vscode configuration +*.vscode diff --git a/.gitlint b/.gitlint new file mode 100644 index 0000000000000000000000000000000000000000..8963b8f4ff4716056d64a3e23915a1edc45003c1 --- /dev/null +++ b/.gitlint @@ -0,0 +1,59 @@ +# This refers the .gitlint of Zephyr Project +# All these sections are optional, edit this file as you like. +[general] +ignore=title-trailing-punctuation, T3, title-max-length, T1, body-hard-tab, B3, B1 +# verbosity should be a value between 1 and 3, the commandline -v flags take precedence over this +verbosity = 3 +# By default gitlint will ignore merge commits. Set to 'false' to disable. +ignore-merge-commits=true +ignore-revert-commits=false +ignore-fixup-commits=false +ignore-squash-commits=false +# Enable debug mode (prints more output). Disabled by default +debug = false + +# Set the extra-path where gitlint will search for user defined rules +# See http://jorisroovers.github.io/gitlint/user_defined_rules for details +extra-path=scripts/gitlint + +[title-max-length-no-revert] +line-length=75 + +[body-min-line-count] +min-line-count=1 + +[body-max-line-count] +max-line-count=200 + +[title-must-not-contain-word] +# Comma-separated list of words that should not occur in the title. Matching is case +# insensitive. It's fine if the keyword occurs as part of a larger word (so "WIPING" +# will not cause a violation, but "WIP: my title" will. +words=wip + +[title-match-regex] +# python like regex (https://docs.python.org/2/library/re.html) that the +# commit-msg title must be matched to. +# Note that the regex can contradict with other rules if not used correctly +# (e.g. title-must-not-contain-word). +#regex=^US[0-9]* + +[max-line-length-with-exceptions] +# B1 = body-max-line-length +# use 120 to replace to old 75 as no need to follow the limit 50/72 +line-length=120 + +[body-min-length] +min-length=3 + +[body-is-missing] +# Whether to ignore this rule on merge commits (which typically only have a title) +# default = True +ignore-merge-commits=true + +[body-changed-file-mention] +# List of files that need to be explicitly mentioned in the body when they are changed +# This is useful for when developers often erroneously edit certain files or git submodules. +# By specifying this rule, developers can only change the file when they explicitly reference +# it in the commit message. +#files=gitlint/rules.py,README.md diff --git a/.oebuild/bblayers.conf.sample b/.oebuild/bblayers.conf.sample new file mode 100644 index 0000000000000000000000000000000000000000..bfbbe0dd253125e7f875ac9803348d381cbad83e --- /dev/null +++ b/.oebuild/bblayers.conf.sample @@ -0,0 +1,16 @@ +# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +POKY_BBLAYERS_CONF_VERSION = "2" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + ##OEROOT##/meta \ + ##OEROOT##/../yocto-meta-openembedded/meta-oe \ + ##OEROOT##/../yocto-meta-openembedded/meta-python \ + ##OEROOT##/../yocto-meta-openembedded/meta-networking \ + ##OEROOT##/../yocto-meta-openembedded/meta-filesystems \ + ##OEROOT##/../yocto-meta-openeuler/meta-openeuler \ + ##OEROOT##/../yocto-meta-openeuler/bsp/meta-openeuler-bsp \ + " diff --git a/.oebuild/common.yaml b/.oebuild/common.yaml new file mode 100644 index 0000000000000000000000000000000000000000..aa236375dabad5a6f0932def02f006caa2407305 --- /dev/null +++ b/.oebuild/common.yaml @@ -0,0 +1,16 @@ +repos: + yocto-poky: + url: https://gitee.com/openeuler/yocto-poky.git + path: yocto-poky + refspec: openEuler-22.09 + + yocto-meta-openembedded: + url: https://gitee.com/openeuler/yocto-meta-openembedded.git + path: yocto-meta-openembedded + refspec: dev_hardknott + + yocto-meta-ros: + url: https://gitee.com/openeuler/yocto-meta-ros.git + path: yocto-meta-ros + refspec: dev_hardknott + \ No newline at end of file diff --git a/.oebuild/features/busybox.yaml b/.oebuild/features/busybox.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8c43b7e23d8dc90f7e7c3a339c68205cd911f904 --- /dev/null +++ b/.oebuild/features/busybox.yaml @@ -0,0 +1,5 @@ +type: feature + +local_conf: | + OPENEULER_INIT_MANAGER = "mdev-busybox" + OPENEULER_DEV_MANAGER = "busybox-mdev" \ No newline at end of file diff --git a/.oebuild/features/clang.yaml b/.oebuild/features/clang.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ba55ed5daa7ba447d0fb757bab6dc3ad7c4e14a8 --- /dev/null +++ b/.oebuild/features/clang.yaml @@ -0,0 +1,11 @@ +type: feature + +support: aarch64-std|raspberrypi4-64 + +local_conf: | + DISTRO_FEATURES_append = " clang " + DISTRO_FEATURES_NATIVE_append = " clang " + EXTERNAL_TOOLCHAIN_CLANG_BIN = "${EXTERNAL_TOOLCHAIN_aarch64}/bin" + +layers: +- yocto-meta-openeuler/meta-clang diff --git a/.oebuild/features/musl.yaml b/.oebuild/features/musl.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5fe734d48cbc90c5396827189ea34d7e2407c0f4 --- /dev/null +++ b/.oebuild/features/musl.yaml @@ -0,0 +1,13 @@ +type: feature + +support: aarch64-std|raspberrypi4-64 + +local_conf: | + EXTERNAL_TARGET_SYS_aarch64 = "aarch64-openeuler-linux-musl" + LIBC = "musl" + crypt = "musl" + TCMODE-LIBC = "musl" + MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "musl" + +layers: +- yocto-meta-openeuler/meta-musl diff --git a/.oebuild/features/openeuler-mcs.yaml b/.oebuild/features/openeuler-mcs.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1bd2a7b441e18445775e29142ebde3ad90fa9c2e --- /dev/null +++ b/.oebuild/features/openeuler-mcs.yaml @@ -0,0 +1,16 @@ +type: feature + +support: aarch64-std|raspberrypi4-64|hi3093 + +layers: +- yocto-meta-openeuler/rtos/meta-openeuler-rtos +- yocto-meta-openeuler/rtos/meta-zephyr + +local_conf: | + MCS_FEATURES = "rpi4 hi3093 lopper-devicetree jailhouse" + +repos: + Jailhouse: + url: https://gitee.com/src-openeuler/Jailhouse + path: Jailhouse + refspec: master diff --git a/.oebuild/features/openeuler-qt.yaml b/.oebuild/features/openeuler-qt.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cddc1379cf58061fbbd72b3575f0f9dd6b992172 --- /dev/null +++ b/.oebuild/features/openeuler-qt.yaml @@ -0,0 +1,14 @@ +type: feature + +repos: + yocto-meta-qt5: + url: https://gitee.com/openeuler/yocto-meta-qt5.git + path: yocto-meta-qt5 + refspec: dev_hardknott + +local_conf: | + DISTRO_FEATURES_append = " opengl wayland" + +layers: +- yocto-meta-openembedded/meta-oe +- yocto-meta-qt5 \ No newline at end of file diff --git a/.oebuild/features/openeuler-ros.yaml b/.oebuild/features/openeuler-ros.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b1be3d7cb7b4e39e0455bfddfe4c2dc939492095 --- /dev/null +++ b/.oebuild/features/openeuler-ros.yaml @@ -0,0 +1,13 @@ +type: feature + +repos: + ros-dev-tools: + url: https://gitee.com/openeuler/yocto-embedded-tools.git + path: ros-dev-tools + refspec: dev_ros + +layers: +- yocto-meta-ros/meta-ros-common +- yocto-meta-ros/meta-ros2 +- yocto-meta-ros/meta-ros2-foxy + diff --git a/.oebuild/features/openeuler-rt.yaml b/.oebuild/features/openeuler-rt.yaml new file mode 100644 index 0000000000000000000000000000000000000000..105cb706b8464171b23101455409ea5dce983537 --- /dev/null +++ b/.oebuild/features/openeuler-rt.yaml @@ -0,0 +1,4 @@ +type: feature + +local_conf: | + PREFERRED_PROVIDER_virtual/kernel = "linux-openeuler-rt" \ No newline at end of file diff --git a/.oebuild/features/systemd.yaml b/.oebuild/features/systemd.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5112ec2e5cd8cc06569e3b053a8e01cd22380997 --- /dev/null +++ b/.oebuild/features/systemd.yaml @@ -0,0 +1,5 @@ +type: feature + +local_conf: | + OPENEULER_INIT_MANAGER = "systemd" + OPENEULER_DEV_MANAGER = "systemd" \ No newline at end of file diff --git a/.oebuild/local.conf.sample b/.oebuild/local.conf.sample new file mode 100644 index 0000000000000000000000000000000000000000..64d7d5db29fe526801528db05a8105e2cae46ea4 --- /dev/null +++ b/.oebuild/local.conf.sample @@ -0,0 +1,335 @@ +# +# 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 ?= "qemuarm64" +#MACHINE ?= "qemumips" +#MACHINE ?= "qemumips64" +#MACHINE ?= "qemuppc" +#MACHINE ?= "qemux86" +#MACHINE ?= "qemux86-64" +# +# There are also the following hardware board target machines included for +# demonstration purposes: +# +#MACHINE ?= "beaglebone-yocto" +#MACHINE ?= "genericx86" +#MACHINE ?= "genericx86-64" +#MACHINE ?= "edgerouter" +# +# This sets the default machine to be qemux86-64 if no other machine is selected: +MACHINE ??= "qemu-aarch64" + +# +# 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 ?= "openeuler" +# 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 target architecture +# +# This variable specifies the architecture to build SDK 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, x86_64, aarch64 +#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) +# "src-pkgs" - add -src packages for all installed packages +# (adds source code for debugging) +# "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, 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. +# We default to enabling the debugging tweaks. +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 +USER_CLASSES ?= "buildstats" + +# +# 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. It can also +# run tests against any SDK that are built. To enable this uncomment these lines. +# See classes/test{image,sdk}.bbclass for further details. +#IMAGE_CLASSES += "testimage testsdk" +#TESTIMAGE_AUTO:qemuall = "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 than 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. +# It's necessary to monitor /tmp, if there is no space left the build will fail +# with very exotic errors. +BB_DISKMON_DIRS ??= "\ + STOPTASKS,${TMPDIR},1G,100K \ + STOPTASKS,${DL_DIR},1G,100K \ + STOPTASKS,${SSTATE_DIR},1G,100K \ + STOPTASKS,/tmp,100M,100K \ + ABORT,${TMPDIR},100M,1K \ + ABORT,${DL_DIR},100M,1K \ + ABORT,${SSTATE_DIR},100M,1K \ + ABORT,/tmp,10M,1K" + +# +# Shared-state files from other locations +# +# As mentioned above, shared state files are prebuilt cache data objects which can be +# 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" + +# +# Yocto Project SState Mirror +# +# The Yocto Project has prebuilt artefacts available for its releases, you can enable +# use of these by uncommenting the following line. This will mean the build uses +# the network to check for artefacts at the start of builds, which does slow it down +# equally, it will also speed up the builds by not having to build things if they are +# present in the cache. It assumes you can download something faster than you can build it +# which will depend on your network. +# +#SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/2.5/PATH;downloadfilename=PATH" + +# +# Qemu configuration +# +# By default native qemu will build with a builtin VNC server where graphical output can be +# seen. The line below enables the SDL UI frontend too. +#PACKAGECONFIG_append:pn-qemu-system-native = " sdl" +# By default libsdl2-native will be built, if you want to use your host's libSDL instead of +# the minimal libsdl built by libsdl2-native then uncomment the ASSUME_PROVIDED line below. +#ASSUME_PROVIDED += "libsdl2-native" + +# You can also enable the Gtk UI frontend, which takes somewhat longer to build, but adds +# a handy set of menus for controlling the emulator. +#PACKAGECONFIG_append:pn-qemu-system-native = " gtk+" + +# +# Hash Equivalence +# +# Enable support for automatically running a local hash equivalence server and +# instruct bitbake to use a hash equivalence aware signature generator. Hash +# equivalence improves reuse of sstate by detecting when a given sstate +# artifact can be reused as equivalent, even if the current task hash doesn't +# match the one that generated the artifact. +# +# A shared hash equivalent server can be set with ":" format +# +#BB_HASHSERVE = "auto" +#BB_SIGNATURE_HANDLER = "OEEquivHash" + +# +# Memory Resident Bitbake +# +# Bitbake's server component can stay in memory after the UI for the current command +# has completed. This means subsequent commands can run faster since there is no need +# for bitbake to reload cache files and so on. Number is in seconds, after which the +# server will shut down. +# +#BB_SERVER_TIMEOUT = "60" + +# 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 = "2" + +require conf/distro/include/openeuler_hosttools.inc + +PATCHTOOL = "patch" +TCMODE = "external-openeuler" +INHERIT_remove += "uninative" +PATCHDEPENDENCY_remove += "patch-replacement-native:do_populate_sysroot" + +# openEuler software package dir +# all openeEuler software packages will be downloaded by specific tool +# into this dir with the following format: +# +# busybox +# openssh +# ..... +OPENEULER_SP_DIR = "/usr1/openeuler/src/" + +# the sysroot of native sdk of openeuler which contains all the native tools +# used for building openeuler +# +# OPENEULER_NATIVESDK_SYSROOT用于指向nativesdk工具目录 +OPENEULER_NATIVESDK_SYSROOT = "/opt/buildtools/nativesdk/sysroots/x86_64-pokysdk-linux" + +# openEuler cross toolchain dir +# prebuilt toolchain with c library is used to build openEuler embedded +# distribution. The prebuilt toolchain should be downloaded and placed in +# EXTERNAL_TOOLCHAIN with the following format: +# +# openeuler_gcc_arm64le +# openeuler_gcc_arm32le" +EXTERNAL_TOOLCHAIN_arm = "/usr1/openeuler/gcc/openeuler_gcc_arm32le" +EXTERNAL_TOOLCHAIN_aarch64 = "/usr1/openeuler/gcc/openeuler_gcc_arm64le" +EXTERNAL_TOOLCHAIN_x86-64 = "/usr1/openeuler/gcc/openeuler_gcc_x86_64" +EXTERNAL_TOOLCHAIN_riscv64 = "/usr1/openeuler/gcc/openeuler_gcc_riscv64" +EXTERNAL_TARGET_SYS_arm = "arm-openeuler-linux-gnueabi" +EXTERNAL_TARGET_SYS_aarch64 = "aarch64-openeuler-linux-gnu" +EXTERNAL_TARGET_SYS_x86-64 = "x86_64-openeuler-linux-gnu" +EXTERNAL_TARGET_SYS_riscv64 = "riscv64-openeuler-linux-gnu" + +# default openeuler platform +OPENEULER_PLATFORM = "aarch64-std" +MACHINEOVERRIDES =. "${OPENEULER_PLATFORM}:" + +# add openeuler security flags +require conf/distro/include/security_flags.inc +require conf/distro/include/security_flags_openeuler.inc + +# OE-built toolchains assume en_US is utf8 +EXTERNAL_TOOLCHAIN_FEATURES_DEFAULT = "locale-utf8-is-default" + +# define root home, default /home/root +ROOT_HOME ?= "/root" + +# define default init and device manager +OPENEULER_INIT_MANAGER = "mdev-busybox" +OPENEULER_DEV_MANAGER = "busybox-mdev" + +# set default kernel provider +PREFERRED_PROVIDER_virtual/kernel = "linux-openeuler" + +OPENEULER_BRANCH = "openEuler-23.03" +OPENEULER_GIT_URL = "https://gitee.com/src-openeuler" diff --git a/.oebuild/platform/aarch64-std.yaml b/.oebuild/platform/aarch64-std.yaml new file mode 100644 index 0000000000000000000000000000000000000000..653a47d920e100d1f3f25eb58758d586acd03de5 --- /dev/null +++ b/.oebuild/platform/aarch64-std.yaml @@ -0,0 +1,5 @@ +type: platform + +machine: qemu-aarch64 + +toolchain_type: EXTERNAL_TOOLCHAIN_aarch64 diff --git a/.oebuild/platform/arm-std.yaml b/.oebuild/platform/arm-std.yaml new file mode 100644 index 0000000000000000000000000000000000000000..729ca593c892741037a8029bea691cad9f9ce9b5 --- /dev/null +++ b/.oebuild/platform/arm-std.yaml @@ -0,0 +1,5 @@ +type: platform + +machine: qemu-arm + +toolchain_type: EXTERNAL_TOOLCHAIN_arm diff --git a/.oebuild/platform/hi3093.yaml b/.oebuild/platform/hi3093.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2b5fee86ee18c98a00bde6fe2680a645a0d3e4a1 --- /dev/null +++ b/.oebuild/platform/hi3093.yaml @@ -0,0 +1,8 @@ +type: platform + +machine: hi3093 + +toolchain_type: EXTERNAL_TOOLCHAIN_aarch64 + +layers: + - yocto-meta-openeuler/bsp/meta-hisilicon diff --git a/.oebuild/platform/ok3568.yaml b/.oebuild/platform/ok3568.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eb475b0ea8c39bff273df1ce886f6d1e53e5e7a3 --- /dev/null +++ b/.oebuild/platform/ok3568.yaml @@ -0,0 +1,8 @@ +type: platform + +machine: ok3568 + +toolchain_type: EXTERNAL_TOOLCHAIN_aarch64 + +layers: + - yocto-meta-openeuler/bsp/meta-rockchip diff --git a/.oebuild/platform/raspberrypi4-64.yaml b/.oebuild/platform/raspberrypi4-64.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4c9869e8d68a6d055180cff41f068d42182daa0c --- /dev/null +++ b/.oebuild/platform/raspberrypi4-64.yaml @@ -0,0 +1,8 @@ +type: platform + +machine: raspberrypi4-64 + +toolchain_type: EXTERNAL_TOOLCHAIN_aarch64 + +layers: + - yocto-meta-openeuler/bsp/meta-raspberrypi diff --git a/.oebuild/platform/riscv64-std.yaml b/.oebuild/platform/riscv64-std.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8655da9790b509119502f4dec078f0d580de6627 --- /dev/null +++ b/.oebuild/platform/riscv64-std.yaml @@ -0,0 +1,5 @@ +type: platform + +machine: qemu-riscv64 + +toolchain_type: EXTERNAL_TOOLCHAIN_riscv64 diff --git a/.oebuild/platform/ryd-3568.yaml b/.oebuild/platform/ryd-3568.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b0d0baa7c3e813b23375bcd3d2e32b40f02d89d7 --- /dev/null +++ b/.oebuild/platform/ryd-3568.yaml @@ -0,0 +1,8 @@ +type: platform + +machine: ryd-3568 + +toolchain_type: EXTERNAL_TOOLCHAIN_aarch64 + +layers: + - yocto-meta-openeuler/bsp/meta-rockchip diff --git a/.oebuild/platform/x86-64-std.yaml b/.oebuild/platform/x86-64-std.yaml new file mode 100644 index 0000000000000000000000000000000000000000..96e4b25a63ffc63ea3e97c21bd99e330a5b58b66 --- /dev/null +++ b/.oebuild/platform/x86-64-std.yaml @@ -0,0 +1,5 @@ +type: platform + +machine: generic-x86-64 + +toolchain_type: EXTERNAL_TOOLCHAIN_x86-64 diff --git a/.oebuild/relies.yaml b/.oebuild/relies.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3ca790736c49394c8c173118fd3c453e639ec7cd --- /dev/null +++ b/.oebuild/relies.yaml @@ -0,0 +1,443 @@ +# openEuler Embedded builds the full repository file that depends + +# This file lists all the dependencies involved in openEuler Embedded, +# and the check file of the file is suffixed with the same file name +# plus .sha256 under the same path, and it is recommended to verify the +# integrity of the file before using the file in a closed environment + +sha256_file: relies.yaml.sha256 + +# Please add back and refresh the SHA256 check file +relies: +- local_name: kernel-5.10 + remote_url: https://gitee.com/openeuler/kernel.git +- local_name: src-kernel-5.10 + remote_url: https://gitee.com/src-openeuler/kernel.git +- local_name: busybox + remote_url: https://gitee.com/src-openeuler/busybox.git +- local_name: dsoftbus_standard + remote_url: https://gitee.com/openeuler/dsoftbus_standard.git +- local_name: libboundscheck + remote_url: https://gitee.com/src-openeuler/libboundscheck.git +- local_name: cjson + remote_url: https://gitee.com/src-openeuler/cjson.git +- local_name: yocto-embedded-tools + remote_url: https://gitee.com/openeuler/yocto-embedded-tools.git +- local_name: embedded-ipc + remote_url: https://gitee.com/openeuler/embedded-ipc.git +- local_name: yocto-poky + remote_url: https://gitee.com/openeuler/yocto-poky.git +- local_name: yocto-pseudo + remote_url: https://gitee.com/src-openeuler/yocto-pseudo.git +- local_name: yocto-meta-openembedded + remote_url: https://gitee.com/openeuler/yocto-meta-openembedded.git +- local_name: yocto-meta-ros + remote_url: https://gitee.com/openeuler/yocto-meta-ros.git +- local_name: audit + remote_url: https://gitee.com/src-openeuler/audit.git +- local_name: cracklib + remote_url: https://gitee.com/src-openeuler/cracklib.git +- local_name: libcap-ng + remote_url: https://gitee.com/src-openeuler/libcap-ng.git +- local_name: libpwquality + remote_url: https://gitee.com/src-openeuler/libpwquality.git +- local_name: openssh + remote_url: https://gitee.com/src-openeuler/openssh.git +- local_name: libnsl2 + remote_url: https://gitee.com/src-openeuler/libnsl2.git +- local_name: openssl + remote_url: https://gitee.com/src-openeuler/openssl.git +- local_name: pam + remote_url: https://gitee.com/src-openeuler/pam.git +- local_name: shadow + remote_url: https://gitee.com/src-openeuler/shadow.git +- local_name: ncurses + remote_url: https://gitee.com/src-openeuler/ncurses.git +- local_name: bash + remote_url: https://gitee.com/src-openeuler/bash.git +- local_name: libtirpc + remote_url: https://gitee.com/src-openeuler/libtirpc.git +- local_name: grep + remote_url: https://gitee.com/src-openeuler/grep.git +- local_name: pcre + remote_url: https://gitee.com/src-openeuler/pcre.git +- local_name: less + remote_url: https://gitee.com/src-openeuler/less.git +- local_name: gzip + remote_url: https://gitee.com/src-openeuler/gzip.git +- local_name: xz + remote_url: https://gitee.com/src-openeuler/xz.git +- local_name: lzo + remote_url: https://gitee.com/src-openeuler/lzo.git +- local_name: lz4 + remote_url: https://gitee.com/src-openeuler/lz4.git +- local_name: bzip2 + remote_url: https://gitee.com/src-openeuler/bzip2.git +- local_name: sed + remote_url: https://gitee.com/src-openeuler/sed.git +- local_name: json-c + remote_url: https://gitee.com/src-openeuler/json-c.git +- local_name: ethtool + remote_url: https://gitee.com/src-openeuler/ethtool.git +- local_name: expat + remote_url: https://gitee.com/src-openeuler/expat.git +- local_name: acl + remote_url: https://gitee.com/src-openeuler/acl.git +- local_name: attr + remote_url: https://gitee.com/src-openeuler/attr.git +- local_name: readline + remote_url: https://gitee.com/src-openeuler/readline.git +- local_name: libaio + remote_url: https://gitee.com/src-openeuler/libaio.git +- local_name: libffi + remote_url: https://gitee.com/src-openeuler/libffi.git +- local_name: popt + remote_url: https://gitee.com/src-openeuler/popt.git +- local_name: binutils + remote_url: https://gitee.com/src-openeuler/binutils.git +- local_name: elfutils + remote_url: https://gitee.com/src-openeuler/elfutils.git +- local_name: kexec-tools + remote_url: https://gitee.com/src-openeuler/kexec-tools.git +- local_name: psmisc + remote_url: https://gitee.com/src-openeuler/psmisc.git +- local_name: squashfs-tools + remote_url: https://gitee.com/src-openeuler/squashfs-tools.git +- local_name: strace + remote_url: https://gitee.com/src-openeuler/strace.git +- local_name: util-linux + remote_url: https://gitee.com/src-openeuler/util-linux.git +- local_name: libsepol + remote_url: https://gitee.com/src-openeuler/libsepol.git +- local_name: libselinux + remote_url: https://gitee.com/src-openeuler/libselinux.git +- local_name: libsemanage + remote_url: https://gitee.com/src-openeuler/libsemanage.git +- local_name: policycoreutils + remote_url: https://gitee.com/src-openeuler/policycoreutils.git +- local_name: initscripts + remote_url: https://gitee.com/src-openeuler/initscripts.git +- local_name: libestr + remote_url: https://gitee.com/src-openeuler/libestr.git +- local_name: libfastjson + remote_url: https://gitee.com/src-openeuler/libfastjson.git +- local_name: logrotate + remote_url: https://gitee.com/src-openeuler/logrotate.git +- local_name: rsyslog + remote_url: https://gitee.com/src-openeuler/rsyslog.git +- local_name: cifs-utils + remote_url: https://gitee.com/src-openeuler/cifs-utils.git +- local_name: dosfstools + remote_url: https://gitee.com/src-openeuler/dosfstools.git +- local_name: e2fsprogs + remote_url: https://gitee.com/src-openeuler/e2fsprogs.git +- local_name: iproute + remote_url: https://gitee.com/src-openeuler/iproute.git +- local_name: iptables + remote_url: https://gitee.com/src-openeuler/iptables.git +- local_name: dhcp + remote_url: https://gitee.com/src-openeuler/dhcp.git +- local_name: libhugetlbfs + remote_url: https://gitee.com/src-openeuler/libhugetlbfs.git +- local_name: libnl3 + remote_url: https://gitee.com/src-openeuler/libnl3.git +- local_name: libpcap + remote_url: https://gitee.com/src-openeuler/libpcap.git +- local_name: nfs-utils + remote_url: https://gitee.com/src-openeuler/nfs-utils.git +- local_name: rpcbind + remote_url: https://gitee.com/src-openeuler/rpcbind.git +- local_name: cronie + remote_url: https://gitee.com/src-openeuler/cronie.git +- local_name: kmod + remote_url: https://gitee.com/src-openeuler/kmod.git +- local_name: libusbx + remote_url: https://gitee.com/src-openeuler/libusbx.git +- local_name: libxml2 + remote_url: https://gitee.com/src-openeuler/libxml2.git +- local_name: lvm2 + remote_url: https://gitee.com/src-openeuler/lvm2.git +- local_name: quota + remote_url: https://gitee.com/src-openeuler/quota.git +- local_name: pciutils + remote_url: https://gitee.com/src-openeuler/pciutils.git +- local_name: procps-ng + remote_url: https://gitee.com/src-openeuler/procps-ng.git +- local_name: tzdata + remote_url: https://gitee.com/src-openeuler/tzdata.git +- local_name: glib2 + remote_url: https://gitee.com/src-openeuler/glib2.git +- local_name: raspberrypi-firmware + remote_url: https://gitee.com/src-openeuler/raspberrypi-firmware.git +- local_name: gmp + remote_url: https://gitee.com/src-openeuler/gmp.git +- local_name: gdb + remote_url: https://gitee.com/src-openeuler/gdb.git +- local_name: libmetal + remote_url: https://gitee.com/src-openeuler/libmetal.git +- local_name: OpenAMP + remote_url: https://gitee.com/src-openeuler/OpenAMP.git +- local_name: sysfsutils + remote_url: https://gitee.com/src-openeuler/sysfsutils.git +- local_name: tcl + remote_url: https://gitee.com/src-openeuler/tcl.git +- local_name: expect + remote_url: https://gitee.com/src-openeuler/expect.git +- local_name: jitterentropy-library + remote_url: https://gitee.com/src-openeuler/jitterentropy-library.git +- local_name: m4 + remote_url: https://gitee.com/src-openeuler/m4.git +- local_name: gdbm + remote_url: https://gitee.com/src-openeuler/gdbm.git +- local_name: libtool + remote_url: https://gitee.com/src-openeuler/libtool.git +- local_name: libidn2 + remote_url: https://gitee.com/src-openeuler/libidn2.git +- local_name: libunistring + remote_url: https://gitee.com/src-openeuler/libunistring.git +- local_name: gnutls + remote_url: https://gitee.com/src-openeuler/gnutls.git +- local_name: nettle + remote_url: https://gitee.com/src-openeuler/nettle.git +- local_name: rng-tools + remote_url: https://gitee.com/src-openeuler/rng-tools.git +- local_name: bash-completion + remote_url: https://gitee.com/src-openeuler/bash-completion.git +- local_name: coreutils + remote_url: https://gitee.com/src-openeuler/coreutils.git +- local_name: findutils + remote_url: https://gitee.com/src-openeuler/findutils.git +- local_name: gawk + remote_url: https://gitee.com/src-openeuler/gawk.git +- local_name: libmnl + remote_url: https://gitee.com/src-openeuler/libmnl.git +- local_name: libuv + remote_url: https://gitee.com/src-openeuler/libuv.git +- local_name: flex + remote_url: https://gitee.com/src-openeuler/flex.git +- local_name: sqlite + remote_url: https://gitee.com/src-openeuler/sqlite.git +- local_name: bison + remote_url: https://gitee.com/src-openeuler/bison.git +- local_name: perl + remote_url: https://gitee.com/src-openeuler/perl.git +- local_name: userspace-rcu + remote_url: https://gitee.com/src-openeuler/userspace-rcu.git +- local_name: lttng-ust + remote_url: https://gitee.com/src-openeuler/lttng-ust.git +- local_name: libdb + remote_url: https://gitee.com/src-openeuler/libdb.git +- local_name: groff + remote_url: https://gitee.com/src-openeuler/groff.git +- local_name: nasm + remote_url: https://gitee.com/src-openeuler/nasm.git +- local_name: syslinux + remote_url: https://gitee.com/src-openeuler/syslinux.git +- local_name: cdrkit + remote_url: https://gitee.com/src-openeuler/cdrkit.git +- local_name: yocto-opkg-utils + remote_url: https://gitee.com/src-openeuler/yocto-opkg-utils.git +- local_name: python3 + remote_url: https://gitee.com/src-openeuler/python3.git +- local_name: libgpg-error + remote_url: https://gitee.com/src-openeuler/libgpg-error.git +- local_name: libgcrypt + remote_url: https://gitee.com/src-openeuler/libgcrypt.git +- local_name: kbd + remote_url: https://gitee.com/src-openeuler/kbd.git +- local_name: autoconf-archive + remote_url: https://gitee.com/src-openeuler/autoconf-archive.git +- local_name: libxslt + remote_url: https://gitee.com/src-openeuler/libxslt.git +- local_name: dbus + remote_url: https://gitee.com/src-openeuler/dbus.git +- local_name: wpa_supplicant + remote_url: https://gitee.com/src-openeuler/wpa_supplicant.git +- local_name: grub2 + remote_url: https://gitee.com/src-openeuler/grub2.git +- local_name: parted + remote_url: https://gitee.com/src-openeuler/parted.git +- local_name: intltool + remote_url: https://gitee.com/src-openeuler/intltool.git +- local_name: tar + remote_url: https://gitee.com/src-openeuler/tar.git +- local_name: perl-XML-Parser + remote_url: https://gitee.com/src-openeuler/perl-XML-Parser.git +- local_name: systemd + remote_url: https://gitee.com/src-openeuler/systemd.git +- local_name: gnu-efi + remote_url: https://gitee.com/src-openeuler/gnu-efi.git +- local_name: screen + remote_url: https://gitee.com/src-openeuler/screen.git +- local_name: pcre2 + remote_url: https://gitee.com/src-openeuler/pcre2.git +- local_name: mosquitto + remote_url: https://gitee.com/src-openeuler/mosquitto.git +- local_name: uthash + remote_url: https://gitee.com/src-openeuler/uthash.git +- local_name: check + remote_url: https://gitee.com/src-openeuler/check.git +- local_name: ppp + remote_url: https://gitee.com/src-openeuler/ppp.git +- local_name: libinput + remote_url: https://gitee.com/src-openeuler/libinput.git +- local_name: freetype + remote_url: https://gitee.com/src-openeuler/freetype.git +- local_name: wayland + remote_url: https://gitee.com/src-openeuler/wayland.git +- local_name: mesa + remote_url: https://gitee.com/src-openeuler/mesa.git +- local_name: libdrm + remote_url: https://gitee.com/src-openeuler/libdrm.git +- local_name: xorg-x11-proto-devel + remote_url: https://gitee.com/src-openeuler/xorg-x11-proto-devel.git +- local_name: tslib + remote_url: https://gitee.com/src-openeuler/tslib.git +- local_name: libevdev + remote_url: https://gitee.com/src-openeuler/libevdev.git +- local_name: mtd-utils + remote_url: https://gitee.com/src-openeuler/mtd-utils.git +- local_name: dtc + remote_url: https://gitee.com/src-openeuler/dtc.git +- local_name: libunwind + remote_url: https://gitee.com/src-openeuler/libunwind.git +- local_name: libatomic_ops + remote_url: https://gitee.com/src-openeuler/libatomic_ops.git +- local_name: libmodbus + remote_url: https://gitee.com/src-openeuler/libmodbus.git +- local_name: python-argcomplete + remote_url: https://gitee.com/src-openeuler/python-argcomplete.git +- local_name: python-asn1crypto + remote_url: https://gitee.com/src-openeuler/python-asn1crypto.git +- local_name: python-cmd2 + remote_url: https://gitee.com/src-openeuler/python-cmd2.git +- local_name: python-Cython + remote_url: https://gitee.com/src-openeuler/python-Cython.git +- local_name: python-dateutil + remote_url: https://gitee.com/src-openeuler/python-dateutil.git +- local_name: python-docutils + remote_url: https://gitee.com/src-openeuler/python-docutils.git +- local_name: python-idna + remote_url: https://gitee.com/src-openeuler/python-idna.git +- local_name: python-importlib-metadata + remote_url: https://gitee.com/src-openeuler/python-importlib-metadata.git +- local_name: python-lxml + remote_url: https://gitee.com/src-openeuler/python-lxml.git +- local_name: python-mccabe + remote_url: https://gitee.com/src-openeuler/python-mccabe.git +- local_name: python-mock + remote_url: https://gitee.com/src-openeuler/python-mock.git +- local_name: python-more-itertools + remote_url: https://gitee.com/src-openeuler/python-more-itertools.git +- local_name: python-netifaces + remote_url: https://gitee.com/src-openeuler/python-netifaces.git +- local_name: numpy + remote_url: https://gitee.com/src-openeuler/numpy.git +- local_name: python-packaging + remote_url: https://gitee.com/src-openeuler/python-packaging.git +- local_name: python-pathlib2 + remote_url: https://gitee.com/src-openeuler/python-pathlib2.git +- local_name: python-pep8 + remote_url: https://gitee.com/src-openeuler/python-pep8.git +- local_name: python-pip + remote_url: https://gitee.com/src-openeuler/python-pip.git +- local_name: python-ply + remote_url: https://gitee.com/src-openeuler/python-ply.git +- local_name: python-prettytable + remote_url: https://gitee.com/src-openeuler/python-prettytable.git +- local_name: pybind11 + remote_url: https://gitee.com/src-openeuler/pybind11.git +- local_name: pyflakes + remote_url: https://gitee.com/src-openeuler/pyflakes.git +- local_name: pyparsing + remote_url: https://gitee.com/src-openeuler/pyparsing.git +- local_name: python-pyperclip + remote_url: https://gitee.com/src-openeuler/python-pyperclip.git +- local_name: pytest + remote_url: https://gitee.com/src-openeuler/pytest.git +- local_name: PyYAML + remote_url: https://gitee.com/src-openeuler/PyYAML.git +- local_name: python-setuptools + remote_url: https://gitee.com/src-openeuler/python-setuptools.git +- local_name: python-setuptools_scm + remote_url: https://gitee.com/src-openeuler/python-setuptools_scm.git +- local_name: python-toml + remote_url: https://gitee.com/src-openeuler/python-toml.git +- local_name: python-zipp + remote_url: https://gitee.com/src-openeuler/python-zipp.git +- local_name: meson + remote_url: https://gitee.com/src-openeuler/meson.git +- local_name: gnupg2 + remote_url: https://gitee.com/src-openeuler/gnupg2.git +- local_name: gobject-introspection + remote_url: https://gitee.com/src-openeuler/gobject-introspection.git +- local_name: libassuan + remote_url: https://gitee.com/src-openeuler/libassuan.git +- local_name: gpgme + remote_url: https://gitee.com/src-openeuler/gpgme.git +- local_name: gtk-doc + remote_url: https://gitee.com/src-openeuler/gtk-doc.git +- local_name: libdnf + remote_url: https://gitee.com/src-openeuler/libdnf.git +- local_name: libksba + remote_url: https://gitee.com/src-openeuler/libksba.git +- local_name: libmodulemd + remote_url: https://gitee.com/src-openeuler/libmodulemd.git +- local_name: libyaml + remote_url: https://gitee.com/src-openeuler/libyaml.git +- local_name: lua + remote_url: https://gitee.com/src-openeuler/lua.git +- local_name: npth + remote_url: https://gitee.com/src-openeuler/npth.git +- local_name: pinentry + remote_url: https://gitee.com/src-openeuler/pinentry.git +- local_name: python-six + remote_url: https://gitee.com/src-openeuler/python-six.git +- local_name: python-iniparse + remote_url: https://gitee.com/src-openeuler/python-iniparse.git +- local_name: python-setuptools + remote_url: https://gitee.com/src-openeuler/python-setuptools.git +- local_name: swig + remote_url: https://gitee.com/src-openeuler/swig.git +- local_name: dnf + remote_url: https://gitee.com/src-openeuler/dnf.git +- local_name: file + remote_url: https://gitee.com/src-openeuler/file.git +- local_name: libcomps + remote_url: https://gitee.com/src-openeuler/libcomps.git +- local_name: librepo + remote_url: https://gitee.com/src-openeuler/librepo.git +- local_name: zstd + remote_url: https://gitee.com/src-openeuler/zstd.git +- local_name: libsolv + remote_url: https://gitee.com/src-openeuler/libsolv.git +- local_name: rpm + remote_url: https://gitee.com/src-openeuler/rpm.git +- local_name: tcpdump + remote_url: https://gitee.com/src-openeuler/tcpdump.git +- local_name: zlib + remote_url: https://gitee.com/src-openeuler/zlib.git +- local_name: libcap + remote_url: https://gitee.com/src-openeuler/libcap.git +- local_name: yajl + remote_url: https://gitee.com/src-openeuler/yajl.git +- local_name: libseccomp + remote_url: https://gitee.com/src-openeuler/libseccomp.git +- local_name: curl + remote_url: https://gitee.com/src-openeuler/curl.git +- local_name: lxc + remote_url: https://gitee.com/src-openeuler/lxc.git +- local_name: lcr + remote_url: https://gitee.com/src-openeuler/lcr.git +- local_name: libarchive + remote_url: https://gitee.com/src-openeuler/libarchive.git +- local_name: libevent + remote_url: https://gitee.com/src-openeuler/libevent.git +- local_name: libevhtp + remote_url: https://gitee.com/src-openeuler/libevhtp.git +- local_name: http-parser + remote_url: https://gitee.com/src-openeuler/http-parser.git +- local_name: libwebsockets + remote_url: https://gitee.com/src-openeuler/libwebsockets.git +- local_name: iSulad + remote_url: https://gitee.com/src-openeuler/iSulad.git diff --git a/.oebuild/relies.yaml.sha256 b/.oebuild/relies.yaml.sha256 new file mode 100644 index 0000000000000000000000000000000000000000..a390588addc1c9f989fd0ca0af3e598ecbcba967 --- /dev/null +++ b/.oebuild/relies.yaml.sha256 @@ -0,0 +1 @@ +f1895098246c40f99f7b7757b01ad13598d9ae859cddcfe7674b4157ca83c0c9 relies.yaml diff --git a/README.md b/README.md index b68810d6f3f3a8b70838b69a6406369acfc1b19d..798d77686d9ad2aa364b75d9d01d7a02259bb531 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# yocto-meta-embedded +# yocto-meta-openeuler ## 介绍 -yocto-meta-embedded是用于构建openEuler Embedded所需要的一系列工具、构建配方的集合, +yocto-meta-openeuler是用于构建openEuler Embedded所需要的一系列工具、构建配方的集合, 以及当前openEuler Embedded开发使用文档的承载仓库。 -yocto-meta-embedded核心是构建Yocto Poky之上,但针对openEuler Embedded的需求做了大 +yocto-meta-openeuler核心是构建Yocto Poky之上,但针对openEuler Embedded的需求做了大 量的定制化的修改,包括但不限于: * 与openEuler其他场景的Linux, 共享软件包,共演进 @@ -57,13 +57,26 @@ yocto-meta-embedded核心是构建Yocto Poky之上,但针对openEuler Embedded ``` 之后便可以运行 **bitbake <目标,例如openeuler-image-tiny>** 开始构建 -6. 由于openEuler Embedded采取了**尽可能不构建主机工具**的策略,因此在构建主机上需要实现准备好相应的工具,具体所需要的工具可以从**src/yocto-meta-openeuler/meta-openeuler/conf/local.conf.sample**中的**HOSTTOOLS_XXX**相关变量中获得,另一种推荐的方法是采用容器构建,具体如下: +6. 由于openEuler Embedded采取了**尽可能不构建主机工具**的策略,因此在构建主机上需要事先准备好相应的工具,具体所需要的工具可以从**src/yocto-meta-openeuler/meta-openeuler/conf/local.conf.sample**中的**HOSTTOOLS_XXX**相关变量中获得,另一种推荐的方法是采用容器构建,具体如下: - [**openEuler Embedded容器构建**](https://openeuler.gitee.io/yocto-meta-openeuler/yocto/quickbuild/container-build.html) + [**openEuler Embedded容器构建**](https://openeuler.gitee.io/yocto-meta-openeuler/master/yocto/quickbuild/container-build.html) ## 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 + +一个合格的git提交信息如下所示,请尽可能在提交信息中描述相关信息,例如修改的原因,改动的地方,如何验证等等: + +``` +  module: this is git commit msg titile + + this is git commit msg body + + Signed-off-by: xxxx +``` + +本仓库采用了gitlint检查每次git提交, 建议提交前使用 [**gitlint**](https://jorisroovers.com/gitlint) 检查您的提交,以避免CI门禁检查失败. + 4. 新建 Pull Request diff --git a/bsp/meta-hisilicon/COPYING.MIT b/bsp/meta-hisilicon/COPYING.MIT new file mode 100644 index 0000000000000000000000000000000000000000..fb950dc69feb8afa93493747f33d6e1c02659b55 --- /dev/null +++ b/bsp/meta-hisilicon/COPYING.MIT @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/bsp/meta-hisilicon/README b/bsp/meta-hisilicon/README new file mode 100644 index 0000000000000000000000000000000000000000..7f48e6f4b0a05f7ed7b6bfe9945ee9113a369ccc --- /dev/null +++ b/bsp/meta-hisilicon/README @@ -0,0 +1,41 @@ +This README file contains information on the contents of the meta-hisilicon layer. + +Please see the corresponding sections below for details. + +Dependencies +============ + + URI: + branch: + + URI: + branch: + + . + . + . + +Patches +======= + +Please submit any patches against the meta-hisilicon layer to the xxxx mailing list (xxxx@zzzz.org) +and cc: the maintainer: + +Maintainer: XXX YYYYYY + +Table of Contents +================= + + I. Adding the meta-hisilicon layer to your build + II. Misc + + +I. Adding the meta-hisilicon layer to your build +================================================= + +Run 'bitbake-layers add-layer meta-hisilicon' + +II. Misc +======== + +--- replace with specific information about the meta-hisilicon layer --- diff --git a/bsp/meta-hisilicon/conf/layer.conf b/bsp/meta-hisilicon/conf/layer.conf new file mode 100644 index 0000000000000000000000000000000000000000..d5f760d81e87187b457d36ed649cfdb4b3730818 --- /dev/null +++ b/bsp/meta-hisilicon/conf/layer.conf @@ -0,0 +1,19 @@ +# 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 += "hisilicon" +BBFILE_PATTERN_hisilicon = "^${LAYERDIR}/" +BBFILE_PRIORITY_hisilicon = "6" + +LAYERDEPENDS_hisilicon = "core" +LAYERSERIES_COMPAT_hisilicon = "hardknott" + +# enable .bb under qt5-layer/ when exist meta-qt5 +BBFILES_DYNAMIC += " \ +qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/recipes-*/*/*.bb \ +qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/recipes-*/*/*.bbappend \ +" diff --git a/bsp/meta-hisilicon/conf/machine/hi3093.conf b/bsp/meta-hisilicon/conf/machine/hi3093.conf new file mode 100644 index 0000000000000000000000000000000000000000..f40b0f2a2a965af531a0598bd0a9698330919b72 --- /dev/null +++ b/bsp/meta-hisilicon/conf/machine/hi3093.conf @@ -0,0 +1 @@ +require conf/machine/include/hi1711.inc diff --git a/bsp/meta-hisilicon/conf/machine/include/hi1711.inc b/bsp/meta-hisilicon/conf/machine/include/hi1711.inc new file mode 100644 index 0000000000000000000000000000000000000000..a5fb562509433c3c10e8bbd0d3051af7fedf45bb --- /dev/null +++ b/bsp/meta-hisilicon/conf/machine/include/hi1711.inc @@ -0,0 +1,27 @@ +include conf/machine/include/tune-cortexa55.inc +MACHINE_FEATURES += "efi pci vc4graphics" +MACHINEOVERRIDES =. "hi1711:march64le:" +DEFAULTTUNE = "aarch64" + +require conf/multilib.conf +# currently, don't support 32 bit libs +MULTILIBS = "" + +ROOTFS_PACKAGE_ARCH = "aarch64" + +# set IMAGETYPE and dtb +KERNEL_IMAGETYPE = "zImage" +# choose dtb file +KERNEL_DEVICETREE = "" +ENABLE_UART = "1" +# serial port enabled in hi1711 +CMDLINE_SERIAL = "ttyS0,115200" +SERIAL_CONSOLES = "115200;ttyS0" + +# arm and arm64 both support -mlittle-endian so no +# need to consider compat32. +TUNE_CCARGS .= " -mlittle-endian" +IMAGE_INSTALL_append = " kernel-modules" + +# auto load module during startup +KERNEL_MODULE_AUTOLOAD = "" diff --git a/bsp/meta-hisilicon/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend b/bsp/meta-hisilicon/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b2aebdd5534043929ff9bf35fba496abecbaff30 --- /dev/null +++ b/bsp/meta-hisilicon/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend @@ -0,0 +1,19 @@ +PACKAGECONFIG_GL = "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'gl', \ + bb.utils.contains('DISTRO_FEATURES', 'opengl', 'eglfs gles2', \ + '', d), d)}" +PACKAGECONFIG_GL_append = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', ' kms', '', d)}" +PACKAGECONFIG_GL_append = " gbm" +PACKAGECONFIG_FONTS = "fontconfig" +PACKAGECONFIG_append = " libinput examples tslib xkbcommon" +PACKAGECONFIG_remove = "tests" + +OE_QTBASE_EGLFS_DEVICE_INTEGRATION = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', 'eglfs_brcm', d)}" + +do_configure_prepend() { + # Add the appropriate EGLFS_DEVICE_INTEGRATION + if [ "${@d.getVar('OE_QTBASE_EGLFS_DEVICE_INTEGRATION')}" != "" ]; then + echo "EGLFS_DEVICE_INTEGRATION = ${OE_QTBASE_EGLFS_DEVICE_INTEGRATION}" >> ${S}/mkspecs/oe-device-extra.pri + fi +} +RDEPENDS_${PN}_append = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', ' userland', d)}" +DEPENDS_append = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', ' userland', d)}" diff --git a/bsp/meta-hisilicon/recipes-core/images/hi1711.inc b/bsp/meta-hisilicon/recipes-core/images/hi1711.inc new file mode 100644 index 0000000000000000000000000000000000000000..17d26821aed8fcd18b14393a9f8e0edd3639b58e --- /dev/null +++ b/bsp/meta-hisilicon/recipes-core/images/hi1711.inc @@ -0,0 +1,28 @@ +IMAGE_FSTYPES = "cpio.gz" +IMAGE_FSTYPES_remove = "iso" +IMAGE_FSTYPES_DEBUGFS = "cpio.gz" +INITRAMFS_MAXSIZE = "476591" + +delete_unneeded_from_rootfs() { + set -x + test -d "${OUTPUT_DIR}" || mkdir -p "${OUTPUT_DIR}" + rm -rf "${OUTPUT_DIR}"/* + cd "${IMAGE_ROOTFS}" + cp -r boot/* "${OUTPUT_DIR}" + # just need the boot dir, others in boot are not needed to reduce the size of image. + rm -rf ./boot/* + cd - + set +x +} +IMAGE_PREPROCESS_COMMAND += "delete_unneeded_from_rootfs;" + +copy_hi1711_distro() { + set -x + for IMAGETYPE in ${IMAGE_FSTYPES} + do + rm -f "${OUTPUT_DIR}"/${IMAGE_NAME}${IMAGE_NAME_SUFFIX%.rootfs}.*${IMAGETYPE} + cp -fp ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX%.rootfs}.*${IMAGETYPE} ${OUTPUT_DIR}/ + done + set +x +} +IMAGE_POSTPROCESS_COMMAND += "copy_hi1711_distro;" diff --git a/bsp/meta-hisilicon/recipes-core/images/hi3093.inc b/bsp/meta-hisilicon/recipes-core/images/hi3093.inc new file mode 100644 index 0000000000000000000000000000000000000000..785649bd4e49feea50e75424f621ddc44d90b60d --- /dev/null +++ b/bsp/meta-hisilicon/recipes-core/images/hi3093.inc @@ -0,0 +1 @@ +require hi1711.inc diff --git a/bsp/meta-hisilicon/recipes-core/images/openeuler-image-mcs.bbappend b/bsp/meta-hisilicon/recipes-core/images/openeuler-image-mcs.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e089aeff828f8eeb29dfc38a10f6704c8d9d0ba9 --- /dev/null +++ b/bsp/meta-hisilicon/recipes-core/images/openeuler-image-mcs.bbappend @@ -0,0 +1,5 @@ +# Zephyr and Jailhouse do not currently support hi3093, so remove them. +IMAGE_INSTALL_remove = " \ + zephyr-image \ + ${@bb.utils.contains('MCS_FEATURES', 'jailhouse', 'jailhouse', '', d)} \ + " diff --git a/bsp/meta-hisilicon/recipes-core/images/openeuler-image-tiny.bbappend b/bsp/meta-hisilicon/recipes-core/images/openeuler-image-tiny.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bc4dcfe5823d7265a82c27f8849e2bba64e9074a --- /dev/null +++ b/bsp/meta-hisilicon/recipes-core/images/openeuler-image-tiny.bbappend @@ -0,0 +1 @@ +do_rootfs[depends] = "opkg-utils-native:do_populate_sysroot" diff --git a/bsp/meta-hisilicon/recipes-core/images/openeuler-image.bbappend b/bsp/meta-hisilicon/recipes-core/images/openeuler-image.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bc4dcfe5823d7265a82c27f8849e2bba64e9074a --- /dev/null +++ b/bsp/meta-hisilicon/recipes-core/images/openeuler-image.bbappend @@ -0,0 +1 @@ +do_rootfs[depends] = "opkg-utils-native:do_populate_sysroot" diff --git a/bsp/meta-hisilicon/recipes-core/packagegroups/packagegroup-base.bbappend b/bsp/meta-hisilicon/recipes-core/packagegroups/packagegroup-base.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d3a59a30727519b7c0ab5873319f17e1e284e4e6 --- /dev/null +++ b/bsp/meta-hisilicon/recipes-core/packagegroups/packagegroup-base.bbappend @@ -0,0 +1,3 @@ +RDEPENDS_packagegroup-base_append += " \ +e2fsprogs-resize2fs \ +" diff --git a/bsp/meta-hisilicon/recipes-core/packagegroups/packagegroup-core-boot.bbappend b/bsp/meta-hisilicon/recipes-core/packagegroups/packagegroup-core-boot.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ca2717c60a72eccdec9fbb8f9144551a0cc85f0c --- /dev/null +++ b/bsp/meta-hisilicon/recipes-core/packagegroups/packagegroup-core-boot.bbappend @@ -0,0 +1,4 @@ +# we add bootfile +RDEPENDS_${PN} += " \ + bootfile \ +" diff --git a/bsp/meta-hisilicon/recipes-graphics/mesa/mesa_%.bbappend b/bsp/meta-hisilicon/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..33cefa79ff43d1a441529a1acde10a8727f02ab3 --- /dev/null +++ b/bsp/meta-hisilicon/recipes-graphics/mesa/mesa_%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG_append_hi1711 = " gallium vc4 v3d kmsro ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)}" diff --git a/bsp/meta-hisilicon/recipes-kernel/linux/files/dtbs/hi3093-mcs.dtb b/bsp/meta-hisilicon/recipes-kernel/linux/files/dtbs/hi3093-mcs.dtb new file mode 100644 index 0000000000000000000000000000000000000000..7895a8ec0049ffdb922132f1ade689051a3eecc7 Binary files /dev/null and b/bsp/meta-hisilicon/recipes-kernel/linux/files/dtbs/hi3093-mcs.dtb differ diff --git a/bsp/meta-hisilicon/recipes-kernel/linux/files/dtbs/hi3093.dtb b/bsp/meta-hisilicon/recipes-kernel/linux/files/dtbs/hi3093.dtb new file mode 100644 index 0000000000000000000000000000000000000000..0eaf8e95279f01992da9338fdde5d0a96e70b121 Binary files /dev/null and b/bsp/meta-hisilicon/recipes-kernel/linux/files/dtbs/hi3093.dtb differ diff --git a/bsp/meta-hisilicon/recipes-kernel/linux/files/tools/mkimage b/bsp/meta-hisilicon/recipes-kernel/linux/files/tools/mkimage new file mode 100755 index 0000000000000000000000000000000000000000..7101799495b98e2731920adc7ba831a3180df335 Binary files /dev/null and b/bsp/meta-hisilicon/recipes-kernel/linux/files/tools/mkimage differ diff --git a/bsp/meta-hisilicon/recipes-kernel/linux/linux-hisilicon.inc b/bsp/meta-hisilicon/recipes-kernel/linux/linux-hisilicon.inc new file mode 100644 index 0000000000000000000000000000000000000000..4999a8c6b965c11805a1ea518d95af30c0d1a494 --- /dev/null +++ b/bsp/meta-hisilicon/recipes-kernel/linux/linux-hisilicon.inc @@ -0,0 +1,25 @@ +# add recipes-kernel path to find patch and defconfig +FILESEXTRAPATHS_append := "${THISDIR}/files/:" +# add prebuild tools to make uImage +SRC_URI_append = " \ + file://dtbs \ + file://tools \ +" + +# add patch tool to solve patch apply +PATCHTOOL = "git" + +# add method to do_compile task to produce bootable Image +do_compile_append_hi1711(){ + ../tools/mkimage -A arm -O linux -T kernel -C none -a 0x98280000 -e 0x98280040 -n linux-5.10.0 -d ${KERNEL_OUTPUT_DIR}/zImage uImage +} + +# add uImage to $D +do_install_append(){ + cp uImage ${D}/boot + cp ../dtbs/hi3093*.dtb ${D}/boot +} +PACKAGES += "bootfile" +FILES_bootfile="/boot/uImage \ +${@bb.utils.contains('MCS_FEATURES', 'hi3093', '/boot/hi3093-mcs.dtb', '/boot/hi3093.dtb', d)} \ +" diff --git a/bsp/meta-hisilicon/recipes-kernel/linux/linux-openeuler-rt.bbappend b/bsp/meta-hisilicon/recipes-kernel/linux/linux-openeuler-rt.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..066f58af3def22302c302205f744e1948ea1e60d --- /dev/null +++ b/bsp/meta-hisilicon/recipes-kernel/linux/linux-openeuler-rt.bbappend @@ -0,0 +1,4 @@ +require recipes-kernel/linux/linux-hisilicon.inc + +# add COMPATIBLE_MACHINE +COMPATIBLE_MACHINE = "hi3093" diff --git a/bsp/meta-hisilicon/recipes-kernel/linux/linux-openeuler.bbappend b/bsp/meta-hisilicon/recipes-kernel/linux/linux-openeuler.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..066f58af3def22302c302205f744e1948ea1e60d --- /dev/null +++ b/bsp/meta-hisilicon/recipes-kernel/linux/linux-openeuler.bbappend @@ -0,0 +1,4 @@ +require recipes-kernel/linux/linux-hisilicon.inc + +# add COMPATIBLE_MACHINE +COMPATIBLE_MACHINE = "hi3093" diff --git a/bsp/meta-hisilicon/recipes-mcs/mcs-linux/files/0001-mcs_km-adapted-for-hi3093.patch b/bsp/meta-hisilicon/recipes-mcs/mcs-linux/files/0001-mcs_km-adapted-for-hi3093.patch new file mode 100644 index 0000000000000000000000000000000000000000..dfc86dfcb7504c96d95e39f3d646bcc8ddabc148 --- /dev/null +++ b/bsp/meta-hisilicon/recipes-mcs/mcs-linux/files/0001-mcs_km-adapted-for-hi3093.patch @@ -0,0 +1,35 @@ +From 3d44c63e1d442b2766d62b710f5af6fd46ae98ef Mon Sep 17 00:00:00 2001 +From: hanzongcheng +Date: Sat, 25 Mar 2023 12:11:51 +0800 +Subject: [PATCH] mcs_km: adapted for hi3093 + +* The parameter that actually needs to be passed to start the slave core is + cpu mpidr, which we haven't perfected yet. According to the cpu reg config + in dts, manually shift the cpu id left by eight bits to get mpidr + (e.g. 0x3 --> 0x300). + +Signed-off-by: hanzongcheng + +diff --git a/mcs_km.c b/mcs_km.c +index 14773dd..aabb696 100644 +--- a/mcs_km.c ++++ b/mcs_km.c +@@ -141,6 +141,7 @@ static long mcs_ioctl(struct file *f, unsigned int cmd, unsigned long arg) + + pr_info("start booting clientos on cpu(%d) addr(0x%lx)\n", cpu_id, cpu_boot_addr); + ++ cpu_id = cpu_id << 8; + ret = invoke_psci_fn(CPU_ON_FUNCID, cpu_id, cpu_boot_addr, 0); + if (ret) { + pr_err("boot clientos failed(%ld)\n", ret); +@@ -149,6 +150,7 @@ static long mcs_ioctl(struct file *f, unsigned int cmd, unsigned long arg) + break; + + case IOC_AFFINITY_INFO: ++ cpu_id = cpu_id << 8; + ret = invoke_psci_fn(AFFINITY_INFO_FUNCID, cpu_id, 0, 0); + if (copy_to_user((unsigned long __user *)arg, &ret, sizeof(unsigned long))) + return -EFAULT; +-- +2.34.1 + diff --git a/bsp/meta-hisilicon/recipes-mcs/mcs-linux/files/0001-rpmsg_main-set-phy_shared_mem-to-0x90000000.patch b/bsp/meta-hisilicon/recipes-mcs/mcs-linux/files/0001-rpmsg_main-set-phy_shared_mem-to-0x90000000.patch new file mode 100644 index 0000000000000000000000000000000000000000..e0a4990cbb7f6c7f646021cf348b8f850a30ff80 --- /dev/null +++ b/bsp/meta-hisilicon/recipes-mcs/mcs-linux/files/0001-rpmsg_main-set-phy_shared_mem-to-0x90000000.patch @@ -0,0 +1,27 @@ +From 2ae92bda1fb881460aa44c33b1386ba8cdb355eb Mon Sep 17 00:00:00 2001 +From: hanzongcheng +Date: Sat, 25 Mar 2023 13:04:08 +0800 +Subject: [PATCH] rpmsg_main: set phy_shared_mem to 0x90000000 + +* The reserved memory was reprogrammed according to the memory + layout of the hi3093, reserving 0x90000000 to 0x95000000. + So update phy_shared_mem. + +Signed-off-by: hanzongcheng + +diff --git a/rpmsg_pty_demo/rpmsg_main.c b/rpmsg_pty_demo/rpmsg_main.c +index 8f99d20..a82cec3 100644 +--- a/rpmsg_pty_demo/rpmsg_main.c ++++ b/rpmsg_pty_demo/rpmsg_main.c +@@ -7,7 +7,7 @@ + + static struct client_os_inst client_os = { + /* physical address start of shared device mem */ +- .phy_shared_mem = 0x70000000, ++ .phy_shared_mem = 0x90000000, + /* size of shared device mem */ + .shared_mem_size = 0x30000, + .vring_size = VRING_SIZE, +-- +2.34.1 + diff --git a/bsp/meta-hisilicon/recipes-mcs/mcs-linux/mcs-km.bbappend b/bsp/meta-hisilicon/recipes-mcs/mcs-linux/mcs-km.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..f60171a5c173c64f602b56b214c55316fd54d160 --- /dev/null +++ b/bsp/meta-hisilicon/recipes-mcs/mcs-linux/mcs-km.bbappend @@ -0,0 +1,3 @@ +# adapted for hi1711 +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRC_URI_append = " file://0001-mcs_km-adapted-for-hi3093.patch" diff --git a/bsp/meta-hisilicon/recipes-mcs/mcs-linux/mcs-linux.bbappend b/bsp/meta-hisilicon/recipes-mcs/mcs-linux/mcs-linux.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..05e6c807484547b0551ca8b33725563d52589415 --- /dev/null +++ b/bsp/meta-hisilicon/recipes-mcs/mcs-linux/mcs-linux.bbappend @@ -0,0 +1,3 @@ +# adapted for hi1711 +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRC_URI_append = " file://0001-rpmsg_main-set-phy_shared_mem-to-0x90000000.patch" diff --git a/bsp/meta-openeuler-bsp/classes/sdcard_image-rpi.bbclass b/bsp/meta-openeuler-bsp/classes/sdcard_image-rpi.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..57c2f7685f88526a967cfdd607d24bb417b1ef3b --- /dev/null +++ b/bsp/meta-openeuler-bsp/classes/sdcard_image-rpi.bbclass @@ -0,0 +1,219 @@ +# This is a copy of sdcard_image-rpi.bbclass from meta-raspberrypi +# we just add uefi_configuration here to make uefi configs before Burn Partitions + +inherit image_types + +# +# Create an image that can be written onto a SD card using dd. +# +# The disk layout used is: +# +# 0 -> IMAGE_ROOTFS_ALIGNMENT - reserved for other data +# IMAGE_ROOTFS_ALIGNMENT -> BOOT_SPACE - bootloader and kernel +# BOOT_SPACE -> SDIMG_SIZE - rootfs +# + +# Default Free space = 1.3x +# Use IMAGE_OVERHEAD_FACTOR to add more space +# <---------> +# 4MiB 48MiB SDIMG_ROOTFS +# <-----------------------> <----------> <----------------------> +# ------------------------ ------------ ------------------------ +# | IMAGE_ROOTFS_ALIGNMENT | BOOT_SPACE | ROOTFS_SIZE | +# ------------------------ ------------ ------------------------ +# ^ ^ ^ ^ +# | | | | +# 0 4MiB 4MiB + 48MiB 4MiB + 48Mib + SDIMG_ROOTFS + +# This image depends on the rootfs image +IMAGE_TYPEDEP_rpi-sdimg = "${SDIMG_ROOTFS_TYPE}" + +# Kernel image name +SDIMG_KERNELIMAGE_raspberrypi ?= "kernel.img" +SDIMG_KERNELIMAGE_raspberrypi2 ?= "kernel7.img" +SDIMG_KERNELIMAGE_raspberrypi3-64 ?= "kernel8.img" + +# Boot partition volume id +# Shorten raspberrypi to just rpi to keep it under 11 characters +# now enforced by mkfs.vfat from dosfstools-4.2 +BOOTDD_VOLUME_ID ?= "${@d.getVar('MACHINE').replace('raspberrypi', 'rpi')}" + +# Boot partition size [in KiB] (will be rounded up to IMAGE_ROOTFS_ALIGNMENT) +BOOT_SPACE ?= "49152" + +# Set alignment to 4MB [in KiB] +IMAGE_ROOTFS_ALIGNMENT = "4096" + +# Use an uncompressed ext3 by default as rootfs +SDIMG_ROOTFS_TYPE ?= "ext3" +SDIMG_ROOTFS = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${SDIMG_ROOTFS_TYPE}" + +# For the names of kernel artifacts +inherit kernel-artifact-names + +RPI_SDIMG_EXTRA_DEPENDS ?= "" + +do_image_rpi_sdimg[depends] = " \ + parted-native:do_populate_sysroot \ + mtools-native:do_populate_sysroot \ + dosfstools-native:do_populate_sysroot \ + virtual/kernel:do_deploy \ + rpi-bootfiles:do_deploy \ + ${@bb.utils.contains('MACHINE_FEATURES', 'armstub', 'armstubs:do_deploy', '' ,d)} \ + ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot:do_deploy', '',d)} \ + ${@bb.utils.contains('RPI_USE_U_BOOT', '1', 'u-boot-default-script:do_deploy', '',d)} \ + ${RPI_SDIMG_EXTRA_DEPENDS} \ +" + +do_image_rpi_sdimg[recrdeps] = "do_build" + +# SD card image name +SDIMG = "${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.rpi-sdimg" + +# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS. +FATPAYLOAD ?= "" + +# SD card vfat partition image name +SDIMG_VFAT_DEPLOY ?= "${RPI_USE_U_BOOT}" +SDIMG_VFAT = "${IMAGE_NAME}.vfat" +SDIMG_LINK_VFAT = "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.vfat" + +def split_overlays(d, out, ver=None): + dts = d.getVar("KERNEL_DEVICETREE") + # Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' (4.1.x) or by '.dtbo' (4.4.9+) string and will be put in a dedicated folder + if out: + overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d) + overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays, d) + else: + overlays = oe.utils.str_filter('\S+\-overlay\.dtb$', dts, d) + \ + " " + oe.utils.str_filter('\S+\.dtbo$', dts, d) + + return overlays + + +uefi_configuration() { + echo "uefi_configuration make nothing" +} + +IMAGE_CMD_rpi-sdimg () { + + # Align partitions + BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE} + ${IMAGE_ROOTFS_ALIGNMENT} - 1) + BOOT_SPACE_ALIGNED=$(expr ${BOOT_SPACE_ALIGNED} - ${BOOT_SPACE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT}) + SDIMG_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} + ${BOOT_SPACE_ALIGNED} + $ROOTFS_SIZE) + + echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $ROOTFS_SIZE KiB" + + # Check if we are building with device tree support + DTS="${KERNEL_DEVICETREE}" + + # Initialize sdcard image file + dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE} + + # Create partition table + parted -s ${SDIMG} mklabel msdos + # Create boot partition and mark it as bootable + parted -s ${SDIMG} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT}) + parted -s ${SDIMG} set 1 boot on + # Create rootfs partition to the end of disk + parted -s ${SDIMG} -- unit KiB mkpart primary ext2 $(expr ${BOOT_SPACE_ALIGNED} \+ ${IMAGE_ROOTFS_ALIGNMENT}) -1s + parted ${SDIMG} print + + # Create a vfat image with boot files + BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }') + rm -f ${WORKDIR}/boot.img + mkfs.vfat -F32 -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${BOOTFILES_DIR_NAME}/* ::/ || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${BOOTFILES_DIR_NAME}/* into boot.img" + if [ "${@bb.utils.contains("MACHINE_FEATURES", "armstub", "1", "0", d)}" = "1" ]; then + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/armstubs/${ARMSTUB} ::/ || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/armstubs/${ARMSTUB} into boot.img" + fi + if test -n "${DTS}"; then + # Copy board device trees to root folder + for dtbf in ${@split_overlays(d, True)}; do + dtb=`basename $dtbf` + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/$dtb ::$dtb || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/$dtb into boot.img" + done + + # Copy device tree overlays to dedicated folder + mmd -i ${WORKDIR}/boot.img overlays + for dtbf in ${@split_overlays(d, False)}; do + dtb=`basename $dtbf` + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/$dtb ::overlays/$dtb || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/$dtb into boot.img" + done + fi + if [ "${RPI_USE_U_BOOT}" = "1" ]; then + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/u-boot.bin ::${SDIMG_KERNELIMAGE} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/u-boot.bin into boot.img" + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/boot.scr ::boot.scr || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/boot.scr into boot.img" + if [ ! -z "${INITRAMFS_IMAGE}" -a "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin ::${KERNEL_IMAGETYPE} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin into boot.img" + else + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ::${KERNEL_IMAGETYPE} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} into boot.img" + fi + else + if [ ! -z "${INITRAMFS_IMAGE}" -a "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin ::${SDIMG_KERNELIMAGE} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin into boot.img" + else + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ::${SDIMG_KERNELIMAGE} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} into boot.img" + fi + fi + + # Add files (eg. hypervisor binaries) from the deploy dir + if [ -n "${DEPLOYPAYLOAD}" ] ; then + echo "Copying deploy file payload into VFAT" + for entry in ${DEPLOYPAYLOAD} ; do + # Split entry at optional ':' to enable file renaming for the destination + if [ $(echo "$entry" | grep -c :) = "0" ] ; then + DEPLOY_FILE="$entry" + DEST_FILENAME="$entry" + else + DEPLOY_FILE="$(echo "$entry" | cut -f1 -d:)" + DEST_FILENAME="$(echo "$entry" | cut -f2- -d:)" + fi + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${DEPLOY_FILE} ::${DEST_FILENAME} || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/${DEPLOY_FILE} into boot.img" + done + fi + + if [ -n "${FATPAYLOAD}" ] ; then + echo "Copying payload into VFAT" + for entry in ${FATPAYLOAD} ; do + # use bbwarn instead of bbfatal to stop aborting on vfat issues like not supporting .~lock files + mcopy -v -i ${WORKDIR}/boot.img -s ${IMAGE_ROOTFS}$entry :: || bbwarn "mcopy cannot copy ${IMAGE_ROOTFS}$entry into boot.img" + done + fi + + # Add stamp file + echo "${IMAGE_NAME}" > ${WORKDIR}/image-version-info + mcopy -v -i ${WORKDIR}/boot.img ${WORKDIR}/image-version-info :: || bbfatal "mcopy cannot copy ${WORKDIR}/image-version-info into boot.img" + + uefi_configuration "" + + # Deploy vfat partition + if [ "${SDIMG_VFAT_DEPLOY}" = "1" ]; then + cp ${WORKDIR}/boot.img ${IMGDEPLOYDIR}/${SDIMG_VFAT} + ln -sf ${SDIMG_VFAT} ${SDIMG_LINK_VFAT} + fi + + # Burn Partitions + dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) + # If SDIMG_ROOTFS_TYPE is a .xz file use xzcat + if echo "${SDIMG_ROOTFS_TYPE}" | egrep -q "*\.xz" + then + xzcat ${SDIMG_ROOTFS} | dd of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) + else + dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) + fi +} + +ROOTFS_POSTPROCESS_COMMAND += " rpi_generate_sysctl_config ; " + +rpi_generate_sysctl_config() { + # systemd sysctl config + test -d ${IMAGE_ROOTFS}${sysconfdir}/sysctl.d && \ + echo "vm.min_free_kbytes = 8192" > ${IMAGE_ROOTFS}${sysconfdir}/sysctl.d/rpi-vm.conf + + # sysv sysctl config + IMAGE_SYSCTL_CONF="${IMAGE_ROOTFS}${sysconfdir}/sysctl.conf" + test -e ${IMAGE_ROOTFS}${sysconfdir}/sysctl.conf && \ + sed -e "/vm.min_free_kbytes/d" -i ${IMAGE_SYSCTL_CONF} + echo "" >> ${IMAGE_SYSCTL_CONF} && echo "vm.min_free_kbytes = 8192" >> ${IMAGE_SYSCTL_CONF} +} diff --git a/bsp/meta-openeuler-bsp/conf/machine/openeuler-raspberrypi4-64.conf b/bsp/meta-openeuler-bsp/conf/machine/openeuler-raspberrypi4-64.conf index 6715209142c3aece0cc4889c5c1897a739c86652..fd064ecb128e8e51a498e01d550caaf881744e00 100644 --- a/bsp/meta-openeuler-bsp/conf/machine/openeuler-raspberrypi4-64.conf +++ b/bsp/meta-openeuler-bsp/conf/machine/openeuler-raspberrypi4-64.conf @@ -8,3 +8,52 @@ ROOTFS_PACKAGE_ARCH = "aarch64" RPI_USE_U_BOOT = "0" KERNEL_IMAGETYPE_DIRECT = "Image" ENABLE_UART = "1" +# serial port enabled by default in raspberrypi +CMDLINE_SERIAL = "console=tty1 console=ttyS0,115200" +# ttyS0 may use for ROS driver +# ttyAMA0 use for bluetooth +SERIAL_CONSOLES = "" + +# add kernel-module for support wifi +INSTALLMODULES += "\ +kernel-module-rfkill \ +kernel-module-cfg80211 \ +kernel-module-brcmutil \ +kernel-module-brcmfmac \ +" + +# add kernel-module for support wayland +INSTALLMODULES +=" \ +kernel-module-vc4 \ +kernel-module-v3d \ +kernel-module-drm \ +" + +# add common usb serial drivers +INSTALLMODULES +=" \ +kernel-module-usbserial \ +kernel-module-cp210x \ +kernel-module-ch341 \ +" + +# add kernel-module for support bluetooth +INSTALLMODULES +="\ +kernel-module-ecc \ +kernel-module-ecdh-generic \ +kernel-module-bluetooth \ +kernel-module-btbcm \ +kernel-module-hci-uart \ +kernel-module-rfcomm \ +kernel-module-cmac \ +kernel-module-bnep \ +" + +KERNEL_MODULE_AUTOLOAD = "${INSTALLMODULES}" + +# automatic file system expansion +AUTO-EXPAND-FS = "1" + +# remove bcm2711-rpi-4-b.dtb from kernel_devicetree +RPI_KERNEL_DEVICETREE_remove = " \ + broadcom/bcm2711-rpi-4-b.dtb \ +" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-bootfiles.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-bootfiles.bbappend index 75f469e85cb588dbe3ab353f4b7282d303dda50e..0277e2b6a0e7005adfa707092f2cd39425c3d75a 100644 --- a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-bootfiles.bbappend +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-bootfiles.bbappend @@ -1,5 +1,23 @@ -SRC_URI = "file://raspberrypi-firmware/firmware-1.20210201.tar.gz \ +OPENEULER_REPO_NAME = "raspberrypi-firmware" +PV = "2c9ca22c4aedd1a8a6bc14698be5861525f2bfdf" +SRC_URI = "file://firmware-${PV}.tar.gz \ " -S = "${WORKDIR}/firmware-1.20210201/boot" -#FILESEXTRAPATHS_prepend = "${OPENEULER_SP_DIR}/raspberrypi-firmware/:" +S = "${WORKDIR}/firmware-${PV}/boot" + +# add uefi grub package +# rpi-tf-a package don't support clang compile +# and standard image don't use uefi and grub. +# so using MCS_FEATURES to distinguish standard image and mcs image. +do_deploy[depends] += "${@bb.utils.contains('MCS_FEATURES', 'rpi4', 'grub-efi:do_deploy grub-bootconf:do_deploy rpi-uefi:do_deploy', '', d)}" + +# fix runtime error: Could not find DRM device! +# instead of bcm2711-rpi-4-b.dtb from kernel_devicetree +do_deploy_append() { + cp ${S}/bcm2711-rpi-4-b.dtb ${DEPLOYDIR}/${BOOTFILES_DIR_NAME} +} + +inherit ${@bb.utils.contains('MCS_FEATURES', 'lopper-devicetree', 'lopper-devicetree', '', d)} + +INPUT_DT = "${S}/bcm2711-rpi-4-b.dtb" +OUTPUT_DT = "${S}/bcm2711-rpi-4-b.dtb" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ced34343fc0786bfbc156365bc3eee91f4d46920 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-cmdline.bbappend @@ -0,0 +1,7 @@ +# the kernel mounts readonly rootfs by default +# the rootfs will be remounted to rw rootfs through /etc/inittab when using busybox-init start +# add rw to CMALINE when using systemd start as a workaround +CMDLINE += "rw" + +# do init_resize.sh to expand file system to use all the space on the card at first boot +CMDLINE += "${@oe.utils.conditional("AUTO-EXPAND-FS", "1", "init=/usr/lib/init_resize.sh", "", d)}" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-config/config.txt b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-config/config.txt new file mode 100644 index 0000000000000000000000000000000000000000..b2f65f6482b3a95afdddda26b3d363a2d2a280d3 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-config/config.txt @@ -0,0 +1,67 @@ +# For more options and information see +# http://rpf.io/configtxt +# Some settings may impact device functionality. See link above for details + +# uncomment if you get no picture on HDMI for a default "safe" mode +#hdmi_safe=1 + +# uncomment this if your display has a black border of unused pixels visible +# and your display can output without overscan +#disable_overscan=1 + +# uncomment the following to adjust overscan. Use positive numbers if console +# goes off screen, and negative if there is too much border +#overscan_left=16 +#overscan_right=16 +#overscan_top=16 +#overscan_bottom=16 + +# uncomment to force a console size. By default it will be display's size minus +# overscan. +#framebuffer_width=1280 +#framebuffer_height=720 + +# uncomment if hdmi display is not detected and composite is being output +#hdmi_force_hotplug=1 + +# uncomment to force a specific HDMI mode (this will force VGA) +#hdmi_group=1 +#hdmi_mode=1 + +# uncomment to force a HDMI mode rather than DVI. This can make audio work in +# DMT (computer monitor) modes +#hdmi_drive=2 + +# uncomment to increase signal to HDMI, if you have interference, blanking, or +# no display +#config_hdmi_boost=4 + +# uncomment for composite PAL +#sdtv_mode=2 + +#uncomment to overclock the arm. 700 MHz is the default. +#arm_freq=800 + +# Uncomment some or all of these to enable the optional hardware interfaces +#dtparam=i2c_arm=on +#dtparam=i2s=on +#dtparam=spi=on + +# Uncomment this to enable infrared communication. +#dtoverlay=gpio-ir,gpio_pin=17 +#dtoverlay=gpio-ir-tx,gpio_pin=18 + +# Additional overlays and parameters are documented /boot/overlays/README + +# Enable audio (loads snd_bcm2835) +dtparam=audio=on + +[pi4] +# Enable DRM VC4 V3D driver on top of the dispmanx display stack +#dtoverlay=vc4-fkms-v3d +#dtoverlay=disable-bt +#max_framebuffers=2 + +[all] + +enable_uart=1 diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend index d2cb876c294b5d0de4a0b7943e38322c264b93d0..fda521b888ac9e220d1d7d24f24daaf0114544f1 100644 --- a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend @@ -1,3 +1,5 @@ -SRC_URI = "file://yocto-embedded-tools/config/${MACHINE}/config.txt \ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" + +SRC_URI = "file://config.txt \ " -S = "${WORKDIR}/yocto-embedded-tools/config/${MACHINE}" +S = "${WORKDIR}" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/grub/grub-bootconf_%.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/grub/grub-bootconf_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ab5e6f845c4654330f5959f2bef3a9c0bc4034aa --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/grub/grub-bootconf_%.bbappend @@ -0,0 +1,18 @@ +GRUB_SERIAL := "" +GRUB_TIMEOUT := "0" +GRUB_OPTS := "" +APPEND = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 console=ttyAMA0,115200" +# do init_resize.sh to expand file system to use all the space on the card at first boot +APPEND += "${@oe.utils.conditional("AUTO-EXPAND-FS", "1", "init=/usr/lib/init_resize.sh", "", d)}" +GRUB_ROOT := "root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" + +inherit deploy + +do_deploy() { + install -d ${DEPLOYDIR}/EFI/BOOT + GRUBCFG=${DEPLOYDIR}/EFI/BOOT/grub.cfg + cp ${S}/grub-bootconf $GRUBCFG +} + +addtask deploy after do_install before do_build +do_deploy[dirs] += "${DEPLOYDIR}/EFI/BOOT" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/grub/grub-efi_%.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/grub/grub-efi_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ef417161eb28a88824ae0d020cf311163baff760 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/grub/grub-efi_%.bbappend @@ -0,0 +1,11 @@ +EFI_PROVIDER = "grub-efi" + +# we need more buildin grub +GRUB_BUILDIN = "acpi all_video archelp bfs bitmap bitmap_scale blocklist boot bufio cat cbfs chain cmp configfile cpio crc64 crypto cryptodisk date datehook datetime disk diskfilter div dm_nv echo efi_gop efinet elf eval exfat ext2 extcmd fat fdt file font fshelp geli gettext gfxmenu gfxterm gfxterm_background gfxterm_menu gptsync gzio halt hashsum hello help hexdump http iso9660 jfs jpeg keystatus ldm linux loadenv loopback ls lsacpi lsefi lsefimmap lsefisystab lsmmap lssal luks lvm lzopio macbless macho memdisk memrw minicmd minix minix2 minix3 mmap mpi msdospart net newc normal ntfs ntfscomp odc offsetio part_acorn part_amiga part_apple part_bsd part_dfly part_dvh part_gpt part_msdos part_plan part_sun part_sunpc parttool png priority_queue probe procfs progress raid5rec raid6rec read reboot regexp reiserfs romfs scsi search search_fs_file search_fs_uuid search_label serial setjmp sfs sleep squash4 tar terminal terminfo tftp tga time tr trig true udf ufs1 ufs1_be ufs2 video video_colors video_fb videoinfo xen_boot xfs xnu_uuid xzio zfs zfscrypt zfsinfo" + +do_deploy() { + install -d ${DEPLOYDIR}/EFI/BOOT + install -m 644 ${D}${EFI_FILES_PATH}/${GRUB_IMAGE} ${DEPLOYDIR}/EFI/BOOT +} + +do_deploy[dirs] += "${DEPLOYDIR}/EFI/BOOT" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/jailhouse-overlay/files/jailhouse-overlay.dts b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/jailhouse-overlay/files/jailhouse-overlay.dts new file mode 100644 index 0000000000000000000000000000000000000000..c34b5270c6ae448e357e1892a02a741faed8f8e4 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/jailhouse-overlay/files/jailhouse-overlay.dts @@ -0,0 +1,28 @@ +/dts-v1/; +/plugin/; +/ { + compatible = "brcm,bcm2835"; + + fragment@0 { + target-path = "/"; + __overlay__ { + reserved-memory { + #address-cells = <2>; + #size-cells = <1>; + ranges; + + jailhouse@10000000 { + reg = <0 0x10000000 0x10000000>; + no-map; + }; + }; + }; + }; + + fragment@1 { + target-path = "/scb/pcie@7d500000"; + __overlay__ { + linux,pci-domain = <0x00000000>; + }; + }; +}; diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/jailhouse-overlay/jailhouse-overlay.bb b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/jailhouse-overlay/jailhouse-overlay.bb new file mode 100644 index 0000000000000000000000000000000000000000..001c28579a224c2ca233c40e3c3ed09b758f0dad --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/jailhouse-overlay/jailhouse-overlay.bb @@ -0,0 +1,26 @@ +inherit deploy + +DEPENDS += "dtc-native" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI += " \ + file://${BPN}.dts \ + " + +do_compile() { + # generate dtbo + dtc -I dts -O dtb ${WORKDIR}/${BPN}.dts -o ${WORKDIR}/${BPN}.dtbo +} + +do_deploy() { + if [ -e ${DEPLOYDIR}/${BPN}.dtbo ];then + rm ${DEPLOYDIR}/${BPN}.dtbo + fi + + install -m 0644 ${WORKDIR}/${BPN}.dtbo ${DEPLOYDIR}/ +} + +addtask do_deploy after do_compile before do_install +do_deploy[dirs] += "${DEPLOYDIR}" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/0001-RPI3-RPI4-revert-rpi3_pwr_down_wfi.patch b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/0001-RPI3-RPI4-revert-rpi3_pwr_down_wfi.patch new file mode 100644 index 0000000000000000000000000000000000000000..fc380db45915936a5ec6ca9b2c1a4353403b5696 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/0001-RPI3-RPI4-revert-rpi3_pwr_down_wfi.patch @@ -0,0 +1,59 @@ +From ae9d9d059de737a97923f3caf383129f537aec42 Mon Sep 17 00:00:00 2001 +From: hanzongcheng +Date: Thu, 2 Mar 2023 16:36:15 +0800 +Subject: [PATCH] RPI3/RPI4: revert rpi3_pwr_down_wfi() + +* rpi3_pwr_down_wfi() cannot be used to power off the cores after + testing, use rpi3_pwr_domain_pwr_down_wfi as an implementation of + pwr_domain_pwr_down_wfi. + +Signed-off-by: hanzongcheng + +diff --git a/plat/rpi/common/rpi3_pm.c b/plat/rpi/common/rpi3_pm.c +index 86c61f7..8327026 100644 +--- a/plat/rpi/common/rpi3_pm.c ++++ b/plat/rpi/common/rpi3_pm.c +@@ -174,32 +174,6 @@ static void rpi3_pwr_domain_on_finish(const psci_power_state_t *target_state) + #endif + } + +-static void __dead2 rpi3_pwr_down_wfi( +- const psci_power_state_t *target_state) +-{ +- uintptr_t hold_base = PLAT_RPI3_TM_HOLD_BASE; +- unsigned int pos = plat_my_core_pos(); +- +- if (pos == 0) { +- /* +- * The secondaries will always be in a wait +- * for warm boot on reset, but the BSP needs +- * to be able to distinguish between waiting +- * for warm boot (e.g. after psci_off, waiting +- * for psci_on) and a cold boot. +- */ +- mmio_write_64(hold_base, PLAT_RPI3_TM_HOLD_STATE_BSP_OFF); +- /* No cache maintenance here, we run with caches off already. */ +- dsb(); +- isb(); +- } +- +- write_rmr_el3(RMR_EL3_RR_BIT | RMR_EL3_AA64_BIT); +- +- while (1) +- ; +-} +- + /******************************************************************************* + * Platform handlers for system reset and system off. + ******************************************************************************/ +@@ -265,7 +239,6 @@ static const plat_psci_ops_t plat_rpi3_psci_pm_ops = { + .pwr_domain_pwr_down_wfi = rpi3_pwr_domain_pwr_down_wfi, + .pwr_domain_on = rpi3_pwr_domain_on, + .pwr_domain_on_finish = rpi3_pwr_domain_on_finish, +- .pwr_domain_pwr_down_wfi = rpi3_pwr_down_wfi, + .system_off = rpi3_system_off, + .system_reset = rpi3_system_reset, + .validate_power_state = rpi3_validate_power_state, +-- +2.34.1 + diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/COPYING.linux b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/COPYING.linux new file mode 100644 index 0000000000000000000000000000000000000000..ca442d313d86dc67e0a2e5d584b465bd382cbf5c --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/COPYING.linux @@ -0,0 +1,356 @@ + + NOTE! This copyright does *not* cover user programs that use kernel + services by normal system calls - this is merely considered normal use + of the kernel, and does *not* fall under the heading of "derived work". + Also note that the GPL below is copyrighted by the Free Software + Foundation, but the instance of code that it refers to (the Linux + kernel) is copyrighted by me and others who actually wrote it. + + Also note that the only valid version of the GPL as far as the kernel + is concerned is _this_ particular version of the license (ie v2, not + v2.2 or v3.x or whatever), unless explicitly otherwise stated. + + Linus Torvalds + +---------------------------------------- + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/LICENCE.broadcom b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/LICENCE.broadcom new file mode 100644 index 0000000000000000000000000000000000000000..d5793b5ffd637a0f19f991d461d9d032e2fc163a --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/LICENCE.broadcom @@ -0,0 +1,31 @@ +Copyright (c) 2006, Broadcom Corporation. +Copyright (c) 2015, Raspberry Pi (Trading) Ltd +All rights reserved. + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +* This software may only be used for the purposes of developing for, + running or using a Raspberry Pi device, or authorised derivative + device manufactured via the element14 Raspberry Pi Customization Service +* Redistributions must reproduce the above copyright notice and the + following disclaimer in the documentation and/or other materials + provided with the distribution. +* Neither the name of Broadcom Corporation nor the names of its suppliers + may be used to endorse or promote products derived from this software + without specific prior written permission. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/LICENCE.edk2 b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/LICENCE.edk2 new file mode 100644 index 0000000000000000000000000000000000000000..ee840505cb0c041145ee87fa07be69a51fa325b2 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/LICENCE.edk2 @@ -0,0 +1,51 @@ +Copyright (c) 2019, TianoCore and contributors. All rights reserved. + +SPDX-License-Identifier: BSD-2-Clause-Patent + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +Subject to the terms and conditions of this license, each copyright holder +and contributor hereby grants to those receiving rights under this license +a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except for failure to satisfy the conditions of this license) patent +license to make, have made, use, offer to sell, sell, import, and otherwise +transfer this software, where such license applies only to those patent +claims, already acquired or hereafter acquired, licensable by such copyright +holder or contributor that are necessarily infringed by: + +(a) their Contribution(s) (the licensed copyrights of copyright holders and + non-copyrightable additions of contributors, in source or binary form) + alone; or + +(b) combination of their Contribution(s) with the work of authorship to + which such Contribution(s) was added by such copyright holder or + contributor, if, at the time the Contribution is added, such addition + causes such combination to be necessarily infringed. The patent license + shall not apply to any other combinations which include the + Contribution. + +Except as expressly stated above, no rights or licenses from any copyright +holder or contributor is granted under this license, whether expressly, by +implication, estoppel or otherwise. + +DISCLAIMER + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/RPi4_UEFI_Firmware_v1.33.zip b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/RPi4_UEFI_Firmware_v1.33.zip new file mode 100644 index 0000000000000000000000000000000000000000..33d962f7eb629292dffc2b8678341fb40736d1bf Binary files /dev/null and b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/RPi4_UEFI_Firmware_v1.33.zip differ diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/arm-trusted-firmware-2.6.tar.gz b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/arm-trusted-firmware-2.6.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..431e56383beb625551f8808d037089a6120785ff Binary files /dev/null and b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/arm-trusted-firmware-2.6.tar.gz differ diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/checksum b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/checksum new file mode 100644 index 0000000000000000000000000000000000000000..dcc097855203a6c2d5fc771f5ea93b08c0941aa2 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/files/checksum @@ -0,0 +1,7 @@ +md5sum: 45b696dc35ca2b6cdfcea7d97834d967 +source: https://github.com/pftf/RPi4/releases/download/v1.33/RPi4_UEFI_Firmware_v1.33.zip +license: +The firmware (RPI_EFI.fd) is licensed under the current EDK2 license, which is BSD-2-Clause-Patent. +The other files from the zip archives are licensed under the terms described in the Raspberry Pi boot files README. +The binary blobs in the firmware/ directory are licensed under the Cypress wireless driver license that is found there. +more information see: https://github.com/pftf/RPi4/ diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/rpi-tf-a.bb b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/rpi-tf-a.bb new file mode 100644 index 0000000000000000000000000000000000000000..03f27939b067fdfd8c6faf4c2bd1b251c7c2c405 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/rpi-tf-a.bb @@ -0,0 +1,30 @@ +SUMMARY = "ARM Trusted Firmware for Raspberry Pi 4" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +BPN = "arm-trusted-firmware" +PV = "2.6" + +SRC_URI = "file://${BP}.tar.gz \ + file://0001-RPI3-RPI4-revert-rpi3_pwr_down_wfi.patch \ + " + +SRC_URI[md5sum] = "2622f7077e30436b2310bea0232c7cec" +SRC_URI[sha256sum] = "3905a6d6affa84fb629d1565a4e4bdc82812bba49a457b8249ab445eeb28011b" + +# overide LDFLAGS to allow rpi4 TF-A to build without: "aarch64-openeuler-linux-gnu-ld.bfd: unrecognized option '-Wl,-O1'" +export LDFLAGS="" + +EXTRA_OEMAKE="CROSS_COMPILE=${TARGET_PREFIX} " +export LDFLAGS="" + +do_compile_append() { + oe_runmake PLAT=rpi4 RPI3_PRELOADED_DTB_BASE=0x1F0000 PRELOADED_BL33_BASE=0x20000 SUPPORT_VFP=1 SMC_PCI_SUPPORT=1 DEBUG=0 all +} + +do_install_append() { + install -d ${D}${datadir} + install ${B}/build/rpi4/release/bl31.bin ${D}${datadir} +} + +FILES_${PN} += "${datadir}/bl31.bin" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/rpi-uefi.bb b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/rpi-uefi.bb new file mode 100644 index 0000000000000000000000000000000000000000..488f074f758fade05395988ac43664de5e3eb67d --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-bsp/uefi/rpi-uefi.bb @@ -0,0 +1,30 @@ +SUMMARY = "EDK2 Raspberry Pi 4 UEFI firmware" +# RPI_EFI.fd is BSD-2-Clause, licence is described in files/LICENCE.edk2 +# licence of start*.elf, fixup*.dat are described in files/LICENCE.broadcom +# firmware files see LICENCE.txt + +# we just need RPI_EFI.fd so here we present BSD-2-Clause here +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://${THISDIR}/files/LICENCE.edk2;md5=2b415520383f7964e96700ae12b4570a" + + +SRC_URI = "file://RPi4_UEFI_Firmware_v1.33.zip \ + " + +SRC_URI[sha256sum] = "1de14df6caaeb61fd15065eee23fb1bae864a1ea15eba8ee066a94073660f8be" + +inherit deploy nopackages + +DEPENDS += "rpi-tf-a" + +do_deploy() { + # Use the bl31.bin we compiled to make a RPI_EFI.fd + # bl31.bin is placed into the first 128KB of RPI_EFI.fd, filled up with 0xFF + tr '\000' '\377' < /dev/zero | dd conv=notrunc bs=1K seek=0 count=128 of=${WORKDIR}/RPI_EFI.fd + dd if=${WORKDIR}/recipe-sysroot/${datadir}/bl31.bin of=${WORKDIR}/RPI_EFI.fd conv=notrunc + + install -m 0644 ${WORKDIR}/RPI_EFI.fd ${DEPLOYDIR} +} + +addtask deploy before do_build after do_install +do_deploy[dirs] += "${DEPLOYDIR}" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_%.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..aed31e1a544bf7166d3a28172f42d6a6770e7bcd --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth_%.bbappend @@ -0,0 +1,15 @@ +# apply openeuler source package +OPENEULER_REPO_NAME = "raspberrypi-bluetooth" + +PV = "87248a382d1a81b80a62730975135d87fffd7ef1" + +SRC_URI = "\ + file://${BP}.tar.gz \ +" + +S = "${WORKDIR}/${BP}" + +do_install_append() { + # we do not use udev package, so pass /dev/ttyAMA0 directly. + sed -i "s/\/dev\/serial1/\/dev\/ttyAMA0/g" ${D}${bindir}/btuart +} diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/auto-expand-fs/auto-expand-fs.bb b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/auto-expand-fs/auto-expand-fs.bb new file mode 100644 index 0000000000000000000000000000000000000000..6c714fc8c89f821f25a0c622dc26679c175369af --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/auto-expand-fs/auto-expand-fs.bb @@ -0,0 +1,39 @@ +SUMMARY = "Automatic file system expansion" +DESCRIPTION = "Expand file system to use all the space on the card at first boot" +SECTION = "base" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +RDEPENDS_${PN} = "parted util-linux-findmnt e2fsprogs-resize2fs" + +# As the recipe doesn't inherit systemd.bbclass, we need to set this variable +# manually to avoid unnecessary postinst/preinst generated. +python __anonymous() { + if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): + d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") +} + +inherit update-rc.d + +# init_resize.sh: perform the partition resize +# resize2fs_once: resize file system at first boot +# reference: https://github.com/RPi-Distro/raspi-config/blob/master/usr/lib/raspi-config/init_resize.sh +SRC_URI = "file://init_resize.sh \ + file://resize2fs_once \ + " + +INITSCRIPT_NAME = "resize2fs_once" +INITSCRIPT_PARAMS = "defaults" + +S = "${WORKDIR}" + +FILES_${PN} = "/usr/lib/init_resize.sh ${sysconfdir}/init.d/resize2fs_once" + +do_install () { + install -d ${D}${sysconfdir}/init.d/ + install -d ${D}/usr/lib/ + install -m 0755 ${WORKDIR}/resize2fs_once ${D}${sysconfdir}/init.d/ + install -m 0755 ${WORKDIR}/init_resize.sh ${D}/usr/lib/ +} + +ALLOW_EMPTY_${PN} = "1" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/auto-expand-fs/files/init_resize.sh b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/auto-expand-fs/files/init_resize.sh new file mode 100644 index 0000000000000000000000000000000000000000..1a9ab693ec405ef8b82d9b64715b8faa6825083a --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/auto-expand-fs/files/init_resize.sh @@ -0,0 +1,209 @@ +#!/bin/sh + +reboot_pi () { + umount /boot + mount / -o remount,rw + rm -r /boot + mount / -o remount,ro + sync + if [ "$NOOBS" = "1" ]; then + if [ "$NEW_KERNEL" = "1" ]; then + reboot -f "$BOOT_PART_NUM" + sleep 5 + else + echo "$BOOT_PART_NUM" > "/sys/module/${BCM_MODULE}/parameters/reboot_part" + fi + fi + reboot -f + sleep 5 + exit 0 +} + +check_commands () { + for COMMAND in grep cut sed parted fdisk findmnt; do + if ! command -v $COMMAND > /dev/null; then + FAIL_REASON="$COMMAND not found" + return 1 + fi + done + return 0 +} + +check_noobs () { + if [ "$BOOT_PART_NUM" = "1" ]; then + NOOBS=0 + else + NOOBS=1 + fi +} + +get_variables () { + ROOT_PART_DEV=$(findmnt / -o source -n) + ROOT_PART_NAME=$(echo "$ROOT_PART_DEV" | cut -d "/" -f 3) + ROOT_DEV_NAME=$(echo /sys/block/*/"${ROOT_PART_NAME}" | cut -d "/" -f 4) + ROOT_DEV="/dev/${ROOT_DEV_NAME}" + ROOT_PART_NUM=$(cat "/sys/block/${ROOT_DEV_NAME}/${ROOT_PART_NAME}/partition") + + BOOT_PART_DEV=$(findmnt /boot -o source -n) + BOOT_PART_NAME=$(echo "$BOOT_PART_DEV" | cut -d "/" -f 3) + BOOT_DEV_NAME=$(echo /sys/block/*/"${BOOT_PART_NAME}" | cut -d "/" -f 4) + BOOT_PART_NUM=$(cat "/sys/block/${BOOT_DEV_NAME}/${BOOT_PART_NAME}/partition") + + OLD_DISKID=$(fdisk -l "$ROOT_DEV" | sed -n 's/Disk identifier: 0x\([^ ]*\)/\1/p') + + check_noobs + + ROOT_DEV_SIZE=$(cat "/sys/block/${ROOT_DEV_NAME}/size") + TARGET_END=$((ROOT_DEV_SIZE - 1)) + + PARTITION_TABLE=$(parted -m "$ROOT_DEV" unit s print | tr -d 's') + + LAST_PART_NUM=$(echo "$PARTITION_TABLE" | tail -n 1 | cut -d ":" -f 1) + + ROOT_PART_LINE=$(echo "$PARTITION_TABLE" | grep -e "^${ROOT_PART_NUM}:") + ROOT_PART_START=$(echo "$ROOT_PART_LINE" | cut -d ":" -f 2) + ROOT_PART_END=$(echo "$ROOT_PART_LINE" | cut -d ":" -f 3) + + if [ "$NOOBS" = "1" ]; then + EXT_PART_LINE=$(echo "$PARTITION_TABLE" | grep ":::;" | head -n 1) + EXT_PART_NUM=$(echo "$EXT_PART_LINE" | cut -d ":" -f 1) + EXT_PART_START=$(echo "$EXT_PART_LINE" | cut -d ":" -f 2) + EXT_PART_END=$(echo "$EXT_PART_LINE" | cut -d ":" -f 3) + fi +} + +fix_partuuid() { + mount -o remount,rw "$ROOT_PART_DEV" + mount -o remount,rw "$BOOT_PART_DEV" + DISKID="$(tr -dc 'a-f0-9' < /dev/hwrng | dd bs=1 count=8 2>/dev/null)" + fdisk "$ROOT_DEV" > /dev/null < /dev/kmsg + sleep 5 +else + echo "Could not expand filesystem: ${FAIL_REASON}" > /dev/kmsg + sleep 5 +fi + +reboot_pi diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/auto-expand-fs/files/resize2fs_once b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/auto-expand-fs/files/resize2fs_once new file mode 100644 index 0000000000000000000000000000000000000000..0e6ef95339a35b7e42a9ec689ddf996964a8d25a --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/auto-expand-fs/files/resize2fs_once @@ -0,0 +1,15 @@ +#! /bin/sh + +case "$1" in + start) + echo "Starting resize2fs_once." + ROOT_DEV=$(findmnt / -o source -n) && + resize2fs $ROOT_DEV && + rm /etc/init.d/resize2fs_once && + echo "done" + ;; + *) + echo "Usage: $0 start" >&2 + exit 1 + ;; +esac diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/images/openeuler-image-mcs.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/images/openeuler-image-mcs.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..fd41c8108b05a76445193633b85fb88e77cad44e --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/images/openeuler-image-mcs.bbappend @@ -0,0 +1,78 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +# fix mkfs.ext4 running error, add -E no_copy_xattrs to mkfs.ext4 +WKS_FILE = "sdimage-rpi.wks" +WKS_FILE_DEPENDS = "" + +SDIMG_KERNELIMAGE = "Image" + +# we need more space for boot: see definition in sdcard_image-rpi.bbclass +BOOT_SPACE = "196608" + +RDEPENDS += " \ +${@bb.utils.contains('MCS_FEATURES', 'jailhouse', 'jailhouse-overlay', '', d)} \ +" + +# Notice: we need our sdcard_image-rpi.bbclass in meta-openeuler-bsp to work. +uefi_configuration() { + # we use Image.gz for grub.cfg here + gzip -c "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}" > "${DEPLOY_DIR_IMAGE}/Image.gz" + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/Image.gz ::Image.gz || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/Image.gz into boot.img" + # here we want uefi to boot + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/RPI_EFI.fd ::RPI_EFI.fd || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/RPI_EFI.fd into boot.img" + # here we use efi and grub to boot + mmd -i ${WORKDIR}/boot.img EFI + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/EFI/* ::EFI/ || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/EFI/* into boot.img" + # here we want reserved resources for mcs features. + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/mcs-resources.dtbo ::overlays/mcs-resources.dtbo || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/mcs-resources.dtbo into boot.img" + # add jailhouse-overlay + if ${@bb.utils.contains('MCS_FEATURES', 'jailhouse', 'true', 'false', d)}; then + mcopy -v -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/jailhouse-overlay.dtbo ::overlays/jailhouse-overlay.dtbo || bbfatal "mcopy cannot copy ${DEPLOY_DIR_IMAGE}/jailhouse-overlay.dtbo into boot.img" + fi +} + +# make no login and standard PATH +set_permissions_from_rootfs_append() { + cd "${IMAGE_ROOTFS}" + if [ -f ./etc/inittab ]; then + sed -i "s#respawn:/sbin/getty.*#respawn:-/bin/sh#g" ./etc/inittab + fi + if [ -f ./etc/profile ]; then + sed -i "s#^PATH=.*#PATH=\"/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin\"#g" ./etc/profile + fi + cd - +} + +change_bootfiles_to_enable_uefi() { + CONFIGFILE=${DEPLOY_DIR_IMAGE}/${BOOTFILES_DIR_NAME}/config.txt + + # change configs to use uefi and load mcs dtoverlay + eficfg=`cat ${CONFIGFILE} | grep RPI_EFI || true` + if [ -z "$eficfg" ]; then + echo "arm_64bit=1" >> ${CONFIGFILE} + echo "uart_2ndstage=1" >> ${CONFIGFILE} + echo "enable_gic=1" >> ${CONFIGFILE} + echo "armstub=RPI_EFI.fd" >> ${CONFIGFILE} + echo "disable_commandline_tags=1" >> ${CONFIGFILE} + echo "disable_overscan=1" >> ${CONFIGFILE} + echo "device_tree_address=0x1f0000" >> ${CONFIGFILE} + echo "device_tree_end=0x200000" >> ${CONFIGFILE} + fi + + # add mcs dtoverlay config + dtcfg=`cat ${CONFIGFILE} | grep mcs-resources || true` + if [ -z "$dtcfg" ]; then + echo "dtoverlay=mcs-resources" >> ${CONFIGFILE} + fi + + # add jailhouse-overlay + if ${@bb.utils.contains('MCS_FEATURES', 'jailhouse', 'true', 'false', d)}; then + echo "dtoverlay=jailhouse-overlay" >> ${CONFIGFILE} + fi + + #change grub.cfg to use Image.gz to launch + sed -i 's/linux \/Image /linux \/Image.gz /' ${DEPLOY_DIR_IMAGE}/EFI/BOOT/grub.cfg + #set maxcpus=3, reserve cpu3 for clientos + sed -i 's/linux \/Image.gz/& maxcpus=3 /' ${DEPLOY_DIR_IMAGE}/EFI/BOOT/grub.cfg +} + +IMAGE_PREPROCESS_COMMAND_append += "change_bootfiles_to_enable_uefi" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/images/openeuler-image-tiny.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/images/openeuler-image-tiny.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..80594cb9ba6da3a688adb1991002210422273135 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/images/openeuler-image-tiny.bbappend @@ -0,0 +1,4 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +#fix mkfs.ext4 running error, add -E no_copy_xattrs to mkfs.ext4 +WKS_FILE = "sdimage-rpi.wks" +WKS_FILE_DEPENDS = "" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/images/rpi.inc b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/images/rpi.inc index 0c6383dc9295483ae05967c53ffc309d1b1a17ac..fb51c7e2542f9b39faacedb6486e7359b2c1e258 100644 --- a/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/images/rpi.inc +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/images/rpi.inc @@ -1,13 +1,13 @@ delete_boot_from_rootfs() { test -d "${OUTPUT_DIR}" || mkdir -p "${OUTPUT_DIR}" - pushd "${IMAGE_ROOTFS}" + cd "${IMAGE_ROOTFS}" if [ -d ./boot ];then rm -f "${OUTPUT_DIR}"/*Image* "${OUTPUT_DIR}"/vmlinux* mv boot/${KERNEL_IMAGETYPE}-* "${OUTPUT_DIR}"/${KERNEL_IMAGETYPE} mv boot/vmlinux* "${OUTPUT_DIR}"/ rm -r ./boot fi - popd + cd - } copy_openeuler_distro() { @@ -24,23 +24,17 @@ IMAGE_FSTYPES = "rpi-sdimg" SDIMG_ROOTFS_TYPE = "ext4" EXTRA_IMAGECMD_ext4 += "-E no_copy_xattrs" +# add /init symlink to rootfs, refer to IMAGE_CMD_cpio +IMAGE_PREPROCESS_COMMAND += "add_init_to_rootfs;" -#not depends to native parted/mtools and so on, use host command -export OPENEULER_WIC_IMAGE_REMOVE = "parted dosfstools mtools" -python() { - all_depends = d.getVarFlag("do_image_rpi_sdimg", "depends") - bb.note("all depends of do_image_rpi_sdimg: %s" % all_depends) - for dep in ('parted', 'gptfdisk', 'dosfstools', 'mtools'): - all_depends = all_depends.replace('%s-native:do_populate_sysroot' % dep, "") - new_depends = all_depends - d.setVarFlag("do_image_rpi_sdimg", "depends", new_depends) - bb.note("new depends of do_image_rpi_sdimg: %s" % new_depends) - - all_depends = d.getVarFlag("do_image_ext4", "depends") - bb.note("all depends of do_image_ext4: %s" % all_depends) - for dep in ['e2fsprogs']: - all_depends = all_depends.replace('%s-native:do_populate_sysroot' % dep, "") - new_depends = all_depends - d.setVarFlag("do_image_ext4", "depends", new_depends) - bb.note("new depends of do_image_ext4: %s" % new_depends) -} +add_init_to_rootfs() { + if [ "${IMAGE_BUILDING_DEBUGFS}" != "true" ]; then + if [ ! -L ${IMAGE_ROOTFS}/init ] && [ ! -e ${IMAGE_ROOTFS}/init ]; then + if [ -L ${IMAGE_ROOTFS}/sbin/init ] || [ -e ${IMAGE_ROOTFS}/sbin/init ]; then + ln -sf /sbin/init ${IMAGE_ROOTFS}/init + else + touch ${IMAGE_ROOTFS}/init + fi + fi + fi +} \ No newline at end of file diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/packagegroups/packagegroup-base.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/packagegroups/packagegroup-base.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bdd50aa93dc915daea720dfa91a2c51f7526054c --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/packagegroups/packagegroup-base.bbappend @@ -0,0 +1,9 @@ +RDEPENDS_packagegroup-base_append += " \ +e2fsprogs-resize2fs \ +linux-firmware-rpidistro-bcm43455 \ +wpa-supplicant \ +dsoftbus \ +bluez5 \ +bluez-firmware-rpidistro-bcm4345c0-hcd \ +" + diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/packagegroups/packagegroup-core-boot.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/packagegroups/packagegroup-core-boot.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..04a7c33f2131703290d9ad70a60ea41e2c1b13fb --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-core/packagegroups/packagegroup-core-boot.bbappend @@ -0,0 +1,3 @@ +RDEPENDS_${PN} += " \ + ${@oe.utils.conditional("AUTO-EXPAND-FS", "1", "auto-expand-fs", "", d)} \ +" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/bluez-firmware-rpidistro/bluez-firmware-rpidistro_%.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/bluez-firmware-rpidistro/bluez-firmware-rpidistro_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7d619f92c9fd1f4dab9c187165af9c3f045abf62 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/bluez-firmware-rpidistro/bluez-firmware-rpidistro_%.bbappend @@ -0,0 +1,26 @@ +# apply openeuler source package +OPENEULER_REPO_NAME = "raspberrypi-firmware" + +PV = "20230316" + +SRC_URI = "file://raspberrypi-firmware-${PV}.tar.gz \ +" + +S = "${WORKDIR}/raspberrypi-firmware-${PV}" + +LIC_FILES_CHKSUM = "\ + file://LICENCE.cypress-rpidistro;md5=eb723b61539feef013de476e68b5c50a \ +" + +# copy license +do_extract_lic() { + cp ${S}/License/LICENCE.bluez-firmware ${S}/LICENCE.cypress-rpidistro +} + +# openeuler source package directory tree is difference +do_install() { + install -d ${D}${nonarch_base_libdir}/firmware/brcm + + cp LICENCE.cypress-rpidistro ${D}${nonarch_base_libdir}/firmware + install -m 0644 BCM434*.hcd ${D}${nonarch_base_libdir}/firmware/brcm/ +} diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..12c6f762981f457f3b5e0eeb8bd395a05c686075 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend @@ -0,0 +1,86 @@ +# apply openeuler source package + +OPENEULER_REPO_NAME = "raspberrypi-firmware" + +PV = "20230316" + +SRC_URI = "file://raspberrypi-firmware-${PV}.tar.gz \ +" + +S = "${WORKDIR}/raspberrypi-firmware-${PV}" + +LICENSE = "\ + Firmware-broadcom_bcm43xx-rpidistro \ +" + +# openeuler source package directory tree is difference +LIC_FILES_CHKSUM = "\ + file://License/LICENCE.broadcom_brcm80211;md5=a59d187f4143e4acd4e8dc4dc626f591 \ +" + +NO_GENERIC_LICENSE[Firmware-broadcom_bcm43xx-rpidistro] = "License/LICENCE.broadcom_brcm80211" + +# in do_install function, it will exec: +# cp ./LICENCE.broadcom_bcm43xx ${D}${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx-rpidistro +# but this license file is at ${S}/License in openeuler source package +# so copy it to ${S} in do_compile function +do_compile_append() { + cp ./License/LICENCE.broadcom_brcm80211 ./LICENCE.broadcom_bcm43xx +} + +# regulatory.db is needed when firmware load +# this files is packed together in raspberrypi-firmware, just copy it. +# update from upstream +do_install() { + install -d ${D}${nonarch_base_libdir}/firmware/brcm ${D}${nonarch_base_libdir}/firmware/cypress + + cp ./LICENCE.broadcom_bcm43xx ${D}${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx-rpidistro + + for fw in \ + brcmfmac43430-sdio \ + brcmfmac43436-sdio \ + brcmfmac43436s-sdio \ + brcmfmac43455-sdio \ + brcmfmac43456-sdio; do + cp -R --no-dereference --preserve=mode,links -v brcm/${fw}.* ${D}${nonarch_base_libdir}/firmware/brcm/ + done + + cp -R --no-dereference --preserve=mode,links -v cypress/* ${D}${nonarch_base_libdir}/firmware/cypress/ + + rm ${D}${nonarch_base_libdir}/firmware/cypress/README.txt + rm ${D}${nonarch_base_libdir}/firmware/cypress/43439A0-7.95.49.00.combined + + rm ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.bin + ln -s ../cypress/cyfmac43455-sdio-standard.bin ${D}/${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.bin + + # add compat links. Fixes errors like + # brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-compute-module.txt failed with error -2 + ln -sf brcmfmac43455-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt + # brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.bin failed with error -2 + ln -sf brcmfmac43455-sdio.bin ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.bin + # brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.bin failed with error -2 + ln -sf brcmfmac43430-sdio.bin ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.bin + # brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.bin failed with error -2 + ln -sf brcmfmac43430-sdio.bin ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.bin + + cp ./regulatory* ${D}${nonarch_base_libdir}/firmware +} + +PACKAGES += "\ + ${PN}-bcm43436 \ + ${PN}-bcm43436s \ +" + +FILES_${PN}-bcm43455 += " \ + ${nonarch_base_libdir}/firmware/regulatory* \ + ${nonarch_base_libdir}/firmware/cypress/cyfmac43455-sdio* \ +" + +FILES:${PN}-bcm43430 += " \ + ${nonarch_base_libdir}/firmware/cypress/cyfmac43430-sdio.bin \ + ${nonarch_base_libdir}/firmware/cypress/cyfmac43430-sdio.clm_blob \ +" + +FILES:${PN}-bcm43436 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43436-*" + +FILES:${PN}-bcm43436s = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43436s*" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/files/enable_cpu_hotplug.patch b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/files/enable_cpu_hotplug.patch new file mode 100644 index 0000000000000000000000000000000000000000..bbaa0c202c9714b78a49b0c036b78dd248f3a059 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/files/enable_cpu_hotplug.patch @@ -0,0 +1,9 @@ +diff --git a/arch/arm64/configs/bcm2711_defconfig b/arch/arm64/configs/bcm2711_defconfig +index 75333e69e..51a4e77be 100644 +--- a/arch/arm64/configs/bcm2711_defconfig ++++ b/arch/arm64/configs/bcm2711_defconfig +@@ -1564,3 +1564,4 @@ CONFIG_IRQSOFF_TRACER=y + CONFIG_SCHED_TRACER=y + CONFIG_BLK_DEV_IO_TRACE=y + # CONFIG_UPROBE_EVENTS is not set ++CONFIG_HOTPLUG_CPU=y diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler-rpi.inc b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler-rpi.inc new file mode 100644 index 0000000000000000000000000000000000000000..579f0acb7e81624847c79684c7ddcb5e5aaa02ed --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler-rpi.inc @@ -0,0 +1,7 @@ +# apply RPI kernel patch +FILESEXTRAPATHS_append := "${THISDIR}/files/:" + +# export symbol for jailhouse +SRC_URI_append = "${@bb.utils.contains('MCS_FEATURES', 'jailhouse', \ + ' file://Jailhouse/jailhouse_fix_rpi4_compile_error.patch \ + file://enable_cpu_hotplug.patch', '', d)}" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler-rt.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler-rt.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..26ff4f06d5000c9831832ce33e17a4f2cff01a33 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler-rt.bbappend @@ -0,0 +1,19 @@ +# For the Raspberry Pi, we don't need to apply the aarch64 patches +SRC_URI_remove_raspberrypi4 += " \ + file://src-kernel-5.10/0001-modify-openeuler_defconfig-for-rt62.patch \ +" + +SRC_URI += "\ + file://src-kernel-5.10/0000-raspberrypi-kernel.patch \ + file://src-kernel-5.10/0002-modify-bcm2711_defconfig-for-rt-rpi-kernel.patch \ +" + +require linux-openeuler-rpi.inc + +COMPATIBLE_MACHINE = "raspberrypi4-64" + +OPENEULER_KERNEL_CONFIG = "${S}/arch/${ARCH}/configs/bcm2711_defconfig" +do_configure_prepend() { + sed -i '$a CONFIG_ACPI=y' ${OPENEULER_KERNEL_CONFIG} + cp -f "${OPENEULER_KERNEL_CONFIG}" .config +} diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler.bbappend index ad6ebab9b69f1b8fa2d867532545798d93ea3b78..30ae72f9e014ec0492b62ace777089d3fde1d417 100644 --- a/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler.bbappend +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler.bbappend @@ -1,6 +1,8 @@ SRC_URI += "\ file://src-kernel-5.10/0000-raspberrypi-kernel.patch \ " +require linux-openeuler-rpi.inc + OPENEULER_KERNEL_CONFIG = "${S}/arch/${ARCH}/configs/bcm2711_defconfig" do_configure_prepend() { sed -i '$a CONFIG_ACPI=y' ${OPENEULER_KERNEL_CONFIG} diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/lopper/lopper-ops.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/lopper/lopper-ops.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7f6cf72d5c055f6dd95fa55bf9aced690af3c1cd --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/lopper/lopper-ops.bbappend @@ -0,0 +1,2 @@ +# Use the operation files from current layer +FILESEXTRAPATHS_prepend := "${THISDIR}/:" diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/lopper/lops/lop-extract-uart5-for-zephyr.dts b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/lopper/lops/lop-extract-uart5-for-zephyr.dts new file mode 100644 index 0000000000000000000000000000000000000000..c47656cabcb8a5a0ffa8428c59ae86315bf47135 --- /dev/null +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/lopper/lops/lop-extract-uart5-for-zephyr.dts @@ -0,0 +1,48 @@ +/dts-v1/; + +/ { + compatible = "system-device-tree-v1"; + lops { + // Extract a serial(serial@7e201a00) from rpi4 device tree + // and output it to zephyr-rpi4.dts + lop_1: lop_1 { + compatible = "system-device-tree-v1,lop,select-v1"; + // clear any old selections + select_1; + select_2 = "/:compatible:raspberrypi,4-model-b\0brcm,bcm2711"; + }; + lop_1_1: lop_1_1 { + compatible = "system-device-tree-v1,lop,code-v1"; + code = " + tree.process = False + if __selected__: + print( 'Compatible dts (rpi4) found: %s' % node ) + tree.process = True + + if __selected__: + return True + else: + return False + "; + + lop_1_1_1 { + compatible = "system-device-tree-v1,lop,tree"; + cond = <&lop_1>; + tree = "zephyr-tree"; + nodes = "serial@7e201a00"; + }; + lop_1_1_2 { + compatible = "system-device-tree-v1,lop,output"; + cond = <&lop_1>; + tree = "zephyr-tree"; + outfile = "zephyr-rpi4.dts"; + nodes = "*"; + }; + lop_1_1_3 { + compatible = "system-device-tree-v1,lop,modify"; + cond = <&lop_1>; + modify = "/soc/serial@7e201a00/::"; + }; + }; + }; +}; diff --git a/bsp/meta-raspberrypi/conf/layer.conf b/bsp/meta-raspberrypi/conf/layer.conf index 2518379ae7082ccda1645bada758ca347b8d1418..4a0539a0984c15cf482ad3964865d59a9b6b46b8 100644 --- a/bsp/meta-raspberrypi/conf/layer.conf +++ b/bsp/meta-raspberrypi/conf/layer.conf @@ -34,6 +34,8 @@ BBFILES_DYNAMIC += " \ qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/*/*/*.bbappend \ multimedia-layer:${LAYERDIR}/dynamic-layers/multimedia-layer/*/*/*.bb \ multimedia-layer:${LAYERDIR}/dynamic-layers/multimedia-layer/*/*/*.bbappend \ + ros2-layer:${LAYERDIR}/dynamic-layers/ros2-layer/*/*/*.bb \ + ros2-layer:${LAYERDIR}/dynamic-layers/ros2-layer/*/*/*.bbappend \ " DEFAULT_TEST_SUITES_remove_rpi = "parselogs" diff --git a/bsp/meta-raspberrypi/dynamic-layers/ros2-layer/recipes-core/images/openeuler-image-ros.bbappend b/bsp/meta-raspberrypi/dynamic-layers/ros2-layer/recipes-core/images/openeuler-image-ros.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..cd3482ac947c5c0e59498765ff41059dd08dde7a --- /dev/null +++ b/bsp/meta-raspberrypi/dynamic-layers/ros2-layer/recipes-core/images/openeuler-image-ros.bbappend @@ -0,0 +1,9 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +#fix mkfs.ext4 running error, add -E no_copy_xattrs to mkfs.ext4 +WKS_FILE = "sdimage-rpi.wks" +WKS_FILE_DEPENDS = "" + +# add ros slam demo for rpi4 +IMAGE_INSTALL += " \ +packagegroup-rosslam \ +" diff --git a/bsp/meta-raspberrypi/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-base_%.bbappend b/bsp/meta-raspberrypi/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-base_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..9926f857365d8c6bb76d371d6031d28d82a23354 --- /dev/null +++ b/bsp/meta-raspberrypi/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-base_%.bbappend @@ -0,0 +1,5 @@ +# we use ttyS0 as originbot base serial port in rpi4 as default +do_configure_prepend_class-target() { + sed -i 's:ttyS3:ttyS0:g' ${S}/launch/robot.launch.py +} + diff --git a/bsp/meta-raspberrypi/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-bringup_%.bbappend b/bsp/meta-raspberrypi/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-bringup_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..10b7b9564992b37b6db55a7ab9ec12cf7e666e7f --- /dev/null +++ b/bsp/meta-raspberrypi/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-bringup_%.bbappend @@ -0,0 +1,5 @@ +# we use ttyUSB0 as ydlidar serial port in rpi4 as default +do_configure_prepend_class-target() { + sed -i 's:dev\/ydlidar:dev\/ttyUSB0:g' ${S}/param/ydlidar.yaml +} + diff --git a/bsp/meta-rockchip/COPYING.MIT b/bsp/meta-rockchip/COPYING.MIT new file mode 100644 index 0000000000000000000000000000000000000000..fb950dc69feb8afa93493747f33d6e1c02659b55 --- /dev/null +++ b/bsp/meta-rockchip/COPYING.MIT @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/bsp/meta-rockchip/README b/bsp/meta-rockchip/README new file mode 100644 index 0000000000000000000000000000000000000000..2bb106eb45ad3427c6a32eb7680cbcae4900af9c --- /dev/null +++ b/bsp/meta-rockchip/README @@ -0,0 +1,41 @@ +This README file contains information on the contents of the meta-rockchip layer. + +Please see the corresponding sections below for details. + +Dependencies +============ + + URI: + branch: + + URI: + branch: + + . + . + . + +Patches +======= + +Please submit any patches against the meta-rockchip layer to the xxxx mailing list (xxxx@zzzz.org) +and cc: the maintainer: + +Maintainer: XXX YYYYYY + +Table of Contents +================= + + I. Adding the meta-rockchip layer to your build + II. Misc + + +I. Adding the meta-rockchip layer to your build +================================================= + +Run 'bitbake-layers add-layer meta-rockchip' + +II. Misc +======== + +--- replace with specific information about the meta-rockchip layer --- diff --git a/bsp/meta-rockchip/conf/layer.conf b/bsp/meta-rockchip/conf/layer.conf new file mode 100644 index 0000000000000000000000000000000000000000..00d67645bb88c3bff418e8463fd535119a4cc852 --- /dev/null +++ b/bsp/meta-rockchip/conf/layer.conf @@ -0,0 +1,19 @@ +# 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 += "rockchip" +BBFILE_PATTERN_rockchip = "^${LAYERDIR}/" +BBFILE_PRIORITY_rockchip = "6" + +LAYERDEPENDS_rockchip = "core" +LAYERSERIES_COMPAT_rockchip = "hardknott" + +# enable .bb under qt5-layer/ when exist meta-qt5 +BBFILES_DYNAMIC += " \ +qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/recipes-*/*/*.bb \ +qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/recipes-*/*/*.bbappend \ +" diff --git a/bsp/meta-rockchip/conf/machine/include/rk3568.inc b/bsp/meta-rockchip/conf/machine/include/rk3568.inc new file mode 100644 index 0000000000000000000000000000000000000000..251cc58757ba552f0a761e2ec563bfa6733b7a7a --- /dev/null +++ b/bsp/meta-rockchip/conf/machine/include/rk3568.inc @@ -0,0 +1,28 @@ +include conf/machine/include/tune-cortexa55.inc +MACHINE_FEATURES += "efi pci vc4graphics" +MACHINEOVERRIDES =. "rk3568:march64le:" +DEFAULTTUNE = "aarch64" + +require conf/multilib.conf +# currently, don't support 32 bit libs +MULTILIBS = "" + +ROOTFS_PACKAGE_ARCH = "aarch64" + +# set IMAGETYPE and dtb +KERNEL_IMAGETYPE = "Image" +# choose dtb file +RK3568_KERNEL_DTB_NAME ?= "OK3568-C-linux.dtb" +KERNEL_DEVICETREE = "rockchip/${RK3568_KERNEL_DTB_NAME}" +ENABLE_UART = "1" +# serial port enabled in ok3568 +CMDLINE_SERIAL = "console=tty1 console=ttyFIQ0,115200" +SERIAL_CONSOLES = "115200;ttyFIQ0" + +# arm and arm64 both support -mlittle-endian so no +# need to consider compat32. +TUNE_CCARGS .= " -mlittle-endian" +IMAGE_INSTALL_append = " kernel-modules" + +# auto load module during startup +KERNEL_MODULE_AUTOLOAD = "mlan moal " diff --git a/bsp/meta-rockchip/conf/machine/ok3568.conf b/bsp/meta-rockchip/conf/machine/ok3568.conf new file mode 100644 index 0000000000000000000000000000000000000000..2ebf7834f5ee1723c0e0a0684d8c1c21979da6e5 --- /dev/null +++ b/bsp/meta-rockchip/conf/machine/ok3568.conf @@ -0,0 +1 @@ +require conf/machine/include/rk3568.inc diff --git a/bsp/meta-rockchip/conf/machine/ryd-3568.conf b/bsp/meta-rockchip/conf/machine/ryd-3568.conf new file mode 100644 index 0000000000000000000000000000000000000000..0fe7cbb8c6632766e685044cc6456218f79bf6da --- /dev/null +++ b/bsp/meta-rockchip/conf/machine/ryd-3568.conf @@ -0,0 +1,2 @@ +require conf/machine/include/rk3568.inc +RK3568_KERNEL_DTB_NAME = "rk3568-8897-ddr4-v1-linux-hdmi.dtb" diff --git a/bsp/meta-rockchip/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend b/bsp/meta-rockchip/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bb9b173f6bf69fef9ed5acde6a1c7cbeb4cfb126 --- /dev/null +++ b/bsp/meta-rockchip/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend @@ -0,0 +1,19 @@ +PACKAGECONFIG_GL = "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'gl', \ + bb.utils.contains('DISTRO_FEATURES', 'opengl', 'eglfs gles2', \ + '', d), d)}" +PACKAGECONFIG_GL_append = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', ' kms', '', d)}" +PACKAGECONFIG_GL_append = " gbm" +PACKAGECONFIG_FONTS = "fontconfig" +PACKAGECONFIG_append = " libinput examples tslib xkbcommon" +PACKAGECONFIG_remove = "tests" + +OE_QTBASE_EGLFS_DEVICE_INTEGRATION = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', 'eglfs_brcm', d)}" + +do_configure_prepend() { + # Add the appropriate EGLFS_DEVICE_INTEGRATION + if [ "${@d.getVar('OE_QTBASE_EGLFS_DEVICE_INTEGRATION')}" != "" ]; then + echo "EGLFS_DEVICE_INTEGRATION = ${OE_QTBASE_EGLFS_DEVICE_INTEGRATION}" >> ${S}/mkspecs/oe-device-extra.pri + fi +} +RDEPENDS_${PN}_append = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', ' userland', d)}" +DEPENDS_append = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', ' userland', d)}" \ No newline at end of file diff --git a/bsp/meta-rockchip/recipes-connectivity/init-ifupdown/init-ifupdown/interfaces_rk3568 b/bsp/meta-rockchip/recipes-connectivity/init-ifupdown/init-ifupdown/interfaces_rk3568 new file mode 100644 index 0000000000000000000000000000000000000000..7f9faa05207a2e29aaec647d731c759c32f6a191 --- /dev/null +++ b/bsp/meta-rockchip/recipes-connectivity/init-ifupdown/init-ifupdown/interfaces_rk3568 @@ -0,0 +1,38 @@ +# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) + +# The loopback interface +auto lo +iface lo inet loopback + +# Wireless interfaces +iface mlan0 inet dhcp + wireless_mode managed + wireless_essid any + wpa-driver wext + wpa-conf /etc/wpa_supplicant.conf + +iface atml0 inet dhcp + +# Wired or wireless interfaces +auto eth0 +iface eth0 inet static + address 192.168.0.7 + netmask 255.255.255.0 + network 192.168.0.0 + gateway 192.168.0.1 +iface eth1 inet static + address 192.168.0.8 + netmask 255.255.255.0 + network 192.168.0.0 + gateway 192.168.0.1 + +# Ethernet/RNDIS gadget (g_ether) +# ... or on host side, usbnet and random hwaddr +iface usb0 inet static + address 192.168.7.2 + netmask 255.255.255.0 + network 192.168.7.0 + gateway 192.168.7.1 + +# Bluetooth networking +iface bnep0 inet dhcp \ No newline at end of file diff --git a/bsp/meta-rockchip/recipes-connectivity/init-ifupdown/init-ifupdown_1.0.bbappend b/bsp/meta-rockchip/recipes-connectivity/init-ifupdown/init-ifupdown_1.0.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..aeb3b8487db59275804250f7930b82a928e7989b --- /dev/null +++ b/bsp/meta-rockchip/recipes-connectivity/init-ifupdown/init-ifupdown_1.0.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" + +SRC_URI_append_rk3568 = " file://interfaces_rk3568 \ +" + +do_install_append_rk3568 () { + install -m 0644 ${WORKDIR}/interfaces_rk3568 ${D}${sysconfdir}/network/interfaces +} diff --git a/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/ed_mac_ctrl_V3_8987.conf b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/ed_mac_ctrl_V3_8987.conf new file mode 100644 index 0000000000000000000000000000000000000000..af2f2da3b322d9cc25ae59c3b1c716a2a9d73292 --- /dev/null +++ b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/ed_mac_ctrl_V3_8987.conf @@ -0,0 +1,23 @@ +# File : ed_mac_ctrl_V3_8987.conf +# +# ed_mac_ctrl_v3 is used for 88W8997, 88W8987, 88W8977 +# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V3_8987.conf ed_mac_ctrl_v3 +# +## Set Energy Detect Threshold for EU Adaptivity test + +ed_mac_ctrl_v3={ + CmdCode=0x0130 #Command code, DO NOT change this line + ed_ctrl_2g.enable:2=0x1 # 0 - disable EU adaptivity for 2.4GHz band + # 1 - enable EU adaptivity for 2.4GHz band + + ed_ctrl_2g.offset:2=0x6 # 0 - Default Energy Detect threshold + #offset value range: 0x80 to 0x7F + + ed_ctrl_5g.enable:2=0x1 # 0 - disable EU adaptivity for 5GHz band + # 1 - enable EU adaptivity for 5GHz band + + ed_ctrl_5g.offset:2=0x6 # 0 - Default Energy Detect threshold + #offset value range: 0x80 to 0x7F + + ed_ctrl_txq_lock:4=0xFF #DO NOT Change this line +} diff --git a/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/ed_mac_ctrl_V3_8997.conf b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/ed_mac_ctrl_V3_8997.conf new file mode 100644 index 0000000000000000000000000000000000000000..6c86bd7060a3ad66f08cb279e1748bd60e508aa5 --- /dev/null +++ b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/ed_mac_ctrl_V3_8997.conf @@ -0,0 +1,23 @@ +# File : ed_mac_ctrl_V3_8997.conf +# +# ed_mac_ctrl_v3 is used for 88W8997, 88W8987, 88W8977 +# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V3_8997.conf ed_mac_ctrl_v3 +# +## Set Energy Detect Threshold for EU Adaptivity test + +ed_mac_ctrl_v3={ + CmdCode=0x0130 #Command code, DO NOT change this line + ed_ctrl_2g.enable:2=0x1 # 0 - disable EU adaptivity for 2.4GHz band + # 1 - enable EU adaptivity for 2.4GHz band + + ed_ctrl_2g.offset:2=0x0 # 0 - Default Energy Detect threshold + #offset value range: 0x80 to 0x7F + + ed_ctrl_5g.enable:2=0x1 # 0 - disable EU adaptivity for 5GHz band + # 1 - enable EU adaptivity for 5GHz band + + ed_ctrl_5g.offset:2=0x4 # 0 - Default Energy Detect threshold + #offset value range: 0x80 to 0x7F + + ed_ctrl_txq_lock:4=0xFF #DO NOT Change this line +} diff --git a/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/pcieuart8997_combo_v4.bin b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/pcieuart8997_combo_v4.bin new file mode 100644 index 0000000000000000000000000000000000000000..ca6f9ddba385f76ac1560a1c8033b11cc0ba5003 Binary files /dev/null and b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/pcieuart8997_combo_v4.bin differ diff --git a/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/sdiouart8987_combo_v0.bin b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/sdiouart8987_combo_v0.bin new file mode 100644 index 0000000000000000000000000000000000000000..a385809d4c47520fd186ab83499e80a7c3320d1e Binary files /dev/null and b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/sdiouart8987_combo_v0.bin differ diff --git a/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/txpwrlimit_cfg_8987.conf b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/txpwrlimit_cfg_8987.conf new file mode 100644 index 0000000000000000000000000000000000000000..74be6d6a307b8d3a69bb8a356f7d60080d119356 --- /dev/null +++ b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/txpwrlimit_cfg_8987.conf @@ -0,0 +1,509 @@ +# File : txpwrlimit_cfg.conf +## Get CFG data for Tx power limitation +txpwrlimit_2g_cfg_get={ + CmdCode=0x00fb # do NOT change this line + Action:2=0 # 0 - GET + SubBand:2=0x00 # 0x00 2G subband (2.4G: channel 1-14) + # 0x10 5G subband0 (5G: channel 36,40,44,48, + # 52,56,60,64) + # 0x11 5G subband1 (5G: channel 100,104,108,112, + # 116,120,124,128, + # 132,136,140,144) + # 0x12 5G subband2 (5G: channel 149,153,157,161,165,172) + # 0x13 5G subband3 (5G: channel 183,184,185,187,188, + # 189, 192,196; + # 5G: channel 7,8,11,12,16,34) +} + + +txpwrlimit_5g_cfg_get_sub0={ + CmdCode=0x00fb # do NOT change this line + Action:2=0 # 0 - GET + SubBand:2=0x10 # 0x00 2G subband (2.4G: channel 1-14) + # 0x10 5G subband0 (5G: channel 36,40,44,48, + # 52,56,60,64) + # 0x11 5G subband1 (5G: channel 100,104,108,112, + # 116,120,124,128, + # 132,136,140,144) + # 0x12 5G subband2 (5G: channel 149,153,157,161,165,172) + # 0x13 5G subband3 (5G: channel 183,184,185,187,188, + # 189, 192,196; + # 5G: channel 7,8,11,12,16,34) +} + + +txpwrlimit_5g_cfg_get_sub1={ + CmdCode=0x00fb # do NOT change this line + Action:2=0 # 0 - GET + SubBand:2=0x11 # 0x00 2G subband (2.4G: channel 1-14) + # 0x10 5G subband0 (5G: channel 36,40,44,48, + # 52,56,60,64) + # 0x11 5G subband1 (5G: channel 100,104,108,112, + # 116,120,124,128, + # 132,136,140,144) + # 0x12 5G subband2 (5G: channel 149,153,157,161,165,172) + # 0x13 5G subband3 (5G: channel 183,184,185,187,188, + # 189, 192,196; + # 5G: channel 7,8,11,12,16,34) +} + + +txpwrlimit_5g_cfg_get_sub2={ + CmdCode=0x00fb # do NOT change this line + Action:2=0 # 0 - GET + SubBand:2=0x12 # 0x00 2G subband (2.4G: channel 1-14) + # 0x10 5G subband0 (5G: channel 36,40,44,48, + # 52,56,60,64) + # 0x11 5G subband1 (5G: channel 100,104,108,112, + # 116,120,124,128, + # 132,136,140,144) + # 0x12 5G subband2 (5G: channel 149,153,157,161,165,172) + # 0x13 5G subband3 (5G: channel 183,184,185,187,188, + # 189, 192,196; + # 5G: channel 7,8,11,12,16,34) +} + + +txpwrlimit_5g_cfg_get_sub3={ + CmdCode=0x00fb # do NOT change this line + Action:2=0 # 0 - GET + SubBand:2=0x13 # 0x00 2G subband (2.4G: channel 1-14) + # 0x10 5G subband0 (5G: channel 36,40,44,48, + # 52,56,60,64) + # 0x11 5G subband1 (5G: channel 100,104,108,112, + # 116,120,124,128, + # 132,136,140,144) + # 0x12 5G subband2 (5G: channel 149,153,157,161,165,172) + # 0x13 5G subband3 (5G: channel 183,184,185,187,188, + # 189, 192,196; + # 5G: channel 7,8,11,12,16,34) +} + +## Set CFG data for Tx power limitation +## +## TLVStartFreq: Starting Frequency of the band for this channel +## 2407, 2414 or 2400 for 2.4 GHz +## 5000 +## 4000 +## TLVChanWidth: Channel Width +## 20 +## TLVChanNum : Channel Number +## TLVPwr[] : ModulationGroup +## 0: CCK (1,2,5.5,11 Mbps) +## 1: OFDM (6,9,12,18 Mbps) +## 2: OFDM (24,36 Mbps) +## 3: OFDM (48,54 Mbps) +## 4: HT20 (0,1,2) +## 5: HT20 (3,4) +## 6: HT20 (5,6,7) +## 7: HT40 (0,1,2) +## 8: HT40 (3,4) +## 9: HT40 (5,6,7) +## 10: VHT_QAM256 (MCS8) +## 11: VHT_40_QAM256 (MCS8,9) +## 12: VHT_80_PSK (MCS0,1,2) +## 13: VHT_80_QAM16 (MCS3,4) +## 14: VHT_80_QAM64 (MCS5,6,7) +## 15: VHT_80_QAM256 (MCS8,9) +## Power Limit in dBm +## +## For 40MHz modulation groups, specify same Tx power value for a set of +## two consecutive channel frequencies +## Valid channel sets: +## (36, 40), (44, 48), (52, 56), (60, 64) +## (100, 104), (108, 112), (116, 120), (124, 128), (132, 136), (140, 144) +## (149, 153), (157, 161) +## +## For 80MHz modulation groups, specify same Tx power value for a set of +## four consecutive channel frequencies +## Valid channel sets: +## (36, 40, 44, 48), (52, 56, 60, 64) +## (100, 104, 108, 112), (116, 120, 124, 128), (132, 136, 140, 144) +## (149, 153, 157, 161) + +## 2G Tx power limit CFG +txpwrlimit_2g_cfg_set={ + CmdCode=0x00fb # do NOT change this line + Action:2=1 # 1 - SET + RSVD:2=0 # do NOT change this line + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=1 + TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=2 + TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=3 + TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=4 + TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=5 + TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=6 + TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=7 + TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=8 + TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=9 + TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=10 + TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=11 + TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=12 + TLVPwr:24='0,16,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=13 + TLVPwr:24='0,16,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,16,11,16' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2414 + TLVChanWidth:1=20 + TLVChanNum:1=14 + TLVPwr:24='0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12' + } +} + +## 5G Tx power limit CFG +txpwrlimit_5g_cfg_set={ + CmdCode=0x00fb # do NOT change this line + Action:2=1 # 1 - SET + RSVD:2=0 # do NOT change this line + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=36 + TLVPwr:32='0,0,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=40 + TLVPwr:32='0,0,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=44 + TLVPwr:32='0,0,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=48 + TLVPwr:32='0,0,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=52 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=56 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=60 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=64 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=100 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=104 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=108 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=112 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=116 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=120 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=124 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=128 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=132 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=136 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=140 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=144 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=149 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=153 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=157 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=161 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=165 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=183 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=184 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=185 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=187 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=188 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=189 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=192 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=196 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=7 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=8 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=11 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=12 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=16 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=34 + TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13' + } +} diff --git a/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/txpwrlimit_cfg_8997.conf b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/txpwrlimit_cfg_8997.conf new file mode 100644 index 0000000000000000000000000000000000000000..0f3b71a5368eca418e4814de39ea4cfdd0603b31 --- /dev/null +++ b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/txpwrlimit_cfg_8997.conf @@ -0,0 +1,621 @@ +# File : txpwrlimit_cfg.conf +## Get CFG data for Tx power limitation +txpwrlimit_2g_cfg_get={ + CmdCode=0x00fb # do NOT change this line + Action:2=0 # 0 - GET + SubBand:2=0x00 # 0x00 2G subband (2.4G: channel 1-14) + # 0x10 5G subband0 (5G: channel 36,40,44,48, + # 52,56,60,64) + # 0x11 5G subband1 (5G: channel 100,104,108,112, + # 116,120,124,128, + # 132,136,140,144) + # 0x12 5G subband2 (5G: channel 149,153,157,161,165,172) + # 0x13 5G subband3 (5G: channel 183,184,185,187,188, + # 189, 192,196; + # 5G: channel 7,8,11,12,16,34) +} + + +txpwrlimit_5g_cfg_get_sub0={ + CmdCode=0x00fb # do NOT change this line + Action:2=0 # 0 - GET + SubBand:2=0x10 # 0x00 2G subband (2.4G: channel 1-14) + # 0x10 5G subband0 (5G: channel 36,40,44,48, + # 52,56,60,64) + # 0x11 5G subband1 (5G: channel 100,104,108,112, + # 116,120,124,128, + # 132,136,140,144) + # 0x12 5G subband2 (5G: channel 149,153,157,161,165,172) + # 0x13 5G subband3 (5G: channel 183,184,185,187,188, + # 189, 192,196; + # 5G: channel 7,8,11,12,16,34) +} + + +txpwrlimit_5g_cfg_get_sub1={ + CmdCode=0x00fb # do NOT change this line + Action:2=0 # 0 - GET + SubBand:2=0x11 # 0x00 2G subband (2.4G: channel 1-14) + # 0x10 5G subband0 (5G: channel 36,40,44,48, + # 52,56,60,64) + # 0x11 5G subband1 (5G: channel 100,104,108,112, + # 116,120,124,128, + # 132,136,140,144) + # 0x12 5G subband2 (5G: channel 149,153,157,161,165,172) + # 0x13 5G subband3 (5G: channel 183,184,185,187,188, + # 189, 192,196; + # 5G: channel 7,8,11,12,16,34) +} + + +txpwrlimit_5g_cfg_get_sub2={ + CmdCode=0x00fb # do NOT change this line + Action:2=0 # 0 - GET + SubBand:2=0x12 # 0x00 2G subband (2.4G: channel 1-14) + # 0x10 5G subband0 (5G: channel 36,40,44,48, + # 52,56,60,64) + # 0x11 5G subband1 (5G: channel 100,104,108,112, + # 116,120,124,128, + # 132,136,140,144) + # 0x12 5G subband2 (5G: channel 149,153,157,161,165,172) + # 0x13 5G subband3 (5G: channel 183,184,185,187,188, + # 189, 192,196; + # 5G: channel 7,8,11,12,16,34) +} + + +txpwrlimit_5g_cfg_get_sub3={ + CmdCode=0x00fb # do NOT change this line + Action:2=0 # 0 - GET + SubBand:2=0x13 # 0x00 2G subband (2.4G: channel 1-14) + # 0x10 5G subband0 (5G: channel 36,40,44,48, + # 52,56,60,64) + # 0x11 5G subband1 (5G: channel 100,104,108,112, + # 116,120,124,128, + # 132,136,140,144) + # 0x12 5G subband2 (5G: channel 149,153,157,161,165,172) + # 0x13 5G subband3 (5G: channel 183,184,185,187,188, + # 189, 192,196; + # 5G: channel 7,8,11,12,16,34) +} + +## Set CFG data for Tx power limitation +## +## TLVStartFreq: Starting Frequency of the band for this channel +## 2407, 2414 or 2400 for 2.4 GHz +## 5000 +## 4000 +## TLVChanWidth: Channel Width +## 20 +## TLVChanNum : Channel Number +## TLVPwr[] : ModulationGroup +## 0: CCK (1,2,5.5,11 Mbps) +## 1: OFDM (6,9,12,18 Mbps) +## 2: OFDM (24,36 Mbps) +## 3: OFDM (48,54 Mbps) +## 4: HT20 (MCS0,1,2) +## 5: HT20 (MCS3,4) +## 6: HT20 (MCS5,6,7) +## 7: HT40 (MCS0,1,2) +## 8: HT40 (MCS3,4) +## 9: HT40 (MCS5,6,7) +## 10: HT2_20 (MCS8,9,10) +## 11: HT2_20 (MCS11,12) +## 12: HT2_20 (MCS13,14,15) +## 13: HT2_40 (MCS8,9,10) +## 14: HT2_40 (MCS11,12) +## 15: HT2_40 (MCS13,14,15) +## 16: VHT_QAM256 (MCS8) +## 17: VHT_40_QAM256 (MCS8,9) +## 18: VHT_80_PSK (MCS0,1,2) +## 19: VHT_80_QAM16 (MCS3,4) +## 20: VHT_80_QAM64 (MCS5,6,7) +## 21: VHT_80_QAM256 (MCS8,9) +## 22: VHT2_20_QAM256 (MCS8,9) +## 23: VHT2_40_QAM256 (MCS8,9) +## 24: VHT2_80_PSK (MCS0, 1, 2) +## 25: VHT2_80_QAM16 (MCS3,4) +## 26: VHT2_80_QAM64 (MCS5,6,7) +## 27: VHT2_80_QAM256 (MCS8,9) +## Power Limit in dBm + +## For 40MHz modulation groups, specify same Tx power value for a set of +## two consecutive channel frequencies +## Valid channel sets: +## (36, 40), (44, 48), (52, 56), (60, 64) +## (100, 104), (108, 112), (116, 120), (124, 128), (132, 136), (140, 144) +## (149, 153), (157, 161) +## +## For 80MHz modulation groups, specify same Tx power value for a set of +## four consecutive channel frequencies +## Valid channel sets: +## (36, 40, 44, 48), (52, 56, 60, 64) +## (100, 104, 108, 112), (116, 120, 124, 128), (132, 136, 140, 144) +## (149, 153, 157, 161) + + +## 2G subband0 Tx power limit CFG +txpwrlimit_2g_cfg_set={ + CmdCode=0x00fb # do NOT change this line + Action:2=1 # 1 - SET + SubBand:2=0 # do NOT use this member in set cmd + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=1 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=2 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=3 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=4 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=5 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=6 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=7 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=8 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=9 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=10 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=11 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=12 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=13 + TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15' + } + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=2407 + TLVChanWidth:1=20 + TLVChanNum:1=14 + TLVPwr:32='0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12,12,12,13,12,14,12,15,12' + } +} + +## 5G subband1 Tx power limit CFG +txpwrlimit_5g_cfg_set_sub0={ + CmdCode=0x00fb # do NOT change this line + Action:2=1 # 1 - SET + SubBand:2=0 # do NOT use this member in set cmd + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=36 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=40 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=44 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=48 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=52 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=56 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=60 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=64 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } +} + +## 5G subband2 Tx power limit CFG +txpwrlimit_5g_cfg_set_sub1={ + CmdCode=0x00fb # do NOT change this line + Action:2=1 # 1 - SET + SubBand:2=0 # do NOT use this member in set cmd + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=100 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=104 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=108 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=112 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=116 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=120 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=124 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=128 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=132 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=136 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=140 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=144 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + +} + + +## 5G subband3 Tx power limit CFG +txpwrlimit_5g_cfg_set_sub2={ + CmdCode=0x00fb # do NOT change this line + Action:2=1 # 1 - SET + SubBand:2=0 # do NOT use this member in set cmd + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=149 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=153 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=157 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=161 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=165 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } +} + + +## 5G subband4 Tx power limit CFG +txpwrlimit_5g_cfg_set_sub3={ + CmdCode=0x00fb # do NOT change this line + Action:2=1 # 1 - SET + SubBand:2=0 # do NOT use this in set cmd + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=4000 + TLVChanWidth:1=20 + TLVChanNum:1=183 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=4000 + TLVChanWidth:1=20 + TLVChanNum:1=184 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=4000 + TLVChanWidth:1=20 + TLVChanNum:1=185 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=4000 + TLVChanWidth:1=20 + TLVChanNum:1=187 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=4000 + TLVChanWidth:1=20 + TLVChanNum:1=188 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=4000 + TLVChanWidth:1=20 + TLVChanNum:1=189 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=4000 + TLVChanWidth:1=20 + TLVChanNum:1=192 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=4000 + TLVChanWidth:1=20 + TLVChanNum:1=196 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=7 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=8 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=11 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=12 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=16 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } + + + ChanTRPC.TlvType:2=0x0189 + ChanTRPC.TlvLength:2={ + TLVStartFreq:2=5000 + TLVChanWidth:1=20 + TLVChanNum:1=34 + TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10' + } +} diff --git a/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/wifi_mod_para.conf b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/wifi_mod_para.conf new file mode 100644 index 0000000000000000000000000000000000000000..96179f95d9926b16ef6a77210b1148225cc9c7b8 --- /dev/null +++ b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware/firmware/nxp/wifi_mod_para.conf @@ -0,0 +1,184 @@ +# Not matter how many spaces or tabs are inserted in a line, +# components and ending format must be exactly same as given +# example: +# +# [_] = { +# key=value +# } +# +# card_type : 8XXX (mandatory) +# block_id : configuration block id (optional ) +# key : module parameter name +# value : value for module parameter +# for string value, no need to add "" +# +# card_type supported: 8887/8897/8997/8977/8987/9098 +# block_id: support same chipset with +# different module parameter. +# For example to support mutiple SD8997 cards, usr can +# specify the configuration block id number [0 - 9], if not +# specified, it is taken as 0 by default. +# +# debug related module parameters could not be set via module +# configure file, ex. drvdbg could not be set in this file +# +# line started with "#" will be ignored +# refer to the USB8997_1 for parameters that could be set in +# this configuration file, and set the corresponding value +# according to your real needs + +SD8997 = { + cfg80211_wext=0xf + wfd_name=p2p + max_vir_bss=1 + cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf + drv_mode=7 +} + +#SD8997_1 = { +# cfg80211_wext=0xf +# wfd_name=wfd0 +# max_vir_bss=1 +# cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf +# drv_mode=5 +#} + +#SD8887 = { +# cfg80211_wext=0xf +# wfd_name=p2p +# max_vir_bss=1 +# cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf +# drv_mode=7 +#} + +#SD8897 = { +# cfg80211_wext=0xf +# wfd_name=p2p +# max_vir_bss=1 +# cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf +# drv_mode=7 +#} + +#SD8977 = { +# cfg80211_wext=0xf +# wfd_name=p2p +# max_vir_bss=1 +# cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf +# drv_mode=7 +#} + +SD8987 = { + cfg80211_wext=0xf + wfd_name=p2p + max_vir_bss=1 + cal_data_cfg=none + drv_mode=7 + ps_mode=2 + auto_ds=2 + fw_name=nxp/sdiouart8987_combo_v0.bin +} + +USB8997 = { + cfg80211_wext=0xf + wfd_name=p2p + max_vir_bss=1 + cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf + drv_mode=7 +} + +PCIE8997 = { + cfg80211_wext=0xf + wfd_name=p2p + max_vir_bss=1 + cal_data_cfg=none + drv_mode=7 + ps_mode=2 + auto_ds=2 + fw_name=nxp/pcieuart8997_combo_v4.bin +} + +PCIE9098_0 = { + cfg80211_wext=0xf + wfd_name=p2p + max_vir_bss=1 + cal_data_cfg=none + drv_mode=7 + mac_addr=00:50:43:20:12:34 +} + +PCIE9098_1 = { + cfg80211_wext=0xf + wfd_name=p2p + max_vir_bss=1 + cal_data_cfg=none + drv_mode=7 + mac_addr=00:50:43:20:52:56 +} + +#USB8997 = { +# hw_test=0 +# fw_name="nxp/usbusb8997_combo_v4.bin" +# req_fw_nowait=1 +# fw_reload=3 +# fw_serial=1 +# mac_addr=00:50:43:22:1e:3d +# mfg_mode=0 +# drv_mode=0x5 +# max_sta_bss=1 +# sta_name=wlan +# max_uap_bss=1 +# uap_name=uap +# wfd_name=p2p +# max_vir_bss=1 +# max_mpl_bss=1 +# nan_name=nan +# max_nan_bss=1 +# max_11p_bss=1 +# auto_ds=0 +# ps_mode=1 +# max_tx_buf=4096 +# intmode=0 +# gpiopin=0 +# pm_keep_power=0 +# shutdown_hs=1 +# cfg_11d=1 +# start_11ai_scan=0 +# oob_mode=0 +# sdio_pd=1 +# cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf +# txpwrtlimit_cfg=nxp/txpwr_limit.conf +# cntry_txpwrt=0 +# init_hostcmd_cfg=nxp/init_hostcmd_cfg.conf +# minicard_pwrup=0 +# cfg80211_wext=0xf +# skip_fwdnld=0 +# wq_sched_prio=0 +# wq_sched_policy=0 +# rx_work=1 +# aggrctrl=1 +# usb_aggr=1 +# pcie_int_mode=1 +# low_power_mode_enable=1 +# wakelock_timeout=10 +# dev_cap_mask=0xffffffff +# sdio_rx_aggr=1 +# pmic=1 +# antcfg=0 +# uap_oper_ctrl=0 +# hs_wake_interval=400 +# indication_gpio=0xff +# disconnect_on_suspend=0 +# hs_mimo_switch=1 +# indrstcfg=0xffffffff +# fixed_beacon_buffer=0 +# GoAgeoutTime=0 +# gtk_rekey_offload=1 +# multi_dtim=0 +# inact_tmo=0 +# usb_fw_option=1 +# napi=1 +# dfs_offload=1 +# cfg80211_drcs=1 +# drcs_chantime_mode=0 +# reg_alpha2=US +#} diff --git a/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware_v1.0.bb b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware_v1.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..350db5d4835ea903ae2c19b3ee2873809153798e --- /dev/null +++ b/bsp/meta-rockchip/recipes-connectivity/wifi_firmware/wififirmware_v1.0.bb @@ -0,0 +1,14 @@ +SUMMARY = "add wifi firmware to /lib" +DESCRIPTION = "wifi_firmware" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +PR = "r0" +SRC_URI = "file://firmware/nxp" + +FILES_${PN} += "/lib/firmware/nxp" +inherit allarch + +do_install() { + install -d ${D}/lib/firmware/nxp + install -m 0755 ${WORKDIR}/firmware/nxp/* ${D}/lib/firmware/nxp/ +} diff --git a/bsp/meta-rockchip/recipes-core/images/ok3568.inc b/bsp/meta-rockchip/recipes-core/images/ok3568.inc new file mode 100644 index 0000000000000000000000000000000000000000..dc85c83ebd92951bdbbe88bd8732ec4cf13c443c --- /dev/null +++ b/bsp/meta-rockchip/recipes-core/images/ok3568.inc @@ -0,0 +1 @@ +require rk3568.inc diff --git a/bsp/meta-rockchip/recipes-core/images/openeuler-image-tiny.bbappend b/bsp/meta-rockchip/recipes-core/images/openeuler-image-tiny.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bc4dcfe5823d7265a82c27f8849e2bba64e9074a --- /dev/null +++ b/bsp/meta-rockchip/recipes-core/images/openeuler-image-tiny.bbappend @@ -0,0 +1 @@ +do_rootfs[depends] = "opkg-utils-native:do_populate_sysroot" diff --git a/bsp/meta-rockchip/recipes-core/images/openeuler-image.bbappend b/bsp/meta-rockchip/recipes-core/images/openeuler-image.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bc4dcfe5823d7265a82c27f8849e2bba64e9074a --- /dev/null +++ b/bsp/meta-rockchip/recipes-core/images/openeuler-image.bbappend @@ -0,0 +1 @@ +do_rootfs[depends] = "opkg-utils-native:do_populate_sysroot" diff --git a/bsp/meta-rockchip/recipes-core/images/rk3568.inc b/bsp/meta-rockchip/recipes-core/images/rk3568.inc new file mode 100644 index 0000000000000000000000000000000000000000..aa5ba40077f0b631cad7c36a18c191f36ebde0cd --- /dev/null +++ b/bsp/meta-rockchip/recipes-core/images/rk3568.inc @@ -0,0 +1,28 @@ +IMAGE_FSTYPES = "ext4" +IMAGE_FSTYPES_remove = "iso" +IMAGE_FSTYPES_DEBUGFS = "ext4" +INITRAMFS_MAXSIZE = "476591" + +delete_unneeded_from_rootfs() { + set -x + test -d "${OUTPUT_DIR}" || mkdir -p "${OUTPUT_DIR}" + rm -rf "${OUTPUT_DIR}"/* + cd "${IMAGE_ROOTFS}" + cp -r boot/* "${OUTPUT_DIR}" + # just need the boot dir, others in boot are not needed to reduce the size of image. + rm -rf ./boot/* + cd - + set +x +} +IMAGE_PREPROCESS_COMMAND += "delete_unneeded_from_rootfs;" + +copy_rk3568_distro() { + set -x + for IMAGETYPE in ${IMAGE_FSTYPES} + do + rm -f "${OUTPUT_DIR}"/${IMAGE_NAME}${IMAGE_NAME_SUFFIX%.rootfs}.*${IMAGETYPE} + cp -fp ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX%.rootfs}.*${IMAGETYPE} ${OUTPUT_DIR}/ + done + set +x +} +IMAGE_POSTPROCESS_COMMAND += "copy_rk3568_distro;" diff --git a/bsp/meta-rockchip/recipes-core/images/ryd-3568.inc b/bsp/meta-rockchip/recipes-core/images/ryd-3568.inc new file mode 100644 index 0000000000000000000000000000000000000000..dc85c83ebd92951bdbbe88bd8732ec4cf13c443c --- /dev/null +++ b/bsp/meta-rockchip/recipes-core/images/ryd-3568.inc @@ -0,0 +1 @@ +require rk3568.inc diff --git a/bsp/meta-rockchip/recipes-core/packagegroups/packagegroup-base.bbappend b/bsp/meta-rockchip/recipes-core/packagegroups/packagegroup-base.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..dee9263e3200c5548a195e75bbb0a82e8196beeb --- /dev/null +++ b/bsp/meta-rockchip/recipes-core/packagegroups/packagegroup-base.bbappend @@ -0,0 +1,5 @@ +RDEPENDS_packagegroup-base_append += " \ +e2fsprogs-resize2fs \ +wpa-supplicant \ +wififirmware \ +" \ No newline at end of file diff --git a/bsp/meta-rockchip/recipes-core/packagegroups/packagegroup-core-boot.bbappend b/bsp/meta-rockchip/recipes-core/packagegroups/packagegroup-core-boot.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ca2717c60a72eccdec9fbb8f9144551a0cc85f0c --- /dev/null +++ b/bsp/meta-rockchip/recipes-core/packagegroups/packagegroup-core-boot.bbappend @@ -0,0 +1,4 @@ +# we add bootfile +RDEPENDS_${PN} += " \ + bootfile \ +" diff --git a/bsp/meta-rockchip/recipes-graphics/mesa/mesa_%.bbappend b/bsp/meta-rockchip/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..1880f9dfb66729b0f15dbf4c77b768cc45d6b8f2 --- /dev/null +++ b/bsp/meta-rockchip/recipes-graphics/mesa/mesa_%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG_append_rk3568 = " gallium vc4 v3d kmsro ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)}" diff --git a/bsp/meta-rockchip/recipes-kernel/linux/files/config/ok3568/defconfig-kernel b/bsp/meta-rockchip/recipes-kernel/linux/files/config/ok3568/defconfig-kernel new file mode 100644 index 0000000000000000000000000000000000000000..8b029d3fe1ebffde2b2db9bb85981fdd4241a7fa --- /dev/null +++ b/bsp/meta-rockchip/recipes-kernel/linux/files/config/ok3568/defconfig-kernel @@ -0,0 +1,6511 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/arm64 5.10.0 Kernel Configuration +# +CONFIG_CC_VERSION_TEXT="aarch64-openeuler-linux-gnu-gcc (crosstool-NG 1.25.0) 10.3.1" +CONFIG_CC_IS_GCC=y +CONFIG_GCC_VERSION=100301 +CONFIG_LD_VERSION=237000000 +CONFIG_CLANG_VERSION=0 +CONFIG_LLD_VERSION=0 +CONFIG_CC_CAN_LINK=y +CONFIG_CC_CAN_LINK_STATIC=y +CONFIG_CC_HAS_ASM_GOTO=y +CONFIG_CC_HAS_ASM_INLINE=y +CONFIG_IRQ_WORK=y +CONFIG_BUILDTIME_TABLE_SORT=y +CONFIG_THREAD_INFO_IN_TASK=y + +# +# General setup +# +CONFIG_INIT_ENV_ARG_LIMIT=32 +# CONFIG_COMPILE_TEST is not set +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_BUILD_SALT="" +CONFIG_DEFAULT_INIT="" +CONFIG_DEFAULT_HOSTNAME="localhost" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +# CONFIG_WATCH_QUEUE is not set +CONFIG_CROSS_MEMORY_ATTACH=y +# CONFIG_USELIB is not set +# CONFIG_AUDIT is not set +CONFIG_HAVE_ARCH_AUDITSYSCALL=y + +# +# IRQ subsystem +# +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_GENERIC_IRQ_IPI=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_IRQ_MSI_IOMMU=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_SPARSE_IRQ=y +# CONFIG_GENERIC_IRQ_DEBUGFS is not set +# end of IRQ subsystem + +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_ARCH_HAS_TICK_BROADCAST=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y + +# +# Timers subsystem +# +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ_COMMON=y +# CONFIG_HZ_PERIODIC is not set +CONFIG_NO_HZ_IDLE=y +# CONFIG_NO_HZ_FULL is not set +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +# end of Timers subsystem + +# CONFIG_PREEMPT_NONE is not set +# CONFIG_PREEMPT_VOLUNTARY is not set +CONFIG_PREEMPT=y + +# +# CPU/Task time and stats accounting +# +CONFIG_TICK_CPU_ACCOUNTING=y +# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set +# CONFIG_IRQ_TIME_ACCOUNTING is not set +CONFIG_SCHED_THERMAL_PRESSURE=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_PSI is not set +# end of CPU/Task time and stats accounting + +CONFIG_CPU_ISOLATION=y + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_RCU_EXPERT is not set +CONFIG_SRCU=y +CONFIG_TREE_SRCU=y +CONFIG_TASKS_RCU_GENERIC=y +CONFIG_TASKS_RUDE_RCU=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_RCU_NEED_SEGCBLIST=y +# end of RCU Subsystem + +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +# CONFIG_IKHEADERS is not set +CONFIG_LOG_BUF_SHIFT=18 +CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 +CONFIG_GENERIC_SCHED_CLOCK=y + +# +# Scheduler features +# +# CONFIG_UCLAMP_TASK is not set +# end of Scheduler features + +CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y +CONFIG_CC_HAS_INT128=y +CONFIG_ARCH_SUPPORTS_INT128=y +CONFIG_CGROUPS=y +# CONFIG_MEMCG is not set +# CONFIG_BLK_CGROUP is not set +CONFIG_CGROUP_SCHED=y +# CONFIG_QOS_SCHED is not set +# CONFIG_SCHED_PRIO_LB is not set +CONFIG_FAIR_GROUP_SCHED=y +CONFIG_CFS_BANDWIDTH=y +# CONFIG_RT_GROUP_SCHED is not set +# CONFIG_CGROUP_PIDS is not set +# CONFIG_CGROUP_RDMA is not set +CONFIG_CGROUP_FREEZER=y +CONFIG_CPUSETS=y +CONFIG_PROC_PID_CPUSET=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CGROUP_CPUACCT=y +# CONFIG_CGROUP_PERF is not set +# CONFIG_CGROUP_DEBUG is not set +# CONFIG_CGROUP_FILES is not set +CONFIG_NAMESPACES=y +CONFIG_UTS_NS=y +CONFIG_TIME_NS=y +CONFIG_IPC_NS=y +CONFIG_USER_NS=y +CONFIG_PID_NS=y +CONFIG_NET_NS=y +# CONFIG_SCHED_STEAL is not set +# CONFIG_CHECKPOINT_RESTORE is not set +# CONFIG_SCHED_AUTOGROUP is not set +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_RELAY=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_RD_GZIP=y +CONFIG_RD_BZIP2=y +CONFIG_RD_LZMA=y +CONFIG_RD_XZ=y +CONFIG_RD_LZO=y +CONFIG_RD_LZ4=y +CONFIG_RD_ZSTD=y +CONFIG_INITRAMFS_FILE_METADATA="" +# CONFIG_BOOT_CONFIG is not set +# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_LD_ORPHAN_WARN=y +CONFIG_SYSCTL=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_BPF=y +CONFIG_EXPERT=y +CONFIG_MULTIUSER=y +# CONFIG_SGETMASK_SYSCALL is not set +CONFIG_SYSFS_SYSCALL=y +CONFIG_FHANDLE=y +CONFIG_POSIX_TIMERS=y +CONFIG_PRINTK=y +CONFIG_PRINTK_NMI=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_FUTEX_PI=y +CONFIG_HAVE_FUTEX_CMPXCHG=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_IO_URING=y +CONFIG_ADVISE_SYSCALLS=y +CONFIG_MEMBARRIER=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +CONFIG_KALLSYMS_BASE_RELATIVE=y +# CONFIG_BPF_SYSCALL is not set +CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y +# CONFIG_USERFAULTFD is not set +CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y +CONFIG_KCMP=y +CONFIG_RSEQ=y +# CONFIG_DEBUG_RSEQ is not set +CONFIG_EMBEDDED=y +CONFIG_HAVE_PERF_EVENTS=y +# CONFIG_PC104 is not set + +# +# Kernel Performance Events And Counters +# +CONFIG_PERF_EVENTS=y +# CONFIG_DEBUG_PERF_USE_VMALLOC is not set +# end of Kernel Performance Events And Counters + +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_SLUB_DEBUG=y +# CONFIG_COMPAT_BRK is not set +# CONFIG_SLAB is not set +CONFIG_SLUB=y +# CONFIG_SLOB is not set +CONFIG_SLAB_MERGE_DEFAULT=y +# CONFIG_SLAB_FREELIST_RANDOM is not set +# CONFIG_SLAB_FREELIST_HARDENED is not set +# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set +CONFIG_SLUB_CPU_PARTIAL=y +CONFIG_SYSTEM_DATA_VERIFICATION=y +CONFIG_PROFILING=y +CONFIG_TRACEPOINTS=y +CONFIG_KABI_RESERVE=y +CONFIG_KABI_SIZE_ALIGN_CHECKS=y +# end of General setup + +CONFIG_ARM64=y +CONFIG_64BIT=y +CONFIG_MMU=y +CONFIG_ARM64_PAGE_SHIFT=12 +CONFIG_ARM64_CONT_PTE_SHIFT=4 +CONFIG_ARM64_CONT_PMD_SHIFT=4 +CONFIG_ARCH_MMAP_RND_BITS_MIN=18 +CONFIG_ARCH_MMAP_RND_BITS_MAX=24 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_ZONE_DMA=y +CONFIG_ZONE_DMA32=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y +CONFIG_SMP=y +CONFIG_KERNEL_MODE_NEON=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_PGTABLE_LEVELS=3 +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_PROC_KCORE_TEXT=y +CONFIG_ARCH_HAS_CPU_RELAX=y + +# +# Platform selection +# +# CONFIG_ARCH_ACTIONS is not set +# CONFIG_ARCH_AGILEX is not set +# CONFIG_ARCH_SUNXI is not set +# CONFIG_ARCH_ALPINE is not set +# CONFIG_ARCH_BCM2835 is not set +# CONFIG_ARCH_BCM_IPROC is not set +# CONFIG_ARCH_BERLIN is not set +# CONFIG_ARCH_BITMAIN is not set +# CONFIG_ARCH_BRCMSTB is not set +# CONFIG_ARCH_EXYNOS is not set +# CONFIG_ARCH_SPARX5 is not set +# CONFIG_ARCH_K3 is not set +# CONFIG_ARCH_LAYERSCAPE is not set +# CONFIG_ARCH_LG1K is not set +# CONFIG_ARCH_HISI is not set +# CONFIG_ARCH_KEEMBAY is not set +# CONFIG_ARCH_MEDIATEK is not set +# CONFIG_ARCH_MESON is not set +# CONFIG_ARCH_MVEBU is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_PHYTIUM is not set +# CONFIG_ARCH_QCOM is not set +# CONFIG_ARCH_REALTEK is not set +# CONFIG_ARCH_RENESAS is not set +CONFIG_ARCH_ROCKCHIP=y +# CONFIG_ARCH_S32 is not set +# CONFIG_ARCH_SEATTLE is not set +# CONFIG_ARCH_STRATIX10 is not set +# CONFIG_ARCH_SYNQUACER is not set +# CONFIG_ARCH_TEGRA is not set +# CONFIG_ARCH_SPRD is not set +# CONFIG_ARCH_THUNDER is not set +# CONFIG_ARCH_THUNDER2 is not set +# CONFIG_ARCH_UNIPHIER is not set +# CONFIG_ARCH_VEXPRESS is not set +# CONFIG_ARCH_VISCONTI is not set +# CONFIG_ARCH_XGENE is not set +# CONFIG_ARCH_ZX is not set +# CONFIG_ARCH_ZYNQMP is not set +# end of Platform selection + +CONFIG_HAVE_LIVEPATCH_WO_FTRACE=y + +# +# Enable Livepatch +# +# end of Enable Livepatch + +# +# Kernel Features +# + +# +# ARM errata workarounds via the alternatives framework +# +# CONFIG_ARM64_ERRATUM_826319 is not set +# CONFIG_ARM64_ERRATUM_827319 is not set +# CONFIG_ARM64_ERRATUM_824069 is not set +# CONFIG_ARM64_ERRATUM_819472 is not set +# CONFIG_ARM64_ERRATUM_832075 is not set +CONFIG_ARM64_ERRATUM_843419=y +CONFIG_ARM64_ERRATUM_1024718=y +CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y +CONFIG_ARM64_ERRATUM_1165522=y +CONFIG_ARM64_ERRATUM_1319367=y +CONFIG_ARM64_ERRATUM_1530923=y +CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y +CONFIG_ARM64_ERRATUM_1286807=y +CONFIG_ARM64_ERRATUM_1463225=y +CONFIG_ARM64_ERRATUM_1542419=y +CONFIG_ARM64_ERRATUM_1508412=y +# CONFIG_CAVIUM_ERRATUM_22375 is not set +# CONFIG_CAVIUM_ERRATUM_23154 is not set +CONFIG_CAVIUM_ERRATUM_27456=y +CONFIG_CAVIUM_ERRATUM_30115=y +CONFIG_CAVIUM_TX2_ERRATUM_219=y +CONFIG_FUJITSU_ERRATUM_010001=y +CONFIG_HISILICON_ERRATUM_161600802=y +# CONFIG_HISILICON_ERRATUM_1980005 is not set +CONFIG_QCOM_FALKOR_ERRATUM_1003=y +CONFIG_QCOM_FALKOR_ERRATUM_1009=y +CONFIG_QCOM_QDF2400_ERRATUM_0065=y +CONFIG_QCOM_FALKOR_ERRATUM_E1041=y +CONFIG_SOCIONEXT_SYNQUACER_PREITS=y +CONFIG_HISILICON_ERRATUM_HIP08_RU_PREFETCH=y +# CONFIG_HISILICON_HIP08_RU_PREFETCH_DEFAULT_OFF is not set +# end of ARM errata workarounds via the alternatives framework + +CONFIG_ARM64_4K_PAGES=y +# CONFIG_ARM64_16K_PAGES is not set +# CONFIG_ARM64_64K_PAGES is not set +CONFIG_ARM64_VA_BITS_39=y +# CONFIG_ARM64_VA_BITS_48 is not set +CONFIG_ARM64_VA_BITS=39 +CONFIG_ARM64_PA_BITS_48=y +CONFIG_ARM64_PA_BITS=48 +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SCHED_MC=y +# CONFIG_SCHED_CLUSTER is not set +# CONFIG_SCHED_SMT is not set +CONFIG_NR_CPUS=8 +CONFIG_HOTPLUG_CPU=y +# CONFIG_ARM64_BOOTPARAM_HOTPLUG_CPU0 is not set +# CONFIG_NUMA is not set +# CONFIG_HZ_100 is not set +# CONFIG_HZ_250 is not set +CONFIG_HZ_300=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=300 +CONFIG_SCHED_HRTICK=y +CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SPARSEMEM_DEFAULT=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HW_PERF_EVENTS=y +CONFIG_SYS_SUPPORTS_HUGETLBFS=y +CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y +CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y +CONFIG_ARCH_LLC_128_LINE_SIZE=y +CONFIG_ARCH_HAS_FILTER_PGPROT=y +CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y +# CONFIG_PARAVIRT is not set +# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set +# CONFIG_KEXEC is not set +# CONFIG_KEXEC_FILE is not set +# CONFIG_CRASH_DUMP is not set +# CONFIG_XEN is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_UNMAP_KERNEL_AT_EL0=y +CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y +CONFIG_RODATA_FULL_DEFAULT_ENABLED=y +# CONFIG_ARM64_PMEM_LEGACY is not set +# CONFIG_ARM64_SW_TTBR0_PAN is not set +CONFIG_ARM64_TAGGED_ADDR_ABI=y +# CONFIG_AARCH32_EL0 is not set + +# +# ARMv8.1 architectural features +# +CONFIG_ARM64_HW_AFDBM=y +CONFIG_ARM64_PAN=y +CONFIG_AS_HAS_LSE_ATOMICS=y +CONFIG_ARM64_VHE=y +# end of ARMv8.1 architectural features + +# +# ARMv8.2 architectural features +# +# CONFIG_ARM64_PMEM is not set +CONFIG_ARM64_RAS_EXTN=y +CONFIG_ARM64_CNP=y +# end of ARMv8.2 architectural features + +# +# ARMv8.3 architectural features +# +CONFIG_ARM64_PTR_AUTH=y +CONFIG_CC_HAS_BRANCH_PROT_PAC_RET=y +CONFIG_CC_HAS_SIGN_RETURN_ADDRESS=y +CONFIG_AS_HAS_PAC=y +CONFIG_AS_HAS_CFI_NEGATE_RA_STATE=y +# end of ARMv8.3 architectural features + +# +# ARMv8.4 architectural features +# +CONFIG_ARM64_AMU_EXTN=y +CONFIG_AS_HAS_ARMV8_4=y +CONFIG_ARM64_TLB_RANGE=y +# end of ARMv8.4 architectural features + +# +# ARMv8.5 architectural features +# +CONFIG_ARM64_BTI=y +CONFIG_ARM64_BTI_KERNEL=y +CONFIG_CC_HAS_BRANCH_PROT_PAC_RET_BTI=y +CONFIG_ARM64_E0PD=y +CONFIG_ARCH_RANDOM=y +CONFIG_ARM64_AS_HAS_MTE=y +CONFIG_ARM64_MTE=y +# end of ARMv8.5 architectural features + +# +# ARMv8.6 architectural features +# +CONFIG_ARM64_TWED=y +# end of ARMv8.6 architectural features + +# +# ARMv8.7 architectural features +# +CONFIG_ARM64_EPAN=y +# end of ARMv8.7 architectural features + +CONFIG_ARM64_SVE=y +CONFIG_ARM64_SME=y +CONFIG_ARM64_MODULE_PLTS=y +# CONFIG_ARM64_PSEUDO_NMI is not set +CONFIG_RELOCATABLE=y +# CONFIG_RANDOMIZE_BASE is not set +CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y +CONFIG_STACKPROTECTOR_PER_TASK=y +# CONFIG_ASCEND_FEATURES is not set +# end of Kernel Features + +# +# Boot options +# +CONFIG_CMDLINE="" +# CONFIG_EFI is not set +# end of Boot options + +# +# Power management options +# +CONFIG_SUSPEND=y +CONFIG_SUSPEND_FREEZER=y +# CONFIG_SUSPEND_SKIP_SYNC is not set +# CONFIG_HIBERNATION is not set +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_SMP=y +# CONFIG_PM_AUTOSLEEP is not set +# CONFIG_PM_WAKELOCKS is not set +CONFIG_PM=y +CONFIG_PM_DEBUG=y +CONFIG_PM_ADVANCED_DEBUG=y +# CONFIG_PM_TEST_SUSPEND is not set +CONFIG_PM_SLEEP_DEBUG=y +# CONFIG_DPM_WATCHDOG is not set +CONFIG_PM_CLK=y +CONFIG_PM_GENERIC_DOMAINS=y +CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y +CONFIG_PM_GENERIC_DOMAINS_SLEEP=y +CONFIG_PM_GENERIC_DOMAINS_OF=y +CONFIG_CPU_PM=y +CONFIG_ENERGY_MODEL=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# end of Power management options + +# +# CPU Power Management +# + +# +# CPU Idle +# +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y +# CONFIG_CPU_IDLE_GOV_LADDER is not set +CONFIG_CPU_IDLE_GOV_MENU=y +# CONFIG_CPU_IDLE_GOV_TEO is not set +# CONFIG_CPU_IDLE_GOV_HALTPOLL is not set +CONFIG_DT_IDLE_STATES=y + +# +# ARM CPU Idle Drivers +# +CONFIG_ARM_CPUIDLE=y +# CONFIG_ARM_PSCI_CPUIDLE is not set +# end of ARM CPU Idle Drivers + +CONFIG_HALTPOLL_CPUIDLE=y +# end of CPU Idle + +# +# CPU Frequency scaling +# +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +# CONFIG_CPU_FREQ_STAT is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y + +# +# CPU frequency scaling drivers +# +CONFIG_CPUFREQ_DT=y +CONFIG_CPUFREQ_DT_PLATDEV=y +# CONFIG_ARM_SCMI_CPUFREQ is not set +# end of CPU Frequency scaling +# end of CPU Power Management + +# +# Firmware Drivers +# +CONFIG_ARM_SCMI_PROTOCOL=y +CONFIG_ARM_SCMI_POWER_DOMAIN=y +# CONFIG_ARM_SCPI_PROTOCOL is not set +# CONFIG_ARM_SDE_INTERFACE is not set +# CONFIG_FIRMWARE_MEMMAP is not set +# CONFIG_FW_CFG_SYSFS is not set +CONFIG_ROCKCHIP_SIP=y +# CONFIG_GOOGLE_FIRMWARE is not set +CONFIG_ARM_PSCI_FW=y +# CONFIG_ARM_PSCI_CHECKER is not set +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_ARM_SMCCC_DISCOVERY=y +CONFIG_ARM_SMCCC_SOC_ID=y + +# +# Tegra firmware driver +# +# end of Tegra firmware driver +# end of Firmware Drivers + +# CONFIG_VIRTUALIZATION is not set +CONFIG_ARM64_CRYPTO=y +CONFIG_CRYPTO_SHA256_ARM64=y +# CONFIG_CRYPTO_SHA512_ARM64 is not set +CONFIG_CRYPTO_SHA1_ARM64_CE=y +CONFIG_CRYPTO_SHA2_ARM64_CE=y +# CONFIG_CRYPTO_SHA512_ARM64_CE is not set +# CONFIG_CRYPTO_SHA3_ARM64 is not set +# CONFIG_CRYPTO_SM3_ARM64_CE is not set +# CONFIG_CRYPTO_SM4_ARM64_CE is not set +# CONFIG_CRYPTO_SM4_ARM64_CE_BLK is not set +# CONFIG_CRYPTO_SM4_ARM64_NEON_BLK is not set +CONFIG_CRYPTO_GHASH_ARM64_CE=y +# CONFIG_CRYPTO_CRCT10DIF_ARM64_CE is not set +CONFIG_CRYPTO_AES_ARM64=y +CONFIG_CRYPTO_AES_ARM64_CE=y +CONFIG_CRYPTO_AES_ARM64_CE_CCM=y +CONFIG_CRYPTO_AES_ARM64_CE_BLK=y +# CONFIG_CRYPTO_AES_ARM64_NEON_BLK is not set +# CONFIG_CRYPTO_CHACHA20_NEON is not set +# CONFIG_CRYPTO_POLY1305_NEON is not set +# CONFIG_CRYPTO_NHPOLY1305_NEON is not set +# CONFIG_CRYPTO_AES_ARM64_BS is not set + +# +# General architecture-dependent options +# +# CONFIG_KPROBES is not set +# CONFIG_JUMP_LABEL is not set +CONFIG_UPROBES=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y +CONFIG_HAVE_NMI=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y +CONFIG_ARCH_HAS_KEEPINITRD=y +CONFIG_ARCH_HAS_SET_MEMORY=y +CONFIG_ARCH_HAS_SET_DIRECT_MAP=y +CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y +# CONFIG_HAVE_ASM_MODVERSIONS is not set +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_RSEQ=y +CONFIG_HAVE_RUST=y +CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y +CONFIG_HAVE_HW_BREAKPOINT=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y +CONFIG_MMU_GATHER_TABLE_FREE=y +CONFIG_MMU_GATHER_RCU_TABLE_FREE=y +CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y +CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y +CONFIG_HAVE_CMPXCHG_LOCAL=y +CONFIG_HAVE_CMPXCHG_DOUBLE=y +CONFIG_HAVE_ARCH_SECCOMP=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_SECCOMP=y +CONFIG_SECCOMP_FILTER=y +# CONFIG_SECCOMP_CACHE_DEBUG is not set +CONFIG_HAVE_ARCH_STACKLEAK=y +CONFIG_HAVE_STACKPROTECTOR=y +CONFIG_STACKPROTECTOR=y +CONFIG_STACKPROTECTOR_STRONG=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_MOVE_PUD=y +CONFIG_HAVE_MOVE_PMD=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y +CONFIG_HAVE_ARCH_HUGE_VMAP=y +CONFIG_HAVE_ARCH_HUGE_VMALLOC=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_MODULES_USE_ELF_RELA=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_HAVE_ARCH_MMAP_RND_BITS=y +CONFIG_ARCH_MMAP_RND_BITS=18 +CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y +CONFIG_CLONE_BACKWARDS=y +# CONFIG_COMPAT_32BIT_TIME is not set +CONFIG_HAVE_ARCH_VMAP_STACK=y +CONFIG_VMAP_STACK=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +CONFIG_STRICT_KERNEL_RWX=y +CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y +CONFIG_STRICT_MODULE_RWX=y +CONFIG_HAVE_ARCH_COMPILER_H=y +CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y +# CONFIG_LOCK_EVENT_COUNTS is not set +CONFIG_ARCH_HAS_RELR=y +CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y +CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y + +# +# GCOV-based kernel profiling +# +# CONFIG_GCOV_KERNEL is not set +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +# end of GCOV-based kernel profiling + +CONFIG_HAVE_GCC_PLUGINS=y +CONFIG_GCC_PLUGINS=y +# CONFIG_GCC_PLUGIN_CYC_COMPLEXITY is not set +# CONFIG_GCC_PLUGIN_LATENT_ENTROPY is not set +# CONFIG_GCC_PLUGIN_RANDSTRUCT is not set +# end of General architecture-dependent options + +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +CONFIG_MODULE_FORCE_LOAD=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +# CONFIG_MODULE_SIG is not set +# CONFIG_MODULE_COMPRESS is not set +# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_TRIM_UNUSED_KSYMS is not set +CONFIG_MODULES_TREE_LOOKUP=y +CONFIG_BLOCK=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_BLK_DEV_BSG=y +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_INTEGRITY is not set +# CONFIG_BLK_DEV_ZONED is not set +# CONFIG_BLK_CMDLINE_PARSER is not set +# CONFIG_BLK_WBT is not set +CONFIG_BLK_DEBUG_FS=y +# CONFIG_BLK_SED_OPAL is not set +# CONFIG_BLK_INLINE_ENCRYPTION is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_AIX_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_KARMA_PARTITION is not set +CONFIG_EFI_PARTITION=y +# CONFIG_SYSV68_PARTITION is not set +# CONFIG_CMDLINE_PARTITION is not set +# end of Partition Types + +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_PM=y + +# +# IO Schedulers +# +CONFIG_MQ_IOSCHED_DEADLINE=y +CONFIG_MQ_IOSCHED_KYBER=y +# CONFIG_IOSCHED_BFQ is not set +# end of IO Schedulers + +CONFIG_ASN1=y +CONFIG_ARCH_INLINE_SPIN_TRYLOCK=y +CONFIG_ARCH_INLINE_SPIN_TRYLOCK_BH=y +CONFIG_ARCH_INLINE_SPIN_LOCK=y +CONFIG_ARCH_INLINE_SPIN_LOCK_BH=y +CONFIG_ARCH_INLINE_SPIN_LOCK_IRQ=y +CONFIG_ARCH_INLINE_SPIN_LOCK_IRQSAVE=y +CONFIG_ARCH_INLINE_SPIN_UNLOCK=y +CONFIG_ARCH_INLINE_SPIN_UNLOCK_BH=y +CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQ=y +CONFIG_ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE=y +CONFIG_ARCH_INLINE_READ_LOCK=y +CONFIG_ARCH_INLINE_READ_LOCK_BH=y +CONFIG_ARCH_INLINE_READ_LOCK_IRQ=y +CONFIG_ARCH_INLINE_READ_LOCK_IRQSAVE=y +CONFIG_ARCH_INLINE_READ_UNLOCK=y +CONFIG_ARCH_INLINE_READ_UNLOCK_BH=y +CONFIG_ARCH_INLINE_READ_UNLOCK_IRQ=y +CONFIG_ARCH_INLINE_READ_UNLOCK_IRQRESTORE=y +CONFIG_ARCH_INLINE_WRITE_LOCK=y +CONFIG_ARCH_INLINE_WRITE_LOCK_BH=y +CONFIG_ARCH_INLINE_WRITE_LOCK_IRQ=y +CONFIG_ARCH_INLINE_WRITE_LOCK_IRQSAVE=y +CONFIG_ARCH_INLINE_WRITE_UNLOCK=y +CONFIG_ARCH_INLINE_WRITE_UNLOCK_BH=y +CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQ=y +CONFIG_ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE=y +CONFIG_UNINLINE_SPIN_UNLOCK=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_ARCH_USE_QUEUED_RWLOCKS=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y +CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y +CONFIG_FREEZER=y + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_HAVE_ELF_PROT=y +CONFIG_ARCH_USE_GNU_PROPERTY=y +CONFIG_ELFCORE=y +CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y +CONFIG_BINFMT_SCRIPT=y +# CONFIG_BINFMT_MISC is not set +CONFIG_COREDUMP=y +# end of Executable file formats + +# +# Memory Management options +# +CONFIG_SELECT_MEMORY_MODEL=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_HAVE_FAST_GUP=y +CONFIG_HOLES_IN_ZONE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_MEMORY_ISOLATION=y +# CONFIG_MEMORY_HOTPLUG is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_COMPACTION is not set +# CONFIG_PAGE_REPORTING is not set +CONFIG_MIGRATION=y +# CONFIG_HUGE_VMALLOC_DEFAULT_ENABLED is not set +CONFIG_CONTIG_ALLOC=y +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_BOUNCE=y +# CONFIG_KSM is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 +CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y +# CONFIG_MEMORY_FAILURE is not set +# CONFIG_TRANSPARENT_HUGEPAGE is not set +# CONFIG_CLEANCACHE is not set +# CONFIG_FRONTSWAP is not set +# CONFIG_ETMEM_SCAN is not set +# CONFIG_ETMEM_SWAP is not set +# CONFIG_PAGE_CACHE_LIMIT is not set +CONFIG_CMA=y +# CONFIG_CMA_DEBUG is not set +# CONFIG_CMA_DEBUGFS is not set +CONFIG_CMA_AREAS=7 +# CONFIG_ZPOOL is not set +# CONFIG_ZBUD is not set +CONFIG_ZSMALLOC=y +# CONFIG_ZSMALLOC_STAT is not set +CONFIG_GENERIC_EARLY_IOREMAP=y +# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set +# CONFIG_IDLE_PAGE_TRACKING is not set +CONFIG_ARCH_HAS_PTE_DEVMAP=y +CONFIG_FRAME_VECTOR=y +CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y +# CONFIG_PERCPU_STATS is not set +# CONFIG_GUP_BENCHMARK is not set +CONFIG_ARCH_HAS_PTE_SPECIAL=y +# CONFIG_PIN_MEMORY is not set +# CONFIG_CLEAR_FREELIST_PAGE is not set + +# +# Data Access Monitoring +# +# CONFIG_DAMON is not set +# end of Data Access Monitoring +# end of Memory Management options + +CONFIG_NET=y +CONFIG_NET_INGRESS=y +CONFIG_SKB_EXTENSIONS=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_DIAG is not set +CONFIG_UNIX=y +CONFIG_UNIX_SCM=y +# CONFIG_UNIX_DIAG is not set +# CONFIG_TLS is not set +CONFIG_XFRM=y +CONFIG_XFRM_ALGO=y +CONFIG_XFRM_USER=y +# CONFIG_XFRM_INTERFACE is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +CONFIG_NET_KEY=y +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +# CONFIG_IP_FIB_TRIE_STATS is not set +# CONFIG_IP_MULTIPLE_TABLES is not set +# CONFIG_IP_ROUTE_MULTIPATH is not set +# CONFIG_IP_ROUTE_VERBOSE is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE_DEMUX is not set +CONFIG_IP_MROUTE_COMMON=y +CONFIG_IP_MROUTE=y +# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set +# CONFIG_IP_PIMSM_V1 is not set +# CONFIG_IP_PIMSM_V2 is not set +CONFIG_SYN_COOKIES=y +# CONFIG_NET_IPVTI is not set +# CONFIG_NET_FOU is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_DIAG is not set +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +# CONFIG_TCP_COMP is not set +CONFIG_IPV6=y +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +# CONFIG_INET6_AH is not set +# CONFIG_INET6_ESP is not set +# CONFIG_INET6_IPCOMP is not set +# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_ILA is not set +# CONFIG_IPV6_VTI is not set +# CONFIG_IPV6_SIT is not set +# CONFIG_IPV6_TUNNEL is not set +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_IPV6_MROUTE is not set +# CONFIG_IPV6_SEG6_LWTUNNEL is not set +# CONFIG_IPV6_SEG6_HMAC is not set +# CONFIG_IPV6_RPL_LWTUNNEL is not set +# CONFIG_MPTCP is not set +# CONFIG_NETWORK_SECMARK is not set +CONFIG_NET_PTP_CLASSIFY=y +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +CONFIG_NETFILTER=y +CONFIG_NETFILTER_ADVANCED=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_INGRESS=y +# CONFIG_NETFILTER_NETLINK_ACCT is not set +# CONFIG_NETFILTER_NETLINK_QUEUE is not set +# CONFIG_NETFILTER_NETLINK_LOG is not set +# CONFIG_NETFILTER_NETLINK_OSF is not set +CONFIG_NF_CONNTRACK=y +# CONFIG_NF_LOG_NETDEV is not set +# CONFIG_NF_CONNTRACK_MARK is not set +# CONFIG_NF_CONNTRACK_ZONES is not set +CONFIG_NF_CONNTRACK_PROCFS=y +# CONFIG_NF_CONNTRACK_EVENTS is not set +# CONFIG_NF_CONNTRACK_TIMEOUT is not set +# CONFIG_NF_CONNTRACK_TIMESTAMP is not set +# CONFIG_NF_CONNTRACK_LABELS is not set +CONFIG_NF_CT_PROTO_DCCP=y +CONFIG_NF_CT_PROTO_SCTP=y +CONFIG_NF_CT_PROTO_UDPLITE=y +# CONFIG_NF_CONNTRACK_AMANDA is not set +# CONFIG_NF_CONNTRACK_FTP is not set +# CONFIG_NF_CONNTRACK_H323 is not set +# CONFIG_NF_CONNTRACK_IRC is not set +# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set +# CONFIG_NF_CONNTRACK_SNMP is not set +# CONFIG_NF_CONNTRACK_PPTP is not set +# CONFIG_NF_CONNTRACK_SANE is not set +# CONFIG_NF_CONNTRACK_SIP is not set +# CONFIG_NF_CONNTRACK_TFTP is not set +# CONFIG_NF_CT_NETLINK is not set +CONFIG_NF_NAT=y +CONFIG_NF_NAT_REDIRECT=y +CONFIG_NF_NAT_MASQUERADE=y +# CONFIG_NF_TABLES is not set +CONFIG_NETFILTER_XTABLES=y + +# +# Xtables combined modules +# +# CONFIG_NETFILTER_XT_MARK is not set +# CONFIG_NETFILTER_XT_CONNMARK is not set + +# +# Xtables targets +# +# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set +# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set +# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set +# CONFIG_NETFILTER_XT_TARGET_DSCP is not set +# CONFIG_NETFILTER_XT_TARGET_HL is not set +# CONFIG_NETFILTER_XT_TARGET_HMARK is not set +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +# CONFIG_NETFILTER_XT_TARGET_LED is not set +# CONFIG_NETFILTER_XT_TARGET_LOG is not set +# CONFIG_NETFILTER_XT_TARGET_MARK is not set +CONFIG_NETFILTER_XT_NAT=y +CONFIG_NETFILTER_XT_TARGET_NETMAP=y +# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set +# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set +# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set +CONFIG_NETFILTER_XT_TARGET_REDIRECT=y +CONFIG_NETFILTER_XT_TARGET_MASQUERADE=y +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +# CONFIG_NETFILTER_XT_TARGET_TPROXY is not set +# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set +# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set + +# +# Xtables matches +# +# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_BPF is not set +# CONFIG_NETFILTER_XT_MATCH_CGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set +# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set +# CONFIG_NETFILTER_XT_MATCH_CONNLABEL is not set +# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set +# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +# CONFIG_NETFILTER_XT_MATCH_DCCP is not set +# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set +# CONFIG_NETFILTER_XT_MATCH_ECN is not set +# CONFIG_NETFILTER_XT_MATCH_ESP is not set +# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_HELPER is not set +# CONFIG_NETFILTER_XT_MATCH_HL is not set +# CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set +# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set +# CONFIG_NETFILTER_XT_MATCH_L2TP is not set +# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set +# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_MAC is not set +# CONFIG_NETFILTER_XT_MATCH_MARK is not set +# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set +# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set +# CONFIG_NETFILTER_XT_MATCH_OSF is not set +# CONFIG_NETFILTER_XT_MATCH_OWNER is not set +# CONFIG_NETFILTER_XT_MATCH_POLICY is not set +# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set +# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set +# CONFIG_NETFILTER_XT_MATCH_REALM is not set +# CONFIG_NETFILTER_XT_MATCH_RECENT is not set +# CONFIG_NETFILTER_XT_MATCH_SCTP is not set +# CONFIG_NETFILTER_XT_MATCH_SOCKET is not set +# CONFIG_NETFILTER_XT_MATCH_STATE is not set +# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set +# CONFIG_NETFILTER_XT_MATCH_STRING is not set +# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set +# CONFIG_NETFILTER_XT_MATCH_TIME is not set +# CONFIG_NETFILTER_XT_MATCH_U32 is not set +# end of Core Netfilter Configuration + +# CONFIG_IP_SET is not set +# CONFIG_IP_VS is not set + +# +# IP: Netfilter Configuration +# +CONFIG_NF_DEFRAG_IPV4=y +# CONFIG_NF_SOCKET_IPV4 is not set +# CONFIG_NF_TPROXY_IPV4 is not set +# CONFIG_NF_DUP_IPV4 is not set +# CONFIG_NF_LOG_ARP is not set +# CONFIG_NF_LOG_IPV4 is not set +# CONFIG_NF_REJECT_IPV4 is not set +CONFIG_IP_NF_IPTABLES=y +# CONFIG_IP_NF_MATCH_AH is not set +# CONFIG_IP_NF_MATCH_ECN is not set +# CONFIG_IP_NF_MATCH_RPFILTER is not set +# CONFIG_IP_NF_MATCH_TTL is not set +CONFIG_IP_NF_FILTER=y +# CONFIG_IP_NF_TARGET_REJECT is not set +# CONFIG_IP_NF_TARGET_SYNPROXY is not set +CONFIG_IP_NF_NAT=y +CONFIG_IP_NF_TARGET_MASQUERADE=y +CONFIG_IP_NF_TARGET_NETMAP=y +CONFIG_IP_NF_TARGET_REDIRECT=y +CONFIG_IP_NF_MANGLE=y +# CONFIG_IP_NF_TARGET_CLUSTERIP is not set +# CONFIG_IP_NF_TARGET_ECN is not set +# CONFIG_IP_NF_TARGET_TTL is not set +# CONFIG_IP_NF_RAW is not set +# CONFIG_IP_NF_ARPTABLES is not set +# end of IP: Netfilter Configuration + +# +# IPv6: Netfilter Configuration +# +# CONFIG_NF_SOCKET_IPV6 is not set +# CONFIG_NF_TPROXY_IPV6 is not set +# CONFIG_NF_DUP_IPV6 is not set +# CONFIG_NF_REJECT_IPV6 is not set +# CONFIG_NF_LOG_IPV6 is not set +# CONFIG_IP6_NF_IPTABLES is not set +# end of IPv6: Netfilter Configuration + +CONFIG_NF_DEFRAG_IPV6=y +# CONFIG_NF_CONNTRACK_BRIDGE is not set +# CONFIG_BPFILTER is not set +# CONFIG_IP_DCCP is not set +# CONFIG_IP_SCTP is not set +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_L2TP is not set +# CONFIG_BRIDGE is not set +CONFIG_HAVE_NET_DSA=y +# CONFIG_NET_DSA is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_PHONET is not set +# CONFIG_6LOWPAN is not set +# CONFIG_IEEE802154 is not set +# CONFIG_NET_SCHED is not set +# CONFIG_DCB is not set +CONFIG_DNS_RESOLVER=y +# CONFIG_BATMAN_ADV is not set +# CONFIG_OPENVSWITCH is not set +# CONFIG_VSOCKETS is not set +# CONFIG_NETLINK_DIAG is not set +# CONFIG_MPLS is not set +# CONFIG_NET_NSH is not set +# CONFIG_HSR is not set +# CONFIG_NET_SWITCHDEV is not set +# CONFIG_NET_L3_MASTER_DEV is not set +# CONFIG_QRTR is not set +# CONFIG_NET_NCSI is not set +CONFIG_RPS=y +CONFIG_RFS_ACCEL=y +CONFIG_XPS=y +# CONFIG_CGROUP_NET_PRIO is not set +# CONFIG_CGROUP_NET_CLASSID is not set +CONFIG_NET_RX_BUSY_POLL=y +CONFIG_BQL=y +# CONFIG_BPF_JIT is not set +CONFIG_NET_FLOW_LIMIT=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_NET_DROP_MONITOR is not set +# end of Network testing +# end of Networking options + +# CONFIG_HAMRADIO is not set +CONFIG_CAN=y +CONFIG_CAN_RAW=y +CONFIG_CAN_BCM=y +CONFIG_CAN_GW=y +# CONFIG_CAN_J1939 is not set +# CONFIG_CAN_ISOTP is not set + +# +# CAN Device Drivers +# +# CONFIG_CAN_VCAN is not set +# CONFIG_CAN_VXCAN is not set +# CONFIG_CAN_SLCAN is not set +CONFIG_CAN_DEV=y +CONFIG_CAN_CALC_BITTIMING=y +# CONFIG_CAN_FLEXCAN is not set +# CONFIG_CAN_GRCAN is not set +# CONFIG_CAN_KVASER_PCIEFD is not set +# CONFIG_CAN_XILINXCAN is not set +# CONFIG_CAN_C_CAN is not set +# CONFIG_CAN_CC770 is not set +# CONFIG_CAN_IFI_CANFD is not set +# CONFIG_CAN_M_CAN is not set +# CONFIG_CAN_PEAK_PCIEFD is not set +# CONFIG_CAN_SJA1000 is not set +# CONFIG_CAN_SOFTING is not set + +# +# CAN SPI interfaces +# +# CONFIG_CAN_HI311X is not set +# CONFIG_CAN_MCP251X is not set +# CONFIG_CAN_MCP251XFD is not set +# end of CAN SPI interfaces + +# +# CAN USB interfaces +# +# CONFIG_CAN_8DEV_USB is not set +# CONFIG_CAN_EMS_USB is not set +# CONFIG_CAN_ESD_USB2 is not set +# CONFIG_CAN_GS_USB is not set +# CONFIG_CAN_KVASER_USB is not set +# CONFIG_CAN_MCBA_USB is not set +# CONFIG_CAN_PEAK_USB is not set +# CONFIG_CAN_UCAN is not set +# end of CAN USB interfaces + +# CONFIG_CAN_DEBUG_DEVICES is not set +# end of CAN Device Drivers + +CONFIG_BT=y +CONFIG_BT_BREDR=y +CONFIG_BT_RFCOMM=y +# CONFIG_BT_RFCOMM_TTY is not set +# CONFIG_BT_BNEP is not set +CONFIG_BT_HIDP=y +# CONFIG_BT_HS is not set +CONFIG_BT_LE=y +# CONFIG_BT_LEDS is not set +# CONFIG_BT_MSFTEXT is not set +CONFIG_BT_DEBUGFS=y +# CONFIG_BT_SELFTEST is not set + +# +# Bluetooth device drivers +# +CONFIG_BT_INTEL=y +CONFIG_BT_BCM=y +CONFIG_BT_RTL=y +CONFIG_BT_HCIBTUSB=y +# CONFIG_BT_HCIBTUSB_AUTOSUSPEND is not set +CONFIG_BT_HCIBTUSB_BCM=y +# CONFIG_BT_HCIBTUSB_MTK is not set +CONFIG_BT_HCIBTUSB_RTL=y +# CONFIG_BT_HCIBTSDIO is not set +CONFIG_BT_HCIUART=y +CONFIG_BT_HCIUART_H4=y +# CONFIG_BT_HCIUART_BCSP is not set +CONFIG_BT_HCIUART_ATH3K=y +# CONFIG_BT_HCIUART_INTEL is not set +# CONFIG_BT_HCIUART_AG6XX is not set +# CONFIG_BT_HCIBCM203X is not set +# CONFIG_BT_HCIBPA10X is not set +CONFIG_BT_HCIBFUSB=y +CONFIG_BT_HCIVHCI=y +CONFIG_BT_MRVL=y +CONFIG_BT_MRVL_SDIO=y +# CONFIG_BT_ATH3K is not set +# CONFIG_BT_MTKSDIO is not set +# end of Bluetooth device drivers + +# CONFIG_AF_RXRPC is not set +# CONFIG_AF_KCM is not set +CONFIG_WIRELESS=y +CONFIG_WIRELESS_EXT=y +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_PRIV=y +CONFIG_CFG80211=y +CONFIG_NL80211_TESTMODE=y +# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set +# CONFIG_CFG80211_CERTIFICATION_ONUS is not set +CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y +CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y +CONFIG_CFG80211_DEFAULT_PS=y +CONFIG_CFG80211_DEBUGFS=y +CONFIG_CFG80211_CRDA_SUPPORT=y +CONFIG_CFG80211_WEXT=y +CONFIG_MAC80211=y +CONFIG_MAC80211_HAS_RC=y +CONFIG_MAC80211_RC_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +# CONFIG_MAC80211_MESH is not set +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_DEBUGFS=y +# CONFIG_MAC80211_MESSAGE_TRACING is not set +CONFIG_MAC80211_DEBUG_MENU=y +# CONFIG_MAC80211_NOINLINE is not set +CONFIG_MAC80211_VERBOSE_DEBUG=y +# CONFIG_MAC80211_MLME_DEBUG is not set +# CONFIG_MAC80211_STA_DEBUG is not set +# CONFIG_MAC80211_HT_DEBUG is not set +# CONFIG_MAC80211_OCB_DEBUG is not set +# CONFIG_MAC80211_IBSS_DEBUG is not set +# CONFIG_MAC80211_PS_DEBUG is not set +# CONFIG_MAC80211_TDLS_DEBUG is not set +# CONFIG_MAC80211_DEBUG_COUNTERS is not set +CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 +# CONFIG_WIMAX is not set +CONFIG_RFKILL=y +CONFIG_RFKILL_LEDS=y +# CONFIG_RFKILL_INPUT is not set +# CONFIG_RFKILL_GPIO is not set +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +# CONFIG_CEPH_LIB is not set +# CONFIG_NFC is not set +# CONFIG_PSAMPLE is not set +# CONFIG_NET_IFE is not set +# CONFIG_LWTUNNEL is not set +CONFIG_GRO_CELLS=y +CONFIG_PAGE_POOL=y +# CONFIG_FAILOVER is not set +CONFIG_ETHTOOL_NETLINK=y +CONFIG_HAVE_EBPF_JIT=y + +# +# Device Drivers +# +CONFIG_ARM_AMBA=y +CONFIG_HAVE_PCI=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_SYSCALL=y +CONFIG_PCIEPORTBUS=y +# CONFIG_PCIEAER is not set +CONFIG_PCIEASPM=y +CONFIG_PCIEASPM_DEFAULT=y +# CONFIG_PCIEASPM_POWERSAVE is not set +# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set +# CONFIG_PCIEASPM_PERFORMANCE is not set +CONFIG_PCIE_PME=y +# CONFIG_PCIE_PTM is not set +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_PCI_QUIRKS=y +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCI_PRI is not set +# CONFIG_PCI_PASID is not set +# CONFIG_PCIE_BUS_TUNE_OFF is not set +CONFIG_PCIE_BUS_DEFAULT=y +# CONFIG_PCIE_BUS_SAFE is not set +# CONFIG_PCIE_BUS_PERFORMANCE is not set +# CONFIG_PCIE_BUS_PEER2PEER is not set +# CONFIG_HOTPLUG_PCI is not set + +# +# PCI controller drivers +# +# CONFIG_PCI_FTPCI100 is not set +# CONFIG_PCI_HOST_GENERIC is not set +# CONFIG_PCIE_XILINX is not set +# CONFIG_PCI_XGENE is not set +# CONFIG_PCIE_ALTERA is not set +# CONFIG_PCI_HOST_THUNDER_PEM is not set +# CONFIG_PCI_HOST_THUNDER_ECAM is not set +# CONFIG_PCIE_ROCKCHIP_HOST is not set + +# +# DesignWare PCI Core Support +# +# CONFIG_PCIE_DW_PLAT_HOST is not set +# CONFIG_PCI_HISI is not set +# CONFIG_PCIE_KIRIN is not set +# CONFIG_PCI_MESON is not set +# CONFIG_PCIE_AL is not set +# end of DesignWare PCI Core Support + +# +# Mobiveil PCIe Core Support +# +# CONFIG_PCIE_LAYERSCAPE_GEN4 is not set +# end of Mobiveil PCIe Core Support + +# +# Cadence PCIe controllers support +# +# CONFIG_PCIE_CADENCE_PLAT_HOST is not set +# CONFIG_PCI_J721E_HOST is not set +# end of Cadence PCIe controllers support +# end of PCI controller drivers + +# +# PCI Endpoint +# +# CONFIG_PCI_ENDPOINT is not set +# end of PCI Endpoint + +# +# PCI switch controller drivers +# +# CONFIG_PCI_SW_SWITCHTEC is not set +# end of PCI switch controller drivers + +# CONFIG_PCCARD is not set +# CONFIG_RAPIDIO is not set + +# +# Generic Driver Options +# +# CONFIG_UEVENT_HELPER is not set +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y + +# +# Firmware loader +# +CONFIG_FW_LOADER=y +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_FW_LOADER_USER_HELPER is not set +# CONFIG_FW_LOADER_COMPRESS is not set +CONFIG_FW_CACHE=y +# end of Firmware loader + +CONFIG_WANT_DEV_COREDUMP=y +CONFIG_ALLOW_DEV_COREDUMP=y +CONFIG_DEV_COREDUMP=y +# CONFIG_DEBUG_DRIVER is not set +CONFIG_DEBUG_DEVRES=y +# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set +# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_SOC_BUS=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_IRQ=y +CONFIG_DMA_SHARED_BUFFER=y +# CONFIG_DMA_FENCE_TRACE is not set +CONFIG_GENERIC_ARCH_TOPOLOGY=y +# end of Generic Driver Options + +# +# Bus devices +# +# CONFIG_BRCMSTB_GISB_ARB is not set +# CONFIG_MOXTET is not set +# CONFIG_SIMPLE_PM_BUS is not set +# CONFIG_VEXPRESS_CONFIG is not set +# CONFIG_MHI_BUS is not set +# end of Bus devices + +CONFIG_CONNECTOR=y +CONFIG_PROC_EVENTS=y +# CONFIG_GNSS is not set +CONFIG_MTD=y +# CONFIG_MTD_TESTS is not set + +# +# Partition parsers +# +# CONFIG_MTD_AR7_PARTS is not set +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_OF_PARTS=y +# CONFIG_MTD_AFS_PARTS is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +# end of Partition parsers + +# +# User Modules And Translation Layers +# +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_SM_FTL is not set +# CONFIG_MTD_OOPS is not set +# CONFIG_MTD_SWAP is not set +# CONFIG_MTD_PARTITIONED_MASTER is not set + +# +# RAM/ROM/Flash chip drivers +# +# CONFIG_MTD_CFI is not set +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set +# end of RAM/ROM/Flash chip drivers + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set +# end of Mapping drivers for chip access + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_DATAFLASH is not set +# CONFIG_MTD_MCHP23K256 is not set +# CONFIG_MTD_SST25L is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOCG3 is not set +# end of Self-contained MTD device drivers + +# +# NAND +# +# CONFIG_MTD_ONENAND is not set +# CONFIG_MTD_RAW_NAND is not set +# CONFIG_MTD_SPI_NAND is not set + +# +# ECC engine support +# +# end of ECC engine support +# end of NAND + +# +# LPDDR & LPDDR2 PCM memory drivers +# +# CONFIG_MTD_LPDDR is not set +# end of LPDDR & LPDDR2 PCM memory drivers + +# CONFIG_MTD_SPI_NOR is not set +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_LIMIT=20 +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set +# CONFIG_MTD_UBI_BLOCK is not set +# CONFIG_MTD_HYPERBUS is not set +CONFIG_DTC=y +CONFIG_OF=y +# CONFIG_OF_UNITTEST is not set +CONFIG_OF_FLATTREE=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_KOBJ=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_IRQ=y +CONFIG_OF_NET=y +CONFIG_OF_RESERVED_MEM=y +# CONFIG_OF_OVERLAY is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_NULL_BLK is not set +CONFIG_CDROM=y +# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set +CONFIG_ZRAM=y +# CONFIG_ZRAM_WRITEBACK is not set +# CONFIG_ZRAM_MEMORY_TRACKING is not set +# CONFIG_BLK_DEV_UMEM is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_DRBD is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SKD is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=1 +CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_BLK_DEV_RBD is not set +# CONFIG_BLK_DEV_RSXX is not set + +# +# NVME Support +# +CONFIG_NVME_CORE=y +CONFIG_BLK_DEV_NVME=y +# CONFIG_NVME_MULTIPATH is not set +# CONFIG_NVME_HWMON is not set +# CONFIG_NVME_FC is not set +# CONFIG_NVME_TCP is not set +# CONFIG_NVME_TARGET is not set +# end of NVME Support + +# +# Misc devices +# +# CONFIG_AD525X_DPOT is not set +# CONFIG_DUMMY_IRQ is not set +# CONFIG_PHANTOM is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HP_ILO is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_HMC6352 is not set +# CONFIG_DS1682 is not set +# CONFIG_LATTICE_ECP3_CONFIG is not set +CONFIG_SRAM=y +# CONFIG_PCI_ENDPOINT_TEST is not set +# CONFIG_XILINX_SDFEC is not set +# CONFIG_PVPANIC is not set +# CONFIG_HISI_HIKEY_USB is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_AT25 is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +# CONFIG_EEPROM_93CX6 is not set +# CONFIG_EEPROM_93XX46 is not set +# CONFIG_EEPROM_IDT_89HPESX is not set +# CONFIG_EEPROM_EE1004 is not set +# end of EEPROM support + +# CONFIG_CB710_CORE is not set + +# +# Texas Instruments shared transport line discipline +# +# CONFIG_TI_ST is not set +# end of Texas Instruments shared transport line discipline + +# CONFIG_SENSORS_LIS3_SPI is not set +# CONFIG_SENSORS_LIS3_I2C is not set +# CONFIG_ALTERA_STAPL is not set +# CONFIG_GENWQE is not set +# CONFIG_ECHO is not set +# CONFIG_MISC_ALCOR_PCI is not set +# CONFIG_MISC_RTSX_PCI is not set +# CONFIG_MISC_RTSX_USB is not set +# CONFIG_HABANA_AI is not set +# CONFIG_UACCE is not set +# end of Misc devices + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +CONFIG_BLK_DEV_SR=y +# CONFIG_CHR_DEV_SG is not set +# CONFIG_CHR_DEV_SCH is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_SCAN_ASYNC=y + +# +# SCSI Transports +# +CONFIG_SCSI_SPI_ATTRS=y +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +# end of SCSI Transports + +CONFIG_SCSI_LOWLEVEL=y +# CONFIG_ISCSI_TCP is not set +# CONFIG_ISCSI_BOOT_SYSFS is not set +# CONFIG_SCSI_CXGB3_ISCSI is not set +# CONFIG_SCSI_CXGB4_ISCSI is not set +# CONFIG_SCSI_BNX2_ISCSI is not set +# CONFIG_BE2ISCSI is not set +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_HPSA is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_3W_SAS is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC94XX is not set +# CONFIG_SCSI_HISI_SAS is not set +# CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVUMI is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_ARCMSR is not set +# CONFIG_SCSI_ESAS2R is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_SAS is not set +# CONFIG_SCSI_MPT3SAS is not set +# CONFIG_SCSI_MPT2SAS is not set +# CONFIG_SCSI_SMARTPQI is not set +# CONFIG_SCSI_UFSHCD is not set +# CONFIG_RAMAXEL_SPRAID is not set +# CONFIG_SCSI_HPTIOP is not set +# CONFIG_SCSI_MYRB is not set +# CONFIG_SCSI_MYRS is not set +# CONFIG_SCSI_SNIC is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_FDOMAIN_PCI is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_STEX is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLA_ISCSI is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_WD719X is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_SCSI_PMCRAID is not set +# CONFIG_SCSI_PM8001 is not set +# CONFIG_SCSI_DH is not set +# end of SCSI device support + +CONFIG_HAVE_PATA_PLATFORM=y +CONFIG_ATA=y +CONFIG_SATA_HOST=y +CONFIG_ATA_VERBOSE_ERROR=y +CONFIG_ATA_FORCE=y +CONFIG_SATA_PMP=y + +# +# Controllers with non-SFF native interface +# +CONFIG_SATA_AHCI=y +CONFIG_SATA_MOBILE_LPM_POLICY=0 +CONFIG_SATA_AHCI_PLATFORM=y +# CONFIG_AHCI_CEVA is not set +# CONFIG_AHCI_QORIQ is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_SIL24 is not set +# CONFIG_ATA_SFF is not set +CONFIG_MD=y +# CONFIG_BLK_DEV_MD is not set +# CONFIG_BCACHE is not set +# CONFIG_BLK_DEV_DM is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# end of IEEE 1394 (FireWire) support + +CONFIG_NETDEVICES=y +CONFIG_MII=y +CONFIG_NET_CORE=y +# CONFIG_BONDING is not set +# CONFIG_DUMMY is not set +# CONFIG_WIREGUARD is not set +# CONFIG_EQUALIZER is not set +# CONFIG_NET_FC is not set +# CONFIG_NET_TEAM is not set +# CONFIG_MACVLAN is not set +# CONFIG_IPVLAN is not set +# CONFIG_VXLAN is not set +# CONFIG_GENEVE is not set +# CONFIG_BAREUDP is not set +# CONFIG_GTP is not set +# CONFIG_MACSEC is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_TUN is not set +# CONFIG_TUN_VNET_CROSS_LE is not set +# CONFIG_VETH is not set +# CONFIG_NLMON is not set +# CONFIG_ARCNET is not set + +# +# Distributed Switch Architecture drivers +# +# end of Distributed Switch Architecture drivers + +CONFIG_ETHERNET=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_VENDOR_AGERE is not set +CONFIG_NET_VENDOR_ALACRITECH=y +# CONFIG_SLICOSS is not set +# CONFIG_NET_VENDOR_ALTEON is not set +# CONFIG_ALTERA_TSE is not set +CONFIG_NET_VENDOR_AMAZON=y +# CONFIG_ENA_ETHERNET is not set +# CONFIG_NET_VENDOR_AMD is not set +CONFIG_NET_VENDOR_AQUANTIA=y +# CONFIG_AQTION is not set +# CONFIG_NET_VENDOR_ARC is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +CONFIG_NET_VENDOR_AURORA=y +# CONFIG_AURORA_NB8800 is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_BROCADE is not set +CONFIG_NET_VENDOR_CADENCE=y +# CONFIG_MACB is not set +# CONFIG_NET_VENDOR_CAVIUM is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_CISCO is not set +CONFIG_NET_VENDOR_CORTINA=y +# CONFIG_GEMINI_ETHERNET is not set +# CONFIG_DNET is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_DLINK is not set +# CONFIG_NET_VENDOR_EMULEX is not set +# CONFIG_NET_VENDOR_EZCHIP is not set +CONFIG_NET_VENDOR_GOOGLE=y +# CONFIG_GVE is not set +# CONFIG_NET_VENDOR_HISILICON is not set +CONFIG_NET_VENDOR_HUAWEI=y +# CONFIG_BMA is not set +CONFIG_NET_VENDOR_I825XX=y +CONFIG_NET_VENDOR_INTEL=y +# CONFIG_E100 is not set +# CONFIG_E1000 is not set +CONFIG_E1000E=y +# CONFIG_IGB is not set +# CONFIG_IGBVF is not set +# CONFIG_IXGB is not set +# CONFIG_IXGBE is not set +# CONFIG_IXGBEVF is not set +# CONFIG_I40E is not set +# CONFIG_I40EVF is not set +# CONFIG_ICE is not set +# CONFIG_FM10K is not set +# CONFIG_IGC is not set +CONFIG_NET_VENDOR_NETSWIFT=y +# CONFIG_JME is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MICROCHIP is not set +CONFIG_NET_VENDOR_MICROSEMI=y +# CONFIG_NET_VENDOR_MYRI is not set +# CONFIG_FEALNX is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +CONFIG_NET_VENDOR_NETERION=y +# CONFIG_S2IO is not set +# CONFIG_VXGE is not set +CONFIG_NET_VENDOR_NETRONOME=y +# CONFIG_NFP is not set +CONFIG_NET_VENDOR_NI=y +# CONFIG_NI_XGE_MANAGEMENT_ENET is not set +# CONFIG_NET_VENDOR_NVIDIA is not set +# CONFIG_NET_VENDOR_OKI is not set +# CONFIG_ETHOC is not set +CONFIG_NET_VENDOR_PACKET_ENGINES=y +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +CONFIG_NET_VENDOR_PENSANDO=y +# CONFIG_IONIC is not set +# CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_QUALCOMM is not set +# CONFIG_NET_VENDOR_RDC is not set +# CONFIG_NET_VENDOR_REALTEK is not set +# CONFIG_NET_VENDOR_RENESAS is not set +# CONFIG_NET_VENDOR_ROCKER is not set +# CONFIG_NET_VENDOR_SAMSUNG is not set +# CONFIG_NET_VENDOR_SEEQ is not set +CONFIG_NET_VENDOR_SOLARFLARE=y +# CONFIG_SFC is not set +# CONFIG_SFC_FALCON is not set +# CONFIG_NET_VENDOR_SILAN is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_NET_VENDOR_SMSC is not set +CONFIG_NET_VENDOR_SOCIONEXT=y +CONFIG_NET_VENDOR_STMICRO=y +CONFIG_STMMAC_ETH=y +# CONFIG_STMMAC_SELFTESTS is not set +CONFIG_STMMAC_PLATFORM=y +# CONFIG_DWMAC_DWC_QOS_ETH is not set +CONFIG_DWMAC_GENERIC=y +CONFIG_DWMAC_ROCKCHIP=y +CONFIG_DWMAC_ROCKCHIP_TOOL=y +CONFIG_DWMAC_RK_AUTO_DELAYLINE=y +# CONFIG_DWMAC_INTEL_PLAT is not set +# CONFIG_STMMAC_PCI is not set +# CONFIG_NET_VENDOR_SUN is not set +# CONFIG_NET_VENDOR_SYNOPSYS is not set +# CONFIG_NET_VENDOR_TEHUTI is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_NET_VENDOR_WIZNET is not set +CONFIG_NET_VENDOR_XILINX=y +# CONFIG_XILINX_AXI_EMAC is not set +# CONFIG_XILINX_LL_TEMAC is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +CONFIG_PHYLINK=y +CONFIG_PHYLIB=y +CONFIG_SWPHY=y +# CONFIG_LED_TRIGGER_PHY is not set +CONFIG_FIXED_PHY=y +# CONFIG_SFP is not set + +# +# MII PHY device drivers +# +# CONFIG_AMD_PHY is not set +# CONFIG_ADIN_PHY is not set +# CONFIG_AQUANTIA_PHY is not set +# CONFIG_AX88796B_PHY is not set +# CONFIG_BROADCOM_PHY is not set +# CONFIG_BCM54140_PHY is not set +# CONFIG_BCM7XXX_PHY is not set +# CONFIG_BCM84881_PHY is not set +# CONFIG_BCM87XX_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_CORTINA_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_INTEL_XWAY_PHY is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_MARVELL_PHY is not set +# CONFIG_MARVELL_10G_PHY is not set +# CONFIG_MICREL_PHY is not set +# CONFIG_MICROCHIP_PHY is not set +# CONFIG_MICROCHIP_T1_PHY is not set +# CONFIG_MICROSEMI_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_NXP_TJA11XX_PHY is not set +# CONFIG_AT803X_PHY is not set +# CONFIG_QSEMI_PHY is not set +CONFIG_REALTEK_PHY=y +# CONFIG_RENESAS_PHY is not set +CONFIG_ROCKCHIP_PHY=y +# CONFIG_SMSC_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_TERANETICS_PHY is not set +# CONFIG_DP83822_PHY is not set +# CONFIG_DP83TC811_PHY is not set +# CONFIG_DP83848_PHY is not set +# CONFIG_DP83867_PHY is not set +# CONFIG_DP83869_PHY is not set +# CONFIG_VITESSE_PHY is not set +# CONFIG_XILINX_GMII2RGMII is not set +# CONFIG_MICREL_KS8995MA is not set +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_BUS=y +CONFIG_OF_MDIO=y +CONFIG_MDIO_DEVRES=y +# CONFIG_MDIO_BITBANG is not set +# CONFIG_MDIO_BCM_UNIMAC is not set +# CONFIG_MDIO_HISI_FEMAC is not set +# CONFIG_MDIO_MVUSB is not set +# CONFIG_MDIO_MSCC_MIIM is not set +# CONFIG_MDIO_OCTEON is not set +# CONFIG_MDIO_IPQ4019 is not set +# CONFIG_MDIO_IPQ8064 is not set +# CONFIG_MDIO_THUNDER is not set + +# +# MDIO Multiplexers +# +# CONFIG_MDIO_BUS_MUX_GPIO is not set +# CONFIG_MDIO_BUS_MUX_MULTIPLEXER is not set +# CONFIG_MDIO_BUS_MUX_MMIOREG is not set + +# +# PCS device drivers +# +CONFIG_PCS_XPCS=y +# end of PCS device drivers + +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +CONFIG_USB_NET_DRIVERS=y +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +CONFIG_USB_RTL8150=y +CONFIG_USB_RTL8152=y +# CONFIG_USB_LAN78XX is not set +CONFIG_USB_USBNET=y +CONFIG_USB_NET_AX8817X=y +CONFIG_USB_NET_AX88179_178A=y +CONFIG_USB_NET_CDCETHER=y +# CONFIG_USB_NET_CDC_EEM is not set +CONFIG_USB_NET_CDC_NCM=y +# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set +CONFIG_USB_NET_CDC_MBIM=y +# CONFIG_USB_NET_DM9601 is not set +# CONFIG_USB_NET_SR9700 is not set +# CONFIG_USB_NET_SR9800 is not set +# CONFIG_USB_NET_SMSC75XX is not set +# CONFIG_USB_NET_SMSC95XX is not set +# CONFIG_USB_NET_GL620A is not set +# CONFIG_USB_NET_NET1080 is not set +# CONFIG_USB_NET_PLUSB is not set +# CONFIG_USB_NET_MCS7830 is not set +CONFIG_USB_NET_RNDIS_HOST=y +# CONFIG_USB_NET_CDC_SUBSET is not set +# CONFIG_USB_NET_ZAURUS is not set +# CONFIG_USB_NET_CX82310_ETH is not set +# CONFIG_USB_NET_KALMIA is not set +# CONFIG_USB_NET_QMI_WWAN is not set +# CONFIG_USB_HSO is not set +# CONFIG_USB_NET_INT51X1 is not set +# CONFIG_USB_IPHETH is not set +# CONFIG_USB_SIERRA_NET is not set +# CONFIG_USB_VL600 is not set +# CONFIG_USB_NET_CH9200 is not set +# CONFIG_USB_NET_AQC111 is not set +CONFIG_WLAN=y +# CONFIG_WIRELESS_WDS is not set +CONFIG_WLAN_VENDOR_ADMTEK=y +# CONFIG_ADM8211 is not set +CONFIG_WLAN_VENDOR_ATH=y +# CONFIG_ATH_DEBUG is not set +# CONFIG_ATH5K is not set +# CONFIG_ATH5K_PCI is not set +# CONFIG_ATH9K is not set +# CONFIG_ATH9K_HTC is not set +# CONFIG_CARL9170 is not set +# CONFIG_ATH6KL is not set +# CONFIG_AR5523 is not set +# CONFIG_WIL6210 is not set +# CONFIG_ATH10K is not set +# CONFIG_WCN36XX is not set +CONFIG_WLAN_VENDOR_ATMEL=y +# CONFIG_ATMEL is not set +# CONFIG_AT76C50X_USB is not set +CONFIG_WLAN_VENDOR_BROADCOM=y +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +# CONFIG_BRCMSMAC is not set +# CONFIG_BRCMFMAC is not set +CONFIG_WLAN_VENDOR_CISCO=y +CONFIG_WLAN_VENDOR_INTEL=y +# CONFIG_IPW2100 is not set +# CONFIG_IPW2200 is not set +# CONFIG_IWL4965 is not set +# CONFIG_IWL3945 is not set +# CONFIG_IWLWIFI is not set +CONFIG_WLAN_VENDOR_INTERSIL=y +# CONFIG_HOSTAP is not set +# CONFIG_HERMES is not set +# CONFIG_P54_COMMON is not set +# CONFIG_PRISM54 is not set +CONFIG_WLAN_VENDOR_MARVELL=y +# CONFIG_LIBERTAS is not set +# CONFIG_LIBERTAS_THINFIRM is not set +# CONFIG_MWIFIEX is not set +# CONFIG_MWL8K is not set +CONFIG_WLAN_VENDOR_MEDIATEK=y +# CONFIG_MT7601U is not set +# CONFIG_MT76x0U is not set +# CONFIG_MT76x0E is not set +# CONFIG_MT76x2E is not set +# CONFIG_MT76x2U is not set +# CONFIG_MT7603E is not set +# CONFIG_MT7615E is not set +# CONFIG_MT7663U is not set +# CONFIG_MT7663S is not set +# CONFIG_MT7915E is not set +CONFIG_WLAN_VENDOR_MICROCHIP=y +# CONFIG_WILC1000_SDIO is not set +# CONFIG_WILC1000_SPI is not set +CONFIG_WLAN_VENDOR_RALINK=y +# CONFIG_RT2X00 is not set +CONFIG_WLAN_VENDOR_REALTEK=y +# CONFIG_RTL8180 is not set +# CONFIG_RTL8187 is not set +CONFIG_RTL_CARDS=y +# CONFIG_RTL8192CE is not set +# CONFIG_RTL8192SE is not set +# CONFIG_RTL8192DE is not set +# CONFIG_RTL8723AE is not set +# CONFIG_RTL8723BE is not set +# CONFIG_RTL8188EE is not set +# CONFIG_RTL8192EE is not set +# CONFIG_RTL8821AE is not set +# CONFIG_RTL8192CU is not set +# CONFIG_RTL8XXXU is not set +# CONFIG_RTW88 is not set +CONFIG_WLAN_VENDOR_RSI=y +# CONFIG_RSI_91X is not set +CONFIG_WLAN_VENDOR_ST=y +# CONFIG_CW1200 is not set +CONFIG_WLAN_VENDOR_TI=y +# CONFIG_WL1251 is not set +# CONFIG_WL12XX is not set +# CONFIG_WL18XX is not set +# CONFIG_WLCORE is not set +CONFIG_WLAN_VENDOR_ZYDAS=y +# CONFIG_USB_ZD1201 is not set +# CONFIG_ZD1211RW is not set +CONFIG_WLAN_VENDOR_QUANTENNA=y +# CONFIG_QTNFMAC_PCIE is not set +CONFIG_WL_ROCKCHIP=y +CONFIG_WIFI_BUILD_MODULE=y +CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP=y +# CONFIG_WIFI_GENERATE_RANDOM_MAC_ADDR is not set +CONFIG_BCMDHD=y +CONFIG_BCMDHD_SDIO=y +# CONFIG_BCMDHD_PCIE is not set +CONFIG_BCMDHD_FW_PATH="/vendor/etc/firmware/fw_bcmdhd.bin" +CONFIG_BCMDHD_NVRAM_PATH="/vendor/etc/firmware/nvram.txt" +# CONFIG_BCMDHD_STATIC_IF is not set +CONFIG_MXMWIFIEX=m +# CONFIG_MAC80211_HWSIM is not set +CONFIG_USB_NET_RNDIS_WLAN=y +# CONFIG_VIRT_WIFI is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_VMXNET3 is not set +# CONFIG_NETDEVSIM is not set +# CONFIG_NET_FAILOVER is not set +# CONFIG_ISDN is not set + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_LEDS=y +CONFIG_INPUT_FF_MEMLESS=y +# CONFIG_INPUT_POLLDEV is not set +# CONFIG_INPUT_SPARSEKMAP is not set +# CONFIG_INPUT_MATRIXKMAP is not set + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ADC=y +# CONFIG_KEYBOARD_ADP5588 is not set +# CONFIG_KEYBOARD_ADP5589 is not set +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_QT1050 is not set +# CONFIG_KEYBOARD_QT1070 is not set +# CONFIG_KEYBOARD_QT2160 is not set +# CONFIG_KEYBOARD_DLINK_DIR685 is not set +# CONFIG_KEYBOARD_LKKBD is not set +CONFIG_KEYBOARD_GPIO=y +CONFIG_KEYBOARD_GPIO_POLLED=y +# CONFIG_KEYBOARD_TCA6416 is not set +# CONFIG_KEYBOARD_TCA8418 is not set +# CONFIG_KEYBOARD_MATRIX is not set +# CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_LM8333 is not set +# CONFIG_KEYBOARD_MAX7359 is not set +# CONFIG_KEYBOARD_MCS is not set +# CONFIG_KEYBOARD_MPR121 is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_OPENCORES is not set +# CONFIG_KEYBOARD_SAMSUNG is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_OMAP4 is not set +# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_CAP11XX is not set +# CONFIG_KEYBOARD_BCM is not set +CONFIG_INPUT_MOUSE=y +# CONFIG_MOUSE_PS2 is not set +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_APPLETOUCH is not set +# CONFIG_MOUSE_BCM5974 is not set +CONFIG_MOUSE_CYAPA=y +CONFIG_MOUSE_ELAN_I2C=y +CONFIG_MOUSE_ELAN_I2C_I2C=y +# CONFIG_MOUSE_ELAN_I2C_SMBUS is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_MOUSE_GPIO is not set +# CONFIG_MOUSE_SYNAPTICS_I2C is not set +# CONFIG_MOUSE_SYNAPTICS_USB is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_PROPERTIES=y +# CONFIG_TOUCHSCREEN_ADS7846 is not set +# CONFIG_TOUCHSCREEN_AD7877 is not set +# CONFIG_TOUCHSCREEN_AD7879 is not set +# CONFIG_TOUCHSCREEN_ADC is not set +# CONFIG_TOUCHSCREEN_AR1021_I2C is not set +CONFIG_TOUCHSCREEN_ATMEL_MXT=y +# CONFIG_TOUCHSCREEN_ATMEL_MXT_T37 is not set +# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set +# CONFIG_TOUCHSCREEN_BU21013 is not set +# CONFIG_TOUCHSCREEN_BU21029 is not set +# CONFIG_TOUCHSCREEN_CHIPONE_ICN8318 is not set +# CONFIG_TOUCHSCREEN_CY8CTMA140 is not set +# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set +# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set +# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set +# CONFIG_TOUCHSCREEN_DYNAPRO is not set +# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set +# CONFIG_TOUCHSCREEN_EETI is not set +# CONFIG_TOUCHSCREEN_EGALAX is not set +# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set +# CONFIG_TOUCHSCREEN_EXC3000 is not set +# CONFIG_TOUCHSCREEN_FUJITSU is not set +CONFIG_TOUCHSCREEN_GOODIX=y +# CONFIG_TOUCHSCREEN_HIDEEP is not set +# CONFIG_TOUCHSCREEN_ILI210X is not set +# CONFIG_TOUCHSCREEN_S6SY761 is not set +# CONFIG_TOUCHSCREEN_GUNZE is not set +# CONFIG_TOUCHSCREEN_EKTF2127 is not set +CONFIG_TOUCHSCREEN_ELAN=y +# CONFIG_TOUCHSCREEN_ELO is not set +# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set +# CONFIG_TOUCHSCREEN_WACOM_I2C is not set +# CONFIG_TOUCHSCREEN_MAX11801 is not set +# CONFIG_TOUCHSCREEN_MCS5000 is not set +# CONFIG_TOUCHSCREEN_MMS114 is not set +# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set +# CONFIG_TOUCHSCREEN_MTOUCH is not set +# CONFIG_TOUCHSCREEN_IMX6UL_TSC is not set +# CONFIG_TOUCHSCREEN_INEXIO is not set +# CONFIG_TOUCHSCREEN_MK712 is not set +# CONFIG_TOUCHSCREEN_PENMOUNT is not set +CONFIG_TOUCHSCREEN_EDT_FT5X06=y +# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set +# CONFIG_TOUCHSCREEN_TOUCHWIN is not set +# CONFIG_TOUCHSCREEN_PIXCIR is not set +# CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set +CONFIG_TOUCHSCREEN_USB_COMPOSITE=y +CONFIG_TOUCHSCREEN_USB_EGALAX=y +CONFIG_TOUCHSCREEN_USB_PANJIT=y +CONFIG_TOUCHSCREEN_USB_3M=y +CONFIG_TOUCHSCREEN_USB_ITM=y +CONFIG_TOUCHSCREEN_USB_ETURBO=y +CONFIG_TOUCHSCREEN_USB_GUNZE=y +CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +CONFIG_TOUCHSCREEN_USB_GOTOP=y +CONFIG_TOUCHSCREEN_USB_JASTEC=y +CONFIG_TOUCHSCREEN_USB_ELO=y +CONFIG_TOUCHSCREEN_USB_E2I=y +CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y +CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y +CONFIG_TOUCHSCREEN_USB_NEXIO=y +CONFIG_TOUCHSCREEN_USB_EASYTOUCH=y +# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set +# CONFIG_TOUCHSCREEN_TSC_SERIO is not set +# CONFIG_TOUCHSCREEN_TSC2004 is not set +# CONFIG_TOUCHSCREEN_TSC2005 is not set +# CONFIG_TOUCHSCREEN_TSC2007 is not set +# CONFIG_TOUCHSCREEN_RM_TS is not set +# CONFIG_TOUCHSCREEN_SILEAD is not set +# CONFIG_TOUCHSCREEN_SIS_I2C is not set +# CONFIG_TOUCHSCREEN_ST1232 is not set +# CONFIG_TOUCHSCREEN_STMFTS is not set +# CONFIG_TOUCHSCREEN_SUR40 is not set +# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set +# CONFIG_TOUCHSCREEN_SX8654 is not set +# CONFIG_TOUCHSCREEN_TPS6507X is not set +# CONFIG_TOUCHSCREEN_ZET6223 is not set +# CONFIG_TOUCHSCREEN_ZFORCE is not set +# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set +# CONFIG_TOUCHSCREEN_IQS5XX is not set +# CONFIG_TOUCHSCREEN_ZINITIX is not set +CONFIG_INPUT_MISC=y +# CONFIG_INPUT_AD714X is not set +# CONFIG_INPUT_ATMEL_CAPTOUCH is not set +# CONFIG_INPUT_BMA150 is not set +# CONFIG_INPUT_E3X0_BUTTON is not set +# CONFIG_INPUT_MMA8450 is not set +# CONFIG_INPUT_GPIO_BEEPER is not set +# CONFIG_INPUT_GPIO_DECODER is not set +# CONFIG_INPUT_GPIO_VIBRA is not set +# CONFIG_INPUT_ATI_REMOTE2 is not set +# CONFIG_INPUT_KEYSPAN_REMOTE is not set +# CONFIG_INPUT_KXTJ9 is not set +# CONFIG_INPUT_POWERMATE is not set +# CONFIG_INPUT_YEALINK is not set +# CONFIG_INPUT_CM109 is not set +# CONFIG_INPUT_REGULATOR_HAPTIC is not set +CONFIG_INPUT_UINPUT=y +# CONFIG_INPUT_PCF8574 is not set +# CONFIG_INPUT_PWM_BEEPER is not set +# CONFIG_INPUT_PWM_VIBRA is not set +CONFIG_INPUT_RK805_PWRKEY=y +# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set +# CONFIG_INPUT_ADXL34X is not set +# CONFIG_INPUT_IMS_PCU is not set +# CONFIG_INPUT_IQS269A is not set +# CONFIG_INPUT_CMA3000 is not set +# CONFIG_INPUT_DRV260X_HAPTICS is not set +# CONFIG_INPUT_DRV2665_HAPTICS is not set +# CONFIG_INPUT_DRV2667_HAPTICS is not set +# CONFIG_RMI4_CORE is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set +# end of Hardware I/O ports +# end of Input device support + +# +# Character devices +# +CONFIG_TTY=y +CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_CONSOLE_SLEEP=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_UNIX98_PTYS=y +# CONFIG_LEGACY_PTYS is not set +CONFIG_LDISC_AUTOLOAD=y + +# +# Serial drivers +# +CONFIG_SERIAL_EARLYCON=y +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y +CONFIG_SERIAL_8250_16550A_VARIANTS=y +# CONFIG_SERIAL_8250_FINTEK is not set +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_DMA=y +# CONFIG_SERIAL_8250_PCI is not set +CONFIG_SERIAL_8250_NR_UARTS=10 +CONFIG_SERIAL_8250_RUNTIME_UARTS=10 +# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250_ASPEED_VUART is not set +CONFIG_SERIAL_8250_DWLIB=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_DW=y +# CONFIG_SERIAL_8250_RT288X is not set +CONFIG_SERIAL_OF_PLATFORM=y + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_AMBA_PL010 is not set +# CONFIG_SERIAL_AMBA_PL011 is not set +# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set +# CONFIG_SERIAL_MAX3100 is not set +# CONFIG_SERIAL_MAX310X is not set +# CONFIG_SERIAL_UARTLITE is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_SIFIVE is not set +# CONFIG_SERIAL_SCCNXP is not set +# CONFIG_SERIAL_SC16IS7XX is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_IFX6X60 is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_SERIAL_ARC is not set +# CONFIG_SERIAL_RP2 is not set +# CONFIG_SERIAL_FSL_LPUART is not set +# CONFIG_SERIAL_FSL_LINFLEXUART is not set +# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set +# CONFIG_SERIAL_SPRD is not set +# end of Serial drivers + +CONFIG_SERIAL_MCTRL_GPIO=y +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_N_GSM is not set +# CONFIG_NOZOMI is not set +# CONFIG_NULL_TTY is not set +# CONFIG_TRACE_SINK is not set +# CONFIG_HVC_DCC is not set +# CONFIG_SERIAL_DEV_BUS is not set +# CONFIG_TTY_PRINTK is not set +# CONFIG_VIRTIO_CONSOLE is not set +# CONFIG_IPMI_HANDLER is not set +CONFIG_HW_RANDOM=y +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +# CONFIG_HW_RANDOM_BA431 is not set +CONFIG_HW_RANDOM_OPTEE=y +# CONFIG_HW_RANDOM_CCTRNG is not set +# CONFIG_HW_RANDOM_XIPHERA is not set +# CONFIG_APPLICOM is not set +CONFIG_DEVMEM=y +# CONFIG_RAW_DRIVER is not set +CONFIG_DEVPORT=y +CONFIG_TCG_TPM=y +CONFIG_HW_RANDOM_TPM=y +# CONFIG_TCG_TIS is not set +# CONFIG_TCG_TIS_SPI is not set +# CONFIG_TCG_TIS_I2C_ATMEL is not set +CONFIG_TCG_TIS_I2C_INFINEON=y +# CONFIG_TCG_TIS_I2C_NUVOTON is not set +# CONFIG_TCG_ATMEL is not set +# CONFIG_TCG_VTPM_PROXY is not set +# CONFIG_TCG_FTPM_TEE is not set +# CONFIG_TCG_TIS_ST33ZP24_I2C is not set +# CONFIG_TCG_TIS_ST33ZP24_SPI is not set +# CONFIG_XILLYBUS is not set +# end of Character devices + +# CONFIG_RANDOM_TRUST_CPU is not set +# CONFIG_RANDOM_TRUST_BOOTLOADER is not set + +# +# I2C support +# +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_MUX is not set +CONFIG_I2C_HELPER_AUTO=y +CONFIG_I2C_ALGOBIT=y + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_NVIDIA_GPU is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_CADENCE is not set +# CONFIG_I2C_CBUS_GPIO is not set +# CONFIG_I2C_DESIGNWARE_PLATFORM is not set +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_EMEV2 is not set +# CONFIG_I2C_GPIO is not set +# CONFIG_I2C_HISI is not set +# CONFIG_I2C_NOMADIK is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PCA_PLATFORM is not set +CONFIG_I2C_RK3X=y +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_THUNDERX is not set +# CONFIG_I2C_XILINX is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_ROBOTFUZZ_OSIF is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Other I2C/SMBus bus drivers +# +# end of I2C Hardware Bus support + +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_SLAVE is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# end of I2C support + +# CONFIG_I3C is not set +CONFIG_SPI=y +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_MASTER=y +# CONFIG_SPI_MEM is not set + +# +# SPI Master Controller Drivers +# +# CONFIG_SPI_ALTERA is not set +# CONFIG_SPI_AXI_SPI_ENGINE is not set +CONFIG_SPI_BITBANG=y +# CONFIG_SPI_CADENCE is not set +# CONFIG_SPI_CADENCE_QUADSPI is not set +# CONFIG_SPI_DESIGNWARE is not set +# CONFIG_SPI_NXP_FLEXSPI is not set +# CONFIG_SPI_GPIO is not set +# CONFIG_SPI_FSL_SPI is not set +# CONFIG_SPI_OC_TINY is not set +# CONFIG_SPI_PL022 is not set +# CONFIG_SPI_PXA2XX is not set +CONFIG_SPI_ROCKCHIP=y +# CONFIG_SPI_SC18IS602 is not set +# CONFIG_SPI_SIFIVE is not set +# CONFIG_SPI_MXIC is not set +# CONFIG_SPI_THUNDERX is not set +# CONFIG_SPI_XCOMM is not set +# CONFIG_SPI_XILINX is not set +# CONFIG_SPI_ZYNQMP_GQSPI is not set +# CONFIG_SPI_AMD is not set + +# +# SPI Multiplexer support +# +# CONFIG_SPI_MUX is not set + +# +# SPI Protocol Masters +# +CONFIG_SPI_SPIDEV=y +# CONFIG_SPI_LOOPBACK_TEST is not set +# CONFIG_SPI_TLE62X0 is not set +# CONFIG_SPI_SLAVE is not set +# CONFIG_SPMI is not set +# CONFIG_HSI is not set +CONFIG_PPS=y +# CONFIG_PPS_DEBUG is not set + +# +# PPS clients support +# +# CONFIG_PPS_CLIENT_KTIMER is not set +# CONFIG_PPS_CLIENT_LDISC is not set +# CONFIG_PPS_CLIENT_GPIO is not set + +# +# PPS generators support +# + +# +# PTP clock support +# +CONFIG_PTP_1588_CLOCK=y + +# +# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. +# +# CONFIG_PTP_1588_CLOCK_IDT82P33 is not set +# CONFIG_PTP_1588_CLOCK_IDTCM is not set +# end of PTP clock support + +CONFIG_PINCTRL=y +CONFIG_PINMUX=y +CONFIG_PINCONF=y +CONFIG_GENERIC_PINCONF=y +# CONFIG_DEBUG_PINCTRL is not set +# CONFIG_PINCTRL_MCP23S08 is not set +CONFIG_PINCTRL_ROCKCHIP=y +# CONFIG_PINCTRL_SINGLE is not set +# CONFIG_PINCTRL_SX150X is not set +# CONFIG_PINCTRL_STMFX is not set +CONFIG_PINCTRL_RK805=y +# CONFIG_PINCTRL_OCELOT is not set + +# +# Renesas pinctrl drivers +# +# end of Renesas pinctrl drivers + +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_FASTPATH_LIMIT=512 +CONFIG_OF_GPIO=y +CONFIG_GPIOLIB_IRQCHIP=y +# CONFIG_DEBUG_GPIO is not set +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_CDEV_V1=y +CONFIG_GPIO_GENERIC=y + +# +# Memory mapped GPIO drivers +# +# CONFIG_GPIO_74XX_MMIO is not set +# CONFIG_GPIO_ALTERA is not set +# CONFIG_GPIO_CADENCE is not set +# CONFIG_GPIO_DWAPB is not set +# CONFIG_GPIO_FTGPIO010 is not set +CONFIG_GPIO_GENERIC_PLATFORM=y +# CONFIG_GPIO_GRGPIO is not set +# CONFIG_GPIO_HLWD is not set +# CONFIG_GPIO_LOGICVC is not set +# CONFIG_GPIO_MB86S7X is not set +# CONFIG_GPIO_PL061 is not set +CONFIG_GPIO_ROCKCHIP=y +# CONFIG_GPIO_SAMA5D2_PIOBU is not set +# CONFIG_GPIO_SIFIVE is not set +# CONFIG_GPIO_SYSCON is not set +# CONFIG_GPIO_XGENE is not set +# CONFIG_GPIO_XILINX is not set +# CONFIG_GPIO_AMD_FCH is not set +# end of Memory mapped GPIO drivers + +# +# I2C GPIO expanders +# +# CONFIG_GPIO_ADP5588 is not set +# CONFIG_GPIO_ADNP is not set +# CONFIG_GPIO_GW_PLD is not set +# CONFIG_GPIO_MAX7300 is not set +# CONFIG_GPIO_MAX732X is not set +# CONFIG_GPIO_PCA953X is not set +# CONFIG_GPIO_PCA9570 is not set +# CONFIG_GPIO_PCF857X is not set +# CONFIG_GPIO_TPIC2810 is not set +# end of I2C GPIO expanders + +# +# MFD GPIO expanders +# +# CONFIG_GPIO_TPS6586X is not set +# end of MFD GPIO expanders + +# +# PCI GPIO expanders +# +# CONFIG_GPIO_BT8XX is not set +# CONFIG_GPIO_PCI_IDIO_16 is not set +# CONFIG_GPIO_PCIE_IDIO_24 is not set +# CONFIG_GPIO_RDC321X is not set +# end of PCI GPIO expanders + +# +# SPI GPIO expanders +# +# CONFIG_GPIO_74X164 is not set +# CONFIG_GPIO_MAX3191X is not set +# CONFIG_GPIO_MAX7301 is not set +# CONFIG_GPIO_MC33880 is not set +# CONFIG_GPIO_PISOSR is not set +# CONFIG_GPIO_XRA1403 is not set +# end of SPI GPIO expanders + +# +# USB GPIO expanders +# +# end of USB GPIO expanders + +# CONFIG_GPIO_AGGREGATOR is not set +# CONFIG_GPIO_MOCKUP is not set +# CONFIG_W1 is not set +CONFIG_POWER_RESET=y +# CONFIG_POWER_RESET_BRCMSTB is not set +CONFIG_POWER_RESET_GPIO=y +CONFIG_POWER_RESET_GPIO_RESTART=y +# CONFIG_POWER_RESET_LTC2952 is not set +# CONFIG_POWER_RESET_RESTART is not set +# CONFIG_POWER_RESET_XGENE is not set +# CONFIG_POWER_RESET_SYSCON is not set +# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set +CONFIG_REBOOT_MODE=y +CONFIG_SYSCON_REBOOT_MODE=y +# CONFIG_NVMEM_REBOOT_MODE is not set +CONFIG_POWER_SUPPLY=y +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_POWER_SUPPLY_HWMON=y +# CONFIG_PDA_POWER is not set +# CONFIG_GENERIC_ADC_BATTERY is not set +# CONFIG_TEST_POWER is not set +# CONFIG_CHARGER_ADP5061 is not set +# CONFIG_BATTERY_CW2015 is not set +# CONFIG_BATTERY_DS2780 is not set +# CONFIG_BATTERY_DS2781 is not set +# CONFIG_BATTERY_DS2782 is not set +CONFIG_BATTERY_SBS=y +# CONFIG_CHARGER_SBS is not set +# CONFIG_BATTERY_BQ27XXX is not set +# CONFIG_BATTERY_MAX17040 is not set +# CONFIG_BATTERY_MAX17042 is not set +# CONFIG_CHARGER_ISP1704 is not set +# CONFIG_CHARGER_MAX8903 is not set +# CONFIG_CHARGER_LP8727 is not set +CONFIG_CHARGER_GPIO=y +# CONFIG_CHARGER_MANAGER is not set +# CONFIG_CHARGER_LT3651 is not set +# CONFIG_CHARGER_DETECTOR_MAX14656 is not set +# CONFIG_CHARGER_BQ2415X is not set +# CONFIG_CHARGER_BQ24190 is not set +# CONFIG_CHARGER_BQ24257 is not set +CONFIG_CHARGER_BQ24735=y +# CONFIG_CHARGER_BQ2515X is not set +# CONFIG_CHARGER_BQ25890 is not set +# CONFIG_CHARGER_BQ25980 is not set +# CONFIG_CHARGER_SMB347 is not set +# CONFIG_BATTERY_GAUGE_LTC2941 is not set +# CONFIG_BATTERY_RT5033 is not set +# CONFIG_CHARGER_RT9455 is not set +# CONFIG_CHARGER_UCS1002 is not set +# CONFIG_CHARGER_BD99954 is not set +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set + +# +# Native drivers +# +# CONFIG_SENSORS_AD7314 is not set +# CONFIG_SENSORS_AD7414 is not set +# CONFIG_SENSORS_AD7418 is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1029 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ADM1177 is not set +# CONFIG_SENSORS_ADM9240 is not set +# CONFIG_SENSORS_ADT7310 is not set +# CONFIG_SENSORS_ADT7410 is not set +# CONFIG_SENSORS_ADT7411 is not set +# CONFIG_SENSORS_ADT7462 is not set +# CONFIG_SENSORS_ADT7470 is not set +# CONFIG_SENSORS_ADT7475 is not set +# CONFIG_SENSORS_AS370 is not set +# CONFIG_SENSORS_ASC7621 is not set +# CONFIG_SENSORS_AXI_FAN_CONTROL is not set +# CONFIG_SENSORS_ARM_SCMI is not set +# CONFIG_SENSORS_ASPEED is not set +# CONFIG_SENSORS_ATXP1 is not set +# CONFIG_SENSORS_CORSAIR_CPRO is not set +# CONFIG_SENSORS_DRIVETEMP is not set +# CONFIG_SENSORS_DS620 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_I5K_AMB is not set +# CONFIG_SENSORS_F71805F is not set +# CONFIG_SENSORS_F71882FG is not set +# CONFIG_SENSORS_F75375S is not set +# CONFIG_SENSORS_FTSTEUTATES is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_GL520SM is not set +# CONFIG_SENSORS_G760A is not set +# CONFIG_SENSORS_G762 is not set +# CONFIG_SENSORS_GPIO_FAN is not set +# CONFIG_SENSORS_HIH6130 is not set +# CONFIG_SENSORS_IIO_HWMON is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_JC42 is not set +# CONFIG_SENSORS_POWR1220 is not set +# CONFIG_SENSORS_LINEAGE is not set +# CONFIG_SENSORS_LTC2945 is not set +# CONFIG_SENSORS_LTC2947_I2C is not set +# CONFIG_SENSORS_LTC2947_SPI is not set +# CONFIG_SENSORS_LTC2990 is not set +# CONFIG_SENSORS_LTC4151 is not set +# CONFIG_SENSORS_LTC4215 is not set +# CONFIG_SENSORS_LTC4222 is not set +# CONFIG_SENSORS_LTC4245 is not set +# CONFIG_SENSORS_LTC4260 is not set +# CONFIG_SENSORS_LTC4261 is not set +# CONFIG_SENSORS_MAX1111 is not set +# CONFIG_SENSORS_MAX16065 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_MAX1668 is not set +# CONFIG_SENSORS_MAX197 is not set +# CONFIG_SENSORS_MAX31722 is not set +# CONFIG_SENSORS_MAX31730 is not set +# CONFIG_SENSORS_MAX6621 is not set +# CONFIG_SENSORS_MAX6639 is not set +# CONFIG_SENSORS_MAX6642 is not set +# CONFIG_SENSORS_MAX6650 is not set +# CONFIG_SENSORS_MAX6697 is not set +# CONFIG_SENSORS_MAX31790 is not set +# CONFIG_SENSORS_MCP3021 is not set +# CONFIG_SENSORS_TC654 is not set +# CONFIG_SENSORS_MR75203 is not set +# CONFIG_SENSORS_ADCXX is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM70 is not set +# CONFIG_SENSORS_LM73 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_LM92 is not set +# CONFIG_SENSORS_LM93 is not set +# CONFIG_SENSORS_LM95234 is not set +# CONFIG_SENSORS_LM95241 is not set +# CONFIG_SENSORS_LM95245 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_PC87427 is not set +# CONFIG_SENSORS_NTC_THERMISTOR is not set +# CONFIG_SENSORS_NCT6683 is not set +# CONFIG_SENSORS_NCT6775 is not set +# CONFIG_SENSORS_NCT7802 is not set +# CONFIG_SENSORS_NCT7904 is not set +# CONFIG_SENSORS_NPCM7XX is not set +# CONFIG_SENSORS_OCC_P8_I2C is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_PMBUS is not set +# CONFIG_SENSORS_PWM_FAN is not set +# CONFIG_SENSORS_SHT15 is not set +# CONFIG_SENSORS_SHT21 is not set +# CONFIG_SENSORS_SHT3x is not set +# CONFIG_SENSORS_SHTC1 is not set +# CONFIG_SENSORS_SIS5595 is not set +# CONFIG_SENSORS_DME1737 is not set +# CONFIG_SENSORS_EMC1403 is not set +# CONFIG_SENSORS_EMC2103 is not set +# CONFIG_SENSORS_EMC6W201 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_SMSC47M192 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_SCH5627 is not set +# CONFIG_SENSORS_SCH5636 is not set +# CONFIG_SENSORS_STTS751 is not set +# CONFIG_SENSORS_SMM665 is not set +# CONFIG_SENSORS_ADC128D818 is not set +# CONFIG_SENSORS_ADS7828 is not set +# CONFIG_SENSORS_ADS7871 is not set +# CONFIG_SENSORS_AMC6821 is not set +# CONFIG_SENSORS_INA209 is not set +# CONFIG_SENSORS_INA2XX is not set +# CONFIG_SENSORS_INA3221 is not set +# CONFIG_SENSORS_TC74 is not set +# CONFIG_SENSORS_THMC50 is not set +# CONFIG_SENSORS_TMP102 is not set +# CONFIG_SENSORS_TMP103 is not set +# CONFIG_SENSORS_TMP108 is not set +# CONFIG_SENSORS_TMP401 is not set +# CONFIG_SENSORS_TMP421 is not set +# CONFIG_SENSORS_TMP513 is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_VT1211 is not set +# CONFIG_SENSORS_VT8231 is not set +# CONFIG_SENSORS_W83773G is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83791D is not set +# CONFIG_SENSORS_W83792D is not set +# CONFIG_SENSORS_W83793 is not set +# CONFIG_SENSORS_W83795 is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83L786NG is not set +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83627EHF is not set +CONFIG_THERMAL=y +# CONFIG_THERMAL_NETLINK is not set +# CONFIG_THERMAL_STATISTICS is not set +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_OF=y +CONFIG_THERMAL_WRITABLE_TRIPS=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set +# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set +CONFIG_THERMAL_GOV_FAIR_SHARE=y +CONFIG_THERMAL_GOV_STEP_WISE=y +# CONFIG_THERMAL_GOV_BANG_BANG is not set +# CONFIG_THERMAL_GOV_USER_SPACE is not set +# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set +CONFIG_CPU_THERMAL=y +CONFIG_CPU_FREQ_THERMAL=y +CONFIG_DEVFREQ_THERMAL=y +# CONFIG_THERMAL_EMULATION is not set +# CONFIG_THERMAL_MMIO is not set +CONFIG_ROCKCHIP_THERMAL=y +# CONFIG_GENERIC_ADC_THERMAL is not set +CONFIG_WATCHDOG=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WATCHDOG_NOWAYOUT is not set +CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y +CONFIG_WATCHDOG_OPEN_TIMEOUT=0 +# CONFIG_WATCHDOG_SYSFS is not set + +# +# Watchdog Pretimeout Governors +# +# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +# CONFIG_GPIO_WATCHDOG is not set +# CONFIG_XILINX_WATCHDOG is not set +# CONFIG_ZIIRAVE_WATCHDOG is not set +# CONFIG_ARM_SP805_WATCHDOG is not set +# CONFIG_ARM_SBSA_WATCHDOG is not set +# CONFIG_CADENCE_WATCHDOG is not set +CONFIG_DW_WATCHDOG=y +# CONFIG_MAX63XX_WATCHDOG is not set +# CONFIG_ARM_SMC_WATCHDOG is not set +# CONFIG_ALIM7101_WDT is not set +# CONFIG_I6300ESB_WDT is not set +# CONFIG_MEN_A21_WDT is not set + +# +# PCI-based Watchdog Cards +# +# CONFIG_PCIPCWATCHDOG is not set +# CONFIG_WDTPCI is not set + +# +# USB-based Watchdog Cards +# +# CONFIG_USBPCWATCHDOG is not set +CONFIG_SSB_POSSIBLE=y +# CONFIG_SSB is not set +CONFIG_BCMA_POSSIBLE=y +# CONFIG_BCMA is not set + +# +# Multifunction device drivers +# +CONFIG_MFD_CORE=y +# CONFIG_MFD_ACT8945A is not set +# CONFIG_MFD_AS3711 is not set +# CONFIG_MFD_AS3722 is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_AAT2870_CORE is not set +# CONFIG_MFD_ATMEL_FLEXCOM is not set +# CONFIG_MFD_ATMEL_HLCDC is not set +# CONFIG_MFD_BCM590XX is not set +# CONFIG_MFD_BD9571MWV is not set +# CONFIG_MFD_AXP20X_I2C is not set +# CONFIG_MFD_MADERA is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_MFD_DA9052_SPI is not set +# CONFIG_MFD_DA9052_I2C is not set +# CONFIG_MFD_DA9055 is not set +# CONFIG_MFD_DA9062 is not set +# CONFIG_MFD_DA9063 is not set +# CONFIG_MFD_DA9150 is not set +# CONFIG_MFD_DLN2 is not set +# CONFIG_MFD_GATEWORKS_GSC is not set +# CONFIG_MFD_MC13XXX_SPI is not set +# CONFIG_MFD_MC13XXX_I2C is not set +# CONFIG_MFD_MP2629 is not set +# CONFIG_MFD_HI6421_PMIC is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_HTC_I2CPLD is not set +# CONFIG_LPC_ICH is not set +# CONFIG_LPC_SCH is not set +# CONFIG_MFD_INTEL_PMT is not set +# CONFIG_MFD_IQS62X is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_KEMPLD is not set +# CONFIG_MFD_88PM800 is not set +# CONFIG_MFD_88PM805 is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_MAX14577 is not set +# CONFIG_MFD_MAX77620 is not set +# CONFIG_MFD_MAX77650 is not set +# CONFIG_MFD_MAX77686 is not set +# CONFIG_MFD_MAX77693 is not set +# CONFIG_MFD_MAX77843 is not set +# CONFIG_MFD_MAX8907 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_MT6360 is not set +# CONFIG_MFD_MT6397 is not set +# CONFIG_MFD_MENF21BMC is not set +# CONFIG_EZX_PCAP is not set +# CONFIG_MFD_CPCAP is not set +# CONFIG_MFD_VIPERBOARD is not set +# CONFIG_MFD_RETU is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_RT5033 is not set +# CONFIG_MFD_RC5T583 is not set +CONFIG_MFD_RK808=y +# CONFIG_MFD_RN5T618 is not set +# CONFIG_MFD_SEC_CORE is not set +# CONFIG_MFD_SI476X_CORE is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_MFD_SKY81452 is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_MFD_STMPE is not set +CONFIG_MFD_SYSCON=y +# CONFIG_MFD_TI_AM335X_TSCADC is not set +# CONFIG_MFD_LP3943 is not set +# CONFIG_MFD_LP8788 is not set +# CONFIG_MFD_TI_LMU is not set +# CONFIG_MFD_PALMAS is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS65010 is not set +# CONFIG_TPS6507X is not set +# CONFIG_MFD_TPS65086 is not set +# CONFIG_MFD_TPS65090 is not set +# CONFIG_MFD_TPS65217 is not set +# CONFIG_MFD_TI_LP873X is not set +# CONFIG_MFD_TI_LP87565 is not set +# CONFIG_MFD_TPS65218 is not set +CONFIG_MFD_TPS6586X=y +# CONFIG_MFD_TPS65910 is not set +# CONFIG_MFD_TPS65912_I2C is not set +# CONFIG_MFD_TPS65912_SPI is not set +# CONFIG_MFD_TPS80031 is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_TWL6040_CORE is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_MFD_LM3533 is not set +# CONFIG_MFD_TC3589X is not set +# CONFIG_MFD_TQMX86 is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_LOCHNAGAR is not set +# CONFIG_MFD_ARIZONA_I2C is not set +# CONFIG_MFD_ARIZONA_SPI is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM831X_SPI is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8994 is not set +# CONFIG_MFD_ROHM_BD718XX is not set +# CONFIG_MFD_ROHM_BD70528 is not set +# CONFIG_MFD_ROHM_BD71828 is not set +# CONFIG_MFD_STPMIC1 is not set +# CONFIG_MFD_STMFX is not set +# CONFIG_MFD_KHADAS_MCU is not set +# CONFIG_MFD_INTEL_M10_BMC is not set +# end of Multifunction device drivers + +CONFIG_REGULATOR=y +CONFIG_REGULATOR_DEBUG=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set +# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set +# CONFIG_REGULATOR_88PG86X is not set +CONFIG_REGULATOR_ACT8865=y +# CONFIG_REGULATOR_AD5398 is not set +# CONFIG_REGULATOR_DA9210 is not set +# CONFIG_REGULATOR_DA9211 is not set +CONFIG_REGULATOR_FAN53555=y +# CONFIG_REGULATOR_FAN53880 is not set +CONFIG_REGULATOR_GPIO=y +# CONFIG_REGULATOR_ISL9305 is not set +# CONFIG_REGULATOR_ISL6271A is not set +# CONFIG_REGULATOR_LP3971 is not set +# CONFIG_REGULATOR_LP3972 is not set +# CONFIG_REGULATOR_LP872X is not set +# CONFIG_REGULATOR_LP8755 is not set +# CONFIG_REGULATOR_LTC3589 is not set +# CONFIG_REGULATOR_LTC3676 is not set +# CONFIG_REGULATOR_MAX1586 is not set +# CONFIG_REGULATOR_MAX8649 is not set +# CONFIG_REGULATOR_MAX8660 is not set +# CONFIG_REGULATOR_MAX8952 is not set +# CONFIG_REGULATOR_MAX8973 is not set +# CONFIG_REGULATOR_MAX77826 is not set +# CONFIG_REGULATOR_MCP16502 is not set +# CONFIG_REGULATOR_MP5416 is not set +# CONFIG_REGULATOR_MP8859 is not set +# CONFIG_REGULATOR_MP886X is not set +# CONFIG_REGULATOR_MPQ7920 is not set +# CONFIG_REGULATOR_MT6311 is not set +# CONFIG_REGULATOR_PCA9450 is not set +# CONFIG_REGULATOR_PFUZE100 is not set +# CONFIG_REGULATOR_PV88060 is not set +# CONFIG_REGULATOR_PV88080 is not set +# CONFIG_REGULATOR_PV88090 is not set +CONFIG_REGULATOR_PWM=y +# CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY is not set +CONFIG_REGULATOR_RK808=y +# CONFIG_REGULATOR_RT4801 is not set +# CONFIG_REGULATOR_RTMV20 is not set +# CONFIG_REGULATOR_SLG51000 is not set +# CONFIG_REGULATOR_SY8106A is not set +# CONFIG_REGULATOR_SY8824X is not set +# CONFIG_REGULATOR_SY8827N is not set +# CONFIG_REGULATOR_TPS51632 is not set +# CONFIG_REGULATOR_TPS62360 is not set +# CONFIG_REGULATOR_TPS65023 is not set +# CONFIG_REGULATOR_TPS6507X is not set +CONFIG_REGULATOR_TPS65132=y +# CONFIG_REGULATOR_TPS6524X is not set +CONFIG_REGULATOR_TPS6586X=y +# CONFIG_REGULATOR_VCTRL is not set +# CONFIG_RC_CORE is not set +CONFIG_CEC_CORE=y +CONFIG_CEC_NOTIFIER=y +CONFIG_MEDIA_CEC_SUPPORT=y +# CONFIG_CEC_CH7322 is not set +# CONFIG_USB_PULSE8_CEC is not set +# CONFIG_USB_RAINSHADOW_CEC is not set +CONFIG_MEDIA_SUPPORT=y +# CONFIG_MEDIA_SUPPORT_FILTER is not set +# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set + +# +# Media device types +# +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_MEDIA_ANALOG_TV_SUPPORT=y +CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y +CONFIG_MEDIA_RADIO_SUPPORT=y +CONFIG_MEDIA_SDR_SUPPORT=y +CONFIG_MEDIA_PLATFORM_SUPPORT=y +CONFIG_MEDIA_TEST_SUPPORT=y +# end of Media device types + +# +# Media core support +# +CONFIG_VIDEO_DEV=y +CONFIG_MEDIA_CONTROLLER=y +CONFIG_DVB_CORE=y +# end of Media core support + +# +# Video4Linux options +# +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_V4L2_I2C=y +CONFIG_VIDEO_V4L2_SUBDEV_API=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +# end of Video4Linux options + +# +# Media controller options +# +# CONFIG_MEDIA_CONTROLLER_DVB is not set +# end of Media controller options + +# +# Digital TV options +# +# CONFIG_DVB_MMAP is not set +CONFIG_DVB_NET=y +CONFIG_DVB_MAX_ADAPTERS=16 +CONFIG_DVB_DYNAMIC_MINORS=y +# CONFIG_DVB_DEMUX_SECTION_LOSS_LOG is not set +# CONFIG_DVB_ULE_DEBUG is not set +# end of Digital TV options + +# +# Media drivers +# +CONFIG_MEDIA_USB_SUPPORT=y + +# +# Webcam devices +# +CONFIG_USB_VIDEO_CLASS=y +# CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV is not set +# CONFIG_USB_GSPCA is not set +# CONFIG_USB_PWC is not set +# CONFIG_VIDEO_CPIA2 is not set +# CONFIG_USB_ZR364XX is not set +# CONFIG_USB_STKWEBCAM is not set +# CONFIG_USB_S2255 is not set + +# +# Analog TV USB devices +# +# CONFIG_VIDEO_PVRUSB2 is not set +# CONFIG_VIDEO_HDPVR is not set +# CONFIG_VIDEO_STK1160_COMMON is not set + +# +# Analog/digital TV USB devices +# +# CONFIG_VIDEO_AU0828 is not set + +# +# Digital TV USB devices +# +# CONFIG_DVB_USB_V2 is not set +# CONFIG_DVB_TTUSB_BUDGET is not set +# CONFIG_DVB_TTUSB_DEC is not set +# CONFIG_SMS_USB_DRV is not set +# CONFIG_DVB_B2C2_FLEXCOP_USB is not set +# CONFIG_DVB_AS102 is not set + +# +# Webcam, TV (analog/digital) USB devices +# +# CONFIG_VIDEO_EM28XX is not set + +# +# Software defined radio USB devices +# +# CONFIG_USB_AIRSPY is not set +# CONFIG_USB_HACKRF is not set +# CONFIG_USB_MSI2500 is not set +# CONFIG_MEDIA_PCI_SUPPORT is not set +CONFIG_RADIO_ADAPTERS=y +# CONFIG_RADIO_SI470X is not set +# CONFIG_RADIO_SI4713 is not set +# CONFIG_USB_MR800 is not set +# CONFIG_USB_DSBR is not set +# CONFIG_RADIO_MAXIRADIO is not set +# CONFIG_RADIO_SHARK is not set +# CONFIG_RADIO_SHARK2 is not set +# CONFIG_USB_KEENE is not set +# CONFIG_USB_RAREMONO is not set +# CONFIG_USB_MA901 is not set +# CONFIG_RADIO_TEA5764 is not set +# CONFIG_RADIO_SAA7706H is not set +# CONFIG_RADIO_TEF6862 is not set +# CONFIG_RADIO_WL1273 is not set +CONFIG_VIDEOBUF2_CORE=y +CONFIG_VIDEOBUF2_V4L2=y +CONFIG_VIDEOBUF2_MEMOPS=y +CONFIG_VIDEOBUF2_VMALLOC=y +CONFIG_V4L_PLATFORM_DRIVERS=y +# CONFIG_VIDEO_CAFE_CCIC is not set +# CONFIG_VIDEO_CADENCE is not set +# CONFIG_VIDEO_ASPEED is not set +# CONFIG_VIDEO_MUX is not set +# CONFIG_VIDEO_XILINX is not set +# CONFIG_V4L_MEM2MEM_DRIVERS is not set +# CONFIG_DVB_PLATFORM_DRIVERS is not set +# CONFIG_SDR_PLATFORM_DRIVERS is not set + +# +# MMC/SDIO DVB adapters +# +# CONFIG_SMS_SDIO_DRV is not set +# CONFIG_V4L_TEST_DRIVERS is not set +# CONFIG_DVB_TEST_DRIVERS is not set +# end of Media drivers + +# +# Media ancillary drivers +# +CONFIG_MEDIA_ATTACH=y + +# +# Audio decoders, processors and mixers +# +# CONFIG_VIDEO_TVAUDIO is not set +# CONFIG_VIDEO_TDA7432 is not set +# CONFIG_VIDEO_TDA9840 is not set +# CONFIG_VIDEO_TEA6415C is not set +# CONFIG_VIDEO_TEA6420 is not set +# CONFIG_VIDEO_MSP3400 is not set +# CONFIG_VIDEO_CS3308 is not set +# CONFIG_VIDEO_CS5345 is not set +# CONFIG_VIDEO_CS53L32A is not set +# CONFIG_VIDEO_TLV320AIC23B is not set +# CONFIG_VIDEO_UDA1342 is not set +# CONFIG_VIDEO_WM8775 is not set +# CONFIG_VIDEO_WM8739 is not set +# CONFIG_VIDEO_VP27SMPX is not set +# CONFIG_VIDEO_SONY_BTF_MPX is not set +# end of Audio decoders, processors and mixers + +# +# RDS decoders +# +# CONFIG_VIDEO_SAA6588 is not set +# end of RDS decoders + +# +# Video decoders +# +# CONFIG_VIDEO_ADV7180 is not set +# CONFIG_VIDEO_ADV7183 is not set +# CONFIG_VIDEO_ADV748X is not set +# CONFIG_VIDEO_ADV7604 is not set +# CONFIG_VIDEO_ADV7842 is not set +# CONFIG_VIDEO_BT819 is not set +# CONFIG_VIDEO_BT856 is not set +# CONFIG_VIDEO_BT866 is not set +# CONFIG_VIDEO_KS0127 is not set +# CONFIG_VIDEO_ML86V7667 is not set +# CONFIG_VIDEO_SAA7110 is not set +# CONFIG_VIDEO_SAA711X is not set +# CONFIG_VIDEO_TC358743 is not set +# CONFIG_VIDEO_TVP514X is not set +# CONFIG_VIDEO_TVP5150 is not set +# CONFIG_VIDEO_TVP7002 is not set +# CONFIG_VIDEO_TW2804 is not set +# CONFIG_VIDEO_TW9903 is not set +# CONFIG_VIDEO_TW9906 is not set +# CONFIG_VIDEO_TW9910 is not set +# CONFIG_VIDEO_VPX3220 is not set + +# +# Video and audio decoders +# +# CONFIG_VIDEO_SAA717X is not set +# CONFIG_VIDEO_CX25840 is not set +# end of Video decoders + +# +# Video encoders +# +# CONFIG_VIDEO_SAA7127 is not set +# CONFIG_VIDEO_SAA7185 is not set +# CONFIG_VIDEO_ADV7170 is not set +# CONFIG_VIDEO_ADV7175 is not set +# CONFIG_VIDEO_ADV7343 is not set +# CONFIG_VIDEO_ADV7393 is not set +# CONFIG_VIDEO_ADV7511 is not set +# CONFIG_VIDEO_AD9389B is not set +# CONFIG_VIDEO_AK881X is not set +# CONFIG_VIDEO_THS8200 is not set +# end of Video encoders + +# +# Video improvement chips +# +# CONFIG_VIDEO_UPD64031A is not set +# CONFIG_VIDEO_UPD64083 is not set +# end of Video improvement chips + +# +# Audio/Video compression chips +# +# CONFIG_VIDEO_SAA6752HS is not set +# end of Audio/Video compression chips + +# +# SDR tuner chips +# +# CONFIG_SDR_MAX2175 is not set +# end of SDR tuner chips + +# +# Miscellaneous helper chips +# +# CONFIG_VIDEO_THS7303 is not set +# CONFIG_VIDEO_M52790 is not set +# CONFIG_VIDEO_I2C is not set +# CONFIG_VIDEO_ST_MIPID02 is not set +# end of Miscellaneous helper chips + +# +# Camera sensor devices +# +# CONFIG_VIDEO_HI556 is not set +# CONFIG_VIDEO_IMX214 is not set +# CONFIG_VIDEO_IMX219 is not set +# CONFIG_VIDEO_IMX258 is not set +# CONFIG_VIDEO_IMX274 is not set +# CONFIG_VIDEO_IMX290 is not set +# CONFIG_VIDEO_IMX319 is not set +# CONFIG_VIDEO_IMX355 is not set +# CONFIG_VIDEO_OV2640 is not set +# CONFIG_VIDEO_OV2659 is not set +# CONFIG_VIDEO_OV2680 is not set +# CONFIG_VIDEO_OV2685 is not set +# CONFIG_VIDEO_OV5640 is not set +# CONFIG_VIDEO_OV5645 is not set +# CONFIG_VIDEO_OV5647 is not set +# CONFIG_VIDEO_OV6650 is not set +# CONFIG_VIDEO_OV5670 is not set +# CONFIG_VIDEO_OV5675 is not set +# CONFIG_VIDEO_OV5695 is not set +# CONFIG_VIDEO_OV7251 is not set +# CONFIG_VIDEO_OV772X is not set +# CONFIG_VIDEO_OV7640 is not set +# CONFIG_VIDEO_OV7670 is not set +# CONFIG_VIDEO_OV7740 is not set +# CONFIG_VIDEO_OV8856 is not set +# CONFIG_VIDEO_OV9640 is not set +# CONFIG_VIDEO_OV9650 is not set +# CONFIG_VIDEO_OV13858 is not set +# CONFIG_VIDEO_VS6624 is not set +# CONFIG_VIDEO_MT9M001 is not set +# CONFIG_VIDEO_MT9M032 is not set +# CONFIG_VIDEO_MT9M111 is not set +# CONFIG_VIDEO_MT9P031 is not set +# CONFIG_VIDEO_MT9T001 is not set +# CONFIG_VIDEO_MT9T112 is not set +# CONFIG_VIDEO_MT9V011 is not set +# CONFIG_VIDEO_MT9V032 is not set +# CONFIG_VIDEO_MT9V111 is not set +# CONFIG_VIDEO_SR030PC30 is not set +# CONFIG_VIDEO_NOON010PC30 is not set +# CONFIG_VIDEO_M5MOLS is not set +# CONFIG_VIDEO_RDACM20 is not set +# CONFIG_VIDEO_RJ54N1 is not set +# CONFIG_VIDEO_S5K6AA is not set +# CONFIG_VIDEO_S5K6A3 is not set +# CONFIG_VIDEO_S5K4ECGX is not set +# CONFIG_VIDEO_S5K5BAF is not set +# CONFIG_VIDEO_SMIAPP is not set +# CONFIG_VIDEO_ET8EK8 is not set +# CONFIG_VIDEO_S5C73M3 is not set +# end of Camera sensor devices + +# +# Lens drivers +# +# CONFIG_VIDEO_AD5820 is not set +# CONFIG_VIDEO_AK7375 is not set +# CONFIG_VIDEO_DW9714 is not set +# CONFIG_VIDEO_DW9768 is not set +# CONFIG_VIDEO_DW9807_VCM is not set +# end of Lens drivers + +# +# Flash devices +# +# CONFIG_VIDEO_ADP1653 is not set +# CONFIG_VIDEO_LM3560 is not set +# CONFIG_VIDEO_LM3646 is not set +# end of Flash devices + +# +# SPI helper chips +# +# CONFIG_VIDEO_GS1662 is not set +# end of SPI helper chips + +# +# Media SPI Adapters +# +CONFIG_CXD2880_SPI_DRV=m +# end of Media SPI Adapters + +CONFIG_MEDIA_TUNER=y + +# +# Customize TV tuners +# +CONFIG_MEDIA_TUNER_SIMPLE=m +CONFIG_MEDIA_TUNER_TDA18250=m +CONFIG_MEDIA_TUNER_TDA8290=m +CONFIG_MEDIA_TUNER_TDA827X=m +CONFIG_MEDIA_TUNER_TDA18271=m +CONFIG_MEDIA_TUNER_TDA9887=m +CONFIG_MEDIA_TUNER_TEA5761=m +CONFIG_MEDIA_TUNER_TEA5767=m +CONFIG_MEDIA_TUNER_MSI001=m +CONFIG_MEDIA_TUNER_MT20XX=m +CONFIG_MEDIA_TUNER_MT2060=m +CONFIG_MEDIA_TUNER_MT2063=m +CONFIG_MEDIA_TUNER_MT2266=m +CONFIG_MEDIA_TUNER_MT2131=m +CONFIG_MEDIA_TUNER_QT1010=m +CONFIG_MEDIA_TUNER_XC2028=m +CONFIG_MEDIA_TUNER_XC5000=m +CONFIG_MEDIA_TUNER_XC4000=m +CONFIG_MEDIA_TUNER_MXL5005S=m +CONFIG_MEDIA_TUNER_MXL5007T=m +CONFIG_MEDIA_TUNER_MC44S803=m +CONFIG_MEDIA_TUNER_MAX2165=m +CONFIG_MEDIA_TUNER_TDA18218=m +CONFIG_MEDIA_TUNER_FC0011=m +CONFIG_MEDIA_TUNER_FC0012=m +CONFIG_MEDIA_TUNER_FC0013=m +CONFIG_MEDIA_TUNER_TDA18212=m +CONFIG_MEDIA_TUNER_E4000=m +CONFIG_MEDIA_TUNER_FC2580=m +CONFIG_MEDIA_TUNER_M88RS6000T=m +CONFIG_MEDIA_TUNER_TUA9001=m +CONFIG_MEDIA_TUNER_SI2157=m +CONFIG_MEDIA_TUNER_IT913X=m +CONFIG_MEDIA_TUNER_R820T=m +CONFIG_MEDIA_TUNER_MXL301RF=m +CONFIG_MEDIA_TUNER_QM1D1C0042=m +CONFIG_MEDIA_TUNER_QM1D1B0004=m +# end of Customize TV tuners + +# +# Customise DVB Frontends +# + +# +# Multistandard (satellite) frontends +# +CONFIG_DVB_STB0899=m +CONFIG_DVB_STB6100=m +CONFIG_DVB_STV090x=m +CONFIG_DVB_STV0910=m +CONFIG_DVB_STV6110x=m +CONFIG_DVB_STV6111=m +CONFIG_DVB_MXL5XX=m + +# +# Multistandard (cable + terrestrial) frontends +# +CONFIG_DVB_DRXK=m +CONFIG_DVB_TDA18271C2DD=m +CONFIG_DVB_SI2165=m +CONFIG_DVB_MN88472=m +CONFIG_DVB_MN88473=m + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_MT312=m +CONFIG_DVB_ZL10036=m +CONFIG_DVB_ZL10039=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_STV0288=m +CONFIG_DVB_STB6000=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_STV6110=m +CONFIG_DVB_STV0900=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8261=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_TUNER_ITD1000=m +CONFIG_DVB_TUNER_CX24113=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_CX24116=m +CONFIG_DVB_CX24117=m +CONFIG_DVB_CX24120=m +CONFIG_DVB_SI21XX=m +CONFIG_DVB_TS2020=m +CONFIG_DVB_DS3000=m +CONFIG_DVB_MB86A16=m +CONFIG_DVB_TDA10071=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_S5H1432=m +CONFIG_DVB_DRXD=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +CONFIG_DVB_DIB9000=m +CONFIG_DVB_TDA10048=m +CONFIG_DVB_EC100=m +CONFIG_DVB_STV0367=m +CONFIG_DVB_CXD2820R=m +CONFIG_DVB_CXD2841ER=m +CONFIG_DVB_ZD1301_DEMOD=m +CONFIG_DVB_CXD2880=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LGDT3305=m +CONFIG_DVB_LG2160=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_AU8522=m +CONFIG_DVB_AU8522_DTV=m +CONFIG_DVB_AU8522_V4L=m +CONFIG_DVB_S5H1411=m + +# +# ISDB-T (terrestrial) frontends +# +CONFIG_DVB_S921=m +CONFIG_DVB_DIB8000=m +CONFIG_DVB_MB86A20S=m + +# +# ISDB-S (satellite) & ISDB-T (terrestrial) frontends +# +CONFIG_DVB_TC90522=m +CONFIG_DVB_MN88443X=m + +# +# Digital terrestrial only tuners/PLL +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_DIB0090=m + +# +# SEC control devices for DVB-S +# +CONFIG_DVB_DRX39XYJ=m +CONFIG_DVB_LNBH25=m +CONFIG_DVB_LNBH29=m +CONFIG_DVB_LNBP21=m +CONFIG_DVB_LNBP22=m +CONFIG_DVB_ISL6405=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_ISL6423=m +CONFIG_DVB_A8293=m +CONFIG_DVB_LGS8GL5=m +CONFIG_DVB_LGS8GXX=m +CONFIG_DVB_ATBM8830=m +CONFIG_DVB_TDA665x=m +CONFIG_DVB_IX2505V=m +CONFIG_DVB_M88RS2000=m +CONFIG_DVB_AF9033=m +CONFIG_DVB_HORUS3A=m +CONFIG_DVB_ASCOT2E=m +CONFIG_DVB_HELENE=m + +# +# Common Interface (EN50221) controller drivers +# +CONFIG_DVB_CXD2099=m +CONFIG_DVB_SP2=m +# end of Customise DVB Frontends + +# +# Tools to develop new frontends +# +# CONFIG_DVB_DUMMY_FE is not set +# end of Media ancillary drivers + +# +# Graphics support +# +# CONFIG_VGA_ARB is not set +CONFIG_DRM=y +CONFIG_DRM_MIPI_DSI=y +# CONFIG_DRM_DP_AUX_CHARDEV is not set +# CONFIG_DRM_DEBUG_MM is not set +# CONFIG_DRM_DEBUG_SELFTEST is not set +CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_KMS_FB_HELPER=y +# CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set +CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 +# CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM is not set +# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set +# CONFIG_DRM_DP_CEC is not set +CONFIG_DRM_GEM_CMA_HELPER=y + +# +# I2C encoder or helper chips +# +# CONFIG_DRM_I2C_CH7006 is not set +# CONFIG_DRM_I2C_SIL164 is not set +# CONFIG_DRM_I2C_NXP_TDA998X is not set +# CONFIG_DRM_I2C_NXP_TDA9950 is not set +# end of I2C encoder or helper chips + +# +# ARM devices +# +# CONFIG_DRM_HDLCD is not set +# CONFIG_DRM_MALI_DISPLAY is not set +# CONFIG_DRM_KOMEDA is not set +# end of ARM devices + +# CONFIG_DRM_RADEON is not set +# CONFIG_DRM_AMDGPU is not set +# CONFIG_DRM_NOUVEAU is not set +# CONFIG_DRM_VGEM is not set +# CONFIG_DRM_VKMS is not set +CONFIG_DRM_ROCKCHIP=y +# CONFIG_ROCKCHIP_DRM_CUBIC_LUT is not set +# CONFIG_ROCKCHIP_DRM_DEBUG is not set +# CONFIG_ROCKCHIP_DRM_DIRECT_SHOW is not set +# CONFIG_ROCKCHIP_VOP is not set +CONFIG_ROCKCHIP_VOP2=y +# CONFIG_ROCKCHIP_ANALOGIX_DP is not set +# CONFIG_ROCKCHIP_CDN_DP is not set +CONFIG_ROCKCHIP_DW_HDMI=y +CONFIG_ROCKCHIP_DW_MIPI_DSI=y +# CONFIG_ROCKCHIP_DW_DP is not set +# CONFIG_ROCKCHIP_INNO_HDMI is not set +# CONFIG_ROCKCHIP_LVDS is not set +# CONFIG_ROCKCHIP_RGB is not set +# CONFIG_ROCKCHIP_RK3066_HDMI is not set +# CONFIG_ROCKCHIP_VCONN is not set +# CONFIG_DRM_ROCKCHIP_VVOP is not set +# CONFIG_DRM_UDL is not set +# CONFIG_DRM_AST is not set +# CONFIG_DRM_MGAG200 is not set +# CONFIG_DRM_RCAR_DW_HDMI is not set +# CONFIG_DRM_RCAR_LVDS is not set +# CONFIG_DRM_QXL is not set +# CONFIG_DRM_BOCHS is not set +CONFIG_DRM_PANEL=y + +# +# Display Panels +# +# CONFIG_DRM_PANEL_ARM_VERSATILE is not set +# CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 is not set +# CONFIG_DRM_PANEL_BOE_HIMAX8279D is not set +# CONFIG_DRM_PANEL_BOE_TV101WUM_NL6 is not set +# CONFIG_DRM_PANEL_LVDS is not set +CONFIG_DRM_PANEL_SIMPLE=y +# CONFIG_DRM_PANEL_ELIDA_KD35T133 is not set +# CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02 is not set +# CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D is not set +# CONFIG_DRM_PANEL_ILITEK_IL9322 is not set +# CONFIG_DRM_PANEL_ILITEK_ILI9881C is not set +# CONFIG_DRM_PANEL_INNOLUX_P079ZCA is not set +# CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set +# CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04 is not set +# CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W is not set +# CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829 is not set +# CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set +# CONFIG_DRM_PANEL_LG_LB035Q02 is not set +# CONFIG_DRM_PANEL_LG_LG4573 is not set +# CONFIG_DRM_PANEL_NEC_NL8048HL11 is not set +# CONFIG_DRM_PANEL_NOVATEK_NT35510 is not set +# CONFIG_DRM_PANEL_NOVATEK_NT39016 is not set +# CONFIG_DRM_PANEL_MANTIX_MLAF057WE51 is not set +# CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set +# CONFIG_DRM_PANEL_ORISETECH_OTM8009A is not set +# CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS is not set +# CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00 is not set +# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set +# CONFIG_DRM_PANEL_RAYDIUM_RM67191 is not set +# CONFIG_DRM_PANEL_RAYDIUM_RM68200 is not set +# CONFIG_DRM_PANEL_RONBO_RB070D30 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6D16D0 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E63M0 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set +# CONFIG_DRM_PANEL_SEIKO_43WVF1G is not set +# CONFIG_DRM_PANEL_SHARP_LQ101R1SX01 is not set +# CONFIG_DRM_PANEL_SHARP_LS037V7DW01 is not set +# CONFIG_DRM_PANEL_SHARP_LS043T1LE01 is not set +# CONFIG_DRM_PANEL_SITRONIX_ST7701 is not set +# CONFIG_DRM_PANEL_SITRONIX_ST7703 is not set +# CONFIG_DRM_PANEL_SITRONIX_ST7789V is not set +# CONFIG_DRM_PANEL_SONY_ACX424AKP is not set +# CONFIG_DRM_PANEL_SONY_ACX565AKM is not set +# CONFIG_DRM_PANEL_TPO_TD028TTEC1 is not set +# CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set +# CONFIG_DRM_PANEL_TPO_TPG110 is not set +# CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set +# CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set +# CONFIG_DRM_PANEL_XINPENG_XPP055C272 is not set +# end of Display Panels + +CONFIG_DRM_BRIDGE=y +CONFIG_DRM_PANEL_BRIDGE=y + +# +# Display Interface Bridges +# +# CONFIG_DRM_CDNS_DSI is not set +# CONFIG_DRM_CHRONTEL_CH7033 is not set +# CONFIG_DRM_DISPLAY_CONNECTOR is not set +# CONFIG_DRM_LONTIUM_LT9611 is not set +# CONFIG_DRM_LVDS_CODEC is not set +# CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set +# CONFIG_DRM_NWL_MIPI_DSI is not set +# CONFIG_DRM_NXP_PTN3460 is not set +# CONFIG_DRM_PARADE_PS8622 is not set +# CONFIG_DRM_PARADE_PS8640 is not set +# CONFIG_DRM_SIL_SII8620 is not set +# CONFIG_DRM_SII902X is not set +# CONFIG_DRM_SII9234 is not set +# CONFIG_DRM_SIMPLE_BRIDGE is not set +# CONFIG_DRM_THINE_THC63LVD1024 is not set +# CONFIG_DRM_TOSHIBA_TC358762 is not set +# CONFIG_DRM_TOSHIBA_TC358764 is not set +# CONFIG_DRM_TOSHIBA_TC358767 is not set +# CONFIG_DRM_TOSHIBA_TC358768 is not set +# CONFIG_DRM_TOSHIBA_TC358775 is not set +# CONFIG_DRM_TI_TFP410 is not set +# CONFIG_DRM_TI_SN65DSI86 is not set +# CONFIG_DRM_TI_TPD12S015 is not set +# CONFIG_DRM_ANALOGIX_ANX6345 is not set +# CONFIG_DRM_ANALOGIX_ANX78XX is not set +# CONFIG_DRM_I2C_ADV7511 is not set +# CONFIG_DRM_CDNS_MHDP8546 is not set +CONFIG_DRM_DW_HDMI=y +CONFIG_DRM_DW_HDMI_CEC=y +CONFIG_DRM_DW_MIPI_DSI=y +# end of Display Interface Bridges + +# CONFIG_DRM_ETNAVIV is not set +# CONFIG_DRM_ARCPGU is not set +# CONFIG_DRM_HISI_HIBMC is not set +# CONFIG_DRM_HISI_KIRIN is not set +# CONFIG_DRM_MXSFB is not set +# CONFIG_DRM_CIRRUS_QEMU is not set +# CONFIG_DRM_GM12U320 is not set +# CONFIG_TINYDRM_HX8357D is not set +# CONFIG_TINYDRM_ILI9225 is not set +# CONFIG_TINYDRM_ILI9341 is not set +# CONFIG_TINYDRM_ILI9486 is not set +# CONFIG_TINYDRM_MI0283QT is not set +# CONFIG_TINYDRM_REPAPER is not set +# CONFIG_TINYDRM_ST7586 is not set +# CONFIG_TINYDRM_ST7735R is not set +# CONFIG_DRM_PL111 is not set +# CONFIG_DRM_LIMA is not set +# CONFIG_DRM_PANFROST is not set +# CONFIG_DRM_TIDSS is not set +# CONFIG_DRM_LEGACY is not set +CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y +CONFIG_MALI_BIFROST=y +CONFIG_MALI_PLATFORM_NAME="rk" +CONFIG_MALI_REAL_HW=y + +# +# Platform specific options +# +# CONFIG_MALI_CSF_SUPPORT is not set +CONFIG_MALI_BIFROST_DEVFREQ=y +CONFIG_MALI_BIFROST_GATOR_SUPPORT=y +# CONFIG_MALI_BIFROST_ENABLE_TRACE is not set +# CONFIG_MALI_BIFROST_DMA_FENCE is not set +# CONFIG_MALI_ARBITER_SUPPORT is not set +# CONFIG_MALI_DMA_BUF_MAP_ON_DEMAND is not set +# CONFIG_MALI_DMA_BUF_LEGACY_COMPAT is not set +# CONFIG_MALI_BIFROST_EXPERT is not set +# CONFIG_MALI_ARBITRATION is not set + +# +# Frame buffer Devices +# +CONFIG_FB_CMDLINE=y +CONFIG_FB_NOTIFY=y +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_IMAGEBLIT=y +# CONFIG_FB_FOREIGN_ENDIAN is not set +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_DEFERRED_IO=y +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_ARMCLCD is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_UVESA is not set +# CONFIG_FB_OPENCORES is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_I740 is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_IBM_GXT4500 is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_SIMPLE is not set +# CONFIG_FB_SSD1307 is not set +# CONFIG_FB_SM712 is not set +# end of Frame buffer Devices + +# +# Backlight & LCD device support +# +# CONFIG_LCD_CLASS_DEVICE is not set +CONFIG_BACKLIGHT_CLASS_DEVICE=y +# CONFIG_BACKLIGHT_KTD253 is not set +CONFIG_BACKLIGHT_PWM=y +# CONFIG_BACKLIGHT_QCOM_WLED is not set +# CONFIG_BACKLIGHT_ADP8860 is not set +# CONFIG_BACKLIGHT_ADP8870 is not set +# CONFIG_BACKLIGHT_LM3630A is not set +# CONFIG_BACKLIGHT_LM3639 is not set +# CONFIG_BACKLIGHT_LP855X is not set +# CONFIG_BACKLIGHT_GPIO is not set +# CONFIG_BACKLIGHT_LV5207LP is not set +# CONFIG_BACKLIGHT_BD6107 is not set +# CONFIG_BACKLIGHT_ARCXCNN is not set +# CONFIG_BACKLIGHT_LED is not set +# end of Backlight & LCD device support + +# +# Rockchip Misc Video driver +# + +# +# RGA +# +# CONFIG_ROCKCHIP_RGA is not set +# end of RGA + +CONFIG_ROCKCHIP_RGA2=y +# CONFIG_ROCKCHIP_RGA2_PROC_FS is not set +CONFIG_ROCKCHIP_RGA2_DEBUG_FS=y +CONFIG_ROCKCHIP_RGA2_DEBUGGER=y +# CONFIG_ROCKCHIP_MULTI_RGA is not set +# CONFIG_ROCKCHIP_RVE is not set + +# +# IEP +# +# CONFIG_IEP is not set +# end of IEP + +CONFIG_ROCKCHIP_MPP_SERVICE=y +CONFIG_ROCKCHIP_MPP_PROC_FS=y +CONFIG_ROCKCHIP_MPP_RKVDEC=y +CONFIG_ROCKCHIP_MPP_RKVDEC2=y +CONFIG_ROCKCHIP_MPP_RKVENC=y +# CONFIG_ROCKCHIP_MPP_RKVENC2 is not set +CONFIG_ROCKCHIP_MPP_VDPU1=y +CONFIG_ROCKCHIP_MPP_VEPU1=y +CONFIG_ROCKCHIP_MPP_VDPU2=y +CONFIG_ROCKCHIP_MPP_VEPU2=y +CONFIG_ROCKCHIP_MPP_IEP2=y +CONFIG_ROCKCHIP_MPP_JPGDEC=y +# CONFIG_ROCKCHIP_MPP_AV1DEC is not set +# CONFIG_ROCKCHIP_DVBM is not set +# end of Rockchip Misc Video driver + +CONFIG_VIDEOMODE_HELPERS=y +CONFIG_HDMI=y + +# +# Console display driver support +# +CONFIG_DUMMY_CONSOLE=y +CONFIG_DUMMY_CONSOLE_COLUMNS=80 +CONFIG_DUMMY_CONSOLE_ROWS=25 +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set +# end of Console display driver support + +# CONFIG_LOGO is not set +# end of Graphics support + +# CONFIG_SOUND is not set + +# +# HID support +# +CONFIG_HID=y +CONFIG_HID_BATTERY_STRENGTH=y +CONFIG_HIDRAW=y +CONFIG_UHID=y +CONFIG_HID_GENERIC=y + +# +# Special HID drivers +# +# CONFIG_HID_A4TECH is not set +# CONFIG_HID_ACCUTOUCH is not set +# CONFIG_HID_ACRUX is not set +# CONFIG_HID_APPLE is not set +# CONFIG_HID_APPLEIR is not set +# CONFIG_HID_ASUS is not set +# CONFIG_HID_AUREAL is not set +# CONFIG_HID_BELKIN is not set +# CONFIG_HID_BETOP_FF is not set +# CONFIG_HID_BIGBEN_FF is not set +# CONFIG_HID_CHERRY is not set +# CONFIG_HID_CHICONY is not set +# CONFIG_HID_CORSAIR is not set +# CONFIG_HID_COUGAR is not set +# CONFIG_HID_MACALLY is not set +# CONFIG_HID_CMEDIA is not set +# CONFIG_HID_CP2112 is not set +# CONFIG_HID_CREATIVE_SB0540 is not set +# CONFIG_HID_CYPRESS is not set +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_ELAN is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_ELO is not set +# CONFIG_HID_EZKEY is not set +# CONFIG_HID_GEMBIRD is not set +# CONFIG_HID_GFRM is not set +# CONFIG_HID_GLORIOUS is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_VIVALDI is not set +# CONFIG_HID_GT683R is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_VIEWSONIC is not set +# CONFIG_HID_GYRATION is not set +# CONFIG_HID_ICADE is not set +# CONFIG_HID_ITE is not set +# CONFIG_HID_JABRA is not set +# CONFIG_HID_TWINHAN is not set +CONFIG_HID_KENSINGTON=y +# CONFIG_HID_LCPOWER is not set +# CONFIG_HID_LED is not set +# CONFIG_HID_LENOVO is not set +# CONFIG_HID_LOGITECH is not set +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MALTRON is not set +# CONFIG_HID_MAYFLASH is not set +# CONFIG_HID_REDRAGON is not set +# CONFIG_HID_MICROSOFT is not set +# CONFIG_HID_MONTEREY is not set +CONFIG_HID_MULTITOUCH=y +# CONFIG_HID_NTI is not set +# CONFIG_HID_NTRIG is not set +# CONFIG_HID_ORTEK is not set +# CONFIG_HID_PANTHERLORD is not set +# CONFIG_HID_PENMOUNT is not set +# CONFIG_HID_PETALYNX is not set +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PLANTRONICS is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_RETRODE is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAITEK is not set +# CONFIG_HID_SAMSUNG is not set +# CONFIG_HID_SONY is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_STEAM is not set +# CONFIG_HID_STEELSERIES is not set +# CONFIG_HID_SUNPLUS is not set +# CONFIG_HID_RMI is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_TIVO is not set +# CONFIG_HID_TOPSEED is not set +# CONFIG_HID_THINGM is not set +# CONFIG_HID_THRUSTMASTER is not set +# CONFIG_HID_UDRAW_PS3 is not set +# CONFIG_HID_U2FZERO is not set +# CONFIG_HID_WACOM is not set +# CONFIG_HID_WIIMOTE is not set +# CONFIG_HID_XINMO is not set +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +# CONFIG_HID_SENSOR_HUB is not set +# CONFIG_HID_ALPS is not set +# CONFIG_HID_MCP2221 is not set +# end of Special HID drivers + +# +# USB HID support +# +CONFIG_USB_HID=y +# CONFIG_HID_PID is not set +CONFIG_USB_HIDDEV=y +# end of USB HID support + +# +# I2C HID support +# +CONFIG_I2C_HID=y +# end of I2C HID support +# end of HID support + +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_COMMON=y +# CONFIG_USB_LED_TRIG is not set +# CONFIG_USB_ULPI_BUS is not set +# CONFIG_USB_CONN_GPIO is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB=y +CONFIG_USB_PCI=y +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y + +# +# Miscellaneous USB options +# +# CONFIG_USB_DEFAULT_PERSIST is not set +# CONFIG_USB_FEW_INIT_RETRIES is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_OTG=y +# CONFIG_USB_OTG_PRODUCTLIST is not set +# CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set +# CONFIG_USB_OTG_FSM is not set +# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set +CONFIG_USB_AUTOSUSPEND_DELAY=2 +CONFIG_USB_MON=y + +# +# USB Host Controller Drivers +# +# CONFIG_USB_C67X00_HCD is not set +CONFIG_USB_XHCI_HCD=y +# CONFIG_USB_XHCI_DBGCAP is not set +CONFIG_USB_XHCI_PCI=y +# CONFIG_USB_XHCI_PCI_RENESAS is not set +CONFIG_USB_XHCI_PLATFORM=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_EHCI_PCI=y +# CONFIG_USB_EHCI_FSL is not set +CONFIG_USB_EHCI_HCD_PLATFORM=y +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_FOTG210_HCD is not set +# CONFIG_USB_MAX3421_HCD is not set +CONFIG_USB_OHCI_HCD=y +# CONFIG_USB_OHCI_HCD_PCI is not set +CONFIG_USB_OHCI_HCD_PLATFORM=y +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set +# CONFIG_USB_HCD_TEST_MODE is not set + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=y +# CONFIG_USB_PRINTER is not set +CONFIG_USB_WDM=y +# CONFIG_USB_TMC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# + +# +# also be needed; see USB_STORAGE Help for more info +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_REALTEK is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set +# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set +# CONFIG_USB_STORAGE_ENE_UB6250 is not set +CONFIG_USB_UAS=y + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USBIP_CORE is not set +# CONFIG_USB_CDNS3 is not set +# CONFIG_USB_MUSB_HDRC is not set +CONFIG_USB_DWC3=y +# CONFIG_USB_DWC3_HOST is not set +# CONFIG_USB_DWC3_GADGET is not set +CONFIG_USB_DWC3_DUAL_ROLE=y + +# +# Platform Glue Driver Support +# +CONFIG_USB_DWC3_HAPS=y +CONFIG_USB_DWC3_OF_SIMPLE=y +CONFIG_USB_DWC2=y +# CONFIG_USB_DWC2_HOST is not set + +# +# Gadget/Dual-role mode requires USB Gadget support to be enabled +# +# CONFIG_USB_DWC2_PERIPHERAL is not set +CONFIG_USB_DWC2_DUAL_ROLE=y +# CONFIG_USB_DWC2_PCI is not set +# CONFIG_USB_DWC2_DEBUG is not set +# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set +# CONFIG_USB_CHIPIDEA is not set +# CONFIG_USB_ISP1760 is not set + +# +# USB port drivers +# +CONFIG_USB_SERIAL=y +# CONFIG_USB_SERIAL_CONSOLE is not set +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_SIMPLE is not set +# CONFIG_USB_SERIAL_AIRCABLE is not set +# CONFIG_USB_SERIAL_ARK3116 is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_CH341 is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +CONFIG_USB_SERIAL_CP210X=y +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set +# CONFIG_USB_SERIAL_EMPEG is not set +CONFIG_USB_SERIAL_FTDI_SIO=y +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_F81232 is not set +# CONFIG_USB_SERIAL_F8153X is not set +# CONFIG_USB_SERIAL_GARMIN is not set +# CONFIG_USB_SERIAL_IPW is not set +# CONFIG_USB_SERIAL_IUU is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +CONFIG_USB_SERIAL_KEYSPAN=y +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_METRO is not set +# CONFIG_USB_SERIAL_MOS7720 is not set +# CONFIG_USB_SERIAL_MOS7840 is not set +# CONFIG_USB_SERIAL_MXUPORT is not set +# CONFIG_USB_SERIAL_NAVMAN is not set +CONFIG_USB_SERIAL_PL2303=y +CONFIG_USB_SERIAL_OTI6858=y +# CONFIG_USB_SERIAL_QCAUX is not set +CONFIG_USB_SERIAL_QUALCOMM=y +# CONFIG_USB_SERIAL_SPCP8X5 is not set +# CONFIG_USB_SERIAL_SAFE is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=y +# CONFIG_USB_SERIAL_SYMBOL is not set +# CONFIG_USB_SERIAL_TI is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +CONFIG_USB_SERIAL_WWAN=y +CONFIG_USB_SERIAL_OPTION=y +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_SERIAL_OPTICON is not set +# CONFIG_USB_SERIAL_XSENS_MT is not set +# CONFIG_USB_SERIAL_WISHBONE is not set +# CONFIG_USB_SERIAL_SSU100 is not set +# CONFIG_USB_SERIAL_QT2 is not set +# CONFIG_USB_SERIAL_UPD78F0730 is not set +# CONFIG_USB_SERIAL_DEBUG is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_APPLE_MFI_FASTCHARGE is not set +# CONFIG_USB_SISUSBVGA is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_EHSET_TEST_FIXTURE is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_YUREX is not set +CONFIG_USB_EZUSB_FX2=y +# CONFIG_USB_HUB_USB251XB is not set +# CONFIG_USB_HSIC_USB3503 is not set +# CONFIG_USB_HSIC_USB4604 is not set +# CONFIG_USB_LINK_LAYER_TEST is not set +# CONFIG_USB_CHAOSKEY is not set + +# +# USB Physical Layer drivers +# +CONFIG_USB_PHY=y +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_USB_GPIO_VBUS is not set +# CONFIG_USB_ISP1301 is not set +# CONFIG_USB_ULPI is not set +# end of USB Physical Layer drivers + +CONFIG_USB_GADGET=y +# CONFIG_USB_GADGET_DEBUG is not set +CONFIG_USB_GADGET_DEBUG_FILES=y +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_VBUS_DRAW=500 +CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 +# CONFIG_U_SERIAL_CONSOLE is not set + +# +# USB Peripheral Controller +# +# CONFIG_USB_FOTG210_UDC is not set +# CONFIG_USB_GR_UDC is not set +# CONFIG_USB_R8A66597 is not set +# CONFIG_USB_PXA27X is not set +# CONFIG_USB_MV_UDC is not set +# CONFIG_USB_MV_U3D is not set +# CONFIG_USB_SNP_UDC_PLAT is not set +# CONFIG_USB_M66592 is not set +# CONFIG_USB_BDC_UDC is not set +# CONFIG_USB_AMD5536UDC is not set +# CONFIG_USB_NET2272 is not set +# CONFIG_USB_NET2280 is not set +# CONFIG_USB_GOKU is not set +# CONFIG_USB_EG20T is not set +# CONFIG_USB_GADGET_XILINX is not set +# CONFIG_USB_MAX3420_UDC is not set +# CONFIG_USB_DUMMY_HCD is not set +# end of USB Peripheral Controller + +CONFIG_USB_LIBCOMPOSITE=y +CONFIG_USB_F_ACM=y +CONFIG_USB_U_SERIAL=y +CONFIG_USB_F_MASS_STORAGE=y +CONFIG_USB_F_FS=y +CONFIG_USB_F_UVC=y +CONFIG_USB_CONFIGFS=y +# CONFIG_USB_CONFIGFS_SERIAL is not set +CONFIG_USB_CONFIGFS_ACM=y +# CONFIG_USB_CONFIGFS_OBEX is not set +# CONFIG_USB_CONFIGFS_NCM is not set +# CONFIG_USB_CONFIGFS_ECM is not set +# CONFIG_USB_CONFIGFS_ECM_SUBSET is not set +# CONFIG_USB_CONFIGFS_RNDIS is not set +# CONFIG_USB_CONFIGFS_EEM is not set +CONFIG_USB_CONFIGFS_MASS_STORAGE=y +# CONFIG_USB_CONFIGFS_F_LB_SS is not set +CONFIG_USB_CONFIGFS_F_FS=y +# CONFIG_USB_CONFIGFS_F_HID is not set +CONFIG_USB_CONFIGFS_F_UVC=y +# CONFIG_USB_CONFIGFS_F_PRINTER is not set + +# +# USB Gadget precomposed configurations +# +# CONFIG_USB_ZERO is not set +# CONFIG_USB_ETH is not set +# CONFIG_USB_G_NCM is not set +# CONFIG_USB_GADGETFS is not set +# CONFIG_USB_FUNCTIONFS is not set +CONFIG_USB_MASS_STORAGE=m +# CONFIG_USB_G_SERIAL is not set +# CONFIG_USB_G_PRINTER is not set +# CONFIG_USB_CDC_COMPOSITE is not set +# CONFIG_USB_G_ACM_MS is not set +# CONFIG_USB_G_MULTI is not set +# CONFIG_USB_G_HID is not set +# CONFIG_USB_G_DBGP is not set +# CONFIG_USB_G_WEBCAM is not set +# CONFIG_USB_RAW_GADGET is not set +# end of USB Gadget precomposed configurations + +# CONFIG_TYPEC is not set +CONFIG_USB_ROLE_SWITCH=y +CONFIG_MMC=y +CONFIG_PWRSEQ_EMMC=y +# CONFIG_PWRSEQ_SD8787 is not set +CONFIG_PWRSEQ_SIMPLE=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_BLOCK_MINORS=32 +# CONFIG_SDIO_UART is not set +CONFIG_MMC_TEST=y + +# +# MMC/SD/SDIO Host Controller Drivers +# +# CONFIG_MMC_DEBUG is not set +# CONFIG_MMC_ARMMMCI is not set +CONFIG_MMC_SDHCI=y +# CONFIG_MMC_SDHCI_PCI is not set +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_SDHCI_OF_ARASAN=y +# CONFIG_MMC_SDHCI_OF_ASPEED is not set +# CONFIG_MMC_SDHCI_OF_AT91 is not set +CONFIG_MMC_SDHCI_OF_DWCMSHC=y +# CONFIG_MMC_SDHCI_CADENCE is not set +# CONFIG_MMC_SDHCI_F_SDH30 is not set +# CONFIG_MMC_SDHCI_MILBEAUT is not set +# CONFIG_MMC_TIFM_SD is not set +# CONFIG_MMC_SPI is not set +# CONFIG_MMC_CB710 is not set +# CONFIG_MMC_VIA_SDMMC is not set +CONFIG_MMC_DW=y +CONFIG_MMC_DW_PLTFM=y +# CONFIG_MMC_DW_BLUEFIELD is not set +# CONFIG_MMC_DW_EXYNOS is not set +# CONFIG_MMC_DW_HI3798CV200 is not set +# CONFIG_MMC_DW_K3 is not set +# CONFIG_MMC_DW_PCI is not set +CONFIG_MMC_DW_ROCKCHIP=y +# CONFIG_MMC_VUB300 is not set +# CONFIG_MMC_USHC is not set +# CONFIG_MMC_USDHI6ROL0 is not set +CONFIG_MMC_CQHCI=y +# CONFIG_MMC_HSQ is not set +# CONFIG_MMC_TOSHIBA_PCI is not set +# CONFIG_MMC_MTK is not set +# CONFIG_MMC_SDHCI_XENON is not set +# CONFIG_MMC_SDHCI_OMAP is not set +# CONFIG_MMC_SDHCI_AM654 is not set +# CONFIG_MEMSTICK is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +# CONFIG_LEDS_CLASS_FLASH is not set +# CONFIG_LEDS_CLASS_MULTICOLOR is not set +# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set + +# +# LED drivers +# +# CONFIG_LEDS_AN30259A is not set +# CONFIG_LEDS_AW2013 is not set +# CONFIG_LEDS_BCM6328 is not set +# CONFIG_LEDS_BCM6358 is not set +# CONFIG_LEDS_CR0014114 is not set +# CONFIG_LEDS_EL15203000 is not set +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_LM3532 is not set +# CONFIG_LEDS_LM3642 is not set +# CONFIG_LEDS_LM3692X is not set +# CONFIG_LEDS_PCA9532 is not set +CONFIG_LEDS_GPIO=y +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP3952 is not set +# CONFIG_LEDS_LP50XX is not set +# CONFIG_LEDS_LP55XX_COMMON is not set +# CONFIG_LEDS_LP8860 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_PCA963X is not set +# CONFIG_LEDS_DAC124S085 is not set +# CONFIG_LEDS_PWM is not set +# CONFIG_LEDS_REGULATOR is not set +# CONFIG_LEDS_BD2802 is not set +# CONFIG_LEDS_LT3593 is not set +# CONFIG_LEDS_TCA6507 is not set +# CONFIG_LEDS_TLC591XX is not set +# CONFIG_LEDS_LM355x is not set +# CONFIG_LEDS_IS31FL319X is not set +CONFIG_LEDS_IS31FL32XX=y + +# +# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM) +# +# CONFIG_LEDS_BLINKM is not set +# CONFIG_LEDS_SYSCON is not set +# CONFIG_LEDS_MLXREG is not set +# CONFIG_LEDS_USER is not set +# CONFIG_LEDS_SPI_BYTE is not set +# CONFIG_LEDS_TI_LMU_COMMON is not set + +# +# LED Triggers +# +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=y +# CONFIG_LEDS_TRIGGER_ONESHOT is not set +# CONFIG_LEDS_TRIGGER_DISK is not set +# CONFIG_LEDS_TRIGGER_MTD is not set +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_CPU is not set +# CONFIG_LEDS_TRIGGER_ACTIVITY is not set +CONFIG_LEDS_TRIGGER_GPIO=y +CONFIG_LEDS_TRIGGER_DEFAULT_ON=y + +# +# iptables trigger is under Netfilter config (LED target) +# +# CONFIG_LEDS_TRIGGER_TRANSIENT is not set +# CONFIG_LEDS_TRIGGER_CAMERA is not set +# CONFIG_LEDS_TRIGGER_PANIC is not set +# CONFIG_LEDS_TRIGGER_NETDEV is not set +# CONFIG_LEDS_TRIGGER_PATTERN is not set +# CONFIG_LEDS_TRIGGER_AUDIO is not set +# CONFIG_ACCESSIBILITY is not set +# CONFIG_INFINIBAND is not set +CONFIG_EDAC_SUPPORT=y +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +CONFIG_RTC_SYSTOHC=y +CONFIG_RTC_SYSTOHC_DEVICE="rtc0" +# CONFIG_RTC_DEBUG is not set +CONFIG_RTC_NVMEM=y + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set +# CONFIG_RTC_DRV_TEST is not set + +# +# I2C RTC drivers +# +# CONFIG_RTC_DRV_ABB5ZES3 is not set +# CONFIG_RTC_DRV_ABEOZ9 is not set +# CONFIG_RTC_DRV_ABX80X is not set +# CONFIG_RTC_DRV_DS1307 is not set +# CONFIG_RTC_DRV_DS1374 is not set +# CONFIG_RTC_DRV_DS1672 is not set +# CONFIG_RTC_DRV_HYM8563 is not set +# CONFIG_RTC_DRV_MAX6900 is not set +# CONFIG_RTC_DRV_RK808 is not set +# CONFIG_RTC_DRV_RS5C372 is not set +# CONFIG_RTC_DRV_ISL1208 is not set +# CONFIG_RTC_DRV_ISL12022 is not set +# CONFIG_RTC_DRV_ISL12026 is not set +# CONFIG_RTC_DRV_X1205 is not set +# CONFIG_RTC_DRV_PCF8523 is not set +# CONFIG_RTC_DRV_PCF85063 is not set +# CONFIG_RTC_DRV_PCF85363 is not set +CONFIG_RTC_DRV_PCF8563=y +# CONFIG_RTC_DRV_PCF8583 is not set +# CONFIG_RTC_DRV_M41T80 is not set +# CONFIG_RTC_DRV_BQ32K is not set +# CONFIG_RTC_DRV_TPS6586X is not set +# CONFIG_RTC_DRV_S35390A is not set +# CONFIG_RTC_DRV_FM3130 is not set +# CONFIG_RTC_DRV_RX8010 is not set +# CONFIG_RTC_DRV_RX8581 is not set +# CONFIG_RTC_DRV_RX8025 is not set +# CONFIG_RTC_DRV_EM3027 is not set +# CONFIG_RTC_DRV_RV3028 is not set +# CONFIG_RTC_DRV_RV3032 is not set +# CONFIG_RTC_DRV_RV8803 is not set +# CONFIG_RTC_DRV_SD3078 is not set + +# +# SPI RTC drivers +# +# CONFIG_RTC_DRV_M41T93 is not set +# CONFIG_RTC_DRV_M41T94 is not set +# CONFIG_RTC_DRV_DS1302 is not set +# CONFIG_RTC_DRV_DS1305 is not set +# CONFIG_RTC_DRV_DS1343 is not set +# CONFIG_RTC_DRV_DS1347 is not set +# CONFIG_RTC_DRV_DS1390 is not set +# CONFIG_RTC_DRV_MAX6916 is not set +# CONFIG_RTC_DRV_R9701 is not set +# CONFIG_RTC_DRV_RX4581 is not set +# CONFIG_RTC_DRV_RX6110 is not set +# CONFIG_RTC_DRV_RS5C348 is not set +# CONFIG_RTC_DRV_MAX6902 is not set +# CONFIG_RTC_DRV_PCF2123 is not set +# CONFIG_RTC_DRV_MCP795 is not set +CONFIG_RTC_I2C_AND_SPI=y + +# +# SPI and I2C RTC drivers +# +# CONFIG_RTC_DRV_DS3232 is not set +# CONFIG_RTC_DRV_PCF2127 is not set +# CONFIG_RTC_DRV_RV3029C2 is not set + +# +# Platform RTC drivers +# +# CONFIG_RTC_DRV_DS1286 is not set +# CONFIG_RTC_DRV_DS1511 is not set +# CONFIG_RTC_DRV_DS1553 is not set +# CONFIG_RTC_DRV_DS1685_FAMILY is not set +# CONFIG_RTC_DRV_DS1742 is not set +# CONFIG_RTC_DRV_DS2404 is not set +# CONFIG_RTC_DRV_STK17TA8 is not set +# CONFIG_RTC_DRV_M48T86 is not set +# CONFIG_RTC_DRV_M48T35 is not set +# CONFIG_RTC_DRV_M48T59 is not set +# CONFIG_RTC_DRV_MSM6242 is not set +# CONFIG_RTC_DRV_BQ4802 is not set +# CONFIG_RTC_DRV_RP5C01 is not set +# CONFIG_RTC_DRV_V3020 is not set +# CONFIG_RTC_DRV_ZYNQMP is not set + +# +# on-CPU RTC drivers +# +# CONFIG_RTC_DRV_PL030 is not set +# CONFIG_RTC_DRV_PL031 is not set +# CONFIG_RTC_DRV_CADENCE is not set +# CONFIG_RTC_DRV_FTRTC010 is not set +# CONFIG_RTC_DRV_R7301 is not set + +# +# HID Sensor RTC drivers +# +CONFIG_DMADEVICES=y +# CONFIG_DMADEVICES_DEBUG is not set + +# +# DMA Devices +# +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y +# CONFIG_ALTERA_MSGDMA is not set +# CONFIG_AMBA_PL08X is not set +# CONFIG_DW_AXI_DMAC is not set +# CONFIG_FSL_EDMA is not set +# CONFIG_FSL_QDMA is not set +# CONFIG_HISI_DMA is not set +# CONFIG_INTEL_IDMA64 is not set +# CONFIG_MV_XOR_V2 is not set +CONFIG_PL330_DMA=y +# CONFIG_PLX_DMA is not set +# CONFIG_XILINX_DMA is not set +# CONFIG_XILINX_ZYNQMP_DMA is not set +# CONFIG_XILINX_ZYNQMP_DPDMA is not set +# CONFIG_QCOM_HIDMA_MGMT is not set +# CONFIG_QCOM_HIDMA is not set +# CONFIG_DW_DMAC is not set +# CONFIG_DW_DMAC_PCI is not set +# CONFIG_DW_EDMA is not set +# CONFIG_DW_EDMA_PCIE is not set +# CONFIG_SF_PDMA is not set + +# +# DMA Clients +# +# CONFIG_ASYNC_TX_DMA is not set +# CONFIG_DMATEST is not set + +# +# DMABUF options +# +CONFIG_SYNC_FILE=y +# CONFIG_SW_SYNC is not set +# CONFIG_UDMABUF is not set +# CONFIG_DMABUF_MOVE_NOTIFY is not set +# CONFIG_DMABUF_SELFTESTS is not set +# CONFIG_DMABUF_HEAPS is not set +# end of DMABUF options + +# CONFIG_AUXDISPLAY is not set +# CONFIG_UIO is not set +# CONFIG_VFIO is not set +# CONFIG_VIRT_DRIVERS is not set +CONFIG_VIRTIO_MENU=y +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTIO_MMIO is not set +# CONFIG_VDPA is not set +CONFIG_VHOST_MENU=y +# CONFIG_VHOST_NET is not set +# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set + +# +# Microsoft Hyper-V guest support +# +# end of Microsoft Hyper-V guest support + +# CONFIG_GREYBUS is not set +CONFIG_STAGING=y +# CONFIG_PRISM2_USB is not set +# CONFIG_COMEDI is not set +# CONFIG_RTL8192U is not set +# CONFIG_RTLLIB is not set +# CONFIG_RTL8723BS is not set +# CONFIG_R8712U is not set +# CONFIG_R8188EU is not set +# CONFIG_RTS5208 is not set +# CONFIG_VT6655 is not set +# CONFIG_VT6656 is not set + +# +# IIO staging drivers +# + +# +# Accelerometers +# +# CONFIG_ADIS16203 is not set +# CONFIG_ADIS16240 is not set +# end of Accelerometers + +# +# Analog to digital converters +# +# CONFIG_AD7816 is not set +# CONFIG_AD7280 is not set +# end of Analog to digital converters + +# +# Analog digital bi-direction converters +# +# CONFIG_ADT7316 is not set +# end of Analog digital bi-direction converters + +# +# Capacitance to digital converters +# +# CONFIG_AD7150 is not set +# CONFIG_AD7746 is not set +# end of Capacitance to digital converters + +# +# Direct Digital Synthesis +# +# CONFIG_AD9832 is not set +# CONFIG_AD9834 is not set +# end of Direct Digital Synthesis + +# +# Network Analyzer, Impedance Converters +# +# CONFIG_AD5933 is not set +# end of Network Analyzer, Impedance Converters + +# +# Active energy metering IC +# +# CONFIG_ADE7854 is not set +# end of Active energy metering IC + +# +# Resolver to digital converters +# +# CONFIG_AD2S1210 is not set +# end of Resolver to digital converters +# end of IIO staging drivers + +# CONFIG_FB_SM750 is not set +# CONFIG_STAGING_MEDIA is not set + +# +# Android +# +# CONFIG_ASHMEM is not set +# CONFIG_DEBUG_KINFO is not set +# CONFIG_ION is not set +CONFIG_FIQ_DEBUGGER=y +CONFIG_FIQ_DEBUGGER_NO_SLEEP=y +# CONFIG_FIQ_DEBUGGER_WAKEUP_IRQ_ALWAYS_ON is not set +CONFIG_FIQ_DEBUGGER_CONSOLE=y +CONFIG_FIQ_DEBUGGER_CONSOLE_DEFAULT_ENABLE=y +CONFIG_FIQ_DEBUGGER_TRUST_ZONE=y +# CONFIG_FIQ_DEBUGGER_UART_OVERLAY is not set +CONFIG_RK_CONSOLE_THREAD=y +# end of Android + +# CONFIG_STAGING_BOARD is not set +# CONFIG_LTE_GDM724X is not set +# CONFIG_GS_FPGABOOT is not set +# CONFIG_UNISYSSPAR is not set +# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set +# CONFIG_FB_TFT is not set +# CONFIG_KS7010 is not set +# CONFIG_PI433 is not set + +# +# Gasket devices +# +# CONFIG_STAGING_GASKET_FRAMEWORK is not set +# end of Gasket devices + +# CONFIG_XIL_AXIS_FIFO is not set +# CONFIG_FIELDBUS_DEV is not set +# CONFIG_QLGE is not set +# CONFIG_WFX is not set +# CONFIG_GOLDFISH is not set +# CONFIG_CHROME_PLATFORMS is not set +# CONFIG_MELLANOX_PLATFORM is not set +CONFIG_HAVE_CLK=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_COMMON_CLK=y +# CONFIG_COMMON_CLK_MAX9485 is not set +CONFIG_COMMON_CLK_RK808=y +CONFIG_COMMON_CLK_SCMI=y +# CONFIG_COMMON_CLK_SI5341 is not set +# CONFIG_COMMON_CLK_SI5351 is not set +# CONFIG_COMMON_CLK_SI514 is not set +# CONFIG_COMMON_CLK_SI544 is not set +# CONFIG_COMMON_CLK_SI570 is not set +# CONFIG_COMMON_CLK_CDCE706 is not set +# CONFIG_COMMON_CLK_CDCE925 is not set +# CONFIG_COMMON_CLK_CS2000_CP is not set +# CONFIG_CLK_QORIQ is not set +# CONFIG_COMMON_CLK_XGENE is not set +# CONFIG_COMMON_CLK_PWM is not set +# CONFIG_COMMON_CLK_VC5 is not set +# CONFIG_COMMON_CLK_FIXED_MMIO is not set +CONFIG_COMMON_CLK_ROCKCHIP=y +CONFIG_CLK_PX30=y +CONFIG_CLK_RK1808=y +CONFIG_CLK_RK3328=y +CONFIG_CLK_RK3399=y +CONFIG_CLK_RK3568=y +# CONFIG_ROCKCHIP_CLK_COMPENSATION is not set +# CONFIG_ROCKCHIP_CLK_LINK is not set +CONFIG_ROCKCHIP_CLK_BOOST=y +CONFIG_ROCKCHIP_CLK_INV=y +CONFIG_ROCKCHIP_CLK_PVTM=y +CONFIG_ROCKCHIP_DDRCLK=y +# CONFIG_ROCKCHIP_DDRCLK_SCPI is not set +CONFIG_ROCKCHIP_DDRCLK_SIP=y +CONFIG_ROCKCHIP_DDRCLK_SIP_V2=y +# CONFIG_ROCKCHIP_PLL_RK3066 is not set +CONFIG_ROCKCHIP_PLL_RK3399=y +# CONFIG_ROCKCHIP_PLL_RK3588 is not set +# CONFIG_HWSPINLOCK is not set + +# +# Clock Source drivers +# +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_CLKSRC_MMIO=y +CONFIG_ROCKCHIP_TIMER=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y +CONFIG_FSL_ERRATUM_A008585=y +CONFIG_HISILICON_ERRATUM_161010101=y +CONFIG_ARM64_ERRATUM_858921=y +# CONFIG_MICROCHIP_PIT64B is not set +# end of Clock Source drivers + +CONFIG_MAILBOX=y +# CONFIG_ARM_MHU is not set +# CONFIG_PLATFORM_MHU is not set +# CONFIG_PL320_MBOX is not set +# CONFIG_ROCKCHIP_MBOX is not set +# CONFIG_ALTERA_MBOX is not set +# CONFIG_MAILBOX_TEST is not set +CONFIG_IOMMU_IOVA=y +CONFIG_IOMMU_API=y +CONFIG_IOMMU_SUPPORT=y + +# +# Generic IOMMU Pagetable Support +# +# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set +# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set +# end of Generic IOMMU Pagetable Support + +# CONFIG_IOMMU_DEBUGFS is not set +# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set +CONFIG_OF_IOMMU=y +CONFIG_IOMMU_DMA=y +CONFIG_ROCKCHIP_IOMMU=y +# CONFIG_ARM_SMMU is not set +# CONFIG_ARM_SMMU_V3 is not set + +# +# Remoteproc drivers +# +# CONFIG_REMOTEPROC is not set +# end of Remoteproc drivers + +# +# Rpmsg drivers +# +# CONFIG_RPMSG_QCOM_GLINK_RPM is not set +# CONFIG_RPMSG_VIRTIO is not set +# end of Rpmsg drivers + +# CONFIG_SOUNDWIRE is not set + +# +# SOC (System On Chip) specific Drivers +# + +# +# Amlogic SoC drivers +# +# end of Amlogic SoC drivers + +# +# Aspeed SoC drivers +# +# end of Aspeed SoC drivers + +# +# Broadcom SoC drivers +# +# CONFIG_SOC_BRCMSTB is not set +# end of Broadcom SoC drivers + +# +# NXP/Freescale QorIQ SoC drivers +# +# CONFIG_QUICC_ENGINE is not set +# CONFIG_FSL_RCPM is not set +# end of NXP/Freescale QorIQ SoC drivers + +# +# i.MX SoC drivers +# +# end of i.MX SoC drivers + +# +# Qualcomm SoC drivers +# +# end of Qualcomm SoC drivers + +# +# Rockchip CPU selection +# +CONFIG_CPU_PX30=y +CONFIG_CPU_RK1808=y +# CONFIG_CPU_RK3308 is not set +CONFIG_CPU_RK3328=y +# CONFIG_CPU_RK3368 is not set +CONFIG_CPU_RK3399=y +CONFIG_CPU_RK3568=y +# CONFIG_CPU_RK3588 is not set +# end of Rockchip CPU selection + +CONFIG_NO_GKI=y +# CONFIG_ROCKCHIP_CPUINFO is not set +# CONFIG_ROCKCHIP_GRF is not set +# CONFIG_ROCKCHIP_HW_DECOMPRESS is not set +CONFIG_ROCKCHIP_IODOMAIN=y +# CONFIG_ROCKCHIP_IOMUX is not set +# CONFIG_ROCKCHIP_IPA is not set +# CONFIG_ROCKCHIP_OPP is not set +# CONFIG_ROCKCHIP_PERFORMANCE is not set +CONFIG_ROCKCHIP_PM_DOMAINS=y +CONFIG_ROCKCHIP_PVTM=y +# CONFIG_ROCKCHIP_RAMDISK is not set +CONFIG_ROCKCHIP_SUSPEND_MODE=y +# CONFIG_ROCKCHIP_SYSTEM_MONITOR is not set +CONFIG_ROCKCHIP_VENDOR_STORAGE=y +CONFIG_ROCKCHIP_MMC_VENDOR_STORAGE=y +CONFIG_ROCKCHIP_MTD_VENDOR_STORAGE=y +CONFIG_ROCKCHIP_VENDOR_STORAGE_UPDATE_LOADER=y +CONFIG_ROCKCHIP_FIQ_DEBUGGER=y +# CONFIG_ROCKCHIP_DEBUG is not set +# CONFIG_ROCKCHIP_MINI_KERNEL is not set +# CONFIG_ROCKCHIP_THUNDER_BOOT is not set +# CONFIG_ROCKCHIP_NPOR_POWERGOOD is not set +# CONFIG_RK_CMA_PROCFS is not set +# CONFIG_RK_DMABUF_PROCFS is not set +# CONFIG_RK_MEMBLOCK_PROCFS is not set +# CONFIG_SOC_TI is not set + +# +# Xilinx SoC drivers +# +# CONFIG_XILINX_VCU is not set +# end of Xilinx SoC drivers +# end of SOC (System On Chip) specific Drivers + +CONFIG_PM_DEVFREQ=y + +# +# DEVFREQ Governors +# +CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y +CONFIG_DEVFREQ_GOV_PERFORMANCE=y +CONFIG_DEVFREQ_GOV_POWERSAVE=y +CONFIG_DEVFREQ_GOV_USERSPACE=y +# CONFIG_DEVFREQ_GOV_PASSIVE is not set + +# +# DEVFREQ Drivers +# +# CONFIG_ARM_RK3399_DMC_DEVFREQ is not set +# CONFIG_PM_DEVFREQ_EVENT is not set +CONFIG_EXTCON=y + +# +# Extcon Device Drivers +# +# CONFIG_EXTCON_ADC_JACK is not set +# CONFIG_EXTCON_FSA9480 is not set +# CONFIG_EXTCON_GPIO is not set +# CONFIG_EXTCON_MAX3355 is not set +# CONFIG_EXTCON_PTN5150 is not set +# CONFIG_EXTCON_RT8973A is not set +# CONFIG_EXTCON_SM5502 is not set +# CONFIG_EXTCON_USB_GPIO is not set +CONFIG_MEMORY=y +# CONFIG_ARM_PL172_MPMC is not set +CONFIG_IIO=y +CONFIG_IIO_BUFFER=y +# CONFIG_IIO_BUFFER_CB is not set +# CONFIG_IIO_BUFFER_DMA is not set +# CONFIG_IIO_BUFFER_DMAENGINE is not set +# CONFIG_IIO_BUFFER_HW_CONSUMER is not set +CONFIG_IIO_KFIFO_BUF=y +CONFIG_IIO_TRIGGERED_BUFFER=y +# CONFIG_IIO_CONFIGFS is not set +CONFIG_IIO_TRIGGER=y +CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 +# CONFIG_IIO_SW_DEVICE is not set +# CONFIG_IIO_SW_TRIGGER is not set +# CONFIG_IIO_TRIGGERED_EVENT is not set + +# +# Accelerometers +# +# CONFIG_ADIS16201 is not set +# CONFIG_ADIS16209 is not set +# CONFIG_ADXL345_I2C is not set +# CONFIG_ADXL345_SPI is not set +# CONFIG_ADXL372_SPI is not set +# CONFIG_ADXL372_I2C is not set +# CONFIG_BMA180 is not set +# CONFIG_BMA220 is not set +# CONFIG_BMA400 is not set +# CONFIG_BMC150_ACCEL is not set +# CONFIG_DA280 is not set +# CONFIG_DA311 is not set +# CONFIG_DMARD06 is not set +# CONFIG_DMARD09 is not set +# CONFIG_DMARD10 is not set +# CONFIG_IIO_ST_ACCEL_3AXIS is not set +# CONFIG_KXSD9 is not set +# CONFIG_KXCJK1013 is not set +# CONFIG_MC3230 is not set +# CONFIG_MMA7455_I2C is not set +# CONFIG_MMA7455_SPI is not set +# CONFIG_MMA7660 is not set +# CONFIG_MMA8452 is not set +# CONFIG_MMA9551 is not set +# CONFIG_MMA9553 is not set +# CONFIG_MXC4005 is not set +# CONFIG_MXC6255 is not set +# CONFIG_SCA3000 is not set +# CONFIG_STK8312 is not set +# CONFIG_STK8BA50 is not set +# end of Accelerometers + +# +# Analog to digital converters +# +# CONFIG_AD7091R5 is not set +# CONFIG_AD7124 is not set +# CONFIG_AD7192 is not set +# CONFIG_AD7266 is not set +# CONFIG_AD7291 is not set +# CONFIG_AD7292 is not set +# CONFIG_AD7298 is not set +# CONFIG_AD7476 is not set +# CONFIG_AD7606_IFACE_PARALLEL is not set +# CONFIG_AD7606_IFACE_SPI is not set +# CONFIG_AD7766 is not set +# CONFIG_AD7768_1 is not set +# CONFIG_AD7780 is not set +# CONFIG_AD7791 is not set +# CONFIG_AD7793 is not set +# CONFIG_AD7887 is not set +# CONFIG_AD7923 is not set +# CONFIG_AD7949 is not set +# CONFIG_AD799X is not set +# CONFIG_ADI_AXI_ADC is not set +# CONFIG_CC10001_ADC is not set +# CONFIG_ENVELOPE_DETECTOR is not set +# CONFIG_HI8435 is not set +# CONFIG_HX711 is not set +# CONFIG_INA2XX_ADC is not set +# CONFIG_LTC2471 is not set +# CONFIG_LTC2485 is not set +# CONFIG_LTC2496 is not set +# CONFIG_LTC2497 is not set +# CONFIG_MAX1027 is not set +# CONFIG_MAX11100 is not set +# CONFIG_MAX1118 is not set +# CONFIG_MAX1241 is not set +# CONFIG_MAX1363 is not set +# CONFIG_MAX9611 is not set +# CONFIG_MCP320X is not set +# CONFIG_MCP3422 is not set +# CONFIG_MCP3911 is not set +# CONFIG_NAU7802 is not set +CONFIG_ROCKCHIP_SARADC=y +# CONFIG_SD_ADC_MODULATOR is not set +# CONFIG_TI_ADC081C is not set +# CONFIG_TI_ADC0832 is not set +# CONFIG_TI_ADC084S021 is not set +# CONFIG_TI_ADC12138 is not set +# CONFIG_TI_ADC108S102 is not set +# CONFIG_TI_ADC128S052 is not set +# CONFIG_TI_ADC161S626 is not set +# CONFIG_TI_ADS1015 is not set +# CONFIG_TI_ADS7950 is not set +# CONFIG_TI_ADS8344 is not set +# CONFIG_TI_ADS8688 is not set +# CONFIG_TI_ADS124S08 is not set +# CONFIG_TI_TLC4541 is not set +# CONFIG_VF610_ADC is not set +# CONFIG_XILINX_XADC is not set +# end of Analog to digital converters + +# +# Analog Front Ends +# +# CONFIG_IIO_RESCALE is not set +# end of Analog Front Ends + +# +# Amplifiers +# +# CONFIG_AD8366 is not set +# CONFIG_HMC425 is not set +# end of Amplifiers + +# +# Chemical Sensors +# +# CONFIG_ATLAS_PH_SENSOR is not set +# CONFIG_ATLAS_EZO_SENSOR is not set +# CONFIG_BME680 is not set +# CONFIG_CCS811 is not set +# CONFIG_IAQCORE is not set +# CONFIG_SCD30_CORE is not set +# CONFIG_SENSIRION_SGP30 is not set +# CONFIG_SPS30 is not set +# CONFIG_VZ89X is not set +# end of Chemical Sensors + +# +# Hid Sensor IIO Common +# +# end of Hid Sensor IIO Common + +# +# SSP Sensor Common +# +# CONFIG_IIO_SSP_SENSORHUB is not set +# end of SSP Sensor Common + +# +# Digital to analog converters +# +# CONFIG_AD5064 is not set +# CONFIG_AD5360 is not set +# CONFIG_AD5380 is not set +# CONFIG_AD5421 is not set +# CONFIG_AD5446 is not set +# CONFIG_AD5449 is not set +# CONFIG_AD5592R is not set +# CONFIG_AD5593R is not set +# CONFIG_AD5504 is not set +# CONFIG_AD5624R_SPI is not set +# CONFIG_AD5686_SPI is not set +# CONFIG_AD5696_I2C is not set +# CONFIG_AD5755 is not set +# CONFIG_AD5758 is not set +# CONFIG_AD5761 is not set +# CONFIG_AD5764 is not set +# CONFIG_AD5770R is not set +# CONFIG_AD5791 is not set +# CONFIG_AD7303 is not set +# CONFIG_AD8801 is not set +# CONFIG_DPOT_DAC is not set +# CONFIG_DS4424 is not set +# CONFIG_LTC1660 is not set +# CONFIG_LTC2632 is not set +# CONFIG_M62332 is not set +# CONFIG_MAX517 is not set +# CONFIG_MAX5821 is not set +# CONFIG_MCP4725 is not set +# CONFIG_MCP4922 is not set +# CONFIG_TI_DAC082S085 is not set +# CONFIG_TI_DAC5571 is not set +# CONFIG_TI_DAC7311 is not set +# CONFIG_TI_DAC7612 is not set +# CONFIG_VF610_DAC is not set +# end of Digital to analog converters + +# +# IIO dummy driver +# +# end of IIO dummy driver + +# +# Frequency Synthesizers DDS/PLL +# + +# +# Clock Generator/Distribution +# +# CONFIG_AD9523 is not set +# end of Clock Generator/Distribution + +# +# Phase-Locked Loop (PLL) frequency synthesizers +# +# CONFIG_ADF4350 is not set +# CONFIG_ADF4371 is not set +# end of Phase-Locked Loop (PLL) frequency synthesizers +# end of Frequency Synthesizers DDS/PLL + +# +# Digital gyroscope sensors +# +# CONFIG_ADIS16080 is not set +# CONFIG_ADIS16130 is not set +# CONFIG_ADIS16136 is not set +# CONFIG_ADIS16260 is not set +# CONFIG_ADXRS290 is not set +# CONFIG_ADXRS450 is not set +# CONFIG_BMG160 is not set +# CONFIG_FXAS21002C is not set +# CONFIG_MPU3050_I2C is not set +# CONFIG_IIO_ST_GYRO_3AXIS is not set +# CONFIG_ITG3200 is not set +# end of Digital gyroscope sensors + +# +# Health Sensors +# + +# +# Heart Rate Monitors +# +# CONFIG_AFE4403 is not set +# CONFIG_AFE4404 is not set +# CONFIG_MAX30100 is not set +# CONFIG_MAX30102 is not set +# end of Heart Rate Monitors +# end of Health Sensors + +# +# Humidity sensors +# +# CONFIG_AM2315 is not set +# CONFIG_DHT11 is not set +# CONFIG_HDC100X is not set +# CONFIG_HDC2010 is not set +# CONFIG_HTS221 is not set +# CONFIG_HTU21 is not set +# CONFIG_SI7005 is not set +# CONFIG_SI7020 is not set +# end of Humidity sensors + +# +# Inertial measurement units +# +# CONFIG_ADIS16400 is not set +# CONFIG_ADIS16460 is not set +# CONFIG_ADIS16475 is not set +# CONFIG_ADIS16480 is not set +# CONFIG_BMI160_I2C is not set +# CONFIG_BMI160_SPI is not set +# CONFIG_FXOS8700_I2C is not set +# CONFIG_FXOS8700_SPI is not set +# CONFIG_KMX61 is not set +# CONFIG_INV_ICM42600_I2C is not set +# CONFIG_INV_ICM42600_SPI is not set +# CONFIG_INV_MPU6050_I2C is not set +# CONFIG_INV_MPU6050_SPI is not set +# CONFIG_IIO_ST_LSM6DSX is not set +# end of Inertial measurement units + +# +# Light sensors +# +# CONFIG_ADJD_S311 is not set +# CONFIG_ADUX1020 is not set +# CONFIG_AL3010 is not set +# CONFIG_AL3320A is not set +# CONFIG_APDS9300 is not set +# CONFIG_APDS9960 is not set +# CONFIG_AS73211 is not set +# CONFIG_BH1750 is not set +# CONFIG_BH1780 is not set +# CONFIG_CM32181 is not set +# CONFIG_CM3232 is not set +# CONFIG_CM3323 is not set +# CONFIG_CM3605 is not set +# CONFIG_CM36651 is not set +# CONFIG_GP2AP002 is not set +# CONFIG_GP2AP020A00F is not set +CONFIG_SENSORS_ISL29018=y +# CONFIG_SENSORS_ISL29028 is not set +# CONFIG_ISL29125 is not set +# CONFIG_JSA1212 is not set +# CONFIG_RPR0521 is not set +# CONFIG_LTR501 is not set +# CONFIG_LV0104CS is not set +# CONFIG_MAX44000 is not set +# CONFIG_MAX44009 is not set +# CONFIG_NOA1305 is not set +# CONFIG_OPT3001 is not set +# CONFIG_PA12203001 is not set +# CONFIG_SI1133 is not set +# CONFIG_SI1145 is not set +# CONFIG_STK3310 is not set +# CONFIG_ST_UVIS25 is not set +# CONFIG_TCS3414 is not set +# CONFIG_TCS3472 is not set +CONFIG_SENSORS_TSL2563=y +CONFIG_TSL2583=y +# CONFIG_TSL2772 is not set +# CONFIG_TSL4531 is not set +# CONFIG_US5182D is not set +# CONFIG_VCNL4000 is not set +# CONFIG_VCNL4035 is not set +# CONFIG_VEML6030 is not set +# CONFIG_VEML6070 is not set +# CONFIG_VL6180 is not set +# CONFIG_ZOPT2201 is not set +# end of Light sensors + +# +# Magnetometer sensors +# +# CONFIG_AK8974 is not set +# CONFIG_AK8975 is not set +# CONFIG_AK09911 is not set +# CONFIG_BMC150_MAGN_I2C is not set +# CONFIG_BMC150_MAGN_SPI is not set +# CONFIG_MAG3110 is not set +# CONFIG_MMC35240 is not set +# CONFIG_IIO_ST_MAGN_3AXIS is not set +# CONFIG_SENSORS_HMC5843_I2C is not set +# CONFIG_SENSORS_HMC5843_SPI is not set +# CONFIG_SENSORS_RM3100_I2C is not set +# CONFIG_SENSORS_RM3100_SPI is not set +# end of Magnetometer sensors + +# +# Multiplexers +# +# CONFIG_IIO_MUX is not set +# end of Multiplexers + +# +# Inclinometer sensors +# +# end of Inclinometer sensors + +# +# Triggers - standalone +# +# CONFIG_IIO_INTERRUPT_TRIGGER is not set +CONFIG_IIO_SYSFS_TRIGGER=y +# end of Triggers - standalone + +# +# Linear and angular position sensors +# +# end of Linear and angular position sensors + +# +# Digital potentiometers +# +# CONFIG_AD5272 is not set +# CONFIG_DS1803 is not set +# CONFIG_MAX5432 is not set +# CONFIG_MAX5481 is not set +# CONFIG_MAX5487 is not set +# CONFIG_MCP4018 is not set +# CONFIG_MCP4131 is not set +# CONFIG_MCP4531 is not set +# CONFIG_MCP41010 is not set +# CONFIG_TPL0102 is not set +# end of Digital potentiometers + +# +# Digital potentiostats +# +# CONFIG_LMP91000 is not set +# end of Digital potentiostats + +# +# Pressure sensors +# +# CONFIG_ABP060MG is not set +# CONFIG_BMP280 is not set +# CONFIG_DLHL60D is not set +# CONFIG_DPS310 is not set +# CONFIG_HP03 is not set +# CONFIG_ICP10100 is not set +# CONFIG_MPL115_I2C is not set +# CONFIG_MPL115_SPI is not set +# CONFIG_MPL3115 is not set +# CONFIG_MS5611 is not set +# CONFIG_MS5637 is not set +# CONFIG_IIO_ST_PRESS is not set +# CONFIG_T5403 is not set +# CONFIG_HP206C is not set +# CONFIG_ZPA2326 is not set +# end of Pressure sensors + +# +# Lightning sensors +# +# CONFIG_AS3935 is not set +# end of Lightning sensors + +# +# Proximity and distance sensors +# +# CONFIG_ISL29501 is not set +# CONFIG_LIDAR_LITE_V2 is not set +# CONFIG_MB1232 is not set +# CONFIG_PING is not set +# CONFIG_RFD77402 is not set +# CONFIG_SRF04 is not set +# CONFIG_SX9310 is not set +# CONFIG_SX9500 is not set +# CONFIG_SRF08 is not set +# CONFIG_VCNL3020 is not set +# CONFIG_VL53L0X_I2C is not set +# end of Proximity and distance sensors + +# +# Resolver to digital converters +# +# CONFIG_AD2S90 is not set +# CONFIG_AD2S1200 is not set +# end of Resolver to digital converters + +# +# Temperature sensors +# +# CONFIG_LTC2983 is not set +# CONFIG_MAXIM_THERMOCOUPLE is not set +# CONFIG_MLX90614 is not set +# CONFIG_MLX90632 is not set +# CONFIG_TMP006 is not set +# CONFIG_TMP007 is not set +# CONFIG_TSYS01 is not set +# CONFIG_TSYS02D is not set +# CONFIG_MAX31856 is not set +# end of Temperature sensors + +# CONFIG_NTB is not set +# CONFIG_VME_BUS is not set +CONFIG_PWM=y +CONFIG_PWM_SYSFS=y +# CONFIG_PWM_DEBUG is not set +# CONFIG_PWM_FSL_FTM is not set +# CONFIG_PWM_PCA9685 is not set +CONFIG_PWM_ROCKCHIP=y + +# +# IRQ chip support +# +CONFIG_IRQCHIP=y +CONFIG_ARM_GIC=y +CONFIG_ARM_GIC_MAX_NR=1 +CONFIG_ARM_GIC_V2M=y +CONFIG_ARM_GIC_V3=y +CONFIG_ARM_GIC_V3_ITS=y +CONFIG_ARM_GIC_V3_ITS_PCI=y +# CONFIG_AL_FIC is not set +CONFIG_PARTITION_PERCPU=y +# end of IRQ chip support + +# CONFIG_IPACK_BUS is not set +CONFIG_ARCH_HAS_RESET_CONTROLLER=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RESET_SCMI=y +# CONFIG_RESET_TI_SYSCON is not set + +# +# PHY Subsystem +# +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PHY_MIPI_DPHY=y +# CONFIG_PHY_XGENE is not set +# CONFIG_BCM_KONA_USB2_PHY is not set +# CONFIG_PHY_CADENCE_TORRENT is not set +# CONFIG_PHY_CADENCE_DPHY is not set +# CONFIG_PHY_CADENCE_SIERRA is not set +# CONFIG_PHY_CADENCE_SALVO is not set +# CONFIG_PHY_FSL_IMX8MQ_USB is not set +# CONFIG_PHY_MIXEL_MIPI_DPHY is not set +# CONFIG_PHY_PXA_28NM_HSIC is not set +# CONFIG_PHY_PXA_28NM_USB2 is not set +# CONFIG_PHY_CPCAP_USB is not set +# CONFIG_PHY_MAPPHONE_MDM6600 is not set +# CONFIG_PHY_OCELOT_SERDES is not set +# CONFIG_PHY_ROCKCHIP_CSI2_DPHY is not set +# CONFIG_PHY_ROCKCHIP_DP is not set +# CONFIG_PHY_ROCKCHIP_DPHY_RX0 is not set +CONFIG_PHY_ROCKCHIP_EMMC=y +# CONFIG_PHY_ROCKCHIP_INNO_COMBPHY is not set +# CONFIG_PHY_ROCKCHIP_INNO_HDMI is not set +CONFIG_PHY_ROCKCHIP_INNO_USB2=y +CONFIG_PHY_ROCKCHIP_INNO_USB3=y +# CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY is not set +# CONFIG_PHY_ROCKCHIP_MIPI_RX is not set +# CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY is not set +# CONFIG_PHY_ROCKCHIP_NANENG_EDP is not set +# CONFIG_PHY_ROCKCHIP_NANENG_USB2 is not set +CONFIG_PHY_ROCKCHIP_PCIE=y +# CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY is not set +# CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX is not set +# CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX_HDMI is not set +CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=y +CONFIG_PHY_ROCKCHIP_TYPEC=y +CONFIG_PHY_ROCKCHIP_USB=y +# CONFIG_PHY_ROCKCHIP_USBDP is not set +# CONFIG_PHY_SAMSUNG_USB2 is not set +# end of PHY Subsystem + +# CONFIG_POWERCAP is not set +# CONFIG_MCB is not set + +# +# Performance monitor support +# +# CONFIG_ARM_CCI_PMU is not set +# CONFIG_ARM_CCN is not set +# CONFIG_ARM_CMN is not set +CONFIG_ARM_PMU=y +# CONFIG_ARM_DSU_PMU is not set +# CONFIG_ARM_SPE_PMU is not set +# CONFIG_HISI_PCIE_PMU is not set +# end of Performance monitor support + +# CONFIG_RAS is not set +# CONFIG_USB4 is not set + +# +# Android +# +CONFIG_ANDROID=y +# CONFIG_ANDROID_BINDER_IPC is not set +# end of Android + +# +# Vendor Hooks +# +# CONFIG_VENDOR_HOOKS is not set +# end of Vendor Hooks + +# CONFIG_LIBNVDIMM is not set +# CONFIG_DAX is not set +CONFIG_NVMEM=y +CONFIG_NVMEM_SYSFS=y +CONFIG_ROCKCHIP_EFUSE=y +CONFIG_ROCKCHIP_OTP=y + +# +# HW tracing support +# +# CONFIG_STM is not set +# CONFIG_INTEL_TH is not set +# end of HW tracing support + +# CONFIG_FPGA is not set +# CONFIG_FSI is not set +CONFIG_TEE=y + +# +# TEE drivers +# +CONFIG_OPTEE=y +CONFIG_OPTEE_SHM_NUM_PRIV_PAGES=1 +# end of TEE drivers + +CONFIG_PM_OPP=y +# CONFIG_SIOX is not set +# CONFIG_SLIMBUS is not set +# CONFIG_INTERCONNECT is not set +# CONFIG_COUNTER is not set +# CONFIG_MOST is not set +# end of Device Drivers + +# +# File systems +# +CONFIG_DCACHE_WORD_ACCESS=y +# CONFIG_VALIDATE_FS_PARSER is not set +CONFIG_FS_IOMAP=y +# CONFIG_EXT2_FS is not set +# CONFIG_EXT3_FS is not set +CONFIG_EXT4_FS=y +CONFIG_EXT4_USE_FOR_EXT2=y +CONFIG_EXT4_FS_POSIX_ACL=y +CONFIG_EXT4_FS_SECURITY=y +# CONFIG_EXT4_DEBUG is not set +CONFIG_JBD2=y +# CONFIG_JBD2_DEBUG is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +CONFIG_XFS_FS=y +CONFIG_XFS_SUPPORT_V4=y +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_POSIX_ACL is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_ONLINE_SCRUB is not set +# CONFIG_XFS_WARN is not set +# CONFIG_XFS_DEBUG is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_NILFS2_FS is not set +# CONFIG_F2FS_FS is not set +# CONFIG_FS_DAX is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_EXPORTFS=y +# CONFIG_EXPORTFS_BLOCK_OPS is not set +CONFIG_FILE_LOCKING=y +CONFIG_MANDATORY_FILE_LOCKING=y +# CONFIG_FS_ENCRYPTION is not set +# CONFIG_FS_VERITY is not set +CONFIG_FSNOTIFY=y +# CONFIG_DNOTIFY is not set +CONFIG_INOTIFY_USER=y +# CONFIG_FANOTIFY is not set +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_AUTOFS_FS is not set +CONFIG_FUSE_FS=y +# CONFIG_CUSE is not set +# CONFIG_VIRTIO_FS is not set +# CONFIG_OVERLAY_FS is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set +# end of Caches + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +# CONFIG_UDF_FS is not set +# end of CD-ROM/DVD Filesystems + +# +# DOS/FAT/EXFAT/NT Filesystems +# +CONFIG_FAT_FS=y +# CONFIG_MSDOS_FS is not set +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=936 +CONFIG_FAT_DEFAULT_IOCHARSET="utf8" +# CONFIG_FAT_DEFAULT_UTF8 is not set +# CONFIG_EXFAT_FS is not set +CONFIG_NTFS_FS=y +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set +# CONFIG_NTFS3_FS is not set +# end of DOS/FAT/EXFAT/NT Filesystems + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +# CONFIG_PROC_KCORE is not set +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +# CONFIG_PROC_CHILDREN is not set +CONFIG_KERNFS=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_TMPFS_XATTR=y +# CONFIG_TMPFS_INODE64 is not set +# CONFIG_HUGETLBFS is not set +CONFIG_ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y +CONFIG_MEMFD_CREATE=y +CONFIG_ARCH_HAS_GIGANTIC_PAGE=y +CONFIG_CONFIGFS_FS=y +# end of Pseudo filesystems + +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ORANGEFS_FS is not set +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_ECRYPT_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_FS_XATTR is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_RTIME=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +CONFIG_UBIFS_FS_ZSTD=y +# CONFIG_UBIFS_ATIME_SUPPORT is not set +CONFIG_UBIFS_FS_XATTR=y +CONFIG_UBIFS_FS_SECURITY=y +# CONFIG_UBIFS_FS_AUTHENTICATION is not set +# CONFIG_CRAMFS is not set +CONFIG_SQUASHFS=y +CONFIG_SQUASHFS_FILE_CACHE=y +# CONFIG_SQUASHFS_FILE_DIRECT is not set +CONFIG_SQUASHFS_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_DECOMP_MULTI is not set +# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set +# CONFIG_SQUASHFS_XATTR is not set +CONFIG_SQUASHFS_ZLIB=y +# CONFIG_SQUASHFS_LZ4 is not set +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_XZ is not set +# CONFIG_SQUASHFS_ZSTD is not set +# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_VXFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX6FS_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_PSTORE=y +CONFIG_PSTORE_DEFLATE_COMPRESS=y +# CONFIG_PSTORE_LZO_COMPRESS is not set +# CONFIG_PSTORE_LZ4_COMPRESS is not set +# CONFIG_PSTORE_LZ4HC_COMPRESS is not set +# CONFIG_PSTORE_842_COMPRESS is not set +# CONFIG_PSTORE_ZSTD_COMPRESS is not set +CONFIG_PSTORE_COMPRESS=y +CONFIG_PSTORE_DEFLATE_COMPRESS_DEFAULT=y +CONFIG_PSTORE_COMPRESS_DEFAULT="deflate" +CONFIG_PSTORE_CONSOLE=y +# CONFIG_PSTORE_PMSG is not set +# CONFIG_PSTORE_FTRACE is not set +CONFIG_PSTORE_RAM=y +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set +# CONFIG_EROFS_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V2=y +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFS_SWAP=y +# CONFIG_NFS_V4_1 is not set +# CONFIG_NFS_USE_LEGACY_DNS is not set +CONFIG_NFS_USE_KERNEL_DNS=y +CONFIG_NFS_DISABLE_UDP_SUPPORT=y +# CONFIG_NFSD is not set +CONFIG_GRACE_PERIOD=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_SUNRPC_SWAP=y +# CONFIG_SUNRPC_DEBUG is not set +# CONFIG_CEPH_FS is not set +# CONFIG_CIFS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="utf8" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +CONFIG_NLS_CODEPAGE_936=y +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_MAC_ROMAN is not set +# CONFIG_NLS_MAC_CELTIC is not set +# CONFIG_NLS_MAC_CENTEURO is not set +# CONFIG_NLS_MAC_CROATIAN is not set +# CONFIG_NLS_MAC_CYRILLIC is not set +# CONFIG_NLS_MAC_GAELIC is not set +# CONFIG_NLS_MAC_GREEK is not set +# CONFIG_NLS_MAC_ICELAND is not set +# CONFIG_NLS_MAC_INUIT is not set +# CONFIG_NLS_MAC_ROMANIAN is not set +# CONFIG_NLS_MAC_TURKISH is not set +CONFIG_NLS_UTF8=y +# CONFIG_DLM is not set +CONFIG_UNICODE=y +# CONFIG_UNICODE_NORMALIZATION_SELFTEST is not set +CONFIG_IO_WQ=y +# end of File systems + +# +# Security options +# +CONFIG_KEYS=y +# CONFIG_KEYS_REQUEST_CACHE is not set +# CONFIG_PERSISTENT_KEYRINGS is not set +# CONFIG_TRUSTED_KEYS is not set +# CONFIG_ENCRYPTED_KEYS is not set +# CONFIG_KEY_DH_OPERATIONS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +# CONFIG_SECURITY is not set +CONFIG_SECURITYFS=y +CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y +# CONFIG_HARDENED_USERCOPY is not set +# CONFIG_FORTIFY_SOURCE is not set +# CONFIG_STATIC_USERMODEHELPER is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_LSM="lockdown,yama,loadpin,safesetid,integrity,bpf" + +# +# Kernel hardening options +# + +# +# Memory initialization +# +CONFIG_INIT_STACK_NONE=y +# CONFIG_GCC_PLUGIN_STRUCTLEAK_USER is not set +# CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF is not set +# CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL is not set +# CONFIG_GCC_PLUGIN_STACKLEAK is not set +# CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set +# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set +# end of Memory initialization +# end of Kernel hardening options + +# CONFIG_SECURITY_BOOT_INIT is not set +# end of Security options + +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_SKCIPHER=y +CONFIG_CRYPTO_SKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_AKCIPHER2=y +CONFIG_CRYPTO_AKCIPHER=y +CONFIG_CRYPTO_KPP2=y +CONFIG_CRYPTO_KPP=y +CONFIG_CRYPTO_ACOMP2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +# CONFIG_CRYPTO_USER is not set +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +CONFIG_CRYPTO_GF128MUL=y +CONFIG_CRYPTO_NULL=y +CONFIG_CRYPTO_NULL2=y +# CONFIG_CRYPTO_PCRYPT is not set +CONFIG_CRYPTO_CRYPTD=y +# CONFIG_CRYPTO_AUTHENC is not set +# CONFIG_CRYPTO_TEST is not set +CONFIG_CRYPTO_SIMD=y + +# +# Public-key cryptography +# +CONFIG_CRYPTO_RSA=y +# CONFIG_CRYPTO_DH is not set +CONFIG_CRYPTO_ECC=y +CONFIG_CRYPTO_ECDH=y +# CONFIG_CRYPTO_ECDSA is not set +# CONFIG_CRYPTO_ECRDSA is not set +# CONFIG_CRYPTO_SM2 is not set +# CONFIG_CRYPTO_CURVE25519 is not set + +# +# Authenticated Encryption with Associated Data +# +CONFIG_CRYPTO_CCM=y +CONFIG_CRYPTO_GCM=y +# CONFIG_CRYPTO_CHACHA20POLY1305 is not set +# CONFIG_CRYPTO_AEGIS128 is not set +# CONFIG_CRYPTO_SEQIV is not set +# CONFIG_CRYPTO_ECHAINIV is not set + +# +# Block modes +# +# CONFIG_CRYPTO_CBC is not set +# CONFIG_CRYPTO_CFB is not set +CONFIG_CRYPTO_CTR=y +# CONFIG_CRYPTO_CTS is not set +CONFIG_CRYPTO_ECB=y +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_OFB is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_XTS is not set +# CONFIG_CRYPTO_KEYWRAP is not set +# CONFIG_CRYPTO_ADIANTUM is not set +# CONFIG_CRYPTO_ESSIV is not set + +# +# Hash modes +# +CONFIG_CRYPTO_CMAC=y +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_VMAC is not set + +# +# Digest +# +CONFIG_CRYPTO_CRC32C=y +# CONFIG_CRYPTO_CRC32 is not set +# CONFIG_CRYPTO_XXHASH is not set +# CONFIG_CRYPTO_BLAKE2B is not set +# CONFIG_CRYPTO_BLAKE2S is not set +CONFIG_CRYPTO_CRCT10DIF=y +CONFIG_CRYPTO_GHASH=y +# CONFIG_CRYPTO_POLY1305 is not set +# CONFIG_CRYPTO_MD4 is not set +CONFIG_CRYPTO_MD5=y +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +CONFIG_CRYPTO_SHA1=y +CONFIG_CRYPTO_SHA256=y +CONFIG_CRYPTO_SHA512=y +# CONFIG_CRYPTO_SHA3 is not set +# CONFIG_CRYPTO_SM3_GENERIC is not set +# CONFIG_CRYPTO_STREEBOG is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_WP512 is not set + +# +# Ciphers +# +CONFIG_CRYPTO_AES=y +# CONFIG_CRYPTO_AES_TI is not set +# CONFIG_CRYPTO_ANUBIS is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_CHACHA20 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_SM4_GENERIC is not set +# CONFIG_CRYPTO_TEA is not set +CONFIG_CRYPTO_TWOFISH=y +CONFIG_CRYPTO_TWOFISH_COMMON=y + +# +# Compression +# +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_LZO=y +# CONFIG_CRYPTO_842 is not set +# CONFIG_CRYPTO_LZ4 is not set +# CONFIG_CRYPTO_LZ4HC is not set +CONFIG_CRYPTO_ZSTD=y + +# +# Random Number Generation +# +CONFIG_CRYPTO_ANSI_CPRNG=y +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_DRBG_HMAC=y +# CONFIG_CRYPTO_DRBG_HASH is not set +# CONFIG_CRYPTO_DRBG_CTR is not set +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_JITTERENTROPY=y +CONFIG_CRYPTO_USER_API=y +CONFIG_CRYPTO_USER_API_HASH=y +CONFIG_CRYPTO_USER_API_SKCIPHER=y +# CONFIG_CRYPTO_USER_API_RNG is not set +# CONFIG_CRYPTO_USER_API_AEAD is not set +CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y +CONFIG_CRYPTO_HASH_INFO=y + +# +# Crypto library routines +# +CONFIG_CRYPTO_LIB_AES=y +CONFIG_CRYPTO_LIB_ARC4=y +# CONFIG_CRYPTO_LIB_BLAKE2S is not set +# CONFIG_CRYPTO_LIB_CHACHA is not set +# CONFIG_CRYPTO_LIB_CURVE25519 is not set +CONFIG_CRYPTO_LIB_DES=y +CONFIG_CRYPTO_LIB_POLY1305_RSIZE=9 +# CONFIG_CRYPTO_LIB_POLY1305 is not set +# CONFIG_CRYPTO_LIB_CHACHA20POLY1305 is not set +CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_HW=y +# CONFIG_CRYPTO_DEV_ATMEL_ECC is not set +# CONFIG_CRYPTO_DEV_ATMEL_SHA204A is not set +# CONFIG_CRYPTO_DEV_CCP is not set +# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set +# CONFIG_CRYPTO_DEV_CAVIUM_ZIP is not set +CONFIG_CRYPTO_DEV_ROCKCHIP=y +# CONFIG_CRYPTO_DEV_SAFEXCEL is not set +# CONFIG_CRYPTO_DEV_CCREE is not set +# CONFIG_CRYPTO_DEV_HISI_SEC is not set +# CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set +CONFIG_ASYMMETRIC_KEY_TYPE=y +CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y +CONFIG_X509_CERTIFICATE_PARSER=y +# CONFIG_PKCS8_PRIVATE_KEY_PARSER is not set +CONFIG_PKCS7_MESSAGE_PARSER=y +# CONFIG_PKCS7_TEST_KEY is not set +# CONFIG_SIGNED_PE_FILE_VERIFICATION is not set +# CONFIG_PGP_LIBRARY is not set +# CONFIG_PGP_KEY_PARSER is not set +# CONFIG_PGP_PRELOAD is not set + +# +# Certificates for signature checking +# +CONFIG_SYSTEM_TRUSTED_KEYRING=y +CONFIG_SYSTEM_TRUSTED_KEYS="" +# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set +# CONFIG_SECONDARY_TRUSTED_KEYRING is not set +# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set +# CONFIG_PGP_PRELOAD_PUBLIC_KEYS is not set +# end of Certificates for signature checking + +CONFIG_BINARY_PRINTF=y + +# +# Library routines +# +CONFIG_LINEAR_RANGES=y +# CONFIG_PACKING is not set +CONFIG_BITREVERSE=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_NET_UTILS=y +# CONFIG_CORDIC is not set +# CONFIG_PRIME_NUMBERS is not set +CONFIG_RATIONAL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_HAS_FAST_MULTIPLIER=y +CONFIG_ARCH_USE_SYM_ANNOTATIONS=y +# CONFIG_INDIRECT_PIO is not set +CONFIG_CRC_CCITT=y +CONFIG_CRC16=y +CONFIG_CRC_T10DIF=y +CONFIG_CRC_ITU_T=y +CONFIG_CRC32=y +# CONFIG_CRC32_SELFTEST is not set +CONFIG_CRC32_SLICEBY8=y +# CONFIG_CRC32_SLICEBY4 is not set +# CONFIG_CRC32_SARWATE is not set +# CONFIG_CRC32_BIT is not set +# CONFIG_CRC64 is not set +# CONFIG_CRC4 is not set +CONFIG_CRC7=y +CONFIG_LIBCRC32C=y +# CONFIG_CRC8 is not set +CONFIG_XXHASH=y +CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y +# CONFIG_RANDOM32_SELFTEST is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_LZ4_DECOMPRESS=y +CONFIG_ZSTD_COMPRESS=y +CONFIG_ZSTD_DECOMPRESS=y +CONFIG_XZ_DEC=y +# CONFIG_XZ_DEC_X86 is not set +# CONFIG_XZ_DEC_POWERPC is not set +# CONFIG_XZ_DEC_IA64 is not set +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_ARMTHUMB=y +# CONFIG_XZ_DEC_SPARC is not set +CONFIG_XZ_DEC_BCJ=y +# CONFIG_XZ_DEC_TEST is not set +CONFIG_DECOMPRESS_GZIP=y +CONFIG_DECOMPRESS_BZIP2=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DECOMPRESS_XZ=y +CONFIG_DECOMPRESS_LZO=y +CONFIG_DECOMPRESS_LZ4=y +CONFIG_DECOMPRESS_ZSTD=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_REED_SOLOMON=y +CONFIG_REED_SOLOMON_ENC8=y +CONFIG_REED_SOLOMON_DEC8=y +CONFIG_ASSOCIATIVE_ARRAY=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAS_DMA=y +CONFIG_DMA_OPS=y +CONFIG_NEED_SG_DMA_LENGTH=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_DMA_DECLARE_COHERENT=y +CONFIG_ARCH_HAS_SETUP_DMA_OPS=y +CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y +CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y +CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y +CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y +CONFIG_SWIOTLB=y +CONFIG_DMA_NONCOHERENT_MMAP=y +CONFIG_DMA_COHERENT_POOL=y +CONFIG_DMA_REMAP=y +CONFIG_DMA_DIRECT_REMAP=y +CONFIG_DMA_CMA=y +# CONFIG_DMA_PERNUMA_CMA is not set + +# +# Default contiguous memory area size: +# +CONFIG_CMA_SIZE_MBYTES=16 +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_ALIGNMENT=8 +# CONFIG_DMA_API_DEBUG is not set +CONFIG_SGL_ALLOC=y +CONFIG_CPU_RMAP=y +CONFIG_DQL=y +CONFIG_GLOB=y +# CONFIG_GLOB_SELFTEST is not set +CONFIG_NLATTR=y +CONFIG_CLZ_TAB=y +# CONFIG_IRQ_POLL is not set +CONFIG_MPILIB=y +CONFIG_LIBFDT=y +CONFIG_OID_REGISTRY=y +CONFIG_HAVE_GENERIC_VDSO=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_VDSO_TIME_NS=y +CONFIG_FONT_SUPPORT=y +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_SG_POOL=y +CONFIG_ARCH_STACKWALK=y +CONFIG_SBITMAP=y +# CONFIG_STRING_SELFTEST is not set +# end of Library routines + +# +# Kernel hacking +# + +# +# printk and dmesg options +# +CONFIG_PRINTK_TIME=y +# CONFIG_PRINTK_CALLER is not set +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 +CONFIG_CONSOLE_LOGLEVEL_QUIET=4 +CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 +# CONFIG_BOOT_PRINTK_DELAY is not set +CONFIG_DYNAMIC_DEBUG=y +CONFIG_DYNAMIC_DEBUG_CORE=y +CONFIG_SYMBOLIC_ERRNAME=y +CONFIG_DEBUG_BUGVERBOSE=y +# end of printk and dmesg options + +# +# Compile-time checks and compiler options +# +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_INFO_REDUCED is not set +# CONFIG_DEBUG_INFO_COMPRESSED is not set +# CONFIG_DEBUG_INFO_SPLIT is not set +# CONFIG_DEBUG_INFO_DWARF4 is not set +# CONFIG_DEBUG_INFO_BTF is not set +# CONFIG_GDB_SCRIPTS is not set +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=2048 +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_READABLE_ASM is not set +# CONFIG_HEADERS_INSTALL is not set +# CONFIG_OPTIMIZE_INLINING is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +CONFIG_SECTION_MISMATCH_WARN_ONLY=y +# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_32B is not set +CONFIG_ARCH_WANT_FRAME_POINTERS=y +CONFIG_FRAME_POINTER=y +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# end of Compile-time checks and compiler options + +# +# Generic Kernel Debugging Instruments +# +CONFIG_MAGIC_SYSRQ=y +CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0 +CONFIG_MAGIC_SYSRQ_SERIAL=y +CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE="" +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_FS_ALLOW_ALL=y +# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set +# CONFIG_DEBUG_FS_ALLOW_NONE is not set +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y +# CONFIG_UBSAN is not set +# end of Generic Kernel Debugging Instruments + +CONFIG_DEBUG_KERNEL=y +CONFIG_DEBUG_MISC=y + +# +# Memory Debugging +# +# CONFIG_PAGE_EXTENSION is not set +# CONFIG_DEBUG_PAGEALLOC is not set +# CONFIG_PAGE_OWNER is not set +# CONFIG_PAGE_TABLE_CHECK is not set +# CONFIG_PAGE_POISONING is not set +# CONFIG_DEBUG_PAGE_REF is not set +# CONFIG_DEBUG_RODATA_TEST is not set +CONFIG_ARCH_HAS_DEBUG_WX=y +# CONFIG_DEBUG_WX is not set +CONFIG_GENERIC_PTDUMP=y +# CONFIG_PTDUMP_DEBUGFS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_SLUB_STATS is not set +CONFIG_HAVE_DEBUG_KMEMLEAK=y +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_SCHED_STACK_END_CHECK is not set +CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_VM_PGTABLE is not set +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y +# CONFIG_DEBUG_VIRTUAL is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +CONFIG_HAVE_ARCH_KASAN=y +CONFIG_HAVE_ARCH_KASAN_SW_TAGS=y +CONFIG_HAVE_ARCH_KASAN_VMALLOC=y +CONFIG_CC_HAS_KASAN_GENERIC=y +CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y +# CONFIG_KASAN is not set +CONFIG_HAVE_ARCH_KFENCE=y +# CONFIG_KFENCE is not set +# end of Memory Debugging + +# CONFIG_DEBUG_SHIRQ is not set + +# +# Debug Oops, Lockups and Hangs +# +# CONFIG_PANIC_ON_OOPS is not set +CONFIG_PANIC_ON_OOPS_VALUE=0 +CONFIG_PANIC_TIMEOUT=0 +# CONFIG_SOFTLOCKUP_DETECTOR is not set + +# +# ARM64 NMI watchdog configuration +# +# end of ARM64 NMI watchdog configuration + +# CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_WQ_WATCHDOG is not set +# CONFIG_TEST_LOCKUP is not set +# end of Debug Oops, Lockups and Hangs + +# +# Scheduler Debugging +# +CONFIG_SCHED_DEBUG=y +CONFIG_SCHED_INFO=y +CONFIG_SCHEDSTATS=y +# end of Scheduler Debugging + +# CONFIG_DEBUG_TIMEKEEPING is not set + +# +# Lock Debugging (spinlocks, mutexes, etc...) +# +CONFIG_LOCK_DEBUGGING_SUPPORT=y +# CONFIG_PROVE_LOCKING is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +CONFIG_DEBUG_SPINLOCK=y +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set +# CONFIG_DEBUG_RWSEMS is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_LOCK_TORTURE_TEST is not set +# CONFIG_WW_MUTEX_SELFTEST is not set +# CONFIG_SCF_TORTURE_TEST is not set +# CONFIG_CSD_LOCK_WAIT_DEBUG is not set +# end of Lock Debugging (spinlocks, mutexes, etc...) + +CONFIG_STACKTRACE=y +# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_HAVE_DEBUG_BUGVERBOSE=y + +# +# Debug kernel data structures +# +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_PLIST is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_BUG_ON_DATA_CORRUPTION is not set +# end of Debug kernel data structures + +CONFIG_DEBUG_CREDENTIALS=y + +# +# RCU Debugging +# +# CONFIG_RCU_SCALE_TEST is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_RCU_REF_SCALE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +CONFIG_RCU_TRACE=y +# CONFIG_RCU_EQS_DEBUG is not set +# end of RCU Debugging + +# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set +# CONFIG_LATENCYTOP is not set +CONFIG_NOP_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_TRACE_CLOCK=y +CONFIG_RING_BUFFER=y +CONFIG_EVENT_TRACING=y +CONFIG_CONTEXT_SWITCH_TRACER=y +CONFIG_TRACING=y +CONFIG_GENERIC_TRACER=y +CONFIG_TRACING_SUPPORT=y +CONFIG_FTRACE=y +# CONFIG_BOOTTIME_TRACING is not set +CONFIG_FUNCTION_TRACER=y +CONFIG_FUNCTION_GRAPH_TRACER=y +CONFIG_DYNAMIC_FTRACE=y +CONFIG_DYNAMIC_FTRACE_WITH_REGS=y +# CONFIG_FUNCTION_PROFILER is not set +# CONFIG_STACK_TRACER is not set +# CONFIG_IRQSOFF_TRACER is not set +# CONFIG_SCHED_TRACER is not set +# CONFIG_HWLAT_TRACER is not set +# CONFIG_OSNOISE_TRACER is not set +# CONFIG_TIMERLAT_TRACER is not set +# CONFIG_FTRACE_SYSCALLS is not set +# CONFIG_TRACER_SNAPSHOT is not set +CONFIG_BRANCH_PROFILE_NONE=y +# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set +# CONFIG_PROFILE_ALL_BRANCHES is not set +CONFIG_BLK_DEV_IO_TRACE=y +CONFIG_UPROBE_EVENTS=y +CONFIG_DYNAMIC_EVENTS=y +CONFIG_PROBE_EVENTS=y +CONFIG_FTRACE_MCOUNT_RECORD=y +# CONFIG_SYNTH_EVENTS is not set +# CONFIG_HIST_TRIGGERS is not set +# CONFIG_TRACE_EVENT_INJECT is not set +# CONFIG_TRACEPOINT_BENCHMARK is not set +# CONFIG_RING_BUFFER_BENCHMARK is not set +# CONFIG_TRACE_EVAL_MAP_FILE is not set +# CONFIG_FTRACE_STARTUP_TEST is not set +# CONFIG_RING_BUFFER_STARTUP_TEST is not set +# CONFIG_PREEMPTIRQ_DELAY_TEST is not set +# CONFIG_SAMPLES is not set +CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y +CONFIG_STRICT_DEVMEM=y +# CONFIG_IO_STRICT_DEVMEM is not set + +# +# arm64 Debugging +# +# CONFIG_PID_IN_CONTEXTIDR is not set +# CONFIG_ARM64_RELOC_TEST is not set +# CONFIG_CORESIGHT is not set +# end of arm64 Debugging + +# +# Kernel Testing and Coverage +# +# CONFIG_KUNIT is not set +# CONFIG_NOTIFIER_ERROR_INJECTION is not set +# CONFIG_FAULT_INJECTION is not set +CONFIG_ARCH_HAS_KCOV=y +CONFIG_CC_HAS_SANCOV_TRACE_PC=y +# CONFIG_KCOV is not set +CONFIG_RUNTIME_TESTING_MENU=y +CONFIG_LKDTM=y +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_TEST_MIN_HEAP is not set +# CONFIG_TEST_SORT is not set +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_RBTREE_TEST is not set +# CONFIG_REED_SOLOMON_TEST is not set +# CONFIG_INTERVAL_TREE_TEST is not set +# CONFIG_PERCPU_TEST is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_TEST_HEXDUMP is not set +# CONFIG_TEST_STRING_HELPERS is not set +# CONFIG_TEST_STRSCPY is not set +# CONFIG_TEST_KSTRTOX is not set +# CONFIG_TEST_PRINTF is not set +# CONFIG_TEST_BITMAP is not set +# CONFIG_TEST_UUID is not set +# CONFIG_TEST_XARRAY is not set +# CONFIG_TEST_OVERFLOW is not set +# CONFIG_TEST_RHASHTABLE is not set +# CONFIG_TEST_HASH is not set +# CONFIG_TEST_IDA is not set +# CONFIG_TEST_LKM is not set +# CONFIG_TEST_BITOPS is not set +# CONFIG_TEST_VMALLOC is not set +# CONFIG_TEST_USER_COPY is not set +# CONFIG_TEST_BPF is not set +# CONFIG_TEST_BLACKHOLE_DEV is not set +# CONFIG_FIND_BIT_BENCHMARK is not set +# CONFIG_TEST_FIRMWARE is not set +# CONFIG_TEST_SYSCTL is not set +# CONFIG_TEST_UDELAY is not set +# CONFIG_TEST_STATIC_KEYS is not set +# CONFIG_TEST_KMOD is not set +# CONFIG_TEST_MEMCAT_P is not set +# CONFIG_TEST_STACKINIT is not set +# CONFIG_TEST_MEMINIT is not set +# CONFIG_TEST_FREE_PAGES is not set +# CONFIG_MEMTEST is not set +# end of Kernel Testing and Coverage + +# +# Rust hacking +# +# end of Rust hacking +# end of Kernel hacking diff --git a/bsp/meta-rockchip/recipes-kernel/linux/files/config/ryd-3568/defconfig-kernel b/bsp/meta-rockchip/recipes-kernel/linux/files/config/ryd-3568/defconfig-kernel new file mode 100644 index 0000000000000000000000000000000000000000..ae347700c40fd19e8f016f0c1c1fe03f762e9921 --- /dev/null +++ b/bsp/meta-rockchip/recipes-kernel/linux/files/config/ryd-3568/defconfig-kernel @@ -0,0 +1,6504 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/arm64 5.10.0 Kernel Configuration +# +CONFIG_CC_VERSION_TEXT="aarch64-openeuler-linux-gnu-gcc (crosstool-NG 1.25.0) 10.3.1" +CONFIG_CC_IS_GCC=y +CONFIG_GCC_VERSION=100301 +CONFIG_LD_VERSION=237000000 +CONFIG_CLANG_VERSION=0 +CONFIG_LLD_VERSION=0 +CONFIG_CC_CAN_LINK=y +CONFIG_CC_CAN_LINK_STATIC=y +CONFIG_CC_HAS_ASM_GOTO=y +CONFIG_CC_HAS_ASM_INLINE=y +CONFIG_IRQ_WORK=y +CONFIG_BUILDTIME_TABLE_SORT=y +CONFIG_THREAD_INFO_IN_TASK=y + +# +# General setup +# +CONFIG_INIT_ENV_ARG_LIMIT=32 +# CONFIG_COMPILE_TEST is not set +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_BUILD_SALT="" +CONFIG_DEFAULT_INIT="" +CONFIG_DEFAULT_HOSTNAME="localhost" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +# CONFIG_WATCH_QUEUE is not set +CONFIG_CROSS_MEMORY_ATTACH=y +# CONFIG_USELIB is not set +# CONFIG_AUDIT is not set +CONFIG_HAVE_ARCH_AUDITSYSCALL=y + +# +# IRQ subsystem +# +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_GENERIC_IRQ_IPI=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_IRQ_MSI_IOMMU=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_SPARSE_IRQ=y +# CONFIG_GENERIC_IRQ_DEBUGFS is not set +# end of IRQ subsystem + +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_ARCH_HAS_TICK_BROADCAST=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y + +# +# Timers subsystem +# +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ_COMMON=y +# CONFIG_HZ_PERIODIC is not set +CONFIG_NO_HZ_IDLE=y +# CONFIG_NO_HZ_FULL is not set +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +# end of Timers subsystem + +# CONFIG_PREEMPT_NONE is not set +# CONFIG_PREEMPT_VOLUNTARY is not set +CONFIG_PREEMPT=y +CONFIG_PREEMPT_COUNT=y +CONFIG_PREEMPTION=y + +# +# CPU/Task time and stats accounting +# +CONFIG_TICK_CPU_ACCOUNTING=y +# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set +# CONFIG_IRQ_TIME_ACCOUNTING is not set +CONFIG_SCHED_THERMAL_PRESSURE=y +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_PSI is not set +# end of CPU/Task time and stats accounting + +CONFIG_CPU_ISOLATION=y + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +CONFIG_PREEMPT_RCU=y +# CONFIG_RCU_EXPERT is not set +CONFIG_SRCU=y +CONFIG_TREE_SRCU=y +CONFIG_TASKS_RCU_GENERIC=y +CONFIG_TASKS_RCU=y +CONFIG_TASKS_RUDE_RCU=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_RCU_NEED_SEGCBLIST=y +# end of RCU Subsystem + +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +# CONFIG_IKHEADERS is not set +CONFIG_LOG_BUF_SHIFT=18 +CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 +CONFIG_GENERIC_SCHED_CLOCK=y + +# +# Scheduler features +# +# CONFIG_UCLAMP_TASK is not set +# end of Scheduler features + +CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y +CONFIG_CC_HAS_INT128=y +CONFIG_ARCH_SUPPORTS_INT128=y +CONFIG_CGROUPS=y +# CONFIG_MEMCG is not set +# CONFIG_BLK_CGROUP is not set +CONFIG_CGROUP_SCHED=y +# CONFIG_QOS_SCHED is not set +CONFIG_FAIR_GROUP_SCHED=y +CONFIG_CFS_BANDWIDTH=y +# CONFIG_RT_GROUP_SCHED is not set +# CONFIG_CGROUP_PIDS is not set +# CONFIG_CGROUP_RDMA is not set +CONFIG_CGROUP_FREEZER=y +CONFIG_CPUSETS=y +CONFIG_PROC_PID_CPUSET=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CGROUP_CPUACCT=y +# CONFIG_CGROUP_PERF is not set +# CONFIG_CGROUP_DEBUG is not set +# CONFIG_CGROUP_FILES is not set +CONFIG_NAMESPACES=y +CONFIG_UTS_NS=y +CONFIG_TIME_NS=y +CONFIG_IPC_NS=y +CONFIG_USER_NS=y +CONFIG_PID_NS=y +CONFIG_NET_NS=y +# CONFIG_SCHED_STEAL is not set +# CONFIG_CHECKPOINT_RESTORE is not set +# CONFIG_SCHED_AUTOGROUP is not set +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_RELAY=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_RD_GZIP=y +CONFIG_RD_BZIP2=y +CONFIG_RD_LZMA=y +CONFIG_RD_XZ=y +CONFIG_RD_LZO=y +CONFIG_RD_LZ4=y +CONFIG_RD_ZSTD=y +CONFIG_INITRAMFS_FILE_METADATA="" +# CONFIG_BOOT_CONFIG is not set +# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_LD_ORPHAN_WARN=y +CONFIG_SYSCTL=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_BPF=y +CONFIG_EXPERT=y +CONFIG_MULTIUSER=y +# CONFIG_SGETMASK_SYSCALL is not set +CONFIG_SYSFS_SYSCALL=y +CONFIG_FHANDLE=y +CONFIG_POSIX_TIMERS=y +CONFIG_PRINTK=y +CONFIG_PRINTK_NMI=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_FUTEX_PI=y +CONFIG_HAVE_FUTEX_CMPXCHG=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_IO_URING=y +CONFIG_ADVISE_SYSCALLS=y +CONFIG_MEMBARRIER=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +CONFIG_KALLSYMS_BASE_RELATIVE=y +# CONFIG_BPF_SYSCALL is not set +CONFIG_ARCH_WANT_DEFAULT_BPF_JIT=y +# CONFIG_USERFAULTFD is not set +CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y +CONFIG_KCMP=y +CONFIG_RSEQ=y +# CONFIG_DEBUG_RSEQ is not set +CONFIG_EMBEDDED=y +CONFIG_HAVE_PERF_EVENTS=y +# CONFIG_PC104 is not set + +# +# Kernel Performance Events And Counters +# +CONFIG_PERF_EVENTS=y +# CONFIG_DEBUG_PERF_USE_VMALLOC is not set +# end of Kernel Performance Events And Counters + +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_SLUB_DEBUG=y +# CONFIG_COMPAT_BRK is not set +# CONFIG_SLAB is not set +CONFIG_SLUB=y +# CONFIG_SLOB is not set +CONFIG_SLAB_MERGE_DEFAULT=y +# CONFIG_SLAB_FREELIST_RANDOM is not set +# CONFIG_SLAB_FREELIST_HARDENED is not set +# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set +CONFIG_SLUB_CPU_PARTIAL=y +CONFIG_SYSTEM_DATA_VERIFICATION=y +CONFIG_PROFILING=y +CONFIG_TRACEPOINTS=y +CONFIG_KABI_RESERVE=y +CONFIG_KABI_SIZE_ALIGN_CHECKS=y +# end of General setup + +CONFIG_ARM64=y +CONFIG_64BIT=y +CONFIG_MMU=y +CONFIG_ARM64_PAGE_SHIFT=12 +CONFIG_ARM64_CONT_PTE_SHIFT=4 +CONFIG_ARM64_CONT_PMD_SHIFT=4 +CONFIG_ARCH_MMAP_RND_BITS_MIN=18 +CONFIG_ARCH_MMAP_RND_BITS_MAX=24 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_ZONE_DMA=y +CONFIG_ZONE_DMA32=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y +CONFIG_SMP=y +CONFIG_KERNEL_MODE_NEON=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_PGTABLE_LEVELS=3 +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_PROC_KCORE_TEXT=y +CONFIG_ARCH_HAS_CPU_RELAX=y + +# +# Platform selection +# +# CONFIG_ARCH_ACTIONS is not set +# CONFIG_ARCH_AGILEX is not set +# CONFIG_ARCH_SUNXI is not set +# CONFIG_ARCH_ALPINE is not set +# CONFIG_ARCH_BCM2835 is not set +# CONFIG_ARCH_BCM_IPROC is not set +# CONFIG_ARCH_BERLIN is not set +# CONFIG_ARCH_BITMAIN is not set +# CONFIG_ARCH_BRCMSTB is not set +# CONFIG_ARCH_EXYNOS is not set +# CONFIG_ARCH_SPARX5 is not set +# CONFIG_ARCH_K3 is not set +# CONFIG_ARCH_LAYERSCAPE is not set +# CONFIG_ARCH_LG1K is not set +# CONFIG_ARCH_HISI is not set +# CONFIG_ARCH_KEEMBAY is not set +# CONFIG_ARCH_MEDIATEK is not set +# CONFIG_ARCH_MESON is not set +# CONFIG_ARCH_MVEBU is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_PHYTIUM is not set +# CONFIG_ARCH_QCOM is not set +# CONFIG_ARCH_REALTEK is not set +# CONFIG_ARCH_RENESAS is not set +CONFIG_ARCH_ROCKCHIP=y +# CONFIG_ARCH_S32 is not set +# CONFIG_ARCH_SEATTLE is not set +# CONFIG_ARCH_STRATIX10 is not set +# CONFIG_ARCH_SYNQUACER is not set +# CONFIG_ARCH_TEGRA is not set +# CONFIG_ARCH_SPRD is not set +# CONFIG_ARCH_THUNDER is not set +# CONFIG_ARCH_THUNDER2 is not set +# CONFIG_ARCH_UNIPHIER is not set +# CONFIG_ARCH_VEXPRESS is not set +# CONFIG_ARCH_VISCONTI is not set +# CONFIG_ARCH_XGENE is not set +# CONFIG_ARCH_ZX is not set +# CONFIG_ARCH_ZYNQMP is not set +# end of Platform selection + +CONFIG_HAVE_LIVEPATCH_WO_FTRACE=y + +# +# Enable Livepatch +# +# end of Enable Livepatch + +# +# Kernel Features +# + +# +# ARM errata workarounds via the alternatives framework +# +# CONFIG_ARM64_ERRATUM_826319 is not set +# CONFIG_ARM64_ERRATUM_827319 is not set +# CONFIG_ARM64_ERRATUM_824069 is not set +# CONFIG_ARM64_ERRATUM_819472 is not set +# CONFIG_ARM64_ERRATUM_832075 is not set +CONFIG_ARM64_ERRATUM_843419=y +CONFIG_ARM64_ERRATUM_1024718=y +CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y +CONFIG_ARM64_ERRATUM_1165522=y +CONFIG_ARM64_ERRATUM_1319367=y +CONFIG_ARM64_ERRATUM_1530923=y +CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y +CONFIG_ARM64_ERRATUM_1286807=y +CONFIG_ARM64_ERRATUM_1463225=y +CONFIG_ARM64_ERRATUM_1542419=y +CONFIG_ARM64_ERRATUM_1508412=y +# CONFIG_CAVIUM_ERRATUM_22375 is not set +# CONFIG_CAVIUM_ERRATUM_23154 is not set +CONFIG_CAVIUM_ERRATUM_27456=y +CONFIG_CAVIUM_ERRATUM_30115=y +CONFIG_CAVIUM_TX2_ERRATUM_219=y +CONFIG_FUJITSU_ERRATUM_010001=y +CONFIG_HISILICON_ERRATUM_161600802=y +# CONFIG_HISILICON_ERRATUM_1980005 is not set +CONFIG_QCOM_FALKOR_ERRATUM_1003=y +CONFIG_QCOM_FALKOR_ERRATUM_1009=y +CONFIG_QCOM_QDF2400_ERRATUM_0065=y +CONFIG_QCOM_FALKOR_ERRATUM_E1041=y +CONFIG_SOCIONEXT_SYNQUACER_PREITS=y +CONFIG_HISILICON_ERRATUM_HIP08_RU_PREFETCH=y +# CONFIG_HISILICON_HIP08_RU_PREFETCH_DEFAULT_OFF is not set +# end of ARM errata workarounds via the alternatives framework + +CONFIG_ARM64_4K_PAGES=y +# CONFIG_ARM64_16K_PAGES is not set +# CONFIG_ARM64_64K_PAGES is not set +CONFIG_ARM64_VA_BITS_39=y +# CONFIG_ARM64_VA_BITS_48 is not set +CONFIG_ARM64_VA_BITS=39 +CONFIG_ARM64_PA_BITS_48=y +CONFIG_ARM64_PA_BITS=48 +# CONFIG_CPU_BIG_ENDIAN is not set +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_SCHED_MC=y +# CONFIG_SCHED_CLUSTER is not set +# CONFIG_SCHED_SMT is not set +CONFIG_NR_CPUS=8 +CONFIG_HOTPLUG_CPU=y +# CONFIG_ARM64_BOOTPARAM_HOTPLUG_CPU0 is not set +# CONFIG_NUMA is not set +# CONFIG_HZ_100 is not set +# CONFIG_HZ_250 is not set +CONFIG_HZ_300=y +# CONFIG_HZ_1000 is not set +CONFIG_HZ=300 +CONFIG_SCHED_HRTICK=y +CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SPARSEMEM_DEFAULT=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_FLATMEM_ENABLE=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HW_PERF_EVENTS=y +CONFIG_SYS_SUPPORTS_HUGETLBFS=y +CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y +CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y +CONFIG_ARCH_LLC_128_LINE_SIZE=y +CONFIG_ARCH_HAS_FILTER_PGPROT=y +CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y +# CONFIG_PARAVIRT is not set +# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set +# CONFIG_KEXEC is not set +# CONFIG_KEXEC_FILE is not set +# CONFIG_CRASH_DUMP is not set +# CONFIG_XEN is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_UNMAP_KERNEL_AT_EL0=y +CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y +CONFIG_RODATA_FULL_DEFAULT_ENABLED=y +# CONFIG_ARM64_PMEM_LEGACY is not set +# CONFIG_ARM64_SW_TTBR0_PAN is not set +CONFIG_ARM64_TAGGED_ADDR_ABI=y +# CONFIG_AARCH32_EL0 is not set + +# +# ARMv8.1 architectural features +# +CONFIG_ARM64_HW_AFDBM=y +CONFIG_ARM64_PAN=y +CONFIG_AS_HAS_LSE_ATOMICS=y +CONFIG_ARM64_VHE=y +# end of ARMv8.1 architectural features + +# +# ARMv8.2 architectural features +# +# CONFIG_ARM64_PMEM is not set +CONFIG_ARM64_RAS_EXTN=y +CONFIG_ARM64_CNP=y +# end of ARMv8.2 architectural features + +# +# ARMv8.3 architectural features +# +CONFIG_ARM64_PTR_AUTH=y +CONFIG_CC_HAS_BRANCH_PROT_PAC_RET=y +CONFIG_CC_HAS_SIGN_RETURN_ADDRESS=y +CONFIG_AS_HAS_PAC=y +CONFIG_AS_HAS_CFI_NEGATE_RA_STATE=y +# end of ARMv8.3 architectural features + +# +# ARMv8.4 architectural features +# +CONFIG_ARM64_AMU_EXTN=y +CONFIG_AS_HAS_ARMV8_4=y +CONFIG_ARM64_TLB_RANGE=y +# end of ARMv8.4 architectural features + +# +# ARMv8.5 architectural features +# +CONFIG_ARM64_BTI=y +CONFIG_CC_HAS_BRANCH_PROT_PAC_RET_BTI=y +CONFIG_ARM64_E0PD=y +CONFIG_ARCH_RANDOM=y +CONFIG_ARM64_AS_HAS_MTE=y +CONFIG_ARM64_MTE=y +# end of ARMv8.5 architectural features + +# +# ARMv8.6 architectural features +# +CONFIG_ARM64_TWED=y +# end of ARMv8.6 architectural features + +# +# ARMv8.7 architectural features +# +CONFIG_ARM64_EPAN=y +# end of ARMv8.7 architectural features + +CONFIG_ARM64_SVE=y +CONFIG_ARM64_MODULE_PLTS=y +# CONFIG_ARM64_PSEUDO_NMI is not set +CONFIG_RELOCATABLE=y +# CONFIG_RANDOMIZE_BASE is not set +CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y +CONFIG_STACKPROTECTOR_PER_TASK=y +# CONFIG_ASCEND_FEATURES is not set +# end of Kernel Features + +# +# Boot options +# +CONFIG_CMDLINE="" +# CONFIG_EFI is not set +# end of Boot options + +# +# Power management options +# +CONFIG_SUSPEND=y +CONFIG_SUSPEND_FREEZER=y +# CONFIG_SUSPEND_SKIP_SYNC is not set +# CONFIG_HIBERNATION is not set +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_SMP=y +# CONFIG_PM_AUTOSLEEP is not set +# CONFIG_PM_WAKELOCKS is not set +CONFIG_PM=y +CONFIG_PM_DEBUG=y +CONFIG_PM_ADVANCED_DEBUG=y +# CONFIG_PM_TEST_SUSPEND is not set +CONFIG_PM_SLEEP_DEBUG=y +# CONFIG_DPM_WATCHDOG is not set +CONFIG_PM_CLK=y +CONFIG_PM_GENERIC_DOMAINS=y +CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y +CONFIG_PM_GENERIC_DOMAINS_SLEEP=y +CONFIG_PM_GENERIC_DOMAINS_OF=y +CONFIG_CPU_PM=y +CONFIG_ENERGY_MODEL=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +# end of Power management options + +# +# CPU Power Management +# + +# +# CPU Idle +# +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y +# CONFIG_CPU_IDLE_GOV_LADDER is not set +CONFIG_CPU_IDLE_GOV_MENU=y +# CONFIG_CPU_IDLE_GOV_TEO is not set +# CONFIG_CPU_IDLE_GOV_HALTPOLL is not set +CONFIG_DT_IDLE_STATES=y + +# +# ARM CPU Idle Drivers +# +CONFIG_ARM_CPUIDLE=y +# CONFIG_ARM_PSCI_CPUIDLE is not set +# end of ARM CPU Idle Drivers + +CONFIG_HALTPOLL_CPUIDLE=y +# end of CPU Idle + +# +# CPU Frequency scaling +# +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +# CONFIG_CPU_FREQ_STAT is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y + +# +# CPU frequency scaling drivers +# +CONFIG_CPUFREQ_DT=y +CONFIG_CPUFREQ_DT_PLATDEV=y +# CONFIG_ARM_ROCKCHIP_CPUFREQ is not set +# CONFIG_ARM_SCMI_CPUFREQ is not set +# end of CPU Frequency scaling +# end of CPU Power Management + +# +# Firmware Drivers +# +CONFIG_ARM_SCMI_PROTOCOL=y +CONFIG_ARM_SCMI_POWER_DOMAIN=y +# CONFIG_ARM_SCPI_PROTOCOL is not set +# CONFIG_ARM_SDE_INTERFACE is not set +# CONFIG_FIRMWARE_MEMMAP is not set +# CONFIG_FW_CFG_SYSFS is not set +CONFIG_ROCKCHIP_SIP=y +# CONFIG_GOOGLE_FIRMWARE is not set +CONFIG_ARM_PSCI_FW=y +# CONFIG_ARM_PSCI_CHECKER is not set +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_ARM_SMCCC_DISCOVERY=y +CONFIG_ARM_SMCCC_SOC_ID=y + +# +# Tegra firmware driver +# +# end of Tegra firmware driver +# end of Firmware Drivers + +# CONFIG_VIRTUALIZATION is not set +CONFIG_ARM64_CRYPTO=y +CONFIG_CRYPTO_SHA256_ARM64=y +# CONFIG_CRYPTO_SHA512_ARM64 is not set +CONFIG_CRYPTO_SHA1_ARM64_CE=y +CONFIG_CRYPTO_SHA2_ARM64_CE=y +# CONFIG_CRYPTO_SHA512_ARM64_CE is not set +# CONFIG_CRYPTO_SHA3_ARM64 is not set +# CONFIG_CRYPTO_SM3_ARM64_CE is not set +# CONFIG_CRYPTO_SM4_ARM64_CE is not set +# CONFIG_CRYPTO_SM4_ARM64_CE_BLK is not set +# CONFIG_CRYPTO_SM4_ARM64_NEON_BLK is not set +CONFIG_CRYPTO_GHASH_ARM64_CE=y +# CONFIG_CRYPTO_CRCT10DIF_ARM64_CE is not set +CONFIG_CRYPTO_AES_ARM64=y +CONFIG_CRYPTO_AES_ARM64_CE=y +CONFIG_CRYPTO_AES_ARM64_CE_CCM=y +CONFIG_CRYPTO_AES_ARM64_CE_BLK=y +# CONFIG_CRYPTO_AES_ARM64_NEON_BLK is not set +# CONFIG_CRYPTO_CHACHA20_NEON is not set +# CONFIG_CRYPTO_POLY1305_NEON is not set +# CONFIG_CRYPTO_NHPOLY1305_NEON is not set +# CONFIG_CRYPTO_AES_ARM64_BS is not set +CONFIG_SELFDECOMPRESS_ZIMAGE=y + +# +# zImage support selfdecompre features +# +# CONFIG_SELFDECOMPRESS_ZIMAGE_GZIP is not set +CONFIG_SELFDECOMPRESS_ZIMAGE_XZ=y +# CONFIG_SELFDECOMPRESS_ZIMAGE_LZ4 is not set +# CONFIG_SELFDECOMPRESS_ZIMAGE_LZMA is not set +# CONFIG_SELFDECOMPRESS_ZIMAGE_LZO is not set +# CONFIG_ZIMAGE_2M_TEXT_OFFSET is not set +# end of zImage support selfdecompre features + +# +# General architecture-dependent options +# +# CONFIG_KPROBES is not set +# CONFIG_JUMP_LABEL is not set +CONFIG_UPROBES=y +# CONFIG_UPROBES_SUPPORT_PC_ALTER is not set +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y +CONFIG_HAVE_NMI=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y +CONFIG_ARCH_HAS_KEEPINITRD=y +CONFIG_ARCH_HAS_SET_MEMORY=y +CONFIG_ARCH_HAS_SET_DIRECT_MAP=y +CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y +CONFIG_HAVE_ASM_MODVERSIONS=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_RSEQ=y +CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y +CONFIG_HAVE_HW_BREAKPOINT=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y +CONFIG_MMU_GATHER_TABLE_FREE=y +CONFIG_MMU_GATHER_RCU_TABLE_FREE=y +CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y +CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y +CONFIG_HAVE_CMPXCHG_LOCAL=y +CONFIG_HAVE_CMPXCHG_DOUBLE=y +CONFIG_HAVE_ARCH_SECCOMP=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_SECCOMP=y +CONFIG_SECCOMP_FILTER=y +# CONFIG_SECCOMP_CACHE_DEBUG is not set +CONFIG_HAVE_ARCH_STACKLEAK=y +CONFIG_HAVE_STACKPROTECTOR=y +CONFIG_STACKPROTECTOR=y +CONFIG_STACKPROTECTOR_STRONG=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_MOVE_PUD=y +CONFIG_HAVE_MOVE_PMD=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y +CONFIG_HAVE_ARCH_HUGE_VMAP=y +CONFIG_HAVE_ARCH_HUGE_VMALLOC=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_MODULES_USE_ELF_RELA=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_HAVE_ARCH_MMAP_RND_BITS=y +CONFIG_ARCH_MMAP_RND_BITS=18 +CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y +CONFIG_CLONE_BACKWARDS=y +# CONFIG_COMPAT_32BIT_TIME is not set +CONFIG_HAVE_ARCH_VMAP_STACK=y +CONFIG_VMAP_STACK=y +CONFIG_HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET=y +CONFIG_RANDOMIZE_KSTACK_OFFSET=y +# CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT is not set +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +CONFIG_STRICT_KERNEL_RWX=y +CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y +CONFIG_STRICT_MODULE_RWX=y +CONFIG_HAVE_ARCH_COMPILER_H=y +CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y +# CONFIG_LOCK_EVENT_COUNTS is not set +CONFIG_ARCH_HAS_RELR=y +CONFIG_ARCH_WANT_LD_ORPHAN_WARN=y + +# +# GCOV-based kernel profiling +# +# CONFIG_GCOV_KERNEL is not set +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +# end of GCOV-based kernel profiling + +CONFIG_HAVE_GCC_PLUGINS=y +CONFIG_GCC_PLUGINS=y +# CONFIG_GCC_PLUGIN_CYC_COMPLEXITY is not set +# CONFIG_GCC_PLUGIN_LATENT_ENTROPY is not set +# CONFIG_GCC_PLUGIN_RANDSTRUCT is not set +# end of General architecture-dependent options + +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +CONFIG_MODULE_FORCE_LOAD=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +# CONFIG_MODULE_SIG is not set +# CONFIG_MODULE_COMPRESS is not set +# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_TRIM_UNUSED_KSYMS is not set +CONFIG_MODULES_TREE_LOOKUP=y +CONFIG_BLOCK=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_BLK_DEV_BSG=y +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_INTEGRITY is not set +# CONFIG_BLK_DEV_ZONED is not set +# CONFIG_BLK_CMDLINE_PARSER is not set +# CONFIG_BLK_WBT is not set +CONFIG_BLK_DEBUG_FS=y +# CONFIG_BLK_SED_OPAL is not set +# CONFIG_BLK_INLINE_ENCRYPTION is not set +# CONFIG_BLK_DEV_DUMPINFO is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_AIX_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_KARMA_PARTITION is not set +CONFIG_EFI_PARTITION=y +# CONFIG_SYSV68_PARTITION is not set +# CONFIG_CMDLINE_PARTITION is not set +# end of Partition Types + +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_PM=y + +# +# IO Schedulers +# +CONFIG_MQ_IOSCHED_DEADLINE=y +CONFIG_MQ_IOSCHED_KYBER=y +# CONFIG_IOSCHED_BFQ is not set +# end of IO Schedulers + +CONFIG_ASN1=y +CONFIG_UNINLINE_SPIN_UNLOCK=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_ARCH_USE_QUEUED_RWLOCKS=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE=y +CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y +CONFIG_FREEZER=y + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_HAVE_ELF_PROT=y +CONFIG_ARCH_USE_GNU_PROPERTY=y +CONFIG_ELFCORE=y +CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y +CONFIG_BINFMT_SCRIPT=y +# CONFIG_BINFMT_MISC is not set +CONFIG_COREDUMP=y +# end of Executable file formats + +# +# Memory Management options +# +CONFIG_SELECT_MEMORY_MODEL=y +# CONFIG_FLATMEM_MANUAL is not set +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_HAVE_FAST_GUP=y +CONFIG_HOLES_IN_ZONE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_MEMORY_ISOLATION=y +# CONFIG_MEMORY_HOTPLUG is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_COMPACTION is not set +# CONFIG_PAGE_REPORTING is not set +CONFIG_MIGRATION=y +# CONFIG_HUGE_VMALLOC_DEFAULT_ENABLED is not set +CONFIG_CONTIG_ALLOC=y +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_BOUNCE=y +# CONFIG_KSM is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 +CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y +# CONFIG_MEMORY_FAILURE is not set +# CONFIG_TRANSPARENT_HUGEPAGE is not set +# CONFIG_CLEANCACHE is not set +# CONFIG_FRONTSWAP is not set +# CONFIG_ETMEM is not set +# CONFIG_PAGE_CACHE_LIMIT is not set +CONFIG_CMA=y +# CONFIG_CMA_DEBUG is not set +# CONFIG_CMA_DEBUGFS is not set +CONFIG_CMA_AREAS=7 +# CONFIG_ZPOOL is not set +# CONFIG_ZBUD is not set +CONFIG_ZSMALLOC=y +# CONFIG_ZSMALLOC_STAT is not set +CONFIG_GENERIC_EARLY_IOREMAP=y +# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set +# CONFIG_IDLE_PAGE_TRACKING is not set +CONFIG_ARCH_HAS_PTE_DEVMAP=y +CONFIG_FRAME_VECTOR=y +CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y +# CONFIG_PERCPU_STATS is not set +# CONFIG_GUP_BENCHMARK is not set +CONFIG_ARCH_HAS_PTE_SPECIAL=y +# CONFIG_PIN_MEMORY is not set +# CONFIG_CLEAR_FREELIST_PAGE is not set + +# +# Data Access Monitoring +# +# CONFIG_DAMON is not set +# end of Data Access Monitoring +# end of Memory Management options + +CONFIG_NET=y +CONFIG_NET_INGRESS=y +CONFIG_SKB_EXTENSIONS=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_DIAG is not set +CONFIG_UNIX=y +CONFIG_UNIX_SCM=y +# CONFIG_UNIX_DIAG is not set +# CONFIG_TLS is not set +CONFIG_XFRM=y +CONFIG_XFRM_ALGO=y +CONFIG_XFRM_USER=y +# CONFIG_XFRM_INTERFACE is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +CONFIG_NET_KEY=y +# CONFIG_NET_KEY_MIGRATE is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +# CONFIG_IP_FIB_TRIE_STATS is not set +# CONFIG_IP_MULTIPLE_TABLES is not set +# CONFIG_IP_ROUTE_MULTIPATH is not set +# CONFIG_IP_ROUTE_VERBOSE is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE_DEMUX is not set +CONFIG_IP_MROUTE_COMMON=y +CONFIG_IP_MROUTE=y +# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set +# CONFIG_IP_PIMSM_V1 is not set +# CONFIG_IP_PIMSM_V2 is not set +CONFIG_SYN_COOKIES=y +# CONFIG_NET_IPVTI is not set +# CONFIG_NET_FOU is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_DIAG is not set +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +# CONFIG_TCP_COMP is not set +CONFIG_IPV6=y +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +# CONFIG_INET6_AH is not set +# CONFIG_INET6_ESP is not set +# CONFIG_INET6_IPCOMP is not set +# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_ILA is not set +# CONFIG_IPV6_VTI is not set +# CONFIG_IPV6_SIT is not set +# CONFIG_IPV6_TUNNEL is not set +# CONFIG_IPV6_MULTIPLE_TABLES is not set +# CONFIG_IPV6_MROUTE is not set +# CONFIG_IPV6_SEG6_LWTUNNEL is not set +# CONFIG_IPV6_SEG6_HMAC is not set +# CONFIG_IPV6_RPL_LWTUNNEL is not set +# CONFIG_MPTCP is not set +# CONFIG_NETWORK_SECMARK is not set +CONFIG_NET_PTP_CLASSIFY=y +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +CONFIG_NETFILTER=y +CONFIG_NETFILTER_ADVANCED=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_INGRESS=y +# CONFIG_NETFILTER_NETLINK_ACCT is not set +# CONFIG_NETFILTER_NETLINK_QUEUE is not set +# CONFIG_NETFILTER_NETLINK_LOG is not set +# CONFIG_NETFILTER_NETLINK_OSF is not set +CONFIG_NF_CONNTRACK=y +# CONFIG_NF_LOG_NETDEV is not set +# CONFIG_NF_CONNTRACK_MARK is not set +# CONFIG_NF_CONNTRACK_ZONES is not set +CONFIG_NF_CONNTRACK_PROCFS=y +# CONFIG_NF_CONNTRACK_EVENTS is not set +# CONFIG_NF_CONNTRACK_TIMEOUT is not set +# CONFIG_NF_CONNTRACK_TIMESTAMP is not set +# CONFIG_NF_CONNTRACK_LABELS is not set +CONFIG_NF_CT_PROTO_DCCP=y +CONFIG_NF_CT_PROTO_SCTP=y +CONFIG_NF_CT_PROTO_UDPLITE=y +# CONFIG_NF_CONNTRACK_AMANDA is not set +# CONFIG_NF_CONNTRACK_FTP is not set +# CONFIG_NF_CONNTRACK_H323 is not set +# CONFIG_NF_CONNTRACK_IRC is not set +# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set +# CONFIG_NF_CONNTRACK_SNMP is not set +# CONFIG_NF_CONNTRACK_PPTP is not set +# CONFIG_NF_CONNTRACK_SANE is not set +# CONFIG_NF_CONNTRACK_SIP is not set +# CONFIG_NF_CONNTRACK_TFTP is not set +# CONFIG_NF_CT_NETLINK is not set +CONFIG_NF_NAT=y +CONFIG_NF_NAT_REDIRECT=y +CONFIG_NF_NAT_MASQUERADE=y +# CONFIG_NF_TABLES is not set +CONFIG_NETFILTER_XTABLES=y + +# +# Xtables combined modules +# +# CONFIG_NETFILTER_XT_MARK is not set +# CONFIG_NETFILTER_XT_CONNMARK is not set + +# +# Xtables targets +# +# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set +# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set +# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set +# CONFIG_NETFILTER_XT_TARGET_DSCP is not set +# CONFIG_NETFILTER_XT_TARGET_HL is not set +# CONFIG_NETFILTER_XT_TARGET_HMARK is not set +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +# CONFIG_NETFILTER_XT_TARGET_LED is not set +# CONFIG_NETFILTER_XT_TARGET_LOG is not set +# CONFIG_NETFILTER_XT_TARGET_MARK is not set +CONFIG_NETFILTER_XT_NAT=y +CONFIG_NETFILTER_XT_TARGET_NETMAP=y +# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set +# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set +# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set +CONFIG_NETFILTER_XT_TARGET_REDIRECT=y +CONFIG_NETFILTER_XT_TARGET_MASQUERADE=y +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +# CONFIG_NETFILTER_XT_TARGET_TPROXY is not set +# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set +# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set + +# +# Xtables matches +# +# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_BPF is not set +# CONFIG_NETFILTER_XT_MATCH_CGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set +# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set +# CONFIG_NETFILTER_XT_MATCH_CONNLABEL is not set +# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set +# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +# CONFIG_NETFILTER_XT_MATCH_DCCP is not set +# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set +# CONFIG_NETFILTER_XT_MATCH_ECN is not set +# CONFIG_NETFILTER_XT_MATCH_ESP is not set +# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_HELPER is not set +# CONFIG_NETFILTER_XT_MATCH_HL is not set +# CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set +# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set +# CONFIG_NETFILTER_XT_MATCH_L2TP is not set +# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set +# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_MAC is not set +# CONFIG_NETFILTER_XT_MATCH_MARK is not set +# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set +# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set +# CONFIG_NETFILTER_XT_MATCH_OSF is not set +# CONFIG_NETFILTER_XT_MATCH_OWNER is not set +# CONFIG_NETFILTER_XT_MATCH_POLICY is not set +# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set +# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set +# CONFIG_NETFILTER_XT_MATCH_REALM is not set +# CONFIG_NETFILTER_XT_MATCH_RECENT is not set +# CONFIG_NETFILTER_XT_MATCH_SCTP is not set +# CONFIG_NETFILTER_XT_MATCH_SOCKET is not set +# CONFIG_NETFILTER_XT_MATCH_STATE is not set +# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set +# CONFIG_NETFILTER_XT_MATCH_STRING is not set +# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set +# CONFIG_NETFILTER_XT_MATCH_TIME is not set +# CONFIG_NETFILTER_XT_MATCH_U32 is not set +# end of Core Netfilter Configuration + +# CONFIG_IP_SET is not set +# CONFIG_IP_VS is not set + +# +# IP: Netfilter Configuration +# +CONFIG_NF_DEFRAG_IPV4=y +# CONFIG_NF_SOCKET_IPV4 is not set +# CONFIG_NF_TPROXY_IPV4 is not set +# CONFIG_NF_DUP_IPV4 is not set +# CONFIG_NF_LOG_ARP is not set +# CONFIG_NF_LOG_IPV4 is not set +# CONFIG_NF_REJECT_IPV4 is not set +CONFIG_IP_NF_IPTABLES=y +# CONFIG_IP_NF_MATCH_AH is not set +# CONFIG_IP_NF_MATCH_ECN is not set +# CONFIG_IP_NF_MATCH_RPFILTER is not set +# CONFIG_IP_NF_MATCH_TTL is not set +CONFIG_IP_NF_FILTER=y +# CONFIG_IP_NF_TARGET_REJECT is not set +# CONFIG_IP_NF_TARGET_SYNPROXY is not set +CONFIG_IP_NF_NAT=y +CONFIG_IP_NF_TARGET_MASQUERADE=y +CONFIG_IP_NF_TARGET_NETMAP=y +CONFIG_IP_NF_TARGET_REDIRECT=y +CONFIG_IP_NF_MANGLE=y +# CONFIG_IP_NF_TARGET_CLUSTERIP is not set +# CONFIG_IP_NF_TARGET_ECN is not set +# CONFIG_IP_NF_TARGET_TTL is not set +# CONFIG_IP_NF_RAW is not set +# CONFIG_IP_NF_ARPTABLES is not set +# end of IP: Netfilter Configuration + +# +# IPv6: Netfilter Configuration +# +# CONFIG_NF_SOCKET_IPV6 is not set +# CONFIG_NF_TPROXY_IPV6 is not set +# CONFIG_NF_DUP_IPV6 is not set +# CONFIG_NF_REJECT_IPV6 is not set +# CONFIG_NF_LOG_IPV6 is not set +# CONFIG_IP6_NF_IPTABLES is not set +# end of IPv6: Netfilter Configuration + +CONFIG_NF_DEFRAG_IPV6=y +# CONFIG_NF_CONNTRACK_BRIDGE is not set +# CONFIG_BPFILTER is not set +# CONFIG_IP_DCCP is not set +# CONFIG_IP_SCTP is not set +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_L2TP is not set +# CONFIG_BRIDGE is not set +CONFIG_HAVE_NET_DSA=y +# CONFIG_NET_DSA is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_PHONET is not set +# CONFIG_6LOWPAN is not set +# CONFIG_IEEE802154 is not set +# CONFIG_NET_SCHED is not set +# CONFIG_DCB is not set +CONFIG_DNS_RESOLVER=y +# CONFIG_BATMAN_ADV is not set +# CONFIG_OPENVSWITCH is not set +# CONFIG_VSOCKETS is not set +# CONFIG_NETLINK_DIAG is not set +# CONFIG_MPLS is not set +# CONFIG_NET_NSH is not set +# CONFIG_HSR is not set +# CONFIG_NET_SWITCHDEV is not set +# CONFIG_NET_L3_MASTER_DEV is not set +# CONFIG_QRTR is not set +# CONFIG_NET_NCSI is not set +CONFIG_RPS=y +CONFIG_RFS_ACCEL=y +CONFIG_XPS=y +# CONFIG_CGROUP_NET_PRIO is not set +# CONFIG_CGROUP_NET_CLASSID is not set +CONFIG_NET_RX_BUSY_POLL=y +CONFIG_BQL=y +# CONFIG_BPF_JIT is not set +CONFIG_NET_FLOW_LIMIT=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_NET_DROP_MONITOR is not set +# end of Network testing +# end of Networking options + +# CONFIG_HAMRADIO is not set +CONFIG_CAN=y +CONFIG_CAN_RAW=y +CONFIG_CAN_BCM=y +CONFIG_CAN_GW=y +# CONFIG_CAN_J1939 is not set +# CONFIG_CAN_ISOTP is not set + +# +# CAN Device Drivers +# +# CONFIG_CAN_VCAN is not set +# CONFIG_CAN_VXCAN is not set +# CONFIG_CAN_SLCAN is not set +CONFIG_CAN_DEV=y +CONFIG_CAN_CALC_BITTIMING=y +# CONFIG_CAN_FLEXCAN is not set +# CONFIG_CAN_GRCAN is not set +# CONFIG_CAN_KVASER_PCIEFD is not set +# CONFIG_CAN_XILINXCAN is not set +# CONFIG_CAN_C_CAN is not set +# CONFIG_CAN_CC770 is not set +# CONFIG_CAN_IFI_CANFD is not set +# CONFIG_CAN_M_CAN is not set +# CONFIG_CAN_PEAK_PCIEFD is not set +# CONFIG_CAN_SJA1000 is not set +# CONFIG_CAN_SOFTING is not set + +# +# CAN SPI interfaces +# +# CONFIG_CAN_HI311X is not set +# CONFIG_CAN_MCP251X is not set +# CONFIG_CAN_MCP251XFD is not set +# end of CAN SPI interfaces + +# +# CAN USB interfaces +# +# CONFIG_CAN_8DEV_USB is not set +# CONFIG_CAN_EMS_USB is not set +# CONFIG_CAN_ESD_USB2 is not set +# CONFIG_CAN_GS_USB is not set +# CONFIG_CAN_KVASER_USB is not set +# CONFIG_CAN_MCBA_USB is not set +# CONFIG_CAN_PEAK_USB is not set +# CONFIG_CAN_UCAN is not set +# end of CAN USB interfaces + +# CONFIG_CAN_DEBUG_DEVICES is not set +# end of CAN Device Drivers + +CONFIG_BT=y +CONFIG_BT_BREDR=y +CONFIG_BT_RFCOMM=y +# CONFIG_BT_RFCOMM_TTY is not set +# CONFIG_BT_BNEP is not set +CONFIG_BT_HIDP=y +# CONFIG_BT_HS is not set +CONFIG_BT_LE=y +# CONFIG_BT_LEDS is not set +# CONFIG_BT_MSFTEXT is not set +CONFIG_BT_DEBUGFS=y +# CONFIG_BT_SELFTEST is not set + +# +# Bluetooth device drivers +# +CONFIG_BT_INTEL=y +CONFIG_BT_BCM=y +CONFIG_BT_RTL=y +CONFIG_BT_HCIBTUSB=y +# CONFIG_BT_HCIBTUSB_AUTOSUSPEND is not set +CONFIG_BT_HCIBTUSB_BCM=y +# CONFIG_BT_HCIBTUSB_MTK is not set +CONFIG_BT_HCIBTUSB_RTL=y +# CONFIG_BT_HCIBTSDIO is not set +CONFIG_BT_HCIUART=y +CONFIG_BT_HCIUART_H4=y +# CONFIG_BT_HCIUART_BCSP is not set +CONFIG_BT_HCIUART_ATH3K=y +# CONFIG_BT_HCIUART_INTEL is not set +# CONFIG_BT_HCIUART_AG6XX is not set +# CONFIG_BT_HCIBCM203X is not set +# CONFIG_BT_HCIBPA10X is not set +CONFIG_BT_HCIBFUSB=y +CONFIG_BT_HCIVHCI=y +CONFIG_BT_MRVL=y +CONFIG_BT_MRVL_SDIO=y +# CONFIG_BT_ATH3K is not set +# CONFIG_BT_MTKSDIO is not set +# end of Bluetooth device drivers + +# CONFIG_AF_RXRPC is not set +# CONFIG_AF_KCM is not set +CONFIG_WIRELESS=y +CONFIG_WIRELESS_EXT=y +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_PRIV=y +CONFIG_CFG80211=y +CONFIG_NL80211_TESTMODE=y +# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set +# CONFIG_CFG80211_CERTIFICATION_ONUS is not set +CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y +CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y +CONFIG_CFG80211_DEFAULT_PS=y +CONFIG_CFG80211_DEBUGFS=y +CONFIG_CFG80211_CRDA_SUPPORT=y +CONFIG_CFG80211_WEXT=y +CONFIG_MAC80211=y +CONFIG_MAC80211_HAS_RC=y +CONFIG_MAC80211_RC_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +# CONFIG_MAC80211_MESH is not set +CONFIG_MAC80211_LEDS=y +CONFIG_MAC80211_DEBUGFS=y +# CONFIG_MAC80211_MESSAGE_TRACING is not set +CONFIG_MAC80211_DEBUG_MENU=y +# CONFIG_MAC80211_NOINLINE is not set +CONFIG_MAC80211_VERBOSE_DEBUG=y +# CONFIG_MAC80211_MLME_DEBUG is not set +# CONFIG_MAC80211_STA_DEBUG is not set +# CONFIG_MAC80211_HT_DEBUG is not set +# CONFIG_MAC80211_OCB_DEBUG is not set +# CONFIG_MAC80211_IBSS_DEBUG is not set +# CONFIG_MAC80211_PS_DEBUG is not set +# CONFIG_MAC80211_TDLS_DEBUG is not set +# CONFIG_MAC80211_DEBUG_COUNTERS is not set +CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 +# CONFIG_WIMAX is not set +CONFIG_RFKILL=y +CONFIG_RFKILL_LEDS=y +# CONFIG_RFKILL_INPUT is not set +# CONFIG_RFKILL_GPIO is not set +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +# CONFIG_CEPH_LIB is not set +# CONFIG_NFC is not set +# CONFIG_PSAMPLE is not set +# CONFIG_NET_IFE is not set +# CONFIG_LWTUNNEL is not set +CONFIG_GRO_CELLS=y +CONFIG_PAGE_POOL=y +# CONFIG_FAILOVER is not set +CONFIG_ETHTOOL_NETLINK=y +CONFIG_HAVE_EBPF_JIT=y + +# +# Device Drivers +# +CONFIG_ARM_AMBA=y +CONFIG_HAVE_PCI=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_SYSCALL=y +CONFIG_PCIEPORTBUS=y +# CONFIG_PCIEAER is not set +CONFIG_PCIEASPM=y +CONFIG_PCIEASPM_DEFAULT=y +# CONFIG_PCIEASPM_POWERSAVE is not set +# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set +# CONFIG_PCIEASPM_PERFORMANCE is not set +CONFIG_PCIE_PME=y +# CONFIG_PCIE_PTM is not set +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_PCI_QUIRKS=y +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCI_PRI is not set +# CONFIG_PCI_PASID is not set +# CONFIG_PCIE_BUS_TUNE_OFF is not set +CONFIG_PCIE_BUS_DEFAULT=y +# CONFIG_PCIE_BUS_SAFE is not set +# CONFIG_PCIE_BUS_PERFORMANCE is not set +# CONFIG_PCIE_BUS_PEER2PEER is not set +# CONFIG_HOTPLUG_PCI is not set + +# +# PCI controller drivers +# +# CONFIG_PCI_FTPCI100 is not set +# CONFIG_PCI_HOST_GENERIC is not set +# CONFIG_PCIE_XILINX is not set +# CONFIG_PCI_XGENE is not set +# CONFIG_PCIE_ALTERA is not set +# CONFIG_PCI_HOST_THUNDER_PEM is not set +# CONFIG_PCI_HOST_THUNDER_ECAM is not set +# CONFIG_PCIE_ROCKCHIP_HOST is not set + +# +# DesignWare PCI Core Support +# +# CONFIG_PCIE_DW_PLAT_HOST is not set +# CONFIG_PCI_HISI is not set +# CONFIG_PCIE_KIRIN is not set +# CONFIG_PCI_MESON is not set +# CONFIG_PCIE_AL is not set +# end of DesignWare PCI Core Support + +# +# Mobiveil PCIe Core Support +# +# CONFIG_PCIE_LAYERSCAPE_GEN4 is not set +# end of Mobiveil PCIe Core Support + +# +# Cadence PCIe controllers support +# +# CONFIG_PCIE_CADENCE_PLAT_HOST is not set +# CONFIG_PCI_J721E_HOST is not set +# end of Cadence PCIe controllers support +# end of PCI controller drivers + +# +# PCI Endpoint +# +# CONFIG_PCI_ENDPOINT is not set +# end of PCI Endpoint + +# +# PCI switch controller drivers +# +# CONFIG_PCI_SW_SWITCHTEC is not set +# end of PCI switch controller drivers + +# CONFIG_PCCARD is not set +# CONFIG_RAPIDIO is not set + +# +# Generic Driver Options +# +# CONFIG_UEVENT_HELPER is not set +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y + +# +# Firmware loader +# +CONFIG_FW_LOADER=y +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_FW_LOADER_USER_HELPER is not set +# CONFIG_FW_LOADER_COMPRESS is not set +CONFIG_FW_CACHE=y +# end of Firmware loader + +CONFIG_WANT_DEV_COREDUMP=y +CONFIG_ALLOW_DEV_COREDUMP=y +CONFIG_DEV_COREDUMP=y +# CONFIG_DEBUG_DRIVER is not set +CONFIG_DEBUG_DEVRES=y +# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set +# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_SOC_BUS=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_IRQ=y +CONFIG_DMA_SHARED_BUFFER=y +# CONFIG_DMA_FENCE_TRACE is not set +CONFIG_GENERIC_ARCH_TOPOLOGY=y +# end of Generic Driver Options + +# +# Bus devices +# +# CONFIG_BRCMSTB_GISB_ARB is not set +# CONFIG_MOXTET is not set +# CONFIG_SIMPLE_PM_BUS is not set +# CONFIG_VEXPRESS_CONFIG is not set +# CONFIG_MHI_BUS is not set +# end of Bus devices + +CONFIG_CONNECTOR=y +CONFIG_PROC_EVENTS=y +# CONFIG_GNSS is not set +CONFIG_MTD=y +# CONFIG_MTD_TESTS is not set + +# +# Partition parsers +# +# CONFIG_MTD_AR7_PARTS is not set +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_OF_PARTS=y +# CONFIG_MTD_AFS_PARTS is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +# end of Partition parsers + +# +# User Modules And Translation Layers +# +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SSFDC is not set +# CONFIG_SM_FTL is not set +# CONFIG_MTD_OOPS is not set +# CONFIG_MTD_SWAP is not set +# CONFIG_MTD_PARTITIONED_MASTER is not set + +# +# RAM/ROM/Flash chip drivers +# +# CONFIG_MTD_CFI is not set +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set +# end of RAM/ROM/Flash chip drivers + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_PLATRAM is not set +# end of Mapping drivers for chip access + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_DATAFLASH is not set +# CONFIG_MTD_MCHP23K256 is not set +# CONFIG_MTD_SST25L is not set +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOCG3 is not set +# end of Self-contained MTD device drivers + +# +# NAND +# +# CONFIG_MTD_ONENAND is not set +# CONFIG_MTD_RAW_NAND is not set +# CONFIG_MTD_SPI_NAND is not set + +# +# ECC engine support +# +# end of ECC engine support +# end of NAND + +# +# LPDDR & LPDDR2 PCM memory drivers +# +# CONFIG_MTD_LPDDR is not set +# end of LPDDR & LPDDR2 PCM memory drivers + +# CONFIG_MTD_SPI_NOR is not set +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTD_UBI_BEB_LIMIT=20 +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set +# CONFIG_MTD_UBI_BLOCK is not set +# CONFIG_MTD_HYPERBUS is not set +CONFIG_DTC=y +CONFIG_OF=y +# CONFIG_OF_UNITTEST is not set +CONFIG_OF_FLATTREE=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_KOBJ=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_IRQ=y +CONFIG_OF_NET=y +CONFIG_OF_RESERVED_MEM=y +# CONFIG_OF_OVERLAY is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_NULL_BLK is not set +CONFIG_CDROM=y +# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set +CONFIG_ZRAM=y +# CONFIG_ZRAM_WRITEBACK is not set +# CONFIG_ZRAM_MEMORY_TRACKING is not set +# CONFIG_BLK_DEV_UMEM is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_DRBD is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SKD is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=1 +CONFIG_BLK_DEV_RAM_SIZE=4096 +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_BLK_DEV_RBD is not set +# CONFIG_BLK_DEV_RSXX is not set + +# +# NVME Support +# +CONFIG_NVME_CORE=y +CONFIG_BLK_DEV_NVME=y +# CONFIG_NVME_MULTIPATH is not set +# CONFIG_NVME_HWMON is not set +# CONFIG_NVME_FC is not set +# CONFIG_NVME_TCP is not set +# CONFIG_NVME_TARGET is not set +# end of NVME Support + +# +# Misc devices +# +# CONFIG_AD525X_DPOT is not set +# CONFIG_DUMMY_IRQ is not set +# CONFIG_PHANTOM is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HP_ILO is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_HMC6352 is not set +# CONFIG_DS1682 is not set +# CONFIG_LATTICE_ECP3_CONFIG is not set +CONFIG_SRAM=y +# CONFIG_PCI_ENDPOINT_TEST is not set +# CONFIG_XILINX_SDFEC is not set +# CONFIG_PVPANIC is not set +# CONFIG_HISI_HIKEY_USB is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_AT25 is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +# CONFIG_EEPROM_93CX6 is not set +# CONFIG_EEPROM_93XX46 is not set +# CONFIG_EEPROM_IDT_89HPESX is not set +# CONFIG_EEPROM_EE1004 is not set +# end of EEPROM support + +# CONFIG_CB710_CORE is not set + +# +# Texas Instruments shared transport line discipline +# +# CONFIG_TI_ST is not set +# end of Texas Instruments shared transport line discipline + +# CONFIG_SENSORS_LIS3_SPI is not set +# CONFIG_SENSORS_LIS3_I2C is not set +# CONFIG_ALTERA_STAPL is not set +# CONFIG_GENWQE is not set +# CONFIG_ECHO is not set +# CONFIG_MISC_ALCOR_PCI is not set +# CONFIG_MISC_RTSX_PCI is not set +# CONFIG_MISC_RTSX_USB is not set +# CONFIG_HABANA_AI is not set +# CONFIG_UACCE is not set +# end of Misc devices + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +CONFIG_BLK_DEV_SR=y +# CONFIG_CHR_DEV_SG is not set +# CONFIG_CHR_DEV_SCH is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_SCAN_ASYNC=y + +# +# SCSI Transports +# +CONFIG_SCSI_SPI_ATTRS=y +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +# end of SCSI Transports + +CONFIG_SCSI_LOWLEVEL=y +# CONFIG_ISCSI_TCP is not set +# CONFIG_ISCSI_BOOT_SYSFS is not set +# CONFIG_SCSI_CXGB3_ISCSI is not set +# CONFIG_SCSI_CXGB4_ISCSI is not set +# CONFIG_SCSI_BNX2_ISCSI is not set +# CONFIG_BE2ISCSI is not set +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_HPSA is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_3W_SAS is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC94XX is not set +# CONFIG_SCSI_HISI_SAS is not set +# CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVUMI is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_ARCMSR is not set +# CONFIG_SCSI_ESAS2R is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_SAS is not set +# CONFIG_SCSI_MPT3SAS is not set +# CONFIG_SCSI_MPT2SAS is not set +# CONFIG_SCSI_SMARTPQI is not set +# CONFIG_SCSI_UFSHCD is not set +# CONFIG_RAMAXEL_SPRAID is not set +# CONFIG_SCSI_HPTIOP is not set +# CONFIG_SCSI_MYRB is not set +# CONFIG_SCSI_MYRS is not set +# CONFIG_SCSI_SNIC is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_FDOMAIN_PCI is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_STEX is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLA_ISCSI is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_WD719X is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_SCSI_PMCRAID is not set +# CONFIG_SCSI_PM8001 is not set +# CONFIG_SCSI_DH is not set +# end of SCSI device support + +CONFIG_HAVE_PATA_PLATFORM=y +CONFIG_ATA=y +CONFIG_SATA_HOST=y +CONFIG_ATA_VERBOSE_ERROR=y +CONFIG_ATA_FORCE=y +CONFIG_SATA_PMP=y + +# +# Controllers with non-SFF native interface +# +CONFIG_SATA_AHCI=y +CONFIG_SATA_MOBILE_LPM_POLICY=0 +CONFIG_SATA_AHCI_PLATFORM=y +# CONFIG_AHCI_CEVA is not set +# CONFIG_AHCI_QORIQ is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_SIL24 is not set +# CONFIG_ATA_SFF is not set +CONFIG_MD=y +# CONFIG_BLK_DEV_MD is not set +# CONFIG_BCACHE is not set +# CONFIG_BLK_DEV_DM is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# end of IEEE 1394 (FireWire) support + +CONFIG_NETDEVICES=y +CONFIG_MII=y +CONFIG_NET_CORE=y +# CONFIG_BONDING is not set +# CONFIG_DUMMY is not set +# CONFIG_WIREGUARD is not set +# CONFIG_EQUALIZER is not set +# CONFIG_NET_FC is not set +# CONFIG_NET_TEAM is not set +# CONFIG_MACVLAN is not set +# CONFIG_IPVLAN is not set +# CONFIG_VXLAN is not set +# CONFIG_GENEVE is not set +# CONFIG_BAREUDP is not set +# CONFIG_GTP is not set +# CONFIG_MACSEC is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_TUN is not set +# CONFIG_TUN_VNET_CROSS_LE is not set +# CONFIG_VETH is not set +# CONFIG_NLMON is not set +# CONFIG_ARCNET is not set + +# +# Distributed Switch Architecture drivers +# +# end of Distributed Switch Architecture drivers + +CONFIG_ETHERNET=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_VENDOR_AGERE is not set +CONFIG_NET_VENDOR_ALACRITECH=y +# CONFIG_SLICOSS is not set +# CONFIG_NET_VENDOR_ALTEON is not set +# CONFIG_ALTERA_TSE is not set +CONFIG_NET_VENDOR_AMAZON=y +# CONFIG_ENA_ETHERNET is not set +# CONFIG_NET_VENDOR_AMD is not set +CONFIG_NET_VENDOR_AQUANTIA=y +# CONFIG_AQTION is not set +# CONFIG_NET_VENDOR_ARC is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +CONFIG_NET_VENDOR_AURORA=y +# CONFIG_AURORA_NB8800 is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_BROCADE is not set +CONFIG_NET_VENDOR_CADENCE=y +# CONFIG_MACB is not set +# CONFIG_NET_VENDOR_CAVIUM is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_CISCO is not set +CONFIG_NET_VENDOR_CORTINA=y +# CONFIG_GEMINI_ETHERNET is not set +# CONFIG_DNET is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_DLINK is not set +# CONFIG_NET_VENDOR_EMULEX is not set +# CONFIG_NET_VENDOR_EZCHIP is not set +CONFIG_NET_VENDOR_GOOGLE=y +# CONFIG_GVE is not set +# CONFIG_NET_VENDOR_HISILICON is not set +CONFIG_NET_VENDOR_HUAWEI=y +# CONFIG_BMA is not set +CONFIG_NET_VENDOR_I825XX=y +CONFIG_NET_VENDOR_INTEL=y +# CONFIG_E100 is not set +# CONFIG_E1000 is not set +CONFIG_E1000E=y +# CONFIG_IGB is not set +# CONFIG_IGBVF is not set +# CONFIG_IXGB is not set +# CONFIG_IXGBE is not set +# CONFIG_IXGBEVF is not set +# CONFIG_I40E is not set +# CONFIG_I40EVF is not set +# CONFIG_ICE is not set +# CONFIG_FM10K is not set +# CONFIG_IGC is not set +CONFIG_NET_VENDOR_NETSWIFT=y +# CONFIG_NGBE is not set +# CONFIG_TXGBE is not set +# CONFIG_JME is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MICROCHIP is not set +CONFIG_NET_VENDOR_MICROSEMI=y +# CONFIG_NET_VENDOR_MYRI is not set +# CONFIG_FEALNX is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +CONFIG_NET_VENDOR_NETERION=y +# CONFIG_S2IO is not set +# CONFIG_VXGE is not set +CONFIG_NET_VENDOR_NETRONOME=y +# CONFIG_NFP is not set +CONFIG_NET_VENDOR_NI=y +# CONFIG_NI_XGE_MANAGEMENT_ENET is not set +# CONFIG_NET_VENDOR_NVIDIA is not set +# CONFIG_NET_VENDOR_OKI is not set +# CONFIG_ETHOC is not set +CONFIG_NET_VENDOR_PACKET_ENGINES=y +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +CONFIG_NET_VENDOR_PENSANDO=y +# CONFIG_IONIC is not set +# CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_QUALCOMM is not set +# CONFIG_NET_VENDOR_RDC is not set +# CONFIG_NET_VENDOR_REALTEK is not set +# CONFIG_NET_VENDOR_RENESAS is not set +# CONFIG_NET_VENDOR_ROCKER is not set +# CONFIG_NET_VENDOR_SAMSUNG is not set +# CONFIG_NET_VENDOR_SEEQ is not set +CONFIG_NET_VENDOR_SOLARFLARE=y +# CONFIG_SFC is not set +# CONFIG_SFC_FALCON is not set +# CONFIG_NET_VENDOR_SILAN is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_NET_VENDOR_SMSC is not set +CONFIG_NET_VENDOR_SOCIONEXT=y +CONFIG_NET_VENDOR_STMICRO=y +CONFIG_STMMAC_ETH=y +# CONFIG_STMMAC_SELFTESTS is not set +CONFIG_STMMAC_PLATFORM=y +# CONFIG_DWMAC_DWC_QOS_ETH is not set +CONFIG_DWMAC_GENERIC=y +CONFIG_DWMAC_ROCKCHIP=y +CONFIG_DWMAC_ROCKCHIP_TOOL=y +CONFIG_DWMAC_RK_AUTO_DELAYLINE=y +# CONFIG_DWMAC_INTEL_PLAT is not set +# CONFIG_DWMAC_LOONGSON is not set +# CONFIG_STMMAC_PCI is not set +# CONFIG_NET_VENDOR_SUN is not set +# CONFIG_NET_VENDOR_SYNOPSYS is not set +# CONFIG_NET_VENDOR_TEHUTI is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_NET_VENDOR_WIZNET is not set +CONFIG_NET_VENDOR_XILINX=y +# CONFIG_XILINX_AXI_EMAC is not set +# CONFIG_XILINX_LL_TEMAC is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +CONFIG_PHYLINK=y +CONFIG_PHYLIB=y +CONFIG_SWPHY=y +# CONFIG_LED_TRIGGER_PHY is not set +CONFIG_FIXED_PHY=y +# CONFIG_SFP is not set + +# +# MII PHY device drivers +# +# CONFIG_AMD_PHY is not set +# CONFIG_ADIN_PHY is not set +# CONFIG_AQUANTIA_PHY is not set +# CONFIG_AX88796B_PHY is not set +# CONFIG_BROADCOM_PHY is not set +# CONFIG_BCM54140_PHY is not set +# CONFIG_BCM7XXX_PHY is not set +# CONFIG_BCM84881_PHY is not set +# CONFIG_BCM87XX_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_CORTINA_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_INTEL_XWAY_PHY is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_MARVELL_PHY is not set +# CONFIG_MARVELL_10G_PHY is not set +# CONFIG_MICREL_PHY is not set +# CONFIG_MICROCHIP_PHY is not set +# CONFIG_MICROCHIP_T1_PHY is not set +# CONFIG_MICROSEMI_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_NXP_TJA11XX_PHY is not set +# CONFIG_AT803X_PHY is not set +# CONFIG_QSEMI_PHY is not set +CONFIG_REALTEK_PHY=y +# CONFIG_RENESAS_PHY is not set +CONFIG_ROCKCHIP_PHY=y +# CONFIG_SMSC_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_TERANETICS_PHY is not set +# CONFIG_DP83822_PHY is not set +# CONFIG_DP83TC811_PHY is not set +# CONFIG_DP83848_PHY is not set +# CONFIG_DP83867_PHY is not set +# CONFIG_DP83869_PHY is not set +# CONFIG_VITESSE_PHY is not set +# CONFIG_XILINX_GMII2RGMII is not set +# CONFIG_MICREL_KS8995MA is not set +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_BUS=y +CONFIG_OF_MDIO=y +CONFIG_MDIO_DEVRES=y +# CONFIG_MDIO_BITBANG is not set +# CONFIG_MDIO_BCM_UNIMAC is not set +# CONFIG_MDIO_HISI_FEMAC is not set +# CONFIG_MDIO_MVUSB is not set +# CONFIG_MDIO_MSCC_MIIM is not set +# CONFIG_MDIO_OCTEON is not set +# CONFIG_MDIO_IPQ4019 is not set +# CONFIG_MDIO_IPQ8064 is not set +# CONFIG_MDIO_THUNDER is not set + +# +# MDIO Multiplexers +# +# CONFIG_MDIO_BUS_MUX_GPIO is not set +# CONFIG_MDIO_BUS_MUX_MULTIPLEXER is not set +# CONFIG_MDIO_BUS_MUX_MMIOREG is not set + +# +# PCS device drivers +# +CONFIG_PCS_XPCS=y +# end of PCS device drivers + +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +CONFIG_USB_NET_DRIVERS=y +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +CONFIG_USB_RTL8150=y +CONFIG_USB_RTL8152=y +# CONFIG_USB_LAN78XX is not set +CONFIG_USB_USBNET=y +CONFIG_USB_NET_AX8817X=y +CONFIG_USB_NET_AX88179_178A=y +CONFIG_USB_NET_CDCETHER=y +# CONFIG_USB_NET_CDC_EEM is not set +CONFIG_USB_NET_CDC_NCM=y +# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set +CONFIG_USB_NET_CDC_MBIM=y +# CONFIG_USB_NET_DM9601 is not set +# CONFIG_USB_NET_SR9700 is not set +# CONFIG_USB_NET_SR9800 is not set +# CONFIG_USB_NET_SMSC75XX is not set +# CONFIG_USB_NET_SMSC95XX is not set +# CONFIG_USB_NET_GL620A is not set +# CONFIG_USB_NET_NET1080 is not set +# CONFIG_USB_NET_PLUSB is not set +# CONFIG_USB_NET_MCS7830 is not set +CONFIG_USB_NET_RNDIS_HOST=y +# CONFIG_USB_NET_CDC_SUBSET is not set +# CONFIG_USB_NET_ZAURUS is not set +# CONFIG_USB_NET_CX82310_ETH is not set +# CONFIG_USB_NET_KALMIA is not set +# CONFIG_USB_NET_QMI_WWAN is not set +# CONFIG_USB_HSO is not set +# CONFIG_USB_NET_INT51X1 is not set +# CONFIG_USB_IPHETH is not set +# CONFIG_USB_SIERRA_NET is not set +# CONFIG_USB_VL600 is not set +# CONFIG_USB_NET_CH9200 is not set +# CONFIG_USB_NET_AQC111 is not set +CONFIG_WLAN=y +# CONFIG_WIRELESS_WDS is not set +CONFIG_WLAN_VENDOR_ADMTEK=y +# CONFIG_ADM8211 is not set +CONFIG_WLAN_VENDOR_ATH=y +# CONFIG_ATH_DEBUG is not set +# CONFIG_ATH5K is not set +# CONFIG_ATH5K_PCI is not set +# CONFIG_ATH9K is not set +# CONFIG_ATH9K_HTC is not set +# CONFIG_CARL9170 is not set +# CONFIG_ATH6KL is not set +# CONFIG_AR5523 is not set +# CONFIG_WIL6210 is not set +# CONFIG_ATH10K is not set +# CONFIG_WCN36XX is not set +CONFIG_WLAN_VENDOR_ATMEL=y +# CONFIG_ATMEL is not set +# CONFIG_AT76C50X_USB is not set +CONFIG_WLAN_VENDOR_BROADCOM=y +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +# CONFIG_BRCMSMAC is not set +# CONFIG_BRCMFMAC is not set +CONFIG_WLAN_VENDOR_CISCO=y +CONFIG_WLAN_VENDOR_INTEL=y +# CONFIG_IPW2100 is not set +# CONFIG_IPW2200 is not set +# CONFIG_IWL4965 is not set +# CONFIG_IWL3945 is not set +# CONFIG_IWLWIFI is not set +CONFIG_WLAN_VENDOR_INTERSIL=y +# CONFIG_HOSTAP is not set +# CONFIG_HERMES is not set +# CONFIG_P54_COMMON is not set +# CONFIG_PRISM54 is not set +CONFIG_WLAN_VENDOR_MARVELL=y +# CONFIG_LIBERTAS is not set +# CONFIG_LIBERTAS_THINFIRM is not set +# CONFIG_MWIFIEX is not set +# CONFIG_MWL8K is not set +CONFIG_WLAN_VENDOR_MEDIATEK=y +# CONFIG_MT7601U is not set +# CONFIG_MT76x0U is not set +# CONFIG_MT76x0E is not set +# CONFIG_MT76x2E is not set +# CONFIG_MT76x2U is not set +# CONFIG_MT7603E is not set +# CONFIG_MT7615E is not set +# CONFIG_MT7663U is not set +# CONFIG_MT7663S is not set +# CONFIG_MT7915E is not set +CONFIG_WLAN_VENDOR_MICROCHIP=y +# CONFIG_WILC1000_SDIO is not set +# CONFIG_WILC1000_SPI is not set +CONFIG_WLAN_VENDOR_RALINK=y +# CONFIG_RT2X00 is not set +CONFIG_WLAN_VENDOR_REALTEK=y +# CONFIG_RTL8180 is not set +# CONFIG_RTL8187 is not set +CONFIG_RTL_CARDS=y +# CONFIG_RTL8192CE is not set +# CONFIG_RTL8192SE is not set +# CONFIG_RTL8192DE is not set +# CONFIG_RTL8723AE is not set +# CONFIG_RTL8723BE is not set +# CONFIG_RTL8188EE is not set +# CONFIG_RTL8192EE is not set +# CONFIG_RTL8821AE is not set +# CONFIG_RTL8192CU is not set +# CONFIG_RTL8XXXU is not set +# CONFIG_RTW88 is not set +CONFIG_WLAN_VENDOR_RSI=y +# CONFIG_RSI_91X is not set +CONFIG_WLAN_VENDOR_ST=y +# CONFIG_CW1200 is not set +CONFIG_WLAN_VENDOR_TI=y +# CONFIG_WL1251 is not set +# CONFIG_WL12XX is not set +# CONFIG_WL18XX is not set +# CONFIG_WLCORE is not set +CONFIG_WLAN_VENDOR_ZYDAS=y +# CONFIG_USB_ZD1201 is not set +# CONFIG_ZD1211RW is not set +CONFIG_WLAN_VENDOR_QUANTENNA=y +# CONFIG_QTNFMAC_PCIE is not set +CONFIG_WL_ROCKCHIP=y +CONFIG_WIFI_BUILD_MODULE=y +CONFIG_WIFI_LOAD_DRIVER_WHEN_KERNEL_BOOTUP=y +# CONFIG_WIFI_GENERATE_RANDOM_MAC_ADDR is not set +CONFIG_MXMWIFIEX=m +# CONFIG_MAC80211_HWSIM is not set +CONFIG_USB_NET_RNDIS_WLAN=y +# CONFIG_VIRT_WIFI is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_VMXNET3 is not set +# CONFIG_NETDEVSIM is not set +# CONFIG_NET_FAILOVER is not set +# CONFIG_ISDN is not set + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_LEDS=y +CONFIG_INPUT_FF_MEMLESS=y +# CONFIG_INPUT_POLLDEV is not set +# CONFIG_INPUT_SPARSEKMAP is not set +# CONFIG_INPUT_MATRIXKMAP is not set + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ADC=y +# CONFIG_KEYBOARD_ADP5588 is not set +# CONFIG_KEYBOARD_ADP5589 is not set +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_QT1050 is not set +# CONFIG_KEYBOARD_QT1070 is not set +# CONFIG_KEYBOARD_QT2160 is not set +# CONFIG_KEYBOARD_DLINK_DIR685 is not set +# CONFIG_KEYBOARD_LKKBD is not set +CONFIG_KEYBOARD_GPIO=y +CONFIG_KEYBOARD_GPIO_POLLED=y +# CONFIG_KEYBOARD_TCA6416 is not set +# CONFIG_KEYBOARD_TCA8418 is not set +# CONFIG_KEYBOARD_MATRIX is not set +# CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_LM8333 is not set +# CONFIG_KEYBOARD_MAX7359 is not set +# CONFIG_KEYBOARD_MCS is not set +# CONFIG_KEYBOARD_MPR121 is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_OPENCORES is not set +# CONFIG_KEYBOARD_SAMSUNG is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_OMAP4 is not set +# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_CAP11XX is not set +# CONFIG_KEYBOARD_BCM is not set +CONFIG_INPUT_MOUSE=y +# CONFIG_MOUSE_PS2 is not set +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_APPLETOUCH is not set +# CONFIG_MOUSE_BCM5974 is not set +CONFIG_MOUSE_CYAPA=y +CONFIG_MOUSE_ELAN_I2C=y +CONFIG_MOUSE_ELAN_I2C_I2C=y +# CONFIG_MOUSE_ELAN_I2C_SMBUS is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_MOUSE_GPIO is not set +# CONFIG_MOUSE_SYNAPTICS_I2C is not set +# CONFIG_MOUSE_SYNAPTICS_USB is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_PROPERTIES=y +# CONFIG_TOUCHSCREEN_ADS7846 is not set +# CONFIG_TOUCHSCREEN_AD7877 is not set +# CONFIG_TOUCHSCREEN_AD7879 is not set +# CONFIG_TOUCHSCREEN_ADC is not set +# CONFIG_TOUCHSCREEN_AR1021_I2C is not set +CONFIG_TOUCHSCREEN_ATMEL_MXT=y +# CONFIG_TOUCHSCREEN_ATMEL_MXT_T37 is not set +# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set +# CONFIG_TOUCHSCREEN_BU21013 is not set +# CONFIG_TOUCHSCREEN_BU21029 is not set +# CONFIG_TOUCHSCREEN_CHIPONE_ICN8318 is not set +# CONFIG_TOUCHSCREEN_CY8CTMA140 is not set +# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set +# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set +# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set +# CONFIG_TOUCHSCREEN_DYNAPRO is not set +# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set +# CONFIG_TOUCHSCREEN_EETI is not set +# CONFIG_TOUCHSCREEN_EGALAX is not set +# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set +# CONFIG_TOUCHSCREEN_EXC3000 is not set +# CONFIG_TOUCHSCREEN_FUJITSU is not set +CONFIG_TOUCHSCREEN_GOODIX=y +# CONFIG_TOUCHSCREEN_HIDEEP is not set +# CONFIG_TOUCHSCREEN_ILI210X is not set +# CONFIG_TOUCHSCREEN_S6SY761 is not set +# CONFIG_TOUCHSCREEN_GUNZE is not set +# CONFIG_TOUCHSCREEN_EKTF2127 is not set +CONFIG_TOUCHSCREEN_ELAN=y +# CONFIG_TOUCHSCREEN_ELO is not set +# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set +# CONFIG_TOUCHSCREEN_WACOM_I2C is not set +# CONFIG_TOUCHSCREEN_MAX11801 is not set +# CONFIG_TOUCHSCREEN_MCS5000 is not set +# CONFIG_TOUCHSCREEN_MMS114 is not set +# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set +# CONFIG_TOUCHSCREEN_MTOUCH is not set +# CONFIG_TOUCHSCREEN_IMX6UL_TSC is not set +# CONFIG_TOUCHSCREEN_INEXIO is not set +# CONFIG_TOUCHSCREEN_MK712 is not set +# CONFIG_TOUCHSCREEN_PENMOUNT is not set +CONFIG_TOUCHSCREEN_EDT_FT5X06=y +# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set +# CONFIG_TOUCHSCREEN_TOUCHWIN is not set +# CONFIG_TOUCHSCREEN_PIXCIR is not set +# CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set +CONFIG_TOUCHSCREEN_USB_COMPOSITE=y +CONFIG_TOUCHSCREEN_USB_EGALAX=y +CONFIG_TOUCHSCREEN_USB_PANJIT=y +CONFIG_TOUCHSCREEN_USB_3M=y +CONFIG_TOUCHSCREEN_USB_ITM=y +CONFIG_TOUCHSCREEN_USB_ETURBO=y +CONFIG_TOUCHSCREEN_USB_GUNZE=y +CONFIG_TOUCHSCREEN_USB_DMC_TSC10=y +CONFIG_TOUCHSCREEN_USB_IRTOUCH=y +CONFIG_TOUCHSCREEN_USB_IDEALTEK=y +CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH=y +CONFIG_TOUCHSCREEN_USB_GOTOP=y +CONFIG_TOUCHSCREEN_USB_JASTEC=y +CONFIG_TOUCHSCREEN_USB_ELO=y +CONFIG_TOUCHSCREEN_USB_E2I=y +CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y +CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y +CONFIG_TOUCHSCREEN_USB_NEXIO=y +CONFIG_TOUCHSCREEN_USB_EASYTOUCH=y +# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set +# CONFIG_TOUCHSCREEN_TSC_SERIO is not set +# CONFIG_TOUCHSCREEN_TSC2004 is not set +# CONFIG_TOUCHSCREEN_TSC2005 is not set +# CONFIG_TOUCHSCREEN_TSC2007 is not set +# CONFIG_TOUCHSCREEN_RM_TS is not set +# CONFIG_TOUCHSCREEN_SILEAD is not set +# CONFIG_TOUCHSCREEN_SIS_I2C is not set +# CONFIG_TOUCHSCREEN_ST1232 is not set +# CONFIG_TOUCHSCREEN_STMFTS is not set +# CONFIG_TOUCHSCREEN_SUR40 is not set +# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set +# CONFIG_TOUCHSCREEN_SX8654 is not set +# CONFIG_TOUCHSCREEN_TPS6507X is not set +# CONFIG_TOUCHSCREEN_ZET6223 is not set +# CONFIG_TOUCHSCREEN_ZFORCE is not set +# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set +# CONFIG_TOUCHSCREEN_IQS5XX is not set +# CONFIG_TOUCHSCREEN_ZINITIX is not set +CONFIG_INPUT_MISC=y +# CONFIG_INPUT_AD714X is not set +# CONFIG_INPUT_ATMEL_CAPTOUCH is not set +# CONFIG_INPUT_BMA150 is not set +# CONFIG_INPUT_E3X0_BUTTON is not set +# CONFIG_INPUT_MMA8450 is not set +# CONFIG_INPUT_GPIO_BEEPER is not set +# CONFIG_INPUT_GPIO_DECODER is not set +# CONFIG_INPUT_GPIO_VIBRA is not set +# CONFIG_INPUT_ATI_REMOTE2 is not set +# CONFIG_INPUT_KEYSPAN_REMOTE is not set +# CONFIG_INPUT_KXTJ9 is not set +# CONFIG_INPUT_POWERMATE is not set +# CONFIG_INPUT_YEALINK is not set +# CONFIG_INPUT_CM109 is not set +# CONFIG_INPUT_REGULATOR_HAPTIC is not set +CONFIG_INPUT_UINPUT=y +# CONFIG_INPUT_PCF8574 is not set +# CONFIG_INPUT_PWM_BEEPER is not set +# CONFIG_INPUT_PWM_VIBRA is not set +CONFIG_INPUT_RK805_PWRKEY=y +# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set +# CONFIG_INPUT_ADXL34X is not set +# CONFIG_INPUT_IMS_PCU is not set +# CONFIG_INPUT_IQS269A is not set +# CONFIG_INPUT_CMA3000 is not set +# CONFIG_INPUT_DRV260X_HAPTICS is not set +# CONFIG_INPUT_DRV2665_HAPTICS is not set +# CONFIG_INPUT_DRV2667_HAPTICS is not set +# CONFIG_RMI4_CORE is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set +# end of Hardware I/O ports +# end of Input device support + +# +# Character devices +# +CONFIG_TTY=y +CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_CONSOLE_SLEEP=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_UNIX98_PTYS=y +# CONFIG_LEGACY_PTYS is not set +CONFIG_LDISC_AUTOLOAD=y + +# +# Serial drivers +# +CONFIG_SERIAL_EARLYCON=y +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y +CONFIG_SERIAL_8250_16550A_VARIANTS=y +# CONFIG_SERIAL_8250_FINTEK is not set +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_DMA=y +# CONFIG_SERIAL_8250_PCI is not set +CONFIG_SERIAL_8250_NR_UARTS=10 +CONFIG_SERIAL_8250_RUNTIME_UARTS=10 +# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250_ASPEED_VUART is not set +CONFIG_SERIAL_8250_DWLIB=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_DW=y +# CONFIG_SERIAL_8250_RT288X is not set +CONFIG_SERIAL_OF_PLATFORM=y + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_AMBA_PL010 is not set +# CONFIG_SERIAL_AMBA_PL011 is not set +# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set +# CONFIG_SERIAL_MAX3100 is not set +# CONFIG_SERIAL_MAX310X is not set +# CONFIG_SERIAL_UARTLITE is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_SIFIVE is not set +# CONFIG_SERIAL_SCCNXP is not set +# CONFIG_SERIAL_SC16IS7XX is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_IFX6X60 is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_SERIAL_ARC is not set +# CONFIG_SERIAL_RP2 is not set +# CONFIG_SERIAL_FSL_LPUART is not set +# CONFIG_SERIAL_FSL_LINFLEXUART is not set +# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set +# CONFIG_SERIAL_SPRD is not set +# end of Serial drivers + +CONFIG_SERIAL_MCTRL_GPIO=y +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_N_GSM is not set +# CONFIG_NOZOMI is not set +# CONFIG_NULL_TTY is not set +# CONFIG_TRACE_SINK is not set +# CONFIG_HVC_DCC is not set +# CONFIG_SERIAL_DEV_BUS is not set +CONFIG_RYD_GPIO_CONTROL=y +# CONFIG_TTY_PRINTK is not set +# CONFIG_VIRTIO_CONSOLE is not set +# CONFIG_IPMI_HANDLER is not set +CONFIG_HW_RANDOM=y +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +# CONFIG_HW_RANDOM_BA431 is not set +CONFIG_HW_RANDOM_OPTEE=y +# CONFIG_HW_RANDOM_CCTRNG is not set +# CONFIG_HW_RANDOM_XIPHERA is not set +# CONFIG_APPLICOM is not set +CONFIG_DEVMEM=y +# CONFIG_RAW_DRIVER is not set +CONFIG_DEVPORT=y +CONFIG_TCG_TPM=y +CONFIG_HW_RANDOM_TPM=y +# CONFIG_TCG_TIS is not set +# CONFIG_TCG_TIS_SPI is not set +# CONFIG_TCG_TIS_I2C_ATMEL is not set +CONFIG_TCG_TIS_I2C_INFINEON=y +# CONFIG_TCG_TIS_I2C_NUVOTON is not set +# CONFIG_TCG_ATMEL is not set +# CONFIG_TCG_VTPM_PROXY is not set +# CONFIG_TCG_FTPM_TEE is not set +# CONFIG_TCG_TIS_ST33ZP24_I2C is not set +# CONFIG_TCG_TIS_ST33ZP24_SPI is not set +# CONFIG_XILLYBUS is not set +# CONFIG_RANDOM_TRUST_CPU is not set +# CONFIG_RANDOM_TRUST_BOOTLOADER is not set +# end of Character devices + +# +# I2C support +# +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_CHARDEV=y +# CONFIG_I2C_MUX is not set +CONFIG_I2C_HELPER_AUTO=y +CONFIG_I2C_ALGOBIT=y + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_NVIDIA_GPU is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_CADENCE is not set +# CONFIG_I2C_CBUS_GPIO is not set +# CONFIG_I2C_DESIGNWARE_PLATFORM is not set +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_EMEV2 is not set +# CONFIG_I2C_GPIO is not set +# CONFIG_I2C_HISI is not set +# CONFIG_I2C_NOMADIK is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PCA_PLATFORM is not set +CONFIG_I2C_RK3X=y +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_THUNDERX is not set +# CONFIG_I2C_XILINX is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_ROBOTFUZZ_OSIF is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Other I2C/SMBus bus drivers +# +# end of I2C Hardware Bus support + +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_SLAVE is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# end of I2C support + +# CONFIG_I3C is not set +CONFIG_SPI=y +# CONFIG_SPI_DEBUG is not set +CONFIG_SPI_MASTER=y +# CONFIG_SPI_MEM is not set + +# +# SPI Master Controller Drivers +# +# CONFIG_SPI_ALTERA is not set +# CONFIG_SPI_AXI_SPI_ENGINE is not set +CONFIG_SPI_BITBANG=y +# CONFIG_SPI_CADENCE is not set +# CONFIG_SPI_CADENCE_QUADSPI is not set +# CONFIG_SPI_DESIGNWARE is not set +# CONFIG_SPI_NXP_FLEXSPI is not set +# CONFIG_SPI_GPIO is not set +# CONFIG_SPI_FSL_SPI is not set +# CONFIG_SPI_OC_TINY is not set +# CONFIG_SPI_PL022 is not set +# CONFIG_SPI_PXA2XX is not set +CONFIG_SPI_ROCKCHIP=y +# CONFIG_SPI_SC18IS602 is not set +# CONFIG_SPI_SIFIVE is not set +# CONFIG_SPI_MXIC is not set +# CONFIG_SPI_THUNDERX is not set +# CONFIG_SPI_XCOMM is not set +# CONFIG_SPI_XILINX is not set +# CONFIG_SPI_ZYNQMP_GQSPI is not set +# CONFIG_SPI_AMD is not set + +# +# SPI Multiplexer support +# +# CONFIG_SPI_MUX is not set + +# +# SPI Protocol Masters +# +CONFIG_SPI_SPIDEV=y +# CONFIG_SPI_LOOPBACK_TEST is not set +# CONFIG_SPI_TLE62X0 is not set +# CONFIG_SPI_SLAVE is not set +# CONFIG_SPMI is not set +# CONFIG_HSI is not set +CONFIG_PPS=y +# CONFIG_PPS_DEBUG is not set + +# +# PPS clients support +# +# CONFIG_PPS_CLIENT_KTIMER is not set +# CONFIG_PPS_CLIENT_LDISC is not set +# CONFIG_PPS_CLIENT_GPIO is not set + +# +# PPS generators support +# + +# +# PTP clock support +# +CONFIG_PTP_1588_CLOCK=y + +# +# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. +# +# CONFIG_PTP_1588_CLOCK_IDT82P33 is not set +# CONFIG_PTP_1588_CLOCK_IDTCM is not set +# end of PTP clock support + +CONFIG_PINCTRL=y +CONFIG_PINMUX=y +CONFIG_PINCONF=y +CONFIG_GENERIC_PINCONF=y +# CONFIG_DEBUG_PINCTRL is not set +# CONFIG_PINCTRL_MCP23S08 is not set +CONFIG_PINCTRL_ROCKCHIP=y +# CONFIG_PINCTRL_SINGLE is not set +# CONFIG_PINCTRL_SX150X is not set +# CONFIG_PINCTRL_STMFX is not set +CONFIG_PINCTRL_RK805=y +# CONFIG_PINCTRL_OCELOT is not set + +# +# Renesas pinctrl drivers +# +# end of Renesas pinctrl drivers + +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_FASTPATH_LIMIT=512 +CONFIG_OF_GPIO=y +CONFIG_GPIOLIB_IRQCHIP=y +# CONFIG_DEBUG_GPIO is not set +CONFIG_GPIO_SYSFS=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_CDEV_V1=y +CONFIG_GPIO_GENERIC=y + +# +# Memory mapped GPIO drivers +# +# CONFIG_GPIO_74XX_MMIO is not set +# CONFIG_GPIO_ALTERA is not set +# CONFIG_GPIO_CADENCE is not set +# CONFIG_GPIO_DWAPB is not set +# CONFIG_GPIO_FTGPIO010 is not set +CONFIG_GPIO_GENERIC_PLATFORM=y +# CONFIG_GPIO_GRGPIO is not set +# CONFIG_GPIO_HLWD is not set +# CONFIG_GPIO_LOGICVC is not set +# CONFIG_GPIO_MB86S7X is not set +# CONFIG_GPIO_PL061 is not set +CONFIG_GPIO_ROCKCHIP=y +# CONFIG_GPIO_SAMA5D2_PIOBU is not set +# CONFIG_GPIO_SIFIVE is not set +# CONFIG_GPIO_SYSCON is not set +# CONFIG_GPIO_XGENE is not set +# CONFIG_GPIO_XILINX is not set +# CONFIG_GPIO_AMD_FCH is not set +# end of Memory mapped GPIO drivers + +# +# I2C GPIO expanders +# +# CONFIG_GPIO_ADP5588 is not set +# CONFIG_GPIO_ADNP is not set +# CONFIG_GPIO_GW_PLD is not set +# CONFIG_GPIO_MAX7300 is not set +# CONFIG_GPIO_MAX732X is not set +# CONFIG_GPIO_PCA953X is not set +# CONFIG_GPIO_PCA9570 is not set +# CONFIG_GPIO_PCF857X is not set +# CONFIG_GPIO_TPIC2810 is not set +# end of I2C GPIO expanders + +# +# MFD GPIO expanders +# +# CONFIG_GPIO_TPS6586X is not set +# end of MFD GPIO expanders + +# +# PCI GPIO expanders +# +# CONFIG_GPIO_BT8XX is not set +# CONFIG_GPIO_PCI_IDIO_16 is not set +# CONFIG_GPIO_PCIE_IDIO_24 is not set +# CONFIG_GPIO_RDC321X is not set +# end of PCI GPIO expanders + +# +# SPI GPIO expanders +# +# CONFIG_GPIO_74X164 is not set +# CONFIG_GPIO_MAX3191X is not set +# CONFIG_GPIO_MAX7301 is not set +# CONFIG_GPIO_MC33880 is not set +# CONFIG_GPIO_PISOSR is not set +# CONFIG_GPIO_XRA1403 is not set +# end of SPI GPIO expanders + +# +# USB GPIO expanders +# +# end of USB GPIO expanders + +# CONFIG_GPIO_AGGREGATOR is not set +# CONFIG_GPIO_MOCKUP is not set +# CONFIG_W1 is not set +CONFIG_POWER_RESET=y +# CONFIG_POWER_RESET_BRCMSTB is not set +CONFIG_POWER_RESET_GPIO=y +CONFIG_POWER_RESET_GPIO_RESTART=y +# CONFIG_POWER_RESET_LTC2952 is not set +# CONFIG_POWER_RESET_RESTART is not set +# CONFIG_POWER_RESET_XGENE is not set +# CONFIG_POWER_RESET_SYSCON is not set +# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set +CONFIG_REBOOT_MODE=y +CONFIG_SYSCON_REBOOT_MODE=y +# CONFIG_NVMEM_REBOOT_MODE is not set +CONFIG_POWER_SUPPLY=y +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_POWER_SUPPLY_HWMON=y +# CONFIG_PDA_POWER is not set +# CONFIG_GENERIC_ADC_BATTERY is not set +# CONFIG_TEST_POWER is not set +# CONFIG_CHARGER_ADP5061 is not set +# CONFIG_BATTERY_CW2015 is not set +# CONFIG_BATTERY_DS2780 is not set +# CONFIG_BATTERY_DS2781 is not set +# CONFIG_BATTERY_DS2782 is not set +CONFIG_BATTERY_SBS=y +# CONFIG_CHARGER_SBS is not set +# CONFIG_BATTERY_BQ27XXX is not set +# CONFIG_BATTERY_MAX17040 is not set +# CONFIG_BATTERY_MAX17042 is not set +# CONFIG_CHARGER_ISP1704 is not set +# CONFIG_CHARGER_MAX8903 is not set +# CONFIG_CHARGER_LP8727 is not set +CONFIG_CHARGER_GPIO=y +# CONFIG_CHARGER_MANAGER is not set +# CONFIG_CHARGER_LT3651 is not set +# CONFIG_CHARGER_DETECTOR_MAX14656 is not set +# CONFIG_CHARGER_BQ2415X is not set +# CONFIG_CHARGER_BQ24190 is not set +# CONFIG_CHARGER_BQ24257 is not set +CONFIG_CHARGER_BQ24735=y +# CONFIG_CHARGER_BQ2515X is not set +# CONFIG_CHARGER_BQ25890 is not set +# CONFIG_CHARGER_BQ25980 is not set +# CONFIG_CHARGER_SMB347 is not set +# CONFIG_BATTERY_GAUGE_LTC2941 is not set +# CONFIG_BATTERY_RT5033 is not set +# CONFIG_CHARGER_RT9455 is not set +# CONFIG_CHARGER_UCS1002 is not set +# CONFIG_CHARGER_BD99954 is not set +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set + +# +# Native drivers +# +# CONFIG_SENSORS_AD7314 is not set +# CONFIG_SENSORS_AD7414 is not set +# CONFIG_SENSORS_AD7418 is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1029 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ADM1177 is not set +# CONFIG_SENSORS_ADM9240 is not set +# CONFIG_SENSORS_ADT7310 is not set +# CONFIG_SENSORS_ADT7410 is not set +# CONFIG_SENSORS_ADT7411 is not set +# CONFIG_SENSORS_ADT7462 is not set +# CONFIG_SENSORS_ADT7470 is not set +# CONFIG_SENSORS_ADT7475 is not set +# CONFIG_SENSORS_AS370 is not set +# CONFIG_SENSORS_ASC7621 is not set +# CONFIG_SENSORS_AXI_FAN_CONTROL is not set +# CONFIG_SENSORS_ARM_SCMI is not set +# CONFIG_SENSORS_ASPEED is not set +# CONFIG_SENSORS_ATXP1 is not set +# CONFIG_SENSORS_CORSAIR_CPRO is not set +# CONFIG_SENSORS_DRIVETEMP is not set +# CONFIG_SENSORS_DS620 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_I5K_AMB is not set +# CONFIG_SENSORS_F71805F is not set +# CONFIG_SENSORS_F71882FG is not set +# CONFIG_SENSORS_F75375S is not set +# CONFIG_SENSORS_FTSTEUTATES is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_GL520SM is not set +# CONFIG_SENSORS_G760A is not set +# CONFIG_SENSORS_G762 is not set +# CONFIG_SENSORS_GPIO_FAN is not set +# CONFIG_SENSORS_HIH6130 is not set +# CONFIG_SENSORS_IIO_HWMON is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_JC42 is not set +# CONFIG_SENSORS_POWR1220 is not set +# CONFIG_SENSORS_LINEAGE is not set +# CONFIG_SENSORS_LTC2945 is not set +# CONFIG_SENSORS_LTC2947_I2C is not set +# CONFIG_SENSORS_LTC2947_SPI is not set +# CONFIG_SENSORS_LTC2990 is not set +# CONFIG_SENSORS_LTC4151 is not set +# CONFIG_SENSORS_LTC4215 is not set +# CONFIG_SENSORS_LTC4222 is not set +# CONFIG_SENSORS_LTC4245 is not set +# CONFIG_SENSORS_LTC4260 is not set +# CONFIG_SENSORS_LTC4261 is not set +# CONFIG_SENSORS_MAX1111 is not set +# CONFIG_SENSORS_MAX16065 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_MAX1668 is not set +# CONFIG_SENSORS_MAX197 is not set +# CONFIG_SENSORS_MAX31722 is not set +# CONFIG_SENSORS_MAX31730 is not set +# CONFIG_SENSORS_MAX6621 is not set +# CONFIG_SENSORS_MAX6639 is not set +# CONFIG_SENSORS_MAX6642 is not set +# CONFIG_SENSORS_MAX6650 is not set +# CONFIG_SENSORS_MAX6697 is not set +# CONFIG_SENSORS_MAX31790 is not set +# CONFIG_SENSORS_MCP3021 is not set +# CONFIG_SENSORS_TC654 is not set +# CONFIG_SENSORS_MR75203 is not set +# CONFIG_SENSORS_ADCXX is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM70 is not set +# CONFIG_SENSORS_LM73 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_LM92 is not set +# CONFIG_SENSORS_LM93 is not set +# CONFIG_SENSORS_LM95234 is not set +# CONFIG_SENSORS_LM95241 is not set +# CONFIG_SENSORS_LM95245 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_PC87427 is not set +# CONFIG_SENSORS_NTC_THERMISTOR is not set +# CONFIG_SENSORS_NCT6683 is not set +# CONFIG_SENSORS_NCT6775 is not set +# CONFIG_SENSORS_NCT7802 is not set +# CONFIG_SENSORS_NCT7904 is not set +# CONFIG_SENSORS_NPCM7XX is not set +# CONFIG_SENSORS_OCC_P8_I2C is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_PMBUS is not set +# CONFIG_SENSORS_PWM_FAN is not set +# CONFIG_SENSORS_SHT15 is not set +# CONFIG_SENSORS_SHT21 is not set +# CONFIG_SENSORS_SHT3x is not set +# CONFIG_SENSORS_SHTC1 is not set +# CONFIG_SENSORS_SIS5595 is not set +# CONFIG_SENSORS_DME1737 is not set +# CONFIG_SENSORS_EMC1403 is not set +# CONFIG_SENSORS_EMC2103 is not set +# CONFIG_SENSORS_EMC6W201 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_SMSC47M192 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_SCH5627 is not set +# CONFIG_SENSORS_SCH5636 is not set +# CONFIG_SENSORS_STTS751 is not set +# CONFIG_SENSORS_SMM665 is not set +# CONFIG_SENSORS_ADC128D818 is not set +# CONFIG_SENSORS_ADS7828 is not set +# CONFIG_SENSORS_ADS7871 is not set +# CONFIG_SENSORS_AMC6821 is not set +# CONFIG_SENSORS_INA209 is not set +# CONFIG_SENSORS_INA2XX is not set +# CONFIG_SENSORS_INA3221 is not set +# CONFIG_SENSORS_TC74 is not set +# CONFIG_SENSORS_THMC50 is not set +# CONFIG_SENSORS_TMP102 is not set +# CONFIG_SENSORS_TMP103 is not set +# CONFIG_SENSORS_TMP108 is not set +# CONFIG_SENSORS_TMP401 is not set +# CONFIG_SENSORS_TMP421 is not set +# CONFIG_SENSORS_TMP513 is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_VT1211 is not set +# CONFIG_SENSORS_VT8231 is not set +# CONFIG_SENSORS_W83773G is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83791D is not set +# CONFIG_SENSORS_W83792D is not set +# CONFIG_SENSORS_W83793 is not set +# CONFIG_SENSORS_W83795 is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83L786NG is not set +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83627EHF is not set +CONFIG_THERMAL=y +# CONFIG_THERMAL_NETLINK is not set +# CONFIG_THERMAL_STATISTICS is not set +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_OF=y +CONFIG_THERMAL_WRITABLE_TRIPS=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set +# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set +CONFIG_THERMAL_GOV_FAIR_SHARE=y +CONFIG_THERMAL_GOV_STEP_WISE=y +# CONFIG_THERMAL_GOV_BANG_BANG is not set +# CONFIG_THERMAL_GOV_USER_SPACE is not set +# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set +CONFIG_CPU_THERMAL=y +CONFIG_CPU_FREQ_THERMAL=y +CONFIG_DEVFREQ_THERMAL=y +# CONFIG_THERMAL_EMULATION is not set +# CONFIG_THERMAL_MMIO is not set +CONFIG_ROCKCHIP_THERMAL=y +# CONFIG_GENERIC_ADC_THERMAL is not set +CONFIG_WATCHDOG=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WATCHDOG_NOWAYOUT is not set +CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y +CONFIG_WATCHDOG_OPEN_TIMEOUT=0 +# CONFIG_WATCHDOG_SYSFS is not set + +# +# Watchdog Pretimeout Governors +# +# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +# CONFIG_GPIO_WATCHDOG is not set +# CONFIG_XILINX_WATCHDOG is not set +# CONFIG_ZIIRAVE_WATCHDOG is not set +# CONFIG_ARM_SP805_WATCHDOG is not set +# CONFIG_ARM_SBSA_WATCHDOG is not set +# CONFIG_CADENCE_WATCHDOG is not set +CONFIG_DW_WATCHDOG=y +# CONFIG_MAX63XX_WATCHDOG is not set +# CONFIG_ARM_SMC_WATCHDOG is not set +# CONFIG_ALIM7101_WDT is not set +# CONFIG_I6300ESB_WDT is not set +# CONFIG_MEN_A21_WDT is not set + +# +# PCI-based Watchdog Cards +# +# CONFIG_PCIPCWATCHDOG is not set +# CONFIG_WDTPCI is not set + +# +# USB-based Watchdog Cards +# +# CONFIG_USBPCWATCHDOG is not set +CONFIG_SSB_POSSIBLE=y +# CONFIG_SSB is not set +CONFIG_BCMA_POSSIBLE=y +# CONFIG_BCMA is not set + +# +# Multifunction device drivers +# +CONFIG_MFD_CORE=y +# CONFIG_MFD_ACT8945A is not set +# CONFIG_MFD_AS3711 is not set +# CONFIG_MFD_AS3722 is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_AAT2870_CORE is not set +# CONFIG_MFD_ATMEL_FLEXCOM is not set +# CONFIG_MFD_ATMEL_HLCDC is not set +# CONFIG_MFD_BCM590XX is not set +# CONFIG_MFD_BD9571MWV is not set +# CONFIG_MFD_AXP20X_I2C is not set +# CONFIG_MFD_MADERA is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_MFD_DA9052_SPI is not set +# CONFIG_MFD_DA9052_I2C is not set +# CONFIG_MFD_DA9055 is not set +# CONFIG_MFD_DA9062 is not set +# CONFIG_MFD_DA9063 is not set +# CONFIG_MFD_DA9150 is not set +# CONFIG_MFD_DLN2 is not set +# CONFIG_MFD_GATEWORKS_GSC is not set +# CONFIG_MFD_MC13XXX_SPI is not set +# CONFIG_MFD_MC13XXX_I2C is not set +# CONFIG_MFD_MP2629 is not set +# CONFIG_MFD_HI6421_PMIC is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_HTC_I2CPLD is not set +# CONFIG_LPC_ICH is not set +# CONFIG_LPC_SCH is not set +# CONFIG_MFD_INTEL_PMT is not set +# CONFIG_MFD_IQS62X is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_KEMPLD is not set +# CONFIG_MFD_88PM800 is not set +# CONFIG_MFD_88PM805 is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_MAX14577 is not set +# CONFIG_MFD_MAX77620 is not set +# CONFIG_MFD_MAX77650 is not set +# CONFIG_MFD_MAX77686 is not set +# CONFIG_MFD_MAX77693 is not set +# CONFIG_MFD_MAX77843 is not set +# CONFIG_MFD_MAX8907 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_MT6360 is not set +# CONFIG_MFD_MT6397 is not set +# CONFIG_MFD_MENF21BMC is not set +# CONFIG_EZX_PCAP is not set +# CONFIG_MFD_CPCAP is not set +# CONFIG_MFD_VIPERBOARD is not set +# CONFIG_MFD_RETU is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_RT5033 is not set +# CONFIG_MFD_RC5T583 is not set +CONFIG_MFD_RK808=y +# CONFIG_MFD_RN5T618 is not set +# CONFIG_MFD_SEC_CORE is not set +# CONFIG_MFD_SI476X_CORE is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_MFD_SKY81452 is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_MFD_STMPE is not set +CONFIG_MFD_SYSCON=y +# CONFIG_MFD_TI_AM335X_TSCADC is not set +# CONFIG_MFD_LP3943 is not set +# CONFIG_MFD_LP8788 is not set +# CONFIG_MFD_TI_LMU is not set +# CONFIG_MFD_PALMAS is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS65010 is not set +# CONFIG_TPS6507X is not set +# CONFIG_MFD_TPS65086 is not set +# CONFIG_MFD_TPS65090 is not set +# CONFIG_MFD_TPS65217 is not set +# CONFIG_MFD_TI_LP873X is not set +# CONFIG_MFD_TI_LP87565 is not set +# CONFIG_MFD_TPS65218 is not set +CONFIG_MFD_TPS6586X=y +# CONFIG_MFD_TPS65910 is not set +# CONFIG_MFD_TPS65912_I2C is not set +# CONFIG_MFD_TPS65912_SPI is not set +# CONFIG_MFD_TPS80031 is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_TWL6040_CORE is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_MFD_LM3533 is not set +# CONFIG_MFD_TC3589X is not set +# CONFIG_MFD_TQMX86 is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_LOCHNAGAR is not set +# CONFIG_MFD_ARIZONA_I2C is not set +# CONFIG_MFD_ARIZONA_SPI is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM831X_SPI is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8994 is not set +# CONFIG_MFD_ROHM_BD718XX is not set +# CONFIG_MFD_ROHM_BD70528 is not set +# CONFIG_MFD_ROHM_BD71828 is not set +# CONFIG_MFD_STPMIC1 is not set +# CONFIG_MFD_STMFX is not set +# CONFIG_MFD_KHADAS_MCU is not set +# CONFIG_MFD_INTEL_M10_BMC is not set +# end of Multifunction device drivers + +CONFIG_REGULATOR=y +CONFIG_REGULATOR_DEBUG=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set +# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set +# CONFIG_REGULATOR_88PG86X is not set +CONFIG_REGULATOR_ACT8865=y +# CONFIG_REGULATOR_AD5398 is not set +# CONFIG_REGULATOR_DA9210 is not set +# CONFIG_REGULATOR_DA9211 is not set +CONFIG_REGULATOR_FAN53555=y +# CONFIG_REGULATOR_FAN53880 is not set +CONFIG_REGULATOR_GPIO=y +# CONFIG_REGULATOR_ISL9305 is not set +# CONFIG_REGULATOR_ISL6271A is not set +# CONFIG_REGULATOR_LP3971 is not set +# CONFIG_REGULATOR_LP3972 is not set +# CONFIG_REGULATOR_LP872X is not set +# CONFIG_REGULATOR_LP8755 is not set +# CONFIG_REGULATOR_LTC3589 is not set +# CONFIG_REGULATOR_LTC3676 is not set +# CONFIG_REGULATOR_MAX1586 is not set +# CONFIG_REGULATOR_MAX8649 is not set +# CONFIG_REGULATOR_MAX8660 is not set +# CONFIG_REGULATOR_MAX8952 is not set +# CONFIG_REGULATOR_MAX8973 is not set +# CONFIG_REGULATOR_MAX77826 is not set +# CONFIG_REGULATOR_MCP16502 is not set +# CONFIG_REGULATOR_MP5416 is not set +# CONFIG_REGULATOR_MP8859 is not set +# CONFIG_REGULATOR_MP886X is not set +# CONFIG_REGULATOR_MPQ7920 is not set +# CONFIG_REGULATOR_MT6311 is not set +# CONFIG_REGULATOR_PCA9450 is not set +# CONFIG_REGULATOR_PFUZE100 is not set +# CONFIG_REGULATOR_PV88060 is not set +# CONFIG_REGULATOR_PV88080 is not set +# CONFIG_REGULATOR_PV88090 is not set +CONFIG_REGULATOR_PWM=y +# CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY is not set +CONFIG_REGULATOR_RK808=y +# CONFIG_REGULATOR_RT4801 is not set +# CONFIG_REGULATOR_RTMV20 is not set +# CONFIG_REGULATOR_SLG51000 is not set +# CONFIG_REGULATOR_SY8106A is not set +# CONFIG_REGULATOR_SY8824X is not set +# CONFIG_REGULATOR_SY8827N is not set +# CONFIG_REGULATOR_TPS51632 is not set +# CONFIG_REGULATOR_TPS62360 is not set +# CONFIG_REGULATOR_TPS65023 is not set +# CONFIG_REGULATOR_TPS6507X is not set +CONFIG_REGULATOR_TPS65132=y +# CONFIG_REGULATOR_TPS6524X is not set +CONFIG_REGULATOR_TPS6586X=y +# CONFIG_REGULATOR_VCTRL is not set +# CONFIG_RC_CORE is not set +CONFIG_CEC_CORE=y +CONFIG_CEC_NOTIFIER=y +CONFIG_MEDIA_CEC_SUPPORT=y +# CONFIG_CEC_CH7322 is not set +# CONFIG_CEC_GPIO is not set +# CONFIG_USB_PULSE8_CEC is not set +# CONFIG_USB_RAINSHADOW_CEC is not set +CONFIG_MEDIA_SUPPORT=y +# CONFIG_MEDIA_SUPPORT_FILTER is not set +# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set + +# +# Media device types +# +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_MEDIA_ANALOG_TV_SUPPORT=y +CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y +CONFIG_MEDIA_RADIO_SUPPORT=y +CONFIG_MEDIA_SDR_SUPPORT=y +CONFIG_MEDIA_PLATFORM_SUPPORT=y +CONFIG_MEDIA_TEST_SUPPORT=y +# end of Media device types + +# +# Media core support +# +CONFIG_VIDEO_DEV=y +CONFIG_MEDIA_CONTROLLER=y +CONFIG_DVB_CORE=y +# end of Media core support + +# +# Video4Linux options +# +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_V4L2_I2C=y +CONFIG_VIDEO_V4L2_SUBDEV_API=y +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +# end of Video4Linux options + +# +# Media controller options +# +# CONFIG_MEDIA_CONTROLLER_DVB is not set +# end of Media controller options + +# +# Digital TV options +# +# CONFIG_DVB_MMAP is not set +CONFIG_DVB_NET=y +CONFIG_DVB_MAX_ADAPTERS=16 +CONFIG_DVB_DYNAMIC_MINORS=y +# CONFIG_DVB_DEMUX_SECTION_LOSS_LOG is not set +# CONFIG_DVB_ULE_DEBUG is not set +# end of Digital TV options + +# +# Media drivers +# +CONFIG_MEDIA_USB_SUPPORT=y + +# +# Webcam devices +# +CONFIG_USB_VIDEO_CLASS=y +# CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV is not set +# CONFIG_USB_GSPCA is not set +# CONFIG_USB_PWC is not set +# CONFIG_VIDEO_CPIA2 is not set +# CONFIG_USB_ZR364XX is not set +# CONFIG_USB_STKWEBCAM is not set +# CONFIG_USB_S2255 is not set + +# +# Analog TV USB devices +# +# CONFIG_VIDEO_PVRUSB2 is not set +# CONFIG_VIDEO_HDPVR is not set +# CONFIG_VIDEO_STK1160_COMMON is not set + +# +# Analog/digital TV USB devices +# +# CONFIG_VIDEO_AU0828 is not set + +# +# Digital TV USB devices +# +# CONFIG_DVB_USB_V2 is not set +# CONFIG_DVB_TTUSB_BUDGET is not set +# CONFIG_DVB_TTUSB_DEC is not set +# CONFIG_SMS_USB_DRV is not set +# CONFIG_DVB_B2C2_FLEXCOP_USB is not set +# CONFIG_DVB_AS102 is not set + +# +# Webcam, TV (analog/digital) USB devices +# +# CONFIG_VIDEO_EM28XX is not set + +# +# Software defined radio USB devices +# +# CONFIG_USB_AIRSPY is not set +# CONFIG_USB_HACKRF is not set +# CONFIG_USB_MSI2500 is not set +# CONFIG_MEDIA_PCI_SUPPORT is not set +CONFIG_RADIO_ADAPTERS=y +# CONFIG_RADIO_SI470X is not set +# CONFIG_RADIO_SI4713 is not set +# CONFIG_USB_MR800 is not set +# CONFIG_USB_DSBR is not set +# CONFIG_RADIO_MAXIRADIO is not set +# CONFIG_RADIO_SHARK is not set +# CONFIG_RADIO_SHARK2 is not set +# CONFIG_USB_KEENE is not set +# CONFIG_USB_RAREMONO is not set +# CONFIG_USB_MA901 is not set +# CONFIG_RADIO_TEA5764 is not set +# CONFIG_RADIO_SAA7706H is not set +# CONFIG_RADIO_TEF6862 is not set +# CONFIG_RADIO_WL1273 is not set +CONFIG_VIDEOBUF2_CORE=y +CONFIG_VIDEOBUF2_V4L2=y +CONFIG_VIDEOBUF2_MEMOPS=y +CONFIG_VIDEOBUF2_VMALLOC=y +CONFIG_V4L_PLATFORM_DRIVERS=y +# CONFIG_VIDEO_CAFE_CCIC is not set +# CONFIG_VIDEO_CADENCE is not set +# CONFIG_VIDEO_ASPEED is not set +# CONFIG_VIDEO_MUX is not set +# CONFIG_VIDEO_XILINX is not set +# CONFIG_V4L_MEM2MEM_DRIVERS is not set +# CONFIG_DVB_PLATFORM_DRIVERS is not set +# CONFIG_SDR_PLATFORM_DRIVERS is not set + +# +# MMC/SDIO DVB adapters +# +# CONFIG_SMS_SDIO_DRV is not set +# CONFIG_V4L_TEST_DRIVERS is not set +# CONFIG_DVB_TEST_DRIVERS is not set +# end of Media drivers + +# +# Media ancillary drivers +# +CONFIG_MEDIA_ATTACH=y + +# +# Audio decoders, processors and mixers +# +# CONFIG_VIDEO_TVAUDIO is not set +# CONFIG_VIDEO_TDA7432 is not set +# CONFIG_VIDEO_TDA9840 is not set +# CONFIG_VIDEO_TEA6415C is not set +# CONFIG_VIDEO_TEA6420 is not set +# CONFIG_VIDEO_MSP3400 is not set +# CONFIG_VIDEO_CS3308 is not set +# CONFIG_VIDEO_CS5345 is not set +# CONFIG_VIDEO_CS53L32A is not set +# CONFIG_VIDEO_TLV320AIC23B is not set +# CONFIG_VIDEO_UDA1342 is not set +# CONFIG_VIDEO_WM8775 is not set +# CONFIG_VIDEO_WM8739 is not set +# CONFIG_VIDEO_VP27SMPX is not set +# CONFIG_VIDEO_SONY_BTF_MPX is not set +# end of Audio decoders, processors and mixers + +# +# RDS decoders +# +# CONFIG_VIDEO_SAA6588 is not set +# end of RDS decoders + +# +# Video decoders +# +# CONFIG_VIDEO_ADV7180 is not set +# CONFIG_VIDEO_ADV7183 is not set +# CONFIG_VIDEO_ADV748X is not set +# CONFIG_VIDEO_ADV7604 is not set +# CONFIG_VIDEO_ADV7842 is not set +# CONFIG_VIDEO_BT819 is not set +# CONFIG_VIDEO_BT856 is not set +# CONFIG_VIDEO_BT866 is not set +# CONFIG_VIDEO_KS0127 is not set +# CONFIG_VIDEO_ML86V7667 is not set +# CONFIG_VIDEO_SAA7110 is not set +# CONFIG_VIDEO_SAA711X is not set +# CONFIG_VIDEO_TC358743 is not set +# CONFIG_VIDEO_TVP514X is not set +# CONFIG_VIDEO_TVP5150 is not set +# CONFIG_VIDEO_TVP7002 is not set +# CONFIG_VIDEO_TW2804 is not set +# CONFIG_VIDEO_TW9903 is not set +# CONFIG_VIDEO_TW9906 is not set +# CONFIG_VIDEO_TW9910 is not set +# CONFIG_VIDEO_VPX3220 is not set + +# +# Video and audio decoders +# +# CONFIG_VIDEO_SAA717X is not set +# CONFIG_VIDEO_CX25840 is not set +# end of Video decoders + +# +# Video encoders +# +# CONFIG_VIDEO_SAA7127 is not set +# CONFIG_VIDEO_SAA7185 is not set +# CONFIG_VIDEO_ADV7170 is not set +# CONFIG_VIDEO_ADV7175 is not set +# CONFIG_VIDEO_ADV7343 is not set +# CONFIG_VIDEO_ADV7393 is not set +# CONFIG_VIDEO_ADV7511 is not set +# CONFIG_VIDEO_AD9389B is not set +# CONFIG_VIDEO_AK881X is not set +# CONFIG_VIDEO_THS8200 is not set +# end of Video encoders + +# +# Video improvement chips +# +# CONFIG_VIDEO_UPD64031A is not set +# CONFIG_VIDEO_UPD64083 is not set +# end of Video improvement chips + +# +# Audio/Video compression chips +# +# CONFIG_VIDEO_SAA6752HS is not set +# end of Audio/Video compression chips + +# +# SDR tuner chips +# +# CONFIG_SDR_MAX2175 is not set +# end of SDR tuner chips + +# +# Miscellaneous helper chips +# +# CONFIG_VIDEO_THS7303 is not set +# CONFIG_VIDEO_M52790 is not set +# CONFIG_VIDEO_I2C is not set +# CONFIG_VIDEO_ST_MIPID02 is not set +# end of Miscellaneous helper chips + +# +# Camera sensor devices +# +# CONFIG_VIDEO_HI556 is not set +# CONFIG_VIDEO_IMX214 is not set +# CONFIG_VIDEO_IMX219 is not set +# CONFIG_VIDEO_IMX258 is not set +# CONFIG_VIDEO_IMX274 is not set +# CONFIG_VIDEO_IMX290 is not set +# CONFIG_VIDEO_IMX319 is not set +# CONFIG_VIDEO_IMX355 is not set +# CONFIG_VIDEO_OV2640 is not set +# CONFIG_VIDEO_OV2659 is not set +# CONFIG_VIDEO_OV2680 is not set +# CONFIG_VIDEO_OV2685 is not set +# CONFIG_VIDEO_OV5640 is not set +# CONFIG_VIDEO_OV5645 is not set +# CONFIG_VIDEO_OV5647 is not set +# CONFIG_VIDEO_OV6650 is not set +# CONFIG_VIDEO_OV5670 is not set +# CONFIG_VIDEO_OV5675 is not set +# CONFIG_VIDEO_OV5695 is not set +# CONFIG_VIDEO_OV7251 is not set +# CONFIG_VIDEO_OV772X is not set +# CONFIG_VIDEO_OV7640 is not set +# CONFIG_VIDEO_OV7670 is not set +# CONFIG_VIDEO_OV7740 is not set +# CONFIG_VIDEO_OV8856 is not set +# CONFIG_VIDEO_OV9640 is not set +# CONFIG_VIDEO_OV9650 is not set +# CONFIG_VIDEO_OV13858 is not set +# CONFIG_VIDEO_VS6624 is not set +# CONFIG_VIDEO_MT9M001 is not set +# CONFIG_VIDEO_MT9M032 is not set +# CONFIG_VIDEO_MT9M111 is not set +# CONFIG_VIDEO_MT9P031 is not set +# CONFIG_VIDEO_MT9T001 is not set +# CONFIG_VIDEO_MT9T112 is not set +# CONFIG_VIDEO_MT9V011 is not set +# CONFIG_VIDEO_MT9V032 is not set +# CONFIG_VIDEO_MT9V111 is not set +# CONFIG_VIDEO_SR030PC30 is not set +# CONFIG_VIDEO_NOON010PC30 is not set +# CONFIG_VIDEO_M5MOLS is not set +# CONFIG_VIDEO_RDACM20 is not set +# CONFIG_VIDEO_RJ54N1 is not set +# CONFIG_VIDEO_S5K6AA is not set +# CONFIG_VIDEO_S5K6A3 is not set +# CONFIG_VIDEO_S5K4ECGX is not set +# CONFIG_VIDEO_S5K5BAF is not set +# CONFIG_VIDEO_SMIAPP is not set +# CONFIG_VIDEO_ET8EK8 is not set +# CONFIG_VIDEO_S5C73M3 is not set +# end of Camera sensor devices + +# +# Lens drivers +# +# CONFIG_VIDEO_AD5820 is not set +# CONFIG_VIDEO_AK7375 is not set +# CONFIG_VIDEO_DW9714 is not set +# CONFIG_VIDEO_DW9768 is not set +# CONFIG_VIDEO_DW9807_VCM is not set +# end of Lens drivers + +# +# Flash devices +# +# CONFIG_VIDEO_ADP1653 is not set +# CONFIG_VIDEO_LM3560 is not set +# CONFIG_VIDEO_LM3646 is not set +# end of Flash devices + +# +# SPI helper chips +# +# CONFIG_VIDEO_GS1662 is not set +# end of SPI helper chips + +# +# Media SPI Adapters +# +CONFIG_CXD2880_SPI_DRV=m +# end of Media SPI Adapters + +CONFIG_MEDIA_TUNER=y + +# +# Customize TV tuners +# +CONFIG_MEDIA_TUNER_SIMPLE=m +CONFIG_MEDIA_TUNER_TDA18250=m +CONFIG_MEDIA_TUNER_TDA8290=m +CONFIG_MEDIA_TUNER_TDA827X=m +CONFIG_MEDIA_TUNER_TDA18271=m +CONFIG_MEDIA_TUNER_TDA9887=m +CONFIG_MEDIA_TUNER_TEA5761=m +CONFIG_MEDIA_TUNER_TEA5767=m +CONFIG_MEDIA_TUNER_MSI001=m +CONFIG_MEDIA_TUNER_MT20XX=m +CONFIG_MEDIA_TUNER_MT2060=m +CONFIG_MEDIA_TUNER_MT2063=m +CONFIG_MEDIA_TUNER_MT2266=m +CONFIG_MEDIA_TUNER_MT2131=m +CONFIG_MEDIA_TUNER_QT1010=m +CONFIG_MEDIA_TUNER_XC2028=m +CONFIG_MEDIA_TUNER_XC5000=m +CONFIG_MEDIA_TUNER_XC4000=m +CONFIG_MEDIA_TUNER_MXL5005S=m +CONFIG_MEDIA_TUNER_MXL5007T=m +CONFIG_MEDIA_TUNER_MC44S803=m +CONFIG_MEDIA_TUNER_MAX2165=m +CONFIG_MEDIA_TUNER_TDA18218=m +CONFIG_MEDIA_TUNER_FC0011=m +CONFIG_MEDIA_TUNER_FC0012=m +CONFIG_MEDIA_TUNER_FC0013=m +CONFIG_MEDIA_TUNER_TDA18212=m +CONFIG_MEDIA_TUNER_E4000=m +CONFIG_MEDIA_TUNER_FC2580=m +CONFIG_MEDIA_TUNER_M88RS6000T=m +CONFIG_MEDIA_TUNER_TUA9001=m +CONFIG_MEDIA_TUNER_SI2157=m +CONFIG_MEDIA_TUNER_IT913X=m +CONFIG_MEDIA_TUNER_R820T=m +CONFIG_MEDIA_TUNER_MXL301RF=m +CONFIG_MEDIA_TUNER_QM1D1C0042=m +CONFIG_MEDIA_TUNER_QM1D1B0004=m +# end of Customize TV tuners + +# +# Customise DVB Frontends +# + +# +# Multistandard (satellite) frontends +# +CONFIG_DVB_STB0899=m +CONFIG_DVB_STB6100=m +CONFIG_DVB_STV090x=m +CONFIG_DVB_STV0910=m +CONFIG_DVB_STV6110x=m +CONFIG_DVB_STV6111=m +CONFIG_DVB_MXL5XX=m + +# +# Multistandard (cable + terrestrial) frontends +# +CONFIG_DVB_DRXK=m +CONFIG_DVB_TDA18271C2DD=m +CONFIG_DVB_SI2165=m +CONFIG_DVB_MN88472=m +CONFIG_DVB_MN88473=m + +# +# DVB-S (satellite) frontends +# +CONFIG_DVB_CX24110=m +CONFIG_DVB_CX24123=m +CONFIG_DVB_MT312=m +CONFIG_DVB_ZL10036=m +CONFIG_DVB_ZL10039=m +CONFIG_DVB_S5H1420=m +CONFIG_DVB_STV0288=m +CONFIG_DVB_STB6000=m +CONFIG_DVB_STV0299=m +CONFIG_DVB_STV6110=m +CONFIG_DVB_STV0900=m +CONFIG_DVB_TDA8083=m +CONFIG_DVB_TDA10086=m +CONFIG_DVB_TDA8261=m +CONFIG_DVB_VES1X93=m +CONFIG_DVB_TUNER_ITD1000=m +CONFIG_DVB_TUNER_CX24113=m +CONFIG_DVB_TDA826X=m +CONFIG_DVB_TUA6100=m +CONFIG_DVB_CX24116=m +CONFIG_DVB_CX24117=m +CONFIG_DVB_CX24120=m +CONFIG_DVB_SI21XX=m +CONFIG_DVB_TS2020=m +CONFIG_DVB_DS3000=m +CONFIG_DVB_MB86A16=m +CONFIG_DVB_TDA10071=m + +# +# DVB-T (terrestrial) frontends +# +CONFIG_DVB_SP8870=m +CONFIG_DVB_SP887X=m +CONFIG_DVB_CX22700=m +CONFIG_DVB_CX22702=m +CONFIG_DVB_S5H1432=m +CONFIG_DVB_DRXD=m +CONFIG_DVB_L64781=m +CONFIG_DVB_TDA1004X=m +CONFIG_DVB_NXT6000=m +CONFIG_DVB_MT352=m +CONFIG_DVB_ZL10353=m +CONFIG_DVB_DIB3000MB=m +CONFIG_DVB_DIB3000MC=m +CONFIG_DVB_DIB7000M=m +CONFIG_DVB_DIB7000P=m +CONFIG_DVB_DIB9000=m +CONFIG_DVB_TDA10048=m +CONFIG_DVB_EC100=m +CONFIG_DVB_STV0367=m +CONFIG_DVB_CXD2820R=m +CONFIG_DVB_CXD2841ER=m +CONFIG_DVB_ZD1301_DEMOD=m +CONFIG_DVB_CXD2880=m + +# +# DVB-C (cable) frontends +# +CONFIG_DVB_VES1820=m +CONFIG_DVB_TDA10021=m +CONFIG_DVB_TDA10023=m +CONFIG_DVB_STV0297=m + +# +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends +# +CONFIG_DVB_NXT200X=m +CONFIG_DVB_OR51211=m +CONFIG_DVB_OR51132=m +CONFIG_DVB_BCM3510=m +CONFIG_DVB_LGDT330X=m +CONFIG_DVB_LGDT3305=m +CONFIG_DVB_LG2160=m +CONFIG_DVB_S5H1409=m +CONFIG_DVB_AU8522=m +CONFIG_DVB_AU8522_DTV=m +CONFIG_DVB_AU8522_V4L=m +CONFIG_DVB_S5H1411=m + +# +# ISDB-T (terrestrial) frontends +# +CONFIG_DVB_S921=m +CONFIG_DVB_DIB8000=m +CONFIG_DVB_MB86A20S=m + +# +# ISDB-S (satellite) & ISDB-T (terrestrial) frontends +# +CONFIG_DVB_TC90522=m +CONFIG_DVB_MN88443X=m + +# +# Digital terrestrial only tuners/PLL +# +CONFIG_DVB_PLL=m +CONFIG_DVB_TUNER_DIB0070=m +CONFIG_DVB_TUNER_DIB0090=m + +# +# SEC control devices for DVB-S +# +CONFIG_DVB_DRX39XYJ=m +CONFIG_DVB_LNBH25=m +CONFIG_DVB_LNBH29=m +CONFIG_DVB_LNBP21=m +CONFIG_DVB_LNBP22=m +CONFIG_DVB_ISL6405=m +CONFIG_DVB_ISL6421=m +CONFIG_DVB_ISL6423=m +CONFIG_DVB_A8293=m +CONFIG_DVB_LGS8GL5=m +CONFIG_DVB_LGS8GXX=m +CONFIG_DVB_ATBM8830=m +CONFIG_DVB_TDA665x=m +CONFIG_DVB_IX2505V=m +CONFIG_DVB_M88RS2000=m +CONFIG_DVB_AF9033=m +CONFIG_DVB_HORUS3A=m +CONFIG_DVB_ASCOT2E=m +CONFIG_DVB_HELENE=m + +# +# Common Interface (EN50221) controller drivers +# +CONFIG_DVB_CXD2099=m +CONFIG_DVB_SP2=m +# end of Customise DVB Frontends + +# +# Tools to develop new frontends +# +# CONFIG_DVB_DUMMY_FE is not set +# end of Media ancillary drivers + +# +# Graphics support +# +# CONFIG_VGA_ARB is not set +CONFIG_DRM=y +CONFIG_DRM_MIPI_DSI=y +# CONFIG_DRM_DP_AUX_CHARDEV is not set +# CONFIG_DRM_DEBUG_MM is not set +# CONFIG_DRM_DEBUG_SELFTEST is not set +CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_KMS_FB_HELPER=y +# CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS is not set +CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 +# CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM is not set +# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set +# CONFIG_DRM_DP_CEC is not set +CONFIG_DRM_GEM_CMA_HELPER=y + +# +# I2C encoder or helper chips +# +# CONFIG_DRM_I2C_CH7006 is not set +# CONFIG_DRM_I2C_SIL164 is not set +# CONFIG_DRM_I2C_NXP_TDA998X is not set +# CONFIG_DRM_I2C_NXP_TDA9950 is not set +# end of I2C encoder or helper chips + +# +# ARM devices +# +# CONFIG_DRM_HDLCD is not set +# CONFIG_DRM_MALI_DISPLAY is not set +# CONFIG_DRM_KOMEDA is not set +# end of ARM devices + +# CONFIG_DRM_RADEON is not set +# CONFIG_DRM_AMDGPU is not set +# CONFIG_DRM_NOUVEAU is not set +# CONFIG_DRM_VGEM is not set +# CONFIG_DRM_VKMS is not set +CONFIG_DRM_ROCKCHIP=y +# CONFIG_ROCKCHIP_DRM_CUBIC_LUT is not set +# CONFIG_ROCKCHIP_DRM_DEBUG is not set +# CONFIG_ROCKCHIP_DRM_DIRECT_SHOW is not set +# CONFIG_ROCKCHIP_VOP is not set +CONFIG_ROCKCHIP_VOP2=y +# CONFIG_ROCKCHIP_ANALOGIX_DP is not set +# CONFIG_ROCKCHIP_CDN_DP is not set +CONFIG_ROCKCHIP_DW_HDMI=y +CONFIG_ROCKCHIP_DW_MIPI_DSI=y +# CONFIG_ROCKCHIP_DW_DP is not set +# CONFIG_ROCKCHIP_INNO_HDMI is not set +# CONFIG_ROCKCHIP_LVDS is not set +# CONFIG_ROCKCHIP_RGB is not set +# CONFIG_ROCKCHIP_RK3066_HDMI is not set +# CONFIG_ROCKCHIP_VCONN is not set +# CONFIG_DRM_ROCKCHIP_VVOP is not set +# CONFIG_DRM_UDL is not set +# CONFIG_DRM_AST is not set +# CONFIG_DRM_MGAG200 is not set +# CONFIG_DRM_RCAR_DW_HDMI is not set +# CONFIG_DRM_RCAR_LVDS is not set +# CONFIG_DRM_QXL is not set +# CONFIG_DRM_BOCHS is not set +CONFIG_DRM_PANEL=y + +# +# Display Panels +# +# CONFIG_DRM_PANEL_ARM_VERSATILE is not set +# CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 is not set +# CONFIG_DRM_PANEL_BOE_HIMAX8279D is not set +# CONFIG_DRM_PANEL_BOE_TV101WUM_NL6 is not set +# CONFIG_DRM_PANEL_LVDS is not set +CONFIG_DRM_PANEL_SIMPLE=y +# CONFIG_DRM_PANEL_ELIDA_KD35T133 is not set +# CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02 is not set +# CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D is not set +# CONFIG_DRM_PANEL_ILITEK_IL9322 is not set +# CONFIG_DRM_PANEL_ILITEK_ILI9881C is not set +# CONFIG_DRM_PANEL_INNOLUX_P079ZCA is not set +# CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set +# CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04 is not set +# CONFIG_DRM_PANEL_LEADTEK_LTK050H3146W is not set +# CONFIG_DRM_PANEL_LEADTEK_LTK500HD1829 is not set +# CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set +# CONFIG_DRM_PANEL_LG_LB035Q02 is not set +# CONFIG_DRM_PANEL_LG_LG4573 is not set +# CONFIG_DRM_PANEL_NEC_NL8048HL11 is not set +# CONFIG_DRM_PANEL_NOVATEK_NT35510 is not set +# CONFIG_DRM_PANEL_NOVATEK_NT39016 is not set +# CONFIG_DRM_PANEL_MANTIX_MLAF057WE51 is not set +# CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set +# CONFIG_DRM_PANEL_ORISETECH_OTM8009A is not set +# CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS is not set +# CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00 is not set +# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set +# CONFIG_DRM_PANEL_RAYDIUM_RM67191 is not set +# CONFIG_DRM_PANEL_RAYDIUM_RM68200 is not set +# CONFIG_DRM_PANEL_RONBO_RB070D30 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6D16D0 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E63M0 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set +# CONFIG_DRM_PANEL_SEIKO_43WVF1G is not set +# CONFIG_DRM_PANEL_SHARP_LQ101R1SX01 is not set +# CONFIG_DRM_PANEL_SHARP_LS037V7DW01 is not set +# CONFIG_DRM_PANEL_SHARP_LS043T1LE01 is not set +# CONFIG_DRM_PANEL_SITRONIX_ST7701 is not set +# CONFIG_DRM_PANEL_SITRONIX_ST7703 is not set +# CONFIG_DRM_PANEL_SITRONIX_ST7789V is not set +# CONFIG_DRM_PANEL_SONY_ACX424AKP is not set +# CONFIG_DRM_PANEL_SONY_ACX565AKM is not set +# CONFIG_DRM_PANEL_TPO_TD028TTEC1 is not set +# CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set +# CONFIG_DRM_PANEL_TPO_TPG110 is not set +# CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set +# CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set +# CONFIG_DRM_PANEL_XINPENG_XPP055C272 is not set +# end of Display Panels + +CONFIG_DRM_BRIDGE=y +CONFIG_DRM_PANEL_BRIDGE=y + +# +# Display Interface Bridges +# +# CONFIG_DRM_CDNS_DSI is not set +# CONFIG_DRM_CHRONTEL_CH7033 is not set +# CONFIG_DRM_DISPLAY_CONNECTOR is not set +# CONFIG_DRM_LONTIUM_LT9611 is not set +# CONFIG_DRM_LVDS_CODEC is not set +# CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set +# CONFIG_DRM_NWL_MIPI_DSI is not set +# CONFIG_DRM_NXP_PTN3460 is not set +# CONFIG_DRM_PARADE_PS8622 is not set +# CONFIG_DRM_PARADE_PS8640 is not set +# CONFIG_DRM_SIL_SII8620 is not set +# CONFIG_DRM_SII902X is not set +# CONFIG_DRM_SII9234 is not set +# CONFIG_DRM_SIMPLE_BRIDGE is not set +# CONFIG_DRM_THINE_THC63LVD1024 is not set +# CONFIG_DRM_TOSHIBA_TC358762 is not set +# CONFIG_DRM_TOSHIBA_TC358764 is not set +# CONFIG_DRM_TOSHIBA_TC358767 is not set +# CONFIG_DRM_TOSHIBA_TC358768 is not set +# CONFIG_DRM_TOSHIBA_TC358775 is not set +# CONFIG_DRM_TI_TFP410 is not set +# CONFIG_DRM_TI_SN65DSI86 is not set +# CONFIG_DRM_TI_TPD12S015 is not set +# CONFIG_DRM_ANALOGIX_ANX6345 is not set +# CONFIG_DRM_ANALOGIX_ANX78XX is not set +# CONFIG_DRM_I2C_ADV7511 is not set +# CONFIG_DRM_CDNS_MHDP8546 is not set +CONFIG_DRM_DW_HDMI=y +CONFIG_DRM_DW_HDMI_CEC=y +CONFIG_DRM_DW_MIPI_DSI=y +# end of Display Interface Bridges + +# CONFIG_DRM_ETNAVIV is not set +# CONFIG_DRM_ARCPGU is not set +# CONFIG_DRM_HISI_HIBMC is not set +# CONFIG_DRM_HISI_KIRIN is not set +# CONFIG_DRM_MXSFB is not set +# CONFIG_DRM_CIRRUS_QEMU is not set +# CONFIG_DRM_GM12U320 is not set +# CONFIG_TINYDRM_HX8357D is not set +# CONFIG_TINYDRM_ILI9225 is not set +# CONFIG_TINYDRM_ILI9341 is not set +# CONFIG_TINYDRM_ILI9486 is not set +# CONFIG_TINYDRM_MI0283QT is not set +# CONFIG_TINYDRM_REPAPER is not set +# CONFIG_TINYDRM_ST7586 is not set +# CONFIG_TINYDRM_ST7735R is not set +# CONFIG_DRM_PL111 is not set +# CONFIG_DRM_LIMA is not set +# CONFIG_DRM_PANFROST is not set +# CONFIG_DRM_TIDSS is not set +# CONFIG_DRM_LEGACY is not set +CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y +CONFIG_MALI_BIFROST=y +CONFIG_MALI_PLATFORM_NAME="rk" +CONFIG_MALI_REAL_HW=y + +# +# Platform specific options +# +# CONFIG_MALI_CSF_SUPPORT is not set +CONFIG_MALI_BIFROST_DEVFREQ=y +CONFIG_MALI_BIFROST_GATOR_SUPPORT=y +# CONFIG_MALI_BIFROST_ENABLE_TRACE is not set +# CONFIG_MALI_BIFROST_DMA_FENCE is not set +# CONFIG_MALI_ARBITER_SUPPORT is not set +# CONFIG_MALI_DMA_BUF_MAP_ON_DEMAND is not set +# CONFIG_MALI_DMA_BUF_LEGACY_COMPAT is not set +# CONFIG_MALI_BIFROST_EXPERT is not set +# CONFIG_MALI_ARBITRATION is not set + +# +# Frame buffer Devices +# +CONFIG_FB_CMDLINE=y +CONFIG_FB_NOTIFY=y +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_IMAGEBLIT=y +# CONFIG_FB_FOREIGN_ENDIAN is not set +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_DEFERRED_IO=y +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_ARMCLCD is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_UVESA is not set +# CONFIG_FB_OPENCORES is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_I740 is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_IBM_GXT4500 is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_SIMPLE is not set +# CONFIG_FB_SSD1307 is not set +# CONFIG_FB_SM712 is not set +# end of Frame buffer Devices + +# +# Backlight & LCD device support +# +# CONFIG_LCD_CLASS_DEVICE is not set +CONFIG_BACKLIGHT_CLASS_DEVICE=y +# CONFIG_BACKLIGHT_KTD253 is not set +CONFIG_BACKLIGHT_PWM=y +# CONFIG_BACKLIGHT_QCOM_WLED is not set +# CONFIG_BACKLIGHT_ADP8860 is not set +# CONFIG_BACKLIGHT_ADP8870 is not set +# CONFIG_BACKLIGHT_LM3630A is not set +# CONFIG_BACKLIGHT_LM3639 is not set +# CONFIG_BACKLIGHT_LP855X is not set +# CONFIG_BACKLIGHT_GPIO is not set +# CONFIG_BACKLIGHT_LV5207LP is not set +# CONFIG_BACKLIGHT_BD6107 is not set +# CONFIG_BACKLIGHT_ARCXCNN is not set +# CONFIG_BACKLIGHT_LED is not set +# end of Backlight & LCD device support + +# +# Rockchip Misc Video driver +# + +# +# RGA +# +# CONFIG_ROCKCHIP_RGA is not set +# end of RGA + +CONFIG_ROCKCHIP_RGA2=y +# CONFIG_ROCKCHIP_RGA2_PROC_FS is not set +CONFIG_ROCKCHIP_RGA2_DEBUG_FS=y +CONFIG_ROCKCHIP_RGA2_DEBUGGER=y +# CONFIG_ROCKCHIP_MULTI_RGA is not set +# CONFIG_ROCKCHIP_RVE is not set + +# +# IEP +# +# CONFIG_IEP is not set +# end of IEP + +CONFIG_ROCKCHIP_MPP_SERVICE=y +CONFIG_ROCKCHIP_MPP_PROC_FS=y +CONFIG_ROCKCHIP_MPP_RKVDEC=y +CONFIG_ROCKCHIP_MPP_RKVDEC2=y +CONFIG_ROCKCHIP_MPP_RKVENC=y +# CONFIG_ROCKCHIP_MPP_RKVENC2 is not set +CONFIG_ROCKCHIP_MPP_VDPU1=y +CONFIG_ROCKCHIP_MPP_VEPU1=y +CONFIG_ROCKCHIP_MPP_VDPU2=y +CONFIG_ROCKCHIP_MPP_VEPU2=y +CONFIG_ROCKCHIP_MPP_IEP2=y +CONFIG_ROCKCHIP_MPP_JPGDEC=y +# CONFIG_ROCKCHIP_MPP_AV1DEC is not set +# CONFIG_ROCKCHIP_DVBM is not set +# end of Rockchip Misc Video driver + +CONFIG_VIDEOMODE_HELPERS=y +CONFIG_HDMI=y + +# +# Console display driver support +# +CONFIG_DUMMY_CONSOLE=y +CONFIG_DUMMY_CONSOLE_COLUMNS=80 +CONFIG_DUMMY_CONSOLE_ROWS=25 +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set +# end of Console display driver support + +# CONFIG_LOGO is not set +# end of Graphics support + +# CONFIG_SOUND is not set + +# +# HID support +# +CONFIG_HID=y +CONFIG_HID_BATTERY_STRENGTH=y +CONFIG_HIDRAW=y +CONFIG_UHID=y +CONFIG_HID_GENERIC=y + +# +# Special HID drivers +# +# CONFIG_HID_A4TECH is not set +# CONFIG_HID_ACCUTOUCH is not set +# CONFIG_HID_ACRUX is not set +# CONFIG_HID_APPLE is not set +# CONFIG_HID_APPLEIR is not set +# CONFIG_HID_ASUS is not set +# CONFIG_HID_AUREAL is not set +# CONFIG_HID_BELKIN is not set +# CONFIG_HID_BETOP_FF is not set +# CONFIG_HID_BIGBEN_FF is not set +# CONFIG_HID_CHERRY is not set +# CONFIG_HID_CHICONY is not set +# CONFIG_HID_CORSAIR is not set +# CONFIG_HID_COUGAR is not set +# CONFIG_HID_MACALLY is not set +# CONFIG_HID_CMEDIA is not set +# CONFIG_HID_CP2112 is not set +# CONFIG_HID_CREATIVE_SB0540 is not set +# CONFIG_HID_CYPRESS is not set +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_ELAN is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_ELO is not set +# CONFIG_HID_EZKEY is not set +# CONFIG_HID_GEMBIRD is not set +# CONFIG_HID_GFRM is not set +# CONFIG_HID_GLORIOUS is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_VIVALDI is not set +# CONFIG_HID_GT683R is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_VIEWSONIC is not set +# CONFIG_HID_GYRATION is not set +# CONFIG_HID_ICADE is not set +# CONFIG_HID_ITE is not set +# CONFIG_HID_JABRA is not set +# CONFIG_HID_TWINHAN is not set +CONFIG_HID_KENSINGTON=y +# CONFIG_HID_LCPOWER is not set +# CONFIG_HID_LED is not set +# CONFIG_HID_LENOVO is not set +# CONFIG_HID_LOGITECH is not set +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MALTRON is not set +# CONFIG_HID_MAYFLASH is not set +# CONFIG_HID_REDRAGON is not set +# CONFIG_HID_MICROSOFT is not set +# CONFIG_HID_MONTEREY is not set +CONFIG_HID_MULTITOUCH=y +# CONFIG_HID_NTI is not set +# CONFIG_HID_NTRIG is not set +# CONFIG_HID_ORTEK is not set +# CONFIG_HID_PANTHERLORD is not set +# CONFIG_HID_PENMOUNT is not set +# CONFIG_HID_PETALYNX is not set +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PLANTRONICS is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_RETRODE is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAITEK is not set +# CONFIG_HID_SAMSUNG is not set +# CONFIG_HID_SONY is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_STEAM is not set +# CONFIG_HID_STEELSERIES is not set +# CONFIG_HID_SUNPLUS is not set +# CONFIG_HID_RMI is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_TIVO is not set +# CONFIG_HID_TOPSEED is not set +# CONFIG_HID_THINGM is not set +# CONFIG_HID_THRUSTMASTER is not set +# CONFIG_HID_UDRAW_PS3 is not set +# CONFIG_HID_U2FZERO is not set +# CONFIG_HID_WACOM is not set +# CONFIG_HID_WIIMOTE is not set +# CONFIG_HID_XINMO is not set +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +# CONFIG_HID_SENSOR_HUB is not set +# CONFIG_HID_ALPS is not set +# CONFIG_HID_MCP2221 is not set +# end of Special HID drivers + +# +# USB HID support +# +CONFIG_USB_HID=y +# CONFIG_HID_PID is not set +CONFIG_USB_HIDDEV=y +# end of USB HID support + +# +# I2C HID support +# +CONFIG_I2C_HID=y +# end of I2C HID support +# end of HID support + +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_COMMON=y +# CONFIG_USB_LED_TRIG is not set +# CONFIG_USB_ULPI_BUS is not set +# CONFIG_USB_CONN_GPIO is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB=y +CONFIG_USB_PCI=y +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y + +# +# Miscellaneous USB options +# +# CONFIG_USB_DEFAULT_PERSIST is not set +# CONFIG_USB_FEW_INIT_RETRIES is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +CONFIG_USB_OTG=y +# CONFIG_USB_OTG_PRODUCTLIST is not set +# CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB is not set +# CONFIG_USB_OTG_FSM is not set +# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set +CONFIG_USB_AUTOSUSPEND_DELAY=2 +CONFIG_USB_MON=y + +# +# USB Host Controller Drivers +# +# CONFIG_USB_C67X00_HCD is not set +CONFIG_USB_XHCI_HCD=y +# CONFIG_USB_XHCI_DBGCAP is not set +CONFIG_USB_XHCI_PCI=y +# CONFIG_USB_XHCI_PCI_RENESAS is not set +CONFIG_USB_XHCI_PLATFORM=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_EHCI_PCI=y +# CONFIG_USB_EHCI_FSL is not set +CONFIG_USB_EHCI_HCD_PLATFORM=y +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_FOTG210_HCD is not set +# CONFIG_USB_MAX3421_HCD is not set +CONFIG_USB_OHCI_HCD=y +# CONFIG_USB_OHCI_HCD_PCI is not set +CONFIG_USB_OHCI_HCD_PLATFORM=y +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set +# CONFIG_USB_HCD_TEST_MODE is not set + +# +# USB Device Class drivers +# +CONFIG_USB_ACM=y +# CONFIG_USB_PRINTER is not set +CONFIG_USB_WDM=y +# CONFIG_USB_TMC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# + +# +# also be needed; see USB_STORAGE Help for more info +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_REALTEK is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set +# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set +# CONFIG_USB_STORAGE_ENE_UB6250 is not set +CONFIG_USB_UAS=y + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USBIP_CORE is not set +# CONFIG_USB_CDNS3 is not set +# CONFIG_USB_MUSB_HDRC is not set +CONFIG_USB_DWC3=y +# CONFIG_USB_DWC3_HOST is not set +# CONFIG_USB_DWC3_GADGET is not set +CONFIG_USB_DWC3_DUAL_ROLE=y + +# +# Platform Glue Driver Support +# +CONFIG_USB_DWC3_HAPS=y +CONFIG_USB_DWC3_OF_SIMPLE=y +CONFIG_USB_DWC2=y +# CONFIG_USB_DWC2_HOST is not set + +# +# Gadget/Dual-role mode requires USB Gadget support to be enabled +# +# CONFIG_USB_DWC2_PERIPHERAL is not set +CONFIG_USB_DWC2_DUAL_ROLE=y +# CONFIG_USB_DWC2_PCI is not set +# CONFIG_USB_DWC2_DEBUG is not set +# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set +# CONFIG_USB_CHIPIDEA is not set +# CONFIG_USB_ISP1760 is not set + +# +# USB port drivers +# +CONFIG_USB_SERIAL=y +# CONFIG_USB_SERIAL_CONSOLE is not set +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_SIMPLE is not set +# CONFIG_USB_SERIAL_AIRCABLE is not set +# CONFIG_USB_SERIAL_ARK3116 is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_CH341 is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +CONFIG_USB_SERIAL_CP210X=y +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set +# CONFIG_USB_SERIAL_EMPEG is not set +CONFIG_USB_SERIAL_FTDI_SIO=y +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_F81232 is not set +# CONFIG_USB_SERIAL_F8153X is not set +# CONFIG_USB_SERIAL_GARMIN is not set +# CONFIG_USB_SERIAL_IPW is not set +# CONFIG_USB_SERIAL_IUU is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +CONFIG_USB_SERIAL_KEYSPAN=y +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_METRO is not set +# CONFIG_USB_SERIAL_MOS7720 is not set +# CONFIG_USB_SERIAL_MOS7840 is not set +# CONFIG_USB_SERIAL_MXUPORT is not set +# CONFIG_USB_SERIAL_NAVMAN is not set +CONFIG_USB_SERIAL_PL2303=y +CONFIG_USB_SERIAL_OTI6858=y +# CONFIG_USB_SERIAL_QCAUX is not set +CONFIG_USB_SERIAL_QUALCOMM=y +# CONFIG_USB_SERIAL_SPCP8X5 is not set +# CONFIG_USB_SERIAL_SAFE is not set +CONFIG_USB_SERIAL_SIERRAWIRELESS=y +# CONFIG_USB_SERIAL_SYMBOL is not set +# CONFIG_USB_SERIAL_TI is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +CONFIG_USB_SERIAL_WWAN=y +CONFIG_USB_SERIAL_OPTION=y +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_SERIAL_OPTICON is not set +# CONFIG_USB_SERIAL_XSENS_MT is not set +# CONFIG_USB_SERIAL_WISHBONE is not set +# CONFIG_USB_SERIAL_SSU100 is not set +# CONFIG_USB_SERIAL_QT2 is not set +# CONFIG_USB_SERIAL_UPD78F0730 is not set +# CONFIG_USB_SERIAL_DEBUG is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_APPLE_MFI_FASTCHARGE is not set +# CONFIG_USB_SISUSBVGA is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_EHSET_TEST_FIXTURE is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_YUREX is not set +CONFIG_USB_EZUSB_FX2=y +# CONFIG_USB_HUB_USB251XB is not set +# CONFIG_USB_HSIC_USB3503 is not set +# CONFIG_USB_HSIC_USB4604 is not set +# CONFIG_USB_LINK_LAYER_TEST is not set +# CONFIG_USB_CHAOSKEY is not set + +# +# USB Physical Layer drivers +# +CONFIG_USB_PHY=y +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_USB_GPIO_VBUS is not set +# CONFIG_USB_ISP1301 is not set +# CONFIG_USB_ULPI is not set +# end of USB Physical Layer drivers + +CONFIG_USB_GADGET=y +# CONFIG_USB_GADGET_DEBUG is not set +CONFIG_USB_GADGET_DEBUG_FILES=y +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_VBUS_DRAW=500 +CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 +# CONFIG_U_SERIAL_CONSOLE is not set + +# +# USB Peripheral Controller +# +# CONFIG_USB_FOTG210_UDC is not set +# CONFIG_USB_GR_UDC is not set +# CONFIG_USB_R8A66597 is not set +# CONFIG_USB_PXA27X is not set +# CONFIG_USB_MV_UDC is not set +# CONFIG_USB_MV_U3D is not set +# CONFIG_USB_SNP_UDC_PLAT is not set +# CONFIG_USB_M66592 is not set +# CONFIG_USB_BDC_UDC is not set +# CONFIG_USB_AMD5536UDC is not set +# CONFIG_USB_NET2272 is not set +# CONFIG_USB_NET2280 is not set +# CONFIG_USB_GOKU is not set +# CONFIG_USB_EG20T is not set +# CONFIG_USB_GADGET_XILINX is not set +# CONFIG_USB_MAX3420_UDC is not set +# CONFIG_USB_DUMMY_HCD is not set +# end of USB Peripheral Controller + +CONFIG_USB_LIBCOMPOSITE=y +CONFIG_USB_F_ACM=y +CONFIG_USB_U_SERIAL=y +CONFIG_USB_F_MASS_STORAGE=y +CONFIG_USB_F_FS=y +CONFIG_USB_F_UVC=y +CONFIG_USB_CONFIGFS=y +# CONFIG_USB_CONFIGFS_SERIAL is not set +CONFIG_USB_CONFIGFS_ACM=y +# CONFIG_USB_CONFIGFS_OBEX is not set +# CONFIG_USB_CONFIGFS_NCM is not set +# CONFIG_USB_CONFIGFS_ECM is not set +# CONFIG_USB_CONFIGFS_ECM_SUBSET is not set +# CONFIG_USB_CONFIGFS_RNDIS is not set +# CONFIG_USB_CONFIGFS_EEM is not set +CONFIG_USB_CONFIGFS_MASS_STORAGE=y +# CONFIG_USB_CONFIGFS_F_LB_SS is not set +CONFIG_USB_CONFIGFS_F_FS=y +# CONFIG_USB_CONFIGFS_F_HID is not set +CONFIG_USB_CONFIGFS_F_UVC=y +# CONFIG_USB_CONFIGFS_F_PRINTER is not set + +# +# USB Gadget precomposed configurations +# +# CONFIG_USB_ZERO is not set +# CONFIG_USB_ETH is not set +# CONFIG_USB_G_NCM is not set +# CONFIG_USB_GADGETFS is not set +# CONFIG_USB_FUNCTIONFS is not set +CONFIG_USB_MASS_STORAGE=m +# CONFIG_USB_G_SERIAL is not set +# CONFIG_USB_G_PRINTER is not set +# CONFIG_USB_CDC_COMPOSITE is not set +# CONFIG_USB_G_ACM_MS is not set +# CONFIG_USB_G_MULTI is not set +# CONFIG_USB_G_HID is not set +# CONFIG_USB_G_DBGP is not set +# CONFIG_USB_G_WEBCAM is not set +# CONFIG_USB_RAW_GADGET is not set +# end of USB Gadget precomposed configurations + +# CONFIG_TYPEC is not set +CONFIG_USB_ROLE_SWITCH=y +CONFIG_MMC=y +CONFIG_PWRSEQ_EMMC=y +# CONFIG_PWRSEQ_SD8787 is not set +CONFIG_PWRSEQ_SIMPLE=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_BLOCK_MINORS=32 +# CONFIG_SDIO_UART is not set +CONFIG_MMC_TEST=y + +# +# MMC/SD/SDIO Host Controller Drivers +# +# CONFIG_MMC_DEBUG is not set +# CONFIG_MMC_ARMMMCI is not set +CONFIG_MMC_SDHCI=y +# CONFIG_MMC_SDHCI_PCI is not set +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_SDHCI_OF_ARASAN=y +# CONFIG_MMC_SDHCI_OF_ASPEED is not set +# CONFIG_MMC_SDHCI_OF_AT91 is not set +CONFIG_MMC_SDHCI_OF_DWCMSHC=y +# CONFIG_MMC_SDHCI_CADENCE is not set +# CONFIG_MMC_SDHCI_F_SDH30 is not set +# CONFIG_MMC_SDHCI_MILBEAUT is not set +# CONFIG_MMC_TIFM_SD is not set +# CONFIG_MMC_SPI is not set +# CONFIG_MMC_CB710 is not set +# CONFIG_MMC_VIA_SDMMC is not set +CONFIG_MMC_DW=y +CONFIG_MMC_DW_PLTFM=y +# CONFIG_MMC_DW_BLUEFIELD is not set +# CONFIG_MMC_DW_EXYNOS is not set +# CONFIG_MMC_DW_HI3798CV200 is not set +# CONFIG_MMC_DW_K3 is not set +# CONFIG_MMC_DW_PCI is not set +CONFIG_MMC_DW_ROCKCHIP=y +# CONFIG_MMC_VUB300 is not set +# CONFIG_MMC_USHC is not set +# CONFIG_MMC_USDHI6ROL0 is not set +CONFIG_MMC_CQHCI=y +# CONFIG_MMC_HSQ is not set +# CONFIG_MMC_TOSHIBA_PCI is not set +# CONFIG_MMC_MTK is not set +# CONFIG_MMC_SDHCI_XENON is not set +# CONFIG_MMC_SDHCI_OMAP is not set +# CONFIG_MMC_SDHCI_AM654 is not set +# CONFIG_MEMSTICK is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +# CONFIG_LEDS_CLASS_FLASH is not set +# CONFIG_LEDS_CLASS_MULTICOLOR is not set +# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set + +# +# LED drivers +# +# CONFIG_LEDS_AN30259A is not set +# CONFIG_LEDS_AW2013 is not set +# CONFIG_LEDS_BCM6328 is not set +# CONFIG_LEDS_BCM6358 is not set +# CONFIG_LEDS_CR0014114 is not set +# CONFIG_LEDS_EL15203000 is not set +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_LM3532 is not set +# CONFIG_LEDS_LM3642 is not set +# CONFIG_LEDS_LM3692X is not set +# CONFIG_LEDS_PCA9532 is not set +CONFIG_LEDS_GPIO=y +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP3952 is not set +# CONFIG_LEDS_LP50XX is not set +# CONFIG_LEDS_LP55XX_COMMON is not set +# CONFIG_LEDS_LP8860 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_PCA963X is not set +# CONFIG_LEDS_DAC124S085 is not set +# CONFIG_LEDS_PWM is not set +# CONFIG_LEDS_REGULATOR is not set +# CONFIG_LEDS_BD2802 is not set +# CONFIG_LEDS_LT3593 is not set +# CONFIG_LEDS_TCA6507 is not set +# CONFIG_LEDS_TLC591XX is not set +# CONFIG_LEDS_LM355x is not set +# CONFIG_LEDS_IS31FL319X is not set +CONFIG_LEDS_IS31FL32XX=y + +# +# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM) +# +# CONFIG_LEDS_BLINKM is not set +# CONFIG_LEDS_SYSCON is not set +# CONFIG_LEDS_MLXREG is not set +# CONFIG_LEDS_USER is not set +# CONFIG_LEDS_SPI_BYTE is not set +# CONFIG_LEDS_TI_LMU_COMMON is not set + +# +# LED Triggers +# +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=y +# CONFIG_LEDS_TRIGGER_ONESHOT is not set +# CONFIG_LEDS_TRIGGER_DISK is not set +# CONFIG_LEDS_TRIGGER_MTD is not set +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_CPU is not set +# CONFIG_LEDS_TRIGGER_ACTIVITY is not set +CONFIG_LEDS_TRIGGER_GPIO=y +CONFIG_LEDS_TRIGGER_DEFAULT_ON=y + +# +# iptables trigger is under Netfilter config (LED target) +# +# CONFIG_LEDS_TRIGGER_TRANSIENT is not set +# CONFIG_LEDS_TRIGGER_CAMERA is not set +# CONFIG_LEDS_TRIGGER_PANIC is not set +# CONFIG_LEDS_TRIGGER_NETDEV is not set +# CONFIG_LEDS_TRIGGER_PATTERN is not set +# CONFIG_LEDS_TRIGGER_AUDIO is not set +# CONFIG_ACCESSIBILITY is not set +# CONFIG_INFINIBAND is not set +CONFIG_EDAC_SUPPORT=y +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +CONFIG_RTC_SYSTOHC=y +CONFIG_RTC_SYSTOHC_DEVICE="rtc0" +# CONFIG_RTC_DEBUG is not set +CONFIG_RTC_NVMEM=y + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set +# CONFIG_RTC_DRV_TEST is not set + +# +# I2C RTC drivers +# +# CONFIG_RTC_DRV_ABB5ZES3 is not set +# CONFIG_RTC_DRV_ABEOZ9 is not set +# CONFIG_RTC_DRV_ABX80X is not set +# CONFIG_RTC_DRV_DS1307 is not set +# CONFIG_RTC_DRV_DS1374 is not set +# CONFIG_RTC_DRV_DS1672 is not set +# CONFIG_RTC_DRV_HYM8563 is not set +# CONFIG_RTC_DRV_MAX6900 is not set +# CONFIG_RTC_DRV_RK808 is not set +# CONFIG_RTC_DRV_RS5C372 is not set +# CONFIG_RTC_DRV_ISL1208 is not set +# CONFIG_RTC_DRV_ISL12022 is not set +# CONFIG_RTC_DRV_ISL12026 is not set +# CONFIG_RTC_DRV_X1205 is not set +# CONFIG_RTC_DRV_PCF8523 is not set +# CONFIG_RTC_DRV_PCF85063 is not set +# CONFIG_RTC_DRV_PCF85363 is not set +CONFIG_RTC_DRV_PCF8563=y +# CONFIG_RTC_DRV_PCF8583 is not set +# CONFIG_RTC_DRV_M41T80 is not set +# CONFIG_RTC_DRV_BQ32K is not set +# CONFIG_RTC_DRV_TPS6586X is not set +# CONFIG_RTC_DRV_S35390A is not set +# CONFIG_RTC_DRV_FM3130 is not set +# CONFIG_RTC_DRV_RX8010 is not set +# CONFIG_RTC_DRV_RX8581 is not set +# CONFIG_RTC_DRV_RX8025 is not set +# CONFIG_RTC_DRV_EM3027 is not set +# CONFIG_RTC_DRV_RV3028 is not set +# CONFIG_RTC_DRV_RV3032 is not set +# CONFIG_RTC_DRV_RV8803 is not set +# CONFIG_RTC_DRV_SD3078 is not set + +# +# SPI RTC drivers +# +# CONFIG_RTC_DRV_M41T93 is not set +# CONFIG_RTC_DRV_M41T94 is not set +# CONFIG_RTC_DRV_DS1302 is not set +# CONFIG_RTC_DRV_DS1305 is not set +# CONFIG_RTC_DRV_DS1343 is not set +# CONFIG_RTC_DRV_DS1347 is not set +# CONFIG_RTC_DRV_DS1390 is not set +# CONFIG_RTC_DRV_MAX6916 is not set +# CONFIG_RTC_DRV_R9701 is not set +# CONFIG_RTC_DRV_RX4581 is not set +# CONFIG_RTC_DRV_RX6110 is not set +# CONFIG_RTC_DRV_RS5C348 is not set +# CONFIG_RTC_DRV_MAX6902 is not set +# CONFIG_RTC_DRV_PCF2123 is not set +# CONFIG_RTC_DRV_MCP795 is not set +CONFIG_RTC_I2C_AND_SPI=y + +# +# SPI and I2C RTC drivers +# +# CONFIG_RTC_DRV_DS3232 is not set +# CONFIG_RTC_DRV_PCF2127 is not set +# CONFIG_RTC_DRV_RV3029C2 is not set + +# +# Platform RTC drivers +# +# CONFIG_RTC_DRV_DS1286 is not set +# CONFIG_RTC_DRV_DS1511 is not set +# CONFIG_RTC_DRV_DS1553 is not set +# CONFIG_RTC_DRV_DS1685_FAMILY is not set +# CONFIG_RTC_DRV_DS1742 is not set +# CONFIG_RTC_DRV_DS2404 is not set +# CONFIG_RTC_DRV_STK17TA8 is not set +# CONFIG_RTC_DRV_M48T86 is not set +# CONFIG_RTC_DRV_M48T35 is not set +# CONFIG_RTC_DRV_M48T59 is not set +# CONFIG_RTC_DRV_MSM6242 is not set +# CONFIG_RTC_DRV_BQ4802 is not set +# CONFIG_RTC_DRV_RP5C01 is not set +# CONFIG_RTC_DRV_V3020 is not set +# CONFIG_RTC_DRV_ZYNQMP is not set + +# +# on-CPU RTC drivers +# +# CONFIG_RTC_DRV_PL030 is not set +# CONFIG_RTC_DRV_PL031 is not set +# CONFIG_RTC_DRV_CADENCE is not set +# CONFIG_RTC_DRV_FTRTC010 is not set +# CONFIG_RTC_DRV_R7301 is not set + +# +# HID Sensor RTC drivers +# +CONFIG_DMADEVICES=y +# CONFIG_DMADEVICES_DEBUG is not set + +# +# DMA Devices +# +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y +# CONFIG_ALTERA_MSGDMA is not set +# CONFIG_AMBA_PL08X is not set +# CONFIG_DW_AXI_DMAC is not set +# CONFIG_FSL_EDMA is not set +# CONFIG_FSL_QDMA is not set +# CONFIG_HISI_DMA is not set +# CONFIG_INTEL_IDMA64 is not set +# CONFIG_MV_XOR_V2 is not set +CONFIG_PL330_DMA=y +# CONFIG_PLX_DMA is not set +# CONFIG_XILINX_DMA is not set +# CONFIG_XILINX_ZYNQMP_DMA is not set +# CONFIG_XILINX_ZYNQMP_DPDMA is not set +# CONFIG_QCOM_HIDMA_MGMT is not set +# CONFIG_QCOM_HIDMA is not set +# CONFIG_DW_DMAC is not set +# CONFIG_DW_DMAC_PCI is not set +# CONFIG_DW_EDMA is not set +# CONFIG_DW_EDMA_PCIE is not set +# CONFIG_SF_PDMA is not set + +# +# DMA Clients +# +# CONFIG_ASYNC_TX_DMA is not set +# CONFIG_DMATEST is not set + +# +# DMABUF options +# +CONFIG_SYNC_FILE=y +# CONFIG_SW_SYNC is not set +# CONFIG_UDMABUF is not set +# CONFIG_DMABUF_MOVE_NOTIFY is not set +# CONFIG_DMABUF_SELFTESTS is not set +# CONFIG_DMABUF_HEAPS is not set +# end of DMABUF options + +# CONFIG_AUXDISPLAY is not set +# CONFIG_UIO is not set +# CONFIG_VFIO is not set +# CONFIG_VIRT_DRIVERS is not set +CONFIG_VIRTIO_MENU=y +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTIO_MMIO is not set +# CONFIG_VDPA is not set +CONFIG_VHOST_MENU=y +# CONFIG_VHOST_NET is not set +# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set + +# +# Microsoft Hyper-V guest support +# +# end of Microsoft Hyper-V guest support + +# CONFIG_GREYBUS is not set +CONFIG_STAGING=y +# CONFIG_PRISM2_USB is not set +# CONFIG_COMEDI is not set +# CONFIG_RTL8192U is not set +# CONFIG_RTLLIB is not set +# CONFIG_RTL8723BS is not set +# CONFIG_R8712U is not set +# CONFIG_R8188EU is not set +# CONFIG_RTS5208 is not set +# CONFIG_VT6655 is not set +# CONFIG_VT6656 is not set + +# +# IIO staging drivers +# + +# +# Accelerometers +# +# CONFIG_ADIS16203 is not set +# CONFIG_ADIS16240 is not set +# end of Accelerometers + +# +# Analog to digital converters +# +# CONFIG_AD7816 is not set +# CONFIG_AD7280 is not set +# end of Analog to digital converters + +# +# Analog digital bi-direction converters +# +# CONFIG_ADT7316 is not set +# end of Analog digital bi-direction converters + +# +# Capacitance to digital converters +# +# CONFIG_AD7150 is not set +# CONFIG_AD7746 is not set +# end of Capacitance to digital converters + +# +# Direct Digital Synthesis +# +# CONFIG_AD9832 is not set +# CONFIG_AD9834 is not set +# end of Direct Digital Synthesis + +# +# Network Analyzer, Impedance Converters +# +# CONFIG_AD5933 is not set +# end of Network Analyzer, Impedance Converters + +# +# Active energy metering IC +# +# CONFIG_ADE7854 is not set +# end of Active energy metering IC + +# +# Resolver to digital converters +# +# CONFIG_AD2S1210 is not set +# end of Resolver to digital converters +# end of IIO staging drivers + +# CONFIG_FB_SM750 is not set +# CONFIG_STAGING_MEDIA is not set + +# +# Android +# +# CONFIG_ASHMEM is not set +# CONFIG_DEBUG_KINFO is not set +# CONFIG_ION is not set +CONFIG_FIQ_DEBUGGER=y +CONFIG_FIQ_DEBUGGER_NO_SLEEP=y +# CONFIG_FIQ_DEBUGGER_WAKEUP_IRQ_ALWAYS_ON is not set +CONFIG_FIQ_DEBUGGER_CONSOLE=y +CONFIG_FIQ_DEBUGGER_CONSOLE_DEFAULT_ENABLE=y +CONFIG_FIQ_DEBUGGER_TRUST_ZONE=y +# CONFIG_FIQ_DEBUGGER_UART_OVERLAY is not set +CONFIG_RK_CONSOLE_THREAD=y +# end of Android + +# CONFIG_STAGING_BOARD is not set +# CONFIG_LTE_GDM724X is not set +# CONFIG_GS_FPGABOOT is not set +# CONFIG_UNISYSSPAR is not set +# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set +# CONFIG_FB_TFT is not set +# CONFIG_KS7010 is not set +# CONFIG_PI433 is not set + +# +# Gasket devices +# +# CONFIG_STAGING_GASKET_FRAMEWORK is not set +# end of Gasket devices + +# CONFIG_XIL_AXIS_FIFO is not set +# CONFIG_FIELDBUS_DEV is not set +# CONFIG_QLGE is not set +# CONFIG_WFX is not set +# CONFIG_GOLDFISH is not set +# CONFIG_CHROME_PLATFORMS is not set +# CONFIG_MELLANOX_PLATFORM is not set +CONFIG_HAVE_CLK=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_COMMON_CLK=y +# CONFIG_COMMON_CLK_MAX9485 is not set +CONFIG_COMMON_CLK_RK808=y +CONFIG_COMMON_CLK_SCMI=y +# CONFIG_COMMON_CLK_SI5341 is not set +# CONFIG_COMMON_CLK_SI5351 is not set +# CONFIG_COMMON_CLK_SI514 is not set +# CONFIG_COMMON_CLK_SI544 is not set +# CONFIG_COMMON_CLK_SI570 is not set +# CONFIG_COMMON_CLK_CDCE706 is not set +# CONFIG_COMMON_CLK_CDCE925 is not set +# CONFIG_COMMON_CLK_CS2000_CP is not set +# CONFIG_CLK_QORIQ is not set +# CONFIG_COMMON_CLK_XGENE is not set +# CONFIG_COMMON_CLK_PWM is not set +# CONFIG_COMMON_CLK_VC5 is not set +# CONFIG_COMMON_CLK_FIXED_MMIO is not set +CONFIG_COMMON_CLK_ROCKCHIP=y +CONFIG_CLK_PX30=y +CONFIG_CLK_RK1808=y +CONFIG_CLK_RK3328=y +CONFIG_CLK_RK3399=y +CONFIG_CLK_RK3568=y +# CONFIG_ROCKCHIP_CLK_COMPENSATION is not set +# CONFIG_ROCKCHIP_CLK_LINK is not set +CONFIG_ROCKCHIP_CLK_BOOST=y +CONFIG_ROCKCHIP_CLK_INV=y +CONFIG_ROCKCHIP_CLK_PVTM=y +CONFIG_ROCKCHIP_DDRCLK=y +# CONFIG_ROCKCHIP_DDRCLK_SCPI is not set +CONFIG_ROCKCHIP_DDRCLK_SIP=y +CONFIG_ROCKCHIP_DDRCLK_SIP_V2=y +# CONFIG_ROCKCHIP_PLL_RK3066 is not set +CONFIG_ROCKCHIP_PLL_RK3399=y +# CONFIG_ROCKCHIP_PLL_RK3588 is not set +# CONFIG_HWSPINLOCK is not set + +# +# Clock Source drivers +# +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_CLKSRC_MMIO=y +CONFIG_ROCKCHIP_TIMER=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y +CONFIG_FSL_ERRATUM_A008585=y +CONFIG_HISILICON_ERRATUM_161010101=y +CONFIG_ARM64_ERRATUM_858921=y +# CONFIG_MICROCHIP_PIT64B is not set +# end of Clock Source drivers + +CONFIG_MAILBOX=y +# CONFIG_ARM_MHU is not set +# CONFIG_PLATFORM_MHU is not set +# CONFIG_PL320_MBOX is not set +# CONFIG_ROCKCHIP_MBOX is not set +# CONFIG_ALTERA_MBOX is not set +# CONFIG_MAILBOX_TEST is not set +CONFIG_IOMMU_IOVA=y +CONFIG_IOMMU_API=y +CONFIG_IOMMU_SUPPORT=y + +# +# Generic IOMMU Pagetable Support +# +# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set +# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set +# end of Generic IOMMU Pagetable Support + +# CONFIG_IOMMU_DEBUGFS is not set +# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set +CONFIG_OF_IOMMU=y +CONFIG_IOMMU_DMA=y +CONFIG_ROCKCHIP_IOMMU=y +# CONFIG_ARM_SMMU is not set +# CONFIG_ARM_SMMU_V3 is not set + +# +# Remoteproc drivers +# +# CONFIG_REMOTEPROC is not set +# end of Remoteproc drivers + +# +# Rpmsg drivers +# +# CONFIG_RPMSG_QCOM_GLINK_RPM is not set +# CONFIG_RPMSG_VIRTIO is not set +# end of Rpmsg drivers + +# CONFIG_SOUNDWIRE is not set + +# +# SOC (System On Chip) specific Drivers +# + +# +# Amlogic SoC drivers +# +# end of Amlogic SoC drivers + +# +# Aspeed SoC drivers +# +# end of Aspeed SoC drivers + +# +# Broadcom SoC drivers +# +# CONFIG_SOC_BRCMSTB is not set +# end of Broadcom SoC drivers + +# +# NXP/Freescale QorIQ SoC drivers +# +# CONFIG_QUICC_ENGINE is not set +# CONFIG_FSL_RCPM is not set +# end of NXP/Freescale QorIQ SoC drivers + +# +# i.MX SoC drivers +# +# end of i.MX SoC drivers + +# +# Qualcomm SoC drivers +# +# end of Qualcomm SoC drivers + +# +# Rockchip CPU selection +# +CONFIG_CPU_PX30=y +CONFIG_CPU_RK1808=y +# CONFIG_CPU_RK3308 is not set +CONFIG_CPU_RK3328=y +# CONFIG_CPU_RK3368 is not set +CONFIG_CPU_RK3399=y +CONFIG_CPU_RK3568=y +# CONFIG_CPU_RK3588 is not set +# end of Rockchip CPU selection + +CONFIG_NO_GKI=y +# CONFIG_ROCKCHIP_CPUINFO is not set +# CONFIG_ROCKCHIP_GRF is not set +# CONFIG_ROCKCHIP_HW_DECOMPRESS is not set +CONFIG_ROCKCHIP_IODOMAIN=y +# CONFIG_ROCKCHIP_IOMUX is not set +# CONFIG_ROCKCHIP_IPA is not set +# CONFIG_ROCKCHIP_OPP is not set +# CONFIG_ROCKCHIP_PERFORMANCE is not set +CONFIG_ROCKCHIP_PM_DOMAINS=y +CONFIG_ROCKCHIP_PVTM=y +# CONFIG_ROCKCHIP_RAMDISK is not set +CONFIG_ROCKCHIP_SUSPEND_MODE=y +# CONFIG_ROCKCHIP_SYSTEM_MONITOR is not set +CONFIG_ROCKCHIP_VENDOR_STORAGE=y +CONFIG_ROCKCHIP_MMC_VENDOR_STORAGE=y +CONFIG_ROCKCHIP_MTD_VENDOR_STORAGE=y +CONFIG_ROCKCHIP_VENDOR_STORAGE_UPDATE_LOADER=y +CONFIG_ROCKCHIP_FIQ_DEBUGGER=y +# CONFIG_ROCKCHIP_DEBUG is not set +# CONFIG_ROCKCHIP_MINI_KERNEL is not set +# CONFIG_ROCKCHIP_THUNDER_BOOT is not set +# CONFIG_ROCKCHIP_NPOR_POWERGOOD is not set +# CONFIG_RK_CMA_PROCFS is not set +# CONFIG_RK_DMABUF_PROCFS is not set +# CONFIG_RK_MEMBLOCK_PROCFS is not set +# CONFIG_SOC_TI is not set + +# +# Xilinx SoC drivers +# +# CONFIG_XILINX_VCU is not set +# end of Xilinx SoC drivers +# end of SOC (System On Chip) specific Drivers + +CONFIG_PM_DEVFREQ=y + +# +# DEVFREQ Governors +# +CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y +CONFIG_DEVFREQ_GOV_PERFORMANCE=y +CONFIG_DEVFREQ_GOV_POWERSAVE=y +CONFIG_DEVFREQ_GOV_USERSPACE=y +# CONFIG_DEVFREQ_GOV_PASSIVE is not set + +# +# DEVFREQ Drivers +# +# CONFIG_ARM_RK3399_DMC_DEVFREQ is not set +# CONFIG_ARM_ROCKCHIP_DMC_DEVFREQ is not set +# CONFIG_PM_DEVFREQ_EVENT is not set +CONFIG_EXTCON=y + +# +# Extcon Device Drivers +# +# CONFIG_EXTCON_ADC_JACK is not set +# CONFIG_EXTCON_FSA9480 is not set +# CONFIG_EXTCON_GPIO is not set +# CONFIG_EXTCON_MAX3355 is not set +# CONFIG_EXTCON_PTN5150 is not set +# CONFIG_EXTCON_RT8973A is not set +# CONFIG_EXTCON_SM5502 is not set +# CONFIG_EXTCON_USB_GPIO is not set +CONFIG_MEMORY=y +# CONFIG_ARM_PL172_MPMC is not set +CONFIG_IIO=y +CONFIG_IIO_BUFFER=y +# CONFIG_IIO_BUFFER_CB is not set +# CONFIG_IIO_BUFFER_DMA is not set +# CONFIG_IIO_BUFFER_DMAENGINE is not set +# CONFIG_IIO_BUFFER_HW_CONSUMER is not set +CONFIG_IIO_KFIFO_BUF=y +CONFIG_IIO_TRIGGERED_BUFFER=y +# CONFIG_IIO_CONFIGFS is not set +CONFIG_IIO_TRIGGER=y +CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 +# CONFIG_IIO_SW_DEVICE is not set +# CONFIG_IIO_SW_TRIGGER is not set +# CONFIG_IIO_TRIGGERED_EVENT is not set + +# +# Accelerometers +# +# CONFIG_ADIS16201 is not set +# CONFIG_ADIS16209 is not set +# CONFIG_ADXL345_I2C is not set +# CONFIG_ADXL345_SPI is not set +# CONFIG_ADXL372_SPI is not set +# CONFIG_ADXL372_I2C is not set +# CONFIG_BMA180 is not set +# CONFIG_BMA220 is not set +# CONFIG_BMA400 is not set +# CONFIG_BMC150_ACCEL is not set +# CONFIG_DA280 is not set +# CONFIG_DA311 is not set +# CONFIG_DMARD06 is not set +# CONFIG_DMARD09 is not set +# CONFIG_DMARD10 is not set +# CONFIG_IIO_ST_ACCEL_3AXIS is not set +# CONFIG_KXSD9 is not set +# CONFIG_KXCJK1013 is not set +# CONFIG_MC3230 is not set +# CONFIG_MMA7455_I2C is not set +# CONFIG_MMA7455_SPI is not set +# CONFIG_MMA7660 is not set +# CONFIG_MMA8452 is not set +# CONFIG_MMA9551 is not set +# CONFIG_MMA9553 is not set +# CONFIG_MXC4005 is not set +# CONFIG_MXC6255 is not set +# CONFIG_SCA3000 is not set +# CONFIG_STK8312 is not set +# CONFIG_STK8BA50 is not set +# end of Accelerometers + +# +# Analog to digital converters +# +# CONFIG_AD7091R5 is not set +# CONFIG_AD7124 is not set +# CONFIG_AD7192 is not set +# CONFIG_AD7266 is not set +# CONFIG_AD7291 is not set +# CONFIG_AD7292 is not set +# CONFIG_AD7298 is not set +# CONFIG_AD7476 is not set +# CONFIG_AD7606_IFACE_PARALLEL is not set +# CONFIG_AD7606_IFACE_SPI is not set +# CONFIG_AD7766 is not set +# CONFIG_AD7768_1 is not set +# CONFIG_AD7780 is not set +# CONFIG_AD7791 is not set +# CONFIG_AD7793 is not set +# CONFIG_AD7887 is not set +# CONFIG_AD7923 is not set +# CONFIG_AD7949 is not set +# CONFIG_AD799X is not set +# CONFIG_ADI_AXI_ADC is not set +# CONFIG_CC10001_ADC is not set +# CONFIG_ENVELOPE_DETECTOR is not set +# CONFIG_HI8435 is not set +# CONFIG_HX711 is not set +# CONFIG_INA2XX_ADC is not set +# CONFIG_LTC2471 is not set +# CONFIG_LTC2485 is not set +# CONFIG_LTC2496 is not set +# CONFIG_LTC2497 is not set +# CONFIG_MAX1027 is not set +# CONFIG_MAX11100 is not set +# CONFIG_MAX1118 is not set +# CONFIG_MAX1241 is not set +# CONFIG_MAX1363 is not set +# CONFIG_MAX9611 is not set +# CONFIG_MCP320X is not set +# CONFIG_MCP3422 is not set +# CONFIG_MCP3911 is not set +# CONFIG_NAU7802 is not set +CONFIG_ROCKCHIP_SARADC=y +# CONFIG_SD_ADC_MODULATOR is not set +# CONFIG_TI_ADC081C is not set +# CONFIG_TI_ADC0832 is not set +# CONFIG_TI_ADC084S021 is not set +# CONFIG_TI_ADC12138 is not set +# CONFIG_TI_ADC108S102 is not set +# CONFIG_TI_ADC128S052 is not set +# CONFIG_TI_ADC161S626 is not set +# CONFIG_TI_ADS1015 is not set +# CONFIG_TI_ADS7950 is not set +# CONFIG_TI_ADS8344 is not set +# CONFIG_TI_ADS8688 is not set +# CONFIG_TI_ADS124S08 is not set +# CONFIG_TI_TLC4541 is not set +# CONFIG_VF610_ADC is not set +# CONFIG_XILINX_XADC is not set +# end of Analog to digital converters + +# +# Analog Front Ends +# +# CONFIG_IIO_RESCALE is not set +# end of Analog Front Ends + +# +# Amplifiers +# +# CONFIG_AD8366 is not set +# CONFIG_HMC425 is not set +# end of Amplifiers + +# +# Chemical Sensors +# +# CONFIG_ATLAS_PH_SENSOR is not set +# CONFIG_ATLAS_EZO_SENSOR is not set +# CONFIG_BME680 is not set +# CONFIG_CCS811 is not set +# CONFIG_IAQCORE is not set +# CONFIG_SCD30_CORE is not set +# CONFIG_SENSIRION_SGP30 is not set +# CONFIG_SPS30 is not set +# CONFIG_VZ89X is not set +# end of Chemical Sensors + +# +# Hid Sensor IIO Common +# +# end of Hid Sensor IIO Common + +# +# SSP Sensor Common +# +# CONFIG_IIO_SSP_SENSORHUB is not set +# end of SSP Sensor Common + +# +# Digital to analog converters +# +# CONFIG_AD5064 is not set +# CONFIG_AD5360 is not set +# CONFIG_AD5380 is not set +# CONFIG_AD5421 is not set +# CONFIG_AD5446 is not set +# CONFIG_AD5449 is not set +# CONFIG_AD5592R is not set +# CONFIG_AD5593R is not set +# CONFIG_AD5504 is not set +# CONFIG_AD5624R_SPI is not set +# CONFIG_AD5686_SPI is not set +# CONFIG_AD5696_I2C is not set +# CONFIG_AD5755 is not set +# CONFIG_AD5758 is not set +# CONFIG_AD5761 is not set +# CONFIG_AD5764 is not set +# CONFIG_AD5770R is not set +# CONFIG_AD5791 is not set +# CONFIG_AD7303 is not set +# CONFIG_AD8801 is not set +# CONFIG_DPOT_DAC is not set +# CONFIG_DS4424 is not set +# CONFIG_LTC1660 is not set +# CONFIG_LTC2632 is not set +# CONFIG_M62332 is not set +# CONFIG_MAX517 is not set +# CONFIG_MAX5821 is not set +# CONFIG_MCP4725 is not set +# CONFIG_MCP4922 is not set +# CONFIG_TI_DAC082S085 is not set +# CONFIG_TI_DAC5571 is not set +# CONFIG_TI_DAC7311 is not set +# CONFIG_TI_DAC7612 is not set +# CONFIG_VF610_DAC is not set +# end of Digital to analog converters + +# +# IIO dummy driver +# +# end of IIO dummy driver + +# +# Frequency Synthesizers DDS/PLL +# + +# +# Clock Generator/Distribution +# +# CONFIG_AD9523 is not set +# end of Clock Generator/Distribution + +# +# Phase-Locked Loop (PLL) frequency synthesizers +# +# CONFIG_ADF4350 is not set +# CONFIG_ADF4371 is not set +# end of Phase-Locked Loop (PLL) frequency synthesizers +# end of Frequency Synthesizers DDS/PLL + +# +# Digital gyroscope sensors +# +# CONFIG_ADIS16080 is not set +# CONFIG_ADIS16130 is not set +# CONFIG_ADIS16136 is not set +# CONFIG_ADIS16260 is not set +# CONFIG_ADXRS290 is not set +# CONFIG_ADXRS450 is not set +# CONFIG_BMG160 is not set +# CONFIG_FXAS21002C is not set +# CONFIG_MPU3050_I2C is not set +# CONFIG_IIO_ST_GYRO_3AXIS is not set +# CONFIG_ITG3200 is not set +# end of Digital gyroscope sensors + +# +# Health Sensors +# + +# +# Heart Rate Monitors +# +# CONFIG_AFE4403 is not set +# CONFIG_AFE4404 is not set +# CONFIG_MAX30100 is not set +# CONFIG_MAX30102 is not set +# end of Heart Rate Monitors +# end of Health Sensors + +# +# Humidity sensors +# +# CONFIG_AM2315 is not set +# CONFIG_DHT11 is not set +# CONFIG_HDC100X is not set +# CONFIG_HDC2010 is not set +# CONFIG_HTS221 is not set +# CONFIG_HTU21 is not set +# CONFIG_SI7005 is not set +# CONFIG_SI7020 is not set +# end of Humidity sensors + +# +# Inertial measurement units +# +# CONFIG_ADIS16400 is not set +# CONFIG_ADIS16460 is not set +# CONFIG_ADIS16475 is not set +# CONFIG_ADIS16480 is not set +# CONFIG_BMI160_I2C is not set +# CONFIG_BMI160_SPI is not set +# CONFIG_FXOS8700_I2C is not set +# CONFIG_FXOS8700_SPI is not set +# CONFIG_KMX61 is not set +# CONFIG_INV_ICM42600_I2C is not set +# CONFIG_INV_ICM42600_SPI is not set +# CONFIG_INV_MPU6050_I2C is not set +# CONFIG_INV_MPU6050_SPI is not set +# CONFIG_IIO_ST_LSM6DSX is not set +# end of Inertial measurement units + +# +# Light sensors +# +# CONFIG_ADJD_S311 is not set +# CONFIG_ADUX1020 is not set +# CONFIG_AL3010 is not set +# CONFIG_AL3320A is not set +# CONFIG_APDS9300 is not set +# CONFIG_APDS9960 is not set +# CONFIG_AS73211 is not set +# CONFIG_BH1750 is not set +# CONFIG_BH1780 is not set +# CONFIG_CM32181 is not set +# CONFIG_CM3232 is not set +# CONFIG_CM3323 is not set +# CONFIG_CM3605 is not set +# CONFIG_CM36651 is not set +# CONFIG_GP2AP002 is not set +# CONFIG_GP2AP020A00F is not set +CONFIG_SENSORS_ISL29018=y +# CONFIG_SENSORS_ISL29028 is not set +# CONFIG_ISL29125 is not set +# CONFIG_JSA1212 is not set +# CONFIG_RPR0521 is not set +# CONFIG_LTR501 is not set +# CONFIG_LV0104CS is not set +# CONFIG_MAX44000 is not set +# CONFIG_MAX44009 is not set +# CONFIG_NOA1305 is not set +# CONFIG_OPT3001 is not set +# CONFIG_PA12203001 is not set +# CONFIG_SI1133 is not set +# CONFIG_SI1145 is not set +# CONFIG_STK3310 is not set +# CONFIG_ST_UVIS25 is not set +# CONFIG_TCS3414 is not set +# CONFIG_TCS3472 is not set +CONFIG_SENSORS_TSL2563=y +CONFIG_TSL2583=y +# CONFIG_TSL2772 is not set +# CONFIG_TSL4531 is not set +# CONFIG_US5182D is not set +# CONFIG_VCNL4000 is not set +# CONFIG_VCNL4035 is not set +# CONFIG_VEML6030 is not set +# CONFIG_VEML6070 is not set +# CONFIG_VL6180 is not set +# CONFIG_ZOPT2201 is not set +# end of Light sensors + +# +# Magnetometer sensors +# +# CONFIG_AK8974 is not set +# CONFIG_AK8975 is not set +# CONFIG_AK09911 is not set +# CONFIG_BMC150_MAGN_I2C is not set +# CONFIG_BMC150_MAGN_SPI is not set +# CONFIG_MAG3110 is not set +# CONFIG_MMC35240 is not set +# CONFIG_IIO_ST_MAGN_3AXIS is not set +# CONFIG_SENSORS_HMC5843_I2C is not set +# CONFIG_SENSORS_HMC5843_SPI is not set +# CONFIG_SENSORS_RM3100_I2C is not set +# CONFIG_SENSORS_RM3100_SPI is not set +# end of Magnetometer sensors + +# +# Multiplexers +# +# CONFIG_IIO_MUX is not set +# end of Multiplexers + +# +# Inclinometer sensors +# +# end of Inclinometer sensors + +# +# Triggers - standalone +# +# CONFIG_IIO_INTERRUPT_TRIGGER is not set +CONFIG_IIO_SYSFS_TRIGGER=y +# end of Triggers - standalone + +# +# Linear and angular position sensors +# +# end of Linear and angular position sensors + +# +# Digital potentiometers +# +# CONFIG_AD5272 is not set +# CONFIG_DS1803 is not set +# CONFIG_MAX5432 is not set +# CONFIG_MAX5481 is not set +# CONFIG_MAX5487 is not set +# CONFIG_MCP4018 is not set +# CONFIG_MCP4131 is not set +# CONFIG_MCP4531 is not set +# CONFIG_MCP41010 is not set +# CONFIG_TPL0102 is not set +# end of Digital potentiometers + +# +# Digital potentiostats +# +# CONFIG_LMP91000 is not set +# end of Digital potentiostats + +# +# Pressure sensors +# +# CONFIG_ABP060MG is not set +# CONFIG_BMP280 is not set +# CONFIG_DLHL60D is not set +# CONFIG_DPS310 is not set +# CONFIG_HP03 is not set +# CONFIG_ICP10100 is not set +# CONFIG_MPL115_I2C is not set +# CONFIG_MPL115_SPI is not set +# CONFIG_MPL3115 is not set +# CONFIG_MS5611 is not set +# CONFIG_MS5637 is not set +# CONFIG_IIO_ST_PRESS is not set +# CONFIG_T5403 is not set +# CONFIG_HP206C is not set +# CONFIG_ZPA2326 is not set +# end of Pressure sensors + +# +# Lightning sensors +# +# CONFIG_AS3935 is not set +# end of Lightning sensors + +# +# Proximity and distance sensors +# +# CONFIG_ISL29501 is not set +# CONFIG_LIDAR_LITE_V2 is not set +# CONFIG_MB1232 is not set +# CONFIG_PING is not set +# CONFIG_RFD77402 is not set +# CONFIG_SRF04 is not set +# CONFIG_SX9310 is not set +# CONFIG_SX9500 is not set +# CONFIG_SRF08 is not set +# CONFIG_VCNL3020 is not set +# CONFIG_VL53L0X_I2C is not set +# end of Proximity and distance sensors + +# +# Resolver to digital converters +# +# CONFIG_AD2S90 is not set +# CONFIG_AD2S1200 is not set +# end of Resolver to digital converters + +# +# Temperature sensors +# +# CONFIG_LTC2983 is not set +# CONFIG_MAXIM_THERMOCOUPLE is not set +# CONFIG_MLX90614 is not set +# CONFIG_MLX90632 is not set +# CONFIG_TMP006 is not set +# CONFIG_TMP007 is not set +# CONFIG_TSYS01 is not set +# CONFIG_TSYS02D is not set +# CONFIG_MAX31856 is not set +# end of Temperature sensors + +# CONFIG_NTB is not set +# CONFIG_VME_BUS is not set +CONFIG_PWM=y +CONFIG_PWM_SYSFS=y +# CONFIG_PWM_DEBUG is not set +# CONFIG_PWM_FSL_FTM is not set +# CONFIG_PWM_PCA9685 is not set +CONFIG_PWM_ROCKCHIP=y + +# +# IRQ chip support +# +CONFIG_IRQCHIP=y +CONFIG_ARM_GIC=y +CONFIG_ARM_GIC_MAX_NR=1 +CONFIG_ARM_GIC_V2M=y +CONFIG_ARM_GIC_V3=y +CONFIG_ARM_GIC_V3_ITS=y +CONFIG_ARM_GIC_V3_ITS_PCI=y +# CONFIG_AL_FIC is not set +CONFIG_PARTITION_PERCPU=y +# end of IRQ chip support + +# CONFIG_IPACK_BUS is not set +CONFIG_ARCH_HAS_RESET_CONTROLLER=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RESET_SCMI=y +# CONFIG_RESET_TI_SYSCON is not set + +# +# PHY Subsystem +# +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PHY_MIPI_DPHY=y +# CONFIG_PHY_XGENE is not set +# CONFIG_BCM_KONA_USB2_PHY is not set +# CONFIG_PHY_CADENCE_TORRENT is not set +# CONFIG_PHY_CADENCE_DPHY is not set +# CONFIG_PHY_CADENCE_SIERRA is not set +# CONFIG_PHY_CADENCE_SALVO is not set +# CONFIG_PHY_FSL_IMX8MQ_USB is not set +# CONFIG_PHY_MIXEL_MIPI_DPHY is not set +# CONFIG_PHY_PXA_28NM_HSIC is not set +# CONFIG_PHY_PXA_28NM_USB2 is not set +# CONFIG_PHY_CPCAP_USB is not set +# CONFIG_PHY_MAPPHONE_MDM6600 is not set +# CONFIG_PHY_OCELOT_SERDES is not set +# CONFIG_PHY_ROCKCHIP_CSI2_DPHY is not set +# CONFIG_PHY_ROCKCHIP_DP is not set +# CONFIG_PHY_ROCKCHIP_DPHY_RX0 is not set +CONFIG_PHY_ROCKCHIP_EMMC=y +# CONFIG_PHY_ROCKCHIP_INNO_COMBPHY is not set +# CONFIG_PHY_ROCKCHIP_INNO_HDMI is not set +CONFIG_PHY_ROCKCHIP_INNO_USB2=y +CONFIG_PHY_ROCKCHIP_INNO_USB3=y +# CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY is not set +# CONFIG_PHY_ROCKCHIP_MIPI_RX is not set +CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=y +CONFIG_PHY_ROCKCHIP_NANENG_EDP=y +# CONFIG_PHY_ROCKCHIP_NANENG_USB2 is not set +CONFIG_PHY_ROCKCHIP_PCIE=y +# CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY is not set +# CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX is not set +# CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX_HDMI is not set +CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=y +CONFIG_PHY_ROCKCHIP_TYPEC=y +CONFIG_PHY_ROCKCHIP_USB=y +# CONFIG_PHY_ROCKCHIP_USBDP is not set +# CONFIG_PHY_SAMSUNG_USB2 is not set +# end of PHY Subsystem + +# CONFIG_POWERCAP is not set +# CONFIG_MCB is not set + +# +# Performance monitor support +# +# CONFIG_ARM_CCI_PMU is not set +# CONFIG_ARM_CCN is not set +# CONFIG_ARM_CMN is not set +CONFIG_ARM_PMU=y +# CONFIG_ARM_DSU_PMU is not set +# CONFIG_ARM_SPE_PMU is not set +# CONFIG_HISI_PCIE_PMU is not set +# CONFIG_HNS3_PMU is not set +# end of Performance monitor support + +# CONFIG_RAS is not set +# CONFIG_USB4 is not set + +# +# Android +# +CONFIG_ANDROID=y +# CONFIG_ANDROID_BINDER_IPC is not set +# end of Android + +# +# Vendor Hooks +# +# CONFIG_VENDOR_HOOKS is not set +# end of Vendor Hooks + +# CONFIG_LIBNVDIMM is not set +# CONFIG_DAX is not set +CONFIG_NVMEM=y +CONFIG_NVMEM_SYSFS=y +CONFIG_ROCKCHIP_EFUSE=y +CONFIG_ROCKCHIP_OTP=y + +# +# HW tracing support +# +# CONFIG_STM is not set +# CONFIG_INTEL_TH is not set +# CONFIG_HISI_PTT is not set +# end of HW tracing support + +# CONFIG_FPGA is not set +# CONFIG_FSI is not set +CONFIG_TEE=y + +# +# TEE drivers +# +CONFIG_OPTEE=y +CONFIG_OPTEE_SHM_NUM_PRIV_PAGES=1 +# end of TEE drivers + +CONFIG_PM_OPP=y +# CONFIG_SIOX is not set +# CONFIG_SLIMBUS is not set +# CONFIG_INTERCONNECT is not set +# CONFIG_COUNTER is not set +# CONFIG_MOST is not set +# CONFIG_ROH is not set +# end of Device Drivers + +# +# File systems +# +CONFIG_DCACHE_WORD_ACCESS=y +# CONFIG_VALIDATE_FS_PARSER is not set +CONFIG_FS_IOMAP=y +# CONFIG_EXT2_FS is not set +# CONFIG_EXT3_FS is not set +CONFIG_EXT4_FS=y +CONFIG_EXT4_USE_FOR_EXT2=y +CONFIG_EXT4_FS_POSIX_ACL=y +CONFIG_EXT4_FS_SECURITY=y +# CONFIG_EXT4_DEBUG is not set +CONFIG_JBD2=y +# CONFIG_JBD2_DEBUG is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +CONFIG_XFS_FS=y +CONFIG_XFS_SUPPORT_V4=y +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_POSIX_ACL is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_ONLINE_SCRUB is not set +# CONFIG_XFS_WARN is not set +# CONFIG_XFS_DEBUG is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_NILFS2_FS is not set +# CONFIG_F2FS_FS is not set +# CONFIG_FS_DAX is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_EXPORTFS=y +# CONFIG_EXPORTFS_BLOCK_OPS is not set +CONFIG_FILE_LOCKING=y +CONFIG_MANDATORY_FILE_LOCKING=y +# CONFIG_FS_ENCRYPTION is not set +# CONFIG_FS_VERITY is not set +CONFIG_FSNOTIFY=y +# CONFIG_DNOTIFY is not set +CONFIG_INOTIFY_USER=y +# CONFIG_FANOTIFY is not set +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_AUTOFS_FS is not set +CONFIG_FUSE_FS=y +# CONFIG_CUSE is not set +# CONFIG_VIRTIO_FS is not set +# CONFIG_OVERLAY_FS is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set +# end of Caches + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +# CONFIG_UDF_FS is not set +# end of CD-ROM/DVD Filesystems + +# +# DOS/FAT/EXFAT/NT Filesystems +# +CONFIG_FAT_FS=y +# CONFIG_MSDOS_FS is not set +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=936 +CONFIG_FAT_DEFAULT_IOCHARSET="utf8" +# CONFIG_FAT_DEFAULT_UTF8 is not set +# CONFIG_EXFAT_FS is not set +CONFIG_NTFS_FS=y +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_RW is not set +# CONFIG_NTFS3_FS is not set +# end of DOS/FAT/EXFAT/NT Filesystems + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +# CONFIG_PROC_KCORE is not set +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +# CONFIG_PROC_CHILDREN is not set +CONFIG_KERNFS=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_TMPFS_XATTR=y +# CONFIG_TMPFS_INODE64 is not set +# CONFIG_HUGETLBFS is not set +CONFIG_ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y +CONFIG_MEMFD_CREATE=y +CONFIG_ARCH_HAS_GIGANTIC_PAGE=y +CONFIG_CONFIGFS_FS=y +# end of Pseudo filesystems + +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ORANGEFS_FS is not set +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_ECRYPT_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_FS_XATTR is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_RTIME=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +CONFIG_UBIFS_FS_ZSTD=y +# CONFIG_UBIFS_ATIME_SUPPORT is not set +CONFIG_UBIFS_FS_XATTR=y +CONFIG_UBIFS_FS_SECURITY=y +# CONFIG_UBIFS_FS_AUTHENTICATION is not set +# CONFIG_CRAMFS is not set +CONFIG_SQUASHFS=y +CONFIG_SQUASHFS_FILE_CACHE=y +# CONFIG_SQUASHFS_FILE_DIRECT is not set +CONFIG_SQUASHFS_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_DECOMP_MULTI is not set +# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set +# CONFIG_SQUASHFS_XATTR is not set +CONFIG_SQUASHFS_ZLIB=y +# CONFIG_SQUASHFS_LZ4 is not set +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_XZ is not set +# CONFIG_SQUASHFS_ZSTD is not set +# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_VXFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX6FS_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_PSTORE=y +CONFIG_PSTORE_DEFLATE_COMPRESS=y +# CONFIG_PSTORE_LZO_COMPRESS is not set +# CONFIG_PSTORE_LZ4_COMPRESS is not set +# CONFIG_PSTORE_LZ4HC_COMPRESS is not set +# CONFIG_PSTORE_842_COMPRESS is not set +# CONFIG_PSTORE_ZSTD_COMPRESS is not set +CONFIG_PSTORE_COMPRESS=y +CONFIG_PSTORE_DEFLATE_COMPRESS_DEFAULT=y +CONFIG_PSTORE_COMPRESS_DEFAULT="deflate" +CONFIG_PSTORE_CONSOLE=y +# CONFIG_PSTORE_PMSG is not set +# CONFIG_PSTORE_FTRACE is not set +CONFIG_PSTORE_RAM=y +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set +# CONFIG_EROFS_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V2=y +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NFS_SWAP=y +# CONFIG_NFS_V4_1 is not set +# CONFIG_NFS_USE_LEGACY_DNS is not set +CONFIG_NFS_USE_KERNEL_DNS=y +CONFIG_NFS_DISABLE_UDP_SUPPORT=y +# CONFIG_NFSD is not set +CONFIG_GRACE_PERIOD=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_SUNRPC_SWAP=y +# CONFIG_SUNRPC_DEBUG is not set +# CONFIG_CEPH_FS is not set +# CONFIG_CIFS is not set +# CONFIG_SMB_SERVER is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="utf8" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +CONFIG_NLS_CODEPAGE_936=y +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_MAC_ROMAN is not set +# CONFIG_NLS_MAC_CELTIC is not set +# CONFIG_NLS_MAC_CENTEURO is not set +# CONFIG_NLS_MAC_CROATIAN is not set +# CONFIG_NLS_MAC_CYRILLIC is not set +# CONFIG_NLS_MAC_GAELIC is not set +# CONFIG_NLS_MAC_GREEK is not set +# CONFIG_NLS_MAC_ICELAND is not set +# CONFIG_NLS_MAC_INUIT is not set +# CONFIG_NLS_MAC_ROMANIAN is not set +# CONFIG_NLS_MAC_TURKISH is not set +CONFIG_NLS_UTF8=y +# CONFIG_DLM is not set +CONFIG_UNICODE=y +# CONFIG_UNICODE_NORMALIZATION_SELFTEST is not set +CONFIG_IO_WQ=y +# end of File systems + +# +# Security options +# +CONFIG_KEYS=y +# CONFIG_KEYS_REQUEST_CACHE is not set +# CONFIG_PERSISTENT_KEYRINGS is not set +# CONFIG_TRUSTED_KEYS is not set +# CONFIG_ENCRYPTED_KEYS is not set +# CONFIG_KEY_DH_OPERATIONS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +# CONFIG_SECURITY is not set +CONFIG_SECURITYFS=y +CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y +# CONFIG_HARDENED_USERCOPY is not set +# CONFIG_FORTIFY_SOURCE is not set +# CONFIG_STATIC_USERMODEHELPER is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_LSM="lockdown,yama,loadpin,safesetid,integrity,bpf" + +# +# Kernel hardening options +# + +# +# Memory initialization +# +CONFIG_INIT_STACK_NONE=y +# CONFIG_GCC_PLUGIN_STRUCTLEAK_USER is not set +# CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF is not set +# CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL is not set +# CONFIG_GCC_PLUGIN_STACKLEAK is not set +# CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set +# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set +# end of Memory initialization +# end of Kernel hardening options + +# CONFIG_SECURITY_BOOT_INIT is not set +# end of Security options + +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_SKCIPHER=y +CONFIG_CRYPTO_SKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_AKCIPHER2=y +CONFIG_CRYPTO_AKCIPHER=y +CONFIG_CRYPTO_KPP2=y +CONFIG_CRYPTO_KPP=y +CONFIG_CRYPTO_ACOMP2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +# CONFIG_CRYPTO_USER is not set +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +CONFIG_CRYPTO_GF128MUL=y +CONFIG_CRYPTO_NULL=y +CONFIG_CRYPTO_NULL2=y +# CONFIG_CRYPTO_PCRYPT is not set +CONFIG_CRYPTO_CRYPTD=y +# CONFIG_CRYPTO_AUTHENC is not set +# CONFIG_CRYPTO_TEST is not set +CONFIG_CRYPTO_SIMD=y + +# +# Public-key cryptography +# +CONFIG_CRYPTO_RSA=y +# CONFIG_CRYPTO_DH is not set +CONFIG_CRYPTO_ECC=y +CONFIG_CRYPTO_ECDH=y +# CONFIG_CRYPTO_ECDSA is not set +# CONFIG_CRYPTO_ECRDSA is not set +# CONFIG_CRYPTO_SM2 is not set +# CONFIG_CRYPTO_CURVE25519 is not set + +# +# Authenticated Encryption with Associated Data +# +CONFIG_CRYPTO_CCM=y +CONFIG_CRYPTO_GCM=y +# CONFIG_CRYPTO_CHACHA20POLY1305 is not set +# CONFIG_CRYPTO_AEGIS128 is not set +# CONFIG_CRYPTO_SEQIV is not set +# CONFIG_CRYPTO_ECHAINIV is not set + +# +# Block modes +# +# CONFIG_CRYPTO_CBC is not set +# CONFIG_CRYPTO_CFB is not set +CONFIG_CRYPTO_CTR=y +# CONFIG_CRYPTO_CTS is not set +CONFIG_CRYPTO_ECB=y +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_OFB is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_XTS is not set +# CONFIG_CRYPTO_KEYWRAP is not set +# CONFIG_CRYPTO_ADIANTUM is not set +# CONFIG_CRYPTO_ESSIV is not set + +# +# Hash modes +# +CONFIG_CRYPTO_CMAC=y +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_VMAC is not set + +# +# Digest +# +CONFIG_CRYPTO_CRC32C=y +# CONFIG_CRYPTO_CRC32 is not set +# CONFIG_CRYPTO_XXHASH is not set +# CONFIG_CRYPTO_BLAKE2B is not set +# CONFIG_CRYPTO_BLAKE2S is not set +CONFIG_CRYPTO_CRCT10DIF=y +CONFIG_CRYPTO_GHASH=y +# CONFIG_CRYPTO_POLY1305 is not set +# CONFIG_CRYPTO_MD4 is not set +CONFIG_CRYPTO_MD5=y +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +CONFIG_CRYPTO_SHA1=y +CONFIG_CRYPTO_SHA256=y +CONFIG_CRYPTO_SHA512=y +# CONFIG_CRYPTO_SHA3 is not set +# CONFIG_CRYPTO_SM3_GENERIC is not set +# CONFIG_CRYPTO_STREEBOG is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_WP512 is not set + +# +# Ciphers +# +CONFIG_CRYPTO_AES=y +# CONFIG_CRYPTO_AES_TI is not set +# CONFIG_CRYPTO_ANUBIS is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_CHACHA20 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_SM4_GENERIC is not set +# CONFIG_CRYPTO_TEA is not set +CONFIG_CRYPTO_TWOFISH=y +CONFIG_CRYPTO_TWOFISH_COMMON=y + +# +# Compression +# +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_LZO=y +# CONFIG_CRYPTO_842 is not set +# CONFIG_CRYPTO_LZ4 is not set +# CONFIG_CRYPTO_LZ4HC is not set +CONFIG_CRYPTO_ZSTD=y + +# +# Random Number Generation +# +CONFIG_CRYPTO_ANSI_CPRNG=y +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_DRBG_HMAC=y +# CONFIG_CRYPTO_DRBG_HASH is not set +# CONFIG_CRYPTO_DRBG_CTR is not set +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_JITTERENTROPY=y +CONFIG_CRYPTO_USER_API=y +CONFIG_CRYPTO_USER_API_HASH=y +CONFIG_CRYPTO_USER_API_SKCIPHER=y +# CONFIG_CRYPTO_USER_API_RNG is not set +# CONFIG_CRYPTO_USER_API_AEAD is not set +CONFIG_CRYPTO_USER_API_ENABLE_OBSOLETE=y +CONFIG_CRYPTO_HASH_INFO=y +CONFIG_CRYPTO_HW=y +# CONFIG_CRYPTO_DEV_ATMEL_ECC is not set +# CONFIG_CRYPTO_DEV_ATMEL_SHA204A is not set +# CONFIG_CRYPTO_DEV_CCP is not set +# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set +# CONFIG_CRYPTO_DEV_CAVIUM_ZIP is not set +CONFIG_CRYPTO_DEV_ROCKCHIP=y +# CONFIG_CRYPTO_DEV_SAFEXCEL is not set +# CONFIG_CRYPTO_DEV_CCREE is not set +# CONFIG_CRYPTO_DEV_HISI_SEC is not set +# CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set +CONFIG_ASYMMETRIC_KEY_TYPE=y +CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y +CONFIG_X509_CERTIFICATE_PARSER=y +# CONFIG_PKCS8_PRIVATE_KEY_PARSER is not set +CONFIG_PKCS7_MESSAGE_PARSER=y +# CONFIG_PKCS7_TEST_KEY is not set +# CONFIG_SIGNED_PE_FILE_VERIFICATION is not set +# CONFIG_PGP_LIBRARY is not set +# CONFIG_PGP_KEY_PARSER is not set +# CONFIG_PGP_PRELOAD is not set + +# +# Certificates for signature checking +# +CONFIG_SYSTEM_TRUSTED_KEYRING=y +CONFIG_SYSTEM_TRUSTED_KEYS="" +# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set +# CONFIG_SECONDARY_TRUSTED_KEYRING is not set +# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set +# CONFIG_PGP_PRELOAD_PUBLIC_KEYS is not set +# end of Certificates for signature checking + +CONFIG_BINARY_PRINTF=y + +# +# Library routines +# +CONFIG_LINEAR_RANGES=y +# CONFIG_PACKING is not set +CONFIG_BITREVERSE=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_NET_UTILS=y +# CONFIG_CORDIC is not set +# CONFIG_PRIME_NUMBERS is not set +CONFIG_RATIONAL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_HAS_FAST_MULTIPLIER=y +CONFIG_ARCH_USE_SYM_ANNOTATIONS=y +# CONFIG_INDIRECT_PIO is not set + +# +# Crypto library routines +# +CONFIG_CRYPTO_LIB_AES=y +CONFIG_CRYPTO_LIB_ARC4=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +# CONFIG_CRYPTO_LIB_CHACHA is not set +# CONFIG_CRYPTO_LIB_CURVE25519 is not set +CONFIG_CRYPTO_LIB_DES=y +CONFIG_CRYPTO_LIB_POLY1305_RSIZE=9 +# CONFIG_CRYPTO_LIB_POLY1305 is not set +# CONFIG_CRYPTO_LIB_CHACHA20POLY1305 is not set +CONFIG_CRYPTO_LIB_SHA256=y +# end of Crypto library routines + +CONFIG_LIB_MEMNEQ=y +CONFIG_CRC_CCITT=y +CONFIG_CRC16=y +CONFIG_CRC_T10DIF=y +CONFIG_CRC_ITU_T=y +CONFIG_CRC32=y +# CONFIG_CRC32_SELFTEST is not set +CONFIG_CRC32_SLICEBY8=y +# CONFIG_CRC32_SLICEBY4 is not set +# CONFIG_CRC32_SARWATE is not set +# CONFIG_CRC32_BIT is not set +# CONFIG_CRC64 is not set +# CONFIG_CRC4 is not set +CONFIG_CRC7=y +CONFIG_LIBCRC32C=y +# CONFIG_CRC8 is not set +CONFIG_XXHASH=y +CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y +# CONFIG_RANDOM32_SELFTEST is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_LZ4_DECOMPRESS=y +CONFIG_ZSTD_COMPRESS=y +CONFIG_ZSTD_DECOMPRESS=y +CONFIG_XZ_DEC=y +# CONFIG_XZ_DEC_X86 is not set +# CONFIG_XZ_DEC_POWERPC is not set +# CONFIG_XZ_DEC_IA64 is not set +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_ARMTHUMB=y +# CONFIG_XZ_DEC_SPARC is not set +CONFIG_XZ_DEC_BCJ=y +# CONFIG_XZ_DEC_TEST is not set +CONFIG_DECOMPRESS_GZIP=y +CONFIG_DECOMPRESS_BZIP2=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DECOMPRESS_XZ=y +CONFIG_DECOMPRESS_LZO=y +CONFIG_DECOMPRESS_LZ4=y +CONFIG_DECOMPRESS_ZSTD=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_REED_SOLOMON=y +CONFIG_REED_SOLOMON_ENC8=y +CONFIG_REED_SOLOMON_DEC8=y +CONFIG_ASSOCIATIVE_ARRAY=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAS_DMA=y +CONFIG_DMA_OPS=y +CONFIG_NEED_SG_DMA_LENGTH=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_DMA_DECLARE_COHERENT=y +CONFIG_ARCH_HAS_SETUP_DMA_OPS=y +CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y +CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y +CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y +CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y +CONFIG_SWIOTLB=y +CONFIG_DMA_NONCOHERENT_MMAP=y +CONFIG_DMA_COHERENT_POOL=y +CONFIG_DMA_REMAP=y +CONFIG_DMA_DIRECT_REMAP=y +CONFIG_DMA_CMA=y +# CONFIG_DMA_PERNUMA_CMA is not set + +# +# Default contiguous memory area size: +# +CONFIG_CMA_SIZE_MBYTES=16 +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_ALIGNMENT=8 +# CONFIG_DMA_API_DEBUG is not set +# CONFIG_DMA_MAP_BENCHMARK is not set +CONFIG_SGL_ALLOC=y +CONFIG_CPU_RMAP=y +CONFIG_DQL=y +CONFIG_GLOB=y +# CONFIG_GLOB_SELFTEST is not set +CONFIG_NLATTR=y +CONFIG_CLZ_TAB=y +# CONFIG_IRQ_POLL is not set +CONFIG_MPILIB=y +CONFIG_LIBFDT=y +CONFIG_OID_REGISTRY=y +CONFIG_HAVE_GENERIC_VDSO=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_VDSO_TIME_NS=y +CONFIG_FONT_SUPPORT=y +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_SG_POOL=y +CONFIG_ARCH_STACKWALK=y +CONFIG_SBITMAP=y +# CONFIG_STRING_SELFTEST is not set +# end of Library routines + +# +# Kernel hacking +# + +# +# printk and dmesg options +# +CONFIG_PRINTK_TIME=y +# CONFIG_PRINTK_CALLER is not set +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 +CONFIG_CONSOLE_LOGLEVEL_QUIET=4 +CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 +# CONFIG_BOOT_PRINTK_DELAY is not set +CONFIG_DYNAMIC_DEBUG=y +CONFIG_DYNAMIC_DEBUG_CORE=y +CONFIG_SYMBOLIC_ERRNAME=y +CONFIG_DEBUG_BUGVERBOSE=y +# end of printk and dmesg options + +# +# Compile-time checks and compiler options +# +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_INFO_REDUCED is not set +# CONFIG_DEBUG_INFO_COMPRESSED is not set +# CONFIG_DEBUG_INFO_SPLIT is not set +# CONFIG_DEBUG_INFO_DWARF4 is not set +# CONFIG_DEBUG_INFO_BTF is not set +# CONFIG_GDB_SCRIPTS is not set +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=2048 +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_READABLE_ASM is not set +# CONFIG_HEADERS_INSTALL is not set +# CONFIG_OPTIMIZE_INLINING is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +CONFIG_SECTION_MISMATCH_WARN_ONLY=y +# CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_32B is not set +CONFIG_ARCH_WANT_FRAME_POINTERS=y +CONFIG_FRAME_POINTER=y +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# end of Compile-time checks and compiler options + +# +# Generic Kernel Debugging Instruments +# +CONFIG_MAGIC_SYSRQ=y +CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0 +CONFIG_MAGIC_SYSRQ_SERIAL=y +CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE="" +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_FS_ALLOW_ALL=y +# CONFIG_DEBUG_FS_DISALLOW_MOUNT is not set +# CONFIG_DEBUG_FS_ALLOW_NONE is not set +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y +# CONFIG_UBSAN is not set +# end of Generic Kernel Debugging Instruments + +CONFIG_DEBUG_KERNEL=y +CONFIG_DEBUG_MISC=y + +# +# Memory Debugging +# +# CONFIG_PAGE_EXTENSION is not set +# CONFIG_DEBUG_PAGEALLOC is not set +# CONFIG_PAGE_OWNER is not set +# CONFIG_PAGE_POISONING is not set +# CONFIG_DEBUG_PAGE_REF is not set +# CONFIG_DEBUG_RODATA_TEST is not set +CONFIG_ARCH_HAS_DEBUG_WX=y +# CONFIG_DEBUG_WX is not set +CONFIG_GENERIC_PTDUMP=y +# CONFIG_PTDUMP_DEBUGFS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_SLUB_STATS is not set +CONFIG_HAVE_DEBUG_KMEMLEAK=y +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_SCHED_STACK_END_CHECK is not set +CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_VM_PGTABLE is not set +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y +# CONFIG_DEBUG_VIRTUAL is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +CONFIG_HAVE_ARCH_KASAN=y +CONFIG_HAVE_ARCH_KASAN_SW_TAGS=y +CONFIG_HAVE_ARCH_KASAN_VMALLOC=y +CONFIG_CC_HAS_KASAN_GENERIC=y +CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y +# CONFIG_KASAN is not set +CONFIG_HAVE_ARCH_KFENCE=y +# CONFIG_KFENCE is not set +# end of Memory Debugging + +# CONFIG_DEBUG_SHIRQ is not set + +# +# Debug Oops, Lockups and Hangs +# +# CONFIG_PANIC_ON_OOPS is not set +CONFIG_PANIC_ON_OOPS_VALUE=0 +CONFIG_PANIC_TIMEOUT=0 +# CONFIG_SOFTLOCKUP_DETECTOR is not set + +# +# ARM64 NMI watchdog configuration +# +# end of ARM64 NMI watchdog configuration + +# CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_WQ_WATCHDOG is not set +# CONFIG_TEST_LOCKUP is not set +# end of Debug Oops, Lockups and Hangs + +# +# Scheduler Debugging +# +CONFIG_SCHED_DEBUG=y +CONFIG_SCHED_INFO=y +CONFIG_SCHEDSTATS=y +# end of Scheduler Debugging + +# CONFIG_DEBUG_TIMEKEEPING is not set +CONFIG_DEBUG_PREEMPT=y + +# +# Lock Debugging (spinlocks, mutexes, etc...) +# +CONFIG_LOCK_DEBUGGING_SUPPORT=y +# CONFIG_PROVE_LOCKING is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +CONFIG_DEBUG_SPINLOCK=y +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set +# CONFIG_DEBUG_RWSEMS is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_LOCK_TORTURE_TEST is not set +# CONFIG_WW_MUTEX_SELFTEST is not set +# CONFIG_SCF_TORTURE_TEST is not set +# CONFIG_CSD_LOCK_WAIT_DEBUG is not set +# end of Lock Debugging (spinlocks, mutexes, etc...) + +CONFIG_STACKTRACE=y +# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_HAVE_DEBUG_BUGVERBOSE=y + +# +# Debug kernel data structures +# +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_PLIST is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_BUG_ON_DATA_CORRUPTION is not set +# end of Debug kernel data structures + +CONFIG_DEBUG_CREDENTIALS=y + +# +# RCU Debugging +# +# CONFIG_RCU_SCALE_TEST is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_RCU_REF_SCALE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +CONFIG_RCU_TRACE=y +# CONFIG_RCU_EQS_DEBUG is not set +# end of RCU Debugging + +# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set +# CONFIG_LATENCYTOP is not set +CONFIG_NOP_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_TRACE_CLOCK=y +CONFIG_RING_BUFFER=y +CONFIG_EVENT_TRACING=y +CONFIG_CONTEXT_SWITCH_TRACER=y +CONFIG_TRACING=y +CONFIG_GENERIC_TRACER=y +CONFIG_TRACING_SUPPORT=y +CONFIG_FTRACE=y +# CONFIG_BOOTTIME_TRACING is not set +CONFIG_FUNCTION_TRACER=y +CONFIG_FUNCTION_GRAPH_TRACER=y +CONFIG_DYNAMIC_FTRACE=y +CONFIG_DYNAMIC_FTRACE_WITH_REGS=y +# CONFIG_FUNCTION_PROFILER is not set +# CONFIG_STACK_TRACER is not set +# CONFIG_IRQSOFF_TRACER is not set +# CONFIG_PREEMPT_TRACER is not set +# CONFIG_SCHED_TRACER is not set +# CONFIG_HWLAT_TRACER is not set +# CONFIG_OSNOISE_TRACER is not set +# CONFIG_TIMERLAT_TRACER is not set +# CONFIG_FTRACE_SYSCALLS is not set +# CONFIG_TRACER_SNAPSHOT is not set +CONFIG_BRANCH_PROFILE_NONE=y +# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set +# CONFIG_PROFILE_ALL_BRANCHES is not set +CONFIG_BLK_DEV_IO_TRACE=y +CONFIG_UPROBE_EVENTS=y +CONFIG_DYNAMIC_EVENTS=y +CONFIG_PROBE_EVENTS=y +CONFIG_FTRACE_MCOUNT_RECORD=y +# CONFIG_SYNTH_EVENTS is not set +# CONFIG_HIST_TRIGGERS is not set +# CONFIG_TRACE_EVENT_INJECT is not set +# CONFIG_TRACEPOINT_BENCHMARK is not set +# CONFIG_RING_BUFFER_BENCHMARK is not set +# CONFIG_TRACE_EVAL_MAP_FILE is not set +# CONFIG_FTRACE_STARTUP_TEST is not set +# CONFIG_RING_BUFFER_STARTUP_TEST is not set +# CONFIG_PREEMPTIRQ_DELAY_TEST is not set +# CONFIG_SAMPLES is not set +CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y +CONFIG_STRICT_DEVMEM=y +# CONFIG_IO_STRICT_DEVMEM is not set + +# +# arm64 Debugging +# +# CONFIG_PID_IN_CONTEXTIDR is not set +# CONFIG_ARM64_RELOC_TEST is not set +# CONFIG_CORESIGHT is not set +# end of arm64 Debugging + +# +# Kernel Testing and Coverage +# +# CONFIG_KUNIT is not set +# CONFIG_NOTIFIER_ERROR_INJECTION is not set +# CONFIG_FAULT_INJECTION is not set +CONFIG_ARCH_HAS_KCOV=y +CONFIG_CC_HAS_SANCOV_TRACE_PC=y +# CONFIG_KCOV is not set +CONFIG_RUNTIME_TESTING_MENU=y +CONFIG_LKDTM=y +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_TEST_MIN_HEAP is not set +# CONFIG_TEST_SORT is not set +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_RBTREE_TEST is not set +# CONFIG_REED_SOLOMON_TEST is not set +# CONFIG_INTERVAL_TREE_TEST is not set +# CONFIG_PERCPU_TEST is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_TEST_HEXDUMP is not set +# CONFIG_TEST_STRING_HELPERS is not set +# CONFIG_TEST_STRSCPY is not set +# CONFIG_TEST_KSTRTOX is not set +# CONFIG_TEST_PRINTF is not set +# CONFIG_TEST_BITMAP is not set +# CONFIG_TEST_UUID is not set +# CONFIG_TEST_XARRAY is not set +# CONFIG_TEST_OVERFLOW is not set +# CONFIG_TEST_RHASHTABLE is not set +# CONFIG_TEST_HASH is not set +# CONFIG_TEST_IDA is not set +# CONFIG_TEST_LKM is not set +# CONFIG_TEST_BITOPS is not set +# CONFIG_TEST_VMALLOC is not set +# CONFIG_TEST_USER_COPY is not set +# CONFIG_TEST_BPF is not set +# CONFIG_TEST_BLACKHOLE_DEV is not set +# CONFIG_FIND_BIT_BENCHMARK is not set +# CONFIG_TEST_FIRMWARE is not set +# CONFIG_TEST_SYSCTL is not set +# CONFIG_TEST_UDELAY is not set +# CONFIG_TEST_STATIC_KEYS is not set +# CONFIG_TEST_KMOD is not set +# CONFIG_TEST_MEMCAT_P is not set +# CONFIG_TEST_STACKINIT is not set +# CONFIG_TEST_MEMINIT is not set +# CONFIG_TEST_FREE_PAGES is not set +# CONFIG_MEMTEST is not set +# end of Kernel Testing and Coverage +# end of Kernel hacking diff --git a/bsp/meta-rockchip/recipes-kernel/linux/files/logo/logo.bmp b/bsp/meta-rockchip/recipes-kernel/linux/files/logo/logo.bmp new file mode 100644 index 0000000000000000000000000000000000000000..750a0bb18043267b6ba21856ce4d6659493e3bb1 Binary files /dev/null and b/bsp/meta-rockchip/recipes-kernel/linux/files/logo/logo.bmp differ diff --git a/bsp/meta-rockchip/recipes-kernel/linux/files/logo/logo_kernel.bmp b/bsp/meta-rockchip/recipes-kernel/linux/files/logo/logo_kernel.bmp new file mode 100644 index 0000000000000000000000000000000000000000..1afef1ed156e4732fa2cf7489177d8faf77c7e76 Binary files /dev/null and b/bsp/meta-rockchip/recipes-kernel/linux/files/logo/logo_kernel.bmp differ diff --git a/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0000-rk3568-kernel.patch.gz b/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0000-rk3568-kernel.patch.gz new file mode 100644 index 0000000000000000000000000000000000000000..004b085722d80cd18c6f9e1490c84caef53d06be Binary files /dev/null and b/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0000-rk3568-kernel.patch.gz differ diff --git a/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0001-rk3568-8897-dts.patch b/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0001-rk3568-8897-dts.patch new file mode 100644 index 0000000000000000000000000000000000000000..c52d1cdb8f34e610e391cf7675f655af1bc5d826 --- /dev/null +++ b/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0001-rk3568-8897-dts.patch @@ -0,0 +1,3054 @@ +diff -uprN a/arch/arm64/boot/dts/rockchip/rk3568-8897-ddr4-v1-linux-base.dts b/arch/arm64/boot/dts/rockchip/rk3568-8897-ddr4-v1-linux-base.dts +--- a/arch/arm64/boot/dts/rockchip/rk3568-8897-ddr4-v1-linux-base.dts 1970-01-01 00:00:00.000000000 +0000 ++++ b/arch/arm64/boot/dts/rockchip/rk3568-8897-ddr4-v1-linux-base.dts 2023-03-15 03:59:07.051206609 +0000 +@@ -0,0 +1,569 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2020 Rockchip Electronics Co., Ltd. ++ * ++ */ ++ ++#include "rk3568-evb1-ddr4-v10.dtsi" ++#include "rk3568-linux.dtsi" ++#include ++ ++/ { ++ boardtype = "RK3568 8897 board V1 (linux base)"; ++ ++ chosen: chosen { ++ bootargs = "earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 root=PARTUUID=614e0000-0000 rw rootwait"; ++ }; ++ ++ fiq-debugger { ++ compatible = "rockchip,fiq-debugger"; ++ rockchip,serial-id = <2>; ++ rockchip,wake-irq = <0>; ++ /* If enable uart uses irq instead of fiq */ ++ rockchip,irq-mode-enable = <1>; ++ rockchip,baudrate = <115200>; /* Only 115200 and 1500000 */ ++ interrupts = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart2m0_xfer>; ++ status = "okay"; ++ }; ++ ++ lvds_panel: lvds-panel { ++ compatible = "simple-panel"; ++ status = "disabled"; ++ }; ++ ++ edp_panel: edp-panel { ++ compatible ="simple-panel"; ++ status = "disabled"; ++ }; ++ ++ ryd_gpio_control:ryd-gpio-control { ++ compatible = "ryd_gpio_control"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gl3523_reset &usb_host_en &hub_rst &gpio3_a4_mux &gpio3_a5_mux &gpio3_b5 &gpio3_c1 &gpio0_c4>; ++ status = "okay"; ++ ++ gl3523_rst: gl3523-rst { ++ gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; ++ //can set dir_in, default is dir_out ++ pull_cfg = <0>; //<0>=null, <1>=pulldown, <2>=pullup ++ sys_create; // if set, will export the gpio in sysfs ++ export; ++ }; ++ ++ usb_host_en{ ++ gpio = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>; ++ //can set dir_in, default is dir_out ++ pull_cfg = <0>; //<0>=null, <1>=pulldown, <2>=pullup ++ sys_create; // if set, will export the gpio in sysfs ++ export; ++ }; ++/* ++ pcie_pwren{ ++ gpio = <&gpio2 RK_PD7 GPIO_ACTIVE_HIGH>; ++ //can set dir_in, default is dir_out ++ pull_cfg = <0>; //<0>=null, <1>=pulldown, <2>=pullup ++ //sys_create; // if set, will export the gpio in sysfs ++ //export; ++ }; ++*/ ++ hub_rst { ++ gpio = <&gpio3 RK_PA0 GPIO_ACTIVE_HIGH>; ++ //can set dir_in, default is dir_out ++ pull_cfg = <0>; //<0>=null, <1>=pulldown, <2>=pullup ++ //sys_create; // if set, will export the gpio in sysfs ++ }; ++ ++ gpio3_a4:gpio3_a4 { ++ gpio = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>; ++ //can set dir_in, default is dir_out ++ pull_cfg = <0>; //<0>=null, <1>=pulldown, <2>=pullup ++ sys_create; // if set, will export the gpio in sysfs ++ export; ++ }; ++ ++ gpio3_a5:gpio3_a5 { ++ gpio = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; ++ //can set dir_in, default is dir_out ++ pull_cfg = <0>; //<0>=null, <1>=pulldown, <2>=pullup ++ sys_create; // if set, will export the gpio in sysfs ++ export; ++ }; ++ ++ gpio3_b5 { ++ gpio = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; ++ //can set dir_in, default is dir_out ++ pull_cfg = <0>; //<0>=null, <1>=pulldown, <2>=pullup ++ sys_create; // if set, will export the gpio in sysfs ++ export; ++ }; ++ gpio3_c1{ ++ gpio = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>; ++ //can set dir_in, default is dir_out ++ pull_cfg = <0>; //<0>=null, <1>=pulldown, <2>=pullup ++ sys_create; // if set, will export the gpio in sysfs ++ export; ++ }; ++ gpio0_c4{ ++ gpio = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>; ++ //can set dir_in, default is dir_out ++ pull_cfg = <0>; //<0>=null, <1>=pulldown, <2>=pullup ++ sys_create; // if set, will export the gpio in sysfs ++ export; ++ }; ++ }; ++ ++ rk_modem: rk-modem { ++ compatible="4g-modem-platdata"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <<e_power_en <e_reset>; ++ 4G,vbat-gpio = <&gpio1 RK_PD3 GPIO_ACTIVE_HIGH>; ++ 4G,disable = <&gpio1 RK_PB0 GPIO_ACTIVE_HIGH>; ++ 4G,power = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; ++ 4G,reset = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++ }; ++/* ++ usb_host_en: usb-host-en { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb-host-en"; ++ gpio = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ enable-active-high; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++*/ ++ vcc5v0_host1: vcc5v0-host1-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_host1_en>; ++ regulator-name = "vcc5v0_host1"; ++ regulator-always-on; ++ }; ++ ++ pcie30_3v3: gpio-regulator { ++ compatible = "regulator-gpio"; ++ regulator-name = "pcie30_3v3"; ++ regulator-min-microvolt = <100000>; ++ regulator-max-microvolt = <3300000>; ++ gpios = <&gpio2 RK_PD7 GPIO_ACTIVE_HIGH>; ++ gpios-states = <0x1>; ++ states = <100000 0x0 ++ 3300000 0x1>; ++ }; ++}; ++ ++&wireless_bluetooth { ++ compatible = "bluetooth-platdata"; ++ clocks = <&rk809 1>; ++ clock-names = "ext_clock"; ++ //wifi-bt-power-toggle; ++ uart_rts_gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>; ++ pinctrl-names = "default", "rts_gpio"; ++ pinctrl-0 = <&uart8m0_rtsn>; ++ pinctrl-1 = <&uart8_gpios>; ++ BT,reset_gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; ++ BT,wake_gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_HIGH>; ++ BT,wake_host_irq = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++}; ++ ++&gmac0 { ++ snps,reset-gpio = <&gpio2 RK_PD0 GPIO_ACTIVE_LOW>; ++ status = "okay"; ++}; ++ ++&gmac1 { ++ snps,reset-gpio = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>; ++ status = "okay"; ++}; ++ ++// EDP1 backlight ++&pwm4 { ++ status = "okay"; ++ pinctrl-names = "active"; ++ pinctrl-0 = <&pwm4_pins>; ++}; ++ ++&pwm5 { ++ status = "disabled"; ++}; ++ ++&pwm6 { ++ status = "okay"; ++ pinctrl-names = "active"; ++ pinctrl-0 = <&pwm6_pins>; ++}; ++ ++// LVDS backlight ++&pwm7 { ++ status = "disabled"; ++ pinctrl-names = "active"; ++ pinctrl-0 = <&pwm7_pins>; ++}; ++ ++&dmc { ++ compatible = "rockchip,rk3568-dmc"; ++ interrupts = ; ++ interrupt-names = "complete"; ++ devfreq-events = <&dfi>; ++ //clocks = <&cru SCLK_DDRCLK>; ++ clock-names = "dmc_clk"; ++ operating-points-v2 = <&dmc_opp_table>; ++ ++ system-status-freq = < ++ /*system status freq(KHz)*/ ++ SYS_STATUS_NORMAL 780000 ++ SYS_STATUS_REBOOT 1184000 ++ SYS_STATUS_SUSPEND 324000 ++ SYS_STATUS_VIDEO_4K 780000 ++ SYS_STATUS_VIDEO_4K_10B 780000 ++ SYS_STATUS_BOOST 1184000 ++ SYS_STATUS_ISP 1184000 ++ SYS_STATUS_PERFORMANCE 1184000 ++ SYS_STATUS_DUALVIEW 1184000 ++ >; ++ ++ status = "okay"; ++}; ++ ++&dmc_opp_table{ ++ compatible = "operating-points-v2"; ++ ++ mbist-vmin = <825000 900000 950000>; ++ nvmem-cells = <&log_leakage>, <&core_pvtm>, <&mbist_vmin>; ++ nvmem-cell-names = "leakage", "pvtm", "mbist-vmin"; ++ rockchip,temp-hysteresis = <5000>; ++ rockchip,low-temp = <0>; ++ rockchip,low-temp-adjust-volt = < ++ /* MHz MHz uV */ ++ 0 1560 25000 ++ >; ++ rockchip,leakage-voltage-sel = < ++ 1 80 0 ++ 81 254 1 ++ >; ++ ++ opp-324000000 { ++ opp-hz = /bits/ 64 <324000000>; ++ opp-microvolt = <900000>; ++ opp-microvolt-L0 = <900000>; ++ opp-microvolt-L1 = <850000>; ++ }; ++ opp-528000000 { ++ opp-hz = /bits/ 64 <528000000>; ++ opp-microvolt = <900000>; ++ opp-microvolt-L0 = <900000>; ++ opp-microvolt-L1 = <850000>; ++ }; ++ opp-780000000 { ++ opp-hz = /bits/ 64 <780000000>; ++ opp-microvolt = <900000>; ++ opp-microvolt-L0 = <900000>; ++ opp-microvolt-L1 = <850000>; ++ }; ++ opp-920000000 { ++ opp-hz = /bits/ 64 <920000000>; ++ opp-microvolt = <900000>; ++ opp-microvolt-L0 = <900000>; ++ opp-microvolt-L1 = <850000>; ++ }; ++ opp-1184000000 { ++ opp-hz = /bits/ 64 <1184000000>; ++ opp-microvolt = <900000>; ++ opp-microvolt-L0 = <900000>; ++ opp-microvolt-L1 = <850000>; ++ }; ++ opp-1560000000 { ++ opp-hz = /bits/ 64 <1560000000>; ++ opp-microvolt = <900000>; ++ opp-microvolt-L0 = <900000>; ++ opp-microvolt-L1 = <850000>; ++ status = "disabled"; ++ }; ++}; ++ ++&i2c0 { ++ status = "okay"; ++}; ++ ++&i2c4 { ++ status = "disabled"; ++}; ++ ++&i2c5 { ++ status = "okay"; ++ ++ hym8563: hym8563@51 { ++ compatible = "haoyu,hym8563"; ++ reg = <0x51>; ++ ++ interrupt-parent = <&gpio0>; ++ interrupts = ; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_int>; ++ ++ #clock-cells = <0>; ++ clock-output-names = "xin32k"; ++ }; ++}; ++ ++&rk809 { ++ rtc { ++ status = "disabled"; ++ }; ++}; ++ ++// MIPI-DSI configuration ++&dsi0 { ++ status = "disabled"; ++}; ++ ++ ++&dsi0_in_vp0 { ++ status = "disabled"; ++}; ++ ++&dsi0_in_vp1 { ++ status = "disabled"; ++}; ++ ++&sdmmc0 { ++ max-frequency = <150000000>; ++ supports-sd; ++ bus-width = <4>; ++ cap-mmc-highspeed; ++ cap-sd-highspeed; ++ disable-wp; ++ sd-uhs-sdr104; ++ vmmc-supply = <&vcc3v3_sd>; ++ vqmmc-supply = <&vccio_sd>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; ++ status = "okay"; ++}; ++ ++&pmu_io_domains { ++ status = "okay"; ++ pmuio1-supply = <&vcc3v3_pmu>; ++ pmuio2-supply = <&vcc3v3_pmu>; ++ vccio1-supply = <&vccio_acodec>; ++ vccio3-supply = <&vccio_sd>; ++ vccio4-supply = <&vcc_1v8>; ++ vccio5-supply = <&vcc_3v3>; ++ vccio6-supply = <&vcc_1v8>; ++ vccio7-supply = <&vcc_3v3>; ++ ++}; ++ ++&vcc3v3_lcd0_n { ++ gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++}; ++ ++&vcc3v3_lcd1_n { ++ gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++}; ++ ++&backlight { ++ status = "okay"; ++ pwms = <&pwm4 0 500000 0>; ++ enable-gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_LOW>; ++ pinctrl-0 = <&lcd0_bl_en>; ++ brightness-levels = < ++ 255 254 253 252 251 250 249 248 ++ 247 246 245 244 243 242 241 240 ++ 239 238 237 236 235 234 233 232 ++ 231 230 229 228 227 226 225 224 ++ 223 222 221 220 219 218 217 216 ++ 215 214 213 212 211 210 209 208 ++ 207 206 205 204 203 202 201 200 ++ 199 198 197 196 195 194 193 192 ++ 191 190 189 188 187 186 185 184 ++ 183 182 181 180 179 178 177 176 ++ 175 174 173 172 171 170 169 168 ++ 167 166 165 164 163 162 161 160 ++ 159 158 157 156 155 154 153 152 ++ 151 150 149 148 147 146 145 144 ++ 143 142 141 140 139 138 137 136 ++ 135 134 133 132 131 130 129 128 ++ 127 126 125 124 123 122 121 120 ++ 119 118 117 116 115 114 113 112 ++ 111 110 109 108 107 106 105 104 ++ 103 102 101 100 99 98 97 96 ++ 95 94 93 92 91 90 89 88 ++ 87 86 85 84 83 82 81 80 ++ 79 78 77 76 75 74 73 72 ++ 71 70 69 68 67 66 65 64 ++ 63 62 61 60 59 58 57 56 ++ 55 54 53 52 51 50 49 48 ++ 47 46 45 44 43 42 41 40 ++ 39 38 37 36 35 34 33 32 ++ 31 30 29 28 27 26 25 24 ++ 23 22 21 20 19 18 17 16 ++ 15 14 13 12 11 10 9 8 ++ 7 6 5 4 3 2 1 0>; ++ default-brightness-level = <200>; ++}; ++ ++&uart0 { ++ status = "disabled"; ++}; ++ ++&uart1 { ++ status = "disabled"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1m1_xfer>; ++}; ++&uart3 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart3m1_xfer>; ++}; ++&uart4 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart4m1_xfer>; ++}; ++&uart7 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart7m1_xfer>; ++}; ++&uart9 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart9m1_xfer>; ++}; ++ ++ ++// MUST disable PCI-E function, ++// otherwise kernel will stall ++&pcie30phy { ++ status = "okay"; ++}; ++ ++&pcie3x2 { ++ reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&pcie30_3v3>; ++ max-link-speed= <3>; ++ status = "okay"; ++}; ++ ++&rk809_codec { ++ status = "okay"; ++ hp-volume = <3>; ++ spk-ctl-gpios =<&gpio3 RK_PC3 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spk_ctl_gpios &i2s1m0_mclk>; ++ spk-volume = <3>; ++}; ++ ++&pwm11 { ++ status = "disabled"; ++}; ++ ++&spdif_out { ++ status = "disabled"; ++}; ++ ++&spdif_8ch { ++ status = "disabled"; ++}; ++ ++&can1 { ++ status = "okay"; ++ ++ assigned-clocks = <&cru CLK_CAN1>; ++ assigned-clock-rates = <100000000>; ++}; ++ ++&usbdrd_dwc3 { ++ dr_mode = "host"; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ backlight { ++ lcd0_bl_en: lcd0_bl_en { ++ rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++/* ++ lcd1_bl_en: lcd1_bl_en { ++ rockchip,pins = <3 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++*/ ++ }; ++ rk809{ ++ spk_ctl_gpios: spk-ctl-gpios{ ++ rockchip,pins = ; ++ }; ++ }; ++ pwm4 { ++ pwm4_pins: pwm4-pins { ++ rockchip,pins = <0 RK_PC3 RK_FUNC_1 &pcfg_pull_none>; ++ }; ++ }; ++ pwm6 { ++ pwm6_pins: pwm6-pins { ++ rockchip,pins = <0 RK_PC5 RK_FUNC_1 &pcfg_pull_none>; ++ }; ++ }; ++ usb { ++ vcc5v0_host1_en: vcc5v0-host1-en { ++ rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ rk-modem { ++ lte_power_en: lte-power-en { ++ rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ lte_reset: lte-reset { ++ rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ ryd_gpio_control { ++ gl3523_reset: gl3523-reset { ++ rockchip,pins = ; ++ }; ++ hub_rst: usb-otg-en { ++ rockchip,pins = ; ++ }; ++ usb_host_en: usb-host-en { ++ rockchip,pins = ; ++ }; ++ cash_pr_en: cash-pr-en { ++ rockchip,pins = ; ++ }; ++ ++ gpio3_a4_mux: gpio3-a4-mux { ++ rockchip,pins = ; ++ }; ++ gpio3_a5_mux: gpio3-a5-mux { ++ rockchip,pins = ; ++ }; ++ ++ gpio3_b5: gpio3-b5 { ++ rockchip,pins = ; ++ }; ++ gpio3_c1: gpio3-c1 { ++ rockchip,pins = ; ++ }; ++ gpio0_c4: gpio0-c4 { ++ rockchip,pins = ; ++ }; ++ }; ++}; +diff -uprN a/arch/arm64/boot/dts/rockchip/rk3568-8897-ddr4-v1-linux-hdmi.dts b/arch/arm64/boot/dts/rockchip/rk3568-8897-ddr4-v1-linux-hdmi.dts +--- a/arch/arm64/boot/dts/rockchip/rk3568-8897-ddr4-v1-linux-hdmi.dts 1970-01-01 00:00:00.000000000 +0000 ++++ b/arch/arm64/boot/dts/rockchip/rk3568-8897-ddr4-v1-linux-hdmi.dts 2023-03-15 03:59:07.051206609 +0000 +@@ -0,0 +1,44 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2020 Rockchip Electronics Co., Ltd. ++ * ++ */ ++ ++#include "rk3568-8897-ddr4-v1-linux-base.dts" ++ ++/ { ++ model = "RK3568 8897 V1 Board HDMI"; ++}; ++ ++&video_phy0 { ++ status = "okay"; ++}; ++ ++&hdmi { ++ status = "okay"; ++}; ++ ++&route_hdmi { ++ status = "okay"; ++ connect = <&vp0_out_hdmi>; ++}; ++ ++&hdmi_in_vp0 { ++ status = "okay"; ++}; ++ ++&hdmi_in_vp1 { ++ status = "disabled"; ++}; ++ ++&hdmi_sound { ++ status = "okay"; ++}; ++ ++&edp { ++ status = "disabled"; ++}; ++ ++&edp_in_vp0 { ++ status = "disabled"; ++}; +diff -uprN a/arch/arm64/boot/dts/rockchip/rk3568-evb.dtsi b/arch/arm64/boot/dts/rockchip/rk3568-evb.dtsi +--- a/arch/arm64/boot/dts/rockchip/rk3568-evb.dtsi 1970-01-01 00:00:00.000000000 +0000 ++++ b/arch/arm64/boot/dts/rockchip/rk3568-evb.dtsi 2023-03-15 03:59:07.051206609 +0000 +@@ -0,0 +1,1837 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2020 Rockchip Electronics Co., Ltd. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/ { ++ ++ adc_keys: adc-keys { ++ compatible = "adc-keys"; ++ io-channels = <&saradc 0>; ++ io-channel-names = "buttons"; ++ keyup-threshold-microvolt = <1800000>; ++ poll-interval = <100>; ++ ++ vol-up-key { ++ label = "volume up"; ++ linux,code = ; ++ press-threshold-microvolt = <1750>; ++ }; ++ ++ vol-down-key { ++ label = "volume down"; ++ linux,code = ; ++ press-threshold-microvolt = <297500>; ++ }; ++ ++ menu-key { ++ label = "menu"; ++ linux,code = ; ++ press-threshold-microvolt = <980000>; ++ }; ++ ++ back-key { ++ label = "back"; ++ linux,code = ; ++ press-threshold-microvolt = <1305500>; ++ }; ++ }; ++ ++ audiopwmout_diff: audiopwmout-diff { ++ status = "disabled"; ++ compatible = "simple-audio-card"; ++ simple-audio-card,format = "i2s"; ++ simple-audio-card,name = "rockchip,audiopwmout-diff"; ++ simple-audio-card,mclk-fs = <256>; ++ simple-audio-card,bitclock-master = <&master>; ++ simple-audio-card,frame-master = <&master>; ++ simple-audio-card,cpu { ++ sound-dai = <&i2s3_2ch>; ++ }; ++ master: simple-audio-card,codec { ++ sound-dai = <&dig_acodec>; ++ }; ++ }; ++ ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pwms = <&pwm4 0 25000 0>; ++ brightness-levels = < ++ 0 20 20 21 21 22 22 23 ++ 23 24 24 25 25 26 26 27 ++ 27 28 28 29 29 30 30 31 ++ 31 32 32 33 33 34 34 35 ++ 35 36 36 37 37 38 38 39 ++ 40 41 42 43 44 45 46 47 ++ 48 49 50 51 52 53 54 55 ++ 56 57 58 59 60 61 62 63 ++ 64 65 66 67 68 69 70 71 ++ 72 73 74 75 76 77 78 79 ++ 80 81 82 83 84 85 86 87 ++ 88 89 90 91 92 93 94 95 ++ 96 97 98 99 100 101 102 103 ++ 104 105 106 107 108 109 110 111 ++ 112 113 114 115 116 117 118 119 ++ 120 121 122 123 124 125 126 127 ++ 128 129 130 131 132 133 134 135 ++ 136 137 138 139 140 141 142 143 ++ 144 145 146 147 148 149 150 151 ++ 152 153 154 155 156 157 158 159 ++ 160 161 162 163 164 165 166 167 ++ 168 169 170 171 172 173 174 175 ++ 176 177 178 179 180 181 182 183 ++ 184 185 186 187 188 189 190 191 ++ 192 193 194 195 196 197 198 199 ++ 200 201 202 203 204 205 206 207 ++ 208 209 210 211 212 213 214 215 ++ 216 217 218 219 220 221 222 223 ++ 224 225 226 227 228 229 230 231 ++ 232 233 234 235 236 237 238 239 ++ 240 241 242 243 244 245 246 247 ++ 248 249 250 251 252 253 254 255 ++ >; ++ default-brightness-level = <200>; ++ }; ++ ++ backlight1: backlight1 { ++ compatible = "pwm-backlight"; ++ pwms = <&pwm5 0 25000 0>; ++ brightness-levels = < ++ 0 20 20 21 21 22 22 23 ++ 23 24 24 25 25 26 26 27 ++ 27 28 28 29 29 30 30 31 ++ 31 32 32 33 33 34 34 35 ++ 35 36 36 37 37 38 38 39 ++ 40 41 42 43 44 45 46 47 ++ 48 49 50 51 52 53 54 55 ++ 56 57 58 59 60 61 62 63 ++ 64 65 66 67 68 69 70 71 ++ 72 73 74 75 76 77 78 79 ++ 80 81 82 83 84 85 86 87 ++ 88 89 90 91 92 93 94 95 ++ 96 97 98 99 100 101 102 103 ++ 104 105 106 107 108 109 110 111 ++ 112 113 114 115 116 117 118 119 ++ 120 121 122 123 124 125 126 127 ++ 128 129 130 131 132 133 134 135 ++ 136 137 138 139 140 141 142 143 ++ 144 145 146 147 148 149 150 151 ++ 152 153 154 155 156 157 158 159 ++ 160 161 162 163 164 165 166 167 ++ 168 169 170 171 172 173 174 175 ++ 176 177 178 179 180 181 182 183 ++ 184 185 186 187 188 189 190 191 ++ 192 193 194 195 196 197 198 199 ++ 200 201 202 203 204 205 206 207 ++ 208 209 210 211 212 213 214 215 ++ 216 217 218 219 220 221 222 223 ++ 224 225 226 227 228 229 230 231 ++ 232 233 234 235 236 237 238 239 ++ 240 241 242 243 244 245 246 247 ++ 248 249 250 251 252 253 254 255 ++ >; ++ default-brightness-level = <200>; ++ }; ++ ++ dc_12v: dc-12v { ++ compatible = "regulator-fixed"; ++ regulator-name = "dc_12v"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <12000000>; ++ regulator-max-microvolt = <12000000>; ++ }; ++ ++ hdmi_sound: hdmi-sound { ++ compatible = "simple-audio-card"; ++ simple-audio-card,format = "i2s"; ++ simple-audio-card,mclk-fs = <128>; ++ simple-audio-card,name = "rockchip,hdmi"; ++ status = "disabled"; ++ ++ simple-audio-card,cpu { ++ sound-dai = <&i2s0_8ch>; ++ }; ++ simple-audio-card,codec { ++ sound-dai = <&hdmi>; ++ }; ++ }; ++ ++ leds: leds { ++ compatible = "gpio-leds"; ++ work_led: work { ++ gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++ ++ pdmics: dummy-codec { ++ status = "disabled"; ++ compatible = "rockchip,dummy-codec"; ++ #sound-dai-cells = <0>; ++ }; ++ ++ pdm_mic_array: pdm-mic-array { ++ status = "disabled"; ++ compatible = "simple-audio-card"; ++ simple-audio-card,name = "rockchip,pdm-mic-array"; ++ simple-audio-card,cpu { ++ sound-dai = <&pdm>; ++ }; ++ simple-audio-card,codec { ++ sound-dai = <&pdmics>; ++ }; ++ }; ++ ++ rk809_sound: rk809-sound { ++ status = "okay"; ++ compatible = "rockchip,multicodecs-card"; ++ rockchip,card-name = "rockchip-rk809"; ++ hp-det-gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; ++ rockchip,format = "i2s"; ++ rockchip,mclk-fs = <256>; ++ rockchip,cpu = <&i2s1_8ch>; ++ rockchip,codec = <&rk809_codec>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hp_det>; ++ }; ++ ++ spdif-sound { ++ status = "okay"; ++ compatible = "simple-audio-card"; ++ simple-audio-card,name = "ROCKCHIP,SPDIF"; ++ simple-audio-card,cpu { ++ sound-dai = <&spdif_8ch>; ++ }; ++ simple-audio-card,codec { ++ sound-dai = <&spdif_out>; ++ }; ++ }; ++ ++ spdif_out: spdif-out { ++ status = "okay"; ++ compatible = "linux,spdif-dit"; ++ #sound-dai-cells = <0>; ++ }; ++ ++ vad_sound: vad-sound { ++ status = "disabled"; ++ compatible = "rockchip,multicodecs-card"; ++ rockchip,card-name = "rockchip,rk3568-vad"; ++ rockchip,cpu = <&i2s1_8ch>; ++ rockchip,codec = <&rk809_codec>, <&vad>; ++ }; ++ ++ vcc3v3_sys: vcc3v3-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&dc_12v>; ++ }; ++ ++ vcc5v0_sys: vcc5v0-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&dc_12v>; ++ }; ++ ++ vcc5v0_usb: vcc5v0-usb { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_usb"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&dc_12v>; ++ }; ++ ++ vcc5v0_host: vcc5v0-host-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_host"; ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; ++ vin-supply = <&vcc5v0_usb>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_host_en>; ++ }; ++ ++ vcc5v0_otg: vcc5v0-otg-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_otg"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>; ++ vin-supply = <&vcc5v0_usb>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_otg_en>; ++ }; ++ ++ vcc3v3_lcd0_n: vcc3v3-lcd0-n { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_lcd0_n"; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_lcd1_n: vcc3v3-lcd1-n { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_lcd1_n"; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ sdio_pwrseq: sdio-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ clocks = <&rk809 1>; ++ clock-names = "ext_clock"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&wifi_enable_h>; ++ ++ /* ++ * On the module itself this is one of these (depending ++ * on the actual card populated): ++ * - SDIO_RESET_L_WL_REG_ON ++ * - PDN (power down when low) ++ */ ++ post-power-on-delay-ms = <200>; ++ reset-gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wireless_wlan: wireless-wlan { ++ compatible = "wlan-platdata"; ++ rockchip,grf = <&grf>; ++ wifi_chip_type = "ap6398s"; ++ status = "okay"; ++ }; ++ ++ wireless_bluetooth: wireless-bluetooth { ++ compatible = "bluetooth-platdata"; ++ clocks = <&rk809 1>; ++ clock-names = "ext_clock"; ++ //wifi-bt-power-toggle; ++ uart_rts_gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>; ++ pinctrl-names = "default", "rts_gpio"; ++ pinctrl-0 = <&uart8m0_rtsn>; ++ pinctrl-1 = <&uart8_gpios>; ++ BT,reset_gpio = <&gpio3 RK_PA0 GPIO_ACTIVE_HIGH>; ++ BT,wake_gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>; ++ BT,wake_host_irq = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++ }; ++ ++ test-power { ++ status = "okay"; ++ }; ++}; ++ ++&bus_npu { ++ bus-supply = <&vdd_logic>; ++ pvtm-supply = <&vdd_cpu>; ++ status = "okay"; ++}; ++ ++&can0 { ++ assigned-clocks = <&cru CLK_CAN0>; ++ assigned-clock-rates = <150000000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&can0m1_pins>; ++ status = "disabled"; ++}; ++ ++&can1 { ++ assigned-clocks = <&cru CLK_CAN1>; ++ assigned-clock-rates = <150000000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&can1m1_pins>; ++ status = "disabled"; ++}; ++ ++&can2 { ++ assigned-clocks = <&cru CLK_CAN2>; ++ assigned-clock-rates = <150000000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&can2m1_pins>; ++ status = "disabled"; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&dfi { ++ status = "okay"; ++}; ++ ++&dmc { ++ center-supply = <&vdd_logic>; ++ status = "okay"; ++}; ++ ++&dsi0 { ++ status = "disabled"; ++ //rockchip,lane-rate = <1000>; ++ dsi0_panel: panel@0 { ++ status = "okay"; ++ compatible = "simple-panel-dsi"; ++ reg = <0>; ++ backlight = <&backlight>; ++ reset-delay-ms = <60>; ++ enable-delay-ms = <60>; ++ prepare-delay-ms = <60>; ++ unprepare-delay-ms = <60>; ++ disable-delay-ms = <60>; ++ dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | ++ MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>; ++ dsi,format = ; ++ dsi,lanes = <4>; ++ panel-init-sequence = [ ++ 23 00 02 FE 21 ++ 23 00 02 04 00 ++ 23 00 02 00 64 ++ 23 00 02 2A 00 ++ 23 00 02 26 64 ++ 23 00 02 54 00 ++ 23 00 02 50 64 ++ 23 00 02 7B 00 ++ 23 00 02 77 64 ++ 23 00 02 A2 00 ++ 23 00 02 9D 64 ++ 23 00 02 C9 00 ++ 23 00 02 C5 64 ++ 23 00 02 01 71 ++ 23 00 02 27 71 ++ 23 00 02 51 71 ++ 23 00 02 78 71 ++ 23 00 02 9E 71 ++ 23 00 02 C6 71 ++ 23 00 02 02 89 ++ 23 00 02 28 89 ++ 23 00 02 52 89 ++ 23 00 02 79 89 ++ 23 00 02 9F 89 ++ 23 00 02 C7 89 ++ 23 00 02 03 9E ++ 23 00 02 29 9E ++ 23 00 02 53 9E ++ 23 00 02 7A 9E ++ 23 00 02 A0 9E ++ 23 00 02 C8 9E ++ 23 00 02 09 00 ++ 23 00 02 05 B0 ++ 23 00 02 31 00 ++ 23 00 02 2B B0 ++ 23 00 02 5A 00 ++ 23 00 02 55 B0 ++ 23 00 02 80 00 ++ 23 00 02 7C B0 ++ 23 00 02 A7 00 ++ 23 00 02 A3 B0 ++ 23 00 02 CE 00 ++ 23 00 02 CA B0 ++ 23 00 02 06 C0 ++ 23 00 02 2D C0 ++ 23 00 02 56 C0 ++ 23 00 02 7D C0 ++ 23 00 02 A4 C0 ++ 23 00 02 CB C0 ++ 23 00 02 07 CF ++ 23 00 02 2F CF ++ 23 00 02 58 CF ++ 23 00 02 7E CF ++ 23 00 02 A5 CF ++ 23 00 02 CC CF ++ 23 00 02 08 DD ++ 23 00 02 30 DD ++ 23 00 02 59 DD ++ 23 00 02 7F DD ++ 23 00 02 A6 DD ++ 23 00 02 CD DD ++ 23 00 02 0E 15 ++ 23 00 02 0A E9 ++ 23 00 02 36 15 ++ 23 00 02 32 E9 ++ 23 00 02 5F 15 ++ 23 00 02 5B E9 ++ 23 00 02 85 15 ++ 23 00 02 81 E9 ++ 23 00 02 AD 15 ++ 23 00 02 A9 E9 ++ 23 00 02 D3 15 ++ 23 00 02 CF E9 ++ 23 00 02 0B 14 ++ 23 00 02 33 14 ++ 23 00 02 5C 14 ++ 23 00 02 82 14 ++ 23 00 02 AA 14 ++ 23 00 02 D0 14 ++ 23 00 02 0C 36 ++ 23 00 02 34 36 ++ 23 00 02 5D 36 ++ 23 00 02 83 36 ++ 23 00 02 AB 36 ++ 23 00 02 D1 36 ++ 23 00 02 0D 6B ++ 23 00 02 35 6B ++ 23 00 02 5E 6B ++ 23 00 02 84 6B ++ 23 00 02 AC 6B ++ 23 00 02 D2 6B ++ 23 00 02 13 5A ++ 23 00 02 0F 94 ++ 23 00 02 3B 5A ++ 23 00 02 37 94 ++ 23 00 02 64 5A ++ 23 00 02 60 94 ++ 23 00 02 8A 5A ++ 23 00 02 86 94 ++ 23 00 02 B2 5A ++ 23 00 02 AE 94 ++ 23 00 02 D8 5A ++ 23 00 02 D4 94 ++ 23 00 02 10 D1 ++ 23 00 02 38 D1 ++ 23 00 02 61 D1 ++ 23 00 02 87 D1 ++ 23 00 02 AF D1 ++ 23 00 02 D5 D1 ++ 23 00 02 11 04 ++ 23 00 02 39 04 ++ 23 00 02 62 04 ++ 23 00 02 88 04 ++ 23 00 02 B0 04 ++ 23 00 02 D6 04 ++ 23 00 02 12 05 ++ 23 00 02 3A 05 ++ 23 00 02 63 05 ++ 23 00 02 89 05 ++ 23 00 02 B1 05 ++ 23 00 02 D7 05 ++ 23 00 02 18 AA ++ 23 00 02 14 36 ++ 23 00 02 42 AA ++ 23 00 02 3D 36 ++ 23 00 02 69 AA ++ 23 00 02 65 36 ++ 23 00 02 8F AA ++ 23 00 02 8B 36 ++ 23 00 02 B7 AA ++ 23 00 02 B3 36 ++ 23 00 02 DD AA ++ 23 00 02 D9 36 ++ 23 00 02 15 74 ++ 23 00 02 3F 74 ++ 23 00 02 66 74 ++ 23 00 02 8C 74 ++ 23 00 02 B4 74 ++ 23 00 02 DA 74 ++ 23 00 02 16 9F ++ 23 00 02 40 9F ++ 23 00 02 67 9F ++ 23 00 02 8D 9F ++ 23 00 02 B5 9F ++ 23 00 02 DB 9F ++ 23 00 02 17 DC ++ 23 00 02 41 DC ++ 23 00 02 68 DC ++ 23 00 02 8E DC ++ 23 00 02 B6 DC ++ 23 00 02 DC DC ++ 23 00 02 1D FF ++ 23 00 02 19 03 ++ 23 00 02 47 FF ++ 23 00 02 43 03 ++ 23 00 02 6E FF ++ 23 00 02 6A 03 ++ 23 00 02 94 FF ++ 23 00 02 90 03 ++ 23 00 02 BC FF ++ 23 00 02 B8 03 ++ 23 00 02 E2 FF ++ 23 00 02 DE 03 ++ 23 00 02 1A 35 ++ 23 00 02 44 35 ++ 23 00 02 6B 35 ++ 23 00 02 91 35 ++ 23 00 02 B9 35 ++ 23 00 02 DF 35 ++ 23 00 02 1B 45 ++ 23 00 02 45 45 ++ 23 00 02 6C 45 ++ 23 00 02 92 45 ++ 23 00 02 BA 45 ++ 23 00 02 E0 45 ++ 23 00 02 1C 55 ++ 23 00 02 46 55 ++ 23 00 02 6D 55 ++ 23 00 02 93 55 ++ 23 00 02 BB 55 ++ 23 00 02 E1 55 ++ 23 00 02 22 FF ++ 23 00 02 1E 68 ++ 23 00 02 4C FF ++ 23 00 02 48 68 ++ 23 00 02 73 FF ++ 23 00 02 6F 68 ++ 23 00 02 99 FF ++ 23 00 02 95 68 ++ 23 00 02 C1 FF ++ 23 00 02 BD 68 ++ 23 00 02 E7 FF ++ 23 00 02 E3 68 ++ 23 00 02 1F 7E ++ 23 00 02 49 7E ++ 23 00 02 70 7E ++ 23 00 02 96 7E ++ 23 00 02 BE 7E ++ 23 00 02 E4 7E ++ 23 00 02 20 97 ++ 23 00 02 4A 97 ++ 23 00 02 71 97 ++ 23 00 02 97 97 ++ 23 00 02 BF 97 ++ 23 00 02 E5 97 ++ 23 00 02 21 B5 ++ 23 00 02 4B B5 ++ 23 00 02 72 B5 ++ 23 00 02 98 B5 ++ 23 00 02 C0 B5 ++ 23 00 02 E6 B5 ++ 23 00 02 25 F0 ++ 23 00 02 23 E8 ++ 23 00 02 4F F0 ++ 23 00 02 4D E8 ++ 23 00 02 76 F0 ++ 23 00 02 74 E8 ++ 23 00 02 9C F0 ++ 23 00 02 9A E8 ++ 23 00 02 C4 F0 ++ 23 00 02 C2 E8 ++ 23 00 02 EA F0 ++ 23 00 02 E8 E8 ++ 23 00 02 24 FF ++ 23 00 02 4E FF ++ 23 00 02 75 FF ++ 23 00 02 9B FF ++ 23 00 02 C3 FF ++ 23 00 02 E9 FF ++ 23 00 02 FE 3D ++ 23 00 02 00 04 ++ 23 00 02 FE 23 ++ 23 00 02 08 82 ++ 23 00 02 0A 00 ++ 23 00 02 0B 00 ++ 23 00 02 0C 01 ++ 23 00 02 16 00 ++ 23 00 02 18 02 ++ 23 00 02 1B 04 ++ 23 00 02 19 04 ++ 23 00 02 1C 81 ++ 23 00 02 1F 00 ++ 23 00 02 20 03 ++ 23 00 02 23 04 ++ 23 00 02 21 01 ++ 23 00 02 54 63 ++ 23 00 02 55 54 ++ 23 00 02 6E 45 ++ 23 00 02 6D 36 ++ 23 00 02 FE 3D ++ 23 00 02 55 78 ++ 23 00 02 FE 20 ++ 23 00 02 26 30 ++ 23 00 02 FE 3D ++ 23 00 02 20 71 ++ 23 00 02 50 8F ++ 23 00 02 51 8F ++ 23 00 02 FE 00 ++ 23 00 02 35 00 ++ 05 78 01 11 ++ 05 1E 01 29 ++ ]; ++ ++ panel-exit-sequence = [ ++ 05 00 01 28 ++ 05 00 01 10 ++ ]; ++ ++ disp_timings0: display-timings { ++ native-mode = <&dsi0_timing0>; ++ dsi0_timing0: timing0 { ++ clock-frequency = <132000000>; ++ hactive = <1080>; ++ vactive = <1920>; ++ hfront-porch = <15>; ++ hsync-len = <2>; ++ hback-porch = <30>; ++ vfront-porch = <15>; ++ vsync-len = <2>; ++ vback-porch = <15>; ++ hsync-active = <0>; ++ vsync-active = <0>; ++ de-active = <0>; ++ pixelclk-active = <1>; ++ }; ++ }; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ panel_in_dsi: endpoint { ++ remote-endpoint = <&dsi_out_panel>; ++ }; ++ }; ++ }; ++ }; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@1 { ++ reg = <1>; ++ dsi_out_panel: endpoint { ++ remote-endpoint = <&panel_in_dsi>; ++ }; ++ }; ++ }; ++ ++}; ++ ++&dsi1 { ++ status = "disabled"; ++ //rockchip,lane-rate = <1000>; ++ dsi1_panel: panel@0 { ++ status = "okay"; ++ compatible = "simple-panel-dsi"; ++ reg = <0>; ++ backlight = <&backlight1>; ++ reset-delay-ms = <60>; ++ enable-delay-ms = <60>; ++ prepare-delay-ms = <60>; ++ unprepare-delay-ms = <60>; ++ disable-delay-ms = <60>; ++ dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | ++ MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>; ++ dsi,format = ; ++ dsi,lanes = <4>; ++ panel-init-sequence = [ ++ 23 00 02 FE 21 ++ 23 00 02 04 00 ++ 23 00 02 00 64 ++ 23 00 02 2A 00 ++ 23 00 02 26 64 ++ 23 00 02 54 00 ++ 23 00 02 50 64 ++ 23 00 02 7B 00 ++ 23 00 02 77 64 ++ 23 00 02 A2 00 ++ 23 00 02 9D 64 ++ 23 00 02 C9 00 ++ 23 00 02 C5 64 ++ 23 00 02 01 71 ++ 23 00 02 27 71 ++ 23 00 02 51 71 ++ 23 00 02 78 71 ++ 23 00 02 9E 71 ++ 23 00 02 C6 71 ++ 23 00 02 02 89 ++ 23 00 02 28 89 ++ 23 00 02 52 89 ++ 23 00 02 79 89 ++ 23 00 02 9F 89 ++ 23 00 02 C7 89 ++ 23 00 02 03 9E ++ 23 00 02 29 9E ++ 23 00 02 53 9E ++ 23 00 02 7A 9E ++ 23 00 02 A0 9E ++ 23 00 02 C8 9E ++ 23 00 02 09 00 ++ 23 00 02 05 B0 ++ 23 00 02 31 00 ++ 23 00 02 2B B0 ++ 23 00 02 5A 00 ++ 23 00 02 55 B0 ++ 23 00 02 80 00 ++ 23 00 02 7C B0 ++ 23 00 02 A7 00 ++ 23 00 02 A3 B0 ++ 23 00 02 CE 00 ++ 23 00 02 CA B0 ++ 23 00 02 06 C0 ++ 23 00 02 2D C0 ++ 23 00 02 56 C0 ++ 23 00 02 7D C0 ++ 23 00 02 A4 C0 ++ 23 00 02 CB C0 ++ 23 00 02 07 CF ++ 23 00 02 2F CF ++ 23 00 02 58 CF ++ 23 00 02 7E CF ++ 23 00 02 A5 CF ++ 23 00 02 CC CF ++ 23 00 02 08 DD ++ 23 00 02 30 DD ++ 23 00 02 59 DD ++ 23 00 02 7F DD ++ 23 00 02 A6 DD ++ 23 00 02 CD DD ++ 23 00 02 0E 15 ++ 23 00 02 0A E9 ++ 23 00 02 36 15 ++ 23 00 02 32 E9 ++ 23 00 02 5F 15 ++ 23 00 02 5B E9 ++ 23 00 02 85 15 ++ 23 00 02 81 E9 ++ 23 00 02 AD 15 ++ 23 00 02 A9 E9 ++ 23 00 02 D3 15 ++ 23 00 02 CF E9 ++ 23 00 02 0B 14 ++ 23 00 02 33 14 ++ 23 00 02 5C 14 ++ 23 00 02 82 14 ++ 23 00 02 AA 14 ++ 23 00 02 D0 14 ++ 23 00 02 0C 36 ++ 23 00 02 34 36 ++ 23 00 02 5D 36 ++ 23 00 02 83 36 ++ 23 00 02 AB 36 ++ 23 00 02 D1 36 ++ 23 00 02 0D 6B ++ 23 00 02 35 6B ++ 23 00 02 5E 6B ++ 23 00 02 84 6B ++ 23 00 02 AC 6B ++ 23 00 02 D2 6B ++ 23 00 02 13 5A ++ 23 00 02 0F 94 ++ 23 00 02 3B 5A ++ 23 00 02 37 94 ++ 23 00 02 64 5A ++ 23 00 02 60 94 ++ 23 00 02 8A 5A ++ 23 00 02 86 94 ++ 23 00 02 B2 5A ++ 23 00 02 AE 94 ++ 23 00 02 D8 5A ++ 23 00 02 D4 94 ++ 23 00 02 10 D1 ++ 23 00 02 38 D1 ++ 23 00 02 61 D1 ++ 23 00 02 87 D1 ++ 23 00 02 AF D1 ++ 23 00 02 D5 D1 ++ 23 00 02 11 04 ++ 23 00 02 39 04 ++ 23 00 02 62 04 ++ 23 00 02 88 04 ++ 23 00 02 B0 04 ++ 23 00 02 D6 04 ++ 23 00 02 12 05 ++ 23 00 02 3A 05 ++ 23 00 02 63 05 ++ 23 00 02 89 05 ++ 23 00 02 B1 05 ++ 23 00 02 D7 05 ++ 23 00 02 18 AA ++ 23 00 02 14 36 ++ 23 00 02 42 AA ++ 23 00 02 3D 36 ++ 23 00 02 69 AA ++ 23 00 02 65 36 ++ 23 00 02 8F AA ++ 23 00 02 8B 36 ++ 23 00 02 B7 AA ++ 23 00 02 B3 36 ++ 23 00 02 DD AA ++ 23 00 02 D9 36 ++ 23 00 02 15 74 ++ 23 00 02 3F 74 ++ 23 00 02 66 74 ++ 23 00 02 8C 74 ++ 23 00 02 B4 74 ++ 23 00 02 DA 74 ++ 23 00 02 16 9F ++ 23 00 02 40 9F ++ 23 00 02 67 9F ++ 23 00 02 8D 9F ++ 23 00 02 B5 9F ++ 23 00 02 DB 9F ++ 23 00 02 17 DC ++ 23 00 02 41 DC ++ 23 00 02 68 DC ++ 23 00 02 8E DC ++ 23 00 02 B6 DC ++ 23 00 02 DC DC ++ 23 00 02 1D FF ++ 23 00 02 19 03 ++ 23 00 02 47 FF ++ 23 00 02 43 03 ++ 23 00 02 6E FF ++ 23 00 02 6A 03 ++ 23 00 02 94 FF ++ 23 00 02 90 03 ++ 23 00 02 BC FF ++ 23 00 02 B8 03 ++ 23 00 02 E2 FF ++ 23 00 02 DE 03 ++ 23 00 02 1A 35 ++ 23 00 02 44 35 ++ 23 00 02 6B 35 ++ 23 00 02 91 35 ++ 23 00 02 B9 35 ++ 23 00 02 DF 35 ++ 23 00 02 1B 45 ++ 23 00 02 45 45 ++ 23 00 02 6C 45 ++ 23 00 02 92 45 ++ 23 00 02 BA 45 ++ 23 00 02 E0 45 ++ 23 00 02 1C 55 ++ 23 00 02 46 55 ++ 23 00 02 6D 55 ++ 23 00 02 93 55 ++ 23 00 02 BB 55 ++ 23 00 02 E1 55 ++ 23 00 02 22 FF ++ 23 00 02 1E 68 ++ 23 00 02 4C FF ++ 23 00 02 48 68 ++ 23 00 02 73 FF ++ 23 00 02 6F 68 ++ 23 00 02 99 FF ++ 23 00 02 95 68 ++ 23 00 02 C1 FF ++ 23 00 02 BD 68 ++ 23 00 02 E7 FF ++ 23 00 02 E3 68 ++ 23 00 02 1F 7E ++ 23 00 02 49 7E ++ 23 00 02 70 7E ++ 23 00 02 96 7E ++ 23 00 02 BE 7E ++ 23 00 02 E4 7E ++ 23 00 02 20 97 ++ 23 00 02 4A 97 ++ 23 00 02 71 97 ++ 23 00 02 97 97 ++ 23 00 02 BF 97 ++ 23 00 02 E5 97 ++ 23 00 02 21 B5 ++ 23 00 02 4B B5 ++ 23 00 02 72 B5 ++ 23 00 02 98 B5 ++ 23 00 02 C0 B5 ++ 23 00 02 E6 B5 ++ 23 00 02 25 F0 ++ 23 00 02 23 E8 ++ 23 00 02 4F F0 ++ 23 00 02 4D E8 ++ 23 00 02 76 F0 ++ 23 00 02 74 E8 ++ 23 00 02 9C F0 ++ 23 00 02 9A E8 ++ 23 00 02 C4 F0 ++ 23 00 02 C2 E8 ++ 23 00 02 EA F0 ++ 23 00 02 E8 E8 ++ 23 00 02 24 FF ++ 23 00 02 4E FF ++ 23 00 02 75 FF ++ 23 00 02 9B FF ++ 23 00 02 C3 FF ++ 23 00 02 E9 FF ++ 23 00 02 FE 3D ++ 23 00 02 00 04 ++ 23 00 02 FE 23 ++ 23 00 02 08 82 ++ 23 00 02 0A 00 ++ 23 00 02 0B 00 ++ 23 00 02 0C 01 ++ 23 00 02 16 00 ++ 23 00 02 18 02 ++ 23 00 02 1B 04 ++ 23 00 02 19 04 ++ 23 00 02 1C 81 ++ 23 00 02 1F 00 ++ 23 00 02 20 03 ++ 23 00 02 23 04 ++ 23 00 02 21 01 ++ 23 00 02 54 63 ++ 23 00 02 55 54 ++ 23 00 02 6E 45 ++ 23 00 02 6D 36 ++ 23 00 02 FE 3D ++ 23 00 02 55 78 ++ 23 00 02 FE 20 ++ 23 00 02 26 30 ++ 23 00 02 FE 3D ++ 23 00 02 20 71 ++ 23 00 02 50 8F ++ 23 00 02 51 8F ++ 23 00 02 FE 00 ++ 23 00 02 35 00 ++ 05 78 01 11 ++ 05 1E 01 29 ++ ]; ++ ++ panel-exit-sequence = [ ++ 05 00 01 28 ++ 05 00 01 10 ++ ]; ++ ++ disp_timings1: display-timings { ++ native-mode = <&dsi1_timing0>; ++ dsi1_timing0: timing0 { ++ clock-frequency = <132000000>; ++ hactive = <1080>; ++ vactive = <1920>; ++ hfront-porch = <15>; ++ hsync-len = <2>; ++ hback-porch = <30>; ++ vfront-porch = <15>; ++ vsync-len = <2>; ++ vback-porch = <15>; ++ hsync-active = <0>; ++ vsync-active = <0>; ++ de-active = <0>; ++ pixelclk-active = <1>; ++ }; ++ }; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ panel_in_dsi1: endpoint { ++ remote-endpoint = <&dsi1_out_panel>; ++ }; ++ }; ++ }; ++ }; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@1 { ++ reg = <1>; ++ dsi1_out_panel: endpoint { ++ remote-endpoint = <&panel_in_dsi1>; ++ }; ++ }; ++ }; ++ ++}; ++ ++&gpu { ++ mali-supply = <&vdd_gpu>; ++ status = "okay"; ++}; ++ ++&hdmi { ++ status = "okay"; ++ rockchip,phy-table = ++ <92812500 0x8009 0x0000 0x0270>, ++ <165000000 0x800b 0x0000 0x026d>, ++ <185625000 0x800b 0x0000 0x01ed>, ++ <297000000 0x800b 0x0000 0x01ad>, ++ <594000000 0x8029 0x0000 0x0088>, ++ <000000000 0x0000 0x0000 0x0000>; ++}; ++ ++&hdmi_in_vp0 { ++ status = "okay"; ++}; ++ ++&hdmi_in_vp1 { ++ status = "disabled"; ++}; ++ ++&hdmi_sound { ++ status = "okay"; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ vdd_cpu: tcs4525@1c { ++ compatible = "tcs,tcs452x"; ++ reg = <0x1c>; ++ vin-supply = <&vcc5v0_sys>; ++ regulator-compatible = "fan53555-reg"; ++ regulator-name = "vdd_cpu"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1390000>; ++ regulator-init-microvolt = <900000>; ++ regulator-initial-mode = <1>; ++ regulator-ramp-delay = <2300>; ++ fcs,suspend-voltage-selector = <1>; ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ rk809: pmic@20 { ++ compatible = "rockchip,rk809"; ++ reg = <0x20>; ++ interrupt-parent = <&gpio0>; ++ interrupts = <3 IRQ_TYPE_LEVEL_LOW>; ++ ++ pinctrl-names = "default", "pmic-sleep", ++ "pmic-power-off", "pmic-reset"; ++ pinctrl-0 = <&pmic_int>; ++ pinctrl-1 = <&soc_slppin_slp>, <&rk817_slppin_slp>; ++ pinctrl-2 = <&soc_slppin_gpio>, <&rk817_slppin_pwrdn>; ++ pinctrl-3 = <&soc_slppin_gpio>, <&rk817_slppin_rst>; ++ ++ rockchip,system-power-controller; ++ wakeup-source; ++ #clock-cells = <1>; ++ clock-output-names = "rk808-clkout1", "rk808-clkout2"; ++ //fb-inner-reg-idxs = <2>; ++ /* 1: rst regs (default in codes), 0: rst the pmic */ ++ pmic-reset-func = <0>; ++ /* not save the PMIC_POWER_EN register in uboot */ ++ not-save-power-en = <1>; ++ ++ vcc1-supply = <&vcc3v3_sys>; ++ vcc2-supply = <&vcc3v3_sys>; ++ vcc3-supply = <&vcc3v3_sys>; ++ vcc4-supply = <&vcc3v3_sys>; ++ vcc5-supply = <&vcc3v3_sys>; ++ vcc6-supply = <&vcc3v3_sys>; ++ vcc7-supply = <&vcc3v3_sys>; ++ vcc8-supply = <&vcc3v3_sys>; ++ vcc9-supply = <&vcc3v3_sys>; ++ ++ pwrkey { ++ status = "okay"; ++ }; ++ ++ pinctrl_rk8xx: pinctrl_rk8xx { ++ gpio-controller; ++ #gpio-cells = <2>; ++ ++ rk817_slppin_null: rk817_slppin_null { ++ pins = "gpio_slp"; ++ function = "pin_fun0"; ++ }; ++ ++ rk817_slppin_slp: rk817_slppin_slp { ++ pins = "gpio_slp"; ++ function = "pin_fun1"; ++ }; ++ ++ rk817_slppin_pwrdn: rk817_slppin_pwrdn { ++ pins = "gpio_slp"; ++ function = "pin_fun2"; ++ }; ++ ++ rk817_slppin_rst: rk817_slppin_rst { ++ pins = "gpio_slp"; ++ function = "pin_fun3"; ++ }; ++ }; ++ ++ regulators { ++ vdd_logic: DCDC_REG1 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-init-microvolt = <900000>; ++ regulator-ramp-delay = <6001>; ++ regulator-initial-mode = <0x2>; ++ regulator-name = "vdd_logic"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_gpu: DCDC_REG2 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-init-microvolt = <900000>; ++ regulator-ramp-delay = <6001>; ++ regulator-initial-mode = <0x2>; ++ regulator-name = "vdd_gpu"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_ddr: DCDC_REG3 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-initial-mode = <0x2>; ++ regulator-name = "vcc_ddr"; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vdd_npu: DCDC_REG4 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-init-microvolt = <900000>; ++ regulator-ramp-delay = <6001>; ++ regulator-initial-mode = <0x2>; ++ regulator-name = "vdd_npu"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda0v9_image: LDO_REG1 { ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ regulator-name = "vdda0v9_image"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda_0v9: LDO_REG2 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ regulator-name = "vdda_0v9"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda0v9_pmu: LDO_REG3 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ regulator-name = "vdda0v9_pmu"; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <900000>; ++ }; ++ }; ++ ++ vccio_acodec: LDO_REG4 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vccio_acodec"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vccio_sd: LDO_REG5 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vccio_sd"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_pmu: LDO_REG6 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc3v3_pmu"; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcca_1v8: LDO_REG7 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "vcca_1v8"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcca1v8_pmu: LDO_REG8 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "vcca1v8_pmu"; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcca1v8_image: LDO_REG9 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "vcca1v8_image"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8: DCDC_REG5 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "vcc_1v8"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_3v3: SWITCH_REG1 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-name = "vcc_3v3"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_sd: SWITCH_REG2 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-name = "vcc3v3_sd"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ }; ++ ++ rk809_codec: codec { ++ #sound-dai-cells = <1>; ++ compatible = "rockchip,rk809-codec", "rockchip,rk817-codec"; ++ clocks = <&cru I2S1_MCLKOUT>; ++ clock-names = "mclk"; ++ assigned-clocks = <&cru I2S1_MCLKOUT>, <&cru I2S1_MCLK_TX_IOE>; ++ assigned-clock-rates = <12288000>; ++ assigned-clock-parents = <&cru I2S1_MCLKOUT_TX>, <&cru I2S1_MCLKOUT_TX>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s1m0_mclk>; ++ hp-volume = <20>; ++ spk-volume = <3>; ++ mic-in-differential; ++ status = "okay"; ++ }; ++ }; ++}; ++ ++&i2c1 { ++ status = "okay"; ++ ++ gt1x: gt1x@14 { ++ compatible = "goodix,gt1x"; ++ reg = <0x14>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&touch_gpio>; ++ goodix,rst-gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>; ++ goodix,irq-gpio = <&gpio0 RK_PB5 IRQ_TYPE_LEVEL_LOW>; ++ }; ++}; ++ ++&i2c5 { ++ status = "okay"; ++ ++ mxc6655xa: mxc6655xa@15 { ++ status = "okay"; ++ compatible = "gs_mxc6655xa"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mxc6655xa_irq_gpio>; ++ reg = <0x15>; ++ irq-gpio = <&gpio3 RK_PC1 IRQ_TYPE_LEVEL_LOW>; ++ irq_enable = <0>; ++ poll_delay_ms = <30>; ++ type = ; ++ power-off-in-suspend = <1>; ++ layout = <1>; ++ }; ++}; ++ ++&i2s0_8ch { ++ status = "okay"; ++}; ++ ++&i2s1_8ch { ++ status = "okay"; ++ rockchip,clk-trcm = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s1m0_sclktx ++ &i2s1m0_lrcktx ++ &i2s1m0_sdi0 ++ &i2s1m0_sdo0>; ++}; ++ ++&iep { ++ status = "okay"; ++}; ++ ++&iep_mmu { ++ status = "okay"; ++}; ++ ++&jpegd { ++ status = "okay"; ++}; ++ ++&jpegd_mmu { ++ status = "okay"; ++}; ++ ++&mpp_srv { ++ status = "okay"; ++}; ++ ++&nandc0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ nand@0 { ++ reg = <0>; ++ nand-bus-width = <8>; ++ nand-ecc-mode = "hw"; ++ nand-ecc-strength = <16>; ++ nand-ecc-step-size = <1024>; ++ }; ++}; ++ ++&pinctrl { ++ ++ headphone { ++ hp_det: hp-det { ++ rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ ++ mxc6655xa { ++ mxc6655xa_irq_gpio: mxc6655xa_irq_gpio { ++ rockchip,pins = <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ pmic { ++ pmic_int: pmic_int { ++ rockchip,pins = ++ <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ ++ soc_slppin_gpio: soc_slppin_gpio { ++ rockchip,pins = ++ <0 RK_PA2 RK_FUNC_GPIO &pcfg_output_low>; ++ }; ++ ++ soc_slppin_slp: soc_slppin_slp { ++ rockchip,pins = ++ <0 RK_PA2 1 &pcfg_pull_none>; ++ }; ++ ++ soc_slppin_rst: soc_slppin_rst { ++ rockchip,pins = ++ <0 RK_PA2 2 &pcfg_pull_none>; ++ }; ++ }; ++ ++ touch { ++ touch_gpio: touch-gpio { ++ rockchip,pins = ++ <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>, ++ <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ sdio-pwrseq { ++ wifi_enable_h: wifi-enable-h { ++ rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ usb { ++ vcc5v0_host_en: vcc5v0-host-en { ++ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ vcc5v0_otg_en: vcc5v0-otg-en { ++ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ wireless-bluetooth { ++ uart8_gpios: uart8-gpios { ++ rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++}; ++ ++ /* ++ * There are 10 independent IO domains in RK3566/RK3568, including PMUIO[0:2] and VCCIO[1:7]. ++ * 1/ PMUIO0 and PMUIO1 are fixed-level power domains which cannot be configured; ++ * 2/ PMUIO2 and VCCIO1,VCCIO[3:7] domains require that their hardware power supply voltages ++ * must be consistent with the software configuration correspondingly ++ * a/ When the hardware IO level is connected to 1.8V, the software voltage configuration ++ * should also be configured to 1.8V accordingly; ++ * b/ When the hardware IO level is connected to 3.3V, the software voltage configuration ++ * should also be configured to 3.3V accordingly; ++ * 3/ VCCIO2 voltage control selection (0xFDC20140) ++ * BIT[0]: 0x0: from GPIO_0A7 (default) ++ * BIT[0]: 0x1: from GRF ++ * Default is determined by Pin FLASH_VOL_SEL/GPIO0_A7: ++ * L:VCCIO2 must supply 3.3V ++ * H:VCCIO2 must supply 1.8V ++ */ ++&pmu_io_domains { ++ status = "okay"; ++ pmuio2-supply = <&vcc3v3_pmu>; ++ vccio1-supply = <&vccio_acodec>; ++ vccio3-supply = <&vccio_sd>; ++ vccio4-supply = <&vcc_3v3>; ++ vccio5-supply = <&vcc_3v3>; ++ vccio6-supply = <&vcc_3v3>; ++ vccio7-supply = <&vcc_3v3>; ++}; ++ ++&pwm4 { ++ status = "okay"; ++}; ++ ++&pwm5 { ++ status = "okay"; ++}; ++ ++&pwm7 { ++ status = "okay"; ++ ++ compatible = "rockchip,remotectl-pwm"; ++ remote_pwm_id = <3>; ++ handle_cpu_id = <1>; ++ remote_support_psci = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm7_pins>; ++ ++ ir_key1 { ++ rockchip,usercode = <0x4040>; ++ rockchip,key_table = ++ <0xf2 KEY_REPLY>, ++ <0xba KEY_BACK>, ++ <0xf4 KEY_UP>, ++ <0xf1 KEY_DOWN>, ++ <0xef KEY_LEFT>, ++ <0xee KEY_RIGHT>, ++ <0xbd KEY_HOME>, ++ <0xea KEY_VOLUMEUP>, ++ <0xe3 KEY_VOLUMEDOWN>, ++ <0xe2 KEY_SEARCH>, ++ <0xb2 KEY_POWER>, ++ <0xbc KEY_MUTE>, ++ <0xec KEY_MENU>, ++ <0xbf 0x190>, ++ <0xe0 0x191>, ++ <0xe1 0x192>, ++ <0xe9 183>, ++ <0xe6 248>, ++ <0xe8 185>, ++ <0xe7 186>, ++ <0xf0 388>, ++ <0xbe 0x175>; ++ }; ++ ++ ir_key2 { ++ rockchip,usercode = <0xff00>; ++ rockchip,key_table = ++ <0xf9 KEY_HOME>, ++ <0xbf KEY_BACK>, ++ <0xfb KEY_MENU>, ++ <0xaa KEY_REPLY>, ++ <0xb9 KEY_UP>, ++ <0xe9 KEY_DOWN>, ++ <0xb8 KEY_LEFT>, ++ <0xea KEY_RIGHT>, ++ <0xeb KEY_VOLUMEDOWN>, ++ <0xef KEY_VOLUMEUP>, ++ <0xf7 KEY_MUTE>, ++ <0xe7 KEY_POWER>, ++ <0xfc KEY_POWER>, ++ <0xa9 KEY_VOLUMEDOWN>, ++ <0xa8 KEY_VOLUMEDOWN>, ++ <0xe0 KEY_VOLUMEDOWN>, ++ <0xa5 KEY_VOLUMEDOWN>, ++ <0xab 183>, ++ <0xb7 388>, ++ <0xe8 388>, ++ <0xf8 184>, ++ <0xaf 185>, ++ <0xed KEY_VOLUMEDOWN>, ++ <0xee 186>, ++ <0xb3 KEY_VOLUMEDOWN>, ++ <0xf1 KEY_VOLUMEDOWN>, ++ <0xf2 KEY_VOLUMEDOWN>, ++ <0xf3 KEY_SEARCH>, ++ <0xb4 KEY_VOLUMEDOWN>, ++ <0xbe KEY_SEARCH>; ++ }; ++ ++ ir_key3 { ++ rockchip,usercode = <0x1dcc>; ++ rockchip,key_table = ++ <0xee KEY_REPLY>, ++ <0xf0 KEY_BACK>, ++ <0xf8 KEY_UP>, ++ <0xbb KEY_DOWN>, ++ <0xef KEY_LEFT>, ++ <0xed KEY_RIGHT>, ++ <0xfc KEY_HOME>, ++ <0xf1 KEY_VOLUMEUP>, ++ <0xfd KEY_VOLUMEDOWN>, ++ <0xb7 KEY_SEARCH>, ++ <0xff KEY_POWER>, ++ <0xf3 KEY_MUTE>, ++ <0xbf KEY_MENU>, ++ <0xf9 0x191>, ++ <0xf5 0x192>, ++ <0xb3 388>, ++ <0xbe KEY_1>, ++ <0xba KEY_2>, ++ <0xb2 KEY_3>, ++ <0xbd KEY_4>, ++ <0xf9 KEY_5>, ++ <0xb1 KEY_6>, ++ <0xfc KEY_7>, ++ <0xf8 KEY_8>, ++ <0xb0 KEY_9>, ++ <0xb6 KEY_0>, ++ <0xb5 KEY_BACKSPACE>; ++ }; ++}; ++ ++&rk_rga { ++ status = "okay"; ++}; ++ ++&rkvdec { ++ status = "okay"; ++}; ++ ++&rkvdec_mmu { ++ status = "okay"; ++}; ++ ++&rkvenc { ++ venc-supply = <&vdd_logic>; ++ status = "okay"; ++}; ++ ++&rkvenc_mmu { ++ status = "okay"; ++}; ++ ++&rknpu { ++ rknpu-supply = <&vdd_npu>; ++ status = "okay"; ++}; ++ ++&rknpu_mmu { ++ status = "okay"; ++}; ++ ++&route_hdmi { ++ status = "okay"; ++ connect = <&vp0_out_hdmi>; ++}; ++ ++&saradc { ++ status = "okay"; ++ vref-supply = <&vcca_1v8>; ++}; ++ ++&sdhci { ++ bus-width = <8>; ++ no-sdio; ++ no-sd; ++ non-removable; ++ max-frequency = <200000000>; ++ status = "okay"; ++}; ++ ++&sdmmc0 { ++ max-frequency = <150000000>; ++ no-sdio; ++ no-mmc; ++ bus-width = <4>; ++ cap-mmc-highspeed; ++ cap-sd-highspeed; ++ disable-wp; ++ sd-uhs-sdr104; ++ vmmc-supply = <&vcc3v3_sd>; ++ vqmmc-supply = <&vccio_sd>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; ++ status = "okay"; ++}; ++ ++&sfc { ++ status = "okay"; ++ ++ flash@0 { ++ compatible = "spi-nand"; ++ reg = <0>; ++ spi-max-frequency = <75000000>; ++ spi-rx-bus-width = <4>; ++ spi-tx-bus-width = <1>; ++ }; ++}; ++ ++&spdif_8ch { ++ status = "okay"; ++}; ++ ++&tsadc { ++ status = "okay"; ++}; ++ ++&u2phy0_host { ++ phy-supply = <&vcc5v0_host>; ++ status = "okay"; ++}; ++ ++&u2phy0_otg { ++ vbus-supply = <&vcc5v0_otg>; ++ status = "okay"; ++}; ++ ++&u2phy1_host { ++ phy-supply = <&vcc5v0_host>; ++ status = "okay"; ++}; ++ ++&u2phy1_otg { ++ phy-supply = <&vcc5v0_host>; ++ status = "okay"; ++}; ++ ++&usb2phy0 { ++ status = "okay"; ++}; ++ ++&usb2phy1 { ++ status = "okay"; ++}; ++ ++&usb_host0_ehci { ++ status = "okay"; ++}; ++ ++&usb_host0_ohci { ++ status = "okay"; ++}; ++ ++&usb_host1_ehci { ++ status = "okay"; ++}; ++ ++&usb_host1_ohci { ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3 { ++ dr_mode = "otg"; ++ extcon = <&usb2phy0>; ++ status = "okay"; ++}; ++ ++&usbdrd30 { ++ status = "okay"; ++}; ++ ++&usbhost_dwc3 { ++ status = "okay"; ++}; ++ ++&usbhost30 { ++ status = "okay"; ++}; ++ ++&vad { ++ rockchip,audio-src = <&i2s1_8ch>; ++ rockchip,buffer-time-ms = <128>; ++ rockchip,det-channel = <0>; ++ rockchip,mode = <0>; ++}; ++ ++&vdpu { ++ status = "okay"; ++}; ++ ++&vdpu_mmu { ++ status = "okay"; ++}; ++ ++&vepu { ++ status = "okay"; ++}; ++ ++&vepu_mmu { ++ status = "okay"; ++}; ++ ++&vop { ++ status = "okay"; ++ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; ++ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; ++}; ++ ++&vop_mmu { ++ status = "okay"; ++}; +diff -uprN a/arch/arm64/boot/dts/rockchip/rk3568-evb1-ddr4-v10.dtsi b/arch/arm64/boot/dts/rockchip/rk3568-evb1-ddr4-v10.dtsi +--- a/arch/arm64/boot/dts/rockchip/rk3568-evb1-ddr4-v10.dtsi 1970-01-01 00:00:00.000000000 +0000 ++++ b/arch/arm64/boot/dts/rockchip/rk3568-evb1-ddr4-v10.dtsi 2023-03-15 03:59:07.051206609 +0000 +@@ -0,0 +1,492 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2020 Rockchip Electronics Co., Ltd. ++ * ++ */ ++ ++/dts-v1/; ++ ++#include ++#include ++#include "rk3568.dtsi" ++#include "rk3568-evb.dtsi" ++ ++/ { ++ model = "Rockchip RK3568 EVB1 DDR4 V10 Board"; ++ compatible = "rockchip,rk3568-evb1-ddr4-v10", "rockchip,rk3568"; ++ ++ vcc2v5_sys: vcc2v5-ddr { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc2v5-sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <2500000>; ++ regulator-max-microvolt = <2500000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++ ++ vcc3v3_vga: vcc3v3-vga { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_vga"; ++ regulator-always-on; ++ regulator-boot-on; ++ gpio = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++ ++ pcie30_avdd0v9: pcie30-avdd0v9 { ++ compatible = "regulator-fixed"; ++ regulator-name = "pcie30_avdd0v9"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++ ++ pcie30_avdd1v8: pcie30-avdd1v8 { ++ compatible = "regulator-fixed"; ++ regulator-name = "pcie30_avdd1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++ ++ vcc3v3_pcie: gpio-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_pcie"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ enable-active-high; ++ gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; ++ startup-delay-us = <5000>; ++ vin-supply = <&dc_12v>; ++ }; ++ ++ vcc3v3_bu: vcc3v3-bu { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_bu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ vcc_camera: vcc-camera-regulator { ++ compatible = "regulator-fixed"; ++ gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&camera_pwr>; ++ regulator-name = "vcc_camera"; ++ enable-active-high; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++}; ++ ++&combphy0_us { ++ status = "okay"; ++}; ++ ++&combphy1_usq { ++ status = "okay"; ++}; ++ ++&combphy2_psq { ++ status = "okay"; ++}; ++ ++&csi2_dphy_hw { ++ status = "okay"; ++}; ++ ++&csi2_dphy0 { ++ status = "okay"; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ port@0 { ++ reg = <0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ mipi_in_ucam0: endpoint@1 { ++ reg = <1>; ++ remote-endpoint = <&ucam_out0>; ++ data-lanes = <1 2 3 4>; ++ }; ++ mipi_in_ucam1: endpoint@2 { ++ reg = <2>; ++ remote-endpoint = <&gc8034_out>; ++ data-lanes = <1 2 3 4>; ++ }; ++ mipi_in_ucam2: endpoint@3 { ++ reg = <3>; ++ remote-endpoint = <&ov5695_out>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ port@1 { ++ reg = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ csidphy_out: endpoint@0 { ++ reg = <0>; ++ remote-endpoint = <&isp0_in>; ++ }; ++ }; ++ }; ++}; ++ ++/* ++ * video_phy0 needs to be enabled ++ * when dsi0 is enabled ++ */ ++&dsi0 { ++ status = "okay"; ++}; ++ ++&dsi0_in_vp0 { ++ status = "disabled"; ++}; ++ ++&dsi0_in_vp1 { ++ status = "okay"; ++}; ++ ++&dsi0_panel { ++ power-supply = <&vcc3v3_lcd0_n>; ++}; ++ ++/* ++ * video_phy1 needs to be enabled ++ * when dsi1 is enabled ++ */ ++&dsi1 { ++ status = "disabled"; ++}; ++ ++&dsi1_in_vp0 { ++ status = "disabled"; ++}; ++ ++&dsi1_in_vp1 { ++ status = "disabled"; ++}; ++ ++&dsi1_panel { ++ power-supply = <&vcc3v3_lcd1_n>; ++}; ++ ++&edp { ++ hpd-gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++}; ++ ++&edp_phy { ++ status = "okay"; ++}; ++ ++&edp_in_vp0 { ++ status = "okay"; ++}; ++ ++&edp_in_vp1 { ++ status = "disabled"; ++}; ++ ++&gmac0 { ++ phy-mode = "rgmii"; ++ clock_in_out = "output"; ++ ++ snps,reset-gpio = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>; ++ snps,reset-active-low; ++ /* Reset time is 20ms, 100ms for rtl8211f */ ++ snps,reset-delays-us = <0 20000 100000>; ++ ++ assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>; ++ assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>; ++ assigned-clock-rates = <0>, <125000000>; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gmac0_miim ++ &gmac0_tx_bus2 ++ &gmac0_rx_bus2 ++ &gmac0_rgmii_clk ++ &gmac0_rgmii_bus>; ++ ++ tx_delay = <0x3c>; ++ rx_delay = <0x2f>; ++ ++ phy-handle = <&rgmii_phy0>; ++ status = "okay"; ++}; ++ ++&gmac1 { ++ phy-mode = "rgmii"; ++ clock_in_out = "output"; ++ ++ snps,reset-gpio = <&gpio2 RK_PD1 GPIO_ACTIVE_LOW>; ++ snps,reset-active-low; ++ /* Reset time is 20ms, 100ms for rtl8211f */ ++ snps,reset-delays-us = <0 20000 100000>; ++ ++ assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>; ++ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>; ++ assigned-clock-rates = <0>, <125000000>; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gmac1m1_miim ++ &gmac1m1_tx_bus2 ++ &gmac1m1_rx_bus2 ++ &gmac1m1_rgmii_clk ++ &gmac1m1_rgmii_bus>; ++ ++ tx_delay = <0x4f>; ++ rx_delay = <0x26>; ++ ++ phy-handle = <&rgmii_phy1>; ++ status = "okay"; ++}; ++ ++/* ++ * power-supply should switche to vcc3v3_lcd1_n ++ * when mipi panel is connected to dsi1. ++ */ ++>1x { ++ power-supply = <&vcc3v3_lcd0_n>; ++}; ++ ++&i2c4 { ++ status = "okay"; ++ gc8034: gc8034@37 { ++ compatible = "galaxycore,gc8034"; ++ status = "okay"; ++ reg = <0x37>; ++ clocks = <&cru CLK_CIF_OUT>; ++ clock-names = "xvclk"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&cif_clk>; ++ reset-gpios = <&gpio3 RK_PB6 GPIO_ACTIVE_LOW>; ++ pwdn-gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_LOW>; ++ rockchip,grf = <&grf>; ++ rockchip,camera-module-index = <0>; ++ rockchip,camera-module-facing = "back"; ++ rockchip,camera-module-name = "RK-CMK-8M-2-v1"; ++ rockchip,camera-module-lens-name = "CK8401"; ++ port { ++ gc8034_out: endpoint { ++ remote-endpoint = <&mipi_in_ucam1>; ++ data-lanes = <1 2 3 4>; ++ }; ++ }; ++ }; ++ os04a10: os04a10@36 { ++ compatible = "ovti,os04a10"; ++ reg = <0x36>; ++ clocks = <&cru CLK_CIF_OUT>; ++ clock-names = "xvclk"; ++ power-domains = <&power RK3568_PD_VI>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&cif_clk>; ++ reset-gpios = <&gpio3 RK_PB6 GPIO_ACTIVE_LOW>; ++ pwdn-gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>; ++ rockchip,camera-module-index = <0>; ++ rockchip,camera-module-facing = "back"; ++ rockchip,camera-module-name = "CMK-OT1607-FV1"; ++ rockchip,camera-module-lens-name = "M12-40IRC-4MP-F16"; ++ port { ++ ucam_out0: endpoint { ++ remote-endpoint = <&mipi_in_ucam0>; ++ data-lanes = <1 2 3 4>; ++ }; ++ }; ++ }; ++ ov5695: ov5695@36 { ++ status = "okay"; ++ compatible = "ovti,ov5695"; ++ reg = <0x36>; ++ clocks = <&cru CLK_CIF_OUT>; ++ clock-names = "xvclk"; ++ power-domains = <&power RK3568_PD_VI>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&cif_clk>; ++ reset-gpios = <&gpio3 RK_PB6 GPIO_ACTIVE_HIGH>; ++ pwdn-gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>; ++ rockchip,camera-module-index = <0>; ++ rockchip,camera-module-facing = "back"; ++ rockchip,camera-module-name = "TongJu"; ++ rockchip,camera-module-lens-name = "CHT842-MD"; ++ port { ++ ov5695_out: endpoint { ++ remote-endpoint = <&mipi_in_ucam2>; ++ data-lanes = <1 2>; ++ }; ++ }; ++ }; ++}; ++ ++&mdio0 { ++ rgmii_phy0: phy@0 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <0x0>; ++ }; ++}; ++ ++&mdio1 { ++ rgmii_phy1: phy@0 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <0x0>; ++ }; ++}; ++ ++&video_phy0 { ++ status = "okay"; ++}; ++ ++&video_phy1 { ++ status = "disabled"; ++}; ++ ++&pcie30phy { ++ status = "okay"; ++}; ++ ++&pcie3x2 { ++ reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc3v3_pcie>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ cam { ++ camera_pwr: camera-pwr { ++ rockchip,pins = ++ /* camera power en */ ++ <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ headphone { ++ hp_det: hp-det { ++ rockchip,pins = <3 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ ++ wireless-wlan { ++ wifi_host_wake_irq: wifi-host-wake-irq { ++ rockchip,pins = <3 RK_PD4 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ ++ wireless-bluetooth { ++ uart8_gpios: uart8-gpios { ++ rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++}; ++ ++&rk809_sound { ++ hp-det-gpio = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>; ++}; ++ ++&rkisp { ++ status = "okay"; ++}; ++ ++&rkisp_mmu { ++ status = "okay"; ++}; ++ ++&rkisp_vir0 { ++ status = "okay"; ++ ++ port { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ isp0_in: endpoint@0 { ++ reg = <0>; ++ remote-endpoint = <&csidphy_out>; ++ }; ++ }; ++}; ++ ++&route_dsi0 { ++ status = "okay"; ++ connect = <&vp1_out_dsi0>; ++}; ++ ++&route_edp { ++ status = "okay"; ++ connect = <&vp0_out_edp>; ++}; ++ ++&sata2 { ++ status = "okay"; ++}; ++ ++&sdmmc2 { ++ max-frequency = <150000000>; ++ no-sd; ++ no-mmc; ++ bus-width = <4>; ++ disable-wp; ++ cap-sd-highspeed; ++ cap-sdio-irq; ++ keep-power-in-suspend; ++ mmc-pwrseq = <&sdio_pwrseq>; ++ non-removable; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc2m0_bus4 &sdmmc2m0_cmd &sdmmc2m0_clk>; ++ sd-uhs-sdr104; ++ status = "okay"; ++}; ++ ++&spdif_8ch { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spdifm1_tx>; ++}; ++ ++&uart8 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart8m0_xfer &uart8m0_ctsn>; ++}; ++ ++&vcc3v3_lcd0_n { ++ gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++}; ++ ++&vcc3v3_lcd1_n { ++ gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++}; ++ ++&wireless_wlan { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&wifi_host_wake_irq>; ++ WIFI,host_wake_irq = <&gpio3 RK_PD4 GPIO_ACTIVE_HIGH>; ++}; ++ ++&wireless_bluetooth { ++ compatible = "bluetooth-platdata"; ++ clocks = <&rk809 1>; ++ clock-names = "ext_clock"; ++ //wifi-bt-power-toggle; ++ uart_rts_gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>; ++ pinctrl-names = "default", "rts_gpio"; ++ pinctrl-0 = <&uart8m0_rtsn>; ++ pinctrl-1 = <&uart8_gpios>; ++ BT,reset_gpio = <&gpio3 RK_PA0 GPIO_ACTIVE_HIGH>; ++ BT,wake_gpio = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>; ++ BT,wake_host_irq = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++}; +diff -uprN a/arch/arm64/boot/dts/rockchip/rk3568-linux.dtsi b/arch/arm64/boot/dts/rockchip/rk3568-linux.dtsi +--- a/arch/arm64/boot/dts/rockchip/rk3568-linux.dtsi 1970-01-01 00:00:00.000000000 +0000 ++++ b/arch/arm64/boot/dts/rockchip/rk3568-linux.dtsi 2023-03-15 03:59:07.051206609 +0000 +@@ -0,0 +1,70 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2020 Rockchip Electronics Co., Ltd. ++ * ++ */ ++ ++/ { ++ aliases { ++ mmc0 = &sdhci; ++ mmc1 = &sdmmc0; ++ mmc2 = &sdmmc1; ++ mmc3 = &sdmmc2; ++ }; ++ ++ chosen: chosen { ++ bootargs = "earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 root=PARTUUID=614e0000-0000 rw rootwait"; ++ }; ++ ++ fiq-debugger { ++ compatible = "rockchip,fiq-debugger"; ++ rockchip,serial-id = <2>; ++ rockchip,wake-irq = <0>; ++ /* If enable uart uses irq instead of fiq */ ++ rockchip,irq-mode-enable = <1>; ++ rockchip,baudrate = <1500000>; /* Only 115200 and 1500000 */ ++ interrupts = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart2m0_xfer>; ++ status = "okay"; ++ }; ++ ++ debug: debug@fd904000 { ++ compatible = "rockchip,debug"; ++ reg = <0x0 0xfd904000 0x0 0x1000>, ++ <0x0 0xfd905000 0x0 0x1000>, ++ <0x0 0xfd906000 0x0 0x1000>, ++ <0x0 0xfd907000 0x0 0x1000>; ++ }; ++ ++ cspmu: cspmu@fd90c000 { ++ compatible = "rockchip,cspmu"; ++ reg = <0x0 0xfd90c000 0x0 0x1000>, ++ <0x0 0xfd90d000 0x0 0x1000>, ++ <0x0 0xfd90e000 0x0 0x1000>, ++ <0x0 0xfd90f000 0x0 0x1000>; ++ }; ++}; ++ ++&reserved_memory { ++ ramoops: ramoops@110000 { ++ compatible = "ramoops"; ++ reg = <0x0 0x110000 0x0 0xf0000>; ++ record-size = <0x20000>; ++ console-size = <0x80000>; ++ ftrace-size = <0x00000>; ++ pmsg-size = <0x50000>; ++ }; ++}; ++ ++&rng { ++ status = "okay"; ++}; ++ ++&rockchip_suspend { ++ status = "okay"; ++}; ++ ++&vop { ++ disable-win-move; ++}; +diff -uprN a/include/dt-bindings/sensor-dev.h b/include/dt-bindings/sensor-dev.h +--- a/include/dt-bindings/sensor-dev.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/dt-bindings/sensor-dev.h 2023-03-15 03:59:49.358063947 +0000 +@@ -0,0 +1,18 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++ ++#ifndef __DT_BINDINGS_ROCKCHIP_SENSORDEV_H__ ++#define __DT_BINDINGS_ROCKCHIP_SENSORDEV_H__ ++ ++#define SENSOR_TYPE_NULL 0 ++#define SENSOR_TYPE_ANGLE 1 ++#define SENSOR_TYPE_ACCEL 2 ++#define SENSOR_TYPE_COMPASS 3 ++#define SENSOR_TYPE_GYROSCOPE 4 ++#define SENSOR_TYPE_LIGHT 5 ++#define SENSOR_TYPE_PROXIMITY 6 ++#define SENSOR_TYPE_TEMPERATURE 7 ++#define SENSOR_TYPE_PRESSURE 8 ++#define SENSOR_TYPE_HALL 9 ++#define SENSOR_NUM_TYPES 10 ++ ++#endif diff --git a/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0002-fix-fiq_debugger.patch b/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0002-fix-fiq_debugger.patch new file mode 100644 index 0000000000000000000000000000000000000000..5d7b9548fa95f5efa4604e17733cb7c418f3d94e --- /dev/null +++ b/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0002-fix-fiq_debugger.patch @@ -0,0 +1,83 @@ +From 03ae4a2fb5ee3854d8784391aefdc1abac4297ae Mon Sep 17 00:00:00 2001 +From: liangqifeng +Date: Wed, 15 Feb 2023 13:57:51 +0000 +Subject: [PATCH] fix fiq_debugger + +--- + arch/arm64/kernel/fpsimd.c | 4 ++-- + drivers/staging/android/fiq_debugger/fiq_debugger.c | 7 +++---- + include/linux/printk.h | 2 +- + kernel/printk/printk.c | 2 +- + 4 files changed, 7 insertions(+), 8 deletions(-) + +diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c +index dbe196f38..da2413218 100644 +--- a/arch/arm64/kernel/fpsimd.c ++++ b/arch/arm64/kernel/fpsimd.c +@@ -244,7 +244,7 @@ static void *sve_free_atomic(struct task_struct *task) + */ + static void get_cpu_fpsimd_context(void) + { +- local_bh_disable(); ++ preempt_disable(); + __get_cpu_fpsimd_context(); + } + +@@ -265,7 +265,7 @@ static void __put_cpu_fpsimd_context(void) + static void put_cpu_fpsimd_context(void) + { + __put_cpu_fpsimd_context(); +- local_bh_enable(); ++ preempt_enable(); + } + + static bool have_cpu_fpsimd_context(void) +diff --git a/drivers/staging/android/fiq_debugger/fiq_debugger.c b/drivers/staging/android/fiq_debugger/fiq_debugger.c +index 59bd0a841..c1b352982 100755 +--- a/drivers/staging/android/fiq_debugger/fiq_debugger.c ++++ b/drivers/staging/android/fiq_debugger/fiq_debugger.c +@@ -263,12 +263,11 @@ static void fiq_debugger_dump_kernel_log(struct fiq_debugger_state *state) + { + char buf[512]; + size_t len; +- struct kmsg_dumper dumper = { .active = true }; ++ struct kmsg_dumper_iter iter = { .active = 1 }; + + +- kmsg_dump_rewind_nolock(&dumper); +- while (kmsg_dump_get_line_nolock(&dumper, true, buf, +- sizeof(buf) - 1, &len)) { ++ kmsg_dump_rewind(&iter); ++ while (kmsg_dump_get_line(&iter, false, buf, sizeof(buf), &len)) { + buf[len] = 0; + fiq_debugger_puts(state, buf); + } +diff --git a/include/linux/printk.h b/include/linux/printk.h +index 9331b131b..23946f482 100644 +--- a/include/linux/printk.h ++++ b/include/linux/printk.h +@@ -241,7 +241,7 @@ __printf(1, 2) void dump_stack_set_arch_desc(const char *fmt, ...); + void dump_stack_print_info(const char *log_lvl); + void show_regs_print_info(const char *log_lvl); + extern asmlinkage void dump_stack(void) __cold; +-#if defined(CONFIG_X86) || defined(CONFIG_ARM64_PSEUDO_NMI) ++#if (defined(CONFIG_X86) || defined(CONFIG_ARM64_PSEUDO_NMI)) && !defined(CONFIG_PREEMPT_RT) + extern void zap_locks(void); + #else + static inline void zap_locks(void) { } +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 7859f42a6..d1a472283 100644 +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -1813,7 +1813,7 @@ static void print_sync_until(struct console *con, u64 seq) + console_atomic_unlock(flags); + } + +-#if defined(CONFIG_X86) || defined(CONFIG_ARM64_PSEUDO_NMI) ++#if (defined(CONFIG_X86) || defined(CONFIG_ARM64_PSEUDO_NMI)) && !defined(CONFIG_PREEMPT_RT) + void zap_locks(void) + { + if (raw_spin_is_locked(&logbuf_lock)) { +-- +2.33.0 + diff --git a/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0002-ryd-gpio-control.patch b/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0002-ryd-gpio-control.patch new file mode 100644 index 0000000000000000000000000000000000000000..0f7bf0e314e5c8390b297edcd3dc5a1095384ba4 --- /dev/null +++ b/bsp/meta-rockchip/recipes-kernel/linux/files/patches/0002-ryd-gpio-control.patch @@ -0,0 +1,295 @@ +diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig +index f75f9e3ea..7b075bc11 100644 +--- a/drivers/char/Kconfig ++++ b/drivers/char/Kconfig +@@ -7,6 +7,12 @@ menu "Character devices" + + source "drivers/tty/Kconfig" + ++config RYD_GPIO_CONTROL ++ tristate "Support New RYD GPIO Control (Not use anymore)" ++ default y ++ help ++ If you say Y here, you will get support for a character device ++ + config TTY_PRINTK + tristate "TTY driver to output user messages via printk" + depends on EXPERT && TTY +diff --git a/drivers/char/Makefile b/drivers/char/Makefile +index 362d4a9cd..6920dbb7d 100644 +--- a/drivers/char/Makefile ++++ b/drivers/char/Makefile +@@ -49,3 +49,4 @@ obj-$(CONFIG_XILLYBUS) += xillybus/ + obj-$(CONFIG_POWERNV_OP_PANEL) += powernv-op-panel.o + obj-$(CONFIG_ADI) += adi.o + obj-$(CONFIG_PIN_MEMORY_DEV) += pin_memory.o ++obj-y += ryd_gpio_controls.o + +diff -uprN a/drivers/char/ryd_gpio_controls.c b/drivers/char/ryd_gpio_controls.c +--- a/drivers/char/ryd_gpio_controls.c 1970-01-01 00:00:00.000000000 +0000 ++++ b/drivers/char/ryd_gpio_controls.c 2023-03-14 08:15:53.465817342 +0000 +@@ -0,0 +1,264 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define D_DIRE_OUT 1 ++#define D_DIRE_IN 0 ++ ++#define D_PULL_NULL 0 ++#define D_PULL_LOW 1 ++#define D_PULL_UP 2 ++/* ++ryd_gpio_control { ++ compatible = "ryd_gpio_control"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ title { ++ gpio = <&gpio8 3 GPIO_ACTIVE_LOW>; ++ pull_cfg = 0=null 1=pulldown 2=pullup ++ dire_in:defaule dire_out ++ sys_create: create sys node ++ export:export gpio ++ } ++ ++};*/ ++ ++struct gpio_des { ++ char name[20]; ++ int gpio; ++ char flags; ++ char dir; ++ char pulldata; ++ char resetdelay; ++ char export; ++ struct device_attribute sysnode; ++}; ++ ++struct ryd_gpio_des { ++ int gpio_num; ++ struct gpio_des gpio_des_data[30]; ++}; ++ ++static struct platform_driver ryd_gpio_driver; ++ ++static ssize_t gpio_state_store(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t len) ++{ ++ int index = 0; ++ int value = buf[0] - 48; ++ if ((value == 0) || (value == 1)) ++ { ++ struct ryd_gpio_des *data = dev_get_drvdata(dev); ++ while(index < data->gpio_num) ++ { ++ if(strcmp(attr->attr.name,data->gpio_des_data[index].name) == 0) ++ { ++ if (data->gpio_des_data[index].dir == D_DIRE_OUT) ++ { ++ if (gpio_cansleep(data->gpio_des_data[index].gpio) == 1) ++ gpiod_set_value_cansleep(gpio_to_desc(data->gpio_des_data[index].gpio),value); ++ else ++ gpio_direction_output(data->gpio_des_data[index].gpio,value); ++ } ++ break; ++ } ++ index++; ++ } ++ } ++ ++ return len; ++} ++ ++static ssize_t gpio_state_show(struct device *dev, struct device_attribute *attr,char *buf) ++{ ++ int index = 0; ++ int value = -1; ++ struct ryd_gpio_des *data = dev_get_drvdata(dev); ++ while(index < data->gpio_num) ++ { ++ if(strcmp(attr->attr.name,data->gpio_des_data[index].name) == 0) ++ { ++ if (gpio_cansleep(data->gpio_des_data[index].gpio) == 1) ++ value = gpiod_get_value_cansleep(gpio_to_desc(data->gpio_des_data[index].gpio)); ++ else ++ value = gpio_get_value(data->gpio_des_data[index].gpio); ++ break; ++ } ++ index++; ++ } ++ ++ return sprintf(buf, "%d\n", value); ++} ++ ++static int rydgpio_parse_dt(struct device_node *fathernode,struct ryd_gpio_des *data) ++{ ++ struct device_node *childnode; ++ enum of_gpio_flags flags; ++ data->gpio_num = 0; ++ for_each_child_of_node(fathernode, childnode) ++ { ++ data->gpio_des_data[data->gpio_num].gpio = of_get_named_gpio_flags(childnode, "gpio", 0,&flags); ++ ++ if (!gpio_is_valid(data->gpio_des_data[data->gpio_num].gpio)) ++ { ++ printk("get ryd gpio is error\n"); ++ continue; ++ } ++ data->gpio_des_data[data->gpio_num].flags = (flags == OF_GPIO_ACTIVE_LOW) ? 0 : 1; ++ data->gpio_des_data[data->gpio_num].dir = D_DIRE_OUT; ++ if (of_property_read_bool(childnode, "dir_in")) ++ { ++ data->gpio_des_data[data->gpio_num].dir = D_DIRE_IN; ++ } ++ ++ of_property_read_u8(childnode, "pull_cfg", &(data->gpio_des_data[data->gpio_num].pulldata)); ++ ++ if (of_property_read_bool(childnode, "sys_create")) ++ { ++ sprintf(data->gpio_des_data[data->gpio_num].name,childnode->name); ++ } ++ else ++ { ++ sprintf(data->gpio_des_data[data->gpio_num].name,"null"); ++ } ++ ++ data->gpio_des_data[data->gpio_num].resetdelay = 0; ++ if (of_property_read_bool(childnode, "reset_pin")) ++ { ++ of_property_read_u8(childnode, "reset_pin", &(data->gpio_des_data[data->gpio_num].resetdelay)); ++ } ++ ++ if (of_property_read_bool(childnode, "export")) ++ { ++ data->gpio_des_data[data->gpio_num].export = 1; ++ } ++ ++ data->gpio_num++; ++ } ++ return 0; ++} ++ ++static int rydgpio_deal(struct platform_device *pdev,struct ryd_gpio_des *data) ++{ ++ int index = 0; ++ int ret; ++ while(index < data->gpio_num) ++ { ++ ret = gpio_request(data->gpio_des_data[index].gpio,data->gpio_des_data[index].name); ++ if (ret != 0) { ++ pr_err("gpio_request gpio invalid: %d\n",index); ++ } ++ else ++ { ++ //deal reset ++ if (data->gpio_des_data[index].resetdelay > 0) ++ { ++ if (data->gpio_des_data[index].dir == D_DIRE_OUT) ++ { ++ if (gpio_cansleep(data->gpio_des_data[index].gpio) == 1) ++ gpiod_set_value_cansleep(gpio_to_desc(data->gpio_des_data[index].gpio),!data->gpio_des_data[index].flags); ++ else ++ gpio_direction_output(data->gpio_des_data[index].gpio,!data->gpio_des_data[index].flags); ++ } ++ msleep(data->gpio_des_data[index].resetdelay); ++ } ++ ++ if (data->gpio_des_data[index].dir == D_DIRE_OUT) ++ { ++ gpio_direction_output(data->gpio_des_data[index].gpio,data->gpio_des_data[index].flags); ++ if (gpio_cansleep(data->gpio_des_data[index].gpio) == 1) ++ gpiod_set_value_cansleep(gpio_to_desc(data->gpio_des_data[index].gpio),data->gpio_des_data[index].flags); ++ else ++ gpio_direction_output(data->gpio_des_data[index].gpio,data->gpio_des_data[index].flags); ++ } ++ ++ if (data->gpio_des_data[index].pulldata == D_PULL_UP) ++ { ++ ++ } ++ else if(data->gpio_des_data[index].pulldata == D_PULL_LOW) ++ { ++ ++ } ++ ++ if (strcmp(data->gpio_des_data[index].name,"null") != 0) ++ { ++ data->gpio_des_data[index].sysnode.attr.name = data->gpio_des_data[index].name; ++ data->gpio_des_data[index].sysnode.attr.mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH; ++ data->gpio_des_data[index].sysnode.show = gpio_state_show; ++ data->gpio_des_data[index].sysnode.store = gpio_state_store; ++ device_create_file(&pdev->dev,&(data->gpio_des_data[index].sysnode)); ++ } ++ ++ if (data->gpio_des_data[index].export == 1) ++ { ++ if (data->gpio_des_data[index].dir == D_DIRE_IN){ ++ gpio_direction_input(data->gpio_des_data[index].gpio); ++ gpio_export(data->gpio_des_data[index].gpio,0); ++ } ++ else ++ gpio_export(data->gpio_des_data[index].gpio,1); ++ } ++ } ++ index++; ++ } ++ return 0; ++} ++ ++static int ryd_gpio_probe(struct platform_device *pdev) ++{ ++ struct ryd_gpio_des *platdata; ++ platdata = devm_kzalloc(&pdev->dev, sizeof(struct ryd_gpio_des),GFP_KERNEL); ++ ++ if (!platdata) ++ return -ENOMEM; ++ ++ printk("start new gpio_probe\n"); ++ ++ rydgpio_parse_dt(pdev->dev.of_node,platdata); ++ rydgpio_deal(pdev,platdata); ++ ++ platform_set_drvdata(pdev, platdata); ++ ++ printk("start end gpio_probe\n"); ++ ++ return 0; ++} ++ ++ ++static const struct of_device_id ryd_gpio_dt_ids[] = { ++ {.compatible = "ryd_gpio_control",}, ++ {} ++}; ++ ++static struct platform_driver ryd_gpio_driver = { ++ .probe = ryd_gpio_probe, ++ .driver = { ++ .name = "ryd_gpio_control", ++ .owner = THIS_MODULE, ++ .of_match_table = of_match_ptr(ryd_gpio_dt_ids), ++ }, ++}; ++ ++static int __init ryd_gpio_init(void) ++{ ++ int retval; ++ retval = platform_driver_register(&ryd_gpio_driver); ++ return retval; ++} ++ ++static void __exit ryd_gpio_exit(void) ++{ ++ platform_driver_unregister(&ryd_gpio_driver); ++} ++ ++subsys_initcall_sync(ryd_gpio_init); ++module_exit(ryd_gpio_exit); diff --git a/bsp/meta-rockchip/recipes-kernel/linux/files/tools/its_config b/bsp/meta-rockchip/recipes-kernel/linux/files/tools/its_config new file mode 100644 index 0000000000000000000000000000000000000000..9b48dfa282b4eef5577e4f6df2dbe64ecc7db9bb --- /dev/null +++ b/bsp/meta-rockchip/recipes-kernel/linux/files/tools/its_config @@ -0,0 +1,67 @@ +/* +* Copyright (C) 2020 Rockchip Electronics Co., Ltd +* +* SPDX-License-Identifier: GPL-2.0 +*/ + +/dts-v1/; +/ { +description = "U-Boot FIT source file for arm"; + +images { +fdt { +data = /incbin/("path_to_kernel/arch/arm64/boot/dts/rockchip/dtb_name"); +type = "flat_dt"; +arch = "arm64"; +compression = "none"; +load = <0xffffff00>; + +hash { +algo = "sha256"; +}; +}; + +kernel { +data = /incbin/("path_to_kernel/arch/arm64/boot/Image"); +type = "kernel"; +arch = "arm64"; +os = "linux"; +compression = "none"; +entry = <0xffffff01>; +load = <0xffffff01>; + +hash { +algo = "sha256"; +}; +}; + +resource { +data = /incbin/("path_to_kernel/resource.img"); +type = "multi"; +arch = "arm64"; +compression = "none"; + +hash { +algo = "sha256"; +}; +}; +}; + +configurations { +default = "conf"; + +conf { +rollback-index = <0x00>; +fdt = "fdt"; +kernel = "kernel"; +multi = "resource"; + +signature { +algo = "sha256,rsa2048"; +padding = "pss"; +key-name-hint = "dev"; +sign-images = "fdt", "kernel", "multi"; +}; +}; +}; +}; diff --git a/bsp/meta-rockchip/recipes-kernel/linux/files/tools/mkimage b/bsp/meta-rockchip/recipes-kernel/linux/files/tools/mkimage new file mode 100755 index 0000000000000000000000000000000000000000..d70325202c898dd39c87552d7614ac63ca99cb1d Binary files /dev/null and b/bsp/meta-rockchip/recipes-kernel/linux/files/tools/mkimage differ diff --git a/bsp/meta-rockchip/recipes-kernel/linux/files/tools/mkimg b/bsp/meta-rockchip/recipes-kernel/linux/files/tools/mkimg new file mode 100755 index 0000000000000000000000000000000000000000..41ff8c0b84e40de0672f930439cd7d140a142d78 --- /dev/null +++ b/bsp/meta-rockchip/recipes-kernel/linux/files/tools/mkimg @@ -0,0 +1,259 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd. + +set -e + +usage() { + cat >&2 << USAGE +usage: $0 [-h] --dtb DTB + +optional arguments: + -h, --help show this help message and exit + --dtb DTB the dtb file name +USAGE +} + +# Parse command-line arguments +while [ $# -gt 0 ]; do + case $1 in + --dtb) + DTB=$2 + shift 2 + ;; + -h) + usage + exit 0 + ;; + --help) + usage + exit 0 + ;; + *) + shift + ;; + esac +done + +srctree=${srctree-"."} +objtree=${objtree-"."} +if [ "${ARCH}" == "" ]; then + if [ "$($srctree/scripts/config --state CONFIG_ARM)" == "y" ]; then + ARCH=arm + else + ARCH=arm64 + fi +fi + +LOGO_PATH=${srctree}/logo.bmp +[ -f ${LOGO_PATH} ] && LOGO=logo.bmp + +LOGO_KERNEL_PATH=${srctree}/logo_kernel.bmp +[ -f ${LOGO_KERNEL_PATH} ] && LOGO_KERNEL=logo_kernel.bmp + +KERNEL_IMAGE_PATH=${objtree}/arch/${ARCH}/boot/Image +KERNEL_IMAGE_ARG="--kernel ${KERNEL_IMAGE_PATH}" +if [ "${ARCH}" == "arm" ]; then + DTB_PATH=${objtree}/arch/arm/boot/dts/${DTB} + ZIMAGE=zImage +else + DTB_PATH=${objtree}/arch/arm64/boot/dts/rockchip/${DTB} + ZIMAGE=Image.lz4 +fi +KERNEL_ZIMAGE_PATH=${objtree}/arch/${ARCH}/boot/${ZIMAGE} +KERNEL_ZIMAGE_ARG="--kernel ${KERNEL_ZIMAGE_PATH}" +if [ ! -f ${DTB_PATH} ]; then + echo "No dtb" >&2 + usage + exit 1 +fi + +OUT=out +ITB=${BOOT_IMG} +ITS=${OUT}/boot.its +MKIMAGE=${MKIMAGE-"mkimage"} +MKIMAGE_ARG="-E -p 0x800" + +make_boot_img() +{ + RAMDISK_IMG_PATH=${objtree}/ramdisk.img + [ -f ${RAMDISK_IMG_PATH} ] && RAMDISK_IMG=ramdisk.img && RAMDISK_ARG="--ramdisk ${RAMDISK_IMG_PATH}" + + ${srctree}/scripts/mkbootimg \ + ${KERNEL_IMAGE_ARG} \ + ${RAMDISK_ARG} \ + --second resource.img \ + -o boot.img && \ + echo " Image: boot.img (with Image ${RAMDISK_IMG} resource.img) is ready"; + ${srctree}/scripts/mkbootimg \ + ${KERNEL_ZIMAGE_ARG} \ + ${RAMDISK_ARG} \ + --second resource.img \ + -o zboot.img && \ + echo " Image: zboot.img (with ${ZIMAGE} ${RAMDISK_IMG} resource.img) is ready" +} + +repack_boot_img() +{ + ${srctree}/scripts/repack-bootimg \ + --boot_img ${BOOT_IMG} --out ${OUT} \ + ${KERNEL_IMAGE_ARG} \ + --second resource.img \ + --dtb ${DTB_PATH} \ + -o boot.img && + echo " Image: boot.img (${BOOT_IMG} + Image) is ready"; + ${srctree}/scripts/repack-bootimg \ + --boot_img ${BOOT_IMG} --out ${OUT} \ + ${KERNEL_ZIMAGE_ARG} \ + --second resource.img \ + --dtb ${DTB_PATH} \ + -o zboot.img && \ + echo " Image: zboot.img (${BOOT_IMG} + ${ZIMAGE}) is ready" +} + +check_mkimage() +{ + MKIMAGE=$(type -p ${MKIMAGE} || true) + if [ -z "${MKIMAGE}" ]; then + # Doesn't exist + echo '"mkimage" command not found - U-Boot images will not be built' >&2 + exit 1; + fi +} + +unpack_itb() +{ + rm -rf ${OUT} + mkdir -p ${OUT} + + for NAME in $(fdtget -l ${ITB} /images) + do + # generate image + NODE="/images/${NAME}" + OFFS=$(fdtget -ti ${ITB} ${NODE} data-position) + SIZE=$(fdtget -ti ${ITB} ${NODE} data-size) + if [ -z ${OFFS} ]; then + continue; + fi + + if [ ${SIZE} -ne 0 ]; then + dd if=${ITB} of=${OUT}/${NAME} bs=${SIZE} count=1 skip=${OFFS} iflag=skip_bytes >/dev/null 2>&1 + else + touch ${OUT}/${NAME} + fi + done + + [ ! -f ${OUT}/kernel ] && echo "FIT ${ITB} no kernel" >&2 && exit 1 || true +} + +gen_its() +{ + TMP_ITB=${OUT}/boot.tmp + + # add placeholder + cp ${ITB} ${TMP_ITB} + for NAME in $(fdtget -l ${ITB} /images); do + fdtput -t s ${TMP_ITB} /images/${NAME} data "/INCBIN/(${NAME})" + done + dtc -I dtb -O dts ${TMP_ITB} -o ${ITS} >/dev/null 2>&1 + rm -f ${TMP_ITB} + + # fixup placeholder: data = "/INCBIN/(...)"; -> data = /incbin/("..."); + sed -i "s/\"\/INCBIN\/(\(.*\))\"/\/incbin\/(\"\1\")/" ${ITS} + + # remove + sed -i "/memreserve/d" ${ITS} + sed -i "/timestamp/d" ${ITS} + sed -i "/data-size/d" ${ITS} + sed -i "/data-position/d" ${ITS} + sed -i "/value/d" ${ITS} + sed -i "/hashed-strings/d" ${ITS} + sed -i "/hashed-nodes/d" ${ITS} + sed -i "/signer-version/d" ${ITS} + sed -i "/signer-name/d" ${ITS} +} + +gen_itb() +{ + [ -f ${OUT}/fdt ] && cp -a ${DTB_PATH} ${OUT}/fdt && FDT=" + ${DTB}" + [ -f ${OUT}/resource ] && cp -a resource.img ${OUT}/resource && RESOURCE=" + resource.img" + COMP=$(fdtget ${ITB} /images/kernel compression) + case "${COMP}" in + gzip) EXT=".gz";; + lz4) EXT=".lz4";; + bzip2) EXT=".bz2";; + lzma) EXT=".lzma";; + lzo) EXT=".lzo";; + esac + cp -a ${KERNEL_IMAGE_PATH}${EXT} ${OUT}/kernel && \ + ${MKIMAGE} ${MKIMAGE_ARG} -f ${ITS} boot.img >/dev/null && \ + echo " Image: boot.img (FIT ${BOOT_IMG} + Image${EXT}${FDT}${RESOURCE}) is ready"; + if [ "${EXT}" == "" ] && [ -f ${KERNEL_ZIMAGE_PATH} ]; then + cp -a ${KERNEL_ZIMAGE_PATH} ${OUT}/kernel && \ + ${MKIMAGE} ${MKIMAGE_ARG} -f ${ITS} zboot.img >/dev/null && \ + echo " Image: zboot.img (FIT ${BOOT_IMG} + zImage${FDT}${RESOURCE}) is ready"; + fi +} + +repack_itb() +{ + check_mkimage + unpack_itb + gen_its + gen_itb +} + +# Create U-Boot FIT Image use ${BOOT_ITS} +make_fit_boot_img() +{ + ITS=${OUT}/boot.its + + check_mkimage + mkdir -p ${OUT} + rm -f ${OUT}/fdt ${OUT}/kernel ${OUT}/resource ${ITS} + + cp -a ${BOOT_ITS} ${ITS} + cp -a ${DTB_PATH} ${OUT}/fdt + cp -a ${KERNEL_ZIMAGE_PATH} ${OUT}/kernel + cp -a resource.img ${OUT}/resource + + if [ "${ARCH}" == "arm64" ]; then + sed -i -e 's/arch = ""/arch = "arm64"/g' -e 's/compression = ""/compression = "lz4"/' ${ITS} + else + sed -i -e 's/arch = ""/arch = "arm"/g' -e 's/compression = ""/compression = "none"/' ${ITS} + fi + FIT_DESC=$(${MKIMAGE} ${MKIMAGE_ARG} -f ${ITS} boot.img | grep "FIT description" | sed 's/FIT description: //') + echo " Image: boot.img (${FIT_DESC}) is ready"; +} + +if [ -x ${srctree}/scripts/bmpconvert ]; then + if [ -f ${LOGO_PATH} ]; then + ${srctree}/scripts/bmpconvert ${LOGO_PATH}; + fi + if [ -f ${LOGO_KERNEL_PATH} ]; then + ${srctree}/scripts/bmpconvert ${LOGO_KERNEL_PATH}; + fi +fi + +if [ "${srctree}" != "${objtree}" ]; then + if [ -f ${LOGO_PATH} ]; then + cp -a ${LOGO_PATH} ${objtree}/; + fi + if [ -f ${LOGO_KERNEL_PATH} ]; then + cp -a ${LOGO_KERNEL_PATH} ${objtree}/; + fi +fi +scripts/resource_tool ${DTB_PATH} ${LOGO} ${LOGO_KERNEL} >/dev/null +echo " Image: resource.img (with ${DTB} ${LOGO} ${LOGO_KERNEL}) is ready" + +if [ -f "${BOOT_IMG}" ]; then + if file -L -p -b ${BOOT_IMG} | grep -q 'Device Tree Blob' ; then + repack_itb; + elif [ -x ${srctree}/scripts/repack-bootimg ]; then + repack_boot_img; + fi +elif [ -f "${BOOT_ITS}" ]; then + make_fit_boot_img; +elif [ -x ${srctree}/scripts/mkbootimg ]; then + make_boot_img; +fi diff --git a/bsp/meta-rockchip/recipes-kernel/linux/linux-openeuler-rt.bbappend b/bsp/meta-rockchip/recipes-kernel/linux/linux-openeuler-rt.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..2214ef2c11d49b0157b38ceb1a6818c35b78db66 --- /dev/null +++ b/bsp/meta-rockchip/recipes-kernel/linux/linux-openeuler-rt.bbappend @@ -0,0 +1,13 @@ +require recipes-kernel/linux/linux-rockchip.inc + +SRC_URI_append_rk3568 = " \ + file://patches/0002-fix-fiq_debugger.patch \ +" +#define and use defconfig +do_configure_prepend() { + sed -i 's/CONFIG_PREEMPT=y/CONFIG_PREEMPT_RT=y/g' ${OPENEULER_KERNEL_CONFIG} + cp -f "${OPENEULER_KERNEL_CONFIG}" .config +} + +#add COMPATIBLE_MACHINE +COMPATIBLE_MACHINE = "ok3568|ryd-3568" diff --git a/bsp/meta-rockchip/recipes-kernel/linux/linux-openeuler.bbappend b/bsp/meta-rockchip/recipes-kernel/linux/linux-openeuler.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3fb9df874fd2c7c7409e1a98595ef94340a0aed7 --- /dev/null +++ b/bsp/meta-rockchip/recipes-kernel/linux/linux-openeuler.bbappend @@ -0,0 +1,4 @@ +require recipes-kernel/linux/linux-rockchip.inc + +# add COMPATIBLE_MACHINE +COMPATIBLE_MACHINE = "ok3568|ryd-3568" diff --git a/bsp/meta-rockchip/recipes-kernel/linux/linux-rockchip.inc b/bsp/meta-rockchip/recipes-kernel/linux/linux-rockchip.inc new file mode 100644 index 0000000000000000000000000000000000000000..5eea12ed97f6415d71191b07288faa9745a34fab --- /dev/null +++ b/bsp/meta-rockchip/recipes-kernel/linux/linux-rockchip.inc @@ -0,0 +1,41 @@ +# add recipes-kernel path to find patch and defconfig +FILESEXTRAPATHS_append := "${THISDIR}/files/:" +# add patch prebuild tools and logo +SRC_URI_append = " \ + file://config/ \ + file://patches/0000-rk3568-kernel.patch.gz;name=rk3568-kernel-patch \ + file://tools \ + file://logo \ +" + +# patches for ryd-3568 +SRC_URI_append_ryd-3568 = " \ + file://patches/0001-rk3568-8897-dts.patch \ + file://patches/0002-ryd-gpio-control.patch \ + " + +# more support of device is comming. so we documented this patch md5sum. +SRC_URI[rk3568-kernel-patch.md5sum] = "b4c156e59411c8e86098e03de67a84ca" + +# add patch tool to solve patch apply +PATCHTOOL = "git" + +OPENEULER_KERNEL_CONFIG = "../config/${MACHINE}/defconfig-kernel" + +# add method to do_compile task to produce bootable Image +do_compile_append_rk3568(){ + cp ../logo/* ./ + scripts/mkkrnlimg ${KERNEL_OUTPUT_DIR}/Image kernel.img + ../tools/mkimg --dtb ${RK3568_KERNEL_DTB_NAME} + sed -e "s:path_to_kernel:${WORKDIR}\/build:g" -e "s:dtb_name:${RK3568_KERNEL_DTB_NAME}:g" \ + ${WORKDIR}/tools/its_config > .tmp_its_config + ../tools/mkimage -f .tmp_its_config -E -p 0x800 boot.img + rm -rf .tmp_its_config +} + +# add boot.img to $D +do_install_append(){ + cp ${B}/boot.img ${D}/boot +} +PACKAGES += "bootfile" +FILES_bootfile="/boot/boot.img" diff --git a/docs/image/armnn/UnitTests.jpg b/docs/image/armnn/UnitTests.jpg new file mode 100644 index 0000000000000000000000000000000000000000..75e6b5df8c6d9ed5d1e14a492a68b35026c90581 Binary files /dev/null and b/docs/image/armnn/UnitTests.jpg differ diff --git a/docs/image/armnn/context_diagram.jpg b/docs/image/armnn/context_diagram.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7e894c790f9183a4bcbe38fc6163771436677422 Binary files /dev/null and b/docs/image/armnn/context_diagram.jpg differ diff --git a/docs/image/armnn/inference_speed_diagram.jpg b/docs/image/armnn/inference_speed_diagram.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3f078e495557d44b52f655cd24a4be911b62103b Binary files /dev/null and b/docs/image/armnn/inference_speed_diagram.jpg differ diff --git a/docs/image/armnn/inference_speed_table.jpg b/docs/image/armnn/inference_speed_table.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f08f1be2c0a4edda6b5df1045f7ad64f2b84965e Binary files /dev/null and b/docs/image/armnn/inference_speed_table.jpg differ diff --git a/docs/image/armnn/libs.jpg b/docs/image/armnn/libs.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4ef5c24cf67f4b58978547cd4438159b2b5acb39 Binary files /dev/null and b/docs/image/armnn/libs.jpg differ diff --git a/docs/image/armnn/mem_diagram.jpg b/docs/image/armnn/mem_diagram.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fe87d5d4772a34eb3ee8c3c789ba7e967c79a81c Binary files /dev/null and b/docs/image/armnn/mem_diagram.jpg differ diff --git a/docs/image/armnn/mem_table.jpg b/docs/image/armnn/mem_table.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e670e976a98629c23173952059ce7a3ad115e71b Binary files /dev/null and b/docs/image/armnn/mem_table.jpg differ diff --git a/docs/image/develop_help/openeuler_fetch_process.png b/docs/image/develop_help/openeuler_fetch_process.png new file mode 100644 index 0000000000000000000000000000000000000000..313ccb01bb17b6e76d40f5a4cc4ded64315ff019 Binary files /dev/null and b/docs/image/develop_help/openeuler_fetch_process.png differ diff --git a/docs/image/develop_help/openeuler_fetch_repo_init.png b/docs/image/develop_help/openeuler_fetch_repo_init.png new file mode 100644 index 0000000000000000000000000000000000000000..b816598a8585c12d4638a8c0acb79ebf97e69914 Binary files /dev/null and b/docs/image/develop_help/openeuler_fetch_repo_init.png differ diff --git a/docs/image/docker_list/docker_detail.png b/docs/image/docker_list/docker_detail.png new file mode 100644 index 0000000000000000000000000000000000000000..9f0d32516f1374bdec435b6a0a38b9610fc208e3 Binary files /dev/null and b/docs/image/docker_list/docker_detail.png differ diff --git a/docs/image/mcs_architecture.png b/docs/image/mcs/mcs_architecture.png similarity index 100% rename from docs/image/mcs_architecture.png rename to docs/image/mcs/mcs_architecture.png diff --git a/docs/image/openamp_architecture.png b/docs/image/mcs/openamp_architecture.png similarity index 100% rename from docs/image/openamp_architecture.png rename to docs/image/mcs/openamp_architecture.png diff --git a/docs/image/os_services.png b/docs/image/mcs/os_services.png similarity index 100% rename from docs/image/os_services.png rename to docs/image/mcs/os_services.png diff --git a/docs/image/mcs/rpmsg-pty-shell.png b/docs/image/mcs/rpmsg-pty-shell.png new file mode 100755 index 0000000000000000000000000000000000000000..59a3e8c6667473ee395492a284ff3e9520241aab Binary files /dev/null and b/docs/image/mcs/rpmsg-pty-shell.png differ diff --git a/docs/image/qt/helloworld-gui_1.png b/docs/image/qt/helloworld-gui_1.png new file mode 100644 index 0000000000000000000000000000000000000000..befdb20397a9c61bded4993e89a2de2e0347e8c0 Binary files /dev/null and b/docs/image/qt/helloworld-gui_1.png differ diff --git a/docs/image/qt/helloworld-gui_2.png b/docs/image/qt/helloworld-gui_2.png new file mode 100644 index 0000000000000000000000000000000000000000..23891c186ea29b9b079ca2d0e720a886da3a63d4 Binary files /dev/null and b/docs/image/qt/helloworld-gui_2.png differ diff --git a/docs/image/qt/qt5-opengles2-test.png b/docs/image/qt/qt5-opengles2-test.png new file mode 100644 index 0000000000000000000000000000000000000000..75028e2eb5966b3baadf4235918d6d34d58258b5 Binary files /dev/null and b/docs/image/qt/qt5-opengles2-test.png differ diff --git a/docs/image/qt/wayland_frame.png b/docs/image/qt/wayland_frame.png new file mode 100644 index 0000000000000000000000000000000000000000..62f090d12b1e059f81048c4910784f57b96cc283 Binary files /dev/null and b/docs/image/qt/wayland_frame.png differ diff --git a/docs/image/qt/weston.png b/docs/image/qt/weston.png new file mode 100644 index 0000000000000000000000000000000000000000..2085a20a84ddf26ce3da6a57ab6f0d1c7d745dd4 Binary files /dev/null and b/docs/image/qt/weston.png differ diff --git a/docs/image/ros/plan_ros_architecture.png b/docs/image/ros/plan_ros_architecture.png new file mode 100644 index 0000000000000000000000000000000000000000..7d00df9d6d38e669585c84205035374cd5bd0dba Binary files /dev/null and b/docs/image/ros/plan_ros_architecture.png differ diff --git a/docs/image/ros/slam_demo1.png b/docs/image/ros/slam_demo1.png new file mode 100644 index 0000000000000000000000000000000000000000..b54485132ef8dc653c439086b65ea3ecbf1d3724 Binary files /dev/null and b/docs/image/ros/slam_demo1.png differ diff --git a/docs/image/ros/slam_demo2.png b/docs/image/ros/slam_demo2.png new file mode 100644 index 0000000000000000000000000000000000000000..85054ee99e11ef947aa07489ae22ceefb2e49c64 Binary files /dev/null and b/docs/image/ros/slam_demo2.png differ diff --git a/docs/image/test_project/mugen_run_info.png b/docs/image/test_project/mugen_run_info.png new file mode 100644 index 0000000000000000000000000000000000000000..cc523892155c8ab9814c392a1b081409c33e5720 Binary files /dev/null and b/docs/image/test_project/mugen_run_info.png differ diff --git a/docs/source/_templates/versions.html b/docs/source/_templates/versions.html new file mode 100644 index 0000000000000000000000000000000000000000..625a9a38478ebaeccdfa459a5678dfc7779527de --- /dev/null +++ b/docs/source/_templates/versions.html @@ -0,0 +1,28 @@ +{%- if current_version %} +
+ + Other Versions + v: {{ current_version.name }} + + +
+ {%- if versions.tags %} +
+
Tags
+ {%- for item in versions.tags %} +
{{ item.name }}
+ {%- endfor %} +
+ {%- endif %} + {%- if versions.branches %} +
+
Branches
+ {%- for item in versions.branches %} +
{{ item.name }}
+ {%- endfor %} +
+ {%- endif %} +
+
+{%- endif %} + diff --git a/docs/source/bsp/add_new_bsp_layer.rst b/docs/source/bsp/add_new_bsp_layer.rst new file mode 100644 index 0000000000000000000000000000000000000000..6cdda13898c2bb8abc006873676a46e288308740 --- /dev/null +++ b/docs/source/bsp/add_new_bsp_layer.rst @@ -0,0 +1,176 @@ +.. _add_new_bsp_layer: + +yocto-meta-openeuler 新增 bsp 层 +################################ + +本文档介绍如何在 ``yocto-meta-openeuler`` 仓库中新增 bsp 适配层 + +yocto-meta-openeuler 仓 bsp 目录层次说明 +**************************************** + +bsp 目录下当前共有两个目录: ``meta-openeuler-bsp`` ``meta-raspberrypi`` + +- ``meta-raspberrypi`` + + 该层提供树莓派开发板在硬件上的 recipes 和 conf 文件,例如一些基本固件,只要是跟开发板硬件强相关的 recipes 都可以放在该层中。一般该层由上游社区提供,例如 ``meta-raspberrypi`` 层在 openeuler 中仅仅只是引入,未对其中的 recipes 和 conf 文件作侵入式的修改,这便于后续升级和维护。 + +- ``meta-openeuler-bsp`` + + 单独的 bsp 层无法独立在 openeuler 层中很好的工作,作为 bsp 层与 openeuler 层之间的桥梁, ``meta-openeuler-bsp`` 层提供统一的对bsp层的修改,层中对 recipes 的修改基于yocto工程中 ``bbappend`` 形式来实现。 + + +新增 bsp 层举例说明 +******************* + +- 新增 ``meta-template`` 层 + + 上一节提到过,该层主要是提供与硬件强相关的 recipes 和 conf 文件,如果有上游社区提供完整的层,可以像引入 ``meta-raspberrypi`` 层一样直接引入。但是如果没有上游社区提供完整的层,就需要从零开始新建该层了,这里提供一种仅仅适配 ``openeuler`` 层的新建方式,而不是标准 ``yocto`` 形式的完整的层。 + + 1.缩减 ``meta-raspberrypi`` 层 + + .. code-block:: console + + tree -L 2 -d . + . + ├── classes + ├── conf + │   └── machine + ├── files + │   └── custom-licenses + ├── recipes-bsp + │   ├── bootfiles + │   └── common + ├── recipes-kernel + │   ├── bluez-firmware-rpidistro + │   └── linux-firmware-rpidistro + └── wic + + + ``classes``: 存放类文件目录 + + ``conf``: 存放配置文件目录 + + ``recipes-bsp``: 存放启动相关固件的recipes目录 + + ``recipes-kernel``: 存放与内核相关固件recipes目录 + + ``wic``: 暂时不考虑 + + 缩减完的 ``meta-raspberrypi`` 层同样可以支撑编译生成树莓派sd卡镜像,这就说明这是 ``meta-raspberrypi`` 层的最小集合,因此可以仿照这个最小集合来新增 bsp 层。 + + 2.最小集合分析 + + ``classes`` 和 ``recipes-bsp`` 目录 + + 首先,树莓派主要启动方式是通过把镜像烧录到sd卡中来启动,这就需要在 yocto 工程中生成可供烧录至sd卡的镜像, ``meta-raspberrypi`` 层中提供了 ``classes/sdcard_image-rpi.bbclass`` 这样一个类文件来实现(也可以看作是一个制作脚本)。脚本中的实现也不复杂,主要是构建 boot.img 文件并写入/boot分区,把 rootfs 文件写入/root分区,其中 boot.img 中会包含dtb,cmdline,config,kernel,启动固件等内容,这些内容怎么获取,最终是什么样的形式,是由 ``recipes-bsp/bootfiles/`` 目录中对应的 recipes 来决定的, ``sdcard_image-rpi.bbclass`` 只负责将最终产物搬移至 boot.img 中。这也就是 ``classes`` 和 ``recipes-bsp`` 中主要组成部分,逻辑是 ``classes/sdcard_image-rpi.bbclass`` 镜像生成脚本依赖 ``recipes-bsp/bootfiles/`` 中启动相关recipes的产物。 + + .. attention:: + 具体怎么组织文件内容,以及最终镜像的产物由开发板对应的启动方式来确定,这里只以树莓派为例。 + + ``conf`` 目录 + + 关于层的一些配置 ``layer.conf`` 是必须的,里面定义了层配置。 ``machine/xxxxx.conf`` 也是必须的,可以参考章节 :ref:`构建系统/yocto开发/如何定制添加layer` + + ``recipes-kernel`` 目录 + + 与 kernel 相关的固件 recipes,以树莓派的WI-FI驱动加载为例,内核驱动 brcmfmac.ko 在加载时需要先加载对应的固件,这些固件怎么编译/获取需要在该目录下的 recipes 中定义。 + + + 3.最终极简情况下的 ``meta-template`` 层结构如下 + + .. code-block:: console + + . + └── conf + ├── layer.conf + └── machine + └── template.conf + + ** layer.conf 文件内容示例 ** + + .. code-block:: console + + # We have a conf and classes directory, append to BBPATH + BBPATH .= ":${LAYERDIR}" + + # We have a recipes directory containing .bb and .bbappend files, add to BBFILES + BBFILES += "${LAYERDIR}/recipes*/*/*.bb \ + ${LAYERDIR}/recipes*/*/*.bbappend" + + BBFILE_COLLECTIONS += "template" + BBFILE_PATTERN_template := "^${LAYERDIR}/" + BBFILE_PRIORITY_template = "10" + + LAYERSERIES_COMPAT_template = "hardknott honister" + + ** template.conf 文件内容示例 ** + + .. code-block:: console + + # must needed, using which file depends on which arch + # poky privides some predefined files on different archs + # you can look through these files in yocto-poky/meta/conf/machine + # or using files privided by meta-openeuler like: + # require conf/machine/xxxx.inc + require conf/machine/include/tune-cortexa72.inc + + ``recipes-*`` 的内容是可选的,如果涉及到二次打包镜像,建议像树莓派那样,提供定制化脚本,放在classes目录中,在 ``conf/machine/template.conf`` 中增加 ``IMAGE_CLASSES += "xxxxx"`` 使其生效,并增加相应依赖的启动固件的 recipes;如果涉及到其他固件,也可以添加相应的 recipes。 + +- 修改 ``meta-openeuler-bsp`` 层 + + 1. 新增了 ``meta-template`` 层后,需要在 ``meta-openeuler-bsp`` 层中使其生效。修改 ``meta-openeuler-bsp/conf/layer.conf`` 文件即可: + + .. code-block:: console + + template:${LAYERDIR}/template/*/*/*.bb \ + template:${LAYERDIR}/template/*/*/*.bbappend \ + + BBPATH_append =. ":${LAYERDIR}/template" + + 2. 新增 ``template`` 目录 + + 目录的最小结构如下: + + .. code-block:: console + + . + ├── recipes-core + │   └── images + │   └── template.inc + └── recipes-kernel + └── linux + └── linux-openeuler.bbappend + + 该目录主要是提供针对 openeuler 层的适配操作,比如新增 bsp 所开启/关闭的内核选项与默认的不一样,就可以通过 ``linux-openeuler.bbappend`` 来修改。 ``template.inc`` 文件是必须存在的,可以为空,也可以做一些与 images 相关的适配操作。其他对 yocto 工程中任何 recipes 和 task 的修改,都可以通过该目录下来实现。 + + .. attention:: + + 新增其他 recipes 可以在 ``packagegroup-*.bbappend`` 添加使其生效 + + +- 修改 ``compile.sh`` 脚本 + + 在 ``get_build_info`` 函数中使能新增bsp的machine支持 + + .. code-block:: + + "template") + MACHINE="template" + ;; + + 并设置toolchain的路径(这里以arrch64为例,也可以在compile.sh的参数解析中新增) + + .. code-block:: + + "qemu-aarch64" | "raspberrypi4-64" | "template") + EXTERNAL_TOOLCHAIN_DIR="EXTERNAL_TOOLCHAIN_aarch64";; + + 在 ``set_env`` 函数中新增 ``meta-template`` 层 + + .. code-block:: + + if echo "$MACHINE" | grep -q "template";then + grep "meta-bsp-template" conf/bblayers.conf |grep -qv "^[[:space:]]*#" || sed -i "/\/meta-openeuler /a \ "${SRC_DIR}"/yocto-meta-openeuler/bsp/meta-bsp-template \\\\" conf/bblayers.conf + fi + + 至此,可以通过 ``source compile.sh template /path/to/build/dir`` 初始化 yocto 工程,使用 ``bitbake openeuler-image`` 生成镜像了。 diff --git a/docs/source/bsp/arm32/index.rst b/docs/source/bsp/arm32/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..3371553099b7bd63325685edaaa72a20a6f485fa --- /dev/null +++ b/docs/source/bsp/arm32/index.rst @@ -0,0 +1,13 @@ +.. _openeuler_embedded_arm32: + + +ARM32硬件 +################################ + +所支持的ARM32硬件如下: + +.. toctree:: + :maxdepth: 1 + :glob: + + */index diff --git a/docs/source/bsp/arm32/qemu_virt_cortex_a15/index.rst b/docs/source/bsp/arm32/qemu_virt_cortex_a15/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..0e45c83ea399e3bcf6ba035b8e96d9864bc0a04a --- /dev/null +++ b/docs/source/bsp/arm32/qemu_virt_cortex_a15/index.rst @@ -0,0 +1,17 @@ +.. _board_qemu_cortex_a15: + + +QEMU Virt Cortex-A15 +###################################### + +基本介绍 +================= + + +构建说明 +================== + + +使用说明 +================= + diff --git a/docs/source/bsp/arm64/index.rst b/docs/source/bsp/arm64/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..7036540c369dc02e3ca7211573b9e53253502343 --- /dev/null +++ b/docs/source/bsp/arm64/index.rst @@ -0,0 +1,13 @@ +.. _openeuler_embedded_arm64: + + +ARM64硬件 +################################ + +所支持的ARM64硬件如下: + +.. toctree:: + :maxdepth: 1 + :glob: + + */index diff --git a/docs/source/bsp/arm64/qemu_virt_cortex_a57/index.rst b/docs/source/bsp/arm64/qemu_virt_cortex_a57/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..3e05b98f5e4083f11fcca5bfbd31dcb3aff1fb79 --- /dev/null +++ b/docs/source/bsp/arm64/qemu_virt_cortex_a57/index.rst @@ -0,0 +1,16 @@ +.. _board_qemu_cortex_a57: + + +QEMU Virt Cortex-A57 +###################################### + +基本介绍 +================= + + +构建说明 +================== + + +使用说明 +================= diff --git a/docs/source/bsp/arm64/raspberrypi4/boot.png b/docs/source/bsp/arm64/raspberrypi4/boot.png new file mode 100644 index 0000000000000000000000000000000000000000..535d3e5eacb2c8792543d4b7b1c0ffa14ef34f5b Binary files /dev/null and b/docs/source/bsp/arm64/raspberrypi4/boot.png differ diff --git a/docs/source/bsp/arm64/raspberrypi4/boot_order1.png b/docs/source/bsp/arm64/raspberrypi4/boot_order1.png new file mode 100644 index 0000000000000000000000000000000000000000..21b6f0812147bac273ef5bec54b01225c6940e5a Binary files /dev/null and b/docs/source/bsp/arm64/raspberrypi4/boot_order1.png differ diff --git a/docs/source/bsp/arm64/raspberrypi4/boot_order2.png b/docs/source/bsp/arm64/raspberrypi4/boot_order2.png new file mode 100644 index 0000000000000000000000000000000000000000..87a58af6e7cb7c6de32ab575542c86724ebbbcbd Binary files /dev/null and b/docs/source/bsp/arm64/raspberrypi4/boot_order2.png differ diff --git a/docs/source/bsp/arm64/raspberrypi4/boot_order3.png b/docs/source/bsp/arm64/raspberrypi4/boot_order3.png new file mode 100644 index 0000000000000000000000000000000000000000..07b92808b831fc39034c81fff04e9af97e5d151b Binary files /dev/null and b/docs/source/bsp/arm64/raspberrypi4/boot_order3.png differ diff --git a/docs/source/bsp/arm64/raspberrypi4/boot_order4.png b/docs/source/bsp/arm64/raspberrypi4/boot_order4.png new file mode 100644 index 0000000000000000000000000000000000000000..5318ef666c0145c728250dfa8f350322faad51b0 Binary files /dev/null and b/docs/source/bsp/arm64/raspberrypi4/boot_order4.png differ diff --git a/docs/source/features/raspberrypi.rst b/docs/source/bsp/arm64/raspberrypi4/build.rst similarity index 69% rename from docs/source/features/raspberrypi.rst rename to docs/source/bsp/arm64/raspberrypi4/build.rst index dcf18cf38dd425f54b2d522d72d4c4a40f9c2c87..a6541baea60b058f041fc816fc51d19016840ed9 100644 --- a/docs/source/features/raspberrypi.rst +++ b/docs/source/bsp/arm64/raspberrypi4/build.rst @@ -1,40 +1,38 @@ -.. _raspberrypi: +.. _board_raspberrypi4_build: -树莓派4B的支持 +树莓派4B镜像构建与使用 ###################################### 本章主要介绍openEuler Embedded中树莓派4B的构建,使用和特性介绍。 树莓派镜像构建指导 *********************************** -**构建环境** +**构建指导** -1.构建环境推荐:openEuler-22.03 LTS -2.构建指导: `参考容器构建指导 `_ +- 参照 :ref:`openeuler_embedded_oebuild` 完成oebuild安装,并详细了解构建过程 -- 构建命令示例: +- 依次执行以下命令完成构建 -.. code-block:: console - - su openeuler - - source /usr1/openeuler/src/yocto-meta-openeuler/scripts/compile.sh raspberrypi4-64 /usr1/openeuler/src/build/build-raspberrypi4-64/ + .. code-block:: console - bitbake openeuler-image + # 生成raspberrypi4-64配置文件 + oebuild generate -p raspberrypi4-64 -- 构建镜像生成目录示例: - -.. code-block:: console + # 进入构建交互终端 + oebuild bitbake - /usr1/openeuler/src/build/build-raspberrypi4-64/output + # 构建镜像 + bitbake openeuler-image + # 构建sdk + bitbake openeuler-image -c do_populate_sdk - 二进制介绍: 1. Image: 树莓派内核镜像 - 2. openeuler-glibc-x86-64-openeuler-image-cortexa72-raspberrypi4-64-toolchain-22.03.30.sh: SDK工具链 + 2. openeuler-glibc-x86-64-openeuler-image-cortexa72-raspberrypi4-64-toolchain-\*.sh: SDK工具链 3. openeuler-image-raspberrypi4-64-\*.rootfs.rpi-sdimg: openEuler Embedded树莓派支持SD卡镜像 @@ -42,10 +40,24 @@ 1.镜像烧录: -参考: `树莓派SD卡烧录指导 `_ +- linux + +.. code-block:: console + + dd if=openeuler-image-raspberrypi4-64-*.rootfs.rpi-sdimg of=/dev/xxxx + +**if** : 指定编译好的树莓派镜像文件 + +**of** : 指定u盘被识别的设备文件, 注意是主设备名, 例如 /dev/sdb, 而不是分区的设备名, 例如 /dev/sdb1, /dev/sdb2 + +- windows + + 参考: `树莓派SD卡烧录指导 `_ 2.镜像使用 +1) 镜像烧录前查看/修改文件 + - 使用 losetup 将磁盘镜像文件虚拟成块设备 .. code-block:: console @@ -59,7 +71,7 @@ .. code-block:: console kpartx -va /dev/loop0 - + 得到结果是 /dev/loop0 的两个分区设备 .. code-block:: console @@ -95,6 +107,32 @@ 挂载完成后,可以查看boot分区和root分区下树莓派镜像的文件,其中boot分区为启动引导分区,包含了引导程序,内核镜像,设备树,config.txt和cmdline等配置文件,root分区为根文件系统分区。 +2) 镜像烧录后查看/修改文件 + +镜像烧录完成后, 此时插入的读卡器会被识别成两个分区设备, 例如/dev/sdb1, /dev/sdb2 + +- 分区挂载 + +创建挂载目录 + +.. code-block:: console + + mkdir ${WORKDIR}/boot ${WORKDIR}/root + +挂载boot分区 + +.. code-block:: console + + mount -t vfat -o uid=root,gid=root,umask=0000 /dev/sdb1 ${WORKDIR}/boot + +挂载root分区 + +.. code-block:: console + + mount -t ext4 /dev/sdb2 ${WORKDIR}/root + +有些情况下(linux系统配置), 分区设备/dev/sdb1, /dev/sdb2会自动挂载, 可以略过分区挂载步骤直接查看/修改文件. + 基于openEuler Embedded树莓派使用 ********************************************** @@ -116,32 +154,33 @@ a.使用串口登录: 示例:使用ttyusb转接器,将树莓派串口通过USB连接到putty: -.. image:: ../../image/raspberrypi/rasp-ttyusb-connect.png +.. image:: rasp-ttyusb-connect.png putty配置参考: Serial line:ttyUSB0 speed:115200 Connection type:Serial -.. image:: ../../image/raspberrypi/putty_config.png +.. image:: putty_config.png b.使用HDMI登录: 树莓派连接显示器(树莓派视频输出接口为 Micro HDMI)、键盘、鼠标后,启动树莓派,可以看到树莓派启动日志输出到显示器上。待树莓派启动成功,输入用户名(root)和密码登录。 -注意:当前镜像默认使能串口登录,如果需要通过HDMI,需要修改相关配置: +2.ssh 远程登录 -(1)修改boot分区下的cmdline文件内参数,添加 console=tty1 +网络配置: -(2)将root分区下的/etc/inittab文件内参数字段ttyS0修改为tty1 - +参考 :ref:`网络配置/openEuler Embedded网络配置` -2.ssh 远程登录 +使用ssh命令登录: + +.. code-block:: console -参考: `树莓派使用:启用树莓派:ssh 登录 `_ + ssh root@x.x.x.x **分区扩容** -以下内容引用: `树莓派使用:启用树莓派:分区扩容 `_ +默认根目录分区空间比较小,在使用之前,需要对分区进行扩容(在22.09及其之后的版本中,已实现自动扩容,首次烧录镜像启动会自动执行扩容并提示重启) -默认根目录分区空间比较小,在使用之前,需要对分区进行扩容。 +以下为手动扩容方法,内容引用: `树莓派使用:启用树莓派:分区扩容 `_ 1.查看磁盘分区信息 @@ -199,6 +238,7 @@ SD 卡对应盘符为 /dev/mmcblk0,包括 2 个分区,分别为 .. code-block:: console resize2fs /dev/mmcblk0p2 + #需重启生效 树莓派镜像特性介绍 ************************** diff --git a/docs/source/bsp/arm64/raspberrypi4/index.rst b/docs/source/bsp/arm64/raspberrypi4/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..22f6b62590209722e65153e7e5348967fbcb1295 --- /dev/null +++ b/docs/source/bsp/arm64/raspberrypi4/index.rst @@ -0,0 +1,12 @@ +.. _board_raspberrypi4b: + + +树莓派4B +################################# + + +.. toctree:: + :maxdepth: 1 + + build.rst + uefi.rst diff --git a/docs/source/bsp/arm64/raspberrypi4/launch_step1.png b/docs/source/bsp/arm64/raspberrypi4/launch_step1.png new file mode 100644 index 0000000000000000000000000000000000000000..4c7e4184d301846cf58e4fb7251ea09908f06016 Binary files /dev/null and b/docs/source/bsp/arm64/raspberrypi4/launch_step1.png differ diff --git a/docs/source/bsp/arm64/raspberrypi4/launch_step2.png b/docs/source/bsp/arm64/raspberrypi4/launch_step2.png new file mode 100644 index 0000000000000000000000000000000000000000..f22d0a3d21dc018b23eae2dc7a425df870c81cb6 Binary files /dev/null and b/docs/source/bsp/arm64/raspberrypi4/launch_step2.png differ diff --git a/docs/source/bsp/arm64/raspberrypi4/launch_step3.png b/docs/source/bsp/arm64/raspberrypi4/launch_step3.png new file mode 100644 index 0000000000000000000000000000000000000000..9056b74fea66bb1311d2e765d35489be8a931266 Binary files /dev/null and b/docs/source/bsp/arm64/raspberrypi4/launch_step3.png differ diff --git a/docs/source/bsp/arm64/raspberrypi4/launch_step4.png b/docs/source/bsp/arm64/raspberrypi4/launch_step4.png new file mode 100644 index 0000000000000000000000000000000000000000..6d496815e3e00f406ce7408e04baeb188c0dfccc Binary files /dev/null and b/docs/source/bsp/arm64/raspberrypi4/launch_step4.png differ diff --git a/docs/source/bsp/arm64/raspberrypi4/launch_step5.png b/docs/source/bsp/arm64/raspberrypi4/launch_step5.png new file mode 100644 index 0000000000000000000000000000000000000000..acf3de86080e6c504005eb8029ff775c49f17b1e Binary files /dev/null and b/docs/source/bsp/arm64/raspberrypi4/launch_step5.png differ diff --git a/docs/image/raspberrypi/putty_config.png b/docs/source/bsp/arm64/raspberrypi4/putty_config.png similarity index 100% rename from docs/image/raspberrypi/putty_config.png rename to docs/source/bsp/arm64/raspberrypi4/putty_config.png diff --git a/docs/image/raspberrypi/rasp-ttyusb-connect.png b/docs/source/bsp/arm64/raspberrypi4/rasp-ttyusb-connect.png similarity index 100% rename from docs/image/raspberrypi/rasp-ttyusb-connect.png rename to docs/source/bsp/arm64/raspberrypi4/rasp-ttyusb-connect.png diff --git a/docs/source/bsp/arm64/raspberrypi4/rasp_uefi.png b/docs/source/bsp/arm64/raspberrypi4/rasp_uefi.png new file mode 100644 index 0000000000000000000000000000000000000000..d526d39b301565035f46b07a6bc6e21a82a1ec5c Binary files /dev/null and b/docs/source/bsp/arm64/raspberrypi4/rasp_uefi.png differ diff --git a/docs/source/bsp/arm64/raspberrypi4/uefi.rst b/docs/source/bsp/arm64/raspberrypi4/uefi.rst new file mode 100644 index 0000000000000000000000000000000000000000..4f2307994d11d5a330ff26b506be5e1bd2dcc58b --- /dev/null +++ b/docs/source/bsp/arm64/raspberrypi4/uefi.rst @@ -0,0 +1,360 @@ +.. _board_raspberrypi4_uefi: + +树莓派的UEFI支持和网络启动 +########################## + +本文档介绍如何让树莓派4B支持UEFI(UEFI第三方固件支持PSCI标准实现,混合部署的从核启停依赖此功能),并可通过SD卡或网络启动 openEuler Embedded。 + +使用openEuler Embedded UEFI+GRUB的树莓派镜像 +******************************************** + + openEuler Embedded 的树莓派混合关键部署镜像(openeuler-image-mcs for RPI4)默认使能了UEFI+GRUB,并集成了基于树梅派4B的混合部署环境依赖。 + + 以下会基于mcs镜像介绍如何使用树莓派UEFI。 + +构建树梅派openeuler-image-mcs镜像和烧录 +======================================= + + 镜像构建参考 :ref:`mcs镜像构建指导 ` , + 镜像烧录参考 :ref:`树莓派镜像镜像烧录 ` + +.. _raspberrypi4-uefi-guide: + +openeuler-image-mcs启动使用指导 +=============================== + +1. **烧录后首次启动需修改UEFI配置,启动阶段按ESC进入UEFI,按下图操作解锁3G内存限制并关闭ACPI选用DEVICETREE,保存重启后再操作步骤2** + + .. figure:: launch_step1.png + :align: center + + .. figure:: launch_step2.png + :align: center + + .. figure:: launch_step3.png + :align: center + + .. figure:: launch_step4.png + :align: center + + .. figure:: launch_step5.png + :align: center + +2. **更改boot order或手动选择SD卡启动,如下,最后选择Commit Changes and Exit** + + .. figure:: boot_order1.png + :align: center + + .. figure:: boot_order2.png + :align: center + + .. figure:: boot_order3.png + :align: center + + .. figure:: boot_order4.png + :align: center + + **启动截图** + + .. figure:: boot.png + :align: center + + .. attention:: + + * 此UEFI版本的固件默认使用3G内存limit,可以在UEFI菜单中关闭3G limit,否则系统启动后你看到的内存只有3G【`官方说明 `_ 】 + + * 该版本UEFI+ACPI部署方法有缺陷(HDMI驱动异常),首次使用必须进入UEFI菜单,使用DEVICETREE模式 + +____ + +手动刷新固件使树莓派4B支持UEFI引导 +********************************** + +环境/工具准备 +============= + +编译工具链:可用openEuler Embedded的交叉编译工具链,参考 :ref:`基于SDK的应用开发 ` 部分。 + +设备:建议树莓派4B的出厂配置,包括树莓派4B基础套件和SD卡 + +openEuler Embedded标准镜像 + UEFI固件下载和刷新方法 +=================================================== + +1. **将openEuler Embedded树莓派镜像烧录到SD卡** + + 参考: `openEuler烧录参考 `_ + + - 如何获得openEuler Embedded树莓派镜像,参照 :ref:`关键特性/树莓派4B的支持/树莓派镜像构建指导 ` 部分 + + .. code-block:: console + + # 假设镜像名 openeuler-image-raspberrypi4-64.rootfs.rpi-sdimg, SD卡识别为/dev/sda (linux环境) + sudo dd bs=4M if=openeuler-image-raspberrypi4-64.rootfs.rpi-sdimg of=/dev/sda + + - 烧录完成后,将SD卡(boot盘)根目录的kernel8.img文件压缩成Image.gz: + + .. code-block:: console + + # boot分区可能已经满了,移出kernel8.img再操作 + mv SDbootVolumes/kernel8.img /tmp/Image + gzip -c /tmp/Image > SDbootVolumes/Image.gz + +2. **下载树莓派UEFI固件** + + 固件: `树莓派UEFI固件(v1.33版本为例) `_ + + 下载上述固件后解压,将除了bcm2711-rpi-4-b.dtb之外的所有文件拷贝到SD卡(boot盘)根目录(覆盖之前的文件): + + .. code-block:: console + + # 备份bcm2711-rpi-4-b.dtb + cp SDbootVolumes/bcm2711-rpi-4-b.dtb /bakdir/bcm2711-rpi-4-b.dtb + cp -rf /xxx/RPi4_UEFI_Firmware_v1.33/* SDbootVolumes/ + # 恢复使用备份的openEuler Embedded的dtb + cp /bakdir/bcm2711-rpi-4-b.dtb SDbootVolumes/ + + .. attention:: + + * 3G内存解锁和关闭ACPI使能DEVICETREE请参考上述"openeuler-image-uefi启动使用指导"章节 + + * kernel8.img不再需要,清务必删除,否则将影响启动。 + +3. **制作grub并选择启动方式** + + - SD卡启动参考本文档章节: 树莓派UEFI之手动制作grub并通过SD卡启动openEuler Embedded + + - 网络卡启动参考本文档章节: 树莓派UEFI之手动制作grub并通过网络启动openEuler Embedded + +____ + +树莓派UEFI之手动制作grub并通过SD卡启动openEuler Embedded +******************************************************** + +grub准备(编译+制作grub启动组件) +================================= + +**grub源码获取** + + 下载地址:https://github.com/coreos/grub/releases/tag/grub-2.02 + +**grub组件编译** + + 解压源码包并进入根目录,准备开始构建arm64-efi(交叉编译)的grub库,注意此时交叉编译工具已经配置完毕,按如下步骤执行: + + .. code-block:: console + + ./autogen.sh + ./configure --prefix=/xxx/grub-2.02/build --with-platform=efi --disable-werror --target=aarch64-openeuler-linux-gnu + make + + 构建成功后,在当前目录会生成对应的二进制和grub组件依赖库,其中,grub-core即制作grub-efi需要的工具库,grub-mkimage即制作板子grub.efi引导的host-tool。 + +**制作引导程序** + + 接下来制作板子引导grub程序,下例输出名为bootaa64.efi,生成后请放置到SD卡boot分区的对应目录(/EFI/BOOT/bootaa64.efi): + + .. code-block:: console + + ./grub-mkimage -d ./grub-core -O arm64-efi -o bootaa64.efi -p '' ls grub-core/*.mod | cut -d "." -f 1 + mkdir -p SDbootVolumes/EFI/BOOT + cp ./bootaa64.efi SDbootVolumes/EFI/BOOT/ + + .. note:: + + xxxxx目录中请不要带“.”,否则请适配上述语法。 + +**制作引导配置文件** + + 最后,编辑grub.cfg配置文件,grub.cfg配置文件同bootaa64.efi放在一起(/EFI/BOOT/grub.cfg),就绪后在UEFI菜单中选择SD卡启动即可。grub.cfg示例内容如下(后面是cmdline内容,linux gz压缩的内核,使用sd卡分区,不需要initrd): + + .. code-block:: console + + insmod gzio + set timeout=0 + + menuentry 'Start OpenEuler' { + echo "openEuler test." + linux /Image.gz coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 smsc95xx.macaddr=E4:5F:01:38:E2:E2 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait + } + + .. note:: + + 上述内容需配合oepnEuler embedded构建的树莓派镜像,并在UEFI 非ACPI(DEVICETREE)下使用,dtb使用openEuler embedded镜像中的内容。其中Image.gz即内核Image的gizp压缩,可通过gzip -c kernel8.img > Image.gz获得(若使用openEuler embedded镜像),kernel8.img不再需要,清务必删除,否则将影响启动。 + +____ + +树莓派UEFI之手动制作grub并通过网络启动openEuler Embedded +******************************************************** + +1. **准备PXE部署服务器** + + 以ubunutu 14.04为例,dhcp中指定的filename就是grup的efi引导文件名 + + 假设服务器网段为192.168.10.x,服务器ip为192.168.10.1,网卡eth0用于dhcp服务,初始化服务器ip例: + + .. code-block:: console + + sudo ifconfig eth0 192.168.10.1 up + +2. **使能DHCP服务** + + 安装DHCP软件: + + .. code-block:: console + + sudo apt-get install isc-dhcp-server + + 编辑/etc/dhcp/dhcpd.conf文件,内容示例: + + .. code-block:: console + + allow booting; + allow bootp; + option domain-name "example.org"; + default-lease-time 600; + max-lease-time 7200; + ddns-update-style none; + + subnet 192.168.10.0 netmask 255.255.255.0 { + range 192.168.10.100 192.168.10.200; + filename "mygrub.efi"; #默认下载的grub文件名,和3中制作的efi引导程序名字需匹配 + option routers 192.168.10.1; + next-server 192.168.10.1; #tftp服务器IP,PXE必须,HTTPBOOT可选 + option broadcast-address 192.168.10.255; + } + + 配置DHCP服务网络接口,编辑文件/etc/default/isc-dhcp-server 增加/修改字段: + + .. code-block:: console + + INTERFACES=”eth0” #dhcp使用的网卡 + + 启动DHCP服务: + + .. code-block:: console + + sudo /etc/init.d/isc-dhcp-server restart + +3. **使能TFTP服务** + + 安装TFTP服务器软件: + + .. code-block:: console + + sudo apt-get install tftpd-hpa + + 配置TFTP服务,编辑/etc/default/tftpd-hpa 文件,示例内容如下: + + .. code-block:: console + + TFTP_USERNAME="tftp" + TFTP_ADDRESS=":69" + TFTP_DIRECTORY="/var/lib/tftpboot/" + TFTP_OPTIONS="--secure -l -c -s" + + 启动TFTP服务: + + .. code-block:: console + + sudo /etc/init.d/tftpd-hpa restart + +4. **grub准备(编译+制作grub启动组件)** + + **grub源码获取** + + 下载地址:https://github.com/coreos/grub/releases/tag/grub-2.02 + + **grub组件编译** + + 解压源码包并进入根目录,准备开始构建arm64-efi(交叉编译)的grub库,注意此时交叉编译工具已经配置完毕,按如下步骤执行: + + .. code-block:: console + + ./autogen.sh + ./configure --prefix=/xxx/grub-2.02/build --with-platform=efi --disable-werror --target=aarch64-openeuler-linux-gnu + make + + 构建成功后,在当前目录会生成对应的二进制和grub组件依赖库,其中,grub-core即制作grub-efi需要的工具库,grub-mkimage即制作板子grub.efi引导的host-tool。 + + **制作引导程序** + + 接下来制作板子引导grub程序,下例输出名为mygrub.efi: + + .. code-block:: console + + ./grub-mkimage -d ./grub-core -O arm64-efi -o mygrub.efi -p '' ls grub-core/*.mod | cut -d "." -f 1 + + .. note:: + + xxxxx目录中请不要带“.”,否则请适配上述语法。 + + **制作引导配置文件** + + 最后,编辑grub.cfg配置文件,grub.cfg配置文件放在tftp的根目录(/var/lib/tftpboot/grub.cfg),就绪后在UEFI菜单中选择IPV4网络启动即可,grub.cfg示例内容如下(Image.gz后面是cmdline内容,linux gz压缩的内核,initrd文件系统): + + .. code-block:: console + + insmod gzio + set timeout=0 + + menuentry 'Start OpenEuler' { + echo "openEuler test." + linux /Image.gz coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 smsc95xx.macaddr=E4:5F:01:38:E2:E2 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 console=ttyAMA0,115200 + initrd /initrd.cpio.gz + } + +____ + +附:网络启动时,内核Image.gz和文件系统initrd的来源说明 +====================================================== + +**文件系统例子** + + 若使用网络启动,可使用openEuler Embedded构建的标准树梅派镜像构建过程中的rootfs并手动打包,也可使用openEuler Embedded发布的qemu-aarch64参考 `文件系统 `_ + + 手动打包rootfs例子(预先需准备openEuler Embedded树梅派已构建完成的环境): + + .. code-block:: console + + # 假设已经处于构建build目录 + cd tmp/work/raspberrypi4_64-openeuler-linux/openeuler-image/1.0-r0/rootfs/ + find . | cpio -H newc -o | gzip -n9c > ../initrd.cpio.gz + # 生成在上层目录的initrd.cpio.gz即为所需文件系统 + + .. note:: + + 配置文件系统/etc/inittab时注意getty登录时串口重定向要配置正确,否则可能没有打印。(树莓派4B硬件串口PL011对应,引脚14TXD和15RXD) + +**内核例子** + + 若使用网络启动,可使用openEuler Embedded构建的标准树梅派镜像中的kernel8.img,格式即Image,然后通过gzip压缩为Image.gz格式 + +**内核单独编译例子(openEuler)** + + 参考: `openEuler树莓派交叉编译内核 `_ + + .. attention:: + + * 若使用上述UEFI+ACPI部署方法,必须在config中开启ACPI系列功能支持。在make menuconfig ARCH=arm64菜单中,选中ACPI默认系列支持。建议在UEFI中关闭ACPI选用DEVICETREE(参考openeuler-image-uefi启动使用指导相关配置) + + * 编译生成的Image,在上述efi配置下,grub.cfg的linux格式需使用gz命令压缩成Image.gz + +**操作说明** + + 将上述内核和文件系统,放在tftp服务目录下(/var/lib/tftpboot)即可进行网络启动。 + + 网络启动基本流程如下: + + a. DHCP服务器给单板分配IP + + b. 单板启动UEFI选择PXE启动 + + c. PXE根据DHCP的filename和tftp服务器地址,从tftp服务器下载mygrub.efi + + d. 进入grub引导程序,根据grub.cfg配置,从对应tftp目录下载文件系统和内核并加载启动 + + 其中,使用的ACPI资源表/DTB是UEFI固件初始化好的(引导内核前已放在对应内存),不过cmdline/bootargs可通过grub.cfg进行配置,在加载内核时,grub会传递给UEFI并上报给系统。 + + .. figure:: rasp_uefi.png + :align: center + diff --git a/docs/source/bsp/arm64/rk3568/RKDevTool1.png b/docs/source/bsp/arm64/rk3568/RKDevTool1.png new file mode 100644 index 0000000000000000000000000000000000000000..6e2058c568e35032432398006a17214cc5a9f772 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/RKDevTool1.png differ diff --git a/docs/source/bsp/arm64/rk3568/add_partition.png b/docs/source/bsp/arm64/rk3568/add_partition.png new file mode 100644 index 0000000000000000000000000000000000000000..755ab8d8186548bbd612175cbd77dd70e0f029d9 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/add_partition.png differ diff --git a/docs/source/bsp/arm64/rk3568/choose_partition.png b/docs/source/bsp/arm64/rk3568/choose_partition.png new file mode 100644 index 0000000000000000000000000000000000000000..ae595ce8d741aaf33dc5aa73c5c21f626d6d2cdd Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/choose_partition.png differ diff --git a/docs/source/bsp/arm64/rk3568/compare_rootfs_address.png b/docs/source/bsp/arm64/rk3568/compare_rootfs_address.png new file mode 100644 index 0000000000000000000000000000000000000000..5d7d2957e3ea41cc3909cdb5f055fc3f5c724b23 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/compare_rootfs_address.png differ diff --git a/docs/source/bsp/arm64/rk3568/console1.png b/docs/source/bsp/arm64/rk3568/console1.png new file mode 100644 index 0000000000000000000000000000000000000000..5d6f118d4d50744f8bc4741113a2883038307f99 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/console1.png differ diff --git a/docs/source/bsp/arm64/rk3568/console2.png b/docs/source/bsp/arm64/rk3568/console2.png new file mode 100644 index 0000000000000000000000000000000000000000..1a43b9cf8882351d0b6d65bc4d301f8f2f252138 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/console2.png differ diff --git a/docs/source/bsp/arm64/rk3568/console_link.png b/docs/source/bsp/arm64/rk3568/console_link.png new file mode 100644 index 0000000000000000000000000000000000000000..25e2197d8c2b487453308011128dbf523815ae22 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/console_link.png differ diff --git a/docs/source/bsp/arm64/rk3568/device_parted_scan.png b/docs/source/bsp/arm64/rk3568/device_parted_scan.png new file mode 100644 index 0000000000000000000000000000000000000000..cedbfe21c1190c807038a740a2ad41883f376428 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/device_parted_scan.png differ diff --git a/docs/source/bsp/arm64/rk3568/ifconfig.png b/docs/source/bsp/arm64/rk3568/ifconfig.png new file mode 100644 index 0000000000000000000000000000000000000000..b71c1f9279301e9dc745e193c3b10c7d9998d260 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/ifconfig.png differ diff --git a/docs/source/bsp/arm64/rk3568/index.rst b/docs/source/bsp/arm64/rk3568/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..753e10f780c8e335a0e3f14a737cf3b68bde2f6d --- /dev/null +++ b/docs/source/bsp/arm64/rk3568/index.rst @@ -0,0 +1,11 @@ +.. _board_rk3568: + + +RK3568 +################################# + + +.. toctree:: + :maxdepth: 1 + + rk3568.rst diff --git a/docs/source/bsp/arm64/rk3568/install_driver1.png b/docs/source/bsp/arm64/rk3568/install_driver1.png new file mode 100644 index 0000000000000000000000000000000000000000..206a58067839593f323a498d6d69d90698a91874 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/install_driver1.png differ diff --git a/docs/source/bsp/arm64/rk3568/install_driver2.png b/docs/source/bsp/arm64/rk3568/install_driver2.png new file mode 100644 index 0000000000000000000000000000000000000000..dc37f038234d87addf2abd279fef5bada0415c30 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/install_driver2.png differ diff --git a/docs/source/bsp/arm64/rk3568/install_driver3.png b/docs/source/bsp/arm64/rk3568/install_driver3.png new file mode 100644 index 0000000000000000000000000000000000000000..8297c1980835fa9822f70e8a93d3da61816b039b Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/install_driver3.png differ diff --git a/docs/source/bsp/arm64/rk3568/rk3568.rst b/docs/source/bsp/arm64/rk3568/rk3568.rst new file mode 100644 index 0000000000000000000000000000000000000000..483ca5784537b0a7a34f1cf7ff8d22076c91cef6 --- /dev/null +++ b/docs/source/bsp/arm64/rk3568/rk3568.rst @@ -0,0 +1,231 @@ +.. _board_rk3568_build: + +======================================== +RK3568板卡镜像构建与使用 +======================================== + +本章主要介绍openEuler Embedded中RK3568系列板卡的构建,使用和特性介绍。 + +RK3568镜像构建指导 +===================== + +- 参照 :ref:`openeuler_embedded_oebuild` 完成oebuild安装,并详细了解构建过程 + +- 依次执行以下命令完成构建 + + .. code-block:: console + + # 生成ok3568配置文件 + oebuild generate -p ok3568 -d ok3568 + + # 或生成ryd-3568配置文件 + oebuild generate -p ryd-3568 -d ryd-3568 + + # 进入构建交互终端 + oebuild bitbake + + # 构建镜像 + bitbake openeuler-image + + # 构建sdk + bitbake openeuler-image -c populate_sdk + +- 二进制介绍: + + 1. Image: rk3568内核镜像 + + 2. openeuler-glibc-x86_64-openeuler-image-aarch64-ok3568-toolchain-23.03\*.sh: SDK工具链 + + 3. boot.img: openEuler Embedded 适用rk3568内核镜像 + + 4. openeuler-image-ok3568-\*.rootfs.ext4: 适用rk3568根文件系统 + +镜像使用方法 +===================== + +1. 烧写前镜像使用 + + 创建挂载目录 + + .. code-block:: console + + mkdir ${WORKDIR}/rootfs + + 挂载rootfs + + .. code-block:: console + + mount -t ext4 openeuler-image-ok3568-\*.rootfs.ext4 ${WORKDIR}/rootfs + + 挂载完成后,可以查看ok3568根文件系统的文件或者自行添加内容。 + +2. 镜像烧录仅支持windows: + + 将文件DriverAssitant_v5.11.zip解压到任意目录,以管理员权限运行打开DriverInstall.exe 程序,然后点击“驱动安装”进行安装。 + + .. figure:: install_driver1.png + :align: center + + .. figure:: install_driver2.png + :align: center + + .. figure:: install_driver3.png + :align: center + +内核镜像和文件系统烧写方法 +=========================== + +1. 将瑞芯微开发工具RKDevTool_Release.zip解压到全英文路径下,打开瑞芯微开发工具RKDevTool,使用Type-C线连接开发板和主机,按住开发板的Recovery键不要松开,然后按下RESET键系统复位,大约两秒后松开Recovery键,瑞芯微开发工具RKDevTool将提示发现LOADER设备。 + + .. figure:: switch_turn_to_off.png + :align: center + + .. figure:: RKDevTool1.png + :align: center + +2. 点击“设备分区表”按钮,将自动读取分区地址。会有某些分区读不到的提示,点击确定即可。 + + .. figure:: device_parted_scan.png + :align: center + +3. 在地址栏右键选择添加项,添加文件系统的地址。 + + .. figure:: add_partition.png + :align: center + + .. figure:: compare_rootfs_address.png + :align: center + +4. 勾选Boot和rootfs,并选择Boot和rootfs的路径。 + + .. figure:: choose_partition.png + :align: center + +5. 点击“执行”按钮将自动烧写内核和文件系统,并重新启动。 + + .. figure:: start_burning.png + :align: center + +基于openEuler Embedded ok3568使用 +=================================== + +启用ok3568 +-------------------- + +硬件版本要求:飞凌ok3568 + +默认用户名:root,密码:第一次启动没有默认密码,需重新配置,且密码强度有相应要求, 需要数字、字母、特殊字符组合最少8位,例如openEuler@2021。 + +将刷写镜像后的ok3568核心板通电启用。 + +ok3568登录方式 +-------------------- + +本地登录 +^^^^^^^^^^^ + +- 使用串口登录: + + 镜像使能了串口登录功能,按照ok3568的串口连接方式,如下图,可以启用串口操作。 + + 示例:使用ttyusb转接器,将ok3568的串口通过USB连接到putty: + +.. figure:: console_link.png + :align: center + +- 使用HDMI登录: + + ok3568连接显示器(ok3568视频输出接口为HDMI)、键盘、鼠标后,启动ok3568,可以看到ok3568启动日志输出到显示器上。待ok3568启动成功,输入用户名(root)和密码登录。 + +ssh 远程登录 +^^^^^^^^^^^^^^^^^ + +网络配置 +"""""""""""""""""""" + +启动后无线网卡配置 +***************************** + +1. 使用终端连接工具通过串口连接开发板 + +.. figure:: console1.png + :align: center + +.. figure:: console2.png + :align: center + +2. 使用wpa_passphrase工具将wifi密码加密,生成配置 + +执行命令: + +.. code-block:: console + + wpa_passphrase wifi_name password + +.. figure:: wpa_passphrase.png + :align: center + +3. 将生成的配置写入配置文件/etc/wpa_supplicant.conf: + +执行命令: + +.. code-block:: console + + vi /etc/wpa_supplicant.conf + +.. figure:: wpa_supplicant.png + :align: center + +启用无线网卡 +******************** + +1. 执行命令: + +.. code-block:: console + + ifup mlan0 + +2. 启用wifi网卡后,会自动生成IP,可直接查看网卡信息。 + + 执行命令:ifconfig + + .. figure:: ifconfig.png + :align: center + + 使用ssh命令登录: + + .. code-block:: console + + ssh root@x.x.x.x + +分区扩容 +"""""""""""""""""""" + + 默认根目录分区空间比较小,在使用之前,需要对分区进行扩容(在23.03及其之后的版本中,已实现自动扩容,首次烧录镜像启动会自动执行扩容并提示重启) + + 执行 fdisk -l 命令查看磁盘分区信息。回显如下: + +.. code-block:: console + + Number Start (sector) End (sector) Size Name + 1 16384 24575 4096K uboot + 2 24576 32767 4096K misc + 3 32768 98303 32.0M boot + 4 98304 163839 32.0M recovery + 5 163840 229375 32.0M backup + 6 229376 12812287 6144M rootfs + 7 12812288 13074431 128M oem + 8 13074432 30777279 8643M userdata + + 对应数据分区为 rootfs,与userdata + +ok3568镜像特性介绍 +========================== + + 1. ok3568硬件特性,参考: `RK3568 TRM手册 `_ + + 目前已使能串口设备,可以访问uart,其他硬件特性目前支持:无线网卡、GPU、TF卡、以太网卡、USB Host、SPI、HDMI。 + + 2. 支持百级嵌入式软件包,见软件包功能列表。 + + 3. 支持部署rt实时内核。 diff --git a/docs/source/bsp/arm64/rk3568/start_burning.png b/docs/source/bsp/arm64/rk3568/start_burning.png new file mode 100644 index 0000000000000000000000000000000000000000..1182c137180904d11600b6eb7fda3fe761db91b5 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/start_burning.png differ diff --git a/docs/source/bsp/arm64/rk3568/switch_turn_to_off.png b/docs/source/bsp/arm64/rk3568/switch_turn_to_off.png new file mode 100644 index 0000000000000000000000000000000000000000..265319f2d8d60aa5a1f619f3bb8921c4f72bb52f Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/switch_turn_to_off.png differ diff --git a/docs/source/bsp/arm64/rk3568/wpa_passphrase.png b/docs/source/bsp/arm64/rk3568/wpa_passphrase.png new file mode 100644 index 0000000000000000000000000000000000000000..11de945145abc6da4a913358d3adb6a81c191880 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/wpa_passphrase.png differ diff --git a/docs/source/bsp/arm64/rk3568/wpa_supplicant.png b/docs/source/bsp/arm64/rk3568/wpa_supplicant.png new file mode 100644 index 0000000000000000000000000000000000000000..759f2b7bda1928d24e0301a203a57f7fb35237f0 Binary files /dev/null and b/docs/source/bsp/arm64/rk3568/wpa_supplicant.png differ diff --git a/docs/source/bsp/index.rst b/docs/source/bsp/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..4959ed93a2e51c448018d2f15fbd658ec2e9ee51 --- /dev/null +++ b/docs/source/bsp/index.rst @@ -0,0 +1,19 @@ +.. _bsp: + +南向支持 +################################ + +本章介绍openEuler Embedded的南向支持,包括如果新增新的BSP、所支持的硬件列表等等。 + +.. toctree:: + :maxdepth: 1 + :caption: 南向开发注意事项 + + add_new_bsp_layer.rst + +.. toctree:: + :maxdepth: 1 + :glob: + :caption: 所支持的硬件 + + */index diff --git a/docs/source/bsp/riscv/index.rst b/docs/source/bsp/riscv/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..cf2bdb22785b8a57f3747c9a125519cc3e7083d3 --- /dev/null +++ b/docs/source/bsp/riscv/index.rst @@ -0,0 +1,13 @@ +.. _openeuler_embedded_riscv: + + +RISC-V硬件 +################################ + +所支持的RISC-V硬件如下: + +.. toctree:: + :maxdepth: 1 + :glob: + + */index \ No newline at end of file diff --git a/docs/source/bsp/x86/HVAEIPC-M10/images/grub-option.png b/docs/source/bsp/x86/HVAEIPC-M10/images/grub-option.png new file mode 100644 index 0000000000000000000000000000000000000000..6221e67330bcd818ed47cc9e3399c9c8695182f5 Binary files /dev/null and b/docs/source/bsp/x86/HVAEIPC-M10/images/grub-option.png differ diff --git a/docs/source/bsp/x86/HVAEIPC-M10/images/install-step1.png b/docs/source/bsp/x86/HVAEIPC-M10/images/install-step1.png new file mode 100644 index 0000000000000000000000000000000000000000..735023a9b6bee074a99ea21c7fa63b02c00e2004 Binary files /dev/null and b/docs/source/bsp/x86/HVAEIPC-M10/images/install-step1.png differ diff --git a/docs/source/bsp/x86/HVAEIPC-M10/images/install-step3.jpg b/docs/source/bsp/x86/HVAEIPC-M10/images/install-step3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..903adb8ced7b513c50a8e42ac86058b197d82fcf Binary files /dev/null and b/docs/source/bsp/x86/HVAEIPC-M10/images/install-step3.jpg differ diff --git a/docs/source/bsp/x86/HVAEIPC-M10/images/install-step4.png b/docs/source/bsp/x86/HVAEIPC-M10/images/install-step4.png new file mode 100644 index 0000000000000000000000000000000000000000..06025a133229ced3bb436bd6196ee6d8b77bbb62 Binary files /dev/null and b/docs/source/bsp/x86/HVAEIPC-M10/images/install-step4.png differ diff --git a/docs/source/bsp/x86/HVAEIPC-M10/images/m10_configuration.png b/docs/source/bsp/x86/HVAEIPC-M10/images/m10_configuration.png new file mode 100644 index 0000000000000000000000000000000000000000..d560bccfcc8cfc5e59e1e7ba41ff1d004dc5cbc5 Binary files /dev/null and b/docs/source/bsp/x86/HVAEIPC-M10/images/m10_configuration.png differ diff --git a/docs/source/bsp/x86/HVAEIPC-M10/m10.rst b/docs/source/bsp/x86/HVAEIPC-M10/m10.rst new file mode 100644 index 0000000000000000000000000000000000000000..8926ee60b72efd890af87cc77f0f10cb8de590c0 --- /dev/null +++ b/docs/source/bsp/x86/HVAEIPC-M10/m10.rst @@ -0,0 +1,82 @@ +工控机HVAEIPC-M10 +################# + +基本介绍 +======== + +HVAEPIC-M10是一台通过国家3C认证的无风扇工控机,采用Intel i7-10510U处理器,详细参数配置如下: + +.. image:: images/m10_configuration.png + :width: 450px + +目前openEuler Embedded已经支持M10工控机的镜像构建、安装及运行。 + +____ + +构建说明 +======== + +.. seealso:: + + 参考 :ref:`openEuler Embedded x86-64镜像构建 `. + +____ + +安装说明 +======== + +.. warning:: + 进行openEuler Embedded镜像安装,会擦除安装磁盘中原有的数据。 + +1. 使用构建出来的iso镜像制作U盘启动盘,例如使用Rufus制作: + + .. image:: images/install-step1.png + :scale: 50 + +2. 在工控机上插入U盘,启动后按 ``Del`` 进入BIOS,并在 ``BOOT`` 选项卡中调整 ``Boot Option #1`` 为U盘启动。保存重启后,进入grub界面: + + .. image:: images/grub-option.png + + 选择 ``boot`` 可以进入live os,一般用于debug;选择 ``install`` 进入系统安装流程。 + +3. 选择 ``install`` 后,进行系统安装,依次输入U盘和安装盘: + + .. image:: images/install-step3.jpg + + 之后稍作等待,完成系统安装后,会提示: ``Installation successful. Remove your installation media and press ENTER to reboot.`` 此时可以拔出U盘,按enter重启。 + +4. 启动后按 ``Del`` 进入BIOS,调整 ``Boot Option #1`` : + + .. image:: images/install-step4.png + +____ + +实时性能测试 +============ + +实时性优化请参考 :ref:`软实时性能优化 ` 章节,进行优化后,实时性能有大幅提升,以下为相关测试对比数据: + +.. list-table:: + :widths: 30 15 10 10 + :header-rows: 1 + + * - OS + - Real-Time + - Min(us) + - Max(us) + * - openEuler-Embedded (PREEMPT-RT) + - Y + - 2 + - 12 + * - openEuler-Embedded (PREEMPT) + - N + - 2 + - 55 + +.. note:: + | **环境**:M10工控机 + | **CPU-Info**: Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz + | **操作系统版本**:openEuler-Embedded 23.03 + | **测试命令**: ``cyclictest -p 90 -m -i 1000 -n -h 1000 -l 5000000 -a --histfile=test.log`` + | + | 由于M10工控机的HDMI驱动对实时性影响较大,因此需要拔出HDMI,通过ssh登录进行测试。 diff --git a/docs/source/bsp/x86/appendix/build.rst b/docs/source/bsp/x86/appendix/build.rst new file mode 100644 index 0000000000000000000000000000000000000000..1b87cbaac2cc07a9235707f48a97b3b0911d3930 --- /dev/null +++ b/docs/source/bsp/x86/appendix/build.rst @@ -0,0 +1,51 @@ +.. _board_x86_build: + +openEuler Embedded x86-64镜像构建 +################################# + +本章主要介绍openEuler Embedded中x86-64镜像的构建、安装及启动方法。 + +1. 根据 :ref:`oebuild快速构建 ` ,初始化oebuild工作目录; + + .. code-block:: shell + + oebuild init + cd + oebuild update + +2. 进入oebuild工作目录,创建x86-64的编译配置文件: + + .. code-block:: shell + + oebuild generate -p x86-64-std -d + + .. note:: + + | x86-64的软实时镜像通过以下命令进行编译配置: + | ``oebuild generate -p x86-64-std -f openeuler-rt -d `` + | 更多用法请参考oebuild章节。 + +3. 进入 ```` 目录,编译openeuler-image: + + .. code-block:: shell + + # 构建镜像 + oebuild bitbake openeuler-image + + # 构建SDK + oebuild bitbake openeuler-image -c do_populate_sdk + +____ + +- 构建完成后,在 ``/output`` 目录下可以看到镜像,如: + + .. code-block:: shell + + $ tree + . + └── 20230315093436 + ├── bzImage -> bzImage-5.10.0 + ├── bzImage-5.10.0 + ├── openeuler-image-generic-x86-64-20230315093436.iso + ├── openeuler-image-generic-x86-64-20230315093436.rootfs.cpio.gz + └── vmlinux-5.10.0 diff --git a/docs/source/bsp/x86/appendix/index.rst b/docs/source/bsp/x86/appendix/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..cd658c5fabf9accaebe24e402ddfd62ba63e7d8a --- /dev/null +++ b/docs/source/bsp/x86/appendix/index.rst @@ -0,0 +1,8 @@ +附录 +##### + +.. toctree:: + :maxdepth: 1 + :glob: + + build.rst diff --git a/docs/source/bsp/x86/index.rst b/docs/source/bsp/x86/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..4b24e403d4b58ea3b55eec089b5a97a522c092c2 --- /dev/null +++ b/docs/source/bsp/x86/index.rst @@ -0,0 +1,15 @@ +.. _openeuler_embedded_x86: + + +x86硬件 +################################ + +所支持的x86硬件如下: + +.. toctree:: + :maxdepth: 1 + :glob: + + HVAEIPC-M10/m10.rst + qemu/qemu.rst + appendix/index.rst diff --git a/docs/source/bsp/x86/qemu/qemu-install.png b/docs/source/bsp/x86/qemu/qemu-install.png new file mode 100644 index 0000000000000000000000000000000000000000..eb4ef14845dfb15807d39ce263d7b981b9220bfe Binary files /dev/null and b/docs/source/bsp/x86/qemu/qemu-install.png differ diff --git a/docs/source/bsp/x86/qemu/qemu.rst b/docs/source/bsp/x86/qemu/qemu.rst new file mode 100644 index 0000000000000000000000000000000000000000..b33935611e117b0661cb0b99aa790c7e42165c14 --- /dev/null +++ b/docs/source/bsp/x86/qemu/qemu.rst @@ -0,0 +1,75 @@ +QEMU-X86-64 +########### + +基本介绍 +======== + +目前openEuler Embedded支持使用QEMU启动x86镜像,方便开发人员体验openEuler Embedded的功能,也可以快速进行基本的嵌入式Linux开发。 + +____ + +构建说明 +======== + +.. seealso:: + + 参考 :ref:`openEuler Embedded x86-64镜像构建 `. + +____ + +运行说明 +======== + +构建完成后,在 ``/output`` 目录下可以看到镜像,如: + + .. code-block:: shell + + $ tree + . + └── 20230315093436 + ├── bzImage -> bzImage-5.10.0 + ├── bzImage-5.10.0 + ├── openeuler-image-generic-x86-64-20230315093436.iso + ├── openeuler-image-generic-x86-64-20230315093436.rootfs.cpio.gz + └── vmlinux-5.10.0 + +可以使用以下命令启动openEuler-Embedded: + + .. code-block:: shell + + sudo qemu-system-x86_64 -m 1G -nographic -append 'console=ttyS0' –kernel bzImage –initrd *.rootfs.cpio.gz + +____ + +安装说明 +======== + +QEMU支持X86的iso镜像安装,步骤如下: + +1. 创建一个用于挂载的磁盘: + + .. code-block:: shell + + qemu-img create disk.img 8G + +2. 下载 `OVMF.fd `_; + +3. 使用以下命令启动QEMU: + + .. code-block:: shell + + sudo qemu-system-x86_64 -m 1G -nographic -cdrom openeuler-image-*.iso -bios OVMF.fd -hda disk.img + + 进入gurb界面后,选择 ``boot`` 可以进入live os,一般用于debug;选择 ``install`` 进入系统安装流程。 + +4. 选择 ``install`` 后,进行系统安装,依次输入cdrom和安装盘: + + .. image:: qemu-install.png + + 之后稍作等待,完成系统安装后,会提示: ``Installation successful. Remove your installation media and press ENTER to reboot.`` 此时可以直接按 `` + x`` 关闭QEMU。 + +5. 之后都可以通过disk.img启动openEuler-Embedded: + + .. code-block:: shell + + sudo qemu-system-x86_64 -m 1G -nographic -bios OVMF.fd -hda disk.img diff --git a/docs/source/conf.py b/docs/source/conf.py index ee7a5a59cf90ac4850a1a388e2b2e6e7159b4ee4..73168fa13ce4cb2eea07783c039e0a0a93ad6e77 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -30,11 +30,19 @@ release = '1.0.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [ -] +extensions = ['sphinx_multiversion'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] +html_sidebars = { + '**': [ + 'versions.html', + ], +} + +# 指定哪个分支为 lastest 版本 +smv_latest_version = 'master' + # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/develop_help/commit.rst b/docs/source/develop_help/commit.rst new file mode 100644 index 0000000000000000000000000000000000000000..b2322fead1510d028ef9e0fc6e9f14a924fc80e7 --- /dev/null +++ b/docs/source/develop_help/commit.rst @@ -0,0 +1,184 @@ +.. _commit_msg: + +git commit提交规范 +###################################### + +开发人员通过git commit和gitee pr的形式向openEuler Embedded进行贡献,其中git commit msg需遵循相应的规范。 +openEuler Embedded部署了基于gitlint的机制来检查git commit是否符合规划,具体的规则位于 :file:`.gitlint` 文件中。 + +- **commit msg规范** + +commit msg提交规范由三部分组成:title, body, foot + +title简明说明该次pr提交信息,(:)号前面是模块儿名,后面是简要信息 + +body详细说明该次提交的信息 + +foot由固定格式组成,第一部分是Signed-off-by,空格后是开发者用户名,再空格后是开发者邮箱,Signed off信息一般由 +git在提交时自动生成。 + + script: this is title + + this is body + + Signed-off-by: xxx + +- **范例** + +以下是一个提交范例 + + yocto: support compile xxx + + support compile xxx, this module is new and deal some archs now not supporting + + Signed-off-by: xxx + +- **.gitlint文件内容** + +:: + + # Edit this file as you like. + # + # All these sections are optional. Each section with the exception of [general] represents + # one rule and each key in it is an option for that specific rule. + # + # Rules and sections can be referenced by their full name or by id. For example + # section "[body-max-line-length]" could also be written as "[B1]". Full section names are + # used in here for clarity. + # + [general] + # Ignore certain rules, this example uses both full name and id + # ignore=title-trailing-punctuation, T3 + + # verbosity should be a value between 1 and 3, the commandline -v flags take precedence over this + # verbosity = 2 + + # By default gitlint will ignore merge, revert, fixup and squash commits. + # ignore-merge-commits=true + # ignore-revert-commits=true + # ignore-fixup-commits=true + # ignore-squash-commits=true + + # Ignore any data send to gitlint via stdin + # ignore-stdin=true + + # Fetch additional meta-data from the local repository when manually passing a + # commit message to gitlint via stdin or --commit-msg. Disabled by default. + # staged=true + + # Hard fail when the target commit range is empty. Note that gitlint will + # already fail by default on invalid commit ranges. This option is specifically + # to tell gitlint to fail on *valid but empty* commit ranges. + # Disabled by default. + # fail-without-commits=true + + # Enable debug mode (prints more output). Disabled by default. + # debug=true + + # Enable community contributed rules + # See http://jorisroovers.github.io/gitlint/contrib_rules for details + # contrib=contrib-title-conventional-commits,CC1 + contrib=CC1 + + # Set the extra-path where gitlint will search for user defined rules + # See http://jorisroovers.github.io/gitlint/user_defined_rules for details + # extra-path=examples/ + + # This is an example of how to configure the "title-max-length" rule and + # set the line-length it enforces to 50 + [title-max-length] + line-length=72 + + # Conversely, you can also enforce minimal length of a title with the + # "title-min-length" rule: + [title-min-length] + min-length=5 + + # title cannot have trailing whitespace(space or tab) + [title-trailing-whitespace] + + # [title-must-not-contain-word] + # Comma-separated list of words that should not occur in the title. Matching is case + # insensitive. It's fine if the keyword occurs as part of a larger word (so "WIPING" + # will not cause a violation, but "WIP: my title" will. + # words=wip + + [title-match-regex] + # python-style regex that the commit-msg title must match + # Note that the regex can contradict with other rules if not used correctly + # (e.g. title-must-not-contain-word). + regex=^(([0-9a-zA-Z]|-|_){1,}(: ))(.){1,}$ + + [body-max-line-length] + line-length=80 + + [body-min-length] + min-length=70 + + # Body cannot hava trailing whitespace + [body-trailing-whitespace] + + [author-valid-email] + + [body-first-line-empty] + + # [body-is-missing] + # Whether to ignore this rule on merge commits (which typically only have a title) + # default = True + # ignore-merge-commits=false + + # [body-changed-file-mention] + # List of files that need to be explicitly mentioned in the body when they are changed + # This is useful for when developers often erroneously edit certain files or git submodules. + # By specifying this rule, developers can only change the file when they explicitly reference + # it in the commit message. + # files=gitlint-core/gitlint/rules.py,README.md + + # [body-match-regex] + # python-style regex that the commit-msg body must match. + # E.g. body must end in My-Commit-Tag: foo + # regex=My-Commit-Tag: foo$ + + # [author-valid-email] + # python-style regex that the commit author email address must match. + # For example, use the following regex if you only want to allow email addresses from foo.com + # regex=[^@]+@foo.com + + # [ignore-by-title] + # Ignore certain rules for commits of which the title matches a regex + # E.g. Match commit titles that start with "Release" + # regex=^Release(.*) + + # Ignore certain rules, you can reference them by their id or by their full name + # Use 'all' to ignore all rules + # ignore=T1,body-min-length + + # [ignore-by-body] + # Ignore certain rules for commits of which the body has a line that matches a regex + # E.g. Match bodies that have a line that that contain "release" + # regex=(.*)release(.*) + # + # Ignore certain rules, you can reference them by their id or by their full name + # Use 'all' to ignore all rules + # ignore=T1,body-min-length + + # [ignore-body-lines] + # Ignore certain lines in a commit body that match a regex. + # E.g. Ignore all lines that start with 'Co-Authored-By' + # regex=^Co-Authored-By + + # [ignore-by-author-name] + # Ignore certain rules for commits of which the author name matches a regex + # E.g. Match commits made by dependabot + # regex=(.*)dependabot(.*) + # + # Ignore certain rules, you can reference them by their id or by their full name + # Use 'all' to ignore all rules + # ignore=T1,body-min-length + + # This is a contrib rule - a community contributed rule. These are disabled by default. + # You need to explicitly enable them one-by-one by adding them to the "contrib" option + # under [general] section above. + # [contrib-title-conventional-commits] + # Specify allowed commit types. For details see: https://www.conventionalcommits.org/ + # types = bugfix,user-story,epic \ No newline at end of file diff --git a/docs/source/contribute_doc.rst b/docs/source/develop_help/contribute_doc.rst similarity index 94% rename from docs/source/contribute_doc.rst rename to docs/source/develop_help/contribute_doc.rst index d8fc2681c4b99df5d3f2bd34e1e856cf5db8130f..6ce70e1b0e0d42618bd1e917baf722f050f3ad3a 100644 --- a/docs/source/contribute_doc.rst +++ b/docs/source/develop_help/contribute_doc.rst @@ -72,7 +72,11 @@ reStructuredText的语法无需专门记忆,需要用到时再去查询即可 "introduction", "openEuler Embedded总揽与简介" "getting_started", "openEuler Embedded快速使用入门" "features", "openEuler Embedded主要特性介绍" - "yocto", "openeuler Embedded的Yocto构建系统" + "linux", "openEuler Embedded运行相关的内容说明" + "infrastructure", "openEuler Embedded基础设施相关内容" + "yocto", "openEuler Embedded的Yocto构建系统" + "develop_help", "涉及openEuler Embedded开发过程中的一些帮助指导" + "bsp", "openEuler Embedded南向支持方面的内容" "release", "openEuler Embedded的发布说明" * 编译文档 @@ -218,7 +222,11 @@ easy_install可以自动下载并安装sphinx以及它所依赖的其他模块 "introduction", "openEuler Embedded总揽与简介" "getting_started", "openEuler Embedded快速使用入门" "features", "openEuler Embedded主要特性介绍" - "yocto", "openeuler Embedded的Yocto构建系统" + "linux", "openEuler Embedded运行相关的内容说明" + "infrastructure", "openEuler Embedded基础设施相关内容" + "yocto", "openEuler Embedded的Yocto构建系统" + "develop_help", "涉及openEuler Embedded开发过程中的一些帮助指导" + "bsp", "openEuler Embedded南向支持方面的内容" "release", "openEuler Embedded的发布说明" diff --git a/docs/source/develop_help/index.rst b/docs/source/develop_help/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..30737ac93de5ce75be298c519c2352d195f5cc63 --- /dev/null +++ b/docs/source/develop_help/index.rst @@ -0,0 +1,14 @@ +.. _develop_help: + +开发帮助 +============================ + +该部分内容旨在帮助开发者在openEuler Embedded项目下进行贡献以及需要遵守的相应规则。具体内容如下: + +.. toctree:: + :maxdepth: 1 + + commit.rst + contribute_doc.rst + openeuler_fetch.rst + republish.rst diff --git a/docs/source/develop_help/openeuler_fetch.rst b/docs/source/develop_help/openeuler_fetch.rst new file mode 100644 index 0000000000000000000000000000000000000000..dfdcde053f0f950ed719028bcb7778bea4a28d4a --- /dev/null +++ b/docs/source/develop_help/openeuler_fetch.rst @@ -0,0 +1,101 @@ +.. _openeuler_fetch: + + +通过openeuler_fetch使用openEuler软件包 +========================================== + +特性介绍 +*************************** + +openeuler_fetch是匹配openEuler Embedded构建镜像时按需从上游源码包自动下载软件包的功能函数,该功能省去了在构建openeuler-image镜像时需要提前下载所有软件包的步骤,因为openEuler Embedded由上百个软件包构成,完全下载耗时耗力,例如,如果你只想编译busybox这一个软件包,你其实是不需要将其他软件包全部下载,你关注的只是构建busybox的依赖软件包下载即可,而openeuler_fetch即可实现按需下载,你只需要初始化完环境即可进入编译环节。 + +openeuler_fetch运行机制 +*************************** + +openeuler_fetch在classes/openeuler.bbclass中实现,函数名为do_openeuler_fetch,该函数在base_do_fetch_prepend中通过bb.build.exec_func()函数调用,即openeuler_fetch运行完还会继续执行do_fetch,这样做的原因是不管openeuler_fetch运行成功与否都可以让fetch继续补充,例如有一款软件包在gitee中不存在,或在配置中配置错误,或者源码目录有相关的改动导致openeuler_fetch运行失败,则do_fetch可以继续完成文件的查找。 + +openeuler_fetch运行逻辑 +*************************** + +openeuler_fetch通过以下相关控制变量来完成相关包下载: + + - OPENEULER_GIT_URL: 远程仓库前缀,默认为https://gitee.com/src-openeuler,该值在.oebuild/local.conf.sample中设置,全局生效,也可以在bb或bbappend文件中设置使之局部生效 + + - OPENEULER_BRANCH: 软件包分支,在下载软件包时会通过该值指定分支名称,该值在.oebuild/local.conf.sample中设置,全局生效,也可以在bb或bbappend文件中设置使之局部生效 + + - OPENEULER_REPO_NAME: 软件包名,该名一般和构建包名一致,但在特殊情况下需要改动,例如构建libtool-cross时,构建包名为libtool-cross,因此默认OPENEULER_REPO_NAME为libtool-cross,但是依赖包路径是libtool,则需要将OPENEULER_REPO_NAME改为libtool + + - OPENEULER_LOCAL_NAME: 软件包本地名称,即软件包在本地路径名称,一般该变量如果不设置则在系统处理时默认和OPENEULER_REPO_NAME一样,该变量意在解决软件包名和本地存储路径不一致问题 + + - OPENEULER_SRC_URI_REMOVE: SRC_URI过滤变量,设置该变量可以在bitbake执行fetch之前移除设定的相关uri文件路径,该变量匹配规则时前缀匹配,例如设定OPENEULER_SRC_URI_REMOVE="https git",则openeuler_fetch在处理时遇到以https和git开头的uri则会去除 + +整体openeuler_fetch下载就是依靠以上相关变量完成,由以上变量最终组成git下载参数: + + - remote: 默认为https://gitee.com/src-openeuler/xxx,由OPENEULER_GIT_URL/OPENEULER_REPO_NAME组成 + + - branch: 默认为OPENEULER_BRANCH + +依据remote和branch,openeuler_fetch完成下载 + +openeuler_fetch 运行原理图如下: + .. image:: ../../image/develop_help/openeuler_fetch_process.png + +repo_init 运行原理图如下: + .. image:: ../../image/develop_help/openeuler_fetch_repo_init.png + +如何适配其他软件包 +*************************** + +在构建openEuler Embedded时经常会引入其他相关包或修改非指定包版本,那么此时该如何做呢?从上文中已经得知openeuler_fetch依赖5个变量来进行下载,内核是例外,因此我们只需要关注其他五个变量即可,接下来我们以busybox为例进行讲解: + +- 如果想要某一个版本的busybox参与构建:在busybox的bbappend文件中设定OPENEULER_BRANCH值为相关版本即可 + +- 如果想要使用自有仓库busybox参与构建:在busybox的bbappend文件中设定OPENEULER_GIT_URL为自有空间即可,注意:如果busybox已经下载在本地,则需要手动删除,然后再执行构建 + +- 如果需要其他代码仓的busybox参与构建,则修改OPENEULER_GIT_URL为其他平台仓域名即可,例如https://github.com/xxx + +- 另外,当构建busybox时需要的依赖并不会是某一款特定包,即不能直接通过depends添加依赖,而仅仅是需要某个路径下的文件,此时需要在bbappend中添加do_fetch_prepend,在该函数中添加需要依赖的包,例如: + +:: + + + python do_fetch_prepend() { + repoList = [{ + "repo_name": "yocto-embedded-tools", + "git_url": "https://gitee.com/openeuler", + "branch": "master" + },{ + "repo_name": "libboundscheck", + "git_url": "https://gitee.com/openeuler", + "branch": "openEuler-22.09" + },{ + "repo_name": "dsoftbus_standard", + "git_url": "https://gitee.com/openeuler", + "branch": "v3.1" + },{ + "repo_name": "embedded-ipc", + "git_url": "https://gitee.com/openeuler", + "branch": "master" + }] + + d.setVar("PKG_REPO_LIST", repoList) + + dd.build.exec_func("do_openeuler_fetchs", d) + } + +通过repoList设置好需要依赖的包,包结构格式不可更改,PKG_REPO_LIST变量的设定是为在do_openeuler_fetchs中获取依赖的包列表,do_openeuler_fetchs将依次解析PKG_REPO_LIST,并调用do_openeuler_fetch完成相关包的下载。 + +- 如果想要下载的busybox包在本地用其他路径,比如busyboyy,则在busybox的bb文件或bbappend文件设定OPENEULER_LOCAL_NAME="busyboyy",则在clone busybox时本地路径会变成busyboyy,注意,如果本地已经有busybox,但是依然设置了OPENEULER_LOCAL_NAME,则原本地仓将不会做任何操作,openeuler_fetch将直接新建一个busyboyy + +- 如果在编译busybox中所依赖的某些文件不想要,而想要统一去除,则可以在bb文件或bbappend文件中设定OPENEULER_SRC_URI_REMOVE变量,比如busybox的SRC_URI中有https或git开头的文件路径,但是我们会自己下载而不需要系统默认设定的,则可以设置OPENEULER_SRC_URI_REMOVE="https git",这样openeuler_fetch在处理时就会去除以https和git开头的文件 + +如何关闭openeuler_fetch功能 +*************************** + +OPENEULER_FETCH有两种关闭方式: + +1. 在meta-openeuler/conf/layer.conf中有一个全局变量OPENEULER_FETCH,该值默认设置为enable,即openeuler_fetch是开启状态,如果想要关闭openeuler_fetch则设置该值为disable, + +2. 在oebuild执行generate指令是将参数-df带上,也可以关闭openeuelr_fetch功能 + +另外 ``OPENEULER_FETCH`` 该值的作用域是全局的,我们在开发中可能会针对某一些或某几个包不需要运行openeuler_fetch,则可以在相关包的bb或bbappend中设定该值为disable \ No newline at end of file diff --git a/docs/source/develop_help/republish.rst b/docs/source/develop_help/republish.rst new file mode 100644 index 0000000000000000000000000000000000000000..ebeb8a55a4c4630493ea1cc3d7b003d7d2866218 --- /dev/null +++ b/docs/source/develop_help/republish.rst @@ -0,0 +1,17 @@ +.. _republish: + +商业发行版发行说明 +################################ + +本章介绍第三方公司发行openEuler嵌入式商业发行版的要求和建议,具体如下: + +1. 要求: + + (1) 要求基于openEuler嵌入式代码工程制作,软件包可以随意裁剪增加。构建指导:https://openeuler.gitee.io/yocto-meta-openeuler/yocto/index.html + +2. 建议: + + (1) 关键软件包版本(例如glib) 和配置(例如内核PAGE_SIZE大小) 和openEuler保持一致。 + (2) 开发工具链推荐使用openEuler嵌入式官方发行版本。 + (3) 嵌入式特有安全加固规则(https://openeuler.gitee.io/yocto-meta-openeuler/security_hardening/index.html) 建议采用。 + (4) 发行版提供面向具体行业的镜像文件(内核镜像和rootfs) 和开发工具链。 diff --git a/docs/source/features/armnn.rst b/docs/source/features/armnn.rst new file mode 100644 index 0000000000000000000000000000000000000000..331a295282241b446888d57b5b6360ea4b23d760 --- /dev/null +++ b/docs/source/features/armnn.rst @@ -0,0 +1,104 @@ +.. _ArmNN: + +ArmNN的支持 +###################################### + +本章主要介绍openEuler Embedded中ArmNN的特性、使用和构建。 + +ArmNN介绍 +*********************************** + +Arm NN SDK 是一套开源 Linux 软件和工具,支持在高能效的设备上运行机器学习工作负载。它桥接了现有神经网络框架与高能效的Arm Cortex CPUs、Arm Mali GPU 或 Arm 机器学习处理器。 + +.. image:: ../../image/armnn/context_diagram.jpg + +如上图所示,Arm NN填补了现有NN框架和底层IP之间的空白。它可以帮助TensorFlow 和 Caffe等现有神经网络框架实现高效转换,并在Arm Cortex CPU和Arm Mali GPU上高效运行,无需修改。 + +Arm NN SDK 运用 Compute Library,以 Cortex-A CPU和Mali GPU等可编程内核为目标,尽可能提高效率。其中包括为Arm机器学习处理器提供支持,以及通过CMSIS-NN 为Cortex-M CPU提供支持。 + +Arm NN先将这些框架中的网络转换为内部Arm NN格式,然后通过Compute Library 将它们高效地部署在Cortex-A CPU和Mali-G71及Mali-G72等Mali GPU上(如果存在后者的话)。 + +**主要优势** + +- 更轻松地在嵌入式系统上运行 TensorFlow和Caffe; +- Compute Library 内部的一流优化函数,让用户充分发挥底层平台的强大性能; +- 无论面向何种内核类型,编程模式都是相同的; +- 现有软件能够自动利用新硬件特性; +- 作为开源软件,能够相对简单地进行扩展,从而适应Arm合作伙伴的其他内核类型。 + +构建指导 +*********************************** + +ArmNN软件兼容 yocto-meta-openeuler 上做了很多准备工作,如 tensorflow的适配,Compute Library的适配,flatbuffers的使用等。openEuler Embedded ArmNN的代码位于 meta-openeuler/recipes-arm层上,社区开发者可根据需要自行构建 ArmNN软件,如构建一个在 arm64 架构下使用的 ArmNN工具。 + +示例:如何让 openeuler-image 构建添加ArmNN软件。 + +**步骤1** + + 修改meta-openeuler/recipes-core/packagegroups/packagegroup-base.bb 文件,在 RDEPENDS_packagegroup-base 中加入 armnn 包: + + .. code-block:: console + + RDEPENDS_packagegroup-base = " \ + acl \ + armnn \ + attr \ + ... + + 接下来按照官方 ref:容器环境下的快速构建指导 指导构建使用即可。 + +**步骤2** + + 将以上生成的系统镜像进行烧录,部署后验证ArmNN软件可用性。 + + .. code-block:: console + + cd /usr/lib64/ + ll libarm* + + .. image:: ../../image/armnn/libs.jpg + + 可通过单元测试程序 UnitTests 验证ArmNN库的可用性: + + .. code-block:: console + + cd /usr/bin/ + UnitTests + + 如下图所示,则表示测试用例都通过,ArmNN库可用。 + + .. image:: ../../image/armnn/UnitTests.jpg + +使用说明 +*********************************** +ArmNN软件使用详见 `ArmNN Documentation `_ 。 + +AI推理性能验证结果 +*********************************** + +以目标检测为示例,验证ArmNN的推理加速效果: +1)模型:yolov3 tiny(FLOAT32量化) + +2)训练数据:COCO + +3)测试数据:640*480 H264视频 + +**ArmNN推理速度** + + .. image:: ../../image/armnn/inference_speed_table.jpg + + .. image:: ../../image/armnn/inference_speed_diagram.jpg + +由以上图可得,在模型初始化和加载阶段,Ref模式比Acc模式快近4倍,但是在数据推理阶段,Acc模式比Ref模式有两个数量级的提升,可见硬件指令加速对于推理速度有极大的提升。 + +**ArmNN内存占用率** + + .. image:: ../../image/armnn/mem_table.jpg + + .. image:: ../../image/armnn/mem_diagram.jpg + +由上图可得,Acc情况下,空间占用率要比Ref高,体现了用空间换时间的优化原则。 + + .. note:: + + glibc-ref是指基于GlibC的Openeuler Embedded且不做任何加速,musl-acc是指基于MuslC的Openeuler Embedded且使能ArmNN的指令加速和优化。 diff --git a/docs/source/features/clang_llvm.rst b/docs/source/features/clang_llvm.rst new file mode 100644 index 0000000000000000000000000000000000000000..5ab2bd529fa7c2d2c0efa58efe24a3b27d3994e4 --- /dev/null +++ b/docs/source/features/clang_llvm.rst @@ -0,0 +1,107 @@ +.. _clang_llvm: + +clang/llvm 编译工具链支持 +######################### + +本章介绍如何使用 clang/llvm 编译工具链构建 openEuler Embedded。 + +clang/llvm 介绍 +--------------- + +LLVM 项目是模块化和可重用编译器以及工具链的集合,clang 是其编译器前端。相比较于GNU编译工具链,其优势在于编译速度更快,静态检查工具更加完善,可拓展性更强等等。 + +GNU工具链与LLVM工具链主要区别如下表: + +========= ============== ================== +项目 GNU工具链 LLVM工具链 +========= ============== ================== +C编译器 gcc clang +C++编译器 g++ clang++ +binutils GNU binutils LLVM binutils +汇编器 GNU as 集成汇编器 +链接器 ld.bfd,ld.gold LLVM linker ld.lld +运行时 libgcc compiler-rt +原子操作 libatomic compiler-rt +C语言库 GNU libc glibc LLVM libc +C++标准库 libstdc++ libc++ +C++ABI libsupcxx libc++abi +栈展开 libgcc_s LLVM libunwind +========= ============== ================== + +meta-clang 层介绍 +----------------- + +``meta-clang`` 层包含使用 clang/llvm 编译器工具链所需要的recipes和bbclass文件,由于 openeuler 使用 external-toolchain 机制,无需在 yocto 工程中编译 clang/llvm 工具链。 + +meta-clang层中主要起作用的是clang.bbclass文件,该文件用来控制编译时传入clang/llvm编译器工具链变量和依赖,除此之外,目前还有一小部分软件包并不完美支持使用clang/llvm来编译,nonclangable.conf文件记录了这些软件包的情况。 + +构建指导 +-------- + +1. clang/llvm 编译工具链获取: + + - 源码构建 + + 获取编译容器 + + .. code-block:: console + + docker pull swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/cross-compile-bisheng:v0.1 + + 进入容器 + + .. code-block:: console + + docker run -idt --network host --name clang_compile swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/cross-compile-bisheng:v0.1 bash + docker exec -it clang_compile bash + + 下载llvm-project + + .. code-block:: console + + cd ~ + git clone https://gitee.com/openeuler/llvm-project.git -b dev_15x + + 初始化环境并编译 + + .. code-block:: console + + source /etc/profile + cd llvm-project + ./build.sh -e -o -s -i -b release + + - 预编译发布 + + 直接从预编译发布网站获取 `LLVM `_ + +2. 构建环境 + + 参考 :ref:`openeuler_embedded_oebuild` 初始化容器环境,生成配置文件时使用如下命令 + + .. code-block:: console + + oebuild generate -p platform -d build_direction -t /path/to/clang-llvm-15.0.3 -f clang + + 键入 ``oebuild bitbake`` 进入容器环境后,拷贝arm64架构GCC库至编译器目录 + + ``/usr1/openeuler/native_gcc/`` 为oebuild默认挂载的编译器目录 + + .. code-block:: console + + sudo cp /usr1/openeuler/gcc/openeuler_gcc_arm64le/* /usr1/openeuler/native_gcc/ + + .. attention:: + + 当前只支持arm64架构 + +3. 构建命令 + + .. code-block:: console + + bitbake openeuler-image-llvm + +4. SDK生成 + + .. code-block:: console + + bitbake openeuler-image-llvm -c populate_sdk diff --git a/docs/source/features/distributed_soft_bus.rst b/docs/source/features/distributed_soft_bus.rst deleted file mode 100644 index ceeab818dea21b9d0fb8eb32095490e36408b089..0000000000000000000000000000000000000000 --- a/docs/source/features/distributed_soft_bus.rst +++ /dev/null @@ -1,137 +0,0 @@ -.. _distributed_soft_bus: - -分布式软总线 -############# - -特性介绍 -************** - -**背景** - -openEuler秉承着打造“数字化基础设施操作系统”的愿景,为促进与OpenHarmony生态的合作与互通,实现端边领域的互通和协同,首次在嵌入式领域引入分布式软总线技术。 - -分布式软总线是OpenHarmony社区开源的分布式设备通信基座,为设备之间的互通互联提供统一的分布式协同能力,实现设备无感发现和高效传输。 - -OpenHarmony主要面向强交互等需求的智能终端、物联网终端和工业终端。openEuler主要面向有高可靠、高性能等需求的服务器、边缘计算、云和嵌入式设备,二者各有侧重。通过以分布式软总线为代表的技术进行生态互通,以期实现“1+1>2”的效果,支撑社区用户开拓更广阔的行业空间。 - -**架构** - -软总线的主要架构如下: - - .. figure:: ../../image/dsoftbus/dsoftbus_architecture.png - :align: center - -软总线主体功能分为发现、组网、连接和传输四个基本模块,实现: - -* **即插即用**:快速便捷发现周边设备 - -* **自由流转**:各设备间自组网,任意建立业务连接,实现自由通信 - -* **高效传输**:通过wifi、蓝牙设备下软硬件协同最大化发挥硬件传输性能 - -软总线南向支持标准以太网通信,同时后续可持续拓展wifi、蓝牙等多种通信方式。并为北向的分布式应用提供统一的API接口,屏蔽底层通信机制。 - -软总线依赖于设备认证、IPC、日志和系统参数(SN号)等周边模块,嵌入式系统中将这些依赖模块进行了样板性质的替换,以实现软总线基本功能。实际的周边模块功能实现,还需要用户根据实际业务场景进行丰富和替换,以拓展软总线能力。 - -应用指南 -************** - -**部署示意** - -软总线支持局域网内多设备部署,设备间通过以太网通信。单设备上分为server和client,二者通过IPC模块进行交互。 - - .. figure:: ../../image/dsoftbus/dsoftbus_networking.png - :align: center - -.. attention:: - - 当前IPC模块和SN号等系统参数,嵌入式版本提供的仅为参考模板,还无法支持多节点和多client部署。用户可根据实际业务场景进行IPC模块和SN号系统参数进行功能丰富,以拓展软总线部署能力。 - -**服务端启动** - -服务端主程序为softbus_server_main,执行该主程序既可拉起软总线服务端。 - -.. code-block:: console - - openeuler ~ # softbus_server_main >log.file & - -当服务端被拉起时,会主动通过名为ethX的网络设备进行coap广播,若探测到对端设备存在则会启动自组网。 - -**客户端API** - -头文件在sdk和initrd中均存放在/usr/include/dsoftbus/下,其中: - -1.discovery_service.h:发现模块头文件,支持应用主动探测和发布的API如下: - -+----------------------------+--------------------------------------------------------------------+ -| PublishService | 发布特定服务能力 | -+----------------------------+--------------------------------------------------------------------+ -| UnPublishService | 取消发布特定服务能力 | -+----------------------------+--------------------------------------------------------------------+ -| StartDiscovery | 订阅/探测特定服务能力 | -+----------------------------+--------------------------------------------------------------------+ -| StopDiscovery | 取消订阅特性服务能力 | -+----------------------------+--------------------------------------------------------------------+ - -其中服务能力通过g_capbilityMap数组定义,用户若新增能力需要自定义修改该数组,并重新编译软总线服务端和客户端程序来生效。 - -2.softbus_bus_center.h:组网模块头文件,支持获取组网内设备信息API如下: - -+----------------------------+--------------------------------------------------------------------+ -| GetAllNodeDeviceInfo | 获取当前组网内所有节点信息 | -+----------------------------+--------------------------------------------------------------------+ - -3.session.h:连接/传输模块头文件,支持创建session和数据传输API如下: - -+----------------------------+--------------------------------------------------------------------+ -| CreateSessionServer | 创建session服务端 | -+----------------------------+--------------------------------------------------------------------+ -| RemoveSessionServer | 移除session服务端 | -+----------------------------+--------------------------------------------------------------------+ -| OpenSession | 创建到对端的传输连接(同时依赖于本端和对端提前创建的SessionServer)| -+----------------------------+--------------------------------------------------------------------+ -| CloseSession | 断开传输连接 | -+----------------------------+--------------------------------------------------------------------+ -| SendBytes | 根据建好的连接ID,进行数据传输。 | -+----------------------------+--------------------------------------------------------------------+ - -各API参数详见头文件描述。 - -编译指导 -************** - -编译依托于embedded版本发布的容器镜像,请参考“openEuler Embedded容器构建指导”章节进行容器环境准备。 - -1)下载脚本所在仓库(例如下载到src/yocto-meta-openeuler目录下) - -.. code-block:: console - - git clone https://gitee.com/openeuler/yocto-meta-openeuler.git -b openEuler-22.03-LTS -v src/yocto-meta-openeuler - -2)执行下载脚本 - -下载最新软总线代码: - -.. code-block:: console - - sh src/yocto-meta-openeuler/scripts/download_code.sh dsoftbus - -代码默认下载到与yocto-meta-openeuler同级别的路径,如需修改软总线或者其依赖的模块代码可到对应路径下查找dsoftbus_standard和yocto-embedded-tools仓库进行对应修改。 - -3)编译编译脚本 - -编译最新软总线代码: - -.. code-block:: console - - sh src/yocto-meta-openeuler/scripts/compile.sh dsoftbus - -编译工作目录名为“dsoftbus_build”,编译生成件目录名为“dsoftbus_output”,二者均默认与yocto-meta-openeuler在同级别路径。 - -限制约束 -************** - -1.仅支持局域网下的coap发现。wifi/ble等功能在后续版本中持续支持。 - -2.目前提供的IPC、SN号等软总线的依赖模块均为样例,仅支持双设备节点部署,client-server一对一部署的能力。期待后续与社区伙伴,根据实际场景共同对这些依赖模块进行实例化。 - diff --git a/docs/source/features/distributed_softbus.rst b/docs/source/features/distributed_softbus.rst new file mode 100644 index 0000000000000000000000000000000000000000..4069c1247a5ee9acc81efcf4f79bf33d0682a3a8 --- /dev/null +++ b/docs/source/features/distributed_softbus.rst @@ -0,0 +1,1047 @@ +.. _distributed_softbus: + +分布式软总线 +############# + +特性介绍 +************** + +**背景** + +openEuler秉承着打造“数字化基础设施操作系统”的愿景,为促进与OpenHarmony生态的合作与互通,实现端边领域的互通和协同,首次在嵌入式领域引入分布式软总线技术。 + +分布式软总线是OpenHarmony社区开源的分布式设备通信基座,为设备之间的互通互联提供统一的分布式协同能力,实现设备无感发现和高效传输。 + +OpenHarmony主要面向强交互等需求的智能终端、物联网终端和工业终端。openEuler主要面向有高可靠、高性能等需求的服务器、边缘计算、云和嵌入式设备,二者各有侧重。通过以分布式软总线为代表的技术进行生态互通,以期实现“1+1>2”的效果,支撑社区用户开拓更广阔的行业空间。 + +**架构** + +软总线的主要架构如下: + + .. figure:: ../../image/dsoftbus/dsoftbus_architecture.png + :align: center + +软总线主体功能分为发现、组网、连接和传输四个基本模块,实现: + +* **即插即用**:快速便捷发现周边设备 + +* **自由流转**:各设备间自组网,任意建立业务连接,实现自由通信 + +* **高效传输**:通过wifi、蓝牙设备下软硬件协同最大化发挥硬件传输性能 + +软总线南向支持wifi(22.09新增)和有线以太网通信,同时后续可持续拓展蓝牙等通信方式。并为北向的分布式应用提供统一的API接口,屏蔽底层通信机制。 + +软总线依赖于设备认证、IPC、日志和系统参数(SN号)等周边模块,嵌入式系统中将这些依赖模块进行了样板性质的替换,以实现软总线基本功能。实际的周边模块功能实现,还需要用户根据实际业务场景进行丰富和替换,以拓展软总线能力。 + +应用指南 +************** + +此部分内容基于22.09描述,建议使用22.09分支的分布式软总线特性,功能更为完善。 + +其他历史信息请基于对应分支的yocto-meta-openeuler/docs进行查阅。 + +**部署示意** + +软总线支持局域网内多设备部署,设备间通过以太网通信。 + +单设备上分为server和client,二者通过IPC模块进行交互。 + +单节点上支持多client同时接入单一server。 + + .. figure:: ../../image/dsoftbus/dsoftbus_networking.png + :align: center + + +**服务端启动** + +服务端主程序名为softbus_server_main。 + +如部署模型,软总线通过独立进程部署的方式对外提供服务,通过执行服务端主程序可拉起软总线进程提供对外服务。 + +.. code-block:: console + + openeuler ~ # softbus_server_main >log.file & + +1.当服务端被拉起时,会主动通过名为ethX/wifiX的网络设备进行coap广播,对对端设备进行自动探测。 + +2.当探测到对端设备且对端设备为可信设备时,还会自动组网操作,以便后后续客户端进行快速连接和传输。(“添加可信设备”见后续章节) + +3.日志模块可通过重定向接管,有条件者还可通过实现和替换软总线依赖的hilog模块,进行更细致的日志管理。 + +4.服务端依赖于系统参数模块syspara,以获取设备唯一的UDID。openEuler Embedded预留了/etc/SN的文件接口,作为生成UDID的参数。(SN号可为64字节长度内的任意字符串) + +.. attention:: + + * 用户请参考部署模型,保证单设备节点上有且仅有唯一的softbus_server_main进程。 + + * 用户需要在启动softbus_server_main前配置/etc/SN,并保证多设备下SN号的唯一性 + + +**客户端API** + +softbus客户端API头文件在嵌入式版本提供的sdk中对外开放,可在客户端代码中引用。 + +.. code-block:: console + + #include "discovery_service.h" + #include "softbus_bus_center.h" + #include "session.h" + + +其中: + +1.discovery_service.h:发现模块头文件,支持应用主动探测和发布的API如下: + ++----------------------------+--------------------------------------------------------------------+ +| PublishService | 发布特定服务能力 | ++----------------------------+--------------------------------------------------------------------+ +| UnPublishService | 取消发布特定服务能力 | ++----------------------------+--------------------------------------------------------------------+ +| StartDiscovery | 订阅/探测特定服务能力 | ++----------------------------+--------------------------------------------------------------------+ +| StopDiscovery | 取消订阅特性服务能力 | ++----------------------------+--------------------------------------------------------------------+ + +.. attention:: + + 服务能力通过g_capabilityMap数组定义,用户若新增能力需要自定义修改该数组,并重新编译软总线服务端和客户端程序来生效。 + +2.softbus_bus_center.h:组网模块头文件,支持获取组网内设备信息API如下: + ++----------------------------+--------------------------------------------------------------------+ +| GetAllNodeDeviceInfo | 获取当前组网内所有节点信息 | ++----------------------------+--------------------------------------------------------------------+ +| FreeNodeInfo | 释放GetAllNodeDeviceInfo返回的节点信息内存 | ++----------------------------+--------------------------------------------------------------------+ + +3.session.h:连接/传输模块头文件,支持创建session和数据传输API如下: + ++----------------------------+--------------------------------------------------------------------+ +| CreateSessionServer | 创建session服务端 | ++----------------------------+--------------------------------------------------------------------+ +| RemoveSessionServer | 移除session服务端 | ++----------------------------+--------------------------------------------------------------------+ +| OpenSession | 创建到对端的传输连接(同时依赖于本端和对端提前创建的SessionServer)| ++----------------------------+--------------------------------------------------------------------+ +| CloseSession | 断开传输连接 | ++----------------------------+--------------------------------------------------------------------+ +| SendBytes | 根据建好的连接ID,进行字节流数据传输 | ++----------------------------+--------------------------------------------------------------------+ +| SendMessage | 根据建好的连接ID,进行消息数据传输 | ++----------------------------+--------------------------------------------------------------------+ +| SendStream | 根据建好的连接ID,进行流式数据传输 | ++----------------------------+--------------------------------------------------------------------+ +| SendFile | 根据建好的连接ID,进行文件传输 | ++----------------------------+--------------------------------------------------------------------+ +| SetFileSendListener | 设置文件传输发送过程中的回调函数 | ++----------------------------+--------------------------------------------------------------------+ +| SetFileReceiveListener | 设置文件传输接收过程中的回调函数 | ++----------------------------+--------------------------------------------------------------------+ + +各API参数详见头文件描述。 + +**客户端使用** + +客户端提供动态链接库: + * libsoftbus_client.z.so, + +以及对应的头文件: + + * 发现:discovery_service.h + + * 组网:softbus_bus_center.h + + * 连接/组网:session.h + +用户使用软总线时,需要作为客户端程序显式链接libsoftbus_client.z.so动态库,即可通过函数调用使用软总线提供的API。 + +链接动态库方式参见下一章节(应用示例) + + +**应用示例** + +使用qemu部署分布式软总线,编写客户端程序,使其能够列出所有发现的设备信息。 + +1. 编写客户端程序 + + 编写客户端程序依托于embedded版本发布的SDK,请参考 :ref:`getting_started` 章节进行SDK环境使用准备 + + 该示例代码中同时实现了两个设备间的发现和消息收发功能。用户可以作为API调用参考,并根据应用场景进行裁减和扩展。 + + 创建一个 :file:`softbus_client_main.c` 文件,源码如下: + + .. code-block:: c + + #include + #include + #include + #include "securec.h" + #include "discovery_service.h" + #include "softbus_bus_center.h" + #include "session.h" + + #define PACKAGE_NAME "softbus_sample" + #define LOCAL_SESSION_NAME "session_test" + #define TARGET_SESSION_NAME "session_test" + #define DEFAULT_CAPABILITY "osdCapability" + #define DEFAULT_SESSION_GROUP "group_test" + #define DEFAULT_PUBLISH_ID 123 + + static int g_sessionId; + + static void PublishSuccess(int publishId) + { + printf("CB: publish %d done\n", publishId); + } + + static void PublishFailed(int publishId, PublishFailReason reason) + { + printf("CB: publish %d failed, reason=%d\n", publishId, (int)reason); + } + + static int PublishServiceInterface() + { + PublishInfo info = { + .publishId = DEFAULT_PUBLISH_ID, + .mode = DISCOVER_MODE_PASSIVE, + .medium = COAP, + .freq = LOW, + .capability = DEFAULT_CAPABILITY, + .capabilityData = NULL, + .dataLen = 0, + }; + IPublishCallback cb = { + .OnPublishSuccess = PublishSuccess, + .OnPublishFail = PublishFailed, + }; + return PublishService(PACKAGE_NAME, &info, &cb); + } + + static void UnPublishServiceInterface(void) + { + int ret = UnPublishService(PACKAGE_NAME, DEFAULT_PUBLISH_ID); + if (ret != 0) { + printf("UnPublishService fail:%d\n", ret); + } + } + + static void DeviceFound(const DeviceInfo *device) + { + unsigned int i; + printf("CB: Device has found\n"); + printf("\tdevId=%s\n", device->devId); + printf("\tdevName=%s\n", device->devName); + printf("\tdevType=%d\n", device->devType); + printf("\taddrNum=%d\n", device->addrNum); + for (i = 0; i < device->addrNum; i++) { + printf("\t\taddr%d:type=%d,", i + 1, device->addr[i].type); + switch (device->addr[i].type) { + case CONNECTION_ADDR_WLAN: + case CONNECTION_ADDR_ETH: + printf("ip=%s,port=%d,", device->addr[i].info.ip.ip, device->addr[i].info.ip.port); + break; + default: + break; + } + printf("peerUid=%s\n", device->addr[i].peerUid); + } + printf("\tcapabilityBitmapNum=%d\n", device->capabilityBitmapNum); + for (i = 0; i < device->addrNum; i++) { + printf("\t\tcapabilityBitmap[%d]=0x%x\n", i + 1, device->capabilityBitmap[i]); + } + printf("\tcustData=%s\n", device->custData); + } + + static void DiscoverySuccess(int subscribeId) + { + printf("CB: discover subscribeId=%d\n", subscribeId); + } + + static void DiscoveryFailed(int subscribeId, DiscoveryFailReason reason) + { + printf("CB: discover subscribeId=%d failed, reason=%d\n", subscribeId, (int)reason); + } + + static int DiscoveryInterface(void) + { + SubscribeInfo info = { + .subscribeId = DEFAULT_PUBLISH_ID, + .mode = DISCOVER_MODE_ACTIVE, + .medium = COAP, + .freq = LOW, + .isSameAccount = false, + .isWakeRemote = false, + .capability = DEFAULT_CAPABILITY, + .capabilityData = NULL, + .dataLen = 0, + }; + IDiscoveryCallback cb = { + .OnDeviceFound = DeviceFound, + .OnDiscoverFailed = DiscoveryFailed, + .OnDiscoverySuccess = DiscoverySuccess, + }; + return StartDiscovery(PACKAGE_NAME, &info, &cb); + } + + static void StopDiscoveryInterface(void) + { + int ret = StopDiscovery(PACKAGE_NAME, DEFAULT_PUBLISH_ID); + if (ret) { + printf("StopDiscovery fail:%d\n", ret); + } + } + + static int SessionOpened(int sessionId, int result) + { + printf("CB: session %d open fail:%d\n", sessionId, result); + if (result == 0) { + g_sessionId = sessionId; + } + + return result; + } + + static void SessionClosed(int sessionId) + { + printf("CB: session %d closed\n", sessionId); + } + + static void ByteRecived(int sessionId, const void *data, unsigned int dataLen) + { + printf("CB: session %d received %u bytes data=%s\n", sessionId, dataLen, (const char *)data); + } + + static void MessageReceived(int sessionId, const void *data, unsigned int dataLen) + { + printf("CB: session %d received %u bytes message=%s\n", sessionId, dataLen, (const char *)data); + } + + static int CreateSessionServerInterface(void) + { + const ISessionListener sessionCB = { + .OnSessionOpened = SessionOpened, + .OnSessionClosed = SessionClosed, + .OnBytesReceived = ByteRecived, + .OnMessageReceived = MessageReceived, + }; + + return CreateSessionServer(PACKAGE_NAME, LOCAL_SESSION_NAME, &sessionCB); + } + + static void RemoveSessionServerInterface(void) + { + int ret = RemoveSessionServer(PACKAGE_NAME, LOCAL_SESSION_NAME); + if (ret) { + printf("RemoveSessionServer fail:%d\n", ret); + } + } + + static int OpenSessionInterface(const char *peerNetworkId) + { + SessionAttribute attr = { + .dataType = TYPE_BYTES, + .linkTypeNum = 1, + .linkType[0] = LINK_TYPE_WIFI_WLAN_2G, + .attr = {RAW_STREAM}, + }; + + return OpenSession(LOCAL_SESSION_NAME, TARGET_SESSION_NAME, peerNetworkId, DEFAULT_SESSION_GROUP, &attr); + } + + static void CloseSessionInterface(int sessionId) + { + CloseSession(sessionId); + } + + static int GetAllNodeDeviceInfoInterface(NodeBasicInfo **dev) + { + int ret, num; + + ret = GetAllNodeDeviceInfo(PACKAGE_NAME, dev, &num); + if (ret) { + printf("GetAllNodeDeviceInfo fail:%d\n", ret); + return -1; + } + + printf("return %d Node\n", num); + for (int i = 0; i < num; i++) { + printf("deviceName=%s\n", i + 1, dev[i]->deviceName); + printf("\tnetworkId=%s\n", dev[i]->networkId); + printf("\tType=%d\n", dev[i]->deviceTypeId); + } + + return num; + } + + static void FreeNodeInfoInterface(NodeBasicInfo *dev) + { + FreeNodeInfo(dev); + } + + static void commnunicate(void) + { + NodeBasicInfo *dev = NULL; + char cData[] = "hello world test"; + int dev_num, sessionId, input, ret; + int timeout = 5; + + dev_num = GetAllNodeDeviceInfoInterface(&dev); + if (dev_num <= 0) { + return; + } + + printf("\nInput Node num to commnunication:"); + scanf_s("%d", &input); + if (input <= 0 || input > dev_num) { + printf("error input num\n"); + goto err_input; + } + + g_sessionId = -1; + sessionId = OpenSessionInterface(dev[input - 1].networkId); + if (sessionId < 0) { + printf("OpenSessionInterface fail, ret=%d\n", sessionId); + goto err_OpenSessionInterface; + } + + while (timeout) { + if (g_sessionId == sessionId) { + ret = SendBytes(sessionId, cData, strlen(cData) + 1); + if (ret) { + printf("SendBytes fail:%d\n", ret); + } + break; + } + timeout--; + sleep(1); + } + + CloseSessionInterface(sessionId); + err_OpenSessionInterface: + err_input: + FreeNodeInfoInterface(dev); + } + + int main(int argc, char **argv) + { + bool loop = true; + int ret; + + ret = CreateSessionServerInterface(); + if (ret) { + printf("CreateSessionServer fail, ret=%d\n", ret); + return ret; + } + + ret = PublishServiceInterface(); + if (ret) { + printf("PublishService fail, ret=%d\n", ret); + goto err_PublishServiceInterface; + } + + ret = DiscoveryInterface(); + if (ret) { + printf("DiscoveryInterface fail, ret=%d\n", ret); + goto err_DiscoveryInterface; + } + + while (loop) { + printf("\nInput c to commnuication, Input s to stop:"); + char op = getchar(); + switch(op) { + case 'c': + commnunicate(); + continue; + case 's': + loop = false; + break; + case '\n': + break; + default: + continue; + } + } + + StopDiscoveryInterface(); + err_DiscoveryInterface: + UnPublishServiceInterface(); + err_PublishServiceInterface: + RemoveSessionServerInterface(); + return 0; + } + + 在配置好SDK环境 编译客户端主程序如下: + + .. code-block:: console + + ${CC} -lsoftbus_client.z -lboundscheck softbus_client_main.c -o softbus_client_main + + 编译完成后会得到dsoftbus_client_main程序 + +2. 构建qemu组网环境 + + 在host中创建网桥br0 + + .. code-block:: console + + brctl addbr br0 + + 启动qemu1 + + .. code-block:: console + + qemu-system-aarch64 -M virt-4.0 -m 1G -cpu cortex-a57 -nographic -kernel zImage -initrd -device virtio-net-device,netdev=tap0,mac=52:54:00:12:34:56 -netdev bridge,id=tap0 + + .. attention:: + 首次运行如果出现如下错误提示, + + .. code-block:: console + + failed to parse default acl file `/usr/local/libexec/../etc/qemu/bridge.conf' + qemu-system-aarch64: bridge helper failed + + 则需要向指示的文件添加"allow br0" + + .. code-block:: console + + echo "allow br0" > /usr/local/libexec/../etc/qemu/bridge.conf + + 启动qemu2 + + .. code-block:: console + + qemu-system-aarch64 -M virt-4.0 -m 1G -cpu cortex-a57 -nographic -kernel zImage -initrd openeuler-image-qemu-aarch64-20220331025547.rootfs.cpio.gz -device virtio-net-device,netdev=tap1,mac=52:54:00:12:34:78 -netdev bridge,id=tap1 + + .. attention:: + + qemu1与qemu2的mac地址需要配置为不同的值 + + + 配置IP + + 配置host的网桥地址 + + .. code-block:: console + + ifconfig br0 192.168.10.1 up + + 配置qemu1的网络地址 + + .. code-block:: console + + ifconfig eth0 192.168.10.2 + + 配置qemu2的网络地址 + + .. code-block:: console + + ifconfig eth0 192.168.10.3 + + 分别在host、qemu1、qemu2使用ping进行测试,确保qemu1可以ping通qemu2。 + +3. 启动分布式软总线 + + 在qemu1和qemu2中启动分布式软总线的服务端 + + .. code-block:: console + + softbus_server_main >log.file & + + 将编译好的客户端分发到qemu1和qemu2的根目录中 + + .. code-block:: console + + scp softbus_client_main root@192.168.10.2:/ + scp softbus_client_main root@192.168.10.3:/ + + 分别在qemu1和qemu2的根目录下运行softbus_client_main,双方均会发现对端设备并输出设备信息: + + .. code-block:: console + + CB: Device has found + devId=6B86B273FF34FCE19D6B804EFF5A3F5747ADA4EAA22F1D49C01E52DDB7875B4B + devName=openEuler + devType=175 + addrNum=1 + addr1:type=3,ip=192.168.10.3,port=44749,peerUid= + capabilityBitmapNum=1 + capabilityBitmap[1]=0xc0 + custData= + + 将一端作为发送方,输出字符'c'后,会显示在同一个本地神经网络中的其他设备信息 + + .. code-block:: console + + Input c to commnuication, Input s to stop:c + return 1 Node + deviceName=openEuler + networkId=15a5e255f24073630c04a52f83679677b817df008fc11a22711cb3038de9d9b1 + Type=0 + + 继续输入节点序号后,将尝试创建与对应节点的连接并传输测试数据 + + .. code-block:: console + + Input Node num to commnunication:1 + + 若传输成功,则在对端设备上会显示传输数据的结果 + + .. code-block:: console + + CB: session 2 received 17 bytes data=hello world test + + 测试结束后,输入字符's'退出双端程序 + +可信设备添加 +************** + +**背景** + +软总线在创建连接的过程中,会调用hichain模块的认证接口,与对端的设备进行认证操作。hichain模块为OpenHarmony提供设备认证能力,支持通过点对点认证方式创建可信群组。 + +若仅为openEuler之间的软总线连接,可以通过绕过hichain认证或者自定义认证实现。但如果openEuler和OpenHarmony设备之间要互连互通,则需要在openEuler上支持hichain的点对点认证和可信群组创建能力。 + +**应用说明** + +hichain模块与软总线一样,分为服务端和客户端: + +* **服务端**:在openEuler上,实现了hichain和softbus的服务端共进程,即用户仅需拉起softbus服务端,无需额外操作hichain服务端。 + +* **客户端**:通过hichain的客户端提供的API,可以创建群组,并请求添加群组成员,从而将多个设备添加到可信群组。 + +hichain的客户端为动态链接库,用户可以单独链接hichain的客户端进行可信群组创建。在可信群组创建后,软总线会自动触发组网,支持后续软总线客户端的连接和传输。 + + +**客户端API** + +hichain的客户端API头文件在嵌入式版本提供的sdk中对外开放,可在客户端代码中引用。 + +.. code-block:: console + + #include "device_auth.h" + +1.直接调用接口 + ++----------------------------+--------------------------------------------------------------------+ +| InitDeviceAuthService | 初始化hichain客户端 | ++----------------------------+--------------------------------------------------------------------+ +| GetGmInstance | 获取客户端群组管理的操作函数组 | ++----------------------------+--------------------------------------------------------------------+ +| DestroyDeviceAuthService | 注销hichain客户端 | ++----------------------------+--------------------------------------------------------------------+ + +2.GetGmInstance返回的操作函数组 + ++----------------------------+--------------------------------------------------------------------+ +| regCallback | 注册群组创建和请求回调函数 | ++----------------------------+--------------------------------------------------------------------+ +| unRegCallback | 解注册群组回调函 | ++----------------------------+--------------------------------------------------------------------+ +| createGroup | 创建新的群组 | ++----------------------------+--------------------------------------------------------------------+ +| getGroupInfo | 查询本地群组信息 | ++----------------------------+--------------------------------------------------------------------+ +| destroyInfo | 释放通过getGroupInfo申请的内存 | ++----------------------------+--------------------------------------------------------------------+ +| addMemberToGroup | 请求添加成员到群组 | ++----------------------------+--------------------------------------------------------------------+ +| isDeviceInGroup | 查询某个设备是否在群组中 | ++----------------------------+--------------------------------------------------------------------+ + +更详细的接口说明,请参考社区hichain模块代码实现。 + +**客户端编译** + +客户端提供动态链接库:libdeviceauth_sdk.z.so + +用户使用hichain创建群组和添加可信设备时,需要作为客户端程序显式链接该动态库,即可通过函数调用使用hichain提供的API。 + +.. code-block:: console + + #: ${CROSS_COMPILE}ld -ldeviceauth_sdk.z -lcjson + + +**使用范例** + +1.按照hichain的点对点pin码认证方式,需要通过设备创建群组(host),另一个台设备请求添加成员到该群组(target),实例代码如下: + +.. code-block:: console + + #include + #include + #include + #include + #include + #include + + #define APP_ID "hichain_test" + #define DEFAULT_GROUP_NAME "dsoftbus" + #define DEFAULT_PIN_CODE "123456" + #define MAX_UDID_LEN 65 + #define MAX_GROUP_LEN 65 + + #define FIELD_ETH_IP "ETH_IP" + #define FIELD_ETH_PORT "ETH_PORT" + #define FIELD_WLAN_IP "WIFI_IP" + #define FIELD_WLAN_PORT "WIFI_PORT" + + static const DeviceGroupManager *g_hichainGmInstance = NULL; + static char g_udid[MAX_UDID_LEN]; + static char g_groupId[MAX_GROUP_LEN]; + static int64_t g_requestId = 1; + + static const char *GetStringFromJson(const cJSON *obj, const char *key) + { + cJSON *item; + + if (obj == NULL || key == NULL) + return NULL; + + item = cJSON_GetObjectItemCaseSensitive(obj, key); + if (item != NULL && cJSON_IsString(item)) { + return cJSON_GetStringValue(item); + } else { + int len = cJSON_GetArraySize(obj); + for (int i = 0; i < len; i++) { + item = cJSON_GetArrayItem(obj, i); + if (cJSON_IsObject(item)) { + const char *value = GetStringFromJson(item, key); + if (value != NULL) + return value; + } + } + } + return NULL; + } + + static int HichainSaveGroupID(const char *param) + { + cJSON *msg = cJSON_Parse(param); + const char *value = NULL; + + if (msg == NULL) { + printf("HichainSaveGroupID: cJSON_Parse fail\n"); + return -1; + } + + value = GetStringFromJson(msg, FIELD_GROUP_ID); + if (value == NULL) { + printf("HichainSaveGroupID:GetStringFromJson fail\n"); + cJSON_Delete(msg); + return -1; + } + + memcpy_s(g_groupId, MAX_GROUP_LEN, value, strlen(value)); + printf("HichainSaveGroupID:groupID=%s\n", g_groupId); + + cJSON_Delete(msg); + return 0; + } + + static void HiChainGmOnFinish(int64_t requestId, int operationCode, const char *returnData) + { + if (operationCode == GROUP_CREATE && returnData != NULL) { + printf("create new group finish:requestId=%lld, returnData=%s\n", requestId, returnData); + HichainSaveGroupID(returnData); + } else if (operationCode == MEMBER_JOIN) { + printf("member join finish:requestId=%lld, returnData=%s\n", requestId, returnData); + + } else { + printf("CB:requestId=%lld, operationCode=%d, returnData=%s\n", requestId, operationCode, returnData); + } + } + + static void HiChainGmOnError(int64_t requestId, int operationCode, int errorCode, const char *errorReturn) + { + printf("CB:requestId=%lld, operationCode=%d, errorCode=%d, errorReturn=%s\n", requestId, operationCode, errorCode, errorReturn); + } + + static char *HiChainGmOnRuest(int64_t requestId, int operationCode, const char *reqParams) + { + cJSON *msg = cJSON_CreateObject(); + char *param = NULL; + + printf("CB:requestId=%lld, operationCode=%d, reqParams=%s", requestId, operationCode, reqParams); + + if (operationCode != MEMBER_JOIN) { + return NULL; + } + + if (msg == NULL) { + printf("HiChainGmOnRuest: cJSON_CreateObject fail\n"); + } + + if (cJSON_AddNumberToObject(msg, FIELD_CONFIRMATION, REQUEST_ACCEPTED) == NULL || + cJSON_AddStringToObject(msg, FIELD_PIN_CODE, DEFAULT_PIN_CODE) == NULL || + cJSON_AddStringToObject(msg, FIELD_DEVICE_ID, g_udid) == NULL) { + printf("HiChainGmOnRuest: cJSON_AddToObject fail\n"); + cJSON_Delete(msg); + return NULL; + } + + param = cJSON_PrintUnformatted(msg); + cJSON_Delete(msg); + return param; + } + + static const DeviceAuthCallback g_groupManagerCallback = { + .onRequest = HiChainGmOnRuest, + .onError = HiChainGmOnError, + .onFinish = HiChainGmOnFinish, + }; + + int HichainGmRegCallback(void) + { + return g_hichainGmInstance->regCallback(APP_ID, &g_groupManagerCallback); + } + + void HichainGmUnRegCallback(void) + { + g_hichainGmInstance->unRegCallback(APP_ID); + } + + int HichainGmGetGroupInfo(char **groupVec, uint32_t *num) + { + cJSON *msg = cJSON_CreateObject(); + char *param = NULL; + int ret = -1; + + if (msg == NULL) { + printf("HichainGmGetGroupInfo: cJSON_CreateObject fail\n"); + return -1; + } + + if (cJSON_AddNumberToObject(msg, FIELD_GROUP_TYPE, PEER_TO_PEER_GROUP) == NULL || + cJSON_AddStringToObject(msg, FIELD_GROUP_NAME, DEFAULT_GROUP_NAME) == NULL || + cJSON_AddNumberToObject(msg, FIELD_GROUP_VISIBILITY, GROUP_VISIBILITY_PUBLIC) == NULL) { + printf("HichainGmGetGroupInfo: cJSON_AddToObject fail\n"); + goto err_cJSON_Delete; + } + param = cJSON_PrintUnformatted(msg); + if (param == NULL) { + printf("HichainGmGetGroupInfo: cJSON_PrintUnformatted fail\n"); + goto err_cJSON_Delete; + } + + ret = g_hichainGmInstance->getGroupInfo(ANY_OS_ACCOUNT, APP_ID, param, groupVec, num); + if (ret != 0) { + printf("getGroupInfo fail:%d", ret); + goto err_getGroupInfo; + } + + err_getGroupInfo: + cJSON_free(param); + err_cJSON_Delete: + cJSON_Delete(msg); + return ret; + } + + void HichainGmDestroyGroupInfo(char **groupVec) + { + g_hichainGmInstance->destroyInfo(groupVec); + } + + int HichainGmCreatGroup(void) + { + cJSON *msg = cJSON_CreateObject(); + char *param = NULL; + int ret; + + if (msg == NULL) + return -1; + + if (cJSON_AddNumberToObject(msg, FIELD_GROUP_TYPE, PEER_TO_PEER_GROUP) == NULL || + cJSON_AddStringToObject(msg, FIELD_DEVICE_ID, g_udid) == NULL || + cJSON_AddStringToObject(msg, FIELD_GROUP_NAME, DEFAULT_GROUP_NAME) == NULL || + cJSON_AddNumberToObject(msg, FIELD_USER_TYPE, 0) == NULL || + cJSON_AddNumberToObject(msg, FIELD_GROUP_VISIBILITY, GROUP_VISIBILITY_PUBLIC) == NULL || + cJSON_AddNumberToObject(msg, FIELD_EXPIRE_TIME, EXPIRE_TIME_MAX) == NULL) { + printf("HichainGmCreatGroup: cJSON_AddToObject fail\n"); + cJSON_Delete(msg); + return -1; + } + param = cJSON_PrintUnformatted(msg); + if (param == NULL) { + printf("HichainGmCreatGroup: cJSON_PrintUnformatted fail\n"); + cJSON_Delete(msg); + return -1; + } + + ret = g_hichainGmInstance->createGroup(ANY_OS_ACCOUNT, g_requestId++, APP_ID, param); + + cJSON_free(param); + cJSON_Delete(msg); + return ret; + } + + bool HichainIsDeviceInGroup(const char *groupId, const char *devId) + { + return g_hichainGmInstance->isDeviceInGroup(ANY_OS_ACCOUNT, APP_ID, groupId, devId); + } + + int HichainGmAddMemberToGroup(const DeviceInfo *device, const char *groupId) + { + cJSON *msg = cJSON_CreateObject(); + cJSON *addr = NULL; + char *param = NULL; + int ret = -1; + + if (msg == NULL) { + printf("HichainGmAddMemberToGroup: cJSON_CreateObject1 fail\n"); + return -1; + } + + addr = cJSON_CreateObject(); + if (addr == NULL) { + printf("HichainGmAddMemberToGroup: cJSON_CreateObject2 fail\n"); + goto err_cJSON_CreateObject; + } + + for (unsigned int i = 0; i < device->addrNum; i++) { + if (device->addr[i].type == CONNECTION_ADDR_ETH) { + if (cJSON_AddStringToObject(addr, FIELD_ETH_IP, device->addr[i].info.ip.ip) == NULL || + cJSON_AddNumberToObject(addr, FIELD_ETH_PORT, device->addr[i].info.ip.port) == NULL) { + printf("HichainGmAddMemberToGroup: cJSON_AddToObject1 fail\n"); + goto err_cJSON_AddToObject; + } + } else if (device->addr[i].type == CONNECTION_ADDR_WLAN) { + if (cJSON_AddStringToObject(addr, FIELD_WLAN_IP, device->addr[i].info.ip.ip) == NULL || + cJSON_AddNumberToObject(addr, FIELD_WLAN_PORT, device->addr[i].info.ip.port) == NULL) { + printf("HichainGmAddMemberToGroup: cJSON_AddToObject2 fail\n"); + goto err_cJSON_AddToObject; + } + } else { + printf("unsupport connection type:%d\n", device->addr[i].type); + goto err_cJSON_AddToObject; + } + } + + param = cJSON_PrintUnformatted(addr); + if (param == NULL) { + printf("HichainGmAddMemberToGroup: cJSON_PrintUnformatted1 fail\n"); + goto err_cJSON_AddToObject; + } + + if (cJSON_AddStringToObject(msg, FIELD_GROUP_ID, groupId) == NULL || + cJSON_AddNumberToObject(msg, FIELD_GROUP_TYPE, PEER_TO_PEER_GROUP) == NULL || + cJSON_AddStringToObject(msg, FIELD_PIN_CODE, DEFAULT_PIN_CODE) == NULL || + cJSON_AddStringToObject(msg, FIELD_DEVICE_ID, g_udid) == NULL || + cJSON_AddStringToObject(msg, FIELD_GROUP_NAME, DEFAULT_GROUP_NAME) == NULL || + cJSON_AddBoolToObject(msg, FIELD_IS_ADMIN, false) == NULL || + cJSON_AddStringToObject(msg, FIELD_CONNECT_PARAMS, param) == NULL) { + printf("HichainGmAddMemberToGroup: cJSON_AddToObject4 fail\n"); + goto err_cJSON_AddToObject1; + } + + cJSON_free(param); + param = cJSON_PrintUnformatted(msg); + if (param == NULL) { + printf("HichainGmAddMemberToGroup: cJSON_PrintUnformatted fail\n"); + goto err_cJSON_CreateObject; + } + + ret = g_hichainGmInstance->addMemberToGroup(ANY_OS_ACCOUNT, g_requestId++, APP_ID, param); + if (ret != 0) { + printf("addMemberToGroup fail:%d\n", ret); + } + + err_cJSON_AddToObject1: + cJSON_free(param); + err_cJSON_AddToObject: + cJSON_Delete(addr); + err_cJSON_CreateObject: + cJSON_Delete(msg); + return ret; + } + + int HichainInit(void) + { + char *groupVec = NULL; + uint32_t num; + int ret; + + ret = GetDevUdid(g_udid, MAX_UDID_LEN); + if (ret) { + printf("GetDevUdid fail:%d\n", ret); + return ret; + } + + ret = InitDeviceAuthService(); + if (ret != 0) { + printf("InitDeviceAuthService fail:%d\n", ret); + return ret; + } + + g_hichainGmInstance = GetGmInstance(); + if (g_hichainGmInstance == NULL) { + printf("GetGmInstance fail\n"); + ret = -1; + goto err_GetGmInstance; + } + + ret = HichainGmRegCallback(); + if (ret != 0) { + printf("HichainGmregCallback fail.:%d\n", ret); + goto err_HichainGmRegCallback; + } + + ret = HichainGmGetGroupInfo(&groupVec, &num); + if (ret != 0) { + printf("HichainGmGetGroupInfo fail:%d\n", ret); + goto err_HichainGmGetGroupInfo; + } + + if (num == 0) { + ret = HichainGmCreatGroup(); + if (ret) { + printf("HichainGmCreatGroup fail:%d\n", ret); + goto err_HichainGmCreatGroup; + } + } else { + printf("HichainGmGetGroupInfo:num=%u\n", num); + HichainSaveGroupID(groupVec); + HichainGmDestroyGroupInfo(&groupVec); + } + + return 0; + + err_HichainGmCreatGroup: + err_HichainGmGetGroupInfo: + HichainGmUnRegCallback(); + err_HichainGmRegCallback: + err_GetGmInstance: + DestroyDeviceAuthService(); + return ret; + } + +.. note:: + + * 在HichainInit完成后,可以在任意一端调用HichainGmAddMemberToGroup申请将本端设备添加到对端的群组中。 + + * 认证中使用的pin码,分别在两端设备中通过addMemberToGroup函数和HiChainGmOnRuest回调函数接口传入,实际应用中可由用户随机生成。 + + * HichainGmAddMemberToGroup认证过程中需要交互的对端信息,如deviceInfo,groupID等,实际应用中可通过软总线的发现能力和认证通道进行数据交互。 + +2.与OpenHarmony互联时,可通过上述方式创建双方信任的可信群组和成员,也可使用分布式硬件中的device manger模块进行更便捷的可信群组创建,该模块兼容OpenHarmony的pin码弹窗等功能,但需要openEuler额外支持。 + + +全量编译指导 +************** + +当用户有需求自定义修改软总线功能模块时,可使用全量编译方式构建软总线的各个子模块。 + +嵌入式版本提供的dsoftbus代码已集成于yocto构建系统,作为一个package存在,编译参照 :ref:`openeuler_embedded_oebuild` 章节。 + +用户也可按照镜像编译指导完成环境准备后按如下命令单独进行编译(和单独编译package方法一致) + +.. code-block:: console + + bitbake dsoftbus + +编译过程和结果遵循yocto构建策略,日志和生成物参考yocto bb文件和默认工作目录。 + + +限制约束 +************** + +1.支持wifi和有限的标准以太局域网下的coap设备发现和传输。蓝牙目前仅支持ble发现,ble发现需要开启蓝牙,参照 :ref:`bluetooth_config` ,br连接和通信功能在后续版本中持续支持。 diff --git a/docs/source/features/index.rst b/docs/source/features/index.rst index b1a05013d6be038ef2fa85b4436a3c3e92b820d2..03dc9cc341b437e1ecb9a82ab3fd6a3076a2a55a 100644 --- a/docs/source/features/index.rst +++ b/docs/source/features/index.rst @@ -10,6 +10,14 @@ software_package_description.rst mcs.rst - distributed_soft_bus.rst - raspberrypi.rst + lopper_devicetree.rst + ros.rst + muslc.rst + distributed_softbus.rst preempt_rt.rst + nativesdk.rst + rust.rst + qt5_wayland.rst + armnn.rst + clang_llvm.rst + jailhouse.rst diff --git a/docs/source/features/jailhouse.rst b/docs/source/features/jailhouse.rst new file mode 100644 index 0000000000000000000000000000000000000000..d1f032050bdc5830a383d2bbf093d42545d9000c --- /dev/null +++ b/docs/source/features/jailhouse.rst @@ -0,0 +1,127 @@ +轻量级虚拟化工具 Jailhouse +########################## + +总体介绍 +======== + + Jailhouse 是一种轻量级虚拟化工具,与传统的全功能虚拟化解决方案(如 KVM 和 Xen)不同,它不提供完整的虚拟机管理和抽象功能, + 而是一种基于Linux的静态分区虚拟化方案。Jailhouse 不支持任何设备模拟,不同客户虚拟机之间也不共享任何 CPU,所以也没有调度器。 + + Jailhouse 的工作是将硬件资源进行静态分区,每个分区称为一个 cell,每个 cell 之间是相互隔离开的,并且拥有自己的硬件资源(CPU、内存、外设等), + 运行在 cell 内的裸机应用程序或操作系统称为 inmate。 + Jailhouse 的第一个 cell 叫 Root Cell,这是一个特权Cell,内部运行的是一个 Linux 系统,依赖该 Linux 接管系统硬件资源,以及进行硬件的初始化和启动。 + 除了 Root Cell 的其它 cell 统一称为 Non-root Cell,从 Root Cell 中获取系统资源,可独占或与 Root Cell 共享。 + +____ + +Jailhouse 构建指导 +================== + + openEuler Embedded 目前支持在 qemu-arm64 和 RPI4 上运行 Jailhouse,默认集成到了 openeuler-image-mcs 镜像,构建方法可参考 :ref:`mcs镜像构建指导 `。 + +____ + +Jailhouse 使用指导 +================== + + Jailhouse 构建完成后,生成文件分为三部分: + + - Jailhouse 驱动和固件: ``jailhouse.ko, jailhouse.bin``,提供用户态接口并初始化 hypervisor; + - cell 和 guest 镜像:cell是镜像运行所需的系统资源的描述;guest镜像运行在cell内,包括裸机,RTOS等; + - 用户态工具 ``jailhouse``:负责加载cell,运行镜像,查看运行状态等。 + + openeuler-image-mcs 镜像中安装了可用的 cell 和 inmates-demo,下面以 ``qemu-arm64`` 为例,介绍 Jailhouse 的使用。 + + 1. 启动 QEMU + + .. code-block:: console + + qemu-system-aarch64 -machine virt,gic-version=3,virtualization=on,its=off \ + -cpu cortex-a57 -nographic -smp 4 -m 2G \ + -append "console=ttyAMA0 loglevel=8 mem=1G" \ + -kernel zImage \ + -initrd openeuler-image-mcs-qemu-aarch64-*.rootfs.cpio.gz + + 2. 初始化 Root Cell + + .. code-block:: console + + jailhouse enable /usr/share/jailhouse/cells/qemu-arm64-openeuler-demo.cell + + 3. 初始化 Non-root Cell + + .. code-block:: console + + jailhouse cell create /usr/share/jailhouse/cells/qemu-arm64-inmate-demo.cell + + 4. 加载 inmate + + .. code-block:: console + + jailhouse cell load 1 /usr/share/jailhouse/inmates/uart-demo.bin + jailhouse cell start 1 + + 之后可以看到 uart-demo 的打印: + + .. code-block:: console + + Started cell "inmate-demo" + ======= 0x0Hello 1 from cell! + Hello 2 from cell! + Hello 3 from cell! + Hello 4 from cell! + Hello 5 from cell! + Hello 6 from cell! + Hello 7 from cell! + ... ... + + .. note:: + + 树莓派4B上 Jailhouse 的使用方法与 QEMU 类似,但需要提前分配保留内存(openeuler-image-mcs 默认已保留了 0x10000000-0x20000000)。 + +____ + +使用 Jailhouse 运行 FreeRTOS +============================ + + 目前仅支持在 qemu-arm64 上通过 Jailhouse 运行 FreeRTOS。 + + 1. 添加 FreeRTOS 的构建 + + 根据 :ref:`mcs镜像构建指导 `,使用 oebuild 初始化编译环境。 + + .. code-block:: shell + + # qemu-arm64 + oebuild generate -p aarch64-std -f openeuler-mcs -d + + 进入 ```` 目录,添加 ``meta-freertos`` + + .. code-block:: shell + + # BBLAYERS 中添加 meta-freertos + vi conf/bblayers.conf + + BBLAYERS ?= " \ + ... ... + /usr1/openeuler/src/yocto-poky/../yocto-meta-openeuler/rtos/meta-freertos \ + " + + 2. 构建 jailhouse-freertos + + .. code-block:: shell + + oebuild bitbake jailhouse-freertos + + 3. 加载 FreeRTOS + + 构建完成后,oebuild 构建目录下可以获取 ``FreeRTOS.bin``,放到 qemu 上通过 Jailhouse 加载运行: + + .. code-block:: shell + + # 获取 FreeRTOS.bin + find . -name FreeRTOS.bin + + # 放到 qemu 上,通过 Jailhouse 加载运行 + jailhouse cell load 1 FreeRTOS.bin + jailhouse cell start 1 diff --git a/docs/source/features/lopper_devicetree.rst b/docs/source/features/lopper_devicetree.rst new file mode 100644 index 0000000000000000000000000000000000000000..075bc1bc37fe96d71467fbca719da8d1702e5acf --- /dev/null +++ b/docs/source/features/lopper_devicetree.rst @@ -0,0 +1,354 @@ +外设分区管理 +############ + +总体介绍 +======== + +受益于硬件技术的快速发展,先进封装技术带来了更高的集成度,一个片上系统(SoC)中能够封装各种丰富的外设组件, +为部署混合关键性系统提供了坚实的物理基础,但同时也带来了一个挑战:Linux、RTOS或其他操作系统在运行时有各自的资源访问需求, +需要能够直接访问 SoC 的不同部分,并排运行并且不会相互干扰。针对该场景,用户可以使用外设分区管理配置各OS需要的外设资源。 + +通过外设分区管理,能够在集成构建的过程中,根据用户的配置文件,对完整的设备树进行解析和操作,最终生成针对不同OS的设备树。 + +本章主要介绍如何基于yocto-meta-openeuler使用外设分区管理,以及如何编写自定义的配置文件。 + +____ + +如何使用外设分区管理 +==================== + +1. 在对应的BSP层添加 ``lopper-ops.bbappend`` 和 ``lops`` 文件夹,用于承载用户的配置文件。例如: + + .. code-block:: console + + . + └── meta-openeuler-bsp + └── recipes-kernel +    └── lopper +    ├── lopper-ops.bbappend +    └── lops +    └── lop-user-config.dts + + ``lopper-ops.bbappend`` 主要是将当前目录的lops文件夹传递给yocto,内容如下: + + .. code-block:: console + + $ cat lopper-ops.bbappend + # Use the operation files from current layer + FILESEXTRAPATHS_prepend := "${THISDIR}/:" + + ``lops`` 用于放置用户自定义的配置文件,这些配置文件统一用device-tree格式描述,但是有单独的语法, + 用于描述关于输入设备树的操作,包括:修改(删除)某个设备节点;添加自定义节点;提取部分节点并生成新的设备树等。 + 具体如何编写 ``lop-user-config.dts`` ,请参考下一小节。 + +2. 在使用设备树文件的配方中(假设为 ``foo-A.bb``),调用 lopper-devicetree.bbclass ,并配置输入和输出,如: + + .. code-block:: shell + + # foo-A.bb + inherit lopper-devicetree + INPUT_DT = "${B}/input-sample.dtb" + OUTPUT_DT = "${B}/output-sample.dtb" + + | **输入**:``input-sample.dtb``,完整的设备树。 + | **输出**:``output-sample.dtb``,处理后的设备树。此外,还会输出根据配置文件生成的RTOS侧设备树。 + | 即: + + .. code-block:: none + + ┌──────► output-sample.dtb -- for Linux + │ + │ + lop-user-config.dts │ + input-sample.dtb ──────────────────────┤ + │ + │ + │ + └──────► serial-for-zephyr.dts -- for zephyr + + 默认会通过 lopper-devicetree 中的 do_mkdts 完成设备树的处理,这个任务默认的依赖关系为 + ``before do_install after do_compile`` ,因此,用户可以在 ``do_install`` 中使用处理后的设备树 ``output-sample.dtb``。 + + 另外,用户可以通过配置文件生成RTOS侧的设备树,例如,指明提取某个 serial 节点,并生成 + ``serial-for-zephyr.dts`` ,经过处理后,这份 dts 默认会被安装到 ``foo-A`` 的 SYSROOT_DIR 中, + 因此,在其它的配方中(``foo-B.bb``)可以通过以下方法获取该 dts 文件: + + .. code-block:: shell + + # foo-B.bb + + # add dependence + DEPENDS += "foo-A" + + # get the serial-for-zephyr.dts + do_configure_append() { + cp ${WORKDIR}/recipe-sysroot/lop_dts/serial-for-zephyr.dts ${B}/ + } + +.. seealso:: + + yocto-meta-openeuler 中为树莓派添加了一个使用案例,将 ``serial@7e201a00`` 提取给zephyr使用, + 参考提交 `rpi4: extract a serial for zephyr `_。 + +____ + +如何编写外设分区配置文件 +======================== + +外设分区管理是基于开源工具 lopper 完成的,用户可以自定义配置文件(lopper operations),以实现设备树节点的修改、删除、提取等操作。 +关于 lopper operations 详细完整的语法配置,可以阅读学习 `lopper/README-architecture `_。 +下面,会介绍一些较为常用的功能接口。 + +**lopper operations 的格式**: + + lopper operations(lops) 的结构类似于标准的dts文件,设备树的根必须指定 ``compatible = "system-device-tree-v1,lop";``,以便识别为 lop 文件。 + 所有的操作都需要定义在 ``lops/lop_`` 中(number仅用于标识,lop的解析顺序是其出现在文件中的顺序)。 + + .. code-block:: none + + /dts-v1/; + + / { + compatible = "system-device-tree-v1"; + lops { + lop_ { + compatible = "system-device-tree-v1,lop,"; // compatible 注明 lop 的类型 + ; + }; + lop_ { + compatible = "system-device-tree-v1,lop,"; + ; + }; + }; + }; + +不同类型的 lop 有各自的 compatible 和 properties,包括: + +1. **modify** + + 用于修改指定路径的设备节点,包括修改property、添加property、删除或移动设备节点。 + + 对应的 compatible 为:``"system-device-tree-v1,lop,modify"`` + + 对应的 property 格式为:``modify = "::"`` + + 具体用法可参考: + + .. code-block:: shell + + // 重命名 /cpus_r5 节点为 /cpus + lop_1 { + compatible = "system-device-tree-v1,lop,modify"; + modify = "/cpus_r5/::/cpus/"; + }; + + // 删除 /cpus_r5 节点 + lop_2 { + compatible = "system-device-tree-v1,lop,modify"; + modify = "/cpus_r5/::"; + }; + + // 移动 /cpus_r5 节点到 /soc/cpus_r5 + lop_3 { + compatible = "system-device-tree-v1,lop,modify"; + modify = "/cpus_r5::/soc/cpus_r5"; + }; + + // 将 memory@800000000 中的 reg 修改为 modify_val 中的 reg + lop_4 { + compatible = "system-device-tree-v1,lop,modify"; + modify = "/memory@800000000:reg:&modify_val#reg"; + modify_val { + reg = <0x0 0x00000000 0x0 0x200000>; + }; + }; + + // 为 /soc/serial@7e201000 节点添加 my-prop = okay + lop_5 { + compatible = "system-device-tree-v1,lop,modify"; + modify = "/soc/serial@7e201000:my-prop:okay"; + }; + + // 修改 /soc/serial@7e201000 的 my-prop 为 disable + lop_6 { + compatible = "system-device-tree-v1,lop,modify"; + modify = "/soc/serial@7e201000:my-prop:disable"; + }; + +2. **node add** + + 添加节点,例如,添加 ``mcs@70000000`` 到 /reserved-memory/ 中: + + .. code-block:: shell + + lop_1 { + compatible = "system-device-tree-v1,lop,add"; + node_src = "mcs@70000000"; + node_dest = "/reserved-memory/"; + mcs@70000000 { + reg = <0x00 0x70000000 0x00 0x10000000>; + compatible = "mcs_mem"; + no-map; + }; + }; + +3. **output** + + 将指定的 nodes 输出到 output 中(源文件不会被修改),output 可以指定为 dts 也可以指定为 dtb,而且 nodes 支持正则匹配。 + + .. code-block:: shell + + // 将 "reserved-memory", "cpu1", "ipi1" 节点输出到 test.dtb + lop_1 { + compatible = "system-device-tree-v1,lop,output"; + outfile = "test.dtb"; + nodes = "reserved-memory", "cpu1", "ipi1"; + }; + + // 所有的节点都输出到 test.dtb + lop_2 { + compatible = "system-device-tree-v1,lop,output"; + outfile = "test.dtb"; + // * is "all nodes" + nodes = "*"; + }; + + // 所有 testprop 为 testvalue 的 axi 节点都输出到 test.dts + lop_3 { + compatible = "system-device-tree-v1,lop,output"; + outfile = "test.dts"; + nodes = "axi.*:testprop:testvalue"; + }; + +4. **select** + + select lop 通常用于选择一个满足 select_* 的节点。可以同时有多条 select 语句,并且这些 select 是全局的,在 lop_1 定义的 select,可以沿用到 lop_2 中。 + + select 的语法跟 modify 操作的语法相同:``select_* = "::"`` + + 示例一:选择满足 select_1 或满足 select_2 的节点,类似于 ``if (node1 || node2)`` : + + .. code-block:: shell + + // for node1 + select_1 = "/path/or/regex/to/nodes:prop:val"; + + // for node2 + select_2 = "/path/or/2nd/node/regex:prop2:val2"; + + 示例二:选择同时满足 select_1 和 select_2 的节点,类似于 ``if (node1.prop1.val1 && node1.prop2.val2)`` : + + .. code-block:: shell + + // for node1.prop1.val1 + select_1 = "/path/or/regex/to/nodes:prop1:val1"; + + // for node1.prop2.val2 + select_2 = ":prop2:val2"; + + 由于 select 是全局的,因此用法十分灵活,也略微复杂,一些用法示例: + + .. code-block:: shell + + lop_1 { + compatible = "system-device-tree-v1,lop,select-v1"; + // 清除前面选择的节点 + select_1; + // 选择 compatible 为 ".*arm,cortex-a72.*",并且 cpu-idle-states 为 3 的 cpu 节点 + select_2 = "/cpus/.*:compatible:.*arm,cortex-a72.*"; + select_3 = ":cpu-idle-states:3"; + }; + + lop_2 { + // modify 的 path 是空,所以对之前 select 的节点进行 modify 操作 + compatible = "system-device-tree-v1,lop,modify"; + modify = ":testprop:testvalue"; + }; + + lop_4 { + compatible = "system-device-tree-v1,lop,select-v1"; + // 清空之前的select + select_1; + // 选择 compatible 为 ".*arm,cortex-a72.*" 的 cpu 节点 + // 或 phy-handle 为 0x9 的 axi 节点 + select_2 = "/cpus/.*:compatible:.*arm,cortex-a72.*"; + select_3 = "/axi/.*:phy-handle:0x9"; + }; + +5. **cond** + + 可以在任意的 lop 中使用 cond 指定一个 select lop,并进行条件判断,若 select lop 为真,则 lop 会继续解析并执行;若 select lop 为假,则 lop 会被忽略。 + + .. code-block:: shell + + lops { + // 定义一个 select lop, + // 判断 device-tree 的 compatible 是否为 "raspberrypi,4-model-b\0brcm,bcm2711" + lop_1: lop_1 { + compatible = "system-device-tree-v1,lop,select-v1"; + select_1; + select_2 = "/:compatible:raspberrypi,4-model-b\0brcm,bcm2711"; + }; + + // 通过 cond 进行条件判断 + // 若 select 为真,则进行 modify 操作,删除 /soc/serial@7e201a00/ 节点 + lop_1_1: lop_1_1 { + lop_1_1_1 { + compatible = "system-device-tree-v1,lop,modify"; + cond = <&lop_1>; + modify = "/soc/serial@7e201a00/::"; + }; + }; + }; + +6. **tree** + + 可以通过 tree 指定一个 node 集,并且对该 node 集进行 modify,output 等操作。 + + modify 等 lop,默认会对输入的设备树文件进行操作,如果指定了 tree 就会在对应的 node 集中进行操作,如: + + .. code-block:: shell + + // 创建一棵 tree(test-tree),包含 nodes 中指定的节点 + lop_1 { + compatible = "system-device-tree-v1,lop,tree"; + tree = "test-tree"; + nodes = "reserved-memory", "cpu1", "ipi1"; + nodes = "reserved-memory", "zynqmp-rpu", "zynqmp_ipi1"; + }; + + // 针对 test-tree 做 modify + lop_2 { + compatible = "system-device-tree-v1,lop,modify"; + tree = "test-tree"; + modify = "/reserved-memory:#size-cells:3"; + }; + + // 针对 test-tree 进行 output 操作,输出 nodes 中指定的节点 + lop_3 { + compatible = "system-device-tree-v1,lop,output"; + tree = "test-tree"; + outfile = "output.dts"; + nodes = "reserved-memory"; + }; + +7. **print** + + print lop 可以用于增加调试打印,任何以 print 开头的property在被处理时,都会输出到 stdout。 + + .. code-block:: shell + + lop_1 { + compatible = "system-device-tree-v1,lop,print-v1"; + print = "print_test: print 1"; + print2 = "print_test: print2"; + }; + +.. note:: + + 应用示例: `rpi4: extract a serial for zephyr `_ + + 除本文介绍的接口外,lopper 还支持一些其它的 lops,比如 conditional, exec, code 等,还支持通过 assists 加载自定义的 python 代码进行 dts 的解析处理。 + + 更多用法探索,请阅读学习 `lopper/README-architecture `_。 + diff --git a/docs/source/features/mcs.rst b/docs/source/features/mcs.rst index 5344e1defb8fce9e96b21a288033ddded196a5db..c520c087478cd91c32ade293b75420eecc2333a5 100644 --- a/docs/source/features/mcs.rst +++ b/docs/source/features/mcs.rst @@ -1,11 +1,11 @@ .. _mixed_critical_system: -多OS混合部署框架 -################### +混合关键性系统 +############## -背景:混合关键性系统 -===================== +混合关键性系统特性介绍 +====================== 在嵌入式场景中,虽然Linux已经得到了广泛应用,但并不能覆盖所有需求,例如高实时、高可靠、高安全的场合。这些场合往往是实时操作系统 的用武之地。有些应用场景既需要Linux的管理能力、丰富的生态又需要实时操作系统的高实时、高可靠、高安全,那么一种典型的设计是采用一颗性能较 @@ -23,7 +23,7 @@ 面对上述硬件和应用的变化,结合自身原有的特点,嵌入式系统未来演进的方向之一就是 **混合关键性系统(MCS, Mixed Criticality System)**, 这可以从典型的 嵌入式系统-汽车电子的最近发展趋势略见一斑。 - .. figure:: ../../image/mcs_architecture.png + .. figure:: ../../image/mcs/mcs_architecture.png :align: center 图 1 openEuler Embedded中的混合关键性系统大致架构 @@ -54,7 +54,7 @@ Linux负责系统管理与服务、1个实时操作系统负责实时控制、1 openEuler Embedded中多OS混合部署框架的架构图如下所示,引入了开源框架 `OpenAMP `_ 作为基础, 并结合自身需要 进一步创新。 - .. figure:: ../../image/openamp_architecture.png + .. figure:: ../../image/mcs/openamp_architecture.png :align: center 图 2 多OS混合部署框架的基础架构 @@ -62,18 +62,135 @@ openEuler Embedded中多OS混合部署框架的架构图如下所示,引入了 在上述架构中,libmetal提供屏蔽了不同系统实现的细节提供了统一的抽象,virtio queue相当于网络协议中的MAC层提供高效的底层通信机制,rpmsg相当于网络协议中的 传输层提供了基于端点(endpoint)与通道(channel)抽象的通信机制, remoteproc提供生命周期管理功能包括初始化、启动、暂停、结束等。 -在openEuler Embedded 22.03中,集成了OpenAMP相关支持并与openEuler的 `SIG Zephyr `_ 合作 -实现了openEuler Embedded与实时操作系统 `Zephyr `_ 在QEMU平台上的混合部署,具体可以参考 - -`多OS混合部署Demo `_ - -在此基础上,openEuler Embedded的混合部署框架还会继续演进,包括对接更多的实时操作系统,如国产开源实时操作系统 `RT-Thread `_,实现如下图所示的 +目前,混合部署框架不仅能在qemu上进行仿真验证,还支持在树莓派实际硬件上部署运行。未来,openEuler Embedded的混合部署框架还会继续演进,包括对接更多的实时操作系统,如国产开源实时操作系统 `RT-Thread `_,实现如下图所示的 多OS服务化部署并适时引入基于虚拟化技术的嵌入式弹性底座。 - .. figure:: ../../image/os_services.png + .. figure:: ../../image/mcs/os_services.png :align: center 图 3 多OS服务化部署架构 在上述多OS服务化部署架构中,openEuler Embedded是中心,主要对其他OS提供管理、网络、文件系统等通用服务,其他OS可以专注于其所擅长的领域提诸如实时控制、监控等服务,并通过shell、log和debug 等通道与Linux丰富而强大维测体对接从而简化开发工作。 + + +.. _mcs_build: + +构建指南 +======== + +openEuler Embedded 不仅支持混合关键性系统特性的单独构建,还实现了集成构建,能够使用同一套工具链一键式构建出包含linux, zephyr的部署镜像。 + +.. note:: 单独构建混合关键系统特性的方法请参考 `mcs 构建安装指导 `_ + +**集成构建指导** + +1. 根据 :ref:`oebuild快速构建 ` ,初始化oebuild工作目录; + + .. code-block:: shell + + oebuild init + cd + oebuild update + +2. 下载依赖代码: + + zephyr 的构建包含核心部分和外部 zephyr modules 部分,由于全部代码较大,需要从 `src-openEuler/zephyr `_ 中的百度网盘路径下载 zephyr_project_v3.2.0.tar.gz,并放在构建代码目录下的 zephyrproject 子目录中(对应oebuild工作目录的/src/zephyrproject): + + python3-pykwalify 在 openeuler 社区尚无相应的源码包,需要从上游下载 `Download pykwalify-1.8.0.tar.gz `_ ,并放在构建代码目录下的 python3-pykwalify 子目录中(对应oebuild工作目录的/src/python3-pykwalify) + +3. 进入oebuild工作目录,创建对应的编译配置文件,**mcs镜像需要添加** ``-f openeuler-mcs``: + + .. code-block:: shell + + # qemu-arm64 + oebuild generate -p aarch64-std -f openeuler-mcs -d + + # RPI4 + oebuild generate -p raspberrypi4-64 -f openeuler-mcs -d + +4. 进入 ```` 目录,编译 ``openeuler-image-mcs`` : + + .. code-block:: shell + + oebuild bitbake openeuler-image-mcs + +.. note:: + + **注意**:构建 openeuler-image-mcs 需要在 oebuild 初始化时添加 ``-f openeuler-mcs``。 + +使用方法 +======== + +目前混合关键性系统(mcs)支持在qemu-aarch64和树莓派上部署运行,部署mcs需要预留出必要的内存、CPU资源,并且还需要bios提供psci支持。 + +1.镜像启动 + - **对于树莓派:** + + 集成构建出来的 openeuler-image-mcs 已经通过 dt-overlay 等方式预留了相关资源,并且默认使用了支持psci的uefi引导固件。因此只需要根据 :ref:`openeuler-image-uefi启动使用指导 ` 进行镜像启动,再部署mcs即可。 + - **对于qemu:** + + 需要准备一份dtb文件,dtb文件的制作可参考 `配置dts预留出mcs_mem `_ ,并通过以下命令启动qemu: + + .. code-block:: console + + $ qemu-system-aarch64 -M virt,gic-version=3 -m 1G -cpu cortex-a57 -nographic -append 'maxcpus=3' -smp 4 -kernel zImage -initrd *.rootfs.cpio.gz -dtb qemu_mcs.dtb + +2.部署mcs + - **step1: 调整内核打印等级并插入内核模块** + + .. code-block:: console + + # 为了不影响shell的使用,先屏蔽内核打印: + $ echo "1 4 1 7" > /proc/sys/kernel/printk + + # 插入内核模块 + $ modprobe mcs_km.ko + + 插入内核模块后,可以通过 `cat /proc/iomem` 查看预留出来的 mcs_mem,如: + + .. code-block:: console + + qemu-aarch64 ~ # cat /proc/iomem + ... + 70000000-7fffffff : reserved + 70000000-7fffffff : mcs_mem + ... + + 若mcs_km.ko插入失败,可以通过dmesg看到对应的失败日志,可能的原因有:1.使用的交叉工具链与内核版本不匹配;2.未预留内存资源;3.使用的bios不支持psci + + - **step2: 运行rpmsg_main程序,启动client os** + + .. code-block:: console + + $ rpmsg_main -c [cpu_id] -t [target_binfile] -a [target_binaddress] + eg: + $ rpmsg_main -c 3 -t /firmware/zephyr-image.bin -a 0x7a000000 + + 若rpmsg_main成功运行,会有如下打印: + + .. code-block:: console + + qemu-aarch64 ~ # rpmsg_main -c 3 -t /firmware/zephyr-image.bin -a 0x7a000000 + ... + start client os + ... + pls open /dev/pts/1 to talk with client OS + pty_thread for uart is runnning + ... + + 此时, **按ctrl-c可以通知client os下线并退出rpmsg_main** ,下线后支持重复拉起。 + 也可以根据打印提示,通过 /dev/pts/1 与 client os 进行 shell 交互,例如: + + .. code-block:: console + + # 新建一个terminal,登录到运行环境 + $ ssh user@ip + + # 连接pts设备 + $ screen /dev/pts/1 + + # 敲回车后,可以打开client os的shell,对client os下发命令,例如 + uart:~$ help + uart:~$ kernel version + diff --git a/docs/source/features/muslc.rst b/docs/source/features/muslc.rst new file mode 100644 index 0000000000000000000000000000000000000000..27aaeddc96101f966953141dd7cdbaaeef07c665 --- /dev/null +++ b/docs/source/features/muslc.rst @@ -0,0 +1,479 @@ +.. _musl_libc: + +musl libc的支持 +################################ + +本章介绍使用musl libc构建openEuler Embedded。 + +musl libc的介绍 +---------------------------------------- + +musl libc是构建在Linux系统调用API之上的C标准库的实现,是一个轻量级libc库,用于嵌入式操作系统和移动设备。它包括在基本语言标准、POSIX和广泛认可的扩展中定义的接口。 + +meta-musl层介绍 +---------------------------------------- + +``meta-musl`` 层包含所有涉及musl libc的软件包的补丁,该层以叠加 ``*.bbappend`` 的形式,把musl libc相关修改到对应软件包上。对于后续软件包的适配可直接在meta-musl层中进行修改,更加利于后期管理和维护。 + +``meta-musl`` 层目录结构如下 + +.. code-block:: console + + tree -L 3 . + . + ├── conf + │   └── layer.conf + ├── recipes-connectivity + │   ├── iproute2 + │   │   ├── iproute2 + │   │ └── iproute2_%.bbappend + ├── recipes-core + │   ├── dsoftbus + │   │   ├── dsoftbus + │   │ └── dsoftbus_%.bbappend + ├── ...... + ├── ...... + └── ...... + +构建环境 +---------------------------------------- + +构建环境推荐:master + +构建环境指导:详见 :ref:`openeuler_embedded_oebuild` + +编译器构建指导:musl交叉工具链的生成可 `参考编译器构建指导 `_ + +qemu镜像的构建 +---------------------------------------- +1.构建环境示例 + +参考 :ref:`openeuler_embedded_oebuild` 初始化容器环境,生成配置文件时使用如下命令 + +.. code-block:: console + + oebuild generate -p aarch64-std -t /path/to/clang-llvm-15.0.3 -f musl + +键入 ``oebuild bitbake`` 进入容器环境后,拷贝musl-arm64架构GCC库至编译器目录 + +``/usr1/openeuler/native_gcc/`` 为oebuild默认挂载的编译器目录 + +.. code-block:: console + + sudo cp /path/aarch64-openeuler-linux-musl/* /usr1/openeuler/native_gcc/ + +.. attention:: + + 当前在容器里是没有musl-arm64的工具链,需要按照上面工具链的生成指导生成 + +2.构建命令 + +.. code-block:: console + + bitbake openeuler-image + +3.构建镜像生成目录示例 + +结果件默认生成在构建目录下的output目录下: + +.. code-block:: console + + /usr1/build/ouput + +镜像运行 `QEMU参考运行指导 `_ + + +树莓派镜像的构建 +---------------------------------------- +1.构建命令示例 + +.. code-block:: console + + oebuild generate -p raspberrypi4-64 -t /path/to/clang-llvm-15.0.3 -f musl + + sudo cp /path/aarch64-openeuler-linux-musl/* /usr1/openeuler/native_gcc/ + + bitbake openeuler-image + +2.构建镜像生成目录 + +结果件默认生成在构建目录下的output目录下: + +.. code-block:: console + + /usr1/build/ouput + +镜像运行 `树莓派参考运行指导 `_ + +musl与glibc性能对比测试 +---------------------------------------- +性能测试平台采用了主频为600Mhz的树莓派4B,测试集采用了libc-bench、coremark、lmbench、unixbench,以下为测试集简介: + +==================== =============================================================================================== +测试集 简介 +==================== =============================================================================================== +libc-bench musl 官方提供的测试集,用于时间和内存效率的测试,该测试集中比较了各种C/POSIX标准库函数的实现。 +coremark CoreMark是由EEMBC提出的基准测试程序, 是评测嵌入式芯片性能的最常用测试程序之一。 +lmbench lmbench 是个用于评价系统综合性能的多平台开源 benchmark,能够测试包括文档读写、 内存操作、进程创建销毁开销、网络等性能。 +unixbench unixbench是一个用于测试unix系统性能的工具。 +==================== =============================================================================================== + +libc-bench性能测试 +---------------------------------------- +1.执行时间测试 + +============================= ==================== ==================== ==================== +测试项 glibc执行时间(s) musl执行时间(s) 性能比 +============================= ==================== ==================== ==================== +b_malloc_sparse 0.133191926 0.155694333 -14% +b_malloc_bubble 0.132751351 0.160789685 -17% +b_malloc_tiny1 0.004129741 0.006242797 -34% +b_malloc_tiny2 0.003741592 0.004415814 -15% +b_malloc_big1 0.030093408 0.085103333 -65% +b_malloc_big2 0.026437222 0.059723722 -56% +b_malloc_thread_stress 0.057703185 0.191215629 -70% +b_malloc_thread_local 0.040528055 0.1589995 -75% +b_string_strstr(abcd) 0.022583204 0.033620482 -33% +b_string_strstr(azby) 0.022762333 0.052186926 -56% +b_string_strstr(ac) 0.023064741 0.034024092 -32% +b_string_strstr(aaac) 0.02253924 0.034291277 -34% +b_string_strstr(aaaaac) 0.024667129 0.038916833 -37% +b_string_memset 0.021160371 0.016245278 30% +b_string_strchr 0.028452092 0.044776333 -36% +b_string_strlen 0.01696987 0.025606074 -34% +b_pthread_createjoin_serial1 0.546294574 0.589207315 -7% +b_pthread_createjoin_serial2 0.518631648 0.443272055 17% +b_pthread_create_serial1 0.452602518 0.405491611 12% +b_pthread_uselesslock 0.167918796 0.151241092 11% +b_stdio_putcgetc 0.269504648 0.296806204 -9% +b_pthread_createjoin_minimal1 0.526583 0.565946184 -7% +b_pthread_createjoin_minimal2 0.455035314 0.490921982 -7% +============================= ==================== ==================== ==================== + +**备注** :性能比由 ``glibc执行时间/musl执行时间-1`` 计算得到。 + +2.内存占用测试 + +- 虚拟内存占用测试 + +============================= =================================== =================================== ===================================== +测试项 glibc(KB) musl(KB) glibc_virt/musl_virt +============================= =================================== =================================== ===================================== +b_malloc_sparse 38992 8480 4.60 +b_malloc_bubble 39364 156 252.33 +b_malloc_tiny1 688 32 21.50 +b_malloc_tiny2 688 628 1.10 +b_malloc_big1 160 24 6.67 +b_malloc_big2 80192 87404 0.92 +b_malloc_thread_stress 16808 52 323.23 +b_malloc_thread_local 16808 80 210.10 +b_string_strstr(abc) 160 16 10.00 +b_string_strstr(azby) 160 16 10.00 +b_string_strstr(ac) 160 16 10.00 +b_string_strstr(aaac) 160 16 10.00 +b_string_strstr(aaaaac) 160 16 10.00 +b_string_memset 160 16 10.00 +b_string_strchr 160 16 10.00 +b_string_strlen 160 16 10.00 +b_pthread_createjoin_serial1 8352 16 522.00 +b_pthread_createjoin_serial2 32928 16 2058.00 +b_pthread_create_serial1 20480820 50016 409.49 +b_pthread_uselesslock 8352 16 522.00 +b_stdio_putcgetc 160 16 10.00 +b_stdio_putcgetc_unlocked 160 16 10.00 +b_regex_compile 160 40 4.00 +b_regex_search 160 16 10.00 +b_regex_search 160 16 10.00 +b_pthread_createjoin_minimal1 8352 16 522.00 +b_pthread_createjoin_minimal2 41120 16 2570.00 +============================= =================================== =================================== ===================================== + +- 物理内存占用测试 + +============================= =================================== =================================== ===================================== +测试项 glibc(KB) musl(KB) glibc_res/musl_res +============================= =================================== =================================== ===================================== +b_malloc_sparse 38980 8480 4.60 +b_malloc_bubble 39240 92 426.52 +b_malloc_tiny1 568 32 17.75 +b_malloc_tiny2 568 604 0.94 +b_malloc_big1 32 24 1.33 +b_malloc_big2 8044 16072 0.50 +b_malloc_thread_stress 164 52 3.15 +b_malloc_thread_local 184 80 2.30 +b_string_strstr(abc) 20 16 1.25 +b_string_strstr(azby) 20 16 1.25 +b_string_strstr(ac) 20 16 1.25 +b_string_strstr(aaac) 20 16 1.25 +b_string_strstr(aaaaac) 20 16 1.25 +b_string_memset 20 16 1.25 +b_string_strchr 20 16 1.25 +b_string_strlen 20 16 1.25 +b_pthread_createjoin_serial1 28 16 1.75 +b_pthread_createjoin_serial2 68 16 4.25 +b_pthread_create_serial1 20724 10016 2.07 +b_pthread_uselesslock 28 16 1.75 +b_stdio_putcgetc 24 16 1.50 +b_stdio_putcgetc_unlocked 24 16 1.50 +b_regex_compile 32 28 1.14 +b_regex_search 32 16 2.00 +b_regex_search 84 16 5.25 +b_pthread_createjoin_minimal1 28 16 1.75 +b_pthread_createjoin_minimal2 76 16 4.75 +============================= =================================== =================================== ===================================== + +- 系统可回收内存测试 + +============================= =================================== =================================== ===================================== +测试项 glibc(KB) musl(KB) glibc_dirty/musl_dirty +============================= =================================== =================================== ===================================== +b_malloc_sparse 38976 8480 4.60 +b_malloc_bubble 39236 92 426.48 +b_malloc_tiny1 564 32 17.63 +b_malloc_tiny2 564 604 0.93 +b_malloc_big1 28 24 1.17 +b_malloc_big2 8040 13052 0.62 +b_malloc_thread_stress 160 52 3.08 +b_malloc_thread_local 180 80 2.25 +b_string_strstr(abc) 16 16 1.00 +b_string_strstr(azby) 16 16 1.00 +b_string_strstr(ac) 16 16 1.00 +b_string_strstr(aaac) 16 16 1.00 +b_string_strstr(aaaaac) 16 16 1.00 +b_string_memset 16 16 1.00 +b_string_strchr 16 16 1.00 +b_string_strlen 16 16 1.00 +b_pthread_createjoin_serial1 24 16 1.50 +b_pthread_createjoin_serial2 64 16 4.00 +b_pthread_create_serial1 20720 10016 2.07 +b_pthread_uselesslock 24 16 1.50 +b_stdio_putcgetc 20 16 1.25 +b_stdio_putcgetc_unlocked 20 16 1.25 +b_regex_compile 28 28 1.00 +b_regex_search 28 16 1.75 +b_regex_search 80 16 5.00 +b_pthread_createjoin_minimal1 24 16 1.50 +b_pthread_createjoin_minimal2 72 16 4.50 +============================= =================================== =================================== ===================================== + +coremark性能测试 +---------------------------------------- +1.单线程测试 + +- glibc测试结果 + +.. code-block:: console + + 2K performance run parameters for coremark. + CoreMark Size : 666 + Total ticks : 12256 + Total time (secs): 12.256000 + Iterations/Sec : 3263.707572 + Iterations : 40000 + Compiler version : GCC10.3.1 + Compiler flags : -O2 -DPERFORMANCE_RUN=1 -lrt + Memory location : Please put data memory location here + (e.g. code in flash, data on heap etc) + seedcrc : 0xe9f5 + [0]crclist : 0xe714 + [0]crcmatrix : 0x1fd7 + [0]crcstate : 0x8e3a + [0]crcfinal : 0x25b5 + Correct operation validated. See README.md for run and reporting rules. + CoreMark 1.0 : 3263.707572 / GCC10.3.1 -O2 -DPERFORMANCE_RUN=1 -lrt / Heap + +- musl测试结果 + +.. code-block:: console + + 2K performance run parameters for coremark. + CoreMark Size : 666 + Total ticks : 12333 + Total time (secs): 12.333000 + Iterations/Sec : 3243.330901 + Iterations : 40000 + Compiler version : GCC10.3.1 + Compiler flags : -O2 -DPERFORMANCE_RUN=1 -lrt + Memory location : Please put data memory location here + (e.g. code in flash, data on heap etc) + seedcrc : 0xe9f5 + [0]crclist : 0xe714 + [0]crcmatrix : 0x1fd7 + [0]crcstate : 0x8e3a + [0]crcfinal : 0x25b5 + Correct operation validated. See README.md for run and reporting rules. + CoreMark 1.0 : 3243.330901 / GCC10.3.1 -O2 -DPERFORMANCE_RUN=1 -lrt / Heap + +综上,得到glibc得分为 ``5.45 Coremark/Mhz`` ,musl得分为 ``5.41 Coremark/Mhz`` 。 + + +2.多线程测试 + +- glibc测试结果 + +.. code-block:: console + + 2K performance run parameters for coremark. + CoreMark Size : 666 + Total ticks : 12284 + Total time (secs): 12.284000 + Iterations/Sec : 13025.073266 + Iterations : 160000 + Compiler version : GCC10.3.1 + Compiler flags : -O2 -DMULTITHREAD=4 -DUSE_PTHREAD -DPERFORMANCE_RUN=1 -lrt + Parallel PThreads : 4 + Memory location : Please put data memory location here + (e.g. code in flash, data on heap etc) + seedcrc : 0xe9f5 + [0]crclist : 0xe714 + [1]crclist : 0xe714 + [2]crclist : 0xe714 + [3]crclist : 0xe714 + [0]crcmatrix : 0x1fd7 + [1]crcmatrix : 0x1fd7 + [2]crcmatrix : 0x1fd7 + [3]crcmatrix : 0x1fd7 + [0]crcstate : 0x8e3a + [1]crcstate : 0x8e3a + [2]crcstate : 0x8e3a + [3]crcstate : 0x8e3a + [0]crcfinal : 0x25b5 + [1]crcfinal : 0x25b5 + [2]crcfinal : 0x25b5 + [3]crcfinal : 0x25b5 + Correct operation validated. See README.md for run and reporting rules. + CoreMark 1.0 : 13025.073266 / GCC10.3.1 -O2 -DMULTITHREAD=4 -DUSE_PTHREAD -DPERFORMANCE_RUN=1 -lrt / Heap / 4:PThreads + +- musl测试结果 + +.. code-block:: console + + 2K performance run parameters for coremark. + CoreMark Size : 666 + Total ticks : 12281 + Total time (secs): 12.281000 + Iterations/Sec : 13028.255028 + Iterations : 160000 + Compiler version : GCC10.3.1 + Compiler flags : -O2 -DMULTITHREAD=4 -DUSE_PTHREAD -DPERFORMANCE_RUN=1 -lrt + Parallel PThreads : 4 + Memory location : Please put data memory location here + (e.g. code in flash, data on heap etc) + seedcrc : 0xe9f5 + [0]crclist : 0xe714 + [1]crclist : 0xe714 + [2]crclist : 0xe714 + [3]crclist : 0xe714 + [0]crcmatrix : 0x1fd7 + [1]crcmatrix : 0x1fd7 + [2]crcmatrix : 0x1fd7 + [3]crcmatrix : 0x1fd7 + [0]crcstate : 0x8e3a + [1]crcstate : 0x8e3a + [2]crcstate : 0x8e3a + [3]crcstate : 0x8e3a + [0]crcfinal : 0x25b5 + [1]crcfinal : 0x25b5 + [2]crcfinal : 0x25b5 + [3]crcfinal : 0x25b5 + Correct operation validated. See README.md for run and reporting rules. + CoreMark 1.0 : 13028.255028 / GCC10.3.1 -O2 -DMULTITHREAD=4 -DUSE_PTHREAD -DPERFORMANCE_RUN=1 -lrt / Heap / 4:PThreads + +综上,得到glibc得分为 ``21.74 Coremark/Mhz`` ,musl得分为 ``21.75 Coremark/Mhz`` 。 + +lmbench OS性能测试 +---------------------------------------- +1.处理器进程操作时间(微秒) + +============= =============== ================ ============== +测试项 glibc musl 性能差异 +============= =============== ================ ============== +null call 4.19 4.36 -3.90% +null I/O 4.43 4.48 -1.12% +stat 12.8 13.1 -2.29% +open clos 29.6 29.3 1.02% +slct TCP 19.3 19.4 -0.52% +sig inst 6.2 6.6 -6.06% +sig hndl 24.8 24.4 1.64% +fork proc 645 488 32.17% +exec proc 765 580 31.90% +sh proc 4899 2212 121.47% +============= =============== ================ ============== + +2.上下文切换时间(微秒) + +============= =============== ================ ============== +测试项 glibc musl 性能差异 +============= =============== ================ ============== +2p/0K ctxsw 24.9 23.3 6.87% +2p/16K ctxsw 23.8 24.2 -1.65% +2p/64K ctxsw 24.2 20.7 16.91% +8p/16K ctxsw 28.3 24.3 16.46% +8p/64K ctxsw 27.6 26.6 3.76% +16p/16K ctxsw 28.2 26.6 6.02% +16p/64K ctxsw 37.9 36 5.28% +============= =============== ================ ============== + +3.本地管道通信延迟(微秒) + +============= =============== ================ ============== +测试项 glibc musl 性能差异 +============= =============== ================ ============== +Pipe 84.3 81.2 3.82% +AF UNIX 81.9 71.7 14.23% +UDP 144.6 133.7 8.15% +TCP 199.1 196.1 1.53% +TCP conn 556 556 0.00% +============= =============== ================ ============== + +4.文件延迟(微秒) + +=============== =============== ================ ============== +测试项 glibc musl 性能差异 +=============== =============== ================ ============== +0K File Create 52.4 52.6 -0.38% +0K File Delete 37.1 37.5 -1.07% +10K File Create 106.5 104.1 2.31% +10K File Delete 59.8 60.7 -1.48% +Mmap Latency 21.8K 21.8K 0.00% +Prot Fault 3.325 3.342 -0.51% +Page Fault 1.7151 1.7067 0.49% +100fd selct 10.5 10.6 -0.94% +=============== =============== ================ ============== + +5.本地通信带宽(MB/s) + +=============== =============== ================ ============== +测试项 glibc musl 性能差异 +=============== =============== ================ ============== +Pipe 303 306 0.99% +AF UNIX 592 746 26.01% +TCP 373 425 13.94% +File reread 1028.7 1020.9 -0.76% +Mmap reread 2837.4 2837.6 0.01% +Bcopy (libc) 1637.4 1639.8 0.15% +Bcopy(hand) 1613 1635.1 1.37% +Mem read 2128 2124 -0.19% +Mem write 1681 1680 -0.06% +=============== =============== ================ ============== + +unixbench性能测试 +---------------------------------------- +====================================== =============== ================ ============== ================= ================= +测试项 musl glibc 基准线 musl对比基准线 glibc对比基准线 +====================================== =============== ================ ============== ================= ================= +Dhrystone 2 using register variables 4981154.2 lps 6244531.8 lps 116700.0 lps 426.8 535.1 +Double-Precision Whetstone 1059.1 MWIPS 1062.0 MWIPS 55.0 MWIPS 192.6 193.1 +Execl Throughput 1215.8 lps 653.9 lps 43.0 lps 282.7 152.1 +File Copy 1024 bufsize 2000 maxblocks 62370.8 KBps 59823.5 KBps 3960.0 KBps 157.5 151.1 +File Copy 256 bufsize 500 maxblocks 17242.5 KBps 16201.4 KBps 1655.0 KBps 104.2 97.9 +File Copy 4096 bufsize 8000 maxblocks 195350.9 KBps 191638.2 KBps 5800.0 KBps 336.8 330.4 +Pipe Throughput 58289.1 lps 58878.8 lps 12440.0 lps 46.9 47.3 +Pipe-based Context Switching 12190.6 lps 12742.8 lps 4000.0 lps 30.5 31.9 +Process Creation 1596.9 lps 1209.4 lps 126.0 lps 126.7 96 +Shell Scripts (1 concurrent) 1894.0 lpm 1516.3 lpm 42.4 lpm 446.7 357.6 +Shell Scripts (8 concurrent) 594.4 lpm 478.0 lpm 6.0 lpm 990.6 796.7 +System Call Overhead 46124.2 lps 46279.8 lps 15000.0 lpm 30.7 30.9 +====================================== =============== ================ ============== ================= ================= + +综上,基于glibc的树莓派系统跑分结果为 ``146.5`` ,基于muslc的树莓派系统跑分结果为 ``161.6`` 。 diff --git a/docs/source/features/nativesdk.rst b/docs/source/features/nativesdk.rst new file mode 100644 index 0000000000000000000000000000000000000000..891a8f4ed681603f7ae97b5a2ef362f6ed2cb6b5 --- /dev/null +++ b/docs/source/features/nativesdk.rst @@ -0,0 +1,56 @@ +nativesdk 特性 +********************** + +nativesdk 介绍 +#################### + +openEuler Embedded nativesdk 工具参考 Yocto 官方提供的 `buildtools `_ 的实现方式,将 openeuler-image 构建所需要的主机包以及依赖的部分 xxx-native 包通过 nativesdk-xxx 的方式构建了出来,并安装到 buildtools(nativesdk)中,以减少构建时间。 + +某种意义上来说,xxx-native 包即主机包,如执行 bitbake meson-native 时 Yocto 会下载上游源码编译出一个 meson 二进制和其他的文件等,而 nativesdk-meson 在 meson-native 的基础上提供了打包功能,将构建出来的文件打包成多个 rpm 包,如 nativesdk-meson-XXX.rpm, nativesdk-meson-dev-XXX.rpm 等,这样做的一个好处是可以共享,移动到另一个匹配的环境中也能使用,可用于避免重复构建 xxx-native 包,节省构建时间。 + +理论上所有的 native 包都可以部署到环境,但是有些包涉及到 Yocto 的底层配置(如pseudo-native),也有一些包不支持 nativesdk 构建,即便这些包没有加入到环境中,也可以减少大量的构建时间。 + +.. note:: + + 开发者可以在环境中直接安装编译所需要的包。举例说明,nativesdk-meson 与 meson 包功能是类似的,开发者可以直接通过包管理器或者其他方式安装 meson 包,但 nativesdk 包有个很大的优势,因为它是 Yocto 构建出来的,所以它的使用可以兼容 Yocto 构建,而通过一般的包管理器直接安装的包则不一定具备。 + + +开发指南 +################### + +openEuler 开发者在 nativesdk 工具兼容 yocto-meta-openeuler 上做了很多准备工作,如 autotools 类的适配,rpmdeps 的配置,meson 工具的使用等。openEuler Embedded nativesdk 的代码位于 `yocto-poky/nativesdk分支 `_ 上,社区开发者可根据需要自行构建 nativesdk 工具,如构建一个在 arm64 架构下使用的 nativesdk 工具。 + +示例:如何让 openeuler-image 构建使用 nativesdk 中的 bison 包。 + +**步骤1** + + 修改 yocto-poky/meta/recipes-core/meta/buildtools-extended-tarball.bb 文件,在 nativesdk 中加入 bison 包: + + .. code-block:: + + TOOLCHAIN_HOST_TASK += "nativesdk-bison" + + 接下来按照官方 `buildtools `_ 指导构建使用即可。 + + .. note:: + + 如果你没有把 nativesdk 工具安装在 /opt/buildtools/nativesdk/ 目录,则需要在构建时将 OPENEULER_NATIVESDK_SYSROOT 字节更改为你所安装 nativesdk 工具的目录(参考 conf/local.conf 写法)。 + +**步骤2** + + 尽管环境中已经存在了 bison 包,但是 Yocto 还是会去构建 bison-native 包,为了不再构建,需修改 meta-openeuler/conf/distro/include/openeuler_hosttools.inc 中 ASSUME_PROVIDED 与 HOSTTOOLS 变量,取消 bison-native 编译,使用环境中 bison 命令: + + .. code-block:: + + ASSUME_PROVIDED += "bison-native" + HOSTTOOLS += "bison" + + .. note:: + + | ASSUME_PROVIDED: 该字节字面意思是“假定提供”,作用是将对应的包不加入构建队列,即使依赖也不会构建该包; + | HOSTTOOLS: 该字节表示使用环境中的二进制命令。 + +存在的问题 +################## + +目前来说,nativesdk 的使用有一些不完善之处,一方面是构建时采用的包源码直接来自于上游而非 openEuler,这一点开发者正在进行改进;另一方面是兼容性问题,当前由于 poky/hardknott 分支使用的 glibc 版本是 2.33,使得嵌入式的 nativesdk 工具只能在主机C库版本低于 2.34 的版本使用,否则会有问题,这一点开发者正在进行攻克,一个方向是 Yocto 的 uninative 机制,但目前开发者对此的研究还不深入。 diff --git a/docs/source/features/preempt_rt.rst b/docs/source/features/preempt_rt.rst index 988f91cb1330d84a75d62110ae06f10151dbd98a..f1d13110443360b724e8d398fbd8d9bf169c3661 100644 --- a/docs/source/features/preempt_rt.rst +++ b/docs/source/features/preempt_rt.rst @@ -10,293 +10,239 @@ **实时性简介** -实时的诉求通常是事件的响应时间不能超过规定的期限,一个事件的最大响应时间应该是确定的、可以预测的。 + 实时的诉求通常是事件的响应时间不能超过规定的期限,一个事件的最大响应时间应该是确定的、可以预测的。 **PREEMPT_RT补丁简介** -PREEMPT_RT补丁(以下简称RT补丁)可直接打在内核源码上,并通过内核配置选项 CONFIG_PREEMPT_RT=y 使能软实时功能。RT补丁实现的核心在于最小化内核中不可抢占部分的代码,从而使高优先级任务就绪时能及时抢占低优先级任务,减少切换时延。除此之外,补丁通过多种降低时延的措施,对锁、驱动等模块也进行了优化。 - -openEuler Embedded版本中可使用的RT补丁请参考: - -1. qemu: - - 1. `patch-5.10.0-60.10.0-rt62.patch `_ - - 2. `patch-5.10.0-60.10.0-rt62_openeuler_defconfig.patch `_ - -2. raspberrypi: - - 1. `0000-raspberrypi-kernel.patch (树莓派补丁) `_ - - 2. `0001-add-preemptRT-patch.patch `_ - - 3. `0002-modifty-bcm2711_defconfig-for-rt-rpi-kernel.patch `_ + PREEMPT_RT补丁(以下简称RT补丁)可直接打在内核源码上,并通过内核配置选项 CONFIG_PREEMPT_RT=y 使能软实时功能。RT补丁实现的核心在于最小化内核中不可抢占部分的代码,从而使高优先级任务就绪时能及时抢占低优先级任务,减少切换时延。除此之外,补丁通过多种降低时延的措施,对锁、驱动等模块也进行了优化。 **补丁关键功能举例** -1. 增加中断程序的可抢占性(中断线程化、软中断线程化) - -2. 增加临界区的可抢占性(如自旋锁) + - 增加中断程序的可抢占性(中断线程化、软中断线程化) + - 增加临界区的可抢占性(如自旋锁) + - 增加关中断代码的可抢占性 + - 解决优先级反转问题(优先级继承) -3. 增加关中断代码的可抢占性 - -4. 解决优先级反转问题(优先级继承) +____ 软实时镜像构建指导 ****************** -具体下载源码和编译流程建议参考:`容器环境下的快速构建指导 `_ - -**qemu RT镜像构建方式** +1. 根据 :ref:`oebuild快速构建 ` ,初始化oebuild工作目录; -- 步骤: + .. code-block:: shell -下载源码 --> 修改bb文件打入RT补丁 --> 手动打开CONFIG_PREEMPT_RT --> 编译构建 + oebuild init + cd + oebuild update -- 更改aarch64镜像内核bb文件,使其构建时自动打入RT补丁,示例: +2. 进入oebuild工作目录,创建对应的编译配置文件,软实时镜像需要添加 ``-f openeuler-rt``: -.. code-block:: console + .. code-block:: shell - cd /usr1/openeuler/src/yocto-meta-openeuler/meta-openeuler/recipes-kernel/linux/ + # arm64 + oebuild generate -p aarch64-std -f openeuler-rt -d - sed -i '/0001-arm64-add-zImage/a\ file://src-kernel-5.10/patch-5.10.0-60.10.0-rt62.patch \\' linux-openeuler.bb + # RPI4 + oebuild generate -p raspberrypi4-64 -f openeuler-rt -d - sed -i '/patch-5.10.0-60.10.0-rt62.patch/a\ file://src-kernel-5.10/patch-5.10.0-60.10.0-rt62_openeuler_defconfig.patch \\' linux-openeuler.bb + # x86 + oebuild generate -p x86-64-std -f openeuler-rt -d -git diff 输出示例: +3. 进入 ```` 目录,编译openeuler-image: -.. code-block:: console + .. code-block:: shell - diff --git a/meta-openeuler/recipes-kernel/linux/linux-openeuler.bb b/meta-openeuler/recipes-kernel/linux/linux-openeuler.bb - index 77d8717..5a4b2b8 100644 - --- a/meta-openeuler/recipes-kernel/linux/linux-openeuler.bb - +++ b/meta-openeuler/recipes-kernel/linux/linux-openeuler.bb - @@ -11,6 +11,8 @@ SRC_URI = "file://kernel-5.10 \ - # add patches only for aarch64 - SRC_URI_append_aarch64 += " \ - file://yocto-embedded-tools/patches/${ARCH}/0001-arm64-add-zImage-support-for-arm64.patch \ - + file://src-kernel-5.10/patch-5.10.0-60.10.0-rt62.patch \ - + file://src-kernel-5.10/patch-5.10.0-60.10.0-rt62_openeuler_defconfig.patch \ - " - - # add patches for OPENEULER_PLATFROM such as aarch64-pro + oebuild bitbake openeuler-image -- 打开aarch64镜像defconfig中的CONFIG_PREEMPT_RT,示例: + .. note:: -.. code-block:: console + 1. openEuler Embedded 软实时特性当前不支持 arm32 架构 - cd /usr1/openeuler/src/yocto-embedded-tools/config/arm64/ +____ - sed -i 's/CONFIG_PREEMPT=y/CONFIG_PREEMPT_RT=y/g' defconfig-kernel - -git diff 输出示例: - -.. code-block:: console - - diff --git a/config/arm64/defconfig-kernel b/config/arm64/defconfig-kernel - index dece4f7..c4ef7ab 100644 - --- a/config/arm64/defconfig-kernel - +++ b/config/arm64/defconfig-kernel - @@ -80,7 +80,7 @@ CONFIG_HIGH_RES_TIMERS=y - - # CONFIG_PREEMPT_NONE is not set - # CONFIG_PREEMPT_VOLUNTARY is not set - -CONFIG_PREEMPT=y - +CONFIG_PREEMPT_RT=y - CONFIG_PREEMPT_COUNT=y - CONFIG_PREEMPTION=y - - -- 编译时选择 aarch64-std 架构,示例: +验证软实时是否使能 +****************** -.. code-block:: console + 使能软实时特性后,系统会带有 ``PREEMPT_RT`` 字样,可以通过以下命令进行判断: - cd /usr1/openeuler/src/yocto-meta-openeuler/scripts + .. code-block:: shell - source compile.sh aarch64-std /usr1/build /usr1/openeuler/gcc/openeuler_gcc_arm64le + $ uname -a + Linux openeuler 5.10.0-rt62-v8 #1 SMP PREEMPT_RT Fri Mar 25 03:58:22 UTC 2022 aarch64 GNU/Linux - bitbake openeuler-image +____ -- 构建镜像生成目录: +软实时性能测试 +************** - :file:`/usr1/build/output/` +**软实时相关测试** -- 二进制介绍: +参考 `RT-Tests 指导 `_ 进行软实时相关测试,用例包括但不限于: + 1. cyclictest 时延性能测试 + 2. pi_stress 优先级继承测试 + 3. hackbench 负载构造工具 - 1. :file:`Image-5.10.0`: qemu RT内核镜像 +下面以cyclictest 时延性能测试为例进行说明。 - 2. :file:`openeuler-image-qemu-aarch64-<时间戳>.rootfs.cpio.gz`:qemu文件系统 +**cyclictest 时延性能测试** - 3. :file:`openeuler-glibc-x86-64-openeuler-image-aarch64-qemu-aarch64-toolchain-22.03.sh`: sdk工具链 + .. note:: + | **对于x86架构**: + | cyclictest工具依赖 ``libnuma.so`` ,而SDK中未提供该库,建议使用openEuler-Embedded构建容器(或其它x86环境)编译cyclictest,并将libnuma.so上传到环境的 ``/lib64/`` 目录。 + | + | **对于arm64架构**: + | 可以参考下述步骤,使用SDK进行交叉编译。 - 4. :file:`zImage`: qemu RT内核的压缩镜像 + 1. 准备开发环境 -**树莓派RT镜像构建方式** + 参考 :ref:`安装SDK ` -- 步骤: + .. code-block:: console -下载源码 --> 修改bb文件打入RT补丁(补丁已自动打开CONFIG_PREEMPT_RT) --> 编译构建 + sh openeuler-glibc-x86_64-openeuler-image-aarch64-qemu-aarch64-toolchain-22.03.sh -- 更改raspberrypi镜像内核bb文件,使其构建时自动打入RT补丁并打开CONFIG_PREEMPT_RT,示例: + . /path/to/sdk/environment-setup-aarch64-openeuler-linux -.. code-block:: console + 2. 编译用例 - cd /usr1/openeuler/src/yocto-meta-openeuler/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/ + .. code-block:: console - sed -i '/0000-raspberrypi-kernel.patch/a\ file://src-kernel-5.10/0001-add-preemptRT-patch.patch \\' linux-openeuler.bbappend + git clone https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git + cd rt-tests + git checkout stable/v1.0 + make all - sed -i '/0001-add-preemptRT-patch.patch/a\ file://src-kernel-5.10/0002-modifty-bcm2711_defconfig-for-rt-rpi-kernel.patch \\' linux-openeuler.bbappend + 3. 执行用例 -git diff 输出示例: + 编译完成后生成二进制 :file:`cyclictest`,传入单板环境后可查看执行cyclictest时可配置的参数: -.. code-block:: console + .. code-block:: console - diff --git a/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler.bbappend b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler.bbappend - index ad6ebab..cf52b3d 100644 - --- a/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler.bbappend - +++ b/bsp/meta-openeuler-bsp/raspberrypi/recipes-kernel/linux/linux-openeuler.bbappend - @@ -1,5 +1,7 @@ - SRC_URI += "\ - file://src-kernel-5.10/0000-raspberrypi-kernel.patch \ - + file://src-kernel-5.10/0001-add-preemptRT-patch.patch \ - + file://src-kernel-5.10/0002-modifty-bcm2711_defconfig-for-rt-rpi-kernel.patch \ - " - OPENEULER_KERNEL_CONFIG = "${S}/arch/${ARCH}/configs/bcm2711_defconfig" - do_configure_prepend() { + ./cyclictest --help -- 编译时选择 raspberrypi4-64 架构,示例: + cyclictest有多种参数配置方法,用例具体的入参设计可参考:`test-design `_ -.. code-block:: console + 输入示例: - cd /usr1/openeuler/src/yocto-meta-openeuler/scripts + .. code-block:: console - source compile.sh raspberrypi4-64 /usr1/build /usr1/openeuler/gcc/openeuler_gcc_arm64le + ./cyclictest -p 90 -m -i 100 -n -h 100 -l 10000000 - bitbake openeuler-image + 输出示例: -- 构建镜像生成目录: + .. code-block:: console - :file:`/usr1/build/output/` + # /dev/cpu_dma_latency set to 0us + policy: fifo: loadavg: 2.32 1.99 1.58 1/95 311 -- 二进制介绍: + T: 0 ( 311) P:90 I:100 C:10000000 Min: 7 Act: 9 Avg: 8 Max: 16 - 1. :file:`Image`: 树莓派RT内核镜像 + 即用例循环1000万次后,平均时延为8us,最坏时延为16us(该数据仅为示例,具体以环境实测为准)。 - 2. :file:`openeuler-image-raspberrypi4-64-<时间戳>.rootfs.rpi-sdimg`:树莓派RT支持SD卡镜像 + .. attention:: - 3. :file:`openeuler-glibc-x86-64-openeuler-image-cortexa72-raspberrypi4-64-toolchain-22.03.sh`: sdk工具链 + 如果树莓派4B的空载情况下,平均时延较差(如超过20us),可查看使用的树莓派固件是否将CPU频率配置为了节能模式,并根据需要将CPU频率配置为最高运行频率。如无cpufreq相关接口,则不涉及。 -树莓派4B的具体使用方法请参考:`树莓派4B的支持 `_ + 输入示例: -.. note:: + .. code-block:: console - 1. 如果开发人员使用的内核配置不是RT补丁中修改的defconfig(qemu::file:`arch/arm64/configs/openeuler_defconfig`,树莓派::file:`arch/arm64/configs/bcm2711_defconfig`),则需要在自己的defconfig中开启内核配置选项 CONFIG_PREEMPT_RT,例如上面qemu构建方式中的 yocto-embedded-tools/config/arm64/defconfig-kernel + cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor - 2. openEuler Embedded 软实时特性当前仅支持 arm64 架构 + 输出示例: -验证环境的软实时是否使能 -************************ + .. code-block:: console -- 查看系统是否有PREEMPT_RT字样: + powersave -输入示例: + 如上结果表示CPU频率为节能模式。 -.. code-block:: console + 配置CPU最高运行频率,输入示例: - uname -a + .. code-block:: console -输出示例: + echo performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor -.. code-block:: console +____ - Linux openeuler 5.10.0-rt62-v8 #1 SMP PREEMPT_RT Fri Mar 25 03:58:22 UTC 2022 aarch64 GNU/Linux +.. _realtime_tuning: -软实时性能测试 +软实时性能优化 ************** -**软实时相关测试** - -参考 `RT-Tests 指导 `_ 进行软实时相关测试,用例包括但不限于: - -1. cyclictest 时延性能测试 - -2. pi_stress 优先级继承测试 - -3. hackbench 负载构造工具 - -下面以cyclictest 时延性能测试为例进行说明。 - -**cyclictest 时延性能测试** - -1. 准备开发环境 - -参考 `安装SDK `_,准备编译环境,示例: - -.. code-block:: console - - sh openeuler-glibc-x86_64-openeuler-image-aarch64-qemu-aarch64-toolchain-22.03.sh - - . /path/to/sdk/environment-setup-aarch64-openeuler-linux - -2. 编译用例 - -.. code-block:: console - - git clone https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git - - cd rt-tests - - git checkout stable/v1.0 - - make all +性能优化的原则是:降低不确定性,提高可预期性。实时性能的优化是非常复杂的,涉及硬件底层架构特征、内核采用的机制策略,以及上层软件的编程设计等。以下介绍了x86平台的一些性能优化措施: -3. 执行用例 +- 调整BIOS配置: + 关闭 ``Hyper-Threading``, ``Intel SpeendStep``. -编译完成后生成二进制 :file:`cyclictest`,传入单板环境后可查看执行cyclictest时可配置的参数: +- 添加内核启动参数: -.. code-block:: console + .. list-table:: + :header-rows: 1 - ./cyclictest --help + * - Kernel Command Line + - Description -cyclictest有多种参数配置方法,用例具体的入参设计可参考:`test-design `_ + * - intel_pstate=disable + - 禁用intel调频 -输入示例: + * - nohalt idle=poll intel_idle.max_cstate=0 processor.max_cstate=1 + - 避免CPU陷入深层次的省电睡眠状态 -.. code-block:: console + * - nowatchdog + - 关闭softlockup和hardlockup - ./cyclictest -p 90 -m -i 100 -n -h 100 -l 10000000 + * - mce=ignore_ce + - 忽略mce -输出示例: + * - clocksource=tsc tsc=reliable + - 指定tsc作为系统clocksource -.. code-block:: console +- 修改虚拟内存统计周期: + ``sysctl -w vm.stat_interval=120`` - # /dev/cpu_dma_latency set to 0us - policy: fifo: loadavg: 2.32 1.99 1.58 1/95 311 +- 除了上述的针对系统全局的配置修改外,还可以为某些核进行单独配置: - T: 0 ( 311) P:90 I:100 C:10000000 Min: 7 Act: 9 Avg: 8 Max: 16 + .. list-table:: + :header-rows: 1 -即用例循环1000万次后,平均时延为8us,最坏时延为16us(该数据仅为示例,具体以环境实测为准)。 + * - Kernel Command Line + - Description -.. attention:: + * - isolcpus=,..., + - 避免普通任务在指定CPU上调度运行 - 如果树莓派4B的空载情况下,平均时延较差(如超过20us),可查看使用的树莓派固件是否将CPU频率配置为了节能模式,并根据需要将CPU频率配置为最高运行频率。如无cpufreq相关接口,则不涉及。 + * - nohz_full=,..., + - 关闭指定CPU的tick - 输入示例: + * - rcu_nocbs=,..., + - 卸载指定CPU的RCU回调任务 - .. code-block:: console + * - irqaffinity=,..., + - 配置中断亲缘性,默认由指定核处理中断 - cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor + 可以为某些核进行以上配置,再将实时任务进行绑核,以减少实时任务受到的干扰。例如: - 输出示例: + .. code-block:: shell - .. code-block:: console + Step1: + # 修改cmdline以隔离出cpu2及cpu3: + "isolcpus=2,3 nohz_full=2,3 rcu_nocbs=2,3 irqaffinity=0,1" - powersave + Step 2: + # 将实时任务绑定到2核或3核 + taskset -c 2 ./realtime_task1 + taskset -c 3 ./realtime_task2 - 如上结果表示CPU频率为节能模式。 + .. note:: + openEuler-Embedded 可以通过修改boot分区的 ``grub.cfg`` 配置内核启动参数,例如: - 配置CPU最高运行频率,输入示例: + .. code-block:: shell - .. code-block:: console + vi /run/media/sda1/efi/boot/grub.cfg - echo performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor + # cmdline 为 "rw quiet" + menuentry 'boot'{ + linux /bzImage root=PARTUUID=eaecae14-7021-4551-9183-29b0d210222f rw quiet + } diff --git a/docs/source/features/qt5_wayland.rst b/docs/source/features/qt5_wayland.rst new file mode 100644 index 0000000000000000000000000000000000000000..74b6852afe47e647f694e83393b1ba9571c5feb5 --- /dev/null +++ b/docs/source/features/qt5_wayland.rst @@ -0,0 +1,166 @@ +嵌入式图形支持 +**************** + +特性介绍 +############### + +**Qt5+Wayland 框架简介** + + 图形栈框架: + + .. figure:: ../../image/qt/wayland_frame.png + :align: center + +| Qt5: GUI 库,用于开发图形界面应用程序; +| Wayland: 狭义上讲只是一种显示协议, 可以不依赖于任何具体的 CPU/GPU 架构, 但具体的显示功能是由 Wayland Compositor 的实现而定。 +| OpenGL: Open Graphics Library,开放式图形库; +| KMS/DRM:底层图形显示驱动。 + +**openEuler Embedded 图形栈主要包** + +| wayland: 一个用于合成器(compositor)与客户端对话的协议,也是该协议的C库实现;合成器可以是运行在 Linux 内核模式设置和 evdev 输入设备上的独立显示服务器。客户端可以是传统应用程序、X服务器(无根或全屏)或其他显示服务器; +| weston: wayland 合成器的参考实现; +| qtwayland: 封装了 wayland 功能的 Qt5 模块,分为 client 与 server 端;客户端提供了运行 wayland 客户端 Qt 程序的方法,服务端提供了 Qt Wayland Compositor 应用程序接口,用户可用于创建自己的合成器(未实现); +| mesa:OpenGL API 的免费实现(一个用于渲染交互式3D图形的系统);mesa EGL 和 mesa vulkan 栈支持 wayland,许多 wayland 应用程序,都依赖于 EGL Wayland 平台; +| libdrm:基础用户态操作 DRM 运行库; +| libinput:转换 evdev 事件为 wayland 事件。 + +构建指南 +########### + +构建兼容了 meta-openeuler、poky/meta、meta-raspberrypi、meta-qt5、meta-openembedded 等层,目前只支持 systemd 的启动方式,支持在树梅派、rk3568平台构建,构建流程如下: + +.. code-block:: console + + # 树梅派构建 + $ oebuild -p raspberrypi4-64 -f systemd -f openeuler-qt -d ras-qt + # ok3568构建 + $ oebuild -p ok3568 -f systemd -f openeuler-qt -d ok3568-qt + # ryd-3568构建 + $ oebuild -p ryd-3568 -f systemd -f openeuler-qt -d ryd-3568-qt + + # 进入交互构建终端 + $ oebuild bitbake + + # 执行构建 + $ bitbake openeuler-image + # sdk构建 + $ bitbake openeuler-image -c populate_sdk + + +使用方法 +############# + +image 中集成了一些 demo 程序用于测试功能是否正常,如下: + +==================== =============================================================== +程序名 作用 +==================== =============================================================== +kmscube 测试驱动(kms/drm)功能,在普通窗口界面运行; +qt5-opengles2-test 测试 Qt5 OpenGL ES 2.0渲染; +helloworld-gui Qt5 helloworld 程序; +==================== =============================================================== + +在openEuler Embedded系统中运行 demo 程序。 + +普通窗口界面: + +.. code-block:: console + + # kmscube + # qt5-opengles2-test --platform eglfs + +weston 窗口界面: + +.. code-block:: console + + # qt5-opengles2-test --platform wayland + # helloworld-gui --platform wayland-egl + +qt5-opengles2-test --platform eglfs 执行效果图: + +.. figure:: ../../image/qt/qt5-opengles2-test.png + :align: center + +weston 执行效果图: + +.. figure:: ../../image/qt/weston.png + :align: center + +helloworld-gui --platform wayland 执行效果图: + +.. figure:: ../../image/qt/helloworld-gui_1.png + +.. figure:: ../../image/qt/helloworld-gui_2.png + :align: center + + +SDK 编译 qt 程序样例 +###################### + +1. **准备代码** + + qmake 运行时以硬编码的方式加入库路径,意味着 qmake 一旦生成很多变量就写死了,需要编写 qt.conf 文件放在 qmake 二进制的同级目录。 + + 编写 :file:`qt.conf` 文件,源码如下: + + .. code-block:: console + + [Paths] + prefix = xxx/sysroots/cortexa72-openeuler-linux + Headers = xxx/sysroots/cortexa72-openeuler-linux/usr/include + Libraries = xxx/sysroots/cortexa72-openeuler-linux/usr/lib64 + HostData = xxx/sysroots/cortexa72-openeuler-linux/usr/lib64 + Sysroot = xxx/sysroots/cortexa72-openeuler-linux + TargetSpec = linux-oe-g++ + + xxx 表示 SDK 所在目录的前缀。 + + 可通过 :file:`qt.conf` 设置 Binaries 字节来配置二进制所在路径,如 qttools 二进制所在路径为 /usr/lib/qt5/bin/,则 :file:`qt.conf` 新增如下行: + + .. code-block:: console + + Binaries = /usr/lib/qt5/bin + HostBinaries = /usr/lib/qt5/bin + + 编写 :file:`hello.cpp` 文件,源码如下: + + .. code-block:: cpp + + #include + #include + int main(int argc,char * argv[]) + { + QApplication app(argc,argv); + QLabel * label=new QLabel("

HelloQt!

"); + label->show(); + return app.exec(); + } + + 编写 :file:`hello.pro`,和 :file:`hello.cpp` 文件放在同一个目录;也可使用 qmake 命令自动生成 pro 文件,但需要手动补充部分内容,示例: + + .. code-block:: console + + $ qmake -project + +2. **编译生成二进制** + + 进入 :file:`hello.cpp` 所在目录,使用SDK编译,命令如下: + + .. code-block:: console + + $ qmake hello.pro + $ make + + 把编译好的 qt 程序拷贝到 openEuler Embedded 系统的 :file:`/tmp/` 某个目录下(例如 :file:`/tmp/myfiles/` )。如何拷贝可以参考前文所述共享文件系统场景。 + +3. **运行用户态程序** + + 在 openEuler Embedded 系统中运行 qt 程序。 + + .. code-block:: console + + # cd /tmp/myfiles/ + # ./hello --platform eglfs or wayland + + 如运行成功,则会输出"Hello Qt!"。 diff --git a/docs/source/features/ros.rst b/docs/source/features/ros.rst new file mode 100644 index 0000000000000000000000000000000000000000..22dc151569dca7602ab37f9e658ff71311063bd5 --- /dev/null +++ b/docs/source/features/ros.rst @@ -0,0 +1,339 @@ +.. _ros_runtime_embedded: + +嵌入式ROS运行时支持 +#################### + + +总体介绍 +========================== + +机器人尤其服务机器人领域近年来发展迅速,ROS是一个适用于机器人的开源的元操作系统,已在众多领域被广泛应用,常规ROS存在较多平台约束,大多与ubuntu等desktop版本强依赖。 + +随着ROS1开始广泛融入各领域无人系统的研发,陆续暴露了系统的诸多问题。为了适应新时代机器人研发的和操作系统生态发展的需要,ROS2应运而生。 + +为使能ROS2在高度定制化的嵌入式Linux运行,支持通过yocto构建的meta-ROS(原LG维护)layer层成为嵌入式ROS支持的关键途径。然而,当前原生meta-ros应用门槛较高且未充分考虑嵌入式运行时的关键场景要素。 + +openEuler Embedded的嵌入式ROS运行时支持意在提高易用性、解决高门槛问题的同时,构建嵌入式运行时竞争力(如实时、小型化等)。 + +框架 +========================= + +openEuler Embedded中ROS运行时整体架构图如下所示,分为运行视图和构建视图,构建视图总体基于开源meta-ros layer `meta-ros `_ 作为基础。 + + .. figure:: ../../image/ros/plan_ros_architecture.png + :align: center + + 图 1 openEuler Embedded中ROS运行时支持基础架构 + +其中, + +**meta-openuler层** 提供依赖解耦和嵌入式定制(针对编译类、观测类、仿真类等工具对onboard/运行时部署进行解耦),负责镜像快速集成和SDK工具的生成。 + +**ros2recipe模块** 提供了第三方ros源码到yocto配方的转换工具(不同于社区原生meta-ros生成工具superflore),作为meta-openeuler镜像快速集成的输入。 + +**快速开发SDK模块** 提供了第三方ros源码到运行时应用的交叉编译转化。 + +**运行时优化模块** 联通OS侧特性,链接混合关键部署等RTOS实时及总线能力,最终提供复杂系统的实时和通信解决方案。 + + +镜像构建指南 +============== + +openEuler Embedded 支持ROS运行时相关组件的单独构建和镜像集成构建案例。 + +**构建指导** + +使用oebuild进行构建即可,具体使用方式参照oebuild指导,构建qemu-ros参照如下命令: + + .. code-block:: console + + $ oebuild generate -p aarch64-std -f openeuler-ros -d aarch64-qemu-ros + $ oebuild bitbake + $ bitbake openeuler-image-ros + + +构建树莓派参照如下命令 + + .. code-block:: console + + $ oebuild generate -p raspberrypi4-64 -f openeuler-ros -d raspberrypi4-64-ros + $ oebuild bitbake + $ bitbake openeuler-image-ros + + +.. note:: 当前openeuler-image-ros镜像默认集成ros-core核心功能 + + 基于树莓派的openeuler-image-ros镜像还加入了SLAM典型功能 + (相关导航和制图典型场景功能正在完善中,欢迎试用和加入贡献) + + 另外按照嵌入式运行时原则,将尽量不在target集成编译类、观测类、仿真类等工具 + + | 注意: + | pcl点云库比较耗编译主机的内存资源,对该库进行了线程限制(-j 2),可参见对应pcl的bbappend配方 + | 另外,虽已限制在(-j 2),其编译所需的主机内存要求需大于等于14G(加上swap空间) + | 若您的编译主机配置足够,可解开(-j 2)限制 + | 参考: + | 在16线程32GB内存的机器解除限制后无法成功编译 + | 在24线程64GB内存的机器上测试可解除线程限制成功编译 + + +镜像使用示例 +============ + +以qemu-aarch64和originbot小车(树莓派作为主控板)为例: + +**1.QEMU多机部署和demo_nodes_cpp示例** + + - **step1: 部署两个QEMU机器** + + 在host中创建网桥br0 + + .. code-block:: console + + brctl addbr br0 + + 启动qemu1 + + .. code-block:: console + + qemu-system-aarch64 -M virt-4.0 -m 1G -cpu cortex-a57 -nographic -kernel zImage -initrd -device virtio-net-device,netdev=tap0,mac=52:54:00:12:34:56 -netdev bridge,id=tap0 + + .. attention:: + + 首次运行如果出现如下错误提示, + + .. code-block:: console + + failed to parse default acl file `/usr/local/libexec/../etc/qemu/bridge.conf' + qemu-system-aarch64: bridge helper failed + + 则需要向指示的文件添加"allow br0" + + .. code-block:: console + + echo "allow br0" > /usr/local/libexec/../etc/qemu/bridge.conf + + 启动qemu2 + + .. code-block:: console + + qemu-system-aarch64 -M virt-4.0 -m 1G -cpu cortex-a57 -nographic -kernel zImage -initrd openeuler-image-qemu-aarch64-2023xxx.rootfs.cpio.gz -device virtio-net-device,netdev=tap1,mac=52:54:00:12:34:78 -netdev bridge,id=tap1 + + .. attention:: + + qemu1与qemu2的mac地址需要配置为不同的值 + + + 配置IP + + 配置host的网桥地址 + + .. code-block:: console + + ifconfig br0 192.168.10.1 up + + 配置qemu1的网络地址 + + .. code-block:: console + + ifconfig eth0 192.168.10.2 + + 配置qemu2的网络地址 + + .. code-block:: console + + ifconfig eth0 192.168.10.3 + + - **step2: 分别在两个QEMU机器中运行demo_nodes_cpp发布和订阅** + + qemu1执行 + + .. code-block:: console + + # ROS环境变量初始化 + $ source /etc/profile.d/ros/setup.bash + + # demo消息订阅 + $ ros2 run demo_nodes_cpp listener + + qemu2执行 + + .. code-block:: console + + # ROS环境变量初始化 + $ source /etc/profile.d/ros/setup.bash + + # demo消息发布 + $ ros2 run demo_nodes_cpp talker + + .. note:: 单机通信同理,在同一台设备上通过多个终端分别执行demo_nodes_cpp发布和订阅即可,属于ROS常规用法,不再详述。 + + +**2.originbot小车制图和导航示例(树莓派作为主控板)** + + - **step1: originbot小车雷达USB、底盘驱动板串口完成连接** + + 以树莓派作为主控板为例,假如雷达使用USB串口且对应设备为ttyUSB0、底盘串口使用GPIO 14/15且对应ttyS0 + + .. note:: + + 以上串口设备为示例配置,雷达串口号和originbot底盘串口号用户可自行修改配置,配置文件位置例(直接修改即生效): + + /usr/share/originbot_base/launch/robot.launch.py + + /usr/share/originbot_bringup/param/ydlidar.yaml + + - **step2: 环境准备,并配置originbot小车和观测PC处于同一网段** + + 以树莓派作为主控板通过无线网络连接为例(可使用无线路由器或无线热点,需要小车和观测PC处于同一个网段) + + openEuler Embedded树莓派使能无线连接参见 :ref:`openEuler Embedded网络配置-Wi-Fi网络配置 ` + + .. note:: + 观测PC可为ubuntu,需要安装ROS和oringbot观测端,参见: + + `PC端ubuntu ros安装 `_ + + `PC端ubuntu oringbot安装 `_ + + - **step3: 通过观测PC,远程ssh登录originbot小车,执行运行时ROS应用** + + 以建图为例,整体过程和originbot官网过程一样,可参考 + + `originbot 启动底盘和雷达 `_ + + `originbot 启动SLAM `_ + + 首先,ssh登录originbot小车终端1,执行如下命令 + + .. code-block:: console + + # ROS环境变量初始化 + $ source /etc/profile.d/ros/setup.bash + # 启动机器人底盘和激光雷达: + $ ros2 launch originbot_bringup originbot.launch.py use_lidar:=true + + 然后,ssh登录originbot小车终端2,执行如下命令 + + .. code-block:: console + + # ROS环境变量初始化 + $ source /etc/profile.d/ros/setup.bash + # 启动cartographer建图算法: + $ ros2 launch originbot_navigation cartographer.launch.py + + + - **step4: 在观测端PC,启动上位机可视化软件以便查看SLAM的完整过程,同时启动上位机键盘控制远程小车** + + 整体过程和originbot官网过程一样,可参考 + + `originbot 上位机可视化显示 `_ + + `originbot 上位机键盘控制小车建图 `_ + + 首先,观测端PC开启一个终端,进入ROS环境后启动rviz观测软件 + + .. code-block:: console + + $ ros2 launch originbot_viz display_slam.launch.py + + 然后,观测端PC开启另一个终端,进入ROS环境后启动键盘控制节点用于控制小车,并按照提示控制小车完成建图 + + .. code-block:: console + + $ ros2 run teleop_twist_keyboard teleop_twist_keyboard + + - **step5: 保存运行时数据(建图数据等)** + + 以建图保存为例,整体过程和originbot官网过程一样,可参考 + + `originbot 保存地图 `_ + + 不要关闭之前步骤的端口,ssh登录originbot小车终端3,执行如下命令 + + .. code-block:: console + + # ROS环境变量初始化 + $ source /etc/profile.d/ros/setup.bash + # 保存地图: + $ ros2 run nav2_map_server map_saver_cli -f my_map --ros-args -p save_map_timeout:=10000 + + .. figure:: ../../image/ros/slam_demo1.png + :align: center + + .. figure:: ../../image/ros/slam_demo2.png + :align: center + + 图 2 openEuler Embedded中ROS SLAM DEMO示例 + + .. note:: 其他应用如导航类似,请直接参考orinbot官方资料。如 + + 自主导航,将建好的地图至于对应包位置即可,参见 `originbot 自主导航 `_ + + +如何开发和贡献 +================= + + - **1、关于ROS源码** + + 上游ROS发布的源码存放于github,对中国用户下载较慢,且src-openEuler社区针对ROS全量分包源码还在完善, + + 为加构建过程,嵌入式版本统一将ROS涉及的ROS软件包临时存放于yocto-embedded-tools仓库的dev_ros分支中,并遵循一定的源码存放规则,后续src-openeuler针对ROS分包支持后将对此部分进行优化。 + + **源码存放规则(暂行)** + + **仓库**:https://gitee.com/openeuler/yocto-embedded-tools.git + + **分支**:dev_ros + + **相对目录**:ros_depends + + **要求**: + + 按照yocto的包名作为文件夹名,单独存放tarball压缩包,例如ros_depends/tf2/0.13.12-1.tar.gz,并按要求填充src.txt配置文件,tarball的下载建议使用src_helper.sh脚本。 + + **src_helper.sh脚本说明** + + 当前目录中提供了src_helper.sh脚本,脚本会根据src.txt描述文件进行对应包名目录的创建并通过wget下载对应的包, + 该脚本用于开发者添加新源码包到该仓库时使用。 + + **src.txt说明** + + 若需要引入新的ROS标准包,开发者可追加ros.txt内容,并按如下规则: + + **第一列** 为yocto中包名 + + **第二列** 为该包在yocto中定义的工作目录,比如通常SRC_URI若为git链接,则需使用git。单包多压缩包目录可表示多行,可参见foonathan-memory + + **第三列** 为该包的上游获取地址,若为标准ROS包,开发者可从meta-ros对应distro的bb文件中通过"matches with"关键字获取到。 + + .. note:: 第一列和第二列的包名在yocto构建时将自动引用 + + 整个yocto-embedded-tool的dev_ros分支,在构建时会以新本地名字ros-dev-tools作为构建源码输入存在 + + 实现参见: openeuler_ros_source.bbclass + + - **2、关于ros2recipe** + + **现状:** + ros2recipe当前还处于前期开发阶段,在依赖解析部分还存在较多工作,其原理类似meta-ros的生成工具superflore。 + + **例子:** + 我们在yocto工程中集成了originbot ros第三方包,其基础bb配方是通过ros2recipe工具转化,但目前还需要增加bbappend文件来适配部分依赖。 + + **其他说明:** + superfores能够实现以一个ROS版本生成全量官方ROS组件包,需要对整体ROS和oe层进行了复杂的依赖关联,但不支持将独立的第三方包转换为yocto配方。 + + 针对该场景,ros2recipe如何能够更好更快的补全依赖关系和减少手工bbappend的适配,是一个很有挑战工作,我们会逐步完善,在此也期待您的贡献。 + + **使用方法** + + .. code-block:: console + + yocto-meta-openeuler/scripts/ros2recipe.sh + + .. note:: 其中相对目录的使用原理,请参考并理解“关于ROS源码” + + - **3、关于快速开发SDK** + + 暂未发布,敬请期待,同时欢迎您的参与 diff --git a/docs/source/features/rust.rst b/docs/source/features/rust.rst new file mode 100644 index 0000000000000000000000000000000000000000..c557d57dac75a7864aa283020613cea8f48ecf44 --- /dev/null +++ b/docs/source/features/rust.rst @@ -0,0 +1,86 @@ +.. _rust: + +支持Rust工具链 +###################################### + +本章介绍OpenEuler Embedded中对于Rust工具链的支持。 + +为什么选择Rust +--------------------- +1. **运行效率**:Rust类似C++,提供了零开销抽象、可以深入底层进行优化的能力。因此Rust的运行效率可以达到C++同一级别,高于Go等需要GC的语言。 +#. **内存安全性**:Rust提供了一套基于借用、生命周期等语法用于防止发生内存不安全的行为,编译器会在编译时期就帮助程序员避免大多数错误。 +#. **更好的包管理工具**:Rust提供了Cargo工具用于管理Rust项目的构建、下载依赖与分发等。 + +OpenEuler Embedded对于Rust工具链的支持 +---------------------------------------- +目前OpenEuler Embedded中的Rust工具链主要包含以下组件: + +1. ``cargo.bbclass`` :用于提供yocto构建Rust项目的支持。``cargo.bbclass`` 定义了一系列Task用于构建基于Cargo工具组织的Rust项目,同时也定义了一系列变量支持编译的自定义。Rust项目的recipe可以通过继承`cargo`类,定义一些标准变量就可以实现项目的构建与发布。 +#. ``rustc-bin-cross`` 与 ``cargo-bin-cross``:用于引入Rust编译器 ``rustc`` 和包管理工具 ``cargo`` 的recipe,目前是通过官方提供的预编译二进制包完成项目搭建。 +#. ``rust-demo``:定义了一个简单的Rust项目用于展示工具链的使用方法。 + +Rust工具链使用方法 +------------------- +首先新建一个recipe用于存放Rust项目的源代码。以下是一个简单的recipe文件内容: + +.. code-block:: console + + inherit cargo + SUMMARY = "Rust simple demo" + DESCRIPTION = "A demo using openeuler Rust toolchain" + LICENSE = "MIT" + LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + + SRC_URI = "file://demo-src" + S = "${WORKDIR}/demo-src" + SRCREV = "${AUTOREV}" + +首先最重要的是recipe需要继承cargo类 ``inherit cargo`` 这样项目就可以使用Rust工具链去构建安装。之后可以设置yocto常用的变量。 + +Rust项目应该通过cargo工具进行管理,源代码目录应该遵循以下目录结构: + +.. code-block:: console + +demo-src + ├── Cargo.toml + + └── src + └── main.rs + +需要将项目的源文件目录 ``S`` 设置在Rust项目 ``Cargo.toml`` 所在目录,否则会报告无法找到 ``Cargo.toml`` 的错误。需要注意:本例通过 ``file`` 的方式进行fetch,所以将 ``S`` 变量设置为fetch后的文件夹目录。如果你使用git方式去fetch源文件,则需要修改 ``S`` 为 ``${WORKDIR}/git`` (fetch参数默认时)。 + +如果Rust项目需要通过 ``crate-io`` 拉取依赖项, ``CARGO_CRATES_SOURCE`` 变量提供了一个配置crates替换源的方法,需要设该变量为一个非空值,通过配置该变量的flag进行镜像源的配置,具体可以参考 `Cargo源配置 `_。下面是使用 `TUNA镜像 `_ 需要增加的配置: + +.. code-block:: console + + CARGO_CRATES_SOURCE = "tuna" + CARGO_CRATES_SOURCE[registry] = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git" + + +==================== =============================================================================================== +变量名 说明 +==================== =============================================================================================== +EXTRA_CARGO_FLAGS 额外的传递给 ``cargo`` 的flag +EXTRA_RUSTFLAGS 额外的传递给Rust编译器的flag +CARGO_BUILD_TYPE 构建类型,应该为 ``"--release"`` 或 ``"--debug"`` +CARGO_FEATURES 一个空格划分的列表,代表需要启用的Cargo特性(详见 ``cargo build --feature ...`` 相关信息) +==================== =============================================================================================== + + +为什么没有使用OpenEuler生态中的Rust工具链 +--------------------------------------------- +目前OpenEuler源代码 `仓库 `_ 中提供了Rust工具链的源代码,OpenEuler发行版也支持安装 ``rustc`` 与 ``cargo`` 工具。但是因为以下原因没有使用: + +1. 完全从源代码构建Rust工具链是比较繁琐的。因为 ``rustc`` 还需要构建LLVM编译器后端,整个构建的中间文件可以达到10G级别的大小。参考 `面向嵌入式场景的构建系统Yocto应用与思考 `_ 中的构建原则,我们更倾向于使用已编译好的包进行构建。 +#. OpenEuler发行版可以安装Rust工具链,但是在x86平台下只能安装x86的 ``rust-std`` Rust标准库,如果需要进行交叉编译,还需要安装目标平台的Rust标准库,因此无法通过本机工具的方法构建 + +基于以上原因目前使用官方的预编译包。更好的解决办法是OpenEuler可以提供在x86安装不同平台的Rust标准库的方法,这样既能保证同源,也能减少从源码构建的复杂性。 + + +增加对于新版本Rust工具链的支持 +------------------------------ +如果需要升级Rust工具链,或是需要特定版本的Rust工具链,可以修改 ``cargo-bin-cross_${PV}.bb`` 和 ``rustc-bin-cross_${PV}.bb`` 为需要的版本,之后将两个bb文件中的安装包获取地址以及校验码更新即可适配新版本工具链。 + +鸣谢 +------- +本特性基于 `meta-rust-bin `_ 项目进行开发,遵守开源MIT协议。 diff --git a/docs/source/features/software_package_description-22.09.csv b/docs/source/features/software_package_description-22.09.csv new file mode 100644 index 0000000000000000000000000000000000000000..9bad6db5f038adf882fb46aba82d02cddd128cba --- /dev/null +++ b/docs/source/features/software_package_description-22.09.csv @@ -0,0 +1,337 @@ +软件名称,RPM名称,软件包名称,功能说明,详细情况,依赖关系 +acl,acl-2.3.1-r0.aarch64.rpm,acl,提供操纵访问控制列表的命令,提供操作程序控制列表的getfacl和setfacl程序。,libacl1 >= 2.3.1 libc6 >= 2.34+10.3.1 +acl,libacl1-2.3.1-r0.aarch64.rpm,libacl1,提供用于访问POSIX访问控制列表的动态库,提供libacl.so动态库,其中包含POSIX 1003.1e标准草案中用于操作访问控制列表的17个函数。,libattr1 >= 2.5.1 libc6 >= 2.34+10.3.1 +attr,attr-2.5.1-r0.aarch64.rpm,attr,用于管理文件系统扩展属性,一种在文件系统对象上操作扩展属性的工具集,特别是getfattr和setfattr工具。还提供了一个attr命令,它在很大程度上兼容使用同名的SGI IRIX工具。,libattr1 >= 2.5.1 libc6 >= 2.34+10.3.1 update-alternatives-opkg +attr,libattr1-2.5.1-r0.aarch64.rpm,libattr1,提供文件扩展属性支持的动态库,提供libattr.so动态库,其中包含扩展属性库函数。,libc6 >= 2.34+10.3.1 +audit,audispd-plugins-3.0.1-r0.aarch64.rpm,audispd-plugins,提供审计事件调度器的插件,为audit系统、audispd的实时接口的提供插件;此插件能够传达事件到远端及其或者为分析可疑行为的事件。, +audit,audit-3.0.1-r0.aarch64.rpm,audit,为审计提供用户空间工具,通过审计系统提供用户空间程序来存储和搜索审计记录生成。,libc6 >= 2.34+10.3.1 libcap-ng >= 0.8.2 +audit,auditd-3.0.1-r0.aarch64.rpm,auditd,提供audit的守护进程,,audit >= 3.0.1 libc6 >= 2.34+10.3.1 libcap-ng >= 0.8.2 +base-files,base-files-3.0.14-r89.qemu_aarch64.rpm,base-files,基础系统的杂项文件,创建基本的系统目录结构,并为系统提供一小组关键配置文件。, +base-passwd,base-passwd-3.5.29-r0.aarch64.rpm,base-passwd,基本系统主密码/组文件,用户数据库文件的主副本(/etc/passwd和/etc/group)。还提供了更新密码工具,以使系统数据库与这些主文件保持同步。, +bash,bash-5.1.8-r0.aarch64.rpm,bash,命令处理器,与sh兼容的命令解释器,从标准输入或文件中读取来执行命令,并结合了ksh和csh的有用功能。,base-files libc6 >= 2.34+10.3.1 libtinfo5 >= 6.3 update-alternatives-opkg +bind-dhclient,bind-dhclient-9.11.14-r0.aarch64.rpm,bind-dhclient,BIND DNS服务器,,base-files base-passwd bind-dhclient-libs >= 9.11.14 libc6 >= 2.34+10.3.1 libcap >= 2.61 libcrypto1.1 >= 1.1.1m shadow +bind-dhclient,bind-dhclient-libs-9.11.14-r0.aarch64.rpm,bind-dhclient-libs,BIND DNS包使用的库,,libc6 >= 2.34+10.3.1 libcap >= 2.61 libcrypto1.1 >= 1.1.1m +bind-dhclient,bind-dhclient-utils-9.11.14-r0.aarch64.rpm,bind-dhclient-utils,用于查询DNS名称服务器的实用程序,Bind utils包含一组实用程序,用于查询DNS(域名系统)名称服务器以查找有关Internet主机的信息。这些工具将为您提供给定主机名的IP地址,以及有关注册域和网络地址的其他信息。,bind-dhclient-libs >= 9.11.14 libc6 >= 2.34+10.3.1 libreadline8 >= 8.1 update-alternatives-opkg +binutils,libbfd-2.37-r0.aarch64.rpm,libbfd,二进制描述器,提供libbfd-2.37.so动态库。,libc6 >= 2.34+10.3.1 libz1 >= 1.2.11 +busybox,busybox-1.34.1-r0.aarch64.rpm,busybox,许多常见UNIX实用程序的微小版本组合,替代通常在filetuils、shellutils、findutils、textutils、grep、gzip、tar等中的实用程序,提供相当完整的POSIX小型或嵌入式系统环境。,busybox-inittab libc6 >= 2.34+10.3.1 libcrypt1 >= 1.0+10.3.1 libtirpc3 >= 1.3.2 update-alternatives-opkg +busybox,busybox-hwclock-1.34.1-r0.aarch64.rpm,busybox-hwclock,hardware clock,硬件(RTC)时钟,, +busybox,busybox-mdev-1.34.1-r0.aarch64.rpm,busybox-mdev,创建和管理 /dev 目录下的设备文件,包括初始化对象和动态更新,, +busybox,busybox-udhcpc-1.34.1-r0.aarch64.rpm,busybox-udhcpc,自动分配ip,并设置网卡IP,, +busybox-inittab,busybox-inittab-1.33.2-r0.qemu_aarch64.rpm,busybox-inittab,帮助init完成系统配置的主要文件,, +bzip2,libbz2-1-1.0.8-r0.aarch64.rpm,libbz2-1,bzip2运行时库,提供libbz2.so.1动态库。,libc6 >= 2.34+10.3.1 +cifs-utils,cifs-utils-6.14-r0.aarch64.rpm,cifs-utils,用于执行和管理Linu CIFS文件系统的挂载,包含用于执行和管理Linux CIFS文件系统挂载的使用程序。,libc6 >= 2.34+10.3.1 +cracklib,cracklib-2.9.7-r0.aarch64.rpm,cracklib,使用字典破解密码的库,测试密码以确定它们是否匹配一定的安全导向特性,可阻止用户选择太过简单的密码。,libc6 >= 2.34+10.3.1 libz1 >= 1.2.11 +cronie,cronie-1.5.7-r0.aarch64.rpm,cronie,用于周期性执行指令,提供cron的守护进程,cron用于在特定时间自动启动任务程序。,base-files base-passwd initd-functions libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-runtime pam-plugin-access pam-plugin-loginuid shadow +curl,curl-7.79.1-r0.aarch64.rpm,curl,用于从远端服务器获取文件,一个命令行工具,用于使用URL语法传输数据,支持多种协议和大量有用的技巧。,libc6 >= 2.34+10.3.1 libcurl4 >= 7.79.1 +curl,libcurl4-7.79.1-r0.aarch64.rpm,libcurl4,用于从URL传输数据的库,"curl共享库,用于使用不同的网络协议访问数据,",libc6 >= 2.34+10.3.1 libgnutls30 >= 3.7.2 libidn2-0 >= 2.3.2 libz1 >= 1.2.11 nettle >= 3.8.1 +dhcp,dhcp-client-4.4.2-r0.aarch64.rpm,dhcp-client,提供ISC DHCP客户端守护程序和dhclient脚本,,bind-dhclient-libs >= 9.11.14 dhcp-libs >= 4.4.2 libc6 >= 2.34+10.3.1 +dhcp,dhcp-libs-4.4.2-r0.aarch64.rpm,dhcp-libs,ISC DHCP服务端和客户端使用的共享库,提供ISC DHCP服务端和客户端使用的共享库。,libc6 >= 2.34+10.3.1 +dhcp,dhcp-omshell-4.4.2-r0.aarch64.rpm,dhcp-omshell,提供omshell程序,,bind-dhclient-libs >= 9.11.14 dhcp-libs >= 4.4.2 libc6 >= 2.34+10.3.1 +dhcp,dhcp-relay-4.4.2-r0.aarch64.rpm,dhcp-relay,提供ISC DHCP中继代理,,bind-dhclient-libs >= 9.11.14 dhcp-libs >= 4.4.2 libc6 >= 2.34+10.3.1 +dhcp,dhcp-server-4.4.2-r0.aarch64.rpm,dhcp-server,提供ISC DHCP服务端,提供DHCP服务端和dhcp守护进程。,base-files base-passwd bind-dhclient-libs >= 9.11.14 dhcp-libs >= 4.4.2 libc6 >= 2.34+10.3.1 shadow +dhcp,dhcp-server-config-4.4.2-r0.aarch64.rpm,dhcp-server-config,ISC DHCP服务端配置,提供默认的DHCP服务端和dhcp守护进程配置文件。, +dosfstools,dosfstools-4.2-r0.aarch64.rpm,dosfstools,用于创建和检查MS-DOS FAT文件系统,包含用于Linux中 创建和检查硬盘或软盘上的MS-DOS FAT文件系统的两个工具。,libc6 >= 2.34+10.3.1 update-alternatives-opkg +dsoftbus,dsoftbus-1.0-r1.aarch64.rpm,dsoftbus,软总线,,libc6 >= 2.34+10.3.1 libstdc++6 >= 10.3.1+10.3.1 +e2fsprogs,e2fsprogs-1.46.4-r0.aarch64.rpm,e2fsprogs,用于管理ext2、ext3和ext4文件系统,包含许多用于ext2、ext3和ext4文件系统中创建、检查、修改和纠正任何不一致的程序。,e2fsprogs-badblocks e2fsprogs-dumpe2fs libblkid1 >= 2.37.2 libc6 >= 2.34+10.3.1 libcom-err2 >= 1.46.4 libe2p2 >= 1.46.4 libext2fs2 >= 1.46.4 libss2 >= 1.46.4 libuuid1 >= 2.37.2 update-alternatives-opkg +e2fsprogs,e2fsprogs-badblocks-1.46.4-r0.aarch64.rpm,e2fsprogs-badblocks,用于检查磁盘装置中损坏的区块,提供badblocks命令,用于检查磁盘装置中损坏的区块。,libc6 >= 2.34+10.3.1 libcom-err2 >= 1.46.4 libext2fs2 >= 1.46.4 +e2fsprogs,e2fsprogs-dumpe2fs-1.46.4-r0.aarch64.rpm,e2fsprogs-dumpe2fs,用于查看格式化之后的文件系统信息,提供dumpe2fs命令,用于查看格式化之后的文件系统信息。,libblkid1 >= 2.37.2 libc6 >= 2.34+10.3.1 libcom-err2 >= 1.46.4 libe2p2 >= 1.46.4 libext2fs2 >= 1.46.4 +e2fsprogs,e2fsprogs-e2fsck-1.46.4-r0.aarch64.rpm,e2fsprogs-e2fsck,用于检查使用Linux ext2档案系统的partition,提供e2fsck命令,用于检查使用Linux ext2档案系统的partition是否正常工作。,libblkid1 >= 2.37.2 libc6 >= 2.34+10.3.1 libcom-err2 >= 1.46.4 libe2p2 >= 1.46.4 libext2fs2 >= 1.46.4 libuuid1 >= 2.37.2 +e2fsprogs,e2fsprogs-mke2fs-1.46.4-r0.aarch64.rpm,e2fsprogs-mke2fs,用于建立ext2文件系统,提供mke2fs.conf和mke2fs.e2fsprogs,mke2fs命令用于建立ext2文件系统。,libblkid1 >= 2.37.2 libc6 >= 2.34+10.3.1 libcom-err2 >= 1.46.4 libe2p2 >= 1.46.4 libext2fs2 >= 1.46.4 libuuid1 >= 2.37.2 update-alternatives-opkg +e2fsprogs,e2fsprogs-tune2fs-1.46.4-r0.aarch64.rpm,e2fsprogs-tune2fs,调整和查看ext2/ext3文件系统参数的命令行工具,"提供e2label、tune2fs.e2fsprogs命令,",libblkid1 >= 2.37.2 libc6 >= 2.34+10.3.1 libcom-err2 >= 1.46.4 libe2p2 >= 1.46.4 libext2fs2 >= 1.46.4 libuuid1 >= 2.37.2 update-alternatives-opkg +e2fsprogs,libcom-err2-1.46.4-r0.aarch64.rpm,libcom-err2,e2fsprogs报错库,一个错误信息显示库。,libc6 >= 2.34+10.3.1 +e2fsprogs,libe2p2-1.46.4-r0.aarch64.rpm,libe2p2,e2fsprogs共享库,提供libe2p.so.2和libe2p.so.2.3动态库。,libc6 >= 2.34+10.3.1 +e2fsprogs,libext2fs2-1.46.4-r0.aarch64.rpm,libext2fs2,e2fsprogs共享库,提供libext2fs2.so.2和libext2fs.2.4动态库。,libblkid1 >= 2.37.2 libc6 >= 2.34+10.3.1 libcom-err2 >= 1.46.4 +e2fsprogs,libss2-1.46.4-r0.aarch64.rpm,libss2,e2fsprogs共享库,提供libss.so.2和libss.so.2.0动态库。,libc6 >= 2.34+10.3.1 libcom-err2 >= 1.46.4 +elfutils,libasm1-0.187-r0.aarch64.rpm,libasm1,用于处理编译对象的实用程序和DSO集合,"提供libasm-0.185.so和libasm.so.1动态库,",libc6 >= 2.34+10.3.1 libdw1 >= 0.187 libelf1 >= 0.187 +elfutils,libelf1-0.187-r0.aarch64.rpm,libelf1,读写ELF文件的库,"提供libelf-0.185.so好libelf.so.1动态库,",libc6 >= 2.34+10.3.1 libelf1 >= 0.187 libz1 >= 1.2.11 +elfutils,libdw1-0.187-r0.aarch64.rpm,libdw1,访问DWARF调试信息的库,"提供libdw-0.185.so和libdw.so.1动态库,",libc6 >= 2.34+10.3.1 libz1 >= 1.2.11 +ethtool,ethtool-5.15-r0.aarch64.rpm,ethtool,以太网网卡的设置工具,允许在许多网络设备尤其是以太网设备中查询和更改设置,例如速度、端口、自动协商、PCI位置、校验和卸载。,libc6 >= 2.34+10.3.1 libmnl0 >= 1.0.4 +expat,libexpat1-2.4.8-r0.aarch64.rpm,libexpat1,XML解析器工具包,"提供libexpat.so.1好libexpat.so.1.8.1动态库,",libc6 >= 2.34+10.3.1 +expect,expect-5.45.4-r0.aarch64.rpm,expect,程序脚本交互和测试实用程序,Expect是一个tcl应用程序,用于自动化和测试交互式应用程序,如telnet、ftp、passwd、fsck、rlogin、tip等。Expect使脚本可以轻松控制另一个程序并与之交互。,libc6 >= 2.34+10.3.1 libtcl8.6-0 >= 8.6.12 tcl update-alternatives-opkg +gcc-runtime-external,libstdc++6-10.3.1+10.3.1-r0.aarch64.rpm,libstdc++6,GNU C++ 库,,glibc-external libgcc-s1 >= 10.3.1+10.3.1 +gdb,gdb-11.1-r0.aarch64.rpm,gdb,用于C、C++、Fortran和其他语言的GNU源代码级调试器,GDB是GNU调试器,允许您调试用C、C++、Java和其他语言编写的程序,方法是以受控的方式执行这些程序并打印它们的数据。,libc6 >= 2.34+10.3.1 libexpat1 >= 2.4.8 libgcc-s1 >= 10.3.1+10.3.1 libgmp10 >= 6.2.1 libreadline8 >= 8.1 libstdc++6 >= 10.3.1+10.3.1 libtinfo5 >= 6.3 +gdb,gdbserver-11.1-r0.aarch64.rpm,gdbserver,GDB(GNU源级调试器)的独立服务器,此软件包提供了一个程序,允许您在运行正在调试程序的计算机之外的计算机上运行GDB。openEuler Embedded 330 版本中,SDK中暂时不支持主机端交叉调试工具gdb,可以使用gdb-multiarch代替,一般都可以通过zypper/apt/yum 安装(openeuler镜像暂不支持)。,libc6 >= 2.34+10.3.1 libgcc-s1 >= 10.3.1+10.3.1 libstdc++6 >= 10.3.1+10.3.1 +glib-2.0,libglib-2.0-0-2.72.2-r0.aarch64.rpm,libglib-2.0-0,通用使用程序库,,libc6 >= 2.34+10.3.1 libffi8 >= 3.4.2 libpcre1 >= 8.45 libz1 >= 1.2.11 +glibc-external,ldconfig-2.34+10.3.1-r0.aarch64.rpm,ldconfig,提供ldconfig实用程序,, +glibc-external,libc6-2.34+10.3.1-r0.aarch64.rpm,libc6,GNU libc库,, +glibc-external,libthread-db1-2.34+10.3.1-r0.aarch64.rpm,libthread-db1,,,libc6 >= 2.34+10.3.1 +gmp,libgmp10-6.2.1-r0.aarch64.rpm,libgmp10,一个用于计算巨大数字的库,GMP是一个用于任意精度算术的库,对有符号整数、有理数和浮点数进行操作。,libc6 >= 2.34+10.3.1 +gnutls,libgnutls30-3.7.2-r0.aarch64.rpm,libgnutls30,GNU传输层安全库,GnuTLS库在可靠传输层上提供了一个安全层。目前,GnuTLS库实现了IETF TLS工作组提出的标准。,libc6 >= 2.34+10.3.1 libgmp10 >= 6.2.1 libidn2-0 >= 2.3.2 libunistring2 >= 0.9.10 nettle >= 3.8.1 +grep,grep-3.7-r0.aarch64.rpm,grep,用于打印与模式匹配的行,提供grep命令,用于在一个或多个输入文件中搜索包含匹配指定的模式,默认情况下,grep打印匹配的行。,libc6 >= 2.34+10.3.1 libpcre2 >= 10.39 update-alternatives-opkg +grub,grub-common-2.06-r0.aarch64.rpm,grub-common,grub2通用布局,这个包提供了各种GRUB2子包所需的一些目录。,grub-editenv libc6 >= 2.34+10.3.1 +grub,grub-editenv-2.06-r0.aarch64.rpm,grub-editenv,提供grub-editenv程序,,libc6 >= 2.34+10.3.1 +grub-bootconf,grub-bootconf-1.00-r0.qemu_aarch64.rpm,grub-bootconf,用于EFI系统的基本配置文件,, +grub-efi,grub-efi-2.06-r0.aarch64.rpm,grub-efi,支持EFI的bootloader,,grub-common virtual/grub-bootconf +gzip,gzip-1.12-r0.aarch64.rpm,gzip,GNU 数据压缩程序,包含GNU gzip数据压缩程序。,libc6 >= 2.34+10.3.1 update-alternatives-opkg +http-parser,libhttp-parser2.9-2.9.4-r0.aarch64.rpm,libhttp-parser2.9,解析http的库,,libc6 >= 2.34+10.3.1 +init-ifupdown,init-ifupdown-1.0-r7.qemu_aarch64.rpm,init-ifupdown,基本TCP/IP网络初始化脚本和配置文件,, os-base +init-system-helpers,init-system-helpers-service-debian+1.64-r0.aarch64.rpm,init-system-helpers-service,所有初始化系统的帮助工具,, +initscripts,initscripts-1.0-r155.aarch64.rpm,initscripts,提供System V初始化脚本的基本支持,提供System V初始化脚本的基本支持以及一些工具和实用程序。,55 init-system-helpers-service initd-functions +initscripts,initscripts-functions-1.0-r155.aarch64.rpm,initscripts-functions,shell公共函数,提供一些基础的功能。, +iproute2,iproute2-ip-5.15.0-r0.aarch64.rpm,iproute2-ip,提供iproute2程序,提供ip.iproute2工具。,libc6 >= 2.34+10.3.1 libcap >= 2.61 libelf1 >= 0.187 libmnl0 >= 1.0.4 update-alternatives-opkg +iptables,iptables-1.8.7-r0.aarch64.rpm,iptables,用于管理Linux内核包过滤功能的工具,在Linux内核中控制网络包过滤代码,用于设置防火墙或IP伪装。,iptables-module-xt-standard libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-ah-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-ah,提供libip6t_ah.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-dnat-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-dnat,提供libip6t_DNAT.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-dnpt-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-dnpt,提供libip6t_DNPT.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-dst-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-dst,提供libip6t_dst.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-eui64-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-eui64,提供libip6t_eui64.so动态库,,iptables >= 1.8.7 +iptables,iptables-module-ip6t-frag-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-frag,提供libip6t_frag.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-hbh-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-hbh,提供libip6t_hbh.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-hl-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-hl,提供libip6t_HL.so和libip6t_hl.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-icmp6-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-icmp6,提供libip6t_icmp6.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-ipv6header-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-ipv6header,提供libip6t_ipv6header.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-log-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-log,提供libip6t_LOG.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-masquerade-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-masquerade,提供libip6t_MASQUERADE.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-mh-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-mh,提供libip6t_mh.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-netmap-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-netmap,提供libip6t_NETMAP.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-redirect-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-redirect,提供libip6t_REDIRECT.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-reject-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-reject,提供libip6t_REJECT.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-rt-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-rt,提供libip6t_rt.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-snat-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-snat,提供libip6t_SNAT.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-snpt-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-snpt,提供libip6t_SNPT.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ip6t-srh-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-srh,提供libip6t_srh.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-ah-1.8.7-r0.aarch64.rpm,iptables-module-ipt-ah,提供libipt_ah.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-clusterip-1.8.7-r0.aarch64.rpm,iptables-module-ipt-clusterip,提供libipt_CLUSTERIP.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-dnat-1.8.7-r0.aarch64.rpm,iptables-module-ipt-dnat,提供libipt_DNAT.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-ecn-1.8.7-r0.aarch64.rpm,iptables-module-ipt-ecn,提供libipt_ECN.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-icmp-1.8.7-r0.aarch64.rpm,iptables-module-ipt-icmp,提供libipt_icmp.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-log-1.8.7-r0.aarch64.rpm,iptables-module-ipt-log,提供libipt_LOG.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-masquerade-1.8.7-r0.aarch64.rpm,iptables-module-ipt-masquerade,提供libipt_MASQUERADE.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-netmap-1.8.7-r0.aarch64.rpm,iptables-module-ipt-netmap,提供libipt_NETMAP.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-realm-1.8.7-r0.aarch64.rpm,iptables-module-ipt-realm,提供libipt_realm.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-redirect-1.8.7-r0.aarch64.rpm,iptables-module-ipt-redirect,提供libipt_REDIRECT.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-reject-1.8.7-r0.aarch64.rpm,iptables-module-ipt-reject,提供libipt_REJECT.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-snat-1.8.7-r0.aarch64.rpm,iptables-module-ipt-snat,提供libipt_SNAT.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-ttl-1.8.7-r0.aarch64.rpm,iptables-module-ipt-ttl,提供libipt_TTL.so和libipt_ttl.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-ipt-ulog-1.8.7-r0.aarch64.rpm,iptables-module-ipt-ulog,提供libipt_ULOG.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-addrtype-1.8.7-r0.aarch64.rpm,iptables-module-xt-addrtype,提供libxt_addrtype.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-audit-1.8.7-r0.aarch64.rpm,iptables-module-xt-audit,提供libxt_AUDIT.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-bpf-1.8.7-r0.aarch64.rpm,iptables-module-xt-bpf,提供libxt_bpf.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-cgroup-1.8.7-r0.aarch64.rpm,iptables-module-xt-cgroup,提供libxt_cgroup.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-checksum-1.8.7-r0.aarch64.rpm,iptables-module-xt-checksum,提供libxt_CHECKSUM.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-classify-1.8.7-r0.aarch64.rpm,iptables-module-xt-classify,提供libxt_CLASSIFY.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-cluster-1.8.7-r0.aarch64.rpm,iptables-module-xt-cluster,提供libxt_cluster.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-comment-1.8.7-r0.aarch64.rpm,iptables-module-xt-comment,提供libxt_comment.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-connbytes-1.8.7-r0.aarch64.rpm,iptables-module-xt-connbytes,提供libxt_connbytes.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-connlimit-1.8.7-r0.aarch64.rpm,iptables-module-xt-connlimit,提供libxt_connlimit.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-connmark-1.8.7-r0.aarch64.rpm,iptables-module-xt-connmark,提供libxt_CONNMARK.so和libxt_connmark.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-connsecmark-1.8.7-r0.aarch64.rpm,iptables-module-xt-connsecmark,提供libxt_CONNSECMARK.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-conntrack-1.8.7-r0.aarch64.rpm,iptables-module-xt-conntrack,提供libxt_conntrack.so和libxt_state.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-cpu-1.8.7-r0.aarch64.rpm,iptables-module-xt-cpu,提供libxt_cpu.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-ct-1.8.7-r0.aarch64.rpm,iptables-module-xt-ct,提供libxt_CT.so和libxt_NOTRACK.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-dccp-1.8.7-r0.aarch64.rpm,iptables-module-xt-dccp,提供libxt_dccp.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-devgroup-1.8.7-r0.aarch64.rpm,iptables-module-xt-devgroup,提供libxt_devgroup.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-dscp-1.8.7-r0.aarch64.rpm,iptables-module-xt-dscp,提供libxt_DSCP.so和libxt_dscp.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-ecn-1.8.7-r0.aarch64.rpm,iptables-module-xt-ecn,提供libxt_ecn.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-esp-1.8.7-r0.aarch64.rpm,iptables-module-xt-esp,提供libxt_esp.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-hashlimit-1.8.7-r0.aarch64.rpm,iptables-module-xt-hashlimit,提供ibxt_hashlimit.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-helper-1.8.7-r0.aarch64.rpm,iptables-module-xt-helper,提供libxt_helper.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-hmark-1.8.7-r0.aarch64.rpm,iptables-module-xt-hmark,提供libxt_HMARK.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-idletimer-1.8.7-r0.aarch64.rpm,iptables-module-xt-idletimer,提供libxt_IDLETIMER.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-ipcomp-1.8.7-r0.aarch64.rpm,iptables-module-xt-ipcomp,提供libxt_ipcomp.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-iprange-1.8.7-r0.aarch64.rpm,iptables-module-xt-iprange,提供libxt_iprange.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-ipvs-1.8.7-r0.aarch64.rpm,iptables-module-xt-ipvs,提供libxt_ipvs.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-led-1.8.7-r0.aarch64.rpm,iptables-module-xt-led,提供libxt_LED.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-length-1.8.7-r0.aarch64.rpm,iptables-module-xt-length,提供libxt_length.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-limit-1.8.7-r0.aarch64.rpm,iptables-module-xt-limit,提供libxt_limit.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-mac-1.8.7-r0.aarch64.rpm,iptables-module-xt-mac,提供libxt_mac.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-mark-1.8.7-r0.aarch64.rpm,iptables-module-xt-mark,提供libxt_MARK.so和libxt_mark.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-multiport-1.8.7-r0.aarch64.rpm,iptables-module-xt-multiport,提供libxt_multiport.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-nfacct-1.8.7-r0.aarch64.rpm,iptables-module-xt-nfacct,提供libxt_nfacct.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-nflog-1.8.7-r0.aarch64.rpm,iptables-module-xt-nflog,提供libxt_NFLOG.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-nfqueue-1.8.7-r0.aarch64.rpm,iptables-module-xt-nfqueue,提供libxt_NFQUEUE.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-osf-1.8.7-r0.aarch64.rpm,iptables-module-xt-osf,提供libxt_osf.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-owner-1.8.7-r0.aarch64.rpm,iptables-module-xt-owner,提供libxt_owner.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-physdev-1.8.7-r0.aarch64.rpm,iptables-module-xt-physdev,提供libxt_physdev.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-pkttype-1.8.7-r0.aarch64.rpm,iptables-module-xt-pkttype,提供libxt_pkttype.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-policy-1.8.7-r0.aarch64.rpm,iptables-module-xt-policy,提供libxt_policy.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-quota-1.8.7-r0.aarch64.rpm,iptables-module-xt-quota,提供libxt_quota.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-rateest-1.8.7-r0.aarch64.rpm,iptables-module-xt-rateest,提供libxt_RATEEST.so和libxt_rateest.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-recent-1.8.7-r0.aarch64.rpm,iptables-module-xt-recent,提供libxt_recent.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-rpfilter-1.8.7-r0.aarch64.rpm,iptables-module-xt-rpfilter,提供libxt_rpfilter.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-sctp-1.8.7-r0.aarch64.rpm,iptables-module-xt-sctp,提供libxt_sctp.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-secmark-1.8.7-r0.aarch64.rpm,iptables-module-xt-secmark,提供libxt_SECMARK.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-set-1.8.7-r0.aarch64.rpm,iptables-module-xt-set,提供libxt_SET.so和libxt_set.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-socket-1.8.7-r0.aarch64.rpm,iptables-module-xt-socket,提供libxt_socket.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-standard-1.8.7-r0.aarch64.rpm,iptables-module-xt-standard,提供libxt_standard.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-statistic-1.8.7-r0.aarch64.rpm,iptables-module-xt-statistic,提供libxt_statistic.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-string-1.8.7-r0.aarch64.rpm,iptables-module-xt-string,提供libxt_string.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-synproxy-1.8.7-r0.aarch64.rpm,iptables-module-xt-synproxy,提供libxt_SYNPROXY.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-tcp-1.8.7-r0.aarch64.rpm,iptables-module-xt-tcp,提供libxt_tcp.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-tcpmss-1.8.7-r0.aarch64.rpm,iptables-module-xt-tcpmss,提供libxt_TCPMSS.so和libxt_tcpmss.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-tcpoptstrip-1.8.7-r0.aarch64.rpm,iptables-module-xt-tcpoptstrip,提供libxt_TCPOPTSTRIP.so库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-tee-1.8.7-r0.aarch64.rpm,iptables-module-xt-tee,提供libxt_TEE.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-time-1.8.7-r0.aarch64.rpm,iptables-module-xt-time,提供libxt_time.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-tos-1.8.7-r0.aarch64.rpm,iptables-module-xt-tos,提供libxt_TOS.so和libxt_tos.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-tproxy-1.8.7-r0.aarch64.rpm,iptables-module-xt-tproxy,提供libxt_TPROXY.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-trace-1.8.7-r0.aarch64.rpm,iptables-module-xt-trace,提供libxt_TRACE.so动态库,,iptables >= 1.8.7 +iptables,iptables-module-xt-u32-1.8.7-r0.aarch64.rpm,iptables-module-xt-u32,提供libxt_u32.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +iptables,iptables-module-xt-udp-1.8.7-r0.aarch64.rpm,iptables-module-xt-udp,提供libxt_udp.so动态库,,iptables >= 1.8.7 libc6 >= 2.34+10.3.1 +isulad,isulad-2.0.16-r0.aarch64.rpm,isulad,云原生轻量级容器解决方案,,lcr >= 2.0.8 libc6 >= 2.34+10.3.1 libcrypto1.1 >= 1.1.1m libcurl4 >= 7.79.1 libevent-2.1-7 >= 2.1.12 libevhtp >= 1.2.18 libhttp-parser2.9 >= 2.9.4 libz1 >= 1.2.11 yajl >= 2.1.0 +json-c,libjson-c5-0.15-r0.aarch64.rpm,libjson-c5,C中json实现,提供在C中处理json的动态库。,libc6 >= 2.34+10.3.1 +kmod,kmod-30-r0.aarch64.rpm,kmod,将模块加载到内核中,提供内核模块插入、删除、列出、检查属性、解析等工具。,libc6 >= 2.34+10.3.1 libz1 >= 1.2.11 update-alternatives-opkg +kmod,libkmod2-30-r0.aarch64.rpm,libkmod2,与Linux内核模块交互的库,创建libkmod是为了让程序能够轻松插入、删除和列出模块,还可以检查其属性、依赖项和别名。,libc6 >= 2.34+10.3.1 libz1 >= 1.2.11 +lcr,lcr-2.0.8-r0.aarch64.rpm,lcr,轻量级容器,提供轻量级容器动态库。,libc6 >= 2.34+10.3.1 lxc >= 4.0.3 yajl >= 2.1.0 +less,less-590-r0.aarch64.rpm,less,文本文件浏览器,提供less等命令,用于查看文本,类似于more,但具有更多的能力。,libc6 >= 2.34+10.3.1 libtinfo5 >= 6.3 update-alternatives-opkg +libaio,libaio1-0.3.112-r0.aarch64.rpm,libaio1,Linux原生异步I/O访问库,提供给POSIX异步I/O工具内核加速的异步I/O功能。,libc6 >= 2.34+10.3.1 +libarchive,Libarchive-3.6.1-r0.aarch64.rpm,libarchive,用于处理流归档格式的库,提供创建和读取不同流存档格式的功能。,libacl1 >= 2.3.1 libbz2-1 >= 1.0.8 libc6 >= 2.34+10.3.1 liblzma5 >= 5.2.5 liblzo2-2 >= 2.10 libxml2 >= 2.9.14 libz1 >= 1.2.11 +libcap,libcap-2.61-r0.aarch64.rpm,libcap,用于获取和设置POSIX.1e功能的库,数据包捕获函数库,用于捕获网卡数据或分析pcap格式的抓包报文。,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 +libcap,libcap-bin-2.61-r0.aarch64.rpm,libcap-bin,提供libcap二进制工具,提供/usr/sbin/capsh、/usr/sbin/getcap、/usr/sbin/getpcaps、/usr/sbin/setcap,libc6 >= 2.34+10.3.1 libcap >= 2.61 +libcap-ng,libcap-ng-0.8.2-r0.aarch64.rpm,libcap-ng,备用POSIX功能库,提供比传统libcap库更容易使用POSIX功能编程的库,libc6 >= 2.34+10.3.1 +libcap-ng,libcap-ng-bin-0.8.2-r0.aarch64.rpm,libcap-ng-bin,提供libcap-ng二进制工具,提供/usr/bin/captest、/usr/bin/filecap、/usr/bin/netcap、/usr/bin/pscap,libc6 >= 2.34+10.3.1 libcap-ng >= 0.8.2 +libestr,libestr0-0.1.11-r0.aarch64.rpm,libestr0,字符串处理必备库,提供了rsyslog守护进程使用的字符串处理必备共享库,libc6 >= 2.34+10.3.1 +libevent,libevent-2.1-7-2.1.12-r0.aarch64.rpm,libevent-2.1-7,抽象异步事件通知库,libevent API提供了一种机制,在文件描述符上发生特定事件或达到超时后执行回调函数。libevent旨在替换事件驱动网络服务器中发现的异步事件循环。应用程序只需要调用event_dispatch(),然后就可以动态添加或删除事件,而不必更改事件循环。,libc6 >= 2.34+10.3.1 +libevhtp,libevhtp-1.2.18-r0.aarch64.rpm,libevhtp,libevhtp包的调试源,此软件包为libevhtp包提供调试源。调试源在开发使用此软件包的应用程序或调试此软件包时非常有用。,libc6 >= 2.34+10.3.1 libevent-2.1-7 >= 2.1.12 +libfastjson,libfastjson4-0.99.9-r0.aarch64.rpm,libfastjson4,JSON解析库,一个JSON解析库,json-c的分叉,由rsyslog团队开发,用于rsyslog和liblognorm。此软件包包括libfastjson库。,libc6 >= 2.34+10.3.1 +libffi,libffi8-3.4.2-r0.aarch64.rpm,libffi8,外部函数接口库,libffi库为各种调用约定提供了一个可移植的高级编程接口。这允许程序员在运行时调用调用接口描述指定的任何函数。,libc6 >= 2.34+10.3.1 +libgcc-external,libgcc-s1-10.3.1+10.3.1-r0.aarch64.rpm,libgcc-s1,GCC共享支持库,该软件包包含GCC共享支持库,如异常处理支持所需。,glibc-external +libhugetlbfs,libhugetlbfs-2.23-r0.aarch64.rpm,libhugetlbfs,用于大型翻译Lookaside缓冲区文件系统的帮助程序库,libhugetlbfs包与Linux hugetlbfs交互,以透明的方式使大页面可供应用程序使用。,libc6 >= 2.34+10.3.1 +libidn2,libidn2-0-2.3.2-r0.aarch64.rpm,libidn2-0,支持国际化域名(IDN),IDNA2008规范的实现,libc6 >= 2.34+10.3.1 libunistring2 >= 0.9.10 +libjitterentropy,libjitterentropy3-3.3.1-r0.aarch64.rpm,libjitterentropy3,Jitter entropy generator共享库,,libc6 >= 2.34+10.3.1 +libmetal,libmetal-2022.04.0-r0.aarch64.rpm,libmetal,跨用户空间Linux、baremetal和RTOS环境的抽象层,,libc6 >= 2.34+10.3.1 libsysfs2 >= 2.1.1 +libmnl,libmnl0-1.0.4-r0.aarch64.rpm,libmnl0,最简约的Netlink通信库,libmnl是面向Netlink开发人员的极简用户空间库。在解析、验证和构造Netlink头和TLV时,有许多常见任务是重复的,很容易出错。该库旨在提供简单的助手,允许您重用代码并避免重新发明轮子。,libc6 >= 2.34+10.3.1 +libnl,libnl-3-200-3.5.0-r0.aarch64.rpm,libnl-3-200,内核网络套接字的便利库,这个包包含一个方便的库,可以简化使用Linux内核的netlink套接字接口进行网络操作。,libc6 >= 2.34+10.3.1 +libnl,libnl-3-cli-3.5.0-r0.aarch64.rpm,libnl-3-cli,libnl3的命令行界面实用程序,此软件包包含各种libnl3实用程序和它们所依赖的其他库。,libc6 >= 2.34+10.3.1 libnl-3-200 >= 3.5.0 libnl-genl-3-200 >= 3.5.0 libnl-idiag-3-200 >= 3.5.0 libnl-nf-3-200 >= 3.5.0 libnl-route-3-200 >= 3.5.0 +libnl,libnl-genl-3-200-3.5.0-r0.aarch64.rpm,libnl-genl-3-200,Netlink操作库,提供libnl-genl-3.so.*,libc6 >= 2.34+10.3.1 libnl-3-200 >= 3.5.0 +libnl,libnl-idiag-3-200-3.5.0-r0.aarch64.rpm,libnl-idiag-3-200,libnl-idiag动态库,提供libnl-idiag-3.so.*,libc6 >= 2.34+10.3.1 libnl-3-200 >= 3.5.0 +libnl,libnl-nf-3-200-3.5.0-r0.aarch64.rpm,libnl-nf-3-200,NetFilter以及接口监控相关的Netlink操作库,提供libnl-nf-3.so.*,libc6 >= 2.34+10.3.1 libnl-3-200 >= 3.5.0 libnl-route-3-200 >= 3.5.0 +libnl,libnl-route-3-200-3.5.0-r0.aarch64.rpm,libnl-route-3-200,提供NETLINK_ROUTE家族的API接口库,提供libnl-route-3.so.*,libc6 >= 2.34+10.3.1 libnl-3-200 >= 3.5.0 +libnl,libnl-xfrm-3-200-3.5.0-r0.aarch64.rpm,libnl-xfrm-3-200,libnl-xfrm动态库,提供libnl-xfrm-3.so.*,libc6 >= 2.34+10.3.1 libnl-3-200 >= 3.5.0 +libpam,libpam-1.5.2-r0.aarch64.rpm,libpam,为应用程序提供身份验证的可扩展库,提供/lib64/libpam.so.*、/lib64/libpam_misc.so.*和/lib64/libpamc.so.*,libc6 >= 2.34+10.3.1 +libpam,pam-plugin-access-1.5.2-r0.aarch64.rpm,pam-plugin-access,pam_access.so动态库,提供/lib64/security/pam_access.so,libc6 >= 2.34+10.3.1 libcrypt1 >= 1.0+10.3.1 libpam >= 1.5.2 libpam-suffix64 libpwquality pam-plugin-deny-suffix64 pam-plugin-faillock-suffix64 pam-plugin-permit-suffix64 pam-plugin-pwhistory-suffix64 pam-plugin-unix-suffix64 pam-plugin-warn-suffix64 +libpam,libpam-runtime-1.5.2-r0.aarch64.rpm,libpam-runtime,pam实用程序,PAM(可插拔身份验证模块)是一种系统安全工具允许系统管理员设置身份验证策略而不必重新编译处理身份验证的程序。,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-debug-1.5.2-r0.aarch64.rpm,pam-plugin-debug,pam_debug.so动态库,提供/lib64/security/pam_debug.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-deny-1.5.2-r0.aarch64.rpm,pam-plugin-deny,pam_deny.so动态库,提供/lib64/security/pam_deny.so,libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-echo-1.5.2-r0.aarch64.rpm,pam-plugin-echo,pam_echo.so动态库,提供/lib64/security/pam_echo.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-env-1.5.2-r0.aarch64.rpm,pam-plugin-env,pam_env.so动态库,提供/lib64/security/pam_env.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-exec-1.5.2-r0.aarch64.rpm,pam-plugin-exec,pam_exec.so动态库,提供/lib64/security/pam_exec.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-faildelay-1.5.2-r0.aarch64.rpm,pam-plugin-faildelay,pam_faildelay.so动态库,提供/lib64/security/pam_faildelay.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-faillock-1.5.2-r0.aarch64.rpm,pam-plugin-faillock,pam_faillock.so动态库,提供/lib64/security/pam_faillock.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-filter-1.5.2-r0.aarch64.rpm,pam-plugin-filter,pam_filter.so动态库,提供/lib64/security/pam_filter.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-ftp-1.5.2-r0.aarch64.rpm,pam-plugin-ftp,pam_ftp.so动态库,提供/lib64/security/pam_ftp.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-group-1.5.2-r0.aarch64.rpm,pam-plugin-group,pam_group.so动态库,提供/lib64/security/pam_group.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-issue-1.5.2-r0.aarch64.rpm,pam-plugin-issue,pam_issue.so动态库,提供/lib64/security/pam_issue.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-keyinit-1.5.2-r0.aarch64.rpm,pam-plugin-keyinit,pam_keyinit.so动态库,提供/lib64/security/pam_keyinit.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-lastlog-1.5.2-r0.aarch64.rpm,pam-plugin-lastlog,pam_lastlog.so动态库,提供/lib64/security/pam_lastlog.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-limits-1.5.2-r0.aarch64.rpm,pam-plugin-limits,pam_limits.so动态库,提供/lib64/security/pam_limits.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-listfile-1.5.2-r0.aarch64.rpm,pam-plugin-listfile,pam_listfile.so动态库,提供/lib64/security/pam_listfile.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-localuser-1.5.2-r0.aarch64.rpm,pam-plugin-localuser,pam_localuser.so动态库,提供/lib64/security/pam_localuser.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-loginuid-1.5.2-r0.aarch64.rpm,pam-plugin-loginuid,pam_loginuid.so动态库,提供/lib64/security/pam_loginuid.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-mail-1.5.2-r0.aarch64.rpm,pam-plugin-mail,pam_mail.so动态库,提供/lib64/security/pam_mail.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-mkhomedir-1.5.2-r0.aarch64.rpm,pam-plugin-mkhomedir,pam_mkhomedir.so动态库,提供/lib64/security/pam_mkhomedir.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-motd-1.5.2-r0.aarch64.rpm,pam-plugin-motd,pam_motd.so动态库,提供/lib64/security/pam_motd.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-namespace-1.5.2-r0.aarch64.rpm,pam-plugin-namespace,pam_namespace.so动态库,提供/lib64/security/pam_namespace.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-nologin-1.5.2-r0.aarch64.rpm,pam-plugin-nologin,pam_nologin.so动态库,提供/lib64/security/pam_nologin.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-permit-1.5.2-r0.aarch64.rpm,pam-plugin-permit,pam_permit.so动态库,提供/lib64/security/pam_permit.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-pwhistory-1.5.2-r0.aarch64.rpm,pam-plugin-pwhistory,pam_pwhistory.so动态库,提供/lib64/security/pam_pwhistory.so,libc6 >= 2.34+10.3.1 libcrypt1 >= 1.0+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-rhosts-1.5.2-r0.aarch64.rpm,pam-plugin-rhosts,pam_rhostsso动态库,提供/lib64/security/pam_rhostsso,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-rootok-1.5.2-r0.aarch64.rpm,pam-plugin-rootok,pam_rootok.so动态库,提供/lib64/security/pam_rootok.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-securetty-1.5.2-r0.aarch64.rpm,pam-plugin-securetty,pam_securetty.so动态库,提供/lib64/security/pam_securetty.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-setquota-1.5.2-r0.aarch64.rpm,pam-plugin-setquota,pam_setquota.so动态库,提供/lib64/security/pam_setquota.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-shells-1.5.2-r0.aarch64.rpm,pam-plugin-shells,pam_shells.so动态库,提供/lib64/security/pam_shells.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-stress-1.5.2-r0.aarch64.rpm,pam-plugin-stress,pam_stress.so动态库,提供/lib64/security/pam_stress.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-succeed-if-1.5.2-r0.aarch64.rpm,pam-plugin-succeed-if,pam_succeed_if.so动态库,提供/lib64/security/pam_succeed_if.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-time-1.5.2-r0.aarch64.rpm,pam-plugin-time,pam_time.so动态库,提供/lib64/security/pam_time.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-timestamp-1.5.2-r0.aarch64.rpm,pam-plugin-timestamp,pam_timestamp.so动态库,提供/lib64/security/pam_timestamp.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-umask-1.5.2-r0.aarch64.rpm,pam-plugin-umask,pam_umask.so动态库,提供/lib64/security/pam_umask.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-unix-1.5.2-r0.aarch64.rpm,pam-plugin-unix,pam_unix.so动态库,提供/lib64/security/pam_unix.so,libc6 >= 2.34+10.3.1 libcrypt1 >= 1.0+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-usertype-1.5.2-r0.aarch64.rpm,pam-plugin-usertype,pam_usertypeso动态库,提供/lib64/security/pam_usertypeso,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-warn-1.5.2-r0.aarch64.rpm,pam-plugin-warn,pam_warn.so动态库,提供/lib64/security/pam_warn.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-wheel-1.5.2-r0.aarch64.rpm,pam-plugin-wheel,pam_wheel.so动态库,提供/lib64/security/pam_wheel.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpam,pam-plugin-xauth-1.5.2-r0.aarch64.rpm,pam-plugin-xauth,pam_xauth.so动态库,提供/lib64/security/pam_xauth.so,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 libpam-suffix64 +libpcap,libpcap1-1.10.1-r0.aarch64.rpm,libpcap1,网络嗅探器库,libpcap是数据包嗅探器程序使用的库。它为他们提供了一个接口,用于捕获和分析来自网络设备的数据包。只有当您计划自己编译或编写这样的程序时,才需要此软件包。,libc6 >= 2.34+10.3.1 +libpcre,libpcre1-8.45-r0.aarch64.rpm,libpcre1,Perl兼容正则表达式的库,PCRE库是一组函数,使用与Perl 5相同的语法和语义实现正则表达式模式匹配;此PCRE库变体支持8位和UTF-8字符串。,libc6 >= 2.34+10.3.1 +libpcre2,libpcre2-10.39-r0.aarch64.rpm,libpcre2,Perl兼容正则表达式库,PCRE2库是一组函数,使用与Perl 5相同的语法和语义实现正则表达式模式匹配。PCRE2是对原始PCRE库的重新工作,以提供一个全新的API。,libc6 >= 2.34+10.3.1 +libpwquality,libpwquality-1.4.4-r0.aarch64.rpm,libpwquality,密码生成和密码质量检查库,这是一个用于密码质量检查和生成通过检查的随机密码的库。此库使用破解库和破解库字典执行一些检查。,cracklib >= 2.9.7 libc6 >= 2.34+10.3.1 libpam >= 1.5.2 +libseccomp,libseccomp-2.5.3-r0.aarch64.rpm,libseccomp,增强的seccomp库,libseccomp库为Linux内核的syscall过滤机制(seccomp)提供了一个易于使用的接口。libseccomp API允许应用程序指定允许应用程序执行哪些syscall,以及可选的哪些syscall参数,所有这些都由Linux内核强制执行。,libc6 >= 2.34+10.3.1 +libselinux,libselinux1-3.3-r0.aarch64.rpm,libselinux1,SELinux运行时库,libselinux提供了一个接口,用于获取和设置进程和文件安全上下文,以及获取安全策略决策。(安全增强的Linux是内核和一些实施强制性访问控制策略的实用程序的一个功能,如类型实施、基于角色的访问控制和多级安全。),libc6 >= 2.34+10.3.1 libpcre1 >= 8.45 libselinux1 >= 3.3 libsepol2 >= 3.3 +libselinux,libselinux-bin-3.3-r0.aarch64.rpm,libselinux-bin,SELinux libselinux实用程序,"libselinux-bin软件包包含实用程序,",libc6 >= 2.34+10.3.1 libpcre1 >= 8.45 +libsemanage,libsemanage2-3.3-r0.aarch64.rpm,libsemanage2,SELinux策略管理库,libsemanage是策略管理库。使用libsepol和libselinux与SELinux系统交互,它还调用帮助程序来加载策略和检查file_contexts配置是否有效。,audit >= 3.0.1 libbz2-1 >= 1.0.8 libc6 >= 2.34+10.3.1 libselinux1 >= 3.3 libsepol2 >= 3.3 +libsepol,libsepol2-3.3-r0.aarch64.rpm,libsepol2,SELinux二进制策略操作库,提供SELinux二进制策略操作库,libc6 >= 2.34+10.3.1 libsepol2 >= 3.3 +libsepol,libsepol-bin-3.3-r0.aarch64.rpm,libsepol-bin,SELinux二进制策略操作工具,libsepol提供了一个用于操作SELinux二进制策略的API。它由checkpolicy(策略编译器)和类似的工具,以及需要对二进制策略执行特定转换(如自定义策略布尔设置)的程序使用。,libc6 >= 2.34+10.3.1 +libtirpc,libtirpc3-1.3.2-r0.aarch64.rpm,libtirpc3,与传输无关的RPC库,传输独立RPC库(TI-RPC)是glibc中不支持IPv6地址的标准SunRPC库的替代。此实现允许支持UDP和TCP over IPv4以外的其他传输。,libc6 >= 2.34+10.3.1 +libunistring,libunistring2-0.9.10-r0.aarch64.rpm,libunistring2,GNU Unicode字符串库,该库实现了Unicode字符串(有三种风格:UTF-8字符串、UTF-16字符串和UTF-32字符串),以及Unicode字符集函数(字符名、分类、属性)和字符串处理函数(格式化输出、宽度、分词、换行、规范化、大小写折叠、正则表达式)。,libc6 >= 2.34+10.3.1 +libusb,libusb-1.0-0-1.0.24-r0.aarch64.rpm,libusb-1.0-0,USB库,Libusb是一个允许用户空间访问USB设备的库。,libc6 >= 2.34+10.3.1 +libuv,libuv1-1.42.0-r0.aarch64.rpm,libuv1,异步I/O支持库,,libc6 >= 2.34+10.3.1 +libwebsockets,libwebsockets19-4.3.0-r0.aarch64.rpm,libwebsockets19,用于Websockets的轻量级C库,这是用于轻量级websocket客户端和服务器的libwebsockets C库。,libc6 >= 2.34+10.3.1 libuv1 >= 1.42.0 libwebsockets19 >= 4.3.0 +libwebsockets,libwebsockets-evlib-uv-4.3.0-r0.aarch64.rpm,libwebsockets-evlib-uv,提供libwebsockets-evlib_uv.so,,libc6 >= 2.34+10.3.1 libcrypto1.1 >= 1.1.1m libssl1.1 >= 1.1.1m libwebsockets-evlib-uv +libxcrypt-external,libcrypt1-1.0+10.3.1-r0.aarch64.rpm,libcrypt1,用于DES、MD5、Blowfish等的扩展加密库,,glibc-external +libxml2,libxml2-2.9.14-r0.aarch64.rpm,libxml2,提供XML和HTML支持的库,此库允许操作XML文件。它包括读取、修改和写入XML和HTML文件的支持。DTD支持,这包括解析和验证,即使是复杂的DtD,可以在解析时或在修改文档后更晚。输出可以是简单的SAX流,也可以是内存中类似DOM的表示。在这种情况下,可以使用内置的XPath和XPointer实现来选择子节点或范围。提供灵活的输入/输出机制,具有现有的HTTP和FTP模块,并组合到URI库。,libc6 >= 2.34+10.3.1 libz1 >= 1.2.11 +libxml2,libxml2-utils-2.9.14-r0.aarch64.rpm,libxml2-utils,用于操作XML文件的实用程序,此软件包包含用于操作XML文件的实用程序。,libc6 >= 2.34+10.3.1 libxml2 >= 2.9.14 +logrotate,logrotate-3.20.1-r0.aarch64.rpm,logrotate,用于旋转、压缩、邮寄和删除系统日志文件的Cron服务,logrotate实用程序自动旋转、压缩、邮寄和删除日志文件。Logrotate可以设置为每天、每周、每月或当日志文件达到一定大小时处理日志文件。通常,logrotate作为每日cron作业运行。它只管理普通文件,不参与systemd的日志轮换。, libacl1 >= 2.3.1 libc6 >= 2.34+10.3.1 libpopt0 >= 1.18 +lvm2,lvm2-2.03.14-r0.aarch64.rpm,lvm2,Userland逻辑卷管理工具,LVM2包括处理物理卷(硬盘、RAID系统、磁光等,多个设备(MD),请参阅mdm(8),甚至环路设备,请参见Lostup(8))上的读/写操作的所有支持,从一个或多个物理卷创建卷组(虚拟磁盘种类),并在卷组中创建一个或多个逻辑卷(逻辑分区种类)。,libaio1 >= 0.3.112 libblkid1 >= 2.37.2 libc6 >= 2.34+10.3.1 +lvm2,lvm2-scripts-2.03.14-r0.aarch64.rpm,lvm2-scripts,提供blkdeactivate、fsadm、lvmdum命令,提供/usr/sbin/blkdeactivate、/usr/sbin/fsadm和/usr/sbin/lvmdump,bash lvm2 = 2.03.14-r0 +lxc,lxc-4.0.3-r0.aarch64.rpm,lxc,Linux内核容器的用户空间工具,LXC是众所周知的、经过严格测试的低层次Linux容器运行时。,libc6 >= 2.34+10.3.1 libcap >= 2.61 libgcc-s1 >= 10.3.1+10.3.1 libseccomp >= 2.5.3 yajl >= 2.1.0 +lz4,lz4-1.9.3-r0.aarch64.rpm,lz4,基于散列的预测Lempel–Ziv压缩器,LZ4是一种无损数据压缩算法,专注于压缩和解压缩速度。它属于面向字节压缩方案的LZ77(Lempel–Ziv)家族。它是一个LZP2分叉,为文本文件提供更好的压缩比。,libc6 >= 2.34+10.3.1 +lzo,liblzo2-2-2.10-r0.aarch64.rpm,liblzo2-2,实时数据压缩库,LZO是一个以ANSI C编写的便携式无损数据压缩库。解压缩不需要内存。LZO适用于实时数据压缩和解压缩。这意味着它有利于速度超过压缩比。,libc6 >= 2.34+10.3.1 +modutils-initscripts,modutils-initscripts-1.0-r7.aarch64.rpm,modutils-initscripts,启动时自动加载内核模块的初始化脚本,, +ncurses,libform5-6.3-r0.aarch64.rpm,libform5,libform动态库,提供/usr/lib64/libform.so.*,libc6 >= 2.34+10.3.1 libncurses5 >= 6.3 +ncurses,libmenu5-6.3-r0.aarch64.rpm,libmenu5,libmenu动态库,提供/usr/lib64/libmenu.so.*,libc6 >= 2.34+10.3.1 libncurses5 >= 6.3 +ncurses,libncurses5-6.3-r0.aarch64.rpm,libncurses5,libncurses动态库,提供/lib64/libncurses.so.*,libc6 >= 2.34+10.3.1 libtinfo5 >= 6.3 +ncurses,libpanel5-6.3-r0.aarch64.rpm,libpanel5,libpanel动态库,提供/usr/lib64/libpanel.so.*,libc6 >= 2.34+10.3.1 libncurses5 >= 6.3 +ncurses,libtinfo5-6.3-r0.aarch64.rpm,libtinfo5,libtinfo动态库,提供/lib64/libtinfo.so.*,libc6 >= 2.34+10.3.1 +ncurses,ncurses-6.3-r0.aarch64.rpm,ncurses,CRT屏幕处理和优化包,提供/usr/bin/tput、/usr/bin/tset功能,libc6 >= 2.34+10.3.1 libtinfo5 >= 6.3 +ncurses,ncurses-terminfo-6.3-r0.aarch64.rpm,ncurses-terminfo,终端描述数据库,这是ncures包中维护的术语信息基本数据库。此数据库是4.4BSD术语帽文件的官方继承者,包含有关任何已知终端的信息。ncures库利用此数据库正确使用终端。,ncurses-terminfo-base update-alternatives-opkg +ncurses,ncurses-terminfo-base-6.3-r0.aarch64.rpm,ncurses-terminfo-base,提供终端信息基础,提供/etc/terminfo/*, +nettle,nettle-3.8.1-r0.aarch64.rpm,nettle,加密工具,Nettle是一个加密库,设计用于或多或少地适应任何环境:面向对象语言(C++、Python、Pike等)的加密工具包,LSH或GNUPG等应用程序,甚至内核空间。,libc6 >= 2.34+10.3.1 libgmp10 >= 6.2.1 +nfs-utils,nfs-utils-2.5.4-r0.aarch64.rpm,nfs-utils,NFS实用程序以及内核NFS服务器的支持客户端和守护程序,nfs-utils软件包为内核NFS服务器和相关工具提供了一个守护程序,它提供了比大多数用户使用的传统Linux NFS服务器更高的性能级别。,initd-functions libblkid1 >= 2.37.2 libc6 >= 2.34+10.3.1 libtirpc3 >= 1.3.2 libuuid1 >= 2.37.2 nfs-utils-client +nfs-utils,nfs-utils-client-2.5.4-r0.aarch64.rpm,nfs-utils-client,查询远程主机上的装载守护程序,此软件包还包含showmount程序。Showmount查询远程主机上的装载守护程序,以了解有关远程主机上NFS(网络文件系统)服务器的信息。例如,showmount可以显示装载在该主机上的客户端。,base-files base-passwd initd-functions libc6 >= 2.34+10.3.1 libcap >= 2.61 libtirpc3 >= 1.3.2 nfs-utils-mount rpcbind shadow +nfs-utils,nfs-utils-mount-2.5.4-r0.aarch64.rpm,nfs-utils-mount,挂载或卸载文件系统,此软件包还包含mount.nfs和umount.nfs程序。,libc6 >= 2.34+10.3.1 libmount1 >= 2.37.2 libtirpc3 >= 1.3.2 +openamp,libopen-amp1-2022.04.0-r0.aarch64.rpm,libopen-amp1,提供libopen_amp.so.1,,libc6 >= 2.34+10.3.1 libmetal >= 2022.04.0 screen +openssh,openssh-keygen-8.8p1-r0.aarch64.rpm,openssh-keygen,生成ssh公钥认证所需的公钥和私钥文件,提供/usr/bin/ssh-keygen,libc6 >= 2.34+10.3.1 libcrypto1.1 >= 1.1.1m +openssh,openssh-misc-8.8p1-r0.aarch64.rpm,openssh-misc,ssh远程登陆管理主机,提供/usr/bin/ssh、/usr/bin/ssh-add、/usr/bin/ssh-agent、/usr/bin/ssh-copy-id、/usr/bin/ssh-keyscan等,libc6 >= 2.34+10.3.1 libcrypto1.1 >= 1.1.1m libz1 >= 1.2.11 +openssh,openssh-scp-8.8p1-r0.aarch64.rpm,openssh-scp,远程复制命令,提供/usr/bin/scp,libc6 >= 2.34+10.3.1 libcrypto1.1 >= 1.1.1m update-alternatives-opkg +openssh,openssh-sftp-8.8p1-r0.aarch64.rpm,openssh-sftp,远程文件传输服务,提供/usr/bin/sftp,libc6 >= 2.34+10.3.1 libcrypto1.1 >= 1.1.1m +openssh,openssh-sftp-server-8.8p1-r0.aarch64.rpm,openssh-sftp-server,”sftp“协议的服务器端程序使用加密的方式进行文件传输,提供/usr/libexec/sftp-server,libc6 >= 2.34+10.3.1 libcrypto1.1 >= 1.1.1m +openssh,openssh-ssh-8.8p1-r0.aarch64.rpm,openssh-ssh,ssh服务配置文件,提供/etc/ssh/ssh_config,libc6 >= 2.34+10.3.1 libcrypto1.1 >= 1.1.1m libz1 >= 1.2.11 update-alternatives-opkg +openssh,openssh-sshd-8.8p1-r0.aarch64.rpm,openssh-sshd,ssh服务进程启动,提供/usr/sbin/sshd、/usr/libexec/openssh/sshd_check_keys等,base-files base-passwd libc6 >= 2.34+10.3.1 libcrypt1 >= 1.0+10.3.1 libcrypto1.1 >= 1.1.1m libpam >= 1.5.2 libz1 >= 1.2.11 openssh-keygen pam-plugin-keyinit pam-plugin-loginuid shadow +openssl,openssl-conf-1.1.1m-r0.aarch64.rpm,openssl-conf,openssl的主配置文件,提供/etc/ssl/openssl.cnf,libc6 >= 2.34+10.3.1 +openssl,libcrypto1.1-1.1.1m-r0.aarch64.rpm,libcrypto1.1,OpenSSL crypto库,提供/usr/lib64/libcrypto.so.*,libc6 >= 2.34+10.3.1 libcrypto1.1 >= 1.1.1m +openssl,libssl1.1-1.1.1m-r0.aarch64.rpm,libssl1.1,OpenSSL SSL库,提供/usr/lib64/libssl.so.*, +opkg-utils,update-alternatives-opkg-0.5.0-r0.aarch64.rpm,update-alternatives-opkg,通过确定默认命令来维护符号链接,提供opkg-utils的update-alternatives程序, +os-base,os-base-1.0-r1.qemu_aarch64.rpm,os-base,openEuler Embedded的额外基本配置文件,, +os-release,os-release-1.0-r0.noarch.rpm,os-release,添加openeuler版本信息,添加openeuler版本信息,同时添加os-revision记录构建时间戳。生成的镜像也放到时间戳目录便于区分不同版本, +pciutils,libpci3-3.7.0-r0.aarch64.rpm,libpci3,PCI实用程序库,libpci提供了对PCI配置空间的访问,libc6 >= 2.34+10.3.1 libz1 >= 1.2.11 +pciutils,pciutils-3.7.0-r0.aarch64.rpm,pciutils,Linux内核的PCI实用程序,lspci:此程序显示有关系统中所有PCI总线和设备的详细信息,取代原始的/proc/pci接口;setpci:此程序允许读取和写入PCI设备配置寄存器。例如,您可以使用它调整延迟计时器;update-pciids:此程序下载pci.ids文件的当前版本。,libc6 >= 2.34+10.3.1 libkmod2 >= 30 libpci3 >= 3.7.0 libz1 >= 1.2.11 pciutils-ids +pciutils,pciutils-ids-3.7.0-r0.aarch64.rpm,pciutils-ids,存放系统所有支持和不支持的硬件信息,提供/usr/share/hwdata/pci.ids.gz, +policycoreutils,policycoreutils-3.3-r0.aarch64.rpm,policycoreutils,显示当前seinux信息修改selinux策略内各项规则的布尔值,提供/etc/pam.d、/sbin/setsebool、/usr/bin/sestatus和/var/lib/selinux,libc6 >= 2.34+10.3.1 libselinux1 >= 3.3 libsemanage2 >= 3.3 +policycoreutils,policycoreutils-fixfiles-3.3-r0.aarch64.rpm,policycoreutils-fixfiles,检查或矫正文件系统中的安全环境数据库,提供/sbin/fixfiles,policycoreutils-setfiles +policycoreutils,policycoreutils-hll-3.3-r0.aarch64.rpm,policycoreutils-hll,提供/usr/libexec/selinux/hll/pp,提供/usr/libexec/selinux/hll/pp,libc6 >= 2.34+10.3.1 libsepol2 >= 3.3 +policycoreutils,policycoreutils-loadpolicy-3.3-r0.aarch64.rpm,policycoreutils-loadpolicy,装载或替换新的二进制策略到内核中保持使用当前的Bootlean值,提供/sbin/load_policy,libc6 >= 2.34+10.3.1 libselinux1 >= 3.3 libsepol2 >= 3.3 +policycoreutils,policycoreutils-semodule-3.3-r0.aarch64.rpm,policycoreutils-semodule,可以显示、加载、删除模块,提供/sbin/semodule,libc6 >= 2.34+10.3.1 libselinux libsemanage2 >= 3.3 libsepol2 >= 3.3 +policycoreutils,policycoreutils-sestatus-3.3-r0.aarch64.rpm,policycoreutils-sestatus,显示系统的详细状态,提供/etc/sestatus.conf和/sbin/sestatus,libselinux policycoreutils +policycoreutils,policycoreutils-setfiles-3.3-r0.aarch64.rpm,policycoreutils-setfiles,恢复或更改一部分文件的标签,提供/sbin/restorecon、/sbin/restorecon_xattr和/sbin/setfiles,libc6 >= 2.34+10.3.1 libselinux1 >= 3.3 libsepol2 >= 3.3 +popt,libpopt0-1.18-r0.aarch64.rpm,libpopt0,一个用于解析命令行参数的C库,Popt是一个用于解析命令行参数的C库。Popt受到getopt()和getopt_long()函数的严重影响。它通过允许更强大的参数扩展来改进它们。Popt可以解析任意argv[]样式数组,并根据命令行参数自动设置变量。Popt允许通过配置文件别名命令行参数,并包括用于使用类似shell的规则将任意字符串解析为argv[]数组的实用程序函数。,libc6 >= 2.34+10.3.1 +procps,libprocps8-3.3.17-r0.aarch64.rpm,libprocps8,procps库,procps库可用于从/proc读取进程信息pseudo-file系统中的信息。,libc6 >= 2.34+10.3.1 +procps,procps-3.3.17-r0.aarch64.rpm,procps,/proc的ps实用程序,procps包包含一组提供系统信息的系统实用程序。Procps包括ps、free、skill、snice、tload、top、uptime、vmstat、w和watch。,libc6 >= 2.34+10.3.1 libncurses5 >= 6.3 libprocps8 >= 3.3.17 libtinfo5 >= 6.3 procps-ps procps-sysctl update-alternatives-opkg +procps,procps-ps-3.3.17-r0.aarch64.rpm,procps-ps,提供ps程序查看进程运行状态,,libc6 >= 2.34+10.3.1 libprocps8 >= 3.3.17 update-alternatives-opkg +procps,procps-sysctl-3.3.17-r0.aarch64.rpm,procps-sysctl,,,libc6 >= 2.34+10.3.1 procps-lib update-alternatives-opkg +psmisc,pstree-23.4-r0.aarch64.rpm,pstree,显示进程状态树,列出当前的进程,以及它们的树状结构,libc6 >= 2.34+10.3.1 libtinfo5 >= 6.3 +quota,quota-4.06-r0.aarch64.rpm,quota,用于监控用户磁盘使用情况的系统管理工具,包含系统管理工具,用于监控和限制每个文件系统的用户和或组磁盘使用情况。,libc6 >= 2.34+10.3.1 libcom-err2 >= 1.46.4 libext2fs2 >= 1.46.4 libtirpc3 >= 1.3.2 +readline,libreadline8-8.1-r0.aarch64.rpm,libreadline8,Readline库,readline库由 Bourne Again Shell(bash,标准命令解释器)用于轻松编辑命令行。这包括历史记录和搜索功能。,libc6 >= 2.34+10.3.1 libtinfo5 >= 6.3 +rng-tools,rng-tools-6.14-r0.aarch64.rpm,rng-tools,随机数生成器和相关实用程序,硬件随机数生成工具。它监视一组熵源,并将熵提供给系统内核的/dev/random机制。,libc6 >= 2.34+10.3.1 libcrypto1.1 >= 1.1.1m libjitterentropy3 >= 3.3.1 +rpcbind,rpcbind-1.2.6-r0.aarch64.rpm,rpcbind,RPC程序号映射器的通用地址,rpcbind实用程序是将RPC程序编号转换为通用地址的服务器。它必须在主机上运行,才能在该计算机上的服务器上进行RPC调用。,base-files base-passwd initd-functions libc6 >= 2.34+10.3.1 libtirpc3 >= 1.3.2 shadow update-alternatives-opkg +rsyslog,rsyslog-8.2110.0-r0.aarch64.rpm,rsyslog,用于Linux和Unix的增强系统日志,Rsyslog是一个增强的多线程syslogd,支持MySQL、syslog/tcp、RFC 3195、允许的发件人列表、对任何消息部分的过滤和细粒度输出格式控制。它与库存sysklogd相当兼容,可以用作直接替换。它的高级功能使它适合企业级、加密保护的系统日志中继链,同时也非常容易为新手用户设置。,libc6 >= 2.34+10.3.1 libcurl4 >= 7.79.1 libestr0 >= 0.1.11 libfastjson4 >= 0.99.9 libgnutls30 >= 3.7.2 libuuid1 >= 2.37.2 libz1 >= 1.2.11 logrotate +screen,screen-4.8.0-r0.aarch64.rpm,screen,支持在一个终端上多次登录的管理器,screen实用程序允许您在一个终端上多次登录。screen对于通过远程登录到机器或通过哑终端连接但希望使用多个登录的用户非常有用。,base-files libc6 >= 2.34+10.3.1 libcrypt1 >= 1.0+10.3.1 libpam >= 1.5.2 libtinfo5 >= 6.3 +sed,sed-4.8-r0.aarch64.rpm,sed,GNU流文本编辑器,sed(流编辑器)编辑器是流或批处理(非交互式)编辑器。Sed将文本作为输入,对文本执行操作或一组操作,并输出修改后的文本。sed执行的操作(替换、删除、插入等)可以在脚本文件或命令行中指定。,libc6 >= 2.34+10.3.1 update-alternatives-opkg +shadow,shadow-4.9-r0.aarch64.rpm,shadow,用于管理用户和组帐户的实用程序,此软件包包括将普通密码文件转换为影子密码格式以及管理用户和组帐户所需的程序。,base-passwd libattr1 >= 2.5.1 libc6 >= 2.34+10.3.1 libcrypt1 >= 1.0+10.3.1 libpam >= 1.5.2 libpam-runtime pam-plugin-env pam-plugin-faildelay pam-plugin-group pam-plugin-lastlog pam-plugin-limits pam-plugin-mail pam-plugin-motd pam-plugin-nologin pam-plugin-rootok pam-plugin-securetty pam-plugin-shells shadow-base shadow-securetty update-alternatives-opkg util-linux-sulogin +shadow,shadow-base-4.9-r0.aarch64.rpm,shadow-base,提供sg工具,提供/usr/bin/sg工具,libc6 >= 2.34+10.3.1 libcrypt1 >= 1.0+10.3.1 libpam >= 1.5.2 update-alternatives-opkg +shadow,shadow-securetty-4.8.1-r1.aarch64.rpm,shadow-securetty,安全终端,提供/etc/securetty, +squashfs-tools,squashfs-tools-4.5-r0.aarch64.rpm,squashfs-tools,用于创建squashfs文件系统的实用程序,squashfs是Linux的高度压缩只读文件系统。此软件包包含用于操作squashfs文件系统的实用程序。,libc6 >= 2.34+10.3.1 liblzma5 >= 5.2.5 liblzo2-2 >= 2.10 libz1 >= 1.2.11 lz4 >= 1.9.3 +strace,strace-5.14-r0.aarch64.rpm,strace,跟踪和显示与正在运行的进程关联的系统调用,strace程序拦截并记录运行进程调用和接收的系统调用。strace可以打印每个系统调用、其参数和返回值的记录。strace对于诊断问题和调试以及教学目的都很有用。,libc6 >= 2.34+10.3.1 +sysfsutils,libsysfs2-2.1.1-r5.aarch64.rpm,libsysfs2,sysfsutils的主库,此包包含运行与sysfsutils动态链接的程序所需的库。libsysfs库允许访问系统设备。,libc6 >= 2.34+10.3.1 +sysfsutils,sysfsutils-2.1.1-r5.aarch64.rpm,sysfsutils,提供与sysfs接口的实用程序,,libc6 >= 2.34+10.3.1 libsysfs2 >= 2.1.1 +tcl,libtcl8.6-0-8.6.12-r0.aarch64.rpm,libtcl8.6-0,tcl的共享库,,libc6 >= 2.34+10.3.1 libz1 >= 1.2.11 +tcl,tcl-8.6.12-r0.aarch64.rpm,tcl,Tcl编程语言,Tcl(工具命令语言)是一种非常强大但易于学习的动态编程语言,适用于非常广泛的用途,包括web和桌面应用程序、网络、管理、测试等。,libc6 >= 2.34+10.3.1 libtcl8.6-0 >= 8.6.12 +tzdata,tzdata-core-2022a-r0.aarch64.rpm,tzdata-core,时区说明,描述可用时区的配置文件。, +update-rc.d,update-rc.d-0.8-r0.noarch.rpm,update-rc.d,管理/etc/rcN.d中的符号链接,, +util-linux,libblkid1-2.37.2-r0.aarch64.rpm,libblkid1,块设备ID库,块设备识别库,util-linux的一部分。,libc6 >= 2.34+10.3.1 +util-linux,libfdisk1-2.37.2-r0.aarch64.rpm,libfdisk1,文件系统检测库,用于文件系统检测的库。,libblkid1 >= 2.37.2 libc6 >= 2.34+10.3.1 libuuid1 >= 2.37.2 +util-linux,libmount1-2.37.2-r0.aarch64.rpm,libmount1,设备挂载库,设计用于低级实用程序的库,如mount(8)和/usr/sbin/mount,libblkid1 >= 2.37.2 libc6 >= 2.34+10.3.1 +util-linux,util-linux-su-2.37.2-r0.aarch64.rpm,util-linux-su,用于变更为其他使用者的身份,提供su命令,用于变更使用者身份,libc6 >= 2.34+10.3.1 libpam >= 1.5.2 update-alternatives-opkg +util-linux,util-linux-sulogin-2.37.2-r0.aarch64.rpm,util-linux-sulogin,进行单用户登录,,libc6 >= 2.34+10.3.1 libcrypt1 >= 1.0+10.3.1 update-alternatives-opkg +util-linux-libuuid,libuuid1-2.37.2-r0.aarch64.rpm,libuuid1,用于生成UUIDs的库,,libc6 >= 2.34+10.3.1 +xz,liblzma5-5.2.5-r0.aarch64.rpm,liblzma5,Lempel–Ziv–Markov 链算法压缩库,用于编码/解码LZMA文件的库。,libc6 >= 2.34+10.3.1 +xz,xz-5.2.5-r0.aarch64.rpm,xz,LZMA压缩实用程序,XZ Utils试图使LZMA压缩易于在自由(如自由)操作系统上使用。这是通过提供类似于使用的工具和库来实现的,而不是最流行的现有压缩算法的等效工具和库。LZMA是由伊戈尔·巴甫洛夫设计的通用压缩算法,作为7-Zip的一部分。它提供了高压缩比,同时保持了快速的解压缩速度。,libc6 >= 2.34+10.3.1 liblzma5 >= 5.2.5 update-alternatives-opkg +yajl,yajl-2.1.0-r0.aarch64.rpm,yajl,又一个JSON库(YAJL),又是一个JSON库。YAJL是一个用ANSI C编写的小型事件驱动(SAX风格)JSON解析器,也是一个小型验证JSON生成器。,libc6 >= 2.34+10.3.1 +zlib,libz1-1.2.11-r0.aarch64.rpm,libz1,实现DEFLATE压缩算法的库,zlib是一个通用的无损数据压缩库,实现了DEFLATE算法的API,例如gzip和ZIP存档格式正在使用后者。,libc6 >= 2.34+10.3.1 diff --git a/docs/source/features/software_package_description.csv b/docs/source/features/software_package_description.csv new file mode 100644 index 0000000000000000000000000000000000000000..c20d2b17e892c5f33492c8055b4fd920524efc45 --- /dev/null +++ b/docs/source/features/software_package_description.csv @@ -0,0 +1,290 @@ +软件名称,RPM名称,软件包名称,功能说明,详细情况,依赖关系 +acl,acl-2.3.1-r0.aarch64.rpm,acl,提供操纵访问控制列表的命令,提供操作程序控制列表的getfacl和setfacl程序。,glibc >= 2.34;libacl1 >= 2.3.1; +acl,libacl1-2.3.1-r0.aarch64.rpm,libacl1,提供用于访问POSIX访问控制列表的动态库,提供libacl.so动态库,其中包含POSIX 1003.1e标准草案中用于操作访问控制列表的17个函数。,/bin/sh;glibc >= 2.34;libattr1 >= 2.5.1 +attr,attr-2.5.1-r0.aarch64.rpm,attr,用于管理文件系统扩展属性,一种在文件系统对象上操作扩展属性的工具集,特别是getfattr和setfattr工具。还提供了一个attr命令,它在很大程度上兼容使用同名的SGI IRIX工具。,glibc >= 2.34;libattr1 >= 2.5.1 +attr,libattr1-2.5.1-r0.aarch64.rpm,libattr1,提供文件扩展属性支持的动态库,提供libattr.so动态库,其中包含扩展属性库函数。, +audit,audispd-plugins-3.0.1-r0.aarch64.rpm,audispd-plugins,提供审计事件调度器的插件,为audit系统、audispd的实时接口的提供插件;此插件能够传达事件到远端及其或者为分析可疑行为的事件。, +audit,audit-3.0.1-r0.aarch64.rpm,audit,为审计提供用户空间工具,通过审计系统提供用户空间程序来存储和搜索审计记录生成。,/bin/sh;glibc >= 2.34;libcap-ng >= 0.8.2 +audit,auditd-3.0.1-r0.aarch64.rpm,auditd,提供audit的守护进程,,audit >= 3.0.1;config(auditd) = 3.0.1-r0;glibc >= 2.34;libcap-ng >= 0.8.2 +bash,bash-5.1.8-r0.aarch64.rpm,bash,命令处理器,与sh兼容的命令解释器,从标准输入或文件中读取来执行命令,并结合了ksh和csh的有用功能。,/bin/sh;glibc >= 2.34;glibc >= 2.34;libtinfo5 >= 6.2;libtinfo5 >= 6.2 +bind,bind-9.11.14-r0.aarch64.rpm,bind,域名系统(DNS)协议的一种实现,提供DNS服务器,将主机名转换为IP地址;提供解析器库,是与DNS交互式应用程序使用的例程;提供工具,验证DNS服务是否正常运行。,/bin/sh;config(bind) = 9.11.14-r0;glibc >= 2.34;libcap >= 2.61;libcrypto1.1 >= 1.1.1m;libz1 >= 1.2.11 +bind,bind-utils-9.11.14-r0.aarch64.rpm,bind-utils,用于查询DNS名称服务器,从DNS名称服务器中获取信息。,bind >= 9.11.14;glibc >= 2.34;libreadline8 >= 8.1 +binutils,libbfd-2.37-r0.aarch64.rpm,libbfd,二进制描述器,提供libbfd-2.37.so动态库。,/bin/sh;glibc >= 2.34;libz1 >= 1.2.11 +busybox,busybox-1.34.1-r1.aarch64.rpm,busybox,许多常见UNIX实用程序的微小版本组合,替代通常在filetuils、shellutils、findutils、textutils、grep、gzip、tar等中的实用程序,提供相当完整的POSIX小型或嵌入式系统环境。,glibc >= 2.34;libtirpc3 >= 1.3.2 +busybox,busybox-linuxrc-1.34.1-r1.aarch64.rpm,busybox-linuxrc,提供初始化程序,提供linuxrc和init程序。,busybox +bzip2,libbz2-1-1.0.8-r0.aarch64.rpm,libbz2-1,bzip2运行时库,提供libbz2.so.1动态库。,/bin/sh;glibc >= 2.34;glibc >= 2.34 +cifs-utils,cifs-utils-6.14-r0.aarch64.rpm,cifs-utils,用于执行和管理Linu CIFS文件系统的挂载,包含用于执行和管理Linux CIFS文件系统挂载的使用程序。,glibc >= 2.34 +cracklib,cracklib-2.9.7-r0.aarch64.rpm,cracklib,使用字典破解密码的库,测试密码以确定它们是否匹配一定的安全导向特性,可阻止用户选择太过简单的密码。,/bin/sh;glibc >= 2.34;libz1 >= 1.2.11 +cronie,cronie-1.5.7-r0.aarch64.rpm,cronie,用于周期性执行指令,提供cron的守护进程,cron用于在特定时间自动启动任务程序。,config(cronie) = 1.5.7-r0;glibc >= 2.34;libpam >= 1.5.2;libpam-runtime;pam-plugin-access;pam-plugin-loginuid +curl,curl-7.79.1-r0.aarch64.rpm,curl,用于从远端服务器获取文件,一个命令行工具,用于使用URL语法传输数据,支持多种协议和大量有用的技巧。,glibc >= 2.34;libcurl4 >= 7.79.1 +curl,libcurl4-7.79.1-r0.aarch64.rpm,libcurl4,用于从URL传输数据的库,"curl共享库,用于使用不同的网络协议访问数据,",/bin/sh;glibc >= 2.34 +dhcp,dhcp-4.4.2-r0.aarch64.rpm,dhcp,提供ISC DHCP软件使用的常用程序,包含ISC DHCP服务端和客户端使用的常用程序。,bind >= 9.11.14;dhcp-libs >= 4.4.2;glibc >= 2.34 +dhcp,dhcp-libs-4.4.2-r0.aarch64.rpm,dhcp-libs,ISC DHCP服务端和客户端使用的共享库,提供ISC DHCP服务端和客户端使用的共享库。,/bin/sh;glibc >= 2.34 +dhcp,dhcp-server-4.4.2-r0.aarch64.rpm,dhcp-server,提供ISC DHCP服务端,提供DHCP服务端和dhcp守护进程。,/bin/sh;bind >= 9.11.14;dhcp-libs >= 4.4.2;glibc >= 2.34 +dhcp,dhcp-server-config-4.4.2-r0.aarch64.rpm,dhcp-server-config,ISC DHCP服务端配置,提供默认的DHCP服务端和dhcp守护进程配置文件。,/etc;/etc/default;/etc/default/dhcp-server;/etc/dhcp;/etc/dhcp/dhcpd.conf +dosfstools,dosfstools-4.2-r0.aarch64.rpm,dosfstools,用于创建和检查MS-DOS FAT文件系统,包含用于Linux中 创建和检查硬盘或软盘上的MS-DOS FAT文件系统的两个工具。,glibc >= 2.34 +e2fsprogs,e2fsprogs-1.46.4-r0.aarch64.rpm,e2fsprogs,用于管理ext2、ext3和ext4文件系统,包含许多用于ext2、ext3和ext4文件系统中创建、检查、修改和纠正任何不一致的程序。,e2fsprogs-badblocks;e2fsprogs-dumpe2fs;glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4;libe2p2 >= 1.46.4;libext2fs2 >= 1.46.4;libss2 >= 1.46.4;libuuid1 >= 2.37.2 +e2fsprogs,e2fsprogs-badblocks-1.46.4-r0.aarch64.rpm,e2fsprogs-badblocks,用于检查磁盘装置中损坏的区块,提供badblocks命令,用于检查磁盘装置中损坏的区块。,glibc >= 2.34;libcom-err2 >= 1.46.4;libext2fs2 >= 1.46.4 +e2fsprogs,e2fsprogs-dumpe2fs-1.46.4-r0.aarch64.rpm,e2fsprogs-dumpe2fs,用于查看格式化之后的文件系统信息,提供dumpe2fs命令,用于查看格式化之后的文件系统信息。,glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4;libe2p2 >= 1.46.4;libext2fs2 >= 1.46.4 +e2fsprogs,e2fsprogs-e2fsck-1.46.4-r0.aarch64.rpm,e2fsprogs-e2fsck,用于检查使用Linux ext2档案系统的partition,提供e2fsck命令,用于检查使用Linux ext2档案系统的partition是否正常工作。,glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4;libe2p2 >= 1.46.4;libext2fs2 >= 1.46.4;libuuid1 >= 2.37.2 +e2fsprogs,e2fsprogs-mke2fs-1.46.4-r0.aarch64.rpm,e2fsprogs-mke2fs,用于建立ext2文件系统,提供mke2fs.conf和mke2fs.e2fsprogs,mke2fs命令用于建立ext2文件系统。,glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4;libe2p2 >= 1.46.4;libext2fs2 >= 1.46.4;libuuid1 >= 2.37.2 +e2fsprogs,e2fsprogs-tune2fs-1.46.4-r0.aarch64.rpm,e2fsprogs-tune2fs,调整和查看ext2/ext3文件系统参数的命令行工具,"提供e2label、tune2fs.e2fsprogs命令,",glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4;libe2p2 >= 1.46.4;libext2fs2 >= 1.46.4;libuuid1 >= 2.37.2 +e2fsprogs,libcom-err2-1.46.4-r0.aarch64.rpm,libcom-err2,e2fsprogs报错库,一个错误信息显示库。,/bin/sh;glibc >= 2.34 +e2fsprogs,libe2p2-1.46.4-r0.aarch64.rpm,libe2p2,e2fsprogs共享库,提供libe2p.so.2和libe2p.so.2.3动态库。,/bin/sh;glibc >= 2.34 +e2fsprogs,libext2fs2-1.46.4-r0.aarch64.rpm,libext2fs2,e2fsprogs共享库,提供libext2fs2.so.2和libext2fs.2.4动态库。,/bin/sh;glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4 +e2fsprogs,libss2-1.46.4-r0.aarch64.rpm,libss2,e2fsprogs共享库,提供libss.so.2和libss.so.2.0动态库。,/bin/sh;glibc >= 2.34;glibc >= 2.34;libcom-err2 >= 1.46.4;libcom-err2 >= 1.46.4 +elfutils,libasm1-0.185-r0.aarch64.rpm,libasm1,用于处理编译对象的实用程序和DSO集合,"提供libasm-0.185.so和libasm.so.1动态库,",/bin/sh;glibc >= 2.34;libdw1 >= 0.185;libelf1 >= 0.185 +elfutils,libelf1-0.185-r0.aarch64.rpm,libelf1,读写ELF文件的库,"提供libelf-0.185.so好libelf.so.1动态库,",/bin/sh;glibc >= 2.34;libz1 >= 1.2.11 +elfutils,libdw1-0.185-r0.aarch64.rpm,libdw1,访问DWARF调试信息的库,"提供libdw-0.185.so和libdw.so.1动态库,",glibc >= 2.34;libelf1 >= 0.185;libz1 >= 1.2.11 +ethtool,ethtool-5.15-r0.aarch64.rpm,ethtool,以太网网卡的设置工具,允许在许多网络设备尤其是以太网设备中查询和更改设置,例如速度、端口、自动协商、PCI位置、校验和卸载。,glibc >= 2.34 +expat,libexpat1-2.4.1-r0.aarch64.rpm,libexpat1,XML解析器工具包,"提供libexpat.so.1好libexpat.so.1.8.1动态库,",/bin/sh;glibc >= 2.34 +gdb,gdb-11.1-r0.aarch64.rpm,gdb,用于C、C++、Fortran和其他语言的GNU源代码级调试器,GDB是GNU调试器,允许您调试用C、C++、Java和其他语言编写的程序,方法是以受控的方式执行这些程序并打印它们的数据。,gcc-bin-toolchain-compilerlibs-aarch64 >= 1.0;glibc >= 2.34;libexpat1 >= 2.4.1;libgmp10 >= 6.2.1;libreadline8 >= 8.1;libtinfo5 >= 6.3 +gdb,gdbserver-11.1-r0.aarch64.rpm,gdbserver,GDB(GNU源级调试器)的独立服务器,此软件包提供了一个程序,允许您在运行正在调试程序的计算机之外的计算机上运行GDB。openEuler Embedded 330 版本中,SDK中暂时不支持主机端交叉调试工具gdb,可以使用gdb-multiarch代替,一般都可以通过zypper/apt/yum 安装(openeuler镜像暂不支持)。,gcc-bin-toolchain-compilerlibs-aarch64 >= 1.0;glibc >= 2.34 +glib-2.0,libglib-2.0-0-2.68.1-r0.aarch64.rpm,libglib-2.0-0,通用使用程序库,,/bin/sh;glibc >= 2.34;libffi8 >= 3.4.2;libmount1 >= 2.37.2;libpcre1 >= 8.45;libz1 >= 1.2.11 +glibc,glibc-2.34-r1.aarch64.rpm,glibc,GNU C库,包含重要的共享库集:标准C库和标准数学库。,/bin/sh +gmp,libgmp10-6.2.1-r0.aarch64.rpm,libgmp10,一个用于计算巨大数字的库,GMP是一个用于任意精度算术的库,对有符号整数、有理数和浮点数进行操作。,/bin/sh;glibc >= 2.34 +grep,grep-3.7-r0.aarch64.rpm,grep,用于打印与模式匹配的行,提供grep命令,用于在一个或多个输入文件中搜索包含匹配指定的模式,默认情况下,grep打印匹配的行。,glibc >= 2.34;libpcre1 >= 8.45 +gzip,gzip-1.11-r0.aarch64.rpm,gzip,GNU 数据压缩程序,包含GNU gzip数据压缩程序。,glibc >= 2.34 +http-parser,libhttp-parser2.9-2.9.4-r0.aarch64.rpm,libhttp-parser2.9,解析http的库,,/bin/sh;glibc >= 2.34 +initscripts,initscripts-10.12-1.aarch64.rpm,initscripts,提供System V初始化脚本的基本支持,提供System V初始化脚本的基本支持以及一些工具和实用程序。,/bin/sh;initd-functions +initscripts,initscripts-functions-10.12-1.aarch64.rpm,initscripts-functions,shell公共函数,提供一些基础的功能。, +iproute2,iproute2-ip-5.15.0-r0.aarch64.rpm,iproute2-ip,提供iproute2程序,提供ip.iproute2工具。,glibc >= 2.34;libcap >= 2.61;libelf1 >= 0.185 +iptables,iptables-1.8.7-r0.aarch64.rpm,iptables,用于管理Linux内核包过滤功能的工具,在Linux内核中控制网络包过滤代码,用于设置防火墙或IP伪装。, +iptables,iptables-module-ip6t-ah-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-ah,提供libip6t_ah.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-dnat-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-dnat,提供libip6t_DNAT.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-dnpt-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-dnpt,提供libip6t_DNPT.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-dst-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-dst,提供libip6t_dst.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-eui64-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-eui64,提供libip6t_eui64.so动态库,,iptables >= 1.8.7 +iptables,iptables-module-ip6t-frag-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-frag,提供libip6t_frag.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-hbh-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-hbh,提供libip6t_hbh.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-hl-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-hl,提供libip6t_HL.so和libip6t_hl.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-icmp6-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-icmp6,提供libip6t_icmp6.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-ipv6header-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-ipv6header,提供libip6t_ipv6header.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-log-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-log,提供libip6t_LOG.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-masquerade-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-masquerade,提供libip6t_MASQUERADE.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-mh-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-mh,提供libip6t_mh.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-netmap-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-netmap,提供libip6t_NETMAP.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-redirect-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-redirect,提供libip6t_REDIRECT.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-reject-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-reject,提供libip6t_REJECT.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-rt-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-rt,提供libip6t_rt.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-snat-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-snat,提供libip6t_SNAT.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-snpt-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-snpt,提供libip6t_SNPT.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ip6t-srh-1.8.7-r0.aarch64.rpm,iptables-module-ip6t-srh,提供libip6t_srh.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-ah-1.8.7-r0.aarch64.rpm,iptables-module-ipt-ah,提供libipt_ah.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-clusterip-1.8.7-r0.aarch64.rpm,iptables-module-ipt-clusterip,提供libipt_CLUSTERIP.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-dnat-1.8.7-r0.aarch64.rpm,iptables-module-ipt-dnat,提供libipt_DNAT.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-ecn-1.8.7-r0.aarch64.rpm,iptables-module-ipt-ecn,提供libipt_ECN.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-icmp-1.8.7-r0.aarch64.rpm,iptables-module-ipt-icmp,提供libipt_icmp.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-log-1.8.7-r0.aarch64.rpm,iptables-module-ipt-log,提供libipt_LOG.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-masquerade-1.8.7-r0.aarch64.rpm,iptables-module-ipt-masquerade,提供libipt_MASQUERADE.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-netmap-1.8.7-r0.aarch64.rpm,iptables-module-ipt-netmap,提供libipt_NETMAP.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-realm-1.8.7-r0.aarch64.rpm,iptables-module-ipt-realm,提供libipt_realm.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-redirect-1.8.7-r0.aarch64.rpm,iptables-module-ipt-redirect,提供libipt_REDIRECT.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-reject-1.8.7-r0.aarch64.rpm,iptables-module-ipt-reject,提供libipt_REJECT.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-snat-1.8.7-r0.aarch64.rpm,iptables-module-ipt-snat,提供libipt_SNAT.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-ttl-1.8.7-r0.aarch64.rpm,iptables-module-ipt-ttl,提供libipt_TTL.so和libipt_ttl.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-ipt-ulog-1.8.7-r0.aarch64.rpm,iptables-module-ipt-ulog,提供libipt_ULOG.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-addrtype-1.8.7-r0.aarch64.rpm,iptables-module-xt-addrtype,提供libxt_addrtype.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-audit-1.8.7-r0.aarch64.rpm,iptables-module-xt-audit,提供libxt_AUDIT.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-bpf-1.8.7-r0.aarch64.rpm,iptables-module-xt-bpf,提供libxt_bpf.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-cgroup-1.8.7-r0.aarch64.rpm,iptables-module-xt-cgroup,提供libxt_cgroup.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-checksum-1.8.7-r0.aarch64.rpm,iptables-module-xt-checksum,提供libxt_CHECKSUM.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-classify-1.8.7-r0.aarch64.rpm,iptables-module-xt-classify,提供libxt_CLASSIFY.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-cluster-1.8.7-r0.aarch64.rpm,iptables-module-xt-cluster,提供libxt_cluster.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-comment-1.8.7-r0.aarch64.rpm,iptables-module-xt-comment,提供libxt_comment.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-connbytes-1.8.7-r0.aarch64.rpm,iptables-module-xt-connbytes,提供libxt_connbytes.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-connlimit-1.8.7-r0.aarch64.rpm,iptables-module-xt-connlimit,提供libxt_connlimit.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-connmark-1.8.7-r0.aarch64.rpm,iptables-module-xt-connmark,提供libxt_CONNMARK.so和libxt_connmark.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-connsecmark-1.8.7-r0.aarch64.rpm,iptables-module-xt-connsecmark,提供libxt_CONNSECMARK.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-conntrack-1.8.7-r0.aarch64.rpm,iptables-module-xt-conntrack,提供libxt_conntrack.so和libxt_state.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-cpu-1.8.7-r0.aarch64.rpm,iptables-module-xt-cpu,提供libxt_cpu.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-ct-1.8.7-r0.aarch64.rpm,iptables-module-xt-ct,提供libxt_CT.so和libxt_NOTRACK.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-dccp-1.8.7-r0.aarch64.rpm,iptables-module-xt-dccp,提供libxt_dccp.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-devgroup-1.8.7-r0.aarch64.rpm,iptables-module-xt-devgroup,提供libxt_devgroup.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-dscp-1.8.7-r0.aarch64.rpm,iptables-module-xt-dscp,提供libxt_DSCP.so和libxt_dscp.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-ecn-1.8.7-r0.aarch64.rpm,iptables-module-xt-ecn,提供libxt_ecn.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-esp-1.8.7-r0.aarch64.rpm,iptables-module-xt-esp,提供libxt_esp.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-hashlimit-1.8.7-r0.aarch64.rpm,iptables-module-xt-hashlimit,提供ibxt_hashlimit.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-helper-1.8.7-r0.aarch64.rpm,iptables-module-xt-helper,提供libxt_helper.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-hmark-1.8.7-r0.aarch64.rpm,iptables-module-xt-hmark,提供libxt_HMARK.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-idletimer-1.8.7-r0.aarch64.rpm,iptables-module-xt-idletimer,提供libxt_IDLETIMER.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-ipcomp-1.8.7-r0.aarch64.rpm,iptables-module-xt-ipcomp,提供libxt_ipcomp.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-iprange-1.8.7-r0.aarch64.rpm,iptables-module-xt-iprange,提供libxt_iprange.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-ipvs-1.8.7-r0.aarch64.rpm,iptables-module-xt-ipvs,提供libxt_ipvs.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-led-1.8.7-r0.aarch64.rpm,iptables-module-xt-led,提供libxt_LED.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-length-1.8.7-r0.aarch64.rpm,iptables-module-xt-length,提供libxt_length.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-limit-1.8.7-r0.aarch64.rpm,iptables-module-xt-limit,提供libxt_limit.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-mac-1.8.7-r0.aarch64.rpm,iptables-module-xt-mac,提供libxt_mac.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-mark-1.8.7-r0.aarch64.rpm,iptables-module-xt-mark,提供libxt_MARK.so和libxt_mark.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-multiport-1.8.7-r0.aarch64.rpm,iptables-module-xt-multiport,提供libxt_multiport.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-nfacct-1.8.7-r0.aarch64.rpm,iptables-module-xt-nfacct,提供libxt_nfacct.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-nflog-1.8.7-r0.aarch64.rpm,iptables-module-xt-nflog,提供libxt_NFLOG.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-nfqueue-1.8.7-r0.aarch64.rpm,iptables-module-xt-nfqueue,提供libxt_NFQUEUE.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-osf-1.8.7-r0.aarch64.rpm,iptables-module-xt-osf,提供libxt_osf.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-owner-1.8.7-r0.aarch64.rpm,iptables-module-xt-owner,提供libxt_owner.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-physdev-1.8.7-r0.aarch64.rpm,iptables-module-xt-physdev,提供libxt_physdev.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-pkttype-1.8.7-r0.aarch64.rpm,iptables-module-xt-pkttype,提供libxt_pkttype.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-policy-1.8.7-r0.aarch64.rpm,iptables-module-xt-policy,提供libxt_policy.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-quota-1.8.7-r0.aarch64.rpm,iptables-module-xt-quota,提供libxt_quota.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-rateest-1.8.7-r0.aarch64.rpm,iptables-module-xt-rateest,提供libxt_RATEEST.so和libxt_rateest.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-recent-1.8.7-r0.aarch64.rpm,iptables-module-xt-recent,提供libxt_recent.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-rpfilter-1.8.7-r0.aarch64.rpm,iptables-module-xt-rpfilter,提供libxt_rpfilter.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-sctp-1.8.7-r0.aarch64.rpm,iptables-module-xt-sctp,提供libxt_sctp.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-secmark-1.8.7-r0.aarch64.rpm,iptables-module-xt-secmark,提供libxt_SECMARK.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-set-1.8.7-r0.aarch64.rpm,iptables-module-xt-set,提供libxt_SET.so和libxt_set.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-socket-1.8.7-r0.aarch64.rpm,iptables-module-xt-socket,提供libxt_socket.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-standard-1.8.7-r0.aarch64.rpm,iptables-module-xt-standard,提供libxt_standard.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-statistic-1.8.7-r0.aarch64.rpm,iptables-module-xt-statistic,提供libxt_statistic.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-string-1.8.7-r0.aarch64.rpm,iptables-module-xt-string,提供libxt_string.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-synproxy-1.8.7-r0.aarch64.rpm,iptables-module-xt-synproxy,提供libxt_SYNPROXY.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-tcp-1.8.7-r0.aarch64.rpm,iptables-module-xt-tcp,提供libxt_tcp.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-tcpmss-1.8.7-r0.aarch64.rpm,iptables-module-xt-tcpmss,提供libxt_TCPMSS.so和libxt_tcpmss.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-tcpoptstrip-1.8.7-r0.aarch64.rpm,iptables-module-xt-tcpoptstrip,提供libxt_TCPOPTSTRIP.so库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-tee-1.8.7-r0.aarch64.rpm,iptables-module-xt-tee,提供libxt_TEE.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-time-1.8.7-r0.aarch64.rpm,iptables-module-xt-time,提供libxt_time.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-tos-1.8.7-r0.aarch64.rpm,iptables-module-xt-tos,提供libxt_TOS.so和libxt_tos.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-tproxy-1.8.7-r0.aarch64.rpm,iptables-module-xt-tproxy,提供libxt_TPROXY.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-trace-1.8.7-r0.aarch64.rpm,iptables-module-xt-trace,提供libxt_TRACE.so动态库,,iptables >= 1.8.7 +iptables,iptables-module-xt-u32-1.8.7-r0.aarch64.rpm,iptables-module-xt-u32,提供libxt_u32.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iptables,iptables-module-xt-udp-1.8.7-r0.aarch64.rpm,iptables-module-xt-udp,提供libxt_udp.so动态库,,glibc >= 2.34;iptables >= 1.8.7 +iSulad,iSulad-2.0.10-r0.aarch64.rpm,iSulad,云原生轻量级容器解决方案,,/bin/sh;glibc >= 2.34;lcr >= 2.0.7;libcrypto1.1 >= 1.1.1m;libcurl4 >= 7.79.1;libevent >= 2.1.12;libevhtp >= 1.2.18;libhttp-parser2.9 >= 2.9.4;libz1 >= 1.2.11;yajl >= 2.1.0 +json-c,libjson-c5-0.15-r0.aarch64.rpm,libjson-c5,C中json实现,提供在C中处理json的动态库。,/bin/sh;glibc >= 2.34;glibc >= 2.34 +kmod,kmod-29-r0.aarch64.rpm,kmod,将模块加载到内核中,提供内核模块插入、删除、列出、检查属性、解析等工具。,glibc >= 2.34;libz1 >= 1.2.11 +lcr,lcr-2.0.6-r0.aarch64.rpm,lcr,轻量级容器,提供轻量级容器动态库。,/bin/sh;glibc >= 2.34;glibc >= 2.34;lxc >= 4.0.3;lxc >= 4.0.3;yajl >= 2.1.0;yajl >= 2.1.0 +less,less-590-r0.aarch64.rpm,less,文本文件浏览器,提供less等命令,用于查看文本,类似于more,但具有更多的能力。,glibc >= 2.34;libtinfo5 >= 6.2 +libaio,libaio1-0.3.112-r0.aarch64.rpm,libaio1,Linux原生异步I/O访问库,提供给POSIX异步I/O工具内核加速的异步I/O功能。,/bin/sh;glibc >= 2.34;glibc >= 2.34 +libarchive,libarchive-3.5.2-r0.aarch64.rpm,libarchive,用于处理流归档格式的库,提供创建和读取不同流存档格式的功能。,/bin/sh;glibc >= 2.34;glibc >= 2.34 +libcap,libcap-2.61-r0.aarch64.rpm,libcap,用于获取和设置POSIX.1e功能的库,数据包捕获函数库,用于捕获网卡数据或分析pcap格式的抓包报文。,/bin/sh;glibc >= 2.34;glibc >= 2.34 +libcap,libcap-bin-2.61-r0.aarch64.rpm,libcap-bin,提供libcap二进制工具,提供/usr/sbin/capsh、/usr/sbin/getcap、/usr/sbin/getpcaps、/usr/sbin/setcap,glibc >= 2.34;libcap >= 2.61 +libcap-ng,libcap-ng-0.8.2-r0.aarch64.rpm,libcap-ng,备用POSIX功能库,提供比传统libcap库更容易使用POSIX功能编程的库,/bin/sh;glibc >= 2.34;glibc >= 2.34 +libcap-ng,libcap-ng-bin-0.8.2-r0.aarch64.rpm,libcap-ng-bin,提供libcap-ng二进制工具,提供/usr/bin/captest、/usr/bin/filecap、/usr/bin/netcap、/usr/bin/pscap,glibc >= 2.34;libcap-ng >= 0.8.2 +libestr,libestr0-0.1.11-r0.aarch64.rpm,libestr0,字符串处理必备库,提供了rsyslog守护进程使用的字符串处理必备共享库,/bin/sh;glibc >= 2.34;glibc >= 2.34 +libevent,libevent-2.1.12-r0.aarch64.rpm,libevent,抽象异步事件通知库,libevent API提供了一种机制,在文件描述符上发生特定事件或达到超时后执行回调函数。libevent旨在替换事件驱动网络服务器中发现的异步事件循环。应用程序只需要调用event_dispatch(),然后就可以动态添加或删除事件,而不必更改事件循环。,/bin/sh;glibc >= 2.34 +libevhtp,libevhtp-1.2.18-r0.aarch64.rpm,libevhtp,libevhtp包的调试源,此软件包为libevhtp包提供调试源。调试源在开发使用此软件包的应用程序或调试此软件包时非常有用。,/bin/sh;glibc >= 2.34;libevent >= 2.1.12 +libfastjson,libfastjson4-0.99.9-r0.aarch64.rpm,libfastjson4,JSON解析库,一个JSON解析库,json-c的分叉,由rsyslog团队开发,用于rsyslog和liblognorm。此软件包包括libfastjson库。,/bin/sh;glibc >= 2.34 +libffi,libffi8-3.4.2-r0.aarch64.rpm,libffi8,外部函数接口库,libffi库为各种调用约定提供了一个可移植的高级编程接口。这允许程序员在运行时调用调用接口描述指定的任何函数。,/bin/sh;glibc >= 2.34 +libhugetlbfs,libhugetlbfs-2.23-r0.aarch64.rpm,libhugetlbfs,用于大型翻译Lookaside缓冲区文件系统的帮助程序库,libhugetlbfs包与Linux hugetlbfs交互,以透明的方式使大页面可供应用程序使用。,/bin/sh;glibc >= 2.34 +libnl,libnl-3-200-3.5.0-r0.aarch64.rpm,libnl-3-200,内核网络套接字的便利库,这个包包含一个方便的库,可以简化使用Linux内核的netlink套接字接口进行网络操作。,/bin/sh;glibc >= 2.34 +libnl,libnl-3-cli-3.5.0-r0.aarch64.rpm,libnl-3-cli,libnl3的命令行界面实用程序,此软件包包含各种libnl3实用程序和它们所依赖的其他库。,/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0;libnl-genl-3-200 >= 3.5.0;libnl-idiag-3-200 >= 3.5.0;libnl-nf-3-200 >= 3.5.0;libnl-route-3-200 >= 3.5.0 +libnl,libnl-genl-3-200-3.5.0-r0.aarch64.rpm,libnl-genl-3-200,Netlink操作库,提供libnl-genl-3.so.*,/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0 +libnl,libnl-idiag-3-200-3.5.0-r0.aarch64.rpm,libnl-idiag-3-200,libnl-idiag动态库,提供libnl-idiag-3.so.*,/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0 +libnl,libnl-nf-3-200-3.5.0-r0.aarch64.rpm,libnl-nf-3-200,NetFilter以及接口监控相关的Netlink操作库,提供libnl-nf-3.so.*,/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0;libnl-route-3-200 >= 3.5.0 +libnl,libnl-route-3-200-3.5.0-r0.aarch64.rpm,libnl-route-3-200,提供NETLINK_ROUTE家族的API接口库,提供libnl-route-3.so.*,/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0 +libnl,libnl-xfrm-3-200-3.5.0-r0.aarch64.rpm,libnl-xfrm-3-200,libnl-xfrm动态库,提供libnl-xfrm-3.so.*,/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0 +libpam,libpam-1.5.2-r0.aarch64.rpm,libpam,为应用程序提供身份验证的可扩展库,提供/lib64/libpam.so.*、/lib64/libpam_misc.so.*和/lib64/libpamc.so.*,/bin/sh;glibc >= 2.34 +libpam,pam-plugin-access-1.5.2-r0.aarch64.rpm,pam-plugin-access,pam_access.so动态库,提供/lib64/security/pam_access.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,libpam-runtime-1.5.2-r0.aarch64.rpm,libpam-runtime,pam实用程序,PAM(可插拔身份验证模块)是一种系统安全工具允许系统管理员设置身份验证策略而不必重新编译处理身份验证的程序。,config(libpam-runtime) = 1.5.2-r0;glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64;pam-plugin-deny-suffix64;pam-plugin-permit-suffix64;pam-plugin-unix-suffix64;pam-plugin-warn-suffix64 +libpam,pam-plugin-debug-1.5.2-r0.aarch64.rpm,pam-plugin-debug,pam_debug.so动态库,提供/lib64/security/pam_debug.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-deny-1.5.2-r0.aarch64.rpm,pam-plugin-deny,pam_deny.so动态库,提供/lib64/security/pam_deny.so,libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-echo-1.5.2-r0.aarch64.rpm,pam-plugin-echo,pam_echo.so动态库,提供/lib64/security/pam_echo.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-env-1.5.2-r0.aarch64.rpm,pam-plugin-env,pam_env.so动态库,提供/lib64/security/pam_env.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-exec-1.5.2-r0.aarch64.rpm,pam-plugin-exec,pam_exec.so动态库,提供/lib64/security/pam_exec.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-faildelay-1.5.2-r0.aarch64.rpm,pam-plugin-faildelay,pam_faildelay.so动态库,提供/lib64/security/pam_faildelay.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-faillock-1.5.2-r0.aarch64.rpm,pam-plugin-faillock,pam_faillock.so动态库,提供/lib64/security/pam_faillock.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-filter-1.5.2-r0.aarch64.rpm,pam-plugin-filter,pam_filter.so动态库,提供/lib64/security/pam_filter.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-ftp-1.5.2-r0.aarch64.rpm,pam-plugin-ftp,pam_ftp.so动态库,提供/lib64/security/pam_ftp.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-group-1.5.2-r0.aarch64.rpm,pam-plugin-group,pam_group.so动态库,提供/lib64/security/pam_group.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-issue-1.5.2-r0.aarch64.rpm,pam-plugin-issue,pam_issue.so动态库,提供/lib64/security/pam_issue.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-keyinit-1.5.2-r0.aarch64.rpm,pam-plugin-keyinit,pam_keyinit.so动态库,提供/lib64/security/pam_keyinit.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-lastlog-1.5.2-r0.aarch64.rpm,pam-plugin-lastlog,pam_lastlog.so动态库,提供/lib64/security/pam_lastlog.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-limits-1.5.2-r0.aarch64.rpm,pam-plugin-limits,pam_limits.so动态库,提供/lib64/security/pam_limits.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-listfile-1.5.2-r0.aarch64.rpm,pam-plugin-listfile,pam_listfile.so动态库,提供/lib64/security/pam_listfile.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-localuser-1.5.2-r0.aarch64.rpm,pam-plugin-localuser,pam_localuser.so动态库,提供/lib64/security/pam_localuser.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-loginuid-1.5.2-r0.aarch64.rpm,pam-plugin-loginuid,pam_loginuid.so动态库,提供/lib64/security/pam_loginuid.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-mail-1.5.2-r0.aarch64.rpm,pam-plugin-mail,pam_mail.so动态库,提供/lib64/security/pam_mail.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-mkhomedir-1.5.2-r0.aarch64.rpm,pam-plugin-mkhomedir,pam_mkhomedir.so动态库,提供/lib64/security/pam_mkhomedir.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-motd-1.5.2-r0.aarch64.rpm,pam-plugin-motd,pam_motd.so动态库,提供/lib64/security/pam_motd.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-namespace-1.5.2-r0.aarch64.rpm,pam-plugin-namespace,pam_namespace.so动态库,提供/lib64/security/pam_namespace.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-nologin-1.5.2-r0.aarch64.rpm,pam-plugin-nologin,pam_nologin.so动态库,提供/lib64/security/pam_nologin.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-permit-1.5.2-r0.aarch64.rpm,pam-plugin-permit,pam_permit.so动态库,提供/lib64/security/pam_permit.so,libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-pwhistory-1.5.2-r0.aarch64.rpm,pam-plugin-pwhistory,pam_pwhistory.so动态库,提供/lib64/security/pam_pwhistory.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-rhosts-1.5.2-r0.aarch64.rpm,pam-plugin-rhosts,pam_rhostsso动态库,提供/lib64/security/pam_rhostsso,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-rootok-1.5.2-r0.aarch64.rpm,pam-plugin-rootok,pam_rootok.so动态库,提供/lib64/security/pam_rootok.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-securetty-1.5.2-r0.aarch64.rpm,pam-plugin-securetty,pam_securetty.so动态库,提供/lib64/security/pam_securetty.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-setquota-1.5.2-r0.aarch64.rpm,pam-plugin-setquota,pam_setquota.so动态库,提供/lib64/security/pam_setquota.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-shells-1.5.2-r0.aarch64.rpm,pam-plugin-shells,pam_shells.so动态库,提供/lib64/security/pam_shells.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-stress-1.5.2-r0.aarch64.rpm,pam-plugin-stress,pam_stress.so动态库,提供/lib64/security/pam_stress.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-succeed-if-1.5.2-r0.aarch64.rpm,pam-plugin-succeed-if,pam_succeed_if.so动态库,提供/lib64/security/pam_succeed_if.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-time-1.5.2-r0.aarch64.rpm,pam-plugin-time,pam_time.so动态库,提供/lib64/security/pam_time.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-timestamp-1.5.2-r0.aarch64.rpm,pam-plugin-timestamp,pam_timestamp.so动态库,提供/lib64/security/pam_timestamp.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-umask-1.5.2-r0.aarch64.rpm,pam-plugin-umask,pam_umask.so动态库,提供/lib64/security/pam_umask.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-unix-1.5.2-r0.aarch64.rpm,pam-plugin-unix,pam_unix.so动态库,提供/lib64/security/pam_unix.so,libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-usertype-1.5.2-r0.aarch64.rpm,pam-plugin-usertype,pam_usertypeso动态库,提供/lib64/security/pam_usertypeso,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-warn-1.5.2-r0.aarch64.rpm,pam-plugin-warn,pam_warn.so动态库,提供/lib64/security/pam_warn.so,libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-wheel-1.5.2-r0.aarch64.rpm,pam-plugin-wheel,pam_wheel.so动态库,提供/lib64/security/pam_wheel.so,glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64 +libpam,pam-plugin-xauth-1.5.2-r0.aarch64.rpm,pam-plugin-xauth,pam_xauth.so动态库,提供/lib64/security/pam_xauth.so,libpam >= 1.5.2;libpam-suffix64 +libpcap,libpcap1-1.10.1-r0.aarch64.rpm,libpcap1,网络嗅探器库,libpcap是数据包嗅探器程序使用的库。它为他们提供了一个接口,用于捕获和分析来自网络设备的数据包。只有当您计划自己编译或编写这样的程序时,才需要此软件包。,/bin/sh;glibc >= 2.34 +libpcre,libpcre1-8.45-r0.aarch64.rpm,libpcre1,Perl兼容正则表达式的库,PCRE库是一组函数,使用与Perl 5相同的语法和语义实现正则表达式模式匹配;此PCRE库变体支持8位和UTF-8字符串。,/bin/sh;glibc >= 2.34 +libpwquality,libpwquality-1.4.4-r0.aarch64.rpm,libpwquality,密码生成和密码质量检查库,这是一个用于密码质量检查和生成通过检查的随机密码的库。此库使用破解库和破解库字典执行一些检查。,/bin/sh;cracklib >= 2.9.7;glibc >= 2.34;libpam >= 1.5.2 +libseccomp,libseccomp-2.5.3-r0.aarch64.rpm,libseccomp,增强的seccomp库,libseccomp库为Linux内核的syscall过滤机制(seccomp)提供了一个易于使用的接口。libseccomp API允许应用程序指定允许应用程序执行哪些syscall,以及可选的哪些syscall参数,所有这些都由Linux内核强制执行。,/bin/sh;glibc >= 2.34 +libselinux,libselinux1-3.3-r0.aarch64.rpm,libselinux1,SELinux运行时库,libselinux提供了一个接口,用于获取和设置进程和文件安全上下文,以及获取安全策略决策。(安全增强的Linux是内核和一些实施强制性访问控制策略的实用程序的一个功能,如类型实施、基于角色的访问控制和多级安全。),/bin/sh;glibc >= 2.34;libpcre1 >= 8.45 +libselinux,libselinux-bin-3.3-r0.aarch64.rpm,libselinux-bin,SELinux libselinux实用程序,"libselinux-bin软件包包含实用程序,",glibc >= 2.34;libpcre1 >= 8.45;libselinux1 >= 3.3;libsepol2 >= 3.3 +libsemanage,libsemanage2-3.3-r0.aarch64.rpm,libsemanage2,SELinux策略管理库,libsemanage是策略管理库。使用libsepol和libselinux与SELinux系统交互,它还调用帮助程序来加载策略和检查file_contexts配置是否有效。,/bin/sh;audit >= 3.0.1;glibc >= 2.34;libbz2-1 >= 1.0.8;libselinux1 >= 3.3;libsepol2 >= 3.3 +libsepol,libsepol2-3.3-r0.aarch64.rpm,libsepol2,SELinux二进制策略操作库,提供SELinux二进制策略操作库,/bin/sh;glibc >= 2.34 +libsepol,libsepol-bin-3.3-r0.aarch64.rpm,libsepol-bin,SELinux二进制策略操作工具,libsepol提供了一个用于操作SELinux二进制策略的API。它由checkpolicy(策略编译器)和类似的工具,以及需要对二进制策略执行特定转换(如自定义策略布尔设置)的程序使用。,glibc >= 2.34;libsepol2 >= 3.3 +libtirpc,libtirpc3-1.3.2-r0.aarch64.rpm,libtirpc3,与传输无关的RPC库,传输独立RPC库(TI-RPC)是glibc中不支持IPv6地址的标准SunRPC库的替代。此实现允许支持UDP和TCP over IPv4以外的其他传输。,/bin/sh;glibc >= 2.34 +libusb,libusb-1.0-0-1.0.24-r0.aarch64.rpm,libusb-1.0-0,USB库,Libusb是一个允许用户空间访问USB设备的库。,/bin/sh;glibc >= 2.34 +libwebsockets,libwebsockets-4.3.0-r0.aarch64.rpm,libwebsockets,用于Websockets的轻量级C库,这是用于轻量级websocket客户端和服务器的libwebsockets C库。,/bin/sh;glibc >= 2.34;libcrypto1.1 >= 1.1.1m;libssl1.1 >= 1.1.1m;libz1 >= 1.2.11 +libxml2,libxml2-2.9.12-r0.aarch64.rpm,libxml2,提供XML和HTML支持的库,此库允许操作XML文件。它包括读取、修改和写入XML和HTML文件的支持。DTD支持,这包括解析和验证,即使是复杂的DtD,可以在解析时或在修改文档后更晚。输出可以是简单的SAX流,也可以是内存中类似DOM的表示。在这种情况下,可以使用内置的XPath和XPointer实现来选择子节点或范围。提供灵活的输入/输出机制,具有现有的HTTP和FTP模块,并组合到URI库。,/bin/sh;glibc >= 2.34;libz1 >= 1.2.11 +libxml2,libxml2-utils-2.9.12-r0.aarch64.rpm,libxml2-utils,用于操作XML文件的实用程序,此软件包包含用于操作XML文件的实用程序。,glibc >= 2.34;libxml2 >= 2.9.12 +logrotate,logrotate-3.18.1-r0.aarch64.rpm,logrotate,用于旋转、压缩、邮寄和删除系统日志文件的Cron服务,logrotate实用程序自动旋转、压缩、邮寄和删除日志文件。Logrotate可以设置为每天、每周、每月或当日志文件达到一定大小时处理日志文件。通常,logrotate作为每日cron作业运行。它只管理普通文件,不参与systemd的日志轮换。,config(logrotate) = 3.18.1-r0;glibc >= 2.34;libacl1 >= 2.3.1;libpopt0 >= 1.18 +lvm2,lvm2-2.03.14-r0.aarch64.rpm,lvm2,Userland逻辑卷管理工具,LVM2包括处理物理卷(硬盘、RAID系统、磁光等,多个设备(MD),请参阅mdm(8),甚至环路设备,请参见Lostup(8))上的读/写操作的所有支持,从一个或多个物理卷创建卷组(虚拟磁盘种类),并在卷组中创建一个或多个逻辑卷(逻辑分区种类)。,/bin/sh;config(lvm2) = 2.03.14-r0;glibc >= 2.34;libaio1 >= 0.3.112;libblkid1 >= 2.37.2 +lvm2,lvm2-scripts-2.03.14-r0.aarch64.rpm,lvm2-scripts,提供blkdeactivate、fsadm、lvmdum命令,提供/usr/sbin/blkdeactivate、/usr/sbin/fsadm和/usr/sbin/lvmdump,bash;lvm2 = 2.03.14-r0 +lxc,lxc-4.0.3-r0.aarch64.rpm,lxc,Linux内核容器的用户空间工具,LXC是众所周知的、经过严格测试的低层次Linux容器运行时。,/bin/sh;gcc-bin-toolchain-compilerlibs-aarch64 >= 1.0;glibc >= 2.34;libcap >= 2.61;libseccomp >= 2.5.3;yajl >= 2.1.0 +ncurses,libform5-6.3-r0.aarch64.rpm,libform5,libform动态库,提供/usr/lib64/libform.so.*,/bin/sh;glibc >= 2.34;libncurses5 >= 6.3 +ncurses,libmenu5-6.3-r0.aarch64.rpm,libmenu5,libmenu动态库,提供/usr/lib64/libmenu.so.*,/bin/sh;glibc >= 2.34;libncurses5 >= 6.3 +ncurses,libncurses5-6.3-r0.aarch64.rpm,libncurses5,libncurses动态库,提供/lib64/libncurses.so.*,/bin/sh;glibc >= 2.34;libtinfo5 >= 6.3 +ncurses,libpanel5-6.3-r0.aarch64.rpm,libpanel5,libpanel动态库,提供/usr/lib64/libpanel.so.*,/bin/sh;glibc >= 2.34;libncurses5 >= 6.3 +ncurses,libtinfo5-6.3-r0.aarch64.rpm,libtinfo5,libtinfo动态库,提供/lib64/libtinfo.so.*,/bin/sh;glibc >= 2.34 +ncurses,ncurses-6.3-r0.aarch64.rpm,ncurses,CRT屏幕处理和优化包,提供/usr/bin/tput、/usr/bin/tset功能,glibc >= 2.34;libtinfo5 >= 6.3 +ncurses,ncurses-terminfo-6.3-r0.aarch64.rpm,ncurses-terminfo,终端描述数据库,这是ncures包中维护的术语信息基本数据库。此数据库是4.4BSD术语帽文件的官方继承者,包含有关任何已知终端的信息。ncures库利用此数据库正确使用终端。,ncurses-terminfo-base +ncurses,ncurses-terminfo-base-6.3-r0.aarch64.rpm,ncurses-terminfo-base,提供终端信息基础,提供/etc/terminfo/*, +nfs-utils,nfs-utils-2.5.4-r0.aarch64.rpm,nfs-utils,NFS实用程序以及内核NFS服务器的支持客户端和守护程序,nfs-utils软件包为内核NFS服务器和相关工具提供了一个守护程序,它提供了比大多数用户使用的传统Linux NFS服务器更高的性能级别。,glibc >= 2.34;libblkid1 >= 2.37.2;libtirpc3 >= 1.3.2;libuuid1 >= 2.37.2;nfs-utils-client +nfs-utils,nfs-utils-client-2.5.4-r0.aarch64.rpm,nfs-utils-client,查询远程主机上的装载守护程序,此软件包还包含showmount程序。Showmount查询远程主机上的装载守护程序,以了解有关远程主机上NFS(网络文件系统)服务器的信息。例如,showmount可以显示装载在该主机上的客户端。,config(nfs-utils-client) = 2.5.4-r0;glibc >= 2.34;libcap >= 2.61;libtirpc3 >= 1.3.2;nfs-utils-mount +nfs-utils,nfs-utils-mount-2.5.4-r0.aarch64.rpm,nfs-utils-mount,挂载或卸载文件系统,此软件包还包含mount.nfs和umount.nfs程序。,glibc >= 2.34;libmount1 >= 2.37.2;libtirpc3 >= 1.3.2 +openssh,openssh-keygen-8.8p1-r0.aarch64.rpm,openssh-keygen,生成ssh公钥认证所需的公钥和私钥文件,提供/usr/bin/ssh-keygen,glibc >= 2.34 +openssh,openssh-misc-8.8p1-r0.aarch64.rpm,openssh-misc,ssh远程登陆管理主机,提供/usr/bin/ssh、/usr/bin/ssh-add、/usr/bin/ssh-agent、/usr/bin/ssh-copy-id、/usr/bin/ssh-keyscan等,glibc >= 2.34;libz1 >= 1.2.11 +openssh,openssh-scp-8.8p1-r0.aarch64.rpm,openssh-scp,远程复制命令,提供/usr/bin/scp,glibc >= 2.34 +openssh,openssh-sftp-8.8p1-r0.aarch64.rpm,openssh-sftp,远程文件传输服务,提供/usr/bin/sftp,glibc >= 2.34 +openssh,openssh-sftp-server-8.8p1-r0.aarch64.rpm,openssh-sftp-server,”sftp“协议的服务器端程序使用加密的方式进行文件传输,提供/usr/libexec/sftp-server,glibc >= 2.34 +openssh,openssh-ssh-8.8p1-r0.aarch64.rpm,openssh-ssh,ssh服务配置文件,提供/etc/ssh/ssh_config,config(openssh-ssh) = 8.8p1-r0 +openssh,openssh-sshd-8.8p1-r0.aarch64.rpm,openssh-sshd,ssh服务进程启动,提供/usr/sbin/sshd、/usr/libexec/openssh/sshd_check_keys等,config(openssh-sshd) = 8.8p1-r0;glibc >= 2.34;libpam >= 1.5.2;libz1 >= 1.2.11;openssh-keygen;pam-plugin-keyinit;pam-plugin-loginuid +openssl,openssl-conf-1.1.1m-r0.aarch64.rpm,openssl-conf,openssl的主配置文件,提供/etc/ssl/openssl.cnf,config(openssl-conf) = 1.1.1m-r0 +openssl,libcrypto1.1-1.1.1m-r0.aarch64.rpm,libcrypto1.1,OpenSSL crypto库,提供/usr/lib64/libcrypto.so.*,/bin/sh;glibc >= 2.34 +openssl,libssl1.1-1.1.1m-r0.aarch64.rpm,libssl1.1,OpenSSL SSL库,提供/usr/lib64/libssl.so.*,/bin/sh;glibc >= 2.34;libcrypto1.1 >= 1.1.1m +os-release,os-release-1.0-r0.noarch.rpm,os-release,添加openeuler版本信息,添加openeuler版本信息,同时添加os-revision记录构建时间戳。生成的镜像也放到时间戳目录便于区分不同版本, +os-base,os-base-1.0-r1.aarch64.rpm,os-base,提供OS基础,提供hostname、passwd、modules等配置信息, +pciutils,libpci3-3.7.0-r0.aarch64.rpm,libpci3,PCI实用程序库,libpci提供了对PCI配置空间的访问,/bin/sh;glibc >= 2.34;libz1 >= 1.2.11 +pciutils,pciutils-3.7.0-r0.aarch64.rpm,pciutils,Linux内核的PCI实用程序,lspci:此程序显示有关系统中所有PCI总线和设备的详细信息,取代原始的/proc/pci接口;setpci:此程序允许读取和写入PCI设备配置寄存器。例如,您可以使用它调整延迟计时器;update-pciids:此程序下载pci.ids文件的当前版本。,glibc >= 2.34;libpci3 >= 3.7.0;libz1 >= 1.2.11;pciutils-ids +pciutils,pciutils-ids-3.7.0-r0.aarch64.rpm,pciutils-ids,存放系统所有支持和不支持的硬件信息,提供/usr/share/hwdata/pci.ids.gz, +policycoreutils,policycoreutils-3.3-r0.aarch64.rpm,policycoreutils,显示当前seinux信息修改selinux策略内各项规则的布尔值,提供/etc/pam.d、/sbin/setsebool、/usr/bin/sestatus和/var/lib/selinux,glibc >= 2.34;libselinux1 >= 3.3;libsemanage2 >= 3.3 +policycoreutils,policycoreutils-fixfiles-3.3-r0.aarch64.rpm,policycoreutils-fixfiles,检查或矫正文件系统中的安全环境数据库,提供/sbin/fixfiles,policycoreutils-setfiles +policycoreutils,policycoreutils-hll-3.3-r0.aarch64.rpm,policycoreutils-hll,提供/usr/libexec/selinux/hll/pp,提供/usr/libexec/selinux/hll/pp,glibc >= 2.34;libsepol2 >= 3.3 +policycoreutils,policycoreutils-loadpolicy-3.3-r0.aarch64.rpm,policycoreutils-loadpolicy,装载或替换新的二进制策略到内核中保持使用当前的Bootlean值,提供/sbin/load_policy,glibc >= 2.34;libselinux1 >= 3.3;libsepol2 >= 3.3 +policycoreutils,policycoreutils-semodule-3.3-r0.aarch64.rpm,policycoreutils-semodule,可以显示、加载、删除模块,提供/sbin/semodule,glibc >= 2.34;libselinux;libsemanage2 >= 3.3;libsepol2 >= 3.3 +policycoreutils,policycoreutils-sestatus-3.3-r0.aarch64.rpm,policycoreutils-sestatus,显示系统的详细状态,提供/etc/sestatus.conf和/sbin/sestatus,libselinux;policycoreutils +policycoreutils,policycoreutils-setfiles-3.3-r0.aarch64.rpm,policycoreutils-setfiles,恢复或更改一部分文件的标签,提供/sbin/restorecon、/sbin/restorecon_xattr和/sbin/setfiles,glibc >= 2.34;libselinux1 >= 3.3;libsepol2 >= 3.3 +popt,libpopt0-1.18-r0.aarch64.rpm,libpopt0,一个用于解析命令行参数的C库,Popt是一个用于解析命令行参数的C库。Popt受到getopt()和getopt_long()函数的严重影响。它通过允许更强大的参数扩展来改进它们。Popt可以解析任意argv[]样式数组,并根据命令行参数自动设置变量。Popt允许通过配置文件别名命令行参数,并包括用于使用类似shell的规则将任意字符串解析为argv[]数组的实用程序函数。,/bin/sh;glibc >= 2.34 +procps,libprocps8-3.3.17-r0.aarch64.rpm,libprocps8,procps库,procps库可用于从/proc读取进程信息pseudo-file系统中的信息。,/bin/sh;glibc >= 2.34 +procps,procps-3.3.17-r0.aarch64.rpm,procps,/proc的ps实用程序,procps包包含一组提供系统信息的系统实用程序。Procps包括ps、free、skill、snice、tload、top、uptime、vmstat、w和watch。,glibc >= 2.34;libncurses5 >= 6.3;libprocps8 >= 3.3.17;libtinfo5 >= 6.3;procps-sysctl +procps,procps-sysctl-3.3.17-r0.aarch64.rpm,procps-sysctl,控制和配置Linux内核及网络设置,提供/etc/sysctl.conf,procps-lib +psmisc,pstree-23.4-r0.aarch64.rpm,pstree,显示进程状态树,列出当前的进程,以及它们的树状结构,glibc >= 2.34;libtinfo5 >= 6.3 +quota,quota-4.06-r0.aarch64.rpm,quota,用于监控用户磁盘使用情况的系统管理工具,包含系统管理工具,用于监控和限制每个文件系统的用户和或组磁盘使用情况。,glibc >= 2.34;libcom-err2 >= 1.46.4;libext2fs2 >= 1.46.4;libtirpc3 >= 1.3.2 +readline,libreadline8-8.1-r0.aarch64.rpm,libreadline8,Readline库,readline库由 Bourne Again Shell(bash,标准命令解释器)用于轻松编辑命令行。这包括历史记录和搜索功能。,/bin/sh;config(libreadline8) = 8.1-r0;glibc >= 2.34;libtinfo5 >= 6.3 +rsyslog,rsyslog-8.2110.0-r0.aarch64.rpm,rsyslog,用于Linux和Unix的增强系统日志,Rsyslog是一个增强的多线程syslogd,支持MySQL、syslog/tcp、RFC 3195、允许的发件人列表、对任何消息部分的过滤和细粒度输出格式控制。它与库存sysklogd相当兼容,可以用作直接替换。它的高级功能使它适合企业级、加密保护的系统日志中继链,同时也非常容易为新手用户设置。,config(rsyslog) = 8.2110.0-r0;glibc >= 2.34;libcurl4 >= 7.79.1;libestr0 >= 0.1.11;libfastjson4 >= 0.99.9;libuuid1 >= 2.37.2;libz1 >= 1.2.11;logrotate +sed,sed-4.8-r0.aarch64.rpm,sed,GNU流文本编辑器,sed(流编辑器)编辑器是流或批处理(非交互式)编辑器。Sed将文本作为输入,对文本执行操作或一组操作,并输出修改后的文本。sed执行的操作(替换、删除、插入等)可以在脚本文件或命令行中指定。,glibc >= 2.34 +shadow,shadow-4.9-r0.aarch64.rpm,shadow,用于管理用户和组帐户的实用程序,此软件包包括将普通密码文件转换为影子密码格式以及管理用户和组帐户所需的程序。,glibc >= 2.34;libpam >= 1.5.2;libpam-runtime;pam-plugin-env;pam-plugin-faildelay;pam-plugin-group;pam-plugin-lastlog;pam-plugin-limits;pam-plugin-mail;pam-plugin-motd;pam-plugin-nologin;pam-plugin-rootok;pam-plugin-securetty;pam-plugin-shells;shadow-base;shadow-securetty +shadow,shadow-base-4.9-r0.aarch64.rpm,shadow-base,提供sg工具,提供/usr/bin/sg工具, +shadow,shadow-securetty-4.8.1-r1.aarch64.rpm,shadow-securetty,安全终端,提供/etc/securetty, +squashfs-tools,squashfs-tools-4.5-r0.aarch64.rpm,squashfs-tools,用于创建squashfs文件系统的实用程序,squashfs是Linux的高度压缩只读文件系统。此软件包包含用于操作squashfs文件系统的实用程序。,glibc >= 2.34;liblzma5 >= 5.2.5;libz1 >= 1.2.11 +strace,strace-5.14-r0.aarch64.rpm,strace,跟踪和显示与正在运行的进程关联的系统调用,strace程序拦截并记录运行进程调用和接收的系统调用。strace可以打印每个系统调用、其参数和返回值的记录。strace对于诊断问题和调试以及教学目的都很有用。,glibc >= 2.34 +tzdata,tzdata-core-2021e-r0.aarch64.rpm,tzdata-core,时区说明,描述可用时区的配置文件。,tzdata-core-2021e-r0.aarch64.rpm ;config(tzdata-core) = 2021e-r0 +util-linux,libblkid1-2.37.2-r0.aarch64.rpm,libblkid1,块设备ID库,块设备识别库,util-linux的一部分。,/bin/sh;glibc >= 2.34 +util-linux,libfdisk1-2.37.2-r0.aarch64.rpm,libfdisk1,文件系统检测库,用于文件系统检测的库。,/bin/sh;glibc >= 2.34;libblkid1 >= 2.37.2;libuuid1 >= 2.37.2 +util-linux,libmount1-2.37.2-r0.aarch64.rpm,libmount1,设备挂载库,设计用于低级实用程序的库,如mount(8)和/usr/sbin/mount,/bin/sh;glibc >= 2.34;libblkid1 >= 2.37.2 +util-linux,libuuid1-2.37.2-r0.aarch64.rpm,libuuid1,用于生成UUID的库,用于生成通用唯一ID(UUID)的库。,/bin/sh;glibc >= 2.34 +util-linux,util-linux-su-2.37.2-r0.aarch64.rpm,util-linux-su,用于变更为其他使用者的身份,提供su命令,用于变更使用者身份,glibc >= 2.34;libpam >= 1.5.2 +xz,liblzma5-5.2.5-r0.aarch64.rpm,liblzma5,Lempel–Ziv–Markov 链算法压缩库,用于编码/解码LZMA文件的库。,/bin/sh;glibc >= 2.34 +xz,xz-5.2.5-r0.aarch64.rpm,xz,LZMA压缩实用程序,XZ Utils试图使LZMA压缩易于在自由(如自由)操作系统上使用。这是通过提供类似于使用的工具和库来实现的,而不是最流行的现有压缩算法的等效工具和库。LZMA是由伊戈尔·巴甫洛夫设计的通用压缩算法,作为7-Zip的一部分。它提供了高压缩比,同时保持了快速的解压缩速度。,glibc >= 2.34;liblzma5 >= 5.2.5 +yajl,yajl-2.1.0-r0.aarch64.rpm,yajl,又一个JSON库(YAJL),又是一个JSON库。YAJL是一个用ANSI C编写的小型事件驱动(SAX风格)JSON解析器,也是一个小型验证JSON生成器。,/bin/sh;glibc >= 2.34 +zlib,libz1-1.2.11-r0.aarch64.rpm,libz1,实现DEFLATE压缩算法的库,zlib是一个通用的无损数据压缩库,实现了DEFLATE算法的API,例如gzip和ZIP存档格式正在使用后者。,/bin/sh;glibc >= 2.34 diff --git a/docs/source/features/software_package_description.rst b/docs/source/features/software_package_description.rst index 1a8853595f1f74fcfcc80d77cb695bd39123d286..f01428943baef83b935c6a684f61ad2294da4e95 100644 --- a/docs/source/features/software_package_description.rst +++ b/docs/source/features/software_package_description.rst @@ -4,296 +4,5 @@ ########################## .. csv-table:: - :header: "软件名称","RPM名称","软件包名称","功能说明","详细情况","依赖关系" - :widths: 10,50,20,50,80,80 - - "acl", "acl-2.3.1-r0.aarch64.rpm", "acl", "提供操纵访问控制列表的命令", "提供操作程序控制列表的getfacl和setfacl程序。", "glibc >= 2.34;libacl1 >= 2.3.1;" - "acl", "libacl1-2.3.1-r0.aarch64.rpm", "libacl1", "提供用于访问POSIX访问控制列表的动态库", "提供libacl.so动态库,其中包含POSIX 1003.1e标准草案中用于操作访问控制列表的17个函数。", "/bin/sh;glibc >= 2.34;libattr1 >= 2.5.1" - "attr", "attr-2.5.1-r0.aarch64.rpm", "attr", "用于管理文件系统扩展属性", "一种在文件系统对象上操作扩展属性的工具集,特别是getfattr和setfattr工具。;还提供了一个attr命令,它在很大程度上兼容使用同名的SGI IRIX工具。", "glibc >= 2.34;libattr1 >= 2.5.1" - "attr", "libattr1-2.5.1-r0.aarch64.rpm", "libattr1", "提供文件扩展属性支持的动态库", "提供libattr.so动态库,其中包含扩展属性库函数。", "" - "audit", "audispd-plugins-3.0.1-r0.aarch64.rpm", "audispd-plugins", "提供审计事件调度器的插件", "为audit系统、audispd的实时接口的提供插件;;此插件能够传达事件到远端及其或者为分析可疑行为的事件。", "" - "audit", "audit-3.0.1-r0.aarch64.rpm", "audit", "为审计提供用户空间工具", "通过审计系统提供用户空间程序来存储和搜索审计记录生成。", "/bin/sh;glibc >= 2.34;libcap-ng >= 0.8.2" - "audit", "auditd-3.0.1-r0.aarch64.rpm", "auditd", "提供audit的守护进程", "", "audit >= 3.0.1;config(auditd) = 3.0.1-r0;glibc >= 2.34;libcap-ng >= 0.8.2" - "bash", "bash-5.1.8-r0.aarch64.rpm", "bash", "命令处理器", "与sh兼容的命令解释器,从标准输入或文件中读取来执行命令,并结合了ksh和csh的有用功能。", "/bin/sh;glibc >= 2.34;glibc >= 2.34;libtinfo5 >= 6.2;libtinfo5 >= 6.2" - "bind", "bind-9.11.14-r0.aarch64.rpm", "bind", "域名系统(DNS)协议的一种实现", "提供DNS服务器,将主机名转换为IP地址;;提供解析器库,是与DNS交互式应用程序使用的例程;;提供工具,验证DNS服务是否正常运行。", "/bin/sh;config(bind) = 9.11.14-r0;glibc >= 2.34;libcap >= 2.61;libcrypto1.1 >= 1.1.1m;libz1 >= 1.2.11" - "bind", "bind-utils-9.11.14-r0.aarch64.rpm", "bind-utils", "用于查询DNS名称服务器", "从DNS名称服务器中获取信息。", "bind >= 9.11.14;glibc >= 2.34;libreadline8 >= 8.1" - "binutils", "libbfd-2.37-r0.aarch64.rpm", "libbfd", "二进制描述器", "提供libbfd-2.37.so动态库。", "/bin/sh;glibc >= 2.34;libz1 >= 1.2.11" - "busybox", "busybox-1.34.1-r1.aarch64.rpm", "busybox", "许多常见UNIX实用程序的微小版本组合", "替代通常在filetuils、shellutils、findutils、textutils、grep、gzip、tar等中的实用程序,;提供相当完整的POSIX小型或嵌入式系统环境。", "glibc >= 2.34;libtirpc3 >= 1.3.2" - "busybox", "busybox-linuxrc-1.34.1-r1.aarch64.rpm", "busybox-linuxrc", "提供初始化程序", "提供linuxrc和init程序。", "busybox" - "bzip2", "libbz2-1-1.0.8-r0.aarch64.rpm", "libbz2-1", "bzip2运行时库", "提供libbz2.so.1动态库。", "/bin/sh;glibc >= 2.34;glibc >= 2.34" - "cifs-utils", "cifs-utils-6.14-r0.aarch64.rpm", "cifs-utils", "用于执行和管理Linu CIFS文件系统的挂载", "包含用于执行和管理Linux CIFS文件系统挂载的使用程序。", "glibc >= 2.34" - "cracklib", "cracklib-2.9.7-r0.aarch64.rpm", "cracklib", "使用字典破解密码的库", "测试密码以确定它们是否匹配一定的安全导向特性,可阻止用户选择太过简单的密码。", "/bin/sh;glibc >= 2.34;libz1 >= 1.2.11" - "cronie", "cronie-1.5.7-r0.aarch64.rpm", "cronie", "用于周期性执行指令", "提供cron的守护进程,cron用于在特定时间自动启动任务程序。", "config(cronie) = 1.5.7-r0;glibc >= 2.34;libpam >= 1.5.2;libpam-runtime;pam-plugin-access;pam-plugin-loginuid" - "curl", "curl-7.79.1-r0.aarch64.rpm", "curl", "用于从远端服务器获取文件", "一个命令行工具,用于使用URL语法传输数据,支持多种协议和大量有用的技巧。", "glibc >= 2.34;libcurl4 >= 7.79.1" - "curl", "libcurl4-7.79.1-r0.aarch64.rpm", "libcurl4", "用于从URL传输数据的库", "curl共享库,用于使用不同的网络协议访问数据", "/bin/sh;glibc >= 2.34" - "dhcp", "dhcp-4.4.2-r0.aarch64.rpm", "dhcp", "提供ISC DHCP软件使用的常用程序", "包含ISC DHCP服务端和客户端使用的常用程序。", "bind >= 9.11.14;dhcp-libs >= 4.4.2;glibc >= 2.34" - "dhcp", "dhcp-libs-4.4.2-r0.aarch64.rpm", "dhcp-libs", "ISC DHCP服务端和客户端使用的共享库", "提供ISC DHCP服务端和客户端使用的共享库。", "/bin/sh;glibc >= 2.34" - "dhcp", "dhcp-server-4.4.2-r0.aarch64.rpm", "dhcp-server", "提供ISC DHCP服务端", "提供DHCP服务端和dhcp守护进程。", "/bin/sh;bind >= 9.11.14;dhcp-libs >= 4.4.2;glibc >= 2.34" - "dhcp", "dhcp-server-config-4.4.2-r0.aarch64.rpm", "dhcp-server-config", "ISC DHCP服务端配置", "提供默认的DHCP服务端和dhcp守护进程配置文件。", "/etc;/etc/default;/etc/default/dhcp-server;/etc/dhcp;/etc/dhcp/dhcpd.conf" - "dosfstools", "dosfstools-4.2-r0.aarch64.rpm", "dosfstools", "用于创建和检查MS-DOS FAT文件系统", "包含用于Linux中 创建和检查硬盘或软盘上的MS-DOS FAT文件系统的两个工具。", "glibc >= 2.34" - "e2fsprogs", "e2fsprogs-1.46.4-r0.aarch64.rpm", "e2fsprogs", "用于管理ext2、ext3和ext4文件系统", "包含许多用于ext2、ext3和ext4文件系统中创建、检查、修改和纠正任何不一致的程序。", "e2fsprogs-badblocks;e2fsprogs-dumpe2fs;glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4;libe2p2 >= 1.46.4;libext2fs2 >= 1.46.4;libss2 >= 1.46.4;libuuid1 >= 2.37.2" - "e2fsprogs", "e2fsprogs-badblocks-1.46.4-r0.aarch64.rpm", "e2fsprogs-badblocks", "用于检查磁盘装置中损坏的区块", "提供badblocks命令,用于检查磁盘装置中损坏的区块。", "glibc >= 2.34;libcom-err2 >= 1.46.4;libext2fs2 >= 1.46.4" - "e2fsprogs", "e2fsprogs-dumpe2fs-1.46.4-r0.aarch64.rpm", "e2fsprogs-dumpe2fs", "用于查看格式化之后的文件系统信息", "提供dumpe2fs命令,用于查看格式化之后的文件系统信息。", "glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4;libe2p2 >= 1.46.4;libext2fs2 >= 1.46.4" - "e2fsprogs", "e2fsprogs-e2fsck-1.46.4-r0.aarch64.rpm", "e2fsprogs-e2fsck", "用于检查使用Linux ext2档案系统的partition", "提供e2fsck命令,用于检查使用Linux ext2档案系统的partition是否正常工作。", "glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4;libe2p2 >= 1.46.4;libext2fs2 >= 1.46.4;libuuid1 >= 2.37.2" - "e2fsprogs", "e2fsprogs-mke2fs-1.46.4-r0.aarch64.rpm", "e2fsprogs-mke2fs", "用于建立ext2文件系统", "提供mke2fs.conf和mke2fs.e2fsprogs,mke2fs命令用于建立ext2文件系统。", "glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4;libe2p2 >= 1.46.4;libext2fs2 >= 1.46.4;libuuid1 >= 2.37.2" - "e2fsprogs", "e2fsprogs-tune2fs-1.46.4-r0.aarch64.rpm", "e2fsprogs-tune2fs", "调整和查看ext2/ext3文件系统参数的命令行工具", "提供e2label、tune2fs.e2fsprogs命令", "glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4;libe2p2 >= 1.46.4;libext2fs2 >= 1.46.4;libuuid1 >= 2.37.2" - "e2fsprogs", "libcom-err2-1.46.4-r0.aarch64.rpm", "libcom-err2", "e2fsprogs报错库", "一个错误信息显示库。", "/bin/sh;glibc >= 2.34" - "e2fsprogs", "libe2p2-1.46.4-r0.aarch64.rpm", "libe2p2", "e2fsprogs共享库", "提供libe2p.so.2和libe2p.so.2.3动态库。", "/bin/sh;glibc >= 2.34" - "e2fsprogs", "libext2fs2-1.46.4-r0.aarch64.rpm", "libext2fs2", "e2fsprogs共享库", "提供libext2fs2.so.2和libext2fs.2.4动态库。", "/bin/sh;glibc >= 2.34;libblkid1 >= 2.37.2;libcom-err2 >= 1.46.4" - "e2fsprogs", "libss2-1.46.4-r0.aarch64.rpm", "libss2", "e2fsprogs共享库", "提供libss.so.2和libss.so.2.0动态库。", "/bin/sh;glibc >= 2.34;glibc >= 2.34;libcom-err2 >= 1.46.4;libcom-err2 >= 1.46.4" - "elfutils", "libasm1-0.185-r0.aarch64.rpm", "libasm1", "用于处理编译对象的实用程序和DSO集合", "提供libasm-0.185.so和libasm.so.1动态库", "/bin/sh;glibc >= 2.34;libdw1 >= 0.185;libelf1 >= 0.185" - "elfutils", "libelf1-0.185-r0.aarch64.rpm", "libelf1", "读写ELF文件的库", "提供libelf-0.185.so好libelf.so.1动态库", "/bin/sh;glibc >= 2.34;libz1 >= 1.2.11" - "elfutils", "libdw1-0.185-r0.aarch64.rpm", "libdw1", "访问DWARF调试信息的库", "提供libdw-0.185.so和libdw.so.1动态库", "glibc >= 2.34;libelf1 >= 0.185;libz1 >= 1.2.11" - "ethtool", "ethtool-5.15-r0.aarch64.rpm", "ethtool", "以太网网卡的设置工具", "允许在许多网络设备尤其是以太网设备中查询和更改设置,;例如速度、端口、自动协商、PCI位置、校验和卸载。", "glibc >= 2.34" - "expat", "libexpat1-2.4.1-r0.aarch64.rpm", "libexpat1", "XML解析器工具包", "提供libexpat.so.1好libexpat.so.1.8.1动态库", "/bin/sh;glibc >= 2.34" - "gdb", "gdb-11.1-r0.aarch64.rpm", "gdb", "用于C、C++、Fortran和其他语言的GNU源代码级调试器", "GDB是GNU调试器,允许您调试用C、C++、Java和其他语言编写的程序,方法是以受控的方式执行这些程序并打印它们的数据。", "gcc-bin-toolchain-compilerlibs-aarch64 >= 1.0;glibc >= 2.34;libexpat1 >= 2.4.1;libgmp10 >= 6.2.1;libreadline8 >= 8.1;libtinfo5 >= 6.3" - "gdb", "gdbserver-11.1-r0.aarch64.rpm", "gdbserver", "GDB(GNU源级调试器)的独立服务器", "此软件包提供了一个程序,允许您在运行正在调试程序的计算机之外的计算机上运行GDB。openEuler Embedded 330 版本中,SDK中暂时不支持主机端交叉调试工具gdb,可以使用gdb-multiarch代替,一般都可以通过zypper/apt/yum 安装(openeuler镜像暂不支持)。", "gcc-bin-toolchain-compilerlibs-aarch64 >= 1.0;glibc >= 2.34" - "glib-2.0", "libglib-2.0-0-2.68.1-r0.aarch64.rpm", "libglib-2.0-0", "通用使用程序库", "", "/bin/sh;glibc >= 2.34;libffi8 >= 3.4.2;libmount1 >= 2.37.2;libpcre1 >= 8.45;libz1 >= 1.2.11" - "glibc", "glibc-2.34-r1.aarch64.rpm", "glibc", "GNU C库", "包含重要的共享库集:标准C库和标准数学库。", "/bin/sh" - "gmp", "libgmp10-6.2.1-r0.aarch64.rpm", "libgmp10", "一个用于计算巨大数字的库", "GMP是一个用于任意精度算术的库,对有符号整数、有理数和浮点数进行操作。", "/bin/sh;glibc >= 2.34" - "grep", "grep-3.7-r0.aarch64.rpm", "grep", "用于打印与模式匹配的行", "提供grep命令,用于在一个或多个输入文件中搜索包含匹配指定的模式,;默认情况下,grep打印匹配的行。", "glibc >= 2.34;libpcre1 >= 8.45" - "gzip", "gzip-1.11-r0.aarch64.rpm", "gzip", "GNU 数据压缩程序", "包含GNU gzip数据压缩程序。", "glibc >= 2.34" - "http-parser", "libhttp-parser2.9-2.9.4-r0.aarch64.rpm", "libhttp-parser2.9", "解析http的库", "", "/bin/sh;glibc >= 2.34" - "initscripts", "initscripts-10.12-1.aarch64.rpm", "initscripts", "提供System V初始化脚本的基本支持", "提供System V初始化脚本的基本支持以及一些工具和实用程序。", "/bin/sh;initd-functions" - "initscripts", "initscripts-functions-10.12-1.aarch64.rpm", "initscripts-functions", "shell公共函数", "提供一些基础的功能。", "" - "iproute2", "iproute2-ip-5.15.0-r0.aarch64.rpm", "iproute2-ip", "提供iproute2程序", "提供ip.iproute2工具。", "glibc >= 2.34;libcap >= 2.61;libelf1 >= 0.185" - "iptables", "iptables-1.8.7-r0.aarch64.rpm", "iptables", "用于管理Linux内核包过滤功能的工具", "在Linux内核中控制网络包过滤代码,用于设置防火墙或IP伪装。", "" - "iptables", "iptables-module-ip6t-ah-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-ah", "提供libip6t_ah.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-dnat-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-dnat", "提供libip6t_DNAT.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-dnpt-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-dnpt", "提供libip6t_DNPT.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-dst-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-dst", "提供libip6t_dst.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-eui64-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-eui64", "提供libip6t_eui64.so动态库", "", "iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-frag-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-frag", "提供libip6t_frag.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-hbh-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-hbh", "提供libip6t_hbh.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-hl-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-hl", "提供libip6t_HL.so和libip6t_hl.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-icmp6-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-icmp6", "提供libip6t_icmp6.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-ipv6header-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-ipv6header", "提供libip6t_ipv6header.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-log-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-log", "提供libip6t_LOG.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-masquerade-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-masquerade", "提供libip6t_MASQUERADE.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-mh-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-mh", "提供libip6t_mh.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-netmap-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-netmap", "提供libip6t_NETMAP.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-redirect-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-redirect", "提供libip6t_REDIRECT.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-reject-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-reject", "提供libip6t_REJECT.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-rt-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-rt", "提供libip6t_rt.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-snat-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-snat", "提供libip6t_SNAT.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-snpt-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-snpt", "提供libip6t_SNPT.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ip6t-srh-1.8.7-r0.aarch64.rpm", "iptables-module-ip6t-srh", "提供libip6t_srh.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-ah-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-ah", "提供libipt_ah.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-clusterip-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-clusterip", "提供libipt_CLUSTERIP.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-dnat-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-dnat", "提供libipt_DNAT.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-ecn-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-ecn", "提供libipt_ECN.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-icmp-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-icmp", "提供libipt_icmp.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-log-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-log", "提供libipt_LOG.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-masquerade-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-masquerade", "提供libipt_MASQUERADE.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-netmap-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-netmap", "提供libipt_NETMAP.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-realm-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-realm", "提供libipt_realm.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-redirect-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-redirect", "提供libipt_REDIRECT.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-reject-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-reject", "提供libipt_REJECT.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-snat-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-snat", "提供libipt_SNAT.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-ttl-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-ttl", "提供libipt_TTL.so和libipt_ttl.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-ipt-ulog-1.8.7-r0.aarch64.rpm", "iptables-module-ipt-ulog", "提供libipt_ULOG.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-addrtype-1.8.7-r0.aarch64.rpm", "iptables-module-xt-addrtype", "提供libxt_addrtype.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-audit-1.8.7-r0.aarch64.rpm", "iptables-module-xt-audit", "提供libxt_AUDIT.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-bpf-1.8.7-r0.aarch64.rpm", "iptables-module-xt-bpf", "提供libxt_bpf.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-cgroup-1.8.7-r0.aarch64.rpm", "iptables-module-xt-cgroup", "提供libxt_cgroup.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-checksum-1.8.7-r0.aarch64.rpm", "iptables-module-xt-checksum", "提供libxt_CHECKSUM.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-classify-1.8.7-r0.aarch64.rpm", "iptables-module-xt-classify", "提供libxt_CLASSIFY.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-cluster-1.8.7-r0.aarch64.rpm", "iptables-module-xt-cluster", "提供libxt_cluster.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-comment-1.8.7-r0.aarch64.rpm", "iptables-module-xt-comment", "提供libxt_comment.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-connbytes-1.8.7-r0.aarch64.rpm", "iptables-module-xt-connbytes", "提供libxt_connbytes.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-connlimit-1.8.7-r0.aarch64.rpm", "iptables-module-xt-connlimit", "提供libxt_connlimit.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-connmark-1.8.7-r0.aarch64.rpm", "iptables-module-xt-connmark", "提供libxt_CONNMARK.so和libxt_connmark.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-connsecmark-1.8.7-r0.aarch64.rpm", "iptables-module-xt-connsecmark", "提供libxt_CONNSECMARK.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-conntrack-1.8.7-r0.aarch64.rpm", "iptables-module-xt-conntrack", "提供libxt_conntrack.so和libxt_state.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-cpu-1.8.7-r0.aarch64.rpm", "iptables-module-xt-cpu", "提供libxt_cpu.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-ct-1.8.7-r0.aarch64.rpm", "iptables-module-xt-ct", "提供libxt_CT.so和libxt_NOTRACK.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-dccp-1.8.7-r0.aarch64.rpm", "iptables-module-xt-dccp", "提供libxt_dccp.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-devgroup-1.8.7-r0.aarch64.rpm", "iptables-module-xt-devgroup", "提供libxt_devgroup.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-dscp-1.8.7-r0.aarch64.rpm", "iptables-module-xt-dscp", "提供libxt_DSCP.so和libxt_dscp.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-ecn-1.8.7-r0.aarch64.rpm", "iptables-module-xt-ecn", "提供libxt_ecn.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-esp-1.8.7-r0.aarch64.rpm", "iptables-module-xt-esp", "提供libxt_esp.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-hashlimit-1.8.7-r0.aarch64.rpm", "iptables-module-xt-hashlimit", "提供ibxt_hashlimit.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-helper-1.8.7-r0.aarch64.rpm", "iptables-module-xt-helper", "提供libxt_helper.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-hmark-1.8.7-r0.aarch64.rpm", "iptables-module-xt-hmark", "提供libxt_HMARK.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-idletimer-1.8.7-r0.aarch64.rpm", "iptables-module-xt-idletimer", "提供libxt_IDLETIMER.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-ipcomp-1.8.7-r0.aarch64.rpm", "iptables-module-xt-ipcomp", "提供libxt_ipcomp.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-iprange-1.8.7-r0.aarch64.rpm", "iptables-module-xt-iprange", "提供libxt_iprange.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-ipvs-1.8.7-r0.aarch64.rpm", "iptables-module-xt-ipvs", "提供libxt_ipvs.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-led-1.8.7-r0.aarch64.rpm", "iptables-module-xt-led", "提供libxt_LED.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-length-1.8.7-r0.aarch64.rpm", "iptables-module-xt-length", "提供libxt_length.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-limit-1.8.7-r0.aarch64.rpm", "iptables-module-xt-limit", "提供libxt_limit.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-mac-1.8.7-r0.aarch64.rpm", "iptables-module-xt-mac", "提供libxt_mac.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-mark-1.8.7-r0.aarch64.rpm", "iptables-module-xt-mark", "提供libxt_MARK.so和libxt_mark.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-multiport-1.8.7-r0.aarch64.rpm", "iptables-module-xt-multiport", "提供libxt_multiport.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-nfacct-1.8.7-r0.aarch64.rpm", "iptables-module-xt-nfacct", "提供libxt_nfacct.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-nflog-1.8.7-r0.aarch64.rpm", "iptables-module-xt-nflog", "提供libxt_NFLOG.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-nfqueue-1.8.7-r0.aarch64.rpm", "iptables-module-xt-nfqueue", "提供libxt_NFQUEUE.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-osf-1.8.7-r0.aarch64.rpm", "iptables-module-xt-osf", "提供libxt_osf.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-owner-1.8.7-r0.aarch64.rpm", "iptables-module-xt-owner", "提供libxt_owner.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-physdev-1.8.7-r0.aarch64.rpm", "iptables-module-xt-physdev", "提供libxt_physdev.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-pkttype-1.8.7-r0.aarch64.rpm", "iptables-module-xt-pkttype", "提供libxt_pkttype.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-policy-1.8.7-r0.aarch64.rpm", "iptables-module-xt-policy", "提供libxt_policy.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-quota-1.8.7-r0.aarch64.rpm", "iptables-module-xt-quota", "提供libxt_quota.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-rateest-1.8.7-r0.aarch64.rpm", "iptables-module-xt-rateest", "提供libxt_RATEEST.so和libxt_rateest.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-recent-1.8.7-r0.aarch64.rpm", "iptables-module-xt-recent", "提供libxt_recent.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-rpfilter-1.8.7-r0.aarch64.rpm", "iptables-module-xt-rpfilter", "提供libxt_rpfilter.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-sctp-1.8.7-r0.aarch64.rpm", "iptables-module-xt-sctp", "提供libxt_sctp.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-secmark-1.8.7-r0.aarch64.rpm", "iptables-module-xt-secmark", "提供libxt_SECMARK.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-set-1.8.7-r0.aarch64.rpm", "iptables-module-xt-set", "提供libxt_SET.so和libxt_set.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-socket-1.8.7-r0.aarch64.rpm", "iptables-module-xt-socket", "提供libxt_socket.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-standard-1.8.7-r0.aarch64.rpm", "iptables-module-xt-standard", "提供libxt_standard.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-statistic-1.8.7-r0.aarch64.rpm", "iptables-module-xt-statistic", "提供libxt_statistic.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-string-1.8.7-r0.aarch64.rpm", "iptables-module-xt-string", "提供libxt_string.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-synproxy-1.8.7-r0.aarch64.rpm", "iptables-module-xt-synproxy", "提供libxt_SYNPROXY.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-tcp-1.8.7-r0.aarch64.rpm", "iptables-module-xt-tcp", "提供libxt_tcp.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-tcpmss-1.8.7-r0.aarch64.rpm", "iptables-module-xt-tcpmss", "提供libxt_TCPMSS.so和libxt_tcpmss.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-tcpoptstrip-1.8.7-r0.aarch64.rpm", "iptables-module-xt-tcpoptstrip", "提供libxt_TCPOPTSTRIP.so库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-tee-1.8.7-r0.aarch64.rpm", "iptables-module-xt-tee", "提供libxt_TEE.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-time-1.8.7-r0.aarch64.rpm", "iptables-module-xt-time", "提供libxt_time.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-tos-1.8.7-r0.aarch64.rpm", "iptables-module-xt-tos", "提供libxt_TOS.so和libxt_tos.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-tproxy-1.8.7-r0.aarch64.rpm", "iptables-module-xt-tproxy", "提供libxt_TPROXY.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-trace-1.8.7-r0.aarch64.rpm", "iptables-module-xt-trace", "提供libxt_TRACE.so动态库", "", "iptables >= 1.8.7" - "iptables", "iptables-module-xt-u32-1.8.7-r0.aarch64.rpm", "iptables-module-xt-u32", "提供libxt_u32.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iptables", "iptables-module-xt-udp-1.8.7-r0.aarch64.rpm", "iptables-module-xt-udp", "提供libxt_udp.so动态库", "", "glibc >= 2.34;iptables >= 1.8.7" - "iSulad", "iSulad-2.0.10-r0.aarch64.rpm", "iSulad", "云原生轻量级容器解决方案", "", "/bin/sh;glibc >= 2.34;lcr >= 2.0.7;libcrypto1.1 >= 1.1.1m;libcurl4 >= 7.79.1;libevent >= 2.1.12;libevhtp >= 1.2.18;libhttp-parser2.9 >= 2.9.4;libz1 >= 1.2.11;yajl >= 2.1.0" - "json-c", "libjson-c5-0.15-r0.aarch64.rpm", "libjson-c5", "C中json实现", "提供在C中处理json的动态库。", "/bin/sh;glibc >= 2.34;glibc >= 2.34" - "kmod", "kmod-29-r0.aarch64.rpm", "kmod", "将模块加载到内核中", "提供内核模块插入、删除、列出、检查属性、解析等工具。", "glibc >= 2.34;libz1 >= 1.2.11" - "lcr", "lcr-2.0.6-r0.aarch64.rpm", "lcr", "轻量级容器", "提供轻量级容器动态库。", "/bin/sh;glibc >= 2.34;glibc >= 2.34;lxc >= 4.0.3;lxc >= 4.0.3;yajl >= 2.1.0;yajl >= 2.1.0" - "less", "less-590-r0.aarch64.rpm", "less", "文本文件浏览器", "提供less等命令,用于查看文本,类似于more,但具有更多的能力。", "glibc >= 2.34;libtinfo5 >= 6.2" - "libaio1", "libaio1-0.3.112-r0.aarch64.rpm", "libaio1", "Linux原生异步I/O访问库", "提供给POSIX异步I/O工具内核加速的异步I/O功能。", "/bin/sh;glibc >= 2.34;glibc >= 2.34" - "libarchive", "libarchive-3.5.2-r0.aarch64.rpm", "libarchive", "用于处理流归档格式的库", "提供创建和读取不同流存档格式的功能。", "/bin/sh;glibc >= 2.34;glibc >= 2.34" - "libcap", "libcap-2.61-r0.aarch64.rpm", "libcap", "用于获取和设置POSIX.1e功能的库", "数据包捕获函数库,用于捕获网卡数据或分析pcap格式的抓包报文。", "/bin/sh;glibc >= 2.34;glibc >= 2.34" - "libcap", "libcap-bin-2.61-r0.aarch64.rpm", "libcap-bin", "提供libcap二进制工具", "提供/usr/sbin/capsh、/usr/sbin/getcap、/usr/sbin/getpcaps、/usr/sbin/setcap", "glibc >= 2.34;libcap >= 2.61" - "libcap-ng", "libcap-ng-0.8.2-r0.aarch64.rpm", "libcap-ng", "备用POSIX功能库", "提供比传统libcap库更容易使用POSIX功能编程的库", "/bin/sh;glibc >= 2.34;glibc >= 2.34" - "libcap-ng", "libcap-ng-bin-0.8.2-r0.aarch64.rpm", "libcap-ng-bin", "提供libcap-ng二进制工具", "提供/usr/bin/captest、/usr/bin/filecap、/usr/bin/netcap、/usr/bin/pscap", "glibc >= 2.34;libcap-ng >= 0.8.2" - "libestr0", "libestr0-0.1.11-r0.aarch64.rpm", "libestr0", "字符串处理必备库", "提供了rsyslog守护进程使用的字符串处理必备共享库", "/bin/sh;glibc >= 2.34;glibc >= 2.34" - "libevent", "libevent-2.1.12-r0.aarch64.rpm", "libevent", "抽象异步事件通知库", "libevent API提供了一种机制,在文件描述符上发生特定事件或达到超时后执行回调函数。libevent旨在替换事件驱动网络服务器中发现的异步事件循环。应用程序只需要调用event_dispatch(),然后就可以动态添加或删除事件,而不必更改事件循环。", "/bin/sh;glibc >= 2.34" - "libevhtp", "libevhtp-1.2.18-r0.aarch64.rpm", "libevhtp", "libevhtp包的调试源", "此软件包为libevhtp包提供调试源。;调试源在开发使用此软件包的应用程序或调试此软件包时非常有用。", "/bin/sh;glibc >= 2.34;libevent >= 2.1.12" - "libfastjson", "libfastjson4-0.99.9-r0.aarch64.rpm", "libfastjson4", "JSON解析库", "一个JSON解析库,json-c的分叉,由rsyslog团队开发,用于rsyslog和liblognorm。;此软件包包括libfastjson库。", "/bin/sh;glibc >= 2.34" - "libffi", "libffi8-3.4.2-r0.aarch64.rpm", "libffi8", "外部函数接口库", "libffi库为各种调用约定提供了一个可移植的高级编程接口。这允许程序员在运行时调用调用接口描述指定的任何函数。", "/bin/sh;glibc >= 2.34" - "libhugetlbfs", "libhugetlbfs-2.23-r0.aarch64.rpm", "libhugetlbfs", "用于大型翻译Lookaside缓冲区文件系统的帮助程序库", "libhugetlbfs包与Linux hugetlbfs交互,以透明的方式使大页面可供应用程序使用。", "/bin/sh;glibc >= 2.34" - "libnl", "libnl-3-200-3.5.0-r0.aarch64.rpm", "libnl-3-200", "内核网络套接字的便利库", "这个包包含一个方便的库,可以简化使用Linux内核的netlink套接字接口进行网络操作", "/bin/sh;glibc >= 2.34" - "libnl", "libnl-3-cli-3.5.0-r0.aarch64.rpm", "libnl-3-cli", "libnl3的命令行界面实用程序", "此软件包包含各种libnl3实用程序和它们所依赖的其他库", "/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0;libnl-genl-3-200 >= 3.5.0;libnl-idiag-3-200 >= 3.5.0;libnl-nf-3-200 >= 3.5.0;libnl-route-3-200 >= 3.5.0" - "libnl", "libnl-genl-3-200-3.5.0-r0.aarch64.rpm", "libnl-genl-3-200", "Netlink操作库", "提供libnl-genl-3.so.*", "/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0" - "libnl", "libnl-idiag-3-200-3.5.0-r0.aarch64.rpm", "libnl-idiag-3-200", "libnl-idiag动态库", "提供libnl-idiag-3.so.*", "/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0" - "libnl", "libnl-nf-3-200-3.5.0-r0.aarch64.rpm", "libnl-nf-3-200", "NetFilter以及接口监控相关的Netlink操作库", "提供libnl-nf-3.so.*", "/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0;libnl-route-3-200 >= 3.5.0" - "libnl", "libnl-route-3-200-3.5.0-r0.aarch64.rpm", "libnl-route-3-200", "提供NETLINK_ROUTE家族的API接口库", "提供libnl-route-3.so.*", "/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0" - "libnl", "libnl-xfrm-3-200-3.5.0-r0.aarch64.rpm", "libnl-xfrm-3-200", "libnl-xfrm动态库", "提供libnl-xfrm-3.so.*", "/bin/sh;glibc >= 2.34;libnl-3-200 >= 3.5.0" - "libpam", "libpam-1.5.2-r0.aarch64.rpm", "libpam", "为应用程序提供身份验证的可扩展库", "提供/lib64/libpam.so.*、/lib64/libpam_misc.so.*和/lib64/libpamc.so.*", "/bin/sh;glibc >= 2.34" - "libpam", "pam-plugin-access-1.5.2-r0.aarch64.rpm", "pam-plugin-access", "pam_access.so动态库", "提供/lib64/security/pam_access.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "libpam-runtime-1.5.2-r0.aarch64.rpm", "libpam-runtime", "pam实用程序", "PAM(可插拔身份验证模块)是一种系统安全工具,允许系统管理员设置身份验证策略,而不必重新编译处理身份验证的程序。", "config(libpam-runtime) = 1.5.2-r0;glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64;pam-plugin-deny-suffix64;pam-plugin-permit-suffix64;pam-plugin-unix-suffix64;pam-plugin-warn-suffix64" - "libpam", "pam-plugin-debug-1.5.2-r0.aarch64.rpm", "pam-plugin-debug", "pam_debug.so动态库", "提供/lib64/security/pam_debug.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-deny-1.5.2-r0.aarch64.rpm", "pam-plugin-deny", "pam_deny.so动态库", "提供/lib64/security/pam_deny.so", "libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-echo-1.5.2-r0.aarch64.rpm", "pam-plugin-echo", "pam_echo.so动态库", "提供/lib64/security/pam_echo.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-env-1.5.2-r0.aarch64.rpm", "pam-plugin-env", "pam_env.so动态库", "提供/lib64/security/pam_env.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-exec-1.5.2-r0.aarch64.rpm", "pam-plugin-exec", "pam_exec.so动态库", "提供/lib64/security/pam_exec.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-faildelay-1.5.2-r0.aarch64.rpm", "pam-plugin-faildelay", "pam_faildelay.so动态库", "提供/lib64/security/pam_faildelay.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-faillock-1.5.2-r0.aarch64.rpm", "pam-plugin-faillock", "pam_faillock.so动态库", "提供/lib64/security/pam_faillock.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-filter-1.5.2-r0.aarch64.rpm", "pam-plugin-filter", "pam_filter.so动态库", "提供/lib64/security/pam_filter.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-ftp-1.5.2-r0.aarch64.rpm", "pam-plugin-ftp", "pam_ftp.so动态库", "提供/lib64/security/pam_ftp.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-group-1.5.2-r0.aarch64.rpm", "pam-plugin-group", "pam_group.so动态库", "提供/lib64/security/pam_group.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-issue-1.5.2-r0.aarch64.rpm", "pam-plugin-issue", "pam_issue.so动态库", "提供/lib64/security/pam_issue.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-keyinit-1.5.2-r0.aarch64.rpm", "pam-plugin-keyinit", "pam_keyinit.so动态库", "提供/lib64/security/pam_keyinit.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-lastlog-1.5.2-r0.aarch64.rpm", "pam-plugin-lastlog", "pam_lastlog.so动态库", "提供/lib64/security/pam_lastlog.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-limits-1.5.2-r0.aarch64.rpm", "pam-plugin-limits", "pam_limits.so动态库", "提供/lib64/security/pam_limits.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-listfile-1.5.2-r0.aarch64.rpm", "pam-plugin-listfile", "pam_listfile.so动态库", "提供/lib64/security/pam_listfile.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-localuser-1.5.2-r0.aarch64.rpm", "pam-plugin-localuser", "pam_localuser.so动态库", "提供/lib64/security/pam_localuser.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-loginuid-1.5.2-r0.aarch64.rpm", "pam-plugin-loginuid", "pam_loginuid.so动态库", "提供/lib64/security/pam_loginuid.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-mail-1.5.2-r0.aarch64.rpm", "pam-plugin-mail", "pam_mail.so动态库", "提供/lib64/security/pam_mail.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-mkhomedir-1.5.2-r0.aarch64.rpm", "pam-plugin-mkhomedir", "pam_mkhomedir.so动态库", "提供/lib64/security/pam_mkhomedir.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-motd-1.5.2-r0.aarch64.rpm", "pam-plugin-motd", "pam_motd.so动态库", "提供/lib64/security/pam_motd.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-namespace-1.5.2-r0.aarch64.rpm", "pam-plugin-namespace", "pam_namespace.so动态库", "提供/lib64/security/pam_namespace.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-nologin-1.5.2-r0.aarch64.rpm", "pam-plugin-nologin", "pam_nologin.so动态库", "提供/lib64/security/pam_nologin.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-permit-1.5.2-r0.aarch64.rpm", "pam-plugin-permit", "pam_permit.so动态库", "提供/lib64/security/pam_permit.so", "libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-pwhistory-1.5.2-r0.aarch64.rpm", "pam-plugin-pwhistory", "pam_pwhistory.so动态库", "提供/lib64/security/pam_pwhistory.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-rhosts-1.5.2-r0.aarch64.rpm", "pam-plugin-rhosts", "pam_rhostsso动态库", "提供/lib64/security/pam_rhostsso", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-rootok-1.5.2-r0.aarch64.rpm", "pam-plugin-rootok", "pam_rootok.so动态库", "提供/lib64/security/pam_rootok.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-securetty-1.5.2-r0.aarch64.rpm", "pam-plugin-securetty", "pam_securetty.so动态库", "提供/lib64/security/pam_securetty.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-setquota-1.5.2-r0.aarch64.rpm", "pam-plugin-setquota", "pam_setquota.so动态库", "提供/lib64/security/pam_setquota.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-shells-1.5.2-r0.aarch64.rpm", "pam-plugin-shells", "pam_shells.so动态库", "提供/lib64/security/pam_shells.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-stress-1.5.2-r0.aarch64.rpm", "pam-plugin-stress", "pam_stress.so动态库", "提供/lib64/security/pam_stress.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-succeed-if-1.5.2-r0.aarch64.rpm", "pam-plugin-succeed-if", "pam_succeed_if.so动态库", "提供/lib64/security/pam_succeed_if.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-time-1.5.2-r0.aarch64.rpm", "pam-plugin-time", "pam_time.so动态库", "提供/lib64/security/pam_time.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-timestamp-1.5.2-r0.aarch64.rpm", "pam-plugin-timestamp", "pam_timestamp.so动态库", "提供/lib64/security/pam_timestamp.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-umask-1.5.2-r0.aarch64.rpm", "pam-plugin-umask", "pam_umask.so动态库", "提供/lib64/security/pam_umask.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-unix-1.5.2-r0.aarch64.rpm", "pam-plugin-unix", "pam_unix.so动态库", "提供/lib64/security/pam_unix.so", "libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-usertype-1.5.2-r0.aarch64.rpm", "pam-plugin-usertype", "pam_usertypeso动态库", "提供/lib64/security/pam_usertypeso", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-warn-1.5.2-r0.aarch64.rpm", "pam-plugin-warn", "pam_warn.so动态库", "提供/lib64/security/pam_warn.so", "libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-wheel-1.5.2-r0.aarch64.rpm", "pam-plugin-wheel", "pam_wheel.so动态库", "提供/lib64/security/pam_wheel.so", "glibc >= 2.34;libpam >= 1.5.2;libpam-suffix64" - "libpam", "pam-plugin-xauth-1.5.2-r0.aarch64.rpm", "pam-plugin-xauth", "pam_xauth.so动态库", "提供/lib64/security/pam_xauth.so", "libpam >= 1.5.2;libpam-suffix64" - "libpcap", "libpcap1-1.10.1-r0.aarch64.rpm", "libpcap1", "网络嗅探器库", "libpcap是数据包嗅探器程序使用的库。它为他们提供了一个接口,用于捕获和分析来自网络设备的数据包。;只有当您计划自己编译或编写这样的程序时,才需要此软件包。", "/bin/sh;glibc >= 2.34" - "libpcre", "libpcre1-8.45-r0.aarch64.rpm", "libpcre1", "Perl兼容正则表达式的库", "PCRE库是一组函数,使用与Perl 5相同的语法和语义实现正则表达式模式匹配;;此PCRE库变体支持8位和UTF-8字符串。", "/bin/sh;glibc >= 2.34" - "libpwquality", "libpwquality-1.4.4-r0.aarch64.rpm", "libpwquality", "密码生成和密码质量检查库", "这是一个用于密码质量检查和生成通过检查的随机密码的库。;此库使用破解库和破解库字典执行一些检查。", "/bin/sh;cracklib >= 2.9.7;glibc >= 2.34;libpam >= 1.5.2" - "libseccomp", "libseccomp-2.5.3-r0.aarch64.rpm", "libseccomp", "增强的seccomp库", "libseccomp库为Linux内核的syscall过滤机制(seccomp)提供了一个易于使用的接口。libseccomp API允许应用程序指定允许应用程序执行哪些syscall,以及可选的哪些syscall参数,所有这些都由Linux内核强制执行。", "/bin/sh;glibc >= 2.34" - "libselinux", "libselinux1-3.3-r0.aarch64.rpm", "libselinux1", "SELinux运行时库", "libselinux提供了一个接口,用于获取和设置进程和文件安全上下文,以及获取安全策略决策。;(安全增强的Linux是内核和一些实施强制性访问控制策略的实用程序的一个功能,如类型实施、基于角色的访问控制和多级安全。)", "/bin/sh;glibc >= 2.34;libpcre1 >= 8.45" - "libselinux", "libselinux-bin-3.3-r0.aarch64.rpm", "libselinux-bin", "SELinux libselinux实用程序", "libselinux-bin软件包包含实用程序", "glibc >= 2.34;libpcre1 >= 8.45;libselinux1 >= 3.3;libsepol2 >= 3.3" - "libsemanage", "libsemanage2-3.3-r0.aarch64.rpm", "libsemanage2", "SELinux策略管理库", "libsemanage是策略管理库。使用libsepol和libselinux与SELinux系统交互,它还调用帮助程序来加载策略和检查file_contexts配置是否有效。", "/bin/sh;audit >= 3.0.1;glibc >= 2.34;libbz2-1 >= 1.0.8;libselinux1 >= 3.3;libsepol2 >= 3.3" - "libsepol", "libsepol2-3.3-r0.aarch64.rpm", "libsepol2", "SELinux二进制策略操作库", "提供SELinux二进制策略操作库", "/bin/sh;glibc >= 2.34" - "libsepol", "libsepol-bin-3.3-r0.aarch64.rpm", "libsepol-bin", "SELinux二进制策略操作工具", "libsepol提供了一个用于操作SELinux二进制策略的API。它由checkpolicy(策略编译器)和类似的工具,以及需要对二进制策略执行特定转换(如自定义策略布尔设置)的程序使用。", "glibc >= 2.34;libsepol2 >= 3.3" - "libtirpc", "libtirpc3-1.3.2-r0.aarch64.rpm", "libtirpc3", "与传输无关的RPC库", "传输独立RPC库(TI-RPC)是glibc中不支持IPv6地址的标准SunRPC库的替代。;此实现允许支持UDP和TCP over IPv4以外的其他传输。", "/bin/sh;glibc >= 2.34" - "libusb1", "libusb-1.0-0-1.0.24-r0.aarch64.rpm", "libusb-1.0-0", "USB库", "Libusb是一个允许用户空间访问USB设备的库。", "/bin/sh;glibc >= 2.34" - "libwebsockets", "libwebsockets-4.3.0-r0.aarch64.rpm", "libwebsockets", "用于Websockets的轻量级C库", "这是用于轻量级websocket客户端和服务器的libwebsockets C库。", "/bin/sh;glibc >= 2.34;libcrypto1.1 >= 1.1.1m;libssl1.1 >= 1.1.1m;libz1 >= 1.2.11" - "libxml2", "libxml2-2.9.12-r0.aarch64.rpm", "libxml2", "提供XML和HTML支持的库", "此库允许操作XML文件。它包括读取、修改和写入XML和HTML文件的支持。DTD支持,这包括解析和验证,即使是复杂的DtD,可以在解析时或在修改文档后更晚。输出可以是简单的SAX流,也可以是内存中类似DOM的表示。;在这种情况下,可以使用内置的XPath和XPointer实现来选择子节点或范围。提供灵活的输入/输出机制,具有现有的HTTP和FTP模块,并组合到URI库。", "/bin/sh;glibc >= 2.34;libz1 >= 1.2.11" - "libxml2", "libxml2-utils-2.9.12-r0.aarch64.rpm", "libxml2-utils", "用于操作XML文件的实用程序", "此软件包包含用于操作XML文件的实用程序。", "glibc >= 2.34;libxml2 >= 2.9.12" - "logrotate", "logrotate-3.18.1-r0.aarch64.rpm", "logrotate", "用于旋转、压缩、邮寄和删除系统日志文件的Cron服务", "logrotate实用程序自动旋转、压缩、邮寄和删除日志文件。Logrotate可以设置为每天、每周、每月或当日志文件达到一定大小时处理日志文件。通常,logrotate作为每日cron作业运行。;它只管理普通文件,不参与systemd的日志轮换。", "config(logrotate) = 3.18.1-r0;glibc >= 2.34;libacl1 >= 2.3.1;libpopt0 >= 1.18" - "lvm2", "lvm2-2.03.14-r0.aarch64.rpm", "lvm2", "Userland逻辑卷管理工具", "LVM2包括处理物理卷(硬盘、RAID系统、磁光等,多个设备(MD),请参阅mdm(8),甚至环路设备,请参见Lostup(8))上的读/写操作的所有支持,从一个或多个物理卷创建卷组(虚拟磁盘种类),并在卷组中创建一个或多个逻辑卷(逻辑分区种类)。", "/bin/sh;config(lvm2) = 2.03.14-r0;glibc >= 2.34;libaio1 >= 0.3.112;libblkid1 >= 2.37.2" - "lvm2", "lvm2-scripts-2.03.14-r0.aarch64.rpm", "lvm2-scripts", "提供blkdeactivate、fsadm、lvmdum命令", "提供/usr/sbin/blkdeactivate、/usr/sbin/fsadm和/usr/sbin/lvmdump", "bash;lvm2 = 2.03.14-r0" - "lxc", "lxc-4.0.3-r0.aarch64.rpm", "lxc", "Linux内核容器的用户空间工具", "LXC是众所周知的、经过严格测试的低层次Linux容器运行时。", "/bin/sh;gcc-bin-toolchain-compilerlibs-aarch64 >= 1.0;glibc >= 2.34;libcap >= 2.61;libseccomp >= 2.5.3;yajl >= 2.1.0" - "ncurses", "libform5-6.3-r0.aarch64.rpm", "libform5", "libform动态库", "提供/usr/lib64/libform.so.*", "/bin/sh;glibc >= 2.34;libncurses5 >= 6.3" - "ncurses", "libmenu5-6.3-r0.aarch64.rpm", "libmenu5", "libmenu动态库", "提供/usr/lib64/libmenu.so.*", "/bin/sh;glibc >= 2.34;libncurses5 >= 6.3" - "ncurses", "libncurses5-6.3-r0.aarch64.rpm", "libncurses5", "libncurses动态库", "提供/lib64/libncurses.so.*", "/bin/sh;glibc >= 2.34;libtinfo5 >= 6.3" - "ncurses", "libpanel5-6.3-r0.aarch64.rpm", "libpanel5", "libpanel动态库", "提供/usr/lib64/libpanel.so.*", "/bin/sh;glibc >= 2.34;libncurses5 >= 6.3" - "ncurses", "libtinfo5-6.3-r0.aarch64.rpm", "libtinfo5", "libtinfo动态库", "提供/lib64/libtinfo.so.*", "/bin/sh;glibc >= 2.34" - "ncurses", "ncurses-6.3-r0.aarch64.rpm", "ncurses", "CRT屏幕处理和优化包", "提供/usr/bin/tput、/usr/bin/tset功能", "glibc >= 2.34;libtinfo5 >= 6.3" - "ncurses", "ncurses-terminfo-6.3-r0.aarch64.rpm", "ncurses-terminfo", "终端描述数据库", "这是ncures包中维护的术语信息基本数据库。此数据库是4.4BSD术语帽文件的官方继承者,包含有关任何已知终端的信息。ncures库利用此数据库正确使用终端。", "ncurses-terminfo-base" - "ncurses", "ncurses-terminfo-base-6.3-r0.aarch64.rpm", "ncurses-terminfo-base", "提供终端信息基础", "提供/etc/terminfo/*", "" - "nfs-utils", "nfs-utils-2.5.4-r0.aarch64.rpm", "nfs-utils", "NFS实用程序以及内核NFS服务器的支持客户端和守护程序", "nfs-utils软件包为内核NFS服务器和相关工具提供了一个守护程序,它提供了比大多数用户使用的传统Linux NFS服务器更高的性能级别。", "glibc >= 2.34;libblkid1 >= 2.37.2;libtirpc3 >= 1.3.2;libuuid1 >= 2.37.2;nfs-utils-client" - "nfs-utils", "nfs-utils-client-2.5.4-r0.aarch64.rpm", "nfs-utils-client", "查询远程主机上的装载守护程序", "此软件包还包含showmount程序。Showmount查询远程主机上的装载守护程序,以了解有关远程主机上NFS(网络文件系统)服务器的信息。例如,showmount可以显示装载在该主机上的客户端。", "config(nfs-utils-client) = 2.5.4-r0;glibc >= 2.34;libcap >= 2.61;libtirpc3 >= 1.3.2;nfs-utils-mount" - "nfs-utils", "nfs-utils-mount-2.5.4-r0.aarch64.rpm", "nfs-utils-mount", "挂载或卸载文件系统", "此软件包还包含mount.nfs和umount.nfs程序。", "glibc >= 2.34;libmount1 >= 2.37.2;libtirpc3 >= 1.3.2" - "openssh", "openssh-keygen-8.8p1-r0.aarch64.rpm", "openssh-keygen", "生成ssh公钥认证所需的公钥和私钥文件", "提供/usr/bin/ssh-keygen", "glibc >= 2.34" - "openssh", "openssh-misc-8.8p1-r0.aarch64.rpm", "openssh-misc", "ssh远程登陆管理主机", "提供/usr/bin/ssh、/usr/bin/ssh-add、/usr/bin/ssh-agent、/usr/bin/ssh-copy-id、/usr/bin/ssh-keyscan等", "glibc >= 2.34;libz1 >= 1.2.11" - "openssh", "openssh-scp-8.8p1-r0.aarch64.rpm", "openssh-scp", "远程复制命令", "提供/usr/bin/scp", "glibc >= 2.34" - "openssh", "openssh-sftp-8.8p1-r0.aarch64.rpm", "openssh-sftp", "远程文件传输服务", "提供/usr/bin/sftp", "glibc >= 2.34" - "openssh", "openssh-sftp-server-8.8p1-r0.aarch64.rpm", "openssh-sftp-server", "”sftp“协议的服务器端程序,使用加密的方式进行文件传输", "提供/usr/libexec/sftp-server", "glibc >= 2.34" - "openssh", "openssh-ssh-8.8p1-r0.aarch64.rpm", "openssh-ssh", "ssh服务配置文件", "提供/etc/ssh/ssh_config", "config(openssh-ssh) = 8.8p1-r0" - "openssh", "openssh-sshd-8.8p1-r0.aarch64.rpm", "openssh-sshd", "ssh服务进程启动", "提供/usr/sbin/sshd、/usr/libexec/openssh/sshd_check_keys等", "config(openssh-sshd) = 8.8p1-r0;glibc >= 2.34;libpam >= 1.5.2;libz1 >= 1.2.11;openssh-keygen;pam-plugin-keyinit;pam-plugin-loginuid" - "openssl", "openssl-conf-1.1.1m-r0.aarch64.rpm", "openssl-conf", "openssl的主配置文件", "提供/etc/ssl/openssl.cnf", "config(openssl-conf) = 1.1.1m-r0" - "openssl", "libcrypto1.1-1.1.1m-r0.aarch64.rpm", "libcrypto1.1", "OpenSSL crypto库", "提供/usr/lib64/libcrypto.so.*", "/bin/sh;glibc >= 2.34" - "openssl", "libssl1.1-1.1.1m-r0.aarch64.rpm", "libssl1.1", "OpenSSL SSL库", "提供/usr/lib64/libssl.so.*", "/bin/sh;glibc >= 2.34;libcrypto1.1 >= 1.1.1m" - "os-release", "os-release-1.0-r0.noarch.rpm", "os-release", "添加openeuler版本信息", "添加openeuler版本信息,同时添加os-revision记录构建时间戳。;生成的镜像也放到时间戳目录便于区分不同版本", "" - "os-base", "os-base-1.0-r1.aarch64.rpm", "os-base", "提供OS基础", "提供hostname、passwd、modules等配置信息", "" - "pciutils", "libpci3-3.7.0-r0.aarch64.rpm", "libpci3", "PCI实用程序库", "libpci提供了对PCI配置空间的访问。", "/bin/sh;glibc >= 2.34;libz1 >= 1.2.11" - "pciutils", "pciutils-3.7.0-r0.aarch64.rpm", "pciutils", "Linux内核的PCI实用程序", "lspci:此程序显示有关系统中所有PCI总线和设备的详细信息,取代原始的/proc/pci接口;;setpci:此程序允许读取和写入PCI设备配置寄存器。例如,您可以使用它调整延迟计时器;;update-pciids:此程序下载pci.ids文件的当前版本。", "glibc >= 2.34;libpci3 >= 3.7.0;libz1 >= 1.2.11;pciutils-ids" - "pciutils", "pciutils-ids-3.7.0-r0.aarch64.rpm", "pciutils-ids", "存放系统所有支持和不支持的硬件信息", "提供/usr/share/hwdata/pci.ids.gz", "" - "policycoreutils", "policycoreutils-3.3-r0.aarch64.rpm", "policycoreutils", "显示当前seinux信息,修改selinux策略内各项规则的布尔值", "提供/etc/pam.d、/sbin/setsebool、/usr/bin/sestatus和/var/lib/selinux", "glibc >= 2.34;libselinux1 >= 3.3;libsemanage2 >= 3.3" - "policycoreutils", "policycoreutils-fixfiles-3.3-r0.aarch64.rpm", "policycoreutils-fixfiles", "检查或矫正文件系统中的安全环境数据库", "提供/sbin/fixfiles", "policycoreutils-setfiles" - "policycoreutils", "policycoreutils-hll-3.3-r0.aarch64.rpm", "policycoreutils-hll", "提供/usr/libexec/selinux/hll/pp", "提供/usr/libexec/selinux/hll/pp", "glibc >= 2.34;libsepol2 >= 3.3" - "policycoreutils", "policycoreutils-loadpolicy-3.3-r0.aarch64.rpm", "policycoreutils-loadpolicy", "装载或替换新的二进制策略到内核中,保持使用当前的Bootlean值", "提供/sbin/load_policy", "glibc >= 2.34;libselinux1 >= 3.3;libsepol2 >= 3.3" - "policycoreutils", "policycoreutils-semodule-3.3-r0.aarch64.rpm", "policycoreutils-semodule", "可以显示、加载、删除模块", "提供/sbin/semodule", "glibc >= 2.34;libselinux;libsemanage2 >= 3.3;libsepol2 >= 3.3" - "policycoreutils", "policycoreutils-sestatus-3.3-r0.aarch64.rpm", "policycoreutils-sestatus", "显示系统的详细状态", "提供/etc/sestatus.conf和/sbin/sestatus", "libselinux;policycoreutils" - "policycoreutils", "policycoreutils-setfiles-3.3-r0.aarch64.rpm", "policycoreutils-setfiles", "恢复或更改一部分文件的标签", "提供/sbin/restorecon、/sbin/restorecon_xattr和/sbin/setfiles", "glibc >= 2.34;libselinux1 >= 3.3;libsepol2 >= 3.3" - "popt", "libpopt0-1.18-r0.aarch64.rpm", "libpopt0", "一个用于解析命令行参数的C库", "Popt是一个用于解析命令行参数的C库。Popt受到getopt()和getopt_long()函数的严重影响。它通过允许更强大的参数扩展来改进它们。Popt可以解析任意argv[]样式数组,并根据命令行参数自动设置变量。Popt允许通过配置文件别名命令行参数,并包括用于使用类似shell的规则将任意字符串解析为argv[]数组的实用程序函数。", "/bin/sh;glibc >= 2.34" - "procps", "libprocps8-3.3.17-r0.aarch64.rpm", "libprocps8", "procps库", "procps库可用于从/proc读取进程信息pseudo-file系统中的信息。", "/bin/sh;glibc >= 2.34" - "procps", "procps-3.3.17-r0.aarch64.rpm", "procps", "/proc的ps实用程序", "procps包包含一组提供系统信息的系统实用程序。Procps包括ps、free、skill、snice、tload、top、uptime、vmstat、w和watch。", "glibc >= 2.34;libncurses5 >= 6.3;libprocps8 >= 3.3.17;libtinfo5 >= 6.3;procps-sysctl" - "procps", "procps-sysctl-3.3.17-r0.aarch64.rpm", "procps-sysctl", "控制和配置Linux内核及网络设置", "提供/etc/sysctl.conf", "procps-lib" - "psmisc", "pstree-23.4-r0.aarch64.rpm", "pstree", "显示进程状态树", "列出当前的进程,以及它们的树状结构", "glibc >= 2.34;libtinfo5 >= 6.3" - "quota", "quota-4.06-r0.aarch64.rpm", "quota", "用于监控用户磁盘使用情况的系统管理工具", "包含系统管理工具,用于监控和限制每个文件系统的用户和或组磁盘使用情况。", "glibc >= 2.34;libcom-err2 >= 1.46.4;libext2fs2 >= 1.46.4;libtirpc3 >= 1.3.2" - "readline", "libreadline8-8.1-r0.aarch64.rpm", "libreadline8", "Readline库", "readline库由 Bourne Again Shell(bash,标准命令解释器)用于轻松编辑命令行。这包括历史记录和搜索功能。", "/bin/sh;config(libreadline8) = 8.1-r0;glibc >= 2.34;libtinfo5 >= 6.3" - "rsyslog", "rsyslog-8.2110.0-r0.aarch64.rpm", "rsyslog", "用于Linux和Unix的增强系统日志", "Rsyslog是一个增强的多线程syslogd,支持MySQL、syslog/tcp、RFC 3195、允许的发件人列表、对任何消息部分的过滤和细粒度输出格式控制。它与库存sysklogd相当兼容,可以用作直接替换。;它的高级功能使它适合企业级、加密保护的系统日志中继链,同时也非常容易为新手用户设置。", "config(rsyslog) = 8.2110.0-r0;glibc >= 2.34;libcurl4 >= 7.79.1;libestr0 >= 0.1.11;libfastjson4 >= 0.99.9;libuuid1 >= 2.37.2;libz1 >= 1.2.11;logrotate" - "sed", "sed-4.8-r0.aarch64.rpm", "sed", "GNU流文本编辑器", "sed(流编辑器)编辑器是流或批处理(非交互式)编辑器。Sed将文本作为输入,对文本执行操作或一组操作,并输出修改后的文本。sed执行的操作(替换、删除、插入等)可以在脚本文件或命令行中指定。", "glibc >= 2.34" - "shadow", "shadow-4.9-r0.aarch64.rpm", "shadow", "用于管理用户和组帐户的实用程序", "此软件包包括将普通密码文件转换为影子密码格式以及管理用户和组帐户所需的程序。", "glibc >= 2.34;libpam >= 1.5.2;libpam-runtime;pam-plugin-env;pam-plugin-faildelay;pam-plugin-group;pam-plugin-lastlog;pam-plugin-limits;pam-plugin-mail;pam-plugin-motd;pam-plugin-nologin;pam-plugin-rootok;pam-plugin-securetty;pam-plugin-shells;shadow-base;shadow-securetty" - "shadow", "shadow-base-4.9-r0.aarch64.rpm", "shadow-base", "提供sg工具", "提供/usr/bin/sg工具", "" - "shadow", "shadow-securetty-4.8.1-r1.aarch64.rpm", "shadow-securetty", "安全终端", "提供/etc/securetty", "" - "squashfs-tools", "squashfs-tools-4.5-r0.aarch64.rpm", "squashfs-tools", "用于创建squashfs文件系统的实用程序", "squashfs是Linux的高度压缩只读文件系统。此软件包包含用于操作squashfs文件系统的实用程序。", "glibc >= 2.34;liblzma5 >= 5.2.5;libz1 >= 1.2.11" - "strace", "strace-5.14-r0.aarch64.rpm", "strace", "跟踪和显示与正在运行的进程关联的系统调用", "strace程序拦截并记录运行进程调用和接收的系统调用。strace可以打印每个系统调用、其参数和返回值的记录。strace对于诊断问题和调试以及教学目的都很有用。", "glibc >= 2.34" - "tzdata", "tzdata-core-2021e-r0.aarch64.rpm", "tzdata-core", "时区说明", "描述可用时区的配置文件。", "tzdata-core-2021e-r0.aarch64.rpm ;config(tzdata-core) = 2021e-r0" - "util-linux", "libblkid1-2.37.2-r0.aarch64.rpm", "libblkid1", "块设备ID库", "块设备识别库,util-linux的一部分。", "/bin/sh;glibc >= 2.34" - "util-linux", "libfdisk1-2.37.2-r0.aarch64.rpm", "libfdisk1", "文件系统检测库", "用于文件系统检测的库。", "/bin/sh;glibc >= 2.34;libblkid1 >= 2.37.2;libuuid1 >= 2.37.2" - "util-linux", "libmount1-2.37.2-r0.aarch64.rpm", "libmount1", "设备挂载库", "设计用于低级实用程序的库,如mount(8)和/usr/sbin/mount", "/bin/sh;glibc >= 2.34;libblkid1 >= 2.37.2" - "util-linux", "libuuid1-2.37.2-r0.aarch64.rpm", "libuuid1", "用于生成UUID的库", "用于生成通用唯一ID(UUID)的库。", "/bin/sh;glibc >= 2.34" - "util-linux", "util-linux-su-2.37.2-r0.aarch64.rpm", "util-linux-su", "用于变更为其他使用者的身份", "提供su命令,用于变更使用者身份", "glibc >= 2.34;libpam >= 1.5.2" - "xz", "liblzma5-5.2.5-r0.aarch64.rpm", "liblzma5", "Lempel–Ziv–Markov 链算法压缩库", "用于编码/解码LZMA文件的库。", "/bin/sh;glibc >= 2.34" - "xz", "xz-5.2.5-r0.aarch64.rpm", "xz", "LZMA压缩实用程序", "XZ Utils试图使LZMA压缩易于在自由(如自由)操作系统上使用。这是通过提供类似于使用的工具和库来实现的,而不是最流行的现有压缩算法的等效工具和库。;LZMA是由伊戈尔·巴甫洛夫设计的通用压缩算法,作为7-Zip的一部分。它提供了高压缩比,同时保持了快速的解压缩速度。", "glibc >= 2.34;liblzma5 >= 5.2.5" - "yajl", "yajl-2.1.0-r0.aarch64.rpm", "yajl", "又一个JSON库(YAJL)", "又是一个JSON库。YAJL是一个用ANSI C编写的小型事件驱动(SAX风格)JSON解析器,也是一个小型验证JSON生成器。", "/bin/sh;glibc >= 2.34" - "zlib", "libz1-1.2.11-r0.aarch64.rpm", "libz1", "实现DEFLATE压缩算法的库", "zlib是一个通用的无损数据压缩库,实现了DEFLATE算法的API,例如gzip和ZIP存档格式正在使用后者。", "/bin/sh;glibc >= 2.34" - + :file: software_package_description.csv + :header-rows: 1 diff --git a/docs/source/getting_started/index.rst b/docs/source/getting_started/index.rst index e55d032bc07d8ca437eba448e997bfd478d6827f..1d25f90c961e290fb9746efe25a9ed28ad0d97fe 100644 --- a/docs/source/getting_started/index.rst +++ b/docs/source/getting_started/index.rst @@ -14,10 +14,10 @@ openEuler Embedded是基于openEuler社区面向嵌入式场景的Linux版本。 获取镜像 *********** -当前发布的已构建好的镜像中,只支持arm和aarch64两种架构,且只支持qemu中ARM virt-4.0平台,您可以通过如下链接获得相应的镜像: +当前发布的已构建好的镜像示例中,只支持arm和aarch64两种架构,且只支持qemu中ARM virt-4.0平台,您可以通过如下链接获得相应的镜像(以22.03为例): -- `qemu_arm `_: 32位arm架构, ARM Cortex A15处理器 -- `qemu_aarch64 `_: 64位aarch64架构 ARM Cortex A57处理器 +- `qemu_arm `_:32位arm架构, ARM Cortex A15处理器 +- `qemu_aarch64 `_:64位aarch64架构 ARM Cortex A57处理器 只要相应环境支持QEMU仿真器(版本5.0以上),您可以将提供的openEuler Embedded镜像部署在物理裸机、云环境、容器或虚拟机上。 @@ -26,7 +26,7 @@ openEuler Embedded是基于openEuler社区面向嵌入式场景的Linux版本。 所下载的镜像,由以下几部分组成: -- 内核镜像 :file:`zImage` : 基于openEuler社区Linux 5.10代码构建得到。相应的内核配置可通过如下链接获取: +- 内核镜像 :file:`zImage` : 基于openEuler社区Linux 5.10代码构建得到。相应的内核配置可通过如下链接获取(以openEuler-22.03-LTS为例,其他分支修改分支名跳转即可): - `arm(cortex a15) `_ - `arm(cortex a57) `_, @@ -38,7 +38,7 @@ openEuler Embedded是基于openEuler社区面向嵌入式场景的Linux版本。 - SDK(Software Development Kit)工具 - - :file:`openeuler-glibc-x86_64-xxxxx.sh`:openEuler Embedded SDK自解压安装包,SDK包含了进行开发(用户态程序、内核模块啦.ko等)所必需的工具、库和头文件等。 + - :file:`openeuler-glibc-x86_64-xxxxx.sh`:openEuler Embedded SDK自解压安装包,SDK包含了进行开发(用户态程序、内核模块等)所必需的工具、库和头文件等。 运行镜像 @@ -50,7 +50,7 @@ openEuler Embedded是基于openEuler社区面向嵌入式场景的Linux版本。 - 建议使用QEMU 5.0以上版本运行镜像,由于一些额外功能(网络、共享文件系统)需要依赖QEMU的virtio-net, virtio-fs等特性,如未在QEMU中使能,则运行时可能会产生错误,此时可能需要从源码重新编译QEMU。 - - 运行镜像时,建议把内核镜像和根文件系统镜像放在同一目录下,后续说明以标准根文件系统为例(initrd)。 + - 运行镜像时,建议把内核镜像和根文件系统镜像放在同一目录下。 QEMU的下载与安装可以参考 `QEMU官方网站 `_ , 或者下载 `源码 `_ 单独编译安装。安装好后可以运行如下命令 @@ -66,21 +66,29 @@ QEMU的下载与安装可以参考 `QEMU官方网站 + .. code-block:: console -针对aarch64(ARM Cortex A57),运行如下命令: + qemu-system-arm -M virt-4.0 -m 1G -cpu cortex-a15 -nographic -kernel zImage -initrd -.. code-block:: console + 针对aarch64(ARM Cortex A57),运行如下命令: + + .. code-block:: console + + qemu-system-aarch64 -M virt-4.0 -m 1G -cpu cortex-a57 -nographic -kernel zImage -initrd - qemu-system-aarch64 -M virt-4.0 -m 1G -cpu cortex-a57 -nographic -kernel zImage -initrd + .. note:: + + 由于标准根文件系统镜像进行了安全加固,因此第一次启动时,需要为登录用户名root设置密码,且密码强度有相应要求, 需要数字、字母、特殊字符组合最少8位,例如openEuler@2021 + +2. **检查运行是否成功** + + QEMU运行成功并登录后,将会呈现openEuler Embedded的Shell。 -由于标准根文件系统镜像进行了安全加固,因此第一次启动时,需要为登录用户名root设置密码,且密码强度有相应要求, 需要数字、字母、特殊字符组合最少8位,例如openEuler@2021 -QEMU运行成功并登录后,将会呈现openEuler Embedded的Shell。 使能共享文件系统场景 ========================== @@ -91,41 +99,41 @@ QEMU运行成功并登录后,将会呈现openEuler Embedded的Shell。 1. **启动QEMU** -针对arm(ARM Cortex A15),运行如下命令: + 针对arm(ARM Cortex A15),运行如下命令: -.. code-block:: console + .. code-block:: console - qemu-system-arm -M virt-4.0 -m 1G -cpu cortex-a15 -nographic -kernel zImage -initrd -device virtio-9p-device,fsdev=fs1,mount_tag=host -fsdev local,security_model=passthrough,id=fs1,path=/tmp + qemu-system-arm -M virt-4.0 -m 1G -cpu cortex-a15 -nographic -kernel zImage -initrd -device virtio-9p-device,fsdev=fs1,mount_tag=host -fsdev local,security_model=passthrough,id=fs1,path=/tmp -针对aarch64(ARM Cortex A57),运行如下命令: + 针对aarch64(ARM Cortex A57),运行如下命令: -.. code-block:: console + .. code-block:: console - qemu-system-aarch64 -M virt-4.0 -m 1G -cpu cortex-a57 -nographic -kernel zImage -initrd -device virtio-9p-device,fsdev=fs1,mount_tag=host -fsdev local,security_model=passthrough,id=fs1,path=/tmp + qemu-system-aarch64 -M virt-4.0 -m 1G -cpu cortex-a57 -nographic -kernel zImage -initrd -device virtio-9p-device,fsdev=fs1,mount_tag=host -fsdev local,security_model=passthrough,id=fs1,path=/tmp 2. **映射文件系统** -在openEuler Embedded启动并登录之后,需要运行如下命令,映射(mount)共享文件系统 + 在openEuler Embedded启动并登录之后,需要运行如下命令,映射(mount)共享文件系统 -.. code-block:: console + .. code-block:: console - cd /tmp - mkdir host - mount -t 9p -o trans=virtio,version=9p2000.L host /tmp/host + cd /tmp + mkdir host + mount -t 9p -o trans=virtio,version=9p2000.L host /tmp/host -即把共享文件系统映射到openEuler Embedded的/tmp/host目录下。 + 即把共享文件系统映射到openEuler Embedded的/tmp/host目录下。 3. **检查共享是否成功** -在openEuler Embedded中,运行如下命令: + 在openEuler Embedded中,运行如下命令: -.. code-block:: console + .. code-block:: console - cd /tmp/host - ls + cd /tmp/host + ls -如能发现hello_openeuler.txt,则共享成功。 + 如能发现hello_openeuler.txt,则共享成功。 使能网络场景 =============== @@ -135,51 +143,59 @@ openEuler Embedded传输文件。 1. **启动QEMU** -针对arm(ARM Cortex A15),运行如下命令: + 针对arm(ARM Cortex A15),运行如下命令: -.. code-block:: console + .. code-block:: console - qemu-system-arm -M virt-4.0 -m 1G -cpu cortex-a15 -nographic -kernel zImage -initrd -device virtio-net-device,netdev=tap0 -netdev tap,id=tap0,script=/etc/qemu-ifup + qemu-system-arm -M virt-4.0 -m 1G -cpu cortex-a15 -nographic -kernel zImage -initrd -device virtio-net-device,netdev=tap0 -netdev tap,id=tap0,script=/etc/qemu-ifup -针对aarch64(ARM Cortex A57),运行如下命令: + 针对aarch64(ARM Cortex A57),运行如下命令: -.. code-block:: console + .. code-block:: console - qemu-system-aarch64 -M virt-4.0 -m 1G -cpu cortex-a57 -nographic -kernel zImage -initrd -device virtio-net-device,netdev=tap0 -netdev tap,id=tap0,script=/etc/qemu-ifup + qemu-system-aarch64 -M virt-4.0 -m 1G -cpu cortex-a57 -nographic -kernel zImage -initrd -device virtio-net-device,netdev=tap0 -netdev tap,id=tap0,script=/etc/qemu-ifup 2. **宿主上建立虚拟网卡** -在宿主机上需要建立名为tap0的虚拟网卡,可以借助 :file:`/etc/qemu-ifup` 脚本实现(如没有,则需要创建),其执行需要root权限,具体内容如下: + 在宿主机上需要建立名为tap0的虚拟网卡,可以借助脚本实现,创建 :file:`qemu-ifup` 脚本,放在 :file:`/etc/` 目录下,具体内容如下: -.. code-block:: console + .. code-block:: console + + #!/bin/bash + ifconfig $1 192.168.10.1 up + + 其执行需要root权限: + + .. code-block:: console - #!/bin/bash - ifconfig $1 192.168.10.1 up + chmod a+x qemu-ifup -通过 :file:`qemu-ifup` 脚本,宿主机上将创建名为tap0的虚拟网卡,地址为192.168.10.1。 + 通过 :file:`qemu-ifup` 脚本,宿主机上将创建名为tap0的虚拟网卡,地址为192.168.10.1。 3. **配置openEuler Embedded网卡** -openEuler Embedded登陆后,执行如下命令: + openEuler Embedded登陆后,执行如下命令: -.. code-block:: console + .. code-block:: console - ifconfig eth0 192.168.10.2 + ifconfig eth0 192.168.10.2 4. **确认网络连通** -在openEuler Embedded中,执行如下命令: + 在openEuler Embedded中,执行如下命令: -.. code-block:: console + .. code-block:: console - ping 192.168.10.1 + ping 192.168.10.1 -如能ping通,则宿主机和openEuler Embedded之间的网络是连通的。 + 如能ping通,则宿主机和openEuler Embedded之间的网络是连通的。 -.. note:: + .. note:: - 如需openEuler Embedded借助宿主机访问互联网,则需要在宿主机上建立网桥,此处不详述,如有需要,请自行查阅相关资料。 + 如需openEuler Embedded借助宿主机访问互联网,则需要在宿主机上建立网桥,此处不详述,如有需要,请自行查阅相关资料。 + +.. _install-openeuler-embedded-sdk: 基于SDK的应用开发 ******************************************** @@ -189,22 +205,35 @@ openEuler Embedded登陆后,执行如下命令: 安装SDK ============= -1. **执行SDK自解压安装脚本** +1. **安装依赖软件包** -运行如下命令: + 使用SDK开发内核模块需要安装一些必要的软件包,运行如下命令: -.. code-block:: console + .. code-block:: console - sh openeuler-glibc-x86_64-openeuler-image-aarch64-qemu-aarch64-toolchain-22.03.sh + 在 openeuler 上安装: + yum install make gcc g++ flex bison gmp-devel libmpc-devel openssl-devel -根据提示输入工具链的安装路径,默认路径是 :file:`/opt/openeuler//`; -若不设置,则按默认路径安装;也可以配置相对路径或绝对路径。 + 在 Ubuntu 上安装: + apt-get install make gcc g++ flex bison libgmp3-dev libmpc-dev libssl-dev -一个例子如下: +2. **执行SDK自解压安装脚本** -.. code-block:: console + 运行如下命令: + + .. code-block:: console + + sh openeuler-glibc-x86_64-openeuler-image-aarch64-qemu-aarch64-toolchain-*.sh + + 根据提示输入工具链的安装路径,默认路径是 :file:`/opt/openeuler//`; + 若不设置,则按默认路径安装;也可以配置相对路径或绝对路径。 + 其中“*”根据分支不同生成字符不同,如22.03、22.09。 - sh ./openeuler-glibc-x86_64-openeuler-image-armv7a-qemu-arm-toolchain-22.03.sh`` + 一个例子如下(22.03例子,22.09等版本类似): + + .. code-block:: console + + sh openeuler-glibc-x86_64-openeuler-image-armv7a-qemu-arm-toolchain-22.03.sh openEuler embedded(openEuler Embedded Reference Distro) SDK installer version 22.03 ================================================================ Enter target directory for SDK (default: /opt/openeuler/22.03): sdk @@ -214,19 +243,19 @@ openEuler Embedded登陆后,执行如下命令: Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g. $ . /usr1/openeuler/sdk/environment-setup-armv7a-openeuler-linux-gnueabi -2. **设置SDK环境变量** +3. **设置SDK环境变量** -前一步执行结束最后已打印source命令,运行即可 + 前一步执行结束最后已打印source命令,运行即可。 -.. code-block:: console + .. code-block:: console . /usr1/openeuler/myfiles/sdk/environment-setup-armv7a-openeuler-linux-gnueabi 3. **查看是否安装成功** -运行如下命令,查看是否安装成功、环境设置成功 + 运行如下命令,查看是否安装成功、环境设置成功。 -.. code-block:: console + .. code-block:: console arm-openeuler-linux-gnueabi-gcc -v @@ -235,127 +264,126 @@ openEuler Embedded登陆后,执行如下命令: 1. **准备代码** -以构建一个hello world程序为例,运行在openEuler Embedded根文件系统镜像中。 + 以构建一个hello world程序为例,运行在openEuler Embedded根文件系统镜像中。 -创建一个 :file:`1hello.c` 文件,源码如下: + 创建一个 :file:`hello.c` 文件,源码如下: -.. code-block:: c + .. code-block:: c - #include + #include - int main(void) - { - printf("hello world\n"); - } + int main(void) + { + printf("hello world\n"); + } -编写CMakelist.txt,和hello.c文件放在同一个目录 + 编写CMakelists.txt,和hello.c文件放在同一个目录。 -:: + :: - project(hello C) + project(hello C) - add_executable(hello hello.c) + add_executable(hello hello.c) 2. **编译生成二进制** -进入 :file:`hello.c` 文件所在目录,使用工具链编译, 命令如下: + 进入 :file:`hello.c` 文件所在目录,使用工具链编译, 命令如下: -.. code-block:: console + .. code-block:: console - cmake .. - make + cmake .. + make -把编译好的hello程序拷贝到openEuler Embedded系统的 :file:`/tmp/` 某个目录下(例如 :file:`/tmp/myfiles/` )。如何拷贝可以参考前文所述共享文件系统场景 + 把编译好的hello程序拷贝到openEuler Embedded系统的 :file:`/tmp/` 某个目录下(例如 :file:`/tmp/myfiles/` )。如何拷贝可以参考前文所述共享文件系统场景。 3. **运行用户态程序** -在openEuler Embedded系统中运行hello程序。 + 在openEuler Embedded系统中运行hello程序。 -.. code-block:: console + .. code-block:: console - cd /tmp/myfiles/ - ./hello + cd /tmp/myfiles/ + ./hello -如运行成功,则会输出"hello world"。 + 如运行成功,则会输出"hello world"。 使用SDK编译内核模块样例 ============================= 1. **准备环境** -在设置好SDK环境的基础之上,编译内核模块还需准备相应环境,但只需要准备一次即可。运行如下命令 -会创建相应的内核模块编译环境: + 在设置好SDK环境的基础之上,编译内核模块还需准备相应环境,但只需要准备一次即可(2209版本之后无需此步骤)。运行如下命令会创建相应的内核模块编译环境: -.. code-block:: console + .. code-block:: console - cd /sysroots/-openeuler-linux/usr/src/kernel - make module_prepare + cd /sysroots/-openeuler-linux/usr/src/kernel + make modules_prepare 2. **准备代码** -以编译一个最简单的内核模块为例,运行在openEuler Embedded内核中。 + 以编译一个最简单的内核模块为例,运行在openEuler Embedded内核中。 -创建一个 :file:`hello.c` 文件,源码如下: + 创建一个 :file:`hello.c` 文件,源码如下: -.. code-block:: c + .. code-block:: c - #include - #include + #include + #include - static int hello_init(void) - { - printk("Hello, openEuler Embedded!\r\n"); - return 0; - } + static int hello_init(void) + { + printk("Hello, openEuler Embedded!\r\n"); + return 0; + } - static void hello_exit(void) - { - printk("Byebye!"); - } + static void hello_exit(void) + { + printk("Byebye!"); + } - module_init(hello_init); - module_exit(hello_exit); + module_init(hello_init); + module_exit(hello_exit); - MODULE_LICENSE(GPL); + MODULE_LICENSE("GPL"); -编写Makefile,和hello.c文件放在同一个目录: + 编写Makefile,和hello.c文件放在同一个目录: -:: + :: - KERNELDIR := ${KERNEL_SRC_DIR} - CURRENT_PATH := $(shell pwd) + KERNELDIR := ${KERNEL_SRC} + CURRENT_PATH := $(shell pwd) - target := hello - obj-m := $(target).o + target := hello + obj-m := $(target).o - build := kernel_modules + build := kernel_modules - kernel_modules: - $(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH) modules - clean: - $(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH) clean + kernel_modules: + $(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH) modules + clean: + $(MAKE) -C $(KERNELDIR) M=$(CURRENT_PATH) clean -:file:`KERNEL_SRC_DIR` 为SDK中内核源码树的目录,该变量在安装SDK后会被自动设置。 + :file:`KERNEL_SRC` 为SDK中内核源码树的目录,该变量在安装SDK后会被自动设置。 3. **编译生成内核模块** -进入hello.c文件所在目录,使用工具链编译,命令如下: + 进入hello.c文件所在目录,使用工具链编译,命令如下: -.. code-block:: console + .. code-block:: console - make + make -将编译好的hello.ko拷贝到openEuler Embedded系统的目录下。 + 将编译好的hello.ko拷贝到openEuler Embedded系统的目录下。 -如何拷贝可以参考前文所述共享文件系统场景。 + 如何拷贝可以参考前文所述共享文件系统场景。 4. **插入内核模块** -在openEuler Embedded系统中插入内核模块: + 在openEuler Embedded系统中插入内核模块: -.. code-block:: console + .. code-block:: console - insmod hello.ko + insmod hello.ko -如运行成功,则会在内核日志中出现"Hello, openEuler Embedded!"。 + 如运行成功,则会在内核日志中出现"Hello, openEuler Embedded!"。 diff --git a/docs/source/index.rst b/docs/source/index.rst index fc9abbbaeed0bf0b08cb4728c8a90bd5dd922ec5..a91253ca8bbab8631b7532e4bfe09a5e29d3e344 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -8,7 +8,7 @@ openEuler Embedded是基于openEuler社区面向嵌入式场景的Linux版本, openEuler Embedded在内核版本、软件包版本等代码层面会与openEuler其他场景的Linux保持一致,共同演进,不同之处 在于针对嵌入场景的内核配置、软件包的组合与配置、代码特性补丁的不同。 -本手册包含了openEuler Embedded如何使用、如何构建,如何开发的相关内容。 +本手册包含了openEuler Embedded如何使用、如何构建、如何开发的相关内容。 章节 @@ -21,10 +21,11 @@ openEuler Embedded在内核版本、软件包版本等代码层面会与openEule introduction/index.rst getting_started/index.rst features/index.rst + linux/index.rst + infrastructure/index.rst yocto/index.rst - qemu/index.rst - contribute_doc.rst - security_hardening/index.rst + develop_help/index.rst + bsp/index.rst releases/index.rst 索引与表格 diff --git a/docs/source/infrastructure/container/index.rst b/docs/source/infrastructure/container/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..cbf50d722bf88774d3c8b9e7bc574f8da29bd125 --- /dev/null +++ b/docs/source/infrastructure/container/index.rst @@ -0,0 +1,46 @@ +.. _container: + +容器介绍 +###################################### + +该文档介绍openEuler Embedded相关的容器、版本、Dockerfile、容器作用等内容,供想要了解openEuler Embedded项目,参与openEuler Embedded项目的开发人员作容器方向的指导。 + +- **个人构建容器:swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container** + +说明:用于个人对openEuler Embedded进行构建。在22.03-lts版本及之前,容器已铺设好openEuler Embedded所需的一切环境,开发者只需要按 `容器环境下的快速构建指导 `__ 在该容器中下载好代码即可进行构建操作。2203-lts之后版本,因预编译软件不再内置,而是对编译所需软件在容器中进行打包以降低容器大小,因此容器在创建后会自动执行自解压并初始化操作,同时在构建之前需预先执行环境变量初始化操作,命令如下:source +/opt/buildtools/nativesdk/environment-setup-x86_64-pokysdk-linux。构建请参考 +`容器环境下的快速构建指导 `__ + +22.03-lts之后版本容器运行机制如下图: + .. figure:: ../../../image/docker_list/docker_detail.png + :align: center + + 图 1 22.03-lts之后版本容器运行机制 + +启动容器->自行解压->初始化sdk->初始化环境变量->构建环境初始化完成 + ++--------------+-------------------------------------+--------------+----------------------------------------------------------------+--------+ +| Image | Base Image | Libc Version | Dockerfile | Remark | +| Version | | | | | ++==============+=====================================+==============+================================================================+========+ +| latest | openeuler/openeuler:21.03 | 2.31 | `dockerfile `__ | | ++--------------+-------------------------------------+--------------+----------------------------------------------------------------+--------+ +| 22.03-lts | openeuler/openeuler:22.03-lts | 2.34 | `dockerfile `__ | | ++--------------+-------------------------------------+--------------+----------------------------------------------------------------+--------+ +| 21.09 | openeuler/openeuler:21.03 | 2.31 | `dockerfile `__ | | ++--------------+-------------------------------------+--------------+----------------------------------------------------------------+--------+ + +- **openEuler基础镜像:swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler** + +说明:用于制作openEuler Embedded相关容器 + +============= ============ +Image Version Libc Version +============= ============ +22.03-lts 2.34 +21.03 2.31 +20.03 2.31 +============= ============ diff --git a/docs/source/infrastructure/index.rst b/docs/source/infrastructure/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..3eba800c5f73af255765d647c3dcc90b65a135ee --- /dev/null +++ b/docs/source/infrastructure/index.rst @@ -0,0 +1,15 @@ +.. _openeuler_embedded_infrastructure: + + +基础设施 +################################ + +本章包含了openEuler Embedded相关基础设施的介绍,具体如下: + +.. toctree:: + :maxdepth: 1 + :caption: 基础设施列表 + + test/index.rst + container/index.rst + qemu/index.rst diff --git a/docs/source/qemu/index.rst b/docs/source/infrastructure/qemu/index.rst similarity index 100% rename from docs/source/qemu/index.rst rename to docs/source/infrastructure/qemu/index.rst diff --git a/docs/source/qemu/qemu_monitor.rst b/docs/source/infrastructure/qemu/qemu_monitor.rst similarity index 100% rename from docs/source/qemu/qemu_monitor.rst rename to docs/source/infrastructure/qemu/qemu_monitor.rst diff --git a/docs/source/qemu/qemu_start.rst b/docs/source/infrastructure/qemu/qemu_start.rst similarity index 99% rename from docs/source/qemu/qemu_start.rst rename to docs/source/infrastructure/qemu/qemu_start.rst index b46755a650f8c996f5ffedae0bf03de87813be3f..45493bb079492880cae67cf55402c9b900264d84 100644 --- a/docs/source/qemu/qemu_start.rst +++ b/docs/source/infrastructure/qemu/qemu_start.rst @@ -1,6 +1,6 @@ .. _qemu_start_debug: -qemu使用和调试 +QEMU使用和调试 ############################## 本文档主要用于介绍如何获得qemu的二进制,qemu的运行,以及如何基于qemu进行一些简单的调试。 diff --git a/docs/source/infrastructure/test/index.rst b/docs/source/infrastructure/test/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..295183fb14b544cc2476c638b8f3a53f24b88dd4 --- /dev/null +++ b/docs/source/infrastructure/test/index.rst @@ -0,0 +1,190 @@ +.. _test_project: + +测试工程 +######## + +openEuler Embedded采用openEuler社区开放的测试框架 `mugen `_ 作为社区开发者进行测试代码的编写和执行的框架。 + +mugen框架介绍 +================= + +mugen框架执行流程 +--------------------- + +.. image:: ../../../image/test_project/mugen_run_info.png + + +openEuler Embedded使用mugen框架时,由于嵌入式镜像中缺少mugen框架运行的必要依赖软件,嵌入式测试采用QEMU远程执行测试用例的方式,对系统进行测试。 + +典型的测试执行流程 +--------------------- + +典型的测试执行包含了框架下载、依赖准备、启动qemu环境、编译测试用例、测试用例执行和qemu环境的清理。 + +.. code-block:: console + + # git下载mugen测试框架 + git clone https://gitee.com/openeuler/mugen.git + + cd mugen + # 安装依赖包,-e会检查和安装qemu依赖,如果不能通过yum安装则报错,需要自行安装qemu(版本5.0以上) + sh dep_install.sh -e + + # 启动QEMU,默认使用qemu-system-aarch64拉起qemu,并完成测试套环境变量配置 + # start 启动qemu + # --put_all 配置执行测试套时一次拷贝所有测试套用例至qemu + # --kernal_img_path openEuler Embedded kernel镜像zImage + # --initrd_path openEuler Embedded rootfs镜像openeuler-image-qemu-*.rootfs.cpio.gz + sh qemu_ctl.sh start --put_all --kernal_img_path --initrd_path + + # 如果在远端设备执行测试,则不需要执行QEMU启动,但需要进行测试套环境变量配置 + # -c 配置测试套环境 + # --ip 远端设备IP + # --port 远端设备SSH端口号 + # --user 远端登录用户名 + # --password 远端登录用户密码 + # --put_all 执行测试套时一次拷贝所有测试套用例至远端 + # --run_remote 配置该配置远端环境为执行用例环境 + # bash mugen.sh -c --ip $ip --password $passwd --user $user --port $port --put_all --run_remote + + # 如果测试套中包含需要编译的用例,则先编译测试用例,目前仅支持测试套整体编译 + # 在执行测试用例编译前需要先执行sdk配置 + bash mugen.sh -b <测试套名> + + # 执行对应的测试套 + # -f 执行测试套名称 + # -s 远端执行测试套 + bash mugen.sh -f <测试套名> -s + + # 停止QEMU + sh qemu_ctl.sh stop + +其他mugen框架的具体介绍和使用详见 `mugen `_ 项目的介绍 + +openEuler Embedded测试套介绍 +=============================== + +openEuler Embedded测试套已包含安全配置测试、OS基础测试以及tiny镜像测试。 +未来会持续扩展测试套测试能力,计划增加基础软件包功能测试、特性专项测试等测试能力, +同时也欢迎更多的开发者参与到openEuler Embedded的测试中来,贡献更多的测试用例和测试套。 + +openEuler Embedded测试用例源码在mugen框架的 `testcases/embedded-test `_ +目录,每个测试套一个文件夹。 + +tiny镜像测试套 +----------------- + +tiny镜像测试套,仅执行镜像的启动和简单的busybox测试。 +与其他测试套不同,执行tiny镜像测试套时,不需要提前启动qemu,但需要配置测试套执行环境。 + +执行脚本如下: + +.. code-block:: console + + # git下载mugen测试框架 + git clone https://gitee.com/openeuler/mugen.git + + cd mugen + # 安装依赖包 + sh dep_install.sh -e + + # 如果在远端设备执行测试,则不需要执行QEMU启动,但需要进行测试套环境变量配置 + bash mugen.sh -c --ip 127.0.0.1 --password --user --port --put_all --run_remote + + # 执行对应的测试套 + bash mugen.sh -f embedded_tiny_image_test -s + +OS基础测试套 +----------------- + +OS基础测试套需要标准镜像支持,主要对OS的基础能力进行测试,需要提前启动qemu。 + +执行脚本如下: + +.. code-block:: console + + # git下载mugen测试框架 + git clone https://gitee.com/openeuler/mugen.git + + cd mugen + # 安装依赖包 + sh dep_install.sh -e + + # 启动QEMU,如果需要测试arm标准镜像,则需要增加 --qemu_type arm + sh qemu_ctl.sh start --put_all --kernal_img_path --initrd_path + + # 执行对应的测试套 + bash mugen.sh -f embedded_os_basic_test -s + + # 停止QEMU + sh qemu_ctl.sh stop + +嵌入式安全配置测试套 +---------------------- + +嵌入式安全配置测试套基于 `社区嵌入式安全加固说明 `_ +要求进行测试。 + +嵌入式安全配置测试套同样需要标准镜像支持,需要提前启动qemu。 + +执行脚本如下: + +.. code-block:: console + + # git下载mugen测试框架 + git clone https://gitee.com/openeuler/mugen.git + + cd mugen + # 安装依赖包 + sh dep_install.sh -e + + # 启动QEMU,如果需要测试arm标准镜像,则需要增加 --qemu_type arm + sh qemu_ctl.sh start --put_all --kernal_img_path --initrd_path + + # 执行对应的测试套 + bash mugen.sh -f embedded_security_config_test -s + + # 停止QEMU + sh qemu_ctl.sh stop + +嵌入式基础开发测试套 +---------------------- + +嵌入式基础开发测试套,主要对SDK编译出的C、C++用户态程序以及内核模块进行基础测试 + +嵌入式基础开发测试套同样需要标准镜像支持,需要提前启动qemu。 + +执行脚本如下: + +.. code-block:: console + + # git下载mugen测试框架 + git clone https://gitee.com/openeuler/mugen.git + + cd mugen + # 安装依赖包 + sh dep_install.sh -e + + # 启动QEMU,如果需要测试arm标准镜像,则需要增加 --qemu_type arm + sh qemu_ctl.sh start --put_all --kernal_img_path --initrd_path + + # 执行编译测试套 + bash mugen.sh -b embedded_application_develop_tests + + # 执行对应的测试套 + bash mugen.sh -f embedded_application_develop_tests -s + + # 停止QEMU + sh qemu_ctl.sh stop + +.. attention:: + 在 `社区嵌入式安全加固说明 `_ + 中有部分安全加固项为方便开发和使用并没有启用,以下用例失败为正常。 + + 列表如下: + + 1. oe_test_check_file_sys_protect_005 + 2. oe_test_check_network_firewall_001 + 3. oe_test_check_network_firewall_002 + 4. oe_test_check_ssh_config_002 + 5. oe_test_check_file_sys_protect_004 diff --git a/docs/source/introduction/index.rst b/docs/source/introduction/index.rst index 0124cfe6d6ef9ab47f822f32cd8f75fc5ce6ca29..d9e62bf74ca6238554f792864391ef5e18fd100a 100644 --- a/docs/source/introduction/index.rst +++ b/docs/source/introduction/index.rst @@ -15,7 +15,7 @@ openEuler Embedded是基于openEuler社区面向嵌入式场景的Linux版本, - **以Linux为中心** openEuler Embedded的中心是Linux,采用了与openEuler其他场景相同的Linux 5.10内核,该版本内核最长支持周期为6年。 -在软件包层面也与内核一样和所有场景共代码、共演进,当前已经支持80+嵌入式场景核心软件包,远期目标是支持openEuler社区所有 +在软件包层面也与内核一样和所有场景共代码、共演进,当前已经支持140+嵌入式场景核心软件包,远期目标是支持openEuler社区所有 软件包。 同时针对嵌入式场景的需求,openEuler Embedded会在内核特性、系统配置、软件包组合、镜像裁剪、安全加固、轻量化等方面 @@ -28,12 +28,12 @@ openEuler Embedded的中心是Linux,采用了与openEuler其他场景相同的 一颗微控制器/DSP/实时处理器运行实时操作系统,两者之间通过I/O、网络或片外总线通信。现在随着硬件技术的快速发展,片上系统的集成度越来 越高,同时集成多核、乃至异构多核已经很常见,这就为在软件上同时部署多个OS的提供了物质基础。 -openEuler Embedded的混合部署框架就是为了实现在一颗片上系统中同时部署多个OS而设计的,目的是通过一套框架实现Linux和其他OS的便捷地混合部署,依托硬件 +openEuler Embedded的混合部署框架就是为了实现在一颗片上系统中同时部署多个OS而设计的,目的是通过一套框架实现Linux和其他OS便捷地混合部署,依托硬件 上的多核能力使得通用的Linux和专用的实时操作系统有效互补,从而达到全系统兼具两者的特点,并能够灵活开发、灵活部署。 - **嵌入式虚拟化** -混合部署框架虽然可以解决Linux和实时操作系统的混合部署, 但也存在着Linux和实时操作系统未实现强隔离,静态部署资源利用率低等问题。嵌入式虚拟化 +混合部署框架虽然可以解决Linux和实时操作系统的混合部署, 但也存在着Linux和实时操作系统之间未实现强隔离、静态部署资源利用率低等问题。嵌入式虚拟化 是解决这些的问题的途径之一。由于嵌入式场景的诸多约束,嵌入式虚拟化与以服务器、云计算为代表的通用虚拟化有着显著的不同,openEuler Embedded 正就嵌入式虚拟化相关技术积极布局,未来将推出相应的解决方案,有力支撑以混合关键性系统为代表的相关应用。 @@ -45,7 +45,7 @@ openEuler Embedded的混合部署框架就是为了实现在一颗片上系统 - **工具体系** -由于嵌入式系统资源受限,无法像通用系统那样方便地进行开发工作,非常依赖工具体系的支持。除了嵌入式Linux外,openEuler Embedded的发布件中还包含能有力 +由于嵌入式系统资源受限,无法像通用系统那样方便地进行开发工作,因此非常依赖开发工具体系的支持。除了嵌入式Linux运行时外,openEuler Embedded的发布件中还包含能有力 支持嵌入式开发工作的SDK(Software Development Kit), 同时近期也会集成与openEuler Embedded配套嵌入式系统仿真方案,未来还计划集成图形化的IDE (Integrated Development Environment), 最终形成一套相对完整的开发工具体系。 @@ -71,4 +71,4 @@ openEuler Embedded初步支持了在嵌入式系统广泛使用的ARM架构, - **北向生态** -openEuler Embedded的北向生态正在起步中,将会与openEuler的相关SIG组与社区伙伴合作不断完善,重点聚焦在工控、机器人、能源等场景。 \ No newline at end of file +openEuler Embedded的北向生态正在起步中,将会与openEuler的相关SIG组与社区伙伴合作不断完善,重点聚焦在工控、机器人、能源等场景。 diff --git a/docs/source/linux/bluetooth/bluetooth_config.rst b/docs/source/linux/bluetooth/bluetooth_config.rst new file mode 100644 index 0000000000000000000000000000000000000000..5c0d4bc6138ebbb739affb790829c104d6d0bc43 --- /dev/null +++ b/docs/source/linux/bluetooth/bluetooth_config.rst @@ -0,0 +1,51 @@ +.. _bluetooth_config: + +openEuler Embedded蓝牙配置 +########################## + +本文档介绍如何在openEuler Embedded系统中开启蓝牙,以树莓派4B为例。 + +环境/工具准备 +======================== + +设备:建议树莓派4B的出厂配置,包括树莓派4B基础套件和SD卡 + +编译openEuler Embedded版本的树莓派镜像, 并烧录进SD卡中, 参考 :ref:`关键特性/树莓派4B支持/树莓派镜像构建指导` + +蓝牙使用说明 +============ + +使用如下命令开启蓝牙: + +- 加载蓝牙固件 + + .. code-block:: console + + btuart + +- 开启蓝牙 + + .. code-block:: console + + /etc/init.d/bluetooth start + hciconfig hci0 up + +- 扫描设备 + + .. code-block:: console + + bluetoothctl scan on + +- 开启被发现 + + .. code-block:: console + + bluetoothctl discoverable on + + 开启后可以被其他设备发现 + +.. attention:: + + 1. 当前openEuler Embedded版本蓝牙暂不支持配对和链接,在后续版本提供支持 + + 2. 软总线ble发现只需要开启蓝牙即可。另外软总线ble发现部分未对资源回收,一旦服务端和客户端退出后再次使用ble发现需要关闭后再开启蓝牙,即hciconfig hci0 down/up。 diff --git a/docs/source/linux/bluetooth/index.rst b/docs/source/linux/bluetooth/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..8f8d47205fed93b4327df668a6f5b2bacad706d3 --- /dev/null +++ b/docs/source/linux/bluetooth/index.rst @@ -0,0 +1,11 @@ +.. _bluetooth: + +蓝牙使用 +################################ + +本章介绍openEuler Embedded的蓝牙使用相关教程,具体内容如下: + +.. toctree:: + :maxdepth: 1 + + bluetooth_config.rst diff --git a/docs/source/linux/index.rst b/docs/source/linux/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..f9f271dff10b05ce8a54c732ab6956e86f743f48 --- /dev/null +++ b/docs/source/linux/index.rst @@ -0,0 +1,15 @@ +.. _openeuler_embedded_usage: + + +使用与配置 +################################ + +本章包含了openEuler Embedded使用与配置的相关说明,具体如下: + +.. toctree:: + :maxdepth: 1 + :caption: 分类列表 + + network/index.rst + bluetooth/index.rst + security/index.rst diff --git a/docs/source/linux/network/index.rst b/docs/source/linux/network/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..ddd5ca0c490cd95ce428584ea17cd0ad5ad4b1a8 --- /dev/null +++ b/docs/source/linux/network/index.rst @@ -0,0 +1,11 @@ +.. _network: + +网络配置 +################################ + +本章介绍openEuler Embedded的网络配置相关教程,具体内容如下: + +.. toctree:: + :maxdepth: 1 + + network_config.rst diff --git a/docs/source/linux/network/network_config.rst b/docs/source/linux/network/network_config.rst new file mode 100644 index 0000000000000000000000000000000000000000..134c1bcea5d557d2056e65f26b2bb6dd235238a1 --- /dev/null +++ b/docs/source/linux/network/network_config.rst @@ -0,0 +1,202 @@ +.. _network_config: + +openEuler Embedded网络配置 +############################## + +本文档介绍如何在openEuler Embedded系统中配置网络, 以树莓派4B配置为例. + +环境/工具准备 +======================== + +设备:建议树莓派4B的出厂配置,包括树莓派4B基础套件和SD卡 + +编译openEuler Embedded版本的树莓派镜像, 并烧录进SD卡中, 参考 :ref:`关键特性/树莓派4B支持/树莓派镜像构建指导` + + +有线网络配置 +======================== + +- **动态获取IP地址** + + 通过网线连接树莓派和路由器, 并启动树莓派, 此时树莓派会自动启动dhclient服务来获取IP + + 因为在/etc/network/interfaces 文件中, 有线网卡默认的配置是通过DHCP自动获取, 即: + + .. code-block:: console + + # Wired or wireless interfaces + auto eth0 # 系统启动后默认开启eth0网卡 + iface eth0 inet dhcp # eth0 网卡使用DHCP来获取IP地址 + iface eth1 inet dhcp + +- **配置静态IP地址** + + 网线另一端设备未提供DHCP服务时, 此时需要在两端设备上同时配置静态IP才能正常通信 + + 临时配置: + + 在两端同时配置IP地址, 确保在同一子网中即可通信 + + .. code-block:: console + + ifconfig <有线网卡名称> 192.168.10.x + + + 永久配置: + + 修改/etc/network/interfaces 文件中, 对应有线网卡的配置, 以eth0为例 + + .. code-block:: console + + # 将iface eth0 inet dhcp这行改为如下形式: + iface eth0 inet static # eth0 网卡使用静态IP地址 + address 192.168.10.x # IP地址 + netmask 255.255.255.0 + network 192.168.10.0 + gateway 192.168.10.1 + + 修改成功后, 需要重启networking service更新配置文件 + + .. code-block:: console + + service networking restart + + 更新配置文件后如果有线网卡没有自动启用的话, 可以手动使用命令up/down + + .. code-block:: console + + ifdown eth0 + ifup eth0 + + 最后可以通过ifconfig查看对应网卡的IP地址 + + .. code-block:: console + + root@raspberrypi4-64:~# ifconfig + eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx + inet addr:192.168.10.x Bcast:0.0.0.0 Mask:255.255.255.0 + UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 + RX packets:277 errors:0 dropped:0 overruns:0 frame:0 + TX packets:157 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:30734 (30.0 KiB) TX bytes:23751 (23.1 KiB) + + lo Link encap:Local Loopback + inet addr:127.0.0.1 Mask:255.0.0.0 + UP LOOPBACK RUNNING MTU:65536 Metric:1 + RX packets:2 errors:0 dropped:0 overruns:0 frame:0 + TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:140 (140.0 B) TX bytes:140 (140.0 B) + +.. _network_config_wifi: + + +Wi-Fi网络配置 +================================================ + + .. attention:: + + 当前只有22.09之后的版本默认支持以下方式配置Wi-Fi + +当前树莓派Wi-Fi网络配置包括三部分: **1.使能无线驱动 2.增加Wi-Fi配置 3.启用Wi-Fi网卡** + +- **使能无线驱动** + + 修改/etc/network/interfaces文件中无线网卡wlan0的配置 + + .. code-block:: console + + iface wlan0 inet dhcp + wireless_mode managed + wireless_essid any + wpa-driver wext + wpa-conf /etc/wpa_supplicant.conf + # 当前树莓派所使用的无线网卡驱动是 nl80211系列 + # 因此将wpa-driver wext 改为 wpa-driver nl80211 + # 才能正确启动wpa_supplicant + iface wlan0 inet dhcp + wireless_mode managed + wireless_essid any + wpa-driver nl80211 + wpa-conf /etc/wpa_supplicant.conf + + 修改完成后重启networking service使配置生效 + +- **增加Wi-Fi配置** + + 通过wpa_supplicant配置文件增加Wi-Fi网络 + + .. note:: + + wpa_supplicant 是一款开源用户态软件, 其主要功能是提供用户和Wi-Fi驱动之间沟通的桥梁, 以及对Wi-Fi协议和加密认证. 是目前使用范围较广的Wi-Fi配置工具, 也还有其他配置工具wireless-tools, 当前openEuler Embedded仅引入wpa_supplicant工具. + + 修改wpa_supplicant启动时所指定的配置文件/etc/wpa_supplicant.conf, 增加如下network字段的配置, 最简单的network配置可以只需要ssid和psk字段即可. 其他高级选项和字段可以参考: `wpa_supplicant官网文档 `_ + + .. code-block:: console + + network={ + # ssid Wi-Fi网络名称 + ssid="home" + # psk Wi-Fi网络密码 + psk="very secret passphrase" + # 可选, 隐藏的网络必须指定为1 + scan_ssid=1 + # 加密类型协议, 可选, 无此字段时会默认包含 WPA-PSK WPA-EAP + key_mgmt=WPA-PSK + } + + 如果担心配置文件中明文密码泄漏, 可以使用wpa_passphrase工具加密后再写入配置文件即可, 其用法为: wpa_passphrase + + .. code-block:: console + + wpa_passphrase test 12345678 + # 工具会输出如下形式, 将加密后的psk复制到配置文件中, 删除明文即可 + network={ + ssid="test" + #psk="12345678" + psk=fe727aa8b64ac9b3f54c72432da14faed933ea511ecab15bbc6c52e7522f709a + } + +- **启用Wi-Fi网卡** + + 使用ifup启动Wi-Fi连接并自动获取IP地址 + + .. code-block:: console + + root@raspberrypi4-64:~# ifup wlan0 + Successfully initialized wpa_supplicant + + 使用ifconfig命令查看wlan0网卡, 已经具有IP地址, 并可以正常通信 + + .. code-block:: console + + root@raspberrypi4-64:~# ifconfig + eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx + inet addr:192.168.10.x Bcast:0.0.0.0 Mask:255.255.255.0 + UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 + RX packets:565 errors:0 dropped:0 overruns:0 frame:0 + TX packets:425 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:73072 (71.3 KiB) TX bytes:51915 (50.6 KiB) + + lo Link encap:Local Loopback + inet addr:127.0.0.1 Mask:255.0.0.0 + UP LOOPBACK RUNNING MTU:65536 Metric:1 + RX packets:2 errors:0 dropped:0 overruns:0 frame:0 + TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:140 (140.0 B) TX bytes:140 (140.0 B) + + wlan0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx + inet addr:192.168.43.x Bcast:192.168.43.255 Mask:255.255.255.0 + UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 + RX packets:2 errors:0 dropped:0 overruns:0 frame:0 + TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:365 (365.0 B) TX bytes:432 (432.0 B) + + + .. attention:: + + 当修改/etc/wpa_supplicant.conf配置文件后, 例如新增Wi-Fi网络配置或修改Wi-Fi网络配置, 需要使用ifdown wlan0来关闭网卡, ifup wlan0开启网卡使wpa_supplicant配置重新加载生效 diff --git a/docs/source/security_hardening/index.rst b/docs/source/linux/security/index.rst similarity index 100% rename from docs/source/security_hardening/index.rst rename to docs/source/linux/security/index.rst diff --git a/docs/source/security_hardening/security_configuration_baseline.rst b/docs/source/linux/security/security_configuration_baseline.rst similarity index 97% rename from docs/source/security_hardening/security_configuration_baseline.rst rename to docs/source/linux/security/security_configuration_baseline.rst index 2bf8e7eb577de391784773e23ad0d75cf8800330..adc9a38828e60aa57ac1f3827e9128a7be567829 100644 --- a/docs/source/security_hardening/security_configuration_baseline.rst +++ b/docs/source/linux/security/security_configuration_baseline.rst @@ -83,17 +83,21 @@ openEuler Embedded安全配置基线 为了防止给系统带来风险,外置存储、日志分区、临时存储分区中不要有可执行文件、setuid可执行文件、设备节点等文件,各分区应使用nodev, nosuid, noexec, -ro等挂载选项。对于数据文件等分区应以noexec方式挂载分区;对于文件禁止修改的分区应以ro方式挂载;对于不需要SUID/SGID的分区应以nosuid方式挂载;/var、/tmp目录应以nodev方式挂载。请根据场景判断分区挂载选项的合理性,使用对应的挂载选项。 +ro等挂载选项。对于数据文件等分区应以noexec方式挂载分区;对于文件禁止修改的分区应以ro方式挂载;对于不需要SUID/SGID的分区应以nosuid方式挂载;/var日志分区、/tmp目录应以nodev方式挂载。请根据场景判断分区挂载选项的合理性,使用对应的挂载选项。 **检查方法:** -查看/var、/tmp和/dev/shm是否设置了合适的挂载选项。 -例如,通过以下命令查看是否为/var目录设置了合适的挂载选项: +查看/var日志分区、/tmp和/dev/shm是否设置了合适的挂载选项。 +例如,通过以下命令查看是否为/var日志分区目录设置了合适的挂载选项: .. code-block:: bash - # mount | grep /var + # 假设/var整个目录都为日志所用 + mount | grep var none on /var type tmpfs (rw,nosuid,nodev,relatime,mode=755) + # 或 假设/var/volatile为对应日志分区 + mount | grep var + tmpfs on /var/volatile type tmpfs (rw,nosuid,nodev,relatime,mode=755) 编辑/etc/fstab文件: @@ -171,7 +175,7 @@ ro等挂载选项。对于数据文件等分区应以noexec方式挂载分区; +--------------------------+----------+----------+----------+ | /var/log/\* | root | root | 0640 | +--------------------------+----------+----------+----------+ -| /var/log/secure | root | root | 0640 | +| /var/log/secure或auth.log| root | root | 0640 | +--------------------------+----------+----------+----------+ | /var/log/wtmp | root | root | 0640 | +--------------------------+----------+----------+----------+ @@ -254,6 +258,12 @@ umask如果设置不合理,可能导致新建文件权限过小或过大,从 $ ll -d testdir/ drwx------ 2 test test 40 May 17 23:55 testdir/ +- 其他说明:使用ssh -C远程命令(如ssh root@xxx -C "umask")或scp时,在/etc/profile等文件中配置的umask不会生效,因为ssh远程命令是非login shell,所以不会触发/etc/profile、bashrc中的umask。该情况的配置为高安全要求,可能影响ssh、scp的基本功能使用,在版本中不做自动配置,用户如需要进行加固,可通过在/etc/pam.d/sshd中加入如下内容: + +.. code-block:: bash + + session optional pam_umask.so umask=0077 + 确保全局可写目录设置粘滞位 ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -341,7 +351,7 @@ Linux系统中为某些服务而提供的账户通常称为系统用户,这些 .. code-block:: bash - # cat /etc/passwd | awk -F: '($1!="root" && $3<500 && $7!="/sbin/nologin" && $7!="/bin/false") {print}' + # cat /etc/passwd | awk -F: '($1!="root" && $3<500 && $7!="/sbin/nologin" && $7!="/bin/false" && $7!="/bin/sync") {print}' 确保连续3次输入错误口令后锁定用户 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/releases/release-notes-22.03.30.rst b/docs/source/releases/release-notes-22.03.30.rst index c4e6963eab84fb5f7cfade70455f596499a2e4b5..187e4eb39d1fc7ec649c85f2297990019de9832b 100644 --- a/docs/source/releases/release-notes-22.03.30.rst +++ b/docs/source/releases/release-notes-22.03.30.rst @@ -15,14 +15,13 @@ openEuler Embedded 22.03是openEuler Embedded第一次正式发布,包含的 - 支持80+软件包,详见 :ref:`software_packages_list` * 亮点特性 - 多OS混合部署框架的初步实现,支持openEuler Embedded和Zephyr的混合部署,详见 :ref:`mixed_critical_system` - - 分布式软总线的初步集成,详见 :ref:`distributed_soft_bus` + - 分布式软总线的初步集成,详见 :ref:`distributed_softbus` - 安全加固指导,详见 :ref:`security_hardening` - 基于Preempt-RT的软实时,详见 :ref:`preempt_rt` * 南向生态 - - 新增树莓派4B支持,详见 :ref:`raspberrypi` + - 新增树莓派4B支持,详见 :ref:`board_raspberrypi4_build` * 构建系统 - - 初步的openEuler Embedded构建体系, 详见 :ref:`yocto_quick_build` - - 容器化构建,详见 :ref:`container_build` + - 初步的openEuler Embedded构建体系, 详见 openEuler-22.03-LTS版本->构建系统->快速构建->容器环境下的快速构建指导 * 其他 - 基于Sphinx的文档体系,详见 :ref:`contribute_doc` diff --git a/docs/source/releases/release-notes-22.09.30.rst b/docs/source/releases/release-notes-22.09.30.rst new file mode 100644 index 0000000000000000000000000000000000000000..e72a2de175b00f755180628c9ff3874d4667538e --- /dev/null +++ b/docs/source/releases/release-notes-22.09.30.rst @@ -0,0 +1,23 @@ +:orphan: + +.. _openeuler_embedded_22_09_30: + +openEuler Embedded 22.09 +########################### + +openEuler Embedded 22.09是openEuler Embedded第二个创新版本,包含的内容大概如下: + +* 内核 + - 内核升级到 5.10.0-106.18.0 + - 内核支持Preempt-RT补丁 + - 内核支持树莓派4B相关补丁 +* 软件包 + - 支持140+软件包,详见 :ref:`software_packages_list` +* 亮点特性 + - 多OS混合部署能力增强,新增树莓派4B混合部署实例,新增支持服务化混合部署功能,可通过Linux shell命令行访问zephyr,详见 :ref:`mixed_critical_system` + - 分布式软总线能力增强,新增支持基于分布式软总线的openEuler和openHarmony设备认证和互通互联,增加南向wifi传输介质支持,详见 :ref:`distributed_softbus` + - 安全加固指导,详见 :ref:`security_hardening` + - 基于Preempt-RT的软实时,详见 :ref:`preempt_rt` +* 构建系统 + - 优化后的openEuler Embedded构建体系, 详见 openEuler-22.09版本->构建系统->快速构建->容器环境下的快速构建指导 + diff --git a/docs/source/yocto/addpackage_guide.rst b/docs/source/yocto/addpackage_guide.rst index 443a8b91e446d4684d79b8edf049bcfd97101bf9..b6fbcaa9e22c9ab964b9e86132376f424841f0f6 100644 --- a/docs/source/yocto/addpackage_guide.rst +++ b/docs/source/yocto/addpackage_guide.rst @@ -3,66 +3,88 @@ 新增软件包指导 ############################### -配方(.bb 文件)是 Yocto 项目环境中的基本组件。 OpenEmbedded 构建系统构建的每个软件组件都需要一个配方来定义组件; +配方(bb文件)是 Yocto 项目中的基本组件。Yocto 构建系统构建的每个软件组件都需要一个配方来定义组件;bbappend 文件是 bb 文件的补充,在最后解析。 -新增软件包到镜像中需要有软件包的源码,对应的bb文件。 +新增软件包到镜像中需要软件包的源码和对应的 bb 文件。 主要过程 -******************** +============== -1. **源码获取/下载** +1. **源码获取** -软件包源码放在src(yocto-meta-openeuler同级目录)下。 +源码通常在 `src-openEuler `_ 上获取,在 download_code.sh 脚本中增加下载相关代码的命令;如果 src-openEuler 上不存在对应源码,可以从官网获取后放在 SRC_DIR 目录(yocto-meta-openeuler同级目录)下。 -2. **获取配方(.bb文件)**、 - -从yocto-poky仓库寻找相应软件包的bb文件; +例如,在 download_code.sh 脚本中增加下载 audit 源码: .. code-block:: console + + ... + download_code() + { + ... + update_code_repo src-openeuler/audit ${SRC_BRANCH} //SRC_BRANCH为分支名 + } - find yocto-poky -name package*.bb +2. **获取配方(bb文件)** -`OpenEmbedded Layer `_ 可直接搜索相应软件包的bb文件。 +先确认 yocto-poky 仓是否存在相应软件包的 bb 文件: -3. **适配配方** +.. code-block:: console -在上一步中如果未找到相应版本的bb文件,可基于相近版本修改; + $ find yocto-poky -name *.bb -.. code-block:: console +如果没有找到则可以在 `OpenEmbedded Layer `_ 搜索,然后拷贝需要的文件(bb、补丁等)到 meta-openeuler 层。 - mv package_version1.bb package_version2.bb //修改bb文件名为所需版本 +3. **适配配方** -修改bb文件适配openEuler yocto工程,主要需要修改如下字段; +| bbappend 文件作为 bb 文件的补充,开发者可以通过在 bbappend 文件中增加内容来对 bb 文件进行覆盖更改,而不用直接对 bb 文件进行更改。 +| 开发者首先在 meta-openeuler 层 bb 文件对应的目录下创建 bbappend 文件,文件命名为 _%.bbappend,Yocto 中 "%" 为通配符,这样命名能匹配任何一个找到的 bb 文件版本;下一步根据构建需求编写 bbappend 内容,并做好相应注释说明,大多数情况下编写的内容如下: -SRC_URI:表示软件包来源,修改源码包来源为本地,如果源码是从src-openEuler下载到本地,src-openEuler上该软件包有额外补丁也需要加上。 +- OPENEULER_REPO_NAME: src-openEuler存储仓名称; +- PV: 版本; +- SRC_URI: 源码来源; +- SRC_URI[md5sum/sha256sum]: 源码校验码; +- S: 源码解压后目录。 .. code-block:: console - SRC_URI = "file://package//${BP}.tar.*" //BP变量表示软件名-版本号,*需改为相应的后缀。 + OPENEULER_REPO_NAME = "仓库具体命名" + PV = "版本号" + SRC_URI_remove = "原源码链接" + SRC_URI_prepend = "file://源码包 \ + " + SRC_URI[sha256sum] = "校验码" //执行 sha256sum 源码包 + S = "${WORKDIR}/${BP}" //BP变量表示软件名-版本号,如果不符合则需要修改 -依赖相关字段,如inherit、DEPENDS、RDEPENDS; +举例:查看 meta-openeuler/recipes-support/libjitterentropy/libjitterentropy_%.bbappend 的编写。 + +优先构建未支持的依赖包,从下往上依次适配;查看依赖方法: .. code-block:: console - bitbake -g //此命令可查看软件依赖 + bitbake -g //此命令输出软件依赖到文件中 cat pn-buildlist -发现未支持依赖需优先编译依赖软件或者视情况解耦掉依赖软件。删除不支持的依赖,如inherit texinfo update-alternatives python3,这些class需要引入软件包,暂时没有支持起来。 +4. **单包构建** -4. **单包编译** +.. code-block:: console - bitbake + $ bitbake 5. **加入镜像** -bb文件适配完成并验证ok后,将所需子包追加到layer配置文件RDEPNDNS变量中( 当前配置文件位于yocto-meta-openeuler工程meta-openeuler /recipes-core/packagegroups/packagegroup-xxx.bb )。 +单包构建完成后,将所需子包追加到包管理 bb 文件 RDEPNDNS 变量中(文件位于 meta-openeuler/recipes-core/packagegroups/packagegroup-xxx.bb)。例如: + +.. code-block:: console + + RDEPENDS_${PN} += "audit" -如果在加入镜像中与已有子包文件发生冲突的话需选择需要的子包,将另一个包从RDEPENDS变量值去除,但这个操作可能会引起一些麻烦,由于被删除子包中可能会包含其它必要的文件。 +6. **构建镜像** -6. **编译镜像** +openeuler-image-tiny 镜像中只包含了运行系统所需的最基本的包文件,构建所需时间较少;为了避免构建时间过长,推荐先将所需子包加入到 openeuler-image-tiny 镜像进行验证,验证通过后再加入到 openeuler-image 镜像中。 .. code-block:: console - bitbake openeuler-image + bitbake openeuler-image or openeuler-image-tiny -这时产生的镜像中已经包含了你所需的软件包功能。 +这时产生的镜像中已经包含了你所需的软件包。 diff --git a/docs/source/yocto/container_environment.rst b/docs/source/yocto/container_environment.rst new file mode 100644 index 0000000000000000000000000000000000000000..02a78938a0521d4f13bf1db699ceae82fd80a465 --- /dev/null +++ b/docs/source/yocto/container_environment.rst @@ -0,0 +1,67 @@ +openEuler Embedded 容器环境介绍 +################################### + +相比较22.03版本,22.09版本执行构建前多了一个步骤: + +.. code-block:: + + $ source /opt/buildtools/nativesdk/environment-setup-x86_64-pokysdk-linux + +此步骤会修改环境配置,生成一个适合 openeuler-image 构建的环境,可通过 env 命令对比执行前后的环境配置;此外,/opt/buildtools/nativesdk 的生成与 Yocto 密不可分,接下来介绍为什么需要这个步骤。 + +1. Yocto 构建对主机环境有要求 +================================ + +为了 Yocto 能够正常的构建,主机上需要存在一些工具包,如 git,tar,python 等,Yocto 对这些工具的版本有一定的要求,如果主机环境并不满足要求,那么构建可能会报错。 + +2. 配置适合 Yocto 构建的主机环境 +================================== + +Yocto 官网指明了三种方式可以方便地配置主机环境:第一种是使用 poky 自带的 install-buildtools 脚本安装;第二种是从官网下载 buildtools 压缩文件,该压缩文件同时是一个 shell 脚本,执行脚本就可以安装 sdk 工具到指定的位置;第三种是开发者提前构建 buildtools 压缩文件。 + +参考:`yocto 官方文档1.3节 `_ + +3. Yocto 构建方式 +===================== + +Yocto 针对一个包文件通常会有三种构建方式:target、native、nativesdk。 + +- **target** 即目标构建,一般以 bitbake package 实现,使用交叉编译工具链去编译包,如 x86 环境中构建 arm32 的包; +- **native** 即主机构建,一般以 bitbake package-native 实现,使用主机上的编译器来编译包,不会打包成 rpm 包或者其他类型包,如 x86 环境下构建 x86 的包; +- **nativesdk** 构建,一般以 bitbake nativesdk-package 实现,相比较 native 构建多了打包等步骤,将编译出的产物拆分到一个个包中供使用。 + +| 若 bb 文件中存在如下语句: +| **BBCLASSEXTEND = "native nativesdk"**:表示该包支持三种构建方式; +| **BBCLASSEXTEND = "native"**:表示支持 target 及 native 构建方式; +| **inherit native** or **inherit nativesdk**:表示该 bb 只是一个 native 或者 nativesdk 包,只支持一种构建方式。 + + +4. 配置一个适合 openeuler-image 构建的环境 +============================================= + +openEuler Embedded 为了减少构建主机包的时间,将尽可能多的 native 包都配置到了环境中,这是为了做到构建时不去构建所依赖的 native 包,而是直接从环境中获取,这样可以大幅减少构建时间,配置环境参考第二节 buildtools 的构建方式。 + +openEuler Embedded buildtools 构建方法: + +.. code-block:: + + $ git clone -b nativesdk-3.3.6 https://gitee.com/openeuler/yocto-poky.git + $ cd yocto-poky + $ source oe-init-build-env + $ bitbake buildtools-tarball or bitbake buildtools-extended-tarball + +buildtools-tarball.bb、buildtools-extended-tarball.bb 文件存在于 **poky/meta/recipes-core/meta/** 目录, 原理是将 nativesdk 构建的包生成一个 sdk 工具(位于 **build/tmp/deploy/sdk** 目录),开发者可通过将 nativesdk 工具安装到指定目录或者移动到另一个相同的主机环境中安装使用,然后执行目录中的环境配置脚本配置环境,这时就配置好了相应的环境。 + +执行步骤: + +a. 安装 nativesdk 工具 + +.. code-block:: + + $ sh x86_64-buildtools-extended-nativesdk-standalone-3.3.6.sh -y -d /opt/buildtools/nativesdk + +b. 初始化 openEuler Embedded 构建环境 + +.. code-block:: + + $ source /opt/buildtools/nativesdk/environment-setup-x86_64-pokysdk-linux diff --git a/docs/source/yocto/index.rst b/docs/source/yocto/index.rst index 878a171a17f0c66666a7e37e59bc162e774f996c..9db89d94113a6d334c50656332f349dffe1a982b 100644 --- a/docs/source/yocto/index.rst +++ b/docs/source/yocto/index.rst @@ -12,9 +12,12 @@ openEuler Embeddedd的核心构建系统是基于Yocto,但又根据自身的 .. toctree:: :maxdepth: 1 - quickbuild/index.rst + oebuild.rst overview.rst meta-openeuler.rst exploration.rst development.rst addpackage_guide.rst + container_environment.rst + priority.rst + sstate.rst diff --git a/docs/source/yocto/oebuild.rst b/docs/source/yocto/oebuild.rst new file mode 100644 index 0000000000000000000000000000000000000000..3e9eaaec6629540d5d81072f0276ff70b21c4be4 --- /dev/null +++ b/docs/source/yocto/oebuild.rst @@ -0,0 +1,666 @@ +.. _openeuler_embedded_oebuild: + +基于 oebuild 快速构建 +################################ + +总体介绍 +^^^^^^^^ + +oebuild是openEuler Embedded孵化的一个开源项目,是为了辅助开发openEuler +Embedded项目而衍生的辅助开发工具,是openEuler +Embedded项目健康运行的一个催化剂,目前oebuild主要实现了主体框架,业务只涵盖了构建,将来会涉及到CICD,本地测试,云构建等等,oebuild的使用将不仅仅限于命令行窗口,还会搭载上层IDE来使用。yocto实现了构建的灵活性,但是做应用的定制与实现需要有较高的学习成本与环境成本,oebuild将完全摒弃这些开发羁绊,解放你的双手,只需要几个指令,即可获得你要的应用镜像,你不需要去下载代码,不需要去准备编译环境,如果你要的应用不是特有定制的,甚至不要求你去学习如何修改bb文件,一切都可以交给oebuild来做,而oebuild需要的,仅仅是一个网络而已。对,就这么简单!!! + +运行环境准备 +^^^^^^^^^^^^ + +安装python3和pip +'''''''''''''''' + +通过系统指令安装即可,这里要求要以python3运行oebuild,python3,pip的安装会根据运行系统的不同而不同 + +- 如果是ubuntu类系统,则通过如下命令安装: + +:: + + apt-get install python3 python3-pip + +- 如果是centos,则通过如下命令安装: + +:: + + yum install python3 python3-pip + +- 如果是suse,则通过如下命令安装: + +:: + + zypper install python3 python3-pip + +.. note:: + + 注1:由于版本或名称可能会有所不同,因此在各系统安装python3或pip时,请根据实际环境来安装,例如:有些系统会默认python即python3,有些系统则需要使用python-is-python3包来安装。 + + 注2:如果该系统没有pip包,则可以通过离线方式来安装,预先下载pip包,然后再通过python安装,通过如下命令来完成pip的安装: + + :: + + curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py # 下载安装脚本 + python get-pip.py # python is python3 + +安装oebuild +''''''''''''''''' + +安装完pip后则可以通过以下命令来完成oebuild的安装 + +:: + + pip install oebuild + +oebuild会依赖一些第三方库辅助运行,因此相关的第三方库也会直接被安装,如果在安装过程中显示错误,或报第三方库安装请求失败等,请再次重新运行安装oebuild的命令即可。 + +.. note:: + + 注: 如果安装在安装oebuild时是以root用户执行,则在安装后可以直接运行,如果是以普通用户安装的,则需要注意将普通用户执行路径添加到环境变量中,可以参考以下方式来完成添加: + +1. 以普通用户身份打开.bashrc + +:: + + cd ~ && vim .bashrc + +2. 在文件末尾查看是否将命令执行路径添加到环境变量中,该路径一般为\ ``/home//.local/bin``,如果没有,则将以下语句添加到文件末尾 + +:: + + export PATH=/home//.local/bin:$PATH + +在以上命令行中,\ ````\ 表示是你此时的用户名,如果不确定,则可以通过执行\ ``whoami``\ 来确定 + +1. 在添加完成后保存退出,vim编辑板的保存推出按键为:先按\ ``esc``\ ,再按\ ``shift + :``,最后输入\ ``wq``\ 然后按回车键即可 + +2. 退出后还需要刷新以下环境变量,执行以下命令完成环境变量的刷新 + +:: + + source ~/.bashrc + +这样你就可以使用oebuild这个工具了,试着执行一下\ ``oebuild -h``\ ,看看能否显示oebuild的帮助信息 + + +如何编译一个标准镜像 +^^^^^^^^^^^^^^^^^^^^ + + +这里将介绍如何使用oebuild来进行基于openEuler Embedded项目编译标准的aarch64的qemu应用 + +初始化oebuild目录 +''''''''''''''''' + +运行如下命令完成oebuild的初始化工作: + +:: + + oebuild init + +该操作会初始化oebuild的目录,\ ````\ 表示要初始化目录的名称 + +.. note:: + + 注:由于oebuild的运行整体依赖docker环境的运行,因此,如果你本地没有安装docker应用,则请按照oebuild给出的提示进行操作,或者按以下给出的方式完成docker的安装 + +1. 确定你本机的系统类型,这里以ubuntu为例讲解,执行以下命令完成docker的安装 + +:: + + sudo apt install docker docker.io -y + +2. 添加docker用户组 + +:: + + sudo groupadd docker + +3. 将本用户添加到docker组内 + +:: + + sudo usermod -a -G docker $(whoami) + +4. 重新启动docker + +:: + + sudo systemctl-reload && systemctl restart docker + +5. 修改docker.sock读写权限 + +:: + + sudo chmod o+rw /var/run/docker.sock + +其他操作系统请参考ubuntu方式进行 + +更新oebuild运行环境 +''''''''''''''''''' + +运行如下命令来完成初期环境的准备工作: + +:: + + oebuild update + +| 更新工作主要有两点: + +- pull相关的运行容器镜像 +- 从gitee上下载yocto-meta-openeuler仓代码,如果本地没有openeuler相关容器,则在这一步执行会比较漫长,请耐心等待。 + +创建编译配置文件 +'''''''''''''''' + +运行如下命令来产生编译配置文件: + +:: + + oebuild generate + +默认配置文件对应的镜像是aarch64标准镜像 + +执行构建操作 +'''''''''''' + +执行如下命令会进入镜像构建程序: + +:: + + oebuild bitbake openeuler-image + +请耐心等待20分钟,你就可以得到一个标准的openEuler Embedded +aarch64架构的镜像 + +命令介绍 +^^^^^^^^ + +oebuild init +'''''''''''' + +目录初始化指令,主要用于初始化oebuild项目目录,运行该指令在后面需要跟要初始化的目录名,通过运行\ ``oebuild init -h``\ 来查看帮助信息: + +:: + + usage: + + oebuild init [directory] [-u yocto_remote_url] [-b branch] + + Initialize an OEBUILD working directory, and execute + all other OEbuild instructions in the initialized directory + + positional arguments: + directory The name of the directory that will be initialized + + options: + -h, --help show this help message and exit + -u YOCTO_REMOTE_URL Specifies the remote of yocto-meta-openeuler + -b BRANCH Specifies the branch of yocto-meta-openeuler + +directory: 表示要初始化的目录名称(注意:我们无法在已经初始化的目录内再次执行初始化操作) + +- -u:yocto-meta-openeuler的remote远程链接 + +- -b:yocto-meta-openeuler的分支 + +(注意:oebuild在执行构建任务时是依赖已经适配oebuild的yocto-meta-openeuler的仓的) + +例如初始化demo目录只需要执行如下命令: + +:: + + oebuild init demo + +| init命令执行后主要执行两个任务: + +1. 创建src源码目录,创建.oebuild目录,拷贝config配置文件到.oebuild + +2. 如果设置了-u或-b参数,则对config文件进行相应的修改 + +初始化目录后demo的目录结构如下: + +:: + + .oebuild + config + src + +- src:该目录用于存放跟编译相关的源码 +- .oebuild:目录用于存放全局性配置文件,在oebuild执行初始化后,会看到有一个config配置文件,该配置文件将在搭建编译基础环境时应用到。 + +oebuild update +'''''''''''''' + +基础环境更新指令,在执行初始化目录指令后,在执行构建环节之前必须要先执行该命令,通过运行\ ``oebuild update -h``\ 来查看帮助信息 + +:: + + usage: + oebuild update [-t docker_tag] [-l list] [-i ignore] [-e enable] + + Update the base environment required at build time, such as + updating the necessary docker images and yocto-meta-openeuler repositories + + options: + -h, --help show this help message and exit + -t DOCKER_TAG specifying the -t parameter will update the corresponding docker image + -l {docker} specifying the -l parameter lists the specified modules + -i {docker,meta} specify the -i parameter to ignore the corresponding setting when updating, when the -e parameter is used at the same time, the -i parameter no longer takes + effect + -e {docker,meta} specify the -e parameter to enable the corresponding setting when updating, when the -e parameter is used at the same time, the -i parameter no longer takes + effect + +- -t:指更新哪个tag的容器 + +- -l:表示列出可选资源列表,目前只有docker这一项 + +- -i:表示在更新时忽略哪一项,可选的有docker与meta,docker代表容器镜像,meta代表yocto-meta-openeuler仓 + +- -e:表示在更新时使能哪一项,可选范围与解释同上 + + +执行更新操作如下命令: + +:: + + oebuild update + +| oebuild执行构建有两个必要的前提: + +- 构建需要的容器 +- 主构建仓(yocto-meta-openeuler) + +所以更新命令主要以这两部分展开 + +另外,如果我们有自己的oebuild适配仓,可以在\ ``config``\ 配置文件中修改(该文件在\ ``/.oebuild``\ 目录下),如果已经先执行过更新操作,然后再次执行\ ``oebuild update``\ 会将原有的\ ``yocto-meta-openeuler``\ 做备份,将在工作空间根目录下创建yocto-bak备份目录,然后将备份后的\ ``yocto-meta-openeuler``\ 移动到该目录。更改基础仓在config中的如下字段修改: + +:: + + basic_repo: + yocto_meta_openeuler: + path: yocto-meta-openeuler + remote_url: https://gitee.com/openeuler/yocto-meta-openeuler.git + branch: master + +basic_repo与yocto-meta-openeuler是两个key键,不可以更改,remote_url与branch可以更改成自己已经适配的\ ``yocto-meta-openeuler``\ 仓的参数 + +.. note:: + + 注:如果我们不输入任何参数,即直接执行\ ``oebuild update``\ ,则默认更新容器镜像和基础仓 + +oebuild generate +'''''''''''''''' + +创建配置文件指令,而该命令就是用来产生配置文件的,通过运行`oebuild generate -h`来查看帮助信息。 + +:: + + usage: + + oebuild generate [-p platform] [-f features] [-t toolchain_dir] [-d build_directory] [-l list] [-b_in build_in] + + compile.yaml is generated according to different command parameters by generate + + options: + -h, --help show this help message and exit + -l {platform,feature} + with platform will list support archs, with feature will list support features + -p PLATFORM this param is for arch, for example aarch4-std, aarch64-pro and so on + -s SSTATE_CACHE this param is for SSTATE_MIRRORS + -s_dir SSTATE_DIR this param is for SSTATE_DIR + -m TMP_DIR this param is for tmp directory, the build result will be stored in + -f FEATURES this param is feature, it's a reuse command + -d DIRECTORY this param is build directory, the default is same to platform + -t TOOLCHAIN_DIR this param is for external toolchain dir, if you want use your own toolchain + -n NATIVESDK_DIR this param is for external nativesdk dir, the param will be useful when you want to build in host + -dt, --datetime this param is add DATETIME to local.conf, the value is getting current time + -df, --disable_fetch this param is set openeuler_fetch in local.conf, the default value is enable, if set -df, the OPENEULER_FETCH will set to 'disable' + -b_in {docker,host} This parameter marks the mode at build time, and is built in the container by docker + +- -l:list参数,有两个可选范围,platform和feature,platform则会列出支持的platform列表,feature则会列出支持的feature列表 + +- -p:全称platform,生成配置文件需要的一个参数,默认为aarch64-std + +- -s:指定外部sstate_cache目录,该目录在构建时会使用 + +- -s_dir:指定sstate_cache目录,该目录在构建时会使用 + +- -m:执行tmp目录,yocto在要求tmp目录不可以存放在nfs系统文件结构下,如果有相关环境可以单独指定该存放目录 + +- -f:特性参数,全称feature,生成配置文件需要的一个参数,没有默认值 + +- -d:外部编译链参数,全称toolchain_dir,生成配置文件需要的一个参数,没有默认值,该值表示如果我们不需要系统提供的交叉编译链而选择自己的交叉编译链,则可以选择该参数。 + +- -n:外部nativesdk目录参数,可以指定外部nativesdk目录,当构建方式为主机构建时该配置才有效 + +- -dt:在local.conf中设定DATATIME变量,该变量旨在设定构建时间戳 + +- -df:在local.conf中设定 ``OPENEULER_FETCH`` 变量为 ``disable`` ,这样构建时将禁用OPENEULER_FETCH功能 + +- -b_in:构建方式,目前构建方式有docker与host两种,默认与推荐使用docker构建方式 + +oebuild在构建时依赖compile.yaml配置文件来完成构建操作,创建配置文件指令已经属于构建指令内容,该操作将会检查\ ``yocto-meta-openeuler``\ 是否适配了oebuild,检查是否适配的规则便是是否在\ ``yocto-meta-openeuler``\ 根目录创建了\ ``.oebuild``\ 隐藏目录,而\ ``-p``\ 则会解析\ ``.oebuild/platform``\ 下相应的平台配置文件,\ ``-f``\ 参数则会解析\ ``.oebuild/feature``\ 下相应的配置文件,该参数是可以多值传入的,例如如下范例: + +:: + + oebuild generate -p aarch64-std -f systemd -f openeuler-qt + +则生成的构建配置文件会涵盖\ ``systemd openeuler-qt``\ 两者的特性 + +最终会在编译目录下(在执行完\ ``oebuild generate``\ 后按提示给出的路径即为编译目录)生成构建配置文件\ ``compile.yaml``,关于该配置文件的详细介绍请参考配置文件介绍中的\ ``compile.yaml``\ 。在下一步的构建流程会解析该配置文件,在此之前,用户可以根据自身特定场景环境来修改配置文件,因为按该\ ``oebuild generate``\ 指令生成的配置文件仅算作一个参考模板,目的是给用户一个最基本的模板参考用,减少用户学习的成本,使用户能够快速上手。 + +oebuild bitbake +''''''''''''''' + +构建指令,该指令会解析\ ``compile.yaml``\ (通过\ ``oebuild generate``\ 指令生成的),然后完成构建环境的初始化工作。该命令参数如下: + +一般来说,启动后的容器挂在的目录映射关系如下: + +:: + + /src:/usr1/openeuler/src + /build/:/usr1/openeuler/build + +如果在\ ``compile.yaml``\ 中有\ ``toolchain_dir``\ 参数,即有用户自定义外部工具链,则会增加一个挂载目录,如下: + +:: + + :/usr1/openeuler/native_gcc + +oebuild manifest +''''''''''''''''' + +manifest相关指令,该指令需要在oebuild工作目录下运行,通过该指令我们可以生成当前src目录下的软件仓清单列表,包含远程仓地址以及版本,也可以通过清单文件将相应的软件仓还原到指定的版本,该指令需要oebuild版本在0.0.11及以上。该命令帮助信息如下: + +:: + + usage: + + oebuild manifest [-c CREATE] [-r recover] [-m_dir MANIFEST_DIR] + + manifest provides the manifest function of generating dependent + source repositories in the build working directory, and can restore + relevant source repositories based on the manifest file + + options: + -h, --help show this help message and exit + -c, --create create manifest from oebuild workspace src directory + -r, --recover restore repo version to oebuild workspace src directory from a manifest + -m_dir MANIFEST_DIR specify a manifest path to perform the create or restore operation + +- -c:创建manifest文件标识参数 +- -r:依据manifest文件将软件仓还原到指定的版本 +- -m_dir:指定manifest路径 + +我们在完成镜像构建所有任务后,在oebuild工作目录下运行: + +:: + + oebuild manifest -c -m_dir source_list/manifest.yaml + +这样,我们就生成当下src目录的软件清单列表,存放路径为/source_list/manifest.yaml + +如果我们需要通过manifest.yaml来复原一个镜像版本,那么按如下步骤进行: + +1. 通过manifest命令还原软件仓版本,运行如下命令: + +:: + + oebuild manifest -r -m_dir + +2. 运行generate命令附带-df参数,生成配置文件,这样就会关闭OPENEULER_FETCH功能: + +:: + + oebuild generate -df ... # 其他参数按需添加 + +3. 修改compile.yaml文件,在build_in字段下添加如下内容,屏蔽layer层更新: + +:: + + not_use_repos: true + +4. 执行bitbake指令,进入交互模式,然后执行\ ``bitbake openeuler-image``\ 进行构建 + +配置文件介绍 +^^^^^^^^^^^^ + +oebuild在生成后有多个配置文件,每个配置文件的作用域不同,下面将介绍各配置文件存放位置以及内容 + +config +'''''' + +oebuild在外围环境的配置文件,该配置文件存放在oebuild项目根目录下的.oebuild目录中,该配置文件结构如下: + +:: + + docker: + repo_url: swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container + tag_map: + openEuler-22.09: '22.09' + openEuler-22.03-lts-sp1: 22.03-lts-sp1 + master: latest + basic_repo: + yocto_meta_openeuler: + path: yocto-meta-openeuler + remote_url: https://gitee.com/openeuler/yocto-meta-openeuler.git + branch: master + +**docker**: +表示构建容器相关信息,在该字段下面所列的容器镜像,在执行\ ``oebuild update``\ 后会下载相应的容器 + +- repo_url:表示openEuler Embedded的docker远程仓地址 + +- tag_map:表示每个openEuler Embedded版本对用的docker构建容器tag + +**basic_repo**:表示基础的repo仓,顾名思义,表示在构建之前是作为底座的角色存在的,在执行\ ``oebuild update``\ 时会解析config配置文件,然后下载相应的构建代码仓 + +- yocto-meta-openeuler:目前oebuild唯一的基础仓 + +- path:该仓下载的路径名称 + +- remote_url:该仓的远程地址 + +- branch:该仓的分支 + +.env +'''' + +编译目录配置文件结构如下: + +:: + + container: + remote: xxxxxxxxxxxx + branch: xxxxxxxxxxxx + short_id: xxxxxxxxxx + volumns: + - /xxxxxxxxxxx + - /xxxxxxxxxxx + +| container:表示容器相关配置信息 + +- remote:表示\ ``yocto-meta-openeuler``\ 远程url + +- branch:表示\ ``yocto-meta-openeuler``\ 分支信息 + +- short_id:表示容器ID + +- volumns:表示容器挂在的目录映射 + +oebuild在执行构建过程中,会解析\ ``.env``\ 配置文件,通过对比环境中的其他参数确定是否重新创建一个新的容器还是启用旧容器,比对的内容包括(remote,branch,volumns)只有这三个参数与要构建的对应参数一致,才会继续拉起旧容器,否则就会创建一个新的容器。另外oebuild也会检查设置的short_id对用的容器是否存在,不存在也会创建一个新的容器。在创建新的容器后,新的配置信息会重新写入到\ ``.env``\ 中 + +compile.yaml +'''''''''''' + +构建配置文件,该配置文件结构如下: + +:: + + platform: aarch64-std + machine: qemu-aarch64 + toolchain_type: EXTERNAL_TOOLCHAIN_aarch64 + sdk_dir: + toolchain_dir: + repos: + yocto-poky: + url: https://gitee.com/openeuler/yocto-poky.git + path: yocto-poky + refspec: openEuler-22.09 + + yocto-meta-openembedded: + url: https://gitee.com/openeuler/yocto-meta-openembedded.git + path: yocto-meta-openembedded + refspec: dev_hardknott + + yocto-meta-ros: + url: https://gitee.com/openeuler/yocto-meta-ros.git + path: yocto-meta-ros + refspec: dev_hardknott + local_conf: | + - xxx + - xxx + layers: + - xxx + - xxxx + +- platform:表示cpu架构, + +- machine:表示机器类型 + +- toolchain_type:表示编译链类型 + +- sdk_dir:保留字段 + +- toolchain_dir:表示自定义外部编译链路径,如果在\ ``oebuild generate``\ 设置了该参数\ ``-t``\ ,则会在\ ``compile.yaml``\ 存在该字段 + +- repos:表示在初始化构建环境时需要用到的仓 + + - url:表示仓的远程地址 + + - path:表示仓在本地的地址 + + - refspec:表示仓的版本分支 + +- local_conf:local.conf替换内容,该值在oebuild执行完oe_init后将替换\ ``build/conf/local.conf``\ 中匹配到的内容 + +- layers:meta层,该值在oebuild执行完oe_init后将通过调用\ ``bitbake-layers add-layer``\ 来添加meta层 + +开发者帮助 +^^^^^^^^^^ + +oebuild项目欢迎广大爱好开发者参与贡献oebuild的发展,为了使开发者更快更好的参与到oebuild的开发工作中来,我们专门写了如下指导。 + +oebuild目录介绍 +''''''''''''''' + +打开oebuild仓我们可以看到,oebuild一级目录有如下内容: + +:: + + docs + src + .gitignore + MANIFEST.in + README.md + setup.py + +- docs:文档目录,该目录用于存放关于oebuild的介绍性信息 + +- src:核心源码目录,我们真正运行oebuild的核心源码就存放在这里,后续介绍关于参与开发oebuild的详细流程将会详细介绍该目录内容 + +- .gitignore:git提交忽略的文件,在该文件中通过设置的内容可以在git提交时自动忽略 + +- MANIFEST.in:该文件为pip在打包时包含额外文件的配置文件,在该文件中的内容将在执行python打包时按规则进行包含 + +- README.md:简要介绍性文件 + +- setup.py:python打包入口文件 ,我们最终要打包wheel包就要通过该文件来完成 + +如何使用setup.py进行调试或打包 +'''''''''''''''''''''''''''''' + +在我们完成相关的开发性工作并进行调试时,将通过setup.py内的相关设置来完成该工作 + +打开setup.py文件,我们可以看到其内容如下: + +:: + + # Copyright 2018 Open Source Foundries Limited. + # Copyright (c) 2020, Nordic Semiconductor ASA + # + # SPDX-License-Identifier: Apache-2.0 + + import os + + import setuptools + + SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) + os.chdir(SCRIPT_DIR) + + with open('README.md', 'r') as f: + long_description = f.read() + + with open('src/oebuild/version.py', 'r') as f: + __version__ = None + exec(f.read()) + assert __version__ is not None + + version = os.environ.get('OEBUILD_VERSION', __version__) + + setuptools.setup( + name='oebuild', + version=version, + author='alichinese', + author_email='', + description='', + long_description=long_description, + # http://docutils.sourceforge.net/FAQ.html#what-s-the-official-mime-type-for-restructuredtext-data + long_description_content_type="text/x-rst", + url='', + packages=setuptools.find_packages(where='src'), + package_dir={'': 'src'}, + include_package_data=True, + classifiers=[ + 'Programming Language :: Python :: 3', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: POSIX :: Linux', + ], + install_requires=[ + 'setuptools', + 'packaging', + 'PyYaml', + 'docker', + 'GitPython', + 'colorama', + 'ruamel.yaml' + ], + python_requires='>=3.8', + entry_points={'console_scripts': ('oebuild = oebuild.app.main:main',)}, + ) + +可以看到引入的模块儿有\ ``setuptools``,这个是打包的核心模块儿,关于其他的介绍我们暂且不管,因为对于开发者来说几乎没改动,这里我们着重介绍以下\ ``install_requires``\ ,该设置从字面意思理解就是依赖的必要安装,也就是说oebuild运行要依赖的第三方库,如果我们在后续的oebuild开发过程中有一些其他库的依赖,则需要在这里添加。 + +在进入oebuild目录后,我们可以执行以下命令进入调试状态: + +:: + + pip install -e . + +.. note:: + + 注:以上命令的运行如果以普通用户运行,需要先确认是否将本地执行路径添加到环境变量\ ``PATH``\ 中,如果以root用户运行则不需要考虑,这样我们可以直接运行oebuild相关指令 + + 这样在后续开发与调试过程中,我们可以随时改代码随时生效 + +src源码介绍 +''''''''''' + +正在完善中… diff --git a/docs/source/yocto/overview.rst b/docs/source/yocto/overview.rst index 76fc5999c1aa35f1372ba262697b920d1c0cbc3c..46c83b3d7779b8c083395970a23a891c36fa7f26 100644 --- a/docs/source/yocto/overview.rst +++ b/docs/source/yocto/overview.rst @@ -6,19 +6,21 @@ Yocto介绍 Yocto是什么 ************** -Yocto项目是Linux Foundation旗下的一个开源协作项目,该项目起源于OpenEmbedded Project,并与之协作,可帮助开发人员 -在各种硬件架构上创建基于Linux的定制系统,这些系统专为嵌入式产品而设计,不区分硬件体系架构。Yocto Project提供了灵活 -的工具集和开发环境,允许全世界的嵌入式设备开发人员通过共享技术、软件堆栈、配置和最佳实践,用于协作创建定制Linux镜像。 +Yocto(Yocto Projec,后简称Yocto)是Linux基金会(Linux Foundation)旗下的一个开源协作项目,该项目起源于 +OpenEmbedded项目(OpenEmbedded Project,后简称OpenEmbedded),并与之协作,可帮助开发人员在各种硬件架构上创 +建基于Linux的定制系统,这些系统专为嵌入式产品而设计,不区分硬件体系架构。Yocto提供了灵活的工具集和开发环境,允许全 +世界的嵌入式设备开发人员通过共享技术、软件堆栈、配置和最佳实践,用于协作创建定制Linux镜像。 -该项目为构建定制化的嵌入式Linux发行版提供一系列模板、工具和方法来简化定制linux开发,允许更换软件配置和构建,避免重复工作 -以及不必要的维护。Yocto项目鼓励跨各种应用程序和设备类型的创新,支持多种硬件架构,包括X86(32位和64位)、ARM(32w位和64位)、 +Yocto为构建定制化的嵌入式Linux发行版提供一系列模板、工具和方法来简化定制Linux开发,允许更换软件配置和构建,避免重复工作 +以及不必要的维护。Yocto鼓励跨各种应用程序和设备类型的创新,支持多种硬件架构,包括X86(32位和64位)、ARM(32w位和64位) 、RISC-V、PPC和MIPS等。随着硬件BSP支持的增加和BSP格式的标准化,这个项目创造了巨大的价值。 -Yocto项目和OpenEmbedded共享一个核心元数据集合,称为openembedded-core。OpenEmbedded为各种体系结构、功能和应用程序 -提供了一套全面的元数据。Yocto项目专注于为一组核心架构和特定单板提供功能强大、易于使用、可互操作、经过良好测试的工具、元数 +Yocto和OpenEmbedded共享一个核心元数据集合,称为OpenEmbedded-Core。OpenEmbedded为各种体系结构、功能和应用程序 +提供了一套全面的元数据, 而Yocto专注于为一组核心架构和特定单板提供功能强大、易于使用、可互操作、经过良好测试的工具、元数 据和BSPs。 -**** +**Yocto主要特点** + - 广泛应用于整个行业 - 架构无关 - 镜像和代码移植容易 @@ -36,41 +38,39 @@ Yocto项目和OpenEmbedded共享一个核心元数据集合,称为openembedded Yocto构建流程 ******************** +Yocto的构建流程如下图所示,开发者通过指定一些用户配置文件(例如local.conf),其中包含针对不同软件的配方文件、层, +目标开发板的配置文件和打包策略配置文件等。Yocto的执行引擎Bitbake会去读取这些配方和配置文件,然后 -Yocto的构建流程如下图所示,开发者通过指定一些用户配置文件(比如说local.conf),其中包含针对不同软件的配方文件和层, -目标开发板的配置文件,打包策略配置文件。Bitbake(淡蓝色部分)会去读取这些配方和配置文件,然后 - -1. 去配方和配置文件指定的地方(下图深黄色部分)下载源代码(source fetching)。 -#. 下载后,将源码提取到本地工作区(下图绿色部分)中,在工作区中打补丁(patch application)、执行配置和编译等步骤 -#. 使用一些自动工具(比如说使用autoconf生成configure脚本,config.h等文件) -#. 分析各个包之间的依赖关系(analysis for package relationship) -#. 根据打包策略生成deb, rpm或者ipk包 -#. 对软件包进行测试(QA tests),做一些通用的质量检查和健全性检查 -#. 使用这些软件包生成linux镜像和软件开发套件(SDK) - -在使用Yocto项目的过程中,这个工作流将会随着实际使用的组件和工具而改变。 +1. 去配方和配置文件指定的地方下载源代码(source fetching)。 +#. 下载后,将源码提取到本地工作区中,在工作区中打补丁(patch application)、执行配置和编译等步骤 +#. 分析软件包如何拆分成子包以及软件包之间的关系 +#. 根据打包策略生成具体的软件包(deb, rpm或者ipk包) +#. 对软件包进行测试(QA tests),包括一些通用的质量检查和健全性检查 +#. 以软件包为单位生成Linux镜像和软件开发套件(SDK) .. image:: ../../image/yocto/open_embedded_architecture_workflow.png +在使用Yocto的过程中,这个工作流将会随着实际使用的组件和工具而改变。 + 通常,Yocto构建的工作流由几个功能区域组成: - - User Configuration:可用于控制生成过程的元数据(bblayer.conf/local.conf)。 - - Metadata Layers:提供软件、板子和发行版元数据的各种层。 - - Source Files:构建使用的软件包源码,可以来自上游发布的软件包、本地代码目录或者软件代码仓(例如git,svn)。 - - Build System:在Bitbake控制下的进程。这个模块扩展了Bitbake如何获取源代码、应用补丁、完成编译、分析生成包的输出、创建和测试包、生成镜像 + - 用户构建配置(User Configuration):可用于控制生成过程的元数据(bblayer.conf/local.conf)。 + - 构建元数据层(Metadata Layers):提供软件、板子和发行版元数据的各种层,通过元数据层可以有效实现复用和抽象 + - 软件包源代码(Source Files):构建使用的软件包源码,可以来自上游发布的软件包、本地代码目录或者软件代码仓(例如git,svn,http,ftp)。 + - 构建系统(Build System):在Bitbake控制下的进程。这个模块扩展了Bitbake如何获取源代码、应用补丁、完成编译、分析生成包的输出、创建和测试包、生成镜像 以及生成交叉开发工具。 - - Package Feeds:包含输出包(RPM、DEB或IPK)的目录,这些输出包随后用于构建由构建系统生成的镜像或软件开发工具包(SDK)。如果启用了运行时包 - 管理,还可以使用web服务器或其他方式复制和共享这些提要,以便于在运行时扩展或更新设备上的现有镜像。 - - Images:生成的镜像,包括内核镜像、根文件系统镜像等。 - - Application Development SDK:生成的包含交叉编译工具链、头文件和库文件的开发组件。 + - 软件包源(Package Feeds):包含输出包(RPM、DEB或IPK)的目录,这些输出包随后用于构建由构建系统生成的镜像或软件开发工具包(SDK)。如果启用了运行时包 + 管理,还可以使用web服务器或其他方式复制和共享这些软件包,以便于在运行时扩展或更新设备上的现有镜像。 + - 镜像(Images):生成的镜像,包括内核镜像、根文件系统镜像等。 + - 应用开发工具(Application Development SDK):生成的包含交叉编译工具链、头文件和库文件的开发组件。 主要组件和工具 ******************** -Yocto项目在整个Yocto项目源存储库参考系统(Poky)中集成了OE-Core Metadata。Yocto Project Version 1.0之后,Yocto Project和 +Yocto参考实现(Poky)中集成了OE-Core Metadata。Yocto Project Version 1.0之后,Yocto和 OpenEmbedded同意共同工作并共享一个共同的核心元数据集(OE-Core),其中包含以前在Poky中发现的大部分功能。这种合作实现了长期的 -OpenEmbedded目标,拥有更严格控制和质量保证的核心。共享一组核心元数据使Poky成为OE-Core之上的集成层。Yocto项目结合了各种组件,如 -Bitbake,OE-Core,脚本“集合”,以及其构建系统的文档。要使用Yocto Project工具和组件,还要下载(clone)Poky并使用它来引导构建自己的 +OpenEmbedded目标,拥有更严格控制和质量保证的核心。共享一组核心元数据使Poky成为OE-Core之上的集成层。Yocto结合了各种组件,如 +Bitbake,OE-Core,脚本“集合”,以及其构建系统的文档。要使用Yocto工具和组件,需要下载(clone)Poky并使用它来引导构建自己的 发行版。 @@ -78,69 +78,69 @@ Bitbake,OE-Core,脚本“集合”,以及其构建系统的文档。要使 Metadata ^^^^^^^^^^^^^^^^ -Metadata元数据是Yocto项目的关键元素,用于构建Linux发行版。元数据包含在一些文件中,当构建镜像时构建系统会去解析它们。通常,元数据包括 +Metadata元数据是Yocto的关键元素,用于构建Linux发行版。元数据包含在一些文件中,当构建镜像时构建系统会去解析它们。通常,元数据包括 配方、配置文件和其他引用构建指令本身的信息,以及用于控制要构建的事物和影响构建方式的数据。 元数据还包括: - | 1). 用于指示被使用软件的版本和来源信息的命令和数据; - | 2). 对软件本身(补丁或辅助文件)进行的更改或添加,用于修复错误或自定义特定情况下使用的软件。 + +- 用于指示被使用软件的版本和来源信息的命令和数据; +- 对软件本身(补丁或辅助文件)进行的更改或添加,用于修复错误或自定义特定情况下使用的软件。 OpenEmbedded Core就是一组重要的经过验证的元数据集合。 - - Configuration Files(配置文件):包含变量的全局定义、用户定义的变量和硬件配置信息的文件,主要是.conf文件。它们告知构建系统需要构 + - 配置文件(Configuration Files):包含变量的全局定义、用户定义的变量和硬件配置信息的文件,主要是.conf文件。它们告知构建系统需要构 建什么,并放入镜像image中以支持特定平台。比如conf/local.conf可以配置机器配置选项,分发配置选项,编译器调整选项,常规通用配置选项 和用户配置选项。conf/bblayers.conf中可以添加用到的layer层路径,从而在编译时将他们添加进去。 - - recipe(配方):元数据(metadata)的最常见形式,主要是.bb、.bbappend、.inc、.bbclass和patches文件。一个recipe包含一个用于构 - 建程序包的设置和任务(说明)列表,食谱描述将从哪里获取源码,以及应用哪些补丁,描述了库和其他食谱的依赖关系,以及配置和编译选项。它们存 + - 配方(Recipes):元数据(metadata)的最常见形式,主要是.bb、.bbappend、.inc、和.bbclass。一个recipe包含一个用于构 + 建程序包的设置和任务(说明)列表,配方描述将从哪里获取源码,以及应用哪些补丁,描述了和其他软件包的依赖关系,以及配置和编译选项。它们存 储在层(layer)中。bbappend和bb的区别主要在于bbappend是基于bb的,功能是对相应的bb文件作补充和覆盖,类似于'重写'的概念。 .bbclass文件,包含在配方文件之间共享的有用信息。.inc文件包含一个开源软件多版本之间共享的信息。 - - Layer(层):即各种meta-xxx目录,将Metadata按层进行分类,是一些列相关配方的集合(同一个目标文件的相关配方,配置等文件)。层允许你合 - 并相关的元数据以自定义构建,并隔离多个体系结构构建的信息。例如要定制一套支持特定硬件的系统,可以把与底层相关的单元放在一个layer中,这叫 - 做 Board Support Package(BSP) Layer。层在覆盖先前规范方面具有层次结构。隔离特定于硬件的配置允许通过使用不同的层来共享其他元数据, - 其中元数据可能在多个硬件中是通用的。你可以从Yocto Project中包含任意数量的可用层,并通过在它们之后添加你自己的层来自定义构建。尽管你可 - 能会发现在单个项目中将所有内容都保留在一层中很诱人,但是元数据的模块化程度越高,应对将来的更改就越容易。 + - 层(Meta layers):即各种meta-xxx目,将Metadata按层进行分类,是一些列相关配方的集合(同一个目标文件的相关配方,配置等文件)。层允许合 + 并相关的元数据以自定义构建,并隔离多个体系结构构建的信息。例如要定制一套支持特定硬件的系统,可以把与底层相关的单元放在一个层中,例如BSP + (Board Support Package)层。在实际的Yocto应用中,可以包含任意数量的可用层,并通过在它们之后添加你自己的层来自定义构建。尽管你在单个项目 + 中将所有内容都保留在一层中很诱人,但是元数据的模块化程度越高,应对将来的更改就越容易。 Bitbake ^^^^^^^^^^^^^^^ -Bitbake一种软件构建自动化工具,是解析指令(食谱)和配置数据的调度程序和执行引擎,像所有的build工具一样(比如make,ant,jam)控制如何去构建 +Bitbake一种软件构建自动化工具,是解析指令(配方)和配置数据的调度程序和执行引擎,像所有的build工具一样(比如make,ant,jam)控制如何去构建 系统并且解决构建依赖。但是又区别于功能单一的工程管理工具(比如make),Bitbake不是基于把依赖写死了的makefile,而是收集和管理大量之间没有依赖 -关系的描述文件(这里我们称为包的配方),在解析阶段之后,Bitbake 创建一个依赖树来对编译进行排序,调度包含代码的编译,最后构建指定的自定义Image。 +关系的配方,在解析阶段之后,Bitbake创建一个依赖树来对所有构建任务进行排序和调度,最后构建定制化的镜像。 Bitbake是一个Python程序,它由用户创建的配置驱动,可以为用户指定的目标执行用户创建的任务,即所谓的配方。配置、任务和配方是用一种Bitbake DSL -(领域特定语言)编写的,其中包含变量和可执行的 shell 或 python 代码。它允许shell和Python任务在复杂的任务间依赖性约束下工作时高效并行地运行。 +(领域特定语言)编写的,其中包含变量和可执行的shell或Python代码。它允许shell和Python任务在复杂的任务间依赖性约束下工作时高效并行地运行。 简而言之,Bitbake是一个构建引擎,它通过以特定格式编写的配方来执行,以执行任务集。 Bitbake是作为构建软件的工具而制作的,因此具有一些特殊功能,例如定义依赖项的可能性。Bitbake能够解决依赖关系并将它必须做的工作按正确的顺序排 列,然后执行这些任务。此外,构建软件包通常包含相同或非常相似的任务。常见任务例如:下载并提取源代码、运行配置、运行make或简单地编写日志消息。 Bitbake提供了一种以可配置方式抽象、封装和重用此功能的机制。 -通常,Bitbake项目组织在包含配置和元数据的文件夹(称为层)中,以及一个构建文件夹(文件夹包含Bitbake功能的配置、任务和目标描述)。通常的做法是将 -层文件夹命名为meta-xxx。 +更多信息可以参考 `Bitbake手册 `_ -Bitbake手册:https://docs.yoctoproject.org/bitbake/ - -oe-core +OE-Core ^^^^^^^^^^^^^^^^ -oe-core(OpenEmbedded-Core)是由基础配方,类和关联文件组成的元数据,是一些脚本(shell和Python脚本)和数据构成的自动构建系统。在许多不同的 -OpenEmbedded派生系统(包括Yocto Project)中,它们都是共有的。Yocto项目和OpenEmbedded项目都维护OpenEmbedded-Core。它是OpenEmbedded + +OE-Core(OpenEmbedded-Core)是由基础配方,类和关联文件组成的元数据,是一些脚本(shell和Python脚本)和数据构成的自动构建系统。在许多不同的 +OpenEmbedded派生系统(包括Yocto Project)中,它们都是共有的。Yocto和OpenEmbedded都维护OpenEmbedded-Core。它是OpenEmbedded 社区开发的原始仓库的精选子集,该原始仓库已被精简为一组较小的,经过持续验证的核心配方,从而形成了受到严格控制且质量保证的核心配方集。 -poky +Poky ^^^^^^^^^^^^^^^^ -poky–参考嵌入式发行版OS,实际上是一个有效的构建实例,它包含构建系统(Bitbake、OpenEmbedded Core、meta-poky、meta-yocto-bsp)以及一组 + +Poky是Yocto参考嵌入式发行版OS,实际上是一个有效的构建实例,它包含构建系统(Bitbake、OpenEmbedded Core、meta-poky、meta-yocto-bsp)以及一组 元数据,可帮助你开始构建自己的发行版。 -要使用Yocto项目的工具,你可以下载poky,并且用它来引导你自己的发行版。值得注意的是,poky不包含二进制文件–它是一个工作实例,用来告诉你如何从源 -代码构建自己的定制Linux发行版。你可以以任何你需要的方式去更改、拷贝或使用poky构建细节,来创建你的定制嵌入式Linux。 +要使用Yocto的工具,需要下载poky,并且用它来引导你自己的发行版。值得注意的是,poky不包含二进制文件–它是一个工作实例,用来告诉你如何从源 +代码构建自己的定制Linux发行版。你可以以任何你需要的方式去更改、拷贝或使用poky,从而来创建定制嵌入式Linux。 poky最强大的特性之一是构建的每个方面都由元数据控制。通过添加扩展功能的元数据层,可以使用元数据来扩充这些基本镜像类型。例如,这些层可以为图像类 型提供额外的软件堆栈,为其他硬件添加板级支持包(BSP),甚至可以创建新的镜像类型。 -pseudo +Pseudo ^^^^^^^^^^^^^^^^ -Pseudo是fakeroot的实现, 用于在看似具有root权限的环境中执行命令。在构建软件时,可能需要像系统管理员一样执行操作。例如,你可能需要定义文件的所有权或权限信息。 + +Pseudo是一个类似fakeroot的工具, 用于在看似具有root权限的环境中执行命令。在构建软件时,可能需要像root权限执行操作。例如,定义文件的所有权或权限信息。 Pseudo是一个程序,可以直接使用,也可以作为LD_PRELOAD使用,这两种方法都实现这些操作,就像用户确实具有系统管理员权限一样,即使他们是普通用户。 @@ -165,56 +165,46 @@ Pseudo与fakeroot有很多相似之处,但它是一种新的实现,它改进 } do_mytask[depends] += "virtual/fakeroot-native:do_populate_sysroot" -| **FAKEROOT** :包含在 fakeroot 环境中运行 shell 脚本时使用的命令。 FAKEROOT 变量已过时,已被其他 FAKEROOT* 变量替换。 -| **FAKEROOTBASEENV** :列出在执行 FAKEROOTCMD 定义的命令时要设置的环境变量,该命令在 fakeroot 环境中启动 bitbake-worker 进程。 -| **FAKEROOTCMD** :包含在 fakeroot 环境中启动 bitbake-worker 进程的命令。 -| **FAKEROOTDIRS** :列出在 fakeroot 环境中运行任务之前要创建的目录。 -| **FAKEROOTENV** :列出在 fakeroot 环境中运行任务时要设置的环境变量。 -| **FAKEROOTNOENV** :列出运行不在 fakeroot 环境中的任务时要设置的环境变量。 +- 为什么使用pseudo,而不是fakeroot,请参考:https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot +- fakeroot使用,请参考:http://man.he.net/man1/fakeroot - -为什么使用pseudo,而不是fakeroot:https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot -fakeroot使用:http://man.he.net/man1/fakeroot - -package feeds +软件包源 ^^^^^^^^^^^^^^^^^^^^^^ -当 OpenEmbedded构建系统生成image或SDK时,它会从位于构建目录中的包源区域获取包。如下图所示: -.. image:: ../../image/yocto/package_feeds.png +当Yocto构建生成镜像或SDK时,它会从位于构建目录中的软件包源区域获取包。如下图所示: -包源是构建过程中的一个中间步骤,用来临时存储包的目录,由变量和正在使用的特定包管理器的组合确定。 OpenEmbedded -构建系统提供了生成不同包类型的类,可以通过 PACKAGE_CLASSES 变量指定要启用的类。在将包放入包源中之前,构建过程 -会通过生成的输出的质量保证检查来验证它们。 +.. image:: ../../image/yocto/package_feeds.png -| **DEPLOY_DIR**\ :在构建目录中定义为 tmp/deploy。 -| **DEPLOY_DIR_xxx**\ :根据使用的包管理器,包类型子文件夹。给定 RPM、IPK 或 DEB 打包和 tarball 创建,分别使用 - DEPLOY_DIR_RPM、DEPLOY_DIR_IPK、DEPLOY_DIR_DEB 或 DEPLOY_DIR_TAR 变量。 -| **PACKAGE_ARCH**\ :定义特定于体系结构的子文件夹。例如,可能存在i586或qemux86架构的包。 +软件包源是构建过程中的一个中间步骤,用来临时存储包的目录,由变量和正在使用的特定包管理器的组合确定。Yocto提供了生成不同包类型的类, +可以通过PACKAGE_CLASSES变量指定要启用的类以支持相应格式的软件包。在将软件包放入软件包源中之前,构建过程会通过生成的输出的质量保证(QA) +检查来验证软件包的正确性。 -Bitbake使用do_package_write_*任务生成包并将它们放入包保存区(例如,对于 IPK 包,do_package_write_ipk)。例如, -考虑使用IPK打包管理器并且同时存在对i586和emux86的包架构支持的场景。i586架构的包放在 build/tmp/deploy/ipk/i586, -而qemux86架构的包放在 build/tmp/deploy/ipk/qemux86。 +Bitbake使用do_package_write任务生成包并将它们放入包保存区(对于RPM包,do_package_write_rpm)。例如, +考虑使用RPM包管理器并且同时存在对i586和qemu_x86的包架构支持的场景。i586架构的包放在 :file:`build/tmp/deploy/rpm/i586` , +而qemu_x86架构的包放在 :file:`build/tmp/deploy/ipk/qemux86` 。 层模型 ^^^^^^^^^^^^^^^^^^^^^^ -层是包含相关元数据(即指令集)的存储库,这些元数据告诉OpenEmbedded构建系统如何构建目标。Yocto项目层模型促进了Yocto项目 -开发环境中的协作、共享、定制和重用。层在逻辑上分离你项目的信息。例如,你可以使用一个层来保存特定硬件的所有配置。隔离特定于 +层是包含相关元数据的集合,这些元数据告诉OpenEmbedded构建系统如何构建目标。Yocto层模型促进了Yocto +开发环境中的协作、共享、定制和重用。层在逻辑上分离了项目的信息。例如,你可以使用一个层来保存特定硬件的所有配置。隔离特定于 硬件的配置允许你通过使用不同的层共享其他元数据,其中元数据可能在多个硬件中是通用的。 -按照惯例,Yocto 项目中的层遵循特定的形式。符合已知结构允许Bitbake在构建期间对在哪里可以找到元数据类型做出假设。 +Yocto支持将元数据组织成多个层。层允许你将不同类型的自定义相互隔离。一个典型的Bitbake项目由不止一层组成。 +通常图层包含特定主题的配方。像基本系统,图形系统,...等等。 -层支持包含技术、硬件组件和软件组件。 Yocto Project Compatible 名称提供了最低水平的标准化,这有助于建立强大的生态系统。 -“Yocto Project Compatible”适用于适当的产品和软件组件,例如 BSP、其他 OE 兼容层和相关的开源项目,允许生产者使用 -Yocto Project徽章和品牌资产。有关层和OpenEmbedded层索引的介绍性信息可以在软件概述层部分中找到,或者可以在文档中找到一般 -信息。如果你在此处找不到所需的图层,请查看 OpenEmbedded 图层索引,该索引包含更多层,但内容没有得到普遍验证。 +在某些项目中,也可能有多个构建目标,每个目标都由不同的层组成。一个典型的例子是构建一个带有和不带有GUI组件的Linux发行版。 +可以使用、扩展、配置层,也可以部分覆盖现有层的部分。这很有用,因为它允许根据实际需要重用和定制。 -OpenEmbedded构建系统支持将元数据组织成多个层。层允许你将不同类型的自定义相互隔离。一个典型的Bitbake项目由不止一层组成。 -通常图层包含特定主题的食谱。像基本系统,图形系统,...等等。 +Yocto层必须按照特定格式组织, 以方便Bitbake在构建过程中找到相应的元数据。 -在某些项目中,也可能有多个构建目标,每个目标都由不同的层组成。一个典型的例子是构建一个带有和不带有 GUI 组件的 Linux 发行版。 -可以使用、扩展、配置层,也可以部分覆盖现有层的部分。这很有用,因为它允许根据实际需要重用和定制。 +Yocto Project Compatible名称提供了最低水平的标准化,这有助于建立强大的生态系统。 +“Yocto Project Compatible”适用于适当的产品和软件组件,例如BSP、其他OE兼容层和相关的开源项目,允许提供者使用 +Yocto Project徽章和品牌资产。有关层和OpenEmbedded层索引的介绍性信息可以在软件概述层部分中找到,或者可以在文档中找到一般 +信息。 + +- Yocto的层:https://www.yoctoproject.org/software-overview/layers +如果你在此处找不到所需的层,请查看OpenEmbedded层索引,该索引包含更多层,但其质量并不像Yocto层那样有保障。 -**Yocto项目的层** :https://www.yoctoproject.org/software-overview/layers/ -**OpenEmbedded的层** :http://layers.openembedded.org/layerindex/branch/master/layers/ +- OpenEmbedded的层:http://layers.openembedded.org/layerindex/branch/master/layers/ diff --git a/docs/source/yocto/priority.rst b/docs/source/yocto/priority.rst new file mode 100644 index 0000000000000000000000000000000000000000..baf705e85dfb8a82bf10bac2122b24716cbe32dd --- /dev/null +++ b/docs/source/yocto/priority.rst @@ -0,0 +1,51 @@ +.. _yocto_priority: + +Yocto 元数据优先级 +====================== + +本篇简要介绍 Yocto 元数据的优先级。 + +**总原则**:越往后解析的文件优先级越高。 + +一、常用底层配置文件解析顺序(从上往下): + + .. code-block:: console + + bblayers.conf: 层配置文件,说明用到了哪些层; + layer.conf: 各个层的配置文件, 说明怎么查找bb文件等; + bitbake.conf: yocto核心配置文件; + local.conf: 说明采用的bsp文件与distro文件; + openeuler_hosttools.inc: openeuler用于配置主机工具的文件; + ${MACHINE}.conf: bsp配置文件, 如qemu-aarch64.conf; + ${DISTRO}.conf: distro配置文件, openeuler.conf; + tcmode-external-openeuler.inc: 外部工具链配置。 + + 树莓派有些特殊,在 distro 文件之后又加了 machine 相关的配置文件。 + +二、常用类解析顺序(从上往下): + + .. code-block:: console + + base.bbclass: 默认fetch、unpack、configure、compile、install任务; + patch.bbclass: 默认patch任务; + staging.bbclass: prepare_recipe_sysroot任务,安装依赖包提供的文件到recipe-sysroot和recipe-sysroot-native中;populate_sysroot任务,缓存install任务安装文件的子集到sysroot中; + openeuler.bbclass: openeuler适配类; + external_global.bbclass: 外部工具链全局配置类。 + + 全局类在 conf 文件之后解析,上述的类均可看作全局继承的类;独立继承的类则在全局类之后解析,如 bb 文件中使用了 inherit autotools 语句; + 全局类一般通过 INHERIT 字节配置,也可以通过 USER_CLASSES、PACKAGE_CLASSES、INHERIT_DISTRO 等字节配置,后续的这些字节最终还是被附加到 INHERIT 字节,为符合规范,可查看这些字节的定义进行适配。 + +三、实际上,我们可以根据 require、include、inherit 的位置去判断先后顺序,因为这些指令都是立即执行的,会在调用时立即解析。 + + 举例说明: + + .. code-block:: console + + local.conf 文件: + require test.conf + x = "1" + + test.conf 文件: + x = "2" + + 解析 local.conf 时发现 require 字节,则停止当前文件的解析,转而解析 test.conf,此时 x = "2",test.conf 解析结束后继续解析 local.conf 剩下的内容,得到 x = "1",则最终 x 为 1;include 与 inherit 同理。 diff --git a/docs/source/yocto/quickbuild/container-build.rst b/docs/source/yocto/quickbuild/container-build.rst deleted file mode 100644 index 680fc459e59a45a3763f2bee06543bb91a8b0290..0000000000000000000000000000000000000000 --- a/docs/source/yocto/quickbuild/container-build.rst +++ /dev/null @@ -1,171 +0,0 @@ -.. _container_build: - -容器环境下的快速构建指导 -================================= - -由于openEuler Embedded构建过程需要基于openEuler操作系统,且需要安装较多系统工具和构建工具。 -为方便开发人员快速搭建构建环境,我们将构建过程所依赖的操作系统和工具封装到一个容器中, -这就使得开发人员可以快速搭建一个构建环境,进而投入到代码开发中去,避免在准备环境阶段消耗大量时间。 - -1. 环境准备 -************** - -需要使用docker创建容器环境,为了确保docker成功安装,需满足以下软件硬件要求 - -- 操作系统: 推荐使用Ubuntu、Debian和RHEL(Centos、Fedora等) - -- 内核: 推荐3.8及以上的内核 - -- 驱动: 内核必须支持一种合适的存储驱动,例如: Device Mapper、AUFS、vfs、btrfs、ZFS - -- 架构: 运行64位架构的计算机(x86_64和amd64) - -2. 安装docker -************************ - -1) 检查当前环境是否已安装docker工具 -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -运行如下命令,可以看到当前docker版本信息,则说明当前环境已安装docker,无需再次安装 - -.. code-block:: console - - docker version - -2) 如果没有安装,可参考官方链接安装 -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -官网地址: http://www.dockerinfo.net/document - -openEuler环境可参考Centos安装Docker - -例: openEuler环境docker安装命令如下 - -.. code-block:: console - - sudo yum install docker - -3. 获取容器镜像 -**************** - -通过docker pull命令拉取华为云中的镜像到宿主机。命令如下: -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: console - - docker pull swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container - -4. 准备容器构建环境 -********************* - -1) 启动容器 -^^^^^^^^^^^^^ - -可通过docker run命令启动容器,为了保证容器启动后可以在后台运行,且可以正常访问网络,建议使用如下命令启动: - -.. code-block:: console - - docker run -idt --network host swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container bash - -参数说明: - -- -i 让容器的标准输入保持打开 - -- -d 让 Docker 容器在后台以守护态(Daemonized)形式运行 - -- -t 选项让Docker分配一个伪终端(pseudo-tty)并绑定到容器的标准输入上 - -- --network 将容器连接到(host)网络 - -- swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container 指定镜像名称 - -- bash 进入容器的方式 - -2) 查看已启动的容器id -^^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: console - - docker ps - -3) 进入容器 -^^^^^^^^^^^^ - -.. code-block:: console - - docker exec -it 容器id bash - -构建环境已准备完成,下面就可以在容器中进行构建了 - -5. 开始构建 -************ - -1) 下载源码 -^^^^^^^^^^^^ - -- 获取源码下载脚本 - -.. code-block:: console - - git clone https://gitee.com/openeuler/yocto-meta-openeuler.git -b openEuler-22.03-LTS -v /usr1/openeuler/src/yocto-meta-openeuler - -- 通过脚本下载源码 - -.. code-block:: console - - cd /usr1/openeuler/src/yocto-meta-openeuler/scripts - sh download_code.sh /usr1/openeuler/src - -2) 编译构建 -^^^^^^^^^^^^^ - -- 编译架构: aarch64-std、aarch64-pro、arm-std、raspberrypi4-64 - -- 构建目录: /usr1/build - -- 源码目录: /usr1/openeuler/src - -- 编译器所在路径: /usr1/openeuler/gcc/openeuler_gcc_arm64le - -说明: 不同的编译架构使用不同的编译器,aarch64-std、aarch64-pro、raspberrypi4-64使用openeuler_gcc_arm64le编译器, -arm-std使用openeuler_gcc_arm32le编译器,下面以以aarch64-std目标架构编译为例 - -a) 将/usr1目录所属群组改为openeuler,否则切换至openeuler用户构建会存在权限问题 - -.. code-block:: console - - chown -R openeuler:users /usr1 - -b) 切换至openeuler用户 - -.. code-block:: console - - su openeuler - -c) 进入构建脚本所在路径,运行编译脚本 - -.. code-block:: console - - cd /usr1/openeuler/src/yocto-meta-openeuler/scripts - source compile.sh aarch64-std /usr1/build /usr1/openeuler/gcc/openeuler_gcc_arm64le - bitbake openeuler-image - -3) 构建结果说明 -^^^^^^^^^^^^^^^^^ - -结果件默认生成在构建目录下的output目录下,例如上面aarch64-std的构建结果件生成在/usr1/build/output - -+---------------------------------------------+-------------------------------------------------------------+ -| filename | description | -+=============================================+=============================================================+ -| Image-5.10.0 | openEuler Embedded image | -+---------------------------------------------+-------------------------------------------------------------+ -| openeuler-glibc-x86_64-openeuler-image | openEuler Embedded sdk toolchain | -| -aarch64-qemu-aarch64-toolchain-21.09.30.sh | | -+---------------------------------------------+-------------------------------------------------------------+ -| openeuler-image-qemu-aarch64- | openEuler Embedded file system | -| 20220318114250.rootfs.cpio.gz | | -+---------------------------------------------+-------------------------------------------------------------+ -| zImage | openEuler Embedded compressed image | -+---------------------------------------------+-------------------------------------------------------------+ - diff --git a/docs/source/yocto/quickbuild/index.rst b/docs/source/yocto/quickbuild/index.rst deleted file mode 100644 index 61a190a866679d48d295f5be1554d03658e7a91a..0000000000000000000000000000000000000000 --- a/docs/source/yocto/quickbuild/index.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. _quickbuild: - -快速构建 -============================ - -本章主要提供了两种方式准备构建环境,并描述了详细的构建流程,具体内容如下: - -.. toctree:: - :maxdepth: 1 - - quickstart.rst - container-build.rst diff --git a/docs/source/yocto/quickbuild/quickstart.rst b/docs/source/yocto/quickbuild/quickstart.rst deleted file mode 100644 index 6241c515abc4e326fe473d2064747b0f1efe277b..0000000000000000000000000000000000000000 --- a/docs/source/yocto/quickbuild/quickstart.rst +++ /dev/null @@ -1,112 +0,0 @@ -.. _yocto_quick_build: - -原生环境下的快速构建指导 -=========================================== - -构建环境的准备 -********************************************* - -yocto中主机端命令使用 -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Yocto或者说Bitbake本质上是一组python程序,其最小运行环境要求如下: - | - Python3 > 3.6.0 - | - Git > 1.8.3.1 - | - Tar > 1.28 - -在构建过程中所需要的其他工具,Yocto都可以根据相应的软件包配方自行构建出来,从而达到自包含的效果。在这个过程中,Yocto还会依据自身需要,对相应的工具打上yocto专属补丁(如dnf, rpm等)。这些主机工具会在第一次的构建中从源码开始构建,因此Yocto第一次构建比较费时。 - -为了加速构建特别是第一次构建,openEuler Embedded采取了“能用原生工具就用原生工具,能不构建就不构建”的策略,尽可能使用主机上预编译的原生的工具。 -这就需要依赖主机上软件包管理工具(apt, dnf, yum, zypper等)实现安装好。 - -Yocto是通过HOSTTOOLS变量来实现主机工具的引入,为会每个在HOSTTOOLS中列出的工具建立相应的软链接。为了避免来自主机对构建环境的污染,Yocto会重新准备不同于主机的环境,例如PATH变量等,因此如果新增依赖主机上的某个命令,需显示在Yocto的HOSTTOOLS变量中增加,否则即使主机上存在,Yocto构建时也会报错找不到相应的工具。相应流程如下图所示: - -.. image:: ../../../image/yocto/hosttools.png - -当前openEuler Embedded所需要主机工具已经默认在local.conf.sample中的HOSTTOOLS定义,主要工具描述如下: - -========= ============= -工具名 用途 -========= ============= -cmake cmake构建工具 -ninjia ninja构建系统 -========= ============= - - -openEuler Embedded所需构建工具 -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -1)构建os - - `操作系统:openEuler-20.03-LTS-SP2 `_ - -2)安装系统额外工具 - - yum -y install tar cmake gperf sqlite-devel chrpath gcc-c++ patch rpm-build flex autoconf automake m4 bison bc libtool gettext-devel createrepo_c rpcgen texinfo hostname python meson dosfstools mtools parted ninja-build autoconf-archive libmpc-devel gmp-devel - -3)预编译的交叉工具链和库 - | Yocto可以构建出交叉编译所需的交叉工具链和C库,但整个流程复杂且耗时,不亚于内核乃至镜像的构建,而且除了第一次构建,后面很少会再涉及。同时,绝大部分开发者都不会直接与工具链和C库构建打交道。所以为了简化该流程,openEuler Embedded采取的策略是采用预编译的交叉工具链和库,会专门维护和发布相应的带有C库的工具链。 - | 目前我们提供了对arm32位和aarch64位两种架构的工具链支持, 通过如下方式可以获得: - - - 下载rpm包: ``wget https://repo.openeuler.org/openEuler-22.03-LTS/EPOL/main/x86_64/Packages/gcc-cross-1.0-0.oe2203.x86_64.rpm`` - - 解压rpm包: ``rpm2cpio gcc-cross-1.0-0.oe2203.x86_64.rpm | cpio -id`` - - - 解压后可以看到当前路径下会有tmp目录,编译链存放于该目录下 - - - ARM 32位工具链: openeuler_gcc_arm32le.tar.xz - - ARM 64位工具链: openeuler_gcc_arm64le.tar.xz - -已安装好工具的构建容器 -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -openEuler Embedded的构建过程中会使用到大量的各式各样的主机工具。如前文所述,为了加速构建,openEuler Embedded依赖主机事先安装好相应的工具,但这也会带来一不同主机环境会有不同的工具版本的问题,例如构建需要cmake高于1.9版本,但主机上最高只有cmake 1.8。为了解决这一问题,openEuler Embedded提供了专门的构建容器,提供统一的构建环境。 - -使用者可以通过如下链接获得容器镜像直接用于编译: - - - `openEuler Embedded构建容器的基础镜像 `_ - - -构建代码下载与准备 -********************************************* - -openEuler Embedded整个构建工程的文件布局如下,假设openeuler_embedded为顶层目录: - -:: - - <顶层目录openeuler_embedded> - ├── src 源代码目录,包含所有软件包代码、内核代码和Yocto构建代码 - ├── build openEuler Embedded的构建目录,生成的各种镜像放在此目录下 - -1)下载脚本所在仓库(例如下载到src/yocto-meta-openeuler目录下) - | ``git clone https://gitee.com/openeuler/yocto-meta-openeuler.git -b openEuler-22.03-LTS -v src/yocto-meta-openeuler`` - | 脚本为src/yocto-meta-openeuler/scripts/download_code.sh - | 此脚本有3个参数: - | 参数1:下载的源码路径,默认相对脚本位置下载,例如前面样例,代码仓会下到src/下 - | 参数2:下载的分支,默认值见脚本,不同分支按版本确定 - | 参数3:下代码的xml文件,标准manifest格式,按xml配置下代码 - -2)执行下载脚本 - | 下载最新代码: ``sh src/yocto-meta-openeuler/scripts/download_code.sh`` - | 下载指定版本代码: ``sh src/yocto-meta-openeuler/scripts/download_code.sh "" "" "manifest.xml"`` - - - 指定openEuler Embedded版本的代码的manifest.xml文件从openEuler Embedded发布件目录embedded_img/source-list/下获取 - - -openEuler Embedded版本构建 -***************************** - -一键式构建脚本::file:`src/yocto-meta-openeuler/scripts/compile.sh` , 具体细节可以参考该脚本 - -编译脚本的主要流程: - -1. 设置PATH增加额外工具路径 -#. TEMPLATECONF指定local.conf.sample等配置文件路径 -#. 调用poky仓的oe-init-build-env进行初始化配置 -#. 在编译目录的conf/local.conf中配置MACHINE,按需增加额外新增的层 -#. 在编译目录执行bitbake openeuler-image编译openEuler Embedded的image和sdk -#. 执行完发布件在编译目录的output目录下 - -以编译标准arm架构为例,编译方法如下: - -:: - - source src/yocto-meta-openeuler/scripts/compile.sh arm-std - bitbake openeuler-image #执行第一条source后,会提示出bitbake命令 \ No newline at end of file diff --git a/docs/source/yocto/sstate.rst b/docs/source/yocto/sstate.rst new file mode 100644 index 0000000000000000000000000000000000000000..6248e001e93b378963f73fbcb24c240f45d73127 --- /dev/null +++ b/docs/source/yocto/sstate.rst @@ -0,0 +1,207 @@ +.. _yocto_sstate: + +share state 机制 +==================== + +简要介绍share state(简写为sstate)原理与使用。 + +sstate 原理 +################### + +yocto默认继承了sstate类,sstate机制将SSTATETASKS定义的任务指定的文件目录生成压缩包(缓存)以供后续复用。构建时存在sstate缓存且任务校验和没有发生改变,则会执行对应的task_setscene任务解压压缩包得到输出文件;如果相关任务校验和改变了,则需要重新获取源码进行编译。 + +校验和:每一个执行的任务都会存在一个校验和用于判断是否需要重新构建。基础hash(直接输入到任务的内容信息)与依赖任务的hash生成总的校验和,根据该值变化决定是否复用缓存。可以通过查看SSTATE_DIR目录下的siginfo文件名来查看校验和。 + +相关字节: + +.. code-block:: + + SSTATE_DIR:指向共享缓存所在目录,默认为"${TOPDIR}/sstate-cache"; + SSTATE_MIRRORS:共享缓存镜像机制,可以从镜像指定位置实时获取缓存; + BB_HASHEXCLUDE_COMMON:一些不被计算到hash值的公共变量,参与组成其他字节; + BB_HASHBASE_WHITELIST:列出从校验和和相关性数据中排除的变量;由BB_HASHEXCLUDE_COMMON和其他值组成; + BB_HASHCONFIG_WHITELIST:列出从基本配置校验和中排除的变量;由BB_HASHEXCLUDE_COMMON和其他值组成; + BB_SIGNATURE_EXCLUDE_FLAGS:一些不被计算到hash值的公共变量标志,如果是任务标志,则 prefuncs、postfuncs、exports 等会对hash值有影响;具体要分析底层python脚本。 + vardepsexclude与vardeps标志:使字节或任务计算校验和时不依赖或依赖对应变量。 + +BB_HASHEXCLUDE_COMMON是BB_HASHBASE_WHITELIST和BB_HASHCONFIG_WHITELIST的公共组成部分,因此可以修改BB_HASHEXCLUDE_COMMON对两者同时产生影响。 + + + +sstate 缓存复用机制 +########################### + +缓存指sstate-cache目录下的*.tgz文件,构建时存在对应的tgz文件且校验和不变时则执行对应的task_setsecne任务;sstate-cache目录下还存在*.siginfo文件,目前测试来看该文件只是提供了一种检测校验和的手段,即使不存在也不会使缓存不能使用;每个执行任务都存在一个siginfo文件。 + +.. note:: + + do_build任务不存在siginfo文件。 + +构建linux-openeuler(arm-std),总共执行了59个任务。通过查看日志信息,只执行了54个任务;查看SSTATE_DIR目录,存在54份siginfo文件;其余5个任务应该是每个依赖包的do_build任务,不存在相应的siginfo文件。 + +.. code-block:: + + $ bitbake linux-openeuler -g //生成linux-openeuler依赖信息 + $ cat pn-buildlist //查看依赖的包 + +以下是linux-openeuler(arm-std)及其所有依赖包的任务数与siginfo文件数: + +.. code-block:: + + linux-openeuler:22任务与siginfo文件; + pseudo-native:9任务与siginfo文件; + binutils:7任务与siginfo文件; + gcc-cross-arm:7任务与siginfo文件; + depmodwrapper:9任务与siginfo文件; + +任务数与siginfo文件数一致且对应,符合每个执行任务都有一份对应的siginfo文件提供校验信息。 + + + +开发者自定义 sstate 任务方式 +################################## + +举例说明如何定义sstate任务。 + +.. code-block:: + + SSTATETASKS += "do_test_sstate" //声明为sstate任务 + do_test_sstate () { + // 开发者可自定义此测试任务 + touch a.txt + ln -s ./a.txt ./b.txt + echo ${D}${includedir} >> b.txt + } + + do_test_sstate[dirs] = "${WORKDIR}/test_in" //工作目录 + do_test_sstate[sstate-inputdirs] = "${WORKDIR}/test_in" //缓存输入目录 + do_test_sstate[sstate-outputdirs] = "${WORKDIR}/test_out" //拷贝缓存输入内容到此目录 + # do_test_sstate[sstate-plaindirs] = "${WORKDIR}/test_in" //上述两目录相同时定义方式 + + addtask do_test_sstate after do_fetch before do_patch //声明任务执行顺序 + + python do_test_sstate_setscene () { + sstate_setscene(d) //复用缓存 + } + addtask do_test_sstate_setscene //定义缓存复用任务,以task + _setscene命名 + +开发者可在poky查看更多sstate任务例子。 + + + +sstate 使用方法 +############################## + +此处推荐3种使用方法,如下: + +1、拷贝上一次构建成功的sstate-cache目录到当前构建目录下; + +.. code-block:: + + $ cp -r buildA/sstate-cache buildB/sstate-cache //buildA为已成功构建的目录,buildB为刚刚完成初始化的构建目录 + $ cd buildB + $ bitbake package_name //构建所需包 + +利用sstate_mirrors机制,可以做到根据需求获取缓存,首先把已成功构建的缓存放在公共服务器上。 + +2、开发者使用网络在线获取缓存;会受到网络因素影响,可能会出现随机性的错误,当前暂不使用;需在local.conf脚本添加如下内容: + +.. code-block:: + + # 服务器链接地址 + SSTATE_MIRRORS ?= "file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH" + +3、开发者下载缓存到本地路径;缺点是当开发者只需要某一部分缓存时也会把全部的缓存下载下来,造成资源浪费;需在local.conf脚本添加如下内容: + +.. code-block:: + + # 本地绝对路径 + SSTATE_MIRRORS ?= "file://.* file:///some/local/dir/sstate/PATH" + +| 方案1与方案3的差异是什么? +| **a:** 方案1的做法是拷贝缓存到当前构建目录,当再次构建时会对该缓存产生影响;方案3的做法不会对下载缓存产生影响,只是在构建时会去检查下载缓存目录是否存在所需的缓存,如果存在则拷贝到当前构建缓存目录,不存在则重新构建。 + + + +sstate 使用效果 +######################## + +这里举几个简单例子说明缓存的效果,开发者可自行测试。 + +例1:使用 -c clean 将任务的输出文件删除,但不删除缓存;再重新构建,这个过程会特别迅速,这就是因为存在缓存。 + +.. code-block:: + + $ bitbake pseudo-native //构建pseudo-native成功 + $ bitbake pseudo-native -c clean + $ bitbake pseudo-native + +例2:使用 -c cleansstate 会在 clean 的基础上把缓存也删掉。 + +.. code-block:: + + $ bitbake pseudo-native //构建pseudo-native成功 + $ bitbake pseudo-native -c cleansstate + $ bitbake pseudo-native + +例3: 使用 --no-setscene 选项不使用缓存构建。 + +.. code-block:: + + $ bitbake pseudo-native //构建pseudo-native成功 + $ bitbake pseudo-native -c clean + $ bitbake pseudo-native --no-setscene //不使用缓存构建 + + + +sstate应用过程中解决的疑难问题 +################################# + +在初步复用sstate的过程中,总是频繁触发重新构建,最初定位是工具链缓存复用的问题,通过使用bitbake-diffsigs工具具体定位到是工具链gcc-runtime-external包构建时的do_install任务在postfuncs标志下的do_install_appended任务的校验和会随着构建目录改变而改变。 +根因是gcc-runtime-external的一个匿名函数使用replace函数修改了do_install_appended的内容导致校验和会随构建目录改变而改变,当前只能让do_install任务的校验和不受do_install_appended影响以复用缓存。 + + + +开发者可能关心的问题 +################################# + +| 1、构建目录改变是否会重新构建?yocto仓源码目录改变是否会重新构建?工具链目录改变是否会重新构建? +| **a:** 前两种情况下校验和不会改变,因此不会触发重新构建;工具链目录改变会触发重新构建,工具链sysroot的文件一般是一些wrapper脚本,指向工具链目录下的文件,因此当工具链目录改变了需要重新生成wrapper脚本。 + +| 2、缓存是否能在不同类型的构建主机复用?如openeuler主机构建时生成的缓存能否在ubuntu主机复用? +| **a:** 暂不支持复用;poky使用了uninative机制让生成的缓存与构建环境无关,构建时首先会下载uninative包到本地,从而做到native包构建与构建机器无关。 + +| 3、单任务执行是否会重新构建? +| **a:** 分情况, + +.. code-block:: + + bitbake zlib -c configure + bitbake zlib -c populate_sysroot + +这两个任务的差异是populate_sysroot为sstate任务,存在缓存,而configure任务非sstate任务,只存在siginfo文件;因此populate_sysroot任务不会重新构建,而configure会重新构建。 + +| 4、只存在指定软件包的缓存是否可用? +| **a:** 不可用,经验证发现会重新执行部分流程,包括compile任务;以下是只存在libpcre2的缓存情况下的任务执行顺序: + +.. code-block:: + + $ bitbake libpcre2 + $ cd WORKDIR_of_libpcre2/temp //日志所在目录 + $ cat log.task_order + do_package_qa_setscene (3924912): log.do_package_qa_setscene.3924912 + do_populate_lic_setscene (3924914): log.do_populate_lic_setscene.3924914 + do_package_write_rpm_setscene (3924913): log.do_package_write_rpm_setscene.3924913 + do_populate_sysroot_setscene (3924915): log.do_populate_sysroot_setscene.3924915 + do_packagedata_setscene (3925129): log.do_packagedata_setscene.3925129 + do_deploy_source_date_epoch_setscene (3925173): log.do_deploy_source_date_epoch_setscene.3925173 + do_fetch (3925748): log.do_fetch.3925748 + do_unpack (3926514): log.do_unpack.3926514 + do_patch (3927219): log.do_patch.3927219 + do_prepare_recipe_sysroot (3970565): log.do_prepare_recipe_sysroot.3970565 + do_configure (3970676): log.do_configure.3970676 + do_compile (3979602): log.do_compile.3979602 + do_install (3989915): log.do_install.3989915 + do_package (3990522): log.do_package.3990522 + +结论是某些任务使用了缓存,但是package任务没有使用缓存,导致重新编译;经过一些测试发现需要依赖任务的populate_sysroot任务执行结束,再执行构建才不会重新构建。 diff --git a/meta-clang/CODE_OF_CONDUCT.md b/meta-clang/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000000000000000000000000000000..bcec6e111aaa698a386568597deb6153a542d9ff --- /dev/null +++ b/meta-clang/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at raj.khem@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/meta-clang/CONTRIBUTING.md b/meta-clang/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..11d84dea4f7a63a76460960ba889c158cfdfb40d --- /dev/null +++ b/meta-clang/CONTRIBUTING.md @@ -0,0 +1,7 @@ + +# Contributing + +You are encouraged to follow Github Pull request workflow +to share changes and following commit message guidelines are recommended [OE patch guidelines](https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines) + +Layer Maintainer: [Khem Raj]() diff --git a/meta-clang/COPYING.MIT b/meta-clang/COPYING.MIT new file mode 100644 index 0000000000000000000000000000000000000000..fb950dc69feb8afa93493747f33d6e1c02659b55 --- /dev/null +++ b/meta-clang/COPYING.MIT @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/meta-clang/README.md b/meta-clang/README.md new file mode 100644 index 0000000000000000000000000000000000000000..619b2f3a31ee9d11ae5aad18beb9d6f445ea0496 --- /dev/null +++ b/meta-clang/README.md @@ -0,0 +1,224 @@ +[![Yoe Distro CI](https://github.com/kraj/meta-clang/workflows/Yoe%20Distro%20CI/badge.svg?branch=master)](https://github.com/kraj/meta-clang/actions/workflows/yoe.yml?query=workflow%3AYoe+branch%3Amaster) + +# meta-clang (C/C++ frontend and LLVM compiler backend) + +This layer provides [clang/llvm](http://clang.llvm.org/) as alternative to system +C/C++ compiler for OpenEmbedded/Yocto Project based distributions. This can cohabit +with GNU compiler and can be used for specific recipes or full system compiler. + +# Getting Started + +```shell +git clone git://github.com/openembedded/openembedded-core.git +cd openembedded-core +git clone git://github.com/openembedded/bitbake.git +git clone git://github.com/kraj/meta-clang.git + +$ . ./oe-init-build-env +``` +If using poky ( Yocto project reference Distribution ) + +```shell +git clone https://git.yoctoproject.org/git/poky +cd poky +git clone git://github.com/kraj/meta-clang.git + +$ . ./oe-init-build-env +``` + +Add meta-clang overlay +``` +bitbake-layers add-layer ../meta-clang +``` + +Check `conf/bblayers.conf` to see that meta-clang is added to layer mix e.g. + +# Default Compiler + +Note that by default gcc will remain the system compiler, however if you wish +clang to be the default compiler then set + +```shell +TOOLCHAIN ?= "clang" +``` + +in `local.conf`, this would now switch default cross-compiler to be clang +you can select clang per recipe too by writing bbappends for them containing + +```shell +TOOLCHAIN = "clang" +``` +also look at `conf/nonclangable.conf` for list of recipes which do not yet fully +build with clang. + +# Default Compiler Runtime + +Default is to use GNU runtime `RUNTIME = "gnu"` which consists of libgcc, libstdc++ to provide C/C++ +runtime support. However it's possible to use LLVM runtime to replace it where +compile-rt, llvm libunwind, and libc++ are used to provide C/C++ runtime, while +GNU runtime works with both GCC and Clang, LLVM runtime is only tested with Clang +compiler, switching to use LLVM runtime is done via a config metadata knob + +```shell +RUNTIME = "llvm" +``` + +RUNTIME variable influences individual runtime elements and can be set explicitly as well +e.g. `LIBCPLUSPLUS` `COMPILER_RT` and `UNWINDLIB`. + +Please note that this will still use crt files from GNU compiler always, while llvm now +do provide crt files, they have not been yet integrated into the toolchain. + +# Default C++ Standard Library Switch + +Using RUNTIME variable will select which C++ runtime is used, however it can be overridden +if needed to by modifying `LIBCPLUSPLUS` variable, usually defaults used by `RUNTIME` are +best fit. e.g. below we select LLVM C++ as default C++ runtime. + +```shell +LIBCPLUSPLUS = "-stdlib=libc++" +``` + +in `local.conf`. +You can select libstdc++ per package too by writing bbappends for them containing + +```shell +LIBCPLUSPLUS:toolchain-clang:pn- = "-stdlibc=libc++" +``` +Defaults are chosen to be GNU for maximum compatibility with existing GNU systems. It's always +good to use single runtime on a system, mixing runtimes can cause complications during +compilation as well as runtime. However, it's up to distribution policies to decide which runtime +to use. + +# Adding clang in generated SDK toolchain + +Clang based cross compiler is not included into the generated SDK using `bitbake meta-toolchain` or +`bitbake -cpopulate_sdk ` if clang is expected to be part of SDK, add `CLANGSDK = "1"` +in `local.conf` + +```shell +CLANGSDK = "1" +``` + +# Kernel build with clang +Newer kernels and Android kernels support clang compilation, and even support LTO, The following takes [rockchip](https://github.com/JeffyCN/meta-rockchip)'s kernel as an example to configure clang compilation. x86, arm and arm64 kernel supported full LLVM toolchain, other arch only support clang. more info https://docs.kernel.org/kbuild/llvm.html + +- linux-rockchip_%bbappend +```shell +TOOLCHAIN:forcevariable = "clang" + +DEPENDS:append:toolchain-clang = " clang-cross-${TARGET_ARCH}" +KERNEL_CC:toolchain-clang = "${CCACHE}clang ${HOST_CC_KERNEL_ARCH} -fuse-ld=lld ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH}" +KERNEL_LD:toolchain-clang = "${CCACHE}ld.lld" +KERNEL_AR:toolchain-clang = "${CCACHE}llvm-ar" +``` +if you want use LLVM integrated assembler for some older kernel, newer vesion is enabled default. +```shell +do_compile:prepend:toolchain-clang() { + export LLVM_IAS=1 +} + +do_compile_kernelmodules:prepend:toolchain-clang() { + export LLVM_IAS=1 +} +``` +if you want enable LTO, append follow content. +``` +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI:append:toolchain-clang = "\ + file://lto.cfg \ +" +``` + +`CONFIG_LTO_CLANG`is need for some android based kernel, mainline kernel will do auto detect. + +- lto.cfg +``` +CONFIG_LTO_CLANG=y +CONFIG_LTO=y +CONFIG_LTO_CLANG_THIN=y +``` + + +# Building + +Below we build for qemuarm machine as an example + +```shell +$ MACHINE=qemuarm bitbake core-image-full-cmdline +``` +# Running + +```shell +$ runqemu nographic +``` + +# Limitations + +Few components do not build with clang, if you have a component to add to that list +simply add it to `conf/nonclangable.inc` e.g. + +```shell +TOOLCHAIN:pn- = "gcc" +``` + +and OE will start using gcc to cross compile that recipe. + +If a component does not build with libc++, you can add it to `conf/nonclangable.inc` e.g. + +```shell +CXX:remove:pn-:toolchain-clang = " -stdlib=libc++ " +``` + +# compiler-rt failing in do_configure with custom TARGET_VENDOR + +If your DISTRO sets own value of TARGET_VENDOR, then it's need to be added in +CLANG_EXTRA_OE_VENDORS, it should be done automatically, but if compiler-rt fails +like bellow, then check the end of work-shared/llvm-project-source-12.0.0-r0/temp/log.do_patch +is should have line like: +NOTE: Adding support following TARGET_VENDOR values: foo in + /OE/build/oe-core/tmp-glibc/work-shared/llvm-project-source-12.0.0-r0/git/llvm/lib/Support/Triple.cpp and + /OE/build/oe-core/tmp-glibc/work-shared/llvm-project-source-12.0.0-r0/git/clang/lib/Driver/ToolChains/Gnu.cpp +and check these files if //CLANG_EXTRA_OE_VENDORS* strings were replaced correctly. +Read add_more_target_vendors function in recipes-devtools/clang/llvm-project-source.inc for more details. + +http://errors.yoctoproject.org/Errors/Details/574365/ +```shell +-- Found assembler: TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-foo-linux/x86_64-foo-linux-clang +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - failed +-- Check for working C compiler: TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-foo-linux/x86_64-foo-linux-clang +-- Check for working C compiler: TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-foo-linux/x86_64-foo-linux-clang - broken +CMake Error at TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/recipe-sysroot-native/usr/share/cmake-3.19/Modules/CMakeTestCCompiler.cmake:66 (message): + The C compiler + + "TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/recipe-sysroot-native/usr/bin/x86_64-foo-linux/x86_64-foo-linux-clang" + + is not able to compile a simple test program. + + It fails with the following output: + + Change Dir: TOPDIR/tmp-glibc/work/core2-64-foo-linux/compiler-rt/12.0.0-r0/build/CMakeFiles/CMakeTmp + + Run Build Command(s):ninja cmTC_928f4 && [1/2] Building C object CMakeFiles/cmTC_928f4.dir/testCCompiler.c.o + [2/2] Linking C executable cmTC_928f4 +``` + +# Dependencies + +```shell +URI: git://github.com/openembedded/openembedded-core.git +branch: master +revision: HEAD + +URI: git://github.com/openembedded/bitbake.git +branch: master +revision: HEAD +``` + +# Contributing + +You are encouraged to follow Github Pull request workflow +to share changes and following commit message guidelines are recommended: [OE patch guidelines](https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines). + +Layer Maintainer: [Khem Raj]() diff --git a/meta-clang/classes/clang-native.bbclass b/meta-clang/classes/clang-native.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..51fafcde278a8e78c4e899676667c3c30682eb51 --- /dev/null +++ b/meta-clang/classes/clang-native.bbclass @@ -0,0 +1,23 @@ +# inherit this class if you would like to use clang to compile the native +# version of your recipes instead of system compiler ( which is normally gcc ) +# on build machines +# to use it add +# +# inherit clang-native +# +# to the concerned recipe via a bbappend or directly to recipe file +# +DEPENDS:append:runtime-llvm = " clang-native compiler-rt-native libcxx-native" +# Use libcxx headers for native parts +CXXFLAGS:append:runtime-llvm = " -stdlib=libc++" +BUILD_CXXFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++" +# Use libgcc for native parts +LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc" +BUILD_LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc" +BUILD_CC:runtime-llvm = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE}" +BUILD_CXX:runtime-llvm = "${CCACHE}clang++ -isysroot=${STAGING_DIR_NATIVE}" +BUILD_CPP:runtime-llvm = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE} -E" +BUILD_CCLD:runtime-llvm = "${CCACHE}clang" +BUILD_RANLIB:runtime-llvm = "llvm-ranlib" +BUILD_AR:runtime-llvm = "llvm-ar" +BUILD_NM:runtime-llvm = "llvm-nm" diff --git a/meta-clang/classes/clang.bbclass b/meta-clang/classes/clang.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..09cc363571be99b6d9fab2ed430d3d9eb1676e3e --- /dev/null +++ b/meta-clang/classes/clang.bbclass @@ -0,0 +1,153 @@ +# Add the necessary override +CCACHE_COMPILERCHECK:toolchain-clang ?= "%compiler% -v" +# HOST_CC_ARCH:prepend:toolchain-clang = "-target ${HOST_SYS} " +# --no-sysroot-suffix not support. +HOST_CC_ARCH:remove:toolchain-clang = " --no-sysroot-suffix " +CC:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" +CXX:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" +CPP:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} -E" +CCLD:toolchain-clang = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" +# we do not use llvm- prefix for binutils in wrapper. +RANLIB:toolchain-clang = "${HOST_PREFIX}ranlib" +AR:toolchain-clang = "${HOST_PREFIX}ar" +NM:toolchain-clang = "${HOST_PREFIX}nm" +OBJDUMP:toolchain-clang = "${HOST_PREFIX}objdump" +OBJCOPY:toolchain-clang = "${HOST_PREFIX}objcopy" +#STRIP:toolchain-clang = "${HOST_PREFIX}llvm-strip" +STRINGS:toolchain-clang = "${HOST_PREFIX}strings" +READELF:toolchain-clang = "${HOST_PREFIX}readelf" + +LTO:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'thin-lto', '-flto=thin', '-flto -fuse-ld=lld', d)}" + +COMPILER_RT ??= "" +COMPILER_RT:class-native = "-rtlib=libgcc ${UNWINDLIB}" +COMPILER_RT:armeb = "-rtlib=libgcc ${UNWINDLIB}" +COMPILER_RT:libc-klibc = "-rtlib=libgcc ${UNWINDLIB}" +# not use compiler-rt now, will be enable in the future. +COMPILER_RT:remove:runtime-gnu = "-rtlib=compiler-rt" + +UNWINDLIB ??= "" +UNWINDLIB:class-native = "--unwindlib=libgcc" +UNWINDLIB:armeb = "--unwindlib=libgcc" +UNWINDLIB_libc-klibc = "--unwindlib=libgcc" + +LIBCPLUSPLUS ??= "" +LIBCPLUSPLUS:armv5 = "-stdlib=libstdc++" + +CXXFLAGS:append:toolchain-clang = " ${LIBCPLUSPLUS}" +LDFLAGS:append:toolchain-clang = " ${COMPILER_RT} ${LIBCPLUSPLUS}" + +TUNE_CCARGS:remove:toolchain-clang = "-meb" +TUNE_CCARGS:remove:toolchain-clang = "-mel" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}" + +# Clang does not yet support big.LITTLE performance tunes, so use the LITTLE for tunes +TUNE_CCARGS:remove:toolchain-clang = "-mcpu=cortex-a57.cortex-a53 -mcpu=cortex-a72.cortex-a53 -mcpu=cortex-a15.cortex-a7 -mcpu=cortex-a17.cortex-a7 -mcpu=cortex-a72.cortex-a35 -mcpu=cortex-a73.cortex-a53 -mcpu=cortex-a75.cortex-a55 -mcpu=cortex-a76.cortex-a55" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa53 cortexa57-cortexa53 cortexa73-cortexa53", " -mcpu=cortex-a53", "", d)}" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa15-cortexa7 cortexa17-cortexa7", " -mcpu=cortex-a7", "", d)}" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa72-cortexa35", " -mcpu=cortex-a35", "", d)}" +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains_any("TUNE_FEATURES", "cortexa75-cortexa55 cortexa76-cortexa55", " -mcpu=cortex-a55", "", d)}" + +# Clang does not support octeontx2 processor +TUNE_CCARGS:remove:toolchain-clang = "-mcpu=octeontx2" + +# Reconcile some ppc anamolies +TUNE_CCARGS:remove:toolchain-clang:powerpc = "-mhard-float -mno-spe" +TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64 = " -mlong-double-64" +TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc64le = " -mlong-double-64" +TUNE_CCARGS:append:toolchain-clang:libc-musl:powerpc = " -mlong-double-64" +# usrmerge workaround +TUNE_CCARGS:append:toolchain-clang = "${@bb.utils.contains("DISTRO_FEATURES", "usrmerge", " --dyld-prefix=/usr", "", d)}" + +#TUNE_CCARGS:append:toolchain-clang = " -Qunused-arguments" + +LDFLAGS:append:toolchain-clang:class-nativesdk:x86-64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-x86-64.so.2" +LDFLAGS:append:toolchain-clang:class-nativesdk:x86 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux.so.2" +LDFLAGS:append:toolchain-clang:class-nativesdk:aarch64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-aarch64.so.1" +LDFLAGS:append:toolchain-clang:class-target:aarch64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-aarch64.so.1" + +LDFLAGS:toolchain-clang:class-nativesdk = "${BUILDSDK_LDFLAGS} \ + -Wl,-rpath-link,${STAGING_LIBDIR}/.. \ + -Wl,-rpath,${libdir}/.. " + +# Enable lld globally" +LDFLAGS:append:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -fuse-ld=lld', '', d)}" + +# choose between 'gcc' 'clang' an empty '' can be used as well +# enable clang default +TOOLCHAIN = "clang" +# choose between 'gnu' 'llvm' +RUNTIME ??= "gnu" +# Using gcc or llvm runtime is only available when using clang for compiler +#RUNTIME:toolchain-gcc = "gnu" +RUNTIME:armeb = "gnu" +RUNTIME:armv5 = "gnu" + +TOOLCHAIN:class-native = "clang" +TOOLCHAIN:class-nativesdk = "gcc" +TOOLCHAIN:class-cross-canadian = "gcc" +TOOLCHAIN:class-crosssdk = "gcc" +TOOLCHAIN:class-cross = "clang" + +OVERRIDES =. "${@['', 'toolchain-${TOOLCHAIN}:']['${TOOLCHAIN}' != '']}" +OVERRIDES =. "${@['', 'runtime-${RUNTIME}:']['${RUNTIME}' != '']}" +OVERRIDES[vardepsexclude] += "TOOLCHAIN RUNTIME" + + +YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target = "${STAGING_BINDIR}/llvm-config" +YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target = "/${BASELIB}" + +#YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target[export] = "1" +#YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target[export] = "1" + +#DEPENDS:append:toolchain-clang:class-target = " clang-cross-${TARGET_ARCH} " +#DEPENDS:remove:toolchain-clang:allarch = "clang-cross-${TARGET_ARCH}" + +def clang_base_deps(d): + if not d.getVar('INHIBIT_DEFAULT_DEPS', False): + if not oe.utils.inherits(d, 'allarch') : + ret = " ${MLPREFIX}clang-external-cross-${TARGET_ARCH} virtual/libc " + if (d.getVar('RUNTIME').find('android') != -1): + ret += " libcxx" + return ret + if (d.getVar('RUNTIME').find('llvm') != -1): + ret += " compiler-rt" + elif (d.getVar('COMPILER_RT').find('-rtlib=compiler-rt') != -1): + ret += " compiler-rt " + else: + ret += " libgcc " + if (d.getVar('RUNTIME').find('llvm') != -1): + ret += " libcxx" + elif (d.getVar('COMPILER_RT').find('--unwindlib=libunwind') != -1): + ret += " libcxx " + elif (d.getVar('LIBCPLUSPLUS').find('-stdlib=libc++') != -1): + ret += " libcxx " + else: + ret += " virtual/${TARGET_PREFIX}compilerlibs " + return ret + return "" + +BASE_DEFAULT_DEPS:toolchain-clang:class-target = "${@clang_base_deps(d)}" +BASE_DEFAULT_DEPS:append:class-native:toolchain-clang:runtime-llvm = " libcxx-native compiler-rt-native" +BASEDEPENDS:append = " clang-native" +BASEDEPENDS:remove:pn-clang-native = "clang-native" +BASE_DEFAULT_DEPS:append:class-nativesdk:toolchain-clang:runtime-llvm = " clang-native nativesdk-libcxx nativesdk-compiler-rt" + +# do_populate_sysroot needs STRIP +POPULATESYSROOTDEPS:toolchain-clang:class-target = "${MLPREFIX}clang-external-cross-${TARGET_ARCH}:do_populate_sysroot" + +cmake_do_generate_toolchain_file:append:toolchain-clang () { + cat >> ${WORKDIR}/toolchain.cmake < ${WORKDIR}/toolchain-native.cmake < +# Released under the MIT license (see COPYING.MIT for the terms) + +EXTRA_ANALYZER_OPTIONS += "-analyze-headers" +EXTRA_ANALYZER_OPTIONS += "--force-analyze-debug-code" +SCAN_BUILD ??= "1" +SCAN_BUILD:class-native = "" +SCAN_BUILD:class-nativesdk = "" +SCAN_BUILD:class-cross = "" +SCAN_BUILD:class-crosssdk = "" +SCAN_BUILD:class-cross-canadian = "" + +#CLANG_SCAN_SERVER_IP ??= "127.0.0.1" +CLANG_SCAN_SERVER_IP ??= "10.0.0.10" +CLANG_SCAN_PORT ??= "8181" +SCAN_RESULTS_DIR ?= "${TMPDIR}/static-scan/${PN}" + +CCSCAN ?= "${HOST_PREFIX}${TOOLCHAIN}" +CXXSCAN:toolchain-clang ?= "${HOST_PREFIX}clang++" +CXXSCAN:toolchain-gcc ?= "${HOST_PREFIX}g++" + +do_scanbuild() { + rm -rf ${SCAN_RESULTS_DIR} + scan-build --use-cc ${CCSCAN} --use-c++ ${CXXSCAN} --analyzer-target ${HOST_SYS} --html-title ${BP} -o ${SCAN_RESULTS_DIR} ${EXTRA_ANALYZER_OPTIONS} ${MAKE} ${PARALLEL_MAKE} ${EXTRA_OEMAKE} +} + +do_scanview() { + bbplain "================================================================" + bbplain "Starting scan-view server at: http://${CLANG_SCAN_SERVER_IP}:${CLANG_SCAN_PORT}" + bbplain "Use Ctrl-C to exit" + bbplain "================================================================" + scan-view --host ${CLANG_SCAN_SERVER_IP} --port ${CLANG_SCAN_PORT} --allow-all-hosts ${SCAN_RESULTS_DIR}/*/ +} + +do_scanview[depends] += "${PN}:do_scanbuild" +do_scanbuild[depends] += "clang-native:do_populate_sysroot" +#do_scanbuild[cleandirs] += "${SCAN_RESULTS_DIR}" +do_scanbuild[dirs] += "${B}" +do_scanview[dirs] += "${SCAN_RESULTS_DIR}" +#do_build[recrdeptask] += "do_scanbuild" + +do_scanbuild[doc] = "Build and scan static analysis data using clang" +do_scanview[doc] = "Start a webserver to visualize static analysis data" + +addtask scanbuild after do_configure before do_compile +addtask scanview after do_scanbuild +python () { + # Remove scanbuild task when scanning is not enabled or recipe does not have do_configure + if not(d.getVar('SCAN_BUILD') == "1") or not(d.getVar('TOOLCHAIN') == "clang") or oe.utils.inherits(d, 'allarch'): + for i in ['do_scanbuild', 'do_scanview']: + bb.build.deltask(i, d) + else: + cflags = d.getVar('CFLAGS', False) + d.getVar('TARGET_CC_ARCH', False) + d.getVar('TOOLCHAIN_OPTIONS', False) + cxxflags = d.getVar('CXXFLAGS', False) + d.getVar('TARGET_CC_ARCH', False) + d.getVar('TOOLCHAIN_OPTIONS', False) + d.setVar('CFLAGS', cflags) + d.setVar('CXXFLAGS', cxxflags) + if oe.utils.inherits(d, 'autotools'): + cachedvar = d.getVar('CACHED_CONFIGUREVARS', False) + cachedvar = cachedvar + " scan-build " + " --analyzer-target " + d.getVar('HOST_SYS', False) + " --use-cc " + d.getVar('CCSCAN', False) + " --use-c++ " + d.getVar('CXXSCAN', False) + d.setVar('CACHED_CONFIGUREVARS', cachedvar) +} diff --git a/meta-clang/conf/distro/include/tcmode-external-clang.inc b/meta-clang/conf/distro/include/tcmode-external-clang.inc new file mode 100644 index 0000000000000000000000000000000000000000..5eabf1deeeae7435752ca5d2f8df85cf5978c0d2 --- /dev/null +++ b/meta-clang/conf/distro/include/tcmode-external-clang.inc @@ -0,0 +1,24 @@ +EXTERNAL_CLANG ?= "clang" +CLANG_VERSION = "${@get_clang_version(d)}" +CLANG_VERSION_allarch = "" +CLANG_VERSION[vardepvalue] = "${CLANG_VERSION}" +BUILDCFG_VARS += "CLANG_VERSION" + +def get_clang_version(d): + import os.path + import re + import subprocess + import oe.path + import bb + version_output = "" + toolchain_bin = d.getVar('EXTERNAL_TOOLCHAIN_CLANG_BIN') + if toolchain_bin: + path = os.path.join(toolchain_bin, d.getVar('EXTERNAL_CLANG')) + cmd = path + " --version | head -n1" + bb.debug(1, 'oe.external.run({})'.format(cmd)) + version_output = subprocess.getoutput(cmd) + # clang version xx.yy.zz, here we get xx.yy.zz + match = re.search("[0-9]+\.[0-9]+\.[0-9]", version_output) + if match: + return match.group() + return 'UNKNOWN' diff --git a/meta-clang/conf/layer.conf b/meta-clang/conf/layer.conf new file mode 100644 index 0000000000000000000000000000000000000000..25cd41e56ffa6391550556a1ae3b34fd4975894c --- /dev/null +++ b/meta-clang/conf/layer.conf @@ -0,0 +1,37 @@ +# We have a conf and classes directory, append to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have a recipes directory, add to BBFILES +BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend" + +BBFILE_COLLECTIONS += "clang-layer" +BBFILE_PATTERN_clang-layer := "^${LAYERDIR}/" +BBFILE_PRIORITY_clang-layer = "7" +LAYERSERIES_COMPAT_clang-layer = "hardknott kirkstone langdale" +LAYERDEPENDS_clang-layer = "core" + +BBFILES_DYNAMIC += " \ + browser-layer:${LAYERDIR}/dynamic-layers/browser-layer/*/*.bb \ + browser-layer:${LAYERDIR}/dynamic-layers/browser-layer/*/*.bbappend \ + openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/*/*/*.bb \ + openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/*/*/*.bbappend \ + networking-layer:${LAYERDIR}/dynamic-layers/networking-layer/*/*/*.bb \ + networking-layer:${LAYERDIR}/dynamic-layers/networking-layer/*/*/*.bbappend \ + selinux:${LAYERDIR}/dynamic-layers/selinux/*/*.bb \ +" + +PREFERRED_PROVIDER_libgcc-initial = "libgcc-initial" +#PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs_forcevariable = "libcxx" +PREFERRED_PROVIDER_llvm = "clang" +PREFERRED_PROVIDER_llvm-native = "clang-native" +PREFERRED_PROVIDER_nativesdk-llvm = "nativesdk-clang" +PREFERRED_PROVIDER_libunwind = "${@bb.utils.contains_any("RUNTIME", "llvm android", "libcxx", "libunwind", d)}" +INHERIT += "clang" + +# Do not include clang in SDK unless user wants to +CLANGSDK ??= "0" + +LLVMVERSION = "15.0.4" + +require conf/nonclangable.conf +require conf/nonscanable.conf diff --git a/meta-clang/conf/nonclangable.conf b/meta-clang/conf/nonclangable.conf new file mode 100644 index 0000000000000000000000000000000000000000..a543034c6574ca1e6a4e74e6fd7191d2ae83791a --- /dev/null +++ b/meta-clang/conf/nonclangable.conf @@ -0,0 +1,355 @@ +TOOLCHAIN:pn-cpufrequtils = "gcc" + +# | grub-mkimage: error: relocation 0x2b is not implemented yet. +TOOLCHAIN:pn-grub-efi:aarch64 = "gcc" +TOOLCHAIN:pn-grub-efi:riscv32 = "gcc" +# clang-15 crashes +TOOLCHAIN:pn-grub-efi:riscv64 = "gcc" +TOOLCHAIN:pn-grub:riscv64 = "gcc" +# | build-grub-module-verifier: error: search_label: unsupported relocation 0x108. +TOOLCHAIN:pn-grub:aarch64 = "gcc" +# crash embeds version of gdb which is not buildable with clang +TOOLCHAIN:pn-crash = "gcc" +# | ../../elfutils-0.187/libasm/asm_newscn.c:49:22: error: field 'pattern' with variable sized type 'struct FillPattern' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end] +TOOLCHAIN:pn-elfutils:libc-glibc = "gcc" +# /mnt/a/yoe/build/tmp/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/firefox/60.1.0esr-r0/recipe-sysroot-native/usr/lib/clang/7.0.1/include/arm_neon.h:433:1: error: unknown type name 'inline' +# __ai uint8x16_t vabdq_u8(uint8x16_t __p0, uint8x16_t __p1) { +TOOLCHAIN:pn-firefox = "gcc" +TOOLCHAIN:pn-gcc = "gcc" +TOOLCHAIN:pn-gcc-runtime = "gcc" +TOOLCHAIN:pn-gcc-sanitizers = "gcc" +TOOLCHAIN:pn-glibc = "gcc" +TOOLCHAIN:pn-glibc-initial = "gcc" +TOOLCHAIN:pn-glibc-locale = "gcc" +TOOLCHAIN:pn-glibc-mtrace = "gcc" +TOOLCHAIN:pn-glibc-scripts = "gcc" +TOOLCHAIN:pn-glibc-testsuite = "gcc" +TOOLCHAIN:pn-glibc-tests = "gcc" + +#| prelink-rtld: error while loading shared libraries: ld.so.1 +#| /lib64/ld.so.1: No such file or directory +TOOLCHAIN:pn-gobject-intospection:mips64 = "gcc" +TOOLCHAIN:pn-avahi:mips64 = "gcc" + +# VLAs +#| control.c:286:19: error: fields must have a constant size: 'variable length array in structure' extension will never be supported +#| __u32 buffer[cam->max_response_quads]; +#| ^ +#| 1 error generated. +TOOLCHAIN:pn-libdc1394 = "gcc" + +# error: return address can be determined only for current frame +TOOLCHAIN:pn-libexecinfo:mipsarch = "gcc" +TOOLCHAIN:pn-libgcc = "gcc" +TOOLCHAIN:pn-libgcc-initial = "gcc" +TOOLCHAIN:pn-libgfortran = "gcc" +TOOLCHAIN:pn-libssp-nonshared = "gcc" + +TOOLCHAIN:pn-m4:powerpc = "gcc" +# clang does not have 64bit atomics on ppc +TOOLCHAIN:pn-mesa:powerpc = "gcc" +# clang fails with db.c:(.text+0x188): unsupported bss-plt -fPIC ifunc mmio_write64_be +TOOLCHAIN:pn-rdma-core:powerpc = "gcc" +# usermode qemu crashes when running binaries from clang + rust compiler on ppc32 +TOOLCHAIN:pn-librsvg:powerpc = "gcc" +# variant-impl.hpp:309:36: error: 'is_variant' does not name a template but is followed by template arguments +TOOLCHAIN:pn-omxplayer = "gcc" +# error: return address can be determined only for current frame +TOOLCHAIN:pn-openflow:mipsarch = "gcc" +TOOLCHAIN:pn-openjdk-8 = "gcc" +TOOLCHAIN:pn-openjre-8 = "gcc" +TOOLCHAIN:pn-syslinux = "gcc" +TOOLCHAIN:pn-systemtap = "gcc" +# v4l-utils uses nested functions +TOOLCHAIN:pn-v4l-utils = "gcc" +# https://bugs.kde.org/show_bug.cgi?id=369723 +TOOLCHAIN:pn-valgrind = "gcc" +# uses C++ which clang does not like +TOOLCHAIN:pn-wvstreams = "gcc" +TOOLCHAIN:pn-wvdial = "gcc" +# +#../../lib/libicui18n.so: undefined reference to `__atomic_fetch_sub_4' +#../../lib/libicui18n.so: undefined reference to `__atomic_load_4' +#../../lib/libicui18n.so: undefined reference to `__atomic_store_4' +#../../lib/libicui18n.so: undefined reference to `__atomic_fetch_add_4' +# +TOOLCHAIN:pn-icu:armv4 = "gcc" +TOOLCHAIN:pn-icu:armv5 = "gcc" + +#../../libgcrypt-1.6.5/mpi/mpih-div.c:98:3: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions +TOOLCHAIN:pn-libgcrypt:mips64 = "gcc" + +#recipe-sysroot/usr/include/mozjs-60/mozilla/Span.h:634:5: error: statement not allowed in constexpr function +#| MOZ_RELEASE_ASSERT(aStart <= len && (aLength == dynamic_extent || +#| ^ +TOOLCHAIN:pn-polkit = "gcc" + +# ppp uses nested functions and gcc specific option e.g. --print-sysroot +# +TOOLCHAIN:pn-ppp = "gcc" + +#| ./ports/linux/pseudo_wrappers.c:80:14: error: use of unknown builtin '__builtin_apply' [-Wimplicit-function-declaration] +#| void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7); +#| ^ +#| ./ports/linux/pseudo_wrappers.c:80:57: error: use of unknown builtin '__builtin_apply_args' [-Wimplicit-function-declaration] +#| void *res = __builtin_apply((void (*)()) real_syscall, __builtin_apply_args(), sizeof(long) * 7); +TOOLCHAIN:pn-pseudo = "gcc" + +# mix_neon.c:179:9: error: invalid operand in inline asm: 'vld1.s32 ${0:h}, [$2] +# vld1.s32 ${1:h}, [$3] ' +TOOLCHAIN:pn-pulseaudio:armv7ve = "gcc" +TOOLCHAIN:pn-pulseaudio:armv7a = "gcc" + +#| ./dsp/v4f_IIR2.h:554:12: error: no matching function for call to 'v4f_map' +#| a[5] = v4f_map<__builtin_cosf> (f); +#| ^~~~~~~~~~~~~~~~~~~~~~~ +TOOLCHAIN:pn-caps = "gcc" + +#| ../libffi-3.3-rc0/src/arm/sysv.S: Assembler messages: +#| ../libffi-3.3-rc0/src/arm/sysv.S:131: Error: selected processor does not support `vldrle d0,[sp]' in ARM mode +#| ../libffi-3.3-rc0/src/arm/sysv.S:132: Error: selected processor does not support `vldmgt sp,{d0-d7}' in ARM mode +TOOLCHAIN:pn-libffi:armeb = "gcc" + +# rocksdb/rocksdb/util/crc32c_ppc_asm.S:9:10: fatal error: 'ppc-asm.h' file not found +# #include +# This header is only available with gcc-cross +TOOLCHAIN:pn-mariadb:powerpc64le = "gcc" + +# OpenCV does not compile for ppc64 with clang due to VSX clashes with altivec.h from clang +TOOLCHAIN:pn-opencv:powerpc64le = "gcc" +# Ade is used by openCV and shared C++ runtime so we can not mix libstdc++ and libc++ +TOOLCHAIN:pn-ade:powerpc64le = "gcc" + +#| error: return address can be determined only for current frame +#| error: return address can be determined only for current frame +#| error: return address can be determined only for current frame +TOOLCHAIN:pn-gcompat:mips = "gcc" + +# Fixes Clang induced linker crashes when using glibc 2.35+ +# mips-yoe-linux/mips-yoe-linux-ld: DWARF error: invalid or unhandled FORM value: 0x22 +# mips-yoe-linux-ld: Zend/asm/make_mips32_o32_elf_gas.o: CALL16 reloc at 0x28 not against global symbol +# mips-yoe-linux/mips-yoe-linux-ld: BFD (GNU Binutils) 2.37.20210721 assertion fail ../../bfd/elfxx-mips.c:3614 +TOOLCHAIN:pn-php:mips = "gcc" + +# Clang-15 compiled openSSH tools crash on target ssh-keygen specifically +TOOLCHAIN:pn-openssh = "gcc" +# some packages not support clang compile yet. +TOOLCHAIN:class-native:pn-pseudo-native = "gcc" +TOOLCHAIN:class-native:pn-grub-native = "gcc" +TOOLCHAIN:pn-gnutls = "clang" +TOOLCHAIN:pn-libmetal = "clang" +TOOLCHAIN:pn-openamp = "clang" +TOOLCHAIN:pn-dhcp = "clang" +TOOLCHAIN:pn-openssh = "clang" + +CFLAGS:append:pn-liboil:toolchain-clang:x86-64 = " -fheinous-gnu-extensions " + +#../libffi-3.2.1/src/arm/sysv.S:363:2: error: invalid instruction, did you mean: fldmiax? +# fldmiadgt ip, {d0-d7} +CFLAGS:append:pn-libffi:mips64:toolchain-clang = " -no-integrated-as" + +# ../db-5.3.28/src/mutex/mut_tas.c:150:34: error: unknown directive +#:9:2: note: instantiated into assembly here +# .force_thumb +# ^ +#CFLAGS:append:pn-db:toolchain-clang = " -no-integrated-as" +# +#| ../../../DirectFB-1.7.7/lib/direct/armasm_memcpy.S:63:2: error: invalid instruction +#| ldmgeia r1!, {r3, r4, r12, lr} +#| ^ +CFLAGS:append:pn-directfb:toolchain-clang:arm = " -no-integrated-as" + +#| threads_pthread.c:(.text+0x372): undefined reference to `__atomic_is_lock_free' +EXTRA_OECONF:pn-openssl:toolchain-clang:x86 = "-latomic" + +CFLAGS:append:pn-userland:toolchain-clang = " -no-integrated-as" + +# libjpeg-turbo-2.0.2/simd/mips/jsimd_dspr2.S +# :13:5: error: invalid token in expression +# .if $17 != 0 +# ^ +CFLAGS:append:pn-libjpeg-turbo:toolchain-clang:mipsarch = " -no-integrated-as" + +#| /tmp/x86-sse2-cdb148.s:207:9: error: ambiguous operand size for instruction 'sub' +#| sub SIZE, 64 +#| ^~~~ +CFLAGS:append:pn-tinymembench:toolchain-clang:x86-64 = " -no-integrated-as" +CFLAGS:append:pn-tinymembench:toolchain-clang:x86 = " -no-integrated-as" +CFLAGS:append:pn-tinymembench:toolchain-clang:mipsarch = " -no-integrated-as" + +CFLAGS:append:pn-ne10:toolchain-clang:arm = " -no-integrated-as" +CFLAGS:append:pn-libde265:toolchain-clang:arm = " -no-integrated-as" + +#2816:2: error: changed section type for .debug_frame, expected: 0x7000001E +# .section .debug_frame,"",@progbits +# ^ +#lj_vm.S:2890:2: error: changed section flags for .eh_frame, expected: 0x2 +# .section .eh_frame,"aw",@progbits +# ^ +CFLAGS:append:pn-luajit:toolchain-clang:mips = " -no-integrated-as" + +#FAILED: libucontext_posix.so.1 +#clang-13: error: unable to execute command: Segmentation fault (core dumped) +#clang-13: error: linker command failed due to signal (use -v to see invocation) +CFLAGS:append:pn-libucontext:toolchain-clang:powerpc64le = " -no-integrated-as" + +# Generated asm file can not be compiled with clang assembler due to presence of .0 label +# and its references +#| aes-decrypt-internal-2.s:368:1: error: unexpected token at start of statement +#| .0: +#| ^ +CFLAGS:append:pn-nettle:toolchain-clang:powerpc64le = " -no-integrated-as" + +# include/gcc/arm/ck_pr.h:201:1: error: instruction requires: arm-mode +#| CK_PR_DOUBLE_STORE(uint64_t, 64) +#| ^ +#include/gcc/arm/ck_pr.h:192:6: note: expanded from macro 'CK_PR_DOUBLE_STORE' +#| "strexd %1, %3, [%2]\n" \ +#| ^ +CFLAGS:append:pn-concurrencykit:toolchain-clang:arm = " -no-integrated-as" + +#../git/common/connection.c:154:55: error: comparison of integers of different signs: 'unsigned long' and 'int' [-Werror,-Wsign-compare] +# for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg)) { +# ^~~~~~~~~~~~~~~~~~~~~~ +CFLAGS:append:pn-seatd:toolchain-clang = " -Wno-sign-compare" + +# -fno-tree-vrp is gcc specific +CXXFLAGS:remove:pn-mozjs:toolchain-clang = "-fno-tree-vrp" +CFLAGS:remove:pn-mozjs:toolchain-clang = "-fno-tree-vrp" + +TUNE_CCARGS:remove:pn-omxplayer:toolchain-clang = "-no-integrated-as" +TUNE_CCARGS:remove:pn-nfs-utils:toolchain-clang = "-Qunused-arguments" + +# We want to error out when -msse option is used otherwise it enables sse on non-x86 arches +TUNE_CCARGS:remove:pn-pipewire:toolchain-clang = "-Qunused-arguments" +TUNE_CCARGS:remove:pn-tesseract:toolchain-clang = "-Qunused-arguments" +TUNE_CCARGS:remove:pn-pulseaudio:toolchain-clang = "-Qunused-arguments" + +# Disable altivec on ppc32 +#/usr/include/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h:1345:32: error: use of undeclared identifier 'vec_sqrt'; did you mean 'vec_rsqrt'? +# BF16_TO_F32_UNARY_OP_WRAPPER(vec_sqrt, a); +# ^~~~~~~~ +# vec_rsqrt +TUNE_CCARGS:pn-ceres-solver:append:toolchain-clang:powerpc = " -mno-altivec" +TUNE_CCARGS:pn-opencv:append:toolchain-clang:powerpc = " -mno-altivec" +CXXFLAGS:pn-libeigen:append:toolchain-clang:powerpc = " -DEIGEN_ALTIVEC_DISABLE_MMA" + +#| /usr/src/debug/ruby/2.5.1-r0/build/../ruby-2.5.1/process.c:7073: undefined reference to `__mulodi4' +#| clang-7: error: linker command failed with exit code 1 (use -v to see invocation) +COMPILER_RT:pn-ruby:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-python3:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-m4:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-cpio:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-openssh:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-webkitgtk:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-wpewebkit:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-python3-numpy:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:pn-mongodb:toolchain-clang:runtime-gnu = "-rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT:remove:pn-m4:powerpc = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-ruby:powerpc = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-webkitgtk:powerpc = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-m4:armeb = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-ruby:armeb = "-rtlib=compiler-rt" +COMPILER_RT:remove:pn-webkitgtk:armeb = "-rtlib=compiler-rt" + +# Does not work with libc++ 15.x +TOOLCHAIN:pn-webkitgtk = "gcc" + +# build/lib/libQt5Widgets.so: undefined reference to `__lshrti3' +# __lshrti3 is missing in libgcc +COMPILER_RT:pn-qtbase:toolchain-clang:riscv32 = "-rtlib=compiler-rt ${UNWINDLIB}" + +LDFLAGS:append:pn-qtwebengine:toolchain-clang:runtime-gnu:x86 = " -latomic" +LDFLAGS:append:pn-qemu:toolchain-clang:x86 = " -latomic" + +# glibc is built with gcc and hence encodes some libgcc specific builtins which are not found +# when doing static linking with clang using compiler-rt, so use libgcc +# undefined reference to `__unordtf2' +COMPILER_RT:pn-aufs-util:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-tsocks:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libc-bench:libc-glibc:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-fmt:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-fmt:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-mybw:toolchain-clang:x86 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-mybw:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libc-bench:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-mpich:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-aufs-util:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" +COMPILER_RT:pn-tsocks:libc-glibc:toolchain-clang:x86-64 = "-rtlib=libgcc --unwindlib=libgcc" + +#(unwind.o): in function `__pthread_unwind': +#/usr/src/debug/glibc/2.29-r0/git/nptl/unwind.c:121: undefined reference to `_Unwind_ForcedUnwind' +#clang-8: error: linker command failed with exit code 1 (use -v to see invocation) +COMPILER_RT:pn-libhugetlbfs:libc-glibc:toolchain-clang:arm = "--unwindlib=libgcc" + +# Uses gcc for native tools, e.g. nsinstall and passes clang options which fails so +# let same compiler ( gcc or clang) be native/cross compiler +# | gcc: error: unrecognized command line option ‘-Qunused-arguments’ +BUILD_CC:pn-nss:toolchain-clang = "clang -rtlib=libgcc -unwindlib=none" + +# LTO +# Seems to use symver ASMs see https://stackoverflow.com/questions/46304742/how-to-combine-lto-with-symbol-versioning +# lib/puny_encode.c:136: multiple definition of `_idn2_punycode_encode' +LTO:pn-libidn2:toolchain-clang = "" + +#libcairo.so: undefined reference to pthread_mutexattr_init [--no-allow-shlib-undefined] +LTO:pn-cairo:toolchain-clang = "" + +# This works with gcc-ranlib wrapper only which expands $@ shell array, +# but it will fail if RANLIB was set to -ranlib or +# -llvn-ranlib has same behaviour +RANLIB:append:pn-tcf-agent:toolchain-clang = " $@" + +# see https://github.com/llvm/llvm-project/issues/53948 +OBJCOPY:pn-opensbi:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-libc-bench:toolchain-clang = "${HOST_PREFIX}objcopy" +STRIP:pn-libc-bench:toolchain-clang = "${HOST_PREFIX}strip" +OBJCOPY:pn-aufs-util:toolchain-clang = "${HOST_PREFIX}objcopy" +STRIP:pn-aufs-util:toolchain-clang = "${HOST_PREFIX}strip" + +# Depend on GNU objcopy option missing in llvm-objcopy +# llvm-objcopy: error: unknown argument '--section-alignment=512' +OBJCOPY:pn-systemd-boot:toolchain-clang = "${HOST_PREFIX}objcopy" + +# See https://github.com/llvm/llvm-project/issues/53999 +STRIP:pn-go-helloworld:mips:toolchain-clang = "${HOST_PREFIX}strip" +OBJCOPY:pn-go-helloworld:mips:toolchain-clang = "${HOST_PREFIX}objcopy" +STRIP:pn-gosu:mips:toolchain-clang = "${HOST_PREFIX}strip" +OBJCOPY:pn-gosu:mips:toolchain-clang = "${HOST_PREFIX}objcopy" +# mips-yoe-linux-llvm-objcopy: error: Link field value 42 in section .rel.dyn is not a symbol table +OBJCOPY:pn-mybw:mips:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-mybw:x86:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-mybw:x86-64:toolchain-clang = "${HOST_PREFIX}objcopy" +OBJCOPY:pn-mybw:riscv64:toolchain-clang = "${HOST_PREFIX}objcopy" + +# Fails with llvm strip +# i686-yoe-linux-llvm-strip: error: SHT_STRTAB string table section [index 9] is non-null terminated +STRIP:pn-minio:toolchain-clang = "${HOST_PREFIX}strip" +OBJCOPY:pn-minio:toolchain-clang = "${HOST_PREFIX}objcopy" + +# see https://github.com/llvm/llvm-project/issues/54213 +# Generates a bad libbsd.so linker stub and apps like bluelsa, mg, netcat-openbsd, android-tools +# fails to link with libbsd +OBJDUMP:pn-libbsd:mips:toolchain-clang = "${HOST_PREFIX}objdump" + +# With clang/lld it builds objects which gnu strip complains about +# iscv64-yoe-linux-strip: /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/python3-matplotlib/3.5.3-r0/package/usr/lib/python3.10/site-packages/matplotlib/stTcyupd: not enough room for program headers, try linking with -N +STRIP:pn-python3-matplotlib:toolchain-clang:riscv64 = "${HOST_PREFIX}llvm-strip" +STRIP:pn-python3-matplotlib:toolchain-clang:riscv32 = "${HOST_PREFIX}llvm-strip" + +# Need OBJDUMP during do_package_qa which is set to llvm-objdump with meta-clang +# it might work with GNU objdump since it falls back to one from build host +DEPENDS:pn-linux-firmware:append:toolchain-clang = " clang-native" + +# Needs for solving fopenmp issues +DEPENDS:append:pn-pixman:mips:toolchain-clang = " openmp" +#| ../pixman-0.40.0/pixman/pixman-arm-neon-asm.S:3625:1: note: while in macro instantiation +#| generate_bilinear_scanline_func pixman_scaled_bilinear_scanline_0565_0565_SRC_asm_neon, 0565, 0565, 1, 1, 28, BILINEAR_FLAG_UNROLL_4 +#| ^ +#| :134:1: error: unknown directive +#| .endfunc +#| ^ +CFLAGS:append:pn-pixman:arm:toolchain-clang = " -no-integrated-as" + diff --git a/meta-clang/conf/nonscanable.conf b/meta-clang/conf/nonscanable.conf new file mode 100644 index 0000000000000000000000000000000000000000..3cdc454e90524badad66da139e689bd60795c401 --- /dev/null +++ b/meta-clang/conf/nonscanable.conf @@ -0,0 +1,22 @@ +SCAN_BUILD:pn-linux-libc-headers = "" +SCAN_BUILD:pn-update-rc.d = "" +SCAN_BUILD:pn-initscripts = "" +SCAN_BUILD:pn-base-files = "" +SCAN_BUILD:pn-os-release = "" +SCAN_BUILD:pn-wireless-regdb = "" +SCAN_BUILD:pn-tzdata = "" +SCAN_BUILD:pn-qemuwrapper-cross = "" +SCAN_BUILD:pn-depmodwrapper-cross = "" +SCAN_BUILD:pn-bluez-firmware-rpidistro = "" +SCAN_BUILD:pn-udev-rules-rpi = "" +SCAN_BUILD:pn-shadow-securetty = "" +SCAN_BUILD:pn-96boards-tools = "" +SCAN_BUILD:pn-run-postinsts = "" +SCAN_BUILD:pn-keymaps = "" +SCAN_BUILD:pn-sysvinit-inittab = "" +SCAN_BUILD:pn-pi-bluetooth = "" +SCAN_BUILD:pn-rpi-config = "" +SCAN_BUILD:pn-bcm2835-bootfiles = "" +SCAN_BUILD:pn-autoconf-archive = "" +SCAN_BUILD:pn-compiler-rt = "" +SCAN_BUILD:pn-libcxx = "" diff --git a/meta-clang/dynamic-layers/networking-layer/recipes-connectivity/samba/files/fix_duplicate_pdb_search_init.patch b/meta-clang/dynamic-layers/networking-layer/recipes-connectivity/samba/files/fix_duplicate_pdb_search_init.patch new file mode 100644 index 0000000000000000000000000000000000000000..e9d88d20bd45695b5a485d54ea3ac5ea6f807782 --- /dev/null +++ b/meta-clang/dynamic-layers/networking-layer/recipes-connectivity/samba/files/fix_duplicate_pdb_search_init.patch @@ -0,0 +1,10 @@ +--- a/source3/wscript_build 2019-03-14 09:03:29.498617250 +0100 ++++ b/source3/wscript_build 2019-03-14 09:06:19.824949694 +0100 +@@ -124,7 +124,6 @@ + '!get_attr_list'] + private_pdb_match.append('!pdb_nds_*') + private_pdb_match.append('!pdb_ldapsam_init*') +-private_pdb_match.append('!pdb_*_init') + private_pdb_match = private_pdb_match + ldapsam_pdb_match + + bld.SAMBA3_LIBRARY('samba-passdb', diff --git a/meta-clang/dynamic-layers/networking-layer/recipes-connectivity/samba/samba_4.%.bbappend b/meta-clang/dynamic-layers/networking-layer/recipes-connectivity/samba/samba_4.%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..543f32cedac83f5d9e2fb75af439c5af252c051c --- /dev/null +++ b/meta-clang/dynamic-layers/networking-layer/recipes-connectivity/samba/samba_4.%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI:append = " file://fix_duplicate_pdb_search_init.patch " diff --git a/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch new file mode 100644 index 0000000000000000000000000000000000000000..3e0a6aa0862bc29c9108a65f5e80dddf122d0661 --- /dev/null +++ b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch @@ -0,0 +1,41 @@ +From 4f64ed40e1ffea7ea278627f30a01018e57dcbcf Mon Sep 17 00:00:00 2001 +From: Mingli Yu +Date: Wed, 9 Sep 2020 05:48:19 +0000 +Subject: [PATCH] CMakeLists.txt: override the PY_CMD_ESCAPED + +Override the PY_CMD_ESCAPED as the PY_CMD_ESCAPED is constructed by +the full path of the python3. In some cases, the path is so long and +result in the PY_CMD_ESCAPED exceeds 255 characters and comes below +do_configure error: + | CMake Error at src/python/CMakeLists.txt:18 (configure_file): + | configure_file Problem configuring file + | + | CMake Error: Could not open file for write in copy operation /buildarea1/test/wr_build/wr1020_20200909_bcc/bcc_long_Kernel/auto-standalone_next/200827/lxbuilds/Intel-Snow-Ridge-NS_platform_up/intel-x86-64-standard-glibc-std/wrlinux/build/tmp-glibc/work/corei7-64-wrs-linux/bcc/0.15.0-r0/build/src/python/bcc--buildarea1-test-wr_build-wr1020_20200909_bcc-bcc_long_Kernel-auto-standalone_next-200827-lxbuilds-Intel-Snow-Ridge-NS_platform_up-intel-x86-64-standard-glibc-std-wrlinux-build-tmp-glibc-work-corei7-64-wrs-linux-bcc-0.15.0-r0-recipe-sysroot-native-usr-bin-python3-native-python3/bcc/version.py.tmp + +Upstream-Status: Pending + +Signed-off-by: Mingli Yu +--- + src/python/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/src/python/CMakeLists.txt ++++ b/src/python/CMakeLists.txt +@@ -12,7 +12,7 @@ file(GLOB_RECURSE PYTHON_INCLUDES RELATI + + foreach(PY_CMD ${PYTHON_CMD}) + string(REPLACE "/" "-" PY_CMD_ESCAPED ${PY_CMD}) +- set(PY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bcc-${PY_CMD_ESCAPED}) ++ set(PY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bcc-python3) + + foreach(PY_SRC ${PYTHON_SOURCES}) + configure_file(${PY_SRC} ${PY_DIRECTORY}/${PY_SRC} COPYONLY) +@@ -31,7 +31,7 @@ foreach(PY_CMD ${PYTHON_CMD}) + DEPENDS ${PYTHON_SOURCES} ${PYTHON_INCLUDES} + COMMENT "Building sdist for ${PY_CMD}" + ) +- add_custom_target(bcc_py_${PY_CMD_ESCAPED} ALL DEPENDS ${PIP_INSTALLABLE}) ++ add_custom_target(bcc_py_python3 ALL DEPENDS ${PIP_INSTALLABLE}) + + install( + CODE " diff --git a/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch new file mode 100644 index 0000000000000000000000000000000000000000..946787c0878959e7b8b4ab0a5932b6dd40e804ca --- /dev/null +++ b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch @@ -0,0 +1,124 @@ +From 6cffc195eca6b53a12865d325ff97e7b5ba8f22b Mon Sep 17 00:00:00 2001 +From: Daniel Thompson +Date: Thu, 19 May 2022 09:14:20 +0000 +Subject: [PATCH] Vendor just enough extra headers to allow libbpf to be + de-vendored + +Currently it is not possible to build the bcc recipe when we de-vendor +libbpf and adopt the packaged version. Ironically this is due to the +deliberate vendoring of some depreciated btf code that is being removed +upstream because bcc was the only user! In other words the vendored code +doesn't work the de-vendored libbpf because also ends up de-vendoring +one of the Linux uapi headers. + +This is obviously an OE specific issue (due to the current combination +of linux headers, libbpf and bcc). It's a bit of a mess and the right +solution is probably to update the system UAPI headers but I am committing +this for now simply so I can easily show why we must de-vendor libbpf in +the first place! + +Upstream-status: Inappropriate [other] + +Signed-off-by: Daniel Thompson +--- + src/cc/bcc_btf.cc | 87 +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 87 insertions(+) + +diff --git a/src/cc/bcc_btf.cc b/src/cc/bcc_btf.cc +index 7f551ae8..cca3c6c3 100644 +--- a/src/cc/bcc_btf.cc ++++ b/src/cc/bcc_btf.cc +@@ -33,6 +33,93 @@ + + namespace btf_ext_vendored { + ++#ifdef HAVE_EXTERNAL_LIBBPF ++/* ++ * When we de-vendor libbpf we end up picking up an older version of ++ * [uapi/]linux/bpf.h which misses out some of the data structures needed ++ * to compile this file. Annoyingly the code that doesn't compile it ++ * a result of de-vendoring ++ * ++ * This section is a minimized re-vendoring to fix that. It is not robust ++ * against version skew: When the system linux/bpf.h is updated then this ++ * will break the build and the patch can be dropped. ++ */ ++ ++/* bpf_core_relo_kind encodes which aspect of captured field/type/enum value ++ * has to be adjusted by relocations. It is emitted by llvm and passed to ++ * libbpf and later to the kernel. ++ */ ++enum bpf_core_relo_kind { ++ BPF_CORE_FIELD_BYTE_OFFSET = 0, /* field byte offset */ ++ BPF_CORE_FIELD_BYTE_SIZE = 1, /* field size in bytes */ ++ BPF_CORE_FIELD_EXISTS = 2, /* field existence in target kernel */ ++ BPF_CORE_FIELD_SIGNED = 3, /* field signedness (0 - unsigned, 1 - signed) */ ++ BPF_CORE_FIELD_LSHIFT_U64 = 4, /* bitfield-specific left bitshift */ ++ BPF_CORE_FIELD_RSHIFT_U64 = 5, /* bitfield-specific right bitshift */ ++ BPF_CORE_TYPE_ID_LOCAL = 6, /* type ID in local BPF object */ ++ BPF_CORE_TYPE_ID_TARGET = 7, /* type ID in target kernel */ ++ BPF_CORE_TYPE_EXISTS = 8, /* type existence in target kernel */ ++ BPF_CORE_TYPE_SIZE = 9, /* type size in bytes */ ++ BPF_CORE_ENUMVAL_EXISTS = 10, /* enum value existence in target kernel */ ++ BPF_CORE_ENUMVAL_VALUE = 11, /* enum value integer value */ ++}; ++ ++/* ++ * "struct bpf_core_relo" is used to pass relocation data form LLVM to libbpf ++ * and from libbpf to the kernel. ++ * ++ * CO-RE relocation captures the following data: ++ * - insn_off - instruction offset (in bytes) within a BPF program that needs ++ * its insn->imm field to be relocated with actual field info; ++ * - type_id - BTF type ID of the "root" (containing) entity of a relocatable ++ * type or field; ++ * - access_str_off - offset into corresponding .BTF string section. String ++ * interpretation depends on specific relocation kind: ++ * - for field-based relocations, string encodes an accessed field using ++ * a sequence of field and array indices, separated by colon (:). It's ++ * conceptually very close to LLVM's getelementptr ([0]) instruction's ++ * arguments for identifying offset to a field. ++ * - for type-based relocations, strings is expected to be just "0"; ++ * - for enum value-based relocations, string contains an index of enum ++ * value within its enum type; ++ * - kind - one of enum bpf_core_relo_kind; ++ * ++ * Example: ++ * struct sample { ++ * int a; ++ * struct { ++ * int b[10]; ++ * }; ++ * }; ++ * ++ * struct sample *s = ...; ++ * int *x = &s->a; // encoded as "0:0" (a is field #0) ++ * int *y = &s->b[5]; // encoded as "0:1:0:5" (anon struct is field #1, ++ * // b is field #0 inside anon struct, accessing elem #5) ++ * int *z = &s[10]->b; // encoded as "10:1" (ptr is used as an array) ++ * ++ * type_id for all relocs in this example will capture BTF type id of ++ * `struct sample`. ++ * ++ * Such relocation is emitted when using __builtin_preserve_access_index() ++ * Clang built-in, passing expression that captures field address, e.g.: ++ * ++ * bpf_probe_read(&dst, sizeof(dst), ++ * __builtin_preserve_access_index(&src->a.b.c)); ++ * ++ * In this case Clang will emit field relocation recording necessary data to ++ * be able to find offset of embedded `a.b.c` field within `src` struct. ++ * ++ * [0] https://llvm.org/docs/LangRef.html#getelementptr-instruction ++ */ ++struct bpf_core_relo { ++ __u32 insn_off; ++ __u32 type_id; ++ __u32 access_str_off; ++ enum bpf_core_relo_kind kind; ++}; ++#endif /* HAVE_EXTERNAL_LIBBPF */ ++ + /* The minimum bpf_func_info checked by the loader */ + struct bpf_func_info_min { + uint32_t insn_off; diff --git a/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch new file mode 100644 index 0000000000000000000000000000000000000000..4d5ceda57d3619256d3d597fd97ee790b7b3b107 --- /dev/null +++ b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch @@ -0,0 +1,35 @@ +From cb3f032b55b32c50201862b26c76ea18ad37cb39 Mon Sep 17 00:00:00 2001 +From: Ovidiu Panait +Date: Thu, 30 Jan 2020 14:19:33 +0200 +Subject: [PATCH] python/CMakeLists.txt: Remove check for host + /etc/debian_version + +Fix the following error that occurs during do_install when using the native +version of python3: +usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] + or: setup.py --help [cmd1 cmd2 ...] + or: setup.py --help-commands + or: setup.py cmd --help + +error: option --install-layout not recognized + +Upstream-status: Innapropriate [oe-specific] + +Signed-off-by: Ovidiu Panait +--- + src/python/CMakeLists.txt | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/src/python/CMakeLists.txt ++++ b/src/python/CMakeLists.txt +@@ -5,10 +5,6 @@ if(NOT PYTHON_CMD) + set(PYTHON_CMD "python3") + endif() + +-if(EXISTS "/etc/debian_version") +- set(PYTHON_FLAGS "${PYTHON_FLAGS} --install-layout deb") +-endif() +- + file(GLOB_RECURSE PYTHON_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.py) + file(GLOB_RECURSE PYTHON_INCLUDES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch new file mode 100644 index 0000000000000000000000000000000000000000..6ac72195b7f447cf2b729c5c72e657179c9f4ac0 --- /dev/null +++ b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch @@ -0,0 +1,41 @@ +From a9f59fc8605de1bcca0b6c2d8132585f40c3b9bc Mon Sep 17 00:00:00 2001 +From: He Zhe +Date: Thu, 13 Aug 2020 11:25:58 +0800 +Subject: [PATCH] tools/trace.py: Fix failing to exit + +Class Probe::print_event is used as a callback of a ctypes wrapper. With +Yocto latest python v3.8.5, the exception raised by exit() is ignored and +thus trace cannot exit. Use os._exit(0) instead. + +$ /usr/share/bcc/tools/trace do_sys_open -M 1 +PID TID COMM FUNC +3740 3740 irqbalance do_sys_open +Exception ignored on calling ctypes callback function: +.raw_cb at 0x7f7c9efea280> +Traceback (most recent call last): +File "/usr/lib64/python3.8/site-packages/bcc/table.py", line 685, in raw_cb_ +callback(cpu, data, size) +File "/usr/share/bcc/tools/trace", line 630, in print_event +exit() +File "/usr/lib64/python3.8/sitebuiltins.py", line 26, in __call_ +raise SystemExit(code) +SystemExit: None + +Upstream-Status: Pending + +Signed-off-by: He Zhe +--- + tools/trace.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/trace.py ++++ b/tools/trace.py +@@ -671,7 +671,7 @@ BPF_PERF_OUTPUT(%s); + if self.aggregate: + self.print_aggregate_events() + sys.stdout.flush() +- exit() ++ os._exit(0) + + def attach(self, bpf, verbose): + if len(self.library) == 0: diff --git a/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/ptest_wrapper.sh b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/ptest_wrapper.sh new file mode 100644 index 0000000000000000000000000000000000000000..92d015614c81ee43c9d84fe4426420f1a5134ee8 --- /dev/null +++ b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/ptest_wrapper.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Simple OE specific wrapper for bcc python tests + +name=$1 +kind=$2 +cmd=$3 +shift 3 + +case $kind in + simple|sudo) + $cmd "$@" + ;; + *) + echo "Invalid kind $kind of test $name" + exit 1 +esac diff --git a/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest new file mode 100644 index 0000000000000000000000000000000000000000..a27f6976b029722a296be044738b27f9ee71a625 --- /dev/null +++ b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/run-ptest @@ -0,0 +1,42 @@ +#!/bin/sh + +cd tests || exit 1 + +PASS_CNT=0 +FAIL_CNT=0 +FAILED="" + +print_test_result() { + if [ $? -eq 0 ]; then + echo PASS: "$1" + PASS_CNT=$((PASS_CNT + 1)) + else + echo FAIL: "$1" + FAIL_CNT=$((FAIL_CNT + 1)) + FAILED="$FAILED $1;" + fi +} + +# Run CC tests, set IFS as test names have spaces +IFS=$(printf '\n\t') +for test_name in $(./cc/test_libbcc_no_libbpf --list-test-names-only); do + ./cc/test_libbcc_no_libbpf "$test_name" > /dev/null 2>&1 + print_test_result "cc $test_name" +done +unset IFS + +# Run python tests, skip namespace tests as they currently don't work +if cmake -DCMAKE_TESTING_ENABLED=ON -DTEST_WRAPPER="$(pwd)/ptest_wrapper.sh" python > /dev/null 2>&1; then + for test_name in $(awk -F '[( ]' '/^add_test/ && !/namespace/ {print $2}' CTestTestfile.cmake); do + ctest -Q -R "$test_name" + print_test_result "python $test_name" + done +else + print_test_result "cmake error, couldn't start python tests" +fi + +echo "#### bcc tests summary ####" +echo "# TOTAL: $((PASS_CNT + FAIL_CNT))" +echo "# PASS: $PASS_CNT" +echo "# FAIL: $FAIL_CNT ($FAILED)" +echo "###########################" diff --git a/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.25.0.bb b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.25.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..cdacbb29c5444bd1e45918f5ce4b355216b71e62 --- /dev/null +++ b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.25.0.bb @@ -0,0 +1,71 @@ +SUMMARY = "BPF Compiler Collection (BCC)" +HOMEPAGE = "https://github.com/iovisor/bcc" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c29e" + +inherit cmake python3native manpages ptest + +DEPENDS += "bison-native \ + flex-native \ + flex \ + elfutils \ + ${LUAJIT} \ + clang \ + libbpf \ + " + +LUAJIT ?= "luajit" +LUAJIT:powerpc64le = "" +LUAJIT:powerpc64 = "" +LUAJIT:riscv64 = "" + +RDEPENDS:${PN} += "bash python3 python3-core python3-setuptools xz" +RDEPENDS:${PN}-ptest = "cmake python3 python3-distutils python3-netaddr python3-pyroute2" + +SRC_URI = "gitsm://github.com/iovisor/bcc;branch=master;protocol=https \ + file://0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch \ + file://0001-tools-trace.py-Fix-failing-to-exit.patch \ + file://0001-CMakeLists.txt-override-the-PY_CMD_ESCAPED.patch \ + file://0001-Vendor-just-enough-extra-headers-to-allow-libbpf-to-.patch \ + file://run-ptest \ + file://ptest_wrapper.sh \ + " + +SRCREV = "711f03024d776d174874b1f833dac0597f22a49a" + +PV .= "+git${SRCPV}" + +S = "${WORKDIR}/git" + +PACKAGECONFIG ??= "examples" +PACKAGECONFIG:remove:libc-musl = "examples" + +PACKAGECONFIG[manpages] = "-DENABLE_MAN=ON,-DENABLE_MAN=OFF," +PACKAGECONFIG[examples] = "-DENABLE_EXAMPLES=ON,-DENABLE_EXAMPLES=OFF," + +EXTRA_OECMAKE = " \ + -DCMAKE_USE_LIBBPF_PACKAGE=ON \ + -DENABLE_LLVM_SHARED=ON \ + -DENABLE_CLANG_JIT=ON \ + -DLLVM_PACKAGE_VERSION=${LLVMVERSION} \ + -DPYTHON_CMD=${PYTHON} \ + -DPYTHON_FLAGS=--install-lib=${PYTHON_SITEPACKAGES_DIR} \ +" + +do_install:append() { + sed -e 's@#!/usr/bin/python@#!/usr/bin/env python3@g' \ + -i $(find ${D}${datadir}/${PN} -type f) +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests/cc + install ${B}/tests/cc/test_libbcc_no_libbpf ${B}/tests/cc/libusdt_test_lib.so ${D}${PTEST_PATH}/tests/cc + cp -rf ${S}/tests/python ${D}${PTEST_PATH}/tests/python + install ${WORKDIR}/ptest_wrapper.sh ${D}${PTEST_PATH}/tests + install ${S}/examples/networking/simulation.py ${D}${PTEST_PATH}/tests/python +} + +FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}" +FILES:${PN}-doc += "${datadir}/${PN}/man" + +COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" diff --git a/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest new file mode 100644 index 0000000000000000000000000000000000000000..bab30339881119fb218ffcb4d85e5f86caac842e --- /dev/null +++ b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace/run-ptest @@ -0,0 +1,50 @@ +#!/bin/sh + +# The whole test suite may take up to 40 minutes to run, so setting -t 2400 +# parameter in ptest-runner is necessary to not kill it before completion + +cd tests || exit 1 +export BPFTRACE_RUNTIME_TEST_EXECUTABLE=/usr/bin + +PASS_CNT=0 +FAIL_CNT=0 +SKIP_CNT=0 +FAILED="" + +print_test_result() { + if [ $? -eq 0 ]; then + echo "PASS: $1" + PASS_CNT=$((PASS_CNT + 1)) + else + echo "FAIL: $1" + FAIL_CNT=$((FAIL_CNT + 1)) + FAILED="${FAILED:+$FAILED }$1;" + fi + } + +IFS=$(printf '\n\t') +# Start unit tests +for test_name in $(./bpftrace_test --gtest_list_tests | grep -v "^ "); do + ./bpftrace_test --gtest_filter="${test_name}*" > /dev/null 2>&1 + print_test_result "unit:$test_name" +done + +# Start runtime tests +for test_name in $(ls runtime); do + # Ignore test cases that hang the suite forever (bpftrace v0.16.0) + if [ "$test_name" = "signals" ] || [ "$test_name" = "watchpoint" ]; then + echo "SKIP: runtime:$test_name" + SKIP_CNT=$((SKIP_CNT + 1)) + continue + fi + python3 runtime/engine/main.py --filter="${test_name}.*" > /dev/null 2>&1 + print_test_result "runtime:$test_name" +done +unset IFS + +echo "#### bpftrace tests summary ####" +echo "# TOTAL: $((PASS_CNT + FAIL_CNT + SKIP_CNT))" +echo "# PASS: $PASS_CNT" +echo "# FAIL: $FAIL_CNT ($FAILED)" +echo "# SKIP: $SKIP_CNT" +echo "################################" diff --git a/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.16.0.bb b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.16.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..ca324bc1b9a4ba9f7ae785c760cf22af7e87cf4c --- /dev/null +++ b/meta-clang/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.16.0.bb @@ -0,0 +1,58 @@ +SUMMARY = "bpftrace" +HOMEPAGE = "https://github.com/iovisor/bpftrace" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" + +DEPENDS += "bison-native \ + flex-native \ + gzip-native \ + elfutils \ + bcc \ + systemtap \ + libcereal \ + libbpf \ + " + +PV .= "+git${SRCREV}" +RDEPENDS:${PN} += "bash python3 xz" + +SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \ + file://run-ptest \ +" +SRCREV = "a277ec42102c463d656df8f64eb2f7e87e322210" + +S = "${WORKDIR}/git" + +inherit cmake ptest + +PACKAGECONFIG ?= "${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" + +# Clang-15.x crashes compiling some usdt tests +# see https://github.com/llvm/llvm-project/issues/58477 +PACKAGECONFIG:remove:riscv64 = "tests" + +PACKAGECONFIG[tests] = "-DBUILD_TESTING=ON,-DBUILD_TESTING=OFF,gtest xxd-native" + +do_install_ptest() { + if [ -e ${B}/tests/bpftrace_test ]; then + install -Dm 755 ${B}/tests/bpftrace_test ${D}${PTEST_PATH}/tests/bpftrace_test + cp -rf ${B}/tests/runtime ${D}${PTEST_PATH}/tests + cp -rf ${B}/tests/test* ${D}${PTEST_PATH}/tests + fi +} + +def llvm_major_version(d): + pvsplit = d.getVar('LLVMVERSION').split('.') + return pvsplit[0] + +LLVM_MAJOR_VERSION = "${@llvm_major_version(d)}" + +EXTRA_OECMAKE = " \ + -DCMAKE_ENABLE_EXPORTS=1 \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_REQUESTED_VERSION=${LLVM_MAJOR_VERSION} \ + -DENABLE_MAN=OFF \ +" + +COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux" +COMPATIBLE_HOST:libc-musl = "null" diff --git a/meta-clang/dynamic-layers/openembedded-layer/recipes-kernel/kernel-selftest/kernel-selftest.bbappend b/meta-clang/dynamic-layers/openembedded-layer/recipes-kernel/kernel-selftest/kernel-selftest.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..580d98bf9a7639af76520698036c234f0b105c24 --- /dev/null +++ b/meta-clang/dynamic-layers/openembedded-layer/recipes-kernel/kernel-selftest/kernel-selftest.bbappend @@ -0,0 +1,4 @@ +DEPENDS:append = " clang-native" +DEPENDS:remove = "llvm-native" + +EXCLUDE_FROM_WORLD:forcevariable = "" diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/10-adbd-configfs.conf b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/10-adbd-configfs.conf new file mode 100644 index 0000000000000000000000000000000000000000..ddf155a907bc0e81b220d77ff03d67bca6c97d24 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/10-adbd-configfs.conf @@ -0,0 +1,4 @@ +[Service] +ExecStartPre=/usr/bin/android-gadget-setup +ExecStartPost=/usr/bin/android-gadget-start +ExecStopPost=/usr/bin/android-gadget-cleanup diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-cleanup b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-cleanup new file mode 100644 index 0000000000000000000000000000000000000000..517227d4a636cc78eb1d7c7b2c47adf033851f9b --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-cleanup @@ -0,0 +1,24 @@ +#!/bin/sh + +[ -d /sys/kernel/config/usb_gadget ] || exit 0 + +cd /sys/kernel/config/usb_gadget + +cd adb + +echo "" > UDC || true + +killall adbd || true + +umount /dev/usb-ffs/adb + +rm configs/c.1/ffs.usb0 + +rmdir configs/c.1/strings/0x409 +rmdir configs/c.1 + +rmdir functions/ffs.usb0 +rmdir strings/0x409 + +cd .. +rmdir adb diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-setup b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-setup new file mode 100644 index 0000000000000000000000000000000000000000..e44d1bacbe3a8c5ac4335f5b214b22d73c7adb2f --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-setup @@ -0,0 +1,35 @@ +#!/bin/sh + +set -e + +manufacturer=RPB +model="Android device" +serial=0123456789ABCDEF + +if [ -r /etc/android-gadget-setup.machine ] ; then + . /etc/android-gadget-setup.machine +fi + +[ -d /sys/kernel/config/usb_gadget ] || modprobe libcomposite + +cd /sys/kernel/config/usb_gadget + +[ -d adb ] && /usr/bin/android-gadget-cleanup || true + +mkdir adb +cd adb + +mkdir configs/c.1 +mkdir functions/ffs.usb0 +mkdir strings/0x409 +mkdir configs/c.1/strings/0x409 +echo 0x18d1 > idVendor +echo 0xd002 > idProduct +echo "$serial" > strings/0x409/serialnumber +echo "$manufacturer" > strings/0x409/manufacturer +echo "$model" > strings/0x409/product +echo "Conf 1" > configs/c.1/strings/0x409/configuration +ln -s functions/ffs.usb0 configs/c.1 + +mkdir -p /dev/usb-ffs/adb +mount -t functionfs usb0 /dev/usb-ffs/adb diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-start b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-start new file mode 100644 index 0000000000000000000000000000000000000000..ca6c3df275369b8616856c76af345e9beaf01f98 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs/android-gadget-start @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +sleep 3 + +ls /sys/class/udc/ > /sys/kernel/config/usb_gadget/adb/UDC diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs_1.0.bb b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs_1.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..3f9d49a2d293f5e7b3d94325d57d5512126eb3b3 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf-configfs_1.0.bb @@ -0,0 +1,35 @@ +DESCRIPTION = "Different utilities from Android - corressponding configuration files for using ConfigFS" +SECTION = "console/utils" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = " \ + file://android-gadget-setup \ + file://android-gadget-start \ + file://android-gadget-cleanup \ + file://10-adbd-configfs.conf \ +" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/android-gadget-setup ${D}${bindir} + install -m 0755 ${WORKDIR}/android-gadget-start ${D}${bindir} + install -m 0755 ${WORKDIR}/android-gadget-cleanup ${D}${bindir} + + if [ -r ${WORKDIR}/android-gadget-setup.machine ] ; then + install -d ${D}${sysconfdir} + install -m 0644 ${WORKDIR}/android-gadget-setup.machine ${D}${sysconfdir} + fi + + install -d ${D}${systemd_unitdir}/system/android-tools-adbd.service.d + install -m 0644 ${WORKDIR}/10-adbd-configfs.conf ${D}${systemd_unitdir}/system/android-tools-adbd.service.d +} + +FILES:${PN} += " \ + ${systemd_unitdir}/system/ \ +" + +PROVIDES += "android-tools-conf" +RPROVIDES:${PN} = "android-tools-conf" diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup new file mode 100644 index 0000000000000000000000000000000000000000..26cf30edddfed1b0fceb0f25f86dc73094dea625 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf/android-gadget-setup @@ -0,0 +1,37 @@ +#!/bin/sh + +[ ! -e /dev/pts ] && mkdir -p /dev/pts +[ ! -e /dev/pts/0 ] && mount devpts /dev/pts -t devpts + +# TODO enable the lines below once we have support for getprop +# retrieve the product info from Android +# manufacturer=$(getprop ro.product.manufacturer Android) +# model=$(getprop ro.product.model Android) +# serial=$(getprop ro.serialno 0123456789ABCDEF) + +#below are now needed in order to use FunctionFS for ADB, tested to work with 3.4+ kernels +if grep -q functionfs /proc/filesystems; then + mkdir -p /dev/usb-ffs/adb + mount -t functionfs adb /dev/usb-ffs/adb + #android-gadget-setup doesn't provide below 2 and without them it won't work, so we provide them here. + echo adb > /sys/class/android_usb/android0/f_ffs/aliases + echo ffs > /sys/class/android_usb/android0/functions +fi + +manufacturer="$(cat /system/build.prop | grep -o 'ro.product.manufacturer=.*' | cut -d'=' -f 2)" +model="$(cat /system/build.prop | grep -o 'ro.product.model=.*' | cut -d'=' -f 2)" +# get the device serial number from /proc/cmdline directly(since we have no getprop on +# GNU/Linux) +serial="$(cat /proc/cmdline | sed 's/.*androidboot.serialno=//' | sed 's/ .*//')" + +echo $serial > /sys/class/android_usb/android0/iSerial +echo $manufacturer > /sys/class/android_usb/android0/iManufacturer +echo $model > /sys/class/android_usb/android0/iProduct + +echo "0" > /sys/class/android_usb/android0/enable +echo "18d1" > /sys/class/android_usb/android0/idVendor +echo "D002" > /sys/class/android_usb/android0/idProduct +echo "adb" > /sys/class/android_usb/android0/functions +echo "1" > /sys/class/android_usb/android0/enable + +sleep 4 diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf_1.0.bb b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf_1.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..34b1a9bdd2898fead396055822b836db8aa94bbe --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools-conf_1.0.bb @@ -0,0 +1,20 @@ +DESCRIPTION = "Different utilities from Android - corressponding configuration files" +SECTION = "console/utils" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "file://android-gadget-setup" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/android-gadget-setup ${D}${bindir} +} + +python () { + pn = d.getVar('PN') + profprov = d.getVar("PREFERRED_PROVIDER_" + pn) + if profprov and pn != profprov: + raise bb.parse.SkipRecipe("PREFERRED_PROVIDER_%s set to %s, not %s" % (pn, profprov, pn)) +} diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/adb_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/adb_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..8c07e133ac703e29bf88bd5d3660a7569ee14ec2 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/adb_mk_change_out_dir.patch @@ -0,0 +1,50 @@ +patching adb.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending +--- git/system/core/debian/adb.mk 2021-04-29 21:11:00.617892503 +0200 ++++ git/system/core/debian/adb.mk 2021-04-29 21:17:33.256016600 +0200 +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = adb + + SOURCES = client/adb_client.cpp \ +@@ -12,10 +13,10 @@ + + SOURCES := $(foreach source, $(SOURCES), adb/$(source)) + CXXFLAGS += -std=gnu++2a +-CPPFLAGS += -Iinclude -Iadb -Ibase/include \ ++CPPFLAGS += -Iinclude -Iadb -Ibase/include -I$(OUT_DIR)/usr/include/ \ + -DADB_VERSION='"$(DEB_VERSION)"' -DADB_HOST=1 -D_GNU_SOURCE +-LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=. \ +- -lpthread -L. -ladb -lbase ++LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ ++ -lpthread -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -ladb -lbase + + # -latomic should be the last library specified + # https://github.com/android/ndk/issues/589 +@@ -24,7 +25,8 @@ + endif + + build: $(SOURCES) +- $(CXX) $^ -o adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) + + clean: +- $(RM) adb/$(NAME) ++ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME) diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/android-tools-adbd.service b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/android-tools-adbd.service new file mode 100644 index 0000000000000000000000000000000000000000..ddf8d7f74e32f815612e42f62a366effb7db73e6 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/android-tools-adbd.service @@ -0,0 +1,13 @@ +[Unit] +Description=Android Debug Bridge +ConditionPathExists=/var/usb-debugging-enabled +Before=android-system.service + +[Service] +Type=simple +Restart=on-failure +ExecStartPre=-/usr/bin/android-gadget-setup adb +ExecStart=/usr/bin/adbd + +[Install] +WantedBy=basic.target diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/fastboot_compile_remove_gtest.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/fastboot_compile_remove_gtest.patch new file mode 100644 index 0000000000000000000000000000000000000000..a04f27f1070d004ba31ed5040cbfaf733dff590c --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/fastboot_compile_remove_gtest.patch @@ -0,0 +1,51 @@ +socket.h: removing dependency of gtest + +Removed the dependency of gtest on the build of fastboot binary. +Fixes below error + +In file included from fastboot/fastboot.cpp:70: +| In file included from fastboot/tcp.h:36: +| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found +| #include +| ^~~~~~~~~~~~~~~~~~~~ +| 1 error generated. +| In file included from fastboot/socket.cpp:29: +| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found +| #include +| ^~~~~~~~~~~~~~~~~~~~ +| 1 error generated. +| In file included from fastboot/tcp.cpp:29: +| In file included from fastboot/tcp.h:36: +| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found +| #include +| ^~~~~~~~~~~~~~~~~~~~ +| 1 error generated. +| In file included from fastboot/udp.cpp:31: +| In file included from fastboot/udp.h:34: +| fastboot/socket.h:43:10: fatal error: 'gtest/gtest_prod.h' file not found +| #include +| ^~~~~~~~~~~~~~~~~~~~ +| 1 error generated. + + +Signed-off-by: Nisha Parrakat + +--- a/system/core/fastboot/socket.h 2021-04-14 21:14:00.355973915 +0000 ++++ b/system/core/fastboot/socket.h 2021-04-14 21:14:21.879680699 +0000 +@@ -40,7 +40,6 @@ + + #include + #include +-#include + + // Socket interface to be implemented for each platform. + class Socket { +@@ -119,8 +118,6 @@ + socket_send_buffers_function_ = &socket_send_buffers; + + private: +- FRIEND_TEST(SocketTest, TestTcpSendBuffers); +- FRIEND_TEST(SocketTest, TestUdpSendBuffers); + + DISALLOW_COPY_AND_ASSIGN(Socket); + }; diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch new file mode 100644 index 0000000000000000000000000000000000000000..d8c74be1010f86a38383cd3455b05d14ff6249a5 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch @@ -0,0 +1,42 @@ +upstream commit taken as below +Original Issue link +https://android-review.googlesource.com/c/platform/system/core/+/1123485 + +Commit taken below: + +fastboot: don't use sparse_file_import_auto() in load_buf_fd() + +load_buf_fd() attempts to find the size of the file that it is about +to load by first calling sparse_file_import_auto() then using +sparse_file_len() upon success or falling back to the file size on the +filesystem on failure. + +This is problematic however as sparse_file_import_auto() creates a +sparse_file out of the normal file, but does not resparse it, so an +assertion fails during the sparse_file_len() call. + +This is fixed by using sparse_file_import() instead. This will fail +in the case that the file is not sparse and the call to +sparse_file_len() will be properly skipped. + +Bug: 140538105 +Test: flash blueline factory image with assertions enabled in + libsparse/sparse.cpp + +Change-Id: I0283be33563a3301ce5b09bde41105a20f91086c + +https://android.googlesource.com/platform/system/core/+/fbb9535aaea5ae4011f3c3edf4c00b27452f57ec +Upstream-Status: Backport(commit fbb9535aaea5ae4011f3c3edf4c00b27452f57ec) +Signed-off-by: Nisha Parrakat + +--- git/system/core/fastboot/fastboot.cpp 2021-05-28 09:24:15.583963227 +0000 ++++ git/system/core/fastboot/fastboot.cpp 2021-05-28 09:25:09.948974990 +0000 +@@ -869,7 +869,7 @@ + return false; + } + +- if (sparse_file* s = sparse_file_import_auto(fd, false, false)) { ++ if (sparse_file* s = sparse_file_import(fd, false, false)) { + buf->image_size = sparse_file_len(s, false, false); + sparse_file_destroy(s); + } else { diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/fastboot_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/fastboot_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..c8904f0451c193c20522949481df44a654cccecf --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/fastboot_mk_change_out_dir.patch @@ -0,0 +1,52 @@ +patching fastboot.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending + +--- git/system/core/debian/fastboot.mk 2021-05-17 07:47:56.800224043 +0000 ++++ git/system/core/debian/fastboot.mk 2021-05-17 07:49:40.130383096 +0000 +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = fastboot + fastboot_SOURCES = \ + bootimg_utils.cpp \ +@@ -38,11 +39,11 @@ + -Ifs_mgr/liblp/include \ + -I/usr/include/android/openssl \ + -Ilibsparse/include \ +- -Ilibziparchive/include ++ -Ilibziparchive/include -I$(OUT_DIR)/usr/include/ + LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ + -fuse-ld=gold \ +- -Wl,-rpath-link=. \ +- -L. -lziparchive -lsparse -lbase -lcutils -ladb -lcrypto -lext4_utils \ ++ -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lziparchive -lsparse -lbase -lcutils -ladb -lcrypto -lext4_utils \ + -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ + -l7z \ + +@@ -53,7 +54,8 @@ + endif + + build: $(SOURCES) +- $(CXX) $^ -o fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ mkdir --parents $(OUT_DIR)/usr/bin/fastboot ++ $(CXX) $^ -o $(OUT_DIR)/usr/bin/fastboot/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) + + clean: +- $(RM) fastboot/$(NAME) ++ $(RM) $(OUT_DIR)/usr/bin/fastboot/$(NAME) diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/img2simg_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/img2simg_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..6913c4b98bfedc7c15e769579b4a66de61f2b939 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/img2simg_change_out_dir.patch @@ -0,0 +1,41 @@ +patching img2simg.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending + +--- git/system/core/debian/img2simg.mk 2021-05-12 09:05:38.580607289 +0000 ++++ git/system/core/debian/img2simg.mk 2021-05-12 09:09:04.331908253 +0000 +@@ -1,13 +1,14 @@ ++include ../../rules_yocto.mk + NAME = img2simg + SOURCES = img2simg.cpp + SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) + CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 +-LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -Wl,-rpath-link=. \ +- -L. -lsparse ++LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -lsparse + + build: $(SOURCES) +- $(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS) ++ $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS) + + clean: +- $(RM) libsparse/$(NAME) ++ $(RM) $(OUT_DIR)/usr/bin/$(NAME) diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libadb_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libadb_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..7094ccaa9a8136c8d2386a05a5623631ba3d823e --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libadb_mk_change_out_dir.patch @@ -0,0 +1,44 @@ +libadb.mk: modifications to make it build in yocto environment + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +--- git/system/core/debian/libadb.mk 2021-04-30 16:29:34.596618862 +0200 ++++ git/system/core/debian/libadb.mk 2021-04-30 16:36:53.932837490 +0200 +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME := libadb + + LIBADB_SRC_FILES := \ +@@ -43,18 +44,18 @@ + -Ibase/include \ + -Idiagnose_usb/include \ + -Ilibcrypto_utils/include \ +- -Iinclude \ ++ -Iinclude -I$(OUT_DIR)/usr/include \ + -DPLATFORM_TOOLS_VERSION='"$(PLATFORM_TOOLS_VERSION)"' \ + -DADB_HOST=1 -DADB_VERSION='"$(DEB_VERSION)"' + + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android -lcrypto \ +- -lpthread -L. -lbase -lcutils -lcrypto_utils -lusb-1.0 ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lcrypto \ ++ -lpthread -lbase -lcutils -lcrypto_utils -lusb-1.0 + + $(NAME).so: $(SOURCES) +- $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so + + transport_mdns_unsupported.cpp: + echo 'void init_mdns_transport_discovery(void) {}' > transport_mdns_unsupported.cpp diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libbacktrace_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libbacktrace_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..464b63de2fb508e5c63fb52e7322e77622028606 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libbacktrace_mk_change_out_dir.patch @@ -0,0 +1,60 @@ +patching libbacktrace.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending + +--- git/system/core/debian/libbacktrace.mk 2021-05-21 23:51:55.022408433 +0000 ++++ git/system/core/debian/libbacktrace.mk 2021-05-21 23:53:07.487543521 +0000 +@@ -1,5 +1,6 @@ +- +-include /usr/share/dpkg/architecture.mk ++include ../../rules_yocto.mk ++#pass architecture specific info to makefile ++DEB_HOST_ARCH=${deb_host_arch} + + NAME = libbacktrace + +@@ -88,11 +89,11 @@ + -Ilibprocinfo/include \ + -Ilibunwindstack/include \ + -I/usr/include/android/lzma \ +- -I/usr/include/android/unwind ++ -I$(OUT_DIR)/usr/include/android/libunwind + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android -lunwind \ +- -L. -lbase -llog -lpthread -l7z ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lunwind \ ++ -lbase -llog -lpthread -l7z + + # -latomic should be the last library specified + # https://github.com/android/ndk/issues/589 +@@ -104,11 +105,11 @@ + endif + + build: $(COBJECTS) $(CXXOBJECTS) $(OBJECTS_ASSEMBLY) +- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) ++ ln -s $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(NAME).so + + clean: +- $(RM) $(COBJECTS) $(CXXOBJECTS) $(NAME).so* ++ $(RM) $(COBJECTS) $(CXXOBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* + + $(CXXOBJECTS): %.o: %.cpp + $(CXX) $< -o $@ $(CXXFLAGS) $(CPPFLAGS) diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libbase_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libbase_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..37c93d6d07a1fa4752974b6199e410bf5f466af9 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libbase_mk_change_out_dir.patch @@ -0,0 +1,33 @@ +libbase.mk: modifications to make it build in yocto environment + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +--- git/system/core/debian/libbase.mk 2021-04-29 22:01:13.664181133 +0200 ++++ git/system/core/debian/libbase.mk 2021-04-29 22:04:52.328123833 +0200 +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libbase + SOURCES = \ + chrono_utils.cpp \ +@@ -20,8 +21,9 @@ + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 + + build: $(SOURCES) +- $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r base/include/* $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(NAME).so* ++ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libcrypto_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libcrypto_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..f705909773164f3ceb6581e31d35b56d80013f1a --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libcrypto_mk_change_out_dir.patch @@ -0,0 +1,30 @@ +libcrypto.mk: modifications to make it build in yocto environment + +Adding an include file that is setting the common flags. + +Modified the build rule so that it outputs the binary and include +to the OUT_DIR + + +Signed-off-by: Nisha Parrakat + +--- git/external/boringssl/debian/libcrypto.mk 2021-04-30 11:32:40.610312307 +0000 ++++ git/external/boringssl/debian/libcrypto.mk 2021-04-30 11:36:47.738318880 +0000 +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + include sources.mk + + NAME = libcrypto +@@ -26,6 +27,8 @@ + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 -lpthread + + build: $(SOURCES) +- mkdir --parents debian/out +- $(CC) $^ -o debian/out/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 debian/out/$(NAME).so +\ No newline at end of file ++ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ ++ mkdir --parents $(OUT_DIR)/usr/include ++ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DOPENSSL_NO_ASM ++ ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r include/openssl $(OUT_DIR)/usr/include diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libcrypto_utils_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libcrypto_utils_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..a0dd348767be42dbe559411a5ee73fe21a2bb3e4 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libcrypto_utils_mk_change_out_dir.patch @@ -0,0 +1,38 @@ +libcrypto_utils.mk: modifications to make it build in yocto environment + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary and header to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +--- git/system/core/debian/libcrypto_utils.mk 2021-04-30 14:18:54.071379767 +0200 ++++ git/system/core/debian/libcrypto_utils.mk 2021-04-30 14:22:46.179047308 +0200 +@@ -1,15 +1,17 @@ ++include ../../rules_yocto.mk + NAME:= libcrypto_utils + SOURCES := android_pubkey.c + SOURCES := $(foreach source, $(SOURCES), libcrypto_utils/$(source)) +-CPPFLAGS += -Ilibcrypto_utils/include -Iinclude ++CPPFLAGS += -Ilibcrypto_utils/include -Iinclude -I$(OUT_DIR)/usr/include + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ + -lcrypto -Wl,-z,defs + + build: $(SOURCES) +- $(CC) $^ -o $(NAME).so.0 $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CPPFLAGS) $(LDFLAGS) ++ ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r libcrypto_utils/include/* $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(NAME).so* ++ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libcutils_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libcutils_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..5539eb91d532a2e749803c43c375d5273bbbb62c --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libcutils_mk_change_out_dir.patch @@ -0,0 +1,27 @@ +--- git/system/core/debian/libcutils.mk 2021-05-17 06:38:40.105161629 +0000 ++++ git/system/core/debian/libcutils.mk 2021-05-17 06:42:37.141912366 +0000 +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libcutils + + # copied from libcutils/Android.bp +@@ -50,14 +51,15 @@ + -Iinclude \ + + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ +- -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -lpthread -L. -llog -lbase ++ -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -lpthread -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -llog -lbase + + build: $(COBJECTS) $(CXXOBJECTS) +- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) ++ ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r libcutils/include/cutils $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* ++ $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* + + $(COBJECTS): %.o: %.c + $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libext4_utils_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libext4_utils_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..efccfab9c16b52a27fe7e07657295e37c9f8926c --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libext4_utils_mk_change_out_dir.patch @@ -0,0 +1,42 @@ +libext4_utils.mk: modifications to make it build in yocto environment + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary and header to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +--- git/system/extras/debian/libext4_utils.mk 2021-04-29 21:46:39.384394114 +0000 ++++ git/system/extras/debian/libext4_utils.mk 2021-04-29 21:49:53.808605543 +0000 +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libext4_utils + + ext4_utils_SOURCES := \ +@@ -17,14 +18,16 @@ + -Iext4_utils/include \ + -Ilibfec/include \ + -Isquashfs_utils \ +- -I/usr/include/android \ ++ -I/usr/include/android -I$(OUT_DIR)/usr/include \ + -D_GNU_SOURCE -DFEC_NO_KLOG -DSQUASHFS_NO_KLOG -D_LARGEFILE64_SOURCE + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ + -lbase -lsparse -lselinux + + build: $(SOURCES) +- mkdir --parents $(OUT_DIR) +- $(CC) $^ -o $(OUT_DIR)/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 $(OUT_DIR)/$(NAME).so ++ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ ++ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r ext4_utils/include/* $(OUT_DIR)/usr/include/ ++ diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libfec_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libfec_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..0f8184d41f6fdab9a802f5eb87a2e22d8cd2b38c --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libfec_mk_change_out_dir.patch @@ -0,0 +1,35 @@ +--- git/system/extras/debian/libfec.mk 2021-05-17 06:55:51.973044031 +0000 ++++ git/system/extras/debian/libfec.mk 2021-05-17 06:56:41.940185413 +0000 +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libfec + + # copied from libfec/Android.bp +@@ -12,20 +13,21 @@ + CXXFLAGS += -fno-strict-aliasing -std=g++17 + CPPFLAGS += \ + -Iext4_utils/include \ +- -Ilibfec/include \ ++ -Ilibfec/include -I $(OUT_DIR)/usr/include \ + -D_GNU_SOURCE -DFEC_NO_KLOG -D_LARGEFILE64_SOURCE + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ + -lbase -lsparse -lselinux + + build: $(COBJECTS) $(CXXOBJECTS) +- mkdir -p $(OUT_DIR) +- $(CXX) $^ -o $(OUT_DIR)/$(NAME).so.0 $(LDFLAGS) +- ln -s $(NAME).so.0 $(OUT_DIR)/$(NAME).so ++ mkdir -p $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) ++ ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r libfec/include/* $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* ++ $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* + + $(COBJECTS): %.o: %.c + $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/liblog_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/liblog_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..09ef1871b2a2d43faf87e4ab651f52af823661aa --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/liblog_mk_change_out_dir.patch @@ -0,0 +1,42 @@ +patching liblog.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending + +--- git/system/core/debian/liblog.mk 2021-05-17 08:13:28.304700936 +0000 ++++ git/system/core/debian/liblog.mk 2021-05-17 08:15:59.590064282 +0000 +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = liblog + + # copied from liblog/Android.bp +@@ -39,11 +40,12 @@ + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 -lpthread + + build: $(COBJECTS) $(CXXOBJECTS) +- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) ++ ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r liblog/include/* $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(COBJECTS) $(CXXOBJECTS) $(NAME).so* ++ $(RM) $(COBJECTS) $(CXXOBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* + + $(COBJECTS): %.o: %.c + $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libsparse_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libsparse_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..4f8bb44a4277c2484a11b878a453c2cc8e728619 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libsparse_mk_change_out_dir.patch @@ -0,0 +1,47 @@ +patching libsparse.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending + +--- git/system/core/debian/libsparse.mk 2021-05-17 08:13:34.764584388 +0000 ++++ git/system/core/debian/libsparse.mk 2021-05-17 08:15:34.850492654 +0000 +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libsparse + SOURCES = \ + backed_block.cpp \ +@@ -18,16 +19,16 @@ + -shared -Wl,-soname,$(NAME).so.0 \ + -lz \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -L. \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ + -lbase + + + build: $(COBJECTS) $(CXXOBJECTS) +- $(CXX) $^ -o $(NAME).so.0 $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(LDFLAGS) ++ ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so + + clean: +- $(RM) $(CXXOBJECTS) $(COBJECTS) $(NAME).so* ++ $(RM) $(CXXOBJECTS) $(COBJECTS) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* + + $(COBJECTS): %.o: %.c + $(CC) $< -o $@ $(CFLAGS) $(CPPFLAGS) diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libunwind_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libunwind_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..237d45c3cdfb2cec144251e325b6d50ac4db37bd --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libunwind_mk_change_out_dir.patch @@ -0,0 +1,47 @@ +patching libundwind to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Passing the architecture details($CPU)from the recipe. + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending + +--- git/external/libunwind/debian/libunwind.mk 2021-05-22 02:29:52.950324653 +0000 ++++ git/external/libunwind/debian/libunwind.mk 2021-05-22 02:30:48.535322846 +0000 +@@ -1,4 +1,4 @@ +-include debian/detect_arch.mk ++include ../../rules_yocto.mk + + ARCH_SOURCES = is_fpreg.c \ + regname.c \ +@@ -131,10 +131,12 @@ + CPPFLAGS += -Iinclude -Isrc $($(CPU)_INCLUDES) -Idebian/include + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -lpthread -nostdlib -lc -lgcc -Ldebian/out -l7z ++ -lpthread -nostdlib -lc -lgcc -l7z + + build: $(SOURCES) +- mkdir --parents debian/out +- ln -s /usr/lib/p7zip/7z.so debian/out/lib7z.so +- $(CC) $^ -o debian/out/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 debian/out/$(NAME).so ++ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ ++ mkdir --parents $(OUT_DIR)/usr/include/android/libunwind ++ $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wno-header-guard -Wno-absolute-value ++ ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r include/* debian/include/* $(OUT_DIR)/usr/include/android/libunwind/ ++ diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libziparchive_mk_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libziparchive_mk_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..cc9997dace215771f75558600e1bd148f52d2ad7 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/libziparchive_mk_change_out_dir.patch @@ -0,0 +1,47 @@ +patching libziparchive.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending + +--- git/system/core/debian/libziparchive.mk 2021-05-17 08:13:41.684459540 +0000 ++++ git/system/core/debian/libziparchive.mk 2021-05-17 08:16:19.293722572 +0000 +@@ -1,3 +1,4 @@ ++include ../../rules_yocto.mk + NAME = libziparchive + SOURCES = zip_archive.cc \ + zip_archive_stream_entry.cc\ +@@ -5,14 +6,15 @@ + SOURCES := $(foreach source, $(SOURCES), libziparchive/$(source)) + CXXFLAGS += -std=gnu++17 + CPPFLAGS += -DZLIB_CONST -D_FILE_OFFSET_BITS=64 \ +- -Iinclude -Ibase/include -Ilibziparchive/include ++ -Iinclude -Ibase/include -Ilibziparchive/include -I$(OUT_DIR)/usr/include/ + LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ + -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -lz -L. -llog -lbase ++ -lz -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -llog -lbase + + build: $(SOURCES) +- $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) +- ln -s $(NAME).so.0 $(NAME).so ++ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) ++ ln -s $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so ++ cp -r libziparchive/include/* $(OUT_DIR)/usr/include/ + + clean: +- $(RM) $(NAME).so* ++ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/rules_yocto.mk b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/rules_yocto.mk new file mode 100644 index 0000000000000000000000000000000000000000..5e217f47fc6d67bb37fd44ef332dc192195af848 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/rules_yocto.mk @@ -0,0 +1,4 @@ +CPPFLAGS += -fPIC +ifndef OUT_DIR +OUT_DIR = ../../debian/out +endif diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/simg2img_change_out_dir.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/simg2img_change_out_dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..d17adfffd23e8b02c11d6400bd70e389325447c1 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/simg2img_change_out_dir.patch @@ -0,0 +1,41 @@ +patching simg2img.mk to build in yocto environment. + +Changes include: +Introduced an output folder which will keep all the outputs from the +android-tools. + +Adding an include file that is setting the common flags. +Changed the cppflag to include the headers from other components +of android-tools + +Modified LDflags so that the libraries that are coming from other android-tools +are searched in the output folder. + +Modified the build rule so that it outputs the binary to the OUT_DIR + +Signed-off-by: Nisha Parrakat + +Upstream-Status: Pending + +--- git/system/core/debian/simg2img.mk 2021-05-12 09:47:52.577840520 +0000 ++++ git/system/core/debian/simg2img.mk 2021-05-12 09:51:43.525678276 +0000 +@@ -1,13 +1,14 @@ ++include ../../rules_yocto.mk + NAME = simg2img + SOURCES = simg2img.cpp sparse_crc32.cpp + SOURCES := $(foreach source, $(SOURCES), libsparse/$(source)) + CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17 +-LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ +- -Wl,-rpath-link=. \ +- -L. -lsparse ++LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \ ++ -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lsparse + + build: $(SOURCES) +- $(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS) ++ $(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS) + + clean: +- $(RM) libsparse/$(NAME) ++ $(RM) $(OUT_DIR)/usr/bin/$(NAME) diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools/use_name_space_std_to_compile_libbacktrace.patch b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/use_name_space_std_to_compile_libbacktrace.patch new file mode 100644 index 0000000000000000000000000000000000000000..079ade46b08a06444c2fde0cb7b4f87da213ef03 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools/use_name_space_std_to_compile_libbacktrace.patch @@ -0,0 +1,19 @@ +To Fix the below error + + In file included from libunwindstack/DwarfSection.cpp:21: +| libunwindstack/include/unwindstack/DwarfMemory.h:32:29: error: unknown type name 'size_t'; did you mean 'std::size_t'? +| bool ReadBytes(void* dst, size_t num_bytes); +| ^~~~~~ +| std::size_t + +--- ./system/core/libunwindstack/include/unwindstack/DwarfMemory.h 2021-05-22 00:52:15.132452862 +0000 ++++ ./system/core/libunwindstack/include/unwindstack/DwarfMemory.h 2021-05-22 00:53:09.793416724 +0000 +@@ -23,7 +23,7 @@ + + // Forward declarations. + class Memory; +- ++using namespace std; + class DwarfMemory { + public: + DwarfMemory(Memory* memory) : memory_(memory) {} diff --git a/meta-clang/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb b/meta-clang/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb new file mode 100644 index 0000000000000000000000000000000000000000..7fa7e308e9d843521ff3b595fa8cfc7136ff0534 --- /dev/null +++ b/meta-clang/dynamic-layers/selinux/android-tools/android-tools_10.0.0.r36.bb @@ -0,0 +1,205 @@ +DESCRIPTION = "Different utilities from Android" +SECTION = "console/utils" +LICENSE = "Apache-2.0 & GPL-2.0-only & BSD-2-Clause & BSD-3-Clause" +LIC_FILES_CHKSUM = " \ + file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10 \ + file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6 \ + file://${COMMON_LICENSE_DIR}/BSD-2-Clause;md5=cb641bc04cda31daea161b1bc15da69f \ + file://${COMMON_LICENSE_DIR}/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9 \ +" +DEPENDS = "libbsd libpcre zlib libcap libusb squashfs-tools p7zip libselinux" + +ANDROID_MIRROR = "android.googlesource.com" + +# matches with 10.0.0+r36 +SRCREV_boringssl = "ae2dd49c7cb74d04bdba7c1c9bd62c1e9cdf98f6" +SRCREV_core = "5aa13b053182b758d7a19db0c83e1b9b5bf1ec2e" +SRCREV_extras = "d31740f9d0399f8b938e88e58843d966e1cccab6" +SRCREV_libhardware = "c6925520342a7d37758f85eb1cf3baa20a7b7a18" +SRCREV_build = "28768b3120f751583a2743101b892f210d4715cf" +SRCREV_libunwind = "03a963ecf6ea836b38b3537cbcda0ecfd7a77393" + +SRC_URI = " \ + git://salsa.debian.org/android-tools-team/android-platform-external-boringssl;name=boringssl;protocol=https;nobranch=1;destsuffix=git/external/boringssl \ + git://salsa.debian.org/android-tools-team/android-platform-system-core;name=core;protocol=https;nobranch=1;destsuffix=git/system/core \ + git://salsa.debian.org/android-tools-team/android-platform-system-extras;name=extras;protocol=https;nobranch=1;destsuffix=git/system/extras \ + git://${ANDROID_MIRROR}/platform/hardware/libhardware;name=libhardware;protocol=https;nobranch=1;destsuffix=git/hardware/libhardware \ + git://salsa.debian.org/android-tools-team/android-platform-build.git;name=build;protocol=https;nobranch=1;destsuffix=git/build \ + git://salsa.debian.org/android-tools-team/android-platform-external-libunwind.git;protocol=https;name=libunwind;nobranch=1;destsuffix=git/external/libunwind \ + file://adb_mk_change_out_dir.patch \ + file://libadb_mk_change_out_dir.patch \ + file://fastboot_compile_remove_gtest.patch \ + file://fastboot_mk_change_out_dir.patch \ + file://fastboot_dont_use_sparse_file_import_auto_in_load_buf_fd.patch \ + file://libbase_mk_change_out_dir.patch \ + file://libext4_utils_mk_change_out_dir.patch \ + file://libcrypto_mk_change_out_dir.patch \ + file://libcrypto_utils_mk_change_out_dir.patch \ + file://libcutils_mk_change_out_dir.patch \ + file://libfec_mk_change_out_dir.patch \ + file://img2simg_change_out_dir.patch \ + file://simg2img_change_out_dir.patch \ + file://liblog_mk_change_out_dir.patch \ + file://libsparse_mk_change_out_dir.patch \ + file://libziparchive_mk_change_out_dir.patch \ + file://libbacktrace_mk_change_out_dir.patch \ + file://libunwind_mk_change_out_dir.patch \ + file://use_name_space_std_to_compile_libbacktrace.patch \ + file://rules_yocto.mk;subdir=git \ + file://android-tools-adbd.service \ +" + +S = "${WORKDIR}/git" +B = "${WORKDIR}/${BPN}" + +#apply all the patches maintained in the debian version. +do_unpack_and_patch_debian() { + cd ${S}/system/core + for i in `find ${S}/system/core/debian/patches -name "*.patch"`; do + patch -p1 < $i + done + #a patch with no .patch extention, lets apply that + patch -p1 < ${S}/system/core/debian/patches/Added-missing-headers + cd ${S}/external/libunwind + for i in `find ${S}/external/libunwind/debian/patches -name "*.patch"`; do + patch -p1 < $i + done +} +addtask unpack_and_patch_debian after do_unpack before do_patch + +# http://errors.yoctoproject.org/Errors/Details/1debian881/ +ARM_INSTRUCTION_SET:armv4 = "arm" +ARM_INSTRUCTION_SET:armv5 = "arm" + +COMPATIBLE_HOST:powerpc = "(null)" +COMPATIBLE_HOST:powerpc64 = "(null)" +COMPATIBLE_HOST:powerpc64le = "(null)" + +inherit systemd clang + +TOOLCHAIN = "clang" +DEPENDS += "\ + clang-cross-${TARGET_ARCH} \ +" + +SYSTEMD_SERVICE:${PN} = "android-tools-adbd.service" + +# Find libbsd headers during native builds +CC:append:class-native = " -I${STAGING_INCDIR}" +CC:append:class-nativesdk = " -I${STAGING_INCDIR}" + +PREREQUISITE_core = "libbase libsparse liblog libcutils" +TOOLS_TO_BUILD = "libcrypto_utils libadb libziparchive fastboot adb img2simg simg2img libbacktrace" + +# Adb needs sys/capability.h, which is not available for native* +TOOLS:class-native = "boringssl fastboot ext4_utils mkbootimg" +TOOLS:class-nativesdk = "boringssl fastboot ext4_utils mkbootimg" + +do_compile() { + + case "${HOST_ARCH}" in + arm) + export android_arch=linux-arm + cpu=arm + deb_host_arch=arm + ;; + aarch64) + export android_arch=linux-arm64 + cpu=arm64 + deb_host_arch=arm64 + ;; + riscv64) + export android_arch=linux-riscv64 + ;; + mips|mipsel) + export android_arch=linux-mips + cpu=mips + deb_host_arch=mips + ;; + mips64|mips64el) + export android_arch=linux-mips64 + cpu=mips64 + deb_host_arch=mips64 + ;; + powerpc|powerpc64) + export android_arch=linux-ppc + ;; + i586|i686|x86_64) + export android_arch=linux-x86 + cpu=x86_64 + deb_host_arch=amd64 + ;; + esac + + export SRCDIR=${S} + + oe_runmake -f ${S}/external/boringssl/debian/libcrypto.mk -C ${S}/external/boringssl + oe_runmake -f ${S}/external/libunwind/debian/libunwind.mk -C ${S}/external/libunwind CPU=${cpu} + + for tool in ${PREREQUISITE_core}; do + oe_runmake -f ${S}/system/core/debian/${tool}.mk -C ${S}/system/core + done + + for i in `find ${S}/system/extras/debian/ -name "*.mk"`; do + oe_runmake -f $i -C ${S}/system/extras + done + + for tool in ${TOOLS_TO_BUILD}; do + if tool == "libbacktrace"; then + oe_runmake -f ${S}/system/core/debian/${tool}.mk -C ${S}/system/core DEB_HOST_ARCH=${deb_host_arch} + else + oe_runmake -f ${S}/system/core/debian/${tool}.mk -C ${S}/system/core + fi + done + +} + +do_install() { + if echo ${TOOLS_TO_BUILD} | grep -q "ext4_utils" ; then + install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump + fi + + if echo ${TOOLS_TO_BUILD} | grep -q "adb " ; then + install -d ${D}${bindir} + install -m0755 ${S}/debian/out/usr/lib/android/adb/adb ${D}${bindir} + fi + + if echo ${TOOLS_TO_BUILD} | grep -q "adbd" ; then + install -d ${D}${bindir} + install -m0755 ${B}/adbd/adbd ${D}${bindir} + fi + + # Outside the if statement to avoid errors during do_package + install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \ + ${D}${systemd_unitdir}/system/android-tools-adbd.service + + if echo ${TOOLS_TO_BUILD} | grep -q "fastboot" ; then + install -d ${D}${bindir} + install -m0755 ${S}/debian/out/usr/bin/fastboot/fastboot ${D}${bindir} + fi + + install -d ${D}${libdir}/android/ + install -m0755 ${S}/debian/out/usr/lib/android/*.so.* ${D}${libdir}/android/ + if echo ${TOOLS_TO_BUILD} | grep -q "mkbootimg" ; then + install -d ${D}${bindir} + install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir} + fi +} + +PACKAGES += "${PN}-fstools" + +RDEPENDS:${BPN} = "${BPN}-conf p7zip" + +FILES:${PN}-fstools = "\ + ${bindir}/ext2simg \ + ${bindir}/ext4fixup \ + ${bindir}/img2simg \ + ${bindir}/make_ext4fs \ + ${bindir}/simg2img \ + ${bindir}/simg2simg \ + ${bindir}/simg_dump \ + ${bindir}/mkuserimg \ +" +FILES:${PN} += "${libdir}/android ${libdir}/android/*" + +BBCLASSEXTEND = "native" diff --git a/meta-clang/recipes-connectivity/openssl/openssl_%.bbappend b/meta-clang/recipes-connectivity/openssl/openssl_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..9112eadc1ed9631178b2c0c30e437297a28b2bbf --- /dev/null +++ b/meta-clang/recipes-connectivity/openssl/openssl_%.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +LDLIBS:append:toolchain-clang:riscv64 = " -latomic" +LDLIBS:append:toolchain-clang:riscv32 = " -latomic" + +do_configure:prepend:toolchain-clang () { + export LDLIBS="${LDLIBS}" +} diff --git a/meta-clang/recipes-core/glib-2.0/glib-2.0_%.bbappend b/meta-clang/recipes-core/glib-2.0/glib-2.0_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..2aef80ec79eabb2d21ce820943b4a0206374591c --- /dev/null +++ b/meta-clang/recipes-core/glib-2.0/glib-2.0_%.bbappend @@ -0,0 +1 @@ +CFLAGS:append:libc-musl = " -Wno-format-nonliteral" diff --git a/meta-clang/recipes-core/meta/clang-environment.inc b/meta-clang/recipes-core/meta/clang-environment.inc new file mode 100644 index 0000000000000000000000000000000000000000..7887610043f122c7538bd64cf65767075ed0a869 --- /dev/null +++ b/meta-clang/recipes-core/meta/clang-environment.inc @@ -0,0 +1,19 @@ +export TARGET_CLANGCC_ARCH = "${TARGET_CC_ARCH}" +TARGET_CLANGCC_ARCH:remove = "-mthumb-interwork" +TARGET_CLANGCC_ARCH:remove = "-mmusl" +TARGET_CLANGCC_ARCH:remove = "-muclibc" +TARGET_CLANGCC_ARCH:remove = "-meb" +TARGET_CLANGCC_ARCH:remove = "-mel" +TARGET_CLANGCC_ARCH:append = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mbig-endian", " -mlittle-endian", d)}" +TARGET_CLANGCC_ARCH:remove:powerpc = "-mhard-float" +TARGET_CLANGCC_ARCH:remove:powerpc = "-mno-spe" + +create_sdk_files:append() { + script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} + if ${@bb.utils.contains('CLANGSDK', '1', 'true', 'false', d)}; then + echo 'export CLANGCC="${TARGET_PREFIX}clang --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script + echo 'export CLANGCXX="${TARGET_PREFIX}clang++ --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script + echo 'export CLANGCPP="${TARGET_PREFIX}clang -E --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script + echo 'export CLANG_TIDY_EXE="${TARGET_PREFIX}clang-tidy"' >> $script + fi +} diff --git a/meta-clang/recipes-core/meta/meta-environment-extsdk.bbappend b/meta-clang/recipes-core/meta/meta-environment-extsdk.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d40a025e0eec0d12c7605e10079d74a13db3a7b6 --- /dev/null +++ b/meta-clang/recipes-core/meta/meta-environment-extsdk.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +require clang-environment.inc diff --git a/meta-clang/recipes-core/meta/meta-environment.bbappend b/meta-clang/recipes-core/meta/meta-environment.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d40a025e0eec0d12c7605e10079d74a13db3a7b6 --- /dev/null +++ b/meta-clang/recipes-core/meta/meta-environment.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +require clang-environment.inc diff --git a/meta-clang/recipes-core/musl/musl_%.bbappend b/meta-clang/recipes-core/musl/musl_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..514096879612efd4716357ed26c08a1580a0866e --- /dev/null +++ b/meta-clang/recipes-core/musl/musl_%.bbappend @@ -0,0 +1,9 @@ +DEPENDS:append:toolchain-clang = " clang-cross-${TARGET_ARCH}" +DEPENDS:remove:toolchain-clang = "virtual/${TARGET_PREFIX}gcc" +TOOLCHAIN:x86-x32 = "gcc" + +# crashes seen in malloc@plt +# Dump of assembler code for function malloc@got.plt: +# => 0x3f7fc2e8 <+0>: addis r27,r20,-22264 + +TOOLCHAIN:powerpc = "gcc" diff --git a/meta-clang/recipes-core/ncurses/ncurses_%.bbappend b/meta-clang/recipes-core/ncurses/ncurses_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..6e7a7c13a10ddea6729f19fac09854c82443dc4c --- /dev/null +++ b/meta-clang/recipes-core/ncurses/ncurses_%.bbappend @@ -0,0 +1 @@ +CACHED_CONFIGUREVARS:append:toolchain-clang = " cf_cv_prog_CC_c_o=yes cf_cv_prog_CXX_c_o=yes" diff --git a/meta-clang/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/meta-clang/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b2b0a84536b4e605c3648ab7563bdca34459f5f2 --- /dev/null +++ b/meta-clang/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend @@ -0,0 +1 @@ +RDEPENDS:${PN} += "${@bb.utils.contains('CLANGSDK', '1', 'nativesdk-clang', '', d)}" diff --git a/meta-clang/recipes-core/packagegroups/packagegroup-core-buildessential.bbappend b/meta-clang/recipes-core/packagegroups/packagegroup-core-buildessential.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..527ff741b51fcec2340ad7142c9f99eb096ea90d --- /dev/null +++ b/meta-clang/recipes-core/packagegroups/packagegroup-core-buildessential.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +RDEPENDS:packagegroup-core-buildessential:append:toolchain-clang = " clang " diff --git a/meta-clang/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend b/meta-clang/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..29990f0bbdc28937eb61864f0efaeb4174534067 --- /dev/null +++ b/meta-clang/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend @@ -0,0 +1 @@ +RRECOMMENDS:${PN} += "${@bb.utils.contains('CLANGSDK', '1', 'libcxx-dev libcxx-staticdev compiler-rt-dev compiler-rt-staticdev', '', d)}" diff --git a/meta-clang/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend b/meta-clang/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3199a69861a5066e5cb627b6b3f0dd6814c0138f --- /dev/null +++ b/meta-clang/recipes-core/packagegroups/packagegroup-cross-canadian.bbappend @@ -0,0 +1,3 @@ +CLANGCROSSCANADIAN = "clang-cross-canadian-${TRANSLATED_TARGET_ARCH}" +CLANGCROSSCANADIANDEPS += "${@all_multilib_tune_values(d, 'CLANGCROSSCANADIAN')}" +RDEPENDS:${PN} += "${@bb.utils.contains('CLANGSDK', '1', '${CLANGCROSSCANADIANDEPS}', '', d)}" diff --git a/meta-clang/recipes-core/systemd/systemd_%.bbappend b/meta-clang/recipes-core/systemd/systemd_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a54d6eed2c548de39d1376b03dc7acdbfadeb8f2 --- /dev/null +++ b/meta-clang/recipes-core/systemd/systemd_%.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +# systemd 251.4 started to cause boot issues see +# https://bugzilla.yoctoproject.org/show_bug.cgi?id=14906 +# As a workaround disable O2 and use Os for now with clang +SELECTED_OPTIMIZATION:append:toolchain-clang = "-Os" +SELECTED_OPTIMIZATION:remove:toolchain-clang = "-O2" diff --git a/meta-clang/recipes-devtools/castxml/castxml_0.4.5.bb b/meta-clang/recipes-devtools/castxml/castxml_0.4.5.bb new file mode 100644 index 0000000000000000000000000000000000000000..e7ba2f7d6ab2b4b1d0f62aa9d7c8894f50e68630 --- /dev/null +++ b/meta-clang/recipes-devtools/castxml/castxml_0.4.5.bb @@ -0,0 +1,27 @@ +SUMMARY = "C-family abstract syntax tree XML output tool." +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" + +SRC_URI = "git://github.com/CastXML/CastXML;protocol=https;branch=master" + +SRCREV = "7ef4b1e35480a09c18b0c4afc230b558a0f53bc0" + +S = "${WORKDIR}/git" + +DEPENDS = "clang" + +# Match clang's idea of what TOOLCHAIN should be. +TOOLCHAIN = "clang" +TOOLCHAIN:class-native = "gcc" +TOOLCHAIN:class-nativesdk = "clang" + +BUILD_CC:class-nativesdk = "clang" +BUILD_CXX:class-nativesdk = "clang++" +BUILD_AR:class-nativesdk = "llvm-ar" +BUILD_RANLIB:class-nativesdk = "llvm-ranlib" +BUILD_NM:class-nativesdk = "llvm-nm" +LDFLAGS:append:class-nativesdk = " -fuse-ld=gold" + +inherit cmake cmake-native pkgconfig python3native + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-clang/recipes-devtools/clang/clang-cross-canadian_git.bb b/meta-clang/recipes-devtools/clang/clang-cross-canadian_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..e3ae393c39d5737dcb54fd6e241dfd28ccda8374 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang-cross-canadian_git.bb @@ -0,0 +1,36 @@ +# Copyright (C) 2014 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "Clang/LLVM based C/C++ compiler (cross-canadian for ${TARGET_ARCH} target)" +HOMEPAGE = "http://clang.llvm.org/" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" +SECTION = "devel" + +PN = "clang-cross-canadian-${TRANSLATED_TARGET_ARCH}" + +require clang.inc +require common-source.inc +inherit cross-canadian + +DEPENDS += "nativesdk-clang binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-libc" +# We have to point gcc at a sysroot but we don't need to rebuild if this changes +# e.g. we switch between different machines with different tunes. +EXTRA_OECONF_PATHS[vardepsexclude] = "TUNE_PKGARCH" +TARGET_ARCH[vardepsexclude] = "TUNE_ARCH" + +do_install() { + install -d ${D}${bindir} + for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \ + llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov + do + ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool + done +} +SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-llvm-ar \ + *-llvm-ranlib *-llvm-nm *-lld *-ld.lld *-llvm-as *-llvm-strip \ + *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \ + *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov" +do_install:append() { + cross_canadian_bindirlinks +} diff --git a/meta-clang/recipes-devtools/clang/clang-cross_git.bb b/meta-clang/recipes-devtools/clang/clang-cross_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..8aee5cd86280cc73b70e44a0072214c13808e8e5 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang-cross_git.bb @@ -0,0 +1,35 @@ +# Copyright (C) 2014 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "Cross compiler wrappers for LLVM based C/C++ compiler" +HOMEPAGE = "http://clang.llvm.org/" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" +SECTION = "devel" + +PN = "clang-cross-${TARGET_ARCH}" + +require clang.inc +require common-source.inc +inherit cross +DEPENDS += "clang-native virtual/${TARGET_PREFIX}binutils" + +do_install() { + install -d ${D}${bindir} + for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \ + llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov + do + ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool + done +} +SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-lld *-ld.lld \ + *-llvm-nm *-llvm-ar *-llvm-as *-llvm-ranlib *-llvm-strip \ + *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \ + *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov" + +SYSROOT_PREPROCESS_FUNCS += "clangcross_sysroot_preprocess" + +clangcross_sysroot_preprocess () { + sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir} +} +PACKAGES = "" diff --git a/meta-clang/recipes-devtools/clang/clang-crosssdk_git.bb b/meta-clang/recipes-devtools/clang/clang-crosssdk_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..906bc873f059e089699ff729d30f1ee285d2ddf4 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang-crosssdk_git.bb @@ -0,0 +1,34 @@ +# Copyright (C) 2014 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" +HOMEPAGE = "http://clang.llvm.org/" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" +SECTION = "devel" + +PN = "clang-crosssdk-${TARGET_ARCH}" + +require clang.inc +require common-source.inc +inherit crosssdk +DEPENDS += "clang-native nativesdk-clang-glue virtual/${TARGET_PREFIX}binutils-crosssdk virtual/nativesdk-libc" + +do_install() { + install -d ${D}${bindir} + for tool in clang clang++ clang-tidy lld ld.lld llvm-profdata \ + llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov + do + ln -sf ../$tool ${D}${bindir}/${TARGET_PREFIX}$tool + done +} +SSTATE_SCAN_FILES += "*-clang *-clang++ *-llvm-profdata *-lld *-ld.lld \ + *-llvm-nm *-llvm-ar *-llvm-as *-llvm-ranlib *-llvm-strip \ + *-llvm-objcopy *-llvm-objdump *-llvm-readelf *-llvm-addr2line \ + *-llvm-dwp *-llvm-size *-llvm-strings *-llvm-cov" +sysroot_stage_all () { + sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir} +} + +PACKAGES = "" + diff --git a/meta-clang/recipes-devtools/clang/clang.inc b/meta-clang/recipes-devtools/clang/clang.inc new file mode 100644 index 0000000000000000000000000000000000000000..74e929f0edcf38a137865b820f93a172a7b47707 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang.inc @@ -0,0 +1,26 @@ +LLVM_RELEASE = "" +LLVM_DIR = "llvm${LLVM_RELEASE}" + +LLVM_GIT ?= "git://github.com/llvm" +LLVM_GIT_PROTOCOL ?= "https" + +MAJOR_VER = "15" +MINOR_VER = "0" +PATCH_VER = "4" + +SRCREV ?= "5c68a1cb123161b54b72ce90e7975d95a8eaf2a4" + +PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" +BRANCH = "release/15.x" + +LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe" +CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343" +LLDMD5SUM = "ae7dc7c027b1fa89b5b013d391d3ee2b" +LLDBMD5SUM = "2e0d44968471fcde980034dbb826bea9" + +LLVM_LIBDIR_SUFFIX="${@d.getVar('baselib').replace('lib', '')}" + +# set the default pigz thread +export PIGZ = "-p ${@oe.utils.cpu_count(at_least=2)}" + +require common.inc diff --git a/meta-clang/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/meta-clang/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch new file mode 100644 index 0000000000000000000000000000000000000000..0baeecabac02adf5671396d1b69de1e24acd715b --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch @@ -0,0 +1,57 @@ +From f37af7da6832c871007bebe4927f0fc739ae5ad6 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 27 Aug 2017 10:37:49 -0700 +Subject: [PATCH] libcxxabi: Find libunwind headers when + LIBCXXABI_LIBUNWIND_INCLUDES is set + +Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments +then it ends up not searching the specified dir and unwind.h is not found +especially for ARM targets + +This patch makes the searching synthesized directories and then set +LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment + +Signed-off-by: Khem Raj +--- + libcxxabi/CMakeLists.txt | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt +index b8326d08d23a..cb16b5d4238b 100644 +--- a/libcxxabi/CMakeLists.txt ++++ b/libcxxabi/CMakeLists.txt +@@ -474,7 +474,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH + "Specify path to libunwind source." FORCE) + + if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) +- find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h ++ find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h + PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} + ${LIBCXXABI_LIBUNWIND_PATH}/include + ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} +@@ -485,15 +485,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) + NO_CMAKE_FIND_ROOT_PATH + ) + +- if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND") +- set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "") ++ if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND") ++ set(LIBCXXABI_LIBUNWIND_INCLUDES "") + endif() + +- if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "") +- include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}") ++ if (NOT LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "") ++ include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}") + endif() + endif() + ++set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH ++ "Specify path to libunwind includes." FORCE) ++set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH ++ "Specify path to libunwind source." FORCE) ++ ++ + # Add source code. This also contains all of the logic for deciding linker flags + # soname, etc... + add_subdirectory(include) diff --git a/meta-clang/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch b/meta-clang/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch new file mode 100644 index 0000000000000000000000000000000000000000..a4717f43caf44cb08eb076b4df44a2e06faa8928 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0002-compiler-rt-support-a-new-embedded-linux-target.patch @@ -0,0 +1,308 @@ +From 2734739b0c2478ebad3f57462c5c68ce71338551 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 19 Apr 2015 15:16:23 -0700 +Subject: [PATCH] compiler-rt: support a new embedded linux target + +Signed-off-by: Khem Raj +--- + .../make/platform/clang_linux_embedded.mk | 286 ++++++++++++++++++ + .../clang_linux_embedded_test_input.c | 0 + 2 files changed, 286 insertions(+) + create mode 100644 compiler-rt/make/platform/clang_linux_embedded.mk + create mode 100644 compiler-rt/make/platform/clang_linux_embedded_test_input.c + +diff --git a/compiler-rt/make/platform/clang_linux_embedded.mk b/compiler-rt/make/platform/clang_linux_embedded.mk +new file mode 100644 +index 000000000000..d0a890075a1c +--- /dev/null ++++ b/compiler-rt/make/platform/clang_linux_embedded.mk +@@ -0,0 +1,286 @@ ++# These are the functions which clang needs when it is targeting a previous ++# version of the OS. The issue is that the backend may use functions which were ++# not present in the libgcc that shipped on the platform. In such cases, we link ++# with a version of the library which contains private_extern definitions of all ++# the extra functions which might be referenced. ++ ++Description := Static runtime libraries for embedded clang/Linux ++ ++# A function that ensures we don't try to build for architectures that we ++# don't have working toolchains for. ++CheckArches = \ ++ $(shell \ ++ result=""; \ ++ for arch in $(1); do \ ++ if $(CC) -arch $$arch -c \ ++ -integrated-as \ ++ $(ProjSrcRoot)/make/platform/clang_linux_embedded_test_input.c \ ++ -o /dev/null > /dev/null 2> /dev/null; then \ ++ result="$$result$$arch "; \ ++ else \ ++ printf 1>&2 \ ++ "warning: clang_linux_embedded.mk: dropping arch '$$arch' from lib '$(2)'\n"; \ ++ fi; \ ++ done; \ ++ echo $$result) ++ ++XCRun = \ ++ $(shell \ ++ result=`xcrun -find $(1) 2> /dev/null`; \ ++ if [ "$$?" != "0" ]; then result=$(1); fi; \ ++ echo $$result) ++ ++### ++ ++CC := $(call XCRun,clang) ++AR := $(call XCRun,ar) ++RANLIB := $(call XCRun,ranlib) ++STRIP := $(call XCRun,strip) ++LIPO := $(call XCRun,lipo) ++DSYMUTIL := $(call XCRun,dsymutil) ++Configs := ++UniversalArchs := ++ ++# Soft-float version of the runtime. No floating-point instructions will be used ++# and the ABI (out of necessity) passes floating values in normal registers: ++# non-VFP variant of the AAPCS. ++UniversalArchs.soft_static := $(call CheckArches,arm armv7m armv7em armv7,soft_static) ++Configs += $(if $(UniversalArchs.soft_static),soft_static) ++ ++# Hard-float version of the runtime. On ARM VFP instructions and registers are ++# allowed, and floating point values get passed in them. VFP variant of the ++# AAPCS. ++UniversalArchs.hard_static := $(call CheckArches,armv7em armv7 i386 x86_64,hard_static) ++Configs += $(if $(UniversalArchs.hard_static),hard_static) ++ ++UniversalArchs.soft_pic := $(call CheckArches,armv6m armv7m armv7em armv7,soft_pic) ++Configs += $(if $(UniversalArchs.soft_pic),soft_pic) ++ ++UniversalArchs.hard_pic := $(call CheckArches,armv7em armv7 i386 x86_64,hard_pic) ++Configs += $(if $(UniversalArchs.hard_pic),hard_pic) ++ ++CFLAGS := -Wall -Werror -Oz -fomit-frame-pointer -ffreestanding ++ ++PIC_CFLAGS := -fPIC ++STATIC_CFLAGS := -static ++ ++CFLAGS_SOFT := -mfloat-abi=soft ++CFLAGS_HARD := -mfloat-abi=hard ++ ++CFLAGS_I386 := -march=pentium ++ ++CFLAGS.soft_static := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_SOFT) ++CFLAGS.hard_static := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_HARD) ++CFLAGS.soft_pic := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_SOFT) ++CFLAGS.hard_pic := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_HARD) ++ ++CFLAGS.soft_static.armv7 := $(CFLAGS.soft_static) $(CFLAGS_ARMV7) ++CFLAGS.hard_static.armv7 := $(CFLAGS.hard_static) $(CFLAGS_ARMV7) ++CFLAGS.soft_pic.armv7 := $(CFLAGS.soft_pic) $(CFLAGS_ARMV7) ++CFLAGS.hard_pic.armv7 := $(CFLAGS.hard_pic) $(CFLAGS_ARMV7) ++ ++# x86 platforms ignore -mfloat-abi options and complain about doing so. Despite ++# this they're hard-float. ++CFLAGS.hard_static.i386 := $(CFLAGS) $(STATIC_CFLAGS) $(CFLAGS_I386) ++CFLAGS.hard_pic.i386 := $(CFLAGS) $(PIC_CFLAGS) $(CFLAGS_I386) ++CFLAGS.hard_static.x86_64 := $(CFLAGS) $(STATIC_CFLAGS) ++CFLAGS.hard_pic.x86_64 := $(CFLAGS) $(PIC_CFLAGS) ++ ++# Functions not wanted: ++# + eprintf is obsolete anyway ++# + *vfp: designed for Thumb1 CPUs with VFPv2 ++ ++COMMON_FUNCTIONS := \ ++ absvdi2 \ ++ absvsi2 \ ++ addvdi3 \ ++ addvsi3 \ ++ ashldi3 \ ++ ashrdi3 \ ++ bswapdi2 \ ++ bswapsi2 \ ++ clzdi2 \ ++ clzsi2 \ ++ cmpdi2 \ ++ ctzdi2 \ ++ ctzsi2 \ ++ divdc3 \ ++ divdi3 \ ++ divsc3 \ ++ divmodsi4 \ ++ udivmodsi4 \ ++ do_global_dtors \ ++ ffsdi2 \ ++ fixdfdi \ ++ fixsfdi \ ++ fixunsdfdi \ ++ fixunsdfsi \ ++ fixunssfdi \ ++ fixunssfsi \ ++ floatdidf \ ++ floatdisf \ ++ floatundidf \ ++ floatundisf \ ++ gcc_bcmp \ ++ lshrdi3 \ ++ moddi3 \ ++ muldc3 \ ++ muldi3 \ ++ mulsc3 \ ++ mulvdi3 \ ++ mulvsi3 \ ++ negdi2 \ ++ negvdi2 \ ++ negvsi2 \ ++ paritydi2 \ ++ paritysi2 \ ++ popcountdi2 \ ++ popcountsi2 \ ++ powidf2 \ ++ powisf2 \ ++ subvdi3 \ ++ subvsi3 \ ++ ucmpdi2 \ ++ udiv_w_sdiv \ ++ udivdi3 \ ++ udivmoddi4 \ ++ umoddi3 \ ++ adddf3 \ ++ addsf3 \ ++ cmpdf2 \ ++ cmpsf2 \ ++ div0 \ ++ divdf3 \ ++ divsf3 \ ++ divsi3 \ ++ extendsfdf2 \ ++ ffssi2 \ ++ fixdfsi \ ++ fixsfsi \ ++ floatsidf \ ++ floatsisf \ ++ floatunsidf \ ++ floatunsisf \ ++ comparedf2 \ ++ comparesf2 \ ++ modsi3 \ ++ muldf3 \ ++ mulsf3 \ ++ negdf2 \ ++ negsf2 \ ++ subdf3 \ ++ subsf3 \ ++ truncdfsf2 \ ++ udivsi3 \ ++ umodsi3 \ ++ unorddf2 \ ++ unordsf2 ++ ++ARM_FUNCTIONS := \ ++ aeabi_cdcmpeq \ ++ aeabi_cdrcmple \ ++ aeabi_cfcmpeq \ ++ aeabi_cfrcmple \ ++ aeabi_dcmpeq \ ++ aeabi_dcmpge \ ++ aeabi_dcmpgt \ ++ aeabi_dcmple \ ++ aeabi_dcmplt \ ++ aeabi_drsub \ ++ aeabi_fcmpeq \ ++ aeabi_fcmpge \ ++ aeabi_fcmpgt \ ++ aeabi_fcmple \ ++ aeabi_fcmplt \ ++ aeabi_frsub \ ++ aeabi_idivmod \ ++ aeabi_uidivmod \ ++ ++# ARM Assembly implementation which requires Thumb2 (i.e. won't work on v6M). ++THUMB2_FUNCTIONS := \ ++ switch16 \ ++ switch32 \ ++ switch8 \ ++ switchu8 \ ++ sync_fetch_and_add_4 \ ++ sync_fetch_and_sub_4 \ ++ sync_fetch_and_and_4 \ ++ sync_fetch_and_or_4 \ ++ sync_fetch_and_xor_4 \ ++ sync_fetch_and_nand_4 \ ++ sync_fetch_and_max_4 \ ++ sync_fetch_and_umax_4 \ ++ sync_fetch_and_min_4 \ ++ sync_fetch_and_umin_4 \ ++ sync_fetch_and_add_8 \ ++ sync_fetch_and_sub_8 \ ++ sync_fetch_and_and_8 \ ++ sync_fetch_and_or_8 \ ++ sync_fetch_and_xor_8 \ ++ sync_fetch_and_nand_8 \ ++ sync_fetch_and_max_8 \ ++ sync_fetch_and_umax_8 \ ++ sync_fetch_and_min_8 \ ++ sync_fetch_and_umin_8 ++ ++I386_FUNCTIONS := \ ++ i686.get_pc_thunk.eax \ ++ i686.get_pc_thunk.ebp \ ++ i686.get_pc_thunk.ebx \ ++ i686.get_pc_thunk.ecx \ ++ i686.get_pc_thunk.edi \ ++ i686.get_pc_thunk.edx \ ++ i686.get_pc_thunk.esi ++ ++# FIXME: Currently, compiler-rt is missing implementations for a number of the ++# functions. Filter them out for now. ++MISSING_FUNCTIONS := \ ++ cmpdf2 cmpsf2 div0 \ ++ ffssi2 \ ++ udiv_w_sdiv unorddf2 unordsf2 bswapdi2 \ ++ bswapsi2 \ ++ gcc_bcmp \ ++ do_global_dtors \ ++ i686.get_pc_thunk.eax i686.get_pc_thunk.ebp i686.get_pc_thunk.ebx \ ++ i686.get_pc_thunk.ecx i686.get_pc_thunk.edi i686.get_pc_thunk.edx \ ++ i686.get_pc_thunk.esi \ ++ aeabi_cdcmpeq aeabi_cdrcmple aeabi_cfcmpeq aeabi_cfrcmple aeabi_dcmpeq \ ++ aeabi_dcmpge aeabi_dcmpgt aeabi_dcmple aeabi_dcmplt aeabi_drsub \ ++ aeabi_fcmpeq \ aeabi_fcmpge aeabi_fcmpgt aeabi_fcmple aeabi_fcmplt \ ++ aeabi_frsub aeabi_idivmod aeabi_uidivmod ++ ++FUNCTIONS_ARMV6M := $(COMMON_FUNCTIONS) $(ARM_FUNCTIONS) ++FUNCTIONS_ARM_ALL := $(COMMON_FUNCTIONS) $(ARM_FUNCTIONS) $(THUMB2_FUNCTIONS) ++FUNCTIONS_I386 := $(COMMON_FUNCTIONS) $(I386_FUNCTIONS) ++FUNCTIONS_X86_64 := $(COMMON_FUNCTIONS) ++ ++FUNCTIONS_ARMV6M := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_ARMV6M)) ++FUNCTIONS_ARM_ALL := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_ARM_ALL)) ++FUNCTIONS_I386 := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_I386)) ++FUNCTIONS_X86_64 := \ ++ $(filter-out $(MISSING_FUNCTIONS),$(FUNCTIONS_X86_64)) ++ ++FUNCTIONS.soft_static.armv6m := $(FUNCTIONS_ARMV6M) ++FUNCTIONS.soft_pic.armv6m := $(FUNCTIONS_ARMV6M) ++ ++FUNCTIONS.soft_static.armv7m := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.soft_pic.armv7m := $(FUNCTIONS_ARM_ALL) ++ ++FUNCTIONS.soft_static.armv7em := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_static.armv7em := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.soft_pic.armv7em := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_pic.armv7em := $(FUNCTIONS_ARM_ALL) ++ ++FUNCTIONS.soft_static.armv7 := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_static.armv7 := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.soft_pic.armv7 := $(FUNCTIONS_ARM_ALL) ++FUNCTIONS.hard_pic.armv7 := $(FUNCTIONS_ARM_ALL) ++ ++FUNCTIONS.hard_static.i386 := $(FUNCTIONS_I386) ++FUNCTIONS.hard_pic.i386 := $(FUNCTIONS_I386) ++ ++FUNCTIONS.hard_static.x86_64 := $(FUNCTIONS_X86_64) ++FUNCTIONS.hard_pic.x86_64 := $(FUNCTIONS_X86_64) +diff --git a/compiler-rt/make/platform/clang_linux_embedded_test_input.c b/compiler-rt/make/platform/clang_linux_embedded_test_input.c +new file mode 100644 +index 000000000000..e69de29bb2d1 diff --git a/meta-clang/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/meta-clang/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch new file mode 100644 index 0000000000000000000000000000000000000000..8bee34941dead74e44ca02f0f692f16d59901d51 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch @@ -0,0 +1,43 @@ +From 0980511a0eba734da6112c4416a8a086a13c8c82 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 19 May 2016 23:11:45 -0700 +Subject: [PATCH] compiler-rt: Simplify cross-compilation. Don't use + native-compiled llvm-config. + + Note: AddLLVM.cmake does not expose the LLVM source directory. + So if you want to run the test suite, you need to either: + + 1) set LLVM_MAIN_SRC_DIR explicitly (to find lit.py) + 2) change AddLLVM.cmake to point to an installed 'lit'. + 3) add_subdirectory(compiler-rt/test) from clang instead of compiler-rt. + +https://us.codeaurora.org/patches/quic/llvm/50683/compiler-rt-cross-compilation.patch + +Signed-off-by: Greg Fitzgerald +Signed-off-by: Khem Raj +--- + compiler-rt/CMakeLists.txt | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt +index 62737735695f..a2c7c3a786ab 100644 +--- a/compiler-rt/CMakeLists.txt ++++ b/compiler-rt/CMakeLists.txt +@@ -68,7 +68,16 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOL + "Build for a bare-metal target.") + + if (COMPILER_RT_STANDALONE_BUILD) +- load_llvm_config() ++ find_package(LLVM REQUIRED) ++ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") ++ ++ # Variables that AddLLVM.cmake depends on (included by AddCompilerRT) ++ set(LLVM_TOOLS_BINARY_DIR "${LLVM_INSTALL_PREFIX}/bin") ++ set(LLVM_LIBRARY_DIR "${LLVM_INSTALL_PREFIX}/lib") ++ ++ set(LLVM_LIBRARY_OUTPUT_INTDIR ++ ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) ++ + if (TARGET intrinsics_gen) + # Loading the llvm config causes this target to be imported so place it + # under the appropriate folder in an IDE. diff --git a/meta-clang/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/meta-clang/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch new file mode 100644 index 0000000000000000000000000000000000000000..0060f157b9767bb6453e16aa9602367d7e405a5e --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -0,0 +1,88 @@ +From b0a0d9f515b8423b7f8e0cd8f4882a4ef6fd43af Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 21 May 2016 00:33:20 +0000 +Subject: [PATCH] llvm: TargetLibraryInfo: Undefine libc functions if they are + macros + +musl defines some functions as macros and not inline functions +if this is the case then make sure to undefine them + +Signed-off-by: Khem Raj +--- + .../llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def +index 9c1abef33b28..29d2a79ddecc 100644 +--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def ++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def +@@ -815,6 +815,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") + TLI_DEFINE_ENUM_INTERNAL(fopen) + TLI_DEFINE_STRING_INTERNAL("fopen") + /// FILE *fopen64(const char *filename, const char *opentype) ++#ifdef fopen64 ++#undef fopen64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(fopen64) + TLI_DEFINE_STRING_INTERNAL("fopen64") + /// int fork(); +@@ -862,6 +865,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") + /// int fseeko(FILE *stream, off_t offset, int whence); + TLI_DEFINE_ENUM_INTERNAL(fseeko) + TLI_DEFINE_STRING_INTERNAL("fseeko") ++#ifdef fseeko64 ++#undef fseeko64 ++#endif + /// int fseeko64(FILE *stream, off64_t offset, int whence) + TLI_DEFINE_ENUM_INTERNAL(fseeko64) + TLI_DEFINE_STRING_INTERNAL("fseeko64") +@@ -872,6 +878,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") + TLI_DEFINE_ENUM_INTERNAL(fstat) + TLI_DEFINE_STRING_INTERNAL("fstat") + /// int fstat64(int filedes, struct stat64 *buf) ++#ifdef fstat64 ++#undef fstat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(fstat64) + TLI_DEFINE_STRING_INTERNAL("fstat64") + /// int fstatvfs(int fildes, struct statvfs *buf); +@@ -887,6 +896,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") + TLI_DEFINE_ENUM_INTERNAL(ftello) + TLI_DEFINE_STRING_INTERNAL("ftello") + /// off64_t ftello64(FILE *stream) ++#ifdef ftello64 ++#undef ftello64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(ftello64) + TLI_DEFINE_STRING_INTERNAL("ftello64") + /// int ftrylockfile(FILE *file); +@@ -1013,6 +1025,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") + TLI_DEFINE_ENUM_INTERNAL(lstat) + TLI_DEFINE_STRING_INTERNAL("lstat") + /// int lstat64(const char *path, struct stat64 *buf); ++#ifdef lstat64 ++#undef lstat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(lstat64) + TLI_DEFINE_STRING_INTERNAL("lstat64") + /// void *malloc(size_t size); +@@ -1262,6 +1277,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") + TLI_DEFINE_ENUM_INTERNAL(stat) + TLI_DEFINE_STRING_INTERNAL("stat") + /// int stat64(const char *path, struct stat64 *buf); ++#ifdef stat64 ++#undef stat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(stat64) + TLI_DEFINE_STRING_INTERNAL("stat64") + /// int statvfs(const char *path, struct statvfs *buf); +@@ -1397,6 +1415,9 @@ TLI_DEFINE_STRING_INTERNAL("times") + TLI_DEFINE_ENUM_INTERNAL(tmpfile) + TLI_DEFINE_STRING_INTERNAL("tmpfile") + /// FILE *tmpfile64(void) ++#ifdef tmpfile64 ++#undef tmpfile64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(tmpfile64) + TLI_DEFINE_STRING_INTERNAL("tmpfile64") + /// int toascii(int c); diff --git a/meta-clang/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch b/meta-clang/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch new file mode 100644 index 0000000000000000000000000000000000000000..564e43f1abc7a8910bbdb16da97c271e346c4003 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0005-llvm-allow-env-override-of-exe-and-libdir-path.patch @@ -0,0 +1,71 @@ +From d88d1f16df8f3f28246c8fdeb2a3bdb84bfe3121 Mon Sep 17 00:00:00 2001 +From: Martin Kelly +Date: Fri, 19 May 2017 00:22:57 -0700 +Subject: [PATCH] llvm: allow env override of exe and libdir path + +When using a native llvm-config from inside a sysroot, we need llvm-config to +return the libraries, include directories, etc. from inside the sysroot rather +than from the native sysroot. Thus provide an env override for calling +llvm-config from a target sysroot. + +Add YOCTO_ALTERNATE_LIBDIR and YOCTO_ALTERNATE_EXE_PATH env variables + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Martin Kelly +Signed-off-by: Khem Raj +--- + llvm/tools/llvm-config/llvm-config.cpp | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) + +diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp +index 2c6c55f89d38..77da3d7827dd 100644 +--- a/llvm/tools/llvm-config/llvm-config.cpp ++++ b/llvm/tools/llvm-config/llvm-config.cpp +@@ -249,6 +249,13 @@ Typical components:\n\ + + /// Compute the path to the main executable. + std::string GetExecutablePath(const char *Argv0) { ++ // Hack for Yocto: we need to override the root path when we are using ++ // llvm-config from within a target sysroot. ++ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); ++ if (Sysroot != nullptr) { ++ return Sysroot; ++ } ++ + // This just needs to be some symbol in the binary; C++ doesn't + // allow taking the address of ::main however. + void *P = (void *)(intptr_t)GetExecutablePath; +@@ -328,7 +335,7 @@ int main(int argc, char **argv) { + // Compute various directory locations based on the derived location + // information. + std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir, +- ActiveCMakeDir; ++ ActiveCMakeDir, BaseLibDir; + std::string ActiveIncludeOption; + if (IsInDevelopmentTree) { + ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include"; +@@ -369,12 +376,18 @@ int main(int argc, char **argv) { + sys::fs::make_absolute(ActivePrefix, Path); + ActiveBinDir = std::string(Path.str()); + } +- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX; +- { +- SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR); +- sys::fs::make_absolute(ActivePrefix, Path); +- ActiveCMakeDir = std::string(Path.str()); ++ // Hack for Yocto: we need to override the lib path when we are using ++ // llvm-config from within a target sysroot since LLVM_LIBDIR_SUFFIX ++ // maybe different for host llvm vs target e.g. ppc64 Libdir=lib64 but ++ // x86_64 Libdir = lib ++ const char *YoctoLibDir = std::getenv("YOCTO_ALTERNATE_LIBDIR"); ++ if (YoctoLibDir != nullptr) { ++ BaseLibDir = std::string(YoctoLibDir); ++ } else { ++ BaseLibDir = std::string("/lib") + LLVM_LIBDIR_SUFFIX; + } ++ ActiveLibDir = ActivePrefix + BaseLibDir; ++ ActiveCMakeDir = ActiveLibDir + "/cmake/llvm"; + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + diff --git a/meta-clang/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch b/meta-clang/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch new file mode 100644 index 0000000000000000000000000000000000000000..fb4f3faf151fe827d0f89306b740b9e899386020 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0006-clang-driver-Check-sysroot-for-ldso-path.patch @@ -0,0 +1,61 @@ +From 3f9d367a0f519c04c0a59c6aec49898270860f46 Mon Sep 17 00:00:00 2001 +From: Dan McGregor +Date: Wed, 26 Apr 2017 20:29:41 -0600 +Subject: [PATCH] clang: driver: Check sysroot for ldso path + +OE does not necessarily follow the default path for the dynamic linker, +therefore adjust it for OE. Check for the default path, and if it isn't +there, check /lib. + +Signed-off-by: Dan McGregor +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index ceb1a982c3a4..69f5a4662732 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -508,11 +508,19 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; ++ if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ LibDir = "lib"; ++ } + break; + case llvm::Triple::ppc64le: + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; ++ if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ LibDir = "lib"; ++ } + break; + case llvm::Triple::riscv32: { + StringRef ABIName = tools::riscv::getRISCVABI(Args, Triple); +@@ -534,6 +542,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + case llvm::Triple::sparcv9: + LibDir = "lib64"; + Loader = "ld-linux.so.2"; ++ if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ LibDir = "lib"; ++ } + break; + case llvm::Triple::systemz: + LibDir = "lib"; +@@ -548,6 +560,10 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + + LibDir = X32 ? "libx32" : "lib64"; + Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; ++ if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ LibDir = "lib"; ++ } + break; + } + case llvm::Triple::ve: diff --git a/meta-clang/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/meta-clang/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..a7436f688721d8d8d7f6f2355865ea4a4443021a --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch @@ -0,0 +1,31 @@ +From 8d8ad213bf8683093f95112ba61934dff0d42c52 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 19 May 2016 21:11:06 -0700 +Subject: [PATCH] clang: Driver/tools.cpp: Add -lssp_nonshared on musl + +musl driver will need to add ssp_nonshared for stack_check_local +on the linker cmdline when using stack protector commands on +compiler cmdline + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index f203cae1d329..0b5255a10404 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -654,6 +654,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, + if (IsIAMCU) + CmdArgs.push_back("-lgloss"); + ++ if (ToolChain.getTriple().isMusl() && ++ (Args.hasArg(options::OPT_fstack_protector) || ++ Args.hasArg(options::OPT_fstack_protector_strong) || ++ Args.hasArg(options::OPT_fstack_protector_all))) { ++ CmdArgs.push_back("-lssp_nonshared"); ++ } + if (IsStatic || IsStaticPIE) + CmdArgs.push_back("--end-group"); + else diff --git a/meta-clang/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch b/meta-clang/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch new file mode 100644 index 0000000000000000000000000000000000000000..acc90912688078b3943fce7dcf3a9c2690e320b5 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0008-clang-Prepend-trailing-to-sysroot.patch @@ -0,0 +1,38 @@ +From 0004f72d90c276ee934f39706bb101d6d738333f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 16 Mar 2017 09:02:13 -0700 +Subject: [PATCH] clang: Prepend trailing '/' to sysroot + +This is needed to handle a case where clang +isntall and target sysroot are perilously same + +e.g. + +sysroot = /mnt/clang/recipe-sysroot +clang install = /mnt/clang/recipe-sysroot-native + +in this case it will mistakenly assume that +clang is installed under the same sysroot dir +and it will try to add relative ../lib paths +to linker steps which would then be wrong +since they will become relative to clang +installation and not sysroot + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 69f5a4662732..7555466e7e2b 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -183,7 +183,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + Multilibs = GCCInstallation.getMultilibs(); + SelectedMultilib = GCCInstallation.getMultilib(); + llvm::Triple::ArchType Arch = Triple.getArch(); +- std::string SysRoot = computeSysRoot(); ++ std::string SysRoot = computeSysRoot() + "/"; + ToolChain::path_list &PPaths = getProgramPaths(); + + Generic_GCC::PushPPaths(PPaths); diff --git a/meta-clang/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/meta-clang/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch new file mode 100644 index 0000000000000000000000000000000000000000..bdc0dd23447ba78e74dd3b1cea6d638ae98da1e4 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch @@ -0,0 +1,40 @@ +From 6c3940c923c5554b2b26e09e347e452ba293b391 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 16 Mar 2017 19:06:26 -0700 +Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime + +In OE compiler-rt and libc++ are built and staged into target +sysroot and not into resourcedir which is relative to clang +driver installation where the libraries are not instlled + +Specific to cross compiling the way yocto/OE works + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChain.cpp | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp +index 7a4319ea680f..3068d25dab75 100644 +--- a/clang/lib/Driver/ToolChain.cpp ++++ b/clang/lib/Driver/ToolChain.cpp +@@ -13,6 +13,7 @@ + #include "ToolChains/InterfaceStubs.h" + #include "clang/Basic/ObjCRuntime.h" + #include "clang/Basic/Sanitizers.h" ++#include "clang/Basic/Version.h" + #include "clang/Config/config.h" + #include "clang/Driver/Action.h" + #include "clang/Driver/Driver.h" +@@ -458,7 +459,10 @@ StringRef ToolChain::getOSLibName() const { + } + + std::string ToolChain::getCompilerRTPath() const { +- SmallString<128> Path(getDriver().ResourceDir); ++ SmallString<128> Path(getDriver().SysRoot); ++ StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX); ++ llvm::sys::path::append(Path, "/usr/", Twine("lib") + ClangLibdirSuffix, "clang", ++ CLANG_VERSION_STRING); + if (Triple.isOSUnknown()) { + llvm::sys::path::append(Path, "lib"); + } else { diff --git a/meta-clang/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch b/meta-clang/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..bc66adf46c0f38e188cf27065701771c1226b498 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0010-clang-Define-releative-gcc-installation-dir.patch @@ -0,0 +1,46 @@ +From 349fd23e6ecf8b6290460dd7da2e79cbe2fddf7a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 20 Mar 2021 16:09:16 -0700 +Subject: [PATCH] clang: Define / releative gcc installation dir + +This is required for OE gcc installation to work. +Without this its not able to find the paths for libgcc +and other standard headers and libraries from gcc +installation in OE + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 0b5255a10404..bddc77cde2d6 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2642,19 +2642,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + // Whether this library suffix is relevant for the triple. + bool Active; + } Suffixes[] = { +- // This is the normal place. +- {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, +- +- // Debian puts cross-compilers in gcc-cross. +- {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}, +- + // The Freescale PPC SDK has the gcc libraries in + // /usr/lib//x.y.z so have a look there as well. Only do + // this on Freescale triples, though, since some systems put a *lot* of + // files in that location, not just GCC installation data. + {CandidateTriple.str(), "..", + TargetTriple.getVendor() == llvm::Triple::Freescale || +- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}}; ++ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, ++ ++ // This is the normal place. ++ {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, ++ ++ // Debian puts cross-compilers in gcc-cross. ++ {"gcc-cross/" + CandidateTriple.str(), "../..", GCCCrossDirExists}}; + + for (auto &Suffix : Suffixes) { + if (!Suffix.Active) diff --git a/meta-clang/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch b/meta-clang/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch new file mode 100644 index 0000000000000000000000000000000000000000..91bc2117a0ead81dfd5f6549394c4242424ec556 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch @@ -0,0 +1,34 @@ +From 0680ca156584888a7eddef687e47888369ad70c3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 31 Jul 2019 22:51:39 -0700 +Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static + linking + +When doing static liking with --unwindlib=libunwind -static we encounter +undefined symbols +libunwind/src/RWMutex.hpp:68: undefined reference to `pthread_rwlock_wrlock' + +and + +libunwind/src/AddressSpace.hpp:597: undefined reference to `dladdr' + +therefore we need to link in libpthread and libdl to fill these symbols + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/CommonArgs.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp +index 443725f7d8a8..c8eabfac21dc 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp +@@ -1537,6 +1537,8 @@ static void AddUnwindLibrary(const ToolChain &TC, const Driver &D, + CmdArgs.push_back("-lunwind"); + } else if (LGT == LibGccType::StaticLibGcc) { + CmdArgs.push_back("-l:libunwind.a"); ++ CmdArgs.push_back("-lpthread"); ++ CmdArgs.push_back("-ldl"); + } else if (LGT == LibGccType::SharedLibGcc) { + if (TC.getTriple().isOSCygMing()) + CmdArgs.push_back("-l:libunwind.dll.a"); diff --git a/meta-clang/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/meta-clang/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch new file mode 100644 index 0000000000000000000000000000000000000000..1752b49161a4414ef8ccb103cbebc835d0e39fe9 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -0,0 +1,23 @@ +From e47a0db499655d06965e517f2aca297fb9c7ef8d Mon Sep 17 00:00:00 2001 +From: Anuj Mittal +Date: Thu, 26 Dec 2019 12:56:16 -0800 +Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build + +Signed-off-by: Anuj Mittal +Signed-off-by: Khem Raj +--- + llvm/cmake/modules/CrossCompile.cmake | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake +index 52b893dd0214..4399cec3e19a 100644 +--- a/llvm/cmake/modules/CrossCompile.cmake ++++ b/llvm/cmake/modules/CrossCompile.cmake +@@ -84,6 +84,7 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype) + -DLLVM_ENABLE_RUNTIMES="${llvm_enable_runtimes_arg}" + ${external_project_source_dirs} + -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" ++ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" + ${build_type_flags} ${linker_flag} ${external_clang_dir} + ${ARGN} + WORKING_DIRECTORY ${${project_name}_${target_name}_BUILD} diff --git a/meta-clang/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch b/meta-clang/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch new file mode 100644 index 0000000000000000000000000000000000000000..d0fa1df83acc7f379164148f56991b453db0cf85 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0013-Check-for-atomic-double-intrinsics.patch @@ -0,0 +1,33 @@ +From 4686a186fa1b70adc646eb10fe293f47a397071b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 18 Nov 2019 17:00:29 -0800 +Subject: [PATCH] Check for atomic intrinsics + +On some architectures e.g. x86/32bit gcc decides to inline calls to +double atomic variables but clang does not and defers it to libatomic +therefore detect if clang can use built-ins for atomic if not +then link libatomic, this helps building clangd for x86 on linux systems +with gcc runtime + +Signed-off-by: Khem Raj +--- + llvm/cmake/modules/CheckAtomic.cmake | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake +index 3c5ba72993a3..34a1b950bbed 100644 +--- a/llvm/cmake/modules/CheckAtomic.cmake ++++ b/llvm/cmake/modules/CheckAtomic.cmake +@@ -30,10 +30,11 @@ function(check_working_cxx_atomics64 varname) + #include + #include + std::atomic x (0); ++std::atomic y (0); + int main() { + uint64_t i = x.load(std::memory_order_relaxed); + (void)i; +- return 0; ++ return int(y); + } + " ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) diff --git a/meta-clang/recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch b/meta-clang/recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch new file mode 100644 index 0000000000000000000000000000000000000000..1e818d404ebbd196d19c2f12bacc41bd3b96937e --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch @@ -0,0 +1,37 @@ +From c99af87e7ff2088c2fabdae236fa142fbe415ec8 Mon Sep 17 00:00:00 2001 +From: Jeremy Puhlman +Date: Thu, 16 Jan 2020 21:16:10 +0000 +Subject: [PATCH] libcxx: Add compiler runtime library to link step for libcxx + +This corrects "undefined reference to __divti3" + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Jeremy Puhlman +Signed-off-by: Khem Raj +--- + libcxx/src/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt +index 9abf548abbb9..a16c529781c6 100644 +--- a/libcxx/src/CMakeLists.txt ++++ b/libcxx/src/CMakeLists.txt +@@ -199,7 +199,7 @@ if (LIBCXX_ENABLE_SHARED) + add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) + target_include_directories(cxx_shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries(cxx_shared PUBLIC cxx-headers +- PRIVATE ${LIBCXX_LIBRARIES}) ++ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)") + set_target_properties(cxx_shared + PROPERTIES + COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}" +@@ -283,7 +283,7 @@ if (LIBCXX_ENABLE_STATIC) + add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS}) + target_include_directories(cxx_static PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_link_libraries(cxx_static PUBLIC cxx-headers +- PRIVATE ${LIBCXX_LIBRARIES} ++ PRIVATE ${LIBCXX_LIBRARIES} "$$($$CC --print-libgcc-file-name)" + PRIVATE libcxx-abi-static) + set_target_properties(cxx_static + PROPERTIES diff --git a/meta-clang/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch b/meta-clang/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch new file mode 100644 index 0000000000000000000000000000000000000000..2b647c9cebf43425c4c5e6b25f599a5e9a106557 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch @@ -0,0 +1,116 @@ +From a85b06f3aa67a35b65fe2742d6ca53c949235198 Mon Sep 17 00:00:00 2001 +From: Ovidiu Panait +Date: Fri, 31 Jan 2020 10:56:11 +0200 +Subject: [PATCH] clang,llvm: cmake: Fix configure for packages using + find_package() + +Currently, when a package (i.e. bcc [https://github.com/iovisor/bcc.git]) +that depends on LLVM/Clang tries to run cmake find_package() during +do_configure, it will fail with a similar error: + +| The imported target "llvm-tblgen" references the file +| ".../recipe-sysroot/usr/bin/llvm-tblgen" +| +| but this file does not exist. Possible reasons include: +| * The file was deleted, renamed, or moved to another location. +| * An install or uninstall procedure did not complete successfully. +| * The installation package was faulty and contained +| ".../recipe-sysroot/usr/lib/cmake/LLVMExports.cmake" +| but not all the files it references. + +This is due to the fact that currently the cmake scripts look for target +binaries in sysroot. Work around this by not exporting the target binaries in +Exports-* cmake files. + +Upstream-Status: Innapropriate [oe-specific] + +Signed-off-by: Ovidiu Panait +--- + clang/cmake/modules/AddClang.cmake | 2 -- + llvm/cmake/modules/AddLLVM.cmake | 6 ------ + llvm/cmake/modules/TableGen.cmake | 7 ------- + 3 files changed, 15 deletions(-) + +diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake +index 21ac332e4f5f..86c93cfec59d 100644 +--- a/clang/cmake/modules/AddClang.cmake ++++ b/clang/cmake/modules/AddClang.cmake +@@ -165,7 +165,6 @@ macro(add_clang_tool name) + if (CLANG_BUILD_TOOLS) + get_target_export_arg(${name} Clang export_to_clangtargets) + install(TARGETS ${name} +- ${export_to_clangtargets} + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT ${name}) + +@@ -174,7 +173,6 @@ macro(add_clang_tool name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name}) + endif() + endif() + endmacro() +diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake +index 057431208322..e7c77e824d58 100644 +--- a/llvm/cmake/modules/AddLLVM.cmake ++++ b/llvm/cmake/modules/AddLLVM.cmake +@@ -1299,7 +1299,6 @@ macro(llvm_add_tool project name) + if( LLVM_BUILD_TOOLS ) + get_target_export_arg(${name} LLVM export_to_llvmexports) + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1310,9 +1309,6 @@ macro(llvm_add_tool project name) + endif() + endif() + endif() +- if( LLVM_BUILD_TOOLS ) +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) +- endif() + set_target_properties(${name} PROPERTIES FOLDER "Tools") + endif() + endmacro(llvm_add_tool project name) +@@ -1357,7 +1353,6 @@ macro(add_llvm_utility name) + if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS) + get_target_export_arg(${name} LLVM export_to_llvmexports) + install(TARGETS ${name} +- ${export_to_llvmexports} + RUNTIME DESTINATION ${LLVM_UTILS_INSTALL_DIR} + COMPONENT ${name}) + +@@ -1366,7 +1361,6 @@ macro(add_llvm_utility name) + DEPENDS ${name} + COMPONENT ${name}) + endif() +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) + elseif(LLVM_BUILD_UTILS) + set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name}) + endif() +diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake +index 4711456776c8..857392499525 100644 +--- a/llvm/cmake/modules/TableGen.cmake ++++ b/llvm/cmake/modules/TableGen.cmake +@@ -187,14 +187,8 @@ macro(add_tablegen target project) + endif() + + if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS) +- set(export_to_llvmexports) +- if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR +- NOT LLVM_DISTRIBUTION_COMPONENTS) +- set(export_to_llvmexports EXPORT LLVMExports) +- endif() + + install(TARGETS ${target} +- ${export_to_llvmexports} + COMPONENT ${target} + RUNTIME DESTINATION "${${project}_TOOLS_INSTALL_DIR}") + if(NOT LLVM_ENABLE_IDE) +@@ -203,5 +197,4 @@ macro(add_tablegen target project) + COMPONENT ${target}) + endif() + endif() +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target}) + endmacro() diff --git a/meta-clang/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch b/meta-clang/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch new file mode 100644 index 0000000000000000000000000000000000000000..817292762596583708dc28dec1786a60d8368f28 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch @@ -0,0 +1,39 @@ +From 96c42b814881a7548d3d6a74423bf47b85482ca9 Mon Sep 17 00:00:00 2001 +From: Jim Broadus +Date: Thu, 26 Mar 2020 16:05:53 -0700 +Subject: [PATCH] clang: Fix resource dir location for cross toolchains + +When clang looks for the resources directory, it does so based on the binary +location and assumes that the containing directory is a sibling to lib. The +Yocto cross.bbclass defines the default bindir as +${exec_prefix}/bin/${CROSS_TARGET_SYS_DIR}. ex: /usr/bin/aarch64-poky-linux/. +This causes clang to form a path that looks like /usr/bin/lib/clang/... + +As a fix for this, check the parent directory name. If that is "bin", then +use that directory's parent. + +Signed-off-by: Jim Broadus +Signed-off-by: Khem Raj +--- + clang/lib/Driver/Driver.cpp | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp +index 3f29afd35971..45f2e0bede97 100644 +--- a/clang/lib/Driver/Driver.cpp ++++ b/clang/lib/Driver/Driver.cpp +@@ -179,7 +179,13 @@ std::string Driver::GetResourcesPath(StringRef BinaryPath, + // With a static-library build of libclang, LibClangPath will contain the + // path of the embedding binary, which for LLVM binaries will be in bin/. + // ../lib gets us to lib/ in both cases. +- P = llvm::sys::path::parent_path(Dir); ++ Dir = std::string(llvm::sys::path::parent_path(Dir)); ++ ++ // OE cross toolchains are installed, by default, in a subdir of bin. ++ if (llvm::sys::path::filename(Dir) == "bin") { ++ Dir = std::string(llvm::sys::path::parent_path(Dir)); ++ } ++ P = Dir; + llvm::sys::path::append(P, Twine("lib") + CLANG_LIBDIR_SUFFIX, "clang", + CLANG_VERSION_STRING); + } diff --git a/meta-clang/recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch b/meta-clang/recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch new file mode 100644 index 0000000000000000000000000000000000000000..bb4e1c8e485c4d96cb090ec8b21e4f2b0cde1552 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch @@ -0,0 +1,67 @@ +From 1669b300c9460e1cf1ebcff9ee9bfb7e499c9d95 Mon Sep 17 00:00:00 2001 +From: Oleksandr Ocheretnyi +Date: Wed, 15 Apr 2020 00:08:39 +0300 +Subject: [PATCH] clang: driver: Add dyld-prefix when checking sysroot for ldso + path + + * the dyld-prefix shall be taken into account when the default + path for the dynamic linker has to be checked. + + * this patch shall be used as annex to the next patch: + 'clang: driver: Check sysroot for ldso path' which includes + the usrmerge scenario. + +Signed-off-by: Oleksandr Ocheretnyi +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 7555466e7e2b..27951858fb5d 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -508,8 +508,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -517,8 +517,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + LibDir = "lib64"; + Loader = + (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -542,8 +542,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + case llvm::Triple::sparcv9: + LibDir = "lib64"; + Loader = "ld-linux.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; +@@ -560,8 +560,8 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { + + LibDir = X32 ? "libx32" : "lib64"; + Loader = X32 ? "ld-linux-x32.so.2" : "ld-linux-x86-64.so.2"; +- if (!getVFS().exists(getDriver().SysRoot + "/" + LibDir + "/" + Loader) && +- getVFS().exists(getDriver().SysRoot + "/lib/" + Loader)) { ++ if (!getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/" + LibDir + "/" + Loader) && ++ getVFS().exists(getDriver().SysRoot + getDriver().DyldPrefix + "/lib/" + Loader)) { + LibDir = "lib"; + } + break; diff --git a/meta-clang/recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch b/meta-clang/recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch new file mode 100644 index 0000000000000000000000000000000000000000..037591655cecca795947de35254200780e6fa1d4 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0018-clang-Use-python3-in-python-scripts.patch @@ -0,0 +1,68 @@ +From 88fb7548f93674b4ec1e5e7f3e096791bd32ed42 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 14 Oct 2020 22:19:57 -0700 +Subject: [PATCH] clang: Use python3 in python scripts + +Some scripts ask for python, but they work fine with python3 +and in OE python symlink is not exposed to build, only python3 is + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../find-all-symbols/tool/run-find-all-symbols.py | 2 +- + clang-tools-extra/clang-tidy/add_new_check.py | 2 +- + clang-tools-extra/clang-tidy/rename_check.py | 2 +- + clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 2 +- + clang/tools/scan-view/bin/scan-view | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py +index 8655af137bb2..e95ba59a421c 100755 +--- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py ++++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #=- run-find-all-symbols.py - Parallel find-all-symbols runner -*- python -*-=# + # +diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py +index 19b6896e508f..a85767acdce9 100644 +--- a/clang-tools-extra/clang-tidy/add_new_check.py ++++ b/clang-tools-extra/clang-tidy/add_new_check.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- add_new_check.py - clang-tidy check generator ---------*- python -*--===# + # +diff --git a/clang-tools-extra/clang-tidy/rename_check.py b/clang-tools-extra/clang-tidy/rename_check.py +index 9c2021751e0e..4bb9af8cbe0a 100755 +--- a/clang-tools-extra/clang-tidy/rename_check.py ++++ b/clang-tools-extra/clang-tidy/rename_check.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- rename_check.py - clang-tidy check renamer ------------*- python -*--===# + # +diff --git a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +index a26d2144b7f9..396a201b667e 100755 +--- a/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py ++++ b/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + #===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===# + # +diff --git a/clang/tools/scan-view/bin/scan-view b/clang/tools/scan-view/bin/scan-view +index 6165432e7af8..07effbca5969 100755 +--- a/clang/tools/scan-view/bin/scan-view ++++ b/clang/tools/scan-view/bin/scan-view +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + from __future__ import print_function + diff --git a/meta-clang/recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/meta-clang/recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch new file mode 100644 index 0000000000000000000000000000000000000000..a5957fd9517b15ba71136aa82eb7bb0c95d344bf --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch @@ -0,0 +1,70 @@ +From c9b225aeeb3d2b1d98d823c9a6c8afc613fc932b Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Mon, 25 Jan 2021 16:14:35 +0800 +Subject: [PATCH] For x86_64, set Yocto based GCC install search path + +Under Yocto host, while using clang-native to build, it searches +install host gcc failed which causing the include file not found +[snip] +|clang++ -target x86_64-linux -MMD -MF src/base/files/file_path_constants.o.d -I../../../tools/gn/src -I. \ +-isystem/tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/recipe-sysroot-native/usr/include -O2 -pipe \ +-std=c++17 -c ../../../tools/gn/src/base/files/file_path_constants.cc -o src/base/files/file_path_constants.o +|../../../tools/gn/src/base/files/file_path_constants.cc:7:10: fatal error: 'iterator' file not found +|#include +| ^~~~~~~~ +[snip] + +Set three Yocto based GCC triple: poky, oe-core and wind river + +Before aplly the patch +[snip] +$ ../recipe-sysroot-native/usr/bin/clang++ -v +clang version 11.0.1 (https://github.com/llvm/llvm-project 43ff75f2c3feef64f9d73328230d34dac8832a91) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin +[snip] + +After aplly the patch: +[snip] +$ ../recipe-sysroot-native/usr/bin/clang++ -v +clang version 11.0.1 (https://github.com/llvm/llvm-project 22c3241ff9a6224261df48d0258957fd8acc3d64) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir:tmp-glibc/work/x86_64-linux/gn-native/87.0.4280.141-r0/chromium-87.0.4280.141/../recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.1.0 +Selected GCC installation: /usr/lib//x86_64-wrs-linux/10.1.0 +Candidate multilib: .;@m64 +Selected multilib: .;@m64 +[snip] + +BTW, it is hardly to insert a triple by the replacement of TARGET_SYS +(=${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}), since TARGET_VENDOR +is different between clang and clang-native + +The //CLANG_EXTRA_OE_VENDORS_TRIPLES string is replaced with list of +additional triples based on CLANG_EXTRA_OE_VENDORS variable in +recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Martin Jansa +Signed-off-by: Hongxu Jia +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index bddc77cde2d6..5b4271b58337 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2224,6 +2224,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + "x86_64-redhat-linux", "x86_64-suse-linux", + "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", + "x86_64-slackware-linux", "x86_64-unknown-linux", ++ "x86_64-oe-linux",//CLANG_EXTRA_OE_VENDORS_TRIPLES + "x86_64-amazon-linux"}; + static const char *const X32Triples[] = {"x86_64-linux-gnux32", + "x86_64-pc-linux-gnux32"}; diff --git a/meta-clang/recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch b/meta-clang/recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch new file mode 100644 index 0000000000000000000000000000000000000000..1667a968b83813c64ad1d509c8ca856dd48316b3 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0020-llvm-Do-not-use-find_library-for-ncurses.patch @@ -0,0 +1,44 @@ +From 77c05d78ece8599932dc7c53aa43d153471ea13c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 7 Feb 2021 23:58:41 -0800 +Subject: [PATCH] llvm: Do not use find_library for ncurses + +This ensures that it lets OE to decide which lib to link +otherwise it adds absolute paths to linker cmdline and confuses it +horribly with native and target libs when build clang for target + +TOPDIR/build/tmp/work/cortexa57-yoe-linux-musl/clang/12.0.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so: error adding symbols: file in wrong format +clang-12: error: linker command failed with exit code 1 (use -v to see invocation) + +Signed-off-by: Khem Raj +--- + compiler-rt/cmake/config-ix.cmake | 2 +- + llvm/cmake/modules/FindTerminfo.cmake | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake +index cd45176cf2ba..73948a0274cd 100644 +--- a/compiler-rt/cmake/config-ix.cmake ++++ b/compiler-rt/cmake/config-ix.cmake +@@ -160,7 +160,7 @@ else() + set(MAYBE_REQUIRED) + endif() + if(LLVM_ENABLE_TERMINFO) +- find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED}) ++ find_library(COMPILER_RT_TERMINFO_LIB NAMES terminfo tinfo curses ncurses ncursesw ${MAYBE_REQUIRED} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + endif() + if(COMPILER_RT_TERMINFO_LIB) + set(LLVM_ENABLE_TERMINFO 1) +diff --git a/llvm/cmake/modules/FindTerminfo.cmake b/llvm/cmake/modules/FindTerminfo.cmake +index 65edb80fa69a..a58180be8926 100644 +--- a/llvm/cmake/modules/FindTerminfo.cmake ++++ b/llvm/cmake/modules/FindTerminfo.cmake +@@ -11,7 +11,7 @@ + # Additionally, the following import target will be defined: + # Terminfo::terminfo + +-find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw) ++find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + + if(Terminfo_LIBRARIES) + include(CMakePushCheckState) diff --git a/meta-clang/recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch b/meta-clang/recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch new file mode 100644 index 0000000000000000000000000000000000000000..3e0a49c545f72499119d43ac11ca20b2bca5b358 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch @@ -0,0 +1,32 @@ +From addc8d02106241de5c0913fa302c4cca8c6f95ec Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 11 Feb 2021 16:42:49 -0800 +Subject: [PATCH] llvm: Insert anchor for adding OE distro vendor names + +This helps in making right detection for OE built gcc toolchains + +The //CLANG_EXTRA_OE_VENDORS_CASES string is replaced with list of +additional Ceses based on CLANG_EXTRA_OE_VENDORS variable in +recipes-devtools/clang/llvm-project-source.inc:add_more_target_vendors() + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Khem Raj +Signed-off-by: Martin Jansa +--- + llvm/lib/Support/Triple.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp +index 6696d158b2c1..c5aea898ab24 100644 +--- a/llvm/lib/Support/Triple.cpp ++++ b/llvm/lib/Support/Triple.cpp +@@ -542,7 +542,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { + .Case("amd", Triple::AMD) + .Case("mesa", Triple::Mesa) + .Case("suse", Triple::SUSE) +- .Case("oe", Triple::OpenEmbedded) ++ .Case("oe", Triple::OpenEmbedded)//CLANG_EXTRA_OE_VENDORS_CASES + .Default(Triple::UnknownVendor); + } + diff --git a/meta-clang/recipes-devtools/clang/clang/0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch b/meta-clang/recipes-devtools/clang/clang/0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch new file mode 100644 index 0000000000000000000000000000000000000000..529578dfa82b3c734066c9321503289300a17d8f --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch @@ -0,0 +1,68 @@ +From e83ac76ea900deb1b12ad97e1241f67c305a9c04 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 17:32:13 -0700 +Subject: [PATCH] compiler-rt: Do not use backtrace APIs on non-glibc linux + +musl e.g. does not provide backtrace APIs + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../lib/gwp_asan/optional/backtrace_linux_libc.cpp | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +index ea8e72be287d..0344074dd254 100644 +--- a/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp ++++ b/compiler-rt/lib/gwp_asan/optional/backtrace_linux_libc.cpp +@@ -7,7 +7,9 @@ + //===----------------------------------------------------------------------===// + + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +@@ -21,8 +23,11 @@ + namespace { + size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + static_assert(sizeof(uintptr_t) == sizeof(void *), "uintptr_t is not void*"); +- ++#ifdef __GLIBC__ + return backtrace(reinterpret_cast(TraceBuffer), Size); ++#else ++ return -1; ++#endif + } + + // We don't need any custom handling for the Segv backtrace - the libc unwinder +@@ -30,7 +35,11 @@ size_t Backtrace(uintptr_t *TraceBuffer, size_t Size) { + // to avoid the additional frame. + GWP_ASAN_ALWAYS_INLINE size_t SegvBacktrace(uintptr_t *TraceBuffer, size_t Size, + void * /*Context*/) { ++#ifdef __GLIBC__ + return Backtrace(TraceBuffer, Size); ++#else ++ return -1; ++#endif + } + + static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, +@@ -40,6 +49,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + return; + } + ++#ifdef __GLIBC__ + char **BacktraceSymbols = + backtrace_symbols(reinterpret_cast(Trace), TraceLength); + +@@ -53,6 +63,7 @@ static void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, + Printf("\n"); + if (BacktraceSymbols) + free(BacktraceSymbols); ++#endif + } + } // anonymous namespace + diff --git a/meta-clang/recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch b/meta-clang/recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch new file mode 100644 index 0000000000000000000000000000000000000000..2b84007c626f3ca1ca50d9ee72d5f1155963345a --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch @@ -0,0 +1,27 @@ +From 54a8c40d02d02e169f0e646e419e7f72305646af Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 17:56:03 -0700 +Subject: [PATCH] clang: Fix x86 triple for non-debian multiarch linux distros + +OpenEmbedded does not hardcode mutli-arch like debian therefore ensure +that it still uses the proper tuple + +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Linux.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 27951858fb5d..aac45650f97b 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -657,6 +657,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + GCCInstallation.getTriple().getArch() == llvm::Triple::x86 + ? "i386-linux-gnu" + : TripleStr; ++ // OpenEmbedded does not hardcode the triple to i386-linux-gnu like debian ++ if (GCCInstallation.getTriple().getVendor() == llvm::Triple::OpenEmbedded) ++ DebianMultiarch = TripleStr; + + // Try generic GCC detection first. + if (Generic_GCC::addGCCLibStdCxxIncludePaths(DriverArgs, CC1Args, diff --git a/meta-clang/recipes-devtools/clang/clang/0024-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch b/meta-clang/recipes-devtools/clang/clang/0024-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch new file mode 100644 index 0000000000000000000000000000000000000000..02203b7644d712a139924ef3a5fe5f2763d19573 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0024-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch @@ -0,0 +1,28 @@ +From 458b502f8fabf9559d5323225a9ce746fabc05e7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 19 May 2021 21:49:18 -0700 +Subject: [PATCH] compiler-rt: Link scudo with SANITIZER_CXX_ABI_LIBRARIES + +If SANITIZER_CXX_ABI_LIBRARIES is set then link scudo with it, this +fixes build time errors like + +projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.armhf.dir/sanitizer_posix_libcdep.cpp.o: in function `__sanitizer::UnsetAlternateSignalStack()': +| sanitizer_posix_libcdep.cpp:(.text+0x3d2): undefined reference to `__cxa_guard_acquire' + +Signed-off-by: Khem Raj +--- + compiler-rt/lib/scudo/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/compiler-rt/lib/scudo/CMakeLists.txt b/compiler-rt/lib/scudo/CMakeLists.txt +index 31a6976960f7..8f3e291960b0 100644 +--- a/compiler-rt/lib/scudo/CMakeLists.txt ++++ b/compiler-rt/lib/scudo/CMakeLists.txt +@@ -15,6 +15,7 @@ append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_MINIMAL_DYNAMIC_LIBS) ++append_list_if(SANITIZER_CXX_ABI_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARIES} SCUDO_MINIMAL_DYNAMIC_LIBS) + append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer + SCUDO_CFLAGS) + diff --git a/meta-clang/recipes-devtools/clang/clang/0025-libunwind-Added-unw_backtrace-method.patch b/meta-clang/recipes-devtools/clang/clang/0025-libunwind-Added-unw_backtrace-method.patch new file mode 100644 index 0000000000000000000000000000000000000000..597c0654635dd3cab0400d979214c6737fdd473d --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0025-libunwind-Added-unw_backtrace-method.patch @@ -0,0 +1,55 @@ +From 85855552afe94097eaaa0adf904d016af66b3424 Mon Sep 17 00:00:00 2001 +From: Maksim Kita +Date: Sun, 23 May 2021 10:27:29 +0000 +Subject: [PATCH] libunwind: Added unw_backtrace method + +Source: https://github.com/ClickHouse-Extras/libunwind/commit/52f0f7861926cbfaef7e6c97d8a6d7ba2a1f6747#diff-a82fc885e2e4facf4b92d26171c13aa4aa5db296f77e1158ba2f8664e3bd1f5c +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + libunwind/include/libunwind.h | 1 + + libunwind/src/libunwind.cpp | 18 ++++++++++++++++++ + 2 files changed, 19 insertions(+) + +diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h +index f878b46f0348..d922f84011ee 100644 +--- a/libunwind/include/libunwind.h ++++ b/libunwind/include/libunwind.h +@@ -130,6 +130,7 @@ extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; + extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL; + extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL; + //extern int unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*); ++extern int unw_backtrace(void **, int) LIBUNWIND_AVAIL; + + extern unw_addr_space_t unw_local_addr_space; + +diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp +index b8b41ff25e54..ca7d9a01e631 100644 +--- a/libunwind/src/libunwind.cpp ++++ b/libunwind/src/libunwind.cpp +@@ -338,7 +338,25 @@ void __unw_remove_dynamic_eh_frame_section(unw_word_t eh_frame_start) { + #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) + #endif // !defined(__USING_SJLJ_EXCEPTIONS__) + ++int unw_backtrace(void **buffer, int size) { ++ unw_context_t context; ++ unw_cursor_t cursor; ++ if (unw_getcontext(&context) || unw_init_local(&cursor, &context)) { ++ return 0; ++ } ++ ++ unw_word_t ip; ++ int current = 0; ++ while (unw_step(&cursor) > 0) { ++ if (current >= size || unw_get_reg(&cursor, UNW_REG_IP, &ip)) { ++ break; ++ } + ++ buffer[current++] = reinterpret_cast(static_cast(ip)); ++ } ++ ++ return current; ++} + + // Add logging hooks in Debug builds only + #ifndef NDEBUG diff --git a/meta-clang/recipes-devtools/clang/clang/0026-clang-Do-not-use-install-relative-libc-headers.patch b/meta-clang/recipes-devtools/clang/clang/0026-clang-Do-not-use-install-relative-libc-headers.patch new file mode 100644 index 0000000000000000000000000000000000000000..a4fb1819f729a5c7d320c85b8ca035c6a61078e9 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0026-clang-Do-not-use-install-relative-libc-headers.patch @@ -0,0 +1,32 @@ +From 176d5b0f6a46f015854eb48f34922bc34a999d2f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 11 Aug 2021 18:37:11 -0700 +Subject: [PATCH] clang: Do not use install relative libc++ headers + +In OE we use same clang for native and cross builds, therefore we need +to ensure that native sysroot install of libc++ is not searched for +headers when doing cross compile instead it searches the target sysroot +this is especially troublesome when libcxx-native is staged along with +libcxx e.g. chromium + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 5b4271b58337..107ab8d78598 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -3049,7 +3049,9 @@ Generic_GCC::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, + + // Android never uses the libc++ headers installed alongside the toolchain, + // which are generally incompatible with the NDK libraries anyway. +- if (!getTriple().isAndroid()) ++ // And also do not add it when --sysroot is specified, since it would expect ++ // libc++ headers from sysroot ++ if (!getTriple().isAndroid() && SysRoot.empty()) + if (AddIncludePath(getDriver().Dir + "/../include")) + return; + // If this is a development, non-installed, clang, libcxx will diff --git a/meta-clang/recipes-devtools/clang/clang/0027-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch b/meta-clang/recipes-devtools/clang/clang/0027-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch new file mode 100644 index 0000000000000000000000000000000000000000..35f4cfe764db47171a53a3ea02028ac911c5f83a --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0027-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch @@ -0,0 +1,97 @@ +From e58c09f18c4489ed414c2921a37e6e977141b93a Mon Sep 17 00:00:00 2001 +From: David Abdurachmanov +Date: Wed, 20 Oct 2021 17:30:36 -0700 +Subject: [PATCH] clang: Fix how driver finds GCC installation path on + OpenEmbedded + +Fix how Clang Driver finds GCC installation path on OpenEmbedded + +- For RISCV (riscv{32,64}) we define new two multi-lib options without any + subdirectories (e.g., lib32/ilp32d or lib64/lp64d). OpenEmbedded GCC + builds don't use them. +- Modify how Clang Driver finds GCC installation path. This is important + because GCC files on OpenEmbedded are in two different directories: + (1) /usr/bin/../lib/gcc/riscv64-oe-linux/9.2.0 + (2) /usr/lib/riscv64-oe-linux/9.2.0 + +Clang Driver will check (1) first. The directory exist, but will produce +no valid multi-libs and there will be no multi-lib selected. (2) contains +actual GCC run-time objects/libraries, but because the path has exact +same GCC version (9.2.0) it will be skipped. + +We modify the approach by allowing to check other directories with the same +GCC version. We also avoid picking GCC installation path if it results in +an empty multi-lib list. + +Upstream-Status: Pending +Signed-off-by: David Abdurachmanov +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 39 +++++++++++++++++++++-------- + 1 file changed, 28 insertions(+), 11 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 107ab8d78598..b5ee01c566e3 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -1737,18 +1737,29 @@ static void findRISCVMultilibs(const Driver &D, + return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result); + + FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS()); +- Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); +- Multilib Ilp32f = ++ MultilibSet RISCVMultilibs; ++ ++ if (TargetTriple.getVendor() == llvm::Triple::OpenEmbedded) { ++ Multilib OpenEmbeddedIlp32d = makeMultilib("").flag("+m32").flag("+mabi=ilp32d"); ++ Multilib OpenEmbeddedLp64d = makeMultilib("").flag("+m64").flag("+mabi=lp64d"); ++ RISCVMultilibs = ++ MultilibSet() ++ .Either({OpenEmbeddedIlp32d, OpenEmbeddedLp64d}) ++ .FilterOut(NonExistent); ++ } else { ++ Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32"); ++ Multilib Ilp32f = + makeMultilib("lib32/ilp32f").flag("+m32").flag("+mabi=ilp32f"); +- Multilib Ilp32d = ++ Multilib Ilp32d = + makeMultilib("lib32/ilp32d").flag("+m32").flag("+mabi=ilp32d"); +- Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); +- Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); +- Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); +- MultilibSet RISCVMultilibs = +- MultilibSet() +- .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) +- .FilterOut(NonExistent); ++ Multilib Lp64 = makeMultilib("lib64/lp64").flag("+m64").flag("+mabi=lp64"); ++ Multilib Lp64f = makeMultilib("lib64/lp64f").flag("+m64").flag("+mabi=lp64f"); ++ Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d"); ++ RISCVMultilibs = ++ MultilibSet() ++ .Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d}) ++ .FilterOut(NonExistent); ++ } + + Multilib::flags_list Flags; + bool IsRV64 = TargetTriple.getArch() == llvm::Triple::riscv64; +@@ -2674,13 +2685,19 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + continue; // Saw this path before; no need to look at it again. + if (CandidateVersion.isOlderThan(4, 1, 1)) + continue; +- if (CandidateVersion <= Version) ++ if (CandidateVersion < Version) + continue; + + if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(), + NeedsBiarchSuffix)) + continue; + ++ // We might have found existing directory with GCCVersion, but it ++ // might not have GCC libraries we are looking for (i.e. return an ++ // empty Mulilibs) ++ if (Multilibs.size() == 0) ++ continue; ++ + Version = CandidateVersion; + GCCTriple.setTriple(CandidateTriple); + // FIXME: We hack together the directory name here instead of diff --git a/meta-clang/recipes-devtools/clang/clang/0028-Fix-lib-paths-for-OpenEmbedded-Host.patch b/meta-clang/recipes-devtools/clang/clang/0028-Fix-lib-paths-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000000000000000000000000000000000000..d3db1eb87c0523b3dc5e9963b75d7582536604c6 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0028-Fix-lib-paths-for-OpenEmbedded-Host.patch @@ -0,0 +1,79 @@ +From a1ef24c4217263bc4914e5e1ad21da79211ea4cc Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Tue, 7 Dec 2021 04:08:22 +0000 +Subject: [PATCH] Fix lib paths for OpenEmbedded Host + +Under OpenEmbedded Host, while building with clang-native, it cannot find +the GCCInstallPath, which causing following error: +[snip] +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +-target x86_64-linux +-isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include +-O2 -pipe +/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` +hosttools/ld: cannot find crtbeginS.o: No such file or directory +[snip] + +Before this patch: +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) +Target: x86_64-unknown-linux-gnu +Thread model: posix +InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 + +After this patch: +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +clang version 13.0.1 (https://github.com/llvm/llvm-project 08e3a5ccd952edee36b3c002e3a29c6b1b5153de) +Thread model: posix +InstalledDir: /build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +Found candidate GCC installation: /usr/lib/gcc/x86_64-wrs-linux/10.2.0 +Found candidate GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 +Selected GCC installation: /usr/lib/x86_64-wrs-linux/10.2.0 +Candidate multilib: .;@m64 +Selected multilib: .;@m64 + +Summary: +For OpenEmbedded Host, sysroots are of the form/usr/lib//x.y.z. +Take x86-64 as example, the default triple is x86_64-unknown-linux-gnu. +For clang-native, the target vendor is '-unknown', need to test current distro +to follow above form. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Changqing Li +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index b5ee01c566e3..f9dce01b579f 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -23,6 +23,7 @@ + #include "clang/Driver/Options.h" + #include "clang/Driver/Tool.h" + #include "clang/Driver/ToolChain.h" ++#include "clang/Driver/Distro.h" + #include "llvm/Option/ArgList.h" + #include "llvm/Support/CodeGen.h" + #include "llvm/Support/Path.h" +@@ -2643,6 +2644,7 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + const llvm::Triple &TargetTriple, const ArgList &Args, + const std::string &LibDir, StringRef CandidateTriple, + bool NeedsBiarchSuffix, bool GCCDirExists, bool GCCCrossDirExists) { ++ Distro Distro(D.getVFS(), TargetTriple); + // Locations relative to the system lib directory where GCC's triple-specific + // directories might reside. + struct GCCLibSuffix { +@@ -2660,7 +2662,8 @@ void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple( + // files in that location, not just GCC installation data. + {CandidateTriple.str(), "..", + TargetTriple.getVendor() == llvm::Triple::Freescale || +- TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}, ++ TargetTriple.getVendor() == llvm::Triple::OpenEmbedded || ++ Distro.IsOpenEmbedded()}, + + // This is the normal place. + {"gcc/" + CandidateTriple.str(), "../..", GCCDirExists}, diff --git a/meta-clang/recipes-devtools/clang/clang/0029-Correct-library-search-path-for-OpenEmbedded-Host.patch b/meta-clang/recipes-devtools/clang/clang/0029-Correct-library-search-path-for-OpenEmbedded-Host.patch new file mode 100644 index 0000000000000000000000000000000000000000..80710fc7f08ef316464a8b345aede39a2de638dc --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0029-Correct-library-search-path-for-OpenEmbedded-Host.patch @@ -0,0 +1,84 @@ +From 8691b31bfbebf0b5ad31f7f164470b2d3d17b15d Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Tue, 7 Dec 2021 04:55:48 +0000 +Subject: [PATCH] Correct library search path for OpenEmbedded Host + +For OpenEmbedded Host, the gcc install path is +/usr/lib/x86_64-[distroname]-linux/[gcc-version]. +So the library search path is not found with default triple +'x86_64-linux-gnu' for x86_64. Causing following error: +[snip] +compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang +-target x86_64-linux +-isystem/path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/include +-O2 -pipe +/path/to/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/share/cmake-3.21/Modules/CMakeCCompilerABI.c` +| /build/tmp-glibc/hosttools/ld: cannot find -lgcc +| /build/tmp-glibc/hosttools/ld: cannot find -lgcc +| clang-13: error: linker command failed with exit code 1 (use -v to see invocation) +[snip] + +before this patch: +b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs +programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +libraries: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib + +after this patch: +b59da142f2b0:$ /path/to/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/clang --print-search-dirs +programs: =/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin +libraries: =/build/tmp-glibc/work/x84_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/lib/clang/13.0.1:/usr/lib/x86_64-wrs-linux/10.2.0://lib/x86_64-wrs-linux://usr/lib/x86_64-wrs-linux:/build/tmp-glibc/work/x86_64-linux/compiler-rt-native/13.0.1-r0/recipe-sysroot-native/usr/bin/../lib://lib://usr/lib + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Changqing Li +Signed-off-by: Khem Raj +--- + clang/include/clang/Driver/Distro.h | 2 ++ + clang/lib/Driver/Distro.cpp | 1 + + clang/lib/Driver/ToolChains/Linux.cpp | 1 + + 3 files changed, 4 insertions(+) + +diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h +index 01d66b30b038..4d5aa366a005 100644 +--- a/clang/include/clang/Driver/Distro.h ++++ b/clang/include/clang/Driver/Distro.h +@@ -45,6 +45,7 @@ public: + RHEL7, + Fedora, + Gentoo, ++ //CLANG_EXTRA_OE_DISTRO_NAME + OpenSUSE, + UbuntuHardy, + UbuntuIntrepid, +@@ -134,6 +135,7 @@ public: + + bool IsGentoo() const { return DistroVal == Gentoo; } + ++ //CLANG_EXTRA_OE_DISTRO_CHECK + /// @} + }; + +diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp +index 1898667279cc..ab7bc8d45ac1 100644 +--- a/clang/lib/Driver/Distro.cpp ++++ b/clang/lib/Driver/Distro.cpp +@@ -44,6 +44,7 @@ static Distro::DistroType DetectOsRelease(llvm::vfs::FileSystem &VFS) { + .Case("sles", Distro::OpenSUSE) + .Case("opensuse", Distro::OpenSUSE) + .Case("exherbo", Distro::Exherbo) ++ //CLANG_EXTRA_OE_DISTRO_CASE + .Default(Distro::UnknownDistro); + return Version; + } +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index aac45650f97b..3c4034ea4921 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -77,6 +77,7 @@ std::string Linux::getMultiarchTriple(const Driver &D, + return "x86_64-linux-android"; + if (TargetEnvironment == llvm::Triple::GNUX32) + return "x86_64-linux-gnux32"; ++ //CLANG_EXTRA_OE_DISTRO_TRIPLE + return "x86_64-linux-gnu"; + case llvm::Triple::aarch64: + if (IsAndroid) diff --git a/meta-clang/recipes-devtools/clang/clang/0030-lldb-Link-with-libatomic-on-x86.patch b/meta-clang/recipes-devtools/clang/clang/0030-lldb-Link-with-libatomic-on-x86.patch new file mode 100644 index 0000000000000000000000000000000000000000..e81f9455d5dc78f484291a03e0af6c703c7071fc --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0030-lldb-Link-with-libatomic-on-x86.patch @@ -0,0 +1,33 @@ +From d63ad7dc689b4c6e7d30614bc70ab43f4c50c62c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 8 Feb 2022 01:31:26 -0800 +Subject: [PATCH] lldb: Link with libatomic on x86 + +cmake atomic check is not sufficient for i686 target where clang14 still +generates __atomic_store calls but the check does not entail this +function and happily thinks that compiler can resolve all atomic via intrinsics +on i686, but thats not the case, ideally the check for determining +atomic operation should be make more robust but until then lets ask to +link with libatomic on i686/linux + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj +--- + lldb/source/Utility/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt +index 1a92c033fac4..a0d8f3288c06 100644 +--- a/lldb/source/Utility/CMakeLists.txt ++++ b/lldb/source/Utility/CMakeLists.txt +@@ -19,6 +19,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") + list(APPEND LLDB_SYSTEM_LIBS ws2_32 rpcrt4) + endif () + ++if (CMAKE_SYSTEM_PROCESSOR MATCHES "i686" AND CMAKE_SYSTEM_NAME MATCHES "Linux") ++ list(APPEND LLDB_SYSTEM_LIBS atomic) ++endif() ++ + if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB ) + list(APPEND LLDB_SYSTEM_LIBS atomic) + endif() diff --git a/meta-clang/recipes-devtools/clang/clang/0031-clang-exclude-openembedded-distributions-from-settin.patch b/meta-clang/recipes-devtools/clang/clang/0031-clang-exclude-openembedded-distributions-from-settin.patch new file mode 100644 index 0000000000000000000000000000000000000000..59723ea49c893ee18d10a486d80a4aeb7c333c98 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0031-clang-exclude-openembedded-distributions-from-settin.patch @@ -0,0 +1,35 @@ +From 556bf92b3b502cc1eeb9a435c241ca2ce3f6968b Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 11 Feb 2022 12:29:14 -0800 +Subject: [PATCH] clang: exclude openembedded distributions from setting rpath + on openmp executables + +OpenEmbedded based SDKs stage toolchains outsides the target rootfs and +libomp.so is part of the target rootfs and not part of compiler +toolchain install or relative to it. It finds the libraries via +--sysroot during compile. This ensures that -rpath is not added for such +systems, since it is adding cross-compile paths to rpath which is not +correct when the binaries are run on real targets. + +Upstream-Status: Submitted [https://reviews.llvm.org/D119590] +Signed-off-by: Khem Raj +--- + clang/lib/Driver/ToolChains/CommonArgs.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp +index c8eabfac21dc..6e1e626a90ea 100644 +--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp +@@ -649,6 +649,11 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, + void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC, + const ArgList &Args, + ArgStringList &CmdArgs) { ++ // OpenEmbedded/Yocto installs libomp.so into /usr/lib ++ // therefore using -rpath is not needed, on the contrary it adds ++ // paths from cross compiler install location which is not correct ++ if (TC.getTriple().getVendor() == llvm::Triple::OpenEmbedded) ++ return; + + if (Args.hasFlag(options::OPT_fopenmp_implicit_rpath, + options::OPT_fno_openmp_implicit_rpath, true)) { diff --git a/meta-clang/recipes-devtools/clang/clang/0032-compiler-rt-Enable-__int128-for-ppc32.patch b/meta-clang/recipes-devtools/clang/clang/0032-compiler-rt-Enable-__int128-for-ppc32.patch new file mode 100644 index 0000000000000000000000000000000000000000..ba839c827b09636a483be81ebd70219356215ad2 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0032-compiler-rt-Enable-__int128-for-ppc32.patch @@ -0,0 +1,73 @@ +From c9784a9dff18bce24e68f8d5654c57c2345babff Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 9 Mar 2022 16:28:16 -0800 +Subject: [PATCH] compiler-rt: Enable __int128 for ppc32 + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + compiler-rt/lib/builtins/CMakeLists.txt | 15 +++++++-------- + compiler-rt/lib/builtins/int_types.h | 2 +- + 2 files changed, 8 insertions(+), 9 deletions(-) + +diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt +index ec668e294d6d..72556d2fc58e 100644 +--- a/compiler-rt/lib/builtins/CMakeLists.txt ++++ b/compiler-rt/lib/builtins/CMakeLists.txt +@@ -628,11 +628,9 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES} + set(mips64el_SOURCES ${GENERIC_TF_SOURCES} + ${mips_SOURCES}) + +-set(powerpc_SOURCES ${GENERIC_SOURCES}) +- + set(powerpcspe_SOURCES ${GENERIC_SOURCES}) + +-set(powerpc64_SOURCES ++set(powerpc_SOURCES + ppc/divtc3.c + ppc/fixtfdi.c + ppc/fixunstfdi.c +@@ -647,14 +645,15 @@ set(powerpc64_SOURCES + ) + # These routines require __int128, which isn't supported on AIX. + if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX") +- set(powerpc64_SOURCES ++ set(powerpc_SOURCES + ppc/floattitf.c + ppc/fixtfti.c + ppc/fixunstfti.c +- ${powerpc64_SOURCES} ++ ${powerpc_SOURCES} + ) + endif() +-set(powerpc64le_SOURCES ${powerpc64_SOURCES}) ++set(powerpc64le_SOURCES ${powerpc_SOURCES}) ++set(powerpc64_SOURCES ${powerpc_SOURCES}) + + set(riscv_SOURCES + riscv/save.S +@@ -761,9 +760,9 @@ else () + list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET) + endif() + +- # For RISCV32, we must force enable int128 for compiling long ++ # For RISCV32/PPC32, we must force enable int128 for compiling long + # double routines. +- if("${arch}" STREQUAL "riscv32") ++ if("${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc" ) + list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128) + endif() + +diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h +index 7a72de480676..9ee5a327b28a 100644 +--- a/compiler-rt/lib/builtins/int_types.h ++++ b/compiler-rt/lib/builtins/int_types.h +@@ -64,7 +64,7 @@ typedef union { + } udwords; + + #if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \ +- defined(__riscv) || defined(_WIN64) ++ defined(__riscv) || defined(_WIN64) || defined(__powerpc__) + #define CRT_HAS_128BIT + #endif + diff --git a/meta-clang/recipes-devtools/clang/clang/0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch b/meta-clang/recipes-devtools/clang/clang/0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch new file mode 100644 index 0000000000000000000000000000000000000000..1cea38c624542b7e50388c3214cbbe80b41fb64d --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch @@ -0,0 +1,60 @@ +From fde148342b7475a1d83cf270db1c912a22d950f7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 12 Aug 2022 11:50:57 -0700 +Subject: [PATCH] llvm: Do not use cmake infra to detect libzstd + +OE's version is build using plain make not cmake as a result we do not +have the cmake support files and this probing method can get this info +from build host and force linking with libzstd from /usr/lib which is +not what we want when cross building. + +Fixes errors building llvm-config like +/usr/lib/libzstd.so.1.5.2: error adding symbols: file in wrong +format +| clang-15: error: linker command failed with exit code 1 (use -v to see invocation) +| ninja: build stopped: subcommand failed. + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Khem Raj +--- + llvm/lib/Support/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/llvm/lib/Support/CMakeLists.txt ++++ b/llvm/lib/Support/CMakeLists.txt +@@ -22,7 +22,7 @@ if (HAS_WERROR_GLOBAL_CTORS) + endif() + + if(LLVM_ENABLE_ZLIB) +- list(APPEND imported_libs ZLIB::ZLIB) ++ list(APPEND imported_libs z) + endif() + + if(LLVM_ENABLE_ZSTD) +@@ -34,7 +34,7 @@ if(LLVM_ENABLE_ZSTD) + endif() + + if(LLVM_ENABLE_ZSTD) +- list(APPEND imported_libs ${zstd_target}) ++ list(APPEND imported_libs zstd) + endif() + + if( MSVC OR MINGW ) +@@ -301,7 +301,7 @@ if(LLVM_ENABLE_ZLIB) + get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION) + endif() + get_library_name(${zlib_library} zlib_library) +- set(llvm_system_libs ${llvm_system_libs} "${zlib_library}") ++ set(llvm_system_libs ${llvm_system_libs} z) + endif() + + if(LLVM_ENABLE_ZSTD) +@@ -314,7 +314,7 @@ if(LLVM_ENABLE_ZSTD) + get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION) + endif() + get_library_name(${zstd_library} zstd_library) +- set(llvm_system_libs ${llvm_system_libs} "${zstd_library}") ++ set(llvm_system_libs ${llvm_system_libs} zstd) + endif() + + if(LLVM_ENABLE_TERMINFO) diff --git a/meta-clang/recipes-devtools/clang/clang/0034-Revert-MIPS-compiler-rt-Fix-stat-struct-s-size-for-O.patch b/meta-clang/recipes-devtools/clang/clang/0034-Revert-MIPS-compiler-rt-Fix-stat-struct-s-size-for-O.patch new file mode 100644 index 0000000000000000000000000000000000000000..a339caa19f44accaf5deb790cbe633ff5e0af09e --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/0034-Revert-MIPS-compiler-rt-Fix-stat-struct-s-size-for-O.patch @@ -0,0 +1,32 @@ +From c7e8baa12d20683d2e824d4ea2193d26ba46e9d2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 11 Sep 2022 16:15:36 -0700 +Subject: [PATCH] Revert "[MIPS][compiler-rt] Fix stat struct's size for O32 + ABI" + +This reverts commit 2bfb0fcb51510f22723c8cdfefe2a796a0a5ab25. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + .../lib/sanitizer_common/sanitizer_platform_limits_posix.h | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +index bd5692ed511b..a6091307bdce 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -98,10 +98,9 @@ const unsigned struct_kernel_stat64_sz = 104; + const unsigned struct_kernel_stat_sz = 144; + const unsigned struct_kernel_stat64_sz = 104; + #elif defined(__mips__) +-const unsigned struct_kernel_stat_sz = +- SANITIZER_ANDROID +- ? FIRST_32_SECOND_64(104, 128) +- : FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216); ++const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID ++ ? FIRST_32_SECOND_64(104, 128) ++ : FIRST_32_SECOND_64(160, 216); + const unsigned struct_kernel_stat64_sz = 104; + #elif defined(__s390__) && !defined(__s390x__) + const unsigned struct_kernel_stat_sz = 64; diff --git a/meta-clang/recipes-devtools/clang/clang/libunwind.pc.in b/meta-clang/recipes-devtools/clang/clang/libunwind.pc.in new file mode 100644 index 0000000000000000000000000000000000000000..a93d676604f914295c1fd6c8f91f49b10b3502e5 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/libunwind.pc.in @@ -0,0 +1,9 @@ +prefix=/usr +exec_prefix=/usr +libdir=@LIBDIR@ +includedir=/usr/include + +Name: libunwind +Description: libunwind base library +Version: @VERSION@ +Libs: -lunwind diff --git a/meta-clang/recipes-devtools/clang/clang/llvm-config b/meta-clang/recipes-devtools/clang/clang/llvm-config new file mode 100644 index 0000000000000000000000000000000000000000..88a19084ba56e9f347b8add73c9cb05bcc9b2b32 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang/llvm-config @@ -0,0 +1,43 @@ +#!/bin/bash +# +# Wrapper script for llvm-config. Supplies the right environment variables +# for the target and delegates to the native llvm-config for anything else. This +# is needed because arguments like --ldflags, --cxxflags, etc. are set by the +# native compile rather than the target compile. +# +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" +export YOCTO_ALTERNATE_EXE_PATH="${YOCTO_ALTERNATE_EXE_PATH:="$(readlink -f "$SCRIPT_DIR/../llvm-config")"}" +export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib"}" +if [[ $# == 0 ]]; then + exec "$NEXT_LLVM_CONFIG" +fi + +if [[ $1 == "--libs" ]]; then + exec "$NEXT_LLVM_CONFIG" $@ +fi + +if [[ $1 == "--bindir" ]]; then + unset YOCTO_ALTERNATE_EXE_PATH + exec "$NEXT_LLVM_CONFIG" $@ +fi + +for arg in "$@"; do + case "$arg" in + --cppflags) + echo $CPPFLAGS + ;; + --cflags) + echo $CFLAGS + ;; + --cxxflags) + echo $CXXFLAGS + ;; + --ldflags) + echo $LDFLAGS + ;; + *) + echo "$("$NEXT_LLVM_CONFIG" "$arg")" + ;; + esac +done diff --git a/meta-clang/recipes-devtools/clang/clang_git.bb b/meta-clang/recipes-devtools/clang/clang_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..80ff2a4e92b616dfe8996d2e074a434ff3021241 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/clang_git.bb @@ -0,0 +1,424 @@ +# Copyright (C) 2014 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "LLVM based C/C++ compiler" +HOMEPAGE = "http://clang.llvm.org/" +SECTION = "devel" + +require clang.inc +require common-source.inc + +INHIBIT_DEFAULT_DEPS = "1" + +BUILD_CC:class-nativesdk = "clang" +BUILD_CXX:class-nativesdk = "clang++" +BUILD_AR:class-nativesdk = "llvm-ar" +BUILD_RANLIB:class-nativesdk = "llvm-ranlib" +BUILD_NM:class-nativesdk = "llvm-nm" +LDFLAGS:remove:class-nativesdk = "-fuse-ld=lld" + +LDFLAGS:append:class-target:riscv32 = " -Wl,--no-as-needed -latomic -Wl,--as-needed" +LDFLAGS:append:class-target:mips = " -Wl,--no-as-needed -latomic -Wl,--as-needed" + +inherit cmake cmake-native pkgconfig python3native + +OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" + +def get_clang_experimental_arch(bb, d, arch_var): + import re + a = d.getVar(arch_var, True) + return "" + +def get_clang_arch(bb, d, arch_var): + import re + a = d.getVar(arch_var, True) + if re.match('(i.86|athlon|x86.64)$', a): return 'X86' + elif re.match('arm$', a): return 'ARM' + elif re.match('armeb$', a): return 'ARM' + elif re.match('aarch64$', a): return 'AArch64' + elif re.match('aarch64_be$', a): return 'AArch64' + elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips' + elif re.match('riscv32$', a): return 'riscv32' + elif re.match('riscv64$', a): return 'riscv64' + elif re.match('p(pc|owerpc)(|64)', a): return 'PowerPC' + else: + bb.note("'%s' is not a primary llvm architecture" % a) + return "" + +def get_clang_host_arch(bb, d): + return get_clang_arch(bb, d, 'HOST_ARCH') + +def get_clang_target_arch(bb, d): + return get_clang_arch(bb, d, 'TARGET_ARCH') + +def get_clang_experimental_target_arch(bb, d): + return get_clang_experimental_arch(bb, d, 'TARGET_ARCH') + +PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs lldb-wchar \ + ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)} \ + ${@bb.utils.contains('RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)} \ + rtti eh libedit terminfo \ + " +PACKAGECONFIG:class-native = "rtti eh libedit shared-libs ${@bb.utils.contains('RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)}" +PACKAGECONFIG:class-nativesdk = "rtti eh libedit shared-libs ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)} ${@bb.utils.contains('RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)}" + +PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,," +PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,," +PACKAGECONFIG[unwindlib] = "-DCLANG_DEFAULT_UNWINDLIB=libunwind,-DCLANG_DEFAULT_UNWINDLIB=libgcc,," +PACKAGECONFIG[libomp] = "-DCLANG_DEFAULT_OPENMP_RUNTIME=libomp,," +PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," +PACKAGECONFIG[lto] = "-DLLVM_ENABLE_LTO=Full -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils," +PACKAGECONFIG[shared-libs] = "-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON,,," +PACKAGECONFIG[terminfo] = "-DLLVM_ENABLE_TERMINFO=ON -DCOMPILER_RT_TERMINFO_LIB=ON,-DLLVM_ENABLE_TERMINFO=OFF -DCOMPILER_RT_TERMINFO_LIB=OFF,ncurses," +PACKAGECONFIG[pfm] = "-DLLVM_ENABLE_LIBPFM=ON,-DLLVM_ENABLE_LIBPFM=OFF,libpfm," +PACKAGECONFIG[lldb-wchar] = "-DLLDB_EDITLINE_USE_WCHAR=1,-DLLDB_EDITLINE_USE_WCHAR=0," +PACKAGECONFIG[lldb-lua] = "-DLLDB_ENABLE_LUA=ON,-DLLDB_ENABLE_LUA=OFF,lua" +PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,," +PACKAGECONFIG[eh] = "-DLLVM_ENABLE_EH=ON,-DLLVM_ENABLE_EH=OFF,," +PACKAGECONFIG[rtti] = "-DLLVM_ENABLE_RTTI=ON,-DLLVM_ENABLE_RTTI=OFF,," +PACKAGECONFIG[split-dwarf] = "-DLLVM_USE_SPLIT_DWARF=ON,-DLLVM_USE_SPLIT_DWARF=OFF,," +PACKAGECONFIG[libedit] = "-DLLVM_ENABLE_LIBEDIT=ON -DLLDB_ENABLE_LIBEDIT=ON,-DLLVM_ENABLE_LIBEDIT=OFF -DLLDB_ENABLE_LIBEDIT=OFF,libedit libedit-native" + +OECMAKE_SOURCEPATH = "${S}/llvm" + +OECMAKE_TARGET_COMPILE = "${@bb.utils.contains('PACKAGECONFIG', 'bootstrap', 'stage2', 'all', d)}" +OECMAKE_TARGET_INSTALL = "${@bb.utils.contains('PACKAGECONFIG', 'bootstrap', 'stage2-install', 'install', d)}" +BINPATHPREFIX = "${@bb.utils.contains('PACKAGECONFIG', 'bootstrap', '/tools/clang/stage2-bins/NATIVE', '', d)}" + +PASSTHROUGH = "\ +CLANG_DEFAULT_RTLIB;CLANG_DEFAULT_CXX_STDLIB;LLVM_BUILD_LLVM_DYLIB;LLVM_LINK_LLVM_DYLIB;\ +LLVM_ENABLE_ASSERTIONS;LLVM_ENABLE_EXPENSIVE_CHECKS;LLVM_ENABLE_PIC;\ +LLVM_BINDINGS_LIST;LLVM_ENABLE_FFI;FFI_INCLUDE_DIR;LLVM_OPTIMIZED_TABLEGEN;\ +LLVM_ENABLE_RTTI;LLVM_ENABLE_EH;LLVM_BUILD_EXTERNAL_COMPILER_RT;CMAKE_SYSTEM_NAME;\ +CMAKE_BUILD_TYPE;BUILD_SHARED_LIBS;LLVM_ENABLE_PROJECTS;LLVM_BINUTILS_INCDIR;\ +LLVM_TARGETS_TO_BUILD;LLVM_EXPERIMENTAL_TARGETS_TO_BUILD;PYTHON_EXECUTABLE;\ +PYTHON_LIBRARY;PYTHON_INCLUDE_DIR;LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN;LLDB_EDITLINE_USE_WCHAR;\ +LLVM_ENABLE_LIBEDIT;LLDB_ENABLE_LIBEDIT;LLDB_PYTHON_RELATIVE_PATH;LLDB_PYTHON_EXE_RELATIVE_PATH;\ +LLDB_PYTHON_EXT_SUFFIX;CMAKE_C_FLAGS_RELEASE;CMAKE_CXX_FLAGS_RELEASE;CMAKE_ASM_FLAGS_RELEASE;\ +CLANG_DEFAULT_CXX_STDLIB;CLANG_DEFAULT_RTLIB;CLANG_DEFAULT_UNWINDLIB;\ +CLANG_DEFAULT_OPENMP_RUNTIME;LLVM_ENABLE_PER_TARGET_RUNTIME_DIR;\ +" +# +# Default to build all OE-Core supported target arches (user overridable). +# Gennerally setting LLVM_TARGETS_TO_BUILD = "" in local.conf is ok in most simple situations +# where only one target architecture is needed along with just one build arch (usually X86) +# +LLVM_TARGETS_TO_BUILD ?= "AMDGPU;AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86" + +LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= "" +LLVM_EXPERIMENTAL_TARGETS_TO_BUILD:append = ";${@get_clang_experimental_target_arch(bb, d)}" + +HF = "" +HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" +HF[vardepvalue] = "${HF}" + +LLVM_PROJECTS ?= "clang;clang-tools-extra;lld${LLDB}" +LLDB ?= ";lldb" +# LLDB support for RISCV/Mips32 does not work yet +LLDB:riscv32 = "" +LLDB:riscv64 = "" +LLDB:mips = "" +LLDB:mipsel = "" +LLDB:powerpc = "" + +# linux hosts (.so) on Windows .pyd +SOLIBSDEV:mingw32 = ".pyd" + +#CMAKE_VERBOSE = "VERBOSE=1" + +EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF \ + -DLLVM_ENABLE_PIC=ON \ + -DCLANG_DEFAULT_PIE_ON_LINUX=ON \ + -DLLVM_BINDINGS_LIST='' \ + -DLLVM_ENABLE_FFI=ON \ + -DLLVM_ENABLE_ZSTD=ON \ + -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \ + -DLLVM_OPTIMIZED_TABLEGEN=ON \ + -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS_RELEASE='${CXXFLAGS} -DNDEBUG -g0' \ + -DCMAKE_C_FLAGS_RELEASE='${CFLAGS} -DNDEBUG -g0' \ + -DBUILD_SHARED_LIBS=OFF \ + -DLLVM_ENABLE_PROJECTS='${LLVM_PROJECTS}' \ + -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR} \ + -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ + -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD}' \ + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD}' \ +" + +EXTRA_OECMAKE:append:class-native = "\ + -DPYTHON_EXECUTABLE='${PYTHON}' \ +" +EXTRA_OECMAKE:append:class-nativesdk = "\ + -DCMAKE_CROSSCOMPILING:BOOL=ON \ + -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ + -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain-native.cmake' \ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DCMAKE_STRIP=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-strip \ + -DLLVM_USE_HOST_TOOLS=OFF \ + -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ + -DLLDB_TABLEGEN=${STAGING_BINDIR_NATIVE}/lldb-tblgen \ + -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ + -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${STAGING_BINDIR_NATIVE}/clang-tidy-confusable-chars-gen \ + -DCLANG_PSEUDO_GEN=${STAGING_BINDIR_NATIVE}/clang-pseudo-gen \ + -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ + -DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ + -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ + -DPYTHON_EXECUTABLE='${PYTHON}' \ +" +EXTRA_OECMAKE:append:class-target = "\ + -DCMAKE_CROSSCOMPILING:BOOL=ON \ + -DCROSS_TOOLCHAIN_FLAGS_NATIVE='-DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON}' \ + -DLLVM_USE_HOST_TOOLS=OFF \ + -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ + -DLLDB_TABLEGEN=${STAGING_BINDIR_NATIVE}/lldb-tblgen \ + -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ + -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${STAGING_BINDIR_NATIVE}/clang-tidy-confusable-chars-gen \ + -DCLANG_PSEUDO_GEN=${STAGING_BINDIR_NATIVE}/clang-pseudo-gen \ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DCMAKE_STRIP=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-strip \ + -DLLVM_TARGET_ARCH=${@get_clang_target_arch(bb, d)} \ + -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_SYS}${HF} \ + -DLLVM_HOST_TRIPLE=${TARGET_SYS}${HF} \ + -DLLDB_PYTHON_RELATIVE_PATH=${PYTHON_SITEPACKAGES_DIR} \ + -DLLDB_PYTHON_EXE_RELATIVE_PATH=${PYTHON} \ + -DLLDB_PYTHON_EXT_SUFFIX=${SOLIBSDEV} \ + -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ + -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ + -DLLVM_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ + -DPYTHON_EXECUTABLE='${PYTHON}' \ +" + +DEPENDS = "binutils zlib zstd libffi libxml2 libxml2-native ninja-native swig-native" +DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_ARCH} virtual/${TARGET_PREFIX}binutils-crosssdk nativesdk-python3" +DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} python3 compiler-rt libcxx" + +RRECOMMENDS:${PN} = "binutils" +RRECOMMENDS:${PN}:append:class-target = " libcxx-dev" + +do_install:append() { + rm -rf ${D}${libdir}/python*/site-packages/six.py +} + +do_install:append:class-target () { + # Allow bin path to change based on YOCTO_ALTERNATE_EXE_PATH + sed -i 's;${_IMPORT_PREFIX}/bin;${_IMPORT_PREFIX_BIN};g' ${D}${libdir}/cmake/llvm/LLVMExports-release.cmake + + # Insert function to populate Import Variables + sed -i "4i\ +if(DEFINED ENV{YOCTO_ALTERNATE_EXE_PATH})\n\ + execute_process(COMMAND \"llvm-config\" \"--bindir\" OUTPUT_VARIABLE _IMPORT_PREFIX_BIN OUTPUT_STRIP_TRAILING_WHITESPACE)\n\ +else()\n\ + set(_IMPORT_PREFIX_BIN \"\${_IMPORT_PREFIX}/bin\")\n\ +endif()\n" ${D}${libdir}/cmake/llvm/LLVMExports-release.cmake + + if [ -n "${LLVM_LIBDIR_SUFFIX}" ]; then + mkdir -p ${D}${nonarch_libdir} + mv ${D}${libdir}/clang ${D}${nonarch_libdir}/clang + ln -rs ${D}${nonarch_libdir}/clang ${D}${libdir}/clang + rmdir --ignore-fail-on-non-empty ${D}${libdir} + fi + for t in clang clang++ llvm-nm llvm-ar llvm-as llvm-ranlib llvm-strip llvm-objcopy llvm-objdump llvm-readelf \ + llvm-addr2line llvm-dwp llvm-size llvm-strings llvm-cov; do + ln -sf $t ${D}${bindir}/${TARGET_PREFIX}$t + done +} + +do_install:append:class-native () { + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-pseudo-gen ${D}${bindir}/clang-pseudo-gen + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/lldb-tblgen ${D}${bindir}/lldb-tblgen + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen + for f in `find ${D}${bindir} -executable -type f -not -type l`; do + test -n "`file -b $f|grep -i ELF`" && ${STRIP} $f + echo "stripped $f" + done + ln -sf clang-tblgen ${D}${bindir}/clang-tblgen${PV} + ln -sf llvm-tblgen ${D}${bindir}/llvm-tblgen${PV} + ln -sf llvm-config ${D}${bindir}/llvm-config${PV} +} + +do_install:append:class-nativesdk () { + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-pseudo-gen ${D}${bindir}/clang-pseudo-gen + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/lldb-tblgen ${D}${bindir}/lldb-tblgen + install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tidy-confusable-chars-gen ${D}${bindir}/clang-tidy-confusable-chars-gen + for f in `find ${D}${bindir} -executable -type f -not -type l`; do + test -n "`file -b $f|grep -i ELF`" && ${STRIP} $f + done + ln -sf clang-tblgen ${D}${bindir}/clang-tblgen${PV} + ln -sf llvm-tblgen ${D}${bindir}/llvm-tblgen${PV} + ln -sf llvm-config ${D}${bindir}/llvm-config${PV} + rm -rf ${D}${datadir}/llvm/cmake + rm -rf ${D}${datadir}/llvm +} + +PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python ${PN}-libclang-cpp ${PN}-tidy ${PN}-format ${PN}-tools \ + libclang lldb lldb-server liblldb llvm-linker-tools" + +PROVIDES += "llvm llvm${PV}" +PROVIDES:append:class-native = " llvm-native" + +BBCLASSEXTEND = "native nativesdk" + +RDEPENDS:lldb += "${PN}-lldb-python lldb-server" + +RRECOMMENDS:${PN}-tidy += "${PN}-tools" + +FILES:llvm-linker-tools = "${libdir}/LLVMgold* ${libdir}/libLTO.so.* ${libdir}/LLVMPolly*" + +FILES:${PN}-libclang-cpp = "${libdir}/libclang-cpp.so.*" + +FILES:${PN}-lldb-python = "${libdir}/python*/site-packages/lldb/*" + +FILES:${PN}-tidy = "${bindir}/*clang-tidy*" +FILES:${PN}-format = "${bindir}/*clang-format*" + +FILES:${PN}-tools = "${bindir}/analyze-build \ + ${bindir}/c-index-test \ + ${bindir}/clang-apply-replacements \ + ${bindir}/clang-change-namespace \ + ${bindir}/clang-check \ + ${bindir}/clang-cl \ + ${bindir}/clang-doc \ + ${bindir}/clang-extdef-mapping \ + ${bindir}/clang-include-fixer \ + ${bindir}/clang-linker-wrapper \ + ${bindir}/clang-move \ + ${bindir}/clang-nvlink-wrapper \ + ${bindir}/clang-offload-bundler \ + ${bindir}/clang-offload-packager \ + ${bindir}/clang-offload-wrapper \ + ${bindir}/clang-pseudo \ + ${bindir}/clang-query \ + ${bindir}/clang-refactor \ + ${bindir}/clang-rename \ + ${bindir}/clang-reorder-fields \ + ${bindir}/clang-repl \ + ${bindir}/clang-scan-deps \ + ${bindir}/diagtool \ + ${bindir}/find-all-symbols \ + ${bindir}/hmaptool \ + ${bindir}/hwasan_symbolize \ + ${bindir}/intercept-build \ + ${bindir}/modularize \ + ${bindir}/pp-trace \ + ${bindir}/sancov \ + ${bindir}/scan-build \ + ${bindir}/scan-build-py \ + ${bindir}/scan-view \ + ${bindir}/split-file \ + ${libdir}/libscanbuild/* \ + ${libdir}/libear/* \ + ${libexecdir}/analyze-c++ \ + ${libexecdir}/analyze-cc \ + ${libexecdir}/c++-analyzer \ + ${libexecdir}/ccc-analyzer \ + ${libexecdir}/intercept-c++ \ + ${libexecdir}/intercept-cc \ + ${datadir}/scan-build/* \ + ${datadir}/scan-view/* \ + ${datadir}/opt-viewer/* \ + ${datadir}/clang/* \ +" + +FILES:${PN} += "\ + ${libdir}/BugpointPasses.so \ + ${libdir}/LLVMHello.so \ + ${libdir}/LLVMgold.so \ + ${libdir}/*Plugin.so \ + ${libdir}/${BPN} \ + ${nonarch_libdir}/${BPN}/*/include/ \ + ${datadir}/scan-* \ + ${nonarch_libdir}/libscanbuild \ + ${datadir}/opt-viewer/ \ +" + +FILES:lldb = "\ + ${bindir}/lldb \ + ${bindir}/lldb-argdumper \ + ${bindir}/lldb-instr \ + ${bindir}/lldb-vscode \ +" + +FILES:lldb-server = "\ + ${bindir}/lldb-server \ +" + +FILES:liblldb = "\ + ${libdir}/liblldbIntelFeatures.so* \ + ${libdir}/liblldb.so* \ +" + +FILES:${PN}-libllvm =+ "\ + ${libdir}/libLLVM-${MAJOR_VER}.${MINOR_VER}.so \ + ${libdir}/libLLVM-${MAJOR_VER}.so \ + ${libdir}/libLLVM-${MAJOR_VER}git.so \ + ${libdir}/libLLVM-${MAJOR_VER}.${MINOR_VER}git.so \ + ${libdir}/libRemarks.so.* \ +" + +FILES:libclang = "\ + ${libdir}/libclang.so.* \ +" + +FILES:${PN}-dev += "\ + ${datadir}/llvm/cmake \ + ${libdir}/cmake \ + ${nonarch_libdir}/libear \ + ${nonarch_libdir}/${BPN}/*.la \ +" + +FILES:${PN}-staticdev += "${nonarch_libdir}/${BPN}/*.a" + +FILES:${PN}-staticdev:remove = "${libdir}/${BPN}/*.a" +FILES:${PN}-dev:remove = "${libdir}/${BPN}/*.la" +FILES:${PN}:remove = "${libdir}/${BPN}/*" + + +INSANE_SKIP:${PN} += "already-stripped" +#INSANE_SKIP:${PN}-dev += "dev-elf" +INSANE_SKIP:${PN}-lldb-python += "dev-so dev-deps" +INSANE_SKIP:liblldb = "dev-so" + +#Avoid SSTATE_SCAN_COMMAND running sed over llvm-config. +SSTATE_SCAN_FILES:remove = "*-config" + +TOOLCHAIN = "clang" +TOOLCHAIN:class-native = "gcc" +TOOLCHAIN:class-nativesdk = "clang" +COMPILER_RT:class-nativesdk:toolchain-clang:runtime-llvm = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-nativesdk:toolchain-clang:runtime-llvm = "-stdlib=libstdc++" + +SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" + +SYSROOT_PREPROCESS_FUNCS:append:class-target = " clang_sysroot_preprocess" + +clang_sysroot_preprocess() { + install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ + install -m 0755 ${S}/../llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/ + ln -sf llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV} + # LLDTargets.cmake references the lld executable(!) that some modules/plugins link to + install -d ${SYSROOT_DESTDIR}${bindir} + for f in lld diagtool clang-${MAJOR_VER} clang-format clang-offload-packager \ + clang-offload-bundler clang-offload-wrapper clang-scan-deps clang-repl \ + clang-rename clang-refactor clang-check clang-extdef-mapping clang-apply-replacements \ + clang-reorder-fields clang-tidy clang-change-namespace clang-doc clang-include-fixer \ + find-all-symbols clang-move clang-query pp-trace clang-pseudo clangd modularize + do + install -m 755 ${D}${bindir}/$f ${SYSROOT_DESTDIR}${bindir}/ + done +} diff --git a/meta-clang/recipes-devtools/clang/common-source.inc b/meta-clang/recipes-devtools/clang/common-source.inc new file mode 100644 index 0000000000000000000000000000000000000000..e7fb06fb5fb5fb4378ef0fd7ff467ef736598c3f --- /dev/null +++ b/meta-clang/recipes-devtools/clang/common-source.inc @@ -0,0 +1,11 @@ +do_fetch() { + : +} +do_fetch[noexec] = "1" +deltask do_unpack +deltask do_patch + +SRC_URI = "" + +do_configure[depends] += "llvm-project-source-${PV}:do_patch" +do_populate_lic[depends] += "llvm-project-source-${PV}:do_unpack" diff --git a/meta-clang/recipes-devtools/clang/common.inc b/meta-clang/recipes-devtools/clang/common.inc new file mode 100644 index 0000000000000000000000000000000000000000..a0f8a00d874bf1e25e517b0e0fe283d390ceb3f8 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/common.inc @@ -0,0 +1,57 @@ +FILESEXTRAPATHS =. "${FILE_DIRNAME}/clang:" + +LIC_FILES_CHKSUM = "file://llvm/LICENSE.TXT;md5=${LLVMMD5SUM} \ + file://clang/LICENSE.TXT;md5=${CLANGMD5SUM} \ +" +LICENSE = "Apache-2.0-with-LLVM-exception" + +BASEURI ??= "${LLVM_GIT}/llvm-project;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH}" +SRC_URI = "\ + ${BASEURI} \ + file://llvm-config \ + file://libunwind.pc.in \ + file://0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ + file://0002-compiler-rt-support-a-new-embedded-linux-target.patch \ + file://0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ + file://0004-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ + file://0005-llvm-allow-env-override-of-exe-and-libdir-path.patch \ + file://0006-clang-driver-Check-sysroot-for-ldso-path.patch \ + file://0007-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch \ + file://0008-clang-Prepend-trailing-to-sysroot.patch \ + file://0009-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch \ + file://0010-clang-Define-releative-gcc-installation-dir.patch \ + file://0011-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch \ + file://0012-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ + file://0013-Check-for-atomic-double-intrinsics.patch \ + file://0014-libcxx-Add-compiler-runtime-library-to-link-step-for.patch \ + file://0015-clang-llvm-cmake-Fix-configure-for-packages-using-fi.patch \ + file://0016-clang-Fix-resource-dir-location-for-cross-toolchains.patch \ + file://0017-clang-driver-Add-dyld-prefix-when-checking-sysroot-f.patch \ + file://0018-clang-Use-python3-in-python-scripts.patch \ + file://0019-For-x86_64-set-Yocto-based-GCC-install-search-path.patch \ + file://0020-llvm-Do-not-use-find_library-for-ncurses.patch \ + file://0021-llvm-Insert-anchor-for-adding-OE-distro-vendor-names.patch \ + file://0022-compiler-rt-Do-not-use-backtrace-APIs-on-non-glibc-l.patch \ + file://0023-clang-Fix-x86-triple-for-non-debian-multiarch-linux-.patch \ + file://0024-compiler-rt-Link-scudo-with-SANITIZER_CXX_ABI_LIBRAR.patch \ + file://0025-libunwind-Added-unw_backtrace-method.patch \ + file://0026-clang-Do-not-use-install-relative-libc-headers.patch \ + file://0027-clang-Fix-how-driver-finds-GCC-installation-path-on-.patch \ + file://0028-Fix-lib-paths-for-OpenEmbedded-Host.patch \ + file://0029-Correct-library-search-path-for-OpenEmbedded-Host.patch \ + file://0030-lldb-Link-with-libatomic-on-x86.patch \ + file://0031-clang-exclude-openembedded-distributions-from-settin.patch \ + file://0032-compiler-rt-Enable-__int128-for-ppc32.patch \ + file://0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ + file://0034-Revert-MIPS-compiler-rt-Fix-stat-struct-s-size-for-O.patch \ + " +# Fallback to no-PIE if not set +GCCPIE ??= "" + +S = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}/git" +B = "${WORKDIR}/llvm-project-source-${PV}/build.${HOST_SYS}.${TARGET_SYS}" + +# We need to ensure that for the shared work directory, the do_patch signatures match +# The real WORKDIR location isn't a dependency for the shared workdir. +src_patches[vardepsexclude] = "WORKDIR" +should_apply[vardepsexclude] += "PN" diff --git a/meta-clang/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/meta-clang/recipes-devtools/clang/compiler-rt-sanitizers_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..bdf8fe3970f0abf5d0303bd0670712029463dbbb --- /dev/null +++ b/meta-clang/recipes-devtools/clang/compiler-rt-sanitizers_git.bb @@ -0,0 +1,108 @@ +# Copyright (C) 2021 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "LLVM based C/C++ compiler Runtime" +HOMEPAGE = "http://compiler-rt.llvm.org/" +SECTION = "base" + +require clang.inc +require common-source.inc + +inherit cmake pkgconfig python3native + + +LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" + +TUNE_CCARGS:remove = "-no-integrated-as" + +DEPENDS += "ninja-native virtual/crypt" +DEPENDS:append:class-native = " clang-native libxcrypt-native" +DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_ARCH} nativesdk-libxcrypt" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" +PACKAGECONFIG[static-libcxx] = "-DSANITIZER_USE_STATIC_CXX_ABI=ON -DSANITIZER_USE_STATIC_LLVM_UNWINDER=ON -DCOMPILER_RT_ENABLE_STATIC_UNWINDER=ON,," + +HF = "" +HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" +HF[vardepvalue] = "${HF}" + +OECMAKE_TARGET_COMPILE = "compiler-rt" +OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" +OECMAKE_SOURCEPATH = "${S}/llvm" +EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DCOMPILER_RT_STANDALONE_BUILD=OFF \ + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ + -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ + -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH}${HF}${HOST_VENDOR}-${HOST_OS} \ + -DCOMPILER_RT_BUILD_BUILTINS=OFF \ + -DSANITIZER_CXX_ABI_LIBNAME=${@bb.utils.contains("RUNTIME", "llvm", "libc++", "libstdc++", d)} \ + -DCOMPILER_RT_BUILD_XRAY=ON \ + -DCOMPILER_RT_BUILD_SANITIZERS=ON \ + -DCOMPILER_RT_BUILD_LIBFUZZER=ON \ + -DCOMPILER_RT_BUILD_PROFILE=ON \ + -DCOMPILER_RT_BUILD_MEMPROF=ON \ + -DLLVM_ENABLE_PROJECTS='compiler-rt' \ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ +" + +EXTRA_OECMAKE:append:class-nativesdk = "\ + -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ + -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ +" + +EXTRA_OECMAKE:append:libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " +EXTRA_OECMAKE:append:powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " + +do_install:append () { + if [ -n "${LLVM_LIBDIR_SUFFIX}" ]; then + mkdir -p ${D}${nonarch_libdir} + mv ${D}${libdir}/clang ${D}${nonarch_libdir}/clang + rmdir --ignore-fail-on-non-empty ${D}${libdir} + fi + # Already shipped with compile-rt Orc support + rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/libclang_rt.orc-*.a + rm -rf ${D}${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/include/orc/ +} + +FILES_SOLIBSDEV = "" +FILES:${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/lib*${SOLIBSDEV} \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/*.txt \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/share/*.txt" +FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" +FILES:${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.syms \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/include \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/clang_rt.crt*.o \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/libclang_rt.asan-preinit*.a \ + " +INSANE_SKIP:${PN} = "dev-so libdir" +INSANE_SKIP:${PN}-dbg = "libdir" + +#PROVIDES:append:class-target = "\ +# virtual/${TARGET_PREFIX}compilerlibs \ +# libgcc \ +# libgcc-initial \ +# libgcc-dev \ +# libgcc-initial-dev \ +# " +# + +RDEPENDS:${PN}-dev += "${PN}-staticdev" + +BBCLASSEXTEND = "native nativesdk" + +ALLOW_EMPTY:${PN} = "1" +ALLOW_EMPTY:${PN}-dev = "1" + +TOOLCHAIN:forcevariable = "clang" +SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" + +# riscv and x86_64 Sanitizers work on musl too +COMPATIBLE_HOST:libc-musl:x86-64 = "(.*)" +COMPATIBLE_HOST:libc-musl:riscv64 = "(.*)" +COMPATIBLE_HOST:libc-musl:riscv32 = "(.*)" +COMPATIBLE_HOST:libc-musl = "null" diff --git a/meta-clang/recipes-devtools/clang/compiler-rt_git.bb b/meta-clang/recipes-devtools/clang/compiler-rt_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..c4235a6c11d85957993fb7d085522fc90df64596 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/compiler-rt_git.bb @@ -0,0 +1,124 @@ +# Copyright (C) 2015 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "LLVM based C/C++ compiler Runtime" +HOMEPAGE = "http://compiler-rt.llvm.org/" +SECTION = "base" + +require clang.inc +require common-source.inc + +inherit cmake cmake-native pkgconfig python3native + + +LIC_FILES_CHKSUM = "file://compiler-rt/LICENSE.TXT;md5=d846d1d65baf322d4c485d6ee54e877a" + +LIBCPLUSPLUS = "" +COMPILER_RT = "" + +TUNE_CCARGS:remove = "-no-integrated-as" + +INHIBIT_DEFAULT_DEPS = "1" + +DEPENDS += "ninja-native libgcc" +DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime" +DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_ARCH} nativesdk-gcc-runtime" +DEPENDS:append:class-native = " clang-native" + +# Trick clang.bbclass into not creating circular dependencies +UNWINDLIB:class-nativesdk = "--unwindlib=libgcc" +COMPILER_RT:class-nativesdk:toolchain-clang:runtime-llvm = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-nativesdk:toolchain-clang:runtime-llvm = "-stdlib=libstdc++" + +CXXFLAGS += "-stdlib=libstdc++" +LDFLAGS += "-unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" +BUILD_CXXFLAGS += "-stdlib=libstdc++" +BUILD_LDFLAGS += "-unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" +BUILD_CPPFLAGS:remove = "-stdlib=libc++" +BUILD_LDFLAGS:remove = "-stdlib=libc++ -lc++abi" + +BUILD_CC:toolchain-clang = "${CCACHE}clang" +BUILD_CXX:toolchain-clang = "${CCACHE}clang++" +BUILD_CPP:toolchain-clang = "${CCACHE}clang -E" +BUILD_CCLD:toolchain-clang = "${CCACHE}clang" +BUILD_RANLIB:toolchain-clang = "llvm-ranlib" +BUILD_AR:toolchain-clang = "llvm-ar" +BUILD_NM:toolchain-clang = "llvm-nm" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" +PACKAGECONFIG[profile] ="-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF" + +HF = "" +HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" +HF[vardepvalue] = "${HF}" + +OECMAKE_TARGET_COMPILE = "compiler-rt" +OECMAKE_TARGET_INSTALL = "install-compiler-rt install-compiler-rt-headers" +OECMAKE_SOURCEPATH = "${S}/llvm" +EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DCOMPILER_RT_STANDALONE_BUILD=OFF \ + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ + -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH}${HF}${HOST_VENDOR}-${HOST_OS} \ + -DCOMPILER_RT_BUILD_XRAY=OFF \ + -DCOMPILER_RT_BUILD_SANITIZERS=OFF \ + -DCOMPILER_RT_BUILD_MEMPROF=OFF \ + -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ + -DLLVM_ENABLE_PROJECTS='compiler-rt' \ + -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ +" +EXTRA_OECMAKE:append:class-target = "\ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ +" + +EXTRA_OECMAKE:append:class-nativesdk = "\ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ + -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ +" +EXTRA_OECMAKE:append:powerpc = " -DCOMPILER_RT_DEFAULT_TARGET_ARCH=powerpc " + +do_install:append () { + if [ -n "${LLVM_LIBDIR_SUFFIX}" ]; then + mkdir -p ${D}${nonarch_libdir} + mv ${D}${libdir}/clang ${D}${nonarch_libdir}/clang + rmdir --ignore-fail-on-non-empty ${D}${libdir} + fi +} + +FILES_SOLIBSDEV = "" +FILES:${PN} += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/lib*${SOLIBSDEV} \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/*.txt \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/share/*.txt" +FILES:${PN}-staticdev += "${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" +FILES:${PN}-dev += "${datadir} ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.syms \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/include \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/clang_rt.crt*.o \ + ${nonarch_libdir}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/libclang_rt.asan-preinit*.a \ + " +INSANE_SKIP:${PN} = "dev-so libdir" +INSANE_SKIP:${PN}-dbg = "libdir" + +#PROVIDES:append:class-target = "\ +# virtual/${TARGET_PREFIX}compilerlibs \ +# libgcc \ +# libgcc-initial \ +# libgcc-dev \ +# libgcc-initial-dev \ +# " +# + +RDEPENDS:${PN}-dev += "${PN}-staticdev" + +BBCLASSEXTEND = "native nativesdk" + +ALLOW_EMPTY:${PN} = "1" +ALLOW_EMPTY:${PN}-dev = "1" + +TOOLCHAIN:forcevariable = "clang" +SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" diff --git a/meta-clang/recipes-devtools/clang/libclc_git.bb b/meta-clang/recipes-devtools/clang/libclc_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..643100777b05e5d2e501880ed5272dec8442967d --- /dev/null +++ b/meta-clang/recipes-devtools/clang/libclc_git.bb @@ -0,0 +1,42 @@ +DESCRIPTION = "LLVM based OpenCL runtime support library" +HOMEPAGE = "http://libclc.llvm.org/" +SECTION = "libs" + +require clang.inc +require common-source.inc + +TOOLCHAIN = "clang" + +LIC_FILES_CHKSUM = "file://libclc/LICENSE.TXT;md5=7cc795f6cbb2d801d84336b83c8017db" + +inherit cmake pkgconfig python3native qemu + +DEPENDS += "qemu-native clang spirv-tools spirv-llvm-translator spirv-llvm-translator-native ncurses" + +OECMAKE_SOURCEPATH = "${S}/libclc" + +EXTRA_OECMAKE += " \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \ + -Dclc_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeCLCCompiler.cmake.in \ + -Dll_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeLLAsmCompiler.cmake.in \ + " + +do_configure:prepend () { + # Write out a qemu wrapper that will be used by cmake + # so that it can run target helper binaries through that. + qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}" + cat > ${WORKDIR}/qemuwrapper << EOF +#!/bin/sh +$qemu_binary "\$@" +EOF + chmod +x ${WORKDIR}/qemuwrapper +} + +FILES:${PN} += "${datadir}/clc" + +BBCLASSEXTEND = "native nativesdk" + +export YOCTO_ALTERNATE_EXE_PATH +export YOCTO_ALTERNATE_LIBDIR diff --git a/meta-clang/recipes-devtools/clang/libcxx_git.bb b/meta-clang/recipes-devtools/clang/libcxx_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..5ad4473d92d3a951c727a257a3f40b9474310ecb --- /dev/null +++ b/meta-clang/recipes-devtools/clang/libcxx_git.bb @@ -0,0 +1,112 @@ +# Copyright (C) 2015 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "libc++ is a new implementation of the C++ standard library, targeting C++11" +HOMEPAGE = "http://libcxx.llvm.org/" +SECTION = "base" + +require clang.inc +require common-source.inc + +inherit cmake cmake-native python3native + +PACKAGECONFIG ??= "compiler-rt exceptions ${@bb.utils.contains("RUNTIME", "llvm", "unwind unwind-shared", "", d)}" +PACKAGECONFIG:append:armv5 = " no-atomics" +PACKAGECONFIG:remove:class-native = "compiler-rt" +PACKAGECONFIG[unwind] = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON,-DLIBCXXABI_USE_LLVM_UNWINDER=OFF,," +PACKAGECONFIG[exceptions] = "-DLIBCXXABI_ENABLE_EXCEPTIONS=ON -DDLIBCXX_ENABLE_EXCEPTIONS=ON,-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF -DLIBCXX_ENABLE_EXCEPTIONS=OFF -DCMAKE_REQUIRED_FLAGS='-fno-exceptions'," +PACKAGECONFIG[no-atomics] = "-D_LIBCXXABI_HAS_ATOMIC_BUILTINS=OFF -DCMAKE_SHARED_LINKER_FLAGS='-latomic',," +PACKAGECONFIG[compiler-rt] = "-DLIBCXX_USE_COMPILER_RT=ON -DLIBCXXABI_USE_COMPILER_RT=ON -DLIBUNWIND_USE_COMPILER_RT=ON,,compiler-rt" +PACKAGECONFIG[unwind-shared] = "-DLIBUNWIND_ENABLE_SHARED=ON,-DLIBUNWIND_ENABLE_SHARED=OFF,," + +DEPENDS += "ninja-native" +DEPENDS:append:class-target = " clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${TARGET_PREFIX}compilerlibs" +DEPENDS:append:class-nativesdk = " clang-crosssdk-${SDK_ARCH} nativesdk-compiler-rt" +DEPENDS:append:class-native = " clang-native" + +LIBCPLUSPLUS = "" +COMPILER_RT ?= "-rtlib=compiler-rt" + +# Trick clang.bbclass into not creating circular dependencies +UNWINDLIB:class-nativesdk = "--unwindlib=libgcc" +COMPILER_RT:class-nativesdk = "-rtlib=libgcc --unwindlib=libgcc" +LIBCPLUSPLUS:class-nativesdk = "-stdlib=libstdc++" + +CC:append:toolchain-clang:class-native = " -unwindlib=libgcc -rtlib=libgcc" +CC:append:toolchain-clang:class-nativesdk = " -unwindlib=libgcc -rtlib=libgcc" + +CXXFLAGS += "-stdlib=libstdc++" +LDFLAGS += "-unwindlib=libgcc -stdlib=libstdc++" +BUILD_CXXFLAGS += "-stdlib=libstdc++" +BUILD_LDFLAGS += "-unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++" +BUILD_CPPFLAGS:remove = "-stdlib=libc++" +BUILD_LDFLAGS:remove = "-stdlib=libc++ -lc++abi" + +INHIBIT_DEFAULT_DEPS = "1" + +LIC_FILES_CHKSUM = "file://libcxx/LICENSE.TXT;md5=55d89dd7eec8d3b4204b680e27da3953 \ + file://libcxxabi/LICENSE.TXT;md5=7b9334635b542c56868400a46b272b1e \ + file://libunwind/LICENSE.TXT;md5=f66970035d12f196030658b11725e1a1 \ +" + +OECMAKE_TARGET_COMPILE = "cxxabi cxx" +OECMAKE_TARGET_INSTALL = "install-cxx install-cxxabi ${@bb.utils.contains("RUNTIME", "llvm", "install-unwind", "", d)}" + +OECMAKE_SOURCEPATH = "${S}/llvm" +EXTRA_OECMAKE += "\ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DCMAKE_CROSSCOMPILING=ON \ + -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ + -DLLVM_ENABLE_RTTI=ON \ + -DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON \ + -DLIBCXXABI_INCLUDE_TESTS=OFF \ + -DLIBCXXABI_ENABLE_SHARED=ON \ + -DLIBCXXABI_LIBCXX_INCLUDES=${S}/libcxx/include \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${S}/libcxxabi/include \ + -DLIBCXX_CXX_ABI_LIBRARY_PATH=${B}/lib${LLVM_LIBDIR_SUFFIX} \ + -DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi;libunwind' \ + -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ + -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ +" + +EXTRA_OECMAKE:append:class-target = " \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ + -DLLVM_DEFAULT_TARGET_TRIPLE=${HOST_SYS} \ +" + +EXTRA_OECMAKE:append:class-nativesdk = " \ + -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ + -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ + -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ + -DLLVM_DEFAULT_TARGET_TRIPLE=${HOST_SYS} \ +" + +EXTRA_OECMAKE:append:libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " + +CXXFLAGS:append:armv5 = " -mfpu=vfp2" + +ALLOW_EMPTY:${PN} = "1" + +PROVIDES:append:runtime-llvm = " libunwind" + +do_install:append() { + if ${@bb.utils.contains("RUNTIME", "llvm", "true", "false", d)} + then + for f in libunwind.h __libunwind_config.h unwind.h unwind_itanium.h unwind_arm_ehabi.h + do + install -Dm 0644 ${S}/libunwind/include/$f ${D}${includedir}/$f + done + install -d ${D}${libdir}/pkgconfig + sed -e 's,@LIBDIR@,${libdir},g;s,@VERSION@,${PV},g' ${S}/../libunwind.pc.in > ${D}${libdir}/pkgconfig/libunwind.pc + fi +} + +PACKAGES:append:runtime-llvm = " libunwind" +FILES:libunwind:runtime-llvm = "${libdir}/libunwind.so.*" + +BBCLASSEXTEND = "native nativesdk" +TOOLCHAIN:forcevariable = "clang" diff --git a/meta-clang/recipes-devtools/clang/llvm-project-source.bb b/meta-clang/recipes-devtools/clang/llvm-project-source.bb new file mode 100644 index 0000000000000000000000000000000000000000..78664c578075c8f50919896ea551393f233465bc --- /dev/null +++ b/meta-clang/recipes-devtools/clang/llvm-project-source.bb @@ -0,0 +1,10 @@ +# Copyright (C) 2018 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "This is the canonical git mirror of the LLVM subversion repository." +HOMEPAGE = "https://github.com/llvm/llvm-project" + +require llvm-project-source.inc +require clang.inc + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-clang/recipes-devtools/clang/llvm-project-source.inc b/meta-clang/recipes-devtools/clang/llvm-project-source.inc new file mode 100644 index 0000000000000000000000000000000000000000..4afd1bb9c1462857b6d85051409d3ae49e69cb62 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/llvm-project-source.inc @@ -0,0 +1,88 @@ +deltask do_configure +deltask do_compile +deltask do_install +deltask do_populate_sysroot +deltask do_populate_lic +RM_WORK_EXCLUDE += "${PN}" + +inherit nopackages + +PN = "llvm-project-source-${PV}" + +WORKDIR = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}" +SSTATE_SWSPEC = "sstate:llvm-project-source::${PV}:${PR}::${SSTATE_VERSION}:" + +STAMP = "${STAMPS_DIR}/work-shared/llvm-project-source-${PV}-${PR}" +STAMPCLEAN = "${STAMPS_DIR}/work-shared/llvm-project-source-${PV}-*" + +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS = "" +PACKAGES = "" + +# space separated list of additional distro vendor values we want to support e.g. +# "yoe webos" or "-yoe -webos" '-' is optional +CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR} ${SDK_VENDOR}" +# Extra OE DISTRO that want to support as build host. space separated list of additional distro. +# ":" separated the ID in "/etc/os-release" and the triple for finding gcc on this OE DISTRO. +# eg: "poky:poky wrlinux:wrs" +CLANG_EXTRA_OE_DISTRO ?= "poky:poky" +# Match with MULTILIB_GLOBAL_VARIANTS +MULTILIB_VARIANTS = "lib32 lib64 libx32" +python add_distro_vendor() { + import subprocess + case = "" + triple = "" + vendors = d.getVar('CLANG_EXTRA_OE_VENDORS') + multilib_variants = (d.getVar("MULTILIB_VARIANTS") or "").split() + vendors_to_add = [] + for vendor in vendors.split(): + # convert -yoe into yoe + vendor = vendor.lstrip('-') + # generate possible multilib vendor names for yoe + # such as yoemllib32 + vendors_to_add.extend([vendor + 'ml' + variant for variant in multilib_variants]) + # skip oe since already part of the cpp file + if vendor != "oe": + vendors_to_add.append(vendor) + + for vendor_to_add in vendors_to_add: + case += '\\n .Case("' + vendor_to_add + '", Triple::OpenEmbedded)' + triple += ' "x86_64-' + vendor_to_add + '-linux",' + + bb.note("Adding support following TARGET_VENDOR values") + bb.note(str(vendors_to_add)) + bb.note("in llvm/lib/Support/Triple.cpp and ${S}/clang/lib/Driver/ToolChains/Gnu.cpp") + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_TRIPLES#%s#g' ${S}/clang/lib/Driver/ToolChains/Gnu.cpp" % (triple)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_CASES#%s#g' -i ${S}/llvm/lib/Support/Triple.cpp" % (case)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + + + case = "" + triple = "" + name = "" + check = "" + oe_names = "" + distros = d.getVar('CLANG_EXTRA_OE_DISTRO') + for distro in distros.split(): + distro_id = distro.split(":")[0].replace('-','_') + distro_triple = distro.split(":")[1] + case += '\\n .Case("' + distro_id + '", Distro::' + distro_id.upper() + ')' + triple += '\\n if (Distro.Is' + distro_id.upper() + '())\\n return "x86_64-' + distro_triple + '-linux",' + name += '\\n '+ distro_id.upper() + ',' + check += '\\nbool Is' + distro_id.upper() + '() const { return DistroVal == ' + distro_id.upper() + '; }' + oe_names += distro_id.upper() + ' ||' + + check += '\\nbool IsOpenEmbedded() const { return DistroVal == ' + oe_names[0:-3] + '; }' + + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_NAME#%s#g' ${S}/clang/include/clang/Driver/Distro.h" % (name)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_CHECK#%s#g' ${S}/clang/include/clang/Driver/Distro.h" % (check)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_TRIPLES#%s#g' ${S}/clang/lib/Driver/ToolChains/Linux.cpp" % (triple)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_DISTRO_CASES#%s#g' -i ${S}/clang/lib/Driver/Distro.cpp" % (case)) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) +} + +do_patch[postfuncs] += "add_distro_vendor" diff --git a/meta-clang/recipes-devtools/clang/nativesdk-clang-glue.bb b/meta-clang/recipes-devtools/clang/nativesdk-clang-glue.bb new file mode 100644 index 0000000000000000000000000000000000000000..4e0c6faa2aef750acefc3023ada1100c669eac2c --- /dev/null +++ b/meta-clang/recipes-devtools/clang/nativesdk-clang-glue.bb @@ -0,0 +1,35 @@ +# Copyright (C) 2014 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "SDK Cross compiler wrappers for LLVM based C/C++ compiler" +HOMEPAGE = "http://clang.llvm.org/" +LICENSE = "Apache-2.0-with-LLVM-exception" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" +SECTION = "devel" + +inherit nativesdk +DEPENDS += "nativesdk-clang" + +do_install() { + install -d ${D}${prefix_nativesdk} + cd ${D}${prefix_nativesdk} + ln -s ..${libdir} . + ln -s ..${includedir} . + cd .. + ln -s .${base_libdir} . +} + +sysroot_stage_all () { + sysroot_stage_dir ${D} ${SYSROOT_DESTDIR} +} + +FILES:${PN} += "${prefix_nativesdk} ${base_libdir_nativesdk}" +FILES:${PN}-dbg = "" + +deltask do_configure +deltask do_compile +deltask do_patch +deltask do_fetch +deltask do_unpack +deltask do_create_spdx +deltask do_create_runtime_spdx diff --git a/meta-clang/recipes-devtools/clang/openmp_git.bb b/meta-clang/recipes-devtools/clang/openmp_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..6087a934004c2c643d21c9dc20a032d5f5be3f45 --- /dev/null +++ b/meta-clang/recipes-devtools/clang/openmp_git.bb @@ -0,0 +1,52 @@ +# Copyright (C) 2017 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "LLVM based C/C++ compiler Runtime" +HOMEPAGE = "http://openmp.llvm.org/" +SECTION = "libs" + +require clang.inc +require common-source.inc + +TOOLCHAIN = "clang" + +LIC_FILES_CHKSUM = "file://openmp/LICENSE.TXT;md5=d75288d1ce0450b28b8d58a284c09c79" + +inherit cmake pkgconfig perlnative + +DEPENDS += "elfutils libffi clang" + +EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ + -DOPENMP_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ + -DOPENMP_STANDALONE_BUILD=ON \ + -DCLANG_TOOL=${STAGING_BINDIR_NATIVE}/clang \ + -DLINK_TOOL=${STAGING_BINDIR_NATIVE}/llvm-link \ + -DOPT_TOOL=${STAGING_BINDIR_NATIVE}/opt \ + " + +OECMAKE_SOURCEPATH = "${S}/openmp" + +PACKAGECONFIG ?= "ompt-tools offloading-plugin" + +PACKAGECONFIG:remove:arm = "ompt-tools offloading-plugin" +PACKAGECONFIG:remove:powerpc = "ompt-tools offloading-plugin" + +PACKAGECONFIG:append:mips = " no-atomics" + +PACKAGECONFIG[ompt-tools] = "-DOPENMP_ENABLE_OMPT_TOOLS=ON,-DOPENMP_ENABLE_OMPT_TOOLS=OFF," +PACKAGECONFIG[aliases] = "-DLIBOMP_INSTALL_ALIASES=ON,-DLIBOMP_INSTALL_ALIASES=OFF," +PACKAGECONFIG[offloading-plugin] = ",,elfutils libffi,libelf libffi" +PACKAGECONFIG[no-atomics] = "-DLIBOMP_HAVE_BUILTIN_ATOMIC=OFF -DLIBOMP_LIBFLAGS='-latomic',," + +PACKAGES += "${PN}-libomptarget" +FILES_SOLIBSDEV = "" +FILES:${PN} += "${libdir}/lib*${SOLIBSDEV}" +FILES:${PN}-libomptarget = "${libdir}/libomptarget-*.bc" +INSANE_SKIP:${PN} = "dev-so" + +COMPATIBLE_HOST:mips64 = "null" +COMPATIBLE_HOST:riscv32 = "null" +COMPATIBLE_HOST:powerpc = "null" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-clang/recipes-devtools/gdb/gdb/0001-gdb-Link-with-latomic-for-riscv-clang-alone.patch b/meta-clang/recipes-devtools/gdb/gdb/0001-gdb-Link-with-latomic-for-riscv-clang-alone.patch new file mode 100644 index 0000000000000000000000000000000000000000..8ec0e0e95047cc23865d23bd069ee109324faa5a --- /dev/null +++ b/meta-clang/recipes-devtools/gdb/gdb/0001-gdb-Link-with-latomic-for-riscv-clang-alone.patch @@ -0,0 +1,26 @@ +From 23ad5c62e3586a0ea734c191cbcbe71261747758 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 19 Aug 2019 21:47:49 -0700 +Subject: [PATCH] gdb: Link with -latomic for riscv/clang alone + +Signed-off-by: Khem Raj +--- + gdb/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/Makefile.in b/gdb/Makefile.in +index 762b32b..6e2a271 100644 +--- a/gdb/Makefile.in ++++ b/gdb/Makefile.in +@@ -1889,7 +1889,7 @@ gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(CDEPS) $(TDEPLIBS) + $(SILENCE) rm -f gdb$(EXEEXT) + $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \ + -o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \ +- $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES) ++ $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) -latomic $(LOADLIBES) + ifneq ($(CODESIGN_CERT),) + $(ECHO_SIGN) $(CODESIGN) -s $(CODESIGN_CERT) gdb$(EXEEXT) + endif +-- +2.23.0 + diff --git a/meta-clang/recipes-devtools/gdb/gdb_%.bbappend b/meta-clang/recipes-devtools/gdb/gdb_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ee1991b6c8d648bd6c07ae2f334ce0a4fb1f2493 --- /dev/null +++ b/meta-clang/recipes-devtools/gdb/gdb_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append:toolchain-clang:riscv64 = " file://0001-gdb-Link-with-latomic-for-riscv-clang-alone.patch " diff --git a/meta-clang/recipes-devtools/python/python3_%.bbappend b/meta-clang/recipes-devtools/python/python3_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a4d8b497ecfb90cf4ec2c85385925e5bf52a80e7 --- /dev/null +++ b/meta-clang/recipes-devtools/python/python3_%.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +do_configure:prepend:class-target:toolchain-clang() { + # We do not need --print-multiarch with clang since it prints wrong value + sed -i -e 's#\[MULTIARCH=$($CC --print-multiarch 2>/dev/null)\]#\[MULTIARCH=""\]#g' ${S}/configure.ac +} + diff --git a/meta-clang/recipes-devtools/rpm/rpm_%.bbappend b/meta-clang/recipes-devtools/rpm/rpm_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d2a010c26e2684eaf13c8d901091bdcb44cc66d5 --- /dev/null +++ b/meta-clang/recipes-devtools/rpm/rpm_%.bbappend @@ -0,0 +1,11 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +DEPENDS:append:toolchain-clang = " openmp" +DEPENDS:remove:toolchain-clang:riscv32 = "openmp" +DEPENDS:remove:toolchain-clang:mipsarch = "openmp" +DEPENDS:remove:toolchain-clang:powerpc = "openmp" + +# rpm needs OMP +TOOLCHAIN:riscv32 = "gcc" +TOOLCHAIN:mipsarch = "gcc" +TOOLCHAIN:powerpc = "gcc" diff --git a/meta-clang/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb b/meta-clang/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb new file mode 100644 index 0000000000000000000000000000000000000000..7f214d3bcf02419f6ee80e5eb54de627de7a1792 --- /dev/null +++ b/meta-clang/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb @@ -0,0 +1,45 @@ +LICENSE = "NCSA" +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" + +BRANCH = "main" +SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator;protocol=https;branch=${BRANCH} \ + git://github.com/KhronosGroup/SPIRV-Headers;protocol=https;destsuffix=git/SPIRV-Headers;name=headers;branch=master \ + " + +PV = "15.0.0" +SRCREV = "1b8a00741caafac50de84f1f860b78e702722585" +SRCREV_headers = "0bcc624926a25a2a273d07877fd25a6ff5ba1cfb" + +SRCREV_FORMAT = "default_headers" + +S = "${WORKDIR}/git" + +DEPENDS = "spirv-tools clang" + +inherit cmake pkgconfig python3native + +OECMAKE_GENERATOR = "Unix Makefiles" + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "\ + -DBUILD_SHARED_LIBS=ON \ + -DLLVM_SPIRV_BUILD_EXTERNAL=YES \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_SKIP_RPATH=ON \ + -DLLVM_EXTERNAL_LIT=lit \ + -DLLVM_INCLUDE_TESTS=ON \ + -Wno-dev \ + -DCCACHE_ALLOWED=FALSE \ + -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${S}/SPIRV-Headers \ +" + +do_compile:append() { + oe_runmake llvm-spirv +} + +do_install:append() { + install -Dm755 ${B}/tools/llvm-spirv/llvm-spirv ${D}${bindir}/llvm-spirv +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-clang/recipes-extended/ghostscript/ghostscript_%.bbappend b/meta-clang/recipes-extended/ghostscript/ghostscript_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..c1496d0035152795a4b5ad3b6d87dbac1bfe5c50 --- /dev/null +++ b/meta-clang/recipes-extended/ghostscript/ghostscript_%.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +do_configure:prepend:toolchain-clang () { + if ${@bb.utils.contains('RUNTIME', 'llvm', 'true', 'false', d)}; then + sed -i -e "s|-stdlib=libstdc++|-stdlib=libc++|g" ${S}/configure.ac + fi +} diff --git a/meta-clang/recipes-extended/mdadm/mdadm_%.bbappend b/meta-clang/recipes-extended/mdadm/mdadm_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..2bdf6ca7f30435902554f775915c95534747763b --- /dev/null +++ b/meta-clang/recipes-extended/mdadm/mdadm_%.bbappend @@ -0,0 +1,6 @@ +# Fix errors like +# | super-intel.c:1673:23: error: taking address of packed member 'size_high' of class or structure 'imsm_dev' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] +# | &dev->size_low, &dev->size_high); +# | ^~~~~~~~~~~~~~ + +CFLAGS:append:toolchain-clang = " -Wno-error=address-of-packed-member" diff --git a/meta-clang/recipes-graphics/mesa/mesa_%.bbappend b/meta-clang/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..74888baac510e9ece5c972d5c29f9c02549ba5d9 --- /dev/null +++ b/meta-clang/recipes-graphics/mesa/mesa_%.bbappend @@ -0,0 +1,11 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +LDFLAGS:append:toolchain-clang = " -latomic -lm" +DEPENDS:append:toolchain-clang = " libatomic-ops" + +EXTRA_OEMASON:append:toolchain-clang:x86 = " -Dasm=false" +EXTRA_OEMASON:append:toolchain-clang:x86-64 = " -Dasm=false" + +export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-config" + +PACKAGECONFIG[gallium-llvm] = "-Dllvm=true -Dshared-llvm=true -Ddraw-use-llvm=true,-Dllvm=false,clang clang-native elfutils" diff --git a/meta-clang/recipes-multimedia/ffmpeg/ffmpeg/clang_mips64.patch b/meta-clang/recipes-multimedia/ffmpeg/ffmpeg/clang_mips64.patch new file mode 100644 index 0000000000000000000000000000000000000000..9206af1f1d7ce4c12bca452c9721e0f1e2efebad --- /dev/null +++ b/meta-clang/recipes-multimedia/ffmpeg/ffmpeg/clang_mips64.patch @@ -0,0 +1,28 @@ +Disable fpu using code when using clang/mips64 combo +it works around clang's inline asm error + +error: couldn't allocate output register for constraint 'r' + +Upstream-Status: Pending +Signed-off-by: Khem Raj + +--- a/libavcodec/mips/aacdec_mips.c ++++ b/libavcodec/mips/aacdec_mips.c +@@ -282,7 +282,7 @@ static void apply_ltp_mips(AACContext *a + } + } + +-#if HAVE_MIPSFPU ++#if HAVE_MIPSFPU && !defined(__clang__) + static av_always_inline void fmul_and_reverse(float *dst, const float *src0, const float *src1, int count) + { + /* Multiply 'count' floats in src0 by src1 and store the results in dst in reverse */ +@@ -435,7 +435,7 @@ void ff_aacdec_init_mips(AACContext *c) + #if HAVE_INLINE_ASM + c->imdct_and_windowing = imdct_and_windowing_mips; + c->apply_ltp = apply_ltp_mips; +-#if HAVE_MIPSFPU ++#if HAVE_MIPSFPU && !defined(__clang__) + c->update_ltp = update_ltp_mips; + #endif /* HAVE_MIPSFPU */ + #endif /* HAVE_INLINE_ASM */ diff --git a/meta-clang/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend b/meta-clang/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7854eb1c5b16b050a7a3826c8d0a172e795428de --- /dev/null +++ b/meta-clang/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append:toolchain-clang:mips64 = " file://clang_mips64.patch" diff --git a/meta-clang/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch b/meta-clang/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch new file mode 100644 index 0000000000000000000000000000000000000000..93ab73fb4d9faeef00031c4ea44721eb696ec00b --- /dev/null +++ b/meta-clang/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch @@ -0,0 +1,40 @@ +From 91c980d4cf88b0c12fe5971fe16c7b97b5a942af Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 17 Dec 2019 14:57:55 -0800 +Subject: [PATCH] Disable fpu using code when using clang/mips64 combo + +it works around clang's inline asm error + +error: couldn't allocate output register for constraint 'r' + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c b/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c +index 253cdeb..df4f25d 100644 +--- a/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c ++++ b/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c +@@ -282,7 +282,7 @@ static void apply_ltp_mips(AACContext *ac, SingleChannelElement *sce) + } + } + +-#if HAVE_MIPSFPU ++#if HAVE_MIPSFPU && !defined(__clang__) + static av_always_inline void fmul_and_reverse(float *dst, const float *src0, const float *src1, int count) + { + /* Multiply 'count' floats in src0 by src1 and store the results in dst in reverse */ +@@ -435,7 +435,7 @@ void ff_aacdec_init_mips(AACContext *c) + #if HAVE_INLINE_ASM + c->imdct_and_windowing = imdct_and_windowing_mips; + c->apply_ltp = apply_ltp_mips; +-#if HAVE_MIPSFPU ++#if HAVE_MIPSFPU && !defined(__clang__) + c->update_ltp = update_ltp_mips; + #endif /* HAVE_MIPSFPU */ + #endif /* HAVE_INLINE_ASM */ +-- +2.24.1 + diff --git a/meta-clang/recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend b/meta-clang/recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..c6acc2c4dd11d6457a6f1fb8132fed8b36d92230 --- /dev/null +++ b/meta-clang/recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend @@ -0,0 +1,4 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append:toolchain-clang:mips64 = " file://0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch" + diff --git a/meta-clang/recipes-multimedia/libvorbis/libvorbis_%.bbappend b/meta-clang/recipes-multimedia/libvorbis/libvorbis_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bfc832f4e179115e879993151199a243196e4414 --- /dev/null +++ b/meta-clang/recipes-multimedia/libvorbis/libvorbis_%.bbappend @@ -0,0 +1,4 @@ +# | clang-7: error: unknown argument: '-mfused-madd' +do_configure:prepend:toolchain-clang() { + sed -i -e "s/-mfused-madd//g" ${S}/configure.ac +} diff --git a/meta-clang/recipes-support/libunwind/libunwind_%.bbappend b/meta-clang/recipes-support/libunwind/libunwind_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..51c3cee26c822b8194f5b06635cda81f39888092 --- /dev/null +++ b/meta-clang/recipes-support/libunwind/libunwind_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +COMPATIBLE_HOST:runtime-llvm = "null" diff --git a/meta-musl/conf/layer.conf b/meta-musl/conf/layer.conf new file mode 100644 index 0000000000000000000000000000000000000000..337a1d7ca71f1d1e46cb870497667a28e402ae6b --- /dev/null +++ b/meta-musl/conf/layer.conf @@ -0,0 +1,24 @@ +# 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 += "openeuler-musl" +BBFILE_PATTERN_openeuler-musl = "^${LAYERDIR}/" +BBFILE_PRIORITY_openeuler-musl = "25" + +LAYERSERIES_COMPAT_openeuler-musl = "hardknott" + +# This should only be incremented on significant changes that will +# cause compatibility issues with other layers +LAYERVERSION_openeuler-musl = "13" + +LAYERDEPENDS_openeuler-musl = "core" + +REQUIRED_POKY_BBLAYERS_CONF_VERSION = "2" + + +# For get lib dir under meta-openeuler by external_run +LAYERDIR_openeuler = "${LAYERDIR}" diff --git a/meta-musl/recipes-connectivity/iproute2/iproute2/missing-include.patch b/meta-musl/recipes-connectivity/iproute2/iproute2/missing-include.patch new file mode 100644 index 0000000000000000000000000000000000000000..8bc4b47e3db8b15fe8a5512355de26cb5f34969a --- /dev/null +++ b/meta-musl/recipes-connectivity/iproute2/iproute2/missing-include.patch @@ -0,0 +1,10 @@ +--- iproute2-5.15.0.orig/include/namespace.h 2021-11-22 16:15:31.000000000 +0800 ++++ iproute2-5.15.0/include/namespace.h 2022-07-11 15:09:26.402839958 +0800 +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + + #ifndef NETNS_RUN_DIR + #define NETNS_RUN_DIR "/var/run/netns" diff --git a/meta-musl/recipes-connectivity/iproute2/iproute2_%.bbappend b/meta-musl/recipes-connectivity/iproute2/iproute2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..2008f9dcad29ae2a1746bb969b228562dd6aa7a9 --- /dev/null +++ b/meta-musl/recipes-connectivity/iproute2/iproute2_%.bbappend @@ -0,0 +1,5 @@ +# add patch to support musl +FILESEXTRAPATHS_prepend := "${THISDIR}/iproute2:" +SRC_URI_append =" \ + file://missing-include.patch \ +" diff --git a/meta-musl/recipes-core/dsoftbus/dsoftbus/change-musl-toolchain.patch b/meta-musl/recipes-core/dsoftbus/dsoftbus/change-musl-toolchain.patch new file mode 100644 index 0000000000000000000000000000000000000000..d1fce2ee9aeba9c2bd21135ca07a61066608bb16 --- /dev/null +++ b/meta-musl/recipes-core/dsoftbus/dsoftbus/change-musl-toolchain.patch @@ -0,0 +1,12 @@ +diff -uprN a/toolchain/linux/BUILD.gn b/toolchain/linux/BUILD.gn +--- a/toolchain/linux/BUILD.gn 2022-09-14 16:44:09.577085155 +0800 ++++ b/toolchain/linux/BUILD.gn 2022-09-14 16:47:56.430068282 +0800 +@@ -23,7 +23,7 @@ clang_toolchain("clang_arm64") { + + gcc_toolchain("arm64") { + tool_path = rebase_path("//toolchain/bin", root_build_dir) +- toolprefix = "${tool_path}/aarch64-openeuler-linux-gnu-" ++ toolprefix = "${tool_path}/aarch64-openeuler-linux-musl-" + + cc = "${toolprefix}gcc" + cxx = "${toolprefix}g++" diff --git a/meta-musl/recipes-core/dsoftbus/dsoftbus_%.bbappend b/meta-musl/recipes-core/dsoftbus/dsoftbus_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..2deb835d1db89745f6b9ecdd399e2bacbc868047 --- /dev/null +++ b/meta-musl/recipes-core/dsoftbus/dsoftbus_%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +# add patch to support musl +SRC_URI_append = " \ + file://change-musl-toolchain.patch;patchdir=${S}/build \ +" diff --git a/meta-musl/recipes-core/isulad/isulad/isulad-musl.patch b/meta-musl/recipes-core/isulad/isulad/isulad-musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..df65a9f86e6cf8f753a42e5cbd3c7d40b4eb86a3 --- /dev/null +++ b/meta-musl/recipes-core/isulad/isulad/isulad-musl.patch @@ -0,0 +1,576 @@ +--- iSulad-v2.0.17/src/client/connect/protocol_type.h 2022-09-19 09:11:13.599835541 +0800 ++++ iSulad-v2.0.17/src/client/connect/protocol_type.h 2022-09-19 09:14:51.844509875 +0800 +@@ -54,11 +54,11 @@ struct isula_create_response { + + struct isula_start_request { + char *name; +- char *stdin; ++ char *stdin1; + bool attach_stdin; +- char *stdout; ++ char *stdout1; + bool attach_stdout; +- char *stderr; ++ char *stderr1; + bool attach_stderr; + }; + +@@ -323,9 +323,9 @@ struct isula_exec_request { + bool attach_stdin; + bool attach_stdout; + bool attach_stderr; +- char *stdin; +- char *stdout; +- char *stderr; ++ char *stdin1; ++ char *stdout1; ++ char *stderr1; + int argc; + char **argv; + size_t env_len; +@@ -344,9 +344,9 @@ struct isula_exec_response { + + struct isula_attach_request { + char *name; +- char *stdin; +- char *stdout; +- char *stderr; ++ char *stdin1; ++ char *stdout1; ++ char *stderr1; + bool attach_stdin; + bool attach_stdout; + bool attach_stderr; + +--- iSulad-v2.0.17/src/client/connect/protocol_type.c 2022-09-19 09:21:57.492775372 +0800 ++++ iSulad-v2.0.17/src/client/connect/protocol_type.c 2022-09-19 09:23:54.711674661 +0800 +@@ -280,14 +280,14 @@ void isula_start_request_free(struct isu + free(request->name); + request->name = NULL; + +- free(request->stdin); +- request->stdin = NULL; ++ free(request->stdin1); ++ request->stdin1 = NULL; + +- free(request->stdout); +- request->stdout = NULL; ++ free(request->stdout1); ++ request->stdout1 = NULL; + +- free(request->stderr); +- request->stderr = NULL; ++ free(request->stderr1); ++ request->stderr1 = NULL; + + free(request); + } +@@ -513,14 +513,14 @@ void isula_exec_request_free(struct isul + free(request->suffix); + request->suffix = NULL; + +- free(request->stdout); +- request->stdout = NULL; ++ free(request->stdout1); ++ request->stdout1 = NULL; + +- free(request->stdin); +- request->stdin = NULL; ++ free(request->stdin1); ++ request->stdin1 = NULL; + +- free(request->stderr); +- request->stderr = NULL; ++ free(request->stderr1); ++ request->stderr1 = NULL; + + free(request->user); + request->user = NULL; +@@ -562,14 +562,14 @@ void isula_attach_request_free(struct is + free(request->name); + request->name = NULL; + +- free(request->stderr); +- request->stderr = NULL; ++ free(request->stderr1); ++ request->stderr1 = NULL; + +- free(request->stdout); +- request->stdout = NULL; ++ free(request->stdout1); ++ request->stdout1 = NULL; + +- free(request->stdin); +- request->stdin = NULL; ++ free(request->stdin1); ++ request->stdin1 = NULL; + + free(request); + } + +--- iSulad-v2.0.17/src/client/connect/rest/rest_containers_client.c 2022-09-19 09:27:58.672546293 +0800 ++++ iSulad-v2.0.17/src/client/connect/rest/rest_containers_client.c 2022-09-19 09:38:59.355614190 +0800 +@@ -87,14 +87,14 @@ static int start_request_to_rest(const s + if (ls_request->name != NULL) { + crequest->id = util_strdup_s(ls_request->name); + } +- if (ls_request->stdout != NULL) { +- crequest->stdout = util_strdup_s(ls_request->stdout); ++ if (ls_request->stdout1 != NULL) { ++ crequest->stdout1 = util_strdup_s(ls_request->stdout1); + } +- if (ls_request->stdin != NULL) { +- crequest->stdin = util_strdup_s(ls_request->stdin); ++ if (ls_request->stdin1 != NULL) { ++ crequest->stdin1 = util_strdup_s(ls_request->stdin1); + } +- if (ls_request->stderr != NULL) { +- crequest->stderr = util_strdup_s(ls_request->stderr); ++ if (ls_request->stderr1 != NULL) { ++ crequest->stderr1 = util_strdup_s(ls_request->stderr1); + } + crequest->attach_stdin = ls_request->attach_stdin; + crequest->attach_stdout = ls_request->attach_stdout; +@@ -207,14 +207,14 @@ static int attach_request_to_rest(const + if (la_request->name != NULL) { + crequest->container_id = util_strdup_s(la_request->name); + } +- if (la_request->stdout != NULL) { +- crequest->stdout = util_strdup_s(la_request->stdout); ++ if (la_request->stdout1 != NULL) { ++ crequest->stdout1 = util_strdup_s(la_request->stdout1); + } +- if (la_request->stdin != NULL) { +- crequest->stdin = util_strdup_s(la_request->stdin); ++ if (la_request->stdin1 != NULL) { ++ crequest->stdin1 = util_strdup_s(la_request->stdin1); + } +- if (la_request->stderr != NULL) { +- crequest->stderr = util_strdup_s(la_request->stderr); ++ if (la_request->stderr1 != NULL) { ++ crequest->stderr1 = util_strdup_s(la_request->stderr1); + } + crequest->attach_stdin = la_request->attach_stdin; + crequest->attach_stdout = la_request->attach_stdout; +@@ -1611,14 +1611,14 @@ static int exec_request_to_rest(const st + if (le_request->name != NULL) { + crequest->container_id = util_strdup_s(le_request->name); + } +- if (le_request->stdout != NULL) { +- crequest->stdout = util_strdup_s(le_request->stdout); ++ if (le_request->stdout1 != NULL) { ++ crequest->stdout1 = util_strdup_s(le_request->stdout1); + } +- if (le_request->stdin != NULL) { +- crequest->stdin = util_strdup_s(le_request->stdin); ++ if (le_request->stdin1 != NULL) { ++ crequest->stdin1 = util_strdup_s(le_request->stdin1); + } +- if (le_request->stderr != NULL) { +- crequest->stderr = util_strdup_s(le_request->stderr); ++ if (le_request->stderr1 != NULL) { ++ crequest->stderr1 = util_strdup_s(le_request->stderr1); + } + if (le_request->suffix != NULL) { + crequest->suffix = util_strdup_s(le_request->suffix); + +--- iSulad-v2.0.17/src/daemon/modules/runtime/engines/lcr/lcr_rt_ops.c 2022-09-19 09:43:42.136783044 +0800 ++++ iSulad-v2.0.17/src/daemon/modules/runtime/engines/lcr/lcr_rt_ops.c 2022-09-19 09:42:58.598449116 +0800 +@@ -487,8 +487,8 @@ int rt_lcr_attach(const char *name, cons + goto out; + } + +- if (!engine_ops->engine_console_op(name, params->rootpath, (char *)params->stdin, (char *)params->stdout, +- (char *)params->stderr)) { ++ if (!engine_ops->engine_console_op(name, params->rootpath, (char *)params->stdin1, (char *)params->stdout1, ++ (char *)params->stderr1)) { + ERROR("attach failed"); + const char *tmpmsg = NULL; + if (engine_ops->engine_get_errmsg_op != NULL) { + +--- iSulad-v2.0.17/src/daemon/modules/runtime/isula/isula_rt_ops.c 2022-09-19 09:46:39.902146450 +0800 ++++ iSulad-v2.0.17/src/daemon/modules/runtime/isula/isula_rt_ops.c 2022-09-19 09:47:47.711666534 +0800 +@@ -834,9 +834,9 @@ int rt_isula_create(const char *id, cons + p.exit_fifo = (char *)params->exit_fifo; + p.open_tty = params->tty; + p.open_stdin = params->open_stdin; +- p.isulad_stdin = (char *)params->stdin; +- p.isulad_stdout = (char *)params->stdout; +- p.isulad_stderr = (char *)params->stderr; ++ p.isulad_stdin = (char *)params->stdin1; ++ p.isulad_stdout = (char *)params->stdout1; ++ p.isulad_stderr = (char *)params->stderr1; + p.runtime_args = (char **)runtime_args; + p.runtime_args_len = runtime_args_len; + copy_process(&p, config->process); +@@ -1343,4 +1343,4 @@ int rt_isula_kill(const char *id, const + } + + return 0; +-} +\ No newline at end of file ++} + +--- iSulad-v2.0.17/src/daemon/executor/container_cb/execution.c 2022-09-19 09:49:53.940634672 +0800 ++++ iSulad-v2.0.17/src/daemon/executor/container_cb/execution.c 2022-09-19 09:50:50.743070321 +0800 +@@ -270,7 +270,7 @@ static int prepare_start_io(container_t + goto out; + } + +- if (ready_copy_io_data(*sync_fd, false, request->stdin, request->stdout, request->stderr, stdinfd, ++ if (ready_copy_io_data(*sync_fd, false, request->stdin1, request->stdout1, request->stderr1, stdinfd, + stdout_handler, stderr_handler, (const char **)fifos, thread_id)) { + ret = -1; + goto out; + +--- iSulad-v2.0.17/src/daemon/executor/container_cb/execution_stream.c 2022-09-19 09:52:35.190871412 +0800 ++++ iSulad-v2.0.17/src/daemon/executor/container_cb/execution_stream.c 2022-09-19 09:54:16.304646931 +0800 +@@ -266,7 +266,7 @@ static int attach_prepare_console(const + goto out; + } + +- if (ready_copy_io_data(*sync_fd, false, request->stdin, request->stdout, request->stderr, stdinfd, ++ if (ready_copy_io_data(*sync_fd, false, request->stdin1, request->stdout1, request->stderr1, stdinfd, + stdout_handler, stderr_handler, (const char **)fifos, tid)) { + ret = -1; + goto out; +@@ -342,9 +342,9 @@ static int container_attach_cb(const con + } + + params.rootpath = cont->root_path; +- params.stdin = fifos[0]; +- params.stdout = fifos[1]; +- params.stderr = fifos[2]; ++ params.stdin1 = fifos[0]; ++ params.stdout1 = fifos[1]; ++ params.stderr1 = fifos[2]; + + (void)isulad_monitor_send_container_event(id, ATTACH, -1, 0, NULL, NULL); + +--- iSulad-v2.0.17/src/daemon/modules/api/runtime_api.h 2022-09-19 10:21:19.315094981 +0800 ++++ iSulad-v2.0.17/src/daemon/modules/api/runtime_api.h 2022-09-19 10:23:19.310015312 +0800 +@@ -70,9 +70,9 @@ typedef struct _rt_create_params_t { + const char *state; + void *oci_config_data; + bool terminal; +- const char *stdin; +- const char *stdout; +- const char *stderr; ++ const char *stdin1; ++ const char *stdout1; ++ const char *stderr1; + const char *exit_fifo; + bool tty; + bool open_stdin; +@@ -156,9 +156,9 @@ typedef struct _rt_resume_params_t { + + typedef struct _rt_attach_params_t { + const char *rootpath; +- const char *stdin; +- const char *stdout; +- const char *stderr; ++ const char *stdin1; ++ const char *stdout1; ++ const char *stderr1; + } rt_attach_params_t; + + typedef struct _rt_update_params_t { + +--- iSulad-v2.0.17/src/daemon/modules/service/service_container.c 2022-09-19 10:45:35.318254990 +0800 ++++ iSulad-v2.0.17/src/daemon/modules/service/service_container.c 2022-09-19 10:47:35.547173581 +0800 +@@ -825,9 +825,9 @@ static int do_start_container(container_ + create_params.state = cont->state_path; + create_params.oci_config_data = oci_spec; + create_params.terminal = tty; +- create_params.stdin = console_fifos[0]; +- create_params.stdout = console_fifos[1]; +- create_params.stderr = console_fifos[2]; ++ create_params.stdin1 = console_fifos[0]; ++ create_params.stdout1 = console_fifos[1]; ++ create_params.stderr1 = console_fifos[2]; + create_params.exit_fifo = exit_fifo; + create_params.tty = tty; + create_params.open_stdin = open_stdin; +@@ -1886,7 +1886,7 @@ static int exec_prepare_console(const co + ret = -1; + goto out; + } +- if (ready_copy_io_data(*sync_fd, false, request->stdin, request->stdout, request->stderr, stdinfd, ++ if (ready_copy_io_data(*sync_fd, false, request->stdin1, request->stdout1, request->stderr1, stdinfd, + stdout_handler, stderr_handler, (const char **)fifos, thread_id)) { + ret = -1; + goto out; + +--- iSulad-v2.0.17/src/cmd/isula/base/start.c 2022-09-19 11:16:14.838156121 +0800 ++++ iSulad-v2.0.17/src/cmd/isula/base/start.c 2022-09-19 11:18:12.374049157 +0800 +@@ -124,9 +124,9 @@ static int do_client_start(const struct + + request.name = args->name; + if (console_fifos != NULL && *console_fifos != NULL) { +- request.stdin = (*console_fifos)->stdin_name; +- request.stdout = (*console_fifos)->stdout_name; +- request.stderr = (*console_fifos)->stderr_name; ++ request.stdin1 = (*console_fifos)->stdin_name; ++ request.stdout1 = (*console_fifos)->stdout_name; ++ request.stderr1 = (*console_fifos)->stderr_name; + } + request.attach_stdin = args->custom_conf.attach_stdin; + request.attach_stdout = args->custom_conf.attach_stdout; + +--- iSulad-v2.0.17/src/cmd/isula/stream/exec.c 2022-09-19 11:22:01.760792010 +0800 ++++ iSulad-v2.0.17/src/cmd/isula/stream/exec.c 2022-09-19 11:22:29.969006333 +0800 +@@ -60,9 +60,9 @@ static int fill_exec_request(const struc + request->attach_stdout = args->custom_conf.attach_stdout; + request->attach_stderr = args->custom_conf.attach_stderr; + if (fifos != NULL) { +- request->stdin = util_strdup_s(fifos->stdin_name); +- request->stdout = util_strdup_s(fifos->stdout_name); +- request->stderr = util_strdup_s(fifos->stderr_name); ++ request->stdin1 = util_strdup_s(fifos->stdin_name); ++ request->stdout1 = util_strdup_s(fifos->stdout_name); ++ request->stderr1 = util_strdup_s(fifos->stderr_name); + } + + request->user = util_strdup_s(args->custom_conf.user); + +--- iSulad-v2.0.17/src/cmd/isula/stream/attach.c 2022-09-19 11:23:59.246684654 +0800 ++++ iSulad-v2.0.17/src/cmd/isula/stream/attach.c 2022-09-19 11:24:48.674060200 +0800 +@@ -398,9 +398,9 @@ static int client_attach(struct client_a + ret = ECOMMON; + goto out; + } +- request.stdin = util_strdup_s(attach_fifos->stdin_name); +- request.stdout = util_strdup_s(attach_fifos->stdout_name); +- request.stderr = util_strdup_s(attach_fifos->stderr_name); ++ request.stdin1 = util_strdup_s(attach_fifos->stdin_name); ++ request.stdout1 = util_strdup_s(attach_fifos->stdout_name); ++ request.stderr1 = util_strdup_s(attach_fifos->stderr_name); + #endif + + config = get_connect_config(args); + +--- iSulad-v2.0.17/src/CMakeLists.txt 2022-09-19 14:44:22.526007835 +0800 ++++ iSulad-v2.0.17/src/CMakeLists.txt 2022-09-19 14:43:07.452410938 +0800 +@@ -49,6 +49,7 @@ target_include_directories(libisulad_too + ) + set_target_properties(libisulad_tools PROPERTIES PREFIX "") + target_link_libraries(libisulad_tools ${ZLIB_LIBRARY} ${ISULA_LIBUTILS_LIBRARY} ${CRYPTO_LIBRARY}) ++target_link_libraries(libisulad_tools -lgcompat) + + if (ENABLE_OCI_IMAGE) + target_link_libraries(libisulad_tools ${LIBARCHIVE_LIBRARY}) + +--- iSulad-v2.0.17/src/daemon/modules/image/image_rootfs_handler.c 2022-09-26 09:24:19.359973622 +0800 ++++ iSulad-v2.0.17/src/daemon/modules/image/image_rootfs_handler.c 2022-09-26 09:44:38.957115144 +0800 +@@ -26,6 +26,8 @@ + #include + #include + #include ++#include ++#include + + #include "isula_libutils/log.h" + #include "err_msg.h" +--- iSulad-v2.0.17/src/daemon/executor/image_cb/image_cb.c.org 2022-12-05 07:17:02.493242658 +0000 ++++ iSulad-v2.0.17/src/daemon/executor/image_cb/image_cb.c 2022-12-05 07:17:26.830427286 +0000 +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + + #include "utils.h" + #include "error.h" +--- iSulad-v2.0.17/src/daemon/executor/container_cb/execution.c.org 2022-12-05 07:19:20.833292153 +0000 ++++ iSulad-v2.0.17/src/daemon/executor/container_cb/execution.c 2022-12-05 07:19:40.318439978 +0000 +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #include "isula_libutils/log.h" + #include "container_api.h" +--- iSulad-v2.0.17/src/daemon/executor/container_cb/execution_create.c.org 2022-12-05 07:20:52.222985471 +0000 ++++ iSulad-v2.0.17/src/daemon/executor/container_cb/execution_create.c 2022-12-05 07:21:14.617155365 +0000 +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #include "isula_libutils/log.h" + #include "isulad_config.h" +--- iSulad-v2.0.17/src/daemon/executor/container_cb/execution_information.c.org 2022-12-05 07:21:56.320471735 +0000 ++++ iSulad-v2.0.17/src/daemon/executor/container_cb/execution_information.c 2022-12-05 07:22:14.580610266 +0000 +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include + + #include "isula_libutils/log.h" + #include "isulad_config.h" +--- iSulad-v2.0.17/src/daemon/modules/events/monitord.c.org 2022-12-05 07:22:48.094864515 +0000 ++++ iSulad-v2.0.17/src/daemon/modules/events/monitord.c 2022-12-05 07:23:12.501049668 +0000 +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #include "isula_libutils/log.h" + #include "mainloop.h" +--- iSulad-v2.0.17/src/daemon/modules/image/oci/storage/layer_store/layer_store.c 2022-10-18 08:58:45.194015191 +0000 ++++ iSulad-v2.0.17/src/daemon/modules/image/oci/storage/layer_store/layer_store.c 2022-10-18 08:50:36.870156051 +0000 +@@ -31,7 +31,7 @@ + #include + #include + #include +-#include ++#include + + #include + #include +--- iSulad-v2.0.17/src/cmd/isulad/main.c 2022-10-14 14:04:50.303324243 +0800 ++++ iSulad-v2.0.17/src/cmd/isulad/main.c 2022-10-14 14:06:08.262895032 +0800 +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + #ifdef ENABLE_SUP_GROUPS + #include + #endif +--- iSulad-v2.0.17/src/daemon/executor/container_cb/execution.c.org 2022-12-07 01:25:01.400738816 +0000 ++++ iSulad-v2.0.17/src/daemon/executor/container_cb/execution.c 2022-12-07 02:20:22.825812021 +0000 +@@ -321,9 +321,9 @@ static int container_start_prepare(conta + static void handle_start_io_thread_by_cc(uint32_t cc, int sync_fd, pthread_t thread_id) + { + if (cc == ISULAD_SUCCESS) { +- if (thread_id > 0) { ++ if (thread_id != NULL) { + if (pthread_detach(thread_id) != 0) { +- SYSERROR("Failed to detach 0x%lx", thread_id); ++ SYSERROR("Failed to detach"); + } + } + if (sync_fd >= 0) { +@@ -335,9 +335,9 @@ static void handle_start_io_thread_by_cc + ERROR("Failed to write eventfd: %s", strerror(errno)); + } + } +- if (thread_id > 0) { ++ if (thread_id != NULL) { + if (pthread_join(thread_id, NULL) != 0) { +- ERROR("Failed to join thread: 0x%lx", thread_id); ++ ERROR("Failed to join thread"); + } + } + if (sync_fd >= 0) { +@@ -355,7 +355,7 @@ static int container_start_cb(const cont + char *fifopath = NULL; + container_t *cont = NULL; + int sync_fd = -1; +- pthread_t thread_id = 0; ++ pthread_t thread_id = NULL; + + DAEMON_CLEAR_ERRMSG(); + +--- iSulad-v2.0.17/src/cmd/isula/client_console.c.org 2022-12-07 02:06:17.452077052 +0000 ++++ iSulad-v2.0.17/src/cmd/isula/client_console.c 2022-12-07 02:26:21.167714118 +0000 +@@ -137,8 +137,7 @@ int create_console_fifos(bool attach_std + return -1; + } + +- ret = snprintf(subpath, sizeof(subpath), "%s/%s-%u-%u", name, type, (unsigned int)getpid(), +- (unsigned int)pthread_self()); ++ ret = snprintf(subpath, sizeof(subpath), "%s/%s-%u", name, type, (unsigned int)getpid()); + if (ret < 0 || (size_t)ret >= sizeof(subpath)) { + ERROR("Path is too long"); + goto cleanup; +--- iSulad-v2.0.17/src/daemon/executor/container_cb/execution_stream.c.org 2022-12-07 02:27:35.135313158 +0000 ++++ iSulad-v2.0.17/src/daemon/executor/container_cb/execution_stream.c 2022-12-07 02:30:44.758848855 +0000 +@@ -280,9 +280,9 @@ out: + static void handle_attach_io_thread_by_cc(uint32_t cc, int sync_fd, pthread_t thread_id) + { + if (cc == ISULAD_SUCCESS) { +- if (thread_id > 0) { ++ if (thread_id != NULL) { + if (pthread_detach(thread_id) != 0) { +- SYSERROR("Failed to detach 0x%lx", thread_id); ++ SYSERROR("Failed to detach"); + } + } + if (sync_fd >= 0) { +@@ -294,9 +294,9 @@ static void handle_attach_io_thread_by_c + ERROR("Failed to write eventfd: %s", strerror(errno)); + } + } +- if (thread_id > 0) { ++ if (thread_id != NULL) { + if (pthread_join(thread_id, NULL) != 0) { +- ERROR("Failed to join thread: 0x%lx", thread_id); ++ ERROR("Failed to join thread"); + } + } + if (sync_fd >= 0) { +@@ -314,7 +314,7 @@ static int container_attach_cb(const con + char *fifos[3] = { NULL, NULL, NULL }; + char *fifopath = NULL; + int syncfd = -1; +- pthread_t tid = 0; ++ pthread_t tid = NULL; + container_t *cont = NULL; + rt_attach_params_t params = { 0 }; + +--- iSulad-v2.0.17/src/daemon/modules/service/service_container.c.org 2022-12-07 02:40:35.645634260 +0000 ++++ iSulad-v2.0.17/src/daemon/modules/service/service_container.c 2022-12-07 02:42:19.363474236 +0000 +@@ -1912,9 +1912,9 @@ static void exec_container_end(container + ERROR("Failed to write eventfd: %s", strerror(errno)); + } + } +- if (thread_id > 0) { ++ if (thread_id != NULL) { + if (pthread_join(thread_id, NULL) != 0) { +- ERROR("Failed to join thread: 0x%lx", thread_id); ++ ERROR("Failed to join thread"); + } + } + if (sync_fd >= 0) { +@@ -1985,7 +1985,7 @@ int exec_container(const container_t *co + char *id = NULL; + char *fifos[3] = { NULL, NULL, NULL }; + char *fifopath = NULL; +- pthread_t thread_id = 0; ++ pthread_t thread_id = NULL; + defs_process_user *puser = NULL; + char exec_command[EVENT_ARGS_MAX] = { 0x00 }; + +--- iSulad-v2.0.17/src/daemon/modules/service/io_handler.c.org 2022-12-07 02:49:11.852812776 +0000 ++++ iSulad-v2.0.17/src/daemon/modules/service/io_handler.c 2022-12-07 02:51:19.900843677 +0000 +@@ -116,7 +116,6 @@ int create_daemon_fifos(const char *id, + char subpath[PATH_MAX] = { 0 }; + char fifodir[PATH_MAX] = { 0 }; + struct timespec now; +- pthread_t tid; + + nret = clock_gettime(CLOCK_REALTIME, &now); + if (nret != 0) { +@@ -124,15 +123,13 @@ int create_daemon_fifos(const char *id, + goto cleanup; + } + +- tid = pthread_self(); +- + statepath = conf_get_routine_statedir(runtime); + if (statepath == NULL) { + ERROR("State path is NULL"); + goto cleanup; + } + +- nret = snprintf(subpath, PATH_MAX, "%s/%s/%u_%u_%u", id, operation, (unsigned int)tid, (unsigned int)now.tv_sec, ++ nret = snprintf(subpath, PATH_MAX, "%s/%s/%u_%u", id, operation, (unsigned int)now.tv_sec, + (unsigned int)(now.tv_nsec)); + if (nret >= PATH_MAX || nret < 0) { + ERROR("Failed to print string"); diff --git a/meta-musl/recipes-core/isulad/isulad_%.bbappend b/meta-musl/recipes-core/isulad/isulad_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d0d9b09d85f7e50f99335248321b650a64728c9c --- /dev/null +++ b/meta-musl/recipes-core/isulad/isulad_%.bbappend @@ -0,0 +1,7 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +# add gcompat DEPENDS to support musl +DEPENDS_append = " gcompat " + +SRC_URI_append = " \ + file://isulad-musl.patch \ +" diff --git a/meta-musl/recipes-core/lcr/lcr/lcr-for-musl.patch b/meta-musl/recipes-core/lcr/lcr/lcr-for-musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..d0591be68c29f490ab5691aef56932fbade9bed0 --- /dev/null +++ b/meta-musl/recipes-core/lcr/lcr/lcr-for-musl.patch @@ -0,0 +1,91 @@ +--- lcr-v2.0.7.orig/src/json/schema/container/attach-request.json 2022-07-27 11:10:10.478884003 +0800 ++++ lcr-v2.0.7/src/json/schema/container/attach-request.json 2022-07-27 14:46:21.943112460 +0800 +@@ -14,13 +14,13 @@ + "attach_stderr": { + "type": "boolean" + }, +- "stdin": { ++ "stdin1": { + "type": "string" + }, +- "stdout": { ++ "stdout1": { + "type": "string" + }, +- "stderr": { ++ "stderr1": { + "type": "string" + } + } + +--- lcr-v2.0.7.orig/third_party/libocispec/common_h.py 2022-07-27 11:10:10.474883971 +0800 ++++ lcr-v2.0.7/third_party/libocispec/common_h.py 2022-07-27 11:10:34.027071821 +0800 +@@ -84,7 +84,7 @@ + + struct parser_context { + unsigned int options; +- FILE *stderr; ++ FILE *stderr1; + }; + + yajl_gen_status gen_yajl_object_residual (yajl_val obj, yajl_gen g, parser_error *err); + +--- lcr-v2.0.7.orig/src/json/schema/container/exec-request.json 2022-07-27 11:10:10.478884003 +0800 ++++ lcr-v2.0.7/src/json/schema/container/exec-request.json 2022-07-27 14:55:18.501364215 +0800 +@@ -20,13 +20,13 @@ + "attach_stderr": { + "type": "boolean" + }, +- "stdin": { ++ "stdin1": { + "type": "string" + }, +- "stdout": { ++ "stdout1": { + "type": "string" + }, +- "stderr": { ++ "stderr1": { + "type": "string" + }, + "argv": { + +--- lcr-v2.0.7.orig/third_party/libocispec/sources.py 2022-07-27 11:10:10.474883971 +0800 ++++ lcr-v2.0.7/third_party/libocispec/sources.py 2022-07-27 11:11:42.696619530 +0800 +@@ -272,8 +272,8 @@ + } + if (ctx->options & OPT_PARSE_STRICT) + { +- if (j > 0 && ctx->stderr > 0) +- fprintf (ctx->stderr, "WARNING: unknown key found\\n"); ++ if (j > 0 && ctx->stderr1 > 0) ++ fprintf (ctx->stderr1, "WARNING: unknown key found\\n"); + } + if (ctx->options & OPT_PARSE_FULLKEY) + ret->_residual = resi; + +--- lcr-v2.0.7.orig/src/json/schema/container/start-request.json 2022-07-27 11:10:10.477883995 +0800 ++++ lcr-v2.0.7/src/json/schema/container/start-request.json 2022-07-27 14:56:51.082097502 +0800 +@@ -5,19 +5,19 @@ + "id": { + "type": "string" + }, +- "stdin": { ++ "stdin1": { + "type": "string" + }, + "attach-stdin": { + "type": "boolean" + }, +- "stdout": { ++ "stdout1": { + "type": "string" + }, + "attach-stdout": { + "type": "boolean" + }, +- "stderr": { ++ "stderr1": { + "type": "string" + }, + "attach-stderr": { diff --git a/meta-musl/recipes-core/lcr/lcr_%.bbappend b/meta-musl/recipes-core/lcr/lcr_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..02ca0fd6a374b8ed8f24442c9367748e73281f9d --- /dev/null +++ b/meta-musl/recipes-core/lcr/lcr_%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +# add patch to support musl +SRC_URI_append = " \ + file://lcr-for-musl.patch \ +" diff --git a/meta-musl/recipes-core/libhugetlbfs/libhugetlbfs/libhugetlbfs-musl.patch b/meta-musl/recipes-core/libhugetlbfs/libhugetlbfs/libhugetlbfs-musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..523c4098c7a747968273afe6dba3daadc2508a6f --- /dev/null +++ b/meta-musl/recipes-core/libhugetlbfs/libhugetlbfs/libhugetlbfs-musl.patch @@ -0,0 +1,36 @@ +diff --git a/alloc.c b/alloc.c +index cf7eb40..beda681 100644 +--- a/alloc.c ++++ b/alloc.c +@@ -245,6 +245,7 @@ void free_huge_pages(void *ptr) + __free_huge_pages(ptr, 1); + } + ++#define _SC_LEVEL2_CACHE_LINESIZE 1150 + static size_t get_cacheline_size() { + #if defined(__linux__) + FILE * fp = fopen("/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size", "r"); +diff --git a/shm.c b/shm.c +index 9447b63..27b6ea7 100644 +--- a/shm.c ++++ b/shm.c +@@ -29,6 +29,7 @@ + #include "libhugetlbfs_internal.h" + #include "hugetlbfs.h" + #include ++#include + + #if defined(SYS_shmget) || defined(SYS_ipc) + #define HAVE_SHMGET_SYSCALL +diff --git a/tests/hugetests.h b/tests/hugetests.h +index fbe4dc0..c3fa320 100644 +--- a/tests/hugetests.h ++++ b/tests/hugetests.h +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #include "libhugetlbfs_privutils.h" + #include "libhugetlbfs_testprobes.h" diff --git a/meta-musl/recipes-core/libhugetlbfs/libhugetlbfs_%.bbappend b/meta-musl/recipes-core/libhugetlbfs/libhugetlbfs_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..4003266a36eedfd0b8acfb4eb4e337e67f7ae0e2 --- /dev/null +++ b/meta-musl/recipes-core/libhugetlbfs/libhugetlbfs_%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +# add patch to support musl +SRC_URI_append = " \ + file://libhugetlbfs-musl.patch \ +" diff --git a/meta-musl/recipes-core/libpwquality/libpwquality/libpwquality-musl.patch b/meta-musl/recipes-core/libpwquality/libpwquality/libpwquality-musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..dd650063d4c791133e1e8149941d5affcd6d7b96 --- /dev/null +++ b/meta-musl/recipes-core/libpwquality/libpwquality/libpwquality-musl.patch @@ -0,0 +1,10 @@ +--- libpwquality-1.4.4/src/pam_pwquality.c.org 2022-12-07 05:41:07.676699209 +0000 ++++ libpwquality-1.4.4/src/pam_pwquality.c 2022-12-07 05:42:00.396099608 +0000 +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include "pwquality.h" + + /* diff --git a/meta-musl/recipes-core/libpwquality/libpwquality_%.bbappend b/meta-musl/recipes-core/libpwquality/libpwquality_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..0373702dedfd6d45e9cdc556a315ddba13eba913 --- /dev/null +++ b/meta-musl/recipes-core/libpwquality/libpwquality_%.bbappend @@ -0,0 +1,10 @@ +DEPENDS_append ="\ + gcompat \ +" +LDFLAGS_append = " -lgcompat" + +#add patch to support musl +FILESEXTRAPATHS_prepend := "${THISDIR}/libpwquality/:" +SRC_URI_append = " \ + file://libpwquality-musl.patch \ +" diff --git a/meta-musl/recipes-core/lvm2/lvm2/add_header.patch b/meta-musl/recipes-core/lvm2/lvm2/add_header.patch new file mode 100644 index 0000000000000000000000000000000000000000..b8184f68cfe5040af17389de010c4f6d40489ff9 --- /dev/null +++ b/meta-musl/recipes-core/lvm2/lvm2/add_header.patch @@ -0,0 +1,28 @@ +diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c +index ad69f64..8117719 100644 +--- a/lib/mm/memlock.c ++++ b/lib/mm/memlock.c +@@ -27,6 +27,9 @@ + #include + #include + ++/*add header file for musl*/ ++#include ++ + #ifdef HAVE_VALGRIND + #include + #endif +diff --git a/tools/vgimportdevices.c b/tools/vgimportdevices.c +index ab359d3..cc85068 100644 +--- a/tools/vgimportdevices.c ++++ b/tools/vgimportdevices.c +@@ -16,6 +16,9 @@ + #include "lib/cache/lvmcache.h" + #include "lib/device/device_id.h" + ++/* coverity[unnecessary_header] needed for MuslC */ ++#include ++ + struct vgimportdevices_params { + uint32_t added_devices; + }; diff --git a/meta-musl/recipes-core/lvm2/lvm2/use_lgcompat.patch b/meta-musl/recipes-core/lvm2/lvm2/use_lgcompat.patch new file mode 100644 index 0000000000000000000000000000000000000000..2511617a254c3b0ac759c3a7420fd0fa391e9098 --- /dev/null +++ b/meta-musl/recipes-core/lvm2/lvm2/use_lgcompat.patch @@ -0,0 +1,11 @@ +--- LVM2.2.03.14/tools/Makefile.in.org 2022-12-05 06:02:57.551639891 +0000 ++++ LVM2.2.03.14/tools/Makefile.in 2022-12-05 06:00:59.752750543 +0000 +@@ -123,7 +123,7 @@ CFLAGS_lvm.o += $(EXTRA_EXEC_CFLAGS) + lvm: $(OBJECTS) lvm.o $(LVMINTERNAL_LIBS) + @echo " [CC] $@" + $(Q) $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_EXEC_LDFLAGS) $(ELDFLAGS) \ +- -o $@ $+ $(LVMLIBS) ++ -o $@ $+ $(LVMLIBS) -lgcompat + + DEFS_man-generator.o += -DMAN_PAGE_GENERATOR + diff --git a/meta-musl/recipes-core/lvm2/lvm2_%.bbappend b/meta-musl/recipes-core/lvm2/lvm2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..f846d56b7e7c2e5035329a0d01cdaae165e76585 --- /dev/null +++ b/meta-musl/recipes-core/lvm2/lvm2_%.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +DEPENDS_append ="\ + gcompat \ +" +LDFLAGS_append = " -lgcompat" +# add patch to support musl +SRC_URI_append =" \ + file://add_header.patch \ + file://use_lgcompat.patch \ +" diff --git a/meta-musl/recipes-core/lxc/lxc/lxc-for-musl.patch b/meta-musl/recipes-core/lxc/lxc/lxc-for-musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..c160b2ced584e1f6740eb285616e1afe1c54f771 --- /dev/null +++ b/meta-musl/recipes-core/lxc/lxc/lxc-for-musl.patch @@ -0,0 +1,72 @@ +diff -urN lxc-4.0.3.orig/src/lxc/json/defs.c lxc-4.0.3/src/lxc/json/defs.c +--- lxc-4.0.3.orig/src/lxc/json/defs.c 2022-09-07 17:05:55.714508559 +0800 ++++ lxc-4.0.3/src/lxc/json/defs.c 2022-09-07 17:05:55.711508533 +0800 +@@ -83,8 +83,8 @@ + strcmp(tree->u.object.keys[i], "args") && + strcmp(tree->u.object.keys[i], "env") && + strcmp(tree->u.object.keys[i], "timeout")) { +- if (ctx->stderr > 0) +- fprintf(ctx->stderr, "WARNING: unknown key found: %s\n", tree->u.object.keys[i]); ++ if (ctx->stderr1 > 0) ++ fprintf(ctx->stderr1, "WARNING: unknown key found: %s\n", tree->u.object.keys[i]); + } + } + return ret; +diff -urN lxc-4.0.3.orig/src/lxc/json/json_common.h lxc-4.0.3/src/lxc/json/json_common.h +--- lxc-4.0.3.orig/src/lxc/json/json_common.h 2022-09-07 17:05:55.714508559 +0800 ++++ lxc-4.0.3/src/lxc/json/json_common.h 2022-09-07 17:05:55.711508533 +0800 +@@ -39,7 +39,7 @@ + + struct parser_context { + unsigned int options; +- FILE *stderr; ++ FILE *stderr1; + }; + + yajl_gen_status reformat_number(void *ctx, const char *str, size_t len); +@@ -182,4 +182,4 @@ + } + #endif + +-#endif +\ No newline at end of file ++#endif +diff -urN lxc-4.0.3.orig/src/lxc/json/logger_json_file.c lxc-4.0.3/src/lxc/json/logger_json_file.c +--- lxc-4.0.3.orig/src/lxc/json/logger_json_file.c 2022-09-07 17:05:55.714508559 +0800 ++++ lxc-4.0.3/src/lxc/json/logger_json_file.c 2022-09-07 17:05:55.711508533 +0800 +@@ -50,8 +50,8 @@ + strcmp(tree->u.object.keys[i], "stream") && + strcmp(tree->u.object.keys[i], "time") && + strcmp(tree->u.object.keys[i], "attrs")) { +- if (ctx->stderr > 0) +- fprintf(ctx->stderr, "WARNING: unknown key found: %s\n", tree->u.object.keys[i]); ++ if (ctx->stderr1 > 0) ++ fprintf(ctx->stderr1, "WARNING: unknown key found: %s\n", tree->u.object.keys[i]); + } + } + return ret; +diff -urN lxc-4.0.3.orig/src/lxc/json/oci_runtime_spec.c lxc-4.0.3/src/lxc/json/oci_runtime_spec.c +--- lxc-4.0.3.orig/src/lxc/json/oci_runtime_spec.c 2022-09-07 17:05:55.714508559 +0800 ++++ lxc-4.0.3/src/lxc/json/oci_runtime_spec.c 2022-09-07 17:05:55.711508533 +0800 +@@ -67,8 +67,8 @@ + if (strcmp(tree->u.object.keys[i], "prestart") && + strcmp(tree->u.object.keys[i], "poststart") && + strcmp(tree->u.object.keys[i], "poststop")) { +- if (ctx->stderr > 0) +- fprintf(ctx->stderr, "WARNING: unknown key found: %s\n", tree->u.object.keys[i]); ++ if (ctx->stderr1 > 0) ++ fprintf(ctx->stderr1, "WARNING: unknown key found: %s\n", tree->u.object.keys[i]); + } + } + return ret; + +--- lxc-4.0.3/src/lxc/utils.c.org 2022-12-05 02:38:47.733328396 +0000 ++++ lxc-4.0.3/src/lxc/utils.c 2022-12-05 02:39:22.387590381 +0000 +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + + #include "config.h" + #include "log.h" diff --git a/meta-musl/recipes-core/lxc/lxc_%.bbappend b/meta-musl/recipes-core/lxc/lxc_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ac4bf4fb9bafa2774fc8e515b01444d8b4d4720c --- /dev/null +++ b/meta-musl/recipes-core/lxc/lxc_%.bbappend @@ -0,0 +1,15 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" + +DEPENDS_append ="\ + gcompat \ +" + +SRC_URI_append = " \ + file://lxc-for-musl.patch \ +" +CFLAGS_append = " -Wno-error=address -Wno-error=array-bounds -Wno-array-bounds " +LDFLAGS_append = " -lgcompat" +do_compile_prepend() { + sed -i "s/init_lxc_static_LDFLAGS = -all-static -pthread/init_lxc_static_LDFLAGS = -pthread/" ${S}/src/lxc/Makefile.am +} + diff --git a/meta-musl/recipes-core/packagegroups/packagegroup-pam-plugins.bbappend b/meta-musl/recipes-core/packagegroups/packagegroup-pam-plugins.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..f6cd81222adc78dbec6dee074cd329989d77c00b --- /dev/null +++ b/meta-musl/recipes-core/packagegroups/packagegroup-pam-plugins.bbappend @@ -0,0 +1,5 @@ +# remove them because of the lack of ruserok_af and logwtmp functions +RDEPENDS_${PN}_remove = "\ +pam-plugin-lastlog \ +pam-plugin-rhosts \ +" diff --git a/meta-musl/recipes-core/selinux/libselinux_%.bbappend b/meta-musl/recipes-core/selinux/libselinux_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e79b4d9d4451edb76ba86f641c5f966bdc8adef8 --- /dev/null +++ b/meta-musl/recipes-core/selinux/libselinux_%.bbappend @@ -0,0 +1,12 @@ +DEPENDS_append = " gcompat " +DEPENDS += "${@bb.utils.contains('LIBC', 'musl', 'fts', '', d)}" + +do_configure_prepend () { + if ! grep -q "-lfts" ${S}/src/Makefile ; then sed -i 's/FTS_LDLIBS ?=/FTS_LDLIBS ?= -lfts/' ${S}/src/Makefile; fi + + if ! grep -q "MU_LDLIBS" ${S}/src/Makefile; then + sed -i '/FTS_LDLIBS ?=/aMU_LDLIBS ?= -lgcompat' ${S}/src/Makefile + sed -i 's/$(FTS_LDLIBS)/$(FTS_LDLIBS) $(MU_LDLIBS)/' ${S}/src/Makefile; + fi + sed -i '/.*FTS_LDLIBS*/c\override LDLIBS += -lselinux -lfts ' ${S}/utils/Makefile +} diff --git a/meta-musl/recipes-devtools/binutils/binutils/use-static_cast.patch b/meta-musl/recipes-devtools/binutils/binutils/use-static_cast.patch new file mode 100644 index 0000000000000000000000000000000000000000..883418b597dc51a186c7afb9c612ca8766770a8a --- /dev/null +++ b/meta-musl/recipes-devtools/binutils/binutils/use-static_cast.patch @@ -0,0 +1,23 @@ +diff --git a/gold/gc.h b/gold/gc.h +index 6ebd81f3fd0..4a1368f5abe 100644 +--- a/gold/gc.h ++++ b/gold/gc.h +@@ -247,7 +247,7 @@ gc_process_relocs( + if (is_ordinary) + (*secvec).push_back(Section_id(src_obj, dst_indx)); + else +- (*secvec).push_back(Section_id(reinterpret_cast(NULL), 0)); ++ (*secvec).push_back(Section_id(static_cast(NULL), 0)); + // If the target of the relocation is an STT_SECTION symbol, + // make a note of that by storing -1 in the symbol vector. + if (lsym.get_st_type() == elfcpp::STT_SECTION) +@@ -329,7 +329,7 @@ gc_process_relocs( + if (is_ordinary && dst_obj != NULL) + (*secvec).push_back(Section_id(dst_obj, dst_indx)); + else +- (*secvec).push_back(Section_id(reinterpret_cast(NULL), 0)); ++ (*secvec).push_back(Section_id(static_cast(NULL), 0)); + (*symvec).push_back(gsym); + (*addendvec).push_back(std::make_pair( + static_cast(symvalue), + diff --git a/meta-musl/recipes-devtools/binutils/binutils_%.bbappend b/meta-musl/recipes-devtools/binutils/binutils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..97008cb695e062859469e1507418b8c1cda97345 --- /dev/null +++ b/meta-musl/recipes-devtools/binutils/binutils_%.bbappend @@ -0,0 +1,5 @@ +# add patch to support musl +FILESEXTRAPATHS_prepend := "${THISDIR}/binutils/:" +SRC_URI_append = " \ + file://use-static_cast.patch \ +" diff --git a/meta-musl/recipes-devtools/elfutils/elfutils_%.bbappend b/meta-musl/recipes-devtools/elfutils/elfutils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..f4b19b663bf7f4eaa8bb2aa7f3b5ce7becba3227 --- /dev/null +++ b/meta-musl/recipes-devtools/elfutils/elfutils_%.bbappend @@ -0,0 +1,4 @@ +# delete conflict patches from poky +SRC_URI_remove += " \ + file://0002-musl-libs.patch \ +" diff --git a/meta-musl/recipes-extended/procps/procps/procps-musl.patch b/meta-musl/recipes-extended/procps/procps/procps-musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..c1d1f221c9c562d9ab6bdbac775732d620582750 --- /dev/null +++ b/meta-musl/recipes-extended/procps/procps/procps-musl.patch @@ -0,0 +1,28 @@ +diff --git a/src/w.c b/src/w.c +index 63f81c7..186cac2 100644 +--- a/src/w.c ++++ b/src/w.c +@@ -45,9 +45,8 @@ + #include + #ifdef HAVE_UTMPX_H + # include +-#else +-# include + #endif ++#include + #include + + #include "c.h" +@@ -66,12 +65,6 @@ typedef struct utmpx utmp_t; + typedef struct utmp utmp_t; + #endif + +-#if !defined(UT_HOSTSIZE) || defined(__UT_HOSTSIZE) +-# define UT_HOSTSIZE __UT_HOSTSIZE +-# define UT_LINESIZE __UT_LINESIZE +-# define UT_NAMESIZE __UT_NAMESIZE +-#endif +- + #ifdef W_SHOWFROM + # define FROM_STRING "on" + #else diff --git a/meta-musl/recipes-extended/procps/procps_%.bbappend b/meta-musl/recipes-extended/procps/procps_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..34a2dadaa65bb7a4213fa2c29da7c1e8ff012b48 --- /dev/null +++ b/meta-musl/recipes-extended/procps/procps_%.bbappend @@ -0,0 +1,22 @@ +#main bbfile: yocto-poky/meta/recipes-extended/procps/procps_3.3.17.bb + +#version in openEuler +PV = "4.0.2" + +S = "${WORKDIR}/procps-ng-${PV}" + +FILESEXTRAPATHS_append := "${THISDIR}/procps/:" + +OPENEULER_REPO_NAME = "procps-ng" + +# files, patches can't be applied in openeuler or conflict with openeuler +# files, patches that come from openeuler +SRC_URI_append = " \ + file://procps-musl.patch \ +" + +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \ + " + +SRC_URI[sha256sum] = "ee3fcd2ea6ff94aa43a81ba5cc7912b7c9615acd2911c7a3d3ea081287fdf47a" diff --git a/meta-musl/recipes-external/gcompat/files/gcompat-1.1.0.tar.gz b/meta-musl/recipes-external/gcompat/files/gcompat-1.1.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f0bbf158d456cb9ea41220bfad4d21b42ee77c09 Binary files /dev/null and b/meta-musl/recipes-external/gcompat/files/gcompat-1.1.0.tar.gz differ diff --git a/meta-musl/recipes-external/gcompat/files/gcompat-modify-makefile.patch b/meta-musl/recipes-external/gcompat/files/gcompat-modify-makefile.patch new file mode 100644 index 0000000000000000000000000000000000000000..1890fc4ef4291d20f39baa07e02f980352742d4c --- /dev/null +++ b/meta-musl/recipes-external/gcompat/files/gcompat-modify-makefile.patch @@ -0,0 +1,53 @@ +--- gcompat-1.1.0/Makefile.org 2022-10-21 08:13:10.000000000 +0000 ++++ gcompat-1.1.0/Makefile 2022-12-02 07:06:46.958388096 +0000 +@@ -37,9 +37,12 @@ LIBGCOMPAT_SRC = \ + libgcompat/version.c \ + libgcompat/wchar.c + LIBGCOMPAT_OBJ = ${LIBGCOMPAT_SRC:.c=.o} ++LIBGCOMPAT_STATIC_OBJ = ${LIBGCOMPAT_SRC:.c=.lo} + LIBGCOMPAT_SOVERSION = 0 + LIBGCOMPAT_NAME = libgcompat.so.${LIBGCOMPAT_SOVERSION} +-LIBGCOMPAT_PATH = /lib/${LIBGCOMPAT_NAME} ++LIBGCOMPAT_PATH = /lib64/${LIBGCOMPAT_NAME} ++LIBGCOMPAT_STATIC_NAME = libgcompat.a ++LIBGCOMPAT_STATIC_PATH = /usr/lib64/${LIBGCOMPAT_STATIC_NAME} + + LOADER_SRC = \ + loader/loader.c +@@ -66,7 +69,7 @@ OBSTACK_CFLAGS = $(shell ${PKG_CONFIG} - + OBSTACK_LIBS = $(shell ${PKG_CONFIG} --libs ${WITH_OBSTACK}) + endif + +-all: ${LIBGCOMPAT_NAME} ${LOADER_NAME} ++all: ${LIBGCOMPAT_NAME} ${LIBGCOMPAT_STATIC_NAME} + + ${LIBGCOMPAT_NAME}: ${LIBGCOMPAT_OBJ} + ${CC} ${CFLAGS} ${LDFLAGS} -shared -Wl,-soname,${LIBGCOMPAT_NAME} \ +@@ -86,14 +89,25 @@ ${LOADER_NAME}: ${LOADER_OBJ} + -Wall -Wextra -Wno-frame-address -Wno-unused-parameter \ + ${LIBUCONTEXT_CFLAGS} ${OBSTACK_CFLAGS} -o $@ $< + ++${LIBGCOMPAT_STATIC_NAME}: ${LIBGCOMPAT_STATIC_OBJ} ++ ${AR} rcs ${LIBGCOMPAT_STATIC_NAME} ${LIBGCOMPAT_STATIC_OBJ} ++${LIBGCOMPAT_STATIC_OBJ}: ${LIBGCOMPAT_INCLUDE} ++%.lo:%.c ++ ${CC} ${CPPFLAGS} ${CFLAGS} -c -D_BSD_SOURCE \ ++ -DLIBGCOMPAT='"${LIBGCOMPAT_PATH}"' \ ++ -DLINKER='"${LINKER_PATH}"' -DLOADER='"${LOADER_NAME}"' \ ++ -Ilibgcompat -std=c99 \ ++ -Wall -Wextra -Wno-unused-parameter \ ++ ${LIBUCONTEXT_CFLAGS} ${OBSTACK_CFLAGS} -o $@ $< ++ + clean: +- rm -f libgcompat/*.o loader/*.o ${LIBGCOMPAT_NAME} ${LOADER_NAME} ++ rm -f libgcompat/*.o loader/*.o libgcompat/*.lo ${LIBGCOMPAT_NAME} ${LOADER_NAME} ${LIBGCOMPAT_STATIC_NAME} + + format: + clang-format -i ${LIBGCOMPAT_INCLUDE} ${LIBGCOMPAT_SRC} ${LOADER_SRC} + + install: all + install -D -m755 ${LIBGCOMPAT_NAME} ${DESTDIR}/${LIBGCOMPAT_PATH} +- install -D -m755 ${LOADER_NAME} ${DESTDIR}/${LOADER_PATH} ++ install -D -m755 ${LIBGCOMPAT_STATIC_NAME} ${DESTDIR}/${LIBGCOMPAT_STATIC_PATH} + + .PHONY: all clean format install diff --git a/meta-musl/recipes-external/gcompat/files/libgcompat_musl.patch b/meta-musl/recipes-external/gcompat/files/libgcompat_musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..6ff2b59d9a04a199069626ed53980d7c457c0377 --- /dev/null +++ b/meta-musl/recipes-external/gcompat/files/libgcompat_musl.patch @@ -0,0 +1,131 @@ +diff -uprN gcompat-1.1.0-org/libgcompat/pwd_utils.h gcompat-1.1.0/libgcompat/pwd_utils.h +--- gcompat-1.1.0-org/libgcompat/pwd_utils.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcompat-1.1.0/libgcompat/pwd_utils.h 2022-12-05 02:16:59.119490849 +0000 +@@ -0,0 +1,14 @@ ++#ifndef PWD_UTILS_H ++#define PWD_UTILS_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++int fgetpwent_r(FILE *, struct passwd *, char *, size_t , struct passwd **); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -uprN gcompat-1.1.0-org/libgcompat/malloc_utils.h gcompat-1.1.0/libgcompat/malloc_utils.h +--- gcompat-1.1.0-org/libgcompat/malloc_utils.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcompat-1.1.0/libgcompat/malloc_utils.h 2022-12-05 06:15:46.226443423 +0000 +@@ -0,0 +1,38 @@ ++#ifndef MALLOC_UTILS_H ++#define MALLOC_UTILS_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++struct mallinfo { ++ int arena; /* Non-mmapped space allocated (bytes) */ ++ int ordblks; /* Number of free chunks */ ++ int smblks; /* Number of free fastbin blocks */ ++ int hblks; /* Number of mmapped regions */ ++ int hblkhd; /* Space allocated in mmapped regions (bytes) */ ++ int usmblks; /* Maximum total allocated space (bytes) */ ++ int fsmblks; /* Space in freed fastbin blocks (bytes) */ ++ int uordblks; /* Total allocated space (bytes) */ ++ int fordblks; /* Total free space (bytes) */ ++ int keepcost; /* Top-most, releasable space (bytes) */ ++}; ++ ++struct mallinfo mallinfo(void); ++ ++#define M_TRIM_THRESHOLD -1 ++#define M_TOP_PAD -2 ++#define M_MMAP_THRESHOLD -3 ++#define M_ARENA_TEST -7 ++ ++#define __NEED_size_t ++ ++#include ++ ++int mallopt(int param, int value); ++int malloc_trim(size_t pad); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff -uprN gcompat-1.1.0-org/libgcompat/grp_utils.h gcompat-1.1.0/libgcompat/grp_utils.h +--- gcompat-1.1.0-org/libgcompat/grp_utils.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcompat-1.1.0/libgcompat/grp_utils.h 2022-12-05 06:51:54.723830738 +0000 +@@ -0,0 +1,14 @@ ++#ifndef GRP_UTILS_H ++#define GRP_UTILS_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++int fgetgrent_r(FILE *, struct group *, char *, size_t, struct group **); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +--- gcompat-1.1.0/libgcompat/malloc.c.org 2022-12-07 03:26:38.767933984 +0000 ++++ gcompat-1.1.0/libgcompat/malloc.c 2022-12-07 03:28:23.965783566 +0000 +@@ -31,18 +31,7 @@ + + #include "alias.h" /* alias */ + +-struct mallinfo { +- int arena; /* Non-mmapped space allocated (bytes) */ +- int ordblks; /* Number of free chunks */ +- int smblks; /* Number of free fastbin blocks */ +- int hblks; /* Number of mmapped regions */ +- int hblkhd; /* Space allocated in mmapped regions (bytes) */ +- int usmblks; /* Maximum total allocated space (bytes) */ +- int fsmblks; /* Space in freed fastbin blocks (bytes) */ +- int uordblks; /* Total allocated space (bytes) */ +- int fordblks; /* Total free space (bytes) */ +- int keepcost; /* Top-most, releasable space (bytes) */ +-}; ++#include "malloc_utils.h" + + void *__libc_calloc(size_t nmemb, size_t size) + { +@@ -95,6 +84,12 @@ int malloc_trim(size_t pad) + return 0; + } + ++int mallopt(int param_number, int value) ++{ ++ /* This concept doesn't really map to musl's malloc */ ++ return 0; ++} ++ + void mtrace(void) + { + /* Not implemented on purpose. */ +diff -uprN gcompat-1.1.0-org/libgcompat/execinfo.h gcompat-1.1.0/libgcompat/execinfo.h +--- gcompat-1.1.0-org/libgcompat/execinfo.h 1970-01-01 00:00:00.000000000 +0000 ++++ gcompat-1.1.0/libgcompat/execinfo.h 2022-12-07 07:33:33.891081524 +0000 +@@ -0,0 +1,14 @@ ++#ifndef EXECINFO_H ++#define EXECINFO_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++int backtrace(void **, int); ++char ** backtrace_symbols(void *const *, int); ++void backtrace_symbols_fd(void *const *, int, int); ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* EXECINFO_H */ diff --git a/meta-musl/recipes-external/gcompat/gcompat_1.1.0.bb b/meta-musl/recipes-external/gcompat/gcompat_1.1.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..6654a542da248deecc8202d5f9f6507ea19697a8 --- /dev/null +++ b/meta-musl/recipes-external/gcompat/gcompat_1.1.0.bb @@ -0,0 +1,27 @@ +SUMMARY = "a library which provides glibc-compatible APIs for use on musl libc systems" +HOMEPAGE = "https://git.adelielinux.org/adelie/gcompat" +LICENSE = "NCSA" +LIC_FILES_CHKSUM = "file://LICENSE;md5=802b1aed7330d90086be4de63a3188e3" +SECTION = "libs" + +PV = "1.1.0" +SRC_URI = "file://gcompat-${PV}.tar.gz \ + file://gcompat-modify-makefile.patch \ + file://libgcompat_musl.patch \ + " + +SRC_URI[sha256sum] = "82e56d2ecda3f11a93efe61001394a6e5db39c91127d0812d7ad5b0bda558010" + +do_configure() { + : +} + +do_compile() { + oe_runmake +} + +do_install() { + oe_runmake install DESTDIR=${D} + install -d ${D}${includedir} + install -m 644 ${S}/libgcompat/*.h ${D}${includedir} +} diff --git a/meta-musl/recipes-external/musl/bsd-headers.bbappend b/meta-musl/recipes-external/musl/bsd-headers.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e6dc0bea29d3224fd64f3ec31aedf69a9c18de89 --- /dev/null +++ b/meta-musl/recipes-external/musl/bsd-headers.bbappend @@ -0,0 +1,11 @@ +PACKAGES = "${PN}" + +# add patch to support musl +FILESEXTRAPATHS_prepend := "${THISDIR}/bsd-headers/:" +SRC_URI_append = " \ + file://sys-cdefs-musl.patch \ +" + +FILES_${PN} = " \ + /usr/* \ +" diff --git a/meta-musl/recipes-external/musl/bsd-headers/sys-cdefs-musl.patch b/meta-musl/recipes-external/musl/bsd-headers/sys-cdefs-musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..076fbfb12f917b580d050b71d3055ba05057532a --- /dev/null +++ b/meta-musl/recipes-external/musl/bsd-headers/sys-cdefs-musl.patch @@ -0,0 +1,24 @@ +--- a/sys-cdefs.h 2022-11-16 08:35:20.089145983 +0000 ++++ b/sys-cdefs.h 2022-11-16 08:49:14.023211318 +0000 +@@ -1,4 +1,5 @@ +-#warning usage of non-standard #include is deprecated ++#ifndef SYS_CDEFS_H ++#define SYS_CDEFS_H 1 + + #undef __P + #undef __PMT +@@ -24,3 +25,14 @@ + # define __THROW + # define __NTH(fct) fct + #endif ++ ++#if defined(__GNUC__) && !defined(__cplusplus) ++# define __nonnull(params) __attribute__ ((__nonnull__ params)) ++#else ++# define __nonnull(params) ++#endif ++ ++#undef __always_inline ++#define __always_inline __inline __attribute__ ((__always_inline__)) ++ ++#endif /* sys/cdefs.h */ diff --git a/meta-musl/recipes-external/musl/musl_1.2.3.bb b/meta-musl/recipes-external/musl/musl_1.2.3.bb new file mode 100644 index 0000000000000000000000000000000000000000..b4e4591ef28ad27fd89daf3c7d514fe4d1722a93 --- /dev/null +++ b/meta-musl/recipes-external/musl/musl_1.2.3.bb @@ -0,0 +1,88 @@ +SUMMARY = "An implementation of the standard library for Linux-based systems" +DESCRIPTION = "A new standard library to power a new generation of Linux-based devices. \ +musl is lightweight, fast, simple, free, and strives to be correct in the sense of \ +standards-conformance and safety." + +HOMEPAGE = "http://www.musl-libc.org/" +LICENSE = "MIT" +SECTION = "libs" + +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +PACKAGES = "${PN} ${PN}-dev ${PN}-staticdev" + +PROVIDES += "virtual/libc \ + virtual/libiconv \ + virtual/libintl \ + virtual/crypt \ + linux-libc-headers \ + linux-libc-headers-dev" + +DEPENDS = "bsd-headers \ + libssp-nonshared \ + " +INHIBIT_DEFAULT_DEPS = "1" + +PR = "r1" + +INHIBIT_SYSROOT_STRIP = "1" +INSANE_SKIP_${PN} += "already-stripped" + +PSEUDO_DISABLED = "1" + +inherit external-toolchain + +do_configure() { + : +} + +do_compile () { + : +} + +python do_install () { + bb.build.exec_func('external_toolchain_do_install', d) + bb.build.exec_func('musl_external_do_install_extra', d) +} + +musl_external_do_install_extra(){ + # Modify musl dynamic library search path + mkdir -p ${D}${sysconfdir} + touch ${D}${sysconfdir}/ld-musl-aarch64.path + echo "${base_libdir}" > ${D}${sysconfdir}/ld-musl-aarch64.path + echo "${libdir}" >> ${D}${sysconfdir}/ld-musl-aarch64.path + + # Support perf compile + # Due to musl missing __always_inline definition + sed -i '/#include /a\#include ' ${D}${includedir}/linux/swab.h + sed -i '/#include /a\#include ' ${D}${includedir}/linux/byteorder/little_endian.h + + # Delete conflict file + rm -f ${D}${base_libdir}/libgcc_s.so + rm -f ${D}${base_libdir}/libgcc_s.so.1 +} + +do_package_qa[noexec] = "1" +EXCLUDE_FROM_SHLIBS = "1" + +# In case of conflict +FILES_${PN} = " \ + ${base_libdir}/*.so \ + ${base_libdir}/*.so.* \ + ${base_sbindir}/ldconfig \ + ${includedir}/* \ + ${libdir}/* \ + /usr/lib/* \ + ${sysconfdir}/ld-musl-aarch64.path \ +" +FILES_${PN}-staticdev = " \ + ${base_libdir}/*.a \ +" +# Add depend package +RDEPENDS_${PN} += " bsd-headers gcompat gcompat-dev" + +INSANE_SKIP_${PN} += "installed-vs-shipped" +INSANE_SKIP += "dev-elf dev-so" + + +SYSROOT_DIRS = "/usr/*" diff --git a/meta-musl/recipes-support/ethercat/ethercat_e1000e-%.bbappend b/meta-musl/recipes-support/ethercat/ethercat_e1000e-%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..5f934b0085378b1fdc9695514659f838a25de6a9 --- /dev/null +++ b/meta-musl/recipes-support/ethercat/ethercat_e1000e-%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +# add patch to support musl +SRC_URI_append = " \ + file://ethercat_musl.patch \ +" diff --git a/meta-musl/recipes-support/ethercat/files/ethercat_musl.patch b/meta-musl/recipes-support/ethercat/files/ethercat_musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..b66422432b5933b4898e99c34f31d91506f94694 --- /dev/null +++ b/meta-musl/recipes-support/ethercat/files/ethercat_musl.patch @@ -0,0 +1,11 @@ +--- a/master/globals.h 2022-11-16 06:47:21.199110038 +0000 ++++ b/master/globals.h 2022-11-16 06:48:10.055056280 +0000 +@@ -259,6 +259,8 @@ extern char *ec_master_version_str; + + /*****************************************************************************/ + ++typedef long ssize_t; //for ssize_t ++ + unsigned int ec_master_count(void); + void ec_print_data(const uint8_t *, size_t); + void ec_print_data_diff(const uint8_t *, const uint8_t *, size_t); diff --git a/meta-musl/recipes-support/libgpg-error/files/libgpg-error-musl.patch b/meta-musl/recipes-support/libgpg-error/files/libgpg-error-musl.patch new file mode 100644 index 0000000000000000000000000000000000000000..1d5e0591f34a1d02f0ead33d98ea95a5e76fe225 --- /dev/null +++ b/meta-musl/recipes-support/libgpg-error/files/libgpg-error-musl.patch @@ -0,0 +1,29 @@ +--- a/src/syscfg/lock-obj-pub.linux-musl.h 1970-01-01 08:00:00.000000000 +0800 ++++ b/src/syscfg/lock-obj-pub.linux-musl.h 2022-09-22 10:45:41.214400997 +0800 +@@ -0,0 +1,26 @@ ++## lock-obj-pub.linux-musl.h ++## File created by gen-posix-lock-obj - DO NOT EDIT ++## To be included by mkheader into gpg-error.h ++ ++typedef struct ++{ ++ long _vers; ++ union { ++ volatile char _priv[48]; ++ long _x_align; ++ long *_xp_align; ++ } u; ++} gpgrt_lock_t; ++ ++#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \ ++ 0,0,0,0,0,0,0,0, \ ++ 0,0,0,0,0,0,0,0, \ ++ 0,0,0,0,0,0,0,0, \ ++ 0,0,0,0,0,0,0,0, \ ++ 0,0,0,0,0,0,0,0}}} ++## ++## Local Variables: ++## mode: c ++## buffer-read-only: t ++## End: ++## diff --git a/meta-musl/recipes-support/libgpg-error/libgpg-error_%.bbappend b/meta-musl/recipes-support/libgpg-error/libgpg-error_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e6ce3d00d962160bc7aec0610e5497f0514c3fa3 --- /dev/null +++ b/meta-musl/recipes-support/libgpg-error/libgpg-error_%.bbappend @@ -0,0 +1,7 @@ +# patch directary +FILESEXTRAPATHS_append := "${THISDIR}/files/:" + +# add patch to support musl +SRC_URI_append += " \ + file://libgpg-error-musl.patch \ +" diff --git a/meta-openeuler/classes/autotools.bbclass b/meta-openeuler/classes/autotools.bbclass index 8a0fcb38689cd418149df401745c5f7bc1c768c8..ee6b5d226022af6e9e9af0ab61e806f8a6f6f5f3 100644 --- a/meta-openeuler/classes/autotools.bbclass +++ b/meta-openeuler/classes/autotools.bbclass @@ -1,4 +1,7 @@ -def autotools_xxxx(d): +# openeuler's autotools.bbclass is almost the same as poky's autotools.bbclass except STAGING_DATADIR_NATIVE +# is replaced with NATIVESDK_DATADIR. In the future, if the problem of NATIVE and NATIVESDK is fixed, +# openeuler's autotools.bbclass can be removed +def autotools_dep_prepend(d): if d.getVar('INHIBIT_AUTOTOOLS_DEPS'): return '' @@ -10,19 +13,18 @@ def autotools_xxxx(d): deps += 'autoconf-native automake-native ' if not pn in ['libtool', 'libtool-native'] and not pn.endswith("libtool-cross"): + deps += 'libtool-native ' if not bb.data.inherits_class('native', d) \ and not bb.data.inherits_class('nativesdk', d) \ and not bb.data.inherits_class('cross', d) \ and not d.getVar('INHIBIT_DEFAULT_DEPS'): - image_name = "%s%s" % (d.getVar('MACHINE_ARCH'), d.getVar('OPENEULER_KERNEL_TAG')) - #if image_name in ['arm32a15eb-4.4', 'arm32a9eb-4.4', 'arm32a9eb-tiny-4.4', 'arm64eb-4.4']: - #deps += ' ' - #else: - #deps += 'libtool-cross ' + deps += 'libtool-cross ' - return deps + 'gnu-config-native ' + return deps -DEPENDS_prepend = "${@autotools_xxxx(d)} " +DEPENDS_prepend = "${@autotools_dep_prepend(d)} " + +NATIVESDK_DATADIR = "${OPENEULER_NATIVESDK_SYSROOT}/usr/share" inherit siteinfo @@ -30,9 +32,10 @@ inherit siteinfo # results for autoconf tests we cannot run at build time. # The value of this variable is filled in in a prefunc because it depends on # the contents of the sysroot. -export CONFIG_SITE = "${@siteinfo_get_files(d)}" +export CONFIG_SITE + acpaths ?= "default" -EXTRA_AUTORECONF_DEFINE = " AUTOPOINT=echo GTKDOCIZE=echo " +EXTRA_AUTORECONF = "--exclude=autopoint --exclude=gtkdocize" export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir}" @@ -53,6 +56,8 @@ export LDFLAGS_FOR_BUILD = "${BUILD_LDFLAGS}" def append_libtool_sysroot(d): # Only supply libtool sysroot option for non-native packages + if not bb.data.inherits_class('native', d): + return '--with-libtool-sysroot=${STAGING_DIR_HOST}' return "" CONFIGUREOPTS = " --build=${BUILD_SYS} \ @@ -90,7 +95,7 @@ oe_runconf () { cfgscript=`python3 -c "import os; print(os.path.relpath(os.path.dirname('${CONFIGURE_SCRIPT}'), '.'))"`/$cfgscript_name if [ -x "$cfgscript" ] ; then bbnote "Running $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} $@" - if ! CONFIG_SHELL=/bin/bash ${CACHED_CONFIGUREVARS} $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"; then + if ! CONFIG_SHELL=${CONFIG_SHELL-/bin/bash} ${CACHED_CONFIGUREVARS} $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"; then bbnote "The following config.log files may provide further information." bbnote `find ${B} -ignore_readdir_race -type f -name config.log` bbfatal_log "configure failed" @@ -134,14 +139,14 @@ EXTRACONFFUNCS ??= "" EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}" do_configure[prefuncs] += "autotools_preconfigure autotools_aclocals ${EXTRACONFFUNCS}" -#do_compile[prefuncs] += "autotools_aclocals" -#do_install[prefuncs] += "autotools_aclocals" +do_compile[prefuncs] += "autotools_aclocals" +do_install[prefuncs] += "autotools_aclocals" do_configure[postfuncs] += "autotools_postconfigure" ACLOCALDIR = "${STAGING_DATADIR}/aclocal" -ACLOCALEXTRAPATH = "" -ACLOCALEXTRAPATH_class-target = " -I ${STAGING_DATADIR_NATIVE}/aclocal/" -ACLOCALEXTRAPATH_class-nativesdk = " -I ${STAGING_DATADIR_NATIVE}/aclocal/" +ACLOCALEXTRAPATH = "-I ${NATIVESDK_DATADIR}/aclocal/" +ACLOCALEXTRAPATH_class-target = " -I ${NATIVESDK_DATADIR}/aclocal/" +ACLOCALEXTRAPATH_class-nativesdk = " -I ${NATIVESDK_DATADIR}/aclocal/" python autotools_aclocals () { d.setVar("CONFIG_SITE", siteinfo_get_files(d, sysrootcache=True)) @@ -168,6 +173,7 @@ autotools_do_configure() { olddir=`pwd` cd ${AUTOTOOLS_SCRIPT_PATH} mkdir -p ${ACLOCALDIR} + ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/" if [ x"${acpaths}" = xdefault ]; then acpaths= for i in `find ${AUTOTOOLS_SCRIPT_PATH} -ignore_readdir_race -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \ @@ -177,20 +183,17 @@ autotools_do_configure() { else acpaths="${acpaths}" fi - acpaths="$acpaths -I ${ACLOCALDIR}" - if [ -d ${STAGING_DATADIR_NATIVE}/aclocal ]; then - acpaths="$acpaths ${ACLOCALEXTRAPATH}" - fi + acpaths="$acpaths ${ACLOCALEXTRAPATH}" AUTOV=`automake --version | sed -e '1{s/.* //;s/\.[0-9]\+$//};q'` automake --version echo "AUTOV is $AUTOV" - if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then - ACLOCAL="$ACLOCAL --automake-acdir=${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV" + if [ -d ${NATIVESDK_DATADIR}/aclocal-$AUTOV ]; then + ACLOCAL="$ACLOCAL --automake-acdir=${NATIVESDK_DATADIR}/aclocal-$AUTOV" fi # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look # like it was auto-generated. Work around this by blowing it away # by hand, unless the package specifically asked not to run aclocal. - if ! echo ${EXTRA_AUTORECONF_DEFINE} | grep -q "ACLOCAL"; then + if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then rm -f aclocal.m4 fi if [ -e configure.in ]; then @@ -198,56 +201,34 @@ autotools_do_configure() { else CONFIGURE_AC=configure.ac fi - sed -i '/AC_CANONICAL_TARGET/atest -n $target_alias && test "$target_alias" = "$host_alias" && test "$program_prefix$program_suffix$program_transform_name" = "${target_alias}-NONEs,x,x," && program_prefix=NONE' ${CONFIGURE_AC} if grep -q "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC; then if grep -q "sed.*POTFILES" $CONFIGURE_AC; then : do nothing -- we still have an old unmodified configure.ac - else + else bbnote Executing glib-gettextize --force --copy echo "no" | glib-gettextize --force --copy fi elif [ "${BPN}" != "gettext" ] && grep -q "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC; then # We'd call gettextize here if it wasn't so broken... - cp /usr/share/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/ + cp ${NATIVESDK_DATADIR}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/ if [ -d ${S}/po/ ]; then - cp -f /usr/share/gettext/po/Makefile.in.in ${S}/po/ + cp -f ${NATIVESDK_DATADIR}/gettext/po/Makefile.in.in ${S}/po/ if [ ! -e ${S}/po/remove-potcdate.sin ]; then - cp /usr/share/gettext/po/remove-potcdate.sin ${S}/po/ + cp ${NATIVESDK_DATADIR}/gettext/po/remove-potcdate.sin ${S}/po/ fi fi PRUNE_M4="$PRUNE_M4 gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4" fi mkdir -p m4 - if grep -q "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC; then - if ! echo "${DEPENDS}" | grep -q intltool-native; then - bbwarn "Missing DEPENDS on intltool-native" - fi - PRUNE_M4="$PRUNE_M4 intltool.m4" - bbnote Executing intltoolize --copy --force --automake - intltoolize --copy --force --automake - fi for i in $PRUNE_M4; do find ${S} -ignore_readdir_race -name $i -delete done - tmp_site=`pwd`/tmp.site - rm -f ${tmp_site} - for f in $CONFIG_SITE - do - bbnote Adding script ${f} to site file - cat $f >> ${tmp_site} - done - export CONFIG_SITE=${tmp_site} - - bbnote Executing ACLOCAL=\"$ACLOCAL\" ${EXTRA_AUTORECONF_DEFINE} autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths - ACLOCAL="$ACLOCAL" ${EXTRA_AUTORECONF_DEFINE} autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed." - cp -f ${RECIPE_SYSROOT_NATIVE}/usr/share/gnu-config/config.guess . - cp -f ${RECIPE_SYSROOT_NATIVE}/usr/share/gnu-config/config.sub . + bbnote Executing ACLOCAL=\"$ACLOCAL\" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths + ACLOCAL="$ACLOCAL" autoreconf -Wcross -Wno-obsolete --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed." cd $olddir fi - test ! -f ${S}/aclocal.m4 || sed -i "/MSGMERGE_FOR_MSGFMT_OPTION/{s|--for-msgfmt||g}" ${S}/aclocal.m4 - test ! -f ${S}/configure || sed -i "/MSGMERGE_FOR_MSGFMT_OPTION/{s|--for-msgfmt||g}" ${S}/configure if [ -e ${CONFIGURE_SCRIPT} ]; then oe_runconf else @@ -256,19 +237,7 @@ autotools_do_configure() { } autotools_do_compile() { - for libtool_file in `find ${B} -ignore_readdir_race -name libtool`; do - sed -i 's/macro_version=2.4.2/macro_version=2.4.6/g' $libtool_file - sed -i 's/macro_revision=1.3337/macro_revision=2.4.6/g' $libtool_file - sed -i 's/VERSION=2.4.2/VERSION=2.4.6/g' $libtool_file - sed -i 's/package_revision=2.4.2/package_revision=2.4.6/g' $libtool_file - sed -i 's/package_revision=1.3337/package_revision=2.4.6/g' $libtool_file - if [ ${BUILD_SYS} != ${TARGET_SYS} ]; then - sed -i 's|lt_sysroot=|lt_sysroot=${RECIPE_SYSROOT}|' $libtool_file - fi - sed -i '/fake/{ n; s/add_dir=-L$libdir/add_dir="-L$lt_sysroot$libdir"/; }' $libtool_file - sed -i '/fake/{ n; s/add_dir="-L$libdir"/add_dir="-L$lt_sysroot$libdir"/; }' $libtool_file - done - oe_runmake + oe_runmake } autotools_do_install() { diff --git a/meta-openeuler/classes/blacklist_dynamic.bbclass b/meta-openeuler/classes/blacklist_dynamic.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..8ebcaf6ad4b488edf7b40abe74450fa07a86130e --- /dev/null +++ b/meta-openeuler/classes/blacklist_dynamic.bbclass @@ -0,0 +1,43 @@ +# Blacklist recipe names which include variable references, handling +# multilibs. +# +# Ex. +# PNBLACKLIST_DYNAMIC += "${MLPREFIX}gcc-cross-${TARGET_ARCH}" +# PNBLACKLIST_DYNAMIC += "gcc-source-${@'${GCCVERSION}'.replace('%', '')}" + +PNBLACKLIST_DYNAMIC ?= "" + +inherit blacklist + +python pnblacklist_dynamic_setup () { + d = e.data + + blacklisted = d.getVar('PNBLACKLIST_DYNAMIC', False) + if not blacklisted.strip(): + return + + multilibs = d.getVar('MULTILIBS', True) or '' + + # this block has been copied from base.bbclass so keep it in sync + prefixes = [] + for ext in multilibs.split(): + eext = ext.split(':') + if len(eext) > 1 and eext[0] == 'multilib': + prefixes.append(eext[1]) + + to_blacklist = set() + for prefix in [''] + prefixes: + localdata = bb.data.createCopy(d) + if prefix: + localdata.setVar('MLPREFIX', prefix + '-') + override = ':virtclass-multilib-' + prefix + localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override) + bb.data.update_data(localdata) + + to_blacklist |= set(filter(None, localdata.getVar('PNBLACKLIST_DYNAMIC').split())) + + for blrecipe in to_blacklist: + d.setVarFlag('PNBLACKLIST', blrecipe, 'blacklisted by PNBLACKLIST_DYNAMIC') +} +pnblacklist_dynamic_setup[eventmask] = "bb.event.ConfigParsed" +addhandler pnblacklist_dynamic_setup diff --git a/meta-openeuler/classes/cargo.bbclass b/meta-openeuler/classes/cargo.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..e5138f3c15f7c57092487524d83afe69720b34ff --- /dev/null +++ b/meta-openeuler/classes/cargo.bbclass @@ -0,0 +1,320 @@ +# This file is developed based on meta-rust-bin(https://github.com/rust-embedded/meta-rust-bin) +# using MIT License +# +# Copyright © 2016 meta-rust-bin author +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software +# and associated documentation files (the “Software”), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, publish, distribute, +# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# The above copyright notice and this permission notice shall be included in all copies or +# substantial portions of the Software. + +RUST_BASE_URI := "https://static.rust-lang.org" + +# Many crates rely on pkg-config to find native versions of their libraries for +# linking - do the simple thing and make it generally available. +DEPENDS_append = "\ + cargo-bin-cross-${TARGET_ARCH} \ + pkgconfig-native \ +" + +# Move CARGO_HOME from default of ~/.cargo +export CARGO_HOME = "${WORKDIR}/cargo_home" + +# If something fails while building, this might give useful information +export RUST_BACKTRACE = "1" + +# Do build out-of-tree +B = "${WORKDIR}/target" +export CARGO_TARGET_DIR = "${B}" + +RUST_TARGET = "${@rust_target(d, 'TARGET')}" +RUST_BUILD = "${@rust_target(d, 'BUILD')}" + +# Additional flags passed directly to the "cargo build" invocation +EXTRA_CARGO_FLAGS ??= "" +EXTRA_RUSTFLAGS ??= "" +RUSTFLAGS += "${EXTRA_RUSTFLAGS}" + +# Space-separated list of features to enable +CARGO_FEATURES ??= "" + +# Control the Cargo build type (debug or release) +CARGO_BUILD_TYPE ?= "--release" + +CARGO_INSTALL_DIR ?= "${D}${bindir}" + +CARGO_DEBUG_DIR = "${B}/${RUST_TARGET}/debug" +CARGO_RELEASE_DIR = "${B}/${RUST_TARGET}/release" +WRAPPER_DIR = "${WORKDIR}/wrappers" + +# Set the Cargo manifest path to the typical location +CARGO_MANIFEST_PATH ?= "${S}/Cargo.toml" + +FILES_${PN}-dev += "${libdir}/*.rlib" +FILES_${PN}-dev += "${libdir}/*.rlib.*" + +CARGO_BUILD_FLAGS = "\ + --verbose \ + --manifest-path ${CARGO_MANIFEST_PATH} \ + --target=${RUST_TARGET} \ + ${CARGO_BUILD_TYPE} \ + ${@oe.utils.conditional('CARGO_FEATURES', '', '', '--features "${CARGO_FEATURES}"', d)} \ + ${EXTRA_CARGO_FLAGS} \ +" + +# CARGO_CRATES_SOURCE setting can enable replacement of crates source +# simply, you can set CARGO_CRATES_SOURCE = "tuna" +CARGO_CRATES_SOURCE ??= "" + +write_cargo_source() { + varname="$1" + varval="$2" + if [ "${varval}" != "None" ]; then + cat <<- EOF >> ${CARGO_HOME}/config +${varname} = "${varval}" +EOF + fi +} + +create_cargo_config() { + if [ "${RUST_BUILD}" != "${RUST_TARGET}" ]; then + cat <<- EOF > ${CARGO_HOME}/config +[target.${RUST_BUILD}] +linker = '${WRAPPER_DIR}/ld-native-wrapper.sh' + +[target.${RUST_TARGET}] +linker = '${WRAPPER_DIR}/ld-wrapper.sh' + +EOF + else + cat <<- EOF > ${CARGO_HOME}/config +[target.${RUST_TARGET}] +linker = '${WRAPPER_DIR}/ld-wrapper.sh' + +EOF + fi + + cat <<- EOF >> ${CARGO_HOME}/config +[build] +rustflags = ['-C', 'rpath'] + +[profile.release] +debug = true + +EOF + + if [ -n "${CARGO_CRATES_SOURCE}" ]; then + cat <<- EOF >> ${CARGO_HOME}/config +[source.crates-io] +replace-with = "${CARGO_CRATES_SOURCE}" + +[source.${CARGO_CRATES_SOURCE}] + +EOF + + write_cargo_source "registry" "${@d.getVarFlag('CARGO_CRATES_SOURCE', 'registry', True)}" + write_cargo_source "local-registry" "${@d.getVarFlag('CARGO_CRATES_SOURCE', 'local-registry', True)}" + write_cargo_source "directory" "${@d.getVarFlag('CARGO_CRATES_SOURCE', 'directory', True)}" + write_cargo_source "git" "${@d.getVarFlag('CARGO_CRATES_SOURCE', 'git', True)}" + write_cargo_source "branch" "${@d.getVarFlag('CARGO_CRATES_SOURCE', 'branch', True)}" + write_cargo_source "tag" "${@d.getVarFlag('CARGO_CRATES_SOURCE', 'tag', True)}" + write_cargo_source "rev" "${@d.getVarFlag('CARGO_CRATES_SOURCE', 'rev', True)}" + fi +} + +cargo_do_configure() { + mkdir -p "${B}" + mkdir -p "${CARGO_HOME}" + mkdir -p "${WRAPPER_DIR}" + + # Yocto provides the C compiler in ${CC} but that includes options beyond + # the compiler binary. cargo/rustc expect a single binary, so we put ${CC} + # in a wrapper script. + cat <<- EOF > "${WRAPPER_DIR}/cc-wrapper.sh" +#!/bin/sh +${CC} "\$@" +EOF + chmod +x "${WRAPPER_DIR}/cc-wrapper.sh" + + cat <<- EOF > "${WRAPPER_DIR}/cxx-wrapper.sh" +#!/bin/sh +${CXX} "\$@" +EOF + chmod +x "${WRAPPER_DIR}/cxx-wrapper.sh" + + cat <<- EOF > "${WRAPPER_DIR}/cc-native-wrapper.sh" +#!/bin/sh +${BUILD_CC} "\$@" +EOF + chmod +x "${WRAPPER_DIR}/cc-native-wrapper.sh" + + cat <<- EOF > "${WRAPPER_DIR}/cxx-native-wrapper.sh" +#!/bin/sh +${BUILD_CXX} "\$@" +EOF + chmod +x "${WRAPPER_DIR}/cxx-native-wrapper.sh" + + cat <<- EOF > "${WRAPPER_DIR}/ld-wrapper.sh" +#!/bin/sh +${CC} ${LDFLAGS} "\$@" +EOF + chmod +x "${WRAPPER_DIR}/ld-wrapper.sh" + + cat <<- EOF > "${WRAPPER_DIR}/ld-native-wrapper.sh" +#!/bin/sh +${BUILD_CC} ${BUILD_LDFLAGS} "\$@" +EOF + chmod +x "${WRAPPER_DIR}/ld-native-wrapper.sh" + + # Create our global config in CARGO_HOME + create_cargo_config +} + +cargo_do_compile() { + export TARGET_CC="${WRAPPER_DIR}/cc-wrapper.sh" + export TARGET_CXX="${WRAPPER_DIR}/cxx-wrapper.sh" + export CC="${WRAPPER_DIR}/cc-native-wrapper.sh" + export CXX="${WRAPPER_DIR}/cxx-native-wrapper.sh" + export TARGET_LD="${WRAPPER_DIR}/ld-wrapper.sh" + export LD="${WRAPPER_DIR}/ld-native-wrapper.sh" + export PKG_CONFIG_ALLOW_CROSS="1" + export LDFLAGS="" + export RUSTFLAGS="${RUSTFLAGS}" + bbdebug 2 "which rustc:" `which rustc` + bbdebug 2 "rustc --version" `rustc --version` + bbdebug 2 "which cargo:" `which cargo` + bbdebug 2 "cargo --version" `cargo --version` + bbdebug 2 cargo build ${CARGO_BUILD_FLAGS} + cargo build ${CARGO_BUILD_FLAGS} +} + +cargo_do_install() { + if [ "${CARGO_BUILD_TYPE}" = "--release" ]; then + local cargo_bindir="${CARGO_RELEASE_DIR}" + else + local cargo_bindir="${CARGO_DEBUG_DIR}" + fi + + local files_installed="" + + for tgt in "${cargo_bindir}"/*; do + case $tgt in + *.so|*.rlib) + so_name=$(basename $tgt) + install -d "${D}${libdir}" + install -m755 "$tgt" "${D}${libdir}/$so_name.${PV}" + cd "${D}${libdir}" && ln -fs "$so_name" "$so_name.${PV}" + files_installed="$files_installed $tgt" + ;; + *examples) + if [ -d "$tgt" ]; then + for example in "$tgt/"*; do + if [ -f "$example" ] && [ -x "$example" ]; then + install -d "${CARGO_INSTALL_DIR}" + install -m755 "$example" "${CARGO_INSTALL_DIR}" + files_installed="$files_installed $example" + fi + done + fi + ;; + *) + if [ -f "$tgt" ] && [ -x "$tgt" ]; then + install -d "${CARGO_INSTALL_DIR}" + install -m755 "$tgt" "${CARGO_INSTALL_DIR}" + files_installed="$files_installed $tgt" + fi + ;; + esac + done + + if [ -z "$files_installed" ]; then + bbfatal "Cargo found no files to install" + else + bbnote "Installed the following files:" + for f in $files_installed; do + bbnote " " `basename $f` + done + fi +} + +def rust_target(d, spec_type): + ''' + Convert BitBake system specs into Rust target. + `spec_type` is one of BUILD, TARGET, or HOST + ''' + import re + spec_type = spec_type.upper() + + arch = d.getVar('%s_ARCH' % spec_type, True) + os = d.getVar('%s_OS' % spec_type, True) + + # Make sure that tasks properly recalculate after ARCH or OS change + d.appendVarFlag("rust_target", "vardeps", " %s_ARCH" % spec_type) + d.appendVarFlag("rust_target", "vardeps", " %s_OS" % spec_type) + + # os should in "linux" "freebsd" ... + if '-' in os: + os = os[:os.find('-')] + + # The bitbake vendor won't ever match the Rust specs + vendor = "unknown" + + tclibc = d.getVar("TCLIBC", True) + callconvention = "gnu" + # Only install the musl target toolchain for rust + # versions 1.35.0 and above + if spec_type == "TARGET" and tclibc == "musl": + pnre = re.compile("rustc-bin-cross") + m = pnre.match(d.getVar("PN", True)) + if m: + pv = d.getVar("PV", True) + if pv >= "1.35.0": + callconvention = "musl" + else: + callconvention = "musl" + + # TUNE_FEATURES are always only for the TARGET + if spec_type == "TARGET": + tune = d.getVar("TUNE_FEATURES", True).split() + tune += d.getVar("MACHINEOVERRIDES", True).split(":") + else: + tune = [] + + if arch in ["x86_64", "x86-64", "x64", "amd64"]: + arch = "x86_64" + elif arch in ["arm", "armv6l", "armv7l"]: + # Rust requires NEON/VFP in order to build for armv7, else fall back to v6 + tune_armv7 = any(t.startswith("armv7") for t in tune) + tune_neon = "neon" in tune + tune_cchard = "callconvention-hard" in tune + if all([tune_armv7, tune_neon, tune_cchard]): + arch = "armv7" + callconvention += "eabihf" + elif any(t.startswith("armv5") for t in tune): + arch = "armv5te" + callconvention += "eabi" + else: + arch = "arm" + if tune_cchard: + callconvention += "eabihf" + else: + callconvention += "eabi" + elif arch in ["aarch64"]: + arch = "aarch64" + else: + bb.fatal("Unknown or unsupported architecture: %s" % arch) + + target = "%s-%s-%s-%s" % (arch, vendor, os, callconvention) + + return target + +rust_target[vardepsexclude] += "rust_target[vardeps]" + +EXPORT_FUNCTIONS do_configure do_compile do_install + +# skip riscv as they are not well supported by rust now +COMPATIBLE_HOST_riscv64 = "null" +COMPATIBLE_HOST_riscv32 = "null" diff --git a/meta-openeuler/classes/common-license.bbclass b/meta-openeuler/classes/common-license.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..f043da50a2625dc59d423c83771f8bcb3e648031 --- /dev/null +++ b/meta-openeuler/classes/common-license.bbclass @@ -0,0 +1,48 @@ +# Handle automatically pointing LIC_FILES_CHKSUM to a common license outside +# the recipe's source tree, based on the value of LICENSE. +LIC_FILES_CHKSUM ?= "${COMMON_LIC_CHKSUM}" + +COMMON_LIC_CHKSUM = "" +COMMON_LIC_CHKSUM_CLOSED = "" +COMMON_LIC_CHKSUM_GPL-2.0-only = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" +COMMON_LIC_CHKSUM_GPL-3.0-only = "file://${COREBASE}/meta/files/common-licenses/GPL-3.0-only;md5=c79ff39f19dfec6d293b95dea7b07891" +COMMON_LIC_CHKSUM_GPL-3.0-with-GCC-exception = "file://${COREBASE}/meta/files/common-licenses/GPL-3.0-with-GCC-exception;md5=aef5f35c9272f508be848cd99e0151df" +COMMON_LIC_CHKSUM_LGPL-2.1-only = "file://${COREBASE}/meta/files/common-licenses/LGPL-2.1-only;md5=1a6d268fd218675ffea8be556788b780" + +python () { + import oe.license + + #; Set LIC_FILES_CHKSUM to a common license if it's unset and LICENSE is set + licensestr = d.getVar('LICENSE', True) + for pkg in d.getVar('PACKAGES', True).split(): + pkg_lic = d.getVar('LICENSE_%s' % pkg, True) + if pkg_lic: + licensestr += ' ' + pkg_lic + + licenses = oe.license.flattened_licenses(licensestr, lambda a, b: a + b) + checksums = set() + for license in licenses: + if license != 'CLOSED' and d.getVar('LIC_FILES_CHKSUM', False) == '${COMMON_LIC_CHKSUM}': + license = mapped_license(license, d) + + ext_chksum_var = 'COMMON_LIC_CHKSUM_{0}'.format(license) + if d.getVar(ext_chksum_var, True): + checksums.add('${%s}' % ext_chksum_var) + else: + lic_file_name = '${COREBASE}/meta/files/common-licenses/%s' % license + lic_file = d.expand(lic_file_name) + if os.path.exists(lic_file): + md5 = bb.utils.md5_file(lic_file) + chksum = 'file://{0};md5={1}'.format(lic_file_name, md5) + bb.fatal('{0}: No available license checksum info for this license. Either set LIC_FILES_CHKSUM, or define:\n {1} = "{2}"'.format(d.getVar('PF', True), ext_chksum_var, chksum)) + d.setVar('COMMON_LIC_CHKSUM', ' '.join(checksums)) +} + +def mapped_license(license, d): + if license.endswith('+'): + license = license[:-1] + + mapped = d.getVarFlag('SPDXLICENSEMAP', license, False) + if mapped: + license = mapped + return license diff --git a/meta-openeuler/classes/external-toolchain-cross-canadian.bbclass b/meta-openeuler/classes/external-toolchain-cross-canadian.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..4080bb152777211d447ff8cec419872687350c0b --- /dev/null +++ b/meta-openeuler/classes/external-toolchain-cross-canadian.bbclass @@ -0,0 +1,58 @@ +# cross-canadian.bbclass depends on chrpath-native, change to chrpath on the host +inherit external-toolchain cross-canadian + +# Toolchain binaries are expected to run on both this host and SDKMACHINE, so +# we should be able to use host tools. +STRIP_task-package = "strip" +STRIP_task-populate-sysroot = "strip" +OBJCOPY_task-package = "objcopy" +PACKAGE_DEPENDS_remove = "virtual/${TARGET_PREFIX}binutils" + +# Scan just toolchains root directory, but include some additional mirrors +EXTERNAL_INSTALL_SOURCE_PATHS = "${EXTERNAL_TOOLCHAIN}" +FILES_MIRRORS += "\ + ${bindir}/|/bin/\n \ + ${libdir}/|/lib64/\n \ + ${libexecdir}/|/libexec/\n \ + ${prefix}/|${target_prefix}/\n \ + ${prefix}/|${target_base_prefix}/\n \ + ${exec_prefix}/|${target_exec_prefix}/\n \ + ${exec_prefix}/|${target_base_prefix}/\n \ + ${base_prefix}/|${target_base_prefix}/\n \ +" + +# Align with more typical toolchain layout. Everything is already isolated by +# EXTERNAL_TARGET_SYS, we don't need cross-canadian.bbclass to do it for us. +bindir = "${exec_prefix}/bin" +libdir_arm = "${exec_prefix}/lib" +libdir = "${exec_prefix}/lib64" +libexecdir = "${exec_prefix}/libexec" + +# We're relying on a compatible host libc, not one from a nativesdk build +INSANE_SKIP_${PN} += "build-deps file-rdeps" + +do_install_append () { + for i in ${D}${bindir}/${EXTERNAL_TARGET_SYS}-*; do + if [ -e "$i" ]; then + j="$(basename "$i")" + [[ -e "${D}${bindir}/${TARGET_PREFIX}${j#${EXTERNAL_TARGET_SYS}-}" ]] && continue + ln -sv "$j" "${D}${bindir}/${TARGET_PREFIX}${j#${EXTERNAL_TARGET_SYS}-}" + fi + done +} + +# add links toolchain such as *-gcc to sdk +python add_files_links () { + prefix = d.getVar('EXTERNAL_TARGET_SYS') + '-' + full_prefix = os.path.join(d.getVar('bindir'), prefix) + new_prefix = d.getVar('TARGET_PREFIX') + for pkg in d.getVar('PACKAGES').split(): + files = (d.getVar('FILES_%s' % pkg) or '').split() + new_files = [] + for f in files: + if f.startswith(full_prefix): + new_files.append(f.replace(prefix, new_prefix)) + if new_files: + d.appendVar('FILES_%s' % pkg, ' ' + ' '.join(new_files)) +} +do_package[prefuncs] += "add_files_links" diff --git a/meta-openeuler/classes/external-toolchain-cross.bbclass b/meta-openeuler/classes/external-toolchain-cross.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..b93174b553a2cb5d2264ef38e18bbc189ce552e8 --- /dev/null +++ b/meta-openeuler/classes/external-toolchain-cross.bbclass @@ -0,0 +1,44 @@ +inherit external-toolchain cross + +EXTERNAL_CROSS_BINARIES ?= "" + +# Modify wrap_bin for clang/llvm wrapper +# When using clang/clang++ for cross compiler, it needs gcc-toolchain, so add some parameter in needded. +# And remove prefix llvm- for binutils, because there are using hard code like ${HOST_PREFIX}objdump in package.bbclass +# and some package using hard code like ${TARGET_PREFIX}ar/as/... when do_configure task. +wrap_bin () { + bin="$1" + shift + script="${D}${bindir}/${TARGET_PREFIX}$bin" + execcmd="exec ${EXTERNAL_TOOLCHAIN_BIN}/${EXTERNAL_TARGET_SYS}-$bin \"\$@\"" + case $bin in + clang*) + execcmd="exec ${EXTERNAL_TOOLCHAIN_BIN}/$bin --target=${EXTERNAL_TARGET_SYS} --gcc-toolchain=${EXTERNAL_TOOLCHAIN} --sysroot=${EXTERNAL_TOOLCHAIN_SYSROOT} -Wno-int-conversion \"\$@\"" + ;; + llvm-*) + script="${D}${bindir}/${TARGET_PREFIX}${bin:5}" + execcmd="exec ${EXTERNAL_TOOLCHAIN_BIN}/$bin \"\$@\"" + ;; + *) + ;; + esac + printf '#!/bin/sh\n' >$script + for arg in "$@"; do + printf '%s\n' "$arg" + done >>"$script" + printf '%s\n' "${execcmd}" >>"$script" + chmod +x "$script" +} + +do_install () { + install -d ${D}${bindir} + for bin in ${EXTERNAL_CROSS_BINARIES}; do + if [ ! -e "${EXTERNAL_TOOLCHAIN_BIN}/${EXTERNAL_TARGET_SYS}-$bin" ] && [ ! -e "${EXTERNAL_TOOLCHAIN_BIN}/$bin" ]; then + bbdebug 1 "${EXTERNAL_TOOLCHAIN_BIN}/${EXTERNAL_TARGET_SYS}-$bin or ${EXTERNAL_TOOLCHAIN_BIN}/$bin does not exist" + continue + fi + + bbdebug 1 wrap_bin "$bin" + wrap_bin "$bin" + done +} diff --git a/meta-openeuler/classes/external-toolchain.bbclass b/meta-openeuler/classes/external-toolchain.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..9216f4883de165a5ac0bd9fe0cc89cdfe6037dc5 --- /dev/null +++ b/meta-openeuler/classes/external-toolchain.bbclass @@ -0,0 +1,190 @@ +# This class provides everything necessary for a recipe to pull bits from an +# external toolchain: +# - Automatically sets LIC_FILES_CHKSUM based on LICENSE if appropriate +# - Searches the external toolchain sysroot and alternate locations for the +# patterns specified in the FILES variables, with support for checking +# alternate locations within the sysroot as well +# - Automatically PROVIDES/RPROVIDES the non-external-suffixed names +# - Usual bits to handle packaging of existing binaries +# - Automatically skips the recipe if its files aren't available in the +# external toolchain + +# Since these are prebuilt binaries, there are no source files to checksum for +# LIC_FILES_CHKSUM, so use the license from common-licenses +inherit common-license + +# We don't extract anything which will create S, and we don't want to see the +# warning about it +S = "${WORKDIR}" + +# Prebuilt binaries, no need for any default dependencies +INHIBIT_DEFAULT_DEPS = "1" + +# Missing build deps don't matter when we don't build anything +INSANE_SKIP_${PN} += "build-deps" + +EXTERNAL_PN ?= "${@PN.replace('-external', '')}" +PROVIDES += "${EXTERNAL_PN}" +LICENSE = "CLOSED" +LIC_FILES_CHKSUM = "${COMMON_LIC_CHKSUM}" + +# Packaging requires objcopy/etc for split and strip +PACKAGE_DEPENDS += "virtual/${MLPREFIX}${TARGET_PREFIX}binutils" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +EXTERNAL_PV_PREFIX ?= "" +EXTERNAL_PV_SUFFIX ?= "" +PV_prepend = "${@'${EXTERNAL_PV_PREFIX}' if '${EXTERNAL_PV_PREFIX}' else ''}" +PV_append = "${@'${EXTERNAL_PV_SUFFIX}' if '${EXTERNAL_PV_SUFFIX}' else ''}" + +EXTERNAL_EXTRA_FILES ?= "" + +# Skip this recipe if we don't have files in the external toolchain +EXTERNAL_AUTO_PROVIDE ?= "0" +EXTERNAL_AUTO_PROVIDE_class-target ?= "1" + +# We don't care if this path references other variables +EXTERNAL_TOOLCHAIN[vardepvalue] = "${EXTERNAL_TOOLCHAIN}" + +# We don't want to rebuild if the path to the toolchain changes, only if the +# toolchain changes +external_toolchain_do_install[vardepsexclude] += "EXTERNAL_TOOLCHAIN" +EXTERNAL_INSTALL_SOURCE_PATHS[vardepsexclude] += "EXTERNAL_TOOLCHAIN" + +# Propagate file permissions mode from owner to the rest of the user +# so the toolchain bits would be available for everyone to use even in the +# directories with root permissions. +EXTERNAL_PROPAGATE_MODE ?= "0" + +python () { + # Skipping only matters up front + if d.getVar('BB_WORKERCONTEXT', True) == '1': + return + + if not d.getVar('TCMODE', True).startswith('external'): + raise bb.parse.SkipPackage("External toolchain not configured (TCMODE not set to an external toolchain).") + + # We're not an available provider if there's no external toolchain + if not d.getVar("EXTERNAL_TOOLCHAIN", True): + raise bb.parse.SkipPackage("External toolchain not configured (EXTERNAL_TOOLCHAIN not set).") + + if not bb.utils.to_boolean(d.getVar('EXTERNAL_AUTO_PROVIDE', d)): + return + + sysroots, mirrors, premirrors = oe.external.get_file_search_metadata(d) + search_patterns = [] + pattern = d.getVar('EXTERNAL_PROVIDE_PATTERN', True) + if pattern: + search_patterns.append(pattern) + else: + files = oe.external.gather_pkg_files(d) + search_patterns.extend(filter(lambda f: '.debug' not in f, files)) + + expanded = oe.external.expand_paths(search_patterns, mirrors, premirrors) + paths = oe.external.search_sysroots(expanded, sysroots) + if not any(f for p, f in paths): + raise bb.parse.SkipPackage('No files found in external toolchain sysroot for: {}'.format(', '.join(search_patterns))) +} + +fakeroot python do_install () { + bb.build.exec_func('external_toolchain_do_install', d) + pass # Sentinel +} + +def external_toolchain_propagate_mode (d, installdest): + import stat + + propagate = d.getVar('EXTERNAL_PROPAGATE_MODE', True) + if propagate == '0': + return + + for root, dirs, files in os.walk(installdest): + for bit in dirs + files: + path = os.path.join(root, bit) + try: + bitstat = os.stat(path) + except ValueError: + continue + else: + newmode = bitstat.st_mode + if bitstat.st_mode & stat.S_IRUSR: + newmode |= stat.S_IRGRP | stat.S_IROTH + if bitstat.st_mode & stat.S_IXUSR: + newmode |= stat.S_IXGRP | stat.S_IXOTH + os.chmod(path, newmode) + +python external_toolchain_do_install () { + import subprocess + installdest = d.getVar('D', True) + sysroots, mirrors, premirrors = oe.external.get_file_search_metadata(d) + files = oe.external.gather_pkg_files(d) + oe.external.copy_from_sysroots(files, sysroots, mirrors, premirrors, installdest) + if 'do_install_extra' in d: + bb.build.exec_func('do_install_extra', d) + external_toolchain_propagate_mode(d, installdest) +} +external_toolchain_do_install[vardeps] += "${@' '.join('FILES_%s' % pkg for pkg in '${PACKAGES}'.split())}" + +# Change do_install's CWD to EXTERNAL_TOOLCHAIN for convenience +do_install[dirs] = "${D} ${EXTERNAL_TOOLCHAIN}" + +python () { + # Deal with any do_install_append + install = d.getVar('do_install', False) + try: + base, appended = install.split('# Sentinel', 1) + except ValueError: + pass + else: + d.setVar('do_install', base) + if appended.strip(): + d.setVar('do_install_appended', appended) + d.setVarFlag('do_install_appended', 'func', '1') + d.appendVarFlag('do_install', 'postfuncs', ' do_install_appended') +} + +# Toolchain shipped binaries weren't necessarily built ideally +WARN_QA_remove = "ldflags textrel" +ERROR_QA_remove = "ldflags textrel" + +# Debug files may well have already been split out, or stripped out +INSANE_SKIP_${PN} += "already-stripped" + +RPROVIDES_${PN} += "${EXTERNAL_PN}" +RPROVIDES_${PN}-dev += "${EXTERNAL_PN}-dev" +RPROVIDES_${PN}-staticdev += "${EXTERNAL_PN}-staticdev" +RPROVIDES_${PN}-dbg += "${EXTERNAL_PN}-dbg" +RPROVIDES_${PN}-doc += "${EXTERNAL_PN}-doc" +RPROVIDES_${PN}-locale += "${EXTERNAL_PN}-locale" +LOCALEBASEPN = "${EXTERNAL_PN}" + +FILES_${PN} = "" +FILES_${PN}-dev = "" +FILES_${PN}-staticdev = "" +FILES_${PN}-doc = "" +FILES_${PN}-locale = "" + +def debug_paths(d): + l = d.createCopy() + l.finalize() + paths = [] + exclude = [ + l.getVar('datadir', True), + l.getVar('includedir', True), + ] + for p in l.getVar('PACKAGES', True).split(): + if p.endswith('-dbg'): + continue + for f in (l.getVar('FILES_%s' % p, True) or '').split(): + if any((f == x or f.startswith(x + '/')) for x in exclude): + continue + d = os.path.dirname(f) + b = os.path.basename(f) + paths.append('/usr/lib/debug{0}/{1}.debug'.format(d, b)) + paths.append('{0}/.debug/{1}'.format(d, b)) + paths.append('{0}/.debug/{1}.debug'.format(d, b)) + return set(paths) + +FILES_${PN}-dbg = "${@' '.join(debug_paths(d))}" diff --git a/meta-openeuler/classes/external_global.bbclass b/meta-openeuler/classes/external_global.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..9ae006e971a1eb0cdf064805211835de7676576c --- /dev/null +++ b/meta-openeuler/classes/external_global.bbclass @@ -0,0 +1,123 @@ +def fixed_oe_import(d, modules=None): + import importlib + import sys + + def inject(name, value): + """Make a python object accessible from the metadata""" + if hasattr(bb.utils, "_context"): + bb.utils._context[name] = value + else: + __builtins__[name] = value + + bbpath = d.getVar("BBPATH").split(":") + layerpaths = [os.path.join(dir, "lib") for dir in bbpath] + sys.path[0:0] = layerpaths + + if modules is None: + import oe.data + modules = oe.data.typed_value("OE_IMPORTS", d) + + has_reloaded = set() + for toimport in modules: + # If we're importing something in a namespace package, and it's + # already been imported, reload it, to ensure any namespace package + # extensions to __path__ are picked up + imp_project = toimport + while True: + try: + imp_project, _ = imp_project.rsplit(".", 1) + except ValueError: + break + if imp_project in sys.modules and imp_project not in has_reloaded: + mod = sys.modules[imp_project] + if hasattr(mod, '__path__'): + bb.debug(1, 'Reloading %s' % imp_project) + importlib.reload(mod) + has_reloaded.add(imp_project) + + project = toimport.split(".", 1)[0] + imported = importlib.import_module(toimport) + sys.modules[toimport] = imported + inject(project, sys.modules[project]) + bb.debug(1, 'Imported and injected %s' % toimport) + + return "" + +EXTERNAL_IMPORTED := "${@fixed_oe_import(d, ['oe.external'])}" + +EXTERNAL_TOOLCHAIN_SYSROOT ?= "${@external_run(d, '${EXTERNAL_CC}', *(TARGET_CC_ARCH.split() + ['-print-sysroot'])).rstrip()}" +EXTERNAL_TOOLCHAIN_LIBROOT ?= "${@external_run(d, '${EXTERNAL_CC}', *(TARGET_CC_ARCH.split() + ['-print-file-name=crtbegin.o'])).rstrip().replace('/crtbegin.o', '')}" +EXTERNAL_HEADERS_MULTILIB_SUFFIX ?= "${@external_run(d, '${EXTERNAL_CC}', *(TARGET_CC_ARCH.split() + ['-print-sysroot-headers-suffix'])).rstrip()}" +EXTERNAL_LIBC_KERNEL_VERSION ?= "${@external_get_kernel_version(d, "${EXTERNAL_TOOLCHAIN_SYSROOT}${prefix}")}" + +EXTERNAL_INSTALL_SOURCE_PATHS = "\ + ${EXTERNAL_TOOLCHAIN_SYSROOT} \ + ${EXTERNAL_TOOLCHAIN}/${EXTERNAL_TARGET_SYS} \ + ${EXTERNAL_TOOLCHAIN_SYSROOT}/.. \ + ${EXTERNAL_TOOLCHAIN} \ + ${D} \ +" + +# Potential locations within the external toolchain sysroot +FILES_PREMIRRORS = "\ + ${bindir}/|/usr/${baselib}/bin/\n \ +" + +FILES_MIRRORS = "\ + ${base_libdir}/|/usr/${baselib}/\n \ + ${libexecdir}/|/usr/libexec/\n \ + ${libexecdir}/|/usr/${baselib}/${PN}\n \ + ${mandir}/|/usr/share/man/\n \ + ${mandir}/|/usr/man/\n \ + ${mandir}/|/man/\n \ + ${mandir}/|/share/doc/*-${EXTERNAL_TARGET_SYS}/man/\n \ + ${prefix}/|${base_prefix}/\n \ +" + +EXTERNAL_CC ?= "${EXTERNAL_TARGET_SYS}-gcc" + +# LAYERDIR_openeuler should never be included when generating the signatures +external_run[vardepsexclude] += "LAYERDIR_openeuler" + +def external_run(d, *args): + """Convenience wrapper""" + if (not d.getVar('TCMODE', True).startswith('external') or + not d.getVar('EXTERNAL_TOOLCHAIN', True)): + return 'UNKNOWN' + + sys.path.append(os.path.join(d.getVar('LAYERDIR_openeuler', True), 'lib')) + import oe.external + return oe.external.run(d, *args) + +def external_get_kernel_version(d, p): + if (not d.getVar('TCMODE', True).startswith('external') or + not d.getVar('EXTERNAL_TOOLCHAIN', True)): + return 'UNKNOWN' + + import re + for fn in ['include/linux/utsrelease.h', 'include/generated/utsrelease.h', + 'include/linux/version.h']: + fn = os.path.join(p, fn) + if os.path.exists(fn): + break + else: + return '' + + try: + f = open(fn) + except IOError: + pass + else: + with f: + lines = f.readlines() + + for line in lines: + m = re.match(r'#define LINUX_VERSION_CODE (\d+)$', line) + if m: + code = int(m.group(1)) + a = code >> 16 + b = (code >> 8) & 0xFF + return '%d.%d' % (a, b) + + bb.debug(1, 'external_global.bbclass: failed to find kernel version header in {}'.format(p)) + return '' diff --git a/meta-openeuler/classes/get_rpmdeps.bbclass b/meta-openeuler/classes/get_rpmdeps.bbclass deleted file mode 100644 index cd0328156424d419f12fc0d6f4d6ad1d78f861a2..0000000000000000000000000000000000000000 --- a/meta-openeuler/classes/get_rpmdeps.bbclass +++ /dev/null @@ -1,12 +0,0 @@ -python set_rpmdeps() { - import subprocess - rpmdeps = d.getVar('RPMDEPS', True) - if not rpmdeps or rpmdeps == "default": - rpmdeps = subprocess.Popen('rpm --eval="%{_rpmconfigdir}"', shell=True, stdout=subprocess.PIPE) - stdout, stderr = rpmdeps.communicate() - d.setVar('RPMDEPS', os.path.join(str(stdout, "utf-8").strip(), "rpmdeps")) - #bb.warn("xxxxxxxxxxxxxxxxxx xxxxRPMDEPS=%s"%d.getVar('RPMDEPS', True)) -} - -addhandler set_rpmdeps -set_rpmdeps[eventmask] = "bb.event.RecipePreFinalise" diff --git a/meta-openeuler/classes/image-live.bbclass b/meta-openeuler/classes/image-live.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..38b3c7f1c181d63d5fd84d6bdfadb5f442cb4b68 --- /dev/null +++ b/meta-openeuler/classes/image-live.bbclass @@ -0,0 +1,280 @@ +# Copyright (C) 2004, Advanced Micro Devices, Inc. All Rights Reserved +# Released under the MIT license (see packages/COPYING) + +# Creates a bootable image using syslinux, your kernel and an optional +# initrd + +# +# End result is two things: +# +# 1. A .hddimg file which is an msdos filesystem containing syslinux, a kernel, +# an initrd and a rootfs image. These can be written to harddisks directly and +# also booted on USB flash disks (write them there with dd). +# +# 2. A CD .iso image + +# Boot process is that the initrd will boot and process which label was selected +# in syslinux. Actions based on the label are then performed (e.g. installing to +# an hdd) + +# External variables (also used by syslinux.bbclass) +# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional) +# ${HDDIMG_ID} - FAT image volume-id +# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional) + +inherit live-vm-common image-artifact-names + +do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \ + mtools-native:do_populate_sysroot \ + cdrkit-native:do_populate_sysroot \ + virtual/kernel:do_deploy \ + ${@bb.utils.contains("MACHINE_FEATURES", "isohybrid", "syslinux-native:do_populate_sysroot", "", d)} \ + ${@'%s:do_image_%s' % (d.getVar('PN'), d.getVar('LIVE_ROOTFS_TYPE').replace('-', '_')) if d.getVar('ROOTFS') else ''} \ + " + +LABELS_LIVE ?= "boot install" +ROOT_LIVE ?= "root=/dev/ram0" +INITRD_IMAGE_LIVE ?= "${MLPREFIX}core-image-minimal-initramfs" +INITRD_LIVE ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}-${MACHINE}.${INITRAMFS_FSTYPES}" + +LIVE_ROOTFS_TYPE ?= "ext4" +ROOTFS ?= "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${LIVE_ROOTFS_TYPE}" + +IMAGE_TYPEDEP_live = "${LIVE_ROOTFS_TYPE}" +IMAGE_TYPEDEP_iso = "${LIVE_ROOTFS_TYPE}" +IMAGE_TYPEDEP_hddimg = "${LIVE_ROOTFS_TYPE}" +IMAGE_TYPES_MASKED += "live hddimg iso" + +python() { + image_b = d.getVar('IMAGE_BASENAME') + initrd_i = d.getVar('INITRD_IMAGE_LIVE') + if image_b == initrd_i: + bb.error('INITRD_IMAGE_LIVE %s cannot use image live, hddimg or iso.' % initrd_i) + bb.fatal('Check IMAGE_FSTYPES and INITRAMFS_FSTYPES settings.') + elif initrd_i: + d.appendVarFlag('do_bootimg', 'depends', ' %s:do_image_complete' % initrd_i) +} + +HDDDIR = "${S}/hddimg" +ISODIR = "${S}/iso" +EFIIMGDIR = "${S}/efi_img" +COMPACT_ISODIR = "${S}/iso.z" + +ISOLINUXDIR ?= "/isolinux" +ISO_BOOTIMG = "isolinux/isolinux.bin" +ISO_BOOTCAT = "isolinux/boot.cat" +MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table" + +# this options make iso support uppercase character. it is important to install process. +OPENEULER_MKISOFS_OPTIONS = "-R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -input-charset utf-8 " + +BOOTIMG_VOLUME_ID ?= "boot" +BOOTIMG_EXTRA_SPACE ?= "512" + +populate_live() { + populate_kernel $1 + # zImage is not support, when recive a zImage, replace with Image + # it should compact with DEPLOY_DIR_IMAGE/image in meta-openeuler/recipes-core/images/qemu.inc + if [ "${KERNEL_IMAGETYPE}" == "zImage" ];then + if [ -e ${DEPLOY_DIR_IMAGE}/Image* ]; then + install -m 0644 ${DEPLOY_DIR_IMAGE}/Image* $1/${KERNEL_IMAGETYPE} + else + bbfatal "unsupport zImage in grub cfg, should replace with ${DEPLOY_DIR_IMAGE}/Image* but not exists." + fi + fi + + if [ -s "${ROOTFS}" ]; then + install -m 0644 ${ROOTFS} $1/rootfs.img + fi +} + +build_iso() { + # Only create an ISO if we have an INITRD and the live or iso image type was selected + if [ -z "${INITRD}" ] || [ "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso', '1', '0', d)}" != "1" ]; then + bbnote "ISO image will not be created." + return + fi + # ${INITRD} is a list of multiple filesystem images + for fs in ${INITRD} + do + if [ ! -s "$fs" ]; then + bbwarn "ISO image will not be created. $fs is invalid." + return + fi + done + + populate_live ${ISODIR} + + if [ "${PCBIOS}" = "1" ]; then + syslinux_iso_populate ${ISODIR} + fi + if [ "${EFI}" = "1" ]; then + efi_iso_populate ${ISODIR} + build_fat_img ${EFIIMGDIR} ${ISODIR}/efi.img + fi + + # EFI only + if [ "${PCBIOS}" != "1" ] && [ "${EFI}" = "1" ] && [ "${@bb.utils.contains('MACHINE_FEATURES', 'isohybrid', '1', '0', d)}" = "1" ]; then + # Work around bug in isohybrid where it requires isolinux.bin + # In the boot catalog, even though it is not used + mkdir -p ${ISODIR}/${ISOLINUXDIR} + install -m 0644 ${STAGING_DATADIR_NATIVE}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR} + install -m 0644 ${STAGING_DATADIR_NATIVE}/syslinux/ldlinux.c32 ${ISODIR}${ISOLINUXDIR} + fi + + # We used to have support for zisofs; this is a relic of that + mkisofs_compress_opts="-r" + + # Check the size of ${ISODIR}/rootfs.img, use mkisofs -iso-level 3 + # when it exceeds 3.8GB, the specification is 4G - 1 bytes, we need + # leave a few space for other files. + mkisofs_iso_level="" + + if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then + rootfs_img_size=`stat -c '%s' ${ISODIR}/rootfs.img` + # 4080218931 = 3.8 * 1024 * 1024 * 1024 + if [ $rootfs_img_size -gt 4080218931 ]; then + bbnote "${ISODIR}/rootfs.img execeeds 3.8GB, using '-iso-level 3' for mkisofs" + mkisofs_iso_level="-iso-level 3" + fi + fi + + if [ "${PCBIOS}" = "1" ] && [ "${EFI}" != "1" ] ; then + # PCBIOS only media + mkisofs -V ${BOOTIMG_VOLUME_ID} \ + -o ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso \ + ${OPENEULER_MKISOFS_OPTIONS} \ + -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \ + $mkisofs_compress_opts \ + ${MKISOFS_OPTIONS} $mkisofs_iso_level ${ISODIR} + else + # EFI only OR EFI+PCBIOS + mkisofs -A ${BOOTIMG_VOLUME_ID} -V ${BOOTIMG_VOLUME_ID} \ + -o ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso \ + ${OPENEULER_MKISOFS_OPTIONS} \ + ${@bb.utils.contains("MACHINE_FEATURES", "isohybrid", "-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT}", "", d)} \ + ${@bb.utils.contains("MACHINE_FEATURES", "isohybrid", "$mkisofs_compress_opts ${MKISOFS_OPTIONS} $mkisofs_iso_level", "", d)} \ + ${@bb.utils.contains("MACHINE_FEATURES", "isohybrid", "-eltorito-alt-boot", "", d)} \ + ${@bb.utils.contains("MACHINE_FEATURES", "isohybrid", "-e efi.img", "-b efi.img", d)} -no-emul-boot \ + ${ISODIR} + isohybrid_args="-u" + fi + + if [ "${@bb.utils.contains('MACHINE_FEATURES', 'isohybrid', '1', '0', d)}" = "1" ]; then + isohybrid $isohybrid_args ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso + fi +} + +build_fat_img() { + FATSOURCEDIR=$1 + FATIMG=$2 + + # Calculate the size required for the final image including the + # data and filesystem overhead. + # Sectors: 512 bytes + # Blocks: 1024 bytes + + # Determine the sector count just for the data + SECTORS=$(expr $(du --apparent-size -ks ${FATSOURCEDIR} | cut -f 1) \* 2) + + # Account for the filesystem overhead. This includes directory + # entries in the clusters as well as the FAT itself. + # Assumptions: + # FAT32 (12 or 16 may be selected by mkdosfs, but the extra + # padding will be minimal on those smaller images and not + # worth the logic here to caclulate the smaller FAT sizes) + # < 16 entries per directory + # 8.3 filenames only + + # 32 bytes per dir entry + DIR_BYTES=$(expr $(find ${FATSOURCEDIR} | tail -n +2 | wc -l) \* 32) + # 32 bytes for every end-of-directory dir entry + DIR_BYTES=$(expr $DIR_BYTES + $(expr $(find ${FATSOURCEDIR} -type d | tail -n +2 | wc -l) \* 32)) + # 4 bytes per FAT entry per sector of data + FAT_BYTES=$(expr $SECTORS \* 4) + # 4 bytes per FAT entry per end-of-cluster list + FAT_BYTES=$(expr $FAT_BYTES + $(expr $(find ${FATSOURCEDIR} -type d | tail -n +2 | wc -l) \* 4)) + + # Use a ceiling function to determine FS overhead in sectors + DIR_SECTORS=$(expr $(expr $DIR_BYTES + 511) / 512) + # There are two FATs on the image + FAT_SECTORS=$(expr $(expr $(expr $FAT_BYTES + 511) / 512) \* 2) + SECTORS=$(expr $SECTORS + $(expr $DIR_SECTORS + $FAT_SECTORS)) + + # Determine the final size in blocks accounting for some padding + BLOCKS=$(expr $(expr $SECTORS / 2) + ${BOOTIMG_EXTRA_SPACE}) + + # mkdosfs will sometimes use FAT16 when it is not appropriate, + # resulting in a boot failure from SYSLINUX. Use FAT32 for + # images larger than 512MB, otherwise let mkdosfs decide. + if [ $(expr $BLOCKS / 1024) -gt 512 ]; then + FATSIZE="-F 32" + fi + + # mkdosfs will fail if ${FATIMG} exists. Since we are creating an + # new image, it is safe to delete any previous image. + if [ -e ${FATIMG} ]; then + rm ${FATIMG} + fi + + if [ -z "${HDDIMG_ID}" ]; then + mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} ${MKDOSFS_EXTRAOPTS} -C ${FATIMG} \ + ${BLOCKS} + else + mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} ${MKDOSFS_EXTRAOPTS} -C ${FATIMG} \ + ${BLOCKS} -i ${HDDIMG_ID} + fi + + # Copy FATSOURCEDIR recursively into the image file directly + mcopy -i ${FATIMG} -s ${FATSOURCEDIR}/* ::/ +} + +build_hddimg() { + # Create an HDD image + if [ "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live hddimg', '1', '0', d)}" = "1" ] ; then + populate_live ${HDDDIR} + + if [ "${PCBIOS}" = "1" ]; then + syslinux_hddimg_populate ${HDDDIR} + fi + if [ "${EFI}" = "1" ]; then + efi_hddimg_populate ${HDDDIR} + fi + + # Check the size of ${HDDDIR}/rootfs.img, error out if it + # exceeds 4GB, it is the single file's max size of FAT fs. + if [ -f ${HDDDIR}/rootfs.img ]; then + rootfs_img_size=`stat -c '%s' ${HDDDIR}/rootfs.img` + max_size=`expr 4 \* 1024 \* 1024 \* 1024` + if [ $rootfs_img_size -ge $max_size ]; then + bberror "${HDDDIR}/rootfs.img rootfs size is greather than or equal to 4GB," + bberror "and this doesn't work on a FAT filesystem. You can either:" + bberror "1) Reduce the size of rootfs.img, or," + bbfatal "2) Use wic, vmdk,vhd, vhdx or vdi instead of hddimg\n" + fi + fi + + build_fat_img ${HDDDIR} ${IMGDEPLOYDIR}/${IMAGE_NAME}.hddimg + + if [ "${PCBIOS}" = "1" ]; then + syslinux_hddimg_install + fi + + chmod 644 ${IMGDEPLOYDIR}/${IMAGE_NAME}.hddimg + fi +} + +python do_bootimg() { + set_live_vm_vars(d, 'LIVE') + if d.getVar("PCBIOS") == "1": + bb.build.exec_func('build_syslinux_cfg', d) + if d.getVar("EFI") == "1": + bb.build.exec_func('build_efi_cfg', d) + bb.build.exec_func('build_hddimg', d) + bb.build.exec_func('build_iso', d) + bb.build.exec_func('create_symlinks', d) +} +do_bootimg[subimages] = "hddimg iso" +do_bootimg[imgsuffix] = "." + +addtask bootimg before do_image_complete after do_rootfs diff --git a/meta-openeuler/classes/lopper-devicetree.bbclass b/meta-openeuler/classes/lopper-devicetree.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..fff1a0c4ee520d0cc1e947e6717cc2163916f08b --- /dev/null +++ b/meta-openeuler/classes/lopper-devicetree.bbclass @@ -0,0 +1,62 @@ +DEPENDS += "lopper-ops lopper-native" + +LOPS_DIR = "${WORKDIR}/recipe-sysroot/${libdir}/lops" + +# ${INPUT_DT} - input device tree(dts or dtb) +# ${OUTPUT_DT} - modified device tree(dts or dtb), normally a dtb for Linux +# Note: These two variables require absolute path +INPUT_DT = "" +OUTPUT_DT = "" + +# Output the device-trees (determined in lopper operation) to OUT_DIR +# These device-trees will be installed to SYSROOT_DIR/INSTALL_PATH +OUT_DIR = "${B}/lop_dts" +INSTALL_PATH = "/lop_dts" + +apply_lopper_ops() { + local args="" + + if [ ! -d "${LOPS_DIR}" ]; then + bbfatal_log "lopper-devicetree: No valid lopper-ops was found. No such directory: ${LOPS_DIR}" + fi + + for lops in "${LOPS_DIR}"/*; do + bbnote "lopper: apply ${lops}" + args+=" -i ${lops}" + done + echo ${args} +} + +# Takes an input device tree, applies lopper operations to that tree, +# and outputs one or more modified/processed trees to OUT_DIR. +do_mkdts() { + if [ ! -f "${INPUT_DT}" ]; then + bbfatal_log "lopper-devicetree: No such input file: ${INPUT_DT}" + fi + + local include_lops=$(apply_lopper_ops) + + mkdir -p ${OUT_DIR} + + lopper -v --werror --enhanced \ + ${include_lops} \ + -f -O ${OUT_DIR} \ + -o ${OUTPUT_DT} ${INPUT_DT} +} +addtask mkdts before do_install after do_compile + +SYSROOT_DIR += "${INSTALL_PATH}" +FILES_${PN} = "${INSTALL_PATH}/*.dts" + +# install the processed device tree to SYSROOT_DIR +# other recipes can get it in "${WORKDIR}/recipe-sysroot/lop_dts" +do_install_lop_dts() { + install -d ${D}${INSTALL_PATH} + + for dt in "${OUT_DIR}"/*.dts; do + bbnote "lopper: install ${dt}" + install ${dt} ${D}${INSTALL_PATH}/ + done +} +do_install_lop_dts[dirs] = "${OUT_DIR}" +addtask install_lop_dts after do_install before do_package do_populate_sysroot diff --git a/meta-openeuler/classes/meson.bbclass b/meta-openeuler/classes/meson.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..ea45fbd254e64a6c37af8b047bab48573ba12909 --- /dev/null +++ b/meta-openeuler/classes/meson.bbclass @@ -0,0 +1,195 @@ +# openeuler's meson.bbclass is almost the same as poky's meson.bbclass. There are two modification points: +# one is not to build python3-native, the other is to use pkg-config command instead of pkg-config-native +# command when building native package +# In the future, if the problem of NATIVE and NATIVESDK is fixed, openeuler's meson.bbclass can be removed + +inherit siteinfo python3native + +DEPENDS_append = " meson-native ninja-native" + +# Since the python3 package already exists in the nativesdk tool, +# there is no need to build python3-native when building in meson +DEPENDS_remove = "python3-native" + +# As Meson enforces out-of-tree builds we can just use cleandirs +B = "${WORKDIR}/build" +do_configure[cleandirs] = "${B}" + +# Where the meson.build build configuration is +MESON_SOURCEPATH = "${S}" + +def noprefix(var, d): + return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1) + +MESON_BUILDTYPE ?= "plain" +MESONOPTS = " --prefix ${prefix} \ + --buildtype ${MESON_BUILDTYPE} \ + --bindir ${@noprefix('bindir', d)} \ + --sbindir ${@noprefix('sbindir', d)} \ + --datadir ${@noprefix('datadir', d)} \ + --libdir ${@noprefix('libdir', d)} \ + --libexecdir ${@noprefix('libexecdir', d)} \ + --includedir ${@noprefix('includedir', d)} \ + --mandir ${@noprefix('mandir', d)} \ + --infodir ${@noprefix('infodir', d)} \ + --sysconfdir ${sysconfdir} \ + --localstatedir ${localstatedir} \ + --sharedstatedir ${sharedstatedir} \ + --wrap-mode nodownload \ + --native-file ${WORKDIR}/meson.native" + +EXTRA_OEMESON_append = " ${PACKAGECONFIG_CONFARGS}" + +MESON_CROSS_FILE = "" +MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross" +MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross" + +def meson_array(var, d): + items = d.getVar(var).split() + return repr(items[0] if len(items) == 1 else items) + +# Map our ARCH values to what Meson expects: +# http://mesonbuild.com/Reference-tables.html#cpu-families +def meson_cpu_family(var, d): + import re + arch = d.getVar(var) + if arch == 'powerpc': + return 'ppc' + elif arch == 'powerpc64' or arch == 'powerpc64le': + return 'ppc64' + elif arch == 'armeb': + return 'arm' + elif arch == 'aarch64_be': + return 'aarch64' + elif arch == 'mipsel': + return 'mips' + elif arch == 'mips64el': + return 'mips64' + elif re.match(r"i[3-6]86", arch): + return "x86" + elif arch == "microblazeel": + return "microblaze" + else: + return arch + +# Map our OS values to what Meson expects: +# https://mesonbuild.com/Reference-tables.html#operating-system-names +def meson_operating_system(var, d): + os = d.getVar(var) + if "mingw" in os: + return "windows" + # avoid e.g 'linux-gnueabi' + elif "linux" in os: + return "linux" + else: + return os + +def meson_endian(prefix, d): + arch, os = d.getVar(prefix + "_ARCH"), d.getVar(prefix + "_OS") + sitedata = siteinfo_data_for_machine(arch, os, d) + if "endian-little" in sitedata: + return "little" + elif "endian-big" in sitedata: + return "big" + else: + bb.fatal("Cannot determine endianism for %s-%s" % (arch, os)) + +addtask write_config before do_configure +do_write_config[vardeps] += "CC CXX LD AR NM STRIP READELF CFLAGS CXXFLAGS LDFLAGS" + +# this is a workaround, meson.native: pkgconfig = 'pkg-config-native' -> pkgconfig = 'pkg-config' +do_write_config() { + # This needs to be Py to split the args into single-element lists + cat >${WORKDIR}/meson.cross <${WORKDIR}/meson.native < +# EXTERNAL_TOOLCHAIN with the following format: +# # openeuler_gcc_arm64le # openeuler_gcc_arm32le" -OPENEULER_TOOLCHAIN_DIR_aarch64 = "/usr1/openeuler/gcc/openeuler_gcc_arm64le" -OPENEULER_TOOLCHAIN_DIR_arm = "/usr1/openeuler/gcc/openeuler_gcc_arm32le" +EXTERNAL_TOOLCHAIN_arm = "/usr1/openeuler/gcc/openeuler_gcc_arm32le" +EXTERNAL_TOOLCHAIN_aarch64 = "/usr1/openeuler/gcc/openeuler_gcc_arm64le" +EXTERNAL_TOOLCHAIN_x86-64 = "/usr1/openeuler/gcc/openeuler_gcc_x86_64" +EXTERNAL_TOOLCHAIN_riscv64 = "/usr1/openeuler/gcc/openeuler_gcc_riscv64" +EXTERNAL_TARGET_SYS_arm = "arm-openeuler-linux-gnueabi" +EXTERNAL_TARGET_SYS_aarch64 = "aarch64-openeuler-linux-gnu" +EXTERNAL_TARGET_SYS_x86-64 = "x86_64-openeuler-linux-gnu" +EXTERNAL_TARGET_SYS_riscv64 = "riscv64-openeuler-linux-gnu" # default openeuler platform OPENEULER_PLATFORM = "aarch64-std" @@ -360,3 +317,16 @@ MACHINEOVERRIDES =. "${OPENEULER_PLATFORM}:" # add openeuler security flags require conf/distro/include/security_flags.inc require conf/distro/include/security_flags_openeuler.inc + +# OE-built toolchains assume en_US is utf8 +EXTERNAL_TOOLCHAIN_FEATURES_DEFAULT = "locale-utf8-is-default" + +# define root home, default /home/root +ROOT_HOME ?= "/root" + +# define default init and device manager +OPENEULER_INIT_MANAGER = "mdev-busybox" +OPENEULER_DEV_MANAGER = "busybox-mdev" + +# set default kernel provider +PREFERRED_PROVIDER_virtual/kernel = "linux-openeuler" diff --git a/meta-openeuler/conf/machine/generic-x86-64.conf b/meta-openeuler/conf/machine/generic-x86-64.conf new file mode 100644 index 0000000000000000000000000000000000000000..6e57c2c98383b7f1bbe16a41900cb13dc5faae27 --- /dev/null +++ b/meta-openeuler/conf/machine/generic-x86-64.conf @@ -0,0 +1,29 @@ +#@TYPE: Machine +#@NAME: x86-64 machine +#@DESCRIPTION: Machine configuration for running an x86-64 system + +DEFAULTTUNE ?= "x86-64" +require conf/machine/include/x86/arch-x86.inc + +KERNEL_IMAGETYPE =. "bzImage" +KERNEL_IMAGETYPE_FOR_MAKE =. "bzImage" + +MACHINE_FEATURES += "x86 efi" + +# kernel modules to install and autoload +require conf/machine/include/kernel-modules-conf/iso-install.inc +require conf/machine/include/kernel-modules-conf/x86-64-modules.inc +KERNEL_MODULE_AUTOLOAD = "${INSTALLMODULES}" + +# specify the suffix of packages for installation of rootfs +export ROOTFS_PACKAGE_ARCH = "x86_64" + +# simplest serial console setting, no VT +SERIAL_CONSOLES ?= "115200;ttyS0 115200;tty0" +USE_VT="0" + +# cmdline +APPEND += "console=ttyS0,115200 console=tty0" + +# set hostname to openEuler-Embedded +hostname_pn-base-files = "openEuler-Embedded" diff --git a/meta-openeuler/conf/machine/include/kernel-modules-conf/common.inc b/meta-openeuler/conf/machine/include/kernel-modules-conf/common.inc new file mode 100644 index 0000000000000000000000000000000000000000..c46165e17cd0c27f0d2c105076f64319d995236d --- /dev/null +++ b/meta-openeuler/conf/machine/include/kernel-modules-conf/common.inc @@ -0,0 +1,40 @@ +INSTALLMODULES = " \ +kernel-module-overlay \ +kernel-module-8021q \ +kernel-module-ext2 \ +kernel-module-inet-diag \ +kernel-module-ip-tables \ +kernel-module-ip-tunnel \ +kernel-module-ip6-tables \ +kernel-module-ip6-udp-tunnel \ +kernel-module-ip6table-filter \ +kernel-module-ipip \ +kernel-module-ipt-reject \ +kernel-module-iptable-filter \ +kernel-module-ipv6 \ +kernel-module-nf-conntrack \ +kernel-module-nf-defrag-ipv4 \ +kernel-module-nf-defrag-ipv6 \ +kernel-module-nf-nat \ +kernel-module-nf-reject-ipv4 \ +kernel-module-nf-reject-ipv6 \ +kernel-module-x-tables \ +kernel-module-xt-tcpudp \ +kernel-module-tunnel4 \ +kernel-module-af-packet \ +kernel-module-nfs-ssc \ +kernel-module-fscache \ +kernel-module-grace \ +kernel-module-sunrpc \ +kernel-module-auth-rpcgss \ +kernel-module-lockd \ +kernel-module-nfs-acl \ +kernel-module-nfs \ +kernel-module-nfsv3 \ +kernel-module-nfsd \ +kernel-module-crc-ccitt \ +kernel-module-iptable-nat \ +kernel-module-ip6table-nat \ +kernel-module-ip6t-reject \ +kernel-module-xt-nat \ +" diff --git a/meta-openeuler/conf/machine/include/kernel-modules-conf/iso-install.inc b/meta-openeuler/conf/machine/include/kernel-modules-conf/iso-install.inc new file mode 100644 index 0000000000000000000000000000000000000000..73728d12dcf61abf69fc19befa2f671db78a0462 --- /dev/null +++ b/meta-openeuler/conf/machine/include/kernel-modules-conf/iso-install.inc @@ -0,0 +1,10 @@ +# Notice: we need CONFIG_VIRTIO_BLK=y CONFIG_EXT4_FS=y for vda ext4 filesystem to setup. +# For x86-64, also relies on CONFIG_ATA_PIIX=y CONFIG_BLK_DEV_SD=y + +INSTALLMODULES =+ " \ +kernel-module-cdrom \ +kernel-module-sr-mod \ +kernel-module-isofs \ +kernel-module-msdos \ +kernel-module-virtiofs \ +" diff --git a/meta-openeuler/conf/machine/include/kernel-modules-conf/x86-64-modules.inc b/meta-openeuler/conf/machine/include/kernel-modules-conf/x86-64-modules.inc new file mode 100644 index 0000000000000000000000000000000000000000..01d02b905d2bb3d03c87956201246648bef5d2e3 --- /dev/null +++ b/meta-openeuler/conf/machine/include/kernel-modules-conf/x86-64-modules.inc @@ -0,0 +1,32 @@ +INSTALLMODULES += " \ +kernel-module-ipv6 \ +kernel-module-ip6table-filter \ +kernel-module-ip6table-mangle \ +kernel-module-ip6table-raw \ +kernel-module-iptable-filter \ +kernel-module-iptable-mangle \ +kernel-module-iptable-raw \ +kernel-module-ipt-reject \ +kernel-module-sg \ +kernel-module-joydev \ +kernel-module-pcspkr \ +kernel-module-fuse \ +kernel-module-sr-mod \ +kernel-module-ata-generic \ +kernel-module-igb \ +kernel-module-chipreg \ +kernel-module-mtdblock \ +kernel-module-nfsd \ +kernel-module-xhci-plat-hcd \ +kernel-module-vfat \ +kernel-module-quota-v1 \ +kernel-module-quota-v2 \ +kernel-module-virtio-net \ +kernel-module-virtio-balloon \ +kernel-module-virtio-console \ +kernel-module-virtio-gpu \ +kernel-module-ixgbe \ +kernel-module-i40e \ +kernel-module-e1000e \ +kernel-module-r8169 \ +" diff --git a/meta-openeuler/conf/machine/qemu-aarch64-common.inc b/meta-openeuler/conf/machine/include/qemu-aarch64-common.inc similarity index 59% rename from meta-openeuler/conf/machine/qemu-aarch64-common.inc rename to meta-openeuler/conf/machine/include/qemu-aarch64-common.inc index dd032e0c6df4b6ef31bb96c1462eca286408f038..279001bd4842db191c1f01fbd0cca2d019cb6aa8 100644 --- a/meta-openeuler/conf/machine/qemu-aarch64-common.inc +++ b/meta-openeuler/conf/machine/include/qemu-aarch64-common.inc @@ -1,7 +1,14 @@ # Description: Config for arm64 machine MACHINEOVERRIDES =. "march64:" -require conf/machine/qemu-common.inc +KERNEL_IMAGETYPE =. "zImage" +KERNEL_IMAGETYPE_FOR_MAKE =. "zImage Image" +require conf/machine/include/qemu-common.inc + +#kernel modules to install and autoload +require conf/machine/include/kernel-modules-conf/common.inc +require conf/machine/include/kernel-modules-conf/iso-install.inc +KERNEL_MODULE_AUTOLOAD = "${INSTALLMODULES}" # Different from arm32, here we use armv8a.inc instead # of conf/machine/include/tune-cortexa53.inc because @@ -9,8 +16,8 @@ require conf/machine/qemu-common.inc require conf/machine/include/arm/arch-armv8a.inc # but we are sure in compat32 we should use -mcpu=cortexa9. -# This is may not correct, but to make sure compat32 and arm32 -# give same binary. +# This may be not correct, but to make sure compat32 and arm32 +# generate the same binary. # Should not use conf/machine/include/tune-cortexa9.inc directly. # In case when using compat32, we alert cflags with same way in tune-cortexa9.inc @@ -21,3 +28,9 @@ MACHINEOVERRIDES_remove_virtclass-multilib-lib32 =. "march64:" MACHINEOVERRIDES_append_virtclass-multilib-lib32 =. "march32:" TUNE_FEATURES_append_virtclass-multilib-lib32 += " cortexa9" TUNE_FEATURES_remove_virtclass-multilib-lib32 += " vfp" + +# simplest serial console setting, no VT +SERIAL_CONSOLES ?= "115200;ttyAMA0" +USE_VT ?= "0" +# make a APPEND cmdline for grub.cfg while using iso with grub +APPEND += " console=ttyAMA0,115200 " diff --git a/meta-openeuler/conf/machine/qemu-arm-common.inc b/meta-openeuler/conf/machine/include/qemu-arm-common.inc similarity index 32% rename from meta-openeuler/conf/machine/qemu-arm-common.inc rename to meta-openeuler/conf/machine/include/qemu-arm-common.inc index 41e617d0b25323c71bbaed064ae4b1668da784b9..f3ff60c41ca2023b4880f9989f61926efeee1911 100644 --- a/meta-openeuler/conf/machine/qemu-arm-common.inc +++ b/meta-openeuler/conf/machine/include/qemu-arm-common.inc @@ -1,10 +1,21 @@ -# Description: Conf for arm +# Description: Machine description for little-endian arm32 MACHINEOVERRIDES =. "march32:" -require conf/machine/qemu-common.inc +require conf/machine/include/qemu-common.inc require conf/machine/include/arm/arch-armv7a.inc +#kernel modules to install and autoload +require conf/machine/include/kernel-modules-conf/common.inc +INSTALLMODULES += " \ +kernel-module-unix \ +" +KERNEL_MODULE_AUTOLOAD = "${INSTALLMODULES}" + TUNE_FEATURES_append += " cortexa9" TUNE_FEATURES_remove += " vfp" TUNE_CCARGS .= " -mno-unaligned-access" + +# simplest serial console setting, no VT +SERIAL_CONSOLES ?= "115200;ttyAMA0" +USE_VT ?= "0" diff --git a/meta-openeuler/conf/machine/qemu-common.inc b/meta-openeuler/conf/machine/include/qemu-common.inc similarity index 100% rename from meta-openeuler/conf/machine/qemu-common.inc rename to meta-openeuler/conf/machine/include/qemu-common.inc diff --git a/meta-openeuler/conf/machine/qemu-aarch64.conf b/meta-openeuler/conf/machine/qemu-aarch64.conf index 9abe74de24c507c1d93a071c5fe44006e990361f..7694f85817dbfe65c7ae989081ca0d209ca143a0 100644 --- a/meta-openeuler/conf/machine/qemu-aarch64.conf +++ b/meta-openeuler/conf/machine/qemu-aarch64.conf @@ -1,8 +1,9 @@ # Description: Machine description for little-endian aarch64 +MACHINE_FEATURES += "efi" MACHINEOVERRIDES =. "march64le:" DEFAULTTUNE = "aarch64" -require conf/machine/qemu-aarch64-common.inc +require conf/machine/include/qemu-aarch64-common.inc # arm and arm64 both support -mlittle-endian so no # need to consider compat32. diff --git a/meta-openeuler/conf/machine/qemu-aarch64_be.conf b/meta-openeuler/conf/machine/qemu-aarch64_be.conf deleted file mode 100644 index 40cbfc2f9e04489694f9fd50124e8bb9cf8399e4..0000000000000000000000000000000000000000 --- a/meta-openeuler/conf/machine/qemu-aarch64_be.conf +++ /dev/null @@ -1,21 +0,0 @@ -# Description: Machine description for little-endian aarch64 - -MACHINEOVERRIDES =. "march64be:bigendian:" -DEFAULTTUNE = "aarch64_be" -require conf/machine/qemu-aarch64-common.inc - -# See comments in qemu-aarch64.conf. No need -# to consider compat32 for -mbig-endian. -TUNE_CCARGS .= " -mbig-endian" - -COMPAT32_MACHINEOVERRIDES_DEL =. "march64be:" -COMPAT32_MACHINEOVERRIDES_ADD =. "march32be:" -COMPAT32_DEFAULTTUNE = "armv7ab" - -# See conf/machine/qemu-arm_be.conf -PACKAGE_EXTRA_ARCHS_tune-armv7ab += " armv7ab" -COMPAT32_PACKAGE_EXTRA_ARCHS = "armv7ab" - -COMPAT32_QA_REMOVE += "arch" - -COMPAT32_TUNE_FEATURES_APPEND += " rruarm" diff --git a/meta-openeuler/conf/machine/qemu-arm.conf b/meta-openeuler/conf/machine/qemu-arm.conf index 0b66963006d056c63dbe422dedaf95c4868304c5..39cd2eff344a7a0afbc33bf7b669517ae290e7ca 100644 --- a/meta-openeuler/conf/machine/qemu-arm.conf +++ b/meta-openeuler/conf/machine/qemu-arm.conf @@ -2,7 +2,7 @@ MACHINEOVERRIDES =. "march32le:" DEFAULTTUNE = "armv7a" -require conf/machine/qemu-arm-common.inc +require conf/machine/include/qemu-arm-common.inc TUNE_CCARGS .= " -mlittle-endian" export ROOTFS_PACKAGE_ARCH = "armv7l" diff --git a/meta-openeuler/conf/machine/qemu-arm_be.conf b/meta-openeuler/conf/machine/qemu-arm_be.conf deleted file mode 100644 index 88149b3d3ccb9676c5e934af4f7d775c7240de3d..0000000000000000000000000000000000000000 --- a/meta-openeuler/conf/machine/qemu-arm_be.conf +++ /dev/null @@ -1,15 +0,0 @@ -# Description: Machine description for little-endian aarch64 - -MACHINEOVERRIDES =. "march32be:bigendian:" -DEFAULTTUNE = "armv7ab" -require conf/machine/qemu-arm-common.inc - -# A bug in yocto misses armv7ab in -# PACKAGE_EXTRA_ARCHS_tune-armv7ab (but armv7ab-vfp is there). -PACKAGE_EXTRA_ARCHS_tune-armv7ab += " armv7ab" -TUNE_CCARGS .= " -mbig-endian" - -TUNE_FEATURES_append += ' rruarm' - -ERROR_QA_remove += 'arch' -WARN_QA_remove += 'arch' diff --git a/meta-openeuler/conf/machine/qemu-riscv64.conf b/meta-openeuler/conf/machine/qemu-riscv64.conf new file mode 100644 index 0000000000000000000000000000000000000000..30e3b2d41046985cca3d4799f2be05bbad0b2eaf --- /dev/null +++ b/meta-openeuler/conf/machine/qemu-riscv64.conf @@ -0,0 +1,20 @@ +# Description: Config for riscv64 machine + +MACHINEOVERRIDES =. "mriscv64:" +DEFAULTTUNE = "riscv64" + +export ROOTFS_PACKAGE_ARCH = "riscv64" + +require conf/machine/include/qemu-common.inc +KERNEL_IMAGETYPE = "Image" +KERNEL_IMAGETYPE_FOR_MAKE = "Image" + +require conf/machine/include/riscv/tune-riscv.inc +BASE_LIB_tune-riscv64 = "lib64/lp64d" + +require conf/multilib.conf +MULTILIBS ?= "" + +# simplest serial console setting, no VT +SERIAL_CONSOLES ?= "115200;ttyS0" +USE_VT="0" diff --git a/meta-openeuler/conf/openeuler-ros-distro-recipe-blacklist.inc b/meta-openeuler/conf/openeuler-ros-distro-recipe-blacklist.inc new file mode 100644 index 0000000000000000000000000000000000000000..75a1202081072b495d381bcae695620c0c832032 --- /dev/null +++ b/meta-openeuler/conf/openeuler-ros-distro-recipe-blacklist.inc @@ -0,0 +1,7 @@ +# remove from blacklist for runtime decouple +PNBLACKLIST[navigation2] = "" +PNBLACKLIST[nav2-bringup] = "" +PNBLACKLIST[slam-toolbox] = "" + +# current oe's tbb version is too new for ros-foxy +PREFERRED_VERSION_tbb = "2020.3" diff --git a/meta-openeuler/conf/templateconf.cfg b/meta-openeuler/conf/templateconf.cfg deleted file mode 100644 index 7480a55b98705ae1376833b410765eaad11476be..0000000000000000000000000000000000000000 --- a/meta-openeuler/conf/templateconf.cfg +++ /dev/null @@ -1 +0,0 @@ -meta-poky/conf diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-connectivity/dhcp/dhcp_%.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-connectivity/dhcp/dhcp_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e837b47046d7a2f73a54e62cbeb35cb43746e85b --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-connectivity/dhcp/dhcp_%.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +# fix segmentfault error when compiling with clang +SRC_URI:append = " \ + file://remove-asprintf-declaration-for-clang-build.patch \ +" + +CFLAGS:append = " -DHAVE_ASPRINTF " diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-connectivity/dhcp/files/remove-asprintf-declaration-for-clang-build.patch b/meta-openeuler/dynamic-layers/clang-layer/recipes-connectivity/dhcp/files/remove-asprintf-declaration-for-clang-build.patch new file mode 100644 index 0000000000000000000000000000000000000000..2a4dbdefdb066dfd082ca249eccc81b8e368e99c --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-connectivity/dhcp/files/remove-asprintf-declaration-for-clang-build.patch @@ -0,0 +1,26 @@ +From 3dbbfba1181b69588a544f782e3102d5626a7422 Mon Sep 17 00:00:00 2001 +From: Yunfei Li +Date: Fri, 4 Nov 2022 06:50:50 +0000 +Subject: [PATCH] remove asprintf declaration for clang build + +--- + client/dhclient.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/client/dhclient.c b/client/dhclient.c +index 3b79bd1..cedb19f 100644 +--- a/client/dhclient.c ++++ b/client/dhclient.c +@@ -49,7 +49,9 @@ + * Defined in stdio.h when _GNU_SOURCE is set, but we don't want to define + * that when building ISC code. + */ ++#ifndef HAVE_ASPRINTF + extern int asprintf(char **strp, const char *fmt, ...); ++#endif + + TIME default_lease_time = 43200; /* 12 hours... */ + TIME max_lease_time = 86400; /* 24 hours... */ +-- +2.31.1 + diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-connectivity/nfs-utils/nfs-utils_%.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-connectivity/nfs-utils/nfs-utils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..67f30f8e7e02d26bde0230d406fed96889f23c0d --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-connectivity/nfs-utils/nfs-utils_%.bbappend @@ -0,0 +1 @@ +CFLAGS:append = " -Wno-error=strict-prototypes -Wno-error=logical-not-parentheses " diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/busybox_%.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/busybox_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d2a69fa42be312fbcc1afba36fc50a8f9086fbfc --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/busybox_%.bbappend @@ -0,0 +1,13 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +# fix segmentfault error when compiling with clang +SRC_URI:append = " \ + file://0001-Make-const-ptr-assign-as-function-call-in-clang.patch \ +" + +# fix segmentfault error in raspberrypi +SRC_URI:append:raspberrypi4-64 = " \ + file://0001-apply-const-trick-to-ptr_to_globals.patch \ +" + +CFLAGS:append:raspberrypi4-64 = " -DBB_GLOBAL_CONST='' " diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/files/0001-Make-const-ptr-assign-as-function-call-in-clang.patch b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/files/0001-Make-const-ptr-assign-as-function-call-in-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..19d232a798505c32f54d3e7b59d60226b1e991a8 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/files/0001-Make-const-ptr-assign-as-function-call-in-clang.patch @@ -0,0 +1,178 @@ +From 5156b245536ce0f07165793f07c63fd9fa5dd3b7 Mon Sep 17 00:00:00 2001 +From: YU Jincheng +Date: Sun, 10 Oct 2021 02:19:51 +0800 +Subject: [PATCH] Make const ptr assign as function call in clang + +- This can act as memory barrier in clang to avoid + read before assign of a const ptr + +Signed-off-by: LoveSy +Signed-off-by: Denys Vlasenko +--- + coreutils/test.c | 2 +- + include/libbb.h | 21 +++++++++++++++------ + libbb/Kbuild.src | 1 + + libbb/appletlib.c | 2 +- + libbb/const_hack.c | 16 ++++++++++++++++ + libbb/lineedit.c | 2 +- + shell/ash.c | 6 +++--- + 7 files changed, 38 insertions(+), 12 deletions(-) + create mode 100644 libbb/const_hack.c + +diff --git a/coreutils/test.c b/coreutils/test.c +index fc956724b..a914c7490 100644 +--- a/coreutils/test.c ++++ b/coreutils/test.c +@@ -446,7 +446,7 @@ extern struct test_statics *BB_GLOBAL_CONST test_ptr_to_statics; + #define leaving (S.leaving ) + + #define INIT_S() do { \ +- ASSIGN_CONST_PTR(test_ptr_to_statics, xzalloc(sizeof(S))); \ ++ XZALLOC_CONST_PTR(&test_ptr_to_statics, sizeof(S)); \ + } while (0) + #define DEINIT_S() do { \ + free(group_array); \ +diff --git a/include/libbb.h b/include/libbb.h +index 296417dae..a340f27d2 100644 +--- a/include/libbb.h ++++ b/include/libbb.h +@@ -2280,6 +2280,7 @@ extern const char bb_PATH_root_path[] ALIGN1; /* BB_PATH_ROOT_PATH */ + extern const int const_int_0; + //extern const int const_int_1; + ++ + /* This struct is deliberately not defined. */ + /* See docs/keep_data_small.txt */ + struct globals; +@@ -2304,23 +2305,31 @@ static ALWAYS_INLINE void* not_const_pp(const void *p) + ); + return pp; + } ++# define ASSIGN_CONST_PTR(pptr, v) do { \ ++ *(void**)not_const_pp(pptr) = (void*)(v); \ ++ barrier(); \ ++} while (0) ++/* XZALLOC_CONST_PTR() is an out-of-line function to prevent ++ * clang from reading pointer before it is assigned. ++ */ ++void XZALLOC_CONST_PTR(const void *pptr, size_t size) FAST_FUNC; + #else +-static ALWAYS_INLINE void* not_const_pp(const void *p) { return (void*)p; } +-#endif +- +-#define ASSIGN_CONST_PTR(p, v) do { \ +- *(void**)not_const_pp(&p) = (void*)(v); \ ++# define ASSIGN_CONST_PTR(pptr, v) do { \ ++ *(void**)(pptr) = (void*)(v); \ + /* At least gcc 3.4.6 on mipsel needs optimization barrier */ \ + barrier(); \ + } while (0) ++# define XZALLOC_CONST_PTR(pptr, size) ASSIGN_CONST_PTR(pptr, xzalloc(size)) ++#endif + +-#define SET_PTR_TO_GLOBALS(x) ASSIGN_CONST_PTR(ptr_to_globals, x) ++#define SET_PTR_TO_GLOBALS(x) ASSIGN_CONST_PTR(&ptr_to_globals, x) + #define FREE_PTR_TO_GLOBALS() do { \ + if (ENABLE_FEATURE_CLEAN_UP) { \ + free(ptr_to_globals); \ + } \ + } while (0) + ++ + /* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it, + * use bb_default_login_shell and following defines. + * If you change LIBBB_DEFAULT_LOGIN_SHELL, +diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src +index 676300801..2fa239857 100644 +--- a/libbb/Kbuild.src ++++ b/libbb/Kbuild.src +@@ -24,6 +24,7 @@ lib-y += chomp.o + lib-y += compare_string_array.o + lib-y += concat_path_file.o + lib-y += concat_subpath_file.o ++lib-y += const_hack.o + lib-y += copy_file.o + lib-y += copyfd.o + lib-y += crc32.o +diff --git a/libbb/appletlib.c b/libbb/appletlib.c +index bf26c99e9..e8c308467 100644 +--- a/libbb/appletlib.c ++++ b/libbb/appletlib.c +@@ -247,7 +247,7 @@ void lbb_prepare(const char *applet + IF_FEATURE_INDIVIDUAL(, char **argv)) + { + #ifdef bb_cached_errno_ptr +- ASSIGN_CONST_PTR(bb_errno, get_perrno()); ++ ASSIGN_CONST_PTR(&bb_errno, get_perrno()); + #endif + applet_name = applet; + +diff --git a/libbb/const_hack.c b/libbb/const_hack.c +new file mode 100644 +index 000000000..9575e6d67 +--- /dev/null ++++ b/libbb/const_hack.c +@@ -0,0 +1,16 @@ ++/* vi: set sw=4 ts=4: */ ++/* ++ * Trick to assign a const ptr with barrier for clang ++ * ++ * Copyright (C) 2021 by YU Jincheng ++ * ++ * Licensed under GPLv2 or later, see file LICENSE in this source tree. ++ */ ++#include "libbb.h" ++ ++#if defined(__clang_major__) && __clang_major__ >= 9 ++void FAST_FUNC XZALLOC_CONST_PTR(const void *pptr, size_t size) ++{ ++ ASSIGN_CONST_PTR(pptr, xzalloc(size)); ++} ++#endif +diff --git a/libbb/lineedit.c b/libbb/lineedit.c +index 3c87abcf9..9960448ec 100644 +--- a/libbb/lineedit.c ++++ b/libbb/lineedit.c +@@ -214,7 +214,7 @@ extern struct lineedit_statics *BB_GLOBAL_CONST lineedit_ptr_to_statics; + #define delbuf (S.delbuf ) + + #define INIT_S() do { \ +- ASSIGN_CONST_PTR(lineedit_ptr_to_statics, xzalloc(sizeof(S))); \ ++ XZALLOC_CONST_PTR(&lineedit_ptr_to_statics, sizeof(S)); \ + } while (0) + + static void deinit_S(void) +diff --git a/shell/ash.c b/shell/ash.c +index 199975191..2d3cc8a61 100644 +--- a/shell/ash.c ++++ b/shell/ash.c +@@ -504,7 +504,7 @@ extern struct globals_misc *BB_GLOBAL_CONST ash_ptr_to_globals_misc; + #define random_gen (G_misc.random_gen ) + #define backgndpid (G_misc.backgndpid ) + #define INIT_G_misc() do { \ +- ASSIGN_CONST_PTR(ash_ptr_to_globals_misc, xzalloc(sizeof(G_misc))); \ ++ XZALLOC_CONST_PTR(&ash_ptr_to_globals_misc, sizeof(G_misc)); \ + savestatus = -1; \ + curdir = nullstr; \ + physdir = nullstr; \ +@@ -1582,7 +1582,7 @@ extern struct globals_memstack *BB_GLOBAL_CONST ash_ptr_to_globals_memstack; + #define g_stacknleft (G_memstack.g_stacknleft) + #define stackbase (G_memstack.stackbase ) + #define INIT_G_memstack() do { \ +- ASSIGN_CONST_PTR(ash_ptr_to_globals_memstack, xzalloc(sizeof(G_memstack))); \ ++ XZALLOC_CONST_PTR(&ash_ptr_to_globals_memstack, sizeof(G_memstack)); \ + g_stackp = &stackbase; \ + g_stacknxt = stackbase.space; \ + g_stacknleft = MINSIZE; \ +@@ -2213,7 +2213,7 @@ extern struct globals_var *BB_GLOBAL_CONST ash_ptr_to_globals_var; + #endif + #define INIT_G_var() do { \ + unsigned i; \ +- ASSIGN_CONST_PTR(ash_ptr_to_globals_var, xzalloc(sizeof(G_var))); \ ++ XZALLOC_CONST_PTR(&ash_ptr_to_globals_var, sizeof(G_var)); \ + for (i = 0; i < ARRAY_SIZE(varinit_data); i++) { \ + varinit[i].flags = varinit_data[i].flags; \ + varinit[i].var_text = varinit_data[i].var_text; \ +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/files/0001-apply-const-trick-to-ptr_to_globals.patch b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/files/0001-apply-const-trick-to-ptr_to_globals.patch new file mode 100644 index 0000000000000000000000000000000000000000..84b61a248ebfa042c4470a1697352acd21967929 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/files/0001-apply-const-trick-to-ptr_to_globals.patch @@ -0,0 +1,48 @@ +From d3fbf09787b9dd8a061b541cd931ffbf63e4d610 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 12 Jan 2022 10:48:36 -0800 +Subject: [PATCH] apply const trick to ptr_to_globals + +This was missing in the previous attempt to fix it via [1] + +This helps fix segfaults when compiling with clang ( seen on riscv64 ) + +[ 452.428349] less[270]: unhandled signal 11 code 0x1 at 0x000000000000000c in busybox.nosuid[2ab7491000+ba000] +[ 452.430246] CPU: 3 PID: 270 Comm: less Not tainted 5.15.13-yocto-standard #1 +[ 452.431323] Hardware name: riscv-virtio,qemu (DT) +[ 452.431925] epc : 0000002ab74a19ee ra : 0000002ab74a19dc sp : 0000003fec6ec980 +[ 452.432725] gp : 0000002ab754dcb0 tp : 0000003f88783800 t0 : 0000003f8878d4a0 +[ 452.433744] t1 : 0000002ab749b00c t2 : 0000000000000000 s0 : 0000003fec6ecc38 +[ 452.434732] s1 : 000000000000004c a0 : 00000000ffffffff a1 : 0000002ab754dde0 +[ 452.435861] a2 : 0000000000000000 a3 : 0000000000000100 a4 : 0000002ab754f3a0 +[ 452.436787] a5 : 0000002ab754f3a0 a6 : 0000000000000000 a7 : 0000002ab754f2a0 +[ 452.437974] s2 : 0000000000000002 s3 : 0000002ab754b6c8 s4 : 0000002ab749b60e +[ 452.438781] s5 : 0000000000000000 s6 : 0000002ab754b6c8 s7 : 0000003f88943060 +[ 452.439723] s8 : 0000003f88944050 s9 : 0000002ad8502e88 s10: 0000002ad8502de8 +[ 452.440538] s11: 0000000000000014 t3 : 0000003f887fceb6 t4 : 0000003f8893af0c +[ 452.441438] t5 : 0000000000000000 t6 : 0000003f88923000 + +[1] https://git.busybox.net/busybox/commit/?id=1f925038a + +Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2022-January/089413.html] +Signed-off-by: Khem Raj +--- + include/libbb.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/libbb.h b/include/libbb.h +index a487828..7b76335 100644 +--- a/include/libbb.h ++++ b/include/libbb.h +@@ -2281,7 +2281,7 @@ struct globals; + /* '*const' ptr makes gcc optimize code much better. + * Magic prevents ptr_to_globals from going into rodata. + * If you want to assign a value, use SET_PTR_TO_GLOBALS(x) */ +-extern struct globals *const ptr_to_globals; ++extern struct globals *BB_GLOBAL_CONST ptr_to_globals; + + #define barrier() asm volatile ("":::"memory") + +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/files/0001-generalize-const-trick.patch b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/files/0001-generalize-const-trick.patch new file mode 100644 index 0000000000000000000000000000000000000000..250751a36b24cf6cd8ad80ab59fbeccd59c38b7f --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/busybox/files/0001-generalize-const-trick.patch @@ -0,0 +1,222 @@ +From 1f925038ab9c6bd8f6b3cd40ed7aab0ef10d898e Mon Sep 17 00:00:00 2001 +From: YU Jincheng +Date: Wed, 29 Sep 2021 17:37:26 +0800 +Subject: [PATCH] *: generalize "const trick" + +While at it, change all "__asm__" to "asm" + +Co-authored-by: canyie <31466456+canyie@users.noreply.github.com> +Signed-off-by: YU Jincheng +Signed-off-by: Denys Vlasenko +--- + coreutils/test.c | 5 ++--- + include/libbb.h | 34 +++++++++++++++++++++++++--------- + libbb/appletlib.c | 3 +-- + libbb/lineedit.c | 5 ++--- + procps/powertop.c | 2 +- + shell/ash.c | 23 +++-------------------- + 6 files changed, 34 insertions(+), 38 deletions(-) + +diff --git a/coreutils/test.c b/coreutils/test.c +index 7c6574334..fc956724b 100644 +--- a/coreutils/test.c ++++ b/coreutils/test.c +@@ -435,7 +435,7 @@ struct test_statics { + }; + + /* See test_ptr_hack.c */ +-extern struct test_statics *const test_ptr_to_statics; ++extern struct test_statics *BB_GLOBAL_CONST test_ptr_to_statics; + + #define S (*test_ptr_to_statics) + #define args (S.args ) +@@ -446,8 +446,7 @@ extern struct test_statics *const test_ptr_to_statics; + #define leaving (S.leaving ) + + #define INIT_S() do { \ +- (*(struct test_statics**)not_const_pp(&test_ptr_to_statics)) = xzalloc(sizeof(S)); \ +- barrier(); \ ++ ASSIGN_CONST_PTR(test_ptr_to_statics, xzalloc(sizeof(S))); \ + } while (0) + #define DEINIT_S() do { \ + free(group_array); \ +diff --git a/include/libbb.h b/include/libbb.h +index dfcaa05ec..02cc008f0 100644 +--- a/include/libbb.h ++++ b/include/libbb.h +@@ -365,13 +365,27 @@ struct BUG_off_t_size_is_misdetected { + #endif + #endif + ++/* We use a trick to have more optimized code (fewer pointer reloads ++ * and reduced binary size by a few kilobytes) like: ++ * ash.c: extern struct globals *const ash_ptr_to_globals; ++ * ash_ptr_hack.c: struct globals *ash_ptr_to_globals; ++ * This way, compiler in ash.c knows the pointer can not change. ++ * ++ * However, this may break on weird arches or toolchains. In this case, ++ * set "-DBB_GLOBAL_CONST=''" in CONFIG_EXTRA_CFLAGS to disable ++ * this optimization. ++ */ ++#ifndef BB_GLOBAL_CONST ++# define BB_GLOBAL_CONST const ++#endif ++ + #if defined(errno) + /* If errno is a define, assume it's "define errno (*__errno_location())" + * and we will cache it's result in this variable */ +-extern int *const bb_errno; +-#undef errno +-#define errno (*bb_errno) +-#define bb_cached_errno_ptr 1 ++extern int *BB_GLOBAL_CONST bb_errno; ++# undef errno ++# define errno (*bb_errno) ++# define bb_cached_errno_ptr 1 + #endif + + #if !(ULONG_MAX > 0xffffffff) +@@ -2270,6 +2284,8 @@ struct globals; + * If you want to assign a value, use SET_PTR_TO_GLOBALS(x) */ + extern struct globals *const ptr_to_globals; + ++#define barrier() asm volatile ("":::"memory") ++ + #if defined(__clang_major__) && __clang_major__ >= 9 + /* Clang/llvm drops assignment to "constant" storage. Silently. + * Needs serious convincing to not eliminate the store. +@@ -2277,7 +2293,7 @@ extern struct globals *const ptr_to_globals; + static ALWAYS_INLINE void* not_const_pp(const void *p) + { + void *pp; +- __asm__ __volatile__( ++ asm volatile ( + "# forget that p points to const" + : /*outputs*/ "=r" (pp) + : /*inputs*/ "0" (p) +@@ -2288,13 +2304,13 @@ static ALWAYS_INLINE void* not_const_pp(const void *p) + static ALWAYS_INLINE void* not_const_pp(const void *p) { return (void*)p; } + #endif + +-/* At least gcc 3.4.6 on mipsel system needs optimization barrier */ +-#define barrier() __asm__ __volatile__("":::"memory") +-#define SET_PTR_TO_GLOBALS(x) do { \ +- (*(struct globals**)not_const_pp(&ptr_to_globals)) = (void*)(x); \ ++#define ASSIGN_CONST_PTR(p, v) do { \ ++ *(void**)not_const_pp(&p) = (void*)(v); \ ++ /* At least gcc 3.4.6 on mipsel needs optimization barrier */ \ + barrier(); \ + } while (0) + ++#define SET_PTR_TO_GLOBALS(x) ASSIGN_CONST_PTR(ptr_to_globals, x) + #define FREE_PTR_TO_GLOBALS() do { \ + if (ENABLE_FEATURE_CLEAN_UP) { \ + free(ptr_to_globals); \ +diff --git a/libbb/appletlib.c b/libbb/appletlib.c +index 5c5d7eb95..bf26c99e9 100644 +--- a/libbb/appletlib.c ++++ b/libbb/appletlib.c +@@ -247,8 +247,7 @@ void lbb_prepare(const char *applet + IF_FEATURE_INDIVIDUAL(, char **argv)) + { + #ifdef bb_cached_errno_ptr +- (*(int **)not_const_pp(&bb_errno)) = get_perrno(); +- barrier(); ++ ASSIGN_CONST_PTR(bb_errno, get_perrno()); + #endif + applet_name = applet; + +diff --git a/libbb/lineedit.c b/libbb/lineedit.c +index a7a3ee103..3c87abcf9 100644 +--- a/libbb/lineedit.c ++++ b/libbb/lineedit.c +@@ -192,7 +192,7 @@ struct lineedit_statics { + }; + + /* See lineedit_ptr_hack.c */ +-extern struct lineedit_statics *const lineedit_ptr_to_statics; ++extern struct lineedit_statics *BB_GLOBAL_CONST lineedit_ptr_to_statics; + + #define S (*lineedit_ptr_to_statics) + #define state (S.state ) +@@ -214,8 +214,7 @@ extern struct lineedit_statics *const lineedit_ptr_to_statics; + #define delbuf (S.delbuf ) + + #define INIT_S() do { \ +- (*(struct lineedit_statics**)not_const_pp(&lineedit_ptr_to_statics)) = xzalloc(sizeof(S)); \ +- barrier(); \ ++ ASSIGN_CONST_PTR(lineedit_ptr_to_statics, xzalloc(sizeof(S))); \ + } while (0) + + static void deinit_S(void) +diff --git a/procps/powertop.c b/procps/powertop.c +index fc6018b7a..24c2b320f 100644 +--- a/procps/powertop.c ++++ b/procps/powertop.c +@@ -505,7 +505,7 @@ static void cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx, + unsigned int *edx) + { + /* EAX value specifies what information to return */ +- __asm__( ++ asm ( + " pushl %%ebx\n" /* Save EBX */ + " cpuid\n" + " movl %%ebx, %1\n" /* Save content of EBX */ +diff --git a/shell/ash.c b/shell/ash.c +index 4bf0615ea..7b85981ec 100644 +--- a/shell/ash.c ++++ b/shell/ash.c +@@ -303,20 +303,6 @@ typedef long arith_t; + # error "Do not even bother, ash will not run on NOMMU machine" + #endif + +-/* We use a trick to have more optimized code (fewer pointer reloads): +- * ash.c: extern struct globals *const ash_ptr_to_globals; +- * ash_ptr_hack.c: struct globals *ash_ptr_to_globals; +- * This way, compiler in ash.c knows the pointer can not change. +- * +- * However, this may break on weird arches or toolchains. In this case, +- * set "-DBB_GLOBAL_CONST=''" in CONFIG_EXTRA_CFLAGS to disable +- * this optimization. +- */ +-#ifndef BB_GLOBAL_CONST +-# define BB_GLOBAL_CONST const +-#endif +- +- + /* ============ Hash table sizes. Configurable. */ + + #define VTABSIZE 39 +@@ -518,8 +504,7 @@ extern struct globals_misc *BB_GLOBAL_CONST ash_ptr_to_globals_misc; + #define random_gen (G_misc.random_gen ) + #define backgndpid (G_misc.backgndpid ) + #define INIT_G_misc() do { \ +- (*(struct globals_misc**)not_const_pp(&ash_ptr_to_globals_misc)) = xzalloc(sizeof(G_misc)); \ +- barrier(); \ ++ ASSIGN_CONST_PTR(ash_ptr_to_globals_misc, xzalloc(sizeof(G_misc))); \ + savestatus = -1; \ + curdir = nullstr; \ + physdir = nullstr; \ +@@ -1597,8 +1582,7 @@ extern struct globals_memstack *BB_GLOBAL_CONST ash_ptr_to_globals_memstack; + #define g_stacknleft (G_memstack.g_stacknleft) + #define stackbase (G_memstack.stackbase ) + #define INIT_G_memstack() do { \ +- (*(struct globals_memstack**)not_const_pp(&ash_ptr_to_globals_memstack)) = xzalloc(sizeof(G_memstack)); \ +- barrier(); \ ++ ASSIGN_CONST_PTR(ash_ptr_to_globals_memstack, xzalloc(sizeof(G_memstack))); \ + g_stackp = &stackbase; \ + g_stacknxt = stackbase.space; \ + g_stacknleft = MINSIZE; \ +@@ -2229,8 +2213,7 @@ extern struct globals_var *BB_GLOBAL_CONST ash_ptr_to_globals_var; + #endif + #define INIT_G_var() do { \ + unsigned i; \ +- (*(struct globals_var**)not_const_pp(&ash_ptr_to_globals_var)) = xzalloc(sizeof(G_var)); \ +- barrier(); \ ++ ASSIGN_CONST_PTR(ash_ptr_to_globals_var, xzalloc(sizeof(G_var))); \ + for (i = 0; i < ARRAY_SIZE(varinit_data); i++) { \ + varinit[i].flags = varinit_data[i].flags; \ + varinit[i].var_text = varinit_data[i].var_text; \ +-- +2.30.0 + diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-core/dsoftbus/dsoftbus/0001-change-toolchain-for-clang-build.patch b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/dsoftbus/dsoftbus/0001-change-toolchain-for-clang-build.patch new file mode 100644 index 0000000000000000000000000000000000000000..5f5ffe50afd1afc45843e8737acd64d30ac7f929 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/dsoftbus/dsoftbus/0001-change-toolchain-for-clang-build.patch @@ -0,0 +1,50 @@ +From e11f196cff586404cffb16a467bf42058694c08e Mon Sep 17 00:00:00 2001 +From: hmilylmk +Date: Mon, 6 Feb 2023 10:06:36 +0800 +Subject: [PATCH] change toolchain for clang build + +Signed-off-by: hmilylmk +--- + config/compiler/BUILD.gn | 6 +++++- + toolchain/linux/BUILD.gn | 7 +++---- + 2 files changed, 8 insertions(+), 5 deletions(-) + +diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn +index 14c07bb..8fd4ba5 100755 +--- a/config/compiler/BUILD.gn ++++ b/config/compiler/BUILD.gn +@@ -863,7 +863,11 @@ config("default_warnings") { + + # Don't warn about "maybe" uninitialized. Clang doesn't include this + # in -Wall but gcc does, and it gives false positives. +- cflags += [ "-Wno-maybe-uninitialized" ] ++ # cflags += [ "-Wno-maybe-uninitialized" ] ++ cflags += [ "-Wno-unused-private-field" ] ++ cflags += [ "-Wno-empty-body" ] ++ cflags += [ "-Wno-pointer-to-enum-cast" ] ++ cflags += [ "-Wno-unused-but-set-variable" ] + cflags += [ "-Wno-deprecated-declarations" ] + + # GCC assumes 'this' is never nullptr and optimizes away code +diff --git a/toolchain/linux/BUILD.gn b/toolchain/linux/BUILD.gn +index c811cf9..108fa96 100755 +--- a/toolchain/linux/BUILD.gn ++++ b/toolchain/linux/BUILD.gn +@@ -22,11 +22,10 @@ clang_toolchain("clang_arm64") { + } + + gcc_toolchain("arm64") { +- tool_path = rebase_path("//toolchain/bin", root_build_dir) +- toolprefix = "${tool_path}/aarch64-openeuler-linux-gnu-" ++ toolprefix = "aarch64-openeuler-linux-" + +- cc = "${toolprefix}gcc" +- cxx = "${toolprefix}g++" ++ cc = "${toolprefix}clang" ++ cxx = "${toolprefix}clang++" + + ar = "${toolprefix}ar" + ld = cxx +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-core/dsoftbus/dsoftbus_%.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/dsoftbus/dsoftbus_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d617d953f4778ca57757ea0cd06eff45209abde2 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/dsoftbus/dsoftbus_%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" +# add patch to support clang +SRC_URI_append = " \ + file://0001-change-toolchain-for-clang-build.patch;patchdir=${S}/build \ +" diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-core/images/clang-sdk.inc b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/images/clang-sdk.inc new file mode 100644 index 0000000000000000000000000000000000000000..e64641dd2fc66bed4b20feb2e630d6dfd350a593 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/images/clang-sdk.inc @@ -0,0 +1,14 @@ +TOOLCHAIN_HOST_TASK =+ " \ +clang-external-cross-canadian-${TRANSLATED_TARGET_ARCH} \ +" + +# when using `clang --target=${TARGET_PREFIX}` to compile +# clang will find lib{64}/gcc/${TARGET_PREFIX}/version/crt*.o by default. +# but our sdk just has lib{64}/gcc/${TARGET_PREFIX}-gnu/version/crt*.o, which will lead compile error. +# so add a link fix this +add_target_link () { + cd ${SDK_OUTPUT}/${SDKPATHNATIVE}/usr/lib64/gcc/ + ln -s ${EXTERNAL_TARGET_SYS} ${TARGET_SYS} + cd - +} +SDK_POSTPROCESS_COMMAND =+ " add_target_link;" diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-core/images/openeuler-image-llvm.bb b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/images/openeuler-image-llvm.bb new file mode 100644 index 0000000000000000000000000000000000000000..9dd0f6965963a60e1d8eec11056bfa39845aed87 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/images/openeuler-image-llvm.bb @@ -0,0 +1,35 @@ +# build an iso image, the live-os uses openeuler-image-live, it must be the same as itself(openeuler-image) +# when LIVE_ROOTFS_TYPE defined, bug may come out in poky, so just use default value ext4 in image-live.bbclass. +# notice we need MACHINE_FEATURES += "efi" in machine conf +IMAGE_FSTYPES_append_aarch64 += " iso " +IMAGE_FSTYPES_append_x86-64 += " iso " +IMAGE_FSTYPES_remove_raspberrypi4 += " iso " +INITRD_IMAGE_LIVE = "openeuler-image-live" + +# notice: IMAGE_FEATURE configs such as IMAGE_FSTYPES should be defined before openeuler-image-common.inc(before core-image and image.bbclass) +require recipes-core/images/openeuler-image-common.inc +# package sdk +require recipes-core/images/openeuler-image-sdk.inc +require clang-sdk.inc + +# packages added to rootfs and target sdk +# put packages allowing a device to boot into "packagegroup-core-boot" +# put standard base packages to "packagegroup-core-base-utils" +# put extra base packages to "packagegroup-base" +# put extended packages to "packagegroup-base-extended" +# put other class of packages to "packagegroup-xxx" +# Notice: IMAGE_INSTALL should define after openeuler-image-common.inc(after core-image\image.bbclass) +IMAGE_INSTALL += " \ +packagegroup-core-boot \ +packagegroup-core-base-utils \ +packagegroup-core-tools-debug \ +packagegroup-base \ +packagegroup-base-extended \ +packagegroup-openssh \ +packagegroup-kernel-modules \ +packagegroup-isulad \ +" + +# You can add extra user here, suck like: +# inherit extrausers +# EXTRA_USERS_PARAMS = "useradd -p '' openeuler;" diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-core/lxc/lxc_%.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/lxc/lxc_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7efdca77bc14a1c453d542f89b77565cad9e83c5 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/lxc/lxc_%.bbappend @@ -0,0 +1,2 @@ +CFLAGS:remove = "-Wno-error=stringop-overflow" +CFLAGS:append = " -Wno-error=unused-command-line-argument " diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-core/meta/meta-environment.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/meta/meta-environment.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..99f78af552db4408ef0d63f6d9dc9c865e04e16b --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-core/meta/meta-environment.bbappend @@ -0,0 +1,8 @@ +# change CC/CXX/CPP environment variables to using clang +export TARGET_CLANGCC_ARCH = "${TARGET_CC_ARCH}" +TARGET_CLANGCC_ARCH:append = " -Wno-int-conversion " +create_sdk_files:append() { + sed -i "s/^export CC=.*/export CC=\"clang --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=\$SDKTARGETSYSROOT\"/g" ${script} + sed -i "s/^export CXX=.*/export CXX=\"clang++ --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=\$SDKTARGETSYSROOT\"/g" ${script} + sed -i "s/^export CPP=.*/export CPP=\"clang -E --target=${TARGET_SYS} ${TARGET_CLANGCC_ARCH} --sysroot=\$SDKTARGETSYSROOT\"/g" ${script} +} diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-devtools/json-c/json-c_%.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-devtools/json-c/json-c_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..23386eb60a6c01dfe2ce70448bfeab7d88ee4fca --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-devtools/json-c/json-c_%.bbappend @@ -0,0 +1 @@ +CFLAGS:append = " -Wno-error=strict-prototypes " diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-devtools/strace/strace_%.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-devtools/strace/strace_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bf7dd58ba0e2482cfcee90a51a94f94556415864 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-devtools/strace/strace_%.bbappend @@ -0,0 +1 @@ +TOOLCHAIN = "clang" diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-external/binutils/binutils-external-cross-canadian.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/binutils/binutils-external-cross-canadian.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7dbbe86b659fec8abd55a7fafa603601af9e0f10 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/binutils/binutils-external-cross-canadian.bbappend @@ -0,0 +1,36 @@ +# some binutils still using gcc compiled +binutils_binaries = "as ld ld.bfd ld.gold elfedit addr2line" +# using llvm binutils +clang_binutils = "ar nm objcopy objdump ranlib strip cxxfilt readelf size strings readobj" +# add llvm-* binutils +FILES_${PN} += "\ + ${bindir}/ld* \ + ${bindir}/lld* \ + ${@' '.join('${bindir}/llvm-' + i for i in '${clang_binutils}'.split())} \ +" + +# add ${TARGET_PREFIX}{binutils} links to llvm-{binutils} +do_install_append () { + for i in ${D}${bindir}/llvm-*; do + if [ -e "$i" ]; then + j="$(basename "$i")" + [[ -e "${D}${bindir}/${TARGET_PREFIX}${j#llvm-}" ]] && continue + ln -sv "$j" "${D}${bindir}/${TARGET_PREFIX}${j#llvm-}" + fi + done +} + +python add_llvm_files_links () { + prefix = 'llvm-' + full_prefix = os.path.join(d.getVar('bindir'), prefix) + new_prefix = d.getVar('TARGET_PREFIX') + for pkg in d.getVar('PACKAGES').split(): + files = (d.getVar('FILES_%s' % pkg) or '').split() + new_files = [] + for f in files: + if f.startswith(full_prefix): + new_files.append(f.replace(prefix, new_prefix)) + if new_files: + d.appendVar('FILES_%s' % pkg, ' ' + ' '.join(new_files)) +} +do_package[prefuncs] += "add_llvm_files_links" diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-external/binutils/binutils-external-cross.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/binutils/binutils-external-cross.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..65081518025485710f3ae1a8f440d72d43eaf06f --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/binutils/binutils-external-cross.bbappend @@ -0,0 +1,3 @@ +# still depend gnu's binutils like as/elfedit(for kernel build) ld(normally compile). +binutils_binaries = "llvm-ar as ld ld.bfd ld.gold elfedit llvm-nm llvm-objcopy llvm-objdump llvm-ranlib llvm-strip \ + llvm-addr2line llvm-cxxfilt llvm-readelf llvm-size llvm-strings" diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-external/clang/clang-external-cross-canadian.bb b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/clang/clang-external-cross-canadian.bb new file mode 100644 index 0000000000000000000000000000000000000000..9e3f96568e81f51fe50eb270cde84461d018f94a --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/clang/clang-external-cross-canadian.bb @@ -0,0 +1,27 @@ +inherit external-toolchain-cross-canadian + +PN .= "-${TRANSLATED_TARGET_ARCH}" + +PV = "${CLANG_VERSION}" + +clanglibdir = "${exec_prefix}/lib" +clangincdir = "${exec_prefix}/include" + +RDEPENDS_${PN} = "binutils-external-cross-canadian-${TRANSLATED_TARGET_ARCH}" +FILES_${PN} = "\ + ${bindir}/clang* \ + ${clanglibdir}/* \ + ${clangincdir}/* \ +" + +# no debug package +FILES_${PN}-dbg = "" +# no need do autolibname(handle the dependency of .so libs) +# auto_libname in debian.bbclass will call ${TARGET_PREFIX}objdump to get shlibs2 related info +# for gcc-external-cross-canadian, can't find ${TARGET_PREFIX}objdump +AUTO_LIBNAME_PKGS = "" + + +INSANE_SKIP_${PN} += "dev-so staticdev" +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_SYSROOT_STRIP = "1" diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-external/clang/clang-external-cross.bb b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/clang/clang-external-cross.bb new file mode 100644 index 0000000000000000000000000000000000000000..3002a183c311c22882bee8949abcc6fd69f0baff --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/clang/clang-external-cross.bb @@ -0,0 +1,8 @@ +inherit external-toolchain-cross + +PV = "${CLANG_VERSION}" +PN .= "-${TARGET_ARCH}" +DEPENDS += "virtual/${TARGET_PREFIX}binutils" + +EXTERNAL_CROSS_BINARIES = "clang clang++" + diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-external/clang/clang-native.bb b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/clang/clang-native.bb new file mode 100644 index 0000000000000000000000000000000000000000..023c381fae3d3e87f36a86ac6bc05ed78084435a --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/clang/clang-native.bb @@ -0,0 +1,29 @@ +inherit common-license native +LICENSE = "CLOSED" + +PV = "${CLANG_VERSION}" +wrap_bin () { + bin="$1" + shift + script="${D}${bindir}/${bin}" + # compiler is support nativesdk now + execcmd="exec ${EXTERNAL_TOOLCHAIN_CLANG_BIN}/${bin} --target=x86_64-pokysdk-linux \"\$@\"" + printf '#!/bin/sh\n' >$script + for arg in "$@"; do + printf '%s\n' "$arg" + done >>"$script" + printf '%s\n' "${execcmd}" >>"$script" + chmod +x "$script" +} + +do_install () { + install -d ${D}${bindir} + for bin in clang clang++; do + if [ ! -e "${EXTERNAL_TOOLCHAIN_CLANG_BIN}/${bin}" ]; then + bbdebug 1 "${EXTERNAL_TOOLCHAIN_CLANG_BIN}/${bin} does not exist" + continue + fi + bbdebug 1 wrap_bin "$bin" + wrap_bin "${bin}" + done +} diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-external/sdk-env-external-toolchain/files/clang-external.sh b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/sdk-env-external-toolchain/files/clang-external.sh new file mode 100644 index 0000000000000000000000000000000000000000..fe61282305f6f32335cb645945dcb28b01bd2e2e --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/sdk-env-external-toolchain/files/clang-external.sh @@ -0,0 +1,7 @@ +# add a wrapper for users to use ${TARGET_PREFIX}-clang/clang++ +# compiling target binary conveniently. +CLANGCC=${OECORE_NATIVE_SYSROOT}/usr/bin/${TARGET_PREFIX}clang +CLANGCXX=${OECORE_NATIVE_SYSROOT}/usr/bin/${TARGET_PREFIX}clang++ +echo "#!/bin/bash\nexec ${CC} \"\$@\"" > ${CLANGCC} +echo "#!/bin/bash\nexec ${CXX} \"\$@\"" > ${CLANGCXX} +chmod +x ${CLANGCC} ${CLANGCXX} diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-external/sdk-env-external-toolchain/sdk-env-external-toolchain.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/sdk-env-external-toolchain/sdk-env-external-toolchain.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..88563fb3db3ee4b500a2ad0899621d1726b4483e --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-external/sdk-env-external-toolchain/sdk-env-external-toolchain.bbappend @@ -0,0 +1,11 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files/:" + +SRC_URI:remove = "file://external.sh" +SRC_URI:append = "\ + file://clang-external.sh \ +" + +do_install () { + install -d "${D}/environment-setup.d" + install -m 0644 -o root -g root "${WORKDIR}/clang-external.sh" "${D}/environment-setup.d/" +} diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-kernel/linux/linux-openeuler.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-kernel/linux/linux-openeuler.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7e7f398e60f52221b0e43dc27bf75b66a7214836 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-kernel/linux/linux-openeuler.bbappend @@ -0,0 +1,4 @@ +TOOLCHAIN = "clang" +DEPENDS:append = " clang-external-cross-${TARGET_ARCH}" +DEPENDS:remove = " virtual/${TARGET_PREFIX}gcc " +KERNEL_CC = "${CCACHE}${HOST_PREFIX}clang ${HOST_CC_KERNEL_ARCH} ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH}" diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-kernel/perf/perf.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-kernel/perf/perf.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..27e4fc3a3edbebf36c4804607250b3f665d55d34 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-kernel/perf/perf.bbappend @@ -0,0 +1,3 @@ +TOOLCHAIN = "clang" + +HOST_CC_ARCH:append = " -Wno-error=unused-command-line-argument " diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-mcs/openamp/openamp_%.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-mcs/openamp/openamp_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..98a0be3336300a248d28aea09f6983d5d159a816 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-mcs/openamp/openamp_%.bbappend @@ -0,0 +1,5 @@ +# fix segmentfault error when compiling with clang +SRC_URI:append = " \ + file://0001-apps-Fix-atomic_flag-error-for-clang-compilation.patch \ + file://0002-lib-Fix-atomic_flag-error-for-clang-compilation.patch \ +" diff --git a/meta-openeuler/dynamic-layers/clang-layer/recipes-support/ethercat/ethercat_%.bbappend b/meta-openeuler/dynamic-layers/clang-layer/recipes-support/ethercat/ethercat_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bf7dd58ba0e2482cfcee90a51a94f94556415864 --- /dev/null +++ b/meta-openeuler/dynamic-layers/clang-layer/recipes-support/ethercat/ethercat_%.bbappend @@ -0,0 +1 @@ +TOOLCHAIN = "clang" diff --git a/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/pypi-src-openeuler.inc b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/pypi-src-openeuler.inc new file mode 100644 index 0000000000000000000000000000000000000000..8f835223ea41708e075b61157897cf7b15c0fb3b --- /dev/null +++ b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/pypi-src-openeuler.inc @@ -0,0 +1,5 @@ +OPENEULER_REPO_NAME = "python-${PYPI_PACKAGE}" + +# use openeuler's pkg src +SRC_URI_remove += "${PYPI_SRC_URI} " +SRC_URI_prepend += "file://${PYPI_PACKAGE}-${PV}.tar.gz " diff --git a/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-blinker_%.bbappend b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-blinker_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..9f17221223ff8f115089af4ee91dc440e8fb5f5f --- /dev/null +++ b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-blinker_%.bbappend @@ -0,0 +1,6 @@ +PV = "1.5" +require pypi-src-openeuler.inc + +SRC_URI[md5sum] = "e1c3eec8e52210f69ef59d299c6cca07" +SRC_URI[sha256sum] = "923e5e2f69c155f2cc42dafbbd70e16e3fde24d2d4aa2ab72fbe386238892462" +LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=42cd19c88fc13d1307a4efd64ee90e4e" diff --git a/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-click_%.bbappend b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-click_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bd039aeb0f6519e41594caf60eefd0252f826c79 --- /dev/null +++ b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-click_%.bbappend @@ -0,0 +1,5 @@ +PV = "8.0.4" +require pypi-src-openeuler.inc + +SRC_URI[md5sum] = "c89efc98d1b36d52ba26a39c803df0cc" +SRC_URI[sha256sum] = "8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb" diff --git a/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-coloredlogs_%.bbappend b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-coloredlogs_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3f619d93a6df5f5d100ab467d686eff16576453b --- /dev/null +++ b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-coloredlogs_%.bbappend @@ -0,0 +1,3 @@ +PV = "15.0.1" +require pypi-src-openeuler.inc + diff --git a/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-humanfriendly_%.bbappend b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-humanfriendly_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..981d811eb22d819ea5a9ac7478ef07c00d9c1175 --- /dev/null +++ b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-humanfriendly_%.bbappend @@ -0,0 +1,6 @@ +PV = "10.0" +require pypi-src-openeuler.inc + +SRC_URI[md5sum] = "79ae9293181aa113698ee3393f202188" +SRC_URI[sha256sum] = "6b0b831ce8f15f7300721aa49829fc4e83921a9a301cc7f606be6686a2288ddc" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=5d178009f806c2bdd498a19be0013a7a" diff --git a/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-psutil_%.bbappend b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-psutil_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d52ea4756b319bbd8e3c49a655d70c86d5e09f92 --- /dev/null +++ b/meta-openeuler/dynamic-layers/meta-python/recipes-devtools/python/python3-psutil_%.bbappend @@ -0,0 +1,13 @@ +PV = "5.9.0" +require pypi-src-openeuler.inc + +S = "${WORKDIR}/${PYPI_PACKAGE}-release-${PV}" + +SRC_URI[md5sum] = "080d75a78be3ef1ce72c39a9b001197d" +SRC_URI[sha256sum] = "ea4f431c10100079f46a494894582edb43e395324f200bd82ecf60b60b46a929" + +# add RDEPENDS for 5.9 +RDEPENDS_${PN} += " \ + ${PYTHON_PN}-ctypes \ + ${PYTHON_PN}-resource \ +" diff --git a/meta-openeuler/dynamic-layers/networking-layer/recipes-support/cifs-utils/cifs-utils_%.bbappend b/meta-openeuler/dynamic-layers/networking-layer/recipes-support/cifs-utils/cifs-utils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..90c9913d040f2519195cdb294c78ced90a80ec17 --- /dev/null +++ b/meta-openeuler/dynamic-layers/networking-layer/recipes-support/cifs-utils/cifs-utils_%.bbappend @@ -0,0 +1,12 @@ +PV = "7.0" + +OPENEULER_SRC_URI_REMOVE = "https git http" +SRC_URI_prepend = "file://${BP}.tar.bz2 \ + " + +SRC_URI[sha256sum] = "a7b6940e93250c1676a6fa66b6ead91b78cd43a5fee99cc462459c8b9cf1e6f4" + +S = "${WORKDIR}/${BP}" + +# keep the same as before, otherwise a large number of dependencies will be introduced +DEPENDS_remove = "libtalloc" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-benchmark/libhugetlbfs/libhugetlbfs_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-benchmark/libhugetlbfs/libhugetlbfs_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..30b7deb87f468a88ab8c21d910b2bb222abc3afe --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-benchmark/libhugetlbfs/libhugetlbfs_%.bbappend @@ -0,0 +1,23 @@ +# main bbfile: meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb?h=hardknott + +OPENEULER_SRC_URI_REMOVE = "git" + +# remove patch conflicting with openeuler +SRC_URI_remove = "file://0001-tests-makefile-Append-CPPFLAGS-rather-then-override.patch \ +" + +SRC_URI_prepend = "file://${BP}.tar.gz \ + file://0000-build_flags.patch \ + file://Disable-hugepage-backed-malloc-if-__morecore-is-not-.patch \ + file://libhugetlbfs-make-cflags.patch \ +" + +do_install_append(){ + rm ${D}/${libdir}/../bin/hugeedit +} + +FILES_${PN}-dbg += "${libdir}/libhugetlbfs/tests/obj32/.debug ${libdir}/libhugetlbfs/tests/obj64/.debug" + +S = "${WORKDIR}/${BP}" + +SRC_URI[sha256sum] = "b70672f1e807c61b7eb3adf41c1903b42917951f2e7f8aef6821841700c04479" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-bsp/pointercal/pointercal_0.0.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-bsp/pointercal/pointercal_0.0.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d8aaa5b188b53e3aee72423314f70094424b041a --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-bsp/pointercal/pointercal_0.0.bbappend @@ -0,0 +1,4 @@ +# pointercal does not require code download, to avoid the conflict of pointercal folder +# (set by DL_DIR ?= "${OPENEULER_SP_DIR}/${BPN}" ) +# and pointercal script file (with pointercal_0.0.bb ), +OPENEULER_REPO_NAME = "pointercal_dummy" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-connectivity/libwebsockets/libwebsockets_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-connectivity/libwebsockets/libwebsockets_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a169550be229c226681bd14a463c9cf83cc29194 --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-connectivity/libwebsockets/libwebsockets_%.bbappend @@ -0,0 +1,23 @@ +# source bb: meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.1.6.bb;branch=hardknott + +PV = "4.3.0" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=382bfdf329e774859fd401eaf850d29b" + +OPENEULER_SRC_URI_REMOVE = "git" + +# apply openeuler source and patch +SRC_URI_prepend = "file://${BP}.tar.gz \ + file://0001-add-secure-compile-option-in-Makefile.patch \ + file://0002-solve-the-BEP-problem.patch \ + file://0003-route-extend-lws_route_uidx_t-from-1-byte-to-2-bytes.patch \ +" + +S = "${WORKDIR}/${BP}" + +SRC_URI[md5sum] = "0f82cf061d50d4a2492c32aa149cd930" +SRC_URI[sha256sum] = "e6693ab5aa925930b2c6471129b42a79b8f3cbbc493e5f8b89311cecc0c99bc0" + +# no libwebsockets-test-server +EXTRA_OECMAKE_append = " \ + -DLWS_WITHOUT_TEST_SERVER=ON" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-connectivity/zeromq/cppzmq_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-connectivity/zeromq/cppzmq_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..6fda3a24b192fd2381ec9cf0ce6e74a91bbf5dc9 --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-connectivity/zeromq/cppzmq_%.bbappend @@ -0,0 +1,4 @@ +# main bbfile: yocto-meta-openembedded/meta-oe/recipes-connectivity/zeromq/cppzmq_git.bb + +inherit openeuler_ros_source + diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-connectivity/zeromq/zeromq_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-connectivity/zeromq/zeromq_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..43b59f61bb17f0eb3c4842d8f8631df3f4963e3b --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-connectivity/zeromq/zeromq_%.bbappend @@ -0,0 +1,16 @@ +# main bbfile: yocto-meta-openembedded/meta-oe/recipes-connectivity/zeromq/zeromq_4.3.4.bb + +OPENEULER_BRANCH = "master" +OPENEULER_SRC_URI_REMOVE = "git https http" + +PV = "4.3.4" + +SRC_URI_append = " \ + file://libzmq-${PV}.tar.gz \ + file://fix-test_inproc_connect-occasionally-fails-on-slow-archs.patch \ +" + +SRC_URI[md5sum] = "cc20b769ac10afa352e5ed2769bb23b3" +SRC_URI[sha256sum] = "0ff5a531c9ffaf0dfdc7dc78d13d1383088f454896d252934c429b2554d10559" + +S = "${WORKDIR}/libzmq-${PV}" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-devtools/lua/lua_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-devtools/lua/lua_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d1a18d3e562b749cba0798283e78cea439400817 --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-devtools/lua/lua_%.bbappend @@ -0,0 +1,63 @@ +LIC_FILES_CHKSUM = "file://doc/readme.html;beginline=307;endline=330;md5=79c3f6b19ad05efe24c1681f025026bb" +PV = "5.4.4" +PV_testsuites = "5.4.3" +MINOR_VERSION = "5.4" + +# remove patches out of date +SRC_URI_remove = "file://0001-Allow-building-lua-without-readline-on-Linux.patch \ + file://CVE-2020-15888.patch \ + file://CVE-2020-15945.patch \ + file://0001-Fixed-bug-barriers-cannot-be-active-during-sweep.patch \ +" + +# openeuler has patches for lua-${PV}-tests +SRC_URI += " \ + http://www.lua.org/tests/lua-${PV}-tests.tar.gz;name=tarballtest;subdir=${BP}/ \ + file://run-ptest \ + file://lua-5.4.0-beta-autotoolize.patch \ + file://lua-5.3.0-idsize.patch \ + file://lua-5.2.2-configure-linux.patch \ + file://lua-5.3.0-configure-compat-module.patch \ + file://backport-CVE-2022-28805.patch \ + file://backport-CVE-2022-33099.patch \ + file://backport-luaV_concat-can-use-invalidated-pointer-to-stack.patch \ +" + +SRC_URI[tarballsrc.md5sum] = "bd8ce7069ff99a400efd14cf339a727b" +SRC_URI[tarballsrc.sha256sum] = "164c7849653b80ae67bec4b7473b884bf5cc8d2dca05653475ec2ed27b9ebf61" +SRC_URI[tarballtest.md5sum] = "0e28a9b48b3596d6b12989d04ae403c4" +SRC_URI[tarballtest.sha256sum] = "04d28355cd67a2299dfe5708b55a0ff221ccb1a3907a3113cc103ccc05ac6aad" + +EXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -fPIC' MYLDFLAGS='${LDFLAGS}' 'AR=ar rcD' 'RANLIB=ranlib -D'" + +do_prepare_before_patch() { + cd ${S} + # openeuler has change its name, and patch it + cp -f src/luaconf.h src/luaconf.h.template.in + cd - +} + +addtask do_prepare_before_patch before do_patch after do_unpack + +do_compile () { + oe_runmake ${@bb.utils.contains('PACKAGECONFIG', 'readline', 'linux-readline', 'linux', d)} +} + +# use MINOR_VERSION instead of 5.3 +do_install () { + oe_runmake \ + 'INSTALL_TOP=${D}${prefix}' \ + 'INSTALL_BIN=${D}${bindir}' \ + 'INSTALL_INC=${D}${includedir}/' \ + 'INSTALL_MAN=${D}${mandir}/man1' \ + 'INSTALL_SHARE=${D}${datadir}/lua' \ + 'INSTALL_LIB=${D}${libdir}' \ + 'INSTALL_CMOD=${D}${libdir}/lua/${MINOR_VERSION}' \ + install + install -d ${D}${libdir}/pkgconfig + + sed -e s/@VERSION@/${PV}/ ${WORKDIR}/lua.pc.in > ${WORKDIR}/lua.pc + install -m 0644 ${WORKDIR}/lua.pc ${D}${libdir}/pkgconfig/ + rmdir ${D}${datadir}/lua/${MINOR_VERSION} + rmdir ${D}${datadir}/lua +} diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-devtools/yajl/yajl_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-devtools/yajl/yajl_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a7f43ac75cfdb0ccabb477f8ff3fcf1af072039c --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-devtools/yajl/yajl_%.bbappend @@ -0,0 +1,18 @@ +# meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb?h=hardknott + +OPENEULER_SRC_URI_REMOVE = "git" + +SRC_URI_prepend = " \ + file://${PV}.tar.gz \ + file://0001-yajl-2.1.0-pkgconfig-location.patch \ + file://0002-yajl-2.1.0-pkgconfig-includedir.patch \ + file://0003-yajl-2.1.0-test-location.patch \ + file://0004-yajl-2.1.0-dynlink-binaries.patch \ + file://0005-yajl-2.1.0-fix-memory-leak.patch \ + file://0006-fix-memory-leak-of-ctx-root.patch \ + file://0007-add-cmake-option-for-test-and-binary.patch \ + file://backport-CVE-2022-24795.patch \ + file://yajl-assert-error-when-memory-allocation-failed.patch \ + " + +S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/libpwquality/libpwquality_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/libpwquality/libpwquality_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..8b1a5b7e4e84ea7ced2fa512605f69c40b7eb17b --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/libpwquality/libpwquality_%.bbappend @@ -0,0 +1,27 @@ +# main bbfile: meta-oe/recipes-extended/libpwquality/libpwquality_1.4.4.bb +# change install dir: ${base_libdir}(meta-openeuler) -> ${libdir}(meta-oe) + +SRC_URI_remove = "file://add-missing-python-include-dir-for-cross.patch \ +" + +OPENEULER_SRC_URI_REMOVE = "https git" + +PV = "1.4.5" + +SRC_URI =+ " \ + file://libpwquality-1.4.5.tar.bz2 \ + file://modify-pwquality_conf.patch \ + file://fix-password-similarity.patch \ + file://fix-doc-about-difok.patch \ +" + +# do not enable python bindings, as well as not use gettext to translate +DEPENDS_remove = "virtual/gettext ${PYTHON_PN}-native ${PYTHON_PN}" +RDEPENDS_${PN}_remove = "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}" + +EXTRA_OECONF_remove = "--with-python-rev=${PYTHON_BASEVERSION} \ + --with-python-binary=${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} \ + --with-pythonsitedir=${PYTHON_SITEPACKAGES_DIR} \ +" +EXTRA_OECONF += "--enable-python-bindings=no \ +" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/rsyslog/libfastjson_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/rsyslog/libfastjson_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d886bdd99de756bca21e0c3e9c779d7ee8e30f9c --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/rsyslog/libfastjson_%.bbappend @@ -0,0 +1,8 @@ +# main bbfile: meta-oe/recipes-extended/rsyslog/libfastjson_0.99.9.bb?h=hardknott + +SRC_URI = "file://${BP}.tar.gz" + +SRC_URI[md5sum] = "b4668f067145d4eb2a44433d5256f277" +SRC_URI[sha256sum] = "a330e1bdef3096b7ead53b4bad1a6158f19ba9c9ec7c36eda57de7729d84aaee" + +S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/rsyslog/rsyslog/backport-rsyslogd-adjust-the-order-of-doHUP-and-processImInte.patch b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/rsyslog/rsyslog/backport-rsyslogd-adjust-the-order-of-doHUP-and-processImInte.patch new file mode 100644 index 0000000000000000000000000000000000000000..6ae739b548279557613aed741c32450bf85741aa --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/rsyslog/rsyslog/backport-rsyslogd-adjust-the-order-of-doHUP-and-processImInte.patch @@ -0,0 +1,46 @@ +From e2d129880b6830bf7d26ab46d957b944f73f96e1 Mon Sep 17 00:00:00 2001 +From: Yun Zhou +Date: Thu, 24 Mar 2022 16:34:09 +0800 +Subject: [PATCH] rsyslogd: adjust the order of doHUP() and processImInternal() + +After call doHUP(), probably there is a internal log in the list. However, it +will not be wrote out immediately, because the mainloop will be blocked at +pselect in wait_timeout() until a long timeout or next message occur. +More deadly, the log may be lost if the deamon exits unexpectedly. + +We might as well put processImInternal() after doHUP(), so that the message +will be flushed out immediately. + +Fixes: 723f6fdfa6(rsyslogd: Fix race between signals and main loop timeout) +Signed-off-by: Yun Zhou +Conflict:NA +Reference:https://github.com/rsyslog/rsyslog/commit/857f77906f95681aa15c7ba3f88cbda8952f7e5f +--- + tools/rsyslogd.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tools/rsyslogd.c b/tools/rsyslogd.c +index 9a126dd..8410d44 100644 +--- a/tools/rsyslogd.c ++++ b/tools/rsyslogd.c +@@ -1966,8 +1966,6 @@ mainloop(void) + sigaddset(&sigblockset, SIGHUP); + + do { +- processImInternal(); +- + pthread_sigmask(SIG_BLOCK, &sigblockset, &origmask); + if(bChildDied) { + reapChild(); +@@ -1988,6 +1986,8 @@ mainloop(void) + bHadHUP = 0; + } + ++ processImInternal(); ++ + if(bFinished) + break; /* exit as quickly as possible */ + +-- +2.33.0 + diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/rsyslog/rsyslog_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/rsyslog/rsyslog_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..39a390e0411f5a1f3629bad445af5fa32e8c39ae --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-extended/rsyslog/rsyslog_%.bbappend @@ -0,0 +1,23 @@ +# main bbfile: meta-oe/recipes-extended/rsyslog/rsyslog_8.2102.0.bb?h=hardknott + +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" + +# version in openEuler +PV = "8.2210.0" + +# files, patches that come from openeuler +SRC_URI =+ " \ + file://rsyslog-8.24.0-ensure-parent-dir-exists-when-writting-log-file.patch \ + file://bugfix-rsyslog-7.4.7-imjournal-add-monotonic-timestamp.patch \ + file://bugfix-rsyslog-7.4.7-add-configuration-to-avoid-memory-leak.patch \ + file://rsyslog-8.37.0-initialize-variables-and-check-return-value.patch \ + file://backport-core-bugfix-local-hostname-invalid-if-no-global-config-object-given.patch \ + file://backport-imtcp-bugfix-legacy-config-directives-did-no-longer-work.patch \ +" + +SRC_URI[md5sum] = "23239f609af189b0814f8adc95ad9c02" +SRC_URI[sha256sum] = "643ee279139d694a07c9ff3ff10dc5213bdf874983d27d373525e95e05fa094d" + +# according to openEuler, no need to use liblogging libgcrypt +DEPENDS_remove = "liblogging" +PACKAGECONFIG_remove = "libgcrypt" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-graphics/tslib/tslib_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-graphics/tslib/tslib_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..62e0237557f766eba044bb98296849ce5ba2cde3 --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-graphics/tslib/tslib_%.bbappend @@ -0,0 +1,11 @@ +# main bbfile: meta-oe/recipes-graphics/tslib/tslib_1.22.bb + +PV = "1.16" + +SRC_URI_remove = "https://github.com/kergoth/tslib/releases/download/${PV}/tslib-${PV}.tar.xz;downloadfilename=tslib-${PV}.tar.xz \ +" + +SRC_URI_prepend = "file://${BP}.tar.bz2 \ +" + +S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-multimedia/cdrkit/cdrkit_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-multimedia/cdrkit/cdrkit_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..42b9dfffe968f3f57177307a78a03ec43560d0ff --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-multimedia/cdrkit/cdrkit_%.bbappend @@ -0,0 +1,43 @@ +# main bbfile: meta-oe/recipes-multimedia/cdrkit/cdrkit_1.1.11.bb + +# files, patches can't be applied in openeuler or conflict with openeuler +# patches apply fail: 0001-genisoimage-Add-missing-extern-definition.patch +SRC_URI_remove = " \ + ${DEBIAN_MIRROR}/main/c/${BPN}/${BPN}_${PV}.orig.tar.gz \ + file://0001-genisoimage-Add-missing-extern-definition.patch \ +" + +# files, patches that come from openeuler +# CDDA cdparanoia is an audio CDs tool, thus don't apply cdrkit-1.1.11-paranoiacdda.patch +# cdrkit-1.1.11-cmakewarn.patch requires that the minimum version of cmake is 2.8, current is 3.19.5 +SRC_URI_prepend = "file://${BP}.tar.gz \ + file://cdrkit-1.1.8-werror.patch \ + file://cdrkit-1.1.9-efi-boot.patch \ + file://cdrkit-1.1.9-no_mp3.patch \ + file://cdrkit-1.1.9-buffer_overflow.patch \ + file://cdrkit-1.1.10-build-fix.patch \ + file://cdrkit-1.1.11-manpagefix.patch \ + file://cdrkit-1.1.11-rootstat.patch \ + file://cdrkit-1.1.11-usalinst.patch \ + file://cdrkit-1.1.11-readsegfault.patch \ + file://cdrkit-1.1.11-format.patch \ + file://cdrkit-1.1.11-handler.patch \ + file://cdrkit-1.1.11-dvdman.patch \ + file://cdrkit-1.1.11-utf8.patch \ + file://cdrkit-1.1.11-memset.patch \ + file://cdrkit-1.1.11-ppc64le_elfheader.patch \ + file://cdrkit-1.1.11-werror_gcc5.patch \ + file://cdrkit-1.1.11-devname.patch \ + file://cdrkit-1.1.11-sysmacros.patch \ + file://cdrkit-1.1.11-gcc10.patch \ + file://cdrkit-1.1.11-sw.patch \ +" + +SRC_URI[md5sum] = "efe08e2f3ca478486037b053acd512e9" +SRC_URI[sha256sum] = "d1c030756ecc182defee9fe885638c1785d35a2c2a297b4604c0e0dcc78e47da" + +# fix problem "do_populate_sysroot: sstate found an absolute path symlink" +do_install_append() { + rm -f ${D}${bindir}/mkisofs + ln -sf --relative ${D}${bindir}/genisoimage ${D}${bindir}/mkisofs +} diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/files/0005-do-not-build-manual.patch b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/files/0005-do-not-build-manual.patch new file mode 100644 index 0000000000000000000000000000000000000000..58245c2898205a16a510dbea1fcdb2987cbc5544 --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/files/0005-do-not-build-manual.patch @@ -0,0 +1,72 @@ +From 103ac1c1200df8190372d973e004776cffe8e659 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Mon, 26 Nov 2018 14:59:55 +0800 +Subject: [PATCH 2/3] do not build manual + +On some host (ubuntu 1404), build manual failed. +... +./tools/man-generator --primary lvscan lvscan.8_des +Failed to stat description file lvscan.8_des. +... + +Do not build man to workaround the issue. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia + + +Update context for lvm2 2.03.02. + +Signed-off-by: Kai Kang +--- + Makefile.in | 6 +++--- + configure.ac | 1 - + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 6a1a990..80cba91 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -18,7 +18,7 @@ top_builddir = @top_builddir@ + abs_top_builddir = @abs_top_builddir@ + abs_top_srcdir = @abs_top_srcdir@ + +-SUBDIRS = libdm conf daemons include lib libdaemon man scripts tools ++SUBDIRS = libdm conf daemons include lib libdaemon scripts tools + + ifeq ("@UDEV_RULES@", "yes") + SUBDIRS += udev +@@ -33,7 +33,7 @@ ifeq ($(MAKECMDGOALS),clean) + endif + # FIXME Should use intermediate Makefiles here! + ifeq ($(MAKECMDGOALS),distclean) +- SUBDIRS = conf include man test scripts \ ++ SUBDIRS = conf include test scripts \ + libdaemon lib tools daemons libdm \ + udev po + tools.distclean: test.distclean +@@ -65,7 +65,7 @@ unit-test run-unit-test: test + daemons.device-mapper: libdm.device-mapper + tools.device-mapper: libdm.device-mapper +-device-mapper: tools.device-mapper daemons.device-mapper man.device-mapper ++device-mapper: tools.device-mapper daemons.device-mapper + device_mapper: device-mapper + + ifeq ("@INTL@", "yes") + lib.pofile: include.pofile +diff --git a/configure.ac b/configure.ac +index 7fd0561..4154dc0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1812,7 +1812,6 @@ libdaemon/server/Makefile + libdm/Makefile + libdm/dm-tools/Makefile + libdm/libdevmapper.pc +-man/Makefile + po/Makefile + scripts/lvm2-pvscan.service + scripts/blkdeactivate.sh +-- +2.7.4 + diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/libdevmapper_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/libdevmapper_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..fd5366dd4739996bed8e84cf36d567d27347cd1f --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/libdevmapper_%.bbappend @@ -0,0 +1,14 @@ +require lvm2-src.inc + +DEPENDS += "autoconf-archive-native util-linux" + +TARGET_CC_ARCH += "${LDFLAGS}" + +do_install() { + oe_runmake 'DESTDIR=${D}' -C libdm install +} + +# Do not generate package libdevmapper +PACKAGES = "" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/lvm2-src.inc b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/lvm2-src.inc new file mode 100644 index 0000000000000000000000000000000000000000..670bdcbb88911ad55c7564f1259b880421ef0aec --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/lvm2-src.inc @@ -0,0 +1,36 @@ +# use src-openEuler package + +# adapt 0005-do-not-build-manual.patch for 2.03.14 version +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +OPENEULER_REPO_NAME = "lvm2" + +DEPENDS += "libaio" + +PV = "2.03.18" + +OPENEULER_SRC_URI_REMOVE = "git" + +# remove open_embedded patch that not use +SRC_URI_remove = "file://0002-Guard-use-of-mallinfo-with-__GLIBC__.patch \ + file://0006-start-lvm2-monitor.service-after-tmp.mount.patch \ +" + +SRC_URI_prepend = "file://LVM2.${PV}.tgz \ + file://0001-lvm2-set-default-preferred_names.patch \ + file://0002-lvm2-default-allow-changes-with-duplicate-pvs.patch \ + file://0003-bugfix-lvm2-add-SSD.patch \ + file://0004-bugfix-add-timeout-when-fail-to-wait-udev.patch \ + file://0005-bugfix-fix-the-code-maybe-lead-to-buffer-over-bound-access.patch \ + file://0006-enhancement-modify-default-log-level-to-error-level.patch \ + file://0007-enhancement-add-dfx-log.patch \ + file://0008-enhancement-syslog-more-when-use-libdevmapper-so.patch \ + file://0009-enhancement-log-it-when-disk-slow.patch \ + file://0010-bugfix-lvm2-fix-the-reuse-of-va_list.patch \ + file://0011-13-dm-disk.rules-check-DM_NAME-before-create-symlink.patch \ + file://0012-lvm-code-reduce-cyclomatic-complexity.patch \ +" + +SRC_URI[sha256sum] = "4a63bc8a084a8ae3c7bc5e6530cac264139d218575c64416c8b99e3fe039a05c" + +S = "${WORKDIR}/LVM2.${PV}" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/lvm2_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/lvm2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..8205e5c8d42760c2c6a8a150b10739c42fbc6c74 --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/lvm2/lvm2_%.bbappend @@ -0,0 +1,13 @@ +# main bbfile: meta-oe/recipes-support/lvm2/lvm2_2.03.11.bb?h=hardknott + +require lvm2-src.inc + +# remove strong dependence on udev, use condition statements to decide whether to depend udev +# keep the same as before +# use PACKAGECONFIG instead of LVM2_PACKAGECONFIG +LVM2_PACKAGECONFIG_remove_class-target = " \ + udev \ +" +PACKAGECONFIG_append_class-target = " \ + ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'udev', '', d)} \ +" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/spdlog/spdlog_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/spdlog/spdlog_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d15f13ebdd4079478b2119d55568a7e56a7ced7b --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/spdlog/spdlog_%.bbappend @@ -0,0 +1,16 @@ +# main bbfile: yocto-meta-openembedded/meta-oe/recipes-support/spdlog/spdlog_1.8.2.bb + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_URL = "https://gitee.com/openeuler" + +PV = "1.11.0" + +S = "${WORKDIR}/spdlog-${PV}" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = "git://github.com/gabime/spdlog.git;protocol=https;branch=v1.x; " + +SRC_URI += "file://${OPENEULER_LOCAL_NAME}/ros_depends/spdlog/v${PV}.tar.gz " + diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/uthash/uthash_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/uthash/uthash_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..654e46506490237bb0b8f0ed528f146a8a63a2f1 --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-support/uthash/uthash_%.bbappend @@ -0,0 +1,14 @@ +# main bbfile: meta-oe/recipes-support/uthash/uthash_2.3.0.bb?h=hardknott + +PV = "2.1.0" + +# modify LICENSE checksum +LIC_FILES_CHKSUM = "file://LICENSE;md5=a2513f7d2291df840527b76b2a8f9718" + +OPENEULER_SRC_URI_REMOVE = "git" + +SRC_URI_prepend = " \ + file://v${PV}.tar.gz \ +" + +S = "${WORKDIR}/uthash-${PV}" diff --git a/meta-openeuler/dynamic-layers/openembedded-layer/recipes-test/googletest/googletest_%.bbappend b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-test/googletest/googletest_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..1cd8b7720a236e8dbefd615c526f4ec567800eff --- /dev/null +++ b/meta-openeuler/dynamic-layers/openembedded-layer/recipes-test/googletest/googletest_%.bbappend @@ -0,0 +1,17 @@ +# main bbfile: yocto-meta-openembedded/meta-oe/recipes-test/googletest/googletest_git.bb + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_URL = "https://gitee.com/openeuler" + +# version in openEuler +PV = "1.10.0" + +S = "${WORKDIR}/googletest-release-${PV}" +SRC_URI_remove = " \ + git://github.com/google/googletest.git;branch=main;protocol=https \ + " + +SRC_URI += "file://${OPENEULER_LOCAL_NAME}/ros_depends/googletest/release-${PV}.tar.gz " + diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/helloworld-gui/helloworld-gui-1.5.tar.gz b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/helloworld-gui/helloworld-gui-1.5.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3a743729840f8da590b4acf6e58730cce7892f25 Binary files /dev/null and b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/helloworld-gui/helloworld-gui-1.5.tar.gz differ diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/helloworld-gui_1.5.bb b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/helloworld-gui_1.5.bb new file mode 100644 index 0000000000000000000000000000000000000000..b70a162e9ed8a9533488e8546d18332bf4ca70ae --- /dev/null +++ b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/helloworld-gui_1.5.bb @@ -0,0 +1,26 @@ +SUMMARY = "Qt5 Hello World Test Application" +DESCRIPTION = "This application is used to test GUI rendering \ +in a simple QWindow, plus displaying message box." +HOMEPAGE = "https://github.com/enjoysoftware/helloworld-gui" +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=86da1ce4d01bf33d04fb4d4b88fefe03" + +DEPENDS = "qtbase qttools-native" + +# Depends on gles2 enabled and that's not default configuration +EXCLUDE_FROM_WORLD = "1" + +SRC_URI = "file://${BP}.tar.gz" + +S = "${WORKDIR}/${BP}" + +inherit qmake5 + +# fix error: xxx/recipe-sysroot/usr/bin/lrelease: No such file or directory +do_prepare_lrelease() { + ln -s ${STAGING_BINDIR_NATIVE}/lrelease ${STAGING_BINDIR}/lrelease +} + +do_prepare_recipe_sysroot[postfuncs] += "do_prepare_lrelease" + +FILES_${PN} += "/usr/local/*" diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/qt5-opengles2-test/qt5-opengles2-test-1.0.4.tar.gz b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/qt5-opengles2-test/qt5-opengles2-test-1.0.4.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..aec70b35a7b3abe690ba3a22b2fa2229beee6d6c Binary files /dev/null and b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/qt5-opengles2-test/qt5-opengles2-test-1.0.4.tar.gz differ diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/qt5-opengles2-test_%.bbappend b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/qt5-opengles2-test_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..db6897eff342e788aa915d65ef8077f29707812a --- /dev/null +++ b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/examples/qt5-opengles2-test_%.bbappend @@ -0,0 +1,10 @@ +PV = "1.0.4" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" + +LIC_FILES_CHKSUM_remove = "file://${WORKDIR}/git/main.cpp;beginline=1;endline=26;md5=93b83ece006c9e76b9fca80c3aecb169" +LIC_FILES_CHKSUM_prepend = "file://main.cpp;beginline=1;endline=26;md5=93b83ece006c9e76b9fca80c3aecb169" + +SRC_URI = "file://${BP}.tar.gz" + +S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/packagegroups/packagegroup-base.bbappend b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/packagegroups/packagegroup-base.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..521571f691af3d99dc6d401cb3abdd33daf463a9 --- /dev/null +++ b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/packagegroups/packagegroup-base.bbappend @@ -0,0 +1,8 @@ +RDEPENDS_packagegroup-base-extended_append = " \ +weston \ +qtwayland \ +qtbase \ +kmscube \ +qt5-opengles2-test \ +helloworld-gui \ +" diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qt5-src.inc b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qt5-src.inc new file mode 100644 index 0000000000000000000000000000000000000000..838af844c47d40060de842952ae945f7578fbdb3 --- /dev/null +++ b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qt5-src.inc @@ -0,0 +1,17 @@ +# main bbfile: meta-qt5/recipes-qt/qt5/${BPN}_git.bb + +OPENEULER_REPO_NAME = "qt5-${BPN}" + +PV = "5.15.2" + +SRC_URI_prepend = "file://${BPN}-everywhere-src-${PV}.tar.xz \ +" + +# Use the source packages from src-openEuler, remove patch conflict with openeuler +SRC_URI_remove = " \ + ${QT_GIT}/${QT_MODULE}.git;name=${QT_MODULE};${QT_MODULE_BRANCH_PARAM};protocol=${QT_GIT_PROTOCOL} \ +" + +# yocto-poky specifies 'S = "${WORKDIR}/git', but since we are using the src-openEuler source package, +# we need to re-specify it +S = "${WORKDIR}/${BPN}-everywhere-src-${PV}" diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase-native_%.bbappend b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase-native_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..eec429a6081767aba2107ff028f9f1b31e6d49d2 --- /dev/null +++ b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase-native_%.bbappend @@ -0,0 +1,21 @@ +require qt5-src.inc + +SRC_URI_prepend = "file://tell-the-truth-about-private-api.patch \ + file://qtbase-opensource-src-5.8.0-QT_VERSION_CHECK.patch \ + file://qtbase-opensource-src-5.7.1-moc_macros.patch \ + file://qtbase-everywhere-src-5.12.1-qt5gui_cmake_isystem_includes.patch \ + file://qtbase-qmake_LFLAGS.patch \ + file://qtbase-everywhere-src-5.14.2-no_relocatable.patch \ + file://qt5-qtbase-cxxflag.patch \ + file://qt5-qtbase-5.12.1-firebird.patch \ + file://qtbase-opensource-src-5.9.0-mysql.patch \ + file://qtbase-everywhere-src-5.11.1-python3.patch \ + file://qtbase-use-wayland-on-gnome.patch \ + file://qt5-qtbase-gcc11.patch \ + file://qtbase-QTBUG-90395.patch \ + file://qtbase-QTBUG-89977.patch \ + file://qtbase-QTBUG-91909.patch \ + file://0001-modify-kwin_5.18-complier-error.patch \ + file://CVE-2021-38593.patch \ + file://CVE-2022-25255.patch \ + " diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..66a472064eaa2266a1a0f9e1d28513fd217eab37 --- /dev/null +++ b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtbase_%.bbappend @@ -0,0 +1,22 @@ +# main bbfile: meta-qt5/recipes-qt/qt5/qtbase_git.bb +require qt5-src.inc + +SRC_URI_prepend = "file://tell-the-truth-about-private-api.patch \ + file://qtbase-opensource-src-5.8.0-QT_VERSION_CHECK.patch \ + file://qtbase-opensource-src-5.7.1-moc_macros.patch \ + file://qtbase-everywhere-src-5.12.1-qt5gui_cmake_isystem_includes.patch \ + file://qtbase-qmake_LFLAGS.patch \ + file://qtbase-everywhere-src-5.14.2-no_relocatable.patch \ + file://qt5-qtbase-cxxflag.patch \ + file://qt5-qtbase-5.12.1-firebird.patch \ + file://qtbase-opensource-src-5.9.0-mysql.patch \ + file://qtbase-everywhere-src-5.11.1-python3.patch \ + file://qtbase-use-wayland-on-gnome.patch \ + file://qt5-qtbase-gcc11.patch \ + file://qtbase-QTBUG-90395.patch \ + file://qtbase-QTBUG-89977.patch \ + file://qtbase-QTBUG-91909.patch \ + file://0001-modify-kwin_5.18-complier-error.patch \ + file://CVE-2021-38593.patch \ + file://CVE-2022-25255.patch \ + " diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtdeclarative_%.bbappend b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtdeclarative_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..5b20c2e3bd83e6bd3835e0b5f62fa06f9c2b5e18 --- /dev/null +++ b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtdeclarative_%.bbappend @@ -0,0 +1,29 @@ +require qt5-src.inc + +SRC_URI_prepend = "file://0005-QQuickView-docs-show-correct-usage-of-setInitialProp.patch \ + file://0006-QQuickWindow-Check-if-QQuickItem-was-not-deleted.patch \ + file://0007-Avoid-GHS-linker-to-optimize-away-QML-type-registrat.patch \ + file://0008-QML-Text-doesn-t-reset-lineCount-when-text-is-empty.patch \ + file://0009-Doc-mention-that-INCLUDEPATH-must-be-set-in-some-cas.patch \ + file://0010-qmlfunctions.qdoc-Add-clarification-to-QML_FOREIGN.patch \ + file://0011-Fix-QML-property-cache-leaks-of-delegate-items.patch \ + file://0012-QQuickTextInput-Store-mask-data-in-std-unique_ptr.patch \ + file://0013-Fix-crash-when-calling-hasOwnProperty-on-proxy-objec.patch \ + file://0014-Accessibility-event-is-sent-on-item-s-geometry-chang.patch \ + file://0015-qmltypes.prf-Take-abi-into-account-for-_metatypes.js.patch \ + file://0016-qv4qmlcontext-Fix-bounded-signal-expressions-when-de.patch \ + file://0017-Use-load-qt_tool-for-qmltime.patch \ + file://0018-qqmlistmodel-Fix-crash-when-modelCache-is-null.patch \ + file://0019-Show-a-tableview-even-if-the-syncView-has-an-empty-m.patch \ + file://0020-DesignerSupport-Don-t-skip-already-inspected-objects.patch \ + file://0021-QML-Fix-proxy-iteration.patch \ + file://0022-Fix-IC-properties-in-same-file.patch \ + file://0023-JIT-When-making-memory-writable-include-the-exceptio.patch \ + file://0024-doc-explain-QQItem-event-delivery-handlers-setAccept.patch \ + file://0025-Give-a-warning-when-StyledText-encounters-a-non-supp.patch \ + file://0026-Add-missing-limits-include-to-fix-build-with-GCC-11.patch \ + file://0027-Document-that-StyledText-also-supports-nbsp-and-quot.patch \ + file://0028-Support-apos-in-styled-text.patch \ + file://qt5-qtdeclarative-gcc11.patch \ + file://qtdeclarative-5.15.0-FixMaxXMaxYExtent.patch \ + " diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtsensors_%.bbappend b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtsensors_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..25048d1eeb7e5d995ea0c1915d704515d38ea300 --- /dev/null +++ b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtsensors_%.bbappend @@ -0,0 +1 @@ +require qt5-src.inc diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qttools_%.bbappend b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qttools_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..62c7b5f45159730eae87caf6a7861f64aa3733a2 --- /dev/null +++ b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qttools_%.bbappend @@ -0,0 +1,7 @@ +require qt5-src.inc + +SRC_URI_prepend = "file://qttools-opensource-src-5.13.2-runqttools-with-qt5-suffix.patch \ + file://qttools-opensource-src-5.7-add-libatomic.patch \ + file://0001-Link-against-libclang-cpp.so-instead-of-the-clang-co.patch \ + file://0001-modify-lupdate-qt5-run-error.patch \ + " diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..1d9764767227fa85ec05b7fb301158ee53de7c6d --- /dev/null +++ b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtwayland_%.bbappend @@ -0,0 +1,32 @@ +require qt5-src.inc + +SRC_URI_prepend = "file://0005-Scanner-Avoid-accessing-dangling-pointers-in-destroy.patch \ + file://0006-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch \ + file://0007-Do-not-try-to-eglMakeCurrent-for-unintended-case.patch \ + file://0008-Make-setting-QT_SCALE_FACTOR-work-on-Wayland.patch \ + file://0009-Ensure-that-grabbing-is-performed-in-correct-context.patch \ + file://0010-Fix-leaked-subsurface-wayland-items.patch \ + file://0011-Use-qWarning-and-_exit-instead-of-qFatal-for-wayland.patch \ + file://0012-Fix-memory-leak-in-QWaylandGLContext.patch \ + file://0013-Client-Send-set_window_geometry-only-once-configured.patch \ + file://0014-Translate-opaque-area-with-frame-margins.patch \ + file://0015-Client-Send-exposeEvent-to-parent-on-subsurface-posi.patch \ + file://0016-Get-correct-decoration-margins-region.patch \ + file://0017-xdgshell-Tell-the-compositor-the-screen-we-re-expect.patch \ + file://0018-Fix-compilation.patch \ + file://0019-client-Allow-QWaylandInputContext-to-accept-composed.patch \ + file://0020-Client-Announce-an-output-after-receiving-more-compl.patch \ + file://0021-Fix-issue-with-repeated-window-size-changes.patch \ + file://0022-Include-locale.h-for-setlocale-LC_CTYPE.patch \ + file://0023-Client-Connect-drags-being-accepted-to-updating-the-.patch \ + file://0024-Client-Disconnect-registry-listener-on-destruction.patch \ + file://0025-Client-Set-XdgShell-size-hints-before-the-first-comm.patch \ + file://0026-Fix-build.patch \ + file://0027-Fix-remove-listener.patch \ + file://0028-Hook-up-queryKeyboardModifers.patch \ + file://0029-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch \ + file://0030-Correctly-detect-if-image-format-is-supported-by-QIm.patch \ + file://qtwayland-client-expose-toplevel-window-state.patch \ + file://qtwayland-client-use-wl-keyboard-to-determine-active-state.patch \ + file://qtwayland-client-do-not-empty-clipboard-when-new-popup-or-window-is-opened.patch \ + " diff --git a/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtxmlpatterns_%.bbappend b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtxmlpatterns_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..25048d1eeb7e5d995ea0c1915d704515d38ea300 --- /dev/null +++ b/meta-openeuler/dynamic-layers/qt5-layer/recipes-qt/qt5/qtxmlpatterns_%.bbappend @@ -0,0 +1 @@ +require qt5-src.inc diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-core/images/openeuler-image-ros.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-core/images/openeuler-image-ros.bb new file mode 100644 index 0000000000000000000000000000000000000000..28c005dc6de6b72463f2031679858bbef10c393a --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-core/images/openeuler-image-ros.bb @@ -0,0 +1,37 @@ + +# build an iso image, the live-os uses openeuler-image-live, it must be the same as itself(openeuler-image) +# when LIVE_ROOTFS_TYPE defined, bug may come out in poky, so just use default value ext4 in image-live.bbclass. +# notice we need MACHINE_FEATURES += "efi" in machine conf +IMAGE_FSTYPES_append_aarch64 += " iso " +IMAGE_FSTYPES_append_x86-64 += " iso " +IMAGE_FSTYPES_remove_raspberrypi4 += " iso " +INITRD_IMAGE_LIVE = "openeuler-image-live" + +# notice: IMAGE_FEATURE configs such as IMAGE_FSTYPES should be defined before openeuler-image-common.inc(before core-image and image.bbclass) +require recipes-core/images/openeuler-image-common.inc +# package sdk +require recipes-core/images/openeuler-image-sdk.inc + +# packages added to rootfs and target sdk +# put packages allowing a device to boot into "packagegroup-core-boot" +# put standard base packages to "packagegroup-core-base-utils" +# put extra base packages to "packagegroup-base" +# put extended packages to "packagegroup-base-extended" +# put other class of packages to "packagegroup-xxx" +# Notice: IMAGE_INSTALL should define after openeuler-image-common.inc(after core-image\image.bbclass) +IMAGE_INSTALL += " \ +packagegroup-core-boot \ +packagegroup-core-base-utils \ +packagegroup-core-tools-debug \ +packagegroup-base \ +packagegroup-base-extended \ +packagegroup-openssh \ +packagegroup-kernel-modules \ +packagegroup-isulad \ +packagegroup-roscore \ +" +# current qemu can't support ros slam demo + +# You can add extra user here, suck like: +# inherit extrausers +# EXTRA_USERS_PARAMS = "useradd -p '' openeuler;" diff --git a/meta-openeuler/recipes-core/packagegroups/packagegroup-debugtools.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-core/packagegroups/packagegroup-roscore.bb similarity index 34% rename from meta-openeuler/recipes-core/packagegroups/packagegroup-debugtools.bb rename to meta-openeuler/dynamic-layers/ros2-layer/recipes-core/packagegroups/packagegroup-roscore.bb index 708d0c6b8627dc5778b3b82f46031b76b825e36e..a2e8db5dfbbbd10cc1c5660870362e59f1db3b5f 100644 --- a/meta-openeuler/recipes-core/packagegroups/packagegroup-debugtools.bb +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-core/packagegroups/packagegroup-roscore.bb @@ -1,10 +1,11 @@ -SUMMARY = "Debugging tools" -inherit packagegroup - +SUMMARY = "ros2 pkgs of ros-core and base demo" PR = "r1" +inherit packagegroup + PACKAGES = "${PN}" -RDEPENDS_${PN} = "\ - strace \ - " +RDEPENDS_${PN} = " \ +ros-core \ +demo-nodes-cpp \ +" diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-core/packagegroups/packagegroup-rosslam.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-core/packagegroups/packagegroup-rosslam.bb new file mode 100644 index 0000000000000000000000000000000000000000..2a1b4d84d54306057b4ac7b03289082cc2530781 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-core/packagegroups/packagegroup-rosslam.bb @@ -0,0 +1,20 @@ +SUMMARY = "ros2 pkgs to support originbot slam" +PR = "r1" + +inherit packagegroup + +PACKAGES = "${PN}" + +RDEPENDS_${PN} = " \ +ros-core \ +demo-nodes-cpp \ +originbot-navigation \ +originbot-bringup \ +originbot-msgs \ +originbot-base \ +originbot-teleop \ +send-goal \ +ydlidar-ros2-driver \ +cartographer-ros \ +nav2-bringup \ +" diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/bullet/bullet_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/bullet/bullet_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e28106e9c6f7f5c9ae3326df0f244f60a35c2660 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/bullet/bullet_%.bbappend @@ -0,0 +1,2 @@ +inherit openeuler_ros_source + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/cartographer-ros/cartographer-ros_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/cartographer-ros/cartographer-ros_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..4cb2a73f6ffd7fa245395248a5d9387bcb61a255 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/cartographer-ros/cartographer-ros_%.bbappend @@ -0,0 +1,2 @@ +ROS_EXEC_DEPENDS:remove += "yaml-cpp" +ROS_EXPORT_DEPENDS:remove += "yaml-cpp" diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/consle-bridge/console-bridge_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/consle-bridge/console-bridge_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ed5aeaf23a64803e68bd8f2e3b7681bb84f6f901 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/consle-bridge/console-bridge_%.bbappend @@ -0,0 +1 @@ +inherit openeuler_ros_source diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0001-Fix-README.patch b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0001-Fix-README.patch new file mode 100644 index 0000000000000000000000000000000000000000..45c3600c073457faab0794a750730e4a66c1b245 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0001-Fix-README.patch @@ -0,0 +1,51 @@ +From b975994886e81ad87806ae798d784866d2820528 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonathan=20M=C3=BCller?= +Date: Wed, 23 Oct 2019 14:43:11 +0200 +Subject: [PATCH 1/5] Fix README + +--- + README.md | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/README.md b/README.md +index 13e5629..637b3d6 100644 +--- a/README.md ++++ b/README.md +@@ -4,7 +4,7 @@ + [![Build Status](https://travis-ci.org/foonathan/memory.svg?branch=master)](https://travis-ci.org/foonathan/memory) [![Build status](https://ci.appveyor.com/api/projects/status/ef654yqyoqgvl472/branch/master?svg=true)](https://ci.appveyor.com/project/foonathan/memory/branch/master) [![License: Zlib](https://img.shields.io/badge/License-Zlib-lightgrey.svg)](https://opensource.org/licenses/Zlib) + + The C++ STL allocator model has various flaws. For example, they are fixed to a certain type, because they are almost necessarily required to be templates. So you can't easily share a single allocator for multiple types. In addition, you can only get a copy from the containers and not the original allocator object. At least with C++11 they are allowed to be stateful and so can be made object not instance based. But still, the model has many flaws. +-Over the course of the years many solutions have been proposed. for example [EASTL]. This library is another. But instead of trying to change the STL, it works with the current implementation. ++Over the course of the years many solutions have been proposed, for example [EASTL]. This library is another. But instead of trying to change the STL, it works with the current implementation. + + [![Patreon](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://patreon.com/foonathan) + +@@ -184,13 +184,13 @@ To use an installed library: + + 5. Call `target_link_libraries(your_target PUBLIC foonathan_memory)` to link to the library and setup all required options. + +-See http://foonathan.github.io/doc/memory/md_doc_installation.html for a detailed guide. ++See https://foonathan.net/memory/md_doc_installation.html for a detailed guide. + + ## Documentation + +-Full documentation can be found at http://foonathan.github.io/doc/memory. ++Full documentation can be found at https://foonathan.net/memory. + +-A tutorial is also available at http://foonathan.github.io/doc/memory/md_doc_tutorial.html. ++A tutorial is also available at https://foonathan.net/memory/md_doc_tutorial.html. + + ## RawAllocator + +@@ -214,7 +214,7 @@ struct raw_allocator + ``` + + A `RawAllocator` only needs to be moveable, all `Allocator` classes are `RawAllocators` too. +-Classes not providing the interface can specialize the `allocator_traits`, read more about [writing allocators here](http://foonathan.github.io/doc/memory/md_doc_writing_allocators.html) or about the technical details of the [concept here](http://foonathan.github.io/doc/memory/md_doc_concepts.html). ++Classes not providing the interface can specialize the `allocator_traits`, read more about [writing allocators here](https://foonathan.net/memory/md_doc_writing_allocators.html) or about the technical details of the [concept here](https://foonathan.net/memory/md_doc_concepts.html). + + ## Acknowledgements + +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0002-Fix-compile-error-with-container.hpp-when-FOONATHAN_.patch b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0002-Fix-compile-error-with-container.hpp-when-FOONATHAN_.patch new file mode 100644 index 0000000000000000000000000000000000000000..a00a194a2ad4111c9c5bf7c2b3b6fb216c5f16df --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0002-Fix-compile-error-with-container.hpp-when-FOONATHAN_.patch @@ -0,0 +1,33 @@ +From 219213a7d2c4e5c811a52ed152baf938b52f4565 Mon Sep 17 00:00:00 2001 +From: wtsnyder <28737065+wtsnyder@users.noreply.github.com> +Date: Fri, 15 Nov 2019 15:20:49 -0500 +Subject: [PATCH 2/5] Fix compile error with container.hpp when + FOONATHAN_MEMORY_NO_NODE_SIZE is set (#59) + +--- + include/foonathan/memory/container.hpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/foonathan/memory/container.hpp b/include/foonathan/memory/container.hpp +index ac70535..0cf7111 100644 +--- a/include/foonathan/memory/container.hpp ++++ b/include/foonathan/memory/container.hpp +@@ -368,6 +368,7 @@ namespace foonathan + /// @} + #endif + ++#if !defined(FOONATHAN_MEMORY_NO_NODE_SIZE) + /// The node size required by \ref allocate_shared. + /// \note This is similar to \ref shared_ptr_node_size but takes a + /// \concept{concept_rawallocator,RawAllocator} instead. +@@ -376,6 +377,7 @@ namespace foonathan + : shared_ptr_node_size> + { + }; ++#endif + } // namespace memory + } // namespace foonathan + +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0003-Propose-to-use-the-FHS-layout-on-Windows-build.-58.patch b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0003-Propose-to-use-the-FHS-layout-on-Windows-build.-58.patch new file mode 100644 index 0000000000000000000000000000000000000000..6c3301474bc934411c236a2a6d27c1d18e93b93d --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0003-Propose-to-use-the-FHS-layout-on-Windows-build.-58.patch @@ -0,0 +1,28 @@ +From 5e6173cf778dfcfbf3e95c3a6d23aab919270c4b Mon Sep 17 00:00:00 2001 +From: Sean Yen +Date: Fri, 15 Nov 2019 12:25:28 -0800 +Subject: [PATCH 3/5] Propose to use the FHS layout on Windows build. (#58) + +Nowadays many package system on Windows adopts [FHS](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard)-like layout, for example, `vcpkg`, `conda`, or `conan`. I proposed to make the installed layout more friendly to FHS even for Windows build. +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f28a45d..edc8e54 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,8 +40,8 @@ elseif(WIN32) + set(FOONATHAN_MEMORY_ARCHIVE_INSTALL_DIR "lib") + set(FOONATHAN_MEMORY_FRAMEWORK_INSTALL_DIR "bin") + +- set(FOONATHAN_MEMORY_CMAKE_CONFIG_INSTALL_DIR "cmake") +- set(FOONATHAN_MEMORY_ADDITIONAL_FILES_INSTALL_DIR "./") ++ set(FOONATHAN_MEMORY_CMAKE_CONFIG_INSTALL_DIR "share/foonathan_memory/cmake") ++ set(FOONATHAN_MEMORY_ADDITIONAL_FILES_INSTALL_DIR "share/foonathan_memory") + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + else() + message(FATAL_ERROR "Could not set install folders for this platform!") +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0004-Fix-cmake-crosscompiling-60.patch b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0004-Fix-cmake-crosscompiling-60.patch new file mode 100644 index 0000000000000000000000000000000000000000..0fbf27a26dfdbf5b2c763b331f0e8382ef45ecc8 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0004-Fix-cmake-crosscompiling-60.patch @@ -0,0 +1,47 @@ +From 06bf8d258bd41daa6efb56c4cb62cc105674a96f Mon Sep 17 00:00:00 2001 +From: wtsnyder <28737065+wtsnyder@users.noreply.github.com> +Date: Mon, 18 Nov 2019 10:48:26 -0500 +Subject: [PATCH 4/5] Fix cmake crosscompiling (#60) + +Allow the nodesize_dbg tool to be built when crosscompiling. Link it statically to avoid anoying library search paths then use the crosscompiling emulator to run it to generate container_node_sizes_impl during the build. + +Fixes #61. +--- + src/CMakeLists.txt | 4 ++-- + tool/CMakeLists.txt | 4 ++++ + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index f7cedb6..963c85d 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -77,9 +77,9 @@ set(src + configure_file("config.hpp.in" "${CMAKE_CURRENT_BINARY_DIR}/config_impl.hpp") + + # generate container_node_sizes.hpp +-if(FOONATHAN_MEMORY_BUILD_TOOLS AND (NOT CMAKE_CROSSCOMPILING)) ++if(FOONATHAN_MEMORY_BUILD_TOOLS) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/container_node_sizes_impl.hpp +- COMMAND foonathan_memory_node_size_debugger --code --alignof "FOONATHAN_ALIGNOF(T)" ${CMAKE_CURRENT_BINARY_DIR}/container_node_sizes_impl.hpp ++ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ --code --alignof "FOONATHAN_ALIGNOF(T)" ${CMAKE_CURRENT_BINARY_DIR}/container_node_sizes_impl.hpp + DEPENDS foonathan_memory_node_size_debugger + VERBATIM) + else() +diff --git a/tool/CMakeLists.txt b/tool/CMakeLists.txt +index 6254e3e..e126976 100644 +--- a/tool/CMakeLists.txt ++++ b/tool/CMakeLists.txt +@@ -5,6 +5,10 @@ + # builds tools + + add_executable(foonathan_memory_node_size_debugger test_types.hpp node_size_debugger.hpp node_size_debugger.cpp) ++if (CMAKE_CROSSCOMPILING) ++ # statically link when cross compiling so emulator doesn't need library paths ++ set_target_properties(foonathan_memory_node_size_debugger PROPERTIES LINK_FLAGS "-static") ++endif() + _foonathan_use_comp(foonathan_memory_node_size_debugger) + comp_target_features(foonathan_memory_node_size_debugger PUBLIC CPP11) + if (MSVC) +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0005-Add-funding.patch b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0005-Add-funding.patch new file mode 100644 index 0000000000000000000000000000000000000000..72760060e0118ed6dd50e8ad023798fcf077e729 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/files/0005-Add-funding.patch @@ -0,0 +1,38 @@ +From 8f6a027d473f9b4796509158962d8ddf89fbe086 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonathan=20M=C3=BCller?= +Date: Wed, 20 Nov 2019 15:24:09 +0100 +Subject: [PATCH 5/5] Add funding + +--- + .github/FUNDING.yml | 3 +++ + README.md | 4 +--- + 2 files changed, 4 insertions(+), 3 deletions(-) + create mode 100644 .github/FUNDING.yml + +diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml +new file mode 100644 +index 0000000..47c85de +--- /dev/null ++++ b/.github/FUNDING.yml +@@ -0,0 +1,3 @@ ++patreon: foonathan ++custom: ['https://jonathanmueller.dev/support-me/'] ++ +diff --git a/README.md b/README.md +index 637b3d6..d0e179b 100644 +--- a/README.md ++++ b/README.md +@@ -6,9 +6,7 @@ + The C++ STL allocator model has various flaws. For example, they are fixed to a certain type, because they are almost necessarily required to be templates. So you can't easily share a single allocator for multiple types. In addition, you can only get a copy from the containers and not the original allocator object. At least with C++11 they are allowed to be stateful and so can be made object not instance based. But still, the model has many flaws. + Over the course of the years many solutions have been proposed, for example [EASTL]. This library is another. But instead of trying to change the STL, it works with the current implementation. + +-[![Patreon](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://patreon.com/foonathan) +- +-If you like this project, consider supporting me on Patreon. ++If you like this project, consider [supporting me](https://jonathanmueller.dev/support-me/). + It would really help! + + ## Features +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/foonathan-memory_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/foonathan-memory_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..91b152cc414a368c392d64e01fb5baaaf31278b1 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/foonathan-memory/foonathan-memory_%.bbappend @@ -0,0 +1,16 @@ +# main bbfile: yocto-meta-ros/meta-ros2/recipes-devtools/foonathan-memory/foonathan-memory_git.bb +inherit openeuler_ros_source + +PV = "0.6-2" + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +# from memory git, release 0.6-2 tag(we used) to 8f6a027d473f9b47965 (foonathan-memory in SRCREV_main) have 0001~0005 patches, so apply it +SRC_URI += " \ + file://0001-Fix-README.patch \ + file://0002-Fix-compile-error-with-container.hpp-when-FOONATHAN_.patch \ + file://0003-Propose-to-use-the-FHS-layout-on-Windows-build.-58.patch \ + file://0004-Fix-cmake-crosscompiling-60.patch \ + file://0005-Add-funding.patch \ + " + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/graphicsmagick/graphicsmagick_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/graphicsmagick/graphicsmagick_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..fdcd4a2725b83a1e4b6d85fc825eedf4f717809f --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/graphicsmagick/graphicsmagick_%.bbappend @@ -0,0 +1,28 @@ +#main bbfile: yocto-meta-ros/meta-ros2/recipes-devtools/graphicsmagick/graphicsmagick_1.3.33.bb +OPENEULER_SRC_URI_REMOVE = "https git" +OPENEULER_REPO_NAME = "GraphicsMagick" +OPENEULER_BRANCH = "master" + +LIC_FILES_CHKSUM = "file://Copyright.txt;md5=d46c64029c86acbab3a4deffc237d406" + +# version in openEuler +PV = "1.3.38" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove += " \ + ${SOURCEFORGE_MIRROR}/${BPN}/GraphicsMagick-${PV}.tar.bz2 \ + " + +# files, patches that come from openeuler +SRC_URI_prepend = " \ + file://GraphicsMagick-${PV}.tar.xz \ + file://GraphicsMagick-1.3.16-multilib.patch \ + file://GraphicsMagick-1.3.31-perl_linkage.patch \ +" + +SRC_URI[md5sum] = "9a5978427c3841711f470e15343ca71f" +SRC_URI[sha256sum] = "d60cd9db59351d2b9cb19beb443170acaa28f073d13d258f67b3627635e32675" + +FILES:${PN}:remove += "${datadir}/GraphicsMagick-1.3.33/config ${libdir}/GraphicsMagick-1.3.33/config" +FILES:${PN} += "${datadir}/GraphicsMagick-${PV}/config ${libdir}/GraphicsMagick-${PV}/config" + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/libflann/libflann_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/libflann/libflann_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..08fadea337595378a2eb170ada4f04a2732dd4f5 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/libflann/libflann_%.bbappend @@ -0,0 +1,5 @@ +inherit openeuler_ros_source + +# EXTRA_OECMAKE += "-UPYTHON_EXECUTABLE" is not work in meta-ros-common/recipes-extended/libflann/libflann_1.9.1.bb, fixed it. +EXTRA_OECMAKE_remove += "-UPYTHON_EXECUTABLE" +EXTRA_OECMAKE += " -DPYTHON_EXECUTABLE=0 " diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/opencv/opencv_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/opencv/opencv_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bdd5dd995862dce1f8cebaba5e1eed9ba08f9816 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/opencv/opencv_%.bbappend @@ -0,0 +1,14 @@ +# main bbfile: yocto-meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.5.2.bb + +PV = "4.5.2" + +OPENEULER_SRC_URI_REMOVE = "https git http" +OPENEULER_BRANCH = "master" +OPENEULER_REPO_NAME = "opencv" + +SRC_URI = "file://Fix-OpenCV-build-with-OpenEXR-before-2.2.0.patch \ + file://Fix_compilation_of_copy_assignment_operators_with_GCC.patch \ + file://Repair_clang_abi.patch \ + file://CVE-2022-0561_and_CVE-2022-0562.patch \ + file://CVE-2022-0908.patch \ + " diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/body-tracking_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/body-tracking_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..428987188bd119ca7031aa4842566dfc54d6d712 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/body-tracking_0.0.0.bb @@ -0,0 +1,67 @@ +# originbot-v1.0.2/originbot_deeplearning/body_tracking/body-tracking_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "body tracking" +AUTHOR = "kao.zhu" +SECTION = "devel" +LICENSE = "Apache-License-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=12c26a18c7f493fdc7e8a93b16b7c04f" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "body-tracking" + +ROS_BUILD_DEPENDS = " \ + ai-msgs \ + geometry-msgs \ + rclcpp \ + rclcpp-action \ + rosidl-default-rutime \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ + rosidl-default-generators-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = " \ + rosidl-default-rutime \ +" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_deeplearning/body_tracking" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/gesture-control_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/gesture-control_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..6cbc4600fdda1472c76084f517479a9331be64e0 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/gesture-control_0.0.0.bb @@ -0,0 +1,63 @@ +# originbot-v1.0.2/originbot_deeplearning/gesture_control/gesture-control_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "TODO: Package description" +AUTHOR = "zhukao" +SECTION = "devel" +LICENSE = "Apache-License-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=12c26a18c7f493fdc7e8a93b16b7c04f" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "gesture-control" + +ROS_BUILD_DEPENDS = " \ + ai-msgs \ + geometry-msgs \ + rclcpp \ + rclcpp-action \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_deeplearning/gesture_control" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/line-follower-perception_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/line-follower-perception_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..b309e67c5cdaf961af1dcb38545cbc73bcf3d4af --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/line-follower-perception_0.0.0.bb @@ -0,0 +1,65 @@ +# originbot-v1.0.2/originbot_deeplearning/line_follower_perception/line-follower-perception_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "TODO: Package description" +AUTHOR = "kairui" +SECTION = "devel" +LICENSE = "Apache-License-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=12c26a18c7f493fdc7e8a93b16b7c04f" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "line-follower-perception" + +ROS_BUILD_DEPENDS = " \ + ai-msgs \ + dnn-node \ + geometry-msgs \ + hbm-img-msgs \ + rclcpp \ + std-msgs \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_deeplearning/line_follower_perception" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-autonomous_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-autonomous_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..0a7cfd053e2770a00c051dacccea52e88ba29390 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-autonomous_0.0.0.bb @@ -0,0 +1,67 @@ +# originbot-v1.0.2/originbot_example/originbot_autonomous/originbot-autonomous_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "OriginBot Autonomous" +AUTHOR = "GuYueHome" +SECTION = "devel" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=3dce4ba60d7e51ec64f3c3dc18672dd3" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "originbot-autonomous" + +ROS_BUILD_DEPENDS = " \ + ament-index-cpp \ + qpoases-vendor \ + rclcpp \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ + ament-index-cpp-native \ + qpoases-vendor-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = " \ + ament-index-cpp \ + qpoases-vendor \ +" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_example/originbot_autonomous" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-base_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-base_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d5b3d6c4f96eb14505e04d6d2fc9412793636bb0 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-base_%.bbappend @@ -0,0 +1 @@ +FILES_${PN} += "/usr/share /usr/lib" diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-base_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-base_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..25b4a1cd9cf0db13d32f91b17b8986b298ed5ad9 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-base_0.0.0.bb @@ -0,0 +1,66 @@ +# originbot-v1.0.2/originbot_base/originbot-base_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "OriginBot base driver" +AUTHOR = "GuYueHome" +SECTION = "devel" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=3dce4ba60d7e51ec64f3c3dc18672dd3" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "originbot-base" + +ROS_BUILD_DEPENDS = " \ + geometry-msgs \ + nav-msgs \ + originbot-msgs \ + rclcpp \ + sensor-msgs \ + serial \ + tf2-ros \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_base" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-bringup_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-bringup_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..0f7eeaa756b703a6a0f5cd201d5068ebc176a47e --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-bringup_%.bbappend @@ -0,0 +1,13 @@ +ROS_BUILD_DEPENDS:remove += " \ + joy-linux \ + teleop-twist-joy \ +" + +FILES_${PN} += "/usr/share" + +do_configure_prepend_class-target() { + if [ -f ${S}/CMakeLists.txt ]; then + cat ${S}/CMakeLists.txt | grep "joy_linux" && sed -i 's:find_package(joy_linux REQUIRED)::g' ${S}/CMakeLists.txt + cat ${S}/CMakeLists.txt | grep "teleop_twist_joy" && sed -i 's:find_package(teleop_twist_joy REQUIRED)::g' ${S}/CMakeLists.txt + fi +} diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-bringup_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-bringup_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..afeb48268edaaeb8428effc2e345acb78ca2cd3f --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-bringup_0.0.0.bb @@ -0,0 +1,66 @@ +# originbot-v1.0.2/originbot_bringup/originbot-bringup_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "OriginBot bringup scripts" +AUTHOR = "GuYueHome" +SECTION = "devel" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=3dce4ba60d7e51ec64f3c3dc18672dd3" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "originbot-bringup" + +ROS_BUILD_DEPENDS = " \ + geometry-msgs \ + joy-linux \ + nav-msgs \ + rclcpp \ + sensor-msgs \ + teleop-twist-joy \ + tf2-ros \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_bringup" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-demo_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-demo_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..0d51b80be342a1bfb6bf80036c25db1341eb67a1 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-demo_0.0.0.bb @@ -0,0 +1,62 @@ +# originbot-v1.0.2/originbot_demo/originbot-demo_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "OriginBot Demo" +AUTHOR = "GuYueHome" +SECTION = "devel" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=3dce4ba60d7e51ec64f3c3dc18672dd3" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "originbot-demo" + +ROS_BUILD_DEPENDS = " \ + geometry-msgs \ + nav-msgs \ + originbot-msgs \ +" + +ROS_BUILDTOOL_DEPENDS = "" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-copyright \ + ament-flake8 \ + ament-pep257 \ + python3-pytest \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_demo" +ROS_BUILD_TYPE = "ament_python" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-linefollower_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-linefollower_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..0f814f7b254974778c02527a79d064b0fd4e3d43 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-linefollower_0.0.0.bb @@ -0,0 +1,63 @@ +# originbot-v1.0.2/originbot_linefollower/originbot-linefollower_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "originbot linefollower" +AUTHOR = "GuYueHome" +SECTION = "devel" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=3dce4ba60d7e51ec64f3c3dc18672dd3" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "originbot-linefollower" + +ROS_BUILD_DEPENDS = " \ + cv-bridge \ + geometry-msgs \ + originbot-msgs \ + sensor-msgs \ +" + +ROS_BUILDTOOL_DEPENDS = "" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-copyright \ + ament-flake8 \ + ament-pep257 \ + python3-pytest \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_linefollower" +ROS_BUILD_TYPE = "ament_python" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-msgs_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-msgs_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a294362b3aa3eb59b218f22ce94a25fe26548180 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-msgs_%.bbappend @@ -0,0 +1,17 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +ROS_BUILD_DEPENDS += " \ + std-msgs \ +" + +ROS_BUILDTOOL_DEPENDS += " \ + rosidl-default-generators-native \ + rosidl-typesupport-fastrtps-cpp-native \ + rosidl-typesupport-fastrtps-c-native \ +" + +ROS_EXEC_DEPENDS = " \ + std-msgs \ +" + +FILES_${PN} += "/usr/share" diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-msgs_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-msgs_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..4719ae9238cc76fc35ffa79458bfd3a0d4078012 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-msgs_0.0.0.bb @@ -0,0 +1,63 @@ +# originbot-v1.0.2/originbot_msgs/originbot-msgs_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "message for originbot base" +AUTHOR = "GuYueHome" +SECTION = "devel" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=3dce4ba60d7e51ec64f3c3dc18672dd3" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "originbot-msgs" + +ROS_BUILD_DEPENDS = " \ + rosidl-default-generators \ + rosidl-default-runtime \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = " \ + rosidl-default-runtime \ +" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_msgs" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-navigation_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-navigation_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7a943a3c21836ca0dd5caf9175e14792c914d257 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-navigation_%.bbappend @@ -0,0 +1,2 @@ +FILES_${PN} += "/usr/share /usr/lib" + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-navigation_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-navigation_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..8615e95c39fcd37877c10b2894b0fb87331e677b --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-navigation_0.0.0.bb @@ -0,0 +1,60 @@ +# originbot-v1.0.2/originbot_navigation/originbot-navigation_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "OriginBot slam and navigation function" +AUTHOR = "GuYueHome" +SECTION = "devel" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=3dce4ba60d7e51ec64f3c3dc18672dd3" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "originbot-navigation" + +ROS_BUILD_DEPENDS = " \ + nav2-bringup \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_navigation" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-teleop_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-teleop_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7a943a3c21836ca0dd5caf9175e14792c914d257 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-teleop_%.bbappend @@ -0,0 +1,2 @@ +FILES_${PN} += "/usr/share /usr/lib" + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-teleop_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-teleop_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..0e9487affa27fad2e6df5db964c9a1d407d6ffec --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/originbot-teleop_0.0.0.bb @@ -0,0 +1,61 @@ +# originbot-v1.0.2/originbot_example/originbot_teleop/originbot-teleop_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "OriginBot teleop" +AUTHOR = "GuYueHome" +SECTION = "devel" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=3dce4ba60d7e51ec64f3c3dc18672dd3" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "originbot-teleop" + +ROS_BUILD_DEPENDS = " \ + geometry-msgs \ + rclcpp \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_example/originbot_teleop" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/parking-search_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/parking-search_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..65b5ca021d209bdf155c64c662c11de4b1a9dfee --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/parking-search_0.0.0.bb @@ -0,0 +1,62 @@ +# originbot-v1.0.2/originbot_deeplearning/parking_search/parking-search_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "TODO: Package description" +AUTHOR = "chenzixi" +SECTION = "devel" +LICENSE = "Apache-License-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=12c26a18c7f493fdc7e8a93b16b7c04f" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "parking-search" + +ROS_BUILD_DEPENDS = " \ + ai-msgs \ + rclcpp \ + rclcpp-action \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_deeplearning/parking_search" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/play-football_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/play-football_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..0faf7d0299832e6a08630a579c319d506ff0a884 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/play-football_0.0.0.bb @@ -0,0 +1,69 @@ +# originbot-v1.0.2/originbot_deeplearning/play_football/play-football_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "playfootball_node" +AUTHOR = "zhukao" +SECTION = "devel" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=3dce4ba60d7e51ec64f3c3dc18672dd3" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "play-football" + +ROS_BUILD_DEPENDS = " \ + ai-msgs \ + dnn-node \ + geometry-msgs \ + hbm-img-msgs \ + hobot-cv \ + nav2-msgs \ + rclcpp \ + rclcpp-action \ + rclcpp-components \ + sensor-msgs \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_deeplearning/play_football" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/send-goal_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/send-goal_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..be680de0a825b7110fa4fed92c2a8479dfb97e03 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/send-goal_%.bbappend @@ -0,0 +1,9 @@ +ROS_BUILD_DEPENDS += " \ + rclcpp \ + rclcpp-action \ + rclcpp-components \ + nav2-msgs \ +" + +FILES_${PN} += "/usr/share /usr/lib" + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/send-goal_0.0.0.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/send-goal_0.0.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..acd3ec18aa247f958500b6ec930e8b81b3679318 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/send-goal_0.0.0.bb @@ -0,0 +1,58 @@ +# originbot-v1.0.2/originbot_navigation/send_goal/send-goal_0.0.0.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = "send_goal" +AUTHOR = "zhukao" +SECTION = "devel" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=3dce4ba60d7e51ec64f3c3dc18672dd3" + +ROS_CN = "" +PV = "0.0.0" +ROS_BPN = "send-goal" + +ROS_BUILD_DEPENDS = "" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_navigation/send_goal" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/serial_1.2.1.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/serial_1.2.1.bb new file mode 100644 index 0000000000000000000000000000000000000000..7937a2460ef213d56984bb1f26ae502eaf8cafc7 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/serial_1.2.1.bb @@ -0,0 +1,59 @@ +# originbot-v1.0.2/originbot_driver/serial_ros2/serial_1.2.1.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = " Serial is a cross-platform, simple to use library for using serial ports on computers. This library provides a C++, object oriented interface for interacting with RS-232 like devices on Linux and Windows. " +AUTHOR = "William Woodall" +ROS_AUTHOR = "John Harrison, William Woodall, " +HOMEPAGE = "http://wjwwood.github.com/serial/" +SECTION = "devel" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://package.xml;beginline=13;endline=13;md5=58e54c03ca7f821dd3967e2a2cd1596e" + +ROS_CN = "" +PV = "1.2.1" +ROS_BPN = "serial" + +ROS_BUILD_DEPENDS = "" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + boost \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_driver/serial_ros2" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/ydlidar-ros2-driver_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/ydlidar-ros2-driver_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..8f51694446561b381860044e47d65c3d5eb68bd5 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/ydlidar-ros2-driver_%.bbappend @@ -0,0 +1,14 @@ +ROS_BUILD_DEPENDS += " \ + rosidl-adapter \ + ydlidar \ +" + +ROS_EXPORT_DEPENDS += " \ + ydlidar \ +" + +ROS_EXEC_DEPENDS += " \ + ydlidar \ +" + +FILES_${PN} += "/usr/share /usr/lib" diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/ydlidar-ros2-driver_1.0.1.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/ydlidar-ros2-driver_1.0.1.bb new file mode 100644 index 0000000000000000000000000000000000000000..28c9638f0690de2b4e70488c5f7d503ca1ab6703 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/originbot/ydlidar-ros2-driver_1.0.1.bb @@ -0,0 +1,71 @@ +# originbot-v1.0.2/originbot_driver/ydlidar_ros2_driver/ydlidar-ros2-driver_1.0.1.bb +# +# Generated by ros2recipe.py +# +# Copyright openeuler + +inherit ros_distro_foxy +inherit ros_superflore_generated + +DESCRIPTION = " The ROS2 device driver for YDLIDAR LIDARS " +AUTHOR = "Tony" +SECTION = "devel" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://package.xml;beginline=10;endline=10;md5=58e54c03ca7f821dd3967e2a2cd1596e" + +ROS_CN = "" +PV = "1.0.1" +ROS_BPN = "ydlidar-ros2-driver" + +ROS_BUILD_DEPENDS = " \ + geometry-msgs \ + rclcpp \ + sensor-msgs \ + std-srvs \ + visualization-msgs \ +" + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = " \ + geometry-msgs \ + rclcpp \ + sensor-msgs \ + std-srvs \ + visualization-msgs \ +" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = " \ + ament-cmake-gtest \ + ament-lint-auto \ + ament-lint-common \ +" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_SPACE = "openeuler" + +SRC_URI = " \ + file://${OPENEULER_LOCAL_NAME}/ros_depends/originbot/v1.0.2.tar.gz \ +" + +S = "${WORKDIR}/originbot-v1.0.2/originbot_driver/ydlidar_ros2_driver" +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/pcl/pcl_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/pcl/pcl_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..f79be49f36c58c2874a5027728312a6ff45f4846 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/pcl/pcl_%.bbappend @@ -0,0 +1,8 @@ +inherit ros_distro_foxy + +PV="1.10.1" + +# compiling the pcl library requires a lot of memory and other resources, +# so multiple threads at the same time will cause a crash due to lack of resources, +# as a work around, it is restricted here. +OECMAKE_TARGET_COMPILE += " -j 2 " diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/pypi-src-openeuler.inc b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/pypi-src-openeuler.inc new file mode 100644 index 0000000000000000000000000000000000000000..8f835223ea41708e075b61157897cf7b15c0fb3b --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/pypi-src-openeuler.inc @@ -0,0 +1,5 @@ +OPENEULER_REPO_NAME = "python-${PYPI_PACKAGE}" + +# use openeuler's pkg src +SRC_URI_remove += "${PYPI_SRC_URI} " +SRC_URI_prepend += "file://${PYPI_PACKAGE}-${PV}.tar.gz " diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-catkin-pkg_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-catkin-pkg_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..75b798fed952605da890ef668f457f09646b1b78 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-catkin-pkg_%.bbappend @@ -0,0 +1,16 @@ +# main bbfile: meta-ros/meta-ros-common/recipes-infrastructure/python/python3-catkin-pkg_0.4.24.bb + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_URL = "https://gitee.com/openeuler" + +PV = "0.4.24" + +S = "${WORKDIR}/catkin_pkg-${PV}" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove += "${PYPI_SRC_URI} " + +SRC_URI += "file://${OPENEULER_LOCAL_NAME}/ros_depends/${BPN}/catkin_pkg-${PV}.tar.gz " + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-colcon-core_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-colcon-core_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..121f31ff43198de12caa8d568272c83e20a20bab --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-colcon-core_%.bbappend @@ -0,0 +1,16 @@ +# main bbfile: meta-ros/meta-ros-common/recipes-infrastructure/python/python3-catkin-pkg_0.4.24.bb + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_URL = "https://gitee.com/openeuler" + +PV = "0.6.1" + +S = "${WORKDIR}/colcon-core-${PV}" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove += "${PYPI_SRC_URI} " + +SRC_URI += "file://${OPENEULER_LOCAL_NAME}/ros_depends/${BPN}/colcon-core-${PV}.tar.gz " + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-distlib_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-distlib_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..77a1d27c2245b446a6dc2329a0638bf2081e1b9b --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-distlib_%.bbappend @@ -0,0 +1,12 @@ +PV = "0.3.6" + +OPENEULER_REPO_NAME = "python-${PYPI_PACKAGE}" +OPENEULER_BRANCH = "master" + +# use openeuler's pkg src +SRC_URI_remove += "${PYPI_SRC_URI} " +SRC_URI_prepend += "file://${PYPI_PACKAGE}-${PV}.tar.gz " + +SRC_URI += " \ + file://0001-add-setup.py.patch \ + " diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-empy_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-empy_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..07aad2341ccb52c1fb91fdbb20f688cc5e9664d3 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-empy_%.bbappend @@ -0,0 +1,21 @@ +# main bbfile: yocto-meta-ros/meta-ros-common/recipes-devtools/python/python3-empy_3.3.2.bb + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_URL = "https://gitee.com/openeuler" + +PV = "3.3.4" + +LIC_FILES_CHKSUM = "file://README;md5=10d1c4f6d15ab0aa52e80cc7d6ca0959" + +SRC_URI[md5sum] = "6d73ddc0e9dc76cd607217f14d742679" +SRC_URI[sha256sum] = "73ac49785b601479df4ea18a7c79bc1304a8a7c34c02b9472cf1206ae88f01b3" + +S = "${WORKDIR}/empy-${PV}" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = "http://www.alcyone.com/software/empy/empy-${PV}.tar.gz " + +SRC_URI += "file://${OPENEULER_LOCAL_NAME}/ros_depends/${BPN}/empy-${PV}.tar.gz " + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-ifcfg_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-ifcfg_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..fe08c8751fb31fe72720092aac555c97d5d962ef --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-ifcfg_%.bbappend @@ -0,0 +1,4 @@ +PV = "0.23" +SRC_URI[md5sum] = "b26bdcf553dee44c0e491fb15a3fec91" +SRC_URI[sha256sum] = "624b5ac541693ccd3e2cecc348c0e88154ded4aaadd254cb231212dfaafdbd02" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-lark-parser_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-lark-parser_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..9f7f25b7ad0c74becf48c9add7cdbe872ba93d2f --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-lark-parser_%.bbappend @@ -0,0 +1,7 @@ +PV = "0.12.0" +SRC_URI[md5sum] = "422882c3cb61657d8c64738a2a886c3d" +SRC_URI[sha256sum] = "15967db1f1214013dca65b1180745047b9be457d73da224fcda3d9dd4e96a138" +require pypi-src-openeuler.inc + +# this packages src repo only has master branch +OPENEULER_BRANCH = "master" diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-sphinx_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-sphinx_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..85f9344c5c56f11b4e829de22dc1f83861b8cac0 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/python/python3-sphinx_%.bbappend @@ -0,0 +1,11 @@ +#main bbfile: yocto-meta-ros/meta-ros-common/recipes-devtools/python/python3-sphinx_1.6.7.bb +PV = "4.4.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=de4349dda741c550eb8b20f6b92f38d7" +SRC_URI[md5sum] = "663e2f2ee9219ef4913831950825f68b" +SRC_URI[sha256sum] = "6caad9786055cb1fa22b4a365c1775816b876f91966481765d7d50e9f0dd35cc" + +OPENEULER_BRANCH = "master" +OPENEULER_REPO_NAME = "python-sphinx" + +SRC_URI_remove += "${PYPI_SRC_URI} " +SRC_URI_prepend += "file://${PYPI_PACKAGE}-${PV}.tar.gz " diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/qhull/qhull_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/qhull/qhull_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e7fbb20532e55ee88c4b463144109da1ad35b085 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/qhull/qhull_%.bbappend @@ -0,0 +1 @@ +inherit ros_distro_foxy diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/rosdistro/python3-rosdistro_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/rosdistro/python3-rosdistro_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ed5aeaf23a64803e68bd8f2e3b7681bb84f6f901 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/rosdistro/python3-rosdistro_%.bbappend @@ -0,0 +1 @@ +inherit openeuler_ros_source diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/slam-toolbox/slam-toolbox_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/slam-toolbox/slam-toolbox_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a03d6bb5575a8f508532d2e86045c6e0660558ba --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/slam-toolbox/slam-toolbox_%.bbappend @@ -0,0 +1,25 @@ +# openeuler embedded just want runtime tool/library, not include ground station like rviz + +ROS_EXEC_DEPENDS:remove += " \ + qtbase \ + rviz-common \ + rviz-ogre-vendor \ + rviz-default-plugins \ + rviz-rendering \ +" + +ROS_BUILD_DEPENDS:remove += " \ + qtbase \ + rviz-common \ + rviz-ogre-vendor \ + rviz-default-plugins \ + rviz-rendering \ +" + +ROS_EXPORT_DEPENDS:remove += " \ + rviz-common \ + rviz-ogre-vendor \ + rviz-default-plugins \ + rviz-rendering \ +" + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/sros2/sros2_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/sros2/sros2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..cbb440931778405a97a710258cd14205cbf112ce --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/sros2/sros2_%.bbappend @@ -0,0 +1,3 @@ +# python3-cryptography -> python3-cffi-> python3-pycparser-> cpp/cpp-symlinks-> gcc +# we current do not want gcc be embedded +ROS_EXEC_DEPENDS:remove += "python3-cryptography" diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-amd_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-amd_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3fbf38eaeef274de13e1da0ba68a0ad4e2dd5f50 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-amd_%.bbappend @@ -0,0 +1 @@ +require suitesparse-openeuler.inc diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-camd_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-camd_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3fbf38eaeef274de13e1da0ba68a0ad4e2dd5f50 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-camd_%.bbappend @@ -0,0 +1 @@ +require suitesparse-openeuler.inc diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-ccolamd_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-ccolamd_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3fbf38eaeef274de13e1da0ba68a0ad4e2dd5f50 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-ccolamd_%.bbappend @@ -0,0 +1 @@ +require suitesparse-openeuler.inc diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-cholmod_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-cholmod_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3fbf38eaeef274de13e1da0ba68a0ad4e2dd5f50 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-cholmod_%.bbappend @@ -0,0 +1 @@ +require suitesparse-openeuler.inc diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-colamd_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-colamd_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3fbf38eaeef274de13e1da0ba68a0ad4e2dd5f50 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-colamd_%.bbappend @@ -0,0 +1 @@ +require suitesparse-openeuler.inc diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-config_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-config_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3fbf38eaeef274de13e1da0ba68a0ad4e2dd5f50 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-config_%.bbappend @@ -0,0 +1 @@ +require suitesparse-openeuler.inc diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-cxsparse_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-cxsparse_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3fbf38eaeef274de13e1da0ba68a0ad4e2dd5f50 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-cxsparse_%.bbappend @@ -0,0 +1 @@ +require suitesparse-openeuler.inc diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-metis_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-metis_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3fbf38eaeef274de13e1da0ba68a0ad4e2dd5f50 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-metis_%.bbappend @@ -0,0 +1 @@ +require suitesparse-openeuler.inc diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-openeuler.inc b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-openeuler.inc new file mode 100644 index 0000000000000000000000000000000000000000..7c046691abf708d85d9fde78c81d12aba783c509 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-openeuler.inc @@ -0,0 +1,16 @@ +#reference: yocto-meta-ros/meta-ros-common/recipes-extended/suitesparse/suitesparse-5.4.0.inc +inherit ros_distro_foxy + +# current version in openeuler is too old to compile suitesparse-cholmod +# we use the one version sync with meta-ros, which is in in yocto-embedded-tools/dev_ros +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_URL = "https://gitee.com/openeuler" +OPENEULER_SRC_URI_REMOVE = "git https http" + +# files, patches that come from openeuler +SRC_URI_prepend = " \ + file://ros-dev-tools/ros_depends/suitesparse/SuiteSparse-5.4.0.tar.gz \ +" + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-spqr_%.bbappend b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-spqr_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3fbf38eaeef274de13e1da0ba68a0ad4e2dd5f50 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/suitesparse/suitesparse-spqr_%.bbappend @@ -0,0 +1 @@ +require suitesparse-openeuler.inc diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0001-GS2.patch b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0001-GS2.patch new file mode 100644 index 0000000000000000000000000000000000000000..535418f6b33e6bbd94b30c4ab84c27d08953338d --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0001-GS2.patch @@ -0,0 +1,117 @@ +From 0440c9fc2b88d89b3e082346e915ade384d51dc3 Mon Sep 17 00:00:00 2001 +From: zhanyiaini +Date: Mon, 29 Aug 2022 10:53:18 +0800 +Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9GS2=E6=97=A0=E6=97=B6?= + =?UTF-8?q?=E9=97=B4=E6=88=B3=E9=97=AE=E9=A2=98?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + samples/gs_test.cpp | 3 ++- + src/CYdLidar.cpp | 2 +- + src/GS2LidarDriver.cpp | 30 ++++++++++++++++++------------ + 3 files changed, 21 insertions(+), 14 deletions(-) + +diff --git a/samples/gs_test.cpp b/samples/gs_test.cpp +index b560f6b..3143666 100644 +--- a/samples/gs_test.cpp ++++ b/samples/gs_test.cpp +@@ -237,8 +237,9 @@ int main(int argc, char *argv[]) + { + if (laser.doProcessSimple(scan)) + { +- printf("[%lu] points module num [%d] env flag [0x%04X]\n", ++ printf("[%lu] points in [0x%016lX] module num [%d] env flag [0x%04X]\n", + scan.points.size(), ++ scan.stamp, + scan.moduleNum, + scan.envFlag); + +diff --git a/src/CYdLidar.cpp b/src/CYdLidar.cpp +index 1f11b0c..ec89bbf 100644 +--- a/src/CYdLidar.cpp ++++ b/src/CYdLidar.cpp +@@ -647,7 +647,7 @@ bool CYdLidar::doProcessSimple(LaserScan &outscan) + } + + outscan.config.angle_increment = math::from_degrees(m_field_of_view) / +- (all_node_count - 1); ++ (all_node_count - 1); + + float range = 0.0; + float intensity = 0.0; +diff --git a/src/GS2LidarDriver.cpp b/src/GS2LidarDriver.cpp +index 17ce6f2..d6193fc 100644 +--- a/src/GS2LidarDriver.cpp ++++ b/src/GS2LidarDriver.cpp +@@ -650,24 +650,25 @@ int GS2LidarDriver::cacheScanData() { + // printf("sync:%d,index:%d,moduleNum:%d\n",package_type,frameNum,moduleNum); + // fflush(stdout); + +- if(!isPrepareToSend){ ++ if (!isPrepareToSend) { + continue; + } + + size_t size = multi_package.size(); +- for(size_t i = 0;i < size; i++){ +- if(multi_package[i].frameNum == frameNum && multi_package[i].moduleNum == moduleNum){ +- memcpy(scan_node_buf,multi_package[i].all_points,sizeof (node_info) * 160); ++ for (size_t i = 0;i < size; i++) { ++ if (multi_package[i].frameNum == frameNum && ++ multi_package[i].moduleNum == moduleNum) { ++ memcpy(scan_node_buf, multi_package[i].all_points, sizeof(node_info) * 160); + break; + } + } + +- _lock.lock();//timeout lock, wait resource copys +- scan_node_buf[0].stamp = local_buf[count - 1].stamp; +- scan_node_buf[0].scan_frequence = local_buf[count - 1].scan_frequence; +- scan_node_buf[0].index = 0x03 & (moduleNum >> 1);//gs2: 1, 2, 4 ++ _lock.lock(); //timeout lock, wait resource copys ++ scan_node_buf[0].stamp = local_buf[0].stamp; ++ scan_node_buf[0].scan_frequence = local_buf[0].scan_frequence; ++ scan_node_buf[0].index = 0x03 & (moduleNum >> 1); //gs2: 1, 2, 4 + scan_node_count = 160; //一个包固定160个数据 +- // printf("send frameNum: %d,moduleNum: %d\n",frameNum,moduleNum); ++ // printf("count [%d] stamp [0x%016lX]\n", count, local_buf[count - 1].stamp); + // fflush(stdout); + _dataEvent.set(); + _lock.unlock(); +@@ -754,6 +755,11 @@ result_t GS2LidarDriver::waitPackage(node_info *node, uint32_t timeout) + break; + + case 4: ++ if (currentByte == LIDAR_ANS_SYNC_BYTE1) //如果出现超过4个包头标识的情况 ++ { ++ recvPos = 4; ++ continue; ++ } + moduleNum = currentByte; + CheckSumCal = currentByte; + break; +@@ -871,7 +877,7 @@ result_t GS2LidarDriver::waitPackage(node_info *node, uint32_t timeout) + } + } + +- (*node).stamp = 0; ++ (*node).stamp = getTime(); + + if (CheckSumResult) + { +@@ -1103,8 +1109,8 @@ result_t GS2LidarDriver::waitScanData( + } + addPointsToVec(nodebuffer, recvNodeCount); + +- nodebuffer[recvNodeCount - 1].stamp = size * trans_delay + delayTime; +- nodebuffer[recvNodeCount - 1].scan_frequence = node.scan_frequence; ++ // nodebuffer[recvNodeCount - 1].stamp = size * trans_delay + delayTime; ++ // nodebuffer[recvNodeCount - 1].scan_frequence = node.scan_frequence; + count = recvNodeCount; + return RESULT_OK; + } +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0002-windows.patch b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0002-windows.patch new file mode 100644 index 0000000000000000000000000000000000000000..d65ccbdeb75cc0d278c03d4c3e6c015b7fbfa5fe --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0002-windows.patch @@ -0,0 +1,52 @@ +From 41e3cb93b6e08202a0f68e8a1cc5fc11ebf6ad5a Mon Sep 17 00:00:00 2001 +From: zhanyiaini +Date: Mon, 29 Aug 2022 17:03:46 +0800 +Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9windows=E5=B9=B3=E5=8F=B0?= + =?UTF-8?q?=E5=9B=A0=E4=B8=AD=E6=96=87=E6=B3=A8=E9=87=8A=E6=97=A0=E6=B3=95?= + =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=97=AE=E9=A2=98?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + CMakeLists.txt | 10 ++++++++-- + README.md | 2 +- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c35ca0a..0adc747 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,8 +20,14 @@ ENDIF() + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + + ########################################################## +-# add -fPIC +-add_compile_options(-fPIC) ++IF (CMAKE_SYSTEM_NAME MATCHES "Linux") ++ MESSAGE(STATUS "Current platform: Linux") ++ #Linux add -fPIC ++ add_compile_options(-fPIC) ++ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows") ++ MESSAGE(STATUS "Current platform: Windows") ++ add_compile_options("/utf-8") ++ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux") + #or + #set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +diff --git a/README.md b/README.md +index 7343a8e..0440b95 100644 +--- a/README.md ++++ b/README.md +@@ -21,7 +21,7 @@ YDLidar SDK consists of YDLidar SDK communication protocol, YDLidar SDK core, YD + + ### Prerequisites + * Linux +-* Windows 7/10, Visual Studio 2015/2017 ++* Windows 7/10, Visual Studio 2015/2017(UTF-8 encoding) + * C++11 compiler + + ### Supported Languages +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0003-GS1.patch b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0003-GS1.patch new file mode 100644 index 0000000000000000000000000000000000000000..26a643fa047e9b2360f065fda15fbc043cb404e2 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0003-GS1.patch @@ -0,0 +1,2989 @@ +From 5c1a1aa92d3296405771b9ef05be1008b9b7148e Mon Sep 17 00:00:00 2001 +From: zhanyiaini +Date: Wed, 28 Sep 2022 19:01:33 +0800 +Subject: [PATCH 3/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=94=AF=E6=8C=81GS1?= + =?UTF-8?q?=E9=9B=B7=E8=BE=BE?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + core/common/DriverInterface.h | 1 + + core/common/ydlidar_def.h | 1 + + core/common/ydlidar_help.h | 33 +- + core/common/ydlidar_protocol.h | 35 +- + core/serial/impl/unix/list_ports_linux.cpp | 9 +- + samples/gs_test.cpp | 2 +- + samples/tri_test.cpp | 169 +- + src/CYdLidar.cpp | 15 +- + src/GS1LidarDriver.cpp | 1797 ++++++++++++++++++++ + src/GS1LidarDriver.h | 589 +++++++ + src/YDlidarDriver.cpp | 4 + + 11 files changed, 2561 insertions(+), 94 deletions(-) + create mode 100644 src/GS1LidarDriver.cpp + create mode 100644 src/GS1LidarDriver.h + +diff --git a/core/common/DriverInterface.h b/core/common/DriverInterface.h +index b22b098..e1e1e31 100644 +--- a/core/common/DriverInterface.h ++++ b/core/common/DriverInterface.h +@@ -473,6 +473,7 @@ class DriverInterface { + YDLIDAR_G7 = 21,/**< G7 LiDAR Model. */ + + YDLIDAR_GS2 = 51, //GS2雷达 ++ YDLIDAR_GS1 = 52, //GS1雷达 + + YDLIDAR_TG15 = 100,/**< TG15 LiDAR Model. */ + YDLIDAR_TG30 = 101,/**< T30 LiDAR Model. */ +diff --git a/core/common/ydlidar_def.h b/core/common/ydlidar_def.h +index 136dd46..f8bf961 100644 +--- a/core/common/ydlidar_def.h ++++ b/core/common/ydlidar_def.h +@@ -46,6 +46,7 @@ typedef enum { + TYPE_TRIANGLE = 1,/**< G4. G6. G2 LiDAR.*/ + TYPE_TOF_NET = 2,/**< T15 LiDAR.*/ + TYPE_GS = 3, //GS系列雷达(目前只有GS2) ++ TYPE_GS1 = 4, //GS1雷达 + TYPE_Tail, + } LidarTypeID; + +diff --git a/core/common/ydlidar_help.h b/core/common/ydlidar_help.h +index c96b2ef..35ac3ee 100644 +--- a/core/common/ydlidar_help.h ++++ b/core/common/ydlidar_help.h +@@ -168,6 +168,9 @@ inline std::string lidarModelToString(int model) { + name = "G7"; + break; + ++ case DriverInterface::YDLIDAR_GS1: ++ name = "GS1"; ++ break; + case DriverInterface::YDLIDAR_GS2: + name = "GS2"; + break; +@@ -368,6 +371,7 @@ inline bool hasScanFrequencyCtrl(int model) { + model == DriverInterface::YDLIDAR_S4B || + model == DriverInterface::YDLIDAR_S2 || + model == DriverInterface::YDLIDAR_X4 || ++ model == DriverInterface::YDLIDAR_GS1 || + model == DriverInterface::YDLIDAR_GS2) { + ret = false; + } +@@ -405,6 +409,7 @@ inline bool hasIntensity(int model) { + if (model == DriverInterface::YDLIDAR_G2B || + model == DriverInterface::YDLIDAR_G4B || + model == DriverInterface::YDLIDAR_S4B || ++ model == DriverInterface::YDLIDAR_GS1 || + model == DriverInterface::YDLIDAR_GS2) { + ret = true; + } +@@ -540,14 +545,30 @@ inline bool isTriangleLidar(int type) { + * @param type LiDAR type + * @return true if it is a Triangle type, otherwise false. + */ +-inline bool isGSLidar(int type) { +- bool ret = false; ++inline bool isGSLidar(int type) ++{ ++ return (type == TYPE_GS1 || ++ type == TYPE_GS); ++} + +- if (type == TYPE_GS) { +- ret = true; +- } ++/** ++ * @brief Whether it is a GS1 type LiDAR ++ * @param type LiDAR type ++ * @return true if it is a Triangle type, otherwise false. ++ */ ++inline bool isGS1Lidar(int type) ++{ ++ return (type == TYPE_GS1); ++} + +- return ret; ++/** ++ * @brief Whether it is a GS2 type LiDAR ++ * @param type LiDAR type ++ * @return true if it is a Triangle type, otherwise false. ++ */ ++inline bool isGS2Lidar(int type) ++{ ++ return (type == TYPE_GS); + } + + /** +diff --git a/core/common/ydlidar_protocol.h b/core/common/ydlidar_protocol.h +index d25ab73..68f21f4 100644 +--- a/core/common/ydlidar_protocol.h ++++ b/core/common/ydlidar_protocol.h +@@ -140,13 +140,14 @@ + #define Angle_Py 5.315 + #define Angle_PAngle 22.5 + #define PackageMaxModuleNums 0x03 +-#define PackageSampleMaxLngth_GS 0xA0 //160*2 ++#define MaxPointsPerPackge_GS2 160 //GS2固定160个点 ++#define MaxPointsPerPackge_GS1 216 //GS1固定216个点 + #define PackagePaidBytes_GS 8 + #define NORMAL_PACKAGE_SIZE 331 + + /// Maximuum number of samples in a packet + #define PackageSampleMaxLngth 0x100 +-#define MaximumNumberOfPackages 765 ++#define MaximumNumberOfPackages 765 //= 255 * 3 + + /// CT Package Type + typedef enum { +@@ -326,18 +327,36 @@ struct lidar_ans_header { + uint8_t type; + } __attribute__((packed)); + ++//GS1 ++struct GS1_Multi_Package { ++ int frameNum; ++ int moduleNum; ++ bool left = false; ++ bool right = false; ++ node_info all_points[MaxPointsPerPackge_GS1]; ++} __attribute__((packed)); + //GS2 + struct GS2_Multi_Package { + int frameNum; + int moduleNum; + bool left = false; + bool right = false; +- node_info all_points[160]; +-} __attribute__((packed)) ; ++ node_info all_points[MaxPointsPerPackge_GS2]; ++} __attribute__((packed)); + + struct GS2PackageNode { +- uint16_t PakageSampleDistance:9; +- uint16_t PakageSampleQuality:7; ++ uint16_t PakageSampleDistance : 9; ++ uint16_t PakageSampleQuality : 7; ++} __attribute__((packed)); ++ ++struct gs1_node_package { ++ uint32_t package_Head; ++ uint8_t address; ++ uint8_t package_CT; ++ uint16_t size; ++ uint16_t BackgroudLight; ++ GS2PackageNode packageSample[MaxPointsPerPackge_GS1]; ++ uint8_t checkSum; + } __attribute__((packed)); + + struct gs2_node_package { +@@ -346,9 +365,9 @@ struct gs2_node_package { + uint8_t package_CT; + uint16_t size; + uint16_t BackgroudLight; +- GS2PackageNode packageSample[PackageSampleMaxLngth_GS]; ++ GS2PackageNode packageSample[MaxPointsPerPackge_GS2]; + uint8_t checkSum; +-} __attribute__((packed)) ; ++} __attribute__((packed)); + + struct gs_lidar_ans_header { + uint8_t syncByte0; +diff --git a/core/serial/impl/unix/list_ports_linux.cpp b/core/serial/impl/unix/list_ports_linux.cpp +index ce571d2..d0877ed 100644 +--- a/core/serial/impl/unix/list_ports_linux.cpp ++++ b/core/serial/impl/unix/list_ports_linux.cpp +@@ -284,7 +284,8 @@ usb_sysfs_hw_string(const string &sysfs_path) { + } + + vector +-serial::list_ports() { ++serial::list_ports() ++{ + vector results; + + vector search_globs; +@@ -312,8 +313,8 @@ serial::list_ports() { + std::size_t found = hardware_id.find("10c4:ea60"); + std::size_t found1 = hardware_id.find("0483:5740"); + +- +- if (found != std::string::npos || found1 != std::string::npos) { ++ // if (found != std::string::npos || found1 != std::string::npos) ++ { + PortInfo device_entry; + device_entry.port = device; + device_entry.description = friendly_name; +@@ -322,8 +323,6 @@ serial::list_ports() { + results.push_back(device_entry); + } + +- +- + } + + return results; +diff --git a/samples/gs_test.cpp b/samples/gs_test.cpp +index 3143666..2bb7671 100644 +--- a/samples/gs_test.cpp ++++ b/samples/gs_test.cpp +@@ -153,7 +153,7 @@ int main(int argc, char *argv[]) + /// lidar baudrate + laser.setlidaropt(LidarPropSerialBaudrate, &baudrate, sizeof(int)); + /// gs lidar +- int optval = TYPE_GS; ++ int optval = TYPE_GS1; + laser.setlidaropt(LidarPropLidarType, &optval, sizeof(int)); + /// device type + optval = YDLIDAR_TYPE_SERIAL; +diff --git a/samples/tri_test.cpp b/samples/tri_test.cpp +index 3deb862..4e5f80c 100644 +--- a/samples/tri_test.cpp ++++ b/samples/tri_test.cpp +@@ -1,36 +1,36 @@ + /********************************************************************* +-* Software License Agreement (BSD License) +-* +-* Copyright (c) 2018, EAIBOT, Inc. +-* All rights reserved. +-* +-* Redistribution and use in source and binary forms, with or without +-* modification, are permitted provided that the following conditions +-* are met: +-* +-* * Redistributions of source code must retain the above copyright +-* notice, this list of conditions and the following disclaimer. +-* * Redistributions in binary form must reproduce the above +-* copyright notice, this list of conditions and the following +-* disclaimer in the documentation and/or other materials provided +-* with the distribution. +-* * Neither the name of the Willow Garage nor the names of its +-* contributors may be used to endorse or promote products derived +-* from this software without specific prior written permission. +-* +-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +-* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +-* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +-* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +-* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +-* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +-* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +-* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +-* POSSIBILITY OF SUCH DAMAGE. +-*********************************************************************/ ++ * Software License Agreement (BSD License) ++ * ++ * Copyright (c) 2018, EAIBOT, Inc. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * ++ * * Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * * Redistributions in binary form must reproduce the above ++ * copyright notice, this list of conditions and the following ++ * disclaimer in the documentation and/or other materials provided ++ * with the distribution. ++ * * Neither the name of the Willow Garage nor the names of its ++ * contributors may be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ++ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ++ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, ++ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ++ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ++ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++ * POSSIBILITY OF SUCH DAMAGE. ++ *********************************************************************/ + #include "CYdLidar.h" + #include + #include +@@ -58,7 +58,8 @@ using namespace ydlidar; + * Step7: Uninitialize the SDK and Disconnect the LiDAR.(::CYdLidar::disconnecting)\n + */ + +-int main(int argc, char *argv[]) { ++int main(int argc, char *argv[]) ++{ + printf("__ ______ _ ___ ____ _ ____ \n"); + printf("\\ \\ / / _ \\| | |_ _| _ \\ / \\ | _ \\ \n"); + printf(" \\ V /| | | | | | || | | |/ _ \\ | |_) | \n"); +@@ -70,36 +71,46 @@ int main(int argc, char *argv[]) { + ydlidar::os_init(); + + std::map ports = +- ydlidar::lidarPortList(); ++ ydlidar::lidarPortList(); + std::map::iterator it; + +- if (ports.size() == 1) { ++ if (ports.size() == 1) ++ { + port = ports.begin()->second; +- } else { ++ } ++ else ++ { + int id = 0; + +- for (it = ports.begin(); it != ports.end(); it++) { ++ for (it = ports.begin(); it != ports.end(); it++) ++ { + printf("%d. %s\n", id, it->first.c_str()); + id++; + } + +- if (ports.empty()) { ++ if (ports.empty()) ++ { + printf("Not Lidar was detected. Please enter the lidar serial port:"); + std::cin >> port; +- } else { +- while (ydlidar::os_isOk()) { ++ } ++ else ++ { ++ while (ydlidar::os_isOk()) ++ { + printf("Please select the lidar port:"); + std::string number; + std::cin >> number; + +- if ((size_t)atoi(number.c_str()) >= ports.size()) { ++ if ((size_t)atoi(number.c_str()) >= ports.size()) ++ { + continue; + } + + it = ports.begin(); + id = atoi(number.c_str()); + +- while (id) { ++ while (id) ++ { + id--; + it++; + } +@@ -122,16 +133,19 @@ int main(int argc, char *argv[]) { + printf("Baudrate:\n"); + + for (std::map::iterator it = baudrateList.begin(); +- it != baudrateList.end(); it++) { ++ it != baudrateList.end(); it++) ++ { + printf("%d. %d\n", it->first, it->second); + } + +- while (ydlidar::os_isOk()) { ++ while (ydlidar::os_isOk()) ++ { + printf("Please select the lidar baudrate:"); + std::string number; + std::cin >> number; + +- if ((size_t)atoi(number.c_str()) > baudrateList.size()) { ++ if ((size_t)atoi(number.c_str()) > baudrateList.size()) ++ { + continue; + } + +@@ -139,7 +153,8 @@ int main(int argc, char *argv[]) { + break; + } + +- if (!ydlidar::os_isOk()) { ++ if (!ydlidar::os_isOk()) ++ { + return 0; + } + +@@ -149,15 +164,18 @@ int main(int argc, char *argv[]) { + std::cin >> input_channel; + std::transform(input_channel.begin(), input_channel.end(), + input_channel.begin(), +- [](unsigned char c) { +- return std::tolower(c); // correct +- }); ++ [](unsigned char c) ++ { ++ return std::tolower(c); // correct ++ }); + +- if (input_channel.find("y") != std::string::npos) { ++ if (input_channel.find("y") != std::string::npos) ++ { + isSingleChannel = true; + } + +- if (!ydlidar::os_isOk()) { ++ if (!ydlidar::os_isOk()) ++ { + return 0; + } + +@@ -165,12 +183,14 @@ int main(int argc, char *argv[]) { + + float frequency = 8.0; + +- while (ydlidar::os_isOk() && !isSingleChannel) { ++ while (ydlidar::os_isOk() && !isSingleChannel) ++ { + printf("Please enter the lidar scan frequency[5-12]:"); + std::cin >> input_frequency; + frequency = atof(input_frequency.c_str()); + +- if (frequency <= 12 && frequency >= 5.0) { ++ if (frequency <= 12 && frequency >= 5.0) ++ { + break; + } + +@@ -178,7 +198,8 @@ int main(int argc, char *argv[]) { + "Invalid scan frequency,The scanning frequency range is 5 to 12 HZ, Please re-enter.\n"); + } + +- if (!ydlidar::os_isOk()) { ++ if (!ydlidar::os_isOk()) ++ { + return 0; + } + +@@ -252,14 +273,16 @@ int main(int argc, char *argv[]) { + laser.enableSunNoise(false); + + bool ret = laser.initialize(); +- if (!ret) { ++ if (!ret) ++ { + fprintf(stderr, "Fail to initialize %s\n", laser.DescribeError()); + fflush(stderr); + return -1; + } + + ret = laser.turnOn(); +- if (!ret) { ++ if (!ret) ++ { + fprintf(stderr, "Fail to start %s\n", laser.DescribeError()); + fflush(stderr); + return -1; +@@ -278,23 +301,23 @@ int main(int argc, char *argv[]) { + LaserScan scan; + while (ydlidar::os_isOk()) + { +- if (laser.doProcessSimple(scan)) +- { +- printf("Scan received [%u] points stamp [0x%016lX]\n", +- (unsigned int)scan.points.size(), +- scan.stamp); +-// for (size_t i=0; i(global_nodes[i].angle_q6_checkbit / 100.0f) + +@@ -737,6 +742,9 @@ bool CYdLidar::doProcessSimple(LaserScan &outscan) + range = .0; + } + ++ // printf("i %d d %.03f a %.02f flag %u\n", ++ // i, range, angle*180.0/M_PI, node.sync_flag); ++ + if (angle >= outscan.config.min_angle && + angle <= outscan.config.max_angle) + { +@@ -1802,7 +1810,12 @@ bool CYdLidar::checkCOMMs() + { + lidarPtr = new ydlidar::ETLidarDriver(); // T15 + } +- else if (isGSLidar(m_LidarType)) ++ else if (isGS1Lidar(m_LidarType)) ++ { ++ //GS1 ++ lidarPtr = new ydlidar::GS1LidarDriver(); ++ } ++ else if (isGS2Lidar(m_LidarType)) + { + //GS2 + lidarPtr = new ydlidar::GS2LidarDriver(); +diff --git a/src/GS1LidarDriver.cpp b/src/GS1LidarDriver.cpp +new file mode 100644 +index 0000000..dcaf0d0 +--- /dev/null ++++ b/src/GS1LidarDriver.cpp +@@ -0,0 +1,1797 @@ ++/********************************************************************* ++ * Software License Agreement (BSD License) ++ * ++ * Copyright (c) 2018, EAIBOT, Inc. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * ++ * * Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * * Redistributions in binary form must reproduce the above ++ * copyright notice, this list of conditions and the following ++ * disclaimer in the documentation and/or other materials provided ++ * with the distribution. ++ * * Neither the name of the Willow Garage nor the names of its ++ * contributors may be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ++ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ++ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, ++ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ++ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ++ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++ * POSSIBILITY OF SUCH DAMAGE. ++ *********************************************************************/ ++#include ++#include "GS1LidarDriver.h" ++#include "core/serial/common.h" ++#include "ydlidar_config.h" ++ ++using namespace impl; ++ ++namespace ydlidar ++{ ++ ++ GS1LidarDriver::GS1LidarDriver() : _serial(NULL) ++ { ++ //串口配置参数 ++ m_intensities = false; ++ isAutoReconnect = true; ++ isAutoconnting = false; ++ m_baudrate = 230400; ++ isSupportMotorDtrCtrl = true; ++ scan_node_count = 0; ++ sample_rate = 5000; ++ m_PointTime = 1e9 / 5000; ++ trans_delay = 0; ++ scan_frequence = 0; ++ m_sampling_rate = -1; ++ model = -1; ++ retryCount = 0; ++ has_device_header = false; ++ m_SingleChannel = false; ++ m_LidarType = TYPE_TOF; ++ ++ //解析参数 ++ PackageSampleBytes = 2; ++ IntervalSampleAngle = 0.0; ++ CheckSum = 0; ++ CheckSumCal = 0; ++ SampleNumlAndCTCal = 0; ++ LastSampleAngleCal = 0; ++ CheckSumResult = true; ++ Valu8Tou16 = 0; ++ package_Sample_Num = 0; ++ moduleNum = 0; ++ frameNum = 0; ++ isPrepareToSend = false; ++ multi_package.resize(MaximumNumberOfPackages); ++ ++ last_device_byte = 0x00; ++ asyncRecvPos = 0; ++ async_size = 0; ++ headerBuffer = reinterpret_cast(&header_); ++ infoBuffer = reinterpret_cast(&info_); ++ healthBuffer = reinterpret_cast(&health_); ++ get_device_health_success = false; ++ get_device_info_success = false; ++ ++ package_Sample_Index = 0; ++ IntervalSampleAngle_LastPackage = 0.0; ++ globalRecvBuffer = new uint8_t[sizeof(gs1_node_package)]; ++ scan_node_buf = new node_info[MAX_SCAN_NODES]; ++ package_index = 0; ++ has_package_error = false; ++ isValidPoint = true; ++ bias[0] = 0; ++ bias[1] = 0; ++ bias[2] = 0; ++ } ++ ++ GS1LidarDriver::~GS1LidarDriver() ++ { ++ m_isScanning = false; ++ ++ isAutoReconnect = false; ++ _thread.join(); ++ ++ ScopedLocker lk(_serial_lock); ++ ++ if (_serial) ++ { ++ if (_serial->isOpen()) ++ { ++ _serial->flush(); ++ _serial->closePort(); ++ } ++ } ++ ++ if (_serial) ++ { ++ delete _serial; ++ _serial = NULL; ++ } ++ ++ if (globalRecvBuffer) ++ { ++ delete[] globalRecvBuffer; ++ globalRecvBuffer = NULL; ++ } ++ ++ if (scan_node_buf) ++ { ++ delete[] scan_node_buf; ++ scan_node_buf = NULL; ++ } ++ } ++ ++ result_t GS1LidarDriver::connect(const char *port_path, uint32_t baudrate) ++ { ++ ScopedLocker lk(_serial_lock); ++ m_baudrate = baudrate; ++ serial_port = string(port_path); ++ ++ if (!_serial) ++ { ++ _serial = new serial::Serial(port_path, m_baudrate, ++ serial::Timeout::simpleTimeout(DEFAULT_TIMEOUT)); ++ } ++ ++ { ++ ScopedLocker l(_lock); ++ ++ if (!_serial->open()) ++ { ++ return RESULT_FAIL; ++ } ++ ++ m_isConnected = true; ++ } ++ ++ stopScan(); ++ delay(100); ++ clearDTR(); ++ ++ return RESULT_OK; ++ } ++ ++ void GS1LidarDriver::setDTR() ++ { ++ if (!m_isConnected) ++ { ++ return; ++ } ++ ++ if (_serial) ++ { ++ _serial->setDTR(1); ++ } ++ } ++ ++ void GS1LidarDriver::clearDTR() ++ { ++ if (!m_isConnected) ++ { ++ return; ++ } ++ ++ if (_serial) ++ { ++ _serial->setDTR(0); ++ } ++ } ++ void GS1LidarDriver::flushSerial() ++ { ++ if (!m_isConnected) ++ { ++ return; ++ } ++ ++ size_t len = _serial->available(); ++ if (len) ++ { ++ _serial->readSize(len); ++ } ++ ++ delay(20); ++ } ++ ++ void GS1LidarDriver::disconnect() ++ { ++ isAutoReconnect = false; ++ ++ if (!m_isConnected) ++ { ++ return; ++ } ++ ++ stop(); ++ delay(10); ++ ScopedLocker l(_serial_lock); ++ ++ if (_serial) ++ { ++ if (_serial->isOpen()) ++ { ++ _serial->closePort(); ++ } ++ } ++ ++ m_isConnected = false; ++ } ++ ++ void GS1LidarDriver::disableDataGrabbing() ++ { ++ { ++ if (m_isScanning) ++ { ++ m_isScanning = false; ++ _dataEvent.set(); ++ } ++ } ++ _thread.join(); ++ } ++ ++ bool GS1LidarDriver::isscanning() const ++ { ++ return m_isScanning; ++ } ++ bool GS1LidarDriver::isconnected() const ++ { ++ return m_isConnected; ++ } ++ ++ result_t GS1LidarDriver::sendCommand(uint8_t cmd, ++ const void *payload, ++ size_t payloadsize) ++ { ++ return sendCommand(0x00, cmd, payload, payloadsize); ++ // uint8_t pkt_header[12]; ++ // cmd_packet_gs *header = reinterpret_cast(pkt_header); ++ // uint8_t checksum = 0; ++ ++ // if (!m_isConnected) { ++ // return RESULT_FAIL; ++ // } ++ ++ // header->syncByte0 = LIDAR_CMD_SYNC_BYTE; ++ // header->syncByte1 = LIDAR_CMD_SYNC_BYTE; ++ // header->syncByte2 = LIDAR_CMD_SYNC_BYTE; ++ // header->syncByte3 = LIDAR_CMD_SYNC_BYTE; ++ // header->address = 0x00; ++ // header->cmd_flag = cmd; ++ // header->size = 0xffff&payloadsize; ++ // sendData(pkt_header, 8) ; ++ // checksum += cmd; ++ // checksum += 0xff&header->size; ++ // checksum += 0xff&(header->size>>8); ++ ++ // if (payloadsize && payload) { ++ // for (size_t pos = 0; pos < payloadsize; ++pos) { ++ // checksum += ((uint8_t *)payload)[pos]; ++ // } ++ // uint8_t sizebyte = (uint8_t)(payloadsize); ++ // sendData((const uint8_t *)payload, sizebyte); ++ // } ++ ++ // sendData(&checksum, 1); ++ ++ // return RESULT_OK; ++ } ++ ++ result_t GS1LidarDriver::sendCommand(uint8_t addr, ++ uint8_t cmd, ++ const void *payload, ++ size_t payloadsize) ++ { ++ uint8_t pkt_header[12]; ++ cmd_packet_gs *header = reinterpret_cast(pkt_header); ++ uint8_t checksum = 0; ++ ++ if (!m_isConnected) ++ { ++ return RESULT_FAIL; ++ } ++ ++ header->syncByte0 = LIDAR_CMD_SYNC_BYTE; ++ header->syncByte1 = LIDAR_CMD_SYNC_BYTE; ++ header->syncByte2 = LIDAR_CMD_SYNC_BYTE; ++ header->syncByte3 = LIDAR_CMD_SYNC_BYTE; ++ header->address = addr; ++ header->cmd_flag = cmd; ++ header->size = 0xffff & payloadsize; ++ sendData(pkt_header, 8); ++ checksum += addr; ++ checksum += cmd; ++ checksum += 0xff & header->size; ++ checksum += 0xff & (header->size >> 8); ++ ++ if (payloadsize && payload) ++ { ++ for (size_t pos = 0; pos < payloadsize; ++pos) ++ { ++ checksum += ((uint8_t *)payload)[pos]; ++ } ++ uint8_t sizebyte = (uint8_t)(payloadsize); ++ sendData((const uint8_t *)payload, sizebyte); ++ } ++ ++ sendData(&checksum, 1); ++ ++ return RESULT_OK; ++ } ++ ++ result_t GS1LidarDriver::sendData(const uint8_t *data, size_t size) ++ { ++ if (!_serial || !_serial->isOpen()) ++ { ++ return RESULT_FAIL; ++ } ++ ++ if (data == NULL || size == 0) ++ { ++ return RESULT_FAIL; ++ } ++ ++ size_t r; ++ ++ while (size) ++ { ++ r = _serial->writeData(data, size); ++ ++ if (!r) ++ { ++ return RESULT_FAIL; ++ } ++ ++ // printf("send: "); ++ // printHex(data, r); ++ ++ size -= r; ++ data += r; ++ } ++ ++ return RESULT_OK; ++ } ++ ++ result_t GS1LidarDriver::getData(uint8_t *data, size_t size) ++ { ++ if (!_serial || !_serial->isOpen()) ++ { ++ return RESULT_FAIL; ++ } ++ ++ size_t r; ++ ++ while (size) ++ { ++ r = _serial->readData(data, size); ++ ++ if (!r) ++ { ++ return RESULT_FAIL; ++ } ++ ++ // printf("recv: "); ++ // printHex(data, r); ++ ++ size -= r; ++ data += r; ++ } ++ ++ return RESULT_OK; ++ } ++ ++ result_t GS1LidarDriver::waitResponseHeader(gs_lidar_ans_header *header, ++ uint32_t timeout) ++ { ++ int recvPos = 0; ++ uint32_t startTs = getms(); ++ uint8_t recvBuffer[sizeof(gs_lidar_ans_header)]; ++ uint8_t *headerBuffer = reinterpret_cast(header); ++ uint32_t waitTime = 0; ++ has_device_header = false; ++ last_device_byte = 0x00; ++ ++ while ((waitTime = getms() - startTs) <= timeout) ++ { ++ size_t remainSize = sizeof(gs_lidar_ans_header) - recvPos; ++ size_t recvSize = 0; ++ result_t ans = waitForData(remainSize, timeout - waitTime, &recvSize); ++ ++ if (!IS_OK(ans)) ++ { ++ return ans; ++ } ++ ++ if (recvSize > remainSize) ++ { ++ recvSize = remainSize; ++ } ++ ++ ans = getData(recvBuffer, recvSize); ++ ++ if (IS_FAIL(ans)) ++ { ++ return RESULT_FAIL; ++ } ++ ++ for (size_t pos = 0; pos < recvSize; ++pos) ++ { ++ uint8_t currentByte = recvBuffer[pos]; ++ ++ switch (recvPos) ++ { ++ case 0: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ break; ++ ++ case 1: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ break; ++ ++ case 2: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ break; ++ ++ case 3: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ has_device_header = true; ++ break; ++ ++ default: ++ break; ++ } ++ ++ headerBuffer[recvPos++] = currentByte; ++ last_device_byte = currentByte; ++ ++ if (has_device_header && recvPos == sizeof(gs_lidar_ans_header)) ++ { ++ return RESULT_OK; ++ } ++ } ++ } ++ ++ return RESULT_FAIL; ++ } ++ ++ result_t GS1LidarDriver::waitResponseHeaderEx(gs_lidar_ans_header *header, uint8_t cmd, uint32_t timeout) ++ { ++ int recvPos = 0; ++ uint32_t startTs = getms(); ++ uint8_t recvBuffer[sizeof(gs_lidar_ans_header)]; ++ uint8_t *headerBuffer = reinterpret_cast(header); ++ uint32_t waitTime = 0; ++ has_device_header = false; ++ last_device_byte = 0x00; ++ ++ while ((waitTime = getms() - startTs) <= timeout) ++ { ++ size_t remainSize = sizeof(gs_lidar_ans_header) - recvPos; ++ size_t recvSize = 0; ++ result_t ans = waitForData(remainSize, timeout - waitTime, &recvSize); ++ ++ if (!IS_OK(ans)) ++ { ++ return ans; ++ } ++ ++ if (recvSize > remainSize) ++ { ++ recvSize = remainSize; ++ } ++ ++ ans = getData(recvBuffer, recvSize); ++ ++ if (IS_FAIL(ans)) ++ { ++ return RESULT_FAIL; ++ } ++ ++ for (size_t pos = 0; pos < recvSize; ++pos) ++ { ++ uint8_t currentByte = recvBuffer[pos]; ++ ++ switch (recvPos) ++ { ++ case 0: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ break; ++ ++ case 1: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ break; ++ ++ case 2: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ break; ++ ++ case 3: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ break; ++ case 5: ++ if (currentByte != cmd) ++ { ++ recvPos = 0; ++ continue; ++ } ++ has_device_header = true; ++ break; ++ ++ default: ++ break; ++ } ++ ++ headerBuffer[recvPos++] = currentByte; ++ last_device_byte = currentByte; ++ ++ if (has_device_header && recvPos == sizeof(gs_lidar_ans_header)) ++ { ++ return RESULT_OK; ++ } ++ } ++ } ++ ++ return RESULT_FAIL; ++ } ++ ++ result_t GS1LidarDriver::waitForData(size_t data_count, uint32_t timeout, ++ size_t *returned_size) ++ { ++ size_t length = 0; ++ ++ if (returned_size == NULL) ++ { ++ returned_size = (size_t *)&length; ++ } ++ ++ return (result_t)_serial->waitfordata(data_count, timeout, returned_size); ++ } ++ ++ result_t GS1LidarDriver::checkAutoConnecting() ++ { ++ result_t ans = RESULT_FAIL; ++ isAutoconnting = true; ++ ++ while (isAutoReconnect && isAutoconnting) ++ { ++ { ++ ScopedLocker l(_serial_lock); ++ ++ if (_serial) ++ { ++ if (_serial->isOpen() || m_isConnected) ++ { ++ m_isConnected = false; ++ _serial->closePort(); ++ delete _serial; ++ _serial = NULL; ++ } ++ } ++ } ++ retryCount++; ++ ++ if (retryCount > 100) ++ { ++ retryCount = 100; ++ } ++ ++ delay(100 * retryCount); ++ int retryConnect = 0; ++ ++ while (isAutoReconnect && ++ connect(serial_port.c_str(), m_baudrate) != RESULT_OK) ++ { ++ retryConnect++; ++ ++ if (retryConnect > 50) ++ { ++ retryConnect = 50; ++ } ++ ++ delay(200 * retryConnect); ++ } ++ ++ if (!isAutoReconnect) ++ { ++ m_isScanning = false; ++ return RESULT_FAIL; ++ } ++ ++ if (isconnected()) ++ { ++ delay(100); ++ { ++ ScopedLocker l(_serial_lock); ++ ans = startAutoScan(); ++ ++ if (!IS_OK(ans)) ++ { ++ ans = startAutoScan(); ++ } ++ } ++ ++ if (IS_OK(ans)) ++ { ++ isAutoconnting = false; ++ return ans; ++ } ++ } ++ } ++ ++ return RESULT_FAIL; ++ } ++ ++ int GS1LidarDriver::cacheScanData() ++ { ++ node_info local_buf[MaxPointsPerPackge_GS1]; ++ size_t count = MaxPointsPerPackge_GS1; ++ node_info local_scan[MAX_SCAN_NODES]; ++ size_t scan_count = 0; ++ result_t ans = RESULT_FAIL; ++ memset(local_scan, 0, sizeof(local_scan)); ++ ++ flushSerial(); ++ // waitScanData(local_buf, count); ++ ++ int timeout_count = 0; ++ retryCount = 0; ++ ++ while (m_isScanning) ++ { ++ count = MaxPointsPerPackge_GS1; ++ ans = waitScanData(local_buf, count); ++ ++ if (!IS_OK(ans)) ++ { ++ if (IS_FAIL(ans) || timeout_count > DEFAULT_TIMEOUT_COUNT) ++ { ++ if (!isAutoReconnect) ++ { ++ fprintf(stderr, "exit scanning thread!!\n"); ++ fflush(stderr); ++ { ++ m_isScanning = false; ++ } ++ return RESULT_FAIL; ++ } ++ else ++ { ++ ans = checkAutoConnecting(); ++ ++ if (IS_OK(ans)) ++ { ++ timeout_count = 0; ++ local_scan[0].sync_flag = Node_NotSync; ++ } ++ else ++ { ++ m_isScanning = false; ++ return RESULT_FAIL; ++ } ++ } ++ } ++ else ++ { ++ timeout_count++; ++ local_scan[0].sync_flag = Node_NotSync; ++ fprintf(stderr, "timeout count: %d\n", timeout_count); ++ fflush(stderr); ++ } ++ } ++ else ++ { ++ timeout_count = 0; ++ retryCount = 0; ++ } ++ ++ // printf("sync:%d,index:%d,moduleNum:%d\n",package_type,frameNum,moduleNum); ++ // fflush(stdout); ++ ++ if (!isPrepareToSend) ++ { ++ continue; ++ } ++ ++ size_t size = multi_package.size(); ++ for (size_t i = 0; i < size; i++) ++ { ++ if (multi_package[i].frameNum == frameNum && ++ multi_package[i].moduleNum == moduleNum) ++ { ++ memcpy(scan_node_buf, multi_package[i].all_points, sizeof(node_info) * MaxPointsPerPackge_GS1); ++ break; ++ } ++ } ++ ++ _lock.lock(); // timeout lock, wait resource copys ++ scan_node_buf[0].stamp = local_buf[0].stamp; ++ scan_node_buf[0].scan_frequence = local_buf[0].scan_frequence; ++ scan_node_buf[0].index = 0x03 & moduleNum >> 1; //gs1: 1, 2, 4 ++ scan_node_count = MaxPointsPerPackge_GS1; //一个包固定216个数据 ++ // printf("send frameNum: %d,moduleNum: %d\n",frameNum,moduleNum); ++ // fflush(stdout); ++ _dataEvent.set(); ++ _lock.unlock(); ++ scan_count = 0; ++ isPrepareToSend = false; ++ } ++ ++ m_isScanning = false; ++ ++ return RESULT_OK; ++ } ++ ++ result_t GS1LidarDriver::waitPackage(node_info *node, uint32_t timeout) ++ { ++ int recvPos = 0; ++ uint32_t startTs = getms(); ++ uint32_t waitTime = 0; ++ uint8_t *packageBuffer = (uint8_t *)&package; ++ isValidPoint = true; ++ int package_recvPos = 0; ++ uint16_t sample_lens = 0; ++ has_device_header = false; ++ uint16_t package_Sample_Num = 0; ++ ++ if (package_Sample_Index == 0) ++ { ++ recvPos = 0; ++ ++ while ((waitTime = getms() - startTs) <= timeout) ++ { ++ size_t remainSize = PackagePaidBytes_GS - recvPos; ++ size_t recvSize = 0; ++ CheckSumCal = 0; ++ result_t ans = waitForData(remainSize, timeout - waitTime, &recvSize); ++ ++ if (!IS_OK(ans)) ++ { ++ return ans; ++ } ++ ++ if (recvSize > remainSize) ++ { ++ recvSize = remainSize; ++ } ++ ++ getData(globalRecvBuffer, recvSize); ++ ++ for (size_t pos = 0; pos < recvSize; ++pos) ++ { ++ uint8_t currentByte = globalRecvBuffer[pos]; ++ switch (recvPos) ++ { ++ case 0: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ break; ++ case 1: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ break; ++ case 2: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ break; ++ case 3: ++ if (currentByte != LIDAR_ANS_SYNC_BYTE1) ++ { ++ recvPos = 0; ++ continue; ++ } ++ has_device_header = true; ++ break; ++ case 4: ++ if (currentByte == LIDAR_ANS_SYNC_BYTE1) //如果出现超过4个包头标识的情况 ++ { ++ recvPos = 4; ++ continue; ++ } ++ moduleNum = currentByte; ++ CheckSumCal += currentByte; ++ break; ++ ++ case 5: ++ if (currentByte != GS_LIDAR_ANS_SCAN) ++ { ++ recvPos = 0; ++ CheckSumCal = 0; ++ moduleNum = 0; ++ has_device_header = false; ++ continue; ++ } ++ CheckSumCal += currentByte; ++ break; ++ ++ case 6: ++ sample_lens |= 0x00ff & currentByte; ++ CheckSumCal += currentByte; ++ break; ++ ++ case 7: ++ sample_lens |= (0x00ff & currentByte) << 8; ++ CheckSumCal += currentByte; ++ break; ++ ++ default: ++ break; ++ } ++ ++ packageBuffer[recvPos++] = currentByte; ++ } ++ ++ if (has_device_header && ++ recvPos == PackagePaidBytes_GS) ++ { ++ if (!sample_lens) ++ { ++ recvPos = 0; ++ moduleNum = 0; ++ has_device_header = false; ++ continue; ++ } ++ package_Sample_Num = sample_lens + 1; //环境2Bytes + 点云320Bytes + CRC ++ package_recvPos = recvPos; ++ // printf("sample num %d\n", (package_Sample_Num - 3) / 2); ++ break; ++ } ++ else ++ { ++ recvPos = 0; ++ // printf("invalid data\n"); ++ continue; ++ } ++ } ++ ++ if (PackagePaidBytes_GS == recvPos) ++ { ++ startTs = getms(); ++ recvPos = 0; ++ ++ while ((waitTime = getms() - startTs) <= timeout) ++ { ++ size_t remainSize = package_Sample_Num - recvPos; ++ size_t recvSize = 0; ++ result_t ans = waitForData(remainSize, timeout - waitTime, &recvSize); ++ ++ if (!IS_OK(ans)) ++ { ++ return ans; ++ } ++ ++ if (recvSize > remainSize) ++ { ++ recvSize = remainSize; ++ } ++ ++ getData(globalRecvBuffer, recvSize); ++ ++ for (size_t pos = 0; pos < recvSize - 1; pos++) ++ { ++ CheckSumCal += globalRecvBuffer[pos]; ++ packageBuffer[package_recvPos + recvPos] = globalRecvBuffer[pos]; ++ recvPos++; ++ } ++ CheckSum = globalRecvBuffer[recvSize - 1]; // crc ++ packageBuffer[package_recvPos + recvPos] = CheckSum; // crc ++ recvPos += 1; ++ ++ if (package_Sample_Num == recvPos) ++ { ++ package_recvPos += recvPos; ++ break; ++ } ++ } ++ ++ if (package_Sample_Num != recvPos) ++ { ++ return RESULT_FAIL; ++ } ++ } ++ else ++ { ++ return RESULT_FAIL; ++ } ++ ++ if (CheckSumCal != CheckSum) ++ { ++ CheckSumResult = false; ++ has_package_error = true; ++ } ++ else ++ { ++ CheckSumResult = true; ++ ++ // printf("env: 0x%04X\n", package.BackgroudLight); ++ // fflush(stdout); ++ } ++ } ++ ++ (*node).stamp = getTime(); ++ ++ if (CheckSumResult) ++ { ++ (*node).index = 0x03 & (moduleNum >> 1); ++ (*node).scan_frequence = scan_frequence; ++ (*node).sync_quality = 0; ++ ++ (*node).distance_q2 = ++ package.packageSample[package_Sample_Index].PakageSampleDistance; ++ ++ if (m_intensities) ++ { ++ (*node).sync_quality = (uint16_t)package.packageSample[package_Sample_Index].PakageSampleQuality; ++ } ++ ++ double sampleAngle = 0; ++ if (node->distance_q2 > 0) ++ { ++ angTransform((*node).distance_q2, package_Sample_Index, &sampleAngle, &(*node).distance_q2); ++ } ++ // printf("%lf ", sampleAngle); ++ if (sampleAngle < 0) ++ { ++ (*node).angle_q6_checkbit = (((uint16_t)(sampleAngle * 64 + 23040)) << LIDAR_RESP_MEASUREMENT_ANGLE_SHIFT) + ++ LIDAR_RESP_MEASUREMENT_CHECKBIT; ++ } ++ else ++ { ++ if ((sampleAngle * 64) > 23040) ++ { ++ (*node).angle_q6_checkbit = (((uint16_t)(sampleAngle * 64 - 23040)) << LIDAR_RESP_MEASUREMENT_ANGLE_SHIFT) + ++ LIDAR_RESP_MEASUREMENT_CHECKBIT; ++ } ++ else ++ { ++ (*node).angle_q6_checkbit = (((uint16_t)(sampleAngle * 64)) << LIDAR_RESP_MEASUREMENT_ANGLE_SHIFT) + ++ LIDAR_RESP_MEASUREMENT_CHECKBIT; ++ } ++ } ++ ++ //处理环境数据(2个字节分别存储在两个点的is属性中) ++ if (0 == package_Sample_Index) ++ (*node).is = package.BackgroudLight & 0xFF; ++ else if (1 == package_Sample_Index) ++ (*node).is = package.BackgroudLight >> 8; ++ ++ // printf("%s [%d] : Out : %u %u %u\n", __FUNCTION__, __LINE__, package_Sample_Index, node->distance_q2, node->angle_q6_checkbit); ++ } ++ else ++ { ++ (*node).sync_flag = Node_NotSync; ++ (*node).sync_quality = 0; ++ (*node).angle_q6_checkbit = LIDAR_RESP_MEASUREMENT_CHECKBIT; ++ (*node).distance_q2 = 0; ++ (*node).scan_frequence = 0; ++ return RESULT_FAIL; ++ } ++ ++ package_Sample_Index ++; ++ (*node).sync_flag = Node_NotSync; ++ ++ if (package_Sample_Index >= MaxPointsPerPackge_GS1) ++ { ++ package_Sample_Index = 0; ++ (*node).sync_flag = Node_Sync; ++ CheckSumResult = false; ++ } ++ ++ return RESULT_OK; ++ } ++ ++ void GS1LidarDriver::angTransform(uint16_t dist, int n, double *dstTheta, uint16_t *dstDist) ++ { ++ double pixelU = n, Dist, theta, tempTheta, tempDist, tempX, tempY; ++ uint8_t mdNum = 0x03 & (moduleNum >> 1); // 1,2,4 ++ ++ tempTheta = atan(d_compensateK0[mdNum] * pixelU - d_compensateB0[mdNum]) * 180 / M_PI; ++ Dist = dist / cos(tempTheta * M_PI / 180); ++ theta = tempTheta; ++ ++ if (theta < 0) ++ { ++ theta += 360; ++ } ++ *dstTheta = theta; ++ *dstDist = Dist; ++ } ++ ++ void GS1LidarDriver::addPointsToVec(node_info *nodebuffer, size_t &count) ++ { ++ size_t size = multi_package.size(); ++ bool isFound = false; ++ for (size_t i = 0; i < size; i++) ++ { ++ if (multi_package[i].frameNum == frameNum && multi_package[i].moduleNum == moduleNum) ++ { ++ isFound = true; ++ memcpy(multi_package[i].all_points, nodebuffer, sizeof(node_info) * count); ++ isPrepareToSend = true; ++ if (frameNum > 0) ++ { ++ int lastFrame = frameNum - 1; ++ for (size_t j = 0; j < size; j++) ++ { ++ if (multi_package[j].frameNum == lastFrame && multi_package[j].moduleNum == moduleNum) ++ { ++ break; ++ } ++ } ++ } ++ break; ++ } ++ } ++ if (!isFound) ++ { ++ GS1_Multi_Package package; ++ package.frameNum = frameNum; ++ package.moduleNum = moduleNum; ++ multi_package.push_back(package); ++ } ++ // printf("add points, [sync:%d] [%u]\n",package_type,frameNum); ++ // fflush(stdout); ++ } ++ ++ result_t GS1LidarDriver::waitScanData( ++ node_info *nodebuffer, ++ size_t &count, ++ uint32_t timeout) ++ { ++ if (!m_isConnected) ++ { ++ count = 0; ++ return RESULT_FAIL; ++ } ++ ++ size_t recvNodeCount = 0; ++ uint32_t startTs = getms(); ++ uint32_t waitTime = 0; ++ result_t ans = RESULT_FAIL; ++ ++ while ((waitTime = getms() - startTs) <= timeout && recvNodeCount < count) ++ { ++ node_info node; ++ memset(&node, 0, sizeof(node_info)); ++ ans = waitPackage(&node, timeout - waitTime); ++ ++ if (!IS_OK(ans)) ++ { ++ count = recvNodeCount; ++ return ans; ++ } ++ nodebuffer[recvNodeCount++] = node; ++ ++ if (!package_Sample_Index) ++ { ++ ++ size_t size = _serial->available(); ++ uint64_t delayTime = 0; ++ size_t PackageSize = sizeof(gs1_node_package); ++ ++ if (size > PackagePaidBytes_GS) ++ { ++ size_t packageNum = size / PackageSize; ++ size_t Number = size % PackageSize; ++ delayTime = packageNum * m_PointTime * PackageSize / 2; ++ ++ if (Number > PackagePaidBytes_GS) ++ { ++ delayTime += m_PointTime * ((Number - PackagePaidBytes_GS) / 2); ++ } ++ ++ size = Number; ++ ++ if (packageNum > 0 && Number == 0) ++ { ++ size = PackageSize; ++ } ++ } ++ addPointsToVec(nodebuffer, recvNodeCount); ++ ++ nodebuffer[recvNodeCount - 1].stamp = size * trans_delay + delayTime; ++ nodebuffer[recvNodeCount - 1].scan_frequence = node.scan_frequence; ++ count = recvNodeCount; ++ return RESULT_OK; ++ } ++ ++ if (recvNodeCount == count) ++ { ++ return RESULT_OK; ++ } ++ } ++ ++ count = recvNodeCount; ++ return RESULT_FAIL; ++ } ++ ++ result_t GS1LidarDriver::grabScanData(node_info *nodebuffer, size_t &count, ++ uint32_t timeout) ++ { ++ switch (_dataEvent.wait(timeout)) ++ { ++ case Event::EVENT_TIMEOUT: ++ count = 0; ++ return RESULT_TIMEOUT; ++ ++ case Event::EVENT_OK: ++ { ++ if (scan_node_count == 0) ++ { ++ return RESULT_FAIL; ++ } ++ ++ ScopedLocker l(_lock); ++ size_t size_to_copy = min(count, scan_node_count); ++ memcpy(nodebuffer, scan_node_buf, size_to_copy * sizeof(node_info)); ++ count = size_to_copy; ++ scan_node_count = 0; ++ } ++ ++ return RESULT_OK; ++ ++ default: ++ count = 0; ++ return RESULT_FAIL; ++ } ++ } ++ ++ result_t GS1LidarDriver::ascendScanData(node_info *nodebuffer, size_t count) ++ { ++ float inc_origin_angle = (float)360.0 / count; ++ int i = 0; ++ ++ for (i = 0; i < (int)count; i++) ++ { ++ if (nodebuffer[i].distance_q2 == 0) ++ { ++ continue; ++ } ++ else ++ { ++ while (i != 0) ++ { ++ i--; ++ float expect_angle = (nodebuffer[i + 1].angle_q6_checkbit >> ++ LIDAR_RESP_MEASUREMENT_ANGLE_SHIFT) / ++ 64.0f - ++ inc_origin_angle; ++ ++ if (expect_angle < 0.0f) ++ { ++ expect_angle = 0.0f; ++ } ++ ++ uint16_t checkbit = nodebuffer[i].angle_q6_checkbit & ++ LIDAR_RESP_MEASUREMENT_CHECKBIT; ++ nodebuffer[i].angle_q6_checkbit = (((uint16_t)(expect_angle * 64.0f)) << LIDAR_RESP_MEASUREMENT_ANGLE_SHIFT) + checkbit; ++ } ++ ++ break; ++ } ++ } ++ ++ if (i == (int)count) ++ { ++ return RESULT_FAIL; ++ } ++ ++ for (i = (int)count - 1; i >= 0; i--) ++ { ++ if (nodebuffer[i].distance_q2 == 0) ++ { ++ continue; ++ } ++ else ++ { ++ while (i != ((int)count - 1)) ++ { ++ i++; ++ float expect_angle = (nodebuffer[i - 1].angle_q6_checkbit >> ++ LIDAR_RESP_MEASUREMENT_ANGLE_SHIFT) / ++ 64.0f + ++ inc_origin_angle; ++ ++ if (expect_angle > 360.0f) ++ { ++ expect_angle -= 360.0f; ++ } ++ ++ uint16_t checkbit = nodebuffer[i].angle_q6_checkbit & ++ LIDAR_RESP_MEASUREMENT_CHECKBIT; ++ nodebuffer[i].angle_q6_checkbit = (((uint16_t)(expect_angle * 64.0f)) << LIDAR_RESP_MEASUREMENT_ANGLE_SHIFT) + checkbit; ++ } ++ ++ break; ++ } ++ } ++ ++ float frontAngle = (nodebuffer[0].angle_q6_checkbit >> ++ LIDAR_RESP_MEASUREMENT_ANGLE_SHIFT) / ++ 64.0f; ++ ++ for (i = 1; i < (int)count; i++) ++ { ++ if (nodebuffer[i].distance_q2 == 0) ++ { ++ float expect_angle = frontAngle + i * inc_origin_angle; ++ ++ if (expect_angle > 360.0f) ++ { ++ expect_angle -= 360.0f; ++ } ++ ++ uint16_t checkbit = nodebuffer[i].angle_q6_checkbit & ++ LIDAR_RESP_MEASUREMENT_CHECKBIT; ++ nodebuffer[i].angle_q6_checkbit = (((uint16_t)(expect_angle * 64.0f)) << LIDAR_RESP_MEASUREMENT_ANGLE_SHIFT) + checkbit; ++ } ++ } ++ ++ size_t zero_pos = 0; ++ float pre_degree = (nodebuffer[0].angle_q6_checkbit >> ++ LIDAR_RESP_MEASUREMENT_ANGLE_SHIFT) / ++ 64.0f; ++ ++ for (i = 1; i < (int)count; ++i) ++ { ++ float degree = (nodebuffer[i].angle_q6_checkbit >> ++ LIDAR_RESP_MEASUREMENT_ANGLE_SHIFT) / ++ 64.0f; ++ ++ if (zero_pos == 0 && (pre_degree - degree > 180)) ++ { ++ zero_pos = i; ++ break; ++ } ++ ++ pre_degree = degree; ++ } ++ ++ node_info *tmpbuffer = new node_info[count]; ++ ++ for (i = (int)zero_pos; i < (int)count; i++) ++ { ++ tmpbuffer[i - zero_pos] = nodebuffer[i]; ++ } ++ ++ for (i = 0; i < (int)zero_pos; i++) ++ { ++ tmpbuffer[i + (int)count - zero_pos] = nodebuffer[i]; ++ } ++ ++ memcpy(nodebuffer, tmpbuffer, count * sizeof(node_info)); ++ delete[] tmpbuffer; ++ ++ return RESULT_OK; ++ } ++ ++ /************************************************************************/ ++ /* get device parameters of gs lidar */ ++ /************************************************************************/ ++ result_t GS1LidarDriver::getDevicePara(gs_device_para &info, uint32_t timeout) ++ { ++ result_t ans; ++ uint8_t crcSum, mdNum; ++ uint8_t *pInfo = reinterpret_cast(&info); ++ ++ if (!m_isConnected) ++ { ++ return RESULT_FAIL; ++ } ++ ++ disableDataGrabbing(); ++ flushSerial(); ++ { ++ ScopedLocker l(_lock); ++ ++ if ((ans = sendCommand(GS_LIDAR_CMD_GET_PARAMETER)) != RESULT_OK) ++ { ++ return ans; ++ } ++ gs_lidar_ans_header response_header; ++ // for(int i = 0; i < PackageMaxModuleNums; i++) ++ { ++ if ((ans = waitResponseHeader(&response_header, timeout)) != RESULT_OK) ++ { ++ return ans; ++ } ++ if (response_header.type != GS_LIDAR_CMD_GET_PARAMETER) ++ { ++ return RESULT_FAIL; ++ } ++ if (response_header.size < (sizeof(gs_device_para) - 1)) ++ { ++ return RESULT_FAIL; ++ } ++ if (waitForData(response_header.size + 1, timeout) != RESULT_OK) ++ { ++ return RESULT_FAIL; ++ } ++ getData(reinterpret_cast(&info), sizeof(info)); ++ ++ crcSum = 0; ++ crcSum += response_header.address; ++ crcSum += response_header.type; ++ crcSum += 0xff & response_header.size; ++ crcSum += 0xff & (response_header.size >> 8); ++ for (int j = 0; j < response_header.size; j++) ++ { ++ crcSum += pInfo[j]; ++ } ++ if (crcSum != info.crc) ++ { ++ return RESULT_FAIL; ++ } ++ ++ mdNum = response_header.address >> 1; // 1,2,4 ++ if (mdNum > 2) ++ { ++ return RESULT_FAIL; ++ } ++ u_compensateK0[mdNum] = info.u_compensateK0; ++ u_compensateK1[mdNum] = info.u_compensateK1; ++ u_compensateB0[mdNum] = info.u_compensateB0; ++ u_compensateB1[mdNum] = info.u_compensateB1; ++ d_compensateK0[mdNum] = info.u_compensateK0 / 10000.00; ++ d_compensateK1[mdNum] = info.u_compensateK1 / 10000.00; ++ d_compensateB0[mdNum] = info.u_compensateB0 / 10000.00; ++ d_compensateB1[mdNum] = info.u_compensateB1 / 10000.00; ++ bias[mdNum] = double(info.bias) * 0.1; ++ delay(5); ++ } ++ } ++ ++ return RESULT_OK; ++ } ++ ++ result_t GS1LidarDriver::setDeviceAddress(uint32_t timeout) ++ { ++ result_t ans; ++ ++ if (!m_isConnected) ++ { ++ return RESULT_FAIL; ++ } ++ ++ if (m_SingleChannel) ++ { ++ return RESULT_OK; ++ } ++ ++ disableDataGrabbing(); ++ flushSerial(); ++ { ++ ScopedLocker l(_lock); ++ ++ if ((ans = sendCommand(GS_LIDAR_CMD_GET_ADDRESS)) != RESULT_OK) ++ { ++ return ans; ++ } ++ ++ gs_lidar_ans_header response_header; ++ if ((ans = waitResponseHeader(&response_header, timeout)) != RESULT_OK) ++ { ++ return ans; ++ } ++ ++ if (response_header.type != GS_LIDAR_CMD_GET_ADDRESS) ++ { ++ return RESULT_FAIL; ++ } ++ ++ printf("[YDLIDAR] Lidar module count %d", (response_header.address << 1) + 1); ++ } ++ ++ return RESULT_OK; ++ } ++ ++ /************************************************************************/ ++ /* the set to signal quality */ ++ /************************************************************************/ ++ void GS1LidarDriver::setIntensities(const bool &i) ++ { ++ m_intensities = i; ++ // if (m_intensities != isintensities) ++ // { ++ // if (globalRecvBuffer) ++ // { ++ // delete[] globalRecvBuffer; ++ // globalRecvBuffer = NULL; ++ // } ++ ++ // globalRecvBuffer = new uint8_t[sizeof(gs1_node_package)]; ++ // } ++ ++ // m_intensities = isintensities; ++ ++ // if (m_intensities) ++ // { ++ // PackageSampleBytes = 2; ++ // } ++ // else ++ // { ++ // PackageSampleBytes = 2; ++ // } ++ } ++ /** ++ * @brief 设置雷达异常自动重新连接 \n ++ * @param[in] enable 是否开启自动重连: ++ * true 开启 ++ * false 关闭 ++ */ ++ void GS1LidarDriver::setAutoReconnect(const bool &enable) ++ { ++ isAutoReconnect = enable; ++ } ++ ++ void GS1LidarDriver::checkTransDelay() ++ { ++ //采样率 ++ trans_delay = _serial->getByteTime(); ++ sample_rate = 27 * MaxPointsPerPackge_GS1; ++ m_PointTime = 1e9 / sample_rate; ++ } ++ ++ /************************************************************************/ ++ /* start to scan */ ++ /************************************************************************/ ++ result_t GS1LidarDriver::startScan(bool force, uint32_t timeout) ++ { ++ result_t ans; ++ ++ if (!m_isConnected) ++ { ++ return RESULT_FAIL; ++ } ++ ++ if (m_isScanning) ++ { ++ return RESULT_OK; ++ } ++ ++ stop(); ++ checkTransDelay(); ++ flushSerial(); ++ ++ //配置GS1模组地址(三个模组) ++ // setDeviceAddress(300); ++ ++ //获取GS1参数 ++ gs_device_para gs1_info; ++ // delay(30); ++ getDevicePara(gs1_info, 300); ++ // delay(30); ++ { ++ flushSerial(); ++ ++ ScopedLocker l(_lock); ++ if ((ans = sendCommand(force ? LIDAR_CMD_FORCE_SCAN : GS_LIDAR_CMD_SCAN)) != ++ RESULT_OK) ++ { ++ return ans; ++ } ++ ++ if (!m_SingleChannel) ++ { ++ gs_lidar_ans_header response_header; ++ ++ if ((ans = waitResponseHeader(&response_header, timeout)) != RESULT_OK) ++ { ++ return ans; ++ } ++ ++ if (response_header.type != GS_LIDAR_ANS_SCAN) ++ { ++ printf("[CYdLidar] Response to start scan type error!\n"); ++ return RESULT_FAIL; ++ } ++ } ++ ++ ans = this->createThread(); ++ } ++ ++ return ans; ++ } ++ ++ result_t GS1LidarDriver::stopScan(uint32_t timeout) ++ { ++ UNUSED(timeout); ++ result_t ans; ++ ++ if (!m_isConnected) ++ { ++ return RESULT_FAIL; ++ } ++ ++ ScopedLocker l(_lock); ++ ++ if ((ans = sendCommand(GS_LIDAR_CMD_STOP)) != RESULT_OK) ++ { ++ return ans; ++ } ++ gs_lidar_ans_header response_header; ++ if ((ans = waitResponseHeader(&response_header, timeout)) != RESULT_OK) ++ { ++ return ans; ++ } ++ if (response_header.type != GS_LIDAR_CMD_STOP) ++ { ++ return RESULT_FAIL; ++ } ++ delay(10); ++ printf("GS1LidarDriver stop lidar successfully\n"); ++ ++ return RESULT_OK; ++ } ++ ++ result_t GS1LidarDriver::createThread() ++ { ++ _thread = CLASS_THREAD(GS1LidarDriver, cacheScanData); ++ ++ if (_thread.getHandle() == 0) ++ { ++ m_isScanning = false; ++ return RESULT_FAIL; ++ } ++ ++ m_isScanning = true; ++ return RESULT_OK; ++ } ++ ++ result_t GS1LidarDriver::startAutoScan(bool force, uint32_t timeout) ++ { ++ result_t ans; ++ ++ if (!m_isConnected) ++ { ++ return RESULT_FAIL; ++ } ++ ++ flushSerial(); ++ delay(10); ++ { ++ ++ ScopedLocker l(_lock); ++ ++ if ((ans = sendCommand(force ? LIDAR_CMD_FORCE_SCAN : GS_LIDAR_CMD_SCAN)) != ++ RESULT_OK) ++ { ++ return ans; ++ } ++ ++ if (!m_SingleChannel) ++ { ++ gs_lidar_ans_header response_header; ++ ++ if ((ans = waitResponseHeader(&response_header, timeout)) != RESULT_OK) ++ { ++ return ans; ++ } ++ ++ if (response_header.type != GS_LIDAR_CMD_SCAN) ++ { ++ return RESULT_FAIL; ++ } ++ } ++ } ++ ++ return RESULT_OK; ++ } ++ ++ /************************************************************************/ ++ /* stop scan */ ++ /************************************************************************/ ++ result_t GS1LidarDriver::stop() ++ { ++ if (isAutoconnting) ++ { ++ isAutoReconnect = false; ++ m_isScanning = false; ++ } ++ ++ disableDataGrabbing(); ++ stopScan(); ++ ++ return RESULT_OK; ++ } ++ ++ /************************************************************************/ ++ /* reset device */ ++ /************************************************************************/ ++ result_t GS1LidarDriver::reset(uint8_t addr, uint32_t timeout) ++ { ++ UNUSED(timeout); ++ result_t ans; ++ ++ if (!m_isConnected) ++ { ++ return RESULT_FAIL; ++ } ++ ++ ScopedLocker l(_lock); ++ ++ if ((ans = sendCommand(addr, GS_LIDAR_CMD_RESET)) != RESULT_OK) ++ { ++ return ans; ++ } ++ ++ return RESULT_OK; ++ } ++ ++ std::string GS1LidarDriver::getSDKVersion() ++ { ++ return YDLIDAR_SDK_VERSION_STR; ++ } ++ ++ std::map GS1LidarDriver::lidarPortList() ++ { ++ std::vector lst = list_ports(); ++ std::map ports; ++ ++ for (std::vector::iterator it = lst.begin(); it != lst.end(); it++) ++ { ++ std::string port = "ydlidar" + (*it).device_id; ++ ports[port] = (*it).port; ++ } ++ ++ return ports; ++ } ++ ++ const char *GS1LidarDriver::DescribeError(bool isTCP) ++ { ++ if (_serial) ++ { ++ return _serial->DescribeError(); ++ } ++ return nullptr; ++ } ++ ++ result_t GS1LidarDriver::getHealth(device_health &, uint32_t) ++ { ++ return RESULT_OK; ++ } ++ ++ result_t GS1LidarDriver::getDeviceInfo(device_info &info, uint32_t timeout) ++ { ++ result_t ret = RESULT_OK; ++ ++ if (!m_isConnected) ++ { ++ return RESULT_FAIL; ++ } ++ ++ disableDataGrabbing(); ++ // flushSerial(); ++ { ++ ScopedLocker l(_lock); ++ ++ if ((ret = sendCommand(GS_LIDAR_CMD_GET_VERSION)) != RESULT_OK) ++ { ++ return ret; ++ } ++ ++ gs_lidar_ans_header head; ++ if ((ret = waitResponseHeaderEx(&head, GS_LIDAR_CMD_GET_VERSION, timeout)) != RESULT_OK) ++ { ++ return ret; ++ } ++ if (head.type != GS_LIDAR_CMD_GET_VERSION) ++ { ++ return RESULT_FAIL; ++ } ++ if (head.size < sizeof(gs_device_info)) ++ { ++ return RESULT_FAIL; ++ } ++ ++ if (waitForData(head.size + 1, timeout) != RESULT_OK) ++ { ++ return RESULT_FAIL; ++ } ++ gs_device_info di = {0}; ++ getData(reinterpret_cast(&di), sizeof(di)); ++ model = YDLIDAR_GS1; ++ info.model = model; ++ info.hardware_version = di.hardware_version; ++ info.firmware_version = uint16_t((di.firmware_version & 0xFF) << 8) + ++ uint16_t(di.firmware_version >> 8); ++ memcpy(info.serialnum, di.serialnum, 16); ++ // head.address; //雷达序号 ++ } ++ ++ return RESULT_OK; ++ } ++ ++ result_t GS1LidarDriver::setWorkMode(int mode, uint8_t addr) ++ { ++ result_t ans; ++ uint32_t timeout = 300; ++ string buf; ++ ++ if (!isconnected()) ++ { ++ return RESULT_FAIL; ++ } ++ ++ //如果已经开启扫描,则先停止扫描 ++ if (isscanning()) ++ { ++ disableDataGrabbing(); ++ delay(10); ++ stopScan(); ++ } ++ flushSerial(); ++ ++ { ++ ScopedLocker l(_lock); ++ uint8_t m = uint8_t(mode); ++ if ((ans = sendCommand(addr, GS_LIDAR_CMD_SET_MODE, &m, 1)) != RESULT_OK) ++ { ++ return ans; ++ } ++ gs_lidar_ans_header response_header; ++ if ((ans = waitResponseHeaderEx(&response_header, GS_LIDAR_CMD_SET_MODE, timeout)) != RESULT_OK) ++ { ++ return ans; ++ } ++ if (response_header.type != GS_LIDAR_CMD_SET_MODE) ++ { ++ return RESULT_FAIL; ++ } ++ } ++ ++ return RESULT_OK; ++ } ++ ++} +diff --git a/src/GS1LidarDriver.h b/src/GS1LidarDriver.h +new file mode 100644 +index 0000000..c49ce81 +--- /dev/null ++++ b/src/GS1LidarDriver.h +@@ -0,0 +1,589 @@ ++/********************************************************************* ++* Software License Agreement (BSD License) ++* ++* Copyright (c) 2018, EAIBOT, Inc. ++* All rights reserved. ++* ++* Redistribution and use in source and binary forms, with or without ++* modification, are permitted provided that the following conditions ++* are met: ++* ++* * Redistributions of source code must retain the above copyright ++* notice, this list of conditions and the following disclaimer. ++* * Redistributions in binary form must reproduce the above ++* copyright notice, this list of conditions and the following ++* disclaimer in the documentation and/or other materials provided ++* with the distribution. ++* * Neither the name of the Willow Garage nor the names of its ++* contributors may be used to endorse or promote products derived ++* from this software without specific prior written permission. ++* ++* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ++* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ++* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ++* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, ++* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ++* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ++* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ++* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++* POSSIBILITY OF SUCH DAMAGE. ++*********************************************************************/ ++ ++/** @page GS1LidarDriver ++ * GS1LidarDriver API ++ ++
Library GS1LidarDriver ++
File GS1LidarDriver.h ++
Author Tony [code at ydlidar com] ++
Source https://github.com/ydlidar/YDLidar-SDK ++
Version 1.0.0 ++
++ This GS1LidarDriver support [TYPE_TRIANGLE](\ref LidarTypeID::TYPE_TRIANGLE) and [TYPE_TOF](\ref LidarTypeID::TYPE_TOF) LiDAR ++ ++* @copyright Copyright (c) 2018-2020 EAIBOT ++ Jump to the @link ::ydlidar::GS1LidarDriver @endlink interface documentation. ++*/ ++#ifndef GS1_YDLIDAR_DRIVER_H ++#define GS1_YDLIDAR_DRIVER_H ++ ++#include ++#include ++#include ++#include "core/serial/serial.h" ++#include "core/base/locker.h" ++#include "core/base/thread.h" ++#include "core/common/ydlidar_protocol.h" ++#include "core/common/ydlidar_help.h" ++ ++#if !defined(__cplusplus) ++#ifndef __cplusplus ++#error "The YDLIDAR SDK requires a C++ compiler to be built" ++#endif ++#endif ++ ++ ++using namespace std; ++ ++namespace ydlidar { ++ ++using namespace core; ++using namespace core::serial; ++using namespace core::base; ++ ++/*! ++* GS1操控类 ++*/ ++class GS1LidarDriver : public DriverInterface { ++ public: ++ /** ++ * @brief Set and Get LiDAR single channel. ++ * Whether LiDAR communication channel is a single-channel ++ * @note For a single-channel LiDAR, if the settings are reversed.\n ++ * an error will occur in obtaining device information and the LiDAR will Faied to Start.\n ++ * For dual-channel LiDAR, if th setttings are reversed.\n ++ * the device information cannot be obtained.\n ++ * Set the single channel to match the LiDAR. ++ * @remarks ++ ++
G1/G2/G2A/G2C false ++
G4/G4B/G4PRO/G6/F4/F4PRO false ++
S4/S4B/X4/R2/G4C false ++
S2/X2/X2L false ++
TG15/TG30/TG50 false ++
TX8/TX20 false ++
T5/T15 false ++
GS1 true ++
++ * @see DriverInterface::setSingleChannel and DriverInterface::getSingleChannel ++ */ ++ PropertyBuilderByName(bool, SingleChannel, private); ++ /** ++ * @brief Set and Get LiDAR Type. ++ * @note Refer to the table below for the LiDAR Type.\n ++ * Set the LiDAR Type to match the LiDAR. ++ * @remarks ++ ++
G1/G2A/G2/G2C [TYPE_TRIANGLE](\ref LidarTypeID::TYPE_TRIANGLE) ++
G4/G4B/G4C/G4PRO [TYPE_TRIANGLE](\ref LidarTypeID::TYPE_TRIANGLE) ++
G6/F4/F4PRO [TYPE_TRIANGLE](\ref LidarTypeID::TYPE_TRIANGLE) ++
S4/S4B/X4/R2/S2/X2/X2L [TYPE_TRIANGLE](\ref LidarTypeID::TYPE_TRIANGLE) ++
TG15/TG30/TG50/TX8/TX20 [TYPE_TOF](\ref LidarTypeID::TYPE_TOF) ++
T5/T15 [TYPE_TOF_NET](\ref LidarTypeID::TYPE_TOF_NET) ++
GS1 [TYPE_GS](\ref LidarTypeID::TYPE_GS) ++
++ * @see [LidarTypeID](\ref LidarTypeID) ++ * @see DriverInterface::setLidarType and DriverInterface::getLidarType ++ */ ++ PropertyBuilderByName(int, LidarType, private); ++ /** ++ * @brief Set and Get Sampling interval. ++ * @note Negative correlation between sampling interval and lidar sampling rate.\n ++ * sampling interval = 1e9 / sampling rate(/s)\n ++ * Set the LiDAR sampling interval to match the LiDAR. ++ * @see DriverInterface::setPointTime and DriverInterface::getPointTime ++ */ ++ PropertyBuilderByName(uint32_t, PointTime,private); ++ /*! ++ * A constructor. ++ * A more elaborate description of the constructor. ++ */ ++ GS1LidarDriver(); ++ ++ /*! ++ * A destructor. ++ * A more elaborate description of the destructor. ++ */ ++ virtual ~GS1LidarDriver(); ++ ++ /*! ++ * @brief 连接雷达 \n ++ * 连接成功后,必须使用::disconnect函数关闭 ++ * @param[in] port_path 串口号 ++ * @param[in] baudrate 波特率,YDLIDAR-GS1 雷达波特率:961200 ++ * @return 返回连接状态 ++ * @retval 0 成功 ++ * @retval < 0 失败 ++ * @note连接成功后,必须使用::disconnect函数关闭 ++ * @see 函数::GS1LidarDriver::disconnect (“::”是指定有连接功能,可以看文档里的disconnect变成绿,点击它可以跳转到disconnect.) ++ */ ++ result_t connect(const char *port_path, uint32_t baudrate); ++ ++ /*! ++ * @brief 断开雷达连接 ++ */ ++ void disconnect(); ++ ++ /*! ++ * @brief 获取当前SDK版本号 \n ++ * 静态函数 ++ * @return 返回当前SKD 版本号 ++ */ ++ virtual std::string getSDKVersion(); ++ ++ /*! ++ * @brief lidarPortList 获取雷达端口 ++ * @return 在线雷达列表 ++ */ ++ static std::map lidarPortList(); ++ ++ /*! ++ * @brief 扫图状态 \n ++ * @return 返回当前雷达扫图状态 ++ * @retval true 正在扫图 ++ * @retval false 扫图关闭 ++ */ ++ bool isscanning() const; ++ ++ /*! ++ * @brief 连接雷达状态 \n ++ * @return 返回连接状态 ++ * @retval true 成功 ++ * @retval false 失败 ++ */ ++ bool isconnected() const; ++ ++ /*! ++ * @brief 设置雷达是否带信号质量 \n ++ * 连接成功后,必须使用::disconnect函数关闭 ++ * @param[in] isintensities 是否带信号质量: ++ * true 带信号质量 ++ * false 无信号质量 ++ * @note只有S4B(波特率是153600)雷达支持带信号质量, 别的型号雷达暂不支持 ++ */ ++ void setIntensities(const bool &isintensities); ++ ++ /*! ++ * @brief 设置雷达异常自动重新连接 \n ++ * @param[in] enable 是否开启自动重连: ++ * true 开启 ++ * false 关闭 ++ */ ++ void setAutoReconnect(const bool &enable); ++ ++ /*! ++ * @brief 获取雷达设备信息 \n ++ * @param[in] parameters 设备信息 ++ * @param[in] timeout 超时时间 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 获取成功 ++ * @retval RESULT_FAILE or RESULT_TIMEOUT 获取失败 ++ */ ++ result_t getDevicePara(gs_device_para &info, uint32_t timeout = DEFAULT_TIMEOUT); ++ ++ /*! ++ * @brief 配置雷达地址 \n ++ * @param[in] timeout 超时时间 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 配置成功 ++ * @retval RESULT_FAILE or RESULT_TIMEOUT 配置超时 ++ */ ++ result_t setDeviceAddress(uint32_t timeout = DEFAULT_TIMEOUT); ++ ++ /*! ++ * @brief 开启扫描 \n ++ * @param[in] force 扫描模式 ++ * @param[in] timeout 超时时间 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 开启成功 ++ * @retval RESULT_FAILE 开启失败 ++ * @note 只用开启一次成功即可 ++ */ ++ result_t startScan(bool force = false, uint32_t timeout = DEFAULT_TIMEOUT); ++ ++ /*! ++ * @brief 关闭扫描 \n ++ * @return 返回执行结果 ++ * @retval RESULT_OK 关闭成功 ++ * @retval RESULT_FAILE 关闭失败 ++ */ ++ result_t stop(); ++ ++ /*! ++ * @brief 获取激光数据 \n ++ * @param[in] nodebuffer 激光点信息 ++ * @param[in] count 一圈激光点数 ++ * @param[in] timeout 超时时间 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 获取成功 ++ * @retval RESULT_FAILE 获取失败 ++ * @note 获取之前,必须使用::startScan函数开启扫描 ++ */ ++ result_t grabScanData(node_info *nodebuffer, size_t &count, ++ uint32_t timeout = DEFAULT_TIMEOUT) ; ++ ++ ++ /*! ++ * @brief 补偿激光角度 \n ++ * 把角度限制在0到360度之间 ++ * @param[in] nodebuffer 激光点信息 ++ * @param[in] count 一圈激光点数 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 成功 ++ * @retval RESULT_FAILE 失败 ++ * @note 补偿之前,必须使用::grabScanData函数获取激光数据成功 ++ */ ++ result_t ascendScanData(node_info *nodebuffer, size_t count); ++ ++ /*! ++ * @brief 重置激光雷达 \n ++ * @param[in] timeout 超时时间 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 成功 ++ * @retval RESULT_FAILE 失败 ++ * @note 停止扫描后再执行当前操作, 如果在扫描中调用::stop函数停止扫描 ++ */ ++ result_t reset(uint8_t addr, uint32_t timeout = DEFAULT_TIMEOUT); ++ ++ protected: ++ ++ /*! ++ * @brief 创建解析雷达数据线程 \n ++ * @note 创建解析雷达数据线程之前,必须使用::startScan函数开启扫图成功 ++ */ ++ result_t createThread(); ++ ++ ++ /*! ++ * @brief 重新连接开启扫描 \n ++ * @param[in] force 扫描模式 ++ * @param[in] timeout 超时时间 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 开启成功 ++ * @retval RESULT_FAILE 开启失败 ++ * @note sdk 自动重新连接调用 ++ */ ++ result_t startAutoScan(bool force = false, uint32_t timeout = DEFAULT_TIMEOUT) ; ++ ++ /*! ++ * @brief stopScan ++ * @param timeout ++ * @return ++ */ ++ result_t stopScan(uint32_t timeout = DEFAULT_TIMEOUT); ++ ++ /*! ++ * @brief waitDevicePackage ++ * @param timeout ++ * @return ++ */ ++ result_t waitDevicePackage(uint32_t timeout = DEFAULT_TIMEOUT); ++ /*! ++ * @brief 解包激光数据 \n ++ * @param[in] node 解包后激光点信息 ++ * @param[in] timeout 超时时间 ++ */ ++ result_t waitPackage(node_info *node, uint32_t timeout = DEFAULT_TIMEOUT); ++ ++ /*! ++ * @brief 发送数据到雷达 \n ++ * @param[in] nodebuffer 激光信息指针 ++ * @param[in] count 激光点数大小 ++ * @param[in] timeout 超时时间 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 成功 ++ * @retval RESULT_TIMEOUT 等待超时 ++ * @retval RESULT_FAILE 失败 ++ */ ++ result_t waitScanData(node_info *nodebuffer, size_t &count, ++ uint32_t timeout = DEFAULT_TIMEOUT); ++ ++ /*! ++ * @brief 激光数据解析线程 \n ++ */ ++ int cacheScanData(); ++ ++ /*! ++ * @brief 发送数据到雷达 \n ++ * @param[in] cmd 命名码 ++ * @param[in] payload payload ++ * @param[in] payloadsize payloadsize ++ * @return 返回执行结果 ++ * @retval RESULT_OK 成功 ++ * @retval RESULT_FAILE 失败 ++ */ ++ result_t sendCommand(uint8_t cmd, ++ const void *payload = NULL, ++ size_t payloadsize = 0); ++ ++ /*! ++ * @brief 发送数据到雷达 \n ++ * @param[in] addr 模组地址 ++ * @param[in] cmd 命名码 ++ * @param[in] payload payload ++ * @param[in] payloadsize payloadsize ++ * @return 返回执行结果 ++ * @retval RESULT_OK 成功 ++ * @retval RESULT_FAILE 失败 ++ */ ++ result_t sendCommand(uint8_t addr, ++ uint8_t cmd, ++ const void *payload = NULL, ++ size_t payloadsize = 0); ++ ++ /*! ++ * @brief 等待激光数据包头 \n ++ * @param[in] header 包头 ++ * @param[in] timeout 超时时间 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 获取成功 ++ * @retval RESULT_TIMEOUT 等待超时 ++ * @retval RESULT_FAILE 获取失败 ++ * @note 当timeout = -1 时, 将一直等待 ++ */ ++ result_t waitResponseHeader(gs_lidar_ans_header *header, ++ uint32_t timeout = DEFAULT_TIMEOUT); ++ result_t waitResponseHeaderEx(gs_lidar_ans_header *header, ++ uint8_t cmd, ++ uint32_t timeout = DEFAULT_TIMEOUT); ++ ++ /*! ++ * @brief 等待固定数量串口数据 \n ++ * @param[in] data_count 等待数据大小 ++ * @param[in] timeout 等待时间 ++ * @param[in] returned_size 实际数据大小 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 获取成功 ++ * @retval RESULT_TIMEOUT 等待超时 ++ * @retval RESULT_FAILE 获取失败 ++ * @note 当timeout = -1 时, 将一直等待 ++ */ ++ result_t waitForData(size_t data_count, uint32_t timeout = DEFAULT_TIMEOUT, ++ size_t *returned_size = NULL); ++ ++ /*! ++ * @brief 获取串口数据 \n ++ * @param[in] data 数据指针 ++ * @param[in] size 数据大小 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 获取成功 ++ * @retval RESULT_FAILE 获取失败 ++ */ ++ result_t getData(uint8_t *data, size_t size); ++ ++ /*! ++ * @brief 串口发送数据 \n ++ * @param[in] data 发送数据指针 ++ * @param[in] size 数据大小 ++ * @return 返回执行结果 ++ * @retval RESULT_OK 发送成功 ++ * @retval RESULT_FAILE 发送失败 ++ */ ++ result_t sendData(const uint8_t *data, size_t size); ++ ++ ++ /*! ++ * @brief checkTransDelay ++ */ ++ void checkTransDelay(); ++ ++ /*! ++ * @brief 关闭数据获取通道 \n ++ */ ++ void disableDataGrabbing(); ++ ++ /*! ++ * @brief 设置串口DTR \n ++ */ ++ void setDTR(); ++ ++ /*! ++ * @brief 清除串口DTR \n ++ */ ++ void clearDTR(); ++ ++ /*! ++ * @brief flushSerial ++ */ ++ void flushSerial(); ++ ++ /*! ++ * @brief checkAutoConnecting ++ */ ++ result_t checkAutoConnecting(); ++ ++ /*! ++ * @brief 换算得出点的距离和角度 ++ */ ++ void angTransform(uint16_t dist, int n, double *dstTheta, uint16_t *dstDist); ++ ++ void addPointsToVec(node_info *nodebuffer, size_t &count); ++ ++ /** ++ * @brief 串口错误信息 ++ * @param isTCP TCP or UDP ++ * @return error information ++ */ ++ virtual const char *DescribeError(bool isTCP = false); ++ ++ /** ++ * @brief GS1雷达没有健康信息\n ++ * @return result status ++ * @retval RESULT_OK success ++ * @retval RESULT_FAILE or RESULT_TIMEOUT failed ++ */ ++ virtual result_t getHealth(device_health &health, uint32_t timeout = DEFAULT_TIMEOUT); ++ ++ /** ++ * @brief get Device information \n ++ * @param[in] info Device information ++ * @param[in] timeout timeout ++ * @return result status ++ * @retval RESULT_OK success ++ * @retval RESULT_FAILE or RESULT_TIMEOUT failed ++ */ ++ virtual result_t getDeviceInfo(device_info &info, uint32_t timeout = DEFAULT_TIMEOUT); ++ ++ /** ++ * @brief 设置雷达工作模式(目前只针对GS1雷达) ++ * @param[in] mode 雷达工作模式,0为避障模式;1为延边模式 ++ * @param[in] addr 雷达地址,第1个雷达地址为0x01;第2个雷达地址为0x02;第3个雷达地址为0x04; ++ * @return 成功返回RESULT_OK,否则返回非RESULT_OK ++ */ ++ virtual result_t setWorkMode(int mode=0, uint8_t addr=0x00); ++ ++ //未实现的虚函数 ++ virtual result_t getScanFrequency(scan_frequency &frequency, uint32_t timeout = DEFAULT_TIMEOUT) { return RESULT_OK; } ++ virtual result_t setScanFrequencyDis(scan_frequency &frequency, ++ uint32_t timeout = DEFAULT_TIMEOUT) { return RESULT_OK; } ++ virtual result_t setScanFrequencyAdd(scan_frequency &frequency, ++ uint32_t timeout = DEFAULT_TIMEOUT) { return RESULT_OK; } ++ virtual result_t setScanFrequencyAddMic(scan_frequency &frequency, ++ uint32_t timeout = DEFAULT_TIMEOUT) { return RESULT_OK; } ++ virtual result_t setScanFrequencyDisMic(scan_frequency &frequency, ++ uint32_t timeout = DEFAULT_TIMEOUT) { return RESULT_OK; } ++ virtual result_t getSamplingRate(sampling_rate &rate, ++ uint32_t timeout = DEFAULT_TIMEOUT) { return RESULT_OK; } ++ virtual result_t setSamplingRate(sampling_rate &rate, ++ uint32_t timeout = DEFAULT_TIMEOUT) { return RESULT_OK; } ++ virtual result_t getZeroOffsetAngle(offset_angle &angle, ++ uint32_t timeout = DEFAULT_TIMEOUT) { return RESULT_OK; } ++ virtual result_t setScanHeartbeat(scan_heart_beat &beat, ++ uint32_t timeout = DEFAULT_TIMEOUT) { return RESULT_OK; } ++ ++public: ++ enum { ++ DEFAULT_TIMEOUT = 2000, /**< 默认超时时间. */ ++ DEFAULT_HEART_BEAT = 1000, /**< 默认检测掉电功能时间. */ ++ MAX_SCAN_NODES = 3600, /**< 最大扫描点数. */ ++ DEFAULT_TIMEOUT_COUNT = 1, ++ }; ++ ++ node_info *scan_node_buf; ///< 激光点信息 ++ size_t scan_node_count; ///< 激光点数 ++ Event _dataEvent; ///< 数据同步事件 ++ Locker _lock; ///< 线程锁 ++ Locker _serial_lock; ///< 串口锁 ++ Thread _thread; ///< 线程id ++ ++ private: ++ int PackageSampleBytes; ///< 一个包包含的激光点数 ++ serial::Serial *_serial; ///< 串口 ++ bool m_intensities; ///< 信号质量状体 ++ uint32_t m_baudrate; ///< 波特率 ++ bool isSupportMotorDtrCtrl; ///< 是否支持电机控制 ++ uint32_t trans_delay; ///< 串口传输一个byte时间 ++ int m_sampling_rate; ///< 采样频率 ++ int model; ///< 雷达型号 ++ int sample_rate; ///< ++ ++ gs1_node_package package; ///< 带信号质量协议包 ++ ++ uint16_t package_Sample_Index; ///< 包采样点索引 ++ float IntervalSampleAngle; ++ float IntervalSampleAngle_LastPackage; ++ uint8_t CheckSum; ///< 校验和 ++ uint8_t scan_frequence; ///< 协议中雷达转速 ++ ++ uint8_t CheckSumCal; ++ uint16_t SampleNumlAndCTCal; ++ uint16_t LastSampleAngleCal; ++ bool CheckSumResult; ++ uint16_t Valu8Tou16; ++ ++ std::string serial_port;///< 雷达端口 ++ uint8_t *globalRecvBuffer; ++ int retryCount; ++ bool has_device_header; ++ uint8_t last_device_byte; ++ int asyncRecvPos; ++ uint16_t async_size; ++ ++ //singleChannel ++ device_info info_; ++ device_health health_; ++ gs_lidar_ans_header header_; ++ uint8_t *headerBuffer; ++ uint8_t *infoBuffer; ++ uint8_t *healthBuffer; ++ bool get_device_info_success; ++ bool get_device_health_success; ++ ++ int package_index; ++ uint8_t package_type; ++ bool has_package_error; ++ ++ double d_compensateK0[PackageMaxModuleNums]; ++ double d_compensateK1[PackageMaxModuleNums]; ++ double d_compensateB0[PackageMaxModuleNums]; ++ double d_compensateB1[PackageMaxModuleNums]; ++ uint16_t u_compensateK0[PackageMaxModuleNums]; ++ uint16_t u_compensateK1[PackageMaxModuleNums]; ++ uint16_t u_compensateB0[PackageMaxModuleNums]; ++ uint16_t u_compensateB1[PackageMaxModuleNums]; ++ double bias[PackageMaxModuleNums]; ++ bool isValidPoint; ++ uint8_t package_Sample_Num; ++ ++ uint8_t frameNum; //帧序号 ++ uint8_t moduleNum; //模块编号 ++ bool isPrepareToSend; //是否准备好发送 ++ ++ std::vector multi_package; ++}; ++ ++}// namespace ydlidar ++ ++#endif // GS1_YDLIDAR_DRIVER_H +diff --git a/src/YDlidarDriver.cpp b/src/YDlidarDriver.cpp +index 7c1be54..d64e9ad 100644 +--- a/src/YDlidarDriver.cpp ++++ b/src/YDlidarDriver.cpp +@@ -1296,6 +1296,10 @@ void YDlidarDriver::parseNodeDebugFromBuffer(node_info *node) + (*node).sync_flag = Node_Sync; + package_index = 0; + ++ // printf("start angle %f end angle %f\n", ++ // float(FirstSampleAngle) / 64.0, ++ // float(LastSampleAngle) / 64.0); ++ + if (CheckSumResult) { + has_package_error = false; + (*node).index = package_index; +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0004-S2-Pro.patch b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0004-S2-Pro.patch new file mode 100644 index 0000000000000000000000000000000000000000..cdcb215cb0a4d2bd139701cdf4cbf45573dea015 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0004-S2-Pro.patch @@ -0,0 +1,113 @@ +From 66c77cad6191947a08a742e845d5cfa417123c1f Mon Sep 17 00:00:00 2001 +From: zhanyiaini +Date: Tue, 1 Nov 2022 19:00:02 +0800 +Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9S2-Pro=E9=87=87=E6=A0=B7?= + =?UTF-8?q?=E7=8E=87=E9=97=AE=E9=A2=98?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + core/common/DriverInterface.h | 1 + + core/common/ydlidar_help.h | 12 ++++++++---- + samples/tri_test.cpp | 14 +++++++------- + 3 files changed, 16 insertions(+), 11 deletions(-) + +diff --git a/core/common/DriverInterface.h b/core/common/DriverInterface.h +index e1e1e31..09879c6 100644 +--- a/core/common/DriverInterface.h ++++ b/core/common/DriverInterface.h +@@ -454,6 +454,7 @@ class DriverInterface { + YDLIDAR_T1 = 2,/**< T1 LiDAR Model. */ + YDLIDAR_F2 = 3,/**< F2 LiDAR Model. */ + YDLIDAR_S4 = 4,/**< S4 LiDAR Model. */ ++ YDLIDAR_S2PRO = YDLIDAR_S4,/**< S2PRO LiDAR Model. */ + YDLIDAR_G4 = 5,/**< G4 LiDAR Model. */ + YDLIDAR_X4 = 6,/**< X4 LiDAR Model. */ + YDLIDAR_G4PRO = 7,/**< G4PRO LiDAR Model. */ +diff --git a/core/common/ydlidar_help.h b/core/common/ydlidar_help.h +index 35ac3ee..b80021e 100644 +--- a/core/common/ydlidar_help.h ++++ b/core/common/ydlidar_help.h +@@ -81,9 +81,9 @@ inline std::string lidarModelToString(int model) { + + break; + +- case DriverInterface::YDLIDAR_S4: +- name = "S4"; +- ++ // case DriverInterface::YDLIDAR_S4: ++ case DriverInterface::YDLIDAR_S2PRO: ++ name = "S2PRO"; + break; + + case DriverInterface::YDLIDAR_G4: +@@ -223,7 +223,11 @@ inline std::vector getDefaultSampleRate(int model) + case DriverInterface::YDLIDAR_F4: + case DriverInterface::YDLIDAR_T1: + case DriverInterface::YDLIDAR_F2: +- case DriverInterface::YDLIDAR_S4: ++ srs.push_back(4); ++ break; ++ // case DriverInterface::YDLIDAR_S4: ++ case DriverInterface::YDLIDAR_S2PRO: ++ srs.push_back(3); + srs.push_back(4); + break; + case DriverInterface::YDLIDAR_G4: +diff --git a/samples/tri_test.cpp b/samples/tri_test.cpp +index 4e5f80c..c19b2cf 100644 +--- a/samples/tri_test.cpp ++++ b/samples/tri_test.cpp +@@ -181,7 +181,7 @@ int main(int argc, char *argv[]) + + std::string input_frequency; + +- float frequency = 8.0; ++ float frequency = 5.0; + + while (ydlidar::os_isOk() && !isSingleChannel) + { +@@ -229,12 +229,12 @@ int main(int argc, char *argv[]) + optval = 4; + laser.setlidaropt(LidarPropAbnormalCheckCount, &optval, sizeof(int)); + /// Intenstiy bit count +- optval = 8; ++ optval = 10; + laser.setlidaropt(LidarPropIntenstiyBit, &optval, sizeof(int)); + + //////////////////////bool property///////////////// + /// fixed angle resolution +- bool b_optvalue = false; ++ bool b_optvalue = true; + laser.setlidaropt(LidarPropFixedResolution, &b_optvalue, sizeof(bool)); + /// rotate 180 + laser.setlidaropt(LidarPropReversion, &b_optvalue, sizeof(bool)); +@@ -245,10 +245,10 @@ int main(int argc, char *argv[]) + /// one-way communication + laser.setlidaropt(LidarPropSingleChannel, &isSingleChannel, sizeof(bool)); + /// intensity +- b_optvalue = false; ++ b_optvalue = true; + laser.setlidaropt(LidarPropIntenstiy, &b_optvalue, sizeof(bool)); + /// Motor DTR +- b_optvalue = true; ++ b_optvalue = false; + laser.setlidaropt(LidarPropSupportMotorDtrCtrl, &b_optvalue, sizeof(bool)); + /// HeartBeat + b_optvalue = false; +@@ -303,9 +303,9 @@ int main(int argc, char *argv[]) + { + if (laser.doProcessSimple(scan)) + { +- printf("Scan received [%u] points stamp [0x%016lX]\n", ++ printf("Scan received [%u] points inc [%f]\n", + (unsigned int)scan.points.size(), +- scan.stamp); ++ scan.config.angle_increment); + // for (size_t i = 0; i < scan.points.size(); ++i) + // { + // const LaserPoint &p = scan.points.at(i); +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0005-GS2-S2.patch b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0005-GS2-S2.patch new file mode 100644 index 0000000000000000000000000000000000000000..19dece4bce5b0bf2e481a6cb97eca5899068259b --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/files/0005-GS2-S2.patch @@ -0,0 +1,1496 @@ +From 2b7e756c2823f00ba8b80911852c4127b93213cc Mon Sep 17 00:00:00 2001 +From: zhanyiaini +Date: Tue, 13 Dec 2022 18:13:16 +0800 +Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9GS2=E5=92=8CS2=E7=B3=BB?= + =?UTF-8?q?=E5=88=97=E5=90=8C=E6=97=B6=E4=BD=BF=E7=94=A8=E6=97=B6=E7=BA=BF?= + =?UTF-8?q?=E7=A8=8B=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + CMakeLists.txt | 2 +- + core/base/thread.h | 6 +- + samples/gs_test.cpp | 2 +- + samples/tri_and_gs_test.cpp | 237 +++++++++++++++++++++++++ + src/CYdLidar.cpp | 6 +- + src/GS2LidarDriver.cpp | 141 +++++++-------- + src/GS2LidarDriver.h | 30 ++-- + src/YDlidarDriver.cpp | 343 ++++++++++++++++++++---------------- + 8 files changed, 519 insertions(+), 248 deletions(-) + create mode 100644 samples/tri_and_gs_test.cpp + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0adc747..05ad037 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,7 +5,7 @@ project(ydlidar_sdk C CXX) + # version + set(YDLIDAR_SDK_VERSION_MAJOR 1) + set(YDLIDAR_SDK_VERSION_MINOR 1) +-set(YDLIDAR_SDK_VERSION_PATCH 2) ++set(YDLIDAR_SDK_VERSION_PATCH 3) + set(YDLIDAR_SDK_VERSION ${YDLIDAR_SDK_VERSION_MAJOR}.${YDLIDAR_SDK_VERSION_MINOR}.${YDLIDAR_SDK_VERSION_PATCH}) + + ########################################################## +diff --git a/core/base/thread.h b/core/base/thread.h +index a952933..c13e04b 100644 +--- a/core/base/thread.h ++++ b/core/base/thread.h +@@ -107,19 +107,17 @@ class Thread { + void *res; + int s = -1; + s = pthread_cancel((pthread_t)(this->_handle)); +- + if (s != 0) { + } + + s = pthread_join((pthread_t)(this->_handle), &res); +- + if (s != 0) { + } + + if (res == PTHREAD_CANCELED) { +- printf("%lu thread has been canceled\n", this->_handle); +- this->_handle = 0; ++ printf("0x%X thread has been canceled\n", this->_handle); + } ++ this->_handle = 0; //强制置空线程句柄,以免再次调用该函数时出现异常 + + #endif + return 0; +diff --git a/samples/gs_test.cpp b/samples/gs_test.cpp +index 2bb7671..cea13f8 100644 +--- a/samples/gs_test.cpp ++++ b/samples/gs_test.cpp +@@ -79,7 +79,7 @@ int main(int argc, char *argv[]) + int id = 0; + + for (it = ports.begin(); it != ports.end(); it++) { +- printf("%d. %s\n", id, it->first.c_str()); ++ printf("[%d] %s %s\n", id, it->first.c_str(), it->second.c_str()); + id++; + } + +diff --git a/samples/tri_and_gs_test.cpp b/samples/tri_and_gs_test.cpp +new file mode 100644 +index 0000000..3c28b43 +--- /dev/null ++++ b/samples/tri_and_gs_test.cpp +@@ -0,0 +1,237 @@ ++#include "CYdLidar.h" ++#include ++#include ++#include ++#include ++#include "core/base/timer.h" ++ ++using namespace std; ++using namespace ydlidar; ++ ++#if defined(_MSC_VER) ++#pragma comment(lib, "ydlidar_sdk.lib") ++#endif ++ ++int main(int argc, char *argv[]) ++{ ++ printf("__ ______ _ ___ ____ _ ____ \n"); ++ printf("\\ \\ / / _ \\| | |_ _| _ \\ / \\ | _ \\ \n"); ++ printf(" \\ V /| | | | | | || | | |/ _ \\ | |_) | \n"); ++ printf(" | | | |_| | |___ | || |_| / ___ \\| _ < \n"); ++ printf(" |_| |____/|_____|___|____/_/ \\_\\_| \\_\\ \n"); ++ printf("\n"); ++ fflush(stdout); ++ ++ ydlidar::os_init(); ++ ++ bool ret = false; ++ CYdLidar lidarGs; //GS2雷达 ++ { ++ bool isSingleChannel = false; ++ float frequency = 8.0; ++ std::string port = "/dev/ttyUSB0"; ++ int baudrate = 921600; ++ //////////////////////string property///////////////// ++ /// lidar port ++ lidarGs.setlidaropt(LidarPropSerialPort, port.c_str(), port.size()); ++ /// lidar baudrate ++ lidarGs.setlidaropt(LidarPropSerialBaudrate, &baudrate, sizeof(int)); ++ /// gs lidar ++ int optval = TYPE_GS; ++ lidarGs.setlidaropt(LidarPropLidarType, &optval, sizeof(int)); ++ /// device type ++ optval = YDLIDAR_TYPE_SERIAL; ++ lidarGs.setlidaropt(LidarPropDeviceType, &optval, sizeof(int)); ++ /// sample rate ++ optval = 4; ++ lidarGs.setlidaropt(LidarPropSampleRate, &optval, sizeof(int)); ++ /// abnormal count ++ optval = 4; ++ lidarGs.setlidaropt(LidarPropAbnormalCheckCount, &optval, sizeof(int)); ++ /// Intenstiy bit count ++ optval = 8; ++ lidarGs.setlidaropt(LidarPropIntenstiyBit, &optval, sizeof(int)); ++ //////////////////////bool property///////////////// ++ /// fixed angle resolution ++ bool b_optvalue = false; ++ lidarGs.setlidaropt(LidarPropFixedResolution, &b_optvalue, sizeof(bool)); ++ /// rotate 180 ++ lidarGs.setlidaropt(LidarPropReversion, &b_optvalue, sizeof(bool)); ++ /// Counterclockwise ++ lidarGs.setlidaropt(LidarPropInverted, &b_optvalue, sizeof(bool)); ++ b_optvalue = true; ++ lidarGs.setlidaropt(LidarPropAutoReconnect, &b_optvalue, sizeof(bool)); ++ /// one-way communication ++ lidarGs.setlidaropt(LidarPropSingleChannel, &isSingleChannel, sizeof(bool)); ++ /// intensity ++ b_optvalue = true; ++ lidarGs.setlidaropt(LidarPropIntenstiy, &b_optvalue, sizeof(bool)); ++ /// Motor DTR ++ b_optvalue = true; ++ lidarGs.setlidaropt(LidarPropSupportMotorDtrCtrl, &b_optvalue, sizeof(bool)); ++ /// HeartBeat ++ b_optvalue = false; ++ lidarGs.setlidaropt(LidarPropSupportHeartBeat, &b_optvalue, sizeof(bool)); ++ //////////////////////float property///////////////// ++ /// unit: ° ++ float f_optvalue = 180.0f; ++ lidarGs.setlidaropt(LidarPropMaxAngle, &f_optvalue, sizeof(float)); ++ f_optvalue = -180.0f; ++ lidarGs.setlidaropt(LidarPropMinAngle, &f_optvalue, sizeof(float)); ++ /// unit: m ++ f_optvalue = 1.f; ++ lidarGs.setlidaropt(LidarPropMaxRange, &f_optvalue, sizeof(float)); ++ f_optvalue = 0.025f; ++ lidarGs.setlidaropt(LidarPropMinRange, &f_optvalue, sizeof(float)); ++ /// unit: Hz ++ lidarGs.setlidaropt(LidarPropScanFrequency, &frequency, sizeof(float)); ++ ++ //雷达初始化 ++ ret = lidarGs.initialize(); ++ if (!ret) ++ { ++ fprintf(stderr, "Fail to initialize %s\n", lidarGs.DescribeError()); ++ fflush(stderr); ++ return -1; ++ } ++ } ++ ++ CYdLidar lidarS2; //S2雷达 ++ { ++ bool isSingleChannel = false; ++ float frequency = 8.0; ++ std::string port = "/dev/ttyUSB1"; ++ int baudrate = 115200; ++ //////////////////////string property///////////////// ++ /// lidar port ++ lidarS2.setlidaropt(LidarPropSerialPort, port.c_str(), port.size()); ++ //////////////////////int property///////////////// ++ /// lidar baudrate ++ lidarS2.setlidaropt(LidarPropSerialBaudrate, &baudrate, sizeof(int)); ++ /// tof lidar ++ int optval = TYPE_TRIANGLE; ++ lidarS2.setlidaropt(LidarPropLidarType, &optval, sizeof(int)); ++ /// device type ++ optval = YDLIDAR_TYPE_SERIAL; ++ lidarS2.setlidaropt(LidarPropDeviceType, &optval, sizeof(int)); ++ /// sample rate ++ optval = isSingleChannel ? 3 : 4; ++ lidarS2.setlidaropt(LidarPropSampleRate, &optval, sizeof(int)); ++ /// abnormal count ++ optval = 4; ++ lidarS2.setlidaropt(LidarPropAbnormalCheckCount, &optval, sizeof(int)); ++ /// Intenstiy bit count ++ optval = 10; ++ lidarS2.setlidaropt(LidarPropIntenstiyBit, &optval, sizeof(int)); ++ //////////////////////bool property///////////////// ++ /// fixed angle resolution ++ bool b_optvalue = true; ++ lidarS2.setlidaropt(LidarPropFixedResolution, &b_optvalue, sizeof(bool)); ++ b_optvalue = false; ++ /// rotate 180 ++ lidarS2.setlidaropt(LidarPropReversion, &b_optvalue, sizeof(bool)); ++ /// Counterclockwise ++ lidarS2.setlidaropt(LidarPropInverted, &b_optvalue, sizeof(bool)); ++ b_optvalue = true; ++ lidarS2.setlidaropt(LidarPropAutoReconnect, &b_optvalue, sizeof(bool)); ++ /// one-way communication ++ lidarS2.setlidaropt(LidarPropSingleChannel, &isSingleChannel, sizeof(bool)); ++ /// intensity ++ b_optvalue = true; ++ lidarS2.setlidaropt(LidarPropIntenstiy, &b_optvalue, sizeof(bool)); ++ /// Motor DTR ++ b_optvalue = false; ++ lidarS2.setlidaropt(LidarPropSupportMotorDtrCtrl, &b_optvalue, sizeof(bool)); ++ /// HeartBeat ++ b_optvalue = false; ++ lidarS2.setlidaropt(LidarPropSupportHeartBeat, &b_optvalue, sizeof(bool)); ++ //////////////////////float property///////////////// ++ /// unit: ° ++ float f_optvalue = 180.0f; ++ lidarS2.setlidaropt(LidarPropMaxAngle, &f_optvalue, sizeof(float)); ++ f_optvalue = -180.0f; ++ lidarS2.setlidaropt(LidarPropMinAngle, &f_optvalue, sizeof(float)); ++ /// unit: m ++ f_optvalue = 64.f; ++ lidarS2.setlidaropt(LidarPropMaxRange, &f_optvalue, sizeof(float)); ++ f_optvalue = 0.05f; ++ lidarS2.setlidaropt(LidarPropMinRange, &f_optvalue, sizeof(float)); ++ /// unit: Hz ++ lidarS2.setlidaropt(LidarPropScanFrequency, &frequency, sizeof(float)); ++ ret = lidarS2.initialize(); ++ if (!ret) ++ { ++ fprintf(stderr, "Fail to initialize %s\n", lidarS2.DescribeError()); ++ fflush(stderr); ++ return -1; ++ } ++ } ++ ++ LaserScan scanGs; //GS2点云数据 ++ LaserScan scanS2; //S2雷达点云数据 ++ while (ydlidar::os_isOk()) ++ { ++ //启动S2 ++ ret = lidarS2.turnOn(); ++ if (!ret) ++ { ++ fprintf(stderr, "Fail to turn on S2 %s\n", lidarS2.DescribeError()); ++ fflush(stderr); ++ return -1; ++ } ++ //启动GS2 ++ ret = lidarGs.turnOn(); ++ if (!ret) ++ { ++ fprintf(stderr, "Fail to turn on GS2 %s\n", lidarGs.DescribeError()); ++ fflush(stderr); ++ return -1; ++ } ++ //启动后运行5秒然后停止扫描 ++ uint64_t t = getms(); ++ while (getms() - t < 5000) ++ { ++ //获取GS2点云数据 ++ if (lidarGs.doProcessSimple(scanGs)) ++ { ++ printf("[%lu] points in [0x%016lX] module num [%d] env flag [0x%04X]\n", ++ scanGs.points.size(), ++ scanGs.stamp, ++ scanGs.moduleNum, ++ scanGs.envFlag); ++ fflush(stdout); ++ } ++ else ++ { ++ fprintf(stderr, "Failed to get Lidar GS2 Data\n"); ++ fflush(stderr); ++ } ++ //获取S2点云数据 ++ if (lidarS2.doProcessSimple(scanS2)) ++ { ++ printf("[%u] points inc [%f]\n", ++ (unsigned int)scanS2.points.size(), ++ scanS2.config.angle_increment); ++ fflush(stdout); ++ } ++ else ++ { ++ fprintf(stderr, "Failed to get Lidar S2 Data\n"); ++ fflush(stderr); ++ static int s_errorCount = 0; ++ if (s_errorCount++ > 10) ++ return -1; ++ } ++ } ++ ++ //停止S2 ++ lidarS2.turnOff(); ++ //停止GS2 ++ lidarGs.turnOff(); ++ } ++ ++ lidarGs.turnOff(); ++ lidarGs.disconnecting(); ++ ++ return 0; ++} +diff --git a/src/CYdLidar.cpp b/src/CYdLidar.cpp +index 668e24f..54e1687 100644 +--- a/src/CYdLidar.cpp ++++ b/src/CYdLidar.cpp +@@ -1088,6 +1088,7 @@ bool CYdLidar::checkLidarAbnormal() + } + } + ++ //单通雷达,计算采样率、固定分辨率时的一圈点数 + if (IS_OK(op_result) && lidarPtr->getSingleChannel()) + { + data.push_back(count); +@@ -1115,7 +1116,7 @@ bool CYdLidar::checkLidarAbnormal() + scan_time = 1.0 * static_cast(end_time - start_time) / 1e9; + bool ret = CalculateSampleRate(count, scan_time); + +- if (scan_time > 0.05 && scan_time < 0.5 && lidarPtr->getSingleChannel()) ++ if (scan_time > 0.05 && scan_time < 0.5) + { + if (!ret) + { +@@ -1717,7 +1718,8 @@ bool CYdLidar::checkScanFrequency() + + m_ScanFrequency -= frequencyOffset; + m_FixedSize = m_SampleRate * 1000 / (m_ScanFrequency - 0.1); +- printf("[YDLIDAR INFO] Current Scan Frequency: %fHz\n", m_ScanFrequency); ++ printf("[YDLIDAR] Current Scan Frequency: %fHz\n", m_ScanFrequency); ++ printf("[YDLIDAR] Fixed size: %d\n", m_FixedSize); + return true; + } + +diff --git a/src/GS2LidarDriver.cpp b/src/GS2LidarDriver.cpp +index d6193fc..8fc3708 100644 +--- a/src/GS2LidarDriver.cpp ++++ b/src/GS2LidarDriver.cpp +@@ -99,19 +99,16 @@ GS2LidarDriver::GS2LidarDriver(): + GS2LidarDriver::~GS2LidarDriver() + { + m_isScanning = false; +- + isAutoReconnect = false; + _thread.join(); + +- ScopedLocker lk(_serial_lock); +- ++ ScopedLocker l(_cmd_lock); + if (_serial) { + if (_serial->isOpen()) { + _serial->flush(); + _serial->closePort(); + } + } +- + if (_serial) { + delete _serial; + _serial = NULL; +@@ -121,7 +118,6 @@ GS2LidarDriver::~GS2LidarDriver() + delete[] globalRecvBuffer; + globalRecvBuffer = NULL; + } +- + if (scan_node_buf) { + delete[] scan_node_buf; + scan_node_buf = NULL; +@@ -130,19 +126,17 @@ GS2LidarDriver::~GS2LidarDriver() + + result_t GS2LidarDriver::connect(const char *port_path, uint32_t baudrate) + { +- ScopedLocker lk(_serial_lock); + m_baudrate = baudrate; + serial_port = string(port_path); +- +- if (!_serial) { +- _serial = new serial::Serial(port_path, m_baudrate, +- serial::Timeout::simpleTimeout(DEFAULT_TIMEOUT)); +- } +- + { +- ScopedLocker l(_lock); +- +- if (!_serial->open()) { ++ ScopedLocker l(_cmd_lock); ++ if (!_serial) ++ { ++ _serial = new serial::Serial(port_path, m_baudrate, ++ serial::Timeout::simpleTimeout(DEFAULT_TIMEOUT)); ++ } ++ if (!_serial->open()) ++ { + return RESULT_FAIL; + } + +@@ -200,7 +194,7 @@ void GS2LidarDriver::disconnect() { + + stop(); + delay(10); +- ScopedLocker l(_serial_lock); ++ ScopedLocker l(_cmd_lock); + + if (_serial) { + if (_serial->isOpen()) { +@@ -212,12 +206,11 @@ void GS2LidarDriver::disconnect() { + } + + +-void GS2LidarDriver::disableDataGrabbing() { +- { +- if (m_isScanning) { +- m_isScanning = false; +- _dataEvent.set(); +- } ++void GS2LidarDriver::disableDataGrabbing() ++{ ++ if (m_isScanning) { ++ m_isScanning = false; ++ _dataEvent.set(); + } + _thread.join(); + } +@@ -539,7 +532,7 @@ result_t GS2LidarDriver::checkAutoConnecting() { + + while (isAutoReconnect && isAutoconnting) { + { +- ScopedLocker l(_serial_lock); ++ ScopedLocker l(_cmd_lock); + + if (_serial) { + if (_serial->isOpen() || m_isConnected) { +@@ -578,7 +571,7 @@ result_t GS2LidarDriver::checkAutoConnecting() { + if (isconnected()) { + delay(100); + { +- ScopedLocker l(_serial_lock); ++ ScopedLocker l(_cmd_lock); + ans = startAutoScan(); + + if (!IS_OK(ans)) { +@@ -597,20 +590,18 @@ result_t GS2LidarDriver::checkAutoConnecting() { + + } + +-int GS2LidarDriver::cacheScanData() { ++int GS2LidarDriver::cacheScanData() ++{ + node_info local_buf[200]; + size_t count = 200; +- node_info local_scan[MAX_SCAN_NODES]; + size_t scan_count = 0; + result_t ans = RESULT_FAIL; +- memset(local_scan, 0, sizeof(local_scan)); + +- flushSerial(); +- waitScanData(local_buf, count); +- +- int timeout_count = 0; ++ int timeout_count = 0; + retryCount = 0; + ++ m_isScanning = true; ++ + while (m_isScanning) + { + count = 160; +@@ -630,7 +621,6 @@ int GS2LidarDriver::cacheScanData() { + + if (IS_OK(ans)) { + timeout_count = 0; +- local_scan[0].sync_flag = Node_NotSync; + } else { + m_isScanning = false; + return RESULT_FAIL; +@@ -638,7 +628,6 @@ int GS2LidarDriver::cacheScanData() { + } + } else { + timeout_count++; +- local_scan[0].sync_flag = Node_NotSync; + fprintf(stderr, "timeout count: %d\n", timeout_count); + fflush(stderr); + } +@@ -647,9 +636,6 @@ int GS2LidarDriver::cacheScanData() { + retryCount = 0; + } + +- // printf("sync:%d,index:%d,moduleNum:%d\n",package_type,frameNum,moduleNum); +- // fflush(stdout); +- + if (!isPrepareToSend) { + continue; + } +@@ -663,17 +649,17 @@ int GS2LidarDriver::cacheScanData() { + } + } + +- _lock.lock(); //timeout lock, wait resource copys +- scan_node_buf[0].stamp = local_buf[0].stamp; +- scan_node_buf[0].scan_frequence = local_buf[0].scan_frequence; +- scan_node_buf[0].index = 0x03 & (moduleNum >> 1); //gs2: 1, 2, 4 +- scan_node_count = 160; //一个包固定160个数据 +- // printf("count [%d] stamp [0x%016lX]\n", count, local_buf[count - 1].stamp); +- // fflush(stdout); +- _dataEvent.set(); +- _lock.unlock(); +- scan_count = 0; +- isPrepareToSend = false; ++ { ++ // printf("[YDLIDAR] GS2 points Stored in buffer %lu\n", count); ++ ScopedLocker l(_lock); ++ scan_node_buf[0].stamp = local_buf[0].stamp; ++ scan_node_buf[0].scan_frequence = local_buf[0].scan_frequence; ++ scan_node_buf[0].index = 0x03 & (moduleNum >> 1); // gs2: 1, 2, 4 ++ scan_node_count = 160; // 一个包固定160个数据 ++ _dataEvent.set(); ++ scan_count = 0; ++ isPrepareToSend = false; ++ } + } + + m_isScanning = false; +@@ -811,7 +797,7 @@ result_t GS2LidarDriver::waitPackage(node_info *node, uint32_t timeout) + else + { + recvPos = 0; +- printf("invalid gs2 data\n"); ++ // printf("invalid gs2 data\n"); + continue; + } + } +@@ -1132,25 +1118,20 @@ result_t GS2LidarDriver::grabScanData(node_info *nodebuffer, size_t &count, + count = 0; + return RESULT_TIMEOUT; + +- case Event::EVENT_OK: { +- if (scan_node_count == 0) { +- return RESULT_FAIL; +- } +- ++ case Event::EVENT_OK: ++ { + ScopedLocker l(_lock); + size_t size_to_copy = min(count, scan_node_count); + memcpy(nodebuffer, scan_node_buf, size_to_copy * sizeof(node_info)); + count = size_to_copy; + scan_node_count = 0; + } +- + return RESULT_OK; + + default: + count = 0; + return RESULT_FAIL; + } +- + } + + +@@ -1275,13 +1256,12 @@ result_t GS2LidarDriver::getDevicePara(gs_device_para &info, uint32_t timeout) { + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); +- ++ ScopedLocker l(_cmd_lock); + if ((ans = sendCommand(GS_LIDAR_CMD_GET_PARAMETER)) != RESULT_OK) { + return ans; + } + gs_lidar_ans_header response_header; +- for(int i = 0; i < PackageMaxModuleNums; i++) ++ for (int i = 0; i < PackageMaxModuleNums && i < moduleCount; i++) + { + if ((ans = waitResponseHeader(&response_header, timeout)) != RESULT_OK) { + return ans; +@@ -1344,7 +1324,7 @@ result_t GS2LidarDriver::setDeviceAddress(uint32_t timeout) + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(GS_LIDAR_CMD_GET_ADDRESS)) != RESULT_OK) { + return ans; +@@ -1354,12 +1334,12 @@ result_t GS2LidarDriver::setDeviceAddress(uint32_t timeout) + if ((ans = waitResponseHeader(&response_header, timeout)) != RESULT_OK) { + return ans; + } +- + if (response_header.type != GS_LIDAR_CMD_GET_ADDRESS) { + return RESULT_FAIL; + } + +- printf("[YDLIDAR] Lidar module count %d", (response_header.address << 1) + 1); ++ moduleCount = (response_header.address >> 1) + 1; ++ printf("[YDLIDAR] GS Lidar count %u\n", moduleCount); + } + + return RESULT_OK; +@@ -1427,13 +1407,12 @@ result_t GS2LidarDriver::startScan(bool force, uint32_t timeout) { + + //获取GS2参数 + gs_device_para gs2_info; +-// delay(30); +- getDevicePara(gs2_info, 300); +-// delay(30); ++ ans = getDevicePara(gs2_info, 300); ++ if (IS_OK(ans)) + { + flushSerial(); + +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + if ((ans = sendCommand(force ? LIDAR_CMD_FORCE_SCAN : GS_LIDAR_CMD_SCAN)) != + RESULT_OK) { + return ans; +@@ -1446,7 +1425,6 @@ result_t GS2LidarDriver::startScan(bool force, uint32_t timeout) { + if ((ans = waitResponseHeader(&response_header, timeout)) != RESULT_OK) { + return ans; + } +- + if (response_header.type != GS_LIDAR_ANS_SCAN) { + printf("[CYdLidar] Response to start scan type error!\n"); + return RESULT_FAIL; +@@ -1468,7 +1446,7 @@ result_t GS2LidarDriver::stopScan(uint32_t timeout) { + return RESULT_FAIL; + } + +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(GS_LIDAR_CMD_STOP)) != RESULT_OK) { + return ans; +@@ -1485,19 +1463,26 @@ result_t GS2LidarDriver::stopScan(uint32_t timeout) { + return RESULT_OK; + } + +-result_t GS2LidarDriver::createThread() { ++result_t GS2LidarDriver::createThread() ++{ ++ // 如果线程已启动,则先退出线程 ++ if (_thread.getHandle()) ++ { ++ m_isScanning = false; ++ _thread.join(); ++ } + _thread = CLASS_THREAD(GS2LidarDriver, cacheScanData); + +- if (_thread.getHandle() == 0) { +- m_isScanning = false; ++ if (!_thread.getHandle()) { + return RESULT_FAIL; + } + +- m_isScanning = true; ++ printf("[GS2Lidar] Create GS2 thread 0x%X\n", _thread.getHandle()); ++ fflush(stdout); ++ + return RESULT_OK; + } + +- + result_t GS2LidarDriver::startAutoScan(bool force, uint32_t timeout) { + result_t ans; + +@@ -1509,7 +1494,7 @@ result_t GS2LidarDriver::startAutoScan(bool force, uint32_t timeout) { + delay(10); + { + +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(force ? LIDAR_CMD_FORCE_SCAN : GS_LIDAR_CMD_SCAN)) != + RESULT_OK) { +@@ -1536,10 +1521,10 @@ result_t GS2LidarDriver::startAutoScan(bool force, uint32_t timeout) { + /************************************************************************/ + /* stop scan */ + /************************************************************************/ +-result_t GS2LidarDriver::stop() { ++result_t GS2LidarDriver::stop() ++{ + if (isAutoconnting) { + isAutoReconnect = false; +- m_isScanning = false; + } + + disableDataGrabbing(); +@@ -1559,7 +1544,7 @@ result_t GS2LidarDriver::reset(uint8_t addr, uint32_t timeout) { + return RESULT_FAIL; + } + +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(addr, GS_LIDAR_CMD_RESET)) != RESULT_OK) { + return ans; +@@ -1608,7 +1593,7 @@ result_t GS2LidarDriver::getDeviceInfo(device_info &info, uint32_t timeout) + disableDataGrabbing(); + // flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ret = sendCommand(GS_LIDAR_CMD_GET_VERSION)) != RESULT_OK) { + return ret; +@@ -1662,7 +1647,7 @@ result_t GS2LidarDriver::setWorkMode(int mode, uint8_t addr) + flushSerial(); + + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + uint8_t m = uint8_t(mode); + if ((ans = sendCommand(addr, GS_LIDAR_CMD_SET_MODE, &m, 1)) != RESULT_OK) { + return ans; +diff --git a/src/GS2LidarDriver.h b/src/GS2LidarDriver.h +index 12cfdb9..17e1eef 100644 +--- a/src/GS2LidarDriver.h ++++ b/src/GS2LidarDriver.h +@@ -511,18 +511,18 @@ public: + DEFAULT_TIMEOUT_COUNT = 1, + }; + +- node_info *scan_node_buf; ///< 激光点信息 +- size_t scan_node_count; ///< 激光点数 +- Event _dataEvent; ///< 数据同步事件 +- Locker _lock; ///< 线程锁 +- Locker _serial_lock; ///< 串口锁 +- Thread _thread; ///< 线程id ++ // node_info *scan_node_buf; ///< 激光点信息 ++ // size_t scan_node_count; ///< 激光点数 ++ // Event _dataEvent; ///< 数据同步事件 ++ // Locker _lock; ///< 线程锁 ++ // Locker _cmd_lock; ///< 串口锁 ++ // Thread _thread; ///< 线程id + + private: + int PackageSampleBytes; ///< 一个包包含的激光点数 + serial::Serial *_serial; ///< 串口 +- bool m_intensities; ///< 信号质量状体 +- uint32_t m_baudrate; ///< 波特率 ++ // bool m_intensities; ///< 信号质量状体 ++ // uint32_t m_baudrate; ///< 波特率 + bool isSupportMotorDtrCtrl; ///< 是否支持电机控制 + uint32_t trans_delay; ///< 串口传输一个byte时间 + int m_sampling_rate; ///< 采样频率 +@@ -531,7 +531,7 @@ public: + + gs2_node_package package; ///< 带信号质量协议包 + +- uint16_t package_Sample_Index; ///< 包采样点索引 ++ // uint16_t package_Sample_Index; ///< 包采样点索引 + float IntervalSampleAngle; + float IntervalSampleAngle_LastPackage; + uint8_t CheckSum; ///< 校验和 +@@ -543,9 +543,9 @@ public: + bool CheckSumResult; + uint16_t Valu8Tou16; + +- std::string serial_port;///< 雷达端口 ++ // std::string serial_port;///< 雷达端口 + uint8_t *globalRecvBuffer; +- int retryCount; ++ // int retryCount; + bool has_device_header; + uint8_t last_device_byte; + int asyncRecvPos; +@@ -577,10 +577,10 @@ public: + bool isValidPoint; + uint8_t package_Sample_Num; + +- uint8_t frameNum; //帧序号 +- uint8_t moduleNum; //模块编号 +- bool isPrepareToSend; //是否准备好发送 +- ++ uint8_t frameNum = 0; //帧序号 ++ uint8_t moduleNum = 0; //模块编号 ++ bool isPrepareToSend = false; //是否准备好发送 ++ uint8_t moduleCount = 1; //当前模组数量 + std::vector multi_package; + }; + +diff --git a/src/YDlidarDriver.cpp b/src/YDlidarDriver.cpp +index d64e9ad..d811620 100644 +--- a/src/YDlidarDriver.cpp ++++ b/src/YDlidarDriver.cpp +@@ -92,67 +92,74 @@ YDlidarDriver::YDlidarDriver(uint8_t type): + m_BlockRevSize = 0; + } + +-YDlidarDriver::~YDlidarDriver() { +- { +- m_isScanning = false; +- } +- ++YDlidarDriver::~YDlidarDriver() ++{ ++ m_isScanning = false; + isAutoReconnect = false; + _thread.join(); + delay(200); + +- ScopedLocker lck(_cmd_lock); +- +- if (_serial) { +- if (_serial->isOpen()) { +- _serial->flush(); +- _serial->closePort(); ++ { ++ ScopedLocker l(_cmd_lock); ++ if (_serial) ++ { ++ if (_serial->isOpen()) ++ { ++ _serial->flush(); ++ _serial->closePort(); ++ } ++ } ++ if (_serial) ++ { ++ delete _serial; ++ _serial = NULL; + } + } + +- if (_serial) { +- delete _serial; +- _serial = NULL; +- } +- +- if (globalRecvBuffer) { +- delete[] globalRecvBuffer; +- globalRecvBuffer = NULL; +- } ++ { ++ ScopedLocker l(_lock); ++ if (globalRecvBuffer) ++ { ++ delete[] globalRecvBuffer; ++ globalRecvBuffer = NULL; ++ } + +- if (scan_node_buf) { +- delete[] scan_node_buf; +- scan_node_buf = NULL; ++ if (scan_node_buf) ++ { ++ delete[] scan_node_buf; ++ scan_node_buf = NULL; ++ } + } + } + +- +-result_t YDlidarDriver::connect(const char *port_path, uint32_t baudrate) { +- ScopedLocker lck(_cmd_lock); ++result_t YDlidarDriver::connect(const char *port_path, uint32_t baudrate) ++{ + m_baudrate = baudrate; + serial_port = string(port_path); + +- if (!_serial) { +- if (m_TranformerType == YDLIDAR_TYPE_TCP) { +- _serial = new CActiveSocket(); +- } else { +- _serial = new serial::Serial(port_path, m_baudrate, +- serial::Timeout::simpleTimeout(DEFAULT_TIMEOUT)); +- } +- +- _serial->bindport(port_path, baudrate); +- } +- + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); ++ if (!_serial) ++ { ++ if (m_TranformerType == YDLIDAR_TYPE_TCP) ++ { ++ _serial = new CActiveSocket(); ++ } ++ else ++ { ++ _serial = new serial::Serial(port_path, m_baudrate, ++ serial::Timeout::simpleTimeout(DEFAULT_TIMEOUT)); ++ } ++ _serial->bindport(port_path, baudrate); ++ } + +- if (!_serial->open()) { ++ if (!_serial->open()) ++ { + setDriverError(NotOpenError); + return RESULT_FAIL; + } + + m_isConnected = true; +- + } + + stopScan(); +@@ -217,8 +224,8 @@ void YDlidarDriver::disconnect() { + + stop(); + delay(10); +- ScopedLocker l(_cmd_lock); + ++ ScopedLocker l(_cmd_lock); + if (_serial) { + if (_serial->isOpen()) { + _serial->closePort(); +@@ -226,7 +233,6 @@ void YDlidarDriver::disconnect() { + } + + m_isConnected = false; +- + } + + +@@ -416,64 +422,81 @@ result_t YDlidarDriver::waitForData(size_t data_count, uint32_t timeout, + return (result_t)_serial->waitfordata(data_count, timeout, returned_size); + } + +-result_t YDlidarDriver::checkAutoConnecting(bool serialError) { ++result_t YDlidarDriver::checkAutoConnecting(bool serialError) ++{ + result_t ans = RESULT_FAIL; + isAutoconnting = true; + m_InvalidNodeCount = 0; + +- if (m_driverErrno != BlockError) { ++ if (m_driverErrno != BlockError) ++ { + setDriverError(TimeoutError); + } + +- +- while (isAutoReconnect && isAutoconnting) { ++ while (isAutoReconnect && isAutoconnting) ++ { + { + ScopedLocker l(_cmd_lock); ++ if (_serial) ++ { ++ if (_serial->isOpen() || m_isConnected) ++ { ++ size_t buffer_size = _serial->available(); ++ m_BufferSize += buffer_size; + +- if (_serial) { +- if (_serial->isOpen() || m_isConnected) { +- size_t buffer_size = _serial->available(); +- m_BufferSize += buffer_size; +- +- if (m_BufferSize && m_BufferSize % 7 == 0) { +- setDriverError(BlockError); +- } else { +- if (buffer_size > 0 || m_BufferSize > 0) { +- if (m_driverErrno != BlockError) { +- setDriverError(TrembleError); ++ if (m_BufferSize && m_BufferSize % 7 == 0) ++ { ++ setDriverError(BlockError); ++ } ++ else ++ { ++ if (buffer_size > 0 || m_BufferSize > 0) ++ { ++ if (m_driverErrno != BlockError) ++ { ++ setDriverError(TrembleError); ++ } ++ } ++ else ++ { ++ setDriverError(NotBufferError); + } +- } else { +- setDriverError(NotBufferError); + } +- } + +- if ((retryCount % 2 == 1) || serialError) { +- m_isConnected = false; +- _serial->closePort(); +- delete _serial; +- _serial = NULL; +- } else { +- m_BufferSize -= buffer_size; +- } ++ if ((retryCount % 2 == 1) || serialError) ++ { ++ m_isConnected = false; ++ _serial->closePort(); ++ delete _serial; ++ _serial = NULL; ++ } ++ else ++ { ++ m_BufferSize -= buffer_size; ++ } + } + } + } + +- if (!m_isConnected && ((retryCount % 2 == 1) || serialError)) { +- if (!IS_OK(connect(serial_port.c_str(), m_baudrate))) { ++ if (!m_isConnected && ((retryCount % 2 == 1) || serialError)) ++ { ++ if (!IS_OK(connect(serial_port.c_str(), m_baudrate))) ++ { + setDriverError(NotOpenError); + } + } + + retryCount++; + +- if (retryCount > 50) { ++ if (retryCount > 50) ++ { + retryCount = 50; + } + + int tempCount = 0; + +- while (isAutoReconnect && isscanning() && tempCount < retryCount) { ++ while (isAutoReconnect && isscanning() && tempCount < retryCount) ++ { + delay(200); + tempCount++; + } +@@ -482,64 +505,76 @@ result_t YDlidarDriver::checkAutoConnecting(bool serialError) { + int retryConnect = 0; + + while (isAutoReconnect && +- connect(serial_port.c_str(), m_baudrate) != RESULT_OK) { ++ connect(serial_port.c_str(), m_baudrate) != RESULT_OK) ++ { + retryConnect++; + +- if (retryConnect > 25) { ++ if (retryConnect > 25) ++ { + retryConnect = 25; + } + + tempCount = 0; + setDriverError(NotOpenError); + +- while (isAutoReconnect && isscanning() && tempCount < retryConnect) { ++ while (isAutoReconnect && isscanning() && tempCount < retryConnect) ++ { + delay(200); + tempCount++; + } + } + +- if (!isAutoReconnect) { ++ if (!isAutoReconnect) ++ { + m_isScanning = false; + isAutoconnting = false; + return RESULT_FAIL; + } + +- if (isconnected()) { ++ if (isconnected()) ++ { + delay(50); + +- if (!m_SingleChannel && m_driverErrno != BlockError) { ++ if (!m_SingleChannel && m_driverErrno != BlockError) ++ { + device_info devinfo; + ans = getDeviceInfo(devinfo); + +- if (!IS_OK(ans)) { +- stopScan(); +- ans = getDeviceInfo(devinfo); ++ if (!IS_OK(ans)) ++ { ++ stopScan(); ++ ans = getDeviceInfo(devinfo); + } + +- if (!IS_OK(ans)) { +- setDriverError(DeviceNotFoundError); +- continue; ++ if (!IS_OK(ans)) ++ { ++ setDriverError(DeviceNotFoundError); ++ continue; + } + } + + { +- ScopedLocker l(_cmd_lock); + ans = startAutoScan(); + +- if (!IS_OK(ans)) { +- ans = startAutoScan(); ++ if (!IS_OK(ans)) ++ { ++ ans = startAutoScan(); + } + } + +- if (IS_OK(ans)) { ++ if (IS_OK(ans)) ++ { + isAutoconnting = false; + +- if (getDriverError() == DeviceNotFoundError) { +- setDriverError(NoError); ++ if (getDriverError() == DeviceNotFoundError) ++ { ++ setDriverError(NoError); + } + + return ans; +- } else { ++ } ++ else ++ { + setDriverError(DeviceNotFoundError); + } + } +@@ -547,7 +582,6 @@ result_t YDlidarDriver::checkAutoConnecting(bool serialError) { + + isAutoconnting = false; + return RESULT_FAIL; +- + } + + result_t YDlidarDriver::autoHeartBeat() { +@@ -555,7 +589,7 @@ result_t YDlidarDriver::autoHeartBeat() { + return RESULT_FAIL; + } + +- ScopedLocker lock(_lock); ++ ScopedLocker l(_cmd_lock); + result_t ans = sendCommand(LIDAR_CMD_SCAN); + return ans; + } +@@ -599,21 +633,23 @@ int YDlidarDriver::cacheScanData() + waitDevicePackage(1000); + } + +- flushSerial(); +- waitScanData(local_buf, count); ++ // flushSerial(); ++ // waitScanData(local_buf, count); + +- int timeout_count = 0; ++ int timeout_count = 0; + retryCount = 0; + m_BufferSize = 0; + m_heartbeat_ts = getms(); + bool m_last_frame_valid = false; + ++ m_isScanning = true; ++ + while (m_isScanning) + { + count = 128; + ans = waitScanData(local_buf, count, DEFAULT_TIMEOUT / 2); + +- // printf("count %llu\n", count); ++ // printf("count %lu ret %d\n", count, ans); + // fflush(stdout); + + if (!IS_OK(ans)) { +@@ -668,9 +704,10 @@ int YDlidarDriver::cacheScanData() + { + if (local_buf[pos].sync_flag & LIDAR_RESP_MEASUREMENT_SYNCBIT) + { ++ // printf("[YDLIDAR] S2 points Stored in buffer start %lu\n", scan_count); + if (local_scan[0].sync_flag & LIDAR_RESP_MEASUREMENT_SYNCBIT) + { +- _lock.lock();//timeout lock, wait resource copy ++ ScopedLocker l(_lock); + //将下一圈的第一个点的采集时间作为当前圈数据的采集时间 + // local_scan[0].stamp = local_buf[pos].stamp; + // if (local_scan[0].stamp == 0) { +@@ -681,7 +718,7 @@ int YDlidarDriver::cacheScanData() + memcpy(scan_node_buf, local_scan, scan_count * sizeof(node_info)); + scan_node_count = scan_count; + _dataEvent.set(); +- _lock.unlock(); ++ // printf("[YDLIDAR] S2 points Stored in buffer end %lu\n", scan_count); + } + + scan_count = 0; +@@ -928,14 +965,15 @@ result_t YDlidarDriver::parseResponseHeader( + size_t remainSize = PackagePaidBytes - recvPos; + size_t recvSize = 0; + ans = waitForData(remainSize, timeout - waitTime, &recvSize); +- + if (!IS_OK(ans)) ++ { + return ans; ++ } + + if (recvSize > remainSize) + recvSize = remainSize; + +- getData(globalRecvBuffer, recvSize); ++ ans = getData(globalRecvBuffer, recvSize); + // printf("recv: "); + // printHex(globalRecvBuffer, recvSize); + +@@ -1273,6 +1311,7 @@ void YDlidarDriver::calcutePackageCT() { + package_CT = packages.package_CT; + nowPackageNum = packages.nowPackageNum; + } ++ // printf("[YDLIDAR] S2 pack points %u\n", nowPackageNum); + } + + void YDlidarDriver::parseNodeDebugFromBuffer(node_info *node) +@@ -1414,7 +1453,8 @@ void YDlidarDriver::parseNodeFromeBuffer(node_info *node) + + package_Sample_Index ++; + +- if (package_Sample_Index >= nowPackageNum) { ++ if (package_Sample_Index >= nowPackageNum) ++ { + package_Sample_Index = 0; + CheckSumResult = false; + } +@@ -1485,36 +1525,37 @@ result_t YDlidarDriver::waitScanData( + return RESULT_FAIL; + } + +- +-result_t YDlidarDriver::grabScanData(node_info *nodebuffer, size_t &count, +- uint32_t timeout) { +- switch (_dataEvent.wait(timeout)) { ++result_t YDlidarDriver::grabScanData(node_info *nodebuffer, ++ size_t &count, ++ uint32_t timeout) ++{ ++ switch (_dataEvent.wait(timeout)) ++ { + case Event::EVENT_TIMEOUT: +- count = 0; +- return RESULT_TIMEOUT; ++ count = 0; ++ return RESULT_TIMEOUT; + +- case Event::EVENT_OK: { +- if (scan_node_count == 0) { +- return RESULT_FAIL; +- } ++ case Event::EVENT_OK: ++ { ++ ScopedLocker l(_lock); ++ // if (scan_node_count == 0) ++ // { ++ // return RESULT_FAIL; ++ // } + +- ScopedLocker l(_lock); +- size_t size_to_copy = min(count, scan_node_count); +- memcpy(nodebuffer, scan_node_buf, size_to_copy * sizeof(node_info)); +- count = size_to_copy; +- scan_node_count = 0; ++ size_t size_to_copy = min(count, scan_node_count); ++ memcpy(nodebuffer, scan_node_buf, size_to_copy * sizeof(node_info)); ++ count = size_to_copy; ++ scan_node_count = 0; + } +- +- return RESULT_OK; ++ return RESULT_OK; + + default: +- count = 0; +- return RESULT_FAIL; +- } +- ++ count = 0; ++ return RESULT_FAIL; ++ } + } + +- + result_t YDlidarDriver::ascendScanData(node_info *nodebuffer, size_t count) { + float inc_origin_angle = (float)360.0 / count; + int i = 0; +@@ -1645,7 +1686,7 @@ result_t YDlidarDriver::getHealth(device_health &health, uint32_t timeout) { + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_GET_DEVICE_HEALTH)) != RESULT_OK) { + return ans; +@@ -1702,7 +1743,7 @@ result_t YDlidarDriver::getDeviceInfo(device_info &info, uint32_t timeout) { + // disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_GET_DEVICE_INFO)) != RESULT_OK) { + return ans; +@@ -1843,8 +1884,7 @@ result_t YDlidarDriver::startScan(bool force, uint32_t timeout) + flushSerial(); + delay(30); + { +- ScopedLocker l(_lock); +- ++ ScopedLocker l(_cmd_lock); + if ((ans = sendCommand(force ? LIDAR_CMD_FORCE_SCAN : LIDAR_CMD_SCAN)) != + RESULT_OK) + { +@@ -1890,7 +1930,7 @@ result_t YDlidarDriver::stopScan(uint32_t timeout) { + return RESULT_FAIL; + } + +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + sendCommand(LIDAR_CMD_FORCE_STOP); + delay(5); + sendCommand(LIDAR_CMD_STOP); +@@ -1898,15 +1938,24 @@ result_t YDlidarDriver::stopScan(uint32_t timeout) { + return RESULT_OK; + } + +-result_t YDlidarDriver::createThread() { ++result_t YDlidarDriver::createThread() ++{ ++ //如果线程已启动,则先退出线程 ++ if (_thread.getHandle()) ++ { ++ m_isScanning = false; ++ _thread.join(); ++ } ++ + _thread = CLASS_THREAD(YDlidarDriver, cacheScanData); + +- if (_thread.getHandle() == 0) { +- m_isScanning = false; ++ if (!_thread.getHandle()) { + return RESULT_FAIL; + } + +- m_isScanning = true; ++ printf("[YDlidar] Create thread 0x%X\n", _thread.getHandle()); ++ fflush(stdout); ++ + return RESULT_OK; + } + +@@ -1922,7 +1971,7 @@ result_t YDlidarDriver::startAutoScan(bool force, uint32_t timeout) { + delay(10); + { + +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(force ? LIDAR_CMD_FORCE_SCAN : LIDAR_CMD_SCAN)) != + RESULT_OK) { +@@ -1984,7 +2033,7 @@ result_t YDlidarDriver::reset(uint32_t timeout) { + return RESULT_FAIL; + } + +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_RESET)) != RESULT_OK) { + return ans; +@@ -1997,7 +2046,7 @@ result_t YDlidarDriver::reset(uint32_t timeout) { + /* startMotor */ + /************************************************************************/ + result_t YDlidarDriver::startMotor() { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if (m_SupportMotorDtrCtrl) { + setDTR(); +@@ -2014,7 +2063,7 @@ result_t YDlidarDriver::startMotor() { + /* stopMotor */ + /************************************************************************/ + result_t YDlidarDriver::stopMotor() { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if (m_SupportMotorDtrCtrl) { + clearDTR(); +@@ -2041,7 +2090,7 @@ result_t YDlidarDriver::getScanFrequency(scan_frequency &frequency, + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_GET_AIMSPEED)) != RESULT_OK) { + return ans; +@@ -2084,7 +2133,7 @@ result_t YDlidarDriver::setScanFrequencyAdd(scan_frequency &frequency, + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_SET_AIMSPEED_ADD)) != RESULT_OK) { + return ans; +@@ -2127,7 +2176,7 @@ result_t YDlidarDriver::setScanFrequencyDis(scan_frequency &frequency, + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_SET_AIMSPEED_DIS)) != RESULT_OK) { + return ans; +@@ -2170,7 +2219,7 @@ result_t YDlidarDriver::setScanFrequencyAddMic(scan_frequency &frequency, + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_SET_AIMSPEED_ADDMIC)) != RESULT_OK) { + return ans; +@@ -2213,7 +2262,7 @@ result_t YDlidarDriver::setScanFrequencyDisMic(scan_frequency &frequency, + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_SET_AIMSPEED_DISMIC)) != RESULT_OK) { + return ans; +@@ -2255,7 +2304,7 @@ result_t YDlidarDriver::getSamplingRate(sampling_rate &rate, uint32_t timeout) { + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_GET_SAMPLING_RATE)) != RESULT_OK) { + return ans; +@@ -2298,7 +2347,7 @@ result_t YDlidarDriver::setSamplingRate(sampling_rate &rate, uint32_t timeout) { + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_SET_SAMPLING_RATE)) != RESULT_OK) { + return ans; +@@ -2341,7 +2390,7 @@ result_t YDlidarDriver::getZeroOffsetAngle(offset_angle &angle, + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_GET_OFFSET_ANGLE)) != RESULT_OK) { + return ans; +@@ -2384,7 +2433,7 @@ result_t YDlidarDriver::setScanHeartbeat(scan_heart_beat &beat, + disableDataGrabbing(); + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_SET_HEART_BEAT)) != RESULT_OK) { + return ans; +@@ -2426,7 +2475,7 @@ result_t YDlidarDriver::getAutoZeroOffsetAngle(offset_angle &angle, + + flushSerial(); + { +- ScopedLocker l(_lock); ++ ScopedLocker l(_cmd_lock); + + if ((ans = sendCommand(LIDAR_CMD_GET_OFFSET_ANGLE)) != RESULT_OK) { + return ans; +-- +2.34.1 + diff --git a/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/ydlidar_1.1.3.bb b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/ydlidar_1.1.3.bb new file mode 100644 index 0000000000000000000000000000000000000000..bb925e8698cc4dd2ce45019ccb2d080bc6deda69 --- /dev/null +++ b/meta-openeuler/dynamic-layers/ros2-layer/recipes-ros/ydlidar/ydlidar_1.1.3.bb @@ -0,0 +1,47 @@ +DESCRIPTION = "ydlidar driver" +SECTION = "devel" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=4e320231d59c825e45dbfda066af29c9" + +inherit cmake +PV="1.1.3" + +OPENEULER_REPO_NAME = "yocto-embedded-tools" +OPENEULER_LOCAL_NAME = "ros-dev-tools" +OPENEULER_BRANCH = "dev_ros" +OPENEULER_GIT_URL = "https://gitee.com/openeuler" + +SRC_URI = "file://${OPENEULER_LOCAL_NAME}/ros_depends/${BPN}/V${PV}.tar.gz \ + file://0001-GS2.patch \ + file://0002-windows.patch \ + file://0003-GS1.patch \ + file://0004-S2-Pro.patch \ + file://0005-GS2-S2.patch \ + " + +S = "${WORKDIR}/YDLidar-SDK-${PV}" + +SRC_URI[md5sum] = "10d97fd77d76f1f754ef40b90a36ba17" +SRC_URI[sha256sum] = "88284d8fe5e567120d73d6967b840538f3f1975182db0ef0eb8233ac69023d1b" + +DEPENDS = "swig-native python3" + +SYSROOT_DIRS += "/usr/lib" + +FILES_${PN}-staticdev += "/usr/lib/libydlidar_sdk.a" +FILES_${PN} += "/usr/share /usr/startup /usr/lib/python*" + +# fix pkgconfig installdir conflict and driver compile warnings (which fix buffer overflow) +do_configure_prepend_class-target() { + if [ -f ${S}/cmake/install_package.cmake ]; then + cat ${S}/cmake/install_package.cmake | grep "\${CMAKE_INSTALL_DATAROOTDIR}\/pkgconfig" || sed -i 's:${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig:g' ${S}/cmake/install_package.cmake + cat ${S}/cmake/install_package.cmake | grep "\${CMAKE_INSTALL_DATAROOTDIR}\/cmake" || sed -i 's:lib/cmake:${CMAKE_INSTALL_DATAROOTDIR}/cmake:g' ${S}/cmake/install_package.cmake + fi + sed -i 's:0x\%X thread has been canceled:0x\%lX thread has been canceled:g' ${S}/core/base/thread.h + sed -i 's:Create thread 0x\%X:Create thread 0x\%lX:g' ${S}/src/YDlidarDriver.cpp + sed -i 's:serialnum\[16\]:serialnum\[40\]:g' ${S}/core/common/ydlidar_protocol.h +} + + +BBCLASSEXTEND = "native nativesdk" + diff --git a/meta-openeuler/lib/oe/__init__.py b/meta-openeuler/lib/oe/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3ad9513f40e0c4c6eb5c09fa404aaa95e3ee8753 --- /dev/null +++ b/meta-openeuler/lib/oe/__init__.py @@ -0,0 +1,2 @@ +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) diff --git a/meta-openeuler/lib/oe/external.py b/meta-openeuler/lib/oe/external.py new file mode 100644 index 0000000000000000000000000000000000000000..9fd78d60faa80a89c33d152f9e2b51324ef5f024 --- /dev/null +++ b/meta-openeuler/lib/oe/external.py @@ -0,0 +1,144 @@ +import os.path +import re +import shlex +import subprocess +import oe.path +import bb + + +def run(d, cmd, *args): + topdir = d.getVar('TOPDIR') + toolchain_path = d.getVar('EXTERNAL_TOOLCHAIN') + if toolchain_path: + target_prefix = d.getVar('EXTERNAL_TARGET_SYS') + '-' + if not cmd.startswith(target_prefix): + cmd = target_prefix + cmd + + toolchain_bin = d.getVar('EXTERNAL_TOOLCHAIN_BIN') + path = os.path.join(toolchain_bin, cmd) + args = shlex.split(path) + list(args) + + bb.debug(1, 'oe.external.run({})'.format(repr(args))) + try: + stdout, stderr = bb.process.run(args, cwd=topdir) + except bb.process.CmdError as exc: + bb.debug(1, 'oe.external.run: {} failed: {}'.format(subprocess.list2cmdline(args), exc)) + else: +# cmd like gcc -v will output to stderr not stdout, so do special handling for it + if (stdout == ''): + stdout = stderr + return stdout + + return 'UNKNOWN' + + +def parse_mirrors(mirrors_string): + mirrors, invalid = [], [] + for entry in mirrors_string.replace('\\n', '\n').split('\n'): + entry = entry.strip() + if not entry: + continue + try: + pathname, subst = entry.strip().split('|', 1) + except ValueError: + invalid.append(entry) + mirrors.append(('^' + re.escape(pathname), subst)) + return mirrors, invalid + + +def get_file_search_metadata(d): + '''Given the metadata, return the mirrors and sysroots to operate against.''' + + premirrors, invalid = parse_mirrors(d.getVar('FILES_PREMIRRORS')) + for invalid_entry in invalid: + bb.warn('Invalid FILES_MIRRORS entry: {0}'.format(invalid_entry)) + + mirrors, invalid = parse_mirrors(d.getVar('FILES_MIRRORS')) + for invalid_entry in invalid: + bb.warn('Invalid FILES_MIRRORS entry: {0}'.format(invalid_entry)) + + source_paths = [os.path.realpath(p) + for p in d.getVar('EXTERNAL_INSTALL_SOURCE_PATHS').split()] + + return source_paths, mirrors, premirrors + + +def gather_pkg_files(d): + '''Given the metadata, return all the files we want to copy to ${D} for + this recipe.''' + import itertools + files = [] + for pkg in d.getVar('PACKAGES').split(): + files = itertools.chain(files, (d.getVar('EXTERNAL_FILES_{}'.format(pkg)) or d.getVar('FILES_{}'.format(pkg)) or '').split()) + files = itertools.chain(files, d.getVar('EXTERNAL_EXTRA_FILES').split()) + return files + + +def copy_from_sysroots(pathnames, sysroots, mirrors, premirrors, installdest): + '''Copy the specified files from the specified sysroots, also checking the + specified mirror patterns as alternate paths, to the specified destination.''' + expanded_pathnames = expand_paths(pathnames, mirrors, premirrors) + searched_paths = search_sysroots(expanded_pathnames, sysroots) + for path, files in searched_paths: + if not files: + bb.debug(1, 'oe.external: failed to find `{}`'.format(path)) + else: + destdir = oe.path.join(installdest, os.path.dirname(path)) + bb.utils.mkdirhier(destdir) + subprocess.check_call(['cp', '-PR', '--preserve=mode,timestamps', '--no-preserve=ownership'] + list(files) + [destdir + '/']) + bb.note('Copied `{}` to `{}/`'.format(', '.join(files), destdir)) + +def expand_paths(pathnames, mirrors, premirrors): + '''Apply search/replace to paths to get alternate search paths. + + Returns a generator with tuples of (pathname, expanded_paths).''' + for pathname in pathnames: + expanded_paths = [] + + for search, replace in premirrors: + try: + new_pathname = re.sub(search, replace, pathname, count=1) + except re.error as exc: + bb.warn("Invalid pattern for `%s`" % search) + continue + if new_pathname != pathname: + expanded_paths.append(new_pathname) + + expanded_paths.append(pathname) + + for search, replace in mirrors: + try: + new_pathname = re.sub(search, replace, pathname, count=1) + except re.error as exc: + bb.warn("Invalid pattern for `%s`" % search) + continue + if new_pathname != pathname: + expanded_paths.append(new_pathname) + + yield pathname, expanded_paths + +def search_sysroots(path_entries, sysroots): + '''Search the supplied sysroots for the supplied paths, checking supplied + alternate paths. Expects entries in the format (pathname, all_paths). + + Returns a generator with tuples of (pathname, found_paths).''' + import glob + import itertools + for path, pathnames in path_entries: + for sysroot, pathname in ((s, p) for s in sysroots + for p in pathnames): + check_path = sysroot + os.sep + pathname + found_paths = glob.glob(check_path) + if found_paths: + print("%s --> %s" % (path, found_paths)) + yield path, found_paths + break + else: + yield path, None + + +def find_sysroot_files(paths, d): + sysroots, mirrors, premirrors = get_file_search_metadata(d) + expanded = expand_paths(paths, mirrors, premirrors) + search_results = list(search_sysroots(expanded, sysroots)) + return [v for k, v in search_results] diff --git a/meta-openeuler/recipes-arm/arm-compute-library/arm-compute-library/0001-update-scon-configuration-for-yocto-build.patch b/meta-openeuler/recipes-arm/arm-compute-library/arm-compute-library/0001-update-scon-configuration-for-yocto-build.patch new file mode 100755 index 0000000000000000000000000000000000000000..1ada87fed3562d9c5325ff1fa223fc9fc0463214 --- /dev/null +++ b/meta-openeuler/recipes-arm/arm-compute-library/arm-compute-library/0001-update-scon-configuration-for-yocto-build.patch @@ -0,0 +1,11 @@ +--- a/SConstruct 2022-12-09 09:12:36.260399839 +0000 ++++ b/SConstruct 2022-12-09 09:15:03.923701343 +0000 +@@ -359,7 +359,7 @@ + auto_toolchain_prefix = "armv7l-tizen-linux-gnueabi-" + elif env['estate'] == '64' and 'v8' in env['arch']: + if env['os'] == 'linux': +- auto_toolchain_prefix = "aarch64-linux-gnu-" ++ auto_toolchain_prefix = "" + elif env['os'] == 'bare_metal': + auto_toolchain_prefix = "aarch64-elf-" + elif env['os'] == 'android': diff --git a/meta-openeuler/recipes-arm/arm-compute-library/arm-compute-library_%.bbappend b/meta-openeuler/recipes-arm/arm-compute-library/arm-compute-library_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..2f37904bde60cdd23655258f7a485cdc4cafeaca --- /dev/null +++ b/meta-openeuler/recipes-arm/arm-compute-library/arm-compute-library_%.bbappend @@ -0,0 +1,45 @@ +# main bb file: yocto-meta-openeuler/meta-openeuler/recipes-arm/arm-compute-library/arm-compute-library_22.11.bb +PV = "22.11" + +OPENEULER_BRANCH = "master" +OPENEULER_REPO_NAME = "ComputeLibrary" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=f3c5879801d3cffc4ac2399f2b8e8ec5" + +SRC_URI = " \ + file://ComputeLibrary-${PV}.tar.gz \ + file://0001-update-scon-configuration-for-yocto-build.patch \ +" +SRC_URI[arm-compute-library.sha256sum] = "2f70f54d84390625222503ea38650c00c49d4b70bc86a6b9aeeebee9d243865f" + +S = "${WORKDIR}/ComputeLibrary-${PV}" + +EXTRA_OESCONS = "arch=arm64-v8a extra_cxx_flags="-fPIC -Wno-unused-but-set-variable -Wno-ignored-qualifiers -Wno-noexcept" benchmark_tests=1 validation_tests=0 set_soname=1" +EXTRA_OESCONS += "neon=1 opencl=0 embed_kernels=1" + +scons_do_compile() { + ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} || \ + die "scons build execution failed." +} + +do_install() { + CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" + + install -d ${D}${libdir} + for lib in ${S}/build/lib*.* + do + cp $CP_ARGS $lib ${D}${libdir} + done + + # Install 'example' and benchmark executables + install -d ${D}${bindir} + find ${S}/build/examples/ -maxdepth 1 -type f -executable -exec cp $CP_ARGS {} ${D}${bindir} \; + cp $CP_ARGS ${S}/build/tests/arm_compute_benchmark ${D}${bindir} + + # Install built source package as expected by ARMNN + install -d ${D}${datadir}/${BPN} + cp $CP_ARGS ${S}/arm_compute ${D}${datadir}/${BPN}/. + cp $CP_ARGS ${S}/include ${D}${datadir}/${BPN}/. + cp $CP_ARGS ${S}/support ${D}${datadir}/${BPN}/. +} + diff --git a/meta-openeuler/recipes-arm/arm-compute-library/arm-compute-library_19.02.bb b/meta-openeuler/recipes-arm/arm-compute-library/arm-compute-library_19.02.bb new file mode 100644 index 0000000000000000000000000000000000000000..fe02087a17c164ff9470953908233d7d66bb9e41 --- /dev/null +++ b/meta-openeuler/recipes-arm/arm-compute-library/arm-compute-library_19.02.bb @@ -0,0 +1,44 @@ +SUMMARY = "The ARM Computer Vision and Machine Learning library" +DESCRIPTION = "The ARM Computer Vision and Machine Learning library is a set of functions optimised for both ARM CPUs and GPUs." +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=762a7ba8d2ddc3b38d88742fbaf0b62d" + +inherit scons + +SRC_URI = " \ + git://github.com/ARM-software/ComputeLibrary.git;tag=v${PV};name=arm-compute-library \ + file://0001-update-scon-configuration-for-yocto-build.patch \ +" + +S = "${WORKDIR}/git" + +LIBS += "-larmpl_lp64_mp" + +do_install() { + CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" + + install -d ${D}${libdir} + for lib in ${S}/build/*.so* + do + cp $CP_ARGS $lib ${D}${libdir} + done + + # Install 'example' and benchmark executables + install -d ${D}${bindir} + find ${S}/build/examples/ -maxdepth 1 -type f -executable -exec cp $CP_ARGS {} ${D}${bindir} \; + cp $CP_ARGS ${S}/build/tests/arm_compute_benchmark ${D}${bindir} + + # Install built source package as expected by ARMNN + install -d ${D}${datadir}/${BPN} + cp $CP_ARGS ${S}/arm_compute ${D}${datadir}/${BPN}/. + cp $CP_ARGS ${S}/include ${D}${datadir}/${BPN}/. + cp $CP_ARGS ${S}/support ${D}${datadir}/${BPN}/. +} + +INSANE_SKIP_${PN} = "ldflags" +INSANE_SKIP_${PN}-dev = "dev-elf ldflags" + +FILES_${PN}-source = "${datadir}/${BPN}" +INSANE_SKIP_${PN}-source = "ldflags libdir staticdev" +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" + diff --git a/meta-openeuler/recipes-arm/armnn/armnn/0001-modify-cmake-files.patch b/meta-openeuler/recipes-arm/armnn/armnn/0001-modify-cmake-files.patch new file mode 100644 index 0000000000000000000000000000000000000000..6f28ad4a0861abf699bbafcf0801c9e806efc4a1 --- /dev/null +++ b/meta-openeuler/recipes-arm/armnn/armnn/0001-modify-cmake-files.patch @@ -0,0 +1,2695 @@ +diff -uprN a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2022-12-13 05:28:24.318130169 +0000 ++++ b/CMakeLists.txt 2022-12-13 05:29:40.296835641 +0000 +@@ -733,7 +733,7 @@ if(BUILD_UNIT_TESTS) + add_custom_command( + OUTPUT SchemaText.cpp + COMMAND cp ${TF_LITE_SCHEMA_INCLUDE_PATH}/schema.fbs g_TfLiteSchemaText +- COMMAND xxd -i g_TfLiteSchemaText SchemaText.cpp ++ COMMAND cp ${PROJECT_SOURCE_DIR}/SchemaText.cpp . + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${TF_LITE_SCHEMA_INCLUDE_PATH}/schema.fbs + ) +diff -uprN a/SchemaText.cpp b/SchemaText.cpp +--- a/SchemaText.cpp 1970-01-01 00:00:00.000000000 +0000 ++++ b/SchemaText.cpp 2022-12-13 05:28:39.782273754 +0000 +@@ -0,0 +1,2679 @@ ++unsigned char g_TfLiteSchemaText[] = { ++ 0x2f, 0x2f, 0x20, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, ++ 0x20, 0x32, 0x30, 0x31, 0x37, 0x20, 0x54, 0x68, 0x65, 0x20, 0x54, 0x65, ++ 0x6e, 0x73, 0x6f, 0x72, 0x46, 0x6c, 0x6f, 0x77, 0x20, 0x41, 0x75, 0x74, ++ 0x68, 0x6f, 0x72, 0x73, 0x2e, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x52, 0x69, ++ 0x67, 0x68, 0x74, 0x73, 0x20, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, ++ 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x69, 0x63, ++ 0x65, 0x6e, 0x73, 0x65, 0x64, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, ++ 0x74, 0x68, 0x65, 0x20, 0x41, 0x70, 0x61, 0x63, 0x68, 0x65, 0x20, 0x4c, ++ 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c, 0x20, 0x56, 0x65, 0x72, 0x73, ++ 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x2e, 0x30, 0x20, 0x28, 0x74, 0x68, 0x65, ++ 0x20, 0x22, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x3b, ++ 0x0a, 0x2f, 0x2f, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, ++ 0x6e, 0x6f, 0x74, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, ++ 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, ++ 0x20, 0x69, 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x61, 0x6e, ++ 0x63, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, ++ 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6f, 0x62, 0x74, 0x61, ++ 0x69, 0x6e, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x20, 0x6f, 0x66, ++ 0x20, 0x74, 0x68, 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, ++ 0x20, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, ++ 0x20, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, ++ 0x2e, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x2f, ++ 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2f, 0x4c, 0x49, 0x43, ++ 0x45, 0x4e, 0x53, 0x45, 0x2d, 0x32, 0x2e, 0x30, 0x0a, 0x2f, 0x2f, 0x0a, ++ 0x2f, 0x2f, 0x20, 0x55, 0x6e, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x72, 0x65, ++ 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x70, ++ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6c, 0x61, 0x77, ++ 0x20, 0x6f, 0x72, 0x20, 0x61, 0x67, 0x72, 0x65, 0x65, 0x64, 0x20, 0x74, ++ 0x6f, 0x20, 0x69, 0x6e, 0x20, 0x77, 0x72, 0x69, 0x74, 0x69, 0x6e, 0x67, ++ 0x2c, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x0a, 0x2f, ++ 0x2f, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, ++ 0x64, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x69, 0x73, 0x20, 0x64, ++ 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x20, 0x6f, ++ 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, ++ 0x20, 0x42, 0x41, 0x53, 0x49, 0x53, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x57, ++ 0x49, 0x54, 0x48, 0x4f, 0x55, 0x54, 0x20, 0x57, 0x41, 0x52, 0x52, 0x41, ++ 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, ++ 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x41, ++ 0x4e, 0x59, 0x20, 0x4b, 0x49, 0x4e, 0x44, 0x2c, 0x20, 0x65, 0x69, 0x74, ++ 0x68, 0x65, 0x72, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x20, ++ 0x6f, 0x72, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x2e, 0x0a, ++ 0x2f, 0x2f, 0x20, 0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4c, ++ 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, ++ 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, ++ 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x76, ++ 0x65, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, ++ 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x2f, ++ 0x2f, 0x20, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x0a, 0x2f, 0x2f, ++ 0x20, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x48, 0x69, ++ 0x73, 0x74, 0x6f, 0x72, 0x79, 0x0a, 0x2f, 0x2f, 0x20, 0x56, 0x65, 0x72, ++ 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x30, 0x3a, 0x20, 0x49, 0x6e, 0x69, 0x74, ++ 0x69, 0x61, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, ++ 0x0a, 0x2f, 0x2f, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, ++ 0x31, 0x3a, 0x20, 0x41, 0x64, 0x64, 0x20, 0x73, 0x75, 0x62, 0x67, 0x72, ++ 0x61, 0x70, 0x68, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x63, 0x68, 0x65, ++ 0x6d, 0x61, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, ++ 0x6f, 0x6e, 0x20, 0x32, 0x3a, 0x20, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, ++ 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x74, ++ 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x74, 0x6f, ++ 0x20, 0x4e, 0x4e, 0x20, 0x41, 0x50, 0x49, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, ++ 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x33, 0x3a, 0x20, 0x4d, ++ 0x6f, 0x76, 0x65, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x64, ++ 0x61, 0x74, 0x61, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x4d, 0x6f, 0x64, ++ 0x65, 0x6c, 0x2e, 0x53, 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, ++ 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x4d, ++ 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, ++ 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, ++ 0x20, 0x33, 0x61, 0x3a, 0x20, 0x41, 0x64, 0x64, 0x20, 0x6e, 0x65, 0x77, ++ 0x20, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x20, 0x6f, 0x70, 0x20, ++ 0x63, 0x6f, 0x64, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20, ++ 0x48, 0x61, 0x73, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, ++ 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, ++ 0x74, 0x79, 0x20, 0x77, 0x69, 0x74, 0x68, 0x0a, 0x2f, 0x2f, 0x20, 0x20, ++ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, ++ 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x33, 0x2e, 0x0a, 0x2f, 0x2f, ++ 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x33, 0x62, 0x3a, ++ 0x20, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, ++ 0x64, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, ++ 0x75, 0x72, 0x65, 0x44, 0x65, 0x66, 0x2e, 0x20, 0x48, 0x61, 0x73, 0x20, ++ 0x62, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, 0x20, 0x63, 0x6f, 0x6d, ++ 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x77, ++ 0x69, 0x74, 0x68, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, ++ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, ++ 0x6f, 0x6e, 0x20, 0x33, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x33, 0x61, 0x2e, ++ 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, ++ 0x74, 0x66, 0x6c, 0x69, 0x74, 0x65, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, ++ 0x54, 0x68, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, ++ 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x66, 0x69, 0x6c, ++ 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, ++ 0x20, 0x22, 0x54, 0x46, 0x4c, 0x33, 0x22, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, ++ 0x46, 0x69, 0x6c, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, ++ 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x77, 0x72, ++ 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, ++ 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, ++ 0x69, 0x6f, 0x6e, 0x20, 0x22, 0x74, 0x66, 0x6c, 0x69, 0x74, 0x65, 0x22, ++ 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, ++ 0x41, 0x4e, 0x54, 0x3a, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x6e, 0x65, 0x77, ++ 0x20, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x6f, 0x66, 0x20, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2c, 0x20, 0x65, 0x6e, 0x75, 0x6d, ++ 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x64, 0x64, ++ 0x65, 0x64, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, ++ 0x20, 0x65, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x73, 0x75, ++ 0x72, 0x65, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, 0x73, ++ 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, ++ 0x74, 0x79, 0x2e, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, ++ 0x74, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x61, 0x74, 0x61, ++ 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, ++ 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x0a, 0x65, 0x6e, 0x75, ++ 0x6d, 0x20, 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, ++ 0x20, 0x3a, 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, ++ 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x30, 0x2c, ++ 0x0a, 0x20, 0x20, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x31, 0x36, 0x20, 0x3d, ++ 0x20, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x20, ++ 0x3d, 0x20, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x49, 0x4e, 0x54, 0x38, ++ 0x20, 0x3d, 0x20, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x49, 0x4e, 0x54, 0x36, ++ 0x34, 0x20, 0x3d, 0x20, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x54, 0x52, ++ 0x49, 0x4e, 0x47, 0x20, 0x3d, 0x20, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x42, ++ 0x4f, 0x4f, 0x4c, 0x20, 0x3d, 0x20, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x49, ++ 0x4e, 0x54, 0x31, 0x36, 0x20, 0x3d, 0x20, 0x37, 0x2c, 0x0a, 0x20, 0x20, ++ 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x58, 0x36, 0x34, 0x20, 0x3d, 0x20, ++ 0x38, 0x2c, 0x0a, 0x20, 0x20, 0x49, 0x4e, 0x54, 0x38, 0x20, 0x3d, 0x20, ++ 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, 0x34, ++ 0x20, 0x3d, 0x20, 0x31, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x4f, 0x4d, ++ 0x50, 0x4c, 0x45, 0x58, 0x31, 0x32, 0x38, 0x20, 0x3d, 0x20, 0x31, 0x31, ++ 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x20, 0x3d, ++ 0x20, 0x31, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x78, ++ 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x3a, 0x20, ++ 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, ++ 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x79, 0x70, ++ 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x65, 0x78, 0x70, 0x65, 0x72, ++ 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2c, 0x20, 0x74, 0x68, 0x61, ++ 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, ++ 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, ++ 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x20, 0x44, 0x6f, 0x20, 0x6e, 0x6f, 0x74, ++ 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x63, ++ 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, ++ 0x73, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x73, 0x6f, ++ 0x75, 0x72, 0x63, 0x65, 0x20, 0x26, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, ++ 0x6e, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2f, ++ 0x2f, 0x20, 0x6e, 0x6f, 0x77, 0x2e, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x53, ++ 0x4f, 0x55, 0x52, 0x43, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x33, 0x2c, 0x0a, ++ 0x20, 0x20, 0x56, 0x41, 0x52, 0x49, 0x41, 0x4e, 0x54, 0x20, 0x3d, 0x20, ++ 0x31, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, ++ 0x20, 0x3d, 0x20, 0x31, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x49, 0x4e, ++ 0x54, 0x31, 0x36, 0x20, 0x3d, 0x20, 0x31, 0x36, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x2f, 0x2f, 0x20, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x71, 0x75, ++ 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, ++ 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, ++ 0x72, 0x20, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, ++ 0x69, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6e, 0x65, 0x77, ++ 0x20, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, ++ 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x71, ++ 0x75, 0x65, 0x73, 0x2e, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x43, ++ 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, ++ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x63, 0x75, ++ 0x73, 0x74, 0x6f, 0x6d, 0x3a, 0x5b, 0x75, 0x62, 0x79, 0x74, 0x65, 0x5d, ++ 0x20, 0x28, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x6c, 0x69, 0x67, ++ 0x6e, 0x3a, 0x20, 0x31, 0x36, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, ++ 0x2f, 0x20, 0x52, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, ++ 0x20, 0x61, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, ++ 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, ++ 0x20, 0x74, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x27, 0x73, ++ 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x2e, ++ 0x0a, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x20, 0x51, 0x75, 0x61, 0x6e, 0x74, ++ 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, ++ 0x6c, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x43, 0x75, 0x73, 0x74, 0x6f, ++ 0x6d, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, ++ 0x6e, 0x2c, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, ++ 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, ++ 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x61, ++ 0x20, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x74, ++ 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x20, 0x74, ++ 0x6f, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2e, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, ++ 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, ++ 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, ++ 0x73, 0x65, 0x20, 0x66, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x61, 0x72, 0x61, ++ 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x74, ++ 0x68, 0x65, 0x20, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, ++ 0x63, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x20, 0x71, 0x75, 0x61, ++ 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x61, ++ 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x47, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x71, ++ 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, ++ 0x75, 0x65, 0x20, 0x71, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, ++ 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, ++ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, ++ 0x66, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x3a, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x66, 0x20, 0x3d, 0x20, ++ 0x73, 0x63, 0x61, 0x6c, 0x65, 0x20, 0x2a, 0x20, 0x28, 0x71, 0x20, 0x2d, ++ 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x29, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6f, 0x74, ++ 0x68, 0x65, 0x72, 0x20, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, ++ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2c, 0x20, ++ 0x74, 0x68, 0x65, 0x20, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, ++ 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, ++ 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, ++ 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x6d, 0x69, 0x6e, 0x3a, 0x5b, 0x66, 0x6c, ++ 0x6f, 0x61, 0x74, 0x5d, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, ++ 0x72, 0x20, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x20, ++ 0x62, 0x61, 0x63, 0x6b, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x74, 0x65, ++ 0x6e, 0x73, 0x6f, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x0a, 0x20, 0x20, ++ 0x6d, 0x61, 0x78, 0x3a, 0x5b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5d, 0x3b, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x69, 0x6d, 0x70, ++ 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x20, ++ 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x66, ++ 0x6c, 0x6f, 0x77, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x63, 0x61, 0x6c, 0x65, ++ 0x3a, 0x5b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5d, 0x3b, 0x20, 0x20, 0x2f, ++ 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x71, 0x75, 0x61, 0x6e, ++ 0x74, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, ++ 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x27, 0x73, 0x20, 0x76, 0x61, 0x6c, 0x75, ++ 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x70, ++ 0x6f, 0x69, 0x6e, 0x74, 0x3a, 0x5b, 0x6c, 0x6f, 0x6e, 0x67, 0x5d, 0x3b, ++ 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, ++ 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6e, 0x6f, ++ 0x6e, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x74, 0x68, 0x65, ++ 0x72, 0x20, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, ++ 0x73, 0x20, 0x28, 0x69, 0x2e, 0x65, 0x2e, 0x20, 0x6d, 0x69, 0x6e, 0x2c, ++ 0x20, 0x6d, 0x61, 0x78, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, ++ 0x63, 0x61, 0x6c, 0x65, 0x2c, 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x70, ++ 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, ++ 0x61, 0x62, 0x6f, 0x76, 0x65, 0x29, 0x20, 0x61, 0x72, 0x65, 0x20, 0x69, ++ 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, ++ 0x68, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6f, 0x66, 0x20, ++ 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x51, 0x75, 0x61, ++ 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, ++ 0x61, 0x69, 0x6c, 0x73, 0x20, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x20, 0x73, ++ 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, ++ 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, ++ 0x3a, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, ++ 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x3b, 0x0a, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, ++ 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, ++ 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x54, ++ 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x27, 0x73, 0x20, 0x73, 0x68, 0x61, 0x70, ++ 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, ++ 0x63, 0x61, 0x6c, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x70, 0x6f, 0x69, 0x6e, ++ 0x74, 0x73, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, ++ 0x64, 0x20, 0x74, 0x6f, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, ++ 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x61, 0x20, 0x74, 0x65, 0x6e, ++ 0x73, 0x6f, 0x72, 0x20, 0x74, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, ++ 0x64, 0x69, 0x6d, 0x73, 0x3d, 0x5b, 0x34, 0x2c, 0x20, 0x33, 0x2c, 0x20, ++ 0x32, 0x2c, 0x20, 0x31, 0x5d, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, ++ 0x69, 0x74, 0x68, 0x20, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, ++ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x73, 0x63, 0x61, 0x6c, ++ 0x65, 0x3d, 0x5b, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x32, 0x2e, 0x30, 0x2c, ++ 0x20, 0x33, 0x2e, 0x30, 0x5d, 0x2c, 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x5f, ++ 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x3d, 0x5b, 0x31, 0x2c, 0x20, 0x32, 0x2c, ++ 0x20, 0x33, 0x5d, 0x2c, 0x20, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, ++ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, ++ 0x69, 0x6f, 0x6e, 0x3d, 0x31, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, ++ 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x71, 0x75, 0x61, 0x6e, 0x74, ++ 0x69, 0x7a, 0x65, 0x64, 0x20, 0x61, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x20, ++ 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x64, ++ 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, ++ 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x74, 0x5b, ++ 0x3a, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x3a, 0x2c, 0x20, 0x3a, 0x5d, 0x20, ++ 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x73, 0x63, ++ 0x61, 0x6c, 0x65, 0x5b, 0x30, 0x5d, 0x3d, 0x31, 0x2e, 0x30, 0x2c, 0x20, ++ 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5b, 0x30, ++ 0x5d, 0x3d, 0x31, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x74, ++ 0x5b, 0x3a, 0x2c, 0x20, 0x31, 0x2c, 0x20, 0x3a, 0x2c, 0x20, 0x3a, 0x5d, ++ 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x73, ++ 0x63, 0x61, 0x6c, 0x65, 0x5b, 0x31, 0x5d, 0x3d, 0x32, 0x2e, 0x30, 0x2c, ++ 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5b, ++ 0x30, 0x5d, 0x3d, 0x32, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, ++ 0x74, 0x5b, 0x3a, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x3a, 0x2c, 0x20, 0x3a, ++ 0x5d, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, ++ 0x73, 0x63, 0x61, 0x6c, 0x65, 0x5b, 0x32, 0x5d, 0x3d, 0x33, 0x2e, 0x30, ++ 0x2c, 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, ++ 0x5b, 0x30, 0x5d, 0x3d, 0x33, 0x0a, 0x20, 0x20, 0x71, 0x75, 0x61, 0x6e, ++ 0x74, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, ++ 0x69, 0x6f, 0x6e, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x2f, 0x2f, 0x20, 0x53, 0x70, 0x61, 0x72, 0x73, 0x65, 0x20, 0x74, 0x65, ++ 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x57, 0x65, ++ 0x20, 0x75, 0x73, 0x65, 0x20, 0x61, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, ++ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, ++ 0x68, 0x65, 0x20, 0x54, 0x41, 0x43, 0x4f, 0x20, 0x66, 0x6f, 0x72, 0x6d, ++ 0x61, 0x74, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x66, 0x65, 0x72, ++ 0x65, 0x6e, 0x63, 0x65, 0x3a, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, ++ 0x2f, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x2d, 0x63, 0x6f, 0x6d, 0x70, ++ 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6b, 0x6a, 0x6f, ++ 0x6c, 0x73, 0x74, 0x61, 0x64, 0x2d, 0x6f, 0x6f, 0x70, 0x73, 0x6c, 0x61, ++ 0x31, 0x37, 0x2d, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x2d, 0x63, 0x6f, ++ 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x70, 0x64, 0x66, 0x0a, 0x2f, ++ 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x6f, 0x20, 0x65, 0x6e, 0x63, 0x6f, ++ 0x64, 0x65, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6e, 0x63, 0x65, 0x70, 0x74, ++ 0x75, 0x61, 0x6c, 0x20, 0x6e, 0x2d, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, ++ 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x20, ++ 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, ++ 0x64, 0x69, 0x6d, 0x73, 0x20, 0x28, 0x64, 0x30, 0x2c, 0x20, 0x2e, 0x2e, ++ 0x2e, 0x2c, 0x20, 0x64, 0x6e, 0x2d, 0x31, 0x29, 0x2c, 0x0a, 0x2f, 0x2f, ++ 0x20, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x6c, 0x79, ++ 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x6b, 0x2d, 0x64, 0x69, ++ 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6c, ++ 0x6f, 0x63, 0x6b, 0x20, 0x28, 0x30, 0x20, 0x3c, 0x3d, 0x20, 0x6b, 0x20, ++ 0x3c, 0x3d, 0x20, 0x6e, 0x29, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x64, ++ 0x69, 0x6d, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x64, 0x6e, 0x2c, 0x20, ++ 0x2e, 0x2e, 0x2e, 0x2c, 0x20, 0x64, 0x6e, 0x2b, 0x6b, 0x2d, 0x31, 0x29, ++ 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, ++ 0x20, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x70, ++ 0x65, 0x63, 0x69, 0x66, 0x79, 0x3a, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, ++ 0x31, 0x2e, 0x20, 0x49, 0x6e, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x6f, ++ 0x72, 0x64, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x72, 0x61, 0x76, ++ 0x65, 0x72, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x64, ++ 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x20, 0x46, ++ 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, ++ 0x74, 0x6f, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x20, 0x32, ++ 0x2d, 0x44, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, ++ 0x61, 0x74, 0x72, 0x69, 0x78, 0x20, 0x69, 0x6e, 0x20, 0x72, 0x6f, 0x77, ++ 0x20, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, ++ 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x76, 0x65, 0x72, ++ 0x73, 0x61, 0x6c, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x77, 0x6f, ++ 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x28, 0x64, 0x30, 0x2c, 0x20, ++ 0x64, 0x31, 0x29, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, ++ 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x61, 0x73, 0x20, 0x74, 0x6f, 0x20, ++ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x74, 0x20, 0x69, 0x6e, 0x20, ++ 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x20, 0x6d, 0x61, 0x6a, 0x6f, 0x72, ++ 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x74, 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x20, 0x6f, 0x72, ++ 0x64, 0x65, 0x72, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, ++ 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x64, 0x31, ++ 0x2c, 0x20, 0x64, 0x30, 0x29, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, ++ 0x65, 0x20, 0x32, 0x2d, 0x44, 0x20, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, ++ 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x20, 0x32, 0x2d, 0x44, 0x20, 0x69, ++ 0x6e, 0x6e, 0x65, 0x72, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2c, 0x20, ++ 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x61, ++ 0x6c, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x20, ++ 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, ++ 0x20, 0x28, 0x64, 0x30, 0x2c, 0x20, 0x64, 0x31, 0x2c, 0x20, 0x64, 0x32, ++ 0x2c, 0x20, 0x64, 0x33, 0x29, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, ++ 0x32, 0x2e, 0x20, 0x48, 0x6f, 0x77, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, ++ 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, ++ 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x28, 0x64, 0x6e, 0x2c, 0x20, ++ 0x2e, 0x2e, 0x2e, 0x2c, 0x20, 0x64, 0x6e, 0x2b, 0x6b, 0x2d, 0x31, 0x29, ++ 0x20, 0x6d, 0x61, 0x70, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, ++ 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x0a, 0x2f, 0x2f, ++ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, ++ 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, ++ 0x6e, 0x20, 0x28, 0x64, 0x30, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x2c, 0x20, ++ 0x64, 0x6e, 0x2d, 0x31, 0x29, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, ++ 0x33, 0x2e, 0x20, 0x49, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, ++ 0x61, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x20, 0x6f, 0x72, 0x64, 0x65, ++ 0x72, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x61, 0x62, ++ 0x6f, 0x76, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x72, ++ 0x6d, 0x61, 0x74, 0x20, 0x28, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x76, ++ 0x73, 0x2e, 0x20, 0x73, 0x70, 0x61, 0x72, 0x73, 0x65, 0x29, 0x20, 0x61, ++ 0x6e, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, ++ 0x6e, 0x64, 0x65, 0x78, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, ++ 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x64, ++ 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x46, 0x6f, ++ 0x72, 0x20, 0x61, 0x20, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x64, 0x69, ++ 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x69, ++ 0x73, 0x20, 0x69, 0x73, 0x20, 0x6a, 0x75, 0x73, 0x74, 0x0a, 0x2f, 0x2f, ++ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, ++ 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x64, ++ 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x46, 0x6f, ++ 0x72, 0x20, 0x61, 0x20, 0x73, 0x70, 0x61, 0x72, 0x73, 0x65, 0x20, 0x64, ++ 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x69, 0x74, ++ 0x27, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, ++ 0x61, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, ++ 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, ++ 0x64, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x64, 0x65, 0x66, 0x69, ++ 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, ++ 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x53, 0x70, ++ 0x61, 0x72, 0x73, 0x65, 0x20, 0x52, 0x6f, 0x77, 0x20, 0x28, 0x43, 0x53, ++ 0x52, 0x29, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x0a, 0x2f, ++ 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, ++ 0x3a, 0x2f, 0x2f, 0x73, 0x63, 0x69, 0x70, 0x79, 0x2d, 0x6c, 0x65, 0x63, ++ 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x61, 0x64, ++ 0x76, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x2f, 0x73, 0x63, 0x69, 0x70, 0x79, ++ 0x5f, 0x73, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2f, 0x63, 0x73, 0x72, 0x5f, ++ 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x29, ++ 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x74, 0x6f, ++ 0x72, 0x61, 0x67, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x66, 0x6f, ++ 0x72, 0x20, 0x61, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, ++ 0x6e, 0x2e, 0x20, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, ++ 0x20, 0x77, 0x65, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x3a, ++ 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x31, 0x2e, 0x20, 0x44, 0x45, 0x4e, ++ 0x53, 0x45, 0x3a, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x63, 0x6f, 0x6f, ++ 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, ++ 0x68, 0x69, 0x73, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, ++ 0x6e, 0x20, 0x69, 0x73, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x20, ++ 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x2e, 0x0a, ++ 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x32, 0x2e, 0x20, 0x53, 0x50, 0x41, 0x52, ++ 0x53, 0x45, 0x5f, 0x43, 0x53, 0x52, 0x3a, 0x20, 0x6f, 0x6e, 0x6c, 0x79, ++ 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, ++ 0x61, 0x74, 0x65, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6e, 0x6f, ++ 0x6e, 0x2d, 0x7a, 0x65, 0x72, 0x6f, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, ++ 0x6e, 0x74, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x74, 0x6f, 0x72, ++ 0x65, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x20, ++ 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, ++ 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x71, 0x75, ++ 0x65, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, ++ 0x65, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x43, 0x53, 0x52, 0x20, 0x75, ++ 0x73, 0x65, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x4d, 0x6f, 0x72, 0x65, ++ 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, ++ 0x61, 0x20, 0x73, 0x70, 0x61, 0x72, 0x73, 0x65, 0x20, 0x64, 0x69, 0x6d, ++ 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, ++ 0x61, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, ++ 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, ++ 0x74, 0x65, 0x63, 0x68, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x0a, 0x2f, 0x2f, ++ 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x61, 0x64, ++ 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, ++ 0x69, 0x73, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, ++ 0x75, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x20, ++ 0x44, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, ++ 0x65, 0x20, 0x3a, 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, 0x7b, 0x0a, 0x20, ++ 0x20, 0x44, 0x45, 0x4e, 0x53, 0x45, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x0a, ++ 0x20, 0x20, 0x53, 0x50, 0x41, 0x52, 0x53, 0x45, 0x5f, 0x43, 0x53, 0x52, ++ 0x20, 0x3d, 0x20, 0x31, 0x2c, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x65, 0x63, 0x74, ++ 0x6f, 0x72, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, ++ 0x73, 0x3a, 0x5b, 0x69, 0x6e, 0x74, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x55, 0x69, 0x6e, 0x74, 0x31, 0x36, ++ 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x76, ++ 0x61, 0x6c, 0x75, 0x65, 0x73, 0x3a, 0x5b, 0x75, 0x73, 0x68, 0x6f, 0x72, ++ 0x74, 0x5d, 0x20, 0x28, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x6c, ++ 0x69, 0x67, 0x6e, 0x3a, 0x20, 0x34, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x55, 0x69, 0x6e, 0x74, 0x38, 0x56, ++ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x61, ++ 0x6c, 0x75, 0x65, 0x73, 0x3a, 0x5b, 0x75, 0x62, 0x79, 0x74, 0x65, 0x5d, ++ 0x20, 0x28, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x6c, 0x69, 0x67, ++ 0x6e, 0x3a, 0x20, 0x34, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, ++ 0x20, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x2d, 0x74, 0x79, ++ 0x70, 0x65, 0x64, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x74, ++ 0x6f, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, ++ 0x74, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x73, 0x70, 0x61, ++ 0x72, 0x73, 0x65, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, ++ 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x77, 0x69, ++ 0x64, 0x65, 0x73, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x69, 0x73, ++ 0x20, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, ++ 0x61, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, ++ 0x20, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x74, 0x65, 0x6e, ++ 0x73, 0x6f, 0x72, 0x27, 0x73, 0x20, 0x73, 0x68, 0x61, 0x70, 0x65, 0x20, ++ 0x69, 0x73, 0x20, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x0a, 0x2f, ++ 0x2f, 0x20, 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x20, 0x57, 0x65, ++ 0x20, 0x64, 0x6f, 0x6e, 0x27, 0x74, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, ++ 0x74, 0x68, 0x65, 0x20, 0x70, 0x65, 0x72, 0x2d, 0x64, 0x69, 0x6d, 0x65, ++ 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x64, 0x65, ++ 0x78, 0x20, 0x74, 0x6f, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, ++ 0x77, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, ++ 0x2e, 0x0a, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x70, 0x61, 0x72, ++ 0x73, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x56, 0x65, 0x63, 0x74, 0x6f, ++ 0x72, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, ++ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x69, 0x6e, ++ 0x74, 0x31, 0x36, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2c, 0x0a, 0x20, ++ 0x20, 0x55, 0x69, 0x6e, 0x74, 0x38, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x44, 0x69, ++ 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, ++ 0x61, 0x74, 0x61, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, ++ 0x68, 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x61, 0x20, 0x64, 0x69, 0x6d, ++ 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, ++ 0x6e, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x70, 0x61, 0x72, 0x73, ++ 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3a, ++ 0x44, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, ++ 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x64, 0x65, ++ 0x78, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x75, ++ 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x64, 0x69, ++ 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2f, ++ 0x2f, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x49, 0x66, 0x20, 0x66, 0x6f, 0x72, ++ 0x6d, 0x61, 0x74, 0x20, 0x69, 0x73, 0x20, 0x44, 0x69, 0x6d, 0x65, 0x6e, ++ 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x45, 0x4e, ++ 0x53, 0x45, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x77, 0x65, 0x20, 0x75, ++ 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x6e, 0x73, 0x65, ++ 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, ++ 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, ++ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, ++ 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x64, ++ 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x45, 0x61, ++ 0x63, 0x68, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x69, 0x6e, 0x20, ++ 0x74, 0x68, 0x61, 0x74, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, ++ 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, ++ 0x20, 0x20, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x69, 0x6d, ++ 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x2e, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x49, 0x66, 0x20, 0x66, 0x6f, ++ 0x72, 0x6d, 0x61, 0x74, 0x20, 0x69, 0x73, 0x20, 0x44, 0x69, 0x6d, 0x65, ++ 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x53, 0x50, ++ 0x41, 0x52, 0x53, 0x45, 0x5f, 0x43, 0x53, 0x52, 0x20, 0x74, 0x68, 0x65, ++ 0x6e, 0x20, 0x77, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x61, 0x72, 0x72, ++ 0x61, 0x79, 0x5f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, ++ 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, ++ 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, ++ 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, ++ 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, ++ 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x5f, 0x73, ++ 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x72, 0x65, 0x70, 0x72, ++ 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x68, 0x6f, 0x77, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x73, ++ 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, ++ 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, ++ 0x2c, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x73, 0x65, 0x67, 0x6d, 0x65, ++ 0x6e, 0x74, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, ++ 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x65, 0x6c, ++ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, ++ 0x20, 0x20, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, ++ 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, ++ 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x5f, ++ 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x20, 0x72, 0x65, 0x70, 0x72, ++ 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, ++ 0x6e, 0x64, 0x65, 0x78, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x6f, 0x6e, ++ 0x2d, 0x7a, 0x65, 0x72, 0x6f, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, ++ 0x74, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x74, 0x68, ++ 0x69, 0x73, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, ++ 0x20, 0x28, 0x61, 0x73, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x69, ++ 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x53, 0x52, 0x20, 0x6d, 0x61, ++ 0x74, 0x72, 0x69, 0x78, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, ++ 0x20, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2c, 0x20, 0x77, 0x68, ++ 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x72, 0x73, ++ 0x74, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x69, 0x73, 0x20, 0x72, ++ 0x6f, 0x77, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x20, ++ 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x63, 0x6f, ++ 0x6e, 0x64, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x69, 0x73, 0x0a, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, ++ 0x75, 0x6d, 0x6e, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x29, ++ 0x2e, 0x0a, 0x20, 0x20, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x69, ++ 0x7a, 0x65, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x61, 0x72, ++ 0x72, 0x61, 0x79, 0x5f, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, ++ 0x3a, 0x53, 0x70, 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, ++ 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x3b, 0x0a, 0x20, 0x20, 0x61, 0x72, ++ 0x72, 0x61, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x3a, ++ 0x53, 0x70, 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x56, ++ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, ++ 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, ++ 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x61, 0x20, ++ 0x73, 0x70, 0x61, 0x72, 0x73, 0x65, 0x20, 0x54, 0x66, 0x4c, 0x69, 0x74, ++ 0x65, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x0a, 0x74, 0x61, ++ 0x62, 0x6c, 0x65, 0x20, 0x53, 0x70, 0x61, 0x72, 0x73, 0x69, 0x74, 0x79, ++ 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x7b, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x74, 0x72, ++ 0x61, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x20, 0x6f, 0x72, 0x64, 0x65, ++ 0x72, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x6d, ++ 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, ++ 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x60, ++ 0x73, 0x68, 0x61, 0x70, 0x65, 0x60, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, ++ 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, ++ 0x20, 0x63, 0x6f, 0x6e, 0x63, 0x65, 0x70, 0x74, 0x75, 0x61, 0x6c, 0x20, ++ 0x64, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, ++ 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x6e, 0x2d, 0x64, 0x69, ++ 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x74, 0x65, ++ 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x64, ++ 0x69, 0x6d, 0x73, 0x20, 0x28, 0x64, 0x30, 0x2c, 0x20, 0x64, 0x31, 0x2c, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x2e, 0x2e, 0x2e, 0x2c, 0x20, 0x64, ++ 0x6e, 0x2d, 0x31, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, ++ 0x20, 0x2d, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x6c, ++ 0x6f, 0x63, 0x6b, 0x20, 0x73, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2c, 0x20, ++ 0x74, 0x68, 0x65, 0x20, 0x74, 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x61, ++ 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x6a, ++ 0x75, 0x73, 0x74, 0x20, 0x61, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x75, 0x74, ++ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x28, 0x64, 0x30, ++ 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2e, ++ 0x2e, 0x2e, 0x2c, 0x20, 0x64, 0x6e, 0x2d, 0x31, 0x29, 0x2e, 0x20, 0x46, ++ 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, ++ 0x61, 0x20, 0x32, 0x2d, 0x44, 0x20, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, ++ 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x72, ++ 0x6f, 0x77, 0x2d, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x6f, 0x72, 0x64, ++ 0x65, 0x72, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x0a, 0x20, 0x20, 0x2f, ++ 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, ++ 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x5f, 0x6f, 0x72, 0x64, ++ 0x65, 0x72, 0x20, 0x3d, 0x20, 0x28, 0x64, 0x30, 0x2c, 0x20, 0x64, 0x31, ++ 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2d, 0x20, ++ 0x69, 0x66, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x73, 0x70, 0x61, ++ 0x72, 0x73, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x6b, ++ 0x2d, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x61, 0x6c, ++ 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x28, 0x30, 0x20, 0x3c, 0x3d, ++ 0x20, 0x6b, 0x20, 0x3c, 0x3d, 0x20, 0x6e, 0x29, 0x2c, 0x20, 0x74, 0x68, ++ 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, ++ 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x5f, 0x6f, 0x72, 0x64, ++ 0x65, 0x72, 0x20, 0x68, 0x61, 0x73, 0x20, 0x6e, 0x20, 0x2b, 0x20, 0x6b, ++ 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x20, 0x54, ++ 0x68, 0x65, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x6e, 0x20, 0x65, ++ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, ++ 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x2f, 0x2f, ++ 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x75, 0x74, 0x61, ++ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x28, 0x64, 0x30, 0x2c, ++ 0x20, 0x2e, 0x2e, 0x2e, 0x2c, 0x20, 0x64, 0x6e, 0x2d, 0x31, 0x29, 0x2e, ++ 0x20, 0x54, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x73, 0x6b, 0x20, 0x6b, 0x20, ++ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x72, 0x65, ++ 0x20, 0x61, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, ++ 0x6f, 0x66, 0x20, 0x28, 0x64, 0x6e, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x2c, ++ 0x20, 0x64, 0x6e, 0x2b, 0x6b, 0x2d, 0x31, 0x29, 0x2c, 0x20, 0x64, 0x65, ++ 0x66, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x74, ++ 0x6f, 0x20, 0x74, 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x65, 0x20, 0x61, ++ 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, ++ 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x78, 0x61, 0x6d, ++ 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x61, 0x20, 0x32, 0x2d, 0x44, 0x20, 0x6d, ++ 0x61, 0x74, 0x72, 0x69, 0x78, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x32, ++ 0x2d, 0x44, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2c, 0x20, 0x62, ++ 0x6f, 0x74, 0x68, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x69, ++ 0x6e, 0x20, 0x72, 0x6f, 0x77, 0x2d, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, ++ 0x6f, 0x72, 0x64, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, ++ 0x20, 0x20, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x68, 0x61, 0x76, ++ 0x65, 0x20, 0x74, 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x5f, ++ 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x28, 0x64, 0x30, 0x2c, ++ 0x20, 0x64, 0x31, 0x2c, 0x20, 0x64, 0x32, 0x2c, 0x20, 0x64, 0x33, 0x29, ++ 0x2e, 0x0a, 0x20, 0x20, 0x74, 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x61, ++ 0x6c, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x5b, 0x69, 0x6e, 0x74, ++ 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, ++ 0x61, 0x6e, 0x20, 0x6e, 0x2d, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, ++ 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x20, ++ 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x6b, 0x2d, 0x64, 0x69, 0x6d, ++ 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6c, 0x6f, ++ 0x63, 0x6b, 0x20, 0x28, 0x30, 0x20, 0x3c, 0x3d, 0x20, 0x6b, 0x20, 0x3c, ++ 0x3d, 0x20, 0x6e, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, ++ 0x74, 0x6f, 0x72, 0x65, 0x73, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x61, 0x20, ++ 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, ++ 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x28, 0x64, 0x6e, 0x2c, 0x20, ++ 0x2e, 0x2e, 0x2e, 0x2c, 0x20, 0x64, 0x6e, 0x2b, 0x6b, 0x2d, 0x31, 0x29, ++ 0x20, 0x6d, 0x61, 0x70, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, ++ 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x20, 0x64, 0x69, ++ 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x28, ++ 0x64, 0x30, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x2c, 0x20, 0x64, 0x6e, 0x29, ++ 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x74, 0x27, 0x73, 0x20, ++ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, ++ 0x65, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x28, ++ 0x64, 0x6e, 0x2c, 0x20, 0x2e, 0x2e, 0x2e, 0x2c, 0x20, 0x64, 0x6e, 0x2b, ++ 0x6b, 0x2d, 0x31, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, ++ 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2d, ++ 0x73, 0x70, 0x61, 0x72, 0x73, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, ++ 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x4e, 0x55, ++ 0x4c, 0x4c, 0x2e, 0x0a, 0x20, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, ++ 0x6d, 0x61, 0x70, 0x3a, 0x5b, 0x69, 0x6e, 0x74, 0x5d, 0x3b, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, ++ 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x20, 0x6f, 0x72, 0x64, ++ 0x65, 0x72, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x61, ++ 0x62, 0x6f, 0x76, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x65, ++ 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x65, ++ 0x64, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, ++ 0x61, 0x63, 0x68, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, ++ 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x20, ++ 0x74, 0x68, 0x65, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, 0x7a, 0x65, 0x72, 0x6f, ++ 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, ++ 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, ++ 0x64, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, ++ 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, ++ 0x69, 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, ++ 0x69, 0x6d, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, ++ 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x3d, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x73, 0x69, 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x74, 0x72, 0x61, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x5f, 0x6f, 0x72, ++ 0x64, 0x65, 0x72, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x3d, 0x20, 0x6e, 0x20, 0x2b, 0x20, 0x6b, 0x2e, 0x0a, ++ 0x20, 0x20, 0x64, 0x69, 0x6d, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, ++ 0x74, 0x61, 0x3a, 0x5b, 0x44, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, ++ 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5d, 0x3b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x54, 0x65, 0x6e, ++ 0x73, 0x6f, 0x72, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, ++ 0x68, 0x65, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x20, 0x73, 0x68, ++ 0x61, 0x70, 0x65, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6d, 0x65, 0x61, ++ 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x61, 0x63, 0x68, ++ 0x20, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x70, ++ 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x69, ++ 0x66, 0x69, 0x63, 0x20, 0x62, 0x75, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, ++ 0x20, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x20, 0x6f, 0x70, 0x73, ++ 0x20, 0x75, 0x73, 0x65, 0x3a, 0x20, 0x5b, 0x62, 0x61, 0x74, 0x63, 0x68, ++ 0x20, 0x73, 0x69, 0x7a, 0x65, 0x2c, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, ++ 0x74, 0x2c, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x20, 0x6e, 0x75, ++ 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x68, 0x61, 0x6e, ++ 0x6e, 0x65, 0x6c, 0x73, 0x5d, 0x20, 0x28, 0x54, 0x68, 0x61, 0x74, 0x27, ++ 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x65, 0x6e, 0x73, 0x6f, ++ 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x27, 0x73, 0x20, 0x4e, 0x48, 0x57, 0x43, ++ 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x68, 0x61, 0x70, 0x65, 0x3a, 0x5b, ++ 0x69, 0x6e, 0x74, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, ++ 0x3a, 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x3b, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x20, 0x69, 0x6e, 0x64, ++ 0x65, 0x78, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x72, 0x65, 0x66, 0x65, ++ 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x75, ++ 0x66, 0x66, 0x65, 0x72, 0x73, 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6f, 0x74, 0x20, ++ 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, ++ 0x2e, 0x20, 0x4f, 0x72, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, ++ 0x66, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, ++ 0x6f, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, ++ 0x72, 0x20, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, ++ 0x20, 0x28, 0x69, 0x2e, 0x65, 0x2e, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, ++ 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x20, 0x72, 0x65, 0x73, 0x75, ++ 0x6c, 0x74, 0x73, 0x29, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, ++ 0x30, 0x20, 0x28, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x72, 0x65, 0x66, ++ 0x65, 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, ++ 0x77, 0x61, 0x79, 0x73, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x65, 0x6e, ++ 0x74, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x20, 0x62, 0x75, 0x66, 0x66, ++ 0x65, 0x72, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x5f, ++ 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x69, 0x74, 0x73, 0x65, 0x6c, ++ 0x66, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x6f, 0x70, 0x61, 0x71, ++ 0x75, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, ++ 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, ++ 0x73, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, ++ 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, ++ 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, 0x76, 0x69, 0x63, ++ 0x65, 0x20, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x2d, ++ 0x65, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2e, 0x20, 0x49, 0x6e, 0x20, 0x61, ++ 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x6c, 0x6c, ++ 0x20, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x20, 0x6f, 0x70, 0x65, ++ 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, ++ 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, ++ 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x72, 0x64, ++ 0x65, 0x72, 0x65, 0x64, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x74, 0x68, ++ 0x61, 0x74, 0x20, 0x69, 0x66, 0x20, 0x60, 0x73, 0x68, 0x61, 0x70, 0x65, ++ 0x60, 0x20, 0x69, 0x73, 0x20, 0x5b, 0x34, 0x2c, 0x20, 0x33, 0x2c, 0x20, ++ 0x32, 0x5d, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x69, 0x6e, 0x64, ++ 0x65, 0x78, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x5b, 0x69, 0x2c, 0x20, ++ 0x6a, 0x2c, 0x20, 0x6b, 0x5d, 0x20, 0x6d, 0x61, 0x70, 0x73, 0x20, 0x74, ++ 0x6f, 0x20, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65, ++ 0x72, 0x5b, 0x69, 0x2a, 0x33, 0x2a, 0x32, 0x20, 0x2b, 0x20, 0x6a, 0x2a, ++ 0x32, 0x20, 0x2b, 0x20, 0x6b, 0x5d, 0x2e, 0x0a, 0x20, 0x20, 0x62, 0x75, ++ 0x66, 0x66, 0x65, 0x72, 0x3a, 0x75, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, ++ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, ++ 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x64, 0x65, ++ 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, ++ 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x62, 0x61, ++ 0x63, 0x6b, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x74, 0x65, 0x6e, 0x73, ++ 0x6f, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x0a, 0x20, 0x20, 0x71, 0x75, ++ 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x51, ++ 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, ++ 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x3b, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2e, ++ 0x0a, 0x0a, 0x20, 0x20, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x72, 0x69, 0x61, ++ 0x62, 0x6c, 0x65, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x3d, 0x20, 0x66, ++ 0x61, 0x6c, 0x73, 0x65, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, ++ 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x74, ++ 0x6f, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x61, 0x20, 0x73, ++ 0x70, 0x61, 0x72, 0x73, 0x65, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, ++ 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, ++ 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x2f, ++ 0x2f, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x66, 0x6c, 0x6f, 0x77, ++ 0x2f, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, ++ 0x74, 0x61, 0x2f, 0x73, 0x70, 0x61, 0x72, 0x73, 0x65, 0x5f, 0x74, 0x65, ++ 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, ++ 0x20, 0x73, 0x70, 0x61, 0x72, 0x73, 0x69, 0x74, 0x79, 0x3a, 0x53, 0x70, ++ 0x61, 0x72, 0x73, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, ++ 0x74, 0x65, 0x72, 0x73, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x2f, ++ 0x2f, 0x20, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x60, 0x73, ++ 0x68, 0x61, 0x70, 0x65, 0x60, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x75, ++ 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, ++ 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x20, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, ++ 0x77, 0x6e, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x72, ++ 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x77, ++ 0x69, 0x74, 0x68, 0x20, 0x2d, 0x31, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x68, ++ 0x61, 0x70, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, ++ 0x65, 0x3a, 0x5b, 0x69, 0x6e, 0x74, 0x5d, 0x3b, 0x20, 0x2f, 0x2f, 0x20, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2e, 0x0a, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, ++ 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x6b, 0x20, 0x6f, ++ 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, ++ 0x20, 0x6f, 0x66, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x20, 0x64, ++ 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x73, ++ 0x20, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2e, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, ++ 0x20, 0x22, 0x73, 0x68, 0x61, 0x70, 0x65, 0x22, 0x20, 0x6d, 0x75, 0x73, ++ 0x74, 0x20, 0x62, 0x65, 0x20, 0x5b, 0x5d, 0x2e, 0x0a, 0x20, 0x20, 0x68, ++ 0x61, 0x73, 0x5f, 0x72, 0x61, 0x6e, 0x6b, 0x3a, 0x20, 0x62, 0x6f, 0x6f, ++ 0x6c, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x3b, 0x0a, 0x7d, ++ 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, ++ 0x6f, 0x66, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x20, 0x6f, ++ 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2e, 0x20, 0x42, 0x75, ++ 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, ++ 0x6f, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x6c, 0x69, 0x67, ++ 0x68, 0x74, 0x6c, 0x79, 0x20, 0x66, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, ++ 0x74, 0x68, 0x61, 0x6e, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x0a, ++ 0x2f, 0x2f, 0x20, 0x6f, 0x6e, 0x65, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, ++ 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x79, 0x20, 0x6d, 0x75, 0x63, 0x68, ++ 0x2e, 0x20, 0x4d, 0x6f, 0x72, 0x65, 0x6f, 0x76, 0x65, 0x72, 0x2c, 0x20, ++ 0x77, 0x68, 0x69, 0x6c, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, ++ 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x61, ++ 0x63, 0x63, 0x65, 0x70, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x6f, 0x70, 0x61, ++ 0x71, 0x75, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, ++ 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, ++ 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, ++ 0x73, 0x2c, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x73, 0x20, ++ 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x20, 0x70, 0x72, 0x65, 0x64, 0x65, ++ 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, ++ 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x63, 0x63, 0x65, 0x70, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4e, 0x54, 0x2e, 0x49, ++ 0x66, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x0a, 0x65, 0x6e, 0x75, 0x6d, ++ 0x20, 0x42, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x4f, 0x70, 0x65, 0x72, ++ 0x61, 0x74, 0x6f, 0x72, 0x20, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, ++ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x41, 0x44, 0x44, 0x20, 0x3d, 0x20, 0x30, ++ 0x2c, 0x0a, 0x20, 0x20, 0x41, 0x56, 0x45, 0x52, 0x41, 0x47, 0x45, 0x5f, ++ 0x50, 0x4f, 0x4f, 0x4c, 0x5f, 0x32, 0x44, 0x20, 0x3d, 0x20, 0x31, 0x2c, ++ 0x0a, 0x20, 0x20, 0x43, 0x4f, 0x4e, 0x43, 0x41, 0x54, 0x45, 0x4e, 0x41, ++ 0x54, 0x49, 0x4f, 0x4e, 0x20, 0x3d, 0x20, 0x32, 0x2c, 0x0a, 0x20, 0x20, ++ 0x43, 0x4f, 0x4e, 0x56, 0x5f, 0x32, 0x44, 0x20, 0x3d, 0x20, 0x33, 0x2c, ++ 0x0a, 0x20, 0x20, 0x44, 0x45, 0x50, 0x54, 0x48, 0x57, 0x49, 0x53, 0x45, ++ 0x5f, 0x43, 0x4f, 0x4e, 0x56, 0x5f, 0x32, 0x44, 0x20, 0x3d, 0x20, 0x34, ++ 0x2c, 0x0a, 0x20, 0x20, 0x44, 0x45, 0x50, 0x54, 0x48, 0x5f, 0x54, 0x4f, ++ 0x5f, 0x53, 0x50, 0x41, 0x43, 0x45, 0x20, 0x3d, 0x20, 0x35, 0x2c, 0x0a, ++ 0x20, 0x20, 0x44, 0x45, 0x51, 0x55, 0x41, 0x4e, 0x54, 0x49, 0x5a, 0x45, ++ 0x20, 0x3d, 0x20, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x45, 0x4d, 0x42, 0x45, ++ 0x44, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x4f, 0x4f, 0x4b, 0x55, 0x50, ++ 0x20, 0x3d, 0x20, 0x37, 0x2c, 0x0a, 0x20, 0x20, 0x46, 0x4c, 0x4f, 0x4f, ++ 0x52, 0x20, 0x3d, 0x20, 0x38, 0x2c, 0x0a, 0x20, 0x20, 0x46, 0x55, 0x4c, ++ 0x4c, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x45, 0x44, ++ 0x20, 0x3d, 0x20, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x48, 0x41, 0x53, 0x48, ++ 0x54, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x4c, 0x4f, 0x4f, 0x4b, 0x55, 0x50, ++ 0x20, 0x3d, 0x20, 0x31, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x32, 0x5f, ++ 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, ++ 0x4e, 0x20, 0x3d, 0x20, 0x31, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x32, ++ 0x5f, 0x50, 0x4f, 0x4f, 0x4c, 0x5f, 0x32, 0x44, 0x20, 0x3d, 0x20, 0x31, ++ 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x5f, 0x52, ++ 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, ++ 0x41, 0x4c, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x20, 0x3d, 0x20, ++ 0x31, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x4f, 0x47, 0x49, 0x53, 0x54, ++ 0x49, 0x43, 0x20, 0x3d, 0x20, 0x31, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x4c, ++ 0x53, 0x48, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x49, 0x4f, ++ 0x4e, 0x20, 0x3d, 0x20, 0x31, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x53, ++ 0x54, 0x4d, 0x20, 0x3d, 0x20, 0x31, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x4d, ++ 0x41, 0x58, 0x5f, 0x50, 0x4f, 0x4f, 0x4c, 0x5f, 0x32, 0x44, 0x20, 0x3d, ++ 0x20, 0x31, 0x37, 0x2c, 0x0a, 0x20, 0x20, 0x4d, 0x55, 0x4c, 0x20, 0x3d, ++ 0x20, 0x31, 0x38, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x4c, 0x55, 0x20, ++ 0x3d, 0x20, 0x31, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, ++ 0x4f, 0x54, 0x45, 0x28, 0x61, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x29, 0x3a, ++ 0x20, 0x52, 0x45, 0x4c, 0x55, 0x5f, 0x4e, 0x31, 0x5f, 0x54, 0x4f, 0x5f, ++ 0x31, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, ++ 0x20, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x52, 0x45, 0x4c, 0x55, ++ 0x31, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x69, 0x74, 0x20, 0x77, 0x61, ++ 0x73, 0x20, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x20, 0x64, 0x69, 0x66, ++ 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, ++ 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x20, ++ 0x75, 0x73, 0x65, 0x20, 0x52, 0x45, 0x4c, 0x55, 0x31, 0x20, 0x69, 0x6e, ++ 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x77, ++ 0x61, 0x79, 0x73, 0x2e, 0x20, 0x4e, 0x65, 0x76, 0x65, 0x72, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, ++ 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6f, 0x70, 0x20, 0x63, 0x61, ++ 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x52, 0x45, 0x4c, 0x55, 0x31, 0x2e, 0x0a, ++ 0x20, 0x20, 0x52, 0x45, 0x4c, 0x55, 0x5f, 0x4e, 0x31, 0x5f, 0x54, 0x4f, ++ 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x32, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x52, ++ 0x45, 0x4c, 0x55, 0x36, 0x20, 0x3d, 0x20, 0x32, 0x31, 0x2c, 0x0a, 0x20, ++ 0x20, 0x52, 0x45, 0x53, 0x48, 0x41, 0x50, 0x45, 0x20, 0x3d, 0x20, 0x32, ++ 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x53, 0x49, 0x5a, 0x45, 0x5f, ++ 0x42, 0x49, 0x4c, 0x49, 0x4e, 0x45, 0x41, 0x52, 0x20, 0x3d, 0x20, 0x32, ++ 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x4e, 0x4e, 0x20, 0x3d, 0x20, 0x32, ++ 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x4f, 0x46, 0x54, 0x4d, 0x41, 0x58, ++ 0x20, 0x3d, 0x20, 0x32, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x50, 0x41, ++ 0x43, 0x45, 0x5f, 0x54, 0x4f, 0x5f, 0x44, 0x45, 0x50, 0x54, 0x48, 0x20, ++ 0x3d, 0x20, 0x32, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x56, 0x44, 0x46, ++ 0x20, 0x3d, 0x20, 0x32, 0x37, 0x2c, 0x0a, 0x20, 0x20, 0x54, 0x41, 0x4e, ++ 0x48, 0x20, 0x3d, 0x20, 0x32, 0x38, 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x4f, ++ 0x4e, 0x43, 0x41, 0x54, 0x5f, 0x45, 0x4d, 0x42, 0x45, 0x44, 0x44, 0x49, ++ 0x4e, 0x47, 0x53, 0x20, 0x3d, 0x20, 0x32, 0x39, 0x2c, 0x0a, 0x20, 0x20, ++ 0x53, 0x4b, 0x49, 0x50, 0x5f, 0x47, 0x52, 0x41, 0x4d, 0x20, 0x3d, 0x20, ++ 0x33, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x41, 0x4c, 0x4c, 0x20, 0x3d, ++ 0x20, 0x33, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x55, 0x53, 0x54, 0x4f, ++ 0x4d, 0x20, 0x3d, 0x20, 0x33, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x45, 0x4d, ++ 0x42, 0x45, 0x44, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x4f, 0x4f, 0x4b, ++ 0x55, 0x50, 0x5f, 0x53, 0x50, 0x41, 0x52, 0x53, 0x45, 0x20, 0x3d, 0x20, ++ 0x33, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x50, 0x41, 0x44, 0x20, 0x3d, 0x20, ++ 0x33, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x4e, 0x49, 0x44, 0x49, 0x52, ++ 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x5f, 0x53, 0x45, 0x51, ++ 0x55, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x52, 0x4e, 0x4e, 0x20, 0x3d, 0x20, ++ 0x33, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x47, 0x41, 0x54, 0x48, 0x45, 0x52, ++ 0x20, 0x3d, 0x20, 0x33, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x42, 0x41, 0x54, ++ 0x43, 0x48, 0x5f, 0x54, 0x4f, 0x5f, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, ++ 0x4e, 0x44, 0x20, 0x3d, 0x20, 0x33, 0x37, 0x2c, 0x0a, 0x20, 0x20, 0x53, ++ 0x50, 0x41, 0x43, 0x45, 0x5f, 0x54, 0x4f, 0x5f, 0x42, 0x41, 0x54, 0x43, ++ 0x48, 0x5f, 0x4e, 0x44, 0x20, 0x3d, 0x20, 0x33, 0x38, 0x2c, 0x0a, 0x20, ++ 0x20, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x3d, ++ 0x20, 0x33, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x4d, 0x45, 0x41, 0x4e, 0x20, ++ 0x3d, 0x20, 0x34, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x55, 0x42, 0x20, ++ 0x3d, 0x20, 0x34, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x44, 0x49, 0x56, 0x20, ++ 0x3d, 0x20, 0x34, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x51, 0x55, 0x45, ++ 0x45, 0x5a, 0x45, 0x20, 0x3d, 0x20, 0x34, 0x33, 0x2c, 0x0a, 0x20, 0x20, ++ 0x55, 0x4e, 0x49, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, ++ 0x41, 0x4c, 0x5f, 0x53, 0x45, 0x51, 0x55, 0x45, 0x4e, 0x43, 0x45, 0x5f, ++ 0x4c, 0x53, 0x54, 0x4d, 0x20, 0x3d, 0x20, 0x34, 0x34, 0x2c, 0x0a, 0x20, ++ 0x20, 0x53, 0x54, 0x52, 0x49, 0x44, 0x45, 0x44, 0x5f, 0x53, 0x4c, 0x49, ++ 0x43, 0x45, 0x20, 0x3d, 0x20, 0x34, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x42, ++ 0x49, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, ++ 0x5f, 0x53, 0x45, 0x51, 0x55, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x52, 0x4e, ++ 0x4e, 0x20, 0x3d, 0x20, 0x34, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x45, 0x58, ++ 0x50, 0x20, 0x3d, 0x20, 0x34, 0x37, 0x2c, 0x0a, 0x20, 0x20, 0x54, 0x4f, ++ 0x50, 0x4b, 0x5f, 0x56, 0x32, 0x20, 0x3d, 0x20, 0x34, 0x38, 0x2c, 0x0a, ++ 0x20, 0x20, 0x53, 0x50, 0x4c, 0x49, 0x54, 0x20, 0x3d, 0x20, 0x34, 0x39, ++ 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x4f, 0x47, 0x5f, 0x53, 0x4f, 0x46, 0x54, ++ 0x4d, 0x41, 0x58, 0x20, 0x3d, 0x20, 0x35, 0x30, 0x2c, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x44, 0x45, 0x4c, 0x45, 0x47, 0x41, 0x54, 0x45, 0x20, ++ 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, ++ 0x20, 0x6f, 0x70, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x66, 0x6f, 0x72, ++ 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x61, 0x72, ++ 0x65, 0x20, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x20, ++ 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x74, 0x68, 0x65, ++ 0x72, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, 0x2e, 0x0a, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, ++ 0x3a, 0x20, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, ++ 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, ++ 0x2c, 0x20, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x74, 0x6f, ++ 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x0a, 0x20, 0x20, 0x44, 0x45, ++ 0x4c, 0x45, 0x47, 0x41, 0x54, 0x45, 0x20, 0x3d, 0x20, 0x35, 0x31, 0x2c, ++ 0x0a, 0x20, 0x20, 0x42, 0x49, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, ++ 0x4f, 0x4e, 0x41, 0x4c, 0x5f, 0x53, 0x45, 0x51, 0x55, 0x45, 0x4e, 0x43, ++ 0x45, 0x5f, 0x4c, 0x53, 0x54, 0x4d, 0x20, 0x3d, 0x20, 0x35, 0x32, 0x2c, ++ 0x0a, 0x20, 0x20, 0x43, 0x41, 0x53, 0x54, 0x20, 0x3d, 0x20, 0x35, 0x33, ++ 0x2c, 0x0a, 0x20, 0x20, 0x50, 0x52, 0x45, 0x4c, 0x55, 0x20, 0x3d, 0x20, ++ 0x35, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x4d, 0x41, 0x58, 0x49, 0x4d, 0x55, ++ 0x4d, 0x20, 0x3d, 0x20, 0x35, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x41, 0x52, ++ 0x47, 0x5f, 0x4d, 0x41, 0x58, 0x20, 0x3d, 0x20, 0x35, 0x36, 0x2c, 0x0a, ++ 0x20, 0x20, 0x4d, 0x49, 0x4e, 0x49, 0x4d, 0x55, 0x4d, 0x20, 0x3d, 0x20, ++ 0x35, 0x37, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x45, 0x53, 0x53, 0x20, 0x3d, ++ 0x20, 0x35, 0x38, 0x2c, 0x0a, 0x20, 0x20, 0x4e, 0x45, 0x47, 0x20, 0x3d, ++ 0x20, 0x35, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x50, 0x41, 0x44, 0x56, 0x32, ++ 0x20, 0x3d, 0x20, 0x36, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x47, 0x52, 0x45, ++ 0x41, 0x54, 0x45, 0x52, 0x20, 0x3d, 0x20, 0x36, 0x31, 0x2c, 0x0a, 0x20, ++ 0x20, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x45, 0x51, 0x55, ++ 0x41, 0x4c, 0x20, 0x3d, 0x20, 0x36, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x4c, ++ 0x45, 0x53, 0x53, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x20, 0x3d, 0x20, ++ 0x36, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, ++ 0x20, 0x3d, 0x20, 0x36, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x4c, 0x49, ++ 0x43, 0x45, 0x20, 0x3d, 0x20, 0x36, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x53, ++ 0x49, 0x4e, 0x20, 0x3d, 0x20, 0x36, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x54, ++ 0x52, 0x41, 0x4e, 0x53, 0x50, 0x4f, 0x53, 0x45, 0x5f, 0x43, 0x4f, 0x4e, ++ 0x56, 0x20, 0x3d, 0x20, 0x36, 0x37, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x50, ++ 0x41, 0x52, 0x53, 0x45, 0x5f, 0x54, 0x4f, 0x5f, 0x44, 0x45, 0x4e, 0x53, ++ 0x45, 0x20, 0x3d, 0x20, 0x36, 0x38, 0x2c, 0x0a, 0x20, 0x20, 0x54, 0x49, ++ 0x4c, 0x45, 0x20, 0x3d, 0x20, 0x36, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x45, ++ 0x58, 0x50, 0x41, 0x4e, 0x44, 0x5f, 0x44, 0x49, 0x4d, 0x53, 0x20, 0x3d, ++ 0x20, 0x37, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x45, 0x51, 0x55, 0x41, 0x4c, ++ 0x20, 0x3d, 0x20, 0x37, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x4e, 0x4f, 0x54, ++ 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x20, 0x3d, 0x20, 0x37, 0x32, 0x2c, ++ 0x0a, 0x20, 0x20, 0x4c, 0x4f, 0x47, 0x20, 0x3d, 0x20, 0x37, 0x33, 0x2c, ++ 0x0a, 0x20, 0x20, 0x53, 0x55, 0x4d, 0x20, 0x3d, 0x20, 0x37, 0x34, 0x2c, ++ 0x0a, 0x20, 0x20, 0x53, 0x51, 0x52, 0x54, 0x20, 0x3d, 0x20, 0x37, 0x35, ++ 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x53, 0x51, 0x52, 0x54, 0x20, 0x3d, 0x20, ++ 0x37, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x48, 0x41, 0x50, 0x45, 0x20, ++ 0x3d, 0x20, 0x37, 0x37, 0x2c, 0x0a, 0x20, 0x20, 0x50, 0x4f, 0x57, 0x20, ++ 0x3d, 0x20, 0x37, 0x38, 0x2c, 0x0a, 0x20, 0x20, 0x41, 0x52, 0x47, 0x5f, ++ 0x4d, 0x49, 0x4e, 0x20, 0x3d, 0x20, 0x37, 0x39, 0x2c, 0x0a, 0x20, 0x20, ++ 0x46, 0x41, 0x4b, 0x45, 0x5f, 0x51, 0x55, 0x41, 0x4e, 0x54, 0x20, 0x3d, ++ 0x20, 0x38, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x44, 0x55, 0x43, ++ 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x44, 0x20, 0x3d, 0x20, 0x38, 0x31, 0x2c, ++ 0x0a, 0x20, 0x20, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, 0x4d, 0x41, ++ 0x58, 0x20, 0x3d, 0x20, 0x38, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x50, 0x41, ++ 0x43, 0x4b, 0x20, 0x3d, 0x20, 0x38, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x4c, ++ 0x4f, 0x47, 0x49, 0x43, 0x41, 0x4c, 0x5f, 0x4f, 0x52, 0x20, 0x3d, 0x20, ++ 0x38, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x4f, 0x4e, 0x45, 0x5f, 0x48, 0x4f, ++ 0x54, 0x20, 0x3d, 0x20, 0x38, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x4f, ++ 0x47, 0x49, 0x43, 0x41, 0x4c, 0x5f, 0x41, 0x4e, 0x44, 0x20, 0x3d, 0x20, ++ 0x38, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x4f, 0x47, 0x49, 0x43, 0x41, ++ 0x4c, 0x5f, 0x4e, 0x4f, 0x54, 0x20, 0x3d, 0x20, 0x38, 0x37, 0x2c, 0x0a, ++ 0x20, 0x20, 0x55, 0x4e, 0x50, 0x41, 0x43, 0x4b, 0x20, 0x3d, 0x20, 0x38, ++ 0x38, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, 0x5f, ++ 0x4d, 0x49, 0x4e, 0x20, 0x3d, 0x20, 0x38, 0x39, 0x2c, 0x0a, 0x20, 0x20, ++ 0x46, 0x4c, 0x4f, 0x4f, 0x52, 0x5f, 0x44, 0x49, 0x56, 0x20, 0x3d, 0x20, ++ 0x39, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, ++ 0x5f, 0x41, 0x4e, 0x59, 0x20, 0x3d, 0x20, 0x39, 0x31, 0x2c, 0x0a, 0x20, ++ 0x20, 0x53, 0x51, 0x55, 0x41, 0x52, 0x45, 0x20, 0x3d, 0x20, 0x39, 0x32, ++ 0x2c, 0x0a, 0x20, 0x20, 0x5a, 0x45, 0x52, 0x4f, 0x53, 0x5f, 0x4c, 0x49, ++ 0x4b, 0x45, 0x20, 0x3d, 0x20, 0x39, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x46, ++ 0x49, 0x4c, 0x4c, 0x20, 0x3d, 0x20, 0x39, 0x34, 0x2c, 0x0a, 0x20, 0x20, ++ 0x46, 0x4c, 0x4f, 0x4f, 0x52, 0x5f, 0x4d, 0x4f, 0x44, 0x20, 0x3d, 0x20, ++ 0x39, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x20, ++ 0x3d, 0x20, 0x39, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x53, 0x49, ++ 0x5a, 0x45, 0x5f, 0x4e, 0x45, 0x41, 0x52, 0x45, 0x53, 0x54, 0x5f, 0x4e, ++ 0x45, 0x49, 0x47, 0x48, 0x42, 0x4f, 0x52, 0x20, 0x3d, 0x20, 0x39, 0x37, ++ 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x45, 0x41, 0x4b, 0x59, 0x5f, 0x52, 0x45, ++ 0x4c, 0x55, 0x20, 0x3d, 0x20, 0x39, 0x38, 0x2c, 0x0a, 0x20, 0x20, 0x53, ++ 0x51, 0x55, 0x41, 0x52, 0x45, 0x44, 0x5f, 0x44, 0x49, 0x46, 0x46, 0x45, ++ 0x52, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x3d, 0x20, 0x39, 0x39, 0x2c, 0x0a, ++ 0x20, 0x20, 0x4d, 0x49, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x50, 0x41, 0x44, ++ 0x20, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x41, 0x42, ++ 0x53, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x53, ++ 0x50, 0x4c, 0x49, 0x54, 0x5f, 0x56, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x32, ++ 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x20, 0x3d, ++ 0x20, 0x31, 0x30, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x45, 0x49, 0x4c, ++ 0x20, 0x3d, 0x20, 0x31, 0x30, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, ++ 0x56, 0x45, 0x52, 0x53, 0x45, 0x5f, 0x56, 0x32, 0x20, 0x3d, 0x20, 0x31, ++ 0x30, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x41, 0x44, 0x44, 0x5f, 0x4e, 0x20, ++ 0x3d, 0x20, 0x31, 0x30, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x47, 0x41, 0x54, ++ 0x48, 0x45, 0x52, 0x5f, 0x4e, 0x44, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x37, ++ 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x4f, 0x53, 0x20, 0x3d, 0x20, 0x31, 0x30, ++ 0x38, 0x2c, 0x0a, 0x20, 0x20, 0x57, 0x48, 0x45, 0x52, 0x45, 0x20, 0x3d, ++ 0x20, 0x31, 0x30, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x41, 0x4e, 0x4b, ++ 0x20, 0x3d, 0x20, 0x31, 0x31, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x45, 0x4c, ++ 0x55, 0x20, 0x3d, 0x20, 0x31, 0x31, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x52, ++ 0x45, 0x56, 0x45, 0x52, 0x53, 0x45, 0x5f, 0x53, 0x45, 0x51, 0x55, 0x45, ++ 0x4e, 0x43, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x31, 0x32, 0x2c, 0x0a, 0x20, ++ 0x20, 0x4d, 0x41, 0x54, 0x52, 0x49, 0x58, 0x5f, 0x44, 0x49, 0x41, 0x47, ++ 0x20, 0x3d, 0x20, 0x31, 0x31, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x51, 0x55, ++ 0x41, 0x4e, 0x54, 0x49, 0x5a, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x31, 0x34, ++ 0x2c, 0x0a, 0x20, 0x20, 0x4d, 0x41, 0x54, 0x52, 0x49, 0x58, 0x5f, 0x53, ++ 0x45, 0x54, 0x5f, 0x44, 0x49, 0x41, 0x47, 0x20, 0x3d, 0x20, 0x31, 0x31, ++ 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x20, 0x3d, ++ 0x20, 0x31, 0x31, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x48, 0x41, 0x52, 0x44, ++ 0x5f, 0x53, 0x57, 0x49, 0x53, 0x48, 0x20, 0x3d, 0x20, 0x31, 0x31, 0x37, ++ 0x2c, 0x0a, 0x20, 0x20, 0x49, 0x46, 0x20, 0x3d, 0x20, 0x31, 0x31, 0x38, ++ 0x2c, 0x0a, 0x20, 0x20, 0x57, 0x48, 0x49, 0x4c, 0x45, 0x20, 0x3d, 0x20, ++ 0x31, 0x31, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x4e, 0x4f, 0x4e, 0x5f, 0x4d, ++ 0x41, 0x58, 0x5f, 0x53, 0x55, 0x50, 0x50, 0x52, 0x45, 0x53, 0x53, 0x49, ++ 0x4f, 0x4e, 0x5f, 0x56, 0x34, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x30, 0x2c, ++ 0x0a, 0x20, 0x20, 0x4e, 0x4f, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x5f, 0x53, ++ 0x55, 0x50, 0x50, 0x52, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x56, ++ 0x35, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x53, ++ 0x43, 0x41, 0x54, 0x54, 0x45, 0x52, 0x5f, 0x4e, 0x44, 0x20, 0x3d, 0x20, ++ 0x31, 0x32, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x45, 0x4c, 0x45, 0x43, ++ 0x54, 0x5f, 0x56, 0x32, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x33, 0x2c, 0x0a, ++ 0x20, 0x20, 0x44, 0x45, 0x4e, 0x53, 0x49, 0x46, 0x59, 0x20, 0x3d, 0x20, ++ 0x31, 0x32, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x45, 0x47, 0x4d, 0x45, ++ 0x4e, 0x54, 0x5f, 0x53, 0x55, 0x4d, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x35, ++ 0x2c, 0x0a, 0x20, 0x20, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x4d, 0x41, ++ 0x54, 0x4d, 0x55, 0x4c, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x36, 0x2c, 0x0a, ++ 0x20, 0x20, 0x50, 0x4c, 0x41, 0x43, 0x45, 0x48, 0x4f, 0x4c, 0x44, 0x45, ++ 0x52, 0x5f, 0x46, 0x4f, 0x52, 0x5f, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, ++ 0x52, 0x5f, 0x4f, 0x50, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x53, 0x20, 0x3d, ++ 0x20, 0x31, 0x32, 0x37, 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x55, 0x4d, 0x53, ++ 0x55, 0x4d, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x38, 0x2c, 0x0a, 0x20, 0x20, ++ 0x43, 0x41, 0x4c, 0x4c, 0x5f, 0x4f, 0x4e, 0x43, 0x45, 0x20, 0x3d, 0x20, ++ 0x31, 0x32, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x42, 0x52, 0x4f, 0x41, 0x44, ++ 0x43, 0x41, 0x53, 0x54, 0x5f, 0x54, 0x4f, 0x20, 0x3d, 0x20, 0x31, 0x33, ++ 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x46, 0x46, 0x54, 0x32, 0x44, 0x20, ++ 0x3d, 0x20, 0x31, 0x33, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x4f, 0x4e, ++ 0x56, 0x5f, 0x33, 0x44, 0x20, 0x3d, 0x20, 0x31, 0x33, 0x32, 0x2c, 0x0a, ++ 0x20, 0x20, 0x49, 0x4d, 0x41, 0x47, 0x3d, 0x31, 0x33, 0x33, 0x2c, 0x0a, ++ 0x20, 0x20, 0x52, 0x45, 0x41, 0x4c, 0x3d, 0x31, 0x33, 0x34, 0x2c, 0x0a, ++ 0x20, 0x20, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x58, 0x5f, 0x41, 0x42, ++ 0x53, 0x3d, 0x31, 0x33, 0x35, 0x2c, 0x0a, 0x20, 0x20, 0x48, 0x41, 0x53, ++ 0x48, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x33, 0x36, ++ 0x2c, 0x0a, 0x20, 0x20, 0x48, 0x41, 0x53, 0x48, 0x54, 0x41, 0x42, 0x4c, ++ 0x45, 0x5f, 0x46, 0x49, 0x4e, 0x44, 0x20, 0x3d, 0x20, 0x31, 0x33, 0x37, ++ 0x2c, 0x0a, 0x20, 0x20, 0x48, 0x41, 0x53, 0x48, 0x54, 0x41, 0x42, 0x4c, ++ 0x45, 0x5f, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x20, 0x3d, 0x20, 0x31, ++ 0x33, 0x38, 0x2c, 0x0a, 0x20, 0x20, 0x48, 0x41, 0x53, 0x48, 0x54, 0x41, ++ 0x42, 0x4c, 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x20, 0x3d, 0x20, 0x31, ++ 0x33, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x44, 0x55, 0x43, 0x45, ++ 0x5f, 0x41, 0x4c, 0x4c, 0x20, 0x3d, 0x20, 0x31, 0x34, 0x30, 0x2c, 0x0a, ++ 0x20, 0x20, 0x43, 0x4f, 0x4e, 0x56, 0x5f, 0x33, 0x44, 0x5f, 0x54, 0x52, ++ 0x41, 0x4e, 0x53, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x34, ++ 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x56, 0x41, 0x52, 0x5f, 0x48, 0x41, 0x4e, ++ 0x44, 0x4c, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x34, 0x32, 0x2c, 0x0a, 0x20, ++ 0x20, 0x52, 0x45, 0x41, 0x44, 0x5f, 0x56, 0x41, 0x52, 0x49, 0x41, 0x42, ++ 0x4c, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x34, 0x33, 0x2c, 0x0a, 0x20, 0x20, ++ 0x41, 0x53, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x56, 0x41, 0x52, 0x49, 0x41, ++ 0x42, 0x4c, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x34, 0x34, 0x2c, 0x0a, 0x20, ++ 0x20, 0x42, 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x5f, 0x41, ++ 0x52, 0x47, 0x53, 0x20, 0x3d, 0x20, 0x31, 0x34, 0x35, 0x2c, 0x0a, 0x20, ++ 0x20, 0x52, 0x41, 0x4e, 0x44, 0x4f, 0x4d, 0x5f, 0x53, 0x54, 0x41, 0x4e, ++ 0x44, 0x41, 0x52, 0x44, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x20, ++ 0x3d, 0x20, 0x31, 0x34, 0x36, 0x2c, 0x0a, 0x20, 0x20, 0x42, 0x55, 0x43, ++ 0x4b, 0x45, 0x54, 0x49, 0x5a, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x34, 0x37, ++ 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x41, 0x4e, 0x44, 0x4f, 0x4d, 0x5f, 0x55, ++ 0x4e, 0x49, 0x46, 0x4f, 0x52, 0x4d, 0x20, 0x3d, 0x20, 0x31, 0x34, 0x38, ++ 0x2c, 0x0a, 0x20, 0x20, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x4e, 0x4f, 0x4d, ++ 0x49, 0x41, 0x4c, 0x20, 0x3d, 0x20, 0x31, 0x34, 0x39, 0x2c, 0x0a, 0x20, ++ 0x20, 0x47, 0x45, 0x4c, 0x55, 0x20, 0x3d, 0x20, 0x31, 0x35, 0x30, 0x2c, ++ 0x0a, 0x20, 0x20, 0x44, 0x59, 0x4e, 0x41, 0x4d, 0x49, 0x43, 0x5f, 0x55, ++ 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x4c, 0x49, 0x43, 0x45, 0x20, ++ 0x3d, 0x20, 0x31, 0x35, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x4c, ++ 0x55, 0x5f, 0x30, 0x5f, 0x54, 0x4f, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x31, ++ 0x35, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x4e, 0x53, 0x4f, 0x52, 0x54, ++ 0x45, 0x44, 0x5f, 0x53, 0x45, 0x47, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x50, ++ 0x52, 0x4f, 0x44, 0x20, 0x3d, 0x20, 0x31, 0x35, 0x33, 0x2c, 0x0a, 0x20, ++ 0x20, 0x55, 0x4e, 0x53, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x45, ++ 0x47, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x4d, 0x41, 0x58, 0x20, 0x3d, 0x20, ++ 0x31, 0x35, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x4e, 0x53, 0x4f, 0x52, ++ 0x54, 0x45, 0x44, 0x5f, 0x53, 0x45, 0x47, 0x4d, 0x45, 0x4e, 0x54, 0x5f, ++ 0x53, 0x55, 0x4d, 0x20, 0x3d, 0x20, 0x31, 0x35, 0x35, 0x2c, 0x0a, 0x20, ++ 0x20, 0x41, 0x54, 0x41, 0x4e, 0x32, 0x20, 0x3d, 0x20, 0x31, 0x35, 0x36, ++ 0x0a, 0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4e, 0x54, 0x2e, 0x54, ++ 0x68, 0x65, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x6e, 0x6e, ++ 0x61, 0x70, 0x69, 0x5f, 0x6c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x6c, ++ 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x29, ++ 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x75, 0x69, ++ 0x6c, 0x74, 0x69, 0x6e, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, ++ 0x72, 0x73, 0x2e, 0x0a, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x20, 0x42, 0x75, ++ 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x43, 0x6f, 0x6e, 0x76, 0x32, 0x44, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x44, 0x65, ++ 0x70, 0x74, 0x68, 0x77, 0x69, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x32, ++ 0x44, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, ++ 0x43, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, ++ 0x69, 0x6e, 0x67, 0x73, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x4c, 0x53, 0x48, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, ++ 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x50, 0x6f, 0x6f, 0x6c, 0x32, 0x44, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x56, 0x44, 0x46, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x52, ++ 0x4e, 0x4e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, ++ 0x20, 0x46, 0x75, 0x6c, 0x6c, 0x79, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, ++ 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, ++ 0x20, 0x20, 0x53, 0x6f, 0x66, 0x74, 0x6d, 0x61, 0x78, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x6f, 0x6e, 0x63, ++ 0x61, 0x74, 0x65, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x41, 0x64, 0x64, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x32, ++ 0x4e, 0x6f, 0x72, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, ++ 0x6f, 0x6e, 0x73, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, ++ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x53, 0x54, 0x4d, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x65, 0x73, 0x69, 0x7a, ++ 0x65, 0x42, 0x69, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x61, 0x6c, 0x6c, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x52, ++ 0x65, 0x73, 0x68, 0x61, 0x70, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x6b, 0x69, 0x70, 0x47, 0x72, 0x61, ++ 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, ++ 0x53, 0x70, 0x61, 0x63, 0x65, 0x54, 0x6f, 0x44, 0x65, 0x70, 0x74, 0x68, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x45, ++ 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x4c, 0x6f, 0x6f, 0x6b, ++ 0x75, 0x70, 0x53, 0x70, 0x61, 0x72, 0x73, 0x65, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4d, 0x75, 0x6c, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x50, 0x61, 0x64, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x47, ++ 0x61, 0x74, 0x68, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x2c, 0x0a, 0x20, 0x20, 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, 0x6f, 0x53, ++ 0x70, 0x61, 0x63, 0x65, 0x4e, 0x44, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x70, 0x61, 0x63, 0x65, 0x54, 0x6f, ++ 0x42, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x44, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, ++ 0x6f, 0x73, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, ++ 0x20, 0x20, 0x52, 0x65, 0x64, 0x75, 0x63, 0x65, 0x72, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x75, 0x62, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x44, 0x69, ++ 0x76, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, ++ 0x53, 0x71, 0x75, 0x65, 0x65, 0x7a, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, ++ 0x63, 0x65, 0x52, 0x4e, 0x4e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x74, 0x72, 0x69, 0x64, 0x65, 0x64, 0x53, ++ 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x45, 0x78, 0x70, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x54, 0x6f, 0x70, 0x4b, 0x56, 0x32, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x70, ++ 0x6c, 0x69, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, ++ 0x20, 0x20, 0x4c, 0x6f, 0x67, 0x53, 0x6f, 0x66, 0x74, 0x6d, 0x61, 0x78, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x43, ++ 0x61, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, ++ 0x20, 0x20, 0x44, 0x65, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4d, ++ 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, ++ 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, ++ 0x41, 0x72, 0x67, 0x4d, 0x61, 0x78, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x65, 0x73, 0x73, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4e, 0x65, 0x67, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x50, 0x61, ++ 0x64, 0x56, 0x32, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, ++ 0x20, 0x20, 0x47, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x47, 0x72, 0x65, 0x61, ++ 0x74, 0x65, 0x72, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x65, 0x73, 0x73, 0x45, ++ 0x71, 0x75, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x6c, 0x69, 0x63, ++ 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, ++ 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x73, 0x65, 0x43, 0x6f, 0x6e, ++ 0x76, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, ++ 0x53, 0x70, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x44, 0x65, 0x6e, 0x73, ++ 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, ++ 0x54, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x44, 0x69, 0x6d, ++ 0x73, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, ++ 0x45, 0x71, 0x75, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x2c, 0x0a, 0x20, 0x20, 0x4e, 0x6f, 0x74, 0x45, 0x71, 0x75, 0x61, 0x6c, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x53, ++ 0x68, 0x61, 0x70, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x50, 0x6f, 0x77, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x41, 0x72, 0x67, 0x4d, 0x69, 0x6e, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x46, 0x61, ++ 0x6b, 0x65, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x50, 0x61, 0x63, 0x6b, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x6f, 0x67, ++ 0x69, 0x63, 0x61, 0x6c, 0x4f, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4f, 0x6e, 0x65, 0x48, 0x6f, 0x74, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x6f, ++ 0x67, 0x69, 0x63, 0x61, 0x6c, 0x41, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4c, 0x6f, 0x67, 0x69, 0x63, ++ 0x61, 0x6c, 0x4e, 0x6f, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x46, 0x6c, 0x6f, ++ 0x6f, 0x72, 0x44, 0x69, 0x76, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x71, 0x75, 0x61, 0x72, 0x65, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x5a, 0x65, 0x72, ++ 0x6f, 0x73, 0x4c, 0x69, 0x6b, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x46, 0x69, 0x6c, 0x6c, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x42, 0x69, 0x64, 0x69, ++ 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x71, ++ 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4c, 0x53, 0x54, 0x4d, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x42, 0x69, 0x64, 0x69, ++ 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x71, ++ 0x75, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x4e, 0x4e, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x6e, 0x69, 0x64, 0x69, ++ 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x71, ++ 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4c, 0x53, 0x54, 0x4d, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x46, 0x6c, 0x6f, 0x6f, ++ 0x72, 0x4d, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x65, 0x73, 0x69, 0x7a, ++ 0x65, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x69, 0x67, ++ 0x68, 0x62, 0x6f, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x4c, 0x65, 0x61, 0x6b, 0x79, 0x52, 0x65, 0x6c, 0x75, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x53, ++ 0x71, 0x75, 0x61, 0x72, 0x65, 0x64, 0x44, 0x69, 0x66, 0x66, 0x65, 0x72, ++ 0x65, 0x6e, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x50, 0x61, 0x64, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x41, ++ 0x62, 0x73, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, ++ 0x20, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x56, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x52, ++ 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x56, 0x32, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x41, 0x64, 0x64, 0x4e, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x47, 0x61, ++ 0x74, 0x68, 0x65, 0x72, 0x4e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x6f, 0x73, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x57, 0x68, 0x65, 0x72, 0x65, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x52, ++ 0x61, 0x6e, 0x6b, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, ++ 0x20, 0x20, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x53, 0x65, 0x71, ++ 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x2c, 0x0a, 0x20, 0x20, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x44, 0x69, ++ 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, ++ 0x20, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4d, 0x61, 0x74, 0x72, ++ 0x69, 0x78, 0x53, 0x65, 0x74, 0x44, 0x69, 0x61, 0x67, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x48, 0x61, 0x72, 0x64, ++ 0x53, 0x77, 0x69, 0x73, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x2c, 0x0a, 0x20, 0x20, 0x49, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x57, 0x68, 0x69, 0x6c, 0x65, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x44, 0x65, 0x70, ++ 0x74, 0x68, 0x54, 0x6f, 0x53, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x4e, 0x6f, 0x6e, 0x4d, ++ 0x61, 0x78, 0x53, 0x75, 0x70, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, ++ 0x6e, 0x56, 0x34, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, ++ 0x20, 0x20, 0x4e, 0x6f, 0x6e, 0x4d, 0x61, 0x78, 0x53, 0x75, 0x70, 0x70, ++ 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x56, 0x35, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x63, 0x61, 0x74, ++ 0x74, 0x65, 0x72, 0x4e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x56, 0x32, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x44, ++ 0x65, 0x6e, 0x73, 0x69, 0x66, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, ++ 0x53, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, ++ 0x20, 0x20, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x74, 0x4d, 0x75, ++ 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, ++ 0x43, 0x75, 0x6d, 0x73, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x43, 0x61, 0x6c, 0x6c, 0x4f, 0x6e, 0x63, ++ 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, ++ 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x6f, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x66, ++ 0x66, 0x74, 0x32, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x43, 0x6f, 0x6e, 0x76, 0x33, 0x44, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x48, 0x61, 0x73, 0x68, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x2c, 0x0a, 0x20, 0x20, 0x48, 0x61, 0x73, 0x68, 0x74, 0x61, 0x62, 0x6c, ++ 0x65, 0x46, 0x69, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x2c, 0x0a, 0x20, 0x20, 0x48, 0x61, 0x73, 0x68, 0x74, 0x61, 0x62, 0x6c, ++ 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x48, 0x61, 0x73, 0x68, 0x74, 0x61, ++ 0x62, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x56, 0x61, 0x72, 0x48, 0x61, 0x6e, ++ 0x64, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, ++ 0x20, 0x20, 0x52, 0x65, 0x61, 0x64, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, ++ 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, ++ 0x20, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, 0x72, 0x69, 0x61, ++ 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, ++ 0x20, 0x20, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x42, 0x75, 0x63, 0x6b, 0x65, ++ 0x74, 0x69, 0x7a, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x47, 0x65, 0x6c, 0x75, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, ++ 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6c, 0x69, 0x63, 0x65, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x55, ++ 0x6e, 0x73, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x53, 0x65, 0x67, 0x6d, 0x65, ++ 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x6e, 0x73, 0x6f, 0x72, 0x74, 0x65, ++ 0x64, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x78, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x55, 0x6e, ++ 0x73, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, ++ 0x74, 0x53, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, ++ 0x0a, 0x20, 0x20, 0x41, 0x54, 0x61, 0x6e, 0x32, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, ++ 0x4e, 0x54, 0x2e, 0x49, 0x66, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x0a, ++ 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x50, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, ++ 0x20, 0x3a, 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, 0x7b, 0x20, 0x53, 0x41, ++ 0x4d, 0x45, 0x2c, 0x20, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x20, 0x7d, 0x0a, ++ 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4e, 0x54, 0x2e, 0x54, 0x68, 0x65, 0x6e, ++ 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x2f, 0x2f, 0x74, 0x65, 0x6e, ++ 0x73, 0x6f, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x63, 0x6f, 0x6d, 0x70, ++ 0x69, 0x6c, 0x65, 0x72, 0x2f, 0x6d, 0x6c, 0x69, 0x72, 0x2f, 0x6c, 0x69, ++ 0x74, 0x65, 0x2f, 0x69, 0x72, 0x2f, 0x74, 0x66, 0x6c, 0x5f, 0x6f, 0x70, ++ 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x74, 0x64, 0x29, 0x0a, 0x0a, ++ 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4e, 0x54, 0x2e, 0x49, 0x66, 0x43, 0x68, ++ 0x61, 0x6e, 0x67, 0x65, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x41, 0x63, ++ 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, ++ 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x20, 0x3a, 0x20, 0x62, ++ 0x79, 0x74, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x4e, 0x4f, 0x4e, 0x45, ++ 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x4c, 0x55, ++ 0x20, 0x3d, 0x20, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x4c, 0x55, ++ 0x5f, 0x4e, 0x31, 0x5f, 0x54, 0x4f, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x32, ++ 0x2c, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x4c, 0x55, 0x36, 0x20, 0x3d, 0x20, ++ 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x54, 0x41, 0x4e, 0x48, 0x20, 0x3d, 0x20, ++ 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x42, 0x49, ++ 0x54, 0x20, 0x3d, 0x20, 0x35, 0x2c, 0x0a, 0x7d, 0x0a, 0x2f, 0x2f, 0x20, ++ 0x4c, 0x49, 0x4e, 0x54, 0x2e, 0x54, 0x68, 0x65, 0x6e, 0x43, 0x68, 0x61, ++ 0x6e, 0x67, 0x65, 0x28, 0x2f, 0x2f, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, ++ 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, ++ 0x72, 0x2f, 0x6d, 0x6c, 0x69, 0x72, 0x2f, 0x6c, 0x69, 0x74, 0x65, 0x2f, ++ 0x69, 0x72, 0x2f, 0x74, 0x66, 0x6c, 0x5f, 0x6f, 0x70, 0x5f, 0x65, 0x6e, ++ 0x75, 0x6d, 0x73, 0x2e, 0x74, 0x64, 0x29, 0x0a, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x43, 0x6f, 0x6e, 0x76, 0x32, 0x44, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x70, 0x61, 0x64, ++ 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x50, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, ++ 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x77, ++ 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, ++ 0x64, 0x65, 0x5f, 0x68, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, ++ 0x66, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, ++ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, ++ 0x6e, 0x3a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, ++ 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, ++ 0x3b, 0x0a, 0x20, 0x20, 0x64, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, ++ 0x5f, 0x77, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x3a, 0x69, 0x6e, ++ 0x74, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x64, 0x69, 0x6c, ++ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x5f, 0x66, 0x61, 0x63, 0x74, ++ 0x6f, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x62, 0x6f, 0x74, 0x68, 0x20, 0x43, ++ 0x6f, 0x6e, 0x76, 0x33, 0x44, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x43, 0x6f, ++ 0x6e, 0x76, 0x33, 0x44, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x73, ++ 0x65, 0x2e, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x43, 0x6f, 0x6e, ++ 0x76, 0x33, 0x44, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x50, ++ 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x74, ++ 0x72, 0x69, 0x64, 0x65, 0x5f, 0x64, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, ++ 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x77, 0x3a, 0x69, ++ 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, ++ 0x5f, 0x68, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x75, ++ 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, ++ 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x75, ++ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, ++ 0x20, 0x20, 0x64, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, ++ 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x20, ++ 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x64, 0x69, 0x6c, 0x61, 0x74, ++ 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, ++ 0x3a, 0x69, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, ++ 0x64, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x5f, 0x66, ++ 0x61, 0x63, 0x74, 0x6f, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x20, 0x3d, 0x20, ++ 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x50, 0x6f, 0x6f, 0x6c, 0x32, 0x44, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, ++ 0x67, 0x3a, 0x50, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3b, 0x0a, 0x20, ++ 0x20, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x5f, 0x77, 0x3a, 0x69, 0x6e, ++ 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x5f, ++ 0x68, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x69, 0x6c, ++ 0x74, 0x65, 0x72, 0x5f, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x69, 0x6e, ++ 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, ++ 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, ++ 0x20, 0x20, 0x66, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, ++ 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, ++ 0x69, 0x6f, 0x6e, 0x3a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, ++ 0x70, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x44, 0x65, 0x70, 0x74, 0x68, 0x77, 0x69, 0x73, 0x65, 0x43, 0x6f, ++ 0x6e, 0x76, 0x32, 0x44, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, ++ 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x44, 0x65, ++ 0x70, 0x74, 0x68, 0x77, 0x69, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x20, ++ 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x20, 0x6f, 0x72, ++ 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x70, 0x61, ++ 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x50, 0x61, 0x64, 0x64, 0x69, 0x6e, ++ 0x67, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x5f, ++ 0x77, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, ++ 0x69, 0x64, 0x65, 0x5f, 0x68, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x60, 0x64, 0x65, 0x70, 0x74, 0x68, 0x5f, 0x6d, ++ 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x60, 0x20, 0x69, ++ 0x73, 0x20, 0x72, 0x65, 0x64, 0x75, 0x6e, 0x64, 0x61, 0x6e, 0x74, 0x2e, ++ 0x20, 0x49, 0x74, 0x27, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, ++ 0x79, 0x20, 0x43, 0x50, 0x55, 0x20, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, ++ 0x73, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x65, ++ 0x6e, 0x73, 0x6f, 0x72, 0x46, 0x6c, 0x6f, 0x77, 0x20, 0x32, 0x2e, 0x30, ++ 0x20, 0x6f, 0x72, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2c, 0x20, 0x62, ++ 0x75, 0x74, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x69, ++ 0x6e, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, ++ 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, ++ 0x65, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, ++ 0x69, 0x6e, 0x20, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x2f, 0x62, 0x75, ++ 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x5f, 0x64, 0x61, 0x74, ++ 0x61, 0x2e, 0x68, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, ++ 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x0a, 0x20, 0x20, ++ 0x64, 0x65, 0x70, 0x74, 0x68, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, ++ 0x6c, 0x69, 0x65, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, ++ 0x66, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, ++ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, ++ 0x6e, 0x3a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, ++ 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, ++ 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, ++ 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x44, 0x65, ++ 0x70, 0x74, 0x68, 0x77, 0x69, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x20, ++ 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x20, 0x6f, 0x72, ++ 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x64, 0x69, ++ 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x5f, 0x66, 0x61, 0x63, ++ 0x74, 0x6f, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x3b, ++ 0x0a, 0x20, 0x20, 0x64, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, ++ 0x68, 0x5f, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x3a, 0x69, 0x6e, 0x74, ++ 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x43, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x45, 0x6d, 0x62, ++ 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x5f, 0x63, ++ 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x3a, 0x69, 0x6e, 0x74, 0x3b, ++ 0x0a, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, ++ 0x6e, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, ++ 0x65, 0x6c, 0x3a, 0x5b, 0x69, 0x6e, 0x74, 0x5d, 0x3b, 0x0a, 0x20, 0x20, ++ 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x69, ++ 0x6d, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, ++ 0x6c, 0x3a, 0x5b, 0x69, 0x6e, 0x74, 0x5d, 0x3b, 0x20, 0x2f, 0x2f, 0x20, ++ 0x54, 0x68, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, ++ 0x65, 0x20, 0x69, 0x6e, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x20, 0x66, ++ 0x72, 0x6f, 0x6d, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, ++ 0x72, 0x73, 0x2e, 0x0a, 0x7d, 0x0a, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x20, ++ 0x4c, 0x53, 0x48, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, ++ 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x20, ++ 0x3d, 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x50, 0x41, 0x52, 0x53, ++ 0x45, 0x20, 0x3d, 0x20, 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x44, 0x45, 0x4e, ++ 0x53, 0x45, 0x20, 0x3d, 0x20, 0x32, 0x2c, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, ++ 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4c, 0x53, 0x48, 0x50, 0x72, 0x6f, 0x6a, ++ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, ++ 0x4c, 0x53, 0x48, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, ++ 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, ++ 0x62, 0x6c, 0x65, 0x20, 0x53, 0x56, 0x44, 0x46, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x72, 0x61, 0x6e, 0x6b, ++ 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x75, 0x73, 0x65, ++ 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, ++ 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x41, 0x63, ++ 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, ++ 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x77, 0x65, 0x69, 0x67, 0x68, ++ 0x74, 0x73, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x71, 0x75, 0x61, 0x6e, ++ 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x75, 0x73, ++ 0x65, 0x20, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, ++ 0x20, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, ++ 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x6e, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, ++ 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x20, 0x61, 0x74, 0x20, 0x65, 0x76, ++ 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x69, 0x6d, ++ 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, ++ 0x72, 0x69, 0x63, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, ++ 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, ++ 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x20, 0x69, ++ 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, ++ 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x46, ++ 0x6c, 0x6f, 0x77, 0x20, 0x52, 0x4e, 0x4e, 0x43, 0x65, 0x6c, 0x6c, 0x2e, ++ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x52, 0x4e, 0x4e, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x75, ++ 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, ++ 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x75, ++ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, ++ 0x20, 0x20, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, ++ 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, 0x5f, 0x69, 0x6e, ++ 0x70, 0x75, 0x74, 0x73, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x7d, ++ 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x20, 0x69, 0x6d, 0x70, 0x6c, ++ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, ++ 0x66, 0x20, 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x46, 0x6c, 0x6f, 0x77, ++ 0x20, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x72, 0x6e, 0x6e, ++ 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x52, 0x4e, 0x4e, 0x43, 0x65, 0x6c, ++ 0x6c, 0x2e, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x65, 0x71, ++ 0x75, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x4e, 0x4e, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, ++ 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, ++ 0x0a, 0x20, 0x20, 0x66, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, ++ 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, ++ 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, ++ 0x69, 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, ++ 0x79, 0x70, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x61, 0x73, 0x79, 0x6d, 0x6d, ++ 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, ++ 0x7a, 0x65, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x62, 0x6f, ++ 0x6f, 0x6c, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x6e, ++ 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, ++ 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x54, 0x65, 0x6e, 0x73, 0x6f, ++ 0x72, 0x46, 0x6c, 0x6f, 0x77, 0x20, 0x62, 0x69, 0x64, 0x72, 0x65, 0x63, ++ 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x79, 0x6e, 0x61, 0x6d, ++ 0x69, 0x63, 0x5f, 0x72, 0x6e, 0x6e, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, ++ 0x52, 0x4e, 0x4e, 0x43, 0x65, 0x6c, 0x6c, 0x2e, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x42, 0x69, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, ++ 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, ++ 0x52, 0x4e, 0x4e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, ++ 0x72, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x75, ++ 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, ++ 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x75, ++ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, ++ 0x20, 0x20, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x5f, 0x6f, 0x75, 0x74, 0x70, ++ 0x75, 0x74, 0x73, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, ++ 0x20, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, ++ 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, 0x5f, 0x69, 0x6e, 0x70, ++ 0x75, 0x74, 0x73, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4e, 0x54, 0x2e, 0x49, 0x66, 0x43, ++ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x46, ++ 0x75, 0x6c, 0x6c, 0x79, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, ++ 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x57, 0x65, 0x69, 0x67, ++ 0x68, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3a, 0x20, 0x62, ++ 0x79, 0x74, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x44, 0x45, 0x46, 0x41, ++ 0x55, 0x4c, 0x54, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x53, ++ 0x48, 0x55, 0x46, 0x46, 0x4c, 0x45, 0x44, 0x34, 0x78, 0x31, 0x36, 0x49, ++ 0x4e, 0x54, 0x38, 0x20, 0x3d, 0x20, 0x31, 0x2c, 0x0a, 0x7d, 0x0a, 0x2f, ++ 0x2f, 0x20, 0x4c, 0x49, 0x4e, 0x54, 0x2e, 0x54, 0x68, 0x65, 0x6e, 0x43, ++ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x2f, 0x2f, 0x74, 0x65, 0x6e, 0x73, ++ 0x6f, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x69, ++ 0x6c, 0x65, 0x72, 0x2f, 0x6d, 0x6c, 0x69, 0x72, 0x2f, 0x6c, 0x69, 0x74, ++ 0x65, 0x2f, 0x69, 0x72, 0x2f, 0x74, 0x66, 0x6c, 0x5f, 0x6f, 0x70, 0x5f, ++ 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x74, 0x64, 0x29, 0x0a, 0x0a, 0x2f, ++ 0x2f, 0x20, 0x41, 0x6e, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, ++ 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x54, ++ 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x46, 0x6c, 0x6f, 0x77, 0x20, 0x66, 0x75, ++ 0x6c, 0x6c, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, ++ 0x64, 0x20, 0x28, 0x61, 0x2e, 0x6b, 0x2e, 0x61, 0x20, 0x44, 0x65, 0x6e, ++ 0x73, 0x65, 0x29, 0x20, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x0a, 0x74, ++ 0x61, 0x62, 0x6c, 0x65, 0x20, 0x46, 0x75, 0x6c, 0x6c, 0x79, 0x43, 0x6f, ++ 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, ++ 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, ++ 0x20, 0x46, 0x75, 0x6c, 0x6c, 0x79, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, ++ 0x74, 0x65, 0x64, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, ++ 0x31, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, ++ 0x20, 0x20, 0x66, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, ++ 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, ++ 0x69, 0x6f, 0x6e, 0x3a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, ++ 0x70, 0x65, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, ++ 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, ++ 0x20, 0x46, 0x75, 0x6c, 0x6c, 0x79, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, ++ 0x74, 0x65, 0x64, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, ++ 0x32, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, ++ 0x20, 0x20, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5f, 0x66, 0x6f, ++ 0x72, 0x6d, 0x61, 0x74, 0x3a, 0x46, 0x75, 0x6c, 0x6c, 0x79, 0x43, 0x6f, ++ 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x46, 0x6f, 0x72, ++ 0x6d, 0x61, 0x74, 0x20, 0x3d, 0x20, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, ++ 0x54, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, ++ 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, ++ 0x46, 0x75, 0x6c, 0x6c, 0x79, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, ++ 0x65, 0x64, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x35, ++ 0x20, 0x6f, 0x72, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, ++ 0x6f, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, ++ 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, ++ 0x6f, 0x66, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, ++ 0x20, 0x69, 0x73, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, ++ 0x64, 0x2e, 0x20, 0x46, 0x75, 0x72, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x6f, ++ 0x72, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x6c, 0x6c, ++ 0x20, 0x62, 0x75, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x73, ++ 0x74, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, ++ 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, ++ 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, ++ 0x73, 0x68, 0x61, 0x70, 0x65, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, ++ 0x62, 0x65, 0x20, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x2e, 0x0a, 0x20, 0x20, ++ 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x64, 0x69, 0x6d, ++ 0x73, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, ++ 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x46, 0x75, 0x6c, 0x6c, 0x79, 0x43, ++ 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x76, 0x65, 0x72, ++ 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x37, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x62, ++ 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, ++ 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x72, 0x75, 0x65, ++ 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x77, 0x65, 0x69, 0x67, 0x68, ++ 0x74, 0x73, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x6f, 0x70, 0x20, 0x77, ++ 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x61, 0x73, 0x79, 0x6d, ++ 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x20, 0x71, 0x75, 0x61, 0x6e, 0x74, ++ 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x0a, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x2e, ++ 0x0a, 0x20, 0x20, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, ++ 0x63, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, 0x5f, 0x69, ++ 0x6e, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x6f, ++ 0x66, 0x74, 0x6d, 0x61, 0x78, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x62, 0x65, 0x74, 0x61, 0x3a, 0x20, 0x66, ++ 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, ++ 0x41, 0x6e, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, ++ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x54, 0x65, 0x6e, ++ 0x73, 0x6f, 0x72, 0x46, 0x6c, 0x6f, 0x77, 0x20, 0x63, 0x6f, 0x6e, 0x63, ++ 0x61, 0x74, 0x2e, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x43, 0x6f, ++ 0x6e, 0x63, 0x61, 0x74, 0x65, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x61, ++ 0x78, 0x69, 0x73, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x66, ++ 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, ++ 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, ++ 0x3a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, ++ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x41, 0x64, ++ 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, ++ 0x20, 0x66, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, ++ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, ++ 0x6f, 0x6e, 0x3a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, ++ 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, ++ 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, ++ 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, ++ 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x76, 0x65, 0x72, 0x73, ++ 0x69, 0x6f, 0x6e, 0x20, 0x33, 0x2e, 0x0a, 0x20, 0x20, 0x70, 0x6f, 0x74, ++ 0x5f, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x31, 0x36, ++ 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, ++ 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4d, ++ 0x75, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x20, 0x20, 0x66, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, ++ 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, ++ 0x69, 0x6f, 0x6e, 0x3a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, ++ 0x70, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x4c, 0x32, 0x4e, 0x6f, 0x72, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, ++ 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, ++ 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x69, 0x67, ++ 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, ++ 0x20, 0x4c, 0x32, 0x20, 0x4e, 0x6f, 0x72, 0x6d, 0x20, 0x4f, 0x70, 0x2e, ++ 0x0a, 0x20, 0x20, 0x66, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, ++ 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, ++ 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, ++ 0x69, 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, ++ 0x79, 0x70, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, ++ 0x65, 0x20, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, ++ 0x6e, 0x73, 0x65, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x61, ++ 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x69, ++ 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x62, 0x69, 0x61, 0x73, 0x3a, 0x66, ++ 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x61, 0x6c, 0x70, 0x68, ++ 0x61, 0x3a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x62, ++ 0x65, 0x74, 0x61, 0x3a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x7d, ++ 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4e, 0x54, 0x2e, 0x49, 0x66, ++ 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x20, ++ 0x4c, 0x53, 0x54, 0x4d, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x54, 0x79, ++ 0x70, 0x65, 0x20, 0x3a, 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, 0x7b, 0x0a, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x75, 0x6c, 0x6c, 0x20, 0x4c, 0x53, ++ 0x54, 0x4d, 0x20, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x20, 0x77, 0x68, ++ 0x69, 0x63, 0x68, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, ++ 0x20, 0x70, 0x65, 0x65, 0x70, 0x68, 0x6f, 0x6c, 0x65, 0x20, 0x61, 0x6e, ++ 0x64, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, ++ 0x2e, 0x0a, 0x20, 0x20, 0x46, 0x55, 0x4c, 0x4c, 0x20, 0x3d, 0x20, 0x30, ++ 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, ++ 0x20, 0x4c, 0x53, 0x54, 0x4d, 0x20, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, ++ 0x73, 0x2e, 0x20, 0x45, 0x71, 0x75, 0x69, 0x76, 0x61, 0x6c, 0x65, 0x6e, ++ 0x74, 0x20, 0x74, 0x6f, 0x20, 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x46, ++ 0x6c, 0x6f, 0x77, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x4c, 0x53, 0x54, ++ 0x4d, 0x43, 0x65, 0x6c, 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x42, 0x41, 0x53, ++ 0x49, 0x43, 0x20, 0x3d, 0x20, 0x31, 0x2c, 0x0a, 0x7d, 0x0a, 0x2f, 0x2f, ++ 0x20, 0x4c, 0x49, 0x4e, 0x54, 0x2e, 0x54, 0x68, 0x65, 0x6e, 0x43, 0x68, ++ 0x61, 0x6e, 0x67, 0x65, 0x28, 0x2f, 0x2f, 0x74, 0x65, 0x6e, 0x73, 0x6f, ++ 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, ++ 0x65, 0x72, 0x2f, 0x6d, 0x6c, 0x69, 0x72, 0x2f, 0x6c, 0x69, 0x74, 0x65, ++ 0x2f, 0x69, 0x72, 0x2f, 0x74, 0x66, 0x6c, 0x5f, 0x6f, 0x70, 0x5f, 0x65, ++ 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x74, 0x64, 0x29, 0x0a, 0x0a, 0x2f, 0x2f, ++ 0x20, 0x41, 0x6e, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, ++ 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x54, 0x65, ++ 0x6e, 0x73, 0x6f, 0x72, 0x46, 0x6c, 0x6f, 0x77, 0x20, 0x4c, 0x53, 0x54, ++ 0x4d, 0x43, 0x65, 0x6c, 0x6c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x43, 0x6f, ++ 0x75, 0x70, 0x6c, 0x65, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x6f, ++ 0x72, 0x67, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, 0x4c, 0x53, 0x54, 0x4d, ++ 0x43, 0x65, 0x6c, 0x6c, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4c, ++ 0x53, 0x54, 0x4d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, ++ 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x4c, 0x53, 0x54, ++ 0x4d, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x20, ++ 0x6f, 0x72, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, ++ 0x66, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, ++ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, ++ 0x6e, 0x3a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, ++ 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, ++ 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x65, 0x6c, 0x6c, 0x5f, 0x63, 0x6c, 0x69, ++ 0x70, 0x3a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x20, 0x2f, 0x2f, ++ 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2c, 0x20, 0x30, ++ 0x2e, 0x30, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x20, 0x6e, 0x6f, 0x20, ++ 0x63, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x70, ++ 0x72, 0x6f, 0x6a, 0x5f, 0x63, 0x6c, 0x69, 0x70, 0x3a, 0x20, 0x66, 0x6c, ++ 0x6f, 0x61, 0x74, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x61, 0x6c, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x20, 0x6d, 0x65, ++ 0x61, 0x6e, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x63, 0x6c, 0x69, 0x70, 0x70, ++ 0x69, 0x6e, 0x67, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, ++ 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, ++ 0x20, 0x4c, 0x53, 0x54, 0x4d, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, ++ 0x6e, 0x20, 0x32, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, ++ 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, ++ 0x20, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x20, 0x69, 0x73, 0x20, 0x6f, ++ 0x6e, 0x6c, 0x79, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, ++ 0x64, 0x20, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, ++ 0x20, 0x32, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, ++ 0x0a, 0x20, 0x20, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x74, 0x79, ++ 0x70, 0x65, 0x3a, 0x20, 0x4c, 0x53, 0x54, 0x4d, 0x4b, 0x65, 0x72, 0x6e, ++ 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x46, 0x55, 0x4c, ++ 0x4c, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, ++ 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, ++ 0x4c, 0x53, 0x54, 0x4d, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, ++ 0x20, 0x34, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, ++ 0x0a, 0x20, 0x20, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, ++ 0x63, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, 0x5f, 0x69, ++ 0x6e, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x20, 0x69, 0x6d, ++ 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, ++ 0x20, 0x6f, 0x66, 0x20, 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x46, 0x6c, ++ 0x6f, 0x77, 0x20, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x72, ++ 0x6e, 0x6e, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x4c, 0x53, 0x54, 0x4d, ++ 0x43, 0x65, 0x6c, 0x6c, 0x2e, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x55, 0x6e, 0x69, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, ++ 0x61, 0x6c, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4c, 0x53, ++ 0x54, 0x4d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x20, 0x20, 0x66, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x74, 0x69, ++ 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, ++ 0x69, 0x6f, 0x6e, 0x3a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, ++ 0x70, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x65, 0x6c, 0x6c, 0x5f, 0x63, ++ 0x6c, 0x69, 0x70, 0x3a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x20, ++ 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2c, ++ 0x20, 0x30, 0x2e, 0x30, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x20, 0x6e, ++ 0x6f, 0x20, 0x63, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x0a, 0x20, ++ 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x5f, 0x63, 0x6c, 0x69, 0x70, 0x3a, 0x20, ++ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x20, ++ 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x63, 0x6c, 0x69, ++ 0x70, 0x70, 0x69, 0x6e, 0x67, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, ++ 0x49, 0x66, 0x20, 0x74, 0x72, 0x75, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, ++ 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, ++ 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x73, 0x65, 0x71, 0x75, ++ 0x65, 0x6e, 0x63, 0x65, 0x2c, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, ++ 0x69, 0x73, 0x65, 0x20, 0x62, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x0a, 0x20, ++ 0x20, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x3a, ++ 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, ++ 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x20, 0x66, 0x6f, ++ 0x72, 0x20, 0x55, 0x6e, 0x69, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, ++ 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, ++ 0x65, 0x20, 0x4c, 0x53, 0x54, 0x4d, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, ++ 0x6f, 0x6e, 0x20, 0x34, 0x2e, 0x0a, 0x20, 0x20, 0x61, 0x73, 0x79, 0x6d, ++ 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, ++ 0x69, 0x7a, 0x65, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x62, ++ 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, ++ 0x65, 0x20, 0x42, 0x69, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, ++ 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x4c, ++ 0x53, 0x54, 0x4d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, ++ 0x74, 0x65, 0x72, 0x73, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, ++ 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, ++ 0x6e, 0x20, 0x31, 0x3a, 0x0a, 0x20, 0x20, 0x66, 0x75, 0x73, 0x65, 0x64, ++ 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, ++ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x41, 0x63, 0x74, ++ 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, ++ 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x63, ++ 0x65, 0x6c, 0x6c, 0x5f, 0x63, 0x6c, 0x69, 0x70, 0x3a, 0x20, 0x66, 0x6c, ++ 0x6f, 0x61, 0x74, 0x3b, 0x20, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x61, 0x6c, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x20, 0x6d, 0x65, ++ 0x61, 0x6e, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x63, 0x6c, 0x69, 0x70, 0x70, ++ 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x5f, 0x63, ++ 0x6c, 0x69, 0x70, 0x3a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x20, ++ 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2c, ++ 0x20, 0x30, 0x2e, 0x30, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x20, 0x6e, ++ 0x6f, 0x20, 0x63, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x0a, 0x0a, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x74, 0x72, 0x75, 0x65, ++ 0x2c, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x62, ++ 0x6f, 0x74, 0x68, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, ++ 0x2e, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x5f, 0x6f, 0x75, ++ 0x74, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, ++ 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, ++ 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, ++ 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, ++ 0x6f, 0x6e, 0x20, 0x32, 0x3a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, ++ 0x66, 0x20, 0x74, 0x72, 0x75, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, ++ 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x64, 0x69, 0x6d, 0x65, 0x6e, 0x73, ++ 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x73, 0x65, 0x71, 0x75, 0x65, ++ 0x6e, 0x63, 0x65, 0x2c, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, ++ 0x73, 0x65, 0x20, 0x62, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, ++ 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x64, ++ 0x20, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, ++ 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, ++ 0x73, 0x6f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x64, 0x65, 0x66, 0x61, ++ 0x75, 0x6c, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x76, 0x61, 0x6c, ++ 0x75, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, 0x65, ++ 0x76, 0x65, 0x72, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x0a, ++ 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x61, 0x6a, 0x6f, 0x72, ++ 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, ++ 0x65, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, ++ 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, ++ 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x33, 0x20, 0x6f, 0x72, ++ 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x61, 0x73, ++ 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x71, 0x75, 0x61, ++ 0x6e, 0x74, 0x69, 0x7a, 0x65, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, ++ 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, ++ 0x62, 0x6c, 0x65, 0x20, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x69, ++ 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6e, 0x65, 0x77, 0x5f, 0x68, 0x65, ++ 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x28, 0x64, ++ 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x29, 0x3b, 0x0a, ++ 0x20, 0x20, 0x6e, 0x65, 0x77, 0x5f, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, ++ 0x20, 0x69, 0x6e, 0x74, 0x20, 0x28, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, ++ 0x61, 0x74, 0x65, 0x64, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x61, 0x6c, 0x69, ++ 0x67, 0x6e, 0x5f, 0x63, 0x6f, 0x72, 0x6e, 0x65, 0x72, 0x73, 0x3a, 0x20, ++ 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, ++ 0x5f, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x65, ++ 0x72, 0x73, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x52, 0x65, 0x73, 0x69, 0x7a, ++ 0x65, 0x4e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x69, 0x67, ++ 0x68, 0x62, 0x6f, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x5f, 0x63, 0x6f, ++ 0x72, 0x6e, 0x65, 0x72, 0x73, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, ++ 0x0a, 0x20, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x5f, 0x70, 0x69, 0x78, 0x65, ++ 0x6c, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x20, 0x62, ++ 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, ++ 0x20, 0x63, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, ++ 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x43, 0x61, 0x6c, 0x6c, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, ++ 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, ++ 0x68, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x74, 0x68, 0x61, 0x74, ++ 0x20, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, ++ 0x20, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x73, ++ 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3a, 0x75, 0x69, 0x6e, 0x74, ++ 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x50, ++ 0x61, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x50, 0x61, 0x64, ++ 0x56, 0x32, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x52, 0x65, 0x73, ++ 0x68, 0x61, 0x70, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x68, 0x61, 0x70, ++ 0x65, 0x3a, 0x5b, 0x69, 0x6e, 0x74, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x70, 0x61, 0x63, 0x65, 0x54, ++ 0x6f, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x44, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, 0x6f, 0x53, 0x70, ++ 0x61, 0x63, 0x65, 0x4e, 0x44, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x53, 0x6b, 0x69, 0x70, 0x47, 0x72, 0x61, 0x6d, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6e, 0x67, 0x72, 0x61, ++ 0x6d, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x3b, ++ 0x0a, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x5f, ++ 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, ++ 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x61, 0x6c, 0x6c, ++ 0x5f, 0x6e, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x20, 0x62, 0x6f, 0x6f, ++ 0x6c, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x53, 0x70, 0x61, 0x63, 0x65, 0x54, 0x6f, 0x44, 0x65, 0x70, 0x74, 0x68, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, ++ 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, ++ 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, ++ 0x65, 0x20, 0x44, 0x65, 0x70, 0x74, 0x68, 0x54, 0x6f, 0x53, 0x70, 0x61, ++ 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x20, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x69, 0x7a, 0x65, ++ 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, ++ 0x62, 0x6c, 0x65, 0x20, 0x53, 0x75, 0x62, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x75, 0x73, 0x65, 0x64, ++ 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, ++ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x41, 0x63, 0x74, ++ 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, ++ 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x2f, ++ 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, ++ 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, ++ 0x79, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x35, 0x0a, ++ 0x20, 0x20, 0x70, 0x6f, 0x74, 0x5f, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x5f, ++ 0x69, 0x6e, 0x74, 0x31, 0x36, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x3d, ++ 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, ++ 0x62, 0x6c, 0x65, 0x20, 0x44, 0x69, 0x76, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x75, 0x73, 0x65, 0x64, ++ 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, ++ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x41, 0x63, 0x74, ++ 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x75, 0x6e, 0x63, 0x74, ++ 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x54, 0x6f, 0x70, 0x4b, 0x56, 0x32, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, ++ 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x20, 0x3a, 0x20, 0x62, 0x79, 0x74, ++ 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x53, 0x55, 0x4d, 0x20, 0x3d, 0x20, ++ 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x4d, 0x45, 0x41, 0x4e, 0x20, 0x3d, 0x20, ++ 0x31, 0x2c, 0x0a, 0x20, 0x20, 0x53, 0x51, 0x52, 0x54, 0x4e, 0x20, 0x3d, ++ 0x20, 0x32, 0x2c, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x4c, 0x6f, ++ 0x6f, 0x6b, 0x75, 0x70, 0x53, 0x70, 0x61, 0x72, 0x73, 0x65, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x63, 0x6f, ++ 0x6d, 0x62, 0x69, 0x6e, 0x65, 0x72, 0x3a, 0x43, 0x6f, 0x6d, 0x62, 0x69, ++ 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x47, 0x61, 0x74, 0x68, 0x65, 0x72, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, ++ 0x61, 0x78, 0x69, 0x73, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, ++ 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x47, 0x61, 0x74, 0x68, 0x65, ++ 0x72, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x35, 0x20, ++ 0x6f, 0x72, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, ++ 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x64, 0x69, 0x6d, 0x73, 0x3a, 0x20, ++ 0x69, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, ++ 0x6f, 0x73, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x45, 0x78, ++ 0x70, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, ++ 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x43, 0x6f, 0x73, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x52, 0x65, 0x64, 0x75, 0x63, 0x65, ++ 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, ++ 0x20, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x64, 0x69, 0x6d, 0x73, 0x3a, 0x20, ++ 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x53, 0x71, 0x75, 0x65, 0x65, 0x7a, 0x65, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x73, 0x71, ++ 0x75, 0x65, 0x65, 0x7a, 0x65, 0x5f, 0x64, 0x69, 0x6d, 0x73, 0x3a, 0x5b, ++ 0x69, 0x6e, 0x74, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x5f, ++ 0x73, 0x70, 0x6c, 0x69, 0x74, 0x73, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x3b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x70, ++ 0x6c, 0x69, 0x74, 0x56, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x70, 0x6c, 0x69, ++ 0x74, 0x73, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x74, 0x72, 0x69, 0x64, 0x65, ++ 0x64, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, ++ 0x6d, 0x61, 0x73, 0x6b, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, ++ 0x20, 0x65, 0x6e, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x3a, 0x20, 0x69, ++ 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x6c, 0x6c, 0x69, 0x70, 0x73, ++ 0x69, 0x73, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x3a, 0x20, 0x69, 0x6e, 0x74, ++ 0x3b, 0x0a, 0x20, 0x20, 0x6e, 0x65, 0x77, 0x5f, 0x61, 0x78, 0x69, 0x73, ++ 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x3b, 0x0a, ++ 0x20, 0x20, 0x73, 0x68, 0x72, 0x69, 0x6e, 0x6b, 0x5f, 0x61, 0x78, 0x69, ++ 0x73, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x3b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4c, 0x6f, ++ 0x67, 0x53, 0x6f, 0x66, 0x74, 0x6d, 0x61, 0x78, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x43, 0x61, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x5f, 0x64, 0x61, ++ 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x54, 0x65, 0x6e, ++ 0x73, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x6f, ++ 0x75, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, ++ 0x3a, 0x20, 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, ++ 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x44, ++ 0x65, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, ++ 0x62, 0x6c, 0x65, 0x20, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x4d, ++ 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x54, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x41, 0x72, 0x67, 0x4d, 0x61, 0x78, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, ++ 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3a, 0x20, 0x54, 0x65, 0x6e, 0x73, ++ 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, ++ 0x61, 0x62, 0x6c, 0x65, 0x20, 0x41, 0x72, 0x67, 0x4d, 0x69, 0x6e, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, ++ 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3a, ++ 0x20, 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x3b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x47, 0x72, ++ 0x65, 0x61, 0x74, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x47, 0x72, 0x65, 0x61, 0x74, 0x65, 0x72, 0x45, 0x71, 0x75, 0x61, 0x6c, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4c, 0x65, 0x73, 0x73, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4c, 0x65, 0x73, 0x73, 0x45, 0x71, ++ 0x75, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4e, 0x65, ++ 0x67, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, ++ 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x65, 0x6c, 0x65, ++ 0x63, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x6c, 0x69, ++ 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x54, 0x72, 0x61, ++ 0x6e, 0x73, 0x70, 0x6f, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x76, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x70, 0x61, ++ 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x50, 0x61, 0x64, 0x64, 0x69, 0x6e, ++ 0x67, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x64, 0x65, 0x5f, ++ 0x77, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, ++ 0x69, 0x64, 0x65, 0x5f, 0x68, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x7d, ++ 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x45, 0x78, 0x70, 0x61, ++ 0x6e, 0x64, 0x44, 0x69, 0x6d, 0x73, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x53, 0x70, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x44, 0x65, 0x6e, ++ 0x73, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x20, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, ++ 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x45, 0x71, ++ 0x75, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4e, 0x6f, ++ 0x74, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x53, 0x68, 0x61, 0x70, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, ++ 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, ++ 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, ++ 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x74, ++ 0x36, 0x34, 0x29, 0x2e, 0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, ++ 0x73, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x2e, 0x0a, ++ 0x20, 0x20, 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3a, ++ 0x20, 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x3b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x52, 0x61, ++ 0x6e, 0x6b, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x50, 0x6f, 0x77, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x46, 0x61, 0x6b, 0x65, 0x51, ++ 0x75, 0x61, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, ++ 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, ++ 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, ++ 0x6f, 0x6e, 0x20, 0x31, 0x3a, 0x0a, 0x20, 0x20, 0x6d, 0x69, 0x6e, 0x3a, ++ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x61, 0x78, ++ 0x3a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x6e, 0x75, ++ 0x6d, 0x5f, 0x62, 0x69, 0x74, 0x73, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, ++ 0x74, 0x65, 0x72, 0x73, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, ++ 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, ++ 0x6e, 0x20, 0x32, 0x3a, 0x0a, 0x20, 0x20, 0x6e, 0x61, 0x72, 0x72, 0x6f, ++ 0x77, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, ++ 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x50, ++ 0x61, 0x63, 0x6b, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x20, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x5f, 0x63, 0x6f, ++ 0x75, 0x6e, 0x74, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x61, ++ 0x78, 0x69, 0x73, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x61, ++ 0x6c, 0x4f, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4f, 0x6e, ++ 0x65, 0x48, 0x6f, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x61, 0x78, 0x69, 0x73, 0x3a, 0x69, 0x6e, 0x74, ++ 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x41, ++ 0x62, 0x73, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x48, 0x61, ++ 0x72, 0x64, 0x53, 0x77, 0x69, 0x73, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, ++ 0x65, 0x20, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x41, 0x6e, 0x64, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4c, 0x6f, 0x67, 0x69, 0x63, ++ 0x61, 0x6c, 0x4e, 0x6f, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x55, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x3a, 0x69, 0x6e, ++ 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x61, 0x78, 0x69, 0x73, 0x3a, 0x69, 0x6e, ++ 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x44, 0x69, 0x76, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x53, 0x71, 0x75, 0x61, 0x72, 0x65, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, ++ 0x62, 0x6c, 0x65, 0x20, 0x5a, 0x65, 0x72, 0x6f, 0x73, 0x4c, 0x69, 0x6b, ++ 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, ++ 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x46, 0x69, 0x6c, 0x6c, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x46, 0x6c, 0x6f, 0x6f, 0x72, ++ 0x4d, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x52, 0x61, ++ 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4c, 0x65, ++ 0x61, 0x6b, 0x79, 0x52, 0x65, 0x6c, 0x75, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, ++ 0x3a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, ++ 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x71, 0x75, 0x61, 0x72, 0x65, 0x64, ++ 0x44, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, ++ 0x2f, 0x20, 0x4c, 0x49, 0x4e, 0x54, 0x2e, 0x49, 0x66, 0x43, 0x68, 0x61, ++ 0x6e, 0x67, 0x65, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x4d, 0x69, 0x72, ++ 0x72, 0x6f, 0x72, 0x50, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x20, 0x3a, ++ 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, ++ 0x20, 0x44, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x69, 0x6e, 0x63, ++ 0x6c, 0x75, 0x64, 0x65, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, ++ 0x2e, 0x0a, 0x20, 0x20, 0x52, 0x45, 0x46, 0x4c, 0x45, 0x43, 0x54, 0x20, ++ 0x3d, 0x20, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, ++ 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, ++ 0x72, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x53, 0x59, 0x4d, 0x4d, 0x45, 0x54, ++ 0x52, 0x49, 0x43, 0x20, 0x3d, 0x20, 0x31, 0x2c, 0x0a, 0x7d, 0x0a, 0x2f, ++ 0x2f, 0x20, 0x4c, 0x49, 0x4e, 0x54, 0x2e, 0x54, 0x68, 0x65, 0x6e, 0x43, ++ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x2f, 0x2f, 0x74, 0x65, 0x6e, 0x73, ++ 0x6f, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x69, ++ 0x6c, 0x65, 0x72, 0x2f, 0x6d, 0x6c, 0x69, 0x72, 0x2f, 0x6c, 0x69, 0x74, ++ 0x65, 0x2f, 0x69, 0x72, 0x2f, 0x74, 0x66, 0x6c, 0x5f, 0x6f, 0x70, 0x5f, ++ 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x74, 0x64, 0x29, 0x0a, 0x0a, 0x74, ++ 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4d, 0x69, 0x72, 0x72, 0x6f, 0x72, 0x50, ++ 0x61, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x20, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x3a, 0x4d, 0x69, 0x72, 0x72, 0x6f, ++ 0x72, 0x50, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x55, 0x6e, 0x69, 0x71, 0x75, ++ 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, ++ 0x20, 0x69, 0x64, 0x78, 0x5f, 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, ++ 0x65, 0x3a, 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, ++ 0x20, 0x3d, 0x20, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x52, 0x65, 0x76, 0x65, 0x72, ++ 0x73, 0x65, 0x56, 0x32, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x41, ++ 0x64, 0x64, 0x4e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x47, 0x61, ++ 0x74, 0x68, 0x65, 0x72, 0x4e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x57, 0x68, 0x65, 0x72, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x53, 0x65, 0x71, 0x75, ++ 0x65, 0x6e, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x73, 0x65, 0x71, 0x5f, 0x64, 0x69, 0x6d, 0x3a, ++ 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x62, 0x61, 0x74, 0x63, 0x68, ++ 0x5f, 0x64, 0x69, 0x6d, 0x3a, 0x69, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x30, ++ 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4d, ++ 0x61, 0x74, 0x72, 0x69, 0x78, 0x44, 0x69, 0x61, 0x67, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, ++ 0x62, 0x6c, 0x65, 0x20, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4d, 0x61, 0x74, 0x72, 0x69, ++ 0x78, 0x53, 0x65, 0x74, 0x44, 0x69, 0x61, 0x67, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x49, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x5f, 0x73, 0x75, ++ 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, ++ 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, ++ 0x5f, 0x73, 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x5f, 0x69, 0x6e, ++ 0x64, 0x65, 0x78, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x43, 0x61, 0x6c, 0x6c, 0x4f, 0x6e, ++ 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, ++ 0x20, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x73, 0x75, 0x62, 0x67, 0x72, ++ 0x61, 0x70, 0x68, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x69, 0x6e, ++ 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x57, 0x68, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x73, 0x75, ++ 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, ++ 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x62, 0x6f, 0x64, 0x79, ++ 0x5f, 0x73, 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x5f, 0x69, 0x6e, ++ 0x64, 0x65, 0x78, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4e, 0x6f, 0x6e, 0x4d, 0x61, 0x78, ++ 0x53, 0x75, 0x70, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x56, ++ 0x34, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, ++ 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4e, 0x6f, 0x6e, 0x4d, ++ 0x61, 0x78, 0x53, 0x75, 0x70, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, ++ 0x6e, 0x56, 0x35, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x63, ++ 0x61, 0x74, 0x74, 0x65, 0x72, 0x4e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, ++ 0x65, 0x20, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x56, 0x32, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, ++ 0x61, 0x62, 0x6c, 0x65, 0x20, 0x44, 0x65, 0x6e, 0x73, 0x69, 0x66, 0x79, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x65, 0x67, 0x6d, 0x65, ++ 0x6e, 0x74, 0x53, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x74, 0x4d, 0x75, 0x6c, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x61, ++ 0x64, 0x6a, 0x5f, 0x78, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, ++ 0x20, 0x61, 0x64, 0x6a, 0x5f, 0x79, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, ++ 0x74, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x42, 0x61, 0x74, ++ 0x63, 0x68, 0x4d, 0x61, 0x74, 0x4d, 0x75, 0x6c, 0x20, 0x76, 0x65, 0x72, ++ 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x34, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x62, ++ 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, ++ 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x72, 0x75, 0x65, ++ 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x77, 0x65, 0x69, 0x67, 0x68, ++ 0x74, 0x73, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x6f, 0x70, 0x20, 0x77, ++ 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x61, 0x73, 0x79, 0x6d, ++ 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x20, 0x71, 0x75, 0x61, 0x6e, 0x74, ++ 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x0a, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x2e, ++ 0x0a, 0x20, 0x20, 0x61, 0x73, 0x79, 0x6d, 0x6d, 0x65, 0x74, 0x72, 0x69, ++ 0x63, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x7a, 0x65, 0x5f, 0x69, ++ 0x6e, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x43, 0x75, ++ 0x6d, 0x73, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, ++ 0x65, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, ++ 0x76, 0x65, 0x72, 0x73, 0x65, 0x3a, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x42, 0x72, 0x6f, ++ 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x6f, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x52, 0x66, 0x66, 0x74, 0x32, 0x64, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, ++ 0x62, 0x6c, 0x65, 0x20, 0x48, 0x61, 0x73, 0x68, 0x74, 0x61, 0x62, 0x6c, ++ 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x69, 0x64, 0x65, 0x6e, ++ 0x74, 0x69, 0x74, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x68, 0x61, 0x73, 0x68, ++ 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, 0x20, 0x54, 0x68, 0x69, ++ 0x73, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x20, 0x77, ++ 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, ++ 0x61, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, ++ 0x72, 0x65, 0x6e, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x75, ++ 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, ++ 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, ++ 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x73, 0x74, ++ 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x74, 0x61, 0x62, 0x6c, ++ 0x65, 0x5f, 0x69, 0x64, 0x3a, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x20, 0x20, ++ 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x54, 0x65, ++ 0x6e, 0x73, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, 0x20, 0x20, ++ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x64, 0x74, 0x79, 0x70, 0x65, 0x3a, ++ 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x48, 0x61, 0x73, ++ 0x68, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x64, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, ++ 0x61, 0x62, 0x6c, 0x65, 0x20, 0x48, 0x61, 0x73, 0x68, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, ++ 0x6c, 0x65, 0x20, 0x48, 0x61, 0x73, 0x68, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x53, 0x69, 0x7a, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x56, ++ 0x61, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x63, 0x6f, 0x6e, 0x74, ++ 0x61, 0x69, 0x6e, 0x65, 0x72, 0x3a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, ++ 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x6e, ++ 0x61, 0x6d, 0x65, 0x3a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x52, 0x65, 0x61, ++ 0x64, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x74, ++ 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, ++ 0x62, 0x6c, 0x65, 0x20, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x56, 0x61, ++ 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x73, 0x65, 0x65, 0x64, 0x3a, ++ 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x3b, 0x0a, 0x20, 0x20, 0x73, 0x65, 0x65, ++ 0x64, 0x32, 0x3a, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x3b, 0x0a, 0x7d, 0x0a, ++ 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x42, 0x75, 0x63, 0x6b, 0x65, ++ 0x74, 0x69, 0x7a, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x69, ++ 0x65, 0x73, 0x3a, 0x20, 0x5b, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5d, 0x3b, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x62, 0x75, 0x63, ++ 0x6b, 0x65, 0x74, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x72, 0x69, ++ 0x65, 0x73, 0x2e, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x47, 0x65, 0x6c, 0x75, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, ++ 0x6d, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x3b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x44, 0x79, 0x6e, ++ 0x61, 0x6d, 0x69, 0x63, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6c, ++ 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x55, 0x6e, ++ 0x73, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, ++ 0x74, 0x50, 0x72, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x55, 0x6e, 0x73, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x53, 0x65, 0x67, 0x6d, ++ 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x78, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x55, 0x6e, 0x73, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x53, 0x65, 0x67, ++ 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, ++ 0x65, 0x20, 0x41, 0x54, 0x61, 0x6e, 0x32, 0x4f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x7d, 0x0a, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, ++ 0x41, 0x6e, 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, ++ 0x6f, 0x64, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x61, ++ 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, ++ 0x20, 0x28, 0x42, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x4f, 0x70, 0x65, ++ 0x72, 0x61, 0x74, 0x6f, 0x72, 0x29, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, ++ 0x65, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x69, ++ 0x73, 0x20, 0x61, 0x0a, 0x2f, 0x2f, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x74, ++ 0x69, 0x6e, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x73, 0x74, 0x72, ++ 0x69, 0x6e, 0x67, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, ++ 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x69, 0x73, 0x20, 0x63, ++ 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x2e, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x64, ++ 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, ++ 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x66, ++ 0x6f, 0x72, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, 0x20, ++ 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, ++ 0x79, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, ++ 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, ++ 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, ++ 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6f, ++ 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, ++ 0x65, 0x64, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x5f, 0x63, ++ 0x6f, 0x64, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x68, 0x61, ++ 0x73, 0x20, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x0a, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x42, 0x75, 0x6c, 0x69, 0x74, 0x69, 0x6e, ++ 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x50, 0x4c, 0x41, ++ 0x43, 0x45, 0x48, 0x4f, 0x4c, 0x44, 0x45, 0x52, 0x5f, 0x46, 0x4f, 0x52, ++ 0x5f, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x4f, 0x50, 0x5f, ++ 0x43, 0x4f, 0x44, 0x45, 0x53, 0x2e, 0x0a, 0x20, 0x20, 0x64, 0x65, 0x70, ++ 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x75, 0x69, 0x6c, ++ 0x74, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x3a, 0x62, 0x79, 0x74, ++ 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, ++ 0x63, 0x6f, 0x64, 0x65, 0x3a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3b, ++ 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x76, ++ 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, ++ 0x65, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x20, ++ 0x54, 0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, ++ 0x6e, 0x65, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x62, ++ 0x75, 0x6d, 0x70, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x65, 0x76, ++ 0x65, 0x72, 0x20, 0x6e, 0x65, 0x77, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, ++ 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x20, 0x61, ++ 0x72, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, ++ 0x64, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x20, 0x6f, 0x70, ++ 0x2e, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, ++ 0x69, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, ++ 0x64, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, ++ 0x63, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x73, 0x6f, ++ 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x20, 0x62, 0x75, 0x69, ++ 0x6c, 0x74, 0x69, 0x6e, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x73, 0x68, ++ 0x6f, 0x72, 0x74, 0x61, 0x67, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x6c, ++ 0x65, 0x6d, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x28, 0x74, 0x68, 0x65, ++ 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x42, 0x75, ++ 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, ++ 0x72, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, ++ 0x20, 0x77, 0x61, 0x73, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, ++ 0x6e, 0x74, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x62, 0x79, ++ 0x74, 0x65, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, ++ 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x77, 0x69, 0x6c, ++ 0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x77, 0x68, ++ 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, ++ 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, ++ 0x6e, 0x64, 0x65, 0x64, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, ++ 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x0a, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x68, 0x61, 0x73, 0x20, 0x67, 0x72, 0x65, ++ 0x61, 0x74, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x42, 0x75, ++ 0x6c, 0x69, 0x74, 0x69, 0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, ++ 0x72, 0x5f, 0x50, 0x4c, 0x41, 0x43, 0x45, 0x48, 0x4f, 0x4c, 0x44, 0x45, ++ 0x52, 0x5f, 0x46, 0x4f, 0x52, 0x5f, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, ++ 0x52, 0x5f, 0x4f, 0x50, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x53, 0x2e, 0x0a, ++ 0x20, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x5f, 0x63, 0x6f, ++ 0x64, 0x65, 0x3a, 0x42, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x4f, 0x70, ++ 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x65, ++ 0x6e, 0x75, 0x6d, 0x20, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4f, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, ++ 0x3a, 0x20, 0x62, 0x79, 0x74, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x46, ++ 0x4c, 0x45, 0x58, 0x42, 0x55, 0x46, 0x46, 0x45, 0x52, 0x53, 0x20, 0x3d, ++ 0x20, 0x30, 0x2c, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x6e, ++ 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x74, 0x61, ++ 0x6b, 0x65, 0x73, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x20, ++ 0x61, 0x73, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x20, 0x61, 0x6e, ++ 0x64, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x2e, 0x20, 0x54, ++ 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x6f, ++ 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x65, 0x69, ++ 0x6e, 0x67, 0x0a, 0x2f, 0x2f, 0x20, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, ++ 0x6d, 0x65, 0x64, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x74, 0x65, 0x72, ++ 0x6d, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x6e, 0x20, ++ 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x74, ++ 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x76, ++ 0x61, 0x6c, 0x69, 0x64, 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, ++ 0x72, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x77, ++ 0x68, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, ++ 0x63, 0x69, 0x66, 0x69, 0x63, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x61, ++ 0x63, 0x68, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x20, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, ++ 0x72, 0x65, 0x64, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x62, 0x75, ++ 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x75, 0x73, 0x74, ++ 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, ++ 0x6f, 0x72, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, ++ 0x64, 0x65, 0x78, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, ++ 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, ++ 0x64, 0x65, 0x73, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x20, 0x55, ++ 0x73, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, ++ 0x67, 0x65, 0x72, 0x20, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x76, 0x6f, ++ 0x69, 0x64, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6d, ++ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x6d, 0x61, 0x70, 0x20, ++ 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, ++ 0x70, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, ++ 0x75, 0x69, 0x6e, 0x74, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, ++ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x70, ++ 0x75, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, ++ 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x2d, 0x31, 0x2e, 0x0a, ++ 0x20, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x5b, 0x69, 0x6e, ++ 0x74, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, ++ 0x73, 0x3a, 0x5b, 0x69, 0x6e, 0x74, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, ++ 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, ++ 0x6f, 0x6e, 0x73, 0x3a, 0x42, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x4f, ++ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x0a, 0x20, 0x20, 0x63, 0x75, ++ 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, ++ 0x3a, 0x5b, 0x75, 0x62, 0x79, 0x74, 0x65, 0x5d, 0x3b, 0x0a, 0x20, 0x20, ++ 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, ++ 0x6e, 0x73, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3a, 0x43, 0x75, ++ 0x73, 0x74, 0x6f, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x46, ++ 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, ++ 0x20, 0x41, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x62, ++ 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x64, 0x69, ++ 0x63, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, ++ 0x6e, 0x70, 0x75, 0x74, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, ++ 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x62, ++ 0x65, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x65, 0x64, ++ 0x20, 0x62, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, ++ 0x73, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x28, ++ 0x65, 0x2e, 0x67, 0x2e, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, ++ 0x20, 0x52, 0x4e, 0x4e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x4c, 0x53, 0x54, ++ 0x4d, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, ++ 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x69, 0x66, ++ 0x20, 0x74, 0x68, 0x65, 0x20, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, ++ 0x22, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x72, 0x65, 0x66, 0x65, ++ 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x35, 0x20, 0x74, 0x65, 0x6e, 0x73, ++ 0x6f, 0x72, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x66, 0x74, 0x68, 0x20, 0x61, 0x72, ++ 0x65, 0x20, 0x6d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x76, 0x61, ++ 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x65, ++ 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, ++ 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x5b, 0x66, 0x61, 0x6c, 0x73, 0x65, ++ 0x2c, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, ++ 0x65, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x20, 0x74, 0x72, ++ 0x75, 0x65, 0x5d, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, ++ 0x73, 0x74, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2c, ++ 0x20, 0x6e, 0x6f, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, ++ 0x20, 0x69, 0x73, 0x20, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x65, 0x64, 0x20, ++ 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x65, 0x72, ++ 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, ++ 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x65, 0x69, 0x74, 0x68, ++ 0x65, 0x72, 0x20, 0x68, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, ++ 0x61, 0x6d, 0x65, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x20, 0x61, ++ 0x73, 0x20, 0x60, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x60, 0x2c, 0x20, ++ 0x6f, 0x72, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, ++ 0x0a, 0x20, 0x20, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x5f, ++ 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x70, ++ 0x75, 0x74, 0x73, 0x3a, 0x5b, 0x62, 0x6f, 0x6f, 0x6c, 0x5d, 0x3b, 0x0a, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x6c, 0x69, 0x73, 0x74, ++ 0x20, 0x6f, 0x66, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x20, ++ 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x75, 0x62, 0x67, 0x72, ++ 0x61, 0x70, 0x68, 0x27, 0x73, 0x20, 0x22, 0x74, 0x65, 0x6e, 0x73, 0x6f, ++ 0x72, 0x73, 0x22, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, ++ 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x74, 0x6f, ++ 0x20, 0x61, 0x6e, 0x20, 0x4f, 0x70, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, ++ 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x74, 0x65, ++ 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x74, 0x68, ++ 0x6f, 0x73, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20, ++ 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6c, 0x6f, 0x77, 0x20, 0x69, 0x6e, 0x20, ++ 0x6f, 0x72, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, ++ 0x65, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62, 0x75, 0x74, 0x20, 0x69, 0x6e, ++ 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x61, ++ 0x72, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, ++ 0x61, 0x6c, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x2e, 0x20, 0x41, 0x73, 0x20, 0x73, 0x75, 0x63, 0x68, 0x2c, ++ 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, ++ 0x6f, 0x6e, 0x27, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6d, ++ 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, ++ 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x20, ++ 0x69, 0x74, 0x73, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x6d, ++ 0x6f, 0x72, 0x65, 0x20, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, ++ 0x74, 0x6c, 0x79, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x79, 0x20, 0x61, 0x72, ++ 0x65, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2f, ++ 0x2f, 0x20, 0x68, 0x6f, 0x77, 0x65, 0x76, 0x65, 0x72, 0x20, 0x28, 0x69, ++ 0x2e, 0x65, 0x2e, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6a, 0x75, 0x73, 0x74, ++ 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, ++ 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, ++ 0x6c, 0x29, 0x20, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, ++ 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x61, 0x72, 0x74, 0x20, 0x6f, ++ 0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, ++ 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, ++ 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x72, 0x65, ++ 0x71, 0x75, 0x69, 0x72, 0x65, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, ++ 0x6e, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, ++ 0x73, 0x75, 0x63, 0x68, 0x20, 0x61, 0x73, 0x20, 0x71, 0x75, 0x61, 0x6e, ++ 0x74, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x2f, ++ 0x2f, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, ++ 0x2e, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, ++ 0x69, 0x61, 0x74, 0x65, 0x73, 0x3a, 0x5b, 0x69, 0x6e, 0x74, 0x5d, 0x3b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x72, ++ 0x6f, 0x6f, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x64, 0x65, ++ 0x66, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x73, 0x75, 0x62, ++ 0x67, 0x72, 0x61, 0x70, 0x68, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, ++ 0x20, 0x74, 0x79, 0x70, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x72, ++ 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x6e, ++ 0x20, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, ++ 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, ++ 0x53, 0x75, 0x62, 0x47, 0x72, 0x61, 0x70, 0x68, 0x20, 0x7b, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, ++ 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, ++ 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, ++ 0x69, 0x73, 0x20, 0x73, 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, ++ 0x0a, 0x20, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x3a, 0x5b, ++ 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x20, 0x6f, ++ 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, ++ 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x72, 0x65, 0x20, 0x69, ++ 0x6e, 0x70, 0x75, 0x74, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x74, ++ 0x68, 0x69, 0x73, 0x20, 0x73, 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, ++ 0x2e, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, ++ 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, ++ 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, ++ 0x72, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x66, 0x65, 0x65, 0x64, ++ 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x75, ++ 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, ++ 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x0a, 0x20, 0x20, ++ 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x5b, 0x69, 0x6e, 0x74, 0x5d, ++ 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x64, 0x69, ++ 0x63, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, ++ 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, ++ 0x61, 0x72, 0x65, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x20, ++ 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, ++ 0x73, 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x20, 0x4e, 0x6f, ++ 0x74, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, ++ 0x20, 0x6f, 0x66, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x74, ++ 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, ++ 0x61, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, ++ 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, ++ 0x63, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x73, 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x27, ++ 0x73, 0x20, 0x69, 0x6e, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x2e, ++ 0x0a, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x5b, ++ 0x69, 0x6e, 0x74, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, ++ 0x41, 0x6c, 0x6c, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, ++ 0x73, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, ++ 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x0a, 0x20, ++ 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x3a, 0x5b, ++ 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5d, 0x3b, 0x0a, 0x0a, ++ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, ++ 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x75, 0x62, 0x67, 0x72, 0x61, ++ 0x70, 0x68, 0x20, 0x28, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, ++ 0x20, 0x64, 0x65, 0x62, 0x75, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x29, 0x2e, ++ 0x0a, 0x20, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x73, 0x74, 0x72, 0x69, ++ 0x6e, 0x67, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x61, ++ 0x62, 0x6c, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x72, 0x61, 0x77, 0x20, 0x64, ++ 0x61, 0x74, 0x61, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20, ++ 0x28, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x6f, ++ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, ++ 0x72, 0x73, 0x29, 0x2e, 0x20, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, ++ 0x63, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, ++ 0x72, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x62, 0x79, 0x20, 0x69, 0x6e, 0x64, ++ 0x65, 0x78, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, ++ 0x72, 0x6f, 0x75, 0x73, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x6d, 0x65, ++ 0x6e, 0x74, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x64, 0x61, ++ 0x74, 0x65, 0x73, 0x20, 0x6d, 0x6d, 0x61, 0x70, 0x2d, 0x66, 0x72, 0x69, ++ 0x65, 0x6e, 0x64, 0x6c, 0x79, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x73, ++ 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x0a, 0x74, ++ 0x61, 0x62, 0x6c, 0x65, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, ++ 0x7b, 0x0a, 0x20, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x5b, 0x75, 0x62, ++ 0x79, 0x74, 0x65, 0x5d, 0x20, 0x28, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, ++ 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x20, 0x31, 0x36, 0x29, 0x3b, 0x0a, ++ 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4d, 0x65, 0x74, ++ 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, ++ 0x20, 0x41, 0x20, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x72, 0x65, 0x61, ++ 0x64, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, ++ 0x20, 0x74, 0x6f, 0x20, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x6c, 0x79, ++ 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x79, 0x20, 0x61, 0x20, ++ 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x0a, 0x20, 0x20, ++ 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3b, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x20, 0x69, 0x6e, 0x64, ++ 0x65, 0x78, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x75, ++ 0x66, 0x66, 0x65, 0x72, 0x73, 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, ++ 0x0a, 0x20, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x3a, 0x75, 0x69, ++ 0x6e, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x4d, 0x61, ++ 0x70, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, ++ 0x69, 0x61, 0x73, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, ++ 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x65, ++ 0x6e, 0x73, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x69, ++ 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, ++ 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, ++ 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x53, 0x69, 0x67, 0x6e, ++ 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x64, 0x65, 0x66, 0x2e, 0x0a, 0x74, ++ 0x61, 0x62, 0x6c, 0x65, 0x20, 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x4d, ++ 0x61, 0x70, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x52, 0x65, ++ 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x68, 0x65, ++ 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, ++ 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x74, ++ 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x6e, 0x61, 0x6d, ++ 0x65, 0x3a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3b, 0x0a, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x61, 0x63, 0x74, 0x75, ++ 0x61, 0x6c, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x20, 0x69, 0x6e, ++ 0x64, 0x65, 0x78, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, ++ 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, ++ 0x2c, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x27, 0x6e, 0x61, 0x6d, 0x65, ++ 0x27, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, ++ 0x73, 0x20, 0x74, 0x6f, 0x2e, 0x0a, 0x20, 0x20, 0x74, 0x65, 0x6e, 0x73, ++ 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x75, 0x69, 0x6e, ++ 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, ++ 0x73, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, ++ 0x73, 0x20, 0x74, 0x6f, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, ++ 0x72, 0x65, 0x44, 0x65, 0x66, 0x20, 0x69, 0x6e, 0x20, 0x54, 0x65, 0x6e, ++ 0x73, 0x6f, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x20, 0x53, 0x61, 0x76, 0x65, ++ 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x54, ++ 0x68, 0x65, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, ++ 0x44, 0x65, 0x66, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, ++ 0x70, 0x61, 0x72, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x53, 0x61, 0x76, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x70, ++ 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, ++ 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, ++ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, ++ 0x75, 0x72, 0x65, 0x44, 0x65, 0x66, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, ++ 0x2f, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x70, 0x75, ++ 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, ++ 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x0a, 0x20, ++ 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x5b, 0x54, 0x65, 0x6e, ++ 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, ++ 0x2f, 0x2f, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x20, 0x6f, 0x75, 0x74, ++ 0x70, 0x75, 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x69, ++ 0x73, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, ++ 0x0a, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x3a, 0x5b, ++ 0x54, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x5d, 0x3b, 0x0a, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x76, 0x61, ++ 0x6c, 0x75, 0x65, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x77, 0x61, ++ 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x54, 0x65, 0x6e, ++ 0x73, 0x6f, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x20, 0x53, 0x61, 0x76, 0x65, ++ 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x61, ++ 0x74, 0x75, 0x72, 0x65, 0x44, 0x65, 0x66, 0x20, 0x6d, 0x61, 0x70, 0x2e, ++ 0x0a, 0x20, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, ++ 0x5f, 0x6b, 0x65, 0x79, 0x3a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3b, ++ 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x6c, ++ 0x20, 0x74, 0x61, 0x67, 0x2c, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, ++ 0x61, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x64, 0x65, 0x70, 0x72, ++ 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x61, 0x67, 0x3a, 0x73, ++ 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x28, 0x64, 0x65, 0x70, 0x72, 0x65, ++ 0x63, 0x61, 0x74, 0x65, 0x64, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, ++ 0x2f, 0x20, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x6f, 0x66, 0x20, 0x73, ++ 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x20, 0x74, 0x68, 0x61, ++ 0x74, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, ++ 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x70, ++ 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, ++ 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x75, 0x62, 0x67, 0x72, 0x61, 0x70, 0x68, ++ 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x75, 0x69, 0x6e, 0x74, 0x3b, ++ 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x4d, 0x6f, ++ 0x64, 0x65, 0x6c, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x56, ++ 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, ++ 0x65, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x0a, 0x20, 0x20, ++ 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x75, 0x69, 0x6e, 0x74, ++ 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x6c, 0x69, ++ 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x70, ++ 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x73, ++ 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, ++ 0x73, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x20, 0x54, 0x68, 0x69, ++ 0x73, 0x20, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6b, 0x65, ++ 0x70, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, ++ 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x70, 0x65, 0x72, ++ 0x61, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x63, 0x61, 0x72, 0x72, 0x79, 0x20, ++ 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x69, 0x6e, 0x74, ++ 0x6f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, ++ 0x76, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, ++ 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x73, ++ 0x3a, 0x5b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, ++ 0x64, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, ++ 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x75, 0x62, 0x67, 0x72, ++ 0x61, 0x70, 0x68, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x30, ++ 0x74, 0x68, 0x20, 0x69, 0x73, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, ++ 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, ++ 0x6d, 0x61, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, ++ 0x64, 0x65, 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x75, 0x62, 0x67, 0x72, ++ 0x61, 0x70, 0x68, 0x73, 0x3a, 0x5b, 0x53, 0x75, 0x62, 0x47, 0x72, 0x61, ++ 0x70, 0x68, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, ++ 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x64, 0x65, ++ 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, ++ 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3b, ++ 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, ++ 0x72, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, ++ 0x64, 0x65, 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, ++ 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x30, 0x74, 0x68, 0x20, 0x65, ++ 0x6e, 0x74, 0x72, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, ++ 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, ++ 0x62, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x20, ++ 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x28, 0x73, 0x65, 0x6e, 0x74, ++ 0x69, 0x6e, 0x65, 0x6c, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, ++ 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x63, 0x6f, ++ 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x20, ++ 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, ++ 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x61, 0x20, 0x62, ++ 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x70, 0x72, ++ 0x6f, 0x76, 0x69, 0x64, 0x65, 0x20, 0x30, 0x20, 0x61, 0x73, 0x0a, 0x20, ++ 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x62, 0x75, ++ 0x66, 0x66, 0x65, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x62, 0x75, 0x66, 0x66, ++ 0x65, 0x72, 0x73, 0x3a, 0x5b, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x5d, ++ 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4d, 0x65, 0x74, 0x61, ++ 0x64, 0x61, 0x74, 0x61, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x74, ++ 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x20, 0x49, 0x6e, ++ 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x6f, ++ 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, ++ 0x67, 0x73, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20, 0x6c, ++ 0x69, 0x73, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44, 0x65, ++ 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2c, 0x20, 0x70, 0x72, ++ 0x65, 0x66, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, ++ 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x66, 0x69, 0x65, ++ 0x6c, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, ++ 0x74, 0x61, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x3a, 0x5b, 0x69, ++ 0x6e, 0x74, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4d, ++ 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x61, 0x62, 0x6f, 0x75, ++ 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, ++ 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, ++ 0x5b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5d, 0x3b, 0x0a, ++ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, ++ 0x61, 0x6c, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, ++ 0x44, 0x65, 0x66, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, ++ 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x69, ++ 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x73, ++ 0x3a, 0x5b, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, ++ 0x65, 0x66, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x72, 0x6f, 0x6f, 0x74, ++ 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x3b, ++ 0x0a ++}; ++unsigned int g_TfLiteSchemaText_len = 32101; diff --git a/meta-openeuler/recipes-arm/armnn/armnn_%.bbappend b/meta-openeuler/recipes-arm/armnn/armnn_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..29f8cc38d1c138a8e6c3504b269477380b3a8521 --- /dev/null +++ b/meta-openeuler/recipes-arm/armnn/armnn_%.bbappend @@ -0,0 +1,98 @@ +#main bb file: yocto-meta-openeuler/meta-openeuler/recipes-arm/arm-compute-library/armnn_22.11.bb +PV = "22.11" + +OPENEULER_BRANCH = "master" + +SRCREV = "d95bb5364783c89ea9594550233055590db31094" + +CXXFLAGS += "-fopenmp -O3 -DNDEBUG" +LIBS += "-larmpl_lp64_mp" + +EXTRA_OECMAKE=" \ + -DCMAKE_CXX_FLAGS=-w \ + -DBUILD_SHARED_LIBS=ON \ + -DARMCOMPUTE_ROOT=${STAGING_DIR_HOST}${datadir}/arm-compute-library \ + -DARMCOMPUTE_BUILD_DIR=${STAGING_DIR_HOST}${libdir} \ + -DFLATBUFFERS_INCLUDE_PATH=${STAGING_DIR_HOST}${includedir} \ + -DFLATBUFFERS_LIBRARY=${STAGING_DIR_HOST}${libdir}/libflatbuffers.a \ + -DFlatbuffers_INCLUDE_DIR=${STAGING_DIR_HOST}${includedir} \ + -DFlatbuffers_LIB=${STAGING_DIR_HOST}${libdir}/libflatbuffers.a \ + -DTF_LITE_SCHEMA_INCLUDE_PATH=${STAGING_DIR_HOST}${includedir}/tensorflow/lite/schema \ + -DTENSORFLOW_ROOT=${STAGING_DIR_HOST}${includedir} \ + -DTFLITE_LIB_ROOT=${STAGING_DIR_HOST}${libdir} \ + -DARMCOMPUTENEON=1 -DARMCOMPUTECL=0 -DARMNNREF=1 \ + -DBUILD_TF_LITE_PARSER=1 \ + -DBUILD_ONNX_PARSER=0 \ + -DBUILD_ARMNN_TFLITE_DELEGATE=1 \ + -DFLATC_DIR=${STAGING_DIR_NATIVE}${bindir} \ + -DBUILD_TESTS=1 \ + -DGENERIC_LIB_VERSION=${PV} -DGENERIC_LIB_SOVERSION=${PV_MAJOR} \ +" + +cmake_do_configure() { + if [ "${OECMAKE_BUILDPATH}" ]; then + bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH. The default behaviour is now out-of-tree builds with B=WORKDIR/build." + fi + + if [ "${S}" = "${B}" ]; then + find ${B} -name CMakeFiles -or -name Makefile -or -name cmake_install.cmake -or -name CMakeCache.txt -delete + fi + + # Just like autotools cmake can use a site file to cache result that need generated binaries to run + if [ -e ${WORKDIR}/site-file.cmake ] ; then + oecmake_sitefile="-C ${WORKDIR}/site-file.cmake" + else + oecmake_sitefile= + fi + + cmake \ + $oecmake_sitefile \ + ${OECMAKE_SOURCEPATH} \ + -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \ + -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \ + -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d. getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \ + -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_SO_NO_EXE=0 \ + -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \ + ${EXTRA_OECMAKE} \ + -Wno-dev +} + +SRC_URI_remove = " \ + git://github.com/ARM-software/armnn.git;name=armnn;branch=${BRANCH_ARMNN} \ + file://0001-stdlib-issue-work-around.patch \ + file://0002-enable-use-of-boost-shared-library.patch \ + file://0003-generate-versioned-library.patch \ + file://0004-enable-use-of-arm-compute-shared-library.patch \ + file://0005-add-support-more-examples.patch \ + file://TfLiteMobilenetQuantized_0_25-Armnn.cpp \ + file://TfLiteMobilenetQuantized_1_0-Armnn.cpp \ + file://grace_hopper.jpg \ +" +SRC_URI += " \ + file://armnn-${PV}.tar.gz \ + file://armnn-use-static-libraries.patch \ + file://0001-modify-cmake-files.patch \ +" +S = "${WORKDIR}/${BP}" + +DEPENDS_remove = "\ + armnn-tensorflow-lite \ + stb \ +" +DEPENDS += " \ + tensorflow-lite \ +" + +do_configure_remove() { + install -m 0555 ${WORKDIR}/TfLiteMobilenetQuantized_0_25-Armnn.cpp ${S}/tests/TfLiteMobilenetQuantized-Armnn + install -m 0555 ${WORKDIR}/TfLiteMobilenetQuantized_1_0-Armnn.cpp ${S}/tests/TfLiteMobilenetQuantized-Armnn +} + +FILES_${PN} += "${libdir}/*" diff --git a/meta-openeuler/recipes-arm/armnn/armnn_19.02.bb b/meta-openeuler/recipes-arm/armnn/armnn_19.02.bb new file mode 100644 index 0000000000000000000000000000000000000000..cf7b2cd967b744ba1e2cda2796296c90248517f5 --- /dev/null +++ b/meta-openeuler/recipes-arm/armnn/armnn_19.02.bb @@ -0,0 +1,63 @@ +SUMMARY = "ARM Neural Network SDK" +DESCRIPTION = "Linux software and tools to enable machine learning Tensorflow lite workloads on power-efficient devices" +LICENSE = "MIT & Apache-2.0" +# Apache-2.0 license applies to mobilenet tarball +LIC_FILES_CHKSUM = "file://LICENSE;md5=3e14a924c16f7d828b8335a59da64074 \ + file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +PV_MAJOR = "${@d.getVar('PV',d,1).split('.')[0]}" +PV_MINOR = "${@d.getVar('PV',d,1).split('.')[1]}" + +SRCREV = "0028d1b0ce5f4c2c6a6eb3c66f38111c21eb47a3" + +SRCREV_FORMAT = "armnn" + +S = "${WORKDIR}/git" + +inherit cmake + +BRANCH_ARMNN = "branches/armnn_${PV_MAJOR}_${PV_MINOR}" + +SRC_URI = " \ + git://github.com/ARM-software/armnn.git;name=armnn;branch=${BRANCH_ARMNN} \ + file://0001-stdlib-issue-work-around.patch \ + file://0002-enable-use-of-boost-shared-library.patch \ + file://0003-generate-versioned-library.patch \ + file://0004-enable-use-of-arm-compute-shared-library.patch \ + file://0005-add-support-more-examples.patch \ + file://TfLiteMobilenetQuantized_0_25-Armnn.cpp \ + file://TfLiteMobilenetQuantized_1_0-Armnn.cpp \ + file://grace_hopper.jpg \ +" + +DEPENDS += " \ + boost \ + flatbuffers-native \ + flatbuffers \ + arm-compute-library \ + armnn-tensorflow-lite \ + stb \ +" + +RDEPENDS_${PN} = " arm-compute-library " + +TESTVECS_INSTALL_DIR = "${datadir}/arm/armnn" + +EXTRA_OEMAKE += "'LIBS=${LIBS}' 'CXX=${CXX}' 'CC=${CC}' 'AR=${AR}' 'CXXFLAGS=${CXXFLAGS}' 'CFLAGS=${CFLAGS}'" + +do_configure_prepend() { + install -m 0555 ${WORKDIR}/TfLiteMobilenetQuantized_0_25-Armnn.cpp ${S}/tests/TfLiteMobilenetQuantized-Armnn + install -m 0555 ${WORKDIR}/TfLiteMobilenetQuantized_1_0-Armnn.cpp ${S}/tests/TfLiteMobilenetQuantized-Armnn +} + +do_install_append() { + CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" + install -d ${D}${bindir} + find ${WORKDIR}/build/tests -maxdepth 1 -type f -executable -exec cp $CP_ARGS {} ${D}${bindir} \; + cp $CP_ARGS ${WORKDIR}/build/UnitTests ${D}${bindir} + + chrpath -d ${D}${bindir}/* +} + +FILES_${PN}-dev += "{libdir}/cmake/*" +INSANE_SKIP_${PN}-dev = "dev-elf" diff --git a/meta-openeuler/recipes-bsp/gnu-efi/gnu-efi_%.bbappend b/meta-openeuler/recipes-bsp/gnu-efi/gnu-efi_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..47f634b3638fbb91b8075fd36a97e4d96078dc06 --- /dev/null +++ b/meta-openeuler/recipes-bsp/gnu-efi/gnu-efi_%.bbappend @@ -0,0 +1,10 @@ +# main bbfile: yocto-poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.12.bb + +PV = "3.0.8" + +# remove tar.gz files and code patches from poky +SRC_URI_remove = " \ + ${SOURCEFORGE_MIRROR}/${BPN}/files/${BP}.tar.bz2 \ +" + +SRC_URI =+ "file://gnu-efi-${PV}.tar.bz2 " diff --git a/meta-openeuler/recipes-bsp/grub/files/cfg b/meta-openeuler/recipes-bsp/grub/files/cfg new file mode 100644 index 0000000000000000000000000000000000000000..8ca53d24d7bb2ed98da351566153068bc07b04c3 --- /dev/null +++ b/meta-openeuler/recipes-bsp/grub/files/cfg @@ -0,0 +1,2 @@ +search.file ($cmdpath)/EFI/BOOT/grub.cfg root +set prefix=($root)/EFI/BOOT diff --git a/meta-openeuler/recipes-bsp/grub/grub-efi_%.bbappend b/meta-openeuler/recipes-bsp/grub/grub-efi_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..6dea8cb45e74d1f5c660cce5b348b9beec941732 --- /dev/null +++ b/meta-openeuler/recipes-bsp/grub/grub-efi_%.bbappend @@ -0,0 +1,2 @@ +# main bbfile: yocto-poky/meta/recipes-bsp/grub/grub-efi_git.bb +require grub-source-openeuler.inc diff --git a/meta-openeuler/recipes-bsp/grub/grub-source-openeuler.inc b/meta-openeuler/recipes-bsp/grub/grub-source-openeuler.inc new file mode 100644 index 0000000000000000000000000000000000000000..fe124bc27923d80e3863f3d9b9ee490e86fe4c82 --- /dev/null +++ b/meta-openeuler/recipes-bsp/grub/grub-source-openeuler.inc @@ -0,0 +1,9 @@ +REALPV = "2.06" +PV = "2.06" + +# Notice: openeuler's patches have many conflicts to patch, drop them. + +OPENEULER_REPO_NAME = "grub2" +SRC_URI[sha256sum] = "b79ea44af91b93d17cd3fe80bdae6ed43770678a9a5ae192ccea803ebb657ee1" + +CVE_CHECK_WHITELIST = "" diff --git a/meta-openeuler/recipes-bsp/grub/grub_%.bbappend b/meta-openeuler/recipes-bsp/grub/grub_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..1dcd06095b1c50a38b2eb3b8f67fdc5028fd2106 --- /dev/null +++ b/meta-openeuler/recipes-bsp/grub/grub_%.bbappend @@ -0,0 +1,2 @@ +# main bbfile: yocto-poky/meta/recipes-bsp/grub/grub_git.bb +require grub-source-openeuler.inc diff --git a/meta-openeuler/recipes-core/pciutils/pciutils/configure.patch b/meta-openeuler/recipes-bsp/pciutils/files/configure.patch similarity index 57% rename from meta-openeuler/recipes-core/pciutils/pciutils/configure.patch rename to meta-openeuler/recipes-bsp/pciutils/files/configure.patch index e444c139756d75edd97a4bae679df62d53f7a9f6..ac6f97b34817b28941ea0e728ea3d51c85ebd02a 100644 --- a/meta-openeuler/recipes-core/pciutils/pciutils/configure.patch +++ b/meta-openeuler/recipes-bsp/pciutils/files/configure.patch @@ -1,9 +1,14 @@ +From 42e7d5f5f1d84a56b125aa05de33d31e28ad1124 Mon Sep 17 00:00:00 2001 +From: Richard Purdie +Date: Wed, 31 Dec 2008 17:20:38 +0000 +Subject: [PATCH] pciutils: Upgarde 2.2.4 -> 3.0.3 + This patch: * ensures we link correctly * allows us to optionally pass target information to configure rather than using uname * select linux as the platform in most cases we care about -This is a merge of various tweaks to allow us to build pciutils including +This is a merge of various tweaks to allow us to build pciutils including work from: 7/30/2010 - Qing He @@ -13,23 +18,28 @@ Ionut Radu Upstream-Status: Inappropriate [embedded specific] -Index: pciutils-3.5.6/Makefile -=================================================================== ---- pciutils-3.5.6.orig/Makefile -+++ pciutils-3.5.6/Makefile -@@ -96,7 +96,7 @@ example: example.o lib/$(PCILIB) +--- + Makefile | 2 +- + lib/configure | 14 ++++++++++---- + 2 files changed, 11 insertions(+), 5 deletions(-) + +diff --git a/Makefile b/Makefile +index 3df076d..9b247d3 100644 +--- a/Makefile ++++ b/Makefile +@@ -110,7 +110,7 @@ example$(EXEEXT): example.o lib/$(PCIIMPLIB) example.o: example.c $(PCIINC) - %: %.o + %$(EXEEXT): %.o - $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@ + $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@ - %.8 %.7 %.5: %.man - M=`echo $(DATE) | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <$< >$@ "s/@TODAY@/$$M/;s/@VERSION@/pciutils-$(VERSION)/;s#@IDSDIR@#$(IDSDIR)#" -Index: pciutils-3.5.6/lib/configure -=================================================================== ---- pciutils-3.5.6.orig/lib/configure -+++ pciutils-3.5.6/lib/configure + ifdef PCI_OS_WINDOWS + comma := , +diff --git a/lib/configure b/lib/configure +index 57b064b..b269332 100755 +--- a/lib/configure ++++ b/lib/configure @@ -9,6 +9,10 @@ echo_n() { printf '%s' "$*" } @@ -38,7 +48,7 @@ Index: pciutils-3.5.6/lib/configure +IDSDIR=$2 +DNS=yes + - if [ -z "$VERSION" -o -z "$IDSDIR" ] ; then + if [ -z "$VERSION" ] ; then echo >&2 "Please run the configure script from the top-level Makefile" exit 1 @@ -16,8 +20,8 @@ fi @@ -56,12 +66,12 @@ Index: pciutils-3.5.6/lib/configure proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1` cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'` else -- cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'` -+ cpu=${4:-`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`} +- cpu=`uname -m | sed 's/^i.86-AT386/i386/;s/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'` ++ cpu=${4:-`uname -m | sed 's/^i.86-AT386/i386/;s/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`} fi - if [ "$sys" = "GNU/kFreeBSD" -o "$sys" = "DragonFly" ] + if [ "$sys" = "DragonFly" ] then -@@ -35,7 +39,7 @@ if [ -z "$HOST" ] ; then +@@ -43,7 +47,7 @@ if [ -z "$HOST" ] ; then then sys=cygwin fi @@ -70,7 +80,7 @@ Index: pciutils-3.5.6/lib/configure fi [ -n "$RELEASE" ] && rel="${RELEASE}" # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless. -@@ -44,6 +48,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +@@ -52,6 +56,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo " $host $rel $cpu $sys" @@ -79,3 +89,4 @@ Index: pciutils-3.5.6/lib/configure c=config.h m=config.mk echo >$c '#define PCI_CONFIG_H' + \ No newline at end of file diff --git a/meta-openeuler/recipes-bsp/pciutils/pciutils_%.bbappend b/meta-openeuler/recipes-bsp/pciutils/pciutils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..011e5f9f91a5aaebf318d7fdc538532e88733350 --- /dev/null +++ b/meta-openeuler/recipes-bsp/pciutils/pciutils_%.bbappend @@ -0,0 +1,31 @@ +PV = "3.9.0" + +# update configure.patch of poky +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +OPENEULER_SRC_URI_REMOVE = "https http git" + +SRC_URI_prepend = " \ + file://pciutils-${PV}.tar.gz \ + file://0000-pciutils-2.2.1-idpath.patch \ + file://0001-pciutils-dir-d.patch \ +" + +SRC_URI[sha256sum] = "01f5b9ee8eff577e9953a43bafb3ead76e0654a7288dc26d79627074956fb1e0" + +# use newer do_install +do_install () { + oe_runmake DESTDIR=${D} install install-lib + install -d ${D}${bindir} + oe_multilib_header pci/config.h +} + +# avoid lspci conflict with busybox +inherit update-alternatives + +ALTERNATIVE:${PN} = "lspci" +ALTERNATIVE_PRIORITY = "100" + +# file of ids package is /usr/share/hwdata/pci.ids.gz, but datadir is /usr/share/ +# update it from FILES_${PN}-ids = "${datadir}/pci.ids*" in poky bb. +FILES_${PN}-ids = "${datadir}/*/pci.ids*" diff --git a/meta-openeuler/recipes-connectivity/bind/bind-dhclient/0001-avoid-start-failure-with-bind-user.patch b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/0001-avoid-start-failure-with-bind-user.patch new file mode 100644 index 0000000000000000000000000000000000000000..8db96ec049c7a3483936c48037acc91b9870b16e --- /dev/null +++ b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/0001-avoid-start-failure-with-bind-user.patch @@ -0,0 +1,27 @@ +From 31dde3562f287429eea94b77250d184818b49063 Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Mon, 15 Oct 2018 16:55:09 +0800 +Subject: [PATCH] avoid start failure with bind user + +Upstream-Status: Pending + +Signed-off-by: Chen Qi +--- + init.d | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/init.d b/init.d +index b2eec60..6e03936 100644 +--- a/init.d ++++ b/init.d +@@ -57,6 +57,7 @@ case "$1" in + modprobe capability >/dev/null 2>&1 || true + if [ ! -f /etc/bind/rndc.key ]; then + /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom ++ chown root:bind /etc/bind/rndc.key >/dev/null 2>&1 || true + chmod 0640 /etc/bind/rndc.key + fi + if [ -f /var/run/named/named.pid ]; then +-- +2.7.4 + diff --git a/meta-openeuler/recipes-connectivity/bind/bind-dhclient/0001-configure.in-remove-useless-L-use_openssl-lib.patch b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/0001-configure.in-remove-useless-L-use_openssl-lib.patch new file mode 100644 index 0000000000000000000000000000000000000000..9d31b9808073a468798a068a82ec9f848000e633 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/0001-configure.in-remove-useless-L-use_openssl-lib.patch @@ -0,0 +1,30 @@ +From 2325a92f1896a2a7f586611686801b41fbc91b50 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Mon, 27 Aug 2018 15:00:51 +0800 +Subject: [PATCH] configure.in: remove useless `-L$use_openssl/lib' + +Since `--with-openssl=${STAGING_DIR_HOST}${prefix}' is used in bind recipe, +the `-L$use_openssl/lib' has a hardcoded suffix, removing it is harmless +and helpful for clean up host build path in isc-config.sh + +Upstream-Status: Inappropriate [oe-core specific] + +Signed-off-by: Hongxu Jia + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index e85a5c6..2bbfc58 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1631,7 +1631,7 @@ If you don't want OpenSSL, use --without-openssl]) + fi + ;; + *) +- DST_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto" ++ DST_OPENSSL_LIBS="-lcrypto" + ;; + esac + fi diff --git a/meta-openeuler/recipes-connectivity/bind/bind-dhclient/0001-named-lwresd-V-and-start-log-hide-build-options.patch b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/0001-named-lwresd-V-and-start-log-hide-build-options.patch new file mode 100644 index 0000000000000000000000000000000000000000..75908aa638f5aad3f06a00ec83ed7776125eab28 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/0001-named-lwresd-V-and-start-log-hide-build-options.patch @@ -0,0 +1,34 @@ +From a3af4a405baf5ff582e82aaba392dd9667d94bdc Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Mon, 27 Aug 2018 21:24:20 +0800 +Subject: [PATCH] `named/lwresd -V' and start log hide build options + +The build options expose build path directories, so hide them. +[snip] +$ named -V +|built by make with *** (options are hidden) +[snip] + +Upstream-Status: Inappropriate [oe-core specific] + +Signed-off-by: Hongxu Jia +--- + bin/named/include/named/globals.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bin/named/include/named/globals.h b/bin/named/include/named/globals.h +index ba3457e..7741da7 100644 +--- a/bin/named/include/named/globals.h ++++ b/bin/named/include/named/globals.h +@@ -68,7 +68,7 @@ EXTERN const char * ns_g_version INIT(VERSION); + EXTERN const char * ns_g_product INIT(PRODUCT); + EXTERN const char * ns_g_description INIT(DESCRIPTION); + EXTERN const char * ns_g_srcid INIT(SRCID); +-EXTERN const char * ns_g_configargs INIT(CONFIGARGS); ++EXTERN const char * ns_g_configargs INIT("*** (options are hidden)"); + EXTERN const char * ns_g_builder INIT(BUILDER); + EXTERN in_port_t ns_g_port INIT(0); + EXTERN isc_dscp_t ns_g_dscp INIT(-1); +-- +2.7.4 + diff --git a/meta-openeuler/recipes-connectivity/bind/bind-dhclient/bind-ensure-searching-for-json-headers-searches-sysr.patch b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/bind-ensure-searching-for-json-headers-searches-sysr.patch new file mode 100644 index 0000000000000000000000000000000000000000..84559e5f3786c9f5e597061528130b1332960606 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/bind-ensure-searching-for-json-headers-searches-sysr.patch @@ -0,0 +1,47 @@ +From edda20fb5a6e88548f85e39d34d6c074306e15bc Mon Sep 17 00:00:00 2001 +From: Paul Gortmaker +Date: Tue, 9 Jun 2015 11:22:00 -0400 +Subject: [PATCH] bind: ensure searching for json headers searches sysroot + +Bind can fail configure by detecting headers w/o libs[1], or +it can fail the host contamination check as per below: + +ERROR: This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities. +Rerun configure task after fixing this. The path was 'build/tmp/work/core2-64-poky-linux/bind/9.10.2-r1/build' +ERROR: Function failed: do_qa_configure +ERROR: Logfile of failure stored in: build/tmp/work/core2-64-poky-linux/bind/9.10.2-r1/temp/log.do_configure.5242 +ERROR: Task 5 (meta/recipes-connectivity/bind/bind_9.10.2.bb, do_configure) failed with exit code '1' +NOTE: Tasks Summary: Attempted 773 tasks of which 768 didn't need to be rerun and 1 failed. +No currently running tasks (773 of 781) + +Summary: 1 task failed: + /meta/recipes-connectivity/bind/bind_9.10.2.bb, do_configure + +One way to fix it would be to unconditionally disable json in bind +configure[2] but here we fix it by using the path to where we would +put the header if we had json in the sysroot, in case someone wants +to make use of the combination some day. + +[1] https://trac.macports.org/ticket/45305 +[2] https://trac.macports.org/changeset/126406 + +Upstream-Status: Inappropriate [OE Specific] +Signed-off-by: Paul Gortmaker + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 17392fd..e85a5c6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2449,7 +2449,7 @@ case "$use_libjson" in + libjson_libs="" + ;; + auto|yes) +- for d in /usr /usr/local /opt/local ++ for d in "${STAGING_INCDIR}" + do + if test -f "${d}/include/json/json.h" + then diff --git a/meta-openeuler/recipes-core/bind/bind/bind9 b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/bind9 similarity index 100% rename from meta-openeuler/recipes-core/bind/bind/bind9 rename to meta-openeuler/recipes-connectivity/bind/bind-dhclient/bind9 diff --git a/meta-openeuler/recipes-core/bind/bind/conf.patch b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/conf.patch similarity index 100% rename from meta-openeuler/recipes-core/bind/bind/conf.patch rename to meta-openeuler/recipes-connectivity/bind/bind-dhclient/conf.patch diff --git a/meta-openeuler/recipes-core/bind/bind/generate-rndc-key.sh b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/generate-rndc-key.sh similarity index 76% rename from meta-openeuler/recipes-core/bind/bind/generate-rndc-key.sh rename to meta-openeuler/recipes-connectivity/bind/bind-dhclient/generate-rndc-key.sh index 633e29c0e6157f465f22b0c9577b7813ccc6b6b1..ef915c0ae5a4611d72389100fc851df39afc182f 100644 --- a/meta-openeuler/recipes-core/bind/bind/generate-rndc-key.sh +++ b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/generate-rndc-key.sh @@ -2,7 +2,7 @@ if [ ! -s /etc/bind/rndc.key ]; then echo -n "Generating /etc/bind/rndc.key:" - /usr/sbin/rndc-confgen -a -b 512 + /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom chown root:bind /etc/bind/rndc.key chmod 0640 /etc/bind/rndc.key fi diff --git a/meta-openeuler/recipes-connectivity/bind/bind-dhclient/init.d-add-support-for-read-only-rootfs.patch b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/init.d-add-support-for-read-only-rootfs.patch new file mode 100644 index 0000000000000000000000000000000000000000..11db95ede12a8155abac436c8d836e76f8663570 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/init.d-add-support-for-read-only-rootfs.patch @@ -0,0 +1,65 @@ +Subject: init.d: add support for read-only rootfs + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Chen Qi +--- + init.d | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +diff --git a/init.d b/init.d +index 0111ed4..24677c8 100644 +--- a/init.d ++++ b/init.d +@@ -6,8 +6,48 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin + # Don't modify this line, change or create /etc/default/bind9. + OPTIONS="" + ++test -f /etc/default/rcS && . /etc/default/rcS + test -f /etc/default/bind9 && . /etc/default/bind9 + ++# This function is here because it's possible that /var and / are on different partitions. ++is_on_read_only_partition () { ++ DIRECTORY=$1 ++ dir=`readlink -f $DIRECTORY` ++ while true; do ++ if [ ! -d "$dir" ]; then ++ echo "ERROR: $dir is not a directory" ++ exit 1 ++ else ++ for flag in `awk -v dir=$dir '{ if ($2 == dir) { print "FOUND"; split($4,FLAGS,",") } }; \ ++ END { for (f in FLAGS) print FLAGS[f] }' < /proc/mounts`; do ++ [ "$flag" = "FOUND" ] && partition="read-write" ++ [ "$flag" = "ro" ] && { partition="read-only"; break; } ++ done ++ if [ "$dir" = "/" -o -n "$partition" ]; then ++ break ++ else ++ dir=`dirname $dir` ++ fi ++ fi ++ done ++ [ "$partition" = "read-only" ] && echo "yes" || echo "no" ++} ++ ++bind_mount () { ++ olddir=$1 ++ newdir=$2 ++ mkdir -p $olddir ++ cp -a $newdir/* $olddir ++ mount --bind $olddir $newdir ++} ++ ++# Deal with read-only rootfs ++if [ "$ROOTFS_READ_ONLY" = "yes" ]; then ++ [ "$VERBOSE" != "no" ] && echo "WARN: start bind service in read-only rootfs" ++ [ `is_on_read_only_partition /etc/bind` = "yes" ] && bind_mount /var/volatile/bind/etc /etc/bind ++ [ `is_on_read_only_partition /var/named` = "yes" ] && bind_mount /var/volatile/bind/named /var/named ++fi ++ + test -x /usr/sbin/rndc || exit 0 + + case "$1" in +-- +1.7.9.5 + diff --git a/meta-openeuler/recipes-connectivity/bind/bind-dhclient/make-etc-initd-bind-stop-work.patch b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/make-etc-initd-bind-stop-work.patch new file mode 100644 index 0000000000000000000000000000000000000000..146f3e35db6d57c00a31071ccec39529763e3219 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/make-etc-initd-bind-stop-work.patch @@ -0,0 +1,42 @@ +bind: make "/etc/init.d/bind stop" work + +Upstream-Status: Inappropriate [configuration] + +Add some configurations, make rndc command be able to controls +the named daemon. + +Signed-off-by: Roy Li +--- + conf/named.conf | 5 +++++ + conf/rndc.conf | 5 +++++ + 2 files changed, 10 insertions(+), 0 deletions(-) + create mode 100644 conf/rndc.conf + +diff --git a/conf/named.conf b/conf/named.conf +index 95829cf..c8899e7 100644 +--- a/conf/named.conf ++++ b/conf/named.conf +@@ -47,3 +47,8 @@ zone "255.in-addr.arpa" { + // root-delegation-only exclude { "DE"; "MUSEUM"; }; + + include "/etc/bind/named.conf.local"; ++include "/etc/bind/rndc.key" ; ++controls { ++ inet 127.0.0.1 allow { localhost; } ++ keys { rndc-key; }; ++}; +diff --git a/conf/rndc.conf b/conf/rndc.conf +new file mode 100644 +index 0000000..a0b481d +--- /dev/null ++++ b/conf/rndc.conf +@@ -0,0 +1,5 @@ ++include "/etc/bind/rndc.key"; ++options { ++ default-server localhost; ++ default-key rndc-key; ++}; + +-- +1.7.5.4 + diff --git a/meta-openeuler/recipes-core/bind/bind/named.service b/meta-openeuler/recipes-connectivity/bind/bind-dhclient/named.service similarity index 100% rename from meta-openeuler/recipes-core/bind/bind/named.service rename to meta-openeuler/recipes-connectivity/bind/bind-dhclient/named.service diff --git a/meta-openeuler/recipes-connectivity/bind/bind-dhclient_%.bbappend b/meta-openeuler/recipes-connectivity/bind/bind-dhclient_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..6ee1ee832f26eeb6d877618881509188988b83cf --- /dev/null +++ b/meta-openeuler/recipes-connectivity/bind/bind-dhclient_%.bbappend @@ -0,0 +1,34 @@ +# source bb: meta-overc/recipes-connectivity/bind/bind-dhclient_9.11.22.bb +OPENEULER_REPO_NAME = "dhcp" + +# version in openeuler/dhcp +PV = "9.11.36" +DHCP_PV = "4.4.3" + +# fix LIC_FILES_CHKSUM error +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=b88e7ca5f21908e1b2720169f6807cf6" + +SRC_URI_remove = "https://ftp.isc.org/isc/bind9/${PV}/${PACKAGE_FETCH_NAME}-${PV}.tar.gz \ +" + +S = "${WORKDIR}/dhcp-${DHCP_PV}/bind/bind-${PV}" + +# apply openEuler/dhcp patches +SRC_URI_prepend = "file://dhcp-${DHCP_PV}.tar.gz;name=dhcp.tarball \ + file://backport-0025-bind-Detect-system-time-changes.patch;striplevel=3 \ + file://backport-Fix-CVE-2021-25220.patch;striplevel=3 \ +" + +SRC_URI[dhcp.tarball.sha256sum] = "1a7ccd64a16e5e68f7b5e0f527fd07240a2892ea53fe245620f4f5f607004521" + +# bind users do not need shell/login access for secure +USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \ + --shell /sbin/nologin --user-group bind" + +# decompress the source code from dhcp-${DHCP_PV}.tar.gz +do_unpack_bind () { + tar -xf bind.tar.gz +} +do_unpack_bind[dirs] = "${WORKDIR}/dhcp-${DHCP_PV}/bind/" + +addtask unpack_bind after do_unpack before do_patch diff --git a/meta-openeuler/recipes-core/bind/bind_9.11.14.bb b/meta-openeuler/recipes-connectivity/bind/bind-dhclient_9.11.22.bb similarity index 42% rename from meta-openeuler/recipes-core/bind/bind_9.11.14.bb rename to meta-openeuler/recipes-connectivity/bind/bind-dhclient_9.11.22.bb index 027035d6137c8cab6bf0ce369bc3c22474de6f52..3ac860af953af6916e6725cb871c1cca5d843ac3 100644 --- a/meta-openeuler/recipes-core/bind/bind_9.11.14.bb +++ b/meta-openeuler/recipes-connectivity/bind/bind-dhclient_9.11.22.bb @@ -1,28 +1,43 @@ SUMMARY = "ISC Internet Domain Name Server" -HOMEPAGE = "https://www.isc.org/bind/" -DESCRIPTION = "BIND 9 provides a full-featured Domain Name Server system" +HOMEPAGE = "http://www.isc.org/sw/bind/" SECTION = "console/network" -LICENSE = "MPL-2.0" -LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8f17f64e47e83b60cd920a1e4b54419e" +LICENSE = "ISC & MPL-2.0" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=bf39058a7f64b2a934ce14dc9ec1dd45" DEPENDS = "openssl libcap zlib" -SRC_URI = "file://dhcp/dhcp-4.4.2.tar.gz \ - file://0001-revert-d10fbdec-for-lib-dns-gen.c-as-it-is-a-build-p.patch \ +PACKAGE_FETCH_NAME = "bind" +S = "${WORKDIR}/${PACKAGE_FETCH_NAME}-${PV}" + +SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${PACKAGE_FETCH_NAME}-${PV}.tar.gz \ file://conf.patch \ file://named.service \ file://bind9 \ file://generate-rndc-key.sh \ + file://make-etc-initd-bind-stop-work.patch \ + file://init.d-add-support-for-read-only-rootfs.patch \ + file://bind-ensure-searching-for-json-headers-searches-sysr.patch \ + file://0001-configure.in-remove-useless-L-use_openssl-lib.patch \ + file://0001-named-lwresd-V-and-start-log-hide-build-options.patch \ + file://0001-avoid-start-failure-with-bind-user.patch \ " -SRC_URI[sha256sum] = "1a7ccd64a16e5e68f7b5e0f527fd07240a2892ea53fe245620f4f5f607004521" +SRC_URI[sha256sum] = "afc6d8015006f1cabf699ff19f517bb8fd9c1811e5231f26baf51c3550262ac9" UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/" -# stay at 9.16 follow the ESV versions divisible by 4 -UPSTREAM_CHECK_REGEX = "(?P9.(16|20|24|28)(\.\d+)+(-P\d+)*)/" +# stay at 9.11 until 9.16, from 9.16 follow the ESV versions divisible by 4 +UPSTREAM_CHECK_REGEX = "(?P9.(11|16|20|24|28)(\.\d+)+(-P\d+)*)/" + +# BIND >= 9.11.2 need dhcpd >= 4.4.0, +# don't report it here since dhcpd is already recent enough. +CVE_CHECK_IGNORE += "CVE-2019-6470" + +inherit autotools +#inherit update-rc.d systemd +inherit useradd pkgconfig multilib_script multilib_header -inherit autotools systemd pkgconfig multilib_header +MULTILIB_SCRIPTS = "${PN}:${bindir}/bind9-config ${PN}:${bindir}/isc-config.sh" # PACKAGECONFIGs readline and libedit should NOT be set at same time PACKAGECONFIG ?= "readline" @@ -32,15 +47,16 @@ PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit" PACKAGECONFIG[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,," PACKAGECONFIG[python3] = "--with-python=yes --with-python-install-dir=${PYTHON_SITEPACKAGES_DIR} , --without-python, python3-ply-native," -EXTRA_OECONF = " --with-libtool --disable-devpoll --enable-epoll \ - --with-gssapi=no --with-lmdb=no --with-zlib \ - --with-ecdsa=yes --with-eddsa=no --with-gost=no \ +ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}" +EXTRA_OECONF = " ${ENABLE_IPV6} --with-libtool --enable-threads \ + --disable-devpoll --enable-epoll --with-gost=no \ + --with-gssapi=no --with-ecdsa=yes --with-eddsa=no \ + --with-lmdb=no \ --sysconfdir=${sysconfdir}/bind \ --with-openssl=${STAGING_DIR_HOST}${prefix} \ " -LDFLAGS_append = " -lz" -inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native distutils3-base', '', d)} +inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native setuptools3-base', '', d)} # dhcp needs .la so keep them REMOVE_LIBTOOL_LA = "0" @@ -49,52 +65,55 @@ USERADD_PACKAGES = "${PN}" USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \ --user-group bind" -INITSCRIPT_NAME = "bind" -INITSCRIPT_PARAMS = "defaults" +# INITSCRIPT_NAME = "bind" +# INITSCRIPT_PARAMS = "defaults" -SYSTEMD_SERVICE_${PN} = "named.service" +# SYSTEMD_SERVICE:${PN} = "named.service" -do_unpak () { - cd ${WORKDIR} - tar -xf dhcp-4.4.2/bind/bind.tar.gz +do_install_prepend() { + # clean host path in isc-config.sh before the hardlink created + # by "make install": + # bind9-config -> isc-config.sh + sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh } -addtask unpak after do_unpack before do_patch - do_install_append() { rmdir "${D}${localstatedir}/run" rmdir --ignore-fail-on-non-empty "${D}${localstatedir}" - install -d bind "${D}${localstatedir}/cache/bind" - install -d "${D}${sysconfdir}/bind" - install -d "${D}${sysconfdir}/init.d" - install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/" - install -m 750 "${S}/init.d" "${D}${sysconfdir}/init.d/bind" - if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then - sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \ - ${D}${sbindir}/dnssec-coverage \ - ${D}${sbindir}/dnssec-checkds \ - ${D}${sbindir}/dnssec-keymgr - fi - - # Install systemd related files - install -d ${D}${sbindir} - install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir} - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system - sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ - -e 's,@SBINDIR@,${sbindir},g' \ - ${D}${systemd_unitdir}/system/named.service - - install -d ${D}${sysconfdir}/default - install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default - - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${sysconfdir}/tmpfiles.d - echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf - fi - - oe_multilib_header isc/platform.h + + # install -d -o bind "${D}${localstatedir}/cache/bind" + # install -d "${D}${sysconfdir}/bind" + # install -d "${D}${sysconfdir}/init.d" + # install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/" + # install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind" + # if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then + # sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' \ + # ${D}${sbindir}/dnssec-coverage \ + # ${D}${sbindir}/dnssec-checkds \ + # ${D}${sbindir}/dnssec-keymgr + # fi + + # # Install systemd related files + # install -d ${D}${sbindir} + # install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir} + # install -d ${D}${systemd_unitdir}/system + # install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system + # sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ + # -e 's,@SBINDIR@,${sbindir},g' \ + # ${D}${systemd_unitdir}/system/named.service + + # install -d ${D}${sysconfdir}/default + # install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default + + # if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + # install -d ${D}${sysconfdir}/tmpfiles.d + # echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf + # fi + + rm -rf "${D}${datadir}" + + oe_multilib_header isc/platform.h } CONFFILES_${PN} = " \ @@ -118,10 +137,7 @@ FILES_${PN}-dev += "${bindir}/isc-config.h" FILES_${PN} += "${sbindir}/generate-rndc-key.sh" PACKAGE_BEFORE_PN += "${PN}-libs" -# special arrangement below due to -# https://github.com/isc-projects/bind9/commit/0e25af628cd776f98c04fc4cc59048f5448f6c88 -FILES_SOLIBSDEV = "${libdir}/*[!0-9].so ${libdir}/libbind9.so" -FILES_${PN}-libs = "${libdir}/named/*.so* ${libdir}/*-${PV}.so" +FILES_${PN}-libs = "${libdir}/*.so*" FILES_${PN}-staticdev += "${libdir}/*.la" PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-bind', '', d)}" diff --git a/meta-openeuler/recipes-connectivity/bluez5/bluez5_%.bbappend b/meta-openeuler/recipes-connectivity/bluez5/bluez5_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b26b2204fac362a801d04c63067e6d4c0ebf6da4 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/bluez5/bluez5_%.bbappend @@ -0,0 +1,49 @@ +# apply openeuler source package +OPENEULER_REPO_NAME = "bluez" + +PV = "5.54" + +# these two patches fix CVE-2021-0129 and CVE-2021-3658, which isn't suitable version 5.54 +# openeuler package has another patches to fix these cves. +SRC_URI_remove = "\ + ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \ + file://0001-adapter-Fix-storing-discoverable-setting.patch \ + file://0001-shared-gatt-server-Fix-not-properly-checking-for-sec.patch \ +" + +SRC_URI_prepend = "\ + file://bluez-${PV}.tar.xz \ + file://0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch \ + file://0001-build-Always-define-confdir-and-statedir.patch \ + file://0002-systemd-Add-PrivateTmp-and-NoNewPrivileges-options.patch \ + file://0003-systemd-Add-more-filesystem-lockdown.patch \ + file://0004-systemd-More-lockdown.patch \ + file://backport-CVE-2021-3588.patch \ + file://backport-bluez-disable-test-mesh-crypto.patch \ + file://backport-media-rename-local-function-conflicting-with-pause-2.patch \ + file://backport-CVE-2020-27153.patch \ + file://backport-0001-CVE-2021-3658.patch \ + file://backport-0002-CVE-2021-3658.patch \ + file://backport-CVE-2021-43400.patch \ + file://backport-0001-CVE-2021-0129.patch \ + file://backport-0002-CVE-2021-0129.patch \ + file://backport-0003-CVE-2021-0129.patch \ + file://backport-0004-CVE-2021-0129.patch \ + file://backport-CVE-2022-0204.patch \ + file://backport-CVE-2021-41229.patch \ + file://backport-CVE-2022-39176.patch \ + file://backport-0001-CVE-2022-39177.patch \ + file://backport-0002-CVE-2022-39177.patch \ +" + +# openeuler do not has udev package, which is not necessary for bluez +# so remove it. +PACKAGECONFIG_remove = "udev" + +# testtools depends python3-core python3-dbus python3-pygobject, we do not need these +RDEPENDS_${PN}-testtools = "" + +# adapte md5 checksum +LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ + file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \ + file://src/main.c;beginline=1;endline=24;md5=9bc54b93cd7e17bf03f52513f39f926e" diff --git a/meta-openeuler/recipes-core/dhcp/dhcp.inc b/meta-openeuler/recipes-connectivity/dhcp/dhcp.inc similarity index 35% rename from meta-openeuler/recipes-core/dhcp/dhcp.inc rename to meta-openeuler/recipes-connectivity/dhcp/dhcp.inc index 9bc2442a81668e4ade12d4cfd7054f53205e9cc4..78778005be05693506cec7fd661adbb6433084be 100644 --- a/meta-openeuler/recipes-core/dhcp/dhcp.inc +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp.inc @@ -8,138 +8,99 @@ easier to administer devices." HOMEPAGE = "http://www.isc.org/" LICENSE = "ISC" -LIC_FILES_CHKSUM = "file://LICENSE;md5=b9c6e660b3d9260de9a342d2fb77540a" - -SRC_URI = "file://dhcp/${BP}.tar.gz \ - file://dhcp/backport-0001-change-bug-url.patch \ - file://dhcp/backport-0002-additional-dhclient-options.patch \ - file://dhcp/backport-0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch \ - file://dhcp/backport-0004-Support-unicast-BOOTP-for-IBM-pSeries-systems-and-ma.patch \ - file://dhcp/backport-0005-Change-default-requested-options.patch \ - file://dhcp/backport-0006-Various-man-page-only-fixes.patch \ - file://dhcp/backport-0007-Change-paths-to-conform-to-our-standards.patch \ - file://dhcp/backport-0008-Make-sure-all-open-file-descriptors-are-closed-on-ex.patch \ - file://dhcp/backport-0009-Fix-garbage-in-format-string-error.patch \ - file://dhcp/backport-0010-Handle-null-timeout.patch \ - file://dhcp/backport-0011-Drop-unnecessary-capabilities.patch \ - file://dhcp/backport-0012-RFC-3442-Classless-Static-Route-Option-for-DHCPv4-51.patch \ - file://dhcp/backport-0013-DHCPv6-over-PPP-support-626514.patch \ - file://dhcp/backport-0014-IPoIB-support-660681.patch \ - file://dhcp/backport-0015-Add-GUID-DUID-to-dhcpd-logs-1064416.patch \ - file://dhcp/backport-0016-Turn-on-creating-sending-of-DUID.patch \ - file://dhcp/backport-0017-Send-unicast-request-release-via-correct-interface.patch \ - file://dhcp/backport-0018-No-subnet-declaration-for-iface-should-be-info-not-e.patch \ - file://dhcp/backport-0019-dhclient-write-DUID_LLT-even-in-stateless-mode-11563.patch \ - file://dhcp/backport-0020-Discover-all-hwaddress-for-xid-uniqueness.patch \ - file://dhcp/backport-0021-Load-leases-DB-in-non-replay-mode-only.patch \ - file://dhcp/backport-0022-dhclient-make-sure-link-local-address-is-ready-in-st.patch \ - file://dhcp/backport-0023-option-97-pxe-client-id.patch \ - file://dhcp/backport-0025-bind-Detect-system-time-changes.patch \ - file://dhcp/backport-0026-Add-dhclient-5-B-option-description.patch \ - file://dhcp/backport-0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch \ - file://dhcp/bugfix-dhcp-4.2.5-check-dhclient-pid.patch \ - file://dhcp/bugfix-reduce-getifaddr-calls.patch \ - file://dhcp/bugfix-dhcpd-2038-problem.patch \ - file://dhcp/dhcpd-coredump-infiniband.patch \ - file://dhcp/bugfix-dhclient-check-if-pid-was-held.patch \ - file://dhcp/bugfix-dhcp-64-bit-lease-parse.patch \ - file://dhcp/backport-CVE-2021-25217.patch \ - file://dhcp/fix-multiple-definition-with-gcc-10-1.patch \ - file://dhcp/fix-multiple-definition-with-gcc-10-2.patch \ - file://dhcp/fix-coredump-when-client-active-is-NULL.patch \ - file://dhcp/bugfix-error-message-display.patch \ - file://dhcp/feature-lease-time-config-ipv6.patch \ - file://dhcp/add-a-test-case-to-parse-code93-in-option_unittest.patch \ - file://0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch \ - file://0013-fixup_use_libbind.patch \ - file://init-server file://default-server \ - file://dhclient.conf file://dhcpd.conf \ - " - -SRC_URI[sha256sum] = "1a7ccd64a16e5e68f7b5e0f527fd07240a2892ea53fe245620f4f5f607004521" -DEPENDS = "openssl bind" - +LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=004a4db50a1e20972e924a8618747c01" + +DEPENDS = "openssl bind-dhclient" + +SRC_URI = "http://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \ + file://init-relay file://default-relay \ + file://init-server file://default-server \ + file://dhclient.conf file://dhcpd.conf \ + file://dhclient-systemd-wrapper \ + file://dhclient.service \ + file://dhcpd.service file://dhcrelay.service \ + file://dhcpd6.service \ + " UPSTREAM_CHECK_URI = "http://ftp.isc.org/isc/dhcp/" UPSTREAM_CHECK_REGEX = "(?P\d+\.\d+\.(\d+?))/" -inherit autotools-brokensep systemd +inherit autotools-brokensep systemd useradd update-rc.d USERADD_PACKAGES = "${PN}-server" USERADD_PARAM_${PN}-server = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}" SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay ${PN}-client" -#SYSTEMD_SERVICE_${PN}-server = "dhcpd.service dhcpd6.service" -#SYSTEMD_AUTO_ENABLE_${PN}-server = "disable" +SYSTEMD_SERVICE_${PN}-server = "dhcpd.service dhcpd6.service" +SYSTEMD_AUTO_ENABLE_${PN}-server = "disable" -#SYSTEMD_SERVICE_${PN}-relay = "dhcrelay.service" -#SYSTEMD_AUTO_ENABLE_${PN}-relay = "disable" +SYSTEMD_SERVICE_${PN}-relay = "dhcrelay.service" +SYSTEMD_AUTO_ENABLE_${PN}-relay = "disable" -#SYSTEMD_SERVICE_${PN}-client = "dhclient.service" -#SYSTEMD_AUTO_ENABLE_${PN}-client = "disable" +SYSTEMD_SERVICE_${PN}-client = "dhclient.service" +SYSTEMD_AUTO_ENABLE_${PN}-client = "disable" INITSCRIPT_PACKAGES = "dhcp-server" INITSCRIPT_NAME_dhcp-server = "dhcp-server" INITSCRIPT_PARAMS_dhcp-server = "defaults" -TARGET_CFLAGS += "-D_GNU_SOURCE" -TARGET_CFLAGS += "-fcommon" +CFLAGS += "-D_GNU_SOURCE" EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \ --with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \ --with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \ --with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases \ - --enable-paranoia --enable-static=yes --enable-shared=yes \ + --enable-paranoia --disable-static \ --with-randomdev=/dev/random \ --with-libbind=${STAGING_DIR_HOST} \ - --enable-libtool \ + --enable-libtool \ " -do_unpak() { - cd ${WORKDIR}/${BP}/bind - tar -xf bind.tar.gz - mv bind-9.11.14/ bind -} - -addtask unpak after do_unpack before do_patch - #Enable shared libs per dhcp README do_configure_prepend () { - cp configure.ac+lt configure.ac + cp configure.ac+lt configure.ac } do_install_append () { - install -d ${D}${sysconfdir}/init.d - install -d ${D}${sysconfdir}/default - install -d ${D}${sysconfdir}/dhcp - install -m 0750 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server - install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server - - rm -f ${D}${sysconfdir}/dhclient.conf* - rm -f ${D}${sysconfdir}/dhcpd.conf* - install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf - install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf - - install -d ${D}${base_sbindir}/ - if [ "${sbindir}" != "${base_sbindir}" ]; then - mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/ - fi - install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script - #delete extra rpath - for dhcpFile in $(find ${D} -type f) - do - file ${dhcpFile} | grep ELF || continue - readelf -a ${dhcpFile} | grep rpath || continue - ${RPATH_DELETE} ${dhcpFile} - done + install -d ${D}${sysconfdir}/init.d + install -d ${D}${sysconfdir}/default + install -d ${D}${sysconfdir}/dhcp + install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay + install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay + install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server + install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server + + rm -f ${D}${sysconfdir}/dhclient.conf* + rm -f ${D}${sysconfdir}/dhcpd.conf* + install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf + install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf + + install -d ${D}${base_sbindir}/ + if [ "${sbindir}" != "${base_sbindir}" ]; then + mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/ + fi + install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script + + # Install systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/dhcpd6.service ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system + sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service ${D}${systemd_unitdir}/system/dhcrelay.service + sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcpd*.service + sed -i -e 's,@base_bindir@,${base_bindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service + sed -i -e 's,@localstatedir@,${localstatedir},g' ${D}${systemd_unitdir}/system/dhcpd*.service + sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcrelay.service + + install -d ${D}${base_sbindir} + install -m 0755 ${WORKDIR}/dhclient-systemd-wrapper ${D}${base_sbindir}/dhclient-systemd-wrapper + install -m 0644 ${WORKDIR}/dhclient.service ${D}${systemd_unitdir}/system + sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhclient.service + sed -i -e 's,@BASE_SBINDIR@,${base_sbindir},g' ${D}${systemd_unitdir}/system/dhclient.service } PACKAGES += "dhcp-libs dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell" -FILES_${PN} = "${base_sbindir}/dhclient \ - ${base_sbindir}/dhclient-script \ - ${sysconfdir}/dhcp/dhclient.conf \ - ${bindir}/omshell \ - ${sbindir}/dhcrelay \ - " +PACKAGES_remove = "${PN}" +RDEPENDS_${PN}-client += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'iproute2', '', d)}" RDEPENDS_${PN}-dev = "" RDEPENDS_${PN}-staticdev = "" FILES_${PN}-libs = "${libdir}/libdhcpctl.so.0* ${libdir}/libomapi.so.0* ${libdir}/libdhcp.so.0*" @@ -159,6 +120,12 @@ FILES_${PN}-client = "${base_sbindir}/dhclient \ FILES_${PN}-omshell = "${bindir}/omshell" +pkg_postinst_dhcp-server() { + mkdir -p $D/${localstatedir}/lib/dhcp + touch $D/${localstatedir}/lib/dhcp/dhcpd.leases + touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases +} + pkg_postinst_dhcp-client() { mkdir -p $D/${localstatedir}/lib/dhcp } diff --git a/meta-openeuler/recipes-connectivity/dhcp/dhcp/0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch new file mode 100644 index 0000000000000000000000000000000000000000..d1b57f0bb410afafd72a6924ddae5157ef03e90b --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch @@ -0,0 +1,27 @@ +From 7cc29144535a622fc671dc86eb1da65b0473a7c4 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Tue, 15 Aug 2017 16:14:22 +0800 +Subject: [PATCH 01/11] define macro _PATH_DHCPD_CONF and _PATH_DHCLIENT_CONF + +Upstream-Status: Inappropriate [OE specific] + +Rebase to 4.3.6 +Signed-off-by: Hongxu Jia +--- + includes/site.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: dhcp-4.4.1/includes/site.h +=================================================================== +--- dhcp-4.4.1.orig/includes/site.h ++++ dhcp-4.4.1/includes/site.h +@@ -148,7 +148,8 @@ + /* Define this if you want the dhcpd.conf file to go somewhere other than + the default location. By default, it goes in /etc/dhcpd.conf. */ + +-/* #define _PATH_DHCPD_CONF "/etc/dhcpd.conf" */ ++#define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf" ++#define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf" + + /* Network API definitions. You do not need to choose one of these - if + you don't choose, one will be chosen for you in your system's config diff --git a/meta-openeuler/recipes-connectivity/dhcp/dhcp/0001-workaround-busybox-limitation-in-linux-dhclient-script.patch b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0001-workaround-busybox-limitation-in-linux-dhclient-script.patch new file mode 100644 index 0000000000000000000000000000000000000000..2359381b93802b30f2db73f84210ba0e2e5443d6 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0001-workaround-busybox-limitation-in-linux-dhclient-script.patch @@ -0,0 +1,65 @@ +From eec0503cfc36f63d777f5cb3f2719cecedcb8468 Mon Sep 17 00:00:00 2001 +From: Haris Okanovic +Date: Mon, 7 Jan 2019 13:22:09 -0600 +Subject: [PATCH] Workaround busybox limitation in Linux dhclient-script + +Busybox is a lightweight implementation of coreutils commonly used on +space-constrained embedded Linux distributions. It's implementation of +chown and chmod doesn't provide a "--reference" option added to +client/scripts/linux as of commit 9261cb14. This change works around +that limitation by using stat to read ownership and permissions flags +and simple chown/chmod calls supported in both coreutils and busybox. + + modified: client/scripts/linux + +Signed-off-by: Haris Okanovic +Upstream-Status: Pending [ISC-Bugs #48771] +--- + client/scripts/linux | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +diff --git a/client/scripts/linux b/client/scripts/linux +index 0c429697..2435a44b 100755 +--- a/client/scripts/linux ++++ b/client/scripts/linux +@@ -32,6 +32,17 @@ + # if your system holds ip tool in a non-standard location. + ip=/sbin/ip + ++chown_chmod_by_reference() { ++ local reference_file="$1" ++ local target_file="$2" ++ ++ local owner=$(stat -c "%u:%g" "$reference_file") ++ local perm=$(stat -c "%a" "$reference_file") ++ ++ chown "$owner" "$target_file" ++ chmod "$perm" "$target_file" ++} ++ + # update /etc/resolv.conf based on received values + # This updated version mostly follows Debian script by Andrew Pollock et al. + make_resolv_conf() { +@@ -74,8 +85,7 @@ make_resolv_conf() { + fi + + if [ -f /etc/resolv.conf ]; then +- chown --reference=/etc/resolv.conf $new_resolv_conf +- chmod --reference=/etc/resolv.conf $new_resolv_conf ++ chown_chmod_by_reference /etc/resolv.conf $new_resolv_conf + fi + mv -f $new_resolv_conf /etc/resolv.conf + # DHCPv6 +@@ -101,8 +111,7 @@ make_resolv_conf() { + fi + + if [ -f /etc/resolv.conf ]; then +- chown --reference=/etc/resolv.conf $new_resolv_conf +- chmod --reference=/etc/resolv.conf $new_resolv_conf ++ chown_chmod_by_reference /etc/resolv.conf $new_resolv_conf + fi + mv -f $new_resolv_conf /etc/resolv.conf + fi +-- +2.20.0 + diff --git a/meta-openeuler/recipes-connectivity/dhcp/dhcp/0002-dhclient-dbus.patch b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0002-dhclient-dbus.patch new file mode 100644 index 0000000000000000000000000000000000000000..101c33f677a87010186c7ec2dcad7b6c06cb7bc5 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0002-dhclient-dbus.patch @@ -0,0 +1,117 @@ +From be7540d31c356e80ee02e90e8bf162b7ac6e5ba5 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Tue, 15 Aug 2017 14:56:56 +0800 +Subject: [PATCH 02/11] dhclient dbus + +Upstream-Status: Inappropriate [distribution] + +Rebase to 4.3.6 +Signed-off-by: Hongxu Jia +--- + client/scripts/bsdos | 5 +++++ + client/scripts/freebsd | 5 +++++ + client/scripts/linux | 5 +++++ + client/scripts/netbsd | 5 +++++ + client/scripts/openbsd | 5 +++++ + client/scripts/solaris | 5 +++++ + 6 files changed, 30 insertions(+) + +diff --git a/client/scripts/bsdos b/client/scripts/bsdos +index d69d0d8..095b143 100755 +--- a/client/scripts/bsdos ++++ b/client/scripts/bsdos +@@ -45,6 +45,11 @@ exit_with_hooks() { + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script ++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then ++ dbus-send --system --dest=com.redhat.dhcp \ ++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \ ++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`" ++ fi + exit $exit_status + } + +diff --git a/client/scripts/freebsd b/client/scripts/freebsd +index 8f3e2a2..ad7fb44 100755 +--- a/client/scripts/freebsd ++++ b/client/scripts/freebsd +@@ -89,6 +89,11 @@ exit_with_hooks() { + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script ++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then ++ dbus-send --system --dest=com.redhat.dhcp \ ++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \ ++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`" ++ fi + exit $exit_status + } + +diff --git a/client/scripts/linux b/client/scripts/linux +index 5fb1612..3d447b6 100755 +--- a/client/scripts/linux ++++ b/client/scripts/linux +@@ -174,6 +174,11 @@ exit_with_hooks() { + exit_status=$? + fi + ++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then ++ dbus-send --system --dest=com.redhat.dhcp \ ++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \ ++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`" ++ fi + exit $exit_status + } + +diff --git a/client/scripts/netbsd b/client/scripts/netbsd +index 07383b7..aaba8e8 100755 +--- a/client/scripts/netbsd ++++ b/client/scripts/netbsd +@@ -45,6 +45,11 @@ exit_with_hooks() { + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script ++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then ++ dbus-send --system --dest=com.redhat.dhcp \ ++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \ ++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`" ++ fi + exit $exit_status + } + +diff --git a/client/scripts/openbsd b/client/scripts/openbsd +index e7f4746..56b980c 100644 +--- a/client/scripts/openbsd ++++ b/client/scripts/openbsd +@@ -45,6 +45,11 @@ exit_with_hooks() { + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script ++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then ++ dbus-send --system --dest=com.redhat.dhcp \ ++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \ ++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`" ++ fi + exit $exit_status + } + +diff --git a/client/scripts/solaris b/client/scripts/solaris +index af553b9..4a2aa69 100755 +--- a/client/scripts/solaris ++++ b/client/scripts/solaris +@@ -26,6 +26,11 @@ exit_with_hooks() { + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script ++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then ++ dbus-send --system --dest=com.redhat.dhcp \ ++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \ ++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`" ++ fi + exit $exit_status + } + +-- +1.8.3.1 + diff --git a/meta-openeuler/recipes-connectivity/dhcp/dhcp/0003-link-with-lcrypto.patch b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0003-link-with-lcrypto.patch new file mode 100644 index 0000000000000000000000000000000000000000..dabac108b6add3da9e56d361819c58473ae286b0 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0003-link-with-lcrypto.patch @@ -0,0 +1,34 @@ +From d80bd792323dbd56269309f85b4506eb6b1b60e9 Mon Sep 17 00:00:00 2001 +From: Andrei Gherzan +Date: Tue, 15 Aug 2017 15:05:47 +0800 +Subject: [PATCH 03/11] link with lcrypto + +From 4.2.0 final release, -lcrypto check was removed and we compile +static libraries +from bind that are linked to libcrypto. This is why i added a patch in +order to add +-lcrypto to LIBS. + +Upstream-Status: Pending +Signed-off-by: Andrei Gherzan + +Rebase to 4.3.6 +Signed-off-by: Hongxu Jia +--- + configure.ac | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: dhcp-4.4.1/configure.ac +=================================================================== +--- dhcp-4.4.1.orig/configure.ac ++++ dhcp-4.4.1/configure.ac +@@ -612,6 +612,10 @@ + fi + ++# find an MD5 library ++AC_SEARCH_LIBS(MD5_Init, [crypto]) ++AC_SEARCH_LIBS(MD5Init, [crypto]) ++ + # Solaris needs some libraries for functions + AC_SEARCH_LIBS(socket, [socket]) + AC_SEARCH_LIBS(inet_ntoa, [nsl]) diff --git a/meta-openeuler/recipes-connectivity/dhcp/dhcp/0004-Fix-out-of-tree-builds.patch b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0004-Fix-out-of-tree-builds.patch new file mode 100644 index 0000000000000000000000000000000000000000..9c189d802c29ad80bd7f77f9e6ea968c9eefbcf0 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0004-Fix-out-of-tree-builds.patch @@ -0,0 +1,95 @@ +From cccec0344d68dac4100b6f260ee24e7c2da9dfda Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Tue, 15 Aug 2017 15:08:22 +0800 +Subject: [PATCH 04/11] Fix out of tree builds + +Upstream-Status: Pending + +RP 2013/03/21 + +Rebase to 4.3.6 + +Signed-off-by: Hongxu Jia +--- + client/Makefile.am | 4 ++-- + common/Makefile.am | 3 ++- + dhcpctl/Makefile.am | 2 ++ + omapip/Makefile.am | 1 + + relay/Makefile.am | 2 +- + server/Makefile.am | 2 +- + 6 files changed, 9 insertions(+), 5 deletions(-) + +Index: dhcp-4.4.3/common/Makefile.am +=================================================================== +--- dhcp-4.4.3.orig/common/Makefile.am ++++ dhcp-4.4.3/common/Makefile.am +@@ -1,4 +1,5 @@ +-AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"' ++AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"' ++ + AM_CFLAGS = $(LDAP_CFLAGS) + + lib_LIBRARIES = libdhcp.a +Index: dhcp-4.4.3/dhcpctl/Makefile.am +=================================================================== +--- dhcp-4.4.3.orig/dhcpctl/Makefile.am ++++ dhcp-4.4.3/dhcpctl/Makefile.am +@@ -3,6 +3,8 @@ BINDLIBDNSDIR=@BINDLIBDNSDIR@ + BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@ + BINDLIBISCDIR=@BINDLIBISCDIR@ + ++AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir) ++ + bin_PROGRAMS = omshell + lib_LIBRARIES = libdhcpctl.a + noinst_PROGRAMS = cltest cltest2 +Index: dhcp-4.4.3/server/Makefile.am +=================================================================== +--- dhcp-4.4.3.orig/server/Makefile.am ++++ dhcp-4.4.3/server/Makefile.am +@@ -4,7 +4,7 @@ + # production code. Sadly, we are not there yet. + SUBDIRS = . tests + +-AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"' ++AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes + + dist_sysconf_DATA = dhcpd.conf.example + sbin_PROGRAMS = dhcpd +Index: dhcp-4.4.3/client/Makefile.am +=================================================================== +--- dhcp-4.4.3.orig/client/Makefile.am ++++ dhcp-4.4.3/client/Makefile.am +@@ -5,7 +5,7 @@ + SUBDIRS = . tests + + AM_CPPFLAGS = -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' +-AM_CPPFLAGS += -DLOCALSTATEDIR='"$(localstatedir)"' ++AM_CPPFLAGS += -DLOCALSTATEDIR='"$(localstatedir)"' -I$(top_srcdir)/includes + + dist_sysconf_DATA = dhclient.conf.example + sbin_PROGRAMS = dhclient +Index: dhcp-4.4.3/omapip/Makefile.am +=================================================================== +--- dhcp-4.4.3.orig/omapip/Makefile.am ++++ dhcp-4.4.3/omapip/Makefile.am +@@ -2,6 +2,7 @@ BINDLIBIRSDIR=@BINDLIBIRSDIR@ + BINDLIBDNSDIR=@BINDLIBDNSDIR@ + BINDLIBISCCFGDIR=@BINDLIBISCCFGDIR@ + BINDLIBISCDIR=@BINDLIBISCDIR@ ++AM_CPPFLAGS = -I$(top_srcdir)/includes + + lib_LIBRARIES = libomapi.a + noinst_PROGRAMS = svtest +Index: dhcp-4.4.3/relay/Makefile.am +=================================================================== +--- dhcp-4.4.3.orig/relay/Makefile.am ++++ dhcp-4.4.3/relay/Makefile.am +@@ -1,6 +1,6 @@ + SUBDIRS = . tests + +-AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"' ++AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes + + sbin_PROGRAMS = dhcrelay + dhcrelay_SOURCES = dhcrelay.c diff --git a/meta-openeuler/recipes-connectivity/dhcp/dhcp/0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch new file mode 100644 index 0000000000000000000000000000000000000000..dd56381b1dc3b0688ec2cba5fcc0ea9c127d9771 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch @@ -0,0 +1,36 @@ +From 2e8ff0e4f6d39e346ea86b8c514ab4ccc78fa359 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Tue, 15 Aug 2017 15:24:14 +0800 +Subject: [PATCH 05/11] dhcp-client: fix invoke dhclient-script failed on + Read-only file system + +In read-only file system, '/etc' is on the readonly partition, +and '/etc/resolv.conf' is symlinked to a separate writable +partition. + +In this situation, we create temp files 'resolv.conf.dhclient-new' +in /tmp dir. + +Upstream-Status: Pending + +Signed-off-by: Hongxu Jia +--- + client/scripts/linux | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/client/scripts/linux b/client/scripts/linux +index 3d447b6..3122a75 100755 +--- a/client/scripts/linux ++++ b/client/scripts/linux +@@ -40,7 +40,7 @@ make_resolv_conf() { + # DHCPv4 + if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] || + [ -n "$new_domain_name_servers" ]; then +- new_resolv_conf=/etc/resolv.conf.dhclient-new ++ new_resolv_conf=/tmp/resolv.conf.dhclient-new + rm -f $new_resolv_conf + + if [ -n "$new_domain_name" ]; then +-- +1.8.3.1 + diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch similarity index 82% rename from meta-openeuler/recipes-core/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch rename to meta-openeuler/recipes-connectivity/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch index feb0754fff480805543e4169975c59da4a9d1bda..c50d43324f52745468d4f56bac9a92767fa3a526 100644 --- a/meta-openeuler/recipes-core/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch @@ -15,11 +15,11 @@ Signed-off-by: Hongxu Jia configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) -Index: dhcp-4.4.1/configure.ac +Index: dhcp-4.4.3/configure.ac =================================================================== ---- dhcp-4.4.1.orig/configure.ac -+++ dhcp-4.4.1/configure.ac -@@ -642,6 +642,17 @@ if test "$have_nanosleep" = "rt"; then +--- dhcp-4.4.3.orig/configure.ac ++++ dhcp-4.4.3/configure.ac +@@ -633,6 +633,17 @@ if test "$have_nanosleep" = "rt"; then LIBS="-lrt $LIBS" fi @@ -34,14 +34,14 @@ Index: dhcp-4.4.1/configure.ac + fi]) +fi + - # check for /dev/random (declares HAVE_DEV_RANDOM) + # check for /dev/random (declares ISC_PATH_RANDOMDEV) AC_MSG_CHECKING(for random device) AC_ARG_WITH(randomdev, -Index: dhcp-4.4.1/configure.ac+lt +Index: dhcp-4.4.3/configure.ac+lt =================================================================== ---- dhcp-4.4.1.orig/configure.ac+lt -+++ dhcp-4.4.1/configure.ac+lt -@@ -909,6 +909,18 @@ elif test "$want_libtool" = "yes" -a "$u +--- dhcp-4.4.3.orig/configure.ac+lt ++++ dhcp-4.4.3/configure.ac+lt +@@ -900,6 +900,18 @@ elif test "$want_libtool" = "yes" -a "$u fi AM_CONDITIONAL(INSTALL_BIND, test "$want_install_bind" = "yes") diff --git a/meta-openeuler/recipes-connectivity/dhcp/dhcp/0009-remove-dhclient-script-bash-dependency.patch b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0009-remove-dhclient-script-bash-dependency.patch new file mode 100644 index 0000000000000000000000000000000000000000..912b6d6312c4f9a32cba8ecc07a76d0b687e8f9b --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0009-remove-dhclient-script-bash-dependency.patch @@ -0,0 +1,28 @@ +From f3f8b7726e50e24ef3edf5fa5a17e31d39118d7e Mon Sep 17 00:00:00 2001 +From: Andre McCurdy +Date: Tue, 15 Aug 2017 15:49:31 +0800 +Subject: [PATCH 09/11] remove dhclient-script bash dependency + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Andre McCurdy + +Rebase to 4.3.6 +Signed-off-by: Hongxu Jia +--- + client/scripts/linux | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/client/scripts/linux b/client/scripts/linux +index 3122a75..1712d7d 100755 +--- a/client/scripts/linux ++++ b/client/scripts/linux +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # dhclient-script for Linux. Dan Halbert, March, 1997. + # Updated for Linux 2.[12] by Brian J. Murrell, January 1999. + # No guarantees about this. I'm a novice at the details of Linux +-- +1.8.3.1 + diff --git a/meta-openeuler/recipes-connectivity/dhcp/dhcp/0012-dhcp-correct-the-intention-for-xml2-lib-search.patch b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0012-dhcp-correct-the-intention-for-xml2-lib-search.patch new file mode 100644 index 0000000000000000000000000000000000000000..39ba65fbc4625ea2ccc6f123f65783798e2bebc1 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0012-dhcp-correct-the-intention-for-xml2-lib-search.patch @@ -0,0 +1,34 @@ +From 501543b3ef715488a142e3d301ff2733aa33eec7 Mon Sep 17 00:00:00 2001 +From: Awais Belal +Date: Wed, 25 Oct 2017 21:00:05 +0500 +Subject: [PATCH] dhcp: correct the intention for xml2 lib search + +A missing case breaks the build when libxml2 is +required and found appropriately. The third argument +to the function AC_SEARCH_LIB is action-if-found which +was mistakenly been used for the case where the library +is not found and hence breaks the configure phase +where it shoud actually pass. +We now pass on silently when action-if-found is +executed. + +Upstream-Status: Pending + +Signed-off-by: Awais Belal +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: dhcp-4.4.1/configure.ac +=================================================================== +--- dhcp-4.4.1.orig/configure.ac ++++ dhcp-4.4.1/configure.ac +@@ -647,7 +647,7 @@ AC_ARG_WITH(libxml2, + with_libxml2="$withval", with_libxml2="no") + + if test x$with_libxml2 != xno; then +- AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2], ++ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],, + [if test x$with_libxml2 != xauto; then + AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested]) + fi]) diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/0013-fixup_use_libbind.patch b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0013-fixup_use_libbind.patch similarity index 90% rename from meta-openeuler/recipes-core/dhcp/dhcp/0013-fixup_use_libbind.patch rename to meta-openeuler/recipes-connectivity/dhcp/dhcp/0013-fixup_use_libbind.patch index fcec010bd01fae0695c7a159319731e34a32f517..9982d3df5210a87bd823f8dc2cb5e4b8a0784df2 100644 --- a/meta-openeuler/recipes-core/dhcp/dhcp/0013-fixup_use_libbind.patch +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp/0013-fixup_use_libbind.patch @@ -5,11 +5,11 @@ use libdir and includedir vars Upstream-Status: Pending Signed-off-by: Armin Kuster -Index: dhcp-4.4.1/configure.ac+lt +Index: dhcp-4.4.3/configure.ac+lt =================================================================== ---- dhcp-4.4.1.orig/configure.ac+lt -+++ dhcp-4.4.1/configure.ac+lt -@@ -801,22 +801,22 @@ no) +--- dhcp-4.4.3.orig/configure.ac+lt ++++ dhcp-4.4.3/configure.ac+lt +@@ -792,22 +792,22 @@ no) if test ! -d "$use_libbind"; then AC_MSG_ERROR([Cannot find bind directory at $use_libbind]) fi @@ -35,7 +35,7 @@ Index: dhcp-4.4.1/configure.ac+lt - BINDLIBIRSDIR="$BINDDIR/lib" - BINDLIBDNSDIR="$BINDDIR/lib" - BINDLIBISCCFGDIR="$BINDDIR/lib" -- BINDLIBISCDIR="$BINDDIR/lib" +- BINDLIBISCDIR="$BINDDIR/lib" + BINDLIBIRSDIR="$BINDDIR/$libdir" + BINDLIBDNSDIR="$BINDDIR/$libdir" + BINDLIBISCCFGDIR="$BINDDIR/$libdir" @@ -43,7 +43,7 @@ Index: dhcp-4.4.1/configure.ac+lt DISTCHECK_LIBBIND_CONFIGURE_FLAG="--with-libbind=$use_libbind" ;; esac -@@ -856,14 +856,14 @@ AC_ARG_ENABLE(libtool, +@@ -847,14 +847,14 @@ AC_ARG_ENABLE(libtool, if test "$use_libbind" != "no"; then if test "$want_libtool" = "yes" -a \ diff --git a/meta-openeuler/recipes-connectivity/dhcp/dhcp_%.bbappend b/meta-openeuler/recipes-connectivity/dhcp/dhcp_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..44bf0c2b1d3c19f17c826d8db60fa551fb4ed4bb --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp_%.bbappend @@ -0,0 +1,68 @@ +# source bb: meta-overc/recipes-connectivity/dhcp/dhcp_4.4.2-P1.bb +# update patches: +# 0004-Fix-out-of-tree-builds.patch, +# 0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch, +# 0013-fixup_use_libbind.patch + +# version in openEuler +PV = "4.4.3" + +LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=613211e713c4ffc489ec370e1caceabb" + +# apply patches in openEuler +# backport-0025-bind-Detect-system-time-changes.patch, backport-Fix-CVE-2021-25220.patch for bind +SRC_URI_prepend = "file://backport-0001-change-bug-url.patch \ + file://backport-0002-additional-dhclient-options.patch \ + file://backport-0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch \ + file://backport-0004-Support-unicast-BOOTP-for-IBM-pSeries-systems-and-ma.patch \ + file://backport-0005-Change-default-requested-options.patch \ + file://backport-0006-Various-man-page-only-fixes.patch \ + file://backport-0007-Change-paths-to-conform-to-our-standards.patch \ + file://backport-0008-Make-sure-all-open-file-descriptors-are-closed-on-ex.patch \ + file://backport-0009-Fix-garbage-in-format-string-error.patch \ + file://backport-0010-Handle-null-timeout.patch \ + file://backport-0011-Drop-unnecessary-capabilities.patch \ + file://backport-0012-RFC-3442-Classless-Static-Route-Option-for-DHCPv4-51.patch \ + file://backport-0013-DHCPv6-over-PPP-support-626514.patch \ + file://backport-0014-IPoIB-support-660681.patch \ + file://backport-0015-Add-GUID-DUID-to-dhcpd-logs-1064416.patch \ + file://backport-0016-Turn-on-creating-sending-of-DUID.patch \ + file://backport-0017-Send-unicast-request-release-via-correct-interface.patch \ + file://backport-0018-No-subnet-declaration-for-iface-should-be-info-not-e.patch \ + file://backport-0019-dhclient-write-DUID_LLT-even-in-stateless-mode-11563.patch \ + file://backport-0020-Discover-all-hwaddress-for-xid-uniqueness.patch \ + file://backport-0021-Load-leases-DB-in-non-replay-mode-only.patch \ + file://backport-0022-dhclient-make-sure-link-local-address-is-ready-in-st.patch \ + file://backport-0023-option-97-pxe-client-id.patch \ + file://backport-0024-Detect-system-time-changes.patch \ + file://backport-0026-Add-dhclient-5-B-option-description.patch \ + file://backport-0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch \ + file://bugfix-dhcp-4.2.5-check-dhclient-pid.patch \ + file://bugfix-reduce-getifaddr-calls.patch \ + file://bugfix-dhcpd-2038-problem.patch \ + file://dhcpd-coredump-infiniband.patch \ + file://bugfix-dhclient-check-if-pid-was-held.patch \ + file://bugfix-dhcp-64-bit-lease-parse.patch \ + file://fix-coredump-when-client-active-is-NULL.patch \ + file://feature-lease-time-config-ipv6.patch \ + file://add-a-test-case-to-parse-code93-in-option_unittest.patch \ + file://bugfix-error-message-display.patch \ + file://backport-Fix-CVE-2022-2928.patch \ + file://backport-Fix-CVE-2022-2929.patch \ +" + +SRC_URI[md5sum] = "9076af4cc1293dde5a7c6cae7de6ab45" +SRC_URI[sha256sum] = "0e3ec6b4c2a05ec0148874bcd999a66d05518378d77421f607fb0bc9d0135818" + +# it will make a error when using dhclient +# because backport-0007-Change-paths-to-conform-to-our-standards.patch +# changed the path /sbin/dhclient-script to /usr/sbin/dhclient-script for dhclient finding dhclient-script +# so re-install the dhclient-script to fix it. +do_install_append() { + rm -f ${D}${base_sbindir}/dhclient-script + install -m 0755 ${S}/client/scripts/linux ${D}${sbindir}/dhclient-script +} + +FILES_${PN}-client += "${sbindir}/dhclient-script " + +FILES_${PN}-client_remove = "${base_sbindir}/dhclient-script" diff --git a/meta-openeuler/recipes-connectivity/dhcp/dhcp_4.4.2-P1.bb b/meta-openeuler/recipes-connectivity/dhcp/dhcp_4.4.2-P1.bb new file mode 100644 index 0000000000000000000000000000000000000000..9b9e73e7f5ed1e3071b2608243ab820897a9ff46 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/dhcp_4.4.2-P1.bb @@ -0,0 +1,23 @@ +require dhcp.inc + +SRC_URI += "file://0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch \ + file://0002-dhclient-dbus.patch \ + file://0003-link-with-lcrypto.patch \ + file://0004-Fix-out-of-tree-builds.patch \ + file://0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch \ + file://0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch \ + file://0009-remove-dhclient-script-bash-dependency.patch \ + file://0012-dhcp-correct-the-intention-for-xml2-lib-search.patch \ + file://0013-fixup_use_libbind.patch \ + file://0001-workaround-busybox-limitation-in-linux-dhclient-script.patch \ +" + +SRC_URI[md5sum] = "3089a1ebd20a802ec0870ae337d43907" +SRC_URI[sha256sum] = "b05e04337539545a8faa0d6ac518defc61a07e5aec66a857f455e7f218c85a1a" + +LDFLAGS_append = " -pthread" + +PACKAGECONFIG ?= "" +PACKAGECONFIG[bind-httpstats] = "--with-libxml2,--without-libxml2,libxml2" + +CFLAGS += "-fcommon" diff --git a/meta-openeuler/recipes-connectivity/dhcp/files/default-relay b/meta-openeuler/recipes-connectivity/dhcp/files/default-relay new file mode 100644 index 0000000000000000000000000000000000000000..7961f014bef330d8e30709a50185b6057982fe68 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/files/default-relay @@ -0,0 +1,12 @@ +# Defaults for dhcp-relay initscript +# sourced by /etc/init.d/dhcp-relay + +# What servers should the DHCP relay forward requests to? +# e.g: SERVERS="192.168.0.1" +SERVERS="" + +# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests? +INTERFACES="" + +# Additional options that are passed to the DHCP relay daemon? +OPTIONS="" diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/default-server b/meta-openeuler/recipes-connectivity/dhcp/files/default-server similarity index 100% rename from meta-openeuler/recipes-core/dhcp/dhcp/default-server rename to meta-openeuler/recipes-connectivity/dhcp/files/default-server diff --git a/meta-openeuler/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper b/meta-openeuler/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper new file mode 100644 index 0000000000000000000000000000000000000000..7d0e224a1dff6c6d112eb8299bc6dcd74f6bcb1d --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper @@ -0,0 +1,39 @@ +#!/bin/sh + +# In case the interface is used for nfs, skip it. +nfsroot=0 +interfaces="" +exec 9<&0 < /proc/mounts +while read dev mtpt fstype rest; do + if test $mtpt = "/" ; then + case $fstype in + nfs | nfs4) + nfsroot=1 + nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'` + break + ;; + *) + ;; + esac + fi +done +exec 0<&9 9<&- + +if [ $nfsroot -eq 0 ]; then + interfaces="$INTERFACES" +else + if [ -x /bin/ip -o -x /sbin/ip ] ; then + nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'` + fi + for i in $INTERFACES; do + if test "x$i" = "x$nfs_iface"; then + echo "dhclient skipping nfsroot interface $i" + else + interfaces="$interfaces $i" + fi + done +fi + +if test "x$interfaces" != "x"; then + /sbin/dhclient -d -cf /etc/dhcp/dhclient.conf -q -lf /var/lib/dhcp/dhclient.leases $interfaces +fi diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/dhclient.conf b/meta-openeuler/recipes-connectivity/dhcp/files/dhclient.conf similarity index 100% rename from meta-openeuler/recipes-core/dhcp/dhcp/dhclient.conf rename to meta-openeuler/recipes-connectivity/dhcp/files/dhclient.conf diff --git a/meta-openeuler/recipes-connectivity/dhcp/files/dhclient.service b/meta-openeuler/recipes-connectivity/dhcp/files/dhclient.service new file mode 100644 index 0000000000000000000000000000000000000000..9ddb4d1dfe92cce1373fe80b9ab8bd4b784839e6 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/files/dhclient.service @@ -0,0 +1,13 @@ +[Unit] +Description=Dynamic Host Configuration Protocol (DHCP) +Wants=network.target +Before=network.target +After=systemd-udevd.service + +[Service] +EnvironmentFile=-@SYSCONFDIR@/default/dhcp-client +ExecStart=@BASE_SBINDIR@/dhclient-systemd-wrapper +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/dhcpd.conf b/meta-openeuler/recipes-connectivity/dhcp/files/dhcpd.conf similarity index 100% rename from meta-openeuler/recipes-core/dhcp/dhcp/dhcpd.conf rename to meta-openeuler/recipes-connectivity/dhcp/files/dhcpd.conf diff --git a/meta-openeuler/recipes-connectivity/dhcp/files/dhcpd.service b/meta-openeuler/recipes-connectivity/dhcp/files/dhcpd.service new file mode 100644 index 0000000000000000000000000000000000000000..ae4f93eca5baac10d404cd0bb39429f835c4ac41 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/files/dhcpd.service @@ -0,0 +1,15 @@ +[Unit] +Description=DHCPv4 Server Daemon +Documentation=man:dhcpd(8) man:dhcpd.conf(5) +After=network.target +After=time-sync.target + +[Service] +PIDFile=@localstatedir@/run/dhcpd.pid +EnvironmentFile=@SYSCONFDIR@/default/dhcp-server +EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcp-server +ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd.leases +ExecStart=@SBINDIR@/dhcpd -f -cf @SYSCONFDIR@/dhcp/dhcpd.conf -pf @localstatedir@/run/dhcpd.pid $DHCPDARGS -q $INTERFACES + +[Install] +WantedBy=multi-user.target diff --git a/meta-openeuler/recipes-connectivity/dhcp/files/dhcpd6.service b/meta-openeuler/recipes-connectivity/dhcp/files/dhcpd6.service new file mode 100644 index 0000000000000000000000000000000000000000..52a6224dc2c9990ee49971277054fbf64ba62868 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/files/dhcpd6.service @@ -0,0 +1,15 @@ +[Unit] +Description=DHCPv6 Server Daemon +Documentation=man:dhcpd(8) man:dhcpd.conf(5) +After=network.target +After=time-sync.target + +[Service] +PIDFile=@localstatedir@/run/dhcpd6.pid +EnvironmentFile=@SYSCONFDIR@/default/dhcp-server +EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcpd6 +ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd6.leases +ExecStart=@SBINDIR@/dhcpd -f -6 -cf @SYSCONFDIR@/dhcp/dhcpd6.conf -pf @localstatedir@/run/dhcpd6.pid $DHCPDARGS -q $INTERFACES + +[Install] +WantedBy=multi-user.target diff --git a/meta-openeuler/recipes-connectivity/dhcp/files/dhcrelay.service b/meta-openeuler/recipes-connectivity/dhcp/files/dhcrelay.service new file mode 100644 index 0000000000000000000000000000000000000000..15ff927d34642dda69a9dfe9d156aecc04f37d78 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/files/dhcrelay.service @@ -0,0 +1,10 @@ +[Unit] +Description=DHCP Relay Agent Daemon +After=network.target + +[Service] +EnvironmentFile=@SYSCONFDIR@/default/dhcp-relay +ExecStart=@SBINDIR@/dhcrelay -d --no-pid -q $SERVERS + +[Install] +WantedBy=multi-user.target diff --git a/meta-openeuler/recipes-connectivity/dhcp/files/init-relay b/meta-openeuler/recipes-connectivity/dhcp/files/init-relay new file mode 100644 index 0000000000000000000000000000000000000000..019a7e84cf477aa878f93b878583960207781078 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/dhcp/files/init-relay @@ -0,0 +1,44 @@ +#!/bin/sh +# +# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $ +# + +# It is not safe to start if we don't have a default configuration... +if [ ! -f /etc/default/dhcp-relay ]; then + echo "/etc/default/dhcp-relay does not exist! - Aborting..." + echo "create this file to fix the problem." + exit 1 +fi + +# Read init script configuration (interfaces the daemon should listen on +# and the DHCP server we should forward requests to.) +. /etc/default/dhcp-relay + +# Build command line for interfaces (will be passed to dhrelay below.) +IFCMD="" +if test "$INTERFACES" != ""; then + for I in $INTERFACES; do + IFCMD=${IFCMD}"-i "${I}" " + done +fi + +DHCRELAYPID=/var/run/dhcrelay.pid + +case "$1" in + start) + start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS + ;; + stop) + start-stop-daemon -K -x /usr/sbin/dhcrelay + ;; + restart | force-reload) + $0 stop + sleep 2 + $0 start + ;; + *) + echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}" + exit 1 +esac + +exit 0 diff --git a/meta-openeuler/recipes-core/dhcp/dhcp/init-server b/meta-openeuler/recipes-connectivity/dhcp/files/init-server similarity index 100% rename from meta-openeuler/recipes-core/dhcp/dhcp/init-server rename to meta-openeuler/recipes-connectivity/dhcp/files/init-server diff --git a/meta-openeuler/recipes-connectivity/iproute2/iproute2_%.bbappend b/meta-openeuler/recipes-connectivity/iproute2/iproute2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..1957468fbee3ff1e1bb10e7bda750bd3da415cd7 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/iproute2/iproute2_%.bbappend @@ -0,0 +1,13 @@ +PV = "6.1.0" +OPENEULER_REPO_NAME = "iproute" + +OPENEULER_SRC_URI_REMOVE = "https git http" +SRC_URI += " \ + file://${BPN}-${PV}.tar.xz \ + file://bugfix-iproute2-3.10.0-fix-maddr-show.patch \ + file://bugfix-iproute2-change-proc-to-ipnetnsproc-which-is-private.patch \ + file://backport-testsuite-fix-testsuite-build-failure-when-iproute-b.patch \ + file://bugfix-iproute2-cancel-some-test-cases.patch \ +" + +SRC_URI[sha256sum] = "5ce12a0fec6b212725ef218735941b2dab76244db7e72646a76021b0537b43ab" diff --git a/meta-openeuler/recipes-connectivity/libpcap/libpcap_%.bbappend b/meta-openeuler/recipes-connectivity/libpcap/libpcap_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a95c9a7991225412b3b4b71497be61fd19f7a52f --- /dev/null +++ b/meta-openeuler/recipes-connectivity/libpcap/libpcap_%.bbappend @@ -0,0 +1,11 @@ +# main bb file: yocto-poky/meta/recipes-connectivity/libpcap/libpcap_1.10.0.bb + +# version in openEuler +PV = "1.10.3" + +SRC_URI_prepend = "file://0003-pcap-linux-apparently-ctc-interfaces-on-s390-has-eth.patch \ + file://pcap-config-mitigate-multilib-conflict.patch \ + " + +SRC_URI[md5sum] = "c42fde2eb75a5075f19116f8c9768573" +SRC_URI[sha256sum] = "2a8885c403516cf7b0933ed4b14d6caa30e02052489ebd414dc75ac52e7559e6" diff --git a/meta-openeuler/recipes-connectivity/libuv/libuv_%.bbappend b/meta-openeuler/recipes-connectivity/libuv/libuv_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7b9936fb9db3ab485b8642a3e4bdc5d10f9ab8c3 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/libuv/libuv_%.bbappend @@ -0,0 +1,17 @@ +# main bb file: yocto-poky/meta/recipes-connectivity/libuv/libuv_1.41.0.bb + +# version in openEuler +PV = "1.42.0" + +OPENEULER_BRANCH = "openEuler-23.03" + +SRC_URI_remove = "git://github.com/libuv/libuv;branch=v1.x \ + git://github.com/libuv/libuv;branch=v1.x;protocol=https \ + " + +# apply openEuler source package +SRC_URI_prepend = "file://${BPN}-v${PV}.tar.gz \ + file://backport-Skip-some-tests.patch \ +" + +S = "${WORKDIR}/${BPN}-v${PV}" diff --git a/meta-openeuler/recipes-connectivity/mosquitto/files/mosquitto.init b/meta-openeuler/recipes-connectivity/mosquitto/files/mosquitto.init new file mode 100644 index 0000000000000000000000000000000000000000..9d5963c418d8859dbb8de5450a099aa83feb17cf --- /dev/null +++ b/meta-openeuler/recipes-connectivity/mosquitto/files/mosquitto.init @@ -0,0 +1,89 @@ +#! /bin/sh + +# Based on the Debian initscript for mosquitto + +### BEGIN INIT INFO +# Provides: mosquitto +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: mosquitto MQTT message broker +# Description: +# This is a message broker that supports version 3.1/3.1.1 of the MQ Telemetry +# Transport (MQTT) protocol. +# +# MQTT provides a method of carrying out messaging using a publish/subscribe +# model. It is lightweight, both in terms of bandwidth usage and ease of +# implementation. This makes it particularly useful at the edge of the network +# where a sensor or other simple device may be implemented using an arduino for +# example. +### END INIT INFO + +set -e + +PIDFILE=@LOCALSTATEDIR@/run/mosquitto.pid +DAEMON=@SBINDIR@/mosquitto + +# start and stop the mosquitto MQTT message broker + +test -x ${DAEMON} || exit 0 + +umask 022 + +. @SYSCONFDIR@/init.d/functions + +export PATH="${PATH:+$PATH:}@SBINDIR@:@BASE_SBINDIR@" + +case "$1" in + start) + echo "Starting Mosquitto message broker" "mosquitto" + if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- -c @SYSCONFDIR@/mosquitto/mosquitto.conf ; then + exit 0 + else + exit 1 + fi + ;; + stop) + echo "Stopping Mosquitto message broker" "mosquitto" + if start-stop-daemon --stop --quiet --oknodo --pidfile ${PIDFILE}; then + rm -f ${PIDFILE} + exit 0 + else + exit 1 + fi + ;; + + + reload|force-reload) + if [ -f ${PIDFILE} ] ; then + echo "Reloading configuration for mosquitto" + pid=`cat ${PIDFILE}` + kill -HUP $pid + else + echo "mosquitto does not seem to be running" + fi + ;; + + restart) + echo "Restarting Mosquitto message broker" "mosquitto" + if start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile ${PIDFILE}; then + rm -f ${PIDFILE} + fi + if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- -c @SYSCONFDIR@/mosquitto/mosquitto.conf ; then + exit 0 + else + exit 1 + fi + ;; + + status) + status ${DAEMON} && exit 0 || exit $? + ;; + + *) + echo "Usage: $0 {start|stop|reload|force-reload|restart|status}" + exit 1 +esac + +exit 0 diff --git a/meta-openeuler/recipes-connectivity/mosquitto/mosquitto_%.bbappend b/meta-openeuler/recipes-connectivity/mosquitto/mosquitto_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..60ca295c959c556b33db991bfbba83f0df28b291 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/mosquitto/mosquitto_%.bbappend @@ -0,0 +1,18 @@ +# main bbfile ref: http://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-connectivity/mosquitto?h=zeus + +PV = "1.6.15" + +SRC_URI_remove = " \ + http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \ +" + +SRC_URI_append = " \ + file://mosquitto-${PV}.tar.gz \ + file://add-usage-output.patch \ + file://fix-usage-exit-code.patch \ + file://CVE-2021-41039.patch \ + file://CVE-2021-34432.patch \ +" + +SRC_URI[md5sum] = "792bdd8fce3a8a1db102988ef6a9a02f" +SRC_URI[sha256sum] = "5ff2271512f745bf1a451072cd3768a5daed71e90c5179fae12b049d6c02aa0f" diff --git a/meta-openeuler/recipes-connectivity/mosquitto/mosquitto_1.6.7.bb b/meta-openeuler/recipes-connectivity/mosquitto/mosquitto_1.6.7.bb new file mode 100644 index 0000000000000000000000000000000000000000..340f643d4afbb0d9c0bc534ad9e3bd05b551765f --- /dev/null +++ b/meta-openeuler/recipes-connectivity/mosquitto/mosquitto_1.6.7.bb @@ -0,0 +1,98 @@ +SUMMARY = "Open source MQTT implementation" +DESCRIPTION = "Mosquitto is an open source (Eclipse licensed) message broker \ +that implements the MQ Telemetry Transport protocol version 3.1, 3.1.1 and \ +5, providing both an MQTT broker and several command-line clients. MQTT \ +provides a lightweight method of carrying out messaging using a \ +publish/subscribe model. " +HOMEPAGE = "http://mosquitto.org/" +SECTION = "console/network" +LICENSE = "EPL-1.0 | EDL-1.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=62ddc846179e908dc0c8efec4a42ef20 \ + file://edl-v10;md5=c09f121939f063aeb5235972be8c722c \ + file://epl-v10;md5=8d383c379e91d20ba18a52c3e7d3a979 \ + file://notice.html;md5=a00d6f9ab542be7babc2d8b80d5d2a4c \ +" +DEPENDS = "uthash" + +SRC_URI = "http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \ + file://mosquitto.init \ +" + +SRC_URI[md5sum] = "ec9074c4f337f64eaa9a4320c6dab020" +SRC_URI[sha256sum] = "bcd31a8fbbd053fee328986fadd8666d3058357ded56b9782f7d4f19931d178e" + +inherit systemd update-rc.d useradd + +PACKAGECONFIG ??= "ssl uuid \ + ${@bb.utils.filter('DISTRO_FEATURES','systemd', d)} \ + " + +PACKAGECONFIG[dns-srv] = "WITH_SRV=yes,WITH_SRV=no,c-ares" +PACKAGECONFIG[ssl] = "WITH_TLS=yes WITH_TLS_PSK=yes,WITH_TLS=no WITH_TLS_PSK=no,openssl" +PACKAGECONFIG[uuid] = "WITH_UUID=yes,WITH_UUID=no,util-linux" +PACKAGECONFIG[systemd] = "WITH_SYSTEMD=yes,WITH_SYSTEMD=no,systemd" +PACKAGECONFIG[websockets] = "WITH_WEBSOCKETS=yes,WITH_WEBSOCKETS=no,libwebsockets" + +EXTRA_OEMAKE = " \ + prefix=${prefix} \ + mandir=${mandir} \ + localedir=${localedir} \ + ${PACKAGECONFIG_CONFARGS} \ + STRIP=/bin/true \ + WITH_DOCS=no \ + WITH_BUNDLED_DEPS=no \ +" + +export LIB_SUFFIX = "${@d.getVar('baselib').replace('lib', '')}" + +do_install() { + oe_runmake 'DESTDIR=${D}' install + + install -d ${D}${systemd_unitdir}/system/ + install -m 0644 ${S}/service/systemd/mosquitto.service.notify ${D}${systemd_unitdir}/system/mosquitto.service + + install -d ${D}${sysconfdir}/mosquitto + install -m 0644 ${D}${sysconfdir}/mosquitto/mosquitto.conf.example \ + ${D}${sysconfdir}/mosquitto/mosquitto.conf + + install -d ${D}${sysconfdir}/init.d/ + install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto + sed -i -e 's,@SBINDIR@,${sbindir},g' \ + -e 's,@BASE_SBINDIR@,${base_sbindir},g' \ + -e 's,@LOCALSTATEDIR@,${localstatedir},g' \ + -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + ${D}${sysconfdir}/init.d/mosquitto +} + +PACKAGES += "libmosquitto1 libmosquittopp1 ${PN}-clients" + +PACKAGE_BEFORE_PN = "${PN}-examples" + +FILES_${PN} = "${sbindir}/mosquitto \ + ${bindir}/mosquitto_passwd \ + ${sysconfdir}/mosquitto \ + ${sysconfdir}/init.d \ + ${systemd_unitdir}/system/mosquitto.service \ +" + +CONFFILES_${PN} += "${sysconfdir}/mosquitto/mosquitto.conf" + +FILES_libmosquitto1 = "${libdir}/libmosquitto.so.1" + +FILES_libmosquittopp1 = "${libdir}/libmosquittopp.so.1" + +FILES_${PN}-clients = "${bindir}/mosquitto_pub \ + ${bindir}/mosquitto_sub \ + ${bindir}/mosquitto_rr \ +" + +FILES_${PN}-examples = "${sysconfdir}/mosquitto/*.example" + +SYSTEMD_SERVICE_${PN} = "mosquitto.service" + +INITSCRIPT_NAME = "mosquitto" +INITSCRIPT_PARAMS = "defaults 30" + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false \ + --user-group mosquitto" diff --git a/meta-openeuler/recipes-connectivity/nfs-utils/nfs-utils_%.bbappend b/meta-openeuler/recipes-connectivity/nfs-utils/nfs-utils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3aadf24e6f883f4d703c851aea292c3296f49c06 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/nfs-utils/nfs-utils_%.bbappend @@ -0,0 +1,36 @@ +PV = "2.6.2" + +# apply patches in openeuler +SRC_URI_prepend = "file://0000-systemd-idmapd-require-rpc-pipefs.patch \ + file://0001-correct-the-statd-path-in-man.patch \ + file://0002-nfs-utils-set-use-gss-proxy-1-to-enable-gss-proxy-by.patch \ + file://0003-fix-coredump-in-bl_add_disk.patch \ + file://0004-nfs-blkmaped-Fix-the-error-status-when-nfs_blkmapd-s.patch \ + file://0005-nfs-blkmapd-PID-file-read-by-systemd-failed.patch \ +" + +# fix nativesdk lib use error: /opt/buildtools/nativesdk/sysroots/x86_64-pokysdk-linux/usr/lib/libresolv.so: +# file not recognized: file format not recognized +BUILD_LDFLAGS_remove = " -L${OPENEULER_NATIVESDK_SYSROOT}/usr/lib \ + -L${OPENEULER_NATIVESDK_SYSROOT}/lib \ + -Wl,-rpath-link,${OPENEULER_NATIVESDK_SYSROOT}/usr/lib \ + -Wl,-rpath-link,${OPENEULER_NATIVESDK_SYSROOT}/lib \ + -Wl,-rpath,${OPENEULER_NATIVESDK_SYSROOT}/usr/lib \ + -Wl,-rpath,${OPENEULER_NATIVESDK_SYSROOT}/lib" + +# not support tcp-wrappers currently +PACKAGECONFIG_remove = "tcp-wrappers" + +SRC_URI[sha256sum] = "5200873e81c4d610e2462fc262fe18135f2dbe78b7979f95accd159ae64d5011" + +# For nfs-utils-2.6.2, the following files need to be added to FILES_${PN} +FILES_${PN} += "${nonarch_libdir}/modprobe.d" + +# nfs-utils-stats has a collection of python scripts +# remove the dependency of python3-core to simplify the build +# when python3 support becomes mature, remove the following code +RDEPENDS_${PN}-stats = "" + +# we current use rc5.d of rcS, in normal mode we don't want it autostart default for security +INITSCRIPT_PARAMS = "start 20 2 3 4 . stop 20 0 1 6 ." +INITSCRIPT_PARAMS-${PN}-client = "start 19 2 3 4 . stop 21 0 1 6 ." diff --git a/meta-openeuler/recipes-core/openssh/openssh/sshd_config b/meta-openeuler/recipes-connectivity/openssh/openeuler-config/sshd_config similarity index 95% rename from meta-openeuler/recipes-core/openssh/openssh/sshd_config rename to meta-openeuler/recipes-connectivity/openssh/openeuler-config/sshd_config index f0a3d2073a4b930c6f716c12a9628d9d3acf4a1d..770674df638951be19a9807416670b927c40b3e5 100644 --- a/meta-openeuler/recipes-core/openssh/openssh/sshd_config +++ b/meta-openeuler/recipes-connectivity/openssh/openeuler-config/sshd_config @@ -28,10 +28,10 @@ # Authentication: -LoginGraceTime 120 +#LoginGraceTime 2m #PermitRootLogin prohibit-password #StrictModes yes -MaxAuthTries 3 +#MaxAuthTries 6 #MaxSessions 10 #PubkeyAuthentication yes @@ -79,7 +79,7 @@ AuthorizedKeysFile .ssh/authorized_keys # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. -UsePAM yes +#UsePAM no #AllowAgentForwarding yes #AllowTcpForwarding yes @@ -91,10 +91,10 @@ UsePAM yes #PrintMotd yes #PrintLastLog yes #TCPKeepAlive yes -PermitUserEnvironment no -#Compression delayed -ClientAliveInterval 300 -ClientAliveCountMax 0 +#PermitUserEnvironment no +#Compression no +#ClientAliveInterval 15 +#ClientAliveCountMax 4 #UseDNS no #PidFile /var/run/sshd.pid #MaxStartups 10:30:100 @@ -114,6 +114,14 @@ Subsystem sftp internal-sftp -l INFO # AllowTcpForwarding no # PermitTTY no # ForceCommand cvs server + +# openEuler safety configuration add here: +UsePAM yes +PermitUserEnvironment no +ClientAliveInterval 300 +ClientAliveCountMax 0 +LoginGraceTime 120 +MaxAuthTries 3 Protocol 2 PubkeyAuthentication yes IgnoreRhosts yes diff --git a/meta-openeuler/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch b/meta-openeuler/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch new file mode 100644 index 0000000000000000000000000000000000000000..b8402a4dee015f82a7e2ebb20313c6cfa6c297d1 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch @@ -0,0 +1,47 @@ +Adjust test cases to work with busybox. + +- Replace dd parameter "obs" with "bs". +- Replace "head -" with "head -n ". + +Signed-off-by: Maxin B. John +Upstream-Status: Pending + +Index: openssh-7.6p1/regress/cipher-speed.sh +=================================================================== +--- openssh-7.6p1.orig/regress/cipher-speed.sh ++++ openssh-7.6p1/regress/cipher-speed.sh +@@ -17,7 +17,7 @@ for c in `${SSH} -Q cipher`; do n=0; for + printf "%-60s" "$c/$m:" + ( ${SSH} -o 'compression no' \ + -F $OBJ/ssh_proxy -m $m -c $c somehost \ +- exec sh -c \'"dd of=/dev/null obs=32k"\' \ ++ exec sh -c \'"dd of=/dev/null bs=32k"\' \ + < ${DATA} ) 2>&1 | getbytes + + if [ $? -ne 0 ]; then +Index: openssh-7.6p1/regress/transfer.sh +=================================================================== +--- openssh-7.6p1.orig/regress/transfer.sh ++++ openssh-7.6p1/regress/transfer.sh +@@ -13,7 +13,7 @@ cmp ${DATA} ${COPY} || fail "corrupted + for s in 10 100 1k 32k 64k 128k 256k; do + trace "dd-size ${s}" + rm -f ${COPY} +- dd if=$DATA obs=${s} 2> /dev/null | \ ++ dd if=$DATA bs=${s} 2> /dev/null | \ + ${SSH} -q -F $OBJ/ssh_proxy somehost "cat > ${COPY}" + if [ $? -ne 0 ]; then + fail "ssh cat $DATA failed" +Index: openssh-7.6p1/regress/key-options.sh +=================================================================== +--- openssh-7.6p1.orig/regress/key-options.sh ++++ openssh-7.6p1/regress/key-options.sh +@@ -47,7 +47,7 @@ for f in 127.0.0.1 '127.0.0.0\/8'; do + fi + + sed 's/.*/from="'"$f"'" &/' $origkeys >$authkeys +- from=`head -1 $authkeys | cut -f1 -d ' '` ++ from=`head -n 1 $authkeys | cut -f1 -d ' '` + verbose "key option $from" + r=`${SSH} -q -F $OBJ/ssh_proxy somehost 'echo true'` + if [ "$r" = "true" ]; then diff --git a/meta-openeuler/recipes-connectivity/openssh/openssh/fix-potential-signed-overflow-in-pointer-arithmatic.patch b/meta-openeuler/recipes-connectivity/openssh/openssh/fix-potential-signed-overflow-in-pointer-arithmatic.patch new file mode 100644 index 0000000000000000000000000000000000000000..20036da931810bf1a7696f29b8764db7daa00958 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/openssh/openssh/fix-potential-signed-overflow-in-pointer-arithmatic.patch @@ -0,0 +1,111 @@ +From 3328e98bcbf2930cd7eea3e6c92ad5dcbdf4794f Mon Sep 17 00:00:00 2001 +From: Yuanjie Huang +Date: Wed, 24 Aug 2016 03:15:43 +0000 +Subject: [PATCH] Fix potential signed overflow in pointer arithmatic + +Pointer arithmatic results in implementation defined signed integer +type, so that 's - src' in strlcpy and others may trigger signed overflow. +In case of compilation by gcc or clang with -ftrapv option, the overflow +would lead to program abort. + +Upstream-Status: Submitted [http://bugzilla.mindrot.org/show_bug.cgi?id=2608] + +Signed-off-by: Yuanjie Huang + +Complete the fix +Signed-off-by: Hongxu Jia +--- + openbsd-compat/strlcat.c | 10 +++++++--- + openbsd-compat/strlcpy.c | 8 ++++++-- + openbsd-compat/strnlen.c | 8 ++++++-- + 3 files changed, 19 insertions(+), 7 deletions(-) + +diff --git a/openbsd-compat/strlcat.c b/openbsd-compat/strlcat.c +index bcc1b61..124e1e3 100644 +--- a/openbsd-compat/strlcat.c ++++ b/openbsd-compat/strlcat.c +@@ -23,6 +23,7 @@ + + #include + #include ++#include + + /* + * Appends src to string dst of size siz (unlike strncat, siz is the +@@ -42,7 +43,7 @@ strlcat(char *dst, const char *src, size_t siz) + /* Find the end of dst and adjust bytes left but don't go past end */ + while (n-- != 0 && *d != '\0') + d++; +- dlen = d - dst; ++ dlen = (uintptr_t)d - (uintptr_t)dst; + n = siz - dlen; + + if (n == 0) +@@ -55,8 +56,11 @@ strlcat(char *dst, const char *src, size_t siz) + s++; + } + *d = '\0'; +- +- return(dlen + (s - src)); /* count does not include NUL */ ++ /* ++ * Cast pointers to unsigned type before calculation, to avoid signed ++ * overflow when the string ends where the MSB has changed. ++ */ ++ return (dlen + ((uintptr_t)s - (uintptr_t)src)); /* count does not include NUL */ + } + + #endif /* !HAVE_STRLCAT */ +diff --git a/openbsd-compat/strlcpy.c b/openbsd-compat/strlcpy.c +index b4b1b60..b06f374 100644 +--- a/openbsd-compat/strlcpy.c ++++ b/openbsd-compat/strlcpy.c +@@ -23,6 +23,7 @@ + + #include + #include ++#include + + /* + * Copy src to string dst of size siz. At most siz-1 characters +@@ -51,8 +52,11 @@ strlcpy(char *dst, const char *src, size_t siz) + while (*s++) + ; + } +- +- return(s - src - 1); /* count does not include NUL */ ++ /* ++ * Cast pointers to unsigned type before calculation, to avoid signed ++ * overflow when the string ends where the MSB has changed. ++ */ ++ return ((uintptr_t)s - (uintptr_t)src - 1); /* count does not include NUL */ + } + + #endif /* !HAVE_STRLCPY */ +diff --git a/openbsd-compat/strnlen.c b/openbsd-compat/strnlen.c +index 7ad3573..7040f1f 100644 +--- a/openbsd-compat/strnlen.c ++++ b/openbsd-compat/strnlen.c +@@ -23,6 +23,7 @@ + #include + + #include ++#include + + size_t + strnlen(const char *str, size_t maxlen) +@@ -31,7 +32,10 @@ strnlen(const char *str, size_t maxlen) + + for (cp = str; maxlen != 0 && *cp != '\0'; cp++, maxlen--) + ; +- +- return (size_t)(cp - str); ++ /* ++ * Cast pointers to unsigned type before calculation, to avoid signed ++ * overflow when the string ends where the MSB has changed. ++ */ ++ return (size_t)((uintptr_t)cp - (uintptr_t)str); + } + #endif +-- +2.17.1 + diff --git a/meta-openeuler/recipes-core/openssh/openssh/init b/meta-openeuler/recipes-connectivity/openssh/openssh/init similarity index 98% rename from meta-openeuler/recipes-core/openssh/openssh/init rename to meta-openeuler/recipes-connectivity/openssh/openssh/init index 837340d84ad5195602ed639990acead64f221eae..8887e3af130ebcb7eed1c55a6f11ab8006a9c1d6 100644 --- a/meta-openeuler/recipes-core/openssh/openssh/init +++ b/meta-openeuler/recipes-connectivity/openssh/openssh/init @@ -4,7 +4,7 @@ set -e PIDFILE=/var/run/sshd.pid # source function library -#. /etc/init.d/functions +. /etc/init.d/functions # /etc/init.d/ssh: start and stop the OpenBSD "secure shell" daemon diff --git a/meta-openeuler/recipes-connectivity/openssh/openssh/run-ptest b/meta-openeuler/recipes-connectivity/openssh/openssh/run-ptest new file mode 100644 index 0000000000000000000000000000000000000000..8a9b770d59cf65885d58d55a9b3ccff720df0819 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/openssh/openssh/run-ptest @@ -0,0 +1,45 @@ +#!/bin/sh + +export TEST_SHELL=sh +export SKIP_UNIT=1 + +cd regress +sed -i "/\t\tagent-ptrace /d" Makefile +make -k BUILDDIR=`pwd`/.. .OBJDIR=`pwd` .CURDIR=`pwd` SUDO="sudo" tests \ + | sed -u -e 's/^skipped/SKIP: /g' -e 's/^ok /PASS: /g' -e 's/^failed/FAIL: /g' + +SSHAGENT=`which ssh-agent` +GDB=`which gdb` + +if [ -z "${SSHAGENT}" -o -z "${GDB}" ]; then + echo "SKIP: agent-ptrace" + exit +fi + +useradd openssh-test + +eval `su -c "${SSHAGENT} -s" openssh-test` > /dev/null +r=$? +if [ $r -ne 0 ]; then + echo "FAIL: could not start ssh-agent: exit code $r" +else + su -c "gdb -p ${SSH_AGENT_PID}" openssh-test > /tmp/gdb.out 2>&1 << EOF + quit +EOF + r=$? + if [ $r -ne 0 ]; then + echo "gdb failed: exit code $r" + fi + egrep 'ptrace: Operation not permitted.|procfs:.*Permission denied.|ttrace.*Permission denied.|procfs:.*: Invalid argument.|Unable to access task ' >/dev/null /tmp/gdb.out + r=$? + rm -f /tmp/gdb.out + if [ $r -ne 0 ]; then + echo "FAIL: ptrace agent" + else + echo "PASS: ptrace agent" + fi + + ${SSHAGENT} -k > /dev/null +fi +userdel openssh-test + diff --git a/meta-openeuler/recipes-core/openssh/openssh/ssh_config b/meta-openeuler/recipes-connectivity/openssh/openssh/ssh_config similarity index 88% rename from meta-openeuler/recipes-core/openssh/openssh/ssh_config rename to meta-openeuler/recipes-connectivity/openssh/openssh/ssh_config index b9c6242a7e5f656ddf2051656d0160ea489a7e75..ca70f373759637472be4f17b69f52dd7659fe90b 100644 --- a/meta-openeuler/recipes-core/openssh/openssh/ssh_config +++ b/meta-openeuler/recipes-connectivity/openssh/openssh/ssh_config @@ -1,4 +1,4 @@ -# $OpenBSD: ssh_config,v 1.33 2017/05/07 23:12:57 djm Exp $ +# $OpenBSD: ssh_config,v 1.35 2020/07/17 03:43:42 dtucker Exp $ # This is the ssh client system-wide configuration file. See # ssh_config(5) for more information. This file provides defaults for @@ -17,9 +17,11 @@ # list of available options, their meanings and defaults, please see the # ssh_config(5) man page. +Include /etc/ssh/ssh_config.d/*.conf + Host * -ForwardAgent no -ForwardX11 no + ForwardAgent yes + ForwardX11 yes # RhostsRSAAuthentication no # RSAAuthentication yes # PasswordAuthentication yes @@ -36,7 +38,6 @@ ForwardX11 no # IdentityFile ~/.ssh/id_ecdsa # IdentityFile ~/.ssh/id_ed25519 # Port 22 -Protocol 2 # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc # MACs hmac-md5,hmac-sha1,umac-64@openssh.com # EscapeChar ~ @@ -46,5 +47,4 @@ Protocol 2 # VisualHostKey no # ProxyCommand ssh -q -W %h:%p gateway.example.com # RekeyLimit 1G 1h -StrictHostKeyChecking ask -VerifyHostKeyDNS ask +# UserKnownHostsFile ~/.ssh/known_hosts.d/%k diff --git a/meta-openeuler/recipes-connectivity/openssh/openssh/sshd b/meta-openeuler/recipes-connectivity/openssh/openssh/sshd new file mode 100644 index 0000000000000000000000000000000000000000..4882e58b4804cb4dbce792c0e5ec742f896fbd44 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/openssh/openssh/sshd @@ -0,0 +1,10 @@ +#%PAM-1.0 + +auth include common-auth +account required pam_nologin.so +account include common-account +password include common-password +session optional pam_keyinit.so force revoke +session include common-session +session required pam_loginuid.so + diff --git a/meta-openeuler/recipes-core/openssh/openssh/sshd.socket b/meta-openeuler/recipes-connectivity/openssh/openssh/sshd.socket similarity index 85% rename from meta-openeuler/recipes-core/openssh/openssh/sshd.socket rename to meta-openeuler/recipes-connectivity/openssh/openssh/sshd.socket index 12c39b26b59b2ed4be08e7fbbfd054a2aa811f3a..8d76d623097b709f9ccad5c2f01da1c9d4cf0589 100644 --- a/meta-openeuler/recipes-core/openssh/openssh/sshd.socket +++ b/meta-openeuler/recipes-connectivity/openssh/openssh/sshd.socket @@ -1,5 +1,6 @@ [Unit] Conflicts=sshd.service +Wants=sshdgenkeys.service [Socket] ExecStartPre=@BASE_BINDIR@/mkdir -p /var/run/sshd diff --git a/meta-openeuler/recipes-core/openssh/openssh/sshd@.service b/meta-openeuler/recipes-connectivity/openssh/openssh/sshd@.service similarity index 71% rename from meta-openeuler/recipes-core/openssh/openssh/sshd@.service rename to meta-openeuler/recipes-connectivity/openssh/openssh/sshd@.service index 9d83dfb2bb1cc9b3875eca38b9923fc980c16df5..9d9965e6245f5a9881b0e23990142ea5bf280444 100644 --- a/meta-openeuler/recipes-core/openssh/openssh/sshd@.service +++ b/meta-openeuler/recipes-connectivity/openssh/openssh/sshd@.service @@ -1,13 +1,10 @@ [Unit] Description=OpenSSH Per-Connection Daemon -Wants=sshdgenkeys.service After=sshdgenkeys.service [Service] Environment="SSHD_OPTS=" EnvironmentFile=-/etc/default/ssh ExecStart=-@SBINDIR@/sshd -i $SSHD_OPTS -ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID StandardInput=socket -StandardError=syslog KillMode=process diff --git a/meta-openeuler/recipes-core/openssh/openssh/config/common/sshd_check_keys b/meta-openeuler/recipes-connectivity/openssh/openssh/sshd_check_keys similarity index 99% rename from meta-openeuler/recipes-core/openssh/openssh/config/common/sshd_check_keys rename to meta-openeuler/recipes-connectivity/openssh/openssh/sshd_check_keys index dbd5074386321f3d83cf437feb588cff709f877c..ef117de897ff95f766e56a573f14888507a103eb 100644 --- a/meta-openeuler/recipes-core/openssh/openssh/config/common/sshd_check_keys +++ b/meta-openeuler/recipes-connectivity/openssh/openssh/sshd_check_keys @@ -6,6 +6,7 @@ generate_key() { local DIR="$(dirname "$FILE")" mkdir -p "$DIR" + rm -f ${FILE}.tmp ssh-keygen -q -f "${FILE}.tmp" -N '' -t $TYPE # Atomically rename file public key @@ -25,7 +26,6 @@ generate_key() { sync "${FILE}.pub" "$DIR" "${FILE}.tmp" mv "${FILE}.tmp" "$FILE" - chmod 400 "$FILE" # sync to ensure the atomic rename is committed sync "$DIR" diff --git a/meta-openeuler/recipes-core/openssh/openssh/sshdgenkeys.service b/meta-openeuler/recipes-connectivity/openssh/openssh/sshdgenkeys.service similarity index 95% rename from meta-openeuler/recipes-core/openssh/openssh/sshdgenkeys.service rename to meta-openeuler/recipes-connectivity/openssh/openssh/sshdgenkeys.service index 603c33787f1ac5d4a6d9cf4f62d42b53e8530a17..fd81793d511bc4ae83f05dec5ebbf7c0added506 100644 --- a/meta-openeuler/recipes-core/openssh/openssh/sshdgenkeys.service +++ b/meta-openeuler/recipes-connectivity/openssh/openssh/sshdgenkeys.service @@ -6,3 +6,4 @@ RequiresMountsFor=/var /run ExecStart=@LIBEXECDIR@/sshd_check_keys Type=oneshot RemainAfterExit=yes +Nice=10 diff --git a/meta-openeuler/recipes-core/openssh/openssh/volatiles.99_sshd b/meta-openeuler/recipes-connectivity/openssh/openssh/volatiles.99_sshd similarity index 100% rename from meta-openeuler/recipes-core/openssh/openssh/volatiles.99_sshd rename to meta-openeuler/recipes-connectivity/openssh/openssh/volatiles.99_sshd diff --git a/meta-openeuler/recipes-connectivity/openssh/openssh_%.bbappend b/meta-openeuler/recipes-connectivity/openssh/openssh_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d9bdcddcd7123809b441d80d019a6f61214f86d1 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/openssh/openssh_%.bbappend @@ -0,0 +1,22 @@ +# mian bb ref: +# http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-connectivity/openssh/openssh_9.1p1.bb?id=c80a3a7a4a9dc40cbb675777a1ba1481532ecb05 + +OPENEULER_SRC_URI_REMOVE = "https git http" + +# version in openEuler +PV = "9.1p1" + +# notice files in openssh is all from higher version of oe +# ref: http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-connectivity/openssh/openssh?id=c80a3a7a4a9dc40cbb675777a1ba1481532ecb05 +FILESEXTRAPATHS_prepend := "${THISDIR}/openeuler-config/:" + +# confilct: other openeuler patches can't apply +SRC_URI += " \ + file://openssh-9.1p1.tar.gz \ + file://backport-upstream-CVE-2023-25136-fix-double-free-caused.patch \ + " + +# poky patches conflict with openeuler +SRC_URI_remove += " \ + " + diff --git a/meta-openeuler/recipes-core/openssh/openssh_8.8p1.bb b/meta-openeuler/recipes-connectivity/openssh/openssh_9.1p1.bb similarity index 31% rename from meta-openeuler/recipes-core/openssh/openssh_8.8p1.bb rename to meta-openeuler/recipes-connectivity/openssh/openssh_9.1p1.bb index 39e97332c9732533575d2198b8225a5f0b123a25..85f97b1bbb1cfea88288deb690b0daf818e2c0c4 100644 --- a/meta-openeuler/recipes-core/openssh/openssh_8.8p1.bb +++ b/meta-openeuler/recipes-connectivity/openssh/openssh_9.1p1.bb @@ -5,38 +5,64 @@ Ssh (Secure Shell) is a program for logging into a remote machine \ and for executing commands on a remote machine." HOMEPAGE = "http://www.openssh.com/" SECTION = "console/network" -LICENSE = "BSD & ISC & MIT" +LICENSE = "BSD-2-Clause & BSD-3-Clause & ISC & MIT" +LIC_FILES_CHKSUM = "file://LICENCE;md5=072979064e691d342002f43cd89c0394" -DEPENDS = "zlib openssl" -#DEPENDS = "zlib openssl virtual/crypt" +DEPENDS = "zlib openssl virtual/crypt" DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" -#inherit manpages useradd update-rc.d update-alternatives systemd +SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \ + file://sshd_config \ + file://ssh_config \ + file://init \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ + file://sshd.socket \ + file://sshd@.service \ + file://sshdgenkeys.service \ + file://volatiles.99_sshd \ + file://run-ptest \ + file://fix-potential-signed-overflow-in-pointer-arithmatic.patch \ + file://sshd_check_keys \ + file://add-test-support-for-busybox.patch \ + " +SRC_URI[sha256sum] = "19f85009c7e3e23787f0236fbb1578392ab4d4bf9f8ec5fe6bc1cd7e8bfdd288" + +# This CVE is specific to OpenSSH with the pam opie which we don't build/use here +CVE_CHECK_IGNORE += "CVE-2007-2768" -# remove base-passwd from all image -DEPENDS_remove_class-target += "base-passwd" -USERADDSETSCENEDEPS_remove_class-target += "${MLPREFIX}base-passwd:do_populate_sysroot_setscene" +# This CVE is specific to OpenSSH server, as used in Fedora and Red Hat Enterprise Linux 7 +# and when running in a Kerberos environment. As such it is not relevant to OpenEmbedded +CVE_CHECK_IGNORE += "CVE-2014-9278" + +# CVE only applies to some distributed RHEL binaries +CVE_CHECK_IGNORE += "CVE-2008-3844" + +PAM_SRC_URI = "file://sshd" + +inherit manpages useradd update-rc.d update-alternatives systemd USERADD_PACKAGES = "${PN}-sshd" -USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd" +USERADD_PARAM:${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd" INITSCRIPT_PACKAGES = "${PN}-sshd" -INITSCRIPT_NAME_${PN}-sshd = "sshd" -INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9" +INITSCRIPT_NAME:${PN}-sshd = "sshd" +INITSCRIPT_PARAMS:${PN}-sshd = "defaults 9" SYSTEMD_PACKAGES = "${PN}-sshd" -SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket" +SYSTEMD_SERVICE:${PN}-sshd = "sshd.socket" -inherit autotools-brokensep +inherit autotools-brokensep ptest -LIC_FILES_CHKSUM="file://LICENCE;md5=d9d2753bdef9f19466dc7bc959114b11" -EXTRA_AUTORECONF_DEFINE = " ACLOCAL=echo " - -PACKAGECONFIG ??= "" +PACKAGECONFIG ??= "rng-tools" PACKAGECONFIG[kerberos] = "--with-kerberos5,--without-kerberos5,krb5" PACKAGECONFIG[ldns] = "--with-ldns,--without-ldns,ldns" PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit" PACKAGECONFIG[manpages] = "--with-mantype=man,--with-mantype=cat" +# Add RRECOMMENDS to rng-tools for sshd package +PACKAGECONFIG[rng-tools] = "" + +EXTRA_AUTORECONF += "--exclude=aclocal" + # login path is hardcoded in sshd EXTRA_OECONF = "'LOGIN_PROGRAM=${base_bindir}/login' \ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \ @@ -47,8 +73,8 @@ EXTRA_OECONF = "'LOGIN_PROGRAM=${base_bindir}/login' \ --disable-strip \ " -# musl doesn't implement wtmp/utmp -EXTRA_OECONF_append_libc-musl = " --disable-wtmp" +# musl doesn't implement wtmp/utmp and logwtmp +EXTRA_OECONF:append:libc-musl = " --disable-wtmp --disable-lastlog" # Since we do not depend on libbsd, we do not want configure to use it # just because it finds libutil.h. But, specifying --disable-libutil @@ -61,110 +87,97 @@ CACHED_CONFIGUREVARS += "ac_cv_path_PATH_PASSWD_PROG=${bindir}/passwd" # We don't want to depend on libblockfile CACHED_CONFIGUREVARS += "ac_cv_header_maillock_h=no" -# copy SRC_URI files -SRC_URI = "file://openssh/${BP}.tar.gz \ -file://ssh_config \ -file://init \ -file://sshd.socket \ -file://sshd@.service \ -file://sshdgenkeys.service \ -file://volatiles.99_sshd \ -file://config/common/sshd_check_keys \ -file://sshd_config \ -file://sshd_config_readonly \ -file://sshd \ -" +do_configure:prepend () { + export LD="${CC}" + install -m 0644 ${WORKDIR}/sshd_config ${B}/ + install -m 0644 ${WORKDIR}/ssh_config ${B}/ +} -PAM_SRC_URI = "file://sshd" -SRC_URI_EXTRA = "file://ssh_config \ - file://init \ - ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ - file://sshd.socket \ - file://sshd@.service \ - file://sshdgenkeys.service \ - file://volatiles.99_sshd \ - file://config/common/sshd_check_keys \ - " +do_compile_ptest() { + oe_runmake regress-binaries regress-unit-binaries +} -do_configure_prepend () { - export LD="${CC}" - install -m 0644 ${WORKDIR}/ssh_config ${B}/ +do_install:append () { + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then + install -D -m 0644 ${WORKDIR}/sshd ${D}${sysconfdir}/pam.d/sshd + sed -i -e 's:#UsePAM no:UsePAM yes:' ${D}${sysconfdir}/ssh/sshd_config + fi + + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then + sed -i -e 's:#X11Forwarding no:X11Forwarding yes:' ${D}${sysconfdir}/ssh/sshd_config + fi + + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd + rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin + rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir} + install -d ${D}/${sysconfdir}/default/volatiles + install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd + install -m 0755 ${S}/contrib/ssh-copy-id ${D}${bindir} + + # Create config files for read-only rootfs + install -d ${D}${sysconfdir}/ssh + install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly + sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly + echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly + echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly + echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly + + install -d ${D}${systemd_system_unitdir} + install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_system_unitdir} + install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_system_unitdir} + install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_system_unitdir} + sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ + -e 's,@SBINDIR@,${sbindir},g' \ + -e 's,@BINDIR@,${bindir},g' \ + -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \ + ${D}${systemd_system_unitdir}/sshd.socket ${D}${systemd_system_unitdir}/*.service + + sed -i -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \ + ${D}${sysconfdir}/init.d/sshd + + install -D -m 0755 ${WORKDIR}/sshd_check_keys ${D}${libexecdir}/${BPN}/sshd_check_keys } -do_install_append () { - if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then -# install -D -m 0644 ${WORKDIR}/openssh-8.2p1/sshd ${D}${sysconfdir}/pam.d/sshd - sed -i -e 's:#UsePAM no:UsePAM yes:' ${D}${sysconfdir}/ssh/sshd_config - fi - - if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then - sed -i -e 's:#X11Forwarding no:X11Forwarding yes:' ${D}${sysconfdir}/ssh/sshd_config - fi - - install -d ${D}${sysconfdir}/init.d - install -m 0750 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd - rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin - rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir} - install -d ${D}/${sysconfdir}/default/volatiles - install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd - install -m 0755 ${S}/contrib/ssh-copy-id ${D}${bindir} - - # Create config files for read-only rootfs - install -d ${D}${sysconfdir}/ssh - install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly - sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly - echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly - echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly - echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly - - install -d ${D}${systemd_unitdir}/system - install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_unitdir}/system - install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_unitdir}/system - install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_unitdir}/system - sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ - -e 's,@SBINDIR@,${sbindir},g' \ - -e 's,@BINDIR@,${bindir},g' \ - -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \ - ${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service - - sed -i -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \ - ${D}${sysconfdir}/init.d/sshd - cp ${WORKDIR}/ssh_config ${D}${sysconfdir}/ssh/ssh_config - cp ${WORKDIR}/sshd_config ${D}${sysconfdir}/ssh/sshd_config - cp ${WORKDIR}/sshd_config_readonly ${D}${sysconfdir}/ssh/sshd_config_readonly - install -d ${D}${sysconfdir}/pam.d - cp ${WORKDIR}/sshd ${D}${sysconfdir}/pam.d/sshd - - install -D -m 0755 ${WORKDIR}/config/common/sshd_check_keys ${D}${libexecdir}/${BPN}/sshd_check_keys - chmod -s ${D}/usr/libexec/ssh-keysign - chmod 0600 ${D}${sysconfdir}/ssh/sshd_config - rm -rf ${D}/lib/ +do_install_ptest () { + sed -i -e "s|^SFTPSERVER=.*|SFTPSERVER=${libexecdir}/sftp-server|" regress/test-exec.sh + cp -r regress ${D}${PTEST_PATH} + cp config.h ${D}${PTEST_PATH} } -ALLOW_EMPTY_${PN} = "0" +ALLOW_EMPTY:${PN} = "1" PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server" -FILES_${PN}-scp = "${bindir}/scp.${BPN} ${bindir}/scp" -FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config" -FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd ${systemd_unitdir}/system" -FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd ${sysconfdir}/pam.d/sshd" -FILES_${PN}-sshd += "${libexecdir}/${BPN}/sshd_check_keys" -FILES_${PN}-sftp = "${bindir}/sftp" -FILES_${PN}-sftp-server = "${libexecdir}/sftp-server" -FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*" -FILES_${PN}-keygen = "${bindir}/ssh-keygen" - -RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen" -RDEPENDS_${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}" -#RRECOMMENDS_${PN}-sshd_append_class-target = " rng-tools" - -RPROVIDES_${PN}-ssh = "ssh" -RPROVIDES_${PN}-sshd = "sshd" - -RCONFLICTS_${PN} = "dropbear" -RCONFLICTS_${PN}-sshd = "dropbear" - -CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config" -CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config" +FILES:${PN}-scp = "${bindir}/scp.${BPN}" +FILES:${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config" +FILES:${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd ${systemd_system_unitdir}" +FILES:${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd ${sysconfdir}/pam.d/sshd" +FILES:${PN}-sshd += "${libexecdir}/${BPN}/sshd_check_keys" +FILES:${PN}-sftp = "${bindir}/sftp" +FILES:${PN}-sftp-server = "${libexecdir}/sftp-server" +FILES:${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*" +FILES:${PN}-keygen = "${bindir}/ssh-keygen" + +RDEPENDS:${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen ${PN}-sftp-server" +RDEPENDS:${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}" +RRECOMMENDS:${PN}-sshd:append:class-target = "\ + ${@bb.utils.filter('PACKAGECONFIG', 'rng-tools', d)} \ +" + +# gdb would make attach-ptrace test pass rather than skip but not worth the build dependencies +RDEPENDS:${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make sed sudo coreutils" + +RPROVIDES:${PN}-ssh = "ssh" +RPROVIDES:${PN}-sshd = "sshd" + +RCONFLICTS:${PN} = "dropbear" +RCONFLICTS:${PN}-sshd = "dropbear" + +CONFFILES:${PN}-sshd = "${sysconfdir}/ssh/sshd_config" +CONFFILES:${PN}-ssh = "${sysconfdir}/ssh/ssh_config" + +ALTERNATIVE_PRIORITY = "90" +ALTERNATIVE:${PN}-scp = "scp" +ALTERNATIVE:${PN}-ssh = "ssh" BBCLASSEXTEND += "nativesdk" diff --git a/meta-openeuler/recipes-connectivity/openssl/files/environment.d-openssl.sh b/meta-openeuler/recipes-connectivity/openssl/files/environment.d-openssl.sh new file mode 100644 index 0000000000000000000000000000000000000000..6f23490c872fd11f0fb63b973277e1a77fc82d52 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/openssl/files/environment.d-openssl.sh @@ -0,0 +1,5 @@ +export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/openssl.cnf" +export SSL_CERT_DIR="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/certs" +export SSL_CERT_FILE="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/certs/ca-certificates.crt" +export OPENSSL_MODULES="$OECORE_NATIVE_SYSROOT/usr/lib/ossl-modules/" +export OPENSSL_ENGINES="$OECORE_NATIVE_SYSROOT/usr/lib/engines-3" diff --git a/meta-openeuler/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch b/meta-openeuler/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch new file mode 100644 index 0000000000000000000000000000000000000000..0b7abc3a112345be04487aa7441606f95ec40e3f --- /dev/null +++ b/meta-openeuler/recipes-connectivity/openssl/openssl/0001-Configure-do-not-tweak-mips-cflags.patch @@ -0,0 +1,36 @@ +From 326909baf81a638d51fa8be1d8227518784f5cc4 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 14 Sep 2021 12:18:25 +0200 +Subject: [PATCH] Configure: do not tweak mips cflags + +This conflicts with mips machine definitons from yocto, +e.g. +| Error: -mips3 conflicts with the other architecture options, which imply -mips64r2 + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +--- + Configure | 10 ---------- + 1 file changed, 10 deletions(-) + +Index: openssl-3.0.4/Configure +=================================================================== +--- openssl-3.0.4.orig/Configure ++++ openssl-3.0.4/Configure +@@ -1423,16 +1423,6 @@ if ($target =~ /^mingw/ && `$config{CC} + push @{$config{shared_ldflag}}, "-mno-cygwin"; + } + +-if ($target =~ /linux.*-mips/ && !$disabled{asm} +- && !grep { $_ !~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) { +- # minimally required architecture flags for assembly modules +- my $value; +- $value = '-mips2' if ($target =~ /mips32/); +- $value = '-mips3' if ($target =~ /mips64/); +- unshift @{$config{cflags}}, $value; +- unshift @{$config{cxxflags}}, $value if $config{CXX}; +-} +- + # If threads aren't disabled, check how possible they are + unless ($disabled{threads}) { + if ($auto_threads) { diff --git a/meta-openeuler/recipes-core/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch b/meta-openeuler/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch similarity index 66% rename from meta-openeuler/recipes-core/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch rename to meta-openeuler/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch index 1d8821578a3bb11b830555ba69e5e9e3e92a777a..bafdbaa46fc8ecbc27e0370f7f46917e4e86a6f9 100644 --- a/meta-openeuler/recipes-core/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch +++ b/meta-openeuler/recipes-connectivity/openssl/openssl/0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch @@ -1,76 +1,78 @@ -From 3e1d00481093e10775eaf69d619c45b32a4aa7dc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= -Date: Tue, 6 Nov 2018 14:50:47 +0100 -Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map from compiler - info -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The openssl build system generates buildinf.h containing the full -compiler command line used to compile objects. This breaks -reproducibility, as the compile command is baked into libcrypto, where -it is used when running `openssl version -f`. - -Add stripped build variables for the compiler and cflags lines, and use -those when generating buildinfo.h. - -This is based on a similar patch for older openssl versions: -https://patchwork.openembedded.org/patch/147229/ - -Upstream-Status: Inappropriate [OE specific] -Signed-off-by: Martin Hundeb酶ll - - -Update to fix buildpaths qa issue for '-fmacro-prefix-map'. - -Signed-off-by: Kai Kang ---- - Configurations/unix-Makefile.tmpl | 10 +++++++++- - crypto/build.info | 2 +- - 2 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl -index 16af4d2087..54c162784c 100644 ---- a/Configurations/unix-Makefile.tmpl -+++ b/Configurations/unix-Makefile.tmpl -@@ -317,13 +317,22 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (), - '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} - BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS) - --# CPPFLAGS_Q is used for one thing only: to build up buildinf.h -+# *_Q variables are used for one thing only: to build up buildinf.h - CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g; - $cppflags2 =~ s|([\\"])|\\$1|g; - $lib_cppflags =~ s|([\\"])|\\$1|g; - join(' ', $lib_cppflags || (), $cppflags2 || (), - $cppflags1 || ()) -} - -+CFLAGS_Q={- for (@{$config{CFLAGS}}) { -+ s|-fdebug-prefix-map=[^ ]+|-fdebug-prefix-map=|g; -+ s|-fmacro-prefix-map=[^ ]+|-fmacro-prefix-map=|g; -+ } -+ join(' ', @{$config{CFLAGS}}) -} -+ -+CC_Q={- $config{CC} =~ s|--sysroot=[^ ]+|--sysroot=recipe-sysroot|g; -+ join(' ', $config{CC}) -} -+ - PERLASM_SCHEME= {- $target{perlasm_scheme} -} - - # For x86 assembler: Set PROCESSOR to 386 if you want to support -diff --git a/crypto/build.info b/crypto/build.info -index b515b7318e..8c9cee2a09 100644 ---- a/crypto/build.info -+++ b/crypto/build.info -@@ -10,7 +10,7 @@ EXTRA= ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \ - ppccpuid.pl pariscid.pl alphacpuid.pl arm64cpuid.pl armv4cpuid.pl - - DEPEND[cversion.o]=buildinf.h --GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)" -+GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC_Q) $(CFLAGS_Q) $(CPPFLAGS_Q)" "$(PLATFORM)" - DEPEND[buildinf.h]=../configdata.pm - - GENERATE[uplink-x86.s]=../ms/uplink-x86.pl $(PERLASM_SCHEME) --- -2.19.1 - +From 5985253f2c9025d7c127443a3a9938946f80c2a1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= +Date: Tue, 6 Nov 2018 14:50:47 +0100 +Subject: [PATCH] buildinfo: strip sysroot and debug-prefix-map from compiler + info +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The openssl build system generates buildinf.h containing the full +compiler command line used to compile objects. This breaks +reproducibility, as the compile command is baked into libcrypto, where +it is used when running `openssl version -f`. + +Add stripped build variables for the compiler and cflags lines, and use +those when generating buildinfo.h. + +This is based on a similar patch for older openssl versions: +https://patchwork.openembedded.org/patch/147229/ + +Upstream-Status: Inappropriate [OE specific] +Signed-off-by: Martin Hundebøll + +Update to fix buildpaths qa issue for '-fmacro-prefix-map'. + +Signed-off-by: Kai Kang + +Update to fix buildpaths qa issue for '-ffile-prefix-map'. + +Signed-off-by: Khem Raj + +--- + Configurations/unix-Makefile.tmpl | 12 +++++++++++- + crypto/build.info | 2 +- + 2 files changed, 12 insertions(+), 2 deletions(-) + +Index: openssl-3.0.4/Configurations/unix-Makefile.tmpl +=================================================================== +--- openssl-3.0.4.orig/Configurations/unix-Makefile.tmpl ++++ openssl-3.0.4/Configurations/unix-Makefile.tmpl +@@ -472,13 +472,23 @@ BIN_LDFLAGS={- join(' ', $target{bin_lfl + '$(CNF_LDFLAGS)', '$(LDFLAGS)') -} + BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS) + +-# CPPFLAGS_Q is used for one thing only: to build up buildinf.h ++# *_Q variables are used for one thing only: to build up buildinf.h + CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g; + $cppflags2 =~ s|([\\"])|\\$1|g; + $lib_cppflags =~ s|([\\"])|\\$1|g; + join(' ', $lib_cppflags || (), $cppflags2 || (), + $cppflags1 || ()) -} + ++CFLAGS_Q={- for (@{$config{CFLAGS}}) { ++ s|-fdebug-prefix-map=[^ ]+|-fdebug-prefix-map=|g; ++ s|-fmacro-prefix-map=[^ ]+|-fmacro-prefix-map=|g; ++ s|-ffile-prefix-map=[^ ]+|-ffile-prefix-map=|g; ++ } ++ join(' ', @{$config{CFLAGS}}) -} ++ ++CC_Q={- $config{CC} =~ s|--sysroot=[^ ]+|--sysroot=recipe-sysroot|g; ++ join(' ', $config{CC}) -} ++ + PERLASM_SCHEME= {- $target{perlasm_scheme} -} + + # For x86 assembler: Set PROCESSOR to 386 if you want to support +Index: openssl-3.0.4/crypto/build.info +=================================================================== +--- openssl-3.0.4.orig/crypto/build.info ++++ openssl-3.0.4/crypto/build.info +@@ -109,7 +109,7 @@ DEFINE[../libcrypto]=$UPLINKDEF + + DEPEND[info.o]=buildinf.h + DEPEND[cversion.o]=buildinf.h +-GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)" ++GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC_Q) $(CFLAGS_Q) $(CPPFLAGS_Q)" "$(PLATFORM)" + + GENERATE[uplink-x86.S]=../ms/uplink-x86.pl + GENERATE[uplink-x86_64.s]=../ms/uplink-x86_64.pl diff --git a/meta-openeuler/recipes-core/openssl/openssl/afalg.patch b/meta-openeuler/recipes-connectivity/openssl/openssl/afalg.patch similarity index 81% rename from meta-openeuler/recipes-core/openssl/openssl/afalg.patch rename to meta-openeuler/recipes-connectivity/openssl/openssl/afalg.patch index ce816086a4630c1c3a710ec49b475a131cc840ac..cf77e873a2aa3887885adbb046bd3ad41460d688 100644 --- a/meta-openeuler/recipes-core/openssl/openssl/afalg.patch +++ b/meta-openeuler/recipes-connectivity/openssl/openssl/afalg.patch @@ -1,31 +1,31 @@ -Don't refuse to build afalgeng if cross-compiling or the host kernel is too old. - -Upstream-Status: Submitted [hhttps://github.com/openssl/openssl/pull/7688] -Signed-off-by: Ross Burton - -diff --git a/Configure b/Configure -index 3baa8ce..9ef52ed 100755 ---- a/Configure -+++ b/Configure -@@ -1550,20 +1550,7 @@ unless ($disabled{"crypto-mdebug-backtrace"}) - unless ($disabled{afalgeng}) { - $config{afalgeng}=""; - if (grep { $_ eq 'afalgeng' } @{$target{enable}}) { -- my $minver = 4*10000 + 1*100 + 0; -- if ($config{CROSS_COMPILE} eq "") { -- my $verstr = `uname -r`; -- my ($ma, $mi1, $mi2) = split("\\.", $verstr); -- ($mi2) = $mi2 =~ /(\d+)/; -- my $ver = $ma*10000 + $mi1*100 + $mi2; -- if ($ver < $minver) { -- disable('too-old-kernel', 'afalgeng'); -- } else { -- push @{$config{engdirs}}, "afalg"; -- } -- } else { -- disable('cross-compiling', 'afalgeng'); -- } -+ push @{$config{engdirs}}, "afalg"; - } else { - disable('not-linux', 'afalgeng'); - } +Don't refuse to build afalgeng if cross-compiling or the host kernel is too old. + +Upstream-Status: Submitted [hhttps://github.com/openssl/openssl/pull/7688] +Signed-off-by: Ross Burton + +Index: openssl-3.0.4/Configure +=================================================================== +--- openssl-3.0.4.orig/Configure ++++ openssl-3.0.4/Configure +@@ -1681,20 +1681,7 @@ $config{CFLAGS} = [ map { $_ eq '--ossl- + unless ($disabled{afalgeng}) { + $config{afalgeng}=""; + if (grep { $_ eq 'afalgeng' } @{$target{enable}}) { +- my $minver = 4*10000 + 1*100 + 0; +- if ($config{CROSS_COMPILE} eq "") { +- my $verstr = `uname -r`; +- my ($ma, $mi1, $mi2) = split("\\.", $verstr); +- ($mi2) = $mi2 =~ /(\d+)/; +- my $ver = $ma*10000 + $mi1*100 + $mi2; +- if ($ver < $minver) { +- disable('too-old-kernel', 'afalgeng'); +- } else { +- push @{$config{engdirs}}, "afalg"; +- } +- } else { +- disable('cross-compiling', 'afalgeng'); +- } ++ push @{$config{engdirs}}, "afalg"; + } else { + disable('not-linux', 'afalgeng'); + } diff --git a/meta-openeuler/recipes-core/openssl/openssl/run-ptest b/meta-openeuler/recipes-connectivity/openssl/openssl/run-ptest similarity index 60% rename from meta-openeuler/recipes-core/openssl/openssl/run-ptest rename to meta-openeuler/recipes-connectivity/openssl/openssl/run-ptest index d62d309ee14a9b3d0e5fcce743131d4c5d6ceb2f..8dff79101faaf118c44182fbb8449d1775774d34 100644 --- a/meta-openeuler/recipes-core/openssl/openssl/run-ptest +++ b/meta-openeuler/recipes-connectivity/openssl/openssl/run-ptest @@ -1,12 +1,12 @@ -#!/bin/sh - -set -e - -# Optional arguments are 'list' to lists all tests, or the test name (base name -# ie test_evp, not 03_test_evp.t). - -export TOP=. -# OPENSSL_ENGINES is relative from the test binaries -export OPENSSL_ENGINES=../engines - -perl ./test/run_tests.pl $* | perl -0pe 's#(.*) \.*.ok#PASS: \1#g; s#(.*) \.*.skipped: (.*)#SKIP: \1 (\2)#g; s#(.*) \.*.\nDubious#FAIL: \1#;' +#!/bin/sh + +set -e + +# Optional arguments are 'list' to lists all tests, or the test name (base name +# ie test_evp, not 03_test_evp.t). + +export TOP=. +# OPENSSL_ENGINES is relative from the test binaries +export OPENSSL_ENGINES=../engines + +perl ./test/run_tests.pl $* | sed -u -r -e '/(.*) \.*.ok/ s/^/PASS: /g' -r -e '/Dubious(.*)/ s/^/FAIL: /g' -e '/(.*) \.*.skipped: (.*)/ s/^/SKIP: /g' diff --git a/meta-openeuler/recipes-connectivity/openssl/openssl_%.bbappend b/meta-openeuler/recipes-connectivity/openssl/openssl_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..6714b3f5cc37d9efe0cc32f2a7005cca6bd88771 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/openssl/openssl_%.bbappend @@ -0,0 +1,14 @@ +# main bb file from: +# http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-connectivity/openssl/openssl_3.0.8.bb + +OPENEULER_SRC_URI_REMOVE = "https git http" + +# openEuler version +PV = "3.0.8" + +# patches in openEuler +SRC_URI += "\ + file://openssl-${PV}.tar.gz \ + file://openssl-3.0-build.patch \ +" + diff --git a/meta-openeuler/recipes-connectivity/openssl/openssl_3.0.8.bb b/meta-openeuler/recipes-connectivity/openssl/openssl_3.0.8.bb new file mode 100644 index 0000000000000000000000000000000000000000..8771884ddaeb186d3270e4a0b5623176a084ce99 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/openssl/openssl_3.0.8.bb @@ -0,0 +1,258 @@ +SUMMARY = "Secure Socket Layer" +DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools." +HOMEPAGE = "http://www.openssl.org/" +BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html" +SECTION = "libs/network" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=c75985e733726beaba57bc5253e96d04" + +SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ + file://run-ptest \ + file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ + file://afalg.patch \ + file://0001-Configure-do-not-tweak-mips-cflags.patch \ + " + +SRC_URI:append:class-nativesdk = " \ + file://environment.d-openssl.sh \ + " + +SRC_URI[sha256sum] = "6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e" + +inherit lib_package multilib_header multilib_script ptest perlnative +MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" + +PACKAGECONFIG ?= "" +PACKAGECONFIG:class-native = "" +PACKAGECONFIG:class-nativesdk = "" + +PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux,,cryptodev-module" +PACKAGECONFIG[no-tls1] = "no-tls1" +PACKAGECONFIG[no-tls1_1] = "no-tls1_1" + +B = "${WORKDIR}/build" +do_configure[cleandirs] = "${B}" + +#| ./libcrypto.so: undefined reference to `getcontext' +#| ./libcrypto.so: undefined reference to `setcontext' +#| ./libcrypto.so: undefined reference to `makecontext' +EXTRA_OECONF:append:libc-musl = " no-async" +EXTRA_OECONF:append:libc-musl:powerpc64 = " no-asm" + +# adding devrandom prevents openssl from using getrandom() which is not available on older glibc versions +# (native versions can be built with newer glibc, but then relocated onto a system with older glibc) +EXTRA_OECONF:class-native = "--with-rand-seed=os,devrandom" +EXTRA_OECONF:class-nativesdk = "--with-rand-seed=os,devrandom" + +# Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate. +CFLAGS:append:class-native = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" +CFLAGS:append:class-nativesdk = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" + +# This allows disabling deprecated or undesirable crypto algorithms. +# The default is to trust upstream choices. +DEPRECATED_CRYPTO_FLAGS ?= "" + +do_configure () { + # When we upgrade glibc but not uninative we see obtuse failures in openssl. Make + # the issue really clear that perl isn't functional due to symbol mismatch issues. + cat <<- EOF > ${WORKDIR}/perltest + #!/usr/bin/env perl + use POSIX; + EOF + chmod a+x ${WORKDIR}/perltest + ${WORKDIR}/perltest + + os=${HOST_OS} + case $os in + linux-gnueabi |\ + linux-gnuspe |\ + linux-musleabi |\ + linux-muslspe |\ + linux-musl ) + os=linux + ;; + *) + ;; + esac + target="$os-${HOST_ARCH}" + case $target in + linux-arc | linux-microblaze*) + target=linux-latomic + ;; + linux-arm*) + target=linux-armv4 + ;; + linux-aarch64*) + target=linux-aarch64 + ;; + linux-i?86 | linux-viac3) + target=linux-x86 + ;; + linux-gnux32-x86_64 | linux-muslx32-x86_64 ) + target=linux-x32 + ;; + linux-gnu64-x86_64) + target=linux-x86_64 + ;; + linux-mips | linux-mipsel) + # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags + target="linux-mips32 ${TARGET_CC_ARCH}" + ;; + linux-gnun32-mips*) + target=linux-mips64 + ;; + linux-*-mips64 | linux-mips64 | linux-*-mips64el | linux-mips64el) + target=linux64-mips64 + ;; + linux-nios2* | linux-sh3 | linux-sh4 | linux-arc*) + target=linux-generic32 + ;; + linux-powerpc) + target=linux-ppc + ;; + linux-powerpc64) + target=linux-ppc64 + ;; + linux-powerpc64le) + target=linux-ppc64le + ;; + linux-riscv32) + target=linux-generic32 + ;; + linux-riscv64) + target=linux-generic64 + ;; + linux-sparc | linux-supersparc) + target=linux-sparcv9 + ;; + mingw32-x86_64) + target=mingw64 + ;; + esac + + useprefix=${prefix} + if [ "x$useprefix" = "x" ]; then + useprefix=/ + fi + # WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the + # environment variables set by bitbake. Adjust the environment variables instead. + HASHBANGPERL="/usr/bin/env perl" PERL=perl PERL5LIB="${S}/external/perl/Text-Template-1.46/lib/" \ + perl ${S}/Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} ${DEPRECATED_CRYPTO_FLAGS} --prefix=$useprefix --openssldir=${libdir}/ssl-3 --libdir=${libdir} $target + perl ${B}/configdata.pm --dump +} + +do_install () { + oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install + + oe_multilib_header openssl/opensslconf.h + oe_multilib_header openssl/configuration.h + + # Create SSL structure for packages such as ca-certificates which + # contain hard-coded paths to /etc/ssl. Debian does the same. + install -d ${D}${sysconfdir}/ssl + mv ${D}${libdir}/ssl-3/certs \ + ${D}${libdir}/ssl-3/private \ + ${D}${libdir}/ssl-3/openssl.cnf \ + ${D}${sysconfdir}/ssl/ + + # Although absolute symlinks would be OK for the target, they become + # invalid if native or nativesdk are relocated from sstate. + ln -sf ${@oe.path.relative('${libdir}/ssl-3', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-3/certs + ln -sf ${@oe.path.relative('${libdir}/ssl-3', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-3/private + ln -sf ${@oe.path.relative('${libdir}/ssl-3', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-3/openssl.cnf +} + +do_install:append:class-native () { + create_wrapper ${D}${bindir}/openssl \ + OPENSSL_CONF=${libdir}/ssl-3/openssl.cnf \ + SSL_CERT_DIR=${libdir}/ssl-3/certs \ + SSL_CERT_FILE=${libdir}/ssl-3/cert.pem \ + OPENSSL_ENGINES=${libdir}/engines-3 \ + OPENSSL_MODULES=${libdir}/ossl-modules +} + +do_install:append:class-nativesdk () { + mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d + install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh + sed 's|/usr/lib/ssl/|/usr/lib/ssl-3/|g' -i ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh +} + +PTEST_BUILD_HOST_FILES += "configdata.pm" +PTEST_BUILD_HOST_PATTERN = "perl_version =" +do_install_ptest () { + install -d ${D}${PTEST_PATH}/test + install -m755 ${B}/test/p_test.so ${D}${PTEST_PATH}/test + install -m755 ${B}/test/provider_internal_test.cnf ${D}${PTEST_PATH}/test + + # Prune the build tree + rm -f ${B}/fuzz/*.* ${B}/test/*.* + + cp ${S}/Configure ${B}/configdata.pm ${D}${PTEST_PATH} + sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/configdata.pm + cp -r ${S}/external ${B}/test ${S}/test ${B}/fuzz ${S}/util ${B}/util ${D}${PTEST_PATH} + + # For test_shlibload + ln -s ${libdir}/libcrypto.so.1.1 ${D}${PTEST_PATH}/ + ln -s ${libdir}/libssl.so.1.1 ${D}${PTEST_PATH}/ + + install -d ${D}${PTEST_PATH}/apps + ln -s ${bindir}/openssl ${D}${PTEST_PATH}/apps + install -m644 ${S}/apps/*.pem ${S}/apps/*.srl ${S}/apps/openssl.cnf ${D}${PTEST_PATH}/apps + install -m755 ${B}/apps/CA.pl ${D}${PTEST_PATH}/apps + + install -d ${D}${PTEST_PATH}/engines + install -m755 ${B}/engines/dasync.so ${D}${PTEST_PATH}/engines + install -m755 ${B}/engines/loader_attic.so ${D}${PTEST_PATH}/engines + install -m755 ${B}/engines/ossltest.so ${D}${PTEST_PATH}/engines + + install -d ${D}${PTEST_PATH}/providers + install -m755 ${B}/providers/legacy.so ${D}${PTEST_PATH}/providers + + install -d ${D}${PTEST_PATH}/Configurations + cp -rf ${S}/Configurations/* ${D}${PTEST_PATH}/Configurations/ + + # seems to be needed with perl 5.32.1 + install -d ${D}${PTEST_PATH}/util/perl/recipes + cp ${D}${PTEST_PATH}/test/recipes/tconversion.pl ${D}${PTEST_PATH}/util/perl/recipes/ + + sed 's|${S}|${PTEST_PATH}|g' -i ${D}${PTEST_PATH}/util/wrap.pl +} + +# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto +# package RRECOMMENDS on this package. This will enable the configuration +# file to be installed for both the openssl-bin package and the libcrypto +# package since the openssl-bin package depends on the libcrypto package. + +PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc ${PN}-ossl-module-legacy" + +FILES:libcrypto = "${libdir}/libcrypto${SOLIBS}" +FILES:libssl = "${libdir}/libssl${SOLIBS}" +FILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf \ + ${libdir}/ssl-3/openssl.cnf* \ + " +FILES:${PN}-engines = "${libdir}/engines-3" +# ${prefix} comes from what we pass into --prefix at configure time (which is used for INSTALLTOP) +FILES:${PN}-engines:append:mingw32:class-nativesdk = " ${prefix}${libdir}/engines-3" +FILES:${PN}-misc = "${libdir}/ssl-3/misc ${bindir}/c_rehash" +FILES:${PN}-ossl-module-legacy = "${libdir}/ossl-modules/legacy.so" +FILES:${PN} =+ "${libdir}/ssl-3/* ${libdir}/ossl-modules/" +FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh" + +CONFFILES:openssl-conf = "${sysconfdir}/ssl/openssl.cnf" + +RRECOMMENDS:libcrypto += "openssl-conf ${PN}-ossl-module-legacy" +RDEPENDS:${PN}-misc = "perl" +RDEPENDS:${PN}-ptest += "openssl-bin perl perl-modules bash sed" + +RDEPENDS:${PN}-bin += "openssl-conf" + +BBCLASSEXTEND = "native nativesdk" + +CVE_PRODUCT = "openssl:openssl" + +CVE_VERSION_SUFFIX = "alphabetical" + +# Only affects OpenSSL >= 1.1.1 in combination with Apache < 2.4.37 +# Apache in meta-webserver is already recent enough +CVE_CHECK_IGNORE += "CVE-2019-0190" diff --git a/meta-openeuler/recipes-connectivity/ppp/ppp_%.bbappend b/meta-openeuler/recipes-connectivity/ppp/ppp_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..5f6fffe33671400adacfc847a2d2868e0b9a2413 --- /dev/null +++ b/meta-openeuler/recipes-connectivity/ppp/ppp_%.bbappend @@ -0,0 +1,27 @@ +# main bbfile: yocto-poky/meta/recipes-connectivity/ppp/ppp_2.4.9.bb +PV = "2.4.9" + +# source and patches from openeuler +# can't apply: backport-ppp-2.4.9-config.patch, no support new feature(pam,cbcp) here +# this patch backport-0011-build-sys-don-t-put-connect-errors-log-to-etc-ppp.patch make a new path and will conflict with other package, not apply +# failed to apply the patch: backport-0027-Set-LIBDIR-for-RISCV.patch (for riscv64) +SRC_URI_prepend = " \ + file://backport-0004-doc-add-configuration-samples.patch \ + file://backport-ppp-2.4.9-build-sys-don-t-hardcode-LIBDIR-but-set-it-according.patch \ + file://backport-0006-scritps-use-change_resolv_conf-function.patch \ + file://backport-ppp-2.4.8-pppd-we-don-t-want-to-accidentally-leak-fds.patch \ + file://backport-ppp-2.4.9-everywhere-O_CLOEXEC-harder.patch \ + file://backport-0014-everywhere-use-SOCK_CLOEXEC-when-creating-socket.patch \ + file://backport-0015-pppd-move-pppd-database-to-var-run-ppp.patch \ + file://backport-0016-rp-pppoe-add-manpage-for-pppoe-discovery.patch \ + file://backport-0018-scritps-fix-ip-up.local-sample.patch \ + file://backport-0020-pppd-put-lock-files-in-var-lock-ppp.patch \ + file://backport-0023-build-sys-install-rp-pppoe-plugin-files-with-standar.patch \ + file://backport-0024-build-sys-install-pppoatm-plugin-files-with-standard.patch \ + file://backport-ppp-2.4.8-pppd-install-pppd-binary-using-standard-perms-755.patch \ + file://backport-ppp-2.4.9-configure-cflags-allow-commas.patch \ + file://backport-pppd-Negotiate-IP-address-when-only-peer-addresses-are-provided.patch \ + file://backport-CVE-2022-4603.patch \ +" + +SRC_URI[sha256sum] = "f938b35eccde533ea800b15a7445b2f1137da7f88e32a16898d02dee8adc058d" diff --git a/meta-openeuler/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend b/meta-openeuler/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d414259bca6a916d12dc8d1fc458e2b3735ee91a --- /dev/null +++ b/meta-openeuler/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend @@ -0,0 +1,24 @@ +OPENEULER_REPO_NAME = "wpa_supplicant" + +# version in openEuler +PV = "2.10" + +# apply source package in openeuler +SRC_URI_remove = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \ +file://0001-replace-systemd-install-Alias-with-WantedBy.patch \ +file://0001-AP-Silently-ignore-management-frame-from-unexpected-.patch \ +file://0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch \ +file://0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch \ +file://0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch \ +file://CVE-2021-0326.patch \ +file://CVE-2021-27803.patch \ +file://CVE-2021-30004.patch \ +" + +SRC_URI_prepend = "file://wpa_supplicant-${PV}.tar.gz \ +" + +# checksum changed +LIC_FILES_CHKSUM = "file://COPYING;md5=5ebcb90236d1ad640558c3d3cd3035df \ + file://README;beginline=1;endline=56;md5=e3d2f6c2948991e37c1ca4960de84747 \ + file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=76306a95306fee9a976b0ac1be70f705" diff --git a/meta-openeuler/recipes-core/acl/acl/0001-test-patch-out-failing-bits.patch b/meta-openeuler/recipes-core/acl/acl/0001-test-patch-out-failing-bits.patch deleted file mode 100644 index ba2ffee5d277675ed53e8d48439c6c8b9b476892..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/acl/acl/0001-test-patch-out-failing-bits.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 9e08219e0e99ee2589cf35fa8d52cef3515accce Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Thu, 12 Dec 2019 15:47:49 +0100 -Subject: [PATCH] test: patch out failing bits - -I have confirmed on the host distro (Ubuntu 18.04) that they -fail as well; upstream probably haven't noticed because the -test is only executed under sudo. - -Upstream-Status: Inappropriate [disabling tests instead of fixing them properly] -Signed-off-by: Alexander Kanavin ---- - test/root/permissions.test | 13 ------------- - 1 file changed, 13 deletions(-) - -diff --git a/test/root/permissions.test b/test/root/permissions.test -index 8f8f825..21e8a95 100644 ---- a/test/root/permissions.test -+++ b/test/root/permissions.test -@@ -50,10 +50,6 @@ User daemon is a member in the owning group, which has only read access. - Verify this. - - $ su daemon -- $ cat f -- > root -- > bin -- - $ echo daemon >> f - >~ .*f: Permission denied$ - -@@ -146,8 +142,6 @@ the owning group, he should still have no write access. - $ setfacl -x g:daemon f - - $ su daemon -- $ echo daemon4 >> f -- >~ .*f: Permission denied$ - - - Change the owning group. The other permissions should now grant user -@@ -158,12 +152,6 @@ daemon write access. - - $ su daemon - $ echo daemon5 >> f -- $ cat f -- > root -- > bin -- > daemon -- > daemon2 -- > daemon5 - - - Verify that permissions in separate matching ACL entries do not -@@ -173,7 +161,6 @@ accumulate. - $ setfacl -m g:bin:r,g:daemon:w f - - $ su daemon -- $ : < f - $ : > f - $ : <> f - >~ .*f: Permission denied$ --- -2.17.1 - diff --git a/meta-openeuler/recipes-core/acl/acl/0001-tests-do-not-hardcode-the-build-path-into-a-helper-l.patch b/meta-openeuler/recipes-core/acl/acl/0001-tests-do-not-hardcode-the-build-path-into-a-helper-l.patch deleted file mode 100644 index 57ef0bb728cfdd305795f85f8109727869b49810..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/acl/acl/0001-tests-do-not-hardcode-the-build-path-into-a-helper-l.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 39d332a8801de5d9ef09dacb3dba85c208b7b2ad Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Thu, 12 Dec 2019 13:45:52 +0100 -Subject: [PATCH] tests: do not hardcode the build path into a helper library - -Upstream-Status: Inappropriate [oe-core specific] -Signed-off-by: Alexander Kanavin ---- - test/Makemodule.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/test/Makemodule.am b/test/Makemodule.am -index 17d4927..015de7f 100644 ---- a/test/Makemodule.am -+++ b/test/Makemodule.am -@@ -30,7 +30,7 @@ EXTRA_DIST += \ - check_LTLIBRARIES = libtestlookup.la - - libtestlookup_la_SOURCES = test/test_passwd.c test/test_group.c --libtestlookup_la_CFLAGS = -DBASEDIR=\"$(abs_srcdir)\" -+libtestlookup_la_CFLAGS = -DBASEDIR=\"/tmp/acl-ptest\" - libtestlookup_la_LDFLAGS = -rpath $(abs_builddir) - - AM_TESTS_ENVIRONMENT = PATH="$(abs_top_builddir):$$PATH"; diff --git a/meta-openeuler/recipes-core/acl/acl/run-ptest b/meta-openeuler/recipes-core/acl/acl/run-ptest deleted file mode 100644 index 43128233654d31b3577877ce21cb4344b3068fa9..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/acl/acl/run-ptest +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# -#This script is used to run acl test suites - -#umask 077 - -mkdir -p /tmp/acl-ptest/test -cp test/test.* /tmp/acl-ptest/test - -make test-suite.log diff --git a/meta-openeuler/recipes-core/acl/acl_2.3.1.bb b/meta-openeuler/recipes-core/acl/acl_2.3.1.bb deleted file mode 100644 index a285af482f69b7d6e0adae35e6a1b0554b8470ff..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/acl/acl_2.3.1.bb +++ /dev/null @@ -1,78 +0,0 @@ -SUMMARY = "Utilities for managing POSIX Access Control Lists" -DESCRIPTION = "ACL allows you to provide different levels of access to files \ -and folders for different users." - -HOMEPAGE = "http://savannah.nongnu.org/projects/acl/" -BUGTRACKER = "http://savannah.nongnu.org/bugs/?group=acl" - -SECTION = "libs" - -LICENSE = "LGPLv2.1+ & GPLv2+" -LICENSE_${PN} = "GPLv2+" -LICENSE_lib${BPN} = "LGPLv2.1+" -LIC_FILES_CHKSUM = "file://doc/COPYING;md5=c781d70ed2b4d48995b790403217a249 \ - file://doc/COPYING.LGPL;md5=9e9a206917f8af112da634ce3ab41764" - -DEPENDS = "attr" - -SRC_URI = "file://acl/acl-${PV}.tar.gz \ - file://run-ptest \ - file://0001-tests-do-not-hardcode-the-build-path-into-a-helper-l.patch \ - file://0001-test-patch-out-failing-bits.patch \ - " - -SRC_URI[sha256sum] = "760c61c68901b37fdd5eefeeaf4c0c7a26bdfdd8ac747a1edff1ce0e243c11af" - -inherit autotools gettext ptest - -PACKAGES =+ "lib${BPN}" - -FILES_lib${BPN} = "${libdir}/lib*${SOLIBS}" - -PTEST_BUILD_HOST_FILES = "builddefs" -PTEST_BUILD_HOST_PATTERN = "^RPM" - -do_compile_ptest() { - oe_runmake libtestlookup.la -} - -do_install_ptest() { - cp -rf ${S}/test/ ${D}${PTEST_PATH} - cp -rf ${S}/build-aux/ ${D}${PTEST_PATH} - mkdir -p ${D}${PTEST_PATH}/.libs - cp -rf ${B}/.libs/libtestlookup* ${D}${PTEST_PATH}/.libs - cp ${B}/Makefile ${D}${PTEST_PATH} - - sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's|${DEBUG_PREFIX_MAP}||g' \ - -e 's:${HOSTTOOLS_DIR}/::g' \ - -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ - -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ - -i ${D}${PTEST_PATH}/Makefile - - sed -i "s|^srcdir =.*|srcdir = \.|g" ${D}${PTEST_PATH}/Makefile - sed -i "s|^abs_srcdir =.*|abs_srcdir = \.|g" ${D}${PTEST_PATH}/Makefile - sed -i "s|^abs_top_srcdir =.*|abs_top_srcdir = \.\.|g" ${D}${PTEST_PATH}/Makefile - sed -i "s|^Makefile:.*|Makefile:|g" ${D}${PTEST_PATH}/Makefile - - rm ${D}${PTEST_PATH}/.libs/libtestlookup.lai -} - -RDEPENDS_${PN}-ptest = "acl \ - bash \ - coreutils \ - perl \ - perl-module-filehandle \ - perl-module-getopt-std \ - perl-module-posix \ - shadow \ - make \ - gawk \ - e2fsprogs-mke2fs \ - perl-module-cwd \ - perl-module-file-basename \ - perl-module-file-path \ - perl-module-file-spec \ - " - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/attr/attr.inc b/meta-openeuler/recipes-core/attr/attr.inc deleted file mode 100644 index 134710da259b0f6a6bd0f809ac8036f25ac40bc1..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/attr/attr.inc +++ /dev/null @@ -1,68 +0,0 @@ -SUMMARY = "Utilities for manipulating filesystem extended attributes" -DESCRIPTION = "Implement the ability for a user to attach name:value pairs to objects within the XFS filesystem." - -HOMEPAGE = "http://savannah.nongnu.org/projects/attr/" -SECTION = "libs" - -DEPENDS = "virtual/libintl" - -LICENSE = "LGPLv2.1+ & GPLv2+" -LICENSE_${PN} = "GPLv2+" -LICENSE_lib${BPN} = "LGPLv2.1+" -LIC_FILES_CHKSUM = "file://doc/COPYING;md5=2d0aa14b3fce4694e4f615e30186335f \ - file://doc/COPYING.LGPL;md5=b8d31f339300bc239d73461d68e77b9c \ - file://tools/attr.c;endline=17;md5=be0403261f0847e5f43ed5b08d19593c \ - file://libattr/libattr.c;endline=17;md5=7970f77049f8fa1199fff62a7ab724fb" - -SRC_URI = "file://attr/attr-${PV}.tar.gz \ - file://attr/0001-bypass-wrong-output-when-enabled-selinux.patch \ - file://attr/0002-dont-skip-security.evm-when-copy-xattr.patch \ - file://run-ptest \ -" - -#inherit ptest update-alternatives autotools gettext -inherit autotools gettext ptest - -PACKAGES =+ "lib${BPN}" - -FILES_lib${BPN} = "${libdir}/lib*${SOLIBS}" - -ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN} = "setfattr" -ALTERNATIVE_TARGET[setfattr] = "${bindir}/setfattr" - -PTEST_BUILD_HOST_FILES = "builddefs" -PTEST_BUILD_HOST_PATTERN = "^RPM" - -do_install_ptest() { - cp ${B}/Makefile ${D}${PTEST_PATH} - sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's|${DEBUG_PREFIX_MAP}||g' \ - -e 's:${HOSTTOOLS_DIR}/::g' \ - -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ - -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ - -i ${D}${PTEST_PATH}/Makefile - - sed -i "s|^srcdir =.*|srcdir = \.|g" ${D}${PTEST_PATH}/Makefile - sed -i "s|^abs_srcdir =.*|abs_srcdir = \.|g" ${D}${PTEST_PATH}/Makefile - sed -i "s|^abs_top_srcdir =.*|abs_top_srcdir = \.\.|g" ${D}${PTEST_PATH}/Makefile - sed -i "s|^Makefile:.*|Makefile:|g" ${D}${PTEST_PATH}/Makefile - cp -rf ${S}/build-aux/ ${D}${PTEST_PATH} - cp -rf ${S}/test/ ${D}${PTEST_PATH} -} - -RDEPENDS_${PN}-ptest = "attr \ - coreutils \ - perl-module-filehandle \ - perl-module-getopt-std \ - perl-module-posix \ - make \ - perl \ - gawk \ - perl-module-cwd \ - perl-module-file-basename \ - perl-module-file-path \ - perl-module-file-spec \ - " - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/attr/attr/run-ptest b/meta-openeuler/recipes-core/attr/attr/run-ptest deleted file mode 100644 index f64244f239390dd9a3c3e257ca1523c1a2efbf80..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/attr/attr/run-ptest +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -make test-suite.log diff --git a/meta-openeuler/recipes-core/attr/attr_2.5.1.bb b/meta-openeuler/recipes-core/attr/attr_2.5.1.bb deleted file mode 100644 index 5c5f7bcffb4e40af3fde0f84e7eecb68647fb539..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/attr/attr_2.5.1.bb +++ /dev/null @@ -1,5 +0,0 @@ -require attr.inc - -SRC_URI[sha256sum] = "bae1c6949b258a0d68001367ce0c741cebdacdd3b62965d17e5eb23cd78adaf8" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/audit/audit_%.bbappend b/meta-openeuler/recipes-core/audit/audit_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..40f82135d7aec771cd2264eb784a4bf1b73b0054 --- /dev/null +++ b/meta-openeuler/recipes-core/audit/audit_%.bbappend @@ -0,0 +1,49 @@ +# main bbfile: from oe +# http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-security/audit/audit_3.0.9.bb + +OPENEULER_SRC_URI_REMOVE = "https git http" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files/:" + +#version in openEuler +PV = "3.0.9" + +S = "${WORKDIR}/audit-${PV}" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ + " + +# files, patches that come from openeuler +# This patches are conflict, not apply: +# backport-audit-flex-array-workaround.patch +# backport-audit-undo-flex-array.patch +SRC_URI += " \ + file://audit-${PV}.tar.gz \ + file://bugfix-audit-support-armv7b.patch \ + file://bugfix-audit-userspace-missing-syscalls-for-aarm64.patch \ + file://bugfix-audit-reload-coredump.patch \ + file://audit-Add-sw64-architecture.patch \ + file://auditd.conf \ + file://audit.rules \ + " + +# we don't want audit python3 runtime tool +DEPENDS:remove += " python3 " +EXTRA_OECONF:remove += " --with-python3=yes " +EXTRA_OECONF += " --with-python3=no " +PACKAGES:remove += " ${PN}-python " +FILES:${PN}-python:remove += " ${libdir}/python${PYTHON_BASEVERSION} " +FILES:auditd += " ${libdir} " + +# use openeuler's config and rules +do_install:append() { + cp ${WORKDIR}/audit.rules ${D}/etc/audit/rules.d/audit.rules + cp ${WORKDIR}/audit.rules ${D}/etc/audit/audit.rules + cp ${WORKDIR}/auditd.conf ${D}/etc/audit/auditd.conf + rm -rf ${D}/${libdir}/pkgconfig +} + +do_install:append:arm() { + sed -i "/arch=b64/d" ${D}/etc/audit/audit.rules +} diff --git a/meta-openeuler/recipes-core/audit/audit_3.0.1.bb b/meta-openeuler/recipes-core/audit/audit_3.0.9.bb similarity index 34% rename from meta-openeuler/recipes-core/audit/audit_3.0.1.bb rename to meta-openeuler/recipes-core/audit/audit_3.0.9.bb index 5bcc11f4e1a4655daf2c94fe406de377b2973863..9621d9e335682e23a065718c7e251d826225a1e4 100644 --- a/meta-openeuler/recipes-core/audit/audit_3.0.1.bb +++ b/meta-openeuler/recipes-core/audit/audit_3.0.9.bb @@ -4,54 +4,35 @@ storing and searching the audit records generated by the audit subsystem \ in the Linux kernel." HOMEPAGE = "http://people.redhat.com/sgrubb/audit/" SECTION = "base" -LICENSE = "GPLv2+ & LGPLv2+" - -#inherit autotools python3native update-rc.d systemd -inherit autotools - +LICENSE = "GPL-2.0-or-later & LGPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" -SRC_URI = "file://audit/${BP}.tar.gz \ - file://audit/bugfix-audit-support-armv7b.patch \ - file://audit/bugfix-audit-userspace-missing-syscalls-for-aarm64.patch \ - file://audit/bugfix-audit-reload-coredump.patch \ - file://audit/backport-Fix-the-default-location-for-zos-remote.conf-171.patch \ - file://audit/backport-Add-missing-call-to-free_interpretation_list.patch \ - file://audit/backport-fix-2-more-issues-found-by-fuzzing.patch \ - file://audit/backport-Fix-an-auparse-memory-leak-caused-in-recent-glibc.patch \ - file://audit/backport-Fix-double-free-with-corrupted-logs.patch \ - file://audit/backport-Fix-the-closing-timing-of-audit_fd-166.patch \ - file://audit/backport-Fix-some-string-length-issues.patch \ - file://audit/backport-Move-the-free_config-to-success-path.patch \ - file://audit/backport-Check-for-fuzzer-induced-invalid-value.patch \ - file://audit/backport-error-out-if-log-is-mangled.patch \ - file://audit/backport-Dont-run-off-the-end-with-corrupt-logs.patch \ - file://audit/backport-Another-hardening-measure-for-corrupted-logs.patch \ - file://audit/backport-Fix-busy-loop-in-normalizer-when-logs-are-corrupt.patch \ - file://audit/backport-Better-fix-for-busy-loop-in-normalizer-when-logs-are.patch \ - file://audit/backport-flush-uid-gid-caches-when-user-group-added-deleted-m.patch \ - file://audit/backport-In-auditd-check-if-log_file-is-valid-before-closing-.patch \ - file://audit/backport-Check-ctime-return-code.patch \ - file://audit/backport-When-interpreting-if-val-is-NULL-return-an-empty-str.patch \ - file://audit/backport-auditd.service-Restart-on-failure-ignoring-some-exit.patch \ - file://audit/backport-0001-In-auditd-close-the-logging-file-descriptor-when-log.patch \ - file://audit/backport-0002-In-auditd-close-the-logging-file-descriptor-when-log.patch \ - file://auditd.conf \ - file://audit.rules \ + +SRC_URI = "git://github.com/linux-audit/${BPN}-userspace.git;branch=master;protocol=https \ + file://Fixed-swig-host-contamination-issue.patch \ + file://0001-Replace-__attribute_malloc__-with-__attribute__-__ma.patch \ + file://auditd \ + file://auditd.service \ + file://audit-volatile.conf \ " +S = "${WORKDIR}/git" +SRCREV = "81fa28e0e8b4be83ddba03de8b816a3df510c17e" + +inherit autotools python3native python3targetconfig update-rc.d systemd + UPDATERCPN = "auditd" INITSCRIPT_NAME = "auditd" INITSCRIPT_PARAMS = "defaults" SYSTEMD_PACKAGES = "auditd" -SYSTEMD_SERVICE_auditd = "auditd.service" +SYSTEMD_SERVICE:auditd = "auditd.service" -#DEPENDS += "libcap-ng linux-libc-headers libpam" -DEPENDS += "libcap-ng libpam" +DEPENDS = "python3 tcp-wrappers libcap-ng linux-libc-headers swig-native" -EXTRA_OECONF += " --enable-gssapi-krb5=no \ +EXTRA_OECONF = " --with-libwrap \ + --enable-gssapi-krb5=no \ --with-libcap-ng=yes \ - --with-python3=no \ + --with-python3=yes \ --libdir=${base_libdir} \ --sbindir=${base_sbindir} \ --without-python \ @@ -61,36 +42,44 @@ EXTRA_OECONF += " --enable-gssapi-krb5=no \ --with-aarch64=yes \ " -EXTRA_OECONF_append += "${@ " --build=x86_64-linux --host=${HOST_ARCH}-euler-linux --target=${HOST_ARCH}-euler-linux " if "${TCLIBC}"=="musl" else "" }" - -EXTRA_OEMAKE += " \ +EXTRA_OEMAKE = "PYLIBVER='python${PYTHON_BASEVERSION}' \ + PYINC='${STAGING_INCDIR}/$(PYLIBVER)' \ + pyexecdir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \ STDINC='${STAGING_INCDIR}' \ + pkgconfigdir=${libdir}/pkgconfig \ " -UPDATERCD = "" - -SUMMARY_audispd-plugins = "Plugins for the audit event dispatcher" -DESCRIPTION_audispd-plugins = "The audispd-plugins package provides plugins for the real-time \ +SUMMARY:audispd-plugins = "Plugins for the audit event dispatcher" +DESCRIPTION:audispd-plugins = "The audispd-plugins package provides plugins for the real-time \ interface to the audit system, audispd. These plugins can do things \ like relay events to remote machines or analyze events for suspicious \ behavior." PACKAGES =+ "audispd-plugins" -PACKAGES += "auditd" +PACKAGES += "auditd ${PN}-python" -FILES_${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*" -FILES_auditd += "${bindir}/* ${base_sbindir}/* ${sysconfdir}/* ${datadir}/audit/*" -FILES_audispd-plugins += "${sysconfdir}/audit/audisp-remote.conf \ +FILES:${PN} = "${sysconfdir}/libaudit.conf ${base_libdir}/libaudit.so.1* ${base_libdir}/libauparse.so.*" +FILES:auditd = "${bindir}/* ${base_sbindir}/* ${sysconfdir}/* ${datadir}/audit/*" +FILES:audispd-plugins = "${sysconfdir}/audit/audisp-remote.conf \ ${sysconfdir}/audit/plugins.d/au-remote.conf \ - ${sbindir}/audisp-remote ${localstatedir}/spool/audit \ + ${sysconfdir}/audit/plugins.d/syslog.conf \ + ${base_sbindir}/audisp-remote \ + ${base_sbindir}/audisp-syslog \ + ${localstatedir}/spool/audit \ " -FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" -#FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" -FILES_${PN}-dev += "${base_libdir}/*.so ${base_libdir}/*.la ${base_libdir}/pkgconfig/*" +FILES:${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug" +FILES:${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}" + +CONFFILES:auditd = "${sysconfdir}/audit/audit.rules" -CONFFILES_auditd += "${sysconfdir}/audit/audit.rules" +do_configure:prepend() { + sed -e 's|buf\[];|buf[0];|g' ${STAGING_INCDIR}/linux/audit.h > ${S}/lib/audit.h + sed -i -e 's|#include |#include "audit.h"|g' ${S}/lib/libaudit.h +} + +do_install:append() { + sed -i -e 's|#include "audit.h"|#include |g' ${D}${includedir}/libaudit.h -do_install_append() { rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a rm -f ${D}/${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la @@ -100,31 +89,28 @@ do_install_append() { rmdir ${D}/etc/sysconfig/ # replace init.d - install -D -m 0750 ${THISDIR}/files/auditd ${D}/etc/init.d/auditd + install -D -m 0755 ${WORKDIR}/auditd ${D}/etc/init.d/auditd rm -rf ${D}/etc/rc.d if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then # install systemd unit files install -d ${D}${systemd_unitdir}/system - install -m 0644 ${THISDIR}/files/auditd.service ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/auditd.service ${D}${systemd_unitdir}/system install -d ${D}${sysconfdir}/tmpfiles.d/ - install -m 0644 ${THISDIR}/files/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ + install -m 0644 ${WORKDIR}/audit-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ fi # audit-2.5 doesn't install any rules by default, so we do that here mkdir -p ${D}/etc/audit ${D}/etc/audit/rules.d - cp ${WORKDIR}/audit.rules ${D}/etc/audit/rules.d/audit.rules - cp ${WORKDIR}/auditd.conf ${D}/etc/audit/auditd.conf + cp ${S}/rules/10-base-config.rules ${D}/etc/audit/rules.d/audit.rules chmod 750 ${D}/etc/audit ${D}/etc/audit/rules.d chmod 640 ${D}/etc/audit/auditd.conf ${D}/etc/audit/rules.d/audit.rules # Based on the audit.spec "Copy default rules into place on new installation" cp ${D}/etc/audit/rules.d/audit.rules ${D}/etc/audit/audit.rules - rm -rf ${D}/lib/pkgconfig -} -do_install_append_arm() { - sed -i "/arch=b64/d" ${D}/etc/audit/audit.rules + # Create /var/spool/audit directory for audisp-remote + install -m 0700 -d ${D}${localstatedir}/spool/audit } diff --git a/meta-openeuler/recipes-core/audit/files/0001-Add-substitue-functions-for-strndupa-rawmemchr.patch b/meta-openeuler/recipes-core/audit/files/0001-Add-substitue-functions-for-strndupa-rawmemchr.patch new file mode 100644 index 0000000000000000000000000000000000000000..ed1c0e2b57c1a5fbc594f11dc2f0ffc2a90a7577 --- /dev/null +++ b/meta-openeuler/recipes-core/audit/files/0001-Add-substitue-functions-for-strndupa-rawmemchr.patch @@ -0,0 +1,133 @@ +From d5a4b800a696b8b8d2c0f0bad098b1a8ff94333f Mon Sep 17 00:00:00 2001 +From: Steve Grubb +Date: Tue, 26 Feb 2019 18:33:33 -0500 +Subject: [PATCH] Add substitue functions for strndupa & rawmemchr + +Upstream-Status: Backport +[https://github.com/linux-audit/audit-userspace/commit/d579a08bb1cde71f939c13ac6b2261052ae9f77e] +--- + auparse/auparse.c | 12 +++++++++++- + auparse/interpret.c | 9 ++++++++- + configure.ac | 14 +++++++++++++- + src/ausearch-lol.c | 12 +++++++++++- + 4 files changed, 43 insertions(+), 4 deletions(-) + +diff --git a/auparse/auparse.c b/auparse/auparse.c +index 650db02..2e1c737 100644 +--- a/auparse/auparse.c ++++ b/auparse/auparse.c +@@ -1,5 +1,5 @@ + /* auparse.c -- +- * Copyright 2006-08,2012-17 Red Hat Inc., Durham, North Carolina. ++ * Copyright 2006-08,2012-19 Red Hat Inc., Durham, North Carolina. + * All Rights Reserved. + * + * This library is free software; you can redistribute it and/or +@@ -1118,6 +1118,16 @@ static int str2event(char *s, au_event_t *e) + return 0; + } + ++#ifndef HAVE_STRNDUPA ++static inline char *strndupa(const char *old, size_t n) ++{ ++ size_t len = strnlen(old, n); ++ char *tmp = alloca(len + 1); ++ tmp[len] = 0; ++ return memcpy(tmp, old, len); ++} ++#endif ++ + /* Returns 0 on success and 1 on error */ + static int extract_timestamp(const char *b, au_event_t *e) + { +diff --git a/auparse/interpret.c b/auparse/interpret.c +index 51c4a5e..67b7b77 100644 +--- a/auparse/interpret.c ++++ b/auparse/interpret.c +@@ -853,6 +853,13 @@ err_out: + return print_escaped(id->val); + } + ++// rawmemchr is faster. Let's use it if we have it. ++#ifdef HAVE_RAWMEMCHR ++#define STRCHR rawmemchr ++#else ++#define STRCHR strchr ++#endif ++ + static const char *print_proctitle(const char *val) + { + char *out = (char *)print_escaped(val); +@@ -863,7 +870,7 @@ static const char *print_proctitle(const char *val) + // Proctitle has arguments separated by NUL bytes + // We need to write over the NUL bytes with a space + // so that we can see the arguments +- while ((ptr = rawmemchr(ptr, '\0'))) { ++ while ((ptr = STRCHR(ptr, '\0'))) { + if (ptr >= end) + break; + *ptr = ' '; +diff --git a/configure.ac b/configure.ac +index 6e345f1..6f3007e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1,7 +1,7 @@ + dnl + define([AC_INIT_NOTICE], + [### Generated automatically using autoconf version] AC_ACVERSION [ +-### Copyright 2005-18 Steve Grubb ++### Copyright 2005-19 Steve Grubb + ### + ### Permission is hereby granted, free of charge, to any person obtaining a + ### copy of this software and associated documentation files (the "Software"), +@@ -72,6 +72,18 @@ dnl; posix_fallocate is used in audisp-remote + AC_CHECK_FUNCS([posix_fallocate]) + dnl; signalfd is needed for libev + AC_CHECK_FUNC([signalfd], [], [ AC_MSG_ERROR([The signalfd system call is necessary for auditd]) ]) ++dnl; check if rawmemchr is available ++AC_CHECK_FUNCS([rawmemchr]) ++dnl; check if strndupa is available ++AC_LINK_IFELSE( ++ [AC_LANG_SOURCE( ++ [[ ++ #define _GNU_SOURCE ++ #include ++ int main() { (void) strndupa("test", 10); return 0; }]])], ++ [AC_DEFINE(HAVE_STRNDUPA, 1, [Let us know if we have it or not])], ++ [] ++) + + ALLWARNS="" + ALLDEBUG="-g" +diff --git a/src/ausearch-lol.c b/src/ausearch-lol.c +index 5d17a72..758c33e 100644 +--- a/src/ausearch-lol.c ++++ b/src/ausearch-lol.c +@@ -1,6 +1,6 @@ + /* + * ausearch-lol.c - linked list of linked lists library +-* Copyright (c) 2008,2010,2014,2016 Red Hat Inc., Durham, North Carolina. ++* Copyright (c) 2008,2010,2014,2016,2019 Red Hat Inc., Durham, North Carolina. + * All Rights Reserved. + * + * This software may be freely redistributed and/or modified under the +@@ -152,6 +152,16 @@ static int compare_event_time(event *e1, event *e2) + return 0; + } + ++#ifndef HAVE_STRNDUPA ++static inline char *strndupa(const char *old, size_t n) ++{ ++ size_t len = strnlen(old, n); ++ char *tmp = alloca(len + 1); ++ tmp[len] = 0; ++ return memcpy(tmp, old, len); ++} ++#endif ++ + /* + * This function will look at the line and pick out pieces of it. + */ +-- +2.17.1 + diff --git a/meta-openeuler/recipes-core/audit/files/0001-Make-IPX-packet-interpretation-dependent-on-the-ipx-header.patch b/meta-openeuler/recipes-core/audit/files/0001-Make-IPX-packet-interpretation-dependent-on-the-ipx-header.patch new file mode 100644 index 0000000000000000000000000000000000000000..054f50ab236c7ac89380373dd8b0cbdeeb9ce969 --- /dev/null +++ b/meta-openeuler/recipes-core/audit/files/0001-Make-IPX-packet-interpretation-dependent-on-the-ipx-header.patch @@ -0,0 +1,65 @@ +From 6b09724c69d91668418ddb3af00da6db6755208c Mon Sep 17 00:00:00 2001 +From: Steve Grubb +Date: Thu, 2 Sep 2021 15:01:12 -0400 +Subject: [PATCH] Make IPX packet interpretation dependent on the ipx header + file existing + +Upstream-Status: Backport [https://github.com/linux-audit/audit-userspace/commit/6b09724c69d91668418ddb3af00da6db6755208c.patch] +Comment: Remove one hunk from changelog file and refresh rest hunks as per codebase of audit_2.8.5 +Signed-off-by: Akash Hadke +--- + auparse/interpret.c | 8 ++++++-- + configure.ac | 6 ++++++ + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/auparse/interpret.c b/auparse/interpret.c +index 63829aa0e..6c316456d 100644 +--- a/auparse/interpret.c 2022-10-14 11:22:20.833880000 +0200 ++++ b/auparse/interpret.c 2022-10-14 11:35:13.196455950 +0200 +@@ -44,8 +44,10 @@ + #include + #include + #include +-#include // FIXME: remove when ipx.h is fixed +-#include ++#ifdef HAVE_IPX_HEADERS ++ #include // FIXME: remove when ipx.h is fixed ++ #include ++#endif + #include + #include + #include +@@ -1158,6 +1160,7 @@ + x->sax25_call.ax25_call[6]); + } + break; ++#ifdef HAVE_IPX_HEADERS + case AF_IPX: + { + const struct sockaddr_ipx *ip = +@@ -1167,6 +1170,7 @@ + str, ip->sipx_port, ip->sipx_network); + } + break; ++#endif + case AF_ATMPVC: + { + const struct sockaddr_atmpvc* at = +diff --git a/configure.ac b/configure.ac +index 8f541e4c0..005eb0b5b 100644 +--- a/configure.ac 2022-10-14 11:22:20.833880000 +0200 ++++ b/configure.ac 2022-10-14 11:36:32.391044084 +0200 +@@ -414,6 +414,12 @@ + AC_DEFINE_UNQUOTED(HAVE_LIBWRAP, [], Define if tcp_wrappers support is enabled ) + fi + ++# linux/ipx.h - deprecated in 2018 ++AC_CHECK_HEADER(linux/ipx.h, ipx_headers=yes, ipx_headers=no) ++if test $ipx_headers = yes ; then ++ AC_DEFINE(HAVE_IPX_HEADERS,1,[IPX packet interpretation]) ++fi ++ + # See if we want to support lower capabilities for plugins + LIBCAP_NG_PATH + + diff --git a/meta-openeuler/recipes-core/audit/files/0001-Replace-__attribute_malloc__-with-__attribute__-__ma.patch b/meta-openeuler/recipes-core/audit/files/0001-Replace-__attribute_malloc__-with-__attribute__-__ma.patch new file mode 100644 index 0000000000000000000000000000000000000000..c2080e156de6fdadac93f411717f765ede8d621b --- /dev/null +++ b/meta-openeuler/recipes-core/audit/files/0001-Replace-__attribute_malloc__-with-__attribute__-__ma.patch @@ -0,0 +1,34 @@ +From 79c8d6a2755c9dfa00a5e86378e89a94eef0504d Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 9 Aug 2022 23:57:03 -0700 +Subject: [PATCH] Replace __attribute_malloc__ with + __attribute__((__malloc__)) + +__attribute_malloc__ is not available on musl + +Fixes +| ../../git/auparse/auparse.h:54:2: error: expected function body after function declarator +| __attribute_malloc__ __attr_dealloc (auparse_destroy, 1); +| ^ + +Signed-off-by: Khem Raj +--- + auparse/auparse.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/auparse/auparse.h b/auparse/auparse.h +index 95cf256d..c7dbe5ff 100644 +--- a/auparse/auparse.h ++++ b/auparse/auparse.h +@@ -51,7 +51,7 @@ typedef void (*auparse_callback_ptr)(auparse_state_t *au, + void auparse_destroy(auparse_state_t *au); + void auparse_destroy_ext(auparse_state_t *au, auparse_destroy_what_t what); + auparse_state_t *auparse_init(ausource_t source, const void *b) +- __attribute_malloc__ __attr_dealloc (auparse_destroy, 1); ++ __attribute__((__malloc__)) __attr_dealloc (auparse_destroy, 1); + int auparse_new_buffer(auparse_state_t *au, const char *data, size_t data_len) + __attr_access ((__read_only__, 2, 3)); + int auparse_feed(auparse_state_t *au, const char *data, size_t data_len) +-- +2.37.1 + diff --git a/meta-openeuler/recipes-core/audit/files/0002-Fixed-swig-host-contamination-issue.patch b/meta-openeuler/recipes-core/audit/files/0002-Fixed-swig-host-contamination-issue.patch new file mode 100644 index 0000000000000000000000000000000000000000..39a090c83b7d109988e09e79dba214b0ca4e29a3 --- /dev/null +++ b/meta-openeuler/recipes-core/audit/files/0002-Fixed-swig-host-contamination-issue.patch @@ -0,0 +1,62 @@ +From 3467abce1f3cfc96f9bdace7c09d95218cbcaeb1 Mon Sep 17 00:00:00 2001 +From: Li xin +Date: Sun, 19 Jul 2015 02:42:58 +0900 +Subject: [PATCH] audit: Fixed swig host contamination issue + +The audit build uses swig to generate a python wrapper. +Unfortunately, the swig info file references host include +directories. Some of these were previously noticed and +eliminated, but the one fixed here was not. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Anders Hedlund +Signed-off-by: Joe Slater +Signed-off-by: Yi Zhao + +Comment: Refresh hunk from auditswig.i to fix build with linux 5.17+ +Reference-Commit: ee3c680c3 audit: Upgrade to 3.0.8 and fix build with linux 5.17+ +Signed-off-by: Akash Hadke +Signed-off-by: Akash Hadke +--- + bindings/swig/python3/Makefile.am | 3 ++- + bindings/swig/src/auditswig.i | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/bindings/swig/python3/Makefile.am b/bindings/swig/python3/Makefile.am +index 9938418..fa46aac 100644 +--- a/bindings/swig/python3/Makefile.am ++++ b/bindings/swig/python3/Makefile.am +@@ -22,6 +22,7 @@ + CONFIG_CLEAN_FILES = *.loT *.rej *.orig + AM_CFLAGS = -fPIC -DPIC -fno-strict-aliasing $(PYTHON3_CFLAGS) + AM_CPPFLAGS = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) ++STDINC ?= /usr/include + LIBS = $(top_builddir)/lib/libaudit.la + SWIG_FLAGS = -python -py3 -modern + SWIG_INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) +@@ -37,7 +38,7 @@ _audit_la_DEPENDENCIES =${top_srcdir}/lib/libaudit.h ${top_builddir}/lib/libaudi + _audit_la_LIBADD = ${top_builddir}/lib/libaudit.la + nodist__audit_la_SOURCES = audit_wrap.c + audit.py audit_wrap.c: ${srcdir}/../src/auditswig.i +- swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/auditswig.i ++ swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} -I$(STDINC) ${srcdir}/../src/auditswig.i + + CLEANFILES = audit.py* audit_wrap.c *~ + +diff --git a/bindings/swig/src/auditswig.i b/bindings/swig/src/auditswig.i +index 7ebb373..424fb68 100644 +--- a/bindings/swig/src/auditswig.i ++++ b/bindings/swig/src/auditswig.i +@@ -39,7 +39,7 @@ + #define __attribute(X) /*nothing*/ + typedef unsigned __u32; + typedef unsigned uid_t; +-%include "/usr/include/linux/audit.h" ++%include "../lib/audit.h" + #define __extension__ /*nothing*/ + #include + %include "../lib/libaudit.h" +-- +2.17.1 + diff --git a/meta-openeuler/recipes-core/audit/files/0003-Header-definitions-need-to-be-external-when-building.patch b/meta-openeuler/recipes-core/audit/files/0003-Header-definitions-need-to-be-external-when-building.patch new file mode 100644 index 0000000000000000000000000000000000000000..f209e560bd9c568638378b1f850fa1bf582360ef --- /dev/null +++ b/meta-openeuler/recipes-core/audit/files/0003-Header-definitions-need-to-be-external-when-building.patch @@ -0,0 +1,30 @@ +From 2938f46d318df4a09565db837b60bafd0300f858 Mon Sep 17 00:00:00 2001 +From: Steve Grubb +Date: Fri, 10 Jan 2020 21:13:50 -0500 +Subject: [PATCH] Header definitions need to be external when building with + -fno-common (which is default in GCC 10) - Tony Jones + +Upstream-Status: Backport +[https://github.com/linux-audit/audit-userspace/commit/017e6c6ab95df55f34e339d2139def83e5dada1f] + +Signed-off-by: Alex Kiernan +--- + src/ausearch-common.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ausearch-common.h b/src/ausearch-common.h +index 6669203..3040547 100644 +--- a/src/ausearch-common.h ++++ b/src/ausearch-common.h +@@ -50,7 +50,7 @@ extern pid_t event_pid; + extern int event_exact_match; + extern uid_t event_uid, event_euid, event_loginuid; + extern const char *event_tuid, *event_teuid, *event_tauid; +-slist *event_node_list; ++extern slist *event_node_list; + extern const char *event_comm; + extern const char *event_filename; + extern const char *event_hostname; +-- +2.17.1 + diff --git a/meta-openeuler/recipes-core/audit/files/Fixed-swig-host-contamination-issue.patch b/meta-openeuler/recipes-core/audit/files/Fixed-swig-host-contamination-issue.patch new file mode 100644 index 0000000000000000000000000000000000000000..b023c80ae40773b8ea4034a9b1235f1e00f6ab63 --- /dev/null +++ b/meta-openeuler/recipes-core/audit/files/Fixed-swig-host-contamination-issue.patch @@ -0,0 +1,50 @@ +From 3d13f92c1bb293523670ba01aea7e655b00a6709 Mon Sep 17 00:00:00 2001 +From: Li xin +Date: Sun, 19 Jul 2015 02:42:58 +0900 +Subject: [PATCH] audit: Fixed swig host contamination issue + +The audit build uses swig to generate a python wrapper. +Unfortunately, the swig info file references host include +directories. Some of these were previously noticed and +eliminated, but the one fixed here was not. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Anders Hedlund +Signed-off-by: Joe Slater +Signed-off-by: Yi Zhao +--- + bindings/swig/python3/Makefile.am | 3 ++- + bindings/swig/src/auditswig.i | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +--- a/bindings/swig/python3/Makefile.am ++++ b/bindings/swig/python3/Makefile.am +@@ -23,6 +23,7 @@ + CONFIG_CLEAN_FILES = *.loT *.rej *.orig + AM_CFLAGS = -fPIC -DPIC -fno-strict-aliasing $(PYTHON3_CFLAGS) + AM_CPPFLAGS = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) ++STDINC ?= /usr/include + LIBS = $(top_builddir)/lib/libaudit.la + SWIG_FLAGS = -python -py3 -modern + SWIG_INCLUDES = -I. -I$(top_builddir) -I${top_srcdir}/lib $(PYTHON3_INCLUDES) +@@ -37,7 +38,7 @@ _audit_la_DEPENDENCIES =${top_srcdir}/li + _audit_la_LIBADD = ${top_builddir}/lib/libaudit.la + nodist__audit_la_SOURCES = audit_wrap.c + audit.py audit_wrap.c: ${srcdir}/../src/auditswig.i +- swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} ${srcdir}/../src/auditswig.i ++ swig -o audit_wrap.c ${SWIG_FLAGS} ${SWIG_INCLUDES} -I$(STDINC) ${srcdir}/../src/auditswig.i + + CLEANFILES = audit.py* audit_wrap.c *~ + +--- a/bindings/swig/src/auditswig.i ++++ b/bindings/swig/src/auditswig.i +@@ -39,7 +39,7 @@ signed + #define __attribute(X) /*nothing*/ + typedef unsigned __u32; + typedef unsigned uid_t; +-%include "/usr/include/linux/audit.h" ++%include "../lib/audit.h" + #define __extension__ /*nothing*/ + %include + %include "../lib/libaudit.h" diff --git a/meta-openeuler/recipes-core/base-files/base-files/fstab b/meta-openeuler/recipes-core/base-files/base-files/fstab new file mode 100644 index 0000000000000000000000000000000000000000..ab3101fec065d3af5e5dfa4be0f02b7ac38a3786 --- /dev/null +++ b/meta-openeuler/recipes-core/base-files/base-files/fstab @@ -0,0 +1,17 @@ +# stock fstab - you probably want to override this with a machine specific one + +# May not need /dev/root for common instance: /dev/root: Can't open blockdev +# /dev/root / auto defaults 1 1 + +proc /proc proc defaults 0 0 +devpts /dev/pts devpts mode=0620,ptmxmode=0666,gid=5 0 0 +tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 +tmpfs /var/volatile tmpfs nodev,nosuid,mode=755 0 0 + +tmpfs /dev/shm tmpfs nodev,nosuid,mode=1777,noexec 0 0 +tmpfs /tmp tmpfs nodev,nosuid,noexec 0 0 +none /var/log/audit tmpfs nodev,nosuid,mode=755 0 0 + +# uncomment this if your device has a SD/MMC/Transflash slot +#/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0 + diff --git a/meta-openeuler/recipes-core/base-files/base-files/profile b/meta-openeuler/recipes-core/base-files/base-files/profile new file mode 100644 index 0000000000000000000000000000000000000000..b4e4958ae1faf5d1aa2ce1c897a2bccf90d0de3b --- /dev/null +++ b/meta-openeuler/recipes-core/base-files/base-files/profile @@ -0,0 +1,95 @@ +# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) +# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). +# other config sync with openeuler 22.03 + +# --- openeuler config start --- +PS1="\[\033[32m\]\h \w\[\033[m\] \\$ " +export PS1 + +PATH=/usr/local/bin:/usr/bin:/bin +if [ `id -u` -eq 0 ]; then + PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:$PATH +fi + +ulimit -c 0 + +if [ `id -u` -eq 0 ]; then + umask 077 +else + umask 077 +fi + +USER=`id -un` +LOGNAME=$USER + +HOSTNAME=`/bin/hostname` +HISTSIZE=1000 +TMOUT=300 +PAGER=more +INPUTRC="/etc/inputrc" +alias ls="ls --color=auto" +alias ll="ls -l" +export TERM=vt200 +export VERSION=1.0 +export PRODUCT_NAME=openeuler +export HISTSIZE TMOUT +alias su='su -l' +# --- openeuler config end --- + +# --- src config from poky start --- +if [ -d /etc/profile.d ]; then + for i in /etc/profile.d/*.sh; do + if [ -f $i -a -r $i ]; then + . $i + fi + done + unset i +fi + +if [ -t 0 -a $# -eq 0 ]; then + if [ ! -x @BINDIR@/resize ] ; then + if [ -n "$BASH_VERSION" ] ; then +# Optimized resize funciton for bash +resize() { + local x y + IFS='[;' read -t 2 -p $(printf '\e7\e[r\e[999;999H\e[6n\e8') -sd R _ y x _ + [ -n "$y" ] && \ + echo -e "COLUMNS=$x;\nLINES=$y;\nexport COLUMNS LINES;" && \ + stty cols $x rows $y +} + else +# Portable resize function for ash/bash/dash/ksh +# with subshell to avoid local variables +resize() { + (o=$(stty -g) + stty -echo raw min 0 time 2 + printf '\0337\033[r\033[999;999H\033[6n\0338' + if echo R | read -d R x 2> /dev/null; then + IFS='[;R' read -t 2 -d R -r z y x _ + else + IFS='[;R' read -r _ y x _ + fi + stty "$o" + [ -z "$y" ] && y=${z##*[}&&x=${y##*;}&&y=${y%%;*} + [ -n "$y" ] && \ + echo "COLUMNS=$x;"&&echo "LINES=$y;"&&echo "export COLUMNS LINES;"&& \ + stty cols $x rows $y) +} + fi + fi + # Use the EDITOR not being set as a trigger to call resize + # and only do this for /dev/tty[A-z] which are typically + # serial ports + if [ -z "$EDITOR" -a "$SHLVL" = 1 ] ; then + case $(tty 2>/dev/null) in + /dev/tty[A-z]*) resize >/dev/null;; + esac + fi +fi + +export OPIEDIR QPEDIR QTDIR +# --- src config from poky end --- +EDITOR="vi" +VISUAL="vi" +export PATH PS1 USER LOGNAME HOSTNAME HISTSIZE EDITOR VISUAL PAGER INPUTRC TMOUT + diff --git a/meta-openeuler/recipes-core/base-files/base-files/share/dot.bashrc b/meta-openeuler/recipes-core/base-files/base-files/share/dot.bashrc new file mode 100644 index 0000000000000000000000000000000000000000..99134eb863a2695d5aeaff462d23286a97d29ed4 --- /dev/null +++ b/meta-openeuler/recipes-core/base-files/base-files/share/dot.bashrc @@ -0,0 +1,18 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. + +export PS1='\h:\w\$ ' +umask 077 +TMOUT=300 +export TMOUT + +# You may uncomment the following lines if you want `ls' to be colorized: +# export LS_OPTIONS='--color=auto' +# eval `dircolors` +# alias ls='ls $LS_OPTIONS' +# alias ll='ls $LS_OPTIONS -l' +# alias l='ls $LS_OPTIONS -lA' +# +# Some more alias to avoid making mistakes: +# alias rm='rm -i' +# alias cp='cp -i' +# alias mv='mv -i' diff --git a/meta-openeuler/recipes-core/base-files/base-files_%.bbappend b/meta-openeuler/recipes-core/base-files/base-files_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..74419e4472913eb505671c42878a63c80c8dd60e --- /dev/null +++ b/meta-openeuler/recipes-core/base-files/base-files_%.bbappend @@ -0,0 +1,20 @@ +# main bbfile yocto-poky/meta/recipes-core/base-files/base-files_3.0.14.bb +# we create this file as a layer to use openeuler's configs files +# config files use openeuler's, see base-files under this dir + +FILESEXTRAPATHS_prepend := "${THISDIR}/base-files/:" + +# add secure option for banner use +do_install_basefilesissue_append () { + BANNERSTR="Authorized uses only. All activity may be monitored and reported." + echo "${BANNERSTR}" >> ${D}${sysconfdir}/issue.net + echo >> ${D}${sysconfdir}/issue.net + echo "${BANNERSTR}" >> ${D}${sysconfdir}/issue + echo >> ${D}${sysconfdir}/issue +} + +do_install_append () { + BANNERSTR="Authorized uses only. All activity may be monitored and reported." + echo "${BANNERSTR}" >> ${D}${sysconfdir}/motd + echo >> ${D}${sysconfdir}/motd +} diff --git a/meta-openeuler/recipes-core/base-passwd/base-passwd_%.bbappend b/meta-openeuler/recipes-core/base-passwd/base-passwd_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..6425639f3f3dd350208290b1e1f9ea607eb5581c --- /dev/null +++ b/meta-openeuler/recipes-core/base-passwd/base-passwd_%.bbappend @@ -0,0 +1,28 @@ +# get extra config files from openeuler +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +# remove nobash.patch, because we use /bin/bash as default SHELL +SRC_URI_remove = "https://launchpad.net/debian/+archive/primary/+files/${BPN}_${PV}.tar.gz \ + file://nobash.patch \ +" + +# as it's small, base-passwd's tar.gz is integrated in openEuler Embedded +# to avoid network download +SRC_URI_append = "file://${BPN}_${PV}.tar.gz \ + file://openeuler_secure_nologin.patch \ + " + +# a workaround to fix the error ”useradd: /var/run/passwd: No such file or directory“ +# it's caused by shadow-native where the patch "0002-Allow-for-setting-password-in-clear-text" +# cannot be applied, because openeuler's shadow version is 4.9, and the patch is suitable for +# 4.8.1. In future, this issue can be fixed through upgrade of poky(3.3.2) + +do_install_append() { + install -d -m 755 ${D}${localstatedir}/run +} + +SYSROOT_DIRS += "${localstatedir}" + +PACKAGES =+ "${PN}-var" + +FILES_${PN}-var = "/run ${localstatedir}/run" diff --git a/meta-openeuler/recipes-core/base-passwd/files/base-passwd_3.5.29.tar.gz b/meta-openeuler/recipes-core/base-passwd/files/base-passwd_3.5.29.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0113f479bc938c50710befaaf961d268431aef3d Binary files /dev/null and b/meta-openeuler/recipes-core/base-passwd/files/base-passwd_3.5.29.tar.gz differ diff --git a/meta-openeuler/recipes-core/base-passwd/files/noshadow.patch b/meta-openeuler/recipes-core/base-passwd/files/noshadow.patch new file mode 100644 index 0000000000000000000000000000000000000000..f4e60b3477285484a5863e155e5a4ba4786cb8ee --- /dev/null +++ b/meta-openeuler/recipes-core/base-passwd/files/noshadow.patch @@ -0,0 +1,14 @@ +remove "*" for root since we don't have a /etc/shadow so far. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Scott Garman + +--- base-passwd/passwd.master~nobash ++++ base-passwd/passwd.master +@@ -1,4 +1,4 @@ +-root:*:0:0:root:/root:/bin/bash ++root::0:0:root:/root:/bin/bash + daemon:*:1:1:daemon:/usr/sbin:/bin/sh + bin:*:2:2:bin:/bin:/bin/sh + sys:*:3:3:sys:/dev:/bin/sh diff --git a/meta-openeuler/recipes-core/base-passwd/files/openeuler_secure_nologin.patch b/meta-openeuler/recipes-core/base-passwd/files/openeuler_secure_nologin.patch new file mode 100644 index 0000000000000000000000000000000000000000..60eb40ed08c7e2e44247e551020d988d6b1f512b --- /dev/null +++ b/meta-openeuler/recipes-core/base-passwd/files/openeuler_secure_nologin.patch @@ -0,0 +1,43 @@ +Some user shouldn't have shell login option, make it nologin for secure + +* all users except root and sync, make it nologin + +See openeuler secure docs + +--- base-passwd/passwd.master~nobash ++++ base-passwd/passwd.master +@@ -1,18 +1,18 @@ + root::0:0:root:/root:/bin/bash +-daemon:*:1:1:daemon:/usr/sbin:/bin/sh +-bin:*:2:2:bin:/bin:/bin/sh +-sys:*:3:3:sys:/dev:/bin/sh ++daemon:*:1:1:daemon:/usr/sbin:/sbin/nologin ++bin:*:2:2:bin:/bin:/sbin/nologin ++sys:*:3:3:sys:/dev:/sbin/nologin + sync:*:4:65534:sync:/bin:/bin/sync +-games:*:5:60:games:/usr/games:/bin/sh +-man:*:6:12:man:/var/cache/man:/bin/sh +-lp:*:7:7:lp:/var/spool/lpd:/bin/sh +-mail:*:8:8:mail:/var/mail:/bin/sh +-news:*:9:9:news:/var/spool/news:/bin/sh +-uucp:*:10:10:uucp:/var/spool/uucp:/bin/sh +-proxy:*:13:13:proxy:/bin:/bin/sh +-www-data:*:33:33:www-data:/var/www:/bin/sh +-backup:*:34:34:backup:/var/backups:/bin/sh +-list:*:38:38:Mailing List Manager:/var/list:/bin/sh +-irc:*:39:39:ircd:/var/run/ircd:/bin/sh +-gnats:*:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh +-nobody:*:65534:65534:nobody:/nonexistent:/bin/sh ++games:*:5:60:games:/usr/games:/sbin/nologin ++man:*:6:12:man:/var/cache/man:/sbin/nologin ++lp:*:7:7:lp:/var/spool/lpd:/sbin/nologin ++mail:*:8:8:mail:/var/mail:/sbin/nologin ++news:*:9:9:news:/var/spool/news:/sbin/nologin ++uucp:*:10:10:uucp:/var/spool/uucp:/sbin/nologin ++proxy:*:13:13:proxy:/bin:/sbin/nologin ++www-data:*:33:33:www-data:/var/www:/sbin/nologin ++backup:*:34:34:backup:/var/backups:/sbin/nologin ++list:*:38:38:Mailing List Manager:/var/list:/sbin/nologin ++irc:*:39:39:ircd:/var/run/ircd:/sbin/nologin ++gnats:*:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/sbin/nologin ++nobody:*:65534:65534:nobody:/nonexistent:/sbin/nologin diff --git a/meta-openeuler/recipes-core/bind/bind/0001-revert-d10fbdec-for-lib-dns-gen.c-as-it-is-a-build-p.patch b/meta-openeuler/recipes-core/bind/bind/0001-revert-d10fbdec-for-lib-dns-gen.c-as-it-is-a-build-p.patch deleted file mode 100644 index b088f54cdf45cc3702188430afbb65207089bc69..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/bind/bind/0001-revert-d10fbdec-for-lib-dns-gen.c-as-it-is-a-build-p.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 7278f2529a4f811db8f1d7f5f4e36402986a4470 Mon Sep 17 00:00:00 2001 -From: Mark Andrews -Date: Mon, 23 Dec 2019 07:37:13 +1100 -Subject: [PATCH] revert d10fbdec for lib/dns/gen.c as it is a build platform - executable - ---- - lib/dns/gen.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/lib/dns/gen.c b/lib/dns/gen.c -index 99f0395b3a..6c6e55d4c6 100644 ---- a/lib/dns/gen.c -+++ b/lib/dns/gen.c -@@ -26,8 +26,6 @@ - - #include - --#include -- - #include - #include - #include -@@ -39,6 +37,10 @@ - #include - #include - -+#ifndef PATH_MAX -+#define PATH_MAX 1024 -+#endif -+ - #ifdef WIN32 - #include "gen-win32.h" - #else --- -2.12.3 - diff --git a/meta-openeuler/recipes-core/busybox/busybox-inittab_%.bbappend b/meta-openeuler/recipes-core/busybox/busybox-inittab_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..272a04cdac143dc2524cce66cb46d6bfda008d22 --- /dev/null +++ b/meta-openeuler/recipes-core/busybox/busybox-inittab_%.bbappend @@ -0,0 +1,4 @@ +# main yocto-poky/meta/recipes-core/busybox/busybox-inittab_1.33.2.bb +# we create this file as a layer to use openeuler's configs files + +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" diff --git a/meta-openeuler/recipes-core/busybox/busybox_%.bbappend b/meta-openeuler/recipes-core/busybox/busybox_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..94a1af18047b0332a122cefb391132ae64439d96 --- /dev/null +++ b/meta-openeuler/recipes-core/busybox/busybox_%.bbappend @@ -0,0 +1,52 @@ +PV = "1.34.1" + +# use openEuler defconfig +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ + file://busybox-udhcpc-no_deconfig.patch \ + file://0001-testsuite-check-uudecode-before-using-it.patch \ + file://0001-gen_build_files-Use-C-locale-when-calling-sed-on-glo.patch \ + file://0001-awk-fix-CVEs.patch \ + file://0002-man-fix-segfault-in-man-1.patch \ + " + +#we always want busybox with mdev\init packages to support multi init manager +SRC_URI_append = " \ + file://backport-CVE-2022-28391.patch \ + file://backport-CVE-2022-30065.patch \ + file://backport-fix-use-after-free-in-bc-module.patch \ + file://backport-generalize-const-trick.patch \ + file://init.cfg \ + file://rcS.default \ + file://mdev.cfg \ + " + +# support NFS, which depends on libtirpc +DEPENDS += "libtirpc" +CFLAGS += "${@bb.utils.contains('DEPENDS', 'libtirpc', '-I${STAGING_INCDIR}/tirpc', '', d)}" + +do_prepare_config_append () { + set +e + grep -E '^CONFIG_FEATURE_MOUNT_NFS=y|^CONFIG_FEATURE_INETD_RPC=y' ${S}/.config + ret=$? + if [ $ret -eq 0 ]; then + grep -E '^CONFIG_EXTRA_CFLAGS=".*-I/usr/include/tirpc|^CONFIG_EXTRA_LDLIBS=".*tirpc' ${S}/.config + ret=$? + if [ $ret -ne 0 ]; then + sed -i 's/^CONFIG_EXTRA_LDLIBS="/CONFIG_EXTRA_LDLIBS="tirpc /g' ${S}/.config + fi + fi + set -e +} + +do_install_append () { + if grep -q "CONFIG_INIT=y" ${B}/.config ; then + install -D -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d/rcS + install -D -m 0755 ${WORKDIR}/rcK ${D}${sysconfdir}/init.d/rcK + install -D -m 0755 ${WORKDIR}/rcS.default ${D}${sysconfdir}/default/rcS + fi +} + +SRC_URI[tarball.sha256sum] = "415fbd89e5344c96acf449d94a6f956dbed62e18e835fc83e064db33a34bd549" diff --git a/meta-openeuler/recipes-core/busybox/busybox_1.34.1.bb b/meta-openeuler/recipes-core/busybox/busybox_1.34.1.bb deleted file mode 100644 index 2e631d158ce2b8dc5b86d9c085dde75761c2c9b5..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/busybox/busybox_1.34.1.bb +++ /dev/null @@ -1,129 +0,0 @@ -SUMMARY = "Tiny versions of many common UNIX utilities in a single small executable" -DESCRIPTION = "BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete POSIX environment for any small or embedded system." -HOMEPAGE = "https://www.busybox.net" -BUGTRACKER = "https://bugs.busybox.net/" -SECTION = "base" - -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" - -INHIBIT_DEFAULT_DEPS = "1" -PR = "r1" - -DEPENDS += "virtual/libc" -DEPENDS += "libtirpc" -CFLAGS += "-I${STAGING_INCDIR}/tirpc" -#get arch info -inherit kernel-arch - -SRC_URI = "file://busybox/${BP}.tar.bz2 \ - file://yocto-embedded-tools/config/arm64/defconfig-busybox \ -" - -S = "${WORKDIR}/${BP}" - -#not split debug files with dwarfsrcfiles,no dwarfsrcfiles -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" - -# Whether to split the suid apps into a seperate binary -BUSYBOX_SPLIT_SUID ?= "1" - -export EXTRA_CFLAGS = "${CFLAGS}" -export EXTRA_LDFLAGS = "${LDFLAGS}" - -EXTRA_OEMAKE = "CC='${CC}' V=1 ARCH=${ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y HOSTCC='${BUILD_CC}' HOSTCPP='${BUILD_CPP}'" -#use host pkg-config add by openeuler -EXTRA_OECONF += "PKG_CONFIG=pkg-config" -EXTRA_OEMAKE += "PKG_CONFIG=pkg-config" - -PACKAGES =+ "${PN}-linuxrc ${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock \ - ${PN}-less ${PN}-sed ${PN}-pciutils ${PN}-grep ${PN}-cronie ${PN}-gzip ${PN}-kmod ${PN}-procps \ -" -FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www" -FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog" -FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf ${sysconfdir}/mdev/*" -FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd" -FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc" -FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh" -FILES_${PN}-linuxrc = "/linuxrc /init" -PACKAGES =+ "${PN}-bash ${PN}-login ${PN}-groups" -FILES_${PN}-bash = "${base_bindir}/bash" -FILES_${PN}-login = "${base_bindir}/login" -FILES_${PN}-groups = "${bindir}/groups" -FILES_${PN}-less = "${bindir}/less" -FILES_${PN}-sed="${base_bindir}/sed" -FILES_${PN}-pciutils="${bindir}/lspci" -FILES_${PN}-grep="${base_bindir}/*grep" -FILES_${PN}-cronie="${bindir}/crontab ${sbindir}/crond" -FILES_${PN}-gzip="${base_bindir}/gunzip ${base_bindir}/gzip ${base_bindir}/zcat" -FILES_${PN}-kmod="${base_sbindir}/mod* ${base_sbindir}/depmod ${base_sbindir}/insmod ${base_sbindir}/rmmod" -FILES_${PN}-procps = "${base_bindir}/kill ${base_bindir}/ps ${base_bindir}/pidof ${base_sbindir}/sysctl \ - ${bindir}/free ${bindir}/pkill ${bindir}/top ${bindir}/uptime \ -" - -INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock" - -INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd" -INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh" -INITSCRIPT_NAME_${PN}-mdev = "mdev" -INITSCRIPT_PARAMS_${PN}-mdev = "start 04 S ." -INITSCRIPT_NAME_${PN}-syslog = "syslog" -INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" -INITSCRIPT_NAME_${PN}-initrc = "initrc" - -SYSTEMD_PACKAGES = "${PN}-syslog" -SYSTEMD_SERVICE_${PN}-syslog = "${@bb.utils.contains('SRC_URI', 'file://syslog.cfg', 'busybox-syslog.service', '', d)}" - -RDEPENDS_${PN}-syslog = "busybox" -CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf" -RCONFLICTS_${PN}-syslog = "rsyslog sysklogd syslog-ng" - -CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf" - -RRECOMMENDS_${PN} = "${PN}-udhcpc" - -RDEPENDS_${PN} = "${@["", "busybox-inittab"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]}" - -do_configure() { - cp ../yocto-embedded-tools/config/arm64/defconfig-busybox .config - set +e - grep -E '^CONFIG_FEATURE_MOUNT_NFS=y|^CONFIG_FEATURE_INETD_RPC=y' .config - ret=$? - if [ $ret -eq 0 ]; then - grep -E '^CONFIG_EXTRA_CFLAGS=".*-I/usr/include/tirpc|^CONFIG_EXTRA_LDLIBS=".*tirpc' .config - ret=$? - if [ $ret -ne 0 ]; then - sed -i 's/^CONFIG_EXTRA_CFLAGS="/CONFIG_EXTRA_CFLAGS="-I\/usr\/include\/tirpc /g' .config - sed -i 's/^CONFIG_EXTRA_LDLIBS="/CONFIG_EXTRA_LDLIBS="tirpc /g' .config - fi - fi - set -e - yes '' | oe_runmake oldconfig -} - -do_compile () { - export KCONFIG_NOTIMESTAMP=1 - if [ -e .config.orig ]; then - # Need to guard again an interrupted do_compile - restore any backup - cp .config.orig .config - fi - cp .config .config.orig - - for s in suid nosuid; do - oe_runmake busybox_unstripped - mv busybox_unstripped busybox.$s - oe_runmake busybox.links - sort busybox.links > busybox.links.$s - rm busybox.links - done - cp .config.orig .config -} - -do_install () { - oe_runmake CONFIG_PREFIX="${D}" install - pushd "${D}" - ln -s bin/busybox init - popd -} - -INSANE_SKIP += "already-stripped" diff --git a/meta-openeuler/recipes-core/busybox/files/defconfig b/meta-openeuler/recipes-core/busybox/files/defconfig new file mode 100644 index 0000000000000000000000000000000000000000..e1b41f1507feddb44b8b75d451810df5e66e5730 --- /dev/null +++ b/meta-openeuler/recipes-core/busybox/files/defconfig @@ -0,0 +1,1202 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.34.1 +# Thu Mar 24 07:25:31 2022 +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Settings +# +# CONFIG_DESKTOP is not set +CONFIG_EXTRA_COMPAT=y +# CONFIG_FEDORA_COMPAT is not set +CONFIG_INCLUDE_SUSv2=y +CONFIG_LONG_OPTS=y +CONFIG_SHOW_USAGE=y +CONFIG_FEATURE_VERBOSE_USAGE=y +CONFIG_FEATURE_COMPRESS_USAGE=y +CONFIG_LFS=y +# CONFIG_PAM is not set +CONFIG_FEATURE_DEVPTS=y +CONFIG_FEATURE_UTMP=y +CONFIG_FEATURE_WTMP=y +# CONFIG_FEATURE_PIDFILE is not set +CONFIG_PID_FILE_PATH="" +CONFIG_BUSYBOX=y +# CONFIG_FEATURE_SHOW_SCRIPT is not set +CONFIG_FEATURE_INSTALLER=y +# CONFIG_INSTALL_NO_USR is not set +CONFIG_FEATURE_SUID=y +# CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_CLEAN_UP is not set +# CONFIG_FEATURE_SYSLOG_INFO is not set +CONFIG_FEATURE_SYSLOG=y + +# +# Build Options +# +# CONFIG_STATIC is not set +# CONFIG_PIE is not set +# CONFIG_NOMMU is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_LIBBUSYBOX_STATIC is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_CROSS_COMPILER_PREFIX="" +CONFIG_SYSROOT="" +CONFIG_EXTRA_CFLAGS="" +CONFIG_EXTRA_LDFLAGS="" +CONFIG_EXTRA_LDLIBS="" +CONFIG_USE_PORTABLE_CODE=y +CONFIG_STACK_OPTIMIZATION_386=y +CONFIG_STATIC_LIBGCC=y + +# +# Installation Options ("make install" behavior) +# +CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_INSTALL_APPLET_DONT is not set +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_PESSIMIZE is not set +# CONFIG_DEBUG_SANITIZE is not set +# CONFIG_UNIT_TEST is not set +# CONFIG_WERROR is not set +# CONFIG_WARN_SIMPLE_MSG is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set + +# +# Library Tuning +# +# CONFIG_FEATURE_USE_BSS_TAIL is not set +CONFIG_FLOAT_DURATION=y +# CONFIG_FEATURE_RTMINMAX is not set +# CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS is not set +CONFIG_FEATURE_BUFFERS_USE_MALLOC=y +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SMALL=1 +CONFIG_SHA3_SMALL=1 +CONFIG_FEATURE_FAST_TOP=y +CONFIG_FEATURE_ETC_NETWORKS=y +# CONFIG_FEATURE_ETC_SERVICES is not set +CONFIG_FEATURE_EDITING=y +CONFIG_FEATURE_EDITING_MAX_LEN=1024 +CONFIG_FEATURE_EDITING_VI=y +CONFIG_FEATURE_EDITING_HISTORY=255 +CONFIG_FEATURE_EDITING_SAVEHISTORY=y +# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set +# CONFIG_FEATURE_REVERSE_SEARCH is not set +CONFIG_FEATURE_TAB_COMPLETION=y +# CONFIG_FEATURE_USERNAME_COMPLETION is not set +CONFIG_FEATURE_EDITING_FANCY_PROMPT=y +CONFIG_FEATURE_EDITING_WINCH=y +# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +# CONFIG_LOCALE_SUPPORT is not set +# CONFIG_UNICODE_SUPPORT is not set +# CONFIG_UNICODE_USING_LOCALE is not set +# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_SUBST_WCHAR=0 +CONFIG_LAST_SUPPORTED_WCHAR=0 +# CONFIG_UNICODE_COMBINING_WCHARS is not set +# CONFIG_UNICODE_WIDE_WCHARS is not set +# CONFIG_UNICODE_BIDI_SUPPORT is not set +# CONFIG_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_UNICODE_PRESERVE_BROKEN is not set +CONFIG_FEATURE_NON_POSIX_CP=y +# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +# CONFIG_FEATURE_USE_SENDFILE is not set +CONFIG_FEATURE_COPYBUF_KB=4 +CONFIG_FEATURE_SKIP_ROOTFS=y +# CONFIG_MONOTONIC_SYSCALL is not set +CONFIG_IOCTL_HEX2STR_ERROR=y +# CONFIG_FEATURE_HWIB is not set + +# +# Applets +# + +# +# Archival Utilities +# +# CONFIG_FEATURE_SEAMLESS_XZ is not set +# CONFIG_FEATURE_SEAMLESS_LZMA is not set +CONFIG_FEATURE_SEAMLESS_BZ2=y +CONFIG_FEATURE_SEAMLESS_GZ=y +# CONFIG_FEATURE_SEAMLESS_Z is not set +# CONFIG_AR is not set +# CONFIG_FEATURE_AR_LONG_FILENAMES is not set +# CONFIG_FEATURE_AR_CREATE is not set +# CONFIG_UNCOMPRESS is not set +CONFIG_GUNZIP=y +CONFIG_ZCAT=y +CONFIG_FEATURE_GUNZIP_LONG_OPTIONS=y +# CONFIG_BUNZIP2 is not set +# CONFIG_BZCAT is not set +# CONFIG_UNLZMA is not set +# CONFIG_LZCAT is not set +# CONFIG_LZMA is not set +# CONFIG_UNXZ is not set +# CONFIG_XZCAT is not set +# CONFIG_XZ is not set +# CONFIG_BZIP2 is not set +CONFIG_BZIP2_SMALL=0 +# CONFIG_FEATURE_BZIP2_DECOMPRESS is not set +CONFIG_CPIO=y +CONFIG_FEATURE_CPIO_O=y +CONFIG_FEATURE_CPIO_P=y +# CONFIG_DPKG is not set +# CONFIG_DPKG_DEB is not set +CONFIG_GZIP=y +CONFIG_FEATURE_GZIP_LONG_OPTIONS=y +CONFIG_GZIP_FAST=0 +# CONFIG_FEATURE_GZIP_LEVELS is not set +CONFIG_FEATURE_GZIP_DECOMPRESS=y +# CONFIG_LZOP is not set +# CONFIG_UNLZOP is not set +# CONFIG_LZOPCAT is not set +# CONFIG_LZOP_COMPR_HIGH is not set +# CONFIG_RPM is not set +# CONFIG_RPM2CPIO is not set +CONFIG_TAR=y +CONFIG_FEATURE_TAR_LONG_OPTIONS=y +CONFIG_FEATURE_TAR_CREATE=y +CONFIG_FEATURE_TAR_AUTODETECT=y +CONFIG_FEATURE_TAR_FROM=y +CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y +CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y +CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +CONFIG_FEATURE_TAR_TO_COMMAND=y +CONFIG_FEATURE_TAR_UNAME_GNAME=y +CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y +# CONFIG_FEATURE_TAR_SELINUX is not set +CONFIG_UNZIP=y +CONFIG_FEATURE_UNZIP_CDF=y +# CONFIG_FEATURE_UNZIP_BZIP2 is not set +# CONFIG_FEATURE_UNZIP_LZMA is not set +# CONFIG_FEATURE_UNZIP_XZ is not set +# CONFIG_FEATURE_LZMA_FAST is not set + +# +# Coreutils +# +CONFIG_BASENAME=y +CONFIG_CAT=y +# CONFIG_FEATURE_CATN is not set +# CONFIG_FEATURE_CATV is not set +CONFIG_CHGRP=y +CONFIG_CHMOD=y +CONFIG_CHOWN=y +CONFIG_FEATURE_CHOWN_LONG_OPTIONS=y +CONFIG_CHROOT=y +# CONFIG_CKSUM is not set +CONFIG_CRC32=y +CONFIG_COMM=y +CONFIG_CP=y +CONFIG_FEATURE_CP_LONG_OPTIONS=y +# CONFIG_FEATURE_CP_REFLINK is not set +CONFIG_CUT=y +CONFIG_FEATURE_CUT_REGEX=y +CONFIG_DATE=y +CONFIG_FEATURE_DATE_ISOFMT=y +CONFIG_FEATURE_DATE_NANO=y +CONFIG_FEATURE_DATE_COMPAT=y +CONFIG_DD=y +CONFIG_FEATURE_DD_SIGNAL_HANDLING=y +CONFIG_FEATURE_DD_THIRD_STATUS_LINE=y +CONFIG_FEATURE_DD_IBS_OBS=y +CONFIG_FEATURE_DD_STATUS=y +CONFIG_DF=y +CONFIG_FEATURE_DF_FANCY=y +CONFIG_DIRNAME=y +# CONFIG_DOS2UNIX is not set +# CONFIG_UNIX2DOS is not set +CONFIG_DU=y +CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_ECHO=y +CONFIG_FEATURE_FANCY_ECHO=y +CONFIG_ENV=y +CONFIG_EXPAND=y +# CONFIG_UNEXPAND is not set +CONFIG_EXPR=y +CONFIG_EXPR_MATH_SUPPORT_64=y +# CONFIG_FACTOR is not set +CONFIG_FALSE=y +# CONFIG_FOLD is not set +CONFIG_HEAD=y +CONFIG_FEATURE_FANCY_HEAD=y +CONFIG_HOSTID=y +CONFIG_ID=y +CONFIG_GROUPS=y +CONFIG_INSTALL=y +CONFIG_FEATURE_INSTALL_LONG_OPTIONS=y +# CONFIG_LINK is not set +CONFIG_LN=y +CONFIG_LOGNAME=y +CONFIG_LS=y +CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_FEATURE_LS_WIDTH=y +CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +CONFIG_FEATURE_LS_COLOR=y +CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y +CONFIG_MD5SUM=y +# CONFIG_SHA1SUM is not set +# CONFIG_SHA256SUM is not set +# CONFIG_SHA512SUM is not set +# CONFIG_SHA3SUM is not set + +# +# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum +# +CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y +CONFIG_MKDIR=y +CONFIG_MKFIFO=y +CONFIG_MKNOD=y +CONFIG_MKTEMP=y +CONFIG_MV=y +CONFIG_NICE=y +# CONFIG_NL is not set +CONFIG_NOHUP=y +# CONFIG_NPROC is not set +CONFIG_OD=y +# CONFIG_PASTE is not set +CONFIG_PRINTENV=y +CONFIG_PRINTF=y +CONFIG_PWD=y +CONFIG_READLINK=y +CONFIG_FEATURE_READLINK_FOLLOW=y +# CONFIG_REALPATH is not set +CONFIG_RM=y +CONFIG_RMDIR=y +CONFIG_SEQ=y +# CONFIG_SHRED is not set +# CONFIG_SHUF is not set +CONFIG_SLEEP=y +CONFIG_FEATURE_FANCY_SLEEP=y +CONFIG_SORT=y +CONFIG_FEATURE_SORT_BIG=y +# CONFIG_FEATURE_SORT_OPTIMIZE_MEMORY is not set +# CONFIG_SPLIT is not set +# CONFIG_FEATURE_SPLIT_FANCY is not set +CONFIG_STAT=y +CONFIG_FEATURE_STAT_FORMAT=y +CONFIG_FEATURE_STAT_FILESYSTEM=y +CONFIG_STTY=y +CONFIG_SUM=y +CONFIG_SYNC=y +# CONFIG_FEATURE_SYNC_FANCY is not set +CONFIG_FSYNC=y +# CONFIG_TAC is not set +CONFIG_TAIL=y +CONFIG_FEATURE_FANCY_TAIL=y +CONFIG_TEE=y +CONFIG_FEATURE_TEE_USE_BLOCK_IO=y +CONFIG_TEST=y +CONFIG_TEST1=y +CONFIG_TEST2=y +CONFIG_FEATURE_TEST_64=y +CONFIG_TIMEOUT=y +CONFIG_TOUCH=y +# CONFIG_FEATURE_TOUCH_SUSV3 is not set +CONFIG_TR=y +CONFIG_FEATURE_TR_CLASSES=y +CONFIG_FEATURE_TR_EQUIV=y +CONFIG_TRUE=y +# CONFIG_TRUNCATE is not set +CONFIG_TTY=y +CONFIG_UNAME=y +CONFIG_UNAME_OSNAME="GNU/Linux" +# CONFIG_BB_ARCH is not set +CONFIG_UNIQ=y +# CONFIG_UNLINK is not set +CONFIG_USLEEP=y +# CONFIG_UUDECODE is not set +CONFIG_BASE32=y +CONFIG_BASE64=y +# CONFIG_UUENCODE is not set +CONFIG_WC=y +CONFIG_FEATURE_WC_LARGE=y +CONFIG_WHO=y +# CONFIG_W is not set +CONFIG_USERS=y +CONFIG_WHOAMI=y +CONFIG_YES=y + +# +# Common options +# +CONFIG_FEATURE_VERBOSE=y + +# +# Common options for cp and mv +# +CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for df, du, ls +# +CONFIG_FEATURE_HUMAN_READABLE=y + +# +# Console Utilities +# +# CONFIG_CHVT is not set +CONFIG_CLEAR=y +CONFIG_DEALLOCVT=y +# CONFIG_DUMPKMAP is not set +# CONFIG_FGCONSOLE is not set +# CONFIG_KBD_MODE is not set +# CONFIG_LOADFONT is not set +# CONFIG_SETFONT is not set +# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set +CONFIG_DEFAULT_SETFONT_DIR="" +# CONFIG_FEATURE_LOADFONT_PSF2 is not set +# CONFIG_FEATURE_LOADFONT_RAW is not set +CONFIG_LOADKMAP=y +# CONFIG_OPENVT is not set +CONFIG_RESET=y +CONFIG_RESIZE=y +CONFIG_FEATURE_RESIZE_PRINT=y +CONFIG_SETCONSOLE=y +CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y +# CONFIG_SETKEYCODES is not set +# CONFIG_SETLOGCONS is not set +# CONFIG_SHOWKEY is not set + +# +# Debian Utilities +# +# CONFIG_PIPE_PROGRESS is not set +CONFIG_RUN_PARTS=y +CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y +# CONFIG_FEATURE_RUN_PARTS_FANCY is not set +CONFIG_START_STOP_DAEMON=y +CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y +CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y +CONFIG_WHICH=y + +# +# klibc-utils +# +# CONFIG_MINIPS is not set +# CONFIG_NUKE is not set +# CONFIG_RESUME is not set +# CONFIG_RUN_INIT is not set + +# +# Editors +# +CONFIG_AWK=y +CONFIG_FEATURE_AWK_LIBM=y +CONFIG_FEATURE_AWK_GNU_EXTENSIONS=y +CONFIG_CMP=y +CONFIG_DIFF=y +CONFIG_FEATURE_DIFF_LONG_OPTIONS=y +CONFIG_FEATURE_DIFF_DIR=y +CONFIG_ED=y +# CONFIG_PATCH is not set +CONFIG_SED=y +CONFIG_VI=y +CONFIG_FEATURE_VI_MAX_LEN=4096 +# CONFIG_FEATURE_VI_8BIT is not set +CONFIG_FEATURE_VI_COLON=y +CONFIG_FEATURE_VI_COLON_EXPAND=y +CONFIG_FEATURE_VI_YANKMARK=y +CONFIG_FEATURE_VI_SEARCH=y +# CONFIG_FEATURE_VI_REGEX_SEARCH is not set +CONFIG_FEATURE_VI_USE_SIGNALS=y +CONFIG_FEATURE_VI_DOT_CMD=y +CONFIG_FEATURE_VI_READONLY=y +CONFIG_FEATURE_VI_SETOPTS=y +CONFIG_FEATURE_VI_SET=y +CONFIG_FEATURE_VI_WIN_RESIZE=y +CONFIG_FEATURE_VI_ASK_TERMINAL=y +CONFIG_FEATURE_VI_UNDO=y +CONFIG_FEATURE_VI_UNDO_QUEUE=y +CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256 +CONFIG_FEATURE_VI_VERBOSE_STATUS=y +# CONFIG_FEATURE_ALLOW_EXEC is not set + +# +# Finding Utilities +# +CONFIG_FIND=y +CONFIG_FEATURE_FIND_PRINT0=y +CONFIG_FEATURE_FIND_MTIME=y +CONFIG_FEATURE_FIND_MMIN=y +CONFIG_FEATURE_FIND_PERM=y +CONFIG_FEATURE_FIND_TYPE=y +# CONFIG_FEATURE_FIND_EXECUTABLE is not set +CONFIG_FEATURE_FIND_XDEV=y +CONFIG_FEATURE_FIND_MAXDEPTH=y +CONFIG_FEATURE_FIND_NEWER=y +CONFIG_FEATURE_FIND_INUM=y +CONFIG_FEATURE_FIND_EXEC=y +CONFIG_FEATURE_FIND_EXEC_PLUS=y +CONFIG_FEATURE_FIND_USER=y +CONFIG_FEATURE_FIND_GROUP=y +CONFIG_FEATURE_FIND_NOT=y +CONFIG_FEATURE_FIND_DEPTH=y +CONFIG_FEATURE_FIND_PAREN=y +CONFIG_FEATURE_FIND_SIZE=y +CONFIG_FEATURE_FIND_PRUNE=y +# CONFIG_FEATURE_FIND_QUIT is not set +CONFIG_FEATURE_FIND_DELETE=y +# CONFIG_FEATURE_FIND_EMPTY is not set +CONFIG_FEATURE_FIND_PATH=y +CONFIG_FEATURE_FIND_REGEX=y +# CONFIG_FEATURE_FIND_CONTEXT is not set +CONFIG_FEATURE_FIND_LINKS=y +CONFIG_GREP=y +CONFIG_EGREP=y +CONFIG_FGREP=y +CONFIG_FEATURE_GREP_CONTEXT=y +CONFIG_XARGS=y +CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y +CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y +CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y +CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y +CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y +CONFIG_FEATURE_XARGS_SUPPORT_PARALLEL=y +CONFIG_FEATURE_XARGS_SUPPORT_ARGS_FILE=y + +# +# Init Utilities +# +# CONFIG_BOOTCHARTD is not set +# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +CONFIG_HALT=y +CONFIG_POWEROFF=y +CONFIG_REBOOT=y +# CONFIG_FEATURE_WAIT_FOR_INIT is not set +# CONFIG_FEATURE_CALL_TELINIT is not set +CONFIG_TELINIT_PATH="" +CONFIG_INIT=y +CONFIG_LINUXRC=y +CONFIG_FEATURE_USE_INITTAB=y +CONFIG_FEATURE_KILL_REMOVED=y +CONFIG_FEATURE_KILL_DELAY=0 +CONFIG_FEATURE_INIT_SCTTY=y +# CONFIG_FEATURE_INIT_SYSLOG is not set +CONFIG_FEATURE_INIT_QUIET=y +CONFIG_FEATURE_INIT_COREDUMPS=y +CONFIG_INIT_TERMINAL_TYPE="linux" +CONFIG_FEATURE_INIT_MODIFY_CMDLINE=y + +# +# Login/Password Management Utilities +# +CONFIG_FEATURE_SHADOWPASSWDS=y +# CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_USE_BB_SHADOW is not set +# CONFIG_USE_BB_CRYPT is not set +# CONFIG_USE_BB_CRYPT_SHA is not set +# CONFIG_ADD_SHELL is not set +# CONFIG_REMOVE_SHELL is not set +# CONFIG_ADDGROUP is not set +# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set +# CONFIG_ADDUSER is not set +# CONFIG_FEATURE_CHECK_NAMES is not set +CONFIG_LAST_ID=0 +CONFIG_FIRST_SYSTEM_ID=0 +CONFIG_LAST_SYSTEM_ID=0 +# CONFIG_CHPASSWD is not set +CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="" +# CONFIG_CRYPTPW is not set +# CONFIG_MKPASSWD is not set +# CONFIG_DELUSER is not set +# CONFIG_DELGROUP is not set +# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set +CONFIG_GETTY=y +CONFIG_LOGIN=y +# CONFIG_LOGIN_SESSION_AS_CHILD is not set +CONFIG_LOGIN_SCRIPTS=y +CONFIG_FEATURE_NOLOGIN=y +CONFIG_FEATURE_SECURETTY=y +# CONFIG_PASSWD is not set +# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set +# CONFIG_SU is not set +# CONFIG_FEATURE_SU_SYSLOG is not set +# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set +# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set +# CONFIG_SULOGIN is not set +# CONFIG_VLOCK is not set + +# +# Linux Ext2 FS Progs +# +CONFIG_CHATTR=y +CONFIG_FSCK=y +CONFIG_LSATTR=y +# CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +# CONFIG_MODPROBE_SMALL is not set +CONFIG_DEPMOD=y +CONFIG_INSMOD=y +CONFIG_LSMOD=y +# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +CONFIG_MODINFO=y +CONFIG_MODPROBE=y +# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set +CONFIG_RMMOD=y + +# +# Options common to multiple modutils +# +CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS=y +# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set +# CONFIG_FEATURE_2_4_MODULES is not set +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set +# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_FEATURE_MODUTILS_ALIAS is not set +# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set +CONFIG_DEFAULT_MODULES_DIR="/lib/modules" +CONFIG_DEFAULT_DEPMOD_FILE="modules.dep" + +# +# Linux System Utilities +# +# CONFIG_ACPID is not set +# CONFIG_FEATURE_ACPID_COMPAT is not set +# CONFIG_BLKDISCARD is not set +CONFIG_BLKID=y +CONFIG_FEATURE_BLKID_TYPE=y +CONFIG_BLOCKDEV=y +CONFIG_CAL=y +CONFIG_CHRT=y +CONFIG_DMESG=y +CONFIG_FEATURE_DMESG_PRETTY=y +# CONFIG_EJECT is not set +# CONFIG_FEATURE_EJECT_SCSI is not set +# CONFIG_FALLOCATE is not set +# CONFIG_FATATTR is not set +# CONFIG_FBSET is not set +# CONFIG_FEATURE_FBSET_FANCY is not set +# CONFIG_FEATURE_FBSET_READMODE is not set +# CONFIG_FDFORMAT is not set +CONFIG_FDISK=y +# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set +CONFIG_FEATURE_FDISK_WRITABLE=y +CONFIG_FEATURE_AIX_LABEL=y +CONFIG_FEATURE_SGI_LABEL=y +CONFIG_FEATURE_SUN_LABEL=y +CONFIG_FEATURE_OSF_LABEL=y +CONFIG_FEATURE_GPT_LABEL=y +CONFIG_FEATURE_FDISK_ADVANCED=y +CONFIG_FINDFS=y +CONFIG_FLOCK=y +# CONFIG_FDFLUSH is not set +CONFIG_FREERAMDISK=y +CONFIG_FSCK_MINIX=y +# CONFIG_FSFREEZE is not set +# CONFIG_FSTRIM is not set +CONFIG_GETOPT=y +CONFIG_FEATURE_GETOPT_LONG=y +CONFIG_HEXDUMP=y +CONFIG_HD=y +# CONFIG_XXD is not set +CONFIG_HWCLOCK=y +CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y +# CONFIG_IONICE is not set +CONFIG_IPCRM=y +CONFIG_IPCS=y +CONFIG_LAST=y +# CONFIG_FEATURE_LAST_FANCY is not set +CONFIG_LOSETUP=y +CONFIG_LSPCI=y +# CONFIG_LSUSB is not set +CONFIG_MDEV=y +CONFIG_FEATURE_MDEV_CONF=y +CONFIG_FEATURE_MDEV_RENAME=y +CONFIG_FEATURE_MDEV_RENAME_REGEXP=y +CONFIG_FEATURE_MDEV_EXEC=y +CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y +# CONFIG_FEATURE_MDEV_DAEMON is not set +CONFIG_MESG=y +CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y +# CONFIG_MKE2FS is not set +# CONFIG_MKFS_EXT2 is not set +# CONFIG_MKFS_MINIX is not set +CONFIG_FEATURE_MINIX2=y +# CONFIG_MKFS_REISER is not set +CONFIG_MKDOSFS=y +CONFIG_MKFS_VFAT=y +# CONFIG_MKSWAP is not set +# CONFIG_FEATURE_MKSWAP_UUID is not set +CONFIG_MORE=y +CONFIG_MOUNT=y +CONFIG_FEATURE_MOUNT_FAKE=y +CONFIG_FEATURE_MOUNT_VERBOSE=y +# CONFIG_FEATURE_MOUNT_HELPERS is not set +CONFIG_FEATURE_MOUNT_LABEL=y +CONFIG_FEATURE_MOUNT_NFS=y +CONFIG_FEATURE_MOUNT_CIFS=y +CONFIG_FEATURE_MOUNT_FLAGS=y +CONFIG_FEATURE_MOUNT_FSTAB=y +CONFIG_FEATURE_MOUNT_OTHERTAB=y +CONFIG_MOUNTPOINT=y +# CONFIG_NOLOGIN is not set +# CONFIG_NOLOGIN_DEPENDENCIES is not set +# CONFIG_NSENTER is not set +CONFIG_PIVOT_ROOT=y +# CONFIG_RDATE is not set +# CONFIG_RDEV is not set +CONFIG_READPROFILE=y +CONFIG_RENICE=y +CONFIG_REV=y +# CONFIG_RTCWAKE is not set +CONFIG_SCRIPT=y +# CONFIG_SCRIPTREPLAY is not set +# CONFIG_SETARCH is not set +# CONFIG_LINUX32 is not set +# CONFIG_LINUX64 is not set +# CONFIG_SETPRIV is not set +# CONFIG_FEATURE_SETPRIV_DUMP is not set +# CONFIG_FEATURE_SETPRIV_CAPABILITIES is not set +# CONFIG_FEATURE_SETPRIV_CAPABILITY_NAMES is not set +CONFIG_SETSID=y +CONFIG_SWAPON=y +CONFIG_FEATURE_SWAPON_DISCARD=y +CONFIG_FEATURE_SWAPON_PRI=y +CONFIG_SWAPOFF=y +CONFIG_FEATURE_SWAPONOFF_LABEL=y +CONFIG_SWITCH_ROOT=y +CONFIG_TASKSET=y +CONFIG_FEATURE_TASKSET_FANCY=y +CONFIG_FEATURE_TASKSET_CPULIST=y +# CONFIG_UEVENT is not set +CONFIG_UMOUNT=y +CONFIG_FEATURE_UMOUNT_ALL=y +# CONFIG_UNSHARE is not set +# CONFIG_WALL is not set + +# +# Common options for mount/umount +# +CONFIG_FEATURE_MOUNT_LOOP=y +CONFIG_FEATURE_MOUNT_LOOP_CREATE=y +# CONFIG_FEATURE_MTAB_SUPPORT is not set +CONFIG_VOLUMEID=y + +# +# Filesystem/Volume identification +# +CONFIG_FEATURE_VOLUMEID_BCACHE=y +# CONFIG_FEATURE_VOLUMEID_BTRFS is not set +# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set +CONFIG_FEATURE_VOLUMEID_EROFS=y +# CONFIG_FEATURE_VOLUMEID_EXFAT is not set +# CONFIG_FEATURE_VOLUMEID_EXT is not set +CONFIG_FEATURE_VOLUMEID_F2FS=y +# CONFIG_FEATURE_VOLUMEID_FAT is not set +# CONFIG_FEATURE_VOLUMEID_HFS is not set +# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set +# CONFIG_FEATURE_VOLUMEID_JFS is not set +CONFIG_FEATURE_VOLUMEID_LFS=y +# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set +# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set +# CONFIG_FEATURE_VOLUMEID_LUKS is not set +CONFIG_FEATURE_VOLUMEID_MINIX=y +# CONFIG_FEATURE_VOLUMEID_NILFS is not set +# CONFIG_FEATURE_VOLUMEID_NTFS is not set +# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set +# CONFIG_FEATURE_VOLUMEID_REISERFS is not set +# CONFIG_FEATURE_VOLUMEID_ROMFS is not set +CONFIG_FEATURE_VOLUMEID_SQUASHFS=y +# CONFIG_FEATURE_VOLUMEID_SYSV is not set +CONFIG_FEATURE_VOLUMEID_UBIFS=y +# CONFIG_FEATURE_VOLUMEID_UDF is not set +# CONFIG_FEATURE_VOLUMEID_XFS is not set + +# +# Miscellaneous Utilities +# +CONFIG_ADJTIMEX=y +CONFIG_ASCII=y +# CONFIG_BBCONFIG is not set +# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set +# CONFIG_BC is not set +# CONFIG_DC is not set +# CONFIG_FEATURE_DC_BIG is not set +# CONFIG_FEATURE_DC_LIBM is not set +# CONFIG_FEATURE_BC_INTERACTIVE is not set +# CONFIG_FEATURE_BC_LONG_OPTIONS is not set +# CONFIG_BEEP is not set +CONFIG_FEATURE_BEEP_FREQ=0 +CONFIG_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_CHAT is not set +# CONFIG_FEATURE_CHAT_NOFAIL is not set +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_FEATURE_CHAT_CLR_ABORT is not set +# CONFIG_CONSPY is not set +CONFIG_CROND=y +CONFIG_FEATURE_CROND_D=y +CONFIG_FEATURE_CROND_CALL_SENDMAIL=y +CONFIG_FEATURE_CROND_SPECIAL_TIMES=y +CONFIG_FEATURE_CROND_DIR="/var/spool/cron" +CONFIG_CRONTAB=y +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +# CONFIG_DEVMEM is not set +# CONFIG_FBSPLASH is not set +CONFIG_FLASH_ERASEALL=y +CONFIG_FLASH_LOCK=y +CONFIG_FLASH_UNLOCK=y +CONFIG_FLASHCP=y +# CONFIG_HDPARM is not set +# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set +# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +# CONFIG_HEXEDIT is not set +# CONFIG_I2CGET is not set +# CONFIG_I2CSET is not set +# CONFIG_I2CDUMP is not set +# CONFIG_I2CDETECT is not set +# CONFIG_I2CTRANSFER is not set +# CONFIG_INOTIFYD is not set +CONFIG_LESS=y +CONFIG_FEATURE_LESS_MAXLINES=9999999 +CONFIG_FEATURE_LESS_BRACKETS=y +CONFIG_FEATURE_LESS_FLAGS=y +CONFIG_FEATURE_LESS_TRUNCATE=y +CONFIG_FEATURE_LESS_MARKS=y +CONFIG_FEATURE_LESS_REGEXP=y +CONFIG_FEATURE_LESS_WINCH=y +# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set +CONFIG_FEATURE_LESS_DASHCMD=y +CONFIG_FEATURE_LESS_LINENUMS=y +CONFIG_FEATURE_LESS_RAW=y +CONFIG_FEATURE_LESS_ENV=y +# CONFIG_LSSCSI is not set +CONFIG_MAKEDEVS=y +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +CONFIG_FEATURE_MAKEDEVS_TABLE=y +# CONFIG_MAN is not set +# CONFIG_MICROCOM is not set +# CONFIG_MIM is not set +# CONFIG_MT is not set +CONFIG_NANDWRITE=y +CONFIG_NANDDUMP=y +# CONFIG_PARTPROBE is not set +# CONFIG_RAIDAUTORUN is not set +# CONFIG_READAHEAD is not set +# CONFIG_RFKILL is not set +CONFIG_RUNLEVEL=y +CONFIG_RX=y +# CONFIG_SETFATTR is not set +# CONFIG_SETSERIAL is not set +CONFIG_STRINGS=y +CONFIG_TIME=y +# CONFIG_TS is not set +CONFIG_TTYSIZE=y +# CONFIG_UBIATTACH is not set +# CONFIG_UBIDETACH is not set +# CONFIG_UBIMKVOL is not set +# CONFIG_UBIRMVOL is not set +# CONFIG_UBIRSVOL is not set +# CONFIG_UBIUPDATEVOL is not set +# CONFIG_UBIRENAME is not set +# CONFIG_VOLNAME is not set +# CONFIG_WATCHDOG is not set +# CONFIG_FEATURE_WATCHDOG_OPEN_TWICE is not set + +# +# Networking Utilities +# +CONFIG_FEATURE_IPV6=y +# CONFIG_FEATURE_UNIX_LOCAL is not set +CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +# CONFIG_FEATURE_TLS_SHA1 is not set +CONFIG_ARP=y +CONFIG_ARPING=y +# CONFIG_BRCTL is not set +# CONFIG_FEATURE_BRCTL_FANCY is not set +# CONFIG_FEATURE_BRCTL_SHOW is not set +# CONFIG_DNSD is not set +# CONFIG_ETHER_WAKE is not set +# CONFIG_FTPD is not set +# CONFIG_FEATURE_FTPD_WRITE is not set +# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set +# CONFIG_FEATURE_FTPD_AUTHENTICATION is not set +# CONFIG_FTPGET is not set +# CONFIG_FTPPUT is not set +# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +CONFIG_HOSTNAME=y +CONFIG_DNSDOMAINNAME=y +# CONFIG_HTTPD is not set +# CONFIG_FEATURE_HTTPD_RANGES is not set +# CONFIG_FEATURE_HTTPD_SETUID is not set +# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_FEATURE_HTTPD_CGI is not set +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_FEATURE_HTTPD_PROXY is not set +# CONFIG_FEATURE_HTTPD_GZIP is not set +# CONFIG_FEATURE_HTTPD_ETAG is not set +# CONFIG_FEATURE_HTTPD_LAST_MODIFIED is not set +# CONFIG_FEATURE_HTTPD_DATE is not set +# CONFIG_FEATURE_HTTPD_ACL_IP is not set +CONFIG_IFCONFIG=y +CONFIG_FEATURE_IFCONFIG_STATUS=y +CONFIG_FEATURE_IFCONFIG_SLIP=y +CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y +CONFIG_FEATURE_IFCONFIG_HW=y +CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y +CONFIG_IFENSLAVE=y +CONFIG_IFPLUGD=y +CONFIG_IFUP=y +CONFIG_IFDOWN=y +CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate" +CONFIG_FEATURE_IFUPDOWN_IP=y +CONFIG_FEATURE_IFUPDOWN_IPV4=y +CONFIG_FEATURE_IFUPDOWN_IPV6=y +CONFIG_FEATURE_IFUPDOWN_MAPPING=y +CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP=y +# CONFIG_INETD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set +# CONFIG_FEATURE_INETD_RPC is not set +CONFIG_IP=y +CONFIG_IPADDR=y +CONFIG_IPLINK=y +CONFIG_IPROUTE=y +CONFIG_IPTUNNEL=y +CONFIG_IPRULE=y +# CONFIG_IPNEIGH is not set +CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_FEATURE_IP_LINK=y +CONFIG_FEATURE_IP_ROUTE=y +CONFIG_FEATURE_IP_ROUTE_DIR="/etc/iproute2" +CONFIG_FEATURE_IP_TUNNEL=y +CONFIG_FEATURE_IP_RULE=y +CONFIG_FEATURE_IP_NEIGH=y +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_IPCALC is not set +# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set +# CONFIG_FEATURE_IPCALC_FANCY is not set +# CONFIG_FAKEIDENTD is not set +# CONFIG_NAMEIF is not set +# CONFIG_FEATURE_NAMEIF_EXTENDED is not set +# CONFIG_NBDCLIENT is not set +# CONFIG_NC is not set +# CONFIG_NETCAT is not set +# CONFIG_NC_SERVER is not set +# CONFIG_NC_EXTRA is not set +# CONFIG_NC_110_COMPAT is not set +CONFIG_NETSTAT=y +CONFIG_FEATURE_NETSTAT_WIDE=y +CONFIG_FEATURE_NETSTAT_PRG=y +# CONFIG_NSLOOKUP is not set +# CONFIG_FEATURE_NSLOOKUP_BIG is not set +# CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS is not set +# CONFIG_NTPD is not set +# CONFIG_FEATURE_NTPD_SERVER is not set +# CONFIG_FEATURE_NTPD_CONF is not set +# CONFIG_FEATURE_NTP_AUTH is not set +CONFIG_PING=y +CONFIG_PING6=y +CONFIG_FEATURE_FANCY_PING=y +# CONFIG_PSCAN is not set +CONFIG_ROUTE=y +# CONFIG_SLATTACH is not set +# CONFIG_SSL_CLIENT is not set +# CONFIG_TC is not set +# CONFIG_FEATURE_TC_INGRESS is not set +CONFIG_TCPSVD=y +# CONFIG_UDPSVD is not set +# CONFIG_TELNET is not set +# CONFIG_FEATURE_TELNET_TTYPE is not set +# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set +# CONFIG_FEATURE_TELNET_WIDTH is not set +# CONFIG_TELNETD is not set +# CONFIG_FEATURE_TELNETD_STANDALONE is not set +# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set +# CONFIG_TFTP is not set +# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set +# CONFIG_FEATURE_TFTP_HPA_COMPAT is not set +# CONFIG_TFTPD is not set +# CONFIG_FEATURE_TFTP_GET is not set +# CONFIG_FEATURE_TFTP_PUT is not set +# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set +# CONFIG_TFTP_DEBUG is not set +# CONFIG_TLS is not set +# CONFIG_TRACEROUTE is not set +# CONFIG_TRACEROUTE6 is not set +# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set +# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_TUNCTL is not set +# CONFIG_FEATURE_TUNCTL_UG is not set +CONFIG_VCONFIG=y +# CONFIG_WGET is not set +# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set +# CONFIG_FEATURE_WGET_STATUSBAR is not set +# CONFIG_FEATURE_WGET_FTP is not set +# CONFIG_FEATURE_WGET_AUTHENTICATION is not set +# CONFIG_FEATURE_WGET_TIMEOUT is not set +# CONFIG_FEATURE_WGET_HTTPS is not set +# CONFIG_FEATURE_WGET_OPENSSL is not set +# CONFIG_WHOIS is not set +# CONFIG_ZCIP is not set +# CONFIG_UDHCPD is not set +# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set +# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +CONFIG_DHCPD_LEASES_FILE="" +# CONFIG_DUMPLEASES is not set +# CONFIG_DHCPRELAY is not set +CONFIG_UDHCPC=y +CONFIG_FEATURE_UDHCPC_ARPING=y +CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y +CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" +# CONFIG_UDHCPC6 is not set +# CONFIG_FEATURE_UDHCPC6_RFC3646 is not set +# CONFIG_FEATURE_UDHCPC6_RFC4704 is not set +# CONFIG_FEATURE_UDHCPC6_RFC4833 is not set +# CONFIG_FEATURE_UDHCPC6_RFC5970 is not set + +# +# Common options for DHCP applets +# +CONFIG_UDHCPC_DEFAULT_INTERFACE="eth0" +CONFIG_FEATURE_UDHCP_PORT=y +CONFIG_UDHCP_DEBUG=9 +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +CONFIG_FEATURE_UDHCP_RFC3397=y +# CONFIG_FEATURE_UDHCP_8021Q is not set +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n" + +# +# Print Utilities +# +# CONFIG_LPD is not set +# CONFIG_LPR is not set +# CONFIG_LPQ is not set + +# +# Mail Utilities +# +# CONFIG_MAKEMIME is not set +# CONFIG_POPMAILDIR is not set +# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_REFORMIME is not set +# CONFIG_FEATURE_REFORMIME_COMPAT is not set +# CONFIG_SENDMAIL is not set +CONFIG_FEATURE_MIME_CHARSET="" + +# +# Process Utilities +# +CONFIG_FREE=y +CONFIG_FUSER=y +CONFIG_IOSTAT=y +CONFIG_KILL=y +CONFIG_KILLALL=y +CONFIG_KILLALL5=y +CONFIG_LSOF=y +CONFIG_MPSTAT=y +# CONFIG_NMETER is not set +# CONFIG_PGREP is not set +CONFIG_PKILL=y +CONFIG_PIDOF=y +CONFIG_FEATURE_PIDOF_SINGLE=y +CONFIG_FEATURE_PIDOF_OMIT=y +# CONFIG_PMAP is not set +# CONFIG_POWERTOP is not set +# CONFIG_FEATURE_POWERTOP_INTERACTIVE is not set +CONFIG_PS=y +CONFIG_FEATURE_PS_WIDE=y +# CONFIG_FEATURE_PS_LONG is not set +# CONFIG_FEATURE_PS_TIME is not set +# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set +# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_PSTREE is not set +# CONFIG_PWDX is not set +# CONFIG_SMEMCAP is not set +CONFIG_BB_SYSCTL=y +CONFIG_TOP=y +CONFIG_FEATURE_TOP_INTERACTIVE=y +CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y +CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y +# CONFIG_FEATURE_TOP_SMP_CPU is not set +# CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_FEATURE_TOPMEM is not set +CONFIG_UPTIME=y +CONFIG_FEATURE_UPTIME_UTMP_SUPPORT=y +# CONFIG_WATCH is not set +CONFIG_FEATURE_SHOW_THREADS=y + +# +# Runit Utilities +# +# CONFIG_CHPST is not set +# CONFIG_SETUIDGID is not set +# CONFIG_ENVUIDGID is not set +# CONFIG_ENVDIR is not set +# CONFIG_SOFTLIMIT is not set +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_SV is not set +CONFIG_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_SVC is not set +# CONFIG_SVOK is not set +# CONFIG_SVLOGD is not set +# CONFIG_CHCON is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RUNCON is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SESTATUS is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_RESTORECON is not set +# CONFIG_SETSEBOOL is not set + +# +# Shells +# +CONFIG_SH_IS_ASH=y +# CONFIG_SH_IS_HUSH is not set +# CONFIG_SH_IS_NONE is not set +CONFIG_BASH_IS_ASH=y +# CONFIG_BASH_IS_HUSH is not set +# CONFIG_BASH_IS_NONE is not set +CONFIG_SHELL_ASH=y +CONFIG_ASH=y +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y +CONFIG_ASH_INTERNAL_GLOB=y +CONFIG_ASH_BASH_COMPAT=y +CONFIG_ASH_BASH_SOURCE_CURDIR=y +CONFIG_ASH_BASH_NOT_FOUND_HOOK=y +CONFIG_ASH_JOB_CONTROL=y +CONFIG_ASH_ALIAS=y +CONFIG_ASH_RANDOM_SUPPORT=y +CONFIG_ASH_EXPAND_PRMT=y +CONFIG_ASH_IDLE_TIMEOUT=y +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_ECHO=y +CONFIG_ASH_PRINTF=y +CONFIG_ASH_TEST=y +CONFIG_ASH_HELP=y +CONFIG_ASH_GETOPTS=y +CONFIG_ASH_CMDCMD=y +CONFIG_CTTYHACK=y +CONFIG_HUSH=y +CONFIG_SHELL_HUSH=y +CONFIG_HUSH_BASH_COMPAT=y +CONFIG_HUSH_BRACE_EXPANSION=y +CONFIG_HUSH_BASH_SOURCE_CURDIR=y +CONFIG_HUSH_LINENO_VAR=y +CONFIG_HUSH_INTERACTIVE=y +CONFIG_HUSH_SAVEHISTORY=y +CONFIG_HUSH_JOB=y +CONFIG_HUSH_TICK=y +CONFIG_HUSH_IF=y +CONFIG_HUSH_LOOPS=y +CONFIG_HUSH_CASE=y +CONFIG_HUSH_FUNCTIONS=y +CONFIG_HUSH_LOCAL=y +CONFIG_HUSH_RANDOM_SUPPORT=y +CONFIG_HUSH_MODE_X=y +CONFIG_HUSH_ECHO=y +CONFIG_HUSH_PRINTF=y +CONFIG_HUSH_TEST=y +CONFIG_HUSH_HELP=y +CONFIG_HUSH_EXPORT=y +CONFIG_HUSH_EXPORT_N=y +CONFIG_HUSH_READONLY=y +CONFIG_HUSH_KILL=y +CONFIG_HUSH_WAIT=y +CONFIG_HUSH_COMMAND=y +CONFIG_HUSH_TRAP=y +CONFIG_HUSH_TYPE=y +CONFIG_HUSH_TIMES=y +CONFIG_HUSH_READ=y +CONFIG_HUSH_SET=y +CONFIG_HUSH_UNSET=y +CONFIG_HUSH_ULIMIT=y +CONFIG_HUSH_UMASK=y +CONFIG_HUSH_GETOPTS=y +# CONFIG_HUSH_MEMLEAK is not set + +# +# Options common to all shells +# +CONFIG_FEATURE_SH_MATH=y +CONFIG_FEATURE_SH_MATH_64=y +# CONFIG_FEATURE_SH_MATH_BASE is not set +CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_FEATURE_SH_NOFORK is not set +CONFIG_FEATURE_SH_READ_FRAC=y +# CONFIG_FEATURE_SH_HISTFILESIZE is not set +# CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS is not set + +# +# System Logging Utilities +# +CONFIG_KLOGD=y +CONFIG_FEATURE_KLOGD_KLOGCTL=y +CONFIG_LOGGER=y +# CONFIG_LOGREAD is not set +# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set +CONFIG_SYSLOGD=y +CONFIG_FEATURE_ROTATE_LOGFILE=y +# CONFIG_FEATURE_REMOTE_LOG is not set +CONFIG_FEATURE_SYSLOGD_DUP=y +CONFIG_FEATURE_SYSLOGD_CFG=y +CONFIG_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS=y +CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256 +# CONFIG_FEATURE_IPC_SYSLOG is not set +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 +# CONFIG_FEATURE_KMSG_SYSLOG is not set diff --git a/meta-openeuler/recipes-core/busybox/files/inittab b/meta-openeuler/recipes-core/busybox/files/inittab new file mode 100644 index 0000000000000000000000000000000000000000..a730f90d4572cba2f5e5498646dc4fe551c41c8a --- /dev/null +++ b/meta-openeuler/recipes-core/busybox/files/inittab @@ -0,0 +1,29 @@ +# This is run first except when booting in single-user mode. + +# Startup the system +::sysinit:/bin/mount -t proc proc /proc +::sysinit:/bin/mount -t sysfs sysfs /sys +::sysinit:/bin/mount -t devtmpfs devtmpfs /dev +::sysinit:/bin/mount -o remount,rw / +::sysinit:/bin/mkdir -p /dev/shm +::sysinit:/bin/mkdir -p /var/log/audit +::sysinit:/bin/mkdir -p /dev/pts +::sysinit:/bin/mount -a +::sysinit:/sbin/swapon -a +null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd +null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin +null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout +null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr +# set hostname +null::sysinit:/bin/busybox hostname -F /etc/hostname +::sysinit:/etc/init.d/rcS + +# Stuff to do before rebooting +#::ctrlaltdel:/sbin/reboot +::shutdown:/etc/init.d/rcK +::shutdown:/sbin/swapoff -a +::shutdown:/bin/umount -a -r + +# Stuff to do when restarting the init process +::restart:/sbin/init + diff --git a/meta-openeuler/recipes-core/bzip2/bzip2/Makefile.am b/meta-openeuler/recipes-core/bzip2/bzip2/Makefile.am deleted file mode 100644 index 7338df03ebe74d5cf47dc67b627fe8bbcf3021cc..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/bzip2/bzip2/Makefile.am +++ /dev/null @@ -1,74 +0,0 @@ - -lib_LTLIBRARIES = libbz2.la -libbz2_la_LDFLAGS = -version-info 1:6:0 - -libbz2_la_SOURCES = blocksort.c \ - huffman.c \ - crctable.c \ - randtable.c \ - compress.c \ - decompress.c \ - bzlib.c - -bin_PROGRAMS = bzip2 bzip2recover - -bzip2_SOURCES = bzip2.c -bzip2_LDADD = libbz2.la -bzip2_DEPENDENCIES = libbz2.la - -include_HEADERS = bzlib.h - -bzip2recover_SOURCES = bzip2recover.c -bzip2recover_LDADD = libbz2.la -bzip2recover_DEPENDENCIES = libbz2.la - -bin_SCRIPTS = bzgrep bzmore bzdiff - -man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1 -EXTRA_DIST = $(man_MANS) - -runtest: - ./bzip2 -1 < sample1.ref > sample1.rb2 - ./bzip2 -2 < sample2.ref > sample2.rb2 - ./bzip2 -3 < sample3.ref > sample3.rb2 - ./bzip2 -d < sample1.bz2 > sample1.tst - ./bzip2 -d < sample2.bz2 > sample2.tst - ./bzip2 -ds < sample3.bz2 > sample3.tst - @if cmp sample1.bz2 sample1.rb2; then echo "PASS: sample1 compress";\ - else echo "FAIL: sample1 compress"; fi - @if cmp sample2.bz2 sample2.rb2; then echo "PASS: sample2 compress";\ - else echo "FAIL: sample2 compress"; fi - @if cmp sample3.bz2 sample3.rb2; then echo "PASS: sample3 compress";\ - else echo "FAIL: sample3 compress"; fi - @if cmp sample1.tst sample1.ref; then echo "PASS: sample1 decompress";\ - else echo "FAIL: sample1 decompress"; fi - @if cmp sample2.tst sample2.ref; then echo "PASS: sample2 decompress";\ - else echo "FAIL: sample2 decompress"; fi - @if cmp sample3.tst sample3.ref; then echo "PASS: sample3 decompress";\ - else echo "FAIL: sample3 decompress"; fi - ./bzip2-tests/run-tests.sh --without-valgrind --tests-dir="$(PWD)/bzip2-tests" - -install-ptest: - sed -n '/^runtest:/,/^install-ptest:/{/^install-ptest:/!p}' \ - $(srcdir)/Makefile.am > $(DESTDIR)/Makefile - cp $(srcdir)/sample1.ref $(DESTDIR)/ - cp $(srcdir)/sample2.ref $(DESTDIR)/ - cp $(srcdir)/sample3.ref $(DESTDIR)/ - cp $(srcdir)/sample1.bz2 $(DESTDIR)/ - cp $(srcdir)/sample2.bz2 $(DESTDIR)/ - cp $(srcdir)/sample3.bz2 $(DESTDIR)/ - ln -s $(bindir)/bzip2 $(DESTDIR)/bzip2 - -install-exec-hook: - ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bunzip2$(EXEEXT) - ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bzcat$(EXEEXT) - ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzegrep$(EXEEXT) - ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzfgrep$(EXEEXT) - ln -s $(bindir)/bzmore$(EXEEXT) $(DESTDIR)$(bindir)/bzless$(EXEEXT) - ln -s $(bindir)/bzdiff$(EXEEXT) $(DESTDIR)$(bindir)/bzcmp$(EXEEXT) - -install-data-hook: - echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzegrep.1 - echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1 - echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1 - echo ".so man1/bzdiff.1" > $(DESTDIR)$(mandir)/man1/bzcmp.1 diff --git a/meta-openeuler/recipes-core/bzip2/bzip2/configure.ac b/meta-openeuler/recipes-core/bzip2/bzip2/configure.ac deleted file mode 100644 index b8abade2d960fc920bc292b2d4f862a3c74b7c0e..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/bzip2/bzip2/configure.ac +++ /dev/null @@ -1,11 +0,0 @@ -AC_PREREQ([2.57]) - -AC_INIT(bzip2, %BZIP2_VERSION%) -AM_INIT_AUTOMAKE(foreign) -AM_MAINTAINER_MODE - -AC_PROG_CC -AC_PROG_LIBTOOL - -AC_OUTPUT([Makefile]) - diff --git a/meta-openeuler/recipes-core/bzip2/bzip2/run-ptest b/meta-openeuler/recipes-core/bzip2/bzip2/run-ptest deleted file mode 100644 index 3b20fce1ee92d537cd123d33228c3e73c1f38ad7..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/bzip2/bzip2/run-ptest +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -make -k runtest diff --git a/meta-openeuler/recipes-core/bzip2/bzip2_1.0.8.bb b/meta-openeuler/recipes-core/bzip2/bzip2_1.0.8.bb deleted file mode 100644 index 94a75631b157274369ba7d7ed439af08e11413a4..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/bzip2/bzip2_1.0.8.bb +++ /dev/null @@ -1,60 +0,0 @@ -SUMMARY = "Very high-quality data compression program" -DESCRIPTION = "bzip2 compresses files using the Burrows-Wheeler block-sorting text compression algorithm, and \ -Huffman coding. Compression is generally considerably better than that achieved by more conventional \ -LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors." -HOMEPAGE = "https://sourceware.org/bzip2/" -SECTION = "console/utils" -LICENSE = "bzip2-1.0.6 & GPLv3+ & Apache-2.0 & MS-PL & BSD-3-Clause & Zlib" -LICENSE_${PN} = "bzip2-1.0.6" -LICENSE_${PN}-dev = "bzip2-1.0.6" -LICENSE_${PN}-dbg = "bzip2-1.0.6" -LICENSE_${PN}-doc = "bzip2-1.0.6" -LICENSE_${PN}-src = "bzip2-1.0.6" -LICENSE_libbz2 = "bzip2-1.0.6" -LICENSE_${PN}-ptest = "bzip2-1.0.6 & GPLv3+ & Apache-2.0 & MS-PL & BSD-3-Clause & Zlib" - -LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;endline=37;md5=600af43c50f1fcb82e32f19b32df4664 \ -" -#git://sourceware.org/git/bzip2-tests.git;name=bzip2-tests - -SRC_URI = "file://bzip2/bzip2-${PV}.tar.gz \ - file://bzip2/0001-add-compile-option.patch \ - file://bzip2/0002-CVE-2019-12900.patch \ - file://configure.ac;subdir=${BP} \ - file://Makefile.am;subdir=${BP} \ - file://run-ptest \ - " -SRC_URI[md5sum] = "67e051268d0c475ea773822f7500d0e5" -SRC_URI[sha256sum] = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" - -SRCREV_bzip2-tests = "f9061c030a25de5b6829e1abf373057309c734c0" - -UPSTREAM_CHECK_URI = "https://www.sourceware.org/pub/bzip2/" - -PACKAGES =+ "libbz2" - -CFLAGS_append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=64" - -#inherit autotools update-alternatives ptest relative_symlinks -inherit autotools ptest relative_symlinks - -ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN} = "bunzip2 bzcat bzip2" - -#install binaries to bzip2-native under sysroot for replacement-native -EXTRA_OECONF_append_class-native = " --bindir=${STAGING_BINDIR_NATIVE}/${PN}" - -do_configure_prepend () { - sed -i -e "s|%BZIP2_VERSION%|${PV}|" ${S}/configure.ac -} - -do_install_ptest () { - install -d ${D}${PTEST_PATH}/bzip2-tests - sed -i -e "s|^Makefile:|_Makefile:|" ${D}${PTEST_PATH}/Makefile -} -FILES_libbz2 = "${libdir}/lib*${SOLIBS}" - -RDEPENDS_${PN}-ptest += "make bash" - -PROVIDES_append_class-native = " bzip2-replacement-native" -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/cifs-utils/cifs-utils_6.14.bb b/meta-openeuler/recipes-core/cifs-utils/cifs-utils_6.14.bb deleted file mode 100644 index 053dae81a39bd410ff015e0a496593043fe6fba0..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/cifs-utils/cifs-utils_6.14.bb +++ /dev/null @@ -1,36 +0,0 @@ -DESCRIPTION = "A a package of utilities for doing and managing mounts of the Linux CIFS filesystem." -HOMEPAGE = "http://wiki.samba.org/index.php/LinuxCIFS_utils" -SECTION = "otherosfs" -LICENSE = "GPLv3 & LGPLv3" -LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" - -SRC_URI = "file://cifs-utils/${BP}.tar.bz2" -SRC_URI[sha256sum] = "6609e8074b5421295ff012a31f02ccd9a058415c619c81362ebb788dbf0756b8" - -PACKAGECONFIG ??= "" -PACKAGECONFIG[cap] = "--with-libcap,--without-libcap,libcap" -# when enabled, it creates ${bindir}/cifscreds and --ignore-fail-on-non-empty in do_install_append is needed -PACKAGECONFIG[cifscreds] = "--enable-cifscreds,--disable-cifscreds,keyutils" -# when enabled, it creates ${sbindir}/cifs.upcall and --ignore-fail-on-non-empty in do_install_append is needed -PACKAGECONFIG[cifsupcall] = "--enable-cifsupcall,--disable-cifsupcall,krb5 libtalloc keyutils" -PACKAGECONFIG[cifsidmap] = "--enable-cifsidmap,--disable-cifsidmap,keyutils samba" -PACKAGECONFIG[cifsacl] = "--enable-cifsacl,--disable-cifsacl,samba" -PACKAGECONFIG[pam] = "--enable-pam --with-pamdir=${base_libdir}/security,--disable-pam,libpam keyutils" - -inherit autotools pkgconfig - -do_install_append() { - # Remove empty /usr/bin and /usr/sbin directories since the mount helper - # is installed to /sbin - rmdir --ignore-fail-on-non-empty ${D}${bindir} ${D}${sbindir} -} - -do_compile_prepend() { - #fix open source compile error because of the dependency problem - cat Makefile | grep "@\$(MAKE) \$(AM_MAKEFLAGS) install-exec-am install-data-am" || return 1 - sed -i 's/^[[:space:]]@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am/\t\@\$(MAKE) \$(AM_MAKEFLAGS) install-data-am\n\t\@\$(MAKE) \$(AM_MAKEFLAGS) install-exec-am/g' Makefile -} - -FILES_${PN} += "${base_libdir}/security" -FILES_${PN}-dbg += "${base_libdir}/security/.debug" -RRECOMMENDS_${PN} = "kernel-module-cifs" diff --git a/meta-openeuler/recipes-core/clibcni/clibcni_2.0.4.bb b/meta-openeuler/recipes-core/clibcni/clibcni_2.0.4.bb deleted file mode 100644 index 751f711a9d9b399e9bc13af0c9f384608f1ee5aa..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/clibcni/clibcni_2.0.4.bb +++ /dev/null @@ -1,40 +0,0 @@ -DESCRIPTION = "Yet Another JSON Library - A Portable JSON parsing and serialization library in ANSI C" -LICENSE = "MIT" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" - -SRC_URI = "file://clibcni/v2.0.4.tar.gz \ - file://clibcni/0001-fix-CNI_ARGS-value-when-there-is-no-args.patch \ - file://clibcni/0002-add-error-info-for-failed-run-cni-plugin.patch \ - " - -S = "${WORKDIR}/${BPN}" - -inherit cmake -OECMAKE_GENERATOR = "Unix Makefiles" - -DEPENDS = "lcr" -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" - - -FILES_${PN} += "${libdir}/libclibcni.so* " - -do_configure_prepend() { - grep -q CMAKE_SYSROOT ${WORKDIR}/toolchain.cmake || cat >> ${WORKDIR}/toolchain.cmake < -diff --git a/pam/crond b/pam/crond -index 560529d..95a6457 100644 ---- a/pam/crond -+++ b/pam/crond -@@ -4,8 +4,8 @@ - # - # Although no PAM authentication is called, auth modules - # are used for credential setting --auth include system-auth -+auth include common-auth - account required pam_access.so --account include system-auth -+account include common-auth - session required pam_loginuid.so --session include system-auth -+session include common-session-noninteractive diff --git a/meta-openeuler/recipes-core/cronie/cronie/crontab b/meta-openeuler/recipes-core/cronie/cronie/crontab deleted file mode 100644 index 22c4feb2dc17951b17ae9ebc3304a5c156bc7e7b..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/cronie/cronie/crontab +++ /dev/null @@ -1,14 +0,0 @@ -# /etc/crontab: system-wide crontab -# Unlike any other crontab you don't have to run the `crontab' -# command to install the new version when you edit this file -# and files in /etc/cron.d. These files also have username fields, -# that none of the other crontabs do. - -SHELL=/bin/sh -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin - -# m h dom mon dow user command -# 1 * * * * root cd / && run-parts /etc/cron.hourly -# 30 7 * * * root cd / && run-parts /etc/cron.daily -# 42 7 * * 7 root cd / && run-parts /etc/cron.weekly -# 55 7 1 * * root cd / && run-parts /etc/cron.monthly diff --git a/meta-openeuler/recipes-core/cronie/cronie_1.5.7.bb b/meta-openeuler/recipes-core/cronie/cronie_1.5.7.bb deleted file mode 100644 index d67dc8b09c49048590f47210c8b666882376a34b..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/cronie/cronie_1.5.7.bb +++ /dev/null @@ -1,83 +0,0 @@ -SUMMARY = "Cron daemon for executing programs at set times" -DESCRIPTION = "Cronie contains the standard UNIX daemon crond that runs \ -specified programs at scheduled times and related tools. It is based on the \ -original cron and has security and configuration enhancements like the \ -ability to use pam and SELinux." -HOMEPAGE = "https://github.com/cronie-crond/cronie/" -BUGTRACKER = "https://bugzilla.redhat.com" - -# Internet Systems Consortium License -LICENSE = "ISC & BSD-3-Clause & BSD-2-Clause & GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=dd2a592170760e1386c769e1043b3722 \ - file://src/cron.c;endline=20;md5=b425c334265026177128353a142633b4 \ - file://src/popen.c;beginline=3;endline=31;md5=edd50742d8def712e9472dba353668a9" - -SECTION = "utils" - -UPSTREAM_CHECK_URI = "https://github.com/cronie-crond/${BPN}/releases/" - -SRC_URI = "file://cronie/${BP}.tar.gz \ - file://cronie/bugfix-cronie-systemd-alias.patch \ - file://crond.init \ - file://crontab \ - file://crond.service \ - ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ -" - -PAM_SRC_URI = "file://crond_pam_config.patch" -PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid" - -SRC_URI[sha256sum] = "538bcfaf2e986e5ae1edf6d1472a77ea8271d6a9005aee2497a9ed6e13320eb3" - -inherit autotools systemd - -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" - -PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit," -PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,${PAM_DEPS}" -PACKAGECONFIG[anacron] = "--enable-anacron,--disable-anacron,anacron" - -INITSCRIPT_NAME = "crond" -INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ." - -USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "--system crontab" - -SYSTEMD_SERVICE_${PN} = "crond.service" - -do_install_append () { - install -d ${D}${sysconfdir}/sysconfig/ - install -d ${D}${sysconfdir}/init.d/ - install -m 0644 ${S}/crond.sysconfig ${D}${sysconfdir}/sysconfig/crond - install -m 0750 ${WORKDIR}/crond.init ${D}${sysconfdir}/init.d/crond - - # install systemd unit files - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/crond.service ${D}${systemd_unitdir}/system - sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ - -e 's,@SBINDIR@,${sbindir},g' \ - ${D}${systemd_unitdir}/system/crond.service - - # below are necessary for a complete cron environment - install -d ${D}${localstatedir}/spool/cron - install -m 0755 ${WORKDIR}/crontab ${D}${sysconfdir}/ - mkdir -p ${D}${sysconfdir}/cron.d - mkdir -p ${D}${sysconfdir}/cron.hourly - mkdir -p ${D}${sysconfdir}/cron.daily - mkdir -p ${D}${sysconfdir}/cron.weekly - mkdir -p ${D}${sysconfdir}/cron.monthly - touch ${D}${sysconfdir}/cron.deny - - # below setting is necessary to allow normal user using crontab - - # setgid for crontab binary - chmod 2755 ${D}${bindir}/crontab - - # allow 'crontab' group write to /var/spool/cron - chmod 770 ${D}${localstatedir}/spool/cron - - chmod 600 ${D}${sysconfdir}/crontab -} - -FILES_${PN} += "${sysconfdir}/cron*" -CONFFILES_${PN} += "${sysconfdir}/crontab" diff --git a/meta-openeuler/recipes-core/curl/curl_7.79.1.bb b/meta-openeuler/recipes-core/curl/curl_7.79.1.bb deleted file mode 100644 index 1549575aee7616ace238a67f49b4dec30d2193e1..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/curl/curl_7.79.1.bb +++ /dev/null @@ -1,80 +0,0 @@ -SUMMARY = "Command line tool and library for client-side URL transfers" -HOMEPAGE = "http://curl.haxx.se/" -BUGTRACKER = "http://curl.haxx.se/mail/list.cgi?list=curl-tracker" -SECTION = "console/network" -LICENSE = "MIT" - - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" - -SRC_URI = "file://curl/${BP}.tar.xz \ - file://curl/backport-0101-curl-7.32.0-multilib.patch \ -" - -S = "${WORKDIR}/${BP}" - -CVE_PRODUCT = "curl libcurl" -inherit autotools - -# Because UI console is removed from vpp's libopenssl, arm64le-preempt-pro does not support OPENSSL UI. - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} proxy ssl threaded-resolver verbose zlib" -PACKAGECONFIG_class-native = "ipv6 proxy ssl threaded-resolver verbose zlib" -PACKAGECONFIG_class-nativesdk = "ipv6 proxy ssl threaded-resolver verbose zlib" - -# 'ares' and 'threaded-resolver' are mutually exclusive -PACKAGECONFIG[ares] = "--enable-ares,--disable-ares,c-ares" -PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli" -PACKAGECONFIG[builtinmanual] = "--enable-manual,--disable-manual" -PACKAGECONFIG[dict] = "--enable-dict,--disable-dict," -PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls" -PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher," -PACKAGECONFIG[imap] = "--enable-imap,--disable-imap," -PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," -PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5" -PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap," -PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps," -PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2" -PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2" -PACKAGECONFIG[mbedtls] = "--with-mbedtls=${STAGING_DIR_TARGET},--without-mbedtls,mbedtls" -PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2" -PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3," -PACKAGECONFIG[proxy] = "--enable-proxy,--disable-proxy," -PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump" -PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp," -PACKAGECONFIG[smb] = "--enable-smb,--disable-smb," -PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp," -PACKAGECONFIG[ssl] = "--with-ssl --with-random=/dev/urandom,--without-ssl,openssl" -PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss" -PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet," -PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp," -PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver" -PACKAGECONFIG[verbose] = "--enable-verbose,--disable-verbose" -PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib" - -EXTRA_OECONF = " \ - --disable-libcurl-option \ - --disable-ntlm-wb \ - --enable-crypto-auth \ - --without-libpsl \ -" - -do_install_append_class-target() { - # cleanup buildpaths from curl-config - sed -i \ - -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's|${DEBUG_PREFIX_MAP}||g' \ - ${D}${bindir}/curl-config -} - -PACKAGES =+ "lib${BPN}" - -FILES_lib${BPN} = "${libdir}/lib*.so.*" - -FILES_${PN} += "${datadir}/zsh" - -#inherit multilib_script -#MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/curl-config" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/dbus/dbus_%.bbappend b/meta-openeuler/recipes-core/dbus/dbus_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..0a39e6b410186455c2e23d49f035128d6e07d8c2 --- /dev/null +++ b/meta-openeuler/recipes-core/dbus/dbus_%.bbappend @@ -0,0 +1,25 @@ +# version in openEuler +PV = "1.14.0" + +LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \ + file://dbus/dbus.h;beginline=6;endline=20;md5=866739837ccd835350af94dccd6457d8" + + +# apply openEuler source package +SRC_URI_remove = "https://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \ + file://clear-guid_from_server-if-send_negotiate_unix_f.patch \ +" + +# apply src and patches from openEuler +SRC_URI_prepend = "file://dbus-${PV}.tar.xz \ + file://bugfix-let-systemd-restart-dbus-when-the-it-enters-failed.patch \ + file://print-load-average-when-activate-service-timeout.patch \ + file://backport-tools-Use-Python3-for-GetAllMatchRules.patch \ + file://backport-CVE-2022-42012.patch \ + file://backport-CVE-2022-42011.patch \ + file://backport-CVE-2022-42010.patch \ +" + +# checksum changed +SRC_URI[md5sum] = "ddd5570aff05191dbee8e42d751f1b7d" +SRC_URI[sha256sum] = "ccd7cce37596e0a19558fd6648d1272ab43f011d80c8635aea8fd0bad58aebd4" diff --git a/meta-openeuler/recipes-core/dhcp/dhcp_4.4.2.bb b/meta-openeuler/recipes-core/dhcp/dhcp_4.4.2.bb deleted file mode 100644 index 3ae90b51127c95f3ff134c38e74b58db17721846..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/dhcp/dhcp_4.4.2.bb +++ /dev/null @@ -1,8 +0,0 @@ -require dhcp.inc - -COMPONENT = "isc dhcp" - -LDFLAGS_append = " -pthread" - -PACKAGECONFIG ?= "" -PACKAGECONFIG[bind-httpstats] = "--with-libxml2,--without-libxml2,libxml2" diff --git a/meta-openeuler/recipes-core/dosfstools/dosfstools_4.2.bb b/meta-openeuler/recipes-core/dosfstools/dosfstools_4.2.bb deleted file mode 100644 index 3c26fb9e5ed747261b0d0271bf5d80e684570f1f..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/dosfstools/dosfstools_4.2.bb +++ /dev/null @@ -1,26 +0,0 @@ -# dosfstools OE build file -# Copyright (C) 2004-2006, Advanced Micro Devices, Inc. All Rights Reserved -# Copyright (C) 2015, Sören Brinkmann All Rights Reserved -# Released under the MIT license (see packages/COPYING) -SUMMARY = "DOS FAT Filesystem Utilities" -HOMEPAGE = "https://github.com/dosfstools/dosfstools" -SECTION = "base" -LICENSE = "GPLv3" -LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" - -SRC_URI = "file://dosfstools/${BP}.tar.gz" -SRC_URI[sha256sum] = "64926eebf90092dca21b14259a5301b7b98e7b1943e8a201c7d726084809b527" - -UPSTREAM_CHECK_URI = "https://github.com/dosfstools/dosfstools/releases" - -inherit autotools gettext pkgconfig - -EXTRA_OECONF = "--enable-compat-symlinks --without-iconv" - -CFLAGS += "-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" - -BBCLASSEXTEND = "native nativesdk" - -ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN} = "mkfs.vfat" -ALTERNATIVE_LINK_NAME[mkfs.vfat] = "${sbindir}/mkfs.vfat" diff --git a/meta-openeuler/recipes-core/dsoftbus/dsoftbus_1.0.bb b/meta-openeuler/recipes-core/dsoftbus/dsoftbus_1.0.bb index 2c328a9bf07238da52844cc5d6fc20051f62dd9d..9fd65d7eeba5bb782f0805061fca8927ae6d925d 100644 --- a/meta-openeuler/recipes-core/dsoftbus/dsoftbus_1.0.bb +++ b/meta-openeuler/recipes-core/dsoftbus/dsoftbus_1.0.bb @@ -3,11 +3,64 @@ DESCRIPTION = "dsoftbus" PR = "r1" LICENSE = "CLOSED" -inherit bin_package +# gn\ninja has self contained by this project, no need here +DEPENDS = "python3-native ninja-native openssl libboundscheck cjson" -SRC_URI = "file://dsoftbus_output" +S = "${WORKDIR}/dsoftbus-build" +pkg-build="build-OpenHarmony-v3.0.2-LTS" +pkg-deviceauth="security_device_auth-OpenHarmony-v3.1.2-Release" +pkg-huks="security_huks-OpenHarmony-v3.1.2-Release" +pkg-utils="commonlibrary_c_utils-OpenHarmony-v3.1.2-Release" +pkg-mebedtls="third_party_mbedtls-OpenHarmony-v3.1.2-Release" +pkg-libcoap="third_party_libcoap-OpenHarmony-v3.1.2-Release" -S = "${WORKDIR}/dsoftbus_output" +dsoftbus-buildtools="${S}/prebuilts/build-tools/linux-x86/bin" +dsoftbus-thirdparty="${S}/third_party" +dsoftbus-utils="${S}/utils" +dsoftbus-src="${S}/foundation/communication" +dsoftbus-hichain="${S}/base/security" +dsoftbus-productdefine="${S}/productdefine" +dsoftbus-depend="${S}/depend" + +SRC_URI = " \ + file://yocto-embedded-tools/dsoftbus/build_tools/gn-linux-x86-1717.tar.gz \ + file://dsoftbus/${pkg-build}.tar.gz \ + file://dsoftbus/${pkg-deviceauth}.tar.gz \ + file://dsoftbus/${pkg-huks}.tar.gz \ + file://dsoftbus/${pkg-utils}.tar.gz \ + file://dsoftbus/${pkg-mebedtls}.tar.gz \ + file://dsoftbus/${pkg-libcoap}.tar.gz \ + file://dsoftbus_standard;unpack=true \ + file://embedded-ipc;unpack=true \ + file://dsoftbus/build-0001-add-dsoftbus-build-support-for-embedded-env.patch;patchdir=${S}/build \ + file://dsoftbus/build-0002-support-hichian-for-openeuler.patch;patchdir=${S}/build \ + file://dsoftbus/build-0003-add-deviceauth-ipc-sdk-compile.patch;patchdir=${S}/build \ + file://dsoftbus/security-device-auth-0001-deviceauth-for-openeuler.patch;patchdir=${dsoftbus-hichain}/deviceauth \ + file://dsoftbus/security-device-auth-0002-deviceauth-ipc-service.patch;patchdir=${dsoftbus-hichain}/deviceauth \ + file://dsoftbus/security-device-auth-0003-simplify-dependency-on-third-party-packages.patch;patchdir=${dsoftbus-hichain}/deviceauth \ + file://dsoftbus/security-huks-0001-support-huks-for-openeuler.patch;patchdir=${dsoftbus-hichain}/huks \ + file://dsoftbus/security-huks-0002-simplify-dependency-on-third-party-packages.patch;patchdir=${dsoftbus-hichain}/huks \ + file://dsoftbus/security-huks-0003-fix-discarded-qualifiers-error.patch;patchdir=${dsoftbus-hichain}/huks \ + file://dsoftbus/commonlibrary-c-utils-0001-Adaptation-for-dsoftbus.patch;patchdir=${dsoftbus-utils}/native \ + file://dsoftbus/libboundscheck-0001-Adaptation-for-dsoftbus.patch;patchdir=${dsoftbus-thirdparty}/bounds_checking_function \ + file://dsoftbus/third-party-cjson-0001-adapter-cjson-in-openEuler-for-softbus.patch;patchdir=${dsoftbus-thirdparty}/cJSON \ + file://dsoftbus/third-party-mbedtls-0001-Adaptation-for-dsoftbus.patch;patchdir=${dsoftbus-thirdparty}/mbedtls \ + file://dsoftbus/third-party-mbedtls-0002-fix-CVE-2021-43666.patch;patchdir=${dsoftbus-thirdparty}/mbedtls \ + file://dsoftbus/third-party-mbedtls-0002-fix-CVE-2021-45451.patch;patchdir=${dsoftbus-thirdparty}/mbedtls \ + file://dsoftbus/depend-0001-add-productdefine-for-openeuler.patch;patchdir=${dsoftbus-productdefine}/ \ + file://dsoftbus/depend-0002-add-depend-for-openeuler.patch;patchdir=${dsoftbus-depend} \ + " + +# fix libboundscheck.so not found +RDEPENDS_${PN} = "libboundscheck" + +# bluetooth only support for raspberrypi, qemu don't compile it +FILESEXTRAPATHS:prepend := "${THISDIR}/files/:" +DEPENDS:append:raspberrypi4-64 = " bluez5 " +SRC_URI:append:raspberrypi4-64 = " \ + file://add-bluez-adapter-for-dsoftbus.patch;patchdir=${dsoftbus-depend} \ + file://apply-ble-discovery-support.patch;patchdir=${dsoftbus-src}/dsoftbus \ +" FILES_${PN}-dev = "${includedir}" FILES_${PN} = "${libdir} ${bindir} /data/" @@ -15,15 +68,93 @@ FILES_${PN} = "${libdir} ${bindir} /data/" INSANE_SKIP_${PN} += "already-stripped" ALLOW_EMPTY_${PN} = "1" +python do_fetch_prepend() { + repoList = [{ + "repo_name": "yocto-embedded-tools", + "git_url": "https://gitee.com/openeuler", + "branch": "master" + },{ + "repo_name": "dsoftbus_standard", + "git_url": "https://gitee.com/openeuler", + "branch": "dev" + },{ + "repo_name": "embedded-ipc", + "git_url": "https://gitee.com/openeuler", + "branch": "master" + },{ + "repo_name": "dsoftbus", + "git_url": "https://gitee.com/src-openeuler", + "branch": "master" + }] + + d.setVar("PKG_REPO_LIST", repoList) + + bb.build.exec_func("do_openeuler_fetchs", d) +} + +do_unpack_append() { + bb.build.exec_func('do_copy_dsoftbus_source', d) +} + +do_copy_dsoftbus_source() { + mkdir -p ${dsoftbus-buildtools} + mkdir -p ${dsoftbus-src} + mkdir -p ${dsoftbus-hichain} + mkdir -p ${dsoftbus-utils} + mkdir -p ${dsoftbus-thirdparty} + mkdir -p ${dsoftbus-thirdparty}/cJSON + mkdir -p ${dsoftbus-thirdparty}/bounds_checking_function + mkdir -p ${dsoftbus-productdefine} + mkdir -p ${dsoftbus-depend} + + cp -rfp ${WORKDIR}/gn ${dsoftbus-buildtools}/ + mv ${WORKDIR}/${pkg-build} ${S}/build + mv ${WORKDIR}/${pkg-deviceauth} ${dsoftbus-hichain}/deviceauth + mv ${WORKDIR}/${pkg-huks} ${dsoftbus-hichain}/huks + mv ${WORKDIR}/${pkg-utils} ${dsoftbus-utils}/native + mv ${WORKDIR}/${pkg-mebedtls} ${dsoftbus-thirdparty}/mbedtls + mv ${WORKDIR}/${pkg-libcoap} ${dsoftbus-thirdparty}/libcoap + mv ${WORKDIR}/dsoftbus_standard ${dsoftbus-src}/dsoftbus + mv ${WORKDIR}/embedded-ipc ${dsoftbus-depend}/ipc + + ln -s `which ninja` ${dsoftbus-buildtools}/ninja + + #init gn root + ln -s ${S}/build/build_scripts/build.sh ${S}/build.sh + ln -s ${S}/build/core/gn/dotfile.gn ${S}/.gn + + #link toolchain + ln -s ${EXTERNAL_TOOLCHAIN} ${S}/toolchain +} + +do_compile() { + export STAGING_DIR_TARGET="${STAGING_DIR_TARGET}" + ./build.sh --product-name openEuler +} + do_install() { - #not fail when not exist dsoftbus_output - rm -f ${S}/.xxx - if [ -z "$(ls -A ${S})" ]; then - bbnote bin_package has nothing to install. - return 0 - fi - install -d ${D}/data/data/ - cd ${S} - tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \ - | tar --no-same-owner -xpf - -C ${D} + install -d ${D}${libdir}/ + install -d ${D}${bindir}/ + install -d ${D}/${includedir}/ + install -d ${D}/data/data/deviceauth/ + + # prepare so + install -m 0755 ${S}/out/ohos-arm64-release/common/common/*.so ${D}${libdir}/ + install -m 0755 ${S}/out/ohos-arm64-release/communication/dsoftbus_standard/*.so ${D}${libdir}/ + install -m 0755 ${S}/out/ohos-arm64-release/security/huks/*.so ${D}${libdir}/ + install -m 0755 ${S}/out/ohos-arm64-release/security/deviceauth_standard/*.so ${D}${libdir}/ + + # prepare bin + install -m 0755 ${S}/out/ohos-arm64-release/communication/dsoftbus_standard/softbus_server_main ${D}${bindir}/ + + # prepare head files + install -m 554 \ + ${S}/foundation/communication/dsoftbus/interfaces/kits/discovery/*.h \ + ${S}/foundation/communication/dsoftbus/interfaces/kits/common/*.h \ + ${S}/foundation/communication/dsoftbus/interfaces/kits/bus_center/*.h \ + ${S}/foundation/communication/dsoftbus/interfaces/kits/transport/*.h \ + ${S}/foundation/communication/dsoftbus/core/common/include/softbus_errcode.h \ + ${S}/base/security/deviceauth/interfaces/innerkits/*.h \ + ${S}/depend/syspara/include/*.h \ + ${D}${includedir}/ } diff --git a/meta-openeuler/recipes-core/dsoftbus/files/add-bluez-adapter-for-dsoftbus.patch b/meta-openeuler/recipes-core/dsoftbus/files/add-bluez-adapter-for-dsoftbus.patch new file mode 100644 index 0000000000000000000000000000000000000000..10984ec21e1532e3d0f0786c5231718fc2f2985c --- /dev/null +++ b/meta-openeuler/recipes-core/dsoftbus/files/add-bluez-adapter-for-dsoftbus.patch @@ -0,0 +1,738 @@ +From 2466e9e7ec34ac29d4768cefed349ae1c6a6c3df Mon Sep 17 00:00:00 2001 +From: hmilylmk +Date: Tue, 14 Mar 2023 19:36:08 +0800 +Subject: [PATCH] add bluez adapter for dsoftbus + +Signed-off-by: hmilylmk +--- + BUILD.gn | 20 ++ + bluez_adapter/bluez_adapter.c | 442 +++++++++++++++++++++++++++ + bluez_adapter/include/ohos_bt_def.h | 26 ++ + bluez_adapter/include/ohos_bt_gap.h | 44 +++ + bluez_adapter/include/ohos_bt_gatt.h | 153 ++++++++++ + 5 files changed, 685 insertions(+) + create mode 100644 bluez_adapter/bluez_adapter.c + create mode 100644 bluez_adapter/include/ohos_bt_def.h + create mode 100644 bluez_adapter/include/ohos_bt_gap.h + create mode 100644 bluez_adapter/include/ohos_bt_gatt.h + +diff --git a/BUILD.gn b/BUILD.gn +index 14a5b0e..e155dfa 100644 +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -57,3 +57,23 @@ ohos_shared_library("syspara") { + "//third_party/mbedtls:mbedtls_shared", + ] + } ++ ++config("bluez_adapter_config") { ++ include_dirs = [ ++ "bluez_adapter/include", ++ ] ++} ++ ++ohos_shared_library("bluez_adapter") { ++ include_dirs = [ ++ "bluez_adapter/include", ++ ] ++ sources = [ ++ "bluez_adapter/bluez_adapter.c", ++ ] ++ public_configs = [ ":bluez_adapter_config" ] ++ deps = [ ++ "//third_party/bounds_checking_function:libsec_shared", ++ ] ++ libs = [ "bluetooth" ] ++} +diff --git a/bluez_adapter/bluez_adapter.c b/bluez_adapter/bluez_adapter.c +new file mode 100644 +index 0000000..274c70b +--- /dev/null ++++ b/bluez_adapter/bluez_adapter.c +@@ -0,0 +1,442 @@ ++#include ++#include ++#include ++#include ++#include ++ ++#include "bluetooth/bluetooth.h" ++#include "bluetooth/hci.h" ++#include "bluetooth/hci_lib.h" ++#include "ohos_bt_gap.h" ++#include "ohos_bt_gatt.h" ++ ++#define INSTANCE_MAX 2 ++#define MAX_ADV_DATA_LEN 31 ++#define SCAN_WINDOW 10 ++#define SCAN_INTERVAL 10 ++ ++static int g_instance_arr[INSTANCE_MAX] = {0}; ++ ++static int g_dev_id = 0; ++ ++static StartAdvRawData g_advData[INSTANCE_MAX]; ++ ++static bdaddr_t g_bdaddr[INSTANCE_MAX]; ++ ++static ScanResultCallback g_resultCallback = NULL; ++ ++volatile bool g_isAdvertising = false; ++ ++volatile bool g_isScanning = false; ++ ++static bool g_isRandomAddr = false; ++ ++static int g_scan_dd = -1; ++ ++static int g_adv_dd = -1; ++ ++static pthread_t g_scan_id = -1; ++ ++static pthread_t g_adv_id = -1; ++ ++void scanResultFunc(void *arg) { ++ unsigned char buf[HCI_MAX_EVENT_SIZE], *ptr; ++ struct hci_filter nf, of; ++ socklen_t olen; ++ int len; ++ ++ olen = sizeof(of); ++ if (getsockopt(g_scan_dd, SOL_HCI, HCI_FILTER, &of, &olen) < 0) { ++ printf("Could not get socket options\n"); ++ } ++ ++ hci_filter_clear(&nf); ++ hci_filter_set_ptype(HCI_EVENT_PKT, &nf); ++ hci_filter_set_event(EVT_LE_META_EVENT, &nf); ++ ++ if (setsockopt(g_scan_dd, SOL_HCI, HCI_FILTER, &nf, sizeof(nf)) < 0) { ++ printf("Could not set socket options\n"); ++ } ++ ++ while (1) { ++ evt_le_meta_event *meta; ++ le_advertising_info *info; ++ ++ while ((len = read(g_scan_dd, buf, sizeof(buf))) < 0) { ++ if (errno == EAGAIN || errno == EINTR) continue; ++ goto done; ++ } ++ ++ ptr = buf + (1 + HCI_EVENT_HDR_SIZE); ++ len -= (1 + HCI_EVENT_HDR_SIZE); ++ ++ meta = (void *)ptr; ++ ++ if (meta->subevent != 0x02) goto done; ++ ++ /* Ignoring multiple reports */ ++ info = (le_advertising_info *)(meta->data + 1); ++ BtScanResultData scanResult; ++ scanResult.eventType = OHOS_BLE_EVT_LEGACY_CONNECTABLE; ++ scanResult.dataStatus = OHOS_BLE_DATA_COMPLETE; ++ scanResult.addrType = OHOS_BLE_RANDOM_DEVICE_ADDRESS; ++ scanResult.primaryPhy = OHOS_BLE_SCAN_PHY_1M; ++ scanResult.secondaryPhy = OHOS_BLE_SCAN_PHY_1M; ++ scanResult.advSid = 1; ++ scanResult.txPower = 1; ++ scanResult.rssi = 0xE0; ++ scanResult.directAddrType = OHOS_BLE_RANDOM_DEVICE_ADDRESS; ++ memcpy(scanResult.addr.addr, info->bdaddr.b, 6); ++ scanResult.advData = info->data; ++ scanResult.advLen = info->length; ++ if (g_resultCallback != NULL) ++ g_resultCallback(&scanResult); ++done: ++ ; ++ } ++} ++ ++int BleStartScan(void) { ++ int dd, err; ++ uint8_t own_type = LE_PUBLIC_ADDRESS; ++ uint8_t scan_type = OHOS_BLE_SCAN_TYPE_ACTIVE; ++ uint8_t filter_policy = OHOS_BLE_ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY; ++ uint16_t interval = htobs(SCAN_INTERVAL); ++ uint16_t window = htobs(SCAN_WINDOW); ++ uint8_t filter_dup = 0x01; ++ if (g_scan_dd == -1) { ++ g_scan_dd = hci_open_dev(g_dev_id); ++ if (g_scan_dd < 0) { ++ perror("Could not open device"); ++ return -1; ++ } ++ } ++ ++ dd = hci_open_dev(g_dev_id); ++ if (!g_isScanning) { ++ hci_le_set_scan_parameters(dd, scan_type, interval, window, ++ own_type, filter_policy, 10000); ++ hci_le_set_scan_enable(dd, 0x01, filter_dup, 10000); ++ g_isScanning = true; ++ } ++ hci_close_dev(dd); ++ ++ if (g_scan_id == -1) { ++ err = pthread_create(&g_scan_id, NULL, (void *)&scanResultFunc, NULL); ++ if (err < 0) { ++ perror("pthread_create failed"); ++ hci_close_dev(g_scan_dd); ++ return -1; ++ } ++ } ++ return 0; ++} ++ ++int hci_le_set_adv_parameters(int dd, uint16_t min_interval, ++ uint16_t max_interval, uint8_t advtype, ++ uint8_t chan_map, uint8_t filter, int to) { ++ struct hci_request rq; ++ le_set_advertising_parameters_cp adv_params_cp; ++ uint8_t status; ++ ++ memset(&adv_params_cp, 0, sizeof(adv_params_cp)); ++ adv_params_cp.min_interval = min_interval; ++ adv_params_cp.max_interval = max_interval; ++ adv_params_cp.advtype = advtype; ++ adv_params_cp.own_bdaddr_type = LE_RANDOM_ADDRESS; ++ adv_params_cp.chan_map = 7; ++ ++ memset(&rq, 0, sizeof(rq)); ++ rq.ogf = OGF_LE_CTL; ++ rq.ocf = OCF_LE_SET_ADVERTISING_PARAMETERS; ++ rq.cparam = &adv_params_cp; ++ rq.clen = LE_SET_ADVERTISING_PARAMETERS_CP_SIZE; ++ rq.rparam = &status; ++ rq.rlen = 1; ++ ++ if (hci_send_req(dd, &rq, to) < 0) return -1; ++ ++ if (status) { ++ errno = EIO; ++ return -1; ++ } ++ return 0; ++} ++ ++int get_instance_index() { ++ for (int i = 0; i < INSTANCE_MAX; ++i) { ++ if (g_instance_arr[i] == 0) { ++ g_instance_arr[i] = 1; ++ return i; ++ } ++ } ++ return -1; ++} ++ ++int hci_le_set_adv_data(int dd, unsigned char *data, unsigned int dataLen, ++ int to) { ++ struct hci_request rq; ++ le_set_advertising_data_cp adv_data_cp; ++ uint8_t status; ++ ++ memset(&adv_data_cp, 0, sizeof(adv_data_cp)); ++ memcpy(adv_data_cp.data, data, dataLen); ++ adv_data_cp.length = dataLen; ++ ++ memset(&rq, 0, sizeof(rq)); ++ rq.ogf = OGF_LE_CTL; ++ rq.ocf = OCF_LE_SET_ADVERTISING_DATA; ++ rq.cparam = &adv_data_cp; ++ rq.clen = LE_SET_ADVERTISING_DATA_CP_SIZE; ++ rq.rparam = &status; ++ rq.rlen = 1; ++ ++ if (hci_send_req(dd, &rq, to) < 0) return -1; ++ ++ if (status) { ++ errno = EIO; ++ return -1; ++ } ++ return 0; ++} ++ ++int hci_le_set_adv_rsp_data(int dd, unsigned char *rspData, ++ unsigned int dataLen, int to) { ++ struct hci_request rq; ++ le_set_scan_response_data_cp adv_rspdata_cp; ++ uint8_t status; ++ ++ memset(&adv_rspdata_cp, 0, sizeof(adv_rspdata_cp)); ++ memcpy(adv_rspdata_cp.data, rspData, dataLen); ++ adv_rspdata_cp.length = dataLen; ++ ++ memset(&rq, 0, sizeof(rq)); ++ rq.ogf = OGF_LE_CTL; ++ rq.ocf = OCF_LE_SET_SCAN_RESPONSE_DATA; ++ rq.cparam = &adv_rspdata_cp; ++ rq.clen = LE_SET_SCAN_RESPONSE_DATA_CP_SIZE; ++ rq.rparam = &status; ++ rq.rlen = 1; ++ ++ if (hci_send_req(dd, &rq, to) < 0) return -1; ++ ++ if (status) { ++ errno = EIO; ++ return -1; ++ } ++ return 0; ++} ++ ++int hci_le_set_random_addr(int dd, bdaddr_t addr, int to) { ++ struct hci_request rq; ++ le_set_random_address_cp cp; ++ uint8_t status; ++ ++ memset(&cp, 0, sizeof(cp)); ++ cp.bdaddr = addr; ++ ++ memset(&rq, 0, sizeof(rq)); ++ rq.ogf = OGF_LE_CTL; ++ rq.ocf = OCF_LE_SET_RANDOM_ADDRESS; ++ rq.cparam = &cp; ++ rq.clen = LE_SET_RANDOM_ADDRESS_CP_SIZE; ++ rq.rparam = &status; ++ rq.rlen = 1; ++ ++ if (hci_send_req(dd, &rq, to) < 0) return -1; ++ ++ if (status) { ++ errno = EIO; ++ return -1; ++ } ++ return 0; ++} ++ ++void advFunc(void *arg) { ++ while (1) { ++ while (g_isAdvertising && g_isScanning) { ++ for (int i = 0; i < INSTANCE_MAX; ++i) { ++ if (g_instance_arr[i] == 1) { ++ int dd = hci_open_dev(g_dev_id); ++ hci_le_set_scan_enable(dd, 0x00, 0x01, 10000); ++ hci_le_set_advertise_enable(dd, 0x00, 10000); ++ ++ hci_le_set_adv_data(dd, g_advData[i].advData, ++ g_advData[i].advDataLen, 10000); ++ hci_le_set_adv_rsp_data(dd, g_advData[i].rspData, ++ g_advData[i].rspDataLen, 10000); ++ hci_le_set_random_addr(dd, g_bdaddr[i], 10000); ++ ++ hci_le_set_advertise_enable(dd, 0x01, 10000); ++ hci_le_set_scan_enable(dd, 0x01, 0x01, 10000); ++ hci_close_dev(dd); ++ } ++ sleep(2); ++ } ++ } ++ } ++} ++ ++void initRandomAddr() { ++ srand((unsigned)time(NULL)); ++ for (int i = 0; i < INSTANCE_MAX; ++i) { ++ g_bdaddr[i].b[0] = rand() % 32; ++ for (int j = 1; j < 6; ++j) { ++ g_bdaddr[i].b[j] = rand() % 128; ++ } ++ } ++ g_isRandomAddr = true; ++} ++ ++int BleStartAdvEx(int *advId, const StartAdvRawData rawData, ++ BleAdvParams advParam) { ++ int err, instance; ++ ++ if (g_adv_dd == -1) { ++ g_adv_dd = hci_open_dev(g_dev_id); ++ if (g_adv_dd < 0) { ++ perror("Could not open device"); ++ return -1; ++ } ++ } ++ ++ if (!g_isAdvertising) { ++ err = hci_le_set_adv_parameters(g_adv_dd, advParam.minInterval, ++ advParam.maxInterval, advParam.advType, ++ advParam.channelMap, ++ advParam.advFilterPolicy, 10000); ++ if (err < 0) { ++ perror("Set Adv Parameters failed"); ++ hci_close_dev(g_adv_dd); ++ return -1; ++ } ++ err = hci_le_set_advertise_enable(g_adv_dd, 0x01, 10000); ++ if (err < 0) { ++ perror("Enable adv failed"); ++ hci_close_dev(g_adv_dd); ++ return -1; ++ } ++ g_isAdvertising = true; ++ } ++ ++ instance = get_instance_index(); ++ if (g_advData[instance].advData == NULL) ++ g_advData[instance].advData = ++ (unsigned char *)malloc(sizeof(unsigned char) * MAX_ADV_DATA_LEN); ++ if (g_advData[instance].rspData == NULL) ++ g_advData[instance].rspData = ++ (unsigned char *)malloc(sizeof(unsigned char) * MAX_ADV_DATA_LEN); ++ ++ memcpy(g_advData[instance].advData, rawData.advData, rawData.advDataLen); ++ memcpy(g_advData[instance].rspData, rawData.rspData, rawData.rspDataLen); ++ g_advData[instance].advDataLen = rawData.advDataLen; ++ g_advData[instance].rspDataLen = rawData.rspDataLen; ++ if (!g_isRandomAddr) ++ initRandomAddr(); ++ ++ if (g_adv_id == -1) { ++ err = pthread_create(&g_adv_id, NULL, (void *)&advFunc, NULL); ++ if (err < 0) { ++ perror("pthread_create failed"); ++ hci_close_dev(g_adv_dd); ++ return -1; ++ } ++ } ++ ++ return 0; ++} ++ ++int BleGattRegisterCallbacks(BtGattCallbacks *func) { ++ if (func == NULL || func->scanResultCb == NULL) { ++ perror("RegisterResultCb failed"); ++ return -1; ++ } ++ g_resultCallback = func->scanResultCb; ++ return 0; ++} ++ ++int BleStopAdv(int advId) { ++ int dd, err; ++ ++ dd = hci_open_dev(g_dev_id); ++ if (dd < 0) { ++ perror("Could not open device"); ++ return -1; ++ } ++ err = hci_le_set_advertise_enable(dd, 0x00, 10000); ++ if (err < 0) { ++ perror("Disable adv failed"); ++ hci_close_dev(dd); ++ return -1; ++ } ++ g_isAdvertising = false; ++ hci_close_dev(dd); ++ return 0; ++} ++ ++int BleStopScan(void) { ++ int dd, err; ++ uint8_t filter_dup = 0x01; ++ dd = hci_open_dev(g_dev_id); ++ if (dd < 0) { ++ perror("Could not open device"); ++ return -1; ++ } ++ err = hci_le_set_scan_enable(dd, 0x00, filter_dup, 10000); ++ if (err < 0) { ++ perror("Disable scan failed"); ++ hci_close_dev(dd); ++ return -1; ++ } ++ g_isScanning = false; ++ hci_close_dev(dd); ++ return 0; ++} ++ ++bool GetLocalAddr(unsigned char *mac, unsigned int len) { ++ int dd, err; ++ dd = hci_open_dev(g_dev_id); ++ if (dd < 0) { ++ perror("Could not open device"); ++ return false; ++ } ++ bdaddr_t bdaddr; ++ err = hci_read_bd_addr(dd, &bdaddr, 10000); ++ if (err < 0) { ++ perror("Disable scan failed"); ++ hci_close_dev(dd); ++ return false; ++ } ++ memcpy(mac, bdaddr.b, len); ++ hci_close_dev(dd); ++ return true; ++} ++ ++bool EnableBle(void) { ++ return true; ++} ++ ++bool DisableBle(void) { ++ return true; ++} ++ ++bool SetLocalName(unsigned char *localName, unsigned char length) { ++ return true; ++} ++ ++bool PairRequestReply(const BdAddr *bdAddr, int transport, bool accept) { ++ return true; ++} ++ ++bool SetDevicePairingConfirmation(const BdAddr *bdAddr, int transport, ++ bool accept) { ++ return true; ++} ++ ++bool IsBleEnabled() { ++ return true; ++} ++ ++int GapRegisterCallbacks(BtGapCallBacks *func) { ++ return 0; ++} +diff --git a/bluez_adapter/include/ohos_bt_def.h b/bluez_adapter/include/ohos_bt_def.h +new file mode 100644 +index 0000000..d645c41 +--- /dev/null ++++ b/bluez_adapter/include/ohos_bt_def.h +@@ -0,0 +1,26 @@ ++#ifndef OHOS_BT_DEF_H ++#define OHOS_BT_DEF_H ++ ++#define OHOS_BD_ADDR_LEN 6 ++ ++typedef struct { ++ unsigned char addr[OHOS_BD_ADDR_LEN]; ++} BdAddr; ++ ++typedef enum { ++ OHOS_BT_STATUS_SUCCESS = 0x00, ++ OHOS_BT_STATUS_FAIL, ++ OHOS_BT_STATUS_NOT_READY, ++ OHOS_BT_STATUS_NOMEM, ++ OHOS_BT_STATUS_BUSY, ++ OHOS_BT_STATUS_DONE, ++ OHOS_BT_STATUS_UNSUPPORTED, ++ OHOS_BT_STATUS_PARM_INVALID, ++ OHOS_BT_STATUS_UNHANDLED, ++ OHOS_BT_STATUS_AUTH_FAILURE, ++ OHOS_BT_STATUS_RMT_DEV_DOWN, ++ OHOS_BT_STATUS_AUTH_REJECTED ++} BtStatus; ++ ++ ++#endif +diff --git a/bluez_adapter/include/ohos_bt_gap.h b/bluez_adapter/include/ohos_bt_gap.h +new file mode 100644 +index 0000000..b9e39ff +--- /dev/null ++++ b/bluez_adapter/include/ohos_bt_gap.h +@@ -0,0 +1,44 @@ ++#ifndef OHOS_BT_GAP_H ++#define OHOS_BT_GAP_H ++ ++#include "ohos_bt_def.h" ++#include ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#define OHOS_BD_NAME_LEN 32 ++ ++bool EnableBle(void); ++ ++bool DisableBle(void); ++bool IsBleEnabled(); ++bool GetLocalAddr(unsigned char *mac, unsigned int len); ++bool SetLocalName(unsigned char *localName, unsigned char length); ++bool SetDevicePairingConfirmation(const BdAddr *bdAddr, int transport, bool accept); ++bool PairRequestReply(const BdAddr *bdAddr, int transport, bool accept); ++ ++typedef enum { ++ OHOS_GAP_STATE_TURNING_ON = 0x0, ++ OHOS_GAP_STATE_TURN_ON, ++ OHOS_GAP_STATE_TURNING_OFF, ++ OHOS_GAP_STATE_TURN_OFF ++} BtStackState; ++ ++typedef void (*GapPairRequestedCallback)(const BdAddr *bdAddr, int transport); ++typedef void (*GapPairConfirmedCallback)(const BdAddr *bdAddr, int transport, int reqType, int number); ++typedef void (*GapStateChangedCallback)(const int transport, const int status); ++ ++typedef struct { ++ GapStateChangedCallback stateChangeCallback; ++ GapPairRequestedCallback pairRequestedCallback; ++ GapPairConfirmedCallback pairConfiremedCallback; ++} BtGapCallBacks; ++ ++int GapRegisterCallbacks(BtGapCallBacks *func); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +diff --git a/bluez_adapter/include/ohos_bt_gatt.h b/bluez_adapter/include/ohos_bt_gatt.h +new file mode 100644 +index 0000000..b91af26 +--- /dev/null ++++ b/bluez_adapter/include/ohos_bt_gatt.h +@@ -0,0 +1,153 @@ ++#ifndef OHOS_BT_GATT_H ++#define OHOS_BT_GATT_H ++ ++#include ++#include "ohos_bt_def.h" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++typedef enum { ++ OHOS_BLE_ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY = 0x00, ++ OHOS_BLE_ADV_FILTER_ALLOW_SCAN_WLST_CON_ANY = 0x01, ++ OHOS_BLE_ADV_FILTER_ALLOW_SCAN_ANY_CON_WLST = 0x02, ++ OHOS_BLE_ADV_FILTER_ALLOW_SCAN_WLST_CON_WLST = 0x03, ++} BleAdvFilter; ++ ++typedef enum { ++ OHOS_BLE_ADV_IND = 0x00, ++ OHOS_BLE_ADV_DIRECT_IND_HIGH = 0x01, ++ OHOS_BLE_ADV_SCAN_IND = 0x02, ++ OHOS_BLE_ADV_NONCONN_IND = 0x03, ++ OHOS_BLE_ADV_DIRECT_IND_LOW = 0x04, ++} BleAdvType; ++ ++typedef enum { ++ OHOS_BLE_SCAN_TYPE_PASSIVE = 0x00, ++ OHOS_BLE_SCAN_TYPE_ACTIVE, ++} BleScanType; ++ ++typedef enum { ++ OHOS_BLE_SCAN_FILTER_POLICY_ACCEPT_ALL = 0x00, ++ OHOS_BLE_SCAN_FILTER_POLICY_ONLY_WHITE_LIST, ++ OHOS_BLE_SCAN_FILTER_POLICY_ACCEPT_ALL_AND_RPA, ++ OHOS_BLE_SCAN_FILTER_POLICY_ONLY_WHITE_LIST_AND_RPA ++} BleScanFilterPolicy; ++ ++typedef enum { ++ OHOS_BLE_EVT_NON_CONNECTABLE_NON_SCANNABLE = 0x00, ++ OHOS_BLE_EVT_NON_CONNECTABLE_NON_SCANNABLE_DIRECTED = 0x04, ++ OHOS_BLE_EVT_CONNECTABLE = 0x01, ++ OHOS_BLE_EVT_CONNECTABLE_DIRECTED = 0x05, ++ OHOS_BLE_EVT_SCANNABLE = 0x02, ++ OHOS_BLE_EVT_SCANNABLE_DIRECTED = 0x06, ++ OHOS_BLE_EVT_LEGACY_NON_CONNECTABLE = 0x10, ++ OHOS_BLE_EVT_LEGACY_SCANNABLE = 0x12, ++ OHOS_BLE_EVT_LEGACY_CONNECTABLE = 0x13, ++ OHOS_BLE_EVT_LEGACY_CONNECTABLE_DIRECTED = 0x15, ++ OHOS_BLE_EVT_LEGACY_SCAN_RSP_TO_ADV_SCAN = 0x1A, ++ OHOS_BLE_EVT_LEGACY_SCAN_RSP_TO_ADV = 0x1B ++} BleScanResultEvtType; ++ ++typedef enum { ++ OHOS_BLE_DATA_COMPLETE = 0x00, ++ OHOS_BLE_DATA_INCOMPLETE_MORE_TO_COME = 0x01, ++ OHOS_BLE_DATA_INCOMPLETE_TRUNCATED = 0x02, ++} BleScanResultDataStatus; ++ ++typedef enum { ++ OHOS_BLE_PUBLIC_DEVICE_ADDRESS = 0x00, ++ OHOS_BLE_RANDOM_DEVICE_ADDRESS = 0x01, ++ OHOS_BLE_PUBLIC_IDENTITY_ADDRESS = 0x02, ++ OHOS_BLE_RANDOM_STATIC_IDENTITY_ADDRESS = 0x03, ++ OHOS_BLE_UNRESOLVABLE_RANDOM_DEVICE_ADDRESS = 0xFE, ++ OHOS_BLE_NO_ADDRESS = 0xFF, ++} BleScanResultAddrType; ++ ++typedef enum { ++ OHOS_BLE_SCAN_PHY_NO_PACKET = 0x00, ++ OHOS_BLE_SCAN_PHY_1M = 0x01, ++ OHOS_BLE_SCAN_PHY_2M = 0x02, ++ OHOS_BLE_SCAN_PHY_CODED = 0x03 ++} BleScanResultPhyType; ++ ++typedef struct { ++ int minInterval; ++ int maxInterval; ++ BleAdvType advType; ++ unsigned char ownAddrType; ++ unsigned char peerAddrType; ++ BdAddr peerAddr; ++ int channelMap; ++ BleAdvFilter advFilterPolicy; ++ int txPower; ++ int duration; ++} BleAdvParams; ++ ++typedef struct { ++ unsigned short scanInterval; ++ unsigned short scanWindow; ++ unsigned char scanType; ++ unsigned char scanPhy; ++ unsigned char scanFilterPolicy; ++} BleScanParams; ++ ++typedef struct { ++ unsigned char *advData; ++ unsigned int advDataLen; ++ unsigned char *rspData; ++ unsigned int rspDataLen; ++} StartAdvRawData; ++ ++typedef struct { ++ unsigned char eventType; ++ unsigned char dataStatus; ++ unsigned char addrType; ++ BdAddr addr; ++ unsigned char primaryPhy; ++ unsigned char secondaryPhy; ++ unsigned char advSid; ++ char txPower; ++ char rssi; ++ unsigned short periodicAdvInterval; ++ unsigned char directAddrType; ++ BdAddr directAddr; ++ unsigned char advLen; ++ unsigned char *advData; ++} BtScanResultData; ++ ++typedef void (*AdvEnableCallback)(int advId, int status); ++ ++typedef void (*AdvDisableCallback)(int advId, int status); ++ ++typedef void (*AdvDataCallback)(int advId, int status); ++ ++typedef void (*AdvUpdateCallback)(int advId, int status); ++ ++typedef void (*SecurityRespondCallback)(const BdAddr *bdAddr); ++ ++typedef void (*ScanResultCallback)(BtScanResultData *scanResultdata); ++ ++typedef void (*ScanParameterSetCompletedCallback)(int clientId, int status); ++ ++typedef struct { ++ AdvEnableCallback advEnableCb; ++ AdvDisableCallback advDisableCb; ++ AdvDataCallback advDataCb; ++ AdvUpdateCallback advUpdateCb; ++ SecurityRespondCallback securityRespondCb; ++ ScanResultCallback scanResultCb; ++ ScanParameterSetCompletedCallback scanParamSetCb; ++} BtGattCallbacks; ++ ++int BleStopAdv(int advId); ++int BleStartScan(void); ++int BleStopScan(void); ++int BleGattRegisterCallbacks(BtGattCallbacks *func); ++int BleStartAdvEx(int *advId, const StartAdvRawData rawData, BleAdvParams advParam); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif +-- +2.34.1 + diff --git a/meta-openeuler/recipes-core/dsoftbus/files/apply-ble-discovery-support.patch b/meta-openeuler/recipes-core/dsoftbus/files/apply-ble-discovery-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..b628e1edeb83925a7a258245336cfc219e49fe83 --- /dev/null +++ b/meta-openeuler/recipes-core/dsoftbus/files/apply-ble-discovery-support.patch @@ -0,0 +1,79 @@ +From 0afaf00fd589d3f0f8fc76afb2ddaba09917429c Mon Sep 17 00:00:00 2001 +From: hmilylmk +Date: Tue, 14 Mar 2023 16:50:45 +0800 +Subject: [PATCH] apply ble discovery support + +Signed-off-by: hmilylmk +--- + adapter/default_config/feature_config/standard/config.gni | 2 +- + core/discovery/ble/disc_ble.gni | 8 ++++++++ + core/discovery/ble/src/disc_ble.c | 2 +- + core/frame/BUILD.gn | 1 + + 4 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/adapter/default_config/feature_config/standard/config.gni b/adapter/default_config/feature_config/standard/config.gni +index 75d27a7a..7294b73e 100644 +--- a/adapter/default_config/feature_config/standard/config.gni ++++ b/adapter/default_config/feature_config/standard/config.gni +@@ -12,7 +12,7 @@ + # limitations under the License. + + declare_args() { +- dsoftbus_standard_feature_disc_ble = false ++ dsoftbus_standard_feature_disc_ble = true + dsoftbus_standard_feature_disc_coap = true + + dsoftbus_standard_feature_conn_tcp = true +diff --git a/core/discovery/ble/disc_ble.gni b/core/discovery/ble/disc_ble.gni +index 932fd3cb..5c2e33cd 100755 +--- a/core/discovery/ble/disc_ble.gni ++++ b/core/discovery/ble/disc_ble.gni +@@ -12,6 +12,7 @@ + # limitations under the License. + + import("//foundation/communication/dsoftbus/dsoftbus.gni") ++import("//foundation/communication/dsoftbus/adapter/common/net/bluetooth/net_bluetooth.gni") + + ble_discovery_inc = [ "$dsoftbus_root_path/core/discovery/ble/include" ] + ble_discovery_deps = [] +@@ -22,5 +23,12 @@ if (dsoftbus_standard_feature_disc_ble == false) { + ble_discovery_src = [ + "$dsoftbus_root_path/core/discovery/ble/src/disc_ble_utils.c", + "$dsoftbus_root_path/core/discovery/ble/src/disc_ble.c", ++ "$dsoftbus_root_path/adapter/common/net/bluetooth/ble/softbus_adapter_ble_gatt.c", ++ "$dsoftbus_root_path/adapter/common/net/bluetooth/common/adapter_bt_utils.c", ++ "$dsoftbus_root_path/adapter/common/net/bluetooth/common/softbus_adapter_bt_common.c", ++ ] ++ ble_discovery_inc += adapter_ble_inc ++ ble_discovery_deps += [ ++ "//depend:bluez_adapter", + ] + } +diff --git a/core/discovery/ble/src/disc_ble.c b/core/discovery/ble/src/disc_ble.c +index 110badd8..8dcda0b2 100755 +--- a/core/discovery/ble/src/disc_ble.c ++++ b/core/discovery/ble/src/disc_ble.c +@@ -154,7 +154,7 @@ static DiscBleListener g_bleListener = { + .stateListenerId = -1, + .scanListenerId = -1 + }; +-static const int g_bleTransCapabilityMap[CAPABILITY_MAX_BITNUM] = {0, 3, 5, 3, 6, 5, 6, 7}; ++static const int g_bleTransCapabilityMap[CAPABILITY_MAX_BITNUM] = {0, 3, 5, 3, 7, 5, 6, 7}; + + static SoftBusMessage *CreateBleHandlerMsg(int32_t what, uint64_t arg1, uint64_t arg2, void *obj); + static int32_t AddRecvMessage(const char *key, const uint32_t *capBitMap, bool needBrMac); +diff --git a/core/frame/BUILD.gn b/core/frame/BUILD.gn +index 5936a3ae..3990dc60 100644 +--- a/core/frame/BUILD.gn ++++ b/core/frame/BUILD.gn +@@ -197,6 +197,7 @@ if (defined(ohos_lite)) { + deps += [ + "//depend:libhilog", + "//depend/ipc:ipc_core", ++ "//depend:bluez_adapter", + ] + part_name = "dsoftbus_standard" + subsystem_name = "communication" +-- +2.34.1 + diff --git a/meta-openeuler/recipes-core/dsoftbus/files/dsoftbus_output/.xxx b/meta-openeuler/recipes-core/dsoftbus/files/dsoftbus_output/.xxx deleted file mode 100644 index 462d5c93c1a073fdeb31baf697a2e126713e51ac..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/dsoftbus/files/dsoftbus_output/.xxx +++ /dev/null @@ -1 +0,0 @@ -#add empty directory to make it not fail when dsoftbus_output does not exist diff --git a/meta-openeuler/recipes-core/e2fsprogs/e2fsprogs.inc b/meta-openeuler/recipes-core/e2fsprogs/e2fsprogs.inc deleted file mode 100644 index b1a15e3a89d9ef4828518156c128b103887525fe..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/e2fsprogs/e2fsprogs.inc +++ /dev/null @@ -1,37 +0,0 @@ -SUMMARY = "Ext2 Filesystem Utilities" -DESCRIPTION = "The Ext2 Filesystem Utilities (e2fsprogs) contain all of the standard utilities for creating, \ -fixing, configuring , and debugging ext2 filesystems." -HOMEPAGE = "http://e2fsprogs.sourceforge.net/" - -LICENSE = "GPLv2 & LGPLv2 & BSD & MIT" -LICENSE_e2fsprogs-dumpe2fs = "GPLv2" -LICENSE_e2fsprogs-e2fsck = "GPLv2" -LICENSE_e2fsprogs-mke2fs = "GPLv2" -LICENSE_e2fsprogs-tune2fs = "GPLv2" -LICENSE_e2fsprogs-badblocks = "GPLv2" -LIC_FILES_CHKSUM = "file://NOTICE;md5=d50be0580c0b0a7fbc7a4830bbe6c12b \ - file://lib/ext2fs/ext2fs.h;beginline=1;endline=9;md5=596a8dedcb4e731c6b21c7a46fba6bef \ - file://lib/e2p/e2p.h;beginline=1;endline=7;md5=8a74ade8f9d65095d70ef2d4bf48e36a \ - file://lib/uuid/uuid.h.in;beginline=1;endline=32;md5=dbb8079e114a5f841934b99e59c8820a \ - file://lib/uuid/COPYING;md5=58dcd8452651fc8b07d1f65ce07ca8af \ - file://lib/et/et_name.c;beginline=1;endline=11;md5=ead236447dac7b980dbc5b4804d8c836 \ - file://lib/ss/ss.h;beginline=1;endline=20;md5=6e89ad47da6e75fecd2b5e0e81e1d4a6" -SECTION = "base" -DEPENDS = "util-linux attr" - -SRC_URI = "file://e2fsprogs/${BP}.tar.xz \ - file://e2fsprogs/0001-e2fsprogs-set-hugefile-from-4T-to-1T-in-hugefile-tes.patch \ - file://e2fsprogs/0002-libss-add-newer-libreadline.so.8-to-dlopen-path.patch \ - file://e2fsprogs/0003-tests-update-expect-files-for-f_mmp_garbage.patch \ - file://e2fsprogs/0004-tests-update-expect-files-for-f_large_dir-and-f_larg.patch \ - file://e2fsprogs/0005-resize2fs-resize2fs-disk-hardlinks-will-be-error.patch \ - file://e2fsprogs/0006-e2fsck-exit-journal-recovery-when-find-EIO-ENOMEM-er.patch \ - file://e2fsprogs/0007-e2fsck-exit-journal-recovery-when-jounral-superblock.patch \ - file://e2fsprogs/0008-e2fsck-add-env-param-E2FS_UNRELIABLE_IO-to-fi.patch \ - file://e2fsprogs/0009-e2mmpstatus.8.in-detele-filesystem-can-be-UUID-or-LA.patch \ - file://run-ptest \ -" - -inherit autotools gettext texinfo pkgconfig multilib_header ptest - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/e2fsprogs/e2fsprogs/run-ptest b/meta-openeuler/recipes-core/e2fsprogs/e2fsprogs/run-ptest deleted file mode 100644 index c97c0377e9c0f08346a5ca83bd819b909333ec2b..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/e2fsprogs/e2fsprogs/run-ptest +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -cd ./test -SKIP_SLOW_TESTS=yes ./test_script | sed -u -e '/:[[:space:]]ok/s/^/PASS: /' -e '/:[[:space:]]failed/s/^/FAIL: /' -e '/:[[:space:]]skipped/s/^/SKIP: /' -rm -rf /var/volatile/tmp/*e2fsprogs* -rm -f tmp-* -rm -f *.tmp -rm -f *.ok -rm -f *.failed -rm -f *.log diff --git a/meta-openeuler/recipes-core/e2fsprogs/e2fsprogs_1.46.4.bb b/meta-openeuler/recipes-core/e2fsprogs/e2fsprogs_1.46.4.bb deleted file mode 100644 index 41ee07771ba12dccb365d98478b347291c67e638..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/e2fsprogs/e2fsprogs_1.46.4.bb +++ /dev/null @@ -1,124 +0,0 @@ -require e2fsprogs.inc - -UPSTREAM_CHECK_GITTAGREGEX = "v(?P\d+\.\d+(\.\d+)*)$" - -EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} \ - --enable-elf-shlibs --disable-libuuid --disable-uuidd \ - --disable-libblkid --enable-verbose-makecmds \ - --with-crond-dir=no" - -EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs" - -PACKAGECONFIG ??= "" -PACKAGECONFIG[fuse] = '--enable-fuse2fs,--disable-fuse2fs,fuse' - -# make locale rules sometimes fire, sometimes don't as git doesn't preserve -# file mktime. Touch the files introducing non-determinism to the build -do_compile_prepend (){ - find ${S}/po -type f -name "*.po" -exec touch {} + -} - -do_install () { - oe_runmake 'DESTDIR=${D}' install - oe_runmake 'DESTDIR=${D}' install-libs - # We use blkid from util-linux now so remove from here - rm -f ${D}${base_libdir}/libblkid* - rm -rf ${D}${includedir}/blkid - rm -f ${D}${base_libdir}/pkgconfig/blkid.pc - rm -f ${D}${base_sbindir}/blkid - rm -f ${D}${base_sbindir}/fsck - rm -f ${D}${base_sbindir}/findfs - - # e2initrd_helper and the pkgconfig files belong in libdir - if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then - install -d ${D}${libdir} - mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir} - mv ${D}${base_libdir}/pkgconfig ${D}${libdir} - fi - - oe_multilib_header ext2fs/ext2_types.h - install -d ${D}${base_bindir} - mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs - - install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/ - - # Clean host path (build directory) in compile_et, mk_cmds - sed -i -e "s,\(ET_DIR=.*\)${S}/lib/et\(.*\),\1${datadir}/et\2,g" ${D}${bindir}/compile_et - sed -i -e "s,\(SS_DIR=.*\)${S}/lib/ss\(.*\),\1${datadir}/ss\2,g" ${D}${bindir}/mk_cmds -} - -# Need to find the right mke2fs.conf file -e2fsprogs_conf_fixup () { - for i in mke2fs mkfs.ext2 mkfs.ext3 mkfs.ext4; do - create_wrapper ${D}${base_sbindir}/$i MKE2FS_CONFIG=${sysconfdir}/mke2fs.conf - done -} - -do_install_append_class-native() { - e2fsprogs_conf_fixup -} - -do_install_append_class-nativesdk() { - e2fsprogs_conf_fixup -} - -RDEPENDS_e2fsprogs = "e2fsprogs-badblocks e2fsprogs-dumpe2fs" -RRECOMMENDS_e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck" - -PACKAGES =+ "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck e2fsprogs-e2scrub e2fsprogs-mke2fs e2fsprogs-resize2fs e2fsprogs-tune2fs" -PACKAGES =+ "libcomerr libss libe2p libext2fs" - -FILES_e2fsprogs-dumpe2fs = "${base_sbindir}/dumpe2fs" -FILES_e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*" -FILES_e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*" -FILES_e2fsprogs-e2scrub = "${base_sbindir}/e2scrub*" -FILES_e2fsprogs-mke2fs = "${base_sbindir}/mke2fs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf" -FILES_e2fsprogs-tune2fs = "${base_sbindir}/tune2fs ${base_sbindir}/e2label" -FILES_e2fsprogs-badblocks = "${base_sbindir}/badblocks" -FILES_libcomerr = "${base_libdir}/libcom_err.so.*" -FILES_libss = "${base_libdir}/libss.so.*" -FILES_libe2p = "${base_libdir}/libe2p.so.*" -FILES_libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*" -FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so ${bindir}/compile_et ${bindir}/mk_cmds" - -ALTERNATIVE_${PN} = "chattr" -ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr" -ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs" - -ALTERNATIVE_${PN}-doc = "fsck.8" -ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8" - -ALTERNATIVE_${PN}-mke2fs = "mke2fs mkfs.ext2" -ALTERNATIVE_LINK_NAME[mke2fs] = "${base_sbindir}/mke2fs" -ALTERNATIVE_LINK_NAME[mkfs.ext2] = "${base_sbindir}/mkfs.ext2" - -ALTERNATIVE_${PN}-tune2fs = "tune2fs" -ALTERNATIVE_LINK_NAME[tune2fs] = "${base_sbindir}/tune2fs" - -RDEPENDS_e2fsprogs-e2scrub = "bash" -RDEPENDS_e2fsprogs-e2scrub_remove += "bash" -RDEPENDS_${PN}-ptest += "coreutils procps bash bzip2 diffutils perl sed" -RDEPENDS_${PN}-ptest += "e2fsprogs-badblocks e2fsprogs-dumpe2fs e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-resize2fs e2fsprogs-tune2fs" - -do_compile_ptest() { - oe_runmake -C ${B}/tests -} - -do_install_ptest() { - # This file's permissions depends on the host umask so be deterministic - chmod 0644 ${B}/tests/test_data.tmp - cp -R --no-dereference --preserve=mode,links -v ${B}/tests ${D}${PTEST_PATH}/test - cp -R --no-dereference --preserve=mode,links -v ${S}/tests/* ${D}${PTEST_PATH}/test - sed -e 's!../e2fsck/e2fsck!e2fsck!g' \ - -e 's!../misc/tune2fs!tune2fs!g' -i ${D}${PTEST_PATH}/test/*/expect* - sed -e 's!../e2fsck/e2fsck!${base_sbindir}/e2fsck!g' -i ${D}${PTEST_PATH}/test/*/script - - # Remove various files - find "${D}${PTEST_PATH}" -type f \ - \( -name 'Makefile' -o -name 'Makefile.in' -o -name '*.o' -o -name '*.c' -o -name '*.h' \)\ - -exec rm -f {} + - - install -d ${D}${PTEST_PATH}/lib - install -m 0644 ${B}/lib/config.h ${D}${PTEST_PATH}/lib/ -} diff --git a/meta-openeuler/recipes-core/ethtool/ethtool/avoid_parallel_tests.patch b/meta-openeuler/recipes-core/ethtool/ethtool/avoid_parallel_tests.patch deleted file mode 100644 index c7f907f64875bc31505ba4b7941ab47a4976f78e..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/ethtool/ethtool/avoid_parallel_tests.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 1f9215b845a144e531536709b23cd5fb15e4f206 Mon Sep 17 00:00:00 2001 -From: Tudor Florea -Date: Wed, 28 May 2014 18:59:54 +0200 -Subject: [PATCH] ethtool: use serial-tests config needed by ptest. - -ptest needs buildtest-TESTS and runtest-TESTS targets. -serial-tests is required to generate those targets. - -Signed-off-by: Tudor Florea -Upstream-Status: Inappropriate -(default automake behavior incompatible with ptest) - ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index d49eda6..c7fa195 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. - AC_INIT(ethtool, 5.15, netdev@vger.kernel.org) - AC_PREREQ(2.52) - AC_CONFIG_SRCDIR([ethtool.c]) --AM_INIT_AUTOMAKE([gnu subdir-objects]) -+AM_INIT_AUTOMAKE([gnu subdir-objects serial-tests]) - AC_CONFIG_HEADERS([ethtool-config.h]) - - AM_MAINTAINER_MODE diff --git a/meta-openeuler/recipes-core/ethtool/ethtool/run-ptest b/meta-openeuler/recipes-core/ethtool/ethtool/run-ptest deleted file mode 100644 index 1e245da112d3930e662869c5f34d0cde05ad0305..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/ethtool/ethtool/run-ptest +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -make -k runtest-TESTS diff --git a/meta-openeuler/recipes-core/ethtool/ethtool_5.15.bb b/meta-openeuler/recipes-core/ethtool/ethtool_5.15.bb deleted file mode 100644 index dc359e95c1dbc18c3fbc2c0a8e725e5408694faf..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/ethtool/ethtool_5.15.bb +++ /dev/null @@ -1,37 +0,0 @@ -SUMMARY = "Display or change ethernet card settings" -DESCRIPTION = "A small utility for examining and tuning the settings of your ethernet-based network interfaces." -HOMEPAGE = "http://www.kernel.org/pub/software/network/ethtool/" -SECTION = "console/network" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://ethtool.c;beginline=4;endline=17;md5=c19b30548c582577fc6b443626fc1216" - -SRC_URI = "file://ethtool/ethtool-${PV}.tar.xz \ - file://run-ptest \ - file://avoid_parallel_tests.patch \ - " - -SRC_URI[sha256sum] = "686fd6110389d49c2a120f00c3cd5dfe43debada8e021e4270d74bbe452a116d" - -UPSTREAM_CHECK_URI = "https://gitee/src-openeuler/ethtool" - -#inherit autotools ptest bash-completion pkgconfig -inherit autotools ptest - -RDEPENDS_${PN}-ptest += "make" - -#PACKAGECONFIG ?= "netlink" -PACKAGECONFIG[netlink] = "--disable-netlink,--disable-netlink,libmnl" -FILES_${PN}-bash-completion += "/usr/share/bash-completion/completions/*" -PACKAGES += "ethtool-bash-completion" - -do_compile_ptest() { - oe_runmake buildtest-TESTS -} - -do_install_ptest () { - cp ${B}/Makefile ${D}${PTEST_PATH} - install ${B}/test-cmdline ${D}${PTEST_PATH} - install ${B}/ethtool ${D}${PTEST_PATH}/ethtool - sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile -} diff --git a/meta-openeuler/recipes-core/expat/expat/libtool-tag.patch b/meta-openeuler/recipes-core/expat/expat/libtool-tag.patch deleted file mode 100644 index 0a0aed23e5dbe6745fedefe88f3712d8fc3c71d3..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/expat/expat/libtool-tag.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 10342e6b600858b091bc7771e454d9e06af06410 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 2 Nov 2017 18:20:57 +0800 -Subject: [PATCH] Add CC tag to build - -Add CC tag to build - -Upstream-Status: Pending -Signed-off-by: Khem Raj -Signed-off-by: Dengke Du ---- - Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.in b/Makefile.in -index 9560a95..d444bd6 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -319,7 +319,7 @@ LIBCURRENT = @LIBCURRENT@ - LIBOBJS = @LIBOBJS@ - LIBREVISION = @LIBREVISION@ - LIBS = @LIBS@ --LIBTOOL = @LIBTOOL@ -+LIBTOOL = @LIBTOOL@ --tag CC - LIPO = @LIPO@ - LN_S = @LN_S@ - LTLIBOBJS = @LTLIBOBJS@ --- -2.7.4 - diff --git a/meta-openeuler/recipes-core/expat/expat/run-ptest b/meta-openeuler/recipes-core/expat/expat/run-ptest deleted file mode 100644 index 1b39cec8e5eea7a2a6e4f16713ee5c9157cd1f4b..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/expat/expat/run-ptest +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -output=${1:-"expat_tests.log"} # default log file - -# logging function -function testCheck() { - testExec="$1" - shift - echo && echo ${testExec} && ./${testExec} "$@" - error=$? - result=$([[ ${error} -eq 0 ]] && echo "PASS" || echo "FAIL") - echo "${result}: ${testExec}" && echo "============================" -} - -export output -export -f testCheck -TIME=$(which time) - -echo "Architecture: $(uname -m)" > ${output} -echo "Image: $(uname -sr)" >> ${output} -${TIME} -f 'Execution time: %e s' bash -c "testCheck runtests -vv" |& tee -a ${output} -${TIME} -f 'Execution time: %e s' bash -c "testCheck runtestspp -vv" |& tee -a ${output} -echo diff --git a/meta-openeuler/recipes-core/expat/expat_%.bbappend b/meta-openeuler/recipes-core/expat/expat_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..9ebee1c088ca8b54b2ed6d792ff10133dd212769 --- /dev/null +++ b/meta-openeuler/recipes-core/expat/expat_%.bbappend @@ -0,0 +1,16 @@ +# ref: +# http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/expat/expat_2.5.0.bb + +OPENEULER_SRC_URI_REMOVE = "https git http" + +LIC_FILES_CHKSUM = "file://COPYING;md5=7b3b078238d0901d3b339289117cb7fb" + +PV = "2.5.0" + +SRC_URI[sha256sum] = "6b902ab103843592be5e99504f846ec109c1abb692e85347587f237a4ffa1033" + +# tar from openeuler +SRC_URI = " \ + file://expat-${PV}.tar.gz \ +" + diff --git a/meta-openeuler/recipes-core/expat/expat_2.4.1.bb b/meta-openeuler/recipes-core/expat/expat_2.4.1.bb deleted file mode 100644 index bed0d95b0f2c285d6861368a1fe4bc4aabe03708..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/expat/expat_2.4.1.bb +++ /dev/null @@ -1,47 +0,0 @@ -SUMMARY = "A stream-oriented XML parser library" -DESCRIPTION = "Expat is an XML parser library written in C. It is a stream-oriented parser in which an application registers handlers for things the parser might find in the XML document (like start tags)" -HOMEPAGE = "http://expat.sourceforge.net/" -SECTION = "libs" -LICENSE = "MIT" - -LIC_FILES_CHKSUM = "file://COPYING;md5=9e2ce3b3c4c0f2670883a23bbd7c37a9" - -SRC_URI = "file://expat/expat-${PV}.tar.gz \ - file://expat/backport-CVE-2021-45960.patch \ - file://expat/backport-CVE-2021-46143.patch \ - file://expat/backport-CVE-2022-22822-CVE-2022-22823-CVE-2022-22824-CVE-2022-22825-CVE-2022-22826-CVE-2022-22827.patch \ - file://expat/backport-CVE-2022-23852-lib-Detect-and-prevent-integer-overflow-in-XML_GetBu.patch \ - file://expat/backport-CVE-2022-23852-tests-Cover-integer-overflow-in-XML_GetBuffer-CVE-20.patch \ - file://expat/backport-CVE-2022-23990-lib-Prevent-integer-overflow-in-doProlog-CVE-2022-23.patch \ - file://expat/backport-CVE-2022-25235-lib-Add-missing-validation-of-encoding.patch \ - file://expat/backport-tests-Cover-missing-validation-of-encoding.patch \ - file://expat/backport-CVE-2022-25236-lib-Protect-against-malicious-namespace-declarations.patch \ - file://expat/backport-tests-Cover-CVE-2022-25236.patch \ - file://expat/backport-CVE-2022-25313-Prevent-stack-exhaustion-in-build_model.patch \ - file://expat/backport-CVE-2022-25314-Prevent-integer-overflow-in-copyString.patch \ - file://expat/backport-CVE-2022-25315-Prevent-integer-overflow-in-storeRawNames.patch \ - file://expat/backport-Fix-build_model-regression.patch \ - file://expat/backport-tests-Protect-against-nested-element-declaration-mod.patch \ - file://expat/backport-lib-Fix-harmless-use-of-uninitialized-memory.patch \ - file://expat/backport-lib-Drop-unused-macro-UTF8_GET_NAMING.patch \ - file://expat/backport-lib-Relax-fix-to-CVE-2022-25236-with-regard-to-RFC-3.patch \ - file://expat/backport-tests-Cover-relaxed-fix-to-CVE-2022-25236.patch \ - file://libtool-tag.patch \ - file://run-ptest \ - " - -SRC_URI[sha256sum] = "2f9b6a580b94577b150a7d5617ad4643a4301a6616ff459307df3e225bcfbf40" - -EXTRA_OECMAKE_class-native += "-DEXPAT_BUILD_DOCS=OFF" - -RDEPENDS_${PN}-ptest += "bash" - -inherit cmake lib_package ptest - -do_install_ptest_class-target() { - install -m 755 ${B}/tests/* ${D}${PTEST_PATH} -} - -BBCLASSEXTEND += "native nativesdk" - -CVE_PRODUCT = "expat libexpat" diff --git a/meta-openeuler/recipes-core/glib-2.0/files/0001-fix-compile-error-for-arm32.patch b/meta-openeuler/recipes-core/glib-2.0/files/0001-fix-compile-error-for-arm32.patch new file mode 100644 index 0000000000000000000000000000000000000000..0f8ef5c353ff1a31760f9d874f1c719b780d7396 --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/files/0001-fix-compile-error-for-arm32.patch @@ -0,0 +1,15 @@ +Suject: Fix glib2 compile error for arm32 +Signed-off-by: Zheng Liming + +diff --git a/glib/gthreadprivate.h b/glib/gthreadprivate.h +index 6eaf422..0a1bb97 100644 +--- a/glib/gthreadprivate.h ++++ b/glib/gthreadprivate.h +@@ -44,6 +44,7 @@ struct _GRealThread + #include + #include + #include ++#include + + #ifndef FUTEX_WAIT_PRIVATE + #define FUTEX_WAIT_PRIVATE FUTEX_WAIT diff --git a/meta-openeuler/recipes-core/glib-2.0/files/Enable-more-tests-while-cross-compiling.patch b/meta-openeuler/recipes-core/glib-2.0/files/Enable-more-tests-while-cross-compiling.patch new file mode 100644 index 0000000000000000000000000000000000000000..f5c161fe047af8ba1d873c4ddc32a9dc27fbba52 --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/files/Enable-more-tests-while-cross-compiling.patch @@ -0,0 +1,123 @@ +From 1f3c05529c0c9032ae0a289fb1f088b7541fc9b0 Mon Sep 17 00:00:00 2001 +From: Jussi Kukkonen +Date: Mon, 9 Nov 2015 11:07:27 +0200 +Subject: [PATCH] Enable more tests while cross-compiling + +Upstream disables a few tests while cross-compiling because their build requires +running other built binaries. This usually makes sense but in the cross-compile +case we can depend on glib-2.0-native. + +Upstream-Status: Inappropriate [OE specific] +Signed-off-by: Jussi Kukkonen + +--- + gio/tests/meson.build | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/gio/tests/meson.build b/gio/tests/meson.build +index 3ed23a5..5df932a 100644 +--- a/gio/tests/meson.build ++++ b/gio/tests/meson.build +@@ -253,7 +253,7 @@ if host_machine.system() != 'windows' + } + endif + +- if have_dbus_daemon ++ if true + annotate_args = [ + '--annotate', 'org.project.Bar', 'Key1', 'Value1', + '--annotate', 'org.project.Bar', 'org.gtk.GDBus.Internal', 'Value2', +@@ -603,14 +603,14 @@ if installed_tests_enabled + endforeach + endif + +-if not meson.is_cross_build() or meson.has_exe_wrapper() ++if meson.is_cross_build() + + compiler_type = '--compiler=@0@'.format(cc.get_id()) + + plugin_resources_c = custom_target('plugin-resources.c', + input : 'test4.gresource.xml', + output : 'plugin-resources.c', +- command : [glib_compile_resources, ++ command : ['glib-compile-resources', + compiler_type, + '--target=@OUTPUT@', + '--sourcedir=' + meson.current_source_dir(), +@@ -636,7 +636,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() + test_gresource = custom_target('test.gresource', + input : 'test.gresource.xml', + output : 'test.gresource', +- command : [glib_compile_resources, ++ command : ['glib-compile-resources', + compiler_type, + '--target=@OUTPUT@', + '--sourcedir=' + meson.current_source_dir(), +@@ -649,7 +649,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() + test_resources2_c = custom_target('test_resources2.c', + input : 'test3.gresource.xml', + output : 'test_resources2.c', +- command : [glib_compile_resources, ++ command : ['glib-compile-resources', + compiler_type, + '--target=@OUTPUT@', + '--sourcedir=' + meson.current_source_dir(), +@@ -662,7 +662,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() + test_resources2_h = custom_target('test_resources2.h', + input : 'test3.gresource.xml', + output : 'test_resources2.h', +- command : [glib_compile_resources, ++ command : ['glib-compile-resources', + compiler_type, + '--target=@OUTPUT@', + '--sourcedir=' + meson.current_source_dir(), +@@ -676,7 +676,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() + input : 'test2.gresource.xml', + depends : big_test_resource, + output : 'test_resources.c', +- command : [glib_compile_resources, ++ command : ['glib-compile-resources', + compiler_type, + '--target=@OUTPUT@', + '--sourcedir=' + meson.current_source_dir(), +@@ -689,7 +689,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() + digit_test_resources_c = custom_target('digit_test_resources.c', + input : '111_digit_test.gresource.xml', + output : 'digit_test_resources.c', +- command : [glib_compile_resources, ++ command : ['glib-compile-resources', + compiler_type, + '--target=@OUTPUT@', + '--sourcedir=' + meson.current_source_dir(), +@@ -702,7 +702,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() + digit_test_resources_h = custom_target('digit_test_resources.h', + input : '111_digit_test.gresource.xml', + output : 'digit_test_resources.h', +- command : [glib_compile_resources, ++ command : ['glib-compile-resources', + compiler_type, + '--target=@OUTPUT@', + '--sourcedir=' + meson.current_source_dir(), +@@ -744,11 +744,11 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() + + ld = find_program('ld', required : false) + +- if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found() ++ if not meson.is_cross_build() + test_gresource_binary = custom_target('test5.gresource', + input : 'test5.gresource.xml', + output : 'test5.gresource', +- command : [glib_compile_resources, ++ command : ['glib-compile-resources', + compiler_type, + '--target=@OUTPUT@', + '--sourcedir=' + meson.current_source_dir(), +@@ -762,7 +762,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper() + test_resources_binary_c = custom_target('test_resources_binary.c', + input : 'test5.gresource.xml', + output : 'test_resources_binary.c', +- command : [glib_compile_resources, ++ command : ['glib-compile-resources', + compiler_type, + '--target=@OUTPUT@', + '--sourcedir=' + meson.current_source_dir(), diff --git a/meta-openeuler/recipes-core/glib-2.0/files/glib-2-glibc-2.34-close_range.patch b/meta-openeuler/recipes-core/glib-2.0/files/glib-2-glibc-2.34-close_range.patch new file mode 100644 index 0000000000000000000000000000000000000000..a84ccaaccbb9ff2d6bca708a2d5e17f5e0152996 --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/files/glib-2-glibc-2.34-close_range.patch @@ -0,0 +1,32 @@ +https://bugs.gentoo.org/803632 +https://gitlab.gnome.org/GNOME/glib/-/commit/63e7864d1a0ddbead3c18872e95116e3843e81be.patch + +From 6e59d21b273f026e82adc56fecbec67d1ffa72a4 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 8 Jul 2021 17:26:43 -0700 +Subject: [PATCH] correctly use 3 parameters for close_range + +libc implementation has 3 parameter e.g. +https://www.freebsd.org/cgi/man.cgi?query=close_range&sektion=2&format=html + +Signed-off-by: Khem Raj +--- + glib/gspawn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/glib/gspawn.c b/glib/gspawn.c +index 95f5b868e..a15fb1ca1 100644 +--- a/glib/gspawn.c ++++ b/glib/gspawn.c +@@ -1494,7 +1494,7 @@ safe_closefrom (int lowfd) + * + * Handle ENOSYS in case it’s supported in libc but not the kernel; if so, + * fall back to safe_fdwalk(). */ +- if (close_range (lowfd, G_MAXUINT) != 0 && errno == ENOSYS) ++ if (close_range (lowfd, G_MAXUINT, 0) != 0 && errno == ENOSYS) + #endif /* HAVE_CLOSE_RANGE */ + (void) safe_fdwalk (close_func, GINT_TO_POINTER (lowfd)); + #endif +-- +GitLab + diff --git a/meta-openeuler/recipes-core/glib-2.0/files/relocate-modules.patch b/meta-openeuler/recipes-core/glib-2.0/files/relocate-modules.patch new file mode 100644 index 0000000000000000000000000000000000000000..41e1c9989586f7f99dce107c0833ccabcf72a32e --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/files/relocate-modules.patch @@ -0,0 +1,51 @@ +From 011c9f024b6475d31e7d5432a38d00fb67eaea40 Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Fri, 11 Mar 2016 15:35:55 +0000 +Subject: [PATCH] glib-2.0: relocate the GIO module directory for native builds + +Instead of hard-coding GIO_MODULE_PATH when glib is built, use dladdr() to +determine where libglib.so is and use that path to calculate GIO_MODULES_DIR. + +This solves relocation problems with GIOModule for native builds of glib. + +Upstream-Status: Inappropriate +Signed-off-by: Ross Burton + +Port patch to 2.48 +Signed-off-by: Jussi Kukkonen + +--- + gio/giomodule.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/gio/giomodule.c b/gio/giomodule.c +index dc4d6d3..da46906 100644 +--- a/gio/giomodule.c ++++ b/gio/giomodule.c +@@ -50,7 +50,9 @@ + #include "gmemorymonitordbus.h" + #ifdef G_OS_WIN32 + #include "gregistrysettingsbackend.h" + #include "giowin32-priv.h" ++#else ++#include + #endif + #include + +@@ -1163,7 +1165,15 @@ get_gio_module_dir (void) + NULL); + g_free (install_dir); + #else +- module_dir = g_strdup (GIO_MODULE_DIR); ++ Dl_info info; ++ ++ if (dladdr (g_io_module_new, &info)) { ++ char *libdir = g_path_get_dirname (info.dli_fname); ++ module_dir = g_build_filename (libdir, "gio", "modules", NULL); ++ g_free (libdir); ++ } else { ++ module_dir = g_strdup (GIO_MODULE_DIR); ++ } + #endif + } + diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common deleted file mode 100644 index 0d7c5fa3f8cec69e67d217775b04fe56d2da20e8..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common +++ /dev/null @@ -1,3 +0,0 @@ -[properties] -# On all known supported architectures the stack grows down -growing_stack = false diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc deleted file mode 100644 index c4648f58c78d5400e0052b2047d0f8e7fdb852b6..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-glibc +++ /dev/null @@ -1,5 +0,0 @@ -[properties] -have_c99_vsnprintf = true -have_c99_snprintf = true -have_unix98_printf = true -va_val_copy = true diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux deleted file mode 100644 index adad7e62eeb9e8d0f245ba319a9136cb28a3157c..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-linux +++ /dev/null @@ -1,5 +0,0 @@ -[properties] -have_proc_self_cmdline = true - -[binaries] -env = '/usr/bin/env' diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw deleted file mode 100644 index 75f911ba1edcd498e2ce531bd3c5a9e93f1e91aa..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-mingw +++ /dev/null @@ -1,6 +0,0 @@ -[properties] -have_c99_vsnprintf = false -have_c99_snprintf = false -have_unix98_printf = false -va_val_copy = true -have_proc_self_cmdline = false diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl deleted file mode 100644 index 3049e5116ece7292fa550c29746aba88810b5ea9..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/meson.cross.d/common-musl +++ /dev/null @@ -1,6 +0,0 @@ -[properties] -have_c99_vsnprintf = true -have_c99_snprintf = true -have_unix98_printf = true -va_val_copy = true -have_strlcpy = true diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/run-ptest b/meta-openeuler/recipes-core/glib-2.0/glib-2.0/run-ptest deleted file mode 100644 index 7a231b514b423467f7684772a8f83e2de2b085f9..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/glib-2.0/glib-2.0/run-ptest +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/sh - -set -eux -if id -u glib2-test; then - userdel glib2-test -fi -useradd glib2-test -su glib2-test -c 'gnome-desktop-testing-runner glib' -userdel glib2-test diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0_%.bbappend b/meta-openeuler/recipes-core/glib-2.0/glib-2.0_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..f564c5dcedb44f1c54fc3e413e2d607d46299c47 --- /dev/null +++ b/meta-openeuler/recipes-core/glib-2.0/glib-2.0_%.bbappend @@ -0,0 +1,72 @@ +PV = "2.74.4" +OPENEULER_REPO_NAME = "glib2" + +# use new relocate-modules.patch to fix build error of glib-2.0-native +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +# no such file, add dependency on libpcre +LIC_FILES_CHKSUM_remove = " file://glib/pcre/pcre.h;beginline=8;endline=36;md5=3e2977dae4ad05217f58c446237298fc \ +" + +LIC_FILES_CHKSUM = "file://COPYING;md5=41890f71f740302b785c27661123bff5" + +DEPENDS += "libpcre2" + +# source version differs greatly from poky, use SRC_URI of a later version +# from http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb +# mingw32 patch: 0001-Set-host_machine-correctly-when-building-with-mingw3.patch +SRC_URI = "file://glib-${PV}.tar.xz \ + file://0001-fix-compile-error-for-arm32.patch \ + " +EXTRA_OEMESON_remove = "-Dfam=false" + +SRC_URI[sha256sum] = "0e82da5ea129b4444227c7e4a9e598f7288d1994bf63f129c44b90cfd2432172" + +# delete depends to shared-mime-info +SHAREDMIMEDEP_remove += "shared-mime-info" + +# glib2-codegn is a collection of python scripts. +# here, remove the runtime depends of python3, to simplify build +# when python3 support becomes mature, remove the following codes +RDEPENDS_${PN}-codegen = "" +# glib needs meson, meson needs python3-native +# here use nativesdk's meson-native and python3-native +DEPENDS_remove += "python3-native" + +# delete depends to util-linux-native +PACKAGECONFIG_remove_class-target += "libmount" +# no internal_pcre configuration option +PACKAGECONFIG[system-pcre] = "" + +# glib-2.0 will inherit gio-module-cache.bbclass to update +# gio module after glib-2.0 is installed. +# to update the cache, gio-querymodules of glib-2.0 will be called. +# gio-querymodules is a target binary which can't be directly executed in host +# to do this, yocto use qemu user mode to simulate the execution of gio-querymodules. +# The call of qemu user mode will make things more complex, so better not to use +# A workaround is to delay the call of gio-querymodules in target. +# Here, we set GIO_MODULLE_PACKAGES to empty to bypass the gio_module_cache_common in +# gio-module-cache.bbclass +# In future, if we figure out the related stuff of gio-querymodules, we can remove the +# following codes +GIO_MODULE_PACKAGES = "" + +# for ERROR: glib-2.0-1_2.74.4-r0 do_package: +# QA Issue: glib-2.0: Files/directories were installed but not shipped in any package: +# /usr/libexec +# /usr/libexec/gio-launch-desktop +FILES_${PN} += " ${libexecdir}/*gio-launch-desktop \" + +# rpath may generate by meson and may not auto delete rpath, it is no secure, so let we do it as a workaround +do_install_append () { + if [ -f ${D}${libexecdir}/gio-querymodules${EXEEXT} ]; then + chrpath --delete ${D}${libexecdir}/gio-querymodules${EXEEXT} + fi + if [ -f ${D}${libexecdir}/${MLPREFIX}gio-querymodules${EXEEXT} ]; then + chrpath --delete ${D}${libexecdir}/${MLPREFIX}gio-querymodules${EXEEXT} + fi + chrpath --delete ${D}${libdir}/libgio-2.0.so + chrpath --delete ${D}${libdir}/libgthread-2.0.so + chrpath --delete ${D}${libdir}/libgobject-2.0.so + chrpath --delete ${D}${libdir}/libgmodule-2.0.so +} diff --git a/meta-openeuler/recipes-core/glib-2.0/glib-2.0_2.68.1.bb b/meta-openeuler/recipes-core/glib-2.0/glib-2.0_2.68.1.bb deleted file mode 100644 index 49ac75de97e85f5fa099f579f05227b9c5ff8fd8..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/glib-2.0/glib-2.0_2.68.1.bb +++ /dev/null @@ -1,40 +0,0 @@ -require glib.inc - -SRC_URI = "file://glib2/glib-${PV}.tar.xz \ - file://glib2/backport-correctly-use-3-parameters-for-clise-range.patch \ - file://glib2/backport-fix-a-memory-leak.patch \ - file://run-ptest \ -" - -SRC_URI[sha256sum] = "241654b96bd36b88aaa12814efc4843b578e55d47440103727959ac346944333" - -# Find any meson cross files in FILESPATH that are relevant for the current -# build (using siteinfo) and add them to EXTRA_OEMESON. -inherit siteinfo -def find_meson_cross_files(d): - if bb.data.inherits_class('native', d): - return "" - - thisdir = os.path.normpath(d.getVar("THISDIR")) - import collections - sitedata = siteinfo_data(d) - # filename -> found - files = collections.OrderedDict() - for path in d.getVar("FILESPATH").split(":"): - for element in sitedata: - filename = os.path.normpath(os.path.join(path, "meson.cross.d", element)) - sanitized_path = filename.replace(thisdir, "${THISDIR}") - if sanitized_path == filename: - if os.path.exists(filename): - bb.error("Cannot add '%s' to --cross-file, because it's not relative to THISDIR '%s' and sstate signature would contain this full path" % (filename, thisdir)) - continue - files[filename.replace(thisdir, "${THISDIR}")] = os.path.exists(filename) - - items = ["--cross-file=" + k for k,v in files.items() if v] - d.appendVar("EXTRA_OEMESON", " " + " ".join(items)) - items = ["%s:%s" % (k, "True" if v else "False") for k,v in files.items()] - d.appendVarFlag("do_configure", "file-checksums", " " + " ".join(items)) - -python () { - find_meson_cross_files(d) -} diff --git a/meta-openeuler/recipes-core/glib-2.0/glib.inc b/meta-openeuler/recipes-core/glib-2.0/glib.inc deleted file mode 100644 index 8617001c216e6a5ed049f8cf7a73a39080ed3b5a..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/glib-2.0/glib.inc +++ /dev/null @@ -1,203 +0,0 @@ -SUMMARY = "A general-purpose utility library" -DESCRIPTION = "GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on." -HOMEPAGE = "https://developer.gnome.org/glib/" - -# pcre is under BSD; -# docs/reference/COPYING is with a 'public domain'-like license! -LICENSE = "LGPLv2.1+ & BSD & PD" -LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \ - file://glib/glib.h;beginline=4;endline=17;md5=b88abb7f3ad09607e71cb9d530155906 \ - file://gmodule/COPYING;md5=4fbd65380cdd255951079008b364516c \ - file://gmodule/gmodule.h;beginline=4;endline=17;md5=b88abb7f3ad09607e71cb9d530155906 \ - file://glib/pcre/pcre.h;beginline=8;endline=36;md5=3e2977dae4ad05217f58c446237298fc \ - file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc" -BUGTRACKER = "http://bugzilla.gnome.org" -SECTION = "libs" - -CVE_PRODUCT = "glib" - -BBCLASSEXTEND = "native nativesdk" - -DEPENDS = "glib-2.0-native \ - virtual/libintl \ - virtual/libiconv \ - libffi \ - zlib" - -PACKAGES += "${PN}-codegen ${PN}-utils ${PN}-bash-completion" - -LEAD_SONAME = "libglib-2.0.*" - -#inherit meson gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even bash-completion gio-module-cache manpages -#inherit meson gettext pkgconfig ptest-gnome upstream-version-is-even gio-module-cache manpages -inherit meson gettext pkgconfig - -DEPENDS_append_class-target = "${@' gtk-doc' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}" - -GTKDOC_MESON_OPTION = "gtk_doc" - -S = "${WORKDIR}/glib-${PV}" - -PACKAGECONFIG ??= "system-pcre libmount \ - ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" -# To use the system pcre it must be configured with --enable-unicode-properties -PACKAGECONFIG[system-pcre] = "-Dinternal_pcre=false,-Dinternal_pcre=true,libpcre" -PACKAGECONFIG[libmount] = "-Dlibmount=enabled,-Dlibmount=disabled,util-linux" -PACKAGECONFIG[manpages] = "-Dman=true, -Dman=false, libxslt-native xmlto-native" -# libelf is auto-detected without a configuration option -PACKAGECONFIG[libelf] = ",,elfutils" -PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false,dbus" - -EXTRA_OEMESON = "-Ddtrace=false -Dfam=false -Dsystemtap=false -Dselinux=disabled" - -do_configure_prepend() { - sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in -} - -FILES_${PN} = "${libdir}/lib*${SOLIBS} \ - ${libdir}/gio \ - ${libexecdir}/*gio-querymodules \ - ${datadir}/glib-2.0/schemas" - -FILES_${PN}-utils += "${bindir}/glib-genmarshal \ - ${bindir}/glib-gettextize \ - ${bindir}/glib-mkenums \ - ${bindir}/glib-compile-resources" - -FILES_${PN}-dev += "${libdir}/glib-2.0/include \ - ${libdir}/gio/modules/lib*${SOLIBSDEV} \ - ${libdir}/gio/modules/*.la \ - ${datadir}/glib-2.0/gettext/po/Makefile.in.in \ - ${datadir}/glib-2.0/schemas/gschema.dtd \ - ${datadir}/glib-2.0/valgrind/glib.supp \ - ${datadir}/gettext/its" -FILES_${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb" -FILES_${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py \ - ${bindir}/gdbus-codegen" -FILES_${PN}-utils = "${bindir}/*" -FILES_${PN}-bash-completion += "${datadir}/bash-completion/completions" - -SHAREDMIMEDEP = "shared-mime-info" -SHAREDMIMEDEP_class-native = "" -# When cross compiling for Windows we don't want to include this -SHAREDMIMEDEP_mingw32 = "" - -#RRECOMMENDS_${PN} += "${SHAREDMIMEDEP}" - -ARM_INSTRUCTION_SET_armv4 = "arm" -ARM_INSTRUCTION_SET_armv5 = "arm" -# Valgrind runtime detection works using hand-written assembly, which -# doesn't support mips16e -CPPFLAGS_append_class-target_mips16e = " -DNVALGRIND=1" - -# GLib generally requires gettext to be present so for USE_NLS to yes. For -# native builds as i18n is disabled globally we have to add a gettext-native dependency. -USE_NLS_class-target = "yes" -USE_NLS_class-nativesdk = "yes" -DEPENDS_append_class-native = " gettext-native" - -EXEEXT = "" -EXEEXT_mingw32 = ".exe" - -do_install_append () { - if [ -f ${D}${bindir}/gtester-report ]; then - sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python3|' - fi - - # Remove some unpackaged files - rm -rf ${D}${datadir}/glib-2.0/codegen/__pycache__ - rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc - rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo - - if [ -e ${D}${libdir}/charset.alias ]; then - rm -f ${D}${libdir}/charset.alias - fi - - # Make sure gio-querymodules is unique among multilibs - if test "x${MLPREFIX}" != "x"; then - mv ${D}${libexecdir}/gio-querymodules${EXEEXT} ${D}${libexecdir}/${MLPREFIX}gio-querymodules${EXEEXT} - fi - # Autotools does this, meson does not - mkdir -p ${D}${libdir}/gio/modules -} - -do_install_append_class-target () { - # Tests are only installed on targets, not native builds. Separating this out - # keeps glib-2.0-native from depending on DISTRO_FEATURES - if [ -f ${D}${datadir}/installed-tests/glib/gdbus-serialization.test ]; then - if ${@bb.utils.contains("DISTRO_FEATURES", "x11", "false", "true", d)}; then - rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test - fi - fi - if [ -f ${D}${datadir}/installed-tests/glib/static-link.test ]; then - if test "x${MLPREFIX}" != "x"; then - mv ${D}${datadir}/installed-tests/glib/static-link.test ${D}${datadir}/installed-tests/glib/${MLPREFIX}static-link.test - fi - fi -} - -# As we do not build python3 for windows, makes no sense to ship the script that's using it -do_install_append_mingw32() { - rm -f ${D}${bindir}/gtester-report -} - -CODEGEN_PYTHON_RDEPENDS = "python3 python3-distutils python3-xml" -CODEGEN_PYTHON_RDEPENDS_mingw32 = "" - -#RDEPENDS_${PN}-codegen += "${CODEGEN_PYTHON_RDEPENDS}" - -RDEPENDS_${PN}-ptest += "${PN}-utils" - -RDEPENDS_${PN}-ptest += "\ - coreutils \ - libgcc \ - dbus \ - gnome-desktop-testing \ - tzdata \ - tzdata-americas \ - tzdata-asia \ - tzdata-europe \ - tzdata-posix \ - shared-mime-info \ - ${PN}-locale-ja \ - ${PN}-locale-fr \ - ${PN}-locale-el \ - ${PN}-locale-hr \ - ${PN}-locale-lt \ - ${PN}-locale-pl \ - ${PN}-locale-ru \ - ${PN}-locale-th \ - python3-core \ - python3-modules \ - ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-dbusmock', '', d)} \ - ${PN}-codegen \ - " - -RDEPENDS_${PN}-ptest_append_libc-glibc = "\ - glibc-gconv-utf-16 \ - glibc-charmap-utf-8 \ - glibc-gconv-cp1255 \ - glibc-charmap-cp1255 \ - glibc-gconv-utf-32 \ - glibc-gconv-utf-7 \ - glibc-gconv-euc-jp \ - glibc-gconv-iso8859-1 \ - glibc-gconv-iso8859-15 \ - glibc-charmap-invariant \ - glibc-localedata-translit-cjk-variants \ - locale-base-tr-tr \ - locale-base-lt-lt \ - locale-base-ja-jp.euc-jp \ - locale-base-fa-ir \ - locale-base-ru-ru \ - locale-base-de-de \ - locale-base-hr-hr \ - locale-base-el-gr \ - locale-base-fr-fr \ - locale-base-es-es \ - locale-base-en-gb \ - locale-base-en-us \ - locale-base-pl-pl \ - locale-base-pl-pl.iso-8859-2 \ - " -DEPENDS_remove += "meson-native glib-2.0-native" diff --git a/meta-openeuler/recipes-core/glibc/glibc_2.34.bb b/meta-openeuler/recipes-core/glibc/glibc_2.34.bb deleted file mode 100644 index c1725d816bcbfd1d42a1c5d14bd7b0756b24c8bb..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/glibc/glibc_2.34.bb +++ /dev/null @@ -1,75 +0,0 @@ -SUMMARY = "GLIBC (GNU C Library)" -DESCRIPTION = "The GNU C Library is used as the system C library in most systems with the Linux kernel. \ - In openEuler, glibc is prebuilt and part of toolchain. This recipe just installs the glibc \ - binary" -HOMEPAGE = "http://www.gnu.org/software/libc/libc.html" -SECTION = "libs" -LICENSE = "GPLv2 & LGPLv2.1" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" - -PACKAGES = "${PN} ${PN}-dev ${PN}-staticdev" - -#need strip command from compiler when do_package -DEPENDS = "virtual/${TARGET_PREFIX}gcc" -PROVIDES += "virtual/libc virtual/libiconv virtual/libintl" -#RPROVIDES_${PN}-dev += "libc-dev" - - -INHIBIT_DEFAULT_DEPS = "1" - -PR = "r1" - -require ../../recipes-devtools/gcc/gcc-bin-toolchain.inc - -SRC_URI_aarch64 = "file://openeuler_gcc_arm64le" -SRC_URI_arm = "file://openeuler_gcc_arm32le" - -#Not strip toolchain -INHIBIT_SYSROOT_STRIP = "1" -INSANE_SKIP_${PN} += "already-stripped" - -S_aarch64 = "${WORKDIR}/openeuler_gcc_arm64le" -S_arm = "${WORKDIR}/openeuler_gcc_arm32le" - -PSEUDO_DISABLED = "1" - -do_configure() { - : -} - -do_compile () { - : -} - -do_install() { - install -m 0755 -d ${D}/ - install -m 0755 -d ${D}/${base_libdir} - install -m 0755 -d ${D}/${libdir} - cp -pPR ${S}/sysroot/* ${D}/ - chmod -R 755 ${D}/${base_libdir} - chmod -R 755 ${D}/${libdir} - rm -rf ${D}/etc/rpc - rm -rf ${D}${datadir}/info - rm -rf ${D}${base_libdir}/debug - chown root:root ${D}/ -R -} - -FILES_${PN} = " \ - ${base_libdir}/*.so \ - ${base_libdir}/*.so.* \ - ${libdir}/*.so \ - ${libdir}/*.so.* \ - ${base_sbindir}/ldconfig \ -" -FILES_${PN}-staticdev = " \ - ${base_libdir}/*.a \ - ${libdir}/*.a \ -" - -INSANE_SKIP_${PN} += "installed-vs-shipped" -INSANE_SKIP += "dev-elf dev-so" - -SYSROOT_DIRS += "/*" - -BBCLASSEXTEND = "nativesdk" diff --git a/meta-openeuler/recipes-core/gmp/gmp.inc b/meta-openeuler/recipes-core/gmp/gmp.inc deleted file mode 100644 index 948b89288e05638b039080a47dfa0a948544a53e..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/gmp/gmp.inc +++ /dev/null @@ -1,12 +0,0 @@ -SUMMARY = "GNU multiprecision arithmetic library" -DESCRIPTION = "GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers" -HOMEPAGE = "http://gmplib.org/" -SECTION = "devel" - -inherit autotools texinfo multilib_header - -PACKAGECONFIG ??= "" -PACKAGECONFIG[readline] = "--with-readline=yes,--with-readline=no,readline" - -ARM_INSTRUCTION_SET_armv4 = "arm" -ARM_INSTRUCTION_SET_armv5 = "arm" diff --git a/meta-openeuler/recipes-core/gmp/gmp_6.2.1.bb b/meta-openeuler/recipes-core/gmp/gmp_6.2.1.bb deleted file mode 100644 index 37245b732ecf2103d9326e851fe73fd2786e2193..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/gmp/gmp_6.2.1.bb +++ /dev/null @@ -1,41 +0,0 @@ -require gmp.inc - -LICENSE = "GPLv2+ | LGPLv3+" - -LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ - file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \ - file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ -" - -REVISION = "" -SRC_URI = "file://gmp/${BP}.tar.bz2 \ - " -SRC_URI[md5sum] = "28971fc21cf028042d4897f02fd355ea" -SRC_URI[sha256sum] = "eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c" - -acpaths = "" - -EXTRA_OECONF += " --enable-cxx=detect" -EXTRA_OECONF_mipsarchr6_append = " --disable-assembly" - -PACKAGES =+ "libgmpxx" -FILES_libgmpxx = "${libdir}/libgmpxx${SOLIBS}" - -do_install_append() { - oe_multilib_header gmp.h -} - -do_install_prepend_class-target() { - sed -i \ - -e "s|--sysroot=${STAGING_DIR_HOST}||g" \ - -e "s|${DEBUG_PREFIX_MAP}||g" \ - ${B}/gmp.h -} - -SSTATE_SCAN_FILES += "gmp.h" - -# Doesn't compile in MIPS16e mode due to use of hand-written -# assembly -MIPS_INSTRUCTION_SET = "mips" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/grep/grep_3.7.bb b/meta-openeuler/recipes-core/grep/grep_3.7.bb deleted file mode 100644 index ed3dcb511e15b62d22ad30d8671e71fc7464456a..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/grep/grep_3.7.bb +++ /dev/null @@ -1,45 +0,0 @@ -SUMMARY = "GNU grep utility" -HOMEPAGE = "http://savannah.gnu.org/projects/grep/" -DESCRIPTION = "Grep searches one or more input files for lines containing a match to a specified pattern. By default, grep prints the matching lines." -BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep" -SECTION = "console/utils" -LICENSE = "GPLv3" -LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464" - -SRC_URI = "file://grep/grep-${PV}.tar.xz \ - file://grep/backport-grep-avoid-sticky-problem-with-f-f.patch \ -" -SRC_URI[sha256sum] = "5c10da312460aec721984d5d83246d24520ec438dd48d7ab5a05dbc0d6d6823c" - -inherit autotools gettext texinfo pkgconfig - -# Fix "Argument list too long" error when len(TMPDIR) = 410 -acpaths = "-I ./m4" - -do_configure_prepend () { - sed -i -e '1s,#!@SHELL@,#!/bin/sh,' ${S}/src/egrep.sh - rm -f ${S}/m4/init.m4 -} - -do_install () { - autotools_do_install - if [ "${base_bindir}" != "${bindir}" ]; then - install -d ${D}${base_bindir} - mv ${D}${bindir}/grep ${D}${base_bindir}/grep - mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep - mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep - rmdir ${D}${bindir}/ - fi -} - -PACKAGECONFIG ??= "pcre" -PACKAGECONFIG[pcre] = "--enable-perl-regexp,--disable-perl-regexp,libpcre" - -ALTERNATIVE_PRIORITY = "100" - -ALTERNATIVE_${PN} = "grep egrep fgrep" -ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep" -ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep" -ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep" - -BBCLASSEXTEND = "nativesdk" diff --git a/meta-openeuler/recipes-core/gzip/files/run-ptest b/meta-openeuler/recipes-core/gzip/files/run-ptest deleted file mode 100644 index cf7c64949abd31148f71b2f260b7f5f6d7c7b969..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/gzip/files/run-ptest +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -cd src/tests - -make check - diff --git a/meta-openeuler/recipes-core/gzip/gzip.inc b/meta-openeuler/recipes-core/gzip/gzip.inc deleted file mode 100644 index 1a0747dff837e8ab538e9689c891e4f5d603fc19..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/gzip/gzip.inc +++ /dev/null @@ -1,33 +0,0 @@ -SUMMARY = "Standard GNU compressor" -DESCRIPTION = "GNU Gzip is a popular data compression program originally written by Jean-loup Gailly for the GNU \ -project. Mark Adler wrote the decompression part" -HOMEPAGE = "http://www.gnu.org/software/gzip/" -SECTION = "console/utils" -# change to GPLv3+ in 2007/07. Previous GPLv2 version is 1.3.12 - -inherit autotools texinfo -export DEFS="NO_ASM" - -EXTRA_OEMAKE_class-target = "GREP=${base_bindir}/grep" -EXTRA_OECONF_append_libc-musl = " gl_cv_func_fflush_stdin=yes " - -do_install_append () { - if [ "${base_bindir}" != "${bindir}" ]; then - # Rename and move files into /bin (FHS), which is typical place for gzip - install -d ${D}${base_bindir} - mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip - mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip - mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat - mv ${D}${bindir}/uncompress ${D}${base_bindir}/uncompress - fi -} - -#inherit update-alternatives - -ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN} = "gunzip gzip zcat" -ALTERNATIVE_LINK_NAME[gunzip] = "${base_bindir}/gunzip" -ALTERNATIVE_LINK_NAME[gzip] = "${base_bindir}/gzip" -ALTERNATIVE_LINK_NAME[zcat] = "${base_bindir}/zcat" - -export CONFIG_SHELL="/bin/sh" diff --git a/meta-openeuler/recipes-core/gzip/gzip/wrong-path-fix.patch b/meta-openeuler/recipes-core/gzip/gzip/wrong-path-fix.patch deleted file mode 100644 index 7c37bc8d2d9269aaf86c70164aa0ad86c65cae12..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/gzip/gzip/wrong-path-fix.patch +++ /dev/null @@ -1,36 +0,0 @@ -fix MakeMaker issues with using wrong SHELL/GREP - -A set of substitution is being processed to all target scripts with sed by -replacing some key words with the detected values at configure time, this -is exactly not compliant with cross compling, and will cause missing path -errors at run time like: -"/usr/bin/zgrep: line 230: /usr/bin/grep: No such file or directory" - -Fixed by removing unneeded substitution and using real runtime paths -instead. - -Signed-off-by: Ming Liu - -Upstream-Status: Pending - ---- - Makefile.am | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index d4ecc3f..e4657d2 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -82,8 +82,7 @@ SUFFIXES = .in - .in: - $(AM_V_GEN)rm -f $@-t $@ \ - && sed \ -- -e 's|/bin/sh|$(SHELL)|g' \ -- -e 's|[@]GREP@|$(GREP)|g' \ -+ -e 's|[@]GREP@|$(base_bindir)/grep|g' \ - -e 's|[@]VERSION@|$(VERSION)|g' \ - $(srcdir)/$@.in >$@-t \ - && chmod a=rx $@-t \ --- -2.7.4 - diff --git a/meta-openeuler/recipes-core/gzip/gzip_1.11.bb b/meta-openeuler/recipes-core/gzip/gzip_1.11.bb deleted file mode 100644 index bbb09e67770fb838c5d2608c13231c62e74d0058..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/gzip/gzip_1.11.bb +++ /dev/null @@ -1,45 +0,0 @@ -require gzip.inc - -LICENSE = "GPLv3+" - -SRC_URI = "file://gzip/${BP}.tar.xz \ - file://gzip/gzip-l-now-outputs-accurate-size.patch \ - file://gzip/doc-document-gzip-l-change.patch \ - file://gzip/zdiff-fix-arg-handling-bug.patch \ - file://gzip/zdiff-fix-another-arg-handling-bug.patch \ - file://gzip/fix-verbose-disable.patch \ - file://run-ptest \ - " -SRC_URI_append_class-target = " file://wrong-path-fix.patch" - -LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ - file://gzip.h;beginline=8;endline=20;md5=6e47caaa630e0c8bf9f1bc8d94a8ed0e" - -PROVIDES_append_class-native = " gzip-replacement-native" - -RDEPENDS_${PN}-ptest += "make perl grep diffutils" - -BBCLASSEXTEND = "native nativesdk" - -inherit ptest - -do_install_ptest() { - mkdir -p ${D}${PTEST_PATH}/src/build-aux - cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/src/build-aux/ - mkdir -p ${D}${PTEST_PATH}/src/tests - cp -r ${S}/tests/* ${D}${PTEST_PATH}/src/tests - sed -e 's/^abs_srcdir = ..*/abs_srcdir = \.\./' \ - -e 's/^top_srcdir = ..*/top_srcdir = \.\./' \ - -e 's/^GREP = ..*/GREP = grep/' \ - -e 's/^AWK = ..*/AWK = awk/' \ - -e 's/^srcdir = ..*/srcdir = \./' \ - -e 's/^Makefile: ..*/Makefile: /' \ - -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's|${DEBUG_PREFIX_MAP}||g' \ - -e 's:${HOSTTOOLS_DIR}/::g' \ - -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ - ${B}/tests/Makefile > ${D}${PTEST_PATH}/src/tests/Makefile -} - -SRC_URI[md5sum] = "d1e93996dba00cab0caa7903cd01d454" -SRC_URI[sha256sum] = "9b9a95d68fdcb936849a4d6fada8bf8686cddf58b9b26c9c4289ed0c92a77907" diff --git a/meta-openeuler/recipes-core/http-parser/http-parser_2.9.4.bb b/meta-openeuler/recipes-core/http-parser/http-parser_2.9.4.bb deleted file mode 100644 index 76857503b4fd1c88f243b5312929ab6e914a7848..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/http-parser/http-parser_2.9.4.bb +++ /dev/null @@ -1,51 +0,0 @@ -SUMMARY = "Protocol Buffers - structured data serialisation mechanism" -DESCRIPTION = "Yet Another JSON Library - A Portable JSON parsing and serialization library in ANSI C" -SECTION = "console/tools" -LICENSE = "BSD-2-Clause" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" - -SRC_URI = "file://http-parser/http-parser-2.9.4.tar.gz" - -S = "${WORKDIR}/${BPN}-${PV}" - -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" - -DEPENDS = "" -#CFLAGS_remove = "-D_FORTIFY_SOURCE=2" -#CPPFLAGS_remove = "-D_FORTIFY_SOURCE=2" -#CXXPFLAGS_remove = "-D_FORTIFY_SOURCE=2" - - -inherit autotools pkgconfig - -PACKAGES = "${PN}-dev ${PN}" -FILES_${PN}-dev = "${includedir}/*" -FILES_${PN} += "${libdir}/*" - -do_package_qa() { - : -} - -do_compile() { - make library -} - -do_install_append () { - [[ "${libdir}" != "/usr/local/lib" ]] || return 0 - if test -d ${D}/usr/local/lib ; then - cd ${D}/usr/local/lib - ln -sf libhttp_parser.so.${PV} libhttp_parser.so - cd - - mv ${D}/usr/local/lib ${D}/${libdir} - fi - if test -d ${D}/usr/local/include ; then - mv ${D}/usr/local/include ${D}/${includedir} - fi - rm -rf ${D}/usr/local -} - -BBCLASSEXTEND = "native nativesdk" -B = "${S}" - - diff --git a/meta-openeuler/recipes-core/iSulad/iSulad_2.0.12.bb b/meta-openeuler/recipes-core/iSulad/iSulad_2.0.12.bb deleted file mode 100644 index ce2bc0e16efc746875158be06bdfbc4096438fff..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/iSulad/iSulad_2.0.12.bb +++ /dev/null @@ -1,41 +0,0 @@ -DESCRIPTION = "Yet Another JSON Library - A Portable JSON parsing and serialization library in ANSI C" -LICENSE = "MIT" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" - -SRC_URI = "file://iSulad/v${PV}.tar.gz \ -" - -S = "${WORKDIR}/${BPN}-v${PV}" -WARN_QA_remove += "uppercase-pn" - -inherit cmake -OECMAKE_GENERATOR = "Unix Makefiles" - -DEPENDS = "yajl zlib libarchive http-parser curl lcr libevent libevhtp openssl libwebsockets" - -EXTRA_OECMAKE = "-DENABLE_GRPC=OFF -DENABLE_SYSTEMD_NOTIFY=OFF -DENABLE_SELINUX=OFF \ - -DENABLE_SHIM_V2=OFF -DENABLE_OPENSSL_VERIFY=OFF \ - -DGRPC_CONNECTOR=OFF -DDISABLE_OCI=ON \ - " - -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" - -FILES_${PN} += "${libdir}/* " -#remove so from ${PN}-dev -FILES_SOLIBSDEV = "" - -do_configure_prepend() { - grep -q CMAKE_SYSROOT ${WORKDIR}/toolchain.cmake || cat >> ${WORKDIR}/toolchain.cmake < /dev/null || /bin/true + +mkdir -p /tmp + +# Create /etc/mtab if not present +if [ ! -e /etc/mtab ] && [ -e /proc/mounts ]; then + ln -sf /proc/mounts /etc/mtab +fi + +disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//") + +swap_size=$((disk_size*swap_ratio/100)) +rootfs_size=$((disk_size-boot_size-swap_size)) + +rootfs_start=$((boot_size)) +rootfs_end=$((rootfs_start+rootfs_size)) +swap_start=$((rootfs_end)) + +# MMC devices are special in a couple of ways +# 1) they use a partition prefix character 'p' +# 2) they are detected asynchronously (need rootwait) +rootwait="" +part_prefix="" +if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \ + [ ! "${device#/dev/nvme}" = "${device}" ]; then + part_prefix="p" + rootwait="rootwait" +fi + +# USB devices also require rootwait +if [ -n `readlink /dev/disk/by-id/usb* | grep $TARGET_DEVICE_NAME` ]; then + rootwait="rootwait" +fi + +bootfs=${device}${part_prefix}1 +rootfs=${device}${part_prefix}2 +swap=${device}${part_prefix}3 + +echo "*****************" +echo "Boot partition size: $boot_size MB ($bootfs)" +echo "Rootfs partition size: $rootfs_size MB ($rootfs)" +echo "Swap partition size: $swap_size MB ($swap)" +echo "*****************" +echo "Deleting partition table on ${device} ..." +dd if=/dev/zero of=${device} bs=512 count=35 + +echo "Creating new partition table on ${device} ..." +parted ${device} mklabel gpt + +echo "Creating boot partition on $bootfs" +parted ${device} mkpart boot fat32 0% $boot_size +parted ${device} set 1 boot on + +echo "Creating rootfs partition on $rootfs" +parted ${device} mkpart root ext4 $rootfs_start $rootfs_end + +echo "Creating swap partition on $swap" +parted ${device} mkpart swap linux-swap $swap_start 100% + +parted ${device} print + +echo "Waiting for device nodes..." +C=0 +while [ $C -ne 3 ] && [ ! -e $bootfs -o ! -e $rootfs -o ! -e $swap ]; do + C=$(( C + 1 )) + sleep 1 +done + +echo "Formatting $bootfs to vfat..." +mkfs.vfat $bootfs + +echo "Formatting $rootfs to ext4..." +mkfs.ext4 $rootfs + +echo "Formatting swap partition...($swap)" +mkswap $swap + +mkdir /tgt_root +mkdir /src_root +mkdir -p /boot + +# Handling of the target root partition +mount $rootfs /tgt_root +mount -o rw,loop,noatime,nodiratime /run/media/${TARGET_CDROM_NAME}/${rootfs_name} /src_root +echo "Copying rootfs files..." +cp -a /src_root/* /tgt_root +# you may should manually add it to fstab or if you already has a udev rules. +if [ -d /tgt_root/etc/ ]; then + boot_uuid=$(blkid -o value -s UUID ${bootfs}) + swap_part_uuid=$(blkid -o value -s PARTUUID ${swap}) + echo "#/dev/disk/by-partuuid/$swap_part_uuid swap swap defaults 0 0" >> /tgt_root/etc/fstab + echo "#UUID=$boot_uuid /boot vfat defaults 1 2" >> /tgt_root/etc/fstab + # We dont want udev to mount our root device while we're booting... + if [ -d /tgt_root/etc/udev/ ] ; then + echo "${device}" >> /tgt_root/etc/udev/mount.blacklist + fi +fi + +umount /src_root + +# Handling of the target boot partition +mount $bootfs /boot +echo "Preparing boot partition..." + +EFIDIR="/boot/EFI/BOOT" +# remove old EFI +rm -rf /boot/EFI +mkdir -p $EFIDIR +# Copy the efi loader +cp /run/media/${TARGET_CDROM_NAME}/EFI/BOOT/*.efi $EFIDIR + +if [ -f /run/media/${TARGET_CDROM_NAME}/EFI/BOOT/grub.cfg ]; then + GRUBCFG_TMP=/tmp/grub.cfg.local + cp /run/media/${TARGET_CDROM_NAME}/EFI/BOOT/grub.cfg $GRUBCFG_TMP + + root_part_uuid=$(blkid -o value -s PARTUUID ${rootfs}) + GRUBCFG="$EFIDIR/grub.cfg" + # Update grub config for the installed image + # Delete the install entry + sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG_TMP + # Delete the initrd lines + sed -i "/initrd /d" $GRUBCFG_TMP + # Delete any LABEL= strings + sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG_TMP + # Replace root= and add additional standard boot options + # We use root as a sentinel value, as vmlinuz is no longer guaranteed + sed -i "s/ root=[^ ]*/ root=PARTUUID=$root_part_uuid rw $rootwait quiet /g" $GRUBCFG_TMP + mv $GRUBCFG_TMP $GRUBCFG +fi + +if [ -d /run/media/${TARGET_CDROM_NAME}/loader ]; then + rootuuid=$(blkid -o value -s PARTUUID ${rootfs}) + SYSTEMDBOOT_CFGS="/boot/loader/entries/*.conf" + # copy config files for systemd-boot + cp -dr /run/media/${TARGET_CDROM_NAME}/loader /boot + # delete the install entry + rm -f /boot/loader/entries/install.conf + # delete the initrd lines + sed -i "/initrd /d" $SYSTEMDBOOT_CFGS + # delete any LABEL= strings + sed -i "s/ LABEL=[^ ]*/ /" $SYSTEMDBOOT_CFGS + # delete any root= strings + sed -i "s/ root=[^ ]*/ /" $SYSTEMDBOOT_CFGS + # add the root= and other standard boot options + sed -i "s@options *@options root=PARTUUID=$rootuuid rw $rootwait quiet @" $SYSTEMDBOOT_CFGS +fi + +umount /tgt_root + +# copy any extra files needed for ESP +if [ -d /run/media/${TARGET_CDROM_NAME}/esp ]; then + cp -r /run/media/${TARGET_CDROM_NAME}/esp/* /boot +fi + +# Copy kernel artifacts. To add more artifacts just add to types +# For now just support kernel types already being used by something in OE-core +for types in bzImage zImage vmlinux vmlinuz fitImage; do + for kernel in `find /run/media/${TARGET_CDROM_NAME}/ -iname $types*`; do + cp $kernel /boot + done +done + +umount /boot + +sync + +echo "Installation successful. Remove your installation media and press ENTER to reboot." + +read enter + +echo "Rebooting..." +reboot -f diff --git a/meta-openeuler/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bbappend b/meta-openeuler/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bbee4c1c571f0160878252e1567881260b2d9280 --- /dev/null +++ b/meta-openeuler/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bbappend @@ -0,0 +1,11 @@ +# main bbfile: yocto-poky/meta/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bb + +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +SRC_URI += "file://init-install-efi-openeuler.sh" + +RDEPENDS_${PN}_remove = "initramfs-framework-base" + +do_install_append() { + install -m 0755 ${WORKDIR}/init-install-efi-openeuler.sh ${D}/init.d/install-efi.sh +} diff --git a/meta-openeuler/recipes-core/initscripts/files/init-system-helpers_debian-1.64.tar.gz b/meta-openeuler/recipes-core/initscripts/files/init-system-helpers_debian-1.64.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e5baf92a4371835891a2081951b3b9a2678e0d69 Binary files /dev/null and b/meta-openeuler/recipes-core/initscripts/files/init-system-helpers_debian-1.64.tar.gz differ diff --git a/meta-openeuler/recipes-core/initscripts/files/openeuler-safety-volatiles b/meta-openeuler/recipes-core/initscripts/files/openeuler-safety-volatiles new file mode 100644 index 0000000000000000000000000000000000000000..7e5595834f919b0b67307aa8a3e78e64b405a912 --- /dev/null +++ b/meta-openeuler/recipes-core/initscripts/files/openeuler-safety-volatiles @@ -0,0 +1,36 @@ +# openEuler Embedded extre volatiles for safety: +# Main function is similar to 00_core of initscripts/volatiles +# And extra 'p' mode which will change files/dir's permission + +p root root 0640 /dev/mem none +p root root 0600 /etc/fstab none +p root root 0644 /etc/group none +p root root 0750 /etc/init.d/ none +p root root 0750 /etc/init.d/* none +p root root 0644 /etc/passwd none +p root root 0600 /etc/securetty none +f root root 0600 /etc/security/opasswd none +p root root 0600 /etc/shadow none +p root root 0600 /etc/ssh/sshd_config none +p root root 0600 /etc/sysctl.conf none +p root root 0750 /lib/modules/ none +p root root 0700 /root/ none +d root root 0750 /var/log/audit/ none +p root root 0750 /var/log/audit/ none +f root root 0600 /var/log/audit/audit.log none +p root root 0600 /var/log/audit/audit.log none +p root root 0750 /var/log/ none +p root root 0640 /var/log/* none +f root root 0640 /var/log/auth.log none +p root root 0640 /var/log/auth.log none +p root root 0640 /var/log/wtmp none +p root root 0755 /bin/ none +p root root 0755 /etc/ none +p root root 0755 /home/ none +p root root 0755 /lib/ none +p root root 0755 /dev/ none +p root root 0755 /sbin/init none +p root root 0750 /var/volatile/log none +p root root 0644 /etc/motd none +p root root 0644 /etc/issue none +p root root 0644 /etc/issue.net none diff --git a/meta-openeuler/recipes-core/initscripts/files/populate-openeuler-volatile.sh b/meta-openeuler/recipes-core/initscripts/files/populate-openeuler-volatile.sh new file mode 100755 index 0000000000000000000000000000000000000000..8d8463fc9b55d6451fd3e9a10062580901f079cb --- /dev/null +++ b/meta-openeuler/recipes-core/initscripts/files/populate-openeuler-volatile.sh @@ -0,0 +1,291 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: volatile +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Default-Start: S +# Default-Stop: +# Short-Description: Populate the volatile filesystem +### END INIT INFO + +# Get ROOT_DIR +DIRNAME="$(dirname "$0")" +ROOT_DIR="$(echo "$DIRNAME" | sed -ne 's:/etc/.*::p')" + +[ -e "${ROOT_DIR}/etc/default/rcS" ] && . "${ROOT_DIR}/etc/default/rcS" +# When running populate-volatile.sh at rootfs time, disable cache. +[ -n "$ROOT_DIR" ] && VOLATILE_ENABLE_CACHE=no +# If rootfs is read-only, disable cache. +[ "$ROOTFS_READ_ONLY" = "yes" ] && VOLATILE_ENABLE_CACHE=no + +CFGDIR="${ROOT_DIR}/etc/default/openeuler-volatiles" +TMPROOT="${ROOT_DIR}/var/volatile/tmp" +COREDEF="00_core" + +[ "${VERBOSE}" != "no" ] && echo "Populating volatile Filesystems." + +create_file() { + EXEC="" + if [ -z "$2" ]; then + EXEC=" + touch \"$1\"; + " + else + EXEC=" + cp \"$2\" \"$1\"; + " + fi + EXEC=" + ${EXEC} + chown ${TUSER}:${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1; + chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 " + + test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/openeuler-volatile.cache.build + + if [ -e "$1" ]; then + [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping." + else + if [ -z "$ROOT_DIR" ]; then + eval "$EXEC" + else + # Creating some files at rootfs time may fail and should fail, + # but these failures should not be logged to make sure the do_rootfs + # process doesn't fail. This does no harm, as this script will + # run on target to set up the correct files and directories. + eval "$EXEC" > /dev/null 2>&1 + fi + fi +} + +mk_dir() { + EXEC=" + mkdir -p \"$1\"; + chown ${TUSER}:${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1; + chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 " + + test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/openeuler-volatile.cache.build + if [ -e "$1" ]; then + [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping." + else + if [ -z "$ROOT_DIR" ]; then + eval "$EXEC" + else + # For the same reason with create_file(), failures should + # not be logged. + eval "$EXEC" > /dev/null 2>&1 + fi + fi +} + +ch_perm() { + EXEC=" + chown ${TUSER}:${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1; + chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 " + + test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/openeuler-volatile.cache.build + + if [ -z "$ROOT_DIR" ]; then + eval "$EXEC" + else + eval "$EXEC" > /dev/null 2>&1 + fi +} + +link_file() { + EXEC=" + if [ -L \"$2\" ]; then + [ \"\$(readlink \"$2\")\" != \"$1\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; }; + elif [ -d \"$2\" ]; then + if awk '\$2 == \"$2\" {exit 1}' /proc/mounts; then + cp -a $2/* $1 2>/dev/null; + cp -a $2/.[!.]* $1 2>/dev/null; + rm -rf \"$2\"; + ln -sf \"$1\" \"$2\"; + fi + else + ln -sf \"$1\" \"$2\"; + fi + " + + test "$VOLATILE_ENABLE_CACHE" = yes && echo " $EXEC" >> /etc/openeuler-volatile.cache.build + + if [ -z "$ROOT_DIR" ]; then + eval "$EXEC" + else + # For the same reason with create_file(), failures should + # not be logged. + eval "$EXEC" > /dev/null 2>&1 + fi +} + +check_requirements() { + cleanup() { + rm "${TMP_INTERMED}" + rm "${TMP_DEFINED}" + rm "${TMP_COMBINED}" + } + + CFGFILE="$1" + + TMP_INTERMED="${TMPROOT}/openeuler-tmp.$$" + TMP_DEFINED="${TMPROOT}/openeuler-tmpdefined.$$" + TMP_COMBINED="${TMPROOT}/openeuler-tmpcombined.$$" + + sed 's@\(^:\)*:.*@\1@' "${ROOT_DIR}/etc/passwd" | sort | uniq > "${TMP_DEFINED}" + grep -v "^#" "${CFGFILE}" | cut -s -d " " -f 2 > "${TMP_INTERMED}" + cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}" + NR_DEFINED_USERS="$(wc -l < "${TMP_DEFINED}")" + NR_COMBINED_USERS="$(wc -l < "${TMP_COMBINED}")" + + [ "${NR_DEFINED_USERS}" -ne "${NR_COMBINED_USERS}" ] && { + echo "Undefined users:" + diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>" + cleanup + return 1 + } + + + sed 's@\(^:\)*:.*@\1@' "${ROOT_DIR}/etc/group" | sort | uniq > "${TMP_DEFINED}" + grep -v "^#" "${CFGFILE}" | cut -s -d " " -f 3 > "${TMP_INTERMED}" + cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}" + + NR_DEFINED_GROUPS="$(wc -l < "${TMP_DEFINED}")" + NR_COMBINED_GROUPS="$(wc -l < "${TMP_COMBINED}")" + + [ "${NR_DEFINED_GROUPS}" -ne "${NR_COMBINED_GROUPS}" ] && { + echo "Undefined groups:" + diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>" + cleanup + return 1 + } + + # Add checks for required directories here + + cleanup + return 0 +} + +apply_cfgfile() { + CFGFILE="$1" + SKIP_REQUIREMENTS="$2" + + [ "${VERBOSE}" != "no" ] && echo "Applying ${CFGFILE}" + + [ "${SKIP_REQUIREMENTS}" = "yes" ] || check_requirements "${CFGFILE}" || { + echo "Skipping ${CFGFILE}" + return 1 + } + + sed 's/#.*//' "${CFGFILE}" | \ + while read -r TTYPE TUSER TGROUP TMODE TNAME TLTARGET; do + test -z "${TLTARGET}" && continue + TNAME=${ROOT_DIR}${TNAME} + [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-." + + [ "${TTYPE}" = "l" ] && { + TSOURCE="$TLTARGET" + [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-." + link_file "${TSOURCE}" "${TNAME}" + continue + } + + [ "${TTYPE}" = "b" ] && { + TSOURCE="$TLTARGET" + [ "${VERBOSE}" != "no" ] && echo "Creating mount-bind -${TNAME}- from -${TSOURCE}-." + mount --bind "${TSOURCE}" "${TNAME}" + EXEC=" + mount --bind \"${TSOURCE}\" \"${TNAME}\"" + test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/openeuler-volatile.cache.build + continue + } + + [ -L "${TNAME}" ] && { + [ "${VERBOSE}" != "no" ] && echo "Found link." + NEWNAME=$(ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/') + if echo "${NEWNAME}" | grep -v "^/" >/dev/null; then + TNAME="$(echo "${TNAME}" | sed -e 's@\(.*\)/.*@\1@')/${NEWNAME}" + [ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-." + else + TNAME="${NEWNAME}" + [ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-." + fi + } + + case "${TTYPE}" in + "f") [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-." + TSOURCE="$TLTARGET" + [ "${TSOURCE}" = "none" ] && TSOURCE="" + create_file "${TNAME}" "${TSOURCE}" & + ;; + "d") [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-." + mk_dir "${TNAME}" + # Add check to see if there's an entry in fstab to mount. + ;; + "p") [ "${VERBOSE}" != "no" ] && echo "Changing permission -${TNAME}-." + ch_perm "${TNAME}" + ;; + *) [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-." + continue + ;; + esac + done + return 0 +} + +clearcache=0 +exec 9&- + +if test -e "${ROOT_DIR}/etc/openeuler-volatile.cache" -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" -a "x$clearcache" = "x0" +then + sh "${ROOT_DIR}/etc/openeuler-volatile.cache" +else + rm -f "${ROOT_DIR}/etc/openeuler-volatile.cache" "${ROOT_DIR}/etc/openeuler-volatile.cache.build" + + # Apply the core file with out checking requirements. ${TMPROOT} is + # needed by check_requirements but is setup by this file, so it must be + # processed first and without being checked. + [ -e "${CFGDIR}/${COREDEF}" ] && apply_cfgfile "${CFGDIR}/${COREDEF}" "yes" + + # Fast path: check_requirements is slow and most of the time doesn't + # find any problems. If there are a lot of config files, it is much + # faster to to concatenate them all together and process them once to + # avoid the overhead of calling check_requirements repeatedly + TMP_FILE="${TMPROOT}/openeuler-tmp_volatile.$$" + rm -f "$TMP_FILE" + touch ${CFGDIR}/endtest + CFGFILES="$(ls -1 "${CFGDIR}" | grep -v "^${COREDEF}\$" | sort)" + for file in ${CFGFILES}; do + cat "${CFGDIR}/${file}" >> "$TMP_FILE" + done + + if check_requirements "$TMP_FILE" + then + apply_cfgfile "$TMP_FILE" "yes" + else + # Slow path: One or more config files failed requirements. + # Process each one individually so the offending one can be + # skipped + for file in ${CFGFILES}; do + apply_cfgfile "${CFGDIR}/${file}" + done + fi + rm "$TMP_FILE" + rm ${CFGDIR}/endtest + + [ -e "${ROOT_DIR}/etc/openeuler-volatile.cache.build" ] && sync && mv "${ROOT_DIR}/etc/openeuler-volatile.cache.build" "${ROOT_DIR}/etc/openeuler-volatile.cache" +fi + +if [ -z "${ROOT_DIR}" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ] +then + ln -s /etc/ld.so.cache /var/run/ld.so.cache +fi diff --git a/meta-openeuler/recipes-core/initscripts/init-system-helpers_%.bbappend b/meta-openeuler/recipes-core/initscripts/init-system-helpers_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..fb852f99ca592ab4a003c60347cc50772963111b --- /dev/null +++ b/meta-openeuler/recipes-core/initscripts/init-system-helpers_%.bbappend @@ -0,0 +1,15 @@ +# main bbfile: yocto-poky/meta/recipes-core/initscripts/init-system-helpers_1.60.bb + +# As it's small, the tarball of init-system-helpers is integrated in openEuler Embedded +# to avoid network download. +PV = "debian-1.64" + +FILESEXTRAPATHS_append := "${THISDIR}/files/:" + +LIC_FILES_CHKSUM = "file://debian/copyright;md5=c4ec20aa158fa9de26ee1accf78dcaae" + +SRC_URI = "file://${BPN}_${PV}.tar.gz" +SRC_URI[md5sum] = "69ce302fe1ee5616f17281b0708e9922" +SRC_URI[sha256sum] = "abebfcc4bbed3ba291bf84840451125e7f1d5be37fcae81e171b673cb820d1d1" + +S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/recipes-core/initscripts/initscripts_%.bbappend b/meta-openeuler/recipes-core/initscripts/initscripts_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e90cde86972b7b0a4e2141860e6ba3627dd99b2c --- /dev/null +++ b/meta-openeuler/recipes-core/initscripts/initscripts_%.bbappend @@ -0,0 +1,42 @@ +# we use openeuler's config files + +FILESEXTRAPATHS_append := "${THISDIR}/files/:" + +SRC_URI += " \ + file://populate-openeuler-volatile.sh \ + file://openeuler-safety-volatiles \ + " + +do_install_append() { + install -d ${D}${sysconfdir}/default/openeuler-volatiles + install -m 0644 ${WORKDIR}/openeuler-safety-volatiles ${D}${sysconfdir}/default/openeuler-volatiles/00_core + install -m 0755 ${WORKDIR}/populate-openeuler-volatile.sh ${D}${sysconfdir}/init.d + #advice a low priority (99) to make it start later than any service and populate-volatile.sh + update-rc.d -r ${D} populate-openeuler-volatile.sh start 99 S . +} + +MASKED_SCRIPTS_append += " \ + populate-openeuler-volatile \ + " + +pkg_postinst_${PN}_append () { + # Delete any old volatile cache script, as directories may have moved + if [ -z "$D" ]; then + rm -f "/etc/openeuler-volatile.cache" + fi +} + + +# GPL2.patch will create COPYING file, but if S dir is not a clean +# dir, i.e., COPYING file is already there because of last build, +# do patch will fail. So we use prepend to fix this case. +# A better solution is not using GPL2.patch. +# This fix can be removed if the upstream poky fix this +do_patch_prepend () { + import os + + copyfile = os.path.join(d.getVar('S'),"COPYING") + if os.path.exists(copyfile): + os.remove(copyfile) + +} diff --git a/meta-openeuler/recipes-core/initscripts/initscripts_10.12.bb b/meta-openeuler/recipes-core/initscripts/initscripts_10.12.bb deleted file mode 100644 index a244999bda9083de535654fb518351f676a4e73b..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/initscripts/initscripts_10.12.bb +++ /dev/null @@ -1,75 +0,0 @@ -SUMMARY = "SysV init scripts" -HOMEPAGE = "https://github.com/fedora-sysv/initscripts" -DESCRIPTION = "Initscripts provide the basic system startup initialization scripts for the system. These scripts include actions such as filesystem mounting, fsck, RTC manipulation and other actions routinely performed at system startup. In addition, the scripts are also used during system shutdown to reverse the actions performed at startup." -SECTION = "base" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" -PR = "1" - -SRC_URI = "file://initscripts/initscripts-10.12.tar.gz \ - file://initscripts/backport-run-ifdown-on-all-interfaces.patch \ - file://initscripts/bugfix-initscripts-add-udev-wait-dependency-for-network.patch \ - file://initscripts/bugfix-mod-network-function-when-NM-unmanage-devices.patch \ - file://initscripts/bugfix-initscripts-set-PERSISTENT_DHCLIENT-default-to-yes.patch \ - file://initscripts/bugfix-network-need-chkconfig-on.patch \ - file://initscripts/bugfix-restart-network-warning.patch \ - file://initscripts/new-network-fork-to-start-dhcp.patch \ - file://initscripts/exec-udevadm-settle-when-network-start.patch \ - file://initscripts/remove-rename_device_lock-when-process-does-not-exis.patch \ -" -INHIBIT_DEFAULT_DEPS = "1" - -KERNEL_VERSION = "" - -DEPENDS_append = " update-rc.d-native" -PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}" - -PACKAGES =+ "${PN}-functions ${PN}-sushell" -RDEPENDS_${PN} = "initd-functions \ - ${@bb.utils.contains('DISTRO_FEATURES','selinux','${PN}-sushell','',d)} \ - " -#Recommend pn-functions so that it will be a preferred default provider for initd-functions -RRECOMMENDS_${PN} = "${PN}-functions" -RPROVIDES_${PN}-functions = "initd-functions" -RCONFLICTS_${PN}-functions = "lsbinitscripts" -FILES_${PN}-functions = "${sysconfdir}/init.d/functions*" -FILES_${PN}-sushell = "{base_sbindir}/sushell" - -HALTARGS ?= "-d -f" - -do_configure() { -} - -do_install () { -# -# Create directories and install device independent scripts -# - mkdir -p ${D}/etc/sysconfig/network-scripts - install ${S}/network-scripts/* ${D}/etc/sysconfig/network-scripts/ - - mkdir -p ${D}/etc/init.d - install -m 0750 ${S}/etc/rc.d/init.d/* ${D}/etc/init.d/ -} - -MASKED_SCRIPTS = "" - -pkg_postinst_${PN} () { - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - if [ -n "$D" ]; then - OPTS="--root=$D" - fi - for SERVICE in ${MASKED_SCRIPTS}; do - systemctl $OPTS mask $SERVICE.service - done - fi - - # Delete any old volatile cache script, as directories may have moved - if [ -z "$D" ]; then - rm -f "/etc/volatile.cache" - fi -} - -do_configure[noexec] = "1" -do_compile[noexec] = "1" - -CONFFILES_${PN} += "${sysconfdir}/init.d/checkroot.sh" diff --git a/meta-openeuler/recipes-core/iproute2/iproute2.inc b/meta-openeuler/recipes-core/iproute2/iproute2.inc deleted file mode 100644 index ba83686c2bd07ed1314a42734066bf349fba0abc..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/iproute2/iproute2.inc +++ /dev/null @@ -1,91 +0,0 @@ -SUMMARY = "TCP / IP networking and traffic control utilities" -DESCRIPTION = "Iproute2 is a collection of utilities for controlling \ -TCP / IP networking and traffic control in Linux. Of the utilities ip \ -and tc are the most important. ip controls IPv4 and IPv6 \ -configuration and tc stands for traffic control." -HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2" -SECTION = "base" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \ - file://ip/ip.c;beginline=3;endline=8;md5=689d691d0410a4b64d3899f8d6e31817" - -DEPENDS = "flex-native bison-native iptables libcap" - -inherit pkgconfig - -CLEANBROKEN = "1" - -PACKAGECONFIG ??= "elf" -PACKAGECONFIG[elf] = ",,elfutils," - -IPROUTE2_MAKE_SUBDIRS = "lib tc ip bridge misc genl ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc rdma', d)}" - -EXTRA_OEMAKE = "\ - CC='${CC}' \ - KERNEL_INCLUDE=${STAGING_INCDIR} \ - DOCDIR=${docdir}/iproute2 \ - SUBDIRS='${IPROUTE2_MAKE_SUBDIRS}' \ - SBINDIR='${base_sbindir}' \ - LIBDIR='${libdir}' \ -" - -do_configure_append () { - sh configure ${STAGING_INCDIR} - # Explicitly disable ATM support - sed -i -e '/TC_CONFIG_ATM/d' config.mk -} - -do_install () { - oe_runmake DESTDIR=${D} install - mv ${D}${base_sbindir}/ip ${D}${base_sbindir}/ip.iproute2 - install -d ${D}${datadir} - mv ${D}/share/* ${D}${datadir}/ || true - rm ${D}/share -rf || true -} - -# The .so files in iproute2-tc are modules, not traditional libraries -INSANE_SKIP_${PN}-tc = "dev-so" - -IPROUTE2_PACKAGES =+ "\ - ${PN}-devlink \ - ${PN}-genl \ - ${PN}-ifstat \ - ${PN}-ip \ - ${PN}-lnstat \ - ${PN}-nstat \ - ${PN}-rtacct \ - ${PN}-ss \ - ${PN}-tc \ - ${PN}-tipc \ - ${PN}-rdma \ - ${PN}-bash-completion \ -" - -PACKAGE_BEFORE_PN = "${IPROUTE2_PACKAGES}" -RDEPENDS_${PN} += "${PN}-ip" - -FILES_${PN}-bash-completion = "${datadir}/bash-completion/completions" - -FILES_${PN}-tc = "${base_sbindir}/tc* \ - ${libdir}/tc/*.so" -FILES_${PN}-lnstat = "${base_sbindir}/lnstat \ - ${base_sbindir}/ctstat \ - ${base_sbindir}/rtstat" -FILES_${PN}-ifstat = "${base_sbindir}/ifstat" -FILES_${PN}-ip = "${base_sbindir}/ip.${PN} ${sysconfdir}/iproute2" -FILES_${PN}-genl = "${base_sbindir}/genl" -FILES_${PN}-rtacct = "${base_sbindir}/rtacct" -FILES_${PN}-nstat = "${base_sbindir}/nstat" -FILES_${PN}-ss = "${base_sbindir}/ss" -FILES_${PN}-tipc = "${base_sbindir}/tipc" -FILES_${PN}-devlink = "${base_sbindir}/devlink" -FILES_${PN}-rdma = "${base_sbindir}/rdma" - -ALTERNATIVE_${PN}-ip = "ip" -ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}" -ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip" -ALTERNATIVE_PRIORITY = "100" - -ALTERNATIVE_${PN}-tc = "tc" -ALTERNATIVE_LINK_NAME[tc] = "${base_sbindir}/tc" -ALTERNATIVE_PRIORITY_${PN}-tc = "100" diff --git a/meta-openeuler/recipes-core/iproute2/iproute2_5.15.0.bb b/meta-openeuler/recipes-core/iproute2/iproute2_5.15.0.bb deleted file mode 100644 index 6eb766732371981e797fe24745d66ec75b2f6039..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/iproute2/iproute2_5.15.0.bb +++ /dev/null @@ -1,11 +0,0 @@ -require iproute2.inc - -SRC_URI = "file://iproute/${BP}.tar.xz \ - file://iproute/bugfix-iproute2-3.10.0-fix-maddr-show.patch \ - file://iproute/bugfix-iproute2-change-proc-to-ipnetnsproc-which-is-private.patch \ - " - -SRC_URI[sha256sum] = "56d7dcb05b564c94cf6e4549cec2f93f2dc58085355c08dcb2a8f8249c946080" - -# CFLAGS are computed in Makefile and reference CCOPTS -EXTRA_OEMAKE_append = " CCOPTS='${CFLAGS}'" diff --git a/meta-openeuler/recipes-core/iptables/iptables/ip6tables.service b/meta-openeuler/recipes-core/iptables/iptables/ip6tables.service deleted file mode 100644 index 6c059fca49b9d146138a1936fe81ea638e980708..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/iptables/iptables/ip6tables.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=IPv6 Packet Filtering Framework -Before=network-pre.target -Wants=network-pre.target - -[Service] -Type=oneshot -ExecStart=@SBINDIR@/ip6tables-restore -w -- @RULESDIR@/ip6tables.rules -ExecReload=@SBINDIR@/ip6tables-restore -w -- @RULESDIR@/ip6tables.rules -RemainAfterExit=yes - -[Install] -WantedBy=multi-user.target diff --git a/meta-openeuler/recipes-core/iptables/iptables/iptables.rules b/meta-openeuler/recipes-core/iptables/iptables/iptables.rules deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/meta-openeuler/recipes-core/iptables/iptables/iptables.service b/meta-openeuler/recipes-core/iptables/iptables/iptables.service deleted file mode 100644 index 0eb3c343de71535c67f47152526ec9e645565eca..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/iptables/iptables/iptables.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=IPv4 Packet Filtering Framework -Before=network-pre.target -Wants=network-pre.target - -[Service] -Type=oneshot -ExecStart=@SBINDIR@/iptables-restore -w -- @RULESDIR@/iptables.rules -ExecReload=@SBINDIR@/iptables-restore -w -- @RULESDIR@/iptables.rules -RemainAfterExit=yes - -[Install] -WantedBy=multi-user.target diff --git a/meta-openeuler/recipes-core/iptables/iptables_1.8.7.bb b/meta-openeuler/recipes-core/iptables/iptables_1.8.7.bb deleted file mode 100644 index a2fe0666ddc490941870208b96be8482c2d2794d..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/iptables/iptables_1.8.7.bb +++ /dev/null @@ -1,105 +0,0 @@ -SUMMARY = "Tools for managing kernel packet filtering capabilities" -DESCRIPTION = "iptables is the userspace command line program used to configure and control network packet \ -filtering code in Linux." -HOMEPAGE = "http://www.netfilter.org/" -BUGTRACKER = "http://bugzilla.netfilter.org/" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc \ -" -SRC_URI = "file://iptables/iptables-${PV}.tar.bz2 \ - file://iptables/bugfix-add-check-fw-in-entry.patch \ - file://iptables.service \ - file://iptables.rules \ - file://ip6tables.service \ - file://ip6tables.rules \ - " -SRC_URI[sha256sum] = "c109c96bb04998cd44156622d36f8e04b140701ec60531a10668cfdff5e8d8f0" - -SYSTEMD_SERVICE_${PN} = "\ - iptables.service \ - ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', 'ip6tables.service', '', d)} \ -" - -inherit autotools pkgconfig systemd - -EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR}" - -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" -PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," - -# libnftnl recipe is in meta-networking layer(previously known as libnftables) -PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl" - -do_configure_prepend() { - # Remove some libtool m4 files - # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive. - rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 -} - -IPTABLES_RULES_DIR ?= "${sysconfdir}/${BPN}" - -do_install_append() { - install -d ${D}${IPTABLES_RULES_DIR} - install -m 0644 ${WORKDIR}/iptables.rules ${D}${IPTABLES_RULES_DIR} - - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_system_unitdir} - - sed -i \ - -e 's,@SBINDIR@,${sbindir},g' \ - -e 's,@RULESDIR@,${IPTABLES_RULES_DIR},g' \ - ${D}${systemd_system_unitdir}/iptables.service - - if ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', 'true', 'false', d)} ; then - install -m 0644 ${WORKDIR}/ip6tables.rules ${D}${IPTABLES_RULES_DIR} - install -m 0644 ${WORKDIR}/ip6tables.service ${D}${systemd_system_unitdir} - - sed -i \ - -e 's,@SBINDIR@,${sbindir},g' \ - -e 's,@RULESDIR@,${IPTABLES_RULES_DIR},g' \ - ${D}${systemd_system_unitdir}/ip6tables.service - fi -} - -PACKAGES =+ "${PN}-modules ${PN}-apply" -PACKAGES_DYNAMIC += "^${PN}-module-.*" - -python populate_packages_prepend() { - modules = do_split_packages(d, '${libdir}/xtables', r'lib(.*)\.so$', '${PN}-module-%s', '${PN} module %s', extra_depends='') - if modules: - metapkg = d.getVar('PN') + '-modules' - d.appendVar('RDEPENDS_' + metapkg, ' ' + ' '.join(modules)) -} - -RDEPENDS_${PN} = "${PN}-module-xt-standard" -RRECOMMENDS_${PN} = " \ - ${PN}-modules \ - kernel-module-x-tables \ - kernel-module-ip-tables \ - kernel-module-iptable-filter \ - kernel-module-iptable-nat \ - kernel-module-nf-defrag-ipv4 \ - kernel-module-nf-conntrack \ - kernel-module-nf-conntrack-ipv4 \ - kernel-module-nf-nat \ - kernel-module-ipt-masquerade \ - ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', '\ - kernel-module-ip6table-filter \ - kernel-module-ip6-tables \ - ', '', d)} \ -" - -FILES_${PN} += "${datadir}/xtables" - -FILES_${PN}-apply = "${sbindir}/ip*-apply" -RDEPENDS_${PN}-apply = "${PN}" - -# Include the symlinks as well in respective packages -FILES_${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so" -FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so" - -ALLOW_EMPTY_${PN}-modules = "1" - -INSANE_SKIP_${PN}-module-xt-conntrack = "dev-so" -INSANE_SKIP_${PN}-module-xt-ct = "dev-so" diff --git a/meta-openeuler/recipes-core/isulad/files/compile-error-fix.patch b/meta-openeuler/recipes-core/isulad/files/compile-error-fix.patch new file mode 100644 index 0000000000000000000000000000000000000000..d6371be01ff36c97b210842423659a8e53431517 --- /dev/null +++ b/meta-openeuler/recipes-core/isulad/files/compile-error-fix.patch @@ -0,0 +1,79 @@ +diff --git a/src/client/connect/protocol_type.c b/src/client/connect/protocol_type.c +index d77e088..79b699b 100644 +--- a/src/client/connect/protocol_type.c ++++ b/src/client/connect/protocol_type.c +@@ -72,7 +72,7 @@ int isula_filters_last_parse_args(size_t last_n, struct isula_filters **flt) + goto cleanup; + } + +- ret = snprintf(value, VALUE_SIZE, "%ld", last_n); ++ ret = snprintf(value, VALUE_SIZE, "%zu", last_n); + if (ret < 0 || ret >= VALUE_SIZE) { + ret = -1; + ERROR("Sprintf lastest n containers args failed"); +diff --git a/src/daemon/modules/service/service_network.c b/src/daemon/modules/service/service_network.c +index 2e7fa28..9bacdd8 100644 +--- a/src/daemon/modules/service/service_network.c ++++ b/src/daemon/modules/service/service_network.c +@@ -698,7 +698,7 @@ static int update_container_networks_info(const network_api_result_list *result, + } + + if (result->len != networks->len) { +- ERROR("result len %lu doesn't match networks len %lu", result->len, networks->len); ++ ERROR("result len %zu doesn't match networks len %zu", result->len, networks->len); + return -1; + } + +diff --git a/src/utils/cutils/utils_port.c b/src/utils/cutils/utils_port.c +index 583a350..236c433 100644 +--- a/src/utils/cutils/utils_port.c ++++ b/src/utils/cutils/utils_port.c +@@ -18,6 +18,9 @@ + #include + #include + #include ++#include ++ ++#define __STDC_FORMAT_MACROS + + #include + +@@ -192,7 +195,7 @@ char *util_pack_port_proto(uint64_t port, const char *proto) + return NULL; + } + +- ret = snprintf(port_proto, MAX_BUFFER_SIZE, "%lu/%s", port, proto); ++ ret = snprintf(port_proto, MAX_BUFFER_SIZE, "%" PRIu64 "/%s", port, proto); + if (ret < 0 || (size_t)ret >= MAX_BUFFER_SIZE) { + return NULL; + } +@@ -279,7 +282,7 @@ static int process_range_to_range(ports_t port_data, const char *raw_ip, struct + char format_host_port[MAX_BUFFER_SIZE] = { 0 }; + int nret = 0; + +- nret = snprintf(format_host_port, MAX_BUFFER_SIZE, "%lu", port_data.start_hport + i); ++ nret = snprintf(format_host_port, MAX_BUFFER_SIZE, "%" PRIu64, port_data.start_hport + i); + if (nret < 0 || (size_t)nret >= MAX_BUFFER_SIZE) { + ERROR("Format print host port err"); + ret = -1; +@@ -826,7 +829,7 @@ out: + static bool valid_port(uint64_t port) + { + if (port < 1 || port > 65535) { +- ERROR("Port numbers must be between 1 and 65535 (inclusive), got %lu", port); ++ ERROR("Port numbers must be between 1 and 65535 (inclusive), got %" PRIu64, port); + return false; + } + +@@ -926,9 +929,9 @@ bool util_new_network_port(const char *proto, const char *port, struct network_p + } + + if (work->start == work->end) { +- ret = sprintf(buff, "%zu/%s", work->start, proto) > 0; ++ ret = sprintf(buff, "%" PRIu64 "/%s", work->start, proto) > 0; + } else { +- ret = sprintf(buff, "%zu-%zu/%s", work->start, work->end, proto) > 0; ++ ret = sprintf(buff, "%" PRIu64 "-%" PRIu64 "/%s", work->start, work->end, proto) > 0; + } + if (!ret) { + ERROR("format port failed"); diff --git a/meta-openeuler/recipes-core/isulad/isulad_2.1.1.bb b/meta-openeuler/recipes-core/isulad/isulad_2.1.1.bb new file mode 100644 index 0000000000000000000000000000000000000000..29eead6a552a89b7cd1946e63c8534479a31ac6c --- /dev/null +++ b/meta-openeuler/recipes-core/isulad/isulad_2.1.1.bb @@ -0,0 +1,91 @@ +SUMMARY = "A lightweight C++/C based container runtime daemon" +DESCRIPTION = "iSulad is a lightweight container runtime daemon which is designed for IOT and \ + Cloud infrastructure.iSulad has the characteristics of light, fast and not limited \ + by hardware specifications and architecture, and can be applied more widely" +HOMEPAGE = "https://gitee.com/openeuler/iSulad" +LICENSE = "MulanPSLv2" + +LIC_FILES_CHKSUM = "file://LICENSES/LICENSE;md5=1acb172ffd3d252285dd1b8b8459941e" + +OPENEULER_REPO_NAME = "iSulad" + +SRC_URI = "file://v${PV}.tar.gz \ + file://0001-modify-dependence-from-lcr-to-libisula.patch \ + file://0002-Add-unified-memory_swap_limit_in_bytes-fields-into-C.patch \ + file://0003-Add-macro-for-protoc-cmake.patch \ + file://0004-fix-design-typo.patch \ + file://0005-fix-cpu-rt-review-comments.patch \ + file://0006-fix-inspect.sh-failed.patch \ + file://0007-add-CRI-ContainerStats-Service.patch \ + file://0008-fix-isula-cpu-rt-CI.patch \ + file://0009-fix-cpu-rt-CI.patch \ + file://0010-fix-cpu-rt-CI.patch \ + file://0011-Bugfix-in-config-and-executor.patch \ + file://0012-fix-cpu-rt-disable-after-reboot-machine.patch \ + file://0013-fix-selinux_label_ut-timeout-and-add-timeout-for-all.patch \ + file://0014-add-retry-for-read-write.patch \ + file://0015-support-pull-image-with-digest.patch \ + file://0016-isulad-shim-support-execSync-with-timeout.patch \ + file://0017-Refine-the-commit-info.patch \ + file://0018-Refine-typo-of-word-container.patch \ + file://0019-cleancode-for-read-write.patch \ + file://0020-add-crictl-timeout-and-sync-for-CI.patch \ + file://0021-unlock-m_podsLock-if-new-failed.patch \ + file://0022-Update-CRI.patch \ + file://0023-add-cgroup-cpu-ut.patch \ + file://0024-remove-temp-variables.patch \ + file://0025-fix-read-member-error-from-struct.patch \ + file://0026-Fix-PR-runc.patch \ + file://0027-allow-the-paused-container-to-be-stopped.patch \ + file://0028-Refine.patch \ + file://0029-support-isula-update-when-runtime-is-runc.patch \ + file://0030-Refine-as-others-feedback.patch \ + file://0031-fix-CRI-SetupPod-and-TearDownPod-deadlock.patch \ + file://0032-remote-layer-store-demo.patch \ + file://0033-add-ci-for-remote-ro.patch \ + file://0034-change-sleep-to-usleep-to-avoid-lossing-of-accuracy.patch \ + file://0035-fix-compile-error-when-not-enable-remote-ro.patch \ + file://0036-adapt-to-repo-of-openeuler-url-changed.patch \ + file://0037-change-goto-branch.patch \ + file://0038-CI-not-enable-remote-ro-for-ut.patch \ + file://0039-use-auto-free-to-proc_t.patch \ + file://0040-modifying-cpurt-file-permissions.patch \ + file://0041-use-CURLOPT_XFERINFOFUNCTION-instead-of-deprecated-C.patch \ + file://0042-bugfix-remote-ro-try-add-or-remove-image-layer-twice.patch \ + file://0043-bugfix-can-t-delete-layers-under-dir-overlay-layers.patch \ +" + +SRC_URI_append = "file://compile-error-fix.patch" + +S = "${WORKDIR}/iSulad-v${PV}" + +inherit cmake +OECMAKE_GENERATOR = "Unix Makefiles" + +DEPENDS = "yajl zlib libarchive http-parser curl lcr libevent libevhtp openssl libwebsockets libdevmapper" + +EXTRA_OECMAKE = "-DENABLE_GRPC=OFF -DENABLE_SYSTEMD_NOTIFY=OFF -DENABLE_SELINUX=OFF \ + -DENABLE_SHIM_V2=OFF -DENABLE_OPENSSL_VERIFY=OFF \ + -DGRPC_CONNECTOR=OFF -DDISABLE_OCI=ON \ + " + +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" + +FILES_${PN} += "${libdir}/* " +#remove so from ${PN}-dev +FILES_SOLIBSDEV = "" + +do_configure_prepend() { + grep -q CMAKE_SYSROOT ${WORKDIR}/toolchain.cmake || cat >> ${WORKDIR}/toolchain.cmake < -# Released under the MIT license (see COPYING.MIT for the terms) - -SUMMARY = "Tools for managing Linux kernel modules" -DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \ - insert, remove, list, check properties, resolve dependencies and aliases." -HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kmod/" -LICENSE = "GPL-2.0+ & LGPL-2.1+" -LICENSE_libkmod = "LGPL-2.1+" -SECTION = "base" - -LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ - file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ - file://tools/COPYING;md5=751419260aa954499f7abaabaa882bbe \ - " -inherit autotools pkgconfig manpages - -SRC_URI = "file://kmod/${BP}.tar.xz \ - file://kmod/0001-libkmod-module-check-new_from_name-return-value-in-g.patch \ - file://kmod/0002-Module-replace-the-module-with-new-module.patch \ - file://kmod/0003-Module-suspend-the-module-by-rmmod-r-option.patch \ - file://kmod/0004-don-t-check-module-s-refcnt-when-rmmod-with-r.patch \ - file://depmod-search.conf \ - " -SRC_URI[sha256sum] = "0b80eea7aa184ac6fd20cafa2a1fdf290ffecc70869a797079e2cc5c6225a52a" - -EXTRA_OECONF +=" --enable-tools --with-zlib" - -PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" -PACKAGECONFIG[logging] = " --enable-logging,--disable-logging" -PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native" -PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz" -PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl" - -GTKDOC_DOCDIR = "${S}/libkmod/docs" diff --git a/meta-openeuler/recipes-core/kmod/kmod/depmod-search.conf b/meta-openeuler/recipes-core/kmod/kmod/depmod-search.conf deleted file mode 100644 index 527c0bb6eeb535bc8ed160b83e2b6f8487ec2c1c..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/kmod/kmod/depmod-search.conf +++ /dev/null @@ -1,6 +0,0 @@ -# -# /etc/depmod.d/depmod.conf -# - -search updates extramodules built-in - diff --git a/meta-openeuler/recipes-core/kmod/kmod/run-ptest b/meta-openeuler/recipes-core/kmod/kmod/run-ptest deleted file mode 100755 index 598dd2cb5fbad194a135e5d06601847e00df1586..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/kmod/kmod/run-ptest +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -touch testsuite/stamp-rootfs -tar xf testmodule.tar -make -k runtest-TESTS 2>/dev/null| grep -e ^PASS -e ^FAIL -find testsuite -name *.ko -exec rm -f {} \; diff --git a/meta-openeuler/recipes-core/kmod/kmod_29.bb b/meta-openeuler/recipes-core/kmod/kmod_29.bb deleted file mode 100644 index 5ab65d6e8be576b539c5500d1fee93ef23aae53e..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/kmod/kmod_29.bb +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 2012 Khem Raj -# Released under the MIT license (see COPYING.MIT for the terms) - -require kmod.inc - -DEPENDS += "zlib" -PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" -RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" -RCONFLICTS_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" -RREPLACES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" - -# to force user to remove old module-init-tools and replace them with kmod variants -RCONFLICTS_libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" - -# autotools set prefix to /usr, however we want them in /bin and /sbin -EXTRA_OECONF += " --bindir=${base_bindir} --sbindir=${base_sbindir}" - -do_install_append () { - install -dm755 ${D}${base_bindir} - install -dm755 ${D}${base_sbindir} - # add symlinks to kmod - lnr ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod - for tool in insmod rmmod depmod modinfo modprobe; do - lnr ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool} - done - # configuration directories - install -dm755 ${D}${base_libdir}/depmod.d - install -dm755 ${D}${base_libdir}/modprobe.d - install -dm755 ${D}${sysconfdir}/depmod.d - install -dm755 ${D}${sysconfdir}/modprobe.d - - # install depmod.d file for search/ dir - install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf" -} - -do_compile_prepend() { - sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status -} - -ALTERNATIVE_PRIORITY = "70" - -ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod" - -ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod" -ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe" -ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod" -ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo" -ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod" - -ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod" -ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}" - -ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod" - -PACKAGES =+ "${PN}-bash-completion libkmod" - -FILES_${PN}-bash-completion = "${datadir}/bash-completion/completions" -FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" -FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d" - -BBCLASSEXTEND = "nativesdk" diff --git a/meta-openeuler/recipes-core/lcr/lcr_2.0.7.bb b/meta-openeuler/recipes-core/lcr/lcr_2.1.1.bb similarity index 65% rename from meta-openeuler/recipes-core/lcr/lcr_2.0.7.bb rename to meta-openeuler/recipes-core/lcr/lcr_2.1.1.bb index 00dedc84583d2c491f7e31174cca4fa4adc31895..c4f29a122178adc7dd0950c84b4c9d15cee1eae5 100644 --- a/meta-openeuler/recipes-core/lcr/lcr_2.0.7.bb +++ b/meta-openeuler/recipes-core/lcr/lcr_2.1.1.bb @@ -14,8 +14,15 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;m inherit cmake ### Build metadata -SRC_URI = "file://lcr/v${PV}.tar.gz \ - file://lcr/0001-parse-userns-remap-in-daemmon.json.patch \ +SRC_URI = "file://v${PV}.tar.gz \ + file://0001-add-libisula.pc.patch \ + file://0002-add-unified-and-memory_swap_limit_in_bytes-into-host.patch \ + file://0003-fix-update-cpu-rt-period-failed.patch \ + file://0004-fix-writing-config-line-with-wrong-length.patch \ + file://0005-Add-memory-related-fields.patch \ + file://0006-mod-headers.patch \ + file://0007-add-cgroup-resources-json-schema-for-isula-update.patch \ + file://0008-add-field-for-isulad-daemon-configs.patch \ " S = "${WORKDIR}/${BPN}-v${PV}" @@ -29,6 +36,7 @@ INHIBIT_PACKAGE_DEBUG_SPLIT = "1" #remove so from ${PN}-dev FILES_SOLIBSDEV = "" FILES_${PN} += "${libdir}/* " +FILES_${PN}-staticdev_riscv64 += "${libdir}/*.a" ### Tasks for package do_configure_prepend() { @@ -40,7 +48,9 @@ EOF do_install_append() { [[ "${libdir}" != "/usr/lib" ]] || return 0 if test -d ${D}/usr/lib; then - mv ${D}/usr/lib ${D}/${libdir} + install -d ${D}/${libdir} + mv ${D}/usr/lib/* ${D}/${libdir} + rm -rf ${D}/usr/lib/ fi if test -d ${D}/usr/local/include ; then mv ${D}/usr/local/include ${D}/${includedir} diff --git a/meta-openeuler/recipes-core/less/less_590.bb b/meta-openeuler/recipes-core/less/less_590.bb deleted file mode 100644 index 2f65a251b26fdcbc8e83782ab806d8b813f999aa..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/less/less_590.bb +++ /dev/null @@ -1,42 +0,0 @@ -SUMMARY = "Text file viewer similar to more" -DESCRIPTION = "Less is a program similar to more, i.e. a terminal \ -based program for viewing text files and the output from other \ -programs. Less offers many features beyond those that more does." -HOMEPAGE = "http://www.greenwoodsoftware.com/" -SECTION = "console/utils" - -# (GPLv2+ (<< 418), GPLv3+ (>= 418)) | less -# Including email author giving permissing to use BSD -# -# From: Mark Nudelman -# To: Elizabeth Flanagan ${S}/acinclude.m4 - fi - sed -i -e's,^V_RPATH_OPT=.*$,V_RPATH_OPT=,' ${S}/pcap-config.in -} - -BBCLASSEXTEND = "native" diff --git a/meta-openeuler/recipes-core/libpcre/libpcre/Makefile b/meta-openeuler/recipes-core/libpcre/libpcre/Makefile deleted file mode 100644 index 708d807d0850e4e8b0294ee027a63710e8eb6955..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/libpcre/libpcre/Makefile +++ /dev/null @@ -1,183 +0,0 @@ -TESTS = pcre_stringpiece_unittest RunTest RunGrepTest -subdir = . -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__tty_colors_dummy = \ - mgn= red= grn= lgn= blu= brg= std=; \ - am__color_tests=no -am__tty_colors = { \ - $(am__tty_colors_dummy); \ - if test "X$(AM_COLOR_TESTS)" = Xno; then \ - am__color_tests=no; \ - elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ - am__color_tests=yes; \ - elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ - am__color_tests=yes; \ - fi; \ - if test $$am__color_tests = yes; then \ - red=''; \ - grn=''; \ - lgn=''; \ - blu=''; \ - mgn=''; \ - brg=''; \ - std=''; \ - fi; \ -} -am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } -am__sh_e_setup = case $$- in *e*) set +e;; esac -am__common_driver_flags = \ - --color-tests "$$am__color_tests" \ - --enable-hard-errors "$$am__enable_hard_errors" \ - --expect-failure "$$am__expect_failure" -am__check_pre = \ -$(am__sh_e_setup); \ -$(am__vpath_adj_setup) $(am__vpath_adj) \ -$(am__tty_colors); \ -srcdir=$(srcdir); export srcdir; \ -case "$@" in \ - */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ - *) am__odir=.;; \ -esac; \ -test "x$$am__odir" = x"." || test -d "$$am__odir" \ - || $(MKDIR_P) "$$am__odir" || exit $$?; \ -if test -f "./$$f"; then dir=./; \ -elif test -f "$$f"; then dir=; \ -else dir="$(srcdir)/"; fi; \ -tst=$$dir$$f; log='$@'; \ -if test -n '$(DISABLE_HARD_ERRORS)'; then \ - am__enable_hard_errors=no; \ -else \ - am__enable_hard_errors=yes; \ -fi; -am__set_TESTS_bases = \ - bases='$(TEST_LOGS)'; \ - bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ - bases=`echo $$bases` -RECHECK_LOGS = $(TEST_LOGS) -TEST_SUITE_LOG = test-suite.log -TEST_EXTENSIONS = .test -LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver -am__test_logs1 = $(TESTS:=.log) -am__test_logs2 = $(am__test_logs1:.log=.log) -TEST_LOGS = $(am__test_logs2:.test.log=.log) -MKDIR_P = /bin/mkdir -p -PACKAGE_STRING = PCRE 8.36 -SHELL = /bin/sh -srcdir = . -top_srcdir = . -$(TEST_SUITE_LOG): $(TEST_LOGS) - @$(am__set_TESTS_bases); \ - am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ - redo_bases=`for i in $$bases; do \ - am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ - done`; \ - st=0; \ - errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ - for i in $$redo_bases; do \ - test -f $$i.trs && test -r $$i.trs \ - || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ - test -f $$i.log && test -r $$i.log \ - || { echo "$$errmsg $$i.log" >&2; st=1; }; \ - done; \ - test $$st -eq 0 || exit 1; - @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ - ws='[ ]'; \ - results=`for b in $$bases; do echo $$b.trs; done`; \ - test -n "$$results" || results=/dev/null; \ - all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ - pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ - fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ - skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ - xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ - xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ - error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ - if test `expr $$fail + $$xpass + $$error` -eq 0; then \ - success=true; \ - else \ - success=false; \ - fi; \ - br='==================='; br=$$br$$br$$br$$br; \ - result_count () \ - { \ - if test x"$$1" = x"--maybe-color"; then \ - maybe_colorize=yes; \ - elif test x"$$1" = x"--no-color"; then \ - maybe_colorize=no; \ - else \ - echo "$@: invalid 'result_count' usage" >&2; exit 4; \ - fi; \ - shift; \ - desc=$$1 count=$$2; \ - if test $$maybe_colorize = yes && test $$count -gt 0; then \ - color_start=$$3 color_end=$$std; \ - else \ - color_start= color_end=; \ - fi; \ - echo "$${color_start}# $$desc $$count$${color_end}"; \ - }; \ - create_testsuite_report () \ - { \ - result_count $$1 "TOTAL:" $$all "$$brg"; \ - result_count $$1 "PASS: " $$pass "$$grn"; \ - result_count $$1 "SKIP: " $$skip "$$blu"; \ - result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ - result_count $$1 "FAIL: " $$fail "$$red"; \ - result_count $$1 "XPASS:" $$xpass "$$red"; \ - result_count $$1 "ERROR:" $$error "$$mgn"; \ - }; \ - { \ - echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ - $(am__rst_title); \ - create_testsuite_report --no-color; \ - echo; \ - echo ".. contents:: :depth: 2"; \ - echo; \ - for b in $$bases; do echo $$b; done; \ - } >$(TEST_SUITE_LOG).tmp || exit 1; \ - mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ - if $$success; then \ - col="$$grn"; \ - else \ - col="$$red"; \ - test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ - fi; \ - echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ - echo "$${col}$$br$${std}"; \ - create_testsuite_report --maybe-color; \ - echo "$$col$$br$$std"; \ - if $$success; then :; else \ - echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ - echo "$$col$$br$$std"; \ - fi; \ - $$success || exit 1 -check-TESTS: - @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list - @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) - @set +e; $(am__set_TESTS_bases); \ - log_list=`for i in $$bases; do echo $$i.log; done`; \ - log_list=`echo $$log_list`; \ - $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ - exit $$?; -pcre_stringpiece_unittest.log: pcre_stringpiece_unittest$(EXEEXT) - @p='pcre_stringpiece_unittest$(EXEEXT)'; \ - b='pcre_stringpiece_unittest'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) -- "$$tst" -RunTest.log: RunTest - @p='RunTest'; \ - b='RunTest'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) -- "$$tst" -RunGrepTest.log: RunGrepTest - @p='RunGrepTest'; \ - b='RunGrepTest'; \ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) -- "$$tst" diff --git a/meta-openeuler/recipes-core/libpcre/libpcre/run-ptest b/meta-openeuler/recipes-core/libpcre/libpcre/run-ptest deleted file mode 100644 index 990d4a12ad67df8b1492914e80fd0281393469da..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/libpcre/libpcre/run-ptest +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -make check-TESTS diff --git a/meta-openeuler/recipes-core/libpcre/libpcre_8.45.bb b/meta-openeuler/recipes-core/libpcre/libpcre_8.45.bb deleted file mode 100644 index a83d9c6c63fee19525819ce39064b22d9502b02f..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/libpcre/libpcre_8.45.bb +++ /dev/null @@ -1,74 +0,0 @@ -DESCRIPTION = "The PCRE library is a set of functions that implement regular \ -expression pattern matching using the same syntax and semantics as Perl 5. PCRE \ -has its own native API, as well as a set of wrapper functions that correspond \ -to the POSIX regular expression API." -SUMMARY = "Perl Compatible Regular Expressions" -HOMEPAGE = "http://www.pcre.org" -SECTION = "devel" -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENCE;md5=b5d5d1a69a24ea2718263f1ff85a1c58" -SRC_URI = "file://pcre/pcre-${PV}.tar.bz2 \ - file://run-ptest \ - file://Makefile \ - " - -SRC_URI[md5sum] = "4452288e6a0eefb2ab11d36010a1eebb" -SRC_URI[sha256sum] = "4dae6fdcd2bb0bb6c37b5f97c33c2be954da743985369cddac3546e3218bffb8" - -CVE_PRODUCT = "pcre" - -S = "${WORKDIR}/pcre-${PV}" - -PROVIDES += "pcre" -DEPENDS += "bzip2 zlib" - -PACKAGECONFIG ??= "pcre8 unicode-properties jit" - -PACKAGECONFIG[pcre8] = "--enable-pcre8,--disable-pcre8" -PACKAGECONFIG[pcre16] = "--enable-pcre16,--disable-pcre16" -PACKAGECONFIG[pcre32] = "--enable-pcre32,--disable-pcre32" -PACKAGECONFIG[pcretest-readline] = "--enable-pcretest-libreadline,--disable-pcretest-libreadline,readline," -PACKAGECONFIG[unicode-properties] = "--enable-unicode-properties,--disable-unicode-properties" -PACKAGECONFIG[jit] = "--enable-jit=auto,--disable-jit" - -BINCONFIG = "${bindir}/pcre-config" - -inherit autotools binconfig-disabled ptest - -EXTRA_OECONF = "--enable-utf" - -PACKAGES =+ "libpcrecpp libpcreposix pcregrep pcregrep-doc pcretest pcretest-doc" - -SUMMARY_libpcrecpp = "${SUMMARY} - C++ wrapper functions" -SUMMARY_libpcreposix = "${SUMMARY} - C wrapper functions based on the POSIX regex API" -SUMMARY_pcregrep = "grep utility that uses perl 5 compatible regexes" -SUMMARY_pcregrep-doc = "grep utility that uses perl 5 compatible regexes - docs" -SUMMARY_pcretest = "program for testing Perl-comatible regular expressions" -SUMMARY_pcretest-doc = "program for testing Perl-comatible regular expressions - docs" - -FILES_libpcrecpp = "${libdir}/libpcrecpp.so.*" -FILES_libpcreposix = "${libdir}/libpcreposix.so.*" -FILES_pcregrep = "${bindir}/pcregrep" -FILES_pcregrep-doc = "${mandir}/man1/pcregrep.1" -FILES_pcretest = "${bindir}/pcretest" -FILES_pcretest-doc = "${mandir}/man1/pcretest.1" - -BBCLASSEXTEND = "native nativesdk" - -do_install_ptest() { - t=${D}${PTEST_PATH} - cp ${WORKDIR}/Makefile $t - cp -r ${S}/testdata $t - for i in pcre_stringpiece_unittest pcregrep pcretest; \ - do cp ${B}/.libs/$i $t; \ - done - for i in RunTest RunGrepTest test-driver; \ - do cp ${S}/$i $t; \ - done - # Skip the fr_FR locale test. If the locale fr_FR is found, it is tested. - # If not found, the test is skipped. The test program assumes fr_FR is non-UTF-8 - # locale so the test fails if fr_FR is UTF-8 locale. - sed -i -e 's:do3=yes:do3=no:g' ${D}${PTEST_PATH}/RunTest -} - -RDEPENDS_${PN}-ptest += "make" diff --git a/meta-openeuler/recipes-core/libpwquality/libpwquality_1.4.4.bb b/meta-openeuler/recipes-core/libpwquality/libpwquality_1.4.4.bb deleted file mode 100644 index 71f88f5a16cd41092852d61b04180b23f5033364..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/libpwquality/libpwquality_1.4.4.bb +++ /dev/null @@ -1,37 +0,0 @@ -DESCRIPTION = "Library for password quality checking and generating random passwords" -HOMEPAGE = "https://github.com/libpwquality/libpwquality" -SECTION = "devel/lib" -LICENSE = "GPLv2" - -PARALLEL_MAKE = "-j 1" - -LIC_FILES_CHKSUM = "file://COPYING;md5=6bd2f1386df813a459a0c34fde676fc2" - -SRC_URI = "file://libpwquality/${BP}.tar.bz2 \ - file://libpwquality/modify-pwquality_conf.patch \ - file://libpwquality/fix-password-similarity.patch \ -" - -DEPENDS = "cracklib" - -inherit autotools gettext - -export PYTHON_DIR -export BUILD_SYS -export HOST_SYS - -EXTRA_OECONF += "--enable-python-bindings=no \ - --libdir=${base_libdir} \ -" - -do_install_append() { - rm -r ${D}/${base_libdir}/pkgconfig -} - -PACKAGECONFIG ??= "pam" -PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam" -FILES_${PN} += "${base_libdir}/security/pam_pwquality.so" -FILES_${PN}-dbg += "${base_libdir}/security/.debug" -FILES_${PN}-staticdev += "${base_libdir}/security/pam_pwquality.a" -FILES_${PN}-dev += "${base_libdir}/security/pam_pwquality.la" - diff --git a/meta-openeuler/recipes-core/libseccomp/libseccomp_%.bbappend b/meta-openeuler/recipes-core/libseccomp/libseccomp_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..c5920ee4f3d55fb144061cbaaa12e87eda1bf4ca --- /dev/null +++ b/meta-openeuler/recipes-core/libseccomp/libseccomp_%.bbappend @@ -0,0 +1,6 @@ +# meta-openeuler/recipes-core/libseccomp/libseccomp_2.5.3.bb + +PV = "2.5.4" + +SRC_URI_prepend = "file://backport-arch-disambiguate-in-arch-syscall-validate.patch \ +" \ No newline at end of file diff --git a/meta-openeuler/recipes-core/libtirpc/libtirpc_1.3.2.bb b/meta-openeuler/recipes-core/libtirpc/libtirpc_1.3.2.bb deleted file mode 100644 index c4d06b5055c2c888cca24803a2743013fd4e5dd7..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/libtirpc/libtirpc_1.3.2.bb +++ /dev/null @@ -1,27 +0,0 @@ -SUMMARY = "Transport-Independent RPC library" -DESCRIPTION = "Libtirpc is a port of Suns Transport-Independent RPC library to Linux" -SECTION = "libs/network" -HOMEPAGE = "http://sourceforge.net/projects/libtirpc/" -BUGTRACKER = "http://sourceforge.net/tracker/?group_id=183075&atid=903784" -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://COPYING;md5=f835cce8852481e4b2bbbdd23b5e47f3 \ - file://src/netname.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24" - -PROVIDES = "virtual/librpc" - -SRC_URI = "file://libtirpc/libtirpc-${PV}.tar.bz2 \ - file://libtirpc/0001-update-libtirpc-to-enable-tcp-port-listening.patch \ -" -UPSTREAM_CHECK_URI = "https://gitee.com/src-openeuler/libtirpc" -UPSTREAM_CHECK_REGEX = "(?P\d+(\.\d+)+)/" -SRC_URI[sha256sum] = "245895caf066bec5e3d4375942c8cb4366adad184c29c618d97f724ea309ee17" - -inherit autotools pkgconfig - -EXTRA_OECONF = "--disable-gssapi" - -do_install_append() { - chown root:root ${D}${sysconfdir}/netconfig -} - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/libusb/libusb1/run-ptest b/meta-openeuler/recipes-core/libusb/libusb1/run-ptest deleted file mode 100755 index eaa47a2bc4f074dc3e68b680b64045e992ff935c..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/libusb/libusb1/run-ptest +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -echo -echo "---------------------------- libusb1 tests ---------------------------" -echo - -./stress | { \ -while read -r str -do - echo "$str" - if [ "${str#*Starting test run:}" != "$str" ] - then - name="${str#Starting test run: }" - name="${name%...}" - else - case "$str" in - "Success (0)") - echo "PASS: $name" - ;; - "Failure (1)" | "Error (2)") - echo "FAIL: $name" - ;; - "Skip (3)") - echo "SKIP: $name" - ;; - esac - fi -done -} diff --git a/meta-openeuler/recipes-core/libusb/libusb1_1.0.24.bb b/meta-openeuler/recipes-core/libusb/libusb1_1.0.24.bb deleted file mode 100644 index 3353b0c7024f7f5897b0c43226d39450b9ff0d11..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/libusb/libusb1_1.0.24.bb +++ /dev/null @@ -1,45 +0,0 @@ -SUMMARY = "Userspace library to access USB (version 1.0)" -DESCRIPTION = "A cross-platform library to access USB devices from Linux, \ -macOS, Windows, OpenBSD/NetBSD, Haiku and Solaris userspace." -HOMEPAGE = "http://libusb.sf.net" -BUGTRACKER = "http://www.libusb.org/report" -SECTION = "libs" - -LICENSE = "LGPLv2.1+" -LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" - -BBCLASSEXTEND = "native nativesdk" - -SRC_URI = "file://libusbx/libusb-${PV}.tar.bz2 \ - file://run-ptest \ - " - -SRC_URI[sha256sum] = "7efd2685f7b327326dcfb85cee426d9b871fd70e22caa15bb68d595ce2a2b12a" - -S = "${WORKDIR}/libusb-${PV}" - -inherit autotools pkgconfig ptest - -PACKAGECONFIG-class-target ??= "" -PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev" - -EXTRA_OECONF = "--libdir=${base_libdir} --disable-udev" - -do_install_append() { - install -d ${D}${libdir} - if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then - mv ${D}${base_libdir}/pkgconfig ${D}${libdir} - fi -} - -do_compile_ptest() { - oe_runmake -C tests stress -} - -do_install_ptest() { - install -m 755 ${B}/tests/.libs/stress ${D}${PTEST_PATH} -} - -FILES_${PN} += "${base_libdir}/*.so.*" - -FILES_${PN}-dev += "${base_libdir}/*.so ${base_libdir}/*.la" diff --git a/meta-openeuler/recipes-core/libwebsockets/libwebsockets_4.3.0.bb b/meta-openeuler/recipes-core/libwebsockets/libwebsockets_4.3.0.bb deleted file mode 100644 index d8f4e62675d595c2cb9439ef370ab9d17a55f8e0..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/libwebsockets/libwebsockets_4.3.0.bb +++ /dev/null @@ -1,41 +0,0 @@ -DESCRIPTION = "Yet Another JSON Library - A Portable JSON parsing and serialization library in ANSI C" -LICENSE = "MIT" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" - -SRC_URI = "file://libwebsockets/${BP}.tar.gz \ - file://libwebsockets/0001-add-secure-compile-option-in-Makefile.patch \ - file://libwebsockets/0002-solve-the-BEP-problem.patch \ -" - -S = "${WORKDIR}/${BP}" - -inherit cmake - -DEPENDS = "zlib openssl" - -EXTRA_OECMAKE = "-DLWS_WITH_HTTP2=ON -DLWS_IPV6=ON -DLWS_WITH_ZIP_FOPS=ON -DLWS_WITH_SOCKS5=ON -DLWS_WITH_RANGES=ON -DLWS_WITH_ACME=ON \ - -DLWS_WITH_LIBUV=OFF -DLWS_WITH_LIBEV=OFF -DLWS_WITH_LIBEVENT=OFF -DLWS_WITH_FTS=ON -DLWS_WITH_THREADPOOL=ON -DLWS_UNIX_SOCK=ON \ - -DLWS_WITH_HTTP_PROXY=ON -DLWS_WITH_DISKCACHE=ON -DLWS_WITH_LWSAC=ON -DLWS_LINK_TESTAPPS_DYNAMIC=ON -DLWS_WITHOUT_BUILTIN_GETIFADDRS=ON -DLWS_USE_BUNDLED_ZLIB=OFF \ - -DLWS_WITHOUT_BUILTIN_SHA1=ON \ - -DLWS_WITH_STATIC=OFF \ - -DLWS_WITHOUT_CLIENT=OFF \ - -DLWS_WITHOUT_SERVER=OFF \ - -DLWS_WITHOUT_TESTAPPS=OFF \ - -DLWS_WITHOUT_TEST_SERVER=ON \ - -DLWS_WITHOUT_TEST_SERVER_EXTPOLL=ON \ - -DLWS_WITHOUT_TEST_PING=ON \ - -DLWS_WITHOUT_TEST_CLIENT=ON \ - " - -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" - -FILES_${PN} += "${libdir}/*" -INSANE_SKIP_${PN} += "already-stripped" -INSANE_SKIP_${PN} += "dev-so" -FILES_SOLIBSDEV = "" - -do_install_append() { - rm -rf ${D}/usr/share - ${STRIP} ${D}/${libdir}/*.so* -} diff --git a/meta-openeuler/recipes-core/libxml/libxml2/run-ptest b/meta-openeuler/recipes-core/libxml/libxml2/run-ptest deleted file mode 100644 index c313d83263a825640803559dfe97041c1492328b..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/libxml/libxml2/run-ptest +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -export LC_ALL=en_US.UTF-8 -make -k runtests diff --git a/meta-openeuler/recipes-core/libxml/libxml2_%.bbappend b/meta-openeuler/recipes-core/libxml/libxml2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ff6695181d86e6703348d7aebf9ff0a0df6eb045 --- /dev/null +++ b/meta-openeuler/recipes-core/libxml/libxml2_%.bbappend @@ -0,0 +1,63 @@ +# version in openEuler +PV = "2.9.14" + +# remove patches can't apply +# fix-execution-of-ptests.patch, patch-fuzz warning +SRC_URI_remove = "http://www.xmlsoft.org/sources/libxml2-${PV}.tar.gz;name=libtar \ + http://www.w3.org/XML/Test/xmlts20080827.tar.gz;subdir=${BP};name=testtar \ + file://libxml-m4-use-pkgconfig.patch \ + file://0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch \ + file://fix-execution-of-ptests.patch \ + file://CVE-2020-7595.patch \ + file://CVE-2019-20388.patch \ + file://CVE-2020-24977.patch \ + file://fix-python39.patch \ + file://CVE-2021-3517.patch \ + file://CVE-2021-3516.patch \ + file://CVE-2021-3518-0001.patch \ + file://CVE-2021-3518-0002.patch \ + file://CVE-2021-3537.patch \ + file://CVE-2021-3541.patch \ + file://CVE-2022-23308.patch \ + file://CVE-2022-23308-fix-regression.patch \ +" + +# apply openEuler source package +SRC_URI_prepend = "file://${BP}.tar.xz \ +" + +# add patches in openEuler +SRC_URI += " \ + file://libxml2-multilib.patch \ + file://backport-Rework-validation-context-flags.patch \ + file://backport-Remove-unneeded-code-in-xmlreader.c.patch \ + file://backport-Don-t-add-IDs-containing-unexpanded-entity-reference.patch \ + file://backport-Only-warn-on-invalid-redeclarations-of-predefined-en.patch \ + file://backport-Add-XML_DEPRECATED-macro.patch \ + file://Fix-memleaks-in-xmlXIncludeProcessFlags.patch \ + file://Fix-memory-leaks-for-xmlACatalogAdd.patch \ + file://Fix-memory-leaks-in-xmlACatalogAdd-when-xmlHashAddEntry-failed.patch \ + file://backport-CVE-2022-40303-Fix-integer-overflows-with-XML_PARSE_.patch \ + file://backport-CVE-2022-40304-Fix-dict-corruption-caused-by-entity-.patch \ + file://backport-schemas-Fix-null-pointer-deref-in-xmlSchemaCheckCOSS.patch \ + file://backport-parser-Fix-potential-memory-leak-in-xmlParseAttValue.patch \ +" + +# checksum changed +SRC_URI[sha256sum] = "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee" + +LIC_FILES_CHKSUM = "file://Copyright;md5=2044417e2e5006b65a8b9067b683fcf1 \ + file://hash.c;beginline=6;endline=15;md5=e77f77b12cb69e203d8b4090a0eee879 \ + file://list.c;beginline=4;endline=13;md5=b9c25b021ccaf287e50060602d20f3a7 \ + file://trio.c;beginline=5;endline=14;md5=cd4f61e27f88c1d43df112966b1cd28f \ +" + +# remove python config, because openEuler not support python yet. +PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'python', 'python3', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ +" + +# remove test configuration, because test package not in openEuler +do_configure_remove() { + find ${S}/xmlconf/ -type f -exec chmod -x {} \+ +} diff --git a/meta-openeuler/recipes-core/libxml/libxml2_2.9.12.bb b/meta-openeuler/recipes-core/libxml/libxml2_2.9.12.bb deleted file mode 100644 index 1664216ec8f0a60399ee4bf0aa4c48f6ad4f7aef..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/libxml/libxml2_2.9.12.bb +++ /dev/null @@ -1,104 +0,0 @@ -SUMMARY = "XML C Parser Library and Toolkit" -DESCRIPTION = "The XML Parser Library allows for manipulation of XML files. Libxml2 exports Push and Pull type parser interfaces for both XML and HTML. It can do DTD validation at parse time, on a parsed document instance or with an arbitrary DTD. Libxml2 includes complete XPath, XPointer and Xinclude implementations. It also has a SAX like interface, which is designed to be compatible with Expat." -HOMEPAGE = "http://www.xmlsoft.org/" -BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml2" -SECTION = "libs" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://Copyright;md5=2044417e2e5006b65a8b9067b683fcf1 \ - file://hash.c;beginline=6;endline=15;md5=e77f77b12cb69e203d8b4090a0eee879 \ - file://list.c;beginline=4;endline=13;md5=b9c25b021ccaf287e50060602d20f3a7 \ - file://trio.c;beginline=5;endline=14;md5=cd4f61e27f88c1d43df112966b1cd28f \ -" - -DEPENDS = "zlib virtual/libiconv" - -SRC_URI = "file://libxml2/${BP}.tar.gz \ - file://libxml2/libxml2-multilib.patch \ - file://libxml2/Fix-XPath-recursion-limit.patch \ - file://libxml2/Fix-Null-deref-in-xmlSchemaGetComponentTargetNs.patch \ - file://libxml2/Fix-memleaks-in-xmlXIncludeProcessFlags.patch \ - file://libxml2/xmlAddChild-and-xmlAddNextSibling-may-not-attach-the.patch \ - file://libxml2/Work-around-lxml-API-abuse.patch \ - file://libxml2/Fix-regression-in-xmlNodeDumpOutputInternal.patch \ - file://libxml2/Fix-whitespace-when-serializing-empty-HTML-documents.patch \ - file://libxml2/Patch-to-forbid-epsilon-reduction-of-final-states.patch \ - file://libxml2/Fix-buffering-in-xmlOutputBufferWrite.patch \ - file://libxml2/backport-CVE-2022-23308-Use-after-free-of-ID-and-IDREF-attrib.patch \ - file://run-ptest \ -" - -SRC_URI[sha256sum] = "c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92" - -BINCONFIG = "${bindir}/xml2-config" - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" - -PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3" -PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," - -inherit autotools pkgconfig binconfig-disabled ptest python3native - -RDEPENDS_${PN}-ptest += "make ${@bb.utils.contains('PACKAGECONFIG', 'python', 'libgcc python3-core python3-logging python3-shell python3-stringold python3-threading python3-unittest ${PN}-python', '', d)}" - -RDEPENDS_${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}" - -RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-ebcdic-us \ - glibc-gconv-ibm1141 \ - glibc-gconv-iso8859-5 \ - glibc-gconv-euc-jp \ - locale-base-en-us \ - " - -export PYTHON_SITE_PACKAGES="${PYTHON_SITEPACKAGES_DIR}" - -# WARNING: zlib is required for RPM use -EXTRA_OECONF = "--without-debug --without-legacy --without-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions" -EXTRA_OECONF_class-native = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib" -EXTRA_OECONF_class-nativesdk = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib" -EXTRA_OECONF_linuxstdbase = "--with-debug --with-legacy --with-docbook --with-c14n --without-lzma --with-zlib" - -python populate_packages_prepend () { - # autonamer would call this libxml2-2, but we don't want that - if d.getVar('DEBIAN_NAMES'): - d.setVar('PKG_libxml2', '${MLPREFIX}libxml2') -} - -PACKAGE_BEFORE_PN += "${PN}-utils" -PACKAGES += "${PN}-python" - -FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" -FILES_${PN}-dev += "${libdir}/xml2Conf.sh ${libdir}/cmake/*" -FILES_${PN}-utils = "${bindir}/*" -FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}" - -do_compile_ptest() { - oe_runmake check-am -} - -do_install_ptest () { - cp -r ${S}/xmlconf ${D}${PTEST_PATH} - if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then - sed -i -e 's|^\(PYTHON = \).*|\1${USRBINPATH}/${PYTHON_PN}|' \ - ${D}${PTEST_PATH}/python/tests/Makefile - grep -lrZ '#!/usr/bin/python' ${D}${PTEST_PATH}/python | - xargs -0 sed -i -e 's|/usr/bin/python|${USRBINPATH}/${PYTHON_PN}|' - fi - #Remove build host references from various Makefiles - find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ - sed -i \ - -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's|${DEBUG_PREFIX_MAP}||g' \ - -e 's:${HOSTTOOLS_DIR}/::g' \ - -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ - -e 's:${RECIPE_SYSROOT}::g' \ - -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ - -e '/^RELDATE/d' \ - {} + -} - -do_install_append_class-native () { - # Docs are not needed in the native case - rm ${D}${datadir}/gtk-doc -rf -} - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/logrotate/logrotate_3.18.1.bb b/meta-openeuler/recipes-core/logrotate/logrotate_3.18.1.bb deleted file mode 100644 index 8258b144b6661bf118c97b6fd4e99572ba9265f2..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/logrotate/logrotate_3.18.1.bb +++ /dev/null @@ -1,85 +0,0 @@ -SUMMARY = "Rotates, compresses, removes and mails system log files" -SECTION = "console/utils" -HOMEPAGE = "https://github.com/logrotate/logrotate/" -DESCRIPTION = "The logrotate utility is designed to simplify the administration of log files on a system which generates a lot of log files." -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" - -DEPENDS = "popt" - -SRC_URI = "file://${BPN}/${BP}.tar.xz" -UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases" -UPSTREAM_CHECK_REGEX = "logrotate-(?P\d+(\.\d+)+).tar" - -# These CVEs are debian, gentoo or SUSE specific on the way logrotate was installed/used -CVE_CHECK_WHITELIST += "CVE-2011-1548 CVE-2011-1549 CVE-2011-1550" - -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}" - -PACKAGECONFIG[acl] = ",,acl" -PACKAGECONFIG[selinux] = ",,libselinux" - -CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \ - ${sysconfdir}/logrotate.conf \ - ${sysconfdir}/logrotate.d/btmp \ - ${sysconfdir}/logrotate.d/wtmp" - -# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our -# optimization variables, so use it rather than EXTRA_CFLAGS. -EXTRA_OEMAKE = "\ - LFS= \ - OS_NAME='${OS_NAME}' \ - 'CC=${CC}' \ - 'RPM_OPT_FLAGS=${CFLAGS}' \ - 'EXTRA_LDFLAGS=${LDFLAGS}' \ - ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \ - ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \ -" - -# OS_NAME in the makefile defaults to `uname -s`. The behavior for -# freebsd/netbsd is questionable, so leave it as Linux, which only sets -# INSTALL=install and BASEDIR=/usr. -OS_NAME = "Linux" - -inherit autotools systemd - -SYSTEMD_SERVICE_${PN} = "\ - ${BPN}.service \ - ${BPN}.timer \ -" - -LOGROTATE_OPTIONS ?= "" - -LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily" -LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h" -LOGROTATE_SYSTEMD_TIMER_PERSISTENT ?= "true" - -do_install(){ - oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} - mkdir -p ${D}${sysconfdir}/logrotate.d - mkdir -p ${D}${localstatedir}/lib - install -p -m 644 ${S}/examples/logrotate.conf ${D}${sysconfdir}/logrotate.conf - install -p -m 644 ${S}/examples/btmp ${D}${sysconfdir}/logrotate.d/btmp - install -p -m 644 ${S}/examples/wtmp ${D}${sysconfdir}/logrotate.d/wtmp - touch ${D}${localstatedir}/lib/logrotate.status - - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${S}/examples/logrotate.service ${D}${systemd_system_unitdir}/logrotate.service - install -m 0644 ${S}/examples/logrotate.timer ${D}${systemd_system_unitdir}/logrotate.timer - [ -z "${LOGROTATE_OPTIONS}" ] || - sed -ri \ - -e 's|(ExecStart=.*/logrotate.*)$|\1 ${LOGROTATE_OPTIONS}|g' \ - ${D}${systemd_system_unitdir}/logrotate.service - sed -ri \ - -e 's|(OnCalendar=).*$|\1${LOGROTATE_SYSTEMD_TIMER_BASIS}|g' \ - -e 's|(AccuracySec=).*$|\1${LOGROTATE_SYSTEMD_TIMER_ACCURACY}|g' \ - -e 's|(Persistent=).*$|\1${LOGROTATE_SYSTEMD_TIMER_PERSISTENT}|g' \ - ${D}${systemd_system_unitdir}/logrotate.timer - fi - - if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then - mkdir -p ${D}${sysconfdir}/cron.daily - install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate - fi -} diff --git a/meta-openeuler/recipes-core/lvm2/lvm2.inc b/meta-openeuler/recipes-core/lvm2/lvm2.inc deleted file mode 100644 index 65c5609a242be0834951c0d9a8fae2c3ba292599..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/lvm2/lvm2.inc +++ /dev/null @@ -1,64 +0,0 @@ -HOMEPAGE = "https://www.sourceware.org/lvm2/" -SECTION = "utils" -DESCRIPTION = "LVM2 is a set of utilities to manage logical volumes in Linux." -LICENSE = "GPLv2 & LGPLv2.1 & BSD" - -LIC_FILES_CHKSUM = "file://COPYING;md5=12713b4d9386533feeb07d6e4831765a \ - file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \ - file://COPYING.BSD;md5=d7e19e89ea9f54c1af1aa83c7b7122e7 \ -" - -SRC_URI = "file://lvm2/LVM2.${PV}.tgz \ - file://lvm2/0001-lvm2-set-default-preferred_names.patch \ - file://lvm2/0002-lvm2-default-allow-changes-with-duplicate-pvs.patch \ - file://lvm2/0003-devs-check-for-no-dev-when-dropping-aliases.patch \ - file://lvm2/0004-bugfix-lvm2-add-SSD.patch \ - file://lvm2/0005-bugfix-add-timeout-when-fail-to-wait-udev.patch \ - file://lvm2/0006-bugfix-fix-the-code-maybe-lead-to-buffer-over-bound-access.patch \ - file://lvm2/0007-enhancement-modify-default-log-level-to-error-level.patch \ - file://lvm2/0008-enhancement-add-dfx-log.patch \ - file://lvm2/0009-enhancement-syslog-more-when-use-libdevmapper-so.patch \ - file://lvm2/0010-enhancement-log-it-when-disk-slow.patch \ - file://lvm2/0011-bugfix-lvm2-fix-the-reuse-of-va_list.patch \ -" - -SRC_URI[sha256sum] = "4a63bc8a084a8ae3c7bc5e6530cac264139d218575c64416c8b99e3fe039a05c" -DEPENDS += "util-linux libaio" - -S = "${WORKDIR}/LVM2.${PV}" - -inherit autotools-brokensep pkgconfig systemd license - -LVM2_PACKAGECONFIG = "dmeventd" -LVM2_PACKAGECONFIG_append_class-target = " \ - ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'udev', '', d)} \ -" - -# odirect is always enabled because there currently is a bug in -# lib/device/dev-io.c which prevents compiling without it. It is -# better to stick to configurations that were actually tested by -# upstream... -PACKAGECONFIG ??= "odirect ${LVM2_PACKAGECONFIG}" - -PACKAGECONFIG[dmeventd] = "--enable-dmeventd,--disable-dmeventd" -PACKAGECONFIG[odirect] = "--enable-o_direct,--disable-o_direct" -PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline" -PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux" -PACKAGECONFIG[udev] = "--enable-udev_sync --enable-udev_rules --with-udevdir=${nonarch_base_libdir}/udev/rules.d,--disable-udev_sync --disable-udev_rules,udev" - -# Unset user/group to unbreak install. -EXTRA_OECONF = "--with-user= \ - --with-group= \ - --enable-realtime \ - --enable-cmdlib \ - --enable-pkgconfig \ - --with-usrlibdir=${libdir} \ - --with-systemdsystemunitdir=${systemd_system_unitdir} \ - --disable-thin_check_needs_check \ - --with-thin-check=${sbindir}/thin_check \ - --with-thin-dump=${sbindir}/thin_dump \ - --with-thin-repair=${sbindir}/thin_repair \ - --with-thin-restore=${sbindir}/thin_restore \ -" - diff --git a/meta-openeuler/recipes-core/lvm2/lvm2_2.03.14.bb b/meta-openeuler/recipes-core/lvm2/lvm2_2.03.14.bb deleted file mode 100644 index b4f6609fc97bca0487fca545448ccd7082bbd334..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/lvm2/lvm2_2.03.14.bb +++ /dev/null @@ -1,55 +0,0 @@ -require lvm2.inc - -DEPENDS += "autoconf-archive-native" - -MULTILIB_SCRIPTS = "${PN}:${sysconfdir}/lvm/lvm.conf" - -CACHED_CONFIGUREVARS += "MODPROBE_CMD=${base_sbindir}/modprobe" - -do_install_append() { - # Install machine specific configuration file - install -d ${D}${sysconfdir}/lvm - sed -i -e 's:@libdir@:${libdir}:g' ${D}${sysconfdir}/lvm/lvm.conf - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - oe_runmake 'DESTDIR=${D}' install install_systemd_units - sed -i -e 's:/usr/bin/true:${base_bindir}/true:g' ${D}${systemd_system_unitdir}/blk-availability.service - else - oe_runmake 'DESTDIR=${D}' install install_initscripts - mv ${D}${sysconfdir}/rc.d/init.d ${D}${sysconfdir}/init.d - chmod 0750 ${D}${sysconfdir}/init.d/blk-availability - chmod 0750 ${D}${sysconfdir}/init.d/lvm2-monitor - rm -rf ${D}${sysconfdir}/rc.d - fi -} - -PACKAGE_BEFORE_PN = "${PN}-scripts ${PN}-udevrules" - -SYSTEMD_PACKAGES = "${PN}" -SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'dmeventd', 'lvm2-monitor.service dm-event.socket dm-event.service', '', d)} \ - blk-availability.service" -SYSTEMD_AUTO_ENABLE = "disable" - -TARGET_CC_ARCH += "${LDFLAGS}" - -EXTRA_OECONF_append_class-nativesdk = " --with-confdir=${sysconfdir}" - -FILES_${PN} += "${libdir}/device-mapper/*.so" -FILES_${PN}-scripts = " \ - ${sbindir}/blkdeactivate \ - ${sbindir}/fsadm \ - ${sbindir}/lvmconf \ - ${sbindir}/lvmdump \ -" -# Specified explicitly for the udev rules, just in case that it does not get picked -# up automatically: -FILES_${PN}-udevrules = "${nonarch_base_libdir}/udev/rules.d" -RDEPENDS_${PN}-udevrules = "${PN}" -#RDEPENDS_${PN}_append_class-target = " libdevmapper" -RDEPENDS_${PN}_append_class-nativesdk = " libdevmapper" - -RDEPENDS_${PN}-scripts = "${PN} (= ${EXTENDPKGV}) bash" -RRECOMMENDS_${PN}_class-target = "${PN}-scripts (= ${EXTENDPKGV})" - -CONFFILES_${PN} += "${sysconfdir}/lvm/lvm.conf" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/lxc/lxc/0027-fix-redeclaration.patch b/meta-openeuler/recipes-core/lxc/lxc/0027-fix-redeclaration.patch new file mode 100644 index 0000000000000000000000000000000000000000..7959f22d1e7a2d3d13cfcb3998a2bde7c10a3ec1 --- /dev/null +++ b/meta-openeuler/recipes-core/lxc/lxc/0027-fix-redeclaration.patch @@ -0,0 +1,88 @@ +-- a/src/lxc/macro.h ++++ b/src/lxc/macro.h +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -812,4 +813,16 @@ static inline bool is_set(__u32 bit, __u + + #define BIT(nr) (1UL << (nr)) + ++#ifndef FS_IOC_GETFLAGS ++#define FS_IOC_GETFLAGS _IOR('f', 1, long) ++#endif ++ ++#ifndef FS_IOC_SETFLAGS ++#define FS_IOC_SETFLAGS _IOW('f', 2, long) ++#endif ++ ++#ifndef FS_IMMUTABLE_FL ++#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */ ++#endif ++ + #endif /* __LXC_MACRO_H */ +--- a/src/lxc/utils.c ++++ b/src/lxc/utils.c +@@ -19,8 +19,6 @@ + #include + #include + #include +-/* Needs to be after sys/mount.h header */ +-#include + #include + #include + #include +@@ -238,7 +237,7 @@ int mkdir_p(const char *dir, mode_t mode) + return 0; + } + +-char *get_rundir() ++char *get_rundir(void) + { + char *rundir; + size_t len; +--- a/src/lxc/conf.c ++++ b/src/lxc/conf.c +@@ -3657,7 +3657,9 @@ static bool verify_start_hooks(struct lxc_conf *conf) + + static bool execveat_supported(void) + { +- execveat(-1, "", NULL, NULL, AT_EMPTY_PATH); ++ char *argv[1] = {NULL}; ++ char *envp[1] = {NULL}; ++ execveat(-1, "", argv, envp, AT_EMPTY_PATH); + if (errno == ENOSYS) + return false; + +--- a/src/lxc/json/json_common.c ++++ b/src/lxc/json/json_common.c +@@ -765,7 +765,11 @@ int append_json_map_int_string(json_map_int_string *map, int key, const char *va + return -1; + } + +- if ((SIZE_MAX / sizeof(int) - 1) < map->len || (SIZE_MAX / sizeof(char *) - 1) < map->len) { ++ if ((SIZE_MAX / sizeof(int) - 1) < map->len) { ++ return -1; ++ } ++ ++ if ((SIZE_MAX / sizeof(char *) - 1) < map->len) { + return -1; + } + +@@ -887,7 +891,11 @@ int append_json_map_string_int(json_map_string_int *map, const char *key, int va + return -1; + } + +- if ((SIZE_MAX / sizeof(char *) - 1) < map->len || (SIZE_MAX / sizeof(int) - 1) < map->len) { ++ if ((SIZE_MAX / sizeof(char *) - 1) < map->len) { ++ return -1; ++ } ++ ++ if ((SIZE_MAX / sizeof(int) - 1) < map->len) { + return -1; + } + diff --git a/meta-openeuler/recipes-core/lxc/lxc/0036-add-riscv-support.patch b/meta-openeuler/recipes-core/lxc/lxc/0036-add-riscv-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..fcd5f2485733475a66d84cd3972f4e9ebd5cd835 --- /dev/null +++ b/meta-openeuler/recipes-core/lxc/lxc/0036-add-riscv-support.patch @@ -0,0 +1,119 @@ +--- lxc-4.0.3/src/lxc/syscall_numbers.h ++++ lxc-4.0.3-new/src/lxc/syscall_numbers.h +@@ -35,6 +35,8 @@ + #define __NR_keyctl 280 + #elif defined __powerpc__ + #define __NR_keyctl 271 ++ #elif defined __riscv ++ #define __NR_keyctl 219 + #elif defined __sparc__ + #define __NR_keyctl 283 + #elif defined __ia64__ +@@ -68,6 +70,8 @@ + #define __NR_memfd_create 350 + #elif defined __powerpc__ + #define __NR_memfd_create 360 ++ #elif defined __riscv ++ #define __NR_memfd_create 279 + #elif defined __sparc__ + #define __NR_memfd_create 348 + #elif defined __blackfin__ +@@ -103,6 +107,8 @@ + #define __NR_pivot_root 217 + #elif defined __powerpc__ + #define __NR_pivot_root 203 ++ #elif defined __riscv ++ #define __NR_pivot_root 41 + #elif defined __sparc__ + #define __NR_pivot_root 146 + #elif defined __ia64__ +@@ -136,6 +142,8 @@ + #define __NR_setns 339 + #elif defined __powerpc__ + #define __NR_setns 350 ++ #elif defined __riscv ++ #define __NR_setns 268 + #elif defined __sparc__ + #define __NR_setns 337 + #elif defined __ia64__ +@@ -169,6 +177,8 @@ + #define __NR_sethostname 74 + #elif defined __powerpc__ + #define __NR_sethostname 74 ++ #elif defined __riscv ++ #define __NR_sethostname 161 + #elif defined __sparc__ + #define __NR_sethostname 88 + #elif defined __ia64__ +@@ -202,6 +212,8 @@ + #define __NR_signalfd 316 + #elif defined __powerpc__ + #define __NR_signalfd 305 ++ #elif defined __riscv ++ #define __NR_signalfd4 74 + #elif defined __sparc__ + #define __NR_signalfd 311 + #elif defined __ia64__ +@@ -235,6 +247,8 @@ + #define __NR_signalfd4 322 + #elif defined __powerpc__ + #define __NR_signalfd4 313 ++ #elif defined __riscv ++ #define __NR_signalfd4 74 + #elif defined __sparc__ + #define __NR_signalfd4 317 + #elif defined __ia64__ +@@ -268,6 +282,8 @@ + #define __NR_unshare 303 + #elif defined __powerpc__ + #define __NR_unshare 282 ++ #elif defined __riscv ++ #define __NR_unshare 97 + #elif defined __sparc__ + #define __NR_unshare 299 + #elif defined __ia64__ +@@ -301,6 +317,8 @@ + #define __NR_bpf 351 + #elif defined __powerpc__ + #define __NR_bpf 361 ++ #elif defined __riscv ++ #define __NR_bpf 280 + #elif defined __sparc__ + #define __NR_bpf 349 + #elif defined __ia64__ +@@ -334,6 +352,8 @@ + #define __NR_faccessat 300 + #elif defined __powerpc__ + #define __NR_faccessat 298 ++ #elif defined __riscv ++ #define __NR_faccessat 48 + #elif defined __sparc__ + #define __NR_faccessat 296 + #elif defined __ia64__ +@@ -385,6 +405,8 @@ + #define __NR_seccomp 348 + #elif defined __powerpc__ + #define __NR_seccomp 358 ++ #elif defined __riscv ++ #define __NR_seccomp 277 + #elif defined __sparc__ + #define __NR_seccomp 346 + #elif defined __ia64__ +@@ -418,6 +440,8 @@ + #define __NR_gettid 236 + #elif defined __powerpc__ + #define __NR_gettid 207 ++ #elif defined __riscv ++ #define __NR_gettid 178 + #elif defined __sparc__ + #define __NR_gettid 143 + #elif defined __ia64__ +@@ -455,6 +479,8 @@ + #define __NR_execveat 354 + #elif defined __powerpc__ + #define __NR_execveat 362 ++ #elif defined __riscv ++ #define __NR_execveat 281 + #elif defined __sparc__ + #define __NR_execveat 350 + #elif defined __ia64__ diff --git a/meta-openeuler/recipes-core/lxc/lxc/support_arm32.patch b/meta-openeuler/recipes-core/lxc/lxc/support_arm32.patch index 6b4a9eace2416044a941be3c093096cace5da397..9ee71b315eda4fccdce84220a1334082eca5de9f 100644 --- a/meta-openeuler/recipes-core/lxc/lxc/support_arm32.patch +++ b/meta-openeuler/recipes-core/lxc/lxc/support_arm32.patch @@ -18,35 +18,6 @@ index 9eb6dcb..929d670 100644 else AC_MSG_RESULT([no]) fi -diff --git a/src/lxc/confile.c b/src/lxc/confile.c -index e898e23..522fefa 100644 ---- a/src/lxc/confile.c -+++ b/src/lxc/confile.c -@@ -6233,21 +6233,21 @@ static int set_config_init_args(const char *key, const char *value, - struct lxc_conf *lxc_conf, void *data) - { - int ret = 0; -- char *tmp = NULL; -+ char **tmp = NULL; - char *new_value = NULL; - - ret = set_config_string_item(&new_value, value); - if (ret || !new_value) - return ret; - -- tmp = realloc(lxc_conf->init_argv, (lxc_conf->init_argc + 1) * sizeof(char *)); -+ tmp = (char **)realloc(lxc_conf->init_argv, (lxc_conf->init_argc + 1) * sizeof(char *)); - if (!tmp) { - ERROR("Out of memory"); - free(new_value); - return -1; - } - -- lxc_conf->init_argv = (char **)tmp; -+ lxc_conf->init_argv = tmp; - - lxc_conf->init_argv[lxc_conf->init_argc] = new_value; - lxc_conf->init_argc++; diff --git a/src/lxc/json/json_common.c b/src/lxc/json/json_common.c index ec20c59..87895b0 100755 --- a/src/lxc/json/json_common.c diff --git a/meta-openeuler/recipes-core/lxc/lxc_4.0.3.bb b/meta-openeuler/recipes-core/lxc/lxc_4.0.3.bb index a40aa5006153c1979d419b1f308d18b4230f6975..47a02a77d4f913c5947621a6ce07d0bdc2078a6f 100644 --- a/meta-openeuler/recipes-core/lxc/lxc_4.0.3.bb +++ b/meta-openeuler/recipes-core/lxc/lxc_4.0.3.bb @@ -1,54 +1,48 @@ -SUMMARY = "Protocol Buffers - structured data serialisation mechanism" -DESCRIPTION = "Yet Another JSON Library - A Portable JSON parsing and serialization library in ANSI C" -SECTION = "console/tools" -LICENSE = "BSD-2-Clause" +SUMMARY = "lxc aims to use these new functionnalities to provide an userspace container object" +DESCRIPTION = "lxc is a well-known Linux container runtime that consists of tools, templates, \ + and library and language bindings. It's pretty low level, very flexible and covers \ + just about every containment feature supported by the upstream kernel" +SECTION = "console/utils" +LICENSE = "LGPL-2.1-only & GPL-2.0-only" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" -SRC_URI = "file://lxc/lxc-4.0.3.tar.gz \ - file://lxc/0001-huawei-adapt-to-huawei-4.0.3.patch \ - file://lxc/0002-add-mount-label-for-rootfs.patch \ - file://lxc/0003-format-code-and-verify-mount-mode.patch \ - file://lxc/0004-Removes-the-definition-of-the-thread-attributes-obje.patch \ - file://lxc/0005-solve-coredump-bug-caused-by-fstype-being-NULL-durin.patch \ - file://lxc/0006-SIGTERM-do-not-catch-signal-SIGTERM-in-lxc-monitor.patch \ - file://lxc/0007-Using-string-type-instead-of-security_context_t-beca.patch \ - file://lxc/0008-hook-pass-correct-mount-dir-as-root-to-hook.patch \ - file://lxc/0009-cgroup-refact-cgroup-manager-to-single-file.patch \ - file://lxc/0010-cgfsng-adjust-log-level-from-error-to-warn.patch \ - file://lxc/0011-rootfs-add-make-private-for-root.path-parent.patch \ - file://lxc/0012-mount-make-possible-to-bind-mount-proc-and-sys-fs.patch \ - file://lxc/0013-use-path-based-unix-domain-sockets-instead-of-abstra.patch \ - file://lxc/0014-api-add-get-container-metrics-api.patch \ - file://lxc/0015-Streaming-IO-solution-optimization-and-enhancement.patch \ - file://lxc/0016-avoid-using-void-pointers-in-caclulation.patch \ - file://lxc/0017-fix-compilation-errors-without-libcap.patch \ - file://lxc/0018-IO-fix-io-data-miss-when-exec-with-pipes.patch \ - file://lxc/0019-metrics-add-total_inactive_file-metric-for-memory.patch \ - file://lxc/0020-support-cgroup-v2.patch \ - file://lxc/0021-support-isula-exec-workdir.patch \ - file://lxc/0022-print-error-message-if-process-workdir-failed.patch \ - file://lxc/0023-log-support-long-syslog-tag.patch \ - file://lxc/0024-log-adjust-log-level-from-error-to-warn.patch \ - file://lxc/0025-get-cgroup-data-len-first-and-malloc-read-buff-by-le.patch \ - file://lxc/0026-coredump-fix-coredump-when-cgroup-get-return-error.patch \ - file://lxc/0027-add-help-for-new-arguments.patch \ - file://lxc/0028-seccomp-init-and-destroy-notifier.cookie.patch \ - file://lxc/0029-just-use-origin-loop-if-do-not-have-io.patch \ - file://lxc/0030-conf-fix-a-memory-leak.patch \ - file://lxc/0031-fix-lsm_se_mount_context-memory-leak.patch \ - file://lxc/0032-disable-lxc_keep-with-oci-image.patch \ - file://lxc/0033-conf-ensure-that-the-idmap-pointer-itself-is-freed.patch \ - file://lxc/0034-cgfsng-fix-cgroup-attach-cgroup-creation.patch \ - file://support_arm32.patch \ - file://check_only_rootfs_as_filesystem_type.patch \ - " - +SRC_URI = "file://${BP}.tar.gz \ + file://0001-refactor-patch-code-of-utils-commands-and-so-on.patch \ + file://0002-refactor-patch-code-of-isulad-for-conf-exec-attach.patch \ + file://0003-refactor-patch-code-of-isulad-for-selinux-attach.patch \ + file://0004-refactor-patch-code-of-lxccontianer-and-so-on.patch \ + file://0005-refactor-patch-code-of-attach-and-seccomp.patch \ + file://0006-refactor-patch-about-namespace-log-terminal.patch \ + file://0007-refactor-patches-on-terminal.c-start.c-and-so-on.patch \ + file://0008-refactor-patch-code-of-json.patch \ + file://0009-fix-HOME-env-of-container-unset-error.patch \ + file://0010-check-yajl-only-when-have-isulad.patch \ + file://0011-drop-security_context_t.patch \ + file://0012-only-set-user-or-image-set-non-empty-HOME.patch \ + file://0013-return-fail-if-no-args-or-no-rootfs-path-found.patch \ + file://0014-fix-tools-using-option-give-error-message.patch \ + file://0015-fix-do-mask-pathes-after-parent-mounted.patch \ + file://0016-skip-kill-cgroup-processes-if-no-hierarchies.patch \ + file://0017-lxc-Add-sw64-architecture.patch \ + file://0018-add-macro-to-adapt-musl-libc.patch \ + file://0019-add-lxc-attach-add-gids-option.patch \ + file://0020-add-sscanf-adapation-code-for-musl.patch \ + file://0021-change-the-suffi-parameter-in-lxc-attach-help-output.patch \ + file://0022-fix-cve-CVE-2022-47952-log-leaks-root-information.patch \ + file://0023-fix-lxc-write-error-message.patch \ + file://0024-remove-process-inheritable-capability.patch \ + file://0025-fix-ops-hierarchies-cause-coredump.patch \ + file://0026-meminfo-cri-1.25.patch \ +" + +SRC_URI_append = " \ + file://check_only_rootfs_as_filesystem_type.patch \ + file://0027-fix-redeclaration.patch \ +" DEPENDS = "yajl libseccomp libcap" -S = "${WORKDIR}/${BPN}-${PV}" - EXTRA_OECONF = "--disable-static --disable-openssl --with-rootfs-path=/var/lib/lxc/rootfs --with-distro=openeuler" inherit autotools diff --git a/meta-openeuler/recipes-core/meta/files/openeuler_target_env.sh b/meta-openeuler/recipes-core/meta/files/openeuler_target_env.sh index acce687273cd622bdef88276e2fd70a900edf7ec..df830de9fa7b09d8a6e545eb8af3b8d8d9e9c239 100644 --- a/meta-openeuler/recipes-core/meta/files/openeuler_target_env.sh +++ b/meta-openeuler/recipes-core/meta/files/openeuler_target_env.sh @@ -1 +1,5 @@ -export KERNEL_SRC_DIR="${SDKTARGETSYSROOT}/usr/src/kernel" +export KERNEL_SRC="${SDKTARGETSYSROOT}/usr/src/kernel" +# prepare context for kernel module development +pushd "${SDKTARGETSYSROOT}/usr/src/kernel" +make modules_prepare PKG_CONFIG_SYSROOT_DIR= PKG_CONFIG_PATH= +popd diff --git a/meta-openeuler/recipes-core/meta/meta-environment.bbappend b/meta-openeuler/recipes-core/meta/meta-environment.bbappend index 09f4c84b51f017eb770b64efe6e6e14944869cf3..4eadcd14b90e72507b3040bf0e0220d386393d9f 100644 --- a/meta-openeuler/recipes-core/meta/meta-environment.bbappend +++ b/meta-openeuler/recipes-core/meta/meta-environment.bbappend @@ -1,11 +1,13 @@ -SDKPATHNATIVE = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}/" +FILESEXTRAPATHS_append := "${THISDIR}/files/:" +SRC_URI = "file://openeuler_target_env.sh" +LICENSE = "CLOSED" -BBAPPENDDIR := "${@os.path.dirname(d.getVar('FILE', False))}" -S = "${BBAPPENDDIR}/files" +addtask do_fetch before do_install +addtask do_unpack before do_install do_install_append() { #add openeuler env to sdk - local openeuler_env_path="${D}/${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}/environment-setup.d" + local openeuler_env_path="${D}/${SDKPATHNATIVE}/environment-setup.d" install -d ${openeuler_env_path}/ - install ${S}/openeuler_target_env.sh ${openeuler_env_path}/ + install ${WORKDIR}/openeuler_target_env.sh ${openeuler_env_path}/ } diff --git a/meta-openeuler/recipes-core/ncurses/ncurses_%.bbappend b/meta-openeuler/recipes-core/ncurses/ncurses_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a8ea87689ae3605b60446c3e47d80d0661b84ec9 --- /dev/null +++ b/meta-openeuler/recipes-core/ncurses/ncurses_%.bbappend @@ -0,0 +1,22 @@ +OPENEULER_SRC_URI_REMOVE = "https git http" + +PV = "6.4" + +# files, patches can't be applied in openeuler or conflict with openeuler +# CVE-2021-39537.patch from poky is for 6.2 and no need for openeuler 6.3 version +SRC_URI_remove += " \ + file://0002-configure-reproducible.patch \ + file://0003-gen-pkgconfig.in-Do-not-include-LDFLAGS-in-generated.patch \ + file://CVE-2021-39537.patch \ +" + +S = "${WORKDIR}/${BPN}-${PV}" +# files, patches that come from openeuler +SRC_URI += "file://ncurses/${BP}.tar.gz \ + file://ncurses/ncurses-config.patch \ + file://ncurses/ncurses-libs.patch \ + file://ncurses/ncurses-urxvt.patch \ + file://ncurses/ncurses-kbs.patch \ +" + +SRC_URI[md5sum] = "a2736befde5fee7d2b7eb45eb281cdbe" diff --git a/meta-openeuler/recipes-core/newlib/newlib_%.bb b/meta-openeuler/recipes-core/newlib/newlib_%.bb new file mode 100644 index 0000000000000000000000000000000000000000..f5ffe9d2cc93dca2233c030dd17fc753fcc0fbb0 --- /dev/null +++ b/meta-openeuler/recipes-core/newlib/newlib_%.bb @@ -0,0 +1,93 @@ +## in openEuler Embedded, newlib is not an alternative of glibc, it's used by RTOS +## or baremetal in the case of multi-os mixed deployment. +## Because of this, .bbappend is not use but independent bb file +SUMMARY = "Newlib is a C library intended for use on embedded systems" +HOMEPAGE = "https://sourceware.org/newlib/" +DESCRIPTION = "C library intended for use on embedded systems. It is a conglomeration of several library parts, all under free software licenses that make them easily usable on embedded products." +SECTION = "libs" + +LICENSE = "GPLv2 & LGPLv3 & GPLv3 & LGPLv2 & BSD-2-Clause & tcl" + +# current version +PV = "3.3.0" + +# license checksum and tarball file checksum for newlib-3.3.0 +# pls update when version changes +LIC_FILES_CHKSUM = " \ + file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ + file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \ + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \ + file://COPYING.LIBGLOSS;md5=54b778d585443cd7fbfa1b47cbd63a89 \ + file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \ + file://COPYING.NEWLIB;md5=ac17c68751aad7a5298ce3f249121070 \ + file://newlib/libc/posix/COPYRIGHT;md5=103468ff1982be840fdf4ee9f8b51bbf \ + file://newlib/libc/sys/linux/linuxthreads/LICENSE;md5=73640207fbc79b198c7ffd4ad4d97aa0 \ + " + +SRC_URI = "https://sourceware.org/pub/newlib/newlib-${PV}.tar.gz" +SRC_URI[sha256sum] = "58dd9e3eaedf519360d92d84205c3deef0b3fc286685d1c562e245914ef72c66" + +# disable pie security flags by default +SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}" +SECURITY_LDFLAGS = "" + +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS = "virtual/${TARGET_PREFIX}gcc" + +S = "${WORKDIR}/newlib-${PV}" +B = "${WORKDIR}/build" + +## disable stdlib +TARGET_CC_ARCH_append = " -nostdlib" + +# when to use elf, when to use eabi +# depends on toolchain and architecture +NEWLIB_OS ?= "elf" +NEWLIB_TARGET = "${TARGET_ARCH}${TARGET_VENDOR}-${NEWLIB_OS}" + +EXTRA_OECONF = " \ + --build=${BUILD_SYS} \ + --target=${NEWLIB_TARGET} \ + --host=${HOST_SYS} \ + --prefix=${prefix} \ + --exec-prefix=${exec_prefix} \ + --bindir=${bindir} \ + --libdir=${libdir} \ + --includedir=${includedir} \ + --enable-languages=c \ + --with-newlib \ + --with-gnu-as \ + --with-gnu-ld \ + --disable-multilib \ + --disable-newlib-supplied-syscalls \ + " + +do_configure[cleandirs] = "${B}" + +# tell yocto do not skip newlibc +COMPATIBLE_HOST_libc-musl_class-target = "" +COMPATIBLE_HOST_libc-glibc_class-target = "" + +do_configure() { + export CC_FOR_TARGET="${CC}" + ${S}/configure ${EXTRA_OECONF} +} + +# oe_runmake will call "make -j 8 install xxx", -j 8 will cause +# concurrency problem, so use make only. +do_install() { + ${MAKE} install DESTDIR='${D}' + + # Move include files and libs to default directories so they can be picked up later + mv -v ${D}${prefix}/${NEWLIB_TARGET}/lib ${D}${libdir} + mv -v ${D}${prefix}/${NEWLIB_TARGET}/include ${D}${includedir} + + # Remove original directory + rmdir ${D}${prefix}/${NEWLIB_TARGET} +} + +# put the *.specs file and cpu-init into dev package +FILES_${PN}-dev += " ${libdir}/*.specs ${libdir}/cpu-init " + +# No rpm package is actually created but -dev depends on it, avoid dnf error +RDEPENDS_${PN}-dev = "" diff --git a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-mountd.service b/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-mountd.service deleted file mode 100644 index c01415de842f6a020f2cbcdf77e9d42f8638d032..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-mountd.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=NFS Mount Daemon -DefaultDependencies=no -After=rpcbind.socket -Requires=proc-fs-nfsd.mount -After=proc-fs-nfsd.mount -After=network.target local-fs.target -BindsTo=nfs-server.service -ConditionPathExists=@SYSCONFDIR@/exports - -[Service] -EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf -ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS -LimitNOFILE=@HIGH_RLIMIT_NOFILE@ - -[Install] -WantedBy=multi-user.target diff --git a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-server.service b/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-server.service deleted file mode 100644 index 5c845b7e82f017660827bd3406687c37fe3269c5..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-server.service +++ /dev/null @@ -1,23 +0,0 @@ -[Unit] -Description=NFS server and services -DefaultDependencies=no -Requires=network.target proc-fs-nfsd.mount -Requires=nfs-mountd.service -Wants=rpcbind.service -After=local-fs.target -After=network.target proc-fs-nfsd.mount rpcbind.service nfs-mountd.service -ConditionPathExists=@SYSCONFDIR@/exports - -[Service] -Type=oneshot -EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf -ExecStartPre=@SBINDIR@/exportfs -r -ExecStart=@SBINDIR@/rpc.nfsd $NFSD_OPTS $NFSD_COUNT -ExecStop=@SBINDIR@/rpc.nfsd 0 -ExecStopPost=@SBINDIR@/exportfs -au -ExecStopPost=@SBINDIR@/exportfs -f -ExecReload=@SBINDIR@/exportfs -r -RemainAfterExit=yes - -[Install] -WantedBy=multi-user.target diff --git a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-statd.service b/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-statd.service deleted file mode 100644 index 4fa64e19980850bbdd17b357e527271817b1f05d..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-statd.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=NFS status monitor for NFSv2/3 locking. -DefaultDependencies=no -Conflicts=umount.target -Requires=nss-lookup.target rpcbind.service -After=network.target nss-lookup.target rpcbind.service - -[Service] -EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf -ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS -LimitNOFILE=@HIGH_RLIMIT_NOFILE@ - -[Install] -WantedBy=multi-user.target diff --git a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-utils.conf b/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-utils.conf deleted file mode 100644 index a1007a7fbf4a37701fa132591b75b5e357594c03..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfs-utils.conf +++ /dev/null @@ -1,35 +0,0 @@ -# Parameters to be passed to nfs-utils (clients & server) service files. -# - -# Options to pass to rpc.nfsd. -NFSD_OPTS="" - -# Number of servers to start up; the default is 8 servers. -NFSD_COUNT="" - -# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd". -PROCNFSD_MOUNTPOINT="" - -# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid". -PROCNFSD_MOUNTOPTS="" - -# Options for rpc.mountd. -# If you have a port-based firewall, you might want to set up -# a fixed port here using the --port option. -MOUNTD_OPTS="" - -# Parameters to be passed to nfs-common (nfs clients & server) init script. -# - -# If you do not set values for the NEED_ options, they will be attempted -# autodetected; this should be sufficient for most people. Valid alternatives -# for the NEED_ options are "yes" and "no". - -# Do you want to start the statd daemon? It is not needed for NFSv4. -NEED_STATD="" - -# Options to pass to rpc.statd. -# N.B. statd normally runs on both client and server, and run-time -# options should be specified accordingly. -# STATD_OPTS="-p 32765 -o 32766" -STATD_OPTS="" diff --git a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfscommon b/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfscommon deleted file mode 100644 index 992267d5a1610214c1aacfb223ed090d89f09438..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfscommon +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: nfs-common -# Required-Start: $portmap hwclock -# Required-Stop: $portmap hwclock -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: NFS support for both client and server -# Description: NFS is a popular protocol for file sharing across -# TCP/IP networks. This service provides various -# support functions for NFS mounts. -### END INIT INFO -# -# Startup script for nfs-utils -# -# -# Location of executables: - -# Source function library. -. /etc/init.d/functions - -test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd -test -z "$STATD_PID" && STATD_PID=/var/run/rpc.statd.pid -# -# The default state directory is /var/lib/nfs -test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs -# -#---------------------------------------------------------------------- -# Startup and shutdown functions. -# Actual startup/shutdown is at the end of this file. - -start_statd(){ - echo -n "starting statd: " - start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID" - echo done -} -stop_statd(){ - echo -n 'stopping statd: ' - start-stop-daemon --stop --quiet --signal 1 --pidfile "$STATD_PID" - echo done -} -#---------------------------------------------------------------------- -# -# supported options: -# start -# stop -# restart: stops and starts mountd -#FIXME: need to create the /var/lib/nfs/... directories -case "$1" in - start) - start_statd;; - stop) - stop_statd;; - status) - status $NFS_STATD - exit $?;; - restart) - $0 stop - $0 start;; - *) - echo "Usage: $0 {start|stop|status|restart}" - exit 1;; -esac diff --git a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfsserver b/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfsserver deleted file mode 100644 index 0f5747cc6db97d8c14100c170e2fa53f30b6e2b4..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/nfsserver +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: nfs-kernel-server -# Required-Start: $remote_fs nfs-common $portmap hwclock -# Required-Stop: $remote_fs nfs-common $portmap hwclock -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Kernel NFS server support -# Description: NFS is a popular protocol for file sharing across -# TCP/IP networks. This service provides NFS server -# functionality, which is configured via the -# /etc/exports file. -### END INIT INFO -# -# Startup script for nfs-utils -# -# Source function library. -. /etc/init.d/functions -# -# The environment variable NFS_SERVERS may be set in /etc/default/nfsd -# Other control variables may be overridden here too -test -r /etc/default/nfsd && . /etc/default/nfsd -# -# Location of executables: -test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd -test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd -# -# The user mode program must also exist (it just starts the kernel -# threads using the kernel module code). -test -x "$NFS_MOUNTD" || exit 0 -test -x "$NFS_NFSD" || exit 0 -# -# Default is 8 threads, value is settable between 1 and the truely -# ridiculous 99 -test "$NFS_SERVERS" != "" && test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8 -# -#---------------------------------------------------------------------- -# Startup and shutdown functions. -# Actual startup/shutdown is at the end of this file. -#mountd -start_mountd(){ - echo -n 'starting mountd: ' - start-stop-daemon --start --exec "$NFS_MOUNTD" -- "$@" - echo done -} -stop_mountd(){ - echo -n 'stopping mountd: ' - start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD" - echo done -} -# -#nfsd -start_nfsd(){ - modprobe -q nfsd - grep -q nfsd /proc/filesystems || { - echo NFS daemon support not enabled in kernel - exit 1 - } - grep -q nfsd /proc/mounts || mount -t nfsd nfsd /proc/fs/nfsd - grep -q nfsd /proc/mounts || { - echo nfsd filesystem could not be mounted at /proc/fs/nfsd - exit 1 - } - - echo -n "starting $1 nfsd kernel threads: " - start-stop-daemon --start --exec "$NFS_NFSD" -- "$@" - echo done -} -delay_nfsd(){ - for delay in 0 1 2 3 4 5 6 7 8 9 - do - if pidof nfsd >/dev/null - then - echo -n . - sleep 1 - else - return 0 - fi - done - return 1 -} -stop_nfsd(){ - # WARNING: this kills any process with the executable - # name 'nfsd'. - echo -n 'stopping nfsd: ' - start-stop-daemon --stop --quiet --signal 1 --name nfsd - if delay_nfsd || { - echo failed - echo ' using signal 9: ' - start-stop-daemon --stop --quiet --signal 9 --name nfsd - delay_nfsd - } - then - echo done - else - echo failed - fi -} - -#---------------------------------------------------------------------- -# -# supported options: -# start -# stop -# reload: reloads the exports file -# restart: stops and starts mountd -#FIXME: need to create the /var/lib/nfs/... directories -case "$1" in - start) - test -r /etc/exports && exportfs -r - start_nfsd "$NFS_SERVERS" - start_mountd - test -r /etc/exports && exportfs -a;; - stop) exportfs -ua - stop_mountd - stop_nfsd;; - status) - status /usr/sbin/rpc.mountd - RETVAL=$? - status nfsd - rval=$? - [ $RETVAL -eq 0 ] && exit $rval - exit $RETVAL;; - reload) test -r /etc/exports && exportfs -r;; - restart) - $0 stop - $0 start;; - *) echo "Usage: $0 {start|stop|status|reload|restart}" - exit 1;; -esac diff --git a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/proc-fs-nfsd.mount b/meta-openeuler/recipes-core/nfs-utils/nfs-utils/proc-fs-nfsd.mount deleted file mode 100644 index 630801b3751be2a9a6077522380eb7f35d82e96e..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/nfs-utils/nfs-utils/proc-fs-nfsd.mount +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=NFSD configuration filesystem -After=systemd-modules-load.service - -[Mount] -What=nfsd -Where=/proc/fs/nfsd -Type=nfsd diff --git a/meta-openeuler/recipes-core/nfs-utils/nfs-utils_2.5.4.bb b/meta-openeuler/recipes-core/nfs-utils/nfs-utils_2.5.4.bb deleted file mode 100644 index 7b4799e7a1b45bb7694a05977730a2775405a1f7..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/nfs-utils/nfs-utils_2.5.4.bb +++ /dev/null @@ -1,139 +0,0 @@ -SUMMARY = "userspace utilities for kernel nfs" -DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \ -NFS server and related tools." -HOMEPAGE = "http://nfs.sourceforge.net/" -SECTION = "console/network" - -LICENSE = "MIT & GPLv2+ & BSD" -LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84" - -# util-linux for libblkid -DEPENDS = "libcap libevent util-linux libtirpc" -RDEPENDS_${PN} = "${PN}-client" -RRECOMMENDS_${PN} = "kernel-module-nfsd" - -USERADD_PACKAGES = "${PN}-client" -USERADD_PARAM_${PN}-client = "--system --home-dir /var/lib/nfs \ - --shell /bin/false --user-group rpcuser" - -SRC_URI = "file://nfs-utils/${BP}.tar.xz \ - file://nfs-utils/0000-systemd-idmapd-require-rpc-pipefs.patch \ - file://nfs-utils/0001-correct-the-statd-path-in-man.patch \ - file://nfs-utils/0002-nfs-utils-set-use-gss-proxy-1-to-enable-gss-proxy-by.patch \ - file://nfs-utils/0003-idmapd-Fix-error-status-when-nfs-idmapd-exits.patch \ - file://nfs-utils/0004-fix-coredump-in-bl_add_disk.patch \ - file://nfsserver \ - file://nfscommon \ - file://nfs-utils.conf \ - file://nfs-server.service \ - file://nfs-mountd.service \ - file://nfs-statd.service \ - file://proc-fs-nfsd.mount \ - " -SRC_URI[sha256sum] = "51997d94e4c8bcef5456dd36a9ccc38e231207c4e9b6a9a2c108841e6aebe3dd" - -# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will -# pull in the remainder of the dependencies. - -INITSCRIPT_PACKAGES = "${PN} ${PN}-client" -INITSCRIPT_NAME = "nfsserver" -INITSCRIPT_PARAMS = "defaults" -INITSCRIPT_NAME_${PN}-client = "nfscommon" -INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21" - -inherit autotools-brokensep pkgconfig systemd - -SYSTEMD_PACKAGES = "${PN} ${PN}-client" -SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service" -SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service" - -# --enable-uuid is need for cross-compiling -EXTRA_OECONF = "--with-statduser=rpcuser \ - --enable-mountconfig \ - --enable-libmount-mount \ - --enable-uuid \ - --disable-gss \ - --disable-nfsdcltrack \ - --with-statdpath=/var/lib/nfs/statd \ - --with-rpcgen=${HOSTTOOLS_DIR}/rpcgen \ - " - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ -" -PACKAGECONFIG_remove_libc-musl = "tcp-wrappers" -PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," -# libdevmapper is available in meta-oe -PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper,libdevmapper" -# keyutils is available in meta-oe -PACKAGECONFIG[nfsv4] = "--enable-nfsv4,--disable-nfsv4,keyutils,python3-core" - -PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats" - -CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \ - ${localstatedir}/lib/nfs/rmtab \ - ${localstatedir}/lib/nfs/xtab \ - ${localstatedir}/lib/nfs/statd/state \ - ${sysconfdir}/nfsmount.conf" - -FILES_${PN}-client = "${sbindir}/*statd \ - ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \ - ${sbindir}/showmount ${sbindir}/nfsstat \ - ${localstatedir}/lib/nfs \ - ${sysconfdir}/nfs-utils.conf \ - ${sysconfdir}/nfsmount.conf \ - ${sysconfdir}/init.d/nfscommon \ - ${systemd_unitdir}/system/nfs-statd.service" -RDEPENDS_${PN}-client = "${PN}-mount" - -FILES_${PN}-mount = "${base_sbindir}/*mount.nfs*" - -FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat ${sbindir}/nfsdclnts" - -FILES_${PN}-staticdev += "${libdir}/libnfsidmap/*.a" - -FILES_${PN} += "${systemd_unitdir} ${libdir}/libnfsidmap/" - -do_configure_prepend() { - sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \ - ${S}/utils/mount/Makefile.am -} - -# Make clean needed because the package comes with -# precompiled 64-bit objects that break the build -do_compile_prepend() { - make clean -} - -# Works on systemd only -HIGH_RLIMIT_NOFILE ??= "4096" - -do_install_append () { - install -d ${D}${sysconfdir}/init.d - install -m 0750 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver - install -m 0750 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon - - install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir} - install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir} - - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/ - install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/ - install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/ - sed -i -e 's,@SBINDIR@,${sbindir},g' \ - -e 's,@SYSCONFDIR@,${sysconfdir},g' \ - -e 's,@HIGH_RLIMIT_NOFILE@,${HIGH_RLIMIT_NOFILE},g' \ - ${D}${systemd_unitdir}/system/*.service - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/ - install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/ - ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount - fi - - # kernel code as of 3.8 hard-codes this path as a default - install -d ${D}/var/lib/nfs/v4recovery - - chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state - - # Make python tools use python 3 - sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat -} diff --git a/meta-openeuler/recipes-core/openssh/openssh/sshd b/meta-openeuler/recipes-core/openssh/openssh/sshd deleted file mode 100644 index 98750729022417b44a26235a15c7a0c7126faf37..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/openssh/openssh/sshd +++ /dev/null @@ -1,24 +0,0 @@ -#%PAM-1.0 - -auth include common-auth -account required pam_nologin.so - -# SELinux needs to be the first session rule. This ensures that any -# lingering context has been cleared. Without out this it is possible -# that a module could execute code in the wrong domain. -# When the module is present, "required" would be sufficient (When SELinux -# is disabled, this returns success.) -#session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close - -account include common-account -password include common-password -session optional pam_keyinit.so force revoke -session include common-session -session required pam_loginuid.so - -# SELinux needs to intervene at login time to ensure that the process -# starts in the proper default security context. Only sessions which are -# intended to run in the user's context should be run after this. -# When the module is present, "required" would be sufficient (When SELinux -# is disabled, this returns success.) -#session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open diff --git a/meta-openeuler/recipes-core/openssh/openssh/sshd_config_readonly b/meta-openeuler/recipes-core/openssh/openssh/sshd_config_readonly deleted file mode 100644 index 5368a2ff5b9f2d5d2b40ef080c71985c2d21d42c..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/openssh/openssh/sshd_config_readonly +++ /dev/null @@ -1,116 +0,0 @@ -# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $ - -# This is the sshd server system-wide configuration file. See -# sshd_config(5) for more information. - -# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin - -# The strategy used for options in the default sshd_config shipped with -# OpenSSH is to specify options with their default value where -# possible, but leave them commented. Uncommented options override the -# default value. - -#Port 22 -#AddressFamily any -#ListenAddress 0.0.0.0 -#ListenAddress :: - - -# Ciphers and keying -#RekeyLimit default none - -# Logging -#SyslogFacility AUTH -#LogLevel INFO - -# Authentication: - -#LoginGraceTime 2m -#PermitRootLogin prohibit-password -#StrictModes yes -#MaxAuthTries 6 -#MaxSessions 10 - -#PubkeyAuthentication yes - -# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 -# but this is overridden so installations will only check .ssh/authorized_keys -AuthorizedKeysFile .ssh/authorized_keys - -#AuthorizedPrincipalsFile none - -#AuthorizedKeysCommand none -#AuthorizedKeysCommandUser nobody - -# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts -#HostbasedAuthentication no -# Change to yes if you don't trust ~/.ssh/known_hosts for -# HostbasedAuthentication -#IgnoreUserKnownHosts no -# Don't read the user's ~/.rhosts and ~/.shosts files -#IgnoreRhosts yes - -# To disable tunneled clear text passwords, change to no here! -#PasswordAuthentication yes -#PermitEmptyPasswords no - -# Change to no to disable s/key passwords -#ChallengeResponseAuthentication yes - -# Kerberos options -#KerberosAuthentication no -#KerberosOrLocalPasswd yes -#KerberosTicketCleanup yes -#KerberosGetAFSToken no - -# GSSAPI options -#GSSAPIAuthentication no -#GSSAPICleanupCredentials yes - -# Set this to 'yes' to enable PAM authentication, account processing, -# and session processing. If this is enabled, PAM authentication will -# be allowed through the ChallengeResponseAuthentication and -# PasswordAuthentication. Depending on your PAM configuration, -# PAM authentication via ChallengeResponseAuthentication may bypass -# the setting of "PermitRootLogin without-password". -# If you just want the PAM account and session checks to run without -# PAM authentication, then enable this but set PasswordAuthentication -# and ChallengeResponseAuthentication to 'no'. -UsePAM yes - -#AllowAgentForwarding yes -#AllowTcpForwarding yes -#GatewayPorts no -#X11Forwarding no -#X11DisplayOffset 10 -#X11UseLocalhost yes -#PermitTTY yes -#PrintMotd yes -#PrintLastLog yes -#TCPKeepAlive yes -#PermitUserEnvironment no -#Compression delayed -#ClientAliveInterval 0 -#ClientAliveCountMax 3 -#UseDNS no -#PidFile /var/run/sshd.pid -#MaxStartups 10:30:100 -#PermitTunnel no -#ChrootDirectory none -#VersionAddendum none - -# no default banner path -#Banner none - -# override default of no subsystems -Subsystem sftp /usr/libexec/sftp-server - -# Example of overriding settings on a per-user basis -#Match User anoncvs -# X11Forwarding no -# AllowTcpForwarding no -# PermitTTY no -# ForceCommand cvs server -HostKey /var/run/ssh/ssh_host_rsa_key -HostKey /var/run/ssh/ssh_host_ecdsa_key -HostKey /var/run/ssh/ssh_host_ed25519_key diff --git a/meta-openeuler/recipes-core/openssl/files/environment.d-openssl.sh b/meta-openeuler/recipes-core/openssl/files/environment.d-openssl.sh deleted file mode 100644 index d05a93b0f0d9b6ce3a6df333eb22fbebb8208288..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/openssl/files/environment.d-openssl.sh +++ /dev/null @@ -1 +0,0 @@ -export OPENSSL_CONF="$OECORE_NATIVE_SYSROOT/usr/lib/ssl/openssl.cnf" diff --git a/meta-openeuler/recipes-core/openssl/openssl.inc b/meta-openeuler/recipes-core/openssl/openssl.inc deleted file mode 100644 index a371265b860b137d498839b3717162b10e8fd9b3..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/openssl/openssl.inc +++ /dev/null @@ -1,236 +0,0 @@ -SUMMARY = "Secure Socket Layer" -DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools." -HOMEPAGE = "http://www.openssl.org/" -BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html" -SECTION = "libs/network" - -# "openssl | SSLeay" dual license -LICENSE = "openssl" - -DEPENDS = "perl-native-runtime nettle" -DEPENDS_append_class-target = " openssl-native" -#DEPENDS_append_class-target = " linux-libc-headers" - -SRC_URI = "file://openssl/${BP}.tar.gz \ - file://openssl/openssl-1.1.1-build.patch \ - file://openssl/openssl-1.1.1-fips.patch \ - file://0001-buildinfo-strip-sysroot-and-debug-prefix-map-from-co.patch \ - file://0001-skip-test_symbol_presence.patch \ - file://0003-Add-support-for-io_pgetevents_time64-syscall.patch \ - file://0004-Fixup-support-for-io_pgetevents_time64-syscall.patch \ - file://afalg.patch \ - file://reproducible.patch \ -" - -LIC_FILES_CHKSUM = "file://LICENSE;md5=d343e62fc9c833710bbbed25f27364c8" - -S = "${WORKDIR}/${BP}" - -PACKAGECONFIG[perl] = ",,," - -#AR_append = " r" -# Avoid binaries being marked as requiring an executable stack since it -# doesn't(which causes and this causes issues with SELinux -inherit utils -CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \ - -DTERMIO ${CFLAGS} -Wall -Wa,--noexecstack" - -# -02 does not work on mipsel: ssh hangs when it tries to read /dev/urandom -CFLAG_mtx-1 := "${@'${CFLAG}'.replace('-O2', '')}" -CFLAG_mtx-2 := "${@'${CFLAG}'.replace('-O2', '')}" - -export DIRS = "crypto ssl apps" -export EX_LIBS = "-lgcc -ldl" -export AS = "${CC} -c" - -inherit pkgconfig siteinfo multilib_header ptest - -PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf" -FILES_libcrypto = "${base_libdir}/libcrypto${SOLIBS}" -FILES_libssl = "${libdir}/libssl.so.*" -FILES_${PN} =+ " ${libdir}/ssl/*" -FILES_${PN}-misc = "${libdir}/ssl/misc ${bindir}/c_rehash" -RDEPENDS_${PN}-misc = "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}" -FILES_${PN}-dev += "${base_libdir}/libcrypto${SOLIBSDEV}" - -# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto -# package RRECOMMENDS on this package. This will enable the configuration -# file to be installed for both the base openssl package and the libcrypto -# package since the base openssl package depends on the libcrypto package. -FILES_openssl-conf = "${libdir}/ssl/openssl.cnf" -CONFFILES_openssl-conf = "${libdir}/ssl/openssl.cnf" -RRECOMMENDS_libcrypto += "openssl-conf" -RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc" - -# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE -# vulnerability -EXTRA_OECONF = " -no-ssl3" - -do_configure_prepend_darwin () { - sed -i -e '/version-script=openssl\.ld/d' Configure -} - -do_configure () { - cd util - perl perlpath.pl ${STAGING_BINDIR_NATIVE} - cd .. - ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/ - - os=${HOST_OS} - case $os in - linux-uclibc |\ - linux-uclibceabi |\ - linux-gnueabi |\ - linux-uclibcspe |\ - linux-gnuspe |\ - linux-musl*) - os=linux - ;; - *) - ;; - esac - if [ "${libdir}" != "/usr/libilp32" ]; then - target="$os-${HOST_ARCH}" - else - target="${HOST_OS}-${HOST_ARCH}" - fi - case $target in - linux-arm) - target=linux-armv4 - ;; - linux-armeb) - target=linux-elf-armeb - ;; - linux-aarch64*) - target=linux-generic64 - ;; - linux-gnuilp32-aarch64*) - target=linux-aarch64-ilp32 - ;; - linux-sh3) - target=debian-sh3 - ;; - linux-sh4) - target=debian-sh4 - ;; - linux-i486) - target=debian-i386-i486 - ;; - linux-i586 | linux-viac3) - target=debian-i386-i586 - ;; - linux-i686) - target=debian-i386-i686/cmov - ;; - linux-gnux32-x86_64) - target=linux-x32 - ;; - linux-gnu64-x86_64) - target=linux-x86_64 - ;; - linux-mips) - target=debian-mips - ;; - linux-mipsel) - target=debian-mipsel - ;; - linux-*-mips64) - target=linux-mips - ;; - linux-microblaze*) - target=linux-generic32 - ;; - linux-powerpc) - target=linux-ppc - ;; - linux-powerpc64) - target=linux-ppc64 - ;; - linux-supersparc) - target=linux-sparcv8 - ;; - linux-sparc) - target=linux-sparcv8 - ;; - darwin-i386) - target=darwin-i386-cc - ;; - esac - # inject machine-specific flags - sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure - useprefix=${prefix} - if [ "x$useprefix" = "x" ]; then - useprefix=/ - fi - perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=`basename ${libdir}` $target -} - -do_compile_prepend_class-target () { - sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile -} - -do_compile () { - oe_runmake -} - -do_compile_ptest () { - oe_runmake buildtest -} - -do_install () { - # Create ${D}/${prefix} to fix parallel issues - mkdir -p ${D}/${prefix}/ - - oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install - - oe_libinstall -so libcrypto ${D}${libdir} - oe_libinstall -so libssl ${D}${libdir} - - # Moving libcrypto to /lib - if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then - mkdir -p ${D}/${base_libdir}/ - mv ${D}${libdir}/libcrypto* ${D}${base_libdir}/ - sed -i s#libdir=\$\{exec_prefix\}\/lib#libdir=${base_libdir}# ${D}/${libdir}/pkgconfig/libcrypto.pc - fi - - install -d ${D}${includedir} - cp --dereference -R include/openssl ${D}${includedir} - - if [ "${libdir}" != "/usr/libilp32" ]; then - oe_multilib_header openssl/opensslconf.h - fi - - if [ "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}" = "perl" ]; then - install -m 0755 ${S}/tools/c_rehash ${D}${bindir} - sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${bindir}/c_rehash - sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl - sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget - # The c_rehash utility isn't installed by the normal installation process. - else - rm -f ${D}${bindir}/c_rehash - rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget - fi -} - -do_install_ptest () { - cp -r Makefile test ${D}${PTEST_PATH} - cp -r certs ${D}${PTEST_PATH} - mkdir -p ${D}${PTEST_PATH}/apps - ln -sf /usr/lib/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps - ln -sf /usr/lib/ssl/openssl.cnf ${D}${PTEST_PATH}/apps - ln -sf /usr/bin/openssl ${D}${PTEST_PATH}/apps - cp apps/server2.pem ${D}${PTEST_PATH}/apps - mkdir -p ${D}${PTEST_PATH}/util - install util/opensslwrap.sh ${D}${PTEST_PATH}/util - install util/shlib_wrap.sh ${D}${PTEST_PATH}/util -} - -do_install_append_virtclass-native() { - create_wrapper ${D}${bindir}/openssl \ - OPENSSL_CONF=${libdir}/ssl/openssl.cnf \ - SSL_CERT_DIR=${libdir}/ssl/certs \ - SSL_CERT_FILE=${libdir}/ssl/cert.pem \ - OPENSSL_ENGINES=${libdir}/ssl/engines -} - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/openssl/openssl/0001-skip-test_symbol_presence.patch b/meta-openeuler/recipes-core/openssl/openssl/0001-skip-test_symbol_presence.patch deleted file mode 100644 index f6032dca144b168751648d77905d9a3a3d06b310..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/openssl/openssl/0001-skip-test_symbol_presence.patch +++ /dev/null @@ -1,46 +0,0 @@ -From a9401b2289656c5a36dd1b0ecebf0d23e291ce70 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Tue, 2 Oct 2018 23:58:24 +0800 -Subject: [PATCH] skip test_symbol_presence - -We cannot skip `01-test_symbol_presence.t' by configuring option `no-shared' -as INSTALL told us the shared libraries will not be built. - -[INSTALL snip] - Notes on shared libraries - ------------------------- - - For most systems the OpenSSL Configure script knows what is needed to - build shared libraries for libcrypto and libssl. On these systems - the shared libraries will be created by default. This can be suppressed and - only static libraries created by using the "no-shared" option. On systems - where OpenSSL does not know how to build shared libraries the "no-shared" - option will be forced and only static libraries will be created. -[INSTALL snip] - -Hence directly modification the case to skip it. - -Upstream-Status: Inappropriate [OE Specific] - -Signed-off-by: Hongxu Jia ---- - test/recipes/01-test_symbol_presence.t | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/test/recipes/01-test_symbol_presence.t b/test/recipes/01-test_symbol_presence.t -index 7f2a2d7..0b93745 100644 ---- a/test/recipes/01-test_symbol_presence.t -+++ b/test/recipes/01-test_symbol_presence.t -@@ -14,8 +14,7 @@ use OpenSSL::Test::Utils; - - setup("test_symbol_presence"); - --plan skip_all => "Only useful when building shared libraries" -- if disabled("shared"); -+plan skip_all => "The case needs debug symbols then we just disable it"; - - my @libnames = ("crypto", "ssl"); - my $testcount = scalar @libnames; --- -2.7.4 - diff --git a/meta-openeuler/recipes-core/openssl/openssl/0003-Add-support-for-io_pgetevents_time64-syscall.patch b/meta-openeuler/recipes-core/openssl/openssl/0003-Add-support-for-io_pgetevents_time64-syscall.patch deleted file mode 100644 index bfd878a0e23038a30c74cae3598c118e0e86fa30..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/openssl/openssl/0003-Add-support-for-io_pgetevents_time64-syscall.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 5b5e2985f355c8e99c196d9ce5d02c15bebadfbc Mon Sep 17 00:00:00 2001 -From: Alistair Francis -Date: Thu, 29 Aug 2019 13:56:21 -0700 -Subject: [PATCH] Add support for io_pgetevents_time64 syscall - -32-bit architectures that are y2038 safe don't include syscalls that use -32-bit time_t. Instead these architectures have suffixed syscalls that -always use a 64-bit time_t. In the case of the io_getevents syscall the -syscall has been replaced with the io_pgetevents_time64 syscall instead. - -This patch changes the io_getevents() function to use the correct -syscall based on the avaliable syscalls and the time_t size. We will -only use the new 64-bit time_t syscall if the architecture is using a -64-bit time_t. This is to avoid having to deal with 32/64-bit -conversions and relying on a 64-bit timespec struct on 32-bit time_t -platforms. As of Linux 5.3 there are no 32-bit time_t architectures -without __NR_io_getevents. In the future if a 32-bit time_t architecture -wants to use the 64-bit syscalls we can handle the conversion. - -This fixes build failures on 32-bit RISC-V. - -Signed-off-by: Alistair Francis - -Reviewed-by: Richard Levitte -Reviewed-by: Paul Dale -(Merged from https://github.com/openssl/openssl/pull/9819) -Upstream-Status: Accepted ---- - engines/e_afalg.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/engines/e_afalg.c b/engines/e_afalg.c -index dacbe358cb..99516cb1bb 100644 ---- a/engines/e_afalg.c -+++ b/engines/e_afalg.c -@@ -125,7 +125,23 @@ static ossl_inline int io_getevents(aio_context_t ctx, long min, long max, - struct io_event *events, - struct timespec *timeout) - { -+#if defined(__NR_io_getevents) - return syscall(__NR_io_getevents, ctx, min, max, events, timeout); -+#elif defined(__NR_io_pgetevents_time64) -+ /* Let's only support the 64 suffix syscalls for 64-bit time_t. -+ * This simplifies the code for us as we don't need to use a 64-bit -+ * version of timespec with a 32-bit time_t and handle converting -+ * between 64-bit and 32-bit times and check for overflows. -+ */ -+ if (sizeof(timeout->tv_sec) == 8) -+ return syscall(__NR_io_pgetevents_time64, ctx, min, max, events, timeout, NULL); -+ else { -+ errno = ENOSYS; -+ return -1; -+ } -+#else -+# error "We require either the io_getevents syscall or __NR_io_pgetevents_time64." -+#endif - } - - static void afalg_waitfd_cleanup(ASYNC_WAIT_CTX *ctx, const void *key, --- -2.30.1 - diff --git a/meta-openeuler/recipes-core/openssl/openssl/0004-Fixup-support-for-io_pgetevents_time64-syscall.patch b/meta-openeuler/recipes-core/openssl/openssl/0004-Fixup-support-for-io_pgetevents_time64-syscall.patch deleted file mode 100644 index c16d490aec09578ad807246a042e5880641853a7..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/openssl/openssl/0004-Fixup-support-for-io_pgetevents_time64-syscall.patch +++ /dev/null @@ -1,99 +0,0 @@ -From e5499a3cac1e823c3e0697e8667e952317b70cc8 Mon Sep 17 00:00:00 2001 -From: Alistair Francis -Date: Thu, 4 Mar 2021 12:10:11 -0500 -Subject: [PATCH] Fixup support for io_pgetevents_time64 syscall - -This is a fixup for the original commit 5b5e2985f355c8e99c196d9ce5d02c15bebadfbc -"Add support for io_pgetevents_time64 syscall" that didn't correctly -work for 32-bit architecutres with a 64-bit time_t that aren't RISC-V. - -For a full discussion of the issue see: -https://github.com/openssl/openssl/commit/5b5e2985f355c8e99c196d9ce5d02c15bebadfbc - -Signed-off-by: Alistair Francis - -Reviewed-by: Tomas Mraz -Reviewed-by: Paul Dale -(Merged from https://github.com/openssl/openssl/pull/14432) -Upstream-Status: Accepted ---- - engines/e_afalg.c | 55 ++++++++++++++++++++++++++++++++++++----------- - 1 file changed, 42 insertions(+), 13 deletions(-) - -diff --git a/engines/e_afalg.c b/engines/e_afalg.c -index 9480d7c24b..4e9d67db2d 100644 ---- a/engines/e_afalg.c -+++ b/engines/e_afalg.c -@@ -124,27 +124,56 @@ static ossl_inline int io_read(aio_context_t ctx, long n, struct iocb **iocb) - return syscall(__NR_io_submit, ctx, n, iocb); - } - -+/* A version of 'struct timespec' with 32-bit time_t and nanoseconds. */ -+struct __timespec32 -+{ -+ __kernel_long_t tv_sec; -+ __kernel_long_t tv_nsec; -+}; -+ - static ossl_inline int io_getevents(aio_context_t ctx, long min, long max, - struct io_event *events, - struct timespec *timeout) - { -+#if defined(__NR_io_pgetevents_time64) -+ /* Check if we are a 32-bit architecture with a 64-bit time_t */ -+ if (sizeof(*timeout) != sizeof(struct __timespec32)) { -+ int ret = syscall(__NR_io_pgetevents_time64, ctx, min, max, events, -+ timeout, NULL); -+ if (ret == 0 || errno != ENOSYS) -+ return ret; -+ } -+#endif -+ - #if defined(__NR_io_getevents) -- return syscall(__NR_io_getevents, ctx, min, max, events, timeout); --#elif defined(__NR_io_pgetevents_time64) -- /* Let's only support the 64 suffix syscalls for 64-bit time_t. -- * This simplifies the code for us as we don't need to use a 64-bit -- * version of timespec with a 32-bit time_t and handle converting -- * between 64-bit and 32-bit times and check for overflows. -- */ -- if (sizeof(timeout->tv_sec) == 8) -- return syscall(__NR_io_pgetevents_time64, ctx, min, max, events, timeout, NULL); -+ if (sizeof(*timeout) == sizeof(struct __timespec32)) -+ /* -+ * time_t matches our architecture length, we can just use -+ * __NR_io_getevents -+ */ -+ return syscall(__NR_io_getevents, ctx, min, max, events, timeout); - else { -- errno = ENOSYS; -- return -1; -+ /* -+ * We don't have __NR_io_pgetevents_time64, but we are using a -+ * 64-bit time_t on a 32-bit architecture. If we can fit the -+ * timeout value in a 32-bit time_t, then let's do that -+ * and then use the __NR_io_getevents syscall. -+ */ -+ if (timeout && timeout->tv_sec == (long)timeout->tv_sec) { -+ struct __timespec32 ts32; -+ -+ ts32.tv_sec = (__kernel_long_t) timeout->tv_sec; -+ ts32.tv_nsec = (__kernel_long_t) timeout->tv_nsec; -+ -+ return syscall(__NR_io_getevents, ctx, min, max, events, ts32); -+ } else { -+ return syscall(__NR_io_getevents, ctx, min, max, events, NULL); -+ } - } --#else --# error "We require either the io_getevents syscall or __NR_io_pgetevents_time64." - #endif -+ -+ errno = ENOSYS; -+ return -1; - } - - static void afalg_waitfd_cleanup(ASYNC_WAIT_CTX *ctx, const void *key, --- -2.30.1 - diff --git a/meta-openeuler/recipes-core/openssl/openssl/find.pl b/meta-openeuler/recipes-core/openssl/openssl/find.pl deleted file mode 100644 index 257d6276c821f0a38e8b9a39a583f5be6154e1c0..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/openssl/openssl/find.pl +++ /dev/null @@ -1,54 +0,0 @@ -warn "Legacy library @{[(caller(0))[6]]} will be removed from the Perl core distribution in the next major release. Please install it from the CPAN distribution Perl4::CoreLibs. It is being used at @{[(caller)[1]]}, line @{[(caller)[2]]}.\n"; - -# This library is deprecated and unmaintained. It is included for -# compatibility with Perl 4 scripts which may use it, but it will be -# removed in a future version of Perl. Please use the File::Find module -# instead. - -# Usage: -# require "find.pl"; -# -# &find('/foo','/bar'); -# -# sub wanted { ... } -# where wanted does whatever you want. $dir contains the -# current directory name, and $_ the current filename within -# that directory. $name contains "$dir/$_". You are cd'ed -# to $dir when the function is called. The function may -# set $prune to prune the tree. -# -# For example, -# -# find / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune -# -# corresponds to this -# -# sub wanted { -# /^\.nfs.*$/ && -# (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -# int(-M _) > 7 && -# unlink($_) -# || -# ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) && -# $dev < 0 && -# ($prune = 1); -# } -# -# Set the variable $dont_use_nlink if you're using AFS, since AFS cheats. - -use File::Find (); - -*name = *File::Find::name; -*prune = *File::Find::prune; -*dir = *File::Find::dir; -*topdir = *File::Find::topdir; -*topdev = *File::Find::topdev; -*topino = *File::Find::topino; -*topmode = *File::Find::topmode; -*topnlink = *File::Find::topnlink; - -sub find { - &File::Find::find(\&wanted, @_); -} - -1; diff --git a/meta-openeuler/recipes-core/openssl/openssl/reproducible.patch b/meta-openeuler/recipes-core/openssl/openssl/reproducible.patch deleted file mode 100644 index 35441f304d4dbe70822200443370ad92907c23d9..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/openssl/openssl/reproducible.patch +++ /dev/null @@ -1,32 +0,0 @@ -The value for perl_archname can vary depending on the host, e.g. -x86_64-linux-gnu-thread-multi or x86_64-linux-thread-multi which -makes the ptest package non-reproducible. Its unused other than -these references so drop it. - -RP 2020/2/6 - -Upstream-Status: Pending -Signed-off-by: Richard Purdie - -Index: openssl-1.1.1d/Configure -=================================================================== ---- openssl-1.1.1d.orig/Configure -+++ openssl-1.1.1d/Configure -@@ -286,7 +286,7 @@ if (defined env($local_config_envname)) - # Save away perl command information - $config{perl_cmd} = $^X; - $config{perl_version} = $Config{version}; --$config{perl_archname} = $Config{archname}; -+#$config{perl_archname} = $Config{archname}; - - $config{prefix}=""; - $config{openssldir}=""; -@@ -2517,7 +2517,7 @@ _____ - @{$config{perlargv}}), "\n"; - print "\nPerl information:\n\n"; - print ' ',$config{perl_cmd},"\n"; -- print ' ',$config{perl_version},' for ',$config{perl_archname},"\n"; -+ print ' ',$config{perl_version},"\n"; - } - if ($dump || $options) { - my $longest = 0; diff --git a/meta-openeuler/recipes-core/openssl/openssl_1.1.1m.bb b/meta-openeuler/recipes-core/openssl/openssl_1.1.1m.bb deleted file mode 100644 index a1976e482122a0e46ba4cddb94e3d18ec49ca352..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/openssl/openssl_1.1.1m.bb +++ /dev/null @@ -1,177 +0,0 @@ -require openssl.inc -SUMMARY = "Secure Socket Layer" -DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools." -HOMEPAGE = "http://www.openssl.org/" -BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html" -SECTION = "libs/network" - -# "openssl" here actually means both OpenSSL and SSLeay licenses apply -# (see meta/files/common-licenses/OpenSSL to which "openssl" is SPDXLICENSEMAPped) -LICENSE = "openssl" - -DEPENDS = "hostperl-runtime-native" - -inherit lib_package multilib_header -MULTILIB_SCRIPTS = "${PN}-bin:${bindir}/c_rehash" - -PACKAGECONFIG ?= "" -PACKAGECONFIG_class-native = "" -PACKAGECONFIG_class-nativesdk = "" - -PACKAGECONFIG[cryptodev-linux] = "enable-devcryptoeng,disable-devcryptoeng,cryptodev-linux" - -#| ./libcrypto.so: undefined reference to `getcontext' -#| ./libcrypto.so: undefined reference to `setcontext' -#| ./libcrypto.so: undefined reference to `makecontext' -EXTRA_OECONF_append_libc-musl = " no-async" -EXTRA_OECONF_append_libc-musl_powerpc64 = " no-asm" - -# This prevents openssl from using getrandom() which is not available on older glibc versions -# (native versions can be built with newer glibc, but then relocated onto a system with older glibc) -EXTRA_OECONF_class-native = "--with-rand-seed=devrandom" -EXTRA_OECONF_class-nativesdk = "--with-rand-seed=devrandom" - -# Relying on hardcoded built-in paths causes openssl-native to not be relocateable from sstate. -CFLAGS_append_class-native = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" -CFLAGS_append_class-nativesdk = " -DOPENSSLDIR=/not/builtin -DENGINESDIR=/not/builtin" -CFLAGS_append += "${LDFLAGS}" - -EXTRA_OECONF_arm32a15eb += " -no-asm" - -do_configure () { - os=${HOST_OS} - case $os in - linux-gnueabi |\ - linux-gnuspe |\ - linux-musleabi |\ - linux-muslspe |\ - linux-musl ) - os=linux - ;; - *) - ;; - esac - target="$os-${HOST_ARCH}" - case $target in - linux-arm*) - target=linux-armv4 - ;; - linux-aarch64*) - target=linux-aarch64 - ;; - linux-i?86 | linux-viac3) - target=linux-x86 - ;; - linux-gnux32-x86_64 | linux-muslx32-x86_64 ) - target=linux-x32 - ;; - linux-gnu64-x86_64) - target=linux-x86_64 - ;; - linux-mips | linux-mipsel) - # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags - target="linux-mips32 ${TARGET_CC_ARCH}" - ;; - linux-gnun32-mips*) - target=linux-mips64 - ;; - linux-*-mips64 | linux-mips64 | linux-*-mips64el | linux-mips64el) - target=linux64-mips64 - ;; - linux-microblaze* | linux-nios2* | linux-sh3 | linux-sh4 | linux-arc*) - target=linux-generic32 - ;; - linux-powerpc) - target=linux-ppc - ;; - linux-powerpc64) - target=linux-ppc64 - ;; - linux-riscv32) - target=linux-generic32 - ;; - linux-riscv64) - target=linux-generic64 - ;; - linux-sparc | linux-supersparc) - target=linux-sparcv9 - ;; - linux-gnu_ilp32*) - target=linux-arm64ilp32 - ;; - esac - - useprefix=${prefix} - if [ "x$useprefix" = "x" ]; then - useprefix=/ - fi - # WARNING: do not set compiler/linker flags (-I/-D etc.) in EXTRA_OECONF, as they will fully replace the - # environment variables set by bitbake. Adjust the environment variables instead. - if [ target = "linux-arm64ilp32" ]; then - perl ./Configure --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdir} $target - else - perl ./Configure ${EXTRA_OECONF} ${PACKAGECONFIG_CONFARGS} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdir} $target - fi - -} - -do_install () { - oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install - - oe_multilib_header openssl/opensslconf.h - - # Create SSL structure for packages such as ca-certificates which - # contain hard-coded paths to /etc/ssl. Debian does the same. - install -d ${D}${sysconfdir}/ssl - mv ${D}${libdir}/ssl-1.1/certs \ - ${D}${libdir}/ssl-1.1/private \ - ${D}${libdir}/ssl-1.1/openssl.cnf \ - ${D}${sysconfdir}/ssl/ - - # Although absolute symlinks would be OK for the target, they become - # invalid if native or nativesdk are relocated from sstate. - ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/certs')} ${D}${libdir}/ssl-1.1/certs - ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/private')} ${D}${libdir}/ssl-1.1/private - ln -sf ${@oe.path.relative('${libdir}/ssl-1.1', '${sysconfdir}/ssl/openssl.cnf')} ${D}${libdir}/ssl-1.1/openssl.cnf -} - -do_install_append_class-native () { - create_wrapper ${D}${bindir}/openssl \ - OPENSSL_CONF=${libdir}/ssl-1.1/openssl.cnf \ - SSL_CERT_DIR=${libdir}/ssl-1.1/certs \ - SSL_CERT_FILE=${libdir}/ssl-1.1/cert.pem \ - OPENSSL_ENGINES=${libdir}/ssl-1.1/engines -} - -do_install_append_class-nativesdk () { - mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d - install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh - sed 's|/usr/lib/ssl/|/usr/lib/ssl-1.1/|g' -i ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh -} - -# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto -# package RRECOMMENDS on this package. This will enable the configuration -# file to be installed for both the openssl-bin package and the libcrypto -# package since the openssl-bin package depends on the libcrypto package. - -FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}" -FILES_libssl = "${libdir}/libssl${SOLIBS}" -FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf" -FILES_${PN}-engines = "${libdir}/engines-1.1" -FILES_${PN}-misc = "${libdir}/ssl-1.1/misc" -FILES_${PN} += "${libdir}/ssl-1.1/* ${sysconfdir}/ssl/*" -FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh" -FILES_${PN} += "${libdir}/engines-1.1/*" - -CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf" - -RRECOMMENDS_libcrypto += "openssl-conf" -RDEPENDS_${PN}-ptest += "openssl-bin perl perl-modules bash" - -# Remove bash dependencies for all image -RDEPENDS_${PN}-ptest_remove += "bash" - -BBCLASSEXTEND = "native nativesdk" - -CVE_PRODUCT = "openssl:openssl" - diff --git a/meta-openeuler/recipes-core/os-base/os-base/LICENSE b/meta-openeuler/recipes-core/os-base/os-base/LICENSE deleted file mode 100644 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/LICENSE +++ /dev/null @@ -1 +0,0 @@ - diff --git a/meta-openeuler/recipes-core/os-base/os-base/bashrc b/meta-openeuler/recipes-core/os-base/os-base/bashrc deleted file mode 100644 index 619ea72ba08d9f0c2cfd4bfeb3e06ab52e568ae1..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/bashrc +++ /dev/null @@ -1,3 +0,0 @@ -TMOUT=300 -umask 077 -export TMOUT diff --git a/meta-openeuler/recipes-core/os-base/os-base/ethertypes b/meta-openeuler/recipes-core/os-base/os-base/ethertypes new file mode 100644 index 0000000000000000000000000000000000000000..caa9f56b1365d4f9c384c48477c516c03976255b --- /dev/null +++ b/meta-openeuler/recipes-core/os-base/os-base/ethertypes @@ -0,0 +1,45 @@ +# Ethernet frame types +# +# The EtherType is a two-octet field of Ethernet frames used to indicate +# which protocol is contained in their payload. +# +# More entries, mostly historical, can be found on: +# https://www.iana.org/assignments/ieee-802-numbers/ +# http://standards-oui.ieee.org/ethertype/eth.txt +# +# ... # Comment +# +IPv4 0800 ip ip4 # IP (IPv4) +X25 0805 +ARP 0806 ether-arp # Address Resolution Protocol +FR_ARP 0808 # Frame Relay ARP [RFC1701] +BPQ 08FF # G8BPQ AX.25 over Ethernet +TRILL 22F3 # TRILL [RFC6325] +L2-IS-IS 22F4 # TRILL IS-IS [RFC6325] +TEB 6558 # Transparent Ethernet Bridging [RFC1701] +RAW_FR 6559 # Raw Frame Relay [RFC1701] +RARP 8035 # Reverse ARP [RFC903] +ATALK 809B # Appletalk +AARP 80F3 # Appletalk Address Resolution Protocol +802_1Q 8100 8021q 1q 802.1q dot1q # VLAN tagged frame [802.1q] +IPX 8137 # Novell IPX +NetBEUI 8191 # NetBEUI +IPv6 86DD ip6 # IP version 6 +PPP 880B # Point-to-Point Protocol +MPLS 8847 # MPLS [RFC5332] +MPLS_MULTI 8848 # MPLS with upstream-assigned label [RFC5332] +ATMMPOA 884C # MultiProtocol over ATM +PPP_DISC 8863 # PPP over Ethernet discovery stage +PPP_SES 8864 # PPP over Ethernet session stage +ATMFATE 8884 # Frame-based ATM Transport over Ethernet +EAPOL 888E # EAP over LAN [802.1x] +S-TAG 88A8 # QinQ Service VLAN tag identifier [802.1q] +EAP_PREAUTH 88C7 # EAPOL Pre-Authentication [802.11i] +LLDP 88CC # Link Layer Discovery Protocol [802.1ab] +MACSEC 88E5 # Media Access Control Security [802.1ae] +PBB 88E7 macinmac # Provider Backbone Bridging [802.1ah] +MVRP 88F5 # Multiple VLAN Registration Protocol [802.1q] +PTP 88F7 # Precision Time Protocol +FCOE 8906 # Fibre Channel over Ethernet +FIP 8914 # FCoE Initialization Protocol +ROCE 8915 # RDMA over Converged Ethernet diff --git a/meta-openeuler/recipes-core/os-base/os-base/fstab b/meta-openeuler/recipes-core/os-base/os-base/fstab deleted file mode 100644 index bf3c16e8aa93aa68005d0ad2c71dd59fac1d6ae0..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/fstab +++ /dev/null @@ -1,8 +0,0 @@ -proc /proc proc defaults 0 0 -sysfs /sys sysfs defaults 0 0 -none /var tmpfs nodev,nosuid,mode=755,noexec 0 0 -none /var/log/audit tmpfs nodev,nosuid,mode=755 0 0 -devtmpfs /dev devtmpfs defaults 0 0 -tmpfs /dev/shm tmpfs nodev,nosuid,mode=1777,noexec 0 0 -devpts /dev/pts devpts mode=620 0 0 -tmpfs /tmp tmpfs nodev,nosuid,noexec 0 0 diff --git a/meta-openeuler/recipes-core/os-base/os-base/group b/meta-openeuler/recipes-core/os-base/os-base/group deleted file mode 100644 index 007e06d70f44be10167203888e004324588a76a6..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/group +++ /dev/null @@ -1,2 +0,0 @@ -root:x:0: -sshd:x:502: diff --git a/meta-openeuler/recipes-core/os-base/os-base/inittab b/meta-openeuler/recipes-core/os-base/os-base/inittab deleted file mode 100644 index cdc0f97b5c537b70da148165db6eefc297cc6e61..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/inittab +++ /dev/null @@ -1,3 +0,0 @@ -::sysinit:/etc/rc.d/rc.sysinit -::respawn:/sbin/getty -L 115200 ttyAMA0 vt102 -::ctrlaltdel:/bin/false diff --git a/meta-openeuler/recipes-core/os-base/os-base/issue b/meta-openeuler/recipes-core/os-base/os-base/issue deleted file mode 100644 index eb110ba757c91351a720a6fbd1d79fd4694250cc..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/issue +++ /dev/null @@ -1 +0,0 @@ -Authorized uses only. All activity may be monitored and reported. diff --git a/meta-openeuler/recipes-core/os-base/os-base/issue.net b/meta-openeuler/recipes-core/os-base/os-base/issue.net deleted file mode 100644 index eb110ba757c91351a720a6fbd1d79fd4694250cc..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/issue.net +++ /dev/null @@ -1 +0,0 @@ -Authorized uses only. All activity may be monitored and reported. diff --git a/meta-openeuler/recipes-core/os-base/os-base/modules b/meta-openeuler/recipes-core/os-base/os-base/modules deleted file mode 100644 index 4072fc4e90af0a5a4784674dec19b203c7947891..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/modules +++ /dev/null @@ -1,30 +0,0 @@ -llc -stp -garp -8021q -af_packet -libcrc32c -tunnel4 -x_tables -inet_diag -nf_defrag_ipv4 -nf_defrag_ipv6 -nf_conntrack -nf_nat -xt_tcpudp -crc-ccitt -ipv6 -ip6_udp_tunnel -ip6_tables -ip6table_filter -nf_reject_ipv6 -ip_tunnel -ipip -ip_tables -nf_reject_ipv4 -ipt_REJECT -iptable_filter -ip6t_REJECT -xt_nat -iptable_nat -ip6table_nat diff --git a/meta-openeuler/recipes-core/os-base/os-base/motd b/meta-openeuler/recipes-core/os-base/os-base/motd deleted file mode 100644 index eb110ba757c91351a720a6fbd1d79fd4694250cc..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/motd +++ /dev/null @@ -1 +0,0 @@ -Authorized uses only. All activity may be monitored and reported. diff --git a/meta-openeuler/recipes-core/os-base/os-base/passwd b/meta-openeuler/recipes-core/os-base/os-base/passwd deleted file mode 100644 index 6b34777a4248d8593c1e7e4f409a940427ed76da..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/passwd +++ /dev/null @@ -1,2 +0,0 @@ -root:x:0:0:root:/root:/bin/bash -sshd:x:502:502:sshd privsep::/bin/false diff --git a/meta-openeuler/recipes-core/os-base/os-base/profile b/meta-openeuler/recipes-core/os-base/os-base/profile deleted file mode 100644 index bc66fd1e73e2a547dc20ce53667ebc55ae21f3fc..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/profile +++ /dev/null @@ -1,58 +0,0 @@ -# /etc/profile -# init bash prompt and enviroment. -# -# - -PS1="\[\033[32m\]\h \w\[\033[m\] \\$ " - -#init PATH -PATH=/usr/local/bin:/usr/bin:/bin -if [ `id -u` -eq 0 ]; then - PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:$PATH -fi - -ulimit -c 0 - -if [ `id -u` -eq 0 ]; then - umask 077 -else - umask 077 -fi - -USER=`id -un` -LOGNAME=$USER - -HOSTNAME=`/bin/hostname` -HISTSIZE=1000 - -TMOUT=300 - -EDITOR=vi -VISUAL=vi - -PAGER=more - -INPUTRC="/etc/inputrc" - -export PATH PS1 USER LOGNAME HOSTNAME HISTSIZE EDITOR VISUAL PAGER INPUTRC TMOUT - - -# Running the local scripts from the user -for i in /etc/profile.d/*.sh ; do - if [ -x $i ]; then - . $i - fi -done -unset i - -alias ls="ls --color=auto" -alias ll="ls -l" -PS1="\[\033[32m\]\h \w\[\033[m\] \\$ " -export PS1 -export TERM=vt200 -PS1="\[\033[32m\]\H \w\[\033[m\] \\$ " -export PS1 -export VERSION=1.0 -export PRODUCT_NAME=openeuler -export HISTSIZE TMOUT -alias su='su -l' diff --git a/meta-openeuler/recipes-core/os-base/os-base/protocols b/meta-openeuler/recipes-core/os-base/os-base/protocols new file mode 100644 index 0000000000000000000000000000000000000000..1f112b166876723aec07b34146154464b25a4ff1 --- /dev/null +++ b/meta-openeuler/recipes-core/os-base/os-base/protocols @@ -0,0 +1,64 @@ +# Internet (IP) protocols +# +# Updated from http://www.iana.org/assignments/protocol-numbers and other +# sources. +# New protocols will be added on request if they have been officially +# assigned by IANA and are not historical. +# If you need a huge list of used numbers please install the nmap package. + +ip 0 IP # internet protocol, pseudo protocol number +hopopt 0 HOPOPT # IPv6 Hop-by-Hop Option [RFC1883] +icmp 1 ICMP # internet control message protocol +igmp 2 IGMP # Internet Group Management +ggp 3 GGP # gateway-gateway protocol +ipencap 4 IP-ENCAP # IP encapsulated in IP (officially ``IP'') +st 5 ST # ST datagram mode +tcp 6 TCP # transmission control protocol +egp 8 EGP # exterior gateway protocol +igp 9 IGP # any private interior gateway (Cisco) +pup 12 PUP # PARC universal packet protocol +udp 17 UDP # user datagram protocol +hmp 20 HMP # host monitoring protocol +xns-idp 22 XNS-IDP # Xerox NS IDP +rdp 27 RDP # "reliable datagram" protocol +iso-tp4 29 ISO-TP4 # ISO Transport Protocol class 4 [RFC905] +dccp 33 DCCP # Datagram Congestion Control Prot. [RFC4340] +xtp 36 XTP # Xpress Transfer Protocol +ddp 37 DDP # Datagram Delivery Protocol +idpr-cmtp 38 IDPR-CMTP # IDPR Control Message Transport +ipv6 41 IPv6 # Internet Protocol, version 6 +ipv6-route 43 IPv6-Route # Routing Header for IPv6 +ipv6-frag 44 IPv6-Frag # Fragment Header for IPv6 +idrp 45 IDRP # Inter-Domain Routing Protocol +rsvp 46 RSVP # Reservation Protocol +gre 47 GRE # General Routing Encapsulation +esp 50 IPSEC-ESP # Encap Security Payload [RFC2406] +ah 51 IPSEC-AH # Authentication Header [RFC2402] +skip 57 SKIP # SKIP +ipv6-icmp 58 IPv6-ICMP # ICMP for IPv6 +ipv6-nonxt 59 IPv6-NoNxt # No Next Header for IPv6 +ipv6-opts 60 IPv6-Opts # Destination Options for IPv6 +rspf 73 RSPF CPHB # Radio Shortest Path First (officially CPHB) +vmtp 81 VMTP # Versatile Message Transport +eigrp 88 EIGRP # Enhanced Interior Routing Protocol (Cisco) +ospf 89 OSPFIGP # Open Shortest Path First IGP +ax.25 93 AX.25 # AX.25 frames +ipip 94 IPIP # IP-within-IP Encapsulation Protocol +etherip 97 ETHERIP # Ethernet-within-IP Encapsulation [RFC3378] +encap 98 ENCAP # Yet Another IP encapsulation [RFC1241] +# 99 # any private encryption scheme +pim 103 PIM # Protocol Independent Multicast +ipcomp 108 IPCOMP # IP Payload Compression Protocol +vrrp 112 VRRP # Virtual Router Redundancy Protocol [RFC5798] +l2tp 115 L2TP # Layer Two Tunneling Protocol [RFC2661] +isis 124 ISIS # IS-IS over IPv4 +sctp 132 SCTP # Stream Control Transmission Protocol +fc 133 FC # Fibre Channel +mobility-header 135 Mobility-Header # Mobility Support for IPv6 [RFC3775] +udplite 136 UDPLite # UDP-Lite [RFC3828] +mpls-in-ip 137 MPLS-in-IP # MPLS-in-IP [RFC4023] +manet 138 # MANET Protocols [RFC5498] +hip 139 HIP # Host Identity Protocol +shim6 140 Shim6 # Shim6 Protocol [RFC5533] +wesp 141 WESP # Wrapped Encapsulating Security Payload +rohc 142 ROHC # Robust Header Compression diff --git a/meta-openeuler/recipes-core/os-base/os-base/rc.local b/meta-openeuler/recipes-core/os-base/os-base/rc.local deleted file mode 100644 index 401d32680ef215b0e38d970554ad22d3f3fbbda5..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/rc.local +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -. /etc/init.d/auditd start -/usr/sbin/rsyslogd - -chmod 640 /var/log/* -chmod 640 /dev/mem -chmod 600 /var/log/audit/audit.log - -. /etc/init.d/sshd start 1>/dev/null 2>&1 & diff --git a/meta-openeuler/recipes-core/os-base/os-base/rc.sysinit b/meta-openeuler/recipes-core/os-base/os-base/rc.sysinit index a8c226d1e822ed2436ccff07a50fd1a9d57c43a4..fe197f620d53439d5254ceb1ddac745ce7ce9f04 100644 --- a/meta-openeuler/recipes-core/os-base/os-base/rc.sysinit +++ b/meta-openeuler/recipes-core/os-base/os-base/rc.sysinit @@ -1,45 +1,13 @@ #! /bin/sh - PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin -function fs_mount() -{ - echo "mount file system" - mount_a -} - -function loading_module() -{ - echo "Loading the kernel modules: " - depmod - cat /etc/modules | sed -e '/^[ \t]*$/d' | - while read module - do - echo "Loading module: $module" - modprobe $module - done -} - -. /etc/rc.d/rc.functions - -# mount file system - fs_mount - -# load kernel modules - loading_module - -#creating a soft link for /dev/fd to /proc/self/fd - ln -s /proc/self/fd /dev/fd - +# include rc.functions + . /etc/init.d/rc.functions # creating device driver instances echo "Making device instances:" echo /sbin/mdev > /proc/sys/kernel/hotplug mdev -s -# setting up initial hostname - echo "Setting hostname: " - hostname -F /etc/hostname - # Cleaning up the Directory tmp echo "Cleaning up tmp :" rm -rf /tmp/* >/dev/null @@ -47,31 +15,13 @@ function loading_module() #touch /var/log/wtmp to record user login history touch /var/log/wtmp -# setting up the sysctl confgiruaton options - echo "Setting up the sysctl configurations:" - sysctl -p /etc/sysctl.conf > /dev/null - # setting up localhost loopback interface echo "Setting up interface lo: " ifconfig lo up 127.0.0.1 -# running local startup scripts - echo "Running local startup scripts." - for i in `ls /etc/rc.d/rc.start/* 2>/dev/null` ; do - if [ -x $i ]; then - $i start - fi - done - #print uptime after finish running rc.start if [ -r /proc/uptime ] then echo -n "System booting cost:" cat /proc/uptime fi - -# calling user defined scripts if any - if [ -x /etc/rc.d/rc.local ]; then - /etc/rc.d/rc.local - fi - diff --git a/meta-openeuler/recipes-core/os-base/os-base/rcS b/meta-openeuler/recipes-core/os-base/os-base/rcS deleted file mode 100644 index fc699e4723cd15a0ec0dd14b12555d1bd85c5dee..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/rcS +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -/bin/mount -a diff --git a/meta-openeuler/recipes-core/os-base/os-base/rpc b/meta-openeuler/recipes-core/os-base/os-base/rpc new file mode 100644 index 0000000000000000000000000000000000000000..1b306254330d0395c8a5cc9dbe2cf293a825032e --- /dev/null +++ b/meta-openeuler/recipes-core/os-base/os-base/rpc @@ -0,0 +1,40 @@ +# This file contains user readable names that can be used in place of rpc +# program numbers. + +portmapper 100000 portmap sunrpc +rstatd 100001 rstat rstat_svc rup perfmeter +rusersd 100002 rusers +nfs 100003 nfsprog +ypserv 100004 ypprog +mountd 100005 mount showmount +ypbind 100007 +walld 100008 rwall shutdown +yppasswdd 100009 yppasswd +etherstatd 100010 etherstat +rquotad 100011 rquotaprog quota rquota +sprayd 100012 spray +3270_mapper 100013 +rje_mapper 100014 +selection_svc 100015 selnsvc +database_svc 100016 +rexd 100017 rex +alis 100018 +sched 100019 +llockmgr 100020 +nlockmgr 100021 +x25.inr 100022 +statmon 100023 +status 100024 +bootparam 100026 +ypupdated 100028 ypupdate +keyserv 100029 keyserver +tfsd 100037 +nsed 100038 +nsemntd 100039 +ypxfrd 100069 +pcnfsd 150001 +amd 300019 amq +sgi_fam 391002 +ugidd 545580417 +fypxfrd 600100069 freebsd-ypxfrd +bwnfsd 788585389 diff --git a/meta-openeuler/recipes-core/os-base/os-base/securetty b/meta-openeuler/recipes-core/os-base/os-base/securetty deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/meta-openeuler/recipes-core/os-base/os-base/services b/meta-openeuler/recipes-core/os-base/os-base/services new file mode 100644 index 0000000000000000000000000000000000000000..2120524c9a15964fbeb2796f2eedcd813b0b386c --- /dev/null +++ b/meta-openeuler/recipes-core/os-base/os-base/services @@ -0,0 +1,364 @@ +# Network services, Internet style +# +# Note that it is presently the policy of IANA to assign a single well-known +# port number for both TCP and UDP; hence, officially ports have two entries +# even if the protocol doesn't support UDP operations. +# +# Updated from https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml . +# +# New ports will be added on request if they have been officially assigned +# by IANA and used in the real-world or are needed by a debian package. +# If you need a huge list of used numbers please install the nmap package. + +tcpmux 1/tcp # TCP port service multiplexer +echo 7/tcp +echo 7/udp +discard 9/tcp sink null +discard 9/udp sink null +systat 11/tcp users +daytime 13/tcp +daytime 13/udp +netstat 15/tcp +qotd 17/tcp quote +chargen 19/tcp ttytst source +chargen 19/udp ttytst source +ftp-data 20/tcp +ftp 21/tcp +fsp 21/udp fspd +ssh 22/tcp # SSH Remote Login Protocol +telnet 23/tcp +smtp 25/tcp mail +time 37/tcp timserver +time 37/udp timserver +whois 43/tcp nicname +tacacs 49/tcp # Login Host Protocol (TACACS) +tacacs 49/udp +domain 53/tcp # Domain Name Server +domain 53/udp +bootps 67/udp +bootpc 68/udp +tftp 69/udp +gopher 70/tcp # Internet Gopher +finger 79/tcp +http 80/tcp www # WorldWideWeb HTTP +kerberos 88/tcp kerberos5 krb5 kerberos-sec # Kerberos v5 +kerberos 88/udp kerberos5 krb5 kerberos-sec # Kerberos v5 +iso-tsap 102/tcp tsap # part of ISODE +acr-nema 104/tcp dicom # Digital Imag. & Comm. 300 +pop3 110/tcp pop-3 # POP version 3 +sunrpc 111/tcp portmapper # RPC 4.0 portmapper +sunrpc 111/udp portmapper +auth 113/tcp authentication tap ident +nntp 119/tcp readnews untp # USENET News Transfer Protocol +ntp 123/udp # Network Time Protocol +epmap 135/tcp loc-srv # DCE endpoint resolution +netbios-ns 137/udp # NETBIOS Name Service +netbios-dgm 138/udp # NETBIOS Datagram Service +netbios-ssn 139/tcp # NETBIOS session service +imap2 143/tcp imap # Interim Mail Access P 2 and 4 +snmp 161/tcp # Simple Net Mgmt Protocol +snmp 161/udp +snmp-trap 162/tcp snmptrap # Traps for SNMP +snmp-trap 162/udp snmptrap +cmip-man 163/tcp # ISO mgmt over IP (CMOT) +cmip-man 163/udp +cmip-agent 164/tcp +cmip-agent 164/udp +mailq 174/tcp # Mailer transport queue for Zmailer +xdmcp 177/udp # X Display Manager Control Protocol +bgp 179/tcp # Border Gateway Protocol +smux 199/tcp # SNMP Unix Multiplexer +qmtp 209/tcp # Quick Mail Transfer Protocol +z3950 210/tcp wais # NISO Z39.50 database +ipx 213/udp # IPX [RFC1234] +ptp-event 319/udp +ptp-general 320/udp +pawserv 345/tcp # Perf Analysis Workbench +zserv 346/tcp # Zebra server +rpc2portmap 369/tcp +rpc2portmap 369/udp # Coda portmapper +codaauth2 370/tcp +codaauth2 370/udp # Coda authentication server +clearcase 371/udp Clearcase +ldap 389/tcp # Lightweight Directory Access Protocol +ldap 389/udp +svrloc 427/tcp # Server Location +svrloc 427/udp +https 443/tcp # http protocol over TLS/SSL +https 443/udp # HTTP/3 +snpp 444/tcp # Simple Network Paging Protocol +microsoft-ds 445/tcp # Microsoft Naked CIFS +kpasswd 464/tcp +kpasswd 464/udp +submissions 465/tcp ssmtp smtps urd # Submission over TLS [RFC8314] +saft 487/tcp # Simple Asynchronous File Transfer +isakmp 500/udp # IPSEC key management +rtsp 554/tcp # Real Time Stream Control Protocol +rtsp 554/udp +nqs 607/tcp # Network Queuing system +asf-rmcp 623/udp # ASF Remote Management and Control Protocol +qmqp 628/tcp +ipp 631/tcp # Internet Printing Protocol +ldp 646/tcp # Label Distribution Protocol +ldp 646/udp +# +# UNIX specific services +# +exec 512/tcp +biff 512/udp comsat +login 513/tcp +who 513/udp whod +shell 514/tcp cmd syslog # no passwords used +syslog 514/udp +printer 515/tcp spooler # line printer spooler +talk 517/udp +ntalk 518/udp +route 520/udp router routed # RIP +gdomap 538/tcp # GNUstep distributed objects +gdomap 538/udp +uucp 540/tcp uucpd # uucp daemon +klogin 543/tcp # Kerberized `rlogin' (v5) +kshell 544/tcp krcmd # Kerberized `rsh' (v5) +dhcpv6-client 546/udp +dhcpv6-server 547/udp +afpovertcp 548/tcp # AFP over TCP +nntps 563/tcp snntp # NNTP over SSL +submission 587/tcp # Submission [RFC4409] +ldaps 636/tcp # LDAP over SSL +ldaps 636/udp +tinc 655/tcp # tinc control port +tinc 655/udp +silc 706/tcp +kerberos-adm 749/tcp # Kerberos `kadmin' (v5) +# +domain-s 853/tcp # DNS over TLS [RFC7858] +domain-s 853/udp # DNS over DTLS [RFC8094] +rsync 873/tcp +ftps-data 989/tcp # FTP over SSL (data) +ftps 990/tcp +telnets 992/tcp # Telnet over SSL +imaps 993/tcp # IMAP over SSL +pop3s 995/tcp # POP-3 over SSL +# +# From ``Assigned Numbers'': +# +#> The Registered Ports are not controlled by the IANA and on most systems +#> can be used by ordinary user processes or programs executed by ordinary +#> users. +# +#> Ports are used in the TCP [45,106] to name the ends of logical +#> connections which carry long term conversations. For the purpose of +#> providing services to unknown callers, a service contact port is +#> defined. This list specifies the port used by the server process as its +#> contact port. While the IANA can not control uses of these ports it +#> does register or list uses of these ports as a convienence to the +#> community. +# +socks 1080/tcp # socks proxy server +proofd 1093/tcp +rootd 1094/tcp +openvpn 1194/tcp +openvpn 1194/udp +rmiregistry 1099/tcp # Java RMI Registry +lotusnote 1352/tcp lotusnotes # Lotus Note +ms-sql-s 1433/tcp # Microsoft SQL Server +ms-sql-m 1434/udp # Microsoft SQL Monitor +ingreslock 1524/tcp +datametrics 1645/tcp old-radius +datametrics 1645/udp old-radius +sa-msg-port 1646/tcp old-radacct +sa-msg-port 1646/udp old-radacct +kermit 1649/tcp +groupwise 1677/tcp +l2f 1701/udp l2tp +radius 1812/tcp +radius 1812/udp +radius-acct 1813/tcp radacct # Radius Accounting +radius-acct 1813/udp radacct +cisco-sccp 2000/tcp # Cisco SCCP +nfs 2049/tcp # Network File System +nfs 2049/udp # Network File System +gnunet 2086/tcp +gnunet 2086/udp +rtcm-sc104 2101/tcp # RTCM SC-104 IANA 1/29/99 +rtcm-sc104 2101/udp +gsigatekeeper 2119/tcp +gris 2135/tcp # Grid Resource Information Server +cvspserver 2401/tcp # CVS client/server operations +venus 2430/tcp # codacon port +venus 2430/udp # Venus callback/wbc interface +venus-se 2431/tcp # tcp side effects +venus-se 2431/udp # udp sftp side effect +codasrv 2432/tcp # not used +codasrv 2432/udp # server port +codasrv-se 2433/tcp # tcp side effects +codasrv-se 2433/udp # udp sftp side effect +mon 2583/tcp # MON traps +mon 2583/udp +dict 2628/tcp # Dictionary server +f5-globalsite 2792/tcp +gsiftp 2811/tcp +gpsd 2947/tcp +gds-db 3050/tcp gds_db # InterBase server +icpv2 3130/udp icp # Internet Cache Protocol +isns 3205/tcp # iSNS Server Port +isns 3205/udp # iSNS Server Port +iscsi-target 3260/tcp +mysql 3306/tcp +ms-wbt-server 3389/tcp +nut 3493/tcp # Network UPS Tools +nut 3493/udp +distcc 3632/tcp # distributed compiler +daap 3689/tcp # Digital Audio Access Protocol +svn 3690/tcp subversion # Subversion protocol +suucp 4031/tcp # UUCP over SSL +sysrqd 4094/tcp # sysrq daemon +sieve 4190/tcp # ManageSieve Protocol +epmd 4369/tcp # Erlang Port Mapper Daemon +remctl 4373/tcp # Remote Authenticated Command Service +f5-iquery 4353/tcp # F5 iQuery +ipsec-nat-t 4500/udp # IPsec NAT-Traversal [RFC3947] +iax 4569/udp # Inter-Asterisk eXchange +mtn 4691/tcp # monotone Netsync Protocol +radmin-port 4899/tcp # RAdmin Port +sip 5060/tcp # Session Initiation Protocol +sip 5060/udp +sip-tls 5061/tcp +sip-tls 5061/udp +xmpp-client 5222/tcp jabber-client # Jabber Client Connection +xmpp-server 5269/tcp jabber-server # Jabber Server Connection +cfengine 5308/tcp +mdns 5353/udp # Multicast DNS +postgresql 5432/tcp postgres # PostgreSQL Database +freeciv 5556/tcp rptp # Freeciv gameplay +amqps 5671/tcp # AMQP protocol over TLS/SSL +amqp 5672/tcp +amqp 5672/sctp +x11 6000/tcp x11-0 # X Window System +x11-1 6001/tcp +x11-2 6002/tcp +x11-3 6003/tcp +x11-4 6004/tcp +x11-5 6005/tcp +x11-6 6006/tcp +x11-7 6007/tcp +gnutella-svc 6346/tcp # gnutella +gnutella-svc 6346/udp +gnutella-rtr 6347/tcp # gnutella +gnutella-rtr 6347/udp +redis 6379/tcp +sge-qmaster 6444/tcp sge_qmaster # Grid Engine Qmaster Service +sge-execd 6445/tcp sge_execd # Grid Engine Execution Service +mysql-proxy 6446/tcp # MySQL Proxy +babel 6696/udp # Babel Routing Protocol +ircs-u 6697/tcp # Internet Relay Chat via TLS/SSL +bbs 7000/tcp +afs3-fileserver 7000/udp +afs3-callback 7001/udp # callbacks to cache managers +afs3-prserver 7002/udp # users & groups database +afs3-vlserver 7003/udp # volume location database +afs3-kaserver 7004/udp # AFS/Kerberos authentication +afs3-volser 7005/udp # volume managment server +afs3-bos 7007/udp # basic overseer process +afs3-update 7008/udp # server-to-server updater +afs3-rmtsys 7009/udp # remote cache manager service +font-service 7100/tcp xfs # X Font Service +http-alt 8080/tcp webcache # WWW caching service +puppet 8140/tcp # The Puppet master service +bacula-dir 9101/tcp # Bacula Director +bacula-fd 9102/tcp # Bacula File Daemon +bacula-sd 9103/tcp # Bacula Storage Daemon +xmms2 9667/tcp # Cross-platform Music Multiplexing System +nbd 10809/tcp # Linux Network Block Device +zabbix-agent 10050/tcp # Zabbix Agent +zabbix-trapper 10051/tcp # Zabbix Trapper +amanda 10080/tcp # amanda backup services +dicom 11112/tcp +hkp 11371/tcp # OpenPGP HTTP Keyserver +db-lsp 17500/tcp # Dropbox LanSync Protocol +dcap 22125/tcp # dCache Access Protocol +gsidcap 22128/tcp # GSI dCache Access Protocol +wnn6 22273/tcp # wnn6 + +# +# Datagram Delivery Protocol services +# +rtmp 1/ddp # Routing Table Maintenance Protocol +nbp 2/ddp # Name Binding Protocol +echo 4/ddp # AppleTalk Echo Protocol +zip 6/ddp # Zone Information Protocol + +#========================================================================= +# The remaining port numbers are not as allocated by IANA. +#========================================================================= + +# Kerberos (Project Athena/MIT) services +kerberos4 750/udp kerberos-iv kdc # Kerberos (server) +kerberos4 750/tcp kerberos-iv kdc +kerberos-master 751/udp kerberos_master # Kerberos authentication +kerberos-master 751/tcp +passwd-server 752/udp passwd_server # Kerberos passwd server +krb-prop 754/tcp krb_prop krb5_prop hprop # Kerberos slave propagation +zephyr-srv 2102/udp # Zephyr server +zephyr-clt 2103/udp # Zephyr serv-hm connection +zephyr-hm 2104/udp # Zephyr hostmanager +iprop 2121/tcp # incremental propagation +supfilesrv 871/tcp # Software Upgrade Protocol server +supfiledbg 1127/tcp # Software Upgrade Protocol debugging + +# +# Services added for the Debian GNU/Linux distribution +# +poppassd 106/tcp # Eudora +moira-db 775/tcp moira_db # Moira database +moira-update 777/tcp moira_update # Moira update protocol +moira-ureg 779/udp moira_ureg # Moira user registration +spamd 783/tcp # spamassassin daemon +skkserv 1178/tcp # skk jisho server port +predict 1210/udp # predict -- satellite tracking +rmtcfg 1236/tcp # Gracilis Packeten remote config server +xtel 1313/tcp # french minitel +xtelw 1314/tcp # french minitel +zebrasrv 2600/tcp # zebra service +zebra 2601/tcp # zebra vty +ripd 2602/tcp # ripd vty (zebra) +ripngd 2603/tcp # ripngd vty (zebra) +ospfd 2604/tcp # ospfd vty (zebra) +bgpd 2605/tcp # bgpd vty (zebra) +ospf6d 2606/tcp # ospf6d vty (zebra) +ospfapi 2607/tcp # OSPF-API +isisd 2608/tcp # ISISd vty (zebra) +fax 4557/tcp # FAX transmission service (old) +hylafax 4559/tcp # HylaFAX client-server protocol (new) +munin 4949/tcp lrrd # Munin +rplay 5555/udp # RPlay audio service +nrpe 5666/tcp # Nagios Remote Plugin Executor +nsca 5667/tcp # Nagios Agent - NSCA +canna 5680/tcp # cannaserver +syslog-tls 6514/tcp # Syslog over TLS [RFC5425] +sane-port 6566/tcp sane saned # SANE network scanner daemon +ircd 6667/tcp # Internet Relay Chat +zope-ftp 8021/tcp # zope management by ftp +tproxy 8081/tcp # Transparent Proxy +omniorb 8088/tcp # OmniORB +clc-build-daemon 8990/tcp # Common lisp build daemon +xinetd 9098/tcp +git 9418/tcp # Git Version Control System +zope 9673/tcp # zope server +webmin 10000/tcp +kamanda 10081/tcp # amanda backup services (Kerberos) +amandaidx 10082/tcp # amanda backup services +amidxtape 10083/tcp # amanda backup services +sgi-cmsd 17001/udp # Cluster membership services daemon +sgi-crsd 17002/udp +sgi-gcd 17003/udp # SGI Group membership daemon +sgi-cad 17004/tcp # Cluster Admin daemon +binkp 24554/tcp # binkp fidonet protocol +asp 27374/tcp # Address Search Protocol +asp 27374/udp +csync2 30865/tcp # cluster synchronization tool +dircproxy 57000/tcp # Detachable IRC Proxy +tfido 60177/tcp # fidonet EMSI over telnet +fido 60179/tcp # fidonet EMSI over TCP + +# Local services diff --git a/meta-openeuler/recipes-core/os-base/os-base/shadow b/meta-openeuler/recipes-core/os-base/os-base/shadow deleted file mode 100644 index c2935329305663f1bc6792c6c102d97b2d55f843..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/os-base/os-base/shadow +++ /dev/null @@ -1,2 +0,0 @@ -root::0:0:99999:7::: -sshd:!:11880:0:90:7:-1:-1:0 diff --git a/meta-openeuler/recipes-core/os-base/os-base_1.0.bb b/meta-openeuler/recipes-core/os-base/os-base_1.0.bb index 7fe1933bb98d2aab56a4a615196daa2ff5c3cdd7..e5b99d27aeb6c521e6a41ccd34702f6b025e912a 100644 --- a/meta-openeuler/recipes-core/os-base/os-base_1.0.bb +++ b/meta-openeuler/recipes-core/os-base/os-base_1.0.bb @@ -1,81 +1,48 @@ -SUMMARY = "OS basic configuration files" -DESCRIPTION = "base files" +SUMMARY = "extra basic configuration files of openEuler Embedded" +DESCRIPTION = "extra basic configuration files as a supplement of poky's base-files bb" SECTION = "base" PR = "r1" -LICENSE = "CLOSED" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" -FILESPATH = "${THISDIR}/${BPN}/" -DL_DIR = "${THISDIR}/${BPN}/" -LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=1acb172ffd3d252285dd1b8b8459941e" +INHIBIT_DEFAULT_DEPS = "1" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# we need updat-rc.d to set up links between init.d and rcX.d +DEPENDS_append = " update-rc.d-native" -SRC_URI = "file://bashrc \ - file://fstab \ - file://rcS \ - file://group \ - file://inittab \ - file://issue \ - file://issue.net \ - file://LICENSE \ - file://motd \ - file://passwd \ - file://profile \ - file://shadow \ - file://sysctl.conf \ +SRC_URI = " \ file://rc.functions \ file://rc.sysinit \ - file://rc.local \ - file://modules \ + file://ethertypes \ + file://services \ + file://protocols \ + file://rpc \ " -hostname = "openeuler" - do_install() { - install -d ${D}/etc - cp ${WORKDIR}/bashrc ${D}/etc/ - install -m 0600 ${WORKDIR}/fstab ${D}/etc/ - cp ${WORKDIR}/group ${D}/etc/ - cp ${WORKDIR}/inittab ${D}/etc/ - cp ${WORKDIR}/issue ${D}/etc/ - cp ${WORKDIR}/issue.net ${D}/etc/ - cp ${WORKDIR}/motd ${D}/etc/ - cp ${WORKDIR}/passwd ${D}/etc/ - cp ${WORKDIR}/profile ${D}/etc/ - install -m 0600 ${WORKDIR}/shadow ${D}/etc/ - install -m 0600 ${WORKDIR}/sysctl.conf ${D}/etc/ - install -d ${D}/etc/rc.d - install -m 0744 ${WORKDIR}/rc.functions ${D}/etc/rc.d - install -m 0744 ${WORKDIR}/rc.sysinit ${D}/etc/rc.d - install -m 0744 ${WORKDIR}/rc.local ${D}/etc/rc.d - install -m 0755 -d ${D}/etc/init.d/ - install -m 0750 ${WORKDIR}/rcS ${D}/etc/init.d/ - install -m 0750 ${WORKDIR}/modules ${D}/etc/ - mkdir -p ${D}/var/log/ - touch ${D}/var/log/messages ${D}/var/log/lastlog - mkdir -p ${D}/var/run/faillock ${D}/tmp - mkdir -p ${D}/proc ${D}/sys ${D}/root ${D}/dev ${D}/sys/fs/cgroup - mkdir -p ${D}/var/log/audit ${D}/var/run/sshd ${D}$/lib/modules - if [ "${hostname}" ]; then - echo ${hostname} > ${D}${sysconfdir}/hostname - echo "127.0.1.1 ${hostname}" >> ${D}${sysconfdir}/hosts - fi - mkdir -p ${D}${sysconfdir}/security/ - touch ${D}${sysconfdir}/security/opasswd - chmod 600 ${D}${sysconfdir}/security/opasswd - chmod 750 ${D}$/lib/modules - chmod 700 ${D}/root - +## the contents of configuration should be changed according features, user configuration etc. + +## add config files in /etc folder + install -d ${D}${sysconfdir} + +# all init scripts should be in /etc/init.d, currently openeuler embedded specific init functions are mainly +# located in rc.functions and rc.sysinit + install -d ${D}${sysconfdir}/init.d + install -m 0744 ${WORKDIR}/rc.functions ${D}${sysconfdir}/init.d + install -m 0744 ${WORKDIR}/rc.sysinit ${D}${sysconfdir}/init.d +# to match busybox's rcS script and buysbox-inittab, set a link in rc5.d to let rc.sysinit run + if [ x"${INIT_MANAGER}" = x"mdev-busybox" ]; then + install -d ${D}${sysconfdir}/rc5.d + update-rc.d -r ${D} rc.sysinit start 50 5 . + fi + +# necessary infrastructure for basic TCP/IP based networking from netbase_6.2.bb + install -m 0644 ${WORKDIR}/rpc ${D}${sysconfdir}/rpc + install -m 0644 ${WORKDIR}/protocols ${D}${sysconfdir}/protocols + install -m 0644 ${WORKDIR}/services ${D}${sysconfdir}/services + install -m 0644 ${WORKDIR}/ethertypes ${D}${sysconfdir}/ethertypes } -do_install_append_arm() { - echo "unix" >> ${D}/etc/modules -} - -do_install_append_raspberrypi4() { - sed -i 's/ttyAMA0/ttyS0/g' ${D}/etc/inittab - sed -i '/\# load kernel modules/imount -o remount,rw \/' ${D}/etc/rc.d/rc.sysinit -} - -PACKAGES =+ "${PN}-sysctl" FILES_${PN} = "/" -FILES_${PN}-sysctl = "${sysconfdir}/sysctl.conf" -INHIBIT_DEFAULT_DEPS = "1" diff --git a/meta-openeuler/recipes-core/packagegroups/packagegroup-base.bb b/meta-openeuler/recipes-core/packagegroups/packagegroup-base.bb index 70c795eebe4ff3eab32fb021af4709bad4460e73..c1058f0de929c1a0c25feb8cb955d1f6cc57116e 100644 --- a/meta-openeuler/recipes-core/packagegroups/packagegroup-base.bb +++ b/meta-openeuler/recipes-core/packagegroups/packagegroup-base.bb @@ -13,21 +13,24 @@ inherit packagegroup PACKAGES = "${PN} ${PN}-extended" RDEPENDS_packagegroup-base = " \ -packagegroup-core-base-utils \ acl \ attr \ -bind-utils \ +bind-dhclient \ +bind-dhclient-utils \ +dhcp-client \ +dhcp-server \ +dhcp-server-config \ +dhcp-omshell \ +dhcp-relay \ cifs-utils \ cronie \ curl \ dosfstools \ e2fsprogs \ e2fsprogs-tune2fs \ +ethercat \ ethtool \ expat \ -gdb \ -gdbserver \ -glib-2.0 \ grep \ gzip \ initscripts \ @@ -38,7 +41,6 @@ kmod \ less \ libaio \ libasm \ -libbfd \ libcap \ libcap-bin \ libcap-ng \ @@ -46,6 +48,7 @@ libcap-ng-bin \ libdw \ libffi \ libhugetlbfs \ +libmodbus \ libnl \ libnl-cli \ libnl-xfrm \ @@ -53,7 +56,6 @@ libpcap \ libpwquality \ libselinux-bin \ libsepol-bin \ -libusb1 \ libxml2 \ libxml2-utils \ logrotate \ @@ -64,8 +66,7 @@ ncurses-libmenu \ ncurses-libpanel \ ncurses-terminfo \ ncurses-terminfo-base \ -nfs-utils \ -nfs-utils-client \ +nlopt \ pciutils \ policycoreutils \ policycoreutils-fixfiles \ @@ -85,21 +86,30 @@ tzdata-core \ util-linux-su \ util-linux-libfdisk \ xz \ +nfs-utils \ +nfs-utils-client \ +libusb1 \ +glib-2.0 \ +libbfd \ +expect \ " RDEPENDS_packagegroup-base-extended = " \ -dhcp \ -dhcp-libs \ -dhcp-server \ -dhcp-server-config \ sysfsutils \ libmetal \ openamp \ " -RDEPENDS_packagegroup-base_append_raspberrypi4 += " \ -e2fsprogs-resize2fs \ -" RDEPENDS_packagegroup-base_append_aarch64-std = " \ dsoftbus \ " + +RDEPENDS_packagegroup-base_remove_riscv64 += " \ +libhugetlbfs \ +ethercat \ +" + +RDEPENDS_packagegroup-base-extended_remove_riscv64 += " \ +libmetal \ +openamp \ +" diff --git a/meta-openeuler/recipes-core/packagegroups/packagegroup-core-base-utils.bb b/meta-openeuler/recipes-core/packagegroups/packagegroup-core-base-utils.bb index 00ed86c1ff8253da661ec1221cbbaf3100fd582e..7793c0d3a456e9faa5ba35f09c33d7689305bb50 100644 --- a/meta-openeuler/recipes-core/packagegroups/packagegroup-core-base-utils.bb +++ b/meta-openeuler/recipes-core/packagegroups/packagegroup-core-base-utils.bb @@ -21,5 +21,3 @@ shadow \ shadow-securetty \ bash \ " - -RDEPENDS_${PN}_append_arm += "kernel-module-unix" diff --git a/meta-openeuler/recipes-core/packagegroups/packagegroup-core-boot-live.bb b/meta-openeuler/recipes-core/packagegroups/packagegroup-core-boot-live.bb new file mode 100644 index 0000000000000000000000000000000000000000..90e815c43ec462fc3d0fd8df280a222cec84453a --- /dev/null +++ b/meta-openeuler/recipes-core/packagegroups/packagegroup-core-boot-live.bb @@ -0,0 +1,49 @@ +SUMMARY = "live boot requirements" +DESCRIPTION = "The live set of packages required to boot the system" +PR = "r1" +PACKAGE_ARCH = "${MACHINE_ARCH}" +inherit packagegroup + +# live should use this VIRTUAL-RUNTIME as we don't want systemd: +# Notice: we need busybox-inittab to setup in RDEPENDS +DISTRO_FEATURES_BACKFILL_CONSIDERED_append := " systemd" +VIRTUAL-RUNTIME_dev_manager := "busybox-mdev" +VIRTUAL-RUNTIME_init_manager := "busybox" +VIRTUAL-RUNTIME_initscripts := "initscripts" +VIRTUAL-RUNTIME_keymaps := "keymaps" +VIRTUAL-RUNTIME_login_manager := "busybox" + +EFI_PROVIDER ??= "grub-efi" + +SYSVINIT_SCRIPTS = "${@bb.utils.contains('MACHINE_FEATURES', 'rtc', '${VIRTUAL-RUNTIME_base-utils-hwclock}', '', d)} \ + modutils-initscripts \ + init-ifupdown \ + ${VIRTUAL-RUNTIME_initscripts} \ + " + +RDEPENDS_${PN} = "\ + base-files \ + base-passwd \ + ${VIRTUAL-RUNTIME_base-utils} \ + ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${SYSVINIT_SCRIPTS}", "", d)} \ + ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \ + ${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER} kernel", "", d)} \ + ${VIRTUAL-RUNTIME_login_manager} \ + ${VIRTUAL-RUNTIME_init_manager} \ + ${VIRTUAL-RUNTIME_dev_manager} \ + ${VIRTUAL-RUNTIME_update-alternatives} \ + ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS} \ + kernel \ + kernel-img \ + kernel-image \ + kernel-vmlinux \ + os-base \ + busybox-inittab \ + " + +# No rule to make target "Image" for x86-64, remove it +RDEPENDS_${PN}_remove_x86-64 += "kernel-img" + +RRECOMMENDS_${PN} = "\ + ${VIRTUAL-RUNTIME_base-utils-syslog} \ + ${MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS}" diff --git a/meta-openeuler/recipes-core/packagegroups/packagegroup-core-boot.bb b/meta-openeuler/recipes-core/packagegroups/packagegroup-core-boot.bb deleted file mode 100644 index 4e990840dd2050a8745c33268491383e247f86dd..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/packagegroups/packagegroup-core-boot.bb +++ /dev/null @@ -1,26 +0,0 @@ -SUMMARY = "A small image just capable of allowing a device to boot." -LICENSE = "MIT" -PR = "r1" - -inherit packagegroup - -PACKAGES = "${PN} ${PN}-tiny" - -RDEPENDS_${PN} = " \ -busybox-linuxrc \ -kernel \ -kernel-img \ -kernel-vmlinux \ -busybox \ -os-base \ -glibc \ -os-release \ -" - -RDEPENDS_${PN}-tiny = " \ -busybox-login \ -busybox-groups \ -busybox-bash \ -busybox-grep \ -busybox-sed \ -" diff --git a/meta-openeuler/recipes-core/packagegroups/packagegroup-core-boot.bbappend b/meta-openeuler/recipes-core/packagegroups/packagegroup-core-boot.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..1805c28643ec0ed28309a0e316a24c8665f18fdb --- /dev/null +++ b/meta-openeuler/recipes-core/packagegroups/packagegroup-core-boot.bbappend @@ -0,0 +1,21 @@ +#main bbfile: yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb + +# we add kernel-img and kernel-vmlinux +RDEPENDS_${PN} += " \ + kernel \ + kernel-img \ + kernel-image \ + kernel-vmlinux \ + os-base \ + os-release \ +" +# No rule to make target "Image" for x86-64, remove it +RDEPENDS_${PN}_remove_x86-64 += "kernel-img" + +# * netbase's configuration files are included in os-base +# to avoid extra download +# we don't need grub-efi in non-live image +RDEPENDS_${PN}_remove = " \ + netbase \ + ${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER} kernel", "", d)} \ +" diff --git a/meta-openeuler/recipes-core/packagegroups/packagegroup-core-tools-debug.bbappend b/meta-openeuler/recipes-core/packagegroups/packagegroup-core-tools-debug.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..5d5b25d322afce1512bf7356f5c61665b58a53fb --- /dev/null +++ b/meta-openeuler/recipes-core/packagegroups/packagegroup-core-tools-debug.bbappend @@ -0,0 +1,6 @@ +#main bbfile: yocto-poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb + +# remove mtrace which openeuler not support current. +RDEPENDS_${PN}_remove = " \ + ${MTRACE} \ +" diff --git a/meta-openeuler/recipes-core/packagegroups/packagegroup-isulad.bb b/meta-openeuler/recipes-core/packagegroups/packagegroup-isulad.bb index 6d3b21b81a21147219aabad9b8cc954dc0d888a7..f8a3f430d8fc462368feafd817e982b43e81eb2a 100644 --- a/meta-openeuler/recipes-core/packagegroups/packagegroup-isulad.bb +++ b/meta-openeuler/recipes-core/packagegroups/packagegroup-isulad.bb @@ -14,5 +14,5 @@ lxc \ libevhtp \ libarchive \ libevent \ -iSulad \ +isulad \ " diff --git a/meta-openeuler/recipes-core/packagegroups/packagegroup-kernel-modules.bb b/meta-openeuler/recipes-core/packagegroups/packagegroup-kernel-modules.bb index 0f1477b195817f17be1a12f0d32d0b555a2046e5..b805e05ea3ec0c8b66d00cbe6f7e81b3fd09e796 100644 --- a/meta-openeuler/recipes-core/packagegroups/packagegroup-kernel-modules.bb +++ b/meta-openeuler/recipes-core/packagegroups/packagegroup-kernel-modules.bb @@ -7,51 +7,12 @@ inherit packagegroup PACKAGES = "${PN}" -RDEPENDS_${PN} = " \ -kernel-module-overlay \ -kernel-module-8021q \ -kernel-module-jbd2 \ -kernel-module-mbcache \ -kernel-module-ext2 \ -kernel-module-ext4 \ -kernel-module-inet-diag \ -kernel-module-ip-tables \ -kernel-module-ip-tunnel \ -kernel-module-ip6-tables \ -kernel-module-ip6-udp-tunnel \ -kernel-module-ip6table-filter \ -kernel-module-ipip \ -kernel-module-ipt-reject \ -kernel-module-iptable-filter \ -kernel-module-ipv6 \ -kernel-module-nf-conntrack \ -kernel-module-nf-defrag-ipv4 \ -kernel-module-nf-defrag-ipv6 \ -kernel-module-nf-nat \ -kernel-module-nf-reject-ipv4 \ -kernel-module-nf-reject-ipv6 \ -kernel-module-x-tables \ -kernel-module-xt-tcpudp \ -kernel-module-tunnel4 \ -kernel-module-af-packet \ -kernel-module-nfs-ssc \ -kernel-module-fscache \ -kernel-module-grace \ -kernel-module-sunrpc \ -kernel-module-auth-rpcgss \ -kernel-module-lockd \ -kernel-module-nfs-acl \ -kernel-module-nfs \ -kernel-module-nfsv3 \ -kernel-module-nfsd \ -kernel-module-crc-ccitt \ -kernel-module-ipv6 \ -kernel-module-iptable-nat \ -kernel-module-ip6table-nat \ -kernel-module-ip6t-reject \ -kernel-module-xt-nat \ -" -RDEPENDS_${PN}_raspberrypi4 = " \ -" -RDEPENDS_${PN}_aarch64-pro = " \ +RDEPENDS_${PN} += " \ +modutils-initscripts \ " + +# please do not add any MACHINE related modules here +# You can use INSTALLMODULES which is defined in machine conf layer +# like: meta-openeuler/conf/machine/kernel-modules-conf/common.inc +INSTALLMODULES ?= "" +RDEPENDS_${PN} += "${INSTALLMODULES}" diff --git a/meta-openeuler/recipes-core/pam/packagegroup-pam-plugins.bb b/meta-openeuler/recipes-core/packagegroups/packagegroup-pam-plugins.bb similarity index 100% rename from meta-openeuler/recipes-core/pam/packagegroup-pam-plugins.bb rename to meta-openeuler/recipes-core/packagegroups/packagegroup-pam-plugins.bb diff --git a/meta-openeuler/recipes-core/pam/libpam/99_pam b/meta-openeuler/recipes-core/pam/libpam/99_pam deleted file mode 100644 index 47eda03f2c3cebeb8ac3bcaee1c15e9c49085cb5..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pam/libpam/99_pam +++ /dev/null @@ -1 +0,0 @@ -d root root 0755 /var/run/sepermit none diff --git a/meta-openeuler/recipes-core/pam/libpam/libpam-xtests.patch b/meta-openeuler/recipes-core/pam/libpam/libpam-xtests.patch deleted file mode 100644 index 3d3a5f57f9adcfca0022e0d9c0f6c2b61e0b6dc6..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pam/libpam/libpam-xtests.patch +++ /dev/null @@ -1,37 +0,0 @@ -This patch is used to create a new sub package libpam-xtests to do more checks. - -Upstream-Status: Pending - -Signed-off-by: Kang Kai -Index: Linux-PAM-1.3.0/xtests/Makefile.am -=================================================================== ---- Linux-PAM-1.3.0.orig/xtests/Makefile.am -+++ Linux-PAM-1.3.0/xtests/Makefile.am -@@ -7,7 +7,7 @@ AM_CFLAGS = -DLIBPAM_COMPILE -I$(top_src - LDADD = $(top_builddir)/libpam/libpam.la \ - $(top_builddir)/libpam_misc/libpam_misc.la - --CLEANFILES = *~ $(XTESTS) -+CLEANFILES = *~ - - EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \ - tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd \ -@@ -51,3 +51,18 @@ EXTRA_PROGRAMS = $(XTESTS) - - xtests: $(XTESTS) run-xtests.sh - "$(srcdir)"/run-xtests.sh "$(srcdir)" ${XTESTS} ${NOSRCTESTS} -+ -+all: $(XTESTS) -+ -+install: install_xtests -+ -+install_xtests: -+ $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests -+ for file in $(EXTRA_DIST) ; do \ -+ $(INSTALL) $(srcdir)/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \ -+ done -+ for file in $(XTESTS); do \ -+ $(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \ -+ done -+ -+.PHONY: all install_xtests diff --git a/meta-openeuler/recipes-core/pam/libpam/pam-volatiles.conf b/meta-openeuler/recipes-core/pam/libpam/pam-volatiles.conf deleted file mode 100644 index 1f892b7970b6622549e2f99ce1532037d2b1c4a8..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pam/libpam/pam-volatiles.conf +++ /dev/null @@ -1 +0,0 @@ -d /var/run/sepermit 0755 root root - - diff --git a/meta-openeuler/recipes-core/pam/libpam/pam.d/common-account b/meta-openeuler/recipes-core/pam/libpam/pam.d/common-account deleted file mode 100644 index 0a9d30a5d315b2d983a4e469f21e9a412077bce1..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pam/libpam/pam.d/common-account +++ /dev/null @@ -1,4 +0,0 @@ -account required pam_faillock.so -account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so -account requisite pam_deny.so -account required pam_permit.so diff --git a/meta-openeuler/recipes-core/pam/libpam/pam.d/common-auth b/meta-openeuler/recipes-core/pam/libpam/pam.d/common-auth deleted file mode 100644 index d77adbe5af2e398d86a37db5f82a16165b9b06e0..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pam/libpam/pam.d/common-auth +++ /dev/null @@ -1,7 +0,0 @@ -auth required pam_faillock.so preauth audit deny=3 even_deny_root unlock_time=300 -auth sufficient pam_unix.so nullok try_first_pass -auth [default=die] pam_faillock.so authfail audit deny=3 even_deny_root unlock_time=300 -auth requisite pam_listfile.so item=user onerr=succeed sense=deny file=/etc/login.user.deny -auth [success=1 default=ignore] pam_unix.so -auth required pam_deny.so -auth required pam_permit.so diff --git a/meta-openeuler/recipes-core/pam/libpam/pam.d/common-password b/meta-openeuler/recipes-core/pam/libpam/pam.d/common-password deleted file mode 100644 index 06335bf722ef8b71cd88ca6d1821a5e7a5345d1a..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pam/libpam/pam.d/common-password +++ /dev/null @@ -1,5 +0,0 @@ -password requisite pam_pwquality.so try_first_pass minclass=3 minlen=8 lcredit=0 ucredit=0 dcredit=0 ocredit=0 reject_username gecoscheck retry=3 enforce_for_root -password required pam_pwhistory.so remember=5 use_authtok enforce_for_root -password [success=1 default=ignore] pam_unix.so use_authtok nullok sha512 -password requisite pam_deny.so -password required pam_permit.so diff --git a/meta-openeuler/recipes-core/pam/libpam/pam.d/common-session b/meta-openeuler/recipes-core/pam/libpam/pam.d/common-session deleted file mode 100644 index 94765c85d4d6be0ef9bd083f59cff79fd980b752..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pam/libpam/pam.d/common-session +++ /dev/null @@ -1,19 +0,0 @@ -# -# /etc/pam.d/common-session - session-related modules common to all services -# -# This file is included from other service-specific PAM config files, -# and should contain a list of modules that define tasks to be performed -# at the start and end of sessions of *any* kind (both interactive and -# non-interactive). -# - -# here are the per-package modules (the "Primary" block) -session [default=1] pam_permit.so -# here's the fallback if no module succeeds -session requisite pam_deny.so -# prime the stack with a positive return value if there isn't one already; -# this avoids us returning an error just because nothing sets a success code -# since the modules above will each just jump around -session required pam_permit.so -# and here are more per-package modules (the "Additional" block) -session required pam_unix.so diff --git a/meta-openeuler/recipes-core/pam/libpam/pam.d/common-session-noninteractive b/meta-openeuler/recipes-core/pam/libpam/pam.d/common-session-noninteractive deleted file mode 100644 index a9c830d4c9b131f5142477f3d24552d76000d3cc..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pam/libpam/pam.d/common-session-noninteractive +++ /dev/null @@ -1,19 +0,0 @@ -# -# /etc/pam.d/common-session-noninteractive - session-related modules -# common to all non-interactive services -# -# This file is included from other service-specific PAM config files, -# and should contain a list of modules that define tasks to be performed -# at the start and end of all non-interactive sessions. -# - -# here are the per-package modules (the "Primary" block) -session [default=1] pam_permit.so -# here's the fallback if no module succeeds -session requisite pam_deny.so -# prime the stack with a positive return value if there isn't one already; -# this avoids us returning an error just because nothing sets a success code -# since the modules above will each just jump around -session required pam_permit.so -# and here are more per-package modules (the "Additional" block) -session required pam_unix.so diff --git a/meta-openeuler/recipes-core/pam/libpam/pam.d/other b/meta-openeuler/recipes-core/pam/libpam/pam.d/other deleted file mode 100644 index 010d5d11d82279fcfb2112dd45bd25a705ecf87d..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pam/libpam/pam.d/other +++ /dev/null @@ -1,24 +0,0 @@ -# -# /etc/pam.d/other - specify the PAM fallback behaviour -# -# Note that this file is used for any unspecified service; for example -#if /etc/pam.d/cron specifies no session modules but cron calls -#pam_open_session, the session module out of /etc/pam.d/other is -#used. - -# We use pam_warn.so to generate syslog notes that the 'other' -#fallback rules are being used (as a hint to suggest you should setup -#specific PAM rules for the service and aid to debugging). Then to be -#secure, deny access to all services by default. - -auth required pam_warn.so -auth required pam_deny.so - -account required pam_warn.so -account required pam_deny.so - -password required pam_warn.so -password required pam_deny.so - -session required pam_warn.so -session required pam_deny.so diff --git a/meta-openeuler/recipes-core/pam/libpam/run-ptest b/meta-openeuler/recipes-core/pam/libpam/run-ptest deleted file mode 100644 index 2fb69ba7b19821a78e4d72767d10daa5e71f1b95..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pam/libpam/run-ptest +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/sh - -cd tests - -export srcdir=. - -failed=0 -all=0 -for f in tst-*; do - "./$f" > /dev/null 2>&1 - case "$?" in - 0) - echo "PASS: $f" - all=$((all + 1)) - ;; - 77) - echo "SKIP: $f" - ;; - *) - echo "FAIL: $f" - failed=$((failed + 1)) - all=$((all + 1)) - ;; - esac -done - -if [ "$failed" -eq 0 ] ; then - echo "All $all tests passed" -else - echo "$failed of $all tests failed" -fi -unset srcdir diff --git a/meta-openeuler/recipes-core/pam/libpam_1.5.2.bb b/meta-openeuler/recipes-core/pam/libpam_1.5.2.bb deleted file mode 100644 index 179eb2efff037d1ddd5a33c1f7bd09853be8c3b4..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pam/libpam_1.5.2.bb +++ /dev/null @@ -1,188 +0,0 @@ -DISABLE_STATIC = "" -SUMMARY = "Linux-PAM (Pluggable Authentication Modules)" -DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), a flexible mechanism for authenticating users" -HOMEPAGE = "https://fedorahosted.org/linux-pam/" -BUGTRACKER = "https://fedorahosted.org/linux-pam/newticket" -SECTION = "base" -# PAM is dual licensed under GPL and BSD. -# /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time -# libpam-runtime-1.0.1 is GPLv2+), by openembedded -LICENSE = "GPLv2+ | BSD-3-Clause" -LIC_FILES_CHKSUM = "file://COPYING;md5=7eb5c1bf854e8881005d673599ee74d3 \ - file://libpamc/License;md5=a4da476a14c093fdc73be3c3c9ba8fb3 \ - " - -SRC_URI = "file://pam/Linux-PAM-${PV}.tar.xz \ - file://pam/bugfix-pam-1.1.8-faillock-systemtime.patch \ - file://pam/openEuler-change-ndbm-to-gdbm.patch \ - file://pam/0001-bugfix-cannot-open-database-file.patch \ - file://pam/add-sm3-crypt-support.patch \ - file://99_pam \ - file://pam.d/common-account \ - file://pam.d/common-auth \ - file://pam.d/common-password \ - file://pam.d/common-session \ - file://pam.d/common-session-noninteractive \ - file://pam.d/other \ - file://libpam-xtests.patch \ - file://run-ptest \ - file://pam-volatiles.conf \ -" - -SRC_URI[sha256sum] = "e4ec7131a91da44512574268f493c6d8ca105c87091691b8e9b56ca685d4f94d" - -#DEPENDS = "bison-native flex flex-native cracklib libxml2-native virtual/crypt" -DEPENDS = "cracklib" - -EXTRA_OECONF = "--includedir=${includedir}/security \ - --libdir=${base_libdir} \ - --disable-nis \ - --disable-regenerate-docu \ - --disable-doc \ - --disable-prelude" - -CFLAGS_append = " -fPIC " - -S = "${WORKDIR}/Linux-PAM-${PV}" - - -#inherit autotools gettext pkgconfig systemd ptest -inherit autotools gettext - -PACKAGECONFIG ??= "" -PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit," -PACKAGECONFIG[userdb] = "--enable-db=db,--enable-db=no,db," - -PACKAGES += "${PN}-runtime ${PN}-xtests ${PN}-pkgconfig ${PN}-service" -FILES_${PN} = "${base_libdir}/lib*${SOLIBS}" -FILES_${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}" -FILES_${PN}-runtime = "${sysconfdir} ${sbindir} ${systemd_system_unitdir}" -FILES_${PN}-xtests = "${datadir}/Linux-PAM/xtests" -FILES_${PN}-pkgconfig = "${base_libdir}/pkgconfig" -FILES_${PN}-service = "/usr/lib/systemd/system" - -PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*" - -def get_multilib_bit(d): - baselib = d.getVar('baselib') or '' - return baselib.replace('lib', '') - -libpam_suffix = "suffix${@get_multilib_bit(d)}" - -RPROVIDES_${PN} += "${PN}-${libpam_suffix}" -RPROVIDES_${PN}-runtime += "${PN}-runtime-${libpam_suffix}" - -RDEPENDS_${PN}-runtime = "${PN}-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-deny-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-permit-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-warn-${libpam_suffix} \ - ${MLPREFIX}pam-plugin-unix-${libpam_suffix} \ - " -#RDEPENDS_${PN}-xtests = "${PN}-${libpam_suffix} \ -# ${MLPREFIX}pam-plugin-access-${libpam_suffix} \ -# ${MLPREFIX}pam-plugin-debug-${libpam_suffix} \ -# ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \ -# ${MLPREFIX}pam-plugin-succeed-if-${libpam_suffix} \ -# ${MLPREFIX}pam-plugin-time-${libpam_suffix} \ -# bash coreutils" - -# FIXME: Native suffix breaks here, disable it for now -RRECOMMENDS_${PN} = "${PN}-runtime-${libpam_suffix}" -RRECOMMENDS_${PN}_class-native = "" - -python populate_packages_prepend () { - def pam_plugin_hook(file, pkg, pattern, format, basename): - pn = d.getVar('PN') - libpam_suffix = d.getVar('libpam_suffix') - - rdeps = d.getVar('RDEPENDS_' + pkg) - if rdeps: - rdeps = rdeps + " " + pn + "-" + libpam_suffix - else: - rdeps = pn + "-" + libpam_suffix - d.setVar('RDEPENDS_' + pkg, rdeps) - - provides = d.getVar('RPROVIDES_' + pkg) - if provides: - provides = provides + " " + pkg + "-" + libpam_suffix - else: - provides = pkg + "-" + libpam_suffix - d.setVar('RPROVIDES_' + pkg, provides) - - mlprefix = d.getVar('MLPREFIX') or '' - dvar = d.expand('${WORKDIR}/package') - pam_libdir = d.expand('${base_libdir}/security') - pam_sbindir = d.expand('${sbindir}') - pam_filterdir = d.expand('${base_libdir}/security/pam_filter') - pam_pkgname = mlprefix + 'pam-plugin%s' - - do_split_packages(d, pam_libdir, r'^pam(.*)\.so$', pam_pkgname, - 'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='') - do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='') -} - -do_compile_ptest() { - cd tests - sed -i -e 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//' Makefile - oe_runmake check-am - cd - -} - -do_install() { - autotools_do_install - - # don't install /var/run when populating rootfs. Do it through volatile - rm -rf ${D}${localstatedir} - - if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then - rm -rf ${D}${sysconfdir}/init.d/ - rm -rf ${D}${sysconfdir}/rc* - install -d ${D}${sysconfdir}/tmpfiles.d - install -m 0644 ${WORKDIR}/pam-volatiles.conf \ - ${D}${sysconfdir}/tmpfiles.d/pam.conf - else - install -d ${D}${sysconfdir}/default/volatiles - install -m 0644 ${WORKDIR}/99_pam \ - ${D}${sysconfdir}/default/volatiles/ - fi - - install -d ${D}${sysconfdir}/pam.d/ - install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ - - # The lsb requires unix_chkpwd has setuid permission - chmod 4755 ${D}${sbindir}/unix_chkpwd - - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session - fi -} - -do_install_ptest() { - if [ ${PTEST_ENABLED} = "1" ]; then - mkdir -p ${D}${PTEST_PATH}/tests - install -m 0755 ${B}/tests/.libs/* ${D}${PTEST_PATH}/tests - install -m 0644 ${S}/tests/confdir ${D}${PTEST_PATH}/tests - fi -} - -pkg_postinst_${PN}() { - if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then - /etc/init.d/populate-volatile.sh update - fi -} - -inherit features_check -REQUIRED_DISTRO_FEATURES = "pam" - -BBCLASSEXTEND = "nativesdk native" - -CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session" -CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-auth" -CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-password" -CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive" -CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-account" -CONFFILES_${PN}-runtime += "${sysconfdir}/security/limits.conf" - -UPSTREAM_CHECK_URI = "https://github.com/linux-pam/linux-pam/releases" - -CVE_PRODUCT = "linux-pam" diff --git a/meta-openeuler/recipes-core/pciutils/pciutils_3.7.0.bb b/meta-openeuler/recipes-core/pciutils/pciutils_3.7.0.bb deleted file mode 100644 index 96c0a91d7a392c263e75db38362d75deb797d26f..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/pciutils/pciutils_3.7.0.bb +++ /dev/null @@ -1,62 +0,0 @@ -SUMMARY = "PCI utilities" -DESCRIPTION = 'The PCI Utilities package contains a library for portable access \ -to PCI bus configuration space and several utilities based on this library.' -HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml" -SECTION = "console/utils" - -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" -DEPENDS = "zlib" - -SRC_URI = "file://pciutils/${BP}.tar.gz \ - file://pciutils/0000-pciutils-2.2.1-idpath.patch \ - file://pciutils/0001-pciutils-dir-d.patch \ - file://configure.patch \ -" - -SRC_URI[sha256sum] = "2432e7a2e12000502d36cf769ab6e5a0cf4931e5050ccaf8b02984b2d3cb0948" - -inherit multilib_header pkgconfig - -PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'hwdb', '', d)}" -PACKAGECONFIG[hwdb] = "HWDB=yes,HWDB=no,udev" - -PCI_CONF_FLAG = "ZLIB=yes DNS=yes SHARED=yes STRIP= LIBDIR=${libdir}" - -# see configure.patch -do_configure () { - ( - cd lib && \ - # PACKAGECONFIG_CONFARGS for this recipe could only possibly contain 'HWDB=yes/no', - # so we put it before ./configure - ${PCI_CONF_FLAG} ${PACKAGECONFIG_CONFARGS} ./configure ${PV} ${datadir} ${TARGET_OS} ${TARGET_ARCH} - ) -} - -export PREFIX = "${prefix}" -export SBINDIR = "${sbindir}" -export SHAREDIR = "${datadir}" -export MANDIR = "${mandir}" - -EXTRA_OEMAKE = "-e MAKEFLAGS= ${PCI_CONF_FLAG}" - -ASNEEDED = "" - -# The configure script breaks if the HOST variable is set -HOST[unexport] = "1" - -do_install () { - oe_runmake DESTDIR=${D} install install-lib - - install -d ${D}${bindir} - ln -s ../sbin/lspci ${D}${bindir}/lspci - - oe_multilib_header pci/config.h -} - -PACKAGES =+ "${PN}-ids libpci" -FILES_${PN}-ids = "${datadir}/hwdata/pci.ids*" -FILES_libpci = "${libdir}/libpci.so.*" -SUMMARY_${PN}-ids = "PCI utilities - device ID database" -DESCRIPTION_${PN}-ids = "Package providing the PCI device ID database for pciutils." -RDEPENDS_${PN} += "${PN}-ids" diff --git a/meta-openeuler/recipes-core/procps/procps/sysctl.conf b/meta-openeuler/recipes-core/procps/procps/sysctl.conf deleted file mode 100644 index 253f3701bd39d282dc802b581fae9841520111d0..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/procps/procps/sysctl.conf +++ /dev/null @@ -1,67 +0,0 @@ -# This configuration taken from procps v3.3.15 -# Commented out kernel/pid_max=10000 line -# -# /etc/sysctl.conf - Configuration file for setting system variables -# See sysctl.conf (5) for information. - -# you can have the CD-ROM close when you use it, and open -# when you are done. -#dev.cdrom.autoeject = 1 -#dev.cdrom.autoclose = 1 - -# protection from the SYN flood attack -net/ipv4/tcp_syncookies=1 - -# see the evil packets in your log files -net/ipv4/conf/all/log_martians=1 - -# makes you vulnerable or not :-) -net/ipv4/conf/all/accept_redirects=0 -net/ipv4/conf/all/accept_source_route=0 -net/ipv4/icmp_echo_ignore_broadcasts =1 - -# needed for routing, including masquerading or NAT -#net/ipv4/ip_forward=1 - -# sets the port range used for outgoing connections -#net.ipv4.ip_local_port_range = 32768 61000 - -# Broken routers and obsolete firewalls will corrupt the window scaling -# and ECN. Set these values to 0 to disable window scaling and ECN. -# This may, rarely, cause some performance loss when running high-speed -# TCP/IP over huge distances or running TCP/IP over connections with high -# packet loss and modern routers. This sure beats dropped connections. -#net.ipv4.tcp_ecn = 0 - -# Swapping too much or not enough? Disks spinning up when you'd -# rather they didn't? Tweak these. -#vm.vfs_cache_pressure = 100 -#vm.laptop_mode = 0 -#vm.swappiness = 60 - -#kernel.printk_ratelimit_burst = 10 -#kernel.printk_ratelimit = 5 -#kernel.panic_on_oops = 0 - -# Reboot 600 seconds after a panic -#kernel.panic = 600 - -# enable SysRq key (note: console security issues) -#kernel.sysrq = 1 - -# Change name of core file to start with the command name -# so you get things like: emacs.core mozilla-bin.core X.core -#kernel.core_pattern = %e.core - -# NIS/YP domain (not always equal to DNS domain) -#kernel.domainname = example.com -#kernel.hostname = darkstar - -# This limits PID values to 4 digits, which allows tools like ps -# to save screen space. -#kernel/pid_max=10000 - -# Protects against creating or following links under certain conditions -# See https://www.kernel.org/doc/Documentation/sysctl/fs.txt -#fs.protected_hardlinks = 1 -#fs.protected_symlinks = 1 diff --git a/meta-openeuler/recipes-core/procps/procps_3.3.17.bb b/meta-openeuler/recipes-core/procps/procps_3.3.17.bb deleted file mode 100644 index bdd1a910d618d1a237a6f7e9d9ab7ce75828cdd9..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/procps/procps_3.3.17.bb +++ /dev/null @@ -1,96 +0,0 @@ -SUMMARY = "System and process monitoring utilities" -DESCRIPTION = "Procps contains a set of system utilities that provide system information about processes using \ -the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, and skill." -HOMEPAGE = "https://gitlab.com/procps-ng/procps" -SECTION = "base" -LICENSE = "GPLv2+ & LGPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \ - " - -DEPENDS = "ncurses" - -inherit autotools gettext pkgconfig - -SRC_URI = "file://procps-ng/procps-ng-${PV}.tar.xz \ - file://procps-ng/0001-top-fix-two-potential-alternate-display-mode-abends.patch \ - file://procps-ng/0002-top-In-the-bye_bye-function-replace-fputs-with-the-w.patch \ - file://procps-ng/0003-add-options-M-and-N-for-top.patch \ - file://procps-ng/0004-top-exit-with-error-when-pid-overflow.patch \ - file://procps-ng/0005-fix-a-fix-for-the-bye_bye-function.patch \ - file://sysctl.conf \ - " -SRC_URI[sha256sum] = "4518b3e7aafd34ec07d0063d250fd474999b20b200218c3ae56f5d2113f141b4" - -EXTRA_OECONF = "--enable-skill --disable-modern-top" - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" -PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd" - -do_install_append () { - install -d ${D}${base_bindir} - [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done - install -d ${D}${base_sbindir} - [ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done - if [ "${base_sbindir}" != "${sbindir}" ]; then - rmdir ${D}${sbindir} - fi - - install -d ${D}${sysconfdir} - install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - install -d ${D}${sysconfdir}/sysctl.d - ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf - fi -} - -CONFFILES_${PN} = "${sysconfdir}/sysctl.conf" - -bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w" -base_bindir_progs += "kill pidof ps watch" -base_sbindir_progs += "sysctl" - -ALTERNATIVE_PRIORITY = "200" -ALTERNATIVE_PRIORITY[pidof] = "150" - -ALTERNATIVE_${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}" - -ALTERNATIVE_${PN}-doc = "kill.1 uptime.1" -ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" -ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" - -python __anonymous() { - for prog in d.getVar('base_bindir_progs').split(): - d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) - - for prog in d.getVar('base_sbindir_progs').split(): - d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog)) -} - -# 'ps' isn't suitable for use as a security tool so whitelist this CVE. -# https://bugzilla.redhat.com/show_bug.cgi?id=1575473#c3 -CVE_CHECK_WHITELIST += "CVE-2018-1121" - -PROCPS_PACKAGES = "${PN}-lib \ - ${PN}-sysctl" - -PACKAGE_BEFORE_PN = "${PROCPS_PACKAGES}" -RDEPENDS_${PN} += "${PROCPS_PACKAGES}" - -RDEPENDS_${PN}-ps += "${PN}-lib" -RDEPENDS_${PN}-sysctl += "${PN}-lib" - -FILES_${PN}-lib = "${libdir}" -FILES_${PN}-ps = "${base_bindir}/ps.${BPN}" -FILES_${PN}-sysctl = "${base_sbindir}/sysctl.${BPN} ${sysconfdir}/sysctl.conf ${sysconfdir}/sysctl.d" - -ALTERNATIVE_${PN}_remove = "ps" -ALTERNATIVE_${PN}_remove = "sysctl" - -ALTERNATIVE_${PN}-ps = "ps" -ALTERNATIVE_TARGET[ps] = "${base_bindir}/ps" -ALTERNATIVE_LINK_NAME[ps] = "${base_bindir}/ps" - -ALTERNATIVE_${PN}-sysctl = "sysctl" -ALTERNATIVE_TARGET[sysctl] = "${base_sbindir}/sysctl" -ALTERNATIVE_LINK_NAME[sysctl] = "${base_sbindir}/sysctl" diff --git a/meta-openeuler/recipes-core/psmisc/psmisc.inc b/meta-openeuler/recipes-core/psmisc/psmisc.inc deleted file mode 100644 index 3b167d56158fa4663045f4638b9659398c624fa5..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/psmisc/psmisc.inc +++ /dev/null @@ -1,36 +0,0 @@ -SUMMARY = "Utilities for managing processes on your system" -HOMEPAGE = "http://psmisc.sf.net/" -DESCRIPTION = "The psmisc package contains utilities for managing processes on your \ -system: pstree, killall and fuser. The pstree command displays a tree \ -structure of all of the running processes on your system. The killall \ -command sends a specified signal (SIGTERM if nothing is specified) to \ -processes identified by name. The fuser command identifies the PIDs \ -of processes that are using specified files or filesystems." -SECTION = "base" -DEPENDS = "ncurses virtual/libintl" -LICENSE = "GPLv2" - -inherit autotools gettext - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" -PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," - -ALLOW_EMPTY_${PN} = "1" - -PACKAGES =+ "fuser fuser-doc killall killall-doc pstree pstree-doc" -PACKAGES += "psmisc-extras" - -FILES_${PN} = "" -RDEPENDS_${PN} = "fuser killall pstree" - -FILES_fuser = "${bindir}/fuser.${BPN}" -FILES_fuser-doc = "${mandir}/man1/fuser*" - -FILES_killall = "${bindir}/killall.${BPN}" -FILES_killall-doc = "${mandir}/man1/killall*" - -FILES_pstree = "${bindir}/pstree" -FILES_pstree-doc = "${mandir}/man1/pstree*" - -FILES_psmisc-extras = "${bindir}" -FILES_psmisc-extras-doc = "${mandir}" diff --git a/meta-openeuler/recipes-core/psmisc/psmisc_23.4.bb b/meta-openeuler/recipes-core/psmisc/psmisc_23.4.bb deleted file mode 100644 index 77389ea510b848616ef658051e0e0d087d159801..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/psmisc/psmisc_23.4.bb +++ /dev/null @@ -1,6 +0,0 @@ -require psmisc.inc -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" - -SRC_URI = "file://psmisc/${BP}.tar.xz" -S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/recipes-core/quota/quota_4.06.bb b/meta-openeuler/recipes-core/quota/quota_4.06.bb deleted file mode 100644 index 735a33b4b814fc2eb7f607ffee9d50a44840cb7a..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/quota/quota_4.06.bb +++ /dev/null @@ -1,35 +0,0 @@ -SUMMARY = "Tools for monitoring & limiting user disk usage per filesystem" -SECTION = "base" -HOMEPAGE = "http://sourceforge.net/projects/linuxquota/" -DESCRIPTION = "Tools and patches for the Linux Diskquota system as part of the Linux kernel" -BUGTRACKER = "http://sourceforge.net/tracker/?group_id=18136&atid=118136" -LICENSE = "BSD & GPLv2+ & LGPLv2.1+" -LIC_FILES_CHKSUM = "file://rquota_server.c;beginline=1;endline=20;md5=fe7e0d7e11c6f820f8fa62a5af71230f \ - file://svc_socket.c;beginline=1;endline=17;md5=24d5a8792da45910786eeac750be8ceb" - -SRC_URI = "file://quota/${BP}.tar.gz \ - file://quota/0000-Limit-number-of-comparison-characters-to-4.patch \ - file://quota/0001-Limit-maximum-of-RPC-port.patch \ - file://quota/0002-quotaio_xfs-Warn-when-large-kernel-timestamps-cannot.patch \ -" -SRC_URI[sha256sum] = "2f3e03039f378d4f0d97acdb49daf581dcaad64d2e1ddf129495fd579fbd268d" - -CVE_PRODUCT = "linux_diskquota" - -UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/linuxquota/files/quota-tools/" -UPSTREAM_CHECK_REGEX = "/quota-tools/(?P(\d+[\.\-_]*)+)/" - -DEPENDS = "gettext-native e2fsprogs libnl" - -inherit autotools-brokensep gettext pkgconfig - -CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'rpc', '-I${STAGING_INCDIR}/tirpc', '', d)}" -LDFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'rpc', '-ltirpc', '', d)}" -ASNEEDED = "" - -PACKAGECONFIG ??= "rpc bsd" -PACKAGECONFIG_libc-musl = "tcp-wrappers rpc" - -PACKAGECONFIG[rpc] = "--enable-rpc,--disable-rpc,libtirpc" -PACKAGECONFIG[bsd] = "--enable-bsd_behaviour=yes,--enable-bsd_behaviour=no," -PACKAGECONFIG[ldapmail] = "--enable-ldapmail,--disable-ldapmail,openldap" diff --git a/meta-openeuler/recipes-core/readline/files/inputrc b/meta-openeuler/recipes-core/readline/files/inputrc deleted file mode 100644 index b5c4c8af24b001b0596e5080ceed11dd0a0dc602..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/readline/files/inputrc +++ /dev/null @@ -1,61 +0,0 @@ -# /etc/inputrc - global inputrc for libreadline -# See readline(3readline) and `info rluserman' for more information. - -# Be 8 bit clean. -set input-meta on -set output-meta on - -# To allow the use of 8bit-characters like the german umlauts, comment out -# the line below. However this makes the meta key not work as a meta key, -# which is annoying to those which don't need to type in 8-bit characters. - -# set convert-meta off - -# try to enable the application keypad when it is called. Some systems -# need this to enable the arrow keys. -# set enable-keypad on - -# see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys - -# do not bell on tab-completion -# set bell-style none - -# some defaults / modifications for the emacs mode -$if mode=emacs - -# allow the use of the Home/End keys -# "\e[1~": beginning-of-line -# "\e[4~": end-of-line - -# allow the use of the Delete/Insert keys -# "\e[3~": delete-char -# "\e[2~": quoted-insert - -# mappings for "page up" and "page down" to step to the beginning/end -# of the history -# "\e[5~": beginning-of-history -# "\e[6~": end-of-history - -# alternate mappings for "page up" and "page down" to search the history -# "\e[5~": history-search-backward -# "\e[6~": history-search-forward - -# # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving -# "\e[5C": forward-word -# "\e[5D": backward-word -# "\e\e[C": forward-word -# "\e\e[D": backward-word - -# $if term=rxvt -# "\e[8~": end-of-line -# $endif - -# for non RH/Debian xterm, can't hurt for RH/DEbian xterm -# "\eOH": beginning-of-line -# "\eOF": end-of-line - -# for freebsd console -# "\e[H": beginning-of-line -# "\e[F": end-of-line - -$endif diff --git a/meta-openeuler/recipes-core/readline/readline-8.1/configure-fix.patch b/meta-openeuler/recipes-core/readline/readline-8.1/configure-fix.patch deleted file mode 100644 index ef3104f8a6de965f77193f039aeb373a615633bf..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/readline/readline-8.1/configure-fix.patch +++ /dev/null @@ -1,35 +0,0 @@ -Upstream-Status: Pending - -Without this it fails to link against libtermcap causing various missing -symbols issues. - -RP - 8/10/08 - -Support 6.3 which uses configure.ac rather than configure.in. -Signed-off-by: Hongxu Jia ---- - configure.ac | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/configure.ac b/configure.ac -index cea8f91..9075b8f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -218,10 +218,10 @@ if test -f ${srcdir}/support/shobj-conf; then - AC_MSG_CHECKING(configuration for building shared libraries) - eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}` - --# case "$SHLIB_LIBS" in --# *curses*|*termcap*|*termlib*) ;; --# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;; --# esac -+ case "$SHLIB_LIBS" in -+ *curses*|*termcap*|*termlib*) ;; -+ *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;; -+ esac - - AC_SUBST(SHOBJ_CC) - AC_SUBST(SHOBJ_CFLAGS) --- -1.8.1.2 - diff --git a/meta-openeuler/recipes-core/readline/readline-8.1/rl-native.map b/meta-openeuler/recipes-core/readline/readline-8.1/rl-native.map deleted file mode 100644 index 5e7d49cdd222154ebe093590cfd9d9c9a0df9459..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/readline/readline-8.1/rl-native.map +++ /dev/null @@ -1,12 +0,0 @@ -READLINE_6.3 { - rl_change_environment; - rl_clear_history; - rl_executing_key; - rl_executing_keyseq; - rl_filename_stat_hook; - rl_history_substr_search_backward; - rl_history_substr_search_forward; - rl_input_available_hook; - rl_print_last_kbd_macro; - rl_signal_event_hook; -}; diff --git a/meta-openeuler/recipes-core/readline/readline.inc b/meta-openeuler/recipes-core/readline/readline.inc deleted file mode 100644 index fa17afed0786831df0398ca5e2d09ba796b74430..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/readline/readline.inc +++ /dev/null @@ -1,54 +0,0 @@ -SUMMARY = "Library for editing typed command lines" -DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \ -command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \ -additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \ -lines, and perform csh-like history expansion on previous commands." -SECTION = "libs" -HOMEPAGE = "https://tiswww.case.edu/php/chet/readline/rltop.html" - -# GPLv2+ (< 6.0), GPLv3+ (>= 6.0) -LICENSE = "GPLv3+" -LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" - -DEPENDS += "ncurses" - -inherit autotools texinfo - -#EXTRA_AUTORECONF += "--exclude=autoheader" -EXTRA_AUTORECONF_DEFINE += " AUTOHEADER=echo " - -LEAD_SONAME = "libreadline.so" - -do_configure_prepend () { - if [ ! -e ${S}/acinclude.m4 ]; then - cat ${S}/aclocal.m4 > ${S}/acinclude.m4 - fi -} - -do_install_append () { - # Make install doesn't properly install these - oe_libinstall -so -C shlib libhistory ${D}${libdir} - oe_libinstall -so -C shlib libreadline ${D}${libdir} - - rmdir ${D}${bindir} - rm -rf ${D}${datadir}/${BPN}/*.c - rmdir ${D}${datadir}/${BPN} || true - - install -m 0755 -d ${D}${sysconfdir} - install -m 0644 ${WORKDIR}/inputrc ${D}${sysconfdir}/inputrc -} - -BBCLASSEXTEND = "native nativesdk" - -CONFFILES_${PN} += "${sysconfdir}/inputrc" - -#inherit update-alternatives - -ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN}-doc = "history.3" -ALTERNATIVE_LINK_NAME[history.3] = "${mandir}/man3/history.3" - -# OpenSuse injects versions into libreadline leading to conficits between our native one and theirs -# see their spec file for where this is injected. Extra versioning is harmless so we just do the same. -SRC_URI_append_class-native = " file://rl-native.map" -LDFLAGS_append_class-native = " -Wl,--version-script=${WORKDIR}/rl-native.map" diff --git a/meta-openeuler/recipes-core/readline/readline_%.bbappend b/meta-openeuler/recipes-core/readline/readline_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b2b554104e7638be1aba02d3da421e51e166c62f --- /dev/null +++ b/meta-openeuler/recipes-core/readline/readline_%.bbappend @@ -0,0 +1,24 @@ +# main bb file: yocto-poky/meta/recipes-core/readline/readline_8.1.bb +# +OPENEULER_SRC_URI_REMOVE = "https git http" + +PV = "8.2" + +# the patch is out of date, use openeuler patch +SRC_URI_remove = " \ + file://configure-fix.patch \ + file://norpath.patch \ + " + +SRC_URI_prepend = " \ + file://readline-${PV}.tar.gz \ + file://readline-8.0-shlib.patch \ +" + +SRC_URI[archive.md5sum] = "44c762f4abaca8114858e44ca8ee9777" +SRC_URI[archive.sha256sum] = "a3d4637cdbd76f3cbc9566db90306a6af7bef90b291f7c9bc5fd8b0b0db9c686" + +# diff from oe 8.2 bb +# see: http://cgit.openembedded.org/openembedded-core/plain/meta/recipes-core/readline/readline.inc +EXTRA_OECONF += "bash_cv_termcap_lib=ncurses --with-shared-termcap-library" + diff --git a/meta-openeuler/recipes-core/readline/readline_8.1.bb b/meta-openeuler/recipes-core/readline/readline_8.1.bb deleted file mode 100644 index b03e75ef48960ae17ba3fbac1e0f7738ae934f76..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/readline/readline_8.1.bb +++ /dev/null @@ -1,10 +0,0 @@ -require readline.inc - -SRC_URI = "file://readline/${BPN}-${PV}.tar.gz \ - file://readline/readline-8.0-shlib.patch \ - file://inputrc \ - file://configure-fix.patch \ -" - -SRC_URI[archive.md5sum] = "e9557dd5b1409f5d7b37ef717c64518e" -SRC_URI[archive.sha256sum] = "f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" diff --git a/meta-openeuler/recipes-core/rpcbind/rpcbind/init.d b/meta-openeuler/recipes-core/rpcbind/rpcbind/init.d deleted file mode 100644 index 67499aa828b9626f1ec1b27fd336c6533b186795..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/rpcbind/rpcbind/init.d +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh -# -# start/stop rpcbind daemon. - -### BEGIN INIT INFO -# Provides: rpcbind -# Required-Start: $network -# Required-Stop: $network -# Default-Start: S 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: RPC portmapper replacement -# Description: rpcbind is a server that converts RPC (Remote -# Procedure Call) program numbers into DARPA -# protocol port numbers. It must be running in -# order to make RPC calls. Services that use -# RPC include NFS and NIS. -### END INIT INFO - -# Source function library. -. /etc/init.d/functions - -test -f /sbin/rpcbind || exit 0 - -OPTIONS="" -if [ -f /etc/default/rpcbind ] -then - . /etc/default/rpcbind -elif [ -f /etc/rpcbind.conf ] -then - . /etc/rpcbind.conf -fi - -start () -{ - echo -n "Starting rpcbind daemon..." - if pidof /sbin/rpcbind >/dev/null; then - echo "already running." - exit 0 - fi - start-stop-daemon --start --quiet --exec /sbin/rpcbind -- "$@" - if [ $? -eq 0 ]; then - echo "done." - else - echo "failed." - fi -} - -stop () -{ - echo "Stopping rpcbind daemon..." - if ! pidof /sbin/rpcbind >/dev/null; then - echo "not running." - return 0 - fi - start-stop-daemon --stop --quiet --exec /sbin/rpcbind - if [ $? -eq 0 ]; then - echo "done." - else - echo "failed." - fi -} - -case "$1" in - start) - start $OPTIONS - ;; - stop) - stop - ;; - force-reload) - stop - start $OPTIONS - ;; - restart) - stop - start $OPTIONS - ;; - status) - status /sbin/rpcbind - ;; - *) - echo "Usage: /etc/init.d/rpcbind {start|stop|force-reload|restart|status}" - exit 1 - ;; -esac - -exit $? diff --git a/meta-openeuler/recipes-core/rpcbind/rpcbind/rpcbind.conf b/meta-openeuler/recipes-core/rpcbind/rpcbind/rpcbind.conf deleted file mode 100644 index f423ac178894a32ec7f2b8c330034c49865d20b0..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/rpcbind/rpcbind/rpcbind.conf +++ /dev/null @@ -1,3 +0,0 @@ -# Optional arguments passed to rpcbind. -# -RPCBIND_OPTIONS="" diff --git a/meta-openeuler/recipes-core/rpcbind/rpcbind_1.2.6.bb b/meta-openeuler/recipes-core/rpcbind/rpcbind_1.2.6.bb deleted file mode 100644 index 347851b9266fefaad6576778abbe9e53b7de0a4e..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/rpcbind/rpcbind_1.2.6.bb +++ /dev/null @@ -1,56 +0,0 @@ -SUMMARY = "Universal Addresses to RPC Program Number Mapper" -DESCRIPTION = "The rpcbind utility is a server that converts RPC \ - program numbers into universal addresses." -SECTION = "console/network" -HOMEPAGE = "http://sourceforge.net/projects/rpcbind/" -BUGTRACKER = "http://sourceforge.net/tracker/?group_id=201237&atid=976751" -DEPENDS = "libtirpc quota" - -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://COPYING;md5=b46486e4c4a416602693a711bb5bfa39 \ - file://src/rpcinfo.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24" - -SRC_URI = "file://rpcbind/${BP}.tar.bz2 \ - file://rpcbind/rpcbind-0.2.4-runstatdir.patch \ - file://rpcbind/bugfix-rpcbind-GETADDR-return-client-ip.patch \ - file://rpcbind/CVE-2017-8779.patch \ - file://rpcbind/backport-fix-double-free-in-init_transport.patch \ - file://rpcbind/bugfix-listen-tcp-port-111.patch \ - file://init.d \ - file://rpcbind.conf \ -" -SRC_URI[md5sum] = "2d84ebbb7d6fb1fc3566d2d4b37f214b" -SRC_URI[sha256sum] = "5613746489cae5ae23a443bb85c05a11741a5f12c8f55d2bb5e83b9defeee8de" - -inherit autotools systemd pkgconfig - -PACKAGECONFIG ??= "tcp-wrappers" -PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" - -INITSCRIPT_NAME = "rpcbind" -INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ." - -SYSTEMD_SERVICE_${PN} = "rpcbind.service rpcbind.socket" - -USERADD_PACKAGES = "${PN}" -USERADD_PARAM_${PN} = "--system --no-create-home --home-dir / \ - --shell /bin/false --user-group rpc" - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" -PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/, \ - --without-systemdsystemunitdir, \ - systemd \ -" - -EXTRA_OECONF += " --enable-warmstarts --with-rpcuser=rpc --without-systemdsystemunitdir" - -do_install_append () { - install -d ${D}${sysconfdir}/init.d - sed -e 's,/etc/,${sysconfdir}/,g' \ - -e 's,/sbin/,${sbindir}/,g' \ - ${WORKDIR}/init.d > ${D}${sysconfdir}/init.d/rpcbind - chmod 0750 ${D}${sysconfdir}/init.d/rpcbind -} - -ALTERNATIVE_${PN} = "rpcinfo" -ALTERNATIVE_LINK_NAME[rpcinfo] = "${bindir}/rpcinfo" diff --git a/meta-openeuler/recipes-core/rsyslog/rsyslog/initscript b/meta-openeuler/recipes-core/rsyslog/rsyslog/initscript deleted file mode 100644 index 96e9d74ca4e25856f8781475788cbbfe1b01eefb..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/rsyslog/rsyslog/initscript +++ /dev/null @@ -1,119 +0,0 @@ -#! /bin/sh -# -# This is an init script for openembedded -# Copy it to /etc/init.d/rsyslog and type -# > update-rc.d rsyslog defaults 5 -# - -PATH=/sbin:/usr/sbin:/bin:/usr/bin -NAME=rsyslog -RSYSLOGD=rsyslogd -RSYSLOGD_BIN=/usr/sbin/rsyslogd -RSYSLOGD_OPTIONS="" -RSYSLOGD_PIDFILE=/var/run/rsyslogd.pid -SCRIPTNAME=/etc/init.d/$NAME -# Exit if the package is not installed -[ -x "$RSYSLOGD_BIN" ] || exit 0 -# Read configuration variable file if it is present -[ -r /etc/default/$NAME ] && . /etc/default/$NAME -# -# Function that starts the daemon/service -# -do_start() -{ - DAEMON=$1 - DAEMON_ARGS=$2 - PIDFILE=$3 - # Return - # 0 if daemon has been started - # 1 if daemon could not be started - # if daemon had already been started, start-stop-daemon will return 1 - # so add -o/--oknodo(if nothing is done, exit 0) - start-stop-daemon -S --quiet --pidfile $PIDFILE --exec $DAEMON \ - --oknodo -- $DAEMON_ARGS || return 1 -} -# -# Function that stops the daemon/service -# -do_stop() -{ - NAME=$1 - PIDFILE=$2 - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - # QUIT/TERM/INT should work here, but they don't ????? - start-stop-daemon -K --quiet --signal KILL --pidfile $PIDFILE --name $NAME - RETVAL="$?" - rm -f $PIDFILE - return "$RETVAL" -} -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - NAME=$1 - PIDFILE=$2 - start-stop-daemon -K --signal HUP --quiet --pidfile $PIDFILE --name $NAME - return 0 -} - -do_status() { - NAME=$1 - PIDFILE=$2 - # -t: test only but not stop - start-stop-daemon -K -t --quiet --pidfile $PIDFILE --name $NAME - # exit with status 0 if process is found - if [ "$?" = "0" ]; then - return 0 - else - return 1 - fi -} - -case "$1" in - start) - echo -n "starting $RSYSLOGD ... " - do_start "$RSYSLOGD_BIN" "$RSYSLOGD_OPTIONS" "$RSYSLOGD_PIDFILE" - case "$?" in - 0) echo "done" ;; - 1) echo "failed" ;; - esac - ;; - stop) - echo -n "stopping $RSYSLOGD ... " - do_stop "$RSYSLOGD" "$RSYSLOGD_PIDFILE" - case "$?" in - 0|1) echo "done" ;; - 2) echo "failed" ;; - esac - ;; - reload|force-reload) - echo -n "reloading $RSYSLOGD ... " - do_reload "$RSYSLOGD" "$RSYSLOGD_PIDFILE" - echo "done" - ;; - restart) - $0 stop - $0 start - ;; - status) - echo -n "status $RSYSLOGD ... " - do_status "$RSYSLOGD" "$RSYSLOGD_PIDFILE" - if [ "$?" = "0" ]; then - echo "running" - exit 0 - else - echo "stopped" - exit 1 - fi - ;; - *) - echo "Usage: $SCRIPTNAME {start|stop|status|restart|reload|force-reload}" >&2 - exit 3 - ;; -esac -exit 0 - diff --git a/meta-openeuler/recipes-core/rsyslog/rsyslog/rsyslog.conf b/meta-openeuler/recipes-core/rsyslog/rsyslog/rsyslog.conf deleted file mode 100644 index 3db32f0c1cf1a14a9f5ba0a91998360ff47840fc..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/rsyslog/rsyslog/rsyslog.conf +++ /dev/null @@ -1,85 +0,0 @@ -# rsyslog configuration file - -# For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html -# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html - -#### MODULES #### - -$ModLoad imuxsock # provides support for local system logging (e.g. via logger command) -$ModLoad imklog # reads kernel messages (the same are read from journald) -$ModLoad immark # provides --MARK-- message capability - -# Provides UDP syslog reception -#$ModLoad imudp -#$UDPServerRun 514 - -# Provides TCP syslog reception -#$ModLoad imtcp -#$InputTCPServerRun 514 - - -#### GLOBAL DIRECTIVES #### -$FileGroup root -$FileOwner root -$FileCreateMode 0640 - -# Where to place auxiliary files -$WorkDirectory /var/lib/rsyslog - -# Use default timestamp format -$ActionFileDefaultTemplate RSYSLOG_FileFormat - -# File syncing capability is disabled by default. This feature is usually not required, -# not useful and an extreme performance hit -#$ActionFileEnableSync on - -# Include all config files in /etc/rsyslog.d/ -$IncludeConfig /etc/rsyslog.d/*.conf - - -#### RULES #### - -# Log all kernel messages to the console. -# Logging much else clutters up the screen. -#kern.* /dev/console - -# Log anything (except mail) of level info or higher. -# Don't log private authentication messages! -*.info;mail.none /var/log/messages - -# The authpriv file has restricted access. -authpriv.* /var/log/secure - -# Log all the mail messages in one place. -mail.* -/var/log/maillog - - -# Log cron stuff -cron.* /var/log/cron - -# Everybody gets emergency messages -*.emerg :omusrmsg:* - -# Save news errors of level crit and higher in a special file. -uucp,news.crit /var/log/spooler - -# Save boot messages also to boot.log -local7.* /var/log/boot.log - - -# ### begin forwarding rule ### -# The statement between the begin ... end define a SINGLE forwarding -# rule. They belong together, do NOT split them. If you create multiple -# forwarding rules, duplicate the whole block! -# Remote Logging (we use TCP for reliable delivery) -# -# An on-disk queue is created for this action. If the remote host is -# down, messages are spooled to disk and sent when it is up again. -#$ActionQueueFileName fwdRule1 # unique name prefix for spool files -#$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible) -#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown -#$ActionQueueType LinkedList # run asynchronously -#$ActionResumeRetryCount -1 # infinite retries if host is down -# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional -#*.* @@remote-host:514 -# ### end of the forwarding rule ### diff --git a/meta-openeuler/recipes-core/rsyslog/rsyslog/rsyslog.logrotate b/meta-openeuler/recipes-core/rsyslog/rsyslog/rsyslog.logrotate deleted file mode 100644 index 962794577d75516f553240012520b0a0d3d2ea10..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/rsyslog/rsyslog/rsyslog.logrotate +++ /dev/null @@ -1,40 +0,0 @@ -# /etc/logrotate.d/rsyslog - Ported from Debian - -/var/log/syslog -{ - rotate 7 - daily - missingok - notifempty - delaycompress - compress - postrotate - @BINDIR@/pkill -HUP rsyslogd 2> /dev/null || true - endscript -} - -/var/log/mail.info -/var/log/mail.warn -/var/log/mail.err -/var/log/mail.log -/var/log/daemon.log -/var/log/kern.log -/var/log/auth.log -/var/log/user.log -/var/log/lpr.log -/var/log/cron.log -/var/log/debug -/var/log/messages -{ - rotate 4 - weekly - missingok - notifempty - compress - delaycompress - sharedscripts - postrotate - @BINDIR@/pkill -HUP rsyslogd 2> /dev/null || true - endscript -} - diff --git a/meta-openeuler/recipes-core/rsyslog/rsyslog_8.2110.0.bb b/meta-openeuler/recipes-core/rsyslog/rsyslog_8.2110.0.bb deleted file mode 100644 index 446bc332cf4de40b62cac6e1f374300deea297da..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/rsyslog/rsyslog_8.2110.0.bb +++ /dev/null @@ -1,107 +0,0 @@ -SUMMARY = "Rsyslog is an enhanced multi-threaded syslogd" -DESCRIPTION = "\ - Rsyslog is an enhanced syslogd supporting, among others, MySQL,\ - PostgreSQL, failover log destinations, syslog/tcp, fine grain\ - output format control, high precision timestamps, queued operations\ - and the ability to filter on any message part. It is quite\ - compatible to stock sysklogd and can be used as a drop-in replacement.\ - Its advanced features make it suitable for enterprise-class,\ - encryption protected syslog relay chains while at the same time being\ - very easy to setup for the novice user." - -DEPENDS = "zlib libestr libfastjson bison-native" -HOMEPAGE = "http://www.rsyslog.com/" -LICENSE = "GPLv3 & LGPLv3 & Apache-2.0" -LIC_FILES_CHKSUM = "file://COPYING;md5=51d9635e646fb75e1b74c074f788e973" - -SRC_URI = "file://${BPN}/${BP}.tar.gz \ - file://${BPN}/rsyslog-8.24.0-ensure-parent-dir-exists-when-writting-log-file.patch \ - file://${BPN}/bugfix-rsyslog-7.4.7-imjournal-add-monotonic-timestamp.patch \ - file://${BPN}/bugfix-rsyslog-7.4.7-add-configuration-to-avoid-memory-leak.patch \ - file://${BPN}/rsyslog-8.37.0-initialize-variables-and-check-return-value.patch \ - file://initscript \ - file://rsyslog.conf \ - file://rsyslog.logrotate \ -" -UPSTREAM_CHECK_URI = "https://github.com/rsyslog/rsyslog/releases" -UPSTREAM_CHECK_REGEX = "(?P\d+(\.\d+)+)" - -inherit autotools pkgconfig - -#not enable --enable-libsystemd configuration options -EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes --enable-libsystemd=no" -EXTRA_OECONF_remove_mipsarch = "ap_cv_atomic_builtins=yes" -EXTRA_OECONF_remove_powerpc = "ap_cv_atomic_builtins=yes" -EXTRA_OECONF_remove_riscv32 = "ap_cv_atomic_builtins=yes" -CFLAGS += " -I${RECIPE_SYSROOT}/usr/include/libfastjson/ " -# first line is default yes in configure -PACKAGECONFIG ??= " \ - rsyslogd rsyslogrt klog inet regexp uuid \ - fmhttp imdiag imfile \ - ${@bb.utils.filter('DISTRO_FEATURES', 'snmp', d)} \ -" -RSYSLOG_IMAGE_NAME = "${MACHINE_ARCH}${RTOS_KERNEL_TAG}" -PACKAGECONFIG_remove += "${@bb.utils.contains('RSYSLOG_IMAGE_NAME', 'arm32a15eb-5.10', 'fmhttp', '', d)}" -PACKAGECONFIG_remove += "${@bb.utils.contains('RSYSLOG_IMAGE_NAME', 'arm32a9eb-5.10', 'fmhttp', '', d)}" -PACKAGECONFIG_remove += "${@bb.utils.contains('RSYSLOG_IMAGE_NAME', 'arm32a9eb-tiny-5.10', 'fmhttp', '', d)}" -PACKAGECONFIG_remove += "${@bb.utils.contains('RSYSLOG_IMAGE_NAME', 'arm64eb-5.10', 'fmhttp', '', d)}" -PACKAGECONFIG_remove += "${@bb.utils.contains('RSYSLOG_IMAGE_NAME', 'arm64el-5.10', 'fmhttp', '', d)}" -PACKAGECONFIG_remove += "${@bb.utils.contains('RSYSLOG_IMAGE_NAME', 'arm32a7el-preempt-5.10', 'fmhttp', '', d)}" - -# add imfile module to support file monitor function -PACKAGECONFIG_append_arm64el = "${@bb.utils.contains('RTOS_TAG', '-preempt', 'imfile', '', d)}" - -# default yes in configure -PACKAGECONFIG[relp] = "--enable-relp,--disable-relp,librelp," -PACKAGECONFIG[rsyslogd] = "--enable-rsyslogd,--disable-rsyslogd,," -PACKAGECONFIG[rsyslogrt] = "--enable-rsyslogrt,--disable-rsyslogrt,," -PACKAGECONFIG[fmhttp] = "--enable-fmhttp,--disable-fmhttp,curl," -PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,," -PACKAGECONFIG[klog] = "--enable-klog,--disable-klog,," -PACKAGECONFIG[regexp] = "--enable-regexp,--disable-regexp,," -PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux," -PACKAGECONFIG[libgcrypt] = "--enable-libgcrypt,--disable-libgcrypt,libgcrypt," -PACKAGECONFIG[testbench] = "--enable-testbench --enable-omstdout,--disable-testbench --disable-omstdout,," - -# default no in configure -PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,," -PACKAGECONFIG[imdiag] = "--enable-imdiag,--disable-imdiag,," -PACKAGECONFIG[imfile] = "--enable-imfile,--disable-imfile,," -PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp," -PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls," -PACKAGECONFIG[imjournal] = "--enable-imjournal,--disable-imjournal," -PACKAGECONFIG[mmjsonparse] = "--enable-mmjsonparse,--disable-mmjsonparse," -PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," -PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," -PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi," -PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," -PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind," -do_install_append() { - install -d "${D}${sysconfdir}/init.d" - install -d "${D}${sysconfdir}/logrotate.d" - install -d "${D}/var/lib/rsyslog" - install -m 750 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/syslog - install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf - install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog - sed -i -e "s#@BINDIR@#${bindir}#g" ${D}${sysconfdir}/logrotate.d/logrotate.rsyslog - - if ${@bb.utils.contains('PACKAGECONFIG', 'imjournal', 'true', 'false', d)}; then - install -d 0755 ${D}${sysconfdir}/rsyslog.d - echo '$ModLoad imjournal' >> ${D}${sysconfdir}/rsyslog.d/imjournal.conf - fi - if ${@bb.utils.contains('PACKAGECONFIG', 'mmjsonparse', 'true', 'false', d)}; then - install -d 0755 ${D}${sysconfdir}/rsyslog.d - echo '$ModLoad mmjsonparse' >> ${D}${sysconfdir}/rsyslog.d/mmjsonparse.conf - fi -} - -FILES_${PN} += "${bindir}" - -INITSCRIPT_NAME = "syslog" -INITSCRIPT_PARAMS = "defaults" - -CONFFILES_${PN} = "${sysconfdir}/rsyslog.conf" - -RCONFLICTS_${PN} = "busybox-syslog sysklogd syslog-ng" - -RDEPENDS_${PN} += "logrotate" diff --git a/meta-openeuler/recipes-core/sed/sed/run-ptest b/meta-openeuler/recipes-core/sed/sed/run-ptest deleted file mode 100644 index 993d7d5d75e723aee40b544f7df18ab482d32d18..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/sed/sed/run-ptest +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -chown nobody testsuite -chown nobody ../ptest -su nobody -c "make test-suite.log" diff --git a/meta-openeuler/recipes-core/sed/sed_4.8.bb b/meta-openeuler/recipes-core/sed/sed_4.8.bb deleted file mode 100644 index 7afff2217312e6a9685c68acceb186f4d1e8a2da..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/sed/sed_4.8.bb +++ /dev/null @@ -1,72 +0,0 @@ -SUMMARY = "Stream EDitor (text filtering utility)" -HOMEPAGE = "http://www.gnu.org/software/sed/" -DESCRIPTION = "sed (stream editor) is a non-interactive command-line text editor." -LICENSE = "GPLv3+" -LIC_FILES_CHKSUM = "file://COPYING;md5=c678957b0c8e964aa6c70fd77641a71e \ - file://sed/sed.h;beginline=1;endline=15;md5=fb3c7e6fbca6f66943859153d4be8efe \ - " -SECTION = "console/utils" - -SRC_URI = "file://sed/sed-${PV}.tar.xz \ - file://sed/backport-sed-c-flag.patch \ - file://sed/backport-sed-handle-very-long-execution-lines-tiny-change.patch \ - file://sed/backport-sed-handle-very-long-input-lines-with-R-tiny-change.patch \ - file://run-ptest \ -" - -SRC_URI[md5sum] = "6d906edfdb3202304059233f51f9a71d" -SRC_URI[sha256sum] = "f79b0cfea71b37a8eeec8490db6c5f7ae7719c35587f21edb0617f370eeff633" - -#inherit autotools texinfo update-alternatives gettext ptest -inherit autotools texinfo gettext - -PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux" - -RDEPENDS_${PN}-ptest += "make gawk perl perl-module-filehandle perl-module-file-compare perl-module-file-find perl-module-file-temp perl-module-file-stat" -RRECOMMENDS_${PN}-ptest_append_libc-glibc = " locale-base-ru-ru locale-base-en-us locale-base-el-gr.iso-8859-7" - -EXTRA_OECONF = "--disable-acl \ - " - -do_install () { - autotools_do_install - install -d ${D}${base_bindir} - if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then - mv ${D}${bindir}/sed ${D}${base_bindir}/sed - rmdir ${D}${bindir}/ - fi -} - -ALTERNATIVE_${PN} = "sed" -ALTERNATIVE_LINK_NAME[sed] = "${base_bindir}/sed" -ALTERNATIVE_PRIORITY = "100" - -do_compile_ptest() { - oe_runmake testsuite/get-mb-cur-max testsuite/test-mbrtowc -} - -do_install_ptest() { - cp -rf ${S}/testsuite/ ${D}${PTEST_PATH} - cp -rf ${B}/testsuite/* ${D}${PTEST_PATH}/testsuite/ - cp -rf ${S}/build-aux/ ${D}${PTEST_PATH}/ - cp ${B}/Makefile ${D}${PTEST_PATH} - cp ${S}/init.cfg ${D}${PTEST_PATH} - - sed -e 's/^Makefile:/_Makefile:/' -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/bash/sh/' -i ${D}${PTEST_PATH}/Makefile - for i in `grep -rl "sed/sed" ${D}${PTEST_PATH}`; do sed -e 's/..\/sed\/sed/sed/' -i $i; done - - sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ - -e 's|${DEBUG_PREFIX_MAP}||g' \ - -e 's:${HOSTTOOLS_DIR}/::g' \ - -e 's:${RECIPE_SYSROOT_NATIVE}::g' \ - -e 's:abs_top_builddir =.*:abs_top_builddir = ..:g' \ - -e 's:abs_top_srcdir =.*:abs_top_srcdir = ..:g' \ - -e 's:abs_srcdir =.*:abs_srcdir = ..:g' \ - -e 's:top_srcdir =.*:top_srcdir = ..:g' \ - -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ - -i ${D}${PTEST_PATH}/Makefile -} - -RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sed', '', d)}" - -BBCLASSEXTEND = "nativesdk" diff --git a/meta-openeuler/recipes-core/selinux/libselinux/0001-Makefile-fix-python-modules-install-path-for-multili.patch b/meta-openeuler/recipes-core/selinux/libselinux/0001-Makefile-fix-python-modules-install-path-for-multili.patch new file mode 100644 index 0000000000000000000000000000000000000000..9750cd66df0b04d7c5789d3cf36a5556e0725c7e --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/libselinux/0001-Makefile-fix-python-modules-install-path-for-multili.patch @@ -0,0 +1,28 @@ +From 1ff60a36bb0bfc95ce33cf950f58e121548a3c8a Mon Sep 17 00:00:00 2001 +From: Yi Zhao +Date: Mon, 13 Apr 2020 12:44:23 +0800 +Subject: [PATCH] Makefile: fix python modules install path for multilib + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Yi Zhao +--- + src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index 04bf4f2..81ae6a2 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -181,7 +181,7 @@ install: all + ln -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET) + + install-pywrap: pywrap +- $(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` $(PYTHON_SETUP_ARGS) ++ $(PYTHON) setup.py install --prefix=$(PREFIX) --root=$(DESTDIR) --install-lib=$(PYTHONLIBDIR) $(PYTHON_SETUP_ARGS) + install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py + ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT) + +-- +2.25.1 + diff --git a/meta-openeuler/recipes-core/selinux/libselinux/0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch b/meta-openeuler/recipes-core/selinux/libselinux/0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch new file mode 100644 index 0000000000000000000000000000000000000000..db7d68fd0bb518a8dd98263e6ce07237f901d6ed --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/libselinux/0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch @@ -0,0 +1,52 @@ +From dae53d7cd4d7875f7fb7aba016a0331559044eea Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Fri, 25 Oct 2019 13:37:14 +0200 +Subject: [PATCH] Do not use PYCEXT, and rely on the installed file name + +PYCEXT is computed by asking the Python intrepreter what is the +file extension used for native Python modules. + +Unfortunately, when cross-compiling, the host Python doesn't give the +proper result: it gives the result matching the build machine, and not +the target machine. Due to this, the symlink has an incorrect name, +and doesn't point to the .so file that was actually built/installed. + +To address this and keep things simple, this patch just changes the ln +invocation to rely on the name of the _selinux*.so Python module that +was installed. + +[Upstream: https://github.com/SELinuxProject/selinux/pull/184] +Signed-off-by: Thomas Petazzoni + +Upstream-Status: Denied [https://patchwork.kernel.org/patch/11212405/] + +[Refreshed for 3.0] +Signed-off-by: Changqing Li +--- + src/Makefile | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index 81ae6a2..37399e1 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -15,7 +15,6 @@ INCLUDEDIR ?= $(PREFIX)/include + PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX)) + PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX)) + PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(plat_specific=1, prefix='$(PREFIX)'))") +-PYCEXT ?= $(shell $(PYTHON) -c 'import importlib.machinery;print(importlib.machinery.EXTENSION_SUFFIXES[0])') + RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] + " -I" + RbConfig::CONFIG["rubyhdrdir"]') + RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]') + RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]') +@@ -183,7 +182,7 @@ install: all + install-pywrap: pywrap + $(PYTHON) setup.py install --prefix=$(PREFIX) --root=$(DESTDIR) --install-lib=$(PYTHONLIBDIR) $(PYTHON_SETUP_ARGS) + install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py +- ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT) ++ ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux*.so $(DESTDIR)$(PYTHONLIBDIR)/ + + install-rubywrap: rubywrap + test -d $(DESTDIR)$(RUBYINSTALL) || install -m 755 -d $(DESTDIR)$(RUBYINSTALL) +-- +2.25.1 + diff --git a/meta-openeuler/recipes-core/selinux/libselinux_%.bbappend b/meta-openeuler/recipes-core/selinux/libselinux_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e48602292da362fac085eb68db4ad4aa967fcc0e --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/libselinux_%.bbappend @@ -0,0 +1,12 @@ +PV = "3.4" + +OPENEULER_SRC_URI_REMOVE = "https git http" +SRC_URI_prepend = "file://${BP}.tar.gz \ + file://backport-libselinux-restorecon-avoid-printing-NULL-pointer.patch \ + file://do-malloc-trim-after-load-policy.patch \ + " + +SRC_URI[md5sum] = "11d0be95e63fbe73a34d1645c5f17e28" +SRC_URI[sha256sum] = "77c294a927e6795c2e98f74b5c3adde9c8839690e9255b767c5fca6acff9b779" + +S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/recipes-core/selinux/libselinux_3.3.bb b/meta-openeuler/recipes-core/selinux/libselinux_3.3.bb deleted file mode 100644 index 49fd3cd2da8f60d09f47998d2ea6977edaf38ea1..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/selinux/libselinux_3.3.bb +++ /dev/null @@ -1,8 +0,0 @@ -require selinux_common.inc -require ${BPN}.inc - -LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" - -SRC_URI = "file://libselinux/libselinux-${PV}.tar.gz \ - file://libselinux/do-malloc-trim-after-load-policy.patch \ -" diff --git a/meta-openeuler/recipes-core/selinux/libselinux.inc b/meta-openeuler/recipes-core/selinux/libselinux_3.4.bb similarity index 55% rename from meta-openeuler/recipes-core/selinux/libselinux.inc rename to meta-openeuler/recipes-core/selinux/libselinux_3.4.bb index 189bd7e8d3ead9be03eec7b52059606742585fcc..8009d6d584c192e2f7b6c0a62d557e495639c4c8 100644 --- a/meta-openeuler/recipes-core/selinux/libselinux.inc +++ b/meta-openeuler/recipes-core/selinux/libselinux_3.4.bb @@ -4,19 +4,25 @@ process and file security contexts and to obtain security policy \ decisions. Required for any applications that use the SELinux API." SECTION = "base" LICENSE = "PD" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" -inherit lib_package +require selinux_common.inc -DEPENDS += "libsepol libpcre" +inherit lib_package pkgconfig + +DEPENDS = "libsepol libpcre2" +DEPENDS:append:libc-musl = " fts" + +S = "${WORKDIR}/git/libselinux" def get_policyconfigarch(d): import re - target = d.getVar('TARGET_ARCH', True) + target = d.getVar('TARGET_ARCH') p = re.compile('i.86') target = p.sub('i386',target) return "ARCH=%s" % (target) -EXTRA_OEMAKE += "${@get_policyconfigarch(d)}" -EXTRA_OEMAKE += "LDFLAGS='${LDFLAGS} -lpcre ' CFLAGS=' ${CFLAGS} -DNO_ANDROID_BACKEND'" +EXTRA_OEMAKE = "${@get_policyconfigarch(d)}" +EXTRA_OEMAKE:append:libc-musl = " FTS_LDLIBS=-lfts" BBCLASSEXTEND = "native" diff --git a/meta-openeuler/recipes-core/selinux/libsemanage.inc b/meta-openeuler/recipes-core/selinux/libsemanage.inc deleted file mode 100644 index 76ea9986596a0aac4bd1fbb482439575b59d78a0..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/selinux/libsemanage.inc +++ /dev/null @@ -1,25 +0,0 @@ -SUMMARY = "SELinux binary policy manipulation library" -DESCRIPTION = "libsemanage provides an API for the manipulation of SELinux binary policies. \ -It is used by checkpolicy (the policy compiler) and similar tools, as well \ -as by programs like load_policy that need to perform specific transformations \ -on binary policies such as customizing policy boolean settings." -SECTION = "base" -LICENSE = "LGPLv2.1+" - -inherit lib_package - -DEPENDS += "libsepol libselinux bzip2 bison-native" -DEPENDS_append_class-target += "audit" - -EXTRA_OEMAKE_class-native += "DISABLE_AUDIT=y" - -do_install() { - oe_runmake install \ - DESTDIR="${D}" \ - PREFIX="${prefix}" \ - INCLUDEDIR="${includedir}" \ - LIBDIR="${libdir}" \ - SHLIBDIR="${libdir}" -} - -BBCLASSEXTEND = "native" diff --git a/meta-openeuler/recipes-core/selinux/libsemanage/libsemanage-Fix-execve-segfaults-on-Ubuntu.patch b/meta-openeuler/recipes-core/selinux/libsemanage/libsemanage-Fix-execve-segfaults-on-Ubuntu.patch new file mode 100644 index 0000000000000000000000000000000000000000..5a03d3034c370bfb21112ab11f1f6b81a3cd988a --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/libsemanage/libsemanage-Fix-execve-segfaults-on-Ubuntu.patch @@ -0,0 +1,34 @@ +From 2111f86dce8defd9bebd9b43008339e3b5af0aa7 Mon Sep 17 00:00:00 2001 +From: Xin Ouyang +Date: Mon, 26 Mar 2012 15:15:16 +0800 +Subject: [PATCH] libsemanage: Fix execve segfaults on Ubuntu. + +semanage_exec_prog() has pass NULL as param 2 to call execve(), +this may cause segfaults on Ubuntu. +Such as "make load" while building refpolicy. + +http://oss.tresys.com/pipermail/refpolicy/2011-December/004859.html + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Yi Zhao +--- + src/semanage_store.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/semanage_store.c b/src/semanage_store.c +index 14a0957..0a9200e 100644 +--- a/src/semanage_store.c ++++ b/src/semanage_store.c +@@ -1470,7 +1470,7 @@ static int semanage_exec_prog(semanage_handle_t * sh, + if (forkval == 0) { + /* child process. file descriptors will be closed + * because they were set as close-on-exec. */ +- execve(e->path, argv, NULL); ++ execv(e->path, argv); + _exit(EXIT_FAILURE); /* if execve() failed */ + } + +-- +2.25.1 + diff --git a/meta-openeuler/recipes-core/selinux/libsemanage/libsemanage-allow-to-disable-audit-support.patch b/meta-openeuler/recipes-core/selinux/libsemanage/libsemanage-allow-to-disable-audit-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..19263d8105517736b2844552d2f95911f222295c --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/libsemanage/libsemanage-allow-to-disable-audit-support.patch @@ -0,0 +1,126 @@ +From 5718384543ff06ad4032e90291f9e4398a2749c4 Mon Sep 17 00:00:00 2001 +From: Wenzong Fan +Date: Mon, 20 Jan 2014 03:53:48 -0500 +Subject: [PATCH] libsemanage: allow to disable audit support + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Wenzong Fan +--- + src/Makefile | 10 +++++++++- + src/seusers_local.c | 13 +++++++++++++ + tests/Makefile | 10 +++++++++- + 3 files changed, 31 insertions(+), 2 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index 71c2a1d..52f335e 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -26,6 +26,14 @@ ifeq ($(DEBUG),1) + export LDFLAGS ?= -g + endif + ++DISABLE_AUDIT ?= n ++ifeq ($(DISABLE_AUDIT),y) ++ LIBAUDIT = ++ CFLAGS += -DDISABLE_AUDIT ++else ++ LIBAUDIT = -laudit ++endif ++ + LEX = flex + LFLAGS = -s + YACC = bison +@@ -89,7 +97,7 @@ $(LIBA): $(OBJS) + $(RANLIB) $@ + + $(LIBSO): $(LOBJS) +- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol -laudit -lselinux -lbz2 -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -lsepol $(LIBAUDIT) -lselinux -lbz2 -Wl,-soname,$(LIBSO),--version-script=libsemanage.map,-z,defs + ln -sf $@ $(TARGET) + + $(LIBPC): $(LIBPC).in ../VERSION +diff --git a/src/seusers_local.c b/src/seusers_local.c +index 6508ec0..1b26956 100644 +--- a/src/seusers_local.c ++++ b/src/seusers_local.c +@@ -8,7 +8,11 @@ typedef struct semanage_seuser record_t; + + #include + #include ++ ++#ifndef DISABLE_AUDIT + #include ++#endif ++ + #include + #include "user_internal.h" + #include "seuser_internal.h" +@@ -55,6 +59,7 @@ static char *semanage_user_roles(semanage_handle_t * handle, const char *sename) + return roles; + } + ++#ifndef DISABLE_AUDIT + static int semanage_seuser_audit(semanage_handle_t * handle, + const semanage_seuser_t * seuser, + const semanage_seuser_t * previous, +@@ -119,6 +124,7 @@ err: + free(proles); + return rc; + } ++#endif + + int semanage_seuser_modify_local(semanage_handle_t * handle, + const semanage_seuser_key_t * key, +@@ -163,8 +169,11 @@ int semanage_seuser_modify_local(semanage_handle_t * handle, + (void) semanage_seuser_query(handle, key, &previous); + handle->msg_callback = callback; + rc = dbase_modify(handle, dconfig, key, new); ++ ++#ifndef DISABLE_AUDIT + if (semanage_seuser_audit(handle, new, previous, AUDIT_ROLE_ASSIGN, rc == 0) < 0) + rc = -1; ++#endif + err: + if (previous) + semanage_seuser_free(previous); +@@ -180,8 +189,12 @@ int semanage_seuser_del_local(semanage_handle_t * handle, + dbase_config_t *dconfig = semanage_seuser_dbase_local(handle); + rc = dbase_del(handle, dconfig, key); + semanage_seuser_query(handle, key, &seuser); ++ ++#ifndef DISABLE_AUDIT + if (semanage_seuser_audit(handle, NULL, seuser, AUDIT_ROLE_REMOVE, rc == 0) < 0) + rc = -1; ++#endif ++ + if (seuser) + semanage_seuser_free(seuser); + return rc; +diff --git a/tests/Makefile b/tests/Makefile +index 69f49a3..f914492 100644 +--- a/tests/Makefile ++++ b/tests/Makefile +@@ -4,10 +4,18 @@ CILS = $(sort $(wildcard *.cil)) + + ########################################################################### + ++DISABLE_AUDIT ?= n ++ifeq ($(DISABLE_AUDIT),y) ++ LIBAUDIT = ++ CFLAGS += -DDISABLE_AUDIT ++else ++ LIBAUDIT = -laudit ++endif ++ + EXECUTABLE = libsemanage-tests + CFLAGS += -g -O0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter + override CFLAGS += -I../src -I../include +-override LDLIBS += -lcunit -lbz2 -laudit -lselinux -lsepol ++override LDLIBS += -lcunit -lbz2 $(LIBAUDIT) -lselinux -lsepol + + OBJECTS = $(SOURCES:.c=.o) + POLICIES = $(CILS:.cil=.policy) +-- +2.25.1 + diff --git a/meta-openeuler/recipes-core/selinux/libsemanage/libsemanage-disable-expand-check-on-policy-load.patch b/meta-openeuler/recipes-core/selinux/libsemanage/libsemanage-disable-expand-check-on-policy-load.patch new file mode 100644 index 0000000000000000000000000000000000000000..6e0faeb351ac4bc655c1607f4381b07dfdead930 --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/libsemanage/libsemanage-disable-expand-check-on-policy-load.patch @@ -0,0 +1,33 @@ +From dd52bfb66d710473aeb75c5fe92d5cf0a66b637e Mon Sep 17 00:00:00 2001 +From: Joe MacDonald +Date: Wed, 7 May 2014 11:36:27 -0400 +Subject: [PATCH] libsemanage: disable expand-check on policy load + +For small policy modules it's not necessary to walk the hierarchy on load. +On embedded devices that are low-powered or resource-constrained disabling +the hierarchy processing can make the difference between seconds and +(many) minutes of load time (or being able to load the policy at all). + +Upstream-Status: Denied [upstream developers want to preserve the default + checking: http://marc.info/?l=selinux&m=121794804217721&w=2] + +Signed-off-by: Joe MacDonald +--- + src/semanage.conf | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/semanage.conf b/src/semanage.conf +index 98d769b..708fa8c 100644 +--- a/src/semanage.conf ++++ b/src/semanage.conf +@@ -40,3 +40,7 @@ module-store = direct + # By default, semanage will generate policies for the SELinux target. + # To build policies for Xen, uncomment the following line. + #target-platform = xen ++ ++# Don't check the entire policy hierarchy when inserting / expanding a policy ++# module. This results in a significant speed-up in policy loading. ++expand-check=0 +-- +2.25.1 + diff --git a/meta-openeuler/recipes-core/selinux/libsemanage_%.bbappend b/meta-openeuler/recipes-core/selinux/libsemanage_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d77825bad5663fe834396e7c4d681b8545d766a9 --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/libsemanage_%.bbappend @@ -0,0 +1,11 @@ +PV = "3.4" + +OPENEULER_SRC_URI_REMOVE = "https git http" +SRC_URI_prepend = "file://${BP}.tar.gz \ + file://fix-test-failure-with-secilc.patch \ + " + +SRC_URI[md5sum] = "a8b487ce862884bcf7dd8be603d4a6d4" +SRC_URI[sha256sum] = "93b423a21600b8e3fb59bb925d4583d1258f45bebf63c29bde304dfd3d52efd6" + +S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/recipes-core/selinux/libsemanage_3.3.bb b/meta-openeuler/recipes-core/selinux/libsemanage_3.3.bb deleted file mode 100644 index 6d3fd53b5e3beb39607bb253c5a15602bc76966b..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/selinux/libsemanage_3.3.bb +++ /dev/null @@ -1,8 +0,0 @@ -require selinux_common.inc -require ${BPN}.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" - -SRC_URI = "file://libsemanage/libsemanage-${PV}.tar.gz \ - file://libsemanage/fix-test-failure-with-secilc.patch \ -" diff --git a/meta-openeuler/recipes-core/selinux/libsemanage_3.4.bb b/meta-openeuler/recipes-core/selinux/libsemanage_3.4.bb new file mode 100644 index 0000000000000000000000000000000000000000..7f038acd18e121af4bb080791a6352e9806de155 --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/libsemanage_3.4.bb @@ -0,0 +1,55 @@ +SUMMARY = "SELinux binary policy manipulation library" +DESCRIPTION = "libsemanage provides an API for the manipulation of SELinux binary policies. \ +It is used by checkpolicy (the policy compiler) and similar tools, as well \ +as by programs like load_policy that need to perform specific transformations \ +on binary policies such as customizing policy boolean settings." +SECTION = "base" +LICENSE = "LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" + +require selinux_common.inc + +inherit lib_package python3native + +SRC_URI += "file://libsemanage-Fix-execve-segfaults-on-Ubuntu.patch \ + file://libsemanage-allow-to-disable-audit-support.patch \ + file://libsemanage-disable-expand-check-on-policy-load.patch \ + " + +DEPENDS = "libsepol libselinux python3 bison-native swig-native" + +DEPENDS:append:class-target = " audit" + +S = "${WORKDIR}/git/libsemanage" + +EXTRA_OEMAKE:class-native = "DISABLE_AUDIT=y" + +PACKAGES =+ "${PN}-python" + +# For /usr/libexec/selinux/semanage_migrate_store +RDEPENDS:${PN}-python = "python3-core" + +FILES:${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \ + ${libexecdir}/selinux/semanage_migrate_store" +FILES:${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug/*" +FILES:${PN} += "${libexecdir}" + +do_compile:append() { + oe_runmake pywrap \ + PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ + PYINC='-I${STAGING_INCDIR}/${PYLIBVER}' \ + PYLIBS='-L${STAGING_LIBDIR}/${PYLIBVER} -l${PYLIBVER}' +} + +do_install:append() { + oe_runmake install-pywrap \ + PYCEXT='.so' \ + PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ + PYTHONLIBDIR='${D}${libdir}/python${PYTHON_BASEVERSION}/site-packages' + + # Update "policy-version" for semanage.conf + sed -i 's/^#\s*\(policy-version\s*=\).*$/\1 33/' \ + ${D}/etc/selinux/semanage.conf +} + +BBCLASSEXTEND = "native" diff --git a/meta-openeuler/recipes-core/selinux/libsepol/0001-libsepol-fix-validation-of-user-declarations-in-modu.patch b/meta-openeuler/recipes-core/selinux/libsepol/0001-libsepol-fix-validation-of-user-declarations-in-modu.patch new file mode 100644 index 0000000000000000000000000000000000000000..47c18065e665a04e42d6f72af377330a464ce0cc --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/libsepol/0001-libsepol-fix-validation-of-user-declarations-in-modu.patch @@ -0,0 +1,80 @@ +From 4831f73dd356fd72916f594dbeae44d26c93bb6b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= +Date: Tue, 7 Jun 2022 17:01:45 +0200 +Subject: [PATCH] libsepol: fix validation of user declarations in modules +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Users are allowed to be declared in modules. Modules do not get expanded +leaving the `struct user_datum` members `exp_range` and `exp_dfltlevel` +empty. +Do no validate the expanded range and level for modular polices. + +Reported-by: bauen1 +Signed-off-by: Christian Göttsche +Acked-by: James Carter + +Upstream-Status: Backport +[https://github.com/SELinuxProject/selinux/commit/88a703399f3f44be2502fd4ecd22ac3d3c560694] + +Signed-off-by: Yi Zhao +--- + src/policydb_validate.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/policydb_validate.c b/src/policydb_validate.c +index da18282..99d4eb7 100644 +--- a/src/policydb_validate.c ++++ b/src/policydb_validate.c +@@ -18,7 +18,7 @@ typedef struct validate { + typedef struct map_arg { + validate_t *flavors; + sepol_handle_t *handle; +- int mls; ++ policydb_t *policy; + } map_arg_t; + + static int create_gap_ebitmap(char **val_to_name, uint32_t nprim, ebitmap_t *gaps) +@@ -571,7 +571,7 @@ static int validate_mls_range(mls_range_t *range, validate_t *sens, validate_t * + return -1; + } + +-static int validate_user_datum(sepol_handle_t *handle, user_datum_t *user, validate_t flavors[], int mls) ++static int validate_user_datum(sepol_handle_t *handle, user_datum_t *user, validate_t flavors[], policydb_t *p) + { + if (validate_value(user->s.value, &flavors[SYM_USERS])) + goto bad; +@@ -581,9 +581,9 @@ static int validate_user_datum(sepol_handle_t *handle, user_datum_t *user, valid + goto bad; + if (validate_mls_semantic_level(&user->dfltlevel, &flavors[SYM_LEVELS], &flavors[SYM_CATS])) + goto bad; +- if (mls && validate_mls_range(&user->exp_range, &flavors[SYM_LEVELS], &flavors[SYM_CATS])) ++ if (p->mls && p->policy_type != POLICY_MOD && validate_mls_range(&user->exp_range, &flavors[SYM_LEVELS], &flavors[SYM_CATS])) + goto bad; +- if (mls && validate_mls_level(&user->exp_dfltlevel, &flavors[SYM_LEVELS], &flavors[SYM_CATS])) ++ if (p->mls && p->policy_type != POLICY_MOD && validate_mls_level(&user->exp_dfltlevel, &flavors[SYM_LEVELS], &flavors[SYM_CATS])) + goto bad; + if (user->bounds && validate_value(user->bounds, &flavors[SYM_USERS])) + goto bad; +@@ -599,7 +599,7 @@ static int validate_user_datum_wrapper(__attribute__((unused)) hashtab_key_t k, + { + map_arg_t *margs = args; + +- return validate_user_datum(margs->handle, d, margs->flavors, margs->mls); ++ return validate_user_datum(margs->handle, d, margs->flavors, margs->policy); + } + + static int validate_bool_datum(sepol_handle_t *handle, cond_bool_datum_t *boolean, validate_t flavors[]) +@@ -689,7 +689,7 @@ static int validate_datum(__attribute__ ((unused))hashtab_key_t k, hashtab_datum + + static int validate_datum_array_entries(sepol_handle_t *handle, policydb_t *p, validate_t flavors[]) + { +- map_arg_t margs = { flavors, handle, p->mls }; ++ map_arg_t margs = { flavors, handle, p }; + + if (hashtab_map(p->p_commons.table, validate_common_datum_wrapper, &margs)) + goto bad; +-- +2.25.1 + diff --git a/meta-openeuler/recipes-core/selinux/libsepol_%.bbappend b/meta-openeuler/recipes-core/selinux/libsepol_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..35c7ce0fc02c765a974306ea7f963af1f31dbd60 --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/libsepol_%.bbappend @@ -0,0 +1,10 @@ +PV = "3.4" + +OPENEULER_SRC_URI_REMOVE = "https git http" +SRC_URI_prepend = "file://${BP}.tar.gz \ + " + +SRC_URI[md5sum] = "55fef291fa5fa5b43bd98e1bc1c3d088" +SRC_URI[sha256sum] = "fc277ac5b52d59d2cd81eec8b1cccd450301d8b54d9dd48a993aea0577cf0336" + +S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/recipes-core/selinux/libsepol_3.3.bb b/meta-openeuler/recipes-core/selinux/libsepol_3.3.bb deleted file mode 100644 index 21c06a53148848ffcc25859f7bd44e1ebf144b24..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/selinux/libsepol_3.3.bb +++ /dev/null @@ -1,6 +0,0 @@ -require selinux_common.inc -require ${BPN}.inc -LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" - -SRC_URI += "file://libsepol/${BP}.tar.gz" -CFLAGS += "${@bb.utils.contains('RTOS_KASAN', 'kasan', '-fcommon', '', d)}" diff --git a/meta-openeuler/recipes-core/selinux/libsepol.inc b/meta-openeuler/recipes-core/selinux/libsepol_3.4.bb similarity index 61% rename from meta-openeuler/recipes-core/selinux/libsepol.inc rename to meta-openeuler/recipes-core/selinux/libsepol_3.4.bb index 9601fae15b4c62c190eddaafb4e8fcb0c1aec79d..e75655793ebade26f99292940d57927914399624 100644 --- a/meta-openeuler/recipes-core/selinux/libsepol.inc +++ b/meta-openeuler/recipes-core/selinux/libsepol_3.4.bb @@ -4,13 +4,17 @@ It is used by checkpolicy (the policy compiler) and similar tools, as well \ as by programs like load_policy that need to perform specific transformations \ on binary policies such as customizing policy boolean settings." SECTION = "base" -LICENSE = "LGPLv2+" +LICENSE = "LGPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" + +require selinux_common.inc inherit lib_package -# Change RANLIB for cross compiling, use host-tools $(AR) rather than -# local ranlib. -EXTRA_OEMAKE += "RANLIB='$(AR) s'" +SRC_URI += "file://0001-libsepol-fix-validation-of-user-declarations-in-modu.patch" + +S = "${WORKDIR}/git/libsepol" + +DEPENDS = "flex-native" BBCLASSEXTEND = "native" -DEPENDS += "" diff --git a/meta-openeuler/recipes-core/selinux/policycoreutils.inc b/meta-openeuler/recipes-core/selinux/policycoreutils.inc deleted file mode 100644 index 29e91b5ea788fee4246577a96fa4a854f9cf8aa4..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/selinux/policycoreutils.inc +++ /dev/null @@ -1,168 +0,0 @@ -SUMMARY = "SELinux policy core utilities" -DESCRIPTION = "policycoreutils contains the policy core utilities that are required \ -for basic operation of a SELinux system. These utilities include \ -load_policy to load policies, setfiles to label filesystems, newrole \ -to switch roles, and run_init to run /etc/init.d scripts in the proper \ -context." -SECTION = "base" -LICENSE = "GPLv2+" - -DEPENDS += "libsepol libselinux libsemanage libcap gettext-native" -EXTRA_DEPENDS = "libcap-ng" -DEPENDS += "${@['', '${EXTRA_DEPENDS}']['${PN}' != '${BPN}-native']}" - -inherit selinux -DEPENDS += "${@target_selinux(d, 'audit')}" - -RDEPENDS_${BPN}-fixfiles += "\ - ${BPN}-setfiles \ -" -RDEPENDS_${BPN}-genhomedircon += "\ - ${BPN}-semodule \ -" -RDEPENDS_${BPN}-loadpolicy += "\ - libselinux \ - libsepol \ -" -RDEPENDS_${BPN}-newrole += "\ - libcap-ng \ - libselinux \ -" -RDEPENDS_${BPN}-runinit += "libselinux" -RDEPENDS_${BPN}-secon += "libselinux" -RDEPENDS_${BPN}-semodule += "\ - libsepol \ - libselinux \ - libsemanage \ -" -RDEPENDS_${BPN}-sestatus += "libselinux" -RDEPENDS_${BPN}-setfiles += "\ - libselinux \ - libsepol \ -" -RDEPENDS_${BPN}-setsebool += "\ - libsepol \ - libselinux \ - libsemanage \ -" - -PACKAGES =+ "\ - ${PN}-fixfiles \ - ${PN}-genhomedircon \ - ${PN}-hll \ - ${PN}-loadpolicy \ - ${PN}-newrole \ - ${PN}-runinit \ - ${PN}-secon \ - ${PN}-semodule \ - ${PN}-sestatus \ - ${PN}-setfiles \ -" -FILES_${PN}-fixfiles += "${base_sbindir}/fixfiles" -FILES_${PN}-genhomedircon += "${base_sbindir}/genhomedircon" -FILES_${PN}-loadpolicy += "\ - ${base_sbindir}/load_policy \ -" -FILES_${PN}-newrole += "\ - ${bindir}/newrole \ - ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d/newrole', '', d)} \ -" -FILES_${PN}-runinit += "\ - ${base_sbindir}/run_init \ - ${base_sbindir}/open_init_pty \ - ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d/run_init', '', d)} \ -" -FILES_${PN}-dbg += "${prefix}/libexec/selinux/hll/.debug" -FILES_${PN}-secon += "${bindir}/secon" -FILES_${PN}-semodule += "${base_sbindir}/semodule" -FILES_${PN}-hll += "${prefix}/libexec/selinux/hll/*" -FILES_${PN}-sestatus += "\ - ${base_sbindir}/sestatus \ - ${sysconfdir}/sestatus.conf \ -" -FILES_${PN}-setfiles += "\ - ${base_sbindir}/restorecon \ - ${base_sbindir}/restorecon_xattr \ - ${base_sbindir}/setfiles \ -" -FILES_${PN}-setsebool += "\ - ${base_sbindir}/setsebool \ - ${datadir}/bash-completion/completions/setsebool \ -" - -export STAGING_INCDIR -export STAGING_LIBDIR - -AUDITH="`ls ${STAGING_INCDIR}/libaudit.h >/dev/null 2>&1 && echo /usr/include/libaudit.h `" -EXTRA_OEMAKE += "${@target_selinux(d, 'AUDITH=${AUDITH}', 'AUDITH= ')} INOTIFYH=n" -EXTRA_OEMAKE += "PREFIX=${D}" -EXTRA_OEMAKE += "INITDIR=${D}/etc/init.d" - -BBCLASSEXTEND = "native" - -PCU_NATIVE_CMDS = "setfiles semodule hll" - -do_compile_virtclass-native() { - for PCU_CMD in ${PCU_NATIVE_CMDS} ; do - oe_runmake -C $PCU_CMD \ - INCLUDEDIR='${STAGING_INCDIR}' \ - LIBDIR='${STAGING_LIBDIR}' - done -} - -do_compile_class-native() { - for PCU_CMD in ${PCU_NATIVE_CMDS} ; do - oe_runmake -C $PCU_CMD \ - INCLUDEDIR='${STAGING_INCDIR}' \ - LIBDIR='${STAGING_LIBDIR}' - done -} - -do_compile_prepend() { - export PYTHON=${PYTHON} - export PYLIBVER='python${PYTHON_BASEVERSION}' - export PYTHON_CPPFLAGS="-I${STAGING_INCDIR_NATIVE}/${PYLIBVER}" - export PYTHON_LDFLAGS="${STAGING_INCDIR_NATIVE}/lib${PYLIBVER}.so" - export PYTHON_SITE_PKG="${libdir}/${PYLIBVER}/site-packages" -} - -do_install_prepend() { - export PYTHON=${PYTHON} - export SBINDIR="${base_sbindir}" - export SEMODULE_PATH="${base_sbindir}" SYSTEMDDIR=${systemd_unitdir} -} - -do_install_virtclass-native() { - for PCU_CMD in ${PCU_NATIVE_CMDS} ; do - oe_runmake -C $PCU_CMD install \ - DESTDIR="${D}" \ - PREFIX="${prefix}" \ - SBINDIR="${base_sbindir}" - done -} - -do_install_class-native() { - for PCU_CMD in ${PCU_NATIVE_CMDS} ; do - oe_runmake -C $PCU_CMD install \ - DESTDIR="${D}" \ - PREFIX="${prefix}" \ - SBINDIR="${base_sbindir}" - done -} - -do_install_append_class-target() { - if [ -e ${WORKDIR}/pam.d ]; then - install -d ${D}${sysconfdir}/pam.d/ - install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ - fi - - # /var/lib/selinux is involved by seobject.py: - # + dirname = "/var/lib/selinux" - # and it's required for running command: - # $ semanage permissive [OPTS] - install -d ${D}${localstatedir}/lib/selinux - rm -rf ${D}/lib/ - rm -r ${D}/usr/share/bash-completion - rm -rf ${D}/usr/lib64/ - rm -rf ${D}/usr/lib/ -} diff --git a/meta-openeuler/recipes-core/selinux/policycoreutils/pam.d/newrole b/meta-openeuler/recipes-core/selinux/policycoreutils/pam.d/newrole new file mode 100644 index 0000000000000000000000000000000000000000..cbf5d55541e596181f46d189a779fafdab8f3fa0 --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/policycoreutils/pam.d/newrole @@ -0,0 +1,6 @@ +#%PAM-1.0 +auth include common-auth +account include common-account +password include common-password +session include common-session +session optional pam_xauth.so diff --git a/meta-openeuler/recipes-core/selinux/policycoreutils/pam.d/run_init b/meta-openeuler/recipes-core/selinux/policycoreutils/pam.d/run_init new file mode 100644 index 0000000000000000000000000000000000000000..cbf5d55541e596181f46d189a779fafdab8f3fa0 --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/policycoreutils/pam.d/run_init @@ -0,0 +1,6 @@ +#%PAM-1.0 +auth include common-auth +account include common-account +password include common-password +session include common-session +session optional pam_xauth.so diff --git a/meta-openeuler/recipes-core/selinux/policycoreutils/policycoreutils-fixfiles-de-bashify.patch b/meta-openeuler/recipes-core/selinux/policycoreutils/policycoreutils-fixfiles-de-bashify.patch new file mode 100644 index 0000000000000000000000000000000000000000..0e80959f6d226ed8256d4c0666f28c9784a04ef3 --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/policycoreutils/policycoreutils-fixfiles-de-bashify.patch @@ -0,0 +1,89 @@ +From cdc8f6e887d9ab8944e3ae89dd18bf55edf080c4 Mon Sep 17 00:00:00 2001 +From: Joe MacDonald +Date: Fri, 20 Feb 2015 17:00:19 -0500 +Subject: [PATCH] fixfiles: de-bashify + +Most of the bashisms in fixfiles are pretty easy to work around, the only +complex one is the use of PIPESTATUS. The common solution to this is to +use fifos but considering the action this script is performing, that's not +necessarily the best option here. Introducing a second invocation of rpm +is minimal overhead on an operation that should happen very infrequently, +so we'll try that instead. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Joe MacDonald +Signed-off-by: Wenzong Fan +--- + scripts/fixfiles | 23 ++++++++++++++--------- + 1 file changed, 14 insertions(+), 9 deletions(-) + +diff --git a/scripts/fixfiles b/scripts/fixfiles +index c72ca0e..143cc2e 100755 +--- a/scripts/fixfiles ++++ b/scripts/fixfiles +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # fixfiles + # + # Script to restore labels on a SELinux box +@@ -27,7 +27,7 @@ set -o nounset + # number if the current kernel version is greater than 2.6.30, a negative + # number if the current is less than 2.6.30 and 0 if they are the same. + # +-function useseclabel { ++useseclabel () { + VER=`uname -r` + SUP=2.6.30 + expr '(' "$VER" : '\([^.]*\)' ')' '-' '(' "$SUP" : '\([^.]*\)' ')' '|' \ +@@ -93,9 +93,10 @@ exclude_dirs_from_relabelling() { + # skip not absolute path + # skip not directory + [ -z "${i}" ] && continue +- [[ "${i}" =~ ^[[:blank:]]*# ]] && continue +- [[ ! "${i}" =~ ^/.* ]] && continue +- [[ ! -d "${i}" ]] && continue ++ echo "${i}" | egrep -q '^[[:space:]]*#' && continue ++ echo "${i}" | egrep -v '^/.*' && continue ++ [ ! -d "${i}" ] && continue ++ + exclude_from_relabelling="$exclude_from_relabelling -e $i" + done < /etc/selinux/fixfiles_exclude_dirs + fi +@@ -140,7 +141,7 @@ fi + # Log directories excluded from relabelling by configuration file + # + LogExcluded() { +-for i in ${EXCLUDEDIRS//-e / }; do ++for i in `echo ${EXCLUDEDIRS} | sed -e 's/-e / /g'`; do + echo "skipping the directory $i" + done + } +@@ -203,8 +204,12 @@ fi + } + + rpmlist() { +-rpm -q --qf '[%{FILESTATES} %{FILENAMES}\n]' "$1" | grep '^0 ' | cut -f2- -d ' ' +-[ ${PIPESTATUS[0]} != 0 ] && echo "$1 not found" >/dev/stderr ++ if rpm -q --qf '[%{FILESTATES} %{FILENAMES}\n]' "$1" >/dev/null ++ then ++ rpm -q --qf '[%{FILESTATES} %{FILENAMES}\n]' "$1" | grep '^0 ' | cut -f2- -d ' ' ++ else ++ echo "$1 not found" >/dev/stderr ++ fi + } + + # +@@ -295,7 +300,7 @@ relabel() { + exit 1 + fi + +- if [ $fullFlag == 1 ]; then ++ if [ $fullFlag = 1 ]; then + fullrelabel + return + fi +-- +2.25.1 + diff --git a/meta-openeuler/recipes-core/selinux/policycoreutils_%.bbappend b/meta-openeuler/recipes-core/selinux/policycoreutils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..13016d418831cb51907452e44bc1c1668891648f --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/policycoreutils_%.bbappend @@ -0,0 +1,17 @@ +PV = "3.4" + +OPENEULER_SRC_URI_REMOVE = "https git http" +SRC_URI_prepend = "file://${BP}.tar.gz \ + file://fix-fixfiles-N-date-function.patch;patchdir=.. \ + file://fix-fixfiles-N-date-function-two.patch;patchdir=.. \ + file://backport-python-Split-semanage-import-into-two-transactions.patch;patchdir=.. \ + file://backport-python-audit2allow-close-file-stream-on-error.patch;patchdir=.. \ + file://backport-semodule-avoid-toctou-on-output-module.patch;patchdir=.. \ + " + +SRC_URI[md5sum] = "5af631db10479f2284ec92cacbf6c4c8" +SRC_URI[sha256sum] = "e49f26b7cb304777461142840ec6d6f00241fe565e162c0b24dfd7bcf31b369a" + +S = "${WORKDIR}/selinux-${BP}/${BPN}" + +RDEPENDS:${PN}:remove:class-target = "selinux-python" diff --git a/meta-openeuler/recipes-core/selinux/policycoreutils_3.3.bb b/meta-openeuler/recipes-core/selinux/policycoreutils_3.3.bb deleted file mode 100644 index d29390c52e28bbd7481ba04e835fded36f6280cc..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/selinux/policycoreutils_3.3.bb +++ /dev/null @@ -1,9 +0,0 @@ -require selinux_common.inc -require ${BPN}.inc - -LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" - -SRC_URI = "file://policycoreutils/${BP}.tar.gz \ - file://policycoreutils/fix-fixfiles-N-date-function.patch;patchdir=.. \ - file://policycoreutils/fix-fixfiles-N-date-function-two.patch;patchdir=.. \ -" diff --git a/meta-openeuler/recipes-core/selinux/policycoreutils_3.4.bb b/meta-openeuler/recipes-core/selinux/policycoreutils_3.4.bb new file mode 100644 index 0000000000000000000000000000000000000000..ab871a31e11c48c654339267d1371ae415da3722 --- /dev/null +++ b/meta-openeuler/recipes-core/selinux/policycoreutils_3.4.bb @@ -0,0 +1,179 @@ +SUMMARY = "SELinux policy core utilities" +DESCRIPTION = "policycoreutils contains the policy core utilities that are required \ +for basic operation of a SELinux system. These utilities include \ +load_policy to load policies, setfiles to label filesystems, newrole \ +to switch roles, and run_init to run /etc/init.d scripts in the proper \ +context." +SECTION = "base" +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=393a5ca445f6965873eca0259a17f833" + +require selinux_common.inc + +SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ + file://policycoreutils-fixfiles-de-bashify.patch \ + " + +PAM_SRC_URI = "file://pam.d/newrole \ + file://pam.d/run_init \ + " + +DEPENDS = "libsepol libselinux libsemanage gettext-native" +DEPENDS:append:class-target = " libcap-ng" + +S = "${WORKDIR}/git/policycoreutils" + +inherit selinux python3native + +RDEPENDS:${PN}-fixfiles = "\ + ${PN}-setfiles \ + grep \ + findutils \ +" +RDEPENDS:${PN}-genhomedircon = "\ + ${PN}-semodule \ +" +RDEPENDS:${PN}-loadpolicy = "\ + libselinux \ + libsepol \ +" +RDEPENDS:${PN}-newrole = "\ + libcap-ng \ + libselinux \ +" +RDEPENDS:${PN}-runinit = "libselinux" +RDEPENDS:${PN}-secon = "libselinux" +RDEPENDS:${PN}-semodule = "\ + libsepol \ + libselinux \ + libsemanage \ +" +RDEPENDS:${PN}-sestatus = "libselinux" +RDEPENDS:${PN}-setfiles = "\ + libselinux \ + libsepol \ +" +RDEPENDS:${PN}-setsebool = "\ + libsepol \ + libselinux \ + libsemanage \ +" +RDEPENDS:${PN}:class-target = "selinux-python" + +PACKAGES =+ "\ + ${PN}-fixfiles \ + ${PN}-genhomedircon \ + ${PN}-hll \ + ${PN}-loadpolicy \ + ${PN}-newrole \ + ${PN}-runinit \ + ${PN}-secon \ + ${PN}-semodule \ + ${PN}-sestatus \ + ${PN}-setfiles \ + ${PN}-setsebool \ +" +FILES:${PN}-fixfiles = "${base_sbindir}/fixfiles" +FILES:${PN}-genhomedircon = "${base_sbindir}/genhomedircon" +FILES:${PN}-loadpolicy = "\ + ${base_sbindir}/load_policy \ +" +FILES:${PN}-newrole = "\ + ${bindir}/newrole \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d/newrole', '', d)} \ +" +FILES:${PN}-runinit = "\ + ${base_sbindir}/run_init \ + ${base_sbindir}/open_init_pty \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d/run_init', '', d)} \ +" +FILES:${PN}-dbg += "${prefix}/libexec/selinux/hll/.debug" +FILES:${PN}-secon = "${bindir}/secon" +FILES:${PN}-semodule = "${base_sbindir}/semodule" +FILES:${PN}-hll = "${prefix}/libexec/selinux/hll/*" +FILES:${PN}-sestatus = "\ + ${base_sbindir}/sestatus \ + ${sysconfdir}/sestatus.conf \ +" +FILES:${PN}-setfiles = "\ + ${base_sbindir}/restorecon \ + ${base_sbindir}/restorecon_xattr \ + ${base_sbindir}/setfiles \ +" +FILES:${PN}-setsebool = "\ + ${base_sbindir}/setsebool \ + ${datadir}/bash-completion/completions/setsebool \ +" + +export STAGING_INCDIR +export STAGING_LIBDIR +export BUILD_SYS +export HOST_SYS + +PACKAGECONFIG:class-target ?= "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)} \ + audit \ +" +PACKAGECONFIG:class-native ?= "" + +PACKAGECONFIG[libpam] = ",,libpam," +PACKAGECONFIG[audit] = ",,audit," + +EXTRA_OEMAKE = "\ + ${@bb.utils.contains('PACKAGECONFIG', 'libpam', 'PAMH=y', 'PAMH=', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'audit', 'AUDITH=y', 'AUDITH=', d)} \ + INOTIFYH=n \ + PREFIX=${prefix} \ + SBINDIR=${base_sbindir} \ +" + +BBCLASSEXTEND = "native" + +PCU_NATIVE_CMDS = "setfiles semodule hll" + +do_compile:prepend() { + export PYTHON=python3 + export PYLIBVER='python${PYTHON_BASEVERSION}' + export PYTHON_CPPFLAGS="-I${STAGING_INCDIR}/${PYLIBVER}" + export PYTHON_LDFLAGS="${STAGING_LIBDIR}/lib${PYLIBVER}.so" + export PYTHON_SITE_PKG="${libdir}/${PYLIBVER}/site-packages" +} + +do_compile:class-native() { + for PCU_CMD in ${PCU_NATIVE_CMDS} ; do + oe_runmake -C $PCU_CMD \ + INCLUDEDIR='${STAGING_INCDIR}' \ + LIBDIR='${STAGING_LIBDIR}' + done +} + +sysroot_stage_dirs:append:class-native() { + cp -R $from/${prefix}/libexec $to/${prefix}/libexec +} + +do_install:prepend() { + export PYTHON=python3 + export SBINDIR="${D}/${base_sbindir}" +} + +do_install:class-native() { + for PCU_CMD in ${PCU_NATIVE_CMDS} ; do + oe_runmake -C $PCU_CMD install \ + DESTDIR="${D}" \ + PREFIX="${prefix}" \ + SBINDIR="${base_sbindir}" + done +} + +do_install:append:class-target() { + if [ -e ${WORKDIR}/pam.d ]; then + install -d ${D}${sysconfdir}/pam.d/ + install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ + fi + + # /var/lib/selinux is involved by seobject.py: + # + dirname = "/var/lib/selinux" + # and it's required for running command: + # $ semanage permissive [OPTS] + install -d ${D}${localstatedir}/lib/selinux +} diff --git a/meta-openeuler/recipes-core/selinux/selinux_common.inc b/meta-openeuler/recipes-core/selinux/selinux_common.inc index a94b9ab6b9287647ffc7a4a4ed7e4db16e5f38f6..86c748f5bbd54aec956480fcf4d3603c30454a5f 100644 --- a/meta-openeuler/recipes-core/selinux/selinux_common.inc +++ b/meta-openeuler/recipes-core/selinux/selinux_common.inc @@ -1,21 +1,12 @@ HOMEPAGE = "https://github.com/SELinuxProject" -# EXTRA_OEMAKE is typically: -e MAKEFLAGS= -# "MAKEFLAGS= " causes problems as ENV variables will not pass to subdirs, so -# we redefine EXTRA_OEMAKE here -EXTRA_OEMAKE = "-e" +SRC_URI = "git://github.com/SELinuxProject/selinux.git;branch=master;protocol=https" +SRCREV = "0a8c177dacdc1df96ea11bb8aa75e16c4fa82285" -# Releases are now from the base of the full tree, necessitating our skipping -# through an extra level of directories. -S = "${WORKDIR}/${BPN}-${PV}" - -SELINUX_NAME = "selinux" - -COMPONENT = "selinux" +UPSTREAM_CHECK_GITTAGREGEX = "(?P\d+(\.\d+)+)" do_compile() { - oe_runmake all \ - LIBDIR="${libdir}" + oe_runmake all } do_install() { @@ -24,7 +15,5 @@ do_install() { PREFIX="${prefix}" \ INCLUDEDIR="${includedir}" \ LIBDIR="${libdir}" \ - SHLIBDIR="${base_libdir}" \ - INITDIR="/etc/init.d" - rm -rf ${D}${libdir}/golang + SHLIBDIR="${base_libdir}" } diff --git a/meta-openeuler/recipes-core/shadow/shadow-securetty_4.8.1.bb b/meta-openeuler/recipes-core/shadow/shadow-securetty_4.8.1.bb deleted file mode 100644 index 2f06942e8bb1d1207d9c91a4575fa38215f6aa65..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/shadow/shadow-securetty_4.8.1.bb +++ /dev/null @@ -1,38 +0,0 @@ -SUMMARY = "Provider of the machine specific securetty file" -SECTION = "base utils" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -INHIBIT_DEFAULT_DEPS = "1" - -PR = "r1" - -SRC_URI = "file://securetty" - -S = "${WORKDIR}" - -# Since SERIAL_CONSOLES is likely to be set from the machine configuration -PACKAGE_ARCH = "${MACHINE_ARCH}" - -do_install () { - # Ensure we add a suitable securetty file to the package that has - # most common embedded TTYs defined. - install -d ${D}${sysconfdir} - install -m 0400 ${WORKDIR}/securetty ${D}${sysconfdir}/securetty - if [ ! -z "${SERIAL_CONSOLES}" ]; then - # Our SERIAL_CONSOLES contains a baud rate and sometimes extra - # options as well. The following pearl :) takes that and converts - # it into newline-separated tty's and appends them into - # securetty. So if a machine has a weird looking console device - # node (e.g. ttyAMA0) that securetty does not know, it will get - # appended to securetty and root logins will be allowed on that - # console. - tmp="${SERIAL_CONSOLES}" - for entry in $tmp ; do - ttydev=`echo "$entry" | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'` - if ! grep -q $ttydev ${D}${sysconfdir}/securetty; then - echo $ttydev >> ${D}${sysconfdir}/securetty - fi - done - fi -} diff --git a/meta-openeuler/recipes-core/shadow/shadow-sysroot_4.8.1.bb b/meta-openeuler/recipes-core/shadow/shadow-sysroot_4.8.1.bb deleted file mode 100644 index 03fba804f3f704675a9aae73b96173995fdd7a6a..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/shadow/shadow-sysroot_4.8.1.bb +++ /dev/null @@ -1,35 +0,0 @@ -SUMMARY = "Shadow utils requirements for useradd.bbclass" -HOMEPAGE = "http://pkg-shadow.alioth.debian.org" -BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580" -SECTION = "base utils" -LICENSE = "BSD | Artistic-1.0" -LIC_FILES_CHKSUM = "file://login.defs_shadow-sysroot;md5=25e2f2de4dfc8f966ac5cdfce45cd7d5" - -DEPENDS = "base-passwd" - -# Remove base-passwd for all image -DEPENDS_remove += "base-passwd" - -PR = "r1" - -# The sole purpose of this recipe is to provide the /etc/login.defs -# file for the target sysroot - needed so the shadow-native utilities -# can add custom users/groups for recipes that use inherit useradd. -SRC_URI = "file://login.defs_shadow-sysroot" - -SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79" -SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778" - -S = "${WORKDIR}" - -do_install() { - install -d ${D}${sysconfdir} - install -p -m 644 ${S}/login.defs_shadow-sysroot ${D}${sysconfdir}/login.defs -} - -SYSROOT_DIRS += "${sysconfdir}" - -# don't create any packages -# otherwise: dbus-dev depends on shadow-sysroot-dev which depends on shadow-sysroot -# and this has another copy of /etc/login.defs already provided by shadow -PACKAGES = "" diff --git a/meta-openeuler/recipes-core/shadow/shadow.inc b/meta-openeuler/recipes-core/shadow/shadow.inc deleted file mode 100644 index ae2c63b73862e99dcc7475bbd348ca547387ff01..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/shadow/shadow.inc +++ /dev/null @@ -1,211 +0,0 @@ -SUMMARY = "Tools to change and administer password and group data" -HOMEPAGE = "file://pkg-shadow.alioth.debian.org" -BUGTRACKER = "files://alioth.debian.org/tracker/?group_id=30580" -SECTION = "base/utils" -LICENSE = "BSD | Artistic-1.0" - -#DEPENDS = "virtual/crypt" - -UPSTREAM_CHECK_URI = "https://github.com/shadow-maint/shadow/releases" - -FILESEXTRAPATHS_prepend .= "${OPEN_SRC_DIR}/shadow-utils:" - -inherit autotools gettext - -export CONFIG_SHELL="/bin/sh" - -EXTRA_OECONF += "--without-audit \ - --without-libcrack \ - --without-selinux \ - --with-group-name-max-length=24 \ - --enable-subordinate-ids=yes \ - ${NSCDOPT}" - -do_configure_prepend() { - #pushd ${S} - #sh autogen.sh - #sed -i 's/faillog/faillog2/g' configure - #sed -i 's/faillog"/faillog2"/g' configure.ac - #popd -} - -NSCDOPT = "" -NSCDOPT_class-native = "--without-nscd" -NSCDOPT_class-nativesdk = "--without-nscd" -NSCDOPT_libc-glibc = "--with-nscd" - -PAM_PLUGINS = "libpam-runtime \ - pam-plugin-faildelay \ - pam-plugin-securetty \ - pam-plugin-nologin \ - pam-plugin-env \ - pam-plugin-group \ - pam-plugin-limits \ - pam-plugin-lastlog \ - pam-plugin-motd \ - pam-plugin-mail \ - pam-plugin-shells \ - pam-plugin-rootok" - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)}" -PACKAGECONFIG_class-native ??= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)}" -PACKAGECONFIG_class-nativesdk = "" -PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam,${PAM_PLUGINS}" -PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr" -PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl" - -RDEPENDS_${PN} = "shadow-securetty \ - base-passwd " - -# util-linux-sulogin" - -# Remove base-passwd for all image -RDEPENDS_${PN}_remove += "base-passwd" -RDEPENDS_${PN}_class-native = "" -RDEPENDS_${PN}_class-nativesdk = "" - -SRC_URI = "file://shadow/${BP}.tar.xz \ - file://shadow/shadow-4.8-goodname.patch \ - file://shadow/shadow-4.9-null-tm.patch \ - file://shadow/shadow-4.8-long-entry.patch \ - file://shadow/usermod-unlock.patch \ - file://shadow/useradd-create-directories-after-the-SELinux-user.patch \ - file://shadow/shadow-4.1.5.1-var-lock.patch \ - file://shadow/shadow-utils-fix-lock-file-residue.patch \ - file://shadow/Makefile-include-libeconf-dependency-in-new-idmap.patch \ - file://shadow/usermod-allow-all-group-types-with-G-option.patch \ - file://shadow/useradd-avoid-generating-an-empty-subid-range.patch \ - file://shadow/libmisc-fix-default-value-in-SHA_get_salt_rounds.patch \ - file://shadow/semanage-close-the-selabel-handle.patch \ - file://shadow/Revert-useradd.c-fix-memleaks-of-grp.patch \ - file://shadow/useradd-change-SELinux-labels-for-home-files.patch \ - file://shadow/libsubid-link-to-PAM-libraries.patch \ - file://shadow/Fix-out-of-tree-builds-with-respect-to-libsubid-incl.patch \ - file://shadow/Respect-enable-static-no-in-libsubid.patch \ - file://shadow/Fixes-the-linking-issues-when-libsubid-is-static-and.patch \ - file://shadow/pwck-fix-segfault-when-calling-fprintf.patch \ - file://shadow/newgrp-fix-segmentation-fault.patch \ - file://shadow/groupdel-fix-SIGSEGV-when-passwd-does-not-exist.patch \ - file://shadow/shadow-add-sm3-crypt-support.patch \ - file://shadow/backport-useradd-modify-check-ID-range-for-system-users.patch \ -" - -LIC_FILES_CHKSUM="file://COPYING;md5=ed80ff1c2b40843cf5768e5229cf16e5" - -#PAM_SRC_URI = "file://pam.d" -SRC_URI += "file://pam.d/chfn \ - file://login_defs_pam.sed \ - file://pam.d/chpasswd \ - file://pam.d/chsh \ - file://pam.d/login \ - file://pam.d/newusers \ - file://pam.d/passwd \ - file://pam.d/su \ - file://pam.d/groupmems \ - file://login.defs \ - " - -do_install() { - oe_runmake DESTDIR="${D}" sbindir="${base_sbindir}" usbindir="${sbindir}" install - - # Info dir listing isn't interesting at this point so remove it if it exists. - if [ -e "${D}${infodir}/dir" ]; then - rm -f ${D}${infodir}/dir - fi - - # Enable CREATE_HOME by default. - sed -i 's/#CREATE_HOME/CREATE_HOME/g' ${D}${sysconfdir}/login.defs - - # As we are on an embedded system, ensure the users mailbox is in - # ~/ not /var/spool/mail by default, as who knows where or how big - # /var is. The system MDA will set this later anyway. - sed -i 's/MAIL_DIR/#MAIL_DIR/g' ${D}${sysconfdir}/login.defs - sed -i 's/#MAIL_FILE/MAIL_FILE/g' ${D}${sysconfdir}/login.defs - - # Disable checking emails. - sed -i 's/MAIL_CHECK_ENAB/#MAIL_CHECK_ENAB/g' ${D}${sysconfdir}/login.defs - - # Comment out SU_NAME to work correctly with busybox - # See Bug#5359 and Bug#7173 - sed -i 's:^SU_NAME:#SU_NAME:g' ${D}${sysconfdir}/login.defs - - # Use proper encryption for passwords - sed -i 's/^#ENCRYPT_METHOD.*$/ENCRYPT_METHOD SHA512/' ${D}${sysconfdir}/login.defs - - # keep login.defs the same fileds & values as one in the previous init-script rpm - sed -i 's/^CHFN_RESTRICT/#CHFN_RESTRICT/g' ${D}${sysconfdir}/login.defs - sed -i 's/^CONSOLE/#CONSOLE/g' ${D}${sysconfdir}/login.defs - sed -i 's/^ERASECHAR/#ERASECHAR/g' ${D}${sysconfdir}/login.defs - sed -i 's/^FAIL_DELAY/#FAIL_DELAY/g' ${D}${sysconfdir}/login.defs - sed -i 's/^HUSHLOGIN_FILE/#HUSHLOGIN_FILE/g' ${D}${sysconfdir}/login.defs - sed -i 's/^KILLCHAR/#KILLCHAR/g' ${D}${sysconfdir}/login.defs - sed -i 's/^LOGIN_RETRIES/#LOGIN_RETRIES/g' ${D}${sysconfdir}/login.defs - sed -i 's/^MAIL_FILE/#MAIL_FILE/g' ${D}${sysconfdir}/login.defs - sed -i 's/^SYSLOG_SG_ENAB/#SYSLOG_SG_ENAB/g' ${D}${sysconfdir}/login.defs - sed -i 's/^SYSLOG_SU_ENAB/#SYSLOG_SU_ENAB/g' ${D}${sysconfdir}/login.defs - sed -i 's/^SYS_GID_MAX/#SYS_GID_MAX/g' ${D}${sysconfdir}/login.defs - sed -i 's/^SYS_UID_MAX/#SYS_UID_MAX/g' ${D}${sysconfdir}/login.defs - sed -i 's/^TTYGROUP/#TTYGROUP/g' ${D}${sysconfdir}/login.defs - sed -i 's/^UMASK/#UMASK/g' ${D}${sysconfdir}/login.defs - sed -i 's#^ENV_PATH.*$#ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin#' ${D}${sysconfdir}/login.defs - sed -i 's#^ENV_SUPATH.*$#ENV_SUPATH PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin#' ${D}${sysconfdir}/login.defs - sed -i 's#^GID_MIN.*$#GID_MIN 500#' ${D}${sysconfdir}/login.defs - sed -i 's#^UID_MIN.*$#UID_MIN 500#' ${D}${sysconfdir}/login.defs - sed -i 's/^#MAIL_DIR/MAIL_DIR/g' ${D}${sysconfdir}/login.defs - - # Now we don't have a mail system. Disable mail creation for now. - #sed -i 's:/bin/bash:/bin/sh:g' ${D}${sysconfdir}/default/useradd - #sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd - - # Use users group by default - #sed -i 's,^GROUP=1000,GROUP=100,g' ${D}${sysconfdir}/default/useradd -} - -do_install_append() { - # Ensure that the image has as a /var/spool/mail dir so shadow can - # put mailboxes there if the user reconfigures shadow to its - # defaults (see sed below). - install -m 0775 -d ${D}${localstatedir}/spool/mail - chown root:mail ${D}${localstatedir}/spool/mail - - if [ -e ${WORKDIR}/pam.d ]; then - install -d ${D}${sysconfdir}/pam.d/ - install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ - # Remove defaults that are not used when supporting PAM. - sed -i -f ${WORKDIR}/login_defs_pam.sed ${D}${sysconfdir}/login.defs - fi - - install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir} - cp ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ - - # Move binaries to the locations we want - rm ${D}${sbindir}/vigr - # ln -sf vipw.${BPN} ${D}${base_sbindir}/vigr - if [ "${sbindir}" != "${base_sbindir}" ]; then - mv ${D}${sbindir}/vipw ${D}${base_sbindir}/vipw - rm -f ${D}${base_sbindir}/nologin - fi - if [ "${bindir}" != "${base_bindir}" ]; then - mv ${D}${bindir}/login ${D}${base_bindir}/login - rm -f ${D}${bindir}/su - fi - - # Handle link properly after rename, otherwise missing files would - # lead rpm failed dependencies. - ln -sf newgrp.${BPN} ${D}${bindir}/sg - cp ${WORKDIR}/login.defs ${D}${sysconfdir}/ -} - -PACKAGES =+ "${PN}-base" -FILES_${PN}-base = "\ - ${bindir}/sg \ - ${bindir}/newgrp.shadow \ - ${bindir}/groups.shadow \ - ${sysconfdir}/pam.d/login \ - ${sysconfdir}/pam.d/su \ - ${sysconfdir}/login.defs \ -" -RDEPENDS_${PN} += "${PN}-base" - -PACKAGE_WRITE_DEPS += "shadow-native" diff --git a/meta-openeuler/recipes-core/shadow/shadow_4.9.bb b/meta-openeuler/recipes-core/shadow/shadow_4.9.bb deleted file mode 100644 index d5d644ad814c08ce11c1cb5ef79a0ce43705956c..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/shadow/shadow_4.9.bb +++ /dev/null @@ -1,7 +0,0 @@ -require shadow.inc - -# Build falsely assumes that if --enable-libpam is set, we don't need to link against -# libcrypt. This breaks chsh. -#BUILD_LDFLAGS_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '-lcrypt', '', d)}" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/sysfsutils/sysfsutils_%.bbappend b/meta-openeuler/recipes-core/sysfsutils/sysfsutils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..94998694a4bc23bd9f85200df80e877749753ab2 --- /dev/null +++ b/meta-openeuler/recipes-core/sysfsutils/sysfsutils_%.bbappend @@ -0,0 +1,23 @@ +# version in openEuler +PV = "2.1.1" + +# remove patches that can't apply in poky +SRC_URI_remove = "${SOURCEFORGE_MIRROR}/linux-diag/sysfsutils-${PV}.tar.gz \ + file://sysfsutils-2.0.0-class-dup.patch \ + file://obsolete_automake_macros.patch \ + file://separatebuild.patch \ +" + +SRC_URI_prepend += "file://sysfsutils/v${PV}.tar.gz \ +" + +SRC_URI += "file://0001-lib-Fixed-a-memory-leak-in-lib-sysfs_driver.patch \ +" + +# checksum changed in this version +LIC_FILES_CHKSUM = "file://COPYING;md5=dcc19fa9307a50017fca61423a7d9754 \ + file://cmd/GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://lib/LGPL;md5=4fbd65380cdd255951079008b364516c" + +SRC_URI[md5sum] = "537c110be7244905997262854505c30f" +SRC_URI[sha256sum] = "f7f669d27c997d3eb3f3e014b4c0aa1aa4d07ce4d6f9e41fa835240f2bf38810" diff --git a/meta-openeuler/recipes-core/sysfsutils/sysfsutils_2.1.1.bb b/meta-openeuler/recipes-core/sysfsutils/sysfsutils_2.1.1.bb deleted file mode 100644 index 6716b6904638dae8b1c9d9a90535dfd118d453d5..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/sysfsutils/sysfsutils_2.1.1.bb +++ /dev/null @@ -1,36 +0,0 @@ -### Descriptive metadata: SUMMARY,DESCRITPION, HOMEPAGE, AUTHOR, BUGTRACKER -SUMMARY = "Tools for working with sysfs" -DESCRIPTION = "Tools for working with the sysfs virtual filesystem. The tool 'systool' \ - can query devices by bus, class and topology." -AUTHOR = "" -HOMEPAGE = "http://linux-diag.sourceforge.net/Sysfsutils.html" -BUGTRACKER = "https://gitee.com/openeuler/yocto-meta-openeuler" - -### Package manager metadata: SECTION, PRIOIRTY(only for deb, opkg) -SECTION = "libs" - -### License metadata -LICENSE = "GPLv2 & LGPLv2.1" -LICENSE_${PN} = "GPLv2" -LICENSE_libsysfs = "LGPLv2.1" -LIC_FILES_CHKSUM = "file://COPYING;md5=dcc19fa9307a50017fca61423a7d9754 \ - file://cmd/GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://lib/LGPL;md5=4fbd65380cdd255951079008b364516c" - -### Inheritance and includes if needed -inherit autotools - -### Build metadata: SRC_URI, SRCDATA, S, B, FILESEXTRAPATHS.... -SRC_URI = "file://sysfsutils/v${PV}.tar.gz " - -S = "${WORKDIR}/${BPN}-${PV}" - -### Runtime metadata - -### Package metadata -PACKAGES =+ "libsysfs" -FILES_libsysfs = "${libdir}/lib*${SOLIBS}" - -export libdir = "${base_libdir}" - -### Tasks for package diff --git a/meta-openeuler/recipes-core/systemd/files/fix-glibc-2.36-redefinition-error.patch b/meta-openeuler/recipes-core/systemd/files/fix-glibc-2.36-redefinition-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..9d04f047ffcfd088ee3148128c25e4c5dc5bab4a --- /dev/null +++ b/meta-openeuler/recipes-core/systemd/files/fix-glibc-2.36-redefinition-error.patch @@ -0,0 +1,63 @@ +diff -uprN a/meson.build b/meson.build +--- a/meson.build 2023-03-17 02:12:01.119365345 +0000 ++++ b/meson.build 2023-03-17 02:10:34.756309801 +0000 +@@ -448,7 +448,6 @@ decl_headers = ''' + #include + #include + #include +-#include + ''' + + foreach decl : ['char16_t', +@@ -460,6 +459,17 @@ foreach decl : ['char16_t', + # We get -1 if the size cannot be determined + have = cc.sizeof(decl, prefix : decl_headers, args : '-D_GNU_SOURCE') > 0 + ++ if decl == 'struct mount_attr' ++ if have ++ want_linux_fs_h = false ++ else ++ have = cc.sizeof(decl, ++ prefix : decl_headers + '#include ', ++ args : '-D_GNU_SOURCE') > 0 ++ want_linux_fs_h = have ++ endif ++ endif ++ + if decl == 'struct statx' + if have + want_linux_stat_h = false +@@ -475,6 +485,7 @@ foreach decl : ['char16_t', + endforeach + + conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h) ++conf.set10('WANT_LINUX_FS_H', want_linux_fs_h) + + foreach ident : ['secure_getenv', '__secure_getenv'] + conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident)) +diff -uprN a/src/core/namespace.c b/src/core/namespace.c +--- a/src/core/namespace.c 2023-03-17 02:11:54.819431730 +0000 ++++ b/src/core/namespace.c 2023-03-17 02:10:34.772309619 +0000 +@@ -6,7 +6,9 @@ + #include + #include + #include ++#if WANT_LINUX_FS_H + #include ++#endif + + #include "alloc-util.h" + #include "base-filesystem.h" +diff -uprN a/src/shared/mount-util.c b/src/shared/mount-util.c +--- a/src/shared/mount-util.c 2023-03-17 02:11:59.291384569 +0000 ++++ b/src/shared/mount-util.c 2023-03-17 02:10:34.808309208 +0000 +@@ -7,7 +7,9 @@ + #include + #include + #include ++#if WANT_LINUX_FS_H + #include ++#endif + + #include "alloc-util.h" + #include "dissect-image.h" diff --git a/meta-openeuler/recipes-core/systemd/files/systemd-depmod.service b/meta-openeuler/recipes-core/systemd/files/systemd-depmod.service new file mode 100644 index 0000000000000000000000000000000000000000..8addd0692bbac4eeedd428997818eb650e2214be --- /dev/null +++ b/meta-openeuler/recipes-core/systemd/files/systemd-depmod.service @@ -0,0 +1,22 @@ +[Unit] +Description=Do depmod Before Load Kernel Modules +DefaultDependencies=no +Conflicts=shutdown.target +Before=systemd-modules-load.service sysinit.target shutdown.target +ConditionCapability=CAP_SYS_MODULE +ConditionDirectoryNotEmpty=|/lib/modules-load.d +ConditionDirectoryNotEmpty=|/usr/lib/modules-load.d +ConditionDirectoryNotEmpty=|/usr/local/lib/modules-load.d +ConditionDirectoryNotEmpty=|/etc/modules-load.d +ConditionDirectoryNotEmpty=|/run/modules-load.d +ConditionKernelCommandLine=|modules-load +ConditionKernelCommandLine=|rd.modules-load +ConditionFileIsExecutable=/sbin/depmod +ConditionFileNotEmpty=!/lib/modules/%v/modules.dep + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/sbin/depmod -a +TimeoutSec=90s + diff --git a/meta-openeuler/recipes-core/systemd/systemd-boot_%.bbappend b/meta-openeuler/recipes-core/systemd/systemd-boot_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..98d4bc62f8001acb797b31c057a525ced7a65b57 --- /dev/null +++ b/meta-openeuler/recipes-core/systemd/systemd-boot_%.bbappend @@ -0,0 +1,24 @@ +#main bbfile: yocto-poky/meta/recipes-core/systemd/systemd-boot_247.6.bb + +#version in openEuler +PV = "249" +S = "${WORKDIR}/systemd-${PV}" + +OPENEULER_REPO_NAME = "systemd" +require systemd-openeuler.inc + +# sync from poky honister +# see: https://git.yoctoproject.org/poky/tree/meta/recipes-core/systemd/systemd-boot_249.7.bb?h=honister +EFI_LD = "${HOST_PREFIX}ld.bfd" +EXTRA_OEMESON_remove += "-Defi-ld=${@ d.getVar('LD').split()[0]} " +EXTRA_OEMESON += "-Defi-ld=${EFI_LD} " + +SRC_URI[tarball.md5sum] = "8e8adf909c255914dfc10709bd372e69" +SRC_URI[tarball.sha256sum] = "174091ce5f2c02123f76d546622b14078097af105870086d18d55c1c2667d855" + +# glib needs meson, meson needs python3-native +# here use nativesdk's meson-native and python3-native +DEPENDS_remove += "python3-native" + +#delete depends to util-linux-native +PACKAGECONFIG_remove_class-target += "libmount" diff --git a/meta-openeuler/recipes-core/systemd/systemd-openeuler.inc b/meta-openeuler/recipes-core/systemd/systemd-openeuler.inc new file mode 100644 index 0000000000000000000000000000000000000000..f8283ba336f57b1a617fe40e23a09ed20f3982b9 --- /dev/null +++ b/meta-openeuler/recipes-core/systemd/systemd-openeuler.inc @@ -0,0 +1,477 @@ +LIC_FILES_CHKSUM = "file://${WORKDIR}/systemd-${PV}/LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \ + file://${WORKDIR}/systemd-${PV}/LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ + git://github.com/systemd/systemd-stable.git;protocol=https;branch=${SRCBRANCH} \ + file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ + file://0003-implment-systemd-sysv-install-for-OE.patch \ + file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \ + file://0001-logind-Restore-chvt-as-non-root-user-without-polkit.patch \ + file://0027-proc-dont-trigger-mount-error-with-invalid-options-o.patch \ + file://0001-analyze-resolve-executable-path-if-it-is-relative.patch \ + file://0001-sd-dhcp-client-check-error-earlier-and-reduce-indent.patch \ + file://0002-sd-dhcp-client-shorten-code-a-bit.patch \ + file://0003-sd-dhcp-client-logs-when-dhcp-client-unexpectedly-ga.patch \ + file://0004-sd-dhcp-client-tentatively-ignore-FORCERENEW-command.patch \ + file://0001-basic-unit-name-do-not-use-strdupa-on-a-path.patch \ + " + +# files, patches that come from openeuler +# git binary error: backport-sd-dhcp-server-refuse-too-large-packet-to-send.patch +# backport-sd-bus-fix-buffer-overflow.patch +SRC_URI =+ " \ + file://systemd-${PV}.tar.gz \ + file://backport-hostnamed-correct-variable-with-errno-in-fallback_ch.patch \ + file://backport-docs-improve-wording-when-mentioning-the-acronym-ESP.patch \ + file://backport-systemctl-show-error-when-help-for-unknown-unit-is-r.patch \ + file://backport-shared-format-table-allocate-buffer-of-sufficient-si.patch \ + file://backport-fix-CVE-2021-33910.patch \ + file://backport-sd-bus-fix-missing-initializer-in-SD_BUS_VTABLE_END-.patch \ + file://backport-pid1-propagate-the-original-command-line-when-reexec.patch \ + file://backport-coredump-stacktrace.c-avoid-crash-on-binaries-withou.patch \ + file://backport-machined-varlink-fix-double-free.patch \ + file://backport-malloc-uses-getrandom-now.patch \ + file://backport-discover-image-mount-as-read-only-when-extracting-me.patch \ + file://backport-networkd-Include-linux-netdevice.h-header.patch \ + file://backport-seccomp-drop-getrandom-from-system-service.patch \ + file://backport-seccomp-move-sched_getaffinity-from-system-service-t.patch \ + file://backport-systemctl-allow-set-property-to-be-called-with-a-glo.patch \ + file://backport-Use-correct-fcntl.h-include.patch \ + file://backport-Use-correct-poll.h-include.patch \ + file://backport-veritysetup-print-help-for-help-h-help.patch \ + file://backport-network-use-address_equal-route_equal-to-compare-add.patch \ + file://backport-mkosi-openSUSE-update-bootable-no-dependencies.patch \ + file://backport-mkosi-Fix-openSUSE-Jinja2-package-name.patch \ + file://backport-sd-netlink-always-append-new-bridge-FDB-entries.patch \ + file://backport-core-cgroup-fix-error-handling-of-cg_remove_xattr.patch \ + file://backport-core-wrap-cgroup-path-with-empty_to_root-in-log-mess.patch \ + file://backport-network-add-comments.patch \ + file://backport-network-ignore-errors-on-setting-bridge-config.patch \ + file://backport-network-ignore-errors-on-unsetting-master-ifindex.patch \ + file://backport-network-also-check-addresses-when-determine-a-gatewa.patch \ + file://backport-network-check-the-received-interface-name-is-actuall.patch \ + file://backport-network-configure-address-with-requested-lifetime.patch \ + file://backport-network-use-monotonic-instead-of-boot-time-to-handle.patch \ + file://backport-udev-when-setting-up-lo-do-not-return-an-error.patch \ + file://backport-network-fix-configuring-of-CAN-devices.patch \ + file://backport-network-fix-logic-for-checking-gateway-address-is-re.patch \ + file://backport-Fix-the-Failed-to-open-random-seed-.-message.patch \ + file://backport-resolved-Don-t-omit-AD-bit-in-reply-if-DO-is-set-in-.patch \ + file://backport-sd-dhcp6-client-fix-copy-and-paste-mistake.patch \ + file://backport-sd-dhcp6-client-cirtainly-adjust-T1-and-T2.patch \ + file://backport-Get-rid-of-dangling-setutxent.patch \ + file://backport-sd-dhcp-server-fix-possible-double-free-or-use-after.patch \ + file://backport-hostname-fix-off-by-one-issue-in-gethostname.patch \ + file://backport-systemd-analyze-parse-ip_filters_custom_egress-corre.patch \ + file://backport-cgroup-do-catchup-for-unit-cgroup-inotify-watch-file.patch \ + file://backport-core-Make-sure-cgroup_oom_queue-is-flushed-on-manage.patch \ + file://backport-sd-boot-Fix-possible-null-pointer-dereference.patch \ + file://backport-resolved-retry-on-SERVFAIL-before-downgrading-featur.patch \ + file://backport-Don-t-open-var-journals-in-volatile-mode-when-runtim.patch \ + file://backport-network-allow-users-to-forbid-passthru-MACVLAN-from-.patch \ + file://backport-unit-coldplug-both-job-and-nop_job-if-possible.patch \ + file://backport-network-do-not-assume-the-highest-priority-when-Prio.patch \ + file://backport-fstab-generator-Respect-nofail-when-ordering.patch \ + file://backport-discover-image-pass-the-right-fd-to-fd_getcrtime.patch \ + file://backport-src-boot-efi-linux-fix-linux_exec-prototype.patch \ + file://backport-timesync-fix-wrong-type-for-receiving-timestamp-in-n.patch \ + file://backport-import-turn-off-weird-protocols-in-curl.patch \ + file://backport-network-fix-wrong-flag-manage_foreign_routes-manage_.patch \ + file://backport-icmp6-drop-unnecessary-assertion.patch \ + file://backport-socket-util-introduce-CMSG_SPACE_TIMEVAL-TIMESPEC-ma.patch \ + file://backport-timesync-check-cmsg-length.patch \ + file://backport-journal-network-timesync-fix-segfault-on-32bit-timev.patch \ + file://backport-tpm-util-fix-TPM-parameter-handling.patch \ + file://backport-basic-linux-Sync-if_arp.h-with-Linux-5.14.patch \ + file://backport-Drop-bundled-copy-of-linux-if_arp.h.patch \ + file://backport-explicitly-close-FIDO2-devices.patch \ + file://backport-core-respect-install_sysconfdir_samples-in-meson-fil.patch \ + file://backport-login-respect-install_sysconfdir_samples-in-meson-fi.patch \ + file://backport-core-Remove-circular-include.patch \ + file://backport-path-util-make-find_executable-work-without-proc-mou.patch \ + file://backport-Fix-another-crash-due-to-missing-NHDR.patch \ + file://backport-hwdb-remove-double-empty-line-in-help-text.patch \ + file://backport-run-mount-systemctl-don-t-fork-off-PolicyKit-ask-pw-.patch \ + file://backport-homed-make-sure-to-use-right-asssesors-for-GID-acces.patch \ + file://backport-homed-fix-log-message-referring-to-fsck-when-we-actu.patch \ + file://backport-homed-add-missing-SYNTHETIC_ERRNO.patch \ + file://backport-homed-remove-misplaced-assert.patch \ + file://backport-network-print-Ethernet-Link-Layer-DHCP-client-ID-wit.patch \ + file://backport-udev-fix-potential-memleak.patch \ + file://backport-nspawn-fix-type-to-pass-to-connect.patch \ + file://backport-home-secret-argument-of-handle_generic_user_record_e.patch \ + file://backport-docs-portablectl-is-in-bin.patch \ + file://backport-core-fix-free-undefined-pointer-when-strdup-failed-i.patch \ + file://backport-sd-event-take-ref-on-event-loop-object-before-dispat.patch \ + file://backport-nss-systemd-pack-pw_passwd-result-into-supplied-buff.patch \ + file://backport-nss-systemd-ensure-returned-strings-point-into-provi.patch \ + file://backport-core-Parse-log-environment-settings-again-after-appl.patch \ + file://backport-network-fix-handling-of-network-interface-renaming.patch \ + file://backport-virt-Improve-detection-of-EC2-metal-instances.patch \ + file://backport-Fix-error-building-repart-with-no-libcryptsetup-2073.patch \ + file://backport-sd-journal-Don-t-compare-hashes-from-different-journ.patch \ + file://backport-test-use-a-less-restrictive-portable-profile-when-ru.patch \ + file://backport-Respect-install_sysconfdir.patch \ + file://backport-journalctl-never-fail-at-flushing-when-the-flushed-f.patch \ + file://backport-sd-journal-Ignore-data-threshold-if-set-to-zero-in-s.patch \ + file://backport-watchdog-pass-right-error-code-to-log-function-so-th.patch \ + file://backport-fileio-lower-maximum-virtual-file-buffer-size-by-one.patch \ + file://backport-fileio-set-O_NOCTTY-when-reading-virtual-files.patch \ + file://backport-fileio-start-with-4k-buffer-for-procfs.patch \ + file://backport-fileio-fix-truncated-read-handling-in-read_virtual_f.patch \ + file://backport-test-fileio-test-read_virtual_file-with-more-files-f.patch \ + file://backport-bootctl-Fix-update-not-adding-EFI-entry-if-Boot-IDs-.patch \ + file://backport-network-disable-event-sources-before-unref-them.patch \ + file://backport-libsystemd-network-disable-event-sources-before-unre.patch \ + file://backport-resolved-suppress-writing-DNS-server-info-into-etc-r.patch \ + file://backport-resolvconf-compat-make-u-operation-a-NOP.patch \ + file://backport-basic-unit-file-don-t-filter-out-names-starting-with.patch \ + file://backport-core-mount-add-implicit-unit-dependencies-even-if-wh.patch \ + file://backport-seccomp-Always-install-filters-for-native-architectu.patch \ + file://backport-test-Check-that-native-architecture-is-always-filter.patch \ + file://backport-mount-util-fix-fd_is_mount_point-when-both-the-paren.patch \ + file://backport-sleep-don-t-skip-resume-device-with-low-priority-ava.patch \ + file://backport-repart-use-right-error-variable.patch \ + file://backport-basic-env-util-correctly-parse-extended-vars-after-n.patch \ + file://backport-user-record-disable-two-pbkdf-fields-that-don-t-appl.patch \ + file://backport-core-fix-SIGABRT-on-empty-exec-command-argv.patch \ + file://backport-core-service-also-check-path-in-exec-commands.patch \ + file://backport-coredump-Don-t-log-an-error-if-D-Bus-isn-t-running.patch \ + file://backport-ether-addr-util-make-hw_addr_to_string-return-valid-.patch \ + file://backport-localed-use-PROJECT_FILE-rather-than-__FILE__-for-lo.patch \ + file://backport-coredumpctl-stop-truncating-information-about-coredu.patch \ + file://backport-sd-dhcp6-client-ignore-IAs-whose-IAID-do-not-match-c.patch \ + file://backport-sd-boot-Unify-error-handling.patch \ + file://backport-sd-boot-Rework-console-input-handling.patch \ + file://backport-coredump-fix-filename-in-journal-when-not-compressed.patch \ + file://backport-virt-Support-detection-for-ARM64-Hyper-V-guests.patch \ + file://backport-homework-fix-incorrect-error-variable-use.patch \ + file://backport-sd-device-monitor-update-log-message-to-clarify-the-.patch \ + file://backport-homework-don-t-bother-with-BLKRRPART-on-images-that-.patch \ + file://backport-userdb-fix-type-to-pass-to-connect.patch \ + file://backport-homed-shutdown-call-valgrind-magic-after-LOOP_GET_ST.patch \ + file://backport-utmp-remove-dev-from-line.patch \ + file://backport-network-route-fix-possible-overflow-in-conversion-us.patch \ + file://backport-varlink-disconnect-varlink-link-in-one-more-case.patch \ + file://backport-udev-do-not-try-to-rename-interface-if-it-is-already.patch \ + file://backport-stat-util-specify-O_DIRECTORY-when-reopening-dir-in-.patch \ + file://backport-json-do-something-remotely-reasonable-when-we-see-Na.patch \ + file://backport-change-indicator-used-for-later-versions-of-VirtualB.patch \ + file://backport-hwdb-Allow-console-users-access-to-media-nodes.patch \ + file://backport-test-do-not-use-alloca-in-function-call.patch \ + file://backport-systemctl-pretty-print-ExtensionImages-property.patch \ + file://backport-systemctl-small-fixes-for-MountImages-pretty-printin.patch \ + file://backport-core-normalize-r-variable-handling-in-unit_attach_pi.patch \ + file://backport-scope-refuse-activation-of-scopes-if-no-PIDs-to-add-.patch \ + file://backport-homework-repart-turn-on-cryptsetup-logging-before-we.patch \ + file://backport-systemctl-only-fall-back-to-local-cgroup-display-if-.patch \ + file://backport-execute-respect-selinux_context_ignore.patch \ + file://backport-core-ignore-failure-on-setting-smack-process-label-w.patch \ + file://backport-process-util-wait-for-processes-we-killed-even-if-ki.patch \ + file://backport-scope-count-successful-cgroup-additions-when-delegat.patch \ + file://backport-creds-util-switch-to-OpenSSL-3.0-APIs.patch \ + file://backport-openssl-util-use-EVP-API-to-get-RSA-bits.patch \ + file://backport-ci-fix-indentation.patch \ + file://backport-ci-cancel-previous-jobs-on-ref-update.patch \ + file://backport-ci-take-CIFuzz-s-matrix-into-consideration.patch \ + file://backport-ci-run-the-unit_tests-and-mkosi-jobs-on-stable-branc.patch \ + file://backport-test-oomd-util-skip-tests-if-cgroup-memory-controlle.patch \ + file://backport-ci-pin-the-debian-systemd-repo-to-a-specific-revisio.patch \ + file://backport-basic-mountpoint-util-detect-erofs-as-a-read-only-FS.patch \ + file://backport-user-record-fix-display-of-access-mode.patch \ + file://backport-logind-downgrade-message-about-run-utmp-missing-to-L.patch \ + file://backport-tree-wide-use-sd_event_source_disable_unref-where-we.patch \ + file://backport-sd-event-don-t-destroy-inotify-data-structures-from-.patch \ + file://backport-Change-gendered-terms-to-be-gender-neutral-21325.patch \ + file://backport-binfmt-fix-exit-value.patch \ + file://backport-unit_is_bound_by_inactive-fix-return-pointer-check.patch \ + file://backport-umask-util-add-helper-that-resets-umask-until-end-of.patch \ + file://backport-namespace-rebreak-a-few-comments.patch \ + file://backport-namespace-make-whole-namespace_setup-work-regardless.patch \ + file://backport-namespace-make-tmp-dir-handling-code-independent-of-.patch \ + file://backport-tests-add-test-case-for-UMask-BindPaths-combination.patch \ + file://backport-sd-dhcp6-client-constify-one-argument.patch \ + file://backport-sd-dhcp6-client-modernize-dhcp6_option_parse.patch \ + file://backport-test-add-tests-for-reading-unaligned-data.patch \ + file://backport-sd-dhcp6-client-fix-buffer-size-calculation-in-dhcp6.patch \ + file://backport-sd-dhcp6-client-constify-several-arguments.patch \ + file://backport-sd-dhcp6-client-make-dhcp6_lease_free-accepts-NULL.patch \ + file://backport-sd-dhcp6-client-do-not-merge-NTP-and-SNTP-options.patch \ + file://backport-dhcp-fix-assertion-failure.patch \ + file://backport-network-address-read-flags-from-message-header-when-.patch \ + file://backport-seccomp-move-mprotect-to-default.patch \ + file://backport-journal-Skip-over-corrupt-entry-items-in-enumerate_d.patch \ + file://backport-journal-Use-separate-variable-for-Data-object-in-sd_.patch \ + file://backport-journal-Skip-corrupt-Data-objects-in-sd_journal_get_.patch \ + file://backport-analyze-fix-printing-config-when-there-is-no-main-co.patch \ + file://backport-resolved-fix-ResolveService-hostname-handling.patch \ + file://backport-resolved-properly-signal-transient-errors-back-to-NS.patch \ + file://backport-resolved-make-sure-we-don-t-hit-an-assert-when-deali.patch \ + file://backport-resolved-clean-up-manager_write_resolv_conf-a-bit.patch \ + file://backport-virt-Fix-the-detection-for-Hyper-V-VMs.patch \ + file://backport-homework-fix-a-bad-error-propagation.patch \ + file://backport-journal-Remove-entry-seqnum-revert-logic.patch \ + file://backport-mmap-cache-LIST_REMOVE-after-w-unused_prev.patch \ + file://backport-journal-Deduplicate-entry-items-before-they-are-stor.patch \ + file://backport-test-journal-flush-allow-testing-against-specific-fi.patch \ + file://backport-test-journal-flush-do-not-croak-on-corrupted-input-f.patch \ + file://backport-fix-ConditionDirectoryNotEmpty-when-it-comes-to-a-No.patch \ + file://backport-fix-ConditionPathIsReadWrite-when-path-does-not-exis.patch \ + file://backport-sd-dhcp6-client-fix-error-handling.patch \ + file://backport-core-bpf-firewall-make-bpf_firewall_supported-always.patch \ + file://backport-cgroup-don-t-emit-BPF-firewall-warning-when-manager-.patch \ + file://backport-cryptenroll-fix-wrong-error-messages.patch \ + file://backport-Bump-the-max-number-of-inodes-for-dev-to-128k.patch \ + file://backport-fix-DirectoryNotEmpty-when-it-comes-to-a-Non-directo.patch \ + file://backport-core-use-correct-level-for-CPU-time-log-message.patch \ + file://backport-core-cgroup-set-bfq.weight-first-and-fixes-blkio.wei.patch \ + file://backport-core-cgroup-use-helper-macro-for-bfq-conversion.patch \ + file://backport-resolve-remove-server-large-level.patch \ + file://backport-mkosi-Build-Fedora-35-images.patch \ + file://backport-home-fix-heap-use-after-free.patch \ + file://backport-journactl-show-info-about-journal-range-only-at-debu.patch \ + file://backport-fstab-generator-do-not-remount-sys-when-running-in-a.patch \ + file://backport-journal-remote-use-MHD_HTTP_CONTENT_TOO_LARGE-as-MHD.patch \ + file://backport-repart-use-real-disk-start-end-for-bar-production.patch \ + file://backport-machined-set-TTYPath-for-container-shell.patch \ + file://backport-sd-journal-free-incomplete-match-on-failure.patch \ + file://backport-sd-journal-fix-segfault-when-match_new-fails.patch \ + file://backport-random-util-use-ssize_t-for-getrandom-return-value.patch \ + file://backport-dbus-wait-for-jobs-add-extra_args-to-bus_wait_for_jo.patch \ + file://backport-systemd-run-ensure-error-logs-suggest-to-use-user-wh.patch \ + file://backport-sysusers-use-filename-if-proc-is-not-mounted.patch \ + file://backport-nss-systemd-fix-required-buffer-size-calculation.patch \ + file://backport-nss-systemd-fix-alignment-of-gr_mem.patch \ + file://backport-nss-myhostname-do-not-apply-non-zero-offset-to-null-.patch \ + file://backport-syscalls-update-syscall-definitions.patch \ + file://backport-missing-syscall-add-__NR_openat2.patch \ + file://backport-basic-log-allow-errno-values-higher-than-255.patch \ + file://backport-backlight-ignore-error-if-the-backlight-device-is-al.patch \ + file://backport-logind-do-not-propagate-error-in-delayed-action.patch \ + file://backport-test-watchdog-mark-as-unsafe.patch \ + file://backport-fstab-generator-skip-root-directory-handling-when-nf.patch \ + file://backport-seccomp-move-arch_prctl-to-default.patch \ + file://backport-boot-timestamps-Discard-firmware-init-time-when-runn.patch \ + file://backport-CVE-2021-3997-rm-rf-refactor-rm_rf_children-split-out-body-of-dire.patch \ + file://backport-CVE-2021-3997-rm-rf-optionally-fsync-after-removing-directory-tree.patch \ + file://backport-CVE-2021-3997-tmpfiles-st-may-have-been-used-uninitialized.patch \ + file://backport-CVE-2021-3997-shared-rm_rf-refactor-rm_rf_children_inner-to-shorte.patch \ + file://backport-CVE-2021-3997-shared-rm_rf-refactor-rm_rf-to-shorten-code-a-bit.patch \ + file://backport-CVE-2021-3997-shared-rm-rf-loop-over-nested-directories-instead-of.patch \ + file://backport-nss-drop-dummy-setup_logging-helpers.patch \ + file://backport-nss-only-read-logging-config-from-environment-variab.patch \ + file://backport-fix-test-string-util-failed-when-locale-is-not-utf8.patch \ + file://backport-policy-files-adjust-landing-page-link.patch \ + file://backport-xdg-autostart-service-Ignore-missing-desktop-sepcifi.patch \ + file://backport-journal-Skip-data-objects-with-invalid-offsets.patch \ + file://backport-namespace-allow-ProcSubset-pid-with-some-ProtectKern.patch \ + file://backport-sysext-use-LO_FLAGS_PARTSCAN-when-opening-image.patch \ + file://backport-dissect-image-validate-extension-release-even-if-the.patch \ + file://backport-core-refuse-to-mount-ExtensionImages-if-the-base-lay.patch \ + file://backport-resolve-fix-assertion-triggered-when-r-0.patch \ + file://backport-oomd-fix-race-with-path-unavailability-when-killing-.patch \ + file://backport-oomd-handle-situations-when-no-cgroups-are-killed.patch \ + file://backport-udevadm-cleanup_dir-use-dot_or_dot_dot.patch \ + file://backport-udevadm-cleanup-db-don-t-delete-information-for-kept.patch \ + file://backport-core-namespace-allow-using-ProtectSubset-pid-and-Pro.patch \ + file://backport-core-namespace-s-normalize_mounts-drop_unused_mounts.patch \ + file://backport-logind.conf-Fix-name-of-option-RuntimeDirectoryInode.patch \ + file://backport-basic-mac_-selinux-smack-_apply_fd-does-not-work-whe.patch \ + file://backport-sd-dhcp-lease-fix-an-infinite-loop-found-by-the-fuzz.patch \ + file://backport-sd-dhcp-lease-fix-a-memory-leak-in-dhcp_lease_parse_.patch \ + file://backport-core-don-t-fail-on-EEXIST-when-creating-mount-point.patch \ + file://backport-bus-util-retrieve-bus-error-from-message.patch \ + file://backport-core-unit-use-bus_error_message-at-one-more-place.patch \ + file://backport-login-use-bus_error_message-at-one-more-place.patch \ + file://backport-pid1-pass-PAM_DATA_SILENT-to-pam_end-in-child.patch \ + file://backport-execute-use-_cleanup_-logic-where-appropriate.patch \ + file://backport-execute-line-break-comments-a-bit-less-aggressively.patch \ + file://backport-execute-document-that-the-env-param-is-input-and-out.patch \ + file://backport-sd-dhcp-lease-fix-memleak.patch \ + file://backport-util-another-set-of-CVE-2021-4034-assert-s.patch \ + file://backport-resolve-fix-potential-memleak-and-use-after-free.patch \ + file://backport-resolve-fix-possible-memleak.patch \ + file://backport-resolve-use-_cleanup_-attribute-for-freeing-DnsQuery.patch \ + file://backport-network-bridge-fix-endian-of-vlan-protocol.patch \ + file://backport-basic-escape-add-helper-for-quoting-command-lines.patch \ + file://backport-core-use-the-new-quoting-helper.patch \ + file://backport-sd-bus-print-quoted-commandline-when-in-bus_socket_e.patch \ + file://backport-sd-bus-print-debugging-information-if-bus_container_.patch \ + file://backport-sd-bus-allow-numerical-uids-in-M-user-.host.patch \ + file://backport-packit-remove-unsupported-Dcryptolib-openssl-option.patch \ + file://backport-sd-device-silence-gcc-warning-with-newest-gcc.patch \ + file://backport-packit-build-on-and-use-Fedora-35-spec-file.patch \ + file://backport-ci-use-the-system-llvm-11-package-on-Focal.patch \ + file://backport-resolve-refuse-AF_UNSPEC-when-resolving-address.patch \ + file://backport-resolve-add-reference-of-the-original-bus-message-to.patch \ + file://backport-ci-replace-apt-key-with-signed-by.patch \ + file://backport-ci-fix-clang-13-installation.patch \ + file://backport-tree-wide-mark-set-but-not-used-variables-as-unused-.patch \ + file://backport-sd-dhcp-server-rename-server_send_nak-server_send_na.patch \ + file://backport-packit-drop-unnumbered-patches-as-well.patch \ + file://backport-dns-domain-re-introduce-dns_name_is_empty.patch \ + file://backport-resolve-synthesize-empty-name.patch \ + file://backport-resolve-synthesize-null-address-IPv4-broadcast-addre.patch \ + file://backport-resolve-drop-never-matched-condition.patch \ + file://backport-resolve-make-dns_scope_good_domain-take-DnsQuery.patch \ + file://backport-resolve-synthesize-empty-domain-only-when-A-and-or-A.patch \ + file://backport-pid1-watch-bus-name-always-when-we-have-it.patch \ + file://backport-pid1-lookup-owning-PID-of-BusName-name-of-services-a.patch \ + file://backport-docs-SYSTEMD_NSS_BYPASS_BUS-is-not-honoured-anymore-.patch \ + file://backport-pid1-set-SYSTEMD_NSS_DYNAMIC_BYPASS-1-env-var-for-db.patch \ + file://backport-systemctl-make-timestamp-affect-the-show-verb-as-wel.patch \ + file://backport-core-really-skip-automatic-restart-when-a-JOB_STOP-j.patch \ + file://backport-test-oomd-util-style-fixlets.patch \ + file://backport-test-oomd-util-fix-conditional-jump-on-uninitialised.patch \ + file://backport-test-fix-file-descriptor-leak-in-test-catalog.patch \ + file://backport-test-fix-file-descriptor-leak-in-test-oomd-util.patch \ + file://backport-test-fix-file-descriptor-leak-in-test-fs-util.patch \ + file://backport-test-fix-file-descriptor-leak-in-test-tmpfiles.c.patch \ + file://backport-test-fix-file-descriptor-leak-in-test-psi-util.patch \ + file://backport-clang-format-we-actually-typically-use-16ch-continua.patch \ + file://backport-test-journal-send-close-fd-opend-by-syslog.patch \ + file://backport-journal-send-close-fd-on-exit-when-running-with-valg.patch \ + file://backport-udev-builtin-input_id-don-t-label-absolute-mice-as-p.patch \ + file://backport-mkosi-Remove-Arch-nspawn-workaround.patch \ + file://backport-core-check-size-before-mmap.patch \ + file://backport-devnode-acl-use-_cleanup_-to-free-acl_t.patch \ + file://backport-dissect-image-add-extension-specific-validation-flag.patch \ + file://backport-portabled-error-out-if-there-are-no-units-only-after.patch \ + file://backport-portabled-validate-SYSEXT_LEVEL-when-attaching.patch \ + file://backport-portabled-refactor-extraction-validation-into-a-comm.patch \ + file://backport-portable-move-profile-search-helper-to-path-lookup.patch \ + file://backport-portable-add-flag-to-return-extension-releases-in-Ge.patch \ + file://backport-portablectl-reorder-if-branches-to-match-previous-co.patch \ + file://backport-portable-inline-one-variable-declaration.patch \ + file://backport-portable-add-return-parameter-to-GetImageMetadataWit.patch \ + file://backport-wait-online-rename-Manager-elements.patch \ + file://backport-journald-make-sure-SIGTERM-handling-doesn-t-get-star.patch \ + file://backport-journal-file-if-we-are-going-down-don-t-use-event-lo.patch \ + file://backport-kernel-install-also-remove-modules.builtin.alias.bin.patch \ + file://backport-Bump-the-max-number-of-inodes-for-dev-to-a-million.patch \ + file://backport-Bump-the-max-number-of-inodes-for-tmp-to-a-million-t.patch \ + file://backport-unit-escape.patch \ + file://backport-udev-rename-type-name-e.g.-struct-worker-Worker.patch \ + file://backport-udev-run-the-main-process-workers-and-spawned-comman.patch \ + file://backport-Add-meson-option-to-disable-urlify.patch \ + file://backport-Revert-sysctl.d-switch-net.ipv4.conf.all.rp_filter-f.patch \ + file://backport-login-drop-non-default-value-for-RuntimeDirectoryIno.patch \ + file://backport-login-make-RuntimeDirectoryInodesMax-support-K-G-M-s.patch \ + file://backport-virt-detect-OpenStack-Nova-instance.patch \ + file://backport-Avoid-tmp-being-mounted-as-tmpfs-without-the-user-s-.patch \ + file://backport-revert-delete-initrd-usr-fs-target.patch \ + file://backport-journal-Only-move-to-objects-when-necessary.patch \ + file://backport-sd-device-introduce-device_has_devlink.patch \ + file://backport-udev-node-split-out-permission-handling-from-udev_no.patch \ + file://backport-udev-node-stack-directory-must-exist-when-adding-dev.patch \ + file://backport-udev-node-save-information-about-device-node-and-pri.patch \ + file://backport-udev-node-always-update-timestamp-of-stack-directory.patch \ + file://backport-udev-node-assume-no-new-claim-to-a-symlink-if-run-ud.patch \ + file://backport-udev-node-always-atomically-create-symlink-to-device.patch \ + file://backport-udev-node-check-stack-directory-change-even-if-devli.patch \ + file://backport-udev-node-shorten-code-a-bit-and-update-log-message.patch \ + file://backport-udev-node-add-random-delay-on-conflict-in-updating-d.patch \ + file://backport-udev-node-drop-redundant-trial-of-devlink-creation.patch \ + file://backport-udev-node-simplify-the-example-of-race.patch \ + file://backport-udev-node-do-not-ignore-unexpected-errors-on-removin.patch \ + file://backport-calendarspec-fix-possibly-skips-next-elapse.patch \ + file://backport-macro-account-for-negative-values-in-DECIMAL_STR_WID.patch \ + file://backport-core-command-argument-can-be-longer-than-PATH_MAX.patch \ + file://backport-hwdb-fix-parsing-options.patch \ + file://backport-temporarily-disable-test-seccomp.patch \ + file://backport-meson.build-change-operator-combining-bools-from-to-.patch \ + file://backport-core-replace-slice-dependencies-as-they-get-added.patch \ + file://backport-scsi_id-retry-inquiry-ioctl-if-host_byte-is-DID_TRAN.patch \ + file://backport-revert-units-add-ProtectClock-yes.patch \ + file://backport-fix-CVE-2022-3821.patch \ + file://backport-CVE-2022-4415-test-Create-convenience-macros-to-declare-tests.patch \ + file://backport-CVE-2022-4415-test-Slightly-rework-DEFINE_TEST_MAIN-macros.patch \ + file://backport-CVE-2022-4415-test-Add-TEST_RET-macro.patch \ + file://backport-CVE-2022-4415-test-Add-sd_booted-condition-test-to-TEST-macro.patch \ + file://backport-CVE-2022-4415-basic-add-STRERROR-wrapper-for-strerror_r.patch \ + file://backport-CVE-2022-4415-tree-wide-define-and-use-STRERROR_OR_EOF.patch \ + file://backport-coredump-Fix-format-string-type-mismatch.patch \ + file://backport-coredump-drop-an-unused-variable.patch \ + file://backport-CVE-2022-4415-coredump-adjust-whitespace.patch \ + file://backport-CVE-2022-4415-dont-allow-user-access-coredumps-with-changed-uid.patch \ + file://backport-dns-domain-make-each-label-nul-terminated.patch \ + file://backport-resolve-fix-heap-buffer-overflow-reported-by-ASAN-wi.patch \ + file://backport-sd-bus-do-not-pass-NULL-when-received-message-with-i.patch \ + file://backport-growfs-don-t-actually-resize-on-dry-run.patch \ + file://backport-stat-util-replace-is_dir-is_dir_fd-by-single-is_dir_.patch \ + file://backport-tmpfiles-check-the-directory-we-were-supposed-to-cre.patch \ + file://backport-coredump-Connect-stdout-stderr-to-dev-null-before-do.patch \ + file://backport-cgroups-agent-connect-stdin-stdout-stderr-to-dev-nul.patch \ + file://backport-unit-file-avoid-null-in-debugging-logs.patch \ + file://backport-resolve-mdns_packet_extract_matching_rrs-may-return-.patch \ + file://backport-dhcp-fix-potential-buffer-overflow.patch \ + file://backport-sd-device-monitor-actually-refuse-to-send-invalid-de.patch \ + file://backport-sysusers-add-fsync-for-passwd-24324.patch \ + file://backport-condition-fix-device-tree-firmware-path.patch \ + file://backport-log-don-t-attempt-to-duplicate-closed-fd.patch \ + file://backport-mount-util-fix-error-code.patch \ + file://backport-analyze-add-forgotten-return-statement.patch \ + file://backport-shared-condition-avoid-nss-lookup-in-PID1.patch \ + file://backport-logind-fix-getting-property-OnExternalPower-via-D-Bu.patch \ + file://backport-udev-support-by-path-devlink-for-multipath-nvme-bloc.patch \ + file://update-rtc-with-system-clock-when-shutdown.patch \ + file://udev-add-actions-while-rename-netif-failed.patch \ + file://fix-two-VF-virtual-machines-have-same-mac-address.patch \ + file://logind-set-RemoveIPC-to-false-by-default.patch \ + file://rules-add-rule-for-naming-Dell-iDRAC-USB-Virtual-NIC.patch \ + file://unit-don-t-add-Requires-for-tmp.mount.patch \ + file://rules-add-elevator-kernel-command-line-parameter.patch \ + file://rules-add-the-rule-that-adds-elevator-kernel-command.patch \ + file://units-add-Install-section-to-tmp.mount.patch \ + file://Make-systemd-udevd.service-start-after-systemd-remou.patch \ + file://udev-virsh-shutdown-vm.patch \ + file://sd-bus-properly-initialize-containers.patch \ + file://Revert-core-one-step-back-again-for-nspawn-we-actual.patch \ + file://journal-don-t-enable-systemd-journald-audit.socket-b.patch \ + file://systemd-change-time-log-level.patch \ + file://fix-capsh-drop-but-ping-success.patch \ + file://resolved-create-etc-resolv.conf-symlink-at-runtime.patch \ + file://pid1-bump-DefaultTasksMax-to-80-of-the-kernel-pid.ma.patch \ + file://fix-journal-file-descriptors-leak-problems.patch \ + file://activation-service-must-be-restarted-when-reactivated.patch \ + file://systemd-core-fix-problem-of-dbus-service-can-not-be-started.patch \ + file://delay-to-restart-when-a-service-can-not-be-auto-restarted.patch \ + file://disable-initialize_clock.patch \ + file://systemd-solve-that-rsyslog-reads-journal-s-object-of.patch \ + file://check-whether-command_prev-is-null-before-assigning-.patch \ + file://core-skip-change-device-to-dead-in-manager_catchup-d.patch \ + file://revert-rpm-restart-services-in-posttrans.patch \ + file://Don-t-set-AlternativeNamesPolicy-by-default.patch \ + file://change-NTP-server-to-x.pool.ntp.org.patch \ + file://keep-weight-consistent-with-the-set-value.patch \ + file://Systemd-Add-sw64-architecture.patch \ + file://0029-Add-support-for-the-LoongArch-architecture.patch \ + file://0030-Add-LoongArch-dmi-virt-detection-and-testcase.patch \ + file://add-loongarch-for-missing_syscall_def.patch \ + file://core-update-arg_default_rlimit-in-bump_rlimit.patch \ + file://set-forwardtowall-no-to-avoid-emerg-log-shown-on-she.patch \ + file://core-cgroup-support-cpuset.patch \ + file://core-cgroup-support-freezer.patch \ + file://core-cgroup-support-memorysw.patch \ + file://systemd-core-Add-new-rules-for-lower-priority-events.patch \ + file://bugfix-also-stop-machine-when-a-machine-un.patch \ + file://print-the-process-status-to-console-when-shutdown.patch \ + file://Retry-to-handle-the-uevent-when-worker-is-terminated.patch \ + file://treat-hyphen-as-valid-hostname-char.patch \ + file://process-util-log-more-information-when-runnin.patch \ + file://fuser-print-umount-message-to-reboot-umount-msg.patch \ + file://shutdown-reboot-when-recieve-crash-signal.patch \ + file://core-add-OptionalLog-to-allow-users-change-log-level.patch \ + file://core-cgroup-support-default-slice-for-all-uni.patch \ + file://core-add-invalidate-cgroup-config.patch \ + file://let-the-child-of-one-unit-don-t-affect-each-other.patch \ + file://support-disable-cgroup-controllers-we-don-t-want.patch \ + file://fix-mount-failed-while-daemon-reexec.patch \ + file://bugfix-for-cgroup-Swap-cgroup-v1-deletion-and-migration.patch \ + file://delete-journal-files-except-system.journal-when-jour.patch \ + " + +# fix error: redefinition of 'struct statx_timestamp' with glibc-2.36 +# refer to: https://github.com/systemd/systemd/commit/21c03ad5e9d8d0350e30dae92a5e15da318a1539 +SRC_URI += "file://fix-glibc-2.36-redefinition-error.patch" diff --git a/meta-openeuler/recipes-core/systemd/systemd_%.bbappend b/meta-openeuler/recipes-core/systemd/systemd_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b90f12734affb66dbc59d3cf6c0cb0db8c186ebd --- /dev/null +++ b/meta-openeuler/recipes-core/systemd/systemd_%.bbappend @@ -0,0 +1,71 @@ +#main bbfile: yocto-poky/meta/recipes-core/systemd/systemd_247.6.bb + +#version in openEuler +PV = "249" +S = "${WORKDIR}/${BP}" + +require systemd-openeuler.inc + +OPENEULER_REPO_NAME = "systemd" +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +# feature sync with systemd_249.7.bb from poky honister +# see https://git.yoctoproject.org/poky/tree/meta/recipes-core/systemd/systemd_249.7.bb?h=honister +PACKAGECONFIG_append += "wheel-group" +# we don't wan zstd PACKAGECONFIG += "zstd" +PACKAGECONFIG_remove += "xz" +PACKAGECONFIG[tpm2] = "-Dtpm2=true,-Dtpm2=false,tpm2-tss,tpm2-tss libtss2 libtss2-tcti-device" +PACKAGECONFIG[repart] = "-Drepart=true,-Drepart=false" +PACKAGECONFIG[homed] = "-Dhomed=true,-Dhomed=false" +PACKAGECONFIG[wheel-group] = "-Dwheel-group=true, -Dwheel-group=false" +PACKAGECONFIG[zstd] = "-Dzstd=true,-Dzstd=false,zstd" +FILES_${PN}-container += "${exec_prefix}/lib/tmpfiles.d/README " +FILES_${PN}-extra-utils += "${bindir}/systemd-sysext " +FILES_${PN} += "${rootlibexecdir}/modprobe.d/README ${datadir}/dbus-1/system.d/org.freedesktop.home1.conf " +FILES_udev += "${rootlibexecdir}/udev/dmi_memory_id \ + ${rootlibexecdir}/udev/rules.d/40-elevator.rules \ + ${rootlibexecdir}/udev/rules.d/70-memory.rules \ + ${rootlibexecdir}/udev/rules.d/73-idrac.rules \ + ${rootlibexecdir}/udev/rules.d/81-net-dhcp.rules \ + ${rootlibexecdir}/udev/rules.d/README \ + " +python __anonymous() { + if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): + d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") + + if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl', True, False, d): + bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl]") + + if bb.utils.contains('PACKAGECONFIG', 'homed', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'userdb openssl cryptsetup', True, False, d): + bb.error("PACKAGECONFIG[homed] requires PACKAGECONFIG[userdb], PACKAGECONFIG[openssl] and PACKAGECONFIG[cryptsetup]") +} +# rules.d come from openeuler patches: /lib/udev/rules.d/73-idrac.rules /lib/udev/rules.d/40-elevator.rules +FILES_udev += " \ + ${rootlibexecdir}/udev/rules.d/40-elevator.rules \ + ${rootlibexecdir}/udev/rules.d/73-idrac.rules \ + " + +# depmodwrapper is not valid to do depmod in buildtime, add a service to do it in runtime as a workaround. +# as modutils.sh is not run under systemd +PACKAGE_BEFORE_PN_append = "${PN}-depmod " +SRC_URI_append += "file://systemd-depmod.service" +FILES_${PN}-depmod = "${systemd_unitdir}/system/systemd-depmod.service" +SYSTEMD_SERVICE_${PN}-depmod = "systemd-depmod.service" +do_install_append () { + install -m 0644 ${WORKDIR}/systemd-depmod.service ${D}${systemd_unitdir}/system/systemd-depmod.service + ln -sf ../systemd-depmod.service ${D}${systemd_unitdir}/system/sysinit.target.wants/systemd-depmod.service +} + +SRC_URI[tarball.md5sum] = "8e8adf909c255914dfc10709bd372e69" +SRC_URI[tarball.sha256sum] = "174091ce5f2c02123f76d546622b14078097af105870086d18d55c1c2667d855" + +# glib needs meson, meson needs python3-native +# here use nativesdk's meson-native and python3-native +DEPENDS_remove += "python3-native" + +pkg_postinst_udev-hwdb () { + # current we don't support qemuwrapper to pre build the config for rootfs + # so if you wan't to update hwdb, do 'udevadm hwdb --update' in your own script on service or copy the configs into rootfs directly. + : +} + diff --git a/meta-openeuler/recipes-core/tzdata/timezone-append.inc b/meta-openeuler/recipes-core/tzdata/timezone-append.inc new file mode 100644 index 0000000000000000000000000000000000000000..0d809852b12e5edc32b9092fc2c50911e79ab249 --- /dev/null +++ b/meta-openeuler/recipes-core/tzdata/timezone-append.inc @@ -0,0 +1,21 @@ +PV = "2022g" + +DL_DIR = "${OPENEULER_SP_DIR}/tzdata" + +OPENEULER_REPO_NAME = "tzdata" + +# files, patches that come from openeuler +SRC_URI = " \ + file://tzcode${PV}.tar.gz;name=tzcode \ + file://tzdata${PV}.tar.gz;name=tzdata \ + file://backport-Much-of-Greenland-still-uses-DST-from-2024-on.patch \ + file://bugfix-0001-add-Beijing-timezone.patch \ + file://remove-ROC-timezone.patch \ + file://rename-Macau-to-Macao.patch \ + file://remove-El_Aaiun-timezone.patch \ + file://remove-Israel-timezone.patch \ + file://skip-check_web-testcase.patch \ + " + +SRC_URI[tzcode.sha256sum] = "9610bb0b9656ff404c361a41f3286da53064b5469d84f00c9cb2314c8614da74" +SRC_URI[tzdata.sha256sum] = "4491db8281ae94a84d939e427bdd83dc389f26764d27d9a5c52d782c16764478" diff --git a/meta-openeuler/recipes-core/tzdata/timezone.inc b/meta-openeuler/recipes-core/tzdata/timezone.inc deleted file mode 100644 index 44a6e7abe10212a7fbe202fa078bb8ba39388685..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/tzdata/timezone.inc +++ /dev/null @@ -1,23 +0,0 @@ -SUMMARY = "Timezone data" -DESCRIPTION = "The Time Zone Database contains code and data that represent \ -the history of local time for many representative locations around the globe." -HOMEPAGE = "http://www.iana.org/time-zones" -SECTION = "base" -LICENSE = "PD & BSD & BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=c679c9d6b02bc2757b3eaf8f53c43fba" - -SRC_URI = "file://tzdata/tzcode${PV}.tar.gz;name=tzcode \ - file://tzdata/tzdata${PV}.tar.gz;name=tzdata \ - file://tzdata/bugfix-0001-add-Beijing-timezone.patch \ - file://tzdata/remove-country-selection-from-tzselect-steps.patch \ - file://tzdata/remove-ROC-timezone.patch \ - file://tzdata/rename-Macau-to-Macao.patch \ - file://tzdata/remove-El_Aaiun-timezone.patch \ - file://tzdata/remove-Israel-timezone.patch \ - file://tzdata/skip-check_web-testcase.patch \ - " - -UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones" - -SRC_URI[tzcode.sha256sum] = "584666393a5424d13d27ec01183da17703273664742e049d4f62f62dab631775" -SRC_URI[tzdata.sha256sum] = "07ec42b737d0d3c6be9c337f8abb5f00554a0f9cc4fcf01a703d69403b6bb2b1" diff --git a/meta-openeuler/recipes-core/tzdata/tzcode-native.bbappend b/meta-openeuler/recipes-core/tzdata/tzcode-native.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e21b04435dd6bfdbdcbc116cc85a1842eef04b9a --- /dev/null +++ b/meta-openeuler/recipes-core/tzdata/tzcode-native.bbappend @@ -0,0 +1 @@ +include timezone-append.inc diff --git a/meta-openeuler/recipes-core/tzdata/tzcode-native_2021e.bb b/meta-openeuler/recipes-core/tzdata/tzcode-native_2021e.bb deleted file mode 100644 index 8a96af199bdc4244d9be4cb1eb5664a8d1334aaf..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/tzdata/tzcode-native_2021e.bb +++ /dev/null @@ -1,16 +0,0 @@ -require timezone.inc - -SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect" - -S = "${WORKDIR}" - -inherit native - -EXTRA_OEMAKE += "cc='${CC}'" - -do_install () { - install -d ${D}${bindir}/ - install -m 755 zic ${D}${bindir}/ - install -m 755 zdump ${D}${bindir}/ - install -m 755 tzselect ${D}${bindir}/ -} diff --git a/meta-openeuler/recipes-core/tzdata/tzdata.bbappend b/meta-openeuler/recipes-core/tzdata/tzdata.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d130a3756324900b538f6544491457116d5387dc --- /dev/null +++ b/meta-openeuler/recipes-core/tzdata/tzdata.bbappend @@ -0,0 +1,21 @@ +include timezone-append.inc + +FILES_tzdata-core_append += " \ + ${datadir}/zoneinfo/Asia/Beijing \ + ${datadir}/zoneinfo/Asia/Shanghai \ +" + +# no need to depends on tzcode-native, as nativesdk-tzcode is included +# zic is in HOSTTOOLS_NOFATAL +DEPENDS = "" + +do_compile () { + for zone in ${TZONES}; do \ + zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \ + ${S}/${zone} ; \ + zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \ + ${S}/${zone} ; \ + zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \ + ${S}/${zone} ; \ + done +} diff --git a/meta-openeuler/recipes-core/tzdata/tzdata_2021e.bb b/meta-openeuler/recipes-core/tzdata/tzdata_2021e.bb deleted file mode 100644 index b580ac4cc6feb8f586aac75fb55b2c670d7e9088..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/tzdata/tzdata_2021e.bb +++ /dev/null @@ -1,210 +0,0 @@ -require timezone.inc - -DEPENDS = "tzcode-native" - -#inherit allarch - -RCONFLICTS_${PN} = "timezones timezone-africa timezone-america timezone-antarctica \ - timezone-arctic timezone-asia timezone-atlantic \ - timezone-australia timezone-europe timezone-indian \ - timezone-iso3166.tab timezone-pacific timezone-zone.tab" - -S = "${WORKDIR}" - -DEFAULT_TIMEZONE ?= "Universal" -INSTALL_TIMEZONE_FILE ?= "1" - -TZONES= "africa antarctica asia australasia europe northamerica southamerica \ - factory etcetera backward \ - " -# pacificnew - -do_compile () { - for zone in ${TZONES}; do \ - ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \ - ${S}/${zone} ; \ - ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \ - ${S}/${zone} ; \ - ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \ - ${S}/${zone} ; \ - done -} - -do_install () { - install -d ${D}/$exec_prefix ${D}${datadir}/zoneinfo - cp -pPR ${S}/$exec_prefix ${D}/ - # libc is removing zoneinfo files from package - cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo - cp -pP "${S}/zone1970.tab" ${D}${datadir}/zoneinfo - cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo - cp -pP "${S}/leapseconds" ${D}${datadir}/zoneinfo - cp -pP "${S}/leap-seconds.list" ${D}${datadir}/zoneinfo - - # Install default timezone - if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then - install -d ${D}${sysconfdir} - if [ "${INSTALL_TIMEZONE_FILE}" = "1" ]; then - echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone - fi - ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime - else - bberror "DEFAULT_TIMEZONE is set to an invalid value." - exit 1 - fi - - chown -R root:root ${D} -} - -pkg_postinst_${PN} () { - etc_lt="$D${sysconfdir}/localtime" - src="$D${sysconfdir}/timezone" - - if [ -e ${src} ] ; then - tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}") - fi - - if [ ! -z "${tz}" -a ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then - echo "You have an invalid TIMEZONE setting in ${src}" - echo "Your ${etc_lt} has been reset to Universal; enjoy!" - tz="Universal" - echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}" - if [ -L ${etc_lt} ] ; then - rm -f "${etc_lt}" - fi - ln -s "${datadir}/zoneinfo/${tz}" "${etc_lt}" - fi -} - -# Packages primarily organized by directory with a major city -# in most time zones in the base package - -TZ_PACKAGES = " \ - tzdata-core tzdata-misc tzdata-posix tzdata-right tzdata-africa \ - tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \ - tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific" -PACKAGES = "${TZ_PACKAGES} ${PN}" - -FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*" -RPROVIDES_tzdata-africa = "tzdata-africa" - -FILES_tzdata-americas += "${datadir}/zoneinfo/America/* \ - ${datadir}/zoneinfo/US/* \ - ${datadir}/zoneinfo/Brazil/* \ - ${datadir}/zoneinfo/Canada/* \ - ${datadir}/zoneinfo/Mexico/* \ - ${datadir}/zoneinfo/Chile/*" -RPROVIDES_tzdata-americas = "tzdata-americas" - -FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*" -RPROVIDES_tzdata-antarctica = "tzdata-antarctica" - -FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*" -RPROVIDES_tzdata-arctic = "tzdata-arctic" - -FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/* \ - ${datadir}/zoneinfo/Indian/* \ - ${datadir}/zoneinfo/Mideast/*" -RPROVIDES_tzdata-asia = "tzdata-asia" - -FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*" -RPROVIDES_tzdata-atlantic = "tzdata-atlantic" - -FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*" -RPROVIDES_tzdata-australia = "tzdata-australia" - -FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*" -RPROVIDES_tzdata-europe = "tzdata-europe" - -FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*" -RPROVIDES_tzdata-pacific = "tzdata-pacific" - -FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*" -RPROVIDES_tzdata-posix = "tzdata-posix" - -FILES_tzdata-right += "${datadir}/zoneinfo/right/*" -RPROVIDES_tzdata-right = "tzdata-right" - -FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba \ - ${datadir}/zoneinfo/Egypt \ - ${datadir}/zoneinfo/Eire \ - ${datadir}/zoneinfo/Factory \ - ${datadir}/zoneinfo/GB-Eire \ - ${datadir}/zoneinfo/Hongkong \ - ${datadir}/zoneinfo/Iceland \ - ${datadir}/zoneinfo/Iran \ - ${datadir}/zoneinfo/Israel \ - ${datadir}/zoneinfo/Jamaica \ - ${datadir}/zoneinfo/Japan \ - ${datadir}/zoneinfo/Kwajalein \ - ${datadir}/zoneinfo/Libya \ - ${datadir}/zoneinfo/Navajo \ - ${datadir}/zoneinfo/Poland \ - ${datadir}/zoneinfo/Portugal \ - ${datadir}/zoneinfo/Singapore \ - ${datadir}/zoneinfo/Turkey" -RPROVIDES_tzdata-misc = "tzdata-misc" - -FILES_tzdata-core += " \ - ${sysconfdir}/localtime \ - ${sysconfdir}/timezone \ - ${datadir}/zoneinfo/leapseconds \ - ${datadir}/zoneinfo/leap-seconds.list \ - ${datadir}/zoneinfo/Pacific/Honolulu \ - ${datadir}/zoneinfo/America/Anchorage \ - ${datadir}/zoneinfo/America/Los_Angeles \ - ${datadir}/zoneinfo/America/Denver \ - ${datadir}/zoneinfo/America/Chicago \ - ${datadir}/zoneinfo/America/New_York \ - ${datadir}/zoneinfo/America/Caracas \ - ${datadir}/zoneinfo/America/Sao_Paulo \ - ${datadir}/zoneinfo/Europe/London \ - ${datadir}/zoneinfo/Europe/Paris \ - ${datadir}/zoneinfo/Africa/Cairo \ - ${datadir}/zoneinfo/Europe/Moscow \ - ${datadir}/zoneinfo/Asia/Dubai \ - ${datadir}/zoneinfo/Asia/Karachi \ - ${datadir}/zoneinfo/Asia/Dhaka \ - ${datadir}/zoneinfo/Asia/Bangkok \ - ${datadir}/zoneinfo/Asia/Hong_Kong \ - ${datadir}/zoneinfo/Asia/Tokyo \ - ${datadir}/zoneinfo/Australia/Darwin \ - ${datadir}/zoneinfo/Australia/Adelaide \ - ${datadir}/zoneinfo/Australia/Brisbane \ - ${datadir}/zoneinfo/Australia/Sydney \ - ${datadir}/zoneinfo/Pacific/Noumea \ - ${datadir}/zoneinfo/CET \ - ${datadir}/zoneinfo/CST6CDT \ - ${datadir}/zoneinfo/EET \ - ${datadir}/zoneinfo/EST \ - ${datadir}/zoneinfo/EST5EDT \ - ${datadir}/zoneinfo/GB \ - ${datadir}/zoneinfo/GMT \ - ${datadir}/zoneinfo/GMT+0 \ - ${datadir}/zoneinfo/GMT-0 \ - ${datadir}/zoneinfo/GMT0 \ - ${datadir}/zoneinfo/Greenwich \ - ${datadir}/zoneinfo/HST \ - ${datadir}/zoneinfo/MET \ - ${datadir}/zoneinfo/MST \ - ${datadir}/zoneinfo/MST7MDT \ - ${datadir}/zoneinfo/NZ \ - ${datadir}/zoneinfo/NZ-CHAT \ - ${datadir}/zoneinfo/PRC \ - ${datadir}/zoneinfo/PST8PDT \ - ${datadir}/zoneinfo/ROC \ - ${datadir}/zoneinfo/ROK \ - ${datadir}/zoneinfo/UCT \ - ${datadir}/zoneinfo/UTC \ - ${datadir}/zoneinfo/Universal \ - ${datadir}/zoneinfo/W-SU \ - ${datadir}/zoneinfo/WET \ - ${datadir}/zoneinfo/Zulu \ - ${datadir}/zoneinfo/zone.tab \ - ${datadir}/zoneinfo/zone1970.tab \ - ${datadir}/zoneinfo/iso3166.tab \ - ${datadir}/zoneinfo/Etc/*" - -CONFFILES_tzdata-core = "${sysconfdir}/localtime ${sysconfdir}/timezone" - -ALLOW_EMPTY_${PN} = "1" -RDEPENDS_${PN} = "${TZ_PACKAGES}" diff --git a/meta-openeuler/recipes-core/update-rc.d/files/update-rc.d b/meta-openeuler/recipes-core/update-rc.d/files/update-rc.d new file mode 100644 index 0000000000000000000000000000000000000000..95d1c226b9258491ee27f70a893f0209ac1b2a23 --- /dev/null +++ b/meta-openeuler/recipes-core/update-rc.d/files/update-rc.d @@ -0,0 +1,332 @@ +#!/bin/sh +# +# update-rc.d Update the links in /etc/rc[0-9S].d/ +# +# (c) 2003, 2004 Phil Blundell +# +# SPDX-License-Identifier: GPL-2.0-or-later +# + +initd="/etc/init.d" +etcd="/etc/rc" +notreally=0 +force=0 +dostart=0 +verbose=0 + +usage() +{ + cat >&2 <] remove + update-rc.d [-n] [-r ] [-s] defaults [NN | sNN kNN] + update-rc.d [-n] [-r ] [-s] start|stop NN runlvl [runlvl] [...] . + update-rc.d [-n] [-r ] [-s] enable|disable [S|2|3|4|5] + -n: not really + -f: force + -v: verbose + -r: alternate root path (default is /) + -s: invoke start methods if appropriate to current runlevel +EOF +} + +checklinks() +{ + local i dn fn remove=0 + if [ "x$1" = "xremove" ]; then + echo " Removing any system startup links for $bn ..." + remove=1 + fi + + for i in 0 1 2 3 4 5 6 7 8 9 S; do + dn="${etcd}${i}.d" + if [ ! -d $dn ]; then + continue; + fi + for f in ${dn}/[SK]??${bn}; do + if [ -L $f ]; then + if [ $remove -eq 0 ]; then + return 1 + fi + echo " $f" + if [ $notreally -eq 1 ]; then + continue + fi + rm $f + fi + done + done + + return 0 +} + +dolink() +{ + startstop=$1 + lev=`echo $2 | cut -d/ -f1` + nn=`echo $2 | cut -d/ -f2` + fn="${etcd}${lev}.d/${startstop}${nn}${bn}" + [ $verbose -eq 1 ] && echo " $fn -> ../init.d/$bn" + if [ $notreally -eq 0 ]; then + mkdir -p `dirname $fn` + ln -s ../init.d/$bn $fn + fi + if [ $dostart -eq 1 ] && [ $startstop = "S" ] && [ $lev = $RUNLEVEL ]; then + $fn start || true + fi +} + +makelinks() +{ + if ! checklinks; then + echo " System startup links for $initd/$bn already exist." + if [ $dostart -eq 1 ] && [ $notreally -eq 0 ] && [ -L ${etcd}${RUNLEVEL}.d/S??${bn} ]; then + ${etcd}${RUNLEVEL}.d/S??${bn} restart || true + fi + exit 0 + fi + + echo " Adding system startup for $initd/$bn." + + for i in $startlinks; do + dolink S $i + done + for i in $stoplinks; do + dolink K $i + done +} + +# function to disable/enable init script link of one run level +# $1 should be K/S, means to disable/enable +# $2 means which run level to disable/enable +renamelink() +{ + local oldstartstop newstartstop lev oldnn newnn + if [ "x$1" = "xS" ]; then + oldstartstop="K" + newstartstop="S" + else + oldstartstop="S" + newstartstop="K" + fi + + lev=$2 + # modifies existing runlevel links for the script /etc/init.d/name by renaming start links to stop link + # or stop link to start link with a sequence number equal to the difference of 100 minus the original sequence number. + if ls ${etcd}${lev}.d/${oldstartstop}*${bn} >/dev/null 2>&1; then + oldnn=`basename ${etcd}${lev}.d/${oldstartstop}*${bn}|cut -c2-3` + newnn=$(printf "%02d" $((100-${oldnn#0}))) + [ $verbose -eq 1 ] && echo "rename ${etcd}${lev}.d/${oldstartstop}${oldnn}${bn} -> ${etcd}${lev}.d/${newstartstop}${newnn}${bn}" + if [ $notreally -eq 0 ];then + mv ${etcd}${lev}.d/${oldstartstop}${oldnn}${bn} ${etcd}${lev}.d/${newstartstop}${newnn}${bn} + fi + if [ $dostart -eq 1 ] && [ $newstartstop = "S" ] && [ $lev = $RUNLEVEL ]; then + $fn start || true + fi + fi + +} + +# function to disable/enable init script link +# $1 should be K/S, means to disable/enable +# $2 run level [S|2|3|4|5], optional, If no start runlevel is +# specified after the disable or enable keywords +# the script will attempt to modify links in all start runlevels +renamelinks() +{ + if [ $# -eq 2 ]; then + renamelink $1 $2 + else + for i in 2 3 4 5 S; do + renamelink $1 $i + done + fi +} + +while [ $# -gt 0 ]; do + case $1 in + -n) notreally=1 + shift + continue + ;; + -v) verbose=1 + shift + continue + ;; + -f) force=1 + shift + continue + ;; + -s) dostart=1 + shift + continue + ;; + -r) shift + root=$1 + initd="${root}${initd}" + etcd="${root}${etcd}" + shift + ;; + -h | --help) + usage + exit 0 + ;; + -*) + usage + exit 1 + ;; + *) + break + ;; + esac +done + +if [ $# -lt 2 ]; then + usage + exit 1 +fi + +bn=$1 +shift + +sn=$initd/$bn +if [ -L "$sn" -a -n "$root" ]; then + if which readlink >/dev/null; then + while true; do + linksn="$(readlink "$sn")" + if [ -z "$linksn" ]; then + break + fi + + sn="$linksn" + case "$sn" in + /*) sn="$root$sn" ;; + *) sn="$initd/$sn" ;; + esac + done + else + echo "update-rc.d: readlink tool not present, cannot check whether \ + $sn symlink points to a valid file." >&2 + fi +fi + +if [ $1 != "remove" ]; then + if [ ! -f "$sn" ]; then + echo "update-rc.d: $initd/$bn: file does not exist" >&2 + exit 1 + fi +else + if [ -f "$sn" ]; then + if [ $force -eq 1 ]; then + echo "update-rc.d: $initd/$bn exists during rc.d purge (continuing)" >&2 + else + echo "update-rc.d: $initd/$bn exists during rc.d purge (use -f to force)" >&2 + exit 1 + fi + fi +fi + +if [ $dostart -eq 1 ]; then + #RUNLEVEL=`sed 's/.*\[\(.*\)\]/\1/' < /proc/1/cmdline` + RUNLEVEL=`runlevel | cut -d" " -f2` + if [ "x$RUNLEVEL" = "x" ]; then + echo "Unable to determine current runlevel" >&2 + exit 1 + fi +fi + +case $1 in + remove) + checklinks "remove" + ;; + + defaults) + if [ $# -gt 3 ]; then + echo "defaults takes only one or two arguments" >&2 + usage + exit 1 + fi + start=20 + stop=20 + if [ $# -gt 1 ]; then + start=$2 + stop=$2 + fi + if [ $# -gt 2 ]; then + stop=$3 + fi + start=`printf %02d $start` + stop=`printf %02d $stop` + stoplinks="0/$stop 1/$stop 6/$stop" + startlinks="2/$start 3/$start 4/$start 5/$start" + makelinks + ;; + + start | stop) + if [ $# -lt 4 ] + then + echo "Not enough arguments" + usage + exit 1 + fi + + while [ $# -gt 0 ]; do + if [ $1 = "start" ]; then + letter=S + elif [ $1 = "stop" ]; then + letter=K + else + echo "expected start or stop" >&2 + usage + exit 1 + fi + shift + NN=`printf %02d $(expr $1 + 0)` + shift + while [ "x$1" != "x." ]; do + if [ $# -eq 0 ]; then + echo "action with list of runlevels not terminated by \`.'" >&2 + exit 1 + fi + level=$1 + shift + case $letter in + S) startlinks="$startlinks $level/$NN" ;; + K) stoplinks="$stoplinks $level/$NN" ;; + esac + done + shift + done + makelinks + ;; + + enable | disable) + if [ $1 = "enable" ]; then + letter=S + elif [ $1 = "disable" ]; then + letter=K + else + usage + exit 1 + fi + shift + # + if [ $# -gt 0 ] + then + case $1 in + S|2|3|4|5) + renamelinks $letter $1 + ;; + *) + usage + exit 1 + ;; + esac + else + renamelinks $letter + fi + ;; + *) + usage + exit 1 + ;; +esac diff --git a/meta-openeuler/recipes-core/update-rc.d/update-rc.d_%.bbappend b/meta-openeuler/recipes-core/update-rc.d/update-rc.d_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..4f962d03373858689227a4a3dce86c037f85c347 --- /dev/null +++ b/meta-openeuler/recipes-core/update-rc.d/update-rc.d_%.bbappend @@ -0,0 +1,14 @@ +# main bbfile: yocto-poky/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb + +# update-rc.d does not require code download, to avoid the conflict of update-rc.d folder +# (set by DL_DIR ?= "${OPENEULER_SP_DIR}/${BPN}" ) +# and update-rc.d script file (with update-rc.d_0.8.bb ), +OPENEULER_REPO_NAME = "update-rc.d_dummy" + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI = "file://update-rc.d" + +SRC_URI[sha256sum] = "5426fe8d447719957b51bdce842fb857816a6d5cd5053f7586ffbf66b48111d2" + +S = "${WORKDIR}" diff --git a/meta-openeuler/recipes-core/util-linux/util-linux-libuuid_%.bbappend b/meta-openeuler/recipes-core/util-linux/util-linux-libuuid_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7a029337dd3616003137eb57f5676cab45ee289e --- /dev/null +++ b/meta-openeuler/recipes-core/util-linux/util-linux-libuuid_%.bbappend @@ -0,0 +1,4 @@ +require util-linux_src.inc + +# code is the same with util-linux +OPENEULER_REPO_NAME = "util-linux" diff --git a/meta-openeuler/recipes-core/util-linux/util-linux.inc b/meta-openeuler/recipes-core/util-linux/util-linux.inc deleted file mode 100644 index 09fe0d8a61d88cc3cb96d8b16d47afe0e80f5a36..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/util-linux/util-linux.inc +++ /dev/null @@ -1,44 +0,0 @@ -SUMMARY = "A suite of basic system administration utilities" -HOMEPAGE = "https://en.wikipedia.org/wiki/Util-linux" -DESCRIPTION = "Util-linux includes a suite of basic system administration utilities \ -commonly found on most Linux systems. Some of the more important utilities include \ -disk partitioning, kernel message management, filesystem creation, and system login." - -SECTION = "base" - -LICENSE = "GPLv2+ & LGPLv2.1+ & BSD-3-Clause & BSD-4-Clause" -LICENSE_${PN}-libblkid = "LGPLv2.1+" -LICENSE_${PN}-libfdisk = "LGPLv2.1+" -LICENSE_${PN}-libmount = "LGPLv2.1+" -LICENSE_${PN}-libsmartcols = "LGPLv2.1+" - -LIC_FILES_CHKSUM = "file://README.licensing;md5=0fd5c050c6187d2bf0a4492b7f4e33da \ - file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://Documentation/licenses/COPYING.GPL-2.0-or-later;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://Documentation/licenses/COPYING.LGPL-2.1-or-later;md5=4fbd65380cdd255951079008b364516c \ - file://Documentation/licenses/COPYING.BSD-3-Clause;md5=58dcd8452651fc8b07d1f65ce07ca8af \ - file://Documentation/licenses/COPYING.BSD-4-Clause-UC;md5=263860f8968d8bafa5392cab74285262 \ - file://libuuid/COPYING;md5=6d2cafc999feb2c2de84d4d24b23290c \ - file://libmount/COPYING;md5=7c7e39fb7d70ffe5d693a643e29987c2 \ - file://libblkid/COPYING;md5=693bcbbe16d3a4a4b37bc906bc01cc04 \ - file://libfdisk/COPYING;md5=693bcbbe16d3a4a4b37bc906bc01cc04 \ - file://libsmartcols/COPYING;md5=693bcbbe16d3a4a4b37bc906bc01cc04 \ -" - -FILESEXTRAPATHS_prepend := "${THISDIR}/util-linux:" -MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}" -SRC_URI = "file://util-linux/util-linux-${PV}.tar.xz \ - file://util-linux/2.36-login-lastlog-create.patch \ - file://util-linux/backport-CVE-2021-3995.patch \ - file://util-linux/backport-CVE-2021-3996.patch \ - file://util-linux/realloc-buffer-when-header-size-changed.patch \ - file://util-linux/fix-size-use-for-stdin.patch \ - file://util-linux/segmentation-fault-on-invalid-unicode-input-passed-to-s-option.patch \ - file://util-linux/backport-fix-by-ignoring-EINVAL-on-remount-of-proc.patch \ - file://util-linux/Add-check-to-resolve-uname26-version-test-failed.patch \ - file://util-linux/SKIPPED-no-root-permissions-test.patch \ - file://runuser.pamd \ - file://runuser-l.pamd \ - " - -SRC_URI[sha256sum] = "6a0764c1aae7fb607ef8a6dd2c0f6c47d5e5fd27aa08820abaad9ec14e28e9d9 " diff --git a/meta-openeuler/recipes-core/util-linux/util-linux/run-ptest b/meta-openeuler/recipes-core/util-linux/util-linux/run-ptest deleted file mode 100644 index e135ee583bd31de92d4ff413fbf7293e674298b3..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/util-linux/util-linux/run-ptest +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - - -# When udevd (from eudev) is running most eject/mount tests will fail because -# of automount. We need to stop udevd before executing util-linux's tests. -# The systemd-udevd daemon doesn't change the outcome of util-linux's tests. -UDEV_PID="`pidof "@base_sbindir@/udevd"`" -if [ "x$UDEV_PID" != "x" ]; then - /etc/init.d/udev stop -fi - -current_path=$(readlink -f $0) -export bindir=$(dirname $current_path) -export PATH=$bindir/bin:$PATH - -cd tests || exit 1 - -comps=$(find ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort) - - -echo -echo "-------------------- util-linux regression tests --------------------" -echo -echo " For development purpose only. " -echo " Don't execute on production system! " -echo - -res=0 -count=0 -for ts in $comps; -do - $ts | sed -u '{ - s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/ - s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/ - s/^\(.*\):\(.*\) \.\.\. SKIPPED \(.*\)$/SKIP: \1:\2 \3/ - }' -done - - -if [ "x$UDEV_PID" != "x" ]; then - /etc/init.d/udev start -fi - diff --git a/meta-openeuler/recipes-core/util-linux/util-linux/runuser-l.pamd b/meta-openeuler/recipes-core/util-linux/util-linux/runuser-l.pamd deleted file mode 100644 index 4b368ccf5de8f74b42e8177911fed5f03135c8d1..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/util-linux/util-linux/runuser-l.pamd +++ /dev/null @@ -1,3 +0,0 @@ -auth include runuser -session optional pam_keyinit.so force revoke -session include runuser diff --git a/meta-openeuler/recipes-core/util-linux/util-linux/runuser.pamd b/meta-openeuler/recipes-core/util-linux/util-linux/runuser.pamd deleted file mode 100644 index 48d133b9e7e46cea183afe5591f653773176c80c..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/util-linux/util-linux/runuser.pamd +++ /dev/null @@ -1,4 +0,0 @@ -auth sufficient pam_rootok.so -session optional pam_keyinit.so revoke -session required pam_limits.so -session required pam_unix.so diff --git a/meta-openeuler/recipes-core/util-linux/util-linux_%.bbappend b/meta-openeuler/recipes-core/util-linux/util-linux_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3667ab9a2b3a35159407b48355f088f3b2f064b5 --- /dev/null +++ b/meta-openeuler/recipes-core/util-linux/util-linux_%.bbappend @@ -0,0 +1 @@ +require util-linux_src.inc diff --git a/meta-openeuler/recipes-core/util-linux/util-linux_2.37.2.bb b/meta-openeuler/recipes-core/util-linux/util-linux_2.37.2.bb deleted file mode 100644 index b2acdf008b36ac7d9c2cdb89e18ceda62b60699f..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/util-linux/util-linux_2.37.2.bb +++ /dev/null @@ -1,323 +0,0 @@ -require util-linux.inc - -#gtk-doc is not enabled as it requires xmlto which requires util-linux -inherit autotools gettext pkgconfig systemd -DEPENDS = "libcap-ng ncurses zlib" - -PACKAGES =+ "${PN}-swaponoff" -PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', '${PN}-pylibmount', '', d)}" - -python util_linux_binpackages () { - def pkg_hook(f, pkg, file_regex, output_pattern, modulename): - pn = d.getVar('PN') - d.appendVar('RRECOMMENDS_%s' % pn, ' %s' % pkg) - - if d.getVar('ALTERNATIVE_' + pkg): - return - if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename): - d.setVar('ALTERNATIVE_' + pkg, modulename) - - bindirs = sorted(list(set(d.expand("${base_sbindir} ${base_bindir} ${sbindir} ${bindir}").split()))) - for dir in bindirs: - do_split_packages(d, root=dir, - file_regex=r'(.*)', output_pattern='${PN}-%s', - description='${PN} %s', - hook=pkg_hook, extra_depends='') - - # There are some symlinks for some binaries which we have ignored - # above. Add them to the package owning the binary they are - # pointing to - extras = {} - dvar = d.getVar('PKGD') - for root in bindirs: - for walkroot, dirs, files in os.walk(dvar + root): - for f in files: - file = os.path.join(walkroot, f) - if not os.path.islink(file): - continue - - pkg = os.path.basename(os.readlink(file)) - extras[pkg] = extras.get(pkg, '') + ' ' + file.replace(dvar, '', 1) - - pn = d.getVar('PN') - for pkg, links in extras.items(): - of = d.getVar('FILES_' + pn + '-' + pkg) - links = of + links - d.setVar('FILES_' + pn + '-' + pkg, links) -} - -# we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS -PACKAGE_PREPROCESS_FUNCS =+ "util_linux_binpackages " - -python util_linux_libpackages() { - do_split_packages(d, root=d.getVar('UTIL_LINUX_LIBDIR'), file_regex=r'^lib(.*)\.so\..*$', - output_pattern='${PN}-lib%s', - description='${PN} lib%s', - extra_depends='', prepend=True, allow_links=True) -} - -PACKAGESPLITFUNCS =+ "util_linux_libpackages" - -PACKAGES_DYNAMIC = "^${PN}-.*" - -CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms" -UTIL_LINUX_LIBDIR = "${libdir}" -UTIL_LINUX_LIBDIR_class-target = "${base_libdir}" -EXTRA_OECONF = "\ - --enable-libuuid --enable-libblkid \ - \ - --enable-fsck --enable-kill --enable-last --enable-mesg \ - --enable-mount --enable-partx --enable-raw --enable-rfkill \ - --enable-unshare --enable-write \ - \ - --disable-bfs --disable-chfn-chsh --disable-login \ - --disable-makeinstall-chown --disable-minix --disable-newgrp \ - --disable-use-tty-group --disable-vipw \ - \ - --without-udev \ - \ - usrsbin_execdir='${sbindir}' \ - --libdir='${UTIL_LINUX_LIBDIR}' \ -" - -EXTRA_OECONF_append_class-target = " --enable-setpriv" -EXTRA_OECONF_append_class-native = " --without-cap-ng --disable-setpriv" -EXTRA_OECONF_append_class-nativesdk = " --without-cap-ng --disable-setpriv" -EXTRA_OECONF_append = " --disable-hwclock-gplv3" - -# enable pcre2 for native/nativesdk to match host distros -# this helps to keep same expectations when using the SDK or -# build host versions during development -# -PACKAGECONFIG ?= "pcre2" -PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" -# inherit manpages requires this to be present, however util-linux does not have -# configuration options, and installs manpages always -PACKAGECONFIG[manpages] = "" -PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam," -# Respect the systemd feature for uuidd -PACKAGECONFIG[systemd] = "--with-systemd --with-systemdsystemunitdir=${systemd_system_unitdir}, --without-systemd --without-systemdsystemunitdir,systemd" -# Build python bindings for libmount -PACKAGECONFIG[pylibmount] = "--with-python=3 --enable-pylibmount,--without-python --disable-pylibmount,python3" -# Readline support -PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline" -# PCRE support in hardlink -PACKAGECONFIG[pcre2] = ",,libpcre2" -PACKAGECONFIG[cryptsetup] = "--with-cryptsetup,--without-cryptsetup,cryptsetup" - -EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'" - -ALLOW_EMPTY_${PN} = "1" -FILES_${PN} = "" -FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*" -FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la" -FILES_${PN}-mount = "${sysconfdir}/default/mountall" -FILES_${PN}-runuser = "${sysconfdir}/pam.d/runuser*" -FILES_${PN}-su = "${sysconfdir}/pam.d/su-l" -CONFFILES_${PN}-su = "${sysconfdir}/pam.d/su-l" -FILES_${PN}-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \ - ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \ - ${PYTHON_SITEPACKAGES_DIR}/libmount/__pycache__/*" -PACKAGES += "${PN}-bash-completion ${PN}-procps" -FILES_${PN}-bash-completion += "${datadir}/bash-completion/*" -FILES_${PN}-procps = "${base_bindir}/kill" -# Util-linux' blkid replaces the e2fsprogs one -RCONFLICTS_${PN}-blkid = "${MLPREFIX}e2fsprogs-blkid" -RREPLACES_${PN}-blkid = "${MLPREFIX}e2fsprogs-blkid" - -RRECOMMENDS_${PN}_class-native = "" -RRECOMMENDS_${PN}_class-nativesdk = "" -RDEPENDS_${PN}_class-native = "" -RDEPENDS_${PN}_class-nativesdk = "" - -RPROVIDES_${PN}-dev = "${PN}-libblkid-dev ${PN}-libmount-dev" - -RDEPENDS_${PN}-bash-completion += "${PN}-lsblk" -RDEPENDS_${PN}-ptest += "bash bc btrfs-tools coreutils e2fsprogs grep iproute2 kmod mdadm procps sed socat which xz" -RRECOMMENDS_${PN}-ptest += "kernel-module-scsi-debug" -RDEPENDS_${PN}-swaponoff = "${PN}-swapon ${PN}-swapoff" -ALLOW_EMPTY_${PN}-swaponoff = "1" - -SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.socket uuidd.service" -SYSTEMD_AUTO_ENABLE_${PN}-uuidd = "disable" -SYSTEMD_SERVICE_${PN}-fstrim = "fstrim.timer fstrim.service" -SYSTEMD_AUTO_ENABLE_${PN}-fstrim = "disable" - -do_install () { - # with ccache the timestamps on compiled files may - # end up earlier than on their inputs, this allows - # for the resultant compilation in the install step. - oe_runmake 'CC=${CC}' 'LD=${LD}' \ - 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install - - mkdir -p ${D}${base_bindir} - - sbinprogs="agetty ctrlaltdel cfdisk vipw vigr" - sbinprogs_a="pivot_root hwclock mkswap losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin" - binprogs_a="dmesg getopt kill more umount mount login su mountpoint" - - if [ "${base_sbindir}" != "${sbindir}" ]; then - mkdir -p ${D}${base_sbindir} - for p in $sbinprogs $sbinprogs_a; do - if [ -f "${D}${sbindir}/$p" ]; then - mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p" - fi - done - fi - - if [ "${base_bindir}" != "${bindir}" ]; then - mkdir -p ${D}${base_bindir} - for p in $binprogs_a; do - if [ -f "${D}${bindir}/$p" ]; then - mv "${D}${bindir}/$p" "${D}${base_bindir}/$p" - fi - done - fi - - install -d ${D}${sysconfdir}/default/ - echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall - - rm -f ${D}${bindir}/chkdupexe -} - -do_install_append_class-target () { - if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then - install -d ${D}${sysconfdir}/pam.d - install -m 0644 ${WORKDIR}/runuser.pamd ${D}${sysconfdir}/pam.d/runuser - install -m 0644 ${WORKDIR}/runuser-l.pamd ${D}${sysconfdir}/pam.d/runuser-l - # Required for "su -" aka "su --login" because - # otherwise it uses "other", which has "auth pam_deny.so" - # and thus prevents the operation. - ln -s su ${D}${sysconfdir}/pam.d/su-l - fi -} -# nologin causes a conflict with shadow-native -# kill causes a conflict with coreutils-native (if ${bindir}==${base_bindir}) -do_install_append_class-native () { - rm -f ${D}${base_sbindir}/nologin - rm -f ${D}${base_bindir}/kill -} - -ALTERNATIVE_PRIORITY = "80" - -ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" -ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev" -ALTERNATIVE_LINK_NAME[cal] = "${bindir}/cal" -ALTERNATIVE_LINK_NAME[chrt] = "${bindir}/chrt" -ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" -ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject" -ALTERNATIVE_LINK_NAME[fallocate] = "${bindir}/fallocate" -ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk" -ALTERNATIVE_LINK_NAME[flock] = "${bindir}/flock" -ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" -ALTERNATIVE_LINK_NAME[fsfreeze] = "${sbindir}/fsfreeze" -ALTERNATIVE_LINK_NAME[fstrim] = "${base_sbindir}/fstrim" -ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" -ALTERNATIVE_${PN}-agetty = "getty" -ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty" -ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty" -ALTERNATIVE_LINK_NAME[hexdump] = "${bindir}/hexdump" -ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock" -ALTERNATIVE_LINK_NAME[ionice] = "${bindir}/ionice" -ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill" -ALTERNATIVE_${PN}-last = "last lastb" -ALTERNATIVE_LINK_NAME[last] = "${bindir}/last" -ALTERNATIVE_LINK_NAME[lastb] = "${bindir}/lastb" -ALTERNATIVE_LINK_NAME[logger] = "${bindir}/logger" -ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" -ALTERNATIVE_LINK_NAME[mesg] = "${bindir}/mesg" -ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap" -ALTERNATIVE_LINK_NAME[mcookie] = "${bindir}/mcookie" -ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more" -ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount" -ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint" -ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin" -ALTERNATIVE_LINK_NAME[nsenter] = "${bindir}/nsenter" -ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root" -ALTERNATIVE_LINK_NAME[prlimit] = "${bindir}/prlimit" -ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile" -ALTERNATIVE_LINK_NAME[renice] = "${bindir}/renice" -ALTERNATIVE_LINK_NAME[rev] = "${bindir}/rev" -ALTERNATIVE_LINK_NAME[rfkill] = "${sbindir}/rfkill" -ALTERNATIVE_LINK_NAME[rtcwake] = "${sbindir}/rtcwake" -ALTERNATIVE_LINK_NAME[setpriv] = "${bindir}/setpriv" -ALTERNATIVE_LINK_NAME[setsid] = "${bindir}/setsid" -ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su" -ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" -ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff" -ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon" -ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root" -ALTERNATIVE_LINK_NAME[taskset] = "${bindir}/taskset" -ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount" -ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare" -ALTERNATIVE_LINK_NAME[utmpdump] = "${bindir}/utmpdump" -ALTERNATIVE_LINK_NAME[uuidgen] = "${bindir}/uuidgen" -ALTERNATIVE_LINK_NAME[wall] = "${bindir}/wall" - -ALTERNATIVE_${PN}-doc = "\ -blkid.8 eject.1 findfs.8 fsck.8 kill.1 last.1 lastb.1 libblkid.3 logger.1 mesg.1 \ -mountpoint.1 nologin.8 rfkill.8 sulogin.8 utmpdump.1 uuid.3 wall.1\ -" -ALTERNATIVE_${PN}-doc += "${@bb.utils.contains('PACKAGECONFIG', 'pam', 'su.1', '', d)}" - -ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8" -ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1" -ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8" -ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8" -ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" -ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1" -ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1" -ALTERNATIVE_LINK_NAME[libblkid.3] = "${mandir}/man3/libblkid.3" -ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1" -ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1" -ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1" -ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8" -ALTERNATIVE_LINK_NAME[rfkill.8] = "${mandir}/man8/rfkill.8" -ALTERNATIVE_LINK_NAME[setpriv.1] = "${mandir}/man1/setpriv.1" -ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1" -ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8" -ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1" -ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3" -ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1" - - -BBCLASSEXTEND = "native nativesdk" - -PTEST_BINDIR = "1" -do_compile_ptest() { - oe_runmake buildtest-TESTS -} - -do_install_ptest() { - mkdir -p ${D}${PTEST_PATH}/tests/ts - find . -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; - find ./.libs -name 'sample*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; - find ./.libs -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; - - cp ${S}/tests/*.sh ${D}${PTEST_PATH}/tests/ - cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected - cp -pR ${S}/tests/ts ${D}${PTEST_PATH}/tests/ - cp ${WORKDIR}/build/config.h ${D}${PTEST_PATH} - - # The original paths of executables to be tested point to a local folder containing - # the executables. We want to test the installed executables, not the local copies. - # So strip the paths, the executables will be located via "which" - sed -i \ - -e '/^TS_CMD/ s|$top_builddir/||g' \ - -e '/^TS_HELPER/ s|$top_builddir|${PTEST_PATH}|g' \ - ${D}${PTEST_PATH}/tests/commands.sh - - # Change 'if [ ! -x "$1" ]' to 'if [ ! -x "`which $1 2>/dev/null`"]' - sed -i -e \ - '/^\tif[[:space:]]\[[[:space:]]![[:space:]]-x[[:space:]]"$1"/s|$1|`which $1 2>/dev/null`|g' \ - ${D}${PTEST_PATH}/tests/functions.sh - - # Running "kill" without the the complete path would use the shell's built-in kill - sed -i -e \ - '/^TS_CMD_KILL/ s|kill|${PTEST_PATH}/bin/kill|g' \ - ${D}${PTEST_PATH}/tests/commands.sh - - - sed -i 's|@base_sbindir@|${base_sbindir}|g' ${D}${PTEST_PATH}/run-ptest - -} diff --git a/meta-openeuler/recipes-core/util-linux/util-linux_src.inc b/meta-openeuler/recipes-core/util-linux/util-linux_src.inc new file mode 100644 index 0000000000000000000000000000000000000000..3b6e4a7d306a1aa0b1aea29b78edfa198d458258 --- /dev/null +++ b/meta-openeuler/recipes-core/util-linux/util-linux_src.inc @@ -0,0 +1,61 @@ +PV = "2.37.2" + +# files, patches can't be applied in openeuler or conflict with openeuler +# ptest.patch, patch-fuzz warning +OPENEULER_SRC_URI_REMOVE = "https git http" +SRC_URI_remove += " \ + file://ptest.patch \ + file://avoid_parallel_tests.patch \ + file://Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch \ + file://CVE-2021-37600.patch \ +" + +# files, patches that come from openeuler +SRC_URI_prepend += " \ + file://util-linux-${PV}.tar.xz \ + file://2.36-login-lastlog-create.patch \ + file://backport-CVE-2021-3995.patch \ + file://backport-CVE-2021-3996.patch \ + file://realloc-buffer-when-header-size-changed.patch \ + file://fix-size-use-for-stdin.patch \ + file://segmentation-fault-on-invalid-unicode-input-passed-to-s-option.patch \ + file://backport-fix-by-ignoring-EINVAL-on-remount-of-proc.patch \ + file://backport-su-bash-completion-offer-usernames-rather-than-files.patch \ + file://backport-Fix-memory-leaks-in-the-chcpu.patch \ + file://backport-logger-fix-prio-prefix-doesn-t-use-priority-default.patch \ + file://backport-vipw-flush-stdout-before-getting-answer.patch \ + file://backport-login-Restore-tty-size-after-calling-vhangup.patch \ + file://backport-Forward-value-of-sector_size-instead-of-its-address.patch \ + file://backport-libfdisk-dereference-of-possibly-NULL-gcc-analyzer.patch \ + file://backport-libfdisk-check-calloc-return-gcc-analyzer.patch \ + file://backport-mcookie-fix-infinite-loop-when-use-f.patch \ + file://backport-sfdisk-write-empty-label-also-when-only-ignored-part.patch \ + file://backport-fstat-dir-itself.patch \ + file://backport-libblkid-src-topology-dm-close-redundant-write-file-.patch \ + file://backport-libblkid-topology-init-variables-for-DM.patch \ + file://backport-sfdisk-fix-typo-in-move-data-when-check-partition-size.patch \ + file://backport-losetup-fix-memory-leak-asan.patch \ + file://backport-partx-remove-memory-leak-to-make-scanners-happy-coverity-scan.patch \ + file://backport-lib-path-make-ul_path_read_buffer-more-robust-coverity-scan.patch \ + file://backport-libmount-fix-possible-memory-leak-in-mnt_optstr_fix_secontext-coverity-scan.patch \ + file://backport-libblkid-probe-fix-size-and-offset-overflows-fuzzing.patch \ + file://backport-lslogins-improve-prefixes-interpretation.patch \ + file://backport-lsns-fix-the-memory-leak.patch \ + file://backport-libblkid-check-fsync-return-code.patch \ + file://backport-libblkid-mac-make-sure-block-size-is-large-enough-fuzzing.patch \ + file://backport-libblkid-bsd-fix-buffer-pointer-use-fuzzing.patch \ + file://backport-libblkid-hfs-fix-label-use-fuzzing.patch \ + file://backport-Maybe-there-is-a-little-mistake-in-do_taskset-functi.patch \ + file://backport-lsblk-fix-endless-loop-if-device-specified-more-than-once.patch \ + file://backport-libblkid-avoid-buffer-overflow-in-ocfs-superblock-parsing.patch \ + file://backport-fsck-Processes-may-kill-other-processes.patch \ + file://backport-fdisk-fix-output-option-parsing.patch \ + file://backport-libblkid-exfat-fix-divide-by-zero-coverity-scan.patch \ + file://backport-llib-pty-session-split-PTY-and-signalfd-setup.patch \ + file://backport-script-fix-use-of-utempter.patch \ + file://backport-logger-always-update-header-when-read-from-stdin.patch \ + file://Add-check-to-resolve-uname26-version-test-failed.patch \ + file://SKIPPED-no-root-permissions-test.patch \ +" + +SRC_URI[sha256sum] = "6a0764c1aae7fb607ef8a6dd2c0f6c47d5e5fd27aa08820abaad9ec14e28e9d9" diff --git a/meta-openeuler/recipes-core/xz/xz_5.2.5.bb b/meta-openeuler/recipes-core/xz/xz_5.2.5.bb deleted file mode 100644 index bdcc1020e1a3c816c488cb6ebd607ab002ef37e8..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/xz/xz_5.2.5.bb +++ /dev/null @@ -1,45 +0,0 @@ -SUMMARY = "Utilities for managing LZMA compressed files" -HOMEPAGE = "https://tukaani.org/xz/" -DESCRIPTION = "XZ Utils is free general-purpose data compression software with a high compression ratio. XZ Utils were written for POSIX-like systems, but also work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils." -SECTION = "base" - -# The source includes bits of PD, GPLv2, GPLv3, LGPLv2.1+, but the only file -# which is GPLv3 is an m4 macro which isn't shipped in any of our packages, -# and the LGPL bits are under lib/, which appears to be used for libgnu, which -# appears to be used for DOS builds. So we're left with GPLv2+ and PD. -LICENSE = "GPLv2+ & GPL-3.0-with-autoconf-exception & LGPLv2.1+ & PD" -LICENSE_${PN} = "GPLv2+" -LICENSE_${PN}-dev = "GPLv2+" -LICENSE_${PN}-staticdev = "GPLv2+" -LICENSE_${PN}-doc = "GPLv2+" -LICENSE_${PN}-dbg = "GPLv2+" -LICENSE_${PN}-locale = "GPLv2+" -LICENSE_liblzma = "PD" - -LIC_FILES_CHKSUM = "file://COPYING;md5=97d554a32881fee0aa283d96e47cb24a \ - file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \ - file://COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \ - file://lib/getopt.c;endline=23;md5=2069b0ee710572c03bb3114e4532cd84 \ - " - -SRC_URI = "file://xz/xz-${PV}.tar.xz" -SRC_URI[md5sum] = "0d270c997aff29708c74d53f599ef717" -SRC_URI[sha256sum] = "f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10" -UPSTREAM_CHECK_REGEX = "xz-(?P\d+(\.\d+)+)\.tar" - -CACHED_CONFIGUREVARS += "gl_cv_posix_shell=/bin/sh" - -inherit autotools gettext - -PACKAGES =+ "liblzma" - -FILES_liblzma = "${libdir}/liblzma*${SOLIBS}" - -#inherit update-alternatives - -ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN} = "xz xzcat unxz \ - lzma lzcat unlzma" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-core/yajl/yajl_2.1.0.bb b/meta-openeuler/recipes-core/yajl/yajl_2.1.0.bb deleted file mode 100644 index 5f77805e0972d692c6088eceb28858fe6645182d..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/yajl/yajl_2.1.0.bb +++ /dev/null @@ -1,29 +0,0 @@ -DESCRIPTION = "Yet Another JSON Library - A Portable JSON parsing and serialization library in ANSI C" -LICENSE = "MIT" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" - -SRC_URI = "file://yajl/${PV}.tar.gz \ - file://yajl/yajl-2.1.0-pkgconfig-location.patch \ - file://yajl/yajl-2.1.0-pkgconfig-includedir.patch \ - file://yajl/yajl-2.1.0-test-location.patch \ - file://yajl/yajl-2.1.0-dynlink-binaries.patch \ - file://yajl/yajl-2.1.0-fix-memory-leak.patch \ - file://yajl/backport-fix-memory-leaks.patch \ - " - -S = "${WORKDIR}/${BPN}-${PV}" - -inherit cmake - -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" -INSANE_SKIP_${PN} += "already-stripped" -INSANE_SKIP_${PN} += "dev-so" - -FILES_${PN} += "${libdir}/libyajl.so* " -FILES_SOLIBSDEV = "" - -do_install_append() { - ${STRIP} ${D}/${libdir}/*.so* -} - diff --git a/meta-openeuler/recipes-core/zlib/site_config/headers b/meta-openeuler/recipes-core/zlib/site_config/headers deleted file mode 100644 index 50268918aa9dc01897a12421c3ca3b5d3bc24fe9..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/zlib/site_config/headers +++ /dev/null @@ -1 +0,0 @@ -zlib.h diff --git a/meta-openeuler/recipes-core/zlib/zlib/ldflags-tests.patch b/meta-openeuler/recipes-core/zlib/zlib/ldflags-tests.patch deleted file mode 100644 index 286390665f0229c95653ae9aad7dd24f5fc7e0c1..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/zlib/zlib/ldflags-tests.patch +++ /dev/null @@ -1,45 +0,0 @@ -Obey LDFLAGS for tests - -Upstream-Status: Submitted [https://github.com/madler/zlib/pull/409] -Signed-off-by: Ross Burton - ---- zlib-1.2.8.orig/Makefile.in -+++ zlib-1.2.8/Makefile.in -@@ -26,7 +26,7 @@ CFLAGS=-O - - SFLAGS=-O - LDFLAGS= --TEST_LDFLAGS=-L. libz.a -+TEST_LDFLAGS=-L. $(LDFLAGS) - LDSHARED=$(CC) - CPP=$(CC) -E - -@@ -176,22 +176,22 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz. - -@rmdir objs - - example$(EXE): example.o $(STATICLIB) -- $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) -+ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(STATICLIB) - - minigzip$(EXE): minigzip.o $(STATICLIB) -- $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) -+ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(STATICLIB) - - examplesh$(EXE): example.o $(SHAREDLIBV) -- $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV) -+ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(SHAREDLIBV) - - minigzipsh$(EXE): minigzip.o $(SHAREDLIBV) -- $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV) -+ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(SHAREDLIBV) - - example64$(EXE): example64.o $(STATICLIB) -- $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) -+ $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) $(STATICLIB) - - minigzip64$(EXE): minigzip64.o $(STATICLIB) -- $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) -+ $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) $(STATICLIB) - - install-libs: $(LIBS) - -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi diff --git a/meta-openeuler/recipes-core/zlib/zlib/run-ptest b/meta-openeuler/recipes-core/zlib/zlib/run-ptest deleted file mode 100644 index 065863ef754f0af6f8494135e487c2ed024488b7..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/zlib/zlib/run-ptest +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if ./examplesh ; then - echo "PASS: zlib" -else - echo "FAIL: zlib" -fi diff --git a/meta-openeuler/recipes-core/zlib/zlib_%.bbappend b/meta-openeuler/recipes-core/zlib/zlib_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7c40baba9cf176397b1e6fc40b066bceca5138ca --- /dev/null +++ b/meta-openeuler/recipes-core/zlib/zlib_%.bbappend @@ -0,0 +1,26 @@ +#main bbfile: yocto-poky/meta/recipes-core/zlib/zlib_1.2.11.bb + +#version in openEuler +PV = "1.2.13" + +OPENEULER_SRC_URI_REMOVE = "https git http" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ + file://CVE-2018-25032.patch \ + file://ldflags-tests.patch \ + " +# files, patches that come from openeuler +SRC_URI += " \ + file://${BP}.tar.xz \ + file://backport-zlib-1.2.5-minizip-fixuncrypt.patch \ + file://backport-fix-undefined-buffer-detected-by-oss-fuzz.patch \ + " + +# files, patches that come from openeuler for aarch64, there are compile err in 0004-zlib-Optimize-CRC32.patch, not apply +SRC_URI_append_aarch64 += " \ + file://zlib-1.2.11-SIMD.patch \ + " + +SRC_URI[tarball.md5sum] = "85adef240c5f370b308da8c938951a68" +SRC_URI[tarball.sha256sum] = "4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066" diff --git a/meta-openeuler/recipes-core/zlib/zlib_1.2.11.bb b/meta-openeuler/recipes-core/zlib/zlib_1.2.11.bb deleted file mode 100644 index 11e045e70cb3857901417f5f2a498d5f8d2c2153..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-core/zlib/zlib_1.2.11.bb +++ /dev/null @@ -1,51 +0,0 @@ -SUMMARY = "Zlib Compression Library" -DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \ -library which is used by many different programs." -HOMEPAGE = "http://zlib.net/" -SECTION = "libs" -LICENSE = "Zlib" -LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef63bc555f7aa6c0" - -S = "${WORKDIR}/${BPN}-${PV}" -SRC_URI = "file://${BPN}/${BPN}-${PV}.tar.xz \ - " -UPSTREAM_CHECK_URI = "http://zlib.net/" - -SRC_URI[md5sum] = "85adef240c5f370b308da8c938951a68" -SRC_URI[sha256sum] = "4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066" - -CFLAGS += "-D_REENTRANT" - -RDEPENDS_${PN}-ptest += "make" - -inherit ptest - -do_configure() { - LDCONFIG=true ./configure --prefix=${prefix} --shared --libdir=${libdir} --uname=GNU -} - -do_compile() { - oe_runmake shared -} - -do_install() { - oe_runmake DESTDIR=${D} install -} - -do_install_ptest() { - install ${B}/examplesh ${D}${PTEST_PATH} -} - -# Move zlib shared libraries for target builds to $base_libdir so the library -# can be used in early boot before $prefix is mounted. -do_install_append_class-target() { - if [ ${base_libdir} != ${libdir} ] - then - mkdir -p ${D}/${base_libdir} - mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir} - libname=`readlink ${D}/${libdir}/libz.so` - ln -sf ${@oe.path.relative("${libdir}", "${base_libdir}")}/$libname ${D}${libdir}/libz.so - fi -} - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-crypto/libsodium/libsodium_%.bbappend b/meta-openeuler/recipes-crypto/libsodium/libsodium_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7f1b585c50fd22ee103993bc167d8d58a3af9f0b --- /dev/null +++ b/meta-openeuler/recipes-crypto/libsodium/libsodium_%.bbappend @@ -0,0 +1,15 @@ +# main bbfile: yocto-meta-openembedded/meta-oe/recipes-crypto/libsodium/libsodium_1.0.18.bb + +OPENEULER_BRANCH = "master" +OPENEULER_SRC_URI_REMOVE = "git https http" + +PV = "1.0.18" + +SRC_URI_append = " \ + file://libsodium-${PV}.tar.gz \ +" + +SRC_URI[md5sum] = "3ca9ebc13b6b4735acae0a6a4c4f9a95" +SRC_URI[sha256sum] = "6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1" + +S = "${WORKDIR}/libsodium-${PV}" diff --git a/meta-openeuler/recipes-devtools/autoconf-archive/autoconf-archive_%.bbappend b/meta-openeuler/recipes-devtools/autoconf-archive/autoconf-archive_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ac5aa8dc87faaeb345e4e3fe0848dcb4000bdaf7 --- /dev/null +++ b/meta-openeuler/recipes-devtools/autoconf-archive/autoconf-archive_%.bbappend @@ -0,0 +1,4 @@ +PV = "2023.02.20" + +SRC_URI[md5sum] = "1a9ee97d3503d134e16c87c4fa1119cf" +SRC_URI[sha256sum] = "71d4048479ae28f1f5794619c3d72df9c01df49b1c628ef85fde37596dc31a33" diff --git a/meta-openeuler/recipes-devtools/binutils/binutils-2.37.inc b/meta-openeuler/recipes-devtools/binutils/binutils-2.37.inc deleted file mode 100644 index bc67ef9a0169a513a431dd50e13f0c49299d8a01..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/binutils/binutils-2.37.inc +++ /dev/null @@ -1,37 +0,0 @@ -LIC_FILES_CHKSUM="\ - file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ - file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\ - file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\ - file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\ - file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\ - file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\ - file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\ - file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\ - file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\ - " - -def binutils_branch_version(d): - pvsplit = d.getVar('PV').split('.') - return pvsplit[0] + "_" + pvsplit[1] - -# When upgrading to 2.37, please make sure there is no trailing .0, so -# that upstream version check can work correctly. -PV = "2.37" -CVE_VERSION = "2.37" - -SRC_URI = "file://binutils/${BP}.tar.xz \ - file://binutils/binutils-2.20.51.0.2-libtool-lib64.patch \ - file://binutils/export-demangle.h-in-devel-package.patch \ - file://binutils/binutils-2.22.52.0.4-no-config-h-check.patch \ - file://binutils/binutils-2.27-aarch64-ifunc.patch \ - file://binutils/CVE-2019-1010204.patch \ - file://binutils/Fix-a-potential-use-of-an-uninitialised-value-in-the.patch \ - file://binutils/backport-CVE-2021-45078.patch \ - file://binutils/backport-0001-CVE-2021-42574.patch \ - file://binutils/backport-0002-CVE-2021-42574.patch \ - file://binutils/backport-0003-CVE-2021-42574.patch \ - file://binutils/bfd-Close-the-file-descriptor-if-there-is-no-archive.patch \ - file://0005-Point-scripts-location-to-libdir.patch \ -" - -S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/recipes-devtools/binutils/binutils.inc b/meta-openeuler/recipes-devtools/binutils/binutils.inc deleted file mode 100644 index 5bd1650c5b2cca6763ba9ae8e46fa410fa9d0723..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/binutils/binutils.inc +++ /dev/null @@ -1,186 +0,0 @@ -SUMMARY = "GNU binary utilities" -DESCRIPTION = "The GNU Binutils are a collection of binary tools. \ -The main ones are ld (GNU Linker), and as (GNU Assembler). This \ -package also includes addition tools such as addr2line (Converts \ -addresses into filenames and line numbers), ar (utility for creating, \ -modifying and extracting archives), nm (list symbols in object \ -files), objcopy (copy and translate object files), objdump (Display \ -object information), and other tools and related libraries." -HOMEPAGE = "http://www.gnu.org/software/binutils/" -BUGTRACKER = "http://sourceware.org/bugzilla/" -SECTION = "devel" -LICENSE = "GPLv3" - -DEPENDS = "gnu-config-native autoconf-native" - -inherit autotools gettext multilib_header texinfo - -FILES_${PN} = " \ - ${bindir}/${TARGET_PREFIX}* \ - ${libdir}/lib*.so.* \ - ${libdir}/bfd-plugins/lib*.so \ - ${libdir}/lib*-${PV}*.so \ - ${prefix}/${TARGET_SYS}/bin/* \ - ${bindir}/embedspu" - -RPROVIDES_${PN} += "${PN}-symlinks" - -FILES_${PN}-dev = " \ - ${includedir} \ - ${libdir}/*.la \ - ${libdir}/libbfd.so \ - ${libdir}/libctf.so \ - ${libdir}/libctf-nobfd.so \ - ${libdir}/libopcodes.so" - -# Rather than duplicating multiple entries for these, make one -# list and reuse it. - -LDGOLD_ALTS ?= "ld.gold dwp" -LDGOLD_ALTS_riscv64 = "" -LDGOLD_ALTS_riscv32 = "" -LDGOLD_ALTS_libc-glibc_mipsarch = "" - -USE_ALTERNATIVES_FOR = " \ - addr2line \ - ar \ - as \ - c++filt \ - elfedit \ - gprof \ - ld \ - ld.bfd \ - ${LDGOLD_ALTS} \ - nm \ - objcopy \ - objdump \ - ranlib \ - readelf \ - size \ - strings \ - strip \ -" - -python do_package_prepend() { - make_alts = d.getVar("USE_ALTERNATIVES_FOR") or "" - prefix = d.getVar("TARGET_PREFIX") - bindir = d.getVar("bindir") - for alt in make_alts.split(): - d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt) - d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt) -} - -B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" - -EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \ - --disable-werror \ - --enable-deterministic-archives \ - --enable-plugins \ - --disable-gdb \ - --disable-gdbserver \ - --disable-libdecnumber \ - --disable-readline \ - --disable-sim \ - ${LDGOLD} \ - ${EXTRA_TARGETS} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}" - -EXTRA_TARGETS = "" -EXTRA_TARGETS_x86-64 = " --enable-targets=x86_64-pe,x86_64-pep " -EXTRA_TARGETS_class-native = "" - -LDGOLD_class-native = "" -LDGOLD_class-crosssdk = "" -LDGOLD_libc-glibc_mipsarch = "" -LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default --enable-threads', d)}" - - -# This is necessary due to a bug in the binutils Makefiles -# EXTRA_OEMAKE = "configure-build-libiberty all" - -export AR = "${HOST_PREFIX}ar" -export AS = "${HOST_PREFIX}as" -export LD = "${HOST_PREFIX}ld" -export NM = "${HOST_PREFIX}nm" -export RANLIB = "${HOST_PREFIX}ranlib" -export OBJCOPY = "${HOST_PREFIX}objcopy" -export OBJDUMP = "${HOST_PREFIX}objdump" - -export AR_FOR_TARGET = "${TARGET_PREFIX}ar" -export AS_FOR_TARGET = "${TARGET_PREFIX}as" -export LD_FOR_TARGET = "${TARGET_PREFIX}ld" -export NM_FOR_TARGET = "${TARGET_PREFIX}nm" -export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib" - -export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}" -export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}" - -# autotools.bbclass sets the _FOR_BUILD variables, but for some reason we need -# to unset LD_LIBRARY_PATH. -export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}" - -MULTIARCH := "${@bb.utils.contains("DISTRO_FEATURES", "multiarch", "yes", "no", d)}" -do_configure[vardeps] += "MULTIARCH" -do_configure () { - (cd ${S} && gnu-configize) - - oe_runconf -# -# must prime config.cache to ensure the build of libiberty -# - mkdir -p ${B}/build-${BUILD_SYS} - for i in ${CONFIG_SITE}; do - cat $i >> ${B}/build-${BUILD_SYS}/config.cache || true - done -} - -do_install () { - autotools_do_install - - # We don't really need these, so we'll remove them... - rm -rf ${D}${libdir}/ldscripts - - bindir_rel=${@os.path.relpath('${bindir}', '${prefix}/${TARGET_SYS}/bin')} - - # Fix the /usr/${TARGET_SYS}/bin/* links - for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do - rm -f $l - ln -sf $bindir_rel/${TARGET_PREFIX}`basename $l` $l - done - - # Install the libiberty header - install -d ${D}${includedir} - install -m 644 ${S}/include/ansidecl.h ${D}${includedir} - install -m 644 ${S}/include/libiberty.h ${D}${includedir} - - # insall pic version of libiberty if available - if [ -e ${B}/libiberty/pic/libiberty.a ]; then - install -Dm 0644 ${B}/libiberty/pic/libiberty.a ${D}${libdir}/libiberty.a - fi - - cd ${D}${bindir} - - # Symlinks for ease of running these on the native target - for p in ${TARGET_PREFIX}* ; do - ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,` - done - - for alt in ${USE_ALTERNATIVES_FOR}; do - rm -f ${D}${bindir}/$alt - done - - oe_multilib_header bfd.h - # bfd_stdint.h encodes the compiler name in the header - # sed -i ${D}${includedir}/bfd_stdint.h -e "s,${TARGET_PREFIX},," -} - -#inherit update-alternatives - -ALTERNATIVE_PRIORITY = "100" - -ALTERNATIVE_${PN}_class-target = "${USE_ALTERNATIVES_FOR}" - -python () { - if bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', True, False, d) and bb.utils.contains_any('TARGET_ARCH', 'riscv32 riscv64', True, False, d): - bb.fatal("Gold linker does not _yet_ support RISC-V architecture please remove ld-is-gold from DISTRO_FEATURES") -} diff --git a/meta-openeuler/recipes-devtools/binutils/binutils/0005-Point-scripts-location-to-libdir.patch b/meta-openeuler/recipes-devtools/binutils/binutils/0005-Point-scripts-location-to-libdir.patch deleted file mode 100644 index dde0cb5d6d0c683269ba5c267a8fdcee4f2294ff..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/binutils/binutils/0005-Point-scripts-location-to-libdir.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6a67d277941228d997b527990960413f8444fb81 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 2 Mar 2015 01:09:58 +0000 -Subject: [PATCH] Point scripts location to libdir - -Upstream-Status: Inappropriate [debian patch] - -Signed-off-by: Khem Raj ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/ld/Makefile.am b/ld/Makefile.am -index 3b01357b651..b7a1f7491b0 100644 ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -51,7 +51,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ -diff --git a/ld/Makefile.in b/ld/Makefile.in -index a6382bf2a45..5ee3a4971be 100644 ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -562,7 +562,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include diff --git a/meta-openeuler/recipes-devtools/binutils/binutils_%.bbappend b/meta-openeuler/recipes-devtools/binutils/binutils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..42dd3e6f17be40c54dee66b4630da1207d8da8ee --- /dev/null +++ b/meta-openeuler/recipes-devtools/binutils/binutils_%.bbappend @@ -0,0 +1 @@ +require binutils_src.inc diff --git a/meta-openeuler/recipes-devtools/binutils/binutils_2.37.bb b/meta-openeuler/recipes-devtools/binutils/binutils_2.37.bb deleted file mode 100644 index e01dd4254417ae627365c1c23a1cbe85af514fcc..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/binutils/binutils_2.37.bb +++ /dev/null @@ -1,65 +0,0 @@ -require binutils.inc -require binutils-${PV}.inc - -DEPENDS += "zlib" -EXTRA_OECONF += "--with-sysroot=/ \ - --enable-install-libbfd \ - --enable-install-libiberty \ - --enable-shared \ - --with-system-zlib \ - " - -EXTRA_OEMAKE_append_libc-musl = "\ - gt_cv_func_gnugettext1_libc=yes \ - gt_cv_func_gnugettext2_libc=yes \ - " -EXTRA_OECONF_class-native = "--enable-targets=all \ - --enable-64-bit-bfd \ - --enable-install-libiberty \ - --enable-install-libbfd \ - --disable-gdb \ - --disable-gdbserver \ - --disable-libdecnumber \ - --disable-readline \ - --disable-sim \ - --disable-werror" - -PACKAGECONFIG ??= "" -PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, elfutils" -# gcc9.0 end up mis-compiling libbfd.so with O2 which then crashes on target -# So remove -O2 and use -Os as workaround -SELECTED_OPTIMIZATION_remove_mipsarch = "-O2" -SELECTED_OPTIMIZATION_append_mipsarch = " -Os" - -do_install_class-native () { - autotools_do_install - - # Install the libiberty header - install -d ${D}${includedir} - install -m 644 ${S}/include/ansidecl.h ${D}${includedir} - install -m 644 ${S}/include/libiberty.h ${D}${includedir} - - # We only want libiberty, libbfd and libopcodes - rm -rf ${D}${bindir} - rm -rf ${D}${prefix}/${TARGET_SYS} - rm -rf ${D}${prefix}/lib/ldscripts - rm -rf ${D}${prefix}/share/info - rm -rf ${D}${prefix}/share/locale - rm -rf ${D}${prefix}/share/man - rmdir ${D}${prefix}/share || : - rmdir ${D}/${libdir}/gcc-lib || : - rmdir ${D}/${libdir}64/gcc-lib || : - rmdir ${D}/${libdir} || : - rmdir ${D}/${libdir}64 || : -} - -# libctf races with libbfd -PARALLEL_MAKEINST_class-target = "" - -# Split out libbfd-*.so and libopcodes-*.so so including perf doesn't include -# extra stuff -PACKAGE_BEFORE_PN += "libbfd libopcodes" -FILES_libbfd = "${libdir}/libbfd-*.so.* ${libdir}/libbfd-*.so" -FILES_libopcodes = "${libdir}/libopcodes-*.so.* ${libdir}/libopcodes-*.so" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-devtools/binutils/binutils_src.inc b/meta-openeuler/recipes-devtools/binutils/binutils_src.inc new file mode 100644 index 0000000000000000000000000000000000000000..4075b94ec82dc24f098e7abe9ebf19d47d0c3713 --- /dev/null +++ b/meta-openeuler/recipes-devtools/binutils/binutils_src.inc @@ -0,0 +1,82 @@ +PV = "2.37" +S = "${WORKDIR}/${BPN}-${PV}" + +# apply package source and patches from openeuler +SRC_URI = " \ + file://binutils-2.37.tar.xz \ + file://binutils-2.20.51.0.2-libtool-lib64.patch \ + file://export-demangle.h-in-devel-package.patch \ + file://binutils-2.22.52.0.4-no-config-h-check.patch \ + file://binutils-2.27-aarch64-ifunc.patch \ + file://CVE-2019-1010204.patch \ + file://Fix-a-potential-use-of-an-uninitialised-value-in-the.patch \ + file://backport-CVE-2021-45078.patch \ + file://backport-0001-CVE-2021-42574.patch \ + file://backport-0002-CVE-2021-42574.patch \ + file://backport-0003-CVE-2021-42574.patch \ + file://bfd-Close-the-file-descriptor-if-there-is-no-archive.patch \ + file://binutils-AArch64-EFI.patch \ + file://backport-0001-PR28391-strip-objcopy-preserve-dates-.a-cannot-set-t.patch \ + file://0001-x86-Add-int1-as-one-byte-opcode-0xf1.patch \ + file://0002-x86-drop-OP_Mask.patch \ + file://0003-x86-correct-VCVT-U-SI2SD-rounding-mode-handling.patch \ + file://0004-x86-64-generalize-OP_G-s-EVEX.R-handling.patch \ + file://0005-x86-64-properly-bounds-check-bnd-N-in-OP_G.patch \ + file://0006-x86-fold-duplicate-register-printing-code.patch \ + file://0007-x86-fold-duplicate-code-in-MOVSXD_Fixup.patch \ + file://0008-x86-correct-EVEX.V-handling-outside-of-64-bit-mode.patch \ + file://0009-x86-drop-vex_mode-and-vex_scalar_mode.patch \ + file://0010-x86-fold-duplicate-vector-register-printing-code.patch \ + file://0011-x86-drop-xmm_m-b-w-d-q-_mode.patch \ + file://0012-x86-drop-vex_scalar_w_dq_mode.patch \ + file://0013-x86-drop-dq-b-d-_mode.patch \ + file://0014-x86-express-unduly-set-rounding-control-bits-in-disa.patch \ + file://0015-x86-Simplify-check-for-distinct-TMM-register-operand.patch \ + file://0016-PATCH-1-2-Enable-Intel-AVX512_FP16-instructions.patch \ + file://0017-PATCH-2-2-Add-tests-for-Intel-AVX512_FP16-instructio.patch \ + file://0018-x86-ELF-fix-.tfloat-output.patch \ + file://0019-x86-ELF-fix-.ds.x-output.patch \ + file://0020-x86-ELF-fix-.tfloat-output-with-hex-input.patch \ + file://0021-x86-introduce-.hfloat-directive.patch \ + file://0022-x86-Avoid-abort-on-invalid-broadcast.patch \ + file://0023-x86-Put-back-3-aborts-in-OP_E_memory.patch \ + file://0024-x86-Print-bad-on-invalid-broadcast-in-OP_E_memory.patch \ + file://0025-x86-Terminate-mnemonicendp-in-swap_operand.patch \ + file://0026-opcodes-Make-i386-dis.c-thread-safe.patch \ + file://0027-x86-reduce-AVX512-FP16-set-of-insns-decoded-through-.patch \ + file://0028-x86-reduce-AVX512-FP-set-of-insns-decoded-through-ve.patch \ + file://0029-x86-consistently-use-scalar_mode-for-AVX512-FP16-sca.patch \ + file://backport-CVE-2022-38126.patch \ + file://backport-0001-texi2pod.pl-add-no-op-no-split-option-support-PR2814.patch \ + file://backport-AArch64-Add-support-for-AArch64-EFI-efi-aarch64.patch \ + file://backport-Add-support-for-AArch64-EFI-efi-aarch64.patch \ + file://backport-don-t-over-align-file-positions-of-PE-executable-sec.patch \ + file://backport-PR28186-SEGV-elf.c-7991-30-in-_bfd_elf_fixup_group_sections.patch \ + file://backport-PR28422-build_id-use-after-free.patch \ + file://backport-PR28540-segmentation-fault-on-NULL-byte_get.patch \ +" + +# apply used patches from poky +SRC_URI += " \ + file://0005-Point-scripts-location-to-libdir.patch \ +" + +SRC_URI[sha256sum] = "820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c" + +do_configure_prepend_class-target () { + # fix Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /build/tmp/work/*/binutils/2.37-r0/recipe-sysroot-native/usr/share/autoconf ... + # autoconf is installed at buildtool-bar, not build autoconf-native, so need to set autom4te_perllibdir or modify default value in gnu-config + if [ ! -z "${OPENEULER_NATIVESDK_SYSROOT}" ];then + export autom4te_perllibdir="${OPENEULER_NATIVESDK_SYSROOT}/usr/share/autoconf" + fi +} + +# bfd_stdint.h has been removed in favor of using stdint.h in new version +# delete the two function below after upgrade to new poky +do_install_prepend () { + mkdir -p ${D}${includedir} + touch ${D}${includedir}/bfd_stdint.h +} +do_install_append () { + rm -f ${D}${includedir}/bfd_stdint.h +} diff --git a/meta-openeuler/recipes-devtools/bison/bison_%.bbappend b/meta-openeuler/recipes-devtools/bison/bison_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a40edfe39449fb9c49a5b6ee1c008cf1d427bcbc --- /dev/null +++ b/meta-openeuler/recipes-devtools/bison/bison_%.bbappend @@ -0,0 +1,9 @@ +PV = "3.8.2" + +LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464" + +SRC_URI[sha256sum] = "9bba0214ccf7f1079c5d59210045227bcf619519840ebfa80cd3849cff5a5bf2" + +SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.xz \ + file://backport-tests-make-it-easier-to-spot-failures.patch \ + " diff --git a/meta-openeuler/recipes-devtools/cjson/cjson_%.bbappend b/meta-openeuler/recipes-devtools/cjson/cjson_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..100bf4b161a407d26f31d1cd79d624639e38bdad --- /dev/null +++ b/meta-openeuler/recipes-devtools/cjson/cjson_%.bbappend @@ -0,0 +1,7 @@ +OPENEULER_SRC_URI_REMOVE = "https git" + +PV = "1.7.15" + +SRC_URI = "file://v${PV}.tar.gz" + +S = "${WORKDIR}/cJSON-${PV}" diff --git a/meta-openeuler/recipes-devtools/dnf/dnf_%.bbappend b/meta-openeuler/recipes-devtools/dnf/dnf_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3b637e0c5276de50f43ffdf586d07d082fe6af13 --- /dev/null +++ b/meta-openeuler/recipes-devtools/dnf/dnf_%.bbappend @@ -0,0 +1,41 @@ +PV = "4.14.0" + +OPENEULER_BRANCH = "master" + +# find patches under openeuler at firse +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +# delete useless codes from poky +SRC_URI_remove = "git://github.com/rpm-software-management/dnf.git;branch=master;protocol=https \ +" + +# apply patches from openeuler before poky +SRC_URI_prepend = " \ + https://github.com/rpm-software-management/dnf/archive/${PV}/${BPN}-${PV}.tar.gz \ + file://unlock-pidfile-if-current-proccess-is-NOT-dnf.patch \ + file://fix-pid-file-residue.patch \ + file://add-rpm-transaction-debuginfo.patch \ + file://adapt-test-another-process.patch \ + file://fix-dnf-history-undo-error-when-history-sqlite-missing.patch \ + file://dnf-4.10.0-sw.patch \ +" + +# add default repo +SRC_URI += " \ + file://openEuler.repo \ +" + +S = "${WORKDIR}/${BP}" + +SRC_URI[sha256sum] = "7de4eb8e85c4d9a74db6f1f827d2dd3348e265631f8678a1dbf7e3346beaad53" + +FILES_${PN} += " \ + /etc/yum.repos.d/openEuler.repo \ + " + +do_install_append() { + mkdir -p ${D}/etc/yum.repos.d/ || echo "" + local version_dir="openEuler-${DISTRO_VERSION}" + sed -i "s/OPENEULER_VER/${version_dir}/g" ${WORKDIR}/openEuler.repo + cp -f ${WORKDIR}/openEuler.repo ${D}/etc/yum.repos.d/ +} diff --git a/meta-openeuler/recipes-devtools/dnf/files/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch b/meta-openeuler/recipes-devtools/dnf/files/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch new file mode 100644 index 0000000000000000000000000000000000000000..5cffc9dce1759de4591b9dcb98d55aa0db742ee8 --- /dev/null +++ b/meta-openeuler/recipes-devtools/dnf/files/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch @@ -0,0 +1,25 @@ +From ceb1043c4f3de095e36908232320b74a4128a94e Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Fri, 30 Dec 2016 18:29:07 +0200 +Subject: [PATCH] Do not set PYTHON_INSTALL_DIR by running python + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9e2e9e9e..2056089d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,7 +19,7 @@ ELSE () + MESSAGE (FATAL_ERROR "Invalid PYTHON_DESIRED value: " ${PYTHON_DESIRED}) + ENDIF() + +-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from sysconfig import get_path; stdout.write(get_path('purelib'))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) ++#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from sysconfig import get_path; stdout.write(get_path('purelib'))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) + MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}") + + ADD_SUBDIRECTORY (dnf) diff --git a/meta-openeuler/recipes-devtools/dnf/files/aarch64/openEuler.repo b/meta-openeuler/recipes-devtools/dnf/files/aarch64/openEuler.repo new file mode 100644 index 0000000000000000000000000000000000000000..bd35e26b9d4dc410a9762dccd16599184c469d15 --- /dev/null +++ b/meta-openeuler/recipes-devtools/dnf/files/aarch64/openEuler.repo @@ -0,0 +1,50 @@ +#generic-repos is licensed under the Mulan PSL v2. +#You can use this software according to the terms and conditions of the Mulan PSL v2. +#You may obtain a copy of Mulan PSL v2 at: +# http://license.coscl.org.cn/MulanPSL2 +#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR +#PURPOSE. +#See the Mulan PSL v2 for more details. + +[OS] +name=OS +baseurl=http://repo.openeuler.org/OPENEULER_VER/OS/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/OPENEULER_VER/OS/$basearch/RPM-GPG-KEY-openEuler + +[everything] +name=everything +baseurl=http://repo.openeuler.org/OPENEULER_VER/everything/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/OPENEULER_VER/everything/$basearch/RPM-GPG-KEY-openEuler + +[EPOL] +name=EPOL +baseurl=http://repo.openeuler.org/OPENEULER_VER/EPOL/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/OPENEULER_VER/OS/$basearch/RPM-GPG-KEY-openEuler + +[debuginfo] +name=debuginfo +baseurl=http://repo.openeuler.org/OPENEULER_VER/debuginfo/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/OPENEULER_VER/debuginfo/$basearch/RPM-GPG-KEY-openEuler + +[source] +name=source +baseurl=http://repo.openeuler.org/OPENEULER_VER/source/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/OPENEULER_VER/source/RPM-GPG-KEY-openEuler + +[update] +name=update +baseurl=http://repo.openeuler.org/OPENEULER_VER/update/$basearch/ +enabled=1 +gpgcheck=1 +gpgkey=http://repo.openeuler.org/OPENEULER_VER/OS/$basearch/RPM-GPG-KEY-openEuler diff --git a/meta-openeuler/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend b/meta-openeuler/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..f474cf95ee6603ac78134cff607155edc8a2d7e2 --- /dev/null +++ b/meta-openeuler/recipes-devtools/e2fsprogs/e2fsprogs_%.bbappend @@ -0,0 +1,36 @@ +PV = "1.46.5" + +S = "${WORKDIR}/${BPN}-${PV}" +# delete package from poky +SRC_URI_remove += "git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git \ + git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git;branch=master \ + file://0001-e2fsck-fix-last-mount-write-time-when-e2fsck-is-forc.patch \ + " + +SRC_URI[sha256sum] = "b11042533c1b1dcf17512f0da48e05b0c573dada1dd8b762864d10f4dc399713" + +# add openeuler patches +SRC_URI += " \ + file://e2fsprogs-${PV}.tar.xz \ + file://0001-e2fsprogs-set-hugefile-from-4T-to-1T-in-hugefile-tes.patch \ + file://0002-resize2fs-resize2fs-disk-hardlinks-will-be-error.patch \ + file://0003-e2fsck-exit-journal-recovery-when-find-EIO-ENOMEM-er.patch \ + file://0004-e2fsck-exit-journal-recovery-when-jounral-superblock.patch \ + file://0005-e2fsck-add-env-param-E2FS_UNRELIABLE_IO-to-fi.patch \ + file://0006-e2mmpstatus.8.in-detele-filesystem-can-be-UUID-or-LA.patch \ + file://0007-tests-fix-ACL-printing-tests.patch \ + file://0008-e2fsck-do-not-clean-up-file-acl-if-the-inode-is-trun.patch \ + file://0009-e2fsck-handle-level-is-overflow-in-ext2fs_extent_get.patch \ + file://0010-libext2fs-add-sanity-check-to-extent-manipulation.patch \ + file://0011-e2fsprogs-add-sw64.patch \ + file://0012-tune2fs-do-not-change-j_tail_sequence-in-journal-sup.patch \ + file://0013-debugfs-teach-logdump-the-n-num_trans-option.patch \ + file://0014-tune2fs-fix-tune2fs-segfault-when-ext2fs_run_ext3_jo.patch \ + file://0015-tune2fs-tune2fs_main-should-return-rc-when-some-erro.patch \ + file://0016-tune2fs-exit-directly-when-fs-freed-in-ext2fs_run_ext3_journal.patch \ + file://0017-unix_io.c-fix-deadlock-problem-in-unix_write_blk64.patch \ + file://0018-misc-fsck.c-Processes-may-kill-other-processes.patch \ + file://0019-debugfs-fix-repeated-output-problem-with-logdump-O-n.patch \ + file://0020-tune2fs-check-return-value-of-ext2fs_mmp_update2-in-.patch \ + file://0021-mmp-fix-wrong-comparison-in-ext2fs_mmp_stop.patch \ +" diff --git a/meta-openeuler/recipes-devtools/elfutils/elfutils_%.bbappend b/meta-openeuler/recipes-devtools/elfutils/elfutils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..26fbf5bc00a11a405b836551b1c7ca6c5ec0e1e6 --- /dev/null +++ b/meta-openeuler/recipes-devtools/elfutils/elfutils_%.bbappend @@ -0,0 +1,22 @@ +PV = "0.187" + +# add patches from openeuler +SRC_URI += " \ + file://elfutils-${PV}.tar.bz2 \ + file://Fix-segfault-in-eu-ar-m.patch \ + file://Fix-error-of-parsing-object-file-perms.patch \ + file://Fix-issue-of-moving-files-by-ar-or-br.patch \ + file://Get-instance-correctly-for-eu-ar-N-option.patch \ +" + +SRC_URI[sha256sum] = "e70b0dfbe610f90c4d1fe0d71af142a4e25c3c4ef9ebab8d2d72b65159d454c8" + +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://debuginfod/debuginfod-client.c;endline=27;md5=7eb69ae4d5654e590c840538256a7bfe \ + " + +# delete conflict patches from poky +SRC_URI_remove += " \ + file://0001-add-support-for-ipkg-to-debuginfod.cxx.patch \ + https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \ +" diff --git a/meta-openeuler/recipes-devtools/elfutils/elfutils_0.185.bb b/meta-openeuler/recipes-devtools/elfutils/elfutils_0.185.bb deleted file mode 100644 index 9a4ab39a415609195f0720da5c46093690a3894f..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/elfutils/elfutils_0.185.bb +++ /dev/null @@ -1,148 +0,0 @@ -SUMMARY = "Utilities and libraries for handling compiled object files" -HOMEPAGE = "https://sourceware.org/elfutils" -DESCRIPTION = "elfutils is a collection of utilities and libraries to read, create and modify ELF binary files, find and handle DWARF debug data, symbols, thread state and stacktraces for processes and core files on GNU/Linux." -SECTION = "base" -LICENSE = "GPLv2 & GPLv2+ & LGPLv3+ & GPLv3+" -LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ - file://debuginfod/debuginfod-client.c;endline=27;md5=f8e9d171c401c493ec45a0b2992ea2ed \ - " -DEPENDS = "zlib virtual/libintl" -DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack " -# The Debian patches below are from: -# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz -SRC_URI = "file://elfutils/${BP}.tar.bz2 \ - file://elfutils/eu-elfclassify-no-stdin-should-use-classify_flag_no_stdin.patch \ - file://run-ptest \ -" - -SRC_URI[sha256sum] = "dc8d3e74ab209465e7f568e1b3bb9a5a142f8656e2b57d10049a73da2ae6b5a6" - -inherit autotools gettext ptest pkgconfig - -EXTRA_OECONF = "--program-prefix=eu-" - -DEPENDS_BZIP2 = "bzip2-replacement-native" -DEPENDS_BZIP2_class-target = "bzip2" - -PACKAGECONFIG ??= "" -PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}" -PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz" -PACKAGECONFIG[libdebuginfod] = "--enable-libdebuginfod,--disable-libdebuginfod,curl" -PACKAGECONFIG[debuginfod] = "--enable-debuginfod,--disable-debuginfod,libarchive sqlite3 libmicrohttpd" - -RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils" - -EXTRA_OECONF_append_class-target = " --disable-tests-rpath" - -RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" - -do_compile_ptest() { - cd ${B}/tests - oe_runmake buildtest-TESTS oecheck -} - -do_install_ptest() { - if [ ${PTEST_ENABLED} = "1" ]; then - # copy the files which needed by the cases - TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip" - install -d -m 755 ${D}${PTEST_PATH}/src - install -d -m 755 ${D}${PTEST_PATH}/libelf - install -d -m 755 ${D}${PTEST_PATH}/libdw - install -d -m 755 ${D}${PTEST_PATH}/libdwfl - install -d -m 755 ${D}${PTEST_PATH}/libdwelf - install -d -m 755 ${D}${PTEST_PATH}/libasm - install -d -m 755 ${D}${PTEST_PATH}/libcpu - install -d -m 755 ${D}${PTEST_PATH}/libebl - for test_file in ${TEST_FILES}; do - if [ -f ${B}/src/${test_file} ]; then - cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src - fi - done - cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so - cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so - cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so - cp ${B}/libcpu/libcpu.a ${D}${PTEST_PATH}/libcpu/ - cp ${B}/libebl/libebl.a ${D}${PTEST_PATH}/libebl/ - cp ${S}/libelf/*.h ${D}${PTEST_PATH}/libelf/ - cp ${S}/libdw/*.h ${D}${PTEST_PATH}/libdw/ - cp ${S}/libdwfl/*.h ${D}${PTEST_PATH}/libdwfl/ - cp ${S}/libdwelf/*.h ${D}${PTEST_PATH}/libdwelf/ - cp ${S}/libasm/*.h ${D}${PTEST_PATH}/libasm/ - cp -r ${S}/tests/ ${D}${PTEST_PATH} - cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests - cp -r ${B}/config.h ${D}${PTEST_PATH} - cp -r ${B}/backends ${D}${PTEST_PATH} - sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile - find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {} - fi -} - -EXTRA_OEMAKE_class-native = "" -EXTRA_OEMAKE_class-nativesdk = "" - -BBCLASSEXTEND = "native nativesdk" - -# Package utilities separately -PACKAGES =+ "${PN}-binutils libelf libasm libdw libdebuginfod" - -# shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+ -# according to NEWS file: -# "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone -# programs. There is now also a formal CONTRIBUTING document describing how to -# submit patches." -LICENSE_${PN}-binutils = "GPLv3+" -LICENSE_${PN} = "GPLv3+" -LICENSE_libelf = "GPLv2 | LGPLv3+" -LICENSE_libasm = "GPLv2 | LGPLv3+" -LICENSE_libdw = "GPLv2 | LGPLv3+" -LICENSE_libdebuginfod = "GPLv2+ | LGPLv3+" - -FILES_${PN}-binutils = "\ - ${bindir}/eu-addr2line \ - ${bindir}/eu-ld \ - ${bindir}/eu-nm \ - ${bindir}/eu-readelf \ - ${bindir}/eu-size \ - ${bindir}/eu-strip" - -FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*" -FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*" -FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*" -FILES_libdebuginfod = "${libdir}/libdebuginfod-${PV}.so ${libdir}/libdebuginfod.so.*" -# Some packages have the version preceeding the .so instead properly -# versioned .so., so we need to reorder and repackage. -#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so" -#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so" - -# The package contains symlinks that trip up insane -INSANE_SKIP_${MLPREFIX}libdw = "dev-so" -# The nlist binary in the tests uses explicitly minimal compiler flags -INSANE_SKIP_${PN}-ptest += "ldflags" - -# avoid stripping some generated binaries otherwise some of the tests such as test-nlist, -# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail -INHIBIT_PACKAGE_STRIP_FILES = "\ - ${PKGD}${PTEST_PATH}/tests/test-nlist \ - ${PKGD}${PTEST_PATH}/tests/elfstrmerge \ - ${PKGD}${PTEST_PATH}/tests/backtrace-child \ - ${PKGD}${PTEST_PATH}/tests/backtrace-data \ - ${PKGD}${PTEST_PATH}/tests/backtrace-dwarf \ - ${PKGD}${PTEST_PATH}/tests/deleted \ - ${PKGD}${PTEST_PATH}/src/strip \ - ${PKGD}${PTEST_PATH}/src/addr2line \ - ${PKGD}${PTEST_PATH}/src/elfcmp \ - ${PKGD}${PTEST_PATH}/src/objdump \ - ${PKGD}${PTEST_PATH}/src/readelf \ - ${PKGD}${PTEST_PATH}/src/nm \ - ${PKGD}${PTEST_PATH}/src/elflint \ - ${PKGD}${PTEST_PATH}/src/elfclassify \ - ${PKGD}${PTEST_PATH}/src/stack \ - ${PKGD}${PTEST_PATH}/src/unstrip \ - ${PKGD}${PTEST_PATH}/libelf/libelf.so \ - ${PKGD}${PTEST_PATH}/libdw/libdw.so \ - ${PKGD}${PTEST_PATH}/libasm/libasm.so \ - ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \ - ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \ -" - -PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1" diff --git a/meta-openeuler/recipes-devtools/elfutils/files/run-ptest b/meta-openeuler/recipes-devtools/elfutils/files/run-ptest deleted file mode 100644 index d5776fdb5386698990c2a143dda8ed63334109d5..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/elfutils/files/run-ptest +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# -#This script is used to run elfutils test suites -cd tests - -make -k installcheck-local CC=gcc abs_srcdir=$PWD abs_builddir=$PWD srcdir=$PWD top_srcdir=$PWD/../ abs_top_builddir=$PWD/../ elfutils_testrun=installed elfutils_tests_rpath=no program_transform_name=s,^,eu-, diff --git a/meta-openeuler/recipes-devtools/expect/expect_%.bbappend b/meta-openeuler/recipes-devtools/expect/expect_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b4a411e608213651ff5a11ad75dea5868e8e712d --- /dev/null +++ b/meta-openeuler/recipes-devtools/expect/expect_%.bbappend @@ -0,0 +1,27 @@ +# source bb: meta/recipes-devtools/expect/expect_5.45.4.bb + +# expect-5.43.0-pkgpath.patch: build error, delete it from openeuler +SRC_URI_prepend = "file://expect-5.43.0-log_file.patch \ + file://expect-5.45-man-page.patch \ + file://expect-5.45-match-gt-numchars-segfault.patch \ + file://expect-5.45-re-memleak.patch \ + file://expect-5.45-exp-log-buf-overflow.patch \ + file://expect-5.45-segfault-with-stubs.patch \ + file://expect-5.45-fd-leak.patch \ + file://expect-5.32.2-random.patch \ + file://expect-5.45-mkpasswd-dash.patch \ + file://expect-5.45-passmass-su-full-path.patch \ + file://expect-5.45-mkpasswd-man.patch \ + file://expect-5.45-format-security.patch \ + " + +# expect-5.45-format-security.patch and 0001-Resolve-string-formatting-issues.patch provide the same +# 0001-expect-Fix-segfaults-if-Tcl-is-built-with-stubs-and-.patch conflict with expect-5.45-segfault-with-stubs.patch +SRC_URI_remove = "file://0001-Resolve-string-formatting-issues.patch \ + file://0001-expect-Fix-segfaults-if-Tcl-is-built-with-stubs-and-.patch \ +" + +# we don't need .c file pack in rootfs +FILES_${PN}-dev_append += " \ + ${libdir}/expect${PV}/*.c \ + " diff --git a/meta-openeuler/recipes-devtools/file/file_%.bbappend b/meta-openeuler/recipes-devtools/file/file_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..fe4ca3504073fe8c2d2c4a5d2e8d51e5df3a2101 --- /dev/null +++ b/meta-openeuler/recipes-devtools/file/file_%.bbappend @@ -0,0 +1,9 @@ +PV = "5.44" + +S = "${WORKDIR}/${BP}" + +SRC_URI = " \ + ftp://ftp.astron.com/pub/file/file-${PV}.tar.gz \ + file://0001-file-localmagic.patch \ +" +SRC_URI[sha256sum] = "3751c7fba8dbc831cb8d7cc8aff21035459b8ce5155ef8b0880a27d028475f3b" diff --git a/meta-openeuler/recipes-devtools/flatbuffers/files/0001-flatbuffers_cross_build_fix.patch b/meta-openeuler/recipes-devtools/flatbuffers/files/0001-flatbuffers_cross_build_fix.patch new file mode 100644 index 0000000000000000000000000000000000000000..48e2b17d93e5ccb9bb3bf44d5ad75c138e0801e8 --- /dev/null +++ b/meta-openeuler/recipes-devtools/flatbuffers/files/0001-flatbuffers_cross_build_fix.patch @@ -0,0 +1,40037 @@ +diff -urN a/BUILD.bazel b/BUILD.bazel +--- a/BUILD.bazel 2021-05-10 18:45:16.000000000 +0000 ++++ b/BUILD.bazel 2023-01-13 07:47:06.185227175 +0000 +@@ -10,6 +10,20 @@ + "LICENSE", + ]) + ++config_setting( ++ name = "platform_freebsd", ++ constraint_values = [ ++ "@platforms//os:freebsd", ++ ], ++) ++ ++config_setting( ++ name = "platform_openbsd", ++ constraint_values = [ ++ "@platforms//os:openbsd", ++ ], ++) ++ + # Public flatc library to compile flatbuffer files at runtime. + cc_library( + name = "flatbuffers", +@@ -23,8 +37,16 @@ + filegroup( + name = "public_headers", + srcs = [ ++ "include/flatbuffers/allocator.h", ++ "include/flatbuffers/array.h", + "include/flatbuffers/base.h", ++ "include/flatbuffers/bfbs_generator.h", ++ "include/flatbuffers/buffer.h", ++ "include/flatbuffers/buffer_ref.h", + "include/flatbuffers/code_generators.h", ++ "include/flatbuffers/default_allocator.h", ++ "include/flatbuffers/detached_buffer.h", ++ "include/flatbuffers/flatbuffer_builder.h", + "include/flatbuffers/flatbuffers.h", + "include/flatbuffers/flexbuffers.h", + "include/flatbuffers/grpc.h", +@@ -35,7 +57,13 @@ + "include/flatbuffers/reflection_generated.h", + "include/flatbuffers/registry.h", + "include/flatbuffers/stl_emulation.h", ++ "include/flatbuffers/string.h", ++ "include/flatbuffers/struct.h", ++ "include/flatbuffers/table.h", + "include/flatbuffers/util.h", ++ "include/flatbuffers/vector.h", ++ "include/flatbuffers/vector_downward.h", ++ "include/flatbuffers/verifier.h", + ], + ) + +@@ -73,6 +101,8 @@ + "include/flatbuffers/flexbuffers.h", + "include/flatbuffers/stl_emulation.h", + "include/flatbuffers/util.h", ++ "include/flatbuffers/vector.h", ++ "include/flatbuffers/verifier.h", + ], + linkstatic = 1, + strip_include_prefix = "/include", +diff -urN a/CMake/BuildFlatBuffers.cmake b/CMake/BuildFlatBuffers.cmake +--- a/CMake/BuildFlatBuffers.cmake 2021-05-10 18:45:16.000000000 +0000 ++++ b/CMake/BuildFlatBuffers.cmake 2023-01-13 07:47:13.007290179 +0000 +@@ -95,7 +95,7 @@ + set(generated_include ${generated_includes_dir}/${filename}_generated.h) + add_custom_command( + OUTPUT ${generated_include} +- COMMAND ${FLATC} ${FLATC_ARGS} ++ COMMAND ${FLATC} ${FLATC_SCHEMA_ARGS} + -o ${generated_includes_dir} + ${include_params} + -c ${schema} +@@ -230,16 +230,30 @@ + foreach(schema ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS}) + get_filename_component(filename ${schema} NAME_WE) + set(generated_include "${generated_include_dir}/${filename}_generated.h") ++ ++ # Generate files for grpc if needed ++ set(generated_source_file) ++ if("${FLATBUFFERS_GENERATE_HEADERS_FLAGS}" MATCHES "--grpc") ++ # Check if schema file contain a rpc_service definition ++ file(STRINGS ${schema} has_grpc REGEX "rpc_service") ++ if(has_grpc) ++ list(APPEND generated_include "${generated_include_dir}/${filename}.grpc.fb.h") ++ set(generated_source_file "${generated_include_dir}/${filename}.grpc.fb.cc") ++ endif() ++ endif() ++ + add_custom_command( +- OUTPUT ${generated_include} ++ OUTPUT ${generated_include} ${generated_source_file} + COMMAND ${FLATC} ${FLATC_ARGS} + -o ${generated_include_dir} + ${include_params} + -c ${schema} + ${FLATBUFFERS_GENERATE_HEADERS_FLAGS} + DEPENDS ${FLATC_TARGET} ${schema} +- WORKING_DIRECTORY "${working_dir}") ++ WORKING_DIRECTORY "${working_dir}" ++ COMMENT "Building ${schema} flatbuffers...") + list(APPEND all_generated_header_files ${generated_include}) ++ list(APPEND all_generated_source_files ${generated_source_file}) + + # Geneate the binary flatbuffers schemas if instructed to. + if (NOT ${FLATBUFFERS_GENERATE_HEADERS_BINARY_SCHEMAS_DIR} STREQUAL "") +@@ -264,6 +278,7 @@ + INTERFACE + ${all_generated_header_files} + ${all_generated_binary_files} ++ ${all_generated_source_files} + ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS}) + add_dependencies( + ${FLATBUFFERS_GENERATE_HEADERS_TARGET} +@@ -279,6 +294,10 @@ + PREFIX "Flatbuffers/Generated/Headers Files" + FILES ${all_generated_header_files}) + source_group( ++ TREE "${generated_target_dir}" ++ PREFIX "Flatbuffers/Generated/Source Files" ++ FILES ${all_generated_source_files}) ++ source_group( + TREE ${working_dir} + PREFIX "Flatbuffers/Schemas" + FILES ${FLATBUFFERS_GENERATE_HEADERS_SCHEMAS}) +@@ -371,7 +390,8 @@ + -b ${FLATBUFFERS_GENERATE_BINARY_FILES_SCHEMA} ${json_file} + ${FLATBUFFERS_GENERATE_BINARY_FILES_FLAGS} + DEPENDS ${FLATC_TARGET} ${json_file} +- WORKING_DIRECTORY "${working_dir}") ++ WORKING_DIRECTORY "${working_dir}" ++ COMMENT "Building ${json_file} binary flatbuffers...") + list(APPEND all_generated_binary_files ${generated_binary_file}) + endforeach() + +diff -urN a/CMake/Version.cmake b/CMake/Version.cmake +--- a/CMake/Version.cmake 2021-05-10 18:45:16.000000000 +0000 ++++ b/CMake/Version.cmake 2023-01-13 07:47:13.065290715 +0000 +@@ -1,12 +1,12 @@ + set(VERSION_MAJOR 2) + set(VERSION_MINOR 0) +-set(VERSION_PATCH 0) ++set(VERSION_PATCH 6) + set(VERSION_COMMIT 0) + + find_program(GIT git) +-if(GIT) ++if(GIT AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") + execute_process( +- COMMAND ${GIT} describe ++ COMMAND ${GIT} describe --tags + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_DESCRIBE_DIRTY + OUTPUT_STRIP_TRAILING_WHITESPACE +diff -urN a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2021-05-10 18:45:16.000000000 +0000 ++++ b/CMakeLists.txt 2023-01-13 07:47:06.191227231 +0000 +@@ -1,9 +1,34 @@ ++# This is the legacy minimum version flatbuffers supported for a while. + cmake_minimum_required(VERSION 2.8.12) ++ ++# CMake version 3.16 is the 'de-facto' minimum version for flatbuffers. If the ++# current cmake is older than this, warn the user and include the legacy file to ++# provide some level of support. ++if(CMAKE_VERSION VERSION_LESS 3.16) ++ message(WARNING "Using cmake version ${CMAKE_VERSION} which is older than " ++ "our target version of 3.16. This will use the legacy CMakeLists.txt that " ++ "supports version 2.8.12 and higher, but not actively maintained. Consider " ++ "upgrading cmake to a newer version, as this may become a fatal error in the " ++ "future.") ++ # Use the legacy version of CMakeLists.txt ++ include(CMake/CMakeLists_legacy.cmake.in) ++ return() ++endif() ++ ++if (POLICY CMP0048) ++ cmake_policy(SET CMP0048 NEW) ++ project(FlatBuffers ++ DESCRIPTION "Flatbuffers serialization library" ++ VERSION 2.0.0 ++ LANGUAGES CXX) ++else() ++ project(FlatBuffers) ++endif (POLICY CMP0048) ++ ++include(CMake/Version.cmake) ++ + # generate compile_commands.json + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +-include(CheckCXXSymbolExists) +- +-project(FlatBuffers) + + # NOTE: Code coverage only works on Linux & OSX. + option(FLATBUFFERS_CODE_COVERAGE "Enable the code coverage build option." OFF) +@@ -16,6 +41,9 @@ + option(FLATBUFFERS_STATIC_FLATC "Build flatbuffers compiler with -static flag" + OFF) + option(FLATBUFFERS_BUILD_FLATHASH "Enable the build of flathash" ON) ++option(FLATBUFFERS_BUILD_BENCHMARKS "Enable the build of flatbenchmark. \" ++ Requires C++11." ++ OFF) + option(FLATBUFFERS_BUILD_GRPCTEST "Enable the build of grpctest" OFF) + option(FLATBUFFERS_BUILD_SHAREDLIB + "Enable the build of the flatbuffers shared library" +@@ -43,6 +71,12 @@ + Only work if CMake supports 'target_precompile_headers'. \" + This can speed up compilation time." + OFF) ++option(FLATBUFFERS_SKIP_MONSTER_EXTRA ++ "Skip generating monster_extra.fbs that contains non-supported numerical\" ++ types." OFF) ++option(FLATBUFFERS_OSX_BUILD_UNIVERSAL ++ "Enable the build for multiple architectures on OS X (arm64, x86_64)." ++ ON) + + if(NOT FLATBUFFERS_BUILD_FLATC AND FLATBUFFERS_BUILD_TESTS) + message(WARNING +@@ -58,7 +92,9 @@ + + # Auto-detect locale-narrow 'strtod_l' and 'strtoull_l' functions. + if(NOT DEFINED FLATBUFFERS_LOCALE_INDEPENDENT) +- set(FLATBUFFERS_LOCALE_INDEPENDENT 0) ++ include(CheckCXXSymbolExists) ++ ++ set(FLATBUFFERS_LOCALE_INDEPENDENT 1) + if(MSVC) + check_cxx_symbol_exists(_strtof_l stdlib.h FLATBUFFERS_HAS_STRTOF_L) + check_cxx_symbol_exists(_strtoui64_l stdlib.h FLATBUFFERS_HAS_STRTOULL_L) +@@ -73,17 +109,31 @@ + add_definitions(-DFLATBUFFERS_LOCALE_INDEPENDENT=$) + + set(FlatBuffers_Library_SRCS ++ include/flatbuffers/allocator.h ++ include/flatbuffers/array.h + include/flatbuffers/base.h ++ include/flatbuffers/bfbs_generator.h ++ include/flatbuffers/buffer.h ++ include/flatbuffers/buffer_ref.h ++ include/flatbuffers/default_allocator.h ++ include/flatbuffers/detached_buffer.h ++ include/flatbuffers/flatbuffer_builder.h + include/flatbuffers/flatbuffers.h ++ include/flatbuffers/flexbuffers.h + include/flatbuffers/hash.h + include/flatbuffers/idl.h +- include/flatbuffers/util.h ++ include/flatbuffers/minireflect.h + include/flatbuffers/reflection.h + include/flatbuffers/reflection_generated.h +- include/flatbuffers/stl_emulation.h +- include/flatbuffers/flexbuffers.h + include/flatbuffers/registry.h +- include/flatbuffers/minireflect.h ++ include/flatbuffers/stl_emulation.h ++ include/flatbuffers/string.h ++ include/flatbuffers/struct.h ++ include/flatbuffers/table.h ++ include/flatbuffers/util.h ++ include/flatbuffers/vector.h ++ include/flatbuffers/vector_downward.h ++ include/flatbuffers/verifier.h + src/idl_parser.cpp + src/idl_gen_text.cpp + src/reflection.cpp +@@ -110,7 +160,10 @@ + src/idl_gen_swift.cpp + src/flatc.cpp + src/flatc_main.cpp ++ src/bfbs_gen.h ++ src/bfbs_gen_lua.h + include/flatbuffers/code_generators.h ++ src/bfbs_gen_lua.cpp + src/code_generators.cpp + grpc/src/compiler/schema_interface.h + grpc/src/compiler/cpp_generator.h +@@ -220,10 +273,6 @@ + # do not apply any global settings if the toolchain + # is being configured externally + message(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}.") +-elseif(APPLE) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Wno-unused-parameter") +- set(FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wold-style-cast") + elseif(CMAKE_COMPILER_IS_GNUCXX) + if(CYGWIN) + set(CMAKE_CXX_FLAGS +@@ -241,7 +290,7 @@ + "${CMAKE_CXX_FLAGS} -faligned-new -Werror=implicit-fallthrough=2") + endif() + set(CMAKE_CXX_FLAGS +- "${CMAKE_CXX_FLAGS} -Wunused-result -Werror=unused-result -Wunused-parameter -Werror=unused-parameter") ++ "${CMAKE_CXX_FLAGS} -Wno-unused-result -Wno-error=unused-result -Wno-unused-parameter -Wno-error=unused-parameter") + endif() + + # Certain platforms such as ARM do not use signed chars by default +@@ -249,9 +298,31 @@ + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -fsigned-char") + ++# MSVC **MUST** come before the Clang check, as clang-cl is flagged by CMake as "MSVC", but it still textually ++# matches as Clang in its Compiler Id :) ++# Note: in CMake >= 3.14 we can check CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU" or "MSVC" to differentiate... ++elseif(MSVC) ++ # Visual Studio pedantic build settings ++ # warning C4512: assignment operator could not be generated ++ # warning C4316: object allocated on the heap may not be aligned ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /wd4512 /wd4316") ++ ++ if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS") ++ endif() ++ + elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") +- set(CMAKE_CXX_FLAGS +- "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic -Werror -Wextra -Wno-unused-parameter") ++ if(APPLE) ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") ++ ++ if(FLATBUFFERS_OSX_BUILD_UNIVERSAL) ++ set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") ++ endif() ++ else() ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") ++ endif() ++ ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Wno-unused-parameter") + set(FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wold-style-cast") + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.8) + list(APPEND FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wimplicit-fallthrough" "-Wextra-semi" "-Werror=unused-private-field") # enable warning +@@ -273,14 +344,6 @@ + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -fsigned-char") + +-elseif(MSVC) +- # Visual Studio pedantic build settings +- # warning C4512: assignment operator could not be generated +- # warning C4316: object allocated on the heap may not be aligned +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /wd4512 /wd4316") +- +- # multi-core build. +- add_definitions("/MP") + endif() + + # Append FLATBUFFERS_CXX_FLAGS to CMAKE_CXX_FLAGS. +@@ -331,11 +394,6 @@ + endif() + endfunction() + +-if(BIICODE) +- include(biicode/cmake/biicode.cmake) +- return() +-endif() +- + include_directories(include) + include_directories(grpc) + +@@ -382,8 +440,8 @@ + # - micro updated every release when there is no API/ABI changes + # - minor updated when there are additions in API/ABI + # - major (ABI number) updated when there are changes in ABI (or removals) +- set(FlatBuffers_Library_SONAME_MAJOR "2") +- set(FlatBuffers_Library_SONAME_FULL "${FlatBuffers_Library_SONAME_MAJOR}.0.0") ++ set(FlatBuffers_Library_SONAME_MAJOR ${VERSION_MAJOR}) ++ set(FlatBuffers_Library_SONAME_FULL "${FlatBuffers_Library_SONAME_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") + set_target_properties(flatbuffers_shared PROPERTIES OUTPUT_NAME flatbuffers + SOVERSION "${FlatBuffers_Library_SONAME_MAJOR}" + VERSION "${FlatBuffers_Library_SONAME_FULL}") +@@ -438,11 +496,12 @@ + message(STATUS "`${SRC_FBS}`: add generation of binary (.bfbs) schema") + get_filename_component(SRC_FBS_DIR ${SRC_FBS} PATH) + string(REGEX REPLACE "\\.fbs$" ".bfbs" GEN_BINARY_SCHEMA ${SRC_FBS}) +- # For details about flags see generate_code.bat(sh) ++ # For details about flags see generate_code.py + add_custom_command( + OUTPUT ${GEN_BINARY_SCHEMA} + COMMAND "${FLATBUFFERS_FLATC_EXECUTABLE}" + -b --schema --bfbs-comments --bfbs-builtins ++ --bfbs-filenames ${SRC_FBS_DIR} + -I "${CMAKE_CURRENT_SOURCE_DIR}/tests/include_test" + -o "${SRC_FBS_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FBS}" +@@ -460,7 +519,7 @@ + message(STATUS "`${SRC_FBS}`: add generation of C++ embedded binary schema code with '${OPT}'") + get_filename_component(SRC_FBS_DIR ${SRC_FBS} PATH) + string(REGEX REPLACE "\\.fbs$" "_bfbs_generated.h" GEN_BFBS_HEADER ${SRC_FBS}) +- # For details about flags see generate_code.bat(sh) ++ # For details about flags see generate_code.py + add_custom_command( + OUTPUT ${GEN_BFBS_HEADER} + COMMAND "${FLATBUFFERS_FLATC_EXECUTABLE}" +@@ -468,6 +527,7 @@ + --cpp-ptr-type flatbuffers::unique_ptr # Used to test with C++98 STLs + ${OPT} + --bfbs-comments --bfbs-builtins --bfbs-gen-embed ++ --bfbs-filenames ${SRC_FBS_DIR} + -I "${CMAKE_CURRENT_SOURCE_DIR}/tests/include_test" + -o "${SRC_FBS_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FBS}" +@@ -476,6 +536,30 @@ + register_generated_output(${GEN_BFBS_HEADER}) + endfunction() + ++# Look if we have python 3.5 installed so that we can run the generate code ++# python script after flatc is built. ++find_package(Python3 3.5 COMPONENTS Interpreter) ++ ++if(Python3_Interpreter_FOUND) ++ set(GENERATION_OPTS --flatc "${FLATBUFFERS_FLATC_EXECUTABLE}") ++ if(FLATBUFFERS_BUILD_LEGACY) ++ # Need to set --cpp-std c++-0x options ++ set(GENERATION_OPTS ${GENERATION_OPTS}--cpp-0x) ++ endif() ++ if(FLATBUFFERS_SKIP_MONSTER_EXTRA) ++ set(GENERATION_OPTS ${GENERATION_OPTS} --skip-monster-extra) ++ endif() ++ add_custom_command( ++ TARGET flatc ++ POST_BUILD ++ COMMAND ${Python3_EXECUTABLE} scripts/generate_code.py ${GENERATION_OPTS} --skip-gen-reflection ++ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" ++ COMMENT "Running scripts/generate_code.py..." ++ VERBATIM) ++else() ++ message("No Python3 interpreter found! Unable to generate files automatically.") ++endif() ++ + if(FLATBUFFERS_BUILD_TESTS) + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/tests" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/samples" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") +@@ -483,9 +567,9 @@ + # TODO Add (monster_test.fbs monsterdata_test.json)->monsterdata_test.mon + compile_flatbuffers_schema_to_cpp(tests/monster_test.fbs) + compile_flatbuffers_schema_to_binary(tests/monster_test.fbs) +- compile_flatbuffers_schema_to_cpp(tests/namespace_test/namespace_test1.fbs) +- compile_flatbuffers_schema_to_cpp(tests/namespace_test/namespace_test2.fbs) +- compile_flatbuffers_schema_to_cpp(tests/union_vector/union_vector.fbs) ++ compile_flatbuffers_schema_to_cpp_opt(tests/namespace_test/namespace_test1.fbs "--no-includes;--gen-compare;--gen-name-strings") ++ compile_flatbuffers_schema_to_cpp_opt(tests/namespace_test/namespace_test2.fbs "--no-includes;--gen-compare;--gen-name-strings") ++ compile_flatbuffers_schema_to_cpp_opt(tests/union_vector/union_vector.fbs "--no-includes;--gen-compare;--gen-name-strings") + compile_flatbuffers_schema_to_cpp(tests/optional_scalars.fbs) + compile_flatbuffers_schema_to_cpp_opt(tests/native_type_test.fbs "") + compile_flatbuffers_schema_to_cpp_opt(tests/arrays_test.fbs "--scoped-enums;--gen-compare") +@@ -517,7 +601,7 @@ + if(FLATBUFFERS_BUILD_CPP17) + # Don't generate header for flattests_cpp17 target. + # This target uses "generated_cpp17/monster_test_generated.h" +- # produced by direct call of generate_code.bat(sh) script. ++ # produced by direct call of generate_code.py script. + add_executable(flattests_cpp17 ${FlatBuffers_Tests_CPP17_SRCS}) + add_dependencies(flattests_cpp17 generated_code) + target_compile_features(flattests_cpp17 PRIVATE cxx_std_17) +@@ -545,6 +629,7 @@ + INCLUDE_DIRECTORIES(${PROTOBUF_DOWNLOAD_PATH}/src) + find_package(Threads REQUIRED) + list(APPEND CMAKE_PREFIX_PATH ${GRPC_INSTALL_PATH}) ++ find_package(absl CONFIG REQUIRED) + find_package(protobuf CONFIG REQUIRED) + find_package(gRPC CONFIG REQUIRED) + add_executable(grpctest ${FlatBuffers_GRPCTest_SRCS}) +@@ -556,7 +641,6 @@ + endif() + endif() + +-include(CMake/Version.cmake) + + if(FLATBUFFERS_INSTALL) + include(GNUInstallDirs) +@@ -572,18 +656,11 @@ + ) + + if(FLATBUFFERS_BUILD_FLATLIB) +- if(CMAKE_VERSION VERSION_LESS 3.0) +- install( +- TARGETS flatbuffers EXPORT FlatbuffersTargets +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ) +- else() +- install( +- TARGETS flatbuffers EXPORT FlatbuffersTargets +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +- ) +- endif() ++ install( ++ TARGETS flatbuffers EXPORT FlatbuffersTargets ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++ ) + + install(EXPORT FlatbuffersTargets + FILE FlatbuffersTargets.cmake +@@ -607,24 +684,15 @@ + endif() + + if(FLATBUFFERS_BUILD_SHAREDLIB) +- if(CMAKE_VERSION VERSION_LESS 3.0) +- install( +- TARGETS flatbuffers_shared EXPORT FlatbuffersSharedTargets +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- ) +- else() +- install( +- TARGETS flatbuffers_shared EXPORT FlatbuffersSharedTargets +- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} +- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +- ) +- endif() ++ install( ++ TARGETS flatbuffers_shared EXPORT FlatbuffersSharedTargets ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++ ) + +- install( ++ install( + EXPORT FlatbuffersSharedTargets + FILE FlatbuffersSharedTargets.cmake + NAMESPACE flatbuffers:: +@@ -676,3 +744,16 @@ + include(CPack) + endif() + endif() ++ ++# Include for running Google Benchmarks. ++if(FLATBUFFERS_BUILD_BENCHMARKS) ++ add_subdirectory(benchmarks) ++endif() ++ ++# Add FlatBuffers::FlatBuffers interface, needed for FetchContent_Declare ++add_library(FlatBuffers INTERFACE) ++add_library(FlatBuffers::FlatBuffers ALIAS FlatBuffers) ++target_include_directories( ++ FlatBuffers ++ INTERFACE $ ++ $) +diff -urN a/android/AndroidManifest.xml b/android/AndroidManifest.xml +--- a/android/AndroidManifest.xml 2021-05-10 18:45:16.000000000 +0000 ++++ b/android/AndroidManifest.xml 2023-01-13 07:46:48.901067551 +0000 +@@ -1,20 +1,4 @@ + +- + + +diff -urN a/android/app/build.gradle b/android/app/build.gradle +--- a/android/app/build.gradle 2021-05-10 18:45:16.000000000 +0000 ++++ b/android/app/build.gradle 2023-01-13 07:46:48.980068281 +0000 +@@ -101,16 +101,6 @@ + + flavorDimensions "stl-variant" + productFlavors { +- stlport { +- dimension "stl-variant" +- applicationIdSuffix ".stlport" +- versionNameSuffix "-stlport" +- externalNativeBuild { +- ndkBuild { +- arguments "APP_STL=stlport_static" +- } +- } +- } + gnustl { + dimension "stl-variant" + applicationIdSuffix ".gnustl" +diff -urN a/android/app/src/main/cpp/flatbuffers/CMakeLists.txt b/android/app/src/main/cpp/flatbuffers/CMakeLists.txt +--- a/android/app/src/main/cpp/flatbuffers/CMakeLists.txt 2021-05-10 18:45:16.000000000 +0000 ++++ b/android/app/src/main/cpp/flatbuffers/CMakeLists.txt 2023-01-13 07:46:48.998068447 +0000 +@@ -15,17 +15,31 @@ + "${CMAKE_CXX_FLAGS} -fsigned-char") + + set(FlatBuffers_Library_SRCS ++ ${FLATBUFFERS_SRC}/include/flatbuffers/allocator.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/array.h + ${FLATBUFFERS_SRC}/include/flatbuffers/base.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/bfbs_generator.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/buffer.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/buffer_ref.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/default_allocator.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/detached_buffer.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/flatbuffer_builder.h + ${FLATBUFFERS_SRC}/include/flatbuffers/flatbuffers.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/flexbuffers.h + ${FLATBUFFERS_SRC}/include/flatbuffers/hash.h + ${FLATBUFFERS_SRC}/include/flatbuffers/idl.h +- ${FLATBUFFERS_SRC}/include/flatbuffers/util.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/minireflect.h + ${FLATBUFFERS_SRC}/include/flatbuffers/reflection.h + ${FLATBUFFERS_SRC}/include/flatbuffers/reflection_generated.h +- ${FLATBUFFERS_SRC}/include/flatbuffers/stl_emulation.h +- ${FLATBUFFERS_SRC}/include/flatbuffers/flexbuffers.h + ${FLATBUFFERS_SRC}/include/flatbuffers/registry.h +- ${FLATBUFFERS_SRC}/include/flatbuffers/minireflect.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/stl_emulation.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/string.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/struct.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/table.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/util.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/vector.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/vector_downward.h ++ ${FLATBUFFERS_SRC}/include/flatbuffers/verifier.h + ${FLATBUFFERS_SRC}/src/idl_parser.cpp + ${FLATBUFFERS_SRC}/src/idl_gen_text.cpp + ${FLATBUFFERS_SRC}/src/reflection.cpp +diff -urN a/build_defs.bzl b/build_defs.bzl +--- a/build_defs.bzl 2021-05-10 18:45:16.000000000 +0000 ++++ b/build_defs.bzl 2023-01-13 07:47:06.250227776 +0000 +@@ -209,7 +209,7 @@ + Happy dependent Flatbuffering! + ''' + output_headers = [ +- (out_prefix + "%s_generated.h") % (s.replace(".fbs", "").split("/")[-1]) ++ (out_prefix + "%s_generated.h") % (s.replace(".fbs", "").split("/")[-1].split(":")[-1]) + for s in srcs + ] + reflection_name = "%s_reflection" % name if gen_reflections else "" +diff -urN a/conan/build.py b/conan/build.py +--- a/conan/build.py 2021-05-10 18:45:16.000000000 +0000 ++++ b/conan/build.py 2023-01-13 07:47:11.633277490 +0000 +@@ -6,16 +6,6 @@ + from cpt.packager import ConanMultiPackager + + +-def set_appveyor_environment(): +- if os.getenv("APPVEYOR") is not None: +- compiler_version = os.getenv("CMAKE_VS_VERSION").split(" ")[0].replace('"', '') +- os.environ["CONAN_VISUAL_VERSIONS"] = compiler_version +- os.environ["CONAN_STABLE_BRANCH_PATTERN"] = "master" +- ci_platform = os.getenv("Platform").replace('"', '') +- ci_platform = "x86" if ci_platform == "x86" else "x86_64" +- os.environ["CONAN_ARCHS"] = ci_platform +- os.environ["CONAN_BUILD_TYPES"] = os.getenv("Configuration").replace('"', '') +- + + def get_branch(): + try: +@@ -56,7 +46,6 @@ + stable_branch_pattern = os.getenv("CONAN_STABLE_BRANCH_PATTERN", r"v\d+\.\d+\.\d+.*") + test_folder = os.getenv("CPT_TEST_FOLDER", os.path.join("conan", "test_package")) + upload_only_when_stable = os.getenv("CONAN_UPLOAD_ONLY_WHEN_STABLE", True) +- set_appveyor_environment() + + builder = ConanMultiPackager(reference=get_reference(username), + username=username, +diff -urN a/dart/CHANGELOG.md b/dart/CHANGELOG.md +--- a/dart/CHANGELOG.md 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/CHANGELOG.md 2023-01-13 07:47:12.215282865 +0000 +@@ -1,4 +1,22 @@ +-# CHANGELOG ++## 2.0.5 ++ ++- switch to null safety (#6696) ++- add Object APIs (pack/unpack) (#6682, #6723, #6846) ++- add custom builder buffer allocator support (#6711) ++- add `Builder.size()` - finished buffer size (#6403) ++- make `writeString()` argument non-nullable (#6737) ++- make tables fixed size (expect the number of fields when creating) (#6735) ++- make table deduplication optional (param `deduplicateTables`) (#6734) ++- change `Builder.reset()` to reuse an existing buffer (#6661) ++- change table building to assert() instead of exceptions (#6754) ++- optimize `writeString()` for ASCII (param `asciiOptimization`) (#6736) ++- change `StringReader` to make ASCII optimization optional (param `asciiOptimization`) (#6758) ++- change `[byte]` and `[ubyte]` representation to `dart:typed_data` `Int8List` and `Uint8List` (#6839) ++- rename `lowFinish()` to `buffer` getter (#6712) ++- fix `Builder._writeString()` - always write trailing zero byte (#6390) ++- fix `Builder.reset()` - clear vTables (#6386) ++- make sure added padding is zeroed, same as in C++ (#6716) ++- many performance improvements (#6755) + + ## 1.9.2 + +@@ -11,4 +29,4 @@ + + ## 1.9.0 + +-- Initial release, supports Dart 1.x and many dev versions of Dart 2.x +\ No newline at end of file ++- Initial release, supports Dart 1.x and many dev versions of Dart 2.x +diff -urN a/dart/LICENSE b/dart/LICENSE +--- a/dart/LICENSE 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/LICENSE 2023-01-13 07:47:12.232283022 +0000 +@@ -1,35 +1,3 @@ +-The code in lib/flat_buffers.dart is based on code that was releases under the +-following license: +- +-Copyright 2012, the Dart project authors. All rights reserved. +-Redistribution and use in source and binary forms, with or without +-modification, are permitted provided that the following conditions are +-met: +- * Redistributions of source code must retain the above copyright +- notice, this list of conditions and the following disclaimer. +- * Redistributions in binary form must reproduce the above +- copyright notice, this list of conditions and the following +- disclaimer in the documentation and/or other materials provided +- with the distribution. +- * Neither the name of Google Inc. nor the names of its +- contributors may be used to endorse or promote products derived +- from this software without specific prior written permission. +-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- +-To the extent permissible, the changes to that code and the other assets in +-this package are licensed under the Apache2 license: +- +- + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ +diff -urN a/dart/README.md b/dart/README.md +--- a/dart/README.md 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/README.md 2023-01-13 07:47:12.233283032 +0000 +@@ -1,13 +1,23 @@ + # FlatBuffers for Dart + +-This package is used to read and write FlatBuffer files in Dart. ++This package is used to read and write [FlatBuffers](https://google.github.io/flatbuffers/). + +-Most consumers will want to use the [`flatc`](https://github.com/google/flatbuffers) +-compiler to generate Dart code from a FlatBuffers IDL schema. For example, the +-`monster_my_game.sample_generated.dart` was generated with `flatc` from +-`monster.fbs` in the example folder. The generated classes can be used to read +-or write binary files that are interoperable with other languages and platforms +-supported by FlatBuffers, as illustrated in the `example.dart` in the ++Most consumers will want to use the [`flatc` - FlatBuffer compiler](https://github.com/google/flatbuffers) binary for your platform. ++You can find it in the `generator/{Platform}` directory of the [released package archive](https://pub.dev/packages/flat_buffers/versions/2.0.5.tar.gz). ++ ++The FlatBuffer compiler `flatc` reads a FlatBuffers IDL schema and generates Dart code. ++The generated classes can be used to read or write binary data/files that are interoperable with ++other languages and platforms supported by FlatBuffers, as illustrated in the `example.dart` in the + examples folder. + +-Additional documentation and examples are available [at the FlatBuffers site](https://google.github.io/flatbuffers/index.html) +\ No newline at end of file ++For more details and documentation, head over to the official site and read the ++[Tutorial](https://google.github.io/flatbuffers/flatbuffers_guide_tutorial.html) and how to ++[use FlatBuffers in Dart](https://google.github.io/flatbuffers/flatbuffers_guide_use_dart.html). ++ ++## Dart 2.0 notes ++Version 2.0.5 ships with it's own custom build of `flatc` because this is an extraordinary release to catch-up ++with FlatBuffers for other platforms. This generator can only generate dart code (to avoid generating code for other platforms which isn't released yet). ++On the other hand, the generated code still produces standard binary FlatBuffers compatible with other languages. ++In other words: only `flatc --dart ...` works with this generator, but your app will be able to produce and read standard binary (`Uint8List`) FlatBuffers that are fully compotible with other languages supporting FlatBuffers (e.g. Java, C++, ...). ++ ++In the future a common `flatc` binary for all platforms would be shipped through GitHub release page instead. +diff -urN a/dart/analysis_options.yaml b/dart/analysis_options.yaml +--- a/dart/analysis_options.yaml 1970-01-01 00:00:00.000000000 +0000 ++++ b/dart/analysis_options.yaml 2023-01-13 07:47:12.233283032 +0000 +@@ -0,0 +1 @@ ++include: package:lints/recommended.yaml +diff -urN a/dart/example/example.dart b/dart/example/example.dart +--- a/dart/example/example.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/example/example.dart 2023-01-13 07:47:12.663287002 +0000 +@@ -15,7 +15,7 @@ + */ + + import 'package:flat_buffers/flat_buffers.dart' as fb; +-import './monster_my_game.sample_generated.dart' as myGame; ++import './monster_my_game.sample_generated.dart' as my_game; + + // Example how to use FlatBuffers to create and read binary buffers. + +@@ -25,27 +25,27 @@ + } + + void builderTest() { +- final builder = new fb.Builder(initialSize: 1024); +- final int weaponOneName = builder.writeString("Sword"); ++ final builder = fb.Builder(initialSize: 1024); ++ final int? weaponOneName = builder.writeString("Sword"); + final int weaponOneDamage = 3; + +- final int weaponTwoName = builder.writeString("Axe"); ++ final int? weaponTwoName = builder.writeString("Axe"); + final int weaponTwoDamage = 5; + +- final swordBuilder = new myGame.WeaponBuilder(builder) ++ final swordBuilder = my_game.WeaponBuilder(builder) + ..begin() + ..addNameOffset(weaponOneName) + ..addDamage(weaponOneDamage); + final int sword = swordBuilder.finish(); + +- final axeBuilder = new myGame.WeaponBuilder(builder) ++ final axeBuilder = my_game.WeaponBuilder(builder) + ..begin() + ..addNameOffset(weaponTwoName) + ..addDamage(weaponTwoDamage); + final int axe = axeBuilder.finish(); + + // Serialize a name for our monster, called "Orc". +- final int name = builder.writeString('Orc'); ++ final int? name = builder.writeString('Orc'); + + // Create a list representing the inventory of the Orc. Each number + // could correspond to an item that can be claimed after he is slain. +@@ -54,7 +54,7 @@ + final weapons = builder.writeList([sword, axe]); + + // Struct builders are very easy to reuse. +- final vec3Builder = new myGame.Vec3Builder(builder); ++ final vec3Builder = my_game.Vec3Builder(builder); + + vec3Builder.finish(4.0, 5.0, 6.0); + vec3Builder.finish(1.0, 2.0, 3.0); +@@ -62,21 +62,21 @@ + final int hp = 300; + final int mana = 150; + +- final monster = new myGame.MonsterBuilder(builder) ++ final monster = my_game.MonsterBuilder(builder) + ..begin() + ..addNameOffset(name) + ..addInventoryOffset(inventory) + ..addWeaponsOffset(weapons) +- ..addEquippedType(myGame.EquipmentTypeId.Weapon) ++ ..addEquippedType(my_game.EquipmentTypeId.Weapon) + ..addEquippedOffset(axe) + ..addHp(hp) + ..addMana(mana) + ..addPos(vec3Builder.finish(1.0, 2.0, 3.0)) +- ..addColor(myGame.Color.Red); ++ ..addColor(my_game.Color.Red); + + final int monsteroff = monster.finish(); +- final buffer = builder.finish(monsteroff); +- if (verify(buffer)) { ++ builder.finish(monsteroff); ++ if (verify(builder.buffer)) { + print( + "The FlatBuffer was successfully created with a builder and verified!"); + } +@@ -85,17 +85,17 @@ + void objectBuilderTest() { + // Create the builder here so we can use it for both weapons and equipped + // the actual data will only be written to the buffer once. +- var axe = new myGame.WeaponObjectBuilder(name: 'Axe', damage: 5); ++ var axe = my_game.WeaponObjectBuilder(name: 'Axe', damage: 5); + +- var monsterBuilder = new myGame.MonsterObjectBuilder( +- pos: new myGame.Vec3ObjectBuilder(x: 1.0, y: 2.0, z: 3.0), ++ var monsterBuilder = my_game.MonsterObjectBuilder( ++ pos: my_game.Vec3ObjectBuilder(x: 1.0, y: 2.0, z: 3.0), + mana: 150, + hp: 300, + name: 'Orc', + inventory: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], +- color: myGame.Color.Red, +- weapons: [new myGame.WeaponObjectBuilder(name: 'Sword', damage: 3), axe], +- equippedType: myGame.EquipmentTypeId.Weapon, ++ color: my_game.Color.Red, ++ weapons: [my_game.WeaponObjectBuilder(name: 'Sword', damage: 3), axe], ++ equippedType: my_game.EquipmentTypeId.Weapon, + equipped: axe, + ); + +@@ -114,7 +114,7 @@ + + bool verify(List buffer) { + // Get access to the root: +- var monster = new myGame.Monster(buffer); ++ var monster = my_game.Monster(buffer); + + // Get and test some scalar types from the FlatBuffer. + assert(monster.hp == 80); +@@ -122,31 +122,29 @@ + assert(monster.name == "MyMonster"); + + // Get and test a field of the FlatBuffer's `struct`. +- var pos = monster.pos; +- assert(pos != null); ++ var pos = monster.pos!; + assert(pos.z == 3.0); + + // Get a test an element from the `inventory` FlatBuffer's `vector`. +- var inv = monster.inventory; +- assert(inv != null); ++ var inv = monster.inventory!; + assert(inv.length == 10); + assert(inv[9] == 9); + + // Get and test the `weapons` FlatBuffers's `vector`. +- var expected_weapon_names = ["Sword", "Axe"]; +- var expected_weapon_damages = [3, 5]; +- var weps = monster.weapons; ++ var expectedWeaponNames = ["Sword", "Axe"]; ++ var expectedWeaponDamages = [3, 5]; ++ var weps = monster.weapons!; + for (int i = 0; i < weps.length; i++) { +- assert(weps[i].name == expected_weapon_names[i]); +- assert(weps[i].damage == expected_weapon_damages[i]); ++ assert(weps[i].name == expectedWeaponNames[i]); ++ assert(weps[i].damage == expectedWeaponDamages[i]); + } + + // Get and test the `Equipment` union (`equipped` field). +- assert(monster.equippedType.value == myGame.EquipmentTypeId.Weapon.value); +- assert(monster.equippedType == myGame.EquipmentTypeId.Weapon); ++ assert(monster.equippedType!.value == my_game.EquipmentTypeId.Weapon.value); ++ assert(monster.equippedType == my_game.EquipmentTypeId.Weapon); + +- assert(monster.equipped is myGame.Weapon); +- var equipped = monster.equipped as myGame.Weapon; ++ assert(monster.equipped is my_game.Weapon); ++ var equipped = monster.equipped as my_game.Weapon; + assert(equipped.name == "Axe"); + assert(equipped.damage == 5); + +diff -urN a/dart/example/monster_my_game.sample_generated.dart b/dart/example/monster_my_game.sample_generated.dart +--- a/dart/example/monster_my_game.sample_generated.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/example/monster_my_game.sample_generated.dart 2023-01-13 07:47:12.663287002 +0000 +@@ -1,5 +1,5 @@ + // automatically generated by the FlatBuffers compiler, do not modify +-// ignore_for_file: unused_import, unused_field, unused_local_variable ++// ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable + + library my_game.sample; + +@@ -12,23 +12,29 @@ + const Color._(this.value); + + factory Color.fromValue(int value) { +- if (value == null) value = 0; +- if (!values.containsKey(value)) { +- throw new StateError('Invalid value $value for bit flag enum Color'); ++ final result = values[value]; ++ if (result == null) { ++ throw StateError('Invalid value $value for bit flag enum Color'); + } +- return values[value]; ++ return result; + } + ++ static Color? _createOrNull(int? value) => ++ value == null ? null : Color.fromValue(value); ++ + static const int minValue = 0; + static const int maxValue = 2; + static bool containsValue(int value) => values.containsKey(value); + +- static const Color Red = const Color._(0); +- static const Color Green = const Color._(1); +- static const Color Blue = const Color._(2); +- static const Map values = {0: Red,1: Green,2: Blue,}; ++ static const Color Red = Color._(0); ++ static const Color Green = Color._(1); ++ static const Color Blue = Color._(2); ++ static const Map values = { ++ 0: Red, ++ 1: Green, ++ 2: Blue}; + +- static const fb.Reader reader = const _ColorReader(); ++ static const fb.Reader reader = _ColorReader(); + + @override + String toString() { +@@ -44,7 +50,7 @@ + + @override + Color read(fb.BufferContext bc, int offset) => +- new Color.fromValue(const fb.Int8Reader().read(bc, offset)); ++ Color.fromValue(const fb.Int8Reader().read(bc, offset)); + } + + class EquipmentTypeId { +@@ -52,22 +58,27 @@ + const EquipmentTypeId._(this.value); + + factory EquipmentTypeId.fromValue(int value) { +- if (value == null) value = 0; +- if (!values.containsKey(value)) { +- throw new StateError('Invalid value $value for bit flag enum EquipmentTypeId'); ++ final result = values[value]; ++ if (result == null) { ++ throw StateError('Invalid value $value for bit flag enum EquipmentTypeId'); + } +- return values[value]; ++ return result; + } + ++ static EquipmentTypeId? _createOrNull(int? value) => ++ value == null ? null : EquipmentTypeId.fromValue(value); ++ + static const int minValue = 0; + static const int maxValue = 1; + static bool containsValue(int value) => values.containsKey(value); + +- static const EquipmentTypeId NONE = const EquipmentTypeId._(0); +- static const EquipmentTypeId Weapon = const EquipmentTypeId._(1); +- static const Map values = {0: NONE,1: Weapon,}; ++ static const EquipmentTypeId NONE = EquipmentTypeId._(0); ++ static const EquipmentTypeId Weapon = EquipmentTypeId._(1); ++ static const Map values = { ++ 0: NONE, ++ 1: Weapon}; + +- static const fb.Reader reader = const _EquipmentTypeIdReader(); ++ static const fb.Reader reader = _EquipmentTypeIdReader(); + + @override + String toString() { +@@ -83,13 +94,13 @@ + + @override + EquipmentTypeId read(fb.BufferContext bc, int offset) => +- new EquipmentTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); ++ EquipmentTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); + } + + class Vec3 { + Vec3._(this._bc, this._bcOffset); + +- static const fb.Reader reader = const _Vec3Reader(); ++ static const fb.Reader reader = _Vec3Reader(); + + final fb.BufferContext _bc; + final int _bcOffset; +@@ -112,13 +123,11 @@ + + @override + Vec3 createObject(fb.BufferContext bc, int offset) => +- new Vec3._(bc, offset); ++ Vec3._(bc, offset); + } + + class Vec3Builder { +- Vec3Builder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ Vec3Builder(this.fbBuilder); + + final fb.Builder fbBuilder; + +@@ -137,9 +146,9 @@ + final double _z; + + Vec3ObjectBuilder({ +- double x, +- double y, +- double z, ++ required double x, ++ required double y, ++ required double z, + }) + : _x = x, + _y = y, +@@ -147,10 +156,7 @@ + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- ++ int finish(fb.Builder fbBuilder) { + fbBuilder.putFloat32(_z); + fbBuilder.putFloat32(_y); + fbBuilder.putFloat32(_x); +@@ -159,39 +165,39 @@ + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } + class Monster { + Monster._(this._bc, this._bcOffset); + factory Monster(List bytes) { +- fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); ++ final rootRef = fb.BufferContext.fromBytes(bytes); + return reader.read(rootRef, 0); + } + +- static const fb.Reader reader = const _MonsterReader(); ++ static const fb.Reader reader = _MonsterReader(); + + final fb.BufferContext _bc; + final int _bcOffset; + +- Vec3 get pos => Vec3.reader.vTableGet(_bc, _bcOffset, 4, null); ++ Vec3? get pos => Vec3.reader.vTableGetNullable(_bc, _bcOffset, 4); + int get mana => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 6, 150); + int get hp => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 100); +- String get name => const fb.StringReader().vTableGet(_bc, _bcOffset, 10, null); +- List get inventory => const fb.ListReader(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 14, null); +- Color get color => new Color.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 16, 2)); +- List get weapons => const fb.ListReader(Weapon.reader).vTableGet(_bc, _bcOffset, 18, null); +- EquipmentTypeId get equippedType => new EquipmentTypeId.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 20, 0)); ++ String? get name => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 10); ++ List? get inventory => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 14); ++ Color get color => Color.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 16, 2)); ++ List? get weapons => const fb.ListReader(Weapon.reader).vTableGetNullable(_bc, _bcOffset, 18); ++ EquipmentTypeId? get equippedType => EquipmentTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 20)); + dynamic get equipped { + switch (equippedType?.value) { +- case 1: return Weapon.reader.vTableGet(_bc, _bcOffset, 22, null); ++ case 1: return Weapon.reader.vTableGetNullable(_bc, _bcOffset, 22); + default: return null; + } + } +- List get path => const fb.ListReader(Vec3.reader).vTableGet(_bc, _bcOffset, 24, null); ++ List? get path => const fb.ListReader(Vec3.reader).vTableGetNullable(_bc, _bcOffset, 24); + + @override + String toString() { +@@ -204,57 +210,55 @@ + + @override + Monster createObject(fb.BufferContext bc, int offset) => +- new Monster._(bc, offset); ++ Monster._(bc, offset); + } + + class MonsterBuilder { +- MonsterBuilder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ MonsterBuilder(this.fbBuilder); + + final fb.Builder fbBuilder; + + void begin() { +- fbBuilder.startTable(); ++ fbBuilder.startTable(10); + } + + int addPos(int offset) { + fbBuilder.addStruct(0, offset); + return fbBuilder.offset; + } +- int addMana(int mana) { ++ int addMana(int? mana) { + fbBuilder.addInt16(1, mana); + return fbBuilder.offset; + } +- int addHp(int hp) { ++ int addHp(int? hp) { + fbBuilder.addInt16(2, hp); + return fbBuilder.offset; + } +- int addNameOffset(int offset) { ++ int addNameOffset(int? offset) { + fbBuilder.addOffset(3, offset); + return fbBuilder.offset; + } +- int addInventoryOffset(int offset) { ++ int addInventoryOffset(int? offset) { + fbBuilder.addOffset(5, offset); + return fbBuilder.offset; + } +- int addColor(Color color) { ++ int addColor(Color? color) { + fbBuilder.addInt8(6, color?.value); + return fbBuilder.offset; + } +- int addWeaponsOffset(int offset) { ++ int addWeaponsOffset(int? offset) { + fbBuilder.addOffset(7, offset); + return fbBuilder.offset; + } +- int addEquippedType(EquipmentTypeId equippedType) { ++ int addEquippedType(EquipmentTypeId? equippedType) { + fbBuilder.addUint8(8, equippedType?.value); + return fbBuilder.offset; + } +- int addEquippedOffset(int offset) { ++ int addEquippedOffset(int? offset) { + fbBuilder.addOffset(9, offset); + return fbBuilder.offset; + } +- int addPathOffset(int offset) { ++ int addPathOffset(int? offset) { + fbBuilder.addOffset(10, offset); + return fbBuilder.offset; + } +@@ -265,28 +269,28 @@ + } + + class MonsterObjectBuilder extends fb.ObjectBuilder { +- final Vec3ObjectBuilder _pos; +- final int _mana; +- final int _hp; +- final String _name; +- final List _inventory; +- final Color _color; +- final List _weapons; +- final EquipmentTypeId _equippedType; ++ final Vec3ObjectBuilder? _pos; ++ final int? _mana; ++ final int? _hp; ++ final String? _name; ++ final List? _inventory; ++ final Color? _color; ++ final List? _weapons; ++ final EquipmentTypeId? _equippedType; + final dynamic _equipped; +- final List _path; ++ final List? _path; + + MonsterObjectBuilder({ +- Vec3ObjectBuilder pos, +- int mana, +- int hp, +- String name, +- List inventory, +- Color color, +- List weapons, +- EquipmentTypeId equippedType, ++ Vec3ObjectBuilder? pos, ++ int? mana, ++ int? hp, ++ String? name, ++ List? inventory, ++ Color? color, ++ List? weapons, ++ EquipmentTypeId? equippedType, + dynamic equipped, +- List path, ++ List? path, + }) + : _pos = pos, + _mana = mana, +@@ -301,68 +305,53 @@ + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- final int nameOffset = fbBuilder.writeString(_name); +- final int inventoryOffset = _inventory?.isNotEmpty == true +- ? fbBuilder.writeListUint8(_inventory) +- : null; +- final int weaponsOffset = _weapons?.isNotEmpty == true +- ? fbBuilder.writeList(_weapons.map((b) => b.getOrCreateOffset(fbBuilder)).toList()) +- : null; +- final int equippedOffset = _equipped?.getOrCreateOffset(fbBuilder); +- final int pathOffset = _path?.isNotEmpty == true +- ? fbBuilder.writeListOfStructs(_path) +- : null; +- +- fbBuilder.startTable(); ++ int finish(fb.Builder fbBuilder) { ++ final int? nameOffset = _name == null ? null ++ : fbBuilder.writeString(_name!); ++ final int? inventoryOffset = _inventory == null ? null ++ : fbBuilder.writeListUint8(_inventory!); ++ final int? weaponsOffset = _weapons == null ? null ++ : fbBuilder.writeList(_weapons!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); ++ final int? equippedOffset = _equipped?.getOrCreateOffset(fbBuilder); ++ final int? pathOffset = _path == null ? null ++ : fbBuilder.writeListOfStructs(_path!); ++ fbBuilder.startTable(10); + if (_pos != null) { +- fbBuilder.addStruct(0, _pos.finish(fbBuilder)); ++ fbBuilder.addStruct(0, _pos!.finish(fbBuilder)); + } + fbBuilder.addInt16(1, _mana); + fbBuilder.addInt16(2, _hp); +- if (nameOffset != null) { +- fbBuilder.addOffset(3, nameOffset); +- } +- if (inventoryOffset != null) { +- fbBuilder.addOffset(5, inventoryOffset); +- } ++ fbBuilder.addOffset(3, nameOffset); ++ fbBuilder.addOffset(5, inventoryOffset); + fbBuilder.addInt8(6, _color?.value); +- if (weaponsOffset != null) { +- fbBuilder.addOffset(7, weaponsOffset); +- } ++ fbBuilder.addOffset(7, weaponsOffset); + fbBuilder.addUint8(8, _equippedType?.value); +- if (equippedOffset != null) { +- fbBuilder.addOffset(9, equippedOffset); +- } +- if (pathOffset != null) { +- fbBuilder.addOffset(10, pathOffset); +- } ++ fbBuilder.addOffset(9, equippedOffset); ++ fbBuilder.addOffset(10, pathOffset); + return fbBuilder.endTable(); + } + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } + class Weapon { + Weapon._(this._bc, this._bcOffset); + factory Weapon(List bytes) { +- fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); ++ final rootRef = fb.BufferContext.fromBytes(bytes); + return reader.read(rootRef, 0); + } + +- static const fb.Reader reader = const _WeaponReader(); ++ static const fb.Reader reader = _WeaponReader(); + + final fb.BufferContext _bc; + final int _bcOffset; + +- String get name => const fb.StringReader().vTableGet(_bc, _bcOffset, 4, null); ++ String? get name => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 4); + int get damage => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 6, 0); + + @override +@@ -376,25 +365,23 @@ + + @override + Weapon createObject(fb.BufferContext bc, int offset) => +- new Weapon._(bc, offset); ++ Weapon._(bc, offset); + } + + class WeaponBuilder { +- WeaponBuilder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ WeaponBuilder(this.fbBuilder); + + final fb.Builder fbBuilder; + + void begin() { +- fbBuilder.startTable(); ++ fbBuilder.startTable(2); + } + +- int addNameOffset(int offset) { ++ int addNameOffset(int? offset) { + fbBuilder.addOffset(0, offset); + return fbBuilder.offset; + } +- int addDamage(int damage) { ++ int addDamage(int? damage) { + fbBuilder.addInt16(1, damage); + return fbBuilder.offset; + } +@@ -405,36 +392,32 @@ + } + + class WeaponObjectBuilder extends fb.ObjectBuilder { +- final String _name; +- final int _damage; ++ final String? _name; ++ final int? _damage; + + WeaponObjectBuilder({ +- String name, +- int damage, ++ String? name, ++ int? damage, + }) + : _name = name, + _damage = damage; + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- final int nameOffset = fbBuilder.writeString(_name); +- +- fbBuilder.startTable(); +- if (nameOffset != null) { +- fbBuilder.addOffset(0, nameOffset); +- } ++ int finish(fb.Builder fbBuilder) { ++ final int? nameOffset = _name == null ? null ++ : fbBuilder.writeString(_name!); ++ fbBuilder.startTable(2); ++ fbBuilder.addOffset(0, nameOffset); + fbBuilder.addInt16(1, _damage); + return fbBuilder.endTable(); + } + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } +diff -urN a/dart/lib/flat_buffers.dart b/dart/lib/flat_buffers.dart +--- a/dart/lib/flat_buffers.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/lib/flat_buffers.dart 2023-01-13 07:47:11.787278913 +0000 +@@ -22,69 +22,70 @@ + /// + /// This callback is used by other struct's `finish` methods to write the nested + /// struct's fields inline. +-typedef void StructBuilder(); ++typedef StructBuilder = void Function(); + + /// Buffer with data and some context about it. + class BufferContext { + final ByteData _buffer; + +- factory BufferContext.fromBytes(List byteList) { +- Uint8List uint8List = _asUint8List(byteList); +- ByteData buf = new ByteData.view(uint8List.buffer, uint8List.offsetInBytes); +- return new BufferContext._(buf); +- } ++ ByteData get buffer => _buffer; + +- BufferContext._(this._buffer); ++ /// Create from a FlatBuffer represented by a list of bytes (uint8). ++ factory BufferContext.fromBytes(List byteList) => ++ BufferContext(byteList is Uint8List ++ ? byteList.buffer.asByteData(byteList.offsetInBytes) ++ : ByteData.view(Uint8List.fromList(byteList).buffer)); + +- int derefObject(int offset) { +- return offset + _getUint32(offset); +- } ++ /// Create from a FlatBuffer represented by ByteData. ++ BufferContext(this._buffer); ++ ++ @pragma('vm:prefer-inline') ++ int derefObject(int offset) => offset + _getUint32(offset); + +- Uint8List _asUint8LIst(int offset, int length) => ++ @pragma('vm:prefer-inline') ++ Uint8List _asUint8List(int offset, int length) => + _buffer.buffer.asUint8List(_buffer.offsetInBytes + offset, length); + +- double _getFloat64(int offset) => +- _buffer.getFloat64(offset, Endian.little); ++ @pragma('vm:prefer-inline') ++ double _getFloat64(int offset) => _buffer.getFloat64(offset, Endian.little); + +- double _getFloat32(int offset) => +- _buffer.getFloat32(offset, Endian.little); ++ @pragma('vm:prefer-inline') ++ double _getFloat32(int offset) => _buffer.getFloat32(offset, Endian.little); + +- int _getInt64(int offset) => +- _buffer.getInt64(offset, Endian.little); ++ @pragma('vm:prefer-inline') ++ int _getInt64(int offset) => _buffer.getInt64(offset, Endian.little); + +- int _getInt32(int offset) => +- _buffer.getInt32(offset, Endian.little); ++ @pragma('vm:prefer-inline') ++ int _getInt32(int offset) => _buffer.getInt32(offset, Endian.little); + +- int _getInt16(int offset) => +- _buffer.getInt16(offset, Endian.little); ++ @pragma('vm:prefer-inline') ++ int _getInt16(int offset) => _buffer.getInt16(offset, Endian.little); + ++ @pragma('vm:prefer-inline') + int _getInt8(int offset) => _buffer.getInt8(offset); + +- int _getUint64(int offset) => +- _buffer.getUint64(offset, Endian.little); ++ @pragma('vm:prefer-inline') ++ int _getUint64(int offset) => _buffer.getUint64(offset, Endian.little); + +- int _getUint32(int offset) => +- _buffer.getUint32(offset, Endian.little); ++ @pragma('vm:prefer-inline') ++ int _getUint32(int offset) => _buffer.getUint32(offset, Endian.little); + +- int _getUint16(int offset) => +- _buffer.getUint16(offset, Endian.little); ++ @pragma('vm:prefer-inline') ++ int _getUint16(int offset) => _buffer.getUint16(offset, Endian.little); + ++ @pragma('vm:prefer-inline') + int _getUint8(int offset) => _buffer.getUint8(offset); ++} + +- /// If the [byteList] is already a [Uint8List] return it. +- /// Otherwise return a [Uint8List] copy of the [byteList]. +- static Uint8List _asUint8List(List byteList) { +- if (byteList is Uint8List) { +- return byteList; +- } else { +- return new Uint8List.fromList(byteList); +- } +- } ++/// Interface implemented by the "object-api" classes (ending with "T"). ++abstract class Packable { ++ /// Serialize the object using the given builder, returning the offset. ++ int pack(Builder fbBuilder); + } + + /// Class implemented by typed builders generated by flatc. + abstract class ObjectBuilder { +- int _firstOffset; ++ int? _firstOffset; + + /// Can be used to write the data represented by this builder to the [Builder] + /// and reuse the offset created in multiple tables. +@@ -94,7 +95,7 @@ + /// first call to this method. + int getOrCreateOffset(Builder fbBuilder) { + _firstOffset ??= finish(fbBuilder); +- return _firstOffset; ++ return _firstOffset!; + } + + /// Writes the data in this helper to the [Builder]. +@@ -107,34 +108,39 @@ + + /// Class that helps building flat buffers. + class Builder { ++ bool _finished = false; ++ + final int initialSize; + + /// The list of existing VTable(s). +- //final List<_VTable> _vTables = <_VTable>[]; +- final List _vTables = []; ++ final List _vTables; ++ ++ final bool deduplicateTables; + + ByteData _buf; + ++ final Allocator _allocator; ++ + /// The maximum alignment that has been seen so far. If [_buf] has to be + /// reallocated in the future (to insert room at its start for more bytes) the + /// reallocation will need to be a multiple of this many bytes. +- int _maxAlign; ++ int _maxAlign = 1; + + /// The number of bytes that have been written to the buffer so far. The + /// most recently written byte is this many bytes from the end of [_buf]. +- int _tail; ++ int _tail = 0; + + /// The location of the end of the current table, measured in bytes from the +- /// end of [_buf], or `null` if a table is not currently being built. +- int _currentTableEndTail; ++ /// end of [_buf]. ++ int _currentTableEndTail = 0; + +- _VTable _currentVTable; ++ _VTable? _currentVTable; + + /// Map containing all strings that have been written so far. This allows us + /// to avoid duplicating strings. + /// + /// Allocated only if `internStrings` is set to true on the constructor. +- Map _strings; ++ Map? _strings; + + /// Creates a new FlatBuffers Builder. + /// +@@ -142,21 +148,28 @@ + /// automatically grow the array if/as needed. `internStrings`, if set to + /// true, will cause [writeString] to pool strings in the buffer so that + /// identical strings will always use the same offset in tables. +- Builder({this.initialSize: 1024, bool internStrings = false}) { +- if (internStrings == true) { +- _strings = new Map(); ++ Builder({ ++ this.initialSize = 1024, ++ bool internStrings = false, ++ Allocator allocator = const DefaultAllocator(), ++ this.deduplicateTables = true, ++ }) : _allocator = allocator, ++ _buf = allocator.allocate(initialSize), ++ _vTables = deduplicateTables ? [] : const [] { ++ if (internStrings) { ++ _strings = {}; + } +- reset(); + } + + /// Calculate the finished buffer size (aligned). +- int size() => _tail + ((-_tail) % _maxAlign); ++ @pragma('vm:prefer-inline') ++ int size() => _tail + ((-_tail) & (_maxAlign - 1)); + + /// Add the [field] with the given boolean [value]. The field is not added if + /// the [value] is equal to [def]. Booleans are stored as 8-bit fields with + /// `0` for `false` and `1` for `true`. +- void addBool(int field, bool value, [bool def]) { +- _ensureCurrentVTable(); ++ void addBool(int field, bool? value, [bool? def]) { ++ assert(_inVTable); + if (value != null && value != def) { + _prepare(_sizeofUint8, 1); + _trackField(field); +@@ -166,179 +179,183 @@ + + /// Add the [field] with the given 32-bit signed integer [value]. The field is + /// not added if the [value] is equal to [def]. +- void addInt32(int field, int value, [int def]) { +- _ensureCurrentVTable(); ++ void addInt32(int field, int? value, [int? def]) { ++ assert(_inVTable); + if (value != null && value != def) { + _prepare(_sizeofInt32, 1); + _trackField(field); +- _setInt32AtTail(_buf, _tail, value); ++ _setInt32AtTail(_tail, value); + } + } + + /// Add the [field] with the given 32-bit signed integer [value]. The field is + /// not added if the [value] is equal to [def]. +- void addInt16(int field, int value, [int def]) { +- _ensureCurrentVTable(); ++ void addInt16(int field, int? value, [int? def]) { ++ assert(_inVTable); + if (value != null && value != def) { + _prepare(_sizeofInt16, 1); + _trackField(field); +- _setInt16AtTail(_buf, _tail, value); ++ _setInt16AtTail(_tail, value); + } + } + + /// Add the [field] with the given 8-bit signed integer [value]. The field is + /// not added if the [value] is equal to [def]. +- void addInt8(int field, int value, [int def]) { +- _ensureCurrentVTable(); ++ void addInt8(int field, int? value, [int? def]) { ++ assert(_inVTable); + if (value != null && value != def) { + _prepare(_sizeofInt8, 1); + _trackField(field); +- _setInt8AtTail(_buf, _tail, value); ++ _setInt8AtTail(_tail, value); + } + } + + void addStruct(int field, int offset) { +- _ensureCurrentVTable(); ++ assert(_inVTable); + _trackField(field); +- _currentVTable.addField(field, offset); ++ _currentVTable!.addField(field, offset); + } + + /// Add the [field] referencing an object with the given [offset]. +- void addOffset(int field, int offset) { +- _ensureCurrentVTable(); ++ void addOffset(int field, int? offset) { ++ assert(_inVTable); + if (offset != null) { + _prepare(_sizeofUint32, 1); + _trackField(field); +- _setUint32AtTail(_buf, _tail, _tail - offset); ++ _setUint32AtTail(_tail, _tail - offset); + } + } + + /// Add the [field] with the given 32-bit unsigned integer [value]. The field + /// is not added if the [value] is equal to [def]. +- void addUint32(int field, int value, [int def]) { +- _ensureCurrentVTable(); ++ void addUint32(int field, int? value, [int? def]) { ++ assert(_inVTable); + if (value != null && value != def) { + _prepare(_sizeofUint32, 1); + _trackField(field); +- _setUint32AtTail(_buf, _tail, value); ++ _setUint32AtTail(_tail, value); + } + } + + /// Add the [field] with the given 32-bit unsigned integer [value]. The field + /// is not added if the [value] is equal to [def]. +- void addUint16(int field, int value, [int def]) { +- _ensureCurrentVTable(); ++ void addUint16(int field, int? value, [int? def]) { ++ assert(_inVTable); + if (value != null && value != def) { + _prepare(_sizeofUint16, 1); + _trackField(field); +- _setUint16AtTail(_buf, _tail, value); ++ _setUint16AtTail(_tail, value); + } + } + + /// Add the [field] with the given 8-bit unsigned integer [value]. The field + /// is not added if the [value] is equal to [def]. +- void addUint8(int field, int value, [int def]) { +- _ensureCurrentVTable(); ++ void addUint8(int field, int? value, [int? def]) { ++ assert(_inVTable); + if (value != null && value != def) { + _prepare(_sizeofUint8, 1); + _trackField(field); +- _setUint8AtTail(_buf, _tail, value); ++ _setUint8AtTail(_tail, value); + } + } + + /// Add the [field] with the given 32-bit float [value]. The field + /// is not added if the [value] is equal to [def]. +- void addFloat32(int field, double value, [double def]) { +- _ensureCurrentVTable(); ++ void addFloat32(int field, double? value, [double? def]) { ++ assert(_inVTable); + if (value != null && value != def) { + _prepare(_sizeofFloat32, 1); + _trackField(field); +- _setFloat32AtTail(_buf, _tail, value); ++ _setFloat32AtTail(_tail, value); + } + } + + /// Add the [field] with the given 64-bit double [value]. The field + /// is not added if the [value] is equal to [def]. +- void addFloat64(int field, double value, [double def]) { +- _ensureCurrentVTable(); ++ void addFloat64(int field, double? value, [double? def]) { ++ assert(_inVTable); + if (value != null && value != def) { + _prepare(_sizeofFloat64, 1); + _trackField(field); +- _setFloat64AtTail(_buf, _tail, value); ++ _setFloat64AtTail(_tail, value); + } + } + + /// Add the [field] with the given 64-bit unsigned integer [value]. The field + /// is not added if the [value] is equal to [def]. +- void addUint64(int field, int value, [double def]) { +- _ensureCurrentVTable(); ++ void addUint64(int field, int? value, [double? def]) { ++ assert(_inVTable); + if (value != null && value != def) { + _prepare(_sizeofUint64, 1); + _trackField(field); +- _setUint64AtTail(_buf, _tail, value); ++ _setUint64AtTail(_tail, value); + } + } + + /// Add the [field] with the given 64-bit unsigned integer [value]. The field + /// is not added if the [value] is equal to [def]. +- void addInt64(int field, int value, [double def]) { +- _ensureCurrentVTable(); ++ void addInt64(int field, int? value, [double? def]) { ++ assert(_inVTable); + if (value != null && value != def) { + _prepare(_sizeofInt64, 1); + _trackField(field); +- _setInt64AtTail(_buf, _tail, value); ++ _setInt64AtTail(_tail, value); + } + } + + /// End the current table and return its offset. + int endTable() { +- if (_currentVTable == null) { +- throw new StateError('Start a table before ending it.'); +- } ++ assert(_inVTable); + // Prepare for writing the VTable. + _prepare(_sizeofInt32, 1); +- int tableTail = _tail; ++ var tableTail = _tail; + // Prepare the size of the current table. +- _currentVTable.tableSize = tableTail - _currentTableEndTail; ++ final currentVTable = _currentVTable!; ++ currentVTable.tableSize = tableTail - _currentTableEndTail; + // Prepare the VTable to use for the current table. +- int vTableTail; ++ int? vTableTail; + { +- _currentVTable.computeFieldOffsets(tableTail); ++ currentVTable.computeFieldOffsets(tableTail); ++ + // Try to find an existing compatible VTable. +- // Search backward - more likely to have recently used one +- for (int i = _vTables.length - 1; i >= 0; i--) { +- final int vt2Offset = _vTables[i]; +- final int vt2Start = _buf.lengthInBytes - vt2Offset; +- final int vt2Size = _buf.getUint16(vt2Start, Endian.little); +- +- if (_currentVTable._vTableSize == vt2Size && +- _currentVTable._offsetsMatch(vt2Start, _buf)) { +- vTableTail = vt2Offset; +- break; ++ if (deduplicateTables) { ++ // Search backward - more likely to have recently used one ++ for (var i = _vTables.length - 1; i >= 0; i--) { ++ final vt2Offset = _vTables[i]; ++ final vt2Start = _buf.lengthInBytes - vt2Offset; ++ final vt2Size = _buf.getUint16(vt2Start, Endian.little); ++ ++ if (currentVTable._vTableSize == vt2Size && ++ currentVTable._offsetsMatch(vt2Start, _buf)) { ++ vTableTail = vt2Offset; ++ break; ++ } + } + } ++ + // Write a new VTable. + if (vTableTail == null) { +- _prepare(_sizeofUint16, _currentVTable.numOfUint16); ++ _prepare(_sizeofUint16, _currentVTable!.numOfUint16); + vTableTail = _tail; +- _currentVTable.tail = vTableTail; +- _currentVTable.output(_buf, _buf.lengthInBytes - _tail); +- _vTables.add(_currentVTable.tail); ++ currentVTable.tail = vTableTail; ++ currentVTable.output(_buf, _buf.lengthInBytes - _tail); ++ if (deduplicateTables) _vTables.add(currentVTable.tail); + } + } + // Set the VTable offset. +- _setInt32AtTail(_buf, tableTail, vTableTail - tableTail); ++ _setInt32AtTail(tableTail, vTableTail - tableTail); + // Done with this table. + _currentVTable = null; + return tableTail; + } + +- /// This method low level method can be used to return a raw piece of the buffer +- /// after using the the put* methods. +- /// +- /// Most clients should prefer calling [finish]. +- Uint8List lowFinish() { +- return _buf.buffer.asUint8List(_buf.lengthInBytes - size()); ++ /// Returns the finished buffer. You must call [finish] before accessing this. ++ @pragma('vm:prefer-inline') ++ Uint8List get buffer { ++ assert(_finished); ++ final finishedSize = size(); ++ return _buf.buffer ++ .asUint8List(_buf.lengthInBytes - finishedSize, finishedSize); + } + + /// Finish off the creation of the buffer. The given [offset] is used as the +@@ -346,17 +363,26 @@ + /// written object. If [fileIdentifier] is specified (and not `null`), it is + /// interpreted as a 4-byte Latin-1 encoded string that should be placed at + /// bytes 4-7 of the file. +- Uint8List finish(int offset, [String fileIdentifier]) { +- _prepare(max(_sizeofUint32, _maxAlign), fileIdentifier == null ? 1 : 2); ++ void finish(int offset, [String? fileIdentifier]) { ++ final sizeBeforePadding = size(); ++ final requiredBytes = _sizeofUint32 * (fileIdentifier == null ? 1 : 2); ++ _prepare(max(requiredBytes, _maxAlign), 1); + final finishedSize = size(); +- _setUint32AtTail(_buf, finishedSize, finishedSize - offset); ++ _setUint32AtTail(finishedSize, finishedSize - offset); + if (fileIdentifier != null) { +- for (int i = 0; i < 4; i++) { +- _setUint8AtTail(_buf, finishedSize - _sizeofUint32 - i, +- fileIdentifier.codeUnitAt(i)); ++ for (var i = 0; i < 4; i++) { ++ _setUint8AtTail( ++ finishedSize - _sizeofUint32 - i, fileIdentifier.codeUnitAt(i)); + } + } +- return _buf.buffer.asUint8List(_buf.lengthInBytes - finishedSize); ++ ++ // zero out the added padding ++ for (var i = sizeBeforePadding + 1; ++ i <= finishedSize - requiredBytes; ++ i++) { ++ _setUint8AtTail(i, 0); ++ } ++ _finished = true; + } + + /// Writes a Float64 to the tail of the buffer after preparing space for it. +@@ -364,7 +390,7 @@ + /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. + void putFloat64(double value) { + _prepare(_sizeofFloat64, 1); +- _setFloat32AtTail(_buf, _tail, value); ++ _setFloat32AtTail(_tail, value); + } + + /// Writes a Float32 to the tail of the buffer after preparing space for it. +@@ -372,7 +398,7 @@ + /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. + void putFloat32(double value) { + _prepare(_sizeofFloat32, 1); +- _setFloat32AtTail(_buf, _tail, value); ++ _setFloat32AtTail(_tail, value); + } + + /// Writes a Int64 to the tail of the buffer after preparing space for it. +@@ -380,7 +406,7 @@ + /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. + void putInt64(int value) { + _prepare(_sizeofInt64, 1); +- _setInt64AtTail(_buf, _tail, value); ++ _setInt64AtTail(_tail, value); + } + + /// Writes a Uint32 to the tail of the buffer after preparing space for it. +@@ -388,7 +414,7 @@ + /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. + void putInt32(int value) { + _prepare(_sizeofInt32, 1); +- _setInt32AtTail(_buf, _tail, value); ++ _setInt32AtTail(_tail, value); + } + + /// Writes a Uint16 to the tail of the buffer after preparing space for it. +@@ -396,7 +422,7 @@ + /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. + void putInt16(int value) { + _prepare(_sizeofInt16, 1); +- _setInt16AtTail(_buf, _tail, value); ++ _setInt16AtTail(_tail, value); + } + + /// Writes a Uint8 to the tail of the buffer after preparing space for it. +@@ -412,7 +438,7 @@ + /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. + void putUint64(int value) { + _prepare(_sizeofUint64, 1); +- _setUint64AtTail(_buf, _tail, value); ++ _setUint64AtTail(_tail, value); + } + + /// Writes a Uint32 to the tail of the buffer after preparing space for it. +@@ -420,7 +446,7 @@ + /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. + void putUint32(int value) { + _prepare(_sizeofUint32, 1); +- _setUint32AtTail(_buf, _tail, value); ++ _setUint32AtTail(_tail, value); + } + + /// Writes a Uint16 to the tail of the buffer after preparing space for it. +@@ -428,7 +454,7 @@ + /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. + void putUint16(int value) { + _prepare(_sizeofUint16, 1); +- _setUint16AtTail(_buf, _tail, value); ++ _setUint16AtTail(_tail, value); + } + + /// Writes a Uint8 to the tail of the buffer after preparing space for it. +@@ -441,22 +467,20 @@ + + /// Reset the builder and make it ready for filling a new buffer. + void reset() { +- _buf = new ByteData(initialSize); ++ _finished = false; + _maxAlign = 1; + _tail = 0; + _currentVTable = null; +- _vTables.clear(); ++ if (deduplicateTables) _vTables.clear(); + if (_strings != null) { +- _strings = new Map(); ++ _strings = {}; + } + } + +- /// Start a new table. Must be finished with [endTable] invocation. +- void startTable() { +- if (_currentVTable != null) { +- throw new StateError('Inline tables are not supported.'); +- } +- _currentVTable = new _VTable(); ++ /// Start a new table. Must be finished with [endTable] invocation. ++ void startTable(int numFields) { ++ assert(!_inVTable); // Inline tables are not supported. ++ _currentVTable = _VTable(numFields); + _currentTableEndTail = _tail; + } + +@@ -470,8 +494,8 @@ + + /// Writes a list of Structs to the buffer, returning the offset + int writeListOfStructs(List structBuilders) { +- _ensureNoVTable(); +- for (int i = structBuilders.length - 1; i >= 0; i--) { ++ assert(!_inVTable); ++ for (var i = structBuilders.length - 1; i >= 0; i--) { + structBuilders[i].finish(this); + } + return endStructVector(structBuilders.length); +@@ -479,14 +503,14 @@ + + /// Write the given list of [values]. + int writeList(List values) { +- _ensureNoVTable(); ++ assert(!_inVTable); + _prepare(_sizeofUint32, 1 + values.length); +- final int result = _tail; +- int tail = _tail; +- _setUint32AtTail(_buf, tail, values.length); ++ final result = _tail; ++ var tail = _tail; ++ _setUint32AtTail(tail, values.length); + tail -= _sizeofUint32; +- for (int value in values) { +- _setUint32AtTail(_buf, tail, tail - value); ++ for (var value in values) { ++ _setUint32AtTail(tail, tail - value); + tail -= _sizeofUint32; + } + return result; +@@ -494,14 +518,14 @@ + + /// Write the given list of 64-bit float [values]. + int writeListFloat64(List values) { +- _ensureNoVTable(); ++ assert(!_inVTable); + _prepare(_sizeofFloat64, values.length, additionalBytes: _sizeofUint32); +- final int result = _tail; +- int tail = _tail; +- _setUint32AtTail(_buf, tail, values.length); ++ final result = _tail; ++ var tail = _tail; ++ _setUint32AtTail(tail, values.length); + tail -= _sizeofUint32; +- for (double value in values) { +- _setFloat64AtTail(_buf, tail, value); ++ for (var value in values) { ++ _setFloat64AtTail(tail, value); + tail -= _sizeofFloat64; + } + return result; +@@ -509,14 +533,14 @@ + + /// Write the given list of 32-bit float [values]. + int writeListFloat32(List values) { +- _ensureNoVTable(); ++ assert(!_inVTable); + _prepare(_sizeofFloat32, 1 + values.length); +- final int result = _tail; +- int tail = _tail; +- _setUint32AtTail(_buf, tail, values.length); ++ final result = _tail; ++ var tail = _tail; ++ _setUint32AtTail(tail, values.length); + tail -= _sizeofUint32; +- for (double value in values) { +- _setFloat32AtTail(_buf, tail, value); ++ for (var value in values) { ++ _setFloat32AtTail(tail, value); + tail -= _sizeofFloat32; + } + return result; +@@ -524,14 +548,14 @@ + + /// Write the given list of signed 64-bit integer [values]. + int writeListInt64(List values) { +- _ensureNoVTable(); ++ assert(!_inVTable); + _prepare(_sizeofInt64, values.length, additionalBytes: _sizeofUint32); +- final int result = _tail; +- int tail = _tail; +- _setUint32AtTail(_buf, tail, values.length); ++ final result = _tail; ++ var tail = _tail; ++ _setUint32AtTail(tail, values.length); + tail -= _sizeofUint32; +- for (int value in values) { +- _setInt64AtTail(_buf, tail, value); ++ for (var value in values) { ++ _setInt64AtTail(tail, value); + tail -= _sizeofInt64; + } + return result; +@@ -539,14 +563,14 @@ + + /// Write the given list of signed 64-bit integer [values]. + int writeListUint64(List values) { +- _ensureNoVTable(); ++ assert(!_inVTable); + _prepare(_sizeofUint64, values.length, additionalBytes: _sizeofUint32); +- final int result = _tail; +- int tail = _tail; +- _setUint32AtTail(_buf, tail, values.length); ++ final result = _tail; ++ var tail = _tail; ++ _setUint32AtTail(tail, values.length); + tail -= _sizeofUint32; +- for (int value in values) { +- _setUint64AtTail(_buf, tail, value); ++ for (var value in values) { ++ _setUint64AtTail(tail, value); + tail -= _sizeofUint64; + } + return result; +@@ -554,14 +578,14 @@ + + /// Write the given list of signed 32-bit integer [values]. + int writeListInt32(List values) { +- _ensureNoVTable(); ++ assert(!_inVTable); + _prepare(_sizeofUint32, 1 + values.length); +- final int result = _tail; +- int tail = _tail; +- _setUint32AtTail(_buf, tail, values.length); ++ final result = _tail; ++ var tail = _tail; ++ _setUint32AtTail(tail, values.length); + tail -= _sizeofUint32; +- for (int value in values) { +- _setInt32AtTail(_buf, tail, value); ++ for (var value in values) { ++ _setInt32AtTail(tail, value); + tail -= _sizeofInt32; + } + return result; +@@ -569,14 +593,14 @@ + + /// Write the given list of unsigned 32-bit integer [values]. + int writeListUint32(List values) { +- _ensureNoVTable(); ++ assert(!_inVTable); + _prepare(_sizeofUint32, 1 + values.length); +- final int result = _tail; +- int tail = _tail; +- _setUint32AtTail(_buf, tail, values.length); ++ final result = _tail; ++ var tail = _tail; ++ _setUint32AtTail(tail, values.length); + tail -= _sizeofUint32; +- for (int value in values) { +- _setUint32AtTail(_buf, tail, value); ++ for (var value in values) { ++ _setUint32AtTail(tail, value); + tail -= _sizeofUint32; + } + return result; +@@ -584,14 +608,14 @@ + + /// Write the given list of signed 16-bit integer [values]. + int writeListInt16(List values) { +- _ensureNoVTable(); ++ assert(!_inVTable); + _prepare(_sizeofUint32, 1, additionalBytes: 2 * values.length); +- final int result = _tail; +- int tail = _tail; +- _setUint32AtTail(_buf, tail, values.length); ++ final result = _tail; ++ var tail = _tail; ++ _setUint32AtTail(tail, values.length); + tail -= _sizeofUint32; +- for (int value in values) { +- _setInt16AtTail(_buf, tail, value); ++ for (var value in values) { ++ _setInt16AtTail(tail, value); + tail -= _sizeofInt16; + } + return result; +@@ -599,14 +623,14 @@ + + /// Write the given list of unsigned 16-bit integer [values]. + int writeListUint16(List values) { +- _ensureNoVTable(); ++ assert(!_inVTable); + _prepare(_sizeofUint32, 1, additionalBytes: 2 * values.length); +- final int result = _tail; +- int tail = _tail; +- _setUint32AtTail(_buf, tail, values.length); ++ final result = _tail; ++ var tail = _tail; ++ _setUint32AtTail(tail, values.length); + tail -= _sizeofUint32; +- for (int value in values) { +- _setUint16AtTail(_buf, tail, value); ++ for (var value in values) { ++ _setUint16AtTail(tail, value); + tail -= _sizeofUint16; + } + return result; +@@ -614,19 +638,19 @@ + + /// Write the given list of bools as unsigend 8-bit integer [values]. + int writeListBool(List values) { +- return writeListUint8(values?.map((b) => b ? 1 : 0)?.toList()); ++ return writeListUint8(values.map((b) => b ? 1 : 0).toList()); + } + + /// Write the given list of signed 8-bit integer [values]. + int writeListInt8(List values) { +- _ensureNoVTable(); ++ assert(!_inVTable); + _prepare(_sizeofUint32, 1, additionalBytes: values.length); +- final int result = _tail; +- int tail = _tail; +- _setUint32AtTail(_buf, tail, values.length); ++ final result = _tail; ++ var tail = _tail; ++ _setUint32AtTail(tail, values.length); + tail -= _sizeofUint32; +- for (int value in values) { +- _setInt8AtTail(_buf, tail, value); ++ for (var value in values) { ++ _setInt8AtTail(tail, value); + tail -= _sizeofUint8; + } + return result; +@@ -634,147 +658,187 @@ + + /// Write the given list of unsigned 8-bit integer [values]. + int writeListUint8(List values) { +- _ensureNoVTable(); ++ assert(!_inVTable); + _prepare(_sizeofUint32, 1, additionalBytes: values.length); +- final int result = _tail; +- int tail = _tail; +- _setUint32AtTail(_buf, tail, values.length); ++ final result = _tail; ++ var tail = _tail; ++ _setUint32AtTail(tail, values.length); + tail -= _sizeofUint32; +- for (int value in values) { +- _setUint8AtTail(_buf, tail, value); ++ for (var value in values) { ++ _setUint8AtTail(tail, value); + tail -= _sizeofUint8; + } + return result; + } + +- /// Write the given string [value] and return its offset, or `null` if +- /// the [value] is `null`. +- int writeString(String value) { +- _ensureNoVTable(); +- if (value != null) { +- if (_strings != null) { +- return _strings.putIfAbsent(value, () => _writeString(value)); +- } else { +- return _writeString(value); +- } ++ /// Write the given string [value] and return its offset. ++ /// ++ /// Dart strings are UTF-16 but must be stored as UTF-8 in FlatBuffers. ++ /// If the given string consists only of ASCII characters, you can indicate ++ /// enable [asciiOptimization]. In this mode, [writeString()] first tries to ++ /// copy the ASCII string directly to the output buffer and if that fails ++ /// (because there are no-ASCII characters in the string) it falls back and to ++ /// the default UTF-16 -> UTF-8 conversion (with slight performance penalty). ++ int writeString(String value, {bool asciiOptimization = false}) { ++ assert(!_inVTable); ++ if (_strings != null) { ++ return _strings! ++ .putIfAbsent(value, () => _writeString(value, asciiOptimization)); ++ } else { ++ return _writeString(value, asciiOptimization); + } +- return null; + } + +- int _writeString(String value) { +- // TODO(scheglov) optimize for ASCII strings +- List bytes = utf8.encode(value); +- int length = bytes.length; +- _prepare(4, 1, additionalBytes: length + 1); +- final int result = _tail; +- _setUint32AtTail(_buf, _tail, length); +- int offset = _buf.lengthInBytes - _tail + 4; +- for (int i = 0; i < length; i++) { +- _buf.setUint8(offset++, bytes[i]); ++ int _writeString(String value, bool asciiOptimization) { ++ if (asciiOptimization) { ++ // [utf8.encode()] is slow (up to at least Dart SDK 2.13). If the given ++ // string is ASCII we can just write it directly, without any conversion. ++ final originalTail = _tail; ++ if (_tryWriteASCIIString(value)) return _tail; ++ // if non-ASCII: reset the output buffer position for [_writeUTFString()] ++ _tail = originalTail; + } +- _buf.setUint8(offset, 0); // trailing zero +- return result; ++ _writeUTFString(value); ++ return _tail; + } + +- /// Throw an exception if there is not currently a vtable. +- void _ensureCurrentVTable() { +- if (_currentVTable == null) { +- throw new StateError('Start a table before adding values.'); ++ // Try to write the string as ASCII, return false if there's a non-ascii char. ++ @pragma('vm:prefer-inline') ++ bool _tryWriteASCIIString(String value) { ++ _prepare(4, 1, additionalBytes: value.length + 1); ++ final length = value.length; ++ var offset = _buf.lengthInBytes - _tail + 4; ++ for (var i = 0; i < length; i++) { ++ // utf16 code unit, e.g. for '†' it's [0x20 0x20], which is 8224 decimal. ++ // ASCII characters go from 0x00 to 0x7F (which is 0 to 127 decimal). ++ final char = value.codeUnitAt(i); ++ if ((char & ~0x7F) != 0) { ++ return false; ++ } ++ _buf.setUint8(offset++, char); + } ++ _buf.setUint8(offset, 0); // trailing zero ++ _setUint32AtTail(_tail, value.length); ++ return true; + } + +- /// Throw an exception if there is currently a vtable. +- void _ensureNoVTable() { +- if (_currentVTable != null) { +- throw new StateError( +- 'Cannot write a non-scalar value while writing a table.'); ++ @pragma('vm:prefer-inline') ++ void _writeUTFString(String value) { ++ final bytes = utf8.encode(value) as Uint8List; ++ final length = bytes.length; ++ _prepare(4, 1, additionalBytes: length + 1); ++ _setUint32AtTail(_tail, length); ++ var offset = _buf.lengthInBytes - _tail + 4; ++ for (var i = 0; i < length; i++) { ++ _buf.setUint8(offset++, bytes[i]); + } ++ _buf.setUint8(offset, 0); // trailing zero + } + ++ /// Used to assert whether a "Table" is currently being built. ++ /// ++ /// If you hit `assert(!_inVTable())`, you're trying to add table fields ++ /// without starting a table with [Builder.startTable()]. ++ /// ++ /// If you hit `assert(_inVTable())`, you're trying to construct a ++ /// Table/Vector/String during the construction of its parent table, ++ /// between the MyTableBuilder and [Builder.endTable()]. ++ /// Move the creation of these sub-objects to before the MyTableBuilder to ++ /// not get this assert. ++ @pragma('vm:prefer-inline') ++ bool get _inVTable => _currentVTable != null; ++ + /// The number of bytes that have been written to the buffer so far. The + /// most recently written byte is this many bytes from the end of the buffer. ++ @pragma('vm:prefer-inline') + int get offset => _tail; + + /// Zero-pads the buffer, which may be required for some struct layouts. ++ @pragma('vm:prefer-inline') + void pad(int howManyBytes) { +- for (int i = 0; i < howManyBytes; i++) putUint8(0); ++ for (var i = 0; i < howManyBytes; i++) { ++ putUint8(0); ++ } + } + + /// Prepare for writing the given `count` of scalars of the given `size`. + /// Additionally allocate the specified `additionalBytes`. Update the current + /// tail pointer to point at the allocated space. ++ @pragma('vm:prefer-inline') + void _prepare(int size, int count, {int additionalBytes = 0}) { ++ assert(!_finished); + // Update the alignment. + if (_maxAlign < size) { + _maxAlign = size; + } + // Prepare amount of required space. +- int dataSize = size * count + additionalBytes; +- int alignDelta = (-(_tail + dataSize)) % size; +- int bufSize = alignDelta + dataSize; ++ var dataSize = size * count + additionalBytes; ++ var alignDelta = (-(_tail + dataSize)) & (size - 1); ++ var bufSize = alignDelta + dataSize; + // Ensure that we have the required amount of space. + { +- int oldCapacity = _buf.lengthInBytes; ++ var oldCapacity = _buf.lengthInBytes; + if (_tail + bufSize > oldCapacity) { +- int desiredNewCapacity = (oldCapacity + bufSize) * 2; +- int deltaCapacity = desiredNewCapacity - oldCapacity; +- deltaCapacity += (-deltaCapacity) % _maxAlign; +- int newCapacity = oldCapacity + deltaCapacity; +- ByteData newBuf = new ByteData(newCapacity); +- newBuf.buffer +- .asUint8List() +- .setAll(deltaCapacity, _buf.buffer.asUint8List()); +- _buf = newBuf; ++ var desiredNewCapacity = (oldCapacity + bufSize) * 2; ++ var deltaCapacity = desiredNewCapacity - oldCapacity; ++ deltaCapacity += (-deltaCapacity) & (_maxAlign - 1); ++ var newCapacity = oldCapacity + deltaCapacity; ++ _buf = _allocator.resize(_buf, newCapacity, _tail, 0); + } + } ++ ++ // zero out the added padding ++ for (var i = _tail + 1; i <= _tail + alignDelta; i++) { ++ _setUint8AtTail(i, 0); ++ } ++ + // Update the tail pointer. + _tail += bufSize; + } + + /// Record the offset of the given [field]. +- void _trackField(int field) { +- _currentVTable.addField(field, _tail); +- } +- +- static void _setFloat64AtTail(ByteData _buf, int tail, double x) { +- _buf.setFloat64(_buf.lengthInBytes - tail, x, Endian.little); +- } +- +- static void _setFloat32AtTail(ByteData _buf, int tail, double x) { +- _buf.setFloat32(_buf.lengthInBytes - tail, x, Endian.little); +- } +- +- static void _setUint64AtTail(ByteData _buf, int tail, int x) { +- _buf.setUint64(_buf.lengthInBytes - tail, x, Endian.little); +- } +- +- static void _setInt64AtTail(ByteData _buf, int tail, int x) { +- _buf.setInt64(_buf.lengthInBytes - tail, x, Endian.little); +- } ++ @pragma('vm:prefer-inline') ++ void _trackField(int field) => _currentVTable!.addField(field, _tail); + +- static void _setInt32AtTail(ByteData _buf, int tail, int x) { +- _buf.setInt32(_buf.lengthInBytes - tail, x, Endian.little); +- } +- +- static void _setUint32AtTail(ByteData _buf, int tail, int x) { +- _buf.setUint32(_buf.lengthInBytes - tail, x, Endian.little); +- } +- +- static void _setInt16AtTail(ByteData _buf, int tail, int x) { +- _buf.setInt16(_buf.lengthInBytes - tail, x, Endian.little); +- } +- +- static void _setUint16AtTail(ByteData _buf, int tail, int x) { +- _buf.setUint16(_buf.lengthInBytes - tail, x, Endian.little); +- } +- +- static void _setInt8AtTail(ByteData _buf, int tail, int x) { +- _buf.setInt8(_buf.lengthInBytes - tail, x); +- } +- +- static void _setUint8AtTail(ByteData _buf, int tail, int x) { +- _buf.setUint8(_buf.lengthInBytes - tail, x); +- } ++ @pragma('vm:prefer-inline') ++ void _setFloat64AtTail(int tail, double x) => ++ _buf.setFloat64(_buf.lengthInBytes - tail, x, Endian.little); ++ ++ @pragma('vm:prefer-inline') ++ void _setFloat32AtTail(int tail, double x) => ++ _buf.setFloat32(_buf.lengthInBytes - tail, x, Endian.little); ++ ++ @pragma('vm:prefer-inline') ++ void _setUint64AtTail(int tail, int x) => ++ _buf.setUint64(_buf.lengthInBytes - tail, x, Endian.little); ++ ++ @pragma('vm:prefer-inline') ++ void _setInt64AtTail(int tail, int x) => ++ _buf.setInt64(_buf.lengthInBytes - tail, x, Endian.little); ++ ++ @pragma('vm:prefer-inline') ++ void _setInt32AtTail(int tail, int x) => ++ _buf.setInt32(_buf.lengthInBytes - tail, x, Endian.little); ++ ++ @pragma('vm:prefer-inline') ++ void _setUint32AtTail(int tail, int x) => ++ _buf.setUint32(_buf.lengthInBytes - tail, x, Endian.little); ++ ++ @pragma('vm:prefer-inline') ++ void _setInt16AtTail(int tail, int x) => ++ _buf.setInt16(_buf.lengthInBytes - tail, x, Endian.little); ++ ++ @pragma('vm:prefer-inline') ++ void _setUint16AtTail(int tail, int x) => ++ _buf.setUint16(_buf.lengthInBytes - tail, x, Endian.little); ++ ++ @pragma('vm:prefer-inline') ++ void _setInt8AtTail(int tail, int x) => ++ _buf.setInt8(_buf.lengthInBytes - tail, x); ++ ++ @pragma('vm:prefer-inline') ++ void _setUint8AtTail(int tail, int x) => ++ _buf.setUint8(_buf.lengthInBytes - tail, x); + } + + /// Reader of lists of boolean values. +@@ -784,11 +848,13 @@ + const BoolListReader(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofUint32; + + @override ++ @pragma('vm:prefer-inline') + List read(BufferContext bc, int offset) => +- new _FbBoolList(bc, bc.derefObject(offset)); ++ _FbBoolList(bc, bc.derefObject(offset)); + } + + /// The reader of booleans. +@@ -796,9 +862,11 @@ + const BoolReader() : super(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofUint8; + + @override ++ @pragma('vm:prefer-inline') + bool read(BufferContext bc, int offset) => bc._getInt8(offset) != 0; + } + +@@ -809,31 +877,37 @@ + const Float64ListReader(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofFloat64; + + @override ++ @pragma('vm:prefer-inline') + List read(BufferContext bc, int offset) => +- new _FbFloat64List(bc, bc.derefObject(offset)); ++ _FbFloat64List(bc, bc.derefObject(offset)); + } + + class Float32ListReader extends Reader> { + const Float32ListReader(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofFloat32; + + @override ++ @pragma('vm:prefer-inline') + List read(BufferContext bc, int offset) => +- new _FbFloat32List(bc, bc.derefObject(offset)); ++ _FbFloat32List(bc, bc.derefObject(offset)); + } + + class Float64Reader extends Reader { + const Float64Reader(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofFloat64; + + @override ++ @pragma('vm:prefer-inline') + double read(BufferContext bc, int offset) => bc._getFloat64(offset); + } + +@@ -841,18 +915,23 @@ + const Float32Reader(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofFloat32; + + @override ++ @pragma('vm:prefer-inline') + double read(BufferContext bc, int offset) => bc._getFloat32(offset); + } + + class Int64Reader extends Reader { + const Int64Reader() : super(); ++ + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofInt64; + + @override ++ @pragma('vm:prefer-inline') + int read(BufferContext bc, int offset) => bc._getInt64(offset); + } + +@@ -861,9 +940,11 @@ + const Int32Reader() : super(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofInt32; + + @override ++ @pragma('vm:prefer-inline') + int read(BufferContext bc, int offset) => bc._getInt32(offset); + } + +@@ -872,9 +953,11 @@ + const Int16Reader() : super(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofInt16; + + @override ++ @pragma('vm:prefer-inline') + int read(BufferContext bc, int offset) => bc._getInt16(offset); + } + +@@ -883,26 +966,43 @@ + const Int8Reader() : super(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofInt8; + + @override ++ @pragma('vm:prefer-inline') + int read(BufferContext bc, int offset) => bc._getInt8(offset); + } + +-/// The reader of lists of objects. +-/// +-/// The returned unmodifiable lists lazily read objects on access. ++/// The reader of lists of objects. Lazy by default - see [lazy]. + class ListReader extends Reader> { + final Reader _elementReader; + +- const ListReader(this._elementReader); ++ /// Enables lazy reading of the list ++ /// ++ /// If true, the returned unmodifiable list lazily reads objects on access. ++ /// Therefore, the underlying buffer must not change while accessing the list. ++ /// ++ /// If false, reads the whole list immediately on access. ++ final bool lazy; ++ ++ const ListReader(this._elementReader, {this.lazy = true}); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofUint32; + + @override +- List read(BufferContext bc, int offset) => +- new _FbGenericList(_elementReader, bc, bc.derefObject(offset)); ++ List read(BufferContext bc, int offset) { ++ final listOffset = bc.derefObject(offset); ++ return lazy ++ ? _FbGenericList(_elementReader, bc, listOffset) ++ : List.generate( ++ bc.buffer.getUint32(listOffset, Endian.little), ++ (int index) => _elementReader.read( ++ bc, listOffset + size + _elementReader.size * index), ++ growable: true); ++ } + } + + /// Object that can read a value at a [BufferContext]. +@@ -916,43 +1016,55 @@ + T read(BufferContext bc, int offset); + + /// Read the value of the given [field] in the given [object]. +- T vTableGet(BufferContext object, int offset, int field, [T defaultValue]) { +- int vTableSOffset = object._getInt32(offset); +- int vTableOffset = offset - vTableSOffset; +- int vTableSize = object._getUint16(vTableOffset); +- int vTableFieldOffset = field; +- if (vTableFieldOffset < vTableSize) { +- int fieldOffsetInObject = +- object._getUint16(vTableOffset + vTableFieldOffset); +- if (fieldOffsetInObject != 0) { +- return read(object, offset + fieldOffsetInObject); +- } +- } +- return defaultValue; ++ @pragma('vm:prefer-inline') ++ T vTableGet(BufferContext object, int offset, int field, T defaultValue) { ++ var fieldOffset = _vTableFieldOffset(object, offset, field); ++ return fieldOffset == 0 ? defaultValue : read(object, offset + fieldOffset); ++ } ++ ++ /// Read the value of the given [field] in the given [object]. ++ @pragma('vm:prefer-inline') ++ T? vTableGetNullable(BufferContext object, int offset, int field) { ++ var fieldOffset = _vTableFieldOffset(object, offset, field); ++ return fieldOffset == 0 ? null : read(object, offset + fieldOffset); ++ } ++ ++ @pragma('vm:prefer-inline') ++ int _vTableFieldOffset(BufferContext object, int offset, int field) { ++ var vTableSOffset = object._getInt32(offset); ++ var vTableOffset = offset - vTableSOffset; ++ var vTableSize = object._getUint16(vTableOffset); ++ if (field >= vTableSize) return 0; ++ return object._getUint16(vTableOffset + field); + } + } + + /// The reader of string values. + class StringReader extends Reader { +- const StringReader() : super(); ++ final bool asciiOptimization; ++ ++ const StringReader({this.asciiOptimization = false}) : super(); + + @override +- int get size => 4; ++ @pragma('vm:prefer-inline') ++ int get size => _sizeofUint32; + + @override ++ @pragma('vm:prefer-inline') + String read(BufferContext bc, int offset) { +- int strOffset = bc.derefObject(offset); +- int length = bc._getUint32(strOffset); +- Uint8List bytes = bc._asUint8LIst(strOffset + 4, length); +- if (_isLatin(bytes)) { +- return new String.fromCharCodes(bytes); ++ var strOffset = bc.derefObject(offset); ++ var length = bc._getUint32(strOffset); ++ var bytes = bc._asUint8List(strOffset + _sizeofUint32, length); ++ if (asciiOptimization && _isLatin(bytes)) { ++ return String.fromCharCodes(bytes); + } + return utf8.decode(bytes); + } + ++ @pragma('vm:prefer-inline') + static bool _isLatin(Uint8List bytes) { +- int length = bytes.length; +- for (int i = 0; i < length; i++) { ++ var length = bytes.length; ++ for (var i = 0; i < length; i++) { + if (bytes[i] > 127) { + return false; + } +@@ -968,8 +1080,9 @@ + /// Return the object at `offset`. + T createObject(BufferContext bc, int offset); + +- T read(BufferContext bp, int offset) { +- return createObject(bp, offset); ++ @override ++ T read(BufferContext bc, int offset) { ++ return createObject(bc, offset); + } + } + +@@ -978,15 +1091,16 @@ + const TableReader(); + + @override ++ @pragma('vm:prefer-inline') + int get size => 4; + + /// Return the object at [offset]. + T createObject(BufferContext bc, int offset); + + @override +- T read(BufferContext bp, int offset) { +- int objectOffset = bp.derefObject(offset); +- return createObject(bp, objectOffset); ++ T read(BufferContext bc, int offset) { ++ var objectOffset = bc.derefObject(offset); ++ return createObject(bc, objectOffset); + } + } + +@@ -997,11 +1111,13 @@ + const Uint32ListReader(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofUint32; + + @override ++ @pragma('vm:prefer-inline') + List read(BufferContext bc, int offset) => +- new _FbUint32List(bc, bc.derefObject(offset)); ++ _FbUint32List(bc, bc.derefObject(offset)); + } + + /// The reader of unsigned 64-bit integers. +@@ -1011,9 +1127,11 @@ + const Uint64Reader() : super(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofUint64; + + @override ++ @pragma('vm:prefer-inline') + int read(BufferContext bc, int offset) => bc._getUint64(offset); + } + +@@ -1022,9 +1140,11 @@ + const Uint32Reader() : super(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofUint32; + + @override ++ @pragma('vm:prefer-inline') + int read(BufferContext bc, int offset) => bc._getUint32(offset); + } + +@@ -1035,11 +1155,13 @@ + const Uint16ListReader(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofUint32; + + @override ++ @pragma('vm:prefer-inline') + List read(BufferContext bc, int offset) => +- new _FbUint16List(bc, bc.derefObject(offset)); ++ _FbUint16List(bc, bc.derefObject(offset)); + } + + /// The reader of unsigned 32-bit integers. +@@ -1047,24 +1169,44 @@ + const Uint16Reader() : super(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofUint16; + + @override ++ @pragma('vm:prefer-inline') + int read(BufferContext bc, int offset) => bc._getUint16(offset); + } + +-/// Reader of lists of unsigned 8-bit integer values. +-/// +-/// The returned unmodifiable lists lazily read values on access. ++/// Reader of unmodifiable binary data (a list of unsigned 8-bit integers). + class Uint8ListReader extends Reader> { +- const Uint8ListReader(); ++ /// Enables lazy reading of the list ++ /// ++ /// If true, the returned unmodifiable list lazily reads bytes on access. ++ /// Therefore, the underlying buffer must not change while accessing the list. ++ /// ++ /// If false, reads the whole list immediately as an Uint8List. ++ final bool lazy; ++ ++ const Uint8ListReader({this.lazy = true}); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofUint32; + + @override +- List read(BufferContext bc, int offset) => +- new _FbUint8List(bc, bc.derefObject(offset)); ++ @pragma('vm:prefer-inline') ++ List read(BufferContext bc, int offset) { ++ final listOffset = bc.derefObject(offset); ++ if (lazy) return _FbUint8List(bc, listOffset); ++ ++ final length = bc._getUint32(listOffset); ++ final result = Uint8List(length); ++ var pos = listOffset + _sizeofUint32; ++ for (var i = 0; i < length; i++, pos++) { ++ result[i] = bc._getUint8(pos); ++ } ++ return result; ++ } + } + + /// The reader of unsigned 8-bit integers. +@@ -1072,20 +1214,53 @@ + const Uint8Reader() : super(); + + @override ++ @pragma('vm:prefer-inline') + int get size => _sizeofUint8; + + @override ++ @pragma('vm:prefer-inline') + int read(BufferContext bc, int offset) => bc._getUint8(offset); + } + ++/// Reader of unmodifiable binary data (a list of signed 8-bit integers). ++class Int8ListReader extends Reader> { ++ /// Enables lazy reading of the list ++ /// ++ /// If true, the returned unmodifiable list lazily reads bytes on access. ++ /// Therefore, the underlying buffer must not change while accessing the list. ++ /// ++ /// If false, reads the whole list immediately as an Uint8List. ++ final bool lazy; ++ ++ const Int8ListReader({this.lazy = true}); ++ ++ @override ++ @pragma('vm:prefer-inline') ++ int get size => _sizeofUint32; ++ ++ @override ++ @pragma('vm:prefer-inline') ++ List read(BufferContext bc, int offset) { ++ final listOffset = bc.derefObject(offset); ++ if (lazy) return _FbUint8List(bc, listOffset); ++ ++ final length = bc._getUint32(listOffset); ++ final result = Int8List(length); ++ var pos = listOffset + _sizeofUint32; ++ for (var i = 0; i < length; i++, pos++) { ++ result[i] = bc._getInt8(pos); ++ } ++ return result; ++ } ++} ++ + /// The list backed by 64-bit values - Uint64 length and Float64. + class _FbFloat64List extends _FbList { + _FbFloat64List(BufferContext bc, int offset) : super(bc, offset); + + @override +- double operator [](int i) { +- return bc._getFloat64(offset + 4 + 8 * i); +- } ++ @pragma('vm:prefer-inline') ++ double operator [](int i) => bc._getFloat64(offset + 4 + 8 * i); + } + + /// The list backed by 32-bit values - Float32. +@@ -1093,29 +1268,29 @@ + _FbFloat32List(BufferContext bc, int offset) : super(bc, offset); + + @override +- double operator [](int i) { +- return bc._getFloat32(offset + 4 + 4 * i); +- } ++ @pragma('vm:prefer-inline') ++ double operator [](int i) => bc._getFloat32(offset + 4 + 4 * i); + } + + /// List backed by a generic object which may have any size. + class _FbGenericList extends _FbList { + final Reader elementReader; + +- List _items; ++ List? _items; + + _FbGenericList(this.elementReader, BufferContext bp, int offset) + : super(bp, offset); + + @override ++ @pragma('vm:prefer-inline') + E operator [](int i) { +- _items ??= new List(length); +- E item = _items[i]; ++ _items ??= List.filled(length, null); ++ var item = _items![i]; + if (item == null) { + item = elementReader.read(bc, offset + 4 + elementReader.size * i); +- _items[i] = item; ++ _items![i] = item; + } +- return item; ++ return item!; + } + } + +@@ -1123,23 +1298,20 @@ + abstract class _FbList extends Object with ListMixin implements List { + final BufferContext bc; + final int offset; +- int _length; ++ int? _length; + + _FbList(this.bc, this.offset); + + @override +- int get length { +- _length ??= bc._getUint32(offset); +- return _length; +- } ++ @pragma('vm:prefer-inline') ++ int get length => _length ??= bc._getUint32(offset); + + @override +- void set length(int i) => +- throw new StateError('Attempt to modify immutable list'); ++ set length(int i) => throw StateError('Attempt to modify immutable list'); + + @override + void operator []=(int i, E e) => +- throw new StateError('Attempt to modify immutable list'); ++ throw StateError('Attempt to modify immutable list'); + } + + /// List backed by 32-bit unsigned integers. +@@ -1147,9 +1319,8 @@ + _FbUint32List(BufferContext bc, int offset) : super(bc, offset); + + @override +- int operator [](int i) { +- return bc._getUint32(offset + 4 + 4 * i); +- } ++ @pragma('vm:prefer-inline') ++ int operator [](int i) => bc._getUint32(offset + 4 + 4 * i); + } + + /// List backed by 16-bit unsigned integers. +@@ -1157,9 +1328,8 @@ + _FbUint16List(BufferContext bc, int offset) : super(bc, offset); + + @override +- int operator [](int i) { +- return bc._getUint16(offset + 4 + 2 * i); +- } ++ @pragma('vm:prefer-inline') ++ int operator [](int i) => bc._getUint16(offset + 4 + 2 * i); + } + + /// List backed by 8-bit unsigned integers. +@@ -1167,9 +1337,17 @@ + _FbUint8List(BufferContext bc, int offset) : super(bc, offset); + + @override +- int operator [](int i) { +- return bc._getUint8(offset + 4 + i); +- } ++ @pragma('vm:prefer-inline') ++ int operator [](int i) => bc._getUint8(offset + 4 + i); ++} ++ ++/// List backed by 8-bit signed integers. ++class _FbInt8List extends _FbList { ++ _FbInt8List(BufferContext bc, int offset) : super(bc, offset); ++ ++ @override ++ @pragma('vm:prefer-inline') ++ int operator [](int i) => bc._getInt8(offset + 4 + i); + } + + /// List backed by 8-bit unsigned integers. +@@ -1177,41 +1355,48 @@ + _FbBoolList(BufferContext bc, int offset) : super(bc, offset); + + @override +- bool operator [](int i) { +- return bc._getUint8(offset + 4 + i) == 1 ? true : false; +- } ++ @pragma('vm:prefer-inline') ++ bool operator [](int i) => bc._getUint8(offset + 4 + i) == 1 ? true : false; + } + + /// Class that describes the structure of a table. + class _VTable { + static const int _metadataLength = 4; + +- final List fieldTails = []; +- final List fieldOffsets = []; ++ final int numFields; ++ ++ // Note: fieldOffsets start as "tail offsets" and are then transformed by ++ // [computeFieldOffsets()] to actual offsets when a table is finished. ++ final Uint32List fieldOffsets; ++ bool offsetsComputed = false; ++ ++ _VTable(this.numFields) : fieldOffsets = Uint32List(numFields); + + /// The size of the table that uses this VTable. +- int tableSize; ++ int tableSize = 0; + +- /// The tail of this VTable. It is used to share the same VTable between ++ /// The tail of this VTable. It is used to share the same VTable between + /// multiple tables of identical structure. +- int tail; ++ int tail = 0; + + int get _vTableSize => numOfUint16 * _sizeofUint16; + +- int get numOfUint16 => 1 + 1 + fieldTails.length; ++ int get numOfUint16 => 1 + 1 + numFields; + ++ @pragma('vm:prefer-inline') + void addField(int field, int offset) { +- while (fieldTails.length <= field) { +- fieldTails.add(null); +- } +- fieldTails[field] = offset; ++ assert(!offsetsComputed); ++ assert(offset > 0); // it's impossible for field to start at the buffer end ++ assert(offset <= 4294967295); // uint32 max ++ fieldOffsets[field] = offset; + } + ++ @pragma('vm:prefer-inline') + bool _offsetsMatch(int vt2Start, ByteData buf) { +- for (int i = 0; i < fieldOffsets.length; i++) { ++ assert(offsetsComputed); ++ for (var i = 0; i < numFields; i++) { + if (fieldOffsets[i] != +- buf.getUint16( +- vt2Start + _metadataLength + (2 * i), Endian.little)) { ++ buf.getUint16(vt2Start + _metadataLength + (2 * i), Endian.little)) { + return false; + } + } +@@ -1219,17 +1404,22 @@ + } + + /// Fill the [fieldOffsets] field. ++ @pragma('vm:prefer-inline') + void computeFieldOffsets(int tableTail) { +- assert(fieldOffsets.isEmpty); +- for (int fieldTail in fieldTails) { +- int fieldOffset = fieldTail == null ? 0 : tableTail - fieldTail; +- fieldOffsets.add(fieldOffset); ++ assert(!offsetsComputed); ++ offsetsComputed = true; ++ for (var i = 0; i < numFields; i++) { ++ if (fieldOffsets[i] != 0) { ++ fieldOffsets[i] = tableTail - fieldOffsets[i]; ++ } + } + } + + /// Outputs this VTable to [buf], which is is expected to be aligned to 16-bit + /// and have at least [numOfUint16] 16-bit words available. ++ @pragma('vm:prefer-inline') + void output(ByteData buf, int bufOffset) { ++ assert(offsetsComputed); + // VTable size. + buf.setUint16(bufOffset, numOfUint16 * 2, Endian.little); + bufOffset += 2; +@@ -1237,9 +1427,62 @@ + buf.setUint16(bufOffset, tableSize, Endian.little); + bufOffset += 2; + // Field offsets. +- for (int fieldOffset in fieldOffsets) { +- buf.setUint16(bufOffset, fieldOffset, Endian.little); ++ for (var i = 0; i < numFields; i++) { ++ buf.setUint16(bufOffset, fieldOffsets[i], Endian.little); + bufOffset += 2; + } + } + } ++ ++/// The interface that [Builder] uses to allocate buffers for encoding. ++abstract class Allocator { ++ const Allocator(); ++ ++ /// Allocate a [ByteData] buffer of a given size. ++ ByteData allocate(int size); ++ ++ /// Free the given [ByteData] buffer previously allocated by [allocate]. ++ void deallocate(ByteData data); ++ ++ /// Reallocate [newSize] bytes of memory, replacing the old [oldData]. This ++ /// grows downwards, and is intended specifically for use with [Builder]. ++ /// Params [inUseBack] and [inUseFront] indicate how much of [oldData] is ++ /// actually in use at each end, and needs to be copied. ++ ByteData resize( ++ ByteData oldData, int newSize, int inUseBack, int inUseFront) { ++ final newData = allocate(newSize); ++ _copyDownward(oldData, newData, inUseBack, inUseFront); ++ deallocate(oldData); ++ return newData; ++ } ++ ++ /// Called by [resize] to copy memory from [oldData] to [newData]. Only ++ /// memory of size [inUseFront] and [inUseBack] will be copied from the front ++ /// and back of the old memory allocation. ++ void _copyDownward( ++ ByteData oldData, ByteData newData, int inUseBack, int inUseFront) { ++ if (inUseBack != 0) { ++ newData.buffer.asUint8List().setAll( ++ newData.lengthInBytes - inUseBack, ++ oldData.buffer.asUint8List().getRange( ++ oldData.lengthInBytes - inUseBack, oldData.lengthInBytes)); ++ } ++ if (inUseFront != 0) { ++ newData.buffer ++ .asUint8List() ++ .setAll(0, oldData.buffer.asUint8List().getRange(0, inUseFront)); ++ } ++ } ++} ++ ++class DefaultAllocator extends Allocator { ++ const DefaultAllocator(); ++ ++ @override ++ ByteData allocate(int size) => ByteData(size); ++ ++ @override ++ void deallocate(ByteData data) { ++ // nothing to do, it's garbage-collected ++ } ++} +diff -urN a/dart/lib/src/builder.dart b/dart/lib/src/builder.dart +--- a/dart/lib/src/builder.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/lib/src/builder.dart 2023-01-13 07:47:11.939280316 +0000 +@@ -5,38 +5,27 @@ + + /// The main builder class for creation of a FlexBuffer. + class Builder { +- ByteData _buffer; +- List<_StackValue> _stack; +- List<_StackPointer> _stackPointers; +- int _offset; +- bool _finished; +- Map _stringCache; +- Map _keyCache; +- Map<_KeysHash, _StackValue> _keyVectorCache; +- Map _indirectIntCache; +- Map _indirectDoubleCache; ++ final ByteData _buffer; ++ List<_StackValue> _stack = []; ++ List<_StackPointer> _stackPointers = []; ++ int _offset = 0; ++ bool _finished = false; ++ final Map _stringCache = {}; ++ final Map _keyCache = {}; ++ final Map<_KeysHash, _StackValue> _keyVectorCache = {}; ++ final Map _indirectIntCache = {}; ++ final Map _indirectDoubleCache = {}; + + /// Instantiate the builder if you intent to gradually build up the buffer by calling + /// add... methods and calling [finish] to receive the the resulting byte array. + /// + /// The default size of internal buffer is set to 2048. Provide a different value in order to avoid buffer copies. +- Builder({int size = 2048}) { +- _buffer = ByteData(size); +- _stack = []; +- _stackPointers = []; +- _offset = 0; +- _finished = false; +- _stringCache = {}; +- _keyCache = {}; +- _keyVectorCache = {}; +- _indirectIntCache = {}; +- _indirectDoubleCache = {}; +- } ++ Builder({int size = 2048}) : _buffer = ByteData(size); + + /// Use this method in order to turn an object into a FlexBuffer directly. + /// + /// Use the manual instantiation of the [Builder] and gradual addition of values, if performance is more important than convenience. +- static ByteBuffer buildFromObject(Object value) { ++ static ByteBuffer buildFromObject(Object? value) { + final builder = Builder(); + builder._add(value); + final buffer = builder.finish(); +@@ -45,7 +34,7 @@ + return byteData.buffer; + } + +- void _add(Object value) { ++ void _add(Object? value) { + if (value == null) { + addNull(); + } else if (value is bool) { +@@ -81,32 +70,32 @@ + /// Specifically useful when building up a vector where values can be null. + void addNull() { + _integrityCheckOnValueAddition(); +- _stack.add(_StackValue.WithNull()); ++ _stack.add(_StackValue.withNull()); + } + + /// Adds a string value. + void addInt(int value) { + _integrityCheckOnValueAddition(); +- _stack.add(_StackValue.WithInt(value)); ++ _stack.add(_StackValue.withInt(value)); + } + + /// Adds a bool value. + void addBool(bool value) { + _integrityCheckOnValueAddition(); +- _stack.add(_StackValue.WithBool(value)); ++ _stack.add(_StackValue.withBool(value)); + } + + /// Adds a double value. + void addDouble(double value) { + _integrityCheckOnValueAddition(); +- _stack.add(_StackValue.WithDouble(value)); ++ _stack.add(_StackValue.withDouble(value)); + } + + /// Adds a string value. + void addString(String value) { + _integrityCheckOnValueAddition(); + if (_stringCache.containsKey(value)) { +- _stack.add(_stringCache[value]); ++ _stack.add(_stringCache[value]!); + return; + } + final utf8String = utf8.encode(value); +@@ -118,7 +107,8 @@ + final newOffset = _newOffset(length + 1); + _pushBuffer(utf8String); + _offset = newOffset; +- final stackValue = _StackValue.WithOffset(stringOffset, ValueType.String, bitWidth); ++ final stackValue = ++ _StackValue.withOffset(stringOffset, ValueType.String, bitWidth); + _stack.add(stackValue); + _stringCache[value] = stackValue; + } +@@ -129,7 +119,7 @@ + void addKey(String value) { + _integrityCheckOnKeyAddition(); + if (_keyCache.containsKey(value)) { +- _stack.add(_keyCache[value]); ++ _stack.add(_keyCache[value]!); + return; + } + final utf8String = utf8.encode(value); +@@ -138,7 +128,8 @@ + final newOffset = _newOffset(length + 1); + _pushBuffer(utf8String); + _offset = newOffset; +- final stackValue = _StackValue.WithOffset(keyOffset, ValueType.Key, BitWidth.width8); ++ final stackValue = ++ _StackValue.withOffset(keyOffset, ValueType.Key, BitWidth.width8); + _stack.add(stackValue); + _keyCache[value] = stackValue; + } +@@ -156,7 +147,8 @@ + final newOffset = _newOffset(length); + _pushBuffer(value.asUint8List()); + _offset = newOffset; +- final stackValue = _StackValue.WithOffset(blobOffset, ValueType.Blob, bitWidth); ++ final stackValue = ++ _StackValue.withOffset(blobOffset, ValueType.Blob, bitWidth); + _stack.add(stackValue); + } + +@@ -169,15 +161,16 @@ + void addIntIndirectly(int value, {bool cache = false}) { + _integrityCheckOnValueAddition(); + if (_indirectIntCache.containsKey(value)) { +- _stack.add(_indirectIntCache[value]); ++ _stack.add(_indirectIntCache[value]!); + return; + } +- final stackValue = _StackValue.WithInt(value); ++ final stackValue = _StackValue.withInt(value); + final byteWidth = _align(stackValue.width); + final newOffset = _newOffset(byteWidth); + final valueOffset = _offset; + _pushBuffer(stackValue.asU8List(stackValue.width)); +- final stackOffset = _StackValue.WithOffset(valueOffset, ValueType.IndirectInt, stackValue.width); ++ final stackOffset = _StackValue.withOffset( ++ valueOffset, ValueType.IndirectInt, stackValue.width); + _stack.add(stackOffset); + _offset = newOffset; + if (cache) { +@@ -193,15 +186,16 @@ + void addDoubleIndirectly(double value, {bool cache = false}) { + _integrityCheckOnValueAddition(); + if (cache && _indirectDoubleCache.containsKey(value)) { +- _stack.add(_indirectDoubleCache[value]); ++ _stack.add(_indirectDoubleCache[value]!); + return; + } +- final stackValue = _StackValue.WithDouble(value); ++ final stackValue = _StackValue.withDouble(value); + final byteWidth = _align(stackValue.width); + final newOffset = _newOffset(byteWidth); + final valueOffset = _offset; + _pushBuffer(stackValue.asU8List(stackValue.width)); +- final stackOffset = _StackValue.WithOffset(valueOffset, ValueType.IndirectFloat, stackValue.width); ++ final stackOffset = _StackValue.withOffset( ++ valueOffset, ValueType.IndirectFloat, stackValue.width); + _stack.add(stackOffset); + _offset = newOffset; + if (cache) { +@@ -258,8 +252,10 @@ + tmp._offset = _offset; + tmp._stack = List.from(_stack); + tmp._stackPointers = List.from(_stackPointers); +- tmp._buffer.buffer.asUint8List().setAll(0, _buffer.buffer.asUint8List(0, _offset)); +- for (var i = 0; i < tmp._stackPointers.length; i++){ ++ tmp._buffer.buffer ++ .asUint8List() ++ .setAll(0, _buffer.buffer.asUint8List(0, _offset)); ++ for (var i = 0; i < tmp._stackPointers.length; i++) { + tmp.end(); + } + final buffer = tmp.finish(); +@@ -267,14 +263,15 @@ + bd.buffer.asUint8List().setAll(0, buffer); + return bd.buffer; + } +- ++ + void _integrityCheckOnValueAddition() { + if (_finished) { + throw StateError('Adding values after finish is prohibited'); + } + if (_stackPointers.isNotEmpty && _stackPointers.last.isVector == false) { + if (_stack.last.type != ValueType.Key) { +- throw StateError('Adding value to a map before adding a key is prohibited'); ++ throw StateError( ++ 'Adding value to a map before adding a key is prohibited'); + } + } + } +@@ -290,7 +287,8 @@ + + void _finish() { + if (_stack.length != 1) { +- throw StateError('Stack has to be exactly 1, but is ${_stack.length}. You have to end all started vectors and maps, before calling [finish]'); ++ throw StateError( ++ 'Stack has to be exactly 1, but is ${_stack.length}. You have to end all started vectors and maps, before calling [finish]'); + } + final value = _stack[0]; + final byteWidth = _align(value.elementWidth(_offset, 0)); +@@ -299,8 +297,9 @@ + _writeUInt(byteWidth, 1); + _finished = true; + } +- +- _StackValue _createVector(int start, int vecLength, int step, [_StackValue keys]) { ++ ++ _StackValue _createVector(int start, int vecLength, int step, ++ [_StackValue? keys]) { + var bitWidth = BitWidthUtil.uwidth(vecLength); + var prefixElements = 1; + if (keys != null) { +@@ -327,7 +326,9 @@ + } + } + final byteWidth = _align(bitWidth); +- final fix = typed & ValueTypeUtils.isNumber(vectorType) && vecLength >= 2 && vecLength <= 4; ++ final fix = typed & ValueTypeUtils.isNumber(vectorType) && ++ vecLength >= 2 && ++ vecLength <= 4; + if (keys != null) { + _writeStackValue(keys, byteWidth); + _writeUInt(1 << keys.width.index, byteWidth); +@@ -345,13 +346,14 @@ + } + } + if (keys != null) { +- return _StackValue.WithOffset(vecOffset, ValueType.Map, bitWidth); ++ return _StackValue.withOffset(vecOffset, ValueType.Map, bitWidth); + } + if (typed) { +- final vType = ValueTypeUtils.toTypedVector(vectorType, fix ? vecLength : 0); +- return _StackValue.WithOffset(vecOffset, vType, bitWidth); ++ final vType = ++ ValueTypeUtils.toTypedVector(vectorType, fix ? vecLength : 0); ++ return _StackValue.withOffset(vecOffset, vType, bitWidth); + } +- return _StackValue.WithOffset(vecOffset, ValueType.Vector, bitWidth); ++ return _StackValue.withOffset(vecOffset, ValueType.Vector, bitWidth); + } + + void _endVector(_StackPointer pointer) { +@@ -363,12 +365,13 @@ + + void _sortKeysAndEndMap(_StackPointer pointer) { + if (((_stack.length - pointer.stackPosition) & 1) == 1) { +- throw StateError('The stack needs to hold key value pairs (even number of elements). Check if you combined [addKey] with add... method calls properly.'); ++ throw StateError( ++ 'The stack needs to hold key value pairs (even number of elements). Check if you combined [addKey] with add... method calls properly.'); + } + + var sorted = true; + for (var i = pointer.stackPosition; i < _stack.length - 2; i += 2) { +- if (_shouldFlip(_stack[i], _stack[i+2])) { ++ if (_shouldFlip(_stack[i], _stack[i + 2])) { + sorted = false; + break; + } +@@ -394,36 +397,38 @@ + } + _endMap(pointer); + } +- ++ + void _endMap(_StackPointer pointer) { + final vecLength = (_stack.length - pointer.stackPosition) >> 1; + final offsets = []; + for (var i = pointer.stackPosition; i < _stack.length; i += 2) { +- offsets.add(_stack[i].offset); ++ offsets.add(_stack[i].offset!); + } + final keysHash = _KeysHash(offsets); +- var keysStackValue; ++ _StackValue? keysStackValue; + if (_keyVectorCache.containsKey(keysHash)) { + keysStackValue = _keyVectorCache[keysHash]; + } else { + keysStackValue = _createVector(pointer.stackPosition, vecLength, 2); + _keyVectorCache[keysHash] = keysStackValue; + } +- final vec = _createVector(pointer.stackPosition + 1, vecLength, 2, keysStackValue); ++ final vec = ++ _createVector(pointer.stackPosition + 1, vecLength, 2, keysStackValue); + _stack.removeRange(pointer.stackPosition, _stack.length); + _stack.add(vec); + } + + bool _shouldFlip(_StackValue v1, _StackValue v2) { + if (v1.type != ValueType.Key || v2.type != ValueType.Key) { +- throw StateError('Stack values are not keys $v1 | $v2. Check if you combined [addKey] with add... method calls properly.'); ++ throw StateError( ++ 'Stack values are not keys $v1 | $v2. Check if you combined [addKey] with add... method calls properly.'); + } + +- var c1, c2; ++ late int c1, c2; + var index = 0; + do { +- c1 = _buffer.getUint8(v1.offset + index); +- c2 = _buffer.getUint8(v2.offset + index); ++ c1 = _buffer.getUint8(v1.offset! + index); ++ c2 = _buffer.getUint8(v2.offset! + index); + if (c2 < c1) return true; + if (c1 < c2) return false; + index += 1; +@@ -440,11 +445,12 @@ + void _writeStackValue(_StackValue value, int byteWidth) { + final newOffset = _newOffset(byteWidth); + if (value.isOffset) { +- final relativeOffset = _offset - value.offset; ++ final relativeOffset = _offset - value.offset!; + if (byteWidth == 8 || relativeOffset < (1 << (byteWidth * 8))) { + _writeUInt(relativeOffset, byteWidth); + } else { +- throw StateError('Unexpected size $byteWidth. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new'); ++ throw StateError( ++ 'Unexpected size $byteWidth. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new'); + } + } else { + _pushBuffer(value.asU8List(BitWidthUtil.fromByteWidth(byteWidth))); +@@ -467,16 +473,13 @@ + } + if (prevSize < size) { + final newBuf = ByteData(size); +- newBuf.buffer +- .asUint8List() +- .setAll(0, _buffer.buffer.asUint8List()); ++ newBuf.buffer.asUint8List().setAll(0, _buffer.buffer.asUint8List()); + } + return newOffset; + } + + void _pushInt(int value, BitWidth width) { + switch (width) { +- + case BitWidth.width8: + _buffer.setInt8(_offset, value); + break; +@@ -494,7 +497,6 @@ + + void _pushUInt(int value, BitWidth width) { + switch (width) { +- + case BitWidth.width8: + _buffer.setUint8(_offset, value); + break; +@@ -516,37 +518,39 @@ + } + + class _StackValue { +- Object _value; +- int _offset; +- ValueType _type; +- BitWidth _width; +- _StackValue.WithNull() { +- _type = ValueType.Null; +- _width = BitWidth.width8; +- } +- _StackValue.WithInt(int value) { +- _type = value != null ? ValueType.Int : ValueType.Null; +- _width = BitWidthUtil.width(value); +- _value = value; +- } +- _StackValue.WithBool(bool value) { +- _type = value != null ? ValueType.Bool : ValueType.Null; +- _width = BitWidth.width8; +- _value = value; +- } +- _StackValue.WithDouble(double value) { +- _type = value != null ? ValueType.Float : ValueType.Null; +- _width = BitWidthUtil.width(value); +- _value = value; +- } +- _StackValue.WithOffset(int value, ValueType type, BitWidth width) { +- _offset = value; +- _type = type; +- _width = width; +- } ++ late Object _value; ++ int? _offset; ++ final ValueType _type; ++ final BitWidth _width; ++ ++ _StackValue.withNull() ++ : _type = ValueType.Null, ++ _width = BitWidth.width8; ++ ++ _StackValue.withInt(int value) ++ : _type = ValueType.Int, ++ _width = BitWidthUtil.width(value), ++ _value = value; ++ ++ _StackValue.withBool(bool value) ++ : _type = ValueType.Bool, ++ _width = BitWidth.width8, ++ _value = value; ++ ++ _StackValue.withDouble(double value) ++ : _type = ValueType.Float, ++ _width = BitWidthUtil.width(value), ++ _value = value; ++ ++ _StackValue.withOffset(int value, ValueType type, BitWidth width) ++ : _offset = value, ++ _type = type, ++ _width = width; + + BitWidth storedWidth({BitWidth width = BitWidth.width8}) { +- return ValueTypeUtils.isInline(_type) ? BitWidthUtil.max(_width, width) : _width; ++ return ValueTypeUtils.isInline(_type) ++ ? BitWidthUtil.max(_width, width) ++ : _width; + } + + int storedPackedType({BitWidth width = BitWidth.width8}) { +@@ -555,16 +559,19 @@ + + BitWidth elementWidth(int size, int index) { + if (ValueTypeUtils.isInline(_type)) return _width; +- for(var i = 0; i < 4; i++) { ++ final offset = _offset!; ++ for (var i = 0; i < 4; i++) { + final width = 1 << i; +- final offsetLoc = size + BitWidthUtil.paddingSize(size, width) + index * width; +- final offset = offsetLoc - _offset; +- final bitWidth = BitWidthUtil.uwidth(offset); ++ final bitWidth = BitWidthUtil.uwidth(size + ++ BitWidthUtil.paddingSize(size, width) + ++ index * width - ++ offset); + if (1 << bitWidth.index == width) { + return bitWidth; + } + } +- throw StateError('Element is of unknown. Size: $size at index: $index. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new'); ++ throw StateError( ++ 'Element is of unknown. Size: $size at index: $index. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new'); + } + + List asU8List(BitWidth width) { +@@ -572,30 +579,30 @@ + if (_type == ValueType.Float) { + if (width == BitWidth.width32) { + final result = ByteData(4); +- result.setFloat32(0, _value, Endian.little); ++ result.setFloat32(0, _value as double, Endian.little); + return result.buffer.asUint8List(); + } else { + final result = ByteData(8); +- result.setFloat64(0, _value, Endian.little); ++ result.setFloat64(0, _value as double, Endian.little); + return result.buffer.asUint8List(); + } + } else { +- switch(width) { ++ switch (width) { + case BitWidth.width8: + final result = ByteData(1); +- result.setInt8(0, _value); ++ result.setInt8(0, _value as int); + return result.buffer.asUint8List(); + case BitWidth.width16: + final result = ByteData(2); +- result.setInt16(0, _value, Endian.little); ++ result.setInt16(0, _value as int, Endian.little); + return result.buffer.asUint8List(); + case BitWidth.width32: + final result = ByteData(4); +- result.setInt32(0, _value, Endian.little); ++ result.setInt32(0, _value as int, Endian.little); + return result.buffer.asUint8List(); + case BitWidth.width64: + final result = ByteData(8); +- result.setInt64(0, _value, Endian.little); ++ result.setInt64(0, _value as int, Endian.little); + return result.buffer.asUint8List(); + } + } +@@ -607,11 +614,12 @@ + } + if (_type == ValueType.Bool) { + final result = ByteData(1); +- result.setInt8(0, _value ? 1 : 0); ++ result.setInt8(0, _value as bool ? 1 : 0); + return result.buffer.asUint8List(); + } + +- throw StateError('Unexpected type: $_type. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new'); ++ throw StateError( ++ 'Unexpected type: $_type. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new'); + } + + ValueType get type { +@@ -625,7 +633,8 @@ + bool get isOffset { + return !ValueTypeUtils.isInline(_type); + } +- int get offset => _offset; ++ ++ int? get offset => _offset; + + bool get isFloat32 { + return _type == ValueType.Float && _width == BitWidth.width32; +@@ -635,6 +644,7 @@ + class _StackPointer { + int stackPosition; + bool isVector; ++ + _StackPointer(this.stackPosition, this.isVector); + } + +diff -urN a/dart/lib/src/reference.dart b/dart/lib/src/reference.dart +--- a/dart/lib/src/reference.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/lib/src/reference.dart 2023-01-13 07:47:12.158282339 +0000 +@@ -11,14 +11,15 @@ + final int _offset; + final BitWidth _parentWidth; + final String _path; +- int _byteWidth; +- ValueType _valueType; +- int _length; +- +- Reference._(this._buffer, this._offset, this._parentWidth, int packedType, this._path) { +- _byteWidth = 1 << (packedType & 3); +- _valueType = ValueTypeUtils.fromInt(packedType >> 2); +- } ++ final int _byteWidth; ++ final ValueType _valueType; ++ int? _length; ++ ++ Reference._( ++ this._buffer, this._offset, this._parentWidth, int packedType, this._path, ++ [int? byteWidth, ValueType? valueType]) ++ : _byteWidth = byteWidth ?? 1 << (packedType & 3), ++ _valueType = valueType ?? ValueTypeUtils.fromInt(packedType >> 2); + + /// Use this method to access the root value of a FlexBuffer. + static Reference fromBuffer(ByteBuffer buffer) { +@@ -30,31 +31,44 @@ + final byteWidth = byteData.getUint8(len - 1); + final packedType = byteData.getUint8(len - 2); + final offset = len - byteWidth - 2; +- return Reference._(ByteData.view(buffer), offset, BitWidthUtil.fromByteWidth(byteWidth), packedType, "/"); ++ return Reference._(ByteData.view(buffer), offset, ++ BitWidthUtil.fromByteWidth(byteWidth), packedType, "/"); + } + + /// Returns true if the underlying value is null. + bool get isNull => _valueType == ValueType.Null; ++ + /// Returns true if the underlying value can be represented as [num]. +- bool get isNum => ValueTypeUtils.isNumber(_valueType) || ValueTypeUtils.isIndirectNumber(_valueType); ++ bool get isNum => ++ ValueTypeUtils.isNumber(_valueType) || ++ ValueTypeUtils.isIndirectNumber(_valueType); ++ + /// Returns true if the underlying value was encoded as a float (direct or indirect). +- bool get isDouble => _valueType == ValueType.Float || _valueType == ValueType.IndirectFloat; ++ bool get isDouble => ++ _valueType == ValueType.Float || _valueType == ValueType.IndirectFloat; ++ + /// Returns true if the underlying value was encoded as an int or uint (direct or indirect). + bool get isInt => isNum && !isDouble; ++ + /// Returns true if the underlying value was encoded as a string or a key. +- bool get isString => _valueType == ValueType.String || _valueType == ValueType.Key; ++ bool get isString => ++ _valueType == ValueType.String || _valueType == ValueType.Key; ++ + /// Returns true if the underlying value was encoded as a bool. + bool get isBool => _valueType == ValueType.Bool; ++ + /// Returns true if the underlying value was encoded as a blob. + bool get isBlob => _valueType == ValueType.Blob; ++ + /// Returns true if the underlying value points to a vector. + bool get isVector => ValueTypeUtils.isAVector(_valueType); ++ + /// Returns true if the underlying value points to a map. + bool get isMap => _valueType == ValueType.Map; + + /// If this [isBool], returns the bool value. Otherwise, returns null. +- bool get boolValue { +- if(_valueType == ValueType.Bool) { ++ bool? get boolValue { ++ if (_valueType == ValueType.Bool) { + return _readInt(_offset, _parentWidth) != 0; + } + return null; +@@ -63,7 +77,7 @@ + /// Returns an [int], if the underlying value can be represented as an int. + /// + /// Otherwise returns [null]. +- int get intValue { ++ int? get intValue { + if (_valueType == ValueType.Int) { + return _readInt(_offset, _parentWidth); + } +@@ -82,7 +96,7 @@ + /// Returns [double], if the underlying value [isDouble]. + /// + /// Otherwise returns [null]. +- double get doubleValue { ++ double? get doubleValue { + if (_valueType == ValueType.Float) { + return _readFloat(_offset, _parentWidth); + } +@@ -95,12 +109,12 @@ + /// Returns [num], if the underlying value is numeric, be it int uint, or float (direct or indirect). + /// + /// Otherwise returns [null]. +- num get numValue => doubleValue ?? intValue; ++ num? get numValue => doubleValue ?? intValue; + + /// Returns [String] value or null otherwise. +- /// +- /// This method performers a utf8 decoding, as FlexBuffers format stores strings in utf8 encoding. +- String get stringValue { ++ /// ++ /// This method performers a utf8 decoding, as FlexBuffers format stores strings in utf8 encoding. ++ String? get stringValue { + if (_valueType == ValueType.String || _valueType == ValueType.Key) { + return utf8.decode(_buffer.buffer.asUint8List(_indirect, length)); + } +@@ -108,7 +122,7 @@ + } + + /// Returns [Uint8List] value or null otherwise. +- Uint8List get blobValue { ++ Uint8List? get blobValue { + if (_valueType == ValueType.Blob) { + return _buffer.buffer.asUint8List(_indirect, length); + } +@@ -122,22 +136,31 @@ + Reference operator [](Object key) { + if (key is int && ValueTypeUtils.isAVector(_valueType)) { + final index = key; +- if(index >= length || index < 0) { +- throw ArgumentError('Key: [$key] is not applicable on: $_path of: $_valueType length: $length'); ++ if (index >= length || index < 0) { ++ throw ArgumentError( ++ 'Key: [$key] is not applicable on: $_path of: $_valueType length: $length'); + } + final elementOffset = _indirect + index * _byteWidth; +- final reference = Reference._(_buffer, elementOffset, BitWidthUtil.fromByteWidth(_byteWidth), 0, "$_path[$index]"); +- reference._byteWidth = 1; ++ int packedType = 0; ++ int? byteWidth; ++ ValueType? valueType; + if (ValueTypeUtils.isTypedVector(_valueType)) { +- reference._valueType = ValueTypeUtils.typedVectorElementType(_valueType); +- return reference; +- } +- if(ValueTypeUtils.isFixedTypedVector(_valueType)) { +- reference._valueType = ValueTypeUtils.fixedTypedVectorElementType(_valueType); +- return reference; ++ byteWidth = 1; ++ valueType = ValueTypeUtils.typedVectorElementType(_valueType); ++ } else if (ValueTypeUtils.isFixedTypedVector(_valueType)) { ++ byteWidth = 1; ++ valueType = ValueTypeUtils.fixedTypedVectorElementType(_valueType); ++ } else { ++ packedType = _buffer.getUint8(_indirect + length * _byteWidth + index); + } +- final packedType = _buffer.getUint8(_indirect + length * _byteWidth + index); +- return Reference._(_buffer, elementOffset, BitWidthUtil.fromByteWidth(_byteWidth), packedType, "$_path[$index]"); ++ return Reference._( ++ _buffer, ++ elementOffset, ++ BitWidthUtil.fromByteWidth(_byteWidth), ++ packedType, ++ "$_path[$index]", ++ byteWidth, ++ valueType); + } + if (key is String && _valueType == ValueType.Map) { + final index = _keyIndex(key); +@@ -145,13 +168,14 @@ + return _valueForIndexWithKey(index, key); + } + } +- throw ArgumentError('Key: [$key] is not applicable on: $_path of: $_valueType'); ++ throw ArgumentError( ++ 'Key: [$key] is not applicable on: $_path of: $_valueType'); + } + + /// Get an iterable if the underlying flexBuffer value is a vector. + /// Otherwise throws an exception. + Iterable get vectorIterable { +- if(isVector == false) { ++ if (isVector == false) { + throw UnsupportedError('Value is not a vector. It is: $_valueType'); + } + return _VectorIterator(this); +@@ -160,7 +184,7 @@ + /// Get an iterable for keys if the underlying flexBuffer value is a map. + /// Otherwise throws an exception. + Iterable get mapKeyIterable { +- if(isMap == false) { ++ if (isMap == false) { + throw UnsupportedError('Value is not a map. It is: $_valueType'); + } + return _MapKeyIterator(this); +@@ -169,7 +193,7 @@ + /// Get an iterable for values if the underlying flexBuffer value is a map. + /// Otherwise throws an exception. + Iterable get mapValueIterable { +- if(isMap == false) { ++ if (isMap == false) { + throw UnsupportedError('Value is not a map. It is: $_valueType'); + } + return _MapValueIterator(this); +@@ -181,59 +205,62 @@ + /// If the underlying value is a vector, or map, the length reflects number of elements / element pairs. + /// If the values is a string or a blob, the length reflects a number of bytes the value occupies (strings are encoded in utf8 format). + int get length { +- if (_length != null) { +- return _length; +- } +- // needs to be checked before more generic isAVector +- if(ValueTypeUtils.isFixedTypedVector(_valueType)) { +- _length = ValueTypeUtils.fixedTypedVectorElementSize(_valueType); +- } else if(_valueType == ValueType.Blob || ValueTypeUtils.isAVector(_valueType) || _valueType == ValueType.Map){ +- _length = _readUInt(_indirect - _byteWidth, BitWidthUtil.fromByteWidth(_byteWidth)); +- } else if (_valueType == ValueType.Null) { +- _length = 0; +- } else if (_valueType == ValueType.String) { +- final indirect = _indirect; +- var size_byte_width = _byteWidth; +- var size = _readUInt(indirect - size_byte_width, BitWidthUtil.fromByteWidth(size_byte_width)); +- while (_buffer.getInt8(indirect + size) != 0) { +- size_byte_width <<= 1; +- size = _readUInt(indirect - size_byte_width, BitWidthUtil.fromByteWidth(size_byte_width)); +- } +- _length = size; +- } else if (_valueType == ValueType.Key) { +- final indirect = _indirect; +- var size = 1; +- while (_buffer.getInt8(indirect + size) != 0) { +- size += 1; ++ if (_length == null) { ++ // needs to be checked before more generic isAVector ++ if (ValueTypeUtils.isFixedTypedVector(_valueType)) { ++ _length = ValueTypeUtils.fixedTypedVectorElementSize(_valueType); ++ } else if (_valueType == ValueType.Blob || ++ ValueTypeUtils.isAVector(_valueType) || ++ _valueType == ValueType.Map) { ++ _length = _readUInt( ++ _indirect - _byteWidth, BitWidthUtil.fromByteWidth(_byteWidth)); ++ } else if (_valueType == ValueType.Null) { ++ _length = 0; ++ } else if (_valueType == ValueType.String) { ++ final indirect = _indirect; ++ var sizeByteWidth = _byteWidth; ++ var size = _readUInt(indirect - sizeByteWidth, ++ BitWidthUtil.fromByteWidth(sizeByteWidth)); ++ while (_buffer.getInt8(indirect + size) != 0) { ++ sizeByteWidth <<= 1; ++ size = _readUInt(indirect - sizeByteWidth, ++ BitWidthUtil.fromByteWidth(sizeByteWidth)); ++ } ++ _length = size; ++ } else if (_valueType == ValueType.Key) { ++ final indirect = _indirect; ++ var size = 1; ++ while (_buffer.getInt8(indirect + size) != 0) { ++ size += 1; ++ } ++ _length = size; ++ } else { ++ _length = 1; + } +- _length = size; +- } else { +- _length = 1; + } +- return _length; ++ return _length!; + } + +- + /// Returns a minified JSON representation of the underlying FlexBuffer value. + /// + /// This method involves materializing the entire object tree, which may be + /// expensive. It is more efficient to work with [Reference] and access only the needed data. + /// Blob values are represented as base64 encoded string. + String get json { +- if(_valueType == ValueType.Bool) { +- return boolValue ? 'true' : 'false'; ++ if (_valueType == ValueType.Bool) { ++ return boolValue! ? 'true' : 'false'; + } + if (_valueType == ValueType.Null) { + return 'null'; + } +- if(ValueTypeUtils.isNumber(_valueType)) { ++ if (ValueTypeUtils.isNumber(_valueType)) { + return jsonEncode(numValue); + } + if (_valueType == ValueType.String) { + return jsonEncode(stringValue); + } + if (_valueType == ValueType.Blob) { +- return jsonEncode(base64Encode(blobValue)); ++ return jsonEncode(base64Encode(blobValue!)); + } + if (ValueTypeUtils.isAVector(_valueType)) { + final result = StringBuffer(); +@@ -261,7 +288,8 @@ + result.write('}'); + return result.toString(); + } +- throw UnsupportedError('Type: $_valueType is not supported for JSON conversion'); ++ throw UnsupportedError( ++ 'Type: $_valueType is not supported for JSON conversion'); + } + + /// Computes the indirect offset of the value. +@@ -316,16 +344,20 @@ + } + + void _validateOffset(int offset, BitWidth width) { +- if (_offset < 0 || _buffer.lengthInBytes <= offset + width.index || offset & (BitWidthUtil.toByteWidth(width) - 1) != 0) { ++ if (_offset < 0 || ++ _buffer.lengthInBytes <= offset + width.index || ++ offset & (BitWidthUtil.toByteWidth(width) - 1) != 0) { + throw StateError('Bad offset: $offset, width: $width'); + } + } + +- int _keyIndex(String key) { ++ int? _keyIndex(String key) { + final input = utf8.encode(key); + final keysVectorOffset = _indirect - _byteWidth * 3; +- final indirectOffset = keysVectorOffset - _readUInt(keysVectorOffset, BitWidthUtil.fromByteWidth(_byteWidth)); +- final byteWidth = _readUInt(keysVectorOffset + _byteWidth, BitWidthUtil.fromByteWidth(_byteWidth)); ++ final indirectOffset = keysVectorOffset - ++ _readUInt(keysVectorOffset, BitWidthUtil.fromByteWidth(_byteWidth)); ++ final byteWidth = _readUInt( ++ keysVectorOffset + _byteWidth, BitWidthUtil.fromByteWidth(_byteWidth)); + var low = 0; + var high = length - 1; + while (low <= high) { +@@ -341,9 +373,10 @@ + return null; + } + +- int _diffKeys(List input, int index, int indirect_offset, int byteWidth) { +- final keyOffset = indirect_offset + index * byteWidth; +- final keyIndirectOffset = keyOffset - _readUInt(keyOffset, BitWidthUtil.fromByteWidth(byteWidth)); ++ int _diffKeys(List input, int index, int indirectOffset, int byteWidth) { ++ final keyOffset = indirectOffset + index * byteWidth; ++ final keyIndirectOffset = ++ keyOffset - _readUInt(keyOffset, BitWidthUtil.fromByteWidth(byteWidth)); + for (var i = 0; i < input.length; i++) { + final dif = input[i] - _buffer.getUint8(keyIndirectOffset + i); + if (dif != 0) { +@@ -357,38 +390,42 @@ + final indirect = _indirect; + final elementOffset = indirect + index * _byteWidth; + final packedType = _buffer.getUint8(indirect + length * _byteWidth + index); +- return Reference._(_buffer, elementOffset, BitWidthUtil.fromByteWidth(_byteWidth), packedType, "$_path/$key"); ++ return Reference._(_buffer, elementOffset, ++ BitWidthUtil.fromByteWidth(_byteWidth), packedType, "$_path/$key"); + } + + Reference _valueForIndex(int index) { + final indirect = _indirect; + final elementOffset = indirect + index * _byteWidth; + final packedType = _buffer.getUint8(indirect + length * _byteWidth + index); +- return Reference._(_buffer, elementOffset, BitWidthUtil.fromByteWidth(_byteWidth), packedType, "$_path/[$index]"); ++ return Reference._(_buffer, elementOffset, ++ BitWidthUtil.fromByteWidth(_byteWidth), packedType, "$_path/[$index]"); + } + + String _keyForIndex(int index) { + final keysVectorOffset = _indirect - _byteWidth * 3; +- final indirectOffset = keysVectorOffset - _readUInt(keysVectorOffset, BitWidthUtil.fromByteWidth(_byteWidth)); +- final byteWidth = _readUInt(keysVectorOffset + _byteWidth, BitWidthUtil.fromByteWidth(_byteWidth)); ++ final indirectOffset = keysVectorOffset - ++ _readUInt(keysVectorOffset, BitWidthUtil.fromByteWidth(_byteWidth)); ++ final byteWidth = _readUInt( ++ keysVectorOffset + _byteWidth, BitWidthUtil.fromByteWidth(_byteWidth)); + final keyOffset = indirectOffset + index * byteWidth; +- final keyIndirectOffset = keyOffset - _readUInt(keyOffset, BitWidthUtil.fromByteWidth(byteWidth)); ++ final keyIndirectOffset = ++ keyOffset - _readUInt(keyOffset, BitWidthUtil.fromByteWidth(byteWidth)); + var length = 0; + while (_buffer.getUint8(keyIndirectOffset + length) != 0) { + length += 1; + } + return utf8.decode(_buffer.buffer.asUint8List(keyIndirectOffset, length)); + } +- + } + +-class _VectorIterator with IterableMixin implements Iterator { ++class _VectorIterator ++ with IterableMixin ++ implements Iterator { + final Reference _vector; +- int index; ++ int index = -1; + +- _VectorIterator(this._vector) { +- index = -1; +- } ++ _VectorIterator(this._vector); + + @override + Reference get current => _vector[index]; +@@ -405,11 +442,9 @@ + + class _MapKeyIterator with IterableMixin implements Iterator { + final Reference _map; +- int index; ++ int index = -1; + +- _MapKeyIterator(this._map) { +- index = -1; +- } ++ _MapKeyIterator(this._map); + + @override + String get current => _map._keyForIndex(index); +@@ -424,13 +459,13 @@ + Iterator get iterator => this; + } + +-class _MapValueIterator with IterableMixin implements Iterator { ++class _MapValueIterator ++ with IterableMixin ++ implements Iterator { + final Reference _map; +- int index; ++ int index = -1; + +- _MapValueIterator(this._map) { +- index = -1; +- } ++ _MapValueIterator(this._map); + + @override + Reference get current => _map._valueForIndex(index); +diff -urN a/dart/lib/src/types.dart b/dart/lib/src/types.dart +--- a/dart/lib/src/types.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/lib/src/types.dart 2023-01-13 07:47:12.214282856 +0000 +@@ -1,17 +1,13 @@ + import 'dart:typed_data'; + + /// Represents the number of bits a value occupies. +-enum BitWidth { +- width8, +- width16, +- width32, +- width64 +-} ++enum BitWidth { width8, width16, width32, width64 } + + class BitWidthUtil { + static int toByteWidth(BitWidth self) { + return 1 << self.index; + } ++ + static BitWidth width(num value) { + if (value.toInt() == value) { + var v = value.toInt().abs(); +@@ -20,8 +16,11 @@ + if (v >> 31 == 0) return BitWidth.width32; + return BitWidth.width64; + } +- return value == _toF32(value) ? BitWidth.width32 : BitWidth.width64; ++ return value == _toF32(value as double) ++ ? BitWidth.width32 ++ : BitWidth.width64; + } ++ + static BitWidth uwidth(num value) { + if (value.toInt() == value) { + var v = value.toInt().abs(); +@@ -30,8 +29,11 @@ + if (v >> 32 == 0) return BitWidth.width32; + return BitWidth.width64; + } +- return value == _toF32(value) ? BitWidth.width32 : BitWidth.width64; ++ return value == _toF32(value as double) ++ ? BitWidth.width32 ++ : BitWidth.width64; + } ++ + static BitWidth fromByteWidth(int value) { + if (value == 1) { + return BitWidth.width8; +@@ -45,11 +47,13 @@ + if (value == 8) { + return BitWidth.width64; + } +- throw Exception('Unexpected value ${value}'); ++ throw Exception('Unexpected value $value'); + } ++ + static int paddingSize(int bufSize, int scalarSize) { + return (~bufSize + 1) & (scalarSize - 1); + } ++ + static double _toF32(double value) { + var bdata = ByteData(4); + bdata.setFloat32(0, value); +@@ -66,15 +70,36 @@ + + /// Represents all internal FlexBuffer types. + enum ValueType { +- Null, Int, UInt, Float, +- Key, String, IndirectInt, IndirectUInt, IndirectFloat, +- Map, Vector, VectorInt, VectorUInt, VectorFloat, VectorKey, +- @Deprecated('VectorString is deprecated due to a flaw in the binary format (https://github.com/google/flatbuffers/issues/5627)') ++ Null, ++ Int, ++ UInt, ++ Float, ++ Key, ++ String, ++ IndirectInt, ++ IndirectUInt, ++ IndirectFloat, ++ Map, ++ Vector, ++ VectorInt, ++ VectorUInt, ++ VectorFloat, ++ VectorKey, ++ @Deprecated( ++ 'VectorString is deprecated due to a flaw in the binary format (https://github.com/google/flatbuffers/issues/5627)') + VectorString, +- VectorInt2, VectorUInt2, VectorFloat2, +- VectorInt3, VectorUInt3, VectorFloat3, +- VectorInt4, VectorUInt4, VectorFloat4, +- Blob, Bool, VectorBool ++ VectorInt2, ++ VectorUInt2, ++ VectorFloat2, ++ VectorInt3, ++ VectorUInt3, ++ VectorFloat3, ++ VectorInt4, ++ VectorUInt4, ++ VectorFloat4, ++ Blob, ++ Bool, ++ VectorBool + } + + class ValueTypeUtils { +@@ -89,71 +114,70 @@ + } + + static bool isInline(ValueType self) { +- return self == ValueType.Bool +- || toInt(self) <= toInt(ValueType.Float); ++ return self == ValueType.Bool || toInt(self) <= toInt(ValueType.Float); + } + + static bool isNumber(ValueType self) { +- return toInt(self) >= toInt(ValueType.Int) +- && toInt(self) <= toInt(ValueType.Float); ++ return toInt(self) >= toInt(ValueType.Int) && ++ toInt(self) <= toInt(ValueType.Float); + } + + static bool isIndirectNumber(ValueType self) { +- return toInt(self) >= toInt(ValueType.IndirectInt) +- && toInt(self) <= toInt(ValueType.IndirectFloat); ++ return toInt(self) >= toInt(ValueType.IndirectInt) && ++ toInt(self) <= toInt(ValueType.IndirectFloat); + } + + static bool isTypedVectorElement(ValueType self) { + return self == ValueType.Bool || +- ( +- toInt(self) >= toInt(ValueType.Int) +- && toInt(self) <= toInt(ValueType.String) +- ); ++ (toInt(self) >= toInt(ValueType.Int) && ++ toInt(self) <= toInt(ValueType.String)); + } + + static bool isTypedVector(ValueType self) { + return self == ValueType.VectorBool || +- ( +- toInt(self) >= toInt(ValueType.VectorInt) +- && toInt(self) <= toInt(ValueType.VectorString) +- ); ++ (toInt(self) >= toInt(ValueType.VectorInt) && ++ toInt(self) <= toInt(ValueType.VectorString)); + } + + static bool isFixedTypedVector(ValueType self) { +- return ( +- toInt(self) >= toInt(ValueType.VectorInt2) +- && toInt(self) <= toInt(ValueType.VectorFloat4) +- ); ++ return (toInt(self) >= toInt(ValueType.VectorInt2) && ++ toInt(self) <= toInt(ValueType.VectorFloat4)); + } + + static bool isAVector(ValueType self) { +- return ( +- isTypedVector(self) || isFixedTypedVector(self) || self == ValueType.Vector +- ); ++ return (isTypedVector(self) || ++ isFixedTypedVector(self) || ++ self == ValueType.Vector); + } + + static ValueType toTypedVector(ValueType self, int length) { + if (length == 0) { +- return ValueTypeUtils.fromInt(toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt)); ++ return ValueTypeUtils.fromInt( ++ toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt)); + } + if (length == 2) { +- return ValueTypeUtils.fromInt(toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt2)); ++ return ValueTypeUtils.fromInt( ++ toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt2)); + } + if (length == 3) { +- return ValueTypeUtils.fromInt(toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt3)); ++ return ValueTypeUtils.fromInt( ++ toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt3)); + } + if (length == 4) { +- return ValueTypeUtils.fromInt(toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt4)); ++ return ValueTypeUtils.fromInt( ++ toInt(self) - toInt(ValueType.Int) + toInt(ValueType.VectorInt4)); + } + throw Exception('unexpected length ' + length.toString()); + } + + static ValueType typedVectorElementType(ValueType self) { +- return ValueTypeUtils.fromInt(toInt(self) - toInt(ValueType.VectorInt) + toInt(ValueType.Int)); ++ return ValueTypeUtils.fromInt( ++ toInt(self) - toInt(ValueType.VectorInt) + toInt(ValueType.Int)); + } + + static ValueType fixedTypedVectorElementType(ValueType self) { +- return ValueTypeUtils.fromInt((toInt(self) - toInt(ValueType.VectorInt2)) % 3 + toInt(ValueType.Int)); ++ return ValueTypeUtils.fromInt( ++ (toInt(self) - toInt(ValueType.VectorInt2)) % 3 + toInt(ValueType.Int)); + } + + static int fixedTypedVectorElementSize(ValueType self) { +diff -urN a/dart/publish.sh b/dart/publish.sh +--- a/dart/publish.sh 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/publish.sh 2023-01-13 07:47:12.234283041 +0000 +@@ -21,17 +21,12 @@ + + command -v dart >/dev/null 2>&1 || { echo >&2 "Require `dart` but it's not installed. Aborting."; exit 1; } + +-cp ../samples/monster.fbs example/ +-cp ../tests/monster_test.fbs test/ +-cp -r ../tests/include_test/*.fbs test/ +-cp -r ../tests/include_test/sub test/ +- +-pushd example +-../../flatc --dart ./monster.fbs ++pushd ../tests ++./DartTest.sh + popd + +-pushd test +-../../flatc --dart ./monster_test.fbs ++pushd ../samples ++./dart_sample.sh + popd + + dart pub publish +diff -urN a/dart/pubspec.yaml b/dart/pubspec.yaml +--- a/dart/pubspec.yaml 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/pubspec.yaml 2023-01-13 07:47:12.235283050 +0000 +@@ -1,20 +1,15 @@ + name: flat_buffers +-version: 2.0.0 +-description: > +- FlatBuffers reading and writing library for Dart. Use the flatc compiler to +- generate Dart classes for a FlatBuffers schema, and this library to assist with +- reading and writing the binary format. +- +- Based on original work by Konstantin Scheglov and Paul Berry of the Dart SDK team. +-authors: +-- Dan Field +-- Konstantin Scheglov +-- Paul Berry ++version: 2.0.5 ++description: FlatBuffers reading and writing library for Dart. Based on original work by Konstantin Scheglov and Paul Berry of the Dart SDK team. + homepage: https://github.com/google/flatbuffers + documentation: https://google.github.io/flatbuffers/index.html +-dev_dependencies: +- test: ^1.3.0 +- test_reflective_loader: ^0.1.4 +- path: ^1.5.1 ++ + environment: +- sdk: '>=2.0.0-dev.28.0 <3.0.0' +\ No newline at end of file ++ sdk: '>=2.12.0 <3.0.0' ++ ++dev_dependencies: ++ test: ^1.17.7 ++ test_reflective_loader: ^0.2.0 ++ path: ^1.8.0 ++ lints: ^1.0.1 ++ +diff -urN a/dart/test/flat_buffers_test.dart b/dart/test/flat_buffers_test.dart +--- a/dart/test/flat_buffers_test.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/test/flat_buffers_test.dart 2023-01-13 07:47:12.521285691 +0000 +@@ -12,10 +12,12 @@ + import 'package:test_reflective_loader/test_reflective_loader.dart'; + + import './monster_test_my_game.example_generated.dart' as example; ++import './monster_test_my_game.example2_generated.dart' as example2; + + main() { + defineReflectiveSuite(() { + defineReflectiveTests(BuilderTest); ++ defineReflectiveTests(ObjectAPITest); + defineReflectiveTests(CheckOtherLangaugesData); + defineReflectiveTests(GeneratorTest); + }); +@@ -28,34 +30,35 @@ + @reflectiveTest + class CheckOtherLangaugesData { + test_cppData() async { +- List data = await new io.File(path.join( +- path.dirname(io.Platform.script.path), ++ List data = await io.File(path.join( ++ path.context.current, ++ 'test', + 'monsterdata_test.mon', + )).readAsBytes(); +- example.Monster mon = new example.Monster(data); ++ example.Monster mon = example.Monster(data); + expect(mon.hp, 80); + expect(mon.mana, 150); + expect(mon.name, 'MyMonster'); +- expect(mon.pos.x, 1.0); +- expect(mon.pos.y, 2.0); +- expect(mon.pos.z, 3.0); +- expect(mon.pos.test1, 3.0); +- expect(mon.pos.test2.value, 2.0); +- expect(mon.pos.test3.a, 5); +- expect(mon.pos.test3.b, 6); +- expect(mon.testType.value, example.AnyTypeId.Monster.value); ++ expect(mon.pos!.x, 1.0); ++ expect(mon.pos!.y, 2.0); ++ expect(mon.pos!.z, 3.0); ++ expect(mon.pos!.test1, 3.0); ++ expect(mon.pos!.test2.value, 2.0); ++ expect(mon.pos!.test3.a, 5); ++ expect(mon.pos!.test3.b, 6); ++ expect(mon.testType!.value, example.AnyTypeId.Monster.value); + expect(mon.test is example.Monster, true); + final monster2 = mon.test as example.Monster; + expect(monster2.name, "Fred"); + +- expect(mon.inventory.length, 5); +- expect(mon.inventory.reduce((cur, next) => cur + next), 10); +- expect(mon.test4.length, 2); +- expect( +- mon.test4[0].a + mon.test4[0].b + mon.test4[1].a + mon.test4[1].b, 100); +- expect(mon.testarrayofstring.length, 2); +- expect(mon.testarrayofstring[0], "test1"); +- expect(mon.testarrayofstring[1], "test2"); ++ expect(mon.inventory!.length, 5); ++ expect(mon.inventory!.reduce((cur, next) => cur + next), 10); ++ final test4 = mon.test4!; ++ expect(test4.length, 2); ++ expect(test4[0].a + test4[0].b + test4[1].a + test4[1].b, 100); ++ expect(mon.testarrayofstring!.length, 2); ++ expect(mon.testarrayofstring![0], "test1"); ++ expect(mon.testarrayofstring![1], "test2"); + + // this will fail if accessing any field fails. + expect( +@@ -65,7 +68,7 @@ + 'mana: 150, hp: 80, name: MyMonster, inventory: [0, 1, 2, 3, 4], ' + 'color: Color{value: 8}, testType: AnyTypeId{value: 1}, ' + 'test: Monster{pos: null, mana: 150, hp: 100, name: Fred, ' +- 'inventory: null, color: Color{value: 8}, testType: AnyTypeId{value: 0}, ' ++ 'inventory: null, color: Color{value: 8}, testType: null, ' + 'test: null, test4: null, testarrayofstring: null, ' + 'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, ' + 'testempty: null, testbool: false, testhashs32Fnv1: 0, ' +@@ -79,14 +82,14 @@ + 'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, ' + 'coOwningReference: 0, vectorOfCoOwningReferences: null, ' + 'nonOwningReference: 0, vectorOfNonOwningReferences: null, ' +- 'anyUniqueType: AnyUniqueAliasesTypeId{value: 0}, anyUnique: null, ' +- 'anyAmbiguousType: AnyAmbiguousAliasesTypeId{value: 0}, ' ++ 'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, ' + 'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, ' +- 'testrequirednestedflatbuffer: null}, ' ++ 'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, ' ++ 'nativeInline: null}, ' + 'test4: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], ' + 'testarrayofstring: [test1, test2], testarrayoftables: null, ' + 'enemy: Monster{pos: null, mana: 150, hp: 100, name: Fred, ' +- 'inventory: null, color: Color{value: 8}, testType: AnyTypeId{value: 0}, ' ++ 'inventory: null, color: Color{value: 8}, testType: null, ' + 'test: null, test4: null, testarrayofstring: null, ' + 'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, ' + 'testempty: null, testbool: false, testhashs32Fnv1: 0, ' +@@ -100,10 +103,10 @@ + 'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, ' + 'coOwningReference: 0, vectorOfCoOwningReferences: null, ' + 'nonOwningReference: 0, vectorOfNonOwningReferences: null, ' +- 'anyUniqueType: AnyUniqueAliasesTypeId{value: 0}, anyUnique: null, ' +- 'anyAmbiguousType: AnyAmbiguousAliasesTypeId{value: 0}, ' ++ 'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, ' + 'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, ' +- 'testrequirednestedflatbuffer: null}, ' ++ 'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, ' ++ 'nativeInline: null}, ' + 'testnestedflatbuffer: null, testempty: null, testbool: true, ' + 'testhashs32Fnv1: -579221183, testhashu32Fnv1: 3715746113, ' + 'testhashs64Fnv1: 7930699090847568257, ' +@@ -112,7 +115,9 @@ + 'testhashs64Fnv1a: 4898026182817603057, ' + 'testhashu64Fnv1a: 4898026182817603057, ' + 'testarrayofbools: [true, false, true], testf: 3.14159, testf2: 3.0, ' +- 'testf3: 0.0, testarrayofstring2: null, testarrayofsortedstruct: null, ' ++ 'testf3: 0.0, testarrayofstring2: null, testarrayofsortedstruct: [' ++ 'Ability{id: 0, distance: 45}, Ability{id: 1, distance: 21}, ' ++ 'Ability{id: 5, distance: 12}], ' + 'flex: null, test5: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], ' + 'vectorOfLongs: [1, 100, 10000, 1000000, 100000000], ' + 'vectorOfDoubles: [-1.7976931348623157e+308, 0.0, 1.7976931348623157e+308], ' +@@ -121,22 +126,44 @@ + 'vectorOfStrongReferrables: null, coOwningReference: 0, ' + 'vectorOfCoOwningReferences: null, nonOwningReference: 0, ' + 'vectorOfNonOwningReferences: null, ' +- 'anyUniqueType: AnyUniqueAliasesTypeId{value: 0}, anyUnique: null, ' +- 'anyAmbiguousType: AnyAmbiguousAliasesTypeId{value: 0}, ' ++ 'anyUniqueType: null, anyUnique: null, ' ++ 'anyAmbiguousType: null, ' + 'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, ' +- 'testrequirednestedflatbuffer: null}', ++ 'testrequirednestedflatbuffer: null, scalarKeySortedTables: [Stat{id: ' ++ 'miss, val: 0, count: 0}, Stat{id: hit, val: 10, count: 1}], ' ++ 'nativeInline: Test{a: 1, b: 2}}', + ); + } + } + ++/// Test a custom, fixed-memory allocator (no actual allocations performed) ++class CustomAllocator extends Allocator { ++ final _memory = ByteData(10 * 1024); ++ int _used = 0; ++ ++ Uint8List buffer(int size) => _memory.buffer.asUint8List(_used - size, size); ++ ++ @override ++ ByteData allocate(int size) { ++ if (size > _memory.lengthInBytes) { ++ throw UnsupportedError('Trying to allocate too much'); ++ } ++ _used = size; ++ return ByteData.sublistView(_memory, 0, size); ++ } ++ ++ @override ++ void deallocate(ByteData _) {} ++} ++ + @reflectiveTest + class BuilderTest { +- void test_monsterBuilder() { +- final fbBuilder = new Builder(); ++ void test_monsterBuilder([Builder? builder]) { ++ final fbBuilder = builder ?? Builder(); + final str = fbBuilder.writeString('MyMonster'); + + fbBuilder.writeString('test1'); +- fbBuilder.writeString('test2'); ++ fbBuilder.writeString('test2', asciiOptimization: true); + final testArrayOfString = fbBuilder.endStructVector(2); + + final fred = fbBuilder.writeString('Fred'); +@@ -144,12 +171,12 @@ + final List treasure = [0, 1, 2, 3, 4]; + final inventory = fbBuilder.writeListUint8(treasure); + +- final monBuilder = new example.MonsterBuilder(fbBuilder) ++ final monBuilder = example.MonsterBuilder(fbBuilder) + ..begin() + ..addNameOffset(fred); + final mon2 = monBuilder.finish(); + +- final testBuilder = new example.TestBuilder(fbBuilder); ++ final testBuilder = example.TestBuilder(fbBuilder); + testBuilder.finish(10, 20); + testBuilder.finish(30, 40); + final test4 = fbBuilder.endStructVector(2); +@@ -157,7 +184,7 @@ + monBuilder + ..begin() + ..addPos( +- new example.Vec3Builder(fbBuilder).finish( ++ example.Vec3Builder(fbBuilder).finish( + 1.0, + 2.0, + 3.0, +@@ -177,50 +204,51 @@ + fbBuilder.finish(mon); + } + +- void test_error_addInt32_withoutStartTable() { +- Builder builder = new Builder(); ++ void test_error_addInt32_withoutStartTable([Builder? builder]) { ++ builder ??= Builder(); + expect(() { +- builder.addInt32(0, 0); +- }, throwsStateError); ++ builder!.addInt32(0, 0); ++ }, throwsA(isA())); + } + + void test_error_addOffset_withoutStartTable() { +- Builder builder = new Builder(); ++ Builder builder = Builder(); + expect(() { + builder.addOffset(0, 0); +- }, throwsStateError); ++ }, throwsA(isA())); + } + + void test_error_endTable_withoutStartTable() { +- Builder builder = new Builder(); ++ Builder builder = Builder(); + expect(() { + builder.endTable(); +- }, throwsStateError); ++ }, throwsA(isA())); + } + + void test_error_startTable_duringTable() { +- Builder builder = new Builder(); +- builder.startTable(); ++ Builder builder = Builder(); ++ builder.startTable(0); + expect(() { +- builder.startTable(); +- }, throwsStateError); ++ builder.startTable(0); ++ }, throwsA(isA())); + } + + void test_error_writeString_duringTable() { +- Builder builder = new Builder(); +- builder.startTable(); ++ Builder builder = Builder(); ++ builder.startTable(1); + expect(() { + builder.writeString('12345'); +- }, throwsStateError); ++ }, throwsA(isA())); + } + + void test_file_identifier() { + Uint8List byteList; + { +- Builder builder = new Builder(initialSize: 0); +- builder.startTable(); ++ Builder builder = Builder(initialSize: 0); ++ builder.startTable(0); + int offset = builder.endTable(); +- byteList = builder.finish(offset, 'Az~ÿ'); ++ builder.finish(offset, 'Az~ÿ'); ++ byteList = builder.buffer; + } + // Convert byteList to a ByteData so that we can read data from it. + ByteData byteData = byteList.buffer.asByteData(byteList.offsetInBytes); +@@ -243,32 +271,46 @@ + } + + void test_low() { +- Builder builder = new Builder(initialSize: 0); +- expect((builder..putUint8(1)).lowFinish(), [1]); +- expect((builder..putUint32(2)).lowFinish(), [2, 0, 0, 0, 0, 0, 0, 1]); +- expect((builder..putUint8(3)).lowFinish(), +- [0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 1]); +- expect((builder..putUint8(4)).lowFinish(), +- [0, 0, 4, 3, 2, 0, 0, 0, 0, 0, 0, 1]); +- expect((builder..putUint8(5)).lowFinish(), +- [0, 5, 4, 3, 2, 0, 0, 0, 0, 0, 0, 1]); +- expect((builder..putUint32(6)).lowFinish(), ++ final allocator = CustomAllocator(); ++ final builder = Builder(initialSize: 0, allocator: allocator); ++ ++ builder.putUint8(1); ++ expect(allocator.buffer(builder.size()), [1]); ++ ++ builder.putUint32(2); ++ expect(allocator.buffer(builder.size()), [2, 0, 0, 0, 0, 0, 0, 1]); ++ ++ builder.putUint8(3); ++ expect( ++ allocator.buffer(builder.size()), [0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 1]); ++ ++ builder.putUint8(4); ++ expect( ++ allocator.buffer(builder.size()), [0, 0, 4, 3, 2, 0, 0, 0, 0, 0, 0, 1]); ++ ++ builder.putUint8(5); ++ expect( ++ allocator.buffer(builder.size()), [0, 5, 4, 3, 2, 0, 0, 0, 0, 0, 0, 1]); ++ ++ builder.putUint32(6); ++ expect(allocator.buffer(builder.size()), + [6, 0, 0, 0, 0, 5, 4, 3, 2, 0, 0, 0, 0, 0, 0, 1]); + } + + void test_table_default() { + List byteList; + { +- Builder builder = new Builder(initialSize: 0); +- builder.startTable(); ++ final builder = Builder(initialSize: 0, allocator: CustomAllocator()); ++ builder.startTable(2); + builder.addInt32(0, 10, 10); + builder.addInt32(1, 20, 10); + int offset = builder.endTable(); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + expect(builder.size(), byteList.length); + } + // read and verify +- BufferContext buffer = new BufferContext.fromBytes(byteList); ++ BufferContext buffer = BufferContext.fromBytes(byteList); + int objectOffset = buffer.derefObject(0); + // was not written, so uses the new default value + expect( +@@ -282,15 +324,16 @@ + 20); + } + +- void test_table_format() { ++ void test_table_format([Builder? builder]) { + Uint8List byteList; + { +- Builder builder = new Builder(initialSize: 0); +- builder.startTable(); ++ builder ??= Builder(initialSize: 0); ++ builder.startTable(3); + builder.addInt32(0, 10); + builder.addInt32(1, 20); + builder.addInt32(2, 30); +- byteList = builder.finish(builder.endTable()); ++ builder.finish(builder.endTable()); ++ byteList = builder.buffer; + } + // Convert byteList to a ByteData so that we can read data from it. + ByteData byteData = byteList.buffer.asByteData(byteList.offsetInBytes); +@@ -319,30 +362,37 @@ + String unicodeString = 'Проба пера'; + List byteList; + { +- Builder builder = new Builder(initialSize: 0); +- int latinStringOffset = builder.writeString(latinString); +- int unicodeStringOffset = builder.writeString(unicodeString); +- builder.startTable(); ++ Builder builder = Builder(initialSize: 0); ++ int? latinStringOffset = ++ builder.writeString(latinString, asciiOptimization: true); ++ int? unicodeStringOffset = ++ builder.writeString(unicodeString, asciiOptimization: true); ++ builder.startTable(2); + builder.addOffset(0, latinStringOffset); + builder.addOffset(1, unicodeStringOffset); + int offset = builder.endTable(); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); ++ BufferContext buf = BufferContext.fromBytes(byteList); + int objectOffset = buf.derefObject(0); +- expect(const StringReader().vTableGet(buf, objectOffset, indexToField(0)), ++ expect( ++ const StringReader() ++ .vTableGetNullable(buf, objectOffset, indexToField(0)), + latinString); +- expect(const StringReader().vTableGet(buf, objectOffset, indexToField(1)), ++ expect( ++ const StringReader(asciiOptimization: true) ++ .vTableGetNullable(buf, objectOffset, indexToField(1)), + unicodeString); + } + +- void test_table_types() { ++ void test_table_types([Builder? builder]) { + List byteList; + { +- Builder builder = new Builder(initialSize: 0); +- int stringOffset = builder.writeString('12345'); +- builder.startTable(); ++ builder ??= Builder(initialSize: 0); ++ int? stringOffset = builder.writeString('12345'); ++ builder.startTable(7); + builder.addBool(0, true); + builder.addInt8(1, 10); + builder.addInt32(2, 20); +@@ -351,24 +401,39 @@ + builder.addUint32(5, 0x9ABCDEF0); + builder.addUint8(6, 0x9A); + int offset = builder.endTable(); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); ++ BufferContext buf = BufferContext.fromBytes(byteList); + int objectOffset = buf.derefObject(0); + expect( +- const BoolReader().vTableGet(buf, objectOffset, indexToField(0)), true); ++ const BoolReader() ++ .vTableGetNullable(buf, objectOffset, indexToField(0)), ++ true); ++ expect( ++ const Int8Reader() ++ .vTableGetNullable(buf, objectOffset, indexToField(1)), ++ 10); + expect( +- const Int8Reader().vTableGet(buf, objectOffset, indexToField(1)), 10); ++ const Int32Reader() ++ .vTableGetNullable(buf, objectOffset, indexToField(2)), ++ 20); + expect( +- const Int32Reader().vTableGet(buf, objectOffset, indexToField(2)), 20); +- expect(const StringReader().vTableGet(buf, objectOffset, indexToField(3)), ++ const StringReader() ++ .vTableGetNullable(buf, objectOffset, indexToField(3)), + '12345'); + expect( +- const Int32Reader().vTableGet(buf, objectOffset, indexToField(4)), 40); +- expect(const Uint32Reader().vTableGet(buf, objectOffset, indexToField(5)), ++ const Int32Reader() ++ .vTableGetNullable(buf, objectOffset, indexToField(4)), ++ 40); ++ expect( ++ const Uint32Reader() ++ .vTableGetNullable(buf, objectOffset, indexToField(5)), + 0x9ABCDEF0); +- expect(const Uint8Reader().vTableGet(buf, objectOffset, indexToField(6)), ++ expect( ++ const Uint8Reader() ++ .vTableGetNullable(buf, objectOffset, indexToField(6)), + 0x9A); + } + +@@ -377,12 +442,13 @@ + // write + List byteList; + { +- Builder builder = new Builder(initialSize: 0); ++ Builder builder = Builder(initialSize: 0); + int offset = builder.writeListUint32(values); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); ++ BufferContext buf = BufferContext.fromBytes(byteList); + List items = const Uint32ListReader().read(buf, 0); + expect(items, hasLength(4)); + expect(items, orderedEquals(values)); +@@ -393,16 +459,17 @@ + // write + List byteList; + { +- Builder builder = new Builder(initialSize: 0); +- List values = new List.filled(len, false); ++ Builder builder = Builder(initialSize: 0); ++ List values = List.filled(len, false); + for (int bit in trueBits) { + values[bit] = true; + } + int offset = builder.writeListBool(values); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); ++ BufferContext buf = BufferContext.fromBytes(byteList); + List items = const BoolListReader().read(buf, 0); + expect(items, hasLength(len)); + for (int i = 0; i < items.length; i++) { +@@ -421,25 +488,26 @@ + verifyListBooleans(33, [1, 2, 24, 25, 31, 32]); + verifyListBooleans(63, []); + verifyListBooleans(63, [0, 1, 2, 61, 62]); +- verifyListBooleans(63, new List.generate(63, (i) => i)); ++ verifyListBooleans(63, List.generate(63, (i) => i)); + verifyListBooleans(64, []); + verifyListBooleans(64, [0, 1, 2, 61, 62, 63]); + verifyListBooleans(64, [1, 2, 62]); + verifyListBooleans(64, [0, 1, 2, 63]); +- verifyListBooleans(64, new List.generate(64, (i) => i)); ++ verifyListBooleans(64, List.generate(64, (i) => i)); + verifyListBooleans(100, [0, 3, 30, 60, 90, 99]); + } + + void test_writeList_ofInt32() { + List byteList; + { +- Builder builder = new Builder(initialSize: 0); ++ Builder builder = Builder(initialSize: 0); + int offset = builder.writeListInt32([1, 2, 3, 4, 5]); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); +- List items = const ListReader(const Int32Reader()).read(buf, 0); ++ BufferContext buf = BufferContext.fromBytes(byteList); ++ List items = const ListReader(Int32Reader()).read(buf, 0); + expect(items, hasLength(5)); + expect(items, orderedEquals([1, 2, 3, 4, 5])); + } +@@ -449,13 +517,14 @@ + // write + List byteList; + { +- Builder builder = new Builder(initialSize: 0); ++ Builder builder = Builder(initialSize: 0); + int offset = builder.writeListFloat64(values); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); ++ BufferContext buf = BufferContext.fromBytes(byteList); + List items = const Float64ListReader().read(buf, 0); + + expect(items, hasLength(values.length)); +@@ -469,12 +538,13 @@ + // write + List byteList; + { +- Builder builder = new Builder(initialSize: 0); ++ Builder builder = Builder(initialSize: 0); + int offset = builder.writeListFloat32(values); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); ++ BufferContext buf = BufferContext.fromBytes(byteList); + List items = const Float32ListReader().read(buf, 0); + expect(items, hasLength(5)); + for (int i = 0; i < values.length; i++) { +@@ -482,14 +552,14 @@ + } + } + +- void test_writeList_ofObjects() { ++ void test_writeList_ofObjects([Builder? builder]) { + List byteList; + { +- Builder builder = new Builder(initialSize: 0); ++ builder ??= Builder(initialSize: 0); + // write the object #1 + int object1; + { +- builder.startTable(); ++ builder.startTable(2); + builder.addInt32(0, 10); + builder.addInt32(1, 20); + object1 = builder.endTable(); +@@ -497,19 +567,20 @@ + // write the object #1 + int object2; + { +- builder.startTable(); ++ builder.startTable(2); + builder.addInt32(0, 100); + builder.addInt32(1, 200); + object2 = builder.endTable(); + } + // write the list + int offset = builder.writeList([object1, object2]); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); ++ BufferContext buf = BufferContext.fromBytes(byteList); + List items = +- const ListReader(const TestPointReader()).read(buf, 0); ++ const ListReader(TestPointReader()).read(buf, 0); + expect(items, hasLength(2)); + expect(items[0].x, 10); + expect(items[0].y, 20); +@@ -520,36 +591,37 @@ + void test_writeList_ofStrings_asRoot() { + List byteList; + { +- Builder builder = new Builder(initialSize: 0); +- int str1 = builder.writeString('12345'); +- int str2 = builder.writeString('ABC'); ++ Builder builder = Builder(initialSize: 0); ++ int? str1 = builder.writeString('12345'); ++ int? str2 = builder.writeString('ABC'); + int offset = builder.writeList([str1, str2]); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); +- List items = +- const ListReader(const StringReader()).read(buf, 0); ++ BufferContext buf = BufferContext.fromBytes(byteList); ++ List items = const ListReader(StringReader()).read(buf, 0); + expect(items, hasLength(2)); + expect(items, contains('12345')); + expect(items, contains('ABC')); + } + +- void test_writeList_ofStrings_inObject() { ++ void test_writeList_ofStrings_inObject([Builder? builder]) { + List byteList; + { +- Builder builder = new Builder(initialSize: 0); ++ builder ??= Builder(initialSize: 0); + int listOffset = builder.writeList( + [builder.writeString('12345'), builder.writeString('ABC')]); +- builder.startTable(); ++ builder.startTable(1); + builder.addOffset(0, listOffset); + int offset = builder.endTable(); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); +- StringListWrapperImpl reader = new StringListWrapperReader().read(buf, 0); +- List items = reader.items; ++ BufferContext buf = BufferContext.fromBytes(byteList); ++ StringListWrapperImpl reader = StringListWrapperReader().read(buf, 0); ++ List? items = reader.items; + expect(items, hasLength(2)); + expect(items, contains('12345')); + expect(items, contains('ABC')); +@@ -558,12 +630,13 @@ + void test_writeList_ofUint32() { + List byteList; + { +- Builder builder = new Builder(initialSize: 0); ++ Builder builder = Builder(initialSize: 0); + int offset = builder.writeListUint32([1, 2, 0x9ABCDEF0]); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); ++ BufferContext buf = BufferContext.fromBytes(byteList); + List items = const Uint32ListReader().read(buf, 0); + expect(items, hasLength(3)); + expect(items, orderedEquals([1, 2, 0x9ABCDEF0])); +@@ -572,12 +645,13 @@ + void test_writeList_ofUint16() { + List byteList; + { +- Builder builder = new Builder(initialSize: 0); ++ Builder builder = Builder(initialSize: 0); + int offset = builder.writeListUint16([1, 2, 60000]); +- byteList = builder.finish(offset); ++ builder.finish(offset); ++ byteList = builder.buffer; + } + // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); ++ BufferContext buf = BufferContext.fromBytes(byteList); + List items = const Uint16ListReader().read(buf, 0); + expect(items, hasLength(3)); + expect(items, orderedEquals([1, 2, 60000])); +@@ -586,15 +660,188 @@ + void test_writeList_ofUint8() { + List byteList; + { +- Builder builder = new Builder(initialSize: 0); +- int offset = builder.writeListUint8([1, 2, 3, 4, 0x9A]); +- byteList = builder.finish(offset); ++ Builder builder = Builder(initialSize: 0); ++ int offset = builder.writeListUint8([1, 2, 3, 4, 0x9A, 0xFA]); ++ builder.finish(offset); ++ byteList = builder.buffer; ++ } ++ // read and verify ++ BufferContext buf = BufferContext.fromBytes(byteList); ++ const buffOffset = 8; // 32-bit offset to the list, + 32-bit length ++ for (final lazy in [true, false]) { ++ List items = Uint8ListReader(lazy: lazy).read(buf, 0); ++ expect(items, hasLength(6)); ++ expect(items, orderedEquals([1, 2, 3, 4, 0x9A, 0xFA])); ++ ++ // overwrite the buffer to verify the laziness ++ buf.buffer.setUint8(buffOffset + 1, 99); ++ expect(items, orderedEquals([1, lazy ? 99 : 2, 3, 4, 0x9A, 0xFA])); ++ ++ // restore the previous value for the next loop ++ buf.buffer.setUint8(buffOffset + 1, 2); + } +- // read and verify +- BufferContext buf = new BufferContext.fromBytes(byteList); +- List items = const Uint8ListReader().read(buf, 0); +- expect(items, hasLength(5)); +- expect(items, orderedEquals([1, 2, 3, 4, 0x9A])); ++ } ++ ++ void test_reset() { ++ // We'll run a selection of tests , reusing the builder between them. ++ final testCases = [ ++ test_monsterBuilder, ++ test_error_addInt32_withoutStartTable, ++ test_table_format, ++ test_table_types, ++ test_writeList_ofObjects, ++ test_writeList_ofStrings_inObject ++ ]; ++ ++ // Execute all test cases in all permutations of their order. ++ // To do that, we generate permutations of test case indexes. ++ final testCasesPermutations = ++ _permutationsOf(List.generate(testCases.length, (index) => index)); ++ expect(testCasesPermutations.length, _factorial(testCases.length)); ++ ++ for (var indexes in testCasesPermutations) { ++ // print the order so failures are reproducible ++ printOnFailure('Running reset() test cases in order: $indexes'); ++ ++ Builder? builder; ++ for (var index in indexes) { ++ if (builder == null) { ++ // Initial size small enough so at least one test case increases it. ++ // On the other hand, it's large enough so that some test cases don't. ++ builder = Builder(initialSize: 32); ++ } else { ++ builder.reset(); ++ } ++ testCases[index](builder); ++ } ++ } ++ } ++ ++ // Generate permutations of the given list ++ List> _permutationsOf(List source) { ++ final result = >[]; ++ ++ void permutate(List items, int startAt) { ++ for (var i = startAt; i < items.length; i++) { ++ List permutation = items.toList(growable: false); ++ permutation[i] = items[startAt]; ++ permutation[startAt] = items[i]; ++ ++ // add the current list upon reaching the end ++ if (startAt == items.length - 1) { ++ result.add(items); ++ } else { ++ permutate(permutation, startAt + 1); ++ } ++ } ++ } ++ ++ permutate(source, 0); ++ return result; ++ } ++ ++ // a very simple implementation of n! ++ int _factorial(int n) { ++ var result = 1; ++ for (var i = 2; i <= n; i++) { ++ result *= i; ++ } ++ return result; ++ } ++} ++ ++@reflectiveTest ++class ObjectAPITest { ++ void test_tableStat() { ++ final object1 = example.StatT(count: 3, id: "foo", val: 4); ++ expect(object1 is Packable, isTrue); ++ final fbb = Builder(); ++ fbb.finish(object1.pack(fbb)); ++ final object2 = example.Stat(fbb.buffer).unpack(); ++ expect(object2.count, object1.count); ++ expect(object2.id, object1.id); ++ expect(object2.val, object1.val); ++ expect(object2.toString(), object1.toString()); ++ } ++ ++ void test_tableMonster() { ++ final monster = example.MonsterT() ++ ..pos = example.Vec3T( ++ x: 1, ++ y: 2, ++ z: 3, ++ test1: 4.0, ++ test2: example.Color.Red, ++ test3: example.TestT(a: 1, b: 2)) ++ ..mana = 2 ++ ..name = 'Monstrous' ++ ..inventory = [24, 42] ++ ..color = example.Color.Green ++ // TODO be smarter for unions and automatically set the `type` field? ++ ..testType = example.AnyTypeId.MyGame_Example2_Monster ++ ..test = example2.MonsterT() ++ ..test4 = [example.TestT(a: 3, b: 4), example.TestT(a: 5, b: 6)] ++ ..testarrayofstring = ["foo", "bar"] ++ ..testarrayoftables = [example.MonsterT(name: 'Oof')] ++ ..enemy = example.MonsterT(name: 'Enemy') ++ ..testarrayofbools = [false, true, false] ++ ..testf = 42.24 ++ ..testarrayofsortedstruct = [ ++ example.AbilityT(id: 1, distance: 5), ++ example.AbilityT(id: 3, distance: 7) ++ ] ++ ..vectorOfLongs = [5, 6, 7] ++ ..vectorOfDoubles = [8.9, 9.0, 10.1, 11.2] ++ ..anyAmbiguousType = example.AnyAmbiguousAliasesTypeId.M2 ++ ..anyAmbiguous = null ++ ..vectorOfEnums = [example.Color.Blue, example.Color.Green] ++ ..signedEnum = example.Race.None; ++ ++ final fbBuilder = Builder(); ++ final offset = monster.pack(fbBuilder); ++ expect(offset, isNonZero); ++ fbBuilder.finish(offset); ++ final data = fbBuilder.buffer; ++ ++ // TODO currently broken because of struct builder issue, see #6688 ++ // final monster2 = example.Monster(data); // Monster (reader) ++ // expect( ++ // // map Monster => MonsterT, Vec3 => Vec3T, ... ++ // monster2.toString().replaceAllMapped( ++ // RegExp('([a-zA-z0-9]+){'), (match) => match.group(1) + 'T{'), ++ // monster.toString()); ++ // ++ // final monster3 = monster2.unpack(); // MonsterT ++ // expect(monster3.toString(), monster.toString()); ++ } ++ ++ void test_Lists() { ++ // Ensure unpack() reads lists eagerly by reusing the same builder and ++ // overwriting data. Why: because standard reader reads lists lazily... ++ final fbb = Builder(); ++ ++ final object1 = example.TypeAliasesT(v8: [1, 2, 3], vf64: [5, 6]); ++ fbb.finish(object1.pack(fbb)); ++ final object1Read = example.TypeAliases(fbb.buffer).unpack(); ++ ++ // overwrite the original buffer by writing to the same builder ++ fbb.reset(); ++ final object2 = example.TypeAliasesT(v8: [7, 8, 9], vf64: [10, 11]); ++ fbb.finish(object2.pack(fbb)); ++ final object2Read = example.TypeAliases(fbb.buffer).unpack(); ++ ++ // this is fine even with lazy lists: ++ expect(object2.toString(), object2Read.toString()); ++ ++ // this fails with lazy lists: ++ expect(object1.toString(), object1Read.toString()); ++ ++ // empty list must be serialized as such (were stored NULL before v2.0) ++ fbb.reset(); ++ final object3 = example.TypeAliasesT(v8: [], vf64: null); ++ fbb.finish(object3.pack(fbb)); ++ final object3Read = example.TypeAliases(fbb.buffer).unpack(); ++ expect(object3.toString(), object3Read.toString()); + } + } + +@@ -604,8 +851,8 @@ + + StringListWrapperImpl(this.bp, this.offset); + +- List get items => const ListReader(const StringReader()) +- .vTableGet(bp, offset, indexToField(0)); ++ List? get items => const ListReader(StringReader()) ++ .vTableGetNullable(bp, offset, indexToField(0)); + } + + class StringListWrapperReader extends TableReader { +@@ -613,7 +860,7 @@ + + @override + StringListWrapperImpl createObject(BufferContext object, int offset) { +- return new StringListWrapperImpl(object, offset); ++ return StringListWrapperImpl(object, offset); + } + } + +@@ -633,7 +880,7 @@ + + @override + TestPointImpl createObject(BufferContext object, int offset) { +- return new TestPointImpl(object, offset); ++ return TestPointImpl(object, offset); + } + } + +@@ -643,7 +890,9 @@ + expect(example.Color.values, same(example.Color.values)); + expect(example.Race.values, same(example.Race.values)); + expect(example.AnyTypeId.values, same(example.AnyTypeId.values)); +- expect(example.AnyUniqueAliasesTypeId.values, same(example.AnyUniqueAliasesTypeId.values)); +- expect(example.AnyAmbiguousAliasesTypeId.values, same(example.AnyAmbiguousAliasesTypeId.values)); ++ expect(example.AnyUniqueAliasesTypeId.values, ++ same(example.AnyUniqueAliasesTypeId.values)); ++ expect(example.AnyAmbiguousAliasesTypeId.values, ++ same(example.AnyAmbiguousAliasesTypeId.values)); + } + } +diff -urN a/dart/test/flex_builder_test.dart b/dart/test/flex_builder_test.dart +--- a/dart/test/flex_builder_test.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/test/flex_builder_test.dart 2023-01-13 07:47:12.522285700 +0000 +@@ -58,18 +58,18 @@ + { + var flx = Builder(); + flx.addString('hello 😱'); +- expect(flx.finish(), [10, 104, 101, 108, 108, 111, 32, 240, 159, 152, 177, 0, 11, 20, 1]); ++ expect(flx.finish(), ++ [10, 104, 101, 108, 108, 111, 32, 240, 159, 152, 177, 0, 11, 20, 1]); + } + }); + +- test('build vector', (){ ++ test('build vector', () { + { + var flx = Builder() + ..startVector() + ..addInt(1) + ..addInt(2) +- ..end() +- ; ++ ..end(); + expect(flx.finish(), [1, 2, 2, 64, 1]); + } + { +@@ -77,8 +77,7 @@ + ..startVector() + ..addInt(-1) + ..addInt(256) +- ..end() +- ; ++ ..end(); + expect(flx.finish(), [255, 255, 0, 1, 4, 65, 1]); + } + { +@@ -86,8 +85,7 @@ + ..startVector() + ..addInt(-45) + ..addInt(256000) +- ..end() +- ; ++ ..end(); + expect(flx.finish(), [211, 255, 255, 255, 0, 232, 3, 0, 8, 66, 1]); + } + { +@@ -95,9 +93,28 @@ + ..startVector() + ..addDouble(1.1) + ..addDouble(-256) +- ..end() +- ; +- expect(flx.finish(), [154, 153, 153, 153, 153, 153, 241, 63, 0, 0, 0, 0, 0, 0, 112, 192, 16, 75, 1]); ++ ..end(); ++ expect(flx.finish(), [ ++ 154, ++ 153, ++ 153, ++ 153, ++ 153, ++ 153, ++ 241, ++ 63, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 112, ++ 192, ++ 16, ++ 75, ++ 1 ++ ]); + } + { + var flx = Builder() +@@ -105,8 +122,7 @@ + ..addInt(1) + ..addInt(2) + ..addInt(4) +- ..end() +- ; ++ ..end(); + expect(flx.finish(), [1, 2, 4, 3, 76, 1]); + } + { +@@ -115,19 +131,17 @@ + ..addInt(-1) + ..addInt(256) + ..addInt(4) +- ..end() +- ; ++ ..end(); + expect(flx.finish(), [255, 255, 0, 1, 4, 0, 6, 77, 1]); + } + { + var flx = Builder() + ..startVector() +- ..startVector() +- ..addInt(61) +- ..end() +- ..addInt(64) ++ ..startVector() ++ ..addInt(61) + ..end() +- ; ++ ..addInt(64) ++ ..end(); + expect(flx.finish(), [1, 61, 2, 2, 64, 44, 4, 4, 40, 1]); + } + { +@@ -136,9 +150,31 @@ + ..addString('foo') + ..addString('bar') + ..addString('baz') +- ..end() +- ; +- expect(flx.finish(), [3, 102, 111, 111, 0, 3, 98, 97, 114, 0, 3, 98, 97, 122, 0, 3, 15, 11, 7, 3, 60, 1]); ++ ..end(); ++ expect(flx.finish(), [ ++ 3, ++ 102, ++ 111, ++ 111, ++ 0, ++ 3, ++ 98, ++ 97, ++ 114, ++ 0, ++ 3, ++ 98, ++ 97, ++ 122, ++ 0, ++ 3, ++ 15, ++ 11, ++ 7, ++ 3, ++ 60, ++ 1 ++ ]); + } + { + var flx = Builder() +@@ -149,9 +185,34 @@ + ..addString('foo') + ..addString('bar') + ..addString('baz') +- ..end() +- ; +- expect(flx.finish(), [3, 102, 111, 111, 0, 3, 98, 97, 114, 0, 3, 98, 97, 122, 0, 6, 15, 11, 7, 18, 14, 10, 6, 60, 1]); ++ ..end(); ++ expect(flx.finish(), [ ++ 3, ++ 102, ++ 111, ++ 111, ++ 0, ++ 3, ++ 98, ++ 97, ++ 114, ++ 0, ++ 3, ++ 98, ++ 97, ++ 122, ++ 0, ++ 6, ++ 15, ++ 11, ++ 7, ++ 18, ++ 14, ++ 10, ++ 6, ++ 60, ++ 1 ++ ]); + } + { + var flx = Builder() +@@ -159,8 +220,7 @@ + ..addBool(true) + ..addBool(false) + ..addBool(true) +- ..end() +- ; ++ ..end(); + expect(flx.finish(), [3, 1, 0, 1, 3, 144, 1]); + } + { +@@ -171,29 +231,83 @@ + ..addInt(-5) + ..addDouble(1.3) + ..addBool(true) +- ..end() +- ; ++ ..end(); + expect(flx.finish(), [ +- 3, 102, 111, 111, 0, 0, 0, 0, +- 5, 0, 0, 0, 0, 0, 0, 0, +- 15, 0, 0, 0, 0, 0, 0, 0, +- 1, 0, 0, 0, 0, 0, 0, 0, +- 251, 255, 255, 255, 255, 255, 255, 255, +- 205, 204, 204, 204, 204, 204, 244, 63, +- 1, 0, 0, 0, 0, 0, 0, 0, +- 20, 4, 4, 15, 104, 45, 43, 1]); ++ 3, ++ 102, ++ 111, ++ 111, ++ 0, ++ 0, ++ 0, ++ 0, ++ 5, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 15, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 1, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 251, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 205, ++ 204, ++ 204, ++ 204, ++ 204, ++ 204, ++ 244, ++ 63, ++ 1, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 20, ++ 4, ++ 4, ++ 15, ++ 104, ++ 45, ++ 43, ++ 1 ++ ]); + } + }); + +- test('build map', () +- { ++ test('build map', () { + { + var flx = Builder() + ..startMap() + ..addKey('a') + ..addInt(12) +- ..end() +- ; ++ ..end(); + expect(flx.finish(), [97, 0, 1, 3, 1, 1, 1, 12, 4, 2, 36, 1]); + } + { +@@ -203,105 +317,270 @@ + ..addInt(12) + ..addKey('') + ..addInt(45) +- ..end() +- ; +- expect(flx.finish(), [97, 0, 0, 2, 2, 5, 2, 1, 2, 45, 12, 4, 4, 4, 36, 1]); ++ ..end(); ++ expect( ++ flx.finish(), [97, 0, 0, 2, 2, 5, 2, 1, 2, 45, 12, 4, 4, 4, 36, 1]); + } + { + var flx = Builder() + ..startVector() +- ..startMap() +- ..addKey('something') +- ..addInt(12) +- ..end() +- ..startMap() +- ..addKey('something') +- ..addInt(45) +- ..end() ++ ..startMap() ++ ..addKey('something') ++ ..addInt(12) + ..end() +- ; +- expect(flx.finish(), [115, 111, 109, 101, 116, 104, 105, 110, 103, 0, +- 1, 11, 1, 1, 1, 12, 4, 6, 1, 1, 45, 4, 2, 8, 4, 36, 36, 4, 40, 1]); ++ ..startMap() ++ ..addKey('something') ++ ..addInt(45) ++ ..end() ++ ..end(); ++ expect(flx.finish(), [ ++ 115, ++ 111, ++ 109, ++ 101, ++ 116, ++ 104, ++ 105, ++ 110, ++ 103, ++ 0, ++ 1, ++ 11, ++ 1, ++ 1, ++ 1, ++ 12, ++ 4, ++ 6, ++ 1, ++ 1, ++ 45, ++ 4, ++ 2, ++ 8, ++ 4, ++ 36, ++ 36, ++ 4, ++ 40, ++ 1 ++ ]); + } + }); + +- test('build blob', () +- { ++ test('build blob', () { + { +- var flx = Builder() +- ..addBlob(Uint8List.fromList([1, 2, 3]).buffer) +- ; ++ var flx = Builder()..addBlob(Uint8List.fromList([1, 2, 3]).buffer); + expect(flx.finish(), [3, 1, 2, 3, 3, 100, 1]); + } + }); + +- test('build from object', (){ +- expect(Builder.buildFromObject(Uint8List.fromList([1, 2, 3]).buffer).asUint8List(), [3, 1, 2, 3, 3, 100, 1]); ++ test('build from object', () { ++ expect( ++ Builder.buildFromObject(Uint8List.fromList([1, 2, 3]).buffer) ++ .asUint8List(), ++ [3, 1, 2, 3, 3, 100, 1]); + expect(Builder.buildFromObject(null).asUint8List(), [0, 0, 1]); + expect(Builder.buildFromObject(true).asUint8List(), [1, 104, 1]); + expect(Builder.buildFromObject(false).asUint8List(), [0, 104, 1]); + expect(Builder.buildFromObject(25).asUint8List(), [25, 4, 1]); + expect(Builder.buildFromObject(-250).asUint8List(), [6, 255, 5, 2]); +- expect(Builder.buildFromObject(-2.50).asUint8List(), [0, 0, 32, 192, 14, 4]); +- expect(Builder.buildFromObject('Maxim').asUint8List(), [5, 77, 97, 120, 105, 109, 0, 6, 20, 1]); +- expect(Builder.buildFromObject([1, 3.3, 'max', true, null, false]).asUint8List(), [ +- 3, 109, 97, 120, 0, 0, 0, 0, +- 6, 0, 0, 0, 0, 0, 0, 0, +- 1, 0, 0, 0, 0, 0, 0, 0, +- 102, 102, 102, 102, 102, 102, 10, 64, +- 31, 0, 0, 0, 0, 0, 0, 0, +- 1, 0, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, +- 0, 0, 0, 0, 0, 0, 0, 0, +- 4, 15, 20, 104, 0, 104, 54, 43, 1 +- ]); +- expect(Builder.buildFromObject([{'something':12}, {'something': 45}]).asUint8List(), [ +- 115, 111, 109, 101, 116, 104, 105, 110, 103, 0, +- 1, 11, 1, 1, 1, 12, 4, 6, 1, 1, 45, 4, 2, 8, 4, 36, 36, 4, 40, 1 +- ]); ++ expect( ++ Builder.buildFromObject(-2.50).asUint8List(), [0, 0, 32, 192, 14, 4]); ++ expect(Builder.buildFromObject('Maxim').asUint8List(), ++ [5, 77, 97, 120, 105, 109, 0, 6, 20, 1]); ++ expect( ++ Builder.buildFromObject([1, 3.3, 'max', true, null, false]) ++ .asUint8List(), ++ [ ++ 3, ++ 109, ++ 97, ++ 120, ++ 0, ++ 0, ++ 0, ++ 0, ++ 6, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 1, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 102, ++ 102, ++ 102, ++ 102, ++ 102, ++ 102, ++ 10, ++ 64, ++ 31, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 1, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 4, ++ 15, ++ 20, ++ 104, ++ 0, ++ 104, ++ 54, ++ 43, ++ 1 ++ ]); ++ expect( ++ Builder.buildFromObject([ ++ {'something': 12}, ++ {'something': 45} ++ ]).asUint8List(), ++ [ ++ 115, ++ 111, ++ 109, ++ 101, ++ 116, ++ 104, ++ 105, ++ 110, ++ 103, ++ 0, ++ 1, ++ 11, ++ 1, ++ 1, ++ 1, ++ 12, ++ 4, ++ 6, ++ 1, ++ 1, ++ 45, ++ 4, ++ 2, ++ 8, ++ 4, ++ 36, ++ 36, ++ 4, ++ 40, ++ 1 ++ ]); + }); + +- test('add double indirectly', (){ +- var flx = Builder() +- ..addDoubleIndirectly(0.1) +- ; ++ test('add double indirectly', () { ++ var flx = Builder()..addDoubleIndirectly(0.1); + expect(flx.finish(), [154, 153, 153, 153, 153, 153, 185, 63, 8, 35, 1]); + }); + +- test('add double indirectly to vector with cache', (){ ++ test('add double indirectly to vector with cache', () { + var flx = Builder() + ..startVector() + ..addDoubleIndirectly(0.1, cache: true) + ..addDoubleIndirectly(0.1, cache: true) + ..addDoubleIndirectly(0.1, cache: true) + ..addDoubleIndirectly(0.1, cache: true) +- ..end() +- ; +- expect(flx.finish(), [154, 153, 153, 153, 153, 153, 185, 63, +- 4, 9, 10, 11, 12, 35, 35, 35, 35, 8, 40, 1]); ++ ..end(); ++ expect(flx.finish(), [ ++ 154, ++ 153, ++ 153, ++ 153, ++ 153, ++ 153, ++ 185, ++ 63, ++ 4, ++ 9, ++ 10, ++ 11, ++ 12, ++ 35, ++ 35, ++ 35, ++ 35, ++ 8, ++ 40, ++ 1 ++ ]); + }); + +- test('add int indirectly', (){ +- var flx = Builder() +- ..addIntIndirectly(2345234523452345) +- ; ++ test('add int indirectly', () { ++ var flx = Builder()..addIntIndirectly(2345234523452345); + expect(flx.finish(), [185, 115, 175, 118, 250, 84, 8, 0, 8, 27, 1]); + }); + +- test('add int indirectly to vector with cache', (){ ++ test('add int indirectly to vector with cache', () { + var flx = Builder() + ..startVector() + ..addIntIndirectly(2345234523452345, cache: true) + ..addIntIndirectly(2345234523452345, cache: true) + ..addIntIndirectly(2345234523452345, cache: true) + ..addIntIndirectly(2345234523452345, cache: true) +- ..end() +- ; +- expect(flx.finish(), [185, 115, 175, 118, 250, 84, 8, 0, +- 4, 9, 10, 11, 12, 27, 27, 27, 27, 8, 40, 1]); ++ ..end(); ++ expect(flx.finish(), [ ++ 185, ++ 115, ++ 175, ++ 118, ++ 250, ++ 84, ++ 8, ++ 0, ++ 4, ++ 9, ++ 10, ++ 11, ++ 12, ++ 27, ++ 27, ++ 27, ++ 27, ++ 8, ++ 40, ++ 1 ++ ]); + }); + +- test('snapshot', (){ ++ test('snapshot', () { + var flx = Builder(); + flx.startVector(); + flx.addInt(12); +@@ -312,4 +591,3 @@ + expect(flx.snapshot().asUint8List(), [12, 24, 45, 3, 76, 1]); + }); + } +- +diff -urN a/dart/test/flex_reader_test.dart b/dart/test/flex_reader_test.dart +--- a/dart/test/flex_reader_test.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/test/flex_reader_test.dart 2023-01-13 07:47:12.522285700 +0000 +@@ -21,55 +21,68 @@ + expect(Reference.fromBuffer(b([255, 251, 5, 2])).intValue, -1025); + expect(Reference.fromBuffer(b([1, 4, 9, 2])).intValue, 1025); + expect(Reference.fromBuffer(b([255, 255, 255, 127, 6, 4])).intValue, +- 2147483647); ++ 2147483647); ++ expect(Reference.fromBuffer(b([0, 0, 0, 128, 6, 4])).intValue, -2147483648); + expect( +- Reference.fromBuffer(b([0, 0, 0, 128, 6, 4])).intValue, -2147483648); ++ Reference.fromBuffer(b([255, 255, 255, 255, 0, 0, 0, 0, 7, 8])) ++ .intValue, ++ 4294967295); + expect( +- Reference.fromBuffer(b([255, 255, 255, 255, 0, 0, 0, 0, 7, 8])) +- .intValue, +- 4294967295); +- expect( +- Reference.fromBuffer(b([255, 255, 255, 255, 255, 255, 255, 127, 7, 8])) +- .intValue, +- 9223372036854775807); ++ Reference.fromBuffer(b([255, 255, 255, 255, 255, 255, 255, 127, 7, 8])) ++ .intValue, ++ 9223372036854775807); + expect(Reference.fromBuffer(b([0, 0, 0, 0, 0, 0, 0, 128, 7, 8])).intValue, +- -9223372036854775808); ++ -9223372036854775808); + // Dart does not really support UInt64 + // expect(FlxValue.fromBuffer(b([255, 255, 255, 255, 255, 255, 255, 255, 11, 8])).intValue, 18446744073709551615); + }); + test('double value', () { + expect(Reference.fromBuffer(b([0, 0, 144, 64, 14, 4])).doubleValue, 4.5); + expect(Reference.fromBuffer(b([205, 204, 204, 61, 14, 4])).doubleValue, +- closeTo(.1, .001)); ++ closeTo(.1, .001)); + expect( +- Reference.fromBuffer(b([154, 153, 153, 153, 153, 153, 185, 63, 15, 8])) +- .doubleValue, +- .1); ++ Reference.fromBuffer(b([154, 153, 153, 153, 153, 153, 185, 63, 15, 8])) ++ .doubleValue, ++ .1); + }); + test('num value', () { + expect(Reference.fromBuffer(b([0, 0, 144, 64, 14, 4])).numValue, 4.5); + expect(Reference.fromBuffer(b([205, 204, 204, 61, 14, 4])).numValue, +- closeTo(.1, .001)); ++ closeTo(.1, .001)); + expect( +- Reference.fromBuffer(b([154, 153, 153, 153, 153, 153, 185, 63, 15, 8])) +- .numValue, +- .1); ++ Reference.fromBuffer(b([154, 153, 153, 153, 153, 153, 185, 63, 15, 8])) ++ .numValue, ++ .1); + expect(Reference.fromBuffer(b([255, 251, 5, 2])).numValue, -1025); + }); + test('string value', () { + expect( +- Reference.fromBuffer(b([5, 77, 97, 120, 105, 109, 0, 6, 20, 1])) +- .stringValue, +- 'Maxim'); +- expect( +- Reference.fromBuffer(b([ +- 10, 104, 101, 108, 108, 111, 32, 240, 159, 152, 177, 0, 11, 20, 1 +- ])).stringValue, +- 'hello 😱'); ++ Reference.fromBuffer(b([5, 77, 97, 120, 105, 109, 0, 6, 20, 1])) ++ .stringValue, ++ 'Maxim'); ++ expect( ++ Reference.fromBuffer(b([ ++ 10, ++ 104, ++ 101, ++ 108, ++ 108, ++ 111, ++ 32, ++ 240, ++ 159, ++ 152, ++ 177, ++ 0, ++ 11, ++ 20, ++ 1 ++ ])).stringValue, ++ 'hello 😱'); + }); + test('blob value', () { + expect( +- Reference.fromBuffer(b([3, 1, 2, 3, 3, 100, 1])).blobValue, [1, 2, 3]); ++ Reference.fromBuffer(b([3, 1, 2, 3, 3, 100, 1])).blobValue, [1, 2, 3]); + }); + test('bool vector', () { + var flx = Reference.fromBuffer(b([3, 1, 0, 1, 3, 144, 1])); +@@ -81,27 +94,92 @@ + testNumbers([3, 1, 2, 3, 3, 44, 1], [1, 2, 3]); + testNumbers([3, 255, 2, 3, 3, 44, 1], [-1, 2, 3]); + testNumbers([3, 0, 1, 0, 43, 2, 3, 0, 6, 45, 1], [1, 555, 3]); +- testNumbers( +- [3, 0, 0, 0, 1, 0, 0, 0, 204, 216, 0, 0, 3, 0, 0, 0, 12, 46, 1], +- [1, 55500, 3]); ++ testNumbers([3, 0, 0, 0, 1, 0, 0, 0, 204, 216, 0, 0, 3, 0, 0, 0, 12, 46, 1], ++ [1, 55500, 3]); + testNumbers([ +- 3, 0, 0, 0, 0, 0, 0, 0, +- 1, 0, 0, 0, 0, 0, 0, 0, +- 172, 128, 94, 239, 12, 0, 0, 0, +- 3, 0, 0, 0, 0, 0, 0, 0, +- 24, 47, 1 +- ], [1, 55555555500, 3 ++ 3, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 1, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 172, ++ 128, ++ 94, ++ 239, ++ 12, ++ 0, ++ 0, ++ 0, ++ 3, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 24, ++ 47, ++ 1 ++ ], [ ++ 1, ++ 55555555500, ++ 3 + ]); + testNumbers( +- [3, 0, 0, 0, 0, 0, 192, 63, 0, 0, 32, 64, 0, 0, 96, 64, 12, 54, 1], +- [1.5, 2.5, 3.5]); ++ [3, 0, 0, 0, 0, 0, 192, 63, 0, 0, 32, 64, 0, 0, 96, 64, 12, 54, 1], ++ [1.5, 2.5, 3.5]); + testNumbers([ +- 3, 0, 0, 0, 0, 0, 0, 0, +- 154, 153, 153, 153, 153, 153, 241, 63, +- 154, 153, 153, 153, 153, 153, 1, 64, +- 102, 102, 102, 102, 102, 102, 10, 64, +- 24, 55, 1 +- ], [1.1, 2.2, 3.3 ++ 3, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 154, ++ 153, ++ 153, ++ 153, ++ 153, ++ 153, ++ 241, ++ 63, ++ 154, ++ 153, ++ 153, ++ 153, ++ 153, ++ 153, ++ 1, ++ 64, ++ 102, ++ 102, ++ 102, ++ 102, ++ 102, ++ 102, ++ 10, ++ 64, ++ 24, ++ 55, ++ 1 ++ ], [ ++ 1.1, ++ 2.2, ++ 3.3 + ]); + }); + test('number vector, fixed type', () { +@@ -109,11 +187,28 @@ + testNumbers([255, 255, 0, 1, 4, 65, 1], [-1, 256]); + testNumbers([211, 255, 255, 255, 0, 232, 3, 0, 8, 66, 1], [-45, 256000]); + testNumbers([ +- 211, 255, 255, 255, 255, 255, 255, 255, +- 255, 255, 255, 255, 255, 255, 255, 127, +- 16, 67, 1 ++ 211, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 127, ++ 16, ++ 67, ++ 1 + ], [ +- -45, 9223372036854775807 ++ -45, ++ 9223372036854775807 + ]); + + testNumbers([1, 2, 2, 68, 1], [1, 2]); +@@ -122,85 +217,326 @@ + + testNumbers([205, 204, 140, 63, 0, 0, 0, 192, 8, 74, 1], [1.1, -2]); + testNumbers([ +- 154, 153, 153, 153, 153, 153, 241, 63, +- 0, 0, 0, 0, 0, 0, 112, 192, +- 16, 75, 1 ++ 154, ++ 153, ++ 153, ++ 153, ++ 153, ++ 153, ++ 241, ++ 63, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 112, ++ 192, ++ 16, ++ 75, ++ 1 + ], [ +- 1.1, -256 ++ 1.1, ++ -256 + ]); + + testNumbers([211, 255, 255, 255, 0, 232, 3, 0, 4, 0, 0, 0, 12, 78, 1], +- [-45, 256000, 4]); ++ [-45, 256000, 4]); + + testNumbers([ +- 211, 255, 255, 255, 255, 255, 255, 255, +- 255, 255, 255, 255, 255, 255, 255, 127, +- 4, 0, 0, 0, 0, 0, 0, 0, +- 9, 0, 0, 0, 0, 0, 0, 0, +- 32, 91, 1 ++ 211, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 127, ++ 4, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 9, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 32, ++ 91, ++ 1 + ], [ +- -45, 9223372036854775807, 4, 9 ++ -45, ++ 9223372036854775807, ++ 4, ++ 9 + ]); + + testNumbers([ +- 45, 0, 0, 0, 0, 0, 0, 0, +- 255, 255, 255, 255, 255, 255, 255, 127, +- 4, 0, 0, 0, 0, 0, 0, 0, +- 9, 0, 0, 0, 0, 0, 0, 0, +- 32, 95, 1 ++ 45, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 127, ++ 4, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 9, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 32, ++ 95, ++ 1 + ], [ +- 45, 9223372036854775807, 4, 9 ++ 45, ++ 9223372036854775807, ++ 4, ++ 9 + ]); + + testNumbers([ +- 154, 153, 153, 153, 153, 153, 241, 63, +- 0, 0, 0, 0, 0, 0, 112, 64, +- 0, 0, 0, 0, 0, 0, 16, 64, +- 24, 87, 1 ++ 154, ++ 153, ++ 153, ++ 153, ++ 153, ++ 153, ++ 241, ++ 63, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 112, ++ 64, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 16, ++ 64, ++ 24, ++ 87, ++ 1 + ], [ +- 1.1, 256, 4 ++ 1.1, ++ 256, ++ 4 + ]); + + testNumbers([ +- 154, 153, 153, 153, 153, 153, 241, 63, +- 0, 0, 0, 0, 0, 0, 112, 64, +- 0, 0, 0, 0, 0, 0, 16, 64, +- 0, 0, 0, 0, 0, 0, 34, 64, +- 32, 99, 1 ++ 154, ++ 153, ++ 153, ++ 153, ++ 153, ++ 153, ++ 241, ++ 63, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 112, ++ 64, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 16, ++ 64, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 34, ++ 64, ++ 32, ++ 99, ++ 1 + ], [ +- 1.1, 256, 4, 9 ++ 1.1, ++ 256, ++ 4, ++ 9 + ]); + }); + test('string vector', () { + testStrings([ +- 3, 102, 111, 111, 0, +- 3, 98, 97, 114, 0, +- 3, 98, 97, 122, 0, +- 3, 15, 11, 7, +- 3, 60, 1 ++ 3, ++ 102, ++ 111, ++ 111, ++ 0, ++ 3, ++ 98, ++ 97, ++ 114, ++ 0, ++ 3, ++ 98, ++ 97, ++ 122, ++ 0, ++ 3, ++ 15, ++ 11, ++ 7, ++ 3, ++ 60, ++ 1 + ], [ +- 'foo', 'bar', 'baz' ++ 'foo', ++ 'bar', ++ 'baz' + ]); + testStrings([ +- 3, 102, 111, 111, 0, +- 3, 98, 97, 114, 0, +- 3, 98, 97, 122, 0, +- 6, 15, 11, 7, 18, 14, 10, +- 6, 60, 1 ++ 3, ++ 102, ++ 111, ++ 111, ++ 0, ++ 3, ++ 98, ++ 97, ++ 114, ++ 0, ++ 3, ++ 98, ++ 97, ++ 122, ++ 0, ++ 6, ++ 15, ++ 11, ++ 7, ++ 18, ++ 14, ++ 10, ++ 6, ++ 60, ++ 1 + ], [ +- 'foo', 'bar', 'baz', 'foo', 'bar', 'baz' ++ 'foo', ++ 'bar', ++ 'baz', ++ 'foo', ++ 'bar', ++ 'baz' + ]); + }); + test('mixed vector', () { + var flx = Reference.fromBuffer(b([ +- 3, 102, 111, 111, 0, 0, 0, 0, +- 5, 0, 0, 0, 0, 0, 0, 0, +- 15, 0, 0, 0, 0, 0, 0, 0, +- 1, 0, 0, 0, 0, 0, 0, 0, +- 251, 255, 255, 255, 255, 255, 255, 255, +- 205, 204, 204, 204, 204, 204, 244, 63, +- 1, 0, 0, 0, 0, 0, 0, 0, +- 20, 4, 4, 15, 104, 45, 43, 1 ++ 3, ++ 102, ++ 111, ++ 111, ++ 0, ++ 0, ++ 0, ++ 0, ++ 5, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 15, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 1, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 251, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 255, ++ 205, ++ 204, ++ 204, ++ 204, ++ 204, ++ 204, ++ 244, ++ 63, ++ 1, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 20, ++ 4, ++ 4, ++ 15, ++ 104, ++ 45, ++ 43, ++ 1 + ])); + expect(flx.length, 5); + expect(flx[0].stringValue, 'foo'); +@@ -216,7 +552,8 @@ + expect(flx['a'].numValue, 12); + }); + test('two value map', () { +- var flx = Reference.fromBuffer(b([0, 97, 0, 2, 4, 4, 2, 1, 2, 45, 12, 4, 4, 4, 36, 1])); ++ var flx = Reference.fromBuffer( ++ b([0, 97, 0, 2, 4, 4, 2, 1, 2, 45, 12, 4, 4, 4, 36, 1])); + expect(flx.length, 2); + expect(flx['a'].numValue, 12); + expect(flx[''].numValue, 45); +@@ -239,45 +576,239 @@ + expect(flx['address']['zip'].stringValue, '12345'); + expect(flx['address']['countryCode'].stringValue, 'XX'); + +- expect(() => flx['address']['country'].stringValue, +- throwsA(predicate((e) => e is ArgumentError && e.message == 'Key: [country] is not applicable on: //address of: ValueType.Map'))); +- expect(() => flx['address']['countryCode'][0], +- throwsA(predicate((e) => e is ArgumentError && e.message == 'Key: [0] is not applicable on: //address/countryCode of: ValueType.String'))); +- expect(() => flx[1], +- throwsA(predicate((e) => e is ArgumentError && e.message == 'Key: [1] is not applicable on: / of: ValueType.Map'))); +- expect(() => flx['flags'][4], +- throwsA(predicate((e) => e is ArgumentError && e.message == 'Key: [4] is not applicable on: //flags of: ValueType.VectorBool length: 4'))); +- expect(() => flx['flags'][-1], +- throwsA(predicate((e) => e is ArgumentError && e.message == 'Key: [-1] is not applicable on: //flags of: ValueType.VectorBool length: 4'))); ++ expect( ++ () => flx['address']['country'].stringValue, ++ throwsA(predicate((dynamic e) => ++ e is ArgumentError && ++ e.message == ++ 'Key: [country] is not applicable on: //address of: ValueType.Map'))); ++ expect( ++ () => flx['address']['countryCode'][0], ++ throwsA(predicate((dynamic e) => ++ e is ArgumentError && ++ e.message == ++ 'Key: [0] is not applicable on: //address/countryCode of: ValueType.String'))); ++ expect( ++ () => flx[1], ++ throwsA(predicate((dynamic e) => ++ e is ArgumentError && ++ e.message == ++ 'Key: [1] is not applicable on: / of: ValueType.Map'))); ++ expect( ++ () => flx['flags'][4], ++ throwsA(predicate((dynamic e) => ++ e is ArgumentError && ++ e.message == ++ 'Key: [4] is not applicable on: //flags of: ValueType.VectorBool length: 4'))); ++ expect( ++ () => flx['flags'][-1], ++ throwsA(predicate((dynamic e) => ++ e is ArgumentError && ++ e.message == ++ 'Key: [-1] is not applicable on: //flags of: ValueType.VectorBool length: 4'))); + }); + test('complex map to json', () { + var flx = complexMap(); +- expect(flx.json, '{"address":{"city":"Bla","countryCode":"XX","zip":"12345"},"age":35,"flags":[true,false,true,true],"name":"Maxim","weight":72.5}'); ++ expect(flx.json, ++ '{"address":{"city":"Bla","countryCode":"XX","zip":"12345"},"age":35,"flags":[true,false,true,true],"name":"Maxim","weight":72.5}'); + }); + + test('complex map iterators', () { + var flx = complexMap(); +- expect(flx.mapKeyIterable.map((e) => e).toList(), ['address', 'age', 'flags', 'name', 'weight']); +- expect(flx.mapValueIterable.map((e) => e.json).toList(), [flx['address'].json, flx['age'].json, flx['flags'].json, flx['name'].json, flx['weight'].json]); +- expect(flx['flags'].vectorIterable.map((e) => e.boolValue).toList(), [true, false, true, true]); ++ expect(flx.mapKeyIterable.map((e) => e).toList(), ++ ['address', 'age', 'flags', 'name', 'weight']); ++ expect(flx.mapValueIterable.map((e) => e.json).toList(), [ ++ flx['address'].json, ++ flx['age'].json, ++ flx['flags'].json, ++ flx['name'].json, ++ flx['weight'].json ++ ]); ++ expect(flx['flags'].vectorIterable.map((e) => e.boolValue).toList(), ++ [true, false, true, true]); + }); + +- test('bug where offest were stored as int instead of uint', (){ +- const data = [99, 104, 97, 110, 110, 101, 108, 115, 95, 105, 110, 0, +- 100, 105, 108, 97, 116, 105, 111, 110, 95, 104, 101, 105, 103, 104, 116, 95, 102, 97, 99, 116, 111, 114, 0, +- 100, 105, 108, 97, 116, 105, 111, 110, 95, 119, 105, 100, 116, 104, 95, 102, 97, 99, 116, 111, 114, 0, +- 102, 117, 115, 101, 100, 95, 97, 99, 116, 105, 118, 97, 116, 105, 111, 110, 95, 102, 117, 110, 99, 116, 105, 111, 110, 0, +- 112, 97, 100, 95, 118, 97, 108, 117, 101, 115, 0, 112, 97, 100, 100, 105, 110, 103, 0, +- 115, 116, 114, 105, 100, 101, 95, 104, 101, 105, 103, 104, 116, 0, +- 115, 116, 114, 105, 100, 101, 95, 119, 105, 100, 116, 104, 0, +- 8, 130, 119, 97, 76, 51, 41, 34, 21, 8, 1, 8, 64, 1, 1, 1, 1, 0, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 16, 36, 1]; ++ test('bug where offest were stored as int instead of uint', () { ++ const data = [ ++ 99, ++ 104, ++ 97, ++ 110, ++ 110, ++ 101, ++ 108, ++ 115, ++ 95, ++ 105, ++ 110, ++ 0, ++ 100, ++ 105, ++ 108, ++ 97, ++ 116, ++ 105, ++ 111, ++ 110, ++ 95, ++ 104, ++ 101, ++ 105, ++ 103, ++ 104, ++ 116, ++ 95, ++ 102, ++ 97, ++ 99, ++ 116, ++ 111, ++ 114, ++ 0, ++ 100, ++ 105, ++ 108, ++ 97, ++ 116, ++ 105, ++ 111, ++ 110, ++ 95, ++ 119, ++ 105, ++ 100, ++ 116, ++ 104, ++ 95, ++ 102, ++ 97, ++ 99, ++ 116, ++ 111, ++ 114, ++ 0, ++ 102, ++ 117, ++ 115, ++ 101, ++ 100, ++ 95, ++ 97, ++ 99, ++ 116, ++ 105, ++ 118, ++ 97, ++ 116, ++ 105, ++ 111, ++ 110, ++ 95, ++ 102, ++ 117, ++ 110, ++ 99, ++ 116, ++ 105, ++ 111, ++ 110, ++ 0, ++ 112, ++ 97, ++ 100, ++ 95, ++ 118, ++ 97, ++ 108, ++ 117, ++ 101, ++ 115, ++ 0, ++ 112, ++ 97, ++ 100, ++ 100, ++ 105, ++ 110, ++ 103, ++ 0, ++ 115, ++ 116, ++ 114, ++ 105, ++ 100, ++ 101, ++ 95, ++ 104, ++ 101, ++ 105, ++ 103, ++ 104, ++ 116, ++ 0, ++ 115, ++ 116, ++ 114, ++ 105, ++ 100, ++ 101, ++ 95, ++ 119, ++ 105, ++ 100, ++ 116, ++ 104, ++ 0, ++ 8, ++ 130, ++ 119, ++ 97, ++ 76, ++ 51, ++ 41, ++ 34, ++ 21, ++ 8, ++ 1, ++ 8, ++ 64, ++ 1, ++ 1, ++ 1, ++ 1, ++ 0, ++ 1, ++ 1, ++ 4, ++ 4, ++ 4, ++ 4, ++ 4, ++ 4, ++ 4, ++ 4, ++ 16, ++ 36, ++ 1 ++ ]; + var flx = Reference.fromBuffer(b(data)); +- expect(flx.json, '{"channels_in":64,"dilation_height_factor":1,"dilation_width_factor":1,"fused_activation_function":1,"pad_values":1,"padding":0,"stride_height":1,"stride_width":1}'); +- const object = {"channels_in":64,"dilation_height_factor":1,"dilation_width_factor":1,"fused_activation_function":1,"pad_values":1,"padding":0,"stride_height":1,"stride_width":1}; ++ expect(flx.json, ++ '{"channels_in":64,"dilation_height_factor":1,"dilation_width_factor":1,"fused_activation_function":1,"pad_values":1,"padding":0,"stride_height":1,"stride_width":1}'); ++ const object = { ++ "channels_in": 64, ++ "dilation_height_factor": 1, ++ "dilation_width_factor": 1, ++ "fused_activation_function": 1, ++ "pad_values": 1, ++ "padding": 0, ++ "stride_height": 1, ++ "stride_width": 1 ++ }; + var data1 = Builder.buildFromObject(object).asUint8List(); + expect(data1.length, data.length); + var flx1 = Reference.fromBuffer(b(data1)); +- expect(flx1.json, '{"channels_in":64,"dilation_height_factor":1,"dilation_width_factor":1,"fused_activation_function":1,"pad_values":1,"padding":0,"stride_height":1,"stride_width":1}'); ++ expect(flx1.json, ++ '{"channels_in":64,"dilation_height_factor":1,"dilation_width_factor":1,"fused_activation_function":1,"pad_values":1,"padding":0,"stride_height":1,"stride_width":1}'); + }); + } + +@@ -302,7 +833,7 @@ + } + } + +-Reference complexMap(){ ++Reference complexMap() { + // { + // "age": 35, + // "flags": [True, False, True, True], +@@ -315,20 +846,145 @@ + // } + // } + return Reference.fromBuffer(b([ +- 97, 100, 100, 114, 101, 115, 115, 0, +- 99, 105, 116, 121, 0, 3, 66, 108, 97, 0, +- 99, 111, 117, 110, 116, 114, 121, 67, 111, 100, 101, 0, +- 2, 88, 88, 0, +- 122, 105, 112, 0, +- 5, 49, 50, 51, 52, 53, 0, +- 3, 38, 29, 14, 3, 1, 3, 38, 22, 15, 20, 20, 20, +- 97, 103, 101, 0, +- 102, 108, 97, 103, 115, 0, +- 4, 1, 0, 1, 1, +- 110, 97, 109, 101, 0, +- 5, 77, 97, 120, 105, 109, 0, +- 119, 101, 105, 103, 104, 116, 0, +- 5, 93, 36, 33, 23, 12, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 60, 0, 0, 0, 35, 0, 0, 0, 51, 0, 0, 0, 45, +- 0, 0, 0, 0, 0, 145, 66, 36, 4, 144, 20, 14, 25, 38, 1 ++ 97, ++ 100, ++ 100, ++ 114, ++ 101, ++ 115, ++ 115, ++ 0, ++ 99, ++ 105, ++ 116, ++ 121, ++ 0, ++ 3, ++ 66, ++ 108, ++ 97, ++ 0, ++ 99, ++ 111, ++ 117, ++ 110, ++ 116, ++ 114, ++ 121, ++ 67, ++ 111, ++ 100, ++ 101, ++ 0, ++ 2, ++ 88, ++ 88, ++ 0, ++ 122, ++ 105, ++ 112, ++ 0, ++ 5, ++ 49, ++ 50, ++ 51, ++ 52, ++ 53, ++ 0, ++ 3, ++ 38, ++ 29, ++ 14, ++ 3, ++ 1, ++ 3, ++ 38, ++ 22, ++ 15, ++ 20, ++ 20, ++ 20, ++ 97, ++ 103, ++ 101, ++ 0, ++ 102, ++ 108, ++ 97, ++ 103, ++ 115, ++ 0, ++ 4, ++ 1, ++ 0, ++ 1, ++ 1, ++ 110, ++ 97, ++ 109, ++ 101, ++ 0, ++ 5, ++ 77, ++ 97, ++ 120, ++ 105, ++ 109, ++ 0, ++ 119, ++ 101, ++ 105, ++ 103, ++ 104, ++ 116, ++ 0, ++ 5, ++ 93, ++ 36, ++ 33, ++ 23, ++ 12, ++ 0, ++ 0, ++ 7, ++ 0, ++ 0, ++ 0, ++ 1, ++ 0, ++ 0, ++ 0, ++ 5, ++ 0, ++ 0, ++ 0, ++ 60, ++ 0, ++ 0, ++ 0, ++ 35, ++ 0, ++ 0, ++ 0, ++ 51, ++ 0, ++ 0, ++ 0, ++ 45, ++ 0, ++ 0, ++ 0, ++ 0, ++ 0, ++ 145, ++ 66, ++ 36, ++ 4, ++ 144, ++ 20, ++ 14, ++ 25, ++ 38, ++ 1 + ])); + } +diff -urN a/dart/test/flex_types_test.dart b/dart/test/flex_types_test.dart +--- a/dart/test/flex_types_test.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/test/flex_types_test.dart 2023-01-13 07:47:12.523285709 +0000 +@@ -48,69 +48,116 @@ + expect(ValueTypeUtils.isFixedTypedVector(ValueType.VectorInt), isFalse); + }); + test('to typed vector', () { +- expect(ValueTypeUtils.toTypedVector(ValueType.Int,0), equals(ValueType.VectorInt)); +- expect(ValueTypeUtils.toTypedVector(ValueType.UInt,0), equals(ValueType.VectorUInt)); +- expect(ValueTypeUtils.toTypedVector(ValueType.Bool,0), equals(ValueType.VectorBool)); +- expect(ValueTypeUtils.toTypedVector(ValueType.Float,0), equals(ValueType.VectorFloat)); +- expect(ValueTypeUtils.toTypedVector(ValueType.Key,0), equals(ValueType.VectorKey)); +- expect(ValueTypeUtils.toTypedVector(ValueType.String,0), equals(ValueType.VectorString)); +- +- expect(ValueTypeUtils.toTypedVector(ValueType.Int,2), equals(ValueType.VectorInt2)); +- expect(ValueTypeUtils.toTypedVector(ValueType.UInt,2), equals(ValueType.VectorUInt2)); +- expect(ValueTypeUtils.toTypedVector(ValueType.Float,2), equals(ValueType.VectorFloat2)); +- +- expect(ValueTypeUtils.toTypedVector(ValueType.Int,3), equals(ValueType.VectorInt3)); +- expect(ValueTypeUtils.toTypedVector(ValueType.UInt,3), equals(ValueType.VectorUInt3)); +- expect(ValueTypeUtils.toTypedVector(ValueType.Float,3), equals(ValueType.VectorFloat3)); +- +- expect(ValueTypeUtils.toTypedVector(ValueType.Int,4), equals(ValueType.VectorInt4)); +- expect(ValueTypeUtils.toTypedVector(ValueType.UInt,4), equals(ValueType.VectorUInt4)); +- expect(ValueTypeUtils.toTypedVector(ValueType.Float,4), equals(ValueType.VectorFloat4)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.Int, 0), ++ equals(ValueType.VectorInt)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.UInt, 0), ++ equals(ValueType.VectorUInt)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.Bool, 0), ++ equals(ValueType.VectorBool)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.Float, 0), ++ equals(ValueType.VectorFloat)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.Key, 0), ++ equals(ValueType.VectorKey)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.String, 0), ++ equals(ValueType.VectorString)); ++ ++ expect(ValueTypeUtils.toTypedVector(ValueType.Int, 2), ++ equals(ValueType.VectorInt2)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.UInt, 2), ++ equals(ValueType.VectorUInt2)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.Float, 2), ++ equals(ValueType.VectorFloat2)); ++ ++ expect(ValueTypeUtils.toTypedVector(ValueType.Int, 3), ++ equals(ValueType.VectorInt3)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.UInt, 3), ++ equals(ValueType.VectorUInt3)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.Float, 3), ++ equals(ValueType.VectorFloat3)); ++ ++ expect(ValueTypeUtils.toTypedVector(ValueType.Int, 4), ++ equals(ValueType.VectorInt4)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.UInt, 4), ++ equals(ValueType.VectorUInt4)); ++ expect(ValueTypeUtils.toTypedVector(ValueType.Float, 4), ++ equals(ValueType.VectorFloat4)); + }); + test('typed vector element type', () { +- expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorInt), equals(ValueType.Int)); +- expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorUInt), equals(ValueType.UInt)); +- expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorFloat), equals(ValueType.Float)); +- expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorString), equals(ValueType.String)); +- expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorKey), equals(ValueType.Key)); +- expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorBool), equals(ValueType.Bool)); ++ expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorInt), ++ equals(ValueType.Int)); ++ expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorUInt), ++ equals(ValueType.UInt)); ++ expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorFloat), ++ equals(ValueType.Float)); ++ expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorString), ++ equals(ValueType.String)); ++ expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorKey), ++ equals(ValueType.Key)); ++ expect(ValueTypeUtils.typedVectorElementType(ValueType.VectorBool), ++ equals(ValueType.Bool)); + }); + test('fixed typed vector element type', () { +- expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorInt2), equals(ValueType.Int)); +- expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorInt3), equals(ValueType.Int)); +- expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorInt4), equals(ValueType.Int)); +- +- expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorUInt2), equals(ValueType.UInt)); +- expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorUInt3), equals(ValueType.UInt)); +- expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorUInt4), equals(ValueType.UInt)); +- +- expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorFloat2), equals(ValueType.Float)); +- expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorFloat3), equals(ValueType.Float)); +- expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorFloat4), equals(ValueType.Float)); ++ expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorInt2), ++ equals(ValueType.Int)); ++ expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorInt3), ++ equals(ValueType.Int)); ++ expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorInt4), ++ equals(ValueType.Int)); ++ ++ expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorUInt2), ++ equals(ValueType.UInt)); ++ expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorUInt3), ++ equals(ValueType.UInt)); ++ expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorUInt4), ++ equals(ValueType.UInt)); ++ ++ expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorFloat2), ++ equals(ValueType.Float)); ++ expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorFloat3), ++ equals(ValueType.Float)); ++ expect(ValueTypeUtils.fixedTypedVectorElementType(ValueType.VectorFloat4), ++ equals(ValueType.Float)); + }); + test('fixed typed vector element size', () { +- expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorInt2), equals(2)); +- expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorInt3), equals(3)); +- expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorInt4), equals(4)); +- +- expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorUInt2), equals(2)); +- expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorUInt3), equals(3)); +- expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorUInt4), equals(4)); +- +- expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorFloat2), equals(2)); +- expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorFloat3), equals(3)); +- expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorFloat4), equals(4)); ++ expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorInt2), ++ equals(2)); ++ expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorInt3), ++ equals(3)); ++ expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorInt4), ++ equals(4)); ++ ++ expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorUInt2), ++ equals(2)); ++ expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorUInt3), ++ equals(3)); ++ expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorUInt4), ++ equals(4)); ++ ++ expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorFloat2), ++ equals(2)); ++ expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorFloat3), ++ equals(3)); ++ expect(ValueTypeUtils.fixedTypedVectorElementSize(ValueType.VectorFloat4), ++ equals(4)); + }); + test('packed type', () { +- expect(ValueTypeUtils.packedType(ValueType.Null, BitWidth.width8), equals(0)); +- expect(ValueTypeUtils.packedType(ValueType.Null, BitWidth.width16), equals(1)); +- expect(ValueTypeUtils.packedType(ValueType.Null, BitWidth.width32), equals(2)); +- expect(ValueTypeUtils.packedType(ValueType.Null, BitWidth.width64), equals(3)); +- +- expect(ValueTypeUtils.packedType(ValueType.Int, BitWidth.width8), equals(4)); +- expect(ValueTypeUtils.packedType(ValueType.Int, BitWidth.width16), equals(5)); +- expect(ValueTypeUtils.packedType(ValueType.Int, BitWidth.width32), equals(6)); +- expect(ValueTypeUtils.packedType(ValueType.Int, BitWidth.width64), equals(7)); ++ expect( ++ ValueTypeUtils.packedType(ValueType.Null, BitWidth.width8), equals(0)); ++ expect( ++ ValueTypeUtils.packedType(ValueType.Null, BitWidth.width16), equals(1)); ++ expect( ++ ValueTypeUtils.packedType(ValueType.Null, BitWidth.width32), equals(2)); ++ expect( ++ ValueTypeUtils.packedType(ValueType.Null, BitWidth.width64), equals(3)); ++ ++ expect( ++ ValueTypeUtils.packedType(ValueType.Int, BitWidth.width8), equals(4)); ++ expect( ++ ValueTypeUtils.packedType(ValueType.Int, BitWidth.width16), equals(5)); ++ expect( ++ ValueTypeUtils.packedType(ValueType.Int, BitWidth.width32), equals(6)); ++ expect( ++ ValueTypeUtils.packedType(ValueType.Int, BitWidth.width64), equals(7)); + }); + test('bit width', () { + expect(BitWidthUtil.width(0), BitWidth.width8); +diff -urN a/dart/test/monster_test.fbs b/dart/test/monster_test.fbs +--- a/dart/test/monster_test.fbs 1970-01-01 00:00:00.000000000 +0000 ++++ b/dart/test/monster_test.fbs 2023-01-13 07:47:12.524285719 +0000 +@@ -0,0 +1,154 @@ ++// test schema file ++ ++include "include_test1.fbs"; ++ ++namespace MyGame; ++ ++table InParentNamespace {} ++ ++namespace MyGame.Example2; ++ ++table Monster {} // Test having same name as below, but in different namespace. ++ ++namespace MyGame.Example; ++ ++attribute "priority"; ++ ++/// Composite components of Monster color. ++enum Color:ubyte (bit_flags) { ++ Red = 0, // color Red = (1u << 0) ++ /// \brief color Green ++ /// Green is bit_flag with value (1u << 1) ++ Green, ++ /// \brief color Blue (1u << 3) ++ Blue = 3, ++} ++ ++enum Race:byte { ++ None = -1, ++ Human = 0, ++ Dwarf, ++ Elf, ++} ++ ++union Any { Monster, TestSimpleTableWithEnum, MyGame.Example2.Monster } ++ ++union AnyUniqueAliases { M: Monster, TS: TestSimpleTableWithEnum, M2: MyGame.Example2.Monster } ++union AnyAmbiguousAliases { M1: Monster, M2: Monster, M3: Monster } ++ ++struct Test { a:short; b:byte; } ++ ++table TestSimpleTableWithEnum (csharp_partial, private) { ++ color: Color = Green; ++} ++ ++struct Vec3 (force_align: 8) { ++ x:float; ++ y:float; ++ z:float; ++ test1:double; ++ test2:Color; ++ test3:Test; ++} ++ ++struct Ability { ++ id:uint(key); ++ distance:uint; ++} ++ ++struct StructOfStructs { ++ a: Ability; ++ b: Test; ++ c: Ability; ++} ++ ++table Stat { ++ id:string; ++ val:long; ++ count:ushort (key); ++} ++ ++table Referrable { ++ id:ulong(key, hash:"fnv1a_64"); ++} ++ ++/// an example documentation comment: "monster object" ++table Monster { ++ pos:Vec3 (id: 0); ++ hp:short = 100 (id: 2); ++ mana:short = 150 (id: 1); ++ name:string (id: 3, key); ++ color:Color = Blue (id: 6); ++ inventory:[ubyte] (id: 5); ++ friendly:bool = false (deprecated, priority: 1, id: 4); ++ /// an example documentation comment: this will end up in the generated code ++ /// multiline too ++ testarrayoftables:[Monster] (id: 11); ++ testarrayofstring:[string] (id: 10); ++ testarrayofstring2:[string] (id: 28); ++ testarrayofbools:[bool] (id: 24); ++ testarrayofsortedstruct:[Ability] (id: 29); ++ enemy:MyGame.Example.Monster (id:12); // Test referring by full namespace. ++ test:Any (id: 8); ++ test4:[Test] (id: 9); ++ test5:[Test] (id: 31); ++ testnestedflatbuffer:[ubyte] (id:13, nested_flatbuffer: "Monster"); ++ testempty:Stat (id:14); ++ testbool:bool (id:15); ++ testhashs32_fnv1:int (id:16, hash:"fnv1_32"); ++ testhashu32_fnv1:uint (id:17, hash:"fnv1_32"); ++ testhashs64_fnv1:long (id:18, hash:"fnv1_64"); ++ testhashu64_fnv1:ulong (id:19, hash:"fnv1_64"); ++ testhashs32_fnv1a:int (id:20, hash:"fnv1a_32"); ++ testhashu32_fnv1a:uint (id:21, hash:"fnv1a_32", cpp_type:"Stat"); ++ testhashs64_fnv1a:long (id:22, hash:"fnv1a_64"); ++ testhashu64_fnv1a:ulong (id:23, hash:"fnv1a_64"); ++ testf:float = 3.14159 (id:25); ++ testf2:float = 3 (id:26); ++ testf3:float (id:27); ++ flex:[ubyte] (id:30, flexbuffer); ++ vector_of_longs:[long] (id:32); ++ vector_of_doubles:[double] (id:33); ++ parent_namespace_test:InParentNamespace (id:34); ++ vector_of_referrables:[Referrable](id:35); ++ single_weak_reference:ulong(id:36, hash:"fnv1a_64", cpp_type:"ReferrableT"); ++ vector_of_weak_references:[ulong](id:37, hash:"fnv1a_64", cpp_type:"ReferrableT"); ++ vector_of_strong_referrables:[Referrable](id:38, cpp_ptr_type:"default_ptr_type"); //was shared_ptr ++ co_owning_reference:ulong(id:39, hash:"fnv1a_64", cpp_type:"ReferrableT", cpp_ptr_type:"naked"); //was shared_ptr as well ++ vector_of_co_owning_references:[ulong](id:40, hash:"fnv1a_64", cpp_type:"ReferrableT", cpp_ptr_type:"default_ptr_type", cpp_ptr_type_get:".get()"); //was shared_ptr ++ non_owning_reference:ulong(id:41, hash:"fnv1a_64", cpp_type:"ReferrableT", cpp_ptr_type:"naked", cpp_ptr_type_get:""); //was weak_ptr ++ vector_of_non_owning_references:[ulong](id:42, hash:"fnv1a_64", cpp_type:"ReferrableT", cpp_ptr_type:"naked", cpp_ptr_type_get:""); //was weak_ptr ++ any_unique:AnyUniqueAliases(id:44); ++ any_ambiguous:AnyAmbiguousAliases (id:46); ++ vector_of_enums:[Color] (id:47); ++ signed_enum:Race = None (id:48); ++ testrequirednestedflatbuffer:[ubyte] (id:49, nested_flatbuffer: "Monster"); ++ scalar_key_sorted_tables:[Stat] (id: 50); ++} ++ ++table TypeAliases { ++ i8:int8; ++ u8:uint8; ++ i16:int16; ++ u16:uint16; ++ i32:int32; ++ u32:uint32; ++ i64:int64; ++ u64:uint64; ++ f32:float32; ++ f64:float64; ++ v8:[int8]; ++ vf64:[float64]; ++} ++ ++rpc_service MonsterStorage { ++ Store(Monster):Stat (streaming: "none"); ++ Retrieve(Stat):Monster (streaming: "server", idempotent); ++ GetMaxHitPoint(Monster):Stat (streaming: "client"); ++ GetMinMaxHitPoints(Monster):Stat (streaming: "bidi"); ++} ++ ++root_type Monster; ++ ++file_identifier "MONS"; ++file_extension "mon"; +diff -urN a/dart/test/monster_test_my_game.example2_generated.dart b/dart/test/monster_test_my_game.example2_generated.dart +--- a/dart/test/monster_test_my_game.example2_generated.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/test/monster_test_my_game.example2_generated.dart 2023-01-13 07:47:12.553285987 +0000 +@@ -1,5 +1,5 @@ + // automatically generated by the FlatBuffers compiler, do not modify +-// ignore_for_file: unused_import, unused_field, unused_local_variable ++// ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable + + library my_game.example2; + +@@ -12,11 +12,11 @@ + class Monster { + Monster._(this._bc, this._bcOffset); + factory Monster(List bytes) { +- fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); ++ final rootRef = fb.BufferContext.fromBytes(bytes); + return reader.read(rootRef, 0); + } + +- static const fb.Reader reader = const _MonsterReader(); ++ static const fb.Reader reader = _MonsterReader(); + + final fb.BufferContext _bc; + final int _bcOffset; +@@ -26,6 +26,26 @@ + String toString() { + return 'Monster{}'; + } ++ ++ MonsterT unpack() => MonsterT(); ++ ++ static int pack(fb.Builder fbBuilder, MonsterT? object) { ++ if (object == null) return 0; ++ return object.pack(fbBuilder); ++ } ++} ++ ++class MonsterT implements fb.Packable { ++ @override ++ int pack(fb.Builder fbBuilder) { ++ fbBuilder.startTable(0); ++ return fbBuilder.endTable(); ++ } ++ ++ @override ++ String toString() { ++ return 'MonsterT{}'; ++ } + } + + class _MonsterReader extends fb.TableReader { +@@ -33,7 +53,7 @@ + + @override + Monster createObject(fb.BufferContext bc, int offset) => +- new Monster._(bc, offset); ++ Monster._(bc, offset); + } + + class MonsterObjectBuilder extends fb.ObjectBuilder { +@@ -42,19 +62,16 @@ + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- +- fbBuilder.startTable(); ++ int finish(fb.Builder fbBuilder) { ++ fbBuilder.startTable(0); + return fbBuilder.endTable(); + } + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } +diff -urN a/dart/test/monster_test_my_game.example_generated.dart b/dart/test/monster_test_my_game.example_generated.dart +--- a/dart/test/monster_test_my_game.example_generated.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/test/monster_test_my_game.example_generated.dart 2023-01-13 07:47:12.571286153 +0000 +@@ -1,5 +1,5 @@ + // automatically generated by the FlatBuffers compiler, do not modify +-// ignore_for_file: unused_import, unused_field, unused_local_variable ++// ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable + + library my_game.example; + +@@ -15,26 +15,32 @@ + const Color._(this.value); + + factory Color.fromValue(int value) { +- if (value == null) value = 0; +- if (!values.containsKey(value)) { +- throw new StateError('Invalid value $value for bit flag enum Color'); ++ final result = values[value]; ++ if (result == null) { ++ throw StateError('Invalid value $value for bit flag enum Color'); + } +- return values[value]; ++ return result; + } + ++ static Color? _createOrNull(int? value) => ++ value == null ? null : Color.fromValue(value); ++ + static bool containsValue(int value) => values.containsKey(value); + +- static const Color Red = const Color._(1); ++ static const Color Red = Color._(1); + + /// \brief color Green + /// Green is bit_flag with value (1u << 1) +- static const Color Green = const Color._(2); ++ static const Color Green = Color._(2); + + /// \brief color Blue (1u << 3) +- static const Color Blue = const Color._(8); +- static const Map values = {1: Red,2: Green,8: Blue,}; ++ static const Color Blue = Color._(8); ++ static const Map values = { ++ 1: Red, ++ 2: Green, ++ 8: Blue}; + +- static const fb.Reader reader = const _ColorReader(); ++ static const fb.Reader reader = _ColorReader(); + + @override + String toString() { +@@ -50,7 +56,7 @@ + + @override + Color read(fb.BufferContext bc, int offset) => +- new Color.fromValue(const fb.Uint8Reader().read(bc, offset)); ++ Color.fromValue(const fb.Uint8Reader().read(bc, offset)); + } + + class Race { +@@ -58,24 +64,31 @@ + const Race._(this.value); + + factory Race.fromValue(int value) { +- if (value == null) value = 0; +- if (!values.containsKey(value)) { +- throw new StateError('Invalid value $value for bit flag enum Race'); ++ final result = values[value]; ++ if (result == null) { ++ throw StateError('Invalid value $value for bit flag enum Race'); + } +- return values[value]; ++ return result; + } + ++ static Race? _createOrNull(int? value) => ++ value == null ? null : Race.fromValue(value); ++ + static const int minValue = -1; + static const int maxValue = 2; + static bool containsValue(int value) => values.containsKey(value); + +- static const Race None = const Race._(-1); +- static const Race Human = const Race._(0); +- static const Race Dwarf = const Race._(1); +- static const Race Elf = const Race._(2); +- static const Map values = {-1: None,0: Human,1: Dwarf,2: Elf,}; ++ static const Race None = Race._(-1); ++ static const Race Human = Race._(0); ++ static const Race Dwarf = Race._(1); ++ static const Race Elf = Race._(2); ++ static const Map values = { ++ -1: None, ++ 0: Human, ++ 1: Dwarf, ++ 2: Elf}; + +- static const fb.Reader reader = const _RaceReader(); ++ static const fb.Reader reader = _RaceReader(); + + @override + String toString() { +@@ -91,7 +104,7 @@ + + @override + Race read(fb.BufferContext bc, int offset) => +- new Race.fromValue(const fb.Int8Reader().read(bc, offset)); ++ Race.fromValue(const fb.Int8Reader().read(bc, offset)); + } + + class AnyTypeId { +@@ -99,24 +112,31 @@ + const AnyTypeId._(this.value); + + factory AnyTypeId.fromValue(int value) { +- if (value == null) value = 0; +- if (!values.containsKey(value)) { +- throw new StateError('Invalid value $value for bit flag enum AnyTypeId'); ++ final result = values[value]; ++ if (result == null) { ++ throw StateError('Invalid value $value for bit flag enum AnyTypeId'); + } +- return values[value]; ++ return result; + } + ++ static AnyTypeId? _createOrNull(int? value) => ++ value == null ? null : AnyTypeId.fromValue(value); ++ + static const int minValue = 0; + static const int maxValue = 3; + static bool containsValue(int value) => values.containsKey(value); + +- static const AnyTypeId NONE = const AnyTypeId._(0); +- static const AnyTypeId Monster = const AnyTypeId._(1); +- static const AnyTypeId TestSimpleTableWithEnum = const AnyTypeId._(2); +- static const AnyTypeId MyGame_Example2_Monster = const AnyTypeId._(3); +- static const Map values = {0: NONE,1: Monster,2: TestSimpleTableWithEnum,3: MyGame_Example2_Monster,}; ++ static const AnyTypeId NONE = AnyTypeId._(0); ++ static const AnyTypeId Monster = AnyTypeId._(1); ++ static const AnyTypeId TestSimpleTableWithEnum = AnyTypeId._(2); ++ static const AnyTypeId MyGame_Example2_Monster = AnyTypeId._(3); ++ static const Map values = { ++ 0: NONE, ++ 1: Monster, ++ 2: TestSimpleTableWithEnum, ++ 3: MyGame_Example2_Monster}; + +- static const fb.Reader reader = const _AnyTypeIdReader(); ++ static const fb.Reader reader = _AnyTypeIdReader(); + + @override + String toString() { +@@ -132,7 +152,7 @@ + + @override + AnyTypeId read(fb.BufferContext bc, int offset) => +- new AnyTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); ++ AnyTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); + } + + class AnyUniqueAliasesTypeId { +@@ -140,24 +160,31 @@ + const AnyUniqueAliasesTypeId._(this.value); + + factory AnyUniqueAliasesTypeId.fromValue(int value) { +- if (value == null) value = 0; +- if (!values.containsKey(value)) { +- throw new StateError('Invalid value $value for bit flag enum AnyUniqueAliasesTypeId'); ++ final result = values[value]; ++ if (result == null) { ++ throw StateError('Invalid value $value for bit flag enum AnyUniqueAliasesTypeId'); + } +- return values[value]; ++ return result; + } + ++ static AnyUniqueAliasesTypeId? _createOrNull(int? value) => ++ value == null ? null : AnyUniqueAliasesTypeId.fromValue(value); ++ + static const int minValue = 0; + static const int maxValue = 3; + static bool containsValue(int value) => values.containsKey(value); + +- static const AnyUniqueAliasesTypeId NONE = const AnyUniqueAliasesTypeId._(0); +- static const AnyUniqueAliasesTypeId M = const AnyUniqueAliasesTypeId._(1); +- static const AnyUniqueAliasesTypeId TS = const AnyUniqueAliasesTypeId._(2); +- static const AnyUniqueAliasesTypeId M2 = const AnyUniqueAliasesTypeId._(3); +- static const Map values = {0: NONE,1: M,2: TS,3: M2,}; ++ static const AnyUniqueAliasesTypeId NONE = AnyUniqueAliasesTypeId._(0); ++ static const AnyUniqueAliasesTypeId M = AnyUniqueAliasesTypeId._(1); ++ static const AnyUniqueAliasesTypeId TS = AnyUniqueAliasesTypeId._(2); ++ static const AnyUniqueAliasesTypeId M2 = AnyUniqueAliasesTypeId._(3); ++ static const Map values = { ++ 0: NONE, ++ 1: M, ++ 2: TS, ++ 3: M2}; + +- static const fb.Reader reader = const _AnyUniqueAliasesTypeIdReader(); ++ static const fb.Reader reader = _AnyUniqueAliasesTypeIdReader(); + + @override + String toString() { +@@ -173,7 +200,7 @@ + + @override + AnyUniqueAliasesTypeId read(fb.BufferContext bc, int offset) => +- new AnyUniqueAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); ++ AnyUniqueAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); + } + + class AnyAmbiguousAliasesTypeId { +@@ -181,24 +208,31 @@ + const AnyAmbiguousAliasesTypeId._(this.value); + + factory AnyAmbiguousAliasesTypeId.fromValue(int value) { +- if (value == null) value = 0; +- if (!values.containsKey(value)) { +- throw new StateError('Invalid value $value for bit flag enum AnyAmbiguousAliasesTypeId'); ++ final result = values[value]; ++ if (result == null) { ++ throw StateError('Invalid value $value for bit flag enum AnyAmbiguousAliasesTypeId'); + } +- return values[value]; ++ return result; + } + ++ static AnyAmbiguousAliasesTypeId? _createOrNull(int? value) => ++ value == null ? null : AnyAmbiguousAliasesTypeId.fromValue(value); ++ + static const int minValue = 0; + static const int maxValue = 3; + static bool containsValue(int value) => values.containsKey(value); + +- static const AnyAmbiguousAliasesTypeId NONE = const AnyAmbiguousAliasesTypeId._(0); +- static const AnyAmbiguousAliasesTypeId M1 = const AnyAmbiguousAliasesTypeId._(1); +- static const AnyAmbiguousAliasesTypeId M2 = const AnyAmbiguousAliasesTypeId._(2); +- static const AnyAmbiguousAliasesTypeId M3 = const AnyAmbiguousAliasesTypeId._(3); +- static const Map values = {0: NONE,1: M1,2: M2,3: M3,}; ++ static const AnyAmbiguousAliasesTypeId NONE = AnyAmbiguousAliasesTypeId._(0); ++ static const AnyAmbiguousAliasesTypeId M1 = AnyAmbiguousAliasesTypeId._(1); ++ static const AnyAmbiguousAliasesTypeId M2 = AnyAmbiguousAliasesTypeId._(2); ++ static const AnyAmbiguousAliasesTypeId M3 = AnyAmbiguousAliasesTypeId._(3); ++ static const Map values = { ++ 0: NONE, ++ 1: M1, ++ 2: M2, ++ 3: M3}; + +- static const fb.Reader reader = const _AnyAmbiguousAliasesTypeIdReader(); ++ static const fb.Reader reader = _AnyAmbiguousAliasesTypeIdReader(); + + @override + String toString() { +@@ -214,13 +248,13 @@ + + @override + AnyAmbiguousAliasesTypeId read(fb.BufferContext bc, int offset) => +- new AnyAmbiguousAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); ++ AnyAmbiguousAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset)); + } + + class Test { + Test._(this._bc, this._bcOffset); + +- static const fb.Reader reader = const _TestReader(); ++ static const fb.Reader reader = _TestReader(); + + final fb.BufferContext _bc; + final int _bcOffset; +@@ -232,6 +266,37 @@ + String toString() { + return 'Test{a: $a, b: $b}'; + } ++ ++ TestT unpack() => TestT( ++ a: a, ++ b: b); ++ ++ static int pack(fb.Builder fbBuilder, TestT? object) { ++ if (object == null) return 0; ++ return object.pack(fbBuilder); ++ } ++} ++ ++class TestT implements fb.Packable { ++ int a; ++ int b; ++ ++ TestT({ ++ required this.a, ++ required this.b}); ++ ++ @override ++ int pack(fb.Builder fbBuilder) { ++ fbBuilder.pad(1); ++ fbBuilder.putInt8(b); ++ fbBuilder.putInt16(a); ++ return fbBuilder.offset; ++ } ++ ++ @override ++ String toString() { ++ return 'TestT{a: $a, b: $b}'; ++ } + } + + class _TestReader extends fb.StructReader { +@@ -242,13 +307,11 @@ + + @override + Test createObject(fb.BufferContext bc, int offset) => +- new Test._(bc, offset); ++ Test._(bc, offset); + } + + class TestBuilder { +- TestBuilder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ TestBuilder(this.fbBuilder); + + final fb.Builder fbBuilder; + +@@ -266,18 +329,15 @@ + final int _b; + + TestObjectBuilder({ +- int a, +- int b, ++ required int a, ++ required int b, + }) + : _a = a, + _b = b; + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- ++ int finish(fb.Builder fbBuilder) { + fbBuilder.pad(1); + fbBuilder.putInt8(_b); + fbBuilder.putInt16(_a); +@@ -286,30 +346,57 @@ + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } + class TestSimpleTableWithEnum { + TestSimpleTableWithEnum._(this._bc, this._bcOffset); + factory TestSimpleTableWithEnum(List bytes) { +- fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); ++ final rootRef = fb.BufferContext.fromBytes(bytes); + return reader.read(rootRef, 0); + } + +- static const fb.Reader reader = const _TestSimpleTableWithEnumReader(); ++ static const fb.Reader reader = _TestSimpleTableWithEnumReader(); + + final fb.BufferContext _bc; + final int _bcOffset; + +- Color get color => new Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 4, 2)); ++ Color get color => Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 4, 2)); + + @override + String toString() { + return 'TestSimpleTableWithEnum{color: $color}'; + } ++ ++ TestSimpleTableWithEnumT unpack() => TestSimpleTableWithEnumT( ++ color: color); ++ ++ static int pack(fb.Builder fbBuilder, TestSimpleTableWithEnumT? object) { ++ if (object == null) return 0; ++ return object.pack(fbBuilder); ++ } ++} ++ ++class TestSimpleTableWithEnumT implements fb.Packable { ++ Color color; ++ ++ TestSimpleTableWithEnumT({ ++ this.color = Color.Green}); ++ ++ @override ++ int pack(fb.Builder fbBuilder) { ++ fbBuilder.startTable(1); ++ fbBuilder.addUint8(0, color.value); ++ return fbBuilder.endTable(); ++ } ++ ++ @override ++ String toString() { ++ return 'TestSimpleTableWithEnumT{color: $color}'; ++ } + } + + class _TestSimpleTableWithEnumReader extends fb.TableReader { +@@ -317,21 +404,19 @@ + + @override + TestSimpleTableWithEnum createObject(fb.BufferContext bc, int offset) => +- new TestSimpleTableWithEnum._(bc, offset); ++ TestSimpleTableWithEnum._(bc, offset); + } + + class TestSimpleTableWithEnumBuilder { +- TestSimpleTableWithEnumBuilder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ TestSimpleTableWithEnumBuilder(this.fbBuilder); + + final fb.Builder fbBuilder; + + void begin() { +- fbBuilder.startTable(); ++ fbBuilder.startTable(1); + } + +- int addColor(Color color) { ++ int addColor(Color? color) { + fbBuilder.addUint8(0, color?.value); + return fbBuilder.offset; + } +@@ -342,36 +427,33 @@ + } + + class TestSimpleTableWithEnumObjectBuilder extends fb.ObjectBuilder { +- final Color _color; ++ final Color? _color; + + TestSimpleTableWithEnumObjectBuilder({ +- Color color, ++ Color? color, + }) + : _color = color; + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- +- fbBuilder.startTable(); ++ int finish(fb.Builder fbBuilder) { ++ fbBuilder.startTable(1); + fbBuilder.addUint8(0, _color?.value); + return fbBuilder.endTable(); + } + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } + class Vec3 { + Vec3._(this._bc, this._bcOffset); + +- static const fb.Reader reader = const _Vec3Reader(); ++ static const fb.Reader reader = _Vec3Reader(); + + final fb.BufferContext _bc; + final int _bcOffset; +@@ -380,13 +462,62 @@ + double get y => const fb.Float32Reader().read(_bc, _bcOffset + 4); + double get z => const fb.Float32Reader().read(_bc, _bcOffset + 8); + double get test1 => const fb.Float64Reader().read(_bc, _bcOffset + 16); +- Color get test2 => new Color.fromValue(const fb.Uint8Reader().read(_bc, _bcOffset + 24)); ++ Color get test2 => Color.fromValue(const fb.Uint8Reader().read(_bc, _bcOffset + 24)); + Test get test3 => Test.reader.read(_bc, _bcOffset + 26); + + @override + String toString() { + return 'Vec3{x: $x, y: $y, z: $z, test1: $test1, test2: $test2, test3: $test3}'; + } ++ ++ Vec3T unpack() => Vec3T( ++ x: x, ++ y: y, ++ z: z, ++ test1: test1, ++ test2: test2, ++ test3: test3.unpack()); ++ ++ static int pack(fb.Builder fbBuilder, Vec3T? object) { ++ if (object == null) return 0; ++ return object.pack(fbBuilder); ++ } ++} ++ ++class Vec3T implements fb.Packable { ++ double x; ++ double y; ++ double z; ++ double test1; ++ Color test2; ++ TestT test3; ++ ++ Vec3T({ ++ required this.x, ++ required this.y, ++ required this.z, ++ required this.test1, ++ required this.test2, ++ required this.test3}); ++ ++ @override ++ int pack(fb.Builder fbBuilder) { ++ fbBuilder.pad(2); ++ test3.pack(fbBuilder); ++ fbBuilder.pad(1); ++ fbBuilder.putUint8(test2.value); ++ fbBuilder.putFloat64(test1); ++ fbBuilder.pad(4); ++ fbBuilder.putFloat32(z); ++ fbBuilder.putFloat32(y); ++ fbBuilder.putFloat32(x); ++ return fbBuilder.offset; ++ } ++ ++ @override ++ String toString() { ++ return 'Vec3T{x: $x, y: $y, z: $z, test1: $test1, test2: $test2, test3: $test3}'; ++ } + } + + class _Vec3Reader extends fb.StructReader { +@@ -397,13 +528,11 @@ + + @override + Vec3 createObject(fb.BufferContext bc, int offset) => +- new Vec3._(bc, offset); ++ Vec3._(bc, offset); + } + + class Vec3Builder { +- Vec3Builder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ Vec3Builder(this.fbBuilder); + + final fb.Builder fbBuilder; + +@@ -411,7 +540,7 @@ + fbBuilder.pad(2); + test3(); + fbBuilder.pad(1); +- fbBuilder.putUint8(test2?.value); ++ fbBuilder.putUint8(test2.value); + fbBuilder.putFloat64(test1); + fbBuilder.pad(4); + fbBuilder.putFloat32(z); +@@ -431,12 +560,12 @@ + final TestObjectBuilder _test3; + + Vec3ObjectBuilder({ +- double x, +- double y, +- double z, +- double test1, +- Color test2, +- TestObjectBuilder test3, ++ required double x, ++ required double y, ++ required double z, ++ required double test1, ++ required Color test2, ++ required TestObjectBuilder test3, + }) + : _x = x, + _y = y, +@@ -447,14 +576,11 @@ + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- ++ int finish(fb.Builder fbBuilder) { + fbBuilder.pad(2); + _test3.finish(fbBuilder); + fbBuilder.pad(1); +- fbBuilder.putUint8(_test2?.value); ++ fbBuilder.putUint8(_test2.value); + fbBuilder.putFloat64(_test1); + fbBuilder.pad(4); + fbBuilder.putFloat32(_z); +@@ -465,16 +591,16 @@ + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } + class Ability { + Ability._(this._bc, this._bcOffset); + +- static const fb.Reader reader = const _AbilityReader(); ++ static const fb.Reader reader = _AbilityReader(); + + final fb.BufferContext _bc; + final int _bcOffset; +@@ -486,6 +612,36 @@ + String toString() { + return 'Ability{id: $id, distance: $distance}'; + } ++ ++ AbilityT unpack() => AbilityT( ++ id: id, ++ distance: distance); ++ ++ static int pack(fb.Builder fbBuilder, AbilityT? object) { ++ if (object == null) return 0; ++ return object.pack(fbBuilder); ++ } ++} ++ ++class AbilityT implements fb.Packable { ++ int id; ++ int distance; ++ ++ AbilityT({ ++ required this.id, ++ required this.distance}); ++ ++ @override ++ int pack(fb.Builder fbBuilder) { ++ fbBuilder.putUint32(distance); ++ fbBuilder.putUint32(id); ++ return fbBuilder.offset; ++ } ++ ++ @override ++ String toString() { ++ return 'AbilityT{id: $id, distance: $distance}'; ++ } + } + + class _AbilityReader extends fb.StructReader { +@@ -496,13 +652,11 @@ + + @override + Ability createObject(fb.BufferContext bc, int offset) => +- new Ability._(bc, offset); ++ Ability._(bc, offset); + } + + class AbilityBuilder { +- AbilityBuilder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ AbilityBuilder(this.fbBuilder); + + final fb.Builder fbBuilder; + +@@ -519,18 +673,15 @@ + final int _distance; + + AbilityObjectBuilder({ +- int id, +- int distance, ++ required int id, ++ required int distance, + }) + : _id = id, + _distance = distance; + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- ++ int finish(fb.Builder fbBuilder) { + fbBuilder.putUint32(_distance); + fbBuilder.putUint32(_id); + return fbBuilder.offset; +@@ -538,16 +689,16 @@ + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } + class StructOfStructs { + StructOfStructs._(this._bc, this._bcOffset); + +- static const fb.Reader reader = const _StructOfStructsReader(); ++ static const fb.Reader reader = _StructOfStructsReader(); + + final fb.BufferContext _bc; + final int _bcOffset; +@@ -560,6 +711,40 @@ + String toString() { + return 'StructOfStructs{a: $a, b: $b, c: $c}'; + } ++ ++ StructOfStructsT unpack() => StructOfStructsT( ++ a: a.unpack(), ++ b: b.unpack(), ++ c: c.unpack()); ++ ++ static int pack(fb.Builder fbBuilder, StructOfStructsT? object) { ++ if (object == null) return 0; ++ return object.pack(fbBuilder); ++ } ++} ++ ++class StructOfStructsT implements fb.Packable { ++ AbilityT a; ++ TestT b; ++ AbilityT c; ++ ++ StructOfStructsT({ ++ required this.a, ++ required this.b, ++ required this.c}); ++ ++ @override ++ int pack(fb.Builder fbBuilder) { ++ c.pack(fbBuilder); ++ b.pack(fbBuilder); ++ a.pack(fbBuilder); ++ return fbBuilder.offset; ++ } ++ ++ @override ++ String toString() { ++ return 'StructOfStructsT{a: $a, b: $b, c: $c}'; ++ } + } + + class _StructOfStructsReader extends fb.StructReader { +@@ -570,13 +755,11 @@ + + @override + StructOfStructs createObject(fb.BufferContext bc, int offset) => +- new StructOfStructs._(bc, offset); ++ StructOfStructs._(bc, offset); + } + + class StructOfStructsBuilder { +- StructOfStructsBuilder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ StructOfStructsBuilder(this.fbBuilder); + + final fb.Builder fbBuilder; + +@@ -595,9 +778,9 @@ + final AbilityObjectBuilder _c; + + StructOfStructsObjectBuilder({ +- AbilityObjectBuilder a, +- TestObjectBuilder b, +- AbilityObjectBuilder c, ++ required AbilityObjectBuilder a, ++ required TestObjectBuilder b, ++ required AbilityObjectBuilder c, + }) + : _a = a, + _b = b, +@@ -605,10 +788,7 @@ + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- ++ int finish(fb.Builder fbBuilder) { + _c.finish(fbBuilder); + _b.finish(fbBuilder); + _a.finish(fbBuilder); +@@ -617,25 +797,25 @@ + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } + class Stat { + Stat._(this._bc, this._bcOffset); + factory Stat(List bytes) { +- fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); ++ final rootRef = fb.BufferContext.fromBytes(bytes); + return reader.read(rootRef, 0); + } + +- static const fb.Reader reader = const _StatReader(); ++ static const fb.Reader reader = _StatReader(); + + final fb.BufferContext _bc; + final int _bcOffset; + +- String get id => const fb.StringReader().vTableGet(_bc, _bcOffset, 4, null); ++ String? get id => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 4); + int get val => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 6, 0); + int get count => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 8, 0); + +@@ -643,6 +823,43 @@ + String toString() { + return 'Stat{id: $id, val: $val, count: $count}'; + } ++ ++ StatT unpack() => StatT( ++ id: id, ++ val: val, ++ count: count); ++ ++ static int pack(fb.Builder fbBuilder, StatT? object) { ++ if (object == null) return 0; ++ return object.pack(fbBuilder); ++ } ++} ++ ++class StatT implements fb.Packable { ++ String? id; ++ int val; ++ int count; ++ ++ StatT({ ++ this.id, ++ this.val = 0, ++ this.count = 0}); ++ ++ @override ++ int pack(fb.Builder fbBuilder) { ++ final int? idOffset = id == null ? null ++ : fbBuilder.writeString(id!); ++ fbBuilder.startTable(3); ++ fbBuilder.addOffset(0, idOffset); ++ fbBuilder.addInt64(1, val); ++ fbBuilder.addUint16(2, count); ++ return fbBuilder.endTable(); ++ } ++ ++ @override ++ String toString() { ++ return 'StatT{id: $id, val: $val, count: $count}'; ++ } + } + + class _StatReader extends fb.TableReader { +@@ -650,29 +867,27 @@ + + @override + Stat createObject(fb.BufferContext bc, int offset) => +- new Stat._(bc, offset); ++ Stat._(bc, offset); + } + + class StatBuilder { +- StatBuilder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ StatBuilder(this.fbBuilder); + + final fb.Builder fbBuilder; + + void begin() { +- fbBuilder.startTable(); ++ fbBuilder.startTable(3); + } + +- int addIdOffset(int offset) { ++ int addIdOffset(int? offset) { + fbBuilder.addOffset(0, offset); + return fbBuilder.offset; + } +- int addVal(int val) { ++ int addVal(int? val) { + fbBuilder.addInt64(1, val); + return fbBuilder.offset; + } +- int addCount(int count) { ++ int addCount(int? count) { + fbBuilder.addUint16(2, count); + return fbBuilder.offset; + } +@@ -683,14 +898,14 @@ + } + + class StatObjectBuilder extends fb.ObjectBuilder { +- final String _id; +- final int _val; +- final int _count; ++ final String? _id; ++ final int? _val; ++ final int? _count; + + StatObjectBuilder({ +- String id, +- int val, +- int count, ++ String? id, ++ int? val, ++ int? count, + }) + : _id = id, + _val = val, +@@ -698,15 +913,11 @@ + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- final int idOffset = fbBuilder.writeString(_id); +- +- fbBuilder.startTable(); +- if (idOffset != null) { +- fbBuilder.addOffset(0, idOffset); +- } ++ int finish(fb.Builder fbBuilder) { ++ final int? idOffset = _id == null ? null ++ : fbBuilder.writeString(_id!); ++ fbBuilder.startTable(3); ++ fbBuilder.addOffset(0, idOffset); + fbBuilder.addInt64(1, _val); + fbBuilder.addUint16(2, _count); + return fbBuilder.endTable(); +@@ -714,20 +925,20 @@ + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } + class Referrable { + Referrable._(this._bc, this._bcOffset); + factory Referrable(List bytes) { +- fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); ++ final rootRef = fb.BufferContext.fromBytes(bytes); + return reader.read(rootRef, 0); + } + +- static const fb.Reader reader = const _ReferrableReader(); ++ static const fb.Reader reader = _ReferrableReader(); + + final fb.BufferContext _bc; + final int _bcOffset; +@@ -738,6 +949,33 @@ + String toString() { + return 'Referrable{id: $id}'; + } ++ ++ ReferrableT unpack() => ReferrableT( ++ id: id); ++ ++ static int pack(fb.Builder fbBuilder, ReferrableT? object) { ++ if (object == null) return 0; ++ return object.pack(fbBuilder); ++ } ++} ++ ++class ReferrableT implements fb.Packable { ++ int id; ++ ++ ReferrableT({ ++ this.id = 0}); ++ ++ @override ++ int pack(fb.Builder fbBuilder) { ++ fbBuilder.startTable(1); ++ fbBuilder.addUint64(0, id); ++ return fbBuilder.endTable(); ++ } ++ ++ @override ++ String toString() { ++ return 'ReferrableT{id: $id}'; ++ } + } + + class _ReferrableReader extends fb.TableReader { +@@ -745,21 +983,19 @@ + + @override + Referrable createObject(fb.BufferContext bc, int offset) => +- new Referrable._(bc, offset); ++ Referrable._(bc, offset); + } + + class ReferrableBuilder { +- ReferrableBuilder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ ReferrableBuilder(this.fbBuilder); + + final fb.Builder fbBuilder; + + void begin() { +- fbBuilder.startTable(); ++ fbBuilder.startTable(1); + } + +- int addId(int id) { ++ int addId(int? id) { + fbBuilder.addUint64(0, id); + return fbBuilder.offset; + } +@@ -770,68 +1006,65 @@ + } + + class ReferrableObjectBuilder extends fb.ObjectBuilder { +- final int _id; ++ final int? _id; + + ReferrableObjectBuilder({ +- int id, ++ int? id, + }) + : _id = id; + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- +- fbBuilder.startTable(); ++ int finish(fb.Builder fbBuilder) { ++ fbBuilder.startTable(1); + fbBuilder.addUint64(0, _id); + return fbBuilder.endTable(); + } + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } + /// an example documentation comment: "monster object" + class Monster { + Monster._(this._bc, this._bcOffset); + factory Monster(List bytes) { +- fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); ++ final rootRef = fb.BufferContext.fromBytes(bytes); + return reader.read(rootRef, 0); + } + +- static const fb.Reader reader = const _MonsterReader(); ++ static const fb.Reader reader = _MonsterReader(); + + final fb.BufferContext _bc; + final int _bcOffset; + +- Vec3 get pos => Vec3.reader.vTableGet(_bc, _bcOffset, 4, null); ++ Vec3? get pos => Vec3.reader.vTableGetNullable(_bc, _bcOffset, 4); + int get mana => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 6, 150); + int get hp => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 100); +- String get name => const fb.StringReader().vTableGet(_bc, _bcOffset, 10, null); +- List get inventory => const fb.ListReader(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 14, null); +- Color get color => new Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 16, 8)); +- AnyTypeId get testType => new AnyTypeId.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 18, 0)); ++ String? get name => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 10); ++ List? get inventory => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 14); ++ Color get color => Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 16, 8)); ++ AnyTypeId? get testType => AnyTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 18)); + dynamic get test { + switch (testType?.value) { +- case 1: return Monster.reader.vTableGet(_bc, _bcOffset, 20, null); +- case 2: return TestSimpleTableWithEnum.reader.vTableGet(_bc, _bcOffset, 20, null); +- case 3: return my_game_example2.Monster.reader.vTableGet(_bc, _bcOffset, 20, null); ++ case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 20); ++ case 2: return TestSimpleTableWithEnum.reader.vTableGetNullable(_bc, _bcOffset, 20); ++ case 3: return my_game_example2.Monster.reader.vTableGetNullable(_bc, _bcOffset, 20); + default: return null; + } + } +- List get test4 => const fb.ListReader(Test.reader).vTableGet(_bc, _bcOffset, 22, null); +- List get testarrayofstring => const fb.ListReader(const fb.StringReader()).vTableGet(_bc, _bcOffset, 24, null); ++ List? get test4 => const fb.ListReader(Test.reader).vTableGetNullable(_bc, _bcOffset, 22); ++ List? get testarrayofstring => const fb.ListReader(fb.StringReader()).vTableGetNullable(_bc, _bcOffset, 24); + /// an example documentation comment: this will end up in the generated code + /// multiline too +- List get testarrayoftables => const fb.ListReader(Monster.reader).vTableGet(_bc, _bcOffset, 26, null); +- Monster get enemy => Monster.reader.vTableGet(_bc, _bcOffset, 28, null); +- List get testnestedflatbuffer => const fb.ListReader(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 30, null); +- Stat get testempty => Stat.reader.vTableGet(_bc, _bcOffset, 32, null); ++ List? get testarrayoftables => const fb.ListReader(Monster.reader).vTableGetNullable(_bc, _bcOffset, 26); ++ Monster? get enemy => Monster.reader.vTableGetNullable(_bc, _bcOffset, 28); ++ List? get testnestedflatbuffer => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 30); ++ Stat? get testempty => Stat.reader.vTableGetNullable(_bc, _bcOffset, 32); + bool get testbool => const fb.BoolReader().vTableGet(_bc, _bcOffset, 34, false); + int get testhashs32Fnv1 => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 36, 0); + int get testhashu32Fnv1 => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 38, 0); +@@ -841,52 +1074,337 @@ + int get testhashu32Fnv1a => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 46, 0); + int get testhashs64Fnv1a => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 48, 0); + int get testhashu64Fnv1a => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 50, 0); +- List get testarrayofbools => const fb.ListReader(const fb.BoolReader()).vTableGet(_bc, _bcOffset, 52, null); ++ List? get testarrayofbools => const fb.ListReader(fb.BoolReader()).vTableGetNullable(_bc, _bcOffset, 52); + double get testf => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 54, 3.14159); + double get testf2 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 56, 3.0); + double get testf3 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 58, 0.0); +- List get testarrayofstring2 => const fb.ListReader(const fb.StringReader()).vTableGet(_bc, _bcOffset, 60, null); +- List get testarrayofsortedstruct => const fb.ListReader(Ability.reader).vTableGet(_bc, _bcOffset, 62, null); +- List get flex => const fb.ListReader(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 64, null); +- List get test5 => const fb.ListReader(Test.reader).vTableGet(_bc, _bcOffset, 66, null); +- List get vectorOfLongs => const fb.ListReader(const fb.Int64Reader()).vTableGet(_bc, _bcOffset, 68, null); +- List get vectorOfDoubles => const fb.ListReader(const fb.Float64Reader()).vTableGet(_bc, _bcOffset, 70, null); +- my_game.InParentNamespace get parentNamespaceTest => my_game.InParentNamespace.reader.vTableGet(_bc, _bcOffset, 72, null); +- List get vectorOfReferrables => const fb.ListReader(Referrable.reader).vTableGet(_bc, _bcOffset, 74, null); ++ List? get testarrayofstring2 => const fb.ListReader(fb.StringReader()).vTableGetNullable(_bc, _bcOffset, 60); ++ List? get testarrayofsortedstruct => const fb.ListReader(Ability.reader).vTableGetNullable(_bc, _bcOffset, 62); ++ List? get flex => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 64); ++ List? get test5 => const fb.ListReader(Test.reader).vTableGetNullable(_bc, _bcOffset, 66); ++ List? get vectorOfLongs => const fb.ListReader(fb.Int64Reader()).vTableGetNullable(_bc, _bcOffset, 68); ++ List? get vectorOfDoubles => const fb.ListReader(fb.Float64Reader()).vTableGetNullable(_bc, _bcOffset, 70); ++ my_game.InParentNamespace? get parentNamespaceTest => my_game.InParentNamespace.reader.vTableGetNullable(_bc, _bcOffset, 72); ++ List? get vectorOfReferrables => const fb.ListReader(Referrable.reader).vTableGetNullable(_bc, _bcOffset, 74); + int get singleWeakReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 76, 0); +- List get vectorOfWeakReferences => const fb.ListReader(const fb.Uint64Reader()).vTableGet(_bc, _bcOffset, 78, null); +- List get vectorOfStrongReferrables => const fb.ListReader(Referrable.reader).vTableGet(_bc, _bcOffset, 80, null); ++ List? get vectorOfWeakReferences => const fb.ListReader(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 78); ++ List? get vectorOfStrongReferrables => const fb.ListReader(Referrable.reader).vTableGetNullable(_bc, _bcOffset, 80); + int get coOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 82, 0); +- List get vectorOfCoOwningReferences => const fb.ListReader(const fb.Uint64Reader()).vTableGet(_bc, _bcOffset, 84, null); ++ List? get vectorOfCoOwningReferences => const fb.ListReader(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 84); + int get nonOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 86, 0); +- List get vectorOfNonOwningReferences => const fb.ListReader(const fb.Uint64Reader()).vTableGet(_bc, _bcOffset, 88, null); +- AnyUniqueAliasesTypeId get anyUniqueType => new AnyUniqueAliasesTypeId.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 90, 0)); ++ List? get vectorOfNonOwningReferences => const fb.ListReader(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 88); ++ AnyUniqueAliasesTypeId? get anyUniqueType => AnyUniqueAliasesTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 90)); + dynamic get anyUnique { + switch (anyUniqueType?.value) { +- case 1: return Monster.reader.vTableGet(_bc, _bcOffset, 92, null); +- case 2: return TestSimpleTableWithEnum.reader.vTableGet(_bc, _bcOffset, 92, null); +- case 3: return my_game_example2.Monster.reader.vTableGet(_bc, _bcOffset, 92, null); ++ case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 92); ++ case 2: return TestSimpleTableWithEnum.reader.vTableGetNullable(_bc, _bcOffset, 92); ++ case 3: return my_game_example2.Monster.reader.vTableGetNullable(_bc, _bcOffset, 92); + default: return null; + } + } +- AnyAmbiguousAliasesTypeId get anyAmbiguousType => new AnyAmbiguousAliasesTypeId.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 94, 0)); ++ AnyAmbiguousAliasesTypeId? get anyAmbiguousType => AnyAmbiguousAliasesTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 94)); + dynamic get anyAmbiguous { + switch (anyAmbiguousType?.value) { +- case 1: return Monster.reader.vTableGet(_bc, _bcOffset, 96, null); +- case 2: return Monster.reader.vTableGet(_bc, _bcOffset, 96, null); +- case 3: return Monster.reader.vTableGet(_bc, _bcOffset, 96, null); ++ case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96); ++ case 2: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96); ++ case 3: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96); + default: return null; + } + } +- List get vectorOfEnums => const fb.ListReader(Color.reader).vTableGet(_bc, _bcOffset, 98, null); +- Race get signedEnum => new Race.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 100, -1)); +- List get testrequirednestedflatbuffer => const fb.ListReader(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 102, null); +- List get scalarKeySortedTables => const fb.ListReader(Stat.reader).vTableGet(_bc, _bcOffset, 104, null); ++ List? get vectorOfEnums => const fb.ListReader(Color.reader).vTableGetNullable(_bc, _bcOffset, 98); ++ Race get signedEnum => Race.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 100, -1)); ++ List? get testrequirednestedflatbuffer => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 102); ++ List? get scalarKeySortedTables => const fb.ListReader(Stat.reader).vTableGetNullable(_bc, _bcOffset, 104); + + @override + String toString() { + return 'Monster{pos: $pos, mana: $mana, hp: $hp, name: $name, inventory: $inventory, color: $color, testType: $testType, test: $test, test4: $test4, testarrayofstring: $testarrayofstring, testarrayoftables: $testarrayoftables, enemy: $enemy, testnestedflatbuffer: $testnestedflatbuffer, testempty: $testempty, testbool: $testbool, testhashs32Fnv1: $testhashs32Fnv1, testhashu32Fnv1: $testhashu32Fnv1, testhashs64Fnv1: $testhashs64Fnv1, testhashu64Fnv1: $testhashu64Fnv1, testhashs32Fnv1a: $testhashs32Fnv1a, testhashu32Fnv1a: $testhashu32Fnv1a, testhashs64Fnv1a: $testhashs64Fnv1a, testhashu64Fnv1a: $testhashu64Fnv1a, testarrayofbools: $testarrayofbools, testf: $testf, testf2: $testf2, testf3: $testf3, testarrayofstring2: $testarrayofstring2, testarrayofsortedstruct: $testarrayofsortedstruct, flex: $flex, test5: $test5, vectorOfLongs: $vectorOfLongs, vectorOfDoubles: $vectorOfDoubles, parentNamespaceTest: $parentNamespaceTest, vectorOfReferrables: $vectorOfReferrables, singleWeakReference: $singleWeakReference, vectorOfWeakReferences: $vectorOfWeakReferences, vectorOfStrongReferrables: $vectorOfStrongReferrables, coOwningReference: $coOwningReference, vectorOfCoOwningReferences: $vectorOfCoOwningReferences, nonOwningReference: $nonOwningReference, vectorOfNonOwningReferences: $vectorOfNonOwningReferences, anyUniqueType: $anyUniqueType, anyUnique: $anyUnique, anyAmbiguousType: $anyAmbiguousType, anyAmbiguous: $anyAmbiguous, vectorOfEnums: $vectorOfEnums, signedEnum: $signedEnum, testrequirednestedflatbuffer: $testrequirednestedflatbuffer, scalarKeySortedTables: $scalarKeySortedTables}'; + } ++ ++ MonsterT unpack() => MonsterT( ++ pos: pos?.unpack(), ++ mana: mana, ++ hp: hp, ++ name: name, ++ inventory: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 14), ++ color: color, ++ testType: testType, ++ test: test, ++ test4: test4?.map((e) => e.unpack()).toList(), ++ testarrayofstring: const fb.ListReader(fb.StringReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 24), ++ testarrayoftables: testarrayoftables?.map((e) => e.unpack()).toList(), ++ enemy: enemy?.unpack(), ++ testnestedflatbuffer: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 30), ++ testempty: testempty?.unpack(), ++ testbool: testbool, ++ testhashs32Fnv1: testhashs32Fnv1, ++ testhashu32Fnv1: testhashu32Fnv1, ++ testhashs64Fnv1: testhashs64Fnv1, ++ testhashu64Fnv1: testhashu64Fnv1, ++ testhashs32Fnv1a: testhashs32Fnv1a, ++ testhashu32Fnv1a: testhashu32Fnv1a, ++ testhashs64Fnv1a: testhashs64Fnv1a, ++ testhashu64Fnv1a: testhashu64Fnv1a, ++ testarrayofbools: const fb.ListReader(fb.BoolReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 52), ++ testf: testf, ++ testf2: testf2, ++ testf3: testf3, ++ testarrayofstring2: const fb.ListReader(fb.StringReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 60), ++ testarrayofsortedstruct: testarrayofsortedstruct?.map((e) => e.unpack()).toList(), ++ flex: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 64), ++ test5: test5?.map((e) => e.unpack()).toList(), ++ vectorOfLongs: const fb.ListReader(fb.Int64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 68), ++ vectorOfDoubles: const fb.ListReader(fb.Float64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 70), ++ parentNamespaceTest: parentNamespaceTest?.unpack(), ++ vectorOfReferrables: vectorOfReferrables?.map((e) => e.unpack()).toList(), ++ singleWeakReference: singleWeakReference, ++ vectorOfWeakReferences: const fb.ListReader(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 78), ++ vectorOfStrongReferrables: vectorOfStrongReferrables?.map((e) => e.unpack()).toList(), ++ coOwningReference: coOwningReference, ++ vectorOfCoOwningReferences: const fb.ListReader(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 84), ++ nonOwningReference: nonOwningReference, ++ vectorOfNonOwningReferences: const fb.ListReader(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 88), ++ anyUniqueType: anyUniqueType, ++ anyUnique: anyUnique, ++ anyAmbiguousType: anyAmbiguousType, ++ anyAmbiguous: anyAmbiguous, ++ vectorOfEnums: const fb.ListReader(Color.reader, lazy: false).vTableGetNullable(_bc, _bcOffset, 98), ++ signedEnum: signedEnum, ++ testrequirednestedflatbuffer: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 102), ++ scalarKeySortedTables: scalarKeySortedTables?.map((e) => e.unpack()).toList()); ++ ++ static int pack(fb.Builder fbBuilder, MonsterT? object) { ++ if (object == null) return 0; ++ return object.pack(fbBuilder); ++ } ++} ++ ++/// an example documentation comment: "monster object" ++class MonsterT implements fb.Packable { ++ Vec3T? pos; ++ int mana; ++ int hp; ++ String? name; ++ List? inventory; ++ Color color; ++ AnyTypeId? testType; ++ dynamic test; ++ List? test4; ++ List? testarrayofstring; ++ /// an example documentation comment: this will end up in the generated code ++ /// multiline too ++ List? testarrayoftables; ++ MonsterT? enemy; ++ List? testnestedflatbuffer; ++ StatT? testempty; ++ bool testbool; ++ int testhashs32Fnv1; ++ int testhashu32Fnv1; ++ int testhashs64Fnv1; ++ int testhashu64Fnv1; ++ int testhashs32Fnv1a; ++ int testhashu32Fnv1a; ++ int testhashs64Fnv1a; ++ int testhashu64Fnv1a; ++ List? testarrayofbools; ++ double testf; ++ double testf2; ++ double testf3; ++ List? testarrayofstring2; ++ List? testarrayofsortedstruct; ++ List? flex; ++ List? test5; ++ List? vectorOfLongs; ++ List? vectorOfDoubles; ++ my_game.InParentNamespaceT? parentNamespaceTest; ++ List? vectorOfReferrables; ++ int singleWeakReference; ++ List? vectorOfWeakReferences; ++ List? vectorOfStrongReferrables; ++ int coOwningReference; ++ List? vectorOfCoOwningReferences; ++ int nonOwningReference; ++ List? vectorOfNonOwningReferences; ++ AnyUniqueAliasesTypeId? anyUniqueType; ++ dynamic anyUnique; ++ AnyAmbiguousAliasesTypeId? anyAmbiguousType; ++ dynamic anyAmbiguous; ++ List? vectorOfEnums; ++ Race signedEnum; ++ List? testrequirednestedflatbuffer; ++ List? scalarKeySortedTables; ++ ++ MonsterT({ ++ this.pos, ++ this.mana = 150, ++ this.hp = 100, ++ this.name, ++ this.inventory, ++ this.color = Color.Blue, ++ this.testType, ++ this.test, ++ this.test4, ++ this.testarrayofstring, ++ this.testarrayoftables, ++ this.enemy, ++ this.testnestedflatbuffer, ++ this.testempty, ++ this.testbool = false, ++ this.testhashs32Fnv1 = 0, ++ this.testhashu32Fnv1 = 0, ++ this.testhashs64Fnv1 = 0, ++ this.testhashu64Fnv1 = 0, ++ this.testhashs32Fnv1a = 0, ++ this.testhashu32Fnv1a = 0, ++ this.testhashs64Fnv1a = 0, ++ this.testhashu64Fnv1a = 0, ++ this.testarrayofbools, ++ this.testf = 3.14159, ++ this.testf2 = 3.0, ++ this.testf3 = 0.0, ++ this.testarrayofstring2, ++ this.testarrayofsortedstruct, ++ this.flex, ++ this.test5, ++ this.vectorOfLongs, ++ this.vectorOfDoubles, ++ this.parentNamespaceTest, ++ this.vectorOfReferrables, ++ this.singleWeakReference = 0, ++ this.vectorOfWeakReferences, ++ this.vectorOfStrongReferrables, ++ this.coOwningReference = 0, ++ this.vectorOfCoOwningReferences, ++ this.nonOwningReference = 0, ++ this.vectorOfNonOwningReferences, ++ this.anyUniqueType, ++ this.anyUnique, ++ this.anyAmbiguousType, ++ this.anyAmbiguous, ++ this.vectorOfEnums, ++ this.signedEnum = Race.None, ++ this.testrequirednestedflatbuffer, ++ this.scalarKeySortedTables}); ++ ++ @override ++ int pack(fb.Builder fbBuilder) { ++ final int? nameOffset = name == null ? null ++ : fbBuilder.writeString(name!); ++ final int? inventoryOffset = inventory == null ? null ++ : fbBuilder.writeListUint8(inventory!); ++ final int? testOffset = test?.pack(fbBuilder); ++ int? test4Offset; ++ if (test4 != null) { ++ for (var e in test4!) { e.pack(fbBuilder); } ++ test4Offset = fbBuilder.endStructVector(test4!.length); ++ } ++ final int? testarrayofstringOffset = testarrayofstring == null ? null ++ : fbBuilder.writeList(testarrayofstring!.map(fbBuilder.writeString).toList()); ++ final int? testarrayoftablesOffset = testarrayoftables == null ? null ++ : fbBuilder.writeList(testarrayoftables!.map((b) => b.pack(fbBuilder)).toList()); ++ final int? enemyOffset = enemy?.pack(fbBuilder); ++ final int? testnestedflatbufferOffset = testnestedflatbuffer == null ? null ++ : fbBuilder.writeListUint8(testnestedflatbuffer!); ++ final int? testemptyOffset = testempty?.pack(fbBuilder); ++ final int? testarrayofboolsOffset = testarrayofbools == null ? null ++ : fbBuilder.writeListBool(testarrayofbools!); ++ final int? testarrayofstring2Offset = testarrayofstring2 == null ? null ++ : fbBuilder.writeList(testarrayofstring2!.map(fbBuilder.writeString).toList()); ++ int? testarrayofsortedstructOffset; ++ if (testarrayofsortedstruct != null) { ++ for (var e in testarrayofsortedstruct!) { e.pack(fbBuilder); } ++ testarrayofsortedstructOffset = fbBuilder.endStructVector(testarrayofsortedstruct!.length); ++ } ++ final int? flexOffset = flex == null ? null ++ : fbBuilder.writeListUint8(flex!); ++ int? test5Offset; ++ if (test5 != null) { ++ for (var e in test5!) { e.pack(fbBuilder); } ++ test5Offset = fbBuilder.endStructVector(test5!.length); ++ } ++ final int? vectorOfLongsOffset = vectorOfLongs == null ? null ++ : fbBuilder.writeListInt64(vectorOfLongs!); ++ final int? vectorOfDoublesOffset = vectorOfDoubles == null ? null ++ : fbBuilder.writeListFloat64(vectorOfDoubles!); ++ final int? parentNamespaceTestOffset = parentNamespaceTest?.pack(fbBuilder); ++ final int? vectorOfReferrablesOffset = vectorOfReferrables == null ? null ++ : fbBuilder.writeList(vectorOfReferrables!.map((b) => b.pack(fbBuilder)).toList()); ++ final int? vectorOfWeakReferencesOffset = vectorOfWeakReferences == null ? null ++ : fbBuilder.writeListUint64(vectorOfWeakReferences!); ++ final int? vectorOfStrongReferrablesOffset = vectorOfStrongReferrables == null ? null ++ : fbBuilder.writeList(vectorOfStrongReferrables!.map((b) => b.pack(fbBuilder)).toList()); ++ final int? vectorOfCoOwningReferencesOffset = vectorOfCoOwningReferences == null ? null ++ : fbBuilder.writeListUint64(vectorOfCoOwningReferences!); ++ final int? vectorOfNonOwningReferencesOffset = vectorOfNonOwningReferences == null ? null ++ : fbBuilder.writeListUint64(vectorOfNonOwningReferences!); ++ final int? anyUniqueOffset = anyUnique?.pack(fbBuilder); ++ final int? anyAmbiguousOffset = anyAmbiguous?.pack(fbBuilder); ++ final int? vectorOfEnumsOffset = vectorOfEnums == null ? null ++ : fbBuilder.writeListUint8(vectorOfEnums!.map((f) => f.value).toList()); ++ final int? testrequirednestedflatbufferOffset = testrequirednestedflatbuffer == null ? null ++ : fbBuilder.writeListUint8(testrequirednestedflatbuffer!); ++ final int? scalarKeySortedTablesOffset = scalarKeySortedTables == null ? null ++ : fbBuilder.writeList(scalarKeySortedTables!.map((b) => b.pack(fbBuilder)).toList()); ++ fbBuilder.startTable(50); ++ if (pos != null) { ++ fbBuilder.addStruct(0, pos!.pack(fbBuilder)); ++ } ++ fbBuilder.addInt16(1, mana); ++ fbBuilder.addInt16(2, hp); ++ fbBuilder.addOffset(3, nameOffset); ++ fbBuilder.addOffset(5, inventoryOffset); ++ fbBuilder.addUint8(6, color.value); ++ fbBuilder.addUint8(7, testType?.value); ++ fbBuilder.addOffset(8, testOffset); ++ fbBuilder.addOffset(9, test4Offset); ++ fbBuilder.addOffset(10, testarrayofstringOffset); ++ fbBuilder.addOffset(11, testarrayoftablesOffset); ++ fbBuilder.addOffset(12, enemyOffset); ++ fbBuilder.addOffset(13, testnestedflatbufferOffset); ++ fbBuilder.addOffset(14, testemptyOffset); ++ fbBuilder.addBool(15, testbool); ++ fbBuilder.addInt32(16, testhashs32Fnv1); ++ fbBuilder.addUint32(17, testhashu32Fnv1); ++ fbBuilder.addInt64(18, testhashs64Fnv1); ++ fbBuilder.addUint64(19, testhashu64Fnv1); ++ fbBuilder.addInt32(20, testhashs32Fnv1a); ++ fbBuilder.addUint32(21, testhashu32Fnv1a); ++ fbBuilder.addInt64(22, testhashs64Fnv1a); ++ fbBuilder.addUint64(23, testhashu64Fnv1a); ++ fbBuilder.addOffset(24, testarrayofboolsOffset); ++ fbBuilder.addFloat32(25, testf); ++ fbBuilder.addFloat32(26, testf2); ++ fbBuilder.addFloat32(27, testf3); ++ fbBuilder.addOffset(28, testarrayofstring2Offset); ++ fbBuilder.addOffset(29, testarrayofsortedstructOffset); ++ fbBuilder.addOffset(30, flexOffset); ++ fbBuilder.addOffset(31, test5Offset); ++ fbBuilder.addOffset(32, vectorOfLongsOffset); ++ fbBuilder.addOffset(33, vectorOfDoublesOffset); ++ fbBuilder.addOffset(34, parentNamespaceTestOffset); ++ fbBuilder.addOffset(35, vectorOfReferrablesOffset); ++ fbBuilder.addUint64(36, singleWeakReference); ++ fbBuilder.addOffset(37, vectorOfWeakReferencesOffset); ++ fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset); ++ fbBuilder.addUint64(39, coOwningReference); ++ fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset); ++ fbBuilder.addUint64(41, nonOwningReference); ++ fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset); ++ fbBuilder.addUint8(43, anyUniqueType?.value); ++ fbBuilder.addOffset(44, anyUniqueOffset); ++ fbBuilder.addUint8(45, anyAmbiguousType?.value); ++ fbBuilder.addOffset(46, anyAmbiguousOffset); ++ fbBuilder.addOffset(47, vectorOfEnumsOffset); ++ fbBuilder.addInt8(48, signedEnum.value); ++ fbBuilder.addOffset(49, testrequirednestedflatbufferOffset); ++ fbBuilder.addOffset(50, scalarKeySortedTablesOffset); ++ return fbBuilder.endTable(); ++ } ++ ++ @override ++ String toString() { ++ return 'MonsterT{pos: $pos, mana: $mana, hp: $hp, name: $name, inventory: $inventory, color: $color, testType: $testType, test: $test, test4: $test4, testarrayofstring: $testarrayofstring, testarrayoftables: $testarrayoftables, enemy: $enemy, testnestedflatbuffer: $testnestedflatbuffer, testempty: $testempty, testbool: $testbool, testhashs32Fnv1: $testhashs32Fnv1, testhashu32Fnv1: $testhashu32Fnv1, testhashs64Fnv1: $testhashs64Fnv1, testhashu64Fnv1: $testhashu64Fnv1, testhashs32Fnv1a: $testhashs32Fnv1a, testhashu32Fnv1a: $testhashu32Fnv1a, testhashs64Fnv1a: $testhashs64Fnv1a, testhashu64Fnv1a: $testhashu64Fnv1a, testarrayofbools: $testarrayofbools, testf: $testf, testf2: $testf2, testf3: $testf3, testarrayofstring2: $testarrayofstring2, testarrayofsortedstruct: $testarrayofsortedstruct, flex: $flex, test5: $test5, vectorOfLongs: $vectorOfLongs, vectorOfDoubles: $vectorOfDoubles, parentNamespaceTest: $parentNamespaceTest, vectorOfReferrables: $vectorOfReferrables, singleWeakReference: $singleWeakReference, vectorOfWeakReferences: $vectorOfWeakReferences, vectorOfStrongReferrables: $vectorOfStrongReferrables, coOwningReference: $coOwningReference, vectorOfCoOwningReferences: $vectorOfCoOwningReferences, nonOwningReference: $nonOwningReference, vectorOfNonOwningReferences: $vectorOfNonOwningReferences, anyUniqueType: $anyUniqueType, anyUnique: $anyUnique, anyAmbiguousType: $anyAmbiguousType, anyAmbiguous: $anyAmbiguous, vectorOfEnums: $vectorOfEnums, signedEnum: $signedEnum, testrequirednestedflatbuffer: $testrequirednestedflatbuffer, scalarKeySortedTables: $scalarKeySortedTables}'; ++ } + } + + class _MonsterReader extends fb.TableReader { +@@ -894,217 +1412,215 @@ + + @override + Monster createObject(fb.BufferContext bc, int offset) => +- new Monster._(bc, offset); ++ Monster._(bc, offset); + } + + class MonsterBuilder { +- MonsterBuilder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ MonsterBuilder(this.fbBuilder); + + final fb.Builder fbBuilder; + + void begin() { +- fbBuilder.startTable(); ++ fbBuilder.startTable(50); + } + + int addPos(int offset) { + fbBuilder.addStruct(0, offset); + return fbBuilder.offset; + } +- int addMana(int mana) { ++ int addMana(int? mana) { + fbBuilder.addInt16(1, mana); + return fbBuilder.offset; + } +- int addHp(int hp) { ++ int addHp(int? hp) { + fbBuilder.addInt16(2, hp); + return fbBuilder.offset; + } +- int addNameOffset(int offset) { ++ int addNameOffset(int? offset) { + fbBuilder.addOffset(3, offset); + return fbBuilder.offset; + } +- int addInventoryOffset(int offset) { ++ int addInventoryOffset(int? offset) { + fbBuilder.addOffset(5, offset); + return fbBuilder.offset; + } +- int addColor(Color color) { ++ int addColor(Color? color) { + fbBuilder.addUint8(6, color?.value); + return fbBuilder.offset; + } +- int addTestType(AnyTypeId testType) { ++ int addTestType(AnyTypeId? testType) { + fbBuilder.addUint8(7, testType?.value); + return fbBuilder.offset; + } +- int addTestOffset(int offset) { ++ int addTestOffset(int? offset) { + fbBuilder.addOffset(8, offset); + return fbBuilder.offset; + } +- int addTest4Offset(int offset) { ++ int addTest4Offset(int? offset) { + fbBuilder.addOffset(9, offset); + return fbBuilder.offset; + } +- int addTestarrayofstringOffset(int offset) { ++ int addTestarrayofstringOffset(int? offset) { + fbBuilder.addOffset(10, offset); + return fbBuilder.offset; + } +- int addTestarrayoftablesOffset(int offset) { ++ int addTestarrayoftablesOffset(int? offset) { + fbBuilder.addOffset(11, offset); + return fbBuilder.offset; + } +- int addEnemyOffset(int offset) { ++ int addEnemyOffset(int? offset) { + fbBuilder.addOffset(12, offset); + return fbBuilder.offset; + } +- int addTestnestedflatbufferOffset(int offset) { ++ int addTestnestedflatbufferOffset(int? offset) { + fbBuilder.addOffset(13, offset); + return fbBuilder.offset; + } +- int addTestemptyOffset(int offset) { ++ int addTestemptyOffset(int? offset) { + fbBuilder.addOffset(14, offset); + return fbBuilder.offset; + } +- int addTestbool(bool testbool) { ++ int addTestbool(bool? testbool) { + fbBuilder.addBool(15, testbool); + return fbBuilder.offset; + } +- int addTesthashs32Fnv1(int testhashs32Fnv1) { ++ int addTesthashs32Fnv1(int? testhashs32Fnv1) { + fbBuilder.addInt32(16, testhashs32Fnv1); + return fbBuilder.offset; + } +- int addTesthashu32Fnv1(int testhashu32Fnv1) { ++ int addTesthashu32Fnv1(int? testhashu32Fnv1) { + fbBuilder.addUint32(17, testhashu32Fnv1); + return fbBuilder.offset; + } +- int addTesthashs64Fnv1(int testhashs64Fnv1) { ++ int addTesthashs64Fnv1(int? testhashs64Fnv1) { + fbBuilder.addInt64(18, testhashs64Fnv1); + return fbBuilder.offset; + } +- int addTesthashu64Fnv1(int testhashu64Fnv1) { ++ int addTesthashu64Fnv1(int? testhashu64Fnv1) { + fbBuilder.addUint64(19, testhashu64Fnv1); + return fbBuilder.offset; + } +- int addTesthashs32Fnv1a(int testhashs32Fnv1a) { ++ int addTesthashs32Fnv1a(int? testhashs32Fnv1a) { + fbBuilder.addInt32(20, testhashs32Fnv1a); + return fbBuilder.offset; + } +- int addTesthashu32Fnv1a(int testhashu32Fnv1a) { ++ int addTesthashu32Fnv1a(int? testhashu32Fnv1a) { + fbBuilder.addUint32(21, testhashu32Fnv1a); + return fbBuilder.offset; + } +- int addTesthashs64Fnv1a(int testhashs64Fnv1a) { ++ int addTesthashs64Fnv1a(int? testhashs64Fnv1a) { + fbBuilder.addInt64(22, testhashs64Fnv1a); + return fbBuilder.offset; + } +- int addTesthashu64Fnv1a(int testhashu64Fnv1a) { ++ int addTesthashu64Fnv1a(int? testhashu64Fnv1a) { + fbBuilder.addUint64(23, testhashu64Fnv1a); + return fbBuilder.offset; + } +- int addTestarrayofboolsOffset(int offset) { ++ int addTestarrayofboolsOffset(int? offset) { + fbBuilder.addOffset(24, offset); + return fbBuilder.offset; + } +- int addTestf(double testf) { ++ int addTestf(double? testf) { + fbBuilder.addFloat32(25, testf); + return fbBuilder.offset; + } +- int addTestf2(double testf2) { ++ int addTestf2(double? testf2) { + fbBuilder.addFloat32(26, testf2); + return fbBuilder.offset; + } +- int addTestf3(double testf3) { ++ int addTestf3(double? testf3) { + fbBuilder.addFloat32(27, testf3); + return fbBuilder.offset; + } +- int addTestarrayofstring2Offset(int offset) { ++ int addTestarrayofstring2Offset(int? offset) { + fbBuilder.addOffset(28, offset); + return fbBuilder.offset; + } +- int addTestarrayofsortedstructOffset(int offset) { ++ int addTestarrayofsortedstructOffset(int? offset) { + fbBuilder.addOffset(29, offset); + return fbBuilder.offset; + } +- int addFlexOffset(int offset) { ++ int addFlexOffset(int? offset) { + fbBuilder.addOffset(30, offset); + return fbBuilder.offset; + } +- int addTest5Offset(int offset) { ++ int addTest5Offset(int? offset) { + fbBuilder.addOffset(31, offset); + return fbBuilder.offset; + } +- int addVectorOfLongsOffset(int offset) { ++ int addVectorOfLongsOffset(int? offset) { + fbBuilder.addOffset(32, offset); + return fbBuilder.offset; + } +- int addVectorOfDoublesOffset(int offset) { ++ int addVectorOfDoublesOffset(int? offset) { + fbBuilder.addOffset(33, offset); + return fbBuilder.offset; + } +- int addParentNamespaceTestOffset(int offset) { ++ int addParentNamespaceTestOffset(int? offset) { + fbBuilder.addOffset(34, offset); + return fbBuilder.offset; + } +- int addVectorOfReferrablesOffset(int offset) { ++ int addVectorOfReferrablesOffset(int? offset) { + fbBuilder.addOffset(35, offset); + return fbBuilder.offset; + } +- int addSingleWeakReference(int singleWeakReference) { ++ int addSingleWeakReference(int? singleWeakReference) { + fbBuilder.addUint64(36, singleWeakReference); + return fbBuilder.offset; + } +- int addVectorOfWeakReferencesOffset(int offset) { ++ int addVectorOfWeakReferencesOffset(int? offset) { + fbBuilder.addOffset(37, offset); + return fbBuilder.offset; + } +- int addVectorOfStrongReferrablesOffset(int offset) { ++ int addVectorOfStrongReferrablesOffset(int? offset) { + fbBuilder.addOffset(38, offset); + return fbBuilder.offset; + } +- int addCoOwningReference(int coOwningReference) { ++ int addCoOwningReference(int? coOwningReference) { + fbBuilder.addUint64(39, coOwningReference); + return fbBuilder.offset; + } +- int addVectorOfCoOwningReferencesOffset(int offset) { ++ int addVectorOfCoOwningReferencesOffset(int? offset) { + fbBuilder.addOffset(40, offset); + return fbBuilder.offset; + } +- int addNonOwningReference(int nonOwningReference) { ++ int addNonOwningReference(int? nonOwningReference) { + fbBuilder.addUint64(41, nonOwningReference); + return fbBuilder.offset; + } +- int addVectorOfNonOwningReferencesOffset(int offset) { ++ int addVectorOfNonOwningReferencesOffset(int? offset) { + fbBuilder.addOffset(42, offset); + return fbBuilder.offset; + } +- int addAnyUniqueType(AnyUniqueAliasesTypeId anyUniqueType) { ++ int addAnyUniqueType(AnyUniqueAliasesTypeId? anyUniqueType) { + fbBuilder.addUint8(43, anyUniqueType?.value); + return fbBuilder.offset; + } +- int addAnyUniqueOffset(int offset) { ++ int addAnyUniqueOffset(int? offset) { + fbBuilder.addOffset(44, offset); + return fbBuilder.offset; + } +- int addAnyAmbiguousType(AnyAmbiguousAliasesTypeId anyAmbiguousType) { ++ int addAnyAmbiguousType(AnyAmbiguousAliasesTypeId? anyAmbiguousType) { + fbBuilder.addUint8(45, anyAmbiguousType?.value); + return fbBuilder.offset; + } +- int addAnyAmbiguousOffset(int offset) { ++ int addAnyAmbiguousOffset(int? offset) { + fbBuilder.addOffset(46, offset); + return fbBuilder.offset; + } +- int addVectorOfEnumsOffset(int offset) { ++ int addVectorOfEnumsOffset(int? offset) { + fbBuilder.addOffset(47, offset); + return fbBuilder.offset; + } +- int addSignedEnum(Race signedEnum) { ++ int addSignedEnum(Race? signedEnum) { + fbBuilder.addInt8(48, signedEnum?.value); + return fbBuilder.offset; + } +- int addTestrequirednestedflatbufferOffset(int offset) { ++ int addTestrequirednestedflatbufferOffset(int? offset) { + fbBuilder.addOffset(49, offset); + return fbBuilder.offset; + } +- int addScalarKeySortedTablesOffset(int offset) { ++ int addScalarKeySortedTablesOffset(int? offset) { + fbBuilder.addOffset(50, offset); + return fbBuilder.offset; + } +@@ -1115,108 +1631,108 @@ + } + + class MonsterObjectBuilder extends fb.ObjectBuilder { +- final Vec3ObjectBuilder _pos; +- final int _mana; +- final int _hp; +- final String _name; +- final List _inventory; +- final Color _color; +- final AnyTypeId _testType; ++ final Vec3ObjectBuilder? _pos; ++ final int? _mana; ++ final int? _hp; ++ final String? _name; ++ final List? _inventory; ++ final Color? _color; ++ final AnyTypeId? _testType; + final dynamic _test; +- final List _test4; +- final List _testarrayofstring; +- final List _testarrayoftables; +- final MonsterObjectBuilder _enemy; +- final List _testnestedflatbuffer; +- final StatObjectBuilder _testempty; +- final bool _testbool; +- final int _testhashs32Fnv1; +- final int _testhashu32Fnv1; +- final int _testhashs64Fnv1; +- final int _testhashu64Fnv1; +- final int _testhashs32Fnv1a; +- final int _testhashu32Fnv1a; +- final int _testhashs64Fnv1a; +- final int _testhashu64Fnv1a; +- final List _testarrayofbools; +- final double _testf; +- final double _testf2; +- final double _testf3; +- final List _testarrayofstring2; +- final List _testarrayofsortedstruct; +- final List _flex; +- final List _test5; +- final List _vectorOfLongs; +- final List _vectorOfDoubles; +- final my_game.InParentNamespaceObjectBuilder _parentNamespaceTest; +- final List _vectorOfReferrables; +- final int _singleWeakReference; +- final List _vectorOfWeakReferences; +- final List _vectorOfStrongReferrables; +- final int _coOwningReference; +- final List _vectorOfCoOwningReferences; +- final int _nonOwningReference; +- final List _vectorOfNonOwningReferences; +- final AnyUniqueAliasesTypeId _anyUniqueType; ++ final List? _test4; ++ final List? _testarrayofstring; ++ final List? _testarrayoftables; ++ final MonsterObjectBuilder? _enemy; ++ final List? _testnestedflatbuffer; ++ final StatObjectBuilder? _testempty; ++ final bool? _testbool; ++ final int? _testhashs32Fnv1; ++ final int? _testhashu32Fnv1; ++ final int? _testhashs64Fnv1; ++ final int? _testhashu64Fnv1; ++ final int? _testhashs32Fnv1a; ++ final int? _testhashu32Fnv1a; ++ final int? _testhashs64Fnv1a; ++ final int? _testhashu64Fnv1a; ++ final List? _testarrayofbools; ++ final double? _testf; ++ final double? _testf2; ++ final double? _testf3; ++ final List? _testarrayofstring2; ++ final List? _testarrayofsortedstruct; ++ final List? _flex; ++ final List? _test5; ++ final List? _vectorOfLongs; ++ final List? _vectorOfDoubles; ++ final my_game.InParentNamespaceObjectBuilder? _parentNamespaceTest; ++ final List? _vectorOfReferrables; ++ final int? _singleWeakReference; ++ final List? _vectorOfWeakReferences; ++ final List? _vectorOfStrongReferrables; ++ final int? _coOwningReference; ++ final List? _vectorOfCoOwningReferences; ++ final int? _nonOwningReference; ++ final List? _vectorOfNonOwningReferences; ++ final AnyUniqueAliasesTypeId? _anyUniqueType; + final dynamic _anyUnique; +- final AnyAmbiguousAliasesTypeId _anyAmbiguousType; ++ final AnyAmbiguousAliasesTypeId? _anyAmbiguousType; + final dynamic _anyAmbiguous; +- final List _vectorOfEnums; +- final Race _signedEnum; +- final List _testrequirednestedflatbuffer; +- final List _scalarKeySortedTables; ++ final List? _vectorOfEnums; ++ final Race? _signedEnum; ++ final List? _testrequirednestedflatbuffer; ++ final List? _scalarKeySortedTables; + + MonsterObjectBuilder({ +- Vec3ObjectBuilder pos, +- int mana, +- int hp, +- String name, +- List inventory, +- Color color, +- AnyTypeId testType, ++ Vec3ObjectBuilder? pos, ++ int? mana, ++ int? hp, ++ String? name, ++ List? inventory, ++ Color? color, ++ AnyTypeId? testType, + dynamic test, +- List test4, +- List testarrayofstring, +- List testarrayoftables, +- MonsterObjectBuilder enemy, +- List testnestedflatbuffer, +- StatObjectBuilder testempty, +- bool testbool, +- int testhashs32Fnv1, +- int testhashu32Fnv1, +- int testhashs64Fnv1, +- int testhashu64Fnv1, +- int testhashs32Fnv1a, +- int testhashu32Fnv1a, +- int testhashs64Fnv1a, +- int testhashu64Fnv1a, +- List testarrayofbools, +- double testf, +- double testf2, +- double testf3, +- List testarrayofstring2, +- List testarrayofsortedstruct, +- List flex, +- List test5, +- List vectorOfLongs, +- List vectorOfDoubles, +- my_game.InParentNamespaceObjectBuilder parentNamespaceTest, +- List vectorOfReferrables, +- int singleWeakReference, +- List vectorOfWeakReferences, +- List vectorOfStrongReferrables, +- int coOwningReference, +- List vectorOfCoOwningReferences, +- int nonOwningReference, +- List vectorOfNonOwningReferences, +- AnyUniqueAliasesTypeId anyUniqueType, ++ List? test4, ++ List? testarrayofstring, ++ List? testarrayoftables, ++ MonsterObjectBuilder? enemy, ++ List? testnestedflatbuffer, ++ StatObjectBuilder? testempty, ++ bool? testbool, ++ int? testhashs32Fnv1, ++ int? testhashu32Fnv1, ++ int? testhashs64Fnv1, ++ int? testhashu64Fnv1, ++ int? testhashs32Fnv1a, ++ int? testhashu32Fnv1a, ++ int? testhashs64Fnv1a, ++ int? testhashu64Fnv1a, ++ List? testarrayofbools, ++ double? testf, ++ double? testf2, ++ double? testf3, ++ List? testarrayofstring2, ++ List? testarrayofsortedstruct, ++ List? flex, ++ List? test5, ++ List? vectorOfLongs, ++ List? vectorOfDoubles, ++ my_game.InParentNamespaceObjectBuilder? parentNamespaceTest, ++ List? vectorOfReferrables, ++ int? singleWeakReference, ++ List? vectorOfWeakReferences, ++ List? vectorOfStrongReferrables, ++ int? coOwningReference, ++ List? vectorOfCoOwningReferences, ++ int? nonOwningReference, ++ List? vectorOfNonOwningReferences, ++ AnyUniqueAliasesTypeId? anyUniqueType, + dynamic anyUnique, +- AnyAmbiguousAliasesTypeId anyAmbiguousType, ++ AnyAmbiguousAliasesTypeId? anyAmbiguousType, + dynamic anyAmbiguous, +- List vectorOfEnums, +- Race signedEnum, +- List testrequirednestedflatbuffer, +- List scalarKeySortedTables, ++ List? vectorOfEnums, ++ Race? signedEnum, ++ List? testrequirednestedflatbuffer, ++ List? scalarKeySortedTables, + }) + : _pos = pos, + _mana = mana, +@@ -1271,112 +1787,72 @@ + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- final int nameOffset = fbBuilder.writeString(_name); +- final int inventoryOffset = _inventory?.isNotEmpty == true +- ? fbBuilder.writeListUint8(_inventory) +- : null; +- final int testOffset = _test?.getOrCreateOffset(fbBuilder); +- final int test4Offset = _test4?.isNotEmpty == true +- ? fbBuilder.writeListOfStructs(_test4) +- : null; +- final int testarrayofstringOffset = _testarrayofstring?.isNotEmpty == true +- ? fbBuilder.writeList(_testarrayofstring.map((b) => fbBuilder.writeString(b)).toList()) +- : null; +- final int testarrayoftablesOffset = _testarrayoftables?.isNotEmpty == true +- ? fbBuilder.writeList(_testarrayoftables.map((b) => b.getOrCreateOffset(fbBuilder)).toList()) +- : null; +- final int enemyOffset = _enemy?.getOrCreateOffset(fbBuilder); +- final int testnestedflatbufferOffset = _testnestedflatbuffer?.isNotEmpty == true +- ? fbBuilder.writeListUint8(_testnestedflatbuffer) +- : null; +- final int testemptyOffset = _testempty?.getOrCreateOffset(fbBuilder); +- final int testarrayofboolsOffset = _testarrayofbools?.isNotEmpty == true +- ? fbBuilder.writeListBool(_testarrayofbools) +- : null; +- final int testarrayofstring2Offset = _testarrayofstring2?.isNotEmpty == true +- ? fbBuilder.writeList(_testarrayofstring2.map((b) => fbBuilder.writeString(b)).toList()) +- : null; +- final int testarrayofsortedstructOffset = _testarrayofsortedstruct?.isNotEmpty == true +- ? fbBuilder.writeListOfStructs(_testarrayofsortedstruct) +- : null; +- final int flexOffset = _flex?.isNotEmpty == true +- ? fbBuilder.writeListUint8(_flex) +- : null; +- final int test5Offset = _test5?.isNotEmpty == true +- ? fbBuilder.writeListOfStructs(_test5) +- : null; +- final int vectorOfLongsOffset = _vectorOfLongs?.isNotEmpty == true +- ? fbBuilder.writeListInt64(_vectorOfLongs) +- : null; +- final int vectorOfDoublesOffset = _vectorOfDoubles?.isNotEmpty == true +- ? fbBuilder.writeListFloat64(_vectorOfDoubles) +- : null; +- final int parentNamespaceTestOffset = _parentNamespaceTest?.getOrCreateOffset(fbBuilder); +- final int vectorOfReferrablesOffset = _vectorOfReferrables?.isNotEmpty == true +- ? fbBuilder.writeList(_vectorOfReferrables.map((b) => b.getOrCreateOffset(fbBuilder)).toList()) +- : null; +- final int vectorOfWeakReferencesOffset = _vectorOfWeakReferences?.isNotEmpty == true +- ? fbBuilder.writeListUint64(_vectorOfWeakReferences) +- : null; +- final int vectorOfStrongReferrablesOffset = _vectorOfStrongReferrables?.isNotEmpty == true +- ? fbBuilder.writeList(_vectorOfStrongReferrables.map((b) => b.getOrCreateOffset(fbBuilder)).toList()) +- : null; +- final int vectorOfCoOwningReferencesOffset = _vectorOfCoOwningReferences?.isNotEmpty == true +- ? fbBuilder.writeListUint64(_vectorOfCoOwningReferences) +- : null; +- final int vectorOfNonOwningReferencesOffset = _vectorOfNonOwningReferences?.isNotEmpty == true +- ? fbBuilder.writeListUint64(_vectorOfNonOwningReferences) +- : null; +- final int anyUniqueOffset = _anyUnique?.getOrCreateOffset(fbBuilder); +- final int anyAmbiguousOffset = _anyAmbiguous?.getOrCreateOffset(fbBuilder); +- final int vectorOfEnumsOffset = _vectorOfEnums?.isNotEmpty == true +- ? fbBuilder.writeListUint8(_vectorOfEnums.map((f) => f.value)) +- : null; +- final int testrequirednestedflatbufferOffset = _testrequirednestedflatbuffer?.isNotEmpty == true +- ? fbBuilder.writeListUint8(_testrequirednestedflatbuffer) +- : null; +- final int scalarKeySortedTablesOffset = _scalarKeySortedTables?.isNotEmpty == true +- ? fbBuilder.writeList(_scalarKeySortedTables.map((b) => b.getOrCreateOffset(fbBuilder)).toList()) +- : null; +- +- fbBuilder.startTable(); ++ int finish(fb.Builder fbBuilder) { ++ final int? nameOffset = _name == null ? null ++ : fbBuilder.writeString(_name!); ++ final int? inventoryOffset = _inventory == null ? null ++ : fbBuilder.writeListUint8(_inventory!); ++ final int? testOffset = _test?.getOrCreateOffset(fbBuilder); ++ final int? test4Offset = _test4 == null ? null ++ : fbBuilder.writeListOfStructs(_test4!); ++ final int? testarrayofstringOffset = _testarrayofstring == null ? null ++ : fbBuilder.writeList(_testarrayofstring!.map(fbBuilder.writeString).toList()); ++ final int? testarrayoftablesOffset = _testarrayoftables == null ? null ++ : fbBuilder.writeList(_testarrayoftables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); ++ final int? enemyOffset = _enemy?.getOrCreateOffset(fbBuilder); ++ final int? testnestedflatbufferOffset = _testnestedflatbuffer == null ? null ++ : fbBuilder.writeListUint8(_testnestedflatbuffer!); ++ final int? testemptyOffset = _testempty?.getOrCreateOffset(fbBuilder); ++ final int? testarrayofboolsOffset = _testarrayofbools == null ? null ++ : fbBuilder.writeListBool(_testarrayofbools!); ++ final int? testarrayofstring2Offset = _testarrayofstring2 == null ? null ++ : fbBuilder.writeList(_testarrayofstring2!.map(fbBuilder.writeString).toList()); ++ final int? testarrayofsortedstructOffset = _testarrayofsortedstruct == null ? null ++ : fbBuilder.writeListOfStructs(_testarrayofsortedstruct!); ++ final int? flexOffset = _flex == null ? null ++ : fbBuilder.writeListUint8(_flex!); ++ final int? test5Offset = _test5 == null ? null ++ : fbBuilder.writeListOfStructs(_test5!); ++ final int? vectorOfLongsOffset = _vectorOfLongs == null ? null ++ : fbBuilder.writeListInt64(_vectorOfLongs!); ++ final int? vectorOfDoublesOffset = _vectorOfDoubles == null ? null ++ : fbBuilder.writeListFloat64(_vectorOfDoubles!); ++ final int? parentNamespaceTestOffset = _parentNamespaceTest?.getOrCreateOffset(fbBuilder); ++ final int? vectorOfReferrablesOffset = _vectorOfReferrables == null ? null ++ : fbBuilder.writeList(_vectorOfReferrables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); ++ final int? vectorOfWeakReferencesOffset = _vectorOfWeakReferences == null ? null ++ : fbBuilder.writeListUint64(_vectorOfWeakReferences!); ++ final int? vectorOfStrongReferrablesOffset = _vectorOfStrongReferrables == null ? null ++ : fbBuilder.writeList(_vectorOfStrongReferrables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); ++ final int? vectorOfCoOwningReferencesOffset = _vectorOfCoOwningReferences == null ? null ++ : fbBuilder.writeListUint64(_vectorOfCoOwningReferences!); ++ final int? vectorOfNonOwningReferencesOffset = _vectorOfNonOwningReferences == null ? null ++ : fbBuilder.writeListUint64(_vectorOfNonOwningReferences!); ++ final int? anyUniqueOffset = _anyUnique?.getOrCreateOffset(fbBuilder); ++ final int? anyAmbiguousOffset = _anyAmbiguous?.getOrCreateOffset(fbBuilder); ++ final int? vectorOfEnumsOffset = _vectorOfEnums == null ? null ++ : fbBuilder.writeListUint8(_vectorOfEnums!.map((f) => f.value).toList()); ++ final int? testrequirednestedflatbufferOffset = _testrequirednestedflatbuffer == null ? null ++ : fbBuilder.writeListUint8(_testrequirednestedflatbuffer!); ++ final int? scalarKeySortedTablesOffset = _scalarKeySortedTables == null ? null ++ : fbBuilder.writeList(_scalarKeySortedTables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList()); ++ fbBuilder.startTable(50); + if (_pos != null) { +- fbBuilder.addStruct(0, _pos.finish(fbBuilder)); ++ fbBuilder.addStruct(0, _pos!.finish(fbBuilder)); + } + fbBuilder.addInt16(1, _mana); + fbBuilder.addInt16(2, _hp); +- if (nameOffset != null) { +- fbBuilder.addOffset(3, nameOffset); +- } +- if (inventoryOffset != null) { +- fbBuilder.addOffset(5, inventoryOffset); +- } ++ fbBuilder.addOffset(3, nameOffset); ++ fbBuilder.addOffset(5, inventoryOffset); + fbBuilder.addUint8(6, _color?.value); + fbBuilder.addUint8(7, _testType?.value); +- if (testOffset != null) { +- fbBuilder.addOffset(8, testOffset); +- } +- if (test4Offset != null) { +- fbBuilder.addOffset(9, test4Offset); +- } +- if (testarrayofstringOffset != null) { +- fbBuilder.addOffset(10, testarrayofstringOffset); +- } +- if (testarrayoftablesOffset != null) { +- fbBuilder.addOffset(11, testarrayoftablesOffset); +- } +- if (enemyOffset != null) { +- fbBuilder.addOffset(12, enemyOffset); +- } +- if (testnestedflatbufferOffset != null) { +- fbBuilder.addOffset(13, testnestedflatbufferOffset); +- } +- if (testemptyOffset != null) { +- fbBuilder.addOffset(14, testemptyOffset); +- } ++ fbBuilder.addOffset(8, testOffset); ++ fbBuilder.addOffset(9, test4Offset); ++ fbBuilder.addOffset(10, testarrayofstringOffset); ++ fbBuilder.addOffset(11, testarrayoftablesOffset); ++ fbBuilder.addOffset(12, enemyOffset); ++ fbBuilder.addOffset(13, testnestedflatbufferOffset); ++ fbBuilder.addOffset(14, testemptyOffset); + fbBuilder.addBool(15, _testbool); + fbBuilder.addInt32(16, _testhashs32Fnv1); + fbBuilder.addUint32(17, _testhashu32Fnv1); +@@ -1386,88 +1862,52 @@ + fbBuilder.addUint32(21, _testhashu32Fnv1a); + fbBuilder.addInt64(22, _testhashs64Fnv1a); + fbBuilder.addUint64(23, _testhashu64Fnv1a); +- if (testarrayofboolsOffset != null) { +- fbBuilder.addOffset(24, testarrayofboolsOffset); +- } ++ fbBuilder.addOffset(24, testarrayofboolsOffset); + fbBuilder.addFloat32(25, _testf); + fbBuilder.addFloat32(26, _testf2); + fbBuilder.addFloat32(27, _testf3); +- if (testarrayofstring2Offset != null) { +- fbBuilder.addOffset(28, testarrayofstring2Offset); +- } +- if (testarrayofsortedstructOffset != null) { +- fbBuilder.addOffset(29, testarrayofsortedstructOffset); +- } +- if (flexOffset != null) { +- fbBuilder.addOffset(30, flexOffset); +- } +- if (test5Offset != null) { +- fbBuilder.addOffset(31, test5Offset); +- } +- if (vectorOfLongsOffset != null) { +- fbBuilder.addOffset(32, vectorOfLongsOffset); +- } +- if (vectorOfDoublesOffset != null) { +- fbBuilder.addOffset(33, vectorOfDoublesOffset); +- } +- if (parentNamespaceTestOffset != null) { +- fbBuilder.addOffset(34, parentNamespaceTestOffset); +- } +- if (vectorOfReferrablesOffset != null) { +- fbBuilder.addOffset(35, vectorOfReferrablesOffset); +- } ++ fbBuilder.addOffset(28, testarrayofstring2Offset); ++ fbBuilder.addOffset(29, testarrayofsortedstructOffset); ++ fbBuilder.addOffset(30, flexOffset); ++ fbBuilder.addOffset(31, test5Offset); ++ fbBuilder.addOffset(32, vectorOfLongsOffset); ++ fbBuilder.addOffset(33, vectorOfDoublesOffset); ++ fbBuilder.addOffset(34, parentNamespaceTestOffset); ++ fbBuilder.addOffset(35, vectorOfReferrablesOffset); + fbBuilder.addUint64(36, _singleWeakReference); +- if (vectorOfWeakReferencesOffset != null) { +- fbBuilder.addOffset(37, vectorOfWeakReferencesOffset); +- } +- if (vectorOfStrongReferrablesOffset != null) { +- fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset); +- } ++ fbBuilder.addOffset(37, vectorOfWeakReferencesOffset); ++ fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset); + fbBuilder.addUint64(39, _coOwningReference); +- if (vectorOfCoOwningReferencesOffset != null) { +- fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset); +- } ++ fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset); + fbBuilder.addUint64(41, _nonOwningReference); +- if (vectorOfNonOwningReferencesOffset != null) { +- fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset); +- } ++ fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset); + fbBuilder.addUint8(43, _anyUniqueType?.value); +- if (anyUniqueOffset != null) { +- fbBuilder.addOffset(44, anyUniqueOffset); +- } ++ fbBuilder.addOffset(44, anyUniqueOffset); + fbBuilder.addUint8(45, _anyAmbiguousType?.value); +- if (anyAmbiguousOffset != null) { +- fbBuilder.addOffset(46, anyAmbiguousOffset); +- } +- if (vectorOfEnumsOffset != null) { +- fbBuilder.addOffset(47, vectorOfEnumsOffset); +- } ++ fbBuilder.addOffset(46, anyAmbiguousOffset); ++ fbBuilder.addOffset(47, vectorOfEnumsOffset); + fbBuilder.addInt8(48, _signedEnum?.value); +- if (testrequirednestedflatbufferOffset != null) { +- fbBuilder.addOffset(49, testrequirednestedflatbufferOffset); +- } +- if (scalarKeySortedTablesOffset != null) { +- fbBuilder.addOffset(50, scalarKeySortedTablesOffset); +- } ++ fbBuilder.addOffset(49, testrequirednestedflatbufferOffset); ++ fbBuilder.addOffset(50, scalarKeySortedTablesOffset); + return fbBuilder.endTable(); + } + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } + class TypeAliases { + TypeAliases._(this._bc, this._bcOffset); + factory TypeAliases(List bytes) { +- fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); ++ final rootRef = fb.BufferContext.fromBytes(bytes); + return reader.read(rootRef, 0); + } + +- static const fb.Reader reader = const _TypeAliasesReader(); ++ static const fb.Reader reader = _TypeAliasesReader(); + + final fb.BufferContext _bc; + final int _bcOffset; +@@ -1482,13 +1922,88 @@ + int get u64 => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 18, 0); + double get f32 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 20, 0.0); + double get f64 => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 22, 0.0); +- List get v8 => const fb.ListReader(const fb.Int8Reader()).vTableGet(_bc, _bcOffset, 24, null); +- List get vf64 => const fb.ListReader(const fb.Float64Reader()).vTableGet(_bc, _bcOffset, 26, null); ++ List? get v8 => const fb.Int8ListReader().vTableGetNullable(_bc, _bcOffset, 24); ++ List? get vf64 => const fb.ListReader(fb.Float64Reader()).vTableGetNullable(_bc, _bcOffset, 26); + + @override + String toString() { + return 'TypeAliases{i8: $i8, u8: $u8, i16: $i16, u16: $u16, i32: $i32, u32: $u32, i64: $i64, u64: $u64, f32: $f32, f64: $f64, v8: $v8, vf64: $vf64}'; + } ++ ++ TypeAliasesT unpack() => TypeAliasesT( ++ i8: i8, ++ u8: u8, ++ i16: i16, ++ u16: u16, ++ i32: i32, ++ u32: u32, ++ i64: i64, ++ u64: u64, ++ f32: f32, ++ f64: f64, ++ v8: const fb.Int8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 24), ++ vf64: const fb.ListReader(fb.Float64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 26)); ++ ++ static int pack(fb.Builder fbBuilder, TypeAliasesT? object) { ++ if (object == null) return 0; ++ return object.pack(fbBuilder); ++ } ++} ++ ++class TypeAliasesT implements fb.Packable { ++ int i8; ++ int u8; ++ int i16; ++ int u16; ++ int i32; ++ int u32; ++ int i64; ++ int u64; ++ double f32; ++ double f64; ++ List? v8; ++ List? vf64; ++ ++ TypeAliasesT({ ++ this.i8 = 0, ++ this.u8 = 0, ++ this.i16 = 0, ++ this.u16 = 0, ++ this.i32 = 0, ++ this.u32 = 0, ++ this.i64 = 0, ++ this.u64 = 0, ++ this.f32 = 0.0, ++ this.f64 = 0.0, ++ this.v8, ++ this.vf64}); ++ ++ @override ++ int pack(fb.Builder fbBuilder) { ++ final int? v8Offset = v8 == null ? null ++ : fbBuilder.writeListInt8(v8!); ++ final int? vf64Offset = vf64 == null ? null ++ : fbBuilder.writeListFloat64(vf64!); ++ fbBuilder.startTable(12); ++ fbBuilder.addInt8(0, i8); ++ fbBuilder.addUint8(1, u8); ++ fbBuilder.addInt16(2, i16); ++ fbBuilder.addUint16(3, u16); ++ fbBuilder.addInt32(4, i32); ++ fbBuilder.addUint32(5, u32); ++ fbBuilder.addInt64(6, i64); ++ fbBuilder.addUint64(7, u64); ++ fbBuilder.addFloat32(8, f32); ++ fbBuilder.addFloat64(9, f64); ++ fbBuilder.addOffset(10, v8Offset); ++ fbBuilder.addOffset(11, vf64Offset); ++ return fbBuilder.endTable(); ++ } ++ ++ @override ++ String toString() { ++ return 'TypeAliasesT{i8: $i8, u8: $u8, i16: $i16, u16: $u16, i32: $i32, u32: $u32, i64: $i64, u64: $u64, f32: $f32, f64: $f64, v8: $v8, vf64: $vf64}'; ++ } + } + + class _TypeAliasesReader extends fb.TableReader { +@@ -1496,65 +2011,63 @@ + + @override + TypeAliases createObject(fb.BufferContext bc, int offset) => +- new TypeAliases._(bc, offset); ++ TypeAliases._(bc, offset); + } + + class TypeAliasesBuilder { +- TypeAliasesBuilder(this.fbBuilder) { +- assert(fbBuilder != null); +- } ++ TypeAliasesBuilder(this.fbBuilder); + + final fb.Builder fbBuilder; + + void begin() { +- fbBuilder.startTable(); ++ fbBuilder.startTable(12); + } + +- int addI8(int i8) { ++ int addI8(int? i8) { + fbBuilder.addInt8(0, i8); + return fbBuilder.offset; + } +- int addU8(int u8) { ++ int addU8(int? u8) { + fbBuilder.addUint8(1, u8); + return fbBuilder.offset; + } +- int addI16(int i16) { ++ int addI16(int? i16) { + fbBuilder.addInt16(2, i16); + return fbBuilder.offset; + } +- int addU16(int u16) { ++ int addU16(int? u16) { + fbBuilder.addUint16(3, u16); + return fbBuilder.offset; + } +- int addI32(int i32) { ++ int addI32(int? i32) { + fbBuilder.addInt32(4, i32); + return fbBuilder.offset; + } +- int addU32(int u32) { ++ int addU32(int? u32) { + fbBuilder.addUint32(5, u32); + return fbBuilder.offset; + } +- int addI64(int i64) { ++ int addI64(int? i64) { + fbBuilder.addInt64(6, i64); + return fbBuilder.offset; + } +- int addU64(int u64) { ++ int addU64(int? u64) { + fbBuilder.addUint64(7, u64); + return fbBuilder.offset; + } +- int addF32(double f32) { ++ int addF32(double? f32) { + fbBuilder.addFloat32(8, f32); + return fbBuilder.offset; + } +- int addF64(double f64) { ++ int addF64(double? f64) { + fbBuilder.addFloat64(9, f64); + return fbBuilder.offset; + } +- int addV8Offset(int offset) { ++ int addV8Offset(int? offset) { + fbBuilder.addOffset(10, offset); + return fbBuilder.offset; + } +- int addVf64Offset(int offset) { ++ int addVf64Offset(int? offset) { + fbBuilder.addOffset(11, offset); + return fbBuilder.offset; + } +@@ -1565,32 +2078,32 @@ + } + + class TypeAliasesObjectBuilder extends fb.ObjectBuilder { +- final int _i8; +- final int _u8; +- final int _i16; +- final int _u16; +- final int _i32; +- final int _u32; +- final int _i64; +- final int _u64; +- final double _f32; +- final double _f64; +- final List _v8; +- final List _vf64; ++ final int? _i8; ++ final int? _u8; ++ final int? _i16; ++ final int? _u16; ++ final int? _i32; ++ final int? _u32; ++ final int? _i64; ++ final int? _u64; ++ final double? _f32; ++ final double? _f64; ++ final List? _v8; ++ final List? _vf64; + + TypeAliasesObjectBuilder({ +- int i8, +- int u8, +- int i16, +- int u16, +- int i32, +- int u32, +- int i64, +- int u64, +- double f32, +- double f64, +- List v8, +- List vf64, ++ int? i8, ++ int? u8, ++ int? i16, ++ int? u16, ++ int? i32, ++ int? u32, ++ int? i64, ++ int? u64, ++ double? f32, ++ double? f64, ++ List? v8, ++ List? vf64, + }) + : _i8 = i8, + _u8 = u8, +@@ -1607,17 +2120,12 @@ + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- final int v8Offset = _v8?.isNotEmpty == true +- ? fbBuilder.writeListInt8(_v8) +- : null; +- final int vf64Offset = _vf64?.isNotEmpty == true +- ? fbBuilder.writeListFloat64(_vf64) +- : null; +- +- fbBuilder.startTable(); ++ int finish(fb.Builder fbBuilder) { ++ final int? v8Offset = _v8 == null ? null ++ : fbBuilder.writeListInt8(_v8!); ++ final int? vf64Offset = _vf64 == null ? null ++ : fbBuilder.writeListFloat64(_vf64!); ++ fbBuilder.startTable(12); + fbBuilder.addInt8(0, _i8); + fbBuilder.addUint8(1, _u8); + fbBuilder.addInt16(2, _i16); +@@ -1628,20 +2136,16 @@ + fbBuilder.addUint64(7, _u64); + fbBuilder.addFloat32(8, _f32); + fbBuilder.addFloat64(9, _f64); +- if (v8Offset != null) { +- fbBuilder.addOffset(10, v8Offset); +- } +- if (vf64Offset != null) { +- fbBuilder.addOffset(11, vf64Offset); +- } ++ fbBuilder.addOffset(10, v8Offset); ++ fbBuilder.addOffset(11, vf64Offset); + return fbBuilder.endTable(); + } + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } +diff -urN a/dart/test/monster_test_my_game_generated.dart b/dart/test/monster_test_my_game_generated.dart +--- a/dart/test/monster_test_my_game_generated.dart 2021-05-10 18:45:16.000000000 +0000 ++++ b/dart/test/monster_test_my_game_generated.dart 2023-01-13 07:47:12.571286153 +0000 +@@ -1,5 +1,5 @@ + // automatically generated by the FlatBuffers compiler, do not modify +-// ignore_for_file: unused_import, unused_field, unused_local_variable ++// ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable + + library my_game; + +@@ -12,11 +12,11 @@ + class InParentNamespace { + InParentNamespace._(this._bc, this._bcOffset); + factory InParentNamespace(List bytes) { +- fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes); ++ final rootRef = fb.BufferContext.fromBytes(bytes); + return reader.read(rootRef, 0); + } + +- static const fb.Reader reader = const _InParentNamespaceReader(); ++ static const fb.Reader reader = _InParentNamespaceReader(); + + final fb.BufferContext _bc; + final int _bcOffset; +@@ -26,6 +26,26 @@ + String toString() { + return 'InParentNamespace{}'; + } ++ ++ InParentNamespaceT unpack() => InParentNamespaceT(); ++ ++ static int pack(fb.Builder fbBuilder, InParentNamespaceT? object) { ++ if (object == null) return 0; ++ return object.pack(fbBuilder); ++ } ++} ++ ++class InParentNamespaceT implements fb.Packable { ++ @override ++ int pack(fb.Builder fbBuilder) { ++ fbBuilder.startTable(0); ++ return fbBuilder.endTable(); ++ } ++ ++ @override ++ String toString() { ++ return 'InParentNamespaceT{}'; ++ } + } + + class _InParentNamespaceReader extends fb.TableReader { +@@ -33,7 +53,7 @@ + + @override + InParentNamespace createObject(fb.BufferContext bc, int offset) => +- new InParentNamespace._(bc, offset); ++ InParentNamespace._(bc, offset); + } + + class InParentNamespaceObjectBuilder extends fb.ObjectBuilder { +@@ -42,19 +62,16 @@ + + /// Finish building, and store into the [fbBuilder]. + @override +- int finish( +- fb.Builder fbBuilder) { +- assert(fbBuilder != null); +- +- fbBuilder.startTable(); ++ int finish(fb.Builder fbBuilder) { ++ fbBuilder.startTable(0); + return fbBuilder.endTable(); + } + + /// Convenience method to serialize to byte list. + @override +- Uint8List toBytes([String fileIdentifier]) { +- fb.Builder fbBuilder = new fb.Builder(); +- int offset = finish(fbBuilder); +- return fbBuilder.finish(offset, fileIdentifier); ++ Uint8List toBytes([String? fileIdentifier]) { ++ final fbBuilder = fb.Builder(deduplicateTables: false); ++ fbBuilder.finish(finish(fbBuilder), fileIdentifier); ++ return fbBuilder.buffer; + } + } +Binary files a/dart/test/monsterdata_test.mon and b/dart/test/monsterdata_test.mon differ +diff -urN a/grpc/README.md b/grpc/README.md +--- a/grpc/README.md 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/README.md 2023-01-13 07:46:49.749075383 +0000 +@@ -32,9 +32,8 @@ + + ### Linux + +-1. `ln -s ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.6 ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.1` +-2. `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GRPC_INSTALL_PATH}/lib` +-3. `make test ARGS=-V` ++1. `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GRPC_INSTALL_PATH}/lib` ++2. `make test ARGS=-V` + + For Bazel users: + +diff -urN a/grpc/build_grpc.sh b/grpc/build_grpc.sh +--- a/grpc/build_grpc.sh 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/build_grpc.sh 2023-01-13 07:46:49.750075393 +0000 +@@ -1,11 +1,11 @@ + #!/bin/bash + +-grpc_1_36_0_githash=736e3758351ced3cd842bad3ba4e2540f01bbc48 ++grpc_1_39_0_githash=58602e20a3f3e48f24a4114c757099b25b947f7b + + function build_grpc () { + git clone https://github.com/grpc/grpc.git google/grpc + cd google/grpc +- git checkout ${grpc_1_36_0_githash} ++ git checkout ${grpc_1_39_0_githash} + git submodule update --init + # Apply boringssl build patch + cd third_party/boringssl-with-bazel +@@ -13,11 +13,8 @@ + cd ../.. + mkdir ../grpc_build + cd ../grpc_build +- cmake ../grpc -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=`pwd`/../grpc/install ++ cmake ../grpc -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DABSL_ENABLE_INSTALL=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=`pwd`/../grpc/install + cmake --build . --target install ${JOBS:+-j$JOBS} +- if [ ! -f ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.1 ]; then +- ln -s ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.6 ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.1 +- fi + cd ../.. + } + +diff -urN a/grpc/examples/generate.sh b/grpc/examples/generate.sh +--- a/grpc/examples/generate.sh 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/generate.sh 2023-01-13 07:46:51.179088589 +0000 +@@ -41,7 +41,7 @@ + cd go + + cd greeter +-fbc --go ${generator} ++fbc --bfbs-filenames ../.. --go ${generator} + + cd ${current_dir} + +@@ -50,7 +50,7 @@ + + cd greeter + +-fbc --python ${generator} ++fbc --bfbs-filenames ../.. --python ${generator} + + cd ${current_dir} + +@@ -58,7 +58,7 @@ + cd swift + + cd Greeter/Sources/Model +-fbc --swift ${generator} ++fbc --bfbs-filenames ../../../.. --swift --gen-json-emit ${generator} + + cd ${current_dir} + +@@ -66,6 +66,6 @@ + cd ts + + cd greeter/src +-fbc --ts ${generator} ++fbc --bfbs-filenames ../../.. --ts ${generator} + + cd ${current_dir} +diff -urN a/grpc/examples/go/greeter/server/go.mod b/grpc/examples/go/greeter/server/go.mod +--- a/grpc/examples/go/greeter/server/go.mod 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/go/greeter/server/go.mod 2023-01-13 07:46:51.829094592 +0000 +@@ -7,5 +7,5 @@ + require ( + github.com/google/flatbuffers v1.12.0 + github.com/google/flatbuffers/grpc/examples/go/greeter/models v0.0.0 +- google.golang.org/grpc v1.35.0 ++ google.golang.org/grpc v1.39.0-dev + ) +diff -urN a/grpc/examples/go/greeter/server/main.go b/grpc/examples/go/greeter/server/main.go +--- a/grpc/examples/go/greeter/server/main.go 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/go/greeter/server/main.go 2023-01-13 07:46:51.905095294 +0000 +@@ -9,7 +9,6 @@ + flatbuffers "github.com/google/flatbuffers/go" + models "github.com/google/flatbuffers/grpc/examples/go/greeter/models" + "google.golang.org/grpc" +- "google.golang.org/grpc/encoding" + ) + + var ( +@@ -68,8 +67,8 @@ + if err != nil { + log.Fatalf("failed to listen: %v", err) + } +- grpcServer := grpc.NewServer() +- encoding.RegisterCodec(flatbuffers.FlatbuffersCodec{}) ++ codec := &flatbuffers.FlatbuffersCodec{} ++ grpcServer := grpc.NewServer(grpc.ForceServerCodec(codec)) + models.RegisterGreeterServer(grpcServer, newServer()) + if err := grpcServer.Serve(lis); err != nil { + fmt.Print(err) +diff -urN a/grpc/examples/python/greeter/models/HelloReply.py b/grpc/examples/python/greeter/models/HelloReply.py +--- a/grpc/examples/python/greeter/models/HelloReply.py 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/python/greeter/models/HelloReply.py 2023-01-13 07:46:52.184097871 +0000 +@@ -31,15 +31,12 @@ + return self._tab.String(o + self._tab.Pos) + return None + +-def Start(builder): builder.StartObject(1) +-def HelloReplyStart(builder): +- """This method is deprecated. Please switch to Start.""" +- return Start(builder) +-def AddMessage(builder, message): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(message), 0) +-def HelloReplyAddMessage(builder, message): +- """This method is deprecated. Please switch to AddMessage.""" +- return AddMessage(builder, message) +-def End(builder): return builder.EndObject() +-def HelloReplyEnd(builder): +- """This method is deprecated. Please switch to End.""" +- return End(builder) +\ No newline at end of file ++def HelloReplyStart(builder): builder.StartObject(1) ++def Start(builder): ++ return HelloReplyStart(builder) ++def HelloReplyAddMessage(builder, message): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(message), 0) ++def AddMessage(builder, message): ++ return HelloReplyAddMessage(builder, message) ++def HelloReplyEnd(builder): return builder.EndObject() ++def End(builder): ++ return HelloReplyEnd(builder) +\ No newline at end of file +diff -urN a/grpc/examples/python/greeter/models/HelloRequest.py b/grpc/examples/python/greeter/models/HelloRequest.py +--- a/grpc/examples/python/greeter/models/HelloRequest.py 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/python/greeter/models/HelloRequest.py 2023-01-13 07:46:52.184097871 +0000 +@@ -31,15 +31,12 @@ + return self._tab.String(o + self._tab.Pos) + return None + +-def Start(builder): builder.StartObject(1) +-def HelloRequestStart(builder): +- """This method is deprecated. Please switch to Start.""" +- return Start(builder) +-def AddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) +-def HelloRequestAddName(builder, name): +- """This method is deprecated. Please switch to AddName.""" +- return AddName(builder, name) +-def End(builder): return builder.EndObject() +-def HelloRequestEnd(builder): +- """This method is deprecated. Please switch to End.""" +- return End(builder) +\ No newline at end of file ++def HelloRequestStart(builder): builder.StartObject(1) ++def Start(builder): ++ return HelloRequestStart(builder) ++def HelloRequestAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) ++def AddName(builder, name): ++ return HelloRequestAddName(builder, name) ++def HelloRequestEnd(builder): return builder.EndObject() ++def End(builder): ++ return HelloRequestEnd(builder) +\ No newline at end of file +diff -urN a/grpc/examples/swift/Greeter/Sources/Model/greeter_generated.swift b/grpc/examples/swift/Greeter/Sources/Model/greeter_generated.swift +--- a/grpc/examples/swift/Greeter/Sources/Model/greeter_generated.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/swift/Greeter/Sources/Model/greeter_generated.swift 2023-01-13 07:46:52.175097788 +0000 +@@ -4,7 +4,7 @@ + + import FlatBuffers + +-public struct models_HelloReply: FlatBufferObject { ++public struct models_HelloReply: FlatBufferObject, Verifiable { + + static func validateVersion() { FlatBuffersVersion_2_0_0() } + public var __buffer: ByteBuffer! { return _accessor.bb } +@@ -34,9 +34,26 @@ + models_HelloReply.add(message: message, &fbb) + return models_HelloReply.endHelloReply(&fbb, start: __start) + } ++ ++ public static func verify(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable { ++ var _v = try verifier.visitTable(at: position) ++ try _v.visit(field: VTOFFSET.message.p, fieldName: "message", required: false, type: ForwardOffset.self) ++ _v.finish() ++ } ++} ++ ++extension models_HelloReply: Encodable { ++ ++ enum CodingKeys: String, CodingKey { ++ case message = "message" ++ } ++ public func encode(to encoder: Encoder) throws { ++ var container = encoder.container(keyedBy: CodingKeys.self) ++ try container.encodeIfPresent(message, forKey: .message) ++ } + } + +-public struct models_HelloRequest: FlatBufferObject { ++public struct models_HelloRequest: FlatBufferObject, Verifiable { + + static func validateVersion() { FlatBuffersVersion_2_0_0() } + public var __buffer: ByteBuffer! { return _accessor.bb } +@@ -66,5 +83,22 @@ + models_HelloRequest.add(name: name, &fbb) + return models_HelloRequest.endHelloRequest(&fbb, start: __start) + } ++ ++ public static func verify(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws where T: Verifiable { ++ var _v = try verifier.visitTable(at: position) ++ try _v.visit(field: VTOFFSET.name.p, fieldName: "name", required: false, type: ForwardOffset.self) ++ _v.finish() ++ } ++} ++ ++extension models_HelloRequest: Encodable { ++ ++ enum CodingKeys: String, CodingKey { ++ case name = "name" ++ } ++ public func encode(to encoder: Encoder) throws { ++ var container = encoder.container(keyedBy: CodingKeys.self) ++ try container.encodeIfPresent(name, forKey: .name) ++ } + } + +diff -urN a/grpc/examples/swift/Greeter/Sources/client/main.swift b/grpc/examples/swift/Greeter/Sources/client/main.swift +--- a/grpc/examples/swift/Greeter/Sources/client/main.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/swift/Greeter/Sources/client/main.swift 2023-01-13 07:46:52.182097852 +0000 +@@ -37,7 +37,8 @@ + builder.finish(offset: root) + + // Make the RPC call to the server. +- let sayHello = greeter.SayHello(Message(builder: &builder)) ++ let sayHello = greeter ++ .SayHello(Message(builder: &builder)) + + // wait() on the response to stop the program from exiting before the response is received. + do { +@@ -54,7 +55,8 @@ + builder.finish(offset: manyRoot) + + let call = greeter.SayManyHellos(Message(builder: &builder)) { message in +- print("Greeter SayManyHellos received: \(message.object.message ?? "Unknown")") ++ print( ++ "Greeter SayManyHellos received: \(message.object.message ?? "Unknown")") + } + + let status = try! call.status.recover { _ in .processingError }.wait() +diff -urN a/grpc/examples/swift/Greeter/Sources/server/main.swift b/grpc/examples/swift/Greeter/Sources/server/main.swift +--- a/grpc/examples/swift/Greeter/Sources/server/main.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/swift/Greeter/Sources/server/main.swift 2023-01-13 07:46:52.183097861 +0000 +@@ -32,7 +32,8 @@ + + func SayHello( + request: Message, +- context: StatusOnlyCallContext) -> EventLoopFuture> ++ context: StatusOnlyCallContext) ++ -> EventLoopFuture> + { + let recipient = request.object.name ?? "Stranger" + +@@ -40,17 +41,22 @@ + let off = builder.create(string: "Hello \(recipient)") + let root = models_HelloReply.createHelloReply(&builder, messageOffset: off) + builder.finish(offset: root) +- return context.eventLoop.makeSucceededFuture(Message(builder: &builder)) ++ return context.eventLoop ++ .makeSucceededFuture(Message(builder: &builder)) + } + + func SayManyHellos( + request: Message, +- context: StreamingResponseCallContext>) -> EventLoopFuture ++ context: StreamingResponseCallContext>) ++ -> EventLoopFuture + { + for name in greetings { + var builder = FlatBufferBuilder() +- let off = builder.create(string: "\(name) \(request.object.name ?? "Unknown")") +- let root = models_HelloReply.createHelloReply(&builder, messageOffset: off) ++ let off = builder ++ .create(string: "\(name) \(request.object.name ?? "Unknown")") ++ let root = models_HelloReply.createHelloReply( ++ &builder, ++ messageOffset: off) + builder.finish(offset: root) + _ = context.sendResponse(Message(builder: &builder)) + } +diff -urN a/grpc/examples/ts/greeter/package.json b/grpc/examples/ts/greeter/package.json +--- a/grpc/examples/ts/greeter/package.json 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/ts/greeter/package.json 2023-01-13 07:46:49.812075966 +0000 +@@ -8,7 +8,7 @@ + "server": "node dist/server.js" + }, + "dependencies": { +- "flatbuffers": "^2.0.0", +- "grpc": "^1.24.3" ++ "@grpc/grpc-js": "^1.3.2", ++ "flatbuffers": "^2.0.0" + } + } +diff -urN a/grpc/examples/ts/greeter/src/client.ts b/grpc/examples/ts/greeter/src/client.ts +--- a/grpc/examples/ts/greeter/src/client.ts 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/ts/greeter/src/client.ts 2023-01-13 07:46:49.872076520 +0000 +@@ -1,22 +1,22 @@ +-import grpc from 'grpc'; ++import * as grpc from '@grpc/grpc-js'; ++import * as flatbuffers from 'flatbuffers'; + import { HelloReply } from './models/hello-reply'; + import { HelloRequest } from './models/hello-request'; + import { GreeterClient } from './greeter_grpc'; +-import { flatbuffers } from 'flatbuffers'; + +-async function main(PORT: Number, name: String) { +- const _server = new GreeterClient(`localhost:${PORT}`, grpc.credentials.createInsecure()); ++async function main(PORT: Number, name: string) { ++ const client = new GreeterClient(`localhost:${PORT}`, grpc.credentials.createInsecure()); + const builder = new flatbuffers.Builder(); + const offset = builder.createString(name); + const root = HelloRequest.createHelloRequest(builder, offset); + builder.finish(root); + const buffer = HelloRequest.getRootAsHelloRequest(new flatbuffers.ByteBuffer(builder.asUint8Array())); + +- _server.SayHello(buffer, (err, response) => { ++ client.SayHello(buffer, (err, response) => { + console.log(response.message()); + }); + +- const data = _server.SayManyHellos(buffer, null); ++ const data = client.SayManyHellos(buffer, null); + + data.on('data', (data) => { + console.log(data.message()); +@@ -25,7 +25,7 @@ + + const args = process.argv.slice(2) + const PORT = Number(args[0]); +-const name = String(args[1] ?? "flatbuffers"); ++const name: string = args[1] ?? "flatbuffers"; + + if (PORT) { + main(PORT, name); +diff -urN a/grpc/examples/ts/greeter/src/greeter.ts b/grpc/examples/ts/greeter/src/greeter.ts +--- a/grpc/examples/ts/greeter/src/greeter.ts 1970-01-01 00:00:00.000000000 +0000 ++++ b/grpc/examples/ts/greeter/src/greeter.ts 2023-01-13 07:46:50.096078587 +0000 +@@ -0,0 +1,2 @@ ++export { HelloReply } from './models/hello-reply'; ++export { HelloRequest } from './models/hello-request'; +diff -urN a/grpc/examples/ts/greeter/src/greeter_grpc.d.ts b/grpc/examples/ts/greeter/src/greeter_grpc.d.ts +--- a/grpc/examples/ts/greeter/src/greeter_grpc.d.ts 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/ts/greeter/src/greeter_grpc.d.ts 2023-01-13 07:46:50.963086594 +0000 +@@ -3,7 +3,7 @@ + import { HelloReply as models_HelloReply } from './models/hello-reply'; + import { HelloRequest as models_HelloRequest } from './models/hello-request'; + +-import * as grpc from 'grpc'; ++import * as grpc from '@grpc/grpc-js'; + + interface IGreeterService extends grpc.ServiceDefinition { + SayHello: IGreeterService_ISayHello; +@@ -32,7 +32,7 @@ + + export const GreeterService: IGreeterService; + +-export interface IGreeterServer { ++export interface IGreeterServer extends grpc.UntypedServiceImplementation { + SayHello: grpc.handleUnaryCall; + SayManyHellos: grpc.handleServerStreamingCall; + } +@@ -46,7 +46,8 @@ + } + + export class GreeterClient extends grpc.Client implements IGreeterClient { +- constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); public SayHello(request: models_HelloRequest, callback: (error: grpc.ServiceError | null, response: models_HelloReply) => void): grpc.ClientUnaryCall; ++ constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); ++ public SayHello(request: models_HelloRequest, callback: (error: grpc.ServiceError | null, response: models_HelloReply) => void): grpc.ClientUnaryCall; + public SayHello(request: models_HelloRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: models_HelloReply) => void): grpc.ClientUnaryCall; + public SayHello(request: models_HelloRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: models_HelloReply) => void): grpc.ClientUnaryCall; + public SayManyHellos(request: models_HelloRequest, metadata: grpc.Metadata): grpc.ClientReadableStream; +diff -urN a/grpc/examples/ts/greeter/src/greeter_grpc.js b/grpc/examples/ts/greeter/src/greeter_grpc.js +--- a/grpc/examples/ts/greeter/src/greeter_grpc.js 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/ts/greeter/src/greeter_grpc.js 2023-01-13 07:46:51.057087464 +0000 +@@ -3,13 +3,13 @@ + import { HelloReply as models_HelloReply } from './models/hello-reply'; + import { HelloRequest as models_HelloRequest } from './models/hello-request'; + +-var grpc = require('grpc'); ++var grpc = require('@grpc/grpc-js'); + + function serialize_models_HelloReply(buffer_args) { + if (!(buffer_args instanceof models_HelloReply)) { + throw new Error('Expected argument of type HelloReply'); + } +- return buffer_args.serialize(); ++ return Buffer.from(buffer_args.serialize()); + } + + function deserialize_models_HelloReply(buffer) { +@@ -21,7 +21,7 @@ + if (!(buffer_args instanceof models_HelloRequest)) { + throw new Error('Expected argument of type HelloRequest'); + } +- return buffer_args.serialize(); ++ return Buffer.from(buffer_args.serialize()); + } + + function deserialize_models_HelloRequest(buffer) { +diff -urN a/grpc/examples/ts/greeter/src/server.ts b/grpc/examples/ts/greeter/src/server.ts +--- a/grpc/examples/ts/greeter/src/server.ts 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/examples/ts/greeter/src/server.ts 2023-01-13 07:46:51.146088284 +0000 +@@ -1,21 +1,19 @@ +-import grpc from 'grpc'; ++import * as grpc from '@grpc/grpc-js'; ++import * as flatbuffers from 'flatbuffers'; + import { HelloReply } from './models/hello-reply'; + import { HelloRequest } from './models/hello-request'; + import { IGreeterServer, GreeterService } from './greeter_grpc'; +-import { flatbuffers } from 'flatbuffers'; + +-class GreeterServer implements IGreeterServer { +- +- SayHello(call: grpc.ServerUnaryCall, callback: grpc.sendUnaryData): void { ++const greeter: IGreeterServer = { ++ SayHello(call: grpc.ServerUnaryCall, callback: grpc.sendUnaryData): void { + console.log(`SayHello ${call.request.name()}`); + const builder = new flatbuffers.Builder(); + const offset = builder.createString(`welcome ${call.request.name()}`); + const root = HelloReply.createHelloReply(builder, offset); + builder.finish(root); + callback(null, HelloReply.getRootAsHelloReply(new flatbuffers.ByteBuffer(builder.asUint8Array()))); +- } +- +- async SayManyHellos(call: grpc.ServerWritableStream): Promise { ++ }, ++ async SayManyHellos(call: grpc.ServerWritableStream): Promise { + const name = call.request.name(); + console.log(`${call.request.name()} saying hi in different langagues`); + ['Hi', 'Hallo', 'Ciao'].forEach(element => { +@@ -32,10 +30,20 @@ + function serve(): void { + const PORT = 3000; + const server = new grpc.Server(); +- server.addService(GreeterService, new GreeterServer()); ++ server.addService(GreeterService, greeter); + console.log(`Listening on ${PORT}`); +- server.bind(`localhost:${PORT}`, grpc.ServerCredentials.createInsecure()); +- server.start(); ++ server.bindAsync( ++ `localhost:${PORT}`, ++ grpc.ServerCredentials.createInsecure(), ++ (err: Error | null, port: number) => { ++ if (err) { ++ console.error(`Server error: ${err.message}`); ++ } else { ++ console.log(`Server bound on port: ${port}`); ++ server.start(); ++ } ++ } ++ ); + } + + serve(); +\ No newline at end of file +diff -urN a/grpc/flatbuffers-java-grpc/pom.xml b/grpc/flatbuffers-java-grpc/pom.xml +--- a/grpc/flatbuffers-java-grpc/pom.xml 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/flatbuffers-java-grpc/pom.xml 2023-01-13 07:46:49.750075393 +0000 +@@ -6,7 +6,7 @@ + + com.google.flatbuffers + flatbuffers-parent +- 2.0.0 ++ 2.0.3 + + flatbuffers-java-grpc + ${project.artifactId} +@@ -24,7 +24,7 @@ + + + +- 2.0.0 ++ 1.36.0 + + + +diff -urN a/grpc/pom.xml b/grpc/pom.xml +--- a/grpc/pom.xml 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/pom.xml 2023-01-13 07:46:49.771075587 +0000 +@@ -4,7 +4,7 @@ + com.google.flatbuffers + flatbuffers-parent + pom +- 2.0.0 ++ 2.0.3 + flatbuffers-parent + parent pom for flatbuffers java artifacts + +diff -urN a/grpc/samples/greeter/Makefile b/grpc/samples/greeter/Makefile +--- a/grpc/samples/greeter/Makefile 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/samples/greeter/Makefile 2023-01-13 07:46:49.778075651 +0000 +@@ -4,11 +4,11 @@ + .PHONY: all + all: server client + +-greeter_generated.h: greeter.fbs ++greeter_generated: greeter.fbs + flatc --grpc --cpp $< + +-server: server.cpp greeter.grpc.fb.cc greeter_generated.h greeter.grpc.fb.h ++server: greeter_generated server.cpp greeter.grpc.fb.cc greeter.grpc.fb.h + g++ -std=c++11 -O2 $(CXXFLAGS) $(LDFLAGS) -lgpr -lgrpc -lgrpc++ server.cpp greeter.grpc.fb.cc -o $@ + +-client: client.cpp greeter.grpc.fb.cc greeter_generated.h greeter.grpc.fb.h ++client: greeter_generated client.cpp greeter.grpc.fb.cc greeter.grpc.fb.h + g++ -std=c++11 -O2 $(CXXFLAGS) $(LDFLAGS) -lgpr -lgrpc -lgrpc++ client.cpp greeter.grpc.fb.cc -o $@ +diff -urN a/grpc/src/compiler/BUILD.bazel b/grpc/src/compiler/BUILD.bazel +--- a/grpc/src/compiler/BUILD.bazel 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/BUILD.bazel 2023-01-13 07:46:52.185097880 +0000 +@@ -7,7 +7,6 @@ + filegroup( + name = "common_headers", + srcs = [ +- "config.h", + "schema_interface.h", + ], + ) +diff -urN a/grpc/src/compiler/config.h b/grpc/src/compiler/config.h +--- a/grpc/src/compiler/config.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/config.h 1970-01-01 00:00:00.000000000 +0000 +@@ -1,40 +0,0 @@ +-/* +- * +- * Copyright 2015, Google Inc. +- * All rights reserved. +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions are +- * met: +- * +- * * Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * * Redistributions in binary form must reproduce the above +- * copyright notice, this list of conditions and the following disclaimer +- * in the documentation and/or other materials provided with the +- * distribution. +- * * Neither the name of Google Inc. nor the names of its +- * contributors may be used to endorse or promote products derived from +- * this software without specific prior written permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- * +- */ +- +-#ifndef SRC_COMPILER_CONFIG_H +-#define SRC_COMPILER_CONFIG_H +- +-// This file is here only because schema_interface.h, which is copied from gRPC, +-// includes it. There is nothing for Flatbuffers to configure. +- +-#endif // SRC_COMPILER_CONFIG_H +diff -urN a/grpc/src/compiler/cpp_generator.cc b/grpc/src/compiler/cpp_generator.cc +--- a/grpc/src/compiler/cpp_generator.cc 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/cpp_generator.cc 2023-01-13 07:46:52.837103901 +0000 +@@ -1,51 +1,17 @@ +-/* +- * +- * Copyright 2015, Google Inc. +- * All rights reserved. +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions are +- * met: +- * +- * * Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * * Redistributions in binary form must reproduce the above +- * copyright notice, this list of conditions and the following disclaimer +- * in the documentation and/or other materials provided with the +- * distribution. +- * * Neither the name of Google Inc. nor the names of its +- * contributors may be used to endorse or promote products derived from +- * this software without specific prior written permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- * +- */ ++#include "src/compiler/cpp_generator.h" + + #include ++#include + +-#include "src/compiler/cpp_generator.h" + #include "flatbuffers/util.h" + +-#include +- + namespace grpc_cpp_generator { + namespace { + + grpc::string message_header_ext() { return "_generated.h"; } + grpc::string service_header_ext() { return ".grpc.fb.h"; } + +-template +-grpc::string as_string(T x) { ++template grpc::string as_string(T x) { + std::ostringstream out; + out << x; + return out.str(); +@@ -76,10 +42,7 @@ + } + } // namespace + +-template +-T *array_end(T (&array)[N]) { +- return array + N; +-} ++template T *array_end(T (&array)[N]) { return array + N; } + + void PrintIncludes(grpc_generator::Printer *printer, + const std::vector &headers, +@@ -92,9 +55,7 @@ + auto &s = params.grpc_search_path; + if (!s.empty()) { + vars["l"] += s; +- if (s[s.size() - 1] != '/') { +- vars["l"] += '/'; +- } ++ if (s[s.size() - 1] != '/') { vars["l"] += '/'; } + } + + for (auto i = headers.begin(); i != headers.end(); i++) { +@@ -114,7 +75,7 @@ + vars["filename"] = file->filename(); + vars["filename_identifier"] = FilenameIdentifier(file->filename()); + vars["filename_base"] = file->filename_without_ext(); +- vars["message_header_ext"] = message_header_ext(); ++ vars["message_header_ext"] = file->message_header_ext(); + + printer->Print(vars, "// Generated by the gRPC C++ plugin.\n"); + printer->Print(vars, +@@ -144,15 +105,16 @@ + std::map vars; + + static const char *headers_strs[] = { +- "grpcpp/impl/codegen/async_stream.h", +- "grpcpp/impl/codegen/async_unary_call.h", +- "grpcpp/impl/codegen/method_handler.h", +- "grpcpp/impl/codegen/proto_utils.h", +- "grpcpp/impl/codegen/rpc_method.h", +- "grpcpp/impl/codegen/service_type.h", +- "grpcpp/impl/codegen/status.h", +- "grpcpp/impl/codegen/stub_options.h", +- "grpcpp/impl/codegen/sync_stream.h"}; ++ "grpcpp/impl/codegen/async_stream.h", ++ "grpcpp/impl/codegen/async_unary_call.h", ++ "grpcpp/impl/codegen/method_handler.h", ++ "grpcpp/impl/codegen/proto_utils.h", ++ "grpcpp/impl/codegen/rpc_method.h", ++ "grpcpp/impl/codegen/service_type.h", ++ "grpcpp/impl/codegen/status.h", ++ "grpcpp/impl/codegen/stub_options.h", ++ "grpcpp/impl/codegen/sync_stream.h" ++ }; + std::vector headers(headers_strs, array_end(headers_strs)); + PrintIncludes(printer.get(), headers, params); + printer->Print(vars, "\n"); +@@ -187,8 +149,8 @@ + grpc::string prefix; + grpc::string method_params; // extra arguments to method + grpc::string raw_args; // extra arguments to raw version of method +- } async_prefixes[] = {{"Async", ", void* tag", ", tag"}, +- {"PrepareAsync", "", ""}}; ++ } async_prefixes[] = { { "Async", ", void* tag", ", tag" }, ++ { "PrepareAsync", "", "" } }; + + if (is_public) { + if (method->NoStreaming()) { +@@ -196,8 +158,9 @@ + *vars, + "virtual ::grpc::Status $Method$(::grpc::ClientContext* context, " + "const $Request$& request, $Response$* response) = 0;\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + printer->Print( + *vars, +@@ -228,8 +191,9 @@ + "($Method$Raw(context, response));\n"); + printer->Outdent(); + printer->Print("}\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["AsyncRawArgs"] = async_prefix.raw_args; +@@ -262,8 +226,9 @@ + "($Method$Raw(context, request));\n"); + printer->Outdent(); + printer->Print("}\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["AsyncRawArgs"] = async_prefix.raw_args; +@@ -295,8 +260,9 @@ + "$Method$Raw(context));\n"); + printer->Outdent(); + printer->Print("}\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["AsyncRawArgs"] = async_prefix.raw_args; +@@ -318,8 +284,9 @@ + } + } else { + if (method->NoStreaming()) { +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + printer->Print( + *vars, +@@ -334,8 +301,9 @@ + "virtual ::grpc::ClientWriterInterface< $Request$>*" + " $Method$Raw(" + "::grpc::ClientContext* context, $Response$* response) = 0;\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + printer->Print( +@@ -351,8 +319,9 @@ + "virtual ::grpc::ClientReaderInterface< $Response$>* " + "$Method$Raw(" + "::grpc::ClientContext* context, const $Request$& request) = 0;\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + printer->Print( +@@ -367,8 +336,9 @@ + "virtual ::grpc::ClientReaderWriterInterface< $Request$, " + "$Response$>* " + "$Method$Raw(::grpc::ClientContext* context) = 0;\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + printer->Print( +@@ -393,8 +363,8 @@ + grpc::string prefix; + grpc::string method_params; // extra arguments to method + grpc::string raw_args; // extra arguments to raw version of method +- } async_prefixes[] = {{"Async", ", void* tag", ", tag"}, +- {"PrepareAsync", "", ""}}; ++ } async_prefixes[] = { { "Async", ", void* tag", ", tag" }, ++ { "PrepareAsync", "", "" } }; + + if (is_public) { + if (method->NoStreaming()) { +@@ -402,8 +372,9 @@ + *vars, + "::grpc::Status $Method$(::grpc::ClientContext* context, " + "const $Request$& request, $Response$* response) override;\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + printer->Print( + *vars, +@@ -431,8 +402,9 @@ + "($Method$Raw(context, response));\n"); + printer->Outdent(); + printer->Print("}\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["AsyncRawArgs"] = async_prefix.raw_args; +@@ -463,8 +435,9 @@ + "($Method$Raw(context, request));\n"); + printer->Outdent(); + printer->Print("}\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["AsyncRawArgs"] = async_prefix.raw_args; +@@ -494,8 +467,9 @@ + "$Method$Raw(context));\n"); + printer->Outdent(); + printer->Print("}\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["AsyncRawArgs"] = async_prefix.raw_args; +@@ -516,8 +490,9 @@ + } + } else { + if (method->NoStreaming()) { +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + printer->Print( + *vars, +@@ -531,8 +506,9 @@ + "::grpc::ClientWriter< $Request$>* $Method$Raw(" + "::grpc::ClientContext* context, $Response$* response) " + "override;\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["AsyncRawArgs"] = async_prefix.raw_args; +@@ -547,8 +523,9 @@ + "::grpc::ClientReader< $Response$>* $Method$Raw(" + "::grpc::ClientContext* context, const $Request$& request)" + " override;\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["AsyncRawArgs"] = async_prefix.raw_args; +@@ -562,8 +539,9 @@ + printer->Print(*vars, + "::grpc::ClientReaderWriter< $Request$, $Response$>* " + "$Method$Raw(::grpc::ClientContext* context) override;\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["AsyncRawArgs"] = async_prefix.raw_args; +@@ -630,7 +608,8 @@ + "class WithAsyncMethod_$Method$ : public BaseClass {\n"); + printer->Print( + " private:\n" +- " void BaseClassMustBeDerivedFromService(const Service *service) {}\n"); ++ " void BaseClassMustBeDerivedFromService(const Service */*service*/) " ++ "{}\n"); + printer->Print(" public:\n"); + printer->Indent(); + printer->Print(*vars, +@@ -646,8 +625,8 @@ + *vars, + "// disable synchronous version of this method\n" + "::grpc::Status $Method$(" +- "::grpc::ServerContext* context, const $Request$* request, " +- "$Response$* response) final override {\n" ++ "::grpc::ServerContext* /*context*/, const $Request$* /*request*/, " ++ "$Response$* /*response*/) final override {\n" + " abort();\n" + " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n" + "}\n"); +@@ -667,8 +646,8 @@ + *vars, + "// disable synchronous version of this method\n" + "::grpc::Status $Method$(" +- "::grpc::ServerContext* context, " +- "::grpc::ServerReader< $Request$>* reader, " ++ "::grpc::ServerContext* /*context*/, " ++ "::grpc::ServerReader< $Request$>* /*reader*/, " + "$Response$* response) final override {\n" + " abort();\n" + " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n" +@@ -689,8 +668,8 @@ + *vars, + "// disable synchronous version of this method\n" + "::grpc::Status $Method$(" +- "::grpc::ServerContext* context, const $Request$* request, " +- "::grpc::ServerWriter< $Response$>* writer) final override " ++ "::grpc::ServerContext* /*context*/, const $Request$* /*request*/, " ++ "::grpc::ServerWriter< $Response$>* /*writer*/) final override " + "{\n" + " abort();\n" + " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n" +@@ -712,8 +691,8 @@ + *vars, + "// disable synchronous version of this method\n" + "::grpc::Status $Method$(" +- "::grpc::ServerContext* context, " +- "::grpc::ServerReaderWriter< $Response$, $Request$>* stream) " ++ "::grpc::ServerContext* /*context*/, " ++ "::grpc::ServerReaderWriter< $Response$, $Request$>* /*stream*/) " + "final override {\n" + " abort();\n" + " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n" +@@ -747,7 +726,7 @@ + "public BaseClass {\n"); + printer->Print( + " private:\n" +- " void BaseClassMustBeDerivedFromService(const Service *service) " ++ " void BaseClassMustBeDerivedFromService(const Service */*service*/) " + "{}\n"); + printer->Print(" public:\n"); + printer->Indent(); +@@ -768,8 +747,8 @@ + *vars, + "// disable regular version of this method\n" + "::grpc::Status $Method$(" +- "::grpc::ServerContext* context, const $Request$* request, " +- "$Response$* response) final override {\n" ++ "::grpc::ServerContext* /*context*/, const $Request$* /*request*/, " ++ "$Response$* /*response*/) final override {\n" + " abort();\n" + " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n" + "}\n"); +@@ -798,8 +777,8 @@ + "public BaseClass {\n"); + printer->Print( + " private:\n" +- " void BaseClassMustBeDerivedFromService(const Service *service) " +- "{}\n"); ++ " void BaseClassMustBeDerivedFromService(const Service */*service*/) " ++ "{ }\n"); + printer->Print(" public:\n"); + printer->Indent(); + printer->Print( +@@ -820,8 +799,8 @@ + *vars, + "// disable regular version of this method\n" + "::grpc::Status $Method$(" +- "::grpc::ServerContext* context, const $Request$* request, " +- "::grpc::ServerWriter< $Response$>* writer) final override " ++ "::grpc::ServerContext* /*context*/, const $Request$* /*request*/, " ++ "::grpc::ServerWriter< $Response$>* /*writer*/) final override " + "{\n" + " abort();\n" + " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n" +@@ -849,7 +828,8 @@ + "class WithGenericMethod_$Method$ : public BaseClass {\n"); + printer->Print( + " private:\n" +- " void BaseClassMustBeDerivedFromService(const Service *service) {}\n"); ++ " void BaseClassMustBeDerivedFromService(const Service */*service*/) " ++ "{}\n"); + printer->Print(" public:\n"); + printer->Indent(); + printer->Print(*vars, +@@ -865,8 +845,8 @@ + *vars, + "// disable synchronous version of this method\n" + "::grpc::Status $Method$(" +- "::grpc::ServerContext* context, const $Request$* request, " +- "$Response$* response) final override {\n" ++ "::grpc::ServerContext* /*context*/, const $Request$* /*request*/, " ++ "$Response$* /*response*/) final override {\n" + " abort();\n" + " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n" + "}\n"); +@@ -875,9 +855,9 @@ + *vars, + "// disable synchronous version of this method\n" + "::grpc::Status $Method$(" +- "::grpc::ServerContext* context, " +- "::grpc::ServerReader< $Request$>* reader, " +- "$Response$* response) final override {\n" ++ "::grpc::ServerContext* /*context*/, " ++ "::grpc::ServerReader< $Request$>* /*reader*/, " ++ "$Response$* /*response*/) final override {\n" + " abort();\n" + " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n" + "}\n"); +@@ -886,8 +866,8 @@ + *vars, + "// disable synchronous version of this method\n" + "::grpc::Status $Method$(" +- "::grpc::ServerContext* context, const $Request$* request, " +- "::grpc::ServerWriter< $Response$>* writer) final override " ++ "::grpc::ServerContext* /*context*/, const $Request$* /*request*/, " ++ "::grpc::ServerWriter< $Response$>* /*writer*/) final override " + "{\n" + " abort();\n" + " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n" +@@ -897,8 +877,8 @@ + *vars, + "// disable synchronous version of this method\n" + "::grpc::Status $Method$(" +- "::grpc::ServerContext* context, " +- "::grpc::ServerReaderWriter< $Response$, $Request$>* stream) " ++ "::grpc::ServerContext* /*context*/, " ++ "::grpc::ServerReaderWriter< $Response$, $Request$>* /*stream*/) " + "final override {\n" + " abort();\n" + " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n" +@@ -1001,9 +981,7 @@ + printer->Print(*vars, "WithAsyncMethod_$method_name$<"); + } + printer->Print("Service"); +- for (int i = 0; i < service->method_count(); ++i) { +- printer->Print(" >"); +- } ++ for (int i = 0; i < service->method_count(); ++i) { printer->Print(" >"); } + printer->Print(" AsyncService;\n"); + + // Server side - Generic +@@ -1028,9 +1006,7 @@ + } + printer->Print("Service"); + for (int i = 0; i < service->method_count(); ++i) { +- if (service->method(i)->NoStreaming()) { +- printer->Print(" >"); +- } ++ if (service->method(i)->NoStreaming()) { printer->Print(" >"); } + } + printer->Print(" StreamedUnaryService;\n"); + +@@ -1052,9 +1028,7 @@ + printer->Print("Service"); + for (int i = 0; i < service->method_count(); ++i) { + auto method = service->method(i); +- if (ServerOnlyStreaming(method.get())) { +- printer->Print(" >"); +- } ++ if (ServerOnlyStreaming(method.get())) { printer->Print(" >"); } + } + printer->Print(" SplitStreamedService;\n"); + +@@ -1095,9 +1069,7 @@ + // Package string is empty or ends with a dot. It is used to fully qualify + // method names. + vars["Package"] = file->package(); +- if (!file->package().empty()) { +- vars["Package"].append("."); +- } ++ if (!file->package().empty()) { vars["Package"].append("."); } + + if (!params.services_namespace.empty()) { + vars["services_namespace"] = params.services_namespace; +@@ -1155,8 +1127,8 @@ + + vars["filename"] = file->filename(); + vars["filename_base"] = file->filename_without_ext(); +- vars["message_header_ext"] = message_header_ext(); +- vars["service_header_ext"] = service_header_ext(); ++ vars["message_header_ext"] = file->message_header_ext(); ++ vars["service_header_ext"] = file->service_header_ext(); + + printer->Print(vars, "// Generated by the gRPC C++ plugin.\n"); + printer->Print(vars, +@@ -1179,14 +1151,15 @@ + std::map vars; + + static const char *headers_strs[] = { +- "grpcpp/impl/codegen/async_stream.h", +- "grpcpp/impl/codegen/async_unary_call.h", +- "grpcpp/impl/codegen/channel_interface.h", +- "grpcpp/impl/codegen/client_unary_call.h", +- "grpcpp/impl/codegen/method_handler.h", +- "grpcpp/impl/codegen/rpc_service_method.h", +- "grpcpp/impl/codegen/service_type.h", +- "grpcpp/impl/codegen/sync_stream.h"}; ++ "grpcpp/impl/codegen/async_stream.h", ++ "grpcpp/impl/codegen/async_unary_call.h", ++ "grpcpp/impl/codegen/channel_interface.h", ++ "grpcpp/impl/codegen/client_unary_call.h", ++ "grpcpp/impl/codegen/method_handler.h", ++ "grpcpp/impl/codegen/rpc_service_method.h", ++ "grpcpp/impl/codegen/service_type.h", ++ "grpcpp/impl/codegen/sync_stream.h" ++ }; + std::vector headers(headers_strs, array_end(headers_strs)); + PrintIncludes(printer.get(), headers, params); + +@@ -1215,8 +1188,8 @@ + grpc::string start; // bool literal expressed as string + grpc::string method_params; // extra arguments to method + grpc::string create_args; // extra arguments to creator +- } async_prefixes[] = {{"Async", "true", ", void* tag", ", tag"}, +- {"PrepareAsync", "false", "", ", nullptr"}}; ++ } async_prefixes[] = { { "Async", "true", ", void* tag", ", tag" }, ++ { "PrepareAsync", "false", "", ", nullptr" } }; + if (method->NoStreaming()) { + printer->Print(*vars, + "::grpc::Status $ns$$Service$::Stub::$Method$(" +@@ -1226,8 +1199,9 @@ + " return ::grpc::internal::BlockingUnaryCall" + "(channel_.get(), rpcmethod_$Method$_, " + "context, request, response);\n}\n\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncStart"] = async_prefix.start; + printer->Print(*vars, +@@ -1257,8 +1231,9 @@ + "rpcmethod_$Method$_, " + "context, response);\n" + "}\n\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncStart"] = async_prefix.start; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; +@@ -1289,8 +1264,9 @@ + "rpcmethod_$Method$_, " + "context, request);\n" + "}\n\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncStart"] = async_prefix.start; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; +@@ -1321,8 +1297,9 @@ + "rpcmethod_$Method$_, " + "context);\n" + "}\n\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncStart"] = async_prefix.start; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; +@@ -1351,13 +1328,11 @@ + (*vars)["Request"] = method->input_type_name(); + (*vars)["Response"] = method->output_type_name(); + if (method->NoStreaming()) { +- printer->Print(*vars, +- "::grpc::Status $ns$$Service$::Service::$Method$(" +- "::grpc::ServerContext* context, " +- "const $Request$* request, $Response$* response) {\n"); +- printer->Print(" (void) context;\n"); +- printer->Print(" (void) request;\n"); +- printer->Print(" (void) response;\n"); ++ printer->Print( ++ *vars, ++ "::grpc::Status $ns$$Service$::Service::$Method$(" ++ "::grpc::ServerContext* /*context*/, " ++ "const $Request$* /*request*/, $Response$* /*response*/) {\n"); + printer->Print( + " return ::grpc::Status(" + "::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"); +@@ -1365,12 +1340,9 @@ + } else if (ClientOnlyStreaming(method)) { + printer->Print(*vars, + "::grpc::Status $ns$$Service$::Service::$Method$(" +- "::grpc::ServerContext* context, " +- "::grpc::ServerReader< $Request$>* reader, " +- "$Response$* response) {\n"); +- printer->Print(" (void) context;\n"); +- printer->Print(" (void) reader;\n"); +- printer->Print(" (void) response;\n"); ++ "::grpc::ServerContext* /*context*/, " ++ "::grpc::ServerReader< $Request$>* /*reader*/, " ++ "$Response$* /*response*/) {\n"); + printer->Print( + " return ::grpc::Status(" + "::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"); +@@ -1378,12 +1350,9 @@ + } else if (ServerOnlyStreaming(method)) { + printer->Print(*vars, + "::grpc::Status $ns$$Service$::Service::$Method$(" +- "::grpc::ServerContext* context, " +- "const $Request$* request, " +- "::grpc::ServerWriter< $Response$>* writer) {\n"); +- printer->Print(" (void) context;\n"); +- printer->Print(" (void) request;\n"); +- printer->Print(" (void) writer;\n"); ++ "::grpc::ServerContext* /*context*/, " ++ "const $Request$* /*request*/, " ++ "::grpc::ServerWriter< $Response$>* /*writer*/) {\n"); + printer->Print( + " return ::grpc::Status(" + "::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"); +@@ -1391,11 +1360,9 @@ + } else if (method->BidiStreaming()) { + printer->Print(*vars, + "::grpc::Status $ns$$Service$::Service::$Method$(" +- "::grpc::ServerContext* context, " ++ "::grpc::ServerContext* /*context*/, " + "::grpc::ServerReaderWriter< $Response$, $Request$>* " +- "stream) {\n"); +- printer->Print(" (void) context;\n"); +- printer->Print(" (void) stream;\n"); ++ "/*stream*/) {\n"); + printer->Print( + " return ::grpc::Status(" + "::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"); +@@ -1421,7 +1388,7 @@ + printer->Print(*vars, + "std::unique_ptr< $ns$$Service$::Stub> $ns$$Service$::NewStub(" + "const std::shared_ptr< ::grpc::ChannelInterface>& channel, " +- "const ::grpc::StubOptions& options) {\n" ++ "const ::grpc::StubOptions& /*options*/) {\n" + " std::unique_ptr< $ns$$Service$::Stub> stub(new " + "$ns$$Service$::Stub(channel));\n" + " return stub;\n" +@@ -1530,9 +1497,7 @@ + // Package string is empty or ends with a dot. It is used to fully qualify + // method names. + vars["Package"] = file->package(); +- if (!file->package().empty()) { +- vars["Package"].append("."); +- } ++ if (!file->package().empty()) { vars["Package"].append("."); } + if (!params.services_namespace.empty()) { + vars["ns"] = params.services_namespace + "::"; + vars["prefix"] = params.services_namespace; +@@ -1604,9 +1569,9 @@ + std::map vars; + + static const char *headers_strs[] = { +- "grpcpp/impl/codegen/async_stream.h", +- "grpcpp/impl/codegen/sync_stream.h", +- "gmock/gmock.h", ++ "grpcpp/impl/codegen/async_stream.h", ++ "grpcpp/impl/codegen/sync_stream.h", ++ "gmock/gmock.h", + }; + std::vector headers(headers_strs, array_end(headers_strs)); + PrintIncludes(printer.get(), headers, params); +@@ -1636,15 +1601,17 @@ + grpc::string prefix; + grpc::string method_params; // extra arguments to method + int extra_method_param_count; +- } async_prefixes[] = {{"Async", ", void* tag", 1}, {"PrepareAsync", "", 0}}; ++ } async_prefixes[] = { { "Async", ", void* tag", 1 }, ++ { "PrepareAsync", "", 0 } }; + + if (method->NoStreaming()) { + printer->Print( + *vars, + "MOCK_METHOD3($Method$, ::grpc::Status(::grpc::ClientContext* context, " + "const $Request$& request, $Response$* response));\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + printer->Print( + *vars, +@@ -1659,12 +1626,13 @@ + "MOCK_METHOD2($Method$Raw, " + "::grpc::ClientWriterInterface< $Request$>*" + "(::grpc::ClientContext* context, $Response$* response));\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["MockArgs"] = +- flatbuffers::NumToString(3 + async_prefix.extra_method_param_count); ++ flatbuffers::NumToString(3 + async_prefix.extra_method_param_count); + printer->Print(*vars, + "MOCK_METHOD$MockArgs$($AsyncPrefix$$Method$Raw, " + "::grpc::ClientAsyncWriterInterface< $Request$>*" +@@ -1677,8 +1645,9 @@ + "MOCK_METHOD2($Method$Raw, " + "::grpc::ClientReaderInterface< $Response$>*" + "(::grpc::ClientContext* context, const $Request$& request));\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["MockArgs"] = +@@ -1696,8 +1665,9 @@ + "MOCK_METHOD1($Method$Raw, " + "::grpc::ClientReaderWriterInterface< $Request$, $Response$>*" + "(::grpc::ClientContext* context));\n"); +- for (size_t i = 0; i < sizeof(async_prefixes)/sizeof(async_prefixes[0]); i ++) { +- auto& async_prefix = async_prefixes[i]; ++ for (size_t i = 0; i < sizeof(async_prefixes) / sizeof(async_prefixes[0]); ++ i++) { ++ auto &async_prefix = async_prefixes[i]; + (*vars)["AsyncPrefix"] = async_prefix.prefix; + (*vars)["AsyncMethodParams"] = async_prefix.method_params; + (*vars)["MockArgs"] = +@@ -1738,9 +1708,7 @@ + // Package string is empty or ends with a dot. It is used to fully qualify + // method names. + vars["Package"] = file->package(); +- if (!file->package().empty()) { +- vars["Package"].append("."); +- } ++ if (!file->package().empty()) { vars["Package"].append("."); } + + if (!params.services_namespace.empty()) { + vars["services_namespace"] = params.services_namespace; +diff -urN a/grpc/src/compiler/cpp_generator.h b/grpc/src/compiler/cpp_generator.h +--- a/grpc/src/compiler/cpp_generator.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/cpp_generator.h 2023-01-13 07:46:52.837103901 +0000 +@@ -1,36 +1,3 @@ +-/* +- * +- * Copyright 2015, Google Inc. +- * All rights reserved. +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions are +- * met: +- * +- * * Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * * Redistributions in binary form must reproduce the above +- * copyright notice, this list of conditions and the following disclaimer +- * in the documentation and/or other materials provided with the +- * distribution. +- * * Neither the name of Google Inc. nor the names of its +- * contributors may be used to endorse or promote products derived from +- * this software without specific prior written permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- * +- */ +- + #ifndef GRPC_INTERNAL_COMPILER_CPP_GENERATOR_H + #define GRPC_INTERNAL_COMPILER_CPP_GENERATOR_H + +@@ -41,12 +8,11 @@ + #include + #include + +-#include "src/compiler/config.h" + #include "src/compiler/schema_interface.h" + + #ifndef GRPC_CUSTOM_STRING +-#include +-#define GRPC_CUSTOM_STRING std::string ++# include ++# define GRPC_CUSTOM_STRING std::string + #endif + + namespace grpc { +diff -urN a/grpc/src/compiler/go_generator.cc b/grpc/src/compiler/go_generator.cc +--- a/grpc/src/compiler/go_generator.cc 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/go_generator.cc 2023-01-13 07:46:52.838103910 +0000 +@@ -1,47 +1,13 @@ +-/* +- * +- * Copyright 2015, Google Inc. +- * All rights reserved. +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions are +- * met: +- * +- * * Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * * Redistributions in binary form must reproduce the above +- * copyright notice, this list of conditions and the following disclaimer +- * in the documentation AN/or other materials provided with the +- * distribution. +- * * Neither the name of Google Inc. nor the names of its +- * contributors may be used to endorse or promote products derived from +- * this software without specific prior written permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- * +- */ ++#include "src/compiler/go_generator.h" + +-#include + #include ++#include + #include + +-#include "src/compiler/go_generator.h" +- +-template +-grpc::string as_string(T x) { +- std::ostringstream out; +- out << x; +- return out.str(); ++template grpc::string as_string(T x) { ++ std::ostringstream out; ++ out << x; ++ return out.str(); + } + + inline bool ClientOnlyStreaming(const grpc_generator::Method *method) { +@@ -56,18 +22,16 @@ + + // Returns string with first letter to lowerCase + grpc::string unexportName(grpc::string s) { +- if (s.empty()) +- return s; +- s[0] = static_cast(std::tolower(s[0])); +- return s; ++ if (s.empty()) return s; ++ s[0] = static_cast(std::tolower(s[0])); ++ return s; + } + + // Returns string with first letter to uppercase + grpc::string exportName(grpc::string s) { +- if (s.empty()) +- return s; +- s[0] = static_cast(std::toupper(s[0])); +- return s; ++ if (s.empty()) return s; ++ s[0] = static_cast(std::toupper(s[0])); ++ return s; + } + + void GenerateError(grpc_generator::Printer *printer, +@@ -82,50 +46,65 @@ + } + + // Generates imports for the service +-void GenerateImports(grpc_generator::File *file, grpc_generator::Printer *printer, ++void GenerateImports(grpc_generator::File *file, ++ grpc_generator::Printer *printer, + std::map vars) { +- vars["filename"] = file->filename(); +- printer->Print("//Generated by gRPC Go plugin\n"); +- printer->Print("//If you make any local changes, they will be lost\n"); +- printer->Print(vars, "//source: $filename$\n\n"); +- printer->Print(vars, "package $Package$\n\n"); +- printer->Print("import (\n"); +- printer->Indent(); +- printer->Print(vars, "$context$ \"context\"\n"); ++ vars["filename"] = file->filename(); ++ printer->Print("//Generated by gRPC Go plugin\n"); ++ printer->Print("//If you make any local changes, they will be lost\n"); ++ printer->Print(vars, "//source: $filename$\n\n"); ++ printer->Print(vars, "package $Package$\n\n"); ++ printer->Print("import (\n"); ++ printer->Indent(); ++ printer->Print(vars, "$context$ \"context\"\n"); + printer->Print("flatbuffers \"github.com/google/flatbuffers/go\"\n"); +- printer->Print(vars, "$grpc$ \"google.golang.org/grpc\"\n"); ++ printer->Print(vars, "$grpc$ \"google.golang.org/grpc\"\n"); + printer->Print("\"google.golang.org/grpc/codes\"\n"); + printer->Print("\"google.golang.org/grpc/status\"\n"); +- printer->Outdent(); +- printer->Print(")\n\n"); ++ printer->Outdent(); ++ printer->Print(")\n\n"); + } + + // Generates Server method signature source +-void GenerateServerMethodSignature(const grpc_generator::Method *method, grpc_generator::Printer *printer, ++void GenerateServerMethodSignature(const grpc_generator::Method *method, ++ grpc_generator::Printer *printer, + std::map vars) { + vars["Method"] = exportName(method->name()); +- vars["Request"] = method->get_input_type_name(); +- vars["Response"] = (vars["CustomMethodIO"] == "") ? method->get_output_type_name() : vars["CustomMethodIO"]; +- if (method->NoStreaming()) { +- printer->Print(vars, "$Method$($context$.Context, *$Request$) (*$Response$, error)$Ending$"); +- } else if (ServerOnlyStreaming(method)) { +- printer->Print(vars, "$Method$(*$Request$, $Service$_$Method$Server) error$Ending$"); +- } else { +- printer->Print(vars, "$Method$($Service$_$Method$Server) error$Ending$"); +- } ++ vars["Request"] = method->get_input_type_name(); ++ vars["Response"] = (vars["CustomMethodIO"] == "") ++ ? method->get_output_type_name() ++ : vars["CustomMethodIO"]; ++ if (method->NoStreaming()) { ++ printer->Print( ++ vars, ++ "$Method$($context$.Context, *$Request$) (*$Response$, error)$Ending$"); ++ } else if (ServerOnlyStreaming(method)) { ++ printer->Print( ++ vars, "$Method$(*$Request$, $Service$_$Method$Server) error$Ending$"); ++ } else { ++ printer->Print(vars, "$Method$($Service$_$Method$Server) error$Ending$"); ++ } + } + +-void GenerateServerMethod(const grpc_generator::Method *method, grpc_generator::Printer *printer, ++void GenerateServerMethod(const grpc_generator::Method *method, ++ grpc_generator::Printer *printer, + std::map vars) { +- vars["Method"] = exportName(method->name()); +- vars["Request"] = method->get_input_type_name(); +- vars["Response"] = (vars["CustomMethodIO"] == "") ? method->get_output_type_name() : vars["CustomMethodIO"]; +- vars["FullMethodName"] = "/" + vars["ServicePrefix"] + vars["Service"] + "/" + vars["Method"]; +- vars["Handler"] = "_" + vars["Service"] + "_" + vars["Method"] + "_Handler"; +- if (method->NoStreaming()) { +- printer->Print(vars, "func $Handler$(srv interface{}, ctx $context$.Context,\n\tdec func(interface{}) error, interceptor $grpc$.UnaryServerInterceptor) (interface{}, error) {\n"); +- printer->Indent(); +- printer->Print(vars, "in := new($Request$)\n"); ++ vars["Method"] = exportName(method->name()); ++ vars["Request"] = method->get_input_type_name(); ++ vars["Response"] = (vars["CustomMethodIO"] == "") ++ ? method->get_output_type_name() ++ : vars["CustomMethodIO"]; ++ vars["FullMethodName"] = ++ "/" + vars["ServicePrefix"] + vars["Service"] + "/" + vars["Method"]; ++ vars["Handler"] = "_" + vars["Service"] + "_" + vars["Method"] + "_Handler"; ++ if (method->NoStreaming()) { ++ printer->Print( ++ vars, ++ "func $Handler$(srv interface{}, ctx $context$.Context,\n\tdec " ++ "func(interface{}) error, interceptor $grpc$.UnaryServerInterceptor) " ++ "(interface{}, error) {\n"); ++ printer->Indent(); ++ printer->Print(vars, "in := new($Request$)\n"); + vars["Error_Check"] = "err := dec(in); err != nil"; + GenerateError(printer, vars); + printer->Print("if interceptor == nil {\n"); +@@ -133,258 +112,281 @@ + printer->Print(vars, "return srv.($Service$Server).$Method$(ctx, in)\n"); + printer->Outdent(); + printer->Print("}\n"); +- printer->Print(vars, "info := &$grpc$.UnaryServerInfo{\n"); +- printer->Indent(); +- printer->Print("Server: srv,\n"); +- printer->Print(vars, "FullMethod: \"$FullMethodName$\",\n"); +- printer->Outdent(); +- printer->Print("}\n"); ++ printer->Print(vars, "info := &$grpc$.UnaryServerInfo{\n"); ++ printer->Indent(); ++ printer->Print("Server: srv,\n"); ++ printer->Print(vars, "FullMethod: \"$FullMethodName$\",\n"); ++ printer->Outdent(); ++ printer->Print("}\n"); + printer->Outdent(); + printer->Print("\n"); + printer->Indent(); +- printer->Print(vars, "handler := func(ctx $context$.Context, req interface{}) (interface{}, error) {\n"); +- printer->Indent(); +- printer->Print(vars, "return srv.($Service$Server).$Method$(ctx, req.(*$Request$))\n"); +- printer->Outdent(); +- printer->Print("}\n"); +- printer->Print("return interceptor(ctx, in, info, handler)\n"); +- printer->Outdent(); +- printer->Print("}\n"); +- return; +- } +- vars["StreamType"] = vars["ServiceUnexported"] + vars["Method"] + "Server"; +- printer->Print(vars, "func $Handler$(srv interface{}, stream $grpc$.ServerStream) error {\n"); +- printer->Indent(); +- if (ServerOnlyStreaming(method)) { +- printer->Print(vars, "m := new($Request$)\n"); ++ printer->Print(vars, ++ "handler := func(ctx $context$.Context, req interface{}) " ++ "(interface{}, error) {\n"); ++ printer->Indent(); ++ printer->Print( ++ vars, "return srv.($Service$Server).$Method$(ctx, req.(*$Request$))\n"); ++ printer->Outdent(); ++ printer->Print("}\n"); ++ printer->Print("return interceptor(ctx, in, info, handler)\n"); ++ printer->Outdent(); ++ printer->Print("}\n"); ++ return; ++ } ++ vars["StreamType"] = vars["ServiceUnexported"] + vars["Method"] + "Server"; ++ printer->Print( ++ vars, ++ "func $Handler$(srv interface{}, stream $grpc$.ServerStream) error {\n"); ++ printer->Indent(); ++ if (ServerOnlyStreaming(method)) { ++ printer->Print(vars, "m := new($Request$)\n"); + vars["Error_Check"] = "err := stream.RecvMsg(m); err != nil"; + GenerateError(printer, vars, false); +- printer->Print(vars, "return srv.($Service$Server).$Method$(m, &$StreamType${stream})\n"); +- } else { +- printer->Print(vars, "return srv.($Service$Server).$Method$(&$StreamType${stream})\n"); +- } +- printer->Outdent(); +- printer->Print("}\n\n"); +- +- bool genSend = method->BidiStreaming() || ServerOnlyStreaming(method); +- bool genRecv = method->BidiStreaming() || ClientOnlyStreaming(method); +- bool genSendAndClose = ClientOnlyStreaming(method); +- +- printer->Print(vars, "type $Service$_$Method$Server interface {\n"); +- printer->Indent(); +- if (genSend) { +- printer->Print(vars, "Send(*$Response$) error\n"); +- } +- if (genRecv) { +- printer->Print(vars, "Recv() (*$Request$, error)\n"); +- } +- if (genSendAndClose) { +- printer->Print(vars, "SendAndClose(*$Response$) error\n"); +- } +- printer->Print(vars, "$grpc$.ServerStream\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- +- printer->Print(vars, "type $StreamType$ struct {\n"); +- printer->Indent(); +- printer->Print(vars, "$grpc$.ServerStream\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- +- if (genSend) { +- printer->Print(vars, "func (x *$StreamType$) Send(m *$Response$) error {\n"); +- printer->Indent(); +- printer->Print("return x.ServerStream.SendMsg(m)\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- } +- if (genRecv) { +- printer->Print(vars, "func (x *$StreamType$) Recv() (*$Request$, error) {\n"); +- printer->Indent(); +- printer->Print(vars, "m := new($Request$)\n"); ++ printer->Print( ++ vars, ++ "return srv.($Service$Server).$Method$(m, &$StreamType${stream})\n"); ++ } else { ++ printer->Print( ++ vars, "return srv.($Service$Server).$Method$(&$StreamType${stream})\n"); ++ } ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ ++ bool genSend = method->BidiStreaming() || ServerOnlyStreaming(method); ++ bool genRecv = method->BidiStreaming() || ClientOnlyStreaming(method); ++ bool genSendAndClose = ClientOnlyStreaming(method); ++ ++ printer->Print(vars, "type $Service$_$Method$Server interface {\n"); ++ printer->Indent(); ++ if (genSend) { printer->Print(vars, "Send(*$Response$) error\n"); } ++ if (genRecv) { printer->Print(vars, "Recv() (*$Request$, error)\n"); } ++ if (genSendAndClose) { ++ printer->Print(vars, "SendAndClose(*$Response$) error\n"); ++ } ++ printer->Print(vars, "$grpc$.ServerStream\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ ++ printer->Print(vars, "type $StreamType$ struct {\n"); ++ printer->Indent(); ++ printer->Print(vars, "$grpc$.ServerStream\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ ++ if (genSend) { ++ printer->Print(vars, ++ "func (x *$StreamType$) Send(m *$Response$) error {\n"); ++ printer->Indent(); ++ printer->Print("return x.ServerStream.SendMsg(m)\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ } ++ if (genRecv) { ++ printer->Print(vars, ++ "func (x *$StreamType$) Recv() (*$Request$, error) {\n"); ++ printer->Indent(); ++ printer->Print(vars, "m := new($Request$)\n"); + vars["Error_Check"] = "err := x.ServerStream.RecvMsg(m); err != nil"; + GenerateError(printer, vars); +- printer->Print("return m, nil\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- } +- if (genSendAndClose) { +- printer->Print(vars, "func (x *$StreamType$) SendAndClose(m *$Response$) error {\n"); +- printer->Indent(); +- printer->Print("return x.ServerStream.SendMsg(m)\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- } +- ++ printer->Print("return m, nil\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ } ++ if (genSendAndClose) { ++ printer->Print( ++ vars, "func (x *$StreamType$) SendAndClose(m *$Response$) error {\n"); ++ printer->Indent(); ++ printer->Print("return x.ServerStream.SendMsg(m)\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ } + } + + // Generates Client method signature source +-void GenerateClientMethodSignature(const grpc_generator::Method *method, grpc_generator::Printer *printer, ++void GenerateClientMethodSignature(const grpc_generator::Method *method, ++ grpc_generator::Printer *printer, + std::map vars) { +- vars["Method"] = exportName(method->name()); +- vars["Request"] = ", in *" + ((vars["CustomMethodIO"] == "") ? method->get_input_type_name() : vars["CustomMethodIO"]); +- if (ClientOnlyStreaming(method) || method->BidiStreaming()) { +- vars["Request"] = ""; +- } +- vars["Response"] = "*" + method->get_output_type_name(); +- if (ClientOnlyStreaming(method) || method->BidiStreaming() || ServerOnlyStreaming(method)) { +- vars["Response"] = vars["Service"] + "_" + vars["Method"] + "Client" ; +- } +- printer->Print(vars, "$Method$(ctx $context$.Context$Request$,\n\topts ...$grpc$.CallOption) ($Response$, error)$Ending$"); ++ vars["Method"] = exportName(method->name()); ++ vars["Request"] = ++ ", in *" + ((vars["CustomMethodIO"] == "") ? method->get_input_type_name() ++ : vars["CustomMethodIO"]); ++ if (ClientOnlyStreaming(method) || method->BidiStreaming()) { ++ vars["Request"] = ""; ++ } ++ vars["Response"] = "*" + method->get_output_type_name(); ++ if (ClientOnlyStreaming(method) || method->BidiStreaming() || ++ ServerOnlyStreaming(method)) { ++ vars["Response"] = vars["Service"] + "_" + vars["Method"] + "Client"; ++ } ++ printer->Print(vars, ++ "$Method$(ctx $context$.Context$Request$,\n\topts " ++ "...$grpc$.CallOption) ($Response$, error)$Ending$"); + } + + // Generates Client method source +-void GenerateClientMethod(const grpc_generator::Method *method, grpc_generator::Printer *printer, ++void GenerateClientMethod(const grpc_generator::Method *method, ++ grpc_generator::Printer *printer, + std::map vars) { +- printer->Print(vars, "func (c *$ServiceUnexported$Client) "); ++ printer->Print(vars, "func (c *$ServiceUnexported$Client) "); + vars["Ending"] = " {\n"; +- GenerateClientMethodSignature(method, printer, vars); +- printer->Indent(); +- vars["Method"] = exportName(method->name()); +- vars["Request"] = (vars["CustomMethodIO"] == "") ? method->get_input_type_name() : vars["CustomMethodIO"]; +- vars["Response"] = method->get_output_type_name(); +- vars["FullMethodName"] = "/" + vars["ServicePrefix"] + vars["Service"] + "/" + vars["Method"]; +- if (method->NoStreaming()) { +- printer->Print(vars, "out := new($Response$)\n"); +- printer->Print(vars, "err := c.cc.Invoke(ctx, \"$FullMethodName$\", in, out, opts...)\n"); ++ GenerateClientMethodSignature(method, printer, vars); ++ printer->Indent(); ++ vars["Method"] = exportName(method->name()); ++ vars["Request"] = (vars["CustomMethodIO"] == "") ++ ? method->get_input_type_name() ++ : vars["CustomMethodIO"]; ++ vars["Response"] = method->get_output_type_name(); ++ vars["FullMethodName"] = ++ "/" + vars["ServicePrefix"] + vars["Service"] + "/" + vars["Method"]; ++ if (method->NoStreaming()) { ++ printer->Print(vars, "out := new($Response$)\n"); ++ printer->Print( ++ vars, ++ "err := c.cc.Invoke(ctx, \"$FullMethodName$\", in, out, opts...)\n"); + vars["Error_Check"] = "err != nil"; + GenerateError(printer, vars); +- printer->Print("return out, nil\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- return; +- } +- vars["StreamType"] = vars["ServiceUnexported"] + vars["Method"] + "Client"; +- printer->Print(vars, "stream, err := c.cc.NewStream(ctx, &$MethodDesc$, \"$FullMethodName$\", opts...)\n"); ++ printer->Print("return out, nil\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ return; ++ } ++ vars["StreamType"] = vars["ServiceUnexported"] + vars["Method"] + "Client"; ++ printer->Print(vars, ++ "stream, err := c.cc.NewStream(ctx, &$MethodDesc$, " ++ "\"$FullMethodName$\", opts...)\n"); + vars["Error_Check"] = "err != nil"; + GenerateError(printer, vars); + +- printer->Print(vars, "x := &$StreamType${stream}\n"); +- if (ServerOnlyStreaming(method)) { ++ printer->Print(vars, "x := &$StreamType${stream}\n"); ++ if (ServerOnlyStreaming(method)) { + vars["Error_Check"] = "err := x.ClientStream.SendMsg(in); err != nil"; + GenerateError(printer, vars); + vars["Error_Check"] = "err := x.ClientStream.CloseSend(); err != nil"; + GenerateError(printer, vars); +- } +- printer->Print("return x, nil\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- +- bool genSend = method->BidiStreaming() || ClientOnlyStreaming(method); +- bool genRecv = method->BidiStreaming() || ServerOnlyStreaming(method); +- bool genCloseAndRecv = ClientOnlyStreaming(method); +- +- //Stream interface +- printer->Print(vars, "type $Service$_$Method$Client interface {\n"); +- printer->Indent(); +- if (genSend) { +- printer->Print(vars, "Send(*$Request$) error\n"); +- } +- if (genRecv) { +- printer->Print(vars, "Recv() (*$Response$, error)\n"); +- } +- if (genCloseAndRecv) { +- printer->Print(vars, "CloseAndRecv() (*$Response$, error)\n"); +- } +- printer->Print(vars, "$grpc$.ClientStream\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- +- //Stream Client +- printer->Print(vars, "type $StreamType$ struct {\n"); +- printer->Indent(); +- printer->Print(vars, "$grpc$.ClientStream\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- +- if (genSend) { +- printer->Print(vars, "func (x *$StreamType$) Send(m *$Request$) error {\n"); +- printer->Indent(); +- printer->Print("return x.ClientStream.SendMsg(m)\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- } +- +- if (genRecv) { +- printer->Print(vars, "func (x *$StreamType$) Recv() (*$Response$, error) {\n"); +- printer->Indent(); +- printer->Print(vars, "m := new($Response$)\n"); ++ } ++ printer->Print("return x, nil\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ ++ bool genSend = method->BidiStreaming() || ClientOnlyStreaming(method); ++ bool genRecv = method->BidiStreaming() || ServerOnlyStreaming(method); ++ bool genCloseAndRecv = ClientOnlyStreaming(method); ++ ++ // Stream interface ++ printer->Print(vars, "type $Service$_$Method$Client interface {\n"); ++ printer->Indent(); ++ if (genSend) { printer->Print(vars, "Send(*$Request$) error\n"); } ++ if (genRecv) { printer->Print(vars, "Recv() (*$Response$, error)\n"); } ++ if (genCloseAndRecv) { ++ printer->Print(vars, "CloseAndRecv() (*$Response$, error)\n"); ++ } ++ printer->Print(vars, "$grpc$.ClientStream\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ ++ // Stream Client ++ printer->Print(vars, "type $StreamType$ struct {\n"); ++ printer->Indent(); ++ printer->Print(vars, "$grpc$.ClientStream\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ ++ if (genSend) { ++ printer->Print(vars, "func (x *$StreamType$) Send(m *$Request$) error {\n"); ++ printer->Indent(); ++ printer->Print("return x.ClientStream.SendMsg(m)\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ } ++ ++ if (genRecv) { ++ printer->Print(vars, ++ "func (x *$StreamType$) Recv() (*$Response$, error) {\n"); ++ printer->Indent(); ++ printer->Print(vars, "m := new($Response$)\n"); + vars["Error_Check"] = "err := x.ClientStream.RecvMsg(m); err != nil"; + GenerateError(printer, vars); +- printer->Print("return m, nil\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- } +- +- if (genCloseAndRecv) { +- printer->Print(vars, "func (x *$StreamType$) CloseAndRecv() (*$Response$, error) {\n"); +- printer->Indent(); ++ printer->Print("return m, nil\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ } ++ ++ if (genCloseAndRecv) { ++ printer->Print( ++ vars, "func (x *$StreamType$) CloseAndRecv() (*$Response$, error) {\n"); ++ printer->Indent(); + vars["Error_Check"] = "err := x.ClientStream.CloseSend(); err != nil"; + GenerateError(printer, vars); +- printer->Print(vars, "m := new($Response$)\n"); ++ printer->Print(vars, "m := new($Response$)\n"); + vars["Error_Check"] = "err := x.ClientStream.RecvMsg(m); err != nil"; + GenerateError(printer, vars); +- printer->Print("return m, nil\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- } ++ printer->Print("return m, nil\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ } + } + + // Generates client API for the service +-void GenerateService(const grpc_generator::Service *service, grpc_generator::Printer* printer, ++void GenerateService(const grpc_generator::Service *service, ++ grpc_generator::Printer *printer, + std::map vars) { +- vars["Service"] = exportName(service->name()); +- // Client Interface +- printer->Print(vars, "// Client API for $Service$ service\n"); +- printer->Print(vars, "type $Service$Client interface {\n"); +- printer->Indent(); ++ vars["Service"] = exportName(service->name()); ++ // Client Interface ++ printer->Print(vars, "// Client API for $Service$ service\n"); ++ printer->Print(vars, "type $Service$Client interface {\n"); ++ printer->Indent(); + vars["Ending"] = "\n"; +- for (int i = 0; i < service->method_count(); i++) { +- GenerateClientMethodSignature(service->method(i).get(), printer, vars); +- } +- printer->Outdent(); +- printer->Print("}\n\n"); +- +- // Client structure +- vars["ServiceUnexported"] = unexportName(vars["Service"]); +- printer->Print(vars, "type $ServiceUnexported$Client struct {\n"); +- printer->Indent(); +- printer->Print(vars, "cc $grpc$.ClientConnInterface\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- +- // NewClient +- printer->Print(vars, "func New$Service$Client(cc $grpc$.ClientConnInterface) $Service$Client {\n"); +- printer->Indent(); +- printer->Print(vars, "return &$ServiceUnexported$Client{cc}"); +- printer->Outdent(); +- printer->Print("\n}\n\n"); +- +- int unary_methods = 0, streaming_methods = 0; +- vars["ServiceDesc"] = "_" + vars["Service"] + "_serviceDesc"; +- for (int i = 0; i < service->method_count(); i++) { +- auto method = service->method(i); +- if (method->NoStreaming()) { +- vars["MethodDesc"] = vars["ServiceDesc"] + ".Method[" + as_string(unary_methods) + "]"; +- unary_methods++; +- } else { +- vars["MethodDesc"] = vars["ServiceDesc"] + ".Streams[" + as_string(streaming_methods) + "]"; +- streaming_methods++; +- } +- GenerateClientMethod(method.get(), printer, vars); +- } +- +- //Server Interface +- printer->Print(vars, "// Server API for $Service$ service\n"); +- printer->Print(vars, "type $Service$Server interface {\n"); +- printer->Indent(); ++ for (int i = 0; i < service->method_count(); i++) { ++ GenerateClientMethodSignature(service->method(i).get(), printer, vars); ++ } ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ ++ // Client structure ++ vars["ServiceUnexported"] = unexportName(vars["Service"]); ++ printer->Print(vars, "type $ServiceUnexported$Client struct {\n"); ++ printer->Indent(); ++ printer->Print(vars, "cc $grpc$.ClientConnInterface\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); ++ ++ // NewClient ++ printer->Print(vars, ++ "func New$Service$Client(cc $grpc$.ClientConnInterface) " ++ "$Service$Client {\n"); ++ printer->Indent(); ++ printer->Print(vars, "return &$ServiceUnexported$Client{cc}"); ++ printer->Outdent(); ++ printer->Print("\n}\n\n"); ++ ++ int unary_methods = 0, streaming_methods = 0; ++ vars["ServiceDesc"] = "_" + vars["Service"] + "_serviceDesc"; ++ for (int i = 0; i < service->method_count(); i++) { ++ auto method = service->method(i); ++ if (method->NoStreaming()) { ++ vars["MethodDesc"] = ++ vars["ServiceDesc"] + ".Method[" + as_string(unary_methods) + "]"; ++ unary_methods++; ++ } else { ++ vars["MethodDesc"] = vars["ServiceDesc"] + ".Streams[" + ++ as_string(streaming_methods) + "]"; ++ streaming_methods++; ++ } ++ GenerateClientMethod(method.get(), printer, vars); ++ } ++ ++ // Server Interface ++ printer->Print(vars, "// Server API for $Service$ service\n"); ++ printer->Print(vars, "type $Service$Server interface {\n"); ++ printer->Indent(); + vars["Ending"] = "\n"; +- for (int i = 0; i < service->method_count(); i++) { +- GenerateServerMethodSignature(service->method(i).get(), printer, vars); +- } ++ for (int i = 0; i < service->method_count(); i++) { ++ GenerateServerMethodSignature(service->method(i).get(), printer, vars); ++ } + printer->Print(vars, "mustEmbedUnimplemented$Service$Server()\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); + + printer->Print(vars, "type Unimplemented$Service$Server struct {\n"); + printer->Print("}\n\n"); +@@ -397,13 +399,17 @@ + printer->Print(vars, "func (Unimplemented$Service$Server) "); + GenerateServerMethodSignature(method.get(), printer, vars); + printer->Indent(); +- printer->Print(vars, "return $Nil$status.Errorf(codes.Unimplemented, \"method $Method$ not implemented\")\n"); ++ printer->Print(vars, ++ "return $Nil$status.Errorf(codes.Unimplemented, \"method " ++ "$Method$ not implemented\")\n"); + printer->Outdent(); + printer->Print("}\n"); + printer->Print("\n"); + } + +- printer->Print(vars, "func (Unimplemented$Service$Server) mustEmbedUnimplemented$Service$Server() {}"); ++ printer->Print(vars, ++ "func (Unimplemented$Service$Server) " ++ "mustEmbedUnimplemented$Service$Server() {}"); + printer->Print("\n\n"); + + printer->Print(vars, "type Unsafe$Service$Server interface {\n"); +@@ -411,91 +417,89 @@ + printer->Print(vars, "mustEmbedUnimplemented$Service$Server()\n"); + printer->Outdent(); + printer->Print("}\n\n"); +- // Server registration. +- printer->Print(vars, "func Register$Service$Server(s $grpc$.ServiceRegistrar, srv $Service$Server) {\n"); +- printer->Indent(); +- printer->Print(vars, "s.RegisterService(&$ServiceDesc$, srv)\n"); +- printer->Outdent(); +- printer->Print("}\n\n"); +- +- for (int i = 0; i < service->method_count(); i++) { +- GenerateServerMethod(service->method(i).get(), printer, vars); +- } +- +- +- //Service Descriptor +- printer->Print(vars, "var $ServiceDesc$ = $grpc$.ServiceDesc{\n"); +- printer->Indent(); +- printer->Print(vars, "ServiceName: \"$ServicePrefix$$Service$\",\n"); +- printer->Print(vars, "HandlerType: (*$Service$Server)(nil),\n"); +- printer->Print(vars, "Methods: []$grpc$.MethodDesc{\n"); +- printer->Indent(); +- for (int i = 0; i < service->method_count(); i++) { +- auto method = service->method(i); +- vars["Method"] = exportName(method->name()); +- vars["Handler"] = "_" + vars["Service"] + "_" + vars["Method"] + "_Handler"; +- if (method->NoStreaming()) { +- printer->Print("{\n"); +- printer->Indent(); +- printer->Print(vars, "MethodName: \"$Method$\",\n"); +- printer->Print(vars, "Handler: $Handler$,\n"); +- printer->Outdent(); +- printer->Print("},\n"); +- } +- } +- printer->Outdent(); +- printer->Print("},\n"); +- printer->Print(vars, "Streams: []$grpc$.StreamDesc{\n"); +- printer->Indent(); +- for (int i = 0; i < service->method_count(); i++) { +- auto method = service->method(i); +- vars["Method"] = exportName(method->name()); +- vars["Handler"] = "_" + vars["Service"] + "_" + vars["Method"] + "_Handler"; +- if (!method->NoStreaming()) { +- printer->Print("{\n"); +- printer->Indent(); +- printer->Print(vars, "StreamName: \"$Method$\",\n"); +- printer->Print(vars, "Handler: $Handler$,\n"); +- if (ClientOnlyStreaming(method.get())) { +- printer->Print("ClientStreams: true,\n"); +- } else if (ServerOnlyStreaming(method.get())) { +- printer->Print("ServerStreams: true,\n"); +- } else { +- printer->Print("ServerStreams: true,\n"); +- printer->Print("ClientStreams: true,\n"); +- } +- printer->Outdent(); +- printer->Print("},\n"); +- } +- } +- printer->Outdent(); +- printer->Print("},\n"); +- printer->Outdent(); +- printer->Print("}\n"); ++ // Server registration. ++ printer->Print(vars, ++ "func Register$Service$Server(s $grpc$.ServiceRegistrar, srv " ++ "$Service$Server) {\n"); ++ printer->Indent(); ++ printer->Print(vars, "s.RegisterService(&$ServiceDesc$, srv)\n"); ++ printer->Outdent(); ++ printer->Print("}\n\n"); + +-} ++ for (int i = 0; i < service->method_count(); i++) { ++ GenerateServerMethod(service->method(i).get(), printer, vars); ++ } + ++ // Service Descriptor ++ printer->Print(vars, "var $ServiceDesc$ = $grpc$.ServiceDesc{\n"); ++ printer->Indent(); ++ printer->Print(vars, "ServiceName: \"$ServicePrefix$$Service$\",\n"); ++ printer->Print(vars, "HandlerType: (*$Service$Server)(nil),\n"); ++ printer->Print(vars, "Methods: []$grpc$.MethodDesc{\n"); ++ printer->Indent(); ++ for (int i = 0; i < service->method_count(); i++) { ++ auto method = service->method(i); ++ vars["Method"] = exportName(method->name()); ++ vars["Handler"] = "_" + vars["Service"] + "_" + vars["Method"] + "_Handler"; ++ if (method->NoStreaming()) { ++ printer->Print("{\n"); ++ printer->Indent(); ++ printer->Print(vars, "MethodName: \"$Method$\",\n"); ++ printer->Print(vars, "Handler: $Handler$,\n"); ++ printer->Outdent(); ++ printer->Print("},\n"); ++ } ++ } ++ printer->Outdent(); ++ printer->Print("},\n"); ++ printer->Print(vars, "Streams: []$grpc$.StreamDesc{\n"); ++ printer->Indent(); ++ for (int i = 0; i < service->method_count(); i++) { ++ auto method = service->method(i); ++ vars["Method"] = exportName(method->name()); ++ vars["Handler"] = "_" + vars["Service"] + "_" + vars["Method"] + "_Handler"; ++ if (!method->NoStreaming()) { ++ printer->Print("{\n"); ++ printer->Indent(); ++ printer->Print(vars, "StreamName: \"$Method$\",\n"); ++ printer->Print(vars, "Handler: $Handler$,\n"); ++ if (ClientOnlyStreaming(method.get())) { ++ printer->Print("ClientStreams: true,\n"); ++ } else if (ServerOnlyStreaming(method.get())) { ++ printer->Print("ServerStreams: true,\n"); ++ } else { ++ printer->Print("ServerStreams: true,\n"); ++ printer->Print("ClientStreams: true,\n"); ++ } ++ printer->Outdent(); ++ printer->Print("},\n"); ++ } ++ } ++ printer->Outdent(); ++ printer->Print("},\n"); ++ printer->Outdent(); ++ printer->Print("}\n"); ++} + + // Returns source for the service + grpc::string GenerateServiceSource(grpc_generator::File *file, + const grpc_generator::Service *service, + grpc_go_generator::Parameters *parameters) { +- grpc::string out; +- auto p = file->CreatePrinter(&out, '\t'); ++ grpc::string out; ++ auto p = file->CreatePrinter(&out, '\t'); + p->SetIndentationSize(1); +- auto printer = p.get(); +- std::map vars; +- vars["Package"] = parameters->package_name; +- vars["ServicePrefix"] = parameters->service_prefix; +- if (!parameters->service_prefix.empty()) +- vars["ServicePrefix"].append("."); +- vars["grpc"] = "grpc"; +- vars["context"] = "context"; +- GenerateImports(file, printer, vars); +- if (parameters->custom_method_io_type != "") { +- vars["CustomMethodIO"] = parameters->custom_method_io_type; +- } +- GenerateService(service, printer, vars); +- return out; ++ auto printer = p.get(); ++ std::map vars; ++ vars["Package"] = parameters->package_name; ++ vars["ServicePrefix"] = parameters->service_prefix; ++ if (!parameters->service_prefix.empty()) vars["ServicePrefix"].append("."); ++ vars["grpc"] = "grpc"; ++ vars["context"] = "context"; ++ GenerateImports(file, printer, vars); ++ if (parameters->custom_method_io_type != "") { ++ vars["CustomMethodIO"] = parameters->custom_method_io_type; ++ } ++ GenerateService(service, printer, vars); ++ return out; + } +-}// Namespace grpc_go_generator ++} // Namespace grpc_go_generator +diff -urN a/grpc/src/compiler/go_generator.h b/grpc/src/compiler/go_generator.h +--- a/grpc/src/compiler/go_generator.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/go_generator.h 2023-01-13 07:46:52.838103910 +0000 +@@ -1,40 +1,8 @@ +-/* +- * +- * Copyright 2015, Google Inc. +- * All rights reserved. +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions are +- * met: +- * +- * * Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * * Redistributions in binary form must reproduce the above +- * copyright notice, this list of conditions and the following disclaimer +- * in the documentation and/or other materials provided with the +- * distribution. +- * * Neither the name of Google Inc. nor the names of its +- * contributors may be used to endorse or promote products derived from +- * this software without specific prior written permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- * +- */ +- + #ifndef GRPC_INTERNAL_COMPILER_GO_GENERATOR_H + #define GRPC_INTERNAL_COMPILER_GO_GENERATOR_H + +-//go generator is used to generate GRPC code for serialization system, such as flatbuffers ++// go generator is used to generate GRPC code for serialization system, such as ++// flatbuffers + #include + #include + +@@ -43,14 +11,15 @@ + namespace grpc_go_generator { + + struct Parameters { +- //Defines the custom parameter types for methods +- //eg: flatbuffers uses flatbuffers.Builder as input for the client and output for the server ++ // Defines the custom parameter types for methods ++ // eg: flatbuffers uses flatbuffers.Builder as input for the client and output ++ // for the server + grpc::string custom_method_io_type; + +- //Package name for the service ++ // Package name for the service + grpc::string package_name; + +- //Prefix for RPC Calls ++ // Prefix for RPC Calls + grpc::string service_prefix; + }; + +@@ -59,6 +28,6 @@ + const grpc_generator::Service *service, + grpc_go_generator::Parameters *parameters); + +-} ++} // namespace grpc_go_generator + + #endif // GRPC_INTERNAL_COMPILER_GO_GENERATOR_H +diff -urN a/grpc/src/compiler/java_generator.cc b/grpc/src/compiler/java_generator.cc +--- a/grpc/src/compiler/java_generator.cc 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/java_generator.cc 2023-01-13 07:46:52.852104040 +0000 +@@ -23,21 +23,18 @@ + #include + #include + +-// just to get flatbuffer_version_string() +-#include +-#include ++#include "flatbuffers/util.h" + #define to_string flatbuffers::NumToString + + // Stringify helpers used solely to cast GRPC_VERSION + #ifndef STR +-#define STR(s) #s ++# define STR(s) # s + #endif + + #ifndef XSTR +-#define XSTR(s) STR(s) ++# define XSTR(s) STR(s) + #endif + +- + typedef grpc_generator::Printer Printer; + typedef std::map VARS; + typedef grpc_generator::Service ServiceDescriptor; +@@ -48,12 +45,11 @@ + namespace grpc_java_generator { + typedef std::string string; + // Generates imports for the service +-void GenerateImports(grpc_generator::File* file, +- grpc_generator::Printer* printer, VARS& vars) { ++void GenerateImports(grpc_generator::File *file, ++ grpc_generator::Printer *printer, VARS &vars) { + vars["filename"] = file->filename(); +- printer->Print( +- vars, +- "//Generated by flatc compiler (version $flatc_version$)\n"); ++ printer->Print(vars, ++ "//Generated by flatc compiler (version $flatc_version$)\n"); + printer->Print("//If you make any local changes, they will be lost\n"); + printer->Print(vars, "//source: $filename$.fbs\n\n"); + printer->Print(vars, "package $Package$;\n\n"); +@@ -67,7 +63,7 @@ + // Adjust a method name prefix identifier to follow the JavaBean spec: + // - decapitalize the first letter + // - remove embedded underscores & capitalize the following letter +-static string MixedLower(const string& word) { ++static string MixedLower(const string &word) { + string w; + w += static_cast(tolower(word[0])); + bool after_underscore = false; +@@ -87,7 +83,7 @@ + // - An underscore is inserted where a lower case letter is followed by an + // upper case letter. + // - All letters are converted to upper case +-static string ToAllUpperCase(const string& word) { ++static string ToAllUpperCase(const string &word) { + string w; + for (size_t i = 0; i < word.length(); ++i) { + w += static_cast(toupper(word[i])); +@@ -98,47 +94,47 @@ + return w; + } + +-static inline string LowerMethodName(const MethodDescriptor* method) { ++static inline string LowerMethodName(const MethodDescriptor *method) { + return MixedLower(method->name()); + } + +-static inline string MethodPropertiesFieldName(const MethodDescriptor* method) { ++static inline string MethodPropertiesFieldName(const MethodDescriptor *method) { + return "METHOD_" + ToAllUpperCase(method->name()); + } + + static inline string MethodPropertiesGetterName( +- const MethodDescriptor* method) { ++ const MethodDescriptor *method) { + return MixedLower("get_" + method->name() + "_method"); + } + +-static inline string MethodIdFieldName(const MethodDescriptor* method) { ++static inline string MethodIdFieldName(const MethodDescriptor *method) { + return "METHODID_" + ToAllUpperCase(method->name()); + } + +-static inline string JavaClassName(VARS& vars, const string& name) { ++static inline string JavaClassName(VARS &vars, const string &name) { + // string name = google::protobuf::compiler::java::ClassName(desc); + return vars["Package"] + name; + } + +-static inline string ServiceClassName(const string& service_name) { ++static inline string ServiceClassName(const string &service_name) { + return service_name + "Grpc"; + } + + // TODO(nmittler): Remove once protobuf includes javadoc methods in + // distribution. +-template +-static void GrpcSplitStringToIteratorUsing(const string& full, +- const char* delim, ITR& result) { ++template ++static void GrpcSplitStringToIteratorUsing(const string &full, ++ const char *delim, ITR &result) { + // Optimize the common case where delim is a single character. + if (delim[0] != '\0' && delim[1] == '\0') { + char c = delim[0]; +- const char* p = full.data(); +- const char* end = p + full.size(); ++ const char *p = full.data(); ++ const char *end = p + full.size(); + while (p != end) { + if (*p == c) { + ++p; + } else { +- const char* start = p; ++ const char *start = p; + while (++p != end && *p != c) + ; + *result++ = string(start, p - start); +@@ -160,13 +156,13 @@ + } + } + +-static void GrpcSplitStringUsing(const string& full, const char* delim, +- std::vector* result) { ++static void GrpcSplitStringUsing(const string &full, const char *delim, ++ std::vector *result) { + std::back_insert_iterator> it(*result); + GrpcSplitStringToIteratorUsing(full, delim, it); + } + +-static std::vector GrpcSplit(const string& full, const char* delim) { ++static std::vector GrpcSplit(const string &full, const char *delim) { + std::vector result; + GrpcSplitStringUsing(full, delim, &result); + return result; +@@ -174,7 +170,7 @@ + + // TODO(nmittler): Remove once protobuf includes javadoc methods in + // distribution. +-static string GrpcEscapeJavadoc(const string& input) { ++static string GrpcEscapeJavadoc(const string &input) { + string result; + result.reserve(input.size() * 2); + +@@ -221,9 +217,7 @@ + // Java interprets Unicode escape sequences anywhere! + result.append("\"); + break; +- default: +- result.push_back(c); +- break; ++ default: result.push_back(c); break; + } + + prev = c; +@@ -232,7 +226,7 @@ + return result; + } + +-static std::vector GrpcGetDocLines(const string& comments) { ++static std::vector GrpcGetDocLines(const string &comments) { + if (!comments.empty()) { + // TODO(kenton): Ideally we should parse the comment text as Markdown and + // write it back as HTML, but this requires a Markdown parser. For now +@@ -243,27 +237,23 @@ + string escapedComments = GrpcEscapeJavadoc(comments); + + std::vector lines = GrpcSplit(escapedComments, "\n"); +- while (!lines.empty() && lines.back().empty()) { +- lines.pop_back(); +- } ++ while (!lines.empty() && lines.back().empty()) { lines.pop_back(); } + return lines; + } + return std::vector(); + } + + static std::vector GrpcGetDocLinesForDescriptor( +- const DescriptorType* descriptor) { ++ const DescriptorType *descriptor) { + return descriptor->GetAllComments(); + // return GrpcGetDocLines(descriptor->GetLeadingComments("///")); + } + +-static void GrpcWriteDocCommentBody(Printer* printer, VARS& vars, +- const std::vector& lines, ++static void GrpcWriteDocCommentBody(Printer *printer, VARS &vars, ++ const std::vector &lines, + bool surroundWithPreTag) { + if (!lines.empty()) { +- if (surroundWithPreTag) { +- printer->Print(" *
\n");
+-    }
++    if (surroundWithPreTag) { printer->Print(" * 
\n"); }
+ 
+     for (size_t i = 0; i < lines.size(); i++) {
+       // Most lines should start with a space.  Watch out for lines that start
+@@ -277,73 +267,72 @@
+       }
+     }
+ 
+-    if (surroundWithPreTag) {
+-      printer->Print(" * 
\n"); +- } ++ if (surroundWithPreTag) { printer->Print(" *
\n"); } + } + } + +-static void GrpcWriteDocComment(Printer* printer, VARS& vars, +- const string& comments) { ++static void GrpcWriteDocComment(Printer *printer, VARS &vars, ++ const string &comments) { + printer->Print("/**\n"); + std::vector lines = GrpcGetDocLines(comments); + GrpcWriteDocCommentBody(printer, vars, lines, false); + printer->Print(" */\n"); + } + +-static void GrpcWriteServiceDocComment(Printer* printer, VARS& vars, +- const ServiceDescriptor* service) { ++static void GrpcWriteServiceDocComment(Printer *printer, VARS &vars, ++ const ServiceDescriptor *service) { + printer->Print("/**\n"); + std::vector lines = GrpcGetDocLinesForDescriptor(service); + GrpcWriteDocCommentBody(printer, vars, lines, true); + printer->Print(" */\n"); + } + +-void GrpcWriteMethodDocComment(Printer* printer, VARS& vars, +- const MethodDescriptor* method) { ++void GrpcWriteMethodDocComment(Printer *printer, VARS &vars, ++ const MethodDescriptor *method) { + printer->Print("/**\n"); + std::vector lines = GrpcGetDocLinesForDescriptor(method); + GrpcWriteDocCommentBody(printer, vars, lines, true); + printer->Print(" */\n"); + } + +-//outputs static singleton extractor for type stored in "extr_type" and "extr_type_name" vars +-static void PrintTypeExtractor(Printer* p, VARS& vars) { +- p->Print( +- vars, +- "private static volatile FlatbuffersUtils.FBExtactor<$extr_type$> " +- "extractorOf$extr_type_name$;\n" +- "private static FlatbuffersUtils.FBExtactor<$extr_type$> " +- "getExtractorOf$extr_type_name$() {\n" +- " if (extractorOf$extr_type_name$ != null) return " +- "extractorOf$extr_type_name$;\n" +- " synchronized ($service_class_name$.class) {\n" +- " if (extractorOf$extr_type_name$ != null) return " +- "extractorOf$extr_type_name$;\n" +- " extractorOf$extr_type_name$ = new " +- "FlatbuffersUtils.FBExtactor<$extr_type$>() {\n" +- " public $extr_type$ extract (ByteBuffer buffer) {\n" +- " return " +- "$extr_type$.getRootAs$extr_type_name$(buffer);\n" +- " }\n" +- " };\n" +- " return extractorOf$extr_type_name$;\n" +- " }\n" +- "}\n\n"); ++// outputs static singleton extractor for type stored in "extr_type" and ++// "extr_type_name" vars ++static void PrintTypeExtractor(Printer *p, VARS &vars) { ++ p->Print(vars, ++ "private static volatile FlatbuffersUtils.FBExtactor<$extr_type$> " ++ "extractorOf$extr_type_name$;\n" ++ "private static FlatbuffersUtils.FBExtactor<$extr_type$> " ++ "getExtractorOf$extr_type_name$() {\n" ++ " if (extractorOf$extr_type_name$ != null) return " ++ "extractorOf$extr_type_name$;\n" ++ " synchronized ($service_class_name$.class) {\n" ++ " if (extractorOf$extr_type_name$ != null) return " ++ "extractorOf$extr_type_name$;\n" ++ " extractorOf$extr_type_name$ = new " ++ "FlatbuffersUtils.FBExtactor<$extr_type$>() {\n" ++ " public $extr_type$ extract (ByteBuffer buffer) {\n" ++ " return " ++ "$extr_type$.getRootAs$extr_type_name$(buffer);\n" ++ " }\n" ++ " };\n" ++ " return extractorOf$extr_type_name$;\n" ++ " }\n" ++ "}\n\n"); + } +-static void PrintMethodFields(Printer* p, VARS& vars, +- const ServiceDescriptor* service) { ++static void PrintMethodFields(Printer *p, VARS &vars, ++ const ServiceDescriptor *service) { + p->Print("// Static method descriptors that strictly reflect the proto.\n"); + vars["service_name"] = service->name(); + +- //set of names of rpc input- and output- types that were already encountered. +- //this is needed to avoid duplicating type extractor since it's possible that +- //the same type is used as an input or output type of more than a single RPC method ++ // set of names of rpc input- and output- types that were already encountered. ++ // this is needed to avoid duplicating type extractor since it's possible that ++ // the same type is used as an input or output type of more than a single RPC ++ // method + std::set encounteredTypes; + + for (int i = 0; i < service->method_count(); ++i) { + auto method = service->method(i); +- vars["arg_in_id"] = to_string(2L * i); //trying to make msvc 10 happy ++ vars["arg_in_id"] = to_string(2L * i); // trying to make msvc 10 happy + vars["arg_out_id"] = to_string(2L * i + 1); + vars["method_name"] = method->name(); + vars["input_type_name"] = method->get_input_type_name(); +@@ -353,8 +342,10 @@ + vars["method_field_name"] = MethodPropertiesFieldName(method.get()); + vars["method_new_field_name"] = MethodPropertiesGetterName(method.get()); + vars["method_method_name"] = MethodPropertiesGetterName(method.get()); +- bool client_streaming = method->ClientStreaming() || method->BidiStreaming(); +- bool server_streaming = method->ServerStreaming() || method->BidiStreaming(); ++ bool client_streaming = ++ method->ClientStreaming() || method->BidiStreaming(); ++ bool server_streaming = ++ method->ServerStreaming() || method->BidiStreaming(); + if (client_streaming) { + if (server_streaming) { + vars["method_type"] = "BIDI_STREAMING"; +@@ -394,32 +385,32 @@ + } + + p->Print( +- vars, +- "@$ExperimentalApi$(\"https://github.com/grpc/grpc-java/issues/" +- "1901\")\n" +- "public static $MethodDescriptor$<$input_type$,\n" +- " $output_type$> $method_method_name$() {\n" +- " $MethodDescriptor$<$input_type$, $output_type$> " +- "$method_new_field_name$;\n" +- " if (($method_new_field_name$ = " +- "$service_class_name$.$method_new_field_name$) == null) {\n" +- " synchronized ($service_class_name$.class) {\n" +- " if (($method_new_field_name$ = " +- "$service_class_name$.$method_new_field_name$) == null) {\n" +- " $service_class_name$.$method_new_field_name$ = " +- "$method_new_field_name$ = \n" +- " $MethodDescriptor$.<$input_type$, " +- "$output_type$>newBuilder()\n" +- " .setType($MethodType$.$method_type$)\n" +- " .setFullMethodName(generateFullMethodName(\n" +- " \"$Package$$service_name$\", \"$method_name$\"))\n" +- " .setSampledToLocalTracing(true)\n" +- " .setRequestMarshaller(FlatbuffersUtils.marshaller(\n" +- " $input_type$.class, " +- "getExtractorOf$input_type_name$()))\n" +- " .setResponseMarshaller(FlatbuffersUtils.marshaller(\n" +- " $output_type$.class, " +- "getExtractorOf$output_type_name$()))\n"); ++ vars, ++ "@$ExperimentalApi$(\"https://github.com/grpc/grpc-java/issues/" ++ "1901\")\n" ++ "public static $MethodDescriptor$<$input_type$,\n" ++ " $output_type$> $method_method_name$() {\n" ++ " $MethodDescriptor$<$input_type$, $output_type$> " ++ "$method_new_field_name$;\n" ++ " if (($method_new_field_name$ = " ++ "$service_class_name$.$method_new_field_name$) == null) {\n" ++ " synchronized ($service_class_name$.class) {\n" ++ " if (($method_new_field_name$ = " ++ "$service_class_name$.$method_new_field_name$) == null) {\n" ++ " $service_class_name$.$method_new_field_name$ = " ++ "$method_new_field_name$ = \n" ++ " $MethodDescriptor$.<$input_type$, " ++ "$output_type$>newBuilder()\n" ++ " .setType($MethodType$.$method_type$)\n" ++ " .setFullMethodName(generateFullMethodName(\n" ++ " \"$Package$$service_name$\", \"$method_name$\"))\n" ++ " .setSampledToLocalTracing(true)\n" ++ " .setRequestMarshaller(FlatbuffersUtils.marshaller(\n" ++ " $input_type$.class, " ++ "getExtractorOf$input_type_name$()))\n" ++ " .setResponseMarshaller(FlatbuffersUtils.marshaller(\n" ++ " $output_type$.class, " ++ "getExtractorOf$output_type_name$()))\n"); + + // vars["proto_method_descriptor_supplier"] = service->name() + + // "MethodDescriptorSupplier"; +@@ -451,11 +442,11 @@ + + enum CallType { ASYNC_CALL = 0, BLOCKING_CALL = 1, FUTURE_CALL = 2 }; + +-static void PrintBindServiceMethodBody(Printer* p, VARS& vars, +- const ServiceDescriptor* service); ++static void PrintBindServiceMethodBody(Printer *p, VARS &vars, ++ const ServiceDescriptor *service); + + // Prints a client interface or implementation class, or a server interface. +-static void PrintStub(Printer* p, VARS& vars, const ServiceDescriptor* service, ++static void PrintStub(Printer *p, VARS &vars, const ServiceDescriptor *service, + StubType type) { + const string service_name = service->name(); + vars["service_name"] = service_name; +@@ -476,7 +467,7 @@ + break; + case BLOCKING_CLIENT_INTERFACE: + interface = true; +- FLATBUFFERS_FALLTHROUGH(); // fall thru ++ FLATBUFFERS_FALLTHROUGH(); // fall thru + case BLOCKING_CLIENT_IMPL: + call_type = BLOCKING_CALL; + stub_name += "BlockingStub"; +@@ -484,7 +475,7 @@ + break; + case FUTURE_CLIENT_INTERFACE: + interface = true; +- FLATBUFFERS_FALLTHROUGH(); // fall thru ++ FLATBUFFERS_FALLTHROUGH(); // fall thru + case FUTURE_CLIENT_IMPL: + call_type = FUTURE_CALL; + stub_name += "FutureStub"; +@@ -501,9 +492,7 @@ + vars["client_name"] = client_name; + + // Class head +- if (!interface) { +- GrpcWriteServiceDocComment(p, vars, service); +- } ++ if (!interface) { GrpcWriteServiceDocComment(p, vars, service); } + if (impl_base) { + p->Print(vars, + "public static abstract class $abstract_name$ implements " +@@ -546,8 +535,10 @@ + vars["output_type"] = JavaClassName(vars, method->get_output_type_name()); + vars["lower_method_name"] = LowerMethodName(&*method); + vars["method_method_name"] = MethodPropertiesGetterName(&*method); +- bool client_streaming = method->ClientStreaming() || method->BidiStreaming(); +- bool server_streaming = method->ServerStreaming() || method->BidiStreaming(); ++ bool client_streaming = ++ method->ClientStreaming() || method->BidiStreaming(); ++ bool server_streaming = ++ method->ServerStreaming() || method->BidiStreaming(); + + if (call_type == BLOCKING_CALL && client_streaming) { + // Blocking client interface with client streaming is not available +@@ -563,9 +554,7 @@ + p->Print("\n"); + // TODO(nmittler): Replace with WriteMethodDocComment once included by the + // protobuf distro. +- if (!interface) { +- GrpcWriteMethodDocComment(p, vars, &*method); +- } ++ if (!interface) { GrpcWriteMethodDocComment(p, vars, &*method); } + p->Print("public "); + switch (call_type) { + case BLOCKING_CALL: +@@ -630,8 +619,7 @@ + "responseObserver);\n"); + } + break; +- default: +- break; ++ default: break; + } + } else if (!interface) { + switch (call_type) { +@@ -706,15 +694,15 @@ + } + + static bool CompareMethodClientStreaming( +- const std::unique_ptr& method1, +- const std::unique_ptr& method2) { ++ const std::unique_ptr &method1, ++ const std::unique_ptr &method2) { + return method1->ClientStreaming() < method2->ClientStreaming(); + } + + // Place all method invocations into a single class to reduce memory footprint + // on Android. +-static void PrintMethodHandlerClass(Printer* p, VARS& vars, +- const ServiceDescriptor* service) { ++static void PrintMethodHandlerClass(Printer *p, VARS &vars, ++ const ServiceDescriptor *service) { + // Sort method ids based on ClientStreaming() so switch tables are compact. + std::vector> sorted_methods( + service->method_count()); +@@ -724,7 +712,7 @@ + stable_sort(sorted_methods.begin(), sorted_methods.end(), + CompareMethodClientStreaming); + for (size_t i = 0; i < sorted_methods.size(); i++) { +- auto& method = sorted_methods[i]; ++ auto &method = sorted_methods[i]; + vars["method_id"] = to_string(i); + vars["method_id_name"] = MethodIdFieldName(&*method); + p->Print(vars, +@@ -757,9 +745,7 @@ + + for (int i = 0; i < service->method_count(); ++i) { + auto method = service->method(i); +- if (method->ClientStreaming() || method->BidiStreaming()) { +- continue; +- } ++ if (method->ClientStreaming() || method->BidiStreaming()) { continue; } + vars["method_id_name"] = MethodIdFieldName(&*method); + vars["lower_method_name"] = LowerMethodName(&*method); + vars["input_type"] = JavaClassName(vars, method->get_input_type_name()); +@@ -791,9 +777,7 @@ + + for (int i = 0; i < service->method_count(); ++i) { + auto method = service->method(i); +- if (!(method->ClientStreaming() || method->BidiStreaming())) { +- continue; +- } ++ if (!(method->ClientStreaming() || method->BidiStreaming())) { continue; } + vars["method_id_name"] = MethodIdFieldName(&*method); + vars["lower_method_name"] = LowerMethodName(&*method); + vars["input_type"] = JavaClassName(vars, method->get_input_type_name()); +@@ -818,8 +802,8 @@ + p->Print("}\n\n"); + } + +-static void PrintGetServiceDescriptorMethod(Printer* p, VARS& vars, +- const ServiceDescriptor* service) { ++static void PrintGetServiceDescriptorMethod(Printer *p, VARS &vars, ++ const ServiceDescriptor *service) { + vars["service_name"] = service->name(); + // vars["proto_base_descriptor_supplier"] = service->name() + + // "BaseDescriptorSupplier"; vars["proto_file_descriptor_supplier"] = +@@ -911,8 +895,8 @@ + p->Print("}\n"); + } + +-static void PrintBindServiceMethodBody(Printer* p, VARS& vars, +- const ServiceDescriptor* service) { ++static void PrintBindServiceMethodBody(Printer *p, VARS &vars, ++ const ServiceDescriptor *service) { + vars["service_name"] = service->name(); + p->Indent(); + p->Print(vars, +@@ -927,8 +911,10 @@ + vars["input_type"] = JavaClassName(vars, method->get_input_type_name()); + vars["output_type"] = JavaClassName(vars, method->get_output_type_name()); + vars["method_id_name"] = MethodIdFieldName(&*method); +- bool client_streaming = method->ClientStreaming() || method->BidiStreaming(); +- bool server_streaming = method->ServerStreaming() || method->BidiStreaming(); ++ bool client_streaming = ++ method->ClientStreaming() || method->BidiStreaming(); ++ bool server_streaming = ++ method->ServerStreaming() || method->BidiStreaming(); + if (client_streaming) { + if (server_streaming) { + vars["calls_method"] = "asyncBidiStreamingCall"; +@@ -962,8 +948,8 @@ + p->Outdent(); + } + +-static void PrintService(Printer* p, VARS& vars, +- const ServiceDescriptor* service, ++static void PrintService(Printer *p, VARS &vars, ++ const ServiceDescriptor *service, + bool disable_version) { + vars["service_name"] = service->name(); + vars["service_class_name"] = ServiceClassName(service->name()); +@@ -1043,7 +1029,7 @@ + p->Print("}\n"); + } + +-void PrintStaticImports(Printer* p) { ++void PrintStaticImports(Printer *p) { + p->Print( + "import java.nio.ByteBuffer;\n" + "import static " +@@ -1076,8 +1062,8 @@ + "io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;\n\n"); + } + +-void GenerateService(const grpc_generator::Service* service, +- grpc_generator::Printer* printer, VARS& vars, ++void GenerateService(const grpc_generator::Service *service, ++ grpc_generator::Printer *printer, VARS &vars, + bool disable_version) { + // All non-generated classes must be referred by fully qualified names to + // avoid collision with generated classes. +@@ -1113,8 +1099,8 @@ + } + + grpc::string GenerateServiceSource( +- grpc_generator::File* file, const grpc_generator::Service* service, +- grpc_java_generator::Parameters* parameters) { ++ grpc_generator::File *file, const grpc_generator::Service *service, ++ grpc_java_generator::Parameters *parameters) { + grpc::string out; + auto printer = file->CreatePrinter(&out); + VARS vars; +diff -urN a/grpc/src/compiler/python_generator.h b/grpc/src/compiler/python_generator.h +--- a/grpc/src/compiler/python_generator.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/python_generator.h 2023-01-13 07:46:52.933104788 +0000 +@@ -21,7 +21,6 @@ + + #include + +-#include "src/compiler/config.h" + #include "src/compiler/schema_interface.h" + + namespace grpc_python_generator { +diff -urN a/grpc/src/compiler/schema_interface.h b/grpc/src/compiler/schema_interface.h +--- a/grpc/src/compiler/schema_interface.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/schema_interface.h 2023-01-13 07:46:52.952104963 +0000 +@@ -19,11 +19,10 @@ + #ifndef GRPC_INTERNAL_COMPILER_SCHEMA_INTERFACE_H + #define GRPC_INTERNAL_COMPILER_SCHEMA_INTERFACE_H + ++#include + #include + #include + +-#include "src/compiler/config.h" +- + #ifndef GRPC_CUSTOM_STRING + # include + # define GRPC_CUSTOM_STRING std::string +@@ -93,7 +92,7 @@ + virtual void Print(const std::map &vars, + const char *template_string) = 0; + virtual void Print(const char *string) = 0; +- virtual void SetIndentationSize(const int size) = 0; ++ virtual void SetIndentationSize(const size_t size) = 0; + virtual void Indent() = 0; + virtual void Outdent() = 0; + }; +@@ -108,6 +107,8 @@ + virtual grpc::string package() const = 0; + virtual std::vector package_parts() const = 0; + virtual grpc::string additional_headers() const = 0; ++ virtual std::string message_header_ext() const = 0; ++ virtual std::string service_header_ext() const = 0; + + virtual int service_count() const = 0; + virtual std::unique_ptr service(int i) const = 0; +diff -urN a/grpc/src/compiler/swift_generator.h b/grpc/src/compiler/swift_generator.h +--- a/grpc/src/compiler/swift_generator.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/swift_generator.h 2023-01-13 07:46:52.964105074 +0000 +@@ -1,40 +1,22 @@ + /* ++ * Copyright 2020 Google Inc. All rights reserved. + * +- * Copyright 2020, Google Inc. +- * All rights reserved. ++ * 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 + * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions are +- * met: +- * +- * * Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * * Redistributions in binary form must reproduce the above +- * copyright notice, this list of conditions and the following disclaimer +- * in the documentation and/or other materials provided with the +- * distribution. +- * * Neither the name of Google Inc. nor the names of its +- * contributors may be used to endorse or promote products derived from +- * this software without specific prior written permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * 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. + */ + + #include + #include + +-#include "src/compiler/config.h" + #include "src/compiler/schema_interface.h" + + #ifndef GRPC_CUSTOM_STRING +diff -urN a/grpc/src/compiler/ts_generator.cc b/grpc/src/compiler/ts_generator.cc +--- a/grpc/src/compiler/ts_generator.cc 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/ts_generator.cc 2023-01-13 07:46:52.965105084 +0000 +@@ -46,13 +46,14 @@ + return dasherized_case; + } + +-grpc::string GenerateNamespace(const std::vector namepsace, ++ ++grpc::string GenerateNamespace(const std::vector ns, + const std::string filename, + const bool include_separator) { + grpc::string path = ""; + if (include_separator) path += "."; + +- for (auto it = namepsace.begin(); it < namepsace.end(); it++) { ++ for (auto it = ns.begin(); it < ns.end(); it++) { + if (include_separator) path += "/"; + path += include_separator ? ToDasherizedCase(*it) : *it + "_"; + } +@@ -105,9 +106,9 @@ + } + printer->Print("\n"); + if (grpc_var_import) +- printer->Print("var grpc = require('grpc');\n"); ++ printer->Print("var grpc = require('@grpc/grpc-js');\n"); + else +- printer->Print("import * as grpc from 'grpc';\n"); ++ printer->Print("import * as grpc from '@grpc/grpc-js';\n"); + printer->Print("\n"); + } + +@@ -136,7 +137,7 @@ + "throw new Error('Expected argument of type $VALUE$');\n"); + printer->Outdent(); + printer->Print("}\n"); +- printer->Print(vars, "return buffer_args.serialize();\n"); ++ printer->Print(vars, "return Buffer.from(buffer_args.serialize());\n"); + printer->Outdent(); + printer->Print("}\n\n"); + } +@@ -288,7 +289,9 @@ + const grpc_generator::Service *service, grpc_generator::Printer *printer, + std::map *dictonary) { + auto vars = *dictonary; +- printer->Print(vars, "export interface I$ServiceName$Server {\n"); ++ printer->Print(vars, ++ "export interface I$ServiceName$Server extends " ++ "grpc.UntypedServiceImplementation {\n"); + printer->Indent(); + for (auto it = 0; it < service->method_count(); it++) { + auto method = service->method(it); +@@ -463,7 +466,7 @@ + printer->Indent(); + printer->Print( + "constructor(address: string, credentials: grpc.ChannelCredentials, " +- "options?: object);"); ++ "options?: object);\n"); + for (auto it = 0; it < service->method_count(); it++) { + auto method = service->method(it); + vars["MethodName"] = method->name(); +diff -urN a/grpc/src/compiler/ts_generator.h b/grpc/src/compiler/ts_generator.h +--- a/grpc/src/compiler/ts_generator.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/src/compiler/ts_generator.h 2023-01-13 07:46:53.145106745 +0000 +@@ -1,41 +1,7 @@ +-/* +- * +- * Copyright 2020, Google Inc. +- * All rights reserved. +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions are +- * met: +- * +- * * Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * * Redistributions in binary form must reproduce the above +- * copyright notice, this list of conditions and the following disclaimer +- * in the documentation and/or other materials provided with the +- * distribution. +- * * Neither the name of Google Inc. nor the names of its +- * contributors may be used to endorse or promote products derived from +- * this software without specific prior written permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- * +- */ +- + #include +-#include + #include ++#include + +-#include "src/compiler/config.h" + #include "src/compiler/schema_interface.h" + + #ifndef GRPC_CUSTOM_STRING +@@ -58,4 +24,3 @@ + const grpc_generator::Service *service, + const grpc::string &filename); + } // namespace grpc_ts_generator +- +diff -urN a/grpc/tests/go_test.go b/grpc/tests/go_test.go +--- a/grpc/tests/go_test.go 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/tests/go_test.go 2023-01-13 07:46:49.797075827 +0000 +@@ -1,8 +1,8 @@ + package testing + + import ( +- "../../tests/MyGame/Example" + flatbuffers "github.com/google/flatbuffers/go" ++ "github.com/google/flatbuffers/tests/MyGame/Example" + + "context" + "net" +@@ -12,7 +12,9 @@ + "google.golang.org/grpc/encoding" + ) + +-type server struct{} ++type server struct { ++ Example.UnimplementedMonsterStorageServer ++} + + // test used to send and receive in grpc methods + var test = "Flatbuffers" +@@ -65,8 +67,12 @@ + if err != nil { + t.Fatalf("Retrieve client failed: %v", err) + } +- if string(out.Name()) != test { +- t.Errorf("RetrieveClient failed: expected=%s, got=%s\n", test, out.Name()) ++ monster, err := out.Recv() ++ if err != nil { ++ t.Fatalf("Recv failed: %v", err) ++ } ++ if string(monster.Name()) != test { ++ t.Errorf("RetrieveClient failed: expected=%s, got=%s\n", test, monster.Name()) + t.Fail() + } + } +diff -urN a/grpc/tests/grpctest.py b/grpc/tests/grpctest.py +--- a/grpc/tests/grpctest.py 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/tests/grpctest.py 2023-01-13 07:46:49.797075827 +0000 +@@ -126,16 +126,16 @@ + Monster.MonsterStartInventoryVector(b, len(test_inventory)) + for i in range(0, len(test_inventory)): + b.PrependByte(test_inventory[i]) +- inv = b.EndVector(len(test_inventory)) ++ inv = b.EndVector() + + Monster.MonsterStartTest4Vector(b, 2) + Test.CreateTest(b, 10, 20) + Test.CreateTest(b, 30, 40) +- test4 = b.EndVector(2) ++ test4 = b.EndVector() + + Monster.MonsterStartTestarrayofstringVector(b, 1) + b.PrependUOffsetTRelative(test1) +- test_array_of_string = b.EndVector(1) ++ test_array_of_string = b.EndVector() + + Monster.MonsterStart(b) + +diff -urN a/grpc/tests/message_builder_test.cpp b/grpc/tests/message_builder_test.cpp +--- a/grpc/tests/message_builder_test.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/tests/message_builder_test.cpp 2023-01-13 07:46:49.798075836 +0000 +@@ -28,7 +28,7 @@ + auto root_offset1 = populate1(dst); + dst.Finish(root_offset1); + size_t size, offset; +- grpc_slice slice; ++ ::grpc::Slice slice; + dst.ReleaseRaw(size, offset, slice); + flatbuffers::FlatBufferBuilder src; + auto root_offset2 = populate2(src); +@@ -39,7 +39,6 @@ + TEST_EQ(dst.GetSize(), src_size); + TEST_ASSERT(release_n_verify(dst, m2_name(), m2_color())); + TEST_EQ(src.GetSize(), 0); +- grpc_slice_unref(slice); + } + + template +@@ -82,10 +81,9 @@ + auto root_offset1 = populate1(mb); + mb.Finish(root_offset1); + size_t size, offset; +- grpc_slice slice; ++ ::grpc::Slice slice; + const uint8_t *buf = mb.ReleaseRaw(size, offset, slice); + TEST_ASSERT_FUNC(verify(buf, offset, m1_name(), m1_color())); +- grpc_slice_unref(slice); + } + } + +@@ -146,10 +144,9 @@ + auto root_offset1 = populate1(dst); + dst.Finish(root_offset1); + size_t size, offset; +- grpc_slice slice = grpc_empty_slice(); ++ ::grpc::Slice slice; + const uint8_t *buf = dst.ReleaseRaw(size, offset, slice); + TEST_ASSERT_FUNC(verify(buf, offset, m1_name(), m1_color())); +- grpc_slice_unref(slice); + + SrcBuilder src; + dst = std::move(src); +diff -urN a/grpc/tests/pom.xml b/grpc/tests/pom.xml +--- a/grpc/tests/pom.xml 2021-05-10 18:45:16.000000000 +0000 ++++ b/grpc/tests/pom.xml 2023-01-13 07:46:49.798075836 +0000 +@@ -4,13 +4,13 @@ + + com.google.flatbuffers + flatbuffers-parent +- 2.0.0 ++ 2.0.3 + + grpc-test + Example/Test project demonstrating usage of flatbuffers with GRPC-Java instead of protobufs + + +- 2.0.0 ++ 2.0.3 + + + +diff -urN a/include/flatbuffers/allocator.h b/include/flatbuffers/allocator.h +--- a/include/flatbuffers/allocator.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/allocator.h 2023-01-13 07:47:06.299228228 +0000 +@@ -0,0 +1,68 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_ALLOCATOR_H_ ++#define FLATBUFFERS_ALLOCATOR_H_ ++ ++#include "flatbuffers/base.h" ++ ++namespace flatbuffers { ++ ++// Allocator interface. This is flatbuffers-specific and meant only for ++// `vector_downward` usage. ++class Allocator { ++ public: ++ virtual ~Allocator() {} ++ ++ // Allocate `size` bytes of memory. ++ virtual uint8_t *allocate(size_t size) = 0; ++ ++ // Deallocate `size` bytes of memory at `p` allocated by this allocator. ++ virtual void deallocate(uint8_t *p, size_t size) = 0; ++ ++ // Reallocate `new_size` bytes of memory, replacing the old region of size ++ // `old_size` at `p`. In contrast to a normal realloc, this grows downwards, ++ // and is intended specifcally for `vector_downward` use. ++ // `in_use_back` and `in_use_front` indicate how much of `old_size` is ++ // actually in use at each end, and needs to be copied. ++ virtual uint8_t *reallocate_downward(uint8_t *old_p, size_t old_size, ++ size_t new_size, size_t in_use_back, ++ size_t in_use_front) { ++ FLATBUFFERS_ASSERT(new_size > old_size); // vector_downward only grows ++ uint8_t *new_p = allocate(new_size); ++ memcpy_downward(old_p, old_size, new_p, new_size, in_use_back, ++ in_use_front); ++ deallocate(old_p, old_size); ++ return new_p; ++ } ++ ++ protected: ++ // Called by `reallocate_downward` to copy memory from `old_p` of `old_size` ++ // to `new_p` of `new_size`. Only memory of size `in_use_front` and ++ // `in_use_back` will be copied from the front and back of the old memory ++ // allocation. ++ void memcpy_downward(uint8_t *old_p, size_t old_size, uint8_t *new_p, ++ size_t new_size, size_t in_use_back, ++ size_t in_use_front) { ++ memcpy(new_p + new_size - in_use_back, old_p + old_size - in_use_back, ++ in_use_back); ++ memcpy(new_p, old_p, in_use_front); ++ } ++}; ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_ALLOCATOR_H_ +\ No newline at end of file +diff -urN a/include/flatbuffers/array.h b/include/flatbuffers/array.h +--- a/include/flatbuffers/array.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/array.h 2023-01-13 07:47:06.299228228 +0000 +@@ -0,0 +1,243 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_ARRAY_H_ ++#define FLATBUFFERS_ARRAY_H_ ++ ++#include "flatbuffers/base.h" ++#include "flatbuffers/stl_emulation.h" ++#include "flatbuffers/vector.h" ++ ++namespace flatbuffers { ++ ++// This is used as a helper type for accessing arrays. ++template class Array { ++ // Array can carry only POD data types (scalars or structs). ++ typedef typename flatbuffers::bool_constant::value> ++ scalar_tag; ++ typedef ++ typename flatbuffers::conditional::type ++ IndirectHelperType; ++ ++ public: ++ typedef uint16_t size_type; ++ typedef typename IndirectHelper::return_type return_type; ++ typedef VectorIterator const_iterator; ++ typedef VectorReverseIterator const_reverse_iterator; ++ ++ // If T is a LE-scalar or a struct (!scalar_tag::value). ++ static FLATBUFFERS_CONSTEXPR bool is_span_observable = ++ (scalar_tag::value && (FLATBUFFERS_LITTLEENDIAN || sizeof(T) == 1)) || ++ !scalar_tag::value; ++ ++ FLATBUFFERS_CONSTEXPR uint16_t size() const { return length; } ++ ++ return_type Get(uoffset_t i) const { ++ FLATBUFFERS_ASSERT(i < size()); ++ return IndirectHelper::Read(Data(), i); ++ } ++ ++ return_type operator[](uoffset_t i) const { return Get(i); } ++ ++ // If this is a Vector of enums, T will be its storage type, not the enum ++ // type. This function makes it convenient to retrieve value with enum ++ // type E. ++ template E GetEnum(uoffset_t i) const { ++ return static_cast(Get(i)); ++ } ++ ++ const_iterator begin() const { return const_iterator(Data(), 0); } ++ const_iterator end() const { return const_iterator(Data(), size()); } ++ ++ const_reverse_iterator rbegin() const { ++ return const_reverse_iterator(end()); ++ } ++ const_reverse_iterator rend() const { ++ return const_reverse_iterator(begin()); ++ } ++ ++ const_iterator cbegin() const { return begin(); } ++ const_iterator cend() const { return end(); } ++ ++ const_reverse_iterator crbegin() const { return rbegin(); } ++ const_reverse_iterator crend() const { return rend(); } ++ ++ // Get a mutable pointer to elements inside this array. ++ // This method used to mutate arrays of structs followed by a @p Mutate ++ // operation. For primitive types use @p Mutate directly. ++ // @warning Assignments and reads to/from the dereferenced pointer are not ++ // automatically converted to the correct endianness. ++ typename flatbuffers::conditional::type ++ GetMutablePointer(uoffset_t i) const { ++ FLATBUFFERS_ASSERT(i < size()); ++ return const_cast(&data()[i]); ++ } ++ ++ // Change elements if you have a non-const pointer to this object. ++ void Mutate(uoffset_t i, const T &val) { MutateImpl(scalar_tag(), i, val); } ++ ++ // The raw data in little endian format. Use with care. ++ const uint8_t *Data() const { return data_; } ++ ++ uint8_t *Data() { return data_; } ++ ++ // Similarly, but typed, much like std::vector::data ++ const T *data() const { return reinterpret_cast(Data()); } ++ T *data() { return reinterpret_cast(Data()); } ++ ++ // Copy data from a span with endian conversion. ++ // If this Array and the span overlap, the behavior is undefined. ++ void CopyFromSpan(flatbuffers::span src) { ++ const auto p1 = reinterpret_cast(src.data()); ++ const auto p2 = Data(); ++ FLATBUFFERS_ASSERT(!(p1 >= p2 && p1 < (p2 + length)) && ++ !(p2 >= p1 && p2 < (p1 + length))); ++ (void)p1; ++ (void)p2; ++ CopyFromSpanImpl(flatbuffers::bool_constant(), src); ++ } ++ ++ protected: ++ void MutateImpl(flatbuffers::true_type, uoffset_t i, const T &val) { ++ FLATBUFFERS_ASSERT(i < size()); ++ WriteScalar(data() + i, val); ++ } ++ ++ void MutateImpl(flatbuffers::false_type, uoffset_t i, const T &val) { ++ *(GetMutablePointer(i)) = val; ++ } ++ ++ void CopyFromSpanImpl(flatbuffers::true_type, ++ flatbuffers::span src) { ++ // Use std::memcpy() instead of std::copy() to avoid performance degradation ++ // due to aliasing if T is char or unsigned char. ++ // The size is known at compile time, so memcpy would be inlined. ++ std::memcpy(data(), src.data(), length * sizeof(T)); ++ } ++ ++ // Copy data from flatbuffers::span with endian conversion. ++ void CopyFromSpanImpl(flatbuffers::false_type, ++ flatbuffers::span src) { ++ for (size_type k = 0; k < length; k++) { Mutate(k, src[k]); } ++ } ++ ++ // This class is only used to access pre-existing data. Don't ever ++ // try to construct these manually. ++ // 'constexpr' allows us to use 'size()' at compile time. ++ // @note Must not use 'FLATBUFFERS_CONSTEXPR' here, as const is not allowed on ++ // a constructor. ++#if defined(__cpp_constexpr) ++ constexpr Array(); ++#else ++ Array(); ++#endif ++ ++ uint8_t data_[length * sizeof(T)]; ++ ++ private: ++ // This class is a pointer. Copying will therefore create an invalid object. ++ // Private and unimplemented copy constructor. ++ Array(const Array &); ++ Array &operator=(const Array &); ++}; ++ ++// Specialization for Array[struct] with access using Offset pointer. ++// This specialization used by idl_gen_text.cpp. ++template class Array, length> { ++ static_assert(flatbuffers::is_same::value, "unexpected type T"); ++ ++ public: ++ typedef const void *return_type; ++ ++ const uint8_t *Data() const { return data_; } ++ ++ // Make idl_gen_text.cpp::PrintContainer happy. ++ return_type operator[](uoffset_t) const { ++ FLATBUFFERS_ASSERT(false); ++ return nullptr; ++ } ++ ++ private: ++ // This class is only used to access pre-existing data. ++ Array(); ++ Array(const Array &); ++ Array &operator=(const Array &); ++ ++ uint8_t data_[1]; ++}; ++ ++template ++FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span(Array &arr) ++ FLATBUFFERS_NOEXCEPT { ++ static_assert( ++ Array::is_span_observable, ++ "wrong type U, only plain struct, LE-scalar, or byte types are allowed"); ++ return span(arr.data(), N); ++} ++ ++template ++FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span( ++ const Array &arr) FLATBUFFERS_NOEXCEPT { ++ static_assert( ++ Array::is_span_observable, ++ "wrong type U, only plain struct, LE-scalar, or byte types are allowed"); ++ return span(arr.data(), N); ++} ++ ++template ++FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span ++make_bytes_span(Array &arr) FLATBUFFERS_NOEXCEPT { ++ static_assert(Array::is_span_observable, ++ "internal error, Array might hold only scalars or structs"); ++ return span(arr.Data(), sizeof(U) * N); ++} ++ ++template ++FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span ++make_bytes_span(const Array &arr) FLATBUFFERS_NOEXCEPT { ++ static_assert(Array::is_span_observable, ++ "internal error, Array might hold only scalars or structs"); ++ return span(arr.Data(), sizeof(U) * N); ++} ++ ++// Cast a raw T[length] to a raw flatbuffers::Array ++// without endian conversion. Use with care. ++// TODO: move these Cast-methods to `internal` namespace. ++template ++Array &CastToArray(T (&arr)[length]) { ++ return *reinterpret_cast *>(arr); ++} ++ ++template ++const Array &CastToArray(const T (&arr)[length]) { ++ return *reinterpret_cast *>(arr); ++} ++ ++template ++Array &CastToArrayOfEnum(T (&arr)[length]) { ++ static_assert(sizeof(E) == sizeof(T), "invalid enum type E"); ++ return *reinterpret_cast *>(arr); ++} ++ ++template ++const Array &CastToArrayOfEnum(const T (&arr)[length]) { ++ static_assert(sizeof(E) == sizeof(T), "invalid enum type E"); ++ return *reinterpret_cast *>(arr); ++} ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_ARRAY_H_ +diff -urN a/include/flatbuffers/base.h b/include/flatbuffers/base.h +--- a/include/flatbuffers/base.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/include/flatbuffers/base.h 2023-01-13 07:47:06.299228228 +0000 +@@ -50,10 +50,6 @@ + #include + #endif + +-#ifdef _STLPORT_VERSION +- #define FLATBUFFERS_CPP98_STL +-#endif +- + #ifdef __ANDROID__ + #include + #endif +@@ -144,7 +140,7 @@ + + #define FLATBUFFERS_VERSION_MAJOR 2 + #define FLATBUFFERS_VERSION_MINOR 0 +-#define FLATBUFFERS_VERSION_REVISION 0 ++#define FLATBUFFERS_VERSION_REVISION 6 + #define FLATBUFFERS_STRING_EXPAND(X) #X + #define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X) + namespace flatbuffers { +@@ -247,6 +243,11 @@ + #endif // __has_include + #endif // !FLATBUFFERS_HAS_STRING_VIEW + ++#ifndef FLATBUFFERS_GENERAL_HEAP_ALLOC_OK ++ // Allow heap allocations to be used ++ #define FLATBUFFERS_GENERAL_HEAP_ALLOC_OK 1 ++#endif // !FLATBUFFERS_GENERAL_HEAP_ALLOC_OK ++ + #ifndef FLATBUFFERS_HAS_NEW_STRTOD + // Modern (C++11) strtod and strtof functions are available for use. + // 1) nan/inf strings as argument of strtod; +@@ -289,7 +290,7 @@ + #if ((__cplusplus >= 201703L) \ + || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))) + // All attributes unknown to an implementation are ignored without causing an error. +- #define FLATBUFFERS_ATTRIBUTE(attr) [[attr]] ++ #define FLATBUFFERS_ATTRIBUTE(attr) attr + + #define FLATBUFFERS_FALLTHROUGH() [[fallthrough]] + #else +@@ -330,6 +331,9 @@ + // We support aligning the contents of buffers up to this size. + #define FLATBUFFERS_MAX_ALIGNMENT 16 + ++/// @brief The length of a FlatBuffer file header. ++static const size_t kFileIdentifierLength = 4; ++ + inline bool VerifyAlignmentRequirements(size_t align, size_t min_align = 1) { + return (min_align <= align) && (align <= (FLATBUFFERS_MAX_ALIGNMENT)) && + (align & (align - 1)) == 0; // must be power of 2 +@@ -433,5 +437,38 @@ + return ((~buf_size) + 1) & (scalar_size - 1); + } + ++// Generic 'operator==' with conditional specialisations. ++// T e - new value of a scalar field. ++// T def - default of scalar (is known at compile-time). ++template inline bool IsTheSameAs(T e, T def) { return e == def; } ++ ++#if defined(FLATBUFFERS_NAN_DEFAULTS) && \ ++ defined(FLATBUFFERS_HAS_NEW_STRTOD) && (FLATBUFFERS_HAS_NEW_STRTOD > 0) ++// Like `operator==(e, def)` with weak NaN if T=(float|double). ++template inline bool IsFloatTheSameAs(T e, T def) { ++ return (e == def) || ((def != def) && (e != e)); ++} ++template<> inline bool IsTheSameAs(float e, float def) { ++ return IsFloatTheSameAs(e, def); ++} ++template<> inline bool IsTheSameAs(double e, double def) { ++ return IsFloatTheSameAs(e, def); ++} ++#endif ++ ++// Check 'v' is out of closed range [low; high]. ++// Workaround for GCC warning [-Werror=type-limits]: ++// comparison is always true due to limited range of data type. ++template ++inline bool IsOutRange(const T &v, const T &low, const T &high) { ++ return (v < low) || (high < v); ++} ++ ++// Check 'v' is in closed range [low; high]. ++template ++inline bool IsInRange(const T &v, const T &low, const T &high) { ++ return !IsOutRange(v, low, high); ++} ++ + } // namespace flatbuffers + #endif // FLATBUFFERS_BASE_H_ +diff -urN a/include/flatbuffers/bfbs_generator.h b/include/flatbuffers/bfbs_generator.h +--- a/include/flatbuffers/bfbs_generator.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/bfbs_generator.h 2023-01-13 07:47:06.299228228 +0000 +@@ -0,0 +1,43 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_BFBS_GENERATOR_H_ ++#define FLATBUFFERS_BFBS_GENERATOR_H_ ++ ++#include ++ ++namespace flatbuffers { ++ ++enum GeneratorStatus { ++ OK, ++ FAILED, ++ FAILED_VERIFICATION, ++}; ++ ++// A Flatbuffer Code Generator that receives a binary serialized reflection.fbs ++// and generates code from it. ++class BfbsGenerator { ++ public: ++ virtual ~BfbsGenerator() {} ++ ++ // Generate code from the provided `buffer` of given `length`. The buffer is ++ // a serialized reflection.fbs. ++ virtual GeneratorStatus Generate(const uint8_t *buffer, int64_t length) = 0; ++}; ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_BFBS_GENERATOR_H_ +diff -urN a/include/flatbuffers/buffer.h b/include/flatbuffers/buffer.h +--- a/include/flatbuffers/buffer.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/buffer.h 2023-01-13 07:47:06.299228228 +0000 +@@ -0,0 +1,142 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_BUFFER_H_ ++#define FLATBUFFERS_BUFFER_H_ ++ ++#include "flatbuffers/base.h" ++ ++namespace flatbuffers { ++ ++// Wrapper for uoffset_t to allow safe template specialization. ++// Value is allowed to be 0 to indicate a null object (see e.g. AddOffset). ++template struct Offset { ++ uoffset_t o; ++ Offset() : o(0) {} ++ Offset(uoffset_t _o) : o(_o) {} ++ Offset Union() const { return Offset(o); } ++ bool IsNull() const { return !o; } ++}; ++ ++inline void EndianCheck() { ++ int endiantest = 1; ++ // If this fails, see FLATBUFFERS_LITTLEENDIAN above. ++ FLATBUFFERS_ASSERT(*reinterpret_cast(&endiantest) == ++ FLATBUFFERS_LITTLEENDIAN); ++ (void)endiantest; ++} ++ ++template FLATBUFFERS_CONSTEXPR size_t AlignOf() { ++ // clang-format off ++ #ifdef _MSC_VER ++ return __alignof(T); ++ #else ++ #ifndef alignof ++ return __alignof__(T); ++ #else ++ return alignof(T); ++ #endif ++ #endif ++ // clang-format on ++} ++ ++// Lexicographically compare two strings (possibly containing nulls), and ++// return true if the first is less than the second. ++static inline bool StringLessThan(const char *a_data, uoffset_t a_size, ++ const char *b_data, uoffset_t b_size) { ++ const auto cmp = memcmp(a_data, b_data, (std::min)(a_size, b_size)); ++ return cmp == 0 ? a_size < b_size : cmp < 0; ++} ++ ++// When we read serialized data from memory, in the case of most scalars, ++// we want to just read T, but in the case of Offset, we want to actually ++// perform the indirection and return a pointer. ++// The template specialization below does just that. ++// It is wrapped in a struct since function templates can't overload on the ++// return type like this. ++// The typedef is for the convenience of callers of this function ++// (avoiding the need for a trailing return decltype) ++template struct IndirectHelper { ++ typedef T return_type; ++ typedef T mutable_return_type; ++ static const size_t element_stride = sizeof(T); ++ static return_type Read(const uint8_t *p, uoffset_t i) { ++ return EndianScalar((reinterpret_cast(p))[i]); ++ } ++}; ++template struct IndirectHelper> { ++ typedef const T *return_type; ++ typedef T *mutable_return_type; ++ static const size_t element_stride = sizeof(uoffset_t); ++ static return_type Read(const uint8_t *p, uoffset_t i) { ++ p += i * sizeof(uoffset_t); ++ return reinterpret_cast(p + ReadScalar(p)); ++ } ++}; ++template struct IndirectHelper { ++ typedef const T *return_type; ++ typedef T *mutable_return_type; ++ static const size_t element_stride = sizeof(T); ++ static return_type Read(const uint8_t *p, uoffset_t i) { ++ return reinterpret_cast(p + i * sizeof(T)); ++ } ++}; ++ ++/// @brief Get a pointer to the the file_identifier section of the buffer. ++/// @return Returns a const char pointer to the start of the file_identifier ++/// characters in the buffer. The returned char * has length ++/// 'flatbuffers::FlatBufferBuilder::kFileIdentifierLength'. ++/// This function is UNDEFINED for FlatBuffers whose schema does not include ++/// a file_identifier (likely points at padding or the start of a the root ++/// vtable). ++inline const char *GetBufferIdentifier(const void *buf, ++ bool size_prefixed = false) { ++ return reinterpret_cast(buf) + ++ ((size_prefixed) ? 2 * sizeof(uoffset_t) : sizeof(uoffset_t)); ++} ++ ++// Helper to see if the identifier in a buffer has the expected value. ++inline bool BufferHasIdentifier(const void *buf, const char *identifier, ++ bool size_prefixed = false) { ++ return strncmp(GetBufferIdentifier(buf, size_prefixed), identifier, ++ flatbuffers::kFileIdentifierLength) == 0; ++} ++ ++/// @cond FLATBUFFERS_INTERNAL ++// Helpers to get a typed pointer to the root object contained in the buffer. ++template T *GetMutableRoot(void *buf) { ++ EndianCheck(); ++ return reinterpret_cast( ++ reinterpret_cast(buf) + ++ EndianScalar(*reinterpret_cast(buf))); ++} ++ ++template T *GetMutableSizePrefixedRoot(void *buf) { ++ return GetMutableRoot(reinterpret_cast(buf) + ++ sizeof(uoffset_t)); ++} ++ ++template const T *GetRoot(const void *buf) { ++ return GetMutableRoot(const_cast(buf)); ++} ++ ++template const T *GetSizePrefixedRoot(const void *buf) { ++ return GetRoot(reinterpret_cast(buf) + sizeof(uoffset_t)); ++} ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_BUFFER_H_ +\ No newline at end of file +diff -urN a/include/flatbuffers/buffer_ref.h b/include/flatbuffers/buffer_ref.h +--- a/include/flatbuffers/buffer_ref.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/buffer_ref.h 2023-01-13 07:47:06.299228228 +0000 +@@ -0,0 +1,53 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_BUFFER_REF_H_ ++#define FLATBUFFERS_BUFFER_REF_H_ ++ ++#include "flatbuffers/base.h" ++#include "flatbuffers/verifier.h" ++ ++namespace flatbuffers { ++ ++// Convenient way to bundle a buffer and its length, to pass it around ++// typed by its root. ++// A BufferRef does not own its buffer. ++struct BufferRefBase {}; // for std::is_base_of ++ ++template struct BufferRef : BufferRefBase { ++ BufferRef() : buf(nullptr), len(0), must_free(false) {} ++ BufferRef(uint8_t *_buf, uoffset_t _len) ++ : buf(_buf), len(_len), must_free(false) {} ++ ++ ~BufferRef() { ++ if (must_free) free(buf); ++ } ++ ++ const T *GetRoot() const { return flatbuffers::GetRoot(buf); } ++ ++ bool Verify() { ++ Verifier verifier(buf, len); ++ return verifier.VerifyBuffer(nullptr); ++ } ++ ++ uint8_t *buf; ++ uoffset_t len; ++ bool must_free; ++}; ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_BUFFER_REF_H_ +\ No newline at end of file +diff -urN a/include/flatbuffers/default_allocator.h b/include/flatbuffers/default_allocator.h +--- a/include/flatbuffers/default_allocator.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/default_allocator.h 2023-01-13 07:47:06.299228228 +0000 +@@ -0,0 +1,64 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_DEFAULT_ALLOCATOR_H_ ++#define FLATBUFFERS_DEFAULT_ALLOCATOR_H_ ++ ++#include "flatbuffers/allocator.h" ++#include "flatbuffers/base.h" ++ ++namespace flatbuffers { ++ ++// DefaultAllocator uses new/delete to allocate memory regions ++class DefaultAllocator : public Allocator { ++ public: ++ uint8_t *allocate(size_t size) FLATBUFFERS_OVERRIDE { ++ return new uint8_t[size]; ++ } ++ ++ void deallocate(uint8_t *p, size_t) FLATBUFFERS_OVERRIDE { delete[] p; } ++ ++ static void dealloc(void *p, size_t) { delete[] static_cast(p); } ++}; ++ ++// These functions allow for a null allocator to mean use the default allocator, ++// as used by DetachedBuffer and vector_downward below. ++// This is to avoid having a statically or dynamically allocated default ++// allocator, or having to move it between the classes that may own it. ++inline uint8_t *Allocate(Allocator *allocator, size_t size) { ++ return allocator ? allocator->allocate(size) ++ : DefaultAllocator().allocate(size); ++} ++ ++inline void Deallocate(Allocator *allocator, uint8_t *p, size_t size) { ++ if (allocator) ++ allocator->deallocate(p, size); ++ else ++ DefaultAllocator().deallocate(p, size); ++} ++ ++inline uint8_t *ReallocateDownward(Allocator *allocator, uint8_t *old_p, ++ size_t old_size, size_t new_size, ++ size_t in_use_back, size_t in_use_front) { ++ return allocator ? allocator->reallocate_downward(old_p, old_size, new_size, ++ in_use_back, in_use_front) ++ : DefaultAllocator().reallocate_downward( ++ old_p, old_size, new_size, in_use_back, in_use_front); ++} ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_ +\ No newline at end of file +diff -urN a/include/flatbuffers/detached_buffer.h b/include/flatbuffers/detached_buffer.h +--- a/include/flatbuffers/detached_buffer.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/detached_buffer.h 2023-01-13 07:47:06.299228228 +0000 +@@ -0,0 +1,114 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_DETACHED_BUFFER_H_ ++#define FLATBUFFERS_DETACHED_BUFFER_H_ ++ ++#include "flatbuffers/allocator.h" ++#include "flatbuffers/base.h" ++#include "flatbuffers/default_allocator.h" ++ ++namespace flatbuffers { ++ ++// DetachedBuffer is a finished flatbuffer memory region, detached from its ++// builder. The original memory region and allocator are also stored so that ++// the DetachedBuffer can manage the memory lifetime. ++class DetachedBuffer { ++ public: ++ DetachedBuffer() ++ : allocator_(nullptr), ++ own_allocator_(false), ++ buf_(nullptr), ++ reserved_(0), ++ cur_(nullptr), ++ size_(0) {} ++ ++ DetachedBuffer(Allocator *allocator, bool own_allocator, uint8_t *buf, ++ size_t reserved, uint8_t *cur, size_t sz) ++ : allocator_(allocator), ++ own_allocator_(own_allocator), ++ buf_(buf), ++ reserved_(reserved), ++ cur_(cur), ++ size_(sz) {} ++ ++ DetachedBuffer(DetachedBuffer &&other) ++ : allocator_(other.allocator_), ++ own_allocator_(other.own_allocator_), ++ buf_(other.buf_), ++ reserved_(other.reserved_), ++ cur_(other.cur_), ++ size_(other.size_) { ++ other.reset(); ++ } ++ ++ DetachedBuffer &operator=(DetachedBuffer &&other) { ++ if (this == &other) return *this; ++ ++ destroy(); ++ ++ allocator_ = other.allocator_; ++ own_allocator_ = other.own_allocator_; ++ buf_ = other.buf_; ++ reserved_ = other.reserved_; ++ cur_ = other.cur_; ++ size_ = other.size_; ++ ++ other.reset(); ++ ++ return *this; ++ } ++ ++ ~DetachedBuffer() { destroy(); } ++ ++ const uint8_t *data() const { return cur_; } ++ ++ uint8_t *data() { return cur_; } ++ ++ size_t size() const { return size_; } ++ ++ // These may change access mode, leave these at end of public section ++ FLATBUFFERS_DELETE_FUNC(DetachedBuffer(const DetachedBuffer &other)); ++ FLATBUFFERS_DELETE_FUNC( ++ DetachedBuffer &operator=(const DetachedBuffer &other)); ++ ++ protected: ++ Allocator *allocator_; ++ bool own_allocator_; ++ uint8_t *buf_; ++ size_t reserved_; ++ uint8_t *cur_; ++ size_t size_; ++ ++ inline void destroy() { ++ if (buf_) Deallocate(allocator_, buf_, reserved_); ++ if (own_allocator_ && allocator_) { delete allocator_; } ++ reset(); ++ } ++ ++ inline void reset() { ++ allocator_ = nullptr; ++ own_allocator_ = false; ++ buf_ = nullptr; ++ reserved_ = 0; ++ cur_ = nullptr; ++ size_ = 0; ++ } ++}; ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_DETACHED_BUFFER_H_ +diff -urN a/include/flatbuffers/flatbuffer_builder.h b/include/flatbuffers/flatbuffer_builder.h +--- a/include/flatbuffers/flatbuffer_builder.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/flatbuffer_builder.h 2023-01-13 07:47:06.299228228 +0000 +@@ -0,0 +1,1197 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_FLATBUFFER_BUILDER_H_ ++#define FLATBUFFERS_FLATBUFFER_BUILDER_H_ ++ ++#include ++ ++#include "flatbuffers/allocator.h" ++#include "flatbuffers/array.h" ++#include "flatbuffers/base.h" ++#include "flatbuffers/buffer_ref.h" ++#include "flatbuffers/default_allocator.h" ++#include "flatbuffers/detached_buffer.h" ++#include "flatbuffers/stl_emulation.h" ++#include "flatbuffers/string.h" ++#include "flatbuffers/struct.h" ++#include "flatbuffers/table.h" ++#include "flatbuffers/vector.h" ++#include "flatbuffers/vector_downward.h" ++#include "flatbuffers/verifier.h" ++ ++namespace flatbuffers { ++ ++// Converts a Field ID to a virtual table offset. ++inline voffset_t FieldIndexToOffset(voffset_t field_id) { ++ // Should correspond to what EndTable() below builds up. ++ const int fixed_fields = 2; // Vtable size and Object Size. ++ return static_cast((field_id + fixed_fields) * sizeof(voffset_t)); ++} ++ ++template> ++const T *data(const std::vector &v) { ++ // Eventually the returned pointer gets passed down to memcpy, so ++ // we need it to be non-null to avoid undefined behavior. ++ static uint8_t t; ++ return v.empty() ? reinterpret_cast(&t) : &v.front(); ++} ++template> ++T *data(std::vector &v) { ++ // Eventually the returned pointer gets passed down to memcpy, so ++ // we need it to be non-null to avoid undefined behavior. ++ static uint8_t t; ++ return v.empty() ? reinterpret_cast(&t) : &v.front(); ++} ++ ++/// @addtogroup flatbuffers_cpp_api ++/// @{ ++/// @class FlatBufferBuilder ++/// @brief Helper class to hold data needed in creation of a FlatBuffer. ++/// To serialize data, you typically call one of the `Create*()` functions in ++/// the generated code, which in turn call a sequence of `StartTable`/ ++/// `PushElement`/`AddElement`/`EndTable`, or the builtin `CreateString`/ ++/// `CreateVector` functions. Do this is depth-first order to build up a tree to ++/// the root. `Finish()` wraps up the buffer ready for transport. ++class FlatBufferBuilder { ++ public: ++ /// @brief Default constructor for FlatBufferBuilder. ++ /// @param[in] initial_size The initial size of the buffer, in bytes. Defaults ++ /// to `1024`. ++ /// @param[in] allocator An `Allocator` to use. If null will use ++ /// `DefaultAllocator`. ++ /// @param[in] own_allocator Whether the builder/vector should own the ++ /// allocator. Defaults to / `false`. ++ /// @param[in] buffer_minalign Force the buffer to be aligned to the given ++ /// minimum alignment upon reallocation. Only needed if you intend to store ++ /// types with custom alignment AND you wish to read the buffer in-place ++ /// directly after creation. ++ explicit FlatBufferBuilder( ++ size_t initial_size = 1024, Allocator *allocator = nullptr, ++ bool own_allocator = false, ++ size_t buffer_minalign = AlignOf()) ++ : buf_(initial_size, allocator, own_allocator, buffer_minalign), ++ num_field_loc(0), ++ max_voffset_(0), ++ nested(false), ++ finished(false), ++ minalign_(1), ++ force_defaults_(false), ++ dedup_vtables_(true), ++ string_pool(nullptr) { ++ EndianCheck(); ++ } ++ ++ /// @brief Move constructor for FlatBufferBuilder. ++ FlatBufferBuilder(FlatBufferBuilder &&other) ++ : buf_(1024, nullptr, false, AlignOf()), ++ num_field_loc(0), ++ max_voffset_(0), ++ nested(false), ++ finished(false), ++ minalign_(1), ++ force_defaults_(false), ++ dedup_vtables_(true), ++ string_pool(nullptr) { ++ EndianCheck(); ++ // Default construct and swap idiom. ++ // Lack of delegating constructors in vs2010 makes it more verbose than ++ // needed. ++ Swap(other); ++ } ++ ++ /// @brief Move assignment operator for FlatBufferBuilder. ++ FlatBufferBuilder &operator=(FlatBufferBuilder &&other) { ++ // Move construct a temporary and swap idiom ++ FlatBufferBuilder temp(std::move(other)); ++ Swap(temp); ++ return *this; ++ } ++ ++ void Swap(FlatBufferBuilder &other) { ++ using std::swap; ++ buf_.swap(other.buf_); ++ swap(num_field_loc, other.num_field_loc); ++ swap(max_voffset_, other.max_voffset_); ++ swap(nested, other.nested); ++ swap(finished, other.finished); ++ swap(minalign_, other.minalign_); ++ swap(force_defaults_, other.force_defaults_); ++ swap(dedup_vtables_, other.dedup_vtables_); ++ swap(string_pool, other.string_pool); ++ } ++ ++ ~FlatBufferBuilder() { ++ if (string_pool) delete string_pool; ++ } ++ ++ void Reset() { ++ Clear(); // clear builder state ++ buf_.reset(); // deallocate buffer ++ } ++ ++ /// @brief Reset all the state in this FlatBufferBuilder so it can be reused ++ /// to construct another buffer. ++ void Clear() { ++ ClearOffsets(); ++ buf_.clear(); ++ nested = false; ++ finished = false; ++ minalign_ = 1; ++ if (string_pool) string_pool->clear(); ++ } ++ ++ /// @brief The current size of the serialized buffer, counting from the end. ++ /// @return Returns an `uoffset_t` with the current size of the buffer. ++ uoffset_t GetSize() const { return buf_.size(); } ++ ++ /// @brief Get the serialized buffer (after you call `Finish()`). ++ /// @return Returns an `uint8_t` pointer to the FlatBuffer data inside the ++ /// buffer. ++ uint8_t *GetBufferPointer() const { ++ Finished(); ++ return buf_.data(); ++ } ++ ++ /// @brief Get the serialized buffer (after you call `Finish()`) as a span. ++ /// @return Returns a constructed flatbuffers::span that is a view over the ++ /// FlatBuffer data inside the buffer. ++ flatbuffers::span GetBufferSpan() const { ++ Finished(); ++ return flatbuffers::span(buf_.data(), buf_.size()); ++ } ++ ++ /// @brief Get a pointer to an unfinished buffer. ++ /// @return Returns a `uint8_t` pointer to the unfinished buffer. ++ uint8_t *GetCurrentBufferPointer() const { return buf_.data(); } ++ ++ /// @brief Get the released pointer to the serialized buffer. ++ /// @warning Do NOT attempt to use this FlatBufferBuilder afterwards! ++ /// @return A `FlatBuffer` that owns the buffer and its allocator and ++ /// behaves similar to a `unique_ptr` with a deleter. ++ FLATBUFFERS_ATTRIBUTE([[deprecated("use Release() instead")]]) ++ DetachedBuffer ReleaseBufferPointer() { ++ Finished(); ++ return buf_.release(); ++ } ++ ++ /// @brief Get the released DetachedBuffer. ++ /// @return A `DetachedBuffer` that owns the buffer and its allocator. ++ DetachedBuffer Release() { ++ Finished(); ++ return buf_.release(); ++ } ++ ++ /// @brief Get the released pointer to the serialized buffer. ++ /// @param size The size of the memory block containing ++ /// the serialized `FlatBuffer`. ++ /// @param offset The offset from the released pointer where the finished ++ /// `FlatBuffer` starts. ++ /// @return A raw pointer to the start of the memory block containing ++ /// the serialized `FlatBuffer`. ++ /// @remark If the allocator is owned, it gets deleted when the destructor is ++ /// called.. ++ uint8_t *ReleaseRaw(size_t &size, size_t &offset) { ++ Finished(); ++ return buf_.release_raw(size, offset); ++ } ++ ++ /// @brief get the minimum alignment this buffer needs to be accessed ++ /// properly. This is only known once all elements have been written (after ++ /// you call Finish()). You can use this information if you need to embed ++ /// a FlatBuffer in some other buffer, such that you can later read it ++ /// without first having to copy it into its own buffer. ++ size_t GetBufferMinAlignment() const { ++ Finished(); ++ return minalign_; ++ } ++ ++ /// @cond FLATBUFFERS_INTERNAL ++ void Finished() const { ++ // If you get this assert, you're attempting to get access a buffer ++ // which hasn't been finished yet. Be sure to call ++ // FlatBufferBuilder::Finish with your root table. ++ // If you really need to access an unfinished buffer, call ++ // GetCurrentBufferPointer instead. ++ FLATBUFFERS_ASSERT(finished); ++ } ++ /// @endcond ++ ++ /// @brief In order to save space, fields that are set to their default value ++ /// don't get serialized into the buffer. ++ /// @param[in] fd When set to `true`, always serializes default values that ++ /// are set. Optional fields which are not set explicitly, will still not be ++ /// serialized. ++ void ForceDefaults(bool fd) { force_defaults_ = fd; } ++ ++ /// @brief By default vtables are deduped in order to save space. ++ /// @param[in] dedup When set to `true`, dedup vtables. ++ void DedupVtables(bool dedup) { dedup_vtables_ = dedup; } ++ ++ /// @cond FLATBUFFERS_INTERNAL ++ void Pad(size_t num_bytes) { buf_.fill(num_bytes); } ++ ++ void TrackMinAlign(size_t elem_size) { ++ if (elem_size > minalign_) minalign_ = elem_size; ++ } ++ ++ void Align(size_t elem_size) { ++ TrackMinAlign(elem_size); ++ buf_.fill(PaddingBytes(buf_.size(), elem_size)); ++ } ++ ++ void PushFlatBuffer(const uint8_t *bytes, size_t size) { ++ PushBytes(bytes, size); ++ finished = true; ++ } ++ ++ void PushBytes(const uint8_t *bytes, size_t size) { buf_.push(bytes, size); } ++ ++ void PopBytes(size_t amount) { buf_.pop(amount); } ++ ++ template void AssertScalarT() { ++ // The code assumes power of 2 sizes and endian-swap-ability. ++ static_assert(flatbuffers::is_scalar::value, "T must be a scalar type"); ++ } ++ ++ // Write a single aligned scalar to the buffer ++ template uoffset_t PushElement(T element) { ++ AssertScalarT(); ++ Align(sizeof(T)); ++ buf_.push_small(EndianScalar(element)); ++ return GetSize(); ++ } ++ ++ template uoffset_t PushElement(Offset off) { ++ // Special case for offsets: see ReferTo below. ++ return PushElement(ReferTo(off.o)); ++ } ++ ++ // When writing fields, we track where they are, so we can create correct ++ // vtables later. ++ void TrackField(voffset_t field, uoffset_t off) { ++ FieldLoc fl = { off, field }; ++ buf_.scratch_push_small(fl); ++ num_field_loc++; ++ if (field > max_voffset_) { max_voffset_ = field; } ++ } ++ ++ // Like PushElement, but additionally tracks the field this represents. ++ template void AddElement(voffset_t field, T e, T def) { ++ // We don't serialize values equal to the default. ++ if (IsTheSameAs(e, def) && !force_defaults_) return; ++ TrackField(field, PushElement(e)); ++ } ++ ++ template void AddElement(voffset_t field, T e) { ++ TrackField(field, PushElement(e)); ++ } ++ ++ template void AddOffset(voffset_t field, Offset off) { ++ if (off.IsNull()) return; // Don't store. ++ AddElement(field, ReferTo(off.o), static_cast(0)); ++ } ++ ++ template void AddStruct(voffset_t field, const T *structptr) { ++ if (!structptr) return; // Default, don't store. ++ Align(AlignOf()); ++ buf_.push_small(*structptr); ++ TrackField(field, GetSize()); ++ } ++ ++ void AddStructOffset(voffset_t field, uoffset_t off) { ++ TrackField(field, off); ++ } ++ ++ // Offsets initially are relative to the end of the buffer (downwards). ++ // This function converts them to be relative to the current location ++ // in the buffer (when stored here), pointing upwards. ++ uoffset_t ReferTo(uoffset_t off) { ++ // Align to ensure GetSize() below is correct. ++ Align(sizeof(uoffset_t)); ++ // Offset must refer to something already in buffer. ++ const uoffset_t size = GetSize(); ++ FLATBUFFERS_ASSERT(off && off <= size); ++ return size - off + static_cast(sizeof(uoffset_t)); ++ } ++ ++ void NotNested() { ++ // If you hit this, you're trying to construct a Table/Vector/String ++ // during the construction of its parent table (between the MyTableBuilder ++ // and table.Finish(). ++ // Move the creation of these sub-objects to above the MyTableBuilder to ++ // not get this assert. ++ // Ignoring this assert may appear to work in simple cases, but the reason ++ // it is here is that storing objects in-line may cause vtable offsets ++ // to not fit anymore. It also leads to vtable duplication. ++ FLATBUFFERS_ASSERT(!nested); ++ // If you hit this, fields were added outside the scope of a table. ++ FLATBUFFERS_ASSERT(!num_field_loc); ++ } ++ ++ // From generated code (or from the parser), we call StartTable/EndTable ++ // with a sequence of AddElement calls in between. ++ uoffset_t StartTable() { ++ NotNested(); ++ nested = true; ++ return GetSize(); ++ } ++ ++ // This finishes one serialized object by generating the vtable if it's a ++ // table, comparing it against existing vtables, and writing the ++ // resulting vtable offset. ++ uoffset_t EndTable(uoffset_t start) { ++ // If you get this assert, a corresponding StartTable wasn't called. ++ FLATBUFFERS_ASSERT(nested); ++ // Write the vtable offset, which is the start of any Table. ++ // We fill it's value later. ++ auto vtableoffsetloc = PushElement(0); ++ // Write a vtable, which consists entirely of voffset_t elements. ++ // It starts with the number of offsets, followed by a type id, followed ++ // by the offsets themselves. In reverse: ++ // Include space for the last offset and ensure empty tables have a ++ // minimum size. ++ max_voffset_ = ++ (std::max)(static_cast(max_voffset_ + sizeof(voffset_t)), ++ FieldIndexToOffset(0)); ++ buf_.fill_big(max_voffset_); ++ auto table_object_size = vtableoffsetloc - start; ++ // Vtable use 16bit offsets. ++ FLATBUFFERS_ASSERT(table_object_size < 0x10000); ++ WriteScalar(buf_.data() + sizeof(voffset_t), ++ static_cast(table_object_size)); ++ WriteScalar(buf_.data(), max_voffset_); ++ // Write the offsets into the table ++ for (auto it = buf_.scratch_end() - num_field_loc * sizeof(FieldLoc); ++ it < buf_.scratch_end(); it += sizeof(FieldLoc)) { ++ auto field_location = reinterpret_cast(it); ++ auto pos = static_cast(vtableoffsetloc - field_location->off); ++ // If this asserts, it means you've set a field twice. ++ FLATBUFFERS_ASSERT( ++ !ReadScalar(buf_.data() + field_location->id)); ++ WriteScalar(buf_.data() + field_location->id, pos); ++ } ++ ClearOffsets(); ++ auto vt1 = reinterpret_cast(buf_.data()); ++ auto vt1_size = ReadScalar(vt1); ++ auto vt_use = GetSize(); ++ // See if we already have generated a vtable with this exact same ++ // layout before. If so, make it point to the old one, remove this one. ++ if (dedup_vtables_) { ++ for (auto it = buf_.scratch_data(); it < buf_.scratch_end(); ++ it += sizeof(uoffset_t)) { ++ auto vt_offset_ptr = reinterpret_cast(it); ++ auto vt2 = reinterpret_cast(buf_.data_at(*vt_offset_ptr)); ++ auto vt2_size = ReadScalar(vt2); ++ if (vt1_size != vt2_size || 0 != memcmp(vt2, vt1, vt1_size)) continue; ++ vt_use = *vt_offset_ptr; ++ buf_.pop(GetSize() - vtableoffsetloc); ++ break; ++ } ++ } ++ // If this is a new vtable, remember it. ++ if (vt_use == GetSize()) { buf_.scratch_push_small(vt_use); } ++ // Fill the vtable offset we created above. ++ // The offset points from the beginning of the object to where the ++ // vtable is stored. ++ // Offsets default direction is downward in memory for future format ++ // flexibility (storing all vtables at the start of the file). ++ WriteScalar(buf_.data_at(vtableoffsetloc), ++ static_cast(vt_use) - ++ static_cast(vtableoffsetloc)); ++ ++ nested = false; ++ return vtableoffsetloc; ++ } ++ ++ FLATBUFFERS_ATTRIBUTE([[deprecated("call the version above instead")]]) ++ uoffset_t EndTable(uoffset_t start, voffset_t /*numfields*/) { ++ return EndTable(start); ++ } ++ ++ // This checks a required field has been set in a given table that has ++ // just been constructed. ++ template void Required(Offset table, voffset_t field); ++ ++ uoffset_t StartStruct(size_t alignment) { ++ Align(alignment); ++ return GetSize(); ++ } ++ ++ uoffset_t EndStruct() { return GetSize(); } ++ ++ void ClearOffsets() { ++ buf_.scratch_pop(num_field_loc * sizeof(FieldLoc)); ++ num_field_loc = 0; ++ max_voffset_ = 0; ++ } ++ ++ // Aligns such that when "len" bytes are written, an object can be written ++ // after it with "alignment" without padding. ++ void PreAlign(size_t len, size_t alignment) { ++ TrackMinAlign(alignment); ++ buf_.fill(PaddingBytes(GetSize() + len, alignment)); ++ } ++ template void PreAlign(size_t len) { ++ AssertScalarT(); ++ PreAlign(len, sizeof(T)); ++ } ++ /// @endcond ++ ++ /// @brief Store a string in the buffer, which can contain any binary data. ++ /// @param[in] str A const char pointer to the data to be stored as a string. ++ /// @param[in] len The number of bytes that should be stored from `str`. ++ /// @return Returns the offset in the buffer where the string starts. ++ Offset CreateString(const char *str, size_t len) { ++ NotNested(); ++ PreAlign(len + 1); // Always 0-terminated. ++ buf_.fill(1); ++ PushBytes(reinterpret_cast(str), len); ++ PushElement(static_cast(len)); ++ return Offset(GetSize()); ++ } ++ ++ /// @brief Store a string in the buffer, which is null-terminated. ++ /// @param[in] str A const char pointer to a C-string to add to the buffer. ++ /// @return Returns the offset in the buffer where the string starts. ++ Offset CreateString(const char *str) { ++ return CreateString(str, strlen(str)); ++ } ++ ++ /// @brief Store a string in the buffer, which is null-terminated. ++ /// @param[in] str A char pointer to a C-string to add to the buffer. ++ /// @return Returns the offset in the buffer where the string starts. ++ Offset CreateString(char *str) { ++ return CreateString(str, strlen(str)); ++ } ++ ++ /// @brief Store a string in the buffer, which can contain any binary data. ++ /// @param[in] str A const reference to a std::string to store in the buffer. ++ /// @return Returns the offset in the buffer where the string starts. ++ Offset CreateString(const std::string &str) { ++ return CreateString(str.c_str(), str.length()); ++ } ++ ++ // clang-format off ++ #ifdef FLATBUFFERS_HAS_STRING_VIEW ++ /// @brief Store a string in the buffer, which can contain any binary data. ++ /// @param[in] str A const string_view to copy in to the buffer. ++ /// @return Returns the offset in the buffer where the string starts. ++ Offset CreateString(flatbuffers::string_view str) { ++ return CreateString(str.data(), str.size()); ++ } ++ #endif // FLATBUFFERS_HAS_STRING_VIEW ++ // clang-format on ++ ++ /// @brief Store a string in the buffer, which can contain any binary data. ++ /// @param[in] str A const pointer to a `String` struct to add to the buffer. ++ /// @return Returns the offset in the buffer where the string starts ++ Offset CreateString(const String *str) { ++ return str ? CreateString(str->c_str(), str->size()) : 0; ++ } ++ ++ /// @brief Store a string in the buffer, which can contain any binary data. ++ /// @param[in] str A const reference to a std::string like type with support ++ /// of T::c_str() and T::length() to store in the buffer. ++ /// @return Returns the offset in the buffer where the string starts. ++ template Offset CreateString(const T &str) { ++ return CreateString(str.c_str(), str.length()); ++ } ++ ++ /// @brief Store a string in the buffer, which can contain any binary data. ++ /// If a string with this exact contents has already been serialized before, ++ /// instead simply returns the offset of the existing string. This uses a map ++ /// stored on the heap, but only stores the numerical offsets. ++ /// @param[in] str A const char pointer to the data to be stored as a string. ++ /// @param[in] len The number of bytes that should be stored from `str`. ++ /// @return Returns the offset in the buffer where the string starts. ++ Offset CreateSharedString(const char *str, size_t len) { ++ FLATBUFFERS_ASSERT(FLATBUFFERS_GENERAL_HEAP_ALLOC_OK); ++ if (!string_pool) ++ string_pool = new StringOffsetMap(StringOffsetCompare(buf_)); ++ auto size_before_string = buf_.size(); ++ // Must first serialize the string, since the set is all offsets into ++ // buffer. ++ auto off = CreateString(str, len); ++ auto it = string_pool->find(off); ++ // If it exists we reuse existing serialized data! ++ if (it != string_pool->end()) { ++ // We can remove the string we serialized. ++ buf_.pop(buf_.size() - size_before_string); ++ return *it; ++ } ++ // Record this string for future use. ++ string_pool->insert(off); ++ return off; ++ } ++ ++#ifdef FLATBUFFERS_HAS_STRING_VIEW ++ /// @brief Store a string in the buffer, which can contain any binary data. ++ /// If a string with this exact contents has already been serialized before, ++ /// instead simply returns the offset of the existing string. This uses a map ++ /// stored on the heap, but only stores the numerical offsets. ++ /// @param[in] str A const std::string_view to store in the buffer. ++ /// @return Returns the offset in the buffer where the string starts ++ Offset CreateSharedString(const flatbuffers::string_view str) { ++ return CreateSharedString(str.data(), str.size()); ++ } ++#else ++ /// @brief Store a string in the buffer, which null-terminated. ++ /// If a string with this exact contents has already been serialized before, ++ /// instead simply returns the offset of the existing string. This uses a map ++ /// stored on the heap, but only stores the numerical offsets. ++ /// @param[in] str A const char pointer to a C-string to add to the buffer. ++ /// @return Returns the offset in the buffer where the string starts. ++ Offset CreateSharedString(const char *str) { ++ return CreateSharedString(str, strlen(str)); ++ } ++ ++ /// @brief Store a string in the buffer, which can contain any binary data. ++ /// If a string with this exact contents has already been serialized before, ++ /// instead simply returns the offset of the existing string. This uses a map ++ /// stored on the heap, but only stores the numerical offsets. ++ /// @param[in] str A const reference to a std::string to store in the buffer. ++ /// @return Returns the offset in the buffer where the string starts. ++ Offset CreateSharedString(const std::string &str) { ++ return CreateSharedString(str.c_str(), str.length()); ++ } ++#endif ++ ++ /// @brief Store a string in the buffer, which can contain any binary data. ++ /// If a string with this exact contents has already been serialized before, ++ /// instead simply returns the offset of the existing string. This uses a map ++ /// stored on the heap, but only stores the numerical offsets. ++ /// @param[in] str A const pointer to a `String` struct to add to the buffer. ++ /// @return Returns the offset in the buffer where the string starts ++ Offset CreateSharedString(const String *str) { ++ return CreateSharedString(str->c_str(), str->size()); ++ } ++ ++ /// @cond FLATBUFFERS_INTERNAL ++ uoffset_t EndVector(size_t len) { ++ FLATBUFFERS_ASSERT(nested); // Hit if no corresponding StartVector. ++ nested = false; ++ return PushElement(static_cast(len)); ++ } ++ ++ void StartVector(size_t len, size_t elemsize) { ++ NotNested(); ++ nested = true; ++ PreAlign(len * elemsize); ++ PreAlign(len * elemsize, elemsize); // Just in case elemsize > uoffset_t. ++ } ++ ++ // Call this right before StartVector/CreateVector if you want to force the ++ // alignment to be something different than what the element size would ++ // normally dictate. ++ // This is useful when storing a nested_flatbuffer in a vector of bytes, ++ // or when storing SIMD floats, etc. ++ void ForceVectorAlignment(size_t len, size_t elemsize, size_t alignment) { ++ FLATBUFFERS_ASSERT(VerifyAlignmentRequirements(alignment)); ++ PreAlign(len * elemsize, alignment); ++ } ++ ++ // Similar to ForceVectorAlignment but for String fields. ++ void ForceStringAlignment(size_t len, size_t alignment) { ++ FLATBUFFERS_ASSERT(VerifyAlignmentRequirements(alignment)); ++ PreAlign((len + 1) * sizeof(char), alignment); ++ } ++ ++ /// @endcond ++ ++ /// @brief Serialize an array into a FlatBuffer `vector`. ++ /// @tparam T The data type of the array elements. ++ /// @param[in] v A pointer to the array of type `T` to serialize into the ++ /// buffer as a `vector`. ++ /// @param[in] len The number of elements to serialize. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template Offset> CreateVector(const T *v, size_t len) { ++ // If this assert hits, you're specifying a template argument that is ++ // causing the wrong overload to be selected, remove it. ++ AssertScalarT(); ++ StartVector(len, sizeof(T)); ++ if (len == 0) { return Offset>(EndVector(len)); } ++ // clang-format off ++ #if FLATBUFFERS_LITTLEENDIAN ++ PushBytes(reinterpret_cast(v), len * sizeof(T)); ++ #else ++ if (sizeof(T) == 1) { ++ PushBytes(reinterpret_cast(v), len); ++ } else { ++ for (auto i = len; i > 0; ) { ++ PushElement(v[--i]); ++ } ++ } ++ #endif ++ // clang-format on ++ return Offset>(EndVector(len)); ++ } ++ ++ /// @brief Serialize an array like object into a FlatBuffer `vector`. ++ /// @tparam T The data type of the array elements. ++ /// @tparam C The type of the array. ++ /// @param[in] array A reference to an array like object of type `T` to ++ /// serialize into the buffer as a `vector`. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template Offset> CreateVector(const C &array) { ++ return CreateVector(array.data(), array.size()); ++ } ++ ++ template ++ Offset>> CreateVector(const Offset *v, size_t len) { ++ StartVector(len, sizeof(Offset)); ++ for (auto i = len; i > 0;) { PushElement(v[--i]); } ++ return Offset>>(EndVector(len)); ++ } ++ ++ /// @brief Serialize a `std::vector` into a FlatBuffer `vector`. ++ /// @tparam T The data type of the `std::vector` elements. ++ /// @param v A const reference to the `std::vector` to serialize into the ++ /// buffer as a `vector`. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template> ++ Offset> CreateVector(const std::vector &v) { ++ return CreateVector(data(v), v.size()); ++ } ++ ++ // vector may be implemented using a bit-set, so we can't access it as ++ // an array. Instead, read elements manually. ++ // Background: https://isocpp.org/blog/2012/11/on-vectorbool ++ Offset> CreateVector(const std::vector &v) { ++ StartVector(v.size(), sizeof(uint8_t)); ++ for (auto i = v.size(); i > 0;) { ++ PushElement(static_cast(v[--i])); ++ } ++ return Offset>(EndVector(v.size())); ++ } ++ ++ /// @brief Serialize values returned by a function into a FlatBuffer `vector`. ++ /// This is a convenience function that takes care of iteration for you. ++ /// @tparam T The data type of the `std::vector` elements. ++ /// @param f A function that takes the current iteration 0..vector_size-1 and ++ /// returns any type that you can construct a FlatBuffers vector out of. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template ++ Offset> CreateVector(size_t vector_size, ++ const std::function &f) { ++ FLATBUFFERS_ASSERT(FLATBUFFERS_GENERAL_HEAP_ALLOC_OK); ++ std::vector elems(vector_size); ++ for (size_t i = 0; i < vector_size; i++) elems[i] = f(i); ++ return CreateVector(elems); ++ } ++ ++ /// @brief Serialize values returned by a function into a FlatBuffer `vector`. ++ /// This is a convenience function that takes care of iteration for you. This ++ /// uses a vector stored on the heap to store the intermediate results of the ++ /// iteration. ++ /// @tparam T The data type of the `std::vector` elements. ++ /// @param f A function that takes the current iteration 0..vector_size-1, ++ /// and the state parameter returning any type that you can construct a ++ /// FlatBuffers vector out of. ++ /// @param state State passed to f. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template ++ Offset> CreateVector(size_t vector_size, F f, S *state) { ++ FLATBUFFERS_ASSERT(FLATBUFFERS_GENERAL_HEAP_ALLOC_OK); ++ std::vector elems(vector_size); ++ for (size_t i = 0; i < vector_size; i++) elems[i] = f(i, state); ++ return CreateVector(elems); ++ } ++ ++ /// @brief Serialize a `std::vector` into a FlatBuffer `vector`. ++ /// This is a convenience function for a common case. ++ /// @param v A const reference to the `std::vector` to serialize into the ++ /// buffer as a `vector`. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template> ++ Offset>> CreateVectorOfStrings( ++ const std::vector &v) { ++ return CreateVectorOfStrings(v.cbegin(), v.cend()); ++ } ++ ++ /// @brief Serialize a collection of Strings into a FlatBuffer `vector`. ++ /// This is a convenience function for a common case. ++ /// @param begin The begining iterator of the collection ++ /// @param end The ending iterator of the collection ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template ++ Offset>> CreateVectorOfStrings(It begin, It end) { ++ auto size = std::distance(begin, end); ++ auto scratch_buffer_usage = size * sizeof(Offset); ++ // If there is not enough space to store the offsets, there definitely won't ++ // be enough space to store all the strings. So ensuring space for the ++ // scratch region is OK, for it it fails, it would have failed later. ++ buf_.ensure_space(scratch_buffer_usage); ++ for (auto it = begin; it != end; ++it) { ++ buf_.scratch_push_small(CreateString(*it)); ++ } ++ StartVector(size, sizeof(Offset)); ++ for (auto i = 1; i <= size; i++) { ++ // Note we re-evaluate the buf location each iteration to account for any ++ // underlying buffer resizing that may occur. ++ PushElement(*reinterpret_cast *>( ++ buf_.scratch_end() - i * sizeof(Offset))); ++ } ++ buf_.scratch_pop(scratch_buffer_usage); ++ return Offset>>(EndVector(size)); ++ } ++ ++ /// @brief Serialize an array of structs into a FlatBuffer `vector`. ++ /// @tparam T The data type of the struct array elements. ++ /// @param[in] v A pointer to the array of type `T` to serialize into the ++ /// buffer as a `vector`. ++ /// @param[in] len The number of elements to serialize. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template ++ Offset> CreateVectorOfStructs(const T *v, size_t len) { ++ StartVector(len * sizeof(T) / AlignOf(), AlignOf()); ++ if (len > 0) { ++ PushBytes(reinterpret_cast(v), sizeof(T) * len); ++ } ++ return Offset>(EndVector(len)); ++ } ++ ++ /// @brief Serialize an array of native structs into a FlatBuffer `vector`. ++ /// @tparam T The data type of the struct array elements. ++ /// @tparam S The data type of the native struct array elements. ++ /// @param[in] v A pointer to the array of type `S` to serialize into the ++ /// buffer as a `vector`. ++ /// @param[in] len The number of elements to serialize. ++ /// @param[in] pack_func Pointer to a function to convert the native struct ++ /// to the FlatBuffer struct. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template ++ Offset> CreateVectorOfNativeStructs( ++ const S *v, size_t len, T (*const pack_func)(const S &)) { ++ FLATBUFFERS_ASSERT(pack_func); ++ auto structs = StartVectorOfStructs(len); ++ for (size_t i = 0; i < len; i++) { structs[i] = pack_func(v[i]); } ++ return EndVectorOfStructs(len); ++ } ++ ++ /// @brief Serialize an array of native structs into a FlatBuffer `vector`. ++ /// @tparam T The data type of the struct array elements. ++ /// @tparam S The data type of the native struct array elements. ++ /// @param[in] v A pointer to the array of type `S` to serialize into the ++ /// buffer as a `vector`. ++ /// @param[in] len The number of elements to serialize. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template ++ Offset> CreateVectorOfNativeStructs(const S *v, ++ size_t len) { ++ extern T Pack(const S &); ++ return CreateVectorOfNativeStructs(v, len, Pack); ++ } ++ ++ /// @brief Serialize an array of structs into a FlatBuffer `vector`. ++ /// @tparam T The data type of the struct array elements. ++ /// @param[in] filler A function that takes the current iteration ++ /// 0..vector_size-1 and a pointer to the struct that must be filled. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ /// This is mostly useful when flatbuffers are generated with mutation ++ /// accessors. ++ template ++ Offset> CreateVectorOfStructs( ++ size_t vector_size, const std::function &filler) { ++ T *structs = StartVectorOfStructs(vector_size); ++ for (size_t i = 0; i < vector_size; i++) { ++ filler(i, structs); ++ structs++; ++ } ++ return EndVectorOfStructs(vector_size); ++ } ++ ++ /// @brief Serialize an array of structs into a FlatBuffer `vector`. ++ /// @tparam T The data type of the struct array elements. ++ /// @param[in] f A function that takes the current iteration 0..vector_size-1, ++ /// a pointer to the struct that must be filled and the state argument. ++ /// @param[in] state Arbitrary state to pass to f. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ /// This is mostly useful when flatbuffers are generated with mutation ++ /// accessors. ++ template ++ Offset> CreateVectorOfStructs(size_t vector_size, F f, ++ S *state) { ++ T *structs = StartVectorOfStructs(vector_size); ++ for (size_t i = 0; i < vector_size; i++) { ++ f(i, structs, state); ++ structs++; ++ } ++ return EndVectorOfStructs(vector_size); ++ } ++ ++ /// @brief Serialize a `std::vector` of structs into a FlatBuffer `vector`. ++ /// @tparam T The data type of the `std::vector` struct elements. ++ /// @param[in] v A const reference to the `std::vector` of structs to ++ /// serialize into the buffer as a `vector`. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template> ++ Offset> CreateVectorOfStructs( ++ const std::vector &v) { ++ return CreateVectorOfStructs(data(v), v.size()); ++ } ++ ++ /// @brief Serialize a `std::vector` of native structs into a FlatBuffer ++ /// `vector`. ++ /// @tparam T The data type of the `std::vector` struct elements. ++ /// @tparam S The data type of the `std::vector` native struct elements. ++ /// @param[in] v A const reference to the `std::vector` of structs to ++ /// serialize into the buffer as a `vector`. ++ /// @param[in] pack_func Pointer to a function to convert the native struct ++ /// to the FlatBuffer struct. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template> ++ Offset> CreateVectorOfNativeStructs( ++ const std::vector &v, T (*const pack_func)(const S &)) { ++ return CreateVectorOfNativeStructs(data(v), v.size(), pack_func); ++ } ++ ++ /// @brief Serialize a `std::vector` of native structs into a FlatBuffer ++ /// `vector`. ++ /// @tparam T The data type of the `std::vector` struct elements. ++ /// @tparam S The data type of the `std::vector` native struct elements. ++ /// @param[in] v A const reference to the `std::vector` of structs to ++ /// serialize into the buffer as a `vector`. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template> ++ Offset> CreateVectorOfNativeStructs( ++ const std::vector &v) { ++ return CreateVectorOfNativeStructs(data(v), v.size()); ++ } ++ ++ /// @cond FLATBUFFERS_INTERNAL ++ template struct StructKeyComparator { ++ bool operator()(const T &a, const T &b) const { ++ return a.KeyCompareLessThan(&b); ++ } ++ }; ++ /// @endcond ++ ++ /// @brief Serialize a `std::vector` of structs into a FlatBuffer `vector` ++ /// in sorted order. ++ /// @tparam T The data type of the `std::vector` struct elements. ++ /// @param[in] v A const reference to the `std::vector` of structs to ++ /// serialize into the buffer as a `vector`. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template> ++ Offset> CreateVectorOfSortedStructs( ++ std::vector *v) { ++ return CreateVectorOfSortedStructs(data(*v), v->size()); ++ } ++ ++ /// @brief Serialize a `std::vector` of native structs into a FlatBuffer ++ /// `vector` in sorted order. ++ /// @tparam T The data type of the `std::vector` struct elements. ++ /// @tparam S The data type of the `std::vector` native struct elements. ++ /// @param[in] v A const reference to the `std::vector` of structs to ++ /// serialize into the buffer as a `vector`. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template> ++ Offset> CreateVectorOfSortedNativeStructs( ++ std::vector *v) { ++ return CreateVectorOfSortedNativeStructs(data(*v), v->size()); ++ } ++ ++ /// @brief Serialize an array of structs into a FlatBuffer `vector` in sorted ++ /// order. ++ /// @tparam T The data type of the struct array elements. ++ /// @param[in] v A pointer to the array of type `T` to serialize into the ++ /// buffer as a `vector`. ++ /// @param[in] len The number of elements to serialize. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template ++ Offset> CreateVectorOfSortedStructs(T *v, size_t len) { ++ std::stable_sort(v, v + len, StructKeyComparator()); ++ return CreateVectorOfStructs(v, len); ++ } ++ ++ /// @brief Serialize an array of native structs into a FlatBuffer `vector` in ++ /// sorted order. ++ /// @tparam T The data type of the struct array elements. ++ /// @tparam S The data type of the native struct array elements. ++ /// @param[in] v A pointer to the array of type `S` to serialize into the ++ /// buffer as a `vector`. ++ /// @param[in] len The number of elements to serialize. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template ++ Offset> CreateVectorOfSortedNativeStructs(S *v, ++ size_t len) { ++ extern T Pack(const S &); ++ auto structs = StartVectorOfStructs(len); ++ for (size_t i = 0; i < len; i++) { structs[i] = Pack(v[i]); } ++ std::stable_sort(structs, structs + len, StructKeyComparator()); ++ return EndVectorOfStructs(len); ++ } ++ ++ /// @cond FLATBUFFERS_INTERNAL ++ template struct TableKeyComparator { ++ TableKeyComparator(vector_downward &buf) : buf_(buf) {} ++ TableKeyComparator(const TableKeyComparator &other) : buf_(other.buf_) {} ++ bool operator()(const Offset &a, const Offset &b) const { ++ auto table_a = reinterpret_cast(buf_.data_at(a.o)); ++ auto table_b = reinterpret_cast(buf_.data_at(b.o)); ++ return table_a->KeyCompareLessThan(table_b); ++ } ++ vector_downward &buf_; ++ ++ private: ++ FLATBUFFERS_DELETE_FUNC( ++ TableKeyComparator &operator=(const TableKeyComparator &other)); ++ }; ++ /// @endcond ++ ++ /// @brief Serialize an array of `table` offsets as a `vector` in the buffer ++ /// in sorted order. ++ /// @tparam T The data type that the offset refers to. ++ /// @param[in] v An array of type `Offset` that contains the `table` ++ /// offsets to store in the buffer in sorted order. ++ /// @param[in] len The number of elements to store in the `vector`. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template ++ Offset>> CreateVectorOfSortedTables(Offset *v, ++ size_t len) { ++ std::stable_sort(v, v + len, TableKeyComparator(buf_)); ++ return CreateVector(v, len); ++ } ++ ++ /// @brief Serialize an array of `table` offsets as a `vector` in the buffer ++ /// in sorted order. ++ /// @tparam T The data type that the offset refers to. ++ /// @param[in] v An array of type `Offset` that contains the `table` ++ /// offsets to store in the buffer in sorted order. ++ /// @return Returns a typed `Offset` into the serialized data indicating ++ /// where the vector is stored. ++ template> ++ Offset>> CreateVectorOfSortedTables( ++ std::vector, Alloc> *v) { ++ return CreateVectorOfSortedTables(data(*v), v->size()); ++ } ++ ++ /// @brief Specialized version of `CreateVector` for non-copying use cases. ++ /// Write the data any time later to the returned buffer pointer `buf`. ++ /// @param[in] len The number of elements to store in the `vector`. ++ /// @param[in] elemsize The size of each element in the `vector`. ++ /// @param[out] buf A pointer to a `uint8_t` pointer that can be ++ /// written to at a later time to serialize the data into a `vector` ++ /// in the buffer. ++ uoffset_t CreateUninitializedVector(size_t len, size_t elemsize, ++ uint8_t **buf) { ++ NotNested(); ++ StartVector(len, elemsize); ++ buf_.make_space(len * elemsize); ++ auto vec_start = GetSize(); ++ auto vec_end = EndVector(len); ++ *buf = buf_.data_at(vec_start); ++ return vec_end; ++ } ++ ++ /// @brief Specialized version of `CreateVector` for non-copying use cases. ++ /// Write the data any time later to the returned buffer pointer `buf`. ++ /// @tparam T The data type of the data that will be stored in the buffer ++ /// as a `vector`. ++ /// @param[in] len The number of elements to store in the `vector`. ++ /// @param[out] buf A pointer to a pointer of type `T` that can be ++ /// written to at a later time to serialize the data into a `vector` ++ /// in the buffer. ++ template ++ Offset> CreateUninitializedVector(size_t len, T **buf) { ++ AssertScalarT(); ++ return CreateUninitializedVector(len, sizeof(T), ++ reinterpret_cast(buf)); ++ } ++ ++ template ++ Offset> CreateUninitializedVectorOfStructs(size_t len, ++ T **buf) { ++ return CreateUninitializedVector(len, sizeof(T), ++ reinterpret_cast(buf)); ++ } ++ ++ // @brief Create a vector of scalar type T given as input a vector of scalar ++ // type U, useful with e.g. pre "enum class" enums, or any existing scalar ++ // data of the wrong type. ++ template ++ Offset> CreateVectorScalarCast(const U *v, size_t len) { ++ AssertScalarT(); ++ AssertScalarT(); ++ StartVector(len, sizeof(T)); ++ for (auto i = len; i > 0;) { PushElement(static_cast(v[--i])); } ++ return Offset>(EndVector(len)); ++ } ++ ++ /// @brief Write a struct by itself, typically to be part of a union. ++ template Offset CreateStruct(const T &structobj) { ++ NotNested(); ++ Align(AlignOf()); ++ buf_.push_small(structobj); ++ return Offset(GetSize()); ++ } ++ ++ /// @brief Finish serializing a buffer by writing the root offset. ++ /// @param[in] file_identifier If a `file_identifier` is given, the buffer ++ /// will be prefixed with a standard FlatBuffers file header. ++ template ++ void Finish(Offset root, const char *file_identifier = nullptr) { ++ Finish(root.o, file_identifier, false); ++ } ++ ++ /// @brief Finish a buffer with a 32 bit size field pre-fixed (size of the ++ /// buffer following the size field). These buffers are NOT compatible ++ /// with standard buffers created by Finish, i.e. you can't call GetRoot ++ /// on them, you have to use GetSizePrefixedRoot instead. ++ /// All >32 bit quantities in this buffer will be aligned when the whole ++ /// size pre-fixed buffer is aligned. ++ /// These kinds of buffers are useful for creating a stream of FlatBuffers. ++ template ++ void FinishSizePrefixed(Offset root, ++ const char *file_identifier = nullptr) { ++ Finish(root.o, file_identifier, true); ++ } ++ ++ void SwapBufAllocator(FlatBufferBuilder &other) { ++ buf_.swap_allocator(other.buf_); ++ } ++ ++ /// @brief The length of a FlatBuffer file header. ++ static const size_t kFileIdentifierLength = ++ ::flatbuffers::kFileIdentifierLength; ++ ++ protected: ++ // You shouldn't really be copying instances of this class. ++ FlatBufferBuilder(const FlatBufferBuilder &); ++ FlatBufferBuilder &operator=(const FlatBufferBuilder &); ++ ++ void Finish(uoffset_t root, const char *file_identifier, bool size_prefix) { ++ NotNested(); ++ buf_.clear_scratch(); ++ // This will cause the whole buffer to be aligned. ++ PreAlign((size_prefix ? sizeof(uoffset_t) : 0) + sizeof(uoffset_t) + ++ (file_identifier ? kFileIdentifierLength : 0), ++ minalign_); ++ if (file_identifier) { ++ FLATBUFFERS_ASSERT(strlen(file_identifier) == kFileIdentifierLength); ++ PushBytes(reinterpret_cast(file_identifier), ++ kFileIdentifierLength); ++ } ++ PushElement(ReferTo(root)); // Location of root. ++ if (size_prefix) { PushElement(GetSize()); } ++ finished = true; ++ } ++ ++ struct FieldLoc { ++ uoffset_t off; ++ voffset_t id; ++ }; ++ ++ vector_downward buf_; ++ ++ // Accumulating offsets of table members while it is being built. ++ // We store these in the scratch pad of buf_, after the vtable offsets. ++ uoffset_t num_field_loc; ++ // Track how much of the vtable is in use, so we can output the most compact ++ // possible vtable. ++ voffset_t max_voffset_; ++ ++ // Ensure objects are not nested. ++ bool nested; ++ ++ // Ensure the buffer is finished before it is being accessed. ++ bool finished; ++ ++ size_t minalign_; ++ ++ bool force_defaults_; // Serialize values equal to their defaults anyway. ++ ++ bool dedup_vtables_; ++ ++ struct StringOffsetCompare { ++ StringOffsetCompare(const vector_downward &buf) : buf_(&buf) {} ++ bool operator()(const Offset &a, const Offset &b) const { ++ auto stra = reinterpret_cast(buf_->data_at(a.o)); ++ auto strb = reinterpret_cast(buf_->data_at(b.o)); ++ return StringLessThan(stra->data(), stra->size(), strb->data(), ++ strb->size()); ++ } ++ const vector_downward *buf_; ++ }; ++ ++ // For use with CreateSharedString. Instantiated on first use only. ++ typedef std::set, StringOffsetCompare> StringOffsetMap; ++ StringOffsetMap *string_pool; ++ ++ private: ++ // Allocates space for a vector of structures. ++ // Must be completed with EndVectorOfStructs(). ++ template T *StartVectorOfStructs(size_t vector_size) { ++ StartVector(vector_size * sizeof(T) / AlignOf(), AlignOf()); ++ return reinterpret_cast(buf_.make_space(vector_size * sizeof(T))); ++ } ++ ++ // End the vector of structures in the flatbuffers. ++ // Vector should have previously be started with StartVectorOfStructs(). ++ template ++ Offset> EndVectorOfStructs(size_t vector_size) { ++ return Offset>(EndVector(vector_size)); ++ } ++}; ++/// @} ++ ++/// Helpers to get a typed pointer to objects that are currently being built. ++/// @warning Creating new objects will lead to reallocations and invalidates ++/// the pointer! ++template ++T *GetMutableTemporaryPointer(FlatBufferBuilder &fbb, Offset offset) { ++ return reinterpret_cast(fbb.GetCurrentBufferPointer() + fbb.GetSize() - ++ offset.o); ++} ++ ++template ++const T *GetTemporaryPointer(FlatBufferBuilder &fbb, Offset offset) { ++ return GetMutableTemporaryPointer(fbb, offset); ++} ++ ++template ++void FlatBufferBuilder::Required(Offset table, voffset_t field) { ++ auto table_ptr = reinterpret_cast(buf_.data_at(table.o)); ++ bool ok = table_ptr->GetOptionalFieldOffset(field) != 0; ++ // If this fails, the caller will show what field needs to be set. ++ FLATBUFFERS_ASSERT(ok); ++ (void)ok; ++} ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_VECTOR_DOWNWARD_H_ +diff -urN a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h +--- a/include/flatbuffers/flatbuffers.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/include/flatbuffers/flatbuffers.h 2023-01-13 07:47:06.299228228 +0000 +@@ -17,2686 +17,23 @@ + #ifndef FLATBUFFERS_H_ + #define FLATBUFFERS_H_ + ++// TODO: These includes are for mitigating the pains of users editing their ++// source because they relied on flatbuffers.h to include everything for them. ++#include "flatbuffers/array.h" + #include "flatbuffers/base.h" ++#include "flatbuffers/buffer.h" ++#include "flatbuffers/buffer_ref.h" ++#include "flatbuffers/detached_buffer.h" ++#include "flatbuffers/flatbuffer_builder.h" + #include "flatbuffers/stl_emulation.h" +- +-#ifndef FLATBUFFERS_CPP98_STL +-# include +-#endif +- +-#if defined(FLATBUFFERS_NAN_DEFAULTS) +-# include +-#endif ++#include "flatbuffers/string.h" ++#include "flatbuffers/struct.h" ++#include "flatbuffers/table.h" ++#include "flatbuffers/vector.h" ++#include "flatbuffers/vector_downward.h" ++#include "flatbuffers/verifier.h" + + namespace flatbuffers { +-// Generic 'operator==' with conditional specialisations. +-// T e - new value of a scalar field. +-// T def - default of scalar (is known at compile-time). +-template inline bool IsTheSameAs(T e, T def) { return e == def; } +- +-#if defined(FLATBUFFERS_NAN_DEFAULTS) && \ +- defined(FLATBUFFERS_HAS_NEW_STRTOD) && (FLATBUFFERS_HAS_NEW_STRTOD > 0) +-// Like `operator==(e, def)` with weak NaN if T=(float|double). +-template inline bool IsFloatTheSameAs(T e, T def) { +- return (e == def) || ((def != def) && (e != e)); +-} +-template<> inline bool IsTheSameAs(float e, float def) { +- return IsFloatTheSameAs(e, def); +-} +-template<> inline bool IsTheSameAs(double e, double def) { +- return IsFloatTheSameAs(e, def); +-} +-#endif +- +-// Check 'v' is out of closed range [low; high]. +-// Workaround for GCC warning [-Werror=type-limits]: +-// comparison is always true due to limited range of data type. +-template +-inline bool IsOutRange(const T &v, const T &low, const T &high) { +- return (v < low) || (high < v); +-} +- +-// Check 'v' is in closed range [low; high]. +-template +-inline bool IsInRange(const T &v, const T &low, const T &high) { +- return !IsOutRange(v, low, high); +-} +- +-// Wrapper for uoffset_t to allow safe template specialization. +-// Value is allowed to be 0 to indicate a null object (see e.g. AddOffset). +-template struct Offset { +- uoffset_t o; +- Offset() : o(0) {} +- Offset(uoffset_t _o) : o(_o) {} +- Offset Union() const { return Offset(o); } +- bool IsNull() const { return !o; } +-}; +- +-inline void EndianCheck() { +- int endiantest = 1; +- // If this fails, see FLATBUFFERS_LITTLEENDIAN above. +- FLATBUFFERS_ASSERT(*reinterpret_cast(&endiantest) == +- FLATBUFFERS_LITTLEENDIAN); +- (void)endiantest; +-} +- +-template FLATBUFFERS_CONSTEXPR size_t AlignOf() { +- // clang-format off +- #ifdef _MSC_VER +- return __alignof(T); +- #else +- #ifndef alignof +- return __alignof__(T); +- #else +- return alignof(T); +- #endif +- #endif +- // clang-format on +-} +- +-// When we read serialized data from memory, in the case of most scalars, +-// we want to just read T, but in the case of Offset, we want to actually +-// perform the indirection and return a pointer. +-// The template specialization below does just that. +-// It is wrapped in a struct since function templates can't overload on the +-// return type like this. +-// The typedef is for the convenience of callers of this function +-// (avoiding the need for a trailing return decltype) +-template struct IndirectHelper { +- typedef T return_type; +- typedef T mutable_return_type; +- static const size_t element_stride = sizeof(T); +- static return_type Read(const uint8_t *p, uoffset_t i) { +- return EndianScalar((reinterpret_cast(p))[i]); +- } +-}; +-template struct IndirectHelper> { +- typedef const T *return_type; +- typedef T *mutable_return_type; +- static const size_t element_stride = sizeof(uoffset_t); +- static return_type Read(const uint8_t *p, uoffset_t i) { +- p += i * sizeof(uoffset_t); +- return reinterpret_cast(p + ReadScalar(p)); +- } +-}; +-template struct IndirectHelper { +- typedef const T *return_type; +- typedef T *mutable_return_type; +- static const size_t element_stride = sizeof(T); +- static return_type Read(const uint8_t *p, uoffset_t i) { +- return reinterpret_cast(p + i * sizeof(T)); +- } +-}; +- +-// An STL compatible iterator implementation for Vector below, effectively +-// calling Get() for every element. +-template struct VectorIterator { +- typedef std::random_access_iterator_tag iterator_category; +- typedef IT value_type; +- typedef ptrdiff_t difference_type; +- typedef IT *pointer; +- typedef IT &reference; +- +- VectorIterator(const uint8_t *data, uoffset_t i) +- : data_(data + IndirectHelper::element_stride * i) {} +- VectorIterator(const VectorIterator &other) : data_(other.data_) {} +- VectorIterator() : data_(nullptr) {} +- +- VectorIterator &operator=(const VectorIterator &other) { +- data_ = other.data_; +- return *this; +- } +- +- // clang-format off +- #if !defined(FLATBUFFERS_CPP98_STL) +- VectorIterator &operator=(VectorIterator &&other) { +- data_ = other.data_; +- return *this; +- } +- #endif // !defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- +- bool operator==(const VectorIterator &other) const { +- return data_ == other.data_; +- } +- +- bool operator<(const VectorIterator &other) const { +- return data_ < other.data_; +- } +- +- bool operator!=(const VectorIterator &other) const { +- return data_ != other.data_; +- } +- +- difference_type operator-(const VectorIterator &other) const { +- return (data_ - other.data_) / IndirectHelper::element_stride; +- } +- +- // Note: return type is incompatible with the standard +- // `reference operator*()`. +- IT operator*() const { return IndirectHelper::Read(data_, 0); } +- +- // Note: return type is incompatible with the standard +- // `pointer operator->()`. +- IT operator->() const { return IndirectHelper::Read(data_, 0); } +- +- VectorIterator &operator++() { +- data_ += IndirectHelper::element_stride; +- return *this; +- } +- +- VectorIterator operator++(int) { +- VectorIterator temp(data_, 0); +- data_ += IndirectHelper::element_stride; +- return temp; +- } +- +- VectorIterator operator+(const uoffset_t &offset) const { +- return VectorIterator(data_ + offset * IndirectHelper::element_stride, +- 0); +- } +- +- VectorIterator &operator+=(const uoffset_t &offset) { +- data_ += offset * IndirectHelper::element_stride; +- return *this; +- } +- +- VectorIterator &operator--() { +- data_ -= IndirectHelper::element_stride; +- return *this; +- } +- +- VectorIterator operator--(int) { +- VectorIterator temp(data_, 0); +- data_ -= IndirectHelper::element_stride; +- return temp; +- } +- +- VectorIterator operator-(const uoffset_t &offset) const { +- return VectorIterator(data_ - offset * IndirectHelper::element_stride, +- 0); +- } +- +- VectorIterator &operator-=(const uoffset_t &offset) { +- data_ -= offset * IndirectHelper::element_stride; +- return *this; +- } +- +- private: +- const uint8_t *data_; +-}; +- +-template +-struct VectorReverseIterator : public std::reverse_iterator { +- explicit VectorReverseIterator(Iterator iter) +- : std::reverse_iterator(iter) {} +- +- // Note: return type is incompatible with the standard +- // `reference operator*()`. +- typename Iterator::value_type operator*() const { +- auto tmp = std::reverse_iterator::current; +- return *--tmp; +- } +- +- // Note: return type is incompatible with the standard +- // `pointer operator->()`. +- typename Iterator::value_type operator->() const { +- auto tmp = std::reverse_iterator::current; +- return *--tmp; +- } +-}; +- +-struct String; +- +-// This is used as a helper type for accessing vectors. +-// Vector::data() assumes the vector elements start after the length field. +-template class Vector { +- public: +- typedef VectorIterator::mutable_return_type> +- iterator; +- typedef VectorIterator::return_type> +- const_iterator; +- typedef VectorReverseIterator reverse_iterator; +- typedef VectorReverseIterator const_reverse_iterator; +- +- uoffset_t size() const { return EndianScalar(length_); } +- +- // Deprecated: use size(). Here for backwards compatibility. +- FLATBUFFERS_ATTRIBUTE(deprecated("use size() instead")) +- uoffset_t Length() const { return size(); } +- +- typedef typename IndirectHelper::return_type return_type; +- typedef typename IndirectHelper::mutable_return_type mutable_return_type; +- typedef return_type value_type; +- +- return_type Get(uoffset_t i) const { +- FLATBUFFERS_ASSERT(i < size()); +- return IndirectHelper::Read(Data(), i); +- } +- +- return_type operator[](uoffset_t i) const { return Get(i); } +- +- // If this is a Vector of enums, T will be its storage type, not the enum +- // type. This function makes it convenient to retrieve value with enum +- // type E. +- template E GetEnum(uoffset_t i) const { +- return static_cast(Get(i)); +- } +- +- // If this a vector of unions, this does the cast for you. There's no check +- // to make sure this is the right type! +- template const U *GetAs(uoffset_t i) const { +- return reinterpret_cast(Get(i)); +- } +- +- // If this a vector of unions, this does the cast for you. There's no check +- // to make sure this is actually a string! +- const String *GetAsString(uoffset_t i) const { +- return reinterpret_cast(Get(i)); +- } +- +- const void *GetStructFromOffset(size_t o) const { +- return reinterpret_cast(Data() + o); +- } +- +- iterator begin() { return iterator(Data(), 0); } +- const_iterator begin() const { return const_iterator(Data(), 0); } +- +- iterator end() { return iterator(Data(), size()); } +- const_iterator end() const { return const_iterator(Data(), size()); } +- +- reverse_iterator rbegin() { return reverse_iterator(end()); } +- const_reverse_iterator rbegin() const { +- return const_reverse_iterator(end()); +- } +- +- reverse_iterator rend() { return reverse_iterator(begin()); } +- const_reverse_iterator rend() const { +- return const_reverse_iterator(begin()); +- } +- +- const_iterator cbegin() const { return begin(); } +- +- const_iterator cend() const { return end(); } +- +- const_reverse_iterator crbegin() const { return rbegin(); } +- +- const_reverse_iterator crend() const { return rend(); } +- +- // Change elements if you have a non-const pointer to this object. +- // Scalars only. See reflection.h, and the documentation. +- void Mutate(uoffset_t i, const T &val) { +- FLATBUFFERS_ASSERT(i < size()); +- WriteScalar(data() + i, val); +- } +- +- // Change an element of a vector of tables (or strings). +- // "val" points to the new table/string, as you can obtain from +- // e.g. reflection::AddFlatBuffer(). +- void MutateOffset(uoffset_t i, const uint8_t *val) { +- FLATBUFFERS_ASSERT(i < size()); +- static_assert(sizeof(T) == sizeof(uoffset_t), "Unrelated types"); +- WriteScalar(data() + i, +- static_cast(val - (Data() + i * sizeof(uoffset_t)))); +- } +- +- // Get a mutable pointer to tables/strings inside this vector. +- mutable_return_type GetMutableObject(uoffset_t i) const { +- FLATBUFFERS_ASSERT(i < size()); +- return const_cast(IndirectHelper::Read(Data(), i)); +- } +- +- // The raw data in little endian format. Use with care. +- const uint8_t *Data() const { +- return reinterpret_cast(&length_ + 1); +- } +- +- uint8_t *Data() { return reinterpret_cast(&length_ + 1); } +- +- // Similarly, but typed, much like std::vector::data +- const T *data() const { return reinterpret_cast(Data()); } +- T *data() { return reinterpret_cast(Data()); } +- +- template return_type LookupByKey(K key) const { +- void *search_result = std::bsearch( +- &key, Data(), size(), IndirectHelper::element_stride, KeyCompare); +- +- if (!search_result) { +- return nullptr; // Key not found. +- } +- +- const uint8_t *element = reinterpret_cast(search_result); +- +- return IndirectHelper::Read(element, 0); +- } +- +- protected: +- // This class is only used to access pre-existing data. Don't ever +- // try to construct these manually. +- Vector(); +- +- uoffset_t length_; +- +- private: +- // This class is a pointer. Copying will therefore create an invalid object. +- // Private and unimplemented copy constructor. +- Vector(const Vector &); +- Vector &operator=(const Vector &); +- +- template static int KeyCompare(const void *ap, const void *bp) { +- const K *key = reinterpret_cast(ap); +- const uint8_t *data = reinterpret_cast(bp); +- auto table = IndirectHelper::Read(data, 0); +- +- // std::bsearch compares with the operands transposed, so we negate the +- // result here. +- return -table->KeyCompareWithValue(*key); +- } +-}; +- +-// Represent a vector much like the template above, but in this case we +-// don't know what the element types are (used with reflection.h). +-class VectorOfAny { +- public: +- uoffset_t size() const { return EndianScalar(length_); } +- +- const uint8_t *Data() const { +- return reinterpret_cast(&length_ + 1); +- } +- uint8_t *Data() { return reinterpret_cast(&length_ + 1); } +- +- protected: +- VectorOfAny(); +- +- uoffset_t length_; +- +- private: +- VectorOfAny(const VectorOfAny &); +- VectorOfAny &operator=(const VectorOfAny &); +-}; +- +-#ifndef FLATBUFFERS_CPP98_STL +-template +-Vector> *VectorCast(Vector> *ptr) { +- static_assert(std::is_base_of::value, "Unrelated types"); +- return reinterpret_cast> *>(ptr); +-} +- +-template +-const Vector> *VectorCast(const Vector> *ptr) { +- static_assert(std::is_base_of::value, "Unrelated types"); +- return reinterpret_cast> *>(ptr); +-} +-#endif +- +-// Convenient helper function to get the length of any vector, regardless +-// of whether it is null or not (the field is not set). +-template static inline size_t VectorLength(const Vector *v) { +- return v ? v->size() : 0; +-} +- +-// This is used as a helper type for accessing arrays. +-template class Array { +- typedef +- typename flatbuffers::integral_constant::value> +- scalar_tag; +- typedef +- typename flatbuffers::conditional::type +- IndirectHelperType; +- +- public: +- typedef uint16_t size_type; +- typedef typename IndirectHelper::return_type return_type; +- typedef VectorIterator const_iterator; +- typedef VectorReverseIterator const_reverse_iterator; +- +- FLATBUFFERS_CONSTEXPR uint16_t size() const { return length; } +- +- return_type Get(uoffset_t i) const { +- FLATBUFFERS_ASSERT(i < size()); +- return IndirectHelper::Read(Data(), i); +- } +- +- return_type operator[](uoffset_t i) const { return Get(i); } +- +- // If this is a Vector of enums, T will be its storage type, not the enum +- // type. This function makes it convenient to retrieve value with enum +- // type E. +- template E GetEnum(uoffset_t i) const { +- return static_cast(Get(i)); +- } +- +- const_iterator begin() const { return const_iterator(Data(), 0); } +- const_iterator end() const { return const_iterator(Data(), size()); } +- +- const_reverse_iterator rbegin() const { +- return const_reverse_iterator(end()); +- } +- const_reverse_iterator rend() const { +- return const_reverse_iterator(begin()); +- } +- +- const_iterator cbegin() const { return begin(); } +- const_iterator cend() const { return end(); } +- +- const_reverse_iterator crbegin() const { return rbegin(); } +- const_reverse_iterator crend() const { return rend(); } +- +- // Get a mutable pointer to elements inside this array. +- // This method used to mutate arrays of structs followed by a @p Mutate +- // operation. For primitive types use @p Mutate directly. +- // @warning Assignments and reads to/from the dereferenced pointer are not +- // automatically converted to the correct endianness. +- typename flatbuffers::conditional::type +- GetMutablePointer(uoffset_t i) const { +- FLATBUFFERS_ASSERT(i < size()); +- return const_cast(&data()[i]); +- } +- +- // Change elements if you have a non-const pointer to this object. +- void Mutate(uoffset_t i, const T &val) { MutateImpl(scalar_tag(), i, val); } +- +- // The raw data in little endian format. Use with care. +- const uint8_t *Data() const { return data_; } +- +- uint8_t *Data() { return data_; } +- +- // Similarly, but typed, much like std::vector::data +- const T *data() const { return reinterpret_cast(Data()); } +- T *data() { return reinterpret_cast(Data()); } +- +- // Copy data from a span with endian conversion. +- // If this Array and the span overlap, the behavior is undefined. +- void CopyFromSpan(flatbuffers::span src) { +- const auto p1 = reinterpret_cast(src.data()); +- const auto p2 = Data(); +- FLATBUFFERS_ASSERT(!(p1 >= p2 && p1 < (p2 + length)) && +- !(p2 >= p1 && p2 < (p1 + length))); +- (void)p1; +- (void)p2; +- +- CopyFromSpanImpl( +- flatbuffers::integral_constant < bool, +- !scalar_tag::value || sizeof(T) == 1 || FLATBUFFERS_LITTLEENDIAN > (), +- src); +- } +- +- protected: +- void MutateImpl(flatbuffers::integral_constant, uoffset_t i, +- const T &val) { +- FLATBUFFERS_ASSERT(i < size()); +- WriteScalar(data() + i, val); +- } +- +- void MutateImpl(flatbuffers::integral_constant, uoffset_t i, +- const T &val) { +- *(GetMutablePointer(i)) = val; +- } +- +- void CopyFromSpanImpl(flatbuffers::integral_constant, +- flatbuffers::span src) { +- // Use std::memcpy() instead of std::copy() to avoid preformance degradation +- // due to aliasing if T is char or unsigned char. +- // The size is known at compile time, so memcpy would be inlined. +- std::memcpy(data(), src.data(), length * sizeof(T)); +- } +- +- // Copy data from flatbuffers::span with endian conversion. +- void CopyFromSpanImpl(flatbuffers::integral_constant, +- flatbuffers::span src) { +- for (size_type k = 0; k < length; k++) { Mutate(k, src[k]); } +- } +- +- // This class is only used to access pre-existing data. Don't ever +- // try to construct these manually. +- // 'constexpr' allows us to use 'size()' at compile time. +- // @note Must not use 'FLATBUFFERS_CONSTEXPR' here, as const is not allowed on +- // a constructor. +-#if defined(__cpp_constexpr) +- constexpr Array(); +-#else +- Array(); +-#endif +- +- uint8_t data_[length * sizeof(T)]; +- +- private: +- // This class is a pointer. Copying will therefore create an invalid object. +- // Private and unimplemented copy constructor. +- Array(const Array &); +- Array &operator=(const Array &); +-}; +- +-// Specialization for Array[struct] with access using Offset pointer. +-// This specialization used by idl_gen_text.cpp. +-template class Array, length> { +- static_assert(flatbuffers::is_same::value, "unexpected type T"); +- +- public: +- typedef const void *return_type; +- +- const uint8_t *Data() const { return data_; } +- +- // Make idl_gen_text.cpp::PrintContainer happy. +- return_type operator[](uoffset_t) const { +- FLATBUFFERS_ASSERT(false); +- return nullptr; +- } +- +- private: +- // This class is only used to access pre-existing data. +- Array(); +- Array(const Array &); +- Array &operator=(const Array &); +- +- uint8_t data_[1]; +-}; +- +-// Cast a raw T[length] to a raw flatbuffers::Array +-// without endian conversion. Use with care. +-template +-Array &CastToArray(T (&arr)[length]) { +- return *reinterpret_cast *>(arr); +-} +- +-template +-const Array &CastToArray(const T (&arr)[length]) { +- return *reinterpret_cast *>(arr); +-} +- +-template +-Array &CastToArrayOfEnum(T (&arr)[length]) { +- static_assert(sizeof(E) == sizeof(T), "invalid enum type E"); +- return *reinterpret_cast *>(arr); +-} +- +-template +-const Array &CastToArrayOfEnum(const T (&arr)[length]) { +- static_assert(sizeof(E) == sizeof(T), "invalid enum type E"); +- return *reinterpret_cast *>(arr); +-} +- +-// Lexicographically compare two strings (possibly containing nulls), and +-// return true if the first is less than the second. +-static inline bool StringLessThan(const char *a_data, uoffset_t a_size, +- const char *b_data, uoffset_t b_size) { +- const auto cmp = memcmp(a_data, b_data, (std::min)(a_size, b_size)); +- return cmp == 0 ? a_size < b_size : cmp < 0; +-} +- +-struct String : public Vector { +- const char *c_str() const { return reinterpret_cast(Data()); } +- std::string str() const { return std::string(c_str(), size()); } +- +- // clang-format off +- #ifdef FLATBUFFERS_HAS_STRING_VIEW +- flatbuffers::string_view string_view() const { +- return flatbuffers::string_view(c_str(), size()); +- } +- #endif // FLATBUFFERS_HAS_STRING_VIEW +- // clang-format on +- +- bool operator<(const String &o) const { +- return StringLessThan(this->data(), this->size(), o.data(), o.size()); +- } +-}; +- +-// Convenience function to get std::string from a String returning an empty +-// string on null pointer. +-static inline std::string GetString(const String *str) { +- return str ? str->str() : ""; +-} +- +-// Convenience function to get char* from a String returning an empty string on +-// null pointer. +-static inline const char *GetCstring(const String *str) { +- return str ? str->c_str() : ""; +-} +- +-#ifdef FLATBUFFERS_HAS_STRING_VIEW +-// Convenience function to get string_view from a String returning an empty +-// string_view on null pointer. +-static inline flatbuffers::string_view GetStringView(const String *str) { +- return str ? str->string_view() : flatbuffers::string_view(); +-} +-#endif // FLATBUFFERS_HAS_STRING_VIEW +- +-// Allocator interface. This is flatbuffers-specific and meant only for +-// `vector_downward` usage. +-class Allocator { +- public: +- virtual ~Allocator() {} +- +- // Allocate `size` bytes of memory. +- virtual uint8_t *allocate(size_t size) = 0; +- +- // Deallocate `size` bytes of memory at `p` allocated by this allocator. +- virtual void deallocate(uint8_t *p, size_t size) = 0; +- +- // Reallocate `new_size` bytes of memory, replacing the old region of size +- // `old_size` at `p`. In contrast to a normal realloc, this grows downwards, +- // and is intended specifcally for `vector_downward` use. +- // `in_use_back` and `in_use_front` indicate how much of `old_size` is +- // actually in use at each end, and needs to be copied. +- virtual uint8_t *reallocate_downward(uint8_t *old_p, size_t old_size, +- size_t new_size, size_t in_use_back, +- size_t in_use_front) { +- FLATBUFFERS_ASSERT(new_size > old_size); // vector_downward only grows +- uint8_t *new_p = allocate(new_size); +- memcpy_downward(old_p, old_size, new_p, new_size, in_use_back, +- in_use_front); +- deallocate(old_p, old_size); +- return new_p; +- } +- +- protected: +- // Called by `reallocate_downward` to copy memory from `old_p` of `old_size` +- // to `new_p` of `new_size`. Only memory of size `in_use_front` and +- // `in_use_back` will be copied from the front and back of the old memory +- // allocation. +- void memcpy_downward(uint8_t *old_p, size_t old_size, uint8_t *new_p, +- size_t new_size, size_t in_use_back, +- size_t in_use_front) { +- memcpy(new_p + new_size - in_use_back, old_p + old_size - in_use_back, +- in_use_back); +- memcpy(new_p, old_p, in_use_front); +- } +-}; +- +-// DefaultAllocator uses new/delete to allocate memory regions +-class DefaultAllocator : public Allocator { +- public: +- uint8_t *allocate(size_t size) FLATBUFFERS_OVERRIDE { +- return new uint8_t[size]; +- } +- +- void deallocate(uint8_t *p, size_t) FLATBUFFERS_OVERRIDE { delete[] p; } +- +- static void dealloc(void *p, size_t) { delete[] static_cast(p); } +-}; +- +-// These functions allow for a null allocator to mean use the default allocator, +-// as used by DetachedBuffer and vector_downward below. +-// This is to avoid having a statically or dynamically allocated default +-// allocator, or having to move it between the classes that may own it. +-inline uint8_t *Allocate(Allocator *allocator, size_t size) { +- return allocator ? allocator->allocate(size) +- : DefaultAllocator().allocate(size); +-} +- +-inline void Deallocate(Allocator *allocator, uint8_t *p, size_t size) { +- if (allocator) +- allocator->deallocate(p, size); +- else +- DefaultAllocator().deallocate(p, size); +-} +- +-inline uint8_t *ReallocateDownward(Allocator *allocator, uint8_t *old_p, +- size_t old_size, size_t new_size, +- size_t in_use_back, size_t in_use_front) { +- return allocator ? allocator->reallocate_downward(old_p, old_size, new_size, +- in_use_back, in_use_front) +- : DefaultAllocator().reallocate_downward( +- old_p, old_size, new_size, in_use_back, in_use_front); +-} +- +-// DetachedBuffer is a finished flatbuffer memory region, detached from its +-// builder. The original memory region and allocator are also stored so that +-// the DetachedBuffer can manage the memory lifetime. +-class DetachedBuffer { +- public: +- DetachedBuffer() +- : allocator_(nullptr), +- own_allocator_(false), +- buf_(nullptr), +- reserved_(0), +- cur_(nullptr), +- size_(0) {} +- +- DetachedBuffer(Allocator *allocator, bool own_allocator, uint8_t *buf, +- size_t reserved, uint8_t *cur, size_t sz) +- : allocator_(allocator), +- own_allocator_(own_allocator), +- buf_(buf), +- reserved_(reserved), +- cur_(cur), +- size_(sz) {} +- +- // clang-format off +- #if !defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- DetachedBuffer(DetachedBuffer &&other) +- : allocator_(other.allocator_), +- own_allocator_(other.own_allocator_), +- buf_(other.buf_), +- reserved_(other.reserved_), +- cur_(other.cur_), +- size_(other.size_) { +- other.reset(); +- } +- // clang-format off +- #endif // !defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- +- // clang-format off +- #if !defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- DetachedBuffer &operator=(DetachedBuffer &&other) { +- if (this == &other) return *this; +- +- destroy(); +- +- allocator_ = other.allocator_; +- own_allocator_ = other.own_allocator_; +- buf_ = other.buf_; +- reserved_ = other.reserved_; +- cur_ = other.cur_; +- size_ = other.size_; +- +- other.reset(); +- +- return *this; +- } +- // clang-format off +- #endif // !defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- +- ~DetachedBuffer() { destroy(); } +- +- const uint8_t *data() const { return cur_; } +- +- uint8_t *data() { return cur_; } +- +- size_t size() const { return size_; } +- +- // clang-format off +- #if 0 // disabled for now due to the ordering of classes in this header +- template +- bool Verify() const { +- Verifier verifier(data(), size()); +- return verifier.Verify(nullptr); +- } +- +- template +- const T* GetRoot() const { +- return flatbuffers::GetRoot(data()); +- } +- +- template +- T* GetRoot() { +- return flatbuffers::GetRoot(data()); +- } +- #endif +- // clang-format on +- +- // clang-format off +- #if !defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- // These may change access mode, leave these at end of public section +- FLATBUFFERS_DELETE_FUNC(DetachedBuffer(const DetachedBuffer &other)); +- FLATBUFFERS_DELETE_FUNC( +- DetachedBuffer &operator=(const DetachedBuffer &other)); +- // clang-format off +- #endif // !defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- +- protected: +- Allocator *allocator_; +- bool own_allocator_; +- uint8_t *buf_; +- size_t reserved_; +- uint8_t *cur_; +- size_t size_; +- +- inline void destroy() { +- if (buf_) Deallocate(allocator_, buf_, reserved_); +- if (own_allocator_ && allocator_) { delete allocator_; } +- reset(); +- } +- +- inline void reset() { +- allocator_ = nullptr; +- own_allocator_ = false; +- buf_ = nullptr; +- reserved_ = 0; +- cur_ = nullptr; +- size_ = 0; +- } +-}; +- +-// This is a minimal replication of std::vector functionality, +-// except growing from higher to lower addresses. i.e push_back() inserts data +-// in the lowest address in the vector. +-// Since this vector leaves the lower part unused, we support a "scratch-pad" +-// that can be stored there for temporary data, to share the allocated space. +-// Essentially, this supports 2 std::vectors in a single buffer. +-class vector_downward { +- public: +- explicit vector_downward(size_t initial_size, Allocator *allocator, +- bool own_allocator, size_t buffer_minalign) +- : allocator_(allocator), +- own_allocator_(own_allocator), +- initial_size_(initial_size), +- buffer_minalign_(buffer_minalign), +- reserved_(0), +- buf_(nullptr), +- cur_(nullptr), +- scratch_(nullptr) {} +- +- // clang-format off +- #if !defined(FLATBUFFERS_CPP98_STL) +- vector_downward(vector_downward &&other) +- #else +- vector_downward(vector_downward &other) +- #endif // defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- : allocator_(other.allocator_), +- own_allocator_(other.own_allocator_), +- initial_size_(other.initial_size_), +- buffer_minalign_(other.buffer_minalign_), +- reserved_(other.reserved_), +- buf_(other.buf_), +- cur_(other.cur_), +- scratch_(other.scratch_) { +- // No change in other.allocator_ +- // No change in other.initial_size_ +- // No change in other.buffer_minalign_ +- other.own_allocator_ = false; +- other.reserved_ = 0; +- other.buf_ = nullptr; +- other.cur_ = nullptr; +- other.scratch_ = nullptr; +- } +- +- // clang-format off +- #if !defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- vector_downward &operator=(vector_downward &&other) { +- // Move construct a temporary and swap idiom +- vector_downward temp(std::move(other)); +- swap(temp); +- return *this; +- } +- // clang-format off +- #endif // defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- +- ~vector_downward() { +- clear_buffer(); +- clear_allocator(); +- } +- +- void reset() { +- clear_buffer(); +- clear(); +- } +- +- void clear() { +- if (buf_) { +- cur_ = buf_ + reserved_; +- } else { +- reserved_ = 0; +- cur_ = nullptr; +- } +- clear_scratch(); +- } +- +- void clear_scratch() { scratch_ = buf_; } +- +- void clear_allocator() { +- if (own_allocator_ && allocator_) { delete allocator_; } +- allocator_ = nullptr; +- own_allocator_ = false; +- } +- +- void clear_buffer() { +- if (buf_) Deallocate(allocator_, buf_, reserved_); +- buf_ = nullptr; +- } +- +- // Relinquish the pointer to the caller. +- uint8_t *release_raw(size_t &allocated_bytes, size_t &offset) { +- auto *buf = buf_; +- allocated_bytes = reserved_; +- offset = static_cast(cur_ - buf_); +- +- // release_raw only relinquishes the buffer ownership. +- // Does not deallocate or reset the allocator. Destructor will do that. +- buf_ = nullptr; +- clear(); +- return buf; +- } +- +- // Relinquish the pointer to the caller. +- DetachedBuffer release() { +- // allocator ownership (if any) is transferred to DetachedBuffer. +- DetachedBuffer fb(allocator_, own_allocator_, buf_, reserved_, cur_, +- size()); +- if (own_allocator_) { +- allocator_ = nullptr; +- own_allocator_ = false; +- } +- buf_ = nullptr; +- clear(); +- return fb; +- } +- +- size_t ensure_space(size_t len) { +- FLATBUFFERS_ASSERT(cur_ >= scratch_ && scratch_ >= buf_); +- if (len > static_cast(cur_ - scratch_)) { reallocate(len); } +- // Beyond this, signed offsets may not have enough range: +- // (FlatBuffers > 2GB not supported). +- FLATBUFFERS_ASSERT(size() < FLATBUFFERS_MAX_BUFFER_SIZE); +- return len; +- } +- +- inline uint8_t *make_space(size_t len) { +- size_t space = ensure_space(len); +- cur_ -= space; +- return cur_; +- } +- +- // Returns nullptr if using the DefaultAllocator. +- Allocator *get_custom_allocator() { return allocator_; } +- +- uoffset_t size() const { +- return static_cast(reserved_ - static_cast(cur_ - buf_)); +- } +- +- uoffset_t scratch_size() const { +- return static_cast(scratch_ - buf_); +- } +- +- size_t capacity() const { return reserved_; } +- +- uint8_t *data() const { +- FLATBUFFERS_ASSERT(cur_); +- return cur_; +- } +- +- uint8_t *scratch_data() const { +- FLATBUFFERS_ASSERT(buf_); +- return buf_; +- } +- +- uint8_t *scratch_end() const { +- FLATBUFFERS_ASSERT(scratch_); +- return scratch_; +- } +- +- uint8_t *data_at(size_t offset) const { return buf_ + reserved_ - offset; } +- +- void push(const uint8_t *bytes, size_t num) { +- if (num > 0) { memcpy(make_space(num), bytes, num); } +- } +- +- // Specialized version of push() that avoids memcpy call for small data. +- template void push_small(const T &little_endian_t) { +- make_space(sizeof(T)); +- *reinterpret_cast(cur_) = little_endian_t; +- } +- +- template void scratch_push_small(const T &t) { +- ensure_space(sizeof(T)); +- *reinterpret_cast(scratch_) = t; +- scratch_ += sizeof(T); +- } +- +- // fill() is most frequently called with small byte counts (<= 4), +- // which is why we're using loops rather than calling memset. +- void fill(size_t zero_pad_bytes) { +- make_space(zero_pad_bytes); +- for (size_t i = 0; i < zero_pad_bytes; i++) cur_[i] = 0; +- } +- +- // Version for when we know the size is larger. +- // Precondition: zero_pad_bytes > 0 +- void fill_big(size_t zero_pad_bytes) { +- memset(make_space(zero_pad_bytes), 0, zero_pad_bytes); +- } +- +- void pop(size_t bytes_to_remove) { cur_ += bytes_to_remove; } +- void scratch_pop(size_t bytes_to_remove) { scratch_ -= bytes_to_remove; } +- +- void swap(vector_downward &other) { +- using std::swap; +- swap(allocator_, other.allocator_); +- swap(own_allocator_, other.own_allocator_); +- swap(initial_size_, other.initial_size_); +- swap(buffer_minalign_, other.buffer_minalign_); +- swap(reserved_, other.reserved_); +- swap(buf_, other.buf_); +- swap(cur_, other.cur_); +- swap(scratch_, other.scratch_); +- } +- +- void swap_allocator(vector_downward &other) { +- using std::swap; +- swap(allocator_, other.allocator_); +- swap(own_allocator_, other.own_allocator_); +- } +- +- private: +- // You shouldn't really be copying instances of this class. +- FLATBUFFERS_DELETE_FUNC(vector_downward(const vector_downward &)); +- FLATBUFFERS_DELETE_FUNC(vector_downward &operator=(const vector_downward &)); +- +- Allocator *allocator_; +- bool own_allocator_; +- size_t initial_size_; +- size_t buffer_minalign_; +- size_t reserved_; +- uint8_t *buf_; +- uint8_t *cur_; // Points at location between empty (below) and used (above). +- uint8_t *scratch_; // Points to the end of the scratchpad in use. +- +- void reallocate(size_t len) { +- auto old_reserved = reserved_; +- auto old_size = size(); +- auto old_scratch_size = scratch_size(); +- reserved_ += +- (std::max)(len, old_reserved ? old_reserved / 2 : initial_size_); +- reserved_ = (reserved_ + buffer_minalign_ - 1) & ~(buffer_minalign_ - 1); +- if (buf_) { +- buf_ = ReallocateDownward(allocator_, buf_, old_reserved, reserved_, +- old_size, old_scratch_size); +- } else { +- buf_ = Allocate(allocator_, reserved_); +- } +- cur_ = buf_ + reserved_ - old_size; +- scratch_ = buf_ + old_scratch_size; +- } +-}; +- +-// Converts a Field ID to a virtual table offset. +-inline voffset_t FieldIndexToOffset(voffset_t field_id) { +- // Should correspond to what EndTable() below builds up. +- const int fixed_fields = 2; // Vtable size and Object Size. +- return static_cast((field_id + fixed_fields) * sizeof(voffset_t)); +-} +- +-template +-const T *data(const std::vector &v) { +- // Eventually the returned pointer gets passed down to memcpy, so +- // we need it to be non-null to avoid undefined behavior. +- static uint8_t t; +- return v.empty() ? reinterpret_cast(&t) : &v.front(); +-} +-template T *data(std::vector &v) { +- // Eventually the returned pointer gets passed down to memcpy, so +- // we need it to be non-null to avoid undefined behavior. +- static uint8_t t; +- return v.empty() ? reinterpret_cast(&t) : &v.front(); +-} +- +-/// @endcond +- +-/// @addtogroup flatbuffers_cpp_api +-/// @{ +-/// @class FlatBufferBuilder +-/// @brief Helper class to hold data needed in creation of a FlatBuffer. +-/// To serialize data, you typically call one of the `Create*()` functions in +-/// the generated code, which in turn call a sequence of `StartTable`/ +-/// `PushElement`/`AddElement`/`EndTable`, or the builtin `CreateString`/ +-/// `CreateVector` functions. Do this is depth-first order to build up a tree to +-/// the root. `Finish()` wraps up the buffer ready for transport. +-class FlatBufferBuilder { +- public: +- /// @brief Default constructor for FlatBufferBuilder. +- /// @param[in] initial_size The initial size of the buffer, in bytes. Defaults +- /// to `1024`. +- /// @param[in] allocator An `Allocator` to use. If null will use +- /// `DefaultAllocator`. +- /// @param[in] own_allocator Whether the builder/vector should own the +- /// allocator. Defaults to / `false`. +- /// @param[in] buffer_minalign Force the buffer to be aligned to the given +- /// minimum alignment upon reallocation. Only needed if you intend to store +- /// types with custom alignment AND you wish to read the buffer in-place +- /// directly after creation. +- explicit FlatBufferBuilder( +- size_t initial_size = 1024, Allocator *allocator = nullptr, +- bool own_allocator = false, +- size_t buffer_minalign = AlignOf()) +- : buf_(initial_size, allocator, own_allocator, buffer_minalign), +- num_field_loc(0), +- max_voffset_(0), +- nested(false), +- finished(false), +- minalign_(1), +- force_defaults_(false), +- dedup_vtables_(true), +- string_pool(nullptr) { +- EndianCheck(); +- } +- +- // clang-format off +- /// @brief Move constructor for FlatBufferBuilder. +- #if !defined(FLATBUFFERS_CPP98_STL) +- FlatBufferBuilder(FlatBufferBuilder &&other) +- #else +- FlatBufferBuilder(FlatBufferBuilder &other) +- #endif // #if !defined(FLATBUFFERS_CPP98_STL) +- : buf_(1024, nullptr, false, AlignOf()), +- num_field_loc(0), +- max_voffset_(0), +- nested(false), +- finished(false), +- minalign_(1), +- force_defaults_(false), +- dedup_vtables_(true), +- string_pool(nullptr) { +- EndianCheck(); +- // Default construct and swap idiom. +- // Lack of delegating constructors in vs2010 makes it more verbose than needed. +- Swap(other); +- } +- // clang-format on +- +- // clang-format off +- #if !defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- /// @brief Move assignment operator for FlatBufferBuilder. +- FlatBufferBuilder &operator=(FlatBufferBuilder &&other) { +- // Move construct a temporary and swap idiom +- FlatBufferBuilder temp(std::move(other)); +- Swap(temp); +- return *this; +- } +- // clang-format off +- #endif // defined(FLATBUFFERS_CPP98_STL) +- // clang-format on +- +- void Swap(FlatBufferBuilder &other) { +- using std::swap; +- buf_.swap(other.buf_); +- swap(num_field_loc, other.num_field_loc); +- swap(max_voffset_, other.max_voffset_); +- swap(nested, other.nested); +- swap(finished, other.finished); +- swap(minalign_, other.minalign_); +- swap(force_defaults_, other.force_defaults_); +- swap(dedup_vtables_, other.dedup_vtables_); +- swap(string_pool, other.string_pool); +- } +- +- ~FlatBufferBuilder() { +- if (string_pool) delete string_pool; +- } +- +- void Reset() { +- Clear(); // clear builder state +- buf_.reset(); // deallocate buffer +- } +- +- /// @brief Reset all the state in this FlatBufferBuilder so it can be reused +- /// to construct another buffer. +- void Clear() { +- ClearOffsets(); +- buf_.clear(); +- nested = false; +- finished = false; +- minalign_ = 1; +- if (string_pool) string_pool->clear(); +- } +- +- /// @brief The current size of the serialized buffer, counting from the end. +- /// @return Returns an `uoffset_t` with the current size of the buffer. +- uoffset_t GetSize() const { return buf_.size(); } +- +- /// @brief Get the serialized buffer (after you call `Finish()`). +- /// @return Returns an `uint8_t` pointer to the FlatBuffer data inside the +- /// buffer. +- uint8_t *GetBufferPointer() const { +- Finished(); +- return buf_.data(); +- } +- +- /// @brief Get the serialized buffer (after you call `Finish()`) as a span. +- /// @return Returns a constructed flatbuffers::span that is a view over the +- /// FlatBuffer data inside the buffer. +- flatbuffers::span GetBufferSpan() const { +- Finished(); +- return flatbuffers::span(buf_.data(), buf_.size()); +- } +- +- /// @brief Get a pointer to an unfinished buffer. +- /// @return Returns a `uint8_t` pointer to the unfinished buffer. +- uint8_t *GetCurrentBufferPointer() const { return buf_.data(); } +- +- /// @brief Get the released pointer to the serialized buffer. +- /// @warning Do NOT attempt to use this FlatBufferBuilder afterwards! +- /// @return A `FlatBuffer` that owns the buffer and its allocator and +- /// behaves similar to a `unique_ptr` with a deleter. +- FLATBUFFERS_ATTRIBUTE(deprecated("use Release() instead")) +- DetachedBuffer ReleaseBufferPointer() { +- Finished(); +- return buf_.release(); +- } +- +- /// @brief Get the released DetachedBuffer. +- /// @return A `DetachedBuffer` that owns the buffer and its allocator. +- DetachedBuffer Release() { +- Finished(); +- return buf_.release(); +- } +- +- /// @brief Get the released pointer to the serialized buffer. +- /// @param size The size of the memory block containing +- /// the serialized `FlatBuffer`. +- /// @param offset The offset from the released pointer where the finished +- /// `FlatBuffer` starts. +- /// @return A raw pointer to the start of the memory block containing +- /// the serialized `FlatBuffer`. +- /// @remark If the allocator is owned, it gets deleted when the destructor is +- /// called.. +- uint8_t *ReleaseRaw(size_t &size, size_t &offset) { +- Finished(); +- return buf_.release_raw(size, offset); +- } +- +- /// @brief get the minimum alignment this buffer needs to be accessed +- /// properly. This is only known once all elements have been written (after +- /// you call Finish()). You can use this information if you need to embed +- /// a FlatBuffer in some other buffer, such that you can later read it +- /// without first having to copy it into its own buffer. +- size_t GetBufferMinAlignment() const { +- Finished(); +- return minalign_; +- } +- +- /// @cond FLATBUFFERS_INTERNAL +- void Finished() const { +- // If you get this assert, you're attempting to get access a buffer +- // which hasn't been finished yet. Be sure to call +- // FlatBufferBuilder::Finish with your root table. +- // If you really need to access an unfinished buffer, call +- // GetCurrentBufferPointer instead. +- FLATBUFFERS_ASSERT(finished); +- } +- /// @endcond +- +- /// @brief In order to save space, fields that are set to their default value +- /// don't get serialized into the buffer. +- /// @param[in] fd When set to `true`, always serializes default values that +- /// are set. Optional fields which are not set explicitly, will still not be +- /// serialized. +- void ForceDefaults(bool fd) { force_defaults_ = fd; } +- +- /// @brief By default vtables are deduped in order to save space. +- /// @param[in] dedup When set to `true`, dedup vtables. +- void DedupVtables(bool dedup) { dedup_vtables_ = dedup; } +- +- /// @cond FLATBUFFERS_INTERNAL +- void Pad(size_t num_bytes) { buf_.fill(num_bytes); } +- +- void TrackMinAlign(size_t elem_size) { +- if (elem_size > minalign_) minalign_ = elem_size; +- } +- +- void Align(size_t elem_size) { +- TrackMinAlign(elem_size); +- buf_.fill(PaddingBytes(buf_.size(), elem_size)); +- } +- +- void PushFlatBuffer(const uint8_t *bytes, size_t size) { +- PushBytes(bytes, size); +- finished = true; +- } +- +- void PushBytes(const uint8_t *bytes, size_t size) { buf_.push(bytes, size); } +- +- void PopBytes(size_t amount) { buf_.pop(amount); } +- +- template void AssertScalarT() { +- // The code assumes power of 2 sizes and endian-swap-ability. +- static_assert(flatbuffers::is_scalar::value, "T must be a scalar type"); +- } +- +- // Write a single aligned scalar to the buffer +- template uoffset_t PushElement(T element) { +- AssertScalarT(); +- T litle_endian_element = EndianScalar(element); +- Align(sizeof(T)); +- buf_.push_small(litle_endian_element); +- return GetSize(); +- } +- +- template uoffset_t PushElement(Offset off) { +- // Special case for offsets: see ReferTo below. +- return PushElement(ReferTo(off.o)); +- } +- +- // When writing fields, we track where they are, so we can create correct +- // vtables later. +- void TrackField(voffset_t field, uoffset_t off) { +- FieldLoc fl = { off, field }; +- buf_.scratch_push_small(fl); +- num_field_loc++; +- max_voffset_ = (std::max)(max_voffset_, field); +- } +- +- // Like PushElement, but additionally tracks the field this represents. +- template void AddElement(voffset_t field, T e, T def) { +- // We don't serialize values equal to the default. +- if (IsTheSameAs(e, def) && !force_defaults_) return; +- auto off = PushElement(e); +- TrackField(field, off); +- } +- +- template void AddElement(voffset_t field, T e) { +- auto off = PushElement(e); +- TrackField(field, off); +- } +- +- template void AddOffset(voffset_t field, Offset off) { +- if (off.IsNull()) return; // Don't store. +- AddElement(field, ReferTo(off.o), static_cast(0)); +- } +- +- template void AddStruct(voffset_t field, const T *structptr) { +- if (!structptr) return; // Default, don't store. +- Align(AlignOf()); +- buf_.push_small(*structptr); +- TrackField(field, GetSize()); +- } +- +- void AddStructOffset(voffset_t field, uoffset_t off) { +- TrackField(field, off); +- } +- +- // Offsets initially are relative to the end of the buffer (downwards). +- // This function converts them to be relative to the current location +- // in the buffer (when stored here), pointing upwards. +- uoffset_t ReferTo(uoffset_t off) { +- // Align to ensure GetSize() below is correct. +- Align(sizeof(uoffset_t)); +- // Offset must refer to something already in buffer. +- FLATBUFFERS_ASSERT(off && off <= GetSize()); +- return GetSize() - off + static_cast(sizeof(uoffset_t)); +- } +- +- void NotNested() { +- // If you hit this, you're trying to construct a Table/Vector/String +- // during the construction of its parent table (between the MyTableBuilder +- // and table.Finish(). +- // Move the creation of these sub-objects to above the MyTableBuilder to +- // not get this assert. +- // Ignoring this assert may appear to work in simple cases, but the reason +- // it is here is that storing objects in-line may cause vtable offsets +- // to not fit anymore. It also leads to vtable duplication. +- FLATBUFFERS_ASSERT(!nested); +- // If you hit this, fields were added outside the scope of a table. +- FLATBUFFERS_ASSERT(!num_field_loc); +- } +- +- // From generated code (or from the parser), we call StartTable/EndTable +- // with a sequence of AddElement calls in between. +- uoffset_t StartTable() { +- NotNested(); +- nested = true; +- return GetSize(); +- } +- +- // This finishes one serialized object by generating the vtable if it's a +- // table, comparing it against existing vtables, and writing the +- // resulting vtable offset. +- uoffset_t EndTable(uoffset_t start) { +- // If you get this assert, a corresponding StartTable wasn't called. +- FLATBUFFERS_ASSERT(nested); +- // Write the vtable offset, which is the start of any Table. +- // We fill it's value later. +- auto vtableoffsetloc = PushElement(0); +- // Write a vtable, which consists entirely of voffset_t elements. +- // It starts with the number of offsets, followed by a type id, followed +- // by the offsets themselves. In reverse: +- // Include space for the last offset and ensure empty tables have a +- // minimum size. +- max_voffset_ = +- (std::max)(static_cast(max_voffset_ + sizeof(voffset_t)), +- FieldIndexToOffset(0)); +- buf_.fill_big(max_voffset_); +- auto table_object_size = vtableoffsetloc - start; +- // Vtable use 16bit offsets. +- FLATBUFFERS_ASSERT(table_object_size < 0x10000); +- WriteScalar(buf_.data() + sizeof(voffset_t), +- static_cast(table_object_size)); +- WriteScalar(buf_.data(), max_voffset_); +- // Write the offsets into the table +- for (auto it = buf_.scratch_end() - num_field_loc * sizeof(FieldLoc); +- it < buf_.scratch_end(); it += sizeof(FieldLoc)) { +- auto field_location = reinterpret_cast(it); +- auto pos = static_cast(vtableoffsetloc - field_location->off); +- // If this asserts, it means you've set a field twice. +- FLATBUFFERS_ASSERT( +- !ReadScalar(buf_.data() + field_location->id)); +- WriteScalar(buf_.data() + field_location->id, pos); +- } +- ClearOffsets(); +- auto vt1 = reinterpret_cast(buf_.data()); +- auto vt1_size = ReadScalar(vt1); +- auto vt_use = GetSize(); +- // See if we already have generated a vtable with this exact same +- // layout before. If so, make it point to the old one, remove this one. +- if (dedup_vtables_) { +- for (auto it = buf_.scratch_data(); it < buf_.scratch_end(); +- it += sizeof(uoffset_t)) { +- auto vt_offset_ptr = reinterpret_cast(it); +- auto vt2 = reinterpret_cast(buf_.data_at(*vt_offset_ptr)); +- auto vt2_size = ReadScalar(vt2); +- if (vt1_size != vt2_size || 0 != memcmp(vt2, vt1, vt1_size)) continue; +- vt_use = *vt_offset_ptr; +- buf_.pop(GetSize() - vtableoffsetloc); +- break; +- } +- } +- // If this is a new vtable, remember it. +- if (vt_use == GetSize()) { buf_.scratch_push_small(vt_use); } +- // Fill the vtable offset we created above. +- // The offset points from the beginning of the object to where the +- // vtable is stored. +- // Offsets default direction is downward in memory for future format +- // flexibility (storing all vtables at the start of the file). +- WriteScalar(buf_.data_at(vtableoffsetloc), +- static_cast(vt_use) - +- static_cast(vtableoffsetloc)); +- +- nested = false; +- return vtableoffsetloc; +- } +- +- FLATBUFFERS_ATTRIBUTE(deprecated("call the version above instead")) +- uoffset_t EndTable(uoffset_t start, voffset_t /*numfields*/) { +- return EndTable(start); +- } +- +- // This checks a required field has been set in a given table that has +- // just been constructed. +- template void Required(Offset table, voffset_t field); +- +- uoffset_t StartStruct(size_t alignment) { +- Align(alignment); +- return GetSize(); +- } +- +- uoffset_t EndStruct() { return GetSize(); } +- +- void ClearOffsets() { +- buf_.scratch_pop(num_field_loc * sizeof(FieldLoc)); +- num_field_loc = 0; +- max_voffset_ = 0; +- } +- +- // Aligns such that when "len" bytes are written, an object can be written +- // after it with "alignment" without padding. +- void PreAlign(size_t len, size_t alignment) { +- TrackMinAlign(alignment); +- buf_.fill(PaddingBytes(GetSize() + len, alignment)); +- } +- template void PreAlign(size_t len) { +- AssertScalarT(); +- PreAlign(len, sizeof(T)); +- } +- /// @endcond +- +- /// @brief Store a string in the buffer, which can contain any binary data. +- /// @param[in] str A const char pointer to the data to be stored as a string. +- /// @param[in] len The number of bytes that should be stored from `str`. +- /// @return Returns the offset in the buffer where the string starts. +- Offset CreateString(const char *str, size_t len) { +- NotNested(); +- PreAlign(len + 1); // Always 0-terminated. +- buf_.fill(1); +- PushBytes(reinterpret_cast(str), len); +- PushElement(static_cast(len)); +- return Offset(GetSize()); +- } +- +- /// @brief Store a string in the buffer, which is null-terminated. +- /// @param[in] str A const char pointer to a C-string to add to the buffer. +- /// @return Returns the offset in the buffer where the string starts. +- Offset CreateString(const char *str) { +- return CreateString(str, strlen(str)); +- } +- +- /// @brief Store a string in the buffer, which is null-terminated. +- /// @param[in] str A char pointer to a C-string to add to the buffer. +- /// @return Returns the offset in the buffer where the string starts. +- Offset CreateString(char *str) { +- return CreateString(str, strlen(str)); +- } +- +- /// @brief Store a string in the buffer, which can contain any binary data. +- /// @param[in] str A const reference to a std::string to store in the buffer. +- /// @return Returns the offset in the buffer where the string starts. +- Offset CreateString(const std::string &str) { +- return CreateString(str.c_str(), str.length()); +- } +- +- // clang-format off +- #ifdef FLATBUFFERS_HAS_STRING_VIEW +- /// @brief Store a string in the buffer, which can contain any binary data. +- /// @param[in] str A const string_view to copy in to the buffer. +- /// @return Returns the offset in the buffer where the string starts. +- Offset CreateString(flatbuffers::string_view str) { +- return CreateString(str.data(), str.size()); +- } +- #endif // FLATBUFFERS_HAS_STRING_VIEW +- // clang-format on +- +- /// @brief Store a string in the buffer, which can contain any binary data. +- /// @param[in] str A const pointer to a `String` struct to add to the buffer. +- /// @return Returns the offset in the buffer where the string starts +- Offset CreateString(const String *str) { +- return str ? CreateString(str->c_str(), str->size()) : 0; +- } +- +- /// @brief Store a string in the buffer, which can contain any binary data. +- /// @param[in] str A const reference to a std::string like type with support +- /// of T::c_str() and T::length() to store in the buffer. +- /// @return Returns the offset in the buffer where the string starts. +- template Offset CreateString(const T &str) { +- return CreateString(str.c_str(), str.length()); +- } +- +- /// @brief Store a string in the buffer, which can contain any binary data. +- /// If a string with this exact contents has already been serialized before, +- /// instead simply returns the offset of the existing string. +- /// @param[in] str A const char pointer to the data to be stored as a string. +- /// @param[in] len The number of bytes that should be stored from `str`. +- /// @return Returns the offset in the buffer where the string starts. +- Offset CreateSharedString(const char *str, size_t len) { +- if (!string_pool) +- string_pool = new StringOffsetMap(StringOffsetCompare(buf_)); +- auto size_before_string = buf_.size(); +- // Must first serialize the string, since the set is all offsets into +- // buffer. +- auto off = CreateString(str, len); +- auto it = string_pool->find(off); +- // If it exists we reuse existing serialized data! +- if (it != string_pool->end()) { +- // We can remove the string we serialized. +- buf_.pop(buf_.size() - size_before_string); +- return *it; +- } +- // Record this string for future use. +- string_pool->insert(off); +- return off; +- } +- +-#ifdef FLATBUFFERS_HAS_STRING_VIEW +- /// @brief Store a string in the buffer, which can contain any binary data. +- /// If a string with this exact contents has already been serialized before, +- /// instead simply returns the offset of the existing string. +- /// @param[in] str A const std::string_view to store in the buffer. +- /// @return Returns the offset in the buffer where the string starts +- Offset CreateSharedString(const flatbuffers::string_view str) { +- return CreateSharedString(str.data(), str.size()); +- } +-#else +- /// @brief Store a string in the buffer, which null-terminated. +- /// If a string with this exact contents has already been serialized before, +- /// instead simply returns the offset of the existing string. +- /// @param[in] str A const char pointer to a C-string to add to the buffer. +- /// @return Returns the offset in the buffer where the string starts. +- Offset CreateSharedString(const char *str) { +- return CreateSharedString(str, strlen(str)); +- } +- +- /// @brief Store a string in the buffer, which can contain any binary data. +- /// If a string with this exact contents has already been serialized before, +- /// instead simply returns the offset of the existing string. +- /// @param[in] str A const reference to a std::string to store in the buffer. +- /// @return Returns the offset in the buffer where the string starts. +- Offset CreateSharedString(const std::string &str) { +- return CreateSharedString(str.c_str(), str.length()); +- } +-#endif +- +- /// @brief Store a string in the buffer, which can contain any binary data. +- /// If a string with this exact contents has already been serialized before, +- /// instead simply returns the offset of the existing string. +- /// @param[in] str A const pointer to a `String` struct to add to the buffer. +- /// @return Returns the offset in the buffer where the string starts +- Offset CreateSharedString(const String *str) { +- return CreateSharedString(str->c_str(), str->size()); +- } +- +- /// @cond FLATBUFFERS_INTERNAL +- uoffset_t EndVector(size_t len) { +- FLATBUFFERS_ASSERT(nested); // Hit if no corresponding StartVector. +- nested = false; +- return PushElement(static_cast(len)); +- } +- +- void StartVector(size_t len, size_t elemsize) { +- NotNested(); +- nested = true; +- PreAlign(len * elemsize); +- PreAlign(len * elemsize, elemsize); // Just in case elemsize > uoffset_t. +- } +- +- // Call this right before StartVector/CreateVector if you want to force the +- // alignment to be something different than what the element size would +- // normally dictate. +- // This is useful when storing a nested_flatbuffer in a vector of bytes, +- // or when storing SIMD floats, etc. +- void ForceVectorAlignment(size_t len, size_t elemsize, size_t alignment) { +- FLATBUFFERS_ASSERT(VerifyAlignmentRequirements(alignment)); +- PreAlign(len * elemsize, alignment); +- } +- +- // Similar to ForceVectorAlignment but for String fields. +- void ForceStringAlignment(size_t len, size_t alignment) { +- FLATBUFFERS_ASSERT(VerifyAlignmentRequirements(alignment)); +- PreAlign((len + 1) * sizeof(char), alignment); +- } +- +- /// @endcond +- +- /// @brief Serialize an array into a FlatBuffer `vector`. +- /// @tparam T The data type of the array elements. +- /// @param[in] v A pointer to the array of type `T` to serialize into the +- /// buffer as a `vector`. +- /// @param[in] len The number of elements to serialize. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template Offset> CreateVector(const T *v, size_t len) { +- // If this assert hits, you're specifying a template argument that is +- // causing the wrong overload to be selected, remove it. +- AssertScalarT(); +- StartVector(len, sizeof(T)); +- if (len == 0) { return Offset>(EndVector(len)); } +- // clang-format off +- #if FLATBUFFERS_LITTLEENDIAN +- PushBytes(reinterpret_cast(v), len * sizeof(T)); +- #else +- if (sizeof(T) == 1) { +- PushBytes(reinterpret_cast(v), len); +- } else { +- for (auto i = len; i > 0; ) { +- PushElement(v[--i]); +- } +- } +- #endif +- // clang-format on +- return Offset>(EndVector(len)); +- } +- +- template +- Offset>> CreateVector(const Offset *v, size_t len) { +- StartVector(len, sizeof(Offset)); +- for (auto i = len; i > 0;) { PushElement(v[--i]); } +- return Offset>>(EndVector(len)); +- } +- +- /// @brief Serialize a `std::vector` into a FlatBuffer `vector`. +- /// @tparam T The data type of the `std::vector` elements. +- /// @param v A const reference to the `std::vector` to serialize into the +- /// buffer as a `vector`. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template Offset> CreateVector(const std::vector &v) { +- return CreateVector(data(v), v.size()); +- } +- +- // vector may be implemented using a bit-set, so we can't access it as +- // an array. Instead, read elements manually. +- // Background: https://isocpp.org/blog/2012/11/on-vectorbool +- Offset> CreateVector(const std::vector &v) { +- StartVector(v.size(), sizeof(uint8_t)); +- for (auto i = v.size(); i > 0;) { +- PushElement(static_cast(v[--i])); +- } +- return Offset>(EndVector(v.size())); +- } +- +- // clang-format off +- #ifndef FLATBUFFERS_CPP98_STL +- /// @brief Serialize values returned by a function into a FlatBuffer `vector`. +- /// This is a convenience function that takes care of iteration for you. +- /// @tparam T The data type of the `std::vector` elements. +- /// @param f A function that takes the current iteration 0..vector_size-1 and +- /// returns any type that you can construct a FlatBuffers vector out of. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template Offset> CreateVector(size_t vector_size, +- const std::function &f) { +- std::vector elems(vector_size); +- for (size_t i = 0; i < vector_size; i++) elems[i] = f(i); +- return CreateVector(elems); +- } +- #endif +- // clang-format on +- +- /// @brief Serialize values returned by a function into a FlatBuffer `vector`. +- /// This is a convenience function that takes care of iteration for you. +- /// @tparam T The data type of the `std::vector` elements. +- /// @param f A function that takes the current iteration 0..vector_size-1, +- /// and the state parameter returning any type that you can construct a +- /// FlatBuffers vector out of. +- /// @param state State passed to f. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset> CreateVector(size_t vector_size, F f, S *state) { +- std::vector elems(vector_size); +- for (size_t i = 0; i < vector_size; i++) elems[i] = f(i, state); +- return CreateVector(elems); +- } +- +- /// @brief Serialize a `std::vector` into a FlatBuffer `vector`. +- /// This is a convenience function for a common case. +- /// @param v A const reference to the `std::vector` to serialize into the +- /// buffer as a `vector`. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- Offset>> CreateVectorOfStrings( +- const std::vector &v) { +- std::vector> offsets(v.size()); +- for (size_t i = 0; i < v.size(); i++) offsets[i] = CreateString(v[i]); +- return CreateVector(offsets); +- } +- +- /// @brief Serialize an array of structs into a FlatBuffer `vector`. +- /// @tparam T The data type of the struct array elements. +- /// @param[in] v A pointer to the array of type `T` to serialize into the +- /// buffer as a `vector`. +- /// @param[in] len The number of elements to serialize. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset> CreateVectorOfStructs(const T *v, size_t len) { +- StartVector(len * sizeof(T) / AlignOf(), AlignOf()); +- PushBytes(reinterpret_cast(v), sizeof(T) * len); +- return Offset>(EndVector(len)); +- } +- +- /// @brief Serialize an array of native structs into a FlatBuffer `vector`. +- /// @tparam T The data type of the struct array elements. +- /// @tparam S The data type of the native struct array elements. +- /// @param[in] v A pointer to the array of type `S` to serialize into the +- /// buffer as a `vector`. +- /// @param[in] len The number of elements to serialize. +- /// @param[in] pack_func Pointer to a function to convert the native struct +- /// to the FlatBuffer struct. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset> CreateVectorOfNativeStructs( +- const S *v, size_t len, T((*const pack_func)(const S &))) { +- FLATBUFFERS_ASSERT(pack_func); +- std::vector vv(len); +- std::transform(v, v + len, vv.begin(), pack_func); +- return CreateVectorOfStructs(data(vv), vv.size()); +- } +- +- /// @brief Serialize an array of native structs into a FlatBuffer `vector`. +- /// @tparam T The data type of the struct array elements. +- /// @tparam S The data type of the native struct array elements. +- /// @param[in] v A pointer to the array of type `S` to serialize into the +- /// buffer as a `vector`. +- /// @param[in] len The number of elements to serialize. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset> CreateVectorOfNativeStructs(const S *v, +- size_t len) { +- extern T Pack(const S &); +- return CreateVectorOfNativeStructs(v, len, Pack); +- } +- +- // clang-format off +- #ifndef FLATBUFFERS_CPP98_STL +- /// @brief Serialize an array of structs into a FlatBuffer `vector`. +- /// @tparam T The data type of the struct array elements. +- /// @param[in] filler A function that takes the current iteration 0..vector_size-1 +- /// and a pointer to the struct that must be filled. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- /// This is mostly useful when flatbuffers are generated with mutation +- /// accessors. +- template Offset> CreateVectorOfStructs( +- size_t vector_size, const std::function &filler) { +- T* structs = StartVectorOfStructs(vector_size); +- for (size_t i = 0; i < vector_size; i++) { +- filler(i, structs); +- structs++; +- } +- return EndVectorOfStructs(vector_size); +- } +- #endif +- // clang-format on +- +- /// @brief Serialize an array of structs into a FlatBuffer `vector`. +- /// @tparam T The data type of the struct array elements. +- /// @param[in] f A function that takes the current iteration 0..vector_size-1, +- /// a pointer to the struct that must be filled and the state argument. +- /// @param[in] state Arbitrary state to pass to f. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- /// This is mostly useful when flatbuffers are generated with mutation +- /// accessors. +- template +- Offset> CreateVectorOfStructs(size_t vector_size, F f, +- S *state) { +- T *structs = StartVectorOfStructs(vector_size); +- for (size_t i = 0; i < vector_size; i++) { +- f(i, structs, state); +- structs++; +- } +- return EndVectorOfStructs(vector_size); +- } +- +- /// @brief Serialize a `std::vector` of structs into a FlatBuffer `vector`. +- /// @tparam T The data type of the `std::vector` struct elements. +- /// @param[in] v A const reference to the `std::vector` of structs to +- /// serialize into the buffer as a `vector`. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset> CreateVectorOfStructs( +- const std::vector &v) { +- return CreateVectorOfStructs(data(v), v.size()); +- } +- +- /// @brief Serialize a `std::vector` of native structs into a FlatBuffer +- /// `vector`. +- /// @tparam T The data type of the `std::vector` struct elements. +- /// @tparam S The data type of the `std::vector` native struct elements. +- /// @param[in] v A const reference to the `std::vector` of structs to +- /// serialize into the buffer as a `vector`. +- /// @param[in] pack_func Pointer to a function to convert the native struct +- /// to the FlatBuffer struct. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset> CreateVectorOfNativeStructs( +- const std::vector &v, T((*const pack_func)(const S &))) { +- return CreateVectorOfNativeStructs(data(v), v.size(), pack_func); +- } +- +- /// @brief Serialize a `std::vector` of native structs into a FlatBuffer +- /// `vector`. +- /// @tparam T The data type of the `std::vector` struct elements. +- /// @tparam S The data type of the `std::vector` native struct elements. +- /// @param[in] v A const reference to the `std::vector` of structs to +- /// serialize into the buffer as a `vector`. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset> CreateVectorOfNativeStructs( +- const std::vector &v) { +- return CreateVectorOfNativeStructs(data(v), v.size()); +- } +- +- /// @cond FLATBUFFERS_INTERNAL +- template struct StructKeyComparator { +- bool operator()(const T &a, const T &b) const { +- return a.KeyCompareLessThan(&b); +- } +- +- FLATBUFFERS_DELETE_FUNC( +- StructKeyComparator &operator=(const StructKeyComparator &)); +- }; +- /// @endcond +- +- /// @brief Serialize a `std::vector` of structs into a FlatBuffer `vector` +- /// in sorted order. +- /// @tparam T The data type of the `std::vector` struct elements. +- /// @param[in] v A const reference to the `std::vector` of structs to +- /// serialize into the buffer as a `vector`. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset> CreateVectorOfSortedStructs(std::vector *v) { +- return CreateVectorOfSortedStructs(data(*v), v->size()); +- } +- +- /// @brief Serialize a `std::vector` of native structs into a FlatBuffer +- /// `vector` in sorted order. +- /// @tparam T The data type of the `std::vector` struct elements. +- /// @tparam S The data type of the `std::vector` native struct elements. +- /// @param[in] v A const reference to the `std::vector` of structs to +- /// serialize into the buffer as a `vector`. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset> CreateVectorOfSortedNativeStructs( +- std::vector *v) { +- return CreateVectorOfSortedNativeStructs(data(*v), v->size()); +- } +- +- /// @brief Serialize an array of structs into a FlatBuffer `vector` in sorted +- /// order. +- /// @tparam T The data type of the struct array elements. +- /// @param[in] v A pointer to the array of type `T` to serialize into the +- /// buffer as a `vector`. +- /// @param[in] len The number of elements to serialize. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset> CreateVectorOfSortedStructs(T *v, size_t len) { +- std::sort(v, v + len, StructKeyComparator()); +- return CreateVectorOfStructs(v, len); +- } +- +- /// @brief Serialize an array of native structs into a FlatBuffer `vector` in +- /// sorted order. +- /// @tparam T The data type of the struct array elements. +- /// @tparam S The data type of the native struct array elements. +- /// @param[in] v A pointer to the array of type `S` to serialize into the +- /// buffer as a `vector`. +- /// @param[in] len The number of elements to serialize. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset> CreateVectorOfSortedNativeStructs(S *v, +- size_t len) { +- extern T Pack(const S &); +- typedef T (*Pack_t)(const S &); +- std::vector vv(len); +- std::transform(v, v + len, vv.begin(), static_cast(Pack)); +- return CreateVectorOfSortedStructs(vv, len); +- } +- +- /// @cond FLATBUFFERS_INTERNAL +- template struct TableKeyComparator { +- TableKeyComparator(vector_downward &buf) : buf_(buf) {} +- TableKeyComparator(const TableKeyComparator &other) : buf_(other.buf_) {} +- bool operator()(const Offset &a, const Offset &b) const { +- auto table_a = reinterpret_cast(buf_.data_at(a.o)); +- auto table_b = reinterpret_cast(buf_.data_at(b.o)); +- return table_a->KeyCompareLessThan(table_b); +- } +- vector_downward &buf_; +- +- private: +- FLATBUFFERS_DELETE_FUNC( +- TableKeyComparator &operator=(const TableKeyComparator &other)); +- }; +- /// @endcond +- +- /// @brief Serialize an array of `table` offsets as a `vector` in the buffer +- /// in sorted order. +- /// @tparam T The data type that the offset refers to. +- /// @param[in] v An array of type `Offset` that contains the `table` +- /// offsets to store in the buffer in sorted order. +- /// @param[in] len The number of elements to store in the `vector`. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset>> CreateVectorOfSortedTables(Offset *v, +- size_t len) { +- std::sort(v, v + len, TableKeyComparator(buf_)); +- return CreateVector(v, len); +- } +- +- /// @brief Serialize an array of `table` offsets as a `vector` in the buffer +- /// in sorted order. +- /// @tparam T The data type that the offset refers to. +- /// @param[in] v An array of type `Offset` that contains the `table` +- /// offsets to store in the buffer in sorted order. +- /// @return Returns a typed `Offset` into the serialized data indicating +- /// where the vector is stored. +- template +- Offset>> CreateVectorOfSortedTables( +- std::vector> *v) { +- return CreateVectorOfSortedTables(data(*v), v->size()); +- } +- +- /// @brief Specialized version of `CreateVector` for non-copying use cases. +- /// Write the data any time later to the returned buffer pointer `buf`. +- /// @param[in] len The number of elements to store in the `vector`. +- /// @param[in] elemsize The size of each element in the `vector`. +- /// @param[out] buf A pointer to a `uint8_t` pointer that can be +- /// written to at a later time to serialize the data into a `vector` +- /// in the buffer. +- uoffset_t CreateUninitializedVector(size_t len, size_t elemsize, +- uint8_t **buf) { +- NotNested(); +- StartVector(len, elemsize); +- buf_.make_space(len * elemsize); +- auto vec_start = GetSize(); +- auto vec_end = EndVector(len); +- *buf = buf_.data_at(vec_start); +- return vec_end; +- } +- +- /// @brief Specialized version of `CreateVector` for non-copying use cases. +- /// Write the data any time later to the returned buffer pointer `buf`. +- /// @tparam T The data type of the data that will be stored in the buffer +- /// as a `vector`. +- /// @param[in] len The number of elements to store in the `vector`. +- /// @param[out] buf A pointer to a pointer of type `T` that can be +- /// written to at a later time to serialize the data into a `vector` +- /// in the buffer. +- template +- Offset> CreateUninitializedVector(size_t len, T **buf) { +- AssertScalarT(); +- return CreateUninitializedVector(len, sizeof(T), +- reinterpret_cast(buf)); +- } +- +- template +- Offset> CreateUninitializedVectorOfStructs(size_t len, +- T **buf) { +- return CreateUninitializedVector(len, sizeof(T), +- reinterpret_cast(buf)); +- } +- +- // @brief Create a vector of scalar type T given as input a vector of scalar +- // type U, useful with e.g. pre "enum class" enums, or any existing scalar +- // data of the wrong type. +- template +- Offset> CreateVectorScalarCast(const U *v, size_t len) { +- AssertScalarT(); +- AssertScalarT(); +- StartVector(len, sizeof(T)); +- for (auto i = len; i > 0;) { PushElement(static_cast(v[--i])); } +- return Offset>(EndVector(len)); +- } +- +- /// @brief Write a struct by itself, typically to be part of a union. +- template Offset CreateStruct(const T &structobj) { +- NotNested(); +- Align(AlignOf()); +- buf_.push_small(structobj); +- return Offset(GetSize()); +- } +- +- /// @brief The length of a FlatBuffer file header. +- static const size_t kFileIdentifierLength = 4; +- +- /// @brief Finish serializing a buffer by writing the root offset. +- /// @param[in] file_identifier If a `file_identifier` is given, the buffer +- /// will be prefixed with a standard FlatBuffers file header. +- template +- void Finish(Offset root, const char *file_identifier = nullptr) { +- Finish(root.o, file_identifier, false); +- } +- +- /// @brief Finish a buffer with a 32 bit size field pre-fixed (size of the +- /// buffer following the size field). These buffers are NOT compatible +- /// with standard buffers created by Finish, i.e. you can't call GetRoot +- /// on them, you have to use GetSizePrefixedRoot instead. +- /// All >32 bit quantities in this buffer will be aligned when the whole +- /// size pre-fixed buffer is aligned. +- /// These kinds of buffers are useful for creating a stream of FlatBuffers. +- template +- void FinishSizePrefixed(Offset root, +- const char *file_identifier = nullptr) { +- Finish(root.o, file_identifier, true); +- } +- +- void SwapBufAllocator(FlatBufferBuilder &other) { +- buf_.swap_allocator(other.buf_); +- } +- +- protected: +- // You shouldn't really be copying instances of this class. +- FlatBufferBuilder(const FlatBufferBuilder &); +- FlatBufferBuilder &operator=(const FlatBufferBuilder &); +- +- void Finish(uoffset_t root, const char *file_identifier, bool size_prefix) { +- NotNested(); +- buf_.clear_scratch(); +- // This will cause the whole buffer to be aligned. +- PreAlign((size_prefix ? sizeof(uoffset_t) : 0) + sizeof(uoffset_t) + +- (file_identifier ? kFileIdentifierLength : 0), +- minalign_); +- if (file_identifier) { +- FLATBUFFERS_ASSERT(strlen(file_identifier) == kFileIdentifierLength); +- PushBytes(reinterpret_cast(file_identifier), +- kFileIdentifierLength); +- } +- PushElement(ReferTo(root)); // Location of root. +- if (size_prefix) { PushElement(GetSize()); } +- finished = true; +- } +- +- struct FieldLoc { +- uoffset_t off; +- voffset_t id; +- }; +- +- vector_downward buf_; +- +- // Accumulating offsets of table members while it is being built. +- // We store these in the scratch pad of buf_, after the vtable offsets. +- uoffset_t num_field_loc; +- // Track how much of the vtable is in use, so we can output the most compact +- // possible vtable. +- voffset_t max_voffset_; +- +- // Ensure objects are not nested. +- bool nested; +- +- // Ensure the buffer is finished before it is being accessed. +- bool finished; +- +- size_t minalign_; +- +- bool force_defaults_; // Serialize values equal to their defaults anyway. +- +- bool dedup_vtables_; +- +- struct StringOffsetCompare { +- StringOffsetCompare(const vector_downward &buf) : buf_(&buf) {} +- bool operator()(const Offset &a, const Offset &b) const { +- auto stra = reinterpret_cast(buf_->data_at(a.o)); +- auto strb = reinterpret_cast(buf_->data_at(b.o)); +- return StringLessThan(stra->data(), stra->size(), strb->data(), +- strb->size()); +- } +- const vector_downward *buf_; +- }; +- +- // For use with CreateSharedString. Instantiated on first use only. +- typedef std::set, StringOffsetCompare> StringOffsetMap; +- StringOffsetMap *string_pool; +- +- private: +- // Allocates space for a vector of structures. +- // Must be completed with EndVectorOfStructs(). +- template T *StartVectorOfStructs(size_t vector_size) { +- StartVector(vector_size * sizeof(T) / AlignOf(), AlignOf()); +- return reinterpret_cast(buf_.make_space(vector_size * sizeof(T))); +- } +- +- // End the vector of structues in the flatbuffers. +- // Vector should have previously be started with StartVectorOfStructs(). +- template +- Offset> EndVectorOfStructs(size_t vector_size) { +- return Offset>(EndVector(vector_size)); +- } +-}; +-/// @} +- +-/// @cond FLATBUFFERS_INTERNAL +-// Helpers to get a typed pointer to the root object contained in the buffer. +-template T *GetMutableRoot(void *buf) { +- EndianCheck(); +- return reinterpret_cast( +- reinterpret_cast(buf) + +- EndianScalar(*reinterpret_cast(buf))); +-} +- +-template const T *GetRoot(const void *buf) { +- return GetMutableRoot(const_cast(buf)); +-} +- +-template const T *GetSizePrefixedRoot(const void *buf) { +- return GetRoot(reinterpret_cast(buf) + sizeof(uoffset_t)); +-} +- +-/// Helpers to get a typed pointer to objects that are currently being built. +-/// @warning Creating new objects will lead to reallocations and invalidates +-/// the pointer! +-template +-T *GetMutableTemporaryPointer(FlatBufferBuilder &fbb, Offset offset) { +- return reinterpret_cast(fbb.GetCurrentBufferPointer() + fbb.GetSize() - +- offset.o); +-} +- +-template +-const T *GetTemporaryPointer(FlatBufferBuilder &fbb, Offset offset) { +- return GetMutableTemporaryPointer(fbb, offset); +-} +- +-/// @brief Get a pointer to the the file_identifier section of the buffer. +-/// @return Returns a const char pointer to the start of the file_identifier +-/// characters in the buffer. The returned char * has length +-/// 'flatbuffers::FlatBufferBuilder::kFileIdentifierLength'. +-/// This function is UNDEFINED for FlatBuffers whose schema does not include +-/// a file_identifier (likely points at padding or the start of a the root +-/// vtable). +-inline const char *GetBufferIdentifier(const void *buf, +- bool size_prefixed = false) { +- return reinterpret_cast(buf) + +- ((size_prefixed) ? 2 * sizeof(uoffset_t) : sizeof(uoffset_t)); +-} +- +-// Helper to see if the identifier in a buffer has the expected value. +-inline bool BufferHasIdentifier(const void *buf, const char *identifier, +- bool size_prefixed = false) { +- return strncmp(GetBufferIdentifier(buf, size_prefixed), identifier, +- FlatBufferBuilder::kFileIdentifierLength) == 0; +-} +- +-// Helper class to verify the integrity of a FlatBuffer +-class Verifier FLATBUFFERS_FINAL_CLASS { +- public: +- Verifier(const uint8_t *buf, size_t buf_len, uoffset_t _max_depth = 64, +- uoffset_t _max_tables = 1000000, bool _check_alignment = true) +- : buf_(buf), +- size_(buf_len), +- depth_(0), +- max_depth_(_max_depth), +- num_tables_(0), +- max_tables_(_max_tables), +- upper_bound_(0), +- check_alignment_(_check_alignment) { +- FLATBUFFERS_ASSERT(size_ < FLATBUFFERS_MAX_BUFFER_SIZE); +- } +- +- // Central location where any verification failures register. +- bool Check(bool ok) const { +- // clang-format off +- #ifdef FLATBUFFERS_DEBUG_VERIFICATION_FAILURE +- FLATBUFFERS_ASSERT(ok); +- #endif +- #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE +- if (!ok) +- upper_bound_ = 0; +- #endif +- // clang-format on +- return ok; +- } +- +- // Verify any range within the buffer. +- bool Verify(size_t elem, size_t elem_len) const { +- // clang-format off +- #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE +- auto upper_bound = elem + elem_len; +- if (upper_bound_ < upper_bound) +- upper_bound_ = upper_bound; +- #endif +- // clang-format on +- return Check(elem_len < size_ && elem <= size_ - elem_len); +- } +- +- template bool VerifyAlignment(size_t elem) const { +- return Check((elem & (sizeof(T) - 1)) == 0 || !check_alignment_); +- } +- +- // Verify a range indicated by sizeof(T). +- template bool Verify(size_t elem) const { +- return VerifyAlignment(elem) && Verify(elem, sizeof(T)); +- } +- +- bool VerifyFromPointer(const uint8_t *p, size_t len) { +- auto o = static_cast(p - buf_); +- return Verify(o, len); +- } +- +- // Verify relative to a known-good base pointer. +- bool Verify(const uint8_t *base, voffset_t elem_off, size_t elem_len) const { +- return Verify(static_cast(base - buf_) + elem_off, elem_len); +- } +- +- template +- bool Verify(const uint8_t *base, voffset_t elem_off) const { +- return Verify(static_cast(base - buf_) + elem_off, sizeof(T)); +- } +- +- // Verify a pointer (may be NULL) of a table type. +- template bool VerifyTable(const T *table) { +- return !table || table->Verify(*this); +- } +- +- // Verify a pointer (may be NULL) of any vector type. +- template bool VerifyVector(const Vector *vec) const { +- return !vec || VerifyVectorOrString(reinterpret_cast(vec), +- sizeof(T)); +- } +- +- // Verify a pointer (may be NULL) of a vector to struct. +- template bool VerifyVector(const Vector *vec) const { +- return VerifyVector(reinterpret_cast *>(vec)); +- } +- +- // Verify a pointer (may be NULL) to string. +- bool VerifyString(const String *str) const { +- size_t end; +- return !str || (VerifyVectorOrString(reinterpret_cast(str), +- 1, &end) && +- Verify(end, 1) && // Must have terminator +- Check(buf_[end] == '\0')); // Terminating byte must be 0. +- } +- +- // Common code between vectors and strings. +- bool VerifyVectorOrString(const uint8_t *vec, size_t elem_size, +- size_t *end = nullptr) const { +- auto veco = static_cast(vec - buf_); +- // Check we can read the size field. +- if (!Verify(veco)) return false; +- // Check the whole array. If this is a string, the byte past the array +- // must be 0. +- auto size = ReadScalar(vec); +- auto max_elems = FLATBUFFERS_MAX_BUFFER_SIZE / elem_size; +- if (!Check(size < max_elems)) +- return false; // Protect against byte_size overflowing. +- auto byte_size = sizeof(size) + elem_size * size; +- if (end) *end = veco + byte_size; +- return Verify(veco, byte_size); +- } +- +- // Special case for string contents, after the above has been called. +- bool VerifyVectorOfStrings(const Vector> *vec) const { +- if (vec) { +- for (uoffset_t i = 0; i < vec->size(); i++) { +- if (!VerifyString(vec->Get(i))) return false; +- } +- } +- return true; +- } +- +- // Special case for table contents, after the above has been called. +- template bool VerifyVectorOfTables(const Vector> *vec) { +- if (vec) { +- for (uoffset_t i = 0; i < vec->size(); i++) { +- if (!vec->Get(i)->Verify(*this)) return false; +- } +- } +- return true; +- } +- +- __supress_ubsan__("unsigned-integer-overflow") bool VerifyTableStart( +- const uint8_t *table) { +- // Check the vtable offset. +- auto tableo = static_cast(table - buf_); +- if (!Verify(tableo)) return false; +- // This offset may be signed, but doing the subtraction unsigned always +- // gives the result we want. +- auto vtableo = tableo - static_cast(ReadScalar(table)); +- // Check the vtable size field, then check vtable fits in its entirety. +- return VerifyComplexity() && Verify(vtableo) && +- VerifyAlignment(ReadScalar(buf_ + vtableo)) && +- Verify(vtableo, ReadScalar(buf_ + vtableo)); +- } +- +- template +- bool VerifyBufferFromStart(const char *identifier, size_t start) { +- if (identifier && !Check((size_ >= 2 * sizeof(flatbuffers::uoffset_t) && +- BufferHasIdentifier(buf_ + start, identifier)))) { +- return false; +- } +- +- // Call T::Verify, which must be in the generated code for this type. +- auto o = VerifyOffset(start); +- return o && reinterpret_cast(buf_ + start + o)->Verify(*this) +- // clang-format off +- #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE +- && GetComputedSize() +- #endif +- ; +- // clang-format on +- } +- +- // Verify this whole buffer, starting with root type T. +- template bool VerifyBuffer() { return VerifyBuffer(nullptr); } +- +- template bool VerifyBuffer(const char *identifier) { +- return VerifyBufferFromStart(identifier, 0); +- } +- +- template bool VerifySizePrefixedBuffer(const char *identifier) { +- return Verify(0U) && +- ReadScalar(buf_) == size_ - sizeof(uoffset_t) && +- VerifyBufferFromStart(identifier, sizeof(uoffset_t)); +- } +- +- uoffset_t VerifyOffset(size_t start) const { +- if (!Verify(start)) return 0; +- auto o = ReadScalar(buf_ + start); +- // May not point to itself. +- if (!Check(o != 0)) return 0; +- // Can't wrap around / buffers are max 2GB. +- if (!Check(static_cast(o) >= 0)) return 0; +- // Must be inside the buffer to create a pointer from it (pointer outside +- // buffer is UB). +- if (!Verify(start + o, 1)) return 0; +- return o; +- } +- +- uoffset_t VerifyOffset(const uint8_t *base, voffset_t start) const { +- return VerifyOffset(static_cast(base - buf_) + start); +- } +- +- // Called at the start of a table to increase counters measuring data +- // structure depth and amount, and possibly bails out with false if +- // limits set by the constructor have been hit. Needs to be balanced +- // with EndTable(). +- bool VerifyComplexity() { +- depth_++; +- num_tables_++; +- return Check(depth_ <= max_depth_ && num_tables_ <= max_tables_); +- } +- +- // Called at the end of a table to pop the depth count. +- bool EndTable() { +- depth_--; +- return true; +- } +- +- // Returns the message size in bytes +- size_t GetComputedSize() const { +- // clang-format off +- #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE +- uintptr_t size = upper_bound_; +- // Align the size to uoffset_t +- size = (size - 1 + sizeof(uoffset_t)) & ~(sizeof(uoffset_t) - 1); +- return (size > size_) ? 0 : size; +- #else +- // Must turn on FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE for this to work. +- (void)upper_bound_; +- FLATBUFFERS_ASSERT(false); +- return 0; +- #endif +- // clang-format on +- } +- +- private: +- const uint8_t *buf_; +- size_t size_; +- uoffset_t depth_; +- uoffset_t max_depth_; +- uoffset_t num_tables_; +- uoffset_t max_tables_; +- mutable size_t upper_bound_; +- bool check_alignment_; +-}; +- +-// Convenient way to bundle a buffer and its length, to pass it around +-// typed by its root. +-// A BufferRef does not own its buffer. +-struct BufferRefBase {}; // for std::is_base_of +-template struct BufferRef : BufferRefBase { +- BufferRef() : buf(nullptr), len(0), must_free(false) {} +- BufferRef(uint8_t *_buf, uoffset_t _len) +- : buf(_buf), len(_len), must_free(false) {} +- +- ~BufferRef() { +- if (must_free) free(buf); +- } +- +- const T *GetRoot() const { return flatbuffers::GetRoot(buf); } +- +- bool Verify() { +- Verifier verifier(buf, len); +- return verifier.VerifyBuffer(nullptr); +- } +- +- uint8_t *buf; +- uoffset_t len; +- bool must_free; +-}; +- +-// "structs" are flat structures that do not have an offset table, thus +-// always have all members present and do not support forwards/backwards +-// compatible extensions. +- +-class Struct FLATBUFFERS_FINAL_CLASS { +- public: +- template T GetField(uoffset_t o) const { +- return ReadScalar(&data_[o]); +- } +- +- template T GetStruct(uoffset_t o) const { +- return reinterpret_cast(&data_[o]); +- } +- +- const uint8_t *GetAddressOf(uoffset_t o) const { return &data_[o]; } +- uint8_t *GetAddressOf(uoffset_t o) { return &data_[o]; } +- +- private: +- // private constructor & copy constructor: you obtain instances of this +- // class by pointing to existing data only +- Struct(); +- Struct(const Struct &); +- Struct &operator=(const Struct &); +- +- uint8_t data_[1]; +-}; +- +-// "tables" use an offset table (possibly shared) that allows fields to be +-// omitted and added at will, but uses an extra indirection to read. +-class Table { +- public: +- const uint8_t *GetVTable() const { +- return data_ - ReadScalar(data_); +- } +- +- // This gets the field offset for any of the functions below it, or 0 +- // if the field was not present. +- voffset_t GetOptionalFieldOffset(voffset_t field) const { +- // The vtable offset is always at the start. +- auto vtable = GetVTable(); +- // The first element is the size of the vtable (fields + type id + itself). +- auto vtsize = ReadScalar(vtable); +- // If the field we're accessing is outside the vtable, we're reading older +- // data, so it's the same as if the offset was 0 (not present). +- return field < vtsize ? ReadScalar(vtable + field) : 0; +- } +- +- template T GetField(voffset_t field, T defaultval) const { +- auto field_offset = GetOptionalFieldOffset(field); +- return field_offset ? ReadScalar(data_ + field_offset) : defaultval; +- } +- +- template P GetPointer(voffset_t field) { +- auto field_offset = GetOptionalFieldOffset(field); +- auto p = data_ + field_offset; +- return field_offset ? reinterpret_cast

(p + ReadScalar(p)) +- : nullptr; +- } +- template P GetPointer(voffset_t field) const { +- return const_cast(this)->GetPointer

(field); +- } +- +- template P GetStruct(voffset_t field) const { +- auto field_offset = GetOptionalFieldOffset(field); +- auto p = const_cast(data_ + field_offset); +- return field_offset ? reinterpret_cast

(p) : nullptr; +- } +- +- template +- flatbuffers::Optional GetOptional(voffset_t field) const { +- auto field_offset = GetOptionalFieldOffset(field); +- auto p = data_ + field_offset; +- return field_offset ? Optional(static_cast(ReadScalar(p))) +- : Optional(); +- } +- +- template bool SetField(voffset_t field, T val, T def) { +- auto field_offset = GetOptionalFieldOffset(field); +- if (!field_offset) return IsTheSameAs(val, def); +- WriteScalar(data_ + field_offset, val); +- return true; +- } +- template bool SetField(voffset_t field, T val) { +- auto field_offset = GetOptionalFieldOffset(field); +- if (!field_offset) return false; +- WriteScalar(data_ + field_offset, val); +- return true; +- } +- +- bool SetPointer(voffset_t field, const uint8_t *val) { +- auto field_offset = GetOptionalFieldOffset(field); +- if (!field_offset) return false; +- WriteScalar(data_ + field_offset, +- static_cast(val - (data_ + field_offset))); +- return true; +- } +- +- uint8_t *GetAddressOf(voffset_t field) { +- auto field_offset = GetOptionalFieldOffset(field); +- return field_offset ? data_ + field_offset : nullptr; +- } +- const uint8_t *GetAddressOf(voffset_t field) const { +- return const_cast

(this)->GetAddressOf(field); +- } +- +- bool CheckField(voffset_t field) const { +- return GetOptionalFieldOffset(field) != 0; +- } +- +- // Verify the vtable of this table. +- // Call this once per table, followed by VerifyField once per field. +- bool VerifyTableStart(Verifier &verifier) const { +- return verifier.VerifyTableStart(data_); +- } +- +- // Verify a particular field. +- template +- bool VerifyField(const Verifier &verifier, voffset_t field) const { +- // Calling GetOptionalFieldOffset should be safe now thanks to +- // VerifyTable(). +- auto field_offset = GetOptionalFieldOffset(field); +- // Check the actual field. +- return !field_offset || verifier.Verify(data_, field_offset); +- } +- +- // VerifyField for required fields. +- template +- bool VerifyFieldRequired(const Verifier &verifier, voffset_t field) const { +- auto field_offset = GetOptionalFieldOffset(field); +- return verifier.Check(field_offset != 0) && +- verifier.Verify(data_, field_offset); +- } +- +- // Versions for offsets. +- bool VerifyOffset(const Verifier &verifier, voffset_t field) const { +- auto field_offset = GetOptionalFieldOffset(field); +- return !field_offset || verifier.VerifyOffset(data_, field_offset); +- } +- +- bool VerifyOffsetRequired(const Verifier &verifier, voffset_t field) const { +- auto field_offset = GetOptionalFieldOffset(field); +- return verifier.Check(field_offset != 0) && +- verifier.VerifyOffset(data_, field_offset); +- } +- +- private: +- // private constructor & copy constructor: you obtain instances of this +- // class by pointing to existing data only +- Table(); +- Table(const Table &other); +- Table &operator=(const Table &); +- +- uint8_t data_[1]; +-}; +- +-// This specialization allows avoiding warnings like: +-// MSVC C4800: type: forcing value to bool 'true' or 'false'. +-template<> +-inline flatbuffers::Optional Table::GetOptional( +- voffset_t field) const { +- auto field_offset = GetOptionalFieldOffset(field); +- auto p = data_ + field_offset; +- return field_offset ? Optional(ReadScalar(p) != 0) +- : Optional(); +-} +- +-template +-void FlatBufferBuilder::Required(Offset table, voffset_t field) { +- auto table_ptr = reinterpret_cast(buf_.data_at(table.o)); +- bool ok = table_ptr->GetOptionalFieldOffset(field) != 0; +- // If this fails, the caller will show what field needs to be set. +- FLATBUFFERS_ASSERT(ok); +- (void)ok; +-} + + /// @brief This can compute the start of a FlatBuffer from a root pointer, i.e. + /// it is the opposite transformation of GetRoot(). +@@ -2719,7 +56,7 @@ + // file_identifier, and alignment padding) to see which points to the root. + // None of the other values can "impersonate" the root since they will either + // be 0 or four ASCII characters. +- static_assert(FlatBufferBuilder::kFileIdentifierLength == sizeof(uoffset_t), ++ static_assert(flatbuffers::kFileIdentifierLength == sizeof(uoffset_t), + "file_identifier is assumed to be the same size as uoffset_t"); + for (auto possible_roots = FLATBUFFERS_MAX_ALIGNMENT / sizeof(uoffset_t) + 1; + possible_roots; possible_roots--) { +@@ -2755,16 +92,9 @@ + /// if you wish. The resolver does the opposite lookup, for when the object + /// is being serialized again. + typedef uint64_t hash_value_t; +-// clang-format off +-#ifdef FLATBUFFERS_CPP98_STL +- typedef void (*resolver_function_t)(void **pointer_adr, hash_value_t hash); +- typedef hash_value_t (*rehasher_function_t)(void *pointer); +-#else +- typedef std::function +- resolver_function_t; +- typedef std::function rehasher_function_t; +-#endif +-// clang-format on ++typedef std::function ++ resolver_function_t; ++typedef std::function rehasher_function_t; + + // Helper function to test if a field is present, using any of the field + // enums in the generated code. +@@ -2821,7 +151,7 @@ + + // Minimal reflection via code generation. + // Besides full-fat reflection (see reflection.h) and parsing/printing by +-// loading schemas (see idl.h), we can also have code generation for mimimal ++// loading schemas (see idl.h), we can also have code generation for minimal + // reflection data which allows pretty-printing and other uses without needing + // a schema or a parser. + // Generate code with --reflect-types (types only) or --reflect-names (names +@@ -2896,27 +226,13 @@ + }; + + // String which identifies the current version of FlatBuffers. +-// flatbuffer_version_string is used by Google developers to identify which +-// applications uploaded to Google Play are using this library. This allows +-// the development team at Google to determine the popularity of the library. +-// How it works: Applications that are uploaded to the Google Play Store are +-// scanned for this version string. We track which applications are using it +-// to measure popularity. You are free to remove it (of course) but we would +-// appreciate if you left it in. ++inline const char *flatbuffers_version_string() { ++ return "FlatBuffers " FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MAJOR) "." ++ FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MINOR) "." ++ FLATBUFFERS_STRING(FLATBUFFERS_VERSION_REVISION); ++} + +-// Weak linkage is culled by VS & doesn't work on cygwin. + // clang-format off +-#if !defined(_WIN32) && !defined(__CYGWIN__) +- +-extern volatile __attribute__((weak)) const char *flatbuffer_version_string; +-volatile __attribute__((weak)) const char *flatbuffer_version_string = +- "FlatBuffers " +- FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MAJOR) "." +- FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MINOR) "." +- FLATBUFFERS_STRING(FLATBUFFERS_VERSION_REVISION); +- +-#endif // !defined(_WIN32) && !defined(__CYGWIN__) +- + #define FLATBUFFERS_DEFINE_BITMASK_OPERATORS(E, T)\ + inline E operator | (E lhs, E rhs){\ + return E(T(lhs) | T(rhs));\ +diff -urN a/include/flatbuffers/flatc.h b/include/flatbuffers/flatc.h +--- a/include/flatbuffers/flatc.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/include/flatbuffers/flatc.h 2023-01-13 07:47:06.300228238 +0000 +@@ -21,6 +21,7 @@ + #include + #include + ++#include "flatbuffers/bfbs_generator.h" + #include "flatbuffers/flatbuffers.h" + #include "flatbuffers/idl.h" + #include "flatbuffers/util.h" +@@ -30,6 +31,13 @@ + extern void LogCompilerWarn(const std::string &warn); + extern void LogCompilerError(const std::string &err); + ++struct FlatCOption { ++ std::string short_opt; ++ std::string long_opt; ++ std::string parameter; ++ std::string description; ++}; ++ + class FlatCompiler { + public: + // Output generator for the various programming languages and formats we +@@ -41,16 +49,18 @@ + typedef std::string (*MakeRuleFn)(const flatbuffers::Parser &parser, + const std::string &path, + const std::string &file_name); ++ typedef bool (*ParsingCompletedFn)(const flatbuffers::Parser &parser, ++ const std::string &output_path); + + GenerateFn generate; +- const char *generator_opt_short; +- const char *generator_opt_long; + const char *lang_name; + bool schema_only; + GenerateFn generateGRPC; + flatbuffers::IDLOptions::Language lang; +- const char *generator_help; ++ FlatCOption option; + MakeRuleFn make_rule; ++ BfbsGenerator *bfbs_generator; ++ ParsingCompletedFn parsing_completed; + }; + + typedef void (*WarnFn)(const FlatCompiler *flatc, const std::string &warn, +@@ -77,6 +87,7 @@ + + int Compile(int argc, const char **argv); + ++ std::string GetShortUsageString(const char *program_name) const; + std::string GetUsageString(const char *program_name) const; + + private: +diff -urN a/include/flatbuffers/flexbuffers.h b/include/flatbuffers/flexbuffers.h +--- a/include/flatbuffers/flexbuffers.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/include/flatbuffers/flexbuffers.h 2023-01-13 07:47:06.300228238 +0000 +@@ -53,7 +53,7 @@ + FBT_INT = 1, + FBT_UINT = 2, + FBT_FLOAT = 3, +- // Types above stored inline, types below store an offset. ++ // Types above stored inline, types below (except FBT_BOOL) store an offset. + FBT_KEY = 4, + FBT_STRING = 5, + FBT_INDIRECT_INT = 6, +@@ -81,6 +81,8 @@ + FBT_BOOL = 26, + FBT_VECTOR_BOOL = + 36, // To Allow the same type of conversion of type to vector type ++ ++ FBT_MAX_TYPE = 37 + }; + + inline bool IsInline(Type t) { return t <= FBT_FLOAT || t == FBT_BOOL; } +@@ -155,7 +157,8 @@ + // constant, which here it isn't. Test if memcpy is still faster than + // the conditionals in ReadSizedScalar. Can also use inline asm. + // clang-format off +- #if defined(_MSC_VER) && ((defined(_M_X64) && !defined(_M_ARM64EC)) || defined _M_IX86) ++ #if defined(_MSC_VER) && defined(_M_X64) && !defined(_M_ARM64EC) ++ // This is 64-bit Windows only, __movsb does not work on 32-bit Windows. + uint64_t u = 0; + __movsb(reinterpret_cast(&u), + reinterpret_cast(data), byte_width); +@@ -319,8 +322,8 @@ + return data_ == FixedTypedVector::EmptyFixedTypedVector().data_; + } + +- Type ElementType() { return type_; } +- uint8_t size() { return len_; } ++ Type ElementType() const { return type_; } ++ uint8_t size() const { return len_; } + + private: + Type type_; +@@ -368,10 +371,7 @@ + class Reference { + public: + Reference() +- : data_(nullptr), +- parent_width_(0), +- byte_width_(BIT_WIDTH_8), +- type_(FBT_NULL) {} ++ : data_(nullptr), parent_width_(0), byte_width_(0), type_(FBT_NULL) {} + + Reference(const uint8_t *data, uint8_t parent_width, uint8_t byte_width, + Type type) +@@ -572,7 +572,23 @@ + auto keys = m.Keys(); + auto vals = m.Values(); + for (size_t i = 0; i < keys.size(); i++) { +- keys[i].ToString(true, keys_quoted, s); ++ bool kq = keys_quoted; ++ if (!kq) { ++ // FlexBuffers keys may contain arbitrary characters, only allow ++ // unquoted if it looks like an "identifier": ++ const char *p = keys[i].AsKey(); ++ if (!flatbuffers::is_alpha(*p) && *p != '_') { ++ kq = true; ++ } else { ++ while (*++p) { ++ if (!flatbuffers::is_alnum(*p) && *p != '_') { ++ kq = true; ++ break; ++ } ++ } ++ } ++ } ++ keys[i].ToString(true, kq, s); + s += ": "; + vals[i].ToString(true, keys_quoted, s); + if (i < keys.size() - 1) s += ", "; +@@ -756,6 +772,8 @@ + return false; + } + ++ friend class Verifier; ++ + const uint8_t *data_; + uint8_t parent_width_; + uint8_t byte_width_; +@@ -850,6 +868,7 @@ + case 2: comp = KeyCompare; break; + case 4: comp = KeyCompare; break; + case 8: comp = KeyCompare; break; ++ default: FLATBUFFERS_ASSERT(false); return Reference(); + } + auto res = std::bsearch(key, keys.data_, keys.size(), keys.byte_width_, comp); + if (!res) return Reference(nullptr, 1, NullPackedType()); +@@ -872,7 +891,7 @@ + } + + inline Reference GetRoot(const std::vector &buffer) { +- return GetRoot(flatbuffers::vector_data(buffer), buffer.size()); ++ return GetRoot(buffer.data(), buffer.size()); + } + + // Flags that configure how the Builder behaves. +@@ -1068,7 +1087,16 @@ + return CreateBlob(data, len, 0, FBT_BLOB); + } + size_t Blob(const std::vector &v) { +- return CreateBlob(flatbuffers::vector_data(v), v.size(), 0, FBT_BLOB); ++ return CreateBlob(v.data(), v.size(), 0, FBT_BLOB); ++ } ++ ++ void Blob(const char *key, const void *data, size_t len) { ++ Key(key); ++ Blob(data, len); ++ } ++ void Blob(const char *key, const std::vector &v) { ++ Key(key); ++ Blob(v); + } + + // TODO(wvo): support all the FlexBuffer types (like flexbuffers::String), +@@ -1086,7 +1114,7 @@ + return stack_.size(); + } + +- // TODO(wvo): allow this to specify an aligment greater than the natural ++ // TODO(wvo): allow this to specify an alignment greater than the natural + // alignment. + size_t EndVector(size_t start, bool typed, bool fixed) { + auto vec = CreateVector(start, stack_.size() - start, 1, typed, fixed); +@@ -1121,27 +1149,24 @@ + // step automatically when appliccable, and encourage people to write in + // sorted fashion. + // std::sort is typically already a lot faster on sorted data though. +- auto dict = +- reinterpret_cast(flatbuffers::vector_data(stack_) + start); +- std::sort(dict, dict + len, +- [&](const TwoValue &a, const TwoValue &b) -> bool { +- auto as = reinterpret_cast( +- flatbuffers::vector_data(buf_) + a.key.u_); +- auto bs = reinterpret_cast( +- flatbuffers::vector_data(buf_) + b.key.u_); +- auto comp = strcmp(as, bs); +- // We want to disallow duplicate keys, since this results in a +- // map where values cannot be found. +- // But we can't assert here (since we don't want to fail on +- // random JSON input) or have an error mechanism. +- // Instead, we set has_duplicate_keys_ in the builder to +- // signal this. +- // TODO: Have to check for pointer equality, as some sort +- // implementation apparently call this function with the same +- // element?? Why? +- if (!comp && &a != &b) has_duplicate_keys_ = true; +- return comp < 0; +- }); ++ auto dict = reinterpret_cast(stack_.data() + start); ++ std::sort( ++ dict, dict + len, [&](const TwoValue &a, const TwoValue &b) -> bool { ++ auto as = reinterpret_cast(buf_.data() + a.key.u_); ++ auto bs = reinterpret_cast(buf_.data() + b.key.u_); ++ auto comp = strcmp(as, bs); ++ // We want to disallow duplicate keys, since this results in a ++ // map where values cannot be found. ++ // But we can't assert here (since we don't want to fail on ++ // random JSON input) or have an error mechanism. ++ // Instead, we set has_duplicate_keys_ in the builder to ++ // signal this. ++ // TODO: Have to check for pointer equality, as some sort ++ // implementation apparently call this function with the same ++ // element?? Why? ++ if (!comp && &a != &b) has_duplicate_keys_ = true; ++ return comp < 0; ++ }); + // First create a vector out of all keys. + // TODO(wvo): if kBuilderFlagShareKeyVectors is true, see if we can share + // the first vector. +@@ -1195,7 +1220,7 @@ + Vector(elems, len); + } + template void Vector(const std::vector &vec) { +- Vector(flatbuffers::vector_data(vec), vec.size()); ++ Vector(vec.data(), vec.size()); + } + + template size_t TypedVector(F f) { +@@ -1397,12 +1422,10 @@ + + template static Type GetScalarType() { + static_assert(flatbuffers::is_scalar::value, "Unrelated types"); +- return flatbuffers::is_floating_point::value +- ? FBT_FLOAT +- : flatbuffers::is_same::value +- ? FBT_BOOL +- : (flatbuffers::is_unsigned::value ? FBT_UINT +- : FBT_INT); ++ return flatbuffers::is_floating_point::value ? FBT_FLOAT ++ : flatbuffers::is_same::value ++ ? FBT_BOOL ++ : (flatbuffers::is_unsigned::value ? FBT_UINT : FBT_INT); + } + + public: +@@ -1552,9 +1575,9 @@ + } + } + } +- // If you get this assert, your fixed types are not one of: ++ // If you get this assert, your typed types are not one of: + // Int / UInt / Float / Key. +- FLATBUFFERS_ASSERT(!fixed || IsTypedVectorElementType(vector_type)); ++ FLATBUFFERS_ASSERT(!typed || IsTypedVectorElementType(vector_type)); + auto byte_width = Align(bit_width); + // Write vector. First the keys width/offset if available, and size. + if (keys) { +@@ -1597,10 +1620,8 @@ + struct KeyOffsetCompare { + explicit KeyOffsetCompare(const std::vector &buf) : buf_(&buf) {} + bool operator()(size_t a, size_t b) const { +- auto stra = +- reinterpret_cast(flatbuffers::vector_data(*buf_) + a); +- auto strb = +- reinterpret_cast(flatbuffers::vector_data(*buf_) + b); ++ auto stra = reinterpret_cast(buf_->data() + a); ++ auto strb = reinterpret_cast(buf_->data() + b); + return strcmp(stra, strb) < 0; + } + const std::vector *buf_; +@@ -1611,11 +1632,10 @@ + explicit StringOffsetCompare(const std::vector &buf) + : buf_(&buf) {} + bool operator()(const StringOffset &a, const StringOffset &b) const { +- auto stra = reinterpret_cast( +- flatbuffers::vector_data(*buf_) + a.first); +- auto strb = reinterpret_cast( +- flatbuffers::vector_data(*buf_) + b.first); +- return strncmp(stra, strb, (std::min)(a.second, b.second) + 1) < 0; ++ auto stra = buf_->data() + a.first; ++ auto strb = buf_->data() + b.first; ++ auto cr = memcmp(stra, strb, (std::min)(a.second, b.second) + 1); ++ return cr < 0 || (cr == 0 && a.second < b.second); + } + const std::vector *buf_; + }; +@@ -1625,8 +1645,249 @@ + + KeyOffsetMap key_pool; + StringOffsetMap string_pool; ++ ++ friend class Verifier; + }; + ++// Helper class to verify the integrity of a FlexBuffer ++class Verifier FLATBUFFERS_FINAL_CLASS { ++ public: ++ Verifier(const uint8_t *buf, size_t buf_len, ++ // Supplying this vector likely results in faster verification ++ // of larger buffers with many shared keys/strings, but ++ // comes at the cost of using additional memory the same size of ++ // the buffer being verified, so it is by default off. ++ std::vector *reuse_tracker = nullptr, ++ bool _check_alignment = true, size_t max_depth = 64) ++ : buf_(buf), ++ size_(buf_len), ++ depth_(0), ++ max_depth_(max_depth), ++ num_vectors_(0), ++ max_vectors_(buf_len), ++ check_alignment_(_check_alignment), ++ reuse_tracker_(reuse_tracker) { ++ FLATBUFFERS_ASSERT(size_ < FLATBUFFERS_MAX_BUFFER_SIZE); ++ if (reuse_tracker_) { ++ reuse_tracker_->clear(); ++ reuse_tracker_->resize(size_, PackedType(BIT_WIDTH_8, FBT_NULL)); ++ } ++ } ++ ++ private: ++ // Central location where any verification failures register. ++ bool Check(bool ok) const { ++ // clang-format off ++ #ifdef FLATBUFFERS_DEBUG_VERIFICATION_FAILURE ++ FLATBUFFERS_ASSERT(ok); ++ #endif ++ // clang-format on ++ return ok; ++ } ++ ++ // Verify any range within the buffer. ++ bool VerifyFrom(size_t elem, size_t elem_len) const { ++ return Check(elem_len < size_ && elem <= size_ - elem_len); ++ } ++ bool VerifyBefore(size_t elem, size_t elem_len) const { ++ return Check(elem_len <= elem); ++ } ++ ++ bool VerifyFromPointer(const uint8_t *p, size_t len) { ++ auto o = static_cast(p - buf_); ++ return VerifyFrom(o, len); ++ } ++ bool VerifyBeforePointer(const uint8_t *p, size_t len) { ++ auto o = static_cast(p - buf_); ++ return VerifyBefore(o, len); ++ } ++ ++ bool VerifyByteWidth(size_t width) { ++ return Check(width == 1 || width == 2 || width == 4 || width == 8); ++ } ++ ++ bool VerifyType(int type) { return Check(type >= 0 && type < FBT_MAX_TYPE); } ++ ++ bool VerifyOffset(uint64_t off, const uint8_t *p) { ++ return Check(off <= static_cast(size_)) && ++ off <= static_cast(p - buf_); ++ } ++ ++ bool VerifyAlignment(const uint8_t *p, size_t size) const { ++ auto o = static_cast(p - buf_); ++ return Check((o & (size - 1)) == 0 || !check_alignment_); ++ } ++ ++// Macro, since we want to escape from parent function & use lazy args. ++#define FLEX_CHECK_VERIFIED(P, PACKED_TYPE) \ ++ if (reuse_tracker_) { \ ++ auto packed_type = PACKED_TYPE; \ ++ auto existing = (*reuse_tracker_)[P - buf_]; \ ++ if (existing == packed_type) return true; \ ++ /* Fail verification if already set with different type! */ \ ++ if (!Check(existing == 0)) return false; \ ++ (*reuse_tracker_)[P - buf_] = packed_type; \ ++ } ++ ++ bool VerifyVector(Reference r, const uint8_t *p, Type elem_type) { ++ // Any kind of nesting goes thru this function, so guard against that ++ // here, both with simple nesting checks, and the reuse tracker if on. ++ depth_++; ++ num_vectors_++; ++ if (!Check(depth_ <= max_depth_ && num_vectors_ <= max_vectors_)) ++ return false; ++ auto size_byte_width = r.byte_width_; ++ FLEX_CHECK_VERIFIED(p, ++ PackedType(Builder::WidthB(size_byte_width), r.type_)); ++ if (!VerifyBeforePointer(p, size_byte_width)) return false; ++ auto sized = Sized(p, size_byte_width); ++ auto num_elems = sized.size(); ++ auto elem_byte_width = r.type_ == FBT_STRING || r.type_ == FBT_BLOB ++ ? uint8_t(1) ++ : r.byte_width_; ++ auto max_elems = SIZE_MAX / elem_byte_width; ++ if (!Check(num_elems < max_elems)) ++ return false; // Protect against byte_size overflowing. ++ auto byte_size = num_elems * elem_byte_width; ++ if (!VerifyFromPointer(p, byte_size)) return false; ++ if (elem_type == FBT_NULL) { ++ // Verify type bytes after the vector. ++ if (!VerifyFromPointer(p + byte_size, num_elems)) return false; ++ auto v = Vector(p, size_byte_width); ++ for (size_t i = 0; i < num_elems; i++) ++ if (!VerifyRef(v[i])) return false; ++ } else if (elem_type == FBT_KEY) { ++ auto v = TypedVector(p, elem_byte_width, FBT_KEY); ++ for (size_t i = 0; i < num_elems; i++) ++ if (!VerifyRef(v[i])) return false; ++ } else { ++ FLATBUFFERS_ASSERT(IsInline(elem_type)); ++ } ++ depth_--; ++ return true; ++ } ++ ++ bool VerifyKeys(const uint8_t *p, uint8_t byte_width) { ++ // The vector part of the map has already been verified. ++ const size_t num_prefixed_fields = 3; ++ if (!VerifyBeforePointer(p, byte_width * num_prefixed_fields)) return false; ++ p -= byte_width * num_prefixed_fields; ++ auto off = ReadUInt64(p, byte_width); ++ if (!VerifyOffset(off, p)) return false; ++ auto key_byte_with = ++ static_cast(ReadUInt64(p + byte_width, byte_width)); ++ if (!VerifyByteWidth(key_byte_with)) return false; ++ return VerifyVector(Reference(p, byte_width, key_byte_with, FBT_VECTOR_KEY), ++ p - off, FBT_KEY); ++ } ++ ++ bool VerifyKey(const uint8_t *p) { ++ FLEX_CHECK_VERIFIED(p, PackedType(BIT_WIDTH_8, FBT_KEY)); ++ while (p < buf_ + size_) ++ if (*p++) return true; ++ return false; ++ } ++ ++#undef FLEX_CHECK_VERIFIED ++ ++ bool VerifyTerminator(const String &s) { ++ return VerifyFromPointer(reinterpret_cast(s.c_str()), ++ s.size() + 1); ++ } ++ ++ bool VerifyRef(Reference r) { ++ // r.parent_width_ and r.data_ already verified. ++ if (!VerifyByteWidth(r.byte_width_) || !VerifyType(r.type_)) { ++ return false; ++ } ++ if (IsInline(r.type_)) { ++ // Inline scalars, don't require further verification. ++ return true; ++ } ++ // All remaining types are an offset. ++ auto off = ReadUInt64(r.data_, r.parent_width_); ++ if (!VerifyOffset(off, r.data_)) return false; ++ auto p = r.Indirect(); ++ if (!VerifyAlignment(p, r.byte_width_)) return false; ++ switch (r.type_) { ++ case FBT_INDIRECT_INT: ++ case FBT_INDIRECT_UINT: ++ case FBT_INDIRECT_FLOAT: return VerifyFromPointer(p, r.byte_width_); ++ case FBT_KEY: return VerifyKey(p); ++ case FBT_MAP: ++ return VerifyVector(r, p, FBT_NULL) && VerifyKeys(p, r.byte_width_); ++ case FBT_VECTOR: return VerifyVector(r, p, FBT_NULL); ++ case FBT_VECTOR_INT: return VerifyVector(r, p, FBT_INT); ++ case FBT_VECTOR_BOOL: ++ case FBT_VECTOR_UINT: return VerifyVector(r, p, FBT_UINT); ++ case FBT_VECTOR_FLOAT: return VerifyVector(r, p, FBT_FLOAT); ++ case FBT_VECTOR_KEY: return VerifyVector(r, p, FBT_KEY); ++ case FBT_VECTOR_STRING_DEPRECATED: ++ // Use of FBT_KEY here intentional, see elsewhere. ++ return VerifyVector(r, p, FBT_KEY); ++ case FBT_BLOB: return VerifyVector(r, p, FBT_UINT); ++ case FBT_STRING: ++ return VerifyVector(r, p, FBT_UINT) && ++ VerifyTerminator(String(p, r.byte_width_)); ++ case FBT_VECTOR_INT2: ++ case FBT_VECTOR_UINT2: ++ case FBT_VECTOR_FLOAT2: ++ case FBT_VECTOR_INT3: ++ case FBT_VECTOR_UINT3: ++ case FBT_VECTOR_FLOAT3: ++ case FBT_VECTOR_INT4: ++ case FBT_VECTOR_UINT4: ++ case FBT_VECTOR_FLOAT4: { ++ uint8_t len = 0; ++ auto vtype = ToFixedTypedVectorElementType(r.type_, &len); ++ if (!VerifyType(vtype)) return false; ++ return VerifyFromPointer(p, r.byte_width_ * len); ++ } ++ default: return false; ++ } ++ } ++ ++ public: ++ bool VerifyBuffer() { ++ if (!Check(size_ >= 3)) return false; ++ auto end = buf_ + size_; ++ auto byte_width = *--end; ++ auto packed_type = *--end; ++ return VerifyByteWidth(byte_width) && Check(end - buf_ >= byte_width) && ++ VerifyRef(Reference(end - byte_width, byte_width, packed_type)); ++ } ++ ++ private: ++ const uint8_t *buf_; ++ size_t size_; ++ size_t depth_; ++ const size_t max_depth_; ++ size_t num_vectors_; ++ const size_t max_vectors_; ++ bool check_alignment_; ++ std::vector *reuse_tracker_; ++}; ++ ++// Utility function that contructs the Verifier for you, see above for ++// parameters. ++inline bool VerifyBuffer(const uint8_t *buf, size_t buf_len, ++ std::vector *reuse_tracker = nullptr) { ++ Verifier verifier(buf, buf_len, reuse_tracker); ++ return verifier.VerifyBuffer(); ++} ++ ++#ifdef FLATBUFFERS_H_ ++// This is a verifier utility function that works together with the ++// FlatBuffers verifier, which should only be present if flatbuffer.h ++// has been included (which it typically is in generated code). ++inline bool VerifyNestedFlexBuffer(const flatbuffers::Vector *nv, ++ flatbuffers::Verifier &verifier) { ++ if (!nv) return true; ++ return verifier.Check(flexbuffers::VerifyBuffer( ++ nv->data(), nv->size(), verifier.GetFlexReuseTracker())); ++} ++#endif ++ + } // namespace flexbuffers + + #if defined(_MSC_VER) +diff -urN a/include/flatbuffers/grpc.h b/include/flatbuffers/grpc.h +--- a/include/flatbuffers/grpc.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/include/flatbuffers/grpc.h 2023-01-13 07:47:06.300228238 +0000 +@@ -22,6 +22,7 @@ + #include "flatbuffers/flatbuffers.h" + #include "grpc/byte_buffer_reader.h" + #include "grpcpp/support/byte_buffer.h" ++#include "grpcpp/support/slice.h" + + namespace flatbuffers { + namespace grpc { +@@ -32,33 +33,23 @@ + // is refcounted and ownership is be managed automatically. + template class Message { + public: +- Message() : slice_(grpc_empty_slice()) {} ++ Message() {} + +- Message(grpc_slice slice, bool add_ref) +- : slice_(add_ref ? grpc_slice_ref(slice) : slice) {} ++ Message(::grpc::Slice slice) : slice_(slice) {} + + Message &operator=(const Message &other) = delete; + +- Message(Message &&other) : slice_(other.slice_) { +- other.slice_ = grpc_empty_slice(); +- } ++ Message(Message &&other) = default; + + Message(const Message &other) = delete; + +- Message &operator=(Message &&other) { +- grpc_slice_unref(slice_); +- slice_ = other.slice_; +- other.slice_ = grpc_empty_slice(); +- return *this; +- } +- +- ~Message() { grpc_slice_unref(slice_); } ++ Message &operator=(Message &&other) = default; + +- const uint8_t *mutable_data() const { return GRPC_SLICE_START_PTR(slice_); } ++ const uint8_t *mutable_data() const { return slice_.begin(); } + +- const uint8_t *data() const { return GRPC_SLICE_START_PTR(slice_); } ++ const uint8_t *data() const { return slice_.begin(); } + +- size_t size() const { return GRPC_SLICE_LENGTH(slice_); } ++ size_t size() const { return slice_.size(); } + + bool Verify() const { + Verifier verifier(data(), size()); +@@ -70,10 +61,10 @@ + const T *GetRoot() const { return flatbuffers::GetRoot(data()); } + + // This is only intended for serializer use, or if you know what you're doing +- const grpc_slice &BorrowSlice() const { return slice_; } ++ const ::grpc::Slice &BorrowSlice() const { return slice_; } + + private: +- grpc_slice slice_; ++ ::grpc::Slice slice_; + }; + + class MessageBuilder; +@@ -83,12 +74,12 @@ + // efficient to transfer buffers to gRPC. + class SliceAllocator : public Allocator { + public: +- SliceAllocator() : slice_(grpc_empty_slice()) {} ++ SliceAllocator() {} + + SliceAllocator(const SliceAllocator &other) = delete; + SliceAllocator &operator=(const SliceAllocator &other) = delete; + +- SliceAllocator(SliceAllocator &&other) : slice_(grpc_empty_slice()) { ++ SliceAllocator(SliceAllocator &&other) { + // default-construct and swap idiom + swap(other); + } +@@ -105,45 +96,43 @@ + swap(slice_, other.slice_); + } + +- virtual ~SliceAllocator() { grpc_slice_unref(slice_); } ++ virtual ~SliceAllocator() {} + + virtual uint8_t *allocate(size_t size) override { +- FLATBUFFERS_ASSERT(GRPC_SLICE_IS_EMPTY(slice_)); +- slice_ = grpc_slice_malloc(size); +- return GRPC_SLICE_START_PTR(slice_); ++ FLATBUFFERS_ASSERT(slice_.size() == 0); ++ slice_ = ::grpc::Slice(size); ++ return const_cast(slice_.begin()); + } + + virtual void deallocate(uint8_t *p, size_t size) override { +- FLATBUFFERS_ASSERT(p == GRPC_SLICE_START_PTR(slice_)); +- FLATBUFFERS_ASSERT(size == GRPC_SLICE_LENGTH(slice_)); +- grpc_slice_unref(slice_); +- slice_ = grpc_empty_slice(); ++ FLATBUFFERS_ASSERT(p == slice_.begin()); ++ FLATBUFFERS_ASSERT(size == slice_.size()); ++ slice_ = ::grpc::Slice(); + } + + virtual uint8_t *reallocate_downward(uint8_t *old_p, size_t old_size, + size_t new_size, size_t in_use_back, + size_t in_use_front) override { +- FLATBUFFERS_ASSERT(old_p == GRPC_SLICE_START_PTR(slice_)); +- FLATBUFFERS_ASSERT(old_size == GRPC_SLICE_LENGTH(slice_)); ++ FLATBUFFERS_ASSERT(old_p == slice_.begin()); ++ FLATBUFFERS_ASSERT(old_size == slice_.size()); + FLATBUFFERS_ASSERT(new_size > old_size); +- grpc_slice old_slice = slice_; +- grpc_slice new_slice = grpc_slice_malloc(new_size); +- uint8_t *new_p = GRPC_SLICE_START_PTR(new_slice); ++ ::grpc::Slice old_slice = slice_; ++ ::grpc::Slice new_slice = ::grpc::Slice(new_size); ++ uint8_t *new_p = const_cast(new_slice.begin()); + memcpy_downward(old_p, old_size, new_p, new_size, in_use_back, + in_use_front); + slice_ = new_slice; +- grpc_slice_unref(old_slice); + return new_p; + } + + private: +- grpc_slice &get_slice(uint8_t *p, size_t size) { +- FLATBUFFERS_ASSERT(p == GRPC_SLICE_START_PTR(slice_)); +- FLATBUFFERS_ASSERT(size == GRPC_SLICE_LENGTH(slice_)); ++ ::grpc::Slice &get_slice(uint8_t *p, size_t size) { ++ FLATBUFFERS_ASSERT(p == slice_.begin()); ++ FLATBUFFERS_ASSERT(size == slice_.size()); + return slice_; + } + +- grpc_slice slice_; ++ ::grpc::Slice slice_; + + friend class MessageBuilder; + }; +@@ -184,9 +173,9 @@ + if (buf_.capacity()) { + uint8_t *buf = buf_.scratch_data(); // pointer to memory + size_t capacity = buf_.capacity(); // size of memory +- slice_allocator_.slice_ = grpc_slice_new_with_len(buf, capacity, dealloc); ++ slice_allocator_.slice_ = ::grpc::Slice(buf, capacity, dealloc); + } else { +- slice_allocator_.slice_ = grpc_empty_slice(); ++ slice_allocator_.slice_ = ::grpc::Slice(); + } + } + +@@ -221,10 +210,10 @@ + // Releases the ownership of the buffer pointer. + // Returns the size, offset, and the original grpc_slice that + // allocated the buffer. Also see grpc_slice_unref(). +- uint8_t *ReleaseRaw(size_t &size, size_t &offset, grpc_slice &slice) { ++ uint8_t *ReleaseRaw(size_t &size, size_t &offset, ::grpc::Slice &slice) { + uint8_t *buf = FlatBufferBuilder::ReleaseRaw(size, offset); + slice = slice_allocator_.slice_; +- slice_allocator_.slice_ = grpc_empty_slice(); ++ slice_allocator_.slice_ = ::grpc::Slice(); + return buf; + } + +@@ -247,11 +236,11 @@ + auto begin = msg_data - buf_data; + auto end = begin + msg_size; + // Get the slice we are working with (no refcount change) +- grpc_slice slice = slice_allocator_.get_slice(buf_data, buf_size); ++ ::grpc::Slice slice = slice_allocator_.get_slice(buf_data, buf_size); + // Extract a subslice of the existing slice (increment refcount) +- grpc_slice subslice = grpc_slice_sub(slice, begin, end); ++ ::grpc::Slice subslice = slice.sub(begin, end); + // Wrap the subslice in a `Message`, but don't increment refcount +- Message msg(subslice, false); ++ Message msg(subslice); + return msg; + } + +@@ -273,15 +262,10 @@ + template class SerializationTraits> { + public: + static grpc::Status Serialize(const flatbuffers::grpc::Message &msg, +- grpc_byte_buffer **buffer, bool *own_buffer) { +- // We are passed in a `Message`, which is a wrapper around a +- // `grpc_slice`. We extract it here using `BorrowSlice()`. The const cast +- // is necessary because the `grpc_raw_byte_buffer_create` func expects +- // non-const slices in order to increment their refcounts. +- grpc_slice *slice = const_cast(&msg.BorrowSlice()); +- // Now use `grpc_raw_byte_buffer_create` to package the single slice into a +- // `grpc_byte_buffer`, incrementing the refcount in the process. +- *buffer = grpc_raw_byte_buffer_create(slice, 1); ++ ByteBuffer *buffer, bool *own_buffer) { ++ // Package the single slice into a `ByteBuffer`, ++ // incrementing the refcount in the process. ++ *buffer = ByteBuffer(&msg.BorrowSlice(), 1); + *own_buffer = true; + return grpc::Status::OK; + } +@@ -289,30 +273,15 @@ + // Deserialize by pulling the + static grpc::Status Deserialize(ByteBuffer *buf, + flatbuffers::grpc::Message *msg) { +- grpc_byte_buffer *buffer = *reinterpret_cast(buf); +- if (!buffer) { +- return ::grpc::Status(::grpc::StatusCode::INTERNAL, "No payload"); +- } +- // Check if this is a single uncompressed slice. +- if ((buffer->type == GRPC_BB_RAW) && +- (buffer->data.raw.compression == GRPC_COMPRESS_NONE) && +- (buffer->data.raw.slice_buffer.count == 1)) { +- // If it is, then we can reference the `grpc_slice` directly. +- grpc_slice slice = buffer->data.raw.slice_buffer.slices[0]; +- // We wrap a `Message` around the slice, incrementing the refcount. +- *msg = flatbuffers::grpc::Message(slice, true); +- } else { +- // Otherwise, we need to use `grpc_byte_buffer_reader_readall` to read +- // `buffer` into a single contiguous `grpc_slice`. The gRPC reader gives +- // us back a new slice with the refcount already incremented. +- grpc_byte_buffer_reader reader; +- grpc_byte_buffer_reader_init(&reader, buffer); +- grpc_slice slice = grpc_byte_buffer_reader_readall(&reader); +- grpc_byte_buffer_reader_destroy(&reader); +- // We wrap a `Message` around the slice, but don't increment refcount +- *msg = flatbuffers::grpc::Message(slice, false); ++ Slice slice; ++ if (!buf->TrySingleSlice(&slice).ok()) { ++ if (!buf->DumpToSingleSlice(&slice).ok()) { ++ buf->Clear(); ++ return ::grpc::Status(::grpc::StatusCode::INTERNAL, "No payload"); ++ } + } +- grpc_byte_buffer_destroy(buffer); ++ *msg = flatbuffers::grpc::Message(slice); ++ buf->Clear(); + #if FLATBUFFERS_GRPC_DISABLE_AUTO_VERIFICATION + return ::grpc::Status::OK; + #else +diff -urN a/include/flatbuffers/idl.h b/include/flatbuffers/idl.h +--- a/include/flatbuffers/idl.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/include/flatbuffers/idl.h 2023-01-13 07:47:06.300228238 +0000 +@@ -17,6 +17,7 @@ + #ifndef FLATBUFFERS_IDL_H_ + #define FLATBUFFERS_IDL_H_ + ++#include + #include + #include + #include +@@ -27,10 +28,6 @@ + #include "flatbuffers/hash.h" + #include "flatbuffers/reflection.h" + +-#if !defined(FLATBUFFERS_CPP98_STL) +-# include +-#endif // !defined(FLATBUFFERS_CPP98_STL) +- + // This file defines the data types representing a parsed IDL (Interface + // Definition Language) / schema file. + +@@ -75,8 +72,8 @@ + // - Go type. + // - C# / .Net type. + // - Python type. +-// - Rust type. + // - Kotlin type. ++// - Rust type. + + // using these macros, we can now write code dealing with types just once, e.g. + +@@ -207,7 +204,7 @@ + } + + bool Add(const std::string &name, T *e) { +- vector_emplace_back(&vec, e); ++ vec.emplace_back(e); + auto it = dict.find(name); + if (it != dict.end()) return true; + dict[name] = e; +@@ -266,7 +263,8 @@ + defined_namespace(nullptr), + serialized_location(0), + index(-1), +- refcount(1) {} ++ refcount(1), ++ declaration_file(nullptr) {} + + flatbuffers::Offset< + flatbuffers::Vector>> +@@ -286,6 +284,7 @@ + uoffset_t serialized_location; + int index; // Inside the vector it is stored. + int refcount; ++ const std::string *declaration_file; + }; + + struct FieldDef : public Definition { +@@ -307,15 +306,9 @@ + bool IsScalarOptional() const { + return IsScalar(value.type.base_type) && IsOptional(); + } +- bool IsOptional() const { +- return presence == kOptional; +- } +- bool IsRequired() const { +- return presence == kRequired; +- } +- bool IsDefault() const { +- return presence == kDefault; +- } ++ bool IsOptional() const { return presence == kOptional; } ++ bool IsRequired() const { return presence == kRequired; } ++ bool IsDefault() const { return presence == kDefault; } + + Value value; + bool deprecated; // Field is allowed to be present in old data, but can't be. +@@ -475,6 +468,10 @@ + return type.enum_def != nullptr && type.enum_def->is_union; + } + ++inline bool IsUnionType(const Type &type) { ++ return IsUnion(type) && IsInteger(type.base_type); ++} ++ + inline bool IsVector(const Type &type) { + return type.base_type == BASE_TYPE_VECTOR; + } +@@ -542,6 +539,9 @@ + + // Container of options that may apply to any of the source/text generators. + struct IDLOptions { ++ // field case style options for C++ ++ enum CaseStyle { CaseStyle_Unchanged = 0, CaseStyle_Upper, CaseStyle_Lower }; ++ + bool gen_jvmstatic; + // Use flexbuffers instead for binary and text generation + bool use_flexbuffers; +@@ -564,10 +564,12 @@ + std::string cpp_object_api_pointer_type; + std::string cpp_object_api_string_type; + bool cpp_object_api_string_flexible_constructor; ++ CaseStyle cpp_object_api_field_case_style; + bool cpp_direct_copy; + bool gen_nullable; + bool java_checkerframework; + bool gen_generated; ++ bool gen_json_coders; + std::string object_prefix; + std::string object_suffix; + bool union_value_namespacing; +@@ -593,6 +595,12 @@ + std::string filename_suffix; + std::string filename_extension; + bool no_warnings; ++ bool warnings_as_errors; ++ std::string project_root; ++ bool cs_global_alias; ++ bool json_nested_flatbuffers; ++ bool json_nested_flexbuffers; ++ bool json_nested_legacy_flatbuffers; + + // Possible options for the more general generator below. + enum Language { +@@ -615,8 +623,6 @@ + kMAX + }; + +- Language lang; +- + enum MiniReflect { kNone, kTypes, kTypesAndNames }; + + MiniReflect mini_reflect; +@@ -624,6 +630,12 @@ + // If set, require all fields in a table to be explicitly numbered. + bool require_explicit_ids; + ++ // If set, implement serde::Serialize for generated Rust types ++ bool rust_serialize; ++ ++ // If set, generate rust types in individual files with a root module file. ++ bool rust_module_root_file; ++ + // The corresponding language bit will be set if a language is included + // for code generation. + unsigned long lang_to_generate; +@@ -657,10 +669,12 @@ + gen_compare(false), + cpp_object_api_pointer_type("std::unique_ptr"), + cpp_object_api_string_flexible_constructor(false), ++ cpp_object_api_field_case_style(CaseStyle_Unchanged), + cpp_direct_copy(true), + gen_nullable(false), + java_checkerframework(false), + gen_generated(false), ++ gen_json_coders(false), + object_suffix("T"), + union_value_namespacing(true), + allow_non_utf8(false), +@@ -678,9 +692,16 @@ + filename_suffix("_generated"), + filename_extension(), + no_warnings(false), +- lang(IDLOptions::kJava), ++ warnings_as_errors(false), ++ project_root(""), ++ cs_global_alias(false), ++ json_nested_flatbuffers(true), ++ json_nested_flexbuffers(true), ++ json_nested_legacy_flatbuffers(false), + mini_reflect(IDLOptions::kNone), + require_explicit_ids(false), ++ rust_serialize(false), ++ rust_module_root_file(false), + lang_to_generate(0), + set_empty_strings_to_null(true), + set_empty_vectors_to_null(true) {} +@@ -780,6 +801,7 @@ + root_struct_def_(nullptr), + opts(options), + uses_flexbuffers_(false), ++ has_warning_(false), + advanced_features_(0), + source_(nullptr), + anonymous_counter_(0), +@@ -942,14 +964,15 @@ + StructDef *LookupCreateStruct(const std::string &name, + bool create_if_new = true, + bool definition = false); +- FLATBUFFERS_CHECKED_ERROR ParseEnum(bool is_union, EnumDef **dest); ++ FLATBUFFERS_CHECKED_ERROR ParseEnum(bool is_union, EnumDef **dest, ++ const char *filename); + FLATBUFFERS_CHECKED_ERROR ParseNamespace(); + FLATBUFFERS_CHECKED_ERROR StartStruct(const std::string &name, + StructDef **dest); + FLATBUFFERS_CHECKED_ERROR StartEnum(const std::string &name, bool is_union, + EnumDef **dest); +- FLATBUFFERS_CHECKED_ERROR ParseDecl(); +- FLATBUFFERS_CHECKED_ERROR ParseService(); ++ FLATBUFFERS_CHECKED_ERROR ParseDecl(const char *filename); ++ FLATBUFFERS_CHECKED_ERROR ParseService(const char *filename); + FLATBUFFERS_CHECKED_ERROR ParseProtoFields(StructDef *struct_def, + bool isextend, bool inside_oneof); + FLATBUFFERS_CHECKED_ERROR ParseProtoOption(); +@@ -986,6 +1009,8 @@ + FLATBUFFERS_CHECKED_ERROR RecurseError(); + template CheckedError Recurse(F f); + ++ const std::string &GetPooledString(const std::string &s) const; ++ + public: + SymbolTable types_; + SymbolTable structs_; +@@ -1011,6 +1036,7 @@ + + IDLOptions opts; + bool uses_flexbuffers_; ++ bool has_warning_; + + uint64_t advanced_features_; + +@@ -1021,6 +1047,10 @@ + + std::vector> field_stack_; + ++ // TODO(cneo): Refactor parser to use string_cache more often to save ++ // on memory usage. ++ mutable std::set string_cache_; ++ + int anonymous_counter_; + int parse_depth_counter_; // stack-overflow guard + }; +@@ -1152,9 +1182,10 @@ + + // Generate a make rule for generated Java or C# files. + // See code_generators.cpp. +-extern std::string JavaCSharpMakeRule(const Parser &parser, +- const std::string &path, +- const std::string &file_name); ++extern std::string CSharpMakeRule(const Parser &parser, const std::string &path, ++ const std::string &file_name); ++extern std::string JavaMakeRule(const Parser &parser, const std::string &path, ++ const std::string &file_name); + + // Generate a make rule for the generated text (JSON) files. + // See idl_gen_text.cpp. +@@ -1193,6 +1224,9 @@ + + extern bool GenerateTSGRPC(const Parser &parser, const std::string &path, + const std::string &file_name); ++ ++extern bool GenerateRustModuleRootFile(const Parser &parser, ++ const std::string &path); + } // namespace flatbuffers + + #endif // FLATBUFFERS_IDL_H_ +diff -urN a/include/flatbuffers/reflection.h b/include/flatbuffers/reflection.h +--- a/include/flatbuffers/reflection.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/include/flatbuffers/reflection.h 2023-01-13 07:47:06.300228238 +0000 +@@ -21,7 +21,7 @@ + // file) is needed to generate this header in the first place. + // Should normally not be a problem since it can be generated by the + // previous version of flatc whenever this code needs to change. +-// See reflection/generate_code.sh ++// See scripts/generate_code.py for generation. + #include "flatbuffers/reflection_generated.h" + + // Helper functionality for reflection. +@@ -379,12 +379,12 @@ + public: + pointer_inside_vector(T *ptr, std::vector &vec) + : offset_(reinterpret_cast(ptr) - +- reinterpret_cast(flatbuffers::vector_data(vec))), ++ reinterpret_cast(vec.data())), + vec_(vec) {} + + T *operator*() const { +- return reinterpret_cast( +- reinterpret_cast(flatbuffers::vector_data(vec_)) + offset_); ++ return reinterpret_cast(reinterpret_cast(vec_.data()) + ++ offset_); + } + T *operator->() const { return operator*(); } + +@@ -412,7 +412,7 @@ + FLATBUFFERS_ASSERT(type_field); + auto union_type = GetFieldI(table, *type_field); + auto enumval = enumdef->values()->LookupByKey(union_type); +- return *enumval->object(); ++ return *schema.objects()->Get(enumval->union_type()->index()); + } + + // Changes the contents of a string inside a FlatBuffer. FlatBuffer must +diff -urN a/include/flatbuffers/reflection_generated.h b/include/flatbuffers/reflection_generated.h +--- a/include/flatbuffers/reflection_generated.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/include/flatbuffers/reflection_generated.h 2023-01-13 07:47:06.300228238 +0000 +@@ -32,6 +32,9 @@ + struct Service; + struct ServiceBuilder; + ++struct SchemaFile; ++struct SchemaFileBuilder; ++ + struct Schema; + struct SchemaBuilder; + +@@ -114,6 +117,7 @@ + return EnumNamesBaseType()[index]; + } + ++/// New schema language features that are not supported by old code generators. + enum AdvancedFeatures { + AdvancedArrayFeatures = 1ULL, + AdvancedUnionFeatures = 2ULL, +@@ -158,7 +162,9 @@ + VT_BASE_TYPE = 4, + VT_ELEMENT = 6, + VT_INDEX = 8, +- VT_FIXED_LENGTH = 10 ++ VT_FIXED_LENGTH = 10, ++ VT_BASE_SIZE = 12, ++ VT_ELEMENT_SIZE = 14 + }; + reflection::BaseType base_type() const { + return static_cast(GetField(VT_BASE_TYPE, 0)); +@@ -172,12 +178,22 @@ + uint16_t fixed_length() const { + return GetField(VT_FIXED_LENGTH, 0); + } ++ /// The size (octets) of the `base_type` field. ++ uint32_t base_size() const { ++ return GetField(VT_BASE_SIZE, 4); ++ } ++ /// The size (octets) of the `element` field, if present. ++ uint32_t element_size() const { ++ return GetField(VT_ELEMENT_SIZE, 0); ++ } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && +- VerifyField(verifier, VT_BASE_TYPE) && +- VerifyField(verifier, VT_ELEMENT) && +- VerifyField(verifier, VT_INDEX) && +- VerifyField(verifier, VT_FIXED_LENGTH) && ++ VerifyField(verifier, VT_BASE_TYPE, 1) && ++ VerifyField(verifier, VT_ELEMENT, 1) && ++ VerifyField(verifier, VT_INDEX, 4) && ++ VerifyField(verifier, VT_FIXED_LENGTH, 2) && ++ VerifyField(verifier, VT_BASE_SIZE, 4) && ++ VerifyField(verifier, VT_ELEMENT_SIZE, 4) && + verifier.EndTable(); + } + }; +@@ -198,6 +214,12 @@ + void add_fixed_length(uint16_t fixed_length) { + fbb_.AddElement(Type::VT_FIXED_LENGTH, fixed_length, 0); + } ++ void add_base_size(uint32_t base_size) { ++ fbb_.AddElement(Type::VT_BASE_SIZE, base_size, 4); ++ } ++ void add_element_size(uint32_t element_size) { ++ fbb_.AddElement(Type::VT_ELEMENT_SIZE, element_size, 0); ++ } + explicit TypeBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); +@@ -214,8 +236,12 @@ + reflection::BaseType base_type = reflection::None, + reflection::BaseType element = reflection::None, + int32_t index = -1, +- uint16_t fixed_length = 0) { ++ uint16_t fixed_length = 0, ++ uint32_t base_size = 4, ++ uint32_t element_size = 0) { + TypeBuilder builder_(_fbb); ++ builder_.add_element_size(element_size); ++ builder_.add_base_size(base_size); + builder_.add_index(index); + builder_.add_fixed_length(fixed_length); + builder_.add_element(element); +@@ -235,8 +261,8 @@ + bool KeyCompareLessThan(const KeyValue *o) const { + return *key() < *o->key(); + } +- int KeyCompareWithValue(const char *val) const { +- return strcmp(key()->c_str(), val); ++ int KeyCompareWithValue(const char *_key) const { ++ return strcmp(key()->c_str(), _key); + } + const flatbuffers::String *value() const { + return GetPointer(VT_VALUE); +@@ -300,7 +326,6 @@ + enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { + VT_NAME = 4, + VT_VALUE = 6, +- VT_OBJECT = 8, + VT_UNION_TYPE = 10, + VT_DOCUMENTATION = 12 + }; +@@ -313,11 +338,8 @@ + bool KeyCompareLessThan(const EnumVal *o) const { + return value() < o->value(); + } +- int KeyCompareWithValue(int64_t val) const { +- return static_cast(value() > val) - static_cast(value() < val); +- } +- const reflection::Object *object() const { +- return GetPointer(VT_OBJECT); ++ int KeyCompareWithValue(int64_t _value) const { ++ return static_cast(value() > _value) - static_cast(value() < _value); + } + const reflection::Type *union_type() const { + return GetPointer(VT_UNION_TYPE); +@@ -329,9 +351,7 @@ + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && +- VerifyField(verifier, VT_VALUE) && +- VerifyOffset(verifier, VT_OBJECT) && +- verifier.VerifyTable(object()) && ++ VerifyField(verifier, VT_VALUE, 8) && + VerifyOffset(verifier, VT_UNION_TYPE) && + verifier.VerifyTable(union_type()) && + VerifyOffset(verifier, VT_DOCUMENTATION) && +@@ -351,9 +371,6 @@ + void add_value(int64_t value) { + fbb_.AddElement(EnumVal::VT_VALUE, value, 0); + } +- void add_object(flatbuffers::Offset object) { +- fbb_.AddOffset(EnumVal::VT_OBJECT, object); +- } + void add_union_type(flatbuffers::Offset union_type) { + fbb_.AddOffset(EnumVal::VT_UNION_TYPE, union_type); + } +@@ -376,14 +393,12 @@ + flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::Offset name = 0, + int64_t value = 0, +- flatbuffers::Offset object = 0, + flatbuffers::Offset union_type = 0, + flatbuffers::Offset>> documentation = 0) { + EnumValBuilder builder_(_fbb); + builder_.add_value(value); + builder_.add_documentation(documentation); + builder_.add_union_type(union_type); +- builder_.add_object(object); + builder_.add_name(name); + return builder_.Finish(); + } +@@ -392,7 +407,6 @@ + flatbuffers::FlatBufferBuilder &_fbb, + const char *name = nullptr, + int64_t value = 0, +- flatbuffers::Offset object = 0, + flatbuffers::Offset union_type = 0, + const std::vector> *documentation = nullptr) { + auto name__ = name ? _fbb.CreateString(name) : 0; +@@ -401,7 +415,6 @@ + _fbb, + name__, + value, +- object, + union_type, + documentation__); + } +@@ -414,7 +427,8 @@ + VT_IS_UNION = 8, + VT_UNDERLYING_TYPE = 10, + VT_ATTRIBUTES = 12, +- VT_DOCUMENTATION = 14 ++ VT_DOCUMENTATION = 14, ++ VT_DECLARATION_FILE = 16 + }; + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); +@@ -422,8 +436,8 @@ + bool KeyCompareLessThan(const Enum *o) const { + return *name() < *o->name(); + } +- int KeyCompareWithValue(const char *val) const { +- return strcmp(name()->c_str(), val); ++ int KeyCompareWithValue(const char *_name) const { ++ return strcmp(name()->c_str(), _name); + } + const flatbuffers::Vector> *values() const { + return GetPointer> *>(VT_VALUES); +@@ -440,6 +454,10 @@ + const flatbuffers::Vector> *documentation() const { + return GetPointer> *>(VT_DOCUMENTATION); + } ++ /// File that this Enum is declared in. ++ const flatbuffers::String *declaration_file() const { ++ return GetPointer(VT_DECLARATION_FILE); ++ } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME) && +@@ -447,7 +465,7 @@ + VerifyOffsetRequired(verifier, VT_VALUES) && + verifier.VerifyVector(values()) && + verifier.VerifyVectorOfTables(values()) && +- VerifyField(verifier, VT_IS_UNION) && ++ VerifyField(verifier, VT_IS_UNION, 1) && + VerifyOffsetRequired(verifier, VT_UNDERLYING_TYPE) && + verifier.VerifyTable(underlying_type()) && + VerifyOffset(verifier, VT_ATTRIBUTES) && +@@ -456,6 +474,8 @@ + VerifyOffset(verifier, VT_DOCUMENTATION) && + verifier.VerifyVector(documentation()) && + verifier.VerifyVectorOfStrings(documentation()) && ++ VerifyOffset(verifier, VT_DECLARATION_FILE) && ++ verifier.VerifyString(declaration_file()) && + verifier.EndTable(); + } + }; +@@ -482,6 +502,9 @@ + void add_documentation(flatbuffers::Offset>> documentation) { + fbb_.AddOffset(Enum::VT_DOCUMENTATION, documentation); + } ++ void add_declaration_file(flatbuffers::Offset declaration_file) { ++ fbb_.AddOffset(Enum::VT_DECLARATION_FILE, declaration_file); ++ } + explicit EnumBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); +@@ -503,8 +526,10 @@ + bool is_union = false, + flatbuffers::Offset underlying_type = 0, + flatbuffers::Offset>> attributes = 0, +- flatbuffers::Offset>> documentation = 0) { ++ flatbuffers::Offset>> documentation = 0, ++ flatbuffers::Offset declaration_file = 0) { + EnumBuilder builder_(_fbb); ++ builder_.add_declaration_file(declaration_file); + builder_.add_documentation(documentation); + builder_.add_attributes(attributes); + builder_.add_underlying_type(underlying_type); +@@ -521,11 +546,13 @@ + bool is_union = false, + flatbuffers::Offset underlying_type = 0, + std::vector> *attributes = nullptr, +- const std::vector> *documentation = nullptr) { ++ const std::vector> *documentation = nullptr, ++ const char *declaration_file = nullptr) { + auto name__ = name ? _fbb.CreateString(name) : 0; + auto values__ = values ? _fbb.CreateVectorOfSortedTables(values) : 0; + auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables(attributes) : 0; + auto documentation__ = documentation ? _fbb.CreateVector>(*documentation) : 0; ++ auto declaration_file__ = declaration_file ? _fbb.CreateString(declaration_file) : 0; + return reflection::CreateEnum( + _fbb, + name__, +@@ -533,7 +560,8 @@ + is_union, + underlying_type, + attributes__, +- documentation__); ++ documentation__, ++ declaration_file__); + } + + struct Field FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +@@ -550,7 +578,8 @@ + VT_KEY = 20, + VT_ATTRIBUTES = 22, + VT_DOCUMENTATION = 24, +- VT_OPTIONAL = 26 ++ VT_OPTIONAL = 26, ++ VT_PADDING = 28 + }; + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); +@@ -558,8 +587,8 @@ + bool KeyCompareLessThan(const Field *o) const { + return *name() < *o->name(); + } +- int KeyCompareWithValue(const char *val) const { +- return strcmp(name()->c_str(), val); ++ int KeyCompareWithValue(const char *_name) const { ++ return strcmp(name()->c_str(), _name); + } + const reflection::Type *type() const { + return GetPointer(VT_TYPE); +@@ -594,26 +623,31 @@ + bool optional() const { + return GetField(VT_OPTIONAL, 0) != 0; + } ++ /// Number of padding octets to always add after this field. Structs only. ++ uint16_t padding() const { ++ return GetField(VT_PADDING, 0); ++ } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME) && + verifier.VerifyString(name()) && + VerifyOffsetRequired(verifier, VT_TYPE) && + verifier.VerifyTable(type()) && +- VerifyField(verifier, VT_ID) && +- VerifyField(verifier, VT_OFFSET) && +- VerifyField(verifier, VT_DEFAULT_INTEGER) && +- VerifyField(verifier, VT_DEFAULT_REAL) && +- VerifyField(verifier, VT_DEPRECATED) && +- VerifyField(verifier, VT_REQUIRED) && +- VerifyField(verifier, VT_KEY) && ++ VerifyField(verifier, VT_ID, 2) && ++ VerifyField(verifier, VT_OFFSET, 2) && ++ VerifyField(verifier, VT_DEFAULT_INTEGER, 8) && ++ VerifyField(verifier, VT_DEFAULT_REAL, 8) && ++ VerifyField(verifier, VT_DEPRECATED, 1) && ++ VerifyField(verifier, VT_REQUIRED, 1) && ++ VerifyField(verifier, VT_KEY, 1) && + VerifyOffset(verifier, VT_ATTRIBUTES) && + verifier.VerifyVector(attributes()) && + verifier.VerifyVectorOfTables(attributes()) && + VerifyOffset(verifier, VT_DOCUMENTATION) && + verifier.VerifyVector(documentation()) && + verifier.VerifyVectorOfStrings(documentation()) && +- VerifyField(verifier, VT_OPTIONAL) && ++ VerifyField(verifier, VT_OPTIONAL, 1) && ++ VerifyField(verifier, VT_PADDING, 2) && + verifier.EndTable(); + } + }; +@@ -658,6 +692,9 @@ + void add_optional(bool optional) { + fbb_.AddElement(Field::VT_OPTIONAL, static_cast(optional), 0); + } ++ void add_padding(uint16_t padding) { ++ fbb_.AddElement(Field::VT_PADDING, padding, 0); ++ } + explicit FieldBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); +@@ -684,7 +721,8 @@ + bool key = false, + flatbuffers::Offset>> attributes = 0, + flatbuffers::Offset>> documentation = 0, +- bool optional = false) { ++ bool optional = false, ++ uint16_t padding = 0) { + FieldBuilder builder_(_fbb); + builder_.add_default_real(default_real); + builder_.add_default_integer(default_integer); +@@ -692,6 +730,7 @@ + builder_.add_attributes(attributes); + builder_.add_type(type); + builder_.add_name(name); ++ builder_.add_padding(padding); + builder_.add_offset(offset); + builder_.add_id(id); + builder_.add_optional(optional); +@@ -714,7 +753,8 @@ + bool key = false, + std::vector> *attributes = nullptr, + const std::vector> *documentation = nullptr, +- bool optional = false) { ++ bool optional = false, ++ uint16_t padding = 0) { + auto name__ = name ? _fbb.CreateString(name) : 0; + auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables(attributes) : 0; + auto documentation__ = documentation ? _fbb.CreateVector>(*documentation) : 0; +@@ -731,7 +771,8 @@ + key, + attributes__, + documentation__, +- optional); ++ optional, ++ padding); + } + + struct Object FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +@@ -743,7 +784,8 @@ + VT_MINALIGN = 10, + VT_BYTESIZE = 12, + VT_ATTRIBUTES = 14, +- VT_DOCUMENTATION = 16 ++ VT_DOCUMENTATION = 16, ++ VT_DECLARATION_FILE = 18 + }; + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); +@@ -751,8 +793,8 @@ + bool KeyCompareLessThan(const Object *o) const { + return *name() < *o->name(); + } +- int KeyCompareWithValue(const char *val) const { +- return strcmp(name()->c_str(), val); ++ int KeyCompareWithValue(const char *_name) const { ++ return strcmp(name()->c_str(), _name); + } + const flatbuffers::Vector> *fields() const { + return GetPointer> *>(VT_FIELDS); +@@ -772,6 +814,10 @@ + const flatbuffers::Vector> *documentation() const { + return GetPointer> *>(VT_DOCUMENTATION); + } ++ /// File that this Object is declared in. ++ const flatbuffers::String *declaration_file() const { ++ return GetPointer(VT_DECLARATION_FILE); ++ } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME) && +@@ -779,15 +825,17 @@ + VerifyOffsetRequired(verifier, VT_FIELDS) && + verifier.VerifyVector(fields()) && + verifier.VerifyVectorOfTables(fields()) && +- VerifyField(verifier, VT_IS_STRUCT) && +- VerifyField(verifier, VT_MINALIGN) && +- VerifyField(verifier, VT_BYTESIZE) && ++ VerifyField(verifier, VT_IS_STRUCT, 1) && ++ VerifyField(verifier, VT_MINALIGN, 4) && ++ VerifyField(verifier, VT_BYTESIZE, 4) && + VerifyOffset(verifier, VT_ATTRIBUTES) && + verifier.VerifyVector(attributes()) && + verifier.VerifyVectorOfTables(attributes()) && + VerifyOffset(verifier, VT_DOCUMENTATION) && + verifier.VerifyVector(documentation()) && + verifier.VerifyVectorOfStrings(documentation()) && ++ VerifyOffset(verifier, VT_DECLARATION_FILE) && ++ verifier.VerifyString(declaration_file()) && + verifier.EndTable(); + } + }; +@@ -817,6 +865,9 @@ + void add_documentation(flatbuffers::Offset>> documentation) { + fbb_.AddOffset(Object::VT_DOCUMENTATION, documentation); + } ++ void add_declaration_file(flatbuffers::Offset declaration_file) { ++ fbb_.AddOffset(Object::VT_DECLARATION_FILE, declaration_file); ++ } + explicit ObjectBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); +@@ -838,8 +889,10 @@ + int32_t minalign = 0, + int32_t bytesize = 0, + flatbuffers::Offset>> attributes = 0, +- flatbuffers::Offset>> documentation = 0) { ++ flatbuffers::Offset>> documentation = 0, ++ flatbuffers::Offset declaration_file = 0) { + ObjectBuilder builder_(_fbb); ++ builder_.add_declaration_file(declaration_file); + builder_.add_documentation(documentation); + builder_.add_attributes(attributes); + builder_.add_bytesize(bytesize); +@@ -858,11 +911,13 @@ + int32_t minalign = 0, + int32_t bytesize = 0, + std::vector> *attributes = nullptr, +- const std::vector> *documentation = nullptr) { ++ const std::vector> *documentation = nullptr, ++ const char *declaration_file = nullptr) { + auto name__ = name ? _fbb.CreateString(name) : 0; + auto fields__ = fields ? _fbb.CreateVectorOfSortedTables(fields) : 0; + auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables(attributes) : 0; + auto documentation__ = documentation ? _fbb.CreateVector>(*documentation) : 0; ++ auto declaration_file__ = declaration_file ? _fbb.CreateString(declaration_file) : 0; + return reflection::CreateObject( + _fbb, + name__, +@@ -871,7 +926,8 @@ + minalign, + bytesize, + attributes__, +- documentation__); ++ documentation__, ++ declaration_file__); + } + + struct RPCCall FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +@@ -889,8 +945,8 @@ + bool KeyCompareLessThan(const RPCCall *o) const { + return *name() < *o->name(); + } +- int KeyCompareWithValue(const char *val) const { +- return strcmp(name()->c_str(), val); ++ int KeyCompareWithValue(const char *_name) const { ++ return strcmp(name()->c_str(), _name); + } + const reflection::Object *request() const { + return GetPointer(VT_REQUEST); +@@ -996,7 +1052,8 @@ + VT_NAME = 4, + VT_CALLS = 6, + VT_ATTRIBUTES = 8, +- VT_DOCUMENTATION = 10 ++ VT_DOCUMENTATION = 10, ++ VT_DECLARATION_FILE = 12 + }; + const flatbuffers::String *name() const { + return GetPointer(VT_NAME); +@@ -1004,8 +1061,8 @@ + bool KeyCompareLessThan(const Service *o) const { + return *name() < *o->name(); + } +- int KeyCompareWithValue(const char *val) const { +- return strcmp(name()->c_str(), val); ++ int KeyCompareWithValue(const char *_name) const { ++ return strcmp(name()->c_str(), _name); + } + const flatbuffers::Vector> *calls() const { + return GetPointer> *>(VT_CALLS); +@@ -1016,6 +1073,10 @@ + const flatbuffers::Vector> *documentation() const { + return GetPointer> *>(VT_DOCUMENTATION); + } ++ /// File that this Service is declared in. ++ const flatbuffers::String *declaration_file() const { ++ return GetPointer(VT_DECLARATION_FILE); ++ } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_NAME) && +@@ -1029,6 +1090,8 @@ + VerifyOffset(verifier, VT_DOCUMENTATION) && + verifier.VerifyVector(documentation()) && + verifier.VerifyVectorOfStrings(documentation()) && ++ VerifyOffset(verifier, VT_DECLARATION_FILE) && ++ verifier.VerifyString(declaration_file()) && + verifier.EndTable(); + } + }; +@@ -1049,6 +1112,9 @@ + void add_documentation(flatbuffers::Offset>> documentation) { + fbb_.AddOffset(Service::VT_DOCUMENTATION, documentation); + } ++ void add_declaration_file(flatbuffers::Offset declaration_file) { ++ fbb_.AddOffset(Service::VT_DECLARATION_FILE, declaration_file); ++ } + explicit ServiceBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); +@@ -1066,8 +1132,10 @@ + flatbuffers::Offset name = 0, + flatbuffers::Offset>> calls = 0, + flatbuffers::Offset>> attributes = 0, +- flatbuffers::Offset>> documentation = 0) { ++ flatbuffers::Offset>> documentation = 0, ++ flatbuffers::Offset declaration_file = 0) { + ServiceBuilder builder_(_fbb); ++ builder_.add_declaration_file(declaration_file); + builder_.add_documentation(documentation); + builder_.add_attributes(attributes); + builder_.add_calls(calls); +@@ -1080,17 +1148,98 @@ + const char *name = nullptr, + std::vector> *calls = nullptr, + std::vector> *attributes = nullptr, +- const std::vector> *documentation = nullptr) { ++ const std::vector> *documentation = nullptr, ++ const char *declaration_file = nullptr) { + auto name__ = name ? _fbb.CreateString(name) : 0; + auto calls__ = calls ? _fbb.CreateVectorOfSortedTables(calls) : 0; + auto attributes__ = attributes ? _fbb.CreateVectorOfSortedTables(attributes) : 0; + auto documentation__ = documentation ? _fbb.CreateVector>(*documentation) : 0; ++ auto declaration_file__ = declaration_file ? _fbb.CreateString(declaration_file) : 0; + return reflection::CreateService( + _fbb, + name__, + calls__, + attributes__, +- documentation__); ++ documentation__, ++ declaration_file__); ++} ++ ++/// File specific information. ++/// Symbols declared within a file may be recovered by iterating over all ++/// symbols and examining the `declaration_file` field. ++struct SchemaFile FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { ++ typedef SchemaFileBuilder Builder; ++ enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { ++ VT_FILENAME = 4, ++ VT_INCLUDED_FILENAMES = 6 ++ }; ++ /// Filename, relative to project root. ++ const flatbuffers::String *filename() const { ++ return GetPointer(VT_FILENAME); ++ } ++ bool KeyCompareLessThan(const SchemaFile *o) const { ++ return *filename() < *o->filename(); ++ } ++ int KeyCompareWithValue(const char *_filename) const { ++ return strcmp(filename()->c_str(), _filename); ++ } ++ /// Names of included files, relative to project root. ++ const flatbuffers::Vector> *included_filenames() const { ++ return GetPointer> *>(VT_INCLUDED_FILENAMES); ++ } ++ bool Verify(flatbuffers::Verifier &verifier) const { ++ return VerifyTableStart(verifier) && ++ VerifyOffsetRequired(verifier, VT_FILENAME) && ++ verifier.VerifyString(filename()) && ++ VerifyOffset(verifier, VT_INCLUDED_FILENAMES) && ++ verifier.VerifyVector(included_filenames()) && ++ verifier.VerifyVectorOfStrings(included_filenames()) && ++ verifier.EndTable(); ++ } ++}; ++ ++struct SchemaFileBuilder { ++ typedef SchemaFile Table; ++ flatbuffers::FlatBufferBuilder &fbb_; ++ flatbuffers::uoffset_t start_; ++ void add_filename(flatbuffers::Offset filename) { ++ fbb_.AddOffset(SchemaFile::VT_FILENAME, filename); ++ } ++ void add_included_filenames(flatbuffers::Offset>> included_filenames) { ++ fbb_.AddOffset(SchemaFile::VT_INCLUDED_FILENAMES, included_filenames); ++ } ++ explicit SchemaFileBuilder(flatbuffers::FlatBufferBuilder &_fbb) ++ : fbb_(_fbb) { ++ start_ = fbb_.StartTable(); ++ } ++ flatbuffers::Offset Finish() { ++ const auto end = fbb_.EndTable(start_); ++ auto o = flatbuffers::Offset(end); ++ fbb_.Required(o, SchemaFile::VT_FILENAME); ++ return o; ++ } ++}; ++ ++inline flatbuffers::Offset CreateSchemaFile( ++ flatbuffers::FlatBufferBuilder &_fbb, ++ flatbuffers::Offset filename = 0, ++ flatbuffers::Offset>> included_filenames = 0) { ++ SchemaFileBuilder builder_(_fbb); ++ builder_.add_included_filenames(included_filenames); ++ builder_.add_filename(filename); ++ return builder_.Finish(); ++} ++ ++inline flatbuffers::Offset CreateSchemaFileDirect( ++ flatbuffers::FlatBufferBuilder &_fbb, ++ const char *filename = nullptr, ++ const std::vector> *included_filenames = nullptr) { ++ auto filename__ = filename ? _fbb.CreateString(filename) : 0; ++ auto included_filenames__ = included_filenames ? _fbb.CreateVector>(*included_filenames) : 0; ++ return reflection::CreateSchemaFile( ++ _fbb, ++ filename__, ++ included_filenames__); + } + + struct Schema FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { +@@ -1102,7 +1251,8 @@ + VT_FILE_EXT = 10, + VT_ROOT_TABLE = 12, + VT_SERVICES = 14, +- VT_ADVANCED_FEATURES = 16 ++ VT_ADVANCED_FEATURES = 16, ++ VT_FBS_FILES = 18 + }; + const flatbuffers::Vector> *objects() const { + return GetPointer> *>(VT_OBJECTS); +@@ -1125,6 +1275,11 @@ + reflection::AdvancedFeatures advanced_features() const { + return static_cast(GetField(VT_ADVANCED_FEATURES, 0)); + } ++ /// All the files used in this compilation. Files are relative to where ++ /// flatc was invoked. ++ const flatbuffers::Vector> *fbs_files() const { ++ return GetPointer> *>(VT_FBS_FILES); ++ } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffsetRequired(verifier, VT_OBJECTS) && +@@ -1142,7 +1297,10 @@ + VerifyOffset(verifier, VT_SERVICES) && + verifier.VerifyVector(services()) && + verifier.VerifyVectorOfTables(services()) && +- VerifyField(verifier, VT_ADVANCED_FEATURES) && ++ VerifyField(verifier, VT_ADVANCED_FEATURES, 8) && ++ VerifyOffset(verifier, VT_FBS_FILES) && ++ verifier.VerifyVector(fbs_files()) && ++ verifier.VerifyVectorOfTables(fbs_files()) && + verifier.EndTable(); + } + }; +@@ -1172,6 +1330,9 @@ + void add_advanced_features(reflection::AdvancedFeatures advanced_features) { + fbb_.AddElement(Schema::VT_ADVANCED_FEATURES, static_cast(advanced_features), 0); + } ++ void add_fbs_files(flatbuffers::Offset>> fbs_files) { ++ fbb_.AddOffset(Schema::VT_FBS_FILES, fbs_files); ++ } + explicit SchemaBuilder(flatbuffers::FlatBufferBuilder &_fbb) + : fbb_(_fbb) { + start_ = fbb_.StartTable(); +@@ -1193,9 +1354,11 @@ + flatbuffers::Offset file_ext = 0, + flatbuffers::Offset root_table = 0, + flatbuffers::Offset>> services = 0, +- reflection::AdvancedFeatures advanced_features = static_cast(0)) { ++ reflection::AdvancedFeatures advanced_features = static_cast(0), ++ flatbuffers::Offset>> fbs_files = 0) { + SchemaBuilder builder_(_fbb); + builder_.add_advanced_features(advanced_features); ++ builder_.add_fbs_files(fbs_files); + builder_.add_services(services); + builder_.add_root_table(root_table); + builder_.add_file_ext(file_ext); +@@ -1213,12 +1376,14 @@ + const char *file_ext = nullptr, + flatbuffers::Offset root_table = 0, + std::vector> *services = nullptr, +- reflection::AdvancedFeatures advanced_features = static_cast(0)) { ++ reflection::AdvancedFeatures advanced_features = static_cast(0), ++ std::vector> *fbs_files = nullptr) { + auto objects__ = objects ? _fbb.CreateVectorOfSortedTables(objects) : 0; + auto enums__ = enums ? _fbb.CreateVectorOfSortedTables(enums) : 0; + auto file_ident__ = file_ident ? _fbb.CreateString(file_ident) : 0; + auto file_ext__ = file_ext ? _fbb.CreateString(file_ext) : 0; + auto services__ = services ? _fbb.CreateVectorOfSortedTables(services) : 0; ++ auto fbs_files__ = fbs_files ? _fbb.CreateVectorOfSortedTables(fbs_files) : 0; + return reflection::CreateSchema( + _fbb, + objects__, +@@ -1227,7 +1392,8 @@ + file_ext__, + root_table, + services__, +- advanced_features); ++ advanced_features, ++ fbs_files__); + } + + inline const reflection::Schema *GetSchema(const void *buf) { +@@ -1247,6 +1413,11 @@ + buf, SchemaIdentifier()); + } + ++inline bool SizePrefixedSchemaBufferHasIdentifier(const void *buf) { ++ return flatbuffers::BufferHasIdentifier( ++ buf, SchemaIdentifier(), true); ++} ++ + inline bool VerifySchemaBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(SchemaIdentifier()); +diff -urN a/include/flatbuffers/registry.h b/include/flatbuffers/registry.h +--- a/include/flatbuffers/registry.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/include/flatbuffers/registry.h 2023-01-13 07:47:06.300228238 +0000 +@@ -17,6 +17,7 @@ + #ifndef FLATBUFFERS_REGISTRY_H_ + #define FLATBUFFERS_REGISTRY_H_ + ++#include "flatbuffers/base.h" + #include "flatbuffers/idl.h" + + namespace flatbuffers { +@@ -40,13 +41,13 @@ + bool FlatBufferToText(const uint8_t *flatbuf, size_t len, std::string *dest) { + // Get the identifier out of the buffer. + // If the buffer is truncated, exit. +- if (len < sizeof(uoffset_t) + FlatBufferBuilder::kFileIdentifierLength) { ++ if (len < sizeof(uoffset_t) + kFileIdentifierLength) { + lasterror_ = "buffer truncated"; + return false; + } + std::string ident( + reinterpret_cast(flatbuf) + sizeof(uoffset_t), +- FlatBufferBuilder::kFileIdentifierLength); ++ kFileIdentifierLength); + // Load and parse the schema. + Parser parser; + if (!LoadSchema(ident, &parser)) return false; +@@ -103,7 +104,7 @@ + } + // Parse schema. + parser->opts = opts_; +- if (!parser->Parse(schematext.c_str(), vector_data(include_paths_), ++ if (!parser->Parse(schematext.c_str(), include_paths_.data(), + schema.path_.c_str())) { + lasterror_ = parser->error_; + return false; +diff -urN a/include/flatbuffers/stl_emulation.h b/include/flatbuffers/stl_emulation.h +--- a/include/flatbuffers/stl_emulation.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/include/flatbuffers/stl_emulation.h 2023-01-13 07:47:06.300228238 +0000 +@@ -26,14 +26,6 @@ + #include + #include + +-#if defined(_STLPORT_VERSION) && !defined(FLATBUFFERS_CPP98_STL) +- #define FLATBUFFERS_CPP98_STL +-#endif // defined(_STLPORT_VERSION) && !defined(FLATBUFFERS_CPP98_STL) +- +-#if defined(FLATBUFFERS_CPP98_STL) +- #include +-#endif // defined(FLATBUFFERS_CPP98_STL) +- + // Detect C++17 compatible compiler. + // __cplusplus >= 201703L - a compiler has support of 'static inline' variables. + #if defined(FLATBUFFERS_USE_STD_OPTIONAL) \ +@@ -55,7 +47,7 @@ + #endif + #else + // Disable non-trivial ctors if FLATBUFFERS_SPAN_MINIMAL defined. +- #if !defined(FLATBUFFERS_TEMPLATES_ALIASES) || defined(FLATBUFFERS_CPP98_STL) ++ #if !defined(FLATBUFFERS_TEMPLATES_ALIASES) + #define FLATBUFFERS_SPAN_MINIMAL + #else + // Enable implicit construction of a span from a std::array. +@@ -63,135 +55,32 @@ + #endif + #endif // defined(FLATBUFFERS_USE_STD_SPAN) + +-// This header provides backwards compatibility for C++98 STLs like stlport. ++// This header provides backwards compatibility for older versions of the STL. + namespace flatbuffers { + +-// Retrieve ::back() from a string in a way that is compatible with pre C++11 +-// STLs (e.g stlport). +-inline char& string_back(std::string &value) { +- return value[value.length() - 1]; +-} +- +-inline char string_back(const std::string &value) { +- return value[value.length() - 1]; +-} +- +-// Helper method that retrieves ::data() from a vector in a way that is +-// compatible with pre C++11 STLs (e.g stlport). +-template inline T *vector_data(std::vector &vector) { +- // In some debug environments, operator[] does bounds checking, so &vector[0] +- // can't be used. +- return vector.empty() ? nullptr : &vector[0]; +-} +- +-template inline const T *vector_data( +- const std::vector &vector) { +- return vector.empty() ? nullptr : &vector[0]; +-} +- +-template +-inline void vector_emplace_back(std::vector *vector, V &&data) { +- #if defined(FLATBUFFERS_CPP98_STL) +- vector->push_back(data); +- #else +- vector->emplace_back(std::forward(data)); +- #endif // defined(FLATBUFFERS_CPP98_STL) +-} +- +-#ifndef FLATBUFFERS_CPP98_STL +- #if defined(FLATBUFFERS_TEMPLATES_ALIASES) +- template +- using numeric_limits = std::numeric_limits; +- #else +- template class numeric_limits : +- public std::numeric_limits {}; +- #endif // defined(FLATBUFFERS_TEMPLATES_ALIASES) ++#if defined(FLATBUFFERS_TEMPLATES_ALIASES) ++ template ++ using numeric_limits = std::numeric_limits; + #else + template class numeric_limits : +- public std::numeric_limits { +- public: +- // Android NDK fix. +- static T lowest() { +- return std::numeric_limits::min(); +- } +- }; +- +- template <> class numeric_limits : +- public std::numeric_limits { +- public: +- static float lowest() { return -FLT_MAX; } +- }; +- +- template <> class numeric_limits : +- public std::numeric_limits { +- public: +- static double lowest() { return -DBL_MAX; } +- }; +- +- template <> class numeric_limits { +- public: +- static unsigned long long min() { return 0ULL; } +- static unsigned long long max() { return ~0ULL; } +- static unsigned long long lowest() { +- return numeric_limits::min(); +- } +- }; +- +- template <> class numeric_limits { +- public: +- static long long min() { +- return static_cast(1ULL << ((sizeof(long long) << 3) - 1)); +- } +- static long long max() { +- return static_cast( +- (1ULL << ((sizeof(long long) << 3) - 1)) - 1); +- } +- static long long lowest() { +- return numeric_limits::min(); +- } +- }; +-#endif // FLATBUFFERS_CPP98_STL ++ public std::numeric_limits {}; ++#endif // defined(FLATBUFFERS_TEMPLATES_ALIASES) + + #if defined(FLATBUFFERS_TEMPLATES_ALIASES) +- #ifndef FLATBUFFERS_CPP98_STL +- template using is_scalar = std::is_scalar; +- template using is_same = std::is_same; +- template using is_floating_point = std::is_floating_point; +- template using is_unsigned = std::is_unsigned; +- template using is_enum = std::is_enum; +- template using make_unsigned = std::make_unsigned; +- template +- using conditional = std::conditional; +- template +- using integral_constant = std::integral_constant; +- template +- using bool_constant = integral_constant; +- #else +- // Map C++ TR1 templates defined by stlport. +- template using is_scalar = std::tr1::is_scalar; +- template using is_same = std::tr1::is_same; +- template using is_floating_point = +- std::tr1::is_floating_point; +- template using is_unsigned = std::tr1::is_unsigned; +- template using is_enum = std::tr1::is_enum; +- // Android NDK doesn't have std::make_unsigned or std::tr1::make_unsigned. +- template struct make_unsigned { +- static_assert(is_unsigned::value, "Specialization not implemented!"); +- using type = T; +- }; +- template<> struct make_unsigned { using type = unsigned char; }; +- template<> struct make_unsigned { using type = unsigned short; }; +- template<> struct make_unsigned { using type = unsigned int; }; +- template<> struct make_unsigned { using type = unsigned long; }; +- template<> +- struct make_unsigned { using type = unsigned long long; }; +- template +- using conditional = std::tr1::conditional; +- template +- using integral_constant = std::tr1::integral_constant; +- template +- using bool_constant = integral_constant; +- #endif // !FLATBUFFERS_CPP98_STL ++ template using is_scalar = std::is_scalar; ++ template using is_same = std::is_same; ++ template using is_floating_point = std::is_floating_point; ++ template using is_unsigned = std::is_unsigned; ++ template using is_enum = std::is_enum; ++ template using make_unsigned = std::make_unsigned; ++ template ++ using conditional = std::conditional; ++ template ++ using integral_constant = std::integral_constant; ++ template ++ using bool_constant = integral_constant; ++ using true_type = std::true_type; ++ using false_type = std::false_type; + #else + // MSVC 2010 doesn't support C++11 aliases. + template struct is_scalar : public std::is_scalar {}; +@@ -207,126 +96,37 @@ + struct integral_constant : public std::integral_constant {}; + template + struct bool_constant : public integral_constant {}; ++ typedef bool_constant true_type; ++ typedef bool_constant false_type; + #endif // defined(FLATBUFFERS_TEMPLATES_ALIASES) + +-#ifndef FLATBUFFERS_CPP98_STL +- #if defined(FLATBUFFERS_TEMPLATES_ALIASES) +- template using unique_ptr = std::unique_ptr; +- #else +- // MSVC 2010 doesn't support C++11 aliases. +- // We're manually "aliasing" the class here as we want to bring unique_ptr +- // into the flatbuffers namespace. We have unique_ptr in the flatbuffers +- // namespace we have a completely independent implementation (see below) +- // for C++98 STL implementations. +- template class unique_ptr : public std::unique_ptr { +- public: +- unique_ptr() {} +- explicit unique_ptr(T* p) : std::unique_ptr(p) {} +- unique_ptr(std::unique_ptr&& u) { *this = std::move(u); } +- unique_ptr(unique_ptr&& u) { *this = std::move(u); } +- unique_ptr& operator=(std::unique_ptr&& u) { +- std::unique_ptr::reset(u.release()); +- return *this; +- } +- unique_ptr& operator=(unique_ptr&& u) { +- std::unique_ptr::reset(u.release()); +- return *this; +- } +- unique_ptr& operator=(T* p) { +- return std::unique_ptr::operator=(p); +- } +- }; +- #endif // defined(FLATBUFFERS_TEMPLATES_ALIASES) ++#if defined(FLATBUFFERS_TEMPLATES_ALIASES) ++ template using unique_ptr = std::unique_ptr; + #else +- // Very limited implementation of unique_ptr. +- // This is provided simply to allow the C++ code generated from the default +- // settings to function in C++98 environments with no modifications. +- template class unique_ptr { +- public: +- typedef T element_type; +- +- unique_ptr() : ptr_(nullptr) {} +- explicit unique_ptr(T* p) : ptr_(p) {} +- unique_ptr(unique_ptr&& u) : ptr_(nullptr) { reset(u.release()); } +- unique_ptr(const unique_ptr& u) : ptr_(nullptr) { +- reset(const_cast(&u)->release()); +- } +- ~unique_ptr() { reset(); } +- +- unique_ptr& operator=(const unique_ptr& u) { +- reset(const_cast(&u)->release()); ++ // MSVC 2010 doesn't support C++11 aliases. ++ // We're manually "aliasing" the class here as we want to bring unique_ptr ++ // into the flatbuffers namespace. We have unique_ptr in the flatbuffers ++ // namespace we have a completely independent implementation (see below) ++ // for C++98 STL implementations. ++ template class unique_ptr : public std::unique_ptr { ++ public: ++ unique_ptr() {} ++ explicit unique_ptr(T* p) : std::unique_ptr(p) {} ++ unique_ptr(std::unique_ptr&& u) { *this = std::move(u); } ++ unique_ptr(unique_ptr&& u) { *this = std::move(u); } ++ unique_ptr& operator=(std::unique_ptr&& u) { ++ std::unique_ptr::reset(u.release()); + return *this; + } +- + unique_ptr& operator=(unique_ptr&& u) { +- reset(u.release()); ++ std::unique_ptr::reset(u.release()); + return *this; + } +- + unique_ptr& operator=(T* p) { +- reset(p); +- return *this; +- } +- +- const T& operator*() const { return *ptr_; } +- T* operator->() const { return ptr_; } +- T* get() const noexcept { return ptr_; } +- explicit operator bool() const { return ptr_ != nullptr; } +- +- // modifiers +- T* release() { +- T* value = ptr_; +- ptr_ = nullptr; +- return value; ++ return std::unique_ptr::operator=(p); + } +- +- void reset(T* p = nullptr) { +- T* value = ptr_; +- ptr_ = p; +- if (value) delete value; +- } +- +- void swap(unique_ptr& u) { +- T* temp_ptr = ptr_; +- ptr_ = u.ptr_; +- u.ptr_ = temp_ptr; +- } +- +- private: +- T* ptr_; + }; +- +- template bool operator==(const unique_ptr& x, +- const unique_ptr& y) { +- return x.get() == y.get(); +- } +- +- template bool operator==(const unique_ptr& x, +- const D* y) { +- return static_cast(x.get()) == y; +- } +- +- template bool operator==(const unique_ptr& x, intptr_t y) { +- return reinterpret_cast(x.get()) == y; +- } +- +- template bool operator!=(const unique_ptr& x, decltype(nullptr)) { +- return !!x; +- } +- +- template bool operator!=(decltype(nullptr), const unique_ptr& x) { +- return !!x; +- } +- +- template bool operator==(const unique_ptr& x, decltype(nullptr)) { +- return !x; +- } +- +- template bool operator==(decltype(nullptr), const unique_ptr& x) { +- return !x; +- } +- +-#endif // !FLATBUFFERS_CPP98_STL ++#endif // defined(FLATBUFFERS_TEMPLATES_ALIASES) + + #ifdef FLATBUFFERS_USE_STD_OPTIONAL + template +@@ -495,6 +295,32 @@ + int, void>::type; + }; + ++ template ++ struct SpanIterator { ++ // TODO: upgrade to std::random_access_iterator_tag. ++ using iterator_category = std::forward_iterator_tag; ++ using difference_type = std::ptrdiff_t; ++ using value_type = typename std::remove_cv::type; ++ using reference = T&; ++ using pointer = T*; ++ ++ // Convince MSVC compiler that this iterator is trusted (it is verified). ++ #ifdef _MSC_VER ++ using _Unchecked_type = pointer; ++ #endif // _MSC_VER ++ ++ SpanIterator(pointer ptr) : ptr_(ptr) {} ++ reference operator*() const { return *ptr_; } ++ pointer operator->() { return ptr_; } ++ SpanIterator& operator++() { ptr_++; return *this; } ++ SpanIterator operator++(int) { auto tmp = *this; ++(*this); return tmp; } ++ ++ friend bool operator== (const SpanIterator& lhs, const SpanIterator& rhs) { return lhs.ptr_ == rhs.ptr_; } ++ friend bool operator!= (const SpanIterator& lhs, const SpanIterator& rhs) { return lhs.ptr_ != rhs.ptr_; } ++ ++ private: ++ pointer ptr_; ++ }; + } // namespace internal + #endif // !defined(FLATBUFFERS_SPAN_MINIMAL) + +@@ -534,6 +360,17 @@ + return data_; + } + ++ #if !defined(FLATBUFFERS_SPAN_MINIMAL) ++ using Iterator = internal::SpanIterator; ++ using ConstIterator = internal::SpanIterator; ++ ++ Iterator begin() const { return Iterator(data()); } ++ Iterator end() const { return Iterator(data() + size()); } ++ ++ ConstIterator cbegin() const { return ConstIterator(data()); } ++ ConstIterator cend() const { return ConstIterator(data() + size()); } ++ #endif ++ + // Returns a reference to the idx-th element of the sequence. + // The behavior is undefined if the idx is greater than or equal to size(). + FLATBUFFERS_CONSTEXPR_CPP11 reference operator[](size_type idx) const { +@@ -627,46 +464,45 @@ + pointer const data_; + const size_type count_; + }; ++#endif // defined(FLATBUFFERS_USE_STD_SPAN) + +- #if !defined(FLATBUFFERS_SPAN_MINIMAL) +- template +- FLATBUFFERS_CONSTEXPR_CPP11 +- flatbuffers::span make_span(U(&arr)[N]) FLATBUFFERS_NOEXCEPT { +- return span(arr); +- } +- +- template +- FLATBUFFERS_CONSTEXPR_CPP11 +- flatbuffers::span make_span(const U(&arr)[N]) FLATBUFFERS_NOEXCEPT { +- return span(arr); +- } ++#if !defined(FLATBUFFERS_SPAN_MINIMAL) ++template ++FLATBUFFERS_CONSTEXPR_CPP11 ++flatbuffers::span make_span(U(&arr)[N]) FLATBUFFERS_NOEXCEPT { ++ return span(arr); ++} + +- template +- FLATBUFFERS_CONSTEXPR_CPP11 +- flatbuffers::span make_span(std::array &arr) FLATBUFFERS_NOEXCEPT { +- return span(arr); +- } ++template ++FLATBUFFERS_CONSTEXPR_CPP11 ++flatbuffers::span make_span(const U(&arr)[N]) FLATBUFFERS_NOEXCEPT { ++ return span(arr); ++} + +- template +- FLATBUFFERS_CONSTEXPR_CPP11 +- flatbuffers::span make_span(const std::array &arr) FLATBUFFERS_NOEXCEPT { +- return span(arr); +- } ++template ++FLATBUFFERS_CONSTEXPR_CPP11 ++flatbuffers::span make_span(std::array &arr) FLATBUFFERS_NOEXCEPT { ++ return span(arr); ++} + +- template +- FLATBUFFERS_CONSTEXPR_CPP11 +- flatbuffers::span make_span(U *first, std::size_t count) FLATBUFFERS_NOEXCEPT { +- return span(first, count); +- } ++template ++FLATBUFFERS_CONSTEXPR_CPP11 ++flatbuffers::span make_span(const std::array &arr) FLATBUFFERS_NOEXCEPT { ++ return span(arr); ++} + +- template +- FLATBUFFERS_CONSTEXPR_CPP11 +- flatbuffers::span make_span(const U *first, std::size_t count) FLATBUFFERS_NOEXCEPT { +- return span(first, count); +- } +-#endif ++template ++FLATBUFFERS_CONSTEXPR_CPP11 ++flatbuffers::span make_span(U *first, std::size_t count) FLATBUFFERS_NOEXCEPT { ++ return span(first, count); ++} + +-#endif // defined(FLATBUFFERS_USE_STD_SPAN) ++template ++FLATBUFFERS_CONSTEXPR_CPP11 ++flatbuffers::span make_span(const U *first, std::size_t count) FLATBUFFERS_NOEXCEPT { ++ return span(first, count); ++} ++#endif // !defined(FLATBUFFERS_SPAN_MINIMAL) + + } // namespace flatbuffers + +diff -urN a/include/flatbuffers/string.h b/include/flatbuffers/string.h +--- a/include/flatbuffers/string.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/string.h 2023-01-13 07:47:06.301228247 +0000 +@@ -0,0 +1,64 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_STRING_H_ ++#define FLATBUFFERS_STRING_H_ ++ ++#include "flatbuffers/base.h" ++#include "flatbuffers/vector.h" ++ ++namespace flatbuffers { ++ ++struct String : public Vector { ++ const char *c_str() const { return reinterpret_cast(Data()); } ++ std::string str() const { return std::string(c_str(), size()); } ++ ++ // clang-format off ++ #ifdef FLATBUFFERS_HAS_STRING_VIEW ++ flatbuffers::string_view string_view() const { ++ return flatbuffers::string_view(c_str(), size()); ++ } ++ #endif // FLATBUFFERS_HAS_STRING_VIEW ++ // clang-format on ++ ++ bool operator<(const String &o) const { ++ return StringLessThan(this->data(), this->size(), o.data(), o.size()); ++ } ++}; ++ ++// Convenience function to get std::string from a String returning an empty ++// string on null pointer. ++static inline std::string GetString(const String *str) { ++ return str ? str->str() : ""; ++} ++ ++// Convenience function to get char* from a String returning an empty string on ++// null pointer. ++static inline const char *GetCstring(const String *str) { ++ return str ? str->c_str() : ""; ++} ++ ++#ifdef FLATBUFFERS_HAS_STRING_VIEW ++// Convenience function to get string_view from a String returning an empty ++// string_view on null pointer. ++static inline flatbuffers::string_view GetStringView(const String *str) { ++ return str ? str->string_view() : flatbuffers::string_view(); ++} ++#endif // FLATBUFFERS_HAS_STRING_VIEW ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_STRING_H_ +\ No newline at end of file +diff -urN a/include/flatbuffers/struct.h b/include/flatbuffers/struct.h +--- a/include/flatbuffers/struct.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/struct.h 2023-01-13 07:47:06.301228247 +0000 +@@ -0,0 +1,53 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_STRUCT_H_ ++#define FLATBUFFERS_STRUCT_H_ ++ ++#include "flatbuffers/base.h" ++ ++namespace flatbuffers { ++ ++// "structs" are flat structures that do not have an offset table, thus ++// always have all members present and do not support forwards/backwards ++// compatible extensions. ++ ++class Struct FLATBUFFERS_FINAL_CLASS { ++ public: ++ template T GetField(uoffset_t o) const { ++ return ReadScalar(&data_[o]); ++ } ++ ++ template T GetStruct(uoffset_t o) const { ++ return reinterpret_cast(&data_[o]); ++ } ++ ++ const uint8_t *GetAddressOf(uoffset_t o) const { return &data_[o]; } ++ uint8_t *GetAddressOf(uoffset_t o) { return &data_[o]; } ++ ++ private: ++ // private constructor & copy constructor: you obtain instances of this ++ // class by pointing to existing data only ++ Struct(); ++ Struct(const Struct &); ++ Struct &operator=(const Struct &); ++ ++ uint8_t data_[1]; ++}; ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_STRUCT_H_ +\ No newline at end of file +diff -urN a/include/flatbuffers/table.h b/include/flatbuffers/table.h +--- a/include/flatbuffers/table.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/table.h 2023-01-13 07:47:06.301228247 +0000 +@@ -0,0 +1,168 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_TABLE_H_ ++#define FLATBUFFERS_TABLE_H_ ++ ++#include "flatbuffers/base.h" ++#include "flatbuffers/verifier.h" ++ ++namespace flatbuffers { ++ ++// "tables" use an offset table (possibly shared) that allows fields to be ++// omitted and added at will, but uses an extra indirection to read. ++class Table { ++ public: ++ const uint8_t *GetVTable() const { ++ return data_ - ReadScalar(data_); ++ } ++ ++ // This gets the field offset for any of the functions below it, or 0 ++ // if the field was not present. ++ voffset_t GetOptionalFieldOffset(voffset_t field) const { ++ // The vtable offset is always at the start. ++ auto vtable = GetVTable(); ++ // The first element is the size of the vtable (fields + type id + itself). ++ auto vtsize = ReadScalar(vtable); ++ // If the field we're accessing is outside the vtable, we're reading older ++ // data, so it's the same as if the offset was 0 (not present). ++ return field < vtsize ? ReadScalar(vtable + field) : 0; ++ } ++ ++ template T GetField(voffset_t field, T defaultval) const { ++ auto field_offset = GetOptionalFieldOffset(field); ++ return field_offset ? ReadScalar(data_ + field_offset) : defaultval; ++ } ++ ++ template P GetPointer(voffset_t field) { ++ auto field_offset = GetOptionalFieldOffset(field); ++ auto p = data_ + field_offset; ++ return field_offset ? reinterpret_cast

(p + ReadScalar(p)) ++ : nullptr; ++ } ++ template P GetPointer(voffset_t field) const { ++ return const_cast

(this)->GetPointer

(field); ++ } ++ ++ template P GetStruct(voffset_t field) const { ++ auto field_offset = GetOptionalFieldOffset(field); ++ auto p = const_cast(data_ + field_offset); ++ return field_offset ? reinterpret_cast

(p) : nullptr; ++ } ++ ++ template ++ flatbuffers::Optional GetOptional(voffset_t field) const { ++ auto field_offset = GetOptionalFieldOffset(field); ++ auto p = data_ + field_offset; ++ return field_offset ? Optional(static_cast(ReadScalar(p))) ++ : Optional(); ++ } ++ ++ template bool SetField(voffset_t field, T val, T def) { ++ auto field_offset = GetOptionalFieldOffset(field); ++ if (!field_offset) return IsTheSameAs(val, def); ++ WriteScalar(data_ + field_offset, val); ++ return true; ++ } ++ template bool SetField(voffset_t field, T val) { ++ auto field_offset = GetOptionalFieldOffset(field); ++ if (!field_offset) return false; ++ WriteScalar(data_ + field_offset, val); ++ return true; ++ } ++ ++ bool SetPointer(voffset_t field, const uint8_t *val) { ++ auto field_offset = GetOptionalFieldOffset(field); ++ if (!field_offset) return false; ++ WriteScalar(data_ + field_offset, ++ static_cast(val - (data_ + field_offset))); ++ return true; ++ } ++ ++ uint8_t *GetAddressOf(voffset_t field) { ++ auto field_offset = GetOptionalFieldOffset(field); ++ return field_offset ? data_ + field_offset : nullptr; ++ } ++ const uint8_t *GetAddressOf(voffset_t field) const { ++ return const_cast

(this)->GetAddressOf(field); ++ } ++ ++ bool CheckField(voffset_t field) const { ++ return GetOptionalFieldOffset(field) != 0; ++ } ++ ++ // Verify the vtable of this table. ++ // Call this once per table, followed by VerifyField once per field. ++ bool VerifyTableStart(Verifier &verifier) const { ++ return verifier.VerifyTableStart(data_); ++ } ++ ++ // Verify a particular field. ++ template ++ bool VerifyField(const Verifier &verifier, voffset_t field, ++ size_t align) const { ++ // Calling GetOptionalFieldOffset should be safe now thanks to ++ // VerifyTable(). ++ auto field_offset = GetOptionalFieldOffset(field); ++ // Check the actual field. ++ return !field_offset || verifier.VerifyField(data_, field_offset, align); ++ } ++ ++ // VerifyField for required fields. ++ template ++ bool VerifyFieldRequired(const Verifier &verifier, voffset_t field, ++ size_t align) const { ++ auto field_offset = GetOptionalFieldOffset(field); ++ return verifier.Check(field_offset != 0) && ++ verifier.VerifyField(data_, field_offset, align); ++ } ++ ++ // Versions for offsets. ++ bool VerifyOffset(const Verifier &verifier, voffset_t field) const { ++ auto field_offset = GetOptionalFieldOffset(field); ++ return !field_offset || verifier.VerifyOffset(data_, field_offset); ++ } ++ ++ bool VerifyOffsetRequired(const Verifier &verifier, voffset_t field) const { ++ auto field_offset = GetOptionalFieldOffset(field); ++ return verifier.Check(field_offset != 0) && ++ verifier.VerifyOffset(data_, field_offset); ++ } ++ ++ private: ++ // private constructor & copy constructor: you obtain instances of this ++ // class by pointing to existing data only ++ Table(); ++ Table(const Table &other); ++ Table &operator=(const Table &); ++ ++ uint8_t data_[1]; ++}; ++ ++// This specialization allows avoiding warnings like: ++// MSVC C4800: type: forcing value to bool 'true' or 'false'. ++template<> ++inline flatbuffers::Optional Table::GetOptional( ++ voffset_t field) const { ++ auto field_offset = GetOptionalFieldOffset(field); ++ auto p = data_ + field_offset; ++ return field_offset ? Optional(ReadScalar(p) != 0) ++ : Optional(); ++} ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_TABLE_H_ +diff -urN a/include/flatbuffers/util.h b/include/flatbuffers/util.h +--- a/include/flatbuffers/util.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/include/flatbuffers/util.h 2023-01-13 07:47:06.301228247 +0000 +@@ -17,19 +17,20 @@ + #ifndef FLATBUFFERS_UTIL_H_ + #define FLATBUFFERS_UTIL_H_ + ++#include + #include + + #include "flatbuffers/base.h" + #include "flatbuffers/stl_emulation.h" + + #ifndef FLATBUFFERS_PREFER_PRINTF ++# include + # include + #else // FLATBUFFERS_PREFER_PRINTF + # include + # include + #endif // FLATBUFFERS_PREFER_PRINTF + +-#include + #include + + namespace flatbuffers { +@@ -94,7 +95,7 @@ + // Count a single 0 left of the dot for fractional numbers + if (-1 < t && t < 1) digit_count++; + // Count digits until fractional part +- T eps = std::numeric_limits::epsilon(); ++ T eps = std::numeric_limits::epsilon(); + while (t <= (-1 + eps) || (1 - eps) <= t) { + t /= 10; + digit_count++; +@@ -145,20 +146,6 @@ + template<> inline std::string NumToString(char t) { + return NumToString(static_cast(t)); + } +-#if defined(FLATBUFFERS_CPP98_STL) +-template<> inline std::string NumToString(long long t) { +- char buf[21]; // (log((1 << 63) - 1) / log(10)) + 2 +- snprintf(buf, sizeof(buf), "%lld", t); +- return std::string(buf); +-} +- +-template<> +-inline std::string NumToString(unsigned long long t) { +- char buf[22]; // (log((1 << 63) - 1) / log(10)) + 1 +- snprintf(buf, sizeof(buf), "%llu", t); +- return std::string(buf); +-} +-#endif // defined(FLATBUFFERS_CPP98_STL) + + // Special versions for floats/doubles. + template std::string FloatToString(T t, int precision) { +@@ -231,13 +218,13 @@ + }; + + #ifdef _MSC_VER +- #define __strtoull_impl(s, pe, b) _strtoui64_l(s, pe, b, ClassicLocale::Get()) +- #define __strtoll_impl(s, pe, b) _strtoi64_l(s, pe, b, ClassicLocale::Get()) ++ // #define __strtoull_impl(s, pe, b) _strtoui64_l(s, pe, b, ClassicLocale::Get()) ++ // #define __strtoll_impl(s, pe, b) _strtoi64_l(s, pe, b, ClassicLocale::Get()) + #define __strtod_impl(s, pe) _strtod_l(s, pe, ClassicLocale::Get()) + #define __strtof_impl(s, pe) _strtof_l(s, pe, ClassicLocale::Get()) + #else +- #define __strtoull_impl(s, pe, b) strtoull_l(s, pe, b, ClassicLocale::Get()) +- #define __strtoll_impl(s, pe, b) strtoll_l(s, pe, b, ClassicLocale::Get()) ++ //#define __strtoull_impl(s, pe, b) strtoull_l(s, pe, b, ClassicLocale::Get()) ++ //#define __strtoll_impl(s, pe, b) strtoll_l(s, pe, b, ClassicLocale::Get()) + #define __strtod_impl(s, pe) strtod_l(s, pe, ClassicLocale::Get()) + #define __strtof_impl(s, pe) strtof_l(s, pe, ClassicLocale::Get()) + #endif +@@ -245,22 +232,22 @@ + #define __strtod_impl(s, pe) strtod(s, pe) + #define __strtof_impl(s, pe) static_cast(strtod(s, pe)) + #ifdef _MSC_VER +- #define __strtoull_impl(s, pe, b) _strtoui64(s, pe, b) +- #define __strtoll_impl(s, pe, b) _strtoi64(s, pe, b) ++ //#define __strtoull_impl(s, pe, b) _strtoui64(s, pe, b) ++ //#define __strtoll_impl(s, pe, b) _strtoi64(s, pe, b) + #else +- #define __strtoull_impl(s, pe, b) strtoull(s, pe, b) +- #define __strtoll_impl(s, pe, b) strtoll(s, pe, b) ++ //#define __strtoull_impl(s, pe, b) strtoull(s, pe, b) ++ //#define __strtoll_impl(s, pe, b) strtoll(s, pe, b) + #endif + #endif + + inline void strtoval_impl(int64_t *val, const char *str, char **endptr, + int base) { +- *val = __strtoll_impl(str, endptr, base); ++ //*val = __strtoll_impl(str, endptr, base); + } + + inline void strtoval_impl(uint64_t *val, const char *str, char **endptr, + int base) { +- *val = __strtoull_impl(str, endptr, base); ++ //*val = __strtoull_impl(str, endptr, base); + } + + inline void strtoval_impl(double *val, const char *str, char **endptr) { +@@ -272,8 +259,8 @@ + inline void strtoval_impl(float *val, const char *str, char **endptr) { + *val = __strtof_impl(str, endptr); + } +-#undef __strtoull_impl +-#undef __strtoll_impl ++//#undef __strtoull_impl ++//#undef __strtoll_impl + #undef __strtod_impl + #undef __strtof_impl + // clang-format on +@@ -468,6 +455,7 @@ + + // Replaces any '\\' separators with '/' + std::string PosixPath(const char *path); ++std::string PosixPath(const std::string &path); + + // This function ensure a directory exists, by recursively + // creating dirs for any parts of the path that don't exist yet. +@@ -477,6 +465,10 @@ + // Returns the input path if the absolute path couldn't be resolved. + std::string AbsolutePath(const std::string &filepath); + ++// Returns files relative to the --project_root path, prefixed with `//`. ++std::string RelativeToRootPath(const std::string &project, ++ const std::string &filepath); ++ + // To and from UTF-8 unicode conversion functions + + // Convert a unicode code point into a UTF-8 representation by appending it +diff -urN a/include/flatbuffers/vector.h b/include/flatbuffers/vector.h +--- a/include/flatbuffers/vector.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/vector.h 2023-01-13 07:47:06.301228247 +0000 +@@ -0,0 +1,370 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_VECTOR_H_ ++#define FLATBUFFERS_VECTOR_H_ ++ ++#include "flatbuffers/base.h" ++#include "flatbuffers/buffer.h" ++ ++namespace flatbuffers { ++ ++struct String; ++ ++// An STL compatible iterator implementation for Vector below, effectively ++// calling Get() for every element. ++template struct VectorIterator { ++ typedef std::random_access_iterator_tag iterator_category; ++ typedef IT value_type; ++ typedef ptrdiff_t difference_type; ++ typedef IT *pointer; ++ typedef IT &reference; ++ ++ VectorIterator(const uint8_t *data, uoffset_t i) ++ : data_(data + IndirectHelper::element_stride * i) {} ++ VectorIterator(const VectorIterator &other) : data_(other.data_) {} ++ VectorIterator() : data_(nullptr) {} ++ ++ VectorIterator &operator=(const VectorIterator &other) { ++ data_ = other.data_; ++ return *this; ++ } ++ ++ VectorIterator &operator=(VectorIterator &&other) { ++ data_ = other.data_; ++ return *this; ++ } ++ ++ bool operator==(const VectorIterator &other) const { ++ return data_ == other.data_; ++ } ++ ++ bool operator<(const VectorIterator &other) const { ++ return data_ < other.data_; ++ } ++ ++ bool operator!=(const VectorIterator &other) const { ++ return data_ != other.data_; ++ } ++ ++ difference_type operator-(const VectorIterator &other) const { ++ return (data_ - other.data_) / IndirectHelper::element_stride; ++ } ++ ++ // Note: return type is incompatible with the standard ++ // `reference operator*()`. ++ IT operator*() const { return IndirectHelper::Read(data_, 0); } ++ ++ // Note: return type is incompatible with the standard ++ // `pointer operator->()`. ++ IT operator->() const { return IndirectHelper::Read(data_, 0); } ++ ++ VectorIterator &operator++() { ++ data_ += IndirectHelper::element_stride; ++ return *this; ++ } ++ ++ VectorIterator operator++(int) { ++ VectorIterator temp(data_, 0); ++ data_ += IndirectHelper::element_stride; ++ return temp; ++ } ++ ++ VectorIterator operator+(const uoffset_t &offset) const { ++ return VectorIterator(data_ + offset * IndirectHelper::element_stride, ++ 0); ++ } ++ ++ VectorIterator &operator+=(const uoffset_t &offset) { ++ data_ += offset * IndirectHelper::element_stride; ++ return *this; ++ } ++ ++ VectorIterator &operator--() { ++ data_ -= IndirectHelper::element_stride; ++ return *this; ++ } ++ ++ VectorIterator operator--(int) { ++ VectorIterator temp(data_, 0); ++ data_ -= IndirectHelper::element_stride; ++ return temp; ++ } ++ ++ VectorIterator operator-(const uoffset_t &offset) const { ++ return VectorIterator(data_ - offset * IndirectHelper::element_stride, ++ 0); ++ } ++ ++ VectorIterator &operator-=(const uoffset_t &offset) { ++ data_ -= offset * IndirectHelper::element_stride; ++ return *this; ++ } ++ ++ private: ++ const uint8_t *data_; ++}; ++ ++template ++struct VectorReverseIterator : public std::reverse_iterator { ++ explicit VectorReverseIterator(Iterator iter) ++ : std::reverse_iterator(iter) {} ++ ++ // Note: return type is incompatible with the standard ++ // `reference operator*()`. ++ typename Iterator::value_type operator*() const { ++ auto tmp = std::reverse_iterator::current; ++ return *--tmp; ++ } ++ ++ // Note: return type is incompatible with the standard ++ // `pointer operator->()`. ++ typename Iterator::value_type operator->() const { ++ auto tmp = std::reverse_iterator::current; ++ return *--tmp; ++ } ++}; ++ ++// This is used as a helper type for accessing vectors. ++// Vector::data() assumes the vector elements start after the length field. ++template class Vector { ++ public: ++ typedef VectorIterator::mutable_return_type> ++ iterator; ++ typedef VectorIterator::return_type> ++ const_iterator; ++ typedef VectorReverseIterator reverse_iterator; ++ typedef VectorReverseIterator const_reverse_iterator; ++ ++ typedef typename flatbuffers::bool_constant::value> ++ scalar_tag; ++ ++ static FLATBUFFERS_CONSTEXPR bool is_span_observable = ++ scalar_tag::value && (FLATBUFFERS_LITTLEENDIAN || sizeof(T) == 1); ++ ++ uoffset_t size() const { return EndianScalar(length_); } ++ ++ // Deprecated: use size(). Here for backwards compatibility. ++ FLATBUFFERS_ATTRIBUTE([[deprecated("use size() instead")]]) ++ uoffset_t Length() const { return size(); } ++ ++ typedef typename IndirectHelper::return_type return_type; ++ typedef typename IndirectHelper::mutable_return_type mutable_return_type; ++ typedef return_type value_type; ++ ++ return_type Get(uoffset_t i) const { ++ FLATBUFFERS_ASSERT(i < size()); ++ return IndirectHelper::Read(Data(), i); ++ } ++ ++ return_type operator[](uoffset_t i) const { return Get(i); } ++ ++ // If this is a Vector of enums, T will be its storage type, not the enum ++ // type. This function makes it convenient to retrieve value with enum ++ // type E. ++ template E GetEnum(uoffset_t i) const { ++ return static_cast(Get(i)); ++ } ++ ++ // If this a vector of unions, this does the cast for you. There's no check ++ // to make sure this is the right type! ++ template const U *GetAs(uoffset_t i) const { ++ return reinterpret_cast(Get(i)); ++ } ++ ++ // If this a vector of unions, this does the cast for you. There's no check ++ // to make sure this is actually a string! ++ const String *GetAsString(uoffset_t i) const { ++ return reinterpret_cast(Get(i)); ++ } ++ ++ const void *GetStructFromOffset(size_t o) const { ++ return reinterpret_cast(Data() + o); ++ } ++ ++ iterator begin() { return iterator(Data(), 0); } ++ const_iterator begin() const { return const_iterator(Data(), 0); } ++ ++ iterator end() { return iterator(Data(), size()); } ++ const_iterator end() const { return const_iterator(Data(), size()); } ++ ++ reverse_iterator rbegin() { return reverse_iterator(end()); } ++ const_reverse_iterator rbegin() const { ++ return const_reverse_iterator(end()); ++ } ++ ++ reverse_iterator rend() { return reverse_iterator(begin()); } ++ const_reverse_iterator rend() const { ++ return const_reverse_iterator(begin()); ++ } ++ ++ const_iterator cbegin() const { return begin(); } ++ ++ const_iterator cend() const { return end(); } ++ ++ const_reverse_iterator crbegin() const { return rbegin(); } ++ ++ const_reverse_iterator crend() const { return rend(); } ++ ++ // Change elements if you have a non-const pointer to this object. ++ // Scalars only. See reflection.h, and the documentation. ++ void Mutate(uoffset_t i, const T &val) { ++ FLATBUFFERS_ASSERT(i < size()); ++ WriteScalar(data() + i, val); ++ } ++ ++ // Change an element of a vector of tables (or strings). ++ // "val" points to the new table/string, as you can obtain from ++ // e.g. reflection::AddFlatBuffer(). ++ void MutateOffset(uoffset_t i, const uint8_t *val) { ++ FLATBUFFERS_ASSERT(i < size()); ++ static_assert(sizeof(T) == sizeof(uoffset_t), "Unrelated types"); ++ WriteScalar(data() + i, ++ static_cast(val - (Data() + i * sizeof(uoffset_t)))); ++ } ++ ++ // Get a mutable pointer to tables/strings inside this vector. ++ mutable_return_type GetMutableObject(uoffset_t i) const { ++ FLATBUFFERS_ASSERT(i < size()); ++ return const_cast(IndirectHelper::Read(Data(), i)); ++ } ++ ++ // The raw data in little endian format. Use with care. ++ const uint8_t *Data() const { ++ return reinterpret_cast(&length_ + 1); ++ } ++ ++ uint8_t *Data() { return reinterpret_cast(&length_ + 1); } ++ ++ // Similarly, but typed, much like std::vector::data ++ const T *data() const { return reinterpret_cast(Data()); } ++ T *data() { return reinterpret_cast(Data()); } ++ ++ template return_type LookupByKey(K key) const { ++ void *search_result = std::bsearch( ++ &key, Data(), size(), IndirectHelper::element_stride, KeyCompare); ++ ++ if (!search_result) { ++ return nullptr; // Key not found. ++ } ++ ++ const uint8_t *element = reinterpret_cast(search_result); ++ ++ return IndirectHelper::Read(element, 0); ++ } ++ ++ template mutable_return_type MutableLookupByKey(K key) { ++ return const_cast(LookupByKey(key)); ++ } ++ ++ protected: ++ // This class is only used to access pre-existing data. Don't ever ++ // try to construct these manually. ++ Vector(); ++ ++ uoffset_t length_; ++ ++ private: ++ // This class is a pointer. Copying will therefore create an invalid object. ++ // Private and unimplemented copy constructor. ++ Vector(const Vector &); ++ Vector &operator=(const Vector &); ++ ++ template static int KeyCompare(const void *ap, const void *bp) { ++ const K *key = reinterpret_cast(ap); ++ const uint8_t *data = reinterpret_cast(bp); ++ auto table = IndirectHelper::Read(data, 0); ++ ++ // std::bsearch compares with the operands transposed, so we negate the ++ // result here. ++ return -table->KeyCompareWithValue(*key); ++ } ++}; ++ ++template ++FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span(Vector &vec) ++ FLATBUFFERS_NOEXCEPT { ++ static_assert(Vector::is_span_observable, ++ "wrong type U, only LE-scalar, or byte types are allowed"); ++ return span(vec.data(), vec.size()); ++} ++ ++template ++FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span( ++ const Vector &vec) FLATBUFFERS_NOEXCEPT { ++ static_assert(Vector::is_span_observable, ++ "wrong type U, only LE-scalar, or byte types are allowed"); ++ return span(vec.data(), vec.size()); ++} ++ ++template ++FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_bytes_span( ++ Vector &vec) FLATBUFFERS_NOEXCEPT { ++ static_assert(Vector::scalar_tag::value, ++ "wrong type U, only LE-scalar, or byte types are allowed"); ++ return span(vec.Data(), vec.size() * sizeof(U)); ++} ++ ++template ++FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_bytes_span( ++ const Vector &vec) FLATBUFFERS_NOEXCEPT { ++ static_assert(Vector::scalar_tag::value, ++ "wrong type U, only LE-scalar, or byte types are allowed"); ++ return span(vec.Data(), vec.size() * sizeof(U)); ++} ++ ++// Represent a vector much like the template above, but in this case we ++// don't know what the element types are (used with reflection.h). ++class VectorOfAny { ++ public: ++ uoffset_t size() const { return EndianScalar(length_); } ++ ++ const uint8_t *Data() const { ++ return reinterpret_cast(&length_ + 1); ++ } ++ uint8_t *Data() { return reinterpret_cast(&length_ + 1); } ++ ++ protected: ++ VectorOfAny(); ++ ++ uoffset_t length_; ++ ++ private: ++ VectorOfAny(const VectorOfAny &); ++ VectorOfAny &operator=(const VectorOfAny &); ++}; ++ ++template ++Vector> *VectorCast(Vector> *ptr) { ++ static_assert(std::is_base_of::value, "Unrelated types"); ++ return reinterpret_cast> *>(ptr); ++} ++ ++template ++const Vector> *VectorCast(const Vector> *ptr) { ++ static_assert(std::is_base_of::value, "Unrelated types"); ++ return reinterpret_cast> *>(ptr); ++} ++ ++// Convenient helper function to get the length of any vector, regardless ++// of whether it is null or not (the field is not set). ++template static inline size_t VectorLength(const Vector *v) { ++ return v ? v->size() : 0; ++} ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_VERIFIER_H_ +diff -urN a/include/flatbuffers/vector_downward.h b/include/flatbuffers/vector_downward.h +--- a/include/flatbuffers/vector_downward.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/vector_downward.h 2023-01-13 07:47:06.301228247 +0000 +@@ -0,0 +1,271 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_VECTOR_DOWNWARD_H_ ++#define FLATBUFFERS_VECTOR_DOWNWARD_H_ ++ ++#include "flatbuffers/base.h" ++#include "flatbuffers/default_allocator.h" ++#include "flatbuffers/detached_buffer.h" ++ ++namespace flatbuffers { ++ ++// This is a minimal replication of std::vector functionality, ++// except growing from higher to lower addresses. i.e push_back() inserts data ++// in the lowest address in the vector. ++// Since this vector leaves the lower part unused, we support a "scratch-pad" ++// that can be stored there for temporary data, to share the allocated space. ++// Essentially, this supports 2 std::vectors in a single buffer. ++class vector_downward { ++ public: ++ explicit vector_downward(size_t initial_size, Allocator *allocator, ++ bool own_allocator, size_t buffer_minalign) ++ : allocator_(allocator), ++ own_allocator_(own_allocator), ++ initial_size_(initial_size), ++ buffer_minalign_(buffer_minalign), ++ reserved_(0), ++ size_(0), ++ buf_(nullptr), ++ cur_(nullptr), ++ scratch_(nullptr) {} ++ ++ vector_downward(vector_downward &&other) ++ // clang-format on ++ : allocator_(other.allocator_), ++ own_allocator_(other.own_allocator_), ++ initial_size_(other.initial_size_), ++ buffer_minalign_(other.buffer_minalign_), ++ reserved_(other.reserved_), ++ size_(other.size_), ++ buf_(other.buf_), ++ cur_(other.cur_), ++ scratch_(other.scratch_) { ++ // No change in other.allocator_ ++ // No change in other.initial_size_ ++ // No change in other.buffer_minalign_ ++ other.own_allocator_ = false; ++ other.reserved_ = 0; ++ other.buf_ = nullptr; ++ other.cur_ = nullptr; ++ other.scratch_ = nullptr; ++ } ++ ++ vector_downward &operator=(vector_downward &&other) { ++ // Move construct a temporary and swap idiom ++ vector_downward temp(std::move(other)); ++ swap(temp); ++ return *this; ++ } ++ ++ ~vector_downward() { ++ clear_buffer(); ++ clear_allocator(); ++ } ++ ++ void reset() { ++ clear_buffer(); ++ clear(); ++ } ++ ++ void clear() { ++ if (buf_) { ++ cur_ = buf_ + reserved_; ++ } else { ++ reserved_ = 0; ++ cur_ = nullptr; ++ } ++ size_ = 0; ++ clear_scratch(); ++ } ++ ++ void clear_scratch() { scratch_ = buf_; } ++ ++ void clear_allocator() { ++ if (own_allocator_ && allocator_) { delete allocator_; } ++ allocator_ = nullptr; ++ own_allocator_ = false; ++ } ++ ++ void clear_buffer() { ++ if (buf_) Deallocate(allocator_, buf_, reserved_); ++ buf_ = nullptr; ++ } ++ ++ // Relinquish the pointer to the caller. ++ uint8_t *release_raw(size_t &allocated_bytes, size_t &offset) { ++ auto *buf = buf_; ++ allocated_bytes = reserved_; ++ offset = static_cast(cur_ - buf_); ++ ++ // release_raw only relinquishes the buffer ownership. ++ // Does not deallocate or reset the allocator. Destructor will do that. ++ buf_ = nullptr; ++ clear(); ++ return buf; ++ } ++ ++ // Relinquish the pointer to the caller. ++ DetachedBuffer release() { ++ // allocator ownership (if any) is transferred to DetachedBuffer. ++ DetachedBuffer fb(allocator_, own_allocator_, buf_, reserved_, cur_, ++ size()); ++ if (own_allocator_) { ++ allocator_ = nullptr; ++ own_allocator_ = false; ++ } ++ buf_ = nullptr; ++ clear(); ++ return fb; ++ } ++ ++ size_t ensure_space(size_t len) { ++ FLATBUFFERS_ASSERT(cur_ >= scratch_ && scratch_ >= buf_); ++ if (len > static_cast(cur_ - scratch_)) { reallocate(len); } ++ // Beyond this, signed offsets may not have enough range: ++ // (FlatBuffers > 2GB not supported). ++ FLATBUFFERS_ASSERT(size() < FLATBUFFERS_MAX_BUFFER_SIZE); ++ return len; ++ } ++ ++ inline uint8_t *make_space(size_t len) { ++ if (len) { ++ ensure_space(len); ++ cur_ -= len; ++ size_ += static_cast(len); ++ } ++ return cur_; ++ } ++ ++ // Returns nullptr if using the DefaultAllocator. ++ Allocator *get_custom_allocator() { return allocator_; } ++ ++ inline uoffset_t size() const { return size_; } ++ ++ uoffset_t scratch_size() const { ++ return static_cast(scratch_ - buf_); ++ } ++ ++ size_t capacity() const { return reserved_; } ++ ++ uint8_t *data() const { ++ FLATBUFFERS_ASSERT(cur_); ++ return cur_; ++ } ++ ++ uint8_t *scratch_data() const { ++ FLATBUFFERS_ASSERT(buf_); ++ return buf_; ++ } ++ ++ uint8_t *scratch_end() const { ++ FLATBUFFERS_ASSERT(scratch_); ++ return scratch_; ++ } ++ ++ uint8_t *data_at(size_t offset) const { return buf_ + reserved_ - offset; } ++ ++ void push(const uint8_t *bytes, size_t num) { ++ if (num > 0) { memcpy(make_space(num), bytes, num); } ++ } ++ ++ // Specialized version of push() that avoids memcpy call for small data. ++ template void push_small(const T &little_endian_t) { ++ make_space(sizeof(T)); ++ *reinterpret_cast(cur_) = little_endian_t; ++ } ++ ++ template void scratch_push_small(const T &t) { ++ ensure_space(sizeof(T)); ++ *reinterpret_cast(scratch_) = t; ++ scratch_ += sizeof(T); ++ } ++ ++ // fill() is most frequently called with small byte counts (<= 4), ++ // which is why we're using loops rather than calling memset. ++ void fill(size_t zero_pad_bytes) { ++ make_space(zero_pad_bytes); ++ for (size_t i = 0; i < zero_pad_bytes; i++) cur_[i] = 0; ++ } ++ ++ // Version for when we know the size is larger. ++ // Precondition: zero_pad_bytes > 0 ++ void fill_big(size_t zero_pad_bytes) { ++ memset(make_space(zero_pad_bytes), 0, zero_pad_bytes); ++ } ++ ++ void pop(size_t bytes_to_remove) { ++ cur_ += bytes_to_remove; ++ size_ -= static_cast(bytes_to_remove); ++ } ++ ++ void scratch_pop(size_t bytes_to_remove) { scratch_ -= bytes_to_remove; } ++ ++ void swap(vector_downward &other) { ++ using std::swap; ++ swap(allocator_, other.allocator_); ++ swap(own_allocator_, other.own_allocator_); ++ swap(initial_size_, other.initial_size_); ++ swap(buffer_minalign_, other.buffer_minalign_); ++ swap(reserved_, other.reserved_); ++ swap(size_, other.size_); ++ swap(buf_, other.buf_); ++ swap(cur_, other.cur_); ++ swap(scratch_, other.scratch_); ++ } ++ ++ void swap_allocator(vector_downward &other) { ++ using std::swap; ++ swap(allocator_, other.allocator_); ++ swap(own_allocator_, other.own_allocator_); ++ } ++ ++ private: ++ // You shouldn't really be copying instances of this class. ++ FLATBUFFERS_DELETE_FUNC(vector_downward(const vector_downward &)); ++ FLATBUFFERS_DELETE_FUNC(vector_downward &operator=(const vector_downward &)); ++ ++ Allocator *allocator_; ++ bool own_allocator_; ++ size_t initial_size_; ++ size_t buffer_minalign_; ++ size_t reserved_; ++ uoffset_t size_; ++ uint8_t *buf_; ++ uint8_t *cur_; // Points at location between empty (below) and used (above). ++ uint8_t *scratch_; // Points to the end of the scratchpad in use. ++ ++ void reallocate(size_t len) { ++ auto old_reserved = reserved_; ++ auto old_size = size(); ++ auto old_scratch_size = scratch_size(); ++ reserved_ += ++ (std::max)(len, old_reserved ? old_reserved / 2 : initial_size_); ++ reserved_ = (reserved_ + buffer_minalign_ - 1) & ~(buffer_minalign_ - 1); ++ if (buf_) { ++ buf_ = ReallocateDownward(allocator_, buf_, old_reserved, reserved_, ++ old_size, old_scratch_size); ++ } else { ++ buf_ = Allocate(allocator_, reserved_); ++ } ++ cur_ = buf_ + reserved_ - old_size; ++ scratch_ = buf_ + old_scratch_size; ++ } ++}; ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_VECTOR_DOWNWARD_H_ +diff -urN a/include/flatbuffers/verifier.h b/include/flatbuffers/verifier.h +--- a/include/flatbuffers/verifier.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/include/flatbuffers/verifier.h 2023-01-13 07:47:06.301228247 +0000 +@@ -0,0 +1,283 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_VERIFIER_H_ ++#define FLATBUFFERS_VERIFIER_H_ ++ ++#include "flatbuffers/base.h" ++#include "flatbuffers/util.h" ++#include "flatbuffers/vector.h" ++ ++namespace flatbuffers { ++ ++// Helper class to verify the integrity of a FlatBuffer ++class Verifier FLATBUFFERS_FINAL_CLASS { ++ public: ++ Verifier(const uint8_t *buf, size_t buf_len, uoffset_t _max_depth = 64, ++ uoffset_t _max_tables = 1000000, bool _check_alignment = true) ++ : buf_(buf), ++ size_(buf_len), ++ depth_(0), ++ max_depth_(_max_depth), ++ num_tables_(0), ++ max_tables_(_max_tables), ++ upper_bound_(0), ++ check_alignment_(_check_alignment), ++ flex_reuse_tracker_(nullptr) { ++ FLATBUFFERS_ASSERT(size_ < FLATBUFFERS_MAX_BUFFER_SIZE); ++ } ++ ++ // Central location where any verification failures register. ++ bool Check(bool ok) const { ++ // clang-format off ++ #ifdef FLATBUFFERS_DEBUG_VERIFICATION_FAILURE ++ FLATBUFFERS_ASSERT(ok); ++ #endif ++ #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE ++ if (!ok) ++ upper_bound_ = 0; ++ #endif ++ // clang-format on ++ return ok; ++ } ++ ++ // Verify any range within the buffer. ++ bool Verify(size_t elem, size_t elem_len) const { ++ // clang-format off ++ #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE ++ auto upper_bound = elem + elem_len; ++ if (upper_bound_ < upper_bound) ++ upper_bound_ = upper_bound; ++ #endif ++ // clang-format on ++ return Check(elem_len < size_ && elem <= size_ - elem_len); ++ } ++ ++ bool VerifyAlignment(size_t elem, size_t align) const { ++ return Check((elem & (align - 1)) == 0 || !check_alignment_); ++ } ++ ++ // Verify a range indicated by sizeof(T). ++ template bool Verify(size_t elem) const { ++ return VerifyAlignment(elem, sizeof(T)) && Verify(elem, sizeof(T)); ++ } ++ ++ bool VerifyFromPointer(const uint8_t *p, size_t len) { ++ auto o = static_cast(p - buf_); ++ return Verify(o, len); ++ } ++ ++ // Verify relative to a known-good base pointer. ++ bool VerifyFieldStruct(const uint8_t *base, voffset_t elem_off, ++ size_t elem_len, size_t align) const { ++ auto f = static_cast(base - buf_) + elem_off; ++ return VerifyAlignment(f, align) && Verify(f, elem_len); ++ } ++ ++ template ++ bool VerifyField(const uint8_t *base, voffset_t elem_off, ++ size_t align) const { ++ auto f = static_cast(base - buf_) + elem_off; ++ return VerifyAlignment(f, align) && Verify(f, sizeof(T)); ++ } ++ ++ // Verify a pointer (may be NULL) of a table type. ++ template bool VerifyTable(const T *table) { ++ return !table || table->Verify(*this); ++ } ++ ++ // Verify a pointer (may be NULL) of any vector type. ++ template bool VerifyVector(const Vector *vec) const { ++ return !vec || VerifyVectorOrString(reinterpret_cast(vec), ++ sizeof(T)); ++ } ++ ++ // Verify a pointer (may be NULL) of a vector to struct. ++ template bool VerifyVector(const Vector *vec) const { ++ return VerifyVector(reinterpret_cast *>(vec)); ++ } ++ ++ // Verify a pointer (may be NULL) to string. ++ bool VerifyString(const String *str) const { ++ size_t end; ++ return !str || (VerifyVectorOrString(reinterpret_cast(str), ++ 1, &end) && ++ Verify(end, 1) && // Must have terminator ++ Check(buf_[end] == '\0')); // Terminating byte must be 0. ++ } ++ ++ // Common code between vectors and strings. ++ bool VerifyVectorOrString(const uint8_t *vec, size_t elem_size, ++ size_t *end = nullptr) const { ++ auto veco = static_cast(vec - buf_); ++ // Check we can read the size field. ++ if (!Verify(veco)) return false; ++ // Check the whole array. If this is a string, the byte past the array ++ // must be 0. ++ auto size = ReadScalar(vec); ++ auto max_elems = FLATBUFFERS_MAX_BUFFER_SIZE / elem_size; ++ if (!Check(size < max_elems)) ++ return false; // Protect against byte_size overflowing. ++ auto byte_size = sizeof(size) + elem_size * size; ++ if (end) *end = veco + byte_size; ++ return Verify(veco, byte_size); ++ } ++ ++ // Special case for string contents, after the above has been called. ++ bool VerifyVectorOfStrings(const Vector> *vec) const { ++ if (vec) { ++ for (uoffset_t i = 0; i < vec->size(); i++) { ++ if (!VerifyString(vec->Get(i))) return false; ++ } ++ } ++ return true; ++ } ++ ++ // Special case for table contents, after the above has been called. ++ template bool VerifyVectorOfTables(const Vector> *vec) { ++ if (vec) { ++ for (uoffset_t i = 0; i < vec->size(); i++) { ++ if (!vec->Get(i)->Verify(*this)) return false; ++ } ++ } ++ return true; ++ } ++ ++ __supress_ubsan__("unsigned-integer-overflow") bool VerifyTableStart( ++ const uint8_t *table) { ++ // Check the vtable offset. ++ auto tableo = static_cast(table - buf_); ++ if (!Verify(tableo)) return false; ++ // This offset may be signed, but doing the subtraction unsigned always ++ // gives the result we want. ++ auto vtableo = tableo - static_cast(ReadScalar(table)); ++ // Check the vtable size field, then check vtable fits in its entirety. ++ return VerifyComplexity() && Verify(vtableo) && ++ VerifyAlignment(ReadScalar(buf_ + vtableo), ++ sizeof(voffset_t)) && ++ Verify(vtableo, ReadScalar(buf_ + vtableo)); ++ } ++ ++ template ++ bool VerifyBufferFromStart(const char *identifier, size_t start) { ++ if (identifier && !Check((size_ >= 2 * sizeof(flatbuffers::uoffset_t) && ++ BufferHasIdentifier(buf_ + start, identifier)))) { ++ return false; ++ } ++ ++ // Call T::Verify, which must be in the generated code for this type. ++ auto o = VerifyOffset(start); ++ return o && reinterpret_cast(buf_ + start + o)->Verify(*this) ++ // clang-format off ++ #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE ++ && GetComputedSize() ++ #endif ++ ; ++ // clang-format on ++ } ++ ++ template ++ bool VerifyNestedFlatBuffer(const Vector *buf, ++ const char *identifier) { ++ if (!buf) return true; ++ Verifier nested_verifier(buf->data(), buf->size()); ++ return nested_verifier.VerifyBuffer(identifier); ++ } ++ ++ // Verify this whole buffer, starting with root type T. ++ template bool VerifyBuffer() { return VerifyBuffer(nullptr); } ++ ++ template bool VerifyBuffer(const char *identifier) { ++ return VerifyBufferFromStart(identifier, 0); ++ } ++ ++ template bool VerifySizePrefixedBuffer(const char *identifier) { ++ return Verify(0U) && ++ ReadScalar(buf_) == size_ - sizeof(uoffset_t) && ++ VerifyBufferFromStart(identifier, sizeof(uoffset_t)); ++ } ++ ++ uoffset_t VerifyOffset(size_t start) const { ++ if (!Verify(start)) return 0; ++ auto o = ReadScalar(buf_ + start); ++ // May not point to itself. ++ if (!Check(o != 0)) return 0; ++ // Can't wrap around / buffers are max 2GB. ++ if (!Check(static_cast(o) >= 0)) return 0; ++ // Must be inside the buffer to create a pointer from it (pointer outside ++ // buffer is UB). ++ if (!Verify(start + o, 1)) return 0; ++ return o; ++ } ++ ++ uoffset_t VerifyOffset(const uint8_t *base, voffset_t start) const { ++ return VerifyOffset(static_cast(base - buf_) + start); ++ } ++ ++ // Called at the start of a table to increase counters measuring data ++ // structure depth and amount, and possibly bails out with false if ++ // limits set by the constructor have been hit. Needs to be balanced ++ // with EndTable(). ++ bool VerifyComplexity() { ++ depth_++; ++ num_tables_++; ++ return Check(depth_ <= max_depth_ && num_tables_ <= max_tables_); ++ } ++ ++ // Called at the end of a table to pop the depth count. ++ bool EndTable() { ++ depth_--; ++ return true; ++ } ++ ++ // Returns the message size in bytes ++ size_t GetComputedSize() const { ++ // clang-format off ++ #ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE ++ uintptr_t size = upper_bound_; ++ // Align the size to uoffset_t ++ size = (size - 1 + sizeof(uoffset_t)) & ~(sizeof(uoffset_t) - 1); ++ return (size > size_) ? 0 : size; ++ #else ++ // Must turn on FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE for this to work. ++ (void)upper_bound_; ++ FLATBUFFERS_ASSERT(false); ++ return 0; ++ #endif ++ // clang-format on ++ } ++ ++ std::vector *GetFlexReuseTracker() { return flex_reuse_tracker_; } ++ ++ void SetFlexReuseTracker(std::vector *rt) { ++ flex_reuse_tracker_ = rt; ++ } ++ ++ private: ++ const uint8_t *buf_; ++ size_t size_; ++ uoffset_t depth_; ++ uoffset_t max_depth_; ++ uoffset_t num_tables_; ++ uoffset_t max_tables_; ++ mutable size_t upper_bound_; ++ bool check_alignment_; ++ std::vector *flex_reuse_tracker_; ++}; ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_VERIFIER_H_ +diff -urN a/java/com/google/flatbuffers/FlexBuffers.java b/java/com/google/flatbuffers/FlexBuffers.java +--- a/java/com/google/flatbuffers/FlexBuffers.java 2021-05-10 18:45:16.000000000 +0000 ++++ b/java/com/google/flatbuffers/FlexBuffers.java 2023-01-13 07:46:54.187116368 +0000 +@@ -655,7 +655,7 @@ + + Sized(ReadBuf buff, int end, int byteWidth) { + super(buff, end, byteWidth); +- size = readInt(bb, end - byteWidth, byteWidth); ++ size = (int) readUInt(bb, end - byteWidth, byteWidth); + } + + public int size() { +@@ -788,7 +788,12 @@ + if (io == other.length) { + // in our buffer we have an additional \0 byte + // but this does not exist in regular Java strings, so we return now +- return c1 - c2; ++ int cmp = c1 - c2; ++ if (cmp != 0 || bb.get(ia) == '\0') { ++ return cmp; ++ } else { ++ return 1; ++ } + } + } + while (c1 == c2); +@@ -961,7 +966,12 @@ + if (l2 == other.length) { + // in our buffer we have an additional \0 byte + // but this does not exist in regular Java strings, so we return now +- return c1 - c2; ++ int cmp = c1 - c2; ++ if (cmp != 0 || bb.get(l1) == '\0') { ++ return cmp; ++ } else { ++ return 1; ++ } + } + } + while (c1 == c2); +diff -urN a/java/com/google/flatbuffers/FlexBuffersBuilder.java b/java/com/google/flatbuffers/FlexBuffersBuilder.java +--- a/java/com/google/flatbuffers/FlexBuffersBuilder.java 2021-05-10 18:45:16.000000000 +0000 ++++ b/java/com/google/flatbuffers/FlexBuffersBuilder.java 2023-01-13 07:46:54.202116507 +0000 +@@ -452,8 +452,8 @@ + * Finishes a vector, but writing the information in the buffer + * @param key key used to store element in map + * @param start reference for begining of the vector. Returned by {@link startVector()} +- * @param typed boolean indicating wether vector is typed +- * @param fixed boolean indicating wether vector is fixed ++ * @param typed boolean indicating whether vector is typed ++ * @param fixed boolean indicating whether vector is fixed + * @return Reference to the vector + */ + public int endVector(String key, int start, boolean typed, boolean fixed) { +@@ -763,7 +763,7 @@ + // Compute relative offset. + long offset = offsetLoc - iValue; + // Does it fit? +- int bitWidth = widthUInBits((int) offset); ++ int bitWidth = widthUInBits(offset); + if (((1L) << bitWidth) == byteWidth) + return bitWidth; + } +diff -urN a/java/com/google/flatbuffers/Utf8Safe.java b/java/com/google/flatbuffers/Utf8Safe.java +--- a/java/com/google/flatbuffers/Utf8Safe.java 2021-05-10 18:45:16.000000000 +0000 ++++ b/java/com/google/flatbuffers/Utf8Safe.java 2023-01-13 07:46:54.479119065 +0000 +@@ -1,33 +1,3 @@ +-// Protocol Buffers - Google's data interchange format +-// Copyright 2008 Google Inc. All rights reserved. +-// https://developers.google.com/protocol-buffers/ +-// +-// Redistribution and use in source and binary forms, with or without +-// modification, are permitted provided that the following conditions are +-// met: +-// +-// * Redistributions of source code must retain the above copyright +-// notice, this list of conditions and the following disclaimer. +-// * Redistributions in binary form must reproduce the above +-// copyright notice, this list of conditions and the following disclaimer +-// in the documentation and/or other materials provided with the +-// distribution. +-// * Neither the name of Google Inc. nor the names of its +-// contributors may be used to endorse or promote products derived from +-// this software without specific prior written permission. +-// +-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- + package com.google.flatbuffers; + + import java.nio.ByteBuffer; +diff -urN a/net/FlatBuffers/FlatBuffers.csproj b/net/FlatBuffers/FlatBuffers.csproj +--- a/net/FlatBuffers/FlatBuffers.csproj 2021-05-10 18:45:16.000000000 +0000 ++++ b/net/FlatBuffers/FlatBuffers.csproj 2023-01-13 07:47:06.829233123 +0000 +@@ -1,4 +1,4 @@ +- ++ + + + netstandard2.1;netstandard2.0;net46 +diff -urN a/package.json b/package.json +--- a/package.json 2021-05-10 18:45:16.000000000 +0000 ++++ b/package.json 2023-01-13 07:47:06.849233307 +0000 +@@ -1,16 +1,16 @@ + { + "name": "flatbuffers", +- "version": "2.0.0", ++ "version": "2.0.4", + "description": "Memory Efficient Serialization Library", + "files": [ +- "js/*.js", +- "js/*.d.ts", +- "mjs/*.js", +- "mjs/*.d.ts", +- "ts/*.ts" ++ "js/**/*.js", ++ "js/**/*.d.ts", ++ "mjs/**/*.js", ++ "mjs/**/*.d.ts", ++ "ts/**/*.ts" + ], + "main": "js/flatbuffers.js", +- "module": "mjs/index.mjs", ++ "module": "mjs/flatbuffers.js", + "directories": { + "doc": "docs", + "test": "tests" +@@ -18,7 +18,7 @@ + "scripts": { + "test": "npm run compile && cd tests && ./TypeScriptTest.sh", + "compile": "tsc && tsc -p tsconfig.mjs.json", +- "prepublishOnly": "npm run compile" ++ "prepublishOnly": "npm install --only=dev && npm run compile" + }, + "repository": { + "type": "git", +diff -urN a/pom.xml b/pom.xml +--- a/pom.xml 2021-05-10 18:45:16.000000000 +0000 ++++ b/pom.xml 2023-01-13 07:47:06.874233538 +0000 +@@ -3,7 +3,7 @@ + 4.0.0 + com.google.flatbuffers + flatbuffers-java +- 2.0.0 ++ 2.0.3 + bundle + FlatBuffers Java API + +@@ -42,103 +42,112 @@ + + + java +- +- +- maven-compiler-plugin +- +- 1.8 +- 1.8 +- +- 3.2 +- +- +- maven-surefire-plugin +- +- +- **/*Test.java +- +- +- 2.18.1 +- +- +- org.apache.maven.plugins +- maven-source-plugin +- 2.3 +- +- +- attach-sources +- +- jar +- +- +- +- +- +- org.apache.maven.plugins +- maven-javadoc-plugin +- 2.9.1 +- +- -Xdoclint:none +- -Xdoclint:none +- +- +- +- attach-javadocs +- +- jar +- +- +- +- +- +- org.apache.felix +- maven-bundle-plugin +- 3.0.1 +- true +- +- +- org.sonatype.plugins +- nexus-staging-maven-plugin +- 1.6.7 +- true +- +- ossrh +- https://oss.sonatype.org/ +- true +- +- +- +- org.apache.maven.plugins +- maven-gpg-plugin +- 1.6 +- +- +- sign-artifacts +- verify +- +- sign +- ++ ++ ++ ++ jdk9 ++ ++ [1.9,) ++ ++ ++ ++ ++ maven-compiler-plugin + +- +- --pinentry-mode +- loopback +- ++ 8 + +- +- +- +- +- org.apache.maven.plugins +- maven-release-plugin +- 2.5.3 +- +- true +- false +- release +- deploy +- +- +- +- ++ 3.8.1 ++ ++ ++ maven-surefire-plugin ++ ++ ++ **/*Test.java ++ ++ ++ 2.22.2 ++ ++ ++ org.apache.maven.plugins ++ maven-source-plugin ++ 3.2.1 ++ ++ ++ attach-sources ++ ++ jar ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-javadoc-plugin ++ 3.3.0 ++ ++ -Xdoclint:none ++ -Xdoclint:none ++ ++ ++ ++ attach-javadocs ++ ++ jar ++ ++ ++ ++ ++ ++ org.apache.felix ++ maven-bundle-plugin ++ 5.1.2 ++ true ++ ++ ++ org.sonatype.plugins ++ nexus-staging-maven-plugin ++ 1.6.8 ++ true ++ ++ ossrh ++ https://oss.sonatype.org/ ++ true ++ ++ ++ ++ org.apache.maven.plugins ++ maven-gpg-plugin ++ 3.0.1 ++ ++ ++ sign-artifacts ++ verify ++ ++ sign ++ ++ ++ ++ --pinentry-mode ++ loopback ++ ++ ++ ++ ++ ++ ++ org.apache.maven.plugins ++ maven-release-plugin ++ 2.5.3 ++ ++ true ++ false ++ release ++ deploy ++ ++ ++ ++ ++ ++ + + +diff -urN a/python/flatbuffers/compat.py b/python/flatbuffers/compat.py +--- a/python/flatbuffers/compat.py 2021-05-10 18:45:16.000000000 +0000 ++++ b/python/flatbuffers/compat.py 2023-01-13 07:47:06.877233566 +0000 +@@ -16,7 +16,6 @@ + compatibility helpers for numpy. """ + + import sys +-import imp + + PY2 = sys.version_info[0] == 2 + PY26 = sys.version_info[0:2] == (2, 6) +@@ -26,12 +25,14 @@ + PY34 = sys.version_info[0:2] >= (3, 4) + + if PY3: ++ import importlib.machinery + string_types = (str,) + binary_types = (bytes,bytearray) + range_func = range + memoryview_type = memoryview + struct_bool_decl = "?" + else: ++ import imp + string_types = (unicode,) + if PY26 or PY27: + binary_types = (str,bytearray) +@@ -52,11 +53,15 @@ + Returns the numpy module if it exists on the system, + otherwise returns None. + """ +- try: +- imp.find_module('numpy') +- numpy_exists = True +- except ImportError: +- numpy_exists = False ++ if PY3: ++ numpy_exists = ( ++ importlib.machinery.PathFinder.find_spec('numpy') is not None) ++ else: ++ try: ++ imp.find_module('numpy') ++ numpy_exists = True ++ except ImportError: ++ numpy_exists = False + + if numpy_exists: + # We do this outside of try/except block in case numpy exists +diff -urN a/python/flatbuffers/reflection/AdvancedFeatures.py b/python/flatbuffers/reflection/AdvancedFeatures.py +--- a/python/flatbuffers/reflection/AdvancedFeatures.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/AdvancedFeatures.py 2023-01-13 07:47:07.464238988 +0000 +@@ -0,0 +1,10 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++# New schema language features that are not supported by old code generators. ++class AdvancedFeatures(object): ++ AdvancedArrayFeatures = 1 ++ AdvancedUnionFeatures = 2 ++ OptionalScalars = 4 ++ DefaultVectorsAndStrings = 8 +diff -urN a/python/flatbuffers/reflection/BaseType.py b/python/flatbuffers/reflection/BaseType.py +--- a/python/flatbuffers/reflection/BaseType.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/BaseType.py 2023-01-13 07:47:07.467239015 +0000 +@@ -0,0 +1,24 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++class BaseType(object): ++ None_ = 0 ++ UType = 1 ++ Bool = 2 ++ Byte = 3 ++ UByte = 4 ++ Short = 5 ++ UShort = 6 ++ Int = 7 ++ UInt = 8 ++ Long = 9 ++ ULong = 10 ++ Float = 11 ++ Double = 12 ++ String = 13 ++ Vector = 14 ++ Obj = 15 ++ Union = 16 ++ Array = 17 ++ MaxBaseType = 18 +diff -urN a/python/flatbuffers/reflection/Enum.py b/python/flatbuffers/reflection/Enum.py +--- a/python/flatbuffers/reflection/Enum.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/Enum.py 2023-01-13 07:47:07.469239034 +0000 +@@ -0,0 +1,169 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++import flatbuffers ++from flatbuffers.compat import import_numpy ++np = import_numpy() ++ ++class Enum(object): ++ __slots__ = ['_tab'] ++ ++ @classmethod ++ def GetRootAs(cls, buf, offset=0): ++ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) ++ x = Enum() ++ x.Init(buf, n + offset) ++ return x ++ ++ @classmethod ++ def GetRootAsEnum(cls, buf, offset=0): ++ """This method is deprecated. Please switch to GetRootAs.""" ++ return cls.GetRootAs(buf, offset) ++ @classmethod ++ def EnumBufferHasIdentifier(cls, buf, offset, size_prefixed=False): ++ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed) ++ ++ # Enum ++ def Init(self, buf, pos): ++ self._tab = flatbuffers.table.Table(buf, pos) ++ ++ # Enum ++ def Name(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++ # Enum ++ def Values(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.EnumVal import EnumVal ++ obj = EnumVal() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Enum ++ def ValuesLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Enum ++ def ValuesIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ return o == 0 ++ ++ # Enum ++ def IsUnion(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) ++ if o != 0: ++ return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) ++ return False ++ ++ # Enum ++ def UnderlyingType(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ if o != 0: ++ x = self._tab.Indirect(o + self._tab.Pos) ++ from reflection.Type import Type ++ obj = Type() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Enum ++ def Attributes(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.KeyValue import KeyValue ++ obj = KeyValue() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Enum ++ def AttributesLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Enum ++ def AttributesIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ return o == 0 ++ ++ # Enum ++ def Documentation(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) ++ if o != 0: ++ a = self._tab.Vector(o) ++ return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) ++ return "" ++ ++ # Enum ++ def DocumentationLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Enum ++ def DocumentationIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) ++ return o == 0 ++ ++ # File that this Enum is declared in. ++ # Enum ++ def DeclarationFile(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++def EnumStart(builder): builder.StartObject(7) ++def Start(builder): ++ return EnumStart(builder) ++def EnumAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) ++def AddName(builder, name): ++ return EnumAddName(builder, name) ++def EnumAddValues(builder, values): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(values), 0) ++def AddValues(builder, values): ++ return EnumAddValues(builder, values) ++def EnumStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartValuesVector(builder, numElems): ++ return EnumStartValuesVector(builder, numElems) ++def EnumAddIsUnion(builder, isUnion): builder.PrependBoolSlot(2, isUnion, 0) ++def AddIsUnion(builder, isUnion): ++ return EnumAddIsUnion(builder, isUnion) ++def EnumAddUnderlyingType(builder, underlyingType): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(underlyingType), 0) ++def AddUnderlyingType(builder, underlyingType): ++ return EnumAddUnderlyingType(builder, underlyingType) ++def EnumAddAttributes(builder, attributes): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(attributes), 0) ++def AddAttributes(builder, attributes): ++ return EnumAddAttributes(builder, attributes) ++def EnumStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartAttributesVector(builder, numElems): ++ return EnumStartAttributesVector(builder, numElems) ++def EnumAddDocumentation(builder, documentation): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(documentation), 0) ++def AddDocumentation(builder, documentation): ++ return EnumAddDocumentation(builder, documentation) ++def EnumStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartDocumentationVector(builder, numElems): ++ return EnumStartDocumentationVector(builder, numElems) ++def EnumAddDeclarationFile(builder, declarationFile): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(declarationFile), 0) ++def AddDeclarationFile(builder, declarationFile): ++ return EnumAddDeclarationFile(builder, declarationFile) ++def EnumEnd(builder): return builder.EndObject() ++def End(builder): ++ return EnumEnd(builder) +\ No newline at end of file +diff -urN a/python/flatbuffers/reflection/EnumVal.py b/python/flatbuffers/reflection/EnumVal.py +--- a/python/flatbuffers/reflection/EnumVal.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/EnumVal.py 2023-01-13 07:47:07.469239034 +0000 +@@ -0,0 +1,96 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++import flatbuffers ++from flatbuffers.compat import import_numpy ++np = import_numpy() ++ ++class EnumVal(object): ++ __slots__ = ['_tab'] ++ ++ @classmethod ++ def GetRootAs(cls, buf, offset=0): ++ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) ++ x = EnumVal() ++ x.Init(buf, n + offset) ++ return x ++ ++ @classmethod ++ def GetRootAsEnumVal(cls, buf, offset=0): ++ """This method is deprecated. Please switch to GetRootAs.""" ++ return cls.GetRootAs(buf, offset) ++ @classmethod ++ def EnumValBufferHasIdentifier(cls, buf, offset, size_prefixed=False): ++ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed) ++ ++ # EnumVal ++ def Init(self, buf, pos): ++ self._tab = flatbuffers.table.Table(buf, pos) ++ ++ # EnumVal ++ def Name(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++ # EnumVal ++ def Value(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) ++ return 0 ++ ++ # EnumVal ++ def UnionType(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ if o != 0: ++ x = self._tab.Indirect(o + self._tab.Pos) ++ from reflection.Type import Type ++ obj = Type() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # EnumVal ++ def Documentation(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ if o != 0: ++ a = self._tab.Vector(o) ++ return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) ++ return "" ++ ++ # EnumVal ++ def DocumentationLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # EnumVal ++ def DocumentationIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ return o == 0 ++ ++def EnumValStart(builder): builder.StartObject(5) ++def Start(builder): ++ return EnumValStart(builder) ++def EnumValAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) ++def AddName(builder, name): ++ return EnumValAddName(builder, name) ++def EnumValAddValue(builder, value): builder.PrependInt64Slot(1, value, 0) ++def AddValue(builder, value): ++ return EnumValAddValue(builder, value) ++def EnumValAddUnionType(builder, unionType): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(unionType), 0) ++def AddUnionType(builder, unionType): ++ return EnumValAddUnionType(builder, unionType) ++def EnumValAddDocumentation(builder, documentation): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(documentation), 0) ++def AddDocumentation(builder, documentation): ++ return EnumValAddDocumentation(builder, documentation) ++def EnumValStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartDocumentationVector(builder, numElems): ++ return EnumValStartDocumentationVector(builder, numElems) ++def EnumValEnd(builder): return builder.EndObject() ++def End(builder): ++ return EnumValEnd(builder) +\ No newline at end of file +diff -urN a/python/flatbuffers/reflection/Field.py b/python/flatbuffers/reflection/Field.py +--- a/python/flatbuffers/reflection/Field.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/Field.py 2023-01-13 07:47:07.470239043 +0000 +@@ -0,0 +1,208 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++import flatbuffers ++from flatbuffers.compat import import_numpy ++np = import_numpy() ++ ++class Field(object): ++ __slots__ = ['_tab'] ++ ++ @classmethod ++ def GetRootAs(cls, buf, offset=0): ++ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) ++ x = Field() ++ x.Init(buf, n + offset) ++ return x ++ ++ @classmethod ++ def GetRootAsField(cls, buf, offset=0): ++ """This method is deprecated. Please switch to GetRootAs.""" ++ return cls.GetRootAs(buf, offset) ++ @classmethod ++ def FieldBufferHasIdentifier(cls, buf, offset, size_prefixed=False): ++ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed) ++ ++ # Field ++ def Init(self, buf, pos): ++ self._tab = flatbuffers.table.Table(buf, pos) ++ ++ # Field ++ def Name(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++ # Field ++ def Type(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ x = self._tab.Indirect(o + self._tab.Pos) ++ from reflection.Type import Type ++ obj = Type() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Field ++ def Id(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos) ++ return 0 ++ ++ # Field ++ def Offset(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos) ++ return 0 ++ ++ # Field ++ def DefaultInteger(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos) ++ return 0 ++ ++ # Field ++ def DefaultReal(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos) ++ return 0.0 ++ ++ # Field ++ def Deprecated(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) ++ if o != 0: ++ return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) ++ return False ++ ++ # Field ++ def Required(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18)) ++ if o != 0: ++ return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) ++ return False ++ ++ # Field ++ def Key(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20)) ++ if o != 0: ++ return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) ++ return False ++ ++ # Field ++ def Attributes(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.KeyValue import KeyValue ++ obj = KeyValue() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Field ++ def AttributesLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Field ++ def AttributesIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22)) ++ return o == 0 ++ ++ # Field ++ def Documentation(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24)) ++ if o != 0: ++ a = self._tab.Vector(o) ++ return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) ++ return "" ++ ++ # Field ++ def DocumentationLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Field ++ def DocumentationIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24)) ++ return o == 0 ++ ++ # Field ++ def Optional(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26)) ++ if o != 0: ++ return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) ++ return False ++ ++ # Number of padding octets to always add after this field. Structs only. ++ # Field ++ def Padding(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos) ++ return 0 ++ ++def FieldStart(builder): builder.StartObject(13) ++def Start(builder): ++ return FieldStart(builder) ++def FieldAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) ++def AddName(builder, name): ++ return FieldAddName(builder, name) ++def FieldAddType(builder, type): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(type), 0) ++def AddType(builder, type): ++ return FieldAddType(builder, type) ++def FieldAddId(builder, id): builder.PrependUint16Slot(2, id, 0) ++def AddId(builder, id): ++ return FieldAddId(builder, id) ++def FieldAddOffset(builder, offset): builder.PrependUint16Slot(3, offset, 0) ++def AddOffset(builder, offset): ++ return FieldAddOffset(builder, offset) ++def FieldAddDefaultInteger(builder, defaultInteger): builder.PrependInt64Slot(4, defaultInteger, 0) ++def AddDefaultInteger(builder, defaultInteger): ++ return FieldAddDefaultInteger(builder, defaultInteger) ++def FieldAddDefaultReal(builder, defaultReal): builder.PrependFloat64Slot(5, defaultReal, 0.0) ++def AddDefaultReal(builder, defaultReal): ++ return FieldAddDefaultReal(builder, defaultReal) ++def FieldAddDeprecated(builder, deprecated): builder.PrependBoolSlot(6, deprecated, 0) ++def AddDeprecated(builder, deprecated): ++ return FieldAddDeprecated(builder, deprecated) ++def FieldAddRequired(builder, required): builder.PrependBoolSlot(7, required, 0) ++def AddRequired(builder, required): ++ return FieldAddRequired(builder, required) ++def FieldAddKey(builder, key): builder.PrependBoolSlot(8, key, 0) ++def AddKey(builder, key): ++ return FieldAddKey(builder, key) ++def FieldAddAttributes(builder, attributes): builder.PrependUOffsetTRelativeSlot(9, flatbuffers.number_types.UOffsetTFlags.py_type(attributes), 0) ++def AddAttributes(builder, attributes): ++ return FieldAddAttributes(builder, attributes) ++def FieldStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartAttributesVector(builder, numElems): ++ return FieldStartAttributesVector(builder, numElems) ++def FieldAddDocumentation(builder, documentation): builder.PrependUOffsetTRelativeSlot(10, flatbuffers.number_types.UOffsetTFlags.py_type(documentation), 0) ++def AddDocumentation(builder, documentation): ++ return FieldAddDocumentation(builder, documentation) ++def FieldStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartDocumentationVector(builder, numElems): ++ return FieldStartDocumentationVector(builder, numElems) ++def FieldAddOptional(builder, optional): builder.PrependBoolSlot(11, optional, 0) ++def AddOptional(builder, optional): ++ return FieldAddOptional(builder, optional) ++def FieldAddPadding(builder, padding): builder.PrependUint16Slot(12, padding, 0) ++def AddPadding(builder, padding): ++ return FieldAddPadding(builder, padding) ++def FieldEnd(builder): return builder.EndObject() ++def End(builder): ++ return FieldEnd(builder) +\ No newline at end of file +diff -urN a/python/flatbuffers/reflection/KeyValue.py b/python/flatbuffers/reflection/KeyValue.py +--- a/python/flatbuffers/reflection/KeyValue.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/KeyValue.py 2023-01-13 07:47:07.470239043 +0000 +@@ -0,0 +1,56 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++import flatbuffers ++from flatbuffers.compat import import_numpy ++np = import_numpy() ++ ++class KeyValue(object): ++ __slots__ = ['_tab'] ++ ++ @classmethod ++ def GetRootAs(cls, buf, offset=0): ++ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) ++ x = KeyValue() ++ x.Init(buf, n + offset) ++ return x ++ ++ @classmethod ++ def GetRootAsKeyValue(cls, buf, offset=0): ++ """This method is deprecated. Please switch to GetRootAs.""" ++ return cls.GetRootAs(buf, offset) ++ @classmethod ++ def KeyValueBufferHasIdentifier(cls, buf, offset, size_prefixed=False): ++ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed) ++ ++ # KeyValue ++ def Init(self, buf, pos): ++ self._tab = flatbuffers.table.Table(buf, pos) ++ ++ # KeyValue ++ def Key(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++ # KeyValue ++ def Value(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++def KeyValueStart(builder): builder.StartObject(2) ++def Start(builder): ++ return KeyValueStart(builder) ++def KeyValueAddKey(builder, key): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0) ++def AddKey(builder, key): ++ return KeyValueAddKey(builder, key) ++def KeyValueAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0) ++def AddValue(builder, value): ++ return KeyValueAddValue(builder, value) ++def KeyValueEnd(builder): return builder.EndObject() ++def End(builder): ++ return KeyValueEnd(builder) +\ No newline at end of file +diff -urN a/python/flatbuffers/reflection/Object.py b/python/flatbuffers/reflection/Object.py +--- a/python/flatbuffers/reflection/Object.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/Object.py 2023-01-13 07:47:07.470239043 +0000 +@@ -0,0 +1,175 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++import flatbuffers ++from flatbuffers.compat import import_numpy ++np = import_numpy() ++ ++class Object(object): ++ __slots__ = ['_tab'] ++ ++ @classmethod ++ def GetRootAs(cls, buf, offset=0): ++ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) ++ x = Object() ++ x.Init(buf, n + offset) ++ return x ++ ++ @classmethod ++ def GetRootAsObject(cls, buf, offset=0): ++ """This method is deprecated. Please switch to GetRootAs.""" ++ return cls.GetRootAs(buf, offset) ++ @classmethod ++ def ObjectBufferHasIdentifier(cls, buf, offset, size_prefixed=False): ++ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed) ++ ++ # Object ++ def Init(self, buf, pos): ++ self._tab = flatbuffers.table.Table(buf, pos) ++ ++ # Object ++ def Name(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++ # Object ++ def Fields(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.Field import Field ++ obj = Field() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Object ++ def FieldsLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Object ++ def FieldsIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ return o == 0 ++ ++ # Object ++ def IsStruct(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) ++ if o != 0: ++ return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)) ++ return False ++ ++ # Object ++ def Minalign(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) ++ return 0 ++ ++ # Object ++ def Bytesize(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) ++ return 0 ++ ++ # Object ++ def Attributes(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.KeyValue import KeyValue ++ obj = KeyValue() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Object ++ def AttributesLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Object ++ def AttributesIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) ++ return o == 0 ++ ++ # Object ++ def Documentation(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) ++ if o != 0: ++ a = self._tab.Vector(o) ++ return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) ++ return "" ++ ++ # Object ++ def DocumentationLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Object ++ def DocumentationIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) ++ return o == 0 ++ ++ # File that this Object is declared in. ++ # Object ++ def DeclarationFile(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++def ObjectStart(builder): builder.StartObject(8) ++def Start(builder): ++ return ObjectStart(builder) ++def ObjectAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) ++def AddName(builder, name): ++ return ObjectAddName(builder, name) ++def ObjectAddFields(builder, fields): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(fields), 0) ++def AddFields(builder, fields): ++ return ObjectAddFields(builder, fields) ++def ObjectStartFieldsVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartFieldsVector(builder, numElems): ++ return ObjectStartFieldsVector(builder, numElems) ++def ObjectAddIsStruct(builder, isStruct): builder.PrependBoolSlot(2, isStruct, 0) ++def AddIsStruct(builder, isStruct): ++ return ObjectAddIsStruct(builder, isStruct) ++def ObjectAddMinalign(builder, minalign): builder.PrependInt32Slot(3, minalign, 0) ++def AddMinalign(builder, minalign): ++ return ObjectAddMinalign(builder, minalign) ++def ObjectAddBytesize(builder, bytesize): builder.PrependInt32Slot(4, bytesize, 0) ++def AddBytesize(builder, bytesize): ++ return ObjectAddBytesize(builder, bytesize) ++def ObjectAddAttributes(builder, attributes): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(attributes), 0) ++def AddAttributes(builder, attributes): ++ return ObjectAddAttributes(builder, attributes) ++def ObjectStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartAttributesVector(builder, numElems): ++ return ObjectStartAttributesVector(builder, numElems) ++def ObjectAddDocumentation(builder, documentation): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(documentation), 0) ++def AddDocumentation(builder, documentation): ++ return ObjectAddDocumentation(builder, documentation) ++def ObjectStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartDocumentationVector(builder, numElems): ++ return ObjectStartDocumentationVector(builder, numElems) ++def ObjectAddDeclarationFile(builder, declarationFile): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(declarationFile), 0) ++def AddDeclarationFile(builder, declarationFile): ++ return ObjectAddDeclarationFile(builder, declarationFile) ++def ObjectEnd(builder): return builder.EndObject() ++def End(builder): ++ return ObjectEnd(builder) +\ No newline at end of file +diff -urN a/python/flatbuffers/reflection/RPCCall.py b/python/flatbuffers/reflection/RPCCall.py +--- a/python/flatbuffers/reflection/RPCCall.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/RPCCall.py 2023-01-13 07:47:07.471239052 +0000 +@@ -0,0 +1,131 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++import flatbuffers ++from flatbuffers.compat import import_numpy ++np = import_numpy() ++ ++class RPCCall(object): ++ __slots__ = ['_tab'] ++ ++ @classmethod ++ def GetRootAs(cls, buf, offset=0): ++ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) ++ x = RPCCall() ++ x.Init(buf, n + offset) ++ return x ++ ++ @classmethod ++ def GetRootAsRPCCall(cls, buf, offset=0): ++ """This method is deprecated. Please switch to GetRootAs.""" ++ return cls.GetRootAs(buf, offset) ++ @classmethod ++ def RPCCallBufferHasIdentifier(cls, buf, offset, size_prefixed=False): ++ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed) ++ ++ # RPCCall ++ def Init(self, buf, pos): ++ self._tab = flatbuffers.table.Table(buf, pos) ++ ++ # RPCCall ++ def Name(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++ # RPCCall ++ def Request(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ x = self._tab.Indirect(o + self._tab.Pos) ++ from reflection.Object import Object ++ obj = Object() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # RPCCall ++ def Response(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) ++ if o != 0: ++ x = self._tab.Indirect(o + self._tab.Pos) ++ from reflection.Object import Object ++ obj = Object() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # RPCCall ++ def Attributes(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.KeyValue import KeyValue ++ obj = KeyValue() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # RPCCall ++ def AttributesLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # RPCCall ++ def AttributesIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ return o == 0 ++ ++ # RPCCall ++ def Documentation(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ if o != 0: ++ a = self._tab.Vector(o) ++ return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) ++ return "" ++ ++ # RPCCall ++ def DocumentationLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # RPCCall ++ def DocumentationIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ return o == 0 ++ ++def RPCCallStart(builder): builder.StartObject(5) ++def Start(builder): ++ return RPCCallStart(builder) ++def RPCCallAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) ++def AddName(builder, name): ++ return RPCCallAddName(builder, name) ++def RPCCallAddRequest(builder, request): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(request), 0) ++def AddRequest(builder, request): ++ return RPCCallAddRequest(builder, request) ++def RPCCallAddResponse(builder, response): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(response), 0) ++def AddResponse(builder, response): ++ return RPCCallAddResponse(builder, response) ++def RPCCallAddAttributes(builder, attributes): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(attributes), 0) ++def AddAttributes(builder, attributes): ++ return RPCCallAddAttributes(builder, attributes) ++def RPCCallStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartAttributesVector(builder, numElems): ++ return RPCCallStartAttributesVector(builder, numElems) ++def RPCCallAddDocumentation(builder, documentation): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(documentation), 0) ++def AddDocumentation(builder, documentation): ++ return RPCCallAddDocumentation(builder, documentation) ++def RPCCallStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartDocumentationVector(builder, numElems): ++ return RPCCallStartDocumentationVector(builder, numElems) ++def RPCCallEnd(builder): return builder.EndObject() ++def End(builder): ++ return RPCCallEnd(builder) +\ No newline at end of file +diff -urN a/python/flatbuffers/reflection/Schema.py b/python/flatbuffers/reflection/Schema.py +--- a/python/flatbuffers/reflection/Schema.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/Schema.py 2023-01-13 07:47:07.471239052 +0000 +@@ -0,0 +1,206 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++import flatbuffers ++from flatbuffers.compat import import_numpy ++np = import_numpy() ++ ++class Schema(object): ++ __slots__ = ['_tab'] ++ ++ @classmethod ++ def GetRootAs(cls, buf, offset=0): ++ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) ++ x = Schema() ++ x.Init(buf, n + offset) ++ return x ++ ++ @classmethod ++ def GetRootAsSchema(cls, buf, offset=0): ++ """This method is deprecated. Please switch to GetRootAs.""" ++ return cls.GetRootAs(buf, offset) ++ @classmethod ++ def SchemaBufferHasIdentifier(cls, buf, offset, size_prefixed=False): ++ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed) ++ ++ # Schema ++ def Init(self, buf, pos): ++ self._tab = flatbuffers.table.Table(buf, pos) ++ ++ # Schema ++ def Objects(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.Object import Object ++ obj = Object() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Schema ++ def ObjectsLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Schema ++ def ObjectsIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ return o == 0 ++ ++ # Schema ++ def Enums(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.Enum import Enum ++ obj = Enum() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Schema ++ def EnumsLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Schema ++ def EnumsIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ return o == 0 ++ ++ # Schema ++ def FileIdent(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++ # Schema ++ def FileExt(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++ # Schema ++ def RootTable(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ if o != 0: ++ x = self._tab.Indirect(o + self._tab.Pos) ++ from reflection.Object import Object ++ obj = Object() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Schema ++ def Services(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.Service import Service ++ obj = Service() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Schema ++ def ServicesLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Schema ++ def ServicesIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) ++ return o == 0 ++ ++ # Schema ++ def AdvancedFeatures(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos) ++ return 0 ++ ++ # All the files used in this compilation. Files are relative to where ++ # flatc was invoked. ++ # Schema ++ def FbsFiles(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.SchemaFile import SchemaFile ++ obj = SchemaFile() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Schema ++ def FbsFilesLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Schema ++ def FbsFilesIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18)) ++ return o == 0 ++ ++def SchemaStart(builder): builder.StartObject(8) ++def Start(builder): ++ return SchemaStart(builder) ++def SchemaAddObjects(builder, objects): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(objects), 0) ++def AddObjects(builder, objects): ++ return SchemaAddObjects(builder, objects) ++def SchemaStartObjectsVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartObjectsVector(builder, numElems): ++ return SchemaStartObjectsVector(builder, numElems) ++def SchemaAddEnums(builder, enums): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(enums), 0) ++def AddEnums(builder, enums): ++ return SchemaAddEnums(builder, enums) ++def SchemaStartEnumsVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartEnumsVector(builder, numElems): ++ return SchemaStartEnumsVector(builder, numElems) ++def SchemaAddFileIdent(builder, fileIdent): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(fileIdent), 0) ++def AddFileIdent(builder, fileIdent): ++ return SchemaAddFileIdent(builder, fileIdent) ++def SchemaAddFileExt(builder, fileExt): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(fileExt), 0) ++def AddFileExt(builder, fileExt): ++ return SchemaAddFileExt(builder, fileExt) ++def SchemaAddRootTable(builder, rootTable): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(rootTable), 0) ++def AddRootTable(builder, rootTable): ++ return SchemaAddRootTable(builder, rootTable) ++def SchemaAddServices(builder, services): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(services), 0) ++def AddServices(builder, services): ++ return SchemaAddServices(builder, services) ++def SchemaStartServicesVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartServicesVector(builder, numElems): ++ return SchemaStartServicesVector(builder, numElems) ++def SchemaAddAdvancedFeatures(builder, advancedFeatures): builder.PrependUint64Slot(6, advancedFeatures, 0) ++def AddAdvancedFeatures(builder, advancedFeatures): ++ return SchemaAddAdvancedFeatures(builder, advancedFeatures) ++def SchemaAddFbsFiles(builder, fbsFiles): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(fbsFiles), 0) ++def AddFbsFiles(builder, fbsFiles): ++ return SchemaAddFbsFiles(builder, fbsFiles) ++def SchemaStartFbsFilesVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartFbsFilesVector(builder, numElems): ++ return SchemaStartFbsFilesVector(builder, numElems) ++def SchemaEnd(builder): return builder.EndObject() ++def End(builder): ++ return SchemaEnd(builder) +\ No newline at end of file +diff -urN a/python/flatbuffers/reflection/SchemaFile.py b/python/flatbuffers/reflection/SchemaFile.py +--- a/python/flatbuffers/reflection/SchemaFile.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/SchemaFile.py 2023-01-13 07:47:07.472239062 +0000 +@@ -0,0 +1,77 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++import flatbuffers ++from flatbuffers.compat import import_numpy ++np = import_numpy() ++ ++# File specific information. ++# Symbols declared within a file may be recovered by iterating over all ++# symbols and examining the `declaration_file` field. ++class SchemaFile(object): ++ __slots__ = ['_tab'] ++ ++ @classmethod ++ def GetRootAs(cls, buf, offset=0): ++ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) ++ x = SchemaFile() ++ x.Init(buf, n + offset) ++ return x ++ ++ @classmethod ++ def GetRootAsSchemaFile(cls, buf, offset=0): ++ """This method is deprecated. Please switch to GetRootAs.""" ++ return cls.GetRootAs(buf, offset) ++ @classmethod ++ def SchemaFileBufferHasIdentifier(cls, buf, offset, size_prefixed=False): ++ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed) ++ ++ # SchemaFile ++ def Init(self, buf, pos): ++ self._tab = flatbuffers.table.Table(buf, pos) ++ ++ # Filename, relative to project root. ++ # SchemaFile ++ def Filename(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++ # Names of included files, relative to project root. ++ # SchemaFile ++ def IncludedFilenames(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ a = self._tab.Vector(o) ++ return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) ++ return "" ++ ++ # SchemaFile ++ def IncludedFilenamesLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # SchemaFile ++ def IncludedFilenamesIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ return o == 0 ++ ++def SchemaFileStart(builder): builder.StartObject(2) ++def Start(builder): ++ return SchemaFileStart(builder) ++def SchemaFileAddFilename(builder, filename): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(filename), 0) ++def AddFilename(builder, filename): ++ return SchemaFileAddFilename(builder, filename) ++def SchemaFileAddIncludedFilenames(builder, includedFilenames): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(includedFilenames), 0) ++def AddIncludedFilenames(builder, includedFilenames): ++ return SchemaFileAddIncludedFilenames(builder, includedFilenames) ++def SchemaFileStartIncludedFilenamesVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartIncludedFilenamesVector(builder, numElems): ++ return SchemaFileStartIncludedFilenamesVector(builder, numElems) ++def SchemaFileEnd(builder): return builder.EndObject() ++def End(builder): ++ return SchemaFileEnd(builder) +\ No newline at end of file +diff -urN a/python/flatbuffers/reflection/Service.py b/python/flatbuffers/reflection/Service.py +--- a/python/flatbuffers/reflection/Service.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/Service.py 2023-01-13 07:47:07.472239062 +0000 +@@ -0,0 +1,145 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++import flatbuffers ++from flatbuffers.compat import import_numpy ++np = import_numpy() ++ ++class Service(object): ++ __slots__ = ['_tab'] ++ ++ @classmethod ++ def GetRootAs(cls, buf, offset=0): ++ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) ++ x = Service() ++ x.Init(buf, n + offset) ++ return x ++ ++ @classmethod ++ def GetRootAsService(cls, buf, offset=0): ++ """This method is deprecated. Please switch to GetRootAs.""" ++ return cls.GetRootAs(buf, offset) ++ @classmethod ++ def ServiceBufferHasIdentifier(cls, buf, offset, size_prefixed=False): ++ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed) ++ ++ # Service ++ def Init(self, buf, pos): ++ self._tab = flatbuffers.table.Table(buf, pos) ++ ++ # Service ++ def Name(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++ # Service ++ def Calls(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.RPCCall import RPCCall ++ obj = RPCCall() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Service ++ def CallsLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Service ++ def CallsIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ return o == 0 ++ ++ # Service ++ def Attributes(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) ++ if o != 0: ++ x = self._tab.Vector(o) ++ x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4 ++ x = self._tab.Indirect(x) ++ from reflection.KeyValue import KeyValue ++ obj = KeyValue() ++ obj.Init(self._tab.Bytes, x) ++ return obj ++ return None ++ ++ # Service ++ def AttributesLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Service ++ def AttributesIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) ++ return o == 0 ++ ++ # Service ++ def Documentation(self, j): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ if o != 0: ++ a = self._tab.Vector(o) ++ return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)) ++ return "" ++ ++ # Service ++ def DocumentationLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ if o != 0: ++ return self._tab.VectorLen(o) ++ return 0 ++ ++ # Service ++ def DocumentationIsNone(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ return o == 0 ++ ++ # File that this Service is declared in. ++ # Service ++ def DeclarationFile(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ if o != 0: ++ return self._tab.String(o + self._tab.Pos) ++ return None ++ ++def ServiceStart(builder): builder.StartObject(5) ++def Start(builder): ++ return ServiceStart(builder) ++def ServiceAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0) ++def AddName(builder, name): ++ return ServiceAddName(builder, name) ++def ServiceAddCalls(builder, calls): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(calls), 0) ++def AddCalls(builder, calls): ++ return ServiceAddCalls(builder, calls) ++def ServiceStartCallsVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartCallsVector(builder, numElems): ++ return ServiceStartCallsVector(builder, numElems) ++def ServiceAddAttributes(builder, attributes): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(attributes), 0) ++def AddAttributes(builder, attributes): ++ return ServiceAddAttributes(builder, attributes) ++def ServiceStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartAttributesVector(builder, numElems): ++ return ServiceStartAttributesVector(builder, numElems) ++def ServiceAddDocumentation(builder, documentation): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(documentation), 0) ++def AddDocumentation(builder, documentation): ++ return ServiceAddDocumentation(builder, documentation) ++def ServiceStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) ++def StartDocumentationVector(builder, numElems): ++ return ServiceStartDocumentationVector(builder, numElems) ++def ServiceAddDeclarationFile(builder, declarationFile): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(declarationFile), 0) ++def AddDeclarationFile(builder, declarationFile): ++ return ServiceAddDeclarationFile(builder, declarationFile) ++def ServiceEnd(builder): return builder.EndObject() ++def End(builder): ++ return ServiceEnd(builder) +\ No newline at end of file +diff -urN a/python/flatbuffers/reflection/Type.py b/python/flatbuffers/reflection/Type.py +--- a/python/flatbuffers/reflection/Type.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/python/flatbuffers/reflection/Type.py 2023-01-13 07:47:07.472239062 +0000 +@@ -0,0 +1,98 @@ ++# automatically generated by the FlatBuffers compiler, do not modify ++ ++# namespace: reflection ++ ++import flatbuffers ++from flatbuffers.compat import import_numpy ++np = import_numpy() ++ ++class Type(object): ++ __slots__ = ['_tab'] ++ ++ @classmethod ++ def GetRootAs(cls, buf, offset=0): ++ n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) ++ x = Type() ++ x.Init(buf, n + offset) ++ return x ++ ++ @classmethod ++ def GetRootAsType(cls, buf, offset=0): ++ """This method is deprecated. Please switch to GetRootAs.""" ++ return cls.GetRootAs(buf, offset) ++ @classmethod ++ def TypeBufferHasIdentifier(cls, buf, offset, size_prefixed=False): ++ return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x42\x46\x42\x53", size_prefixed=size_prefixed) ++ ++ # Type ++ def Init(self, buf, pos): ++ self._tab = flatbuffers.table.Table(buf, pos) ++ ++ # Type ++ def BaseType(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) ++ return 0 ++ ++ # Type ++ def Element(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos) ++ return 0 ++ ++ # Type ++ def Index(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) ++ return -1 ++ ++ # Type ++ def FixedLength(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Uint16Flags, o + self._tab.Pos) ++ return 0 ++ ++ # The size (octets) of the `base_type` field. ++ # Type ++ def BaseSize(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) ++ return 4 ++ ++ # The size (octets) of the `element` field, if present. ++ # Type ++ def ElementSize(self): ++ o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) ++ if o != 0: ++ return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos) ++ return 0 ++ ++def TypeStart(builder): builder.StartObject(6) ++def Start(builder): ++ return TypeStart(builder) ++def TypeAddBaseType(builder, baseType): builder.PrependInt8Slot(0, baseType, 0) ++def AddBaseType(builder, baseType): ++ return TypeAddBaseType(builder, baseType) ++def TypeAddElement(builder, element): builder.PrependInt8Slot(1, element, 0) ++def AddElement(builder, element): ++ return TypeAddElement(builder, element) ++def TypeAddIndex(builder, index): builder.PrependInt32Slot(2, index, -1) ++def AddIndex(builder, index): ++ return TypeAddIndex(builder, index) ++def TypeAddFixedLength(builder, fixedLength): builder.PrependUint16Slot(3, fixedLength, 0) ++def AddFixedLength(builder, fixedLength): ++ return TypeAddFixedLength(builder, fixedLength) ++def TypeAddBaseSize(builder, baseSize): builder.PrependUint32Slot(4, baseSize, 4) ++def AddBaseSize(builder, baseSize): ++ return TypeAddBaseSize(builder, baseSize) ++def TypeAddElementSize(builder, elementSize): builder.PrependUint32Slot(5, elementSize, 0) ++def AddElementSize(builder, elementSize): ++ return TypeAddElementSize(builder, elementSize) ++def TypeEnd(builder): return builder.EndObject() ++def End(builder): ++ return TypeEnd(builder) +\ No newline at end of file +diff -urN a/readme.md b/readme.md +--- a/readme.md 2021-05-10 18:45:16.000000000 +0000 ++++ b/readme.md 2023-01-13 07:47:07.473239071 +0000 +@@ -1,11 +1,11 @@ + ![logo](http://google.github.io/flatbuffers/fpl_logo_small.png) FlatBuffers + =========== + +-[![Build Status](https://travis-ci.org/google/flatbuffers.svg?branch=master)](https://travis-ci.org/google/flatbuffers) +-[![Build status](https://ci.appveyor.com/api/projects/status/yg5idd2fnusv1n10?svg=true)](https://ci.appveyor.com/project/gwvo/flatbuffers) ++![Build status](https://github.com/google/flatbuffers/actions/workflows/build.yml/badge.svg?branch=master) + [![Join the chat at https://gitter.im/google/flatbuffers](https://badges.gitter.im/google/flatbuffers.svg)](https://gitter.im/google/flatbuffers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + [![Discord Chat](https://img.shields.io/discord/656202785926152206.svg)](https:///discord.gg/6qgKs3R) + [![Twitter Follow](https://img.shields.io/twitter/follow/wvo.svg?style=social)](https://twitter.com/wvo) ++[![Twitter Follow](https://img.shields.io/twitter/follow/dbaileychess.svg?style=social)](https://twitter.com/dbaileychess) + + + **FlatBuffers** is a cross platform serialization library architected for +@@ -44,6 +44,10 @@ + + *To contribute to this project,* see [CONTRIBUTING][]. + ++## Security ++ ++Please see our [Security Policy](SECURITY.md) for reporting vulnerabilities. ++ + ## Licensing + *Flatbuffers* is licensed under the Apache License, Version 2.0. See [LICENSE][] for the full license text. + +diff -urN a/reflection/generate_code.bat b/reflection/generate_code.bat +--- a/reflection/generate_code.bat 2021-05-10 18:45:16.000000000 +0000 ++++ b/reflection/generate_code.bat 1970-01-01 00:00:00.000000000 +0000 +@@ -1,18 +0,0 @@ +-:: Copyright 2015 Google Inc. All rights reserved. +-:: +-:: 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. +- +-set buildtype=Release +-if "%1"=="-b" set buildtype=%2 +- +-..\%buildtype%\flatc.exe --cpp --cpp-std c++0x --no-prefix -o ../include/flatbuffers reflection.fbs || exit /b 1 +diff -urN a/reflection/generate_code.sh b/reflection/generate_code.sh +--- a/reflection/generate_code.sh 2021-05-10 18:45:16.000000000 +0000 ++++ b/reflection/generate_code.sh 1970-01-01 00:00:00.000000000 +0000 +@@ -1,31 +0,0 @@ +-#!/bin/bash +-# +-# Copyright 2016 Google Inc. All rights reserved. +-# +-# 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. +-set -e +- +-tempDir="../include/flatbuffers/.tmp" +-originalFile="../include/flatbuffers/reflection_generated.h" +-newFile="$tempDir/reflection_generated.h" +- +-../flatc -c --cpp-std c++0x --no-prefix -o $tempDir reflection.fbs +- +-if [ -f "$newFile" ]; then +- if ! cmp -s "$originalFile" "$newFile"; then +- mv $newFile $originalFile +- else +- rm $newFile +- fi +- rmdir $tempDir +-fi +diff -urN a/reflection/reflection.fbs b/reflection/reflection.fbs +--- a/reflection/reflection.fbs 2021-05-10 18:45:16.000000000 +0000 ++++ b/reflection/reflection.fbs 2023-01-13 07:46:54.480119075 +0000 +@@ -38,6 +38,10 @@ + // If base_type == Union, UnionType, or integral derived + // from an enum, index into "enums" below. + fixed_length:uint16 = 0; // Only if base_type == Array. ++ /// The size (octets) of the `base_type` field. ++ base_size:uint = 4; // 4 Is a common size due to offsets being that size. ++ /// The size (octets) of the `element` field, if present. ++ element_size:uint = 0; + } + + table KeyValue { +@@ -48,7 +52,7 @@ + table EnumVal { + name:string (required); + value:long (key); +- object:Object; // Will be deprecated in favor of union_type in the future. ++ object:Object (deprecated); + union_type:Type; + documentation:[string]; + } +@@ -60,6 +64,8 @@ + underlying_type:Type (required); + attributes:[KeyValue]; + documentation:[string]; ++ /// File that this Enum is declared in. ++ declaration_file: string; + } + + table Field { +@@ -75,6 +81,8 @@ + attributes:[KeyValue]; + documentation:[string]; + optional:bool = false; ++ /// Number of padding octets to always add after this field. Structs only. ++ padding:uint16 = 0; + } + + table Object { // Used for both tables and structs. +@@ -85,6 +93,8 @@ + bytesize:int; // For structs. + attributes:[KeyValue]; + documentation:[string]; ++ /// File that this Object is declared in. ++ declaration_file: string; + } + + table RPCCall { +@@ -100,9 +110,11 @@ + calls:[RPCCall]; + attributes:[KeyValue]; + documentation:[string]; ++ /// File that this Service is declared in. ++ declaration_file: string; + } + +-// New schema language features that are not supported by old code generators. ++/// New schema language features that are not supported by old code generators. + enum AdvancedFeatures : ulong (bit_flags) { + AdvancedArrayFeatures, + AdvancedUnionFeatures, +@@ -110,6 +122,16 @@ + DefaultVectorsAndStrings, + } + ++/// File specific information. ++/// Symbols declared within a file may be recovered by iterating over all ++/// symbols and examining the `declaration_file` field. ++table SchemaFile { ++ /// Filename, relative to project root. ++ filename:string (required, key); ++ /// Names of included files, relative to project root. ++ included_filenames:[string]; ++} ++ + table Schema { + objects:[Object] (required); // Sorted. + enums:[Enum] (required); // Sorted. +@@ -118,6 +140,9 @@ + root_table:Object; + services:[Service]; // Sorted. + advanced_features:AdvancedFeatures; ++ /// All the files used in this compilation. Files are relative to where ++ /// flatc was invoked. ++ fbs_files:[SchemaFile]; // Sorted. + } + + root_type Schema; +diff -urN a/rust/flatbuffers/Cargo.toml b/rust/flatbuffers/Cargo.toml +--- a/rust/flatbuffers/Cargo.toml 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/Cargo.toml 2023-01-13 07:47:07.806242147 +0000 +@@ -1,6 +1,6 @@ + [package] + name = "flatbuffers" +-version = "2.0.0" ++version = "2.1.0" + edition = "2018" + authors = ["Robert Winslow ", "FlatBuffers Maintainers"] + license = "Apache-2.0" +@@ -11,7 +11,16 @@ + categories = ["encoding", "data-structures", "memory-management"] + rust = "1.51" + ++[features] ++default = ["thiserror"] ++no_std = ["core2", "thiserror_core2"] ++serialize = ["serde"] ++ + [dependencies] + smallvec = "1.6.1" + bitflags = "1.2.1" +-thiserror = "1.0.23" ++serde = { version = "1.0", optional = true } ++thiserror = { version = "1.0.30", optional = true } ++core2 = { version = "0.4.0", optional = true } ++# This version is compliant with mainline 1.0.30 ++thiserror_core2 = { version = "2.0.0", default-features = false, optional = true } +diff -urN a/rust/flatbuffers/README.md b/rust/flatbuffers/README.md +--- a/rust/flatbuffers/README.md 1970-01-01 00:00:00.000000000 +0000 ++++ b/rust/flatbuffers/README.md 2023-01-13 07:47:07.807242156 +0000 +@@ -0,0 +1,15 @@ ++# Flatbuffers ++ ++FlatBuffers is a cross platform serialization library architected for maximum ++memory efficiency. It allows you to directly access serialized data without ++parsing/unpacking it first, while still having great forwards/backwards ++compatibility. It was originally created at Google for game development and ++other performance-critical applications. ++ ++## See our ++* [Tutorial](https://google.github.io/flatbuffers/flatbuffers_guide_tutorial.html) ++* [Landing Page](https://google.github.io/flatbuffers/) ++* [Rust sample binary](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.rs) ++* [Schema**less** format, Flexbuffers](https://crates.io/crates/flexbuffers) ++* [Github](https://github.com/google/flatbuffers) ++ +diff -urN a/rust/flatbuffers/src/array.rs b/rust/flatbuffers/src/array.rs +--- a/rust/flatbuffers/src/array.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/src/array.rs 2023-01-13 07:47:07.807242156 +0000 +@@ -17,9 +17,9 @@ + use crate::follow::Follow; + use crate::vector::VectorIter; + use crate::EndianScalar; +-use std::fmt::{Debug, Formatter, Result}; +-use std::marker::PhantomData; +-use std::mem::size_of; ++use core::fmt::{Debug, Formatter, Result}; ++use core::marker::PhantomData; ++use core::mem::size_of; + + #[derive(Copy, Clone)] + pub struct Array<'a, T: 'a, const N: usize>(&'a [u8], PhantomData); +@@ -133,3 +133,22 @@ + array.assume_init() + } + } ++ ++#[cfg(feature="serialize")] ++impl<'a, T: 'a, const N: usize> serde::ser::Serialize for Array<'a, T, N> ++where ++ T: 'a + Follow<'a>, ++ >::Inner: serde::ser::Serialize, ++{ ++ fn serialize(&self, serializer: S) -> std::result::Result ++ where ++ S: serde::ser::Serializer, ++ { ++ use serde::ser::SerializeSeq; ++ let mut seq = serializer.serialize_seq(Some(self.len()))?; ++ for element in self.iter() { ++ seq.serialize_element(&element)?; ++ } ++ seq.end() ++ } ++} +diff -urN a/rust/flatbuffers/src/builder.rs b/rust/flatbuffers/src/builder.rs +--- a/rust/flatbuffers/src/builder.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/src/builder.rs 2023-01-13 07:47:07.816242239 +0000 +@@ -16,11 +16,13 @@ + + extern crate smallvec; + +-use std::cmp::max; +-use std::iter::{DoubleEndedIterator, ExactSizeIterator}; +-use std::marker::PhantomData; +-use std::ptr::write_bytes; +-use std::slice::from_raw_parts; ++use core::cmp::max; ++use core::iter::{DoubleEndedIterator, ExactSizeIterator}; ++use core::marker::PhantomData; ++use core::ptr::write_bytes; ++use core::slice::from_raw_parts; ++#[cfg(feature = "no_std")] ++use alloc::{vec, vec::Vec}; + + use crate::endian_scalar::{emplace_scalar, read_scalar_at}; + use crate::primitives::*; +@@ -554,42 +556,38 @@ + // serialize every FieldLoc to the vtable: + for &fl in self.field_locs.iter() { + let pos: VOffsetT = (object_revloc_to_vtable.value() - fl.off) as VOffsetT; +- debug_assert_eq!( +- vtfw.get_field_offset(fl.id), +- 0, +- "tried to write a vtable field multiple times" +- ); + vtfw.write_field_offset(fl.id, pos); + } + } +- let dup_vt_use = { +- let this_vt = VTable::init(&self.owned_buf[..], self.head); +- self.find_duplicate_stored_vtable_revloc(this_vt) +- }; +- +- let vt_use = match dup_vt_use { +- Some(n) => { ++ let new_vt_bytes = &self.owned_buf[vt_start_pos..vt_end_pos]; ++ let found = self.written_vtable_revpos.binary_search_by(|old_vtable_revpos: &UOffsetT| { ++ let old_vtable_pos = self.owned_buf.len() - *old_vtable_revpos as usize; ++ let old_vtable = VTable::init(&self.owned_buf, old_vtable_pos); ++ new_vt_bytes.cmp(old_vtable.as_bytes()) ++ }); ++ let final_vtable_revpos = match found { ++ Ok(i) => { ++ // The new vtable is a duplicate so clear it. + VTableWriter::init(&mut self.owned_buf[vt_start_pos..vt_end_pos]).clear(); + self.head += vtable_byte_len; +- n ++ self.written_vtable_revpos[i] + } +- None => { +- let new_vt_use = self.used_space() as UOffsetT; +- self.written_vtable_revpos.push(new_vt_use); +- new_vt_use ++ Err(i) => { ++ // This is a new vtable. Add it to the cache. ++ let new_vt_revpos = self.used_space() as UOffsetT; ++ self.written_vtable_revpos.insert(i, new_vt_revpos); ++ new_vt_revpos + } + }; +- +- { +- let n = self.head + self.used_space() - object_revloc_to_vtable.value() as usize; +- let saw = unsafe { read_scalar_at::(&self.owned_buf, n) }; +- debug_assert_eq!(saw, 0xF0F0_F0F0); +- unsafe { +- emplace_scalar::( +- &mut self.owned_buf[n..n + SIZE_SOFFSET], +- vt_use as SOffsetT - object_revloc_to_vtable.value() as SOffsetT, +- ); +- } ++ // Write signed offset from table to its vtable. ++ let table_pos = self.owned_buf.len() - object_revloc_to_vtable.value() as usize; ++ let tmp_soffset_to_vt = unsafe { read_scalar_at::(&self.owned_buf, table_pos) }; ++ debug_assert_eq!(tmp_soffset_to_vt, 0xF0F0_F0F0); ++ unsafe { ++ emplace_scalar::( ++ &mut self.owned_buf[table_pos..table_pos + SIZE_SOFFSET], ++ final_vtable_revpos as SOffsetT - object_revloc_to_vtable.value() as SOffsetT ++ ); + } + + self.field_locs.clear(); +@@ -597,20 +595,6 @@ + object_revloc_to_vtable + } + +- #[inline] +- fn find_duplicate_stored_vtable_revloc(&self, needle: VTable) -> Option { +- for &revloc in self.written_vtable_revpos.iter().rev() { +- let o = VTable::init( +- &self.owned_buf[..], +- self.head + self.used_space() - revloc as usize, +- ); +- if needle == o { +- return Some(revloc); +- } +- } +- None +- } +- + // Only call this when you know it is safe to double the size of the buffer. + #[inline] + fn grow_owned_buf(&mut self) { +diff -urN a/rust/flatbuffers/src/endian_scalar.rs b/rust/flatbuffers/src/endian_scalar.rs +--- a/rust/flatbuffers/src/endian_scalar.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/src/endian_scalar.rs 2023-01-13 07:47:07.816242239 +0000 +@@ -15,7 +15,7 @@ + */ + #![allow(clippy::wrong_self_convention)] + +-use std::mem::size_of; ++use core::mem::size_of; + + /// Trait for values that must be stored in little-endian byte order, but + /// might be represented in memory as big-endian. Every type that implements +diff -urN a/rust/flatbuffers/src/follow.rs b/rust/flatbuffers/src/follow.rs +--- a/rust/flatbuffers/src/follow.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/src/follow.rs 2023-01-13 07:47:07.816242239 +0000 +@@ -14,7 +14,7 @@ + * limitations under the License. + */ + +-use std::marker::PhantomData; ++use core::marker::PhantomData; + + /// Follow is a trait that allows us to access FlatBuffers in a declarative, + /// type safe, and fast way. They compile down to almost no code (after +diff -urN a/rust/flatbuffers/src/get_root.rs b/rust/flatbuffers/src/get_root.rs +--- a/rust/flatbuffers/src/get_root.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/src/get_root.rs 2023-01-13 07:47:07.816242239 +0000 +@@ -43,7 +43,7 @@ + where + T: 'buf + Follow<'buf> + Verifiable, + { +- let mut v = Verifier::new(&opts, data); ++ let mut v = Verifier::new(opts, data); + >::run_verifier(&mut v, 0)?; + Ok(unsafe { root_unchecked::(data) }) + } +@@ -73,7 +73,7 @@ + where + T: 'buf + Follow<'buf> + Verifiable, + { +- let mut v = Verifier::new(&opts, data); ++ let mut v = Verifier::new(opts, data); + >>::run_verifier(&mut v, 0)?; + Ok(unsafe { size_prefixed_root_unchecked::(data) }) + } +diff -urN a/rust/flatbuffers/src/lib.rs b/rust/flatbuffers/src/lib.rs +--- a/rust/flatbuffers/src/lib.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/src/lib.rs 2023-01-13 07:47:07.816242239 +0000 +@@ -28,6 +28,11 @@ + //! At this time, to generate Rust code, you will need the latest `master` version of `flatc`, available from here: + //! (On OSX, you can install FlatBuffers from `HEAD` with the Homebrew package manager.) + ++#![cfg_attr(feature = "no_std", no_std)] ++ ++#[cfg(feature = "no_std")] ++extern crate alloc; ++ + mod array; + mod builder; + mod endian_scalar; +diff -urN a/rust/flatbuffers/src/primitives.rs b/rust/flatbuffers/src/primitives.rs +--- a/rust/flatbuffers/src/primitives.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/src/primitives.rs 2023-01-13 07:47:07.817242248 +0000 +@@ -14,9 +14,9 @@ + * limitations under the License. + */ + +-use std::marker::PhantomData; +-use std::mem::size_of; +-use std::ops::Deref; ++use core::marker::PhantomData; ++use core::mem::size_of; ++use core::ops::Deref; + + use crate::endian_scalar::{emplace_scalar, read_scalar, read_scalar_at}; + use crate::follow::Follow; +diff -urN a/rust/flatbuffers/src/push.rs b/rust/flatbuffers/src/push.rs +--- a/rust/flatbuffers/src/push.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/src/push.rs 2023-01-13 07:47:07.817242248 +0000 +@@ -14,8 +14,8 @@ + * limitations under the License. + */ + +-use std::cmp::max; +-use std::mem::{align_of, size_of}; ++use core::cmp::max; ++use core::mem::{align_of, size_of}; + + use crate::endian_scalar::emplace_scalar; + +diff -urN a/rust/flatbuffers/src/vector.rs b/rust/flatbuffers/src/vector.rs +--- a/rust/flatbuffers/src/vector.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/src/vector.rs 2023-01-13 07:47:08.193245721 +0000 +@@ -14,12 +14,12 @@ + * limitations under the License. + */ + +-use std::fmt::{Debug, Formatter, Result}; +-use std::iter::{DoubleEndedIterator, ExactSizeIterator, FusedIterator}; +-use std::marker::PhantomData; +-use std::mem::size_of; +-use std::slice::from_raw_parts; +-use std::str::from_utf8_unchecked; ++use core::fmt::{Debug, Formatter, Result}; ++use core::iter::{DoubleEndedIterator, ExactSizeIterator, FusedIterator}; ++use core::marker::PhantomData; ++use core::mem::size_of; ++use core::slice::from_raw_parts; ++use core::str::from_utf8_unchecked; + + use crate::endian_scalar::read_scalar_at; + #[cfg(target_endian = "little")] +@@ -73,7 +73,7 @@ + + #[inline(always)] + pub fn len(&self) -> usize { +- unsafe { read_scalar_at::(&self.0, self.1) as usize } ++ unsafe { read_scalar_at::(self.0, self.1) as usize } + } + #[inline(always)] + pub fn is_empty(&self) -> bool { +@@ -103,7 +103,7 @@ + let loc = self.1; + let sz = size_of::(); + debug_assert!(sz > 0); +- let len = unsafe { read_scalar_at::(&buf, loc) } as usize; ++ let len = unsafe { read_scalar_at::(buf, loc) } as usize; + let data_buf = &buf[loc + SIZE_UOFFSET..loc + SIZE_UOFFSET + len * sz]; + let ptr = data_buf.as_ptr() as *const T; + let s: &'a [T] = unsafe { from_raw_parts(ptr, len) }; +@@ -144,7 +144,7 @@ + impl<'a> Follow<'a> for &'a str { + type Inner = &'a str; + fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { +- let len = unsafe { read_scalar_at::(&buf, loc) } as usize; ++ let len = unsafe { read_scalar_at::(buf, loc) } as usize; + let slice = &buf[loc + SIZE_UOFFSET..loc + SIZE_UOFFSET + len]; + unsafe { from_utf8_unchecked(slice) } + } +@@ -154,7 +154,7 @@ + fn follow_slice_helper(buf: &[u8], loc: usize) -> &[T] { + let sz = size_of::(); + debug_assert!(sz > 0); +- let len = unsafe { read_scalar_at::(&buf, loc) as usize }; ++ let len = unsafe { read_scalar_at::(buf, loc) as usize }; + let data_buf = &buf[loc + SIZE_UOFFSET..loc + SIZE_UOFFSET + len * sz]; + let ptr = data_buf.as_ptr() as *const T; + let s: &[T] = unsafe { from_raw_parts(ptr, len) }; +@@ -308,3 +308,22 @@ + self.iter() + } + } ++ ++#[cfg(feature="serialize")] ++impl<'a, T> serde::ser::Serialize for Vector<'a, T> ++where ++ T: 'a + Follow<'a>, ++ >::Inner: serde::ser::Serialize, ++{ ++ fn serialize(&self, serializer: S) -> std::result::Result ++ where ++ S: serde::ser::Serializer, ++ { ++ use serde::ser::SerializeSeq; ++ let mut seq = serializer.serialize_seq(Some(self.len()))?; ++ for element in self { ++ seq.serialize_element(&element)?; ++ } ++ seq.end() ++ } ++} +diff -urN a/rust/flatbuffers/src/verifier.rs b/rust/flatbuffers/src/verifier.rs +--- a/rust/flatbuffers/src/verifier.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/src/verifier.rs 2023-01-13 07:47:08.193245721 +0000 +@@ -1,6 +1,12 @@ ++#[cfg(feature = "no_std")] ++use alloc::vec::Vec; ++use core::ops::Range; ++use core::option::Option; + use crate::follow::Follow; + use crate::{ForwardsUOffset, SOffsetT, SkipSizePrefix, UOffsetT, VOffsetT, Vector, SIZE_UOFFSET}; +-use std::ops::Range; ++ ++#[cfg(feature="no_std")] ++extern crate thiserror_core2 as thiserror; + use thiserror::Error; + + /// Traces the location of data errors. Not populated for Dos detecting errors. +@@ -23,7 +29,7 @@ + } + #[derive(PartialEq, Eq, Default, Debug, Clone)] + pub struct ErrorTrace(Vec); +-impl std::convert::AsRef<[ErrorTraceDetail]> for ErrorTrace { ++impl core::convert::AsRef<[ErrorTraceDetail]> for ErrorTrace { + #[inline] + fn as_ref(&self) -> &[ErrorTraceDetail] { + &self.0 +@@ -51,7 +57,7 @@ + #[error("Utf8 error for string in {range:?}: {error}\n{error_trace}")] + Utf8Error { + #[source] +- error: std::str::Utf8Error, ++ error: core::str::Utf8Error, + range: Range, + error_trace: ErrorTrace, + }, +@@ -90,8 +96,8 @@ + DepthLimitReached, + } + +-impl std::fmt::Display for ErrorTrace { +- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { ++impl core::fmt::Display for ErrorTrace { ++ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + use ErrorTraceDetail::*; + for e in self.0.iter() { + match e { +@@ -125,7 +131,7 @@ + } + } + +-pub type Result = std::prelude::v1::Result; ++pub type Result = core::result::Result; + + impl InvalidFlatbuffer { + fn new_range_oob(start: usize, end: usize) -> Result { +@@ -245,11 +251,11 @@ + /// `buffer[0]`. TODO(caspern). + #[inline] + fn is_aligned(&self, pos: usize) -> Result<()> { +- if pos % std::mem::align_of::() == 0 { ++ if pos % core::mem::align_of::() == 0 { + Ok(()) + } else { + Err(InvalidFlatbuffer::Unaligned { +- unaligned_type: std::any::type_name::(), ++ unaligned_type: core::any::type_name::(), + position: pos, + error_trace: Default::default(), + }) +@@ -271,7 +277,7 @@ + #[inline] + pub fn in_buffer(&mut self, pos: usize) -> Result<()> { + self.is_aligned::(pos)?; +- self.range_in_buffer(pos, std::mem::size_of::()) ++ self.range_in_buffer(pos, core::mem::size_of::()) + } + #[inline] + fn get_u16(&mut self, pos: usize) -> Result { +@@ -416,7 +422,7 @@ + where + Key: Follow<'buf> + Verifiable, + UnionVerifier: +- (std::ops::FnOnce(>::Inner, &mut Verifier, usize) -> Result<()>), ++ (core::ops::FnOnce(>::Inner, &mut Verifier, usize) -> Result<()>), + // NOTE: >::Inner == Key + { + // TODO(caspern): how to trace vtable errors? +@@ -468,14 +474,14 @@ + } + + /// Checks and returns the range containing the flatbuffers vector. +-fn verify_vector_range(v: &mut Verifier, pos: usize) -> Result> { ++fn verify_vector_range(v: &mut Verifier, pos: usize) -> Result> { + let len = v.get_uoffset(pos)? as usize; + let start = pos.saturating_add(SIZE_UOFFSET); + v.is_aligned::(start)?; +- let size = len.saturating_mul(std::mem::size_of::()); ++ let size = len.saturating_mul(core::mem::size_of::()); + let end = start.saturating_add(size); + v.range_in_buffer(start, size)?; +- Ok(std::ops::Range { start, end }) ++ Ok(core::ops::Range { start, end }) + } + + pub trait SimpleToVerifyInSlice {} +@@ -509,7 +515,7 @@ + #[inline] + fn run_verifier(v: &mut Verifier, pos: usize) -> Result<()> { + let range = verify_vector_range::>(v, pos)?; +- let size = std::mem::size_of::>(); ++ let size = core::mem::size_of::>(); + for (i, element_pos) in range.step_by(size).enumerate() { + trace_elem( + >::run_verifier(v, element_pos), +@@ -526,7 +532,7 @@ + fn run_verifier(v: &mut Verifier, pos: usize) -> Result<()> { + let range = verify_vector_range::(v, pos)?; + let has_null_terminator = v.buffer.get(range.end).map(|&b| b == 0).unwrap_or(false); +- let s = std::str::from_utf8(&v.buffer[range.clone()]); ++ let s = core::str::from_utf8(&v.buffer[range.clone()]); + if let Err(error) = s { + return Err(InvalidFlatbuffer::Utf8Error { + error, +diff -urN a/rust/flatbuffers/src/vtable_writer.rs b/rust/flatbuffers/src/vtable_writer.rs +--- a/rust/flatbuffers/src/vtable_writer.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flatbuffers/src/vtable_writer.rs 2023-01-13 07:47:08.194245730 +0000 +@@ -14,9 +14,9 @@ + * limitations under the License. + */ + +-use std::ptr::write_bytes; ++use core::ptr::write_bytes; + +-use crate::endian_scalar::{emplace_scalar, read_scalar_at}; ++use crate::endian_scalar::emplace_scalar; + use crate::primitives::*; + + /// VTableWriter compartmentalizes actions needed to create a vtable. +@@ -54,16 +54,6 @@ + } + } + +- /// Gets an object field offset from the vtable. Only used for debugging. +- /// +- /// Note that this expects field offsets (which are like pointers), not +- /// field ids (which are like array indices). +- #[inline(always)] +- pub fn get_field_offset(&self, vtable_offset: VOffsetT) -> VOffsetT { +- let idx = vtable_offset as usize; +- unsafe { read_scalar_at::(&self.buf, idx) } +- } +- + /// Writes an object field offset into the vtable. + /// + /// Note that this expects field offsets (which are like pointers), not +diff -urN a/rust/flexbuffers/src/buffer.rs b/rust/flexbuffers/src/buffer.rs +--- a/rust/flexbuffers/src/buffer.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flexbuffers/src/buffer.rs 2023-01-13 07:47:07.474239080 +0000 +@@ -1,6 +1,6 @@ + use std::ops::{Deref, Range}; + +-/// The underlying buffer that is used by a flexbuffer Reader. ++/// The underlying buffer that is used by a flexbuffer Reader. + /// + /// This allows for custom buffer implementations as long as they can be viewed as a &[u8]. + pub trait Buffer: Deref + Sized { +@@ -14,12 +14,12 @@ + /// A BufferString which will live at least as long as the Buffer itself. + /// + /// Deref's to UTF-8 `str`, and only generated from the `buffer_str` function Result. +- type BufferString: Deref + Sized; ++ type BufferString: Deref + Sized + serde::ser::Serialize; + + /// This method returns an instance of type Self. This allows for lifetimes to be tracked + /// in cases of deserialization. + /// +- /// It also lets custom buffers manage reference counts. ++ /// It also lets custom buffers manage reference counts. + /// + /// Returns None if: + /// - range start is greater than end +@@ -48,7 +48,7 @@ + Self::empty().buffer_str().unwrap() + } + +- /// Attempts to convert the given buffer to a custom string type. ++ /// Attempts to convert the given buffer to a custom string type. + /// + /// This should fail if the type does not have valid UTF-8 bytes, and must be zero copy. + fn buffer_str(&self) -> Result; +@@ -78,4 +78,3 @@ + std::str::from_utf8(self) + } + } +- +diff -urN a/rust/flexbuffers/src/builder/map.rs b/rust/flexbuffers/src/builder/map.rs +--- a/rust/flexbuffers/src/builder/map.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flexbuffers/src/builder/map.rs 2023-01-13 07:47:07.475239089 +0000 +@@ -97,8 +97,7 @@ + // preferred over custom sorting or adding another dependency. By construction, this part + // of the values stack must be alternating (key, value) pairs. The public API must not be + // able to trigger the above debug_assets that protect this unsafe usage. +- let pairs: &mut [[Value; 2]] = +- unsafe { std::slice::from_raw_parts_mut(raw_pairs, pairs_len) }; ++ let pairs: &mut [[Value; 2]] = unsafe { std::slice::from_raw_parts_mut(raw_pairs, pairs_len) }; + #[rustfmt::skip] + pairs.sort_unstable_by(|[key1, _], [key2, _]| { + if let Value::Key(a1) = *key1 { +diff -urN a/rust/flexbuffers/src/builder/mod.rs b/rust/flexbuffers/src/builder/mod.rs +--- a/rust/flexbuffers/src/builder/mod.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flexbuffers/src/builder/mod.rs 2023-01-13 07:47:07.475239089 +0000 +@@ -32,10 +32,11 @@ + fn $push_name(&mut self, xs: S) + where + T: Into<$scalar> + Copy, +- S: AsRef<[T]> ++ S: AsRef<[T]>, + { + let mut value = Value::$new_vec(xs.as_ref().len()); +- let mut width = xs.as_ref() ++ let mut width = xs ++ .as_ref() + .iter() + .map(|x| BitWidth::from((*x).into())) + .max() +@@ -56,7 +57,7 @@ + value.set_child_width_or_panic(width); + self.values.push(value); + } +- } ++ }; + } + macro_rules! push_indirect { + ($push_name: ident, $scalar: ty, $Direct: ident, $Indirect: ident) => { +@@ -65,15 +66,13 @@ + let child_width = x.width_or_child_width(); + let address = self.buffer.len(); + store_value(&mut self.buffer, x, child_width); +- self.values.push( +- Value::Reference { +- address, +- child_width, +- fxb_type: FlexBufferType::$Indirect, +- } +- ); ++ self.values.push(Value::Reference { ++ address, ++ child_width, ++ fxb_type: FlexBufferType::$Indirect, ++ }); + } +- } ++ }; + } + + bitflags! { +diff -urN a/rust/flexbuffers/src/builder/ser.rs b/rust/flexbuffers/src/builder/ser.rs +--- a/rust/flexbuffers/src/builder/ser.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flexbuffers/src/builder/ser.rs 2023-01-13 07:47:07.482239154 +0000 +@@ -36,6 +36,10 @@ + pub fn take_buffer(&mut self) -> Vec { + self.builder.take_buffer() + } ++ pub fn reset(&mut self) { ++ self.builder.reset(); ++ self.nesting.clear(); ++ } + fn finish_if_not_nested(&mut self) -> Result<(), Error> { + if self.nesting.is_empty() { + assert_eq!(self.builder.values.len(), 1); +diff -urN a/rust/flexbuffers/src/lib.rs b/rust/flexbuffers/src/lib.rs +--- a/rust/flexbuffers/src/lib.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flexbuffers/src/lib.rs 2023-01-13 07:47:07.474239080 +0000 +@@ -41,18 +41,18 @@ + extern crate serde; + + mod bitwidth; ++mod buffer; + mod builder; + mod flexbuffer_type; + mod reader; +-mod buffer; + + pub use bitwidth::BitWidth; ++pub use buffer::Buffer; + pub use builder::Error as SerializationError; + pub use builder::{ + singleton, Builder, BuilderOptions, FlexbufferSerializer, MapBuilder, Pushable, VectorBuilder, + }; + pub use flexbuffer_type::FlexBufferType; +-pub use buffer::Buffer; + pub use reader::Error as ReaderError; + pub use reader::{DeserializationError, MapReader, Reader, ReaderIterator, VectorReader}; + use serde::{Deserialize, Serialize}; +@@ -76,7 +76,7 @@ + + /// Deserialize a type from a flexbuffer. + pub fn from_buffer<'de, T: Deserialize<'de>, B: Buffer>( +- buf: &'de B ++ buf: &'de B, + ) -> Result { + let r = Reader::get_root(buf as &'de [u8])?; + T::deserialize(r) +diff -urN a/rust/flexbuffers/src/reader/mod.rs b/rust/flexbuffers/src/reader/mod.rs +--- a/rust/flexbuffers/src/reader/mod.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flexbuffers/src/reader/mod.rs 2023-01-13 07:47:07.760241721 +0000 +@@ -14,7 +14,7 @@ + + use crate::bitwidth::BitWidth; + use crate::flexbuffer_type::FlexBufferType; +-use crate::{Buffer, Blob}; ++use crate::{Blob, Buffer}; + use std::convert::{TryFrom, TryInto}; + use std::fmt; + use std::ops::Rem; +@@ -22,6 +22,7 @@ + mod de; + mod iter; + mod map; ++mod serialize; + mod vector; + pub use de::DeserializationError; + pub use iter::ReaderIterator; +@@ -184,13 +185,12 @@ + } + } + +- + macro_rules! try_cast_fn { + ($name: ident, $full_width: ident, $Ty: ident) => { + pub fn $name(&self) -> $Ty { + self.$full_width().try_into().unwrap_or_default() + } +- } ++ }; + } + + fn safe_sub(a: usize, b: usize) -> Result { +@@ -242,7 +242,7 @@ + } + + /// Convenience function to get the underlying buffer. By using `shallow_copy`, this preserves +- /// the lifetime that the underlying buffer has. ++ /// the lifetime that the underlying buffer has. + pub fn buffer(&self) -> B { + self.buffer.shallow_copy() + } +@@ -263,7 +263,11 @@ + if let Some(len) = self.fxb_type.fixed_length_vector_length() { + len + } else if self.fxb_type.has_length_slot() && self.address >= self.width.n_bytes() { +- read_usize(&self.buffer, self.address - self.width.n_bytes(), self.width) ++ read_usize( ++ &self.buffer, ++ self.address - self.width.n_bytes(), ++ self.width, ++ ) + } else { + 0 + } +@@ -359,7 +363,8 @@ + + /// Retrieves the string value up until the first `\0` character. + pub fn get_key(&self) -> Result { +- let bytes = self.buffer ++ let bytes = self ++ .buffer + .slice(self.address..self.address + self.get_key_len()?) + .ok_or(Error::IndexOutOfBounds)?; + Ok(bytes.buffer_str()?) +@@ -368,9 +373,9 @@ + pub fn get_blob(&self) -> Result, Error> { + self.expect_type(FlexBufferType::Blob)?; + Ok(Blob( +- self.buffer +- .slice(self.address..self.address + self.length()) +- .ok_or(Error::IndexOutOfBounds)? ++ self.buffer ++ .slice(self.address..self.address + self.length()) ++ .ok_or(Error::IndexOutOfBounds)?, + )) + } + +@@ -382,7 +387,9 @@ + /// is out of bounds. + pub fn get_str(&self) -> Result { + self.expect_type(FlexBufferType::String)?; +- let bytes = self.buffer.slice(self.address..self.address + self.length()); ++ let bytes = self ++ .buffer ++ .slice(self.address..self.address + self.length()); + Ok(bytes.ok_or(Error::ReadUsizeOverflowed)?.buffer_str()?) + } + +@@ -666,4 +673,4 @@ + let w = BitWidth::try_from(ty & 3u8).map_err(|_| Error::InvalidPackedType)?; + let t = FlexBufferType::try_from(ty >> 2).map_err(|_| Error::InvalidPackedType)?; + Ok((t, w)) +-} +\ No newline at end of file ++} +diff -urN a/rust/flexbuffers/src/reader/serialize.rs b/rust/flexbuffers/src/reader/serialize.rs +--- a/rust/flexbuffers/src/reader/serialize.rs 1970-01-01 00:00:00.000000000 +0000 ++++ b/rust/flexbuffers/src/reader/serialize.rs 2023-01-13 07:47:07.789241990 +0000 +@@ -0,0 +1,76 @@ ++// Copyright 2021 Google LLC ++// ++// 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 ++// ++// https://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. ++ ++use crate::reader::Reader; ++use crate::Buffer; ++use crate::{BitWidth::*, FlexBufferType::*}; ++use serde::ser; ++use serde::ser::{SerializeMap, SerializeSeq}; ++ ++impl ser::Serialize for &Reader { ++ fn serialize(&self, serializer: S) -> Result ++ where ++ S: ser::Serializer, ++ { ++ #[allow(deprecated)] ++ match (self.flexbuffer_type(), self.bitwidth()) { ++ (Null, _) => serializer.serialize_unit(), ++ (Int, W8) | (IndirectInt, W8) => serializer.serialize_i8(self.as_i8()), ++ (Int, W16) | (IndirectInt, W16) => serializer.serialize_i16(self.as_i16()), ++ (Int, W32) | (IndirectInt, W32) => serializer.serialize_i32(self.as_i32()), ++ (Int, W64) | (IndirectInt, W64) => serializer.serialize_i64(self.as_i64()), ++ (UInt, W8) | (IndirectUInt, W8) => serializer.serialize_u8(self.as_u8()), ++ (UInt, W16) | (IndirectUInt, W16) => serializer.serialize_u16(self.as_u16()), ++ (UInt, W32) | (IndirectUInt, W32) => serializer.serialize_u32(self.as_u32()), ++ (UInt, W64) | (IndirectUInt, W64) => serializer.serialize_u64(self.as_u64()), ++ (Float, W32) | (IndirectFloat, W32) => serializer.serialize_f32(self.as_f32()), ++ (Float, _) | (IndirectFloat, _) => serializer.serialize_f64(self.as_f64()), ++ (Bool, _) => serializer.serialize_bool(self.as_bool()), ++ (Key, _) | (String, _) => serializer.serialize_str(&self.as_str()), ++ (Map, _) => { ++ let m = self.as_map(); ++ let mut map_serializer = serializer.serialize_map(Some(m.len()))?; ++ for (k, v) in m.iter_keys().zip(m.iter_values()) { ++ map_serializer.serialize_key(&&k)?; ++ map_serializer.serialize_value(&&v)?; ++ } ++ map_serializer.end() ++ } ++ (Vector, _) ++ | (VectorInt, _) ++ | (VectorUInt, _) ++ | (VectorFloat, _) ++ | (VectorKey, _) ++ | (VectorString, _) ++ | (VectorBool, _) ++ | (VectorInt2, _) ++ | (VectorUInt2, _) ++ | (VectorFloat2, _) ++ | (VectorInt3, _) ++ | (VectorUInt3, _) ++ | (VectorFloat3, _) ++ | (VectorInt4, _) ++ | (VectorUInt4, _) ++ | (VectorFloat4, _) => { ++ let v = self.as_vector(); ++ let mut seq_serializer = serializer.serialize_seq(Some(v.len()))?; ++ for x in v.iter() { ++ seq_serializer.serialize_element(&&x)?; ++ } ++ seq_serializer.end() ++ } ++ (Blob, _) => serializer.serialize_bytes(&self.as_blob().0), ++ } ++ } ++} +diff -urN a/rust/flexbuffers/src/reader/vector.rs b/rust/flexbuffers/src/reader/vector.rs +--- a/rust/flexbuffers/src/reader/vector.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/rust/flexbuffers/src/reader/vector.rs 2023-01-13 07:47:07.806242147 +0000 +@@ -40,7 +40,7 @@ + fn default() -> Self { + VectorReader { + reader: Reader::default(), +- length: usize::default() ++ length: usize::default(), + } + } + } +diff -urN a/samples/dart_sample.sh b/samples/dart_sample.sh +--- a/samples/dart_sample.sh 2021-05-10 18:45:16.000000000 +0000 ++++ b/samples/dart_sample.sh 2023-01-13 07:46:54.481119084 +0000 +@@ -1,4 +1,5 @@ + #!/bin/bash ++set -euo + # + # Copyright 2018 Dan Field. All rights reserved. + # +@@ -27,14 +28,12 @@ + exit 1 + fi + +-cd ../dart/example +- + # Run `flatc`. Note: This requires you to compile using `cmake` from the + # root `/flatbuffers` directory. +-if [ -e ../../flatc ]; then +- ../../flatc --dart ../../samples/monster.fbs +-elif [ -e ../../Debug/flatc ]; then +- ../../Debug/flatc --dart ../../samples/monster.fbs ++if [ -e ../flatc ]; then ++ ../flatc --dart -o ../dart/example/ monster.fbs ++elif [ -e ../Debug/flatc ]; then ++ ../Debug/flatc --dart -o ../dart/example/ monster.fbs + else + echo 'flatc' could not be found. Make sure to build FlatBuffers from the \ + $rootdir directory. +@@ -44,9 +43,7 @@ + echo Running the Dart sample. + + # Execute the sample. +-dart example.dart +- +-# Cleanup temporary files. +-git checkout monster_my_game.sample_generated.dart ++dart ../dart/example/example.dart + +-cd ../../samples ++# Copy the source schema so it is distributed when published to pub.dev ++cp monster.fbs ../dart/example/ +\ No newline at end of file +Binary files a/samples/monster.bfbs and b/samples/monster.bfbs differ +diff -urN a/samples/monster_generated.h b/samples/monster_generated.h +--- a/samples/monster_generated.h 2021-05-10 18:45:16.000000000 +0000 ++++ b/samples/monster_generated.h 2023-01-13 07:46:54.481119084 +0000 +@@ -103,6 +103,14 @@ + static const Equipment enum_value = Equipment_Weapon; + }; + ++template struct EquipmentUnionTraits { ++ static const Equipment enum_value = Equipment_NONE; ++}; ++ ++template<> struct EquipmentUnionTraits { ++ static const Equipment enum_value = Equipment_Weapon; ++}; ++ + struct EquipmentUnion { + Equipment type; + void *value; +@@ -120,17 +128,15 @@ + + void Reset(); + +-#ifndef FLATBUFFERS_CPP98_STL + template + void Set(T&& val) { +- using RT = typename std::remove_reference::type; ++ typedef typename std::remove_reference::type RT; + Reset(); +- type = EquipmentTraits::enum_value; ++ type = EquipmentUnionTraits::enum_value; + if (type != Equipment_NONE) { + value = new RT(std::forward(val)); + } + } +-#endif // FLATBUFFERS_CPP98_STL + + static void *UnPack(const void *obj, Equipment type, const flatbuffers::resolver_function_t *resolver); + flatbuffers::Offset Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher = nullptr) const; +@@ -233,26 +239,12 @@ + std::vector> weapons{}; + MyGame::Sample::EquipmentUnion equipped{}; + std::vector path{}; ++ MonsterT() = default; ++ MonsterT(const MonsterT &o); ++ MonsterT(MonsterT&&) FLATBUFFERS_NOEXCEPT = default; ++ MonsterT &operator=(MonsterT o) FLATBUFFERS_NOEXCEPT; + }; + +-inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { +- return +- (lhs.pos == rhs.pos) && +- (lhs.mana == rhs.mana) && +- (lhs.hp == rhs.hp) && +- (lhs.name == rhs.name) && +- (lhs.inventory == rhs.inventory) && +- (lhs.color == rhs.color) && +- (lhs.weapons == rhs.weapons) && +- (lhs.equipped == rhs.equipped) && +- (lhs.path == rhs.path); +-} +- +-inline bool operator!=(const MonsterT &lhs, const MonsterT &rhs) { +- return !(lhs == rhs); +-} +- +- + struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef MonsterT NativeTableType; + typedef MonsterBuilder Builder; +@@ -280,13 +272,13 @@ + int16_t mana() const { + return GetField(VT_MANA, 150); + } +- bool mutate_mana(int16_t _mana) { ++ bool mutate_mana(int16_t _mana = 150) { + return SetField(VT_MANA, _mana, 150); + } + int16_t hp() const { + return GetField(VT_HP, 100); + } +- bool mutate_hp(int16_t _hp) { ++ bool mutate_hp(int16_t _hp = 100) { + return SetField(VT_HP, _hp, 100); + } + const flatbuffers::String *name() const { +@@ -304,7 +296,7 @@ + MyGame::Sample::Color color() const { + return static_cast(GetField(VT_COLOR, 2)); + } +- bool mutate_color(MyGame::Sample::Color _color) { ++ bool mutate_color(MyGame::Sample::Color _color = static_cast(2)) { + return SetField(VT_COLOR, static_cast(_color), 2); + } + const flatbuffers::Vector> *weapons() const { +@@ -334,18 +326,18 @@ + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && +- VerifyField(verifier, VT_POS) && +- VerifyField(verifier, VT_MANA) && +- VerifyField(verifier, VT_HP) && ++ VerifyField(verifier, VT_POS, 4) && ++ VerifyField(verifier, VT_MANA, 2) && ++ VerifyField(verifier, VT_HP, 2) && + VerifyOffset(verifier, VT_NAME) && + verifier.VerifyString(name()) && + VerifyOffset(verifier, VT_INVENTORY) && + verifier.VerifyVector(inventory()) && +- VerifyField(verifier, VT_COLOR) && ++ VerifyField(verifier, VT_COLOR, 1) && + VerifyOffset(verifier, VT_WEAPONS) && + verifier.VerifyVector(weapons()) && + verifier.VerifyVectorOfTables(weapons()) && +- VerifyField(verifier, VT_EQUIPPED_TYPE) && ++ VerifyField(verifier, VT_EQUIPPED_TYPE, 1) && + VerifyOffset(verifier, VT_EQUIPPED) && + VerifyEquipment(verifier, equipped(), equipped_type()) && + VerifyOffset(verifier, VT_PATH) && +@@ -408,7 +400,7 @@ + + inline flatbuffers::Offset CreateMonster( + flatbuffers::FlatBufferBuilder &_fbb, +- const MyGame::Sample::Vec3 *pos = 0, ++ const MyGame::Sample::Vec3 *pos = nullptr, + int16_t mana = 150, + int16_t hp = 100, + flatbuffers::Offset name = 0, +@@ -434,7 +426,7 @@ + + inline flatbuffers::Offset CreateMonsterDirect( + flatbuffers::FlatBufferBuilder &_fbb, +- const MyGame::Sample::Vec3 *pos = 0, ++ const MyGame::Sample::Vec3 *pos = nullptr, + int16_t mana = 150, + int16_t hp = 100, + const char *name = nullptr, +@@ -470,17 +462,6 @@ + int16_t damage = 0; + }; + +-inline bool operator==(const WeaponT &lhs, const WeaponT &rhs) { +- return +- (lhs.name == rhs.name) && +- (lhs.damage == rhs.damage); +-} +- +-inline bool operator!=(const WeaponT &lhs, const WeaponT &rhs) { +- return !(lhs == rhs); +-} +- +- + struct Weapon FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { + typedef WeaponT NativeTableType; + typedef WeaponBuilder Builder; +@@ -500,14 +481,14 @@ + int16_t damage() const { + return GetField(VT_DAMAGE, 0); + } +- bool mutate_damage(int16_t _damage) { ++ bool mutate_damage(int16_t _damage = 0) { + return SetField(VT_DAMAGE, _damage, 0); + } + bool Verify(flatbuffers::Verifier &verifier) const { + return VerifyTableStart(verifier) && + VerifyOffset(verifier, VT_NAME) && + verifier.VerifyString(name()) && +- VerifyField(verifier, VT_DAMAGE) && ++ VerifyField(verifier, VT_DAMAGE, 2) && + verifier.EndTable(); + } + WeaponT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; +@@ -559,6 +540,51 @@ + + flatbuffers::Offset CreateWeapon(flatbuffers::FlatBufferBuilder &_fbb, const WeaponT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); + ++ ++inline bool operator==(const MonsterT &lhs, const MonsterT &rhs) { ++ return ++ ((lhs.pos == rhs.pos) || (lhs.pos && rhs.pos && *lhs.pos == *rhs.pos)) && ++ (lhs.mana == rhs.mana) && ++ (lhs.hp == rhs.hp) && ++ (lhs.name == rhs.name) && ++ (lhs.inventory == rhs.inventory) && ++ (lhs.color == rhs.color) && ++ (lhs.weapons == rhs.weapons) && ++ (lhs.equipped == rhs.equipped) && ++ (lhs.path == rhs.path); ++} ++ ++inline bool operator!=(const MonsterT &lhs, const MonsterT &rhs) { ++ return !(lhs == rhs); ++} ++ ++ ++inline MonsterT::MonsterT(const MonsterT &o) ++ : pos((o.pos) ? new MyGame::Sample::Vec3(*o.pos) : nullptr), ++ mana(o.mana), ++ hp(o.hp), ++ name(o.name), ++ inventory(o.inventory), ++ color(o.color), ++ equipped(o.equipped), ++ path(o.path) { ++ weapons.reserve(o.weapons.size()); ++ for (const auto &v : o.weapons) { weapons.emplace_back((v) ? new MyGame::Sample::WeaponT(*v) : nullptr); } ++} ++ ++inline MonsterT &MonsterT::operator=(MonsterT o) FLATBUFFERS_NOEXCEPT { ++ std::swap(pos, o.pos); ++ std::swap(mana, o.mana); ++ std::swap(hp, o.hp); ++ std::swap(name, o.name); ++ std::swap(inventory, o.inventory); ++ std::swap(color, o.color); ++ std::swap(weapons, o.weapons); ++ std::swap(equipped, o.equipped); ++ std::swap(path, o.path); ++ return *this; ++} ++ + inline MonsterT *Monster::UnPack(const flatbuffers::resolver_function_t *_resolver) const { + auto _o = std::unique_ptr(new MonsterT()); + UnPackTo(_o.get(), _resolver); +@@ -574,7 +600,7 @@ + { auto _e = name(); if (_e) _o->name = _e->str(); } + { auto _e = inventory(); if (_e) { _o->inventory.resize(_e->size()); std::copy(_e->begin(), _e->end(), _o->inventory.begin()); } } + { auto _e = color(); _o->color = _e; } +- { auto _e = weapons(); if (_e) { _o->weapons.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->weapons[_i] = flatbuffers::unique_ptr(_e->Get(_i)->UnPack(_resolver)); } } } ++ { auto _e = weapons(); if (_e) { _o->weapons.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->weapons[_i]) { _e->Get(_i)->UnPackTo(_o->weapons[_i].get(), _resolver); } else { _o->weapons[_i] = flatbuffers::unique_ptr(_e->Get(_i)->UnPack(_resolver)); }; } } } + { auto _e = equipped_type(); _o->equipped.type = _e; } + { auto _e = equipped(); if (_e) _o->equipped.value = MyGame::Sample::EquipmentUnion::UnPack(_e, equipped_type(), _resolver); } + { auto _e = path(); if (_e) { _o->path.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->path[_i] = *_e->Get(_i); } } } +@@ -612,6 +638,18 @@ + _path); + } + ++ ++inline bool operator==(const WeaponT &lhs, const WeaponT &rhs) { ++ return ++ (lhs.name == rhs.name) && ++ (lhs.damage == rhs.damage); ++} ++ ++inline bool operator!=(const WeaponT &lhs, const WeaponT &rhs) { ++ return !(lhs == rhs); ++} ++ ++ + inline WeaponT *Weapon::UnPack(const flatbuffers::resolver_function_t *_resolver) const { + auto _o = std::unique_ptr(new WeaponT()); + UnPackTo(_o.get(), _resolver); +@@ -667,6 +705,7 @@ + } + + inline void *EquipmentUnion::UnPack(const void *obj, Equipment type, const flatbuffers::resolver_function_t *resolver) { ++ (void)resolver; + switch (type) { + case Equipment_Weapon: { + auto ptr = reinterpret_cast(obj); +@@ -677,6 +716,7 @@ + } + + inline flatbuffers::Offset EquipmentUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const { ++ (void)_rehasher; + switch (type) { + case Equipment_Weapon: { + auto ptr = reinterpret_cast(value); +@@ -832,6 +872,10 @@ + return flatbuffers::GetMutableRoot(buf); + } + ++inline MyGame::Sample::Monster *GetMutableSizePrefixedMonster(void *buf) { ++ return flatbuffers::GetMutableSizePrefixedRoot(buf); ++} ++ + inline bool VerifyMonsterBuffer( + flatbuffers::Verifier &verifier) { + return verifier.VerifyBuffer(nullptr); +diff -urN a/samples/monster_generated.rs b/samples/monster_generated.rs +--- a/samples/monster_generated.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/samples/monster_generated.rs 1970-01-01 00:00:00.000000000 +0000 +@@ -1,1006 +0,0 @@ +-// automatically generated by the FlatBuffers compiler, do not modify +- +- +- +-use std::mem; +-use std::cmp::Ordering; +- +-extern crate flatbuffers; +-use self::flatbuffers::{EndianScalar, Follow}; +- +-#[allow(unused_imports, dead_code)] +-pub mod my_game { +- +- use std::mem; +- use std::cmp::Ordering; +- +- extern crate flatbuffers; +- use self::flatbuffers::{EndianScalar, Follow}; +-#[allow(unused_imports, dead_code)] +-pub mod sample { +- +- use std::mem; +- use std::cmp::Ordering; +- +- extern crate flatbuffers; +- use self::flatbuffers::{EndianScalar, Follow}; +- +-#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +-pub const ENUM_MIN_COLOR: i8 = 0; +-#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +-pub const ENUM_MAX_COLOR: i8 = 2; +-#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +-#[allow(non_camel_case_types)] +-pub const ENUM_VALUES_COLOR: [Color; 3] = [ +- Color::Red, +- Color::Green, +- Color::Blue, +-]; +- +-#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] +-#[repr(transparent)] +-pub struct Color(pub i8); +-#[allow(non_upper_case_globals)] +-impl Color { +- pub const Red: Self = Self(0); +- pub const Green: Self = Self(1); +- pub const Blue: Self = Self(2); +- +- pub const ENUM_MIN: i8 = 0; +- pub const ENUM_MAX: i8 = 2; +- pub const ENUM_VALUES: &'static [Self] = &[ +- Self::Red, +- Self::Green, +- Self::Blue, +- ]; +- /// Returns the variant's name or "" if unknown. +- pub fn variant_name(self) -> Option<&'static str> { +- match self { +- Self::Red => Some("Red"), +- Self::Green => Some("Green"), +- Self::Blue => Some("Blue"), +- _ => None, +- } +- } +-} +-impl std::fmt::Debug for Color { +- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { +- if let Some(name) = self.variant_name() { +- f.write_str(name) +- } else { +- f.write_fmt(format_args!("", self.0)) +- } +- } +-} +-impl<'a> flatbuffers::Follow<'a> for Color { +- type Inner = Self; +- #[inline] +- fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { +- let b = unsafe { +- flatbuffers::read_scalar_at::(buf, loc) +- }; +- Self(b) +- } +-} +- +-impl flatbuffers::Push for Color { +- type Output = Color; +- #[inline] +- fn push(&self, dst: &mut [u8], _rest: &[u8]) { +- unsafe { flatbuffers::emplace_scalar::(dst, self.0); } +- } +-} +- +-impl flatbuffers::EndianScalar for Color { +- #[inline] +- fn to_little_endian(self) -> Self { +- let b = i8::to_le(self.0); +- Self(b) +- } +- #[inline] +- #[allow(clippy::wrong_self_convention)] +- fn from_little_endian(self) -> Self { +- let b = i8::from_le(self.0); +- Self(b) +- } +-} +- +-impl<'a> flatbuffers::Verifiable for Color { +- #[inline] +- fn run_verifier( +- v: &mut flatbuffers::Verifier, pos: usize +- ) -> Result<(), flatbuffers::InvalidFlatbuffer> { +- use self::flatbuffers::Verifiable; +- i8::run_verifier(v, pos) +- } +-} +- +-impl flatbuffers::SimpleToVerifyInSlice for Color {} +-#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +-pub const ENUM_MIN_EQUIPMENT: u8 = 0; +-#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +-pub const ENUM_MAX_EQUIPMENT: u8 = 1; +-#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] +-#[allow(non_camel_case_types)] +-pub const ENUM_VALUES_EQUIPMENT: [Equipment; 2] = [ +- Equipment::NONE, +- Equipment::Weapon, +-]; +- +-#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] +-#[repr(transparent)] +-pub struct Equipment(pub u8); +-#[allow(non_upper_case_globals)] +-impl Equipment { +- pub const NONE: Self = Self(0); +- pub const Weapon: Self = Self(1); +- +- pub const ENUM_MIN: u8 = 0; +- pub const ENUM_MAX: u8 = 1; +- pub const ENUM_VALUES: &'static [Self] = &[ +- Self::NONE, +- Self::Weapon, +- ]; +- /// Returns the variant's name or "" if unknown. +- pub fn variant_name(self) -> Option<&'static str> { +- match self { +- Self::NONE => Some("NONE"), +- Self::Weapon => Some("Weapon"), +- _ => None, +- } +- } +-} +-impl std::fmt::Debug for Equipment { +- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { +- if let Some(name) = self.variant_name() { +- f.write_str(name) +- } else { +- f.write_fmt(format_args!("", self.0)) +- } +- } +-} +-impl<'a> flatbuffers::Follow<'a> for Equipment { +- type Inner = Self; +- #[inline] +- fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { +- let b = unsafe { +- flatbuffers::read_scalar_at::(buf, loc) +- }; +- Self(b) +- } +-} +- +-impl flatbuffers::Push for Equipment { +- type Output = Equipment; +- #[inline] +- fn push(&self, dst: &mut [u8], _rest: &[u8]) { +- unsafe { flatbuffers::emplace_scalar::(dst, self.0); } +- } +-} +- +-impl flatbuffers::EndianScalar for Equipment { +- #[inline] +- fn to_little_endian(self) -> Self { +- let b = u8::to_le(self.0); +- Self(b) +- } +- #[inline] +- #[allow(clippy::wrong_self_convention)] +- fn from_little_endian(self) -> Self { +- let b = u8::from_le(self.0); +- Self(b) +- } +-} +- +-impl<'a> flatbuffers::Verifiable for Equipment { +- #[inline] +- fn run_verifier( +- v: &mut flatbuffers::Verifier, pos: usize +- ) -> Result<(), flatbuffers::InvalidFlatbuffer> { +- use self::flatbuffers::Verifiable; +- u8::run_verifier(v, pos) +- } +-} +- +-impl flatbuffers::SimpleToVerifyInSlice for Equipment {} +-pub struct EquipmentUnionTableOffset {} +- +-#[non_exhaustive] +-#[derive(Debug, Clone, PartialEq)] +-pub enum EquipmentT { +- NONE, +- Weapon(Box), +-} +-impl Default for EquipmentT { +- fn default() -> Self { +- Self::NONE +- } +-} +-impl EquipmentT { +- pub fn equipment_type(&self) -> Equipment { +- match self { +- Self::NONE => Equipment::NONE, +- Self::Weapon(_) => Equipment::Weapon, +- } +- } +- pub fn pack(&self, fbb: &mut flatbuffers::FlatBufferBuilder) -> Option> { +- match self { +- Self::NONE => None, +- Self::Weapon(v) => Some(v.pack(fbb).as_union_value()), +- } +- } +- /// If the union variant matches, return the owned WeaponT, setting the union to NONE. +- pub fn take_weapon(&mut self) -> Option> { +- if let Self::Weapon(_) = self { +- let v = std::mem::replace(self, Self::NONE); +- if let Self::Weapon(w) = v { +- Some(w) +- } else { +- unreachable!() +- } +- } else { +- None +- } +- } +- /// If the union variant matches, return a reference to the WeaponT. +- pub fn as_weapon(&self) -> Option<&WeaponT> { +- if let Self::Weapon(v) = self { Some(v.as_ref()) } else { None } +- } +- /// If the union variant matches, return a mutable reference to the WeaponT. +- pub fn as_weapon_mut(&mut self) -> Option<&mut WeaponT> { +- if let Self::Weapon(v) = self { Some(v.as_mut()) } else { None } +- } +-} +-// struct Vec3, aligned to 4 +-#[repr(transparent)] +-#[derive(Clone, Copy, PartialEq)] +-pub struct Vec3(pub [u8; 12]); +-impl Default for Vec3 { +- fn default() -> Self { +- Self([0; 12]) +- } +-} +-impl std::fmt::Debug for Vec3 { +- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { +- f.debug_struct("Vec3") +- .field("x", &self.x()) +- .field("y", &self.y()) +- .field("z", &self.z()) +- .finish() +- } +-} +- +-impl flatbuffers::SimpleToVerifyInSlice for Vec3 {} +-impl flatbuffers::SafeSliceAccess for Vec3 {} +-impl<'a> flatbuffers::Follow<'a> for Vec3 { +- type Inner = &'a Vec3; +- #[inline] +- fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { +- <&'a Vec3>::follow(buf, loc) +- } +-} +-impl<'a> flatbuffers::Follow<'a> for &'a Vec3 { +- type Inner = &'a Vec3; +- #[inline] +- fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { +- flatbuffers::follow_cast_ref::(buf, loc) +- } +-} +-impl<'b> flatbuffers::Push for Vec3 { +- type Output = Vec3; +- #[inline] +- fn push(&self, dst: &mut [u8], _rest: &[u8]) { +- let src = unsafe { +- ::std::slice::from_raw_parts(self as *const Vec3 as *const u8, Self::size()) +- }; +- dst.copy_from_slice(src); +- } +-} +-impl<'b> flatbuffers::Push for &'b Vec3 { +- type Output = Vec3; +- +- #[inline] +- fn push(&self, dst: &mut [u8], _rest: &[u8]) { +- let src = unsafe { +- ::std::slice::from_raw_parts(*self as *const Vec3 as *const u8, Self::size()) +- }; +- dst.copy_from_slice(src); +- } +-} +- +-impl<'a> flatbuffers::Verifiable for Vec3 { +- #[inline] +- fn run_verifier( +- v: &mut flatbuffers::Verifier, pos: usize +- ) -> Result<(), flatbuffers::InvalidFlatbuffer> { +- use self::flatbuffers::Verifiable; +- v.in_buffer::(pos) +- } +-} +-impl<'a> Vec3 { +- #[allow(clippy::too_many_arguments)] +- pub fn new( +- x: f32, +- y: f32, +- z: f32, +- ) -> Self { +- let mut s = Self([0; 12]); +- s.set_x(x); +- s.set_y(y); +- s.set_z(z); +- s +- } +- +- pub fn x(&self) -> f32 { +- let mut mem = core::mem::MaybeUninit::::uninit(); +- unsafe { +- core::ptr::copy_nonoverlapping( +- self.0[0..].as_ptr(), +- mem.as_mut_ptr() as *mut u8, +- core::mem::size_of::(), +- ); +- mem.assume_init() +- }.from_little_endian() +- } +- +- pub fn set_x(&mut self, x: f32) { +- let x_le = x.to_little_endian(); +- unsafe { +- core::ptr::copy_nonoverlapping( +- &x_le as *const f32 as *const u8, +- self.0[0..].as_mut_ptr(), +- core::mem::size_of::(), +- ); +- } +- } +- +- pub fn y(&self) -> f32 { +- let mut mem = core::mem::MaybeUninit::::uninit(); +- unsafe { +- core::ptr::copy_nonoverlapping( +- self.0[4..].as_ptr(), +- mem.as_mut_ptr() as *mut u8, +- core::mem::size_of::(), +- ); +- mem.assume_init() +- }.from_little_endian() +- } +- +- pub fn set_y(&mut self, x: f32) { +- let x_le = x.to_little_endian(); +- unsafe { +- core::ptr::copy_nonoverlapping( +- &x_le as *const f32 as *const u8, +- self.0[4..].as_mut_ptr(), +- core::mem::size_of::(), +- ); +- } +- } +- +- pub fn z(&self) -> f32 { +- let mut mem = core::mem::MaybeUninit::::uninit(); +- unsafe { +- core::ptr::copy_nonoverlapping( +- self.0[8..].as_ptr(), +- mem.as_mut_ptr() as *mut u8, +- core::mem::size_of::(), +- ); +- mem.assume_init() +- }.from_little_endian() +- } +- +- pub fn set_z(&mut self, x: f32) { +- let x_le = x.to_little_endian(); +- unsafe { +- core::ptr::copy_nonoverlapping( +- &x_le as *const f32 as *const u8, +- self.0[8..].as_mut_ptr(), +- core::mem::size_of::(), +- ); +- } +- } +- +- pub fn unpack(&self) -> Vec3T { +- Vec3T { +- x: self.x(), +- y: self.y(), +- z: self.z(), +- } +- } +-} +- +-#[derive(Debug, Clone, PartialEq, Default)] +-pub struct Vec3T { +- pub x: f32, +- pub y: f32, +- pub z: f32, +-} +-impl Vec3T { +- pub fn pack(&self) -> Vec3 { +- Vec3::new( +- self.x, +- self.y, +- self.z, +- ) +- } +-} +- +-pub enum MonsterOffset {} +-#[derive(Copy, Clone, PartialEq)] +- +-pub struct Monster<'a> { +- pub _tab: flatbuffers::Table<'a>, +-} +- +-impl<'a> flatbuffers::Follow<'a> for Monster<'a> { +- type Inner = Monster<'a>; +- #[inline] +- fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { +- Self { _tab: flatbuffers::Table { buf, loc } } +- } +-} +- +-impl<'a> Monster<'a> { +- #[inline] +- pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self { +- Monster { _tab: table } +- } +- #[allow(unused_mut)] +- pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( +- _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, +- args: &'args MonsterArgs<'args>) -> flatbuffers::WIPOffset> { +- let mut builder = MonsterBuilder::new(_fbb); +- if let Some(x) = args.path { builder.add_path(x); } +- if let Some(x) = args.equipped { builder.add_equipped(x); } +- if let Some(x) = args.weapons { builder.add_weapons(x); } +- if let Some(x) = args.inventory { builder.add_inventory(x); } +- if let Some(x) = args.name { builder.add_name(x); } +- if let Some(x) = args.pos { builder.add_pos(x); } +- builder.add_hp(args.hp); +- builder.add_mana(args.mana); +- builder.add_equipped_type(args.equipped_type); +- builder.add_color(args.color); +- builder.finish() +- } +- +- pub fn unpack(&self) -> MonsterT { +- let pos = self.pos().map(|x| { +- x.unpack() +- }); +- let mana = self.mana(); +- let hp = self.hp(); +- let name = self.name().map(|x| { +- x.to_string() +- }); +- let inventory = self.inventory().map(|x| { +- x.to_vec() +- }); +- let color = self.color(); +- let weapons = self.weapons().map(|x| { +- x.iter().map(|t| t.unpack()).collect() +- }); +- let equipped = match self.equipped_type() { +- Equipment::NONE => EquipmentT::NONE, +- Equipment::Weapon => EquipmentT::Weapon(Box::new( +- self.equipped_as_weapon() +- .expect("Invalid union table, expected `Equipment::Weapon`.") +- .unpack() +- )), +- _ => EquipmentT::NONE, +- }; +- let path = self.path().map(|x| { +- x.iter().map(|t| t.unpack()).collect() +- }); +- MonsterT { +- pos, +- mana, +- hp, +- name, +- inventory, +- color, +- weapons, +- equipped, +- path, +- } +- } +- pub const VT_POS: flatbuffers::VOffsetT = 4; +- pub const VT_MANA: flatbuffers::VOffsetT = 6; +- pub const VT_HP: flatbuffers::VOffsetT = 8; +- pub const VT_NAME: flatbuffers::VOffsetT = 10; +- pub const VT_INVENTORY: flatbuffers::VOffsetT = 14; +- pub const VT_COLOR: flatbuffers::VOffsetT = 16; +- pub const VT_WEAPONS: flatbuffers::VOffsetT = 18; +- pub const VT_EQUIPPED_TYPE: flatbuffers::VOffsetT = 20; +- pub const VT_EQUIPPED: flatbuffers::VOffsetT = 22; +- pub const VT_PATH: flatbuffers::VOffsetT = 24; +- +- #[inline] +- pub fn pos(&self) -> Option<&'a Vec3> { +- self._tab.get::(Monster::VT_POS, None) +- } +- #[inline] +- pub fn mana(&self) -> i16 { +- self._tab.get::(Monster::VT_MANA, Some(150)).unwrap() +- } +- #[inline] +- pub fn hp(&self) -> i16 { +- self._tab.get::(Monster::VT_HP, Some(100)).unwrap() +- } +- #[inline] +- pub fn name(&self) -> Option<&'a str> { +- self._tab.get::>(Monster::VT_NAME, None) +- } +- #[inline] +- pub fn inventory(&self) -> Option<&'a [u8]> { +- self._tab.get::>>(Monster::VT_INVENTORY, None).map(|v| v.safe_slice()) +- } +- #[inline] +- pub fn color(&self) -> Color { +- self._tab.get::(Monster::VT_COLOR, Some(Color::Blue)).unwrap() +- } +- #[inline] +- pub fn weapons(&self) -> Option>>> { +- self._tab.get::>>>(Monster::VT_WEAPONS, None) +- } +- #[inline] +- pub fn equipped_type(&self) -> Equipment { +- self._tab.get::(Monster::VT_EQUIPPED_TYPE, Some(Equipment::NONE)).unwrap() +- } +- #[inline] +- pub fn equipped(&self) -> Option> { +- self._tab.get::>>(Monster::VT_EQUIPPED, None) +- } +- #[inline] +- pub fn path(&self) -> Option<&'a [Vec3]> { +- self._tab.get::>>(Monster::VT_PATH, None).map(|v| v.safe_slice()) +- } +- #[inline] +- #[allow(non_snake_case)] +- pub fn equipped_as_weapon(&self) -> Option> { +- if self.equipped_type() == Equipment::Weapon { +- self.equipped().map(Weapon::init_from_table) +- } else { +- None +- } +- } +- +-} +- +-impl flatbuffers::Verifiable for Monster<'_> { +- #[inline] +- fn run_verifier( +- v: &mut flatbuffers::Verifier, pos: usize +- ) -> Result<(), flatbuffers::InvalidFlatbuffer> { +- use self::flatbuffers::Verifiable; +- v.visit_table(pos)? +- .visit_field::(&"pos", Self::VT_POS, false)? +- .visit_field::(&"mana", Self::VT_MANA, false)? +- .visit_field::(&"hp", Self::VT_HP, false)? +- .visit_field::>(&"name", Self::VT_NAME, false)? +- .visit_field::>>(&"inventory", Self::VT_INVENTORY, false)? +- .visit_field::(&"color", Self::VT_COLOR, false)? +- .visit_field::>>>(&"weapons", Self::VT_WEAPONS, false)? +- .visit_union::(&"equipped_type", Self::VT_EQUIPPED_TYPE, &"equipped", Self::VT_EQUIPPED, false, |key, v, pos| { +- match key { +- Equipment::Weapon => v.verify_union_variant::>("Equipment::Weapon", pos), +- _ => Ok(()), +- } +- })? +- .visit_field::>>(&"path", Self::VT_PATH, false)? +- .finish(); +- Ok(()) +- } +-} +-pub struct MonsterArgs<'a> { +- pub pos: Option<&'a Vec3>, +- pub mana: i16, +- pub hp: i16, +- pub name: Option>, +- pub inventory: Option>>, +- pub color: Color, +- pub weapons: Option>>>>, +- pub equipped_type: Equipment, +- pub equipped: Option>, +- pub path: Option>>, +-} +-impl<'a> Default for MonsterArgs<'a> { +- #[inline] +- fn default() -> Self { +- MonsterArgs { +- pos: None, +- mana: 150, +- hp: 100, +- name: None, +- inventory: None, +- color: Color::Blue, +- weapons: None, +- equipped_type: Equipment::NONE, +- equipped: None, +- path: None, +- } +- } +-} +-pub struct MonsterBuilder<'a: 'b, 'b> { +- fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, +- start_: flatbuffers::WIPOffset, +-} +-impl<'a: 'b, 'b> MonsterBuilder<'a, 'b> { +- #[inline] +- pub fn add_pos(&mut self, pos: &Vec3) { +- self.fbb_.push_slot_always::<&Vec3>(Monster::VT_POS, pos); +- } +- #[inline] +- pub fn add_mana(&mut self, mana: i16) { +- self.fbb_.push_slot::(Monster::VT_MANA, mana, 150); +- } +- #[inline] +- pub fn add_hp(&mut self, hp: i16) { +- self.fbb_.push_slot::(Monster::VT_HP, hp, 100); +- } +- #[inline] +- pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) { +- self.fbb_.push_slot_always::>(Monster::VT_NAME, name); +- } +- #[inline] +- pub fn add_inventory(&mut self, inventory: flatbuffers::WIPOffset>) { +- self.fbb_.push_slot_always::>(Monster::VT_INVENTORY, inventory); +- } +- #[inline] +- pub fn add_color(&mut self, color: Color) { +- self.fbb_.push_slot::(Monster::VT_COLOR, color, Color::Blue); +- } +- #[inline] +- pub fn add_weapons(&mut self, weapons: flatbuffers::WIPOffset>>>) { +- self.fbb_.push_slot_always::>(Monster::VT_WEAPONS, weapons); +- } +- #[inline] +- pub fn add_equipped_type(&mut self, equipped_type: Equipment) { +- self.fbb_.push_slot::(Monster::VT_EQUIPPED_TYPE, equipped_type, Equipment::NONE); +- } +- #[inline] +- pub fn add_equipped(&mut self, equipped: flatbuffers::WIPOffset) { +- self.fbb_.push_slot_always::>(Monster::VT_EQUIPPED, equipped); +- } +- #[inline] +- pub fn add_path(&mut self, path: flatbuffers::WIPOffset>) { +- self.fbb_.push_slot_always::>(Monster::VT_PATH, path); +- } +- #[inline] +- pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b> { +- let start = _fbb.start_table(); +- MonsterBuilder { +- fbb_: _fbb, +- start_: start, +- } +- } +- #[inline] +- pub fn finish(self) -> flatbuffers::WIPOffset> { +- let o = self.fbb_.end_table(self.start_); +- flatbuffers::WIPOffset::new(o.value()) +- } +-} +- +-impl std::fmt::Debug for Monster<'_> { +- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +- let mut ds = f.debug_struct("Monster"); +- ds.field("pos", &self.pos()); +- ds.field("mana", &self.mana()); +- ds.field("hp", &self.hp()); +- ds.field("name", &self.name()); +- ds.field("inventory", &self.inventory()); +- ds.field("color", &self.color()); +- ds.field("weapons", &self.weapons()); +- ds.field("equipped_type", &self.equipped_type()); +- match self.equipped_type() { +- Equipment::Weapon => { +- if let Some(x) = self.equipped_as_weapon() { +- ds.field("equipped", &x) +- } else { +- ds.field("equipped", &"InvalidFlatbuffer: Union discriminant does not match value.") +- } +- }, +- _ => { +- let x: Option<()> = None; +- ds.field("equipped", &x) +- }, +- }; +- ds.field("path", &self.path()); +- ds.finish() +- } +-} +-#[non_exhaustive] +-#[derive(Debug, Clone, PartialEq)] +-pub struct MonsterT { +- pub pos: Option, +- pub mana: i16, +- pub hp: i16, +- pub name: Option, +- pub inventory: Option>, +- pub color: Color, +- pub weapons: Option>, +- pub equipped: EquipmentT, +- pub path: Option>, +-} +-impl Default for MonsterT { +- fn default() -> Self { +- Self { +- pos: None, +- mana: 150, +- hp: 100, +- name: None, +- inventory: None, +- color: Color::Blue, +- weapons: None, +- equipped: EquipmentT::NONE, +- path: None, +- } +- } +-} +-impl MonsterT { +- pub fn pack<'b>( +- &self, +- _fbb: &mut flatbuffers::FlatBufferBuilder<'b> +- ) -> flatbuffers::WIPOffset> { +- let pos_tmp = self.pos.as_ref().map(|x| x.pack()); +- let pos = pos_tmp.as_ref(); +- let mana = self.mana; +- let hp = self.hp; +- let name = self.name.as_ref().map(|x|{ +- _fbb.create_string(x) +- }); +- let inventory = self.inventory.as_ref().map(|x|{ +- _fbb.create_vector(x) +- }); +- let color = self.color; +- let weapons = self.weapons.as_ref().map(|x|{ +- let w: Vec<_> = x.iter().map(|t| t.pack(_fbb)).collect();_fbb.create_vector(&w) +- }); +- let equipped_type = self.equipped.equipment_type(); +- let equipped = self.equipped.pack(_fbb); +- let path = self.path.as_ref().map(|x|{ +- let w: Vec<_> = x.iter().map(|t| t.pack()).collect();_fbb.create_vector(&w) +- }); +- Monster::create(_fbb, &MonsterArgs{ +- pos, +- mana, +- hp, +- name, +- inventory, +- color, +- weapons, +- equipped_type, +- equipped, +- path, +- }) +- } +-} +-pub enum WeaponOffset {} +-#[derive(Copy, Clone, PartialEq)] +- +-pub struct Weapon<'a> { +- pub _tab: flatbuffers::Table<'a>, +-} +- +-impl<'a> flatbuffers::Follow<'a> for Weapon<'a> { +- type Inner = Weapon<'a>; +- #[inline] +- fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { +- Self { _tab: flatbuffers::Table { buf, loc } } +- } +-} +- +-impl<'a> Weapon<'a> { +- #[inline] +- pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self { +- Weapon { _tab: table } +- } +- #[allow(unused_mut)] +- pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( +- _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, +- args: &'args WeaponArgs<'args>) -> flatbuffers::WIPOffset> { +- let mut builder = WeaponBuilder::new(_fbb); +- if let Some(x) = args.name { builder.add_name(x); } +- builder.add_damage(args.damage); +- builder.finish() +- } +- +- pub fn unpack(&self) -> WeaponT { +- let name = self.name().map(|x| { +- x.to_string() +- }); +- let damage = self.damage(); +- WeaponT { +- name, +- damage, +- } +- } +- pub const VT_NAME: flatbuffers::VOffsetT = 4; +- pub const VT_DAMAGE: flatbuffers::VOffsetT = 6; +- +- #[inline] +- pub fn name(&self) -> Option<&'a str> { +- self._tab.get::>(Weapon::VT_NAME, None) +- } +- #[inline] +- pub fn damage(&self) -> i16 { +- self._tab.get::(Weapon::VT_DAMAGE, Some(0)).unwrap() +- } +-} +- +-impl flatbuffers::Verifiable for Weapon<'_> { +- #[inline] +- fn run_verifier( +- v: &mut flatbuffers::Verifier, pos: usize +- ) -> Result<(), flatbuffers::InvalidFlatbuffer> { +- use self::flatbuffers::Verifiable; +- v.visit_table(pos)? +- .visit_field::>(&"name", Self::VT_NAME, false)? +- .visit_field::(&"damage", Self::VT_DAMAGE, false)? +- .finish(); +- Ok(()) +- } +-} +-pub struct WeaponArgs<'a> { +- pub name: Option>, +- pub damage: i16, +-} +-impl<'a> Default for WeaponArgs<'a> { +- #[inline] +- fn default() -> Self { +- WeaponArgs { +- name: None, +- damage: 0, +- } +- } +-} +-pub struct WeaponBuilder<'a: 'b, 'b> { +- fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, +- start_: flatbuffers::WIPOffset, +-} +-impl<'a: 'b, 'b> WeaponBuilder<'a, 'b> { +- #[inline] +- pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) { +- self.fbb_.push_slot_always::>(Weapon::VT_NAME, name); +- } +- #[inline] +- pub fn add_damage(&mut self, damage: i16) { +- self.fbb_.push_slot::(Weapon::VT_DAMAGE, damage, 0); +- } +- #[inline] +- pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> WeaponBuilder<'a, 'b> { +- let start = _fbb.start_table(); +- WeaponBuilder { +- fbb_: _fbb, +- start_: start, +- } +- } +- #[inline] +- pub fn finish(self) -> flatbuffers::WIPOffset> { +- let o = self.fbb_.end_table(self.start_); +- flatbuffers::WIPOffset::new(o.value()) +- } +-} +- +-impl std::fmt::Debug for Weapon<'_> { +- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +- let mut ds = f.debug_struct("Weapon"); +- ds.field("name", &self.name()); +- ds.field("damage", &self.damage()); +- ds.finish() +- } +-} +-#[non_exhaustive] +-#[derive(Debug, Clone, PartialEq)] +-pub struct WeaponT { +- pub name: Option, +- pub damage: i16, +-} +-impl Default for WeaponT { +- fn default() -> Self { +- Self { +- name: None, +- damage: 0, +- } +- } +-} +-impl WeaponT { +- pub fn pack<'b>( +- &self, +- _fbb: &mut flatbuffers::FlatBufferBuilder<'b> +- ) -> flatbuffers::WIPOffset> { +- let name = self.name.as_ref().map(|x|{ +- _fbb.create_string(x) +- }); +- let damage = self.damage; +- Weapon::create(_fbb, &WeaponArgs{ +- name, +- damage, +- }) +- } +-} +-#[inline] +-#[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")] +-pub fn get_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> { +- unsafe { flatbuffers::root_unchecked::>(buf) } +-} +- +-#[inline] +-#[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")] +-pub fn get_size_prefixed_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> { +- unsafe { flatbuffers::size_prefixed_root_unchecked::>(buf) } +-} +- +-#[inline] +-/// Verifies that a buffer of bytes contains a `Monster` +-/// and returns it. +-/// Note that verification is still experimental and may not +-/// catch every error, or be maximally performant. For the +-/// previous, unchecked, behavior use +-/// `root_as_monster_unchecked`. +-pub fn root_as_monster(buf: &[u8]) -> Result { +- flatbuffers::root::(buf) +-} +-#[inline] +-/// Verifies that a buffer of bytes contains a size prefixed +-/// `Monster` and returns it. +-/// Note that verification is still experimental and may not +-/// catch every error, or be maximally performant. For the +-/// previous, unchecked, behavior use +-/// `size_prefixed_root_as_monster_unchecked`. +-pub fn size_prefixed_root_as_monster(buf: &[u8]) -> Result { +- flatbuffers::size_prefixed_root::(buf) +-} +-#[inline] +-/// Verifies, with the given options, that a buffer of bytes +-/// contains a `Monster` and returns it. +-/// Note that verification is still experimental and may not +-/// catch every error, or be maximally performant. For the +-/// previous, unchecked, behavior use +-/// `root_as_monster_unchecked`. +-pub fn root_as_monster_with_opts<'b, 'o>( +- opts: &'o flatbuffers::VerifierOptions, +- buf: &'b [u8], +-) -> Result, flatbuffers::InvalidFlatbuffer> { +- flatbuffers::root_with_opts::>(opts, buf) +-} +-#[inline] +-/// Verifies, with the given verifier options, that a buffer of +-/// bytes contains a size prefixed `Monster` and returns +-/// it. Note that verification is still experimental and may not +-/// catch every error, or be maximally performant. For the +-/// previous, unchecked, behavior use +-/// `root_as_monster_unchecked`. +-pub fn size_prefixed_root_as_monster_with_opts<'b, 'o>( +- opts: &'o flatbuffers::VerifierOptions, +- buf: &'b [u8], +-) -> Result, flatbuffers::InvalidFlatbuffer> { +- flatbuffers::size_prefixed_root_with_opts::>(opts, buf) +-} +-#[inline] +-/// Assumes, without verification, that a buffer of bytes contains a Monster and returns it. +-/// # Safety +-/// Callers must trust the given bytes do indeed contain a valid `Monster`. +-pub unsafe fn root_as_monster_unchecked(buf: &[u8]) -> Monster { +- flatbuffers::root_unchecked::(buf) +-} +-#[inline] +-/// Assumes, without verification, that a buffer of bytes contains a size prefixed Monster and returns it. +-/// # Safety +-/// Callers must trust the given bytes do indeed contain a valid size prefixed `Monster`. +-pub unsafe fn size_prefixed_root_as_monster_unchecked(buf: &[u8]) -> Monster { +- flatbuffers::size_prefixed_root_unchecked::(buf) +-} +-#[inline] +-pub fn finish_monster_buffer<'a, 'b>( +- fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, +- root: flatbuffers::WIPOffset>) { +- fbb.finish(root, None); +-} +- +-#[inline] +-pub fn finish_size_prefixed_monster_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset>) { +- fbb.finish_size_prefixed(root, None); +-} +-} // pub mod Sample +-} // pub mod MyGame +- +diff -urN a/samples/rust_generated/mod.rs b/samples/rust_generated/mod.rs +--- a/samples/rust_generated/mod.rs 1970-01-01 00:00:00.000000000 +0000 ++++ b/samples/rust_generated/mod.rs 2023-01-13 07:46:54.482119093 +0000 +@@ -0,0 +1,17 @@ ++// Automatically generated by the Flatbuffers compiler. Do not modify. ++pub mod my_game { ++ use super::*; ++ pub mod sample { ++ use super::*; ++ mod color_generated; ++ pub use self::color_generated::*; ++ mod equipment_generated; ++ pub use self::equipment_generated::*; ++ mod vec_3_generated; ++ pub use self::vec_3_generated::*; ++ mod monster_generated; ++ pub use self::monster_generated::*; ++ mod weapon_generated; ++ pub use self::weapon_generated::*; ++ } // sample ++} // my_game +diff -urN a/samples/rust_generated/my_game/sample/color_generated.rs b/samples/rust_generated/my_game/sample/color_generated.rs +--- a/samples/rust_generated/my_game/sample/color_generated.rs 1970-01-01 00:00:00.000000000 +0000 ++++ b/samples/rust_generated/my_game/sample/color_generated.rs 2023-01-13 07:46:54.705121153 +0000 +@@ -0,0 +1,97 @@ ++// automatically generated by the FlatBuffers compiler, do not modify ++extern crate flatbuffers; ++use std::mem; ++use std::cmp::Ordering; ++use self::flatbuffers::{EndianScalar, Follow}; ++use super::*; ++#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] ++pub const ENUM_MIN_COLOR: i8 = 0; ++#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] ++pub const ENUM_MAX_COLOR: i8 = 2; ++#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] ++#[allow(non_camel_case_types)] ++pub const ENUM_VALUES_COLOR: [Color; 3] = [ ++ Color::Red, ++ Color::Green, ++ Color::Blue, ++]; ++ ++#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] ++#[repr(transparent)] ++pub struct Color(pub i8); ++#[allow(non_upper_case_globals)] ++impl Color { ++ pub const Red: Self = Self(0); ++ pub const Green: Self = Self(1); ++ pub const Blue: Self = Self(2); ++ ++ pub const ENUM_MIN: i8 = 0; ++ pub const ENUM_MAX: i8 = 2; ++ pub const ENUM_VALUES: &'static [Self] = &[ ++ Self::Red, ++ Self::Green, ++ Self::Blue, ++ ]; ++ /// Returns the variant's name or "" if unknown. ++ pub fn variant_name(self) -> Option<&'static str> { ++ match self { ++ Self::Red => Some("Red"), ++ Self::Green => Some("Green"), ++ Self::Blue => Some("Blue"), ++ _ => None, ++ } ++ } ++} ++impl std::fmt::Debug for Color { ++ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { ++ if let Some(name) = self.variant_name() { ++ f.write_str(name) ++ } else { ++ f.write_fmt(format_args!("", self.0)) ++ } ++ } ++} ++impl<'a> flatbuffers::Follow<'a> for Color { ++ type Inner = Self; ++ #[inline] ++ fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { ++ let b = unsafe { ++ flatbuffers::read_scalar_at::(buf, loc) ++ }; ++ Self(b) ++ } ++} ++ ++impl flatbuffers::Push for Color { ++ type Output = Color; ++ #[inline] ++ fn push(&self, dst: &mut [u8], _rest: &[u8]) { ++ unsafe { flatbuffers::emplace_scalar::(dst, self.0); } ++ } ++} ++ ++impl flatbuffers::EndianScalar for Color { ++ #[inline] ++ fn to_little_endian(self) -> Self { ++ let b = i8::to_le(self.0); ++ Self(b) ++ } ++ #[inline] ++ #[allow(clippy::wrong_self_convention)] ++ fn from_little_endian(self) -> Self { ++ let b = i8::from_le(self.0); ++ Self(b) ++ } ++} ++ ++impl<'a> flatbuffers::Verifiable for Color { ++ #[inline] ++ fn run_verifier( ++ v: &mut flatbuffers::Verifier, pos: usize ++ ) -> Result<(), flatbuffers::InvalidFlatbuffer> { ++ use self::flatbuffers::Verifiable; ++ i8::run_verifier(v, pos) ++ } ++} ++ ++impl flatbuffers::SimpleToVerifyInSlice for Color {} +diff -urN a/samples/rust_generated/my_game/sample/equipment_generated.rs b/samples/rust_generated/my_game/sample/equipment_generated.rs +--- a/samples/rust_generated/my_game/sample/equipment_generated.rs 1970-01-01 00:00:00.000000000 +0000 ++++ b/samples/rust_generated/my_game/sample/equipment_generated.rs 2023-01-13 07:46:54.854122528 +0000 +@@ -0,0 +1,142 @@ ++// automatically generated by the FlatBuffers compiler, do not modify ++extern crate flatbuffers; ++use std::mem; ++use std::cmp::Ordering; ++use self::flatbuffers::{EndianScalar, Follow}; ++use super::*; ++#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] ++pub const ENUM_MIN_EQUIPMENT: u8 = 0; ++#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] ++pub const ENUM_MAX_EQUIPMENT: u8 = 1; ++#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")] ++#[allow(non_camel_case_types)] ++pub const ENUM_VALUES_EQUIPMENT: [Equipment; 2] = [ ++ Equipment::NONE, ++ Equipment::Weapon, ++]; ++ ++#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] ++#[repr(transparent)] ++pub struct Equipment(pub u8); ++#[allow(non_upper_case_globals)] ++impl Equipment { ++ pub const NONE: Self = Self(0); ++ pub const Weapon: Self = Self(1); ++ ++ pub const ENUM_MIN: u8 = 0; ++ pub const ENUM_MAX: u8 = 1; ++ pub const ENUM_VALUES: &'static [Self] = &[ ++ Self::NONE, ++ Self::Weapon, ++ ]; ++ /// Returns the variant's name or "" if unknown. ++ pub fn variant_name(self) -> Option<&'static str> { ++ match self { ++ Self::NONE => Some("NONE"), ++ Self::Weapon => Some("Weapon"), ++ _ => None, ++ } ++ } ++} ++impl std::fmt::Debug for Equipment { ++ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { ++ if let Some(name) = self.variant_name() { ++ f.write_str(name) ++ } else { ++ f.write_fmt(format_args!("", self.0)) ++ } ++ } ++} ++impl<'a> flatbuffers::Follow<'a> for Equipment { ++ type Inner = Self; ++ #[inline] ++ fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { ++ let b = unsafe { ++ flatbuffers::read_scalar_at::(buf, loc) ++ }; ++ Self(b) ++ } ++} ++ ++impl flatbuffers::Push for Equipment { ++ type Output = Equipment; ++ #[inline] ++ fn push(&self, dst: &mut [u8], _rest: &[u8]) { ++ unsafe { flatbuffers::emplace_scalar::(dst, self.0); } ++ } ++} ++ ++impl flatbuffers::EndianScalar for Equipment { ++ #[inline] ++ fn to_little_endian(self) -> Self { ++ let b = u8::to_le(self.0); ++ Self(b) ++ } ++ #[inline] ++ #[allow(clippy::wrong_self_convention)] ++ fn from_little_endian(self) -> Self { ++ let b = u8::from_le(self.0); ++ Self(b) ++ } ++} ++ ++impl<'a> flatbuffers::Verifiable for Equipment { ++ #[inline] ++ fn run_verifier( ++ v: &mut flatbuffers::Verifier, pos: usize ++ ) -> Result<(), flatbuffers::InvalidFlatbuffer> { ++ use self::flatbuffers::Verifiable; ++ u8::run_verifier(v, pos) ++ } ++} ++ ++impl flatbuffers::SimpleToVerifyInSlice for Equipment {} ++pub struct EquipmentUnionTableOffset {} ++ ++#[allow(clippy::upper_case_acronyms)] ++#[non_exhaustive] ++#[derive(Debug, Clone, PartialEq)] ++pub enum EquipmentT { ++ NONE, ++ Weapon(Box), ++} ++impl Default for EquipmentT { ++ fn default() -> Self { ++ Self::NONE ++ } ++} ++impl EquipmentT { ++ pub fn equipment_type(&self) -> Equipment { ++ match self { ++ Self::NONE => Equipment::NONE, ++ Self::Weapon(_) => Equipment::Weapon, ++ } ++ } ++ pub fn pack(&self, fbb: &mut flatbuffers::FlatBufferBuilder) -> Option> { ++ match self { ++ Self::NONE => None, ++ Self::Weapon(v) => Some(v.pack(fbb).as_union_value()), ++ } ++ } ++ /// If the union variant matches, return the owned WeaponT, setting the union to NONE. ++ pub fn take_weapon(&mut self) -> Option> { ++ if let Self::Weapon(_) = self { ++ let v = std::mem::replace(self, Self::NONE); ++ if let Self::Weapon(w) = v { ++ Some(w) ++ } else { ++ unreachable!() ++ } ++ } else { ++ None ++ } ++ } ++ /// If the union variant matches, return a reference to the WeaponT. ++ pub fn as_weapon(&self) -> Option<&WeaponT> { ++ if let Self::Weapon(v) = self { Some(v.as_ref()) } else { None } ++ } ++ /// If the union variant matches, return a mutable reference to the WeaponT. ++ pub fn as_weapon_mut(&mut self) -> Option<&mut WeaponT> { ++ if let Self::Weapon(v) = self { Some(v.as_mut()) } else { None } ++ } ++} +diff -urN a/samples/rust_generated/my_game/sample/monster_generated.rs b/samples/rust_generated/my_game/sample/monster_generated.rs +--- a/samples/rust_generated/my_game/sample/monster_generated.rs 1970-01-01 00:00:00.000000000 +0000 ++++ b/samples/rust_generated/my_game/sample/monster_generated.rs 2023-01-13 07:46:54.893122889 +0000 +@@ -0,0 +1,445 @@ ++// automatically generated by the FlatBuffers compiler, do not modify ++extern crate flatbuffers; ++use std::mem; ++use std::cmp::Ordering; ++use self::flatbuffers::{EndianScalar, Follow}; ++use super::*; ++pub enum MonsterOffset {} ++#[derive(Copy, Clone, PartialEq)] ++ ++pub struct Monster<'a> { ++ pub _tab: flatbuffers::Table<'a>, ++} ++ ++impl<'a> flatbuffers::Follow<'a> for Monster<'a> { ++ type Inner = Monster<'a>; ++ #[inline] ++ fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { ++ Self { _tab: flatbuffers::Table { buf, loc } } ++ } ++} ++ ++impl<'a> Monster<'a> { ++ pub const VT_POS: flatbuffers::VOffsetT = 4; ++ pub const VT_MANA: flatbuffers::VOffsetT = 6; ++ pub const VT_HP: flatbuffers::VOffsetT = 8; ++ pub const VT_NAME: flatbuffers::VOffsetT = 10; ++ pub const VT_INVENTORY: flatbuffers::VOffsetT = 14; ++ pub const VT_COLOR: flatbuffers::VOffsetT = 16; ++ pub const VT_WEAPONS: flatbuffers::VOffsetT = 18; ++ pub const VT_EQUIPPED_TYPE: flatbuffers::VOffsetT = 20; ++ pub const VT_EQUIPPED: flatbuffers::VOffsetT = 22; ++ pub const VT_PATH: flatbuffers::VOffsetT = 24; ++ ++ pub const fn get_fully_qualified_name() -> &'static str { ++ "MyGame.Sample.Monster" ++ } ++ ++ #[inline] ++ pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self { ++ Monster { _tab: table } ++ } ++ #[allow(unused_mut)] ++ pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( ++ _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, ++ args: &'args MonsterArgs<'args> ++ ) -> flatbuffers::WIPOffset> { ++ let mut builder = MonsterBuilder::new(_fbb); ++ if let Some(x) = args.path { builder.add_path(x); } ++ if let Some(x) = args.equipped { builder.add_equipped(x); } ++ if let Some(x) = args.weapons { builder.add_weapons(x); } ++ if let Some(x) = args.inventory { builder.add_inventory(x); } ++ if let Some(x) = args.name { builder.add_name(x); } ++ if let Some(x) = args.pos { builder.add_pos(x); } ++ builder.add_hp(args.hp); ++ builder.add_mana(args.mana); ++ builder.add_equipped_type(args.equipped_type); ++ builder.add_color(args.color); ++ builder.finish() ++ } ++ ++ pub fn unpack(&self) -> MonsterT { ++ let pos = self.pos().map(|x| { ++ x.unpack() ++ }); ++ let mana = self.mana(); ++ let hp = self.hp(); ++ let name = self.name().map(|x| { ++ x.to_string() ++ }); ++ let inventory = self.inventory().map(|x| { ++ x.to_vec() ++ }); ++ let color = self.color(); ++ let weapons = self.weapons().map(|x| { ++ x.iter().map(|t| t.unpack()).collect() ++ }); ++ let equipped = match self.equipped_type() { ++ Equipment::NONE => EquipmentT::NONE, ++ Equipment::Weapon => EquipmentT::Weapon(Box::new( ++ self.equipped_as_weapon() ++ .expect("Invalid union table, expected `Equipment::Weapon`.") ++ .unpack() ++ )), ++ _ => EquipmentT::NONE, ++ }; ++ let path = self.path().map(|x| { ++ x.iter().map(|t| t.unpack()).collect() ++ }); ++ MonsterT { ++ pos, ++ mana, ++ hp, ++ name, ++ inventory, ++ color, ++ weapons, ++ equipped, ++ path, ++ } ++ } ++ ++ #[inline] ++ pub fn pos(&self) -> Option<&'a Vec3> { ++ self._tab.get::(Monster::VT_POS, None) ++ } ++ #[inline] ++ pub fn mana(&self) -> i16 { ++ self._tab.get::(Monster::VT_MANA, Some(150)).unwrap() ++ } ++ #[inline] ++ pub fn hp(&self) -> i16 { ++ self._tab.get::(Monster::VT_HP, Some(100)).unwrap() ++ } ++ #[inline] ++ pub fn name(&self) -> Option<&'a str> { ++ self._tab.get::>(Monster::VT_NAME, None) ++ } ++ #[inline] ++ pub fn inventory(&self) -> Option<&'a [u8]> { ++ self._tab.get::>>(Monster::VT_INVENTORY, None).map(|v| v.safe_slice()) ++ } ++ #[inline] ++ pub fn color(&self) -> Color { ++ self._tab.get::(Monster::VT_COLOR, Some(Color::Blue)).unwrap() ++ } ++ #[inline] ++ pub fn weapons(&self) -> Option>>> { ++ self._tab.get::>>>(Monster::VT_WEAPONS, None) ++ } ++ #[inline] ++ pub fn equipped_type(&self) -> Equipment { ++ self._tab.get::(Monster::VT_EQUIPPED_TYPE, Some(Equipment::NONE)).unwrap() ++ } ++ #[inline] ++ pub fn equipped(&self) -> Option> { ++ self._tab.get::>>(Monster::VT_EQUIPPED, None) ++ } ++ #[inline] ++ pub fn path(&self) -> Option<&'a [Vec3]> { ++ self._tab.get::>>(Monster::VT_PATH, None).map(|v| v.safe_slice()) ++ } ++ #[inline] ++ #[allow(non_snake_case)] ++ pub fn equipped_as_weapon(&self) -> Option> { ++ if self.equipped_type() == Equipment::Weapon { ++ self.equipped().map(Weapon::init_from_table) ++ } else { ++ None ++ } ++ } ++ ++} ++ ++impl flatbuffers::Verifiable for Monster<'_> { ++ #[inline] ++ fn run_verifier( ++ v: &mut flatbuffers::Verifier, pos: usize ++ ) -> Result<(), flatbuffers::InvalidFlatbuffer> { ++ use self::flatbuffers::Verifiable; ++ v.visit_table(pos)? ++ .visit_field::("pos", Self::VT_POS, false)? ++ .visit_field::("mana", Self::VT_MANA, false)? ++ .visit_field::("hp", Self::VT_HP, false)? ++ .visit_field::>("name", Self::VT_NAME, false)? ++ .visit_field::>>("inventory", Self::VT_INVENTORY, false)? ++ .visit_field::("color", Self::VT_COLOR, false)? ++ .visit_field::>>>("weapons", Self::VT_WEAPONS, false)? ++ .visit_union::("equipped_type", Self::VT_EQUIPPED_TYPE, "equipped", Self::VT_EQUIPPED, false, |key, v, pos| { ++ match key { ++ Equipment::Weapon => v.verify_union_variant::>("Equipment::Weapon", pos), ++ _ => Ok(()), ++ } ++ })? ++ .visit_field::>>("path", Self::VT_PATH, false)? ++ .finish(); ++ Ok(()) ++ } ++} ++pub struct MonsterArgs<'a> { ++ pub pos: Option<&'a Vec3>, ++ pub mana: i16, ++ pub hp: i16, ++ pub name: Option>, ++ pub inventory: Option>>, ++ pub color: Color, ++ pub weapons: Option>>>>, ++ pub equipped_type: Equipment, ++ pub equipped: Option>, ++ pub path: Option>>, ++} ++impl<'a> Default for MonsterArgs<'a> { ++ #[inline] ++ fn default() -> Self { ++ MonsterArgs { ++ pos: None, ++ mana: 150, ++ hp: 100, ++ name: None, ++ inventory: None, ++ color: Color::Blue, ++ weapons: None, ++ equipped_type: Equipment::NONE, ++ equipped: None, ++ path: None, ++ } ++ } ++} ++ ++pub struct MonsterBuilder<'a: 'b, 'b> { ++ fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, ++ start_: flatbuffers::WIPOffset, ++} ++impl<'a: 'b, 'b> MonsterBuilder<'a, 'b> { ++ #[inline] ++ pub fn add_pos(&mut self, pos: &Vec3) { ++ self.fbb_.push_slot_always::<&Vec3>(Monster::VT_POS, pos); ++ } ++ #[inline] ++ pub fn add_mana(&mut self, mana: i16) { ++ self.fbb_.push_slot::(Monster::VT_MANA, mana, 150); ++ } ++ #[inline] ++ pub fn add_hp(&mut self, hp: i16) { ++ self.fbb_.push_slot::(Monster::VT_HP, hp, 100); ++ } ++ #[inline] ++ pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) { ++ self.fbb_.push_slot_always::>(Monster::VT_NAME, name); ++ } ++ #[inline] ++ pub fn add_inventory(&mut self, inventory: flatbuffers::WIPOffset>) { ++ self.fbb_.push_slot_always::>(Monster::VT_INVENTORY, inventory); ++ } ++ #[inline] ++ pub fn add_color(&mut self, color: Color) { ++ self.fbb_.push_slot::(Monster::VT_COLOR, color, Color::Blue); ++ } ++ #[inline] ++ pub fn add_weapons(&mut self, weapons: flatbuffers::WIPOffset>>>) { ++ self.fbb_.push_slot_always::>(Monster::VT_WEAPONS, weapons); ++ } ++ #[inline] ++ pub fn add_equipped_type(&mut self, equipped_type: Equipment) { ++ self.fbb_.push_slot::(Monster::VT_EQUIPPED_TYPE, equipped_type, Equipment::NONE); ++ } ++ #[inline] ++ pub fn add_equipped(&mut self, equipped: flatbuffers::WIPOffset) { ++ self.fbb_.push_slot_always::>(Monster::VT_EQUIPPED, equipped); ++ } ++ #[inline] ++ pub fn add_path(&mut self, path: flatbuffers::WIPOffset>) { ++ self.fbb_.push_slot_always::>(Monster::VT_PATH, path); ++ } ++ #[inline] ++ pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MonsterBuilder<'a, 'b> { ++ let start = _fbb.start_table(); ++ MonsterBuilder { ++ fbb_: _fbb, ++ start_: start, ++ } ++ } ++ #[inline] ++ pub fn finish(self) -> flatbuffers::WIPOffset> { ++ let o = self.fbb_.end_table(self.start_); ++ flatbuffers::WIPOffset::new(o.value()) ++ } ++} ++ ++impl std::fmt::Debug for Monster<'_> { ++ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { ++ let mut ds = f.debug_struct("Monster"); ++ ds.field("pos", &self.pos()); ++ ds.field("mana", &self.mana()); ++ ds.field("hp", &self.hp()); ++ ds.field("name", &self.name()); ++ ds.field("inventory", &self.inventory()); ++ ds.field("color", &self.color()); ++ ds.field("weapons", &self.weapons()); ++ ds.field("equipped_type", &self.equipped_type()); ++ match self.equipped_type() { ++ Equipment::Weapon => { ++ if let Some(x) = self.equipped_as_weapon() { ++ ds.field("equipped", &x) ++ } else { ++ ds.field("equipped", &"InvalidFlatbuffer: Union discriminant does not match value.") ++ } ++ }, ++ _ => { ++ let x: Option<()> = None; ++ ds.field("equipped", &x) ++ }, ++ }; ++ ds.field("path", &self.path()); ++ ds.finish() ++ } ++} ++#[non_exhaustive] ++#[derive(Debug, Clone, PartialEq)] ++pub struct MonsterT { ++ pub pos: Option, ++ pub mana: i16, ++ pub hp: i16, ++ pub name: Option, ++ pub inventory: Option>, ++ pub color: Color, ++ pub weapons: Option>, ++ pub equipped: EquipmentT, ++ pub path: Option>, ++} ++impl Default for MonsterT { ++ fn default() -> Self { ++ Self { ++ pos: None, ++ mana: 150, ++ hp: 100, ++ name: None, ++ inventory: None, ++ color: Color::Blue, ++ weapons: None, ++ equipped: EquipmentT::NONE, ++ path: None, ++ } ++ } ++} ++impl MonsterT { ++ pub fn pack<'b>( ++ &self, ++ _fbb: &mut flatbuffers::FlatBufferBuilder<'b> ++ ) -> flatbuffers::WIPOffset> { ++ let pos_tmp = self.pos.as_ref().map(|x| x.pack()); ++ let pos = pos_tmp.as_ref(); ++ let mana = self.mana; ++ let hp = self.hp; ++ let name = self.name.as_ref().map(|x|{ ++ _fbb.create_string(x) ++ }); ++ let inventory = self.inventory.as_ref().map(|x|{ ++ _fbb.create_vector(x) ++ }); ++ let color = self.color; ++ let weapons = self.weapons.as_ref().map(|x|{ ++ let w: Vec<_> = x.iter().map(|t| t.pack(_fbb)).collect();_fbb.create_vector(&w) ++ }); ++ let equipped_type = self.equipped.equipment_type(); ++ let equipped = self.equipped.pack(_fbb); ++ let path = self.path.as_ref().map(|x|{ ++ let w: Vec<_> = x.iter().map(|t| t.pack()).collect();_fbb.create_vector(&w) ++ }); ++ Monster::create(_fbb, &MonsterArgs{ ++ pos, ++ mana, ++ hp, ++ name, ++ inventory, ++ color, ++ weapons, ++ equipped_type, ++ equipped, ++ path, ++ }) ++ } ++} ++#[inline] ++#[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")] ++pub fn get_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> { ++ unsafe { flatbuffers::root_unchecked::>(buf) } ++} ++ ++#[inline] ++#[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")] ++pub fn get_size_prefixed_root_as_monster<'a>(buf: &'a [u8]) -> Monster<'a> { ++ unsafe { flatbuffers::size_prefixed_root_unchecked::>(buf) } ++} ++ ++#[inline] ++/// Verifies that a buffer of bytes contains a `Monster` ++/// and returns it. ++/// Note that verification is still experimental and may not ++/// catch every error, or be maximally performant. For the ++/// previous, unchecked, behavior use ++/// `root_as_monster_unchecked`. ++pub fn root_as_monster(buf: &[u8]) -> Result { ++ flatbuffers::root::(buf) ++} ++#[inline] ++/// Verifies that a buffer of bytes contains a size prefixed ++/// `Monster` and returns it. ++/// Note that verification is still experimental and may not ++/// catch every error, or be maximally performant. For the ++/// previous, unchecked, behavior use ++/// `size_prefixed_root_as_monster_unchecked`. ++pub fn size_prefixed_root_as_monster(buf: &[u8]) -> Result { ++ flatbuffers::size_prefixed_root::(buf) ++} ++#[inline] ++/// Verifies, with the given options, that a buffer of bytes ++/// contains a `Monster` and returns it. ++/// Note that verification is still experimental and may not ++/// catch every error, or be maximally performant. For the ++/// previous, unchecked, behavior use ++/// `root_as_monster_unchecked`. ++pub fn root_as_monster_with_opts<'b, 'o>( ++ opts: &'o flatbuffers::VerifierOptions, ++ buf: &'b [u8], ++) -> Result, flatbuffers::InvalidFlatbuffer> { ++ flatbuffers::root_with_opts::>(opts, buf) ++} ++#[inline] ++/// Verifies, with the given verifier options, that a buffer of ++/// bytes contains a size prefixed `Monster` and returns ++/// it. Note that verification is still experimental and may not ++/// catch every error, or be maximally performant. For the ++/// previous, unchecked, behavior use ++/// `root_as_monster_unchecked`. ++pub fn size_prefixed_root_as_monster_with_opts<'b, 'o>( ++ opts: &'o flatbuffers::VerifierOptions, ++ buf: &'b [u8], ++) -> Result, flatbuffers::InvalidFlatbuffer> { ++ flatbuffers::size_prefixed_root_with_opts::>(opts, buf) ++} ++#[inline] ++/// Assumes, without verification, that a buffer of bytes contains a Monster and returns it. ++/// # Safety ++/// Callers must trust the given bytes do indeed contain a valid `Monster`. ++pub unsafe fn root_as_monster_unchecked(buf: &[u8]) -> Monster { ++ flatbuffers::root_unchecked::(buf) ++} ++#[inline] ++/// Assumes, without verification, that a buffer of bytes contains a size prefixed Monster and returns it. ++/// # Safety ++/// Callers must trust the given bytes do indeed contain a valid size prefixed `Monster`. ++pub unsafe fn size_prefixed_root_as_monster_unchecked(buf: &[u8]) -> Monster { ++ flatbuffers::size_prefixed_root_unchecked::(buf) ++} ++#[inline] ++pub fn finish_monster_buffer<'a, 'b>( ++ fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, ++ root: flatbuffers::WIPOffset>) { ++ fbb.finish(root, None); ++} ++ ++#[inline] ++pub fn finish_size_prefixed_monster_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset>) { ++ fbb.finish_size_prefixed(root, None); ++} +diff -urN a/samples/rust_generated/my_game/sample/vec_3_generated.rs b/samples/rust_generated/my_game/sample/vec_3_generated.rs +--- a/samples/rust_generated/my_game/sample/vec_3_generated.rs 1970-01-01 00:00:00.000000000 +0000 ++++ b/samples/rust_generated/my_game/sample/vec_3_generated.rs 2023-01-13 07:46:54.908123027 +0000 +@@ -0,0 +1,185 @@ ++// automatically generated by the FlatBuffers compiler, do not modify ++extern crate flatbuffers; ++use std::mem; ++use std::cmp::Ordering; ++use self::flatbuffers::{EndianScalar, Follow}; ++use super::*; ++// struct Vec3, aligned to 4 ++#[repr(transparent)] ++#[derive(Clone, Copy, PartialEq)] ++pub struct Vec3(pub [u8; 12]); ++impl Default for Vec3 { ++ fn default() -> Self { ++ Self([0; 12]) ++ } ++} ++impl std::fmt::Debug for Vec3 { ++ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { ++ f.debug_struct("Vec3") ++ .field("x", &self.x()) ++ .field("y", &self.y()) ++ .field("z", &self.z()) ++ .finish() ++ } ++} ++ ++impl flatbuffers::SimpleToVerifyInSlice for Vec3 {} ++impl flatbuffers::SafeSliceAccess for Vec3 {} ++impl<'a> flatbuffers::Follow<'a> for Vec3 { ++ type Inner = &'a Vec3; ++ #[inline] ++ fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { ++ <&'a Vec3>::follow(buf, loc) ++ } ++} ++impl<'a> flatbuffers::Follow<'a> for &'a Vec3 { ++ type Inner = &'a Vec3; ++ #[inline] ++ fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { ++ flatbuffers::follow_cast_ref::(buf, loc) ++ } ++} ++impl<'b> flatbuffers::Push for Vec3 { ++ type Output = Vec3; ++ #[inline] ++ fn push(&self, dst: &mut [u8], _rest: &[u8]) { ++ let src = unsafe { ++ ::std::slice::from_raw_parts(self as *const Vec3 as *const u8, Self::size()) ++ }; ++ dst.copy_from_slice(src); ++ } ++} ++impl<'b> flatbuffers::Push for &'b Vec3 { ++ type Output = Vec3; ++ ++ #[inline] ++ fn push(&self, dst: &mut [u8], _rest: &[u8]) { ++ let src = unsafe { ++ ::std::slice::from_raw_parts(*self as *const Vec3 as *const u8, Self::size()) ++ }; ++ dst.copy_from_slice(src); ++ } ++} ++ ++impl<'a> flatbuffers::Verifiable for Vec3 { ++ #[inline] ++ fn run_verifier( ++ v: &mut flatbuffers::Verifier, pos: usize ++ ) -> Result<(), flatbuffers::InvalidFlatbuffer> { ++ use self::flatbuffers::Verifiable; ++ v.in_buffer::(pos) ++ } ++} ++ ++impl<'a> Vec3 { ++ #[allow(clippy::too_many_arguments)] ++ pub fn new( ++ x: f32, ++ y: f32, ++ z: f32, ++ ) -> Self { ++ let mut s = Self([0; 12]); ++ s.set_x(x); ++ s.set_y(y); ++ s.set_z(z); ++ s ++ } ++ ++ pub const fn get_fully_qualified_name() -> &'static str { ++ "MyGame.Sample.Vec3" ++ } ++ ++ pub fn x(&self) -> f32 { ++ let mut mem = core::mem::MaybeUninit::::uninit(); ++ unsafe { ++ core::ptr::copy_nonoverlapping( ++ self.0[0..].as_ptr(), ++ mem.as_mut_ptr() as *mut u8, ++ core::mem::size_of::(), ++ ); ++ mem.assume_init() ++ }.from_little_endian() ++ } ++ ++ pub fn set_x(&mut self, x: f32) { ++ let x_le = x.to_little_endian(); ++ unsafe { ++ core::ptr::copy_nonoverlapping( ++ &x_le as *const f32 as *const u8, ++ self.0[0..].as_mut_ptr(), ++ core::mem::size_of::(), ++ ); ++ } ++ } ++ ++ pub fn y(&self) -> f32 { ++ let mut mem = core::mem::MaybeUninit::::uninit(); ++ unsafe { ++ core::ptr::copy_nonoverlapping( ++ self.0[4..].as_ptr(), ++ mem.as_mut_ptr() as *mut u8, ++ core::mem::size_of::(), ++ ); ++ mem.assume_init() ++ }.from_little_endian() ++ } ++ ++ pub fn set_y(&mut self, x: f32) { ++ let x_le = x.to_little_endian(); ++ unsafe { ++ core::ptr::copy_nonoverlapping( ++ &x_le as *const f32 as *const u8, ++ self.0[4..].as_mut_ptr(), ++ core::mem::size_of::(), ++ ); ++ } ++ } ++ ++ pub fn z(&self) -> f32 { ++ let mut mem = core::mem::MaybeUninit::::uninit(); ++ unsafe { ++ core::ptr::copy_nonoverlapping( ++ self.0[8..].as_ptr(), ++ mem.as_mut_ptr() as *mut u8, ++ core::mem::size_of::(), ++ ); ++ mem.assume_init() ++ }.from_little_endian() ++ } ++ ++ pub fn set_z(&mut self, x: f32) { ++ let x_le = x.to_little_endian(); ++ unsafe { ++ core::ptr::copy_nonoverlapping( ++ &x_le as *const f32 as *const u8, ++ self.0[8..].as_mut_ptr(), ++ core::mem::size_of::(), ++ ); ++ } ++ } ++ ++ pub fn unpack(&self) -> Vec3T { ++ Vec3T { ++ x: self.x(), ++ y: self.y(), ++ z: self.z(), ++ } ++ } ++} ++ ++#[derive(Debug, Clone, PartialEq, Default)] ++pub struct Vec3T { ++ pub x: f32, ++ pub y: f32, ++ pub z: f32, ++} ++impl Vec3T { ++ pub fn pack(&self) -> Vec3 { ++ Vec3::new( ++ self.x, ++ self.y, ++ self.z, ++ ) ++ } ++} ++ +diff -urN a/samples/rust_generated/my_game/sample/weapon_generated.rs b/samples/rust_generated/my_game/sample/weapon_generated.rs +--- a/samples/rust_generated/my_game/sample/weapon_generated.rs 1970-01-01 00:00:00.000000000 +0000 ++++ b/samples/rust_generated/my_game/sample/weapon_generated.rs 2023-01-13 07:46:55.037124218 +0000 +@@ -0,0 +1,157 @@ ++// automatically generated by the FlatBuffers compiler, do not modify ++extern crate flatbuffers; ++use std::mem; ++use std::cmp::Ordering; ++use self::flatbuffers::{EndianScalar, Follow}; ++use super::*; ++pub enum WeaponOffset {} ++#[derive(Copy, Clone, PartialEq)] ++ ++pub struct Weapon<'a> { ++ pub _tab: flatbuffers::Table<'a>, ++} ++ ++impl<'a> flatbuffers::Follow<'a> for Weapon<'a> { ++ type Inner = Weapon<'a>; ++ #[inline] ++ fn follow(buf: &'a [u8], loc: usize) -> Self::Inner { ++ Self { _tab: flatbuffers::Table { buf, loc } } ++ } ++} ++ ++impl<'a> Weapon<'a> { ++ pub const VT_NAME: flatbuffers::VOffsetT = 4; ++ pub const VT_DAMAGE: flatbuffers::VOffsetT = 6; ++ ++ pub const fn get_fully_qualified_name() -> &'static str { ++ "MyGame.Sample.Weapon" ++ } ++ ++ #[inline] ++ pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self { ++ Weapon { _tab: table } ++ } ++ #[allow(unused_mut)] ++ pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( ++ _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, ++ args: &'args WeaponArgs<'args> ++ ) -> flatbuffers::WIPOffset> { ++ let mut builder = WeaponBuilder::new(_fbb); ++ if let Some(x) = args.name { builder.add_name(x); } ++ builder.add_damage(args.damage); ++ builder.finish() ++ } ++ ++ pub fn unpack(&self) -> WeaponT { ++ let name = self.name().map(|x| { ++ x.to_string() ++ }); ++ let damage = self.damage(); ++ WeaponT { ++ name, ++ damage, ++ } ++ } ++ ++ #[inline] ++ pub fn name(&self) -> Option<&'a str> { ++ self._tab.get::>(Weapon::VT_NAME, None) ++ } ++ #[inline] ++ pub fn damage(&self) -> i16 { ++ self._tab.get::(Weapon::VT_DAMAGE, Some(0)).unwrap() ++ } ++} ++ ++impl flatbuffers::Verifiable for Weapon<'_> { ++ #[inline] ++ fn run_verifier( ++ v: &mut flatbuffers::Verifier, pos: usize ++ ) -> Result<(), flatbuffers::InvalidFlatbuffer> { ++ use self::flatbuffers::Verifiable; ++ v.visit_table(pos)? ++ .visit_field::>("name", Self::VT_NAME, false)? ++ .visit_field::("damage", Self::VT_DAMAGE, false)? ++ .finish(); ++ Ok(()) ++ } ++} ++pub struct WeaponArgs<'a> { ++ pub name: Option>, ++ pub damage: i16, ++} ++impl<'a> Default for WeaponArgs<'a> { ++ #[inline] ++ fn default() -> Self { ++ WeaponArgs { ++ name: None, ++ damage: 0, ++ } ++ } ++} ++ ++pub struct WeaponBuilder<'a: 'b, 'b> { ++ fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, ++ start_: flatbuffers::WIPOffset, ++} ++impl<'a: 'b, 'b> WeaponBuilder<'a, 'b> { ++ #[inline] ++ pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) { ++ self.fbb_.push_slot_always::>(Weapon::VT_NAME, name); ++ } ++ #[inline] ++ pub fn add_damage(&mut self, damage: i16) { ++ self.fbb_.push_slot::(Weapon::VT_DAMAGE, damage, 0); ++ } ++ #[inline] ++ pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> WeaponBuilder<'a, 'b> { ++ let start = _fbb.start_table(); ++ WeaponBuilder { ++ fbb_: _fbb, ++ start_: start, ++ } ++ } ++ #[inline] ++ pub fn finish(self) -> flatbuffers::WIPOffset> { ++ let o = self.fbb_.end_table(self.start_); ++ flatbuffers::WIPOffset::new(o.value()) ++ } ++} ++ ++impl std::fmt::Debug for Weapon<'_> { ++ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { ++ let mut ds = f.debug_struct("Weapon"); ++ ds.field("name", &self.name()); ++ ds.field("damage", &self.damage()); ++ ds.finish() ++ } ++} ++#[non_exhaustive] ++#[derive(Debug, Clone, PartialEq)] ++pub struct WeaponT { ++ pub name: Option, ++ pub damage: i16, ++} ++impl Default for WeaponT { ++ fn default() -> Self { ++ Self { ++ name: None, ++ damage: 0, ++ } ++ } ++} ++impl WeaponT { ++ pub fn pack<'b>( ++ &self, ++ _fbb: &mut flatbuffers::FlatBufferBuilder<'b> ++ ) -> flatbuffers::WIPOffset> { ++ let name = self.name.as_ref().map(|x|{ ++ _fbb.create_string(x) ++ }); ++ let damage = self.damage; ++ Weapon::create(_fbb, &WeaponArgs{ ++ name, ++ damage, ++ }) ++ } ++} +diff -urN a/samples/sample_binary.rs b/samples/sample_binary.rs +--- a/samples/sample_binary.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/samples/sample_binary.rs 2023-01-13 07:46:55.038124227 +0000 +@@ -19,10 +19,9 @@ + + // import the generated code + #[allow(dead_code, unused_imports)] +-#[path = "./monster_generated.rs"] + #[allow(clippy::approx_constant)] // We use low precision PI as a default value. +-mod monster_generated; +-pub use monster_generated::my_game::sample::{Color, Equipment, ++mod rust_generated; ++pub use rust_generated::my_game::sample::{Color, Equipment, + Monster, MonsterArgs, + Vec3, + Weapon, WeaponArgs}; +@@ -33,7 +32,7 @@ + fn main() { + // Build up a serialized buffer algorithmically. + // Initialize it with a capacity of 1024 bytes. +- let mut builder = flatbuffers::FlatBufferBuilder::new_with_capacity(1024); ++ let mut builder = flatbuffers::FlatBufferBuilder::with_capacity(1024); + + // Serialize some weapons for the Monster: A 'sword' and an 'axe'. + let weapon_one_name = builder.create_string("Sword"); +diff -urN a/samples/sample_flexbuffers.rs b/samples/sample_flexbuffers.rs +--- a/samples/sample_flexbuffers.rs 2021-05-10 18:45:16.000000000 +0000 ++++ b/samples/sample_flexbuffers.rs 2023-01-13 07:46:55.038124227 +0000 +@@ -16,7 +16,6 @@ + + use flexbuffers::{BitWidth, Builder, Reader, ReaderError}; + +- + // In this Example we're creating a monster that corresponds to the following JSON: + // { + // "coins": [5, 10, 25, 25, 25, 100], +diff -urN a/scripts/check-generate-code.sh b/scripts/check-generate-code.sh +--- a/scripts/check-generate-code.sh 2021-05-10 18:45:16.000000000 +0000 ++++ b/scripts/check-generate-code.sh 1970-01-01 00:00:00.000000000 +0000 +@@ -1,36 +0,0 @@ +-#!/bin/bash +-# +-# Copyright 2018 Google Inc. All rights reserved. +-# +-# 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. +-set -e +- +-cd tests +-./generate_code.sh +-cd .. +- +-# TODO: Linux and macos builds produce differences here for some reason. +-git checkout HEAD -- tests/monster_test.bfbs +-git checkout HEAD -- tests/arrays_test.bfbs +-git checkout HEAD -- samples/monster.bfbs +- +-if ! git diff --quiet; then +- echo >&2 +- echo "ERROR: ********************************************************" >&2 +- echo "ERROR: The following differences were found after running the" >&2 +- echo "ERROR: tests/generate_code.sh script. Maybe you forgot to run" >&2 +- echo "ERROR: it after making changes in a generator or schema?" >&2 +- echo "ERROR: ********************************************************" >&2 +- echo >&2 +- git diff --binary --exit-code +-fi +diff -urN a/scripts/check_generate_code.py b/scripts/check_generate_code.py +--- a/scripts/check_generate_code.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/scripts/check_generate_code.py 2023-01-13 07:47:13.358293421 +0000 +@@ -0,0 +1,63 @@ ++#!/usr/bin/env python3 ++# ++# Copyright 2021 Google Inc. All rights reserved. ++# ++# 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. ++ ++import platform ++import subprocess ++import sys ++from pathlib import Path ++ ++# Get the path where this script is located so we can invoke the script from ++# any directory and have the paths work correctly. ++script_path = Path(__file__).parent.resolve() ++ ++# Get the root path as an absolute path, so all derived paths are absolute. ++root_path = script_path.parent.absolute() ++ ++result = subprocess.run(["git", "diff", "--quiet"], cwd=root_path) ++ ++if result.returncode != 0: ++ print( ++ "\n" ++ "ERROR: *********************************************************\n" ++ "ERROR: * The following differences were found after building. *\n" ++ "ERROR: * Perhaps there is a difference in the flags for the. *\n" ++ "ERROR: * CMakeLists.txt vs the script/generate_code.py script? *\n" ++ "ERROR: *********************************************************\n" ++ ) ++ subprocess.run(["git", "diff", "--binary", "--exit-code"], cwd=root_path) ++ sys.exit(result.returncode) ++ ++# Rung the generate_code.py script, forwarding arguments ++gen_cmd = ["scripts/generate_code.py"] + sys.argv[1:] ++if platform.system() == "Windows": ++ gen_cmd = ["py"] + gen_cmd ++subprocess.run(gen_cmd, cwd=root_path) ++ ++result = subprocess.run(["git", "diff", "--quiet"], cwd=root_path) ++ ++if result.returncode != 0: ++ print( ++ "\n" ++ "ERROR: ********************************************************\n" ++ "ERROR: * The following differences were found after running *\n" ++ "ERROR: * the script/generate_code.py script. Maybe you forgot *\n" ++ "ERROR: * to run it after making changes in a generator? *\n" ++ "ERROR: ********************************************************\n" ++ ) ++ subprocess.run(["git", "diff", "--binary", "--exit-code"], cwd=root_path) ++ sys.exit(result.returncode) ++ ++sys.exit(0) +diff -urN a/scripts/clang-format-all.sh b/scripts/clang-format-all.sh +--- a/scripts/clang-format-all.sh 1970-01-01 00:00:00.000000000 +0000 ++++ b/scripts/clang-format-all.sh 2023-01-13 07:47:13.358293421 +0000 +@@ -0,0 +1,6 @@ ++# Running it twice corrects some bugs in clang-format. ++for run in {1..2} ++do ++ clang-format -i include/flatbuffers/* src/*.cpp tests/*.cpp samples/*.cpp grpc/src/compiler/schema_interface.h grpc/tests/*.cpp ++done ++git checkout include/flatbuffers/reflection_generated.h +diff -urN a/scripts/clang-format-git.sh b/scripts/clang-format-git.sh +--- a/scripts/clang-format-git.sh 1970-01-01 00:00:00.000000000 +0000 ++++ b/scripts/clang-format-git.sh 2023-01-13 07:47:13.369293522 +0000 +@@ -0,0 +1,6 @@ ++# Running it twice corrects some bugs in clang-format. ++for run in {1..2} ++do ++ git clang-format HEAD^ -- include/flatbuffers/* src/*.cpp tests/*.cpp samples/*.cpp grpc/src/compiler/schema_interface.h grpc/tests/*.cpp -f ++done ++git checkout include/flatbuffers/reflection_generated.h +diff -urN a/scripts/generate_code.py b/scripts/generate_code.py +--- a/scripts/generate_code.py 1970-01-01 00:00:00.000000000 +0000 ++++ b/scripts/generate_code.py 2023-01-13 07:47:13.370293532 +0000 +@@ -0,0 +1,453 @@ ++#!/usr/bin/env python3 ++# ++# Copyright 2021 Google Inc. All rights reserved. ++# ++# 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. ++ ++import argparse ++import filecmp ++import glob ++import platform ++import shutil ++import subprocess ++import sys ++from pathlib import Path ++ ++parser = argparse.ArgumentParser() ++parser.add_argument( ++ "--flatc", ++ help="path of the Flat C compiler relative to the root directory", ++) ++parser.add_argument("--cpp-0x", action="store_true", help="use --cpp-std c++ox") ++parser.add_argument( ++ "--skip-monster-extra", ++ action="store_true", ++ help="skip generating tests involving monster_extra.fbs", ++) ++parser.add_argument( ++ "--skip-gen-reflection", ++ action="store_true", ++ help="skip generating the reflection.fbs files", ++) ++args = parser.parse_args() ++ ++# Get the path where this script is located so we can invoke the script from ++# any directory and have the paths work correctly. ++script_path = Path(__file__).parent.resolve() ++ ++# Get the root path as an absolute path, so all derived paths are absolute. ++root_path = script_path.parent.absolute() ++ ++# Get the location of the flatc executable, reading from the first command line ++# argument or defaulting to default names. ++flatc_exe = Path( ++ ("flatc" if not platform.system() == "Windows" else "flatc.exe") ++ if not args.flatc ++ else args.flatc ++) ++ ++# Find and assert flatc compiler is present. ++if root_path in flatc_exe.parents: ++ flatc_exe = flatc_exe.relative_to(root_path) ++flatc_path = Path(root_path, flatc_exe) ++assert flatc_path.exists(), "Cannot find the flatc compiler " + str(flatc_path) ++ ++# Specify the other paths that will be referenced ++tests_path = Path(root_path, "tests") ++samples_path = Path(root_path, "samples") ++reflection_path = Path(root_path, "reflection") ++ ++# Execute the flatc compiler with the specified parameters ++def flatc( ++ options, schema, prefix=None, include=None, data=None, cwd=tests_path ++): ++ cmd = [str(flatc_path)] + options ++ if prefix: ++ cmd += ["-o"] + [prefix] ++ if include: ++ cmd += ["-I"] + [include] ++ cmd += [schema] if isinstance(schema, str) else schema ++ if data: ++ cmd += [data] if isinstance(data, str) else data ++ result = subprocess.run(cmd, cwd=str(cwd), check=True) ++ ++ ++# Generate the code for flatbuffers reflection schema ++def flatc_reflection(options, location, target): ++ full_options = ["--no-prefix"] + options ++ temp_dir = ".tmp" ++ flatc( ++ full_options, ++ prefix=temp_dir, ++ schema="reflection.fbs", ++ cwd=reflection_path, ++ ) ++ new_reflection_path = Path(reflection_path, temp_dir, target) ++ original_reflection_path = Path(root_path, location, target) ++ if not filecmp.cmp(str(new_reflection_path), str(original_reflection_path)): ++ shutil.rmtree(str(original_reflection_path)) ++ shutil.move(str(new_reflection_path), str(original_reflection_path)) ++ shutil.rmtree(str(Path(reflection_path, temp_dir))) ++ ++ ++# Glob a pattern relative to file path ++def glob(path, pattern): ++ return [str(p) for p in path.glob(pattern)] ++ ++ ++# flatc options that are shared ++BASE_OPTS = ["--reflect-names", "--gen-mutable", "--gen-object-api"] ++NO_INCL_OPTS = BASE_OPTS + ["--no-includes"] ++ ++# Language specific options ++CS_OPTS = ["--csharp", "--cs-gen-json-serializer"] ++CPP_OPTS = [ ++ "--cpp", ++ "--gen-compare", ++ "--cpp-ptr-type", ++ "flatbuffers::unique_ptr", ++] + (["--cpp-std", "c++0x"] if args.cpp_0x else []) ++ ++CPP_17_OPTS = NO_INCL_OPTS + [ ++ "--cpp", ++ "--cpp-std", ++ "c++17", ++ "--cpp-static-reflection", ++ "--gen-object-api", ++] ++RUST_OPTS = BASE_OPTS + ["--rust", "--gen-all", "--gen-name-strings", "--rust-module-root-file"] ++RUST_SERIALIZE_OPTS = BASE_OPTS + [ ++ "--rust", ++ "--gen-all", ++ "--gen-name-strings", ++ "--rust-serialize", ++ "--rust-module-root-file", ++] ++TS_OPTS = ["--ts", "--gen-name-strings"] ++LOBSTER_OPTS = ["--lobster"] ++SWIFT_OPTS = ["--swift", "--gen-json-emit", "--bfbs-filenames", str(tests_path)] ++JAVA_OPTS = ["--java"] ++KOTLIN_OPTS = ["--kotlin"] ++PHP_OPTS = ["--php"] ++DART_OPTS = ["--dart"] ++PYTHON_OPTS = ["--python"] ++BINARY_OPTS = ["-b", "--schema", "--bfbs-comments", "--bfbs-builtins"] ++ ++# Basic Usage ++ ++flatc( ++ NO_INCL_OPTS ++ + CPP_OPTS ++ + CS_OPTS ++ + TS_OPTS ++ + [ ++ "--binary", ++ "--java", ++ "--kotlin", ++ "--dart", ++ "--go", ++ "--lobster", ++ "--php", ++ ], ++ schema="monster_test.fbs", ++ include="include_test", ++ data="monsterdata_test.json", ++) ++ ++flatc( ++ ["--lua", "--bfbs-filenames", str(tests_path)], ++ schema="monster_test.fbs", ++ include="include_test", ++) ++ ++flatc( ++ NO_INCL_OPTS + CPP_OPTS + ["--grpc"], ++ schema="monster_test.fbs", ++ include="include_test", ++ data="monsterdata_test.json", ++) ++ ++flatc( ++ RUST_OPTS, ++ schema="monster_test.fbs", ++ include="include_test", ++ prefix="monster_test", ++ data="monsterdata_test.json", ++) ++ ++flatc( ++ RUST_SERIALIZE_OPTS, ++ schema="monster_test.fbs", ++ include="include_test", ++ prefix="monster_test_serialize", ++ data="monsterdata_test.json", ++) ++ ++flatc( ++ options=BASE_OPTS + ["--python"], ++ schema="monster_test.fbs", ++ include="include_test", ++ data="monsterdata_test.json", ++) ++ ++flatc( ++ options=BASE_OPTS + ["--python", "--gen-onefile"], ++ schema="monster_test.fbs", ++ include="include_test", ++ data="monsterdata_test.json", ++) ++ ++# For Rust we currently generate two independent schemas, with namespace_test2 ++# duplicating the types in namespace_test1 ++flatc( ++ RUST_OPTS, ++ prefix="namespace_test", ++ schema=[ ++ "namespace_test/namespace_test1.fbs", ++ "namespace_test/namespace_test2.fbs", ++ ], ++) ++ ++flatc( ++ BASE_OPTS ++ + CPP_OPTS ++ + CS_OPTS ++ + TS_OPTS ++ + JAVA_OPTS ++ + KOTLIN_OPTS ++ + PHP_OPTS, ++ prefix="union_vector", ++ schema="union_vector/union_vector.fbs", ++) ++ ++flatc( ++ BASE_OPTS + TS_OPTS + ["--gen-name-strings", "--gen-mutable"], ++ include="include_test", ++ schema="monster_test.fbs", ++) ++ ++flatc( ++ BASE_OPTS + TS_OPTS + ["-b"], ++ include="include_test", ++ schema="monster_test.fbs", ++ data="unicode_test.json", ++) ++ ++flatc( ++ BASE_OPTS + TS_OPTS + ["--gen-name-strings"], ++ prefix="union_vector", ++ schema="union_vector/union_vector.fbs", ++) ++ ++flatc( ++ RUST_OPTS, ++ prefix="include_test1", ++ include="include_test", ++ schema="include_test/include_test1.fbs", ++) ++ ++flatc( ++ RUST_OPTS, ++ prefix="include_test2", ++ include="include_test", ++ schema="include_test/sub/include_test2.fbs", ++) ++ ++flatc( ++ BINARY_OPTS + ["--bfbs-filenames", str(tests_path)], ++ include="include_test", ++ schema="monster_test.fbs", ++) ++ ++flatc( ++ CPP_OPTS ++ + NO_INCL_OPTS ++ + [ ++ "--bfbs-comments", ++ "--bfbs-builtins", ++ "--bfbs-gen-embed", ++ "--bfbs-filenames", ++ str(tests_path), ++ ], ++ include="include_test", ++ schema="monster_test.fbs", ++) ++ ++flatc( ++ BINARY_OPTS + ["--bfbs-filenames", str(tests_path)], ++ include="include_test", ++ schema="arrays_test.fbs", ++) ++ ++flatc( ++ ["--jsonschema", "--schema"], ++ include="include_test", ++ schema="monster_test.fbs", ++) ++ ++if not args.skip_monster_extra: ++ flatc( ++ CPP_OPTS ++ + CS_OPTS ++ + NO_INCL_OPTS ++ + JAVA_OPTS ++ + KOTLIN_OPTS ++ + PYTHON_OPTS, ++ schema="monster_extra.fbs", ++ data="monsterdata_extra.json", ++ ) ++ ++ flatc( ++ DART_OPTS + ["--gen-object-api"], ++ schema="monster_extra.fbs", ++ ) ++ ++flatc( ++ CPP_OPTS ++ + CS_OPTS ++ + NO_INCL_OPTS ++ + JAVA_OPTS ++ + ["--jsonschema", "--scoped-enums"], ++ schema="arrays_test.fbs", ++) ++ ++flatc( ++ RUST_OPTS, ++ prefix="arrays_test", ++ schema="arrays_test.fbs", ++) ++ ++flatc( ++ BASE_OPTS + PYTHON_OPTS, ++ schema="arrays_test.fbs", ++) ++ ++ ++# Optional Scalars ++optional_scalars_schema = "optional_scalars.fbs" ++flatc( ++ ["--java", "--kotlin", "--lobster", "--ts"], schema=optional_scalars_schema ++) ++ ++flatc(["--csharp", "--gen-object-api"], schema=optional_scalars_schema) ++ ++flatc(RUST_OPTS, prefix="optional_scalars", schema=optional_scalars_schema) ++ ++flatc(NO_INCL_OPTS + CPP_OPTS, schema=optional_scalars_schema) ++ ++# Generate string/vector default code for tests ++flatc(RUST_OPTS, prefix="more_defaults", schema="more_defaults.fbs") ++ ++# Generate the schema evolution tests ++flatc( ++ CPP_OPTS + ["--scoped-enums"], ++ prefix="evolution_test", ++ schema=glob(tests_path, "evolution_test/evolution_v*.fbs"), ++) ++ ++# Generate the keywords tests ++flatc(BASE_OPTS + CS_OPTS, schema="keyword_test.fbs") ++flatc(RUST_OPTS, prefix="keyword_test", schema="keyword_test.fbs") ++flatc( ++ BASE_OPTS + CS_OPTS + ["--cs-global-alias", "--gen-onefile"], ++ prefix="nested_namespace_test", ++ schema=glob(tests_path, "nested_namespace_test/nested_namespace_test*.fbs"), ++) ++ ++# Swift Tests ++swift_prefix = "FlatBuffers.Test.Swift/Tests/FlatBuffers.Test.SwiftTests" ++flatc( ++ SWIFT_OPTS + NO_INCL_OPTS + ["--grpc"], ++ schema="monster_test.fbs", ++ include="include_test", ++ prefix=swift_prefix, ++) ++flatc( ++ SWIFT_OPTS + BASE_OPTS, ++ schema="union_vector/union_vector.fbs", ++ prefix=swift_prefix, ++) ++flatc(SWIFT_OPTS, schema="optional_scalars.fbs", prefix=swift_prefix) ++flatc( ++ SWIFT_OPTS + ["--gen-object-api"], ++ schema="more_defaults.fbs", ++ prefix=swift_prefix, ++) ++flatc( ++ SWIFT_OPTS + BASE_OPTS, ++ schema="MutatingBool.fbs", ++ prefix=swift_prefix, ++) ++ ++# --filename-suffix and --filename-ext tests ++flatc( ++ CPP_OPTS ++ + NO_INCL_OPTS ++ + ["--filename-suffix", "_suffix", "--filename-ext", "hpp"], ++ include="include_test", ++ schema="monster_test.fbs", ++) ++orig_monster_file = Path(tests_path, "monster_test_generated.h") ++new_monster_file = Path(tests_path, "monster_test_suffix.hpp") ++assert ( ++ new_monster_file.exists() ++), "filename suffix option did not produce a file" ++assert filecmp.cmp( ++ str(orig_monster_file), str(new_monster_file) ++), "filename suffix option did not produce identical results" ++new_monster_file.unlink() ++ ++# Flag c++17 requires Clang6, GCC7, MSVC2017 (_MSC_VER >= 1914) or higher. ++cpp_17_prefix = "cpp17/generated_cpp17" ++flatc( ++ CPP_17_OPTS, ++ schema="monster_test.fbs", ++ include="include_test", ++ prefix=cpp_17_prefix, ++) ++flatc( ++ CPP_17_OPTS, ++ schema="optional_scalars.fbs", ++ prefix=cpp_17_prefix, ++) ++flatc( ++ CPP_17_OPTS, ++ schema="union_vector/union_vector.fbs", ++ prefix=cpp_17_prefix, ++) ++ ++# Sample files ++samples_schema = "monster.fbs" ++flatc( ++ BASE_OPTS + CPP_OPTS + LOBSTER_OPTS, schema=samples_schema, cwd=samples_path ++) ++flatc( ++ RUST_OPTS, prefix="rust_generated", schema=samples_schema, cwd=samples_path ++) ++flatc( ++ BINARY_OPTS + ["--bfbs-filenames", str(samples_path)], ++ schema=samples_schema, ++ cwd=samples_path, ++) ++ ++# Reflection ++ ++# Skip generating the reflection if told too, as we run this script after ++# building flatc which uses the reflection_generated.h itself. ++if not args.skip_gen_reflection: ++ # C++ Reflection ++ flatc_reflection(["-c", "--cpp-std", "c++0x"], "include/flatbuffers", ++ "reflection_generated.h") ++ ++# Python Reflection ++flatc_reflection(["-p"], "python/flatbuffers", "reflection") +diff -urN a/snap/snapcraft.yaml b/snap/snapcraft.yaml +--- a/snap/snapcraft.yaml 2021-05-10 18:45:16.000000000 +0000 ++++ b/snap/snapcraft.yaml 2023-01-13 07:46:55.744130748 +0000 +@@ -1,6 +1,6 @@ + name: flatbuffers + base: core18 +-version: git ++adopt-info: flatc + summary: FlatBuffers compiler + description: | + FlatBuffers compiler +@@ -26,10 +26,24 @@ + - -DCMAKE_BUILD_TYPE=Release + build-packages: + - g++ ++ - git ++ override-pull: | ++ snapcraftctl pull ++ tag=$(git describe --tags --abbrev=0) ++ count=$(git rev-list $tag.. --count) ++ if [ "$count" = 0 ]; ++ then ++ version=$tag ++ else ++ hash=$(git rev-parse --short HEAD) ++ version=$tag+git$count.$hash ++ fi ++ snapcraftctl set-version $version ++ + + apps: + flatc: +- command: flatc ++ command: bin/flatc + plugs: + - home + - removable-media +diff -urN a/src/BUILD.bazel b/src/BUILD.bazel +--- a/src/BUILD.bazel 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/BUILD.bazel 2023-01-13 07:47:08.194245730 +0000 +@@ -17,6 +17,15 @@ + "util.cpp", + ], + hdrs = ["//:public_headers"], ++ linkopts = select({ ++ # TODO: Bazel uses `clang` instead of `clang++` to link ++ # C++ code on BSD. Temporarily adding these linker flags while ++ # we wait for Bazel to resolve ++ # https://github.com/bazelbuild/bazel/issues/12023. ++ "//:platform_freebsd": ["-lm"], ++ "//:platform_openbsd": ["-lm"], ++ "//conditions:default": [], ++ }), + strip_include_prefix = "/include", + visibility = ["//:__pkg__"], + ) +@@ -25,6 +34,9 @@ + cc_library( + name = "flatc_library", + srcs = [ ++ "bfbs_gen.h", ++ "bfbs_gen_lua.cpp", ++ "bfbs_gen_lua.h", + "flatc.cpp", + ], + hdrs = [ +@@ -41,6 +53,9 @@ + cc_library( + name = "flatc", + srcs = [ ++ "bfbs_gen.h", ++ "bfbs_gen_lua.cpp", ++ "bfbs_gen_lua.h", + "flatc_main.cpp", + "idl_gen_cpp.cpp", + "idl_gen_csharp.cpp", +diff -urN a/src/bfbs_gen.h b/src/bfbs_gen.h +--- a/src/bfbs_gen.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/src/bfbs_gen.h 2023-01-13 07:47:08.195245739 +0000 +@@ -0,0 +1,224 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_BFBS_GEN_H_ ++#define FLATBUFFERS_BFBS_GEN_H_ ++ ++#include ++ ++#include "flatbuffers/bfbs_generator.h" ++#include "flatbuffers/reflection_generated.h" ++ ++namespace flatbuffers { ++ ++void ForAllEnums( ++ const flatbuffers::Vector> *enums, ++ std::function func) { ++ for (auto it = enums->cbegin(); it != enums->cend(); ++it) { func(*it); } ++} ++ ++void ForAllObjects( ++ const flatbuffers::Vector> *objects, ++ std::function func) { ++ for (auto it = objects->cbegin(); it != objects->cend(); ++it) { func(*it); } ++} ++ ++void ForAllEnumValues(const reflection::Enum *enum_def, ++ std::function func) { ++ for (auto it = enum_def->values()->cbegin(); it != enum_def->values()->cend(); ++ ++it) { ++ func(*it); ++ } ++} ++ ++void ForAllDocumentation( ++ const flatbuffers::Vector> ++ *documentation, ++ std::function func) { ++ if (!documentation) { return; } ++ for (auto it = documentation->cbegin(); it != documentation->cend(); ++it) { ++ func(*it); ++ } ++} ++ ++// Maps the field index into object->fields() to the field's ID (the ith element ++// in the return vector). ++static std::vector FieldIdToIndex(const reflection::Object *object) { ++ std::vector field_index_by_id; ++ field_index_by_id.resize(object->fields()->size()); ++ ++ // Create the mapping of field ID to the index into the vector. ++ for (uint32_t i = 0; i < object->fields()->size(); ++i) { ++ auto field = object->fields()->Get(i); ++ field_index_by_id[field->id()] = i; ++ } ++ ++ return field_index_by_id; ++} ++ ++static bool IsStructOrTable(const reflection::BaseType base_type) { ++ return base_type == reflection::Obj; ++} ++ ++static bool IsScalar(const reflection::BaseType base_type) { ++ return base_type >= reflection::UType && base_type <= reflection::Double; ++} ++ ++static bool IsFloatingPoint(const reflection::BaseType base_type) { ++ return base_type == reflection::Float || base_type == reflection::Double; ++} ++ ++static bool IsBool(const reflection::BaseType base_type) { ++ return base_type == reflection::Bool; ++} ++ ++static bool IsSingleByte(const reflection::BaseType base_type) { ++ return base_type >= reflection::UType && base_type <= reflection::UByte; ++} ++ ++static bool IsVector(const reflection::BaseType base_type) { ++ return base_type == reflection::Vector; ++} ++ ++static std::string MakeCamelCase(const std::string &in, ++ bool uppercase_first = true) { ++ std::string s; ++ for (size_t i = 0; i < in.length(); i++) { ++ if (!i && uppercase_first) ++ s += static_cast(::toupper(static_cast(in[0]))); ++ else if (in[i] == '_' && i + 1 < in.length()) ++ s += static_cast(::toupper(static_cast(in[++i]))); ++ else ++ s += in[i]; ++ } ++ return s; ++} ++ ++static std::string Denamespace(const flatbuffers::String *name, ++ std::string &ns) { ++ const size_t pos = name->str().find_last_of('.'); ++ if (pos == std::string::npos) { ++ ns = ""; ++ return name->str(); ++ } ++ ns = name->str().substr(0, pos); ++ return name->str().substr(pos + 1); ++} ++ ++static std::string Denamespace(const flatbuffers::String *name) { ++ std::string ns; ++ return Denamespace(name, ns); ++} ++ ++// A concrete base Flatbuffer Generator that specific language generators can ++// derive from. ++class BaseBfbsGenerator : public BfbsGenerator { ++ public: ++ virtual ~BaseBfbsGenerator() {} ++ BaseBfbsGenerator() : schema_(nullptr) {} ++ ++ virtual GeneratorStatus GenerateFromSchema( ++ const reflection::Schema *schema) = 0; ++ ++ // ++ virtual uint64_t SupportedAdvancedFeatures() const = 0; ++ ++ // Override of the Generator::generate method that does the initial ++ // deserialization and verification steps. ++ GeneratorStatus Generate(const uint8_t *buffer, ++ int64_t length) FLATBUFFERS_OVERRIDE { ++ flatbuffers::Verifier verifier(buffer, static_cast(length)); ++ if (!reflection::VerifySchemaBuffer(verifier)) { ++ return FAILED_VERIFICATION; ++ } ++ ++ // Store the root schema since there are cases where leaf nodes refer to ++ // things in the root schema (e.g., indexing the objects). ++ schema_ = reflection::GetSchema(buffer); ++ ++ const uint64_t advance_features = schema_->advanced_features(); ++ if (advance_features > SupportedAdvancedFeatures()) { ++ return FAILED_VERIFICATION; ++ } ++ ++ GeneratorStatus status = GenerateFromSchema(schema_); ++ schema_ = nullptr; ++ return status; ++ } ++ ++ protected: ++ const reflection::Object *GetObject(const reflection::Type *type) const { ++ if (type->index() >= 0 && IsStructOrTable(type->base_type())) { ++ return GetObjectByIndex(type->index()); ++ } ++ return nullptr; ++ } ++ ++ const reflection::Enum *GetEnum(const reflection::Type *type) const { ++ // TODO(derekbailey): it would be better to have a explicit list of allowed ++ // base types, instead of negating Obj types. ++ if (type->index() >= 0 && !IsStructOrTable(type->base_type())) { ++ return GetEnumByIndex(type->index()); ++ } ++ return nullptr; ++ } ++ ++ // Used to get a object that is reference by index. (e.g. ++ // reflection::Type::index). Returns nullptr if no object is available. ++ const reflection::Object *GetObjectByIndex(int32_t index) const { ++ if (!schema_ || index < 0 || ++ index >= static_cast(schema_->objects()->size())) { ++ return nullptr; ++ } ++ return schema_->objects()->Get(index); ++ } ++ ++ // Used to get a enum that is reference by index. (e.g. ++ // reflection::Type::index). Returns nullptr if no enum is available. ++ const reflection::Enum *GetEnumByIndex(int32_t index) const { ++ if (!schema_ || index < 0 || ++ index >= static_cast(schema_->enums()->size())) { ++ return nullptr; ++ } ++ return schema_->enums()->Get(index); ++ } ++ ++ void ForAllFields(const reflection::Object *object, bool reverse, ++ std::function func) const { ++ const std::vector field_to_id_map = FieldIdToIndex(object); ++ for (size_t i = 0; i < field_to_id_map.size(); ++i) { ++ func(object->fields()->Get( ++ field_to_id_map[reverse ? field_to_id_map.size() - (i + 1) : i])); ++ } ++ } ++ ++ bool IsTable(const reflection::Type *type, bool use_element = false) const { ++ return !IsStruct(type, use_element); ++ } ++ ++ bool IsStruct(const reflection::Type *type, bool use_element = false) const { ++ const reflection::BaseType base_type = ++ use_element ? type->element() : type->base_type(); ++ return IsStructOrTable(base_type) && ++ GetObjectByIndex(type->index())->is_struct(); ++ } ++ ++ const reflection::Schema *schema_; ++}; ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_BFBS_GEN_H_ +\ No newline at end of file +diff -urN a/src/bfbs_gen_lua.cpp b/src/bfbs_gen_lua.cpp +--- a/src/bfbs_gen_lua.cpp 1970-01-01 00:00:00.000000000 +0000 ++++ b/src/bfbs_gen_lua.cpp 2023-01-13 07:47:08.196245748 +0000 +@@ -0,0 +1,620 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#include "bfbs_gen_lua.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++// Ensure no includes to flatc internals. bfbs_gen.h and generator.h are OK. ++#include "bfbs_gen.h" ++#include "flatbuffers/bfbs_generator.h" ++ ++// The intermediate representation schema. ++#include "flatbuffers/reflection_generated.h" ++ ++namespace flatbuffers { ++namespace { ++ ++// To reduce typing ++namespace r = ::reflection; ++ ++class LuaBfbsGenerator : public BaseBfbsGenerator { ++ public: ++ explicit LuaBfbsGenerator(const std::string &flatc_version) ++ : BaseBfbsGenerator(), ++ keywords_(), ++ requires_(), ++ current_obj_(nullptr), ++ current_enum_(nullptr), ++ flatc_version_(flatc_version) { ++ static const char *const keywords[] = { ++ "and", "break", "do", "else", "elseif", "end", "false", "for", ++ "function", "goto", "if", "in", "local", "nil", "not", "or", ++ "repeat", "return", "then", "true", "until", "while" ++ }; ++ keywords_.insert(std::begin(keywords), std::end(keywords)); ++ } ++ ++ GeneratorStatus GenerateFromSchema(const r::Schema *schema) ++ FLATBUFFERS_OVERRIDE { ++ if (!GenerateEnums(schema->enums())) { return FAILED; } ++ if (!GenerateObjects(schema->objects(), schema->root_table())) { ++ return FAILED; ++ } ++ return OK; ++ } ++ ++ uint64_t SupportedAdvancedFeatures() const FLATBUFFERS_OVERRIDE { ++ return 0xF; ++ } ++ ++ protected: ++ bool GenerateEnums( ++ const flatbuffers::Vector> *enums) { ++ ForAllEnums(enums, [&](const r::Enum *enum_def) { ++ std::string code; ++ ++ StartCodeBlock(enum_def); ++ ++ std::string ns; ++ const std::string enum_name = ++ NormalizeName(Denamespace(enum_def->name(), ns)); ++ ++ GenerateDocumentation(enum_def->documentation(), "", code); ++ code += "local " + enum_name + " = {\n"; ++ ++ ForAllEnumValues(enum_def, [&](const reflection::EnumVal *enum_val) { ++ GenerateDocumentation(enum_val->documentation(), " ", code); ++ code += " " + NormalizeName(enum_val->name()) + " = " + ++ NumToString(enum_val->value()) + ",\n"; ++ }); ++ code += "}\n"; ++ code += "\n"; ++ ++ EmitCodeBlock(code, enum_name, ns, enum_def->declaration_file()->str()); ++ }); ++ return true; ++ } ++ ++ bool GenerateObjects( ++ const flatbuffers::Vector> *objects, ++ const r::Object *root_object) { ++ ForAllObjects(objects, [&](const r::Object *object) { ++ std::string code; ++ ++ StartCodeBlock(object); ++ ++ // Register the main flatbuffers module. ++ RegisterRequires("flatbuffers", "flatbuffers"); ++ ++ std::string ns; ++ const std::string object_name = ++ NormalizeName(Denamespace(object->name(), ns)); ++ ++ GenerateDocumentation(object->documentation(), "", code); ++ ++ code += "local " + object_name + " = {}\n"; ++ code += "local mt = {}\n"; ++ code += "\n"; ++ code += "function " + object_name + ".New()\n"; ++ code += " local o = {}\n"; ++ code += " setmetatable(o, {__index = mt})\n"; ++ code += " return o\n"; ++ code += "end\n"; ++ code += "\n"; ++ ++ if (object == root_object) { ++ code += "function " + object_name + ".GetRootAs" + object_name + ++ "(buf, offset)\n"; ++ code += " if type(buf) == \"string\" then\n"; ++ code += " buf = flatbuffers.binaryArray.New(buf)\n"; ++ code += " end\n"; ++ code += "\n"; ++ code += " local n = flatbuffers.N.UOffsetT:Unpack(buf, offset)\n"; ++ code += " local o = " + object_name + ".New()\n"; ++ code += " o:Init(buf, n + offset)\n"; ++ code += " return o\n"; ++ code += "end\n"; ++ code += "\n"; ++ } ++ ++ // Generates a init method that receives a pre-existing accessor object, ++ // so that objects can be reused. ++ ++ code += "function mt:Init(buf, pos)\n"; ++ code += " self.view = flatbuffers.view.New(buf, pos)\n"; ++ code += "end\n"; ++ code += "\n"; ++ ++ // Create all the field accessors. ++ ForAllFields(object, /*reverse=*/false, [&](const r::Field *field) { ++ // Skip writing deprecated fields altogether. ++ if (field->deprecated()) { return; } ++ ++ const std::string field_name = NormalizeName(field->name()); ++ const std::string field_name_camel_case = MakeCamelCase(field_name); ++ const r::BaseType base_type = field->type()->base_type(); ++ ++ // Generate some fixed strings so we don't repeat outselves later. ++ const std::string getter_signature = ++ "function mt:" + field_name_camel_case + "()\n"; ++ const std::string offset_prefix = "local o = self.view:Offset(" + ++ NumToString(field->offset()) + ")\n"; ++ const std::string offset_prefix_2 = "if o ~= 0 then\n"; ++ ++ GenerateDocumentation(field->documentation(), "", code); ++ ++ if (IsScalar(base_type)) { ++ code += getter_signature; ++ ++ if (object->is_struct()) { ++ // TODO(derekbailey): it would be nice to modify the view:Get to ++ // just pass in the offset and not have to add it its own ++ // self.view.pos. ++ code += " return " + GenerateGetter(field->type()) + ++ "self.view.pos + " + NumToString(field->offset()) + ")\n"; ++ } else { ++ // Table accessors ++ code += " " + offset_prefix; ++ code += " " + offset_prefix_2; ++ ++ std::string getter = ++ GenerateGetter(field->type()) + "self.view.pos + o)"; ++ if (IsBool(base_type)) { getter = "(" + getter + " ~=0)"; } ++ code += " return " + getter + "\n"; ++ code += " end\n"; ++ code += " return " + DefaultValue(field) + "\n"; ++ } ++ code += "end\n"; ++ code += "\n"; ++ } else { ++ switch (base_type) { ++ case r::String: { ++ code += getter_signature; ++ code += " " + offset_prefix; ++ code += " " + offset_prefix_2; ++ code += " return " + GenerateGetter(field->type()) + ++ "self.view.pos + o)\n"; ++ code += " end\n"; ++ code += "end\n"; ++ code += "\n"; ++ break; ++ } ++ case r::Obj: { ++ if (object->is_struct()) { ++ code += "function mt:" + field_name_camel_case + "(obj)\n"; ++ code += " obj:Init(self.view.bytes, self.view.pos + " + ++ NumToString(field->offset()) + ")\n"; ++ code += " return obj\n"; ++ code += "end\n"; ++ code += "\n"; ++ } else { ++ code += getter_signature; ++ code += " " + offset_prefix; ++ code += " " + offset_prefix_2; ++ ++ const r::Object *field_object = GetObject(field->type()); ++ if (!field_object) { ++ // TODO(derekbailey): this is an error condition. we ++ // should report it better. ++ return; ++ } ++ code += " local x = " + ++ std::string( ++ field_object->is_struct() ++ ? "self.view.pos + o\n" ++ : "self.view:Indirect(self.view.pos + o)\n"); ++ const std::string require_name = RegisterRequires(field); ++ code += " local obj = " + require_name + ".New()\n"; ++ code += " obj:Init(self.view.bytes, x)\n"; ++ code += " return obj\n"; ++ code += " end\n"; ++ code += "end\n"; ++ code += "\n"; ++ } ++ break; ++ } ++ case r::Union: { ++ code += getter_signature; ++ code += " " + offset_prefix; ++ code += " " + offset_prefix_2; ++ code += ++ " local obj = " ++ "flatbuffers.view.New(flatbuffers.binaryArray.New(" ++ "0), 0)\n"; ++ code += " " + GenerateGetter(field->type()) + "obj, o)\n"; ++ code += " return obj\n"; ++ code += " end\n"; ++ code += "end\n"; ++ code += "\n"; ++ break; ++ } ++ case r::Array: ++ case r::Vector: { ++ const r::BaseType vector_base_type = field->type()->element(); ++ int32_t element_size = field->type()->element_size(); ++ code += "function mt:" + field_name_camel_case + "(j)\n"; ++ code += " " + offset_prefix; ++ code += " " + offset_prefix_2; ++ ++ if (IsStructOrTable(vector_base_type)) { ++ code += " local x = self.view:Vector(o)\n"; ++ code += ++ " x = x + ((j-1) * " + NumToString(element_size) + ")\n"; ++ if (IsTable(field->type(), /*use_element=*/true)) { ++ code += " x = self.view:Indirect(x)\n"; ++ } else { ++ // Vector of structs are inline, so we need to query the ++ // size of the struct. ++ const reflection::Object *obj = ++ GetObjectByIndex(field->type()->index()); ++ element_size = obj->bytesize(); ++ } ++ ++ // Include the referenced type, thus we need to make sure ++ // we set `use_element` to true. ++ const std::string require_name = ++ RegisterRequires(field, /*use_element=*/true); ++ code += " local obj = " + require_name + ".New()\n"; ++ code += " obj:Init(self.view.bytes, x)\n"; ++ code += " return obj\n"; ++ } else { ++ code += " local a = self.view:Vector(o)\n"; ++ code += " return " + GenerateGetter(field->type()) + ++ "a + ((j-1) * " + NumToString(element_size) + "))\n"; ++ } ++ code += " end\n"; ++ // Only generate a default value for those types that are ++ // supported. ++ if (!IsStructOrTable(vector_base_type)) { ++ code += ++ " return " + ++ std::string(vector_base_type == r::String ? "''\n" : "0\n"); ++ } ++ code += "end\n"; ++ code += "\n"; ++ ++ // If the vector is composed of single byte values, we ++ // generate a helper function to get it as a byte string in ++ // Lua. ++ if (IsSingleByte(vector_base_type)) { ++ code += "function mt:" + field_name_camel_case + ++ "AsString(start, stop)\n"; ++ code += " return self.view:VectorAsString(" + ++ NumToString(field->offset()) + ", start, stop)\n"; ++ code += "end\n"; ++ code += "\n"; ++ } ++ ++ // We also make a new accessor to query just the length of the ++ // vector. ++ code += "function mt:" + field_name_camel_case + "Length()\n"; ++ code += " " + offset_prefix; ++ code += " " + offset_prefix_2; ++ code += " return self.view:VectorLen(o)\n"; ++ code += " end\n"; ++ code += " return 0\n"; ++ code += "end\n"; ++ code += "\n"; ++ break; ++ } ++ default: { ++ return; ++ } ++ } ++ } ++ return; ++ }); ++ ++ // Create all the builders ++ if (object->is_struct()) { ++ code += "function " + object_name + ".Create" + object_name + ++ "(builder" + GenerateStructBuilderArgs(object) + ")\n"; ++ code += AppendStructBuilderBody(object); ++ code += " return builder:Offset()\n"; ++ code += "end\n"; ++ code += "\n"; ++ } else { ++ // Table builders ++ code += "function " + object_name + ".Start(builder)\n"; ++ code += " builder:StartObject(" + ++ NumToString(object->fields()->size()) + ")\n"; ++ code += "end\n"; ++ code += "\n"; ++ ++ ForAllFields(object, /*reverse=*/false, [&](const r::Field *field) { ++ if (field->deprecated()) { return; } ++ ++ const std::string field_name = NormalizeName(field->name()); ++ ++ code += "function " + object_name + ".Add" + ++ MakeCamelCase(field_name) + "(builder, " + ++ MakeCamelCase(field_name, false) + ")\n"; ++ code += " builder:Prepend" + GenerateMethod(field) + "Slot(" + ++ NumToString(field->id()) + ", " + ++ MakeCamelCase(field_name, false) + ", " + ++ DefaultValue(field) + ")\n"; ++ code += "end\n"; ++ code += "\n"; ++ ++ if (IsVector(field->type()->base_type())) { ++ code += "function " + object_name + ".Start" + ++ MakeCamelCase(field_name) + "Vector(builder, numElems)\n"; ++ ++ const int32_t element_size = field->type()->element_size(); ++ int32_t alignment = 0; ++ if (IsStruct(field->type(), /*use_element=*/true)) { ++ alignment = GetObjectByIndex(field->type()->index())->minalign(); ++ } else { ++ alignment = element_size; ++ } ++ ++ code += " return builder:StartVector(" + ++ NumToString(element_size) + ", numElems, " + ++ NumToString(alignment) + ")\n"; ++ code += "end\n"; ++ code += "\n"; ++ } ++ }); ++ ++ code += "function " + object_name + ".End(builder)\n"; ++ code += " return builder:EndObject()\n"; ++ code += "end\n"; ++ code += "\n"; ++ } ++ ++ EmitCodeBlock(code, object_name, ns, object->declaration_file()->str()); ++ }); ++ return true; ++ } ++ ++ private: ++ void GenerateDocumentation( ++ const flatbuffers::Vector> ++ *documentation, ++ std::string indent, std::string &code) const { ++ flatbuffers::ForAllDocumentation( ++ documentation, [&](const flatbuffers::String *str) { ++ code += indent + "--" + str->str() + "\n"; ++ }); ++ } ++ ++ std::string GenerateStructBuilderArgs(const r::Object *object, ++ std::string prefix = "") const { ++ std::string signature; ++ ForAllFields(object, /*reverse=*/false, [&](const r::Field *field) { ++ if (IsStructOrTable(field->type()->base_type())) { ++ const r::Object *field_object = GetObject(field->type()); ++ signature += GenerateStructBuilderArgs( ++ field_object, prefix + NormalizeName(field->name()) + "_"); ++ } else { ++ signature += ++ ", " + prefix + MakeCamelCase(NormalizeName(field->name()), false); ++ } ++ }); ++ return signature; ++ } ++ ++ std::string AppendStructBuilderBody(const r::Object *object, ++ std::string prefix = "") const { ++ std::string code; ++ code += " builder:Prep(" + NumToString(object->minalign()) + ", " + ++ NumToString(object->bytesize()) + ")\n"; ++ ++ // We need to reverse the order we iterate over, since we build the ++ // buffer backwards. ++ ForAllFields(object, /*reverse=*/true, [&](const r::Field *field) { ++ const int32_t num_padding_bytes = field->padding(); ++ if (num_padding_bytes) { ++ code += " builder:Pad(" + NumToString(num_padding_bytes) + ")\n"; ++ } ++ if (IsStructOrTable(field->type()->base_type())) { ++ const r::Object *field_object = GetObject(field->type()); ++ code += AppendStructBuilderBody( ++ field_object, prefix + NormalizeName(field->name()) + "_"); ++ } else { ++ code += " builder:Prepend" + GenerateMethod(field) + "(" + prefix + ++ MakeCamelCase(NormalizeName(field->name()), false) + ")\n"; ++ } ++ }); ++ ++ return code; ++ } ++ ++ std::string GenerateMethod(const r::Field *field) const { ++ const r::BaseType base_type = field->type()->base_type(); ++ if (IsScalar(base_type)) { return MakeCamelCase(GenerateType(base_type)); } ++ if (IsStructOrTable(base_type)) { return "Struct"; } ++ return "UOffsetTRelative"; ++ } ++ ++ std::string GenerateGetter(const r::Type *type, ++ bool element_type = false) const { ++ switch (element_type ? type->element() : type->base_type()) { ++ case r::String: return "self.view:String("; ++ case r::Union: return "self.view:Union("; ++ case r::Vector: return GenerateGetter(type, true); ++ default: ++ return "self.view:Get(flatbuffers.N." + ++ MakeCamelCase(GenerateType(type, element_type)) + ", "; ++ } ++ } ++ ++ std::string GenerateType(const r::Type *type, ++ bool element_type = false) const { ++ const r::BaseType base_type = ++ element_type ? type->element() : type->base_type(); ++ if (IsScalar(base_type)) { return GenerateType(base_type); } ++ switch (base_type) { ++ case r::String: return "string"; ++ case r::Vector: return GenerateGetter(type, true); ++ case r::Obj: { ++ const r::Object *obj = GetObject(type); ++ return NormalizeName(Denamespace(obj->name())); ++ }; ++ default: return "*flatbuffers.Table"; ++ } ++ } ++ ++ std::string GenerateType(const r::BaseType base_type) const { ++ // Need to override the default naming to match the Lua runtime libraries. ++ // TODO(derekbailey): make overloads in the runtime libraries to avoid this. ++ switch (base_type) { ++ case r::None: return "uint8"; ++ case r::UType: return "uint8"; ++ case r::Byte: return "int8"; ++ case r::UByte: return "uint8"; ++ case r::Short: return "int16"; ++ case r::UShort: return "uint16"; ++ case r::Int: return "int32"; ++ case r::UInt: return "uint32"; ++ case r::Long: return "int64"; ++ case r::ULong: return "uint64"; ++ case r::Float: return "Float32"; ++ case r::Double: return "Float64"; ++ default: return r::EnumNameBaseType(base_type); ++ } ++ } ++ ++ std::string DefaultValue(const r::Field *field) const { ++ const r::BaseType base_type = field->type()->base_type(); ++ if (IsFloatingPoint(base_type)) { ++ return NumToString(field->default_real()); ++ } ++ if (IsBool(base_type)) { ++ return field->default_integer() ? "true" : "false"; ++ } ++ if (IsScalar(base_type)) { return NumToString((field->default_integer())); } ++ // represents offsets ++ return "0"; ++ } ++ ++ std::string NormalizeName(const std::string name) const { ++ return keywords_.find(name) == keywords_.end() ? name : "_" + name; ++ } ++ ++ std::string NormalizeName(const flatbuffers::String *name) const { ++ return NormalizeName(name->str()); ++ } ++ ++ void StartCodeBlock(const reflection::Enum *enum_def) { ++ current_enum_ = enum_def; ++ current_obj_ = nullptr; ++ requires_.clear(); ++ } ++ ++ void StartCodeBlock(const reflection::Object *object) { ++ current_obj_ = object; ++ current_enum_ = nullptr; ++ requires_.clear(); ++ } ++ ++ std::string RegisterRequires(const r::Field *field, ++ bool use_element = false) { ++ std::string type_name; ++ ++ const r::BaseType type = ++ use_element ? field->type()->element() : field->type()->base_type(); ++ ++ if (IsStructOrTable(type)) { ++ const r::Object *object = GetObjectByIndex(field->type()->index()); ++ if (object == current_obj_) { return Denamespace(object->name()); } ++ type_name = object->name()->str(); ++ } else { ++ const r::Enum *enum_def = GetEnumByIndex(field->type()->index()); ++ if (enum_def == current_enum_) { return Denamespace(enum_def->name()); } ++ type_name = enum_def->name()->str(); ++ } ++ ++ // Prefix with double __ to avoid name clashing, since these are defined ++ // at the top of the file and have lexical scoping. Replace '.' with '_' ++ // so it can be a legal identifier. ++ std::string name = "__" + type_name; ++ std::replace(name.begin(), name.end(), '.', '_'); ++ ++ return RegisterRequires(name, type_name); ++ } ++ ++ std::string RegisterRequires(const std::string &local_name, ++ const std::string &requires_name) { ++ requires_[local_name] = requires_name; ++ return local_name; ++ } ++ ++ void EmitCodeBlock(const std::string &code_block, const std::string &name, ++ const std::string &ns, ++ const std::string &declaring_file) const { ++ const std::string root_type = schema_->root_table()->name()->str(); ++ const std::string root_file = ++ schema_->root_table()->declaration_file()->str(); ++ const std::string full_qualified_name = ns.empty() ? name : ns + "." + name; ++ ++ std::string code = "--[[ " + full_qualified_name + "\n\n"; ++ code += ++ " Automatically generated by the FlatBuffers compiler, do not " ++ "modify.\n"; ++ code += " Or modify. I'm a message, not a cop.\n"; ++ code += "\n"; ++ code += " flatc version: " + flatc_version_ + "\n"; ++ code += "\n"; ++ code += " Declared by : " + declaring_file + "\n"; ++ code += " Rooting type : " + root_type + " (" + root_file + ")\n"; ++ code += "\n--]]\n\n"; ++ ++ if (!requires_.empty()) { ++ for (auto it = requires_.cbegin(); it != requires_.cend(); ++it) { ++ code += "local " + it->first + " = require('" + it->second + "')\n"; ++ } ++ code += "\n"; ++ } ++ ++ code += code_block; ++ code += "return " + name; ++ ++ // Namespaces are '.' deliminted, so replace it with the path separator. ++ std::string path = ns; ++ ++ if (path.empty()) { ++ path = "."; ++ } else { ++ std::replace(path.begin(), path.end(), '.', '/'); ++ } ++ ++ // TODO(derekbailey): figure out a save file without depending on util.h ++ EnsureDirExists(path); ++ const std::string file_name = path + "/" + name + ".lua"; ++ SaveFile(file_name.c_str(), code, false); ++ } ++ ++ std::unordered_set keywords_; ++ std::map requires_; ++ const r::Object *current_obj_; ++ const r::Enum *current_enum_; ++ const std::string flatc_version_; ++}; ++} // namespace ++ ++std::unique_ptr NewLuaBfbsGenerator( ++ const std::string &flatc_version) { ++ return std::unique_ptr(new LuaBfbsGenerator(flatc_version)); ++} ++ ++} // namespace flatbuffers +\ No newline at end of file +diff -urN a/src/bfbs_gen_lua.h b/src/bfbs_gen_lua.h +--- a/src/bfbs_gen_lua.h 1970-01-01 00:00:00.000000000 +0000 ++++ b/src/bfbs_gen_lua.h 2023-01-13 07:47:08.200245785 +0000 +@@ -0,0 +1,33 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++#ifndef FLATBUFFERS_BFBS_GEN_LUA_H_ ++#define FLATBUFFERS_BFBS_GEN_LUA_H_ ++ ++#include ++#include ++ ++#include "flatbuffers/bfbs_generator.h" ++ ++namespace flatbuffers { ++ ++// Constructs a new Lua Code generator. ++std::unique_ptr NewLuaBfbsGenerator( ++ const std::string &flatc_version); ++ ++} // namespace flatbuffers ++ ++#endif // FLATBUFFERS_BFBS_GEN_LUA_H_ +\ No newline at end of file +diff -urN a/src/clang-format-all.sh b/src/clang-format-all.sh +--- a/src/clang-format-all.sh 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/clang-format-all.sh 1970-01-01 00:00:00.000000000 +0000 +@@ -1,6 +0,0 @@ +-# Running it twice corrects some bugs in clang-format. +-for run in {1..2} +-do +- clang-format -i -style=file include/flatbuffers/* src/*.cpp tests/*.cpp samples/*.cpp grpc/src/compiler/schema_interface.h grpc/tests/*.cpp +-done +-git checkout include/flatbuffers/reflection_generated.h +diff -urN a/src/clang-format-git.sh b/src/clang-format-git.sh +--- a/src/clang-format-git.sh 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/clang-format-git.sh 1970-01-01 00:00:00.000000000 +0000 +@@ -1,6 +0,0 @@ +-# Running it twice corrects some bugs in clang-format. +-for run in {1..2} +-do +- git clang-format HEAD^ -- include/flatbuffers/* src/*.cpp tests/*.cpp samples/*.cpp grpc/src/compiler/schema_interface.h grpc/tests/*.cpp +-done +-git checkout include/flatbuffers/reflection_generated.h +diff -urN a/src/code_generators.cpp b/src/code_generators.cpp +--- a/src/code_generators.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/code_generators.cpp 2023-01-13 07:47:08.223245997 +0000 +@@ -60,7 +60,7 @@ + // Update the text to everything after the }}. + text = text.substr(end + 2); + } +- if (!text.empty() && string_back(text) == '\\') { ++ if (!text.empty() && text.back() == '\\') { + text.pop_back(); + ignore_ident_ = true; + stream_ << text; +@@ -314,14 +314,10 @@ + return this->NaN(static_cast(v)); + } + +-std::string JavaCSharpMakeRule(const Parser &parser, const std::string &path, ++std::string JavaCSharpMakeRule(const bool java, const Parser &parser, ++ const std::string &path, + const std::string &file_name) { +- FLATBUFFERS_ASSERT(parser.opts.lang == IDLOptions::kJava || +- parser.opts.lang == IDLOptions::kCSharp); +- +- std::string file_extension = +- (parser.opts.lang == IDLOptions::kJava) ? ".java" : ".cs"; +- ++ const std::string file_extension = java ? ".java" : ".cs"; + std::string make_rule; + + for (auto it = parser.enums_.vec.begin(); it != parser.enums_.vec.end(); +@@ -350,6 +346,15 @@ + return make_rule; + } + ++std::string JavaMakeRule(const Parser &parser, const std::string &path, ++ const std::string &file_name) { ++ return JavaCSharpMakeRule(true, parser, path, file_name); ++} ++std::string CSharpMakeRule(const Parser &parser, const std::string &path, ++ const std::string &file_name) { ++ return JavaCSharpMakeRule(false, parser, path, file_name); ++} ++ + std::string BinaryFileName(const Parser &parser, const std::string &path, + const std::string &file_name) { + auto ext = parser.file_extension_.length() ? parser.file_extension_ : "bin"; +diff -urN a/src/flatc.cpp b/src/flatc.cpp +--- a/src/flatc.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/flatc.cpp 2023-01-13 07:47:08.223245997 +0000 +@@ -17,6 +17,9 @@ + #include "flatbuffers/flatc.h" + + #include ++#include ++ ++#include "flatbuffers/util.h" + + namespace flatbuffers { + +@@ -56,127 +59,271 @@ + params_.error_fn(this, err, usage, show_exe_name); + } + ++const static FlatCOption options[] = { ++ { "o", "", "PATH", "Prefix PATH to all generated files." }, ++ { "I", "", "PATH", "Search for includes in the specified path." }, ++ { "M", "", "", "Print make rules for generated files." }, ++ { "", "version", "", "Print the version number of flatc and exit." }, ++ { "h", "help", "", "Prints this help text and exit." }, ++ { "", "string-json", "", ++ "Strict JSON: field names must be / will be quoted, no trailing commas in " ++ "tables/vectors." }, ++ { "", "allow-non-utf8", "", ++ "Pass non-UTF-8 input through parser and emit nonstandard \\x escapes in " ++ "JSON. (Default is to raise parse error on non-UTF-8 input.)" }, ++ { "", "natural-utf8", "", ++ "Output strings with UTF-8 as human-readable strings. By default, UTF-8 " ++ "characters are printed as \\uXXXX escapes." }, ++ { "", "defaults-json", "", ++ "Output fields whose value is the default when writing JSON" }, ++ { "", "unknown-json", "", ++ "Allow fields in JSON that are not defined in the schema. These fields " ++ "will be discared when generating binaries." }, ++ { "", "no-prefix", "", ++ "Don\'t prefix enum values with the enum type in C++." }, ++ { "", "scoped-enums", "", ++ "Use C++11 style scoped and strongly typed enums. Also implies " ++ "--no-prefix." }, ++ { "", "gen-inclues", "", ++ "(deprecated), this is the default behavior. If the original behavior is " ++ "required (no include statements) use --no-includes." }, ++ { "", "no-includes", "", ++ "Don\'t generate include statements for included schemas the generated " ++ "file depends on (C++ / Python)." }, ++ { "", "gen-mutable", "", ++ "Generate accessors that can mutate buffers in-place." }, ++ { "", "gen-onefile", "", ++ "Generate single output file for C#, Go, and Python." }, ++ { "", "gen-name-strings", "", ++ "Generate type name functions for C++ and Rust." }, ++ { "", "gen-object-api", "", "Generate an additional object-based API." }, ++ { "", "gen-compare", "", "Generate operator== for object-based API types." }, ++ { "", "gen-nullable", "", ++ "Add Clang _Nullable for C++ pointer. or @Nullable for Java" }, ++ { "", "java-checkerframe", "", "Add @Pure for Java." }, ++ { "", "gen-generated", "", "Add @Generated annotation for Java." }, ++ { "", "gen-jvmstatic", "", ++ "Add @JvmStatic annotation for Kotlin methods in companion object for " ++ "interop from Java to Kotlin." }, ++ { "", "gen-all", "", ++ "Generate not just code for the current schema files, but for all files it " ++ "includes as well. If the language uses a single file for output (by " ++ "default the case for C++ and JS), all code will end up in this one " ++ "file." }, ++ { "", "gen-json-emit", "", ++ "Generates encoding code which emits Flatbuffers into JSON" }, ++ { "", "cpp-include", "", "Adds an #include in generated file." }, ++ { "", "cpp-ptr-type", "T", ++ "Set object API pointer type (default std::unique_ptr)." }, ++ { "", "cpp-str-type", "T", ++ "Set object API string type (default std::string). T::c_str(), T::length() " ++ "and T::empty() must be supported. The custom type also needs to be " ++ "constructible from std::string (see the --cpp-str-flex-ctor option to " ++ "change this behavior)" }, ++ { "", "cpp-str-flex-ctor", "", ++ "Don't construct custom string types by passing std::string from " ++ "Flatbuffers, but (char* + length)." }, ++ { "", "cpp-field-case-style", "STYLE", ++ "Generate C++ fields using selected case style. Supported STYLE values: * " ++ "'unchanged' - leave unchanged (default) * 'upper' - schema snake_case " ++ "emits UpperCamel; * 'lower' - schema snake_case emits lowerCamel." }, ++ { "", "cpp-std", "CPP_STD", ++ "Generate a C++ code using features of selected C++ standard. Supported " ++ "CPP_STD values: * 'c++0x' - generate code compatible with old compilers; " ++ "'c++11' - use C++11 code generator (default); * 'c++17' - use C++17 " ++ "features in generated code (experimental)." }, ++ { "", "cpp-static-reflection", "", ++ "When using C++17, generate extra code to provide compile-time (static) " ++ "reflection of Flatbuffers types. Requires --cpp-std to be \"c++17\" or " ++ "higher." }, ++ { "", "object-prefix", "PREFIX", ++ "Customize class prefix for C++ object-based API." }, ++ { "", "object-suffix", "SUFFIX", ++ "Customize class suffix for C++ object-based API. Default Value is " ++ "\"T\"." }, ++ { "", "go-namespace", "", "Generate the overriding namespace in Golang." }, ++ { "", "go-import", "IMPORT", ++ "Generate the overriding import for flatbuffers in Golang (default is " ++ "\"github.com/google/flatbuffers/go\")." }, ++ { "", "raw-binary", "", ++ "Allow binaries without file_identifier to be read. This may crash flatc " ++ "given a mismatched schema." }, ++ { "", "size-prefixed", "", "Input binaries are size prefixed buffers." }, ++ { "", "proto", "", "Input is a .proto, translate to .fbs." }, ++ { "", "proto-namespace-suffix", "SUFFIX", ++ "Add this namespace to any flatbuffers generated from protobufs." }, ++ { "", "oneof-union", "", "Translate .proto oneofs to flatbuffer unions." }, ++ { "", "grpc", "", "Generate GRPC interfaces for the specified languages." }, ++ { "", "schema", "", "Serialize schemas instead of JSON (use with -b)." }, ++ { "", "bfbs-filenames", "PATH", ++ "Sets the root path where reflection filenames in reflection.fbs are " ++ "relative to. The 'root' is denoted with `//`. E.g. if PATH=/a/b/c " ++ "then /a/d/e.fbs will be serialized as //../d/e.fbs. (PATH defaults to the " ++ "directory of the first provided schema file." }, ++ { "", "bfbs-comments", "", "Add doc comments to the binary schema files." }, ++ { "", "bfbs-builtins", "", ++ "Add builtin attributes to the binary schema files." }, ++ { "", "bfbs-gen-embed", "", ++ "Generate code to embed the bfbs schema to the source." }, ++ { "", "conform", "FILE", ++ "Specify a schema the following schemas should be an evolution of. Gives " ++ "errors if not." }, ++ { "", "conform-includes", "PATH", ++ "Include path for the schema given with --conform PATH" }, ++ { "", "filename-suffix", "SUFFIX", ++ "The suffix appended to the generated file names (Default is " ++ "'_generated')." }, ++ { "", "filename-ext", "EXT", ++ "The extension appended to the generated file names. Default is " ++ "language-specific (e.g., '.h' for C++)" }, ++ { "", "include-prefix", "PATH", ++ "Prefix this PATH to any generated include statements." }, ++ { "", "keep-prefix", "", ++ "Keep original prefix of schema include statement." }, ++ { "", "reflect-types", "", ++ "Add minimal type reflection to code generation." }, ++ { "", "reflect-names", "", "Add minimal type/name reflection." }, ++ { "", "rust-serialize", "", ++ "Implement serde::Serialize on generated Rust types." }, ++ {"", "rust-module-root-file", "", ++ "Generate rust code in individual files with a module root file."}, ++ { "", "root-type", "T", "Select or override the default root_type." }, ++ { "", "require-explicit-ids", "", ++ "When parsing schemas, require explicit ids (id: x)." }, ++ { "", "force-defaults", "", ++ "Emit default values in binary output from JSON" }, ++ { "", "force-empty", "", ++ "When serializing from object API representation, force strings and " ++ "vectors to empty rather than null." }, ++ { "", "force-empty-vectors", "", ++ "When serializing from object API representation, force vectors to empty " ++ "rather than null." }, ++ { "", "flexbuffers", "", ++ "Used with \"binary\" and \"json\" options, it generates data using " ++ "schema-less FlexBuffers." }, ++ { "", "no-warnings", "", "Inhibit all warnings messages." }, ++ { "", "warning-as-errors", "", "Treat all warnings as errors." }, ++ { "", "cs-global-alias", "", ++ "Prepend \"global::\" to all user generated csharp classes and " ++ "structs." }, ++ { "", "cs-gen-json-serializer", "", ++ "Allows (de)serialization of JSON text in the Object API. (requires " ++ "--gen-object-api)." }, ++ { "", "json-nested-bytes", "", ++ "Allow a nested_flatbuffer field to be parsed as a vector of bytes" ++ "in JSON, which is unsafe unless checked by a verifier afterwards." }, ++}; ++ ++static void AppendTextWrappedString(std::stringstream &ss, std::string &text, ++ size_t max_col, size_t start_col) { ++ size_t max_line_length = max_col - start_col; ++ ++ if (text.length() > max_line_length) { ++ size_t ideal_break_location = text.rfind(' ', max_line_length); ++ size_t length = std::min(max_line_length, ideal_break_location); ++ ss << text.substr(0, length) << "\n"; ++ ss << std::string(start_col, ' '); ++ std::string rest_of_description = text.substr( ++ ((ideal_break_location < max_line_length || text.at(length) == ' ') ++ ? length + 1 ++ : length)); ++ AppendTextWrappedString(ss, rest_of_description, max_col, start_col); ++ } else { ++ ss << text; ++ } ++} ++ ++static void AppendOption(std::stringstream &ss, const FlatCOption &option, ++ size_t max_col, size_t min_col_for_description) { ++ size_t chars = 2; ++ ss << " "; ++ if (!option.short_opt.empty()) { ++ chars += 2 + option.short_opt.length(); ++ ss << "-" << option.short_opt; ++ if (!option.long_opt.empty()) { ++ chars++; ++ ss << ","; ++ } ++ ss << " "; ++ } ++ if (!option.long_opt.empty()) { ++ chars += 3 + option.long_opt.length(); ++ ss << "--" << option.long_opt << " "; ++ } ++ if (!option.parameter.empty()) { ++ chars += 1 + option.parameter.length(); ++ ss << option.parameter << " "; ++ } ++ size_t start_of_description = chars; ++ if (start_of_description > min_col_for_description) { ++ ss << "\n"; ++ start_of_description = min_col_for_description; ++ ss << std::string(start_of_description, ' '); ++ } else { ++ while (start_of_description < min_col_for_description) { ++ ss << " "; ++ start_of_description++; ++ } ++ } ++ if (!option.description.empty()) { ++ std::string description = option.description; ++ AppendTextWrappedString(ss, description, max_col, start_of_description); ++ } ++ ss << "\n"; ++} ++ ++static void AppendShortOption(std::stringstream &ss, ++ const FlatCOption &option) { ++ if (!option.short_opt.empty()) { ++ ss << "-" << option.short_opt; ++ if (!option.long_opt.empty()) { ss << "|"; } ++ } ++ if (!option.long_opt.empty()) { ss << "--" << option.long_opt; } ++} ++ ++std::string FlatCompiler::GetShortUsageString(const char *program_name) const { ++ std::stringstream ss; ++ ss << "Usage: " << program_name << " ["; ++ for (size_t i = 0; i < params_.num_generators; ++i) { ++ const Generator &g = params_.generators[i]; ++ AppendShortOption(ss, g.option); ++ ss << ", "; ++ } ++ for (const FlatCOption &option : options) { ++ AppendShortOption(ss, option); ++ ss << ", "; ++ } ++ ss.seekp(-2, ss.cur); ++ ss << "]... FILE... [-- FILE...]"; ++ std::string help = ss.str(); ++ std::stringstream ss_textwrap; ++ AppendTextWrappedString(ss_textwrap, help, 80, 0); ++ return ss_textwrap.str(); ++} ++ + std::string FlatCompiler::GetUsageString(const char *program_name) const { + std::stringstream ss; + ss << "Usage: " << program_name << " [OPTION]... FILE... [-- FILE...]\n"; + for (size_t i = 0; i < params_.num_generators; ++i) { + const Generator &g = params_.generators[i]; ++ AppendOption(ss, g.option, 80, 25); ++ } + +- std::stringstream full_name; +- full_name << std::setw(16) << std::left << g.generator_opt_long; +- const char *name = g.generator_opt_short ? g.generator_opt_short : " "; +- const char *help = g.generator_help; +- +- ss << " " << full_name.str() << " " << name << " " << help << ".\n"; +- } +- // clang-format off +- +- // Output width +- // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 +- ss << +- " -o PATH Prefix PATH to all generated files.\n" +- " -I PATH Search for includes in the specified path.\n" +- " -M Print make rules for generated files.\n" +- " --version Print the version number of flatc and exit.\n" +- " --strict-json Strict JSON: field names must be / will be quoted,\n" +- " no trailing commas in tables/vectors.\n" +- " --allow-non-utf8 Pass non-UTF-8 input through parser and emit nonstandard\n" +- " \\x escapes in JSON. (Default is to raise parse error on\n" +- " non-UTF-8 input.)\n" +- " --natural-utf8 Output strings with UTF-8 as human-readable strings.\n" +- " By default, UTF-8 characters are printed as \\uXXXX escapes.\n" +- " --defaults-json Output fields whose value is the default when\n" +- " writing JSON\n" +- " --unknown-json Allow fields in JSON that are not defined in the\n" +- " schema. These fields will be discared when generating\n" +- " binaries.\n" +- " --no-prefix Don\'t prefix enum values with the enum type in C++.\n" +- " --scoped-enums Use C++11 style scoped and strongly typed enums.\n" +- " also implies --no-prefix.\n" +- " --gen-includes (deprecated), this is the default behavior.\n" +- " If the original behavior is required (no include\n" +- " statements) use --no-includes.\n" +- " --no-includes Don\'t generate include statements for included\n" +- " schemas the generated file depends on (C++ / Python).\n" +- " --gen-mutable Generate accessors that can mutate buffers in-place.\n" +- " --gen-onefile Generate single output file for C# and Go.\n" +- " --gen-name-strings Generate type name functions for C++ and Rust.\n" +- " --gen-object-api Generate an additional object-based API.\n" +- " --gen-compare Generate operator== for object-based API types.\n" +- " --gen-nullable Add Clang _Nullable for C++ pointer. or @Nullable for Java\n" +- " --java-checkerframe work Add @Pure for Java.\n" +- " --gen-generated Add @Generated annotation for Java\n" +- " --gen-jvmstatic Add @JvmStatic annotation for Kotlin methods\n" +- " in companion object for interop from Java to Kotlin.\n" +- " --gen-all Generate not just code for the current schema files,\n" +- " but for all files it includes as well.\n" +- " If the language uses a single file for output (by default\n" +- " the case for C++ and JS), all code will end up in this one\n" +- " file.\n" +- " --cpp-include Adds an #include in generated file.\n" +- " --cpp-ptr-type T Set object API pointer type (default std::unique_ptr).\n" +- " --cpp-str-type T Set object API string type (default std::string).\n" +- " T::c_str(), T::length() and T::empty() must be supported.\n" +- " The custom type also needs to be constructible from std::string\n" +- " (see the --cpp-str-flex-ctor option to change this behavior).\n" +- " --cpp-str-flex-ctor Don't construct custom string types by passing std::string\n" +- " from Flatbuffers, but (char* + length).\n" +- " --cpp-std CPP_STD Generate a C++ code using features of selected C++ standard.\n" +- " Supported CPP_STD values:\n" +- " * 'c++0x' - generate code compatible with old compilers;\n" +- " * 'c++11' - use C++11 code generator (default);\n" +- " * 'c++17' - use C++17 features in generated code (experimental).\n" +- " --cpp-static-reflection When using C++17, generate extra code to provide compile-time\n" +- " (static) reflection of Flatbuffers types. Requires --cpp-std\n" +- " to be \"c++17\" or higher.\n" +- " --object-prefix Customise class prefix for C++ object-based API.\n" +- " --object-suffix Customise class suffix for C++ object-based API.\n" +- " Default value is \"T\".\n" +- " --go-namespace Generate the overriding namespace in Golang.\n" +- " --go-import Generate the overriding import for flatbuffers in Golang\n" +- " (default is \"github.com/google/flatbuffers/go\").\n" +- " --raw-binary Allow binaries without file_identifier to be read.\n" +- " This may crash flatc given a mismatched schema.\n" +- " --size-prefixed Input binaries are size prefixed buffers.\n" +- " --proto Input is a .proto, translate to .fbs.\n" +- " --proto-namespace-suffix Add this namespace to any flatbuffers generated\n" +- " SUFFIX from protobufs.\n" +- " --oneof-union Translate .proto oneofs to flatbuffer unions.\n" +- " --grpc Generate GRPC interfaces for the specified languages.\n" +- " --schema Serialize schemas instead of JSON (use with -b).\n" +- " --bfbs-comments Add doc comments to the binary schema files.\n" +- " --bfbs-builtins Add builtin attributes to the binary schema files.\n" +- " --bfbs-gen-embed Generate code to embed the bfbs schema to the source.\n" +- " --conform FILE Specify a schema the following schemas should be\n" +- " an evolution of. Gives errors if not.\n" +- " --conform-includes Include path for the schema given with --conform PATH\n" +- " --filename-suffix The suffix appended to the generated file names.\n" +- " Default is '_generated'.\n" +- " --filename-ext The extension appended to the generated file names.\n" +- " Default is language-specific (e.g., '.h' for C++)\n" +- " --include-prefix Prefix this path to any generated include statements.\n" +- " PATH\n" +- " --keep-prefix Keep original prefix of schema include statement.\n" +- " --reflect-types Add minimal type reflection to code generation.\n" +- " --reflect-names Add minimal type/name reflection.\n" +- " --root-type T Select or override the default root_type\n" +- " --require-explicit-ids When parsing schemas, require explicit ids (id: x).\n" +- " --force-defaults Emit default values in binary output from JSON\n" +- " --force-empty When serializing from object API representation,\n" +- " force strings and vectors to empty rather than null.\n" +- " --force-empty-vectors When serializing from object API representation,\n" +- " force vectors to empty rather than null.\n" +- " --flexbuffers Used with \"binary\" and \"json\" options, it generates\n" +- " data using schema-less FlexBuffers.\n" +- " --no-warnings Inhibit all warning messages.\n" +- "FILEs may be schemas (must end in .fbs), binary schemas (must end in .bfbs),\n" +- "or JSON files (conforming to preceding schema). FILEs after the -- must be\n" +- "binary flatbuffer format files.\n" +- "Output files are named using the base file name of the input,\n" +- "and written to the current directory or the path given by -o.\n" +- "example: " << program_name << " -c -b schema1.fbs schema2.fbs data.json\n"; +- // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 +- // clang-format on ++ ss << "\n"; ++ for (const FlatCOption &option : options) { ++ AppendOption(ss, option, 80, 25); ++ } ++ ss << "\n"; ++ ++ std::string files_description = ++ "FILEs may be schemas (must end in .fbs), binary schemas (must end in " ++ ".bfbs) or JSON files (conforming to preceding schema). FILEs after the " ++ "-- must be binary flatbuffer format files. Output files are named using " ++ "the base file name of the input, and written to the current directory " ++ "or the path given by -o. example: " + ++ std::string(program_name) + " -c -b schema1.fbs schema2.fbs data.json"; ++ AppendTextWrappedString(ss, files_description, 80, 0); ++ ss << "\n"; + return ss.str(); + } + +@@ -185,6 +332,8 @@ + return 0; + } + ++ if (argc <= 1) { Error("Need to provide at least one argument."); } ++ + flatbuffers::IDLOptions opts; + std::string output_path; + +@@ -193,6 +342,7 @@ + bool raw_binary = false; + bool schema_binary = false; + bool grpc_enabled = false; ++ bool requires_bfbs = false; + std::vector filenames; + std::list include_directories_storage; + std::vector include_directories; +@@ -201,7 +351,9 @@ + size_t binary_files_from = std::numeric_limits::max(); + std::string conform_to_schema; + +- for (int argi = 0; argi < argc; argi++) { ++ const char *program_name = argv[0]; ++ ++ for (int argi = 1; argi < argc; argi++) { + std::string arg = argv[argi]; + if (arg[0] == '-') { + if (filenames.size() && arg[1] != '-') +@@ -216,6 +368,11 @@ + flatbuffers::PosixPath(argv[argi])); + include_directories.push_back( + include_directories_storage.back().c_str()); ++ } else if (arg == "--bfbs-filenames") { ++ if (++argi > argc) Error("missing path following: " + arg, true); ++ opts.project_root = argv[argi]; ++ if (!DirExists(opts.project_root.c_str())) ++ Error(arg + " is not a directory: " + opts.project_root); + } else if (arg == "--conform") { + if (++argi >= argc) Error("missing path following: " + arg, true); + conform_to_schema = flatbuffers::PosixPath(argv[argi]); +@@ -275,12 +432,25 @@ + opts.cpp_object_api_string_flexible_constructor = true; + } else if (arg == "--no-cpp-direct-copy") { + opts.cpp_direct_copy = false; ++ } else if (arg == "--cpp-field-case-style") { ++ if (++argi >= argc) Error("missing case style following: " + arg, true); ++ if (!strcmp(argv[argi], "unchanged")) ++ opts.cpp_object_api_field_case_style = ++ IDLOptions::CaseStyle_Unchanged; ++ else if (!strcmp(argv[argi], "upper")) ++ opts.cpp_object_api_field_case_style = IDLOptions::CaseStyle_Upper; ++ else if (!strcmp(argv[argi], "lower")) ++ opts.cpp_object_api_field_case_style = IDLOptions::CaseStyle_Lower; ++ else ++ Error("unknown case style: " + std::string(argv[argi]), true); + } else if (arg == "--gen-nullable") { + opts.gen_nullable = true; + } else if (arg == "--java-checkerframework") { + opts.java_checkerframework = true; + } else if (arg == "--gen-generated") { + opts.gen_generated = true; ++ } else if (arg == "--gen-json-emit") { ++ opts.gen_json_coders = true; + } else if (arg == "--object-prefix") { + if (++argi >= argc) Error("missing prefix following: " + arg, true); + opts.object_prefix = argv[argi]; +@@ -297,6 +467,7 @@ + opts.include_dependence_headers = false; + } else if (arg == "--gen-onefile") { + opts.one_file = true; ++ opts.include_dependence_headers = false; + } else if (arg == "--raw-binary") { + raw_binary = true; + } else if (arg == "--size-prefixed") { +@@ -317,6 +488,9 @@ + } else if (arg == "--version") { + printf("flatc version %s\n", FLATC_VERSION()); + exit(0); ++ } else if (arg == "--help" || arg == "-h") { ++ printf("%s\n", GetUsageString(program_name).c_str()); ++ exit(0); + } else if (arg == "--grpc") { + grpc_enabled = true; + } else if (arg == "--bfbs-comments") { +@@ -329,6 +503,10 @@ + opts.mini_reflect = IDLOptions::kTypes; + } else if (arg == "--reflect-names") { + opts.mini_reflect = IDLOptions::kTypesAndNames; ++ } else if (arg == "--rust-serialize") { ++ opts.rust_serialize = true; ++ } else if (arg == "--rust-module-root-file") { ++ opts.rust_module_root_file = true; + } else if (arg == "--require-explicit-ids") { + opts.require_explicit_ids = true; + } else if (arg == "--root-type") { +@@ -357,6 +535,8 @@ + opts.gen_jvmstatic = true; + } else if (arg == "--no-warnings") { + opts.no_warnings = true; ++ } else if (arg == "--warnings-as-errors") { ++ opts.warnings_as_errors = true; + } else if (arg == "--cpp-std") { + if (++argi >= argc) + Error("missing C++ standard specification" + arg, true); +@@ -365,18 +545,26 @@ + opts.cpp_std = arg.substr(std::string("--cpp-std=").size()); + } else if (arg == "--cpp-static-reflection") { + opts.cpp_static_reflection = true; ++ } else if (arg == "--cs-global-alias") { ++ opts.cs_global_alias = true; ++ } else if (arg == "--json-nested-bytes") { ++ opts.json_nested_legacy_flatbuffers = true; + } else { + for (size_t i = 0; i < params_.num_generators; ++i) { +- if (arg == params_.generators[i].generator_opt_long || +- (params_.generators[i].generator_opt_short && +- arg == params_.generators[i].generator_opt_short)) { ++ if (arg == "--" + params_.generators[i].option.long_opt || ++ arg == "-" + params_.generators[i].option.short_opt) { + generator_enabled[i] = true; + any_generator = true; + opts.lang_to_generate |= params_.generators[i].lang; ++ if (params_.generators[i].bfbs_generator) { ++ opts.binary_schema_comments = true; ++ requires_bfbs = true; ++ } + goto found; + } + } + Error("unknown commandline argument: " + arg, true); ++ + found:; + } + } else { +@@ -393,6 +581,12 @@ + Error("no options: specify at least one generator.", true); + } + ++ if (opts.cs_gen_json_serializer && !opts.generate_object_based_api) { ++ Error( ++ "--cs-gen-json-serializer requires --gen-object-api to be set as " ++ "well."); ++ } ++ + flatbuffers::Parser conform_parser; + if (!conform_to_schema.empty()) { + std::string contents; +@@ -420,8 +614,11 @@ + bool is_binary = + static_cast(file_it - filenames.begin()) >= binary_files_from; + auto ext = flatbuffers::GetExtension(filename); +- auto is_schema = ext == "fbs" || ext == "proto"; +- auto is_binary_schema = ext == reflection::SchemaExtension(); ++ const bool is_schema = ext == "fbs" || ext == "proto"; ++ if (is_schema && opts.project_root.empty()) { ++ opts.project_root = StripFileName(filename); ++ } ++ const bool is_binary_schema = ext == reflection::SchemaExtension(); + if (is_binary) { + parser->builder_.Clear(); + parser->builder_.PushFlatBuffer( +@@ -453,20 +650,24 @@ + contents.length() != strlen(contents.c_str())) { + Error("input file appears to be binary: " + filename, true); + } +- if (is_schema) { ++ if (is_schema || is_binary_schema) { + // If we're processing multiple schemas, make sure to start each + // one from scratch. If it depends on previous schemas it must do + // so explicitly using an include. + parser.reset(new flatbuffers::Parser(opts)); + } ++ // Try to parse the file contents (binary schema/flexbuffer/textual ++ // schema) + if (is_binary_schema) { + LoadBinarySchema(*parser.get(), filename, contents); +- } +- if (opts.use_flexbuffers) { ++ } else if (opts.use_flexbuffers) { + if (opts.lang_to_generate == IDLOptions::kJson) { +- parser->flex_root_ = flexbuffers::GetRoot( +- reinterpret_cast(contents.c_str()), +- contents.size()); ++ auto data = reinterpret_cast(contents.c_str()); ++ auto size = contents.size(); ++ std::vector reuse_tracker; ++ if (!flexbuffers::VerifyBuffer(data, size, &reuse_tracker)) ++ Error("flexbuffers file failed to verify: " + filename, false); ++ parser->flex_root_ = flexbuffers::GetRoot(data, size); + } else { + parser->flex_builder_.Clear(); + ParseFile(*parser.get(), filename, contents, include_directories); +@@ -483,7 +684,7 @@ + } + if ((is_schema || is_binary_schema) && !conform_to_schema.empty()) { + auto err = parser->ConformTo(conform_parser); +- if (!err.empty()) Error("schemas don\'t conform: " + err); ++ if (!err.empty()) Error("schemas don\'t conform: " + err, false); + } + if (schema_binary || opts.binary_schema_gen_embed) { + parser->Serialize(); +@@ -492,21 +693,42 @@ + parser->file_extension_ = reflection::SchemaExtension(); + } + } +- + std::string filebase = + flatbuffers::StripPath(flatbuffers::StripExtension(filename)); + ++ // If one of the generators uses bfbs, serialize the parser and get ++ // the serialized buffer and length. ++ const uint8_t *bfbs_buffer = nullptr; ++ int64_t bfbs_length = 0; ++ if (requires_bfbs) { ++ parser->Serialize(); ++ bfbs_buffer = parser->builder_.GetBufferPointer(); ++ bfbs_length = parser->builder_.GetSize(); ++ } ++ + for (size_t i = 0; i < params_.num_generators; ++i) { +- parser->opts.lang = params_.generators[i].lang; + if (generator_enabled[i]) { + if (!print_make_rules) { + flatbuffers::EnsureDirExists(output_path); +- if ((!params_.generators[i].schema_only || +- (is_schema || is_binary_schema)) && +- !params_.generators[i].generate(*parser.get(), output_path, +- filebase)) { +- Error(std::string("Unable to generate ") + +- params_.generators[i].lang_name + " for " + filebase); ++ ++ // Prefer bfbs generators if present. ++ if (params_.generators[i].bfbs_generator) { ++ const GeneratorStatus status = ++ params_.generators[i].bfbs_generator->Generate(bfbs_buffer, ++ bfbs_length); ++ if (status != OK) { ++ Error(std::string("Unable to generate ") + ++ params_.generators[i].lang_name + " for " + filebase + ++ " using bfbs generator."); ++ } ++ } else { ++ if ((!params_.generators[i].schema_only || ++ (is_schema || is_binary_schema)) && ++ !params_.generators[i].generate(*parser.get(), output_path, ++ filebase)) { ++ Error(std::string("Unable to generate ") + ++ params_.generators[i].lang_name + " for " + filebase); ++ } + } + } else { + if (params_.generators[i].make_rule == nullptr) { +@@ -548,6 +770,19 @@ + // in any files coming up next. + parser->MarkGenerated(); + } ++ ++ // Once all the files have been parsed, run any generators Parsing Completed ++ // function for final generation. ++ for (size_t i = 0; i < params_.num_generators; ++i) { ++ if (generator_enabled[i] && ++ params_.generators[i].parsing_completed != nullptr) { ++ if (!params_.generators[i].parsing_completed(*parser, output_path)) { ++ Error("failed running parsing completed for " + ++ std::string(params_.generators[i].lang_name)); ++ } ++ } ++ } ++ + return 0; + } + +diff -urN a/src/flatc_main.cpp b/src/flatc_main.cpp +--- a/src/flatc_main.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/flatc_main.cpp 2023-01-13 07:47:08.249246239 +0000 +@@ -14,6 +14,11 @@ + * limitations under the License. + */ + ++#include ++#include ++ ++#include "bfbs_gen_lua.h" ++#include "flatbuffers/base.h" + #include "flatbuffers/flatc.h" + #include "flatbuffers/util.h" + +@@ -23,16 +28,16 @@ + const std::string &warn, bool show_exe_name) { + (void)flatc; + if (show_exe_name) { printf("%s: ", g_program_name); } +- printf("warning: %s\n", warn.c_str()); ++ fprintf(stderr, "\nwarning:\n %s\n\n", warn.c_str()); + } + + static void Error(const flatbuffers::FlatCompiler *flatc, + const std::string &err, bool usage, bool show_exe_name) { + if (show_exe_name) { printf("%s: ", g_program_name); } +- printf("error: %s\n", err.c_str()); + if (usage && flatc) { +- printf("%s", flatc->GetUsageString(g_program_name).c_str()); ++ fprintf(stderr, "%s\n", flatc->GetShortUsageString(g_program_name).c_str()); + } ++ fprintf(stderr, "\nerror:\n %s\n\n", err.c_str()); + exit(1); + } + +@@ -50,61 +55,96 @@ + // Prevent Appveyor-CI hangs. + flatbuffers::SetupDefaultCRTReportMode(); + ++ const std::string flatbuffers_version(flatbuffers::FLATBUFFERS_VERSION()); ++ ++ std::unique_ptr bfbs_gen_lua = ++ flatbuffers::NewLuaBfbsGenerator(flatbuffers_version); ++ + g_program_name = argv[0]; + + const flatbuffers::FlatCompiler::Generator generators[] = { +- { flatbuffers::GenerateBinary, "-b", "--binary", "binary", false, nullptr, ++ { flatbuffers::GenerateBinary, "binary", false, nullptr, + flatbuffers::IDLOptions::kBinary, +- "Generate wire format binaries for any data definitions", +- flatbuffers::BinaryMakeRule }, +- { flatbuffers::GenerateTextFile, "-t", "--json", "text", false, nullptr, ++ flatbuffers::FlatCOption{ ++ "b", "binary", "", ++ "Generate wire format binaries for any data definitions" }, ++ flatbuffers::BinaryMakeRule, nullptr, nullptr }, ++ { flatbuffers::GenerateTextFile, "text", false, nullptr, + flatbuffers::IDLOptions::kJson, +- "Generate text output for any data definitions", +- flatbuffers::TextMakeRule }, +- { flatbuffers::GenerateCPP, "-c", "--cpp", "C++", true, +- flatbuffers::GenerateCppGRPC, flatbuffers::IDLOptions::kCpp, +- "Generate C++ headers for tables/structs", flatbuffers::CPPMakeRule }, +- { flatbuffers::GenerateGo, "-g", "--go", "Go", true, +- flatbuffers::GenerateGoGRPC, flatbuffers::IDLOptions::kGo, +- "Generate Go files for tables/structs", nullptr }, +- { flatbuffers::GenerateJava, "-j", "--java", "Java", true, +- flatbuffers::GenerateJavaGRPC, flatbuffers::IDLOptions::kJava, +- "Generate Java classes for tables/structs", +- flatbuffers::JavaCSharpMakeRule }, +- { flatbuffers::GenerateDart, "-d", "--dart", "Dart", true, nullptr, ++ flatbuffers::FlatCOption{ ++ "t", "json", "", "Generate text output for any data definitions" }, ++ ++ flatbuffers::TextMakeRule, nullptr, nullptr }, ++ { flatbuffers::GenerateCPP, "C++", true, flatbuffers::GenerateCppGRPC, ++ flatbuffers::IDLOptions::kCpp, ++ flatbuffers::FlatCOption{ "c", "cpp", "", ++ "Generate C++ headers for tables/structs" }, ++ flatbuffers::CPPMakeRule, nullptr, nullptr }, ++ { flatbuffers::GenerateGo, "Go", true, flatbuffers::GenerateGoGRPC, ++ flatbuffers::IDLOptions::kGo, ++ flatbuffers::FlatCOption{ "g", "go", "", ++ "Generate Go files for tables/structs" }, ++ nullptr, nullptr, nullptr }, ++ { flatbuffers::GenerateJava, "Java", true, flatbuffers::GenerateJavaGRPC, ++ flatbuffers::IDLOptions::kJava, ++ flatbuffers::FlatCOption{ "j", "java", "", ++ "Generate Java classes for tables/structs" }, ++ flatbuffers::JavaMakeRule, nullptr, nullptr }, ++ { flatbuffers::GenerateDart, "Dart", true, nullptr, + flatbuffers::IDLOptions::kDart, +- "Generate Dart classes for tables/structs", flatbuffers::DartMakeRule }, +- { flatbuffers::GenerateTS, "-T", "--ts", "TypeScript", true, +- flatbuffers::GenerateTSGRPC, flatbuffers::IDLOptions::kTs, +- "Generate TypeScript code for tables/structs", flatbuffers::TSMakeRule }, +- { flatbuffers::GenerateCSharp, "-n", "--csharp", "C#", true, nullptr, ++ flatbuffers::FlatCOption{ "d", "dart", "", ++ "Generate Dart classes for tables/structs" }, ++ flatbuffers::DartMakeRule, nullptr, nullptr }, ++ { flatbuffers::GenerateTS, "TypeScript", true, flatbuffers::GenerateTSGRPC, ++ flatbuffers::IDLOptions::kTs, ++ flatbuffers::FlatCOption{ "T", "ts", "", ++ "Generate TypeScript code for tables/structs" }, ++ flatbuffers::TSMakeRule, nullptr, nullptr }, ++ { flatbuffers::GenerateCSharp, "C#", true, nullptr, + flatbuffers::IDLOptions::kCSharp, +- "Generate C# classes for tables/structs", +- flatbuffers::JavaCSharpMakeRule }, +- { flatbuffers::GeneratePython, "-p", "--python", "Python", true, ++ flatbuffers::FlatCOption{ "n", "csharp", "", ++ "Generate C# classes for tables/structs" }, ++ flatbuffers::CSharpMakeRule, nullptr, nullptr }, ++ { flatbuffers::GeneratePython, "Python", true, + flatbuffers::GeneratePythonGRPC, flatbuffers::IDLOptions::kPython, +- "Generate Python files for tables/structs", nullptr }, +- { flatbuffers::GenerateLobster, nullptr, "--lobster", "Lobster", true, +- nullptr, flatbuffers::IDLOptions::kLobster, +- "Generate Lobster files for tables/structs", nullptr }, +- { flatbuffers::GenerateLua, "-l", "--lua", "Lua", true, nullptr, +- flatbuffers::IDLOptions::kLua, "Generate Lua files for tables/structs", +- nullptr }, +- { flatbuffers::GenerateRust, "-r", "--rust", "Rust", true, nullptr, +- flatbuffers::IDLOptions::kRust, "Generate Rust files for tables/structs", +- flatbuffers::RustMakeRule }, +- { flatbuffers::GeneratePhp, nullptr, "--php", "PHP", true, nullptr, +- flatbuffers::IDLOptions::kPhp, "Generate PHP files for tables/structs", +- nullptr }, +- { flatbuffers::GenerateKotlin, nullptr, "--kotlin", "Kotlin", true, nullptr, ++ flatbuffers::FlatCOption{ "p", "python", "", ++ "Generate Python files for tables/structs" }, ++ nullptr, nullptr, nullptr }, ++ { flatbuffers::GenerateLobster, "Lobster", true, nullptr, ++ flatbuffers::IDLOptions::kLobster, ++ flatbuffers::FlatCOption{ "", "lobster", "", ++ "Generate Lobster files for tables/structs" }, ++ nullptr, nullptr, nullptr }, ++ { flatbuffers::GenerateLua, "Lua", true, nullptr, ++ flatbuffers::IDLOptions::kLua, ++ flatbuffers::FlatCOption{ "l", "lua", "", ++ "Generate Lua files for tables/structs" }, ++ nullptr, bfbs_gen_lua.get(), nullptr }, ++ { flatbuffers::GenerateRust, "Rust", true, nullptr, ++ flatbuffers::IDLOptions::kRust, ++ flatbuffers::FlatCOption{ "r", "rust", "", ++ "Generate Rust files for tables/structs" }, ++ flatbuffers::RustMakeRule, nullptr, ++ flatbuffers::GenerateRustModuleRootFile }, ++ { flatbuffers::GeneratePhp, "PHP", true, nullptr, ++ flatbuffers::IDLOptions::kPhp, ++ flatbuffers::FlatCOption{ "", "php", "", ++ "Generate PHP files for tables/structs" }, ++ nullptr, nullptr, nullptr }, ++ { flatbuffers::GenerateKotlin, "Kotlin", true, nullptr, + flatbuffers::IDLOptions::kKotlin, +- "Generate Kotlin classes for tables/structs", nullptr }, +- { flatbuffers::GenerateJsonSchema, nullptr, "--jsonschema", "JsonSchema", +- true, nullptr, flatbuffers::IDLOptions::kJsonSchema, +- "Generate Json schema", nullptr }, +- { flatbuffers::GenerateSwift, nullptr, "--swift", "swift", true, +- flatbuffers::GenerateSwiftGRPC, flatbuffers::IDLOptions::kSwift, +- "Generate Swift files for tables/structs", nullptr }, ++ flatbuffers::FlatCOption{ "", "kotlin", "", ++ "Generate Kotlin classes for tables/structs" }, ++ nullptr, nullptr, nullptr }, ++ { flatbuffers::GenerateJsonSchema, "JsonSchema", true, nullptr, ++ flatbuffers::IDLOptions::kJsonSchema, ++ flatbuffers::FlatCOption{ "", "jsonschema", "", "Generate Json schema" }, ++ nullptr, nullptr, nullptr }, ++ { flatbuffers::GenerateSwift, "swift", true, flatbuffers::GenerateSwiftGRPC, ++ flatbuffers::IDLOptions::kSwift, ++ flatbuffers::FlatCOption{ "", "swift", "", ++ "Generate Swift files for tables/structs" }, ++ nullptr, nullptr, nullptr }, + }; + + flatbuffers::FlatCompiler::InitParams params; +@@ -114,5 +154,5 @@ + params.error_fn = Error; + + flatbuffers::FlatCompiler flatc(params); +- return flatc.Compile(argc - 1, argv + 1); ++ return flatc.Compile(argc, argv); + } +diff -urN a/src/idl_gen_cpp.cpp b/src/idl_gen_cpp.cpp +--- a/src/idl_gen_cpp.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_cpp.cpp 2023-01-13 07:47:08.250246248 +0000 +@@ -233,6 +233,30 @@ + return keywords_.find(name) == keywords_.end() ? name : name + "_"; + } + ++ std::string Name(const FieldDef &field) const { ++ // the union type field suffix is immutable. ++ static size_t union_suffix_len = strlen(UnionTypeFieldSuffix()); ++ const bool is_union_type = field.value.type.base_type == BASE_TYPE_UTYPE; ++ // early return if no case transformation required ++ if (opts_.cpp_object_api_field_case_style == ++ IDLOptions::CaseStyle_Unchanged) ++ return EscapeKeyword(field.name); ++ std::string name = field.name; ++ // do not change the case style of the union type field suffix ++ if (is_union_type) { ++ FLATBUFFERS_ASSERT(name.length() > union_suffix_len); ++ name.erase(name.length() - union_suffix_len, union_suffix_len); ++ } ++ if (opts_.cpp_object_api_field_case_style == IDLOptions::CaseStyle_Upper) ++ name = MakeCamel(name, true); /* upper */ ++ else if (opts_.cpp_object_api_field_case_style == ++ IDLOptions::CaseStyle_Lower) ++ name = MakeCamel(name, false); /* lower */ ++ // restore the union field type suffix ++ if (is_union_type) name.append(UnionTypeFieldSuffix(), union_suffix_len); ++ return EscapeKeyword(name); ++ } ++ + std::string Name(const Definition &def) const { + return EscapeKeyword(def.name); + } +@@ -259,6 +283,9 @@ + code_ += "#pragma clang system_header\n\n"; + } + ++ code_ += "#include \"flatbuffers/flatbuffers.h\""; ++ code_ += ""; ++ + SetNameSpace(struct_def.defined_namespace); + auto name = Name(struct_def); + code_.SetValue("STRUCT_NAME", name); +@@ -481,6 +508,17 @@ + code_ += " return flatbuffers::GetMutableRoot<{{STRUCT_NAME}}>(buf);"; + code_ += "}"; + code_ += ""; ++ ++ code_ += "inline \\"; ++ code_ += ++ "{{CPP_NAME}} " ++ "*{{NULLABLE_EXT}}GetMutableSizePrefixed{{STRUCT_NAME}}(void " ++ "*buf) {"; ++ code_ += ++ " return " ++ "flatbuffers::GetMutableSizePrefixedRoot<{{CPP_NAME}}>(buf);"; ++ code_ += "}"; ++ code_ += ""; + } + + if (parser_.file_identifier_.length()) { +@@ -497,6 +535,16 @@ + code_ += " buf, {{STRUCT_NAME}}Identifier());"; + code_ += "}"; + code_ += ""; ++ ++ // Check if a size-prefixed buffer has the identifier. ++ code_ += "inline \\"; ++ code_ += ++ "bool SizePrefixed{{STRUCT_NAME}}BufferHasIdentifier(const void " ++ "*buf) {"; ++ code_ += " return flatbuffers::BufferHasIdentifier("; ++ code_ += " buf, {{STRUCT_NAME}}Identifier(), true);"; ++ code_ += "}"; ++ code_ += ""; + } + + // The root verifier. +@@ -623,8 +671,9 @@ + } + + bool VectorElementUserFacing(const Type &type) const { +- return opts_.g_cpp_std >= cpp::CPP_STD_17 && opts_.g_only_fixed_enums && +- IsEnum(type); ++ return (opts_.scoped_enums && IsEnum(type)) || ++ (opts_.g_cpp_std >= cpp::CPP_STD_17 && opts_.g_only_fixed_enums && ++ IsEnum(type)); + } + + void GenComment(const std::vector &dc, const char *prefix = "") { +@@ -764,7 +813,7 @@ + } + + std::string GenTypeNative(const Type &type, bool invector, +- const FieldDef &field) { ++ const FieldDef &field, bool forcopy = false) { + switch (type.base_type) { + case BASE_TYPE_STRING: { + return NativeString(&field); +@@ -785,15 +834,14 @@ + if (IsStruct(type)) { + auto native_type = type.struct_def->attributes.Lookup("native_type"); + if (native_type) { type_name = native_type->constant; } +- if (invector || field.native_inline) { ++ if (invector || field.native_inline || forcopy) { + return type_name; + } else { + return GenTypeNativePtr(type_name, &field, false); + } + } else { +- return GenTypeNativePtr( +- WrapNativeNameInNameSpace(*type.struct_def, opts_), &field, +- false); ++ const auto nn = WrapNativeNameInNameSpace(*type.struct_def, opts_); ++ return forcopy ? nn : GenTypeNativePtr(nn, &field, false); + } + } + case BASE_TYPE_UNION: { +@@ -907,10 +955,12 @@ + } + + std::string UnionVectorVerifySignature(const EnumDef &enum_def) { +- return "bool Verify" + Name(enum_def) + "Vector" + ++ auto name = Name(enum_def); ++ auto type = opts_.scoped_enums ? name : "uint8_t"; ++ return "bool Verify" + name + "Vector" + + "(flatbuffers::Verifier &verifier, " + + "const flatbuffers::Vector> *values, " + +- "const flatbuffers::Vector *types)"; ++ "const flatbuffers::Vector<" + type + "> *types)"; + } + + std::string UnionUnPackSignature(const EnumDef &enum_def, bool inclass) { +@@ -1009,10 +1059,9 @@ + ? bt - BASE_TYPE_UTYPE + ET_UTYPE + : ET_SEQUENCE; + int ref_idx = -1; +- std::string ref_name = +- type.struct_def +- ? WrapInNameSpace(*type.struct_def) +- : type.enum_def ? WrapInNameSpace(*type.enum_def) : ""; ++ std::string ref_name = type.struct_def ? WrapInNameSpace(*type.struct_def) ++ : type.enum_def ? WrapInNameSpace(*type.enum_def) ++ : ""; + if (!ref_name.empty()) { + auto rit = type_refs.begin(); + for (; rit != type_refs.end(); ++rit) { +@@ -1276,11 +1325,30 @@ + } + + if (opts_.generate_object_based_api && enum_def.is_union) { +- // Generate a union type ++ // Generate a union type and a trait type for it. + code_.SetValue("NAME", Name(enum_def)); + FLATBUFFERS_ASSERT(enum_def.Lookup("NONE")); + code_.SetValue("NONE", GetEnumValUse(enum_def, *enum_def.Lookup("NONE"))); + ++ if (!enum_def.uses_multiple_type_instances) { ++ for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); ++ ++it) { ++ const auto &ev = **it; ++ ++ if (it == enum_def.Vals().begin()) { ++ code_ += "template struct {{NAME}}UnionTraits {"; ++ } else { ++ auto name = GetUnionElement(ev, true, opts_); ++ code_ += "template<> struct {{NAME}}UnionTraits<" + name + "> {"; ++ } ++ ++ auto value = GetEnumValUse(enum_def, ev); ++ code_ += " static const {{ENUM_NAME}} enum_value = " + value + ";"; ++ code_ += "};"; ++ code_ += ""; ++ } ++ } ++ + code_ += "struct {{NAME}}Union {"; + code_ += " {{NAME}} type;"; + code_ += " void *value;"; +@@ -1304,18 +1372,15 @@ + code_ += " void Reset();"; + code_ += ""; + if (!enum_def.uses_multiple_type_instances) { +- code_ += "#ifndef FLATBUFFERS_CPP98_STL"; + code_ += " template "; + code_ += " void Set(T&& val) {"; +- code_ += " using RT = typename std::remove_reference::type;"; ++ code_ += " typedef typename std::remove_reference::type RT;"; + code_ += " Reset();"; +- code_ += +- " type = {{NAME}}Traits::enum_value;"; ++ code_ += " type = {{NAME}}UnionTraits::enum_value;"; + code_ += " if (type != {{NONE}}) {"; + code_ += " value = new RT(std::forward(val));"; + code_ += " }"; + code_ += " }"; +- code_ += "#endif // FLATBUFFERS_CPP98_STL"; + code_ += ""; + } + code_ += " " + UnionUnPackSignature(enum_def, true) + ";"; +@@ -1419,9 +1484,11 @@ + " auto ptr = reinterpret_cast(obj);"; + if (ev.union_type.base_type == BASE_TYPE_STRUCT) { + if (ev.union_type.struct_def->fixed) { ++ code_.SetValue("ALIGN", ++ NumToString(ev.union_type.struct_def->minalign)); + code_ += +- " return verifier.Verify<{{TYPE}}>(static_cast(obj), 0);"; ++ " return verifier.VerifyField<{{TYPE}}>(" ++ "static_cast(obj), 0, {{ALIGN}});"; + } else { + code_ += getptr; + code_ += " return verifier.VerifyTable(ptr);"; +@@ -1461,6 +1528,7 @@ + if (opts_.generate_object_based_api) { + // Generate union Unpack() and Pack() functions. + code_ += "inline " + UnionUnPackSignature(enum_def, false) + " {"; ++ code_ += " (void)resolver;"; + code_ += " switch (type) {"; + for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); + ++it) { +@@ -1491,6 +1559,7 @@ + code_ += ""; + + code_ += "inline " + UnionPackSignature(enum_def, false) + " {"; ++ code_ += " (void)_rehasher;"; + code_ += " switch (type) {"; + for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); + ++it) { +@@ -1534,7 +1603,8 @@ + code_.SetValue("TYPE", GetUnionElement(ev, true, opts_)); + code_ += " case {{LABEL}}: {"; + bool copyable = true; +- if (ev.union_type.base_type == BASE_TYPE_STRUCT && ++ if (opts_.g_cpp_std < cpp::CPP_STD_11 && ++ ev.union_type.base_type == BASE_TYPE_STRUCT && + !ev.union_type.struct_def->fixed) { + // Don't generate code to copy if table is not copyable. + // TODO(wvo): make tables copyable instead. +@@ -1621,7 +1691,7 @@ + if (!opts_.generate_name_strings) { return; } + auto fullname = struct_def.defined_namespace->GetFullyQualifiedName(name); + code_.SetValue("NAME", fullname); +- code_.SetValue("CONSTEXPR", "FLATBUFFERS_CONSTEXPR"); ++ code_.SetValue("CONSTEXPR", "FLATBUFFERS_CONSTEXPR_CPP11"); + code_ += " static {{CONSTEXPR}} const char *GetFullyQualifiedName() {"; + code_ += " return \"{{NAME}}\";"; + code_ += " }"; +@@ -1659,6 +1729,8 @@ + } else { + return "0"; + } ++ } else if (IsStruct(type) && (field.value.constant == "0")) { ++ return "nullptr"; + } else { + return GenDefaultConstant(field); + } +@@ -1735,13 +1807,50 @@ + } + } + ++ // Returns true if `struct_def` needs a copy constructor and assignment ++ // operator because it has one or more table members, struct members with a ++ // custom cpp_type and non-naked pointer type, or vector members of those. ++ bool NeedsCopyCtorAssignOp(const StructDef &struct_def) { ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ const auto &field = **it; ++ const auto &type = field.value.type; ++ if (field.deprecated) continue; ++ if (type.base_type == BASE_TYPE_STRUCT) { ++ const auto cpp_type = field.attributes.Lookup("cpp_type"); ++ const auto cpp_ptr_type = field.attributes.Lookup("cpp_ptr_type"); ++ const bool is_ptr = !(IsStruct(type) && field.native_inline) || ++ (cpp_type && cpp_ptr_type->constant != "naked"); ++ if (is_ptr) { return true; } ++ } else if (IsVector(type)) { ++ const auto vec_type = type.VectorType(); ++ if (vec_type.base_type == BASE_TYPE_UTYPE) continue; ++ const auto cpp_type = field.attributes.Lookup("cpp_type"); ++ const auto cpp_ptr_type = field.attributes.Lookup("cpp_ptr_type"); ++ const bool is_ptr = ++ (vec_type.base_type == BASE_TYPE_STRUCT && !IsStruct(vec_type)) || ++ (cpp_type && cpp_ptr_type->constant != "naked"); ++ if (is_ptr) { return true; } ++ } ++ } ++ return false; ++ } ++ + // Generate the default constructor for this struct. Properly initialize all + // scalar members with default values. + void GenDefaultConstructor(const StructDef &struct_def) { + code_.SetValue("NATIVE_NAME", + NativeName(Name(struct_def), &struct_def, opts_)); +- // In >= C++11, default member initializers are generated. +- if (opts_.g_cpp_std >= cpp::CPP_STD_11) { return; } ++ // In >= C++11, default member initializers are generated. To allow for ++ // aggregate initialization, do not emit a default constructor at all, with ++ // the exception of types that need a copy/move ctors and assignment ++ // operators. ++ if (opts_.g_cpp_std >= cpp::CPP_STD_11) { ++ if (NeedsCopyCtorAssignOp(struct_def)) { ++ code_ += " {{NATIVE_NAME}}() = default;"; ++ } ++ return; ++ } + std::string initializer_list; + for (auto it = struct_def.fields.vec.begin(); + it != struct_def.fields.vec.end(); ++it) { +@@ -1785,6 +1894,125 @@ + code_ += " }"; + } + ++ // Generate the >= C++11 copy/move constructor and assignment operator ++ // declarations if required. Tables that are default-copyable do not get ++ // user-provided copy/move constructors and assignment operators so they ++ // remain aggregates. ++ void GenCopyMoveCtorAndAssigOpDecls(const StructDef &struct_def) { ++ if (opts_.g_cpp_std < cpp::CPP_STD_11) return; ++ if (!NeedsCopyCtorAssignOp(struct_def)) return; ++ code_.SetValue("NATIVE_NAME", ++ NativeName(Name(struct_def), &struct_def, opts_)); ++ code_ += " {{NATIVE_NAME}}(const {{NATIVE_NAME}} &o);"; ++ code_ += ++ " {{NATIVE_NAME}}({{NATIVE_NAME}}&&) FLATBUFFERS_NOEXCEPT = " ++ "default;"; ++ code_ += ++ " {{NATIVE_NAME}} &operator=({{NATIVE_NAME}} o) FLATBUFFERS_NOEXCEPT;"; ++ } ++ ++ // Generate the >= C++11 copy constructor and assignment operator definitions. ++ void GenCopyCtorAssignOpDefs(const StructDef &struct_def) { ++ if (opts_.g_cpp_std < cpp::CPP_STD_11) return; ++ if (!NeedsCopyCtorAssignOp(struct_def)) return; ++ std::string initializer_list; ++ std::string vector_copies; ++ std::string swaps; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ const auto &field = **it; ++ const auto &type = field.value.type; ++ if (field.deprecated || type.base_type == BASE_TYPE_UTYPE) continue; ++ if (type.base_type == BASE_TYPE_STRUCT) { ++ if (!initializer_list.empty()) { initializer_list += ",\n "; } ++ const auto cpp_type = field.attributes.Lookup("cpp_type"); ++ const auto cpp_ptr_type = field.attributes.Lookup("cpp_ptr_type"); ++ auto type_name = (cpp_type) ? cpp_type->constant ++ : GenTypeNative(type, /*invector*/ false, ++ field, /*forcopy*/ true); ++ const bool is_ptr = !(IsStruct(type) && field.native_inline) || ++ (cpp_type && cpp_ptr_type->constant != "naked"); ++ CodeWriter cw; ++ cw.SetValue("FIELD", Name(field)); ++ cw.SetValue("TYPE", type_name); ++ if (is_ptr) { ++ cw += ++ "{{FIELD}}((o.{{FIELD}}) ? new {{TYPE}}(*o.{{FIELD}}) : " ++ "nullptr)\\"; ++ initializer_list += cw.ToString(); ++ } else { ++ cw += "{{FIELD}}(o.{{FIELD}})\\"; ++ initializer_list += cw.ToString(); ++ } ++ } else if (IsVector(type)) { ++ const auto vec_type = type.VectorType(); ++ if (vec_type.base_type == BASE_TYPE_UTYPE) continue; ++ const auto cpp_type = field.attributes.Lookup("cpp_type"); ++ const auto cpp_ptr_type = field.attributes.Lookup("cpp_ptr_type"); ++ const auto type_name = (cpp_type) ++ ? cpp_type->constant ++ : GenTypeNative(vec_type, /*invector*/ true, ++ field, /*forcopy*/ true); ++ const bool is_ptr = ++ (vec_type.base_type == BASE_TYPE_STRUCT && !IsStruct(vec_type)) || ++ (cpp_type && cpp_ptr_type->constant != "naked"); ++ CodeWriter cw(" "); ++ cw.SetValue("FIELD", Name(field)); ++ cw.SetValue("TYPE", type_name); ++ if (is_ptr) { ++ // Use emplace_back to construct the potentially-smart pointer element ++ // from a raw pointer to a new-allocated copy. ++ cw.IncrementIdentLevel(); ++ cw += "{{FIELD}}.reserve(o.{{FIELD}}.size());"; ++ cw += ++ "for (const auto &v : o.{{FIELD}}) { " ++ "{{FIELD}}.emplace_back((v) ? new {{TYPE}}(*v) : nullptr); }"; ++ vector_copies += cw.ToString(); ++ } else { ++ // For non-pointer elements, use std::vector's copy constructor in the ++ // initializer list. This will yield better performance than an insert ++ // range loop for trivially-copyable element types. ++ if (!initializer_list.empty()) { initializer_list += ",\n "; } ++ cw += "{{FIELD}}(o.{{FIELD}})\\"; ++ initializer_list += cw.ToString(); ++ } ++ } else { ++ if (!initializer_list.empty()) { initializer_list += ",\n "; } ++ CodeWriter cw; ++ cw.SetValue("FIELD", Name(field)); ++ cw += "{{FIELD}}(o.{{FIELD}})\\"; ++ initializer_list += cw.ToString(); ++ } ++ { ++ if (!swaps.empty()) { swaps += "\n "; } ++ CodeWriter cw; ++ cw.SetValue("FIELD", Name(field)); ++ cw += "std::swap({{FIELD}}, o.{{FIELD}});\\"; ++ swaps += cw.ToString(); ++ } ++ } ++ if (!initializer_list.empty()) { ++ initializer_list = "\n : " + initializer_list; ++ } ++ if (!swaps.empty()) { swaps = " " + swaps; } ++ ++ code_.SetValue("NATIVE_NAME", ++ NativeName(Name(struct_def), &struct_def, opts_)); ++ code_.SetValue("INIT_LIST", initializer_list); ++ code_.SetValue("VEC_COPY", vector_copies); ++ code_.SetValue("SWAPS", swaps); ++ ++ code_ += ++ "inline {{NATIVE_NAME}}::{{NATIVE_NAME}}(const {{NATIVE_NAME}} &o)" ++ "{{INIT_LIST}} {"; ++ code_ += "{{VEC_COPY}}}\n"; ++ code_ += ++ "inline {{NATIVE_NAME}} &{{NATIVE_NAME}}::operator=" ++ "({{NATIVE_NAME}} o) FLATBUFFERS_NOEXCEPT {"; ++ code_ += "{{SWAPS}}"; ++ code_ += " return *this;\n}\n"; ++ } ++ + void GenCompareOperator(const StructDef &struct_def, + std::string accessSuffix = "") { + std::string compare_op; +@@ -1797,7 +2025,18 @@ + field.value.type.element != BASE_TYPE_UTYPE)) { + if (!compare_op.empty()) { compare_op += " &&\n "; } + auto accessor = Name(field) + accessSuffix; +- compare_op += "(lhs." + accessor + " == rhs." + accessor + ")"; ++ if (struct_def.fixed || field.native_inline || ++ field.value.type.base_type != BASE_TYPE_STRUCT) { ++ compare_op += "(lhs." + accessor + " == rhs." + accessor + ")"; ++ } else { ++ // Deep compare of std::unique_ptr. Null is not equal to empty. ++ std::string both_null = ++ "(lhs." + accessor + " == rhs." + accessor + ")"; ++ std::string not_null_and_equal = "(lhs." + accessor + " && rhs." + ++ accessor + " && *lhs." + accessor + ++ " == *rhs." + accessor + ")"; ++ compare_op += "(" + both_null + " || " + not_null_and_equal + ")"; ++ } + } + } + +@@ -1862,11 +2101,21 @@ + } + GenOperatorNewDelete(struct_def); + GenDefaultConstructor(struct_def); ++ GenCopyMoveCtorAndAssigOpDecls(struct_def); + code_ += "};"; +- if (opts_.gen_compare) GenCompareOperator(struct_def); + code_ += ""; + } + ++ void GenNativeTablePost(const StructDef &struct_def) { ++ if (opts_.gen_compare) { ++ const auto native_name = NativeName(Name(struct_def), &struct_def, opts_); ++ code_.SetValue("STRUCT_NAME", Name(struct_def)); ++ code_.SetValue("NATIVE_NAME", native_name); ++ GenCompareOperator(struct_def); ++ code_ += ""; ++ } ++ } ++ + // Generate the code to call the appropriate Verify function(s) for a field. + void GenVerifyCall(const FieldDef &field, const char *prefix) { + code_.SetValue("PRE", prefix); +@@ -1875,8 +2124,10 @@ + code_.SetValue("SIZE", GenTypeSize(field.value.type)); + code_.SetValue("OFFSET", GenFieldOffsetName(field)); + if (IsScalar(field.value.type.base_type) || IsStruct(field.value.type)) { ++ code_.SetValue("ALIGN", NumToString(InlineAlignment(field.value.type))); + code_ += +- "{{PRE}}VerifyField{{REQUIRED}}<{{SIZE}}>(verifier, {{OFFSET}})\\"; ++ "{{PRE}}VerifyField{{REQUIRED}}<{{SIZE}}>(verifier, " ++ "{{OFFSET}}, {{ALIGN}})\\"; + } else { + code_ += "{{PRE}}VerifyOffset{{REQUIRED}}(verifier, {{OFFSET}})\\"; + } +@@ -1923,6 +2174,19 @@ + } + default: break; + } ++ ++ auto nfn = GetNestedFlatBufferName(field); ++ if (!nfn.empty()) { ++ code_.SetValue("CPP_NAME", nfn); ++ // FIXME: file_identifier. ++ code_ += ++ "{{PRE}}verifier.VerifyNestedFlatBuffer<{{CPP_NAME}}>" ++ "({{NAME}}(), nullptr)\\"; ++ } else if (field.flexbuffer) { ++ code_ += ++ "{{PRE}}flexbuffers::VerifyNestedFlexBuffer" ++ "({{NAME}}(), verifier)\\"; ++ } + break; + } + default: { +@@ -1946,8 +2210,8 @@ + code_ += " }"; + + if (is_string) { +- code_ += " int KeyCompareWithValue(const char *val) const {"; +- code_ += " return strcmp({{FIELD_NAME}}()->c_str(), val);"; ++ code_ += " int KeyCompareWithValue(const char *_{{FIELD_NAME}}) const {"; ++ code_ += " return strcmp({{FIELD_NAME}}()->c_str(), _{{FIELD_NAME}});"; + code_ += " }"; + } else { + FLATBUFFERS_ASSERT(IsScalar(field.value.type.base_type)); +@@ -1958,10 +2222,11 @@ + } + // Returns {fieldval: +1}. + code_.SetValue("KEY_TYPE", type); +- code_ += " int KeyCompareWithValue({{KEY_TYPE}} val) const {"; + code_ += +- " return static_cast({{FIELD_NAME}}() > val) - " +- "static_cast({{FIELD_NAME}}() < val);"; ++ " int KeyCompareWithValue({{KEY_TYPE}} _{{FIELD_NAME}}) const {"; ++ code_ += ++ " return static_cast({{FIELD_NAME}}() > _{{FIELD_NAME}}) - " ++ "static_cast({{FIELD_NAME}}() < _{{FIELD_NAME}});"; + code_ += " }"; + } + } +@@ -2112,14 +2377,8 @@ + // }; + // + void GenFieldNames(const StructDef &struct_def) { +- auto non_deprecated_field_count = std::count_if( +- struct_def.fields.vec.begin(), struct_def.fields.vec.end(), +- [](const FieldDef *field) { return !field->deprecated; }); + code_ += " static constexpr std::array<\\"; +- code_.SetValue( +- "FIELD_COUNT", +- std::to_string(static_cast(non_deprecated_field_count))); +- code_ += "const char *, {{FIELD_COUNT}}> field_names = {\\"; ++ code_ += "const char *, fields_number> field_names = {\\"; + if (struct_def.fields.vec.empty()) { + code_ += "};"; + return; +@@ -2141,7 +2400,7 @@ + } + + void GenFieldsNumber(const StructDef &struct_def) { +- auto non_deprecated_field_count = std::count_if( ++ const auto non_deprecated_field_count = std::count_if( + struct_def.fields.vec.begin(), struct_def.fields.vec.end(), + [](const FieldDef *field) { return !field->deprecated; }); + code_.SetValue( +@@ -2165,9 +2424,9 @@ + code_ += + " static constexpr auto fully_qualified_name = " + "\"{{FULLY_QUALIFIED_NAME}}\";"; ++ GenFieldsNumber(struct_def); + GenFieldNames(struct_def); + GenFieldTypeHelper(struct_def); +- GenFieldsNumber(struct_def); + } + code_ += "};"; + code_ += ""; +@@ -2188,15 +2447,25 @@ + code_.SetValue("FIELD_VALUE", + GenUnderlyingCast(field, false, "_" + Name(field))); + +- code_ += +- " bool mutate_{{FIELD_NAME}}({{FIELD_TYPE}} " +- "_{{FIELD_NAME}}) {"; ++ code_ += " bool mutate_{{FIELD_NAME}}({{FIELD_TYPE}} _{{FIELD_NAME}}\\"; + if (false == field.IsScalarOptional()) { + code_.SetValue("DEFAULT_VALUE", GenDefaultConstant(field)); ++ code_.SetValue( ++ "INTERFACE_DEFAULT_VALUE", ++ GenUnderlyingCast(field, true, GenDefaultConstant(field))); ++ ++ // GenUnderlyingCast for a bool field generates 0 != 0 ++ // So the type has to be checked and the appropriate default chosen ++ if (IsBool(field.value.type.base_type)) { ++ code_ += " = {{DEFAULT_VALUE}}) {"; ++ } else { ++ code_ += " = {{INTERFACE_DEFAULT_VALUE}}) {"; ++ } + code_ += + " return {{SET_FN}}({{OFFSET_NAME}}, {{FIELD_VALUE}}, " + "{{DEFAULT_VALUE}});"; + } else { ++ code_ += ") {"; + code_ += " return {{SET_FN}}({{OFFSET_NAME}}, {{FIELD_VALUE}});"; + } + code_ += " }"; +@@ -2214,6 +2483,21 @@ + } + } + ++ std::string GetNestedFlatBufferName(const FieldDef &field) { ++ auto nested = field.attributes.Lookup("nested_flatbuffer"); ++ if (!nested) return ""; ++ std::string qualified_name = nested->constant; ++ auto nested_root = parser_.LookupStruct(nested->constant); ++ if (nested_root == nullptr) { ++ qualified_name = ++ parser_.current_namespace_->GetFullyQualifiedName(nested->constant); ++ nested_root = parser_.LookupStruct(qualified_name); ++ } ++ FLATBUFFERS_ASSERT(nested_root); // Guaranteed to exist by parser. ++ (void)nested_root; ++ return TranslateNameSpace(qualified_name); ++ } ++ + // Generate an accessor struct, builder structs & function for a table. + void GenTable(const StructDef &struct_def) { + if (opts_.generate_object_based_api) { GenNativeTable(struct_def); } +@@ -2277,19 +2561,9 @@ + GenTableFieldGetter(field); + if (opts_.mutable_buffer) { GenTableFieldSetter(field); } + +- auto nested = field.attributes.Lookup("nested_flatbuffer"); +- if (nested) { +- std::string qualified_name = nested->constant; +- auto nested_root = parser_.LookupStruct(nested->constant); +- if (nested_root == nullptr) { +- qualified_name = parser_.current_namespace_->GetFullyQualifiedName( +- nested->constant); +- nested_root = parser_.LookupStruct(qualified_name); +- } +- FLATBUFFERS_ASSERT(nested_root); // Guaranteed to exist by parser. +- (void)nested_root; +- code_.SetValue("CPP_NAME", TranslateNameSpace(qualified_name)); +- ++ auto nfn = GetNestedFlatBufferName(field); ++ if (!nfn.empty()) { ++ code_.SetValue("CPP_NAME", nfn); + code_ += " const {{CPP_NAME}} *{{FIELD_NAME}}_nested_root() const {"; + code_ += + " return " +@@ -2723,9 +2997,19 @@ + code += "/* else do nothing */"; + } + } else { ++ const bool is_pointer = ++ field.value.type.VectorType().base_type == BASE_TYPE_STRUCT && ++ !IsStruct(field.value.type.VectorType()); ++ if (is_pointer) { ++ code += "if(_o->" + name + "[_i]" + ") { "; ++ code += indexing + "->UnPackTo(_o->" + name + ++ "[_i].get(), _resolver);"; ++ code += " } else { "; ++ } + code += "_o->" + name + "[_i]" + access + " = "; + code += GenUnpackVal(field.value.type.VectorType(), indexing, true, + field); ++ if (is_pointer) { code += "; }"; } + } + code += "; } }"; + } +@@ -2772,8 +3056,17 @@ + } else { + // Generate code for assigning the value, of the form: + // _o->field = value; ++ const bool is_pointer = ++ field.value.type.base_type == BASE_TYPE_STRUCT && ++ !IsStruct(field.value.type); ++ if (is_pointer) { ++ code += "{ if(_o->" + Name(field) + ") { "; ++ code += "_e->UnPackTo(_o->" + Name(field) + ".get(), _resolver);"; ++ code += " } else { "; ++ } + code += "_o->" + Name(field) + " = "; + code += GenUnpackVal(field.value.type, "_e", false, field) + ";"; ++ if (is_pointer) { code += " } }"; } + } + break; + } +@@ -2901,10 +3194,15 @@ + } + case BASE_TYPE_UTYPE: { + value = StripUnionType(value); +- code += "_fbb.CreateVector(" + value + +- ".size(), [](size_t i, _VectorArgs *__va) { " +- "return static_cast(__va->_" + +- value + "[i].type); }, &_va)"; ++ auto type = opts_.scoped_enums ? Name(*field.value.type.enum_def) ++ : "uint8_t"; ++ auto enum_value = "__va->_" + value + "[i].type"; ++ if (!opts_.scoped_enums) ++ enum_value = "static_cast(" + enum_value + ")"; ++ ++ code += "_fbb.CreateVector<" + type + ">(" + value + ++ ".size(), [](size_t i, _VectorArgs *__va) { return " + ++ enum_value + "; }, &_va)"; + break; + } + default: { +@@ -2979,11 +3277,16 @@ + + // Generate code for tables that needs to come after the regular definition. + void GenTablePost(const StructDef &struct_def) { ++ if (opts_.generate_object_based_api) { GenNativeTablePost(struct_def); } ++ + code_.SetValue("STRUCT_NAME", Name(struct_def)); + code_.SetValue("NATIVE_NAME", + NativeName(Name(struct_def), &struct_def, opts_)); + + if (opts_.generate_object_based_api) { ++ // Generate the >= C++11 copy ctor and assignment operator definitions. ++ GenCopyCtorAssignOpDefs(struct_def); ++ + // Generate the X::UnPack() method. + code_ += + "inline " + TableUnPackSignature(struct_def, false, opts_) + " {"; +diff -urN a/src/idl_gen_csharp.cpp b/src/idl_gen_csharp.cpp +--- a/src/idl_gen_csharp.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_csharp.cpp 2023-01-13 07:47:08.830251603 +0000 +@@ -16,15 +16,13 @@ + + // independent from idl_parser, since this code is not needed for most clients + ++#include ++ + #include "flatbuffers/code_generators.h" + #include "flatbuffers/flatbuffers.h" + #include "flatbuffers/idl.h" + #include "flatbuffers/util.h" + +-#if defined(FLATBUFFERS_CPP98_STL) +-# include +-#endif // defined(FLATBUFFERS_CPP98_STL) +- + namespace flatbuffers { + + static TypedFloatConstantGenerator CSharpFloatGen("Double.", "Single.", "NaN", +@@ -46,8 +44,100 @@ + public: + CSharpGenerator(const Parser &parser, const std::string &path, + const std::string &file_name) +- : BaseGenerator(parser, path, file_name, "", ".", "cs"), +- cur_name_space_(nullptr) {} ++ : BaseGenerator(parser, path, file_name, ++ parser.opts.cs_global_alias ? "global::" : "", ".", "cs"), ++ cur_name_space_(nullptr) { ++ // clang-format off ++ ++ // List of keywords retrieved from here: ++ // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/ ++ ++ // One per line to ease comparisons to that list are easier ++ ++ static const char *const keywords[] = { ++ "abstract", ++ "as", ++ "base", ++ "bool", ++ "break", ++ "byte", ++ "case", ++ "catch", ++ "char", ++ "checked", ++ "class", ++ "const", ++ "continue", ++ "decimal", ++ "default", ++ "delegate", ++ "do", ++ "double", ++ "else", ++ "enum", ++ "event", ++ "explicit", ++ "extern", ++ "false", ++ "finally", ++ "fixed", ++ "float", ++ "for", ++ "foreach", ++ "goto", ++ "if", ++ "implicit", ++ "in", ++ "int", ++ "interface", ++ "internal", ++ "is", ++ "lock", ++ "long", ++ "namespace", ++ "new", ++ "null", ++ "object", ++ "operator", ++ "out", ++ "override", ++ "params", ++ "private", ++ "protected", ++ "public", ++ "readonly", ++ "ref", ++ "return", ++ "sbyte", ++ "sealed", ++ "short", ++ "sizeof", ++ "stackalloc", ++ "static", ++ "string", ++ "struct", ++ "switch", ++ "this", ++ "throw", ++ "true", ++ "try", ++ "typeof", ++ "uint", ++ "ulong", ++ "unchecked", ++ "unsafe", ++ "ushort", ++ "using", ++ "virtual", ++ "void", ++ "volatile", ++ "while", ++ nullptr, ++ // clang-format on ++ }; ++ ++ for (auto kw = keywords; *kw; kw++) keywords_.insert(*kw); ++ } + + CSharpGenerator &operator=(const CSharpGenerator &); + +@@ -65,7 +155,7 @@ + one_file_code += enumcode; + } else { + if (!SaveType(enum_def.name, *enum_def.defined_namespace, enumcode, +- false)) ++ false, parser_.opts)) + return false; + } + } +@@ -81,22 +171,45 @@ + one_file_code += declcode; + } else { + if (!SaveType(struct_def.name, *struct_def.defined_namespace, declcode, +- true)) ++ true, parser_.opts)) + return false; + } + } + + if (parser_.opts.one_file) { + return SaveType(file_name_, *parser_.current_namespace_, one_file_code, +- true); ++ true, parser_.opts); + } + return true; + } + ++ private: ++ std::unordered_set keywords_; ++ ++ std::string EscapeKeyword(const std::string &name) const { ++ return keywords_.find(name) == keywords_.end() ? name : "@" + name; ++ } ++ ++ std::string Name(const FieldDef &field) const { ++ std::string name = MakeCamel(field.name, true); ++ return EscapeKeyword(name); ++ } ++ ++ std::string Name(const Definition &def) const { ++ return EscapeKeyword(def.name); ++ } ++ ++ std::string NamespacedName(const Definition &def) const { ++ return WrapInNameSpace(def.defined_namespace, Name(def)); ++ } ++ ++ std::string Name(const EnumVal &ev) const { return EscapeKeyword(ev.name); } ++ + // Save out the generated code for a single class while adding + // declaration boilerplate. + bool SaveType(const std::string &defname, const Namespace &ns, +- const std::string &classcode, bool needs_includes) const { ++ const std::string &classcode, bool needs_includes, ++ const IDLOptions &options) const { + if (!classcode.length()) return true; + + std::string code = +@@ -117,7 +230,10 @@ + } + code += classcode; + if (!namespace_name.empty()) { code += "\n}\n"; } +- auto filename = NamespaceDir(ns) + defname + ".cs"; ++ auto filename = NamespaceDir(ns) + defname; ++ if (options.one_file) { filename += options.filename_suffix; } ++ filename += ++ options.filename_extension.empty() ? ".cs" : options.filename_extension; + return SaveFile(filename.c_str(), code, false); + } + +@@ -134,9 +250,9 @@ + // clang-format on + + if (enableLangOverrides) { +- if (IsEnum(type)) return WrapInNameSpace(*type.enum_def); ++ if (IsEnum(type)) return NamespacedName(*type.enum_def); + if (type.base_type == BASE_TYPE_STRUCT) { +- return "Offset<" + WrapInNameSpace(*type.struct_def) + ">"; ++ return "Offset<" + NamespacedName(*type.struct_def) + ">"; + } + } + +@@ -151,7 +267,7 @@ + switch (type.base_type) { + case BASE_TYPE_STRING: return "string"; + case BASE_TYPE_VECTOR: return GenTypeGet(type.VectorType()); +- case BASE_TYPE_STRUCT: return WrapInNameSpace(*type.struct_def); ++ case BASE_TYPE_STRUCT: return NamespacedName(*type.struct_def); + case BASE_TYPE_UNION: return "TTable"; + default: return "Table"; + } +@@ -165,12 +281,12 @@ + } + + std::string GenOffsetType(const StructDef &struct_def) const { +- return "Offset<" + WrapInNameSpace(struct_def) + ">"; ++ return "Offset<" + NamespacedName(struct_def) + ">"; + } + + std::string GenOffsetConstruct(const StructDef &struct_def, + const std::string &variable_name) const { +- return "new Offset<" + WrapInNameSpace(struct_def) + ">(" + variable_name + ++ return "new Offset<" + NamespacedName(struct_def) + ">(" + variable_name + + ")"; + } + +@@ -179,7 +295,7 @@ + if (IsSeries(type)) { + return DestinationCast(type.VectorType()); + } else { +- if (IsEnum(type)) return "(" + WrapInNameSpace(*type.enum_def) + ")"; ++ if (IsEnum(type)) return "(" + NamespacedName(*type.enum_def) + ")"; + } + return ""; + } +@@ -190,17 +306,19 @@ + // would be cast down to int before being put onto the buffer. In C#, one cast + // directly cast an Enum to its underlying type, which is essential before + // putting it onto the buffer. +- std::string SourceCast(const Type &type) const { ++ std::string SourceCast(const Type &type, ++ const bool isOptional = false) const { + if (IsSeries(type)) { + return SourceCast(type.VectorType()); + } else { +- if (IsEnum(type)) return "(" + GenTypeBasic(type, false) + ")"; ++ if (IsEnum(type)) ++ return "(" + GenTypeBasic(type, false) + (isOptional ? "?" : "") + ")"; + } + return ""; + } + +- std::string SourceCastBasic(const Type &type) const { +- return IsScalar(type.base_type) ? SourceCast(type) : ""; ++ std::string SourceCastBasic(const Type &type, const bool isOptional) const { ++ return IsScalar(type.base_type) ? SourceCast(type, isOptional) : ""; + } + + std::string GenEnumDefaultValue(const FieldDef &field) const { +@@ -208,7 +326,7 @@ + FLATBUFFERS_ASSERT(value.type.enum_def); + auto &enum_def = *value.type.enum_def; + auto enum_val = enum_def.FindByValue(value.constant); +- return enum_val ? (WrapInNameSpace(enum_def) + "." + enum_val->name) ++ return enum_val ? (NamespacedName(enum_def) + "." + Name(*enum_val)) + : value.constant; + } + +@@ -252,7 +370,7 @@ + switch (value.type.base_type) { + case BASE_TYPE_STRING: return "default(StringOffset)"; + case BASE_TYPE_STRUCT: +- return "default(Offset<" + WrapInNameSpace(*value.type.struct_def) + ++ return "default(Offset<" + NamespacedName(*value.type.struct_def) + + ">)"; + case BASE_TYPE_VECTOR: return "default(VectorOffset)"; + default: break; +@@ -293,14 +411,14 @@ + } else { + code += "public "; + } +- code += "enum " + enum_def.name; ++ code += "enum " + Name(enum_def); + code += " : " + GenTypeBasic(enum_def.underlying_type, false); + code += "\n{\n"; + for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); ++it) { + auto &ev = **it; + GenComment(ev.doc_comment, code_ptr, &comment_config, " "); + code += " "; +- code += ev.name + " = "; ++ code += Name(ev) + " = "; + code += enum_def.ToString(ev); + code += ",\n"; + } +@@ -395,7 +513,8 @@ + // don't clash, and to make it obvious these arguments are constructing + // a nested struct, prefix the name with the field name. + GenStructArgs(*field_type.struct_def, code_ptr, +- (nameprefix + (field.name + "_")).c_str(), array_cnt); ++ (nameprefix + (EscapeKeyword(field.name) + "_")).c_str(), ++ array_cnt); + } else { + code += ", "; + code += GenTypeBasic(type); +@@ -407,7 +526,7 @@ + } + code += " "; + code += nameprefix; +- code += MakeCamel(field.name, true); ++ code += Name(field); + } + } + } +@@ -454,7 +573,7 @@ + code += indent + " builder.Put"; + code += GenMethod(type) + "("; + code += SourceCast(type); +- auto argname = nameprefix + MakeCamel(field.name, true); ++ auto argname = nameprefix + Name(field); + code += argname; + size_t array_cnt = index + (IsArray(field_type) ? 1 : 0); + if (array_cnt > 0) { +@@ -618,7 +737,8 @@ + std::string dest_mask = ""; + std::string dest_cast = DestinationCast(field.value.type); + std::string src_cast = SourceCast(field.value.type); +- std::string field_name_camel = MakeCamel(field.name, true); ++ std::string field_name_camel = Name(field); ++ if (field_name_camel == struct_def.name) { field_name_camel += "_"; } + std::string method_start = + " public " + type_name_dest + optional + " " + field_name_camel; + std::string obj = "(new " + type_name + "())"; +@@ -745,8 +865,7 @@ + HasUnionStringValue(*vectortype.enum_def)) { + code += member_suffix; + code += "}\n"; +- code += " public string " + MakeCamel(field.name, true) + +- "AsString(int j)"; ++ code += " public string " + Name(field) + "AsString(int j)"; + code += offset_prefix + GenGetter(Type(BASE_TYPE_STRING)); + code += "(" + index + ") : null"; + } +@@ -759,8 +878,7 @@ + if (HasUnionStringValue(*field.value.type.enum_def)) { + code += member_suffix; + code += "}\n"; +- code += " public string " + MakeCamel(field.name, true) + +- "AsString()"; ++ code += " public string " + Name(field) + "AsString()"; + code += offset_prefix + GenGetter(Type(BASE_TYPE_STRING)); + code += "(o + __p.bb_pos) : null"; + } +@@ -795,7 +913,7 @@ + code += member_suffix; + code += "}\n"; + if (IsVector(field.value.type)) { +- code += " public int " + MakeCamel(field.name, true); ++ code += " public int " + Name(field); + code += "Length"; + code += " { get"; + code += offset_prefix; +@@ -810,9 +928,9 @@ + for (auto kit = fields.begin(); kit != fields.end(); ++kit) { + auto &key_field = **kit; + if (key_field.key) { +- auto qualified_name = WrapInNameSpace(sd); ++ auto qualified_name = NamespacedName(sd); + code += " public " + qualified_name + "? "; +- code += MakeCamel(field.name, true) + "ByKey("; ++ code += Name(field) + "ByKey("; + code += GenTypeGet(key_field.value.type) + " key)"; + code += offset_prefix; + code += qualified_name + ".__lookup_by_key("; +@@ -831,7 +949,7 @@ + code += "#if ENABLE_SPAN_T\n"; + code += " public Span<" + GenTypeBasic(field.value.type.VectorType()) + + "> Get"; +- code += MakeCamel(field.name, true); ++ code += Name(field); + code += "Bytes() { return "; + code += "__p.__vector_as_span<" + + GenTypeBasic(field.value.type.VectorType()) + ">("; +@@ -841,7 +959,7 @@ + code += "); }\n"; + code += "#else\n"; + code += " public ArraySegment? Get"; +- code += MakeCamel(field.name, true); ++ code += Name(field); + code += "Bytes() { return "; + code += "__p.__vector_as_arraysegment("; + code += NumToString(field.value.offset); +@@ -852,7 +970,7 @@ + code += " public "; + code += GenTypeBasic(field.value.type.VectorType()); + code += "[] Get"; +- code += MakeCamel(field.name, true); ++ code += Name(field); + code += "Array() { "; + if (IsEnum(field.value.type.VectorType())) { + // Since __vector_as_array does not work for enum types, +@@ -881,9 +999,9 @@ + } + // generate object accessors if is nested_flatbuffer + if (field.nested_flatbuffer) { +- auto nested_type_name = WrapInNameSpace(*field.nested_flatbuffer); ++ auto nested_type_name = NamespacedName(*field.nested_flatbuffer); + auto nested_method_name = +- MakeCamel(field.name, true) + "As" + field.nested_flatbuffer->name; ++ Name(field) + "As" + field.nested_flatbuffer->name; + auto get_nested_method_name = nested_method_name; + get_nested_method_name = "Get" + nested_method_name; + conditional_cast = "(" + nested_type_name + "?)"; +@@ -904,15 +1022,16 @@ + is_series ? field.value.type.VectorType() : field.value.type; + // Boolean parameters have to be explicitly converted to byte + // representation. +- auto setter_parameter = underlying_type.base_type == BASE_TYPE_BOOL +- ? "(byte)(" + field.name + " ? 1 : 0)" +- : field.name; ++ auto setter_parameter = ++ underlying_type.base_type == BASE_TYPE_BOOL ++ ? "(byte)(" + EscapeKeyword(field.name) + " ? 1 : 0)" ++ : EscapeKeyword(field.name); + auto mutator_prefix = MakeCamel("mutate", true); + // A vector mutator also needs the index of the vector element it should + // mutate. + auto mutator_params = (is_series ? "(int j, " : "(") + +- GenTypeGet(underlying_type) + " " + field.name + +- ") { "; ++ GenTypeGet(underlying_type) + " " + ++ EscapeKeyword(field.name) + ") { "; + auto setter_index = + is_series + ? "__p." + +@@ -926,7 +1045,7 @@ + if (IsScalar(underlying_type.base_type) && !IsUnion(field.value.type)) { + code += " public "; + code += struct_def.fixed ? "void " : "bool "; +- code += mutator_prefix + MakeCamel(field.name, true); ++ code += mutator_prefix + Name(field); + code += mutator_params; + if (struct_def.fixed) { + code += GenSetter(underlying_type) + "(" + setter_index + ", "; +@@ -1002,13 +1121,13 @@ + field.value.type.struct_def->defined_namespace, + GenTypeName_ObjectAPI(field.value.type.struct_def->name, opts)); + code += " "; +- code += field.name; ++ code += EscapeKeyword(field.name); + code += " = null"; + } else { + code += GenTypeBasic(field.value.type); + if (field.IsScalarOptional()) { code += "?"; } + code += " "; +- code += field.name; ++ code += EscapeKeyword(field.name); + if (!IsScalar(field.value.type.base_type)) code += "Offset"; + + code += " = "; +@@ -1028,13 +1147,13 @@ + size == SizeOf(field.value.type.base_type))) { + code += " " + struct_def.name + "."; + code += "Add"; +- code += MakeCamel(field.name) + "(builder, "; ++ code += Name(field) + "(builder, "; + if (IsStruct(field.value.type) && + opts.generate_object_based_api) { + code += GenTypePointer(field.value.type) + ".Pack(builder, " + +- field.name + ")"; ++ EscapeKeyword(field.name) + ")"; + } else { +- code += field.name; ++ code += EscapeKeyword(field.name); + if (!IsScalar(field.value.type.base_type)) code += "Offset"; + } + +@@ -1062,17 +1181,17 @@ + if (field.deprecated) continue; + if (field.key) key_field = &field; + code += " public static void Add"; +- code += MakeCamel(field.name); ++ code += Name(field); + code += "(FlatBufferBuilder builder, "; + code += GenTypeBasic(field.value.type); + auto argname = MakeCamel(field.name, false); + if (!IsScalar(field.value.type.base_type)) argname += "Offset"; + if (field.IsScalarOptional()) { code += "?"; } +- code += " " + argname + ") { builder.Add"; ++ code += " " + EscapeKeyword(argname) + ") { builder.Add"; + code += GenMethod(field.value.type) + "("; + code += NumToString(it - struct_def.fields.vec.begin()) + ", "; +- code += SourceCastBasic(field.value.type); +- code += argname; ++ code += SourceCastBasic(field.value.type, field.IsScalarOptional()); ++ code += EscapeKeyword(argname); + if (!IsScalar(field.value.type.base_type) && + field.value.type.base_type != BASE_TYPE_UNION) { + code += ".Value"; +@@ -1093,7 +1212,7 @@ + field_has_create_set.insert(&field); + code += " public static VectorOffset "; + code += "Create"; +- code += MakeCamel(field.name); ++ code += Name(field); + code += "Vector(FlatBufferBuilder builder, "; + code += GenTypeBasic(vector_type) + "[] data) "; + code += "{ builder.StartVector("; +@@ -1105,7 +1224,11 @@ + code += "Add"; + code += GenMethod(vector_type); + code += "("; +- code += SourceCastBasic(vector_type); ++ // At the moment there is no support of the type Vector with ++ // optional enum, e.g. if we have enum type SomeEnum there is no way ++ // to define `SomeEmum?[] enums` in FlatBuffer schema, so isOptional ++ // = false ++ code += SourceCastBasic(vector_type, false); + code += "data[i]"; + if (vector_type.base_type == BASE_TYPE_STRUCT || + IsString(vector_type)) +@@ -1115,7 +1238,7 @@ + + code += " public static VectorOffset "; + code += "Create"; +- code += MakeCamel(field.name); ++ code += Name(field); + code += "VectorBlock(FlatBufferBuilder builder, "; + code += GenTypeBasic(vector_type) + "[] data) "; + code += "{ builder.StartVector("; +@@ -1127,7 +1250,7 @@ + // Generate a method to start a vector, data to be added manually + // after. + code += " public static void Start"; +- code += MakeCamel(field.name); ++ code += Name(field); + code += "Vector(FlatBufferBuilder builder, int numElems) "; + code += "{ builder.StartVector("; + code += NumToString(elem_size); +@@ -1215,7 +1338,7 @@ + GenPackUnPack_ObjectAPI(struct_def, code_ptr, opts, struct_has_create, + field_has_create_set); + } +- code += "};\n\n"; ++ code += "}\n\n"; + + if (opts.generate_object_based_api) { + GenStruct_ObjectAPI(struct_def, code_ptr, opts); +@@ -1305,19 +1428,27 @@ + code += " }\n\n"; + // As + code += " public T As() where T : class { return this.Value as T; }\n"; +- // As ++ // As, From + for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); ++it) { + auto &ev = **it; + if (ev.union_type.base_type == BASE_TYPE_NONE) continue; + auto type_name = GenTypeGet_ObjectAPI(ev.union_type, opts); +- if (ev.union_type.base_type == BASE_TYPE_STRUCT && +- ev.union_type.struct_def->attributes.Lookup("private")) { +- code += " internal "; +- } else { +- code += " public "; +- } +- code += type_name + " As" + ev.name + "() { return this.As<" + type_name + +- ">(); }\n"; ++ std::string accessibility = ++ (ev.union_type.base_type == BASE_TYPE_STRUCT && ++ ev.union_type.struct_def->attributes.Lookup("private")) ++ ? "internal" ++ : "public"; ++ // As ++ code += " " + accessibility + " " + type_name + " As" + ev.name + ++ "() { return this.As<" + type_name + ">(); }\n"; ++ // From ++ auto lower_ev_name = ev.name; ++ std::transform(lower_ev_name.begin(), lower_ev_name.end(), ++ lower_ev_name.begin(), CharToLower); ++ code += " " + accessibility + " static " + union_name + " From" + ++ ev.name + "(" + type_name + " _" + lower_ev_name + ++ ") { return new " + union_name + "{ Type = " + Name(enum_def) + ++ "." + Name(ev) + ", Value = _" + lower_ev_name + " }; }\n"; + } + code += "\n"; + // Pack() +@@ -1329,7 +1460,7 @@ + if (ev.union_type.base_type == BASE_TYPE_NONE) { + code += " default: return 0;\n"; + } else { +- code += " case " + enum_def.name + "." + ev.name + ": return "; ++ code += " case " + Name(enum_def) + "." + Name(ev) + ": return "; + if (IsString(ev.union_type)) { + code += "builder.CreateString(_o.As" + ev.name + "()).Value;\n"; + } else { +@@ -1414,7 +1545,7 @@ + code += " default: break;\n"; + } else { + auto type_name = GenTypeGet_ObjectAPI(ev.union_type, opts); +- code += " case " + enum_def.name + "." + ev.name + ++ code += " case " + Name(enum_def) + "." + Name(ev) + + ": _o.Value = serializer.Deserialize<" + type_name + + ">(reader); break;\n"; + } +@@ -1450,7 +1581,7 @@ + } else { + code += indent + varialbe_name + " = new "; + } +- code += WrapInNameSpace(enum_def) + "Union();\n"; ++ code += NamespacedName(enum_def) + "Union();\n"; + code += indent + varialbe_name + ".Type = this." + camel_name + "Type" + + type_suffix + ";\n"; + code += +@@ -1461,7 +1592,7 @@ + if (ev.union_type.base_type == BASE_TYPE_NONE) { + code += indent + " default: break;\n"; + } else { +- code += indent + " case " + WrapInNameSpace(enum_def) + "." + ev.name + ++ code += indent + " case " + NamespacedName(enum_def) + "." + ev.name + + ":\n"; + code += indent + " " + varialbe_name + ".Value = this." + camel_name; + if (IsString(ev.union_type)) { +@@ -1499,7 +1630,7 @@ + it != struct_def.fields.vec.end(); ++it) { + auto &field = **it; + if (field.deprecated) continue; +- auto camel_name = MakeCamel(field.name); ++ auto camel_name = Name(field); + auto start = " _o." + camel_name + " = "; + switch (field.value.type.base_type) { + case BASE_TYPE_STRUCT: { +@@ -1515,11 +1646,10 @@ + case BASE_TYPE_ARRAY: { + auto type_name = GenTypeGet_ObjectAPI(field.value.type, opts); + auto length_str = NumToString(field.value.type.fixed_length); +- auto unpack_method = field.value.type.struct_def == nullptr +- ? "" +- : field.value.type.struct_def->fixed +- ? ".UnPack()" +- : "?.UnPack()"; ++ auto unpack_method = field.value.type.struct_def == nullptr ? "" ++ : field.value.type.struct_def->fixed ++ ? ".UnPack()" ++ : "?.UnPack()"; + code += start + "new " + type_name.substr(0, type_name.length() - 1) + + length_str + "];\n"; + code += " for (var _j = 0; _j < " + length_str + "; ++_j) { _o." + +@@ -1574,7 +1704,7 @@ + it != struct_def.fields.vec.end(); ++it) { + auto &field = **it; + if (field.deprecated) continue; +- auto camel_name = MakeCamel(field.name); ++ auto camel_name = Name(field); + // pre + switch (field.value.type.base_type) { + case BASE_TYPE_STRUCT: { +@@ -1628,12 +1758,12 @@ + break; + case BASE_TYPE_UTYPE: + property_name = camel_name.substr(0, camel_name.size() - 4); +- array_type = WrapInNameSpace(*field.value.type.enum_def); ++ array_type = NamespacedName(*field.value.type.enum_def); + to_array = "_o." + property_name + "[_j].Type"; + break; + case BASE_TYPE_UNION: + array_type = "int"; +- to_array = WrapInNameSpace(*field.value.type.enum_def) + ++ to_array = NamespacedName(*field.value.type.enum_def) + + "Union.Pack(builder, _o." + property_name + "[_j])"; + break; + default: gen_for_loop = false; break; +@@ -1688,7 +1818,7 @@ + } + case BASE_TYPE_UNION: { + code += " var _" + field.name + "_type = _o." + camel_name + +- " == null ? " + WrapInNameSpace(*field.value.type.enum_def) + ++ " == null ? " + NamespacedName(*field.value.type.enum_def) + + ".NONE : " + "_o." + camel_name + ".Type;\n"; + code += + " var _" + field.name + " = _o." + camel_name + +@@ -1707,7 +1837,7 @@ + it != struct_def.fields.vec.end(); ++it) { + auto &field = **it; + if (field.deprecated) continue; +- auto camel_name = MakeCamel(field.name); ++ auto camel_name = Name(field); + switch (field.value.type.base_type) { + case BASE_TYPE_STRUCT: { + if (struct_def.fixed) { +@@ -1761,7 +1891,7 @@ + it != struct_def.fields.vec.end(); ++it) { + auto &field = **it; + if (field.deprecated) continue; +- auto camel_name = MakeCamel(field.name); ++ auto camel_name = Name(field); + switch (field.value.type.base_type) { + case BASE_TYPE_STRUCT: { + if (field.value.type.struct_def->fixed) { +@@ -1857,7 +1987,7 @@ + } + code += "] = _o"; + for (size_t i = 0, j = 0; i < array_lengths.size(); ++i) { +- code += "." + MakeCamel(array_lengths[i].name); ++ code += "." + MakeCamel(array_lengths[i].name, true); + if (array_lengths[i].length <= 0) continue; + code += "[idx" + NumToString(j++) + "]"; + } +@@ -1868,7 +1998,7 @@ + } else { + code += "_o"; + for (size_t i = 0; i < array_lengths.size(); ++i) { +- code += "." + MakeCamel(array_lengths[i].name); ++ code += "." + MakeCamel(array_lengths[i].name, true); + } + code += ";"; + } +@@ -1911,13 +2041,13 @@ + type_name.replace(type_name.length() - type_name_length, + type_name_length, new_type_name); + } else if (type.element == BASE_TYPE_UNION) { +- type_name = WrapInNameSpace(*type.enum_def) + "Union"; ++ type_name = NamespacedName(*type.enum_def) + "Union"; + } + break; + } + + case BASE_TYPE_UNION: { +- type_name = WrapInNameSpace(*type.enum_def) + "Union"; ++ type_name = NamespacedName(*type.enum_def) + "Union"; + break; + } + default: break; +@@ -1961,10 +2091,10 @@ + if (field.value.type.element == BASE_TYPE_UTYPE) continue; + auto type_name = GenTypeGet_ObjectAPI(field.value.type, opts); + if (field.IsScalarOptional()) type_name += "?"; +- auto camel_name = MakeCamel(field.name, true); ++ auto camel_name = Name(field); + if (opts.cs_gen_json_serializer) { + if (IsUnion(field.value.type)) { +- auto utype_name = WrapInNameSpace(*field.value.type.enum_def); ++ auto utype_name = NamespacedName(*field.value.type.enum_def); + code += + " [Newtonsoft.Json.JsonProperty(\"" + field.name + "_type\")]\n"; + if (IsVector(field.value.type)) { +@@ -2027,7 +2157,7 @@ + if (field.deprecated) continue; + if (field.value.type.base_type == BASE_TYPE_UTYPE) continue; + if (field.value.type.element == BASE_TYPE_UTYPE) continue; +- code += " this." + MakeCamel(field.name) + " = "; ++ code += " this." + Name(field) + " = "; + auto type_name = GenTypeGet_ObjectAPI(field.value.type, opts); + if (IsScalar(field.value.type.base_type)) { + code += GenDefaultValue(field) + ";\n"; +diff -urN a/src/idl_gen_dart.cpp b/src/idl_gen_dart.cpp +--- a/src/idl_gen_dart.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_dart.cpp 2023-01-13 07:47:08.831251612 +0000 +@@ -63,7 +63,7 @@ + code.clear(); + code = code + "// " + FlatBuffersGeneratedWarning() + "\n"; + code = code + +- "// ignore_for_file: unused_import, unused_field, " ++ "// ignore_for_file: unused_import, unused_field, unused_element, " + "unused_local_variable\n\n"; + + if (!kv->first.empty()) { code += "library " + kv->first + ";\n\n"; } +@@ -231,17 +231,18 @@ + code += " final int value;\n"; + code += " const " + name + "._(this.value);\n\n"; + code += " factory " + name + ".fromValue(int value) {\n"; +- code += " if (value == null) value = 0;\n"; +- +- code += " if (!values.containsKey(value)) {\n"; +- code += +- " throw new StateError('Invalid value $value for bit flag enum "; ++ code += " final result = values[value];\n"; ++ code += " if (result == null) {\n"; ++ code += " throw StateError('Invalid value $value for bit flag enum "; + code += name + "');\n"; + code += " }\n"; + +- code += " return values[value];\n"; ++ code += " return result;\n"; + code += " }\n\n"; + ++ code += " static " + name + "? _createOrNull(int? value) => \n"; ++ code += " value == null ? null : " + name + ".fromValue(value);\n\n"; ++ + // this is meaningless for bit_flags + // however, note that unlike "regular" dart enums this enum can still have + // holes. +@@ -263,19 +264,20 @@ + if (it != enum_def.Vals().begin()) { code += '\n'; } + GenDocComment(ev.doc_comment, &code, "", " "); + } +- code += " static const " + name + " " + ev.name + " = "; +- code += "const " + name + "._(" + enum_def.ToString(ev) + ");\n"; ++ code += " static const " + name + " " + ev.name + " = " + name + "._(" + ++ enum_def.ToString(ev) + ");\n"; + } + +- code += " static const Map values = {"; ++ code += " static const Map values = {\n"; + for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); ++it) { + auto &ev = **it; +- code += enum_def.ToString(ev) + ": " + ev.name + ","; ++ if (it != enum_def.Vals().begin()) code += ",\n"; ++ code += " " + enum_def.ToString(ev) + ": " + ev.name; + } + code += "};\n\n"; + +- code += " static const " + _kFb + ".Reader<" + name + +- "> reader = const _" + name + "Reader();\n\n"; ++ code += " static const " + _kFb + ".Reader<" + name + "> reader = _" + ++ name + "Reader();\n\n"; + code += " @override\n"; + code += " String toString() {\n"; + code += " return '" + name + "{value: $value}';\n"; +@@ -298,7 +300,7 @@ + code += " @override\n"; + code += + " " + name + " read(" + _kFb + ".BufferContext bc, int offset) =>\n"; +- code += " new " + name + ".fromValue(const " + _kFb + "." + ++ code += " " + name + ".fromValue(const " + _kFb + "." + + GenType(enum_def.underlying_type) + "Reader().read(bc, offset));\n"; + code += "}\n\n"; + } +@@ -327,30 +329,41 @@ + + std::string GenReaderTypeName(const Type &type, Namespace *current_namespace, + const FieldDef &def, +- bool parent_is_vector = false) { ++ bool parent_is_vector = false, bool lazy = true, ++ bool constConstruct = true) { ++ std::string prefix = (constConstruct ? "const " : "") + _kFb; + if (type.base_type == BASE_TYPE_BOOL) { +- return "const " + _kFb + ".BoolReader()"; ++ return prefix + ".BoolReader()"; + } else if (IsVector(type)) { +- return "const " + _kFb + ".ListReader<" + ++ if (!type.VectorType().enum_def) { ++ if (type.VectorType().base_type == BASE_TYPE_CHAR) { ++ return prefix + ".Int8ListReader(" + (lazy ? ")" : "lazy: false)"); ++ } ++ if (type.VectorType().base_type == BASE_TYPE_UCHAR) { ++ return prefix + ".Uint8ListReader(" + (lazy ? ")" : "lazy: false)"); ++ } ++ } ++ return prefix + ".ListReader<" + + GenDartTypeName(type.VectorType(), current_namespace, def) + ">(" + +- GenReaderTypeName(type.VectorType(), current_namespace, def, +- true) + +- ")"; ++ GenReaderTypeName(type.VectorType(), current_namespace, def, true, ++ true, false) + ++ (lazy ? ")" : ", lazy: false)"); + } else if (IsString(type)) { +- return "const " + _kFb + ".StringReader()"; ++ return prefix + ".StringReader()"; + } + if (IsScalar(type.base_type)) { + if (type.enum_def && parent_is_vector) { + return GenDartTypeName(type, current_namespace, def) + ".reader"; + } +- return "const " + _kFb + "." + GenType(type) + "Reader()"; ++ return prefix + "." + GenType(type) + "Reader()"; + } else { + return GenDartTypeName(type, current_namespace, def) + ".reader"; + } + } + + std::string GenDartTypeName(const Type &type, Namespace *current_namespace, +- const FieldDef &def, bool addBuilder = false) { ++ const FieldDef &def, ++ std::string struct_type_suffix = "") { + if (type.enum_def) { + if (type.enum_def->is_union && type.base_type != BASE_TYPE_UNION) { + return type.enum_def->name + "TypeId"; +@@ -375,18 +388,26 @@ + case BASE_TYPE_DOUBLE: return "double"; + case BASE_TYPE_STRING: return "String"; + case BASE_TYPE_STRUCT: +- return MaybeWrapNamespace( +- type.struct_def->name + (addBuilder ? "ObjectBuilder" : ""), +- current_namespace, def); ++ return MaybeWrapNamespace(type.struct_def->name + struct_type_suffix, ++ current_namespace, def); + case BASE_TYPE_VECTOR: + return "List<" + + GenDartTypeName(type.VectorType(), current_namespace, def, +- addBuilder) + ++ struct_type_suffix) + + ">"; + default: assert(0); return "dynamic"; + } + } + ++ std::string GenDartTypeName(const Type &type, Namespace *current_namespace, ++ const FieldDef &def, bool nullable, ++ std::string struct_type_suffix) { ++ std::string typeName = ++ GenDartTypeName(type, current_namespace, def, struct_type_suffix); ++ if (nullable && typeName != "dynamic") typeName += "?"; ++ return typeName; ++ } ++ + static const std::string MaybeWrapNamespace(const std::string &type_name, + Namespace *current_ns, + const FieldDef &field) { +@@ -432,15 +453,15 @@ + code += " " + object_name + "._(this._bc, this._bcOffset);\n"; + if (!struct_def.fixed) { + code += " factory " + object_name + "(List bytes) {\n"; +- code += " " + _kFb + ".BufferContext rootRef = new " + _kFb + +- ".BufferContext.fromBytes(bytes);\n"; ++ code += ++ " final rootRef = " + _kFb + ".BufferContext.fromBytes(bytes);\n"; + code += " return reader.read(rootRef, 0);\n"; + code += " }\n"; + } + + code += "\n"; + code += " static const " + _kFb + ".Reader<" + object_name + +- "> reader = const " + reader_name + "();\n\n"; ++ "> reader = " + reader_name + "();\n\n"; + + code += " final " + _kFb + ".BufferContext _bc;\n"; + code += " final int _bcOffset;\n\n"; +@@ -456,8 +477,23 @@ + + GenImplementationGetters(struct_def, non_deprecated_fields, &code); + ++ if (parser_.opts.generate_object_based_api) { ++ code += ++ "\n" + GenStructObjectAPIUnpack(struct_def, non_deprecated_fields); ++ ++ code += "\n static int pack(fb.Builder fbBuilder, " + struct_def.name + ++ "T? object) {\n"; ++ code += " if (object == null) return 0;\n"; ++ code += " return object.pack(fbBuilder);\n"; ++ code += " }\n"; ++ } ++ + code += "}\n\n"; + ++ if (parser_.opts.generate_object_based_api) { ++ code += GenStructObjectAPI(struct_def, non_deprecated_fields); ++ } ++ + GenReader(struct_def, &reader_name, &reader_code); + GenBuilder(struct_def, non_deprecated_fields, &builder_name, &builder_code); + GenObjectBuilder(struct_def, non_deprecated_fields, &object_builder_name, +@@ -469,6 +505,124 @@ + (*namespace_code)[object_namespace] += code; + } + ++ // Generate an accessor struct with constructor for a flatbuffers struct. ++ std::string GenStructObjectAPI( ++ const StructDef &struct_def, ++ const std::vector> &non_deprecated_fields) { ++ std::string code; ++ GenDocComment(struct_def.doc_comment, &code, ""); ++ ++ std::string class_name = struct_def.name + "T"; ++ code += "class " + class_name + " implements " + _kFb + ".Packable {\n"; ++ ++ std::string constructor_args; ++ for (auto it = non_deprecated_fields.begin(); ++ it != non_deprecated_fields.end(); ++it) { ++ const FieldDef &field = *it->second; ++ ++ std::string field_name = MakeCamel(field.name, false); ++ std::string defaultValue = getDefaultValue(field.value); ++ std::string type_name = ++ GenDartTypeName(field.value.type, struct_def.defined_namespace, field, ++ defaultValue.empty() && !struct_def.fixed, "T"); ++ ++ GenDocComment(field.doc_comment, &code, "", " "); ++ code += " " + type_name + " " + field_name + ";\n"; ++ ++ if (!constructor_args.empty()) constructor_args += ",\n"; ++ constructor_args += " "; ++ constructor_args += (struct_def.fixed ? "required " : ""); ++ constructor_args += "this." + field_name; ++ if (!struct_def.fixed && !defaultValue.empty()) { ++ if (IsEnum(field.value.type)) { ++ auto &enum_def = *field.value.type.enum_def; ++ for (auto enumIt = enum_def.Vals().begin(); ++ enumIt != enum_def.Vals().end(); ++enumIt) { ++ auto &ev = **enumIt; ++ if (enum_def.ToString(ev) == defaultValue) { ++ constructor_args += " = " + enum_def.name + "." + ev.name; ++ break; ++ } ++ } ++ } else { ++ constructor_args += " = " + defaultValue; ++ } ++ } ++ } ++ ++ if (!constructor_args.empty()) { ++ code += "\n " + class_name + "({\n" + constructor_args + "});\n\n"; ++ } ++ ++ code += GenStructObjectAPIPack(struct_def, non_deprecated_fields); ++ code += "\n"; ++ code += GenToString(class_name, non_deprecated_fields); ++ ++ code += "}\n\n"; ++ return code; ++ } ++ ++ // Generate function `StructNameT unpack()` ++ std::string GenStructObjectAPIUnpack( ++ const StructDef &struct_def, ++ const std::vector> &non_deprecated_fields) { ++ std::string constructor_args; ++ for (auto it = non_deprecated_fields.begin(); ++ it != non_deprecated_fields.end(); ++it) { ++ const FieldDef &field = *it->second; ++ ++ std::string field_name = MakeCamel(field.name, false); ++ if (!constructor_args.empty()) constructor_args += ",\n"; ++ constructor_args += " " + field_name + ": "; ++ ++ const Type &type = field.value.type; ++ std::string defaultValue = getDefaultValue(field.value); ++ bool isNullable = defaultValue.empty() && !struct_def.fixed; ++ std::string nullableValueAccessOperator = isNullable ? "?" : ""; ++ if (type.base_type == BASE_TYPE_STRUCT) { ++ constructor_args += ++ field_name + nullableValueAccessOperator + ".unpack()"; ++ } else if (type.base_type == BASE_TYPE_VECTOR) { ++ if (type.VectorType().base_type == BASE_TYPE_STRUCT) { ++ constructor_args += field_name + nullableValueAccessOperator + ++ ".map((e) => e.unpack()).toList()"; ++ } else { ++ constructor_args += ++ GenReaderTypeName(field.value.type, struct_def.defined_namespace, ++ field, false, false); ++ constructor_args += ".vTableGet"; ++ std::string offset = NumToString(field.value.offset); ++ constructor_args += ++ isNullable ++ ? "Nullable(_bc, _bcOffset, " + offset + ")" ++ : "(_bc, _bcOffset, " + offset + ", " + defaultValue + ")"; ++ } ++ } else { ++ constructor_args += field_name; ++ } ++ } ++ ++ std::string class_name = struct_def.name + "T"; ++ std::string code = " " + class_name + " unpack() => " + class_name + "("; ++ if (!constructor_args.empty()) code += "\n" + constructor_args; ++ code += ");\n"; ++ return code; ++ } ++ ++ // Generate function `StructNameT pack()` ++ std::string GenStructObjectAPIPack( ++ const StructDef &struct_def, ++ const std::vector> &non_deprecated_fields) { ++ std::string code; ++ ++ code += " @override\n"; ++ code += " int pack(fb.Builder fbBuilder) {\n"; ++ code += GenObjectBuilderImplementation(struct_def, non_deprecated_fields, ++ false, true); ++ code += " }\n"; ++ return code; ++ } ++ + std::string NamespaceAliasFromUnionType(Namespace *root_namespace, + const Type &type) { + const std::vector qualified_name_parts = +@@ -511,8 +665,11 @@ + auto &field = *pair.second; + + std::string field_name = MakeCamel(field.name, false); +- std::string type_name = GenDartTypeName( +- field.value.type, struct_def.defined_namespace, field, false); ++ std::string defaultValue = getDefaultValue(field.value); ++ bool isNullable = defaultValue.empty() && !struct_def.fixed; ++ std::string type_name = ++ GenDartTypeName(field.value.type, struct_def.defined_namespace, field, ++ isNullable, ""); + + GenDocComment(field.doc_comment, &code, "", " "); + +@@ -528,8 +685,8 @@ + auto enum_name = NamespaceAliasFromUnionType( + enum_def.defined_namespace, ev.union_type); + code += " case " + enum_def.ToString(ev) + ": return " + +- enum_name + ".reader.vTableGet(_bc, _bcOffset, " + +- NumToString(field.value.offset) + ", null);\n"; ++ enum_name + ".reader.vTableGetNullable(_bc, _bcOffset, " + ++ NumToString(field.value.offset) + ");\n"; + } + code += " default: return null;\n"; + code += " }\n"; +@@ -538,10 +695,9 @@ + code += " => "; + if (field.value.type.enum_def && + field.value.type.base_type != BASE_TYPE_VECTOR) { +- code += "new " + +- GenDartTypeName(field.value.type, ++ code += GenDartTypeName(field.value.type, + struct_def.defined_namespace, field) + +- ".fromValue("; ++ (isNullable ? "._createOrNull(" : ".fromValue("); + } + + code += GenReaderTypeName(field.value.type, +@@ -550,33 +706,13 @@ + code += + ".read(_bc, _bcOffset + " + NumToString(field.value.offset) + ")"; + } else { +- code += ".vTableGet(_bc, _bcOffset, " + +- NumToString(field.value.offset) + ", "; +- if (!field.value.constant.empty() && field.value.constant != "0") { +- if (IsBool(field.value.type.base_type)) { +- code += "true"; +- } else if (field.value.constant == "nan" || +- field.value.constant == "+nan" || +- field.value.constant == "-nan") { +- code += "double.nan"; +- } else if (field.value.constant == "inf" || +- field.value.constant == "+inf") { +- code += "double.infinity"; +- } else if (field.value.constant == "-inf") { +- code += "double.negativeInfinity"; +- } else { +- code += field.value.constant; +- } ++ code += ".vTableGet"; ++ std::string offset = NumToString(field.value.offset); ++ if (isNullable) { ++ code += "Nullable(_bc, _bcOffset, " + offset + ")"; + } else { +- if (IsBool(field.value.type.base_type)) { +- code += "false"; +- } else if (IsScalar(field.value.type.base_type)) { +- code += "0"; +- } else { +- code += "null"; +- } ++ code += "(_bc, _bcOffset, " + offset + ", " + defaultValue + ")"; + } +- code += ")"; + } + if (field.value.type.enum_def && + field.value.type.base_type != BASE_TYPE_VECTOR) { +@@ -587,10 +723,16 @@ + } + + code += "\n"; ++ code += GenToString(struct_def.name, non_deprecated_fields); ++ } + ++ std::string GenToString( ++ const std::string &object_name, ++ const std::vector> &non_deprecated_fields) { ++ std::string code; + code += " @override\n"; + code += " String toString() {\n"; +- code += " return '" + struct_def.name + "{"; ++ code += " return '" + object_name + "{"; + for (auto it = non_deprecated_fields.begin(); + it != non_deprecated_fields.end(); ++it) { + auto pair = *it; +@@ -601,6 +743,30 @@ + } + code += "}';\n"; + code += " }\n"; ++ return code; ++ } ++ ++ std::string getDefaultValue(const Value &value) const { ++ if (!value.constant.empty() && value.constant != "0") { ++ if (IsBool(value.type.base_type)) { ++ return "true"; ++ } else if (value.constant == "nan" || value.constant == "+nan" || ++ value.constant == "-nan") { ++ return "double.nan"; ++ } else if (value.constant == "inf" || value.constant == "+inf") { ++ return "double.infinity"; ++ } else if (value.constant == "-inf") { ++ return "double.negativeInfinity"; ++ } else { ++ return value.constant; ++ } ++ } else if (IsBool(value.type.base_type)) { ++ return "false"; ++ } else if (IsScalar(value.type.base_type) && !IsUnion(value.type)) { ++ return "0"; ++ } else { ++ return ""; ++ } + } + + void GenReader(const StructDef &struct_def, std::string *reader_name_ptr, +@@ -624,7 +790,7 @@ + } + code += " @override\n"; + code += " " + impl_name + +- " createObject(fb.BufferContext bc, int offset) => \n new " + ++ " createObject(fb.BufferContext bc, int offset) => \n " + + impl_name + "._(bc, offset);\n"; + code += "}\n\n"; + } +@@ -637,9 +803,7 @@ + auto &builder_name = *builder_name_ptr; + + code += "class " + builder_name + " {\n"; +- code += " " + builder_name + "(this.fbBuilder) {\n"; +- code += " assert(fbBuilder != null);\n"; +- code += " }\n\n"; ++ code += " " + builder_name + "(this.fbBuilder);\n\n"; + code += " final " + _kFb + ".Builder fbBuilder;\n\n"; + + if (struct_def.fixed) { +@@ -688,7 +852,7 @@ + } else { + code += " fbBuilder.put" + GenType(field.value.type) + "("; + code += field.name; +- if (field.value.type.enum_def) { code += "?.value"; } ++ if (field.value.type.enum_def) { code += ".value"; } + code += ");\n"; + } + } +@@ -703,7 +867,8 @@ + auto &code = *code_ptr; + + code += " void begin() {\n"; +- code += " fbBuilder.startTable();\n"; ++ code += " fbBuilder.startTable(" + ++ NumToString(non_deprecated_fields.size()) + ");\n"; + code += " }\n\n"; + + for (auto it = non_deprecated_fields.begin(); +@@ -716,7 +881,7 @@ + code += " int add" + MakeCamel(field.name) + "("; + code += GenDartTypeName(field.value.type, struct_def.defined_namespace, + field); +- code += " " + MakeCamel(field.name, false) + ") {\n"; ++ code += "? " + MakeCamel(field.name, false) + ") {\n"; + code += " fbBuilder.add" + GenType(field.value.type) + "(" + + NumToString(offset) + ", "; + code += MakeCamel(field.name, false); +@@ -727,7 +892,7 @@ + code += + " fbBuilder.addStruct(" + NumToString(offset) + ", offset);\n"; + } else { +- code += " int add" + MakeCamel(field.name) + "Offset(int offset) {\n"; ++ code += " int add" + MakeCamel(field.name) + "Offset(int? offset) {\n"; + code += + " fbBuilder.addOffset(" + NumToString(offset) + ", offset);\n"; + } +@@ -756,7 +921,7 @@ + + code += " final " + + GenDartTypeName(field.value.type, struct_def.defined_namespace, +- field, true) + ++ field, !struct_def.fixed, "ObjectBuilder") + + " _" + MakeCamel(field.name, false) + ";\n"; + } + code += "\n"; +@@ -769,9 +934,10 @@ + auto pair = *it; + auto &field = *pair.second; + +- code += " " + ++ code += " "; ++ code += (struct_def.fixed ? "required " : "") + + GenDartTypeName(field.value.type, struct_def.defined_namespace, +- field, true) + ++ field, !struct_def.fixed, "ObjectBuilder") + + " " + MakeCamel(field.name, false) + ",\n"; + } + code += " })\n"; +@@ -795,75 +961,101 @@ + + code += " /// Finish building, and store into the [fbBuilder].\n"; + code += " @override\n"; +- code += " int finish(\n"; +- code += " " + _kFb + ".Builder fbBuilder) {\n"; +- code += " assert(fbBuilder != null);\n"; ++ code += " int finish(" + _kFb + ".Builder fbBuilder) {\n"; ++ code += GenObjectBuilderImplementation(struct_def, non_deprecated_fields); ++ code += " }\n\n"; + ++ code += " /// Convenience method to serialize to byte list.\n"; ++ code += " @override\n"; ++ code += " Uint8List toBytes([String? fileIdentifier]) {\n"; ++ code += " final fbBuilder = " + _kFb + ++ ".Builder(deduplicateTables: false);\n"; ++ code += " fbBuilder.finish(finish(fbBuilder), fileIdentifier);\n"; ++ code += " return fbBuilder.buffer;\n"; ++ code += " }\n"; ++ code += "}\n"; ++ } ++ ++ std::string GenObjectBuilderImplementation( ++ const StructDef &struct_def, ++ const std::vector> &non_deprecated_fields, ++ bool prependUnderscore = true, bool pack = false) { ++ std::string code; + for (auto it = non_deprecated_fields.begin(); + it != non_deprecated_fields.end(); ++it) { +- auto pair = *it; +- auto &field = *pair.second; ++ const FieldDef &field = *it->second; + + if (IsScalar(field.value.type.base_type) || IsStruct(field.value.type)) + continue; + +- code += " final int " + MakeCamel(field.name, false) + "Offset"; +- if (IsVector(field.value.type)) { ++ std::string offset_name = MakeCamel(field.name, false) + "Offset"; ++ std::string field_name = ++ (prependUnderscore ? "_" : "") + MakeCamel(field.name, false); ++ ++ // custom handling for fixed-sized struct in pack() ++ if (pack && IsVector(field.value.type) && ++ field.value.type.VectorType().base_type == BASE_TYPE_STRUCT && ++ field.value.type.struct_def->fixed) { ++ code += " int? " + offset_name + ";\n"; ++ code += " if (" + field_name + " != null) {\n"; + code += +- " = _" + MakeCamel(field.name, false) + "?.isNotEmpty == true\n"; +- code += " ? fbBuilder.writeList"; ++ " for (var e in " + field_name + "!) { e.pack(fbBuilder); }\n"; ++ code += " " + MakeCamel(field.name, false) + ++ "Offset = fbBuilder.endStructVector(" + field_name + ++ "!.length);\n"; ++ code += " }\n"; ++ continue; ++ } ++ ++ code += " final int? " + offset_name; ++ if (IsVector(field.value.type)) { ++ code += " = " + field_name + " == null ? null\n"; ++ code += " : fbBuilder.writeList"; + switch (field.value.type.VectorType().base_type) { + case BASE_TYPE_STRING: +- code += "(_" + MakeCamel(field.name, false) + +- ".map((b) => fbBuilder.writeString(b)).toList())"; ++ code += ++ "(" + field_name + "!.map(fbBuilder.writeString).toList());\n"; + break; + case BASE_TYPE_STRUCT: + if (field.value.type.struct_def->fixed) { +- code += "OfStructs(_" + MakeCamel(field.name, false) + ")"; ++ code += "OfStructs(" + field_name + "!);\n"; + } else { +- code += "(_" + MakeCamel(field.name, false) + +- ".map((b) => b.getOrCreateOffset(fbBuilder)).toList())"; ++ code += "(" + field_name + "!.map((b) => b." + ++ (pack ? "pack" : "getOrCreateOffset") + ++ "(fbBuilder)).toList());\n"; + } + break; + default: +- code += GenType(field.value.type.VectorType()) + "(_" + +- MakeCamel(field.name, false); +- if (field.value.type.enum_def) { code += ".map((f) => f.value)"; } +- code += ")"; ++ code += ++ GenType(field.value.type.VectorType()) + "(" + field_name + "!"; ++ if (field.value.type.enum_def) { ++ code += ".map((f) => f.value).toList()"; ++ } ++ code += ");\n"; + } +- code += "\n : null;\n"; + } else if (IsString(field.value.type)) { +- code += " = fbBuilder.writeString(_" + MakeCamel(field.name, false) + +- ");\n"; ++ code += " = " + field_name + " == null ? null\n"; ++ code += " : fbBuilder.writeString(" + field_name + "!);\n"; + } else { +- code += " = _" + MakeCamel(field.name, false) + +- "?.getOrCreateOffset(fbBuilder);\n"; ++ code += " = " + field_name + "?." + ++ (pack ? "pack" : "getOrCreateOffset") + "(fbBuilder);\n"; + } + } + +- code += "\n"; + if (struct_def.fixed) { +- StructObjectBuilderBody(non_deprecated_fields, code_ptr); ++ code += StructObjectBuilderBody(non_deprecated_fields, prependUnderscore, ++ pack); + } else { +- TableObjectBuilderBody(non_deprecated_fields, code_ptr); ++ code += TableObjectBuilderBody(non_deprecated_fields, prependUnderscore, ++ pack); + } +- code += " }\n\n"; +- +- code += " /// Convenience method to serialize to byte list.\n"; +- code += " @override\n"; +- code += " Uint8List toBytes([String fileIdentifier]) {\n"; +- code += " " + _kFb + ".Builder fbBuilder = new "; +- code += _kFb + ".Builder();\n"; +- code += " int offset = finish(fbBuilder);\n"; +- code += " return fbBuilder.finish(offset, fileIdentifier);\n"; +- code += " }\n"; +- code += "}\n"; ++ return code; + } + +- void StructObjectBuilderBody( +- std::vector> non_deprecated_fields, +- std::string *code_ptr, bool prependUnderscore = true) { +- auto &code = *code_ptr; ++ std::string StructObjectBuilderBody( ++ const std::vector> &non_deprecated_fields, ++ bool prependUnderscore = true, bool pack = false) { ++ std::string code; + + for (auto it = non_deprecated_fields.rbegin(); + it != non_deprecated_fields.rend(); ++it) { +@@ -877,24 +1069,26 @@ + if (IsStruct(field.value.type)) { + code += " "; + if (prependUnderscore) { code += "_"; } +- code += field.name + ".finish(fbBuilder);\n"; ++ code += field.name + (pack ? ".pack" : ".finish") + "(fbBuilder);\n"; + } else { + code += " fbBuilder.put" + GenType(field.value.type) + "("; + if (prependUnderscore) { code += "_"; } + code += field.name; +- if (field.value.type.enum_def) { code += "?.value"; } ++ if (field.value.type.enum_def) { code += ".value"; } + code += ");\n"; + } + } + + code += " return fbBuilder.offset;\n"; ++ return code; + } + +- void TableObjectBuilderBody( +- std::vector> non_deprecated_fields, +- std::string *code_ptr, bool prependUnderscore = true) { +- std::string &code = *code_ptr; +- code += " fbBuilder.startTable();\n"; ++ std::string TableObjectBuilderBody( ++ const std::vector> &non_deprecated_fields, ++ bool prependUnderscore = true, bool pack = false) { ++ std::string code; ++ code += " fbBuilder.startTable(" + ++ NumToString(non_deprecated_fields.size()) + ");\n"; + + for (auto it = non_deprecated_fields.begin(); + it != non_deprecated_fields.end(); ++it) { +@@ -902,29 +1096,29 @@ + auto &field = *pair.second; + auto offset = pair.first; + ++ std::string field_name = ++ (prependUnderscore ? "_" : "") + MakeCamel(field.name, false); ++ + if (IsScalar(field.value.type.base_type)) { + code += " fbBuilder.add" + GenType(field.value.type) + "(" + +- NumToString(offset) + ", "; +- if (prependUnderscore) { code += "_"; } +- code += MakeCamel(field.name, false); +- if (field.value.type.enum_def) { code += "?.value"; } ++ NumToString(offset) + ", " + field_name; ++ if (field.value.type.enum_def) { ++ bool isNullable = getDefaultValue(field.value).empty(); ++ code += (isNullable || !pack) ? "?.value" : ".value"; ++ } + code += ");\n"; + } else if (IsStruct(field.value.type)) { +- code += " if ("; +- if (prependUnderscore) { code += "_"; } +- code += MakeCamel(field.name, false) + " != null) {\n"; +- code += " fbBuilder.addStruct(" + NumToString(offset) + ", "; +- code += "_" + MakeCamel(field.name, false) + ".finish(fbBuilder));\n"; ++ code += " if (" + field_name + " != null) {\n"; ++ code += " fbBuilder.addStruct(" + NumToString(offset) + ", " + ++ field_name + (pack ? "!.pack" : "!.finish") + "(fbBuilder));\n"; + code += " }\n"; + } else { +- code += +- " if (" + MakeCamel(field.name, false) + "Offset != null) {\n"; +- code += " fbBuilder.addOffset(" + NumToString(offset) + ", " + ++ code += " fbBuilder.addOffset(" + NumToString(offset) + ", " + + MakeCamel(field.name, false) + "Offset);\n"; +- code += " }\n"; + } + } + code += " return fbBuilder.endTable();\n"; ++ return code; + } + }; + } // namespace dart +@@ -937,8 +1131,6 @@ + + std::string DartMakeRule(const Parser &parser, const std::string &path, + const std::string &file_name) { +- assert(parser.opts.lang <= IDLOptions::kMAX); +- + auto filebase = + flatbuffers::StripPath(flatbuffers::StripExtension(file_name)); + dart::DartGenerator generator(parser, path, file_name); +diff -urN a/src/idl_gen_grpc.cpp b/src/idl_gen_grpc.cpp +--- a/src/idl_gen_grpc.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_grpc.cpp 2023-01-13 07:47:08.833251631 +0000 +@@ -191,7 +191,7 @@ + } + } + +- void SetIndentationSize(const int size) { ++ void SetIndentationSize(const size_t size) { + FLATBUFFERS_ASSERT(str_->empty()); + indentation_size_ = size; + } +@@ -199,15 +199,15 @@ + void Indent() { indent_++; } + + void Outdent() { ++ FLATBUFFERS_ASSERT(indent_ > 0); + indent_--; +- FLATBUFFERS_ASSERT(indent_ >= 0); + } + + private: + std::string *str_; + char escape_char_; +- int indent_; +- int indentation_size_; ++ size_t indent_; ++ size_t indentation_size_; + char indentation_type_; + }; + +@@ -242,7 +242,9 @@ + return StripExtension(file_name_); + } + +- std::string message_header_ext() const { return "_generated.h"; } ++ std::string message_header_ext() const { ++ return parser_.opts.filename_suffix + ".h"; ++ } + + std::string service_header_ext() const { return ".grpc.fb.h"; } + +diff -urN a/src/idl_gen_java.cpp b/src/idl_gen_java.cpp +--- a/src/idl_gen_java.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_java.cpp 2023-01-13 07:47:08.894252193 +0000 +@@ -21,10 +21,6 @@ + #include "flatbuffers/idl.h" + #include "flatbuffers/util.h" + +-#if defined(FLATBUFFERS_CPP98_STL) +-# include +-#endif // defined(FLATBUFFERS_CPP98_STL) +- + namespace flatbuffers { + namespace java { + +@@ -39,6 +35,11 @@ + }; + + class JavaGenerator : public BaseGenerator { ++ struct FieldArrayLength { ++ std::string name; ++ int length; ++ }; ++ + public: + JavaGenerator(const Parser &parser, const std::string &path, + const std::string &file_name) +@@ -63,6 +64,19 @@ + /* needs_includes= */ false)) + return false; + } ++ ++ if (parser_.opts.generate_object_based_api && enum_def.is_union) { ++ enumcode = ""; ++ GenEnum_ObjectAPI(enum_def, &enumcode, parser_.opts); ++ auto class_name = enum_def.name + "Union"; ++ if (parser_.opts.one_file) { ++ one_file_code += enumcode; ++ } else { ++ if (!SaveType(class_name, *enum_def.defined_namespace, enumcode, ++ /* needs_includes= */ false)) ++ return false; ++ } ++ } + } + + for (auto it = parser_.structs_.vec.begin(); +@@ -71,7 +85,7 @@ + auto &struct_def = **it; + if (!parser_.opts.one_file) + cur_name_space_ = struct_def.defined_namespace; +- GenStruct(struct_def, &declcode); ++ GenStruct(struct_def, &declcode, parser_.opts); + if (parser_.opts.one_file) { + one_file_code += declcode; + } else { +@@ -79,6 +93,19 @@ + /* needs_includes= */ true)) + return false; + } ++ ++ if (parser_.opts.generate_object_based_api) { ++ declcode = ""; ++ GenStruct_ObjectAPI(struct_def, &declcode, parser_.opts); ++ auto class_name = GenTypeName_ObjectAPI(struct_def.name, parser_.opts); ++ if (parser_.opts.one_file) { ++ one_file_code += declcode; ++ } else { ++ if (!SaveType(class_name, *struct_def.defined_namespace, declcode, ++ /* needs_includes= */ true)) ++ return false; ++ } ++ } + } + + if (parser_.opts.one_file) { +@@ -231,11 +258,11 @@ + } else { + if (castFromDest) { + if (type.base_type == BASE_TYPE_UINT) +- return "(int)"; ++ return "(int) "; + else if (type.base_type == BASE_TYPE_USHORT) +- return "(short)"; ++ return "(short) "; + else if (type.base_type == BASE_TYPE_UCHAR) +- return "(byte)"; ++ return "(byte) "; + } + } + return ""; +@@ -304,6 +331,7 @@ + // That, and Java Enums are expensive, and not universally liked. + GenComment(enum_def.doc_comment, code_ptr, &comment_config); + ++ code += "@SuppressWarnings(\"unused\")\n"; + if (enum_def.attributes.Lookup("private")) { + // For Java, we leave the enum unmarked to indicate package-private + } else { +@@ -323,7 +351,7 @@ + code += ";\n"; + } + +- // Generate a generate string table for enum values. ++ // Generate a string table for enum values. + // Problem is, if values are very sparse that could generate really big + // tables. Ideally in that case we generate a map lookup instead, but for + // the moment we simply don't output a table at all. +@@ -331,7 +359,9 @@ + // Average distance between values above which we consider a table + // "too sparse". Change at will. + static const uint64_t kMaxSparseness = 5; +- if (range / static_cast(enum_def.size()) < kMaxSparseness) { ++ if (range / static_cast(enum_def.size()) < kMaxSparseness && ++ GenTypeBasic(DestinationType(enum_def.underlying_type, false)) != ++ "long") { + code += "\n public static final String"; + code += "[] names = { "; + auto val = enum_def.Vals().front(); +@@ -433,7 +463,7 @@ + (nameprefix + (field.name + "_")).c_str(), array_cnt); + } else { + code += ", "; +- code += GenTypeBasic(type); ++ code += GenTypeNameDest(field.value.type); + for (size_t i = 0; i < array_cnt; i++) code += "[]"; + code += " "; + code += nameprefix; +@@ -560,7 +590,8 @@ + return key_getter; + } + +- void GenStruct(StructDef &struct_def, std::string *code_ptr) const { ++ void GenStruct(StructDef &struct_def, std::string *code_ptr, ++ const IDLOptions &opts) const { + if (struct_def.generated) return; + std::string &code = *code_ptr; + +@@ -668,7 +699,7 @@ + code += MakeCamel(field.name, false); + code += "(new "; + code += type_name + "()); }\n"; +- } else if (IsVector(field.value.type) && ++ } else if (IsSeries(field.value.type) && + field.value.type.element == BASE_TYPE_STRUCT) { + // Accessors for vectors of structs also take accessor objects, this + // generates a variant without that argument. +@@ -937,8 +968,11 @@ + } + } + code += "\n"; ++ auto struct_has_create = false; ++ std::set field_has_create_set; + flatbuffers::FieldDef *key_field = nullptr; + if (struct_def.fixed) { ++ struct_has_create = true; + // create a struct constructor function + code += " public static " + GenOffsetType() + " "; + code += "create"; +@@ -968,6 +1002,7 @@ + // JVM specifications restrict default constructor params to be < 255. + // Longs and doubles take up 2 units, so we set the limit to be < 127. + if (has_no_struct_fields && num_fields && num_fields < 127) { ++ struct_has_create = true; + // Generate a table constructor of the form: + // public static int createName(FlatBufferBuilder builder, args...) + code += " public static " + GenOffsetType() + " "; +@@ -976,11 +1011,12 @@ + for (auto it = struct_def.fields.vec.begin(); + it != struct_def.fields.vec.end(); ++it) { + auto &field = **it; ++ auto field_name = MakeCamel(field.name, false); + if (field.deprecated) continue; + code += ",\n "; + code += GenTypeBasic(DestinationType(field.value.type, false)); + code += " "; +- code += field.name; ++ code += field_name; + if (!IsScalar(field.value.type.base_type)) code += "Offset"; + } + code += ") {\n builder."; +@@ -991,12 +1027,14 @@ + for (auto it = struct_def.fields.vec.rbegin(); + it != struct_def.fields.vec.rend(); ++it) { + auto &field = **it; ++ auto field_name = MakeCamel(field.name, false); ++ auto method_name = MakeCamel(field.name, true); + if (!field.deprecated && + (!struct_def.sortbysize || + size == SizeOf(field.value.type.base_type))) { + code += " " + struct_def.name + "."; + code += "add"; +- code += MakeCamel(field.name) + "(builder, " + field.name; ++ code += method_name + "(builder, " + field_name; + if (!IsScalar(field.value.type.base_type)) code += "Offset"; + code += ");\n"; + } +@@ -1041,6 +1079,7 @@ + auto alignment = InlineAlignment(vector_type); + auto elem_size = InlineSize(vector_type); + if (!IsStruct(vector_type)) { ++ field_has_create_set.insert(&field); + // generate a method to create a vector from a java array. + if ((vector_type.base_type == BASE_TYPE_CHAR || + vector_type.base_type == BASE_TYPE_UCHAR)) { +@@ -1061,7 +1100,8 @@ + code += "create"; + code += MakeCamel(field.name); + code += "Vector(FlatBufferBuilder builder, "; +- code += GenTypeBasic(vector_type) + "[] data) "; ++ code += GenTypeBasic(DestinationType(vector_type, false)) + ++ "[] data) "; + code += "{ builder.startVector("; + code += NumToString(elem_size); + code += ", data.length, "; +@@ -1071,7 +1111,7 @@ + code += "add"; + code += GenMethod(vector_type); + code += "("; +- code += SourceCastBasic(vector_type, false); ++ code += SourceCastBasic(vector_type); + code += "data[i]"; + code += "); return "; + code += "builder.endVector(); }\n"; +@@ -1157,8 +1197,11 @@ + code += " }\n"; + } + GenVectorAccessObject(struct_def, code_ptr); +- code += "}"; +- code += "\n\n"; ++ if (opts.generate_object_based_api) { ++ GenPackUnPack_ObjectAPI(struct_def, code_ptr, opts, struct_has_create, ++ field_has_create_set); ++ } ++ code += "}\n\n"; + } + + std::string GenOptionalScalarCheck(FieldDef &field) const { +@@ -1229,6 +1272,866 @@ + code += " }\n"; + } + ++ std::string GenGetterFuncName_ObjectAPI(const std::string &field_name) const { ++ return "get" + MakeCamel(field_name, true); ++ } ++ ++ void GenEnum_ObjectAPI(EnumDef &enum_def, std::string *code_ptr, ++ const IDLOptions &opts) const { ++ auto &code = *code_ptr; ++ if (enum_def.generated) return; ++ code += "import com.google.flatbuffers.FlatBufferBuilder;\n\n"; ++ ++ if (!enum_def.attributes.Lookup("private")) { code += "public "; } ++ auto union_name = enum_def.name + "Union"; ++ auto union_type = ++ GenTypeBasic(DestinationType(enum_def.underlying_type, false)); ++ code += "class " + union_name + " {\n"; ++ // Type ++ code += " private " + union_type + " type;\n"; ++ // Value ++ code += " private Object value;\n"; ++ code += "\n"; ++ // getters and setters ++ code += " public " + union_type + " getType() { return type; }\n\n"; ++ code += " public void setType(" + union_type + ++ " type) { this.type = type; }\n\n"; ++ code += " public Object getValue() { return value; }\n\n"; ++ code += " public void setValue(Object value) { this.value = value; }\n\n"; ++ // Constructor ++ code += " public " + union_name + "() {\n"; ++ code += " this.type = " + enum_def.name + "." + ++ enum_def.Vals()[0]->name + ";\n"; ++ code += " this.value = null;\n"; ++ code += " }\n\n"; ++ // As ++ for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); ++it) { ++ auto &ev = **it; ++ if (ev.union_type.base_type == BASE_TYPE_NONE) continue; ++ auto type_name = GenTypeGet_ObjectAPI(ev.union_type, opts, false, true); ++ if (ev.union_type.base_type == BASE_TYPE_STRUCT && ++ ev.union_type.struct_def->attributes.Lookup("private")) { ++ code += " "; ++ } else { ++ code += " public "; ++ } ++ code += type_name + " as" + ev.name + "() { return (" + type_name + ++ ") value; }\n"; ++ } ++ code += "\n"; ++ // pack() ++ code += " public static int pack(FlatBufferBuilder builder, " + ++ union_name + " _o) {\n"; ++ code += " switch (_o.type) {\n"; ++ for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); ++it) { ++ auto &ev = **it; ++ if (ev.union_type.base_type == BASE_TYPE_NONE) { ++ continue; ++ } else { ++ code += " case " + enum_def.name + "." + ev.name + ": return "; ++ if (IsString(ev.union_type)) { ++ code += "builder.createString(_o.as" + ev.name + "());\n"; ++ } else { ++ code += GenTypeGet(ev.union_type) + ".pack(builder, _o.as" + ev.name + ++ "());\n"; ++ } ++ } ++ } ++ code += " default: return 0;\n"; ++ code += " }\n"; ++ code += " }\n"; ++ code += "}\n\n"; ++ } ++ ++ std::string GenSetterFuncName_ObjectAPI(const std::string &field_name) const { ++ return "set" + MakeCamel(field_name, true); ++ } ++ ++ std::string GenTypeName_ObjectAPI(const std::string &name, ++ const IDLOptions &opts) const { ++ return opts.object_prefix + name + opts.object_suffix; ++ } ++ ++ void GenUnionUnPack_ObjectAPI(const EnumDef &enum_def, std::string *code_ptr, ++ const std::string &type_name, ++ const std::string &camel_name, ++ bool is_vector) const { ++ auto &code = *code_ptr; ++ ++ std::string variable_type = type_name; ++ std::string variable_name = "_o" + MakeCamel(camel_name, true); ++ std::string type_params = ""; ++ std::string value_params = ""; ++ std::string func_suffix = "()"; ++ std::string indent = " "; ++ if (is_vector) { ++ variable_type = type_name.substr(0, type_name.length() - 2); ++ variable_name += "Element"; ++ type_params = "_j"; ++ value_params = ", _j"; ++ func_suffix = "(_j)"; ++ indent = " "; ++ } ++ code += indent + variable_type + " " + variable_name + " = new " + ++ variable_type + "();\n"; ++ code += indent + ++ GenTypeBasic(DestinationType(enum_def.underlying_type, false)) + ++ " " + variable_name + "Type = " + camel_name + "Type(" + ++ type_params + ");\n"; ++ code += indent + variable_name + ".setType(" + variable_name + "Type);\n"; ++ code += indent + "Table " + variable_name + "Value;\n"; ++ code += indent + "switch (" + variable_name + "Type) {\n"; ++ for (auto eit = enum_def.Vals().begin(); eit != enum_def.Vals().end(); ++ ++eit) { ++ auto &ev = **eit; ++ if (ev.union_type.base_type == BASE_TYPE_NONE) { ++ continue; ++ } else { ++ if (ev.union_type.base_type == BASE_TYPE_STRING || ++ (ev.union_type.base_type == BASE_TYPE_STRUCT && ++ ev.union_type.struct_def->fixed)) { ++ continue; // This branch is due to bad implemantation of Unions in ++ // Java which doesn't handle non Table types. Should be ++ // deleted when issue #6561 is fixed. ++ } ++ code += indent + " case " + WrapInNameSpace(enum_def) + "." + ev.name + ++ ":\n"; ++ auto actual_type = GenTypeGet(ev.union_type); ++ code += indent + " " + variable_name + "Value = " + camel_name + ++ "(new " + actual_type + "()" + value_params + ");\n"; ++ code += indent + " " + variable_name + ".setValue(" + variable_name + ++ "Value != null ? ((" + actual_type + ") " + variable_name + ++ "Value).unpack() : null);\n"; ++ code += indent + " break;\n"; ++ } ++ } ++ code += indent + " default: break;\n"; ++ code += indent + "}\n"; ++ if (is_vector) { ++ code += indent + "_o" + MakeCamel(camel_name, true) + ++ "[_j] = " + variable_name + ";\n"; ++ } ++ } ++ ++ void GenPackUnPack_ObjectAPI( ++ StructDef &struct_def, std::string *code_ptr, const IDLOptions &opts, ++ bool struct_has_create, ++ const std::set &field_has_create) const { ++ auto &code = *code_ptr; ++ auto struct_name = GenTypeName_ObjectAPI(struct_def.name, opts); ++ // unpack() ++ code += " public " + struct_name + " unpack() {\n"; ++ code += " " + struct_name + " _o = new " + struct_name + "();\n"; ++ code += " unpackTo(_o);\n"; ++ code += " return _o;\n"; ++ code += " }\n"; ++ // unpackTo() ++ code += " public void unpackTo(" + struct_name + " _o) {\n"; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ if (field.deprecated) continue; ++ if (field.value.type.base_type == BASE_TYPE_UTYPE) continue; ++ if (field.value.type.element == BASE_TYPE_UTYPE) continue; ++ auto camel_name = MakeCamel(field.name, false); ++ auto camel_name_with_first = MakeCamel(field.name, true); ++ auto type_name = ++ GenTypeGet_ObjectAPI(field.value.type, opts, false, true); ++ if (field.IsScalarOptional()) ++ type_name = ConvertPrimitiveTypeToObjectWrapper_ObjectAPI(type_name); ++ auto start = " " + type_name + " _o" + camel_name_with_first + " = "; ++ auto call_setter = true; ++ switch (field.value.type.base_type) { ++ case BASE_TYPE_STRUCT: { ++ auto fixed = struct_def.fixed && field.value.type.struct_def->fixed; ++ if (fixed) { ++ code += " " + camel_name + "().unpackTo(_o.get" + ++ camel_name_with_first + "());\n"; ++ } else { ++ code += " if (" + camel_name + "() != null) "; ++ if (field.value.type.struct_def->fixed) { ++ code += camel_name + "().unpackTo(_o.get" + ++ camel_name_with_first + "());\n"; ++ } else { ++ code += "_o." + GenSetterFuncName_ObjectAPI(field.name) + "(" + ++ camel_name + "().unpack());\n"; ++ } ++ code += " else _o." + GenSetterFuncName_ObjectAPI(field.name) + ++ "(null);\n"; ++ } ++ call_setter = false; ++ break; ++ } ++ case BASE_TYPE_ARRAY: { ++ auto length_str = NumToString(field.value.type.fixed_length); ++ auto unpack_method = ++ field.value.type.struct_def == nullptr ? "" : ".unpack()"; ++ code += ++ start + "_o." + GenGetterFuncName_ObjectAPI(field.name) + "();\n"; ++ code += " for (int _j = 0; _j < " + length_str + "; ++_j) { _o" + ++ camel_name_with_first + "[_j] = " + camel_name + "(_j)" + ++ unpack_method + "; }\n"; ++ call_setter = false; ++ break; ++ } ++ case BASE_TYPE_VECTOR: ++ if (field.value.type.element == BASE_TYPE_UNION) { ++ code += start + "new " + ++ GenConcreteTypeGet_ObjectAPI(field.value.type, opts) ++ .substr(0, type_name.length() - 1) + ++ camel_name + "Length()];\n"; ++ code += " for (int _j = 0; _j < " + camel_name + ++ "Length(); ++_j) {\n"; ++ GenUnionUnPack_ObjectAPI(*field.value.type.enum_def, code_ptr, ++ type_name, camel_name, true); ++ code += " }\n"; ++ } else if (field.value.type.element != BASE_TYPE_UTYPE) { ++ auto fixed = field.value.type.struct_def == nullptr; ++ code += start + "new " + ++ GenConcreteTypeGet_ObjectAPI(field.value.type, opts) ++ .substr(0, type_name.length() - 1) + ++ camel_name + "Length()];\n"; ++ code += ++ " for (int _j = 0; _j < " + camel_name + "Length(); ++_j) {"; ++ code += "_o" + camel_name_with_first + "[_j] = "; ++ if (fixed) { ++ code += camel_name + "(_j)"; ++ } else { ++ code += "(" + camel_name + "(_j) != null ? " + camel_name + ++ "(_j).unpack() : null)"; ++ } ++ code += ";}\n"; ++ } ++ break; ++ case BASE_TYPE_UTYPE: break; ++ case BASE_TYPE_UNION: { ++ GenUnionUnPack_ObjectAPI(*field.value.type.enum_def, code_ptr, ++ type_name, camel_name, false); ++ break; ++ } ++ default: { ++ if (field.IsScalarOptional()) { ++ code += start + "has" + camel_name_with_first + "() ? " + ++ camel_name + "() : null;\n"; ++ } else { ++ code += start + camel_name + "();\n"; ++ } ++ break; ++ } ++ } ++ if (call_setter) { ++ code += " _o." + GenSetterFuncName_ObjectAPI(field.name) + "(_o" + ++ camel_name_with_first + ");\n"; ++ } ++ } ++ code += " }\n"; ++ // pack() ++ code += " public static " + GenOffsetType() + ++ " pack(FlatBufferBuilder builder, " + struct_name + " _o) {\n"; ++ code += " if (_o == null) return 0;\n"; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ if (field.deprecated) continue; ++ auto camel_name = MakeCamel(field.name, false); ++ auto camel_name_with_first = MakeCamel(field.name, true); ++ // pre ++ switch (field.value.type.base_type) { ++ case BASE_TYPE_STRUCT: { ++ if (!field.value.type.struct_def->fixed) { ++ code += " " + GenOffsetType() + " _" + field.name + " = _o." + ++ GenGetterFuncName_ObjectAPI(field.name) + ++ "() == null ? 0 : " + GenTypeGet(field.value.type) + ++ ".pack(builder, _o." + ++ GenGetterFuncName_ObjectAPI(field.name) + "());\n"; ++ } else if (struct_def.fixed && struct_has_create) { ++ std::vector array_lengths; ++ FieldArrayLength tmp_array_length = { ++ field.name, ++ field.value.type.fixed_length, ++ }; ++ array_lengths.push_back(tmp_array_length); ++ GenStructPackDecl_ObjectAPI(*field.value.type.struct_def, code_ptr, ++ array_lengths); ++ } ++ break; ++ } ++ case BASE_TYPE_STRING: { ++ std::string create_string = "createString"; ++ code += " int _" + camel_name + " = _o." + ++ GenGetterFuncName_ObjectAPI(field.name) + ++ "() == null ? 0 : " ++ "builder." + ++ create_string + "(_o." + ++ GenGetterFuncName_ObjectAPI(field.name) + "());\n"; ++ break; ++ } ++ case BASE_TYPE_VECTOR: { ++ if (field_has_create.find(&field) != field_has_create.end()) { ++ auto property_name = camel_name; ++ auto gen_for_loop = true; ++ std::string array_name = "__" + camel_name; ++ std::string array_type = ""; ++ std::string element_type = ""; ++ std::string to_array = ""; ++ switch (field.value.type.element) { ++ case BASE_TYPE_STRING: { ++ std::string create_string = "createString"; ++ array_type = "int"; ++ element_type = "String"; ++ to_array += "builder." + create_string + "(_e)"; ++ break; ++ } ++ case BASE_TYPE_STRUCT: ++ array_type = "int"; ++ element_type = ++ GenTypeGet_ObjectAPI(field.value.type, opts, true, true); ++ ; ++ to_array = GenTypeGet(field.value.type) + ".pack(builder, _e)"; ++ break; ++ case BASE_TYPE_UTYPE: ++ property_name = camel_name.substr(0, camel_name.size() - 4); ++ array_type = GenTypeBasic(DestinationType( ++ field.value.type.enum_def->underlying_type, false)); ++ element_type = field.value.type.enum_def->name + "Union"; ++ to_array = "_o." + GenGetterFuncName_ObjectAPI(property_name) + ++ "()[_j].getType()"; ++ break; ++ case BASE_TYPE_UNION: ++ array_type = "int"; ++ element_type = ++ WrapInNameSpace(*field.value.type.enum_def) + "Union"; ++ to_array = WrapInNameSpace(*field.value.type.enum_def) + ++ "Union.pack(builder, _o." + ++ GenGetterFuncName_ObjectAPI(property_name) + ++ "()[_j])"; ++ break; ++ case BASE_TYPE_UCHAR: // TODO this branch of the switch is due to ++ // inconsistent behavior in unsigned byte. ++ // Read further at Issue #6574. ++ array_type = "byte"; ++ element_type = "int"; ++ to_array = "(byte) _e"; ++ break; ++ default: ++ gen_for_loop = false; ++ array_name = ++ "_o." + GenGetterFuncName_ObjectAPI(property_name) + "()"; ++ array_type = GenTypeNameDest(field.value.type); ++ element_type = array_type; ++ to_array = "_e"; ++ break; ++ } ++ code += " int _" + camel_name + " = 0;\n"; ++ code += " if (_o." + GenGetterFuncName_ObjectAPI(property_name) + ++ "() != null) {\n"; ++ if (gen_for_loop) { ++ code += " " + array_type + "[] " + array_name + " = new " + ++ array_type + "[_o." + ++ GenGetterFuncName_ObjectAPI(property_name) + ++ "().length];\n"; ++ code += " int _j = 0;\n"; ++ code += " for (" + element_type + " _e : _o." + ++ GenGetterFuncName_ObjectAPI(property_name) + "()) { "; ++ code += array_name + "[_j] = " + to_array + "; _j++;}\n"; ++ } ++ code += " _" + camel_name + " = create" + ++ camel_name_with_first + "Vector(builder, " + array_name + ++ ");\n"; ++ code += " }\n"; ++ } else { ++ auto type_name = GenTypeGet(field.value.type); ++ auto element_type_name = ++ GenTypeGet_ObjectAPI(field.value.type, opts, true, true); ++ auto pack_method = ++ field.value.type.struct_def == nullptr ++ ? "builder.add" + GenMethod(field.value.type.VectorType()) + ++ "(_o" + camel_name_with_first + "[_j]);" ++ : type_name + ".pack(builder, _o" + camel_name_with_first + ++ "[_j]);"; ++ code += " int _" + camel_name + " = 0;\n"; ++ code += " " + element_type_name + "[] _o" + ++ camel_name_with_first + " = _o." + ++ GenGetterFuncName_ObjectAPI(field.name) + "();\n"; ++ code += " if (_o" + camel_name_with_first + " != null) {\n"; ++ code += " start" + camel_name_with_first + ++ "Vector(builder, _o" + camel_name_with_first + ++ ".length);\n"; ++ code += " for (int _j = _o" + camel_name_with_first + ++ ".length - 1; _j >=0; _j--) { "; ++ code += pack_method + "}\n"; ++ code += " _" + camel_name + " = builder.endVector();\n"; ++ code += " }\n"; ++ } ++ break; ++ } ++ case BASE_TYPE_ARRAY: { ++ if (field.value.type.struct_def != nullptr) { ++ std::vector array_lengths; ++ FieldArrayLength tmp_array_length = { ++ field.name, ++ field.value.type.fixed_length, ++ }; ++ array_lengths.push_back(tmp_array_length); ++ GenStructPackDecl_ObjectAPI(*field.value.type.struct_def, code_ptr, ++ array_lengths); ++ } else { ++ code += " " + ++ GenTypeGet_ObjectAPI(field.value.type, opts, false, true) + ++ " _" + camel_name + " = _o." + ++ GenGetterFuncName_ObjectAPI(field.name) + "();\n"; ++ } ++ break; ++ } ++ case BASE_TYPE_UNION: { ++ code += ++ " " + ++ GenTypeBasic(DestinationType( ++ field.value.type.enum_def->underlying_type, false)) + ++ " _" + camel_name + "Type = _o.get" + camel_name_with_first + ++ "() == null ? " + WrapInNameSpace(*field.value.type.enum_def) + ++ ".NONE : " + "_o.get" + camel_name_with_first + "().getType();\n"; ++ code += " " + GenOffsetType() + " _" + camel_name + " = _o.get" + ++ camel_name_with_first + "() == null ? 0 : " + ++ WrapInNameSpace(*field.value.type.enum_def) + ++ "Union.pack(builder, _o.get" + camel_name_with_first + ++ "());\n"; ++ break; ++ } ++ default: break; ++ } ++ } ++ if (struct_has_create) { ++ // Create ++ code += " return create" + struct_def.name + "(\n"; ++ code += " builder"; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ if (field.deprecated) continue; ++ auto camel_name = MakeCamel(field.name, false); ++ switch (field.value.type.base_type) { ++ case BASE_TYPE_STRUCT: { ++ if (struct_def.fixed) { ++ GenStructPackCall_ObjectAPI(*field.value.type.struct_def, ++ code_ptr, ++ " _" + camel_name + "_"); ++ } else { ++ code += ",\n"; ++ if (field.value.type.struct_def->fixed) { ++ if (opts.generate_object_based_api) ++ code += " _o." + camel_name; ++ else ++ // Seems like unreachable code ++ code += " " + GenTypeGet(field.value.type) + ++ ".Pack(builder, _o." + camel_name + ")"; ++ } else { ++ code += " _" + field.name; ++ } ++ } ++ break; ++ } ++ case BASE_TYPE_ARRAY: { ++ if (field.value.type.struct_def != nullptr) { ++ GenStructPackCall_ObjectAPI(*field.value.type.struct_def, ++ code_ptr, ++ " _" + camel_name + "_"); ++ } else { ++ code += ",\n"; ++ code += " _" + camel_name; ++ } ++ break; ++ } ++ case BASE_TYPE_UNION: FLATBUFFERS_FALLTHROUGH(); // fall thru ++ case BASE_TYPE_UTYPE: FLATBUFFERS_FALLTHROUGH(); // fall thru ++ case BASE_TYPE_STRING: FLATBUFFERS_FALLTHROUGH(); // fall thru ++ case BASE_TYPE_VECTOR: { ++ code += ",\n"; ++ code += " _" + camel_name; ++ break; ++ } ++ default: // scalar ++ code += ",\n"; ++ code += ++ " _o." + GenGetterFuncName_ObjectAPI(field.name) + "()"; ++ break; ++ } ++ } ++ code += ");\n"; ++ } else { ++ // Start, End ++ code += " start" + struct_def.name + "(builder);\n"; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ if (field.deprecated) continue; ++ auto camel_name = MakeCamel(field.name, false); ++ auto camel_name_with_first = MakeCamel(field.name, true); ++ switch (field.value.type.base_type) { ++ case BASE_TYPE_STRUCT: { ++ if (field.value.type.struct_def->fixed) { ++ code += " add" + camel_name_with_first + "(builder, " + ++ GenTypeGet(field.value.type) + ".pack(builder, _o." + ++ GenGetterFuncName_ObjectAPI(field.name) + "()));\n"; ++ } else { ++ code += " add" + camel_name_with_first + "(builder, _" + ++ field.name + ");\n"; ++ } ++ break; ++ } ++ case BASE_TYPE_STRING: FLATBUFFERS_FALLTHROUGH(); // fall thru ++ case BASE_TYPE_ARRAY: FLATBUFFERS_FALLTHROUGH(); // fall thru ++ case BASE_TYPE_VECTOR: { ++ code += " add" + camel_name_with_first + "(builder, _" + ++ camel_name + ");\n"; ++ break; ++ } ++ case BASE_TYPE_UTYPE: break; ++ case BASE_TYPE_UNION: { ++ code += " add" + camel_name_with_first + "Type(builder, _" + ++ camel_name + "Type);\n"; ++ code += " add" + camel_name_with_first + "(builder, _" + ++ camel_name + ");\n"; ++ break; ++ } ++ // scalar ++ default: { ++ if (field.IsScalarOptional()) { ++ code += " if (_o." + GenGetterFuncName_ObjectAPI(field.name) + ++ "() != null) { add" + camel_name_with_first + ++ "(builder, _o." + ++ GenGetterFuncName_ObjectAPI(field.name) + "()); }\n"; ++ } else { ++ code += " add" + camel_name_with_first + "(builder, _o." + ++ GenGetterFuncName_ObjectAPI(field.name) + "());\n"; ++ } ++ break; ++ } ++ } ++ } ++ code += " return end" + struct_def.name + "(builder);\n"; ++ } ++ code += " }\n"; ++ } ++ ++ void GenStructPackDecl_ObjectAPI( ++ const StructDef &struct_def, std::string *code_ptr, ++ std::vector &array_lengths) const { ++ auto &code = *code_ptr; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ auto is_array = IsArray(field.value.type); ++ const auto &field_type = ++ is_array ? field.value.type.VectorType() : field.value.type; ++ FieldArrayLength tmp_array_length = { ++ field.name, ++ field_type.fixed_length, ++ }; ++ array_lengths.push_back(tmp_array_length); ++ if (field_type.struct_def != nullptr) { ++ GenStructPackDecl_ObjectAPI(*field_type.struct_def, code_ptr, ++ array_lengths); ++ } else { ++ std::vector array_only_lengths; ++ for (size_t i = 0; i < array_lengths.size(); ++i) { ++ if (array_lengths[i].length > 0) { ++ array_only_lengths.push_back(array_lengths[i]); ++ } ++ } ++ std::string name; ++ for (size_t i = 0; i < array_lengths.size(); ++i) { ++ name += "_" + MakeCamel(array_lengths[i].name, false); ++ } ++ code += " " + GenTypeBasic(field_type); ++ if (array_only_lengths.size() > 0) { ++ for (size_t i = 0; i < array_only_lengths.size(); ++i) { ++ code += "[]"; ++ } ++ code += " " + name + " = "; ++ code += "new " + GenTypeBasic(field_type) + "["; ++ for (size_t i = 0; i < array_only_lengths.size(); ++i) { ++ if (i != 0) { code += "]["; } ++ code += NumToString(array_only_lengths[i].length); ++ } ++ code += "];\n"; ++ code += " "; ++ // initialize array ++ for (size_t i = 0; i < array_only_lengths.size(); ++i) { ++ auto idx = "idx" + NumToString(i); ++ code += "for (int " + idx + " = 0; " + idx + " < " + ++ NumToString(array_only_lengths[i].length) + "; ++" + idx + ++ ") {"; ++ } ++ for (size_t i = 0; i < array_only_lengths.size(); ++i) { ++ auto idx = "idx" + NumToString(i); ++ if (i == 0) { ++ code += name + "[" + idx; ++ } else { ++ code += "][" + idx; ++ } ++ } ++ code += "] = _o"; ++ for (size_t i = 0, j = 0; i < array_lengths.size(); ++i) { ++ code += ++ "." + GenGetterFuncName_ObjectAPI(array_lengths[i].name) + "()"; ++ if (array_lengths[i].length <= 0) continue; ++ code += "[idx" + NumToString(j++) + "]"; ++ } ++ code += ";"; ++ for (size_t i = 0; i < array_only_lengths.size(); ++i) { ++ code += "}"; ++ } ++ } else { ++ code += " " + name + " = "; ++ code += "_o"; ++ for (size_t i = 0; i < array_lengths.size(); ++i) { ++ code += "." + GenGetterFuncName_ObjectAPI(array_lengths[i].name) + ++ "()"; // + MakeCamel(array_lengths[i].name); ++ } ++ code += ";"; ++ } ++ code += "\n"; ++ } ++ array_lengths.pop_back(); ++ } ++ } ++ ++ void GenStructPackCall_ObjectAPI(const StructDef &struct_def, ++ std::string *code_ptr, ++ std::string prefix) const { ++ auto &code = *code_ptr; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ const auto &field_type = field.value.type; ++ if (field_type.struct_def != nullptr) { ++ GenStructPackCall_ObjectAPI( ++ *field_type.struct_def, code_ptr, ++ prefix + MakeCamel(field.name, false) + "_"); ++ } else { ++ code += ",\n"; ++ code += prefix + MakeCamel(field.name, false); ++ } ++ } ++ } ++ ++ std::string ConvertPrimitiveTypeToObjectWrapper_ObjectAPI( ++ std::string type_name) const { ++ if (type_name == "boolean") ++ return "Boolean"; ++ else if (type_name == "byte") ++ return "Byte"; ++ else if (type_name == "char") ++ return "Character"; ++ else if (type_name == "short") ++ return "Short"; ++ else if (type_name == "int") ++ return "Integer"; ++ else if (type_name == "long") ++ return "Long"; ++ else if (type_name == "float") ++ return "Float"; ++ else if (type_name == "double") ++ return "Double"; ++ return type_name; ++ } ++ ++ std::string GenTypeGet_ObjectAPI(flatbuffers::Type type, ++ const IDLOptions &opts, bool vectorelem, ++ bool wrap_in_namespace) const { ++ auto type_name = GenTypeNameDest(type); ++ // Replace to ObjectBaseAPI Type Name ++ switch (type.base_type) { ++ case BASE_TYPE_STRUCT: FLATBUFFERS_FALLTHROUGH(); // fall thru ++ case BASE_TYPE_ARRAY: FLATBUFFERS_FALLTHROUGH(); // fall thru ++ case BASE_TYPE_VECTOR: { ++ if (type.struct_def != nullptr) { ++ auto type_name_length = type.struct_def->name.length(); ++ auto new_type_name = ++ GenTypeName_ObjectAPI(type.struct_def->name, opts); ++ type_name.replace(type_name.length() - type_name_length, ++ type_name_length, new_type_name); ++ } else if (type.element == BASE_TYPE_UNION) { ++ if (wrap_in_namespace) { ++ type_name = WrapInNameSpace(*type.enum_def) + "Union"; ++ } else { ++ type_name = type.enum_def->name + "Union"; ++ } ++ } ++ break; ++ } ++ ++ case BASE_TYPE_UNION: { ++ if (wrap_in_namespace) { ++ type_name = WrapInNameSpace(*type.enum_def) + "Union"; ++ } else { ++ type_name = type.enum_def->name + "Union"; ++ } ++ break; ++ } ++ default: break; ++ } ++ if (vectorelem) { return type_name; } ++ switch (type.base_type) { ++ case BASE_TYPE_ARRAY: FLATBUFFERS_FALLTHROUGH(); // fall thru ++ case BASE_TYPE_VECTOR: { ++ type_name = type_name + "[]"; ++ break; ++ } ++ default: break; ++ } ++ return type_name; ++ } ++ ++ std::string GenConcreteTypeGet_ObjectAPI(flatbuffers::Type type, ++ const IDLOptions &opts) const { ++ auto type_name = GenTypeNameDest(type); ++ // Replace to ObjectBaseAPI Type Name ++ switch (type.base_type) { ++ case BASE_TYPE_STRUCT: FLATBUFFERS_FALLTHROUGH(); // fall thru ++ case BASE_TYPE_ARRAY: FLATBUFFERS_FALLTHROUGH(); // fall thru ++ case BASE_TYPE_VECTOR: { ++ if (type.struct_def != nullptr) { ++ auto type_name_length = type.struct_def->name.length(); ++ auto new_type_name = ++ GenTypeName_ObjectAPI(type.struct_def->name, opts); ++ type_name.replace(type_name.length() - type_name_length, ++ type_name_length, new_type_name); ++ } else if (type.element == BASE_TYPE_UNION) { ++ type_name = WrapInNameSpace(*type.enum_def) + "Union"; ++ } ++ break; ++ } ++ ++ case BASE_TYPE_UNION: { ++ type_name = WrapInNameSpace(*type.enum_def) + "Union"; ++ break; ++ } ++ default: break; ++ } ++ ++ switch (type.base_type) { ++ case BASE_TYPE_ARRAY: FLATBUFFERS_FALLTHROUGH(); // fall thru ++ case BASE_TYPE_VECTOR: { ++ type_name = type_name + "[]"; ++ break; ++ } ++ default: break; ++ } ++ return type_name; ++ } ++ ++ void GenStruct_ObjectAPI(StructDef &struct_def, std::string *code_ptr, ++ const IDLOptions &opts) const { ++ if (struct_def.generated) return; ++ auto &code = *code_ptr; ++ if (struct_def.attributes.Lookup("private")) { ++ // For Java, we leave the enum unmarked to indicate package-private ++ } else { ++ code += "public "; ++ } ++ ++ auto class_name = GenTypeName_ObjectAPI(struct_def.name, opts); ++ code += "class " + class_name; ++ code += " {\n"; ++ // Generate Properties ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ if (field.deprecated) continue; ++ if (field.value.type.base_type == BASE_TYPE_UTYPE) continue; ++ if (field.value.type.element == BASE_TYPE_UTYPE) continue; ++ auto type_name = ++ GenTypeGet_ObjectAPI(field.value.type, opts, false, true); ++ if (field.IsScalarOptional()) ++ type_name = ConvertPrimitiveTypeToObjectWrapper_ObjectAPI(type_name); ++ auto camel_name = MakeCamel(field.name, false); ++ code += " private " + type_name + " " + camel_name + ";\n"; ++ } ++ // Generate Java getters and setters ++ code += "\n"; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ if (field.deprecated) continue; ++ if (field.value.type.base_type == BASE_TYPE_UTYPE) continue; ++ if (field.value.type.element == BASE_TYPE_UTYPE) continue; ++ auto type_name = ++ GenTypeGet_ObjectAPI(field.value.type, opts, false, true); ++ if (field.IsScalarOptional()) ++ type_name = ConvertPrimitiveTypeToObjectWrapper_ObjectAPI(type_name); ++ auto camel_name = MakeCamel(field.name, false); ++ code += " public " + type_name + " " + ++ GenGetterFuncName_ObjectAPI(field.name) + "() { return " + ++ camel_name + "; }\n\n"; ++ std::string array_validation = ""; ++ if (field.value.type.base_type == BASE_TYPE_ARRAY) { ++ array_validation = ++ "if (" + camel_name + " != null && " + camel_name + ++ ".length == " + NumToString(field.value.type.fixed_length) + ") "; ++ } ++ code += " public void " + GenSetterFuncName_ObjectAPI(field.name) + "(" + ++ type_name + " " + camel_name + ") { " + array_validation + ++ "this." + camel_name + " = " + camel_name + "; }\n\n"; ++ } ++ // Generate Constructor ++ code += "\n"; ++ code += " public " + class_name + "() {\n"; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ if (field.deprecated) continue; ++ if (field.value.type.base_type == BASE_TYPE_UTYPE) continue; ++ if (field.value.type.element == BASE_TYPE_UTYPE) continue; ++ code += " this." + MakeCamel(field.name, false) + " = "; ++ auto type_name = ++ GenTypeGet_ObjectAPI(field.value.type, opts, false, true); ++ if (IsScalar(field.value.type.base_type)) { ++ if (field.IsScalarOptional()) { ++ code += "null;\n"; ++ } else { ++ code += GenDefaultValue(field) + ";\n"; ++ } ++ } else { ++ switch (field.value.type.base_type) { ++ case BASE_TYPE_STRUCT: { ++ if (IsStruct(field.value.type)) { ++ code += "new " + type_name + "();\n"; ++ } else { ++ code += "null;\n"; ++ } ++ break; ++ } ++ case BASE_TYPE_ARRAY: { ++ code += "new " + type_name.substr(0, type_name.length() - 1) + ++ NumToString(field.value.type.fixed_length) + "];\n"; ++ break; ++ } ++ default: { ++ code += "null;\n"; ++ break; ++ } ++ } ++ } ++ } ++ code += " }\n"; ++ if (parser_.root_struct_def_ == &struct_def) { ++ code += " public static " + class_name + ++ " deserializeFromBinary(byte[] fbBuffer) {\n"; ++ code += " return " + struct_def.name + ".getRootAs" + struct_def.name + ++ "(ByteBuffer.wrap(fbBuffer)).unpack();\n"; ++ code += " }\n"; ++ code += " public byte[] serializeToBinary() {\n"; ++ code += " FlatBufferBuilder fbb = new FlatBufferBuilder();\n"; ++ code += " " + struct_def.name + ".finish" + struct_def.name + ++ "Buffer(fbb, " + struct_def.name + ".pack(fbb, this));\n"; ++ code += " return fbb.sizedByteArray();\n"; ++ code += " }\n"; ++ } ++ code += "}\n\n"; ++ } ++ + // This tracks the current namespace used to determine if a type need to be + // prefixed by its namespace + const Namespace *cur_name_space_; +diff -urN a/src/idl_gen_json_schema.cpp b/src/idl_gen_json_schema.cpp +--- a/src/idl_gen_json_schema.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_json_schema.cpp 2023-01-13 07:47:08.894252193 +0000 +@@ -166,9 +166,45 @@ + return std::string(num_spaces, ' '); + } + ++ std::string PrepareDescription( ++ const std::vector &comment_lines) { ++ std::string comment; ++ for (auto line_iterator = comment_lines.cbegin(); ++ line_iterator != comment_lines.cend(); ++line_iterator) { ++ const auto &comment_line = *line_iterator; ++ ++ // remove leading and trailing spaces from comment line ++ const auto start = std::find_if(comment_line.begin(), comment_line.end(), ++ [](char c) { return !isspace(c); }); ++ const auto end = ++ std::find_if(comment_line.rbegin(), comment_line.rend(), [](char c) { ++ return !isspace(c); ++ }).base(); ++ if (start < end) { ++ comment.append(start, end); ++ } else { ++ comment.append(comment_line); ++ } ++ ++ if (line_iterator + 1 != comment_lines.cend()) comment.append("\n"); ++ } ++ if (!comment.empty()) { ++ std::string description; ++ if (EscapeString(comment.c_str(), comment.length(), &description, true, ++ true)) { ++ return description; ++ } ++ return ""; ++ } ++ return ""; ++ } ++ + bool generate() { + code_ = ""; +- if (parser_.root_struct_def_ == nullptr) { return false; } ++ if (parser_.root_struct_def_ == nullptr) { ++ std::cerr << "Error: Binary schema not generated, no root struct found\n"; ++ return false; ++ } + code_ += "{" + NewLine(); + code_ += Indent(1) + + "\"$schema\": \"https://json-schema.org/draft/2019-09/schema\"," + +@@ -193,21 +229,12 @@ + const auto &structure = *s; + code_ += Indent(2) + "\"" + GenFullName(structure) + "\" : {" + NewLine(); + code_ += Indent(3) + GenType("object") + "," + NewLine(); +- std::string comment; + const auto &comment_lines = structure->doc_comment; +- for (auto comment_line = comment_lines.cbegin(); +- comment_line != comment_lines.cend(); ++comment_line) { +- comment.append(*comment_line); +- } +- if (!comment.empty()) { +- std::string description; +- if (!EscapeString(comment.c_str(), comment.length(), &description, true, +- true)) { +- return false; +- } +- code_ += +- Indent(3) + "\"description\" : " + description + "," + NewLine(); ++ auto comment = PrepareDescription(comment_lines); ++ if (comment != "") { ++ code_ += Indent(3) + "\"description\" : " + comment + "," + NewLine(); + } ++ + code_ += Indent(3) + "\"properties\" : {" + NewLine(); + + const auto &properties = structure->fields.vec; +@@ -223,13 +250,19 @@ + std::string deprecated_info = ""; + if (property->deprecated) { + deprecated_info = +- "," + NewLine() + Indent(8) + "\"deprecated\" : true,"; ++ "," + NewLine() + Indent(8) + "\"deprecated\" : true"; + } + std::string typeLine = Indent(4) + "\"" + property->name + "\""; + typeLine += " : {" + NewLine() + Indent(8); + typeLine += GenType(property->value.type); + typeLine += arrayInfo; + typeLine += deprecated_info; ++ auto description = PrepareDescription(property->doc_comment); ++ if (description != "") { ++ typeLine += ++ "," + NewLine() + Indent(8) + "\"description\" : " + description; ++ } ++ + typeLine += NewLine() + Indent(7) + "}"; + if (property != properties.back()) { typeLine.append(","); } + code_ += typeLine + NewLine(); +diff -urN a/src/idl_gen_kotlin.cpp b/src/idl_gen_kotlin.cpp +--- a/src/idl_gen_kotlin.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_kotlin.cpp 2023-01-13 07:47:08.894252193 +0000 +@@ -23,9 +23,6 @@ + #include "flatbuffers/flatbuffers.h" + #include "flatbuffers/idl.h" + #include "flatbuffers/util.h" +-#if defined(FLATBUFFERS_CPP98_STL) +-# include +-#endif // defined(FLATBUFFERS_CPP98_STL) + + namespace flatbuffers { + +@@ -262,7 +259,6 @@ + GenerateComment(enum_def.doc_comment, writer, &comment_config); + + writer += "@Suppress(\"unused\")"; +- writer += "@ExperimentalUnsignedTypes"; + writer += "class " + Esc(enum_def.name) + " private constructor() {"; + writer.IncrementIdentLevel(); + +@@ -425,7 +421,8 @@ + (nameprefix + (field.name + "_")).c_str()); + } else { + writer.SetValue("type", GenMethod(field.value.type)); +- writer.SetValue("argname", nameprefix + MakeCamel(field.name, false)); ++ writer.SetValue("argname", ++ nameprefix + MakeCamel(Esc(field.name), false)); + writer.SetValue("cast", CastToSigned(field.value.type)); + writer += "builder.put{{type}}({{argname}}{{cast}})"; + } +@@ -463,7 +460,6 @@ + writer.SetValue("superclass", fixed ? "Struct" : "Table"); + + writer += "@Suppress(\"unused\")"; +- writer += "@ExperimentalUnsignedTypes"; + writer += "class {{struct_name}} : {{superclass}}() {\n"; + + writer.IncrementIdentLevel(); +diff -urN a/src/idl_gen_python.cpp b/src/idl_gen_python.cpp +--- a/src/idl_gen_python.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_python.cpp 2023-01-13 07:47:08.914252379 +0000 +@@ -113,12 +113,6 @@ + code += enum_def.ToString(ev) + "\n"; + } + +- // End enum code. +- void EndEnum(std::string *code_ptr) { +- auto &code = *code_ptr; +- code += "\n"; +- } +- + // Initialize a new struct or table from existing data. + void NewRootTypeFromBuffer(const StructDef &struct_def, + std::string *code_ptr) { +@@ -141,7 +135,9 @@ + code += Indent + "def GetRootAs"; + code += NormalizedName(struct_def); + code += "(cls, buf, offset=0):\n"; +- code += Indent + Indent + "\"\"\"This method is deprecated. Please switch to GetRootAs.\"\"\"\n"; ++ code += ++ Indent + Indent + ++ "\"\"\"This method is deprecated. Please switch to GetRootAs.\"\"\"\n"; + code += Indent + Indent + "return cls.GetRootAs(buf, offset)\n"; + } + +@@ -442,7 +438,7 @@ + code += Indent + Indent + Indent; + code += "from " + qualified_name + " import " + unqualified_name + "\n"; + code += Indent + Indent + Indent + "return " + unqualified_name; +- code += ".GetRootAs"; ++ code += ".GetRootAs" + unqualified_name; + code += "(self._tab.Bytes, self._tab.Vector(o))\n"; + code += Indent + Indent + "return 0\n"; + code += "\n"; +@@ -476,7 +472,7 @@ + // a nested struct, prefix the name with the field name. + auto subprefix = nameprefix; + if (has_field_name) { +- subprefix += NormalizedName(field) + fieldname_suffix; ++ subprefix += MakeLowerCamel(field) + fieldname_suffix; + } + StructBuilderArgs(*field.value.type.struct_def, subprefix, namesuffix, + has_field_name, fieldname_suffix, code_ptr); +@@ -516,7 +512,7 @@ + indent + " builder.Pad(" + NumToString(field.padding) + ")\n"; + if (IsStruct(field_type)) { + StructBuilderBody(*field_type.struct_def, +- (nameprefix + (NormalizedName(field) + "_")).c_str(), ++ (nameprefix + (MakeLowerCamel(field) + "_")).c_str(), + code_ptr, index, in_array); + } else { + const auto index_var = "_idx" + NumToString(index); +@@ -529,7 +525,7 @@ + if (IsStruct(type)) { + StructBuilderBody( + *field_type.struct_def, +- (nameprefix + (NormalizedName(field) + "_")).c_str(), code_ptr, ++ (nameprefix + (MakeLowerCamel(field) + "_")).c_str(), code_ptr, + index + 1, in_array); + } else { + code += IsArray(field_type) ? " " : ""; +@@ -553,22 +549,29 @@ + // Get the value of a table's starting offset. + void GetStartOfTable(const StructDef &struct_def, std::string *code_ptr) { + auto &code = *code_ptr; +- code += "def Start(builder): "; ++ ++ // Generate method with struct name. ++ code += "def " + NormalizedName(struct_def) + "Start(builder): "; + code += "builder.StartObject("; + code += NumToString(struct_def.fields.vec.size()); + code += ")\n"; + +- // Add alias with the old name. +- code += "def " + NormalizedName(struct_def) + "Start(builder):\n"; +- code += Indent + "\"\"\"This method is deprecated. Please switch to Start.\"\"\"\n"; +- code += Indent + "return Start(builder)\n"; ++ if (!parser_.opts.one_file) { ++ // Generate method without struct name. ++ code += "def Start(builder):\n"; ++ code += ++ Indent + "return " + NormalizedName(struct_def) + "Start(builder)\n"; ++ } + } + + // Set the value of a table's field. + void BuildFieldOfTable(const StructDef &struct_def, const FieldDef &field, + const size_t offset, std::string *code_ptr) { + auto &code = *code_ptr; +- code += "def Add" + MakeCamel(NormalizedName(field)); ++ ++ // Generate method with struct name. ++ code += "def " + NormalizedName(struct_def) + "Add" + ++ MakeCamel(NormalizedName(field)); + code += "(builder, "; + code += MakeCamel(NormalizedName(field), false); + code += "): "; +@@ -588,26 +591,27 @@ + : field.value.constant; + code += ")\n"; + +- // Add alias with the old name. +- code += "def " + NormalizedName(struct_def) + "Add" + MakeCamel(NormalizedName(field)); +- code += "(builder, "; +- code += MakeCamel(NormalizedName(field), false); +- code += "):\n"; +- code += Indent + "\"\"\"This method is deprecated. Please switch to Add"; +- code += MakeCamel(NormalizedName(field)) + ".\"\"\"\n"; +- code += Indent + "return Add" + MakeCamel(NormalizedName(field)); +- code += "(builder, "; +- code += MakeCamel(NormalizedName(field), false); +- code += ")\n"; +- +- // Add alias with the old name. ++ if (!parser_.opts.one_file) { ++ // Generate method without struct name. ++ code += "def Add" + MakeCamel(NormalizedName(field)); ++ code += "(builder, "; ++ code += MakeCamel(NormalizedName(field), false); ++ code += "):\n"; ++ code += Indent + "return " + NormalizedName(struct_def) + "Add" + ++ MakeCamel(NormalizedName(field)); ++ code += "(builder, "; ++ code += MakeCamel(NormalizedName(field), false); ++ code += ")\n"; ++ } + } + + // Set the value of one of the members of a table's vector. + void BuildVectorOfTable(const StructDef &struct_def, const FieldDef &field, + std::string *code_ptr) { + auto &code = *code_ptr; +- code += "def Start"; ++ ++ // Generate method with struct name. ++ code += "def " + NormalizedName(struct_def) + "Start"; + code += MakeCamel(NormalizedName(field)); + code += "Vector(builder, numElems): return builder.StartVector("; + auto vector_type = field.value.type.VectorType(); +@@ -617,20 +621,23 @@ + code += ", numElems, " + NumToString(alignment); + code += ")\n"; + +- // Add alias with the old name. +- code += "def " + NormalizedName(struct_def) + "Start"; +- code += MakeCamel(NormalizedName(field)); +- code += "Vector(builder, numElems):\n"; +- code += Indent + "\"\"\"This method is deprecated. Please switch to Start.\"\"\"\n"; +- code += Indent + "return Start"; +- code += MakeCamel(NormalizedName(field)); +- code += "Vector(builder, numElems)\n"; ++ if (!parser_.opts.one_file) { ++ // Generate method without struct name. ++ code += "def Start"; ++ code += MakeCamel(NormalizedName(field)); ++ code += "Vector(builder, numElems):\n"; ++ code += Indent + "return " + NormalizedName(struct_def) + "Start"; ++ code += MakeCamel(NormalizedName(field)); ++ code += "Vector(builder, numElems)\n"; ++ } + } + + // Set the value of one of the members of a table's vector and fills in the + // elements from a bytearray. This is for simplifying the use of nested + // flatbuffers. +- void BuildVectorOfTableFromBytes(const FieldDef &field, std::string *code_ptr) { ++ void BuildVectorOfTableFromBytes(const StructDef &struct_def, ++ const FieldDef &field, ++ std::string *code_ptr) { + auto nested = field.attributes.Lookup("nested_flatbuffer"); + if (!nested) { return; } // There is no nested flatbuffer. + +@@ -646,7 +653,11 @@ + (void)nested_root; + + auto &code = *code_ptr; +- code += "def MakeVectorFromBytes(builder, bytes):\n"; ++ ++ // Generate method with struct and field name. ++ code += "def " + NormalizedName(struct_def) + "Make"; ++ code += MakeCamel(NormalizedName(field)); ++ code += "VectorFromBytes(builder, bytes):\n"; + code += Indent + "builder.StartVector("; + auto vector_type = field.value.type.VectorType(); + auto alignment = InlineAlignment(vector_type); +@@ -659,28 +670,30 @@ + code += " = bytes\n"; + code += Indent + "return builder.EndVector()\n"; + +- // Add alias with the old name. +- code += "def Make" + MakeCamel(NormalizedName(field)); +- code += "VectorFromBytes(builder, bytes):\n"; +- code += Indent + "builder.StartVector("; +- code += NumToString(elem_size); +- code += ", len(bytes), " + NumToString(alignment); +- code += ")\n"; +- code += Indent + "builder.head = builder.head - len(bytes)\n"; +- code += Indent + "builder.Bytes[builder.head : builder.head + len(bytes)]"; +- code += " = bytes\n"; +- code += Indent + "return builder.EndVector()\n"; ++ if (!parser_.opts.one_file) { ++ // Generate method without struct and field name. ++ code += "def Make" + MakeCamel(NormalizedName(field)) + ++ "VectorFromBytes(builder, bytes):\n"; ++ code += Indent + "return " + NormalizedName(struct_def) + "Make" + ++ MakeCamel(NormalizedName(field)) + ++ "VectorFromBytes(builder, bytes)\n"; ++ } + } + + // Get the offset of the end of a table. + void GetEndOffsetOnTable(const StructDef &struct_def, std::string *code_ptr) { + auto &code = *code_ptr; +- code += "def End(builder): return builder.EndObject()\n"; + +- // Add alias with the old name. +- code += "def " + NormalizedName(struct_def) + "End(builder):\n"; +- code += Indent + "\"\"\"This method is deprecated. Please switch to End.\"\"\"\n"; +- code += Indent + "return End(builder)"; ++ // Generate method with struct name. ++ code += "def " + NormalizedName(struct_def) + "End"; ++ code += "(builder): "; ++ code += "return builder.EndObject()\n"; ++ ++ if (!parser_.opts.one_file) { ++ // Generate method without struct name. ++ code += "def End(builder):\n"; ++ code += Indent + "return " + NormalizedName(struct_def) + "End(builder)"; ++ } + } + + // Generate the receiver for function signatures. +@@ -758,7 +771,7 @@ + BuildFieldOfTable(struct_def, field, offset, code_ptr); + if (IsVector(field.value.type)) { + BuildVectorOfTable(struct_def, field, code_ptr); +- BuildVectorOfTableFromBytes(field, code_ptr); ++ BuildVectorOfTableFromBytes(struct_def, field, code_ptr); + } + } + +@@ -1287,7 +1300,7 @@ + code_prefix += + GenIndents(2) + "if self." + field_instance_name + " is not None:"; + if (field.value.type.struct_def->fixed) { +- code_prefix += GenIndents(3) + "Start" + ++ code_prefix += GenIndents(3) + struct_name + "Start" + + field_accessor_name + "Vector(builder, len(self." + + field_instance_name + "))"; + code_prefix += GenIndents(3) + "for i in reversed(range(len(self." + +@@ -1305,7 +1318,7 @@ + code_prefix += GenIndents(4) + field_instance_name + "list.append(self." + + field_instance_name + "[i].Pack(builder))"; + +- code_prefix += GenIndents(3) + "Start" + ++ code_prefix += GenIndents(3) + struct_name + "Start" + + field_accessor_name + "Vector(builder, len(self." + + field_instance_name + "))"; + code_prefix += GenIndents(3) + "for i in reversed(range(len(self." + +@@ -1318,7 +1331,7 @@ + + // Adds the field into the struct. + code += GenIndents(2) + "if self." + field_instance_name + " is not None:"; +- code += GenIndents(3) + "Add" + field_accessor_name + ++ code += GenIndents(3) + struct_name + "Add" + field_accessor_name + + "(builder, " + field_instance_name + ")"; + } + +@@ -1331,7 +1344,7 @@ + auto struct_name = NormalizedName(struct_def); + auto vectortype = field.value.type.VectorType(); + +- code += GenIndents(indents) + "Start" + field_accessor_name + ++ code += GenIndents(indents) + struct_name + "Start" + field_accessor_name + + "Vector(builder, len(self." + field_instance_name + "))"; + code += GenIndents(indents) + "for i in reversed(range(len(self." + + field_instance_name + "))):"; +@@ -1368,7 +1381,7 @@ + + // Adds the field into the struct. + code += GenIndents(2) + "if self." + field_instance_name + " is not None:"; +- code += GenIndents(3) + "Add" + field_accessor_name + ++ code += GenIndents(3) + struct_name + "Add" + field_accessor_name + + "(builder, " + field_instance_name + ")"; + + // Creates the field. +@@ -1431,7 +1444,7 @@ + GenIndents(2) + "if self." + field_instance_name + " is not None:"; + } + +- code += GenIndents(3) + "Add" + field_accessor_name + ++ code += GenIndents(3) + struct_name + "Add" + field_accessor_name + + "(builder, " + field_instance_name + ")"; + } + +@@ -1451,7 +1464,7 @@ + code_prefix += GenIndents(3) + field_instance_name + " = self." + + field_instance_name + ".Pack(builder)"; + code += GenIndents(2) + "if self." + field_instance_name + " is not None:"; +- code += GenIndents(3) + "Add" + field_accessor_name + ++ code += GenIndents(3) + struct_name + "Add" + field_accessor_name + + "(builder, " + field_instance_name + ")"; + } + +@@ -1463,7 +1476,7 @@ + + GenReceiverForObjectAPI(struct_def, code_ptr); + code_base += "Pack(self, builder):"; +- code += GenIndents(2) + "Start(builder)"; ++ code += GenIndents(2) + struct_name + "Start(builder)"; + for (auto it = struct_def.fields.vec.begin(); + it != struct_def.fields.vec.end(); ++it) { + auto &field = **it; +@@ -1502,7 +1515,7 @@ + ")"; + code += GenIndents(2) + "if self." + field_instance_name + + " is not None:"; +- code += GenIndents(3) + "Add" + field_accessor_name + ++ code += GenIndents(3) + struct_name + "Add" + field_accessor_name + + "(builder, " + field_instance_name + ")"; + break; + } +@@ -1510,13 +1523,14 @@ + // Generates code for scalar values. If the value equals to the + // default value, builder will automatically ignore it. So we don't + // need to check the value ahead. +- code += GenIndents(2) + "Add" + field_accessor_name + ++ code += GenIndents(2) + struct_name + "Add" + field_accessor_name + + "(builder, self." + field_instance_name + ")"; + break; + } + } + +- code += GenIndents(2) + struct_instance_name + " = " + "End(builder)"; ++ code += GenIndents(2) + struct_instance_name + " = " + struct_name + ++ "End(builder)"; + code += GenIndents(2) + "return " + struct_instance_name; + + code_base += code_prefix + code; +@@ -1590,6 +1604,8 @@ + + // Creates an union object based on union type. + void GenUnionCreator(const EnumDef &enum_def, std::string *code_ptr) { ++ if (enum_def.generated) return; ++ + auto &code = *code_ptr; + auto union_name = MakeUpperCamel(enum_def); + +@@ -1627,7 +1643,6 @@ + GenComment(ev.doc_comment, code_ptr, &def_comment, Indent.c_str()); + EnumMember(enum_def, ev, code_ptr); + } +- EndEnum(code_ptr); + } + + // Returns the function name that is able to read a value of the given type. +@@ -1697,13 +1712,20 @@ + } + + bool generate() { +- if (!generateEnums()) return false; +- if (!generateStructs()) return false; ++ std::string one_file_code; ++ if (!generateEnums(&one_file_code)) return false; ++ if (!generateStructs(&one_file_code)) return false; ++ ++ if (parser_.opts.one_file) { ++ return SaveType(file_name_ + "_generated", *parser_.current_namespace_, ++ one_file_code, true); ++ } ++ + return true; + } + + private: +- bool generateEnums() { ++ bool generateEnums(std::string *one_file_code) { + for (auto it = parser_.enums_.vec.begin(); it != parser_.enums_.vec.end(); + ++it) { + auto &enum_def = **it; +@@ -1712,12 +1734,19 @@ + if (parser_.opts.generate_object_based_api & enum_def.is_union) { + GenUnionCreator(enum_def, &enumcode); + } +- if (!SaveType(enum_def, enumcode, false)) return false; ++ ++ if (parser_.opts.one_file && !enumcode.empty()) { ++ *one_file_code += enumcode + "\n\n"; ++ } else { ++ if (!SaveType(enum_def.name, *enum_def.defined_namespace, enumcode, ++ false)) ++ return false; ++ } + } + return true; + } + +- bool generateStructs() { ++ bool generateStructs(std::string *one_file_code) { + for (auto it = parser_.structs_.vec.begin(); + it != parser_.structs_.vec.end(); ++it) { + auto &struct_def = **it; +@@ -1726,7 +1755,14 @@ + if (parser_.opts.generate_object_based_api) { + GenStructForObjectAPI(struct_def, &declcode); + } +- if (!SaveType(struct_def, declcode, true)) return false; ++ ++ if (parser_.opts.one_file && !declcode.empty()) { ++ *one_file_code += declcode + "\n\n"; ++ } else { ++ if (!SaveType(struct_def.name, *struct_def.defined_namespace, declcode, ++ true)) ++ return false; ++ } + } + return true; + } +@@ -1745,12 +1781,12 @@ + } + + // Save out the generated code for a Python Table type. +- bool SaveType(const Definition &def, const std::string &classcode, +- bool needs_imports) { ++ bool SaveType(const std::string &defname, const Namespace &ns, ++ const std::string &classcode, bool needs_imports) { + if (!classcode.length()) return true; + + std::string namespace_dir = path_; +- auto &namespaces = def.defined_namespace->components; ++ auto &namespaces = ns.components; + for (auto it = namespaces.begin(); it != namespaces.end(); ++it) { + if (it != namespaces.begin()) namespace_dir += kPathSeparator; + namespace_dir += *it; +@@ -1759,10 +1795,9 @@ + } + + std::string code = ""; +- BeginFile(LastNamespacePart(*def.defined_namespace), needs_imports, &code); ++ BeginFile(LastNamespacePart(ns), needs_imports, &code); + code += classcode; +- std::string filename = +- NamespaceDir(*def.defined_namespace) + NormalizedName(def) + ".py"; ++ std::string filename = NamespaceDir(ns) + defname + ".py"; + return SaveFile(filename.c_str(), code, false); + } + +diff -urN a/src/idl_gen_rust.cpp b/src/idl_gen_rust.cpp +--- a/src/idl_gen_rust.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_rust.cpp 2023-01-13 07:47:08.917252407 +0000 +@@ -51,6 +51,10 @@ + return s; + } + ++std::string UnionTypeFieldName(const FieldDef &field) { ++ return MakeSnakeCase(field.name + "_type"); ++} ++ + // Encapsulate all logical field types in this enum. This allows us to write + // field logic based on type switches, instead of branches on the properties + // set on the Type. +@@ -178,31 +182,9 @@ + return ftBool; + } + +-// If the second parameter is false then wrap the first with Option<...> +-std::string WrapInOptionIfNotRequired(std::string s, bool required) { +- if (required) { +- return s; +- } else { +- return "Option<" + s + ">"; +- } +-} +- +-// If the second parameter is false then add .unwrap() +-std::string AddUnwrapIfRequired(std::string s, bool required) { +- if (required) { +- return s + ".unwrap()"; +- } else { +- return s; +- } +-} +- + bool IsBitFlagsEnum(const EnumDef &enum_def) { + return enum_def.attributes.Lookup("bit_flags") != nullptr; + } +-bool IsBitFlagsEnum(const FieldDef &field) { +- EnumDef *ed = field.value.type.enum_def; +- return ed && IsBitFlagsEnum(*ed); +-} + + // TableArgs make required non-scalars "Option<_>". + // TODO(cneo): Rework how we do defaults and stuff. +@@ -210,6 +192,68 @@ + return field.IsOptional() || !IsScalar(field.value.type.base_type); + } + ++bool GenerateRustModuleRootFile(const Parser &parser, ++ const std::string &output_dir) { ++ if (!parser.opts.rust_module_root_file) { ++ // Don't generate a root file when generating one file. This isn't an error ++ // so return true. ++ return true; ++ } ++ // We gather the symbols into a tree of namespaces (which are rust mods) and ++ // generate a file that gathers them all. ++ struct Module { ++ std::map sub_modules; ++ std::vector generated_files; ++ // Add a symbol into the tree. ++ void Insert(const Definition *s, const std::string suffix) { ++ const Definition &symbol = *s; ++ Module *current_module = this; ++ for (auto it = symbol.defined_namespace->components.begin(); ++ it != symbol.defined_namespace->components.end(); it++) { ++ std::string ns_component = MakeSnakeCase(*it); ++ current_module = ¤t_module->sub_modules[ns_component]; ++ } ++ current_module->generated_files.push_back(MakeSnakeCase(symbol.name) + ++ suffix); ++ } ++ // Recursively create the importer file. ++ void GenerateImports(CodeWriter &code) { ++ for (auto it = sub_modules.begin(); it != sub_modules.end(); it++) { ++ code += "pub mod " + it->first + " {"; ++ code.IncrementIdentLevel(); ++ code += "use super::*;"; ++ it->second.GenerateImports(code); ++ code.DecrementIdentLevel(); ++ code += "} // " + it->first; ++ } ++ for (auto it = generated_files.begin(); it != generated_files.end(); ++ it++) { ++ code += "mod " + *it + ";"; ++ code += "pub use self::" + *it + "::*;"; ++ } ++ } ++ }; ++ Module root_module; ++ for (auto it = parser.enums_.vec.begin(); it != parser.enums_.vec.end(); ++ it++) { ++ root_module.Insert(*it, parser.opts.filename_suffix); ++ } ++ for (auto it = parser.structs_.vec.begin(); it != parser.structs_.vec.end(); ++ it++) { ++ root_module.Insert(*it, parser.opts.filename_suffix); ++ } ++ CodeWriter code(" "); ++ // TODO(caspern): Move generated warning out of BaseGenerator. ++ code += ++ "// Automatically generated by the Flatbuffers compiler. " ++ "Do not modify."; ++ root_module.GenerateImports(code); ++ const bool success = ++ SaveFile((output_dir + "mod.rs").c_str(), code.ToString(), false); ++ code.Clear(); ++ return success; ++} ++ + namespace rust { + + class RustGenerator : public BaseGenerator { +@@ -320,13 +364,85 @@ + "ENUM_MAX", + "ENUM_MIN", + "ENUM_VALUES", ++ // clang-format on + }; + for (auto kw = keywords; *kw; kw++) keywords_.insert(*kw); ++ code_.SetPadding(" "); ++ } ++ ++ bool generate() { ++ if (!parser_.opts.rust_module_root_file) { ++ return GenerateOneFile(); ++ } else { ++ return GenerateIndividualFiles(); ++ } ++ } ++ ++ template ++ bool GenerateSymbols(const SymbolTable &symbols, ++ std::function gen_symbol) { ++ for (auto it = symbols.vec.begin(); it != symbols.vec.end(); it++) { ++ const T &symbol = **it; ++ if (symbol.generated) continue; ++ code_.Clear(); ++ code_ += "// " + std::string(FlatBuffersGeneratedWarning()); ++ code_ += "extern crate flatbuffers;"; ++ code_ += "use std::mem;"; ++ code_ += "use std::cmp::Ordering;"; ++ if (parser_.opts.rust_serialize) { ++ code_ += "extern crate serde;"; ++ code_ += ++ "use self::serde::ser::{Serialize, Serializer, SerializeStruct};"; ++ } ++ code_ += "use self::flatbuffers::{EndianScalar, Follow};"; ++ code_ += "use super::*;"; ++ cur_name_space_ = symbol.defined_namespace; ++ gen_symbol(symbol); ++ std::stringstream file_path; ++ file_path << path_; ++ // Create filepath. ++ if (symbol.defined_namespace) ++ for (auto i = symbol.defined_namespace->components.begin(); ++ i != symbol.defined_namespace->components.end(); i++) { ++ file_path << MakeSnakeCase(*i) << kPathSeparator; ++ EnsureDirExists(file_path.str()); ++ } ++ file_path << MakeSnakeCase(symbol.name) << parser_.opts.filename_suffix ++ << ".rs"; ++ const bool save_success = ++ SaveFile(file_path.str().c_str(), code_.ToString(), ++ /*binary=*/false); ++ if (!save_success) return false; ++ } ++ return true; + } + ++ bool GenerateIndividualFiles() { ++ code_.Clear(); ++ // Don't bother with imports. Use absolute paths everywhere. ++ return GenerateSymbols( ++ parser_.enums_, [&](const EnumDef &e) { this->GenEnum(e); }) && ++ GenerateSymbols( ++ parser_.structs_, [&](const StructDef &s) { ++ if (s.fixed) { ++ this->GenStruct(s); ++ } else { ++ this->GenTable(s); ++ if (this->parser_.opts.generate_object_based_api) { ++ this->GenTableObject(s); ++ } ++ } ++ if (this->parser_.root_struct_def_ == &s) { ++ this->GenRootTableFuncs(s); ++ } ++ }); ++ } ++ ++ // Generates code organized by .fbs files. This is broken legacy behavior ++ // that does not work with multiple fbs files with shared namespaces. + // Iterate through all definitions we haven't generated code for (enums, + // structs, and tables) and output them to a single file. +- bool generate() { ++ bool GenerateOneFile() { + code_.Clear(); + code_ += "// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n"; + +@@ -496,32 +612,25 @@ + // example: f(A, D::E) -> super::D::E + // does not include leaf object (typically a struct type). + +- size_t i = 0; + std::stringstream stream; +- +- auto s = src->components.begin(); +- auto d = dst->components.begin(); +- for (;;) { +- if (s == src->components.end()) { break; } +- if (d == dst->components.end()) { break; } +- if (*s != *d) { break; } +- ++s; +- ++d; +- ++i; +- } +- +- for (; s != src->components.end(); ++s) { stream << "super::"; } +- for (; d != dst->components.end(); ++d) { +- stream << MakeSnakeCase(*d) + "::"; +- } ++ size_t common = 0; ++ std::vector s, d; ++ if (src) s = src->components; ++ if (dst) d = dst->components; ++ while (common < s.size() && common < d.size() && s[common] == d[common]) ++ common++; ++ // If src namespace is empty, this must be an absolute path. ++ for (size_t i = common; i < s.size(); i++) stream << "super::"; ++ for (size_t i = common; i < d.size(); i++) ++ stream << MakeSnakeCase(d[i]) + "::"; + return stream.str(); + } + + // Generate a comment from the schema. + void GenComment(const std::vector &dc, const char *prefix = "") { +- std::string text; +- ::flatbuffers::GenComment(dc, &text, nullptr, prefix); +- code_ += text + "\\"; ++ for (auto it = dc.begin(); it != dc.end(); it++) { ++ code_ += std::string(prefix) + "///" + *it; ++ } + } + + // Return a Rust type from the table in idl.h. +@@ -618,7 +727,9 @@ + const auto &ev = **it; + code_.SetValue("VARIANT", Name(ev)); + code_.SetValue("VALUE", enum_def.ToString(ev)); ++ code_.IncrementIdentLevel(); + cb(ev); ++ code_.DecrementIdentLevel(); + } + } + void ForAllEnumValues(const EnumDef &enum_def, std::function cb) { +@@ -655,8 +766,8 @@ + code_ += " #[derive(Default)]"; + code_ += " pub struct {{ENUM_NAME}}: {{BASE_TYPE}} {"; + ForAllEnumValues1(enum_def, [&](const EnumVal &ev) { +- this->GenComment(ev.doc_comment, " "); +- code_ += " const {{VARIANT}} = {{VALUE}};"; ++ this->GenComment(ev.doc_comment, " "); ++ code_ += " const {{VARIANT}} = {{VALUE}};"; + }); + code_ += " }"; + code_ += " }"; +@@ -686,7 +797,7 @@ + code_ += "pub const ENUM_VALUES_{{ENUM_NAME_CAPS}}: [{{ENUM_NAME}}; " + + num_fields + "] = ["; + ForAllEnumValues1(enum_def, [&](const EnumVal &ev) { +- code_ += " " + GetEnumValue(enum_def, ev) + ","; ++ code_ += GetEnumValue(enum_def, ev) + ","; + }); + code_ += "];"; + code_ += ""; +@@ -703,21 +814,21 @@ + code_ += "#[allow(non_upper_case_globals)]"; + code_ += "impl {{ENUM_NAME}} {"; + ForAllEnumValues1(enum_def, [&](const EnumVal &ev) { +- this->GenComment(ev.doc_comment, " "); +- code_ += " pub const {{VARIANT}}: Self = Self({{VALUE}});"; ++ this->GenComment(ev.doc_comment); ++ code_ += "pub const {{VARIANT}}: Self = Self({{VALUE}});"; + }); + code_ += ""; + // Generate Associated constants + code_ += " pub const ENUM_MIN: {{BASE_TYPE}} = {{ENUM_MIN_BASE_VALUE}};"; + code_ += " pub const ENUM_MAX: {{BASE_TYPE}} = {{ENUM_MAX_BASE_VALUE}};"; + code_ += " pub const ENUM_VALUES: &'static [Self] = &["; +- ForAllEnumValues(enum_def, [&]() { code_ += " Self::{{VARIANT}},"; }); ++ ForAllEnumValues(enum_def, [&]() { code_ += " Self::{{VARIANT}},"; }); + code_ += " ];"; + code_ += " /// Returns the variant's name or \"\" if unknown."; + code_ += " pub fn variant_name(self) -> Option<&'static str> {"; + code_ += " match self {"; + ForAllEnumValues(enum_def, [&]() { +- code_ += " Self::{{VARIANT}} => Some(\"{{VARIANT}}\"),"; ++ code_ += " Self::{{VARIANT}} => Some(\"{{VARIANT}}\"),"; + }); + code_ += " _ => None,"; + code_ += " }"; +@@ -741,6 +852,27 @@ + code_.SetValue("INTO_BASE", "self.0"); + } + ++ // Implement serde::Serialize ++ if (parser_.opts.rust_serialize) { ++ code_ += "impl Serialize for {{ENUM_NAME}} {"; ++ code_ += ++ " fn serialize(&self, serializer: S) -> Result"; ++ code_ += " where"; ++ code_ += " S: Serializer,"; ++ code_ += " {"; ++ if (IsBitFlagsEnum(enum_def)) { ++ code_ += " serializer.serialize_u32(self.bits() as u32)"; ++ } else { ++ code_ += ++ " serializer.serialize_unit_variant(\"{{ENUM_NAME}}\", self.0 " ++ "as " ++ "u32, self.variant_name().unwrap())"; ++ } ++ code_ += " }"; ++ code_ += "}"; ++ code_ += ""; ++ } ++ + // Generate Follow and Push so we can serialize and stuff. + code_ += "impl<'a> flatbuffers::Follow<'a> for {{ENUM_NAME}} {"; + code_ += " type Inner = Self;"; +@@ -813,7 +945,9 @@ + code_.SetValue("U_ELEMENT_NAME", MakeSnakeCase(Name(enum_val))); + code_.SetValue("U_ELEMENT_TABLE_TYPE", + NamespacedNativeName(*enum_val.union_type.struct_def)); ++ code_.IncrementIdentLevel(); + cb(); ++ code_.DecrementIdentLevel(); + } + } + void GenUnionObject(const EnumDef &enum_def) { +@@ -822,12 +956,14 @@ + code_.SetValue("NATIVE_NAME", NativeName(enum_def)); + + // Generate native union. ++ code_ += "#[allow(clippy::upper_case_acronyms)]"; // NONE's spelling is ++ // intended. + code_ += "#[non_exhaustive]"; + code_ += "#[derive(Debug, Clone, PartialEq)]"; + code_ += "pub enum {{NATIVE_NAME}} {"; + code_ += " NONE,"; + ForAllUnionObjectVariantsBesidesNone(enum_def, [&] { +- code_ += " {{NATIVE_VARIANT}}(Box<{{U_ELEMENT_TABLE_TYPE}}>),"; ++ code_ += "{{NATIVE_VARIANT}}(Box<{{U_ELEMENT_TABLE_TYPE}}>),"; + }); + code_ += "}"; + // Generate Default (NONE). +@@ -847,7 +983,7 @@ + code_ += " Self::NONE => {{ENUM_NAME}}::NONE,"; + ForAllUnionObjectVariantsBesidesNone(enum_def, [&] { + code_ += +- " Self::{{NATIVE_VARIANT}}(_) => {{ENUM_NAME}}::" ++ " Self::{{NATIVE_VARIANT}}(_) => {{ENUM_NAME}}::" + "{{VARIANT_NAME}},"; + }); + code_ += " }"; +@@ -860,9 +996,8 @@ + code_ += " match self {"; + code_ += " Self::NONE => None,"; + ForAllUnionObjectVariantsBesidesNone(enum_def, [&] { +- code_ += +- " Self::{{NATIVE_VARIANT}}(v) => " +- "Some(v.pack(fbb).as_union_value()),"; ++ code_ += " Self::{{NATIVE_VARIANT}}(v) => \\"; ++ code_ += "Some(v.pack(fbb).as_union_value()),"; + }); + code_ += " }"; + code_ += " }"; +@@ -871,44 +1006,44 @@ + ForAllUnionObjectVariantsBesidesNone(enum_def, [&] { + // Move accessor. + code_ += +- " /// If the union variant matches, return the owned " ++ "/// If the union variant matches, return the owned " + "{{U_ELEMENT_TABLE_TYPE}}, setting the union to NONE."; + code_ += +- " pub fn take_{{U_ELEMENT_NAME}}(&mut self) -> " ++ "pub fn take_{{U_ELEMENT_NAME}}(&mut self) -> " + "Option> {"; +- code_ += " if let Self::{{NATIVE_VARIANT}}(_) = self {"; +- code_ += " let v = std::mem::replace(self, Self::NONE);"; +- code_ += " if let Self::{{NATIVE_VARIANT}}(w) = v {"; +- code_ += " Some(w)"; +- code_ += " } else {"; +- code_ += " unreachable!()"; +- code_ += " }"; ++ code_ += " if let Self::{{NATIVE_VARIANT}}(_) = self {"; ++ code_ += " let v = std::mem::replace(self, Self::NONE);"; ++ code_ += " if let Self::{{NATIVE_VARIANT}}(w) = v {"; ++ code_ += " Some(w)"; + code_ += " } else {"; +- code_ += " None"; ++ code_ += " unreachable!()"; + code_ += " }"; ++ code_ += " } else {"; ++ code_ += " None"; + code_ += " }"; ++ code_ += "}"; + // Immutable reference accessor. + code_ += +- " /// If the union variant matches, return a reference to the " ++ "/// If the union variant matches, return a reference to the " + "{{U_ELEMENT_TABLE_TYPE}}."; + code_ += +- " pub fn as_{{U_ELEMENT_NAME}}(&self) -> " ++ "pub fn as_{{U_ELEMENT_NAME}}(&self) -> " + "Option<&{{U_ELEMENT_TABLE_TYPE}}> {"; + code_ += +- " if let Self::{{NATIVE_VARIANT}}(v) = self " ++ " if let Self::{{NATIVE_VARIANT}}(v) = self " + "{ Some(v.as_ref()) } else { None }"; +- code_ += " }"; ++ code_ += "}"; + // Mutable reference accessor. + code_ += +- " /// If the union variant matches, return a mutable reference" ++ "/// If the union variant matches, return a mutable reference" + " to the {{U_ELEMENT_TABLE_TYPE}}."; + code_ += +- " pub fn as_{{U_ELEMENT_NAME}}_mut(&mut self) -> " ++ "pub fn as_{{U_ELEMENT_NAME}}_mut(&mut self) -> " + "Option<&mut {{U_ELEMENT_TABLE_TYPE}}> {"; + code_ += +- " if let Self::{{NATIVE_VARIANT}}(v) = self " ++ " if let Self::{{NATIVE_VARIANT}}(v) = self " + "{ Some(v.as_mut()) } else { None }"; +- code_ += " }"; ++ code_ += "}"; + }); + code_ += "}"; // End union methods impl. + } +@@ -960,7 +1095,7 @@ + field.IsRequired() ? "\"\"" : "\"" + field.value.constant + "\""; + if (context == kObject) return defval + ".to_string()"; + if (context == kAccessor) return "&" + defval; +- FLATBUFFERS_ASSERT("Unreachable."); ++ FLATBUFFERS_ASSERT(false); + return "INVALID_CODE_GENERATION"; + } + +@@ -986,7 +1121,7 @@ + return "Default::default()"; + } + } +- FLATBUFFERS_ASSERT("Unreachable."); ++ FLATBUFFERS_ASSERT(false); + return "INVALID_CODE_GENERATION"; + } + +@@ -1478,10 +1613,11 @@ + // Generates a fully-qualified name getter for use with --gen-name-strings + void GenFullyQualifiedNameGetter(const StructDef &struct_def, + const std::string &name) { +- code_ += " pub const fn get_fully_qualified_name() -> &'static str {"; +- code_ += " \"" + +- struct_def.defined_namespace->GetFullyQualifiedName(name) + "\""; +- code_ += " }"; ++ const std::string fully_qualified_name = ++ struct_def.defined_namespace->GetFullyQualifiedName(name); ++ code_ += " pub const fn get_fully_qualified_name() -> &'static str {"; ++ code_ += " \"" + fully_qualified_name + "\""; ++ code_ += " }"; + code_ += ""; + } + +@@ -1516,7 +1652,10 @@ + code_.SetValue("OFFSET_VALUE", NumToString(field.value.offset)); + code_.SetValue("FIELD_NAME", Name(field)); + code_.SetValue("BLDR_DEF_VAL", GetDefaultValue(field, kBuilder)); ++ code_.SetValue("DISCRIMINANT", UnionTypeFieldName(field)); ++ code_.IncrementIdentLevel(); + cb(field); ++ code_.DecrementIdentLevel(); + }; + const auto &fields = struct_def.fields.vec; + if (reversed) { +@@ -1545,41 +1684,47 @@ + code_ += "}"; + code_ += ""; + code_ += "impl<'a> flatbuffers::Follow<'a> for {{STRUCT_NAME}}<'a> {"; +- code_ += " type Inner = {{STRUCT_NAME}}<'a>;"; +- code_ += " #[inline]"; +- code_ += " fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {"; +- code_ += " Self { _tab: flatbuffers::Table { buf, loc } }"; +- code_ += " }"; ++ code_ += " type Inner = {{STRUCT_NAME}}<'a>;"; ++ code_ += " #[inline]"; ++ code_ += " fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {"; ++ code_ += " Self { _tab: flatbuffers::Table { buf, loc } }"; ++ code_ += " }"; + code_ += "}"; + code_ += ""; + code_ += "impl<'a> {{STRUCT_NAME}}<'a> {"; + ++ // Generate field id constants. ++ ForAllTableFields(struct_def, [&](const FieldDef &unused) { ++ (void)unused; ++ code_ += ++ "pub const {{OFFSET_NAME}}: flatbuffers::VOffsetT = " ++ "{{OFFSET_VALUE}};"; ++ }); ++ code_ += ""; ++ + if (parser_.opts.generate_name_strings) { + GenFullyQualifiedNameGetter(struct_def, struct_def.name); + } + +- code_ += " #[inline]"; ++ code_ += " #[inline]"; + code_ += +- " pub fn init_from_table(table: flatbuffers::Table<'a>) -> " ++ " pub fn init_from_table(table: flatbuffers::Table<'a>) -> " + "Self {"; +- code_ += " {{STRUCT_NAME}} { _tab: table }"; +- code_ += " }"; ++ code_ += " {{STRUCT_NAME}} { _tab: table }"; ++ code_ += " }"; + + // Generate a convenient create* function that uses the above builder + // to create a table in one function call. + code_.SetValue("MAYBE_US", struct_def.fields.vec.size() == 0 ? "_" : ""); + code_.SetValue("MAYBE_LT", + TableBuilderArgsNeedsLifetime(struct_def) ? "<'args>" : ""); +- code_ += " #[allow(unused_mut)]"; +- code_ += " pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>("; +- code_ += +- " _fbb: " +- "&'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,"; +- code_ += +- " {{MAYBE_US}}args: &'args {{STRUCT_NAME}}Args{{MAYBE_LT}})" +- " -> flatbuffers::WIPOffset<{{STRUCT_NAME}}<'bldr>> {"; ++ code_ += " #[allow(unused_mut)]"; ++ code_ += " pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>("; ++ code_ += " _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,"; ++ code_ += " {{MAYBE_US}}args: &'args {{STRUCT_NAME}}Args{{MAYBE_LT}}"; ++ code_ += " ) -> flatbuffers::WIPOffset<{{STRUCT_NAME}}<'bldr>> {"; + +- code_ += " let mut builder = {{STRUCT_NAME}}Builder::new(_fbb);"; ++ code_ += " let mut builder = {{STRUCT_NAME}}Builder::new(_fbb);"; + for (size_t size = struct_def.sortbysize ? sizeof(largest_scalar_t) : 1; + size; size /= 2) { + ForAllTableFields( +@@ -1590,23 +1735,23 @@ + return; + if (IsOptionalToBuilder(field)) { + code_ += +- " if let Some(x) = args.{{FIELD_NAME}} " ++ " if let Some(x) = args.{{FIELD_NAME}} " + "{ builder.add_{{FIELD_NAME}}(x); }"; + } else { +- code_ += " builder.add_{{FIELD_NAME}}(args.{{FIELD_NAME}});"; ++ code_ += " builder.add_{{FIELD_NAME}}(args.{{FIELD_NAME}});"; + } + }, + /*reverse=*/true); + } +- code_ += " builder.finish()"; +- code_ += " }"; ++ code_ += " builder.finish()"; ++ code_ += " }"; + code_ += ""; + // Generate Object API Packer function. + if (parser_.opts.generate_object_based_api) { + // TODO(cneo): Replace more for loops with ForAllX stuff. + // TODO(cneo): Manage indentation with IncrementIdentLevel? + code_.SetValue("OBJECT_NAME", NativeName(struct_def)); +- code_ += " pub fn unpack(&self) -> {{OBJECT_NAME}} {"; ++ code_ += " pub fn unpack(&self) -> {{OBJECT_NAME}} {"; + ForAllObjectTableFields(struct_def, [&](const FieldDef &field) { + const Type &type = field.value.type; + switch (GetFullType(type)) { +@@ -1614,7 +1759,7 @@ + case ftBool: + case ftFloat: + case ftEnumKey: { +- code_ += " let {{FIELD_NAME}} = self.{{FIELD_NAME}}();"; ++ code_ += " let {{FIELD_NAME}} = self.{{FIELD_NAME}}();"; + return; + } + case ftUnionKey: return; +@@ -1623,27 +1768,22 @@ + code_.SetValue("ENUM_NAME", WrapInNameSpace(enum_def)); + code_.SetValue("NATIVE_ENUM_NAME", NamespacedNativeName(enum_def)); + code_ += +- " let {{FIELD_NAME}} = match " +- "self.{{FIELD_NAME}}_type() {"; +- code_ += +- " {{ENUM_NAME}}::NONE =>" +- " {{NATIVE_ENUM_NAME}}::NONE,"; ++ " let {{FIELD_NAME}} = match self.{{FIELD_NAME}}_type() {"; ++ code_ += " {{ENUM_NAME}}::NONE => {{NATIVE_ENUM_NAME}}::NONE,"; + ForAllUnionObjectVariantsBesidesNone(enum_def, [&] { + code_ += +- " {{ENUM_NAME}}::{{VARIANT_NAME}} => " ++ " {{ENUM_NAME}}::{{VARIANT_NAME}} => " + "{{NATIVE_ENUM_NAME}}::{{NATIVE_VARIANT}}(Box::new("; ++ code_ += " self.{{FIELD_NAME}}_as_{{U_ELEMENT_NAME}}()"; + code_ += +- " self.{{FIELD_NAME}}_as_" +- "{{U_ELEMENT_NAME}}()"; +- code_ += +- " .expect(\"Invalid union table, " ++ " .expect(\"Invalid union table, " + "expected `{{ENUM_NAME}}::{{VARIANT_NAME}}`.\")"; +- code_ += " .unpack()"; +- code_ += " )),"; ++ code_ += " .unpack()"; ++ code_ += " )),"; + }); + // Maybe we shouldn't throw away unknown discriminants? +- code_ += " _ => {{NATIVE_ENUM_NAME}}::NONE,"; +- code_ += " };"; ++ code_ += " _ => {{NATIVE_ENUM_NAME}}::NONE,"; ++ code_ += " };"; + return; + } + // The rest of the types need special handling based on if the field +@@ -1698,32 +1838,25 @@ + } + } + if (field.IsOptional()) { +- code_ += " let {{FIELD_NAME}} = self.{{FIELD_NAME}}().map(|x| {"; +- code_ += " {{EXPR}}"; +- code_ += " });"; ++ code_ += " let {{FIELD_NAME}} = self.{{FIELD_NAME}}().map(|x| {"; ++ code_ += " {{EXPR}}"; ++ code_ += " });"; + } else { +- code_ += " let {{FIELD_NAME}} = {"; +- code_ += " let x = self.{{FIELD_NAME}}();"; +- code_ += " {{EXPR}}"; +- code_ += " };"; ++ code_ += " let {{FIELD_NAME}} = {"; ++ code_ += " let x = self.{{FIELD_NAME}}();"; ++ code_ += " {{EXPR}}"; ++ code_ += " };"; + } + }); +- code_ += " {{OBJECT_NAME}} {"; ++ code_ += " {{OBJECT_NAME}} {"; + ForAllObjectTableFields(struct_def, [&](const FieldDef &field) { + if (field.value.type.base_type == BASE_TYPE_UTYPE) return; +- code_ += " {{FIELD_NAME}},"; ++ code_ += " {{FIELD_NAME}},"; + }); +- code_ += " }"; + code_ += " }"; ++ code_ += " }"; + } + +- // Generate field id constants. +- ForAllTableFields(struct_def, [&](const FieldDef &unused) { +- (void)unused; +- code_ += +- " pub const {{OFFSET_NAME}}: flatbuffers::VOffsetT = " +- "{{OFFSET_VALUE}};"; +- }); + if (struct_def.fields.vec.size() > 0) code_ += ""; + + // Generate the accessors. Each has one of two forms: +@@ -1741,11 +1874,11 @@ + code_.SetValue("RETURN_TYPE", + GenTableAccessorFuncReturnType(field, "'a")); + +- this->GenComment(field.doc_comment, " "); +- code_ += " #[inline]"; +- code_ += " pub fn {{FIELD_NAME}}(&self) -> {{RETURN_TYPE}} {"; +- code_ += " " + GenTableAccessorFuncBody(field, "'a"); +- code_ += " }"; ++ this->GenComment(field.doc_comment); ++ code_ += "#[inline]"; ++ code_ += "pub fn {{FIELD_NAME}}(&self) -> {{RETURN_TYPE}} {"; ++ code_ += " " + GenTableAccessorFuncBody(field, "'a"); ++ code_ += "}"; + + // Generate a comparison function for this field if it is a key. + if (field.key) { GenKeyFieldMethods(field); } +@@ -1763,38 +1896,37 @@ + FLATBUFFERS_ASSERT(nested_root); // Guaranteed to exist by parser. + + code_.SetValue("NESTED", WrapInNameSpace(*nested_root)); +- code_ += " pub fn {{FIELD_NAME}}_nested_flatbuffer(&'a self) -> \\"; ++ code_ += "pub fn {{FIELD_NAME}}_nested_flatbuffer(&'a self) -> \\"; + if (field.IsRequired()) { + code_ += "{{NESTED}}<'a> {"; +- code_ += " let data = self.{{FIELD_NAME}}();"; +- code_ += " use flatbuffers::Follow;"; ++ code_ += " let data = self.{{FIELD_NAME}}();"; ++ code_ += " use flatbuffers::Follow;"; + code_ += +- " >>" ++ " >>" + "::follow(data, 0)"; + } else { + code_ += "Option<{{NESTED}}<'a>> {"; +- code_ += " self.{{FIELD_NAME}}().map(|data| {"; +- code_ += " use flatbuffers::Follow;"; ++ code_ += " self.{{FIELD_NAME}}().map(|data| {"; ++ code_ += " use flatbuffers::Follow;"; + code_ += +- " >>" ++ " >>" + "::follow(data, 0)"; +- code_ += " })"; ++ code_ += " })"; + } +- code_ += " }"; ++ code_ += "}"; + } + }); + + // Explicit specializations for union accessors + ForAllTableFields(struct_def, [&](const FieldDef &field) { + if (field.value.type.base_type != BASE_TYPE_UNION) return; +- code_.SetValue("FIELD_TYPE_FIELD_NAME", field.name); + ForAllUnionVariantsBesidesNone( + *field.value.type.enum_def, [&](const EnumVal &unused) { + (void)unused; +- code_ += " #[inline]"; +- code_ += " #[allow(non_snake_case)]"; ++ code_ += "#[inline]"; ++ code_ += "#[allow(non_snake_case)]"; + code_ += +- " pub fn {{FIELD_NAME}}_as_{{U_ELEMENT_NAME}}(&self) -> " ++ "pub fn {{FIELD_NAME}}_as_{{U_ELEMENT_NAME}}(&self) -> " + "Option<{{U_ELEMENT_TABLE_TYPE}}<'a>> {"; + // If the user defined schemas name a field that clashes with a + // language reserved word, flatc will try to escape the field name +@@ -1808,24 +1940,22 @@ + // + // To avoid this problem the type field name is used unescaped here: + code_ += +- " if self.{{FIELD_TYPE_FIELD_NAME}}_type() == " +- "{{U_ELEMENT_ENUM_TYPE}} {"; ++ " if self.{{DISCRIMINANT}}() == {{U_ELEMENT_ENUM_TYPE}} {"; + + // The following logic is not tested in the integration test, + // as of April 10, 2020 + if (field.IsRequired()) { +- code_ += " let u = self.{{FIELD_NAME}}();"; +- code_ += +- " Some({{U_ELEMENT_TABLE_TYPE}}::init_from_table(u))"; ++ code_ += " let u = self.{{FIELD_NAME}}();"; ++ code_ += " Some({{U_ELEMENT_TABLE_TYPE}}::init_from_table(u))"; + } else { + code_ += +- " self.{{FIELD_NAME}}().map(" ++ " self.{{FIELD_NAME}}().map(" + "{{U_ELEMENT_TABLE_TYPE}}::init_from_table)"; + } +- code_ += " } else {"; +- code_ += " None"; +- code_ += " }"; ++ code_ += " } else {"; ++ code_ += " None"; + code_ += " }"; ++ code_ += "}"; + code_ += ""; + }); + }); +@@ -1850,29 +1980,34 @@ + // All types besides unions. + code_.SetValue("TY", FollowType(field.value.type, "'_")); + code_ += +- "\n .visit_field::<{{TY}}>(&\"{{FIELD_NAME}}\", " ++ "\n .visit_field::<{{TY}}>(\"{{FIELD_NAME}}\", " + "Self::{{OFFSET_NAME}}, {{IS_REQ}})?\\"; + return; + } + // Unions. +- EnumDef &union_def = *field.value.type.enum_def; ++ const EnumDef &union_def = *field.value.type.enum_def; + code_.SetValue("UNION_TYPE", WrapInNameSpace(union_def)); ++ // TODO: Use the same function that generates the _type field for ++ // consistency. We do not call Name() because it inconsistently ++ // escapes keywords. ++ code_.SetValue("UNION_TYPE_OFFSET_NAME", ++ "VT_" + MakeUpper(field.name + "_type")); + code_ += + "\n .visit_union::<{{UNION_TYPE}}, _>(" +- "&\"{{FIELD_NAME}}_type\", Self::{{OFFSET_NAME}}_TYPE, " +- "&\"{{FIELD_NAME}}\", Self::{{OFFSET_NAME}}, {{IS_REQ}}, " ++ "\"{{FIELD_NAME}}_type\", Self::{{UNION_TYPE_OFFSET_NAME}}, " ++ "\"{{FIELD_NAME}}\", Self::{{OFFSET_NAME}}, {{IS_REQ}}, " + "|key, v, pos| {"; +- code_ += " match key {"; ++ code_ += " match key {"; + ForAllUnionVariantsBesidesNone(union_def, [&](const EnumVal &unused) { + (void)unused; + code_ += +- " {{U_ELEMENT_ENUM_TYPE}} => v.verify_union_variant::" ++ " {{U_ELEMENT_ENUM_TYPE}} => v.verify_union_variant::" + ">(" + "\"{{U_ELEMENT_ENUM_TYPE}}\", pos),"; + }); +- code_ += " _ => Ok(()),"; +- code_ += " }"; +- code_ += " })?\\"; ++ code_ += " _ => Ok(()),"; ++ code_ += " }"; ++ code_ += " })?\\"; + }); + code_ += "\n .finish();"; + code_ += " Ok(())"; +@@ -1885,22 +2020,90 @@ + code_ += "pub struct {{STRUCT_NAME}}Args{{MAYBE_LT}} {"; + ForAllTableFields(struct_def, [&](const FieldDef &field) { + code_.SetValue("PARAM_TYPE", TableBuilderArgsDefnType(field, "'a")); +- code_ += " pub {{FIELD_NAME}}: {{PARAM_TYPE}},"; ++ code_ += " pub {{FIELD_NAME}}: {{PARAM_TYPE}},"; + }); + code_ += "}"; + + // Generate an impl of Default for the *Args type: + code_ += "impl<'a> Default for {{STRUCT_NAME}}Args{{MAYBE_LT}} {"; +- code_ += " #[inline]"; +- code_ += " fn default() -> Self {"; +- code_ += " {{STRUCT_NAME}}Args {"; ++ code_ += " #[inline]"; ++ code_ += " fn default() -> Self {"; ++ code_ += " {{STRUCT_NAME}}Args {"; + ForAllTableFields(struct_def, [&](const FieldDef &field) { +- code_ += " {{FIELD_NAME}}: {{BLDR_DEF_VAL}},\\"; ++ code_ += " {{FIELD_NAME}}: {{BLDR_DEF_VAL}},\\"; + code_ += field.IsRequired() ? " // required field" : ""; + }); +- code_ += " }"; + code_ += " }"; ++ code_ += " }"; + code_ += "}"; ++ code_ += ""; ++ ++ // Implement serde::Serialize ++ if (parser_.opts.rust_serialize) { ++ const auto numFields = struct_def.fields.vec.size(); ++ code_.SetValue("NUM_FIELDS", NumToString(numFields)); ++ code_ += "impl Serialize for {{STRUCT_NAME}}<'_> {"; ++ code_ += ++ " fn serialize(&self, serializer: S) -> Result"; ++ code_ += " where"; ++ code_ += " S: Serializer,"; ++ code_ += " {"; ++ if (numFields == 0) { ++ code_ += ++ " let s = serializer.serialize_struct(\"{{STRUCT_NAME}}\", 0)?;"; ++ } else { ++ code_ += ++ " let mut s = serializer.serialize_struct(\"{{STRUCT_NAME}}\", " ++ "{{NUM_FIELDS}})?;"; ++ } ++ ForAllTableFields(struct_def, [&](const FieldDef &field) { ++ const Type &type = field.value.type; ++ if (IsUnion(type)) { ++ if (type.base_type == BASE_TYPE_UNION) { ++ const auto &enum_def = *type.enum_def; ++ code_.SetValue("ENUM_NAME", WrapInNameSpace(enum_def)); ++ code_.SetValue("FIELD_TYPE_FIELD_NAME", field.name); ++ ++ code_ += " match self.{{FIELD_TYPE_FIELD_NAME}}_type() {"; ++ code_ += " {{ENUM_NAME}}::NONE => (),"; ++ ForAllUnionObjectVariantsBesidesNone(enum_def, [&] { ++ code_.SetValue("FIELD_TYPE_FIELD_NAME", field.name); ++ code_ += " {{ENUM_NAME}}::{{VARIANT_NAME}} => {"; ++ code_ += ++ " let f = " ++ "self.{{FIELD_TYPE_FIELD_NAME}}_as_{{U_ELEMENT_NAME}}()"; ++ code_ += ++ " .expect(\"Invalid union table, expected " ++ "`{{ENUM_NAME}}::{{VARIANT_NAME}}`.\");"; ++ code_ += " s.serialize_field(\"{{FIELD_NAME}}\", &f)?;"; ++ code_ += " }"; ++ }); ++ code_ += " _ => unimplemented!(),"; ++ code_ += " }"; ++ } else { ++ code_ += ++ " s.serialize_field(\"{{FIELD_NAME}}\", " ++ "&self.{{FIELD_NAME}}())?;"; ++ } ++ } else { ++ if (field.IsOptional()) { ++ code_ += " if let Some(f) = self.{{FIELD_NAME}}() {"; ++ code_ += " s.serialize_field(\"{{FIELD_NAME}}\", &f)?;"; ++ code_ += " } else {"; ++ code_ += " s.skip_field(\"{{FIELD_NAME}}\")?;"; ++ code_ += " }"; ++ } else { ++ code_ += ++ " s.serialize_field(\"{{FIELD_NAME}}\", " ++ "&self.{{FIELD_NAME}}())?;"; ++ } ++ } ++ }); ++ code_ += " s.end()"; ++ code_ += " }"; ++ code_ += "}"; ++ code_ += ""; ++ } + + // Generate a builder struct: + code_ += "pub struct {{STRUCT_NAME}}Builder<'a: 'b, 'b> {"; +@@ -1929,18 +2132,18 @@ + code_.SetValue("FIELD_OFFSET", Name(struct_def) + "::" + offset); + code_.SetValue("FIELD_TYPE", TableBuilderArgsAddFuncType(field, "'b ")); + code_.SetValue("FUNC_BODY", TableBuilderArgsAddFuncBody(field)); +- code_ += " #[inline]"; ++ code_ += "#[inline]"; + code_ += +- " pub fn add_{{FIELD_NAME}}(&mut self, {{FIELD_NAME}}: " ++ "pub fn add_{{FIELD_NAME}}(&mut self, {{FIELD_NAME}}: " + "{{FIELD_TYPE}}) {"; + if (is_scalar && !field.IsOptional()) { + code_ += +- " {{FUNC_BODY}}({{FIELD_OFFSET}}, {{FIELD_NAME}}, " ++ " {{FUNC_BODY}}({{FIELD_OFFSET}}, {{FIELD_NAME}}, " + "{{BLDR_DEF_VAL}});"; + } else { +- code_ += " {{FUNC_BODY}}({{FIELD_OFFSET}}, {{FIELD_NAME}});"; ++ code_ += " {{FUNC_BODY}}({{FIELD_OFFSET}}, {{FIELD_NAME}});"; + } +- code_ += " }"; ++ code_ += "}"; + }); + + // Struct initializer (all fields required); +@@ -1966,7 +2169,7 @@ + ForAllTableFields(struct_def, [&](const FieldDef &field) { + if (!field.IsRequired()) return; + code_ += +- " self.fbb_.required(o, {{STRUCT_NAME}}::{{OFFSET_NAME}}," ++ " self.fbb_.required(o, {{STRUCT_NAME}}::{{OFFSET_NAME}}," + "\"{{FIELD_NAME}}\");"; + }); + code_ += " flatbuffers::WIPOffset::new(o.value())"; +@@ -1983,35 +2186,33 @@ + if (GetFullType(field.value.type) == ftUnionValue) { + // Generate a match statement to handle unions properly. + code_.SetValue("KEY_TYPE", GenTableAccessorFuncReturnType(field, "")); +- code_.SetValue("FIELD_TYPE_FIELD_NAME", field.name); + code_.SetValue("UNION_ERR", + "&\"InvalidFlatbuffer: Union discriminant" + " does not match value.\""); + +- code_ += " match self.{{FIELD_NAME}}_type() {"; ++ code_ += " match self.{{DISCRIMINANT}}() {"; + ForAllUnionVariantsBesidesNone( + *field.value.type.enum_def, [&](const EnumVal &unused) { + (void)unused; +- code_ += " {{U_ELEMENT_ENUM_TYPE}} => {"; ++ code_ += " {{U_ELEMENT_ENUM_TYPE}} => {"; + code_ += +- " if let Some(x) = " +- "self.{{FIELD_TYPE_FIELD_NAME}}_as_" ++ " if let Some(x) = " ++ "self.{{FIELD_NAME}}_as_" + "{{U_ELEMENT_NAME}}() {"; +- code_ += " ds.field(\"{{FIELD_NAME}}\", &x)"; +- code_ += " } else {"; +- code_ += +- " ds.field(\"{{FIELD_NAME}}\", {{UNION_ERR}})"; +- code_ += " }"; +- code_ += " },"; ++ code_ += " ds.field(\"{{FIELD_NAME}}\", &x)"; ++ code_ += " } else {"; ++ code_ += " ds.field(\"{{FIELD_NAME}}\", {{UNION_ERR}})"; ++ code_ += " }"; ++ code_ += " },"; + }); +- code_ += " _ => {"; +- code_ += " let x: Option<()> = None;"; +- code_ += " ds.field(\"{{FIELD_NAME}}\", &x)"; +- code_ += " },"; +- code_ += " };"; ++ code_ += " _ => {"; ++ code_ += " let x: Option<()> = None;"; ++ code_ += " ds.field(\"{{FIELD_NAME}}\", &x)"; ++ code_ += " },"; ++ code_ += " };"; + } else { + // Most fields. +- code_ += " ds.field(\"{{FIELD_NAME}}\", &self.{{FIELD_NAME}}());"; ++ code_ += " ds.field(\"{{FIELD_NAME}}\", &self.{{FIELD_NAME}}());"; + } + }); + code_ += " ds.finish()"; +@@ -2031,7 +2232,7 @@ + // Union objects combine both the union discriminant and value, so we + // skip making a field for the discriminant. + if (field.value.type.base_type == BASE_TYPE_UTYPE) return; +- code_ += " pub {{FIELD_NAME}}: {{FIELD_OBJECT_TYPE}},"; ++ code_ += "pub {{FIELD_NAME}}: {{FIELD_OBJECT_TYPE}},"; + }); + code_ += "}"; + +@@ -2041,7 +2242,7 @@ + ForAllObjectTableFields(table, [&](const FieldDef &field) { + if (field.value.type.base_type == BASE_TYPE_UTYPE) return; + std::string default_value = GetDefaultValue(field, kObject); +- code_ += " {{FIELD_NAME}}: " + default_value + ","; ++ code_ += " {{FIELD_NAME}}: " + default_value + ","; + }); + code_ += " }"; + code_ += " }"; +@@ -2065,7 +2266,7 @@ + case ftBool: + case ftFloat: + case ftEnumKey: { +- code_ += " let {{FIELD_NAME}} = self.{{FIELD_NAME}};"; ++ code_ += " let {{FIELD_NAME}} = self.{{FIELD_NAME}};"; + return; + } + case ftUnionKey: return; // Generate union type with union value. +@@ -2073,9 +2274,9 @@ + code_.SetValue("SNAKE_CASE_ENUM_NAME", + MakeSnakeCase(Name(*field.value.type.enum_def))); + code_ += +- " let {{FIELD_NAME}}_type = " ++ " let {{FIELD_NAME}}_type = " + "self.{{FIELD_NAME}}.{{SNAKE_CASE_ENUM_NAME}}_type();"; +- code_ += " let {{FIELD_NAME}} = self.{{FIELD_NAME}}.pack(_fbb);"; ++ code_ += " let {{FIELD_NAME}} = self.{{FIELD_NAME}}.pack(_fbb);"; + return; + } + // The rest of the types require special casing around optionalness +@@ -2088,14 +2289,13 @@ + // Hold the struct in a variable so we can reference it. + if (field.IsRequired()) { + code_ += +- " let {{FIELD_NAME}}_tmp = " +- "Some(self.{{FIELD_NAME}}.pack());"; ++ " let {{FIELD_NAME}}_tmp = Some(self.{{FIELD_NAME}}.pack());"; + } else { + code_ += +- " let {{FIELD_NAME}}_tmp = self.{{FIELD_NAME}}" ++ " let {{FIELD_NAME}}_tmp = self.{{FIELD_NAME}}" + ".as_ref().map(|x| x.pack());"; + } +- code_ += " let {{FIELD_NAME}} = {{FIELD_NAME}}_tmp.as_ref();"; ++ code_ += " let {{FIELD_NAME}} = {{FIELD_NAME}}_tmp.as_ref();"; + + return; + } +@@ -2149,7 +2349,7 @@ + code_ += " {{STRUCT_NAME}}::create(_fbb, &{{STRUCT_NAME}}Args{"; + ForAllObjectTableFields(table, [&](const FieldDef &field) { + (void)field; // Unused. +- code_ += " {{FIELD_NAME}},"; ++ code_ += " {{FIELD_NAME}},"; + }); + code_ += " })"; + code_ += " }"; +@@ -2163,21 +2363,23 @@ + if (field.deprecated) continue; + code_.SetValue("FIELD_NAME", Name(field)); + code_.SetValue("FIELD_OBJECT_TYPE", ObjectFieldType(field, true)); ++ code_.IncrementIdentLevel(); + cb(field); ++ code_.DecrementIdentLevel(); + } + } + void MapNativeTableField(const FieldDef &field, const std::string &expr) { + if (field.IsOptional()) { +- code_ += " let {{FIELD_NAME}} = self.{{FIELD_NAME}}.as_ref().map(|x|{"; +- code_ += " " + expr; +- code_ += " });"; ++ code_ += " let {{FIELD_NAME}} = self.{{FIELD_NAME}}.as_ref().map(|x|{"; ++ code_ += " " + expr; ++ code_ += " });"; + } else { + // For some reason Args has optional types for required fields. + // TODO(cneo): Fix this... but its a breaking change? +- code_ += " let {{FIELD_NAME}} = Some({"; +- code_ += " let x = &self.{{FIELD_NAME}};"; +- code_ += " " + expr; +- code_ += " });"; ++ code_ += " let {{FIELD_NAME}} = Some({"; ++ code_ += " let x = &self.{{FIELD_NAME}};"; ++ code_ += " " + expr; ++ code_ += " });"; + } + } + +@@ -2187,21 +2389,22 @@ + FLATBUFFERS_ASSERT(field.key); + + code_.SetValue("KEY_TYPE", GenTableAccessorFuncReturnType(field, "")); ++ code_.SetValue("REF", IsString(field.value.type) ? "" : "&"); + +- code_ += " #[inline]"; ++ code_ += "#[inline]"; + code_ += +- " pub fn key_compare_less_than(&self, o: &{{STRUCT_NAME}}) -> " +- " bool {"; +- code_ += " self.{{FIELD_NAME}}() < o.{{FIELD_NAME}}()"; +- code_ += " }"; ++ "pub fn key_compare_less_than(&self, o: &{{STRUCT_NAME}}) -> " ++ "bool {"; ++ code_ += " self.{{FIELD_NAME}}() < o.{{FIELD_NAME}}()"; ++ code_ += "}"; + code_ += ""; +- code_ += " #[inline]"; ++ code_ += "#[inline]"; + code_ += +- " pub fn key_compare_with_value(&self, val: {{KEY_TYPE}}) -> " +- " ::std::cmp::Ordering {"; +- code_ += " let key = self.{{FIELD_NAME}}();"; +- code_ += " key.cmp(&val)"; +- code_ += " }"; ++ "pub fn key_compare_with_value(&self, val: {{KEY_TYPE}}) -> " ++ "::std::cmp::Ordering {"; ++ code_ += " let key = self.{{FIELD_NAME}}();"; ++ code_ += " key.cmp({{REF}}val)"; ++ code_ += "}"; + } + + // Generate functions for accessing the root table object. This function +@@ -2427,7 +2630,9 @@ + code_.SetValue( + "REF", + IsStruct(field.value.type) || IsArray(field.value.type) ? "&" : ""); ++ code_.IncrementIdentLevel(); + cb(field); ++ code_.DecrementIdentLevel(); + const size_t size = InlineSize(field.value.type); + offset_to_field += size + field.padding; + } +@@ -2466,7 +2671,7 @@ + code_ += " f.debug_struct(\"{{STRUCT_NAME}}\")"; + ForAllStructFields(struct_def, [&](const FieldDef &unused) { + (void)unused; +- code_ += " .field(\"{{FIELD_NAME}}\", &self.{{FIELD_NAME}}())"; ++ code_ += " .field(\"{{FIELD_NAME}}\", &self.{{FIELD_NAME}}())"; + }); + code_ += " .finish()"; + code_ += " }"; +@@ -2530,6 +2735,37 @@ + code_ += " v.in_buffer::(pos)"; + code_ += " }"; + code_ += "}"; ++ code_ += ""; ++ ++ // Implement serde::Serialize ++ if (parser_.opts.rust_serialize) { ++ const auto numFields = struct_def.fields.vec.size(); ++ code_.SetValue("NUM_FIELDS", NumToString(numFields)); ++ code_ += "impl Serialize for {{STRUCT_NAME}} {"; ++ code_ += ++ " fn serialize(&self, serializer: S) -> Result"; ++ code_ += " where"; ++ code_ += " S: Serializer,"; ++ code_ += " {"; ++ if (numFields == 0) { ++ code_ += ++ " let s = serializer.serialize_struct(\"{{STRUCT_NAME}}\", 0)?;"; ++ } else { ++ code_ += ++ " let mut s = serializer.serialize_struct(\"{{STRUCT_NAME}}\", " ++ "{{NUM_FIELDS}})?;"; ++ } ++ ForAllStructFields(struct_def, [&](const FieldDef &unused) { ++ (void)unused; ++ code_ += ++ " s.serialize_field(\"{{FIELD_NAME}}\", " ++ "&self.{{FIELD_NAME}}())?;"; ++ }); ++ code_ += " s.end()"; ++ code_ += " }"; ++ code_ += "}"; ++ code_ += ""; ++ } + + // Generate a constructor that takes all fields as arguments. + code_ += "impl<'a> {{STRUCT_NAME}} {"; +@@ -2537,13 +2773,13 @@ + code_ += " pub fn new("; + ForAllStructFields(struct_def, [&](const FieldDef &unused) { + (void)unused; +- code_ += " {{FIELD_NAME}}: {{REF}}{{FIELD_TYPE}},"; ++ code_ += " {{FIELD_NAME}}: {{REF}}{{FIELD_TYPE}},"; + }); + code_ += " ) -> Self {"; + code_ += " let mut s = Self([0; {{STRUCT_SIZE}}]);"; + ForAllStructFields(struct_def, [&](const FieldDef &unused) { + (void)unused; +- code_ += " s.set_{{FIELD_NAME}}({{REF}}{{FIELD_NAME}});"; ++ code_ += " s.set_{{FIELD_NAME}}({{FIELD_NAME}});"; + }); + code_ += " s"; + code_ += " }"; +@@ -2555,12 +2791,12 @@ + + // Generate accessor methods for the struct. + ForAllStructFields(struct_def, [&](const FieldDef &field) { +- this->GenComment(field.doc_comment, " "); ++ this->GenComment(field.doc_comment); + // Getter. + if (IsStruct(field.value.type)) { +- code_ += " pub fn {{FIELD_NAME}}(&self) -> &{{FIELD_TYPE}} {"; ++ code_ += "pub fn {{FIELD_NAME}}(&self) -> &{{FIELD_TYPE}} {"; + code_ += +- " unsafe {" ++ " unsafe {" + " &*(self.0[{{FIELD_OFFSET}}..].as_ptr() as *const" + " {{FIELD_TYPE}}) }"; + } else if (IsArray(field.value.type)) { +@@ -2568,30 +2804,31 @@ + NumToString(field.value.type.fixed_length)); + code_.SetValue("ARRAY_ITEM", GetTypeGet(field.value.type.VectorType())); + code_ += +- " pub fn {{FIELD_NAME}}(&'a self) -> " ++ "pub fn {{FIELD_NAME}}(&'a self) -> " + "flatbuffers::Array<'a, {{ARRAY_ITEM}}, {{ARRAY_SIZE}}> {"; +- code_ += " flatbuffers::Array::follow(&self.0, {{FIELD_OFFSET}})"; ++ code_ += " flatbuffers::Array::follow(&self.0, {{FIELD_OFFSET}})"; + } else { +- code_ += " pub fn {{FIELD_NAME}}(&self) -> {{FIELD_TYPE}} {"; ++ code_ += "pub fn {{FIELD_NAME}}(&self) -> {{FIELD_TYPE}} {"; + code_ += +- " let mut mem = core::mem::MaybeUninit::" ++ " let mut mem = core::mem::MaybeUninit::" + "<{{FIELD_TYPE}}>::uninit();"; +- code_ += " unsafe {"; +- code_ += " core::ptr::copy_nonoverlapping("; +- code_ += " self.0[{{FIELD_OFFSET}}..].as_ptr(),"; +- code_ += " mem.as_mut_ptr() as *mut u8,"; +- code_ += " core::mem::size_of::<{{FIELD_TYPE}}>(),"; +- code_ += " );"; +- code_ += " mem.assume_init()"; +- code_ += " }.from_little_endian()"; ++ code_ += " unsafe {"; ++ code_ += " core::ptr::copy_nonoverlapping("; ++ code_ += " self.0[{{FIELD_OFFSET}}..].as_ptr(),"; ++ code_ += " mem.as_mut_ptr() as *mut u8,"; ++ code_ += " core::mem::size_of::<{{FIELD_TYPE}}>(),"; ++ code_ += " );"; ++ code_ += " mem.assume_init()"; ++ code_ += " }.from_little_endian()"; + } +- code_ += " }\n"; ++ code_ += "}\n"; + // Setter. + if (IsStruct(field.value.type)) { + code_.SetValue("FIELD_SIZE", NumToString(InlineSize(field.value.type))); +- code_ += " pub fn set_{{FIELD_NAME}}(&mut self, x: &{{FIELD_TYPE}}) {"; ++ code_ += "#[allow(clippy::identity_op)]"; // If FIELD_OFFSET=0. ++ code_ += "pub fn set_{{FIELD_NAME}}(&mut self, x: &{{FIELD_TYPE}}) {"; + code_ += +- " self.0[{{FIELD_OFFSET}}..{{FIELD_OFFSET}}+{{FIELD_SIZE}}]" ++ " self.0[{{FIELD_OFFSET}}..{{FIELD_OFFSET}} + {{FIELD_SIZE}}]" + ".copy_from_slice(&x.0)"; + } else if (IsArray(field.value.type)) { + if (GetFullType(field.value.type) == ftArrayOfBuiltin) { +@@ -2601,36 +2838,35 @@ + "ARRAY_ITEM_SIZE", + NumToString(InlineSize(field.value.type.VectorType()))); + code_ += +- " pub fn set_{{FIELD_NAME}}(&mut self, items: &{{FIELD_TYPE}}) " ++ "pub fn set_{{FIELD_NAME}}(&mut self, items: &{{FIELD_TYPE}}) " + "{"; + code_ += +- " flatbuffers::emplace_scalar_array(&mut self.0, " ++ " flatbuffers::emplace_scalar_array(&mut self.0, " + "{{FIELD_OFFSET}}, items);"; + } else { + code_.SetValue("FIELD_SIZE", + NumToString(InlineSize(field.value.type))); +- code_ += +- " pub fn set_{{FIELD_NAME}}(&mut self, x: &{{FIELD_TYPE}}) {"; +- code_ += " unsafe {"; +- code_ += " std::ptr::copy("; +- code_ += " x.as_ptr() as *const u8,"; +- code_ += " self.0.as_mut_ptr().add({{FIELD_OFFSET}}),"; +- code_ += " {{FIELD_SIZE}},"; +- code_ += " );"; +- code_ += " }"; ++ code_ += "pub fn set_{{FIELD_NAME}}(&mut self, x: &{{FIELD_TYPE}}) {"; ++ code_ += " unsafe {"; ++ code_ += " std::ptr::copy("; ++ code_ += " x.as_ptr() as *const u8,"; ++ code_ += " self.0.as_mut_ptr().add({{FIELD_OFFSET}}),"; ++ code_ += " {{FIELD_SIZE}},"; ++ code_ += " );"; ++ code_ += " }"; + } + } else { +- code_ += " pub fn set_{{FIELD_NAME}}(&mut self, x: {{FIELD_TYPE}}) {"; +- code_ += " let x_le = x.to_little_endian();"; +- code_ += " unsafe {"; +- code_ += " core::ptr::copy_nonoverlapping("; +- code_ += " &x_le as *const {{FIELD_TYPE}} as *const u8,"; +- code_ += " self.0[{{FIELD_OFFSET}}..].as_mut_ptr(),"; +- code_ += " core::mem::size_of::<{{FIELD_TYPE}}>(),"; +- code_ += " );"; +- code_ += " }"; ++ code_ += "pub fn set_{{FIELD_NAME}}(&mut self, x: {{FIELD_TYPE}}) {"; ++ code_ += " let x_le = x.to_little_endian();"; ++ code_ += " unsafe {"; ++ code_ += " core::ptr::copy_nonoverlapping("; ++ code_ += " &x_le as *const {{FIELD_TYPE}} as *const u8,"; ++ code_ += " self.0[{{FIELD_OFFSET}}..].as_mut_ptr(),"; ++ code_ += " core::mem::size_of::<{{FIELD_TYPE}}>(),"; ++ code_ += " );"; ++ code_ += " }"; + } +- code_ += " }\n"; ++ code_ += "}\n"; + + // Generate a comparison function for this field if it is a key. + if (field.key) { GenKeyFieldMethods(field); } +@@ -2645,15 +2881,15 @@ + if (IsArray(field.value.type)) { + if (GetFullType(field.value.type) == ftArrayOfStruct) { + code_ += +- " {{FIELD_NAME}}: { let {{FIELD_NAME}} = " ++ " {{FIELD_NAME}}: { let {{FIELD_NAME}} = " + "self.{{FIELD_NAME}}(); flatbuffers::array_init(|i| " + "{{FIELD_NAME}}.get(i).unpack()) },"; + } else { +- code_ += " {{FIELD_NAME}}: self.{{FIELD_NAME}}().into(),"; ++ code_ += " {{FIELD_NAME}}: self.{{FIELD_NAME}}().into(),"; + } + } else { + std::string unpack = IsStruct(field.value.type) ? ".unpack()" : ""; +- code_ += " {{FIELD_NAME}}: self.{{FIELD_NAME}}()" + unpack + ","; ++ code_ += " {{FIELD_NAME}}: self.{{FIELD_NAME}}()" + unpack + ","; + } + }); + code_ += " }"; +@@ -2670,7 +2906,7 @@ + code_ += "pub struct {{NATIVE_STRUCT_NAME}} {"; + ForAllStructFields(struct_def, [&](const FieldDef &field) { + (void)field; // unused. +- code_ += " pub {{FIELD_NAME}}: {{FIELD_OBJECT_TYPE}},"; ++ code_ += "pub {{FIELD_NAME}}: {{FIELD_OBJECT_TYPE}},"; + }); + code_ += "}"; + // The `pack` method that turns the native struct into its Flatbuffers +@@ -2680,17 +2916,17 @@ + code_ += " {{STRUCT_NAME}}::new("; + ForAllStructFields(struct_def, [&](const FieldDef &field) { + if (IsStruct(field.value.type)) { +- code_ += " &self.{{FIELD_NAME}}.pack(),"; ++ code_ += " &self.{{FIELD_NAME}}.pack(),"; + } else if (IsArray(field.value.type)) { + if (GetFullType(field.value.type) == ftArrayOfStruct) { + code_ += +- " &flatbuffers::array_init(|i| " ++ " &flatbuffers::array_init(|i| " + "self.{{FIELD_NAME}}[i].pack()),"; + } else { +- code_ += " &self.{{FIELD_NAME}},"; ++ code_ += " &self.{{FIELD_NAME}},"; + } + } else { +- code_ += " self.{{FIELD_NAME}},"; ++ code_ += " self.{{FIELD_NAME}},"; + } + }); + code_ += " )"; +@@ -2728,6 +2964,13 @@ + code_ += indent + "use std::mem;"; + code_ += indent + "use std::cmp::Ordering;"; + code_ += ""; ++ if (parser_.opts.rust_serialize) { ++ code_ += indent + "extern crate serde;"; ++ code_ += ++ indent + ++ "use self::serde::ser::{Serialize, Serializer, SerializeStruct};"; ++ code_ += ""; ++ } + code_ += indent + "extern crate flatbuffers;"; + code_ += indent + "use self::flatbuffers::{EndianScalar, Follow};"; + } +diff -urN a/src/idl_gen_swift.cpp b/src/idl_gen_swift.cpp +--- a/src/idl_gen_swift.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_swift.cpp 2023-01-13 07:47:08.990253081 +0000 +@@ -187,7 +187,9 @@ + code_.SetValue("ACCESS_TYPE", is_private_access ? "internal" : "public"); + GenComment(struct_def.doc_comment); + code_.SetValue("STRUCTNAME", NameWrappedInNameSpace(struct_def)); +- code_ += "{{ACCESS_TYPE}} struct {{STRUCTNAME}}: NativeStruct\\"; ++ code_ += ++ "{{ACCESS_TYPE}} struct {{STRUCTNAME}}: NativeStruct, Verifiable, " ++ "FlatbuffersInitializable\\"; + if (parser_.opts.generate_object_based_api) code_ += ", NativeObject\\"; + code_ += " {"; + code_ += ""; +@@ -218,8 +220,10 @@ + IsEnum(field.value.type) ? "{{BASEVALUE}}" : "{{VALUETYPE}}"; + code_ += "private var _{{VALUENAME}}: " + valueType; + auto accessing_value = IsEnum(field.value.type) ? ".value" : ""; +- auto base_value = +- IsStruct(field.value.type) ? (type + "()") : field.value.constant; ++ auto is_bool = IsBool(field.value.type.base_type); ++ auto base_value = IsStruct(field.value.type) ? (type + "()") ++ : is_bool ? ("0" == field.value.constant ? "false" : "true") ++ : field.value.constant; + + main_constructor.push_back("_" + name + " = " + name + accessing_value); + base_constructor.push_back("_" + name + " = " + base_value); +@@ -228,6 +232,7 @@ + constructor += name + ": " + type; + } + code_ += ""; ++ BuildStructConstructor(struct_def); + BuildObjectConstructor(main_constructor, constructor); + BuildObjectConstructor(base_constructor, ""); + +@@ -250,6 +255,45 @@ + GenReaderMainBody() + "{{VALUETYPE}}(rawValue: _{{VALUENAME}})! }"; + } + } ++ code_ += ""; ++ code_ += ++ "public static func verify(_ verifier: inout Verifier, at position: " ++ "Int, of type: T.Type) throws where T: Verifiable {"; ++ Indent(); ++ code_ += ++ "try verifier.inBuffer(position: position, of: {{STRUCTNAME}}.self)"; ++ Outdent(); ++ code_ += "}"; ++ Outdent(); ++ code_ += "}\n"; ++ if (parser_.opts.gen_json_coders) GenerateJSONEncodingAPIs(struct_def); ++ } ++ ++ void BuildStructConstructor(const StructDef &struct_def) { ++ code_ += "{{ACCESS_TYPE}} init(_ bb: ByteBuffer, o: Int32) {"; ++ Indent(); ++ code_ += "let {{ACCESS}} = Struct(bb: bb, position: o)"; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ if (field.deprecated) continue; ++ auto name = Name(field); ++ auto type = field.value.type; ++ code_.SetValue("VALUENAME", name); ++ code_.SetValue("VALUETYPE", GenType(type)); ++ code_.SetValue("OFFSET", NumToString(field.value.offset)); ++ if (IsScalar(type.base_type)) { ++ if (IsEnum(type)) ++ code_.SetValue("VALUETYPE", GenTypeBasic(field.value.type, false)); ++ code_ += ++ "_{{VALUENAME}} = {{ACCESS}}.readBuffer(of: {{VALUETYPE}}.self, " ++ "at: {{OFFSET}})"; ++ } else { ++ code_ += ++ "_{{VALUENAME}} = {{VALUETYPE}}({{ACCESS}}.bb, o: " ++ "{{ACCESS}}.postion + {{OFFSET}})"; ++ } ++ } + Outdent(); + code_ += "}\n"; + } +@@ -368,15 +412,17 @@ + void GenTable(const StructDef &struct_def) { + auto is_private_access = struct_def.attributes.Lookup("private"); + code_.SetValue("ACCESS_TYPE", is_private_access ? "internal" : "public"); +- + GenObjectHeader(struct_def); + GenTableAccessors(struct_def); + GenTableReader(struct_def); + GenTableWriter(struct_def); + if (parser_.opts.generate_object_based_api) + GenerateObjectAPITableExtension(struct_def); ++ code_ += ""; ++ GenerateVerifier(struct_def); + Outdent(); + code_ += "}\n"; ++ if (parser_.opts.gen_json_coders) GenerateJSONEncodingAPIs(struct_def); + } + + // Generates the reader for swift +@@ -410,6 +456,7 @@ + code_.SetValue("MUTABLE", struct_def.fixed ? Mutable() : ""); + code_ += + "{{ACCESS_TYPE}} struct {{STRUCTNAME}}{{MUTABLE}}: FlatBufferObject\\"; ++ if (!struct_def.fixed) code_ += ", Verifiable\\"; + if (!struct_def.fixed && parser_.opts.generate_object_based_api) + code_ += ", ObjectAPIPacker\\"; + code_ += " {\n"; +@@ -651,8 +698,10 @@ + code_.SetValue("VALUETYPE", type); + code_.SetValue("OFFSET", name); + code_.SetValue("CONSTANT", field.value.constant); +- std::string def_Val = field.IsDefault() ? "{{CONSTANT}}" : "nil"; +- std::string optional = field.IsOptional() ? "?" : ""; ++ bool opt_scalar = ++ field.IsOptional() && IsScalar(field.value.type.base_type); ++ std::string def_Val = opt_scalar ? "nil" : "{{CONSTANT}}"; ++ std::string optional = opt_scalar ? "?" : ""; + auto const_string = "return o == 0 ? " + def_Val + " : "; + GenComment(field.doc_comment); + if (IsScalar(field.value.type.base_type) && !IsEnum(field.value.type) && +@@ -665,7 +714,8 @@ + + if (IsBool(field.value.type.base_type)) { + std::string default_value = +- "0" == field.value.constant ? "false" : "true"; ++ field.IsOptional() ? "nil" ++ : ("0" == field.value.constant ? "false" : "true"); + code_.SetValue("CONSTANT", default_value); + code_.SetValue("VALUETYPE", "Bool"); + code_ += GenReaderMainBody(optional) + "\\"; +@@ -831,6 +881,272 @@ + } + } + ++ void GenerateCodingKeys(const StructDef &struct_def) { ++ code_ += "enum CodingKeys: String, CodingKey {"; ++ Indent(); ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ if (field.deprecated) continue; ++ auto name = Name(field); ++ ++ code_.SetValue("RAWVALUENAME", field.name); ++ code_.SetValue("VALUENAME", name); ++ code_ += "case {{VALUENAME}} = \"{{RAWVALUENAME}}\""; ++ } ++ Outdent(); ++ code_ += "}"; ++ } ++ ++ void GenerateEncoderUnionBody(const FieldDef &field) { ++ EnumDef &union_def = *field.value.type.enum_def; ++ auto is_vector = field.value.type.base_type == BASE_TYPE_VECTOR || ++ field.value.type.base_type == BASE_TYPE_ARRAY; ++ if (field.value.type.base_type == BASE_TYPE_UTYPE || ++ (is_vector && ++ field.value.type.VectorType().base_type == BASE_TYPE_UTYPE)) ++ return; ++ if (is_vector) { ++ code_ += ++ "var enumsEncoder = container.nestedUnkeyedContainer(forKey: " ++ ".{{VALUENAME}}Type)"; ++ code_ += ++ "var contentEncoder = container.nestedUnkeyedContainer(forKey: " ++ ".{{VALUENAME}})"; ++ code_ += "for index in 0..<{{VALUENAME}}Count {"; ++ Indent(); ++ code_ += ++ "guard let type = {{VALUENAME}}Type(at: index) else { continue }"; ++ code_ += "try enumsEncoder.encode(type)"; ++ code_ += "switch type {"; ++ for (auto it = union_def.Vals().begin(); it != union_def.Vals().end(); ++ ++it) { ++ const auto &ev = **it; ++ ++ auto name = Name(ev); ++ auto type = GenType(ev.union_type); ++ code_.SetValue("KEY", name); ++ code_.SetValue("VALUETYPE", type); ++ if (ev.union_type.base_type == BASE_TYPE_NONE) { continue; } ++ code_ += "case .{{KEY}}:"; ++ Indent(); ++ code_ += "let _v = {{VALUENAME}}(at: index, type: {{VALUETYPE}}.self)"; ++ code_ += "try contentEncoder.encode(_v)"; ++ Outdent(); ++ } ++ code_ += "default: break;"; ++ code_ += "}"; ++ Outdent(); ++ code_ += "}"; ++ return; ++ } ++ ++ code_ += "switch {{VALUENAME}}Type {"; ++ for (auto it = union_def.Vals().begin(); it != union_def.Vals().end(); ++ ++it) { ++ const auto &ev = **it; ++ ++ auto name = Name(ev); ++ auto type = GenType(ev.union_type); ++ code_.SetValue("KEY", name); ++ code_.SetValue("VALUETYPE", type); ++ if (ev.union_type.base_type == BASE_TYPE_NONE) { continue; } ++ code_ += "case .{{KEY}}:"; ++ Indent(); ++ code_ += "let _v = {{VALUENAME}}(type: {{VALUETYPE}}.self)"; ++ code_ += "try container.encodeIfPresent(_v, forKey: .{{VALUENAME}})"; ++ Outdent(); ++ } ++ code_ += "default: break;"; ++ code_ += "}"; ++ } ++ ++ void GenerateEncoderBody(const StructDef &struct_def) { ++ code_ += "var container = encoder.container(keyedBy: CodingKeys.self)"; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ if (field.deprecated) continue; ++ auto name = Name(field); ++ auto type = field.value.type; ++ ++ auto is_non_union_vector = ++ (field.value.type.base_type == BASE_TYPE_ARRAY || ++ field.value.type.base_type == BASE_TYPE_VECTOR) && ++ field.value.type.VectorType().base_type != BASE_TYPE_UTYPE; ++ ++ code_.SetValue("RAWVALUENAME", field.name); ++ code_.SetValue("VALUENAME", name); ++ code_.SetValue("CONSTANT", field.value.constant); ++ bool should_indent = true; ++ if (is_non_union_vector) { ++ code_ += "if {{VALUENAME}}Count > 0 {"; ++ } else if (IsEnum(type) && !field.IsOptional()) { ++ code_.SetValue("CONSTANT", GenEnumDefaultValue(field)); ++ code_ += "if {{VALUENAME}} != {{CONSTANT}} {"; ++ } else if (IsScalar(type.base_type) && !IsEnum(type) && ++ !IsBool(type.base_type) && !field.IsOptional()) { ++ code_ += "if {{VALUENAME}} != {{CONSTANT}} {"; ++ } else if (IsBool(type.base_type) && !field.IsOptional()) { ++ std::string default_value = ++ "0" == field.value.constant ? "false" : "true"; ++ code_.SetValue("CONSTANT", default_value); ++ code_ += "if {{VALUENAME}} != {{CONSTANT}} {"; ++ } else { ++ should_indent = false; ++ } ++ if (should_indent) Indent(); ++ ++ if (IsUnion(type) && !IsEnum(type)) { ++ GenerateEncoderUnionBody(field); ++ } else if (is_non_union_vector && ++ (!IsScalar(type.VectorType().base_type) || ++ IsEnum(type.VectorType()))) { ++ code_ += ++ "var contentEncoder = container.nestedUnkeyedContainer(forKey: " ++ ".{{VALUENAME}})"; ++ code_ += "for index in 0..<{{VALUENAME}}Count {"; ++ Indent(); ++ code_ += "guard let type = {{VALUENAME}}(at: index) else { continue }"; ++ code_ += "try contentEncoder.encode(type)"; ++ Outdent(); ++ code_ += "}"; ++ } else { ++ code_ += ++ "try container.encodeIfPresent({{VALUENAME}}, forKey: " ++ ".{{VALUENAME}})"; ++ } ++ if (should_indent) Outdent(); ++ ++ if (is_non_union_vector || ++ (IsScalar(type.base_type) && !field.IsOptional())) { ++ code_ += "}"; ++ } ++ } ++ } ++ ++ void GenerateJSONEncodingAPIs(const StructDef &struct_def) { ++ code_ += "extension {{STRUCTNAME}}: Encodable {"; ++ Indent(); ++ code_ += ""; ++ if (struct_def.fields.vec.empty() == false) GenerateCodingKeys(struct_def); ++ ++ code_ += "public func encode(to encoder: Encoder) throws {"; ++ Indent(); ++ if (struct_def.fields.vec.empty() == false) GenerateEncoderBody(struct_def); ++ Outdent(); ++ code_ += "}"; ++ Outdent(); ++ code_ += "}"; ++ code_ += ""; ++ } ++ ++ void GenerateVerifier(const StructDef &struct_def) { ++ code_ += ++ "public static func verify(_ verifier: inout Verifier, at position: " ++ "Int, of type: T.Type) throws where T: Verifiable {"; ++ Indent(); ++ code_ += "var _v = try verifier.visitTable(at: position)"; ++ for (auto it = struct_def.fields.vec.begin(); ++ it != struct_def.fields.vec.end(); ++it) { ++ auto &field = **it; ++ if (field.deprecated) continue; ++ auto offset = NumToString(field.value.offset); ++ auto name = Name(field); ++ ++ code_.SetValue("VALUENAME", name); ++ code_.SetValue("VALUETYPE", GenerateVerifierType(field)); ++ code_.SetValue("OFFSET", name); ++ code_.SetValue("ISREQUIRED", field.IsRequired() ? "true" : "false"); ++ ++ if (IsUnion(field.value.type)) { ++ GenerateUnionTypeVerifier(field); ++ continue; ++ } ++ ++ code_ += ++ "try _v.visit(field: {{TABLEOFFSET}}.{{OFFSET}}.p, fieldName: " ++ "\"{{VALUENAME}}\", required: {{ISREQUIRED}}, type: " ++ "{{VALUETYPE}}.self)"; ++ } ++ code_ += "_v.finish()"; ++ Outdent(); ++ code_ += "}"; ++ } ++ ++ void GenerateUnionTypeVerifier(const FieldDef &field) { ++ auto is_vector = IsVector(field.value.type) || IsArray(field.value.type); ++ if (field.value.type.base_type == BASE_TYPE_UTYPE || ++ (is_vector && ++ field.value.type.VectorType().base_type == BASE_TYPE_UTYPE)) ++ return; ++ EnumDef &union_def = *field.value.type.enum_def; ++ code_.SetValue("VALUETYPE", NameWrappedInNameSpace(union_def)); ++ code_.SetValue("FUNCTION_NAME", is_vector ? "visitUnionVector" : "visit"); ++ code_ += ++ "try _v.{{FUNCTION_NAME}}(unionKey: {{TABLEOFFSET}}.{{OFFSET}}Type.p, " ++ "unionField: {{TABLEOFFSET}}.{{OFFSET}}.p, unionKeyName: " ++ "\"{{VALUENAME}}Type\", fieldName: \"{{VALUENAME}}\", required: " ++ "{{ISREQUIRED}}, completion: { (verifier, key: {{VALUETYPE}}, pos) in"; ++ Indent(); ++ code_ += "switch key {"; ++ for (auto it = union_def.Vals().begin(); it != union_def.Vals().end(); ++ ++it) { ++ const auto &ev = **it; ++ ++ auto name = Name(ev); ++ auto type = GenType(ev.union_type); ++ code_.SetValue("KEY", name); ++ code_.SetValue("VALUETYPE", type); ++ code_ += "case .{{KEY}}:"; ++ Indent(); ++ if (ev.union_type.base_type == BASE_TYPE_NONE) { ++ code_ += "break // NOTE - SWIFT doesnt support none"; ++ } else if (ev.union_type.base_type == BASE_TYPE_STRING) { ++ code_ += ++ "try ForwardOffset.verify(&verifier, at: pos, of: " ++ "String.self)"; ++ } else { ++ code_.SetValue("MAINTYPE", ev.union_type.struct_def->fixed ++ ? type ++ : "ForwardOffset<" + type + ">"); ++ code_ += ++ "try {{MAINTYPE}}.verify(&verifier, at: pos, of: " ++ "{{VALUETYPE}}.self)"; ++ } ++ Outdent(); ++ } ++ code_ += "}"; ++ Outdent(); ++ code_ += "})"; ++ } ++ ++ std::string GenerateVerifierType(const FieldDef &field) { ++ auto type = field.value.type; ++ auto is_vector = IsVector(type) || IsArray(type); ++ ++ if (is_vector) { ++ auto vector_type = field.value.type.VectorType(); ++ return "ForwardOffset>"; ++ } ++ ++ return GenerateNestedVerifierTypes(field.value.type); ++ } ++ ++ std::string GenerateNestedVerifierTypes(const Type &type) { ++ auto string_type = GenType(type); ++ ++ if (IsScalar(type.base_type)) { return string_type; } ++ ++ if (IsString(type)) { return "ForwardOffset<" + string_type + ">"; } ++ ++ if (type.struct_def && type.struct_def->fixed) { return string_type; } ++ ++ return "ForwardOffset<" + string_type + ">"; ++ } ++ + void GenByKeyFunctions(const FieldDef &key_field) { + code_.SetValue("TYPE", GenType(key_field.value.type)); + code_ += +@@ -844,13 +1160,24 @@ + void GenEnum(const EnumDef &enum_def) { + if (enum_def.generated) return; + auto is_private_access = enum_def.attributes.Lookup("private"); ++ code_.SetValue("ENUM_TYPE", ++ enum_def.is_union ? "UnionEnum" : "Enum, Verifiable"); + code_.SetValue("ACCESS_TYPE", is_private_access ? "internal" : "public"); + code_.SetValue("ENUM_NAME", NameWrappedInNameSpace(enum_def)); + code_.SetValue("BASE_TYPE", GenTypeBasic(enum_def.underlying_type, false)); + GenComment(enum_def.doc_comment); +- code_ += "{{ACCESS_TYPE}} enum {{ENUM_NAME}}: {{BASE_TYPE}}, Enum {"; ++ code_ += ++ "{{ACCESS_TYPE}} enum {{ENUM_NAME}}: {{BASE_TYPE}}, {{ENUM_TYPE}} {"; + Indent(); + code_ += "{{ACCESS_TYPE}} typealias T = {{BASE_TYPE}}"; ++ if (enum_def.is_union) { ++ code_ += ""; ++ code_ += "{{ACCESS_TYPE}} init?(value: T) {"; ++ Indent(); ++ code_ += "self.init(rawValue: value)"; ++ Outdent(); ++ code_ += "}\n"; ++ } + code_ += + "{{ACCESS_TYPE}} static var byteSize: Int { return " + "MemoryLayout<{{BASE_TYPE}}>.size " +@@ -865,11 +1192,13 @@ + GenComment(ev.doc_comment); + code_ += "case {{KEY}} = {{VALUE}}"; + } +- code_ += "\n"; ++ code_ += ""; + AddMinOrMaxEnumValue(Name(*enum_def.MaxValue()), "max"); + AddMinOrMaxEnumValue(Name(*enum_def.MinValue()), "min"); + Outdent(); + code_ += "}\n"; ++ if (parser_.opts.gen_json_coders) EnumEncoder(enum_def); ++ code_ += ""; + if (parser_.opts.generate_object_based_api && enum_def.is_union) { + code_ += "{{ACCESS_TYPE}} struct {{ENUM_NAME}}Union {"; + Indent(); +@@ -894,6 +1223,27 @@ + } + } + ++ void EnumEncoder(const EnumDef &enum_def) { ++ code_ += "extension {{ENUM_NAME}}: Encodable {"; ++ Indent(); ++ code_ += "{{ACCESS_TYPE}} func encode(to encoder: Encoder) throws {"; ++ Indent(); ++ code_ += "var container = encoder.singleValueContainer()"; ++ code_ += "switch self {"; ++ for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); ++it) { ++ const auto &ev = **it; ++ auto name = Name(ev); ++ code_.SetValue("KEY", name); ++ code_.SetValue("RAWKEY", ev.name); ++ code_ += "case .{{KEY}}: try container.encode(\"{{RAWKEY}}\")"; ++ } ++ code_ += "}"; ++ Outdent(); ++ code_ += "}"; ++ Outdent(); ++ code_ += "}"; ++ } ++ + // MARK: - Object API + + void GenerateObjectAPIExtensionHeader(std::string name) { +diff -urN a/src/idl_gen_text.cpp b/src/idl_gen_text.cpp +--- a/src/idl_gen_text.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_text.cpp 2023-01-13 07:47:08.991253090 +0000 +@@ -264,12 +264,18 @@ + FLATBUFFERS_ASSERT(IsStruct(fd.value.type) || IsArray(fd.value.type)); + val = reinterpret_cast(table)->GetStruct( + fd.value.offset); +- } else if (fd.flexbuffer) { ++ } else if (fd.flexbuffer && opts.json_nested_flexbuffers) { ++ // We could verify this FlexBuffer before access, but since this sits ++ // inside a FlatBuffer that we don't know wether it has been verified or ++ // not, there is little point making this part safer than the parent.. ++ // The caller should really be verifying the whole. ++ // If the whole buffer is corrupt, we likely crash before we even get ++ // here. + auto vec = table->GetPointer *>(fd.value.offset); + auto root = flexbuffers::GetRoot(vec->data(), vec->size()); + root.ToString(true, opts.strict_json, text); + return true; +- } else if (fd.nested_flatbuffer) { ++ } else if (fd.nested_flatbuffer && opts.json_nested_flatbuffers) { + auto vec = table->GetPointer *>(fd.value.offset); + auto root = GetRoot
(vec->data()); + return GenStruct(*fd.nested_flatbuffer, root, indent); +diff -urN a/src/idl_gen_ts.cpp b/src/idl_gen_ts.cpp +--- a/src/idl_gen_ts.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_gen_ts.cpp 2023-01-13 07:47:09.269255658 +0000 +@@ -29,7 +29,10 @@ + + struct ImportDefinition { + std::string name; +- std::string statement; ++ std::string import_statement; ++ std::string export_statement; ++ std::string bare_file_path; ++ std::string rel_file_path; + const Definition *dependent; + const Definition *dependency; + }; +@@ -45,10 +48,69 @@ + + TsGenerator(const Parser &parser, const std::string &path, + const std::string &file_name) +- : BaseGenerator(parser, path, file_name, "", ".", "ts") {} ++ : BaseGenerator(parser, path, file_name, "", ".", "ts") { ++ // clang-format off ++ ++ // List of keywords retrieved from here: ++ // https://github.com/microsoft/TypeScript/issues/2536 ++ // One per line to ease comparisons to that list are easier ++ static const char *const keywords[] = { ++ "break", ++ "case", ++ "catch", ++ "class", ++ "const", ++ "continue", ++ "debugger", ++ "default", ++ "delete", ++ "do", ++ "else", ++ "enum", ++ "export", ++ "extends", ++ "false", ++ "finally", ++ "for", ++ "function", ++ "if", ++ "import", ++ "in", ++ "instanceof", ++ "new", ++ "null", ++ "return", ++ "super", ++ "switch", ++ "this", ++ "throw", ++ "true", ++ "try", ++ "typeof", ++ "var", ++ "void", ++ "while", ++ "with", ++ "as", ++ "implements", ++ "interface", ++ "let", ++ "package", ++ "private", ++ "protected", ++ "public", ++ "static", ++ "yield", ++ nullptr, ++ // clang-format on ++ }; ++ ++ for (auto kw = keywords; *kw; kw++) keywords_.insert(*kw); ++ } + bool generate() { + generateEnums(); + generateStructs(); ++ generateEntry(); + return true; + } + +@@ -62,12 +124,12 @@ + "// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n"; + + for (auto it = bare_imports.begin(); it != bare_imports.end(); it++) +- code += it->second.statement + "\n"; ++ code += it->second.import_statement + "\n"; + if (!bare_imports.empty()) code += "\n"; + + for (auto it = imports.begin(); it != imports.end(); it++) + if (it->second.dependency != &definition) // do not import itself +- code += it->second.statement + "\n"; ++ code += it->second.import_statement + "\n"; + if (!imports.empty()) code += "\n\n"; + + code += classcode; +@@ -77,6 +139,14 @@ + } + + private: ++ std::unordered_set keywords_; ++ ++ std::string EscapeKeyword(const std::string &name) const { ++ return keywords_.find(name) == keywords_.end() ? name : name + "_"; ++ } ++ ++ import_set imports_all_; ++ + // Generate code for all enums. + void generateEnums() { + for (auto it = parser_.enums_.vec.begin(); it != parser_.enums_.vec.end(); +@@ -88,6 +158,7 @@ + GenEnum(enum_def, &enumcode, imports, false); + GenEnum(enum_def, &enumcode, imports, true); + SaveType(enum_def, enumcode, imports, bare_imports); ++ imports_all_.insert(imports.begin(), imports.end()); + } + } + +@@ -102,9 +173,19 @@ + std::string declcode; + GenStruct(parser_, struct_def, &declcode, imports); + SaveType(struct_def, declcode, imports, bare_imports); ++ imports_all_.insert(imports.begin(), imports.end()); + } + } + ++ // Generate code for a single entry point module. ++ void generateEntry() { ++ std::string code; ++ for (auto it = imports_all_.begin(); it != imports_all_.end(); it++) ++ code += it->second.export_statement + "\n"; ++ std::string path = "./" + path_ + file_name_ + ".ts"; ++ SaveFile(path.c_str(), code, false); ++ } ++ + // Generate a documentation comment, if available. + static void GenDocComment(const std::vector &dc, + std::string *code_ptr, +@@ -210,8 +291,7 @@ + + std::string GenBBAccess() const { return "this.bb!"; } + +- std::string GenDefaultValue(const FieldDef &field, const std::string &context, +- import_set &imports) { ++ std::string GenDefaultValue(const FieldDef &field, import_set &imports) { + if (field.IsScalarOptional()) { return "null"; } + + const auto &value = field.value; +@@ -238,10 +318,7 @@ + + case BASE_TYPE_LONG: + case BASE_TYPE_ULONG: { +- int64_t constant = StringToInt(value.constant.c_str()); +- std::string createLong = context + ".createLong"; +- return createLong + "(" + NumToString(static_cast(constant)) + +- ", " + NumToString(static_cast(constant >> 32)) + ")"; ++ return "BigInt('" + value.constant + "')"; + } + + default: return value.constant; +@@ -266,8 +343,7 @@ + switch (type.base_type) { + case BASE_TYPE_BOOL: return allowNull ? "boolean|null" : "boolean"; + case BASE_TYPE_LONG: +- case BASE_TYPE_ULONG: +- return allowNull ? "flatbuffers.Long|null" : "flatbuffers.Long"; ++ case BASE_TYPE_ULONG: return allowNull ? "bigint|null" : "bigint"; + default: + if (IsScalar(type.base_type)) { + if (type.enum_def) { +@@ -316,9 +392,9 @@ + GenStructArgs(imports, *field.value.type.struct_def, arguments, + nameprefix + field.name + "_"); + } else { +- *arguments += +- ", " + nameprefix + field.name + ": " + +- GenTypeName(imports, field, field.value.type, true, field.IsOptional()); ++ *arguments += ", " + nameprefix + field.name + ": " + ++ GenTypeName(imports, field, field.value.type, true, ++ field.IsOptional()); + } + } + } +@@ -465,30 +541,40 @@ + } + } + std::string import_statement; ++ std::string export_statement; + import_statement += "import { "; ++ export_statement += "export { "; ++ std::string symbols_expression; + if (long_import_name.empty()) { +- import_statement += import_name; ++ symbols_expression += import_name; + if (parser_.opts.generate_object_based_api) +- import_statement += ", " + import_name + "T"; ++ symbols_expression += ", " + import_name + "T"; + } else { +- import_statement += dependency.name + " as " + long_import_name; ++ symbols_expression += dependency.name + " as " + long_import_name; + if (parser_.opts.generate_object_based_api) +- import_statement += ++ symbols_expression += + ", " + dependency.name + "T as " + long_import_name + "T"; + } +- import_statement += " } from '"; +- std::string file_name; ++ import_statement += symbols_expression + " } from '"; ++ export_statement += symbols_expression + " } from '"; ++ std::string bare_file_path; ++ std::string rel_file_path; + const auto &dep_comps = dependent.defined_namespace->components; + for (size_t i = 0; i < dep_comps.size(); i++) +- file_name += i == 0 ? ".." : (kPathSeparator + std::string("..")); +- if (dep_comps.size() == 0) file_name += "."; ++ rel_file_path += i == 0 ? ".." : (kPathSeparator + std::string("..")); ++ if (dep_comps.size() == 0) rel_file_path += "."; + for (auto it = depc_comps.begin(); it != depc_comps.end(); it++) +- file_name += kPathSeparator + ToDasherizedCase(*it); +- file_name += kPathSeparator + ToDasherizedCase(dependency.name); +- import_statement += file_name + "';"; ++ bare_file_path += kPathSeparator + ToDasherizedCase(*it); ++ bare_file_path += kPathSeparator + ToDasherizedCase(dependency.name); ++ rel_file_path += bare_file_path; ++ import_statement += rel_file_path + "';"; ++ export_statement += "." + bare_file_path + "';"; + ImportDefinition import; + import.name = long_import_name.empty() ? import_name : long_import_name; +- import.statement = import_statement; ++ import.bare_file_path = bare_file_path; ++ import.rel_file_path = rel_file_path; ++ import.import_statement = import_statement; ++ import.export_statement = export_statement; + import.dependency = &dependency; + import.dependent = &dependent; + imports.insert(std::make_pair(unique_name, import)); +@@ -514,28 +600,38 @@ + } + } + std::string import_statement; ++ std::string export_statement; + import_statement += "import { "; ++ export_statement += "export { "; ++ std::string symbols_expression; + if (long_import_name.empty()) +- import_statement += import_name; ++ symbols_expression += import_name; + else +- import_statement += dependency.name + " as " + long_import_name; ++ symbols_expression += dependency.name + " as " + long_import_name; + if (dependency.is_union) { +- import_statement += ", unionTo" + import_name; +- import_statement += ", unionListTo" + import_name; ++ symbols_expression += ", unionTo" + import_name; ++ symbols_expression += ", unionListTo" + import_name; + } +- import_statement += " } from '"; +- std::string file_name; ++ import_statement += symbols_expression + " } from '"; ++ export_statement += symbols_expression + " } from '"; ++ std::string bare_file_path; ++ std::string rel_file_path; + const auto &dep_comps = dependent.defined_namespace->components; + for (size_t i = 0; i < dep_comps.size(); i++) +- file_name += i == 0 ? ".." : (kPathSeparator + std::string("..")); +- if (dep_comps.size() == 0) file_name += "."; ++ rel_file_path += i == 0 ? ".." : (kPathSeparator + std::string("..")); ++ if (dep_comps.size() == 0) rel_file_path += "."; + for (auto it = depc_comps.begin(); it != depc_comps.end(); it++) +- file_name += kPathSeparator + ToDasherizedCase(*it); +- file_name += kPathSeparator + ToDasherizedCase(dependency.name); +- import_statement += file_name + "';"; ++ bare_file_path += kPathSeparator + ToDasherizedCase(*it); ++ bare_file_path += kPathSeparator + ToDasherizedCase(dependency.name); ++ rel_file_path += bare_file_path; ++ import_statement += rel_file_path + "';"; ++ export_statement += "." + bare_file_path + "';"; + ImportDefinition import; + import.name = long_import_name.empty() ? import_name : long_import_name; +- import.statement = import_statement; ++ import.bare_file_path = bare_file_path; ++ import.rel_file_path = rel_file_path; ++ import.import_statement = import_statement; ++ import.export_statement = export_statement; + import.dependency = &dependency; + import.dependent = &dependent; + imports.insert(std::make_pair(unique_name, import)); +@@ -546,7 +642,8 @@ + std::string fileName) { + ImportDefinition import; + import.name = import_name; +- import.statement = "import " + import_name + " from '" + fileName + "';"; ++ import.import_statement = ++ "import " + import_name + " from '" + fileName + "';"; + imports.insert(std::make_pair(import_name, import)); + } + +@@ -809,8 +906,7 @@ + // a string that contains values for things that can be created inline or + // the variable name from field_offset_decl + std::string field_offset_val; +- const auto field_default_val = +- GenDefaultValue(field, "flatbuffers", imports); ++ const auto field_default_val = GenDefaultValue(field, imports); + + // Emit a scalar field + const auto is_string = IsString(field.value.type); +@@ -1130,7 +1226,7 @@ + if (is_string) { index += ", optionalEncoding"; } + code += offset_prefix + + GenGetter(field.value.type, "(" + index + ")") + " : " + +- GenDefaultValue(field, GenBBAccess(), imports); ++ GenDefaultValue(field, imports); + code += ";\n"; + } + } +@@ -1226,7 +1322,7 @@ + code += "false"; + } else if (field.value.type.element == BASE_TYPE_LONG || + field.value.type.element == BASE_TYPE_ULONG) { +- code += GenBBAccess() + ".createLong(0, 0)"; ++ code += "BigInt(0)"; + } else if (IsScalar(field.value.type.element)) { + if (field.value.type.enum_def) { + code += field.value.constant; +@@ -1380,13 +1476,13 @@ + code += "0"; + } else if (HasNullDefault(field)) { + if (IsLong(field.value.type.base_type)) { +- code += "builder.createLong(0, 0)"; ++ code += "BigInt(0)"; + } else { + code += "0"; + } + } else { + if (field.value.type.base_type == BASE_TYPE_BOOL) { code += "+"; } +- code += GenDefaultValue(field, "builder", imports); ++ code += GenDefaultValue(field, imports); + } + code += ");\n}\n\n"; + +@@ -1543,10 +1639,13 @@ + allowNull && field.IsOptional()); + } + +- static std::string GetArgName(const FieldDef &field) { ++ std::string GetArgName(const FieldDef &field) { + auto argname = MakeCamel(field.name, false); +- if (!IsScalar(field.value.type.base_type)) { argname += "Offset"; } +- ++ if (!IsScalar(field.value.type.base_type)) { ++ argname += "Offset"; ++ } else { ++ argname = EscapeKeyword(argname); ++ } + return argname; + } + +@@ -1565,8 +1664,6 @@ + + std::string TSMakeRule(const Parser &parser, const std::string &path, + const std::string &file_name) { +- FLATBUFFERS_ASSERT(parser.opts.lang <= IDLOptions::kMAX); +- + std::string filebase = + flatbuffers::StripPath(flatbuffers::StripExtension(file_name)); + ts::TsGenerator generator(parser, path, file_name); +diff -urN a/src/idl_parser.cpp b/src/idl_parser.cpp +--- a/src/idl_parser.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/idl_parser.cpp 2023-01-13 07:47:09.704259675 +0000 +@@ -20,6 +20,7 @@ + #include + #include + ++#include "flatbuffers/base.h" + #include "flatbuffers/idl.h" + #include "flatbuffers/util.h" + +@@ -143,7 +144,10 @@ + } + + void Parser::Warning(const std::string &msg) { +- if (!opts.no_warnings) Message("warning: " + msg); ++ if (!opts.no_warnings) { ++ Message("warning: " + msg); ++ has_warning_ = true; // for opts.warnings_as_errors ++ } + } + + CheckedError Parser::Error(const std::string &msg) { +@@ -158,6 +162,10 @@ + " reached"); + } + ++const std::string &Parser::GetPooledString(const std::string &s) const { ++ return *(string_cache_.insert(s).first); ++} ++ + class Parser::ParseDepthGuard { + public: + explicit ParseDepthGuard(Parser *parser_not_null) +@@ -808,8 +816,7 @@ + "or in structs."); + if (IsString(type) || IsVector(type)) { + advanced_features_ |= reflection::DefaultVectorsAndStrings; +- if (field->value.constant != "0" && field->value.constant != "null" && +- !SupportsDefaultVectorsAndStrings()) { ++ if (field->value.constant != "0" && !SupportsDefaultVectorsAndStrings()) { + return Error( + "Default values for strings and vectors are not supported in one " + "of the specified programming languages"); +@@ -914,7 +921,7 @@ + } + if (!SupportsOptionalScalars()) { + return Error( +- "Optional scalars are not yet supported in at least one the of " ++ "Optional scalars are not yet supported in at least one of " + "the specified programming languages."); + } + } +@@ -1121,6 +1128,9 @@ + } + uint8_t enum_idx; + if (vector_of_union_types) { ++ if (vector_of_union_types->size() <= count) ++ return Error("union types vector smaller than union values vector" ++ " for: " + field->name); + enum_idx = vector_of_union_types->Get(count); + } else { + ECHECK(atot(constant.c_str(), *this, &enum_idx)); +@@ -1623,7 +1633,7 @@ + auto length = array.type.fixed_length; + uoffset_t count = 0; + auto err = ParseVectorDelimiters(count, [&](uoffset_t &) -> CheckedError { +- vector_emplace_back(&stack, Value()); ++ stack.emplace_back(Value()); + auto &val = stack.back(); + val.type = type; + if (IsStruct(type)) { +@@ -1667,7 +1677,13 @@ + size_t fieldn, + const StructDef *parent_struct_def) { + if (token_ == '[') { // backwards compat for 'legacy' ubyte buffers +- ECHECK(ParseAnyValue(val, field, fieldn, parent_struct_def, 0)); ++ if (opts.json_nested_legacy_flatbuffers) { ++ ECHECK(ParseAnyValue(val, field, fieldn, parent_struct_def, 0)); ++ } else { ++ return Error( ++ "cannot parse nested_flatbuffer as bytes unless" ++ " --json-nested-bytes is set"); ++ } + } else { + auto cursor_at_value_begin = cursor_; + ECHECK(SkipAnyJsonValue()); +@@ -2148,10 +2164,14 @@ + auto &v = vals.vec; + if (IsUInt64()) + std::sort(v.begin(), v.end(), [](const EnumVal *e1, const EnumVal *e2) { ++ if (e1->GetAsUInt64() == e2->GetAsUInt64()) { ++ return e1->name < e2->name; ++ } + return e1->GetAsUInt64() < e2->GetAsUInt64(); + }); + else + std::sort(v.begin(), v.end(), [](const EnumVal *e1, const EnumVal *e2) { ++ if (e1->GetAsInt64() == e2->GetAsInt64()) { return e1->name < e2->name; } + return e1->GetAsInt64() < e2->GetAsInt64(); + }); + } +@@ -2281,13 +2301,18 @@ + bool user_value; + }; + +-CheckedError Parser::ParseEnum(const bool is_union, EnumDef **dest) { ++CheckedError Parser::ParseEnum(const bool is_union, EnumDef **dest, ++ const char *filename) { + std::vector enum_comment = doc_comment_; + NEXT(); + std::string enum_name = attribute_; + EXPECT(kTokenIdentifier); + EnumDef *enum_def; + ECHECK(StartEnum(enum_name, is_union, &enum_def)); ++ if (filename != nullptr && !opts.project_root.empty()) { ++ enum_def->declaration_file = ++ &GetPooledString(RelativeToRootPath(opts.project_root, filename)); ++ } + enum_def->doc_comment = enum_comment; + if (!is_union && !opts.proto_mode) { + // Give specialized error message, since this type spec used to +@@ -2407,14 +2432,18 @@ + } + + if (dest) *dest = enum_def; +- types_.Add(current_namespace_->GetFullyQualifiedName(enum_def->name), +- new Type(BASE_TYPE_UNION, nullptr, enum_def)); ++ const auto qualified_name = ++ current_namespace_->GetFullyQualifiedName(enum_def->name); ++ if (types_.Add(qualified_name, new Type(BASE_TYPE_UNION, nullptr, enum_def))) ++ return Error("datatype already exists: " + qualified_name); + return NoError(); + } + + CheckedError Parser::StartStruct(const std::string &name, StructDef **dest) { + auto &struct_def = *LookupCreateStruct(name, true, true); +- if (!struct_def.predecl) return Error("datatype already exists: " + name); ++ if (!struct_def.predecl) ++ return Error("datatype already exists: " + ++ current_namespace_->GetFullyQualifiedName(name)); + struct_def.predecl = false; + struct_def.name = name; + struct_def.file = file_being_parsed_; +@@ -2466,8 +2495,7 @@ + } + + bool Parser::SupportsAdvancedUnionFeatures() const { +- return opts.lang_to_generate != 0 && +- (opts.lang_to_generate & ++ return (opts.lang_to_generate & + ~(IDLOptions::kCpp | IDLOptions::kTs | IDLOptions::kPhp | + IDLOptions::kJava | IDLOptions::kCSharp | IDLOptions::kKotlin | + IDLOptions::kBinary | IDLOptions::kSwift)) == 0; +@@ -2512,7 +2540,7 @@ + return a_id < b_id; + } + +-CheckedError Parser::ParseDecl() { ++CheckedError Parser::ParseDecl(const char *filename) { + std::vector dc = doc_comment_; + bool fixed = IsIdent("struct"); + if (!fixed && !IsIdent("table")) return Error("declaration expected"); +@@ -2523,6 +2551,10 @@ + ECHECK(StartStruct(name, &struct_def)); + struct_def->doc_comment = dc; + struct_def->fixed = fixed; ++ if (filename && !opts.project_root.empty()) { ++ struct_def->declaration_file = ++ &GetPooledString(RelativeToRootPath(opts.project_root, filename)); ++ } + ECHECK(ParseMetaData(&struct_def->attributes)); + struct_def->sortbysize = + struct_def->attributes.Lookup("original_order") == nullptr && !fixed; +@@ -2594,12 +2626,15 @@ + ECHECK(CheckClash(fields, struct_def, "_byte_vector", BASE_TYPE_STRING)); + ECHECK(CheckClash(fields, struct_def, "ByteVector", BASE_TYPE_STRING)); + EXPECT('}'); +- types_.Add(current_namespace_->GetFullyQualifiedName(struct_def->name), +- new Type(BASE_TYPE_STRUCT, struct_def, nullptr)); ++ const auto qualified_name = ++ current_namespace_->GetFullyQualifiedName(struct_def->name); ++ if (types_.Add(qualified_name, ++ new Type(BASE_TYPE_STRUCT, struct_def, nullptr))) ++ return Error("datatype already exists: " + qualified_name); + return NoError(); + } + +-CheckedError Parser::ParseService() { ++CheckedError Parser::ParseService(const char *filename) { + std::vector service_comment = doc_comment_; + NEXT(); + auto service_name = attribute_; +@@ -2609,6 +2644,10 @@ + service_def.file = file_being_parsed_; + service_def.doc_comment = service_comment; + service_def.defined_namespace = current_namespace_; ++ if (filename != nullptr && !opts.project_root.empty()) { ++ service_def.declaration_file = ++ &GetPooledString(RelativeToRootPath(opts.project_root, filename)); ++ } + if (services_.Add(current_namespace_->GetFullyQualifiedName(service_name), + &service_def)) + return Error("service already exists: " + service_name); +@@ -2724,7 +2763,7 @@ + } else if (IsIdent("enum")) { + // These are almost the same, just with different terminator: + EnumDef *enum_def; +- ECHECK(ParseEnum(false, &enum_def)); ++ ECHECK(ParseEnum(false, &enum_def, nullptr)); + if (Is(';')) NEXT(); + // Temp: remove any duplicates, as .fbs files can't handle them. + enum_def->RemoveDuplicates(); +@@ -2747,17 +2786,17 @@ + return NoError(); + } + +-CheckedError Parser::StartEnum(const std::string &enum_name, bool is_union, ++CheckedError Parser::StartEnum(const std::string &name, bool is_union, + EnumDef **dest) { + auto &enum_def = *new EnumDef(); +- enum_def.name = enum_name; ++ enum_def.name = name; + enum_def.file = file_being_parsed_; + enum_def.doc_comment = doc_comment_; + enum_def.is_union = is_union; + enum_def.defined_namespace = current_namespace_; +- if (enums_.Add(current_namespace_->GetFullyQualifiedName(enum_name), +- &enum_def)) +- return Error("enum already exists: " + enum_name); ++ const auto qualified_name = current_namespace_->GetFullyQualifiedName(name); ++ if (enums_.Add(qualified_name, &enum_def)) ++ return Error("enum already exists: " + qualified_name); + enum_def.underlying_type.base_type = + is_union ? BASE_TYPE_UTYPE : BASE_TYPE_INT; + enum_def.underlying_type.enum_def = &enum_def; +@@ -3232,7 +3271,7 @@ + for (auto val_it = enum_def.Vals().begin(); + val_it != enum_def.Vals().end(); ++val_it) { + auto &val = **val_it; +- if (!SupportsAdvancedUnionFeatures() && ++ if (!(opts.lang_to_generate != 0 && SupportsAdvancedUnionFeatures()) && + (IsStruct(val.union_type) || IsString(val.union_type))) + return Error( + "only tables can be union elements in the generated language: " + +@@ -3296,7 +3335,7 @@ + ECHECK(ParseProtoDecl()); + } else if (IsIdent("native_include")) { + NEXT(); +- vector_emplace_back(&native_included_files_, attribute_); ++ native_included_files_.emplace_back(attribute_); + EXPECT(kTokenStringConstant); + EXPECT(';'); + } else if (IsIdent("include") || (opts.proto_mode && IsIdent("import"))) { +@@ -3364,9 +3403,9 @@ + } else if (token_ == '{') { + return NoError(); + } else if (IsIdent("enum")) { +- ECHECK(ParseEnum(false, nullptr)); ++ ECHECK(ParseEnum(false, nullptr, source_filename)); + } else if (IsIdent("union")) { +- ECHECK(ParseEnum(true, nullptr)); ++ ECHECK(ParseEnum(true, nullptr, source_filename)); + } else if (IsIdent("root_type")) { + NEXT(); + auto root_type = attribute_; +@@ -3382,9 +3421,9 @@ + NEXT(); + file_identifier_ = attribute_; + EXPECT(kTokenStringConstant); +- if (file_identifier_.length() != FlatBufferBuilder::kFileIdentifierLength) ++ if (file_identifier_.length() != flatbuffers::kFileIdentifierLength) + return Error("file_identifier must be exactly " + +- NumToString(FlatBufferBuilder::kFileIdentifierLength) + ++ NumToString(flatbuffers::kFileIdentifierLength) + + " characters"); + EXPECT(';'); + } else if (IsIdent("file_extension")) { +@@ -3405,11 +3444,14 @@ + EXPECT(';'); + known_attributes_[name] = false; + } else if (IsIdent("rpc_service")) { +- ECHECK(ParseService()); ++ ECHECK(ParseService(source_filename)); + } else { +- ECHECK(ParseDecl()); ++ ECHECK(ParseDecl(source_filename)); + } + } ++ if (opts.warnings_as_errors && has_warning_) { ++ return Error("treating warnings as errors, failed due to above warnings"); ++ } + return NoError(); + } + +@@ -3484,32 +3526,63 @@ + AssignIndices(structs_.vec); + AssignIndices(enums_.vec); + std::vector> object_offsets; ++ std::set files; + for (auto it = structs_.vec.begin(); it != structs_.vec.end(); ++it) { + auto offset = (*it)->Serialize(&builder_, *this); + object_offsets.push_back(offset); + (*it)->serialized_location = offset.o; ++ const std::string *file = (*it)->declaration_file; ++ if (file) files.insert(*file); + } + std::vector> enum_offsets; + for (auto it = enums_.vec.begin(); it != enums_.vec.end(); ++it) { + auto offset = (*it)->Serialize(&builder_, *this); + enum_offsets.push_back(offset); +- (*it)->serialized_location = offset.o; ++ const std::string *file = (*it)->declaration_file; ++ if (file) files.insert(*file); + } + std::vector> service_offsets; + for (auto it = services_.vec.begin(); it != services_.vec.end(); ++it) { + auto offset = (*it)->Serialize(&builder_, *this); + service_offsets.push_back(offset); +- (*it)->serialized_location = offset.o; ++ const std::string *file = (*it)->declaration_file; ++ if (file) files.insert(*file); + } +- auto objs__ = builder_.CreateVectorOfSortedTables(&object_offsets); +- auto enum__ = builder_.CreateVectorOfSortedTables(&enum_offsets); +- auto fiid__ = builder_.CreateString(file_identifier_); +- auto fext__ = builder_.CreateString(file_extension_); +- auto serv__ = builder_.CreateVectorOfSortedTables(&service_offsets); +- auto schema_offset = reflection::CreateSchema( ++ ++ // Create Schemafiles vector of tables. ++ flatbuffers::Offset< ++ flatbuffers::Vector>> ++ schema_files__; ++ if (!opts.project_root.empty()) { ++ std::vector> schema_files; ++ std::vector> included_files; ++ for (auto f = files_included_per_file_.begin(); ++ f != files_included_per_file_.end(); f++) { ++ const auto filename__ = builder_.CreateSharedString( ++ RelativeToRootPath(opts.project_root, f->first)); ++ for (auto i = f->second.begin(); i != f->second.end(); i++) { ++ included_files.push_back(builder_.CreateSharedString( ++ RelativeToRootPath(opts.project_root, *i))); ++ } ++ const auto included_files__ = builder_.CreateVector(included_files); ++ included_files.clear(); ++ ++ schema_files.push_back( ++ reflection::CreateSchemaFile(builder_, filename__, included_files__)); ++ } ++ schema_files__ = builder_.CreateVectorOfSortedTables(&schema_files); ++ } ++ ++ const auto objs__ = builder_.CreateVectorOfSortedTables(&object_offsets); ++ const auto enum__ = builder_.CreateVectorOfSortedTables(&enum_offsets); ++ const auto fiid__ = builder_.CreateString(file_identifier_); ++ const auto fext__ = builder_.CreateString(file_extension_); ++ const auto serv__ = builder_.CreateVectorOfSortedTables(&service_offsets); ++ const auto schema_offset = reflection::CreateSchema( + builder_, objs__, enum__, fiid__, fext__, + (root_struct_def_ ? root_struct_def_->serialized_location : 0), serv__, +- static_cast(advanced_features_)); ++ static_cast(advanced_features_), ++ schema_files__); + if (opts.size_prefixed) { + builder_.FinishSizePrefixed(schema_offset, reflection::SchemaIdentifier()); + } else { +@@ -3550,16 +3623,18 @@ + field_offsets.push_back((*it)->Serialize( + builder, static_cast(it - fields.vec.begin()), parser)); + } +- auto qualified_name = defined_namespace->GetFullyQualifiedName(name); +- auto name__ = builder->CreateString(qualified_name); +- auto flds__ = builder->CreateVectorOfSortedTables(&field_offsets); +- auto attr__ = SerializeAttributes(builder, parser); +- auto docs__ = parser.opts.binary_schema_comments +- ? builder->CreateVectorOfStrings(doc_comment) +- : 0; +- return reflection::CreateObject(*builder, name__, flds__, fixed, +- static_cast(minalign), +- static_cast(bytesize), attr__, docs__); ++ const auto qualified_name = defined_namespace->GetFullyQualifiedName(name); ++ const auto name__ = builder->CreateString(qualified_name); ++ const auto flds__ = builder->CreateVectorOfSortedTables(&field_offsets); ++ const auto attr__ = SerializeAttributes(builder, parser); ++ const auto docs__ = parser.opts.binary_schema_comments ++ ? builder->CreateVectorOfStrings(doc_comment) ++ : 0; ++ std::string decl_file_in_project = declaration_file ? *declaration_file : ""; ++ const auto file__ = builder->CreateSharedString(decl_file_in_project); ++ return reflection::CreateObject( ++ *builder, name__, flds__, fixed, static_cast(minalign), ++ static_cast(bytesize), attr__, docs__, file__); + } + + bool StructDef::Deserialize(Parser &parser, const reflection::Object *object) { +@@ -3613,7 +3688,7 @@ + IsInteger(value.type.base_type) ? StringToInt(value.constant.c_str()) : 0, + // result may be platform-dependent if underlying is float (not double) + IsFloat(value.type.base_type) ? d : 0.0, deprecated, IsRequired(), key, +- attr__, docs__, IsOptional()); ++ attr__, docs__, IsOptional(), static_cast(padding)); + // TODO: value.constant is almost always "0", we could save quite a bit of + // space by sharing it. Same for common values of value.type. + } +@@ -3629,6 +3704,7 @@ + value.constant = FloatToString(field->default_real(), 16); + } + presence = FieldDef::MakeFieldPresence(field->optional(), field->required()); ++ padding = field->padding(); + key = field->key(); + if (!DeserializeAttributes(parser, field->attributes())) return false; + // TODO: this should probably be handled by a separate attribute +@@ -3678,14 +3754,17 @@ + for (auto it = calls.vec.begin(); it != calls.vec.end(); ++it) { + servicecall_offsets.push_back((*it)->Serialize(builder, parser)); + } +- auto qualified_name = defined_namespace->GetFullyQualifiedName(name); +- auto name__ = builder->CreateString(qualified_name); +- auto call__ = builder->CreateVector(servicecall_offsets); +- auto attr__ = SerializeAttributes(builder, parser); +- auto docs__ = parser.opts.binary_schema_comments +- ? builder->CreateVectorOfStrings(doc_comment) +- : 0; +- return reflection::CreateService(*builder, name__, call__, attr__, docs__); ++ const auto qualified_name = defined_namespace->GetFullyQualifiedName(name); ++ const auto name__ = builder->CreateString(qualified_name); ++ const auto call__ = builder->CreateVector(servicecall_offsets); ++ const auto attr__ = SerializeAttributes(builder, parser); ++ const auto docs__ = parser.opts.binary_schema_comments ++ ? builder->CreateVectorOfStrings(doc_comment) ++ : 0; ++ std::string decl_file_in_project = declaration_file ? *declaration_file : ""; ++ const auto file__ = builder->CreateSharedString(decl_file_in_project); ++ return reflection::CreateService(*builder, name__, call__, attr__, docs__, ++ file__); + } + + bool ServiceDef::Deserialize(Parser &parser, +@@ -3712,16 +3791,18 @@ + for (auto it = vals.vec.begin(); it != vals.vec.end(); ++it) { + enumval_offsets.push_back((*it)->Serialize(builder, parser)); + } +- auto qualified_name = defined_namespace->GetFullyQualifiedName(name); +- auto name__ = builder->CreateString(qualified_name); +- auto vals__ = builder->CreateVector(enumval_offsets); +- auto type__ = underlying_type.Serialize(builder); +- auto attr__ = SerializeAttributes(builder, parser); +- auto docs__ = parser.opts.binary_schema_comments +- ? builder->CreateVectorOfStrings(doc_comment) +- : 0; ++ const auto qualified_name = defined_namespace->GetFullyQualifiedName(name); ++ const auto name__ = builder->CreateString(qualified_name); ++ const auto vals__ = builder->CreateVector(enumval_offsets); ++ const auto type__ = underlying_type.Serialize(builder); ++ const auto attr__ = SerializeAttributes(builder, parser); ++ const auto docs__ = parser.opts.binary_schema_comments ++ ? builder->CreateVectorOfStrings(doc_comment) ++ : 0; ++ std::string decl_file_in_project = declaration_file ? *declaration_file : ""; ++ const auto file__ = builder->CreateSharedString(decl_file_in_project); + return reflection::CreateEnum(*builder, name__, vals__, is_union, type__, +- attr__, docs__); ++ attr__, docs__, file__); + } + + bool EnumDef::Deserialize(Parser &parser, const reflection::Enum *_enum) { +@@ -3750,10 +3831,7 @@ + auto docs__ = parser.opts.binary_schema_comments + ? builder->CreateVectorOfStrings(doc_comment) + : 0; +- return reflection::CreateEnumVal( +- *builder, name__, value, +- union_type.struct_def ? union_type.struct_def->serialized_location : 0, +- type__, docs__); ++ return reflection::CreateEnumVal(*builder, name__, value, type__, docs__); + } + + bool EnumVal::Deserialize(const Parser &parser, +@@ -3770,7 +3848,8 @@ + *builder, static_cast(base_type), + static_cast(element), + struct_def ? struct_def->index : (enum_def ? enum_def->index : -1), +- fixed_length); ++ fixed_length, static_cast(SizeOf(base_type)), ++ static_cast(SizeOf(element))); + } + + bool Type::Deserialize(const Parser &parser, const reflection::Type *type) { +@@ -3927,6 +4006,16 @@ + } + } + advanced_features_ = schema->advanced_features(); ++ ++ if (schema->fbs_files()) ++ for (auto s = schema->fbs_files()->begin(); s != schema->fbs_files()->end(); ++ ++s) { ++ for (auto f = s->included_filenames()->begin(); ++ f != s->included_filenames()->end(); ++f) { ++ files_included_per_file_[s->filename()->str()].insert(f->str()); ++ } ++ } ++ + return true; + } + +diff -urN a/src/reflection.cpp b/src/reflection.cpp +--- a/src/reflection.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/reflection.cpp 2023-01-13 07:47:09.831260848 +0000 +@@ -23,7 +23,7 @@ + namespace flatbuffers { + + int64_t GetAnyValueI(reflection::BaseType type, const uint8_t *data) { +-// clang-format off ++ // clang-format off + #define FLATBUFFERS_GET(T) static_cast(ReadScalar(data)) + switch (type) { + case reflection::UType: +@@ -121,7 +121,7 @@ + } + + void SetAnyValueI(reflection::BaseType type, uint8_t *data, int64_t val) { +-// clang-format off ++ // clang-format off + #define FLATBUFFERS_SET(T) WriteScalar(data, static_cast(val)) + switch (type) { + case reflection::UType: +@@ -180,7 +180,7 @@ + std::vector *flatbuf, + const reflection::Object *root_table = nullptr) + : schema_(schema), +- startptr_(vector_data(*flatbuf) + start), ++ startptr_(flatbuf->data() + start), + delta_(delta), + buf_(*flatbuf), + dag_check_(flatbuf->size() / sizeof(uoffset_t), false) { +@@ -188,8 +188,8 @@ + delta_ = (delta_ + mask) & ~mask; + if (!delta_) return; // We can't shrink by less than largest_scalar_t. + // Now change all the offsets by delta_. +- auto root = GetAnyRoot(vector_data(buf_)); +- Straddle(vector_data(buf_), root, vector_data(buf_)); ++ auto root = GetAnyRoot(buf_.data()); ++ Straddle(buf_.data(), root, buf_.data()); + ResizeTable(root_table ? *root_table : *schema.root_table(), root); + // We can now add or remove bytes at start. + if (delta_ > 0) +@@ -217,7 +217,7 @@ + // will straddle and which won't. + uint8_t &DagCheck(const void *offsetloc) { + auto dag_idx = reinterpret_cast(offsetloc) - +- reinterpret_cast(vector_data(buf_)); ++ reinterpret_cast(buf_.data()); + return dag_check_[dag_idx]; + } + +@@ -309,19 +309,19 @@ + const reflection::Object *root_table) { + auto delta = static_cast(val.size()) - static_cast(str->size()); + auto str_start = static_cast( +- reinterpret_cast(str) - vector_data(*flatbuf)); ++ reinterpret_cast(str) - flatbuf->data()); + auto start = str_start + static_cast(sizeof(uoffset_t)); + if (delta) { + // Clear the old string, since we don't want parts of it remaining. +- memset(vector_data(*flatbuf) + start, 0, str->size()); ++ memset(flatbuf->data() + start, 0, str->size()); + // Different size, we must expand (or contract). + ResizeContext(schema, start, delta, flatbuf, root_table); + // Set the new length. +- WriteScalar(vector_data(*flatbuf) + str_start, ++ WriteScalar(flatbuf->data() + str_start, + static_cast(val.size())); + } + // Copy new data. Safe because we created the right amount of space. +- memcpy(vector_data(*flatbuf) + start, val.c_str(), val.size() + 1); ++ memcpy(flatbuf->data() + start, val.c_str(), val.size() + 1); + } + + uint8_t *ResizeAnyVector(const reflection::Schema &schema, uoffset_t newsize, +@@ -330,25 +330,26 @@ + const reflection::Object *root_table) { + auto delta_elem = static_cast(newsize) - static_cast(num_elems); + auto delta_bytes = delta_elem * static_cast(elem_size); +- auto vec_start = +- reinterpret_cast(vec) - vector_data(*flatbuf); +- auto start = static_cast(vec_start + sizeof(uoffset_t) + +- elem_size * num_elems); ++ auto vec_start = reinterpret_cast(vec) - flatbuf->data(); ++ auto start = static_cast(vec_start) + ++ static_cast(sizeof(uoffset_t)) + ++ elem_size * num_elems; + if (delta_bytes) { + if (delta_elem < 0) { + // Clear elements we're throwing away, since some might remain in the + // buffer. + auto size_clear = -delta_elem * elem_size; +- memset(vector_data(*flatbuf) + start - size_clear, 0, size_clear); ++ memset(flatbuf->data() + start - size_clear, 0, size_clear); + } + ResizeContext(schema, start, delta_bytes, flatbuf, root_table); +- WriteScalar(vector_data(*flatbuf) + vec_start, newsize); // Length field. ++ WriteScalar(flatbuf->data() + vec_start, newsize); // Length field. + // Set new elements to 0.. this can be overwritten by the caller. + if (delta_elem > 0) { +- memset(vector_data(*flatbuf) + start, 0, delta_elem * elem_size); ++ memset(flatbuf->data() + start, 0, ++ static_cast(delta_elem) * elem_size); + } + } +- return vector_data(*flatbuf) + start; ++ return flatbuf->data() + start; + } + + const uint8_t *AddFlatBuffer(std::vector &flatbuf, +@@ -363,7 +364,7 @@ + // Insert the entire FlatBuffer minus the root pointer. + flatbuf.insert(flatbuf.end(), newbuf + sizeof(uoffset_t), newbuf + newlen); + auto root_offset = ReadScalar(newbuf) - sizeof(uoffset_t); +- return vector_data(flatbuf) + insertion_point + root_offset; ++ return flatbuf.data() + insertion_point + root_offset; + } + + void CopyInline(FlatBufferBuilder &fbb, const reflection::Field &fielddef, +@@ -504,8 +505,9 @@ + auto offset = parent_table.GetOptionalFieldOffset(field_offset); + if (required && !offset) { return false; } + +- return !offset || v.Verify(reinterpret_cast(&parent_table), +- offset, obj.bytesize()); ++ return !offset || ++ v.VerifyFieldStruct(reinterpret_cast(&parent_table), ++ offset, obj.bytesize(), obj.minalign()); + } + + bool VerifyVectorOfStructs(flatbuffers::Verifier &v, +@@ -552,7 +554,8 @@ + const flatbuffers::Table &table, + const reflection::Field &vec_field) { + FLATBUFFERS_ASSERT(vec_field.type()->base_type() == reflection::Vector); +- if (!table.VerifyField(v, vec_field.offset())) return false; ++ if (!table.VerifyField(v, vec_field.offset(), sizeof(uoffset_t))) ++ return false; + + switch (vec_field.type()->element()) { + case reflection::UType: +@@ -635,33 +638,45 @@ + switch (field_def->type()->base_type()) { + case reflection::None: FLATBUFFERS_ASSERT(false); break; + case reflection::UType: +- if (!table->VerifyField(v, field_def->offset())) return false; ++ if (!table->VerifyField(v, field_def->offset(), ++ sizeof(uint8_t))) ++ return false; + break; + case reflection::Bool: + case reflection::Byte: + case reflection::UByte: +- if (!table->VerifyField(v, field_def->offset())) return false; ++ if (!table->VerifyField(v, field_def->offset(), sizeof(int8_t))) ++ return false; + break; + case reflection::Short: + case reflection::UShort: +- if (!table->VerifyField(v, field_def->offset())) return false; ++ if (!table->VerifyField(v, field_def->offset(), ++ sizeof(int16_t))) ++ return false; + break; + case reflection::Int: + case reflection::UInt: +- if (!table->VerifyField(v, field_def->offset())) return false; ++ if (!table->VerifyField(v, field_def->offset(), ++ sizeof(int32_t))) ++ return false; + break; + case reflection::Long: + case reflection::ULong: +- if (!table->VerifyField(v, field_def->offset())) return false; ++ if (!table->VerifyField(v, field_def->offset(), ++ sizeof(int64_t))) ++ return false; + break; + case reflection::Float: +- if (!table->VerifyField(v, field_def->offset())) return false; ++ if (!table->VerifyField(v, field_def->offset(), sizeof(float))) ++ return false; + break; + case reflection::Double: +- if (!table->VerifyField(v, field_def->offset())) return false; ++ if (!table->VerifyField(v, field_def->offset(), sizeof(double))) ++ return false; + break; + case reflection::String: +- if (!table->VerifyField(v, field_def->offset()) || ++ if (!table->VerifyField(v, field_def->offset(), ++ sizeof(uoffset_t)) || + !v.VerifyString(flatbuffers::GetFieldS(*table, *field_def))) { + return false; + } +diff -urN a/src/util.cpp b/src/util.cpp +--- a/src/util.cpp 2021-05-10 18:45:16.000000000 +0000 ++++ b/src/util.cpp 2023-01-13 07:47:09.939261845 +0000 +@@ -40,14 +40,16 @@ + #endif + // clang-format on + +-#include "flatbuffers/base.h" + #include "flatbuffers/util.h" + + #include ++ + #include + #include + #include + ++#include "flatbuffers/base.h" ++ + namespace flatbuffers { + + bool FileExistsRaw(const char *name) { +@@ -156,7 +158,7 @@ + const std::string &filename) { + std::string filepath = path; + if (filepath.length()) { +- char &filepath_last_character = string_back(filepath); ++ char &filepath_last_character = filepath.back(); + if (filepath_last_character == kPathSeparatorWindows) { + filepath_last_character = kPathSeparator; + } else if (filepath_last_character != kPathSeparator) { +@@ -176,6 +178,9 @@ + std::replace(p.begin(), p.end(), '\\', '/'); + return p; + } ++std::string PosixPath(const std::string &path) { ++ return PosixPath(path.c_str()); ++} + + void EnsureDirExists(const std::string &filepath) { + auto parent = StripFileName(filepath); +@@ -215,6 +220,36 @@ + // clang-format on + } + ++std::string RelativeToRootPath(const std::string &project, ++ const std::string &filepath) { ++ std::string absolute_project = PosixPath(AbsolutePath(project)); ++ if (absolute_project.back() != '/') absolute_project += "/"; ++ std::string absolute_filepath = PosixPath(AbsolutePath(filepath)); ++ ++ // Find the first character where they disagree. ++ // The previous directory is the lowest common ancestor; ++ const char *a = absolute_project.c_str(); ++ const char *b = absolute_filepath.c_str(); ++ size_t common_prefix_len = 0; ++ while (*a != '\0' && *b != '\0' && *a == *b) { ++ if (*a == '/') common_prefix_len = a - absolute_project.c_str(); ++ a++; ++ b++; ++ } ++ // the number of ../ to prepend to b depends on the number of remaining ++ // directories in A. ++ const char *suffix = absolute_project.c_str() + common_prefix_len; ++ size_t num_up = 0; ++ while (*suffix != '\0') ++ if (*suffix++ == '/') num_up++; ++ num_up--; // last one is known to be '/'. ++ std::string result = "//"; ++ for (size_t i = 0; i < num_up; i++) result += "../"; ++ result += absolute_filepath.substr(common_prefix_len + 1); ++ ++ return result; ++} ++ + // Locale-independent code. + #if defined(FLATBUFFERS_LOCALE_INDEPENDENT) && \ + (FLATBUFFERS_LOCALE_INDEPENDENT > 0) +@@ -238,8 +273,7 @@ + + std::string RemoveStringQuotes(const std::string &s) { + auto ch = *s.c_str(); +- return ((s.size() >= 2) && (ch == '\"' || ch == '\'') && +- (ch == string_back(s))) ++ return ((s.size() >= 2) && (ch == '\"' || ch == '\'') && (ch == s.back())) + ? s.substr(1, s.length() - 2) + : s; + } +diff -urN a/swift/FlatBuffers.podspec b/swift/FlatBuffers.podspec +--- a/swift/FlatBuffers.podspec 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/FlatBuffers.podspec 2023-01-13 07:47:12.800288267 +0000 +@@ -1,6 +1,6 @@ + Pod::Spec.new do |s| + s.name = 'FlatBuffers' +- s.version = '1.0.0' ++ s.version = '2.0.0' + s.summary = 'FlatBuffers: Memory Efficient Serialization Library' + + s.description = "FlatBuffers is a cross platform serialization library architected for +diff -urN a/swift/Package.swift b/swift/Package.swift +--- a/swift/Package.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Package.swift 2023-01-13 07:47:12.847288701 +0000 +@@ -31,5 +31,6 @@ + targets: [ + .target( + name: "FlatBuffers", +- dependencies: []), ++ dependencies: [], ++ exclude: ["Documentation.docc/Resources/code/swift"]), + ]) +diff -urN a/swift/Package@swift-5.5.swift b/swift/Package@swift-5.5.swift +--- a/swift/Package@swift-5.5.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Package@swift-5.5.swift 2023-01-13 07:47:12.848288710 +0000 +@@ -0,0 +1,36 @@ ++// swift-tools-version:5.5 ++/* ++ * Copyright 2020 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++import PackageDescription ++ ++let package = Package( ++ name: "FlatBuffers", ++ platforms: [ ++ .iOS(.v11), ++ .macOS(.v10_14), ++ ], ++ products: [ ++ .library( ++ name: "FlatBuffers", ++ targets: ["FlatBuffers"]), ++ ], ++ targets: [ ++ .target( ++ name: "FlatBuffers", ++ dependencies: []), ++ ]) ++ +diff -urN a/swift/README.md b/swift/README.md +--- a/swift/README.md 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/README.md 2023-01-13 07:47:12.848288710 +0000 +@@ -10,8 +10,6 @@ + + 1- To report any error please use the main repository. + +-2- `1.0.0` deprecates `MyGame_Example_Vec3.createVec3(builder: &fbb, x: 10, test2: .blue)` for `MyGame_Example_Vec3(x: 10, test2: .blue)`. This uses Swift native structs instead of workarounds that which leads to a huge performance increase when serializing structs. You can download the [binary here](https://github.com/google/flatbuffers/actions) and select the latest push to master +- + ### Contribute + + 1- Always run `swift test --generate-linuxmain` whenever new test functions are added or removed +\ No newline at end of file +diff -urN a/swift/Sources/FlatBuffers/ByteBuffer.swift b/swift/Sources/FlatBuffers/ByteBuffer.swift +--- a/swift/Sources/FlatBuffers/ByteBuffer.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/ByteBuffer.swift 2023-01-13 07:47:12.848288710 +0000 +@@ -16,6 +16,9 @@ + + import Foundation + ++/// `ByteBuffer` is the interface that stores the data for a `Flatbuffers` object ++/// it allows users to write and read data directly from memory thus the use of its ++/// functions should be used + @frozen + public struct ByteBuffer { + +@@ -32,7 +35,9 @@ + + @usableFromInline + init(count: Int, alignment: Int) { +- memory = UnsafeMutableRawPointer.allocate(byteCount: count, alignment: alignment) ++ memory = UnsafeMutableRawPointer.allocate( ++ byteCount: count, ++ alignment: alignment) + capacity = count + unowned = false + } +@@ -69,7 +74,7 @@ + /// Reallocates the buffer incase the object to be written doesnt fit in the current buffer + /// - Parameter size: Size of the current object + @usableFromInline +- internal func reallocate(_ size: Int, writerSize: Int, alignment: Int) { ++ func reallocate(_ size: Int, writerSize: Int, alignment: Int) { + let currentWritingIndex = capacity &- writerSize + while capacity <= writerSize &+ size { + capacity = capacity << 1 +@@ -78,7 +83,9 @@ + /// solution take from Apple-NIO + capacity = capacity.convertToPowerofTwo + +- let newData = UnsafeMutableRawPointer.allocate(byteCount: capacity, alignment: alignment) ++ let newData = UnsafeMutableRawPointer.allocate( ++ byteCount: capacity, ++ alignment: alignment) + memset(newData, 0, capacity &- writerSize) + memcpy( + newData.advanced(by: capacity &- writerSize), +@@ -94,9 +101,9 @@ + /// The size of the elements written to the buffer + their paddings + private var _writerSize: Int = 0 + /// Aliginment of the current memory being written to the buffer +- internal var alignment = 1 ++ var alignment = 1 + /// Current Index which is being used to write to the buffer, it is written from the end to the start of the buffer +- internal var writerIndex: Int { _storage.capacity &- _writerSize } ++ var writerIndex: Int { _storage.capacity &- _writerSize } + + /// Reader is the position of the current Writer Index (capacity - size) + public var reader: Int { writerIndex } +@@ -157,7 +164,10 @@ + /// Constructor that creates a Flatbuffer from unsafe memory region without copying + /// - Parameter assumingMemoryBound: The unsafe memory region + /// - Parameter capacity: The size of the given memory region +- public init(assumingMemoryBound memory: UnsafeMutableRawPointer, capacity: Int) { ++ public init( ++ assumingMemoryBound memory: UnsafeMutableRawPointer, ++ capacity: Int) ++ { + _storage = Storage(memory: memory, capacity: capacity, unowned: true) + _writerSize = capacity + } +@@ -166,7 +176,7 @@ + /// - Parameters: + /// - memory: Current memory of the buffer + /// - count: count of bytes +- internal init(memory: UnsafeMutableRawPointer, count: Int) { ++ init(memory: UnsafeMutableRawPointer, count: Int) { + _storage = Storage(count: count, alignment: alignment) + _storage.copy(from: memory, count: count) + _writerSize = _storage.capacity +@@ -177,7 +187,11 @@ + /// - memory: Current memory of the buffer + /// - count: count of bytes + /// - removeBytes: Removes a number of bytes from the current size +- internal init(memory: UnsafeMutableRawPointer, count: Int, removing removeBytes: Int) { ++ init( ++ memory: UnsafeMutableRawPointer, ++ count: Int, ++ removing removeBytes: Int) ++ { + _storage = Storage(count: count, alignment: alignment) + _storage.copy(from: memory, count: count) + _writerSize = removeBytes +@@ -233,7 +247,10 @@ + @usableFromInline + mutating func push(string str: String, len: Int) { + ensureSpace(size: len) +- if str.utf8.withContiguousStorageIfAvailable({ self.push(bytes: $0, len: len) }) != nil { ++ if str.utf8 ++ .withContiguousStorageIfAvailable({ self.push(bytes: $0, len: len) }) != ++ nil ++ { + } else { + let utf8View = str.utf8 + for c in utf8View.reversed() { +@@ -247,7 +264,7 @@ + /// - bytes: Pointer to the view + /// - len: Size of string + @inline(__always) +- mutating internal func push( ++ mutating func push( + bytes: UnsafeBufferPointer, + len: Int) -> Bool + { +@@ -292,20 +309,20 @@ + /// pops the written VTable if it's already written into the buffer + /// - Parameter size: size of the `VTable` + @inline(__always) +- mutating internal func pop(_ size: Int) { +- assert((_writerSize &- size) > 0, "New size should NOT be a negative number") ++ mutating func pop(_ size: Int) { ++ assert( ++ (_writerSize &- size) > 0, ++ "New size should NOT be a negative number") + memset(_storage.memory.advanced(by: writerIndex), 0, _writerSize &- size) + _writerSize = size + } + + /// Clears the current size of the buffer +- @inline(__always) + mutating public func clearSize() { + _writerSize = 0 + } + + /// Clears the current instance of the buffer, replacing it with new memory +- @inline(__always) + mutating public func clear() { + _writerSize = 0 + alignment = 1 +@@ -317,10 +334,7 @@ + /// - def: Type of the object + /// - position: the index of the object in the buffer + public func read(def: T.Type, position: Int) -> T { +- assert( +- position + MemoryLayout.size <= _storage.capacity, +- "Reading out of bounds is illegal") +- return _storage.memory.advanced(by: position).load(as: T.self) ++ _storage.memory.advanced(by: position).load(as: T.self) + } + + /// Reads a slice from the memory assuming a type of T +@@ -329,14 +343,15 @@ + /// - count: count of bytes in memory + @inline(__always) + public func readSlice( +- index: Int32, +- count: Int32) -> [T] ++ index: Int, ++ count: Int) -> [T] + { +- let _index = Int(index) +- let _count = Int(count) +- assert(_index + _count <= _storage.capacity, "Reading out of bounds is illegal") +- let start = _storage.memory.advanced(by: _index).assumingMemoryBound(to: T.self) +- let array = UnsafeBufferPointer(start: start, count: _count) ++ assert( ++ index + count <= _storage.capacity, ++ "Reading out of bounds is illegal") ++ let start = _storage.memory.advanced(by: index) ++ .assumingMemoryBound(to: T.self) ++ let array = UnsafeBufferPointer(start: start, count: count) + return Array(array) + } + +@@ -345,17 +360,17 @@ + /// - index: index of the string in the buffer + /// - count: length of the string + /// - type: Encoding of the string +- @inline(__always) + public func readString( +- at index: Int32, +- count: Int32, ++ at index: Int, ++ count: Int, + type: String.Encoding = .utf8) -> String? + { +- let _index = Int(index) +- let _count = Int(count) +- assert(_index + _count <= _storage.capacity, "Reading out of bounds is illegal") +- let start = _storage.memory.advanced(by: _index).assumingMemoryBound(to: UInt8.self) +- let bufprt = UnsafeBufferPointer(start: start, count: _count) ++ assert( ++ index + count <= _storage.capacity, ++ "Reading out of bounds is illegal") ++ let start = _storage.memory.advanced(by: index) ++ .assumingMemoryBound(to: UInt8.self) ++ let bufprt = UnsafeBufferPointer(start: start, count: count) + return String(bytes: Array(bufprt), encoding: type) + } + +@@ -363,12 +378,32 @@ + /// - Parameter removeBytes: the amount of bytes to remove from the current Size + public func duplicate(removing removeBytes: Int = 0) -> ByteBuffer { + assert(removeBytes > 0, "Can NOT remove negative bytes") +- assert(removeBytes < _storage.capacity, "Can NOT remove more bytes than the ones allocated") ++ assert( ++ removeBytes < _storage.capacity, ++ "Can NOT remove more bytes than the ones allocated") + return ByteBuffer( + memory: _storage.memory, + count: _storage.capacity, + removing: _writerSize &- removeBytes) + } ++ ++ /// Returns the written bytes into the ``ByteBuffer`` ++ public var underlyingBytes: [UInt8] { ++ let cp = capacity &- writerIndex ++ let start = memory.advanced(by: writerIndex) ++ .bindMemory(to: UInt8.self, capacity: cp) ++ ++ let ptr = UnsafeBufferPointer(start: start, count: cp) ++ return Array(ptr) ++ } ++ ++ /// SkipPrefix Skips the first 4 bytes in case one of the following ++ /// functions are called `getPrefixedSizeCheckedRoot` & `getPrefixedSizeRoot` ++ /// which allows us to skip the first 4 bytes instead of recreating the buffer ++ @usableFromInline ++ mutating func skipPrefix() { ++ _writerSize = _writerSize &- MemoryLayout.size ++ } + } + + extension ByteBuffer: CustomDebugStringConvertible { +diff -urN a/swift/Sources/FlatBuffers/Constants.swift b/swift/Sources/FlatBuffers/Constants.swift +--- a/swift/Sources/FlatBuffers/Constants.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Constants.swift 2023-01-13 07:47:12.848288710 +0000 +@@ -21,7 +21,8 @@ + #endif + + /// A boolean to see if the system is littleEndian +-let isLitteEndian = CFByteOrderGetCurrent() == Int(CFByteOrderLittleEndian.rawValue) ++let isLitteEndian = CFByteOrderGetCurrent() == ++ Int(CFByteOrderLittleEndian.rawValue) + /// Constant for the file id length + let FileIdLength = 4 + /// Type aliases +@@ -30,16 +31,19 @@ + public typealias SOffset = Int32 + public typealias VOffset = UInt16 + /// Maximum size for a buffer +-public let FlatBufferMaxSize = UInt32.max << ((MemoryLayout.size * 8 - 1) - 1) ++public let FlatBufferMaxSize = UInt32 ++ .max << ((MemoryLayout.size * 8 - 1) - 1) + +-/// Protocol that confirms all the numbers ++/// Protocol that All Scalars should conform to + /// +-/// Scalar is used to confirm all the numbers that can be represented in a FlatBuffer. It's used to write/read from the buffer. ++/// Scalar is used to conform all the numbers that can be represented in a FlatBuffer. It's used to write/read from the buffer. + public protocol Scalar: Equatable { + associatedtype NumericValue + var convertedEndian: NumericValue { get } + } + ++extension Scalar where Self: Verifiable {} ++ + extension Scalar where Self: FixedWidthInteger { + /// Converts the value from BigEndian to LittleEndian + /// +@@ -49,7 +53,7 @@ + } + } + +-extension Double: Scalar { ++extension Double: Scalar, Verifiable { + public typealias NumericValue = UInt64 + + public var convertedEndian: UInt64 { +@@ -57,7 +61,7 @@ + } + } + +-extension Float32: Scalar { ++extension Float32: Scalar, Verifiable { + public typealias NumericValue = UInt32 + + public var convertedEndian: UInt32 { +@@ -65,7 +69,7 @@ + } + } + +-extension Bool: Scalar { ++extension Bool: Scalar, Verifiable { + public var convertedEndian: UInt8 { + self == true ? 1 : 0 + } +@@ -73,39 +77,39 @@ + public typealias NumericValue = UInt8 + } + +-extension Int: Scalar { ++extension Int: Scalar, Verifiable { + public typealias NumericValue = Int + } + +-extension Int8: Scalar { ++extension Int8: Scalar, Verifiable { + public typealias NumericValue = Int8 + } + +-extension Int16: Scalar { ++extension Int16: Scalar, Verifiable { + public typealias NumericValue = Int16 + } + +-extension Int32: Scalar { ++extension Int32: Scalar, Verifiable { + public typealias NumericValue = Int32 + } + +-extension Int64: Scalar { ++extension Int64: Scalar, Verifiable { + public typealias NumericValue = Int64 + } + +-extension UInt8: Scalar { ++extension UInt8: Scalar, Verifiable { + public typealias NumericValue = UInt8 + } + +-extension UInt16: Scalar { ++extension UInt16: Scalar, Verifiable { + public typealias NumericValue = UInt16 + } + +-extension UInt32: Scalar { ++extension UInt32: Scalar, Verifiable { + public typealias NumericValue = UInt32 + } + +-extension UInt64: Scalar { ++extension UInt64: Scalar, Verifiable { + public typealias NumericValue = UInt64 + } + +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Documentation.md b/swift/Sources/FlatBuffers/Documentation.docc/Documentation.md +--- a/swift/Sources/FlatBuffers/Documentation.docc/Documentation.md 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Documentation.md 2023-01-13 07:47:12.857288794 +0000 +@@ -0,0 +1,22 @@ ++# ``FlatBuffers`` ++ ++FlatBuffers: Memory Efficient Serialization Library ++ ++## Overview ++ ++- Access to serialized data without parsing/unpacking - What sets FlatBuffers apart is that it represents hierarchical data in a flat binary buffer in such a way that it can still be accessed directly without parsing/unpacking, while also still supporting data structure evolution (forwards/backwards compatibility). ++- Memory efficiency and speed - The only memory needed to access your data is that of the buffer. It requires 0 additional allocations (in C++, other languages may vary). FlatBuffers is also very suitable for use with mmap (or streaming), requiring only part of the buffer to be in memory. Access is close to the speed of raw struct access with only one extra indirection (a kind of vtable) to allow for format evolution and optional fields. It is aimed at projects where spending time and space (many memory allocations) to be able to access or construct serialized data is undesirable, such as in games or any other performance sensitive applications. See the benchmarks for details. ++- Flexible - Optional fields means not only do you get great forwards and backwards compatibility (increasingly important for long-lived games: don't have to update all data with each new version!). It also means you have a lot of choice in what data you write and what data you don't, and how you design data structures. ++- Tiny code footprint - Small amounts of generated code, and just a single small header as the minimum dependency, which is very easy to integrate. Again, see the benchmark section for details. ++- Strongly typed - Errors happen at compile time rather than manually having to write repetitive and error prone run-time checks. Useful code can be generated for you. ++ ++## Topics ++ ++### Read this first ++ ++- ++ ++### Where to start ++ ++- ``FlatBufferBuilder`` ++- ``ByteBuffer`` +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_1.fbs b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_1.fbs +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_1.fbs 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_1.fbs 2023-01-13 07:47:12.872288932 +0000 +@@ -0,0 +1 @@ ++ +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_2.fbs b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_2.fbs +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_2.fbs 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_2.fbs 2023-01-13 07:47:12.872288932 +0000 +@@ -0,0 +1 @@ ++enum Color:byte { red, green, blue } +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_3.fbs b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_3.fbs +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_3.fbs 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_3.fbs 2023-01-13 07:47:12.872288932 +0000 +@@ -0,0 +1,6 @@ ++enum Color:byte { red, green, blue } ++ ++struct Vec3 { ++ x:float; ++ y:float; ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_4.fbs b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_4.fbs +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_4.fbs 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_4.fbs 2023-01-13 07:47:12.872288932 +0000 +@@ -0,0 +1,12 @@ ++enum Color:byte { red, green, blue } ++ ++struct Vec3 { ++ x:float; ++ y:float; ++} ++ ++table Monster { ++ pos:Vec3; ++ color:Color = Blue; ++} ++ +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_5.fbs b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_5.fbs +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_5.fbs 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_5.fbs 2023-01-13 07:47:12.872288932 +0000 +@@ -0,0 +1,18 @@ ++enum Color:byte { red, green, blue } ++ ++struct Vec3 { ++ x:float; ++ y:float; ++} ++ ++table Monster { ++ pos:Vec3; ++ color:Color = Blue; ++ ++ mana:short = 150; ++ hp:short = 100; ++ name:string; ++ equipped:Equipment; ++ weapons:[Weapon]; ++ path:[Vec3]; ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_6.fbs b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_6.fbs +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_6.fbs 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_6.fbs 2023-01-13 07:47:12.872288932 +0000 +@@ -0,0 +1,25 @@ ++enum Color:byte { red, green, blue } ++ ++union Equipment { Weapon } // Optionally add more tables. ++ ++struct Vec3 { ++ x:float; ++ y:float; ++} ++ ++table Monster { ++ pos:Vec3; ++ color:Color = Blue; ++ ++ mana:short = 150; ++ hp:short = 100; ++ name:string; ++ equipped:Equipment; ++ weapons:[Weapon]; ++ path:[Vec3]; ++} ++ ++table Weapon { ++ name:string; ++ damage:short; ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_7.fbs b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_7.fbs +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_7.fbs 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/fbs/monster_step_7.fbs 2023-01-13 07:47:12.873288942 +0000 +@@ -0,0 +1,27 @@ ++enum Color:byte { red, green, blue } ++ ++union Equipment { Weapon } // Optionally add more tables. ++ ++struct Vec3 { ++ x:float; ++ y:float; ++} ++ ++table Monster { ++ pos:Vec3; ++ color:Color = Blue; ++ ++ mana:short = 150; ++ hp:short = 100; ++ name:string; ++ equipped:Equipment; ++ weapons:[Weapon]; ++ path:[Vec3]; ++} ++ ++table Weapon { ++ name:string; ++ damage:short; ++} ++ ++root_type Monster; // flatc --swift monster.fbs +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_1.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_1.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_1.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_1.swift 2023-01-13 07:47:12.873288942 +0000 +@@ -0,0 +1 @@ ++import Foundation +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_10.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_10.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_10.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_10.swift 2023-01-13 07:47:12.874288951 +0000 +@@ -0,0 +1,71 @@ ++import FlatBuffers ++import Foundation ++ ++func run() { ++ // create a `FlatBufferBuilder`, which will be used to serialize objects ++ let builder = FlatBufferBuilder(initialSize: 1024) ++ ++ let weapon1Name = builder.create(string: "Sword") ++ let weapon2Name = builder.create(string: "Axe") ++ ++ // start creating the weapon by calling startWeapon ++ let weapon1Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon1Name, &builder) ++ Weapon.add(damage: 3, &builder) ++ // end the object by passing the start point for the weapon 1 ++ let sword = Weapon.endWeapon(&builder, start: weapon1Start) ++ ++ let weapon2Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon2Name, &builder) ++ Weapon.add(damage: 5, &builder) ++ let axe = Weapon.endWeapon(&builder, start: weapon2Start) ++ ++ // Create a FlatBuffer `vector` that contains offsets to the sword and axe ++ // we created above. ++ let weaponsOffset = builder.createVector(ofOffsets: [sword, axe]) ++ ++ // Name of the Monster. ++ let name = builder.create(string: "Orc") ++ ++ let pathOffset = fbb.createVector(ofStructs: [ ++ Vec3(x: 0, y: 0), ++ Vec3(x: 5, y: 5), ++ ]) ++ ++ // startVector(len, elementSize: MemoryLayout.size) ++ // for o in offsets.reversed() { ++ // push(element: o) ++ // } ++ // endVector(len: len) ++ ++ let orc = Monster.createMonster( ++ &builder, ++ pos: Vec3(x: 1, y: 2), ++ hp: 300, ++ nameOffset: name, ++ color: .red, ++ weaponsVectorOffset: weaponsOffset, ++ equippedType: .weapon, ++ equippedOffset: axe, ++ pathOffset: pathOffset) ++ ++ // let start = Monster.startMonster(&builder) ++ // Monster.add(pos: Vec3(x: 1, y: 2), &builder) ++ // Monster.add(hp: 300, &builder) ++ // Monster.add(name: name, &builder) ++ // Monster.add(color: .red, &builder) ++ // Monster.addVectorOf(weapons: weaponsOffset, &builder) ++ // Monster.add(equippedType: .weapon, &builder) ++ // Monster.addVectorOf(paths: weaponsOffset, &builder) ++ // Monster.add(equipped: axe, &builder) ++ // var orc = Monster.endMonster(&builder, start: start) ++ ++ // Call `finish(offset:)` to instruct the builder that this monster is complete. ++ builder.finish(offset: orc) ++ // This must be called after `finish()`. ++ // `sizedByteArray` returns the finished buf of type [UInt8]. ++ let buf = builder.sizedByteArray ++ ++ // or you can use to get an object of type Data ++ let bufData = ByteBuffer(data: builder.sizedBuffer) ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_11.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_11.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_11.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_11.swift 2023-01-13 07:47:12.874288951 +0000 +@@ -0,0 +1,11 @@ ++import FlatBuffers ++import Foundation ++ ++func run() { ++ // create a ByteBuffer(:) from an [UInt8] or Data() ++ let buf = [] // Get your data ++ ++ // Get an accessor to the root object inside the buffer. ++ let monster: Monster = try! getCheckedRoot(byteBuffer: ByteBuffer(bytes: buf)) ++ // let monster: Monster = getRoot(byteBuffer: ByteBuffer(bytes: buf)) ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_12.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_12.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_12.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_12.swift 2023-01-13 07:47:12.875288960 +0000 +@@ -0,0 +1,19 @@ ++import FlatBuffers ++import Foundation ++ ++func run() { ++ // create a ByteBuffer(:) from an [UInt8] or Data() ++ let buf = [] // Get your data ++ ++ // Get an accessor to the root object inside the buffer. ++ let monster: Monster = try! getCheckedRoot(byteBuffer: ByteBuffer(bytes: buf)) ++ // let monster: Monster = getRoot(byteBuffer: ByteBuffer(bytes: buf)) ++ ++ let hp = monster.hp ++ let mana = monster.mana ++ let name = monster.name // returns an optional string ++ ++ let pos = monster.pos ++ let x = pos.x ++ let y = pos.y ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_13.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_13.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_13.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_13.swift 2023-01-13 07:47:12.875288960 +0000 +@@ -0,0 +1,26 @@ ++import FlatBuffers ++import Foundation ++ ++func run() { ++ // create a ByteBuffer(:) from an [UInt8] or Data() ++ let buf = [] // Get your data ++ ++ // Get an accessor to the root object inside the buffer. ++ let monster: Monster = try! getCheckedRoot(byteBuffer: ByteBuffer(bytes: buf)) ++ // let monster: Monster = getRoot(byteBuffer: ByteBuffer(bytes: buf)) ++ ++ let hp = monster.hp ++ let mana = monster.mana ++ let name = monster.name // returns an optional string ++ ++ let pos = monster.pos ++ let x = pos.x ++ let y = pos.y ++ ++ // Get and check if the monster has an equipped item ++ if monster.equippedType == .weapon { ++ let _weapon = monster.equipped(type: Weapon.self) ++ let name = _weapon.name // should return "Axe" ++ let dmg = _weapon.damage // should return 5 ++ } ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_2.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_2.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_2.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_2.swift 2023-01-13 07:47:12.876288969 +0000 +@@ -0,0 +1,2 @@ ++import FlatBuffers ++import Foundation +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_3.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_3.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_3.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_3.swift 2023-01-13 07:47:12.888289080 +0000 +@@ -0,0 +1,7 @@ ++import FlatBuffers ++import Foundation ++ ++func run() { ++ // create a `FlatBufferBuilder`, which will be used to serialize objects ++ let builder = FlatBufferBuilder(initialSize: 1024) ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_4.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_4.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_4.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_4.swift 2023-01-13 07:47:12.888289080 +0000 +@@ -0,0 +1,10 @@ ++import FlatBuffers ++import Foundation ++ ++func run() { ++ // create a `FlatBufferBuilder`, which will be used to serialize objects ++ let builder = FlatBufferBuilder(initialSize: 1024) ++ ++ let weapon1Name = builder.create(string: "Sword") ++ let weapon2Name = builder.create(string: "Axe") ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_5.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_5.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_5.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_5.swift 2023-01-13 07:47:12.888289080 +0000 +@@ -0,0 +1,22 @@ ++import FlatBuffers ++import Foundation ++ ++func run() { ++ // create a `FlatBufferBuilder`, which will be used to serialize objects ++ let builder = FlatBufferBuilder(initialSize: 1024) ++ ++ let weapon1Name = builder.create(string: "Sword") ++ let weapon2Name = builder.create(string: "Axe") ++ ++ // start creating the weapon by calling startWeapon ++ let weapon1Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon1Name, &builder) ++ Weapon.add(damage: 3, &builder) ++ // end the object by passing the start point for the weapon 1 ++ let sword = Weapon.endWeapon(&builder, start: weapon1Start) ++ ++ let weapon2Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon2Name, &builder) ++ Weapon.add(damage: 5, &builder) ++ let axe = Weapon.endWeapon(&builder, start: weapon2Start) ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_6.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_6.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_6.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_6.swift 2023-01-13 07:47:12.888289080 +0000 +@@ -0,0 +1,26 @@ ++import FlatBuffers ++import Foundation ++ ++func run() { ++ // create a `FlatBufferBuilder`, which will be used to serialize objects ++ let builder = FlatBufferBuilder(initialSize: 1024) ++ ++ let weapon1Name = builder.create(string: "Sword") ++ let weapon2Name = builder.create(string: "Axe") ++ ++ // start creating the weapon by calling startWeapon ++ let weapon1Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon1Name, &builder) ++ Weapon.add(damage: 3, &builder) ++ // end the object by passing the start point for the weapon 1 ++ let sword = Weapon.endWeapon(&builder, start: weapon1Start) ++ ++ let weapon2Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon2Name, &builder) ++ Weapon.add(damage: 5, &builder) ++ let axe = Weapon.endWeapon(&builder, start: weapon2Start) ++ ++ // Create a FlatBuffer `vector` that contains offsets to the sword and axe ++ // we created above. ++ let weaponsOffset = builder.createVector(ofOffsets: [sword, axe]) ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_7.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_7.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_7.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_7.swift 2023-01-13 07:47:12.888289080 +0000 +@@ -0,0 +1,29 @@ ++import FlatBuffers ++import Foundation ++ ++func run() { ++ // create a `FlatBufferBuilder`, which will be used to serialize objects ++ let builder = FlatBufferBuilder(initialSize: 1024) ++ ++ let weapon1Name = builder.create(string: "Sword") ++ let weapon2Name = builder.create(string: "Axe") ++ ++ // start creating the weapon by calling startWeapon ++ let weapon1Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon1Name, &builder) ++ Weapon.add(damage: 3, &builder) ++ // end the object by passing the start point for the weapon 1 ++ let sword = Weapon.endWeapon(&builder, start: weapon1Start) ++ ++ let weapon2Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon2Name, &builder) ++ Weapon.add(damage: 5, &builder) ++ let axe = Weapon.endWeapon(&builder, start: weapon2Start) ++ ++ // Create a FlatBuffer `vector` that contains offsets to the sword and axe ++ // we created above. ++ let weaponsOffset = builder.createVector(ofOffsets: [sword, axe]) ++ ++ // Name of the Monster. ++ let name = builder.create(string: "Orc") ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_8.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_8.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_8.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_8.swift 2023-01-13 07:47:12.888289080 +0000 +@@ -0,0 +1,40 @@ ++import FlatBuffers ++import Foundation ++ ++func run() { ++ // create a `FlatBufferBuilder`, which will be used to serialize objects ++ let builder = FlatBufferBuilder(initialSize: 1024) ++ ++ let weapon1Name = builder.create(string: "Sword") ++ let weapon2Name = builder.create(string: "Axe") ++ ++ // start creating the weapon by calling startWeapon ++ let weapon1Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon1Name, &builder) ++ Weapon.add(damage: 3, &builder) ++ // end the object by passing the start point for the weapon 1 ++ let sword = Weapon.endWeapon(&builder, start: weapon1Start) ++ ++ let weapon2Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon2Name, &builder) ++ Weapon.add(damage: 5, &builder) ++ let axe = Weapon.endWeapon(&builder, start: weapon2Start) ++ ++ // Create a FlatBuffer `vector` that contains offsets to the sword and axe ++ // we created above. ++ let weaponsOffset = builder.createVector(ofOffsets: [sword, axe]) ++ ++ // Name of the Monster. ++ let name = builder.create(string: "Orc") ++ ++ let pathOffset = fbb.createVector(ofStructs: [ ++ Vec3(x: 0, y: 0), ++ Vec3(x: 5, y: 5), ++ ]) ++ ++ // startVector(len, elementSize: MemoryLayout.size) ++ // for o in offsets.reversed() { ++ // push(element: o) ++ // } ++ // endVector(len: len) ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_9.swift b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_9.swift +--- a/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_9.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Resources/code/swift/swift_code_9.swift 2023-01-13 07:47:12.920289376 +0000 +@@ -0,0 +1,62 @@ ++import FlatBuffers ++import Foundation ++ ++func run() { ++ // create a `FlatBufferBuilder`, which will be used to serialize objects ++ let builder = FlatBufferBuilder(initialSize: 1024) ++ ++ let weapon1Name = builder.create(string: "Sword") ++ let weapon2Name = builder.create(string: "Axe") ++ ++ // start creating the weapon by calling startWeapon ++ let weapon1Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon1Name, &builder) ++ Weapon.add(damage: 3, &builder) ++ // end the object by passing the start point for the weapon 1 ++ let sword = Weapon.endWeapon(&builder, start: weapon1Start) ++ ++ let weapon2Start = Weapon.startWeapon(&builder) ++ Weapon.add(name: weapon2Name, &builder) ++ Weapon.add(damage: 5, &builder) ++ let axe = Weapon.endWeapon(&builder, start: weapon2Start) ++ ++ // Create a FlatBuffer `vector` that contains offsets to the sword and axe ++ // we created above. ++ let weaponsOffset = builder.createVector(ofOffsets: [sword, axe]) ++ ++ // Name of the Monster. ++ let name = builder.create(string: "Orc") ++ ++ let pathOffset = fbb.createVector(ofStructs: [ ++ Vec3(x: 0, y: 0), ++ Vec3(x: 5, y: 5), ++ ]) ++ ++ // startVector(len, elementSize: MemoryLayout.size) ++ // for o in offsets.reversed() { ++ // push(element: o) ++ // } ++ // endVector(len: len) ++ ++ let orc = Monster.createMonster( ++ &builder, ++ pos: Vec3(x: 1, y: 2), ++ hp: 300, ++ nameOffset: name, ++ color: .red, ++ weaponsVectorOffset: weaponsOffset, ++ equippedType: .weapon, ++ equippedOffset: axe, ++ pathOffset: pathOffset) ++ ++ // let start = Monster.startMonster(&builder) ++ // Monster.add(pos: Vec3(x: 1, y: 2), &builder) ++ // Monster.add(hp: 300, &builder) ++ // Monster.add(name: name, &builder) ++ // Monster.add(color: .red, &builder) ++ // Monster.addVectorOf(weapons: weaponsOffset, &builder) ++ // Monster.add(equippedType: .weapon, &builder) ++ // Monster.addVectorOf(paths: weaponsOffset, &builder) ++ // Monster.add(equipped: axe, &builder) ++ // var orc = Monster.endMonster(&builder, start: start) ++} +Binary files a/swift/Sources/FlatBuffers/Documentation.docc/Resources/images/tutorial_cover_image_1.png and b/swift/Sources/FlatBuffers/Documentation.docc/Resources/images/tutorial_cover_image_1.png differ +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/Tutorial_Table_of_Contents.tutorial b/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/Tutorial_Table_of_Contents.tutorial +--- a/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/Tutorial_Table_of_Contents.tutorial 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/Tutorial_Table_of_Contents.tutorial 2023-01-13 07:47:12.953289681 +0000 +@@ -0,0 +1,14 @@ ++@Tutorials(name: "Starting with FlatBuffers") { ++ @Intro(title: "Starting with FlatBuffers") { ++ FlatBuffers is an efficient cross platform serialization library for C++, ++ C#, C, Go, Java, Kotlin, JavaScript, Lobster, Lua, TypeScript, PHP, Python, Rust and Swift. ++ It was originally created at Google for game development and other performance-critical applications. ++ } ++ @Chapter(name: "Generating your code") { ++ Start by generating your first FlatBuffers objects. ++ @Image(source: tutorial_cover_image_1.png, alt: "A code structure for a base struct in flatbuffers") ++ @TutorialReference(tutorial: "doc:creating_flatbuffer_schema") ++ @TutorialReference(tutorial: "doc:create_your_first_buffer") ++ @TutorialReference(tutorial: "doc:reading_bytebuffer") ++ } ++} +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/create_your_first_buffer.tutorial b/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/create_your_first_buffer.tutorial +--- a/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/create_your_first_buffer.tutorial 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/create_your_first_buffer.tutorial 2023-01-13 07:47:12.953289681 +0000 +@@ -0,0 +1,72 @@ ++@Tutorial(time: 5) { ++ @Intro(title: "After having our code generated") { ++ After generating the code from the previous section, we will know start creating our monster object. ++ We will create a monster object called orc. ++ } ++ ++ @Section(title: "Building your first buffer") { ++ @ContentAndMedia {} ++ @Steps { ++ @Step { ++ Starting with a new file, we will create our very first Flatbuffer. ++ @Code(name: "ViewController.swift", file: "swift_code_1.swift") ++ } ++ @Step { ++ First, we need to import ``FlatBuffers`` ++ @Code(name: "ViewController.swift", file: "swift_code_2.swift") ++ } ++ @Step { ++ We need to create an instance of the `FlatBufferBuilder`, which will contain the buffer as it grows. ++ You can pass an initial size of the buffer (here 1024 bytes), which will grow automatically if needed. ++ @Code(name: "ViewController.swift", file: "swift_code_3.swift") ++ } ++ @Step { ++ After creating the builder, we can start serializing our data. Before we make our orc Monster, ++ let's create some Weapons: a Sword and an Axe. However we will start by naming our weapons as `Sword` and `Axe` ++ @Code(name: "ViewController.swift", file: "swift_code_4.swift") ++ } ++ @Step { ++ After naming the weapons, we will create two weapon objects with the damage that the weapon is going to deal. ++ That's done by calling the `start` Method on each table you will be creating, in this case its called `startWeapon` ++ and finished by calling `end`. ++ @Code(name: "ViewController.swift", file: "swift_code_5.swift") ++ } ++ @Step { ++ We will take our (Sword and Axe) serialized data and serialize their offsets as a vector of tables into our `ByteBuffer`. ++ So we can reference them later on from our Monster Object ++ @Code(name: "ViewController.swift", file: "swift_code_6.swift") ++ } ++ @Step { ++ We will add our Monster name as a string value just like we did with the weapons. ++ @Code(name: "ViewController.swift", file: "swift_code_7.swift") ++ } ++ ++ @Step { ++ We will create a path that our monster should be using while roaming in its den. To create a vector of paths we would us ++ `createVector(ofStructs: [])` which will take a Native `Swift` struct that has been padded to fit the `FlatBuffers` standards. ++ ++ There are usually two ways of creating vectors in `FlatBuffers` which you can see in commented out code. ++ And thus there are multiple convenience methods that will cover all the bases ++ when trying to create a vector so that you dont have to create it with `start` and `end` ++ @Code(name: "ViewController.swift", file: "swift_code_8.swift") ++ } ++ ++ @Step { ++ Now to serialize our data into our `Monster` object. Which again there are two ways of doing, by calling the `create` method or ++ by serializing the objects yourself. What we added to our Monster were the `Equipped Type` and the `Equipped` union itself, which ++ allows the Monster to have the `Axe` as his equipped weapon. ++ ++ Important: Unlike structs, you should not nest tables or other objects, ++ which is why we created all the `strings/vectors/tables` that this monster refers to before start. ++ If you try to create any of them between start and end, you will get an `assert`. ++ @Code(name: "ViewController.swift", file: "swift_code_9.swift") ++ } ++ ++ @Step { ++ Finally you can just finalize the buffer by calling `builder.finish` and get the Byte array from the buffer. ++ @Code(name: "ViewController.swift", file: "swift_code_10.swift") ++ } ++ ++ } ++ } ++ } +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/creating_flatbuffer_schema.tutorial b/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/creating_flatbuffer_schema.tutorial +--- a/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/creating_flatbuffer_schema.tutorial 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/creating_flatbuffer_schema.tutorial 2023-01-13 07:47:12.953289681 +0000 +@@ -0,0 +1,47 @@ ++@Tutorial(time: 2) { ++ @Intro(title: "Creating a schema") { ++ You will need to have the FlatBuffer compiler to be installed on your device ++ } ++ ++ @Section(title: "Creating a schema") { ++ @ContentAndMedia {} ++ @Steps { ++ @Step { ++ Start by creating a new empty folder called `monster.fbs`. We want to create a Monster table, that contains ++ position, color, and basic information about the monster. ++ @Code(name: "monster.fbs", file: "monster_step_1.fbs") ++ } ++ @Step { ++ We will start by adding our Color object. We will be using an enumerate, to represent this object ++ @Code(name: "monster.fbs", file: "monster_step_2.fbs") ++ } ++ @Step { ++ We will add a position object and will use a struct to represent that type of data. Where we will need the monsters ++ x and y positions. ++ @Code(name: "monster.fbs", file: "monster_step_3.fbs") ++ } ++ @Step { ++ Then we will be creating our Monster object of type table. This will contain the current position of our ++ monster and its color ++ @Code(name: "monster.fbs", file: "monster_step_4.fbs") ++ } ++ @Step { ++ Our Monster is missing a name, mana, hp, name, equipped Weapon, weapons, and path. We will be adding these ++ fields to our table with a proper data type for each. Example; weapons, and path would be a vector of data. ++ @Code(name: "monster.fbs", file: "monster_step_5.fbs") ++ } ++ @Step { ++ Now we are missing two data types here, `Weapon` and `Equipment`. And since Equipment can be a weapon, we will be using ++ a `Union` enumerate that can contain all the equipment that you would want your monster to have. And the weapon can simply ++ have a name and amount of damage ++ @Code(name: "monster.fbs", file: "monster_step_6.fbs") ++ } ++ @Step { ++ And to finalize our monster table, we can add a root type of type Monster. ++ Then run the command `flatc --swift monster.fbs` ++ Note: Make sure to import the file to your xcode project. ++ @Code(name: "monster.fbs", file: "monster_step_7.fbs") ++ } ++ } ++ } ++ } +diff -urN a/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/reading_bytebuffer.tutorial b/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/reading_bytebuffer.tutorial +--- a/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/reading_bytebuffer.tutorial 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Documentation.docc/Tutorials/reading_bytebuffer.tutorial 2023-01-13 07:47:12.984289967 +0000 +@@ -0,0 +1,27 @@ ++@Tutorial(time: 2) { ++ @Intro(title: "Reading ByteBuffers") { ++ After getting our ByteBuffer created, we can now read it. ++ } ++ ++ @Section(title: "Reading your first buffer") { ++ @ContentAndMedia {} ++ @Steps { ++ @Step { ++ After fetching the data from disk or network you need to access that data, and that can be done. ++ By simply calling `getCheckedRoot`, which checks if the data is valid before enabling you to read from a corrupt buffer. ++ however, if you are sure that the data is 100% correct you can simply call `getRoot` ++ @Code(name: "ViewController.swift", file: "swift_code_11.swift") ++ } ++ @Step { ++ Now since we have a Monster object, all the fields can be accessed by simply fetching the data. Note, Deprecated fields will not ++ show up ++ @Code(name: "ViewController.swift", file: "swift_code_12.swift") ++ } ++ @Step { ++ And you can access union types as easy as this ++ @Code(name: "ViewController.swift", file: "swift_code_13.swift") ++ } ++ } ++ } ++ } ++ +diff -urN a/swift/Sources/FlatBuffers/Enum.swift b/swift/Sources/FlatBuffers/Enum.swift +--- a/swift/Sources/FlatBuffers/Enum.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Enum.swift 2023-01-13 07:47:12.849288720 +0000 +@@ -0,0 +1,55 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++import Foundation ++ ++/// Enum is a protocol that all flatbuffers enums should conform to ++/// Since it allows us to get the actual `ByteSize` and `Value` from ++/// a swift enum. ++public protocol Enum { ++ /// associatedtype that the type of the enum should conform to ++ associatedtype T: Scalar & Verifiable ++ /// Size of the current associatedtype in the enum ++ static var byteSize: Int { get } ++ /// The current value the enum hosts ++ var value: T { get } ++} ++ ++extension Enum where Self: Verifiable { ++ ++ /// Verifies that the current value is which the bounds of the buffer, and if ++ /// the current `Value` is aligned properly ++ /// - Parameters: ++ /// - verifier: Verifier that hosts the buffer ++ /// - position: Current position within the buffer ++ /// - type: The type of the object to be verified ++ /// - Throws: Errors coming from `inBuffer` function ++ public static func verify( ++ _ verifier: inout Verifier, ++ at position: Int, ++ of type: T.Type) throws where T: Verifiable ++ { ++ try verifier.inBuffer(position: position, of: type.self) ++ } ++ ++} ++ ++/// UnionEnum is a Protocol that allows us to create Union type of enums ++/// and their value initializers. Since an `init` was required by ++/// the verifier ++public protocol UnionEnum: Enum { ++ init?(value: T) throws ++} +diff -urN a/swift/Sources/FlatBuffers/FlatBufferBuilder.swift b/swift/Sources/FlatBuffers/FlatBufferBuilder.swift +--- a/swift/Sources/FlatBuffers/FlatBufferBuilder.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/FlatBufferBuilder.swift 2023-01-13 07:47:12.849288720 +0000 +@@ -16,6 +16,16 @@ + + import Foundation + ++/// ``FlatBufferBuilder`` builds a `FlatBuffer` through manipulating its internal state. ++/// ++/// This is done by creating a ``ByteBuffer`` that hosts the incoming data and ++/// has a hardcoded growth limit of `2GiB` which is set by the Flatbuffers standards. ++/// ++/// ```swift ++/// var builder = FlatBufferBuilder() ++/// ``` ++/// The builder should be always created as a variable, since it would be passed into the writers ++/// + @frozen + public struct FlatBufferBuilder { + +@@ -44,55 +54,76 @@ + + /// Gives a read access to the buffer's size + public var size: UOffset { _bb.size } ++ + /// Data representation of the buffer ++ /// ++ /// Should only be used after ``finish(offset:addPrefix:)`` is called + public var data: Data { + assert(finished, "Data shouldn't be called before finish()") + return Data( + bytes: _bb.memory.advanced(by: _bb.writerIndex), + count: _bb.capacity &- _bb.writerIndex) + } +- /// Get's the fully sized buffer stored in memory ++ ++ /// Returns the underlying bytes in the ``ByteBuffer`` ++ /// ++ /// Note: This should be used with caution. + public var fullSizedByteArray: [UInt8] { + let ptr = UnsafeBufferPointer( + start: _bb.memory.assumingMemoryBound(to: UInt8.self), + count: _bb.capacity) + return Array(ptr) + } +- /// Returns the written size of the buffer ++ ++ /// Returns the written bytes into the ``ByteBuffer`` ++ /// ++ /// Should only be used after ``finish(offset:addPrefix:)`` is called + public var sizedByteArray: [UInt8] { + assert(finished, "Data shouldn't be called before finish()") +- let cp = _bb.capacity &- _bb.writerIndex +- let start = _bb.memory.advanced(by: _bb.writerIndex) +- .bindMemory(to: UInt8.self, capacity: cp) +- +- let ptr = UnsafeBufferPointer(start: start, count: cp) +- return Array(ptr) ++ return _bb.underlyingBytes + } +- /// Returns the buffer ++ ++ /// Returns the original ``ByteBuffer`` ++ /// ++ /// Returns the current buffer that was just created ++ /// with the offsets, and data written to it. + public var buffer: ByteBuffer { _bb } + +- /// Returns A sized Buffer from the readable bytes ++ /// Returns a newly created sized ``ByteBuffer`` ++ /// ++ /// returns a new buffer that is sized to the data written ++ /// to the main buffer + public var sizedBuffer: ByteBuffer { + assert(finished, "Data shouldn't be called before finish()") +- return ByteBuffer(memory: _bb.memory.advanced(by: _bb.reader), count: Int(_bb.size)) ++ return ByteBuffer( ++ memory: _bb.memory.advanced(by: _bb.reader), ++ count: Int(_bb.size)) + } + + // MARK: - Init + +- /// initialize the buffer with a size ++ /// Initialize the buffer with a size + /// - Parameters: + /// - initialSize: Initial size for the buffer + /// - force: Allows default to be serialized into the buffer +- public init(initialSize: Int32 = 1024, serializeDefaults force: Bool = false) { ++ /// ++ /// This initializes a new builder with an initialSize that would initialize ++ /// a new ``ByteBuffer``. ``FlatBufferBuilder`` by default doesnt serialize defaults ++ /// however the builder can be force by passing true for `serializeDefaults` ++ public init( ++ initialSize: Int32 = 1024, ++ serializeDefaults force: Bool = false) ++ { + assert(initialSize > 0, "Size should be greater than zero!") + guard isLitteEndian else { +- fatalError("Reading/Writing a buffer in big endian machine is not supported on swift") ++ fatalError( ++ "Reading/Writing a buffer in big endian machine is not supported on swift") + } + serializeDefaults = force + _bb = ByteBuffer(initialSize: Int(initialSize)) + } + +- /// Clears the buffer and the builder from it's data ++ /// Clears the builder and the buffer from the written data. + mutating public func clear() { + _minAlignment = 0 + isNested = false +@@ -108,11 +139,16 @@ + /// - Parameters: + /// - table: offset for the table + /// - fields: Array of all the important fields to be serialized ++ /// ++ /// *NOTE: Never call this function, this is only supposed to be called ++ /// by the generated code* + mutating public func require(table: Offset, fields: [Int32]) { + for field in fields { + let start = _bb.capacity &- Int(table.o) + let startTable = start &- Int(_bb.read(def: Int32.self, position: start)) +- let isOkay = _bb.read(def: VOffset.self, position: startTable &+ Int(field)) != 0 ++ let isOkay = _bb.read( ++ def: VOffset.self, ++ position: startTable &+ Int(field)) != 0 + assert(isOkay, "Flatbuffers requires the following field") + } + } +@@ -122,9 +158,32 @@ + /// - offset: Offset of the table + /// - fileId: Takes the fileId + /// - prefix: if false it wont add the size of the buffer +- mutating public func finish(offset: Offset, fileId: String, addPrefix prefix: Bool = false) { ++ /// ++ /// ``finish(offset:fileId:addPrefix:)`` should be called at the end of creating ++ /// a table ++ /// ```swift ++ /// var root = SomeObject ++ /// .createObject(&builder, ++ /// name: nameOffset) ++ /// builder.finish( ++ /// offset: root, ++ /// fileId: "ax1a", ++ /// addPrefix: true) ++ /// ``` ++ /// File id would append a file id name at the end of the written bytes before, ++ /// finishing the buffer. ++ /// ++ /// Whereas, if `addPrefix` is true, the written bytes would ++ /// include the size of the current buffer. ++ mutating public func finish( ++ offset: Offset, ++ fileId: String, ++ addPrefix prefix: Bool = false) ++ { + let size = MemoryLayout.size +- preAlign(len: size &+ (prefix ? size : 0) &+ FileIdLength, alignment: _minAlignment) ++ preAlign( ++ len: size &+ (prefix ? size : 0) &+ FileIdLength, ++ alignment: _minAlignment) + assert(fileId.count == FileIdLength, "Flatbuffers requires file id to be 4") + _bb.push(string: fileId, len: 4) + finish(offset: offset, addPrefix: prefix) +@@ -134,7 +193,23 @@ + /// - Parameters: + /// - offset: Offset of the table + /// - prefix: if false it wont add the size of the buffer +- mutating public func finish(offset: Offset, addPrefix prefix: Bool = false) { ++ /// ++ /// ``finish(offset:addPrefix:)`` should be called at the end of creating ++ /// a table ++ /// ```swift ++ /// var root = SomeObject ++ /// .createObject(&builder, ++ /// name: nameOffset) ++ /// builder.finish( ++ /// offset: root, ++ /// addPrefix: true) ++ /// ``` ++ /// If `addPrefix` is true, the written bytes would ++ /// include the size of the current buffer. ++ mutating public func finish( ++ offset: Offset, ++ addPrefix prefix: Bool = false) ++ { + notNested() + let size = MemoryLayout.size + preAlign(len: size &+ (prefix ? size : 0), alignment: _minAlignment) +@@ -144,10 +219,15 @@ + finished = true + } + +- /// starttable will let the builder know, that a new object is being serialized. ++ /// ``startTable(with:)`` will let the builder know, that a new object is being serialized. + /// +- /// The function will fatalerror if called while there is another object being serialized ++ /// The function will fatalerror if called while there is another object being serialized. ++ /// ```swift ++ /// let start = Monster ++ /// .startMonster(&fbb) ++ /// ``` + /// - Parameter numOfFields: Number of elements to be written to the buffer ++ /// - Returns: Offset of the newly started table + mutating public func startTable(with numOfFields: Int) -> UOffset { + notNested() + isNested = true +@@ -155,11 +235,14 @@ + return _bb.size + } + +- /// Endtable will let the builder know that the object that's written to it is completed ++ /// ``endTable(at:)`` will let the ``FlatBufferBuilder`` know that the ++ /// object that's written to it is completed ++ /// ++ /// This would be called after all the elements are serialized, ++ /// it will add the current vtable into the ``ByteBuffer``. ++ /// The functions will `fatalError` in case the object is called ++ /// without ``startTable(with:)``, or the object has exceeded the limit of 2GB. + /// +- /// This would be called after all the elements are serialized, it will add the vtable into the buffer. +- /// it will fatalError in case the object is called without starttable, or the object has exceeded the limit of +- /// 2GB, + /// - Parameter startOffset:Start point of the object written + /// - returns: The root of the table + mutating public func endTable(at startOffset: UOffset) -> UOffset { +@@ -184,7 +267,10 @@ + itr = itr &+ _vtableStorage.size + guard loaded.offset != 0 else { continue } + let _index = (_bb.writerIndex &+ Int(loaded.position)) +- _bb.write(value: VOffset(vTableOffset &- loaded.offset), index: _index, direct: true) ++ _bb.write( ++ value: VOffset(vTableOffset &- loaded.offset), ++ index: _index, ++ direct: true) + } + + _vtableStorage.clear() +@@ -220,7 +306,7 @@ + + // MARK: - Builds Buffer + +- /// asserts to see if the object is not nested ++ /// Asserts to see if the object is not nested + @usableFromInline + mutating internal func notNested() { + assert(!isNested, "Object serialization must not be nested") +@@ -240,7 +326,10 @@ + /// - bufSize: Current size of the buffer + the offset of the object to be written + /// - elementSize: Element size + @inline(__always) +- mutating internal func padding(bufSize: UInt32, elementSize: UInt32) -> UInt32 { ++ mutating internal func padding( ++ bufSize: UInt32, ++ elementSize: UInt32) -> UInt32 ++ { + ((~bufSize) &+ 1) & (elementSize - 1) + } + +@@ -285,7 +374,18 @@ + + // MARK: - Inserting Vectors + +- /// Starts a vector of length and Element size ++ /// ``startVector(_:elementSize:)`` creates a new vector within buffer ++ /// ++ /// The function checks if there is a current object being written, if ++ /// the check passes it creates a buffer alignment of `length * elementSize` ++ /// ```swift ++ /// builder.startVector( ++ /// int32Values.count, elementSize: 4) ++ /// ``` ++ /// ++ /// - Parameters: ++ /// - len: Length of vector to be created ++ /// - elementSize: Size of object type to be written + mutating public func startVector(_ len: Int, elementSize: Int) { + notNested() + isNested = true +@@ -293,46 +393,102 @@ + preAlign(len: len &* elementSize, alignment: elementSize) + } + +- /// Ends the vector of at length ++ /// ``endVector(len:)`` ends the currently created vector ++ /// ++ /// Calling ``endVector(len:)`` requires the length, of the current ++ /// vector. The length would be pushed to indicate the count of numbers ++ /// within the vector. If ``endVector(len:)`` is called without ++ /// ``startVector(_:elementSize:)`` it asserts. ++ /// ++ /// ```swift ++ /// let vectorOffset = builder. ++ /// endVector(len: int32Values.count) ++ /// ``` + /// +- /// The current function will fatalError if startVector is called before serializing the vector + /// - Parameter len: Length of the buffer ++ /// - Returns: Returns the current ``Offset`` in the ``ByteBuffer`` + mutating public func endVector(len: Int) -> Offset { + assert(isNested, "Calling endVector without calling startVector") + isNested = false + return Offset(offset: push(element: Int32(len))) + } + +- /// Creates a vector of type Scalar in the buffer ++ /// Creates a vector of type ``Scalar`` into the ``ByteBuffer`` ++ /// ++ /// ``createVector(_:)-4swl0`` writes a vector of type Scalars into ++ /// ``ByteBuffer``. This is a convenient method instead of calling, ++ /// ``startVector(_:elementSize:)`` and then ``endVector(len:)`` ++ /// ```swift ++ /// let vectorOffset = builder. ++ /// createVector([1, 2, 3, 4]) ++ /// ``` ++ /// ++ /// The underlying implementation simply calls ``createVector(_:size:)-4lhrv`` ++ /// + /// - Parameter elements: elements to be written into the buffer +- /// - returns: Offset of the vector ++ /// - returns: ``Offset`` of the vector + mutating public func createVector(_ elements: [T]) -> Offset { + createVector(elements, size: elements.count) + } + + /// Creates a vector of type Scalar in the buffer ++ /// ++ /// ``createVector(_:)-4swl0`` writes a vector of type Scalars into ++ /// ``ByteBuffer``. This is a convenient method instead of calling, ++ /// ``startVector(_:elementSize:)`` and then ``endVector(len:)`` ++ /// ```swift ++ /// let vectorOffset = builder. ++ /// createVector([1, 2, 3, 4], size: 4) ++ /// ``` ++ /// + /// - Parameter elements: Elements to be written into the buffer + /// - Parameter size: Count of elements +- /// - returns: Offset of the vector +- mutating public func createVector(_ elements: [T], size: Int) -> Offset { ++ /// - returns: ``Offset`` of the vector ++ mutating public func createVector( ++ _ elements: [T], ++ size: Int) -> Offset ++ { + let size = size + startVector(size, elementSize: MemoryLayout.size) + _bb.push(elements: elements) + return endVector(len: size) + } + +- /// Creates a vector of type Enums in the buffer ++ /// Creates a vector of type ``Enum`` into the ``ByteBuffer`` ++ /// ++ /// ``createVector(_:)-9h189`` writes a vector of type ``Enum`` into ++ /// ``ByteBuffer``. This is a convenient method instead of calling, ++ /// ``startVector(_:elementSize:)`` and then ``endVector(len:)`` ++ /// ```swift ++ /// let vectorOffset = builder. ++ /// createVector([.swift, .cpp]) ++ /// ``` ++ /// ++ /// The underlying implementation simply calls ``createVector(_:size:)-7cx6z`` ++ /// + /// - Parameter elements: elements to be written into the buffer +- /// - returns: Offset of the vector ++ /// - returns: ``Offset`` of the vector + mutating public func createVector(_ elements: [T]) -> Offset { + createVector(elements, size: elements.count) + } + +- /// Creates a vector of type Enums in the buffer ++ /// Creates a vector of type ``Enum`` into the ``ByteBuffer`` ++ /// ++ /// ``createVector(_:)-9h189`` writes a vector of type ``Enum`` into ++ /// ``ByteBuffer``. This is a convenient method instead of calling, ++ /// ``startVector(_:elementSize:)`` and then ``endVector(len:)`` ++ /// ```swift ++ /// let vectorOffset = builder. ++ /// createVector([.swift, .cpp]) ++ /// ``` ++ /// + /// - Parameter elements: Elements to be written into the buffer + /// - Parameter size: Count of elements +- /// - returns: Offset of the vector +- mutating public func createVector(_ elements: [T], size: Int) -> Offset { ++ /// - returns: ``Offset`` of the vector ++ mutating public func createVector( ++ _ elements: [T], ++ size: Int) -> Offset ++ { + let size = size + startVector(size, elementSize: T.byteSize) + for e in elements.reversed() { +@@ -341,18 +497,42 @@ + return endVector(len: size) + } + +- /// Creates a vector of type Offsets in the buffer +- /// - Parameter offsets:Array of offsets of type T +- /// - returns: Offset of the vector ++ /// Creates a vector of already written offsets ++ /// ++ /// ``createVector(ofOffsets:)`` creates a vector of ``Offset`` into ++ /// ``ByteBuffer``. This is a convenient method instead of calling, ++ /// ``startVector(_:elementSize:)`` and then ``endVector(len:)``. ++ /// ++ /// The underlying implementation simply calls ``createVector(ofOffsets:len:)`` ++ /// ++ /// ```swift ++ /// let namesOffsets = builder. ++ /// createVector(ofOffsets: [name1, name2]) ++ /// ``` ++ /// - Parameter offsets: Array of offsets of type ``Offset`` ++ /// - returns: ``Offset`` of the vector + mutating public func createVector(ofOffsets offsets: [Offset]) -> Offset { + createVector(ofOffsets: offsets, len: offsets.count) + } + +- /// Creates a vector of type Offsets in the buffer +- /// - Parameter elements: Array of offsets of type T ++ /// Creates a vector of already written offsets ++ /// ++ /// ``createVector(ofOffsets:)`` creates a vector of ``Offset`` into ++ /// ``ByteBuffer``. This is a convenient method instead of calling, ++ /// ``startVector(_:elementSize:)`` and then ``endVector(len:)`` ++ /// ++ /// ```swift ++ /// let namesOffsets = builder. ++ /// createVector(ofOffsets: [name1, name2]) ++ /// ``` ++ /// ++ /// - Parameter offsets: Array of offsets of type ``Offset`` + /// - Parameter size: Count of elements +- /// - returns: Offset of the vector +- mutating public func createVector(ofOffsets offsets: [Offset], len: Int) -> Offset { ++ /// - returns: ``Offset`` of the vector ++ mutating public func createVector( ++ ofOffsets offsets: [Offset], ++ len: Int) -> Offset ++ { + startVector(len, elementSize: MemoryLayout.size) + for o in offsets.reversed() { + push(element: o) +@@ -360,9 +540,21 @@ + return endVector(len: len) + } + +- /// Creates a vector of Strings +- /// - Parameter str: a vector of strings that will be written into the buffer +- /// - returns: Offset of the vector ++ /// Creates a vector of strings ++ /// ++ /// ``createVector(ofStrings:)`` creates a vector of `String` into ++ /// ``ByteBuffer``. This is a convenient method instead of manually ++ /// creating the string offsets, you simply pass it to this function ++ /// and it would write the strings into the ``ByteBuffer``. ++ /// After that it calls ``createVector(ofOffsets:)`` ++ /// ++ /// ```swift ++ /// let namesOffsets = builder. ++ /// createVector(ofStrings: ["Name", "surname"]) ++ /// ``` ++ /// ++ /// - Parameter str: Array of string ++ /// - returns: ``Offset`` of the vector + mutating public func createVector(ofStrings str: [String]) -> Offset { + var offsets: [Offset] = [] + for s in str { +@@ -371,11 +563,25 @@ + return createVector(ofOffsets: offsets) + } + +- /// Creates a vector of `Native swift structs` which were padded to flatbuffers standards +- /// - Parameter structs: A vector of structs +- /// - Returns: offset of the vector +- mutating public func createVector(ofStructs structs: [T]) -> Offset { +- startVector(structs.count * MemoryLayout.size, elementSize: MemoryLayout.alignment) ++ /// Creates a vector of type ``NativeStruct``. ++ /// ++ /// Any swift struct in the generated code, should confirm to ++ /// ``NativeStruct``. Since the generated swift structs are padded ++ /// to the `FlatBuffers` standards. ++ /// ++ /// ```swift ++ /// let offsets = builder. ++ /// createVector(ofStructs: [NativeStr(num: 1), NativeStr(num: 2)]) ++ /// ``` ++ /// ++ /// - Parameter structs: A vector of ``NativeStruct`` ++ /// - Returns: ``Offset`` of the vector ++ mutating public func createVector(ofStructs structs: [T]) ++ -> Offset ++ { ++ startVector( ++ structs.count * MemoryLayout.size, ++ elementSize: MemoryLayout.alignment) + for i in structs.reversed() { + _ = create(struct: i) + } +@@ -384,24 +590,46 @@ + + // MARK: - Inserting Structs + +- /// Fills the buffer with a native struct that's build and padded according to flatbuffers standards ++ /// Writes a ``NativeStruct`` into the ``ByteBuffer`` ++ /// ++ /// Adds a native struct that's build and padded according ++ /// to `FlatBuffers` standards. with a predefined position. ++ /// ++ /// ```swift ++ /// let offset = builder.create( ++ /// struct: NativeStr(num: 1), ++ /// position: 10) ++ /// ``` ++ /// + /// - Parameters: +- /// - s: `Native swift` struct to insert ++ /// - s: ``NativeStruct`` to be inserted into the ``ByteBuffer`` + /// - position: The predefined position of the object +- /// - Returns: offset of written struct ++ /// - Returns: ``Offset`` of written struct + @discardableResult + mutating public func create( + struct s: T, position: VOffset) -> Offset + { + let offset = create(struct: s) +- _vtableStorage.add(loc: FieldLoc(offset: _bb.size, position: VOffset(position))) ++ _vtableStorage.add(loc: FieldLoc( ++ offset: _bb.size, ++ position: VOffset(position))) + return offset + } + +- /// Fills the buffer with a native struct that's build and padded according to flatbuffers standards ++ /// Writes a ``NativeStruct`` into the ``ByteBuffer`` ++ /// ++ /// Adds a native struct that's build and padded according ++ /// to `FlatBuffers` standards, directly into the buffer without ++ /// a predefined position. ++ /// ++ /// ```swift ++ /// let offset = builder.create( ++ /// struct: NativeStr(num: 1)) ++ /// ``` ++ /// + /// - Parameters: +- /// - s: `Native swift` struct to insert +- /// - Returns: offset of written struct ++ /// - s: ``NativeStruct`` to be inserted into the ``ByteBuffer`` ++ /// - Returns: ``Offset`` of written struct + @discardableResult + mutating public func create( + struct s: T) -> Offset +@@ -414,9 +642,18 @@ + + // MARK: - Inserting Strings + +- /// Insets a string into the buffer using UTF8 ++ /// Insets a string into the buffer of type `UTF8` ++ /// ++ /// Adds a swift string into ``ByteBuffer`` by encoding it ++ /// using `UTF8` ++ /// ++ /// ```swift ++ /// let nameOffset = builder ++ /// .create(string: "welcome") ++ /// ``` ++ /// + /// - Parameter str: String to be serialized +- /// - returns: The strings offset in the buffer ++ /// - returns: ``Offset`` of inserted string + mutating public func create(string str: String?) -> Offset { + guard let str = str else { return Offset() } + let len = str.utf8.count +@@ -428,11 +665,25 @@ + return Offset(offset: _bb.size) + } + +- /// Inserts a shared string to the buffer ++ /// Insets a shared string into the buffer of type `UTF8` ++ /// ++ /// Adds a swift string into ``ByteBuffer`` by encoding it ++ /// using `UTF8`. The function will check if the string, ++ /// is already written to the ``ByteBuffer`` ++ /// ++ /// ```swift ++ /// let nameOffset = builder ++ /// .createShared(string: "welcome") ++ /// ++ /// ++ /// let secondOffset = builder ++ /// .createShared(string: "welcome") ++ /// ++ /// assert(nameOffset.o == secondOffset.o) ++ /// ``` + /// +- /// The function checks the stringOffsetmap if it's seen a similar string before + /// - Parameter str: String to be serialized +- /// - returns: The strings offset in the buffer ++ /// - returns: ``Offset`` of inserted string + mutating public func createShared(string str: String?) -> Offset { + guard let str = str else { return Offset() } + if let offset = stringOffsetMap[str] { +@@ -445,18 +696,22 @@ + + // MARK: - Inseting offsets + +- /// Adds the offset of an object into the buffer ++ /// Writes the ``Offset`` of an already written table ++ /// ++ /// Writes the ``Offset`` of a table if not empty into the ++ /// ``ByteBuffer`` ++ /// + /// - Parameters: +- /// - offset: Offset of another object to be written +- /// - position: The predefined position of the object ++ /// - offset: ``Offset`` of another object to be written ++ /// - position: The predefined position of the object + mutating public func add(offset: Offset, at position: VOffset) { + if offset.isEmpty { return } + add(element: refer(to: offset.o), def: 0, at: position) + } + +- /// Pushes a value of type offset into the buffer +- /// - Parameter o: Offset +- /// - returns: Position of the offset ++ /// Pushes a value of type ``Offset`` into the ``ByteBuffer`` ++ /// - Parameter o: ``Offset`` ++ /// - returns: Current position of the ``Offset`` + @discardableResult + mutating public func push(element o: Offset) -> UOffset { + push(element: refer(to: o.o)) +@@ -464,18 +719,42 @@ + + // MARK: - Inserting Scalars to Buffer + +- /// Adds a value into the buffer of type Scalar ++ /// Writes a ``Scalar`` value into ``ByteBuffer`` ++ /// ++ /// ``add(element:def:at:)`` takes in a default value, and current value ++ /// and the position within the `VTable`. The default value would not ++ /// be serialized if the value is the same as the current value or ++ /// `serializeDefaults` is equal to false. ++ /// ++ /// If serializing defaults is important ``init(initialSize:serializeDefaults:)``, ++ /// passing true for `serializeDefaults` would do the job. ++ /// ++ /// ```swift ++ /// // Adds 10 to the buffer ++ /// builder.add(element: Int(10), def: 1, position 12) ++ /// ``` ++ /// ++ /// *NOTE: Never call this manually* + /// + /// - Parameters: + /// - element: Element to insert + /// - def: Default value for that element + /// - position: The predefined position of the element +- mutating public func add(element: T, def: T, at position: VOffset) { ++ mutating public func add( ++ element: T, ++ def: T, ++ at position: VOffset) ++ { + if element == def && !serializeDefaults { return } + track(offset: push(element: element), at: position) + } + +- /// Adds a value into the buffer of type optional Scalar ++ /// Writes a optional ``Scalar`` value into ``ByteBuffer`` ++ /// ++ /// Takes an optional value to be written into the ``ByteBuffer`` ++ /// ++ /// *NOTE: Never call this manually* ++ /// + /// - Parameters: + /// - element: Optional element of type scalar + /// - position: The predefined position of the element +@@ -484,7 +763,10 @@ + track(offset: push(element: element), at: position) + } + +- /// Pushes the values into the buffer ++ /// Pushes a values of type ``Scalar`` into the ``ByteBuffer`` ++ /// ++ /// *NOTE: Never call this manually* ++ /// + /// - Parameter element: Element to insert + /// - returns: Postion of the Element + @discardableResult +@@ -529,13 +811,13 @@ + var numOfFields: Int = 0 + /// Last written Index + var writtenIndex: Int = 0 +- /// the amount of added elements into the buffer +- var addedElements: Int { capacity - (numOfFields &* size) } + + /// Creates the memory to store the buffer in + @usableFromInline + init() { +- memory = UnsafeMutableRawBufferPointer.allocate(byteCount: 0, alignment: 0) ++ memory = UnsafeMutableRawBufferPointer.allocate( ++ byteCount: 0, ++ alignment: 0) + } + + deinit { +@@ -555,7 +837,9 @@ + /// and max offset + /// - Parameter loc: Location of encoded element + func add(loc: FieldLoc) { +- memory.baseAddress?.advanced(by: writtenIndex).storeBytes(of: loc, as: FieldLoc.self) ++ memory.baseAddress?.advanced(by: writtenIndex).storeBytes( ++ of: loc, ++ as: FieldLoc.self) + writtenIndex = writtenIndex &+ size + numOfFields = numOfFields &+ 1 + maxOffset = max(loc.position, maxOffset) +@@ -574,7 +858,9 @@ + func ensure(space: Int) { + guard space &+ writtenIndex > capacity else { return } + memory.deallocate() +- memory = UnsafeMutableRawBufferPointer.allocate(byteCount: space, alignment: size) ++ memory = UnsafeMutableRawBufferPointer.allocate( ++ byteCount: space, ++ alignment: size) + capacity = space + } + +diff -urN a/swift/Sources/FlatBuffers/FlatBufferObject.swift b/swift/Sources/FlatBuffers/FlatBufferObject.swift +--- a/swift/Sources/FlatBuffers/FlatBufferObject.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/FlatBufferObject.swift 2023-01-13 07:47:12.849288720 +0000 +@@ -23,6 +23,8 @@ + /// FlatbuffersInitializable is a protocol that allows any object to be + /// Initialized from a ByteBuffer + public protocol FlatbuffersInitializable { ++ /// Any flatbuffers object that confirms to this protocol is going to be ++ /// initializable through this initializer + init(_ bb: ByteBuffer, o: Int32) + } + +@@ -31,15 +33,32 @@ + var __buffer: ByteBuffer! { get } + } + ++/// ``ObjectAPIPacker`` is a protocol that allows object to pack and unpack from a ++/// ``NativeObject`` to a flatbuffers Object and vice versa. + public protocol ObjectAPIPacker { ++ /// associatedtype to the object that should be unpacked. + associatedtype T ++ ++ /// ``pack(_:obj:)-3ptws`` tries to pacs the variables of a native Object into the `ByteBuffer` by using ++ /// a FlatBufferBuilder ++ /// - Parameters: ++ /// - builder: FlatBufferBuilder that will host incoming data ++ /// - obj: Object of associatedtype to the current implementer ++ /// ++ /// ``pack(_:obj:)-3ptws`` can be called by passing through an already initialized ``FlatBufferBuilder`` ++ /// or it can be called by using the public API that will create a new ``FlatBufferBuilder`` + static func pack(_ builder: inout FlatBufferBuilder, obj: inout T?) -> Offset ++ ++ /// ``pack(_:obj:)-20ipk`` packs the variables of a native Object into the `ByteBuffer` by using ++ /// the FlatBufferBuilder ++ /// - Parameters: ++ /// - builder: FlatBufferBuilder that will host incoming data ++ /// - obj: Object of associatedtype to the current implementer ++ /// ++ /// ``pack(_:obj:)-20ipk`` can be called by passing through an already initialized ``FlatBufferBuilder`` ++ /// or it can be called by using the public API that will create a new ``FlatBufferBuilder`` + static func pack(_ builder: inout FlatBufferBuilder, obj: inout T) -> Offset +- mutating func unpack() -> T +-} + +-public protocol Enum { +- associatedtype T: Scalar +- static var byteSize: Int { get } +- var value: T { get } ++ /// ``unpack()`` unpacks a ``FlatBuffers`` object into a Native swift object. ++ mutating func unpack() -> T + } +diff -urN a/swift/Sources/FlatBuffers/FlatBuffersUtils.swift b/swift/Sources/FlatBuffers/FlatBuffersUtils.swift +--- a/swift/Sources/FlatBuffers/FlatBuffersUtils.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/FlatBuffersUtils.swift 2023-01-13 07:47:12.849288720 +0000 +@@ -16,7 +16,8 @@ + + import Foundation + +-public final class FlatBuffersUtils { ++/// FlatBuffersUtils hosts some utility functions that might be useful ++public enum FlatBuffersUtils { + + /// Gets the size of the prefix + /// - Parameter bb: Flatbuffer object +@@ -24,8 +25,12 @@ + bb.read(def: Int32.self, position: bb.reader) + } + +- /// Removes the prefix by duplicating the Flatbuffer ++ /// Removes the prefix by duplicating the Flatbuffer this call is expensive since its ++ /// creates a new buffer use `readPrefixedSizeCheckedRoot` instead ++ /// unless a completely new buffer is required + /// - Parameter bb: Flatbuffer object ++ /// ++ /// + public static func removeSizePrefix(bb: ByteBuffer) -> ByteBuffer { + bb.duplicate(removing: MemoryLayout.size) + } +diff -urN a/swift/Sources/FlatBuffers/FlatbuffersErrors.swift b/swift/Sources/FlatBuffers/FlatbuffersErrors.swift +--- a/swift/Sources/FlatBuffers/FlatbuffersErrors.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/FlatbuffersErrors.swift 2023-01-13 07:47:12.849288720 +0000 +@@ -0,0 +1,62 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++import Foundation ++ ++/// Collection of thrown from the Flatbuffer verifier ++public enum FlatbuffersErrors: Error, Equatable { ++ ++ /// Thrown when buffer is bigger than the allowed 2GiB ++ case exceedsMaxSizeAllowed ++ /// Thrown when there is an missaligned pointer at position ++ /// of type ++ case missAlignedPointer(position: Int, type: String) ++ /// Thrown when trying to read a value that goes out of the ++ /// current buffer bounds ++ case outOfBounds(position: UInt, end: Int) ++ /// Thrown when the signed offset is out of the bounds of the ++ /// current buffer ++ case signedOffsetOutOfBounds(offset: Int, position: Int) ++ /// Thrown when a required field doesnt exist within the buffer ++ case requiredFieldDoesntExist(position: VOffset, name: String) ++ /// Thrown when a string is missing its NULL Terminator `\0`, ++ /// this can be disabled in the `VerifierOptions` ++ case missingNullTerminator(position: Int, str: String?) ++ /// Thrown when the verifier has reached the maximum tables allowed, ++ /// this can be disabled in the `VerifierOptions` ++ case maximumTables ++ /// Thrown when the verifier has reached the maximum depth allowed, ++ /// this can be disabled in the `VerifierOptions` ++ case maximumDepth ++ /// Thrown when the verifier is presented with an unknown union case ++ case unknownUnionCase ++ /// thrown when a value for a union is not found within the buffer ++ case valueNotFound(key: Int?, keyName: String, field: Int?, fieldName: String) ++ /// thrown when the size of the keys vector doesnt match fields vector ++ case unionVectorSize( ++ keyVectorSize: Int, ++ fieldVectorSize: Int, ++ unionKeyName: String, ++ fieldName: String) ++ case apparentSizeTooLarge ++ ++ public static func == ( ++ lhs: FlatbuffersErrors, ++ rhs: FlatbuffersErrors) -> Bool ++ { ++ lhs.localizedDescription == rhs.localizedDescription ++ } ++} +diff -urN a/swift/Sources/FlatBuffers/Message.swift b/swift/Sources/FlatBuffers/Message.swift +--- a/swift/Sources/FlatBuffers/Message.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Message.swift 2023-01-13 07:47:12.849288720 +0000 +@@ -14,6 +14,10 @@ + * limitations under the License. + */ + ++import Foundation ++ ++/// FlatBufferGRPCMessage protocol that should allow us to invoke ++/// initializers directly from the GRPC generated code + public protocol FlatBufferGRPCMessage { + + /// Raw pointer which would be pointing to the beginning of the readable bytes +@@ -34,10 +38,12 @@ + public var object: T { + T.init( + buffer, +- o: Int32(buffer.read(def: UOffset.self, position: buffer.reader)) + Int32(buffer.reader)) ++ o: Int32(buffer.read(def: UOffset.self, position: buffer.reader)) + ++ Int32(buffer.reader)) + } + +- public var rawPointer: UnsafeMutableRawPointer { buffer.memory.advanced(by: buffer.reader) } ++ public var rawPointer: UnsafeMutableRawPointer { ++ buffer.memory.advanced(by: buffer.reader) } + + public var size: Int { Int(buffer.size) } + +diff -urN a/swift/Sources/FlatBuffers/Mutable.swift b/swift/Sources/FlatBuffers/Mutable.swift +--- a/swift/Sources/FlatBuffers/Mutable.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Mutable.swift 2023-01-13 07:47:12.849288720 +0000 +@@ -16,17 +16,17 @@ + + import Foundation + +-/// Mutable is a protocol that allows us to mutate Scalar values within the buffer ++/// Mutable is a protocol that allows us to mutate Scalar values within a ``ByteBuffer`` + public protocol Mutable { + /// makes Flatbuffer accessed within the Protocol + var bb: ByteBuffer { get } +- /// makes position of the table/struct accessed within the Protocol ++ /// makes position of the ``Table``/``struct`` accessed within the Protocol + var postion: Int32 { get } + } + + extension Mutable { + +- /// Mutates the memory in the buffer, this is only called from the access function of table and structs ++ /// Mutates the memory in the buffer, this is only called from the access function of ``Table`` and ``struct`` + /// - Parameters: + /// - value: New value to be inserted to the buffer + /// - index: index of the Element +@@ -39,7 +39,7 @@ + + extension Mutable where Self == Table { + +- /// Mutates a value by calling mutate with respect to the position in the table ++ /// Mutates a value by calling mutate with respect to the position in a ``Table`` + /// - Parameters: + /// - value: New value to be inserted to the buffer + /// - index: index of the Element +diff -urN a/swift/Sources/FlatBuffers/NativeObject.swift b/swift/Sources/FlatBuffers/NativeObject.swift +--- a/swift/Sources/FlatBuffers/NativeObject.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/NativeObject.swift 2023-01-13 07:47:12.849288720 +0000 +@@ -16,6 +16,9 @@ + + import Foundation + ++/// NativeObject is a protocol that all of the `Object-API` generated code should be ++/// conforming to since it allows developers the ease of use to pack and unpack their ++/// Flatbuffers objects + public protocol NativeObject {} + + extension NativeObject { +@@ -23,7 +26,9 @@ + /// Serialize is a helper function that serailizes the data from the Object API to a bytebuffer directly th + /// - Parameter type: Type of the Flatbuffer object + /// - Returns: returns the encoded sized ByteBuffer +- public func serialize(type: T.Type) -> ByteBuffer where T.T == Self { ++ public func serialize(type: T.Type) -> ByteBuffer ++ where T.T == Self ++ { + var builder = FlatBufferBuilder(initialSize: 1024) + return serialize(builder: &builder, type: type.self) + } +@@ -36,7 +41,10 @@ + /// - Returns: returns the encoded sized ByteBuffer + /// - Note: The `serialize(builder:type)` can be considered as a function that allows you to create smaller builder instead of the default `1024`. + /// It can be considered less expensive in terms of memory allocation +- public func serialize(builder: inout FlatBufferBuilder, type: T.Type) -> ByteBuffer where T.T == Self { ++ public func serialize( ++ builder: inout FlatBufferBuilder, ++ type: T.Type) -> ByteBuffer where T.T == Self ++ { + var s = self + let root = type.pack(&builder, obj: &s) + builder.finish(offset: root) +diff -urN a/swift/Sources/FlatBuffers/Root.swift b/swift/Sources/FlatBuffers/Root.swift +--- a/swift/Sources/FlatBuffers/Root.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Root.swift 2023-01-13 07:47:12.850288729 +0000 +@@ -0,0 +1,82 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++import Foundation ++ ++/// Takes in a prefixed sized buffer, where the prefixed size would be skipped. ++/// And would verify that the buffer passed is a valid `Flatbuffers` Object. ++/// - Parameters: ++/// - byteBuffer: Buffer that needs to be checked and read ++/// - options: Verifier options ++/// - Throws: FlatbuffersErrors ++/// - Returns: Returns a valid, checked Flatbuffers object ++/// ++/// ``getPrefixedSizeCheckedRoot(byteBuffer:options:)`` would skip the first Bytes in ++/// the ``ByteBuffer`` and verifies the buffer by calling ``getCheckedRoot(byteBuffer:options:)`` ++public func getPrefixedSizeCheckedRoot( ++ byteBuffer: inout ByteBuffer, ++ options: VerifierOptions = .init()) throws -> T ++{ ++ byteBuffer.skipPrefix() ++ return try getCheckedRoot(byteBuffer: &byteBuffer, options: options) ++} ++ ++/// Takes in a prefixed sized buffer, where the prefixed size would be skipped. ++/// Returns a `NON-Checked` flatbuffers object ++/// - Parameter byteBuffer: Buffer that contains data ++/// - Returns: Returns a Flatbuffers object ++/// ++/// ``getPrefixedSizeCheckedRoot(byteBuffer:options:)`` would skip the first Bytes in ++/// the ``ByteBuffer`` and then calls ``getRoot(byteBuffer:)`` ++public func getPrefixedSizeRoot(byteBuffer: inout ByteBuffer) ++ -> T ++{ ++ byteBuffer.skipPrefix() ++ return getRoot(byteBuffer: &byteBuffer) ++ ++} ++ ++/// Verifies that the buffer passed is a valid `Flatbuffers` Object. ++/// - Parameters: ++/// - byteBuffer: Buffer that needs to be checked and read ++/// - options: Verifier options ++/// - Throws: FlatbuffersErrors ++/// - Returns: Returns a valid, checked Flatbuffers object ++/// ++/// ``getCheckedRoot(byteBuffer:options:)`` Takes in a ``ByteBuffer`` and verifies ++/// that by creating a ``Verifier`` and checkes if all the `Bytes` and correctly aligned ++/// and within the ``ByteBuffer`` range. ++public func getCheckedRoot( ++ byteBuffer: inout ByteBuffer, ++ options: VerifierOptions = .init()) throws -> T ++{ ++ var verifier = try Verifier(buffer: &byteBuffer, options: options) ++ try ForwardOffset.verify(&verifier, at: 0, of: T.self) ++ return T.init( ++ byteBuffer, ++ o: Int32(byteBuffer.read(def: UOffset.self, position: byteBuffer.reader)) + ++ Int32(byteBuffer.reader)) ++} ++ ++/// Returns a `NON-Checked` flatbuffers object ++/// - Parameter byteBuffer: Buffer that contains data ++/// - Returns: Returns a Flatbuffers object ++public func getRoot(byteBuffer: inout ByteBuffer) -> T { ++ T.init( ++ byteBuffer, ++ o: Int32(byteBuffer.read(def: UOffset.self, position: byteBuffer.reader)) + ++ Int32(byteBuffer.reader)) ++} +diff -urN a/swift/Sources/FlatBuffers/String+extension.swift b/swift/Sources/FlatBuffers/String+extension.swift +--- a/swift/Sources/FlatBuffers/String+extension.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/String+extension.swift 2023-01-13 07:47:12.850288729 +0000 +@@ -16,6 +16,44 @@ + + import Foundation + ++extension String: Verifiable { ++ ++ /// Verifies that the current value is which the bounds of the buffer, and if ++ /// the current `Value` is aligned properly ++ /// - Parameters: ++ /// - verifier: Verifier that hosts the buffer ++ /// - position: Current position within the buffer ++ /// - type: The type of the object to be verified ++ /// - Throws: Errors coming from `inBuffer`, `missingNullTerminator` and `outOfBounds` ++ public static func verify( ++ _ verifier: inout Verifier, ++ at position: Int, ++ of type: T.Type) throws where T: Verifiable ++ { ++ ++ let range = try String.verifyRange(&verifier, at: position, of: UInt8.self) ++ /// Safe &+ since we already check for overflow in verify range ++ let stringLen = range.start &+ range.count ++ ++ if stringLen >= verifier.capacity { ++ throw FlatbuffersErrors.outOfBounds( ++ position: UInt(clamping: stringLen.magnitude), ++ end: verifier.capacity) ++ } ++ ++ let isNullTerminated = verifier._buffer.read( ++ def: UInt8.self, ++ position: stringLen) == 0 ++ ++ if !verifier._options._ignoreMissingNullTerminators && !isNullTerminated { ++ let str = verifier._buffer.readString(at: range.start, count: range.count) ++ throw FlatbuffersErrors.missingNullTerminator( ++ position: position, ++ str: str) ++ } ++ } ++} ++ + extension String: FlatbuffersInitializable { + + /// Initailizes a string from a Flatbuffers ByteBuffer +@@ -23,21 +61,28 @@ + /// - bb: ByteBuffer containing the readable string + /// - o: Current position + public init(_ bb: ByteBuffer, o: Int32) { +- let count = bb.read(def: Int32.self, position: Int(o)) ++ let v = Int(o) ++ let count = bb.read(def: Int32.self, position: v) + self = bb.readString( +- at: Int32(MemoryLayout.size) + o, +- count: count) ?? "" ++ at: MemoryLayout.size + v, ++ count: Int(count)) ?? "" + } + } + + extension String: ObjectAPIPacker { + +- public static func pack(_ builder: inout FlatBufferBuilder, obj: inout String?) -> Offset { ++ public static func pack( ++ _ builder: inout FlatBufferBuilder, ++ obj: inout String?) -> Offset ++ { + guard var obj = obj else { return Offset() } + return pack(&builder, obj: &obj) + } + +- public static func pack(_ builder: inout FlatBufferBuilder, obj: inout String) -> Offset { ++ public static func pack( ++ _ builder: inout FlatBufferBuilder, ++ obj: inout String) -> Offset ++ { + builder.create(string: obj) + } + +@@ -49,11 +94,16 @@ + + extension String: NativeObject { + +- public func serialize(type: T.Type) -> ByteBuffer where T.T == Self { ++ public func serialize(type: T.Type) -> ByteBuffer ++ where T.T == Self ++ { + fatalError("serialize should never be called from string directly") + } + +- public func serialize(builder: inout FlatBufferBuilder, type: T.Type) -> ByteBuffer where T.T == Self { ++ public func serialize( ++ builder: inout FlatBufferBuilder, ++ type: T.Type) -> ByteBuffer where T.T == Self ++ { + fatalError("serialize should never be called from string directly") + } + } +diff -urN a/swift/Sources/FlatBuffers/Struct.swift b/swift/Sources/FlatBuffers/Struct.swift +--- a/swift/Sources/FlatBuffers/Struct.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Struct.swift 2023-01-13 07:47:12.850288729 +0000 +@@ -16,16 +16,30 @@ + + import Foundation + ++/// Struct is a representation of a mutable `Flatbuffers` struct ++/// since native structs are value types and cant be mutated + @frozen + public struct Struct { ++ ++ /// Hosting Bytebuffer + public private(set) var bb: ByteBuffer ++ /// Current position of the struct + public private(set) var postion: Int32 + ++ /// Initializer for a mutable flatbuffers struct ++ /// - Parameters: ++ /// - bb: Current hosting Bytebuffer ++ /// - position: Current position for the struct in the ByteBuffer + public init(bb: ByteBuffer, position: Int32 = 0) { + self.bb = bb + postion = position + } + ++ /// Reads data from the buffer directly at offset O ++ /// - Parameters: ++ /// - type: Type of data to be read ++ /// - o: Current offset of the data ++ /// - Returns: Data of Type T that conforms to type Scalar + public func readBuffer(of type: T.Type, at o: Int32) -> T { + let r = bb.read(def: T.self, position: Int(o + postion)) + return r +diff -urN a/swift/Sources/FlatBuffers/Table.swift b/swift/Sources/FlatBuffers/Table.swift +--- a/swift/Sources/FlatBuffers/Table.swift 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Table.swift 2023-01-13 07:47:12.850288729 +0000 +@@ -16,27 +16,50 @@ + + import Foundation + ++/// `Table` is a Flatbuffers object that can read, ++/// mutate scalar fields within a valid flatbuffers buffer + @frozen + public struct Table { ++ ++ /// Hosting Bytebuffer + public private(set) var bb: ByteBuffer ++ /// Current position of the table within the buffer + public private(set) var postion: Int32 + ++ /// Initializer for the table interface to allow generated code to read ++ /// data from memory ++ /// - Parameters: ++ /// - bb: ByteBuffer that stores data ++ /// - position: Current table position ++ /// - Note: This will `CRASH` if read on a big endian machine + public init(bb: ByteBuffer, position: Int32 = 0) { + guard isLitteEndian else { +- fatalError("Reading/Writing a buffer in big endian machine is not supported on swift") ++ fatalError( ++ "Reading/Writing a buffer in big endian machine is not supported on swift") + } + self.bb = bb + postion = position + } + ++ /// Gets the offset of the current field within the buffer by reading ++ /// the vtable ++ /// - Parameter o: current offset ++ /// - Returns: offset of field within buffer + public func offset(_ o: Int32) -> Int32 { + let vtable = postion - bb.read(def: Int32.self, position: Int(postion)) +- return o < bb.read(def: VOffset.self, position: Int(vtable)) ? Int32(bb.read( +- def: Int16.self, +- position: Int(vtable + o))) : 0 ++ return o < bb ++ .read(def: VOffset.self, position: Int(vtable)) ? Int32(bb.read( ++ def: Int16.self, ++ position: Int(vtable + o))) : 0 + } + +- public func indirect(_ o: Int32) -> Int32 { o + bb.read(def: Int32.self, position: Int(o)) } ++ /// Gets the indirect offset of the current stored object ++ /// (applicable only for object arrays) ++ /// - Parameter o: current offset ++ /// - Returns: offset of field within buffer ++ public func indirect(_ o: Int32) -> Int32 { ++ o + bb.read(def: Int32.self, position: Int(o)) ++ } + + /// String reads from the buffer with respect to position of the current table. + /// - Parameter offset: Offset of the string +@@ -45,14 +68,15 @@ + } + + /// Direct string reads from the buffer disregarding the position of the table. +- /// It would be preferable to use string unless the current position of the table is not needed ++ /// It would be preferable to use string unless the current position of the table ++ /// is not needed + /// - Parameter offset: Offset of the string + public func directString(at offset: Int32) -> String? { + var offset = offset + offset += bb.read(def: Int32.self, position: Int(offset)) + let count = bb.read(def: Int32.self, position: Int(offset)) +- let position = offset + Int32(MemoryLayout.size) +- return bb.readString(at: position, count: count) ++ let position = Int(offset) + MemoryLayout.size ++ return bb.readString(at: position, count: Int(count)) + } + + /// Reads from the buffer with respect to the position in the table. +@@ -81,19 +105,30 @@ + return r + } + ++ /// Returns that current `Union` object at a specific offset ++ /// by adding offset to the current position of table ++ /// - Parameter o: offset ++ /// - Returns: A flatbuffers object + public func union(_ o: Int32) -> T { + let o = o + postion + return directUnion(o) + } + ++ /// Returns a direct `Union` object at a specific offset ++ /// - Parameter o: offset ++ /// - Returns: A flatbuffers object + public func directUnion(_ o: Int32) -> T { + T.init(bb, o: o + bb.read(def: Int32.self, position: Int(o))) + } + ++ /// Returns a vector of type T at a specific offset ++ /// This should only be used by `Scalars` ++ /// - Parameter off: Readable offset ++ /// - Returns: Returns a vector of type [T] + public func getVector(at off: Int32) -> [T]? { + let o = offset(off) + guard o != 0 else { return nil } +- return bb.readSlice(index: vector(at: o), count: vector(count: o)) ++ return bb.readSlice(index: Int(vector(at: o)), count: Int(vector(count: o))) + } + + /// Vector count gets the count of Elements within the array +@@ -115,18 +150,45 @@ + return o + bb.read(def: Int32.self, position: Int(o)) + 4 + } + +- static public func indirect(_ o: Int32, _ fbb: ByteBuffer) -> Int32 { o + fbb.read( +- def: Int32.self, +- position: Int(o)) } ++ /// Reading an indirect offset of a table. ++ /// - Parameters: ++ /// - o: position within the buffer ++ /// - fbb: ByteBuffer ++ /// - Returns: table offset ++ static public func indirect(_ o: Int32, _ fbb: ByteBuffer) -> Int32 { ++ o + fbb.read(def: Int32.self, position: Int(o)) ++ } + +- static public func offset(_ o: Int32, vOffset: Int32, fbb: ByteBuffer) -> Int32 { ++ /// Gets a vtable value according to an table Offset and a field offset ++ /// - Parameters: ++ /// - o: offset relative to entire buffer ++ /// - vOffset: Field offset within a vtable ++ /// - fbb: ByteBuffer ++ /// - Returns: an position of a field ++ static public func offset( ++ _ o: Int32, ++ vOffset: Int32, ++ fbb: ByteBuffer) -> Int32 ++ { + let vTable = Int32(fbb.capacity) - o + return vTable + Int32(fbb.read( + def: Int16.self, +- position: Int(vTable + vOffset - fbb.read(def: Int32.self, position: Int(vTable))))) ++ position: Int(vTable + vOffset - fbb.read( ++ def: Int32.self, ++ position: Int(vTable))))) + } + +- static public func compare(_ off1: Int32, _ off2: Int32, fbb: ByteBuffer) -> Int32 { ++ /// Compares two objects at offset A and offset B within a ByteBuffer ++ /// - Parameters: ++ /// - off1: first offset to compare ++ /// - off2: second offset to compare ++ /// - fbb: Bytebuffer ++ /// - Returns: returns the difference between ++ static public func compare( ++ _ off1: Int32, ++ _ off2: Int32, ++ fbb: ByteBuffer) -> Int32 ++ { + let memorySize = Int32(MemoryLayout.size) + let _off1 = off1 + fbb.read(def: Int32.self, position: Int(off1)) + let _off2 = off2 + fbb.read(def: Int32.self, position: Int(off2)) +@@ -145,7 +207,17 @@ + return len1 - len2 + } + +- static public func compare(_ off1: Int32, _ key: [Byte], fbb: ByteBuffer) -> Int32 { ++ /// Compares two objects at offset A and array of `Bytes` within a ByteBuffer ++ /// - Parameters: ++ /// - off1: Offset to compare to ++ /// - key: bytes array to compare to ++ /// - fbb: Bytebuffer ++ /// - Returns: returns the difference between ++ static public func compare( ++ _ off1: Int32, ++ _ key: [Byte], ++ fbb: ByteBuffer) -> Int32 ++ { + let memorySize = Int32(MemoryLayout.size) + let _off1 = off1 + fbb.read(def: Int32.self, position: Int(off1)) + let len1 = fbb.read(def: Int32.self, position: Int(_off1)) +diff -urN a/swift/Sources/FlatBuffers/TableVerifier.swift b/swift/Sources/FlatBuffers/TableVerifier.swift +--- a/swift/Sources/FlatBuffers/TableVerifier.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/TableVerifier.swift 2023-01-13 07:47:12.850288729 +0000 +@@ -0,0 +1,203 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++import Foundation ++ ++/// `TableVerifier` verifies a table object is within a provided memory. ++/// It checks if all the objects for a specific generated table, are within ++/// the bounds of the buffer, aligned. ++public struct TableVerifier { ++ ++ /// position of current table in `ByteBuffer` ++ fileprivate var _position: Int ++ ++ /// Current VTable position ++ fileprivate var _vtable: Int ++ ++ /// Length of current VTable ++ fileprivate var _vtableLength: Int ++ ++ /// `Verifier` object created in the base verifable call. ++ fileprivate var _verifier: Verifier ++ ++ /// Creates a `TableVerifier` verifier that allows the Flatbuffer object ++ /// to verify the buffer before accessing any of the data. ++ /// ++ /// - Parameters: ++ /// - position: Current table Position ++ /// - vtable: Current `VTable` position ++ /// - vtableLength: Current `VTable` length ++ /// - verifier: `Verifier` Object that caches the data of the verifiable object ++ internal init( ++ position: Int, ++ vtable: Int, ++ vtableLength: Int, ++ verifier: inout Verifier) ++ { ++ _position = position ++ _vtable = vtable ++ _vtableLength = vtableLength ++ _verifier = verifier ++ } ++ ++ /// Dereference the current object position from the `VTable` ++ /// - Parameter field: Current VTable refrence to position. ++ /// - Throws: A `FlatbuffersErrors` incase the voffset is not aligned/outOfBounds/apparentSizeTooLarge ++ /// - Returns: An optional position for current field ++ internal mutating func dereference(_ field: VOffset) throws -> Int? { ++ if field >= _vtableLength { ++ return nil ++ } ++ ++ /// Reading the offset for the field needs to be read. ++ let offset: VOffset = try _verifier.getValue( ++ at: Int(clamping: _vtable &+ Int(field))) ++ ++ if offset > 0 { ++ return Int(clamping: _position &+ Int(offset)) ++ } ++ return nil ++ } ++ ++ /// Visits all the fields within the table to validate the integrity ++ /// of the data ++ /// - Parameters: ++ /// - field: voffset of the current field to be read ++ /// - fieldName: fieldname to report data Errors. ++ /// - required: If the field has to be available in the buffer ++ /// - type: Type of field to be read ++ /// - Throws: A `FlatbuffersErrors` where the field is corrupt ++ public mutating func visit( ++ field: VOffset, ++ fieldName: String, ++ required: Bool, ++ type: T.Type) throws where T: Verifiable ++ { ++ let derefValue = try dereference(field) ++ ++ if let value = derefValue { ++ try T.verify(&_verifier, at: value, of: T.self) ++ return ++ } ++ if required { ++ throw FlatbuffersErrors.requiredFieldDoesntExist( ++ position: field, ++ name: fieldName) ++ } ++ } ++ ++ /// Visits all the fields for a union object within the table to ++ /// validate the integrity of the data ++ /// - Parameters: ++ /// - key: Current Key Voffset ++ /// - field: Current field Voffset ++ /// - unionKeyName: Union key name ++ /// - fieldName: Field key name ++ /// - required: indicates if an object is required to be present ++ /// - completion: Completion is a handler that WILL be called in the generated ++ /// - Throws: A `FlatbuffersErrors` where the field is corrupt ++ public mutating func visit( ++ unionKey key: VOffset, ++ unionField field: VOffset, ++ unionKeyName: String, ++ fieldName: String, ++ required: Bool, ++ completion: @escaping (inout Verifier, T, Int) throws -> Void) throws ++ where T: UnionEnum ++ { ++ let keyPos = try dereference(key) ++ let valPos = try dereference(field) ++ ++ if keyPos == nil && valPos == nil { ++ if required { ++ throw FlatbuffersErrors.requiredFieldDoesntExist( ++ position: key, ++ name: unionKeyName) ++ } ++ return ++ } ++ ++ if let _key = keyPos, ++ let _val = valPos ++ { ++ /// verifiying that the key is within the buffer ++ try T.T.verify(&_verifier, at: _key, of: T.T.self) ++ guard let _enum = try T.init(value: _verifier._buffer.read( ++ def: T.T.self, ++ position: _key)) else ++ { ++ throw FlatbuffersErrors.unknownUnionCase ++ } ++ /// we are assuming that Unions will always be of type Uint8 ++ try completion( ++ &_verifier, ++ _enum, ++ _val) ++ return ++ } ++ throw FlatbuffersErrors.valueNotFound( ++ key: keyPos, ++ keyName: unionKeyName, ++ field: valPos, ++ fieldName: fieldName) ++ } ++ ++ /// Visits and validates all the objects within a union vector ++ /// - Parameters: ++ /// - key: Current Key Voffset ++ /// - field: Current field Voffset ++ /// - unionKeyName: Union key name ++ /// - fieldName: Field key name ++ /// - required: indicates if an object is required to be present ++ /// - completion: Completion is a handler that WILL be called in the generated ++ /// - Throws: A `FlatbuffersErrors` where the field is corrupt ++ public mutating func visitUnionVector( ++ unionKey key: VOffset, ++ unionField field: VOffset, ++ unionKeyName: String, ++ fieldName: String, ++ required: Bool, ++ completion: @escaping (inout Verifier, T, Int) throws -> Void) throws ++ where T: UnionEnum ++ { ++ let keyVectorPosition = try dereference(key) ++ let offsetVectorPosition = try dereference(field) ++ ++ if let keyPos = keyVectorPosition, ++ let valPos = offsetVectorPosition ++ { ++ try UnionVector.verify( ++ &_verifier, ++ keyPosition: keyPos, ++ fieldPosition: valPos, ++ unionKeyName: unionKeyName, ++ fieldName: fieldName, ++ completion: completion) ++ return ++ } ++ if required { ++ throw FlatbuffersErrors.requiredFieldDoesntExist( ++ position: field, ++ name: fieldName) ++ } ++ } ++ ++ /// Finishs the current Table verifier, and subtracts the current ++ /// table from the incremented depth. ++ public mutating func finish() { ++ _verifier.finish() ++ } ++} +diff -urN a/swift/Sources/FlatBuffers/VeriferOptions.swift b/swift/Sources/FlatBuffers/VeriferOptions.swift +--- a/swift/Sources/FlatBuffers/VeriferOptions.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/VeriferOptions.swift 2023-01-13 07:47:12.850288729 +0000 +@@ -0,0 +1,52 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++import Foundation ++ ++/// `VerifierOptions` is a set of options to verify a flatbuffer ++public struct VerifierOptions { ++ ++ /// Maximum `Apparent` size if the buffer can be expanded into a DAG tree ++ internal var _maxApparentSize: UOffset ++ ++ /// Maximum table count allowed in a buffer ++ internal var _maxTableCount: UOffset ++ ++ /// Maximum depth allowed in a buffer ++ internal var _maxDepth: UOffset ++ ++ /// Ignoring missing null terminals in strings ++ internal var _ignoreMissingNullTerminators: Bool ++ ++ /// initializes the set of options for the verifier ++ /// - Parameters: ++ /// - maxDepth: Maximum depth allowed in a buffer ++ /// - maxTableCount: Maximum table count allowed in a buffer ++ /// - maxApparentSize: Maximum `Apparent` size if the buffer can be expanded into a DAG tree ++ /// - ignoreMissingNullTerminators: Ignoring missing null terminals in strings *Currently not supported in swift* ++ public init( ++ maxDepth: UOffset = 64, ++ maxTableCount: UOffset = 1000000, ++ maxApparentSize: UOffset = 1 << 31, ++ ignoreMissingNullTerminators: Bool = false) ++ { ++ _maxDepth = maxDepth ++ _maxTableCount = maxTableCount ++ _maxApparentSize = maxApparentSize ++ _ignoreMissingNullTerminators = ignoreMissingNullTerminators ++ } ++ ++} +diff -urN a/swift/Sources/FlatBuffers/Verifiable.swift b/swift/Sources/FlatBuffers/Verifiable.swift +--- a/swift/Sources/FlatBuffers/Verifiable.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Verifiable.swift 2023-01-13 07:47:12.850288729 +0000 +@@ -0,0 +1,211 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++import Foundation ++ ++/// Verifiable is a protocol all swift flatbuffers object should conform to, ++/// since swift is similar to `cpp` and `rust` where the data is read directly ++/// from `unsafeMemory` thus the need to verify if the buffer received is a valid one ++public protocol Verifiable { ++ ++ /// Verifies that the current value is which the bounds of the buffer, and if ++ /// the current `Value` is aligned properly ++ /// - Parameters: ++ /// - verifier: Verifier that hosts the buffer ++ /// - position: Current position within the buffer ++ /// - type: The type of the object to be verified ++ /// - Throws: Errors coming from `inBuffer` function ++ static func verify( ++ _ verifier: inout Verifier, ++ at position: Int, ++ of type: T.Type) throws where T: Verifiable ++} ++ ++extension Verifiable { ++ ++ /// Verifies if the current range to be read is within the bounds of the buffer, ++ /// and if the range is properly aligned ++ /// - Parameters: ++ /// - verifier: Verifier that hosts the buffer ++ /// - position: Current position within the buffer ++ /// - type: The type of the object to be verified ++ /// - Throws: Erros thrown from `isAligned` & `rangeInBuffer` ++ /// - Returns: a tuple of the start position and the count of objects within the range ++ @discardableResult ++ public static func verifyRange( ++ _ verifier: inout Verifier, ++ at position: Int, of type: T.Type) throws -> (start: Int, count: Int) ++ { ++ let len: UOffset = try verifier.getValue(at: position) ++ let intLen = Int(len) ++ let start = Int(clamping: (position &+ MemoryLayout.size).magnitude) ++ try verifier.isAligned(position: start, type: type.self) ++ try verifier.rangeInBuffer(position: start, size: intLen) ++ return (start, intLen) ++ } ++} ++ ++extension Verifiable where Self: Scalar { ++ ++ /// Verifies that the current value is which the bounds of the buffer, and if ++ /// the current `Value` is aligned properly ++ /// - Parameters: ++ /// - verifier: Verifier that hosts the buffer ++ /// - position: Current position within the buffer ++ /// - type: The type of the object to be verified ++ /// - Throws: Errors coming from `inBuffer` function ++ public static func verify( ++ _ verifier: inout Verifier, ++ at position: Int, ++ of type: T.Type) throws where T: Verifiable ++ { ++ try verifier.inBuffer(position: position, of: type.self) ++ } ++} ++ ++// MARK: - ForwardOffset ++ ++/// ForwardOffset is a container to wrap around the Generic type to be verified ++/// from the flatbuffers object. ++public enum ForwardOffset: Verifiable where U: Verifiable { ++ ++ /// Verifies that the current value is which the bounds of the buffer, and if ++ /// the current `Value` is aligned properly ++ /// - Parameters: ++ /// - verifier: Verifier that hosts the buffer ++ /// - position: Current position within the buffer ++ /// - type: The type of the object to be verified ++ /// - Throws: Errors coming from `inBuffer` function ++ public static func verify( ++ _ verifier: inout Verifier, ++ at position: Int, ++ of type: T.Type) throws where T: Verifiable ++ { ++ let offset: UOffset = try verifier.getValue(at: position) ++ let nextOffset = Int(clamping: (Int(offset) &+ position).magnitude) ++ try U.verify(&verifier, at: nextOffset, of: U.self) ++ } ++} ++ ++// MARK: - Vector ++ ++/// Vector is a container to wrap around the Generic type to be verified ++/// from the flatbuffers object. ++public enum Vector: Verifiable where U: Verifiable, S: Verifiable { ++ ++ /// Verifies that the current value is which the bounds of the buffer, and if ++ /// the current `Value` is aligned properly ++ /// - Parameters: ++ /// - verifier: Verifier that hosts the buffer ++ /// - position: Current position within the buffer ++ /// - type: The type of the object to be verified ++ /// - Throws: Errors coming from `inBuffer` function ++ public static func verify( ++ _ verifier: inout Verifier, ++ at position: Int, ++ of type: T.Type) throws where T: Verifiable ++ { ++ /// checks if the next verification type S is equal to U of type forwardOffset ++ /// This had to be done since I couldnt find a solution for duplicate call functions ++ /// A fix will be appreciated ++ if U.self is ForwardOffset.Type { ++ let range = try verifyRange(&verifier, at: position, of: UOffset.self) ++ for index in stride( ++ from: range.start, ++ to: Int(clamping: range.start &+ range.count), ++ by: MemoryLayout.size) ++ { ++ try U.verify(&verifier, at: index, of: U.self) ++ } ++ } else { ++ try S.verifyRange(&verifier, at: position, of: S.self) ++ } ++ } ++} ++ ++// MARK: - UnionVector ++ ++/// UnionVector is a container to wrap around the Generic type to be verified ++/// from the flatbuffers object. ++public enum UnionVector where S: UnionEnum { ++ ++ /// Completion handler for the function Verify, that passes the verifier ++ /// enum type and position of union field ++ public typealias Completion = (inout Verifier, S, Int) throws -> Void ++ ++ /// Verifies if the current range to be read is within the bounds of the buffer, ++ /// and if the range is properly aligned. It also verifies if the union type is a ++ /// *valid/supported* union type. ++ /// - Parameters: ++ /// - verifier: Verifier that hosts the buffer ++ /// - keyPosition: Current union key position within the buffer ++ /// - fieldPosition: Current union field position within the buffer ++ /// - unionKeyName: Name of key to written if error is presented ++ /// - fieldName: Name of field to written if error is presented ++ /// - completion: Completion is a handler that WILL be called in the generated ++ /// code to verify the actual objects ++ /// - Throws: FlatbuffersErrors ++ public static func verify( ++ _ verifier: inout Verifier, ++ keyPosition: Int, ++ fieldPosition: Int, ++ unionKeyName: String, ++ fieldName: String, ++ completion: @escaping Completion) throws ++ { ++ /// Get offset for union key vectors and offset vectors ++ let keyOffset: UOffset = try verifier.getValue(at: keyPosition) ++ let fieldOffset: UOffset = try verifier.getValue(at: fieldPosition) ++ ++ /// Check if values are within the buffer, returns the start position of vectors, and vector counts ++ /// Using &+ is safe since we already verified that the value is within the buffer, where the max is ++ /// going to be 2Gib and swift supports Int64 by default ++ let keysRange = try S.T.verifyRange( ++ &verifier, ++ at: Int(keyOffset) &+ keyPosition, ++ of: S.T.self) ++ let offsetsRange = try UOffset.verifyRange( ++ &verifier, ++ at: Int(fieldOffset) &+ fieldPosition, ++ of: UOffset.self) ++ ++ guard keysRange.count == offsetsRange.count else { ++ throw FlatbuffersErrors.unionVectorSize( ++ keyVectorSize: keysRange.count, ++ fieldVectorSize: offsetsRange.count, ++ unionKeyName: unionKeyName, ++ fieldName: fieldName) ++ } ++ ++ var count = 0 ++ /// Iterate over the vector of keys and offsets. ++ while count < keysRange.count { ++ ++ /// index of readable enum value in array ++ let keysIndex = MemoryLayout.size * count ++ guard let _enum = try S.init(value: verifier._buffer.read( ++ def: S.T.self, ++ position: keysRange.start + keysIndex)) else ++ { ++ throw FlatbuffersErrors.unknownUnionCase ++ } ++ /// index of readable offset value in array ++ let fieldIndex = MemoryLayout.size * count ++ try completion(&verifier, _enum, offsetsRange.start + fieldIndex) ++ count += 1 ++ } ++ } ++} +diff -urN a/swift/Sources/FlatBuffers/Verifier.swift b/swift/Sources/FlatBuffers/Verifier.swift +--- a/swift/Sources/FlatBuffers/Verifier.swift 1970-01-01 00:00:00.000000000 +0000 ++++ b/swift/Sources/FlatBuffers/Verifier.swift 2023-01-13 07:47:12.850288729 +0000 +@@ -0,0 +1,203 @@ ++/* ++ * Copyright 2021 Google Inc. All rights reserved. ++ * ++ * 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. ++ */ ++ ++import Foundation ++ ++/// Verifier that check if the buffer passed into it is a valid, ++/// safe, aligned Flatbuffers object since swift read from `unsafeMemory` ++public struct Verifier { ++ ++ /// Flag to check for alignment if true ++ fileprivate let _checkAlignment: Bool ++ /// Capacity of the current buffer ++ fileprivate var _capacity: Int ++ /// Current ApparentSize ++ fileprivate var _apparentSize: UOffset = 0 ++ /// Amount of tables present within a buffer ++ fileprivate var _tableCount = 0 ++ ++ /// Capacity of the buffer ++ internal var capacity: Int { _capacity } ++ /// Current reached depth within the buffer ++ internal var _depth = 0 ++ /// Current verifiable ByteBuffer ++ internal var _buffer: ByteBuffer ++ /// Options for verification ++ internal let _options: VerifierOptions ++ ++ /// Initializer for the verifier ++ /// - Parameters: ++ /// - buffer: Bytebuffer that is required to be verified ++ /// - options: `VerifierOptions` that set the rule for some of the verification done ++ /// - checkAlignment: If alignment check is required to be preformed ++ /// - Throws: `exceedsMaxSizeAllowed` if capacity of the buffer is more than 2GiB ++ public init( ++ buffer: inout ByteBuffer, ++ options: VerifierOptions = .init(), ++ checkAlignment: Bool = true) throws ++ { ++ guard buffer.capacity < FlatBufferMaxSize else { ++ throw FlatbuffersErrors.exceedsMaxSizeAllowed ++ } ++ ++ _buffer = buffer ++ _capacity = buffer.capacity ++ _checkAlignment = checkAlignment ++ _options = options ++ } ++ ++ /// Resets the verifier to initial state ++ public mutating func reset() { ++ _depth = 0 ++ _tableCount = 0 ++ } ++ ++ /// Checks if the value of type `T` is aligned properly in the buffer ++ /// - Parameters: ++ /// - position: Current position ++ /// - type: Type of value to check ++ /// - Throws: `missAlignedPointer` if the pointer is not aligned properly ++ public mutating func isAligned(position: Int, type: T.Type) throws { ++ ++ /// If check alignment is false this mutating function doesnt continue ++ if !_checkAlignment { return } ++ ++ /// advance pointer to position X ++ let ptr = _buffer._storage.memory.advanced(by: position) ++ /// Check if the pointer is aligned ++ if Int(bitPattern: ptr) & (MemoryLayout.alignment &- 1) == 0 { ++ return ++ } ++ ++ throw FlatbuffersErrors.missAlignedPointer( ++ position: position, ++ type: String(describing: T.self)) ++ } ++ ++ /// Checks if the value of Size "X" is within the range of the buffer ++ /// - Parameters: ++ /// - position: Current postion to be read ++ /// - size: `Byte` Size of readable object within the buffer ++ /// - Throws: `outOfBounds` if the value is out of the bounds of the buffer ++ /// and `apparentSizeTooLarge` if the apparent size is bigger than the one specified ++ /// in `VerifierOptions` ++ public mutating func rangeInBuffer(position: Int, size: Int) throws { ++ let end = UInt(clamping: (position &+ size).magnitude) ++ if end > _buffer.capacity { ++ throw FlatbuffersErrors.outOfBounds(position: end, end: capacity) ++ } ++ _apparentSize = _apparentSize &+ UInt32(size) ++ if _apparentSize > _options._maxApparentSize { ++ throw FlatbuffersErrors.apparentSizeTooLarge ++ } ++ } ++ ++ /// Validates if a value of type `T` is aligned and within the bounds of ++ /// the buffer ++ /// - Parameters: ++ /// - position: Current readable position ++ /// - type: Type of value to check ++ /// - Throws: FlatbuffersErrors ++ public mutating func inBuffer(position: Int, of type: T.Type) throws { ++ try isAligned(position: position, type: type) ++ try rangeInBuffer(position: position, size: MemoryLayout.size) ++ } ++ ++ /// Visits a table at the current position and validates if the table meets ++ /// the rules specified in the `VerifierOptions` ++ /// - Parameter position: Current position to be read ++ /// - Throws: FlatbuffersErrors ++ /// - Returns: A `TableVerifier` at the current readable table ++ public mutating func visitTable(at position: Int) throws -> TableVerifier { ++ let vtablePosition = try derefOffset(position: position) ++ let vtableLength: VOffset = try getValue(at: vtablePosition) ++ ++ let length = Int(vtableLength) ++ try isAligned( ++ position: Int(clamping: (vtablePosition + length).magnitude), ++ type: VOffset.self) ++ try rangeInBuffer(position: vtablePosition, size: length) ++ ++ _tableCount += 1 ++ ++ if _tableCount > _options._maxTableCount { ++ throw FlatbuffersErrors.maximumTables ++ } ++ ++ _depth += 1 ++ ++ if _depth > _options._maxDepth { ++ throw FlatbuffersErrors.maximumDepth ++ } ++ ++ return TableVerifier( ++ position: position, ++ vtable: vtablePosition, ++ vtableLength: length, ++ verifier: &self) ++ } ++ ++ /// Validates if a value of type `T` is within the buffer and returns it ++ /// - Parameter position: Current position to be read ++ /// - Throws: `inBuffer` errors ++ /// - Returns: a value of type `T` usually a `VTable` or a table offset ++ internal mutating func getValue(at position: Int) throws -> T { ++ try inBuffer(position: position, of: T.self) ++ return _buffer.read(def: T.self, position: position) ++ } ++ ++ /// derefrences an offset within a vtable to get the position of the field ++ /// in the bytebuffer ++ /// - Parameter position: Current readable position ++ /// - Throws: `inBuffer` errors & `signedOffsetOutOfBounds` ++ /// - Returns: Current readable position for a field ++ @inline(__always) ++ internal mutating func derefOffset(position: Int) throws -> Int { ++ try inBuffer(position: position, of: Int32.self) ++ ++ let offset = _buffer.read(def: Int32.self, position: position) ++ // switching to int32 since swift's default Int is int64 ++ // this should be safe since we already checked if its within ++ // the buffer ++ let _int32Position = UInt32(position) ++ ++ let reportedOverflow: (partialValue: UInt32, overflow: Bool) ++ if offset > 0 { ++ reportedOverflow = _int32Position ++ .subtractingReportingOverflow(offset.magnitude) ++ } else { ++ reportedOverflow = _int32Position ++ .addingReportingOverflow(offset.magnitude) ++ } ++ ++ /// since `subtractingReportingOverflow` & `addingReportingOverflow` returns true, ++ /// if there is overflow we return failure ++ if reportedOverflow.overflow || reportedOverflow.partialValue > _buffer ++ .capacity ++ { ++ throw FlatbuffersErrors.signedOffsetOutOfBounds( ++ offset: Int(offset), ++ position: position) ++ } ++ ++ return Int(reportedOverflow.partialValue) ++ } ++ ++ /// finishes the current iteration of verification on an object ++ internal mutating func finish() { ++ _depth -= 1 ++ } ++} +diff -urN a/swift.swiftformat b/swift.swiftformat +--- a/swift.swiftformat 2021-05-10 18:45:16.000000000 +0000 ++++ b/swift.swiftformat 2023-01-13 07:47:09.939261845 +0000 +@@ -2,6 +2,7 @@ + + # format + --indent 2 ++--maxwidth 80 + + # options + --self remove # redundantSelf +@@ -16,10 +17,11 @@ + --typeattributes prev-line # wrapAttributes + + # rules +---rules todos,anyObjectProtocol,redundantParens,redundantReturn,redundantSelf,sortedImports,strongifiedSelf,trailingCommas,trailingSpace,wrapArguments,wrapMultilineStatementBraces,indent,wrapAttributes,void,fileHeader ++--rules wrap,todos,anyObjectProtocol,redundantParens,redundantReturn,redundantSelf,sortedImports,strongifiedSelf,trailingCommas,trailingSpace,wrapArguments,wrapMultilineStatementBraces,indent,wrapAttributes,void,fileHeader + --disable trailingclosures + + --exclude **/*_generated.swift ++--exclude **/swift_code_*.swift + --exclude **/*.grpc.swift + + --header "/*\n * Copyright {year} Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */" +\ No newline at end of file diff --git a/meta-openeuler/recipes-devtools/flatbuffers/flatbuffers_1.12.0.bbappend b/meta-openeuler/recipes-devtools/flatbuffers/flatbuffers_1.12.0.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..7355cd610ca0d77b831acc3b022f861ebd3ce8e4 --- /dev/null +++ b/meta-openeuler/recipes-devtools/flatbuffers/flatbuffers_1.12.0.bbappend @@ -0,0 +1,23 @@ +PV = "2.0.0" + +OPENEULER_BRANCH = "master" + +# find patches under openeuler at firse +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +SRCREV = "3d79a88adb0eceb2ab5ff994c9b4c03b4b3c0daf" + +EXTRA_OECMAKE:append:class-target = " -DFLATBUFFERS_BUILD_FLATC=0" + +SRC_URI = " \ + file://v${PV}.tar.gz \ + file://0001-flatbuffers_cross_build_fix.patch \ +" + +SRC_URI_remove_class-native = " \ + file://0001-flatbuffers_cross_build_fix.patch \ +" + +S = "${WORKDIR}/${BP}" + + diff --git a/meta-openeuler/recipes-devtools/flex/flex_%.bbappend b/meta-openeuler/recipes-devtools/flex/flex_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..4e4a6b9a10cce1e8b3f71134b56ffcc5828b0b96 --- /dev/null +++ b/meta-openeuler/recipes-devtools/flex/flex_%.bbappend @@ -0,0 +1,16 @@ +# main bb file: yocto-poky/meta/recipes-devtools/flex/flex_2.6.4.bb + +# apply patches in openEuler +SRC_URI_prepend = "file://build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch \ + file://filter-memory-leak-free-scanner-postprocessing.patch \ + file://scanner-c-i-j-should-preserve-case.patch \ + file://filter-Output-correct-line-value-for-current-file.patch \ + file://scanner-memory-leak-free-scanner-generator.patch \ + file://scanner-Ignore-comment-lines-in-skeleton-files.patch \ + file://scanner-temporarily-protect-against-ccl-overflow-ove.patch \ + file://scanner-prevent-overflow-in-add_action.patch \ +" + +# remove this patch as it already exists in openEuler +SRC_URI_remove = "file://0001-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch \ +" diff --git a/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain-compilerlibs.bb b/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain-compilerlibs.bb deleted file mode 100644 index e6524e36c11dea4553a54d45e0dfe0e33fe16afd..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain-compilerlibs.bb +++ /dev/null @@ -1,105 +0,0 @@ -# Description: Extract libgcc and compiler-rt from toolchain - -require gcc-bin-toolchain.inc - -PN = "gcc-bin-toolchain-compilerlibs-${TARGET_ARCH}" -INHIBIT_DEFAULT_DEPS = "1" -DEPENDS = "virtual/${TARGET_PREFIX}gcc \ - virtual/${TARGET_PREFIX}g++" -PROVIDES = "gcc-runtime libstdc++ libgcc-initial virtual/${TARGET_PREFIX}compilerlibs" - -do_install () { - bbnote "Installing libgcc/libclang from Compiler CPU binary toolchain" - install -m 0755 -d ${D}${libdir_native}/${EULER_TOOLCHAIN_GCC_PATH_INNER} - - finddirs='' - test -d ${B}/${TOOLCHAIN_PREFIX}/lib && finddirs="$finddirs ${B}/${TOOLCHAIN_PREFIX}/lib" - test -d ${B}/${TOOLCHAIN_PREFIX}/lib64 && finddirs="$finddirs ${B}/${TOOLCHAIN_PREFIX}/lib64" - test -d ${B}/lib/${EULER_TOOLCHAIN_GCC_PATH} && finddirs="$finddirs ${B}/lib/${EULER_TOOLCHAIN_GCC_PATH}" - test -d ${B}/lib64/${EULER_TOOLCHAIN_GCC_PATH} && finddirs="$finddirs ${B}/lib64/${EULER_TOOLCHAIN_GCC_PATH}" - - find $finddirs \ - -name '*.o' \ - -o -name 'libgcc*.a' \ - -o -name 'libc++*.a' \ - -o -name 'libstdc++*.a' \ - -o -name 'libclang_rt*.a' \ - -o -name 'libunwind*.a*' \ - -o -name 'libgcc*.so*' \ - -o -name 'libc++*.so*' \ - -o -name 'libstdc++*.so*' \ - -o -name 'libclang_rt*.so*' \ - -o -name 'libunwind*.so*' | - xargs sh -c 'cp -P --preserve=mode,timestamps,links -v $@ ${D}${libdir_native}/${EULER_TOOLCHAIN_GCC_PATH_INNER}' sh - - # Remove executable permission for crt*.o to avoid being stripped - for f in ${D}${libdir_native}/${EULER_TOOLCHAIN_GCC_PATH_INNER}/*.o - do - chmod 644 $f - done - for f in ${D}${libdir_native}/${EULER_TOOLCHAIN_GCC_PATH_INNER}/*.so* - do - chmod 644 $f - done - - mkdir -p ${D}${base_libdir} - mkdir -p ${D}${libdir} - for f in ${D}${libdir_native}/${EULER_TOOLCHAIN_GCC_PATH_INNER}/*.so* - do - destdir=${libdir} - if echo $f | grep 'libgcc\|libclang_rt\|libunwind_s' - then - destdir=${base_libdir} - fi - - bn=$(basename $f) - mv $f ${D}$destdir - rel=$(realpath --relative-to=$(dirname $f) ${D}$destdir) - ln -s $rel/$bn $(dirname $f) - done - rm -r ${D}${libdir_native}/${TOOLCHAIN_PREFIX} -} - -# Package will be called as libgcc-s1. Don't know why. -# This makes ldconfig triggered. We need to remove -# ldconfig from our DISTRO_FEATURES. -FILES_${PN} = " \ - ${base_libdir}/*.so \ - ${base_libdir}/*.so.*[0-9] \ - ${libdir}/*.so \ - ${libdir}/*.so.*[0-9] \ -" - -FILES_${PN}-dev = " \ - ${libdir_native}/${EULER_TOOLCHAIN_GCC_PATH_INNER}/*.so.* \ - ${libdir_native}/${EULER_TOOLCHAIN_GCC_PATH_INNER}/*.so \ - ${libdir_native}/${EULER_TOOLCHAIN_GCC_PATH_INNER}/*.py \ - ${base_libdir}/*.py \ - ${libdir}/*.py \ -" -FILES_${PN}-staticdev = " \ - ${libdir_native}/${EULER_TOOLCHAIN_GCC_PATH_INNER}/*.o \ - ${libdir_native}/${EULER_TOOLCHAIN_GCC_PATH_INNER}/*.a \ -" - -INSANE_SKIP = "file-rdeps ldflags arch" -# POPULATESYSROOTDEPS contains cross toolchain, which -# is different from real toolchain this compilerlib belongs to, -# in case when we are aarch64 and needs arm compilerlib for compat -# building. See staging.bbclass. -POPULATESYSROOTDEPS_class-target = "" -INHIBIT_SYSROOT_STRIP = "1" -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" - -ERROR_QA_remove += "dev-elf dev-so" -WARN_QA_remove += "libdir" - -INSANE_SKIP += "installed-vs-shipped" -do_package_qa[noexec] = "1" - -SYSROOT_DIRS_append =" \ - ${sublibdir} \ - ${subincludedir} \ -" -SYSROOT_DIRS_NATIVE_append = "${subbindir}" -INSANE_SKIP_${PN} += "installed-vs-shipped" diff --git a/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain-cross-canadian.bb b/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain-cross-canadian.bb deleted file mode 100644 index 9a3abc8140a10f8b5744a753042de1ec36f75251..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain-cross-canadian.bb +++ /dev/null @@ -1,38 +0,0 @@ -inherit cross-canadian -require gcc-bin-toolchain.inc - -# not depends to chrpath-native, use chrpath command at host -DEPENDS_remove += " chrpath-replacement-native" - -PN = "gcc-bin-toolchain-cross-canadian-${TARGET_ARCH}" -INHIBIT_DEFAULT_DEPS = "1" -INHIBIT_PACKAGE_STRIP = "1" - -# Ignore how TARGET_ARCH is computed -TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}" - -REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}" -SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}" - -do_install() { - install -m 0755 -d ${D}/${SDKTARGETSYSROOT}/ - #some files are under sysroot in compiler, need to copy to new sysroot - cp -pPR ${B}/sysroot/* ${D}/${SDKTARGETSYSROOT}/ - cp -pPR ${B}/* ${D}/${SDKTARGETSYSROOT}/ - if [ ${TOOLCHAIN_PREFIX}- == ${TARGET_PREFIX} ]; then - chown -R root:root ${D} - return 0 - fi - for f in ${D}/${SDKTARGETSYSROOT}/bin/${TOOLCHAIN_PREFIX}-*; do - bin=$(basename ${f}) - lnk=$(basename ${f} | sed "s/^${TOOLCHAIN_PREFIX}-/${TARGET_PREFIX}/g") - ln -svf ${bin} ${D}/${SDKTARGETSYSROOT}/bin/${lnk} - done - chown -R root:root ${D} -} - -SYSROOT_DIRS = "" - -INSANE_SKIP_${PN} += " already-stripped libdir staticdev dev-so infodir" -FILES_${PN} = "/" -PACKAGES = "${PN}" diff --git a/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain-cross.bb b/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain-cross.bb deleted file mode 100644 index b561bdbb42bdc442d224d023f90665de8556b0ee..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain-cross.bb +++ /dev/null @@ -1,48 +0,0 @@ -inherit cross -require gcc-bin-toolchain.inc - -PN = "gcc-bin-toolchain-cross-${TARGET_ARCH}" -INHIBIT_DEFAULT_DEPS = "1" -INHIBIT_SYSROOT_STRIP = "1" - -# Ignore how TARGET_ARCH is computed -TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}" - -PROVIDES = "\ - virtual/${TARGET_PREFIX}binutils \ - virtual/${TARGET_PREFIX}gcc \ - virtual/${TARGET_PREFIX}g++ \ -" - -# Inherit cross but keep bindir/libdir/...: -bindir = "${STAGING_DIR_NATIVE}/${prefix_native}/bin/" -libdir = "${STAGING_DIR_NATIVE}/${prefix_native}/${base_libdir}/" -libexecdir = "${STAGING_DIR_NATIVE}/${prefix_native}/libexec/" - -do_install_class-cross() { - install -m 0755 -d ${D}/${STAGING_DIR_NATIVE} - cp -pPR ${B}/* ${D}/${STAGING_DIR_NATIVE} - if [ ${TOOLCHAIN_PREFIX}- == ${TARGET_PREFIX} ]; then - return - fi - for f in ${D}/${STAGING_DIR_NATIVE}/bin/${TOOLCHAIN_PREFIX}-*; do - bin=$(basename ${f}) - lnk=$(basename ${f} | sed "s/^${TOOLCHAIN_PREFIX}-/${TARGET_PREFIX}/g") - ln -svf ${bin} ${D}/${STAGING_DIR_NATIVE}/bin/${lnk} - done -} - -SYSROOT_DIRS += "/*" - -do_gcc_stash_builddir () { - : -} -addtask do_gcc_stash_builddir - -#depends by libgcc -do_packagedata () { - : -} -addtask do_packagedata - -INSANE_SKIP_${PN} += " already-stripped " diff --git a/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain.inc b/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain.inc deleted file mode 100644 index df091a1fd24ae844eef9e495d1d34ed8874ea08a..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/gcc/gcc-bin-toolchain.inc +++ /dev/null @@ -1,29 +0,0 @@ -TOOLCHAIN_GCC_VERSION = "10.3.1" -LICENSE = "CLOSED" -SECTION = "toolchain" - -TOOLCHAIN_PREFIX_arm = "arm-openeuler-linux-gnueabi" -TOOLCHAIN_PREFIX_aarch64 = "aarch64-openeuler-linux-gnu" -EULER_TOOLCHAIN_GCC_PATH_INNER = "${TOOLCHAIN_PREFIX}/${TOOLCHAIN_GCC_VERSION}" -EULER_TOOLCHAIN_GCC_PATH = "/gcc/${EULER_TOOLCHAIN_GCC_PATH_INNER}" - -python () { - import os - - local_toolchain = str(d.getVar('OPENEULER_TOOLCHAIN_DIR', True)) - #nativesdk no arch, nativesdk-glibc cannot get specific toolchain - if bb.data.inherits_class('nativesdk', d): - return True - if not os.path.exists(local_toolchain): - bb.fatal("%s is not a directory [%s]!" % (local_toolchain, d.getVar('PN', True))) - if os.path.exists(local_toolchain): - if "glibc" == d.getVar('BPN', True): - gcctopdir = os.path.abspath(os.path.dirname(local_toolchain)) - d.setVar("DL_DIR", gcctopdir) - return True - d.setVar("S", local_toolchain) - d.setVarFlag("do_fetch", "noexec", "1") - d.setVarFlag("do_unpack", "noexec", "1") - d.setVarFlag("do_patch", "noexec", "1") - d.setVarFlag("do_configure", "noexec", "1") -} diff --git a/meta-openeuler/recipes-core/gdb/gdb-common.inc b/meta-openeuler/recipes-devtools/gdb/gdb-common.inc similarity index 82% rename from meta-openeuler/recipes-core/gdb/gdb-common.inc rename to meta-openeuler/recipes-devtools/gdb/gdb-common.inc index 15702903267240013bcb517bbc0c0fc8c9b60032..925b0c2f8024d689c8abe0c7e045dcb2ae29c29c 100644 --- a/meta-openeuler/recipes-core/gdb/gdb-common.inc +++ b/meta-openeuler/recipes-devtools/gdb/gdb-common.inc @@ -2,13 +2,13 @@ SUMMARY = "GNU debugger" HOMEPAGE = "http://www.gnu.org/software/gdb/" DESCRIPTION = "GDB, the GNU Project debugger, allows you to see what is going on inside another program while it executes -- or what another program was doing at the moment it crashed." SECTION = "devel" -DEPENDS = "expat gmp zlib ncurses virtual/libiconv bison-native" +DEPENDS = "expat gmp zlib ncurses virtual/libiconv ${LTTNGUST} bison-native" LTTNGUST = "lttng-ust" -LTTNGUST_arc = "" -LTTNGUST_aarch64 = "" -LTTNGUST_mipsarch = "" -LTTNGUST_sh4 = "" +LTTNGUST:arc = "" +LTTNGUST:aarch64 = "" +LTTNGUST:mipsarch = "" +LTTNGUST:sh4 = "" inherit autotools texinfo @@ -27,7 +27,7 @@ EXTRA_OECONF = "--disable-gdbtk --disable-x --disable-werror \ --disable-gas --disable-binutils \ --disable-ld --disable-gold \ --disable-gprof \ - --with-libgmp-prefix=${STAGING_EXECPREFIXDIR} \ + --with-libgmp-prefix=${STAGING_EXECPREFIXDIR} \ " PACKAGECONFIG ??= "readline ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}" @@ -53,14 +53,14 @@ do_configure () { # we don't want gdb to provide bfd/iberty/opcodes, which instead will override the # right bits installed by binutils. Same for bfd.info -- also from binutils. -do_install_append() { +do_install:append() { rm -rf ${D}${libdir} rm -rf ${D}${includedir} rm -rf ${D}${datadir}/locale rm -f ${D}${infodir}/bfd.info } -#RRECOMMENDS_gdb_append_linux = " glibc-thread-db " -#RRECOMMENDS_gdb_append_linux-gnueabi = " glibc-thread-db " -#RRECOMMENDS_gdbserver_append_linux = " glibc-thread-db " -#RRECOMMENDS_gdbserver_append_linux-gnueabi = " glibc-thread-db " +RRECOMMENDS:gdb:append:linux = " glibc-thread-db " +RRECOMMENDS:gdb:append:linux-gnueabi = " glibc-thread-db " +RRECOMMENDS:gdbserver:append:linux = " glibc-thread-db " +RRECOMMENDS:gdbserver:append:linux-gnueabi = " glibc-thread-db " diff --git a/meta-openeuler/recipes-devtools/gdb/gdb-cross-canadian.inc b/meta-openeuler/recipes-devtools/gdb/gdb-cross-canadian.inc new file mode 100644 index 0000000000000000000000000000000000000000..8e926e81e164976ba973abc2526b3e652492bb80 --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb-cross-canadian.inc @@ -0,0 +1,44 @@ +inherit cross-canadian +inherit python3-dir +inherit pkgconfig + +SUMMARY = "GNU debugger (cross-canadian gdb for ${TARGET_ARCH} target)" +PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}" +BPN = "gdb" + +DEPENDS = "nativesdk-ncurses nativesdk-expat nativesdk-gettext nativesdk-gmp \ + virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-libc" + +GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'" + +# Overrides PACKAGECONFIG variables in gdb-common.inc +PACKAGECONFIG ??= "python readline ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}" +PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,nativesdk-python3, \ + nativesdk-python3-core \ + nativesdk-python3-codecs nativesdk-python3-netclient \ + " +PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,nativesdk-readline" +PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, nativesdk-elfutils" + +SSTATE_ALLOW_OVERLAP_FILES += "${STAGING_DATADIR}/gdb" + +do_configure:prepend() { +cat > ${WORKDIR}/python << EOF +#! /bin/sh +case "\$2" in + --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}/" ;; + --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}${PYTHON_ABI}" ;; + --exec-prefix) echo "${exec_prefix}" ;; + *) exit 1 ;; +esac +exit 0 +EOF + chmod +x ${WORKDIR}/python +} + +# we don't want gdb to provide bfd/iberty/opcodes, which instead will override the +# right bits installed by binutils. +do_install:append() { + rm -rf ${D}${exec_prefix}/lib + cross_canadian_bindirlinks +} diff --git a/meta-openeuler/recipes-devtools/gdb/gdb-cross-canadian_12.1.bb b/meta-openeuler/recipes-devtools/gdb/gdb-cross-canadian_12.1.bb new file mode 100644 index 0000000000000000000000000000000000000000..4ab2b7156d6ea27eb88d72b0180b3dcb2cbef4b7 --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb-cross-canadian_12.1.bb @@ -0,0 +1,3 @@ +require gdb-common.inc +require gdb-cross-canadian.inc +require gdb.inc diff --git a/meta-openeuler/recipes-devtools/gdb/gdb-cross.inc b/meta-openeuler/recipes-devtools/gdb/gdb-cross.inc new file mode 100644 index 0000000000000000000000000000000000000000..9f9675c1b324a0bee8177e625ab525eca470cd76 --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb-cross.inc @@ -0,0 +1,31 @@ +require gdb-common.inc + +DEPENDS = "expat-native gmp-native ncurses-native flex-native bison-native" + +inherit python3native pkgconfig + +# Overrides PACKAGECONFIG variables in gdb-common.inc +PACKAGECONFIG ??= "python readline ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}" +PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3-native" +PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,readline-native" +PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, elfutils-native" + +do_compile:prepend() { + export STAGING_LIBDIR="${STAGING_LIBDIR_NATIVE}" + export STAGING_INCDIR="${STAGING_INCDIR_NATIVE}" +} + +#EXTRA_OEMAKE += "LDFLAGS='${BUILD_LDFLAGS}'" + +GDBPROPREFIX = "" + +PN = "gdb-cross-${TARGET_ARCH}" +BPN = "gdb" + +# Ignore how TARGET_ARCH is computed. +TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}" + +inherit cross +inherit gettext + +datadir .= "/gdb-${TARGET_SYS}${TARGET_VENDOR}-${TARGET_OS}" diff --git a/meta-openeuler/recipes-devtools/gdb/gdb-cross_12.1.bb b/meta-openeuler/recipes-devtools/gdb/gdb-cross_12.1.bb new file mode 100644 index 0000000000000000000000000000000000000000..3b654a2f0dcb5667c88b8288fde09ba2887078d3 --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb-cross_12.1.bb @@ -0,0 +1,2 @@ +require gdb-cross.inc +require gdb.inc diff --git a/meta-openeuler/recipes-core/gdb/gdb.inc b/meta-openeuler/recipes-devtools/gdb/gdb.inc similarity index 31% rename from meta-openeuler/recipes-core/gdb/gdb.inc rename to meta-openeuler/recipes-devtools/gdb/gdb.inc index cee884ff193173ae6f53b51959bcd61aa58b0f29..3b569fd40e75550af6f32920f4d4c18d891d0f71 100644 --- a/meta-openeuler/recipes-core/gdb/gdb.inc +++ b/meta-openeuler/recipes-devtools/gdb/gdb.inc @@ -4,6 +4,15 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \ file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674" -SRC_URI = "file://gdb/${BP}.tar.xz \ -" -SRC_URI[sha256sum] = "cccfcc407b20d343fb320d4a9a2110776dd3165118ffd41f4b1b162340333f94" +SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.xz \ + file://0001-make-man-install-relative-to-DESTDIR.patch \ + file://0002-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \ + file://0003-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch \ + file://0004-Dont-disable-libreadline.a-when-using-disable-static.patch \ + file://0005-use-asm-sgidefs.h.patch \ + file://0006-Change-order-of-CFLAGS.patch \ + file://0007-resolve-restrict-keyword-conflict.patch \ + file://0008-Fix-invalid-sigprocmask-call.patch \ + file://0009-gdbserver-ctrl-c-handling.patch \ + " +SRC_URI[sha256sum] = "0e1793bf8f2b54d53f46dea84ccfd446f48f81b297b28c4f7fc017b818d69fed" diff --git a/meta-openeuler/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch b/meta-openeuler/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch new file mode 100644 index 0000000000000000000000000000000000000000..16d6cf196fdc278a716c30894f6b5bb0838af16a --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch @@ -0,0 +1,28 @@ +From 8eca28eddcda4ce8a345ca031f43ff1ed6f37089 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 2 Mar 2015 02:27:55 +0000 +Subject: [PATCH 1/9] make man install relative to DESTDIR + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + sim/common/Make-common.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in +index 74e5dad3049..9e95c224ba4 100644 +--- a/sim/common/Make-common.in ++++ b/sim/common/Make-common.in +@@ -70,7 +70,7 @@ tooldir = $(libdir)/$(target_alias) + datadir = @datadir@ + datarootdir = @datarootdir@ + mandir = @mandir@ +-man1dir = $(mandir)/man1 ++man1dir = $(DESTDIR)$(mandir)/man1 + infodir = @infodir@ + includedir = @includedir@ + +-- +2.36.1 + diff --git a/meta-openeuler/recipes-devtools/gdb/gdb/0002-mips-linux-nat-Define-_ABIO32-if-not-defined.patch b/meta-openeuler/recipes-devtools/gdb/gdb/0002-mips-linux-nat-Define-_ABIO32-if-not-defined.patch new file mode 100644 index 0000000000000000000000000000000000000000..8d263de8963d7997a7a204bb7b41232a400f7fd2 --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb/0002-mips-linux-nat-Define-_ABIO32-if-not-defined.patch @@ -0,0 +1,35 @@ +From 37d3afd2eaa95c89ad7cb5d0079b017752e4d0ea Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 23 Mar 2016 06:30:09 +0000 +Subject: [PATCH 2/9] mips-linux-nat: Define _ABIO32 if not defined + +This helps building gdb on mips64 on musl, since +musl does not provide sgidefs.h this define is +only defined when GCC is using o32 ABI, in that +case gcc emits it as built-in define and hence +it works ok for mips32 + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + gdb/mips-linux-nat.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c +index 20e12b6889e..6adc61235aa 100644 +--- a/gdb/mips-linux-nat.c ++++ b/gdb/mips-linux-nat.c +@@ -41,6 +41,10 @@ + #ifndef PTRACE_GET_THREAD_AREA + #define PTRACE_GET_THREAD_AREA 25 + #endif ++/* musl does not define and relies on compiler built-in macros for it */ ++#ifndef _ABIO32 ++#define _ABIO32 1 ++#endif + + class mips_linux_nat_target final : public linux_nat_trad_target + { +-- +2.36.1 + diff --git a/meta-openeuler/recipes-devtools/gdb/gdb/0003-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/meta-openeuler/recipes-devtools/gdb/gdb/0003-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch new file mode 100644 index 0000000000000000000000000000000000000000..7e09404bb0577a8a1eecccee528bea57d1502a2a --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb/0003-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch @@ -0,0 +1,52 @@ +From e689eec672ee8c53b3adb2ade2b5deb9b7cd99d4 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 30 Apr 2016 18:32:14 -0700 +Subject: [PATCH 3/9] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + gdb/nat/ppc-linux.h | 6 ++++++ + gdbserver/linux-ppc-low.cc | 6 ++++++ + 2 files changed, 12 insertions(+) + +diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h +index 1094f6b0be3..d8588a646c2 100644 +--- a/gdb/nat/ppc-linux.h ++++ b/gdb/nat/ppc-linux.h +@@ -18,7 +18,13 @@ + #ifndef NAT_PPC_LINUX_H + #define NAT_PPC_LINUX_H + ++#if !defined(__GLIBC__) ++# define pt_regs uapi_pt_regs ++#endif + #include ++#if !defined(__GLIBC__) ++# undef pt_regs ++#endif + #include + + /* This sometimes isn't defined. */ +diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc +index 08824887003..69afbae5359 100644 +--- a/gdbserver/linux-ppc-low.cc ++++ b/gdbserver/linux-ppc-low.cc +@@ -23,7 +23,13 @@ + #include "elf/common.h" + #include + #include ++#if !defined(__GLIBC__) ++# define pt_regs uapi_pt_regs ++#endif + #include ++#if !defined(__GLIBC__) ++# undef pt_regs ++#endif + + #include "arch/ppc-linux-common.h" + #include "arch/ppc-linux-tdesc.h" +-- +2.36.1 + diff --git a/meta-openeuler/recipes-devtools/gdb/gdb/0004-Dont-disable-libreadline.a-when-using-disable-static.patch b/meta-openeuler/recipes-devtools/gdb/gdb/0004-Dont-disable-libreadline.a-when-using-disable-static.patch new file mode 100644 index 0000000000000000000000000000000000000000..a1e85e91b336d9200c3bba389920679da18c50ee --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb/0004-Dont-disable-libreadline.a-when-using-disable-static.patch @@ -0,0 +1,50 @@ +From 15ee6a626242efb8f367be49c13e00d0b72317f0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 30 Apr 2016 15:25:03 -0700 +Subject: [PATCH 4/9] Dont disable libreadline.a when using --disable-static + +If gdb is configured with --disable-static then this is dutifully passed to +readline which then disables libreadline.a, which causes a problem when gdb +tries to link against that. + +To ensure that readline always builds static libraries, pass --enable-static to +the sub-configure. + +Upstream-Status: Pending +Signed-off-by: Ross Burton +Signed-off-by: Khem Raj +--- + Makefile.def | 3 ++- + Makefile.in | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Makefile.def b/Makefile.def +index acdcd625ed6..78fc31e1199 100644 +--- a/Makefile.def ++++ b/Makefile.def +@@ -120,7 +120,8 @@ host_modules= { module= libiconv; + missing= install-html; + missing= install-info; }; + host_modules= { module= m4; }; +-host_modules= { module= readline; }; ++host_modules= { module= readline; ++ extra_configure_flags='--enable-static';}; + host_modules= { module= sid; }; + host_modules= { module= sim; }; + host_modules= { module= texinfo; no_install= true; }; +diff --git a/Makefile.in b/Makefile.in +index 3aacd2daac9..aa58adada4a 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -32791,7 +32791,7 @@ configure-readline: + $$s/$$module_srcdir/configure \ + --srcdir=$${topdir}/$$module_srcdir \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ +- --target=${target_alias} \ ++ --target=${target_alias} --enable-static \ + || exit 1 + @endif readline + +-- +2.36.1 + diff --git a/meta-openeuler/recipes-devtools/gdb/gdb/0005-use-asm-sgidefs.h.patch b/meta-openeuler/recipes-devtools/gdb/gdb/0005-use-asm-sgidefs.h.patch new file mode 100644 index 0000000000000000000000000000000000000000..242099b9b1e5484471c6e70e25a68e44f7b31069 --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb/0005-use-asm-sgidefs.h.patch @@ -0,0 +1,36 @@ +From 25a75aaf29791f4302f0e4452f7ebaf735d4f083 Mon Sep 17 00:00:00 2001 +From: Andre McCurdy +Date: Sat, 30 Apr 2016 15:29:06 -0700 +Subject: [PATCH 5/9] use + +Build fix for MIPS with musl libc + +The MIPS specific header is provided by glibc and uclibc +but not by musl. Regardless of the libc, the kernel headers provide + which provides the same definitions, so use that +instead. + +Upstream-Status: Pending + +Signed-off-by: Andre McCurdy +Signed-off-by: Khem Raj +--- + gdb/mips-linux-nat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c +index 6adc61235aa..afb40066744 100644 +--- a/gdb/mips-linux-nat.c ++++ b/gdb/mips-linux-nat.c +@@ -31,7 +31,7 @@ + #include "gdb_proc_service.h" + #include "gregset.h" + +-#include ++#include + #include "nat/gdb_ptrace.h" + #include + #include "inf-ptrace.h" +-- +2.36.1 + diff --git a/meta-openeuler/recipes-devtools/gdb/gdb/0006-Change-order-of-CFLAGS.patch b/meta-openeuler/recipes-devtools/gdb/gdb/0006-Change-order-of-CFLAGS.patch new file mode 100644 index 0000000000000000000000000000000000000000..58c9b1d0a781fc58cf5821bbea28c2149b976ce1 --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb/0006-Change-order-of-CFLAGS.patch @@ -0,0 +1,30 @@ +From c0e7c34134aa1f9644075c596a2338a50d3d923e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 30 Apr 2016 15:35:39 -0700 +Subject: [PATCH 6/9] Change order of CFLAGS + +Lets us override Werror if need be + +Upstream-Status: Inappropriate + +Signed-off-by: Khem Raj +--- + gdbserver/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in +index 47648b8d962..5599779de57 100644 +--- a/gdbserver/Makefile.in ++++ b/gdbserver/Makefile.in +@@ -156,7 +156,7 @@ WIN32APILIBS = @WIN32APILIBS@ + INTERNAL_CFLAGS_BASE = ${GLOBAL_CFLAGS} \ + ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS) + INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS) +-INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER ++INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) ${COMPILER_CFLAGS} -DGDBSERVER + + # LDFLAGS is specifically reserved for setting from the command line + # when running make. +-- +2.36.1 + diff --git a/meta-openeuler/recipes-devtools/gdb/gdb/0007-resolve-restrict-keyword-conflict.patch b/meta-openeuler/recipes-devtools/gdb/gdb/0007-resolve-restrict-keyword-conflict.patch new file mode 100644 index 0000000000000000000000000000000000000000..bbd1f0b27f1c64b828a1224576f091f0b677d840 --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb/0007-resolve-restrict-keyword-conflict.patch @@ -0,0 +1,48 @@ +From 44fa1ecfbd8a5fe0cfea12a175fa041686842a0c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 10 May 2016 08:47:05 -0700 +Subject: [PATCH 7/9] resolve restrict keyword conflict + +GCC detects that we call 'restrict' as param name in function +signatures and complains since both params are called 'restrict' +therefore we use __restrict to denote the C99 keywork + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + gnulib/import/sys_time.in.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gnulib/import/sys_time.in.h b/gnulib/import/sys_time.in.h +index 90a67d18426..664641a1fe8 100644 +--- a/gnulib/import/sys_time.in.h ++++ b/gnulib/import/sys_time.in.h +@@ -93,20 +93,20 @@ struct timeval + # define gettimeofday rpl_gettimeofday + # endif + _GL_FUNCDECL_RPL (gettimeofday, int, +- (struct timeval *restrict, void *restrict) ++ (struct timeval *__restrict, void *__restrict) + _GL_ARG_NONNULL ((1))); + _GL_CXXALIAS_RPL (gettimeofday, int, +- (struct timeval *restrict, void *restrict)); ++ (struct timeval *__restrict, void *__restrict)); + # else + # if !@HAVE_GETTIMEOFDAY@ + _GL_FUNCDECL_SYS (gettimeofday, int, +- (struct timeval *restrict, void *restrict) ++ (struct timeval *__restrict, void *__restrict) + _GL_ARG_NONNULL ((1))); + # endif + /* Need to cast, because on glibc systems, by default, the second argument is + struct timezone *. */ + _GL_CXXALIAS_SYS_CAST (gettimeofday, int, +- (struct timeval *restrict, void *restrict)); ++ (struct timeval *__restrict, void *__restrict)); + # endif + _GL_CXXALIASWARN (gettimeofday); + # if defined __cplusplus && defined GNULIB_NAMESPACE +-- +2.36.1 + diff --git a/meta-openeuler/recipes-devtools/gdb/gdb/0008-Fix-invalid-sigprocmask-call.patch b/meta-openeuler/recipes-devtools/gdb/gdb/0008-Fix-invalid-sigprocmask-call.patch new file mode 100644 index 0000000000000000000000000000000000000000..ed1310ced2829393f32e36ac5c67660b7787d5eb --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb/0008-Fix-invalid-sigprocmask-call.patch @@ -0,0 +1,49 @@ +From 5bdd15553daef7370ca3c1f12d8f14247fdd4907 Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Fri, 24 Mar 2017 10:36:03 +0800 +Subject: [PATCH 8/9] Fix invalid sigprocmask call +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The POSIX document says + + The pthread_sigmask() and sigprocmask() functions shall fail if: + + [EINVAL] + The value of the how argument is not equal to one of the defined values. + +and this is how musl-libc is currently doing. Fix the call to be safe +and correct + + [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html + +gdb/ChangeLog: +2017-03-24 Yousong Zhou + + * common/signals-state-save-restore.c (save_original_signals_state): + Fix invalid sigprocmask call. + +Upstream-Status: Pending [not author, cherry-picked from LEDE https://bugs.lede-project.org/index.php?do=details&task_id=637&openedfrom=-1%2Bweek] +Signed-off-by: André Draszik +Signed-off-by: Khem Raj +--- + gdbsupport/signals-state-save-restore.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdbsupport/signals-state-save-restore.cc b/gdbsupport/signals-state-save-restore.cc +index 92e799d3551..a4a0234272a 100644 +--- a/gdbsupport/signals-state-save-restore.cc ++++ b/gdbsupport/signals-state-save-restore.cc +@@ -38,7 +38,7 @@ save_original_signals_state (bool quiet) + int i; + int res; + +- res = gdb_sigmask (0, NULL, &original_signal_mask); ++ res = gdb_sigmask (SIG_BLOCK, NULL, &original_signal_mask); + if (res == -1) + perror_with_name (("sigprocmask")); + +-- +2.36.1 + diff --git a/meta-openeuler/recipes-devtools/gdb/gdb/0009-gdbserver-ctrl-c-handling.patch b/meta-openeuler/recipes-devtools/gdb/gdb/0009-gdbserver-ctrl-c-handling.patch new file mode 100644 index 0000000000000000000000000000000000000000..f53d3bd1e54c65672fa8a10490c4fdadd12106cd --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb/0009-gdbserver-ctrl-c-handling.patch @@ -0,0 +1,40 @@ +From bc3b1f6aacf2d8fe66b022fbfcf28cd82c76e52f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 29 Nov 2018 18:00:23 -0800 +Subject: [PATCH 9/9] gdbserver ctrl-c handling + +This problem was created by the upstream commit 78708b7c8c +After applying the commit, it will send SIGINT to the process +group(-signal_pid). +But if we use gdbserver send SIGINT, and the attached process is not a +process +group leader, then the "kill (-signal_pid, SIGINT)" returns error and +fails to +interrupt the attached process. + +Upstream-Status: Submitted +[https://sourceware.org/bugzilla/show_bug.cgi?id=18945] + +Author: Josh Gao +Signed-off-by: Zhixiong Chi +Signed-off-by: Khem Raj +--- + gdbserver/linux-low.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc +index 7726a4a0c36..f750e074a03 100644 +--- a/gdbserver/linux-low.cc ++++ b/gdbserver/linux-low.cc +@@ -5496,7 +5496,7 @@ linux_process_target::request_interrupt () + { + /* Send a SIGINT to the process group. This acts just like the user + typed a ^C on the controlling terminal. */ +- ::kill (-signal_pid, SIGINT); ++ ::kill (signal_pid, SIGINT); + } + + bool +-- +2.36.1 + diff --git a/meta-openeuler/recipes-devtools/gdb/gdb_%.bbappend b/meta-openeuler/recipes-devtools/gdb/gdb_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..855e27bbba4635a0a1164e07d61d63dec80fc63c --- /dev/null +++ b/meta-openeuler/recipes-devtools/gdb/gdb_%.bbappend @@ -0,0 +1,96 @@ +# main bbfile: yocto-poky/meta/recipes-devtools/gdb/gdb_10.1.bb +# ref: http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/gdb/gdb_12.1.bb?id=8d42315c074a97 + +OPENEULER_SRC_URI_REMOVE = "https git http" + +#version in openEuler +PV = "12.1" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ + ${GNU_MIRROR}/gdb/gdb-${PV}.tar.xz \ + " + +# files, patches that come from openeuler +SRC_URI += " \ + file://gdb-${PV}.tar.xz \ + file://gdb-6.3-rh-testversion-20041202.patch \ + file://gdb-6.3-gstack-20050411.patch \ + file://gdb-6.3-test-movedir-20050125.patch \ + file://gdb-6.3-threaded-watchpoints2-20050225.patch \ + file://gdb-6.3-inheritancetest-20050726.patch \ + file://gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch \ + file://gdb-6.5-sharedlibrary-path.patch \ + file://gdb-6.5-BEA-testsuite.patch \ + file://gdb-6.5-last-address-space-byte-test.patch \ + file://gdb-6.5-readline-long-line-crash-test.patch \ + file://gdb-6.5-bz218379-ppc-solib-trampoline-test.patch \ + file://gdb-6.5-bz109921-DW_AT_decl_file-test.patch \ + file://gdb-6.3-bz140532-ppc-unwinding-test.patch \ + file://gdb-6.3-bz202689-exec-from-pthread-test.patch \ + file://gdb-6.6-bz230000-power6-disassembly-test.patch \ + file://gdb-6.6-bz229517-gcore-without-terminal.patch \ + file://gdb-6.6-testsuite-timeouts.patch \ + file://gdb-6.6-bz237572-ppc-atomic-sequence-test.patch \ + file://gdb-6.3-attach-see-vdso-test.patch \ + file://gdb-6.5-bz243845-stale-testing-zombie-test.patch \ + file://gdb-6.7-charsign-test.patch \ + file://gdb-6.7-ppc-clobbered-registers-O2-test.patch \ + file://gdb-6.7-testsuite-stable-results.patch \ + file://gdb-6.5-ia64-libunwind-leak-test.patch \ + file://gdb-6.5-missed-trap-on-step-test.patch \ + file://gdb-6.5-gcore-buffer-limit-test.patch \ + file://gdb-6.3-mapping-zero-inode-test.patch \ + file://gdb-6.3-focus-cmd-prev-test.patch \ + file://gdb-6.8-bz442765-threaded-exec-test.patch \ + file://gdb-6.5-section-num-fixup-test.patch \ + file://gdb-6.8-bz466901-backtrace-full-prelinked.patch \ + file://gdb-simultaneous-step-resume-breakpoint-test.patch \ + file://gdb-core-open-vdso-warning.patch \ + file://gdb-ccache-workaround.patch \ + file://gdb-lineno-makeup-test.patch \ + file://gdb-ppc-power7-test.patch \ + file://gdb-archer-next-over-throw-cxx-exec.patch \ + file://gdb-bz601887-dwarf4-rh-test.patch \ + file://gdb-test-bt-cfi-without-die.patch \ + file://gdb-bz634108-solib_address.patch \ + file://gdb-test-pid0-core.patch \ + file://gdb-test-dw2-aranges.patch \ + file://gdb-test-expr-cumulative-archer.patch \ + file://gdb-physname-pr11734-test.patch \ + file://gdb-physname-pr12273-test.patch \ + file://gdb-test-ivy-bridge.patch \ + file://gdb-runtest-pie-override.patch \ + file://gdb-glibc-strstr-workaround.patch \ + file://gdb-rhel5.9-testcase-xlf-var-inside-mod.patch \ + file://gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch \ + file://gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch \ + file://gdb-rhbz1007614-memleak-infpy_read_memory-test.patch \ + file://gdb-fortran-frame-string.patch \ + file://gdb-rhbz1156192-recursive-dlopen-test.patch \ + file://gdb-rhbz1149205-catch-syscall-after-fork-test.patch \ + file://gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch \ + file://gdb-rhbz1350436-type-printers-error.patch \ + file://gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch \ + file://gdb-fedora-libncursesw.patch \ + file://gdb-opcodes-clflushopt-test.patch \ + file://gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch \ + file://gdb-container-rh-pkg.patch \ + file://gdb-rhbz1325795-framefilters-test.patch \ + file://gdb-linux_perf-bundle.patch \ + file://gdb-libexec-add-index.patch \ + file://gdb-rhbz1398387-tab-crash-test.patch \ + file://gdb-rhbz1553104-s390x-arch12-test.patch \ + file://gdb-sw22395-constify-target_desc.patch \ + file://0002-set-entry-point-when-text-segment-is-missing.patch \ + file://0003-Add-support-for-readline-8.2.patch \ + " +# These patches can't apply from openEuler +# It may depend on the feature poky not enable, such as --with-rpm, texinfo, etc. +#gdb-6.6-buildid-locate.patch +#gdb-6.6-buildid-locate-solib-missing-ids.patch +#gdb-6.6-buildid-locate-rpm.patch +#gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +#gdb-6.6-buildid-locate-rpm-scl.patch + +FILES_${PN}-dev_riscv64 += "/usr/lib64" diff --git a/meta-openeuler/recipes-core/gdb/gdb_11.1.bb b/meta-openeuler/recipes-devtools/gdb/gdb_12.1.bb similarity index 91% rename from meta-openeuler/recipes-core/gdb/gdb_11.1.bb rename to meta-openeuler/recipes-devtools/gdb/gdb_12.1.bb index d5f57abe00d4b3979c280e310dc2aa42a538dfec..9c6db4ca2c1b56a40704d977760d9bcbb1320ad8 100644 --- a/meta-openeuler/recipes-core/gdb/gdb_11.1.bb +++ b/meta-openeuler/recipes-devtools/gdb/gdb_12.1.bb @@ -7,13 +7,13 @@ inherit gettext pkgconfig # cross-canadian must not see this PACKAGES =+ "gdbserver" -FILES_gdbserver = "${bindir}/gdbserver" +FILES:gdbserver = "${bindir}/gdbserver" require gdb.inc inherit python3-dir -EXTRA_OEMAKE_append_libc-musl = "\ +EXTRA_OEMAKE:append:libc-musl = "\ gt_cv_func_gnugettext1_libc=yes \ gt_cv_func_gnugettext2_libc=yes \ gl_cv_func_working_strerror=yes \ @@ -21,7 +21,7 @@ EXTRA_OEMAKE_append_libc-musl = "\ gl_cv_func_gettimeofday_clobber=no \ " -do_configure_prepend() { +do_configure:prepend() { if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then cat > ${WORKDIR}/python << EOF #!/bin/sh diff --git a/meta-openeuler/recipes-devtools/gnu-config/gnu-config/config.guess b/meta-openeuler/recipes-devtools/gnu-config/gnu-config/config.guess deleted file mode 100644 index 18f8edc0ff54405d81247b07a34a647675a29b2e..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/gnu-config/gnu-config/config.guess +++ /dev/null @@ -1,1486 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2018 Free Software Foundation, Inc. - -timestamp='2018-08-29' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. -# -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess -# -# Please send patches to . - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2018 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -tmp= -# shellcheck disable=SC2172 -trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 -trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 - -set_cc_for_build() { - : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } - dummy=$tmp/dummy - case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in - ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do - if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" - break - fi - done - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; - esac -} - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if test -f /.attbin/uname ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case "$UNAME_SYSTEM" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - set_cc_for_build - cat <<-EOF > "$dummy.c" - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" - - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl - fi - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - "/sbin/$sysctl" 2>/dev/null || \ - "/usr/sbin/$sysctl" 2>/dev/null || \ - echo unknown)` - case "$UNAME_MACHINE_ARCH" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - earmv*) - arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine="${arch}${endian}"-unknown - ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently (or will in the future) and ABI. - case "$UNAME_MACHINE_ARCH" in - earm*) - os=netbsdelf - ;; - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in - earm*) - expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "$UNAME_VERSION" in - Debian*) - release='-gnu' - ;; - *) - release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; - *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; - *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; - *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; - *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; - *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; - *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; - *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; - mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE=alpha ;; - "EV4.5 (21064)") - UNAME_MACHINE=alpha ;; - "LCA4 (21066/21068)") - UNAME_MACHINE=alpha ;; - "EV5 (21164)") - UNAME_MACHINE=alphaev5 ;; - "EV5.6 (21164A)") - UNAME_MACHINE=alphaev56 ;; - "EV5.6 (21164PC)") - UNAME_MACHINE=alphapca56 ;; - "EV5.7 (21164PC)") - UNAME_MACHINE=alphapca57 ;; - "EV6 (21264)") - UNAME_MACHINE=alphaev6 ;; - "EV6.7 (21264A)") - UNAME_MACHINE=alphaev67 ;; - "EV6.8CB (21264C)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8AL (21264B)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8CX (21264D)") - UNAME_MACHINE=alphaev68 ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE=alphaev69 ;; - "EV7 (21364)") - UNAME_MACHINE=alphaev7 ;; - "EV7.9 (21364A)") - UNAME_MACHINE=alphaev79 ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - case `isainfo -b` in - 32) - echo i386-pc-solaris2"$UNAME_REL" - ;; - 64) - echo x86_64-pc-solaris2"$UNAME_REL" - ;; - esac - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" - ;; - sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`"$dummy" "$dummyarg"` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] - then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] - then - echo m88k-dg-dgux"$UNAME_RELEASE" - else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" - fi - else - echo i586-dg-dgux"$UNAME_RELEASE" - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" - fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` - else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" - fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - case "$UNAME_MACHINE" in - 9000/31?) HP_ARCH=m68000 ;; - 9000/[34]??) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "$sc_cpu_version" in - 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 - 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "$sc_kernel_bits" in - 32) HP_ARCH=hppa2.0n ;; - 64) HP_ARCH=hppa2.0w ;; - '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "$HP_ARCH" = "" ]; then - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ "$HP_ARCH" = hppa2.0w ] - then - set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH=hppa2.0w - else - HP_ARCH=hppa64 - fi - fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux"$HPUX_REV" - exit ;; - 3050*:HI-UX:*:*) - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo "$UNAME_MACHINE"-unknown-osf1mk - else - echo "$UNAME_MACHINE"-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; - *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; - arm:FreeBSD:*:*) - UNAME_PROCESSOR=`uname -p` - set_cc_for_build - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi - else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf - fi - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case "$UNAME_PROCESSOR" in - amd64) - UNAME_PROCESSOR=x86_64 ;; - i386) - UNAME_PROCESSOR=i586 ;; - esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; - i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; - *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; - *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; - *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; - i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; - *:Interix*:*) - case "$UNAME_MACHINE" in - x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; - IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; - esac ;; - i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-pc-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; - *:GNU:*:*) - # the GNU system - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" - exit ;; - *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix - exit ;; - aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arm*:Linux:*:*) - set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi - else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; - crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; - e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; - ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - set_cc_for_build - sed 's/^ //' << EOF > "$dummy.c" - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" - test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } - ;; - mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; - or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; - sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; - x86_64:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; - xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; - i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; - i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; - i*86:*:4.*:*) - UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" - else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" - else - echo "$UNAME_MACHINE"-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configure will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo "$UNAME_MACHINE"-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv"$UNAME_RELEASE" - else - echo mips-unknown-sysv"$UNAME_RELEASE" - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; - SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; - *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc - if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_PPC >/dev/null - then - UNAME_PROCESSOR=powerpc - fi - fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 - fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = x86; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; - NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - # shellcheck disable=SC2154 - if test "$cputype" = 386; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; - *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "$UNAME_MACHINE" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" - exit ;; - i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; - i*86:AROS:*:*) - echo "$UNAME_MACHINE"-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; - amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; -esac - -echo "$0: unable to guess system type" >&2 - -case "$UNAME_MACHINE:$UNAME_SYSTEM" in - mips:Linux | mips64:Linux) - # If we got here on MIPS GNU/Linux, output extra information. - cat >&2 <&2 </dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = "$UNAME_MACHINE" -UNAME_RELEASE = "$UNAME_RELEASE" -UNAME_SYSTEM = "$UNAME_SYSTEM" -UNAME_VERSION = "$UNAME_VERSION" -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/meta-openeuler/recipes-devtools/gnu-config/gnu-config/config.sub b/meta-openeuler/recipes-devtools/gnu-config/gnu-config/config.sub deleted file mode 100644 index 69eb4bc1e2fefb829ed2bbad8859a8b066a40412..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/gnu-config/gnu-config/config.sub +++ /dev/null @@ -1,1788 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2018 Free Software Foundation, Inc. - -timestamp='2018-08-29' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS - -Canonicalize a configuration name. - -Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2018 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo "$1" - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Split fields of configuration type -IFS="-" read -r field1 field2 field3 field4 <&2 - exit 1 - ;; - *-*-*-*) - basic_machine=$field1-$field2 - os=$field3-$field4 - ;; - *-*-*) - # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two - # parts - maybe_os=$field2-$field3 - case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ - | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) - basic_machine=$field1 - os=$maybe_os - ;; - android-linux) - basic_machine=$field1-unknown - os=linux-android - ;; - *) - basic_machine=$field1-$field2 - os=$field3 - ;; - esac - ;; - *-*) - # A lone config we happen to match not fitting any pattern - case $field1-$field2 in - decstation-3100) - basic_machine=mips-dec - os= - ;; - *-*) - # Second component is usually, but not always the OS - case $field2 in - # Prevent following clause from handling this valid os - sun*os*) - basic_machine=$field1 - os=$field2 - ;; - # Manufacturers - dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ - | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ - | unicom* | ibm* | next | hp | isi* | apollo | altos* \ - | convergent* | ncr* | news | 32* | 3600* | 3100* \ - | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ - | ultra | tti* | harris | dolphin | highlevel | gould \ - | cbm | ns | masscomp | apple | axis | knuth | cray \ - | microblaze* | sim | cisco \ - | oki | wec | wrs | winbond) - basic_machine=$field1-$field2 - os= - ;; - *) - basic_machine=$field1 - os=$field2 - ;; - esac - ;; - esac - ;; - *) - # Convert single-component short-hands not valid as part of - # multi-component configurations. - case $field1 in - 386bsd) - basic_machine=i386-pc - os=bsd - ;; - a29khif) - basic_machine=a29k-amd - os=udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=scout - ;; - alliant) - basic_machine=fx80-alliant - os= - ;; - altos | altos3068) - basic_machine=m68k-altos - os= - ;; - am29k) - basic_machine=a29k-none - os=bsd - ;; - amdahl) - basic_machine=580-amdahl - os=sysv - ;; - amiga) - basic_machine=m68k-unknown - os= - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=bsd - ;; - aros) - basic_machine=i386-pc - os=aros - ;; - aux) - basic_machine=m68k-apple - os=aux - ;; - balance) - basic_machine=ns32k-sequent - os=dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=linux - ;; - cegcc) - basic_machine=arm-unknown - os=cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=bsd - ;; - convex-c2) - basic_machine=c2-convex - os=bsd - ;; - convex-c32) - basic_machine=c32-convex - os=bsd - ;; - convex-c34) - basic_machine=c34-convex - os=bsd - ;; - convex-c38) - basic_machine=c38-convex - os=bsd - ;; - cray) - basic_machine=j90-cray - os=unicos - ;; - crds | unos) - basic_machine=m68k-crds - os= - ;; - da30) - basic_machine=m68k-da30 - os= - ;; - decstation | pmax | pmin | dec3100 | decstatn) - basic_machine=mips-dec - os= - ;; - delta88) - basic_machine=m88k-motorola - os=sysv3 - ;; - dicos) - basic_machine=i686-pc - os=dicos - ;; - djgpp) - basic_machine=i586-pc - os=msdosdjgpp - ;; - ebmon29k) - basic_machine=a29k-amd - os=ebmon - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=ose - ;; - gmicro) - basic_machine=tron-gmicro - os=sysv - ;; - go32) - basic_machine=i386-pc - os=go32 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=hms - ;; - harris) - basic_machine=m88k-harris - os=sysv3 - ;; - hp300) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=hpux - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=proelf - ;; - i386mach) - basic_machine=i386-mach - os=mach - ;; - vsta) - basic_machine=i386-pc - os=vsta - ;; - isi68 | isi) - basic_machine=m68k-isi - os=sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=linux - ;; - magnum | m3230) - basic_machine=mips-mips - os=sysv - ;; - merlin) - basic_machine=ns32k-utek - os=sysv - ;; - mingw64) - basic_machine=x86_64-pc - os=mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=mingw32ce - ;; - monitor) - basic_machine=m68k-rom68k - os=coff - ;; - morphos) - basic_machine=powerpc-unknown - os=morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=moxiebox - ;; - msdos) - basic_machine=i386-pc - os=msdos - ;; - msys) - basic_machine=i686-pc - os=msys - ;; - mvs) - basic_machine=i370-ibm - os=mvs - ;; - nacl) - basic_machine=le32-unknown - os=nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=sysv4 - ;; - netbsd386) - basic_machine=i386-pc - os=netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=newsos - ;; - news1000) - basic_machine=m68030-sony - os=newsos - ;; - necv70) - basic_machine=v70-nec - os=sysv - ;; - nh3000) - basic_machine=m68k-harris - os=cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=cxux - ;; - nindy960) - basic_machine=i960-intel - os=nindy - ;; - mon960) - basic_machine=i960-intel - os=mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=nonstopux - ;; - os400) - basic_machine=powerpc-ibm - os=os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=ose - ;; - os68k) - basic_machine=m68k-none - os=os68k - ;; - paragon) - basic_machine=i860-intel - os=osf - ;; - parisc) - basic_machine=hppa-unknown - os=linux - ;; - pw32) - basic_machine=i586-unknown - os=pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=rdos - ;; - rdos32) - basic_machine=i386-pc - os=rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=coff - ;; - sa29200) - basic_machine=a29k-amd - os=udi - ;; - sei) - basic_machine=mips-sei - os=seiux - ;; - sequent) - basic_machine=i386-sequent - os= - ;; - sps7) - basic_machine=m68k-bull - os=sysv2 - ;; - st2000) - basic_machine=m68k-tandem - os= - ;; - stratus) - basic_machine=i860-stratus - os=sysv4 - ;; - sun2) - basic_machine=m68000-sun - os= - ;; - sun2os3) - basic_machine=m68000-sun - os=sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=sunos4 - ;; - sun3) - basic_machine=m68k-sun - os= - ;; - sun3os3) - basic_machine=m68k-sun - os=sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=sunos4 - ;; - sun4) - basic_machine=sparc-sun - os= - ;; - sun4os3) - basic_machine=sparc-sun - os=sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=solaris2 - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - os= - ;; - sv1) - basic_machine=sv1-cray - os=unicos - ;; - symmetry) - basic_machine=i386-sequent - os=dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=unicos - ;; - t90) - basic_machine=t90-cray - os=unicos - ;; - toad1) - basic_machine=pdp10-xkl - os=tops20 - ;; - tpf) - basic_machine=s390x-ibm - os=tpf - ;; - udi29k) - basic_machine=a29k-amd - os=udi - ;; - ultra3) - basic_machine=a29k-nyu - os=sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=none - ;; - vaxv) - basic_machine=vax-dec - os=sysv - ;; - vms) - basic_machine=vax-dec - os=vms - ;; - vxworks960) - basic_machine=i960-wrs - os=vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=vxworks - ;; - xbox) - basic_machine=i686-pc - os=mingw32 - ;; - ymp) - basic_machine=ymp-cray - os=unicos - ;; - *) - basic_machine=$1 - os= - ;; - esac - ;; -esac - -# Decode 1-component or ad-hoc basic machines -case $basic_machine in - # Here we handle the default manufacturer of certain CPU types. It is in - # some cases the only manufacturer, in others, it is the most popular. - w89k) - cpu=hppa1.1 - vendor=winbond - ;; - op50n) - cpu=hppa1.1 - vendor=oki - ;; - op60c) - cpu=hppa1.1 - vendor=oki - ;; - ibm*) - cpu=i370 - vendor=ibm - ;; - orion105) - cpu=clipper - vendor=highlevel - ;; - mac | mpw | mac-mpw) - cpu=m68k - vendor=apple - ;; - pmac | pmac-mpw) - cpu=powerpc - vendor=apple - ;; - - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - cpu=m68000 - vendor=att - ;; - 3b*) - cpu=we32k - vendor=att - ;; - bluegene*) - cpu=powerpc - vendor=ibm - os=cnk - ;; - decsystem10* | dec10*) - cpu=pdp10 - vendor=dec - os=tops10 - ;; - decsystem20* | dec20*) - cpu=pdp10 - vendor=dec - os=tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - cpu=m68k - vendor=motorola - ;; - dpx2*) - cpu=m68k - vendor=bull - os=sysv3 - ;; - encore | umax | mmax) - cpu=ns32k - vendor=encore - ;; - elxsi) - cpu=elxsi - vendor=elxsi - os=${os:-bsd} - ;; - fx2800) - cpu=i860 - vendor=alliant - ;; - genix) - cpu=ns32k - vendor=ns - ;; - h3050r* | hiux*) - cpu=hppa1.1 - vendor=hitachi - os=hiuxwe2 - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - cpu=m68000 - vendor=hp - ;; - hp9k3[2-9][0-9]) - cpu=m68k - vendor=hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - cpu=hppa1.1 - vendor=hp - ;; - hp9k78[0-9] | hp78[0-9]) - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - cpu=hppa1.1 - vendor=hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - cpu=hppa1.0 - vendor=hp - ;; - i*86v32) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=sysv32 - ;; - i*86v4*) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=sysv4 - ;; - i*86v) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=sysv - ;; - i*86sol2) - cpu=`echo "$1" | sed -e 's/86.*/86/'` - vendor=pc - os=solaris2 - ;; - j90 | j90-cray) - cpu=j90 - vendor=cray - os=${os:-unicos} - ;; - iris | iris4d) - cpu=mips - vendor=sgi - case $os in - irix*) - ;; - *) - os=irix4 - ;; - esac - ;; - miniframe) - cpu=m68000 - vendor=convergent - ;; - *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) - cpu=m68k - vendor=atari - os=mint - ;; - news-3600 | risc-news) - cpu=mips - vendor=sony - os=newsos - ;; - next | m*-next) - cpu=m68k - vendor=next - case $os in - nextstep* ) - ;; - ns2*) - os=nextstep2 - ;; - *) - os=nextstep3 - ;; - esac - ;; - np1) - cpu=np1 - vendor=gould - ;; - op50n-* | op60c-*) - cpu=hppa1.1 - vendor=oki - os=proelf - ;; - pa-hitachi) - cpu=hppa1.1 - vendor=hitachi - os=hiuxwe2 - ;; - pbd) - cpu=sparc - vendor=tti - ;; - pbb) - cpu=m68k - vendor=tti - ;; - pc532) - cpu=ns32k - vendor=pc532 - ;; - pn) - cpu=pn - vendor=gould - ;; - power) - cpu=power - vendor=ibm - ;; - ps2) - cpu=i386 - vendor=ibm - ;; - rm[46]00) - cpu=mips - vendor=siemens - ;; - rtpc | rtpc-*) - cpu=romp - vendor=ibm - ;; - sde) - cpu=mipsisa32 - vendor=sde - os=${os:-elf} - ;; - simso-wrs) - cpu=sparclite - vendor=wrs - os=vxworks - ;; - tower | tower-32) - cpu=m68k - vendor=ncr - ;; - vpp*|vx|vx-*) - cpu=f301 - vendor=fujitsu - ;; - w65) - cpu=w65 - vendor=wdc - ;; - w89k-*) - cpu=hppa1.1 - vendor=winbond - os=proelf - ;; - none) - cpu=none - vendor=none - ;; - leon|leon[3-9]) - cpu=sparc - vendor=$basic_machine - ;; - leon-*|leon[3-9]-*) - cpu=sparc - vendor=`echo "$basic_machine" | sed 's/-.*//'` - ;; - - *-*) - IFS="-" read -r cpu vendor <&2 - exit 1 - ;; - esac - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $vendor in - digital*) - vendor=dec - ;; - commodore*) - vendor=cbm - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x$os != x ] -then -case $os in - # First match some system type aliases that might get confused - # with valid system types. - # solaris* is a basic system type, with this one exception. - auroraux) - os=auroraux - ;; - bluegene*) - os=cnk - ;; - solaris1 | solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - solaris) - os=solaris2 - ;; - unixware*) - os=sysv4.2uw - ;; - gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # es1800 is here to avoid being matched by es* (a different OS) - es1800*) - os=ose - ;; - # Some version numbers need modification - chorusos*) - os=chorusos - ;; - isc) - os=isc2.2 - ;; - sco6) - os=sco5v6 - ;; - sco5) - os=sco3.2v5 - ;; - sco4) - os=sco3.2v4 - ;; - sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - ;; - sco3.2v[4-9]* | sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - ;; - scout) - # Don't match below - ;; - sco*) - os=sco3.2v2 - ;; - psos*) - os=psos - ;; - # Now accept the basic system types. - # The portable systems comes first. - # Each alternative MUST end in a * to match a version number. - # sysv* is not here because it comes later, after sysvr4. - gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ - | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ - | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ - | sym* | kopensolaris* | plan9* \ - | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ - | aos* | aros* | cloudabi* | sortix* \ - | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ - | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ - | knetbsd* | mirbsd* | netbsd* \ - | bitrig* | openbsd* | solidbsd* | libertybsd* \ - | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ - | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ - | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ - | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ - | chorusrdb* | cegcc* | glidix* \ - | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ - | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ - | linux-newlib* | linux-musl* | linux-uclibc* \ - | uxpv* | beos* | mpeix* | udk* | moxiebox* \ - | interix* | uwin* | mks* | rhapsody* | darwin* \ - | openstep* | oskit* | conix* | pw32* | nonstopux* \ - | storm-chaos* | tops10* | tenex* | tops20* | its* \ - | os2* | vos* | palmos* | uclinux* | nucleus* \ - | morphos* | superux* | rtmk* | windiss* \ - | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ - | skyos* | haiku* | rdos* | toppers* | drops* | es* \ - | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ - | midnightbsd*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - qnx*) - case $cpu in - x86 | i*86) - ;; - *) - os=nto-$os - ;; - esac - ;; - hiux*) - os=hiuxwe2 - ;; - nto-qnx*) - ;; - nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - sim | xray | os68k* | v88r* \ - | windows* | osx | abug | netware* | os9* \ - | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) - ;; - linux-dietlibc) - os=linux-dietlibc - ;; - linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - lynx*178) - os=lynxos178 - ;; - lynx*5) - os=lynxos5 - ;; - lynx*) - os=lynxos - ;; - mac*) - os=`echo "$os" | sed -e 's|mac|macos|'` - ;; - opened*) - os=openedition - ;; - os400*) - os=os400 - ;; - sunos5*) - os=`echo "$os" | sed -e 's|sunos5|solaris2|'` - ;; - sunos6*) - os=`echo "$os" | sed -e 's|sunos6|solaris3|'` - ;; - wince*) - os=wince - ;; - utek*) - os=bsd - ;; - dynix*) - os=bsd - ;; - acis*) - os=aos - ;; - atheos*) - os=atheos - ;; - syllable*) - os=syllable - ;; - 386bsd) - os=bsd - ;; - ctix* | uts*) - os=sysv - ;; - nova*) - os=rtmk-nova - ;; - ns2) - os=nextstep2 - ;; - nsk*) - os=nsk - ;; - # Preserve the version number of sinix5. - sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - sinix*) - os=sysv4 - ;; - tpf*) - os=tpf - ;; - triton*) - os=sysv3 - ;; - oss*) - os=sysv3 - ;; - svr4*) - os=sysv4 - ;; - svr3) - os=sysv3 - ;; - sysvr4) - os=sysv4 - ;; - # This must come after sysvr4. - sysv*) - ;; - ose*) - os=ose - ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) - os=mint - ;; - zvmoe) - os=zvmoe - ;; - dicos*) - os=dicos - ;; - pikeos*) - # Until real need of OS specific support for - # particular features comes up, bare metal - # configurations are quite functional. - case $cpu in - arm*) - os=eabi - ;; - *) - os=elf - ;; - esac - ;; - nacl*) - ;; - ios) - ;; - none) - ;; - *-eabi) - ;; - *) - echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $cpu-$vendor in - score-*) - os=elf - ;; - spu-*) - os=elf - ;; - *-acorn) - os=riscix1.2 - ;; - arm*-rebel) - os=linux - ;; - arm*-semi) - os=aout - ;; - c4x-* | tic4x-*) - os=coff - ;; - c8051-*) - os=elf - ;; - clipper-intergraph) - os=clix - ;; - hexagon-*) - os=elf - ;; - tic54x-*) - os=coff - ;; - tic55x-*) - os=coff - ;; - tic6x-*) - os=coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=tops20 - ;; - pdp11-*) - os=none - ;; - *-dec | vax-*) - os=ultrix4.2 - ;; - m68*-apollo) - os=domain - ;; - i386-sun) - os=sunos4.0.2 - ;; - m68000-sun) - os=sunos3 - ;; - m68*-cisco) - os=aout - ;; - mep-*) - os=elf - ;; - mips*-cisco) - os=elf - ;; - mips*-*) - os=elf - ;; - or32-*) - os=coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=sysv3 - ;; - sparc-* | *-sun) - os=sunos4.1.1 - ;; - pru-*) - os=elf - ;; - *-be) - os=beos - ;; - *-ibm) - os=aix - ;; - *-knuth) - os=mmixware - ;; - *-wec) - os=proelf - ;; - *-winbond) - os=proelf - ;; - *-oki) - os=proelf - ;; - *-hp) - os=hpux - ;; - *-hitachi) - os=hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=sysv - ;; - *-cbm) - os=amigaos - ;; - *-dg) - os=dgux - ;; - *-dolphin) - os=sysv3 - ;; - m68k-ccur) - os=rtu - ;; - m88k-omron*) - os=luna - ;; - *-next) - os=nextstep - ;; - *-sequent) - os=ptx - ;; - *-crds) - os=unos - ;; - *-ns) - os=genix - ;; - i370-*) - os=mvs - ;; - *-gould) - os=sysv - ;; - *-highlevel) - os=bsd - ;; - *-encore) - os=bsd - ;; - *-sgi) - os=irix - ;; - *-siemens) - os=sysv4 - ;; - *-masscomp) - os=rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=uxpv - ;; - *-rom68k) - os=coff - ;; - *-*bug) - os=coff - ;; - *-apple) - os=macos - ;; - *-atari*) - os=mint - ;; - *-wrs) - os=vxworks - ;; - *) - os=none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -case $vendor in - unknown) - case $os in - riscix*) - vendor=acorn - ;; - sunos*) - vendor=sun - ;; - cnk*|-aix*) - vendor=ibm - ;; - beos*) - vendor=be - ;; - hpux*) - vendor=hp - ;; - mpeix*) - vendor=hp - ;; - hiux*) - vendor=hitachi - ;; - unos*) - vendor=crds - ;; - dgux*) - vendor=dg - ;; - luna*) - vendor=omron - ;; - genix*) - vendor=ns - ;; - clix*) - vendor=intergraph - ;; - mvs* | opened*) - vendor=ibm - ;; - os400*) - vendor=ibm - ;; - ptx*) - vendor=sequent - ;; - tpf*) - vendor=ibm - ;; - vxsim* | vxworks* | windiss*) - vendor=wrs - ;; - aux*) - vendor=apple - ;; - hms*) - vendor=hitachi - ;; - mpw* | macos*) - vendor=apple - ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) - vendor=atari - ;; - vos*) - vendor=stratus - ;; - esac - ;; -esac - -echo "$cpu-$vendor-$os" -exit - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/meta-openeuler/recipes-devtools/gnu-config/gnu-config/gnu-configize.in b/meta-openeuler/recipes-devtools/gnu-config/gnu-config/gnu-configize.in deleted file mode 100644 index d4908fc4f9d7f08d4aa116e1d0ef400f1f52ad2d..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/gnu-config/gnu-config/gnu-configize.in +++ /dev/null @@ -1,267 +0,0 @@ -#! /usr/bin/env perl -# -*- perl -*- - -eval 'case $# in 0) exec /usr/bin/perl -S "$0";; *) exec /usr/bin/perl -S "$0" "$@";; esac' - if 0; - -# gnu-configize - install the GNU config.guess / config.sub in a directory tree -# Based on autoreconf: -# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -BEGIN -{ - my $datadir = $ENV{'autom4te_perllibdir'} || '@autom4te_perllibdir@'; -# '/home/kergoth/code/build-arm/tmp/staging/share/autoconf'; - unshift @INC, $datadir; - - # Override SHELL. On DJGPP SHELL may not be set to a shell - # that can handle redirection and quote arguments correctly, - # e.g.: COMMAND.COM. For DJGPP always use the shell that configure - # has detected. - $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos'); -} - -use Autom4te::ChannelDefs; -use Autom4te::Channels; -use Autom4te::Configure_ac; -use Autom4te::FileUtils; -use Autom4te::General; -use Autom4te::XFile; -# Do not use Cwd::chdir, since it might hang. -use Cwd 'cwd'; -use strict; - -## ----------- ## -## Variables. ## -## ----------- ## - -# $HELP -# ----- -$help = "Usage: $0 [OPTION] ... [CONFIGURE-AC or DIRECTORY] ... - -Install the GNU config.sub and config.guess scripts in the -DIRECTORIES or the directory trees driven by CONFIGURE-AC -(defaulting to `.'). - -Operation modes: - -h, --help print this help, then exit - -V, --version print version number, then exit - -v, --verbose verbosely report processing - -f, --force consider all files obsolete - -s, --symlink install symbolic links instead of copies - -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax] - -" . Autom4te::ChannelDefs::usage . " - -The environment variable \`WARNINGS\' is honored. Some subtools might -support other warning types, using \`all' is encouraged. -"; - -# $VERSION -# -------- -$version = "gnu-configize 1.0 - -Copyright (C) 2004 Chris Larson -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -"; - -my $configdir = '@gnu-configdir@'; -#'/home/kergoth/code/build-arm/tmp/staging/i686-linux/share/gnu-config'; -my $autoconf = $ENV{'AUTOCONF'} || 'autoconf'; - -# use symlinks instead. -my $symlink = 0; - -my $configure_ac; - -my $rm = "rm -f"; -my $ln_s = "ln -sf"; -my $cp = "cp -f"; -my $mkdir = "mkdir"; -my $chmod = "chmod"; - -## ---------- ## -## Routines. ## -## ---------- ## - - -# parse_args () -# ------------- -# Process any command line arguments. -sub parse_args () -{ - my $srcdir; - - getopt ('s|symlink' => \$symlink); - - # Even if the user specified a configure.ac, trim to get the - # directory, and look for configure.ac again. Because (i) the code - # is simpler, and (ii) we are still able to diagnose simultaneous - # presence of configure.ac and configure.in. - @ARGV = map { /configure\.(ac|in)$/ ? dirname ($_) : $_ } @ARGV; - push @ARGV, '.' unless @ARGV; -} - - -# &gnu_configize_current_directory -# ----------------------------- -sub gnu_configize_current_directory () -{ - my $configure_ac = require_configure_ac; - - # ---------------------- # - # Is it using Autoconf? # - # ---------------------- # - - my $uses_autoconf; - my $uses_gettext; - my $configure_ac_file = new Autom4te::XFile $configure_ac; - while ($_ = $configure_ac_file->getline) - { - s/#.*//; - s/dnl.*//; - $uses_autoconf = 1 if /AC_INIT/; - } - - if (!$uses_autoconf) - { - verb "$configure_ac: not using Autoconf"; - return; - } - - my $aux_dir; - my @subdir; - my $cmd; - my $dest; - - verb "$configure_ac: tracing"; - my $traces = new Autom4te::XFile - ("$autoconf" - . join (' --trace=', '', - # If you change this list, update the - # `Autoreconf-preselections' section of autom4te.in. - 'AC_CONFIG_AUX_DIR:AC_CONFIG_AUX_DIR:\$1', - 'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1', - 'AC_INIT', - ) - . ' |'); - while ($_ = $traces->getline) - { - $aux_dir = $1 if /AC_CONFIG_AUX_DIR:(.*)/; - $uses_autoconf = 1 if /AC_INIT/; - push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/; - } - - # The subdirs are *optional*, they may not exist. - foreach (@subdir) - { - if (-d) - { - verb "$configure_ac: subdirectory $_ to gnu-configize"; - gnu_configize ($_); - } - else - { - verb "$configure_ac: subdirectory $_ not present"; - } - } - - $dest = "."; - - if (defined $aux_dir) - { - $dest = $aux_dir; - if (! -d $aux_dir) - { - verb "$configure_ac: creating directory $aux_dir"; - mkdir $aux_dir - or error "cannot create $aux_dir: $!"; - } - } - - if (!$symlink) - { - $cmd = $cp; - } - else - { - $cmd = $ln_s; - } - - xsystem ("$cmd $configdir/config.guess $dest/"); - xsystem ("$chmod u+x $dest/config.guess"); - xsystem ("$cmd $configdir/config.sub $dest/"); - xsystem ("$chmod u+x $dest/config.sub"); -} - - -# &gnu_configize ($DIRECTORY) -# ------------------------ -# Reconf the $DIRECTORY. -sub gnu_configize ($) -{ - my ($directory) = @_; - my $cwd = cwd; - - # The format for this message is not free: taken from Emacs, itself - # using GNU Make's format. - verb "Entering directory `$directory'"; - chdir $directory - or error "cannot chdir to $directory: $!"; - - gnu_configize_current_directory; - - # The format is not free: taken from Emacs, itself using GNU Make's - # format. - verb "Leaving directory `$directory'"; - chdir $cwd - or error "cannot chdir to $cwd: $!"; -} - - -## ------ ## -## Main. ## -## ------ ## - -parse_args; - -# Autoreconf all the given configure.ac. A while loop, not a for, -# since the list can change at runtime because of AC_CONFIG_SUBDIRS. -for my $directory (@ARGV) - { - gnu_configize ($directory); - } - -### Setup "GNU" style for perl-mode and cperl-mode. -## Local Variables: -## perl-indent-level: 2 -## perl-continued-statement-offset: 2 -## perl-continued-brace-offset: 0 -## perl-brace-offset: 0 -## perl-brace-imaginary-offset: 0 -## perl-label-offset: -2 -## cperl-indent-level: 2 -## cperl-brace-offset: 0 -## cperl-continued-brace-offset: 0 -## cperl-label-offset: -2 -## cperl-extra-newline-before-brace: t -## cperl-merge-trailing-else: nil -## cperl-continued-statement-offset: 2 -## End: diff --git a/meta-openeuler/recipes-devtools/gnu-config/gnu-config_20120814.bb b/meta-openeuler/recipes-devtools/gnu-config/gnu-config_20120814.bb deleted file mode 100644 index c046c114ea720c1f43121e3a16008bbd136ecdd1..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/gnu-config/gnu-config_20120814.bb +++ /dev/null @@ -1,48 +0,0 @@ -SUMMARY = "gnu-configize" -DESCRIPTION = "Tool that installs the GNU config.guess / config.sub into a directory tree" -SECTION = "devel" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" - -DEPENDS_class-native = "hostperl-runtime-native" - -INHIBIT_DEFAULT_DEPS = "1" - -PR = "r0" - -SRC_URI = " \ - file://gnu-configize.in \ - file://config.guess \ - file://config.sub \ - " - -SRC_URI[md5sum] = "cdb56e9968c9a3674fe4ad8880665f78" -SRC_URI[sha256sum] = "b48543f72d717a8c07cf3b995175b3293c24dac9c9efad01b312321c0c809f07" - -do_compile() { - : -} - -do_configure[noexec] = "1" -do_compile[noexec] = "1" - -do_install () { - install -d ${D}${datadir}/gnu-config \ - ${D}${bindir} - cat ${WORKDIR}/gnu-configize.in | \ - sed -e 's,@gnu-configdir@,${datadir}/gnu-config,g' \ - -e 's,@autom4te_perllibdir@,/usr/share/autoconf,g' > ${D}${bindir}/gnu-configize - # In the native case we want the system perl as perl-native can't have built yet - if [ "${PN}" != "gnu-config-native" -a "${PN}" != "nativesdk-gnu-config" ]; then - sed -i -e 's,/usr/bin/env,${bindir}/env,g' ${D}${bindir}/gnu-configize - fi - chmod 500 ${D}${bindir}/gnu-configize - install -m 0644 "${WORKDIR}/config.guess" ${D}${datadir}/gnu-config/ - install -m 0644 "${WORKDIR}/config.sub" ${D}${datadir}/gnu-config/ - -} - -PACKAGES = "${PN}" -FILES_${PN} = "${bindir} ${datadir}/gnu-config" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-devtools/gnu-config/gnu-config_git.bb b/meta-openeuler/recipes-devtools/gnu-config/gnu-config_git.bb deleted file mode 100644 index 394a34a80f7946ee8ad12d7ef74498903ea66c13..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/gnu-config/gnu-config_git.bb +++ /dev/null @@ -1,41 +0,0 @@ -SUMMARY = "gnu-configize" -DESCRIPTION = "Tool that installs the GNU config.guess / config.sub into a directory tree" -SECTION = "devel" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://config.guess;endline=39;md5=0e6ca0501b27177f3bc640f7225e3ead" - -DEPENDS_class-native = "perl-native-runtime" - -INHIBIT_DEFAULT_DEPS = "1" - -SRCREV = "a47f842264fc19837f8a00eb1d2d254a4c527334" -PV = "1.0+git${SRCPV}" -PR = "r0" - -SRC_URI = "git://git.sv.gnu.org/config.git \ - file://gnu-configize.in" - -S = "${WORKDIR}/git" - -do_compile() { - : -} - -do_install () { - install -d ${D}${datadir}/gnu-config \ - ${D}${bindir} - cat ${WORKDIR}/gnu-configize.in | \ - sed -e 's,@gnu-configdir@,${datadir}/gnu-config,g' \ - -e 's,@autom4te_perllibdir@,${datadir}/autoconf,g' > ${D}${bindir}/gnu-configize - # In the native case we want the system perl as perl-native can't have built yet - if [ "${PN}" != "gnu-config-native" -a "${PN}" != "nativesdk-gnu-config" ]; then - sed -i -e 's,/usr/bin/env,${bindir}/env,g' ${D}${bindir}/gnu-configize - fi - chmod 500 ${D}${bindir}/gnu-configize - install -m 0644 config.guess config.sub ${D}${datadir}/gnu-config/ -} - -PACKAGES = "${PN}" -FILES_${PN} = "${bindir} ${datadir}/gnu-config" - -BBCLASSEXTEND = "native" diff --git a/meta-openeuler/recipes-devtools/intltool/intltool_%.bbappend b/meta-openeuler/recipes-devtools/intltool/intltool_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..83892d8ba40b4861472573df91ef93e3ec0d5dc5 --- /dev/null +++ b/meta-openeuler/recipes-devtools/intltool/intltool_%.bbappend @@ -0,0 +1,13 @@ +# main bbfile: yocto-poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb + +PV = "0.51.0" + +# conflict with intltool-perl5.26-regex-fixes.patch +SRC_URI_remove = "file://perl-522-deprecations.patch \ +" + +# apply openeuler patches +SRC_URI_prepend = "file://intltool-perl5.26-regex-fixes.patch \ + file://intltool-merge-Create-cache-file-atomically.patch \ + file://intltool_distcheck-fix.patch \ +" diff --git a/meta-openeuler/recipes-devtools/json-c/json-c_%.bbappend b/meta-openeuler/recipes-devtools/json-c/json-c_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..67a2aa99a0624ca323445dd8aab5c1ff62cf965d --- /dev/null +++ b/meta-openeuler/recipes-devtools/json-c/json-c_%.bbappend @@ -0,0 +1,19 @@ +# main bbfile: yocto-poky/meta/recipes-devtools/json-c/json-c_0.15.bb + +OPENEULER_SRC_URI_REMOVE = "https git http" + +# json-c version in openEuler +PV = "0.16-20220414" + +# apply patch +SRC_URI += " \ + file://json-c-${PV}.tar.gz \ + file://backport-Add-test-to-check-for-the-memory-leak-mentioned-in-issue-781.patch \ + file://backport-Fix-memory-leak-with-emtpy-strings-in-json_object_set_string.patch \ + file://backport-json_object_from_fd_ex-fail-if-file-is-too-large.patch \ + " + +SRC_URI[md5sum] = "4f3288a5f14e0e6abe914213f41234e0" +SRC_URI[sha256sum] = "3ecaeedffd99a60b1262819f9e60d7d983844073abc74e495cb822b251904185" + +S = "${WORKDIR}/json-c-json-c-0.16-20220414" diff --git a/meta-openeuler/recipes-devtools/lapack/lapack_%.bbappend b/meta-openeuler/recipes-devtools/lapack/lapack_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..628539d04bef82d3972535a19d26dd1be8c6cb93 --- /dev/null +++ b/meta-openeuler/recipes-devtools/lapack/lapack_%.bbappend @@ -0,0 +1,25 @@ +# main bbfile: yocto-meta-openembedded/meta-oe/recipes-devtools/lapack/lapack_3.9.0.bb + +OPENEULER_SRC_URI_REMOVE = "https git" +OPENEULER_REPO_NAME = "lapack" +OPENEULER_BRANCH = "master" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=39902829ba0c2cbac1b0debfb75a416b" + +# version in openEuler +PV = "3.10.0" +S = "${WORKDIR}/lapack-${PV}" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ +" +# files, patches that come from openeuler +SRC_URI_prepend = " \ + file://v${PV}.tar.gz \ + file://0001-fix-lapack-devel-build-error.patch \ + file://0002-Fix-out-of-bounds-read-in-slarrv.patch \ +" + +SRC_URI[md5sum] = "d70fc27a8bdebe00481c97c728184f09" +SRC_URI[sha256sum] = "328c1bea493a32cac5257d84157dc686cc3ab0b004e2bea22044e0a59f6f8a19" + diff --git a/meta-openeuler/recipes-devtools/libcomps/files/0002-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch b/meta-openeuler/recipes-devtools/libcomps/files/0002-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch new file mode 100644 index 0000000000000000000000000000000000000000..6cd052889a64814b7cf3b9fb4bdcfdc2b4681126 --- /dev/null +++ b/meta-openeuler/recipes-devtools/libcomps/files/0002-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch @@ -0,0 +1,27 @@ +From 32447a79e24f8e7e9e0150eb747f34116d63ef38 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Fri, 30 Dec 2016 18:22:09 +0200 +Subject: [PATCH 2/2] Do not set PYTHON_INSTALL_DIR by running python. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +--- + libcomps/src/python/src/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libcomps/src/python/src/CMakeLists.txt b/libcomps/src/python/src/CMakeLists.txt +index f813af4..9eebb6c 100644 +--- a/libcomps/src/python/src/CMakeLists.txt ++++ b/libcomps/src/python/src/CMakeLists.txt +@@ -85,7 +85,7 @@ IF (SKBUILD) + INSTALL(FILES libcomps/__init__.py DESTINATION libcomps/src/python/src/libcomps) + INSTALL(TARGETS pycomps LIBRARY DESTINATION libcomps/src/python/src/libcomps) + ELSE () +- EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from sysconfig import get_path; stdout.write(get_path('platlib'))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) ++ #EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from sysconfig import get_path; stdout.write(get_path('platlib'))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) + + INSTALL(FILES ${pycomps_SRCDIR}/libcomps/__init__.py DESTINATION ${PYTHON_INSTALL_DIR}/libcomps) + #INSTALL(FILES ${pycomps_SRCDIR}/tests/__test.py DESTINATION +-- +2.25.1 + diff --git a/meta-openeuler/recipes-devtools/libcomps/libcomps_%.bbappend b/meta-openeuler/recipes-devtools/libcomps/libcomps_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..8a9ee4f46651956a8dccd67f9df7b7fb6038281c --- /dev/null +++ b/meta-openeuler/recipes-devtools/libcomps/libcomps_%.bbappend @@ -0,0 +1,15 @@ +PV = "0.1.18" + +S = "${WORKDIR}/${BP}" + +SRC_URI = " \ + https://github.com/rpm-software-management/libcomps/archive/refs/tags/${PV}.tar.gz \ + " + +# patches from poky +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRC_URI += " \ + file://0002-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \ + " + +SRC_URI[sha256sum] = "02f8aa83dfd19beb7ce250b39818017a6eda7c3984caf8efbd2fc0c70d97bc9a" diff --git a/meta-openeuler/recipes-devtools/libdnf/files/0001-Add-WITH_TESTS-option.patch b/meta-openeuler/recipes-devtools/libdnf/files/0001-Add-WITH_TESTS-option.patch new file mode 100644 index 0000000000000000000000000000000000000000..607995a39495339f6cd153ae11dd53d3e92be7b5 --- /dev/null +++ b/meta-openeuler/recipes-devtools/libdnf/files/0001-Add-WITH_TESTS-option.patch @@ -0,0 +1,49 @@ +From 7d60d62b5c5374156703ca7262fb2f85ec5db119 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 6 Nov 2018 13:54:43 +0100 +Subject: [PATCH] Add WITH_TESTS option + +This makes a dependency on cppunit optional. + +Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/1382] +Signed-off-by: Alexander Kanavin + +--- + CMakeLists.txt | 3 +++ + python/hawkey/CMakeLists.txt | 2 ++ + 2 files changed, 5 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9c6e1b2f..8599c540 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,6 +33,7 @@ option(WITH_MAN "Enables hawkey man page generation" ON) + option(WITH_ZCHUNK "Build with zchunk support" ON) + option(ENABLE_RHSM_SUPPORT "Build with Red Hat Subscription Manager support?" OFF) + option(ENABLE_SOLV_URPMREORDER "Build with support for URPM-like solution reordering?" OFF) ++option(WITH_TESTS "Enables unit tests" ON) + + + # build options - debugging +@@ -179,8 +180,10 @@ endif() + + + # build tests ++IF (WITH_TESTS) + enable_testing() + add_subdirectory(tests) ++ENDIF() + if(WITH_BINDINGS) + add_subdirectory(python/hawkey) + endif() +diff --git a/python/hawkey/CMakeLists.txt b/python/hawkey/CMakeLists.txt +index d9645346..84d17204 100644 +--- a/python/hawkey/CMakeLists.txt ++++ b/python/hawkey/CMakeLists.txt +@@ -50,4 +50,6 @@ target_link_libraries(_hawkeymodule ${PYTHON_LIBRARY}) + install(FILES __init__.py DESTINATION ${PYTHON_INSTALL_DIR}/hawkey) + install(TARGETS _hawkeymodule LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}/hawkey) + ++IF (WITH_TESTS) + add_subdirectory(tests) ++ENDIF() diff --git a/meta-openeuler/recipes-devtools/libdnf/files/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch b/meta-openeuler/recipes-devtools/libdnf/files/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch new file mode 100644 index 0000000000000000000000000000000000000000..c7b2af89d18e97329c1146f54b7ad9b1524a8805 --- /dev/null +++ b/meta-openeuler/recipes-devtools/libdnf/files/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch @@ -0,0 +1,27 @@ +From 9294cd19e5e3121fb8d37b44ee82dd7c4b3ab2c7 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 7 Feb 2017 12:16:03 +0200 +Subject: [PATCH] Get parameters for both libsolv and libsolvext (libdnf is + + using both) + +Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/312] +Signed-off-by: Alexander Kanavin + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b722d4fb..ce88b9e3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -52,7 +52,7 @@ endif() + + # build dependencies + find_package(Gpgme REQUIRED) +-PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv) ++PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv libsolvext) + set(LIBSOLV_LIBRARY ${LIBSOLV_LIBRARIES}) + + diff --git a/meta-openeuler/recipes-devtools/libdnf/files/0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch b/meta-openeuler/recipes-devtools/libdnf/files/0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch new file mode 100644 index 0000000000000000000000000000000000000000..2d8213cc87f4713657aad4582b9d5603ca983c16 --- /dev/null +++ b/meta-openeuler/recipes-devtools/libdnf/files/0001-Look-fo-sphinx-only-if-documentation-is-actually-ena.patch @@ -0,0 +1,42 @@ +From b570c7f8bd089deec7da2b108aa789a27025a473 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 19 Nov 2019 13:46:09 +0100 +Subject: [PATCH] Look fo sphinx only if documentation is actually enabled + +Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/1383] +Signed-off-by: Alexander Kanavin +--- + docs/hawkey/CMakeLists.txt | 20 +++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + +diff --git a/docs/hawkey/CMakeLists.txt b/docs/hawkey/CMakeLists.txt +index 52cc35c6..63c7672f 100644 +--- a/docs/hawkey/CMakeLists.txt ++++ b/docs/hawkey/CMakeLists.txt +@@ -2,15 +2,17 @@ + # tell sphinx-build to do them both in one go: + + +-find_program(SPHINX_PROGRAM NAMES "sphinx-build-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") +-if(NOT EXISTS ${SPHINX_PROGRAM}) +- find_program(SPHINX_PROGRAM NAMES sphinx-build-${PYTHON_VERSION_MAJOR}) +-endif() +-if(NOT EXISTS ${SPHINX_PROGRAM}) +- find_program(SPHINX_PROGRAM NAMES sphinx-build) +-endif() +-if(NOT EXISTS ${SPHINX_PROGRAM}) +- message(FATAL_ERROR "Sphinx program not found." ) ++if (WITH_HTML OR WITH_MAN) ++ find_program(SPHINX_PROGRAM NAMES "sphinx-build-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") ++ if(NOT EXISTS ${SPHINX_PROGRAM}) ++ find_program(SPHINX_PROGRAM NAMES sphinx-build-${PYTHON_VERSION_MAJOR}) ++ endif() ++ if(NOT EXISTS ${SPHINX_PROGRAM}) ++ find_program(SPHINX_PROGRAM NAMES sphinx-build) ++ endif() ++ if(NOT EXISTS ${SPHINX_PROGRAM}) ++ message(FATAL_ERROR "Sphinx program not found." ) ++ endif() + endif() + + if(WITH_HTML) diff --git a/meta-openeuler/recipes-devtools/libdnf/files/0001-drop-FindPythonInstDir.cmake.patch b/meta-openeuler/recipes-devtools/libdnf/files/0001-drop-FindPythonInstDir.cmake.patch new file mode 100644 index 0000000000000000000000000000000000000000..d483dd410b34f91f47b5b1c88fd58ea5d474d354 --- /dev/null +++ b/meta-openeuler/recipes-devtools/libdnf/files/0001-drop-FindPythonInstDir.cmake.patch @@ -0,0 +1,42 @@ +From c0a465ccae395871ab10932975e37894220bc6a1 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Tue, 1 Jun 2021 10:23:59 +0800 +Subject: [PATCH] drop FindPythonInstDir.cmake + +Since commit [1] applied, PYTHON_INSTALL_DIR is not right +on nativesdk build +... +|Building for python3 +|-- Python install dir is +|tmp-glibc/work/x86_64-nativesdk-wrlinuxsdk-linux/nativesdk-libdnf/0.63.0-r0/ +recipe-sysroot-native/usr/lib/python3.9/site-packages +... + +Yocto manually set PYTHON_INSTALL_DIR from recipe, it is not +necessary to call FindPythonInstDir.cmake which will override +Yocto setting + +[1] https://github.com/rpm-software-management/libdnf/commit/f1cffbfb9f338da827e233c2d8ac3a25a6a59a69 + +Upstream-Status: Inappropriate [Yocto specific] + +Signed-off-by: Hongxu Jia +--- + cmake/modules/FindPythonInstDir.cmake | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/cmake/modules/FindPythonInstDir.cmake b/cmake/modules/FindPythonInstDir.cmake +index ed098ded..8b137891 100644 +--- a/cmake/modules/FindPythonInstDir.cmake ++++ b/cmake/modules/FindPythonInstDir.cmake +@@ -1,6 +1 @@ +-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c " +-from sys import stdout +-from sysconfig import get_path +-path=get_path(name='platlib', vars={'platbase':'${CMAKE_INSTALL_PREFIX}'}) +-stdout.write(path)" +-OUTPUT_VARIABLE PYTHON_INSTALL_DIR) ++ +-- +2.18.1 + diff --git a/meta-openeuler/recipes-devtools/libdnf/files/0001-libdnf-dnf-context.cpp-do-not-try-to-access-BDB-data.patch b/meta-openeuler/recipes-devtools/libdnf/files/0001-libdnf-dnf-context.cpp-do-not-try-to-access-BDB-data.patch new file mode 100644 index 0000000000000000000000000000000000000000..6f8a3dcb50ab6c2eb18c43f54f3b7649e22fe833 --- /dev/null +++ b/meta-openeuler/recipes-devtools/libdnf/files/0001-libdnf-dnf-context.cpp-do-not-try-to-access-BDB-data.patch @@ -0,0 +1,37 @@ +From 2f7382b35d59fe08034603497e82ffb943fedef1 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Wed, 30 Jun 2021 15:31:16 +0200 +Subject: [PATCH] libdnf/dnf-context.cpp: do not try to access BDB database + +Upstream-Status: Inappropriate [upstream needs to rework this to support +sqlite] +Signed-off-by: Alexander Kanavin +--- + libdnf/dnf-context.cpp | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp +index 86f71a79..9cdcf769 100644 +--- a/libdnf/dnf-context.cpp ++++ b/libdnf/dnf-context.cpp +@@ -2264,20 +2264,6 @@ dnf_context_setup(DnfContext *context, + !dnf_context_set_os_release(context, error)) + return FALSE; + +- /* setup a file monitor on the rpmdb, if we're operating on the native / */ +- if (g_strcmp0(priv->install_root, "/") == 0) { +- rpmdb_path = g_build_filename(priv->install_root, "var/lib/rpm/Packages", NULL); +- file_rpmdb = g_file_new_for_path(rpmdb_path); +- priv->monitor_rpmdb = g_file_monitor_file(file_rpmdb, +- G_FILE_MONITOR_NONE, +- NULL, +- error); +- if (priv->monitor_rpmdb == NULL) +- return FALSE; +- g_signal_connect(priv->monitor_rpmdb, "changed", +- G_CALLBACK(dnf_context_rpmdb_changed_cb), context); +- } +- + /* copy any vendor distributed cached metadata */ + if (!dnf_context_copy_vendor_cache(context, error)) + return FALSE; diff --git a/meta-openeuler/recipes-devtools/libdnf/files/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch b/meta-openeuler/recipes-devtools/libdnf/files/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch new file mode 100644 index 0000000000000000000000000000000000000000..643a5f37b6ad1e52d9b1c304a9159a70ce8310c8 --- /dev/null +++ b/meta-openeuler/recipes-devtools/libdnf/files/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch @@ -0,0 +1,28 @@ +From fbb181d25ad85778add7ed45b6aaf114e02d0f79 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Fri, 30 Dec 2016 18:24:50 +0200 +Subject: [PATCH] Set libsolv variables with pkg-config (cmake's own module + + doesn't work properly). + +Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/312] +Signed-off-by: Alexander Kanavin + +--- + CMakeLists.txt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 405dc4e8..53837448 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -52,7 +52,8 @@ endif() + + # build dependencies + find_package(Gpgme REQUIRED) +-find_package(LibSolv 0.7.21 REQUIRED COMPONENTS ext) ++PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv) ++set(LIBSOLV_LIBRARY ${LIBSOLV_LIBRARIES}) + + + # build dependencies via pkg-config diff --git a/meta-openeuler/recipes-devtools/libdnf/libdnf_%.bbappend b/meta-openeuler/recipes-devtools/libdnf/libdnf_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..9d1397274959dbdc4470188a3644b8a045548f94 --- /dev/null +++ b/meta-openeuler/recipes-devtools/libdnf/libdnf_%.bbappend @@ -0,0 +1,31 @@ +PV = "0.69.0" +#export CONFIG_SHELL="/bin/bash" + +# fix rpm install error, depends to /bin/bash +RDEPENDS_${PN} += "busybox" + +# add new patches from openeuler +SRC_URI = " \ + file://${BPN}-${PV}.tar.gz \ + file://backport-query-py-ensure-reldep-is-from-the-same-sack.patch \ + file://0001-libdnf-0.65.0-add-loongarch-support.patch \ +" + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRC_URI += " \ + file://0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch \ + file://0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch \ + file://0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch \ + file://enable_test_data_dir_set.patch \ + file://0001-drop-FindPythonInstDir.cmake.patch \ + file://0001-libdnf-dnf-context.cpp-do-not-try-to-access-BDB-data.patch \ + " + + + +SRC_URI[sha256sum] = "b615a6f7e1d1d82c928d2c79b36242a29d04cd28e267a5e8a6996435d9f97997" + +S = "${WORKDIR}/${BP}" + +# delete depends to prelink from gobject-introspection.bbclass +DEPENDS_remove_class-target = " prelink-native" diff --git a/meta-openeuler/recipes-devtools/libmodulemd/libmodulemd_%.bbappend b/meta-openeuler/recipes-devtools/libmodulemd/libmodulemd_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..636cccd740a80d53ca1fc03284e4994f0a67e94e --- /dev/null +++ b/meta-openeuler/recipes-devtools/libmodulemd/libmodulemd_%.bbappend @@ -0,0 +1,12 @@ +PV = "2.14.0" + +SRC_URI = " \ + https://github.com/fedora-modularity/libmodulemd/releases/download/libmodulemd-${PV}/modulemd-${PV}.tar.xz \ +" + +S = "${WORKDIR}/modulemd-${PV}" + +SRC_URI[sha256sum] = "8087942cc290c0df486931233446fb4bce786cd9ff92eb72384731cd4d36f6ef" + +# delete depends to prelink from gobject-introspection.bbclass +DEPENDS_remove_class-target = " prelink-native" diff --git a/meta-openeuler/recipes-devtools/librepo/files/0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch b/meta-openeuler/recipes-devtools/librepo/files/0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch new file mode 100644 index 0000000000000000000000000000000000000000..2ea50f00ffdc58c05d76248574716666d9c94418 --- /dev/null +++ b/meta-openeuler/recipes-devtools/librepo/files/0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch @@ -0,0 +1,38 @@ +From 82bd6d196a0453657cbacaaedd75b2d2fe0bf9ba Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Fri, 30 Dec 2016 18:05:36 +0200 +Subject: [PATCH] Do not try to obtain PYTHON_INSTALL_DIR by running python. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +Signed-off-by: Wang Mingyu +--- + librepo/python/CMakeLists.txt | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/librepo/python/CMakeLists.txt b/librepo/python/CMakeLists.txt +index 8523ca7..06e5f7b 100644 +--- a/librepo/python/CMakeLists.txt ++++ b/librepo/python/CMakeLists.txt +@@ -16,12 +16,12 @@ SET (librepomodule_SRCS + + MESSAGE("Building python bindings") + +-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c " +-from sys import stdout +-from sysconfig import get_path +-path=get_path(name='platlib', vars={'platbase':'${CMAKE_INSTALL_PREFIX}'}) +-stdout.write(path)" +-OUTPUT_VARIABLE PYTHON_INSTALL_DIR) ++#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c " ++#from sys import stdout ++#from sysconfig import get_path ++#path=get_path(name='platlib', vars={'platbase':'${CMAKE_INSTALL_PREFIX}'}) ++#stdout.write(path)" ++#OUTPUT_VARIABLE PYTHON_INSTALL_DIR) + INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH}) + + MESSAGE(STATUS "Python3 install dir is ${PYTHON_INSTALL_DIR}") +-- +2.25.1 + diff --git a/meta-openeuler/recipes-devtools/librepo/librepo_%.bbappend b/meta-openeuler/recipes-devtools/librepo/librepo_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..0e16d3fe9d036b31125a8f875acfe8e0f7d5de55 --- /dev/null +++ b/meta-openeuler/recipes-devtools/librepo/librepo_%.bbappend @@ -0,0 +1,16 @@ +PV = "1.14.5" + +S = "${WORKDIR}/${BP}" + +SRC_URI = " \ + https://github.com/rpm-software-management/librepo/archive/${PV}/${BPN}-${PV}.tar.gz \ + " + +# from poky +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRC_URI += " \ + file://0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch \ + file://0004-Set-gpgme-variables-with-pkg-config-not-with-cmake-m.patch \ + " + +SRC_URI[sha256sum] = "6fb7dbbcfa48e333633beabf830d75f20b347ae5b9734ffde3164fef8d093391" diff --git a/meta-openeuler/recipes-devtools/libtool/files/fix-resolve-lt-sysroot.patch b/meta-openeuler/recipes-devtools/libtool/files/fix-resolve-lt-sysroot.patch new file mode 100644 index 0000000000000000000000000000000000000000..348dd0c347ea6e651689d347b768441350104c7c --- /dev/null +++ b/meta-openeuler/recipes-devtools/libtool/files/fix-resolve-lt-sysroot.patch @@ -0,0 +1,41 @@ +Upstream-Status: Pending + +This patch updates libtool.m4 (and its output) to resolve a problem +with variable 'lt_sysroot' not being properly updated if the option +'--with[-libtool]-sysroot' is not provided when running the 'configure' +script for a package. + +I have also reported the problem to libtool here + +http://lists.gnu.org/archive/html/bug-libtool/2013-09/msg00005.html + +Signed-off-by: Hans Beckerus +Updated by: Robert Yang +--- +diff --git a/m4/libtool.m4 b/m4/libtool.m4 +--- a/m4/libtool.m4 ++++ b/m4/libtool.m4 +@@ -1254,16 +1254,20 @@ dnl lt_sysroot will always be passed unq + dnl in case the user passed a directory name. + lt_sysroot= + case $with_libtool_sysroot in #( +- yes) ++ no) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` ++ # Treat "/" the same a an unset sysroot. ++ if test "$lt_sysroot" = /; then ++ lt_sysroot= ++ fi + fi + ;; #( ++ yes|''|/) ++ ;; #( + /*) + lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"` + ;; #( +- no|'') +- ;; #( + *) + AC_MSG_RESULT([$with_libtool_sysroot]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) diff --git a/meta-openeuler/recipes-devtools/libtool/files/rename-with-sysroot.patch b/meta-openeuler/recipes-devtools/libtool/files/rename-with-sysroot.patch new file mode 100644 index 0000000000000000000000000000000000000000..c9c20cd2e7cccb134d3cbf4432775b83762768f9 --- /dev/null +++ b/meta-openeuler/recipes-devtools/libtool/files/rename-with-sysroot.patch @@ -0,0 +1,166 @@ +Upstream-Status: Pending + +This patch renames the --with-sysroot option to --with-libtool-sysroot +to avoid namespace conflict with binutils, gcc and other toolchain +components. + +I also reported the problem to libtool here + +http://lists.gnu.org/archive/html/libtool/2010-10/msg00048.html + +-Khem Raj + +Updated by: Robert Yang + +diff --git a/m4/libtool.m4 b/m4/libtool.m4 +--- a/m4/libtool.m4 ++++ b/m4/libtool.m4 +@@ -1244,28 +1244,28 @@ _LT_DECL([], [ECHO], [1], [An echo progr + AC_DEFUN([_LT_WITH_SYSROOT], + [m4_require([_LT_DECL_SED])dnl + AC_MSG_CHECKING([for sysroot]) +-AC_ARG_WITH([sysroot], +-[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], ++AC_ARG_WITH([libtool-sysroot], ++[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], +-[], [with_sysroot=no]) ++[], [with_libtool_sysroot=no]) + + dnl lt_sysroot will always be passed unquoted. We quote it here + dnl in case the user passed a directory name. + lt_sysroot= +-case $with_sysroot in #( ++case $with_libtool_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) +- lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ++ lt_sysroot=`echo "$with_libtool_sysroot" | $SED -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) +- AC_MSG_RESULT([$with_sysroot]) ++ AC_MSG_RESULT([$with_libtool_sysroot]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; + esac +diff --git a/tests/sysroot.at b/tests/sysroot.at +--- a/tests/sysroot.at ++++ b/tests/sysroot.at +@@ -64,7 +64,7 @@ while read file; do + done]) + + LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" +-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" ++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" + + #??? + if test PATH = "$shlibpath_var"; then +@@ -114,7 +114,7 @@ AM_INIT_AUTOMAKE([foreign]) + AC_PROG_CC + AC_CONFIG_SRCDIR([lib2.c]) + LT_INIT +-sysroot=$with_sysroot ++sysroot=$with_libtool_sysroot + AC_SUBST([sysroot]) + AC_OUTPUT(Makefile) + ]]) +@@ -155,7 +155,7 @@ AM_INIT_AUTOMAKE([foreign]) + AC_PROG_CC + AC_CONFIG_SRCDIR([prog.c]) + LT_INIT +-sysroot=$with_sysroot ++sysroot=$with_libtool_sysroot + AC_SUBST([sysroot]) + AC_OUTPUT(Makefile) + ]]) +diff --git a/tests/testsuite b/tests/testsuite +--- a/tests/testsuite ++++ b/tests/testsuite +@@ -48945,7 +48945,7 @@ $at_traceon; } + + + LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" +-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" ++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" + + #??? + if test PATH = "$shlibpath_var"; then +@@ -49154,7 +49154,7 @@ AM_INIT_AUTOMAKE([foreign]) + AC_PROG_CC + AC_CONFIG_SRCDIR([lib2.c]) + LT_INIT +-sysroot=$with_sysroot ++sysroot=$with_libtool_sysroot + AC_SUBST([sysroot]) + AC_OUTPUT(Makefile) + _ATEOF +@@ -49342,7 +49342,7 @@ AM_INIT_AUTOMAKE([foreign]) + AC_PROG_CC + AC_CONFIG_SRCDIR([prog.c]) + LT_INIT +-sysroot=$with_sysroot ++sysroot=$with_libtool_sysroot + AC_SUBST([sysroot]) + AC_OUTPUT(Makefile) + _ATEOF +@@ -49694,7 +49694,7 @@ $at_traceon; } + + + LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" +-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" ++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" + + #??? + if test PATH = "$shlibpath_var"; then +@@ -49903,7 +49903,7 @@ AM_INIT_AUTOMAKE([foreign]) + AC_PROG_CC + AC_CONFIG_SRCDIR([lib2.c]) + LT_INIT +-sysroot=$with_sysroot ++sysroot=$with_libtool_sysroot + AC_SUBST([sysroot]) + AC_OUTPUT(Makefile) + _ATEOF +@@ -50091,7 +50091,7 @@ AM_INIT_AUTOMAKE([foreign]) + AC_PROG_CC + AC_CONFIG_SRCDIR([prog.c]) + LT_INIT +-sysroot=$with_sysroot ++sysroot=$with_libtool_sysroot + AC_SUBST([sysroot]) + AC_OUTPUT(Makefile) + _ATEOF +@@ -50443,7 +50443,7 @@ $at_traceon; } + + + LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined" +-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix" ++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix" + + #??? + if test PATH = "$shlibpath_var"; then +@@ -50652,7 +50652,7 @@ AM_INIT_AUTOMAKE([foreign]) + AC_PROG_CC + AC_CONFIG_SRCDIR([lib2.c]) + LT_INIT +-sysroot=$with_sysroot ++sysroot=$with_libtool_sysroot + AC_SUBST([sysroot]) + AC_OUTPUT(Makefile) + _ATEOF +@@ -50840,7 +50840,7 @@ AM_INIT_AUTOMAKE([foreign]) + AC_PROG_CC + AC_CONFIG_SRCDIR([prog.c]) + LT_INIT +-sysroot=$with_sysroot ++sysroot=$with_libtool_sysroot + AC_SUBST([sysroot]) + AC_OUTPUT(Makefile) + _ATEOF diff --git a/meta-openeuler/recipes-devtools/libtool/libtool-cross_%.bbappend b/meta-openeuler/recipes-devtools/libtool/libtool-cross_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..be96ca34be93e272a2918ea31560d1f6d12eb527 --- /dev/null +++ b/meta-openeuler/recipes-devtools/libtool/libtool-cross_%.bbappend @@ -0,0 +1,17 @@ +# main bbfile: yocto-poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb + +OPENEULER_BRANCH = "master" + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PV = "2.4.7" + +SRC_URI_remove = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \ + file://unwind-opt-parsing.patch \ +" + +# apply openeuler source package and patches +SRC_URI_prepend = " \ + file://libtool-${PV}.tar.xz \ + file://libtool-2.4.5-rpath.patch \ +" diff --git a/meta-openeuler/recipes-devtools/m4/m4_%.bbappend b/meta-openeuler/recipes-devtools/m4/m4_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ece9546c5076c4395de729ad9636099b5d8dfae2 --- /dev/null +++ b/meta-openeuler/recipes-devtools/m4/m4_%.bbappend @@ -0,0 +1,28 @@ +PV = "1.4.19" + +# AN_GNU_GETTEXT is used, need to inherit gettext +inherit gettext + +SRC_URI[md5sum] = "0d90823e1426f1da2fd872df0311298d" +SRC_URI[sha256sum] = "63aede5c6d33b6d9b13511cd0be2cac046f2e70fd0a07aa9573a04a82783af96" + +LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464\ + file://examples/COPYING;md5=4031593b2166d6c47cae282d944a7ede" + + +# remove tar.gz files and code patches from poky +SRC_URI_remove = " \ + ${GNU_MIRROR}/m4/m4-${PV}.tar.gz \ + file://ac_config_links.patch \ + file://m4-1.4.18-glibc-change-work-around.patch \ + file://0001-c-stack-stop-using-SIGSTKSZ.patch \ + file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ + file://serial-tests-config.patch \ + file://0001-test-getopt-posix-fix.patch \ +" + +# append files and patches from openeuler +SRC_URI_append = " \ + file://m4/m4-${PV}.tar.xz \ + file://0001-Delete-test-execute_sh.patch \ +" diff --git a/meta-openeuler/recipes-devtools/meson/files/0001-Check-for-clang-before-guessing-gcc-or-lcc.patch b/meta-openeuler/recipes-devtools/meson/files/0001-Check-for-clang-before-guessing-gcc-or-lcc.patch new file mode 100644 index 0000000000000000000000000000000000000000..58fa1194398e0e10ba5320e78411bc87e8e58cd0 --- /dev/null +++ b/meta-openeuler/recipes-devtools/meson/files/0001-Check-for-clang-before-guessing-gcc-or-lcc.patch @@ -0,0 +1,56 @@ +From 8739e1c3bef653415ad4b9b9c318ccfa76c43da6 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 31 Mar 2022 15:00:24 -0700 +Subject: [PATCH] Check for clang before guessing gcc or lcc + +clang --version can yield a string like below when its installed into +such a directory + +clang version 14.0.0 (https://github.com/llvm/llvm-project 3f43d803382d57e3fc010ca19833077d1023e9c9) +Target: aarch64-yoe-linux +Thread model: posix +InstalledDir: /mnt/b/yoe/master/build/tmp/work/cortexa72-yoe-linux/gnome-text-editor/42.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux + +as you can see InstallDir has 'xt-' subtring and this trips the check to +guess gcc + +if 'Free Software Foundation' in out or 'xt-' in out: + +Therefore, check if compiler is clang then there is no point of running +this check anyway. + +Upstream-Status: Submitted [https://github.com/mesonbuild/meson/pull/10218] +Signed-off-by: Khem Raj +--- + mesonbuild/compilers/detect.py | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py +index 53948b01a..ba335cf39 100644 +--- a/mesonbuild/compilers/detect.py ++++ b/mesonbuild/compilers/detect.py +@@ -427,13 +427,14 @@ def _detect_c_or_cpp_compiler(env: 'Environment', lang: str, for_machine: Machin + version = search_version(out) + + guess_gcc_or_lcc: T.Optional[str] = None +- if 'Free Software Foundation' in out or 'xt-' in out: +- guess_gcc_or_lcc = 'gcc' +- if 'e2k' in out and 'lcc' in out: +- guess_gcc_or_lcc = 'lcc' +- if 'Microchip Technology' in out: +- # this output has "Free Software Foundation" in its version +- guess_gcc_or_lcc = None ++ if not 'clang' in compiler_name: ++ if 'Free Software Foundation' in out or 'xt-' in out: ++ guess_gcc_or_lcc = 'gcc' ++ if 'e2k' in out and 'lcc' in out: ++ guess_gcc_or_lcc = 'lcc' ++ if 'Microchip Technology' in out: ++ # this output has "Free Software Foundation" in its version ++ guess_gcc_or_lcc = None + + if guess_gcc_or_lcc: + defines = _get_gnu_compiler_defines(compiler) +-- +2.35.1 + diff --git a/meta-openeuler/recipes-devtools/meson/files/0001-Make-CPU-family-warnings-fatal.patch b/meta-openeuler/recipes-devtools/meson/files/0001-Make-CPU-family-warnings-fatal.patch new file mode 100644 index 0000000000000000000000000000000000000000..848dccfbe72cf9bfc3b6ff193e884a257960385b --- /dev/null +++ b/meta-openeuler/recipes-devtools/meson/files/0001-Make-CPU-family-warnings-fatal.patch @@ -0,0 +1,45 @@ +From 6c4eef1d92e9e42fdbc888365cab3c95fb33c605 Mon Sep 17 00:00:00 2001 +From: Ross Burton +Date: Tue, 3 Jul 2018 13:59:09 +0100 +Subject: [PATCH] Make CPU family warnings fatal + +Upstream-Status: Inappropriate [OE specific] +Signed-off-by: Ross Burton + +--- + mesonbuild/envconfig.py | 2 +- + mesonbuild/environment.py | 4 +--- + 2 files changed, 2 insertions(+), 4 deletions(-) + +Index: meson-0.60.2/mesonbuild/envconfig.py +=================================================================== +--- meson-0.60.2.orig/mesonbuild/envconfig.py ++++ meson-0.60.2/mesonbuild/envconfig.py +@@ -266,8 +266,8 @@ class MachineInfo(HoldableObject): + 'but is missing {}.'.format(minimum_literal - set(literal))) + + cpu_family = literal['cpu_family'] +- if cpu_family not in known_cpu_families: +- mlog.warning(f'Unknown CPU family {cpu_family}, please report this at https://github.com/mesonbuild/meson/issues/new') ++ if cpu_family not in known_cpu_families and cpu_family != "riscv": ++ raise EnvironmentException('Unknown CPU family {}, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.'.format(cpu_family)) + + endian = literal['endian'] + if endian not in ('little', 'big'): +Index: meson-0.60.2/mesonbuild/environment.py +=================================================================== +--- meson-0.60.2.orig/mesonbuild/environment.py ++++ meson-0.60.2/mesonbuild/environment.py +@@ -354,10 +354,8 @@ def detect_cpu_family(compilers: Compile + if any_compiler_has_define(compilers, '__64BIT__'): + trial = 'ppc64' + +- if trial not in known_cpu_families: +- mlog.warning(f'Unknown CPU family {trial!r}, please report this at ' +- 'https://github.com/mesonbuild/meson/issues/new with the ' +- 'output of `uname -a` and `cat /proc/cpuinfo`') ++ if trial not in known_cpu_families and trail != "riscv": ++ raise EnvironmentException('Unknown CPU family %s, see https://wiki.yoctoproject.org/wiki/Meson/UnknownCPU for directions.' % trial) + + return trial + diff --git a/meta-openeuler/recipes-devtools/meson/files/0001-is_debianlike-always-return-False.patch b/meta-openeuler/recipes-devtools/meson/files/0001-is_debianlike-always-return-False.patch new file mode 100644 index 0000000000000000000000000000000000000000..83c4782a61cc8831e0c694339bdaaa7197033be5 --- /dev/null +++ b/meta-openeuler/recipes-devtools/meson/files/0001-is_debianlike-always-return-False.patch @@ -0,0 +1,26 @@ +From 667b9ede638677fb37911306937ea62f05897581 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Mon, 18 Oct 2021 15:55:59 +0200 +Subject: [PATCH] is_debianlike(): always return False + +Otherwise, host contamination happens. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +--- + mesonbuild/mesonlib/universal.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py +index d670d04..47d1b52 100644 +--- a/mesonbuild/mesonlib/universal.py ++++ b/mesonbuild/mesonlib/universal.py +@@ -651,7 +651,7 @@ def is_cygwin() -> bool: + + + def is_debianlike() -> bool: +- return os.path.isfile('/etc/debian_version') ++ return False + + + def is_dragonflybsd() -> bool: diff --git a/meta-openeuler/recipes-devtools/meson/files/0001-python-module-do-not-manipulate-the-environment-when.patch b/meta-openeuler/recipes-devtools/meson/files/0001-python-module-do-not-manipulate-the-environment-when.patch new file mode 100644 index 0000000000000000000000000000000000000000..86abfa9d529bec2288c84f897505a930c7ab9233 --- /dev/null +++ b/meta-openeuler/recipes-devtools/meson/files/0001-python-module-do-not-manipulate-the-environment-when.patch @@ -0,0 +1,38 @@ +From dd5b4a200cd2fdf7fef627c4b6752f90c00b863a Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Mon, 19 Nov 2018 14:24:26 +0100 +Subject: [PATCH] python module: do not manipulate the environment when calling + pkg-config + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin + +--- + mesonbuild/modules/python.py | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py +index f479ab9..b934bc6 100644 +--- a/mesonbuild/modules/python.py ++++ b/mesonbuild/modules/python.py +@@ -239,10 +239,6 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', + # If python-X.Y.pc exists in LIBPC, we will try to use it + def wrap_in_pythons_pc_dir(name: str, env: 'Environment', kwargs: T.Dict[str, T.Any], + installation: 'PythonInstallation') -> 'ExternalDependency': +- old_pkg_libdir = os.environ.pop('PKG_CONFIG_LIBDIR', None) +- old_pkg_path = os.environ.pop('PKG_CONFIG_PATH', None) +- if pkg_libdir: +- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir + try: + return PythonPkgConfigDependency(name, env, kwargs, installation) + finally: +@@ -251,8 +247,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', + os.environ[name] = value + elif name in os.environ: + del os.environ[name] +- set_env('PKG_CONFIG_LIBDIR', old_pkg_libdir) +- set_env('PKG_CONFIG_PATH', old_pkg_path) ++ pass + + candidates.extend([ + functools.partial(wrap_in_pythons_pc_dir, pkg_name, env, kwargs, installation), diff --git a/meta-openeuler/recipes-devtools/meson/files/disable-rpath-handling.patch b/meta-openeuler/recipes-devtools/meson/files/disable-rpath-handling.patch new file mode 100644 index 0000000000000000000000000000000000000000..7aaed8b4a3865aac75ab9fbfacf69e9ebba50e60 --- /dev/null +++ b/meta-openeuler/recipes-devtools/meson/files/disable-rpath-handling.patch @@ -0,0 +1,37 @@ +From 18600f7a1cddf23aeabd188f86e66983f27ccfe3 Mon Sep 17 00:00:00 2001 +From: Richard Purdie +Date: Fri, 23 Nov 2018 15:28:28 +0000 +Subject: [PATCH] meson: Disable rpath stripping at install time + +We need to allow our rpaths generated through the compiler flags to make it into +our binaries. Therefore disable the meson manipulations of these unless there +is a specific directive to do something differently in the project. + +RP 2018/11/23 + +Upstream-Status: Submitted [https://github.com/mesonbuild/meson/issues/2567] +--- + mesonbuild/minstall.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py +index 7d0da13..17d50db 100644 +--- a/mesonbuild/minstall.py ++++ b/mesonbuild/minstall.py +@@ -718,8 +718,11 @@ class Installer: + if file_copied: + self.did_install_something = True + try: +- self.fix_rpath(outname, t.rpath_dirs_to_remove, install_rpath, final_path, +- install_name_mappings, verbose=False) ++ if install_rpath: ++ self.fix_rpath(outname, t.rpath_dirs_to_remove, install_rpath, final_path, ++ install_name_mappings, verbose=False) ++ else: ++ print("RPATH changes at install time disabled") + except SystemExit as e: + if isinstance(e.code, int) and e.code == 0: + pass +-- +2.20.1 + diff --git a/meta-openeuler/recipes-devtools/meson/meson_%.bbappend b/meta-openeuler/recipes-devtools/meson/meson_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..cf1de12610b9c10b53b2d80d5d879bb2e419c1d6 --- /dev/null +++ b/meta-openeuler/recipes-devtools/meson/meson_%.bbappend @@ -0,0 +1,8 @@ +PV = "0.63.2" + +SRC_URI[sha256sum] = "16222f17ef76be0542c91c07994f9676ae879f46fc21c0c786a21ef2cb518bbf" + +# add patches from new poky under meta-openeluer +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz \ + " diff --git a/meta-openeuler/recipes-devtools/mtd/mtd-utils_%.bbappend b/meta-openeuler/recipes-devtools/mtd/mtd-utils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3d30b6d1b334a78427e707b2eb32c37130737dfd --- /dev/null +++ b/meta-openeuler/recipes-devtools/mtd/mtd-utils_%.bbappend @@ -0,0 +1,13 @@ +# main bb file: yocto-poky/meta/recipes-devtools/mtd/mtd-utils_git.bb + +PV = "2.1.4" + +SRC_URI_remove = "git://git.infradead.org/mtd-utils.git;branch=master" + +SRC_URI_prepend = "file://${BP}.tar.bz2 \ + " +OPENEULER_BRANCH = "openEuler-22.03-LTS" + +S = "${WORKDIR}/${BP}" + +EXTRA_OECONF_remove = "--enable-install-tests" diff --git a/meta-openeuler/recipes-devtools/nasm/nasm_%.bbappend b/meta-openeuler/recipes-devtools/nasm/nasm_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b23a044b9a4d105f65ac75e1c470565b494bb00a --- /dev/null +++ b/meta-openeuler/recipes-devtools/nasm/nasm_%.bbappend @@ -0,0 +1,7 @@ +# main bbfile: yocto-poky/meta/recipes-devtools/nasm/nasm_2.15.05.bb + +# files, patches that come from openeuler +SRC_URI_prepend = " \ + file://enable-make-check.patch \ + file://fix-help-info-error.patch \ +" diff --git a/meta-openeuler/recipes-devtools/opkg-utils/opkg-utils_%.bbappend b/meta-openeuler/recipes-devtools/opkg-utils/opkg-utils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3ccc35d57dc39f021c4caddec6eb6f4da2cf1589 --- /dev/null +++ b/meta-openeuler/recipes-devtools/opkg-utils/opkg-utils_%.bbappend @@ -0,0 +1,10 @@ +# acl version in openEuler +PV = "0.5.0" + +OPENEULER_REPO_NAME = "yocto-opkg-utils" + +# currently, openeuler_embedded only supports update-alternatives, no python +PACKAGECONFIG = "update-alternatives" + +SRC_URI[md5sum] = "c71939ee02c69462bd3ba1fe0d6de5e2" +SRC_URI[sha256sum] = "55733c0f8ffde2bb4f9593cfd66a1f68e6a2f814e8e62f6fd78472911c818c32" diff --git a/meta-openeuler/recipes-devtools/perl-cross/files/0001-Makefile-check-the-file-if-patched-or-not.patch b/meta-openeuler/recipes-devtools/perl-cross/files/0001-Makefile-check-the-file-if-patched-or-not.patch new file mode 100644 index 0000000000000000000000000000000000000000..8c8f3b717c87add9acc01bbbdc83847721a56a24 --- /dev/null +++ b/meta-openeuler/recipes-devtools/perl-cross/files/0001-Makefile-check-the-file-if-patched-or-not.patch @@ -0,0 +1,31 @@ +From 24a3e0c48f9ebe473b5f1078663e275c27d0537f Mon Sep 17 00:00:00 2001 +From: Mingli Yu +Date: Fri, 2 Jul 2021 09:08:21 +0000 +Subject: [PATCH] Makefile: check the file if patched or not + +Check the file if patched or not to avoid patched more than +one time. + +Upstream-Status: Inappropriate (OE-specific) + +Signed-off-by: Mingli Yu +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index f4a26f5..7bc748e 100644 +--- a/Makefile ++++ b/Makefile +@@ -61,7 +61,7 @@ miniperlmain$O: $(CROSSPATCHED) + # Original versions are not saved anymore; patch generally takes care of this, + # and if that fails, reaching for the source tarball is the safest option. + $(CROSSPATCHED): %.applied: %.patch +- patch -p1 -i $< && touch $@ ++ test ! -f $@ && (patch -p1 -i $< && touch $@) || echo "$@ exist" + + # ---[ common ]----------------------------------------------------------------- + +-- +2.29.2 + diff --git a/meta-openeuler/recipes-devtools/perl-cross/files/0001-Makefile-correctly-list-modules-when-cleaning-them.patch b/meta-openeuler/recipes-devtools/perl-cross/files/0001-Makefile-correctly-list-modules-when-cleaning-them.patch new file mode 100644 index 0000000000000000000000000000000000000000..80388fa9b0f4dd7a585a9b23cdbe8655e9fc81ff --- /dev/null +++ b/meta-openeuler/recipes-devtools/perl-cross/files/0001-Makefile-correctly-list-modules-when-cleaning-them.patch @@ -0,0 +1,24 @@ +From 7b8d819e012c24df228a313beb86e1942611c904 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Sat, 4 Jun 2022 13:00:12 +0200 +Subject: [PATCH] Makefile: correctly list modules when cleaning them + +Upstream-Status: Submitted [https://github.com/arsv/perl-cross/pull/133] +Signed-off-by: Alexander Kanavin +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 6b35fb0..9ef9324 100644 +--- a/Makefile ++++ b/Makefile +@@ -462,7 +462,7 @@ clean-subdirs: + + # assuming modules w/o Makefiles were never built and need no cleaning + clean-modules: config.h +- @for i in $(modules disabled); do \ ++ @for i in $(modules) $(disabled); do \ + test -f $$i/Makefile && \ + touch $$i/Makefile && \ + $(MAKE) -C $$i clean \ diff --git a/meta-openeuler/recipes-devtools/perl-cross/files/0001-Makefile-do-not-clean-config.h-xconfig.h.patch b/meta-openeuler/recipes-devtools/perl-cross/files/0001-Makefile-do-not-clean-config.h-xconfig.h.patch new file mode 100644 index 0000000000000000000000000000000000000000..cbb935c71b786ef4567af5ecf4c2fe74e433e39f --- /dev/null +++ b/meta-openeuler/recipes-devtools/perl-cross/files/0001-Makefile-do-not-clean-config.h-xconfig.h.patch @@ -0,0 +1,28 @@ +From ade4a70308d3b9d79cc3db841c0f60385780fe1a Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Sat, 4 Jun 2022 13:45:20 +0200 +Subject: [PATCH] Makefile: do not clean config.h/xconfig.h + +These are generated by ./configure and not by make. + +Upstream-Status: Submitted [https://github.com/arsv/perl-cross/pull/134] +Signed-off-by: Alexander Kanavin +--- + Makefile | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 9ef9324..3de2c2e 100644 +--- a/Makefile ++++ b/Makefile +@@ -473,7 +473,6 @@ clean-generated-files: + -rm -f uudmap.h opmini.c generate_uudmap$X bitcount.h $(CONFIGPM) + -rm -f git_version.h lib/re.pm lib/Config_git.pl + -rm -f perlmini.c perlmain.c +- -rm -f config.h xconfig.h + -rm -f pod/perlmodlib.pod + -rm -f ext.libs static.list + -rm -f $(patsubst %,%/ppport.h,$(mkppport_lst)) +-- +2.30.2 + diff --git a/meta-openeuler/recipes-devtools/perl-cross/files/0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch b/meta-openeuler/recipes-devtools/perl-cross/files/0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch new file mode 100644 index 0000000000000000000000000000000000000000..6c3f08c4324ab6accb98ed14336727b5d8fa07f6 --- /dev/null +++ b/meta-openeuler/recipes-devtools/perl-cross/files/0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch @@ -0,0 +1,27 @@ +From f824cbec9ac8f113a4ae35d57bd18625d415a71b Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 27 Nov 2018 15:37:40 +0100 +Subject: [PATCH] perl-cross: add LDFLAGS when linking libperl + +Upstream-Status: Submitted [https://github.com/arsv/perl-cross/pull/122] +Signed-off-by: Alexander Kanavin +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 01644cd..be811a7 100644 +--- a/Makefile ++++ b/Makefile +@@ -180,7 +180,7 @@ endif + + ifeq ($(useshrplib),true) + $(LIBPERL): +- $(CC) $(LDDLFLAGS) -o $@ $(filter %$o,$^) $(LIBS) ++ $(CC) $(LDFLAGS) $(LDDLFLAGS) -o $@ $(filter %$o,$^) $(LIBS) + else + $(LIBPERL): + $(AR) cru $@ $(filter %$o,$^) +-- +2.17.1 + diff --git a/meta-openeuler/recipes-devtools/perl-cross/files/README.md b/meta-openeuler/recipes-devtools/perl-cross/files/README.md new file mode 100644 index 0000000000000000000000000000000000000000..93217245c88ae9e8c027c2b0f1a3b54ddc139e0f --- /dev/null +++ b/meta-openeuler/recipes-devtools/perl-cross/files/README.md @@ -0,0 +1,29 @@ +**perl-cross** provides configure script, top-level Makefile +and some auxiliary files for [perl](http://www.perl.org), +with the primary emphasis on cross-compiling the source. + + # Get perl and perl-cross sources + curl -L -O http://www.cpan.org/src/5.0/perl-5.24.1.tar.gz + curl -L -O https://github.com/arsv/perl-cross/releases/download/1.1.3/perl-cross-1.1.3.tar.gz + + # Unpack perl-cross over perl, overwriting Makefile + tar -zxf perl-5.24.1.tar.gz + cd perl-5.24.1 + tar --strip-components=1 -zxf ../perl-cross-1.1.3.tar.gz + + # Proceed as usual with most autoconfed packages + ./configure --target=arm-linux-gnueabi --prefix=/usr -Duseshrplib + make -j4 + make DESTDIR=/path/to/staging/dir install + +Unlike mainline Perl, this configure never runs any target executables, +relying solely on compile/link tests and pre-defined hints. +On the flip side, it is only meant to run on resonably sane modern unix systems. + +Check [project pages](http://arsv.github.io/perl-cross/) for more info. +In particular, [configure usage](http://arsv.github.io/perl-cross/usage.html) +lists available configure options. + +Perl-cross is a free software licensed under the same terms +as the original perl source. +See LICENSE, Copying and Artistic files. diff --git a/meta-openeuler/recipes-devtools/perl-cross/files/determinism.patch b/meta-openeuler/recipes-devtools/perl-cross/files/determinism.patch new file mode 100644 index 0000000000000000000000000000000000000000..e9bf752bcb64477c9efe9b8e7074569138940893 --- /dev/null +++ b/meta-openeuler/recipes-devtools/perl-cross/files/determinism.patch @@ -0,0 +1,46 @@ +Fixes to make the perl build reproducible: + +a) Remove the \n from configure_attr.sh since it gets quoted differently depending on + whether the shell is bash or dash which can cause the test result to be incorrect. + Reported upstream: https://github.com/arsv/perl-cross/issues/87 + +b) Sort the order of the module lists from configure_mods.sh since otherwise + the result isn't the same leading to makefile differences. + Reported upstream: https://github.com/arsv/perl-cross/issues/88 + +c) Sort the Encode::Byte byte_t.fnm file output (and the makefile depends whilst + there for good measure) + This needs to go to upstream perl (not done) + +d) Use bash for perl-cross configure since otherwise trnl gets set to "\n" with bash + and "" with dash + Reported upstream: https://github.com/arsv/perl-cross/issues/87 + +RP 2020/2/7 + +Upstream-Status: Pending [75% submitted] +Signed-off-by: Richard Purdie = 34.4', 'setuptools_scm >= 3.0'] ++SETUP_REQUIRES = ['setuptools >= 34.4', ] + + INSTALL_REQUIRES = [ + 'attrs >= 16.3.0', diff --git a/meta-openeuler/recipes-devtools/python/python3-cmd2_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-cmd2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ba09733fce141f42435546e8dec076084a9a491a --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-cmd2_%.bbappend @@ -0,0 +1,14 @@ +PV = "2.4.2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=209e288518b0668115f58c3929af9ff1" +SRC_URI[md5sum] = "9c54a6eb188f6673e32be3e22941ba39" +SRC_URI[sha256sum] = "f328ed33d70a32267f141c5c310f61ed7fcce049094223db2ea2247d62e72c10" +require pypi-src-openeuler.inc + +# remove the setup_requires for setuptools-scm(same as python3-pytest): +# The setup_requires argument forces the download of the egg file for setuptools-scm +# during the do_compile phase. This download is incompatible with the typical fetch +# and mirror structure. The only usage of scm is the generation of the _version.py +# file and in the release tarball it is already correctly created +FILESEXTRAPATHS:prepend := "${THISDIR}/python3-cmd2/:" +SRC_URI_append += "file://0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch" + diff --git a/meta-openeuler/recipes-devtools/python/python3-cython_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-cython_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..57dc53ff1c23d449386e372634e136bf866f9f4e --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-cython_%.bbappend @@ -0,0 +1,4 @@ +PV = "0.29.32" +SRC_URI[md5sum] = "91c36ea86c00adcc5c1c11cf48b733c0" +SRC_URI[sha256sum] = "8733cf4758b79304f2a4e39ebfac5e92341bce47bcceb26c1254398b2f8c1af7" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-dateutil_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-dateutil_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..9c6f6c9be170669455e2770660d88773b339eee3 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-dateutil_%.bbappend @@ -0,0 +1,5 @@ +PV = "2.8.2" +SRC_URI[md5sum] = "5970010bb72452344df3d76a10281b65" +SRC_URI[sha256sum] = "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86" +require pypi-src-openeuler.inc +OPENEULER_REPO_NAME = "${PYPI_PACKAGE}" diff --git a/meta-openeuler/recipes-devtools/python/python3-docopt_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-docopt_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bd4a6cef9682725eba50391b1770bc743442250b --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-docopt_%.bbappend @@ -0,0 +1,2 @@ +PV = "0.6.2" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-docutils_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-docutils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..28c76c47c6c0bec0dcbda183c9f8ded48da120f6 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-docutils_%.bbappend @@ -0,0 +1,5 @@ +PV = "0.17.1" +LIC_FILES_CHKSUM = "file://COPYING.txt;md5=836a1950177996968a49ff477a4a61c4" +SRC_URI[md5sum] = "ed810564c25063e9dac10dd0893ead47" +SRC_URI[sha256sum] = "686577d2e4c32380bb50cbb22f575ed742d58168cee37e99117a854bcd88f125" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-idna_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-idna_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e7b19f6d410908655c67e04707dcc6046a8aa217 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-idna_%.bbappend @@ -0,0 +1,4 @@ +PV = "3.3" +SRC_URI[md5sum] = "5856306eac5f25db8249e37a4c6ee3e7" +SRC_URI[sha256sum] = "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-importlib-metadata_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-importlib-metadata_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e89610400bda79d1346c90b1daa36515c7dcd3e0 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-importlib-metadata_%.bbappend @@ -0,0 +1,7 @@ +PV = "4.12.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" +SRC_URI[md5sum] = "cfcf29185e13439c76d09c94bc8d81f4" +SRC_URI[sha256sum] = "637245b8bab2b6502fcbc752cc4b7a6f6243bb02b31c5c26156ad103d3d45670" +require pypi-src-openeuler.inc +OPENEULER_REPO_NAME = "python-importlib-metadata" +SRC_URI_append += "file://0001-add-setup.py.patch " diff --git a/meta-openeuler/recipes-devtools/python/python3-iniparse_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-iniparse_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b622d44b0be7bca98a2a42c63edc4bb8a62ae962 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-iniparse_%.bbappend @@ -0,0 +1,15 @@ +PV = "0.5" +require pypi-src-openeuler.inc + +SRC_URI[md5sum] = "2054bab923df21107652d009f2373789" +SRC_URI[sha256sum] = "932e5239d526e7acb504017bb707be67019ac428a6932368e6851691093aa842" + +# delete useless patch for version 0.4 +SRC_URI_remove = "file://0001-Add-python-3-compatibility.patch " + +# fix ModuleNotFoundError: No module named 'setuptools' +inherit setuptools3 +# fix _sysconfigdata not found error, after inherit setuptools3 +do_install_remove_class-target() { + export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata" +} diff --git a/meta-openeuler/recipes-devtools/python/python3-jinja2_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-jinja2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..0f557c257e433075d14efbcea54aba5aed86f607 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-jinja2_%.bbappend @@ -0,0 +1,5 @@ +PV = "3.1.2" +SRC_URI[sha256sum] = "611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7" + +require pypi-src-openeuler.inc +OPENEULER_REPO_NAME = "python-jinja2" diff --git a/meta-openeuler/recipes-devtools/python/python3-lxml_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-lxml_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..cecebf4d1215a6837e2ca75eb8b5eff470731ee6 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-lxml_%.bbappend @@ -0,0 +1,9 @@ +PV = "4.9.1" +SRC_URI[md5sum] = "e27240a7319d80d0c1e5390ca31eb1d8" +SRC_URI[sha256sum] = "fe749b052bb7233fe5d072fcb549221a8cb1a16725c47c37e42b0b9cb3ff2c3f" +require pypi-src-openeuler.inc + +# apply openeuler's patches +SRC_URI_append += " \ + file://backport-Work-around-libxml2-bug-in-affected-versions.patch \ + " diff --git a/meta-openeuler/recipes-devtools/python/python3-mccabe_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-mccabe_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..4654c5bac1357556f3d5e1d38879e22f071a3eb8 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-mccabe_%.bbappend @@ -0,0 +1,4 @@ +PV = "0.6.1" +SRC_URI[md5sum] = "723df2f7b1737b8887475bac4c763e1e" +SRC_URI[sha256sum] = "dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-mock_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-mock_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..584caf0c6bc8ebaf4e6eee8ed8ec47c9e45dd878 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-mock_%.bbappend @@ -0,0 +1,4 @@ +PV = "4.0.3" +SRC_URI[md5sum] = "aa1da7f967fc9a23b8f2ef76b9793065" +SRC_URI[sha256sum] = "7d3fbbde18228f4ff2f1f119a45cdffa458b4c0dee32eb4d2bb2f82554bac7bc" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-more-itertools_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-more-itertools_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e6e2485bdd4d9b55efbc334da448bee9fc3f0c4a --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-more-itertools_%.bbappend @@ -0,0 +1,4 @@ +PV = "8.12.0" +SRC_URI[md5sum] = "5cdaf7f40f1e7d1c9ba887e7765db596" +SRC_URI[sha256sum] = "b708a64c95508d4f1fef137acbe3b482b6a95d0cd1b54400c50534cb0ae05923" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-netifaces_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-netifaces_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..6f518655ade796b53b554cd285a9f8158d2b5106 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-netifaces_%.bbappend @@ -0,0 +1,4 @@ +PV = "0.11.0" +SRC_URI[md5sum] = "3146dcb3297dd018ae5eb9a52b440419" +SRC_URI[sha256sum] = "043a79146eb2907edf439899f262b3dfe41717d34124298ed281139a8b93ca32" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch b/meta-openeuler/recipes-devtools/python/python3-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch new file mode 100644 index 0000000000000000000000000000000000000000..9f5f25f9b57c96f51bfa88a66bebcfff48060f0b --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-numpy/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch @@ -0,0 +1,72 @@ +From 27f6687e49bf555fc494d2f14bae6ecd0fa30f14 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Thu, 10 Dec 2015 13:20:30 +0200 +Subject: [PATCH] Don't search /usr and so on for libraries by default to + + avoid host contamination. + +Upstream-Status: Inappropriate (As the code stands, this is a hack) +Signed-off-by: Ross Burton +Signed-off-by: Alexander Kanavin +--- + numpy/distutils/system_info.py | 42 +++++----------------------------- + 1 file changed, 6 insertions(+), 36 deletions(-) + +diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py +index 82e864a..135246d 100644 +--- a/numpy/distutils/system_info.py ++++ b/numpy/distutils/system_info.py +@@ -323,44 +323,14 @@ if sys.platform == 'win32': + add_system_root(os.path.join(conda_dir, 'Library')) + + else: +- default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib', +- '/opt/local/lib', '/sw/lib'], platform_bits) + default_runtime_dirs = [] +- default_include_dirs = ['/usr/local/include', +- '/opt/include', +- # path of umfpack under macports +- '/opt/local/include/ufsparse', +- '/opt/local/include', '/sw/include', +- '/usr/include/suitesparse'] +- default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src'] +- +- default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib', +- '/usr/lib'], platform_bits) +- default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include'] +- +- if os.path.exists('/usr/lib/X11'): +- globbed_x11_dir = glob('/usr/lib/*/libX11.so') +- if globbed_x11_dir: +- x11_so_dir = os.path.split(globbed_x11_dir[0])[0] +- default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11']) +- default_x11_include_dirs.extend(['/usr/lib/X11/include', +- '/usr/include/X11']) +- +- with open(os.devnull, 'w') as tmp: +- try: +- p = subprocess.Popen(["gcc", "-print-multiarch"], stdout=subprocess.PIPE, +- stderr=tmp) +- except (OSError, DistutilsError): +- # OSError if gcc is not installed, or SandboxViolation (DistutilsError +- # subclass) if an old setuptools bug is triggered (see gh-3160). +- pass +- else: +- triplet = str(p.communicate()[0].decode().strip()) +- if p.returncode == 0: +- # gcc supports the "-print-multiarch" option +- default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)] +- default_lib_dirs += [os.path.join("/usr/lib/", triplet)] + ++ default_lib_dirs = libpaths(['/deadir/lib'], platform_bits) ++ default_include_dirs = ['/deaddir/include'] ++ default_src_dirs = ['.', '/deaddir/src'] ++ ++ default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits) ++ default_x11_include_dirs = ['/deaddir/include'] + + if os.path.join(sys.prefix, 'lib') not in default_lib_dirs: + default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib')) +-- +2.25.1 + diff --git a/meta-openeuler/recipes-devtools/python/python3-numpy/0001-generate_umath.py-do-not-write-full-path-to-output-f.patch b/meta-openeuler/recipes-devtools/python/python3-numpy/0001-generate_umath.py-do-not-write-full-path-to-output-f.patch new file mode 100644 index 0000000000000000000000000000000000000000..41dea896828e37d9e735ef5c59be0997051b09d6 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-numpy/0001-generate_umath.py-do-not-write-full-path-to-output-f.patch @@ -0,0 +1,28 @@ +From 3c7deaa3a961a0f3ce4ff108468e3d70118f17b3 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Thu, 9 Jun 2022 17:23:42 +0200 +Subject: [PATCH] generate_umath.py: do not write full path to output files + +This helps reproducibility as those paths vary in automated +build environments. + +Upstream-Status: Submitted [https://github.com/numpy/numpy/pull/21707] +Signed-off-by: Alexander Kanavin + +--- + numpy/core/code_generators/generate_umath.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py +index 292d9e0..df37941 100644 +--- a/numpy/core/code_generators/generate_umath.py ++++ b/numpy/core/code_generators/generate_umath.py +@@ -1233,7 +1233,7 @@ def make_code(funcdict, filename): + + return 0; + } +- """) % (filename, code1, code2, code3) ++ """) % (os.path.basename(filename), code1, code2, code3) + return code + + diff --git a/meta-openeuler/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch b/meta-openeuler/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..b60ca1d2167f9cbdcb9dd1396f53fb98d6cc62ce --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-numpy/0001-numpy-core-Define-RISCV-32-support.patch @@ -0,0 +1,56 @@ +From dbcf296f84e5cef6a3ff0f1c469a4508f1e0fb15 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 15 Nov 2020 15:32:39 -0800 +Subject: [PATCH] numpy/core: Define RISCV-32 support + +Helps compile on riscv32 + +Upstream-Status: Submitted [https://github.com/numpy/numpy/pull/17780] +Signed-off-by: Khem Raj +--- + numpy/core/include/numpy/npy_cpu.h | 9 +++++++-- + numpy/core/include/numpy/npy_endian.h | 1 + + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h +index 4dbf9d84e..bc41a7eda 100644 +--- a/numpy/core/include/numpy/npy_cpu.h ++++ b/numpy/core/include/numpy/npy_cpu.h +@@ -18,6 +18,7 @@ + * NPY_CPU_ARCEL + * NPY_CPU_ARCEB + * NPY_CPU_RISCV64 ++ * NPY_CPU_RISCV32 + * NPY_CPU_WASM + */ + #ifndef _NPY_CPUARCH_H_ +@@ -100,8 +101,12 @@ + #define NPY_CPU_ARCEL + #elif defined(__arc__) && defined(__BIG_ENDIAN__) + #define NPY_CPU_ARCEB +-#elif defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 +- #define NPY_CPU_RISCV64 ++#elif defined(__riscv) ++ #if __riscv_xlen == 64 ++ #define NPY_CPU_RISCV64 ++ #elif __riscv_xlen == 32 ++ #define NPY_CPU_RISCV32 ++ #endif + #elif defined(__EMSCRIPTEN__) + /* __EMSCRIPTEN__ is defined by emscripten: an LLVM-to-Web compiler */ + #define NPY_CPU_WASM +diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h +index aa367a002..d59484573 100644 +--- a/numpy/core/include/numpy/npy_endian.h ++++ b/numpy/core/include/numpy/npy_endian.h +@@ -49,6 +49,7 @@ + || defined(NPY_CPU_PPC64LE) \ + || defined(NPY_CPU_ARCEL) \ + || defined(NPY_CPU_RISCV64) \ ++ || defined(NPY_CPU_RISCV32) \ + || defined(NPY_CPU_WASM) + #define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN + #elif defined(NPY_CPU_PPC) \ +-- +2.29.2 + diff --git a/meta-openeuler/recipes-devtools/python/python3-numpy_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-numpy_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..22e5110a0250eee7d895ca320aafb90655d20f94 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-numpy_%.bbappend @@ -0,0 +1,27 @@ +PV = "1.21.4" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" + +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b076ad374a7d311ba3126a22b2d52596" +SRC_URI[md5sum] = "b3c4477a027d5b6fba5e1065064fd076" +SRC_URI[sha256sum] = "e6c76a87633aa3fa16614b61ccedfae45b91df2767cf097aa9c933932a7ed1e0" +OPENEULER_REPO_NAME = "numpy" + +SRC_URI_prepend += "file://numpy-${PV}.zip " +S = "${WORKDIR}/numpy-${PV}" + +# remove poky conflict src +SRC_URI_remove += " \ + https://github.com/${SRCNAME}/${SRCNAME}/releases/download/v${PV}/${SRCNAME}-${PV}.tar.gz \ + file://CVE-2021-41496.patch \ + " +# apply new patch for new version, see: +# http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3-numpy_1.23.4.bb +SRC_URI_append += "file://0001-generate_umath.py-do-not-write-full-path-to-output-f.patch " + +#apply openeuler patch +SRC_URI_append += " \ + file://backport-CVE-2021-41496.patch \ + file://backport-CVE-2021-41495.patch \ + file://backport-CVE-2021-34141.patch \ + " diff --git a/meta-openeuler/recipes-devtools/python/python3-packaging_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-packaging_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..66ed1a10680e05bcfd33881d53097426ba42d747 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-packaging_%.bbappend @@ -0,0 +1,4 @@ +PV = "21.3" +SRC_URI[md5sum] = "e713c1939f294fd729af4a7be40dd141" +SRC_URI[sha256sum] = "dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-pathlib2_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-pathlib2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..10f3e9c131405b25d2f5d21fc1ffa3b4202b221a --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-pathlib2_%.bbappend @@ -0,0 +1,5 @@ +PV = "2.3.7" +LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=2dc08586cce3ab91bfa091b655c0e440" +SRC_URI[md5sum] = "ff87562935872cf68f935f8a9e43f84f" +SRC_URI[sha256sum] = "7a4329d67beff9a712e1d3ae147e4e3e108b0bfd284ffdea03a635126c76b3c0" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-pep8_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-pep8_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..5ac295d89d057efccf9aaeab400e21bfefcfd118 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-pep8_%.bbappend @@ -0,0 +1,5 @@ +PV = "1.7.1" +LIC_FILES_CHKSUM = "file://README.rst;md5=d8ebbbe831259ce010179d2f310b0f3e" +SRC_URI[md5sum] = "603821d06db945c71d811b5a8d78423c" +SRC_URI[sha256sum] = "fe249b52e20498e59e0b5c5256aa52ee99fc295b26ec9eaa85776ffdb9fe6374" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-pip_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-pip_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..62adb15c9f09d37e6870f453893c77166f9b0ba5 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-pip_%.bbappend @@ -0,0 +1,17 @@ +PV = "22.3.1" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=63ec52baf95163b597008bb46db68030" +SRC_URI[md5sum] = "996f58a94fe0b8b82b6795c42bd171ba" +SRC_URI[sha256sum] = "65fd48317359f3af8e593943e6ae1506b66325085ea64b706a998c6e83eeaf38" +require pypi-src-openeuler.inc + +# remove poky conflict patches +SRC_URI_remove += " \ + file://0001-change-shebang-to-python3.patch \ + file://0001-Don-t-split-git-references-on-unicode-separators.patch \ + " + +# apply openeuler patches +SRC_URI_append +=" \ + file://remove-existing-dist-only-if-path-conflicts.patch \ + file://dummy-certifi.patch \ +" diff --git a/meta-openeuler/recipes-devtools/python/python3-ply_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-ply_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a843318cad8ad68c1e1a73aa3b691b1f816e10e5 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-ply_%.bbappend @@ -0,0 +1,4 @@ +PV = "3.11" +SRC_URI[md5sum] = "6465f602e656455affcd7c5734c638f8" +SRC_URI[sha256sum] = "00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-prettytable/0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch b/meta-openeuler/recipes-devtools/python/python3-prettytable/0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch new file mode 100644 index 0000000000000000000000000000000000000000..ecdb98ad8e24ab30885ffca9d0bcc650204c3346 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-prettytable/0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch @@ -0,0 +1,10 @@ +--- a/setup.cfg 2023-02-27 11:23:59.066894208 +0000 ++++ b/setup.cfg 2023-02-27 11:24:23.026335372 +0000 +@@ -32,7 +32,6 @@ install_requires = + python_requires = >=3.6 + package_dir = =src + setup_requires = +- setuptools_scm + + [options.packages.find] + where = src diff --git a/meta-openeuler/recipes-devtools/python/python3-prettytable_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-prettytable_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..5a191e511669ce1372902f4d801dd23e6bc30a55 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-prettytable_%.bbappend @@ -0,0 +1,21 @@ +PV = "2.4.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=c9a6829fcd174d9535b46211917c7671" +SRC_URI[md5sum] = "c4784a3ea8bd6b326932d112458e051a" +SRC_URI[sha256sum] = "18e56447f636b447096977d468849c1e2d3cfa0af8e7b5acfcf83a64790c0aca" + +SRC_URI_remove += " \ + https://pypi.python.org/packages/source/P/PrettyTable/${SRCNAME}-${PV}.zip \ + " + +OPENEULER_REPO_NAME = "python-prettytable" + +SRC_URI_prepend += "file://prettytable-${PV}.tar.gz " + +# remove the setup_requires for setuptools-scm(same as python3-pytest): +# The setup_requires argument forces the download of the egg file for setuptools-scm +# during the do_compile phase. This download is incompatible with the typical fetch +# and mirror structure. The only usage of scm is the generation of the _version.py +# file and in the release tarball it is already correctly created +FILESEXTRAPATHS:prepend := "${THISDIR}/python3-prettytable/:" +SRC_URI_append += "file://0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch" + diff --git a/meta-openeuler/recipes-devtools/python/python3-pybind11_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-pybind11_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..da0a1ff3dbc45215132a4fdafca875029f2c233a --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-pybind11_%.bbappend @@ -0,0 +1,15 @@ +PV = "2.10.0" +SRC_URI[md5sum] = "da561ebf81594930d368a9f9aae0d035" +SRC_URI[sha256sum] = "eacf582fa8f696227988d08cfc46121770823839fe9e301a20fbce67e7cd70ec" + +# remove meta-python conflict src +SRC_URI_remove += " \ + git://github.com/pybind/pybind11.git;branch=master;protocol=https \ + file://0001-Do-not-strip-binaries.patch \ + file://0001-Do-not-check-pointer-size-when-cross-compiling.patch \ +" + +S = "${WORKDIR}/pybind11-${PV}" +OPENEULER_REPO_NAME = "pybind11" + +SRC_URI_prepend += "file://v${PV}.tar.gz " diff --git a/meta-openeuler/recipes-devtools/python/python3-pyelftools_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-pyelftools_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..13179dac51d96b236acdb2be27d3dae81538c465 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-pyelftools_%.bbappend @@ -0,0 +1,3 @@ +PV = "0.29" +require pypi-src-openeuler.inc +OPENEULER_REPO_NAME = "${PYPI_PACKAGE}" diff --git a/meta-openeuler/recipes-devtools/python/python3-pyflakes_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-pyflakes_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a90265013d84f3f4132b60d70fe5602b45b93fc0 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-pyflakes_%.bbappend @@ -0,0 +1,10 @@ +PV = "2.3.1" +LIC_FILES_CHKSUM = "file://LICENSE;md5=690c2d09203dc9e07c4083fc45ea981f" +SRC_URI[md5sum] = "0b60a307a6b293ee505fe0134e9d46e9" +SRC_URI[sha256sum] = "f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db" +require pypi-src-openeuler.inc +OPENEULER_REPO_NAME = "pyflakes" + +SRC_URI_append += " \ + file://fix-syntax-error-offsets-for-python-3.10-635.patch \ +" diff --git a/meta-openeuler/recipes-devtools/python/python3-pyparsing_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-pyparsing_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..8f35b15dd541962b59ab316d0589156adf2d84a1 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-pyparsing_%.bbappend @@ -0,0 +1,5 @@ +PV = "3.0.7" +SRC_URI[md5sum] = "9d38774991175444e21a3dfa865876cc" +SRC_URI[sha256sum] = "18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea" +require pypi-src-openeuler.inc +OPENEULER_REPO_NAME = "${PYPI_PACKAGE}" diff --git a/meta-openeuler/recipes-devtools/python/python3-pyperclip_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-pyperclip_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..65d0a207140bce7e6e2cecc697b285a8292900dc --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-pyperclip_%.bbappend @@ -0,0 +1,4 @@ +PV = "1.8.2" +SRC_URI[md5sum] = "853603b2e8fa1b13622fdbe72d1fb201" +SRC_URI[sha256sum] = "105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-pytest/0002-setup.py-remove-the-setup_requires-for-setuptools-scm.patch b/meta-openeuler/recipes-devtools/python/python3-pytest/0002-setup.py-remove-the-setup_requires-for-setuptools-scm.patch new file mode 100644 index 0000000000000000000000000000000000000000..c2aabad1ce95dc680ee4e375c9d5f961b60bf904 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-pytest/0002-setup.py-remove-the-setup_requires-for-setuptools-scm.patch @@ -0,0 +1,36 @@ +From ead04f2da75efeca3369feff6161ea4a8baecbc9 Mon Sep 17 00:00:00 2001 +From: Yuan Chao +Date: Wed, 28 Aug 2019 16:12:27 +0900 +Subject: [PATCH] setup.py: remove the setup_requires for setuptools-scm + +The setup_requires argument forces the download of the egg file for setuptools-scm +during the do_compile phase. This download is incompatible with the typical fetch +and mirror structure. The only usage of scm is the generation of the _version.py +file and in the release tarball it is already correctly created + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Derek Straka + +Signed-off-by: Yuan Chao + +Rebase for pytest 6.1.0. + +Signed-off-by: Kai Kang + +--- + setup.cfg | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/setup.cfg b/setup.cfg +index 6ed0792..0137090 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -56,7 +56,6 @@ package_dir = + =src + setup_requires = + setuptools +- setuptools-scm>=6.0 + zip_safe = no + + [options.entry_points] diff --git a/meta-openeuler/recipes-devtools/python/python3-pytest_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-pytest_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b9fdcdcbf122454004c7f789d35763f188de7f38 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-pytest_%.bbappend @@ -0,0 +1,12 @@ +PV = "7.0.1" +LIC_FILES_CHKSUM = "file://LICENSE;md5=bd27e41b6550fe0fc45356d1d81ee37c" +SRC_URI[md5sum] = "995d64fe44bbe717d03bd703d5c48ec6" +SRC_URI[sha256sum] = "e30905a0c131d3d94b89624a1cc5afec3e0ba2fbdb151867d8e0ebd49850f171" +require pypi-src-openeuler.inc +OPENEULER_REPO_NAME = "${PYPI_PACKAGE}" + +# remove poky conflict patch, we have fit by 0002-patch +SRC_URI_remove += "file://0001-setup.py-remove-the-setup_requires-for-setuptools-scm.patch " +FILESEXTRAPATHS:prepend := "${THISDIR}/python3-pytest/:" +SRC_URI_append += "file://0002-setup.py-remove-the-setup_requires-for-setuptools-scm.patch" + diff --git a/meta-openeuler/recipes-devtools/python/python3-pyyaml_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-pyyaml_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..f0b36784ce6068e12999e50dd29de1832d14a23b --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-pyyaml_%.bbappend @@ -0,0 +1,9 @@ +PV = "5.3.1" +LIC_FILES_CHKSUM = "file://LICENSE;md5=7bbd28caa69f81f5cd5f48647236663d" +SRC_URI[md5sum] = "1d19c798f25e58e3e582f0f8c977dbb8" +SRC_URI[sha256sum] = "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2" +OPENEULER_REPO_NAME = "${PYPI_PACKAGE}" +OPENEULER_BRANCH = "openEuler-20.03-LTS" +SRC_URI_remove += "${PYPI_SRC_URI} " +SRC_URI_prepend += "file://${PV}.tar.gz " +S = "${WORKDIR}/pyyaml-${PV}" diff --git a/meta-openeuler/recipes-devtools/python/python3-ruamel-yaml_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-ruamel-yaml_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ab1f494fcc35500037067979ae074bf3f46c8d96 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-ruamel-yaml_%.bbappend @@ -0,0 +1,7 @@ +PV = "0.17.21" + +SRC_URI[sha256sum] = "8b7ce697a2f212752a35c1ac414471dc16c424c9573be4926b56ff3f5d23b7af" +LIC_FILES_CHKSUM = "file://LICENSE;md5=034154b7344d15438bc5ed5ee9cc075f" + +require pypi-src-openeuler.inc +OPENEULER_REPO_NAME = "python-ruamel-yaml" diff --git a/meta-openeuler/recipes-devtools/python/python3-setuptools-scm_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-setuptools-scm_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..5d7151f10c9e97cad3ef77b6f095d6f91202767e --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-setuptools-scm_%.bbappend @@ -0,0 +1,4 @@ +PV = "6.0.0" +SRC_URI[md5sum] = "e6aeee98d39fa093e15f9ff229bb20a2" +SRC_URI[sha256sum] = "4cad20da6cbb3f8cc218d8f3a7fbb3fb0744f9e9bf7f9df993db8909f7ccd456" +require pypi-src-openeuler.inc diff --git a/meta-openeuler/recipes-devtools/python/python3-setuptools_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-setuptools_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ad53dd9f117b896f9e03fecff6e83560d228b3b9 --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-setuptools_%.bbappend @@ -0,0 +1,9 @@ +PV = "59.4.0" +SRC_URI[md5sum] = "1cfee8bed453d447851114c0deca6ba1" +SRC_URI[sha256sum] = "b4c634615a0cf5b02cf83c7bedffc8da0ca439f00e79452699454da6fbd4153d" +require pypi-src-openeuler.inc +OPENEULER_BRANCH = "openEuler-22.03-LTS-Next" + +SRC_URI += " \ + file://bugfix-eliminate-random-order-in-metadata.patch \ +" diff --git a/meta-openeuler/recipes-devtools/python/python3-six_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-six_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..6b7d8edb559fd875c45084b57bab0c79951b670a --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-six_%.bbappend @@ -0,0 +1,5 @@ +PV = "1.16.0" +require pypi-src-openeuler.inc + +SRC_URI[md5sum] = "a7c927740e4964dd29b72cebfc1429bb" +SRC_URI[sha256sum] = "1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926" diff --git a/meta-openeuler/recipes-devtools/python/python3-toml_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-toml_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..765417aa33f423e3974d8fc61f31c17ee9ccc19c --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-toml_%.bbappend @@ -0,0 +1,9 @@ +PV = "0.10.2" +SRC_URI[md5sum] = "165f8d31000174760118dc9893ed9bb9" +SRC_URI[sha256sum] = "71d4039bbdec91e3e7591ec5d6c943c58f9a2d17e5f6783acdc378f743fcdd2a" + +# use openeuler's pkg src +SRC_URI_remove += "${PYPI_SRC_URI} " +OPENEULER_REPO_NAME = "python-${PYPI_PACKAGE}" +OPENEULER_BRANCH = "master" +SRC_URI_prepend += "file://${PV}.tar.gz " diff --git a/meta-openeuler/recipes-devtools/python/python3-zipp_%.bbappend b/meta-openeuler/recipes-devtools/python/python3-zipp_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..fd0b3dbc65b61e1172aa2933e0b8ee967472323c --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3-zipp_%.bbappend @@ -0,0 +1,5 @@ +PV = "3.11.0" +SRC_URI[md5sum] = "5a1fc692b57b348d1e259484b405ddf6" +SRC_URI[sha256sum] = "9f50f446828eb9d45b267433fd3e9da8d801f614129124863f9c51ebceafb87d" +require pypi-src-openeuler.inc +SRC_URI += "file://0001-add-setup.py.patch " diff --git a/meta-openeuler/recipes-devtools/python/python3_%.bbappend b/meta-openeuler/recipes-devtools/python/python3_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..574a09deed7cb9725ee00c16d5063d6a7a76aa3a --- /dev/null +++ b/meta-openeuler/recipes-devtools/python/python3_%.bbappend @@ -0,0 +1,38 @@ +PV = "3.9.9" + +FILESEXTRAPATHS_append := "${THISDIR}/files/:" + +SRC_URI[sha256sum] = "06828c04a573c073a4e51c4292a27c1be4ae26621c3edc7cf9318418ce3b6d27" + +SRC_URI_remove += " \ + file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \ +" + +OPENEULER_BRANCH = "openEuler-22.03-LTS" + +SRC_URI =+ " \ + file://00001-rpath.patch \ + file://00111-no-static-lib.patch \ + file://00251-change-user-install-location.patch \ + file://backport-Add--with-wheel-pkg-dir-configure-option.patch \ + file://backport-bpo-46811-Make-test-suite-support-Expat-2.4.5.patch \ + file://backport-bpo-20369-concurrent.futures.wait-now-deduplicates-f.patch \ + file://Make-mailcap-refuse-to-match-unsafe-filenam.patch \ + file://backport-CVE-2021-28861.patch \ + file://backport-CVE-2020-10735.patch \ + file://backport-bpo-35823-subprocess-Use-vfork-instead-of-fork-on-Li.patch \ + file://backport-bpo-35823-subprocess-Fix-handling-of-pthread_sigmask.patch \ + file://backport-bpo-35823-Allow-setsid-after-vfork-on-Linux.-GH-2294.patch \ + file://backport-bpo-42146-Unify-cleanup-in-subprocess_fork_exec-GH-2.patch \ + file://add-the-sm3-method-for-obtaining-the-salt-value.patch \ +" + +# meta-openeuler layer does not need to build python3-native dependency packages, +# but gets them directly from the nativesdk tool +# Find header from nativesdk +CPPFLAGS_append_class-native = " -I${OPENEULER_NATIVESDK_SYSROOT}/usr/include \ + -I${OPENEULER_NATIVESDK_SYSROOT}/usr/include/ncursesw -I${OPENEULER_NATIVESDK_SYSROOT}/usr/include/uuid \ +" + +# Find library from nativesdk +LDFLAGS_append_class-native = " -L${OPENEULER_NATIVESDK_SYSROOT}/usr/lib" diff --git a/meta-openeuler/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch b/meta-openeuler/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch new file mode 100644 index 0000000000000000000000000000000000000000..6d236ac400f77c3c105630d0aa43a2dd4cbdcda2 --- /dev/null +++ b/meta-openeuler/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch @@ -0,0 +1,58 @@ +From 8d013fe154a162305f76141151baf767dd04b598 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Mon, 27 Feb 2017 09:43:30 +0200 +Subject: [PATCH] Do not hardcode "lib/rpm" as the installation path for + default configuration and macros. + +Upstream-Status: Denied [https://github.com/rpm-software-management/rpm/pull/263] +Signed-off-by: Alexander Kanavin + +--- + configure.ac | 2 +- + macros.in | 2 +- + rpm.am | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index eb7d6941b..10a889b5d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -871,7 +871,7 @@ else + usrprefix=$prefix + fi + +-RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`" ++RPMCONFIGDIR="`echo ${libdir}/rpm`" + AC_SUBST(RPMCONFIGDIR) + + AC_SUBST(OBJDUMP) +diff --git a/macros.in b/macros.in +index a1f795e5f..689e784ef 100644 +--- a/macros.in ++++ b/macros.in +@@ -933,7 +933,7 @@ package or when debugging this package.\ + %_sharedstatedir %{_prefix}/com + %_localstatedir %{_prefix}/var + %_lib lib +-%_libdir %{_exec_prefix}/%{_lib} ++%_libdir @libdir@ + %_includedir %{_prefix}/include + %_infodir %{_datadir}/info + %_mandir %{_datadir}/man +diff --git a/rpm.am b/rpm.am +index 7b57f433b..9bbb9ee96 100644 +--- a/rpm.am ++++ b/rpm.am +@@ -1,10 +1,10 @@ + # Internal binaries + ## HACK: It probably should be $(libexecdir)/rpm or $(libdir)/rpm +-rpmlibexecdir = $(prefix)/lib/rpm ++rpmlibexecdir = $(libdir)/rpm + + # Host independent config files + ## HACK: it probably should be $(datadir)/rpm +-rpmconfigdir = $(prefix)/lib/rpm ++rpmconfigdir = $(libdir)/rpm + + # Libtool version (current-revision-age) for all our libraries + rpm_version_info = 11:0:2 diff --git a/meta-openeuler/recipes-devtools/rpm/files/0001-docs-do-not-build-manpages-requires-pandoc.patch b/meta-openeuler/recipes-devtools/rpm/files/0001-docs-do-not-build-manpages-requires-pandoc.patch new file mode 100644 index 0000000000000000000000000000000000000000..ced52d10071cbc7a96e368b5b9b1134fb793d841 --- /dev/null +++ b/meta-openeuler/recipes-devtools/rpm/files/0001-docs-do-not-build-manpages-requires-pandoc.patch @@ -0,0 +1,26 @@ +From 9bf1693092385eba9841614613313010221ca01f Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 29 Jun 2021 20:11:26 +0200 +Subject: [PATCH] docs: do not build manpages (requires pandoc) + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +--- + docs/Makefile.am | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/docs/Makefile.am b/docs/Makefile.am +index 5a6bd203a..6257767fd 100644 +--- a/docs/Makefile.am ++++ b/docs/Makefile.am +@@ -1,7 +1,5 @@ + ## Process this file with automake to produce Makefile.in + +-SUBDIRS = man +- + EXTRA_DIST = + + EXTRA_DIST += \ +-- +2.32.0 + diff --git a/meta-openeuler/recipes-devtools/rpm/files/0001-tools-Add-error.h-for-non-glibc-case.patch b/meta-openeuler/recipes-devtools/rpm/files/0001-tools-Add-error.h-for-non-glibc-case.patch new file mode 100644 index 0000000000000000000000000000000000000000..9783396639ff80beea817d4be1a226a8fba8ea94 --- /dev/null +++ b/meta-openeuler/recipes-devtools/rpm/files/0001-tools-Add-error.h-for-non-glibc-case.patch @@ -0,0 +1,71 @@ +From 9b9d717f484ec913cdd3804e43489b3dc18bd77c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 31 Oct 2020 22:14:05 -0700 +Subject: [PATCH] tools: Add error.h for non-glibc case + +error is glibc specific API, so this patch will mostly not accepted +upstream given that elfutils has been closely tied to glibc + +Upstream-Status: Inappropriate [workaround for musl] + +Signed-off-by: Khem Raj + +--- + tools/elfdeps.c | 6 +++++- + tools/error.h | 27 +++++++++++++++++++++++++++ + 2 files changed, 32 insertions(+), 1 deletion(-) + create mode 100644 tools/error.h + +diff --git a/tools/elfdeps.c b/tools/elfdeps.c +index d205935bb..3a8945b33 100644 +--- a/tools/elfdeps.c ++++ b/tools/elfdeps.c +@@ -5,10 +5,14 @@ + #include + #include + #include +-#include + #include + #include + #include ++#ifdef __GLIBC__ ++#include ++#else ++#include "error.h" ++#endif + + #include + #include +diff --git a/tools/error.h b/tools/error.h +new file mode 100644 +index 000000000..ef06827a0 +--- /dev/null ++++ b/tools/error.h +@@ -0,0 +1,27 @@ ++#ifndef _ERROR_H_ ++#define _ERROR_H_ ++ ++#include ++#include ++#include ++#include ++#include ++ ++static unsigned int error_message_count = 0; ++ ++static inline void error(int status, int errnum, const char* format, ...) ++{ ++ va_list ap; ++ fprintf(stderr, "%s: ", program_invocation_name); ++ va_start(ap, format); ++ vfprintf(stderr, format, ap); ++ va_end(ap); ++ if (errnum) ++ fprintf(stderr, ": %s", strerror(errnum)); ++ fprintf(stderr, "\n"); ++ error_message_count++; ++ if (status) ++ exit(status); ++} ++ ++#endif /* _ERROR_H_ */ diff --git a/meta-openeuler/recipes-devtools/rpm/rpm_%.bbappend b/meta-openeuler/recipes-devtools/rpm/rpm_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..3a8288dcabaf2e82c1e23b9acd4f4de7421ea130 --- /dev/null +++ b/meta-openeuler/recipes-devtools/rpm/rpm_%.bbappend @@ -0,0 +1,124 @@ +PV = "4.17.0" +S = "${WORKDIR}/${BP}" + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +# delete useless patches form rpm_4.16.1.3.bb +SRC_URI_remove = " \ + git://github.com/rpm-software-management/rpm;branch=rpm-4.16.x;protocol=https \ + file://0001-Fix-build-with-musl-C-library.patch \ + file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \ + file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \ + file://0001-CVE-2021-3521.patch \ + file://0002-CVE-2021-3521.patch \ + file://0003-CVE-2021-3521.patch \ +" + +SRC_URI_append = " \ + file://0001-docs-do-not-build-manpages-requires-pandoc.patch \ +" + +# files, patches that come from openeuler +SRC_URI_prepend = " \ + http://ftp.rpm.org/releases/rpm-4.17.x/${BPN}-${PV}.tar.bz2 \ + file://Unbundle-config-site-and-add-RPM-LD-FLAGS-macro.patch \ + file://rpm-4.12.0-rpm2cpio-hack.patch \ + file://add-dist-to-release-by-default.patch \ + file://revert-always-execute-file-trigger-scriptlet-callbac.patch \ + file://bugfix-rpm-4.11.3-add-aarch64_ilp32-arch.patch \ + file://bugfix-rpm-4.14.2-wait-once-get-rpmlock-fail.patch \ + file://Generate-digest-lists.patch \ + file://Add-digest-list-plugin.patch \ + file://Don-t-add-dist-to-release-if-it-is-already-there.patch \ + file://Generate-digest-lists-before-calling-genCpioListAndH.patch \ + file://call-process_digest_list-after-files-are-added.patch \ + file://fix-lsetxattr-error-in-container.patch \ + file://rpm-selinux-plugin-check-context-file-exist.patch \ + file://get-in-use-of-ndb.patch \ + file://still-in-use-of-python-scripts-from-old-version.patch \ + file://Add-loongarch-architecture-support.patch \ + file://Fix-digest_list_counter.patch \ + file://Check-rpm-parser.patch \ + file://Remove-digest-list-from-the-kernel-during-package-re.patch \ + file://Add-license-to-digest_list.c.patch \ + file://Avoid-generating-digest-lists-if-they-are-already-pa.patch \ + file://dont-remove-ima-xattr-of-parser-when-upgrading.patch \ + file://backport-Use-root-as-default-UID_0_USER-and-UID_0_GROUP.patch \ + file://backport-Check-file-iterator-for-being-NULL-consistently.patch \ + file://backport-Process-MPI-s-from-all-kinds-of-signatures.patch \ + file://backport-Refactor-pgpDigParams-construction-to-helper-functio.patch \ + file://backport-Validate-and-require-subkey-binding-signatures-on-PG.patch \ + file://backport-Revert-Explictly-skip-non-installed-files-on-erasur.patch \ + file://backport-Fix-hash-context-leak.patch \ + file://backport-Fix-hashlen-overflow.patch \ + file://backport-Fix-some-Lua-stack-leaks-in-our-initialization-code.patch \ + file://backport-Simplify-rpm_print-fixing-a-Lua-stack-leak-as-a-bonu.patch \ + file://backport-Switch-the-floating-point-type-in-rpmhook-from-float.patch \ + file://backport-Fix-a-memleak-in-ndb-from-opened-but-not-closed-dbis.patch \ + file://backport-Fix-possible-NULL-pointer-dereference-in-rpmfcClassi.patch \ + file://backport-Fix-old-Python-ts.check-argument-order-regression.patch \ + file://backport-Fix-memory-leak-in-pgpPrtParams.patch \ + file://backport-Fix-use-after-free-in-haveSignature.patch \ + file://backport-Close-file-before-replacing-signed.patch \ + file://backport-Fix-__cplusplus-misspelled-as-_cplusplus.patch \ + file://backport-treat-0-as-valid-file-descriptor.patch \ + file://backport-Skip-recorded-symlinks-in-setperms-RhBug-1900662.patch \ + file://backport-Check-that-the-CRC-length-is-correct.patch \ + file://backport-Make-rpmfiSetFX-return-code-meaningful.patch \ + file://backport-Avoid-reading-out-of-bounds-of-the-i18ntable.patch \ + file://backport-rpmkeys-exit-non-zero-on-I-O-errors.patch \ + file://backport-Prevent-NULL-deref-in-rpmfsGetStates.patch \ + file://backport-Fix-memory-leak-in-pgpPrtParams-1.patch \ + file://backport-Fix-return-value-checks-in-OpenSSL-code.patch \ + file://backport-Avoid-double-frees-if-EVP_PKEY_assign_RSA-fails.patch \ + file://backport-Require-creation-time-to-be-unique-and-hashed.patch \ + file://backport-Add-a-hashed-flag-to-pgpPrtSubtype.patch \ + file://backport-Parse-key-usage-flags.patch \ + file://backport-Ignore-subkeys-that-cannot-be-used-for-signing.patch \ + file://backport-Avoid-unneded-MPI-reparsing.patch \ + file://backport-Fix-OpenPGP-key-ID-parsing-regression.patch \ + file://backport-Fix-changelog-parsing-affecting-caller-timezone-stat.patch \ + file://backport-rpm2cpio.sh-Don-t-drop-newlines-from-header-sizes.patch \ + file://backport-Prevent-readelf-internet-access-during-rpaths-checki.patch \ + file://backport-Fix-short-circuiting-of-version-strings-in-expressio.patch \ + file://backport-Add-optional-callback-on-directory-changes-during-rp.patch \ + file://backport-CVE-2021-35937-CVE-2021-35939.patch \ + file://backport-Consolidate-skipped-hardlink-with-content-case-with-.patch \ + file://backport-Fix-sanitize-the-hardlink-metadata-setting-logic.patch \ + file://backport-Convert-the-file-creation-steps-the-at-family-of-cal.patch \ + file://backport-Bury-rpmio-FD-use-to-fsmUnpack.patch \ + file://backport-Return-descriptor-of-created-file-from-fsmMkfile.patch \ + file://backport-CVE-2021-35938.patch \ + file://backport-rpm2cpio.sh-strip-null-bytes-with-tr.patch \ + file://backport-rpm2cpio.sh-only-read-needed-bytes-of-file-magic.patch \ +" + +SRC_URI[sha256sum] = "2e0d220b24749b17810ed181ac1ed005a56bbb6bc8ac429c21f314068dc65e6a" + +##openeuler rpm not support --without-lua +EXTRA_OECONF_remove = " --without-lua" +DEPENDS += "lua" +DEPENDS_remove = "db" + +PACKAGECONFIG_append = "sqlite zstd ndb" +PACKAGECONFIG[sqlite] = "--enable-sqlite=yes,--enable-sqlite=no,sqlite3" +PACKAGECONFIG[ndb] = "--enable-ndb,--disable-ndb" +PACKAGECONFIG[bdb-ro] = "--enable-bdb-ro,--disable-bdb-ro" +PACKAGECONFIG[zstd] = "--enable-zstd=yes,--enable-zstd=no,zstd" + +RRECOMMENDS_${PN}_remove = " rpm-build" +SSTATE_HASHEQUIV_FILEMAP = " \ + populate_sysroot:*/rpm/macros:${TMPDIR} \ + populate_sysroot:*/rpm/macros:${COREBASE} \ + " + + +# remove the following actios for pythondistdeps.py after upgrade to new poky +do_install_prepend() { + # no file in new rpm version, touch one before use + mkdir -p ${D}${libdir}/rpm/ + touch ${D}${libdir}/rpm/pythondistdeps.py +} +do_install_append() { + rm -f ${D}${libdir}/rpm/pythondistdeps.py +} diff --git a/meta-openeuler/recipes-devtools/run-postinsts/run-postinsts_%.bbappend b/meta-openeuler/recipes-devtools/run-postinsts/run-postinsts_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..8ad76f38657829b9c55e83c9c638ed5b9f9e46c4 --- /dev/null +++ b/meta-openeuler/recipes-devtools/run-postinsts/run-postinsts_%.bbappend @@ -0,0 +1,4 @@ +# run-postinsts does not require code download, to avoid the conflict of run-postinsts folder +# (set by DL_DIR ?= "${OPENEULER_SP_DIR}/${BPN}" ) +# and run-postinsts script file (with run-postinsts_1.0.bb ), +OPENEULER_REPO_NAME = "run_postinsts_dummy" diff --git a/meta-openeuler/recipes-devtools/rust/cargo-bin-cross.inc b/meta-openeuler/recipes-devtools/rust/cargo-bin-cross.inc new file mode 100644 index 0000000000000000000000000000000000000000..dee434762dfd9d30d3b8318f8f964f53e45934d5 --- /dev/null +++ b/meta-openeuler/recipes-devtools/rust/cargo-bin-cross.inc @@ -0,0 +1,65 @@ +# This file is developed based on meta-rust-bin(https://github.com/rust-embedded/meta-rust-bin) +# using MIT License +# +# Copyright © 2016 meta-rust-bin author +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software +# and associated documentation files (the “Software”), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, publish, distribute, +# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# The above copyright notice and this permission notice shall be included in all copies or +# substantial portions of the Software. + +DESCRIPTION = "Cargo build tool for Rust (pre-compiled binary version)" +HOMEPAGE = "https://rust-lang.org" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +SECTION = "devel" + +inherit cross cargo + +# prevent loop dependency +DEPENDS_remove = "cargo-bin-cross-${TARGET_ARCH}" + +PN = "cargo-bin-cross-${TARGET_ARCH}" + +CARGO_HOST_TARGET = "${@rust_target(d, 'HOST')}" + +SYSROOT_DIRS_NATIVE += "${prefix}" +SYSROOT_DIRS_BLACKLIST += "\ + ${prefix}/share \ + ${prefix}/etc \ +" + +# Stripping fails because of mixed arch types (host and target) +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_SYSROOT_STRIP = "1" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_build[noexec] = "1" + +fakeroot do_install() { + ${S}/install.sh --destdir="${D}" --prefix="${prefix}" + rm -f ${D}${prefix}/lib/rustlib/uninstall.sh + rm -f ${D}${prefix}/lib/rustlib/install.log + rm -f ${D}${prefix}/lib/rustlib/components + rm -f ${D}${prefix}/lib/rustlib/rust-installer-version +} +do_install[depends] += "virtual/fakeroot-native:do_populate_sysroot" + +python () { + pv = d.getVar("PV", True) + pv_uri = pv[0:4] + '-' + pv[4:6] + '-' + pv[6:8] + target = d.getVar("CARGO_HOST_TARGET", True) + cargo_uri = ("%s;md5sum=%s;sha256sum=%s;downloadname=%s" % + (cargo_url(target), cargo_md5(target), cargo_sha256(target), + d.getVar("PN", True) + "-" + pv + "-" + target + ".tar.gz")) + src_uri = d.getVar("SRC_URI", True).split() + cargo_extract_path = cargo_url(target).split('/')[-1].replace('.tar.gz', '') + d.setVar("SRC_URI", ' '.join(src_uri + [cargo_uri])) + d.setVar("S", "${{WORKDIR}}/{}".format(cargo_extract_path)) + d.appendVarFlag("S", "vardeps", " cargo_url") + d.appendVarFlag("S", "vardepsexclude", " WORKDIR") +} diff --git a/meta-openeuler/recipes-devtools/rust/cargo-bin-cross_1.60.0.bb b/meta-openeuler/recipes-devtools/rust/cargo-bin-cross_1.60.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..33c32b66fbc0517c2f0ac441c4d450fd210eccc1 --- /dev/null +++ b/meta-openeuler/recipes-devtools/rust/cargo-bin-cross_1.60.0.bb @@ -0,0 +1,57 @@ +# This file is developed based on meta-rust-bin(https://github.com/rust-embedded/meta-rust-bin) +# using MIT License +# +# Copyright © 2016 meta-rust-bin author +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software +# and associated documentation files (the “Software”), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, publish, distribute, +# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# The above copyright notice and this permission notice shall be included in all copies or +# substantial portions of the Software. + +# This corresponds to cargo release 1.60.0 + +def get_by_triple(hashes, component, triple): + try: + return hashes[triple] + except: + raise bb.parse.SkipRecipe("Unsupported triple: %s-%s" % (component, triple)) + +def cargo_md5(triple): + HASHES = { + "aarch64-unknown-linux-gnu": "b647ea4eca4bccdd7e18bd8876272fb8", + "arm-unknown-linux-gnueabi": "c64be1b63d9b5b80d4053ba7b2f4bd9a", + "arm-unknown-linux-gnueabihf": "6ab9fda029a8f11a0f22042c0958c6b9", + "armv7-unknown-linux-gnueabihf": "f4cf6f392ccef814676b2c933ed1484c", + "i686-unknown-linux-gnu": "c94c64e74f20b0860e6d3c8fa99e654c", + "x86_64-unknown-linux-gnu": "10c9c230b5a252872459989b350b7933", + } + return get_by_triple(HASHES, "cargo", triple) + +def cargo_sha256(triple): + HASHES = { + "aarch64-unknown-linux-gnu": "60d58e3c7eac74c4e7a15799c374a49d0c3d5f9ac28534b28b9507912c1d6af5", + "arm-unknown-linux-gnueabi": "2203f2064dfed21d42ee2d78d03ece84894f5ccfab57fd4efd57760380c77bb6", + "arm-unknown-linux-gnueabihf": "df0c44c056eb704de494dddf8dd5c02b58283ad8a34e980b4e75a8a9d197cf95", + "armv7-unknown-linux-gnueabihf": "1e617ae218e2f2bd607211daea6426db4d5b3b93498b4f76058bea8b9c9f5120", + "i686-unknown-linux-gnu": "8989db50fdd8d3bbd682295b3da1a0e3c2a4548cc0559c26b671e197b30f03d2", + "x86_64-unknown-linux-gnu": "6dfc8b0e2d5ac2ccfc4daff66f1e4ea83af47e491edbc56c867de0227eb0cfd5", + } + return get_by_triple(HASHES, "cargo", triple) + +def cargo_url(triple): + URLS = { + "aarch64-unknown-linux-gnu": "https://static.rust-lang.org/dist/2022-04-07/cargo-1.60.0-aarch64-unknown-linux-gnu.tar.gz", + "arm-unknown-linux-gnueabi": "https://static.rust-lang.org/dist/2022-04-07/cargo-1.60.0-arm-unknown-linux-gnueabi.tar.gz", + "arm-unknown-linux-gnueabihf": "https://static.rust-lang.org/dist/2022-04-07/cargo-1.60.0-arm-unknown-linux-gnueabihf.tar.gz", + "armv7-unknown-linux-gnueabihf": "https://static.rust-lang.org/dist/2022-04-07/cargo-1.60.0-armv7-unknown-linux-gnueabihf.tar.gz", + "i686-unknown-linux-gnu": "https://static.rust-lang.org/dist/2022-04-07/cargo-1.60.0-i686-unknown-linux-gnu.tar.gz", + "x86_64-unknown-linux-gnu": "https://static.rust-lang.org/dist/2022-04-07/cargo-1.60.0-x86_64-unknown-linux-gnu.tar.gz", + } + return get_by_triple(URLS, "cargo_url", triple) + +DEPENDS += "rustc-bin-cross-${TARGET_ARCH} (= 1.60.0)" + +require cargo-bin-cross.inc diff --git a/meta-openeuler/recipes-devtools/rust/rustc-bin-cross.inc b/meta-openeuler/recipes-devtools/rust/rustc-bin-cross.inc new file mode 100644 index 0000000000000000000000000000000000000000..7a2b5f7a559749ded7c6c03cb3a677e62af4515b --- /dev/null +++ b/meta-openeuler/recipes-devtools/rust/rustc-bin-cross.inc @@ -0,0 +1,87 @@ +# This file is developed based on meta-rust-bin(https://github.com/rust-embedded/meta-rust-bin) +# using MIT License +# +# Copyright © 2016 meta-rust-bin author +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software +# and associated documentation files (the “Software”), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, publish, distribute, +# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# The above copyright notice and this permission notice shall be included in all copies or +# substantial portions of the Software. + +DESCRIPTION = "Rust compiler and standard libraries (pre-compiled binary version)" +HOMEPAGE = "https://rust-lang.org" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +SECTION = "devel" + +inherit cross cargo + +# prevent loop dependency +DEPENDS_remove = "cargo-bin-cross-${TARGET_ARCH}" + +# Required to link binaries +DEPENDS += "gcc-cross-${TARGET_ARCH}" + +PN = "rustc-bin-cross-${TARGET_ARCH}" + +# Extra architectures to install standard library for. Must match one of the +# standard rust targets. The standard library for the default host and target +# will be installed automatically. +EXTRA_RUST_TARGETS ?= "" + +RUST_BUILD_TARGET = "${@rust_target(d, 'BUILD')}" +RUST_TARGET_TARGET = "${@rust_target(d, 'TARGET')}" +RUST_ALL_TARGETS = "${RUST_BUILD_TARGET} ${RUST_TARGET_TARGET} ${EXTRA_RUST_TARGETS}" + +S = "${WORKDIR}/rustc-${PV}-${RUST_BUILD_TARGET}" + +# Relocating WORKDIR doesn't matter to installer +S[vardepsexclude] += "WORKDIR" + +SYSROOT_DIRS_NATIVE += "${prefix}" +SYSROOT_DIRS_BLACKLIST += "\ + ${prefix}/share \ + ${prefix}/etc \ +" + +# Stripping fails because of mixed arch types (host and target) +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_SYSROOT_STRIP = "1" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_build[noexec] = "1" + +fakeroot do_install() { + # Install rustc + ${S}/install.sh --verbose --destdir="${D}" --prefix="${prefix}" + + # Install rust standard libraries + cd ${WORKDIR}/rust-std + for subdir in *; do + $subdir/install.sh --destdir="${D}" --prefix="${prefix}" + done + + # Remove components that will conflict with other installables + rm -f ${D}${prefix}/lib/rustlib/uninstall.sh + rm -f ${D}${prefix}/lib/rustlib/install.log + rm -f ${D}${prefix}/lib/rustlib/components + rm -f ${D}${prefix}/lib/rustlib/rust-installer-version +} +do_install[depends] += "virtual/fakeroot-native:do_populate_sysroot" + +python () { + pv = d.getVar("PV", True) + base_uri = d.getVar("RUST_BASE_URI", True) + targets = d.getVar("RUST_ALL_TARGETS", True).split() + build_target = d.getVar("RUST_BUILD_TARGET", True) + rustc_src_uri = ("%s/dist/rustc-%s-%s.tar.gz;md5sum=%s;sha256sum=%s" % + (base_uri, pv, build_target, rustc_md5(build_target), rustc_sha256(build_target))) + std_src_uris = ["%s/dist/rust-std-${PV}-%s.tar.gz;md5sum=%s;sha256sum=%s;subdir=rust-std" % + (base_uri, target, rust_std_md5(target), rust_std_sha256(target)) for target in targets] + src_uri = d.getVar("SRC_URI", True).split() + d.setVar("SRC_URI", ' '.join(src_uri + [rustc_src_uri] + std_src_uris)) +} diff --git a/meta-openeuler/recipes-devtools/rust/rustc-bin-cross_1.60.0.bb b/meta-openeuler/recipes-devtools/rust/rustc-bin-cross_1.60.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..6465085883f49ad61405db54451cf93c03135555 --- /dev/null +++ b/meta-openeuler/recipes-devtools/rust/rustc-bin-cross_1.60.0.bb @@ -0,0 +1,70 @@ +# This file is developed based on meta-rust-bin(https://github.com/rust-embedded/meta-rust-bin) +# using MIT License +# +# Copyright © 2016 meta-rust-bin author +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software +# and associated documentation files (the “Software”), to deal in the Software without restriction, +# including without limitation the rights to use, copy, modify, merge, publish, distribute, +# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# The above copyright notice and this permission notice shall be included in all copies or +# substantial portions of the Software. + +def get_by_triple(hashes, component, triple): + try: + return hashes[triple] + except: + raise bb.parse.SkipRecipe("Unsupported triple: %s-%s" % (component, triple)) + +def rust_std_md5(triple): + HASHES = { + "aarch64-unknown-linux-gnu": "8b833ed24714e4e3fa2007dd25bc84b4", + "aarch64-unknown-linux-musl": "59c7157e37dfe682f78953d6298c9739", + "arm-unknown-linux-gnueabi": "2d9d59506435a3818974fdb3d42afbd6", + "arm-unknown-linux-gnueabihf": "4afbb11590395ea1b91923906c39a2a4", + "armv7-unknown-linux-gnueabihf": "4b1625ccaac350176c225861cb035438", + "armv7-unknown-linux-musleabihf": "7e1d13f25ba9c878695c6a850113ab30", + "i686-unknown-linux-gnu": "2976701fa2745b4c98ca45af39367296", + "x86_64-unknown-linux-gnu": "688fabc8b9db1ae9a06ccdd4b200ff95", + } + return get_by_triple(HASHES, "rust-std", triple) + +def rust_std_sha256(triple): + HASHES = { + "aarch64-unknown-linux-gnu": "790b12924797dd00e550f3205c8f6403e73124b88de10a77b00830f67904630c", + "aarch64-unknown-linux-musl": "1f023fb8e8d41451e503e1d194f674ba12b37da79612018d77dc13860b8b694d", + "arm-unknown-linux-gnueabi": "9023211fc273ede0a2e80ebc2c78059a8211734a6f8bdf91853b165e70eaf58b", + "arm-unknown-linux-gnueabihf": "edbb346595fc79131476ee09dd6cf97e6cf44682e34ebb950779b950301521ef", + "armv7-unknown-linux-gnueabihf": "90218ecee6c67a8d3d8bc94022d6e0a66e9addbe6a6bfcfa8fd4977ff743496f", + "armv7-unknown-linux-musleabihf": "ba8da062d443e4d148feb080b1245fb2fc2170def8cb8cd71248b95b33c93a91", + "i686-unknown-linux-gnu": "95657c1f612115bdb434f8a0e049df058ac2d3d139f347aa01007aca82951615", + "x86_64-unknown-linux-gnu": "963fd25a1f0e986a890e0f99f14902314c71e00f3b14bb587a08ca447ea7d1a6", + } + return get_by_triple(HASHES, "rust-std", triple) + +def rustc_md5(triple): + HASHES = { + "aarch64-unknown-linux-gnu": "f13d49cea397bd748ea613c65d3f8fee", + "arm-unknown-linux-gnueabi": "80617d9d10ef7a8d6ccd66e6308863f1", + "arm-unknown-linux-gnueabihf": "5d823112d719df5e54a0726da8535cfa", + "armv7-unknown-linux-gnueabihf": "2c5b930841a769495e22bbf53e73a719", + "i686-unknown-linux-gnu": "f2d599a6c36d2973aab640ba8f79e7c9", + "x86_64-unknown-linux-gnu": "9e3ddf8c08499f685ad36b72d417857a", + } + return get_by_triple(HASHES, "rustc", triple) + +def rustc_sha256(triple): + HASHES = { + "aarch64-unknown-linux-gnu": "0e1ada844aa2f0fa9c1dcfd9352ddd400f67890131eb5873fd3e9ec700b911e1", + "arm-unknown-linux-gnueabi": "dcab6611845e3a2bbcd59a6a238d4ee561736f138eea0b8a86fa04621aa7d9fd", + "arm-unknown-linux-gnueabihf": "1fee8c2b6ca8d523a0b727b0819b3a92051ce4c5d8ea75e1df2021a1bce85e76", + "armv7-unknown-linux-gnueabihf": "bfc8520dbb0bd27af75bfee3015c3e68a1f44d0e2ffaedd13082c7364c6f913f", + "i686-unknown-linux-gnu": "04da8b7af94b9b6b0fe50b296ee69c2f26cd7341ff2a31686a66dffdc0d24ed5", + "x86_64-unknown-linux-gnu": "d68a0566627ea0d481ee5e57c1bfc995c10ff55ffad34b2508c747429c3bbd6e", + } + return get_by_triple(HASHES, "rustc", triple) + +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0" + +require rustc-bin-cross.inc diff --git a/meta-openeuler/recipes-devtools/squashfs-tools/files/0001-install-manpages.sh-do-not-write-original-timestamps.patch b/meta-openeuler/recipes-devtools/squashfs-tools/files/0001-install-manpages.sh-do-not-write-original-timestamps.patch new file mode 100644 index 0000000000000000000000000000000000000000..ed1d2f5b3b2f7ed0eb8522888e4a65e5ae29f8a1 --- /dev/null +++ b/meta-openeuler/recipes-devtools/squashfs-tools/files/0001-install-manpages.sh-do-not-write-original-timestamps.patch @@ -0,0 +1,30 @@ +From b44b00dae195d8587857c7e8054e9be4eaa1f8b3 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Thu, 7 Apr 2022 09:26:09 +0200 +Subject: [PATCH] install-manpages.sh: do not write original timestamps into + .gz metadata + +This helps binary reproducibility. + +Upstream-Status: Submitted [https://github.com/plougher/squashfs-tools/pull/177] +Signed-off-by: Alexander Kanavin +--- + generate-manpages/install-manpages.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/generate-manpages/install-manpages.sh b/generate-manpages/install-manpages.sh +index d4c9e91..6a43b89 100755 +--- a/generate-manpages/install-manpages.sh ++++ b/generate-manpages/install-manpages.sh +@@ -56,7 +56,7 @@ for i in mksquashfs unsquashfs sqfstar sqfscat; do + exit 1 + fi + +- if ! gzip -f9 $2/$i.1; then ++ if ! gzip -n -f9 $2/$i.1; then + echo "$0: Compressing installed manpage failed. Aborting" >&2 + exit 1 + fi +-- +2.30.2 + diff --git a/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools/0001-Avoid-use-of-INSTALL_DIR-for-symlink-targets.patch b/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools/0001-Avoid-use-of-INSTALL_DIR-for-symlink-targets.patch deleted file mode 100644 index bb3f6960554368ed2d85e8b80ce52450a150ea1e..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools/0001-Avoid-use-of-INSTALL_DIR-for-symlink-targets.patch +++ /dev/null @@ -1,35 +0,0 @@ -From f5c908e92d4c055859be2fddbda266d9e3bfd415 Mon Sep 17 00:00:00 2001 -From: Patrick McCarty -Date: Mon, 26 Jul 2021 11:38:43 -0700 -Subject: [PATCH] Avoid use of INSTALL_DIR for symlink targets - -In case INSTALL_DIR is overridden with a staged install location, using -INSTALL_DIR for the symlink target path prefix will yield an incorrect location -for the final installation. - -Because the symlink itself is already installed to INSTALL_DIR, simply removing -the INSTALL_DIR prefix suffices as a fix. - -Note that using $DESTDIR/$INSTALL_DIR where appropriate can avoid this type of -issue, but that can be considered a future enhancement. - -Signed-off-by: Patrick McCarty ---- - squashfs-tools/Makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/squashfs-tools/Makefile b/squashfs-tools/Makefile -index f5a55f1..7262a2e 100755 ---- a/squashfs-tools/Makefile -+++ b/squashfs-tools/Makefile -@@ -406,5 +406,5 @@ install: mksquashfs unsquashfs - mkdir -p $(INSTALL_DIR) - cp mksquashfs $(INSTALL_DIR) - cp unsquashfs $(INSTALL_DIR) -- ln -fs $(INSTALL_DIR)/unsquashfs $(INSTALL_DIR)/sqfscat -- ln -fs $(INSTALL_DIR)/mksquashfs $(INSTALL_DIR)/sqfstar -+ ln -fs unsquashfs $(INSTALL_DIR)/sqfscat -+ ln -fs mksquashfs $(INSTALL_DIR)/sqfstar --- -2.30.0 - diff --git a/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_%.bbappend b/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..fcebeb36349a70be71ae9200b83e616d69e27cd1 --- /dev/null +++ b/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_%.bbappend @@ -0,0 +1,18 @@ +# main bbfile: yocto-poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb + +# version in openEuler +PV = "4.5.1" + +FILESEXTRAPATHS_append := "${THISDIR}/files/:" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI = "" +S = "${WORKDIR}/${BP}" + +# files, patches that come from openeuler +SRC_URI =+ " \ + file://${BPN}-${PV}.tar.gz \ + " + +SRC_URI[md5sum] = "edc3e14508f2716315787b9c88d163a1" +SRC_URI[sha256sum] = "277b6e7f75a4a57f72191295ae62766a10d627a4f5e5f19eadfbc861378deea7" diff --git a/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_4.5.bb b/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_git.bb similarity index 37% rename from meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_4.5.bb rename to meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_git.bb index 2b6a1cd25a5f9726a813e971f87fdd4e168c0d42..4c91331ebbc0b7fda5f5521f74020001ca8bb206 100644 --- a/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_4.5.bb +++ b/meta-openeuler/recipes-devtools/squashfs-tools/squashfs-tools_git.bb @@ -1,42 +1,51 @@ +# This recipe is from the master branch of openembedded-core and can be deleted +# after upgrading to the openembedded-core. + # Note, we can probably remove the lzma option as it has be replaced with xz, # and I don't think the kernel supports it any more. SUMMARY = "Tools for manipulating SquashFS filesystems" HOMEPAGE = "https://github.com/plougher/squashfs-tools" DESCRIPTION = "Tools to create and extract Squashfs filesystems." SECTION = "base" -LICENSE = "GPL-2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" -SRC_URI = "file://squashfs-tools/squashfs4.5.tar.gz \ - file://squashfs-tools/0001-CVE-2021-41072.patch \ - file://squashfs-tools/0002-CVE-2021-41072.patch \ - file://squashfs-tools/0003-CVE-2021-41072.patch \ - file://squashfs-tools/0004-CVE-2021-41072.patch \ - file://squashfs-tools/0005-CVE-2021-41072.patch \ - file://0001-Avoid-use-of-INSTALL_DIR-for-symlink-targets.patch \ -" +PV = "4.5.1" +SRCREV = "afdd63fc386919b4aa40d573b0a6069414d14317" +SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https;branch=master \ + file://0001-install-manpages.sh-do-not-write-original-timestamps.patch \ + " +UPSTREAM_CHECK_GITTAGREGEX = "(?P(\d+(\.\d+)+))" -S = "${WORKDIR}/${BP}" -B = "${S}/${PN}" +S = "${WORKDIR}/git" EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS}" -PACKAGECONFIG ??= "gzip xz xattr" +PACKAGECONFIG ??= "gzip xz lzo lz4 lzma xattr zstd reproducible" PACKAGECONFIG[gzip] = "GZIP_SUPPORT=1,GZIP_SUPPORT=0,zlib" PACKAGECONFIG[xz] = "XZ_SUPPORT=1,XZ_SUPPORT=0,xz" +PACKAGECONFIG[lzo] = "LZO_SUPPORT=1,LZO_SUPPORT=0,lzo" +PACKAGECONFIG[lz4] = "LZ4_SUPPORT=1,LZ4_SUPPORT=0,lz4" +PACKAGECONFIG[lzma] = "LZMA_XZ_SUPPORT=1,LZMA_XZ_SUPPORT=0,xz" PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr" +PACKAGECONFIG[zstd] = "ZSTD_SUPPORT=1,ZSTD_SUPPORT=0,zstd" +PACKAGECONFIG[reproducible] = "REPRODUCIBLE_DEFAULT=1,REPRODUCIBLE_DEFAULT=0," do_compile() { + cd ${S}/squashfs-tools oe_runmake all } do_install() { - oe_runmake install INSTALL_DIR=${D}${sbindir} + cd ${S}/squashfs-tools + install -d "${D}${includedir}" + oe_runmake install INSTALL_PREFIX=${D}${prefix} INSTALL_MANPAGES_DIR=${D}${datadir}/man/man1 + install -m 0644 "${S}"/squashfs-tools/squashfs_fs.h "${D}${includedir}" } -ARM_INSTRUCTION_SET_armv4 = "arm" -ARM_INSTRUCTION_SET_armv5 = "arm" -ARM_INSTRUCTION_SET_armv6 = "arm" +ARM_INSTRUCTION_SET:armv4 = "arm" +ARM_INSTRUCTION_SET:armv5 = "arm" +ARM_INSTRUCTION_SET:armv6 = "arm" BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-devtools/strace/strace/run-ptest b/meta-openeuler/recipes-devtools/strace/strace/run-ptest deleted file mode 100755 index 3a51fb0be9d8b844cd4b285d8da4ac0da4aa53a4..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/strace/strace/run-ptest +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -export TIMEOUT_DURATION=240 -chown nobody tests -chown nobody tests/* -chown nobody ../ptest -su nobody -c "make -B -C tests -k test-suite.log" diff --git a/meta-openeuler/recipes-devtools/strace/strace_%.bbappend b/meta-openeuler/recipes-devtools/strace/strace_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a26d36ba7cef3ff95a1ce37e461ea1afe3f981e4 --- /dev/null +++ b/meta-openeuler/recipes-devtools/strace/strace_%.bbappend @@ -0,0 +1,11 @@ +# main bbfile: yocto-poky/meta/recipes-devtools/strace/strace_5.11.bb + +# strace version in openEuler, this version needs to match the kernel +PV = "5.14" +OPENEULER_BRANCH = "openEuler-22.03-LTS-SP1" + +# remove conflict patch +SRC_URI_remove += "file://Makefile-ptest.patch" + +SRC_URI[md5sum] = "36c1c17f31855617b7898d2fd5abb9e2" +SRC_URI[sha256sum] = "901bee6db5e17debad4530dd9ffb4dc9a96c4a656edbe1c3141b7cb307b11e73" diff --git a/meta-openeuler/recipes-devtools/strace/strace_5.14.bb b/meta-openeuler/recipes-devtools/strace/strace_5.14.bb deleted file mode 100644 index 7125c0ef9e100afe1523cf7663fdb08e0b813c73..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-devtools/strace/strace_5.14.bb +++ /dev/null @@ -1,49 +0,0 @@ -SUMMARY = "System call tracing tool" -HOMEPAGE = "http://strace.io" -DESCRIPTION = "strace is a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state." -SECTION = "console/utils" -LICENSE = "LGPL-2.1+ & GPL-2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=318cfc887fc8723f4e9d4709b55e065b" - -SRC_URI = "file://strace/strace-${PV}.tar.xz \ - file://run-ptest \ - " -SRC_URI[sha256sum] = "901bee6db5e17debad4530dd9ffb4dc9a96c4a656edbe1c3141b7cb307b11e73" - -inherit autotools ptest - -#PACKAGECONFIG_class-target ??= "\ -# ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ -#" - -#PACKAGECONFIG[bluez] = "ac_cv_header_bluetooth_bluetooth_h=yes,ac_cv_header_bluetooth_bluetooth_h=no,bluez5" -PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind" - -EXTRA_OECONF += "--enable-mpers=no --disable-gcc-Werror" - -CFLAGS_append_libc-musl = " -Dsigcontext_struct=sigcontext" - -TESTDIR = "tests" -PTEST_BUILD_HOST_PATTERN = "^(DEB_CHANGELOGTIME|RPM_CHANGELOGTIME|WARN_CFLAGS_FOR_BUILD|LDFLAGS_FOR_BUILD)" - -do_compile_ptest() { - oe_runmake ${PARALLEL_MAKE} -C ${TESTDIR} buildtest-TESTS -} - -do_install_ptest() { - oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR} - mkdir -p ${D}${PTEST_PATH}/build-aux - mkdir -p ${D}${PTEST_PATH}/src - install -m 755 ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ - install -m 644 ${B}/src/config.h ${D}${PTEST_PATH}/src/ - sed -i -e '/^src/s/strace.*[0-9]/ptest/' ${D}/${PTEST_PATH}/${TESTDIR}/Makefile -} - -RDEPENDS_${PN}-ptest += "make coreutils grep gawk sed" - -RDEPENDS_${PN}-ptest_append_libc-glibc = "\ - locale-base-en-us.iso-8859-1 \ -" - -BBCLASSEXTEND = "native" -TOOLCHAIN = "gcc" diff --git a/meta-openeuler/recipes-devtools/swig/files/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch b/meta-openeuler/recipes-devtools/swig/files/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch new file mode 100644 index 0000000000000000000000000000000000000000..f27f80ea184bf790337604fa0892ff956fd6a36d --- /dev/null +++ b/meta-openeuler/recipes-devtools/swig/files/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch @@ -0,0 +1,64 @@ +From a4a0440a644c6c5e5da096efe3cf05ba309a284f Mon Sep 17 00:00:00 2001 +From: "NODA, Kai" +Date: Sun, 22 Apr 2012 17:01:02 +0900 +Subject: [PATCH] Use /proc/self/exe for "swig -swiglib" on non-Win32 + platforms. + +If it wasn't found, then fall back to a fixed string just as before. + +Upstream-Status: Submitted +http://sourceforge.net/mailarchive/message.php?msg_id=29179733 + +--- + Source/Modules/main.cxx | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +--- a/Source/Modules/main.cxx ++++ b/Source/Modules/main.cxx +@@ -25,6 +25,11 @@ + #include + #include + #include // for INT_MAX ++#ifndef _WIN32 ++#include ++#include // for readlink ++#include // for stat ++#endif + + // Global variables + +@@ -934,9 +939,9 @@ int SWIG_main(int argc, char *argv[], co + + // Check for SWIG_LIB environment variable + if ((c = getenv("SWIG_LIB")) == (char *) 0) { ++ char *p; + #if defined(_WIN32) + char buf[MAX_PATH]; +- char *p; + if (!(GetModuleFileName(0, buf, MAX_PATH) == 0 || (p = strrchr(buf, '\\')) == 0)) { + *(p + 1) = '\0'; + SwigLib = NewStringf("%sLib", buf); // Native windows installation path +@@ -946,7 +951,22 @@ int SWIG_main(int argc, char *argv[], co + if (Len(SWIG_LIB_WIN_UNIX) > 0) + SwigLibWinUnix = NewString(SWIG_LIB_WIN_UNIX); // Unix installation path using a drive letter (for msys/mingw) + #else +- SwigLib = NewString(SWIG_LIB); ++ char buf[PATH_MAX]; ++ if (0 < ::readlink("/proc/self/exe", buf, sizeof(buf)) && ++ (p = ::strstr(buf, "/bin/swig"))) { ++ int major, minor, patch; ++ const int ret = ::sscanf(VERSION, "%d.%d.%d", &major, &minor, &patch); ++ if (3 == ret) { ++ const ::ptrdiff_t dir_part_len = p - buf; ++ ::snprintf(p, PATH_MAX - dir_part_len, "/share/swig/%d.%d.%d", major, minor, patch); ++ struct ::stat stat_res; ++ if (0 == ::stat(buf, &stat_res) && S_ISDIR(stat_res.st_mode)) { ++ SwigLib = NewString(buf); ++ } ++ } ++ } ++ if (NULL == SwigLib) ++ SwigLib = NewString(SWIG_LIB); + #endif + } else { + SwigLib = NewString(c); diff --git a/meta-openeuler/recipes-devtools/swig/files/0001-configure-use-pkg-config-for-pcre-detection.patch b/meta-openeuler/recipes-devtools/swig/files/0001-configure-use-pkg-config-for-pcre-detection.patch new file mode 100644 index 0000000000000000000000000000000000000000..fdb9760e89c9304a19590290152cd8684289734d --- /dev/null +++ b/meta-openeuler/recipes-devtools/swig/files/0001-configure-use-pkg-config-for-pcre-detection.patch @@ -0,0 +1,59 @@ +From 5c4d6d8538994d5fe9b3b46bfafaf0a605e3bda6 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Tue, 17 Jun 2014 08:18:17 +0200 +Subject: [PATCH] configure: use pkg-config for pcre detection + +Signed-off-by: Koen Kooi +Upstream-Status: Pending +--- + configure.ac | 38 +++++++------------------------------- + 1 file changed, 7 insertions(+), 31 deletions(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -52,38 +52,14 @@ AC_MSG_RESULT([$with_pcre]) + + dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script + if test x"${with_pcre}" = xyes ; then +- AC_MSG_CHECKING([whether to use local PCRE]) +- local_pcre_config=no +- if test -z $PCRE_CONFIG; then +- if test -f `pwd`/pcre/pcre-swig-install/bin/pcre-config; then +- PCRE_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre-config +- local_pcre_config=$PCRE_CONFIG +- fi +- fi +- AC_MSG_RESULT([$local_pcre_config]) +-fi +-AS_IF([test "x$with_pcre" != xno], +- [AX_PATH_GENERIC([pcre], +- [], dnl Minimal version of PCRE we need -- accept any +- [], dnl custom sed script for version parsing is not needed +- [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library]) +- LIBS="$LIBS $PCRE_LIBS" +- CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS" +- ], +- [AC_MSG_FAILURE([ +- Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions) +- library package. This dependency is needed for configure to complete, +- Either: +- - Install the PCRE developer package on your system (preferred approach). +- - Download the PCRE source tarball, build and install on your system +- as you would for any package built from source distribution. +- - Use the Tools/pcre-build.sh script to build PCRE just for SWIG to statically +- link against. Run 'Tools/pcre-build.sh --help' for instructions. +- (quite easy and does not require privileges to install PCRE on your system) +- - Use configure --without-pcre to disable regular expressions support in SWIG +- (not recommended).]) +- ]) ++ PKG_CHECK_MODULES([PCRE], [libpcre], [ ++ AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library]) ++ LIBS="$LIBS $PCRE_LIBS" ++ CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS" ++ ], [ ++ AC_MSG_WARN([$PCRE_PKG_ERRORS]) + ]) ++fi + + + dnl CCache diff --git a/meta-openeuler/recipes-devtools/swig/files/determinism.patch b/meta-openeuler/recipes-devtools/swig/files/determinism.patch new file mode 100644 index 0000000000000000000000000000000000000000..84c399182a4c30f8f9e21a869e8c5c108aa51377 --- /dev/null +++ b/meta-openeuler/recipes-devtools/swig/files/determinism.patch @@ -0,0 +1,17 @@ +Remove the compiler commandline/platform from the compiled binary as this +breaks reproducibilty. + +Upstream-Status: Inappropriate [OE reproducibiity fix upstream unlikely to take] +RP 2021/3/1 + + +--- a/Source/Modules/main.cxx ++++ b/Source/Modules/main.cxx +@@ -642,7 +642,6 @@ static void getoptions(int argc, char *a + } + } else if (strcmp(argv[i], "-version") == 0) { + fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version()); +- fprintf(stdout, "\nCompiled with %s [%s]\n", SWIG_CXX, SWIG_PLATFORM); + fprintf(stdout, "\nConfigured options: %cpcre\n", + #ifdef HAVE_PCRE + '+' diff --git a/meta-openeuler/recipes-devtools/swig/swig_%.bbappend b/meta-openeuler/recipes-devtools/swig/swig_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..cd2619b040fc70274a15439df348465f5eece5c8 --- /dev/null +++ b/meta-openeuler/recipes-devtools/swig/swig_%.bbappend @@ -0,0 +1,12 @@ +PV = "4.0.2" +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +# openeuler add patches to change pcre to pcre2, no apply +SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz" +SRC_URI += "file://0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch \ + file://determinism.patch \ + file://0001-configure-use-pkg-config-for-pcre-detection.patch \ + " + +SRC_URI[md5sum] = "7c3e46cb5af2b469722cafa0d91e127b" +SRC_URI[sha256sum] = "d53be9730d8d58a16bf0cbd1f8ac0c0c3e1090573168bfa151b01eb47fa906fc" diff --git a/meta-openeuler/recipes-devtools/syslinux/syslinux_%.bbappend b/meta-openeuler/recipes-devtools/syslinux/syslinux_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..4b109491f8bffb836deb88ed02e6a3c4963ea264 --- /dev/null +++ b/meta-openeuler/recipes-devtools/syslinux/syslinux_%.bbappend @@ -0,0 +1,31 @@ +# main bb file: yocto-poky/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb +# isolinux.bin is used to support PCBIOS startup ISO, which is also the bootloader like grub + +# version in openEuler +PV = "6.04-pre1" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ + https://www.zytor.com/pub/syslinux/Testing/6.04/syslinux-${PV}.tar.xz \ + file://determinism.patch \ +" + +# files, patches that come from openeuler +SRC_URI_prepend = " \ + file://${BP}.tar.xz;name=tarball \ + file://0001-Add-install-all-target-to-top-side-of-HAVE_FIRMWARE.patch \ + file://0002-ext4-64bit-feature.patch \ + file://0003-include-sysmacros-h.patch \ + file://backport-add-RPMOPTFLAGS-to-CFLAGS-for-some-stuff.patch \ + file://backport-replace-builtin-strlen-that-appears-to-get-optimized.patch \ + file://backport-tweak-for-gcc-10.patch \ +" + +SRC_URI[tarball.md5sum] = "f9c956fde0de29be297402ecbc8ff4d0" +SRC_URI[tarball.sha256sum] = "3f6d50a57f3ed47d8234fd0ab4492634eb7c9aaf7dd902f33d3ac33564fd631d" + +do_install_append() { + install -d ${D}${datadir}/syslinux/ + install -m 644 ${S}/bios/core/isolinux.bin ${D}${datadir}/syslinux/ + install -m 644 ${S}/bios/com32/elflink/ldlinux/ldlinux.c32 ${D}${datadir}/syslinux/ +} diff --git a/meta-openeuler/recipes-devtools/tcltk/files/fix_non_native_build_issue.patch b/meta-openeuler/recipes-devtools/tcltk/files/fix_non_native_build_issue.patch new file mode 100644 index 0000000000000000000000000000000000000000..d81555aad603b0fe85647f7f4e47228dfaff68f1 --- /dev/null +++ b/meta-openeuler/recipes-devtools/tcltk/files/fix_non_native_build_issue.patch @@ -0,0 +1,65 @@ +Upstream-Status: Pending + +Index: unix/Makefile.in +=================================================================== +--- unix.orig/Makefile.in 2013-11-10 23:37:34.243424934 -0800 ++++ unix/Makefile.in 2013-11-10 23:37:34.243424934 -0800 +@@ -709,23 +709,23 @@ + test: test-tcl test-packages + + test-tcl: ${TCLTEST_EXE} +- $(SHELL_ENV) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) ++ $(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) + + gdb-test: ${TCLTEST_EXE} + @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run + @echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run + @echo "set args $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) -singleproc 1" >> gdb.run +- $(GDB) ./${TCLTEST_EXE} --command=gdb.run ++ $(GDB) ${TCLTEST_EXE} --command=gdb.run + rm gdb.run + + # Useful target to launch a built tcltest with the proper path,... + runtest: ${TCLTEST_EXE} +- $(SHELL_ENV) ./${TCLTEST_EXE} ++ $(SHELL_ENV) ${TCLTEST_EXE} + + # Useful target for running the test suite with an unwritable current + # directory... + ro-test: ${TCLTEST_EXE} +- echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ./${TCLTEST_EXE} ++ echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ${TCLTEST_EXE} + + # The following target generates the shared libraries in dltest/ that are used + # for testing; they are included as part of the "tcltest" target (via the +@@ -743,23 +743,23 @@ # This target can be used to run tclsh from the build directory + # via `make shell SCRIPT=/tmp/foo.tcl` + shell: ${TCL_EXE} +- $(SHELL_ENV) ./${TCL_EXE} $(SCRIPT) ++ $(SHELL_ENV) ${TCL_EXE} $(SCRIPT) + + # This target can be used to run tclsh inside either gdb or insight + gdb: ${TCL_EXE} +- $(SHELL_ENV) $(GDB) ./${TCL_EXE} ++ $(SHELL_ENV) $(GDB) ${TCL_EXE} + + valgrind: ${TCL_EXE} ${TCLTEST_EXE} +- $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCLTEST_EXE} \ ++ $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ${TCLTEST_EXE} \ + $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind \ + $(TESTFLAGS) + + valgrindshell: ${TCL_EXE} +- $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCL_EXE} $(SCRIPT) ++ $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ${TCL_EXE} $(SCRIPT) + + trace-shell: ${TCL_EXE} +- $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCL_EXE} $(SCRIPT) ++ $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ${TCL_EXE} $(SCRIPT) + + trace-test: ${TCLTEST_EXE} +- $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS) ++ $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS) + + #-------------------------------------------------------------------------- + # Installation rules diff --git a/meta-openeuler/recipes-devtools/tcltk/files/no_packages.patch b/meta-openeuler/recipes-devtools/tcltk/files/no_packages.patch new file mode 100644 index 0000000000000000000000000000000000000000..f47537fd16b3907b29ae7c80fd96723ded5bb529 --- /dev/null +++ b/meta-openeuler/recipes-devtools/tcltk/files/no_packages.patch @@ -0,0 +1,52 @@ +tcl 8.6.0 builds by default a number of packages that are not needed in Yocto. +This patch changes the makefile so that these packages are not built by default. + +Upstream-Status:Inappropriate [embedded specific] + +Signed-off-by: Bogdan Marinescu + +--- a/Makefile.in ++++ b/Makefile.in +@@ -709,7 +709,7 @@ SRCS = $(GENERIC_SRCS) $(TOMMATH_SRCS) $ + # Start of rules + #-------------------------------------------------------------------------- + +-all: binaries libraries doc packages ++all: binaries libraries doc + + binaries: ${LIB_FILE} ${TCL_EXE} + +@@ -753,13 +753,13 @@ Makefile: $(UNIX_DIR)/Makefile.in $(DLTE + #tclConfig.h: $(UNIX_DIR)/tclConfig.h.in + # $(SHELL) config.status + +-clean: clean-packages ++clean: + rm -rf *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \ + errors ${TCL_EXE} ${TCLTEST_EXE} lib.exp Tcl @DTRACE_HDR@ \ + *.zip *.vfs + (cd dltest ; $(MAKE) clean) + +-distclean: distclean-packages clean ++distclean: clean + rm -rf Makefile config.status config.cache config.log tclConfig.sh \ + tclConfig.h *.plist Tcl.framework tcl.pc + (cd dltest ; $(MAKE) distclean) +@@ -807,7 +807,7 @@ tcltest-real: + # tcltest, ie: + # % make test TESTFLAGS="-verbose bps -file fileName.test" + +-test: test-tcl test-packages ++test: test-tcl + + test-tcl: ${TCLTEST_EXE} + $(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) +@@ -874,7 +874,7 @@ INSTALL_PACKAGE_TARGETS = install-packag + INSTALL_DEV_TARGETS = install-headers + INSTALL_EXTRA_TARGETS = @EXTRA_INSTALL@ + INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_DEV_TARGETS) \ +- $(INSTALL_PACKAGE_TARGETS) $(INSTALL_EXTRA_TARGETS) ++ $(INSTALL_EXTRA_TARGETS) + + install: $(INSTALL_TARGETS) + diff --git a/meta-openeuler/recipes-devtools/tcltk/files/tcl-add-soname.patch b/meta-openeuler/recipes-devtools/tcltk/files/tcl-add-soname.patch new file mode 100644 index 0000000000000000000000000000000000000000..5b71a934a76df2c9e81d1d508da3c86f6acfb811 --- /dev/null +++ b/meta-openeuler/recipes-devtools/tcltk/files/tcl-add-soname.patch @@ -0,0 +1,46 @@ +Upstream-Status: Pending + +Index: unix/configure +=================================================================== +--- unix.orig/configure 2013-09-19 13:17:13.000000000 -0700 ++++ unix/configure 2013-11-11 00:20:51.519490342 -0800 +@@ -7599,6 +7599,9 @@ + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + ++ # following line added by CW for Debian GNU/Linux ++ TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\${TCL_LIB_FILE}.0" ++ + SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" +Index: unix/tcl.m4 +=================================================================== +--- unix.orig/tcl.m4 2013-09-19 13:17:13.000000000 -0700 ++++ unix/tcl.m4 2013-11-11 00:17:24.263485123 -0800 +@@ -1415,6 +1415,9 @@ + # get rid of the warnings. + #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" + ++ # following line added by CW for Debian GNU/Linux ++ TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\${TCL_LIB_FILE}.0" ++ + SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" +Index: unix/Makefile.in +=================================================================== +--- unix.orig/Makefile.in 2013-09-19 13:17:13.000000000 -0700 ++++ unix/Makefile.in 2013-11-11 00:20:32.423489861 -0800 +@@ -796,7 +796,10 @@ + done + @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" + @@INSTALL_LIB@ +- @chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)" ++ mv "$(DLL_INSTALL_DIR)"/$(LIB_FILE) "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0 ++ ln -sf $(LIB_FILE).0 "$(DLL_INSTALL_DIR)"/$(LIB_FILE) ++ ln -sf "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0 ./ ++ @chmod 555 "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0 + @echo "Installing ${TCL_EXE} as $(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}" + @$(INSTALL_PROGRAM) ${TCL_EXE} "$(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}" + @echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/" diff --git a/meta-openeuler/recipes-devtools/tcltk/tcl_%.bbappend b/meta-openeuler/recipes-devtools/tcltk/tcl_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..948ac22556e83e1a8d238656213b073f79371083 --- /dev/null +++ b/meta-openeuler/recipes-devtools/tcltk/tcl_%.bbappend @@ -0,0 +1,37 @@ +# source bb: meta/recipes-devtools/tcltk/tcl_8.6.11.bb + +PV = "8.6.13" + +# modify fix_non_native_build_issue.patch for version 8.6.12 +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +BASE_SRC_URI_remove = "${SOURCEFORGE_MIRROR}/tcl/${BPN}${PV}-src.tar.gz \ +" + +# source code package name has been changed +BASE_SRC_URI =+ "file://${BPN}-core${PV}-src.tar.gz \ +" +# the list patchs that src-openeuler offerd can not patch successful, the first patch is faild +# SRC_URI += "file://tcl-8.6.12-autopath.patch +# file://tcl-8.6.12-conf.patch +# file://tcl-8.6.10-hidden.patch +# file://tcl-8.6.10-tcltests-path-fix.patch +# file://stay-out-of-internals-when-nice-interfaces-are-avail.patch +# file://oops.patch +# file://File-not-found-should-be-ignored-silently.patch +# " + +# don't patch the openeuler patch that is incompatible with the current bb, +# otherwise it may cause build problems + +SRC_URI[sha256sum] = "c61f0d6699e2bc7691f119b41963aaa8dc980f23532c4e937739832a5f4a6642" + +# no such patch in later version +SRC_URI_remove = " \ + file://fix_issue_with_old_distro_glibc.patch \ + file://fix_non_native_build_issue.patch \ + file://no_packages.patch \ +" + +# we don't need .c file pack in rootfs +FILES_${PN}-dev_append += "${libdir}/tcl8.6/*.c" diff --git a/meta-openeuler/recipes-extended/bash/bash_%.bbappend b/meta-openeuler/recipes-extended/bash/bash_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..5c0cf100aadfbf45653db8101556514369a47b15 --- /dev/null +++ b/meta-openeuler/recipes-extended/bash/bash_%.bbappend @@ -0,0 +1,38 @@ +# main bbfile: yocto-poky/meta/recipes-extended/bash/bash_5.1.bb + +# bash version in openeuler +PV = "5.1.8" + +# These patches have been merged in this version +SRC_URI_remove += " \ + ${GNU_MIRROR}/bash/bash-${PV}-patches/bash51-001;apply=yes;striplevel=0;name=patch001 \ + ${GNU_MIRROR}/bash/bash-${PV}-patches/bash51-002;apply=yes;striplevel=0;name=patch002 \ + ${GNU_MIRROR}/bash/bash-${PV}-patches/bash51-003;apply=yes;striplevel=0;name=patch003 \ + ${GNU_MIRROR}/bash/bash-${PV}-patches/bash51-004;apply=yes;striplevel=0;name=patch004 \ + " + +# patches in openeuler +SRC_URI_append += " \ + file://bash-2.05a-interpreter.patch \ + file://bash-2.05b-pgrp_sync.patch \ + file://bash-4.0-nobits.patch \ + file://bash-4.2-coverity.patch \ + file://bash-4.3-noecho.patch \ + file://bash-4.3-memleak-lc_all.patch \ + file://bugfix-Forbidden-non-root-user-to-clear-history.patch \ + file://enable-dot-logout-and-source-bashrc-through-ssh.patch \ + file://cd-alias.patch \ + file://backport-fix-crash-in-readline-when-started-with-an-invalid.patch \ + file://backport-fix-CVE-2022-3715.patch \ + file://backport-Bash-5.1-patch-10-fix-for-wait-n-being-interrupted-b.patch \ + file://backport-Bash-5.1-patch-11-save-and-restore-alias-parsing-whe.patch \ + file://backport-Bash-5.1-patch-12-fix-race-condition-with-child-proc.patch \ + file://backport-Bash-5.1-patch-15-fix-readline-display-of-some-chara.patch \ + file://backport-Bash-5.1-patch-16-fix-interpretation-of-multiple-ins.patch \ +" + +SRC_URI[tarball.sha256sum] = "0cfb5c9bb1a29f800a97bd242d19511c997a1013815b805e0fdd32214113d6be" + +# When testing the performance of the shell using UnixBench, we found that the sh of busybox(ash) +# outperformed bash, so we still make sh link to busybox instead of bash. +ALTERNATIVE_${PN}_remove += "sh" diff --git a/meta-openeuler/recipes-extended/bzip2/bzip2_%.bbappend b/meta-openeuler/recipes-extended/bzip2/bzip2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..4c11bb6736f4256132056ed948e5241fc31ef43b --- /dev/null +++ b/meta-openeuler/recipes-extended/bzip2/bzip2_%.bbappend @@ -0,0 +1,21 @@ +# main bbfile: yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.8.bb + +OPENEULER_SRC_URI_REMOVE = "https git http" + +PV = "1.0.8" + +# remove conflict files from poky +SRC_URI_remove = " \ +" + +LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;endline=37;md5=600af43c50f1fcb82e32f19b32df4664 \ + file://${S}/LICENSE;md5=1e5cffe65fc786f83a11a4b225495c0b \ +" + +# patches in openeuler +SRC_URI_append = " \ + file://bzip2-${PV}.tar.gz \ + file://0001-add-compile-option.patch \ + file://0002-CVE-2019-12900.patch \ + file://0003-license-and-version-print-should-output-to-stdout-and-exit-with-code-0.patch \ +" diff --git a/meta-openeuler/recipes-extended/cracklib/cracklib_%.bbappend b/meta-openeuler/recipes-extended/cracklib/cracklib_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..4d9329ecaf41a9cd164d8b7427053deafa46ea4d --- /dev/null +++ b/meta-openeuler/recipes-extended/cracklib/cracklib_%.bbappend @@ -0,0 +1,34 @@ +OPENEULER_SRC_URI_REMOVE = "https git http" + +PV = "2.9.8" + +S = "${WORKDIR}/cracklib-${PV}" + +# get new 0001-packlib.c-support-dictionary-byte-order-dependent.patch from higher poky +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +# delete lower version patch from poky +SRC_URI_remove += " \ + file://0001-Apply-patch-to-fix-CVE-2016-6318.patch \ +" + +# add openeuler patches +# note: cracklib-words may not use as src-openeuler, we may check later. +SRC_URI =+ " \ + file://cracklib-${PV}.tar.gz \ + file://fix-problem-of-error-message-about-simplistic-passwo.patch \ + file://backport-cracklib-2.9.6-lookup.patch \ + file://fix-error-length-about-simplistic-password.patch \ + file://fix-truncating-dict-file-without-input-data.patch \ +" + +# ref: http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-extended/cracklib/cracklib_2.9.8.bb +# This is custom stuff from upstream's autogen.sh +do_configure:prepend() { + mkdir -p ${S}/m4 + echo EXTRA_DIST = *.m4 > ${S}/m4/Makefile.am + touch ${S}/ABOUT-NLS +} + +SRC_URI[md5sum] = "48a0c8810ec4780b99c0a4f9931c21c6" +SRC_URI[sha256sum] = "8b6fd202f3f1d8fa395d3b7a5d821227cfd8bb4a9a584a7ae30cf62cea6287dd" diff --git a/meta-openeuler/recipes-extended/cracklib/files/0001-packlib.c-support-dictionary-byte-order-dependent.patch b/meta-openeuler/recipes-extended/cracklib/files/0001-packlib.c-support-dictionary-byte-order-dependent.patch new file mode 100644 index 0000000000000000000000000000000000000000..8fb512a224bf52d3f3f99b700c0245f3b424c937 --- /dev/null +++ b/meta-openeuler/recipes-extended/cracklib/files/0001-packlib.c-support-dictionary-byte-order-dependent.patch @@ -0,0 +1,339 @@ +From aae03b7e626d5f62ab929d51d11352a5a2ff6b2d Mon Sep 17 00:00:00 2001 +From: Lei Maohui +Date: Tue, 9 Jun 2015 11:11:48 +0900 +Subject: [PATCH 1/2] packlib.c: support dictionary byte order dependent + +The previous dict files are NOT byte-order independent, in fact they are +probably ARCHITECTURE SPECIFIC. +Create the dict files in big endian, and convert to host endian while +load them. This could fix the endian issue on multiple platform. + +Signed-off-by: Hongxu Jia +Upstream-Status: Submitted [https://github.com/cracklib/cracklib/pull/41] + +We can't use the endian.h, htobe* and be*toh functions because they are +not available on older versions of glibc, such as that found in RHEL +5.9. + +Change to checking endian and directly calling bswap_* as defined in +byteswap.h. + +Signed-off-by: Mark Hatle + +Signed-off-by: Lei Maohui +--- + lib/packlib.c | 214 +++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 210 insertions(+), 4 deletions(-) + +diff --git a/lib/packlib.c b/lib/packlib.c +index 8acb7be..a9d8750 100644 +--- a/lib/packlib.c ++++ b/lib/packlib.c +@@ -16,6 +16,12 @@ + #ifdef HAVE_STDINT_H + #include + #endif ++ ++#ifndef _BSD_SOURCE ++#define _BSD_SOURCE /* See feature_test_macros(7) */ ++#endif ++#include ++#include + #include "packer.h" + + static const char vers_id[] = "packlib.c : v2.3p2 Alec Muffett 18 May 1993"; +@@ -45,6 +51,185 @@ typedef struct + char data_get[NUMWORDS][MAXWORDLEN]; + } PWDICT64; + ++enum{ ++ en_is32, ++ en_is64 ++}; ++ ++static int ++IheaderHostToBigEndian(char *pHeader, int nBitType) ++{ ++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader; ++ ++ pHeader64->pih_magic = bswap_64(pHeader64->pih_magic); ++ pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords); ++ pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen); ++ pHeader64->pih_pad = bswap_16(pHeader64->pih_pad); ++ ++#if DEBUG ++ printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n", ++ pHeader64->pih_magic, pHeader64->pih_numwords, ++ pHeader64->pih_blocklen, pHeader64->pih_pad); ++#endif ++ } ++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ struct pi_header *pHeader32 = (struct pi_header*)pHeader; ++ ++ pHeader32->pih_magic = bswap_32(pHeader32->pih_magic); ++ pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords); ++ pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen); ++ pHeader32->pih_pad = bswap_16(pHeader32->pih_pad); ++ ++#if DEBUG ++ printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n", ++ pHeader32->pih_magic, pHeader32->pih_numwords, ++ pHeader32->pih_blocklen, pHeader32->pih_pad); ++#endif ++ } ++ else if (__BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType); ++ return (-1); ++ } ++ ++ return 0; ++} ++ ++static int ++IheaderBigEndianToHost(char *pHeader, int nBitType) ++{ ++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader; ++ ++ pHeader64->pih_magic = bswap_64(pHeader64->pih_magic); ++ pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords); ++ pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen); ++ pHeader64->pih_pad = bswap_16(pHeader64->pih_pad); ++ ++#if DEBUG ++ printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n", ++ pHeader64->pih_magic, pHeader64->pih_numwords, ++ pHeader64->pih_blocklen, pHeader64->pih_pad); ++#endif ++ } ++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ struct pi_header *pHeader32 = (struct pi_header*)pHeader; ++ ++ pHeader32->pih_magic = bswap_32(pHeader32->pih_magic); ++ pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords); ++ pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen); ++ pHeader32->pih_pad = bswap_16(pHeader32->pih_pad); ++ ++#if DEBUG ++ printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n", ++ pHeader32->pih_magic, pHeader32->pih_numwords, ++ pHeader32->pih_blocklen, pHeader32->pih_pad); ++#endif ++ } ++ else if (__BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType); ++ return (-1); ++ } ++ ++ return 0; ++} ++ ++static int ++HwmsHostToBigEndian(char *pHwms, int nLen,int nBitType) ++{ ++ int i = 0; ++ ++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ uint64_t *pHwms64 = (uint64_t*)pHwms; ++ ++ for (i = 0; i < nLen / sizeof(uint64_t); i++) ++ { ++ *pHwms64 = bswap_64(*pHwms64); ++ *pHwms64++; ++ } ++ ++ } ++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ uint32_t *pHwms32 = (uint32_t*)pHwms; ++ ++ for (i = 0; i < nLen / sizeof(uint32_t); i++) ++ { ++ *pHwms32 = bswap_32(*pHwms32); ++ *pHwms32++; ++ } ++ ++ } ++ else if (__BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType); ++ return (-1); ++ } ++ ++#if DEBUG ++ for (i = 0; i < nLen; i+=8) ++ { ++ printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n", ++ nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF, ++ pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF, ++ pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF); ++ } ++#endif ++ ++ return 0; ++} ++ ++static int ++HwmsBigEndianToHost(char *pHwms, int nLen, int nBitType) ++{ ++ int i = 0; ++ ++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ uint64_t *pHwms64 = (uint64_t*)pHwms; ++ ++ for (i = 0; i < nLen / sizeof(uint64_t); i++) ++ { ++ *pHwms64++ = bswap_64(*pHwms64); ++ } ++ ++ } ++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ uint32_t *pHwms32 = (uint32_t*)pHwms; ++ ++ for (i = 0; i < nLen / sizeof(uint32_t); i++) ++ { ++ *pHwms32 = bswap_32(*pHwms32); ++ *pHwms32++; ++ } ++ ++ } ++ else if (__BYTE_ORDER == __LITTLE_ENDIAN) ++ { ++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType); ++ return (-1); ++ } ++ ++#if DEBUG ++ for (i = 0; i < nLen; i+=8) ++ { ++ printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n", ++ nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF, ++ pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF, ++ pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF); ++ } ++#endif ++ ++ return 0; ++} + + static int + _PWIsBroken64(FILE *ifp) +@@ -57,6 +242,7 @@ _PWIsBroken64(FILE *ifp) + return 0; + } + ++ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64); + return (pdesc64.header.pih_magic == PIH_MAGIC); + } + +@@ -149,7 +335,11 @@ PWOpen(prefix, mode) + pdesc.header.pih_blocklen = NUMWORDS; + pdesc.header.pih_numwords = 0; + +- fwrite((char *) &pdesc.header, sizeof(pdesc.header), 1, ifp); ++ struct pi_header tmpheader32; ++ ++ memcpy(&tmpheader32, &pdesc.header, sizeof(pdesc.header)); ++ IheaderHostToBigEndian((char *) &tmpheader32, en_is32); ++ fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, ifp); + } else + { + pdesc.flags &= ~PFOR_WRITE; +@@ -173,6 +363,7 @@ PWOpen(prefix, mode) + return NULL; + } + ++ IheaderBigEndianToHost((char *) &pdesc.header, en_is32); + if ((pdesc.header.pih_magic == 0) || (pdesc.header.pih_numwords == 0)) + { + /* uh-oh. either a broken "64-bit" file or a garbage file. */ +@@ -195,6 +386,7 @@ PWOpen(prefix, mode) + } + return NULL; + } ++ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64); + if (pdesc64.header.pih_magic != PIH_MAGIC) + { + /* nope, not "64-bit" after all */ +@@ -290,6 +482,7 @@ PWOpen(prefix, mode) + { + pdesc.flags &= ~PFOR_USEHWMS; + } ++ HwmsBigEndianToHost((char*)pdesc64.hwms, sizeof(pdesc64.hwms), en_is64); + for (i = 0; i < sizeof(pdesc.hwms) / sizeof(pdesc.hwms[0]); i++) + { + pdesc.hwms[i] = pdesc64.hwms[i]; +@@ -299,6 +492,7 @@ PWOpen(prefix, mode) + { + pdesc.flags &= ~PFOR_USEHWMS; + } ++ HwmsBigEndianToHost((char*)pdesc.hwms, sizeof(pdesc.hwms), en_is32); + #if DEBUG + for (i=1; i<=0xff; i++) + { +@@ -332,7 +526,11 @@ PWClose(pwp) + return (-1); + } + +- if (!fwrite((char *) &pwp->header, sizeof(pwp->header), 1, pwp->ifp)) ++ struct pi_header tmpheader32; ++ ++ memcpy(&tmpheader32, &pwp->header, sizeof(pwp->header)); ++ IheaderHostToBigEndian((char *) &tmpheader32, en_is32); ++ if (!fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, pwp->ifp)) + { + fprintf(stderr, "index magic fwrite failed\n"); + return (-1); +@@ -351,7 +549,12 @@ PWClose(pwp) + printf("hwm[%02x] = %d\n", i, pwp->hwms[i]); + #endif + } +- fwrite(pwp->hwms, 1, sizeof(pwp->hwms), pwp->wfp); ++ ++ PWDICT tmp_pwp; ++ ++ memcpy(&tmp_pwp, pwp, sizeof(PWDICT)); ++ HwmsHostToBigEndian(tmp_pwp.hwms, sizeof(tmp_pwp.hwms), en_is32); ++ fwrite(tmp_pwp.hwms, 1, sizeof(tmp_pwp.hwms), pwp->wfp); + } + } + +@@ -405,7 +608,8 @@ PutPW(pwp, string) + + datum = (uint32_t) ftell(pwp->dfp); + +- fwrite((char *) &datum, sizeof(datum), 1, pwp->ifp); ++ uint32_t tmpdatum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum; ++ fwrite((char *) &tmpdatum, sizeof(tmpdatum), 1, pwp->ifp); + + fputs(pwp->data_put[0], pwp->dfp); + putc(0, (FILE*) pwp->dfp); +@@ -464,6 +668,7 @@ GetPW(pwp, number) + perror("(index fread failed)"); + return NULL; + } ++ datum64 = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_64(datum64) : datum64; + datum = datum64; + } else { + if (fseek(pwp->ifp, sizeof(struct pi_header) + (thisblock * sizeof(uint32_t)), 0)) +@@ -477,6 +682,7 @@ GetPW(pwp, number) + perror("(index fread failed)"); + return NULL; + } ++ datum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum; + } + + int r = 1; +-- +2.20.1 + diff --git a/meta-openeuler/recipes-extended/cronie/cronie_%.bbappend b/meta-openeuler/recipes-extended/cronie/cronie_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ef4eacb2f9dfc58de7f877974c8f2bf44415c3df --- /dev/null +++ b/meta-openeuler/recipes-extended/cronie/cronie_%.bbappend @@ -0,0 +1,8 @@ +PV = "1.6.1" + +SRC_URI += " \ + file://bugfix-cronie-systemd-alias.patch \ +" + +SRC_URI[md5sum] = "de07b7229520bc859d987c721bab87c5" +SRC_URI[sha256sum] = "2cd0f0dd1680e6b9c39bf1e3a5e7ad6df76aa940de1ee90a453633aa59984e62" diff --git a/meta-openeuler/recipes-extended/ethtool/ethtool_%.bbappend b/meta-openeuler/recipes-extended/ethtool/ethtool_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..139b1c974890e6259d0173ecb9f6ed1caeef3f36 --- /dev/null +++ b/meta-openeuler/recipes-extended/ethtool/ethtool_%.bbappend @@ -0,0 +1,10 @@ +PV = "5.19" + +SRC_URI:remove += " ${KERNELORG_MIRROR}/software/network/ethtool/ethtool-${PV}.tar.gz " + +# ptest patch: avoid_parallel_tests.patch +SRC_URI = "file://${BP}.tar.xz \ + " + +SRC_URI[sha256sum] = "3b752a3329827907ac3812f2831dfecf51c8c41c55d2d69cfb9c53ca06449fc6" + diff --git a/meta-openeuler/recipes-extended/findutils/findutils_%.bbappend b/meta-openeuler/recipes-extended/findutils/findutils_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..8e93e330eaf8705af461df0b650ed95e08f6996a --- /dev/null +++ b/meta-openeuler/recipes-extended/findutils/findutils_%.bbappend @@ -0,0 +1,10 @@ +# main bbfile: yocto-poky/meta/recipes-extended/findutils/findutils_4.8.0.bb + +PV = "4.9.0" + +# files, patches that come from openeuler +SRC_URI += " \ + file://0001-findutils-xautofs.patch \ +" + +SRC_URI[sha256sum] = "a2bfb8c09d436770edc59f50fa483e785b161a3b7b9d547573cb08065fd462fe" diff --git a/meta-openeuler/recipes-extended/gawk/gawk_%.bbappend b/meta-openeuler/recipes-extended/gawk/gawk_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..db7e84a2810766ff13d962673a8a348b70843129 --- /dev/null +++ b/meta-openeuler/recipes-extended/gawk/gawk_%.bbappend @@ -0,0 +1,24 @@ +# main bbfile: yocto-poky/meta/recipes-extended/gawk/gawk_5.1.0.bb + +# version in openEuler +PV = "5.2.0" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \ +" + +# files, patches that come from openeuler +SRC_URI_prepend = " \ + file://${BP}.tar.xz \ + file://pma.patch \ + file://Disable-pma-test.awk.patch \ + file://backport-Fix-a-bug-with-Node_elem_new.patch \ + file://backport-Additional-fix-for-Node_elem_new.patch \ + file://backport-Yet-another-fix-and-test-for-Node_elem_new.patch \ + file://backport-Fix-a-memory-leak.patch \ + file://backport-Code-simplification-in-interpret.h.patch \ + file://backport-Fix-negative-NaN-issue-on-RiscV.patch \ + " + +SRC_URI[md5sum] = "2f724d925873fc82f5e7b1d605ba9a42" +SRC_URI[sha256sum] = "e4ddbad1c2ef10e8e815ca80208d0162d4c983e6cca16f925e8418632d639018" diff --git a/meta-openeuler/recipes-extended/grep/grep_%.bbappend b/meta-openeuler/recipes-extended/grep/grep_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..6349f4725babd8f060d47d7f447dd9d4f2b93d99 --- /dev/null +++ b/meta-openeuler/recipes-extended/grep/grep_%.bbappend @@ -0,0 +1,15 @@ +OPENEULER_SRC_URI_REMOVE = "https git http" + +PV = "3.8" + +# sync openeuler's grep to use pcre2 +PACKAGECONFIG_append += "pcre2" +PACKAGECONFIG_remove += "pcre" +PACKAGECONFIG[pcre2] = "--enable-perl-regexp,--disable-perl-regexp,libpcre2" + +SRC_URI += " \ + file://grep-${PV}.tar.xz \ + file://backport-grep-bug-backref-in-last-of-multiple-patter.patch \ +" + +SRC_URI[sha256sum] = "498d7cc1b4fb081904d87343febb73475cf771e424fb7e6141aff66013abc382" diff --git a/meta-openeuler/recipes-extended/gzip/gzip_%.bbappend b/meta-openeuler/recipes-extended/gzip/gzip_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bc02f801a8cfd4a1b691ef6b745d6dfe8bc878b6 --- /dev/null +++ b/meta-openeuler/recipes-extended/gzip/gzip_%.bbappend @@ -0,0 +1,20 @@ +# main bbfile: yocto-poky/meta/recipes-extended/gzip/gzip_1.10.bb + +OPENEULER_SRC_URI_REMOVE = "https git http" + +# gzip version in openEuler +PV = "1.12" + +# Use the source packages from openEuler +SRC_URI_remove = "${GNU_MIRROR}/gzip/${BP}.tar.gz" +SRC_URI_prepend += "file://${BP}.tar.xz \ + file://fix-verbose-disable.patch \ + file://backport-gzip-detect-invalid-input.patch \ + file://backport-gzip-test-invalid-input-bug.patch \ + " + +# remove poky's conflicting patch +SRC_URI_remove_class-target = " file://wrong-path-fix.patch" + +SRC_URI[md5sum] = "9608e4ac5f061b2a6479dc44e917a5db" +SRC_URI[sha256sum] = "ce5e03e519f637e1f814011ace35c4f87b33c0bbabeec35baf5fbd3479e91956" diff --git a/meta-openeuler/recipes-extended/iptables/iptables_%.bbappend b/meta-openeuler/recipes-extended/iptables/iptables_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..75966000184deffc7552557da6fc8c5e57d41d00 --- /dev/null +++ b/meta-openeuler/recipes-extended/iptables/iptables_%.bbappend @@ -0,0 +1,11 @@ +PV = "1.8.9" + +OPENEULER_SRC_URI_REMOVE = "https git http" +SRC_URI += "file://${BPN}-${PV}.tar.xz \ + file://0001-extensions-NAT-Fix-for-Werror-format-security.patch \ + " + +SRC_URI[sha256sum] = "ef6639a43be8325a4f8ea68123ffac236cb696e8c78501b64e8106afb008c87f" + +# For iptables-1.8.9, the following files need to be added to FILES_${PN} +FILES_${PN}-module-xt-ct += "${libdir}/xtables/libxt_REDIRECT.so ${libdir}/xtables/libxt_MASQUERADE.so ${libdir}/xtables/libxt_DNAT.so ${libdir}/xtables/libxt_SNAT.so" diff --git a/meta-openeuler/recipes-extended/less/less_%.bbappend b/meta-openeuler/recipes-extended/less/less_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b27058868077a7337da812c3252be09272ca9210 --- /dev/null +++ b/meta-openeuler/recipes-extended/less/less_%.bbappend @@ -0,0 +1,20 @@ +# main bbfile: yocto-poky/meta/recipes-extended/less/less_563.bb + +# less version in openEuler +PV = "608" + +LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \ + file://LICENSE;md5=38fc26d78ca8d284a2a5a4bbc263d29b \ + " + +# Use the source packages and patches from openEuler +# less-475-fsync.patch can't apply: cannot run test program while cross compiling +SRC_URI_remove = "file://less-475-fsync.patch" + +SRC_URI_prepend = "file://less-394-time.patch \ + file://less-475-fsync.patch \ + file://backport-End-OSC8-hyperlink-on-invalid-embedded-escape-sequen.patch \ + " + +SRC_URI[md5sum] = "1cdec714569d830a68f4cff11203cdba" +SRC_URI[sha256sum] = "a69abe2e0a126777e021d3b73aa3222e1b261f10e64624d41ec079685a6ac209" diff --git a/meta-openeuler/recipes-extended/libaio/libaio_%.bbappend b/meta-openeuler/recipes-extended/libaio/libaio_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..1a6e3e6b72926a716d2be5fb4db58cf716fe24ea --- /dev/null +++ b/meta-openeuler/recipes-extended/libaio/libaio_%.bbappend @@ -0,0 +1,23 @@ + +OPENEULER_SRC_URI_REMOVE = "https git http" + +PV = "0.3.113" + +# apply package and patches from openeuler +# 0006-libaio-Add-sw64-architecture.patch is conlict, +# not apply it as we not support sw64 current +SRC_URI = " \ + file://libaio-${PV}.tar.gz \ + file://0000-libaio-install-to-destdir-slash-usr.patch \ + file://0001-libaio-arm64-ilp32.patch \ + file://0002-libaio-makefile-cflags.patch \ + file://0003-libaio-fix-for-x32.patch \ + file://0004-libaio-makefile-add-D_FORTIFY_SOURCE-flag.patch \ +" + +SRC_URI[sha256sum] = "ab0462f2c9d546683e5147b1ce9c195fe95d07fac5bf362f6c01637955c3b492" + +S = "${WORKDIR}/${BPN}-${PV}" + +# fix libaio.a install fail, need to set install prefix dir +EXTRA_OEMAKE =+ "usrlibdir=${D}${libdir}" diff --git a/meta-openeuler/recipes-extended/libarchive/libarchive/0001-libarchive-Do-not-include-sys-mount.h-when-linux-fs..patch b/meta-openeuler/recipes-extended/libarchive/libarchive/0001-libarchive-Do-not-include-sys-mount.h-when-linux-fs..patch new file mode 100644 index 0000000000000000000000000000000000000000..0d217996826e12ce53cf34d8c9ead9567f3d2fcd --- /dev/null +++ b/meta-openeuler/recipes-extended/libarchive/libarchive/0001-libarchive-Do-not-include-sys-mount.h-when-linux-fs..patch @@ -0,0 +1,47 @@ +From a2f68263a1da5ad227bcb9cd8fa91b93c8b6c99f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 25 Jul 2022 10:56:53 -0700 +Subject: [PATCH] libarchive: Do not include sys/mount.h when linux/fs.h is + present + +These headers are in conflict and only one is needed by +archive_read_disk_posix.c therefore include linux/fs.h if it exists +otherwise include sys/mount.h + +It also helps compiling with glibc 2.36 +where sys/mount.h conflicts with linux/mount.h see [1] + +[1] https://sourceware.org/glibc/wiki/Release/2.36 + +Upstream-Status: Submitted [https://github.com/libarchive/libarchive/pull/1761] +Signed-off-by: Khem Raj +--- + libarchive/archive_read_disk_posix.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c +index 2b39e672..a96008db 100644 +--- a/libarchive/archive_read_disk_posix.c ++++ b/libarchive/archive_read_disk_posix.c +@@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$"); + #ifdef HAVE_SYS_PARAM_H + #include + #endif +-#ifdef HAVE_SYS_MOUNT_H +-#include +-#endif + #ifdef HAVE_SYS_STAT_H + #include + #endif +@@ -54,6 +51,8 @@ __FBSDID("$FreeBSD$"); + #endif + #ifdef HAVE_LINUX_FS_H + #include ++#elif HAVE_SYS_MOUNT_H ++#include + #endif + /* + * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h. +-- +2.25.1 + diff --git a/meta-openeuler/recipes-extended/libarchive/libarchive/cve-2022-36227.patch b/meta-openeuler/recipes-extended/libarchive/libarchive/cve-2022-36227.patch new file mode 100644 index 0000000000000000000000000000000000000000..4d13bf64927426c95d6a424c0faecbc32c5c520c --- /dev/null +++ b/meta-openeuler/recipes-extended/libarchive/libarchive/cve-2022-36227.patch @@ -0,0 +1,48 @@ +From bff38efe8c110469c5080d387bec62a6ca15b1a5 Mon Sep 17 00:00:00 2001 +From: obiwac +Date: Fri, 22 Jul 2022 22:41:10 +0200 +Subject: [PATCH] libarchive: Handle a `calloc` returning NULL (fixes #1754) + +--- + libarchive/archive_write.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- +CVE: CVE-2022-36227 + +Source-Repo: https://github.com/libarchive/libarchive.git + +Upstream-Status: Backport [bff38efe8c... unmodified] + +Signed-off-by: Joe Slater + +--- +diff --git a/libarchive/archive_write.c b/libarchive/archive_write.c +index 66592e82..27626b54 100644 +--- a/libarchive/archive_write.c ++++ b/libarchive/archive_write.c +@@ -201,6 +201,10 @@ __archive_write_allocate_filter(struct archive *_a) + struct archive_write_filter *f; + + f = calloc(1, sizeof(*f)); ++ ++ if (f == NULL) ++ return (NULL); ++ + f->archive = _a; + f->state = ARCHIVE_WRITE_FILTER_STATE_NEW; + if (a->filter_first == NULL) +@@ -548,6 +552,10 @@ archive_write_open2(struct archive *_a, void *client_data, + a->client_data = client_data; + + client_filter = __archive_write_allocate_filter(_a); ++ ++ if (client_filter == NULL) ++ return (ARCHIVE_FATAL); ++ + client_filter->open = archive_write_client_open; + client_filter->write = archive_write_client_write; + client_filter->close = archive_write_client_close; +-- +2.38.1 + diff --git a/meta-openeuler/recipes-extended/libarchive/libarchive_%.bbappend b/meta-openeuler/recipes-extended/libarchive/libarchive_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..11784cbc3ea68a26ae7ca7f2f22f81e2e78fc952 --- /dev/null +++ b/meta-openeuler/recipes-extended/libarchive/libarchive_%.bbappend @@ -0,0 +1,16 @@ +PV = "3.6.1" + +SRC_URI[sha256sum] = "c676146577d989189940f1959d9e3980d28513d74eedfbc6b7f15ea45fe54ee2" + +# add patches from openeuler +SRC_URI += " \ + file://0001-Drop-rmd160-from-OpenSSL.patch \ + file://libarchive-uninitialized-value.patch \ +" + +#${STAGING_INCDIR_NATIVE}/ext2fs not exist when not building e2fsprogs-native +python() { + openeuler_sysroot = d.getVar('OPENEULER_NATIVESDK_SYSROOT') + if openeuler_sysroot: + d.setVar('STAGING_INCDIR_NATIVE', "%s/usr/include" % openeuler_sysroot) +} diff --git a/meta-openeuler/recipes-extended/libarchive/libarchive_3.6.1.bb b/meta-openeuler/recipes-extended/libarchive/libarchive_3.6.1.bb new file mode 100644 index 0000000000000000000000000000000000000000..c812038352ed9968ede922696ed2d70df4b82e29 --- /dev/null +++ b/meta-openeuler/recipes-extended/libarchive/libarchive_3.6.1.bb @@ -0,0 +1,70 @@ +SUMMARY = "Support for reading various archive formats" +DESCRIPTION = "C library and command-line tools for reading and writing tar, cpio, zip, ISO, and other archive formats" +HOMEPAGE = "http://www.libarchive.org/" +SECTION = "devel" +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://COPYING;md5=d499814247adaee08d88080841cb5665" + +DEPENDS = "e2fsprogs-native" + +PACKAGECONFIG ?= "zlib bz2 xz zstd" + +PACKAGECONFIG:append:class-target = "\ + ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \ +" + +DEPENDS_BZIP2 = "bzip2-replacement-native" +DEPENDS_BZIP2:class-target = "bzip2" + +PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," +PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr," +PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib," +PACKAGECONFIG[bz2] = "--with-bz2lib,--without-bz2lib,${DEPENDS_BZIP2}," +PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz," +PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl," +PACKAGECONFIG[libxml2] = "--with-xml2,--without-xml2,libxml2," +PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat," +PACKAGECONFIG[lzo] = "--with-lzo2,--without-lzo2,lzo," +PACKAGECONFIG[nettle] = "--with-nettle,--without-nettle,nettle," +PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4," +PACKAGECONFIG[mbedtls] = "--with-mbedtls,--without-mbedtls,mbedtls," +PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd," + +EXTRA_OECONF += "--enable-largefile" + +SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \ + file://0001-libarchive-Do-not-include-sys-mount.h-when-linux-fs..patch \ + file://cve-2022-36227.patch \ + " +UPSTREAM_CHECK_URI = "http://libarchive.org/" + +SRC_URI[sha256sum] = "c676146577d989189940f1959d9e3980d28513d74eedfbc6b7f15ea45fe54ee2" + +inherit autotools update-alternatives pkgconfig + +CPPFLAGS += "-I${WORKDIR}/extra-includes" + +do_configure[cleandirs] += "${WORKDIR}/extra-includes" +do_configure:prepend() { + # We just need the headers for some type constants, so no need to + # build all of e2fsprogs for the target + cp -R ${STAGING_INCDIR_NATIVE}/ext2fs ${WORKDIR}/extra-includes/ +} + +ALTERNATIVE_PRIORITY = "80" + +PACKAGES =+ "bsdtar" +FILES:bsdtar = "${bindir}/bsdtar" + +ALTERNATIVE:bsdtar = "tar" +ALTERNATIVE_LINK_NAME[tar] = "${base_bindir}/tar" +ALTERNATIVE_TARGET[tar] = "${bindir}/bsdtar" + +PACKAGES =+ "bsdcpio" +FILES:bsdcpio = "${bindir}/bsdcpio" + +ALTERNATIVE:bsdcpio = "cpio" +ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio" +ALTERNATIVE_TARGET[cpio] = "${bindir}/bsdcpio" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-openeuler/recipes-extended/libidn2/libidn2_%.bbappend b/meta-openeuler/recipes-extended/libidn2/libidn2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..29b15d7cae612cd80165e40d271813e171ba2704 --- /dev/null +++ b/meta-openeuler/recipes-extended/libidn2/libidn2_%.bbappend @@ -0,0 +1,24 @@ +# main bbfile: yocto-poky/meta/recipes-extended/libidn/libidn2_2.3.0.bb + +# version in openEuler +PV = "2.3.3" + +# solve lic check failed +LIC_FILES_CHKSUM_remove = " \ + file://src/idn2.c;endline=16;md5=426b74d6deb620ab6d39c8a6efd4c13a \ + file://lib/idn2.h.in;endline=27;md5=c2cd28d3f87260f157f022eabb83714f \ +" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ + ${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \ +" + +# files, patches that come from openeuler +SRC_URI += " \ + file://${BP}.tar.gz;name=tarball \ + file://bugfix-libidn2-change-rpath.patch \ +" + +SRC_URI[tarball.md5sum] = "fb54962eb68cf22d47a4ae61f0aba993" +SRC_URI[tarball.sha256sum] = "76940cd4e778e8093579a9d195b25fff5e936e9dc6242068528b437a76764f91" diff --git a/meta-openeuler/recipes-extended/libmnl/libmnl_%.bbappend b/meta-openeuler/recipes-extended/libmnl/libmnl_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..6873c8ab1b84c37eae89e0ca91e7c21674d452aa --- /dev/null +++ b/meta-openeuler/recipes-extended/libmnl/libmnl_%.bbappend @@ -0,0 +1,6 @@ +# main bbfile: meta/recipes-extended/libmnl/libmnl_1.0.4.bb + +PV = "1.0.5" + +SRC_URI[tar.md5sum] = "0bbb70573119ec5d49435114583e7a49" +SRC_URI[tar.sha256sum] = "274b9b919ef3152bfb3da3a13c950dd60d6e2bcd54230ffeca298d03b40d0525" diff --git a/meta-openeuler/recipes-extended/libmodbus/libmodbus_%.bbappend b/meta-openeuler/recipes-extended/libmodbus/libmodbus_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..cfb7a7dc3493b13cf91290c271f49ed4cd83415d --- /dev/null +++ b/meta-openeuler/recipes-extended/libmodbus/libmodbus_%.bbappend @@ -0,0 +1,7 @@ +PV = "3.1.6" +OPENEULER_BRANCH = "master" + +SRC_URI += "file://0000-libmodbus-Heap-based-Buffer-Overflow-in-modbus_reply.patch" + +SRC_URI[md5sum] = "15c84c1f7fb49502b3efaaa668cfd25e" +SRC_URI[sha256sum] = "d7d9fa94a16edb094e5fdf5d87ae17a0dc3f3e3d687fead81835d9572cf87c16" diff --git a/meta-openeuler/recipes-extended/libnsl/libnsl2_%.bbappend b/meta-openeuler/recipes-extended/libnsl/libnsl2_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..575d3c0a9e4cd636ecc693fd5fc69ba1c3e9f04b --- /dev/null +++ b/meta-openeuler/recipes-extended/libnsl/libnsl2_%.bbappend @@ -0,0 +1,19 @@ +#main bbfile: yocto-poky/meta/recipes-extended/libnsl/libnsl2_git.bb + +OPENEULER_SRC_URI_REMOVE = "https git http" + +#version in openEuler +PV = "2.0.0" + +S = "${WORKDIR}/libnsl-${PV}" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ + " +# files, patches that come from openeuler +SRC_URI += " \ + file://v${PV}.tar.gz \ + " + +SRC_URI[tarball.md5sum] = "e1ee6772c2ee5ddc25ea465a33af3004" +SRC_URI[tarball.sha256sum] = "eb37be57c1cf650b3a8a4fc7cd66c8b3dfc06215b41956a16325a9388171bc40" diff --git a/meta-openeuler/recipes-extended/libsolv/libsolv_%.bbappend b/meta-openeuler/recipes-extended/libsolv/libsolv_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..ea229448f659782fc259f03e0412e44aaa2c2c24 --- /dev/null +++ b/meta-openeuler/recipes-extended/libsolv/libsolv_%.bbappend @@ -0,0 +1,14 @@ +PV = "0.7.22" + +S = "${WORKDIR}/${BP}" + +OPENEULER_BRANCH = "master" +SRC_URI[sha256sum] = "968aef452b5493751fa0168cd58745a77c755e202a43fe8d549d791eb16034d5" + +SRC_URI = " \ + https://github.com/openSUSE/libsolv/archive/refs/tags/${PV}.tar.gz \ + file://Fix-memory-leak-when-using-testsolv-to-execute-cases.patch \ +" + +# delete -DENABLE_RPMDB_BDB=ON, not used with new rpm version +PACKAGECONFIG[rpm] = "-DENABLE_RPMMD=ON -DENABLE_RPMDB=ON,,rpm" diff --git a/meta-openeuler/recipes-extended/libtirpc/libtirpc_%.bbappend b/meta-openeuler/recipes-extended/libtirpc/libtirpc_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..eda44f6dfb8e3b1301d3b3e2c08e556cda770f72 --- /dev/null +++ b/meta-openeuler/recipes-extended/libtirpc/libtirpc_%.bbappend @@ -0,0 +1,7 @@ +PV = "1.3.3" + +SRC_URI[sha256sum] = "6474e98851d9f6f33871957ddee9714fdcd9d8a5ee9abb5a98d63ea2e60e12f3" + +SRC_URI += " \ + file://0001-update-libtirpc-to-enable-tcp-port-listening.patch \ +" diff --git a/meta-openeuler/recipes-extended/logrotate/logrotate_%.bbappend b/meta-openeuler/recipes-extended/logrotate/logrotate_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..a849fb69ac41b55d3a1634acef3260b8b7ba1d38 --- /dev/null +++ b/meta-openeuler/recipes-extended/logrotate/logrotate_%.bbappend @@ -0,0 +1,20 @@ +# main bbfile: yocto-poky/meta/recipes-extended/logrotate/logrotate_3.18.0.bb + +# version in openEuler +PV = "3.20.1" + +# files, patches can't be applied in openeuler or conflict with openeuler +# disable-check-different-filesystems.patch apply to 3.20.1 version fail +SRC_URI_remove = " \ + https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz \ + file://disable-check-different-filesystems.patch \ +" + +# files, patches that come from openeuler +SRC_URI_prepend = " \ + file://${BPN}/${BP}.tar.xz;name=tarball \ + file://${BPN}/0001-logrotate-3.20.1-lock-state-msg.patch \ +" + +SRC_URI[tarball.md5sum] = "24704642e1e6c7889edbe2b639636caf" +SRC_URI[tarball.sha256sum] = "742f6d6e18eceffa49a4bacd933686d3e42931cfccfb694d7f6369b704e5d094" diff --git a/meta-openeuler/recipes-extended/net-tools/net-tools_%.bbappend b/meta-openeuler/recipes-extended/net-tools/net-tools_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e5020336a772f3c1ea9cd6573dbea52399bd0555 --- /dev/null +++ b/meta-openeuler/recipes-extended/net-tools/net-tools_%.bbappend @@ -0,0 +1,12 @@ +# main bb file: yocto-poky/meta/recipes-extended/net-tools/net-tools_2.10.bb + +PV = "2.10" + +S = "${WORKDIR}/${BPN}-${PV}" + +SRC_URI_remove = "git://git.code.sf.net/p/net-tools/code;protocol=https;branch=master \" +SRC_URI_prepend = "file://${BPN}-${PV}.tar.xz \ + file://backport-net-tools-cycle.patch \ + file://backport-net-tools-man.patch \ + " +# ether-wake.c patches from openeuler not allpy for embedded diff --git a/meta-openeuler/recipes-extended/pam/libpam_%.bbappend b/meta-openeuler/recipes-extended/pam/libpam_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..c964f40f0a275c55b4020fb1b03c99329394fe6e --- /dev/null +++ b/meta-openeuler/recipes-extended/pam/libpam_%.bbappend @@ -0,0 +1,54 @@ +PV = "1.5.2" + +# get files from pam, not libpam +OPENEULER_REPO_NAME = "pam" + +# delete useless patch from old version in poky bb +SRC_URI_remove += " \ + file://0001-modules-pam_namespace-Makefile.am-correctly-install-.patch \ + file://0001-Makefile.am-support-usrmage.patch \ +" + +# patch from openeuler +SRC_URI += " \ + file://bugfix-pam-1.1.8-faillock-systemtime.patch \ + file://change-ndbm-to-gdbm.patch \ + file://add-sm3-crypt-support.patch \ + file://1003-Change-chinese-translation.patch \ +" +SRC_URI[sha256sum] = "e4ec7131a91da44512574268f493c6d8ca105c87091691b8e9b56ca685d4f94d" + +DEPENDS_remove += "flex" + +# no coreutils in openeuler +RDEPENDS_${PN}-xtests_remove += " \ + coreutils \ +" + +PACKAGES += "${PN}-pkgconfig ${PN}-service" +FILES_${PN}-pkgconfig = "${base_libdir}/pkgconfig" +FILES_${PN}-service = "/usr/lib/systemd/system" + +RDEPENDS_${PN}-runtime += " \ + libpwquality \ + ${MLPREFIX}pam-plugin-faillock-${libpam_suffix} \ + ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \ + " + +do_install_append() { + sed -i -e '0,/^$/s//\ +# lock out any user after three unsuccessful attempts and unlock that user after 5 minutes\ +auth required pam_faillock.so preauth audit deny=3 even_deny_root unlock_time=300\ +auth sufficient pam_unix.so nullok try_first_pass\ +auth [default=die] pam_faillock.so authfail audit deny=3 even_deny_root unlock_time=300/' ${D}${sysconfdir}/pam.d/common-auth + + sed -i -e '0,/^$/s//\ +# locks the account in case there were more than deny consecutive failed authentications\ +account required pam_faillock.so/' ${D}${sysconfdir}/pam.d/common-account + + sed -i -e '0,/^$/s//\ +# forcing strong passwords\ +password requisite pam_pwquality.so try_first_pass minclass=3 minlen=8 lcredit=0 ucredit=0 dcredit=0 ocredit=0 reject_username gecoscheck retry=3 enforce_for_root\ +# prevent users from using the last 5 passwords\ +password required pam_pwhistory.so remember=5 use_authtok enforce_for_root/' ${D}${sysconfdir}/pam.d/common-password +} diff --git a/meta-openeuler/recipes-extended/parted/parted_%.bbappend b/meta-openeuler/recipes-extended/parted/parted_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..0fa675cc53efc3193163d23e0f83ebc4678085e2 --- /dev/null +++ b/meta-openeuler/recipes-extended/parted/parted_%.bbappend @@ -0,0 +1,29 @@ +# main bbfile: yocto-poky/meta/recipes-extended/parted/parted_3.4.bb + +# version in openEuler +PV = "3.5" + +# Use the source packages from openEuler +SRC_URI_remove = " \ + ${GNU_MIRROR}/parted/parted-${PV}.tar.xz \ + " +SRC_URI += "file://parted-${PV}.tar.xz \ + file://0001-add-support-of-gpt_sync_mbr.patch \ + file://0002-Add-extra-judgment-for-a-partition-created-success.patch \ + file://0003-bugfix-parted-fix-failure-of-mklabel-gpt_sync_mbr.patch \ + file://0004-hfsplus_btree_search-free-node-when-hfsplus_file_rea.patch \ + file://0005-amiga_read-need-free-part-and-partition-when-constra.patch \ + file://0006-scsi_get_product_info-fix-memleak-and-avoid-to-use-N.patch \ + file://0007-fat_op_context_new-free-ctx-remap-and-goto-correct-l.patch \ + file://0008-hfsplus_cache_from_extent-fix-memleak.patch \ + file://0009-fat_clobber-set-boot_sector-NULL-and-free-boot_secto.patch \ + " + +# the patch check-vfat.patch will result in error +SRC_URI_remove = "file://check-vfat.patch \ +" + +SRC_URI[md5sum] = "336fde60786d5855b3876ee49ef1e6b2" +SRC_URI[sha256sum] = "4938dd5c1c125f6c78b1f4b3e297526f18ee74aa43d45c248578b1d2470c05a2" + +S = "${WORKDIR}/${BP}" diff --git a/meta-openeuler/recipes-extended/procps/procps/sysctl.conf b/meta-openeuler/recipes-extended/procps/procps/sysctl.conf new file mode 100644 index 0000000000000000000000000000000000000000..f5c30da567ac6bb93e11b1c7568a7ec5c3cb508a --- /dev/null +++ b/meta-openeuler/recipes-extended/procps/procps/sysctl.conf @@ -0,0 +1,201 @@ +# see documents in sysctl directory and ip-sysctl.txt for reference + +#arp_ignore - INTEGER +# Define different modes for sending replies in response to +# received ARP requests that resolve local target IP addresses: +# 0 - (default): reply for any local target IP address, configured +# on any interface +# 1 - reply only if the target IP address is local address +# configured on the incoming interface +# 2 - reply only if the target IP address is local address +# configured on the incoming interface and both with the +# sender's IP address are part from same subnet on this interface +# 3 - do not reply for local addresses configured with scope host, +# only resolutions for global and link addresses are replied +# 4-7 - reserved +# 8 - do not reply for all local addresses +# +# The max value from conf/{all,interface}/arp_ignore is used +# when ARP request is received on the {interface} + +# net.ipv4.conf.all.arp_ignore = 0 +# net.ipv4.conf.default.arp_ignore = 0 + +#arp_filter - BOOLEAN +# 1 - Allows you to have multiple network interfaces on the same +# subnet, and have the ARPs for each interface be answered +# based on whether or not the kernel would route a packet from +# the ARP'd IP out that interface (therefore you must use source +# based routing for this to work). In other words it allows control +# of which cards (usually 1) will respond to an arp request. +# +# 0 - (default) The kernel can respond to arp requests with addresses +# from other interfaces. This may seem wrong but it usually makes +# sense, because it increases the chance of successful communication. +# IP addresses are owned by the complete host on Linux, not by +# particular interfaces. Only for more complex setups like load- +# balancing, does this behaviour cause problems. +# +# arp_filter for the interface will be enabled if at least one of +# conf/{all,interface}/arp_filter is set to TRUE, +# it will be disabled otherwise + +# net.ipv4.conf.all.arp_filter = 1 +# net.ipv4.conf.default.arp_filter = 1 + +#accept_source_route - INTEGER +# Accept source routing (routing extension header). +# +# >= 0: Accept only routing header type 2. +# < 0: Do not accept routing header. +# +# Default: 0 + +net.ipv4.conf.all.accept_source_route = 0 +net.ipv4.conf.default.accept_source_route = 0 + +#accept_redirects - BOOLEAN +# Accept ICMP redirect messages. +# accept_redirects for the interface will be enabled if: +# - both conf/{all,interface}/accept_redirects are TRUE in the case forwarding +# for the interface is enabled +# or +# - at least one of conf/{all,interface}/accept_redirects is TRUE in the case +# forwarding for the interface is disabled +# accept_redirects for the interface will be disabled otherwise +# default TRUE (host) +# FALSE (router) + +net.ipv4.conf.all.accept_redirects = 0 +net.ipv4.conf.default.accept_redirects = 0 + +#secure_redirects - BOOLEAN +# Accept ICMP redirect messages only for gateways, +# listed in default gateway list. +# secure_redirects for the interface will be enabled if at least one of +# conf/{all,interface}/secure_redirects is set to TRUE, +# it will be disabled otherwise +# default TRUE + +net.ipv4.conf.all.secure_redirects = 0 +net.ipv4.conf.default.secure_redirects = 0 + +#send_redirects - BOOLEAN +# Send redirects, if router. +# send_redirects for the interface will be enabled if at least one of +# conf/{all,interface}/send_redirects is set to TRUE, +# it will be disabled otherwise +# Default: TRUE + +net.ipv4.conf.all.send_redirects = 0 +net.ipv4.conf.default.send_redirects = 0 + +#tcp_fin_timeout - INTEGER +# Time to hold socket in state FIN-WAIT-2, if it was closed +# by our side. Peer can be broken and never close its side, +# or even died unexpectedly. Default value is 60sec. +# Usual value used in 2.2 was 180 seconds, you may restore +# it, but remember that if your machine is even underloaded WEB server, +# you risk to overflow memory with kilotons of dead sockets, +# FIN-WAIT-2 sockets are less dangerous than FIN-WAIT-1, +# because they eat maximum 1.5K of memory, but they tend +# to live longer. Cf. tcp_max_orphans. + +# net.ipv4.tcp_fin_timeout = 60 + +#tcp_syncookies - BOOLEAN +# Only valid when the kernel was compiled with CONFIG_SYNCOOKIES +# Send out syncookies when the syn backlog queue of a socket +# overflows. This is to prevent against the common 'syn flood attack' +# Default: FALSE +# +# Note, that syncookies is fallback facility. +# It MUST NOT be used to help highly loaded servers to stand +# against legal connection rate. If you see synflood warnings +# in your logs, but investigation shows that they occur +# because of overload with legal connections, you should tune +# another parameters until this warning disappear. +# See: tcp_max_syn_backlog, tcp_synack_retries, tcp_abort_on_overflow. +# +# syncookies seriously violate TCP protocol, do not allow +# to use TCP extensions, can result in serious degradation +# of some services (f.e. SMTP relaying), visible not by you, +# but your clients and relays, contacting you. While you see +# synflood warnings in logs not being really flooded, your server +# is seriously misconfigured. + +net.ipv4.tcp_syncookies = 1 + +#tcp_syn_retries - INTEGER +# Number of times initial SYNs for an active TCP connection attempt +# will be retransmitted. Should not be higher than 255. Default value +# is 5, which corresponds to ~180seconds. + +# net.ipv4.tcp_syn_retries = 1 + +#tcp_synack_retries - INTEGER +# Number of times SYNACKs for a passive TCP connection attempt will +# be retransmitted. Should not be higher than 255. Default value +# is 5, which corresponds to ~180seconds. + +# net.ipv4.tcp_synack_retries = 1 + +#tcp_max_syn_backlog - INTEGER +# Maximal number of remembered connection requests, which are +# still did not receive an acknowledgment from connecting client. +# Default value is 1024 for systems with more than 128Mb of memory, +# and 128 for low memory machines. If server suffers of overload, +# try to increase this number. + +# net.ipv4.tcp_max_syn_backlog = 4096 + +#icmp_echo_ignore_broadcasts - BOOLEAN +# If set non-zero, then the kernel will ignore all ICMP ECHO and +# TIMESTAMP requests sent to it via broadcast/multicast. +# Default: 1 + +net.ipv4.icmp_echo_ignore_broadcasts = 1 + +#panic_on_oops: +# Controls the kernel's behaviour when an oops or BUG is encountered. +# 0: try to continue operation +# 1: panic immediately. If the `panic' sysctl is also non-zero then the +# machine will be rebooted. + +# kernel.panic_on_oops = 1 + +#printk: +# The four values in printk denote: console_loglevel, +# default_message_loglevel, minimum_console_loglevel and +# default_console_loglevel respectively. +# These values influence printk() behavior when printing or +# logging error messages. See 'man 2 syslog' for more info on +# the different loglevels. +# - console_loglevel: messages with a higher priority than +# this will be printed to the console +# - default_message_level: messages without an explicit priority +# will be printed with this priority +# - minimum_console_loglevel: minimum (highest) value to which +# console_loglevel can be set +# - default_console_loglevel: default value for console_loglevel + +# kernel.printk = 0 4 0 7 + +# net.ipv4.tcp_timestamps = 0 +net.ipv4.icmp_ignore_bogus_error_responses = 1 +net.ipv4.conf.all.rp_filter = 1 +net.ipv4.conf.default.rp_filter = 1 +# kernel.sysrq = 0 + +#################### +# net.ipv4.conf.all.promote_secondaries=1 +fs.suid_dumpable = 0 +net.ipv4.ip_forward=0 +net.ipv4.conf.default.log_martians=1 +net.ipv4.conf.all.log_martians=1 +# net.ipv4.icmp_echo_ignore_all = 1 + +kernel.randomize_va_space=2 +# kernel.perf_event_paranoid = 3 +# fs.protected_symlinks=1 +# fs.protected_hardlinks=1 diff --git a/meta-openeuler/recipes-extended/procps/procps_%.bbappend b/meta-openeuler/recipes-extended/procps/procps_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..4a5c781e92b2391715b33667cf2f878205ec96c3 --- /dev/null +++ b/meta-openeuler/recipes-extended/procps/procps_%.bbappend @@ -0,0 +1,39 @@ +#main bbfile: yocto-poky/meta/recipes-extended/procps/procps_3.3.17.bb + +#version in openEuler +PV = "4.0.2" + +S = "${WORKDIR}/procps-ng-${PV}" + +FILESEXTRAPATHS_append := "${THISDIR}/procps/:" + +OPENEULER_REPO_NAME = "procps-ng" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ + git://gitlab.com/procps-ng/procps.git;protocol=https \ + git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master \ + file://0001-w.c-correct-musl-builds.patch \ + file://0002-proc-escape.c-add-missing-include.patch \ + " +# files, patches that come from openeuler +SRC_URI += " \ + file://procps-ng/procps-ng-${PV}.tar.xz \ +" + +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \ + " + +# file://procps-ng/openeuler-add-M-and-N-options-for-top.patch +# file://procps-ng/openeuler-top-exit-with-error-when-pid-overflow.patch +# file://procps-ng/skill-Restore-the-p-flag-functionality.patch +do_configure_prepend() { + # cannot run po/update-potfiles in new version + if [ ! -f ${S}/po/update-potfiles ]; then + touch ${S}/po/update-potfiles + chmod +x ${S}/po/update-potfiles + fi +} + +SRC_URI[sha256sum] = "ee3fcd2ea6ff94aa43a81ba5cc7912b7c9615acd2911c7a3d3ea081287fdf47a" diff --git a/meta-openeuler/recipes-extended/psmisc/psmisc_%.bbappend b/meta-openeuler/recipes-extended/psmisc/psmisc_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..b3d65b07e1ac82ed5d7c7c7d71047a714c0cd78f --- /dev/null +++ b/meta-openeuler/recipes-extended/psmisc/psmisc_%.bbappend @@ -0,0 +1,24 @@ +# package and patches from openeuler +PV = "23.6" + +SRC_URI = " \ + file://psmisc-${PV}.tar.xz \ +" + +# patches from poky +SRC_URI += " \ + file://0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch \ +" + +S = "${WORKDIR}/${BPN}-${PV}" + +do_configure_prepend() { + # cannot run po/update-potfiles in new version + if [ ! -f ${S}/po/update-potfiles ]; then + touch ${S}/po/update-potfiles + chmod +x ${S}/po/update-potfiles + fi +} + +SRC_URI[md5sum] = "9cbcf82bcf3ab2aab3edef361f171bb9" +SRC_URI[sha256sum] = "2c960f2949a606653a8a05701224587f56856ab7c66b6f376a589144ce248657" diff --git a/meta-openeuler/recipes-extended/quota/quota_%.bbappend b/meta-openeuler/recipes-extended/quota/quota_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..c865941dbe5dc2b79d9b7d45d3317071097ed639 --- /dev/null +++ b/meta-openeuler/recipes-extended/quota/quota_%.bbappend @@ -0,0 +1,26 @@ +#main bbfile: yocto-poky/meta/recipes-extended/quota/quota_4.06.bb + +#version in openEuler +PV = "4.06" + +S = "${WORKDIR}/${BPN}-${PV}" + +DEPENDS_remove += "dbus" +PACKAGECONFIG_remove += "tcp-wrappers" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ + ${SOURCEFORGE_MIRROR}/project/linuxquota/quota-tools/${PV}/quota-${PV}.tar.gz \ + " +# files, patches that come from openeuler +SRC_URI += " \ + file://quota-${PV}.tar.gz \ + file://0000-Limit-number-of-comparison-characters-to-4.patch \ + file://0001-Limit-maximum-of-RPC-port.patch \ + file://0002-quotaio_xfs-Warn-when-large-kernel-timestamps-cannot.patch \ + file://0004-quota_nld-Initialize-sa_mask-when-registering-PID-fi.patch \ + file://0005-quota-nld-fix-open-PID-file-failed-when-systemd-read.patch \ + " + +SRC_URI[tarball.md5sum] = "aef94648438832b684978d46fdf75110" +SRC_URI[tarball.sha256sum] = "2f3e03039f378d4f0d97acdb49daf581dcaad64d2e1ddf129495fd579fbd268d" diff --git a/meta-openeuler/recipes-extended/rpcbind/files/fix-CVE-2017-8779.patch b/meta-openeuler/recipes-extended/rpcbind/files/fix-CVE-2017-8779.patch new file mode 100644 index 0000000000000000000000000000000000000000..0cb218d6fd609b02dafc03354db9f0f20c81409a --- /dev/null +++ b/meta-openeuler/recipes-extended/rpcbind/files/fix-CVE-2017-8779.patch @@ -0,0 +1,13 @@ +diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c +index 9c1c3af..fb14bb9 100644 +--- a/src/rpcb_svc_com.c ++++ b/src/rpcb_svc_com.c +@@ -432,7 +433,7 @@ rpcbproc_taddr2uaddr_com(void *arg, struct svc_req *rqstp /*__unused*/, + static bool_t + xdr_encap_parms(XDR *xdrs, struct encap_parms *epp) + { +- return (xdr_bytes(xdrs, &(epp->args), (u_int *) &(epp->arglen), ~0)); ++ return (xdr_bytes(xdrs, &(epp->args), (u_int *) &(epp->arglen), RPC_MAXDATASIZE)); + } + + /* diff --git a/meta-openeuler/recipes-extended/rpcbind/files/rpcbind_add_option_to_fix_port_number.patch b/meta-openeuler/recipes-extended/rpcbind/files/rpcbind_add_option_to_fix_port_number.patch new file mode 100644 index 0000000000000000000000000000000000000000..535f9ce20ddc06422e317f1b4c4dbe5fd56fb275 --- /dev/null +++ b/meta-openeuler/recipes-extended/rpcbind/files/rpcbind_add_option_to_fix_port_number.patch @@ -0,0 +1,130 @@ +From 76f8598fd20727908e760cbb497dd6a17eda4af5 Mon Sep 17 00:00:00 2001 +From: Roy Li +Date: Wed, 17 Sep 2014 13:22:14 +0800 +Subject: [PATCH] add option to make users able to use fixed port number + +Upstream-Status: Submitted [https://sourceforge.net/p/rpcbind/discussion/716839/thread/32af721d/] + +Signed-off-by: Li Wang +Signed-off-by: Roy Li +Signed-off-by: Yi Zhao +--- + man/rpcbind.8 | 4 +++- + src/rpcb_svc_com.c | 17 +++++++++++++++++ + src/rpcbind.c | 8 ++++++-- + 3 files changed, 26 insertions(+), 3 deletions(-) + +diff --git a/man/rpcbind.8 b/man/rpcbind.8 +index fbf0ace..66f7c08 100644 +--- a/man/rpcbind.8 ++++ b/man/rpcbind.8 +@@ -11,7 +11,7 @@ + .Nd universal addresses to RPC program number mapper + .Sh SYNOPSIS + .Nm +-.Op Fl adhiLls ++.Op Fl adhpiLls + .Sh DESCRIPTION + The + .Nm +@@ -96,6 +96,8 @@ will automatically add + and if IPv6 is enabled, + .Li ::1 + to the list. ++.It Fl p ++Bind for fixed UDP port number + If no + .Fl h + option is specified, +diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c +index 1743dad..07a1c75 100644 +--- a/src/rpcb_svc_com.c ++++ b/src/rpcb_svc_com.c +@@ -48,6 +48,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -497,6 +498,7 @@ xdr_opaque_parms(XDR *xdrs, struct r_rmtcall_args *cap) + + static struct rmtcallfd_list *rmthead; + static struct rmtcallfd_list *rmttail; ++extern unsigned short fixed_port; + + int + create_rmtcall_fd(struct netconfig *nconf) +@@ -504,6 +506,8 @@ create_rmtcall_fd(struct netconfig *nconf) + int fd; + struct rmtcallfd_list *rmt; + SVCXPRT *xprt; ++ struct __rpc_sockinfo si; ++ struct t_bind taddr; + + if ((fd = __rpc_nconf2fd(nconf)) == -1) { + if (debugging) +@@ -512,6 +516,19 @@ create_rmtcall_fd(struct netconfig *nconf) + nconf->nc_device, errno); + return (-1); + } ++ ++ if (fixed_port) { ++ __rpc_fd2sockinfo(fd, &si); ++ memset(&taddr, 0, sizeof(taddr)); ++ taddr.addr.maxlen = taddr.addr.len = si.si_alen; ++ taddr.addr.buf = malloc(si.si_alen); ++ if (taddr.addr.buf == NULL) { ++ return -1; ++ } ++ *(unsigned short *)(&(taddr.addr.buf[0])) = si.si_af; ++ *(unsigned short *)(&(taddr.addr.buf[2])) = htons(fixed_port); ++ xprt = svc_tli_create(fd, nconf, &taddr, RPC_MAXDATASIZE, RPC_MAXDATASIZE); ++ } else + xprt = svc_tli_create(fd, 0, (struct t_bind *) 0, 0, 0); + if (xprt == NULL) { + if (debugging) +diff --git a/src/rpcbind.c b/src/rpcbind.c +index 25d8a90..36a95b9 100644 +--- a/src/rpcbind.c ++++ b/src/rpcbind.c +@@ -111,6 +111,7 @@ int runasdaemon = 0; + int insecure = 0; + int oldstyle_local = 0; + int verboselog = 0; ++unsigned short fixed_port = 0; + + char **hosts = NULL; + int nhosts = 0; +@@ -884,7 +885,7 @@ parseargs(int argc, char *argv[]) + { + int c; + oldstyle_local = 1; +- while ((c = getopt(argc, argv, "adh:ilswf")) != -1) { ++ while ((c = getopt(argc, argv, "adh:p:ilswf")) != -1) { + switch (c) { + case 'a': + doabort = 1; /* when debugging, do an abort on */ +@@ -902,6 +903,9 @@ parseargs(int argc, char *argv[]) + if (hosts[nhosts - 1] == NULL) + errx(1, "Out of memory"); + break; ++ case 'p': ++ fixed_port = atoi(optarg); ++ break; + case 'i': + insecure = 1; + break; +@@ -920,7 +924,7 @@ parseargs(int argc, char *argv[]) + break; + #endif + default: /* error */ +- fprintf(stderr, "usage: rpcbind [-adhilswf]\n"); ++ fprintf(stderr, "usage: rpcbind [-adhpilswf]\n"); + exit (1); + } + } +-- +2.25.1 + diff --git a/meta-openeuler/recipes-extended/rpcbind/rpcbind_%.bbappend b/meta-openeuler/recipes-extended/rpcbind/rpcbind_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..d873757046b407a4b867f1d0329066dd8977ada9 --- /dev/null +++ b/meta-openeuler/recipes-extended/rpcbind/rpcbind_%.bbappend @@ -0,0 +1,33 @@ +#main bbfile: yocto-poky/meta/recipes-extended/rpcbind/rpcbind_1.2.5.bb + +#version in openEuler +PV = "1.2.6" + +S = "${WORKDIR}/${BPN}-${PV}" + +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +# files, patches can't be applied in openeuler or conflict with openeuler +SRC_URI_remove = " \ + ${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \ + " +# files, patches that come from openeuler +# all openeuler systemd patches can't apply, include rpcbind-0.2.4-runstatdir.patch +# backport-debian-enable-rmt-calls-with-r.patch is conflict +SRC_URI_append += " \ + file://${BPN}-${PV}.tar.bz2 \ + file://bugfix-rpcbind-GETADDR-return-client-ip.patch \ + file://fix-CVE-2017-8779.patch \ + file://backport-fix-double-free-in-init_transport.patch \ + file://bugfix-listen-tcp-port-111.patch \ + " +# safety: set init.d/rpcbind no permission for other users +do_install_append() { + chmod 0750 ${D}${sysconfdir}/init.d/rpcbind +} + +SRC_URI[tarball.md5sum] = "2d84ebbb7d6fb1fc3566d2d4b37f214b" +SRC_URI[tarball.sha256sum] = "5613746489cae5ae23a443bb85c05a11741a5f12c8f55d2bb5e83b9defeee8de" + +# we current use rc5.d of rcS, in normal mode we don't want it autostart default for security +INITSCRIPT_PARAMS = "start 12 2 3 4 . stop 60 0 1 6 ." diff --git a/meta-openeuler/recipes-extended/rust-demo/files/demo-src/Cargo.toml b/meta-openeuler/recipes-extended/rust-demo/files/demo-src/Cargo.toml new file mode 100644 index 0000000000000000000000000000000000000000..7785f232ee143b10976d72c847ee1efecb23bccd --- /dev/null +++ b/meta-openeuler/recipes-extended/rust-demo/files/demo-src/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "rust-demo" +version = "0.1.0" +authors = ["yinwenhan"] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/meta-openeuler/recipes-extended/rust-demo/files/demo-src/src/main.rs b/meta-openeuler/recipes-extended/rust-demo/files/demo-src/src/main.rs new file mode 100644 index 0000000000000000000000000000000000000000..331ac3c279f8bafaccb6c34ad174190c397d8132 --- /dev/null +++ b/meta-openeuler/recipes-extended/rust-demo/files/demo-src/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello world! --from Rust"); +} diff --git a/meta-openeuler/recipes-extended/rust-demo/rust-demo_0.1.bb b/meta-openeuler/recipes-extended/rust-demo/rust-demo_0.1.bb new file mode 100644 index 0000000000000000000000000000000000000000..00d47074c5437de233b88f2476b4bf6872b9e596 --- /dev/null +++ b/meta-openeuler/recipes-extended/rust-demo/rust-demo_0.1.bb @@ -0,0 +1,9 @@ +inherit cargo +SUMMARY = "Rust simple demo" +DESCRIPTION = "A demo using openeuler Rust toolchain" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = "file://demo-src" +S = "${WORKDIR}/demo-src" +SRCREV = "${AUTOREV}" diff --git a/meta-openeuler/recipes-extended/screen/screen_%.bbappend b/meta-openeuler/recipes-extended/screen/screen_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..bbd9cc0d7d8ba4d1e7e9d3cad0a7af9fd3f8e5cf --- /dev/null +++ b/meta-openeuler/recipes-extended/screen/screen_%.bbappend @@ -0,0 +1,16 @@ +# main bbfile: yocto-poky/meta/recipes-extended/screen/screen_4.8.0.bb + +PV = "4.9.0" + +SRC_URI_remove = "file://CVE-2021-26937.patch \ +" + +# files, patches that come from openeuler +SRC_URI_prepend = "file://screen-4.3.1-screenrc.patch \ + file://screen-E3.patch \ + file://screen-4.3.1-suppress_remap.patch \ + file://screen-4.3.1-crypt.patch \ +" + +SRC_URI[md5sum] = "71aa04268c0034b3016ceb51bcde91cd" +SRC_URI[sha256sum] = "a7d615ee46f5361489fc423c4436b02d5b622aeefadeb4cd1a60b46d5d161dde" diff --git a/meta-openeuler/recipes-extended/sed/sed_%.bbappend b/meta-openeuler/recipes-extended/sed/sed_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..855427940430c02352f17c8ec156f2a763362a2c --- /dev/null +++ b/meta-openeuler/recipes-extended/sed/sed_%.bbappend @@ -0,0 +1,15 @@ +# main bbfile: yocto-poky/meta/recipes-extended/sed/sed_4.8.bb + +PV = "4.9" + +LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \ + file://sed/sed.h;beginline=1;endline=15;md5=4e8e0f77bc4c1c2c02c2b90d3d24c670 \ +" + +SRC_URI:remove += " ${GNU_MIRROR}/sed/sed-${PV}.tar.xz " + +# patches in openeuler +SRC_URI += " \ + file://sed-${PV}.tar.xz \ + file://sed/backport-sed-c-flag.patch \ +" diff --git a/meta-openeuler/recipes-extended/shadow/files/413-0001-Disable-use-of-syslog-for-sysroot.patch b/meta-openeuler/recipes-extended/shadow/files/413-0001-Disable-use-of-syslog-for-sysroot.patch new file mode 100644 index 0000000000000000000000000000000000000000..fa1532c8317ef563f9bb926984aaee927e5f9782 --- /dev/null +++ b/meta-openeuler/recipes-extended/shadow/files/413-0001-Disable-use-of-syslog-for-sysroot.patch @@ -0,0 +1,52 @@ +From 85d0444229ee3d14fefcf10d093f49c862826f82 Mon Sep 17 00:00:00 2001 +From: Richard Purdie +Date: Thu, 14 Apr 2022 23:11:53 +0000 +Subject: [PATCH] Disable use of syslog for shadow-native tools + +Disable use of syslog to prevent sysroot user and group additions from +writing entries to the host's syslog. This patch should only be used +with the shadow-native recipe. + +Upstream-Status: Inappropriate [OE specific configuration] +Signed-off-by: Richard Purdie +Signed-off-by: Peter Kjellerstedt + +--- + configure.ac | 2 +- + src/login_nopam.c | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 924254a..603af81 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -191,7 +191,7 @@ AC_DEFINE_UNQUOTED(PASSWD_PROGRAM, "$shadow_cv_passwd_dir/passwd", + [Path to passwd program.]) + + dnl XXX - quick hack, should disappear before anyone notices :). +-AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog().]) ++#AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog().]) + if test "$ac_cv_func_ruserok" = "yes"; then + AC_DEFINE(RLOGIN, 1, [Define if login should support the -r flag for rlogind.]) + AC_DEFINE(RUSEROK, 0, [Define to the ruserok() "success" return value (0 or 1).]) +diff --git a/src/login_nopam.c b/src/login_nopam.c +index df6ba88..fc24e13 100644 +--- a/src/login_nopam.c ++++ b/src/login_nopam.c +@@ -29,7 +29,6 @@ + #ifndef USE_PAM + #ident "$Id$" + +-#include "prototypes.h" + /* + * This module implements a simple but effective form of login access + * control based on login names and on host (or domain) names, internet +@@ -57,6 +56,8 @@ + #include + #include /* for inet_ntoa() */ + ++#include "prototypes.h" ++ + #if !defined(MAXHOSTNAMELEN) || (MAXHOSTNAMELEN < 64) + #undef MAXHOSTNAMELEN + #define MAXHOSTNAMELEN 256 diff --git a/meta-openeuler/recipes-extended/shadow/files/413-commonio.c-fix-unexpected-open-failure-in-chroot-env.patch b/meta-openeuler/recipes-extended/shadow/files/413-commonio.c-fix-unexpected-open-failure-in-chroot-env.patch new file mode 100644 index 0000000000000000000000000000000000000000..85d9175105631cb240195e5da54032904b5e827c --- /dev/null +++ b/meta-openeuler/recipes-extended/shadow/files/413-commonio.c-fix-unexpected-open-failure-in-chroot-env.patch @@ -0,0 +1,49 @@ +From 21583da072aa66901d859ac00ce209bac87ddecc Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Thu, 17 Jul 2014 15:53:34 +0800 +Subject: [PATCH] commonio.c-fix-unexpected-open-failure-in-chroot-env + +Upstream-Status: Inappropriate [OE specific] + +commonio.c: fix unexpected open failure in chroot environment + +When using commands with '-R ' option in our pseudo environment, +we would usually get the 'Pemission Denied' error. This patch serves as +a workaround to this problem. + +Note that this patch doesn't change the logic in the code, it just expands +the codes. + +Signed-off-by: Chen Qi + +--- + lib/commonio.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/lib/commonio.c b/lib/commonio.c +index 9a02ce1..61384ec 100644 +--- a/lib/commonio.c ++++ b/lib/commonio.c +@@ -616,10 +616,18 @@ int commonio_open (struct commonio_db *db, int mode) + db->cursor = NULL; + db->changed = false; + +- fd = open (db->filename, +- (db->readonly ? O_RDONLY : O_RDWR) +- | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW); +- saved_errno = errno; ++ if (db->readonly) { ++ fd = open (db->filename, ++ (true ? O_RDONLY : O_RDWR) ++ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW); ++ saved_errno = errno; ++ } else { ++ fd = open (db->filename, ++ (false ? O_RDONLY : O_RDWR) ++ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW); ++ saved_errno = errno; ++ } ++ + db->fp = NULL; + if (fd >= 0) { + #ifdef WITH_TCB diff --git a/meta-openeuler/recipes-extended/shadow/files/diff_login_defs.txt b/meta-openeuler/recipes-extended/shadow/files/diff_login_defs.txt new file mode 100644 index 0000000000000000000000000000000000000000..476a1f749f45d2c3167c11fbc9a536b34727a26d --- /dev/null +++ b/meta-openeuler/recipes-extended/shadow/files/diff_login_defs.txt @@ -0,0 +1,262 @@ +--- etc/login.defs 2018-03-09 12:34:56.000000000 +0000 ++++ /usr1/openeuler/src/yocto-meta-openeuler/meta-openeuler/recipes-extended/shadow/files/login.defs 2022-07-29 13:27:19.063850481 +0000 +@@ -9,10 +9,10 @@ + # Note: When PAM is used, some modules may enforce a minimum delay (e.g. + # pam_unix(8) enforces a 2s delay) + # +-FAIL_DELAY 3 ++#FAIL_DELAY 3 + + # +-# Enable logging and display of /var/log/faillog login(1) failure info. ++# Enable logging and display of /var/log/faillog2 login(1) failure info. + # + #FAILLOG_ENAB yes + +@@ -29,7 +29,7 @@ LOG_OK_LOGINS no + # + # Enable logging and display of /var/log/lastlog login(1) time info. + # +-#LASTLOG_ENAB yes ++LASTLOG_ENAB yes + + # + # Limit the highest user ID number for which the lastlog entries should +@@ -67,15 +67,15 @@ LOG_OK_LOGINS no + # Enable "syslog" logging of su(1) activity - in addition to sulog file logging. + # SYSLOG_SG_ENAB does the same for newgrp(1) and sg(1). + # +-SYSLOG_SU_ENAB yes +-SYSLOG_SG_ENAB yes ++#SYSLOG_SU_ENAB yes ++#SYSLOG_SG_ENAB yes + + # + # If defined, either full pathname of a file containing device names or + # a ":" delimited list of device names. Root logins will be allowed only + # from these devices. + # +-CONSOLE /etc/securetty ++#CONSOLE /etc/securetty + #CONSOLE console:tty01:tty02:tty03:tty04 + + # +@@ -136,7 +136,7 @@ MAIL_FILE .mail + # user's name or shell are found in the file. If not a full pathname, then + # hushed mode will be enabled if the file exists in the user's home directory. + # +-HUSHLOGIN_FILE .hushlogin ++#HUSHLOGIN_FILE .hushlogin + #HUSHLOGIN_FILE /etc/hushlogins + + # +@@ -158,8 +158,8 @@ HUSHLOGIN_FILE .hushlogin + # *REQUIRED* The default PATH settings, for superuser and normal users. + # + # (they are minimal, add the rest in the shell startup files) +-ENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin +-ENV_PATH PATH=/bin:/usr/bin ++ENV_SUPATH PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin ++ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin + + # + # Terminal permissions +@@ -172,7 +172,7 @@ ENV_PATH PATH=/bin:/usr/bin + # and TTYPERM as 0620. Otherwise leave TTYGROUP commented out and + # set TTYPERM to either 622 or 600. + # +-TTYGROUP tty ++#TTYGROUP tty + TTYPERM 0600 + + # +@@ -188,8 +188,8 @@ TTYPERM 0600 + # + # Prefix these values with "0" to get octal, "0x" to get hexadecimal. + # +-ERASECHAR 0177 +-KILLCHAR 025 ++#ERASECHAR 0177 ++#KILLCHAR 025 + #ULIMIT 2097152 + + # Default initial "umask" value used by login(1) on non-PAM enabled systems. +@@ -199,7 +199,7 @@ KILLCHAR 025 + # 022 is the default value, but 027, or even 077, could be considered + # for increased privacy. There is no One True Answer here: each sysadmin + # must make up their mind. +-UMASK 022 ++UMASK 077 + + # HOME_MODE is used by useradd(8) and newusers(8) to set the mode for new + # home directories. +@@ -214,10 +214,10 @@ UMASK 022 + # PASS_MIN_LEN Minimum acceptable password length. + # PASS_WARN_AGE Number of days warning given before a password expires. + # +-PASS_MAX_DAYS 99999 +-PASS_MIN_DAYS 0 ++PASS_MAX_DAYS 90 ++PASS_MIN_DAYS 7 + #PASS_MIN_LEN 5 +-PASS_WARN_AGE 7 ++PASS_WARN_AGE 7 + + # + # If "yes", the user must be listed as a member of the first gid 0 group +@@ -235,11 +235,11 @@ PASS_WARN_AGE 7 + # + # Min/max values for automatic uid selection in useradd(8) + # +-UID_MIN 1000 ++UID_MIN 500 + UID_MAX 60000 + # System accounts + SYS_UID_MIN 101 +-SYS_UID_MAX 999 ++#SYS_UID_MAX 999 + # Extra per user uids + SUB_UID_MIN 100000 + SUB_UID_MAX 600100000 +@@ -248,11 +248,11 @@ SUB_UID_COUNT 65536 + # + # Min/max values for automatic gid selection in groupadd(8) + # +-GID_MIN 1000 ++GID_MIN 500 + GID_MAX 60000 + # System accounts + SYS_GID_MIN 101 +-SYS_GID_MAX 999 ++#SYS_GID_MAX 999 + # Extra per user group ids + SUB_GID_MIN 100000 + SUB_GID_MAX 600100000 +@@ -261,7 +261,7 @@ SUB_GID_COUNT 65536 + # + # Max number of login(1) retries if password is bad + # +-LOGIN_RETRIES 5 ++#LOGIN_RETRIES 5 + + # + # Max time in seconds for login(1) +@@ -295,8 +295,8 @@ LOGIN_TIMEOUT 60 + # any combination of letters "frwh" (full name, room number, work + # phone, home phone). If not defined, no changes are allowed. + # For backward compatibility, "yes" = "rwh" and "no" = "frwh". +-# +-CHFN_RESTRICT rwh ++# ++#CHFN_RESTRICT rwh + + # + # Password prompt (%s will be replaced by user name). +@@ -326,9 +326,7 @@ CHFN_RESTRICT rwh + # If set to SHA256, SHA256-based algorithm will be used for encrypting password + # If set to SHA512, SHA512-based algorithm will be used for encrypting password + # If set to BCRYPT, BCRYPT-based algorithm will be used for encrypting password +-# If set to YESCRYPT, YESCRYPT-based algorithm will be used for encrypting password + # If set to DES, DES-based algorithm will be used for encrypting password (default) +-# MD5 and DES should not be used for new hashes, see crypt(5) for recommendations. + # Overrides the MD5_CRYPT_ENAB option + # + # Note: If you use PAM, it is recommended to use a value consistent with +@@ -344,8 +342,7 @@ ENCRYPT_METHOD SHA512 + # However, more CPU resources will be needed to authenticate users if + # this value is increased. + # +-# If not specified, the libc will choose the default number of rounds (5000), +-# which is orders of magnitude too low for modern hardware. ++# If not specified, the libc will choose the default number of rounds (5000). + # The values must be within the 1000-999999999 range. + # If only one of the MIN or MAX values is set, then this value will be used. + # If MIN > MAX, the highest value will be used. +@@ -354,23 +351,6 @@ ENCRYPT_METHOD SHA512 + #SHA_CRYPT_MAX_ROUNDS 5000 + + # +-# Only works if ENCRYPT_METHOD is set to SM3. +-# +-# Define the number of SM3 rounds. +-# With a lot of rounds, it is more difficult to brute-force the password. +-# However, more CPU resources will be needed to authenticate users if +-# this value is increased. +-# +-# If not specified, the libc will choose the default number of rounds (5000), +-# which is orders of magnitude too low for modern hardware. +-# The values must be within the 1000-999999999 range. +-# If only one of the MIN or MAX values is set, then this value will be used. +-# If MIN > MAX, the highest value will be used. +-# +-#SM3_CRYPT_MAX_ROUNDS 5000 +-#SM3_CRYPT_MIN_ROUNDS 5000 +- +-# + # Only works if ENCRYPT_METHOD is set to BCRYPT. + # + # Define the number of BCRYPT rounds. +@@ -386,19 +366,6 @@ ENCRYPT_METHOD SHA512 + #BCRYPT_MAX_ROUNDS 13 + + # +-# Only works if ENCRYPT_METHOD is set to YESCRYPT. +-# +-# Define the YESCRYPT cost factor. +-# With a higher cost factor, it is more difficult to brute-force the password. +-# However, more CPU time and more memory will be needed to authenticate users +-# if this value is increased. +-# +-# If not specified, a cost factor of 5 will be used. +-# The value must be within the 1-11 range. +-# +-#YESCRYPT_COST_FACTOR 5 +- +-# + # List of groups to add to the user's supplementary group set + # when logging in from the console (as determined by the CONSOLE + # setting). Default is none. +@@ -416,14 +383,6 @@ ENCRYPT_METHOD SHA512 + DEFAULT_HOME yes + + # +-# The pwck(8) utility emits a warning for any system account with a home +-# directory that does not exist. Some system accounts intentionally do +-# not have a home directory. Such accounts may have this string as +-# their home directory in /etc/passwd to avoid a spurious warning. +-# +-NONEXISTENT /nonexistent +- +-# + # If this file exists and is readable, login environment will be + # read from it. Every line should be in the form name=value. + # +@@ -469,28 +428,3 @@ CREATE_HOME yes + # missing. + # + #FORCE_SHADOW yes +- +-# +-# Allow newuidmap and newgidmap when running under an alternative +-# primary group. +-# +-#GRANT_AUX_GROUP_SUBIDS yes +- +-# +-# Prevents an empty password field to be interpreted as "no authentication +-# required". +-# Set to "yes" to prevent for all accounts +-# Set to "superuser" to prevent for UID 0 / root (default) +-# Set to "no" to not prevent for any account (dangerous, historical default) +- +-PREVENT_NO_AUTH superuser +- +-# +-# Select the HMAC cryptography algorithm. +-# Used in pam_timestamp module to calculate the keyed-hash message +-# authentication code. +-# +-# Note: It is recommended to check hmac(3) to see the possible algorithms +-# that are available in your system. +-# +-#HMAC_CRYPTO_ALGO SHA512 diff --git a/meta-openeuler/recipes-core/shadow/files/login.defs b/meta-openeuler/recipes-extended/shadow/files/login.defs similarity index 99% rename from meta-openeuler/recipes-core/shadow/files/login.defs rename to meta-openeuler/recipes-extended/shadow/files/login.defs index b69058a56729b30e07ec60e0005344b81bdfceb2..dfedf1d273145a47ad8ae7b32379958fdb43637f 100644 --- a/meta-openeuler/recipes-core/shadow/files/login.defs +++ b/meta-openeuler/recipes-extended/shadow/files/login.defs @@ -29,7 +29,7 @@ LOG_OK_LOGINS no # # Enable logging and display of /var/log/lastlog login(1) time info. # -#LASTLOG_ENAB yes +LASTLOG_ENAB yes # # Limit the highest user ID number for which the lastlog entries should @@ -127,8 +127,8 @@ LOG_OK_LOGINS no # Directory where mailboxes reside, _or_ name of file, relative to the # home directory. If you _do_ define both, #MAIL_DIR takes precedence. # -MAIL_DIR /var/spool/mail -#MAIL_FILE .mail +#MAIL_DIR /var/spool/mail +MAIL_FILE .mail # # If defined, file which inhibits all the usual chatter during the login @@ -199,7 +199,7 @@ TTYPERM 0600 # 022 is the default value, but 027, or even 077, could be considered # for increased privacy. There is no One True Answer here: each sysadmin # must make up their mind. -#UMASK 022 +UMASK 077 # HOME_MODE is used by useradd(8) and newusers(8) to set the mode for new # home directories. @@ -428,5 +428,3 @@ CREATE_HOME yes # missing. # #FORCE_SHADOW yes -UMASK 077 -LASTLOG_ENAB yes diff --git a/meta-openeuler/recipes-core/shadow/files/login.defs_shadow-sysroot b/meta-openeuler/recipes-extended/shadow/files/login.defs_shadow-sysroot similarity index 100% rename from meta-openeuler/recipes-core/shadow/files/login.defs_shadow-sysroot rename to meta-openeuler/recipes-extended/shadow/files/login.defs_shadow-sysroot diff --git a/meta-openeuler/recipes-core/shadow/files/login_defs_pam.sed b/meta-openeuler/recipes-extended/shadow/files/login_defs_pam.sed similarity index 100% rename from meta-openeuler/recipes-core/shadow/files/login_defs_pam.sed rename to meta-openeuler/recipes-extended/shadow/files/login_defs_pam.sed diff --git a/meta-openeuler/recipes-core/shadow/files/pam.d/chfn b/meta-openeuler/recipes-extended/shadow/files/pam.d/chfn similarity index 100% rename from meta-openeuler/recipes-core/shadow/files/pam.d/chfn rename to meta-openeuler/recipes-extended/shadow/files/pam.d/chfn diff --git a/meta-openeuler/recipes-core/shadow/files/pam.d/chpasswd b/meta-openeuler/recipes-extended/shadow/files/pam.d/chpasswd similarity index 100% rename from meta-openeuler/recipes-core/shadow/files/pam.d/chpasswd rename to meta-openeuler/recipes-extended/shadow/files/pam.d/chpasswd diff --git a/meta-openeuler/recipes-core/shadow/files/pam.d/chsh b/meta-openeuler/recipes-extended/shadow/files/pam.d/chsh similarity index 100% rename from meta-openeuler/recipes-core/shadow/files/pam.d/chsh rename to meta-openeuler/recipes-extended/shadow/files/pam.d/chsh diff --git a/meta-openeuler/recipes-core/shadow/files/pam.d/groupmems b/meta-openeuler/recipes-extended/shadow/files/pam.d/groupmems similarity index 100% rename from meta-openeuler/recipes-core/shadow/files/pam.d/groupmems rename to meta-openeuler/recipes-extended/shadow/files/pam.d/groupmems diff --git a/meta-openeuler/recipes-core/shadow/files/pam.d/login b/meta-openeuler/recipes-extended/shadow/files/pam.d/login similarity index 100% rename from meta-openeuler/recipes-core/shadow/files/pam.d/login rename to meta-openeuler/recipes-extended/shadow/files/pam.d/login diff --git a/meta-openeuler/recipes-core/shadow/files/pam.d/newusers b/meta-openeuler/recipes-extended/shadow/files/pam.d/newusers similarity index 100% rename from meta-openeuler/recipes-core/shadow/files/pam.d/newusers rename to meta-openeuler/recipes-extended/shadow/files/pam.d/newusers diff --git a/meta-openeuler/recipes-core/shadow/files/pam.d/passwd b/meta-openeuler/recipes-extended/shadow/files/pam.d/passwd similarity index 100% rename from meta-openeuler/recipes-core/shadow/files/pam.d/passwd rename to meta-openeuler/recipes-extended/shadow/files/pam.d/passwd diff --git a/meta-openeuler/recipes-core/shadow/files/pam.d/su b/meta-openeuler/recipes-extended/shadow/files/pam.d/su similarity index 100% rename from meta-openeuler/recipes-core/shadow/files/pam.d/su rename to meta-openeuler/recipes-extended/shadow/files/pam.d/su diff --git a/meta-openeuler/recipes-core/shadow/files/securetty b/meta-openeuler/recipes-extended/shadow/files/securetty similarity index 100% rename from meta-openeuler/recipes-core/shadow/files/securetty rename to meta-openeuler/recipes-extended/shadow/files/securetty diff --git a/meta-openeuler/recipes-extended/shadow/files/useradd b/meta-openeuler/recipes-extended/shadow/files/useradd new file mode 100644 index 0000000000000000000000000000000000000000..782aeef41879e677ca8409fed499eaee17682916 --- /dev/null +++ b/meta-openeuler/recipes-extended/shadow/files/useradd @@ -0,0 +1,8 @@ +# useradd defaults file +GROUP=100 +HOME=/home +INACTIVE=-1 +EXPIRE= +SHELL=/bin/sh +SKEL=/etc/skel +CREATE_MAIL_SPOOL=no diff --git a/meta-openeuler/recipes-extended/shadow/shadow-securetty_%.bbappend b/meta-openeuler/recipes-extended/shadow/shadow-securetty_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..4d2729e5d4c150e34c509f4e2c6c7bbc1378d107 --- /dev/null +++ b/meta-openeuler/recipes-extended/shadow/shadow-securetty_%.bbappend @@ -0,0 +1,2 @@ +PV = "4.6" +PR = "r1" diff --git a/meta-openeuler/recipes-extended/shadow/shadow-sysroot_%.bbappend b/meta-openeuler/recipes-extended/shadow/shadow-sysroot_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..4d2729e5d4c150e34c509f4e2c6c7bbc1378d107 --- /dev/null +++ b/meta-openeuler/recipes-extended/shadow/shadow-sysroot_%.bbappend @@ -0,0 +1,2 @@ +PV = "4.6" +PR = "r1" diff --git a/meta-openeuler/recipes-extended/shadow/shadow_%.bbappend b/meta-openeuler/recipes-extended/shadow/shadow_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..07eb5971c4e9244e44642dca9371e40771949fa8 --- /dev/null +++ b/meta-openeuler/recipes-extended/shadow/shadow_%.bbappend @@ -0,0 +1,97 @@ +#main bbfile: yocto-poky/meta/recipes-extended/shadow/shadow_4.8.1.bb +#ref: https://git.yoctoproject.org/poky/tree/meta/recipes-extended/shadow/shadow_4.13.bb + +OPENEULER_SRC_URI_REMOVE = "https git http" + +PV = "4.13" + +LIC_FILES_CHKSUM = "file://COPYING;md5=c9a450b7be84eac23e6353efecb60b5b \ + file://src/passwd.c;beginline=2;endline=30;md5=758c26751513b6795395275969dd3be1 \ + " + +# get extra config files from openeuler +FILESEXTRAPATHS_prepend := "${THISDIR}/files/:" + +SRC_URI = "file://${BP}.tar.xz \ + ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \ + file://usermod-unlock.patch \ + file://backport-useradd-check-if-subid-range-exists-for-user.patch \ + file://shadow-add-sm3-crypt-support.patch \ + file://useradd \ +" + +# add extra pam files for openeuler +# poky shadow.inc have added: chfn chpasswd chsh login newusers passwd su +PAM_SRC_URI += " \ + file://pam.d/groupmems \ + file://login.defs \ +" + +# delete native patches from poky, patch failed, as it's for 4.8.1 +SRC_URI_remove_class-native = " \ + file://0001-Disable-use-of-syslog-for-sysroot.patch \ + file://0002-Allow-for-setting-password-in-clear-text.patch \ + file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \ +" + +# apply 4.13 specific patches, remove these when poky's shadow upgrade to 4.13 +SRC_URI_append_class-native = " \ + file://413-0001-Disable-use-of-syslog-for-sysroot.patch \ + file://413-commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \ + file://login.defs \ +" + +SRC_URI[sha256sum] = "813057047499c7fe81108adcf0cffa3ad4ec75e19a80151f9cbaa458ff2e86cd" + +# no ${mandir} installed in openeuler +ALTERNATIVE_${PN}-doc = "" + +do_install_prepend () { + # we use a higher version useradd config from poky honister, these functions have applied: + # * Disable mail creation: "CREATE_MAIL_SPOOL=no" + # * Use users group by default: "GROUP=100" + # see: https://git.yoctoproject.org/poky/tree/meta/recipes-extended/shadow?h=honister + mkdir -p ${D}${sysconfdir}/default/ + install -m 0644 ${WORKDIR}/useradd ${D}${sysconfdir}/default +} + +do_install_append () { + # use login.defs from openeuler, we have applied these functions as poky: + # * Enable CREATE_HOME by default: "CREATE_HOME yes" + # * Make the users mailbox in ~/ not /var/spool/mail by default on an embedded system: "MAIL_FILE .mail" and "#MAIL_DIR /var/spool/mail" + # * Disable checking emails: "#MAIL_CHECK_ENAB yes" + # * Comment out SU_NAME to work correctly with busybox (See Bug#5359 and Bug#7173): "#SU_NAME su" + # * Use proper encryption for passwords: "ENCRYPT_METHOD SHA512" + # * other list of function that compare with poky's shadow (yocto-poky/meta/recipes-extended/shadow/files/login_defs_pam.sed) : + # Function login_defs_pam.sed openeuler + # FAILLOG_ENAB comment comment + # LASTLOG_ENAB comment "LASTLOG_ENAB yes" + # MAIL_CHECK_ENAB comment comment + # OBSCURE_CHECKS_ENAB comment comment + # PORTTIME_CHECKS_ENAB comment comment + # QUOTAS_ENAB comment comment + # MOTD_FILE comment comment + # FTMP_FILE comment comment + # NOLOGINS_FILE comment comment + # ENV_HZ comment comment + # ENV_TZ comment comment + # PASS_MIN_LEN comment comment + # SU_WHEEL_ONLY comment comment + # CRACKLIB_DICTPATH comment comment + # PASS_CHANGE_TRIES comment comment + # PASS_ALWAYS_WARN comment comment + # PASS_MAX_LEN comment comment + # PASS_MIN_LEN comment comment + # CHFN_AUTH comment comment + # CHSH_AUTH comment noexist + # ISSUE_FILE comment comment + # LOGIN_STRING comment comment + # ULIMIT comment comment + # ENVIRON_FILE comment comment + # * for other difference between poky's shadow login.defs, see diff_login_defs.txt + + install -m 0644 ${WORKDIR}/login.defs ${D}${sysconfdir}/login.defs + + # use /bin/bash as default SHELL + sed -i 's:/bin/sh:/bin/bash:g' ${D}${sysconfdir}/default/useradd +} diff --git a/meta-openeuler/recipes-extended/tar/tar_%.bbappend b/meta-openeuler/recipes-extended/tar/tar_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..8d7544f09838cdebc971439ff0097f51bbed5242 --- /dev/null +++ b/meta-openeuler/recipes-extended/tar/tar_%.bbappend @@ -0,0 +1,17 @@ +# main bbfile: yocto-poky/meta/recipes-extended/tar/tar_1.34.bb +PV="1.34" + +# Use the source packages from openEuler +SRC_URI_remove = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2" +SRC_URI_prepend = "file://tar-${PV}.tar.xz \ + file://backport-CVE-2022-48303.patch \ + file://tar-1.28-loneZeroWarning.patch \ + file://tar-1.28-vfatTruncate.patch \ + file://tar-1.29-wildcards.patch \ + file://tar-1.28-atime-rofs.patch \ + file://tar-1.28-document-exclude-mistakes.patch \ + file://tar-Add-sw64-architecture.patch \ +" + +SRC_URI[md5sum] = "aa1621ec7013a19abab52a8aff04fe5b" +SRC_URI[sha256sum] = "3e1e518ffc912f86608a8cb35e4bd41ad1aec210df2a47aaa1f95e7f5576ef56" diff --git a/meta-openeuler/recipes-extended/wwan/wwan.bb b/meta-openeuler/recipes-extended/wwan/wwan.bb new file mode 100644 index 0000000000000000000000000000000000000000..137e3b5cae00fbc38a2ceb15d5739f44986c87f6 --- /dev/null +++ b/meta-openeuler/recipes-extended/wwan/wwan.bb @@ -0,0 +1,57 @@ +# +# SPDX-License-Identifier: MIT +# This file Copyright (C) 2018, 2020-2021 Anton Kikin +# +PR = "tano5" + +DESCRIPTION = "Generic OpenWrt 3G/4G proto handler" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=801f80980d171dd6425610833a22dbe6" +SECTION = "net/misc" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}/patches:${THISDIR}/${PN}/files:" + +SRC_URI += "\ + file://wwan.sh \ + file://wwan.usb \ + file://wwan.usbmisc \ + file://LICENSE \ +" + +S = "${WORKDIR}" + +SRC_URI[data.md5sum] = "477aabf75258536005d58aef9b0d59d8" + +inherit allarch + +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_fetch[cleandirs] += "${WORKDIR}/data" + +do_install_append() { + install -dm 0755 ${D}/lib/netifd/proto + install -m 0755 ${WORKDIR}/wwan.sh ${D}/lib/netifd/proto/wwan.sh + + install -dm 0755 ${D}${sysconfdir}/hotplug.d/usb + install -m 0755 ${WORKDIR}/wwan.usb ${D}${sysconfdir}/hotplug.d/usb/00_wwan.sh + + install -dm 0755 ${D}${sysconfdir}/hotplug.d/usbmisc + install -m 0755 ${WORKDIR}/wwan.usbmisc ${D}${sysconfdir}/hotplug.d/usbmisc/00_wwan.sh + + install -dm 0755 ${D}/lib/network/wwan + + # + # In order to keep the GIT repo free of filenames with colons, + # we name the files xxxx-yyyy and rename here after copying to the build directory + # + for filevar in ${WORKDIR}/data/*-* + do + [ -f "$filevar" ] || continue + FILENAME=$(basename $filevar) + NEWFILENAME=${FILENAME//-/:} + cp "${WORKDIR}/data/${FILENAME}" \ + "${D}/lib/network/wwan/${NEWFILENAME}" + done +} + +FILES_${PN} += "${sysconfidir}/ /lib/" diff --git a/meta-openeuler/recipes-extended/wwan/wwan/LICENSE b/meta-openeuler/recipes-extended/wwan/wwan/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..7f5abbce27293625a994963735f52e51bce8c1b6 --- /dev/null +++ b/meta-openeuler/recipes-extended/wwan/wwan/LICENSE @@ -0,0 +1,132 @@ + +GNU GENERAL PUBLIC LICENSE + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation`s software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author`s protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors` reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone`s free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program`s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. +b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. +c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients` exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + +one line to give the program`s name and an idea of what it does. +Copyright (C) yyyy name of author + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details +type `show w`. This is free software, and you are welcome +to redistribute it under certain conditions; type `show c` +for details. +The hypothetical commands `show w` and `show c` should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w` and `show c`; they could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright +interest in the program `Gnomovision` +(which makes passes at compilers) written +by James Hacker. + +signature of Ty Coon, 1 April 1989 +Ty Coon, President of Vice +This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. + diff --git a/meta-openeuler/recipes-extended/wwan/wwan/data/data.zip b/meta-openeuler/recipes-extended/wwan/wwan/data/data.zip new file mode 100644 index 0000000000000000000000000000000000000000..82682af790955d845be03fbd5aca64af29f73d4b --- /dev/null +++ b/meta-openeuler/recipes-extended/wwan/wwan/data/data.zip @@ -0,0 +1,1446 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + meta-tanowrt/data.zip at master · tano-systems/meta-tanowrt · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + +
+ + + + + + + + +Permalink + +
+ +
+
+ + + master + + + + +
+
+
+ Switch branches/tags + +
+ + + +
+ +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + +
+ + +
+
+
+
+ +
+ +
+ + + Go to file + +
+ + + + +
+
+
+ + + + + + + + + +
+ +
+
+ + @namedun + +
+ + + + + + + + + +
+
+ + Latest commit + 6eb8839 + Jun 14, 2021 + + + + + + History + + +
+
+
Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
+ +
+ +
+
+ + + 1 + + contributor + + +
+ +

+ Users who have contributed to this file +

+
+ + + + + + +
+
+
+
+ + + + + + + + + +
+ +
+ + +
+ + 62.5 KB +
+ +
+ + + + +
+
+ +
+
+ +
+ +
+
+ + + +
+ +
+ View raw +
+
+ +
+ + + + +
+ + +
+ + +
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + diff --git a/meta-openeuler/recipes-extended/wwan/wwan/wwan.sh b/meta-openeuler/recipes-extended/wwan/wwan/wwan.sh new file mode 100644 index 0000000000000000000000000000000000000000..1ffb94a92b8c59f09fffb7547019fdce370e5689 --- /dev/null +++ b/meta-openeuler/recipes-extended/wwan/wwan/wwan.sh @@ -0,0 +1,146 @@ +#!/bin/sh + +. /lib/functions.sh +. ../netifd-proto.sh +init_proto "$@" + +INCLUDE_ONLY=1 + +ctl_device="" +dat_device="" + +proto_mbim_setup() { echo "wwan[$$] mbim proto is missing"; } +proto_qmi_setup() { echo "wwan[$$] qmi proto is missing"; } +proto_ncm_setup() { echo "wwan[$$] ncm proto is missing"; } +proto_3g_setup() { echo "wwan[$$] 3g proto is missing"; } +proto_directip_setup() { echo "wwan[$$] directip proto is missing"; } + +[ -f ./mbim.sh ] && . ./mbim.sh +[ -f ./ncm.sh ] && . ./ncm.sh +[ -f ./qmi.sh ] && . ./qmi.sh +[ -f ./3g.sh ] && { . ./ppp.sh; . ./3g.sh; } +[ -f ./directip.sh ] && . ./directip.sh + +proto_wwan_init_config() { + available=1 + no_device=1 + + proto_config_add_string apn + proto_config_add_string auth + proto_config_add_string username + proto_config_add_string password + proto_config_add_string pincode + proto_config_add_string delay + proto_config_add_string modes + proto_config_add_string bus +} + +proto_wwan_setup() { + local driver usb devicename desc bus + + json_get_vars bus + + if [ -L "/sys/bus/usb/devices/${bus}" ]; then + if [ -f "/sys/bus/usb/devices/${bus}/idVendor" ] \ + && [ -f "/sys/bus/usb/devices/${bus}/idProduct" ]; then + local vendor product + vendor=$(cat /sys/bus/usb/devices/${bus}/idVendor) + product=$(cat /sys/bus/usb/devices/${bus}/idProduct) + [ -f /lib/network/wwan/$vendor:$product ] && { + usb=/lib/network/wwan/$vendor:$product + devicename=$bus + } + else + echo "wwan[$$]" "Specified usb bus ${bus} was not found" + proto_notify_error "$interface" NO_USB + proto_block_restart "$interface" + return 1 + fi + else + echo "wwan[$$]" "Searching for a valid wwan usb device..." + for a in `ls /sys/bus/usb/devices`; do + local vendor product + [ -z "$usb" -a -f /sys/bus/usb/devices/$a/idVendor -a -f /sys/bus/usb/devices/$a/idProduct ] || continue + vendor=$(cat /sys/bus/usb/devices/$a/idVendor) + product=$(cat /sys/bus/usb/devices/$a/idProduct) + [ -f /lib/network/wwan/$vendor:$product ] && { + usb=/lib/network/wwan/$vendor:$product + devicename=$a + } + done + fi + + echo "wwan[$$]" "Using wwan usb device on bus $devicename" + + [ -n "$usb" ] && { + local old_cb control data + + json_set_namespace wwan old_cb + json_init + json_load "$(cat "$usb")" + json_select + json_get_vars desc control data + json_set_namespace "$old_cb" + + [ -n "$control" -a -n "$data" ] && { + ttys=$(ls -d /sys/bus/usb/devices/$devicename/${devicename}*/tty?* /sys/bus/usb/devices/$devicename/${devicename}*/tty/tty?* | sed "s/.*\///g" | tr "\n" " ") + ctl_device=/dev/$(echo $ttys | cut -d" " -f $((control + 1))) + dat_device=/dev/$(echo $ttys | cut -d" " -f $((data + 1))) + driver=comgt + } + } + + [ -z "$ctl_device" ] && for net in $(ls /sys/class/net/ | grep -e wwan -e usb); do + [ -z "$ctl_device" ] || continue + [ -n "$bus" ] && { + [ $(readlink /sys/class/net/$net | grep $bus) ] || continue + } + driver=$(grep DRIVER /sys/class/net/$net/device/uevent | cut -d= -f2) + case "$driver" in + qmi_wwan|cdc_mbim) + ctl_device=/dev/$(ls /sys/class/net/$net/device/usbmisc) + ;; + sierra_net|cdc_ether|*cdc_ncm) + ctl_device=/dev/$(cd /sys/class/net/$net/; find ../../../ -name ttyUSB* |xargs -n1 basename | head -n1) + ;; + *) continue;; + esac + echo "wwan[$$]" "Using proto:$proto device:$ctl_device iface:$net desc:$desc" + done + + [ -n "$ctl_device" ] || { + echo "wwan[$$]" "No valid device was found" + proto_notify_error "$interface" NO_DEVICE + proto_block_restart "$interface" + return 1 + } + + uci_set_state network "$interface" driver "$driver" + uci_set_state network "$interface" ctl_device "$ctl_device" + uci_set_state network "$interface" dat_device "$dat_device" + + case $driver in + qmi_wwan) proto_qmi_setup $@ ;; + cdc_mbim) proto_mbim_setup $@ ;; + sierra_net) proto_directip_setup $@ ;; + comgt) proto_3g_setup $@ ;; + cdc_ether|*cdc_ncm) proto_ncm_setup $@ ;; + esac +} + +proto_wwan_teardown() { + local interface=$1 + local driver=$(uci_get_state network "$interface" driver) + ctl_device=$(uci_get_state network "$interface" ctl_device) + dat_device=$(uci_get_state network "$interface" dat_device) + + case $driver in + qmi_wwan) proto_qmi_teardown $@ ;; + cdc_mbim) proto_mbim_teardown $@ ;; + sierra_net) proto_directip_teardown $@ ;; + comgt) proto_3g_teardown $@ ;; + cdc_ether|*cdc_ncm) proto_ncm_teardown $@ ;; + esac +} + +add_protocol wwan diff --git a/meta-openeuler/recipes-extended/wwan/wwan/wwan.usb b/meta-openeuler/recipes-extended/wwan/wwan/wwan.usb new file mode 100644 index 0000000000000000000000000000000000000000..b757c1c2abcbf10b362d0dbf49363b715928c8ac --- /dev/null +++ b/meta-openeuler/recipes-extended/wwan/wwan/wwan.usb @@ -0,0 +1,23 @@ +#!/bin/sh + +[ "$ACTION" = add -a "$DEVTYPE" = usb_device ] || exit 0 + +. /lib/functions.sh +. /lib/netifd/netifd-proto.sh + +vid=$(cat /sys$DEVPATH/idVendor) +pid=$(cat /sys$DEVPATH/idProduct) +[ -f "/lib/network/wwan/$vid:$pid" ] || exit 0 + +find_wwan_iface() { + local cfg="$1" + local proto + config_get proto "$cfg" proto + [ "$proto" = wwan ] || return 0 + proto_set_available "$cfg" 1 + ifup $cfg + exit 0 +} + +config_load network +config_foreach find_wwan_iface interface diff --git a/meta-openeuler/recipes-extended/wwan/wwan/wwan.usbmisc b/meta-openeuler/recipes-extended/wwan/wwan/wwan.usbmisc new file mode 100644 index 0000000000000000000000000000000000000000..a86ff5d98b3624272fb55abc99e87a2a13b07263 --- /dev/null +++ b/meta-openeuler/recipes-extended/wwan/wwan/wwan.usbmisc @@ -0,0 +1,28 @@ +#!/bin/sh + +[ "$ACTION" = add ] || [ "$ACTION" = remove ] || exit 0 +[ "${DEVNAME/[0-9]/}" = cdc-wdm ] || exit 0 + +. /lib/functions.sh +. /lib/netifd/netifd-proto.sh + +find_wwan_iface() { + local cfg="$1" + + local proto device + config_get proto "$cfg" proto + config_get device "$cfg" device + + [ "$proto" = wwan ] || [ "$proto" = mbim ] || [ "$proto" = qmi ] || [ "$proto" = ncm ] || return 0 + [ -z "$device" -a "$proto" = wwan ] || [ "$device" = "/dev/$DEVNAME" ] || return 0 + if [ "$ACTION" = add ]; then + proto_set_available "$cfg" 1 + fi + if [ "$ACTION" = remove ]; then + proto_set_available "$cfg" 0 + fi + exit 0 +} + +config_load network +config_foreach find_wwan_iface interface diff --git a/meta-openeuler/recipes-extended/xz/xz_%.bbappend b/meta-openeuler/recipes-extended/xz/xz_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..13e7261c32090ab9fb513aa61e9b965266ed90f9 --- /dev/null +++ b/meta-openeuler/recipes-extended/xz/xz_%.bbappend @@ -0,0 +1,25 @@ +# main bbfile: yocto-poky/meta/recipes-extended/xz/xz_5.2.5.bb + +OPENEULER_SRC_URI_REMOVE = "https git http" + +# Use the source packages from openEuler +SRC_URI_remove = " \ + " + +PV = "5.2.10" + +SRC_URI += "file://xz-${PV}.tar.xz \ + " + +SRC_URI[md5sum] = "1b614d27061168d13afe6221a70e173a" +SRC_URI[sha256sum] = "d615974a17299eaa1bf3d0f3b7afa172624755c8885111b17659051869d6f072" + +#xz-native cannot dependes to xz-native +python() { + all_depends = d.getVarFlag("do_unpack", "depends") + for dep in ['xz']: + all_depends = all_depends.replace('%s-native:do_populate_sysroot' % dep, "") + new_depends = all_depends + if d.getVar("PN") == "xz-native": + d.setVarFlag("do_unpack", "depends", new_depends) +} diff --git a/meta-openeuler/recipes-extended/zstd/zstd_%.bbappend b/meta-openeuler/recipes-extended/zstd/zstd_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..5ba6e194a9ae020f88d88bbdc1e0b5c328075d89 --- /dev/null +++ b/meta-openeuler/recipes-extended/zstd/zstd_%.bbappend @@ -0,0 +1,17 @@ +PV = "1.5.2" + +SRC_URI = " \ + file://${BPN}-${PV}.tar.gz \ + file://add-test-c-result-print.patch \ + " + +S = "${WORKDIR}/${BP}" +SRC_URI[sha256sum] = "0d9ade222c64e912d6957b11c923e214e2e010a18f39bec102f572e693ba2867" + +do_compile_append () { + oe_runmake ${PACKAGECONFIG_CONFARGS} ZSTD_LEGACY_SUPPORT=${ZSTD_LEGACY_SUPPORT} -C contrib/pzstd +} + +do_install_append () { + oe_runmake install 'DESTDIR=${D}' PREFIX=${prefix} -C contrib/pzstd +} diff --git a/meta-openeuler/recipes-external/binutils/binutils-external-cross-canadian.bb b/meta-openeuler/recipes-external/binutils/binutils-external-cross-canadian.bb new file mode 100644 index 0000000000000000000000000000000000000000..860710ba1990ccbe40f4cca5eb3293d766e19810 --- /dev/null +++ b/meta-openeuler/recipes-external/binutils/binutils-external-cross-canadian.bb @@ -0,0 +1,16 @@ +require recipes-external/binutils/binutils-external.inc +inherit external-toolchain-cross-canadian + +PN .= "-${TRANSLATED_TARGET_ARCH}" + +FILES_${PN} = "\ + ${@' '.join('${bindir}/${EXTERNAL_TARGET_SYS}-' + i for i in '${binutils_binaries}'.split())} \ + ${@' '.join('${exec_prefix}/${EXTERNAL_TARGET_SYS}/bin/' + i for i in '${binutils_binaries}'.split())} \ + ${exec_prefix}/lib/ldscripts \ +" + +do_install_append () { + if [ ! -e ${D}${bindir}/${EXTERNAL_TARGET_SYS}-ld.bfd ]; then + ln -s ${EXTERNAL_TARGET_SYS}-ld ${D}${bindir}/${EXTERNAL_TARGET_SYS}-ld.bfd + fi +} diff --git a/meta-openeuler/recipes-external/binutils/binutils-external-cross.bb b/meta-openeuler/recipes-external/binutils/binutils-external-cross.bb new file mode 100644 index 0000000000000000000000000000000000000000..4fe873d77648ac339392aabcb0bb329b147642e0 --- /dev/null +++ b/meta-openeuler/recipes-external/binutils/binutils-external-cross.bb @@ -0,0 +1,13 @@ +require recipes-external/binutils/binutils-external.inc +inherit external-toolchain-cross + +PN .= "-${TARGET_ARCH}" +PROVIDES += "virtual/${TARGET_PREFIX}binutils" + +EXTERNAL_CROSS_BINARIES = "${binutils_binaries}" + +do_install_append () { + if [ ! -e ${D}${bindir}/${TARGET_PREFIX}ld.bfd ]; then + ln -s ${TARGET_PREFIX}ld ${D}${bindir}/${TARGET_PREFIX}ld.bfd + fi +} diff --git a/meta-openeuler/recipes-external/binutils/binutils-external.inc b/meta-openeuler/recipes-external/binutils/binutils-external.inc new file mode 100644 index 0000000000000000000000000000000000000000..b802015b73f92a5e689ca40b1d0554ed7703c941 --- /dev/null +++ b/meta-openeuler/recipes-external/binutils/binutils-external.inc @@ -0,0 +1,10 @@ +SUMMARY = "GNU binary utilities" +HOMEPAGE = "http://www.gnu.org/software/binutils/" +BUGTRACKER = "http://sourceware.org/bugzilla/" +SECTION = "devel" +PV := "${@external_run(d, 'ld', '-v').splitlines()[0].split()[-1].rstrip()}" +LICENSE = "${@'GPLv3' if '${PV}'.split('.') > '2.17.50.0.12'.split('.') else 'GPLv2'}" + +binutils_binaries = "ar as ld ld.bfd ld.gold nm objcopy objdump ranlib strip \ + addr2line c++filt elfedit gprof readelf size \ + strings" diff --git a/meta-openeuler/recipes-external/gcc/gcc-external-cross-canadian.bb b/meta-openeuler/recipes-external/gcc/gcc-external-cross-canadian.bb new file mode 100644 index 0000000000000000000000000000000000000000..0f91aa1aa496d16ca108ebdacf46e410b5a6d969 --- /dev/null +++ b/meta-openeuler/recipes-external/gcc/gcc-external-cross-canadian.bb @@ -0,0 +1,29 @@ +require recipes-external/gcc/gcc-external.inc +inherit external-toolchain-cross-canadian + +PN .= "-${TRANSLATED_TARGET_ARCH}" + +BINV = "${GCC_VERSION}" + +RDEPENDS_${PN} = "binutils-external-cross-canadian-${TRANSLATED_TARGET_ARCH}" +FILES_${PN} = "\ + ${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${BINV} \ + ${libexecdir}/gcc/${EXTERNAL_TARGET_SYS}/${BINV} \ + ${libdir}/libcc1* \ + /lib64/libcc1* \ + ${@' '.join('${base_bindir}/${EXTERNAL_TARGET_SYS}-' + i for i in '${gcc_binaries}'.split())} \ +" + +# no debug package +FILES_${PN}-dbg = "" +# no need do autolibname(handle the dependency of .so libs) +# auto_libname in debian.bbclass will call ${TARGET_PREFIX}objdump to get shlibs2 related info +# for gcc-external-cross-canadian, can't find ${TARGET_PREFIX}objdump +AUTO_LIBNAME_PKGS = "" + +external_libroot = "${@os.path.realpath('${EXTERNAL_TOOLCHAIN_LIBROOT}').replace(os.path.realpath('${EXTERNAL_TOOLCHAIN}') + '/', '/')}" +FILES_MIRRORS =. "${libdir}/gcc/${EXTERNAL_TARGET_SYS}/${BINV}/|${external_libroot}/\n" + +INSANE_SKIP_${PN} += "dev-so staticdev" +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_SYSROOT_STRIP = "1" diff --git a/meta-openeuler/recipes-external/gcc/gcc-external-cross.bb b/meta-openeuler/recipes-external/gcc/gcc-external-cross.bb new file mode 100644 index 0000000000000000000000000000000000000000..db55a496cb7f58546d4d1367a13d8174bc8e9614 --- /dev/null +++ b/meta-openeuler/recipes-external/gcc/gcc-external-cross.bb @@ -0,0 +1,12 @@ +require recipes-external/gcc/gcc-external.inc +inherit external-toolchain-cross + +PN .= "-${TARGET_ARCH}" +DEPENDS += "virtual/${TARGET_PREFIX}binutils" +PROVIDES += "\ + virtual/${TARGET_PREFIX}gcc-intermediate \ + virtual/${TARGET_PREFIX}gcc \ + virtual/${TARGET_PREFIX}g++ \ +" + +EXTERNAL_CROSS_BINARIES = "${gcc_binaries}" diff --git a/meta-openeuler/recipes-external/gcc/gcc-external.inc b/meta-openeuler/recipes-external/gcc/gcc-external.inc new file mode 100644 index 0000000000000000000000000000000000000000..f88582d93c5ecc821d9c6297e005678214dc0845 --- /dev/null +++ b/meta-openeuler/recipes-external/gcc/gcc-external.inc @@ -0,0 +1,7 @@ +SUMMARY = "The GNU Compiler Collection" +HOMEPAGE = "http://www.gnu.org/software/gcc/" +SECTION = "devel" +PV = "${GCC_VERSION}" + +gcc_binaries = "gcc gcc-${@'${PV}'.replace('${EXTERNAL_PV_SUFFIX}', '')} \ + gcc-ar gcc-nm gcc-ranlib cc gcov gcov-tool c++ g++ cpp gfortran" diff --git a/meta-openeuler/recipes-external/gcc/gcc-runtime-external.bb b/meta-openeuler/recipes-external/gcc/gcc-runtime-external.bb new file mode 100644 index 0000000000000000000000000000000000000000..d4e0b96be9d7b70314812d189e3c5e79f627cd1b --- /dev/null +++ b/meta-openeuler/recipes-external/gcc/gcc-runtime-external.bb @@ -0,0 +1,103 @@ +PV = "${GCC_VERSION}" +BINV = "${GCC_VERSION}" + +require recipes-devtools/gcc/gcc-runtime.inc +inherit external-toolchain + +# GCC >4.2 is GPLv3 +DEPENDS = "libgcc" +EXTRA_OECONF = "" +COMPILERDEP = "" + +python () { + lic_deps = d.getVarFlag('do_populate_lic', 'depends', False) + d.setVarFlag('do_populate_lic', 'depends', lic_deps.replace('gcc-source-${PV}:do_unpack', '')) + cfg_deps = d.getVarFlag('do_configure', 'depends', False) + d.setVarFlag('do_configure', 'depends', cfg_deps.replace('gcc-source-${PV}:do_preconfigure', '')) +} + +target_libdir = "${libdir}" +external_libroot = "${@os.path.realpath('${EXTERNAL_TOOLCHAIN_LIBROOT}').replace(os.path.realpath('${EXTERNAL_TOOLCHAIN}') + '/', '/')}" +FILES_MIRRORS =. "\ + ${libdir}/gcc/${TARGET_SYS}/${BINV}/|${external_libroot}/\n \ + ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/|/lib/gcc/${EXTERNAL_TARGET_SYS}/${BINV}/include/ \n \ + ${libdir}/gcc/${TARGET_SYS}/|${libdir}/gcc/${EXTERNAL_TARGET_SYS}/\n \ + ${@'${includedir}/c\+\+/${GCC_VERSION}/${TARGET_SYS}/|${includedir}/c++/${GCC_VERSION}/${EXTERNAL_TARGET_SYS}${EXTERNAL_HEADERS_MULTILIB_SUFFIX}/\n' if d.getVar('EXTERNAL_HEADERS_MULTILIB_SUFFIX') != 'UNKNOWN' else ''} \ + ${includedir}/c\+\+/${GCC_VERSION}/${TARGET_SYS}/|${includedir}/c++/${GCC_VERSION}/${EXTERNAL_TARGET_SYS}/\n \ +" + +# The do_install_append in gcc-runtime.inc doesn't do well if the links +# already exist, as it causes a recursion that breaks traversal. +python () { + adjusted = d.getVar('do_install_appended').replace('ln -s', 'link_if_no_dest') + adjusted = adjusted.replace('mkdir', 'mkdir_if_no_dest') + d.setVar('do_install_appended', adjusted) +} + +# Because the replace function is called in above anonymous function, +# resulting in that the checksum of do_install_appended will change with the change +# of the build directory and cannot be ignored through do_install_appended[vardepsexclude] += "D" +# Ignore how do_install_appended is computed as a workaround +do_install[vardepsexclude] += "do_install_appended" + +link_if_no_dest () { + if ! [ -e "$2" ] && ! [ -L "$2" ]; then + ln -s "$1" "$2" + fi +} + +mkdir_if_no_dest () { + if ! [ -e "$1" ] && ! [ -L "$1" ]; then + mkdir "$1" + fi +} + +do_install_extra () { + if [ "${TARGET_SYS}" != "${EXTERNAL_TARGET_SYS}" ] && [ -z "${MLPREFIX}" ]; then + if [ -e "${D}${includedir}/c++/${GCC_VERSION}/${EXTERNAL_TARGET_SYS}" ]; then + if ! [ -e "${D}${includedir}/c++/${GCC_VERSION}/${TARGET_SYS}" ]; then + ln -s ${EXTERNAL_TARGET_SYS} ${D}${includedir}/c++/${GCC_VERSION}/${TARGET_SYS} + fi + fi + fi + + # Clear out the unused c++ header multilibs + multilib="${EXTERNAL_HEADERS_MULTILIB_SUFFIX}" + if [ "$multilib" != "UNKNOWN" ]; then + for path in ${D}${includedir}/c++/${GCC_VERSION}/${TARGET_SYS}/*; do + case ${path##*/} in + ${multilib#/}) + mv -v "$path/"* "${D}${includedir}/c++/${GCC_VERSION}/${TARGET_SYS}/" + ;; + esac + rm -rfv "$path" + done + fi +} + +FILES_${PN}-dbg += "${datadir}/gdb/python/libstdcxx" +FILES_libstdc++-dev = "\ + ${includedir}/c++ \ + ${libdir}/libstdc++.so \ + ${libdir}/libstdc++.la \ + ${libdir}/libsupc++.la \ +" +FILES_libgomp-dev += "\ + ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \ +" +BBCLASSEXTEND = "" + +# gcc-runtime needs libc, but glibc's utilities need libssp in some cases, so +# short-circuit the interdependency here by manually specifying it rather than +# depending on the libc packagedata. +libc_rdep = "${@'${PREFERRED_PROVIDER_virtual/libc}' if '${PREFERRED_PROVIDER_virtual/libc}' else '${TCLIBC}'}" +RDEPENDS_libgomp += "${libc_rdep}" +RDEPENDS_libssp += "${libc_rdep}" +RDEPENDS_libstdc++ += "${libc_rdep}" +RDEPENDS_libatomic += "${libc_rdep}" +RDEPENDS_libquadmath += "${libc_rdep}" +RDEPENDS_libmpx += "${libc_rdep}" + +do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata" +do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata" +do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata" diff --git a/meta-openeuler/recipes-external/gcc/libgcc-external.bb b/meta-openeuler/recipes-external/gcc/libgcc-external.bb new file mode 100644 index 0000000000000000000000000000000000000000..05efd59a012fd74bb9559d8b5643870f7687ad8c --- /dev/null +++ b/meta-openeuler/recipes-external/gcc/libgcc-external.bb @@ -0,0 +1,91 @@ +SUMMARY = "The GNU Compiler Collection - libgcc" +HOMEPAGE = "http://www.gnu.org/software/gcc/" +SECTION = "devel" +DEPENDS += "virtual/${TARGET_PREFIX}binutils" +PROVIDES += "libgcc-initial" +PV = "${GCC_VERSION}" + +inherit external-toolchain + +LICENSE = "GPL-3.0-with-GCC-exception" + +# libgcc needs libc, but glibc's utilities need libgcc, so short-circuit the +# interdependency here by manually specifying it rather than depending on the +# libc packagedata. +RDEPENDS_${PN} += "${@'${PREFERRED_PROVIDER_virtual/libc}' if '${PREFERRED_PROVIDER_virtual/libc}' else '${TCLIBC}'}" +INSANE_SKIP_${PN} += "build-deps file-rdeps" + +# The dynamically loadable files belong to libgcc, since we really don't need the static files +# on the target, moreover linker won't be able to find them there (see original libgcc.bb recipe). +BINV = "${GCC_VERSION}" +FILES_${PN} = "${base_libdir}/libgcc_s.so.*" + +# TODO: these crt*.o and libgcc* no need for target, and sdk will contains these files not through package-libgcc. +# So i think libgcc packages could not contain these files. Just remove its. + +# BUGFIX: +# if gives ${EXTERNAL_TOOLCHAIN_SYSROOT}, ${LIBROOT_RELATIVE} will be a path with ../../ prefix. +# these files will not be install in ${D}, but in ${D}/../../. Which not be include in packages. +# ${EXTERNAL_TOOLCHAIN}/gcc/${TARGET_PREFIX}/{BINV}/plugin contains some .so files for arch host, which +# makes a error when do_packages. so we just need crt*.o and libgcc* files. +LIBROOT_RELATIVE_RESOLVED = "${@os.path.relpath(os.path.realpath('${EXTERNAL_TOOLCHAIN_LIBROOT}'), os.path.realpath('${EXTERNAL_TOOLCHAIN}'))}" +LIBROOT_RELATIVE = "${@os.path.relpath('${EXTERNAL_TOOLCHAIN_LIBROOT}', '${EXTERNAL_TOOLCHAIN}')}" +FILES_${PN}-dev = "${base_libdir}/libgcc_s.so \ + /${LIBROOT_RELATIVE_RESOLVED}/crt*.o \ + /${LIBROOT_RELATIVE_RESOLVED}/libgcc* \ + /${LIBROOT_RELATIVE}/crt*.o \ + /${LIBROOT_RELATIVE}/libgcc* \ +" +INSANE_SKIP_${PN}-dev += "staticdev" +FILES_${PN}-dbg += "${base_libdir}/.debug/libgcc_s.so.*.debug" + +# Follow any symlinks in the libroot (multilib build) to the main +# libroot and include any symlinks there that link to our libroot. +python add_ml_symlink () { + pass +} +python add_ml_symlink_tcmode-external () { + import pathlib + + def get_links(p): + return (c for c in p.iterdir() if c.is_symlink()) + + if not d.getVar('EXTERNAL_TOOLCHAIN'): + return + + libroot = d.getVar('EXTERNAL_TOOLCHAIN_LIBROOT') + if libroot != 'UNKNOWN': + sysroot = pathlib.Path(d.getVar('EXTERNAL_TOOLCHAIN_SYSROOT')).resolve() + libroot = pathlib.Path(libroot) + for child in get_links(libroot): + link_dest = child.resolve(strict=True) + for other_child in get_links(link_dest): + if other_child.resolve() == libroot.resolve(): + other = other_child.parent.resolve() / other_child.name + relpath = other.relative_to(sysroot) + d.appendVar('SYSROOT_DIRS', ' /' + str(relpath.parent)) + d.appendVar('FILES_${PN}-dev', ' /' + str(relpath)) +} +add_ml_symlink[eventmask] = "bb.event.RecipePreFinalise" +addhandler add_ml_symlink + +do_install_extra () { + if [ -e "${D}${libdir}/${EXTERNAL_TARGET_SYS}" ] && [ -z "${MLPREFIX}" ]; then + if ! [ -e "${D}${libdir}/${TARGET_SYS}" ]; then + ln -s "${EXTERNAL_TARGET_SYS}" "${D}${libdir}/${TARGET_SYS}" + fi + fi + + # This belongs in gcc-runtime + rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include +} + +do_package[prefuncs] += "add_sys_symlink" + +python add_sys_symlink () { + import pathlib + target_sys = pathlib.Path(d.expand('${D}${libdir}/${TARGET_SYS}')) + if target_sys.exists(): + pn = d.getVar('PN') + d.appendVar('FILES_%s-dev' % pn, ' ${libdir}/${TARGET_SYS}') +} diff --git a/meta-openeuler/recipes-external/gcc/libgfortran-external.bb b/meta-openeuler/recipes-external/gcc/libgfortran-external.bb new file mode 100644 index 0000000000000000000000000000000000000000..c125b9857579464fdc8acf3d2bdd8b865261b9b3 --- /dev/null +++ b/meta-openeuler/recipes-external/gcc/libgfortran-external.bb @@ -0,0 +1,26 @@ +SUMMARY = "The GNU Compiler Collection - libgfortran" +HOMEPAGE = "http://www.gnu.org/software/gcc/" +SECTION = "devel" +DEPENDS += "virtual/${TARGET_PREFIX}binutils" +PROVIDES += "libgfortran" +PV = "${GCC_VERSION}" + +inherit external-toolchain + +LICENSE = "GPL-3.0-with-GCC-exception" + +BINV = "${GCC_VERSION}" +LIBROOT_RELATIVE = "${@os.path.relpath('${EXTERNAL_TOOLCHAIN_LIBROOT}', '${EXTERNAL_TOOLCHAIN}')}" + +FILES_${PN} = "${base_libdir}/libgfortran.so.*" +FILES_${PN}-dev = "\ + ${base_libdir}/libgfortran*.so \ + ${base_libdir}/libgfortran.spec \ + ${base_libdir}/libgfortran.la \ + ${LIBROOT_RELATIVE}/libgfortranbegin.* \ + ${LIBROOT_RELATIVE}/libcaf_single* \ + ${LIBROOT_RELATIVE}/finclude/ \ + ${LIBROOT_RELATIVE}/include/ \ +" +INSANE_SKIP_${PN}-dev += "staticdev" +FILES_${PN}-staticdev = "${libdir}/libgfortran.a" diff --git a/meta-openeuler/recipes-external/glibc/glibc-external-version.inc b/meta-openeuler/recipes-external/glibc/glibc-external-version.inc new file mode 100644 index 0000000000000000000000000000000000000000..b31d4cdd9767f8ba8e6f73ca6bf89c882948995a --- /dev/null +++ b/meta-openeuler/recipes-external/glibc/glibc-external-version.inc @@ -0,0 +1,16 @@ +def get_external_libc_version(d): + if (d.getVar('TCMODE', True).startswith('external') and + d.getVar('EXTERNAL_TOOLCHAIN', True)): + cc = os.path.join(d.getVar('EXTERNAL_TOOLCHAIN_SYSROOT', True), "usr/bin/ldd --version") + # ldd is a script, ldd --version will output "ldd (xxx yyy) zzz", zzz is version + # for aws use ')'as delimiter, use '{$1=$1;print}' to strip space, then get zzz + cmd = "%s | head -n1 | awk -F\) '{print $2}' | awk '{$1=$1;print}' " % cc + import subprocess + p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) + stdout, stderr = p.communicate() + version = str(stdout, 'utf-8').strip() + return version + + return 'UNKNOWN' + +PV_tcmode-external := "${@get_external_libc_version(d)}" diff --git a/meta-openeuler/recipes-external/glibc/glibc-external.bb b/meta-openeuler/recipes-external/glibc/glibc-external.bb new file mode 100644 index 0000000000000000000000000000000000000000..df7c49ca7dcc9ff33d4b4d5f10da5154a7159c19 --- /dev/null +++ b/meta-openeuler/recipes-external/glibc/glibc-external.bb @@ -0,0 +1,264 @@ +SRC_URI = "\ + file://SUPPORTED \ + file://makedbs.sh \ + file://nscd.init;subdir=${REL_S}/nscd \ + file://nscd.conf;subdir=${REL_S}/nscd \ + file://nscd.service;subdir=${REL_S}/nscd \ +" +# For makedbs.sh +FILESPATH .= ":${COREBASE}/meta/recipes-core/glibc/glibc" +REL_S = "${@os.path.relpath('${S}', '${WORKDIR}')}" + +require recipes-core/glibc/glibc-common.inc +inherit external-toolchain +require recipes-external/glibc/glibc-external-version.inc + +DEPENDS = "virtual/${TARGET_PREFIX}binutils" +PROVIDES += "glibc \ + virtual/libc \ + virtual/libintl \ + virtual/libiconv \ + linux-libc-headers \ + linux-libc-headers-dev" + +def get_external_libc_license(d): + if (d.getVar('TCMODE', True).startswith('external') and + d.getVar('EXTERNAL_TOOLCHAIN', True)): + errnosearch = os.path.join(d.getVar('includedir', True), 'errno.h') + found = oe.external.find_sysroot_files([errnosearch], d) + if found: + errno_paths = found[0] + if errno_paths: + with open(errno_paths[0], 'rU') as f: + text = f.read() + + lictext = """ The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version.""" + if lictext in text: + return 'LGPL-2.1+' + + return 'UNKNOWN' + +LICENSE_tcmode-external := "${@get_external_libc_license(d)}" + +require recipes-external/glibc/glibc-sysroot-setup.inc +require recipes-external/glibc/glibc-package-adjusted.inc + +FILES_MIRRORS .= "\ + ${base_sbindir}/|/usr/bin/ \n\ + ${base_sbindir}/|/usr/${baselib}/bin/ \n\ + ${sbindir}/|/usr/bin/ \n\ + ${sbindir}/|/usr/${baselib}/bin/ \n\ +" + +python do_install () { + bb.build.exec_func('external_toolchain_do_install', d) + bb.build.exec_func('glibc_external_do_install_extra', d) + if not bb.utils.contains('EXTERNAL_TOOLCHAIN_FEATURES', 'locale-utf8-is-default', True, False, d): + bb.build.exec_func('adjust_locale_names', d) + # sentinel +} + +python adjust_locale_names () { + """Align locale charset names with glibc-locale expectations.""" + # Read in supported locales and associated encodings + supported = {} + with open(oe.path.join(d.getVar('WORKDIR', True), "SUPPORTED")) as f: + for line in f.readlines(): + try: + locale, charset = line.rstrip().split() + except ValueError: + continue + supported[locale] = charset + + # GLIBC_GENERATE_LOCALES var specifies which locales to be generated. empty or "all" means all locales + to_generate = d.getVar('GLIBC_GENERATE_LOCALES', True) + if not to_generate or to_generate == 'all': + to_generate = supported.keys() + else: + to_generate = to_generate.split() + for locale in to_generate: + if locale not in supported: + if '.' in locale: + charset = locale.split('.')[1] + else: + charset = 'UTF-8' + bb.warn("Unsupported locale '%s', assuming encoding '%s'" % (locale, charset)) + supported[locale] = charset + + localedir = oe.path.join(d.getVar('D', True), d.getVar('localedir', True)) + for locale in to_generate: + if '.' not in locale: + continue + + locale, charset = locale.split('.', 1) + if '-' not in charset: + continue + + oe_name = locale + '.' + charset.lower() + existing_name = locale + '.' + charset.lower().replace('-', '') + this_localedir = oe.path.join(localedir, existing_name) + if os.path.exists(this_localedir): + bb.debug(1, '%s -> %s' % (this_localedir, oe.path.join(localedir, oe_name))) + os.rename(this_localedir, oe.path.join(localedir, oe_name)) +} + +glibc_external_do_install_extra () { + mkdir -p ${D}${sysconfdir} + touch ${D}${sysconfdir}/ld.so.conf + + if [ ! -e ${D}${libdir}/libc.so ]; then + bbfatal "Unable to locate installed libc.so file (${libdir}/libc.so)." \ + "This may mean that your external toolchain uses a different" \ + "multi-lib setup than your machine configuration" + fi + if [ "${GLIBC_INTERNAL_USE_BINARY_LOCALE}" != "precompiled" ]; then + rm -rf ${D}${localedir} + fi + + # Work around localedef failures for non-precompiled + for locale in bo_CN bo_IN; do + if [ -e "${D}${datadir}/i18n/locales/$locale" ]; then + sed -i -e '/^name_fmt\s/s/""/"???"/' "${D}${datadir}/i18n/locales/$locale" + if grep -q '^name_fmt.*""' "${D}${datadir}/i18n/locales/$locale"; then + bbfatal "sed did not fix $locale" + fi + fi + done + + # Avoid bash dependency + if [ -e "${D}${bindir}/ldd" ]; then + sed -e '1s#bash#sh#; s#$"#"#g' -i "${D}${bindir}/ldd" + fi + if [ -e "${D}${bindir}/tzselect" ]; then + sed -e '1s#bash#sh#' -i "${D}${bindir}/tzselect" + fi +} + +bberror_task-install () { + # Silence any errors from oe_multilib_header, as we don't care about + # missing multilib headers, as the oe-core glibc version isn't necessarily + # the same as our own. + : +} + +EXTERNAL_EXTRA_FILES += "\ + ${bindir}/mtrace ${bindir}/xtrace ${bindir}/sotruss \ + ${datadir}/i18n \ + ${libdir}/gconv \ + ${@'${localedir}' if d.getVar('GLIBC_INTERNAL_USE_BINARY_LOCALE', True) == 'precompiled' else ''} \ +" + +# These files are picked up out of the sysroot by glibc-locale, so we don't +# need to keep them around ourselves. +do_install_locale_append() { + rm -rf ${D}${localedir} +} + +python () { + # Undo the do_install_append which joined shell to python + install = d.getVar('do_install', False) + python, shell = install.split('# sentinel', 1) + d.setVar('do_install_glibc', shell) + d.setVarFlag('do_install_glibc', 'func', '1') + new_install = python + '\n bb.build.exec_func("do_install_glibc", d)\n' + d.setVar('do_install', new_install.replace('\t', ' ')) + + # Ensure that we pick up just libm, not all libs that start with m + baselibs = d.getVar('libc_baselibs', False) + baselibs = baselibs.replace('${base_libdir}/libm*.so.*', '${base_libdir}/libm.so.* ${base_libdir}/libmvec.so.*') + baselibs = baselibs.replace('${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so', '') + d.setVar('libc_baselibs', baselibs) +} + +# Default pattern is too greedy +FILES_${PN}-utils = "\ + ${bindir}/gencat \ + ${bindir}/getconf \ + ${bindir}/getent \ + ${bindir}/iconv \ + ${sbindir}/iconvconfig \ + ${bindir}/lddlibc4 \ + ${bindir}/locale \ + ${bindir}/makedb \ + ${bindir}/pcprofiledump \ + ${bindir}/pldd \ + ${bindir}/sprof \ +" +FILES_${PN}-doc += "${infodir}/libc.info*" + +# Extract for use by do_install_locale +FILES_${PN} += "\ + ${bindir}/localedef \ + ${libdir}/gconv \ + ${libdir}/locale \ + ${datadir}/locale \ + ${datadir}/i18n \ +" + +#For riscv64 +FILES_${PN} += "\ + ${libdir}/lp64d \ + ${base_libdir}/lp64d \ +" + + +FILES_${PN}-dev_remove := "${datadir}/aclocal" + +# use base_libdir to replace /lib +FILES_${PN}-dev_remove = "${base_libdir}/*.o" +FILES_${PN}-dev += "${libdir}/*crt*.o" +# currently no dbg fils for glibc-external +FILES_${PN}-dbg = "" +# no strip .o files used for startup, as user space app may need symbol information +# here INHIBIT_PACKAGE_STRIP is no need to set to 1, +# because poky package.bbclass will not strip the file with no executable permission except .so or .node + +linux_include_subdirs = "asm asm-generic bits drm linux mtd rdma sound sys video" +FILES_${PN}-dev += "${@' '.join('${includedir}/%s' % d for d in '${linux_include_subdirs}'.split())}" + +# Already multilib headers for oe sdks +libc_baselibs_dev += "\ + ${includedir}/fpu_control-*.h \ + ${includedir}/ieee754-*.h \ +" +libc_baselibs_dev += "${@' '.join('${libdir}/' + os.path.basename(l.replace('${SOLIBS}', '${SOLIBSDEV}')) for l in '${libc_baselibs}'.replace('${base_libdir}/ld*${SOLIBS}', '').split() if l.endswith('${SOLIBS}'))}" +FILES_${PN}-staticdev = "\ + ${@'${libc_baselibs_dev}'.replace('${SOLIBSDEV}', '.a')} \ + ${libdir}/libg.a \ + ${libdir}/libieee.a \ + ${libdir}/libmcheck.a \ +" + +FILES_${PN}-dev += "\ + ${libc_baselibs_dev} \ + ${libdir}/libcidn${SOLIBSDEV} \ + ${libdir}/libthread_db${SOLIBSDEV} \ + ${libdir}/libpthread${SOLIBSDEV} \ +" +libc_headers_file = "${@bb.utils.which('${FILESPATH}', 'libc.headers')}" +FILES_${PN}-dev += "\ + ${@' '.join('${includedir}/' + f.rstrip() for f in oe.utils.read_file('${libc_headers_file}').splitlines())} \ + ${includedir}/fpu_control.h \ + ${includedir}/stdc-predef.h \ + ${includedir}/uchar.h \ +" +FILES_${PN}-dev[file-checksums] += "${libc_headers_file}:True" + +# glibc's utils need libgcc +do_package[depends] += "${MLPREFIX}libgcc:do_packagedata" +do_package_write_ipk[depends] += "${MLPREFIX}libgcc:do_packagedata" +do_package_write_deb[depends] += "${MLPREFIX}libgcc:do_packagedata" +do_package_write_rpm[depends] += "${MLPREFIX}libgcc:do_packagedata" + +# glibc may need libssp for -fstack-protector builds +do_packagedata[depends] += "gcc-runtime:do_packagedata" + +# We don't need linux-libc-headers +LINUX_LIBC_RDEP_REMOVE ?= "linux-libc-headers-dev" +RDEPENDS_${PN}-dev_remove = "${LINUX_LIBC_RDEP_REMOVE}" + +FILES_${PN}-dev_remove = "${base_libdir}/*_nonshared.a ${libdir}/*_nonshared.a" +FILES_${PN}-dev += "${libdir}/libc_nonshared.a ${libdir}/libpthread_nonshared.a ${libdir}/libmvec_nonshared.a" diff --git a/meta-openeuler/recipes-external/glibc/glibc-external/SUPPORTED b/meta-openeuler/recipes-external/glibc/glibc-external/SUPPORTED new file mode 100644 index 0000000000000000000000000000000000000000..ba517a0c96d2cde61c53dc8364e1058aed023ccb --- /dev/null +++ b/meta-openeuler/recipes-external/glibc/glibc-external/SUPPORTED @@ -0,0 +1,487 @@ +aa_DJ.UTF-8 UTF-8 +aa_DJ ISO-8859-1 +aa_ER UTF-8 +aa_ER@saaho UTF-8 +aa_ET UTF-8 +af_ZA.UTF-8 UTF-8 +af_ZA ISO-8859-1 +agr_PE UTF-8 +ak_GH UTF-8 +am_ET UTF-8 +an_ES.UTF-8 UTF-8 +an_ES ISO-8859-15 +anp_IN UTF-8 +ar_AE.UTF-8 UTF-8 +ar_AE ISO-8859-6 +ar_BH.UTF-8 UTF-8 +ar_BH ISO-8859-6 +ar_DZ.UTF-8 UTF-8 +ar_DZ ISO-8859-6 +ar_EG.UTF-8 UTF-8 +ar_EG ISO-8859-6 +ar_IN UTF-8 +ar_IQ.UTF-8 UTF-8 +ar_IQ ISO-8859-6 +ar_JO.UTF-8 UTF-8 +ar_JO ISO-8859-6 +ar_KW.UTF-8 UTF-8 +ar_KW ISO-8859-6 +ar_LB.UTF-8 UTF-8 +ar_LB ISO-8859-6 +ar_LY.UTF-8 UTF-8 +ar_LY ISO-8859-6 +ar_MA.UTF-8 UTF-8 +ar_MA ISO-8859-6 +ar_OM.UTF-8 UTF-8 +ar_OM ISO-8859-6 +ar_QA.UTF-8 UTF-8 +ar_QA ISO-8859-6 +ar_SA.UTF-8 UTF-8 +ar_SA ISO-8859-6 +ar_SD.UTF-8 UTF-8 +ar_SD ISO-8859-6 +ar_SS UTF-8 +ar_SY.UTF-8 UTF-8 +ar_SY ISO-8859-6 +ar_TN.UTF-8 UTF-8 +ar_TN ISO-8859-6 +ar_YE.UTF-8 UTF-8 +ar_YE ISO-8859-6 +ayc_PE UTF-8 +az_AZ UTF-8 +az_IR UTF-8 +as_IN UTF-8 +ast_ES.UTF-8 UTF-8 +ast_ES ISO-8859-15 +be_BY.UTF-8 UTF-8 +be_BY CP1251 +be_BY@latin UTF-8 +bem_ZM UTF-8 +ber_DZ UTF-8 +ber_MA UTF-8 +bg_BG.UTF-8 UTF-8 +bg_BG CP1251 +bhb_IN.UTF-8 UTF-8 +bho_IN UTF-8 +bho_NP UTF-8 +bi_VU UTF-8 +bn_BD UTF-8 +bn_IN UTF-8 +bo_CN UTF-8 +bo_IN UTF-8 +br_FR.UTF-8 UTF-8 +br_FR ISO-8859-1 +br_FR@euro ISO-8859-15 +brx_IN UTF-8 +bs_BA.UTF-8 UTF-8 +bs_BA ISO-8859-2 +byn_ER UTF-8 +ca_AD.UTF-8 UTF-8 +ca_AD ISO-8859-15 +ca_ES.UTF-8 UTF-8 +ca_ES ISO-8859-1 +ca_ES@euro ISO-8859-15 +ca_ES@valencia UTF-8 +ca_FR.UTF-8 UTF-8 +ca_FR ISO-8859-15 +ca_IT.UTF-8 UTF-8 +ca_IT ISO-8859-15 +ce_RU UTF-8 +chr_US UTF-8 +cmn_TW UTF-8 +crh_UA UTF-8 +cs_CZ.UTF-8 UTF-8 +cs_CZ ISO-8859-2 +csb_PL UTF-8 +cv_RU UTF-8 +cy_GB.UTF-8 UTF-8 +cy_GB ISO-8859-14 +da_DK.UTF-8 UTF-8 +da_DK ISO-8859-1 +de_AT.UTF-8 UTF-8 +de_AT ISO-8859-1 +de_AT@euro ISO-8859-15 +de_BE.UTF-8 UTF-8 +de_BE ISO-8859-1 +de_BE@euro ISO-8859-15 +de_CH.UTF-8 UTF-8 +de_CH ISO-8859-1 +de_DE.UTF-8 UTF-8 +de_DE ISO-8859-1 +de_DE@euro ISO-8859-15 +de_IT.UTF-8 UTF-8 +de_IT ISO-8859-1 +de_LI.UTF-8 UTF-8 +de_LU.UTF-8 UTF-8 +de_LU ISO-8859-1 +de_LU@euro ISO-8859-15 +doi_IN UTF-8 +dsb_DE UTF-8 +dv_MV UTF-8 +dz_BT UTF-8 +el_GR.UTF-8 UTF-8 +el_GR ISO-8859-7 +el_GR@euro ISO-8859-7 +el_CY.UTF-8 UTF-8 +el_CY ISO-8859-7 +en_AG UTF-8 +en_AU.UTF-8 UTF-8 +en_AU ISO-8859-1 +en_BW.UTF-8 UTF-8 +en_BW ISO-8859-1 +en_CA.UTF-8 UTF-8 +en_CA ISO-8859-1 +en_DK.UTF-8 UTF-8 +en_DK ISO-8859-1 +en_GB.UTF-8 UTF-8 +en_GB ISO-8859-1 +en_HK.UTF-8 UTF-8 +en_HK ISO-8859-1 +en_IE.UTF-8 UTF-8 +en_IE ISO-8859-1 +en_IE@euro ISO-8859-15 +en_IL UTF-8 +en_IN UTF-8 +en_NG UTF-8 +en_NZ.UTF-8 UTF-8 +en_NZ ISO-8859-1 +en_PH.UTF-8 UTF-8 +en_PH ISO-8859-1 +en_SC.UTF-8 UTF-8 +en_SG.UTF-8 UTF-8 +en_SG ISO-8859-1 +en_US.UTF-8 UTF-8 +en_US ISO-8859-1 +en_ZA.UTF-8 UTF-8 +en_ZA ISO-8859-1 +en_ZM UTF-8 +en_ZW.UTF-8 UTF-8 +en_ZW ISO-8859-1 +eo UTF-8 +es_AR.UTF-8 UTF-8 +es_AR ISO-8859-1 +es_BO.UTF-8 UTF-8 +es_BO ISO-8859-1 +es_CL.UTF-8 UTF-8 +es_CL ISO-8859-1 +es_CO.UTF-8 UTF-8 +es_CO ISO-8859-1 +es_CR.UTF-8 UTF-8 +es_CR ISO-8859-1 +es_CU UTF-8 +es_DO.UTF-8 UTF-8 +es_DO ISO-8859-1 +es_EC.UTF-8 UTF-8 +es_EC ISO-8859-1 +es_ES.UTF-8 UTF-8 +es_ES ISO-8859-1 +es_ES@euro ISO-8859-15 +es_GT.UTF-8 UTF-8 +es_GT ISO-8859-1 +es_HN.UTF-8 UTF-8 +es_HN ISO-8859-1 +es_MX.UTF-8 UTF-8 +es_MX ISO-8859-1 +es_NI.UTF-8 UTF-8 +es_NI ISO-8859-1 +es_PA.UTF-8 UTF-8 +es_PA ISO-8859-1 +es_PE.UTF-8 UTF-8 +es_PE ISO-8859-1 +es_PR.UTF-8 UTF-8 +es_PR ISO-8859-1 +es_PY.UTF-8 UTF-8 +es_PY ISO-8859-1 +es_SV.UTF-8 UTF-8 +es_SV ISO-8859-1 +es_US.UTF-8 UTF-8 +es_US ISO-8859-1 +es_UY.UTF-8 UTF-8 +es_UY ISO-8859-1 +es_VE.UTF-8 UTF-8 +es_VE ISO-8859-1 +et_EE.UTF-8 UTF-8 +et_EE ISO-8859-1 +et_EE.ISO-8859-15 ISO-8859-15 +eu_ES.UTF-8 UTF-8 +eu_ES ISO-8859-1 +eu_ES@euro ISO-8859-15 +fa_IR UTF-8 +ff_SN UTF-8 +fi_FI.UTF-8 UTF-8 +fi_FI ISO-8859-1 +fi_FI@euro ISO-8859-15 +fil_PH UTF-8 +fo_FO.UTF-8 UTF-8 +fo_FO ISO-8859-1 +fr_BE.UTF-8 UTF-8 +fr_BE ISO-8859-1 +fr_BE@euro ISO-8859-15 +fr_CA.UTF-8 UTF-8 +fr_CA ISO-8859-1 +fr_CH.UTF-8 UTF-8 +fr_CH ISO-8859-1 +fr_FR.UTF-8 UTF-8 +fr_FR ISO-8859-1 +fr_FR@euro ISO-8859-15 +fr_LU.UTF-8 UTF-8 +fr_LU ISO-8859-1 +fr_LU@euro ISO-8859-15 +fur_IT UTF-8 +fy_NL UTF-8 +fy_DE UTF-8 +ga_IE.UTF-8 UTF-8 +ga_IE ISO-8859-1 +ga_IE@euro ISO-8859-15 +gd_GB.UTF-8 UTF-8 +gd_GB ISO-8859-15 +gez_ER UTF-8 +gez_ER@abegede UTF-8 +gez_ET UTF-8 +gez_ET@abegede UTF-8 +gl_ES.UTF-8 UTF-8 +gl_ES ISO-8859-1 +gl_ES@euro ISO-8859-15 +gu_IN UTF-8 +gv_GB.UTF-8 UTF-8 +gv_GB ISO-8859-1 +ha_NG UTF-8 +hak_TW UTF-8 +he_IL.UTF-8 UTF-8 +he_IL ISO-8859-8 +hi_IN UTF-8 +hif_FJ UTF-8 +hne_IN UTF-8 +hr_HR.UTF-8 UTF-8 +hr_HR ISO-8859-2 +hsb_DE ISO-8859-2 +hsb_DE.UTF-8 UTF-8 +ht_HT UTF-8 +hu_HU.UTF-8 UTF-8 +hu_HU ISO-8859-2 +hy_AM UTF-8 +hy_AM.ARMSCII-8 ARMSCII-8 +ia_FR UTF-8 +id_ID.UTF-8 UTF-8 +id_ID ISO-8859-1 +ig_NG UTF-8 +ik_CA UTF-8 +is_IS.UTF-8 UTF-8 +is_IS ISO-8859-1 +it_CH.UTF-8 UTF-8 +it_CH ISO-8859-1 +it_IT.UTF-8 UTF-8 +it_IT ISO-8859-1 +it_IT@euro ISO-8859-15 +iu_CA UTF-8 +ja_JP.EUC-JP EUC-JP +ja_JP.UTF-8 UTF-8 +ka_GE.UTF-8 UTF-8 +ka_GE GEORGIAN-PS +kab_DZ UTF-8 +kk_KZ.UTF-8 UTF-8 +kk_KZ PT154 +kl_GL.UTF-8 UTF-8 +kl_GL ISO-8859-1 +km_KH UTF-8 +kn_IN UTF-8 +ko_KR.EUC-KR EUC-KR +ko_KR.UTF-8 UTF-8 +kok_IN UTF-8 +ks_IN UTF-8 +ks_IN@devanagari UTF-8 +ku_TR.UTF-8 UTF-8 +ku_TR ISO-8859-9 +kw_GB.UTF-8 UTF-8 +kw_GB ISO-8859-1 +ky_KG UTF-8 +lb_LU UTF-8 +lg_UG.UTF-8 UTF-8 +lg_UG ISO-8859-10 +li_BE UTF-8 +li_NL UTF-8 +lij_IT UTF-8 +ln_CD UTF-8 +lo_LA UTF-8 +lt_LT.UTF-8 UTF-8 +lt_LT ISO-8859-13 +lv_LV.UTF-8 UTF-8 +lv_LV ISO-8859-13 +lzh_TW UTF-8 +mag_IN UTF-8 +mai_IN UTF-8 +mai_NP UTF-8 +mfe_MU UTF-8 +mg_MG.UTF-8 UTF-8 +mg_MG ISO-8859-15 +mhr_RU UTF-8 +mi_NZ.UTF-8 UTF-8 +mi_NZ ISO-8859-13 +miq_NI UTF-8 +mjw_IN UTF-8 +mk_MK.UTF-8 UTF-8 +mk_MK ISO-8859-5 +ml_IN UTF-8 +mn_MN UTF-8 +mni_IN UTF-8 +mnw_MM UTF-8 +mr_IN UTF-8 +ms_MY.UTF-8 UTF-8 +ms_MY ISO-8859-1 +mt_MT.UTF-8 UTF-8 +mt_MT ISO-8859-3 +my_MM UTF-8 +nan_TW UTF-8 +nan_TW@latin UTF-8 +nb_NO.UTF-8 UTF-8 +nb_NO ISO-8859-1 +nds_DE UTF-8 +nds_NL UTF-8 +ne_NP UTF-8 +nhn_MX UTF-8 +niu_NU UTF-8 +niu_NZ UTF-8 +nl_AW UTF-8 +nl_BE.UTF-8 UTF-8 +nl_BE ISO-8859-1 +nl_BE@euro ISO-8859-15 +nl_NL.UTF-8 UTF-8 +nl_NL ISO-8859-1 +nl_NL@euro ISO-8859-15 +nn_NO.UTF-8 UTF-8 +nn_NO ISO-8859-1 +nr_ZA UTF-8 +nso_ZA UTF-8 +oc_FR.UTF-8 UTF-8 +oc_FR ISO-8859-1 +om_ET UTF-8 +om_KE.UTF-8 UTF-8 +om_KE ISO-8859-1 +or_IN UTF-8 +os_RU UTF-8 +pa_IN UTF-8 +pa_PK UTF-8 +pap_AW UTF-8 +pap_CW UTF-8 +pl_PL.UTF-8 UTF-8 +pl_PL ISO-8859-2 +ps_AF UTF-8 +pt_BR.UTF-8 UTF-8 +pt_BR ISO-8859-1 +pt_PT.UTF-8 UTF-8 +pt_PT ISO-8859-1 +pt_PT@euro ISO-8859-15 +quz_PE UTF-8 +raj_IN UTF-8 +ro_RO.UTF-8 UTF-8 +ro_RO ISO-8859-2 +ru_RU.KOI8-R KOI8-R +ru_RU.UTF-8 UTF-8 +ru_RU ISO-8859-5 +ru_UA.UTF-8 UTF-8 +ru_UA KOI8-U +rw_RW UTF-8 +sa_IN UTF-8 +sah_RU UTF-8 +sat_IN UTF-8 +sc_IT UTF-8 +sd_IN UTF-8 +sd_IN@devanagari UTF-8 +se_NO UTF-8 +sgs_LT UTF-8 +shn_MM UTF-8 +shs_CA UTF-8 +si_LK UTF-8 +sid_ET UTF-8 +sk_SK.UTF-8 UTF-8 +sk_SK ISO-8859-2 +sl_SI.UTF-8 UTF-8 +sl_SI ISO-8859-2 +sm_WS UTF-8 +so_DJ.UTF-8 UTF-8 +so_DJ ISO-8859-1 +so_ET UTF-8 +so_KE.UTF-8 UTF-8 +so_KE ISO-8859-1 +so_SO.UTF-8 UTF-8 +so_SO ISO-8859-1 +sq_AL.UTF-8 UTF-8 +sq_AL ISO-8859-1 +sq_MK UTF-8 +sr_ME UTF-8 +sr_RS UTF-8 +sr_RS@latin UTF-8 +ss_ZA UTF-8 +st_ZA.UTF-8 UTF-8 +st_ZA ISO-8859-1 +sv_FI.UTF-8 UTF-8 +sv_FI ISO-8859-1 +sv_FI@euro ISO-8859-15 +sv_SE.UTF-8 UTF-8 +sv_SE ISO-8859-1 +sw_KE UTF-8 +sw_TZ UTF-8 +szl_PL UTF-8 +ta_IN UTF-8 +ta_LK UTF-8 +tcy_IN.UTF-8 UTF-8 +te_IN UTF-8 +tg_TJ.UTF-8 UTF-8 +tg_TJ KOI8-T +th_TH.UTF-8 UTF-8 +th_TH TIS-620 +the_NP UTF-8 +ti_ER UTF-8 +ti_ET UTF-8 +tig_ER UTF-8 +tk_TM UTF-8 +tl_PH.UTF-8 UTF-8 +tl_PH ISO-8859-1 +tn_ZA UTF-8 +to_TO UTF-8 +tpi_PG UTF-8 +tr_CY.UTF-8 UTF-8 +tr_CY ISO-8859-9 +tr_TR.UTF-8 UTF-8 +tr_TR ISO-8859-9 +ts_ZA UTF-8 +tt_RU UTF-8 +tt_RU@iqtelif UTF-8 +ug_CN UTF-8 +uk_UA.UTF-8 UTF-8 +uk_UA KOI8-U +unm_US UTF-8 +ur_IN UTF-8 +ur_PK UTF-8 +uz_UZ.UTF-8 UTF-8 +uz_UZ ISO-8859-1 +uz_UZ@cyrillic UTF-8 +ve_ZA UTF-8 +vi_VN UTF-8 +wa_BE ISO-8859-1 +wa_BE@euro ISO-8859-15 +wa_BE.UTF-8 UTF-8 +wae_CH UTF-8 +wal_ET UTF-8 +wo_SN UTF-8 +xh_ZA.UTF-8 UTF-8 +xh_ZA ISO-8859-1 +yi_US.UTF-8 UTF-8 +yi_US CP1255 +yo_NG UTF-8 +yue_HK UTF-8 +yuw_PG UTF-8 +zh_CN.GB18030 GB18030 +zh_CN.GBK GBK +zh_CN.UTF-8 UTF-8 +zh_CN GB2312 +zh_HK.UTF-8 UTF-8 +zh_HK BIG5-HKSCS +zh_SG.UTF-8 UTF-8 +zh_SG.GBK GBK +zh_SG GB2312 +zh_TW.EUC-TW EUC-TW +zh_TW.UTF-8 UTF-8 +zh_TW BIG5 +zu_ZA.UTF-8 UTF-8 +zu_ZA ISO-8859-1 diff --git a/meta-openeuler/recipes-external/glibc/glibc-external/libc.headers b/meta-openeuler/recipes-external/glibc/glibc-external/libc.headers new file mode 100644 index 0000000000000000000000000000000000000000..d06a251933a6c94f2ac92d554c6d621a26a865bf --- /dev/null +++ b/meta-openeuler/recipes-external/glibc/glibc-external/libc.headers @@ -0,0 +1,132 @@ +aio.h +aliases.h +alloca.h +a.out.h +argp.h +argz.h +ar.h +arpa +assert.h +byteswap.h +complex.h +cpio.h +ctype.h +dirent.h +dlfcn.h +elf.h +endian.h +envz.h +err.h +errno.h +error.h +execinfo.h +fcntl.h +features.h +features-time64.h +fenv.h +finclude/math-vector-fortran.h +fmtmsg.h +fnmatch.h +fpu_control.h +fstab.h +fts.h +ftw.h +_G_config.h +gconv.h +getopt.h +glob.h +gnu +gnu-versions.h +grp.h +gshadow.h +iconv.h +ieee754.h +ifaddrs.h +inttypes.h +langinfo.h +lastlog.h +libgen.h +libintl.h +libio.h +limits.h +link.h +locale.h +malloc.h +math.h +mcheck.h +memory.h +mntent.h +monetary.h +mqueue.h +net +netash +netatalk +netax25 +netdb.h +neteconet +netinet +netipx +netiucv +netpacket +netrom +netrose +nfs +nl_types.h +nss.h +obstack.h +paths.h +poll.h +printf.h +proc_service.h +protocols +pthread.h +pty.h +pwd.h +re_comp.h +regex.h +regexp.h +resolv.h +rpc/netdb.h +sched.h +scsi +search.h +semaphore.h +setjmp.h +sgtty.h +shadow.h +signal.h +spawn.h +stab.h +stdc-predef.h +stdint.h +stdio_ext.h +stdio.h +stdlib.h +string.h +strings.h +stropts.h +syscall.h +sysexits.h +syslog.h +tar.h +termio.h +termios.h +tgmath.h +thread_db.h +threads.h +time.h +ttyent.h +uchar.h +ucontext.h +ulimit.h +unistd.h +ustat.h +utime.h +utmp.h +utmpx.h +values.h +wait.h +wchar.h +wctype.h +wordexp.h +xlocale.h diff --git a/meta-openeuler/recipes-external/glibc/glibc-external/nscd.conf b/meta-openeuler/recipes-external/glibc/glibc-external/nscd.conf new file mode 100644 index 0000000000000000000000000000000000000000..39b875912dbaf730588e59a3dfd34a014057c83d --- /dev/null +++ b/meta-openeuler/recipes-external/glibc/glibc-external/nscd.conf @@ -0,0 +1,88 @@ +# +# /etc/nscd.conf +# +# An example Name Service Cache config file. This file is needed by nscd. +# +# Legal entries are: +# +# logfile +# debug-level +# threads +# max-threads +# server-user +# server-user is ignored if nscd is started with -S parameters +# stat-user +# reload-count unlimited| +# paranoia +# restart-interval