Przeglądaj źródła

package/dracut: use host-cross-ldd instead of host-prelink-cross

This commit reworks the dracut package to use the cross-ldd installed
by host-cross-ldd instead of prelink-rtld installed by
host-prelink-cross.

Indeed, prelink-cross is not maintained upstream, and its dependency
on host-libiberty causes problems in Buildroot with other packages.

The only change needed is that the dracut_wrapper script needs to be
generated, as we now need to know the prefix of the cross-compilation
tool (TARGET_CROSS).

Tested by running the dracut tests of the test suite.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Thomas Petazzoni 6 miesięcy temu
rodzic
commit
b171b7bd78
2 zmienionych plików z 6 dodań i 4 usunięć
  1. 5 3
      package/dracut/dracut.mk
  2. 1 1
      package/dracut/dracut_wrapper.in

+ 5 - 3
package/dracut/dracut.mk

@@ -10,12 +10,14 @@ DRACUT_LICENSE = GPL-2.0
 DRACUT_LICENSE_FILES = COPYING
 DRACUT_LICENSE_FILES = COPYING
 DRACUT_CPE_ID_VALID = YES
 DRACUT_CPE_ID_VALID = YES
 
 
-HOST_DRACUT_DEPENDENCIES = host-pkgconf host-kmod host-prelink-cross
+HOST_DRACUT_DEPENDENCIES = host-pkgconf host-kmod host-cross-ldd
 
 
 define HOST_DRACUT_POST_INSTALL_WRAPPER_SCRIPT
 define HOST_DRACUT_POST_INSTALL_WRAPPER_SCRIPT
 	mv $(HOST_DIR)/bin/dracut $(HOST_DIR)/bin/dracut.real
 	mv $(HOST_DIR)/bin/dracut $(HOST_DIR)/bin/dracut.real
-	install -D -m 0755 $(HOST_DRACUT_PKGDIR)/dracut_wrapper \
-		$(HOST_DIR)/bin/dracut
+	sed -e "s%@@TARGET_CROSS@@%$(TARGET_CROSS)%" \
+		$(HOST_DRACUT_PKGDIR)/dracut_wrapper.in > \
+		$(@D)/dracut_wrapper
+	install -D -m 0755 $(@D)/dracut_wrapper $(HOST_DIR)/bin/dracut
 endef
 endef
 HOST_DRACUT_POST_INSTALL_HOOKS += HOST_DRACUT_POST_INSTALL_WRAPPER_SCRIPT
 HOST_DRACUT_POST_INSTALL_HOOKS += HOST_DRACUT_POST_INSTALL_WRAPPER_SCRIPT
 
 

+ 1 - 1
package/dracut/dracut_wrapper → package/dracut/dracut_wrapper.in

@@ -34,7 +34,7 @@ topdir="$(dirname "$(realpath "$(dirname "${0}")")")"
 DRACUT_LDD="$(mktemp /tmp/dracut-ldd.XXXXXX)"
 DRACUT_LDD="$(mktemp /tmp/dracut-ldd.XXXXXX)"
 cat >"${DRACUT_LDD}" <<EOL
 cat >"${DRACUT_LDD}" <<EOL
 #!/bin/bash
 #!/bin/bash
-${topdir}/sbin/prelink-rtld --root='${sysroot}' \${1}
+@@TARGET_CROSS@@xldd --root='${sysroot}' \${1}
 EOL
 EOL
 chmod +x "${DRACUT_LDD}"
 chmod +x "${DRACUT_LDD}"
 export DRACUT_LDD
 export DRACUT_LDD