This set of changes adds support for building the greybus loopback_test utility from drivers/staging/greybus/tools, adds support for starting gbsim in loopback mode with associated shortcuts/manifests and enables building of the greybus loopback_test utility by default in the buildroot overlay.
For simplicity I've setup a branch on github and already sent Rui a pull request.
https://github.com/bryanodonoghue/ara_buildroot_x86_64/tree/master%2Bloopbac...
Bryan O'Donoghue (5): package: add greybus_loopback_test package bin: Add a loopback shortcut to /bin manifest: add loopback to the set of manifest files defconfig: enable loopback_test in the staging defconfig readme: add loopback to the set of listed commands
Config.in | 1 + README.md | 1 + board/ara/overlay/bin/loopback | 1 + .../etc/manifests/simple-loopback-module.mnfb | Bin 0 -> 132 bytes configs/ara_qemu_x86_64_staging_next_defconfig | 1 + package/greybus_loopback_test/Config.in | 6 +++++ .../greybus_loopback_test/greybus_loopback_test.mk | 25 +++++++++++++++++++++ 7 files changed, 35 insertions(+) create mode 120000 board/ara/overlay/bin/loopback create mode 100644 board/ara/overlay/etc/manifests/simple-loopback-module.mnfb create mode 100644 package/greybus_loopback_test/Config.in create mode 100644 package/greybus_loopback_test/greybus_loopback_test.mk
The loopback_test utility allows various different types of bandwidth and latency tests to be performed against a greybus loopback Interface. This utility is available in the kernel tree as loopback_test, this package is called greybus_loopback_test here to fit in with the other package names in the greybus overlay.
Once built this package will build the utility in drivers/staging/greybus/tools and install it to /usr/sbin/loopback_test in the target buildroot filesystem.
Signed-off-by: Bryan O'Donoghue pure.logic@nexus-software.ie --- Config.in | 1 + package/greybus_loopback_test/Config.in | 6 ++++++ .../greybus_loopback_test/greybus_loopback_test.mk | 25 ++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 package/greybus_loopback_test/Config.in create mode 100644 package/greybus_loopback_test/greybus_loopback_test.mk
diff --git a/Config.in b/Config.in index aea494c..dbde37a 100644 --- a/Config.in +++ b/Config.in @@ -2,3 +2,4 @@ source "$BR2_EXTERNAL_ARA_PATH/package/greybus/Config.in" source "$BR2_EXTERNAL_ARA_PATH/package/gbsim/Config.in" source "$BR2_EXTERNAL_ARA_PATH/package/libusbg/Config.in" source "$BR2_EXTERNAL_ARA_PATH/package/gbutils/Config.in" +source "$BR2_EXTERNAL_ARA_PATH/package/greybus_loopback_test/Config.in" diff --git a/package/greybus_loopback_test/Config.in b/package/greybus_loopback_test/Config.in new file mode 100644 index 0000000..74bedc5 --- /dev/null +++ b/package/greybus_loopback_test/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_GREYBUS_LOOPBACK_TEST + bool "greybus loopback test" + depends on BR2_LINUX_KERNEL + help + Greybus loopback test tool is used to run performance test + across greybus to loopback enabled Interfaces. diff --git a/package/greybus_loopback_test/greybus_loopback_test.mk b/package/greybus_loopback_test/greybus_loopback_test.mk new file mode 100644 index 0000000..5e1bd60 --- /dev/null +++ b/package/greybus_loopback_test/greybus_loopback_test.mk @@ -0,0 +1,25 @@ +################################################################################ +# +# greybus_loopback_test +# +################################################################################ + +GREYBUS_LOOPBACK_DIR_STAGING = $(LINUX_DIR)/drivers/staging/greybus +GREYBUS_LOOPBACK_TEST_INSTALL_TARGET = YES + +define GREYBUS_LOOPBACK_TEST_BUILD_CMDS + $(Q)if test ! -f $(GREYBUS_LOOPBACK_DIR_STAGING)/tools/Makefile ; then \ + echo "Your kernel version is too old and does not have the greybus loopback tool." ; \ + echo "At least kernel 4.8 must be used." ; \ + exit 1 ; \ + fi + $(TARGET_MAKE_ENV) $(MAKE) -C $(GREYBUS_LOOPBACK_DIR_STAGING)/tools \ + loopback_test +endef + +define GREYBUS_LOOPBACK_TEST_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 755 $(GREYBUS_LOOPBACK_DIR_STAGING)/tools/loopback_test \ + $(TARGET_DIR)/usr/sbin +endef + +$(eval $(generic-package))
The array of commands used to start up gbsim in a particular mode, UART, SDIO etc currently does not cover loopback. This patch adds the necessary simlink to add loopback to set of shortcuts.
Signed-off-by: Bryan O'Donoghue pure.logic@nexus-software.ie --- board/ara/overlay/bin/loopback | 1 + 1 file changed, 1 insertion(+) create mode 120000 board/ara/overlay/bin/loopback
diff --git a/board/ara/overlay/bin/loopback b/board/ara/overlay/bin/loopback new file mode 120000 index 0000000..08b9811 --- /dev/null +++ b/board/ara/overlay/bin/loopback @@ -0,0 +1 @@ +m \ No newline at end of file
In order to enable starting up of gbsim in loopback mode we need a manifest file to copy into the hotplug directory to get gbsim to react and present a set of loopback Interfaces to greybus. This patch adds the necessary manifest file to the /etc overlay.
Signed-off-by: Bryan O'Donoghue pure.logic@nexus-software.ie --- .../ara/overlay/etc/manifests/simple-loopback-module.mnfb | Bin 0 -> 132 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 board/ara/overlay/etc/manifests/simple-loopback-module.mnfb
diff --git a/board/ara/overlay/etc/manifests/simple-loopback-module.mnfb b/board/ara/overlay/etc/manifests/simple-loopback-module.mnfb new file mode 100644 index 0000000000000000000000000000000000000000..e25151bdcf5d50378a6c52b4e463577c8f1f308a GIT binary patch literal 132 zcmZo+U|{56U}RuqVqg$qU}E59R0=4{&q_@$QE)6uRANv8ib*pm1!v|K<fJP2<mVS8 zB_?Mpc;=O)7NsR7rz$ZpFmN!i07($d45e9sEG9t^pGgoR4-^6OnW223jbJ__kPiTD CH4n%D
literal 0 HcmV?d00001
Previous patches added the ability to build the greybus loopback_test utility from staging and added shortcuts for starting up gbsim in loopback mode. This patch enables building of the greybus loopback_test utility by default as we do for other greybus related utilities in this overlay layer.
Signed-off-by: Bryan O'Donoghue pure.logic@nexus-software.ie --- configs/ara_qemu_x86_64_staging_next_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/ara_qemu_x86_64_staging_next_defconfig b/configs/ara_qemu_x86_64_staging_next_defconfig index 00a745b..8200261 100644 --- a/configs/ara_qemu_x86_64_staging_next_defconfig +++ b/configs/ara_qemu_x86_64_staging_next_defconfig @@ -24,3 +24,4 @@ BR2_TARGET_ROOTFS_EXT2=y BR2_PACKAGE_GBSIM=y BR2_PACKAGE_LIBUSBG=y BR2_PACKAGE_GBUTILS=y +BR2_PACKAGE_LINUX_TOOLS_GBLOOPBACK_TEST=y
Add loopback into the set of listed commands along with UART, SDIO and friends.
Signed-off-by: Bryan O'Donoghue pure.logic@nexus-software.ie --- README.md | 1 + 1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md index 27870de..db3421c 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ already running and will replace the simulated module by the new one. . pwm . power-supply . uart + . loopback ```
- To stop qemu do:
Hi Bryan, On Tue, Nov 29, 2016 at 12:56:52AM +0000, Bryan O'Donoghue wrote:
This set of changes adds support for building the greybus loopback_test utility from drivers/staging/greybus/tools, adds support for starting gbsim in loopback mode with associated shortcuts/manifests and enables building of the greybus loopback_test utility by default in the buildroot overlay.
Thanks for this, all merged.
For simplicity I've setup a branch on github and already sent Rui a pull request.
I have used git push instead... I rather do this this way than using github pull requests.
https://github.com/bryanodonoghue/ara_buildroot_x86_64/tree/master%2Bloopbac...
Bryan O'Donoghue (5): package: add greybus_loopback_test package
I have only changed a small nit in this patch. I changed the kernel version from 4.8 to 4.9, since it is the version that introduces the greybus in the staging area.
bin: Add a loopback shortcut to /bin manifest: add loopback to the set of manifest files defconfig: enable loopback_test in the staging defconfig
Also, I only notice this after pushing this series, the config option introduced by this patch was not correct. I have meanwhile fix this and push it. I should have notice this before, but I was more focused in the kernel side and module loading than at the loopback_test binary.
Give it a try from the master and let me know if everything is working as you expect.
Cheers, Rui
On 29/11/16 12:02, Rui Miguel Silva wrote:
Also, I only notice this after pushing this series, the config option introduced by this patch was not correct. I have meanwhile fix this and push it. I should have notice this before, but I was more focused in the kernel side and module loading than at the loopback_test binary.
Ah, I must have changed the name and not noticed.
Thanks