From b643316a4275dccb4db7faca9115fb2e1bca8cfc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 18 Dec 2012 16:57:11 +0100 Subject: VM builds: Use BusyBox http://hydra.nixos.org/build/3510928 --- pkgs/build-support/vm/default.nix | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) (limited to 'pkgs/build-support') 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 ''; -- cgit 1.4.1