2006-11-02 23:48:01 +01:00
|
|
|
#! @shell@
|
|
|
|
|
|
|
|
# Print a greeting.
|
2006-11-02 23:50:30 +01:00
|
|
|
echo
|
|
|
|
echo "<<< NixOS Stage 1 >>>"
|
|
|
|
echo
|
2006-11-02 23:48:01 +01:00
|
|
|
|
|
|
|
# Set the PATH.
|
|
|
|
export PATH=/empty
|
|
|
|
for i in @path@; do
|
|
|
|
PATH=$PATH:$i/bin
|
2006-11-03 01:36:08 +01:00
|
|
|
if test -e $i/sbin; then
|
|
|
|
PATH=$PATH:$i/sbin
|
|
|
|
fi
|
2006-11-02 23:48:01 +01:00
|
|
|
done
|
|
|
|
|
2006-11-03 01:36:08 +01:00
|
|
|
# Mount special file systems.
|
|
|
|
mkdir /etc # to shut up mount
|
|
|
|
touch /etc/fstab # idem
|
|
|
|
mkdir /proc
|
|
|
|
mount -t proc proc /proc
|
|
|
|
mkdir /sys
|
|
|
|
mount -t sysfs sys /sys
|
|
|
|
|
2006-11-03 00:58:06 +01:00
|
|
|
# Create device nodes in /dev.
|
|
|
|
source @makeDevices@
|
|
|
|
|
2006-11-03 01:36:08 +01:00
|
|
|
# Load some kernel modules.
|
2006-11-03 12:47:40 +01:00
|
|
|
export MODULE_DIR=@modules@/lib/modules/
|
2006-11-03 10:45:06 +01:00
|
|
|
modprobe ide-generic
|
|
|
|
modprobe ide-disk
|
|
|
|
modprobe ide-cd
|
|
|
|
|
|
|
|
# Mount the installation CD.
|
|
|
|
mkdir /mnt
|
|
|
|
mkdir /mnt/cdrom
|
|
|
|
mount -o ro /dev/hdc /mnt/cdrom
|
2006-11-03 01:36:08 +01:00
|
|
|
|
2006-11-04 01:01:13 +01:00
|
|
|
# Start stage 2. !!! We use chroot for now, but I guess that should
|
|
|
|
# be pivot_root or so.
|
|
|
|
chroot /mnt/cdrom /init
|
|
|
|
|
|
|
|
# If starting stage 2 failed, start an interactive shell.
|
|
|
|
echo "Stage 2 failed, starting emergency shell..."
|
2006-11-02 23:48:01 +01:00
|
|
|
exec @shell@
|