]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/attr/0004-all-use-install-1-to-install-executables.patch
package/attr: fix install
[coffee/buildroot.git] / package / attr / 0004-all-use-install-1-to-install-executables.patch
1 From 4187e60ab52cac3ed36036a354977310dab68dcb Mon Sep 17 00:00:00 2001
2 From: "Yann E. MORIN" <yann.morin.1998@free.fr>
3 Date: Tue, 8 May 2018 15:16:10 +0200
4 Subject: [PATCH] all: use install(1) to install executables
5
6 When the destination file already exists, the current install script
7 will overwrite it with the new executable.
8
9 However, when the existing executable is a symlink or hardlink to
10 something else, like busybox, this effectively overwrites that something
11 with the new executable, and thus replaces busybox and all its applets
12 with the code for either of the three commands.
13
14 We fix that by simply calling install(1). install(1) is sufficiently
15 widespread that we don't bother checking for it, as this is just a
16 workaround while waiting for the version bump that will eventually fix
17 it for good.
18
19 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
20 ---
21  attr/Makefile     | 4 ++--
22  getfattr/Makefile | 4 ++--
23  setfattr/Makefile | 4 ++--
24  3 files changed, 6 insertions(+), 6 deletions(-)
25
26 diff --git a/attr/Makefile b/attr/Makefile
27 index 1c467e8..326dd7e 100644
28 --- a/attr/Makefile
29 +++ b/attr/Makefile
30 @@ -29,6 +29,6 @@ default: $(LTCOMMAND)
31  include $(BUILDRULES)
32  
33  install: default
34 -       $(INSTALL) -m 755 -d $(PKG_BIN_DIR)
35 -       $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
36 +       install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
37 +
38  install-dev install-lib:
39 diff --git a/getfattr/Makefile b/getfattr/Makefile
40 index 91d3df2..f913172 100644
41 --- a/getfattr/Makefile
42 +++ b/getfattr/Makefile
43 @@ -30,6 +30,6 @@ default: $(LTCOMMAND)
44  include $(BUILDRULES)
45  
46  install: default
47 -       $(INSTALL) -m 755 -d $(PKG_BIN_DIR)
48 -       $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
49 +       install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
50 +
51  install-dev install-lib:
52 diff --git a/setfattr/Makefile b/setfattr/Makefile
53 index d55461b..26dc5d8 100644
54 --- a/setfattr/Makefile
55 +++ b/setfattr/Makefile
56 @@ -30,6 +30,6 @@ default: $(LTCOMMAND)
57  include $(BUILDRULES)
58  
59  install: default
60 -       $(INSTALL) -m 755 -d $(PKG_BIN_DIR)
61 -       $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
62 +       install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
63 +
64  install-dev install-lib:
65 -- 
66 2.14.1
67