* Don't use modprobe but insmod in the initrd. This means we don't
need module-init-tools in the initrd, since insmod is in klibc. * Give the installation CD a label. svn path=/nixos/trunk/; revision=12545
This commit is contained in:
parent
4d6548e94c
commit
abbe260a80
|
@ -8,6 +8,16 @@ fail() {
|
|||
}
|
||||
|
||||
|
||||
# Poor man's `basename'.
|
||||
basename() {
|
||||
local s="$1"
|
||||
set -- $(IFS=/; echo $s)
|
||||
local res
|
||||
while test $# != 0; do res=$1; shift; done
|
||||
echo $res
|
||||
}
|
||||
|
||||
|
||||
# Print a greeting.
|
||||
echo
|
||||
echo "<<< NixOS Stage 1 >>>"
|
||||
|
@ -34,7 +44,7 @@ mount -t sysfs none /sys
|
|||
|
||||
|
||||
# Process the kernel command line.
|
||||
stage2Init=
|
||||
stage2Init=/init
|
||||
for o in $(cat /proc/cmdline); do
|
||||
case $o in
|
||||
init=*)
|
||||
|
@ -59,10 +69,9 @@ done
|
|||
|
||||
|
||||
# Load some kernel modules.
|
||||
export MODULE_DIR=@modulesDir@/lib/modules/
|
||||
for i in @modules@; do
|
||||
echo "trying to load $i..."
|
||||
modprobe $i
|
||||
for i in $(cat @modulesClosure@/insmod-list); do
|
||||
echo "loading module $(basename $i)..."
|
||||
insmod $i
|
||||
done
|
||||
|
||||
|
||||
|
@ -84,8 +93,8 @@ echo shutdown > /sys/power/disk
|
|||
|
||||
# Create device nodes in /dev.
|
||||
export UDEV_CONFIG_FILE=/udev.conf
|
||||
echo 'udev_rules="/no-rules"' > $UDEV_CONFIG_FILE
|
||||
echo -n > /no-rules
|
||||
echo 'udev_rules="/rules"' > $UDEV_CONFIG_FILE
|
||||
mkdir /rules
|
||||
udevd --daemon
|
||||
udevadm trigger
|
||||
udevadm settle
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# is supposed to be put into an initial RAM disk (initrd).
|
||||
|
||||
{ substituteAll, staticShell, klibcShrunk
|
||||
, module_init_tools, extraUtils, modules, modulesDir
|
||||
, extraUtils, modulesClosure
|
||||
|
||||
, # Whether to find root device automatically using its label.
|
||||
autoDetectRootDevice
|
||||
|
@ -48,7 +48,7 @@ substituteAll {
|
|||
|
||||
isExecutable = true;
|
||||
|
||||
inherit staticShell modules modulesDir;
|
||||
inherit staticShell modulesClosure;
|
||||
|
||||
inherit autoDetectRootDevice isLiveCD mountPoints devices fsTypes optionss resumeDevice;
|
||||
|
||||
|
@ -56,7 +56,6 @@ substituteAll {
|
|||
|
||||
path = [
|
||||
extraUtils
|
||||
module_init_tools
|
||||
klibcShrunk
|
||||
];
|
||||
}
|
||||
|
|
|
@ -300,6 +300,8 @@ rec {
|
|||
bootImage = "boot/grub/stage2_eltorito";
|
||||
|
||||
inherit compressImage;
|
||||
|
||||
volumeID = "NIXOS_INSTALLATION_CD";
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ stdenv, perl, cdrkit, nixpkgsPath
|
||||
|
||||
# The file name of the resulting ISO image.
|
||||
, isoName ? "cd.iso"
|
||||
, # The file name of the resulting ISO image.
|
||||
isoName ? "cd.iso"
|
||||
|
||||
, # The files and directories to be placed in the ISO file system.
|
||||
# This is a list of attribute sets {source, target} where `source'
|
||||
|
@ -16,18 +16,20 @@
|
|||
# to `source' that will be added to the CD.
|
||||
storeContents ? []
|
||||
|
||||
,
|
||||
buildStoreContents ? []
|
||||
, buildStoreContents ? []
|
||||
|
||||
# Whether this should be an El-Torito bootable CD.
|
||||
, bootable ? false
|
||||
, # Whether this should be an El-Torito bootable CD.
|
||||
bootable ? false
|
||||
|
||||
# The path (in the ISO file system) of the boot image.
|
||||
, bootImage ? ""
|
||||
, # The path (in the ISO file system) of the boot image.
|
||||
bootImage ? ""
|
||||
|
||||
, # Whether to compress the resulting ISO image with bzip2.
|
||||
compressImage ? false
|
||||
|
||||
, # The volume ID.
|
||||
volumeID ? ""
|
||||
|
||||
}:
|
||||
|
||||
assert bootable -> bootImage != "";
|
||||
|
@ -36,7 +38,8 @@ stdenv.mkDerivation {
|
|||
name = "iso9660-image";
|
||||
builder = ./make-iso9660-image.sh;
|
||||
buildInputs = [perl cdrkit];
|
||||
inherit isoName bootable bootImage compressImage;
|
||||
|
||||
inherit isoName bootable bootImage compressImage volumeID;
|
||||
|
||||
# !!! should use XML.
|
||||
sources = map (x: x.source) contents;
|
||||
|
|
|
@ -61,13 +61,13 @@ cat pathlist | sed -e 's/=\(.*\)=\(.*\)=/\\=\1=\2\\=/' | tee pathlist.safer
|
|||
|
||||
|
||||
ensureDir $out/iso
|
||||
genCommand="genisoimage -iso-level 4 -r -J $bootFlags -hide-rr-moved -graft-points -path-list pathlist.safer"
|
||||
genCommand="genisoimage -iso-level 4 -r -J $bootFlags -hide-rr-moved -graft-points -path-list pathlist.safer ${volumeID:+-V $volumeID}"
|
||||
if test -z "$compressImage"; then
|
||||
$genCommand -o $out/iso/$isoName
|
||||
else
|
||||
$genCommand | bzip2 > $out/iso/$isoName.bz2
|
||||
fi
|
||||
|
||||
|
||||
|
||||
ensureDir $out/nix-support
|
||||
echo $system > $out/nix-support/system
|
||||
|
|
|
@ -107,8 +107,7 @@ rec {
|
|||
# mounting the root FS).
|
||||
bootStage1 = import ../boot/boot-stage-1.nix {
|
||||
inherit (pkgs) substituteAll;
|
||||
inherit (pkgsDiet) module_init_tools;
|
||||
inherit extraUtils;
|
||||
inherit extraUtils modulesClosure;
|
||||
inherit (kernelPackages) klibcShrunk;
|
||||
inherit (config.boot) autoDetectRootDevice isLiveCD;
|
||||
fileSystems =
|
||||
|
@ -116,8 +115,6 @@ rec {
|
|||
(fs: fs.mountPoint == "/" || (fs ? neededForBoot && fs.neededForBoot))
|
||||
config.fileSystems;
|
||||
rootLabel = config.boot.rootLabel;
|
||||
modulesDir = modulesClosure;
|
||||
modules = rootModules;
|
||||
staticShell = stdenvLinuxStuff.bootstrapTools.bash;
|
||||
resumeDevice = config.boot.resumeDevice;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue