Commit a645904e authored by Federico Vaga's avatar Federico Vaga

Merge branch…

Merge branch '4-align-building-infrastructure-to-build-against-fecos-and-install-artifacts' into 'master'

Resolve "Align building infrastructure to build against fecos and install artifacts"

Closes #4

See merge request be-cem-edl/fec/hardware-modules/zio!4
parents a65393e9 5e602354
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
--- ---
variables:
GIT_DEPTH: 0
include: include:
- project: 'be-cem-edl/evergreen/gitlab-ci' - project: 'be-cem-edl/evergreen/gitlab-ci'
ref: master ref: master
...@@ -32,22 +35,10 @@ flawfinder: ...@@ -32,22 +35,10 @@ flawfinder:
script: script:
- make flawfinder - make flawfinder
kernel_build_cc7: software_build:
extends: .kernel_build_cc7 extends: .build_fec_os_sw
variables: variables:
EDL_CI_KBUILD_PATHS: drivers/zio EDL_CI_SW_PATHS: .
kernel_build_validation: kernel_build_validation:
extends: .kernel_build_validation extends: .kernel_build_validation
build_tools:
stage: build
image:
name: gitlab-registry.cern.ch/be-cem-edl/evergreen/gitlab-ci/build-fec-sw:latest
script:
- make -C tools -j "$(nproc)"
artifacts:
paths:
- 'tools/zio-dump'
- 'tools/zio-cat-file'
- 'tools/test-dtc'
...@@ -3,30 +3,24 @@ ...@@ -3,30 +3,24 @@
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: CC0-1.0
-include Makefile.specific -include Makefile.specific
# include parent_common.mk for buildsystem's defines
# It allows you to inherit an environment configuration from larger project
REPO_PARENT ?= $(shell pwd)/..
-include $(REPO_PARENT)/parent_common.mk -include $(REPO_PARENT)/parent_common.mk
C_DIRS = drivers/zio \ C_DIRS = drivers/zio \
lib \
tools tools
DIRS = $(C_DIRS) \ DIRS = $(C_DIRS) \
Documentation/core-api/zio \ Documentation/core-api/zio \
Documentation/core-api/zio/img/Makefile Documentation/core-api/zio/img/Makefile
all clean: $(DIRS) all clean install: $(C_DIRS)
clean: TARGET = clean clean: TARGET = clean
install: TARGET = install
$(DIRS): $(DIRS):
$(MAKE) -C $@ $(TARGET) $(MAKE) -C $@ $(TARGET)
modules modules_install:
$(MAKE) -C drivers/zio $@
flawfinder cppcheck: flawfinder cppcheck:
for d in $(C_DIRS); do $(MAKE) -C $$d $@ || exit 1; done for d in $(C_DIRS); do $(MAKE) -C $$d $@ || exit 1; done
.PHONY: all clean modules modules_install cppcheck flawfinder .PHONY: all clean modules modules_install install cppcheck flawfinder $(DIRS)
...@@ -34,6 +34,7 @@ all: modules ...@@ -34,6 +34,7 @@ all: modules
modules coccicheck modules_install clean: modules coccicheck modules_install clean:
$(MAKE) -C $(KERNELSRC) M=$(shell /bin/pwd) $@ $(MAKE) -C $(KERNELSRC) M=$(shell /bin/pwd) $@
install: modules_install
cppcheck: cppcheck:
$(CPPCHECK) -q -I. --suppress=missingIncludeSystem --enable=all *.c *.h $(CPPCHECK) -q -I. --suppress=missingIncludeSystem --enable=all *.c *.h
......
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
static DEFINE_MUTEX(zmutex); static DEFINE_MUTEX(zmutex);
static struct zio_status *zstat = &zio_global_status; /* Always use ptr */ static struct zio_status *zstat = &zio_global_status; /* Always use ptr */
#if KERNEL_VERSION(6,2,0) <= LINUX_VERSION_CODE
static int zio_dev_uevent(const struct device *dev, struct kobj_uevent_env *env)
#else
static int zio_dev_uevent(struct device *dev, struct kobj_uevent_env *env) static int zio_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
#endif
{ {
unsigned long *flags; unsigned long *flags;
...@@ -38,10 +42,10 @@ static int zio_dev_uevent(struct device *dev, struct kobj_uevent_env *env) ...@@ -38,10 +42,10 @@ static int zio_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
return 0; return 0;
} }
#if LINUX_VERSION_CODE > KERNEL_VERSION(3,2,0) #if KERNEL_VERSION(6,2,0) <= LINUX_VERSION_CODE
static char *zio_devnode(struct device *dev, umode_t *mode) static char *zio_devnode(const struct device *dev, umode_t *mode)
#else #else
static char *zio_devnode(struct device *dev, mode_t *mode) static char *zio_devnode(struct device *dev, umode_t *mode)
#endif #endif
{ {
return kasprintf(GFP_KERNEL, "zio/%s", dev_name(dev)); return kasprintf(GFP_KERNEL, "zio/%s", dev_name(dev));
...@@ -428,9 +432,6 @@ static ssize_t zio_generic_read(struct file *f, char __user *ubuf, ...@@ -428,9 +432,6 @@ static ssize_t zio_generic_read(struct file *f, char __user *ubuf,
struct zio_channel *chan = priv->chan; struct zio_channel *chan = priv->chan;
struct zio_bi *bi = chan->bi; struct zio_bi *bi = chan->bi;
struct zio_block *block; struct zio_block *block;
#if KERNEL_VERSION(4, 18, 0) <= LINUX_VERSION_CODE
struct zio_control zio_ctrl;
#endif
int (*can_read)(struct zio_f_priv *); int (*can_read)(struct zio_f_priv *);
int fault; int fault;
......
# SPDX-FileCopyrightText: 2023 CERN (home.cern)
#
# SPDX-License-Identifier: CC0-1.0
CPPCHECK ?= cppcheck
FLAWFINDER ?= flawfinder
all:
DESTDIR ?=
prefix ?= /usr/local
includedir ?= $(prefix)/include
deploy install:
mkdir -m 0775 -p $(DESTDIR)$(includedir)/zio
install -D -t $(DESTDIR)$(includedir)/zio -m 0644 ../include/linux/zio.h
install -D -t $(DESTDIR)$(includedir)/zio -m 0644 ../include/linux/zio-user.h
modules_install:
cppcheck:
flawfinder:
.PHONY: all clean install cppcheck flawfinder
...@@ -14,7 +14,7 @@ ZIO_VERSION += -D__ZIO_MINOR_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f ...@@ -14,7 +14,7 @@ ZIO_VERSION += -D__ZIO_MINOR_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f
ZIO_VERSION += -D__ZIO_PATCH_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f 1 | cut -d '.' -f 3; ) ZIO_VERSION += -D__ZIO_PATCH_VERSION=$(shell echo $(GIT_VERSION) | cut -d '-' -f 1 | cut -d '.' -f 3; )
INCLUDE = -I$(M)/include/ INCLUDE = -I$(M)/include/
CFLAGS = $(INCLUDE) -Wall -Werror $(ZIO_VERSION) $(EXTRACFLAGS) CFLAGS += $(INCLUDE) -Wall -Werror $(ZIO_VERSION) $(EXTRACFLAGS)
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
CC ?= $(CROSS_COMPILE)gcc CC ?= $(CROSS_COMPILE)gcc
...@@ -26,7 +26,7 @@ progs += zio-cat-file ...@@ -26,7 +26,7 @@ progs += zio-cat-file
progs += test-dtc progs += test-dtc
# The following is ugly, please forgive me by now # The following is ugly, please forgive me by now
user: $(progs) all: $(progs)
clean: clean:
rm -f $(progs) *~ *.o rm -f $(progs) *~ *.o
...@@ -34,10 +34,22 @@ clean: ...@@ -34,10 +34,22 @@ clean:
%: %.c %: %.c
$(CC) $(CFLAGS) $^ -o $@ $(CC) $(CFLAGS) $^ -o $@
# make nothing for modules_install, but avoid errors
modules_install:
DESTDIR ?=
prefix ?= /usr/local
exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin
install: $(progs)
mkdir -m 0775 -p $(DESTDIR)$(bindir)
install -D -t $(DESTDIR)$(bindir) -m 0755 $^
cppcheck: cppcheck:
$(CPPCHECK) -q $(INCLUDE) --suppress=missingIncludeSystem --enable=all *.c *.h $(CPPCHECK) -q $(INCLUDE) --suppress=missingIncludeSystem --enable=all *.c *.h
flawfinder: flawfinder:
$(FLAWFINDER) -SQDC --error-level=4 . $(FLAWFINDER) -SQDC --error-level=4 .
.PHONY: flawfinder cppcheck .PHONY: all clean install modules_install flawfinder cppcheck
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment