Skip to contentSkip to conversation

lockdev: Fix TARGET_DIR link

PATCH New Bernd Kuhls 3 participants 3 messages Dec 29, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lockdev: Fix TARGET_DIR link

---
 package/lockdev/lockdev.mk |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/lockdev/lockdev.mk +1 -1
index 004b637..0c10341 100644
@@ -34,7 +34,7 @@ endef
 
 define LOCKDEV_INSTALL_TARGET_CMDS
 	$(MAKE1) basedir=$(TARGET_DIR)/usr -C $(@D) install_run
-	ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so.1
+	ln -sf liblockdev.$(LOCKDEV_VERSION).so $(TARGET_DIR)/usr/lib/liblockdev.so.1
 endef
 endif # BR2_PREFER_STATIC_LIB
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 lockdev: Fix TARGET_DIR link

Bernd, All,

On 2013-12-29 18:31 +0100, Bernd Kuhls spake thusly:

Quoted 11 lines
---
 package/lockdev/lockdev.mk |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/lockdev/lockdev.mk +0 -0
index 004b637..0c10341 100644

package/lockdev/lockdev.mk endef · line 37

Quoted 5 lines
package/lockdev/lockdev.mk +1 -1
@@ -34,7 +34,7 @@ endef
 
 define LOCKDEV_INSTALL_TARGET_CMDS
 	$(MAKE1) basedir=$(TARGET_DIR)/usr -C $(@D) install_run
-	ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so.1
+	ln -sf liblockdev.$(LOCKDEV_VERSION).so $(TARGET_DIR)/usr/lib/liblockdev.so.1

The .so symlink is not required at runtime, so we do not even have to install it in the first place. All we need is a library which filename is the same as its SONAME.

So, if the SONAME is liblockdev.so.1, just rename the library to .so.1. If the SONAME is liblockdev.so, just rename the library to .so. If the library is already installed with the correct filename, no need to rename it.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 lockdev: Fix TARGET_DIR link

Dear Yann E. MORIN,

Quoted 9 lines · Yann E. MORIN

package/lockdev/lockdev.mk endef · line 37

Quoted 4 lines

define LOCKDEV_INSTALL_TARGET_CMDS

package/lockdev/lockdev.mk +1 -1
 	$(MAKE1) basedir=$(TARGET_DIR)/usr -C $(@D) install_run
-	ln -sf liblockdev.$(LOCKDEV_VERSION).so $(STAGING_DIR)/usr/lib/liblockdev.so.1
+	ln -sf liblockdev.$(LOCKDEV_VERSION).so $(TARGET_DIR)/usr/lib/liblockdev.so.1

The .so symlink is not required at runtime, so we do not even have to install it in the first place. All we need is a library which filename is the same as its SONAME.

Quoted 4 lines

So, if the SONAME is liblockdev.so.1, just rename the library to .so.1. If the SONAME is liblockdev.so, just rename the library to .so. If the library is already installed with the correct filename, no need to rename it.

I've applied the patch, because nowhere in Buildroot we rename libraries so that they have as filename their SONAME. Therefore, doing this specifically for liblockdev would be inconsistent with what we do all over Buildroot.

The SONAME of this library is indeed liblockdev.so.1, so this symbolic link is needed.

Note that liblockdev.$(LOCKDEV_VERSION).so is *NOT* a symbolic link. It is the library itself. liblockdev is a bit non-standard: instead of having its real library binary named liblockdev.so.<version>, it is named liblockdev.<version>.so. And the liblockdev.so.1 symbolic link is needed to ensure that there is something matching the SONAME of the library, as explained above.

Best regards,

Thomas

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