* Doh! Make sure that we put *only* splash_helper in the initrd and

not all of splashutils, otherwise we get Glibc in the initrd.

svn path=/nixos/trunk/; revision=7771
This commit is contained in:
Eelco Dolstra 2007-01-23 13:44:41 +00:00
parent a7d81141be
commit 668c146e33
6 changed files with 62 additions and 28 deletions

View file

@ -128,7 +128,8 @@ rec {
rescueCD = import ../helpers/make-iso9660-image.nix {
inherit (pkgs) stdenv cdrtools;
isoName = "nixos.iso";
# Single files to be copied to fixed locations on the CD.
contents = [
{ source = pkgs.syslinux + "/lib/syslinux/isolinux.bin";
target = "isolinux/isolinux.bin";
@ -153,7 +154,12 @@ rec {
}
];
init = system.bootStage2;
# Closures to be copied to the Nix store on the CD.
storeContents = [
{ object = system.bootStage2;
symlink = "/init";
}
];
bootable = true;
bootImage = "isolinux/isolinux.bin";

View file

@ -19,6 +19,7 @@
</info>
<xi:include href="installation.xml" />
<xi:include href="options-db.xml" />
</book>

View file

@ -9,16 +9,12 @@
# grafted in the file system at path `target'.
contents
/*
, # In addition to `contents', the closure of the store paths listed
# in `packages' are also placed in the file system.
packages ? []
*/
, # `init' should be a store path, the closure of which is added to
# the image, just like `packages'. However, in addition, a symlink
# `/init' to `init' will be created.
init ? null
# in `packages' are also placed in the Nix store of the CD. This is
# a list of attribute sets {source, target} where `source' if a
# store path whose closure will be copied, and `target' is a symlink
# to `source' that will be added to the CD.
storeContents ? []
# Whether this should be an El-Torito bootable CD.
, bootable ? false
@ -34,11 +30,18 @@ stdenv.mkDerivation {
name = "iso9660-image";
builder = ./make-iso9660-image.sh;
buildInputs = [cdrtools];
inherit isoName init bootable bootImage;
sources = map ({source, target}: source) contents;
targets = map ({source, target}: target) contents;
inherit isoName bootable bootImage;
# For obtaining the closure of `init'.
exportReferencesGraph = ["init-closure" init];
# !!! should use XML.
sources = map (x: x.source) contents;
targets = map (x: x.target) contents;
# !!! should use XML.
objects = map (x: x.object) storeContents;
symlinks = map (x: x.symlink) storeContents;
# For obtaining the closure of `storeContents'.
exportReferencesGraph =
map (x: [("closure-" + baseNameOf x.symlink) x.object]) storeContents;
pathsFromGraph = ./paths-from-graph.sh;
}

View file

@ -1,26 +1,46 @@
source $stdenv/setup
sources_=($sources)
targets_=($targets)
objects=($objects)
symlinks=($symlinks)
if test -n "$bootable"; then
bootFlags="-b $bootImage -c boot.cat -no-emul-boot -boot-load-size 4"
fi
graftList=
sources_=($sources)
targets_=($targets)
for ((i = 0; i < ${#targets_[@]}; i++)); do
graftList="$graftList ${targets_[$i]}=$(readlink -f ${sources_[$i]})"
done
storePaths=$($SHELL $pathsFromGraph ./init-closure)
for i in $storePaths; do
graftList="$graftList ${i:1}=$i"
for ((n = 0; n < ${#objects[*]}; n++)); do
object=${objects[$n]}
symlink=${symlinks[$n]}
# Get the paths in the closure of `object'.
closure=closure-$(basename $symlink)
if ! test -e $closure; then
echo 'Your Nix installation is too old! Upgrade to nix-0.11pre7038 or newer.'
exit 1
fi
storePaths=$($SHELL $pathsFromGraph $closure)
for i in $storePaths; do
graftList="$graftList ${i:1}=$i"
done
if test "$symlink" != "none"; then
mkdir -p $(dirname ./$symlink)
ln -s $object ./$symlink
graftList="$graftList $symlink=./$symlink"
fi
done
if test -n "$init"; then
ln -s $init init
graftList="$graftList init=init"
fi
# !!! -f is a quick hack.
ensureDir $out/iso

View file

@ -92,7 +92,10 @@ rec {
symlink = "/init";
}
] ++ (if config.get ["boot" "initrd" "enableSplashScreen"] then [
{ object = pkgs.splashutils;
{ object = pkgs.runCommand "splashutils" {} "
ensureDir $out/bin
cp ${pkgs.splashutils}/bin/splash_helper $out/bin
";
suffix = "/bin/splash_helper";
symlink = "/sbin/splash_helper";
}

View file

@ -1,4 +1,5 @@
server-user nscd
threads 1
paranoia no
debug-level 0
@ -7,7 +8,7 @@ positive-time-to-live passwd 600
negative-time-to-live passwd 20
suggested-size passwd 211
check-files passwd yes
persistent passwd yes
persistent passwd no
shared passwd yes
enable-cache group yes
@ -15,7 +16,7 @@ positive-time-to-live group 3600
negative-time-to-live group 60
suggested-size group 211
check-files group yes
persistent group yes
persistent group no
shared group yes
enable-cache hosts yes