2010-06-14 01:49:16 +02:00
|
|
|
{ pkgs }:
|
2008-03-17 18:29:07 +01:00
|
|
|
|
|
|
|
with pkgs;
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
rec {
|
|
|
|
|
|
|
|
|
2009-12-22 10:23:17 +01:00
|
|
|
inherit (linuxPackages_2_6_32) kernel;
|
2008-05-26 15:30:17 +02:00
|
|
|
|
2010-06-14 01:49:16 +02:00
|
|
|
kvm = pkgs.qemu_kvm;
|
2009-09-23 16:24:37 +02:00
|
|
|
|
2008-05-26 15:30:17 +02:00
|
|
|
|
2008-03-17 11:40:47 +01:00
|
|
|
modulesClosure = makeModulesClosure {
|
|
|
|
inherit kernel;
|
2010-06-14 01:49:16 +02:00
|
|
|
rootModules = [ "cifs" "virtio_net" "virtio_pci" "virtio_blk" "virtio_balloon" "nls_utf8" "ext2" "ext3" "unix" "sd_mod" "ata_piix" ];
|
2008-03-14 14:51:01 +01:00
|
|
|
};
|
|
|
|
|
2009-04-09 10:12:16 +02:00
|
|
|
|
2010-06-14 01:49:16 +02:00
|
|
|
hd = "vda"; # either "sda" or "vda"
|
|
|
|
|
|
|
|
|
2010-06-10 14:28:04 +02:00
|
|
|
initrdUtils = runCommand "initrd-utils"
|
|
|
|
{ buildInputs = [ nukeReferences ];
|
|
|
|
allowedReferences = [ "out" modulesClosure ]; # prevent accidents like glibc being included in the initrd
|
|
|
|
}
|
|
|
|
''
|
2008-03-14 14:51:01 +01:00
|
|
|
ensureDir $out/bin
|
2010-06-10 14:28:04 +02:00
|
|
|
ensureDir $out/lib
|
|
|
|
|
|
|
|
# Copy what we need from Glibc.
|
|
|
|
cp -p ${glibc}/lib/ld-linux*.so.? $out/lib
|
|
|
|
cp -p ${glibc}/lib/libc.so.* $out/lib
|
|
|
|
cp -p ${glibc}/lib/librt.so.* $out/lib
|
|
|
|
cp -p ${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
|
2010-06-14 01:49:16 +02:00
|
|
|
cp ${nettools}/sbin/ifconfig $out/bin
|
|
|
|
cp ${sysvinit}/sbin/halt $out/bin
|
2010-06-10 14:28:04 +02:00
|
|
|
|
|
|
|
# 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
|
|
|
|
done
|
|
|
|
''; # */
|
2009-03-02 14:22:31 +01:00
|
|
|
|
2010-06-10 14:28:04 +02:00
|
|
|
|
2009-03-02 14:22:31 +01:00
|
|
|
createDeviceNodes = dev:
|
|
|
|
''
|
|
|
|
mknod ${dev}/null c 1 3
|
|
|
|
mknod ${dev}/zero c 1 5
|
|
|
|
mknod ${dev}/tty c 5 0
|
2010-06-14 01:49:16 +02:00
|
|
|
. /sys/class/block/${hd}/uevent
|
|
|
|
mknod ${dev}/${hd} b $MAJOR $MINOR
|
2009-03-02 14:22:31 +01:00
|
|
|
'';
|
|
|
|
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
stage1Init = writeScript "vm-run-stage1" ''
|
2010-06-10 14:28:04 +02:00
|
|
|
#! ${initrdUtils}/bin/bash -e
|
2008-03-14 14:51:01 +01:00
|
|
|
echo START
|
|
|
|
|
2010-06-10 14:28:04 +02:00
|
|
|
export PATH=${initrdUtils}/bin
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
mkdir /etc
|
|
|
|
echo -n > /etc/fstab
|
|
|
|
|
|
|
|
mount -t proc none /proc
|
2009-12-18 13:10:35 +01:00
|
|
|
mount -t sysfs none /sys
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
for o in $(cat /proc/cmdline); do
|
|
|
|
case $o in
|
2008-03-17 11:40:47 +01:00
|
|
|
mountDisk=1)
|
|
|
|
mountDisk=1
|
2008-03-14 14:51:01 +01:00
|
|
|
;;
|
|
|
|
command=*)
|
|
|
|
set -- $(IFS==; echo $o)
|
|
|
|
command=$2
|
|
|
|
;;
|
|
|
|
tmpDir=*)
|
|
|
|
set -- $(IFS==; echo $o)
|
|
|
|
export tmpDir=$2
|
|
|
|
;;
|
|
|
|
out=*)
|
|
|
|
set -- $(IFS==; echo $o)
|
|
|
|
export out=$2
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
for i in $(cat ${modulesClosure}/insmod-list); do
|
|
|
|
args=
|
|
|
|
case $i in
|
|
|
|
*/cifs.ko)
|
|
|
|
args="CIFSMaxBufSize=4194304"
|
|
|
|
;;
|
|
|
|
esac
|
2010-06-10 14:28:04 +02:00
|
|
|
echo "loading module $(basename $i .ko)"
|
2008-03-14 14:51:01 +01:00
|
|
|
insmod $i $args
|
|
|
|
done
|
|
|
|
|
|
|
|
mount -t tmpfs none /dev
|
2009-03-02 14:22:31 +01:00
|
|
|
${createDeviceNodes "/dev"}
|
2008-03-14 14:51:01 +01:00
|
|
|
|
2010-06-10 14:28:04 +02:00
|
|
|
ifconfig eth0 up 10.0.2.15
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
mkdir /fs
|
|
|
|
|
2008-03-17 11:40:47 +01:00
|
|
|
if test -z "$mountDisk"; then
|
2008-03-14 14:51:01 +01:00
|
|
|
mount -t tmpfs none /fs
|
|
|
|
else
|
2010-06-14 01:49:16 +02:00
|
|
|
mount -t ext2 /dev/${hd} /fs
|
2008-03-14 14:51:01 +01:00
|
|
|
fi
|
2010-06-14 01:49:16 +02:00
|
|
|
|
2008-03-14 14:51:01 +01:00
|
|
|
mkdir -p /fs/hostfs
|
|
|
|
|
|
|
|
mkdir -p /fs/dev
|
|
|
|
mount -o bind /dev /fs/dev
|
|
|
|
|
2010-06-14 01:49:16 +02:00
|
|
|
for ((n = 0; n < 10; n++)); do
|
|
|
|
echo "mounting host filesystem, attempt $n..."
|
|
|
|
mount -t cifs //10.0.2.4/qemu /fs/hostfs -o guest,username=nobody && break
|
2009-09-23 17:17:47 +02:00
|
|
|
done
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
mkdir -p /fs/nix/store
|
|
|
|
mount -o bind /fs/hostfs/nix/store /fs/nix/store
|
|
|
|
|
|
|
|
mkdir -p /fs/tmp
|
|
|
|
mount -t tmpfs -o "mode=755" none /fs/tmp
|
|
|
|
|
|
|
|
mkdir -p /fs/proc
|
|
|
|
mount -t proc none /fs/proc
|
|
|
|
|
2009-12-18 13:10:35 +01:00
|
|
|
mkdir -p /fs/sys
|
|
|
|
mount -t sysfs none /fs/sys
|
|
|
|
|
2008-03-14 14:51:01 +01:00
|
|
|
mkdir -p /fs/etc
|
|
|
|
ln -sf /proc/mounts /fs/etc/mtab
|
|
|
|
|
|
|
|
echo "Now running: $command"
|
|
|
|
test -n "$command"
|
|
|
|
|
|
|
|
set +e
|
|
|
|
chroot /fs $command /tmp $out /hostfs/$tmpDir
|
|
|
|
echo $? > /fs/hostfs/$tmpDir/in-vm-exit
|
|
|
|
|
|
|
|
mount -o remount,ro dummy /fs
|
|
|
|
|
|
|
|
echo DONE
|
2010-06-10 14:28:04 +02:00
|
|
|
halt -d -p -f
|
2008-03-14 14:51:01 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
|
2008-03-17 11:40:47 +01:00
|
|
|
initrd = makeInitrd {
|
2008-03-14 14:51:01 +01:00
|
|
|
contents = [
|
|
|
|
{ object = stage1Init;
|
|
|
|
symlink = "/init";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
stage2Init = writeScript "vm-run-stage2" ''
|
|
|
|
#! ${bash}/bin/sh
|
|
|
|
source $3/saved-env
|
|
|
|
|
|
|
|
export NIX_STORE=/nix/store
|
|
|
|
export NIX_BUILD_TOP="$1"
|
|
|
|
export TMPDIR="$1"
|
|
|
|
export PATH=/empty
|
|
|
|
out="$2"
|
|
|
|
export ORIG_TMPDIR="$3"
|
|
|
|
cd "$NIX_BUILD_TOP"
|
|
|
|
|
|
|
|
if ! test -e /bin/sh; then
|
|
|
|
${coreutils}/bin/mkdir -p /bin
|
|
|
|
${coreutils}/bin/ln -s ${bash}/bin/sh /bin/sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
# For debugging: if this is the second time this image is run,
|
|
|
|
# then don't start the build again, but instead drop the user into
|
|
|
|
# an interactive shell.
|
|
|
|
if test -n "$origBuilder" -a ! -e /.debug; then
|
|
|
|
${coreutils}/bin/touch /.debug
|
|
|
|
exec $origBuilder $origArgs
|
|
|
|
else
|
|
|
|
export PATH=/bin:/usr/bin:${coreutils}/bin
|
|
|
|
echo "Starting interactive shell..."
|
|
|
|
echo "(To run the original builder: \$origBuilder \$origArgs)"
|
|
|
|
exec ${bash}/bin/sh
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
2008-04-29 14:32:17 +02:00
|
|
|
qemuCommandLinux = ''
|
2010-06-14 01:49:16 +02:00
|
|
|
qemu-system-x86_64 \
|
2008-03-14 14:51:01 +01:00
|
|
|
-nographic -no-reboot \
|
2010-06-14 01:49:16 +02:00
|
|
|
-net nic,model=virtio -chardev socket,id=samba,path=$TMPDIR/samba -net user,guestfwd=tcp:10.0.2.4:139-chardev:samba \
|
|
|
|
-drive file=$diskImage,if=virtio,boot=on,cache=writeback,werror=report \
|
2010-02-18 12:34:48 +01:00
|
|
|
-kernel ${kernel}/bzImage \
|
2008-03-14 14:51:01 +01:00
|
|
|
-initrd ${initrd}/initrd \
|
2008-03-17 11:40:47 +01:00
|
|
|
-append "console=ttyS0 panic=1 command=${stage2Init} tmpDir=$TMPDIR out=$out mountDisk=$mountDisk" \
|
2008-03-14 14:51:01 +01:00
|
|
|
$QEMU_OPTS
|
|
|
|
'';
|
|
|
|
|
2010-06-14 02:18:54 +02:00
|
|
|
|
2008-04-29 14:32:17 +02:00
|
|
|
vmRunCommand = qemuCommand: writeText "vm-run" ''
|
2008-03-14 14:51:01 +01:00
|
|
|
export > saved-env
|
|
|
|
|
2010-06-14 01:49:16 +02:00
|
|
|
PATH=${coreutils}/bin:${kvm}/bin
|
2008-03-14 14:51:01 +01:00
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
diskImage=''${diskImage:-/dev/null}
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
eval "$preVM"
|
|
|
|
|
2010-06-14 01:49:16 +02:00
|
|
|
cat > smb.conf <<EOF
|
|
|
|
[global]
|
|
|
|
private dir=$TMPDIR
|
|
|
|
smb ports=0
|
|
|
|
socket address=127.0.0.1
|
|
|
|
pid directory=$TMPDIR
|
|
|
|
lock directory=$TMPDIR
|
|
|
|
log file=$TMPDIR/log.smbd
|
|
|
|
smb passwd file=$TMPDIR/smbpasswd
|
|
|
|
security = share
|
|
|
|
[qemu]
|
|
|
|
path=/
|
|
|
|
read only=no
|
|
|
|
guest ok=yes
|
|
|
|
EOF
|
|
|
|
|
2008-03-14 14:51:01 +01:00
|
|
|
# Write the command to start the VM to a file so that the user can
|
|
|
|
# debug inside the VM if the build fails (when Nix is called with
|
|
|
|
# the -K option to preserve the temporary build directory).
|
|
|
|
cat > ./run-vm <<EOF
|
|
|
|
#! ${bash}/bin/sh
|
|
|
|
diskImage=$diskImage
|
|
|
|
TMPDIR=$TMPDIR
|
2010-06-14 09:39:13 +02:00
|
|
|
${socat}/bin/socat unix-listen:$TMPDIR/samba system:'while true; do ${samba}/sbin/smbd -s $TMPDIR/smb.conf; done' > /dev/null 2>&1 &
|
2010-06-14 01:49:16 +02:00
|
|
|
while [ ! -e $TMPDIR/samba ]; do sleep 0.1; done # ugly
|
2008-03-14 14:51:01 +01:00
|
|
|
${qemuCommand}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod +x ./run-vm
|
|
|
|
source ./run-vm
|
|
|
|
|
|
|
|
if ! test -e in-vm-exit; then
|
|
|
|
echo "Virtual machine didn't produce an exit code."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2008-04-29 14:32:17 +02:00
|
|
|
eval "$postVM"
|
|
|
|
|
2008-03-14 14:51:01 +01:00
|
|
|
exit $(cat in-vm-exit)
|
|
|
|
'';
|
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
|
|
|
|
createEmptyImage = {size, fullName}: ''
|
|
|
|
mkdir $out
|
2009-03-02 15:31:33 +01:00
|
|
|
diskImage=$out/disk-image.qcow2
|
|
|
|
qemu-img create -f qcow2 $diskImage "${toString size}M"
|
2008-03-17 18:08:40 +01:00
|
|
|
|
|
|
|
mkdir $out/nix-support
|
2008-03-18 13:54:21 +01:00
|
|
|
echo "${fullName}" > $out/nix-support/full-name
|
2008-03-17 18:08:40 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
createRootFS = ''
|
|
|
|
mkdir /mnt
|
2010-06-14 01:49:16 +02:00
|
|
|
${e2fsprogs}/sbin/mke2fs -F /dev/${hd}
|
|
|
|
${utillinux}/bin/mount -t ext2 /dev/${hd} /mnt
|
2008-03-17 18:08:40 +01:00
|
|
|
|
|
|
|
if test -e /mnt/.debug; then
|
|
|
|
exec ${bash}/bin/sh
|
|
|
|
fi
|
|
|
|
touch /mnt/.debug
|
|
|
|
|
|
|
|
mkdir /mnt/proc /mnt/dev /mnt/sys /mnt/bin
|
2009-03-02 14:22:31 +01:00
|
|
|
${createDeviceNodes "/mnt/dev"}
|
2008-03-17 18:08:40 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
/* Run a derivation in a Linux virtual machine (using Qemu/KVM). By
|
|
|
|
default, there is no disk image; the root filesystem is a tmpfs,
|
|
|
|
and /nix/store is shared with the host (via the CIFS protocol to
|
|
|
|
a Samba instance automatically started by Qemu). Thus, any pure
|
|
|
|
Nix derivation should run unmodified, e.g. the call
|
|
|
|
|
|
|
|
runInLinuxVM patchelf
|
|
|
|
|
|
|
|
will build the derivation `patchelf' inside a VM. The attribute
|
|
|
|
`preVM' can optionally contain a shell command to be evaluated
|
|
|
|
*before* the VM is started (i.e., on the host). The attribute
|
|
|
|
`memSize' specifies the memory size of the VM in megabytes,
|
|
|
|
defaulting to 256. The attribute `diskImage' can optionally
|
|
|
|
specify a file system image to be attached to /dev/sda. (Note
|
|
|
|
that currently we expect the image to contain a filesystem, not a
|
|
|
|
full disk image with a partition table etc.)
|
|
|
|
|
|
|
|
If the build fails and Nix is run with the `-K' option, a script
|
|
|
|
`run-vm' will be left behind in the temporary build directory
|
|
|
|
that allows you to boot into the VM and debug it interactively. */
|
|
|
|
|
2009-11-19 17:43:58 +01:00
|
|
|
runInLinuxVM = drv: lib.overrideDerivation drv (attrs: {
|
2008-03-14 14:51:01 +01:00
|
|
|
builder = "${bash}/bin/sh";
|
2008-04-29 14:32:17 +02:00
|
|
|
args = ["-e" (vmRunCommand qemuCommandLinux)];
|
2008-03-14 14:51:01 +01:00
|
|
|
origArgs = attrs.args;
|
|
|
|
origBuilder = attrs.builder;
|
|
|
|
QEMU_OPTS = "-m ${toString (if attrs ? memSize then attrs.memSize else 256)}";
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2008-04-29 14:32:17 +02:00
|
|
|
qemuCommandGeneric = ''
|
2008-08-26 13:39:10 +02:00
|
|
|
qemu-system-x86_64 \
|
2008-04-29 14:32:17 +02:00
|
|
|
-nographic -no-reboot \
|
|
|
|
-smb $(pwd) -hda $diskImage \
|
|
|
|
$QEMU_OPTS
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
/* Run a command in a x86 virtual machine image containing an
|
|
|
|
arbitrary OS. The VM should be configured to do the following:
|
|
|
|
|
|
|
|
- Write log output to the serial port.
|
|
|
|
|
|
|
|
- Mount //10.0.2.4/qemu via SMB.
|
|
|
|
|
|
|
|
- Execute the command "cmd" on the SMB share. It can access the
|
|
|
|
original derivation attributes in "saved-env" on the share.
|
|
|
|
|
|
|
|
- Produce output under "out" on the SMB share.
|
|
|
|
|
|
|
|
- Write an exit code to "in-vm-exit" on the SMB share ("0"
|
|
|
|
meaning success).
|
|
|
|
|
|
|
|
- Reboot to shutdown the machine (because Qemu doesn't seem
|
|
|
|
capable of a APM/ACPI VM shutdown).
|
|
|
|
*/
|
2009-11-19 17:43:58 +01:00
|
|
|
runInGenericVM = drv: lib.overrideDerivation drv (attrs: {
|
2008-04-29 14:32:17 +02:00
|
|
|
system = "i686-linux";
|
|
|
|
builder = "${bash}/bin/sh";
|
|
|
|
args = ["-e" (vmRunCommand qemuCommandGeneric)];
|
|
|
|
QEMU_OPTS = "-m ${toString (if attrs ? memSize then attrs.memSize else 256)}";
|
|
|
|
|
|
|
|
preVM = ''
|
2009-03-02 15:31:33 +01:00
|
|
|
diskImage=$(pwd)/disk-image.qcow2
|
2008-04-29 14:32:17 +02:00
|
|
|
origImage=${attrs.diskImage}
|
2009-03-02 15:31:33 +01:00
|
|
|
if test -d "$origImage"; then origImage="$origImage/disk-image.qcow2"; fi
|
|
|
|
qemu-img create -b "$origImage" -f qcow2 $diskImage
|
2008-04-29 14:32:17 +02:00
|
|
|
|
|
|
|
echo "$buildCommand" > cmd
|
|
|
|
|
|
|
|
eval "$postPreVM"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postVM = ''
|
|
|
|
cp -prvd out $out
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
/* Like runInLinuxVM, but run the build not using the stdenv from
|
|
|
|
the Nix store, but using the tools provided by /bin, /usr/bin
|
|
|
|
etc. from the specified filesystem image, which typically is a
|
|
|
|
filesystem containing a non-NixOS Linux distribution. */
|
|
|
|
|
|
|
|
runInLinuxImage = attrs: runInLinuxVM (attrs // {
|
|
|
|
mountDisk = true;
|
2008-03-14 14:51:01 +01:00
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
/* Mount `image' as the root FS, but use a temporary copy-on-write
|
|
|
|
image since we don't want to (and can't) write to `image'. */
|
|
|
|
preVM = ''
|
2009-03-02 15:31:33 +01:00
|
|
|
diskImage=$(pwd)/disk-image.qcow2
|
2008-03-17 18:08:40 +01:00
|
|
|
origImage=${attrs.diskImage}
|
2009-03-02 15:31:33 +01:00
|
|
|
if test -d "$origImage"; then origImage="$origImage/disk-image.qcow2"; fi
|
|
|
|
qemu-img create -b "$origImage" -f qcow2 $diskImage
|
2008-03-17 18:08:40 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
/* Inside the VM, run the stdenv setup script normally, but at the
|
|
|
|
very end set $PATH and $SHELL to the `native' paths for the
|
|
|
|
distribution inside the VM. */
|
|
|
|
postHook = ''
|
|
|
|
PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
|
|
|
SHELL=/bin/sh
|
2008-03-17 18:29:07 +01:00
|
|
|
eval "$origPostHook"
|
2008-03-17 18:08:40 +01:00
|
|
|
'';
|
|
|
|
|
2008-03-17 18:29:07 +01:00
|
|
|
origPostHook = if attrs ? postHook then attrs.postHook else "";
|
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
/* Don't run Nix-specific build steps like patchelf. */
|
|
|
|
fixupPhase = "true";
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
/* Create a filesystem image of the specified size and fill it with
|
|
|
|
a set of RPM packages. */
|
|
|
|
|
2008-03-14 14:51:01 +01:00
|
|
|
fillDiskWithRPMs =
|
2009-07-02 14:53:25 +02:00
|
|
|
{size ? 4096, rpms, name, fullName, preInstall ? "", postInstall ? "", runScripts ? true}:
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
runInLinuxVM (stdenv.mkDerivation {
|
2008-03-18 15:56:47 +01:00
|
|
|
inherit name preInstall postInstall rpms;
|
2008-03-14 14:51:01 +01:00
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
preVM = createEmptyImage {inherit size fullName;};
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
buildCommand = ''
|
2008-03-17 18:08:40 +01:00
|
|
|
${createRootFS}
|
2008-03-14 14:51:01 +01:00
|
|
|
|
2008-03-18 22:14:02 +01:00
|
|
|
chroot=$(type -tP chroot)
|
|
|
|
|
2008-03-18 15:56:47 +01:00
|
|
|
echo "unpacking RPMs..."
|
|
|
|
for i in $rpms; do
|
|
|
|
echo "$i..."
|
|
|
|
${rpm}/bin/rpm2cpio "$i" | (cd /mnt && ${cpio}/bin/cpio -i --make-directories)
|
|
|
|
done
|
2008-03-14 14:51:01 +01:00
|
|
|
|
2008-03-18 15:56:47 +01:00
|
|
|
eval "$preInstall"
|
2008-03-14 14:51:01 +01:00
|
|
|
|
2008-03-18 22:14:02 +01:00
|
|
|
echo "initialising RPM DB..."
|
2008-05-21 11:35:15 +02:00
|
|
|
PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
|
|
|
|
ldconfig -v || true
|
2008-03-18 22:14:02 +01:00
|
|
|
PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
|
|
|
|
rpm --initdb
|
|
|
|
|
2008-03-18 15:56:47 +01:00
|
|
|
# Make the Nix store available in /mnt, because that's where the RPMs live.
|
|
|
|
mkdir -p /mnt/nix/store
|
2010-06-10 14:28:04 +02:00
|
|
|
${utillinux}/bin/mount -o bind /nix/store /mnt/nix/store
|
2010-06-14 01:49:16 +02:00
|
|
|
${utillinux}/bin/mount -o bind /tmp /mnt/tmp
|
2008-03-18 15:56:47 +01:00
|
|
|
|
|
|
|
echo "installing RPMs..."
|
|
|
|
PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
|
2008-04-11 17:36:03 +02:00
|
|
|
rpm -iv ${if runScripts then "" else "--noscripts"} $rpms
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
echo "running post-install script..."
|
|
|
|
eval "$postInstall"
|
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
rm /mnt/.debug
|
|
|
|
|
2010-06-10 14:28:04 +02:00
|
|
|
${utillinux}/bin/umount /mnt/nix/store
|
2010-06-14 01:49:16 +02:00
|
|
|
${utillinux}/bin/umount /mnt/tmp
|
2010-06-10 14:28:04 +02:00
|
|
|
${utillinux}/bin/umount /mnt
|
2008-03-14 14:51:01 +01:00
|
|
|
'';
|
2008-11-12 18:19:12 +01:00
|
|
|
|
|
|
|
passthru = {inherit fullName;};
|
2008-03-14 14:51:01 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
/* Generate a script that can be used to run an interactive session
|
|
|
|
in the given image. */
|
|
|
|
|
2008-03-14 14:51:01 +01:00
|
|
|
makeImageTestScript = image: writeScript "image-test" ''
|
|
|
|
#! ${bash}/bin/sh
|
|
|
|
if test -z "$1"; then
|
|
|
|
echo "Syntax: $0 <copy-on-write-temp-file>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
diskImage="$1"
|
|
|
|
if ! test -e "$diskImage"; then
|
2009-03-02 15:31:33 +01:00
|
|
|
qemu-img create -b ${image}/disk-image.qcow2 -f qcow2 "$diskImage"
|
2008-03-14 14:51:01 +01:00
|
|
|
fi
|
|
|
|
export TMPDIR=$(mktemp -d)
|
|
|
|
export out=/dummy
|
|
|
|
export origBuilder=
|
|
|
|
export origArgs=
|
|
|
|
export > $TMPDIR/saved-env
|
2008-03-18 15:56:47 +01:00
|
|
|
mountDisk=1
|
2008-04-29 14:32:17 +02:00
|
|
|
${qemuCommandLinux}
|
2008-03-14 14:51:01 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
/* Build RPM packages from the tarball `src' in the Linux
|
|
|
|
distribution installed in the filesystem `diskImage'. The
|
|
|
|
tarball must contain an RPM specfile. */
|
2008-03-14 14:51:01 +01:00
|
|
|
|
2008-03-18 22:14:02 +01:00
|
|
|
buildRPM = attrs: runInLinuxImage (stdenv.mkDerivation ({
|
2008-04-09 08:37:59 +02:00
|
|
|
phases = "prepareImagePhase sysInfoPhase buildPhase installPhase";
|
2008-03-18 22:14:02 +01:00
|
|
|
|
|
|
|
outDir = "rpms/${attrs.diskImage.name}";
|
2008-04-09 08:37:59 +02:00
|
|
|
|
|
|
|
prepareImagePhase = ''
|
2008-04-12 07:19:37 +02:00
|
|
|
if test -n "$extraRPMs"; then
|
2009-10-01 09:25:50 +02:00
|
|
|
for rpmdir in $extraRPMs ; do
|
|
|
|
rpm -iv $(ls $rpmdir/rpms/*/*.rpm | grep -v 'src\.rpm' | sort | head -1)
|
|
|
|
done
|
2008-04-12 07:03:36 +02:00
|
|
|
fi
|
2008-04-09 08:37:59 +02:00
|
|
|
'';
|
2008-03-17 11:40:47 +01:00
|
|
|
|
2008-03-17 18:29:07 +01:00
|
|
|
sysInfoPhase = ''
|
2008-09-12 14:06:40 +02:00
|
|
|
echo "System/kernel: $(uname -a)"
|
2008-04-09 14:51:54 +02:00
|
|
|
if test -e /etc/fedora-release; then echo "Fedora release: $(cat /etc/fedora-release)"; fi
|
|
|
|
if test -e /etc/SuSE-release; then echo "SUSE release: $(cat /etc/SuSE-release)"; fi
|
|
|
|
header "installed RPM packages"
|
2008-03-17 18:29:07 +01:00
|
|
|
rpm -qa --qf "%{Name}-%{Version}-%{Release} (%{Arch}; %{Distribution}; %{Vendor})\n"
|
|
|
|
stopNest
|
|
|
|
'';
|
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
buildPhase = ''
|
2008-03-18 13:54:21 +01:00
|
|
|
eval "$preBuild"
|
2008-03-18 15:56:47 +01:00
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
# Hacky: RPM looks for <basename>.spec inside the tarball, so
|
|
|
|
# strip off the hash.
|
2008-03-14 14:51:01 +01:00
|
|
|
stripHash "$src"
|
|
|
|
srcName="$strippedName"
|
2008-03-18 13:54:21 +01:00
|
|
|
cp "$src" "$srcName" # `ln' doesn't work always work: RPM requires that the file is owned by root
|
|
|
|
|
2008-11-27 19:58:37 +01:00
|
|
|
export HOME=/tmp/home
|
|
|
|
mkdir $HOME
|
|
|
|
|
|
|
|
rpmout=/tmp/rpmout
|
|
|
|
mkdir $rpmout $rpmout/SPECS $rpmout/BUILD $rpmout/RPMS $rpmout/SRPMS
|
|
|
|
|
|
|
|
echo "%_topdir $rpmout" >> $HOME/.rpmmacros
|
|
|
|
|
2008-10-29 18:19:49 +01:00
|
|
|
rpmbuild -vv -ta "$srcName"
|
2008-03-14 14:51:01 +01:00
|
|
|
|
2008-03-18 13:54:21 +01:00
|
|
|
eval "$postBuild"
|
2008-03-17 18:08:40 +01:00
|
|
|
'';
|
2008-03-14 14:51:01 +01:00
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
installPhase = ''
|
2008-11-13 13:45:08 +01:00
|
|
|
eval "$preInstall"
|
|
|
|
|
2008-03-18 22:14:02 +01:00
|
|
|
ensureDir $out/$outDir
|
2008-11-27 19:58:37 +01:00
|
|
|
find $rpmout -name "*.rpm" -exec cp {} $out/$outDir \;
|
2008-03-18 13:54:21 +01:00
|
|
|
|
2008-03-18 22:14:02 +01:00
|
|
|
for i in $out/$outDir/*.rpm; do
|
2008-03-18 13:54:21 +01:00
|
|
|
header "Generated RPM/SRPM: $i"
|
|
|
|
rpm -qip $i
|
|
|
|
stopNest
|
|
|
|
done
|
2008-11-13 13:45:08 +01:00
|
|
|
|
|
|
|
eval "$postInstall"
|
2008-03-18 22:14:02 +01:00
|
|
|
''; # */
|
|
|
|
} // attrs));
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
/* Create a filesystem image of the specified size and fill it with
|
|
|
|
a set of Debian packages. `debs' must be a list of list of
|
|
|
|
.deb files, namely, the Debian packages grouped together into
|
|
|
|
strongly connected components. See deb/deb-closure.nix. */
|
|
|
|
|
2008-03-14 14:51:01 +01:00
|
|
|
fillDiskWithDebs =
|
2009-07-02 14:53:25 +02:00
|
|
|
{size ? 4096, debs, name, fullName, postInstall ? null}:
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
runInLinuxVM (stdenv.mkDerivation {
|
|
|
|
inherit name postInstall;
|
|
|
|
|
|
|
|
debs = (lib.intersperse "|" debs);
|
|
|
|
|
2008-03-17 18:08:40 +01:00
|
|
|
preVM = createEmptyImage {inherit size fullName;};
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
buildCommand = ''
|
2008-03-17 18:08:40 +01:00
|
|
|
${createRootFS}
|
2008-03-14 14:51:01 +01:00
|
|
|
|
2009-10-02 11:11:42 +02:00
|
|
|
PATH=$PATH:${dpkg}/bin:${dpkg}/sbin:${glibc}/sbin:${lzma}/bin
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
# Unpack the .debs. We do this to prevent pre-install scripts
|
|
|
|
# (which have lots of circular dependencies) from barfing.
|
|
|
|
echo "unpacking Debs..."
|
|
|
|
|
|
|
|
for deb in $debs; do
|
|
|
|
if test "$deb" != "|"; then
|
|
|
|
echo "$deb..."
|
|
|
|
dpkg-deb --extract "$deb" /mnt
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Make the Nix store available in /mnt, because that's where the .debs live.
|
|
|
|
mkdir -p /mnt/inst/nix/store
|
2010-06-10 14:28:04 +02:00
|
|
|
${utillinux}/bin/mount -o bind /nix/store /mnt/inst/nix/store
|
|
|
|
${utillinux}/bin/mount -o bind /proc /mnt/proc
|
|
|
|
${utillinux}/bin/mount -o bind /dev /mnt/dev
|
2008-03-14 14:51:01 +01:00
|
|
|
|
|
|
|
# Misc. files/directories assumed by various packages.
|
2008-11-12 18:15:09 +01:00
|
|
|
echo "initialising Dpkg DB..."
|
2008-03-14 14:51:01 +01:00
|
|
|
touch /mnt/etc/shells
|
|
|
|
touch /mnt/var/lib/dpkg/status
|
|
|
|
touch /mnt/var/lib/dpkg/available
|
|
|
|
touch /mnt/var/lib/dpkg/diversions
|
|
|
|
|
|
|
|
# Now install the .debs. This is basically just to register
|
|
|
|
# them with dpkg and to make their pre/post-install scripts
|
|
|
|
# run.
|
|
|
|
echo "installing Debs..."
|
|
|
|
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
oldIFS="$IFS"
|
|
|
|
IFS="|"
|
|
|
|
for component in $debs; do
|
|
|
|
IFS="$oldIFS"
|
|
|
|
echo
|
|
|
|
echo ">>> INSTALLING COMPONENT: $component"
|
|
|
|
debs=
|
|
|
|
for i in $component; do
|
|
|
|
debs="$debs /inst/$i";
|
|
|
|
done
|
|
|
|
chroot=$(type -tP chroot)
|
|
|
|
PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
|
|
|
|
/usr/bin/dpkg --install --force-all $debs < /dev/null
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "running post-install script..."
|
|
|
|
eval "$postInstall"
|
2009-10-02 11:34:37 +02:00
|
|
|
ln -sf dash /mnt/bin/sh
|
|
|
|
|
2008-03-14 14:51:01 +01:00
|
|
|
rm /mnt/.debug
|
|
|
|
|
2010-06-10 14:28:04 +02:00
|
|
|
${utillinux}/bin/umount /mnt/inst/nix/store
|
|
|
|
${utillinux}/bin/umount /mnt/proc
|
|
|
|
${utillinux}/bin/umount /mnt/dev
|
|
|
|
${utillinux}/bin/umount /mnt
|
2008-03-14 14:51:01 +01:00
|
|
|
'';
|
2008-11-12 18:19:12 +01:00
|
|
|
|
|
|
|
passthru = {inherit fullName;};
|
2008-03-14 14:51:01 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2008-04-09 14:02:15 +02:00
|
|
|
/* Generate a Nix expression containing fetchurl calls for the
|
|
|
|
closure of a set of top-level RPM packages from the
|
2008-04-11 13:52:40 +02:00
|
|
|
`primary.xml.gz' file of a Fedora or openSUSE distribution. */
|
2008-04-09 14:02:15 +02:00
|
|
|
|
|
|
|
rpmClosureGenerator =
|
2008-04-11 13:52:40 +02:00
|
|
|
{name, packagesList, urlPrefix, packages, archs ? []}:
|
2008-04-09 14:02:15 +02:00
|
|
|
|
2009-04-20 14:52:24 +02:00
|
|
|
runCommand "${name}.nix" {buildInputs = [perl perlPackages.XMLSimple]; inherit archs;} ''
|
2008-04-09 14:02:15 +02:00
|
|
|
gunzip < ${packagesList} > ./packages.xml
|
|
|
|
perl -w ${rpm/rpm-closure.pl} \
|
|
|
|
./packages.xml ${urlPrefix} ${toString packages} > $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
/* Helper function that combines rpmClosureGenerator and
|
|
|
|
fillDiskWithRPMs to generate a disk image from a set of package
|
|
|
|
names. */
|
|
|
|
|
|
|
|
makeImageFromRPMDist =
|
2009-07-02 14:53:25 +02:00
|
|
|
{ name, fullName, size ? 4096, urlPrefix, packagesList, packages
|
|
|
|
, preInstall ? "", postInstall ? "", archs ? ["noarch" "i386"], runScripts ? true}:
|
2008-04-09 14:02:15 +02:00
|
|
|
|
|
|
|
fillDiskWithRPMs {
|
2009-07-02 14:53:25 +02:00
|
|
|
inherit name fullName size preInstall postInstall runScripts;
|
2008-04-09 14:02:15 +02:00
|
|
|
rpms = import (rpmClosureGenerator {
|
2008-04-11 13:52:40 +02:00
|
|
|
inherit name packagesList urlPrefix packages archs;
|
2008-04-09 14:02:15 +02:00
|
|
|
}) {inherit fetchurl;};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Like `rpmClosureGenerator', but now for Debian/Ubuntu releases
|
|
|
|
(i.e. generate a closure from a Packages.bz2 file). */
|
|
|
|
|
|
|
|
debClosureGenerator =
|
|
|
|
{name, packagesList, urlPrefix, packages}:
|
|
|
|
|
|
|
|
runCommand "${name}.nix" {} ''
|
|
|
|
bunzip2 < ${packagesList} > ./Packages
|
2008-09-12 15:17:52 +02:00
|
|
|
|
|
|
|
# Work around this bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452279
|
|
|
|
substituteInPlace ./Packages --replace x86_64-linux-gnu x86-64-linux-gnu
|
|
|
|
|
2008-04-09 14:02:15 +02:00
|
|
|
${perl}/bin/perl -I${dpkg} -w ${deb/deb-closure.pl} \
|
|
|
|
./Packages ${urlPrefix} ${toString packages} > $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
/* Helper function that combines debClosureGenerator and
|
|
|
|
fillDiskWithDebs to generate a disk image from a set of package
|
|
|
|
names. */
|
|
|
|
|
|
|
|
makeImageFromDebDist =
|
2009-07-02 14:53:25 +02:00
|
|
|
{name, fullName, size ? 4096, urlPrefix, packagesList, packages, postInstall ? ""}:
|
2008-04-09 14:02:15 +02:00
|
|
|
|
2008-11-12 18:15:09 +01:00
|
|
|
let
|
|
|
|
expr = debClosureGenerator {
|
2008-04-09 14:02:15 +02:00
|
|
|
inherit name packagesList urlPrefix packages;
|
2008-11-12 18:15:09 +01:00
|
|
|
};
|
|
|
|
in
|
|
|
|
(fillDiskWithDebs {
|
|
|
|
inherit name fullName size postInstall;
|
|
|
|
debs = import expr {inherit fetchurl;};
|
|
|
|
}) // {inherit expr;};
|
2008-04-09 14:02:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* A bunch of functions that build disk images of various Linux
|
|
|
|
distributions, given a set of top-level package names to be
|
|
|
|
installed in the image. */
|
|
|
|
|
|
|
|
diskImageFuns = {
|
|
|
|
|
2008-04-09 14:51:54 +02:00
|
|
|
fedora2i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-core-2-i386";
|
|
|
|
fullName = "Fedora Core 2 (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/core/2/i386/os/repodata/primary.xml.gz;
|
|
|
|
sha256 = "1nq1k2k0nzkii737cka301f0vbd2ix2wsfvi6bblpi748q6h2w4k";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/core/2/i386/os;
|
2008-04-11 17:36:03 +02:00
|
|
|
runScripts = false;
|
2008-04-09 14:51:54 +02:00
|
|
|
} // args);
|
|
|
|
|
|
|
|
fedora3i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-core-3-i386";
|
|
|
|
fullName = "Fedora Core 3 (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/core/3/i386/os/repodata/primary.xml.gz;
|
|
|
|
sha256 = "13znspn4g1bkjkk47393k9chswgzl6nx1n0q6h2wrw52c7d9nw9i";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/core/3/i386/os;
|
2008-04-11 17:36:03 +02:00
|
|
|
archs = ["noarch" "i386" "i586"];
|
|
|
|
runScripts = false;
|
2008-04-09 14:51:54 +02:00
|
|
|
} // args);
|
|
|
|
|
|
|
|
fedora5i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-core-5-i386";
|
|
|
|
fullName = "Fedora Core 5 (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/core/5/i386/os/repodata/primary.xml.gz;
|
|
|
|
sha256 = "0lfk4mzrpiyls8h7k9ckc3vgywbmg05zsr4ag6qakgnv9gljijig";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/core/5/i386/os;
|
|
|
|
} // args);
|
|
|
|
|
2008-04-09 14:02:15 +02:00
|
|
|
fedora7i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-7-i386";
|
|
|
|
fullName = "Fedora 7 (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/releases/7/Fedora/i386/os/repodata/primary.xml.gz;
|
|
|
|
sha256 = "0zq7ifirj45wry7b2qkm12qhzzazal3hn610h5kwbrfr2xavs882";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/releases/7/Fedora/i386/os;
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
fedora8i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-8-i386";
|
|
|
|
fullName = "Fedora 8 (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/releases/8/Fedora/i386/os/repodata/primary.xml.gz;
|
|
|
|
sha256 = "0vr9345rrk0vhs4pc9cjp8npdkqz0xqyirv84vhyfn533m9ws36f";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/releases/8/Fedora/i386/os;
|
|
|
|
} // args);
|
|
|
|
|
2008-05-21 11:35:15 +02:00
|
|
|
fedora9i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-9-i386";
|
|
|
|
fullName = "Fedora 9 (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/releases/9/Fedora/i386/os/repodata/primary.xml.gz;
|
|
|
|
sha256 = "18780xgyag5acx79warcpvzlfkm0mni8xawl6jjvgxg9n3lp6zg0";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/releases/9/Fedora/i386/os;
|
|
|
|
} // args);
|
|
|
|
|
2008-09-12 14:24:07 +02:00
|
|
|
fedora9x86_64 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-9-x86_64";
|
|
|
|
fullName = "Fedora 9 (x86_64)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/releases/9/Fedora/x86_64/os/repodata/primary.xml.gz;
|
|
|
|
sha256 = "0qcjigzbw29ahhkfjaw5pbpyl7mj9l349hikwv25jcnid1cbpmx7";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/releases/9/Fedora/x86_64/os;
|
|
|
|
archs = ["noarch" "x86_64"];
|
|
|
|
} // args);
|
|
|
|
|
2008-11-26 12:14:39 +01:00
|
|
|
fedora10i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-10-i386";
|
|
|
|
fullName = "Fedora 10 (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/releases/10/Fedora/i386/os/repodata/primary.xml.gz;
|
|
|
|
sha256 = "15ha8pxzvlch707mpy06c7pkr2ra2vpd5b8x30qhydvx8fgcqcx9";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/releases/10/Fedora/i386/os;
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
fedora10x86_64 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-10-x86_64";
|
|
|
|
fullName = "Fedora 10 (x86_64)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/releases/10/Fedora/x86_64/os/repodata/primary.xml.gz;
|
|
|
|
sha256 = "1pmaav6mdaw13fq99wfggbsmhcix306cimijjxh35qi7yc3wbsz4";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/releases/10/Fedora/x86_64/os;
|
|
|
|
archs = ["noarch" "x86_64"];
|
|
|
|
} // args);
|
|
|
|
|
2009-06-09 16:10:16 +02:00
|
|
|
fedora11i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-11-i386";
|
|
|
|
fullName = "Fedora 11 (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/releases/11/Fedora/i386/os/repodata/36af1d88214b770fd3d814a5126083b8e808510c76acfdc3a234d6f7e43c2425-primary.xml.gz;
|
|
|
|
sha256 = "09947kjggmillb1zvb3n1i8his5qhdh1598lv39hyxsb4641vbrn";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/releases/11/Fedora/i386/os;
|
2009-06-09 16:32:31 +02:00
|
|
|
archs = ["noarch" "i386" "i586"];
|
2009-06-09 16:10:16 +02:00
|
|
|
} // args);
|
|
|
|
|
|
|
|
fedora11x86_64 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-11-x86_64";
|
|
|
|
fullName = "Fedora 11 (x86_64)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/releases/11/Fedora/x86_64/os/repodata/c792495863f5314329c463d51860fc74c6367f72c3cb1c132f6c3290102d68da-primary.xml.gz;
|
|
|
|
sha256 = "1nk85l890ckc5w9irjy3f9zkdiklzih1imb3qhll6cgmcdc4k4n7";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/releases/11/Fedora/x86_64/os;
|
|
|
|
archs = ["noarch" "x86_64"];
|
|
|
|
} // args);
|
|
|
|
|
2009-12-09 23:35:46 +01:00
|
|
|
fedora12i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-12-i386";
|
|
|
|
fullName = "Fedora 12 (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/releases/12/Fedora/i386/os/repodata/92857daf45687583ffa0fa6f8f97c71d08c50d8b6305dfeea8a3332bf2f7f27c-primary.xml.gz;
|
|
|
|
sha256 = "0z7jyzr2ncx3m3pdy1b3ic6wa20xqybqyvzsl3zq6xb88nppv1cj";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/releases/12/Fedora/i386/os;
|
|
|
|
archs = ["noarch" "i386" "i586" "i686"];
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
fedora12x86_64 = args: makeImageFromRPMDist ({
|
|
|
|
name = "fedora-12-x86_64";
|
|
|
|
fullName = "Fedora 12 (x86_64)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://fedora/linux/releases/12/Fedora/x86_64/os/repodata/a4ebee776b3c4898086e124a512e7f8c701ab1699fd83b2dcea3d7592b5c9ff0-primary.xml.gz;
|
|
|
|
sha256 = "1w4zbhmmkmx3rqnkpn4zd6qilw4cgwp52jhjdq49hj1wddvyxsx4";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://fedora/linux/releases/12/Fedora/x86_64/os;
|
|
|
|
archs = ["noarch" "x86_64"];
|
|
|
|
} // args);
|
|
|
|
|
2008-04-11 13:52:40 +02:00
|
|
|
opensuse103i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "opensuse-10.3-i586";
|
|
|
|
fullName = "openSUSE 10.3 (i586)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://opensuse/distribution/10.3/repo/oss/suse/repodata/primary.xml.gz;
|
|
|
|
sha256 = "0zb5kxsb755nqq9i8jdclmanacyf551ncx6a011v9jqphsvyfvd7";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://opensuse/distribution/10.3/repo/oss/suse/;
|
|
|
|
archs = ["noarch" "i586"];
|
|
|
|
} // args);
|
|
|
|
|
2009-03-02 14:22:31 +01:00
|
|
|
opensuse110i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "opensuse-11.0-i586";
|
|
|
|
fullName = "openSUSE 11.0 (i586)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://opensuse/distribution/11.0/repo/oss/suse/repodata/primary.xml.gz;
|
|
|
|
sha256 = "13rv855aj8p3h1zpsji5xa1wpkhgq94gcxzvg05l2b68b15q3mwn";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://opensuse/distribution/11.0/repo/oss/suse/;
|
|
|
|
archs = ["noarch" "i586"];
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
opensuse110x86_64 = args: makeImageFromRPMDist ({
|
|
|
|
name = "opensuse-11.0-x86_64";
|
|
|
|
fullName = "openSUSE 11.0 (x86_64)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://opensuse/distribution/11.0/repo/oss/suse/repodata/primary.xml.gz;
|
|
|
|
sha256 = "13rv855aj8p3h1zpsji5xa1wpkhgq94gcxzvg05l2b68b15q3mwn";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://opensuse/distribution/11.0/repo/oss/suse/;
|
|
|
|
archs = ["noarch" "x86_64"];
|
|
|
|
} // args);
|
|
|
|
|
2009-09-24 09:40:30 +02:00
|
|
|
opensuse111i386 = args: makeImageFromRPMDist ({
|
|
|
|
name = "opensuse-11.1-i586";
|
|
|
|
fullName = "openSUSE 11.1 (i586)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://opensuse/distribution/11.1/repo/oss/suse/repodata/primary.xml.gz;
|
|
|
|
sha256 = "1mfmp9afikj0hci1s8cpwjdr0ycbpfym9gdhci590r9fa75w221j";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://opensuse/distribution/11.1/repo/oss/suse/;
|
|
|
|
archs = ["noarch" "i586"];
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
opensuse111x86_64 = args: makeImageFromRPMDist ({
|
|
|
|
name = "opensuse-11.1-x86_64";
|
|
|
|
fullName = "openSUSE 11.1 (x86_64)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://opensuse/distribution/11.1/repo/oss/suse/repodata/primary.xml.gz;
|
|
|
|
sha256 = "1mfmp9afikj0hci1s8cpwjdr0ycbpfym9gdhci590r9fa75w221j";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://opensuse/distribution/11.1/repo/oss/suse/;
|
|
|
|
archs = ["noarch" "x86_64"];
|
|
|
|
} // args);
|
|
|
|
|
2008-09-12 15:34:41 +02:00
|
|
|
# Interestingly, the SHA-256 hashes provided by Ubuntu in
|
|
|
|
# http://nl.archive.ubuntu.com/ubuntu/dists/{gutsy,hardy}/Release are
|
2008-11-12 18:15:09 +01:00
|
|
|
# wrong, but the SHA-1 and MD5 hashes are correct. Intrepid is fine.
|
2008-09-12 15:34:41 +02:00
|
|
|
|
2008-04-09 14:02:15 +02:00
|
|
|
ubuntu710i386 = args: makeImageFromDebDist ({
|
|
|
|
name = "ubuntu-7.10-gutsy-i386";
|
|
|
|
fullName = "Ubuntu 7.10 Gutsy (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://ubuntu/dists/gutsy/main/binary-i386/Packages.bz2;
|
|
|
|
sha1 = "8b52ee3d417700e2b2ee951517fa25a8792cabfd";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://ubuntu;
|
|
|
|
} // args);
|
|
|
|
|
2008-09-12 15:34:41 +02:00
|
|
|
ubuntu804i386 = args: makeImageFromDebDist ({
|
|
|
|
name = "ubuntu-8.04-hardy-i386";
|
|
|
|
fullName = "Ubuntu 8.04 Hardy (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://ubuntu/dists/hardy/main/binary-i386/Packages.bz2;
|
|
|
|
sha1 = "db74581ee75cb3bee2a8ae62364e97956c723259";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://ubuntu;
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
ubuntu804x86_64 = args: makeImageFromDebDist ({
|
|
|
|
name = "ubuntu-8.04-hardy-amd64";
|
|
|
|
fullName = "Ubuntu 8.04 Hardy (amd64)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://ubuntu/dists/hardy/main/binary-amd64/Packages.bz2;
|
|
|
|
sha1 = "d1f1d2b3cc62533d6e4337f2696a5d27235d1f28";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://ubuntu;
|
|
|
|
} // args);
|
|
|
|
|
2008-11-12 18:15:09 +01:00
|
|
|
ubuntu810i386 = args: makeImageFromDebDist ({
|
|
|
|
name = "ubuntu-8.10-intrepid-i386";
|
|
|
|
fullName = "Ubuntu 8.10 Intrepid (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://ubuntu/dists/intrepid/main/binary-i386/Packages.bz2;
|
|
|
|
sha256 = "70483d40a9e9b74598f2faede7df5d5103ee60055af7374f8db5c7e6017c4cf6";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://ubuntu;
|
|
|
|
} // args);
|
2009-04-09 16:29:19 +02:00
|
|
|
|
2008-11-12 18:15:09 +01:00
|
|
|
ubuntu810x86_64 = args: makeImageFromDebDist ({
|
|
|
|
name = "ubuntu-8.10-intrepid-amd64";
|
|
|
|
fullName = "Ubuntu 8.10 Intrepid (amd64)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://ubuntu/dists/intrepid/main/binary-amd64/Packages.bz2;
|
2009-02-24 13:14:48 +01:00
|
|
|
sha256 = "01b2f3842cbdd5834446ddf91691bcf60f59a726dcefa23fb5b93fdc8ea7e27f";
|
2008-11-12 18:15:09 +01:00
|
|
|
};
|
|
|
|
urlPrefix = mirror://ubuntu;
|
|
|
|
} // args);
|
2009-04-09 16:29:19 +02:00
|
|
|
|
|
|
|
ubuntu904i386 = args: makeImageFromDebDist ({
|
2009-04-09 16:38:08 +02:00
|
|
|
name = "ubuntu-9.04-jaunty-i386";
|
|
|
|
fullName = "Ubuntu 9.04 Jaunty (i386)";
|
2009-04-09 16:29:19 +02:00
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://ubuntu/dists/jaunty/main/binary-i386/Packages.bz2;
|
2009-06-03 21:20:13 +02:00
|
|
|
sha256 = "72c95e4901ad56ce8791723e2ae40bce2399f306f9956cac80e964011e1948d0";
|
2009-04-09 16:29:19 +02:00
|
|
|
};
|
|
|
|
urlPrefix = mirror://ubuntu;
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
ubuntu904x86_64 = args: makeImageFromDebDist ({
|
2009-04-09 16:38:08 +02:00
|
|
|
name = "ubuntu-9.04-jaunty-amd64";
|
|
|
|
fullName = "Ubuntu 9.04 Jaunty (amd64)";
|
2009-04-09 16:29:19 +02:00
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://ubuntu/dists/jaunty/main/binary-amd64/Packages.bz2;
|
2009-09-23 22:46:22 +02:00
|
|
|
sha256 = "af760ce04e43f066b8938b1abdeff979a642f940515659ede44f7877ca358ca8";
|
2009-04-09 16:29:19 +02:00
|
|
|
};
|
|
|
|
urlPrefix = mirror://ubuntu;
|
|
|
|
} // args);
|
|
|
|
|
2009-11-05 15:49:17 +01:00
|
|
|
ubuntu910i386 = args: makeImageFromDebDist ({
|
|
|
|
name = "ubuntu-9.10-karmic-i386";
|
|
|
|
fullName = "Ubuntu 9.10 Karmic (i386)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://ubuntu/dists/karmic/main/binary-i386/Packages.bz2;
|
|
|
|
sha256 = "6e3e813857496f2af6cd7e6ada06b3398fa067a7992c5fd7e8bd8fa92e3548b7";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://ubuntu;
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
ubuntu910x86_64 = args: makeImageFromDebDist ({
|
|
|
|
name = "ubuntu-9.10-karmic-amd64";
|
|
|
|
fullName = "Ubuntu 9.10 Karmic (amd64)";
|
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://ubuntu/dists/karmic/main/binary-amd64/Packages.bz2;
|
|
|
|
sha256 = "3a604fcb0c135eeb8b95da3e90a8fd4cfeff519b858cd3c9e62ea808cb9fec40";
|
|
|
|
};
|
|
|
|
urlPrefix = mirror://ubuntu;
|
|
|
|
} // args);
|
|
|
|
|
2008-09-12 15:17:52 +02:00
|
|
|
debian40i386 = args: makeImageFromDebDist ({
|
2010-06-01 12:44:36 +02:00
|
|
|
name = "debian-4.0r9-etch-i386";
|
|
|
|
fullName = "Debian 4.0r9 Etch (i386)";
|
2008-04-09 14:02:15 +02:00
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://debian/dists/etch/main/binary-i386/Packages.bz2;
|
2010-06-01 12:44:36 +02:00
|
|
|
sha256 = "40eeeecc35e6895b6eb0bc601e38fe53fc985d1b1f3fea3766f34763d21f206f";
|
2008-04-09 14:02:15 +02:00
|
|
|
};
|
2008-05-28 17:21:06 +02:00
|
|
|
urlPrefix = mirror://debian;
|
2008-04-09 14:02:15 +02:00
|
|
|
} // args);
|
|
|
|
|
2008-09-12 15:17:52 +02:00
|
|
|
debian40x86_64 = args: makeImageFromDebDist ({
|
2010-06-01 12:44:36 +02:00
|
|
|
name = "debian-4.0r9-etch-amd64";
|
|
|
|
fullName = "Debian 4.0r9 Etch (amd64)";
|
2008-09-12 15:17:52 +02:00
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://debian/dists/etch/main/binary-amd64/Packages.bz2;
|
2010-06-01 12:44:36 +02:00
|
|
|
sha256 = "cf1c4c7d72e0da45797b046011254d2bd83f5ecb7389c7f30d2561be3f5b2e49";
|
2008-09-12 15:17:52 +02:00
|
|
|
};
|
|
|
|
urlPrefix = mirror://debian;
|
|
|
|
} // args);
|
|
|
|
|
2009-02-24 11:56:42 +01:00
|
|
|
debian50i386 = args: makeImageFromDebDist ({
|
2010-02-01 16:17:34 +01:00
|
|
|
name = "debian-5.0.4-lenny-i386";
|
|
|
|
fullName = "Debian 5.0.4 Lenny (i386)";
|
2009-02-24 11:56:42 +01:00
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://debian/dists/lenny/main/binary-i386/Packages.bz2;
|
2010-02-01 16:17:34 +01:00
|
|
|
sha256 = "6c5ca67fb401a5d29f02557c290bbaee35c457172d548583b510d49eadd0f9ff";
|
2009-02-24 11:56:42 +01:00
|
|
|
};
|
|
|
|
urlPrefix = mirror://debian;
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
debian50x86_64 = args: makeImageFromDebDist ({
|
2010-02-01 16:17:34 +01:00
|
|
|
name = "debian-5.0.4-lenny-amd64";
|
|
|
|
fullName = "Debian 5.0.4 Lenny (amd64)";
|
2009-02-24 11:56:42 +01:00
|
|
|
packagesList = fetchurl {
|
|
|
|
url = mirror://debian/dists/lenny/main/binary-amd64/Packages.bz2;
|
2010-02-01 16:17:34 +01:00
|
|
|
sha256 = "c3b660b861ed257e82293a350ab868c2ce566bc084d35cc66b7388a881eaf3c5";
|
2009-02-24 11:56:42 +01:00
|
|
|
};
|
|
|
|
urlPrefix = mirror://debian;
|
|
|
|
} // args);
|
|
|
|
|
2008-04-09 14:02:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Common packages for Fedora images. */
|
|
|
|
commonFedoraPackages = [
|
|
|
|
"autoconf"
|
|
|
|
"automake"
|
|
|
|
"basesystem"
|
|
|
|
"bzip2"
|
|
|
|
"curl"
|
|
|
|
"diffutils"
|
|
|
|
"fedora-release"
|
|
|
|
"findutils"
|
|
|
|
"gawk"
|
|
|
|
"gcc-c++"
|
|
|
|
"gzip"
|
|
|
|
"make"
|
|
|
|
"patch"
|
|
|
|
"perl"
|
|
|
|
"pkgconfig"
|
|
|
|
"rpm"
|
|
|
|
"rpm-build"
|
|
|
|
"tar"
|
|
|
|
"unzip"
|
|
|
|
];
|
|
|
|
|
2008-04-11 13:52:40 +02:00
|
|
|
/* Common packages for openSUSE images. */
|
|
|
|
commonOpenSUSEPackages = [
|
|
|
|
"aaa_base"
|
|
|
|
"autoconf"
|
|
|
|
"automake"
|
|
|
|
"bzip2"
|
|
|
|
"curl"
|
|
|
|
"diffutils"
|
|
|
|
"findutils"
|
|
|
|
"gawk"
|
|
|
|
"gcc-c++"
|
|
|
|
"gzip"
|
|
|
|
"make"
|
|
|
|
"patch"
|
|
|
|
"perl"
|
|
|
|
"pkg-config"
|
|
|
|
"rpm"
|
|
|
|
"tar"
|
|
|
|
"unzip"
|
2008-04-13 23:04:21 +02:00
|
|
|
"util-linux"
|
2009-07-02 14:53:25 +02:00
|
|
|
"gnu-getopt"
|
2008-04-11 13:52:40 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
|
2008-04-09 14:02:15 +02:00
|
|
|
/* Common packages for Debian/Ubuntu images. */
|
|
|
|
commonDebianPackages = [
|
|
|
|
"base-passwd"
|
|
|
|
"dpkg"
|
|
|
|
"libc6-dev"
|
|
|
|
"perl"
|
|
|
|
"sysvinit"
|
|
|
|
"bash"
|
2009-10-02 11:34:37 +02:00
|
|
|
"dash"
|
2008-04-09 14:02:15 +02:00
|
|
|
"gzip"
|
|
|
|
"bzip2"
|
|
|
|
"tar"
|
|
|
|
"grep"
|
|
|
|
"findutils"
|
|
|
|
"g++"
|
|
|
|
"make"
|
|
|
|
"curl"
|
|
|
|
"patch"
|
|
|
|
"diff"
|
2008-11-12 18:15:09 +01:00
|
|
|
"locales"
|
2008-11-25 03:20:41 +01:00
|
|
|
# Needed by checkinstall:
|
|
|
|
"util-linux"
|
|
|
|
"file"
|
|
|
|
"dpkg-dev"
|
2009-07-02 14:53:25 +02:00
|
|
|
"pkg-config"
|
2009-02-24 11:56:42 +01:00
|
|
|
# Needed because it provides /etc/login.defs, whose absence causes
|
|
|
|
# the "passwd" post-installs script to fail.
|
|
|
|
"login"
|
|
|
|
# For shutting up some messages during some post-install scripts:
|
|
|
|
"mktemp"
|
2008-04-09 14:02:15 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
|
2009-11-05 15:49:17 +01:00
|
|
|
# Ubuntu 9.10 no longer has sysvinit.
|
|
|
|
karmicPackages = lib.filter (x: x != "sysvinit") commonDebianPackages;
|
|
|
|
|
|
|
|
|
2008-03-18 13:54:21 +01:00
|
|
|
/* A bunch of disk images. */
|
|
|
|
|
|
|
|
diskImages = {
|
|
|
|
|
|
|
|
redhat9i386 = fillDiskWithRPMs {
|
2008-03-18 22:14:02 +01:00
|
|
|
name = "redhat-9-i386";
|
2008-03-18 13:54:21 +01:00
|
|
|
fullName = "Red Hat Linux 9 (i386)";
|
2008-03-27 14:39:23 +01:00
|
|
|
size = 1024;
|
2008-03-18 13:54:21 +01:00
|
|
|
rpms = import ./rpm/redhat-9-i386.nix {inherit fetchurl;};
|
|
|
|
};
|
|
|
|
|
|
|
|
suse90i386 = fillDiskWithRPMs {
|
2008-03-18 22:14:02 +01:00
|
|
|
name = "suse-9.0-i386";
|
2008-03-18 13:54:21 +01:00
|
|
|
fullName = "SUSE Linux 9.0 (i386)";
|
2008-03-27 14:39:23 +01:00
|
|
|
size = 1024;
|
2008-03-18 13:54:21 +01:00
|
|
|
rpms = import ./rpm/suse-9-i386.nix {inherit fetchurl;};
|
2008-03-18 15:56:47 +01:00
|
|
|
# Urgh. The /etc/group entries are installed by aaa_base (or
|
|
|
|
# something) but due to dependency ordering, that package isn't
|
|
|
|
# installed yet by the time some other packages refer to these
|
|
|
|
# entries.
|
|
|
|
preInstall = ''
|
|
|
|
echo 'bin:x:1:daemon' >> /mnt/etc/group
|
|
|
|
echo 'tty:x:5:' >> /mnt/etc/group
|
|
|
|
echo 'disk:x:6:' >> /mnt/etc/group
|
|
|
|
echo 'lp:x:7:' >> /mnt/etc/group
|
|
|
|
echo 'uucp:x:14:' >> /mnt/etc/group
|
|
|
|
echo 'audio:x:17:' >> /mnt/etc/group
|
|
|
|
echo 'video:x:33:' >> /mnt/etc/group
|
|
|
|
'';
|
2008-03-18 13:54:21 +01:00
|
|
|
};
|
|
|
|
|
2009-10-01 09:49:55 +02:00
|
|
|
fedora2i386 = diskImageExtraFuns.fedora2i386 [];
|
|
|
|
fedora3i386 = diskImageExtraFuns.fedora3i386 [];
|
|
|
|
fedora5i386 = diskImageExtraFuns.fedora5i386 [];
|
|
|
|
fedora7i386 = diskImageExtraFuns.fedora7i386 [];
|
|
|
|
fedora8i386 = diskImageExtraFuns.fedora8i386 [];
|
|
|
|
fedora9i386 = diskImageExtraFuns.fedora9i386 [];
|
|
|
|
fedora9x86_64 = diskImageExtraFuns.fedora9x86_64 [];
|
|
|
|
fedora10i386 = diskImageExtraFuns.fedora10i386 [];
|
|
|
|
fedora10x86_64 = diskImageExtraFuns.fedora10x86_64 [];
|
|
|
|
fedora11i386 = diskImageExtraFuns.fedora11i386 [];
|
|
|
|
fedora11x86_64 = diskImageExtraFuns.fedora11x86_64 [];
|
2009-12-09 23:35:46 +01:00
|
|
|
fedora12i386 = diskImageExtraFuns.fedora12i386 [];
|
|
|
|
fedora12x86_64 = diskImageExtraFuns.fedora12x86_64 [];
|
2009-10-01 09:49:55 +02:00
|
|
|
opensuse103i386 = diskImageExtraFuns.opensuse103i386 [];
|
|
|
|
opensuse110i386 = diskImageExtraFuns.opensuse110i386 [];
|
|
|
|
opensuse110x86_64 = diskImageExtraFuns.opensuse110x86_64 [];
|
|
|
|
opensuse111i386 = diskImageExtraFuns.opensuse111i386 [];
|
|
|
|
opensuse111x86_64 = diskImageExtraFuns.opensuse111x86_64 [];
|
2008-04-09 12:06:16 +02:00
|
|
|
|
2009-10-01 09:49:55 +02:00
|
|
|
ubuntu710i386 = diskImageExtraFuns.ubuntu710i386 [];
|
|
|
|
ubuntu804i386 = diskImageExtraFuns.ubuntu804i386 [];
|
|
|
|
ubuntu804x86_64 = diskImageExtraFuns.ubuntu804x86_64 [];
|
|
|
|
ubuntu810i386 = diskImageExtraFuns.ubuntu810i386 [];
|
|
|
|
ubuntu810x86_64 = diskImageExtraFuns.ubuntu810x86_64 [];
|
|
|
|
ubuntu904i386 = diskImageExtraFuns.ubuntu904i386 [];
|
|
|
|
ubuntu904x86_64 = diskImageExtraFuns.ubuntu904x86_64 [];
|
2009-11-05 15:49:17 +01:00
|
|
|
ubuntu910i386 = diskImageExtraFuns.ubuntu910i386 [];
|
|
|
|
ubuntu910x86_64 = diskImageExtraFuns.ubuntu910x86_64 [];
|
2009-10-01 09:49:55 +02:00
|
|
|
debian40i386 = diskImageExtraFuns.debian40i386 [];
|
|
|
|
debian40x86_64 = diskImageExtraFuns.debian40x86_64 [];
|
|
|
|
debian50i386 = diskImageExtraFuns.debian50i386 [];
|
|
|
|
debian50x86_64 = diskImageExtraFuns.debian50x86_64 [];
|
2008-03-18 13:54:21 +01:00
|
|
|
};
|
|
|
|
|
2009-10-01 09:49:55 +02:00
|
|
|
diskImageExtraFuns = {
|
|
|
|
fedora2i386 = extraVirtualPackages : diskImageFuns.fedora2i386 { packages = commonFedoraPackages ++ extraVirtualPackages; };
|
|
|
|
fedora3i386 = extraVirtualPackages : diskImageFuns.fedora3i386 { packages = commonFedoraPackages ++ extraVirtualPackages; };
|
|
|
|
fedora5i386 = extraVirtualPackages : diskImageFuns.fedora5i386 { packages = commonFedoraPackages ++ ["util-linux"] ++ extraVirtualPackages; };
|
|
|
|
fedora7i386 = extraVirtualPackages : diskImageFuns.fedora7i386 { packages = commonFedoraPackages ++ extraVirtualPackages; };
|
|
|
|
fedora8i386 = extraVirtualPackages : diskImageFuns.fedora8i386 { packages = commonFedoraPackages ++ extraVirtualPackages; };
|
|
|
|
fedora9i386 = extraVirtualPackages : diskImageFuns.fedora9i386 { packages = commonFedoraPackages ++ [ "cronie" "util-linux-ng" ] ++ extraVirtualPackages; };
|
|
|
|
fedora9x86_64 = extraVirtualPackages : diskImageFuns.fedora9x86_64 { packages = commonFedoraPackages ++ [ "cronie" "util-linux-ng" ] ++ extraVirtualPackages; };
|
|
|
|
fedora10i386 = extraVirtualPackages : diskImageFuns.fedora10i386 { packages = commonFedoraPackages ++ [ "cronie" "util-linux-ng" ] ++ extraVirtualPackages; };
|
|
|
|
fedora10x86_64 = extraVirtualPackages : diskImageFuns.fedora10x86_64 { packages = commonFedoraPackages ++ [ "cronie" "util-linux-ng" ] ++ extraVirtualPackages; };
|
|
|
|
fedora11i386 = extraVirtualPackages : diskImageFuns.fedora11i386 { packages = commonFedoraPackages ++ [ "cronie" "util-linux-ng" ] ++ extraVirtualPackages; };
|
|
|
|
fedora11x86_64 = extraVirtualPackages : diskImageFuns.fedora11x86_64 { packages = commonFedoraPackages ++ [ "cronie" "util-linux-ng" ] ++ extraVirtualPackages; };
|
2009-12-09 23:35:46 +01:00
|
|
|
fedora12i386 = extraVirtualPackages : diskImageFuns.fedora12i386 { packages = commonFedoraPackages ++ [ "cronie" "util-linux-ng" ] ++ extraVirtualPackages; };
|
|
|
|
fedora12x86_64 = extraVirtualPackages : diskImageFuns.fedora12x86_64 { packages = commonFedoraPackages ++ [ "cronie" "util-linux-ng" ] ++ extraVirtualPackages; };
|
2009-10-01 09:49:55 +02:00
|
|
|
opensuse103i386 = extraVirtualPackages : diskImageFuns.opensuse103i386 { packages = commonOpenSUSEPackages ++ ["devs"] ++ extraVirtualPackages; };
|
|
|
|
opensuse110i386 = extraVirtualPackages : diskImageFuns.opensuse110i386 { packages = commonOpenSUSEPackages ++ extraVirtualPackages; };
|
|
|
|
opensuse110x86_64 = extraVirtualPackages : diskImageFuns.opensuse110x86_64 { packages = commonOpenSUSEPackages ++ extraVirtualPackages; };
|
|
|
|
opensuse111i386 = extraVirtualPackages : diskImageFuns.opensuse111i386 { packages = commonOpenSUSEPackages ++ extraVirtualPackages; };
|
|
|
|
opensuse111x86_64 = extraVirtualPackages : diskImageFuns.opensuse111x86_64 { packages = commonOpenSUSEPackages ++ extraVirtualPackages; };
|
|
|
|
|
|
|
|
ubuntu710i386 = extraVirtualPackages : diskImageFuns.ubuntu710i386 { packages = commonDebianPackages ++ extraVirtualPackages; };
|
|
|
|
ubuntu804i386 = extraVirtualPackages : diskImageFuns.ubuntu804i386 { packages = commonDebianPackages ++ extraVirtualPackages; };
|
|
|
|
ubuntu804x86_64 = extraVirtualPackages : diskImageFuns.ubuntu804x86_64 { packages = commonDebianPackages ++ extraVirtualPackages; };
|
|
|
|
ubuntu810i386 = extraVirtualPackages : diskImageFuns.ubuntu810i386 { packages = commonDebianPackages ++ extraVirtualPackages; };
|
|
|
|
ubuntu810x86_64 = extraVirtualPackages : diskImageFuns.ubuntu810x86_64 { packages = commonDebianPackages ++ extraVirtualPackages; };
|
|
|
|
ubuntu904i386 = extraVirtualPackages : diskImageFuns.ubuntu904i386 { packages = commonDebianPackages ++ extraVirtualPackages; };
|
|
|
|
ubuntu904x86_64 = extraVirtualPackages : diskImageFuns.ubuntu904x86_64 { packages = commonDebianPackages ++ extraVirtualPackages; };
|
2009-11-05 15:49:17 +01:00
|
|
|
ubuntu910i386 = extraVirtualPackages : diskImageFuns.ubuntu910i386 { packages = karmicPackages ++ extraVirtualPackages; };
|
|
|
|
ubuntu910x86_64 = extraVirtualPackages : diskImageFuns.ubuntu910x86_64 { packages = karmicPackages ++ extraVirtualPackages; };
|
2009-10-01 09:49:55 +02:00
|
|
|
debian40i386 = extraVirtualPackages : diskImageFuns.debian40i386 { packages = commonDebianPackages ++ extraVirtualPackages; };
|
|
|
|
debian40x86_64 = extraVirtualPackages : diskImageFuns.debian40x86_64 { packages = commonDebianPackages ++ extraVirtualPackages; };
|
|
|
|
debian50i386 = extraVirtualPackages : diskImageFuns.debian50i386 { packages = commonDebianPackages ++ extraVirtualPackages; };
|
|
|
|
debian50x86_64 = extraVirtualPackages : diskImageFuns.debian50x86_64 { packages = commonDebianPackages ++ extraVirtualPackages; };
|
|
|
|
};
|
2008-04-09 14:02:15 +02:00
|
|
|
|
2008-03-14 14:51:01 +01:00
|
|
|
}
|