pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH] mksandbox fix for OS X Yosemite new kernel location



Hello.

I just tried mksandbox on OS X Yosemite (10.10, Darwin 14), and it seems
to work, but there's an error message in the output:

===
Copying the kernel
cp: /mach_kernel: No such file or directory
===

This is because on Yosemite the kernel is no longer at /mach_kernel,
it's now at /System/Library/Kernels/kernel.  Below is a patch that
just conditionally sets the "kernel" variable if /mach_kernel exists.
This will result in the kernel being copied as before if it exists
at /mach_kernel, but it will not be copied if it doesn't exist at
/mach_kernel.  In other words, it will not be copied on Yosemite.

I don't know why the kernel needs to be copied on OS X in the first
place.  Was this done just to be like the other supported platforms, and
it was easy to do?  Or was it done because it was really needed?  If the
kernel really does need to be copied, then the below patch won't solve
the problem on OS X Yosemite.  However, it would be trivial to make a
new patch that does copy the kernel from the new location to wherever it
should go in the sandbox (presumably /System/Library/Kernels/kernel).
I'd be happy to provide such a patch if that would be helpful.

Regards,

Lewis

Index: files/mksandbox
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/mksandbox/files/mksandbox,v
retrieving revision 1.6
diff -u -r1.6 mksandbox
--- files/mksandbox	24 Jul 2013 22:16:26 -0000	1.6
+++ files/mksandbox	12 Mar 2015 01:18:39 -0000
@@ -74,7 +74,9 @@
 	cpprog=/bin/cp
 	gtarprog=/usr/bin/gnutar
 	idprog=/usr/bin/id
-	kernel=/mach_kernel
+	if [ -f /mach_kernel ]; then
+		kernel=/mach_kernel
+	fi
 	mkdirprog="/bin/mkdir -p"
 	mountflags="-t nfs"
 	mounthost="localhost"


Home | Main Index | Thread Index | Old Index