diff options
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/busybox/default.nix')
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/busybox/default.nix | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/busybox/default.nix b/nixpkgs/pkgs/os-specific/linux/busybox/default.nix index 430066831b8..599754129b4 100644 --- a/nixpkgs/pkgs/os-specific/linux/busybox/default.nix +++ b/nixpkgs/pkgs/os-specific/linux/busybox/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, buildPackages, fetchurl +{ stdenv, lib, buildPackages, fetchurl, fetchFromGitLab , enableStatic ? false , enableMinimal ? false # Allow forcing musl without switching stdenv itself, e.g. for our bootstrapping: @@ -31,9 +31,26 @@ let CONFIG_FEATURE_UTMP n CONFIG_FEATURE_WTMP n ''; + + # The debian version lacks behind the upstream version and also contains + # a debian-specific suffix. We only fetch the debian repository to get the + # default.script + debianVersion = "1.30.1-6"; + debianSource = fetchFromGitLab { + domain = "salsa.debian.org"; + owner = "installer-team"; + repo = "busybox"; + rev = "debian/1%${debianVersion}"; + sha256 = "sha256-6r0RXtmqGXtJbvLSD1Ma1xpqR8oXL2bBKaUE/cSENL8="; + }; + debianDispatcherScript = "${debianSource}/debian/tree/udhcpc/etc/udhcpc/default.script"; + outDispatchPath = "$out/default.script"; in stdenv.mkDerivation rec { + # TODO: When bumping this version, please validate whether the wget patch is present upstream + # and remove the patch if it is. The patch should be present upstream for all versions 1.32.0+. + # See NixOs/nixpkgs#94722 for context. name = "busybox-1.31.1"; # Note to whoever is updating busybox: please verify that: @@ -49,6 +66,8 @@ stdenv.mkDerivation rec { patches = [ ./busybox-in-store.patch + ./0001-Fix-build-with-glibc-2.31.patch + ./0001-wget-implement-TLS-verification-with-ENABLE_FEATURE_.patch ] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./clang-cross.patch; postPatch = "patchShebangs ."; @@ -80,6 +99,9 @@ stdenv.mkDerivation rec { # Bump from 4KB, much faster I/O CONFIG_FEATURE_COPYBUF_KB 64 + # Set the path for the udhcpc script + CONFIG_UDHCPC_DEFAULT_SCRIPT "${outDispatchPath}" + ${extraConfig} CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cc.targetPrefix}" ${libcConfig} @@ -94,6 +116,15 @@ stdenv.mkDerivation rec { makeFlagsArray+=("CC=${stdenv.cc.targetPrefix}cc -isystem ${musl.dev}/include -B${musl}/lib -L${musl}/lib") ''; + postInstall = '' + sed -e ' + 1 a busybox() { '$out'/bin/busybox "$@"; }\ + logger() { '$out'/bin/logger "$@"; }\ + ' ${debianDispatcherScript} > ${outDispatchPath} + chmod 555 ${outDispatchPath} + PATH=$out/bin patchShebangs ${outDispatchPath} + ''; + depsBuildBuild = [ buildPackages.stdenv.cc ]; buildInputs = lib.optionals (enableStatic && !useMusl && stdenv.cc.libc ? static) [ stdenv.cc.libc stdenv.cc.libc.static ]; @@ -106,7 +137,7 @@ stdenv.mkDerivation rec { description = "Tiny versions of common UNIX utilities in a single small executable"; homepage = "https://busybox.net/"; license = licenses.gpl2; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ TethysSvensson ]; platforms = platforms.linux; priority = 10; }; |