Skip to contentSkip to conversation

package/dhcp: fix installation with BR2_STATIC_LIBS=y

PATCH Superseded unixmania at gmail.com 2 participants 3 messages Aug 9, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/dhcp: fix installation with BR2_STATIC_LIBS=y

From: Carlos Santos <[email protected]>

Use the "install-sbinPROGRAMS" make target to install the utilities instead of guessing their locations. We disable libtool for static builds so the binaries are not always in a ".libs" subdir.

Fixes:
http://autobuild.buildroot.net/results/0c43c02b8d418b60b4734187abde1da585e9e0ca/
http://autobuild.buildroot.net/results/e61b246df60af1e59b8f643510557ef2270f2d97/

---
 package/dhcp/dhcp.mk | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
package/dhcp/dhcp.mk +4 -5
index 5f56c86414..0abb0aebd7 100644
@@ -52,7 +52,7 @@ endef
 define DHCP_INSTALL_SERVER
 	mkdir -p $(TARGET_DIR)/var/lib
 	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
-	$(INSTALL) -m 0755 -D $(@D)/server/.libs/dhcpd $(TARGET_DIR)/usr/sbin/dhcpd
+	$(MAKE) -C $(@D)/server DESTDIR=$(TARGET_DIR) install-sbinPROGRAMS
 	$(INSTALL) -m 0644 -D package/dhcp/dhcpd.conf \
 		$(TARGET_DIR)/etc/dhcp/dhcpd.conf
 endef
@@ -62,8 +62,7 @@ ifeq ($(BR2_PACKAGE_DHCP_RELAY),y)
 define DHCP_INSTALL_RELAY
 	mkdir -p $(TARGET_DIR)/var/lib
 	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
-	$(INSTALL) -m 0755 -D $(DHCP_DIR)/relay/.libs/dhcrelay \
-		$(TARGET_DIR)/usr/sbin/dhcrelay
+	$(MAKE) -C $(@D)/relay DESTDIR=$(TARGET_DIR) install-sbinPROGRAMS
 endef
 endif
 
@@ -71,8 +70,8 @@ ifeq ($(BR2_PACKAGE_DHCP_CLIENT),y)
 define DHCP_INSTALL_CLIENT
 	mkdir -p $(TARGET_DIR)/var/lib
 	(cd $(TARGET_DIR)/var/lib; ln -snf /tmp dhcp)
-	$(INSTALL) -m 0755 -D $(DHCP_DIR)/client/.libs/dhclient \
-		$(TARGET_DIR)/sbin/dhclient
+	$(MAKE) -C $(@D)/client DESTDIR=$(TARGET_DIR) sbindir=/sbin \
+		install-sbinPROGRAMS
 	$(INSTALL) -m 0644 -D package/dhcp/dhclient.conf \
 		$(TARGET_DIR)/etc/dhcp/dhclient.conf
 	$(INSTALL) -m 0755 -D package/dhcp/dhclient-script \
Signature · 1 line
2.18.1
#1 lore raw

PATCH v2 1/1 package/dhcp: fix installation with BR2_STATIC_LIBS=y

Hello,

Quoted 6 lines · On Fri, 9 Aug 2019 09:05:44 -0300 unixmania at gmail.com wrote:

From: Carlos Santos <[email protected]>

Use the "install-sbinPROGRAMS" make target to install the utilities instead of guessing their locations. We disable libtool for static builds so the binaries are not always in a ".libs" subdir.

Quoted 8 lines

Fixes:
http://autobuild.buildroot.net/results/0c43c02b8d418b60b4734187abde1da585e9e0ca/
http://autobuild.buildroot.net/results/e61b246df60af1e59b8f643510557ef2270f2d97/

---
 package/dhcp/dhcp.mk | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Applied to master, thanks. It is worth mentioning that dhcp installs a dangling symlink:

$ ls -l output/target/usr/sbin/
total 344
-rwxr-xr-x 1 thomas thomas 321496  9 ao?t  22:53 dhcpd
-rwxr-xr-x 1 thomas thomas  26064  9 ao?t  22:53 dhcrelay
lrwxrwxrwx 1 thomas thomas     12  9 ao?t  22:52 tsig-keygen -> ddns-confgen

ddns-confgen is not installed, so tsig-keygen doesn't point to anything.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH v2 1/1 package/dhcp: fix installation with BR2_STATIC_LIBS=y

Quoted 30 lines · Thomas Petazzoni

Hello,

Quoted 6 lines · On Fri, 9 Aug 2019 09:05:44 -0300 unixmania at gmail.com wrote:

From: Carlos Santos <[email protected]>

Use the "install-sbinPROGRAMS" make target to install the utilities instead of guessing their locations. We disable libtool for static builds so the binaries are not always in a ".libs" subdir.

Quoted 8 lines

Fixes:
http://autobuild.buildroot.net/results/0c43c02b8d418b60b4734187abde1da585e9e0ca/
http://autobuild.buildroot.net/results/e61b246df60af1e59b8f643510557ef2270f2d97/

---
 package/dhcp/dhcp.mk | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Applied to master, thanks. It is worth mentioning that dhcp installs a dangling symlink:

$ ls -l output/target/usr/sbin/
total 344
(quoted diff) +0 -2
-rwxr-xr-x 1 thomas thomas 321496  9 ao?t  22:53 dhcpd
-rwxr-xr-x 1 thomas thomas  26064  9 ao?t  22:53 dhcrelay

lrwxrwxrwx 1 thomas thomas 12 9 ao?t 22:52 tsig-keygen -> ddns-confgen

Quoted 3 lines

ddns-confgen is not installed, so tsig-keygen doesn't point to anything.

Best regards,

Nope, that one belongs to bind, not to dhcp:

$ fgrep tsig-keygen build/packages-file-list.txt
bind,./usr/sbin/tsig-keygen
bind,./usr/share/man/man8/tsig-keygen.8

I will take a look and submit a fix.

Signature · 1 line
Carlos Santos <[email protected]>