svn path=/nixpkgs/trunk/; revision=11189

This commit is contained in:
Eelco Dolstra 2008-03-18 21:14:02 +00:00
parent 2514c86033
commit 3a05713cb7
3 changed files with 21 additions and 20 deletions

View File

@ -305,9 +305,7 @@ rec {
buildCommand = '' buildCommand = ''
${createRootFS} ${createRootFS}
echo "initialising RPM DB..." chroot=$(type -tP chroot)
rpm="${rpm}/bin/rpm --root /mnt --dbpath /var/lib/rpm"
$rpm --initdb
echo "unpacking RPMs..." echo "unpacking RPMs..."
for i in $rpms; do for i in $rpms; do
@ -317,12 +315,15 @@ rec {
eval "$preInstall" eval "$preInstall"
echo "initialising RPM DB..."
PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
rpm --initdb
# Make the Nix store available in /mnt, because that's where the RPMs live. # Make the Nix store available in /mnt, because that's where the RPMs live.
mkdir -p /mnt/nix/store mkdir -p /mnt/nix/store
${klibcShrunk}/bin/mount -o bind /nix/store /mnt/nix/store ${klibcShrunk}/bin/mount -o bind /nix/store /mnt/nix/store
echo "installing RPMs..." echo "installing RPMs..."
chroot=$(type -tP chroot)
PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \ PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
rpm -iv $rpms rpm -iv $rpms
@ -364,9 +365,11 @@ rec {
distribution installed in the filesystem `diskImage'. The distribution installed in the filesystem `diskImage'. The
tarball must contain an RPM specfile. */ tarball must contain an RPM specfile. */
buildRPM = attrs: runInLinuxImage (stdenv.mkDerivation (attrs // { buildRPM = attrs: runInLinuxImage (stdenv.mkDerivation ({
phases = "sysInfoPhase buildPhase installPhase"; phases = "sysInfoPhase buildPhase installPhase";
outDir = "rpms/${attrs.diskImage.name}";
sysInfoPhase = '' sysInfoPhase = ''
header "base RPMs" header "base RPMs"
rpm -qa --qf "%{Name}-%{Version}-%{Release} (%{Arch}; %{Distribution}; %{Vendor})\n" rpm -qa --qf "%{Name}-%{Version}-%{Release} (%{Arch}; %{Distribution}; %{Vendor})\n"
@ -388,16 +391,16 @@ rec {
''; '';
installPhase = '' installPhase = ''
ensureDir $out/rpms ensureDir $out/$outDir
find /usr/src -name "*.rpm" -exec cp {} $out/rpms \; find /usr/src -name "*.rpm" -exec cp {} $out/$outDir \;
for i in $out/rpms/*.rpm; do for i in $out/$outDir/*.rpm; do
header "Generated RPM/SRPM: $i" header "Generated RPM/SRPM: $i"
rpm -qip $i rpm -qip $i
stopNest stopNest
done done
''; ''; # */
})); } // attrs));
/* Create a filesystem image of the specified size and fill it with /* Create a filesystem image of the specified size and fill it with
@ -483,14 +486,14 @@ rec {
diskImages = { diskImages = {
redhat9i386 = fillDiskWithRPMs { redhat9i386 = fillDiskWithRPMs {
name = "redhat-9-i386-image"; name = "redhat-9-i386";
fullName = "Red Hat Linux 9 (i386)"; fullName = "Red Hat Linux 9 (i386)";
size = 768; size = 768;
rpms = import ./rpm/redhat-9-i386.nix {inherit fetchurl;}; rpms = import ./rpm/redhat-9-i386.nix {inherit fetchurl;};
}; };
suse90i386 = fillDiskWithRPMs { suse90i386 = fillDiskWithRPMs {
name = "suse-9.0-i386-image"; name = "suse-9.0-i386";
fullName = "SUSE Linux 9.0 (i386)"; fullName = "SUSE Linux 9.0 (i386)";
size = 768; size = 768;
rpms = import ./rpm/suse-9-i386.nix {inherit fetchurl;}; rpms = import ./rpm/suse-9-i386.nix {inherit fetchurl;};
@ -510,35 +513,35 @@ rec {
}; };
fedora2i386 = fillDiskWithRPMs { fedora2i386 = fillDiskWithRPMs {
name = "fedora-core-2-i386-image"; name = "fedora-core-2-i386";
fullName = "Fedora Core 2 (i386)"; fullName = "Fedora Core 2 (i386)";
size = 768; size = 768;
rpms = import ./rpm/fedora-2-i386.nix {inherit fetchurl;}; rpms = import ./rpm/fedora-2-i386.nix {inherit fetchurl;};
}; };
fedora3i386 = fillDiskWithRPMs { fedora3i386 = fillDiskWithRPMs {
name = "fedora-core-3-i386-image"; name = "fedora-core-3-i386";
fullName = "Fedora Core 3 (i386)"; fullName = "Fedora Core 3 (i386)";
size = 768; size = 768;
rpms = import ./rpm/fedora-3-i386.nix {inherit fetchurl;}; rpms = import ./rpm/fedora-3-i386.nix {inherit fetchurl;};
}; };
fedora5i386 = fillDiskWithRPMs { fedora5i386 = fillDiskWithRPMs {
name = "fedora-core-5-i386-image"; name = "fedora-core-5-i386";
fullName = "Fedora Core 5 (i386)"; fullName = "Fedora Core 5 (i386)";
size = 768; size = 768;
rpms = import ./rpm/fedora-5-i386.nix {inherit fetchurl;}; rpms = import ./rpm/fedora-5-i386.nix {inherit fetchurl;};
}; };
ubuntu710i386 = fillDiskWithDebs { ubuntu710i386 = fillDiskWithDebs {
name = "ubuntu-7.10-gutsy-i386-image"; name = "ubuntu-7.10-gutsy-i386";
fullName = "Ubuntu 7.10 Gutsy (i386)"; fullName = "Ubuntu 7.10 Gutsy (i386)";
size = 512; size = 512;
debs = import ./deb/ubuntu-7.10-gutsy-i386.nix {inherit fetchurl;}; debs = import ./deb/ubuntu-7.10-gutsy-i386.nix {inherit fetchurl;};
}; };
debian40r3i386 = fillDiskWithDebs { debian40r3i386 = fillDiskWithDebs {
name = "debian-4.0r3-etch-i386-image"; name = "debian-4.0r3-etch-i386";
fullName = "Debian 4.0r3 Etch (i386)"; fullName = "Debian 4.0r3 Etch (i386)";
size = 512; size = 512;
debs = import ./deb/debian-4.0r3-etch-i386.nix {inherit fetchurl;}; debs = import ./deb/debian-4.0r3-etch-i386.nix {inherit fetchurl;};

View File

@ -41,7 +41,6 @@ gcc-4.1.0-3.i386.rpm 6eb6292cb655d5e5af5a6f4d5712dcb2
gcc-c++-4.1.0-3.i386.rpm 982ec6e1c45d9540183bf19fd2070666 gcc-c++-4.1.0-3.i386.rpm 982ec6e1c45d9540183bf19fd2070666
gdbm-1.8.0-26.2.i386.rpm e4746da0a6faeb645feb800e05fea932 gdbm-1.8.0-26.2.i386.rpm e4746da0a6faeb645feb800e05fea932
glib-1.2.10-18.2.2.i386.rpm df4d5de569ea817e9397d3490c78cf42 glib-1.2.10-18.2.2.i386.rpm df4d5de569ea817e9397d3490c78cf42
glib-1.2.10-18.2.2.i386.rpm df4d5de569ea817e9397d3490c78cf42
glib2-2.10.1-1.i386.rpm 0bf35e951dc4499ecc20b64b7bc84dc7 glib2-2.10.1-1.i386.rpm 0bf35e951dc4499ecc20b64b7bc84dc7
glibc-2.4-4.i686.rpm a4a9695595d2a6c79eda24aea045e1a6 glibc-2.4-4.i686.rpm a4a9695595d2a6c79eda24aea045e1a6
glibc-common-2.4-4.i386.rpm 0a252ee07fcd7051f1176ea886465666 glibc-common-2.4-4.i386.rpm 0a252ee07fcd7051f1176ea886465666

View File

@ -41,7 +41,6 @@
(fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/gcc-c++-4.1.0-3.i386.rpm; md5="982ec6e1c45d9540183bf19fd2070666";}) (fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/gcc-c++-4.1.0-3.i386.rpm; md5="982ec6e1c45d9540183bf19fd2070666";})
(fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/gdbm-1.8.0-26.2.i386.rpm; md5="e4746da0a6faeb645feb800e05fea932";}) (fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/gdbm-1.8.0-26.2.i386.rpm; md5="e4746da0a6faeb645feb800e05fea932";})
(fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/glib-1.2.10-18.2.2.i386.rpm; md5="df4d5de569ea817e9397d3490c78cf42";}) (fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/glib-1.2.10-18.2.2.i386.rpm; md5="df4d5de569ea817e9397d3490c78cf42";})
(fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/glib-1.2.10-18.2.2.i386.rpm; md5="df4d5de569ea817e9397d3490c78cf42";})
(fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/glib2-2.10.1-1.i386.rpm; md5="0bf35e951dc4499ecc20b64b7bc84dc7";}) (fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/glib2-2.10.1-1.i386.rpm; md5="0bf35e951dc4499ecc20b64b7bc84dc7";})
(fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/glibc-2.4-4.i686.rpm; md5="a4a9695595d2a6c79eda24aea045e1a6";}) (fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/glibc-2.4-4.i686.rpm; md5="a4a9695595d2a6c79eda24aea045e1a6";})
(fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/glibc-common-2.4-4.i386.rpm; md5="0a252ee07fcd7051f1176ea886465666";}) (fetchurl {url=ftp://ftp.tudelft.nl/pub/Linux/download.fedora.redhat.com/linux/core/5/i386/os/Fedora/RPMS/glibc-common-2.4-4.i386.rpm; md5="0a252ee07fcd7051f1176ea886465666";})