mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
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:
1
packages/README.adoc
Normal file
1
packages/README.adoc
Normal file
@@ -0,0 +1 @@
|
||||
https://github.com/cirosantilli/linux-kernel-module-cheat#packages_directory
|
||||
4
packages/lkmc_many_files/Config.in
Normal file
4
packages/lkmc_many_files/Config.in
Normal 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.
|
||||
16
packages/lkmc_many_files/Makefile
Normal file
16
packages/lkmc_many_files/Makefile
Normal 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)'
|
||||
1
packages/lkmc_many_files/external.desc
Normal file
1
packages/lkmc_many_files/external.desc
Normal file
@@ -0,0 +1 @@
|
||||
name: LKMC_MANY_FILES
|
||||
30
packages/lkmc_many_files/external.mk
Normal file
30
packages/lkmc_many_files/external.mk
Normal 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))
|
||||
7
packages/lkmc_many_files/lkmc_many_files.c
Normal file
7
packages/lkmc_many_files/lkmc_many_files.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
puts("hello lkmc_many_files");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
4
packages/sample_package/Config.in
Normal file
4
packages/sample_package/Config.in
Normal file
@@ -0,0 +1,4 @@
|
||||
config BR2_PACKAGE_SAMPLE_PACKAGE
|
||||
bool "sample_package"
|
||||
help
|
||||
Sample Buildroot package.
|
||||
16
packages/sample_package/Makefile
Normal file
16
packages/sample_package/Makefile
Normal 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)'
|
||||
1
packages/sample_package/external.desc
Normal file
1
packages/sample_package/external.desc
Normal file
@@ -0,0 +1 @@
|
||||
name: SAMPLE_PACKAGE
|
||||
22
packages/sample_package/external.mk
Normal file
22
packages/sample_package/external.mk
Normal 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))
|
||||
7
packages/sample_package/sample_package.c
Normal file
7
packages/sample_package/sample_package.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
puts("hello sample_package");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user