mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-01 21:23:51 -09:00
The host-mkpasswd package needs the <crypt.h> header file installed
on the host. This file was initially provided by the libc headers,
as part of its libcrypt implementation. libcrypt was removed in
glibc 2.39. Most Linux distributions continued to ship a libcrypt
replacement such as libxcrypt in their default installation.
Some mainstream Linux distribution (such as Debian testing) are
now starting to remove this libcrypt and <crypt.h> header from their
default image (of development files).
In that case, host-mkpasswd is failing to build with the error:
/buildroot/output/build/host-mkpasswd/mkpasswd.c:54:10: fatal error: crypt.h: No such file or directory
The issue can be reproduced by adapting the Buildroot Docker file,
by setting "FROM debian:testing-20260316" in [1] and removing
the build of tar.
Note: debian 13 (for example Docker tag trixie-20260316) still
includes the libcrypt-dev package by default, which provides crypt.h.
In Buildroot, there is already the host-heimdal and host-systemd
packages requiring host-libxcrypt. Also, the host-libxcrypt is a
small standalone package. For those reasons, instead of adding
the Buildroot prerequisite on the user host to provide a libcrypt
implementation, this commit simply add the package dependency to
host-libxcrypt, to make sure it will work in all situations.
[1] https://gitlab.com/buildroot.org/buildroot/-/blob/2026.02/support/docker/Dockerfile#L11
Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
31 lines
828 B
Makefile
31 lines
828 B
Makefile
################################################################################
|
|
#
|
|
# mkpasswd
|
|
#
|
|
################################################################################
|
|
|
|
# source included in buildroot, taken from
|
|
# https://github.com/rfc1036/whois/blob/master/
|
|
# at revision 5a0f08500fa51608b6d3b73ee338be38c692eadb
|
|
HOST_MKPASSWD_LICENSE = GPL-2.0+
|
|
|
|
HOST_MKPASSWD_DEPENDENCIES = host-libxcrypt
|
|
|
|
define HOST_MKPASSWD_EXTRACT_CMDS
|
|
cp $(HOST_MKPASSWD_PKGDIR)/*.c $(HOST_MKPASSWD_PKGDIR)/*.h $(@D)
|
|
endef
|
|
|
|
define HOST_MKPASSWD_BUILD_CMDS
|
|
$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
|
|
$(@D)/mkpasswd.c $(@D)/utils.c \
|
|
-o $(@D)/mkpasswd -lcrypt
|
|
endef
|
|
|
|
define HOST_MKPASSWD_INSTALL_CMDS
|
|
$(INSTALL) -D -m 755 $(@D)/mkpasswd $(HOST_DIR)/bin/mkpasswd
|
|
endef
|
|
|
|
$(eval $(host-generic-package))
|
|
|
|
MKPASSWD = $(HOST_DIR)/bin/mkpasswd
|