lkmc_many_files: create package to test a rootfs with many files

Automatically pick up packages from under packages/ into BR2_EXTERNAL.

Move many subdirectory READMEs into the toplevel and link to toplevel from those subreadmes instead.
This commit is contained in:
Ciro Santilli
2018-06-10 13:55:45 +01:00
parent 4484e866cb
commit 57dbe81f33
16 changed files with 118 additions and 31 deletions

1
packages/README.adoc Normal file
View File

@@ -0,0 +1 @@
https://github.com/cirosantilli/linux-kernel-module-cheat#packages_directory

View File

@@ -0,0 +1,4 @@
config BR2_PACKAGE_LKMC_MANY_FILES
bool "lkmc_many_files"
help
Create a bunch of files in target/ to benchmark Buildroot.

View File

@@ -0,0 +1,16 @@
.PHONY: all clean
CFLAGS_EXTRA ?= -fopenmp -std=c99 -Wall -Werror -Wextra
IN_EXT ?= .c
LIBS :=
OUT_EXT ?= .out
OUTS := $(addsuffix $(OUT_EXT), $(basename $(wildcard *$(IN_EXT))))
all: $(OUTS)
%$(OUT_EXT): %$(IN_EXT)
$(CC) $(CFLAGS) $(CFLAGS_EXTRA) -o '$@' '$<' $(LIBS)
clean:
rm -f *'$(OUT_EXT)'

View File

@@ -0,0 +1 @@
name: LKMC_MANY_FILES

View File

@@ -0,0 +1,30 @@
################################################################################
#
# lkmc_many_files
#
################################################################################
LKMC_MANY_FILES_VERSION = 1.0
LKMC_MANY_FILES_SITE = $(BR2_EXTERNAL_LKMC_MANY_FILES_PATH)
LKMC_MANY_FILES_SITE_METHOD = local
define LKMC_MANY_FILES_BUILD_CMDS
# D contains the source code of this package.
# TARGET_CONFIGURE_OPTS contains several common options such as CFLAGS and LDFLAGS.
$(MAKE) -C '$(@D)' $(TARGET_CONFIGURE_OPTS)
endef
define LKMC_MANY_FILES_INSTALL_TARGET_CMDS
# Anything put inside TARGET_DIR will end up on the guest relative to the root directory.
i=0; \
while [ $$i -le 128 ]; do \
j=0; \
while [ $$j -le 128 ]; do \
$(INSTALL) -D -m 0755 $(@D)/lkmc_many_files.out $(TARGET_DIR)/lkmc_many_files/$${i}_$${j}.out; \
j=$$(($$j+1)); \
done; \
i=$$(($$i+1)); \
done
endef
$(eval $(generic-package))

View File

@@ -0,0 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
puts("hello lkmc_many_files");
return EXIT_SUCCESS;
}

View File

@@ -0,0 +1,4 @@
config BR2_PACKAGE_SAMPLE_PACKAGE
bool "sample_package"
help
Sample Buildroot package.

View File

@@ -0,0 +1,16 @@
.PHONY: all clean
CFLAGS_EXTRA ?= -fopenmp -std=c99 -Wall -Werror -Wextra
IN_EXT ?= .c
LIBS :=
OUT_EXT ?= .out
OUTS := $(addsuffix $(OUT_EXT), $(basename $(wildcard *$(IN_EXT))))
all: $(OUTS)
%$(OUT_EXT): %$(IN_EXT)
$(CC) $(CFLAGS) $(CFLAGS_EXTRA) -o '$@' '$<' $(LIBS)
clean:
rm -f *'$(OUT_EXT)'

View File

@@ -0,0 +1 @@
name: SAMPLE_PACKAGE

View File

@@ -0,0 +1,22 @@
################################################################################
#
# sample_package
#
################################################################################
SAMPLE_PACKAGE_VERSION = 1.0
SAMPLE_PACKAGE_SITE = $(BR2_EXTERNAL_SAMPLE_PACKAGE_PATH)
SAMPLE_PACKAGE_SITE_METHOD = local
define SAMPLE_PACKAGE_BUILD_CMDS
# D contains the source code of this package.
# TARGET_CONFIGURE_OPTS contains several common options such as CFLAGS and LDFLAGS.
$(MAKE) -C '$(@D)' $(TARGET_CONFIGURE_OPTS)
endef
define SAMPLE_PACKAGE_INSTALL_TARGET_CMDS
# Anything put inside TARGET_DIR will end up on the guest relative to the root directory.
$(INSTALL) -D -m 0755 $(@D)/*.out '$(TARGET_DIR)'
endef
$(eval $(generic-package))

View File

@@ -0,0 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
puts("hello sample_package");
return EXIT_SUCCESS;
}