diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-12-18 16:57:11 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-12-18 16:57:11 +0100 |
commit | b643316a4275dccb4db7faca9115fb2e1bca8cfc (patch) | |
tree | 4b030df9e51dda73178292481359cc32670b3634 /pkgs | |
parent | 7503291ff99dab60e7d2bed89b1927f7b91b6238 (diff) | |
download | nixlib-b643316a4275dccb4db7faca9115fb2e1bca8cfc.tar nixlib-b643316a4275dccb4db7faca9115fb2e1bca8cfc.tar.gz nixlib-b643316a4275dccb4db7faca9115fb2e1bca8cfc.tar.bz2 nixlib-b643316a4275dccb4db7faca9115fb2e1bca8cfc.tar.lz nixlib-b643316a4275dccb4db7faca9115fb2e1bca8cfc.tar.xz nixlib-b643316a4275dccb4db7faca9115fb2e1bca8cfc.tar.zst nixlib-b643316a4275dccb4db7faca9115fb2e1bca8cfc.zip |
VM builds: Use BusyBox
http://hydra.nixos.org/build/3510928
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/vm/default.nix | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 1a4560805538..9d9bdb2033e3 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -38,35 +38,19 @@ rec { # Copy what we need from Glibc. cp -p ${pkgs.stdenv.glibc}/lib/ld-linux*.so.? $out/lib cp -p ${pkgs.stdenv.glibc}/lib/libc.so.* $out/lib - cp -p ${pkgs.stdenv.glibc}/lib/librt.so.* $out/lib - cp -p ${pkgs.stdenv.glibc}/lib/libdl.so.* $out/lib - - # Copy some utillinux stuff. - cp ${utillinux}/bin/mount ${utillinux}/bin/umount $out/bin - cp -pd ${utillinux}/lib/libblkid*.so.* $out/lib - cp -pd ${utillinux}/lib/libuuid*.so.* $out/lib - - # Copy some coreutils. - cp ${coreutils}/bin/basename $out/bin - cp ${coreutils}/bin/mkdir $out/bin - cp ${coreutils}/bin/mknod $out/bin - cp ${coreutils}/bin/cat $out/bin - cp ${coreutils}/bin/chroot $out/bin - cp ${coreutils}/bin/sleep $out/bin - cp ${coreutils}/bin/ln $out/bin - - # Copy some other tools. - cp ${bash}/bin/bash $out/bin - cp ${module_init_tools}/sbin/insmod $out/bin/insmod - cp ${nettools}/sbin/ifconfig $out/bin - cp ${sysvinit}/sbin/halt $out/bin + cp -p ${pkgs.stdenv.glibc}/lib/libm.so.* $out/lib + + # Copy BusyBox. + cp -pd ${pkgs.busybox}/bin/* ${pkgs.busybox}/sbin/* $out/bin # Run patchelf to make the programs refer to the copied libraries. for i in $out/bin/* $out/lib/*; do if ! test -L $i; then nuke-refs $i; fi; done for i in $out/bin/*; do - echo "patching $i..." - patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib $i || true + if [ -f "$i" -a ! -L "$i" ]; then + echo "patching $i..." + patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib $i || true + fi done ''; # */ @@ -84,8 +68,7 @@ rec { stage1Init = writeScript "vm-run-stage1" '' - #! ${initrdUtils}/bin/bash -e - echo START + #! ${initrdUtils}/bin/ash -e export PATH=${initrdUtils}/bin @@ -167,8 +150,7 @@ rec { mount -o remount,ro dummy /fs - echo DONE - halt -d -p -f + poweroff -f ''; |