* 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 { rescueCD = import ../helpers/make-iso9660-image.nix {
inherit (pkgs) stdenv cdrtools; inherit (pkgs) stdenv cdrtools;
isoName = "nixos.iso"; isoName = "nixos.iso";
# Single files to be copied to fixed locations on the CD.
contents = [ contents = [
{ source = pkgs.syslinux + "/lib/syslinux/isolinux.bin"; { source = pkgs.syslinux + "/lib/syslinux/isolinux.bin";
target = "isolinux/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; bootable = true;
bootImage = "isolinux/isolinux.bin"; bootImage = "isolinux/isolinux.bin";

View file

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

View file

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

View file

@ -1,26 +1,46 @@
source $stdenv/setup source $stdenv/setup
sources_=($sources)
targets_=($targets)
objects=($objects)
symlinks=($symlinks)
if test -n "$bootable"; then if test -n "$bootable"; then
bootFlags="-b $bootImage -c boot.cat -no-emul-boot -boot-load-size 4" bootFlags="-b $bootImage -c boot.cat -no-emul-boot -boot-load-size 4"
fi fi
graftList= graftList=
sources_=($sources)
targets_=($targets)
for ((i = 0; i < ${#targets_[@]}; i++)); do for ((i = 0; i < ${#targets_[@]}; i++)); do
graftList="$graftList ${targets_[$i]}=$(readlink -f ${sources_[$i]})" graftList="$graftList ${targets_[$i]}=$(readlink -f ${sources_[$i]})"
done done
storePaths=$($SHELL $pathsFromGraph ./init-closure)
for i in $storePaths; do for ((n = 0; n < ${#objects[*]}; n++)); do
graftList="$graftList ${i:1}=$i" 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 done
if test -n "$init"; then
ln -s $init init
graftList="$graftList init=init"
fi
# !!! -f is a quick hack. # !!! -f is a quick hack.
ensureDir $out/iso ensureDir $out/iso

View file

@ -92,7 +92,10 @@ rec {
symlink = "/init"; symlink = "/init";
} }
] ++ (if config.get ["boot" "initrd" "enableSplashScreen"] then [ ] ++ (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"; suffix = "/bin/splash_helper";
symlink = "/sbin/splash_helper"; symlink = "/sbin/splash_helper";
} }

View file

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