mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-27 15:40:18 +02:00
split fill-disk in two parts
svn path=/nixu/trunk/; revision=3532
This commit is contained in:
parent
bc3ffa3458
commit
9babae1704
|
@ -4,6 +4,8 @@ derivation {
|
|||
name = "init";
|
||||
system = stdenv.system;
|
||||
builder = ./builder.sh;
|
||||
stage1 = ./prepare-disk.sh;
|
||||
stage2 = ./fill-disk.sh;
|
||||
inherit stdenv bash coreutils utillinux e2fsprogs nix shadowutils
|
||||
mingetty grub parted;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#! @bash@/bin/sh -e
|
||||
|
||||
export PATH=@bash@/bin:@coreutils@/bin:@findutils@/bin:@utillinux@/bin:@utillinux@/sbin
|
||||
export PATH=@bash@/bin:@coreutils@/bin:@findutils@/bin:@utillinux@/bin:@utillinux@/sbin:@e2fsprogs@/sbin
|
||||
|
||||
sysvinitPath=@sysvinitPath@
|
||||
bootPath=@bootPath@
|
||||
|
@ -47,7 +47,22 @@ mknod -m 0666 /dev/ptmx c 5 2
|
|||
mknod -m 0644 /dev/random c 1 8
|
||||
mknod -m 0644 /dev/urandom c 1 9
|
||||
|
||||
echo "blaat"
|
||||
mknod -m 0660 /dev/hda b 3 0
|
||||
mknod -m 0660 /dev/hda1 b 3 1
|
||||
mknod -m 0660 /dev/hda2 b 3 2
|
||||
mknod -m 0660 /dev/hda3 b 3 3
|
||||
|
||||
#mknod -m 0660 /dev/sda b 8 0
|
||||
#mknod -m 0660 /dev/sda1 b 8 1
|
||||
#mknod -m 0660 /dev/sda2 b 8 2
|
||||
#mknod -m 0660 /dev/sda3 b 8 3
|
||||
|
||||
echo "dev"
|
||||
cd /dev; echo *
|
||||
|
||||
mkfs.ext2 /dev/hda1
|
||||
mkswap /dev/hda2
|
||||
|
||||
|
||||
#if ! test -n "$1"
|
||||
#then
|
||||
|
@ -58,6 +73,8 @@ echo "blaat"
|
|||
#fi
|
||||
|
||||
device=/dev/hda1
|
||||
#device=/dev/sda1
|
||||
|
||||
|
||||
make_dir() {
|
||||
mode=$1
|
||||
|
@ -88,6 +105,10 @@ cd /sys; echo *
|
|||
# mount --bind /mnt/cdrom1/nix /nix
|
||||
# mount --bind /mnt/cdrom1/pkgs /nixpkgs/trunk/pkgs
|
||||
|
||||
##
|
||||
## Create a directory tree on the installation disk.
|
||||
##
|
||||
|
||||
make_dir 00755 /bin
|
||||
make_dir 00755 /dev
|
||||
make_dir 00755 /proc
|
||||
|
@ -110,6 +131,10 @@ make_dir 00755 /mnt/host
|
|||
make_dir 00755 /home
|
||||
make_dir 00755 /home/root
|
||||
|
||||
##
|
||||
## Add a few devices to /dev on the install disk. This is by far complete.
|
||||
##
|
||||
|
||||
mknod $root/dev/null c 1 3
|
||||
|
||||
touch_file /etc/passwd
|
||||
|
@ -119,6 +144,12 @@ touch_file /etc/group
|
|||
rm -f $root/etc/mtab
|
||||
#ln -s /proc/mounts $root/etc/mtab
|
||||
|
||||
cat /proc/mounts
|
||||
|
||||
## Probe for CD device which contains our CD here and mount /nix and
|
||||
## /nixpkgs from it inside the ramdisk. Anaconda uses kudzu for this.
|
||||
## Find out how Knoppix and SUSE do this...
|
||||
|
||||
export NIX_DATA_DIR=$root/nix/share
|
||||
export NIX_LOG_DIR=$root/nix/log/nix
|
||||
export NIX_STATE_DIR=$root/nix/var/nix
|
||||
|
@ -201,3 +232,7 @@ cp /etc/resolv.conf $root/etc
|
|||
rm -f $root/etc/hosts
|
||||
echo "127.0.0.1 localhost" >> $root/etc/hosts
|
||||
echo "192.168.150.1 uml" >> $root/etc/hosts
|
||||
|
||||
###
|
||||
### Do funky stuff with grub here.
|
||||
###
|
||||
|
|
Loading…
Reference in a new issue