Skip to contentSkip to conversation

support/testing: remove references to host/usr

PATCH New Arnout Vandecappelle (Essensium/Mind) 3 participants 5 messages Jul 5, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 support/testing: remove references to host/usr

The tools are now installed in host/bin instead of host/usr/bin.

---
 support/testing/tests/fs/test_ext.py      | 2 +-
 support/testing/tests/fs/test_jffs2.py    | 2 +-
 support/testing/tests/fs/test_squashfs.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
support/testing/tests/fs/test_ext.py +1 -1
index ea3d3f11d7..34321a3995 100644
@@ -13,7 +13,7 @@ RESBLKCNT_PROP = "Reserved block count"
 CHECK_FS_TYPE_CMD = "mount | grep '/dev/root on / type {}'"
 
 def dumpe2fs_run(builddir, image):
-    cmd = ["host/usr/sbin/dumpe2fs", os.path.join("images", image)]
+    cmd = ["host/sbin/dumpe2fs", os.path.join("images", image)]
     ret = subprocess.check_output(cmd,
                                   stderr=open(os.devnull, "w"),
                                   cwd=builddir,
support/testing/tests/fs/test_jffs2.py +1 -1
index 0d45af209b..7185df7899 100644
@@ -28,7 +28,7 @@ BR2_TARGET_ROOTFS_JFFS2_PADSIZE=0x4000000
 
     def test_run(self):
         img = os.path.join(self.builddir, "images", "rootfs.jffs2")
-        out = subprocess.check_output(["host/usr/sbin/jffs2dump", "-c", img],
+        out = subprocess.check_output(["host/sbin/jffs2dump", "-c", img],
                                       cwd=self.builddir,
                                       env={"LANG": "C"})
         out = out.splitlines()
support/testing/tests/fs/test_squashfs.py +1 -1
index edaa087106..b205b6a55a 100644
@@ -13,7 +13,7 @@ BR2_TARGET_ROOTFS_SQUASHFS4_LZ4=y
 """
 
     def test_run(self):
-        unsquashfs_cmd = ["host/usr/bin/unsquashfs", "-s", "images/rootfs.squashfs"]
+        unsquashfs_cmd = ["host/bin/unsquashfs", "-s", "images/rootfs.squashfs"]
         out = subprocess.check_output(unsquashfs_cmd,
                                       cwd=self.builddir,
                                       env={"LANG": "C"})
Signature · 1 line
2.13.2
#1 lore raw

PATCH 2/3 check-host-rpath: no longer allow $(HOST_DIR)/usr

Now all packages have been updated to install things in $(HOST_DIR)/lib instead of $(HOST_DIR)/usr/lib, there should no longer be any reason to have $(HOST_DIR)/usr/lib in the RPATH, so we don't allow it any more.

---
 support/scripts/check-host-rpath | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
support/scripts/check-host-rpath +1 -3
index 2846d5eb51..74a25ba99c 100755
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
 # This script scans $(HOST_DIR)/{bin,sbin} for all ELF files, and checks
-# they have an RPATH to $(HOST_DIR)/{,usr/}lib if they need libraries from
+# they have an RPATH to $(HOST_DIR)/lib if they need libraries from
 # there.
 
 # Override the user's locale so we are sure we can parse the output of
@@ -59,8 +59,6 @@ check_elf_has_rpath() {
             # Remove duplicate and trailing '/' for proper match
             dir="$( sed -r -e 's:/+:/:g; s:/$::;' <<<"${dir}" )"
             [ "${dir}" = "${hostdir}/lib" -o "${dir}" = "\$ORIGIN/../lib" ] && return 0
-            # For the time being, the rpath is allowed with both usr/lib and lib
-            [ "${dir}" = "${hostdir}/usr/lib" -o "${dir}" = "\$ORIGIN/../../usr/lib" ] && return 0
         done
     done < <( readelf -d "${file}"                                              \
               |sed -r -e '/.* \(R(UN)?PATH\) +Library r(un)?path: \[(.+)\]$/!d' \
Signature · 1 line
2.13.2
#2 lore raw

PATCH 2/3 check-host-rpath: no longer allow $(HOST_DIR)/usr

Hallo,

Am 05.07.2017 um 14:09 schrieb Arnout Vandecappelle (Essensium/Mind):

Quoted 25 lines

Now all packages have been updated to install things in $(HOST_DIR)/lib instead of $(HOST_DIR)/usr/lib, there should no longer be any reason to have $(HOST_DIR)/usr/lib in the RPATH, so we don't allow it any more.

---
  support/scripts/check-host-rpath | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
support/scripts/check-host-rpath +1 -1
index 2846d5eb51..74a25ba99c 100755
@@ -1,7 +1,7 @@
  #!/usr/bin/env bash
 
  # This script scans $(HOST_DIR)/{bin,sbin} for all ELF files, and checks
-# they have an RPATH to $(HOST_DIR)/{,usr/}lib if they need libraries from
+# they have an RPATH to $(HOST_DIR)/lib if they need libraries from
  # there.
 
  # Override the user's locale so we are sure we can parse the output of

support/scripts/check-host-rpath check_elf_has_rpath() { · line 64

Quoted 8 lines
support/scripts/check-host-rpath +0 -2
@@ -59,8 +59,6 @@ check_elf_has_rpath() {
              # Remove duplicate and trailing '/' for proper match
              dir="$( sed -r -e 's:/+:/:g; s:/$::;' <<<"${dir}" )"
              [ "${dir}" = "${hostdir}/lib" -o "${dir}" = "\$ORIGIN/../lib" ] && return 0
-            # For the time being, the rpath is allowed with both usr/lib and lib
-            [ "${dir}" = "${hostdir}/usr/lib" -o "${dir}" = "\$ORIGIN/../../usr/lib" ] && return 0
          done
      done < <( readelf -d "${file}"                                              \
                |sed -r -e '/.* \(R(UN)?PATH\) +Library r(un)?path: \[(.+)\]$/!d' \

Looks good. Also ORIGIN/../lib is correct now. Going through my series to handle "usr" removal properly.

Wolfgang.

#3 lore raw

PATCH 3/3 CHANGES: update with removal of $(HOST_DIR)/usr

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 CHANGES | 7 +++++++
 1 file changed, 7 insertions(+)
CHANGES +7 -0
index 105c9318f4..a530e8fb45 100644
@@ -17,6 +17,13 @@
 	Therefore, if you need NLS support in packages, you must now
 	explicitly enable the BR2_SYSTEM_ENABLE_NLS option.
 
+	Infrastructure:
+
+	- The host directory no longer has a usr/ component. This
+	  makes it much more natural to use that directory as an
+	  externally used toolchain. For compatibility with existing
+	  scripts, a link usr -> . is still added.
+
 2017.05.1, Released July 4th, 2017
 
 	Important / security related fixes.
Signature · 1 line
2.13.2
#4 lore raw

PATCH 1/3 support/testing: remove references to host/usr

In reply to Arnout Vandecappelle (Essensium/Mind)

Hello,

Quoted 8 lines · Arnout Vandecappelle (Essensium/Mind)

The tools are now installed in host/bin instead of host/usr/bin.

---
 support/testing/tests/fs/test_ext.py      | 2 +-
 support/testing/tests/fs/test_jffs2.py    | 2 +-
 support/testing/tests/fs/test_squashfs.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Series applied to master. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com