diff mbox series

[v2,06/49] kpartx.rules: use @BINDIR@ to locate kpartx

Message ID 20240712171458.77611-7-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath-tools: devmapper API refactored | expand

Commit Message

Martin Wilck July 12, 2024, 5:14 p.m. UTC
The path for kpartx should match the installed binary.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 .gitignore                               | 1 +
 kpartx/Makefile                          | 6 +++---
 kpartx/{kpartx.rules => kpartx.rules.in} | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)
 rename kpartx/{kpartx.rules => kpartx.rules.in} (96%)

Comments

Benjamin Marzinski July 15, 2024, 10:08 p.m. UTC | #1
On Fri, Jul 12, 2024 at 07:14:14PM +0200, Martin Wilck wrote:
> The path for kpartx should match the installed binary.
> 
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  .gitignore                               | 1 +
>  kpartx/Makefile                          | 6 +++---
>  kpartx/{kpartx.rules => kpartx.rules.in} | 2 +-
>  3 files changed, 5 insertions(+), 4 deletions(-)
>  rename kpartx/{kpartx.rules => kpartx.rules.in} (96%)
> 
> diff --git a/.gitignore b/.gitignore
> index 049ffe8..355ddbb 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -12,6 +12,7 @@ config.mk
>  cscope.files
>  cscope.out
>  kpartx/kpartx
> +kpartx/kpartx.rules
>  multipath/multipath
>  multipath/multipath.8
>  multipath/multipath.conf.5
> diff --git a/kpartx/Makefile b/kpartx/Makefile
> index 7720a74..849fd36 100644
> --- a/kpartx/Makefile
> +++ b/kpartx/Makefile
> @@ -13,13 +13,13 @@ LIBDEPS += -ldevmapper
>  OBJS := bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \
>  	gpt.o mac.o ps3.o crc32.o lopart.o xstrncpy.o devmapper.o
>  
> -all: $(EXEC)
> +all: $(EXEC) kpartx.rules
>  
>  $(EXEC): $(OBJS)
>  	@echo building $@ because of $?
>  	$(Q)$(CC) $(CFLAGS) $(OBJS) -o $(EXEC) $(LDFLAGS) $(LIBDEPS)
>  
> -install: $(EXEC) $(EXEC).8
> +install: $(EXEC) $(EXEC).8 kpartx.rules
>  	$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
>  	$(Q)$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)
>  	$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(libudevdir)
> @@ -41,7 +41,7 @@ uninstall:
>  	$(Q)$(RM) $(DESTDIR)$(libudevdir)/rules.d/68-del-part-nodes.rules
>  
>  clean: dep_clean
> -	$(Q)$(RM) core *.o $(EXEC)
> +	$(Q)$(RM) core *.o $(EXEC) kpartx.rules
>  
>  include $(wildcard $(OBJS:.o=.d))
>  
> diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules.in
> similarity index 96%
> rename from kpartx/kpartx.rules
> rename to kpartx/kpartx.rules.in
> index 8dd3369..9d87960 100644
> --- a/kpartx/kpartx.rules
> +++ b/kpartx/kpartx.rules.in
> @@ -39,6 +39,6 @@ LABEL="mpath_kpartx_end"
>  GOTO="kpartx_end"
>  
>  LABEL="run_kpartx"
> -RUN+="/sbin/kpartx -un -p -part /dev/$name"
> +RUN+="@BINDIR@/kpartx -un -p -part /dev/$name"
>  
>  LABEL="kpartx_end"
> -- 
> 2.45.2
diff mbox series

Patch

diff --git a/.gitignore b/.gitignore
index 049ffe8..355ddbb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@  config.mk
 cscope.files
 cscope.out
 kpartx/kpartx
+kpartx/kpartx.rules
 multipath/multipath
 multipath/multipath.8
 multipath/multipath.conf.5
diff --git a/kpartx/Makefile b/kpartx/Makefile
index 7720a74..849fd36 100644
--- a/kpartx/Makefile
+++ b/kpartx/Makefile
@@ -13,13 +13,13 @@  LIBDEPS += -ldevmapper
 OBJS := bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \
 	gpt.o mac.o ps3.o crc32.o lopart.o xstrncpy.o devmapper.o
 
-all: $(EXEC)
+all: $(EXEC) kpartx.rules
 
 $(EXEC): $(OBJS)
 	@echo building $@ because of $?
 	$(Q)$(CC) $(CFLAGS) $(OBJS) -o $(EXEC) $(LDFLAGS) $(LIBDEPS)
 
-install: $(EXEC) $(EXEC).8
+install: $(EXEC) $(EXEC).8 kpartx.rules
 	$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
 	$(Q)$(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)
 	$(Q)$(INSTALL_PROGRAM) -d $(DESTDIR)$(libudevdir)
@@ -41,7 +41,7 @@  uninstall:
 	$(Q)$(RM) $(DESTDIR)$(libudevdir)/rules.d/68-del-part-nodes.rules
 
 clean: dep_clean
-	$(Q)$(RM) core *.o $(EXEC)
+	$(Q)$(RM) core *.o $(EXEC) kpartx.rules
 
 include $(wildcard $(OBJS:.o=.d))
 
diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules.in
similarity index 96%
rename from kpartx/kpartx.rules
rename to kpartx/kpartx.rules.in
index 8dd3369..9d87960 100644
--- a/kpartx/kpartx.rules
+++ b/kpartx/kpartx.rules.in
@@ -39,6 +39,6 @@  LABEL="mpath_kpartx_end"
 GOTO="kpartx_end"
 
 LABEL="run_kpartx"
-RUN+="/sbin/kpartx -un -p -part /dev/$name"
+RUN+="@BINDIR@/kpartx -un -p -part /dev/$name"
 
 LABEL="kpartx_end"