nixpkgs/test/make-initrd.nix
Eelco Dolstra 0b26af2188 * The installer now installs a configuration on the target device that
boots into stage 1 (kernel+initrd) succesfully.
  
  `system-configuration.nix' contains the definition of the
  configuration to be installed.  The attribute systemConfiguration is
  installed into the profile /nix/var/nix/profiles/system.  Then the
  program /nix/var/nix/profiles/system/bin/switch-to-configuration is
  called to finalise the installation.  This program (generated by
  system-configuration.sh) installs Grub on the drive with a menu that
  contains the entry for the desired kernel and initrd.

  In principle this allows us to do rollbacks to previous system
  configurations by doing `nix-env --rollback' and then calling
  switch-to-configuration to update Grub.  Ideally this should be done
  in a single command (and we should consider the obvious risk of
  garbage collecting the current kernel etc. to which the current Grub
  menu points...).

  Maybe the responsibility for generating the Grub menu should be
  placed somewhere else.  For instance, we could generate a Grub menu
  automatically out of all the generations in the `system' profile.

svn path=/nixu/trunk/; revision=7009
2006-11-12 23:30:03 +00:00

21 lines
713 B
Nix

# Create an initial ramdisk containing the specified set of packages.
# An initial ramdisk is used during the initial stages of booting a
# Linux system. It is loaded by the boot loader along with the kernel
# image. It's supposed to contain everything (such as kernel modules)
# necessary to allow us to mount the root file system. Once the root
# file system is mounted, the `real' boot script can be called.
#
# An initrd is really just a gzipped cpio archive.
#
# A symlink `/init' is made to the store path passed in the `init'
# argument.
{stdenv, cpio, packages, init, nix}:
stdenv.mkDerivation {
name = "initrd";
builder = ./make-initrd.sh;
buildInputs = [cpio nix];
inherit packages init;
}