about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/busybox/busybox-in-store.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/busybox/busybox-in-store.patch')
-rw-r--r--pkgs/os-specific/linux/busybox/busybox-in-store.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/busybox/busybox-in-store.patch b/pkgs/os-specific/linux/busybox/busybox-in-store.patch
new file mode 100644
index 000000000000..ea245a49259b
--- /dev/null
+++ b/pkgs/os-specific/linux/busybox/busybox-in-store.patch
@@ -0,0 +1,16 @@
+Allow BusyBox to be invoked as "<something>-busybox". This is
+necessary when it's run from the Nix store as <hash>-busybox during
+stdenv bootstrap.
+
+diff -ru -x '*~' busybox-1.22.1-orig/libbb/appletlib.c busybox-1.22.1/libbb/appletlib.c
+--- busybox-1.22.1-orig/libbb/appletlib.c	2014-01-09 19:15:44.000000000 +0100
++++ busybox-1.22.1/libbb/appletlib.c	2014-10-29 09:53:01.232052068 +0100
+@@ -764,7 +764,7 @@
+ 	int applet = find_applet_by_name(name);
+ 	if (applet >= 0)
+ 		run_applet_no_and_exit(applet, argv);
+-	if (strncmp(name, "busybox", 7) == 0)
++	if (strstr(name, "busybox") != 0)
+ 		exit(busybox_main(argv));
+ }
+