0004-all-use-install-1-to-install-executables.patch 2.1 KB

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