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