Skip to contentSkip to conversation

kbuild: /bin/pwd -> pwd

PATCH In review Bjørn Forsman 2 participants 2 messages Nov 5, 2017 – Nov 18, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: /bin/pwd -> pwd

Most places use pwd and rely on $PATH lookup. Moving the remaining absolute path /bin/pwd users over for consistency.

Also, a reason for doing /bin/pwd -> pwd instead of the other way around is because I believe build systems should make little assumptions on host filesystem layout. Case in point, we do this kind of patching already in NixOS.

Ref. commit 028568d84da3cfca49f5f846eeeef01441d70451 ("kbuild: revert $(realpath ...) to $(shell cd ... && /bin/pwd)").

---
 Documentation/ia64/xen.txt     | 2 +-
 Makefile                       | 2 +-
 tools/power/cpupower/Makefile  | 2 +-
 tools/scripts/Makefile.include | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
Documentation/ia64/xen.txt +1 -1
index c61a99f7c8bb..a12c74ce2773 100644
@@ -41,7 +41,7 @@ Getting and Building Xen and Dom0
 
  5. make initrd for Dom0/DomU
     # make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \
-      O=$(/bin/pwd)/build-linux-2.6.18-xen_ia64
+      O=$(pwd)/build-linux-2.6.18-xen_ia64
     # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \
       2.6.18.8-xen --builtin mptspi --builtin mptbase \
       --builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \
Makefile +1 -1
index 3a8868ee967e..a3eed17080b0 100644
@@ -132,7 +132,7 @@ ifneq ($(KBUILD_OUTPUT),)
 # check that the output directory actually exists
 saved-output := $(KBUILD_OUTPUT)
 KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
-								&& /bin/pwd)
+								&& pwd)
 $(if $(KBUILD_OUTPUT),, \
      $(error failed to create output directory "$(saved-output)"))
 
tools/power/cpupower/Makefile +1 -1
index d6e1c02ddcfe..c76b971d0423 100644
@@ -26,7 +26,7 @@ endif
 
 ifneq ($(OUTPUT),)
 # check that the output directory actually exists
-OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
+OUTDIR := $(shell cd $(OUTPUT) && pwd)
 $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
 endif
 
tools/scripts/Makefile.include +1 -1
index 654efd9768fd..3fab179b1aba 100644
@@ -13,7 +13,7 @@ endif
 
 # check that the output directory actually exists
 ifneq ($(OUTPUT),)
-OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
+OUTDIR := $(shell cd $(OUTPUT) && pwd)
 $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
 endif
 
Signature · 1 line
2.15.0
#1 lore raw

2017-11-05 18:44 GMT+09:00 Bjørn Forsman <[email protected]>:

Quoted 63 lines

Most places use pwd and rely on $PATH lookup. Moving the remaining absolute path /bin/pwd users over for consistency.

Also, a reason for doing /bin/pwd -> pwd instead of the other way around is because I believe build systems should make little assumptions on host filesystem layout. Case in point, we do this kind of patching already in NixOS.

Ref. commit 028568d84da3cfca49f5f846eeeef01441d70451 ("kbuild: revert $(realpath ...) to $(shell cd ... && /bin/pwd)").

---
 Documentation/ia64/xen.txt     | 2 +-
 Makefile                       | 2 +-
 tools/power/cpupower/Makefile  | 2 +-
 tools/scripts/Makefile.include | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
Documentation/ia64/xen.txt +1 -1
index c61a99f7c8bb..a12c74ce2773 100644
@@ -41,7 +41,7 @@ Getting and Building Xen and Dom0
 
  5. make initrd for Dom0/DomU
     # make -C linux-2.6.18-xen.hg ARCH=ia64 modules_install \
-      O=$(/bin/pwd)/build-linux-2.6.18-xen_ia64
+      O=$(pwd)/build-linux-2.6.18-xen_ia64
     # mkinitrd -f /boot/efi/efi/redhat/initrd-2.6.18.8-xen.img \
       2.6.18.8-xen --builtin mptspi --builtin mptbase \
       --builtin mptscsih --builtin uhci-hcd --builtin ohci-hcd \
Makefile +1 -1
index 3a8868ee967e..a3eed17080b0 100644
@@ -132,7 +132,7 @@ ifneq ($(KBUILD_OUTPUT),)
 # check that the output directory actually exists
 saved-output := $(KBUILD_OUTPUT)
 KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
-                                                               && /bin/pwd)
+                                                               && pwd)
 $(if $(KBUILD_OUTPUT),, \
      $(error failed to create output directory "$(saved-output)"))
 
tools/power/cpupower/Makefile +1 -1
index d6e1c02ddcfe..c76b971d0423 100644
@@ -26,7 +26,7 @@ endif
 
 ifneq ($(OUTPUT),)
 # check that the output directory actually exists
-OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
+OUTDIR := $(shell cd $(OUTPUT) && pwd)
 $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
 endif
 
tools/scripts/Makefile.include +0 -0
index 654efd9768fd..3fab179b1aba 100644

tools/scripts/Makefile.include endif · line 18

Quoted 7 lines
tools/scripts/Makefile.include +1 -1
@@ -13,7 +13,7 @@ endif
 
 # check that the output directory actually exists
 ifneq ($(OUTPUT),)
-OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
+OUTDIR := $(shell cd $(OUTPUT) && pwd)
 $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
 endif

Applied to linux-kbuild/kbuild. Thanks!

I will try my best to push this in the current MW.

Signature · 2 lines
Best Regards
Masahiro Yamada