Last active
October 22, 2015 10:25
-
-
Save cleverca22/5894b0de7438a0cfcfdf to your computer and use it in GitHub Desktop.
qemu-user setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
packageOverrides = pkgs: rec { | |
qemu-user-arm = pkgs.callPackage ./qemu-user.nix { user_arch = "arm"; }; | |
nix = pkgs.stdenv.lib.overrideDerivation pkgs.nix (oldAttrs: { | |
patches = ./hax.patch; | |
}); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r -u nix-1.10-old/src/libstore/build.cc nix-1.10/src/libstore/build.cc | |
--- nix-1.10-old/src/libstore/build.cc 2015-09-03 13:52:06.000000000 -0300 | |
+++ nix-1.10/src/libstore/build.cc 2015-10-14 02:51:19.910899012 -0300 | |
@@ -1247,11 +1247,7 @@ | |
static bool canBuildLocally(const string & platform) | |
{ | |
- return platform == settings.thisSystem | |
-#if __linux__ | |
- || (platform == "i686-linux" && settings.thisSystem == "x86_64-linux") | |
-#endif | |
- ; | |
+ return true; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, fetchurl, python, pkgconfig, zlib, glib, user_arch, flex, bison }: | |
stdenv.mkDerivation rec { | |
name = "qemu-user-${user_arch}-${version}"; | |
version = "2.4.0"; | |
buildInputs = [ python pkgconfig zlib glib flex bison ]; | |
src = fetchurl { | |
url = "http://wiki.qemu.org/download/qemu-${version}.tar.bz2"; | |
sha256 = "0836gqv5zcl0xswwjcns3mlkn18lyz2fiq8rl1ihcm6cpf8vkc3j"; | |
}; | |
configureFlags = [ | |
"--enable-linux-user" "--target-list=${user_arch}-linux-user" | |
"--disable-bsd-user" "--disable-system" "--disable-vnc" "--without-pixman" | |
"--disable-vnc-tls" "--disable-curses" "--disable-sdl" "--disable-vde" | |
"--disable-bluez" "--disable-kvm" | |
#"--static" | |
"--disable-tools" | |
]; | |
} | |
# mount -v -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc/ | |
# echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x00\xff\xfe\xff\xff\xff:/nix/store/6lmqyaj2cijpw9qylyw6kll8vxzrngpq-qemu-user-arm-2.4.0/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment