From cd4b5e1a35863f7c79c47c8dc874b23b423f71f8 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 29 Jul 2013 07:33:58 +0200 Subject: fillDiskWithDebs: Create fake start-stop-daemon. This is needed in order to prevent services from starting while populating the image with the contents of the .deb files. The procedure used here is exactly the same as used in debootstrap. Signed-off-by: aszlig --- pkgs/build-support/vm/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkgs/build-support/vm') diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 987da5585195..063341ce1d7b 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -599,8 +599,17 @@ rec { debs="$debs /inst/$i"; done chroot=$(type -tP chroot) + + # Create a fake start-stop-daemon script, as done in debootstrap. + mv "/mnt/sbin/start-stop-daemon" "/mnt/sbin/start-stop-daemon.REAL" + echo "#!/bin/true" > "/mnt/sbin/start-stop-daemon" + chmod 755 "/mnt/sbin/start-stop-daemon" + PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \ /usr/bin/dpkg --install --force-all $debs < /dev/null || true + + # Move the real start-stop-daemon back into its place. + mv "/mnt/sbin/start-stop-daemon.REAL" "/mnt/sbin/start-stop-daemon" done echo "running post-install script..." -- cgit 1.4.1