Skip to content

Commit

Permalink
amdgpu: Set PLUGINDIR to /usr/lib/criu
Browse files Browse the repository at this point in the history
Building the criu packages for Ubuntu/Debian fails with:

	mkdir: cannot create directory '/var/lib/criu': Permission denied

This patch updates PLUGINDIR with the value /usr/lib/criu

Fixes: #1877

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
  • Loading branch information
rst0git committed May 12, 2022
1 parent 531386e commit 2a0b7d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile.install
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MANDIR ?= $(PREFIX)/share/man
INCLUDEDIR ?= $(PREFIX)/include
LIBEXECDIR ?= $(PREFIX)/libexec
RUNDIR ?= /run
PLUGINDIR ?= /var/lib/criu
PLUGINDIR ?= $(PREFIX)/lib/criu

#
# For recent Debian/Ubuntu with multiarch support.
Expand Down
4 changes: 3 additions & 1 deletion criu/include/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#include "common/compiler.h"
#include "common/list.h"

#define CR_PLUGIN_DEFAULT "/var/lib/criu/"
#ifndef CR_PLUGIN_DEFAULT
#define CR_PLUGIN_DEFAULT "/usr/lib/criu/"
#endif

void cr_plugin_fini(int stage, int err);
int cr_plugin_init(int stage);
Expand Down
8 changes: 4 additions & 4 deletions plugins/amdgpu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DEPS_NOK := ;
include $(__nmk_dir)msg.mk

CC := gcc
PLUGIN_CFLAGS := -g -Wall -Werror -D _GNU_SOURCE -shared -nostartfiles -fPIC
PLUGIN_CFLAGS := -g -Wall -Werror -D _GNU_SOURCE -shared -nostartfiles -fPIC -DCR_PLUGIN_DEFAULT="$(PLUGINDIR)"
PLUGIN_LDFLAGS := -lpthread -lrt -ldrm -ldrm_amdgpu

ifeq ($(CONFIG_AMDGPU),y)
Expand Down Expand Up @@ -50,16 +50,16 @@ clean: amdgpu_plugin_clean amdgpu_plugin_test_clean
mrproper: clean

install:
$(Q) mkdir -p $(PLUGINDIR)
ifeq ($(CONFIG_AMDGPU),y)
$(Q) mkdir -p $(DESTDIR)$(PLUGINDIR)
$(E) " INSTALL " $(PLUGIN_NAME)
$(Q) install -m 644 $(PLUGIN_SOBJ) $(PLUGINDIR)
$(Q) install -m 644 $(PLUGIN_SOBJ) $(DESTDIR)$(PLUGINDIR)
endif
.PHONY: install

uninstall:
ifeq ($(CONFIG_AMDGPU),y)
$(E) " UNINSTALL" $(PLUGIN_NAME)
$(Q) $(RM) $(PLUGINDIR)/$(PLUGIN_SOBJ)
$(Q) $(RM) $(DESTDIR)$(PLUGINDIR)/$(PLUGIN_SOBJ)
endif
.PHONY: uninstall

0 comments on commit 2a0b7d6

Please sign in to comment.