- various cleanups

- have mingetty listen on tty2 (but this still fails because of missing /dev/log
- get rid of /init on the targetdrive, solely use /sbin/init (and even that has to go one day)
- use dietlibc statically linked e2fsprogs for the installer. More to come :)

svn path=/nixu/trunk/; revision=3734
This commit is contained in:
Armijn Hemel 2005-08-28 00:51:34 +00:00
parent fff45e114e
commit de289092b2
6 changed files with 26 additions and 43 deletions

View File

@ -34,7 +34,7 @@ for i in $boot $halt $login $env; do
-e "s^@gnugrep\@^$gnugrep^g" \
-e "s^@gzip\@^$gzip^g" \
-e "s^@gcc\@^$gcc^g" \
-e "s^@mingetty\@^$mingetty^g" \
-e "s^@mingettyWrapper\@^$mingettyWrapper^g" \
-e "s^@module_init_tools\@^$module_init_tools^g" \
-e "s^@grub\@^$grubWrapper^g" \
-e "s^@udev\@^$udev^g" \

View File

@ -1,7 +1,7 @@
{ stdenv, kernel, bash, coreutils, findutilsWrapper, utillinux, sysvinit, e2fsprogs
, nettools, nix, subversion, gcc, wget, which, vim, less, screen, openssh
, binutils, strace, shadowutils, iputils, gnumake, curl, gnused, gnugrep
, gnutar, gzip, mingetty, grubWrapper, parted, module_init_tools, hotplug
, gnutar, gzip, mingettyWrapper, grubWrapper, parted, module_init_tools, hotplug
, udev, dhcpWrapper, man, nano}:
derivation {
@ -15,6 +15,6 @@ derivation {
inherit stdenv kernel bash coreutils findutilsWrapper utillinux sysvinit
e2fsprogs nettools nix subversion gcc wget which vim less screen
openssh binutils strace shadowutils iputils gnumake curl gnused
gnutar gnugrep gzip mingetty grubWrapper parted module_init_tools
gnutar gnugrep gzip mingettyWrapper grubWrapper parted module_init_tools
udev dhcpWrapper man nano;
}

View File

@ -1 +1 @@
export PATH=@nix@/bin:@bash@/bin:@coreutils@/bin:@findutilsWrapper@/bin:@utillinux@/bin:@utillinux@/sbin:@sysvinit@/bin:@sysvinit@/sbin:@e2fsprogs@/bin:@e2fsprogs@/sbin:@nettools@/bin:@nettools@/sbin:@gcc@/bin:@subversion@/bin:@which@/bin:@wget@/bin:@vim@/bin:@less@/bin:@screen@/bin:@openssh@/bin:@binutils@/bin:@strace@/bin:@shadowutils@/bin:@shadowutils@/sbin:@iputils@/bin:@gnumake@/bin:@curl@/bin:@gnused@/bin:@gnutar@/bin:@gnugrep@/bin:@gzip@/bin:@mingetty@/sbin:@grub@/bin:@grub@/sbin:@module_init_tools@/sbin:@dhcpWrapper@/sbin:@man@/bin:@nano@/bin
export PATH=@nix@/bin:@bash@/bin:@coreutils@/bin:@findutilsWrapper@/bin:@utillinux@/bin:@utillinux@/sbin:@sysvinit@/bin:@sysvinit@/sbin:@e2fsprogs@/bin:@e2fsprogs@/sbin:@nettools@/bin:@nettools@/sbin:@gcc@/bin:@subversion@/bin:@which@/bin:@wget@/bin:@vim@/bin:@less@/bin:@screen@/bin:@openssh@/bin:@binutils@/bin:@strace@/bin:@shadowutils@/bin:@shadowutils@/sbin:@iputils@/bin:@gnumake@/bin:@curl@/bin:@gnused@/bin:@gnutar@/bin:@gnugrep@/bin:@gzip@/bin:@mingettyWrapper@/sbin:@grub@/bin:@grub@/sbin:@module_init_tools@/sbin:@dhcpWrapper@/sbin:@man@/bin:@nano@/bin

View File

@ -2,6 +2,11 @@
export PATH=@bash@/bin:@coreutils@/bin:@findutils@/bin:@utillinux@/bin:@utillinux@/sbin:@e2fsprogs@/sbin:@grub@/sbin:@sysvinitPath@/sbin:@gnugrep@/bin:@which@/bin:@gnutar@/bin
##
## In the beginning we want to have a minimalistic environment, built with
## klibc.
##
kernel=@kernel@
storePaths=/mystorepaths
@ -10,6 +15,7 @@ sysvinitPath=@sysvinitPath@
bootPath=@bootPath@
modutils=@modutils@
hotplug=@hotplug@
mingetty=@mingetty@
echo mounting special filesystems
@ -176,22 +182,13 @@ mknod -m 0600 $root/dev/tty0 c 4 0
mknod -m 0600 $root/dev/tty1 c 4 1
mknod -m 0444 $root/dev/urandom c 1 9
#touch_file /etc/passwd
#touch_file /etc/shadow
#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...
#devices=$(grep -r cdrom hd* | cut -d '/' -f 1 | sort | uniq)
#echo devices ${devices}
DEVICES="/dev/hd?"
for i in ${DEVICES}
@ -204,13 +201,14 @@ then
cddevice=$i
echo "Accessing NixOS CDROM at $i"
break
fi
#umount /cdrom
fi
fi
done
echo switch to /nix and /nixpkgs from CD
## starting here it's OK to have full blown glibc
ln -s /cdrom/nixpkgs /nixpkgs
mount --bind /cdrom/nix /nix
@ -222,7 +220,6 @@ export NIX_CONF_DIR=$root/nix/etc
NIX_CMD_PATH=@NIX_CMD_PATH@/bin
echo initialising Nix DB...
#/nix/bin/nix-store --init
$NIX_CMD_PATH/nix-store --init
echo verifying Nix DB...
@ -258,10 +255,6 @@ cp /cdrom/mystorepaths $root/tmp
echo copying store
#(while read storepaths; do
#cp -fa $storepaths $root/nix/store
#done) < /cdrom/mystorepaths
#cp -fva /nix/store/* $root/nix/store
tar cf - /nix/store | tar --directory=$root -xvf -
@ -269,23 +262,10 @@ echo registering valid paths...
$NIX_CMD_PATH/nix-store --register-validity < $root/tmp/mystorepaths
#(while read storepath; do
# echo PATH $storepath
# if ! $NIX_CMD_PATH/nix-store --isvalid $storepath 2> /dev/null; then
# (unset NIX_ROOT; $NIX_CMD_PATH/nix-store --dump $storepath) | $NIX_CMD_PATH/nix-store --restore $storepath
# $NIX_CMD_PATH/nix-store --validpath $storepath
# fi
#done) < /tmp/mystorepaths
#echo registering successors...
#(while read line; do
# echo SUCC $line
# $NIX_CMD_PATH/nix-store --successor $line
#done) < /tmp/mysuccessors
echo setting init symlink...
rm -f $root/init
ln -s $sysvinitPath/sbin/init $root/init
#ln -s $sysvinitPath/sbin/init $root/init
ln -s @sysvinitPath@/sbin/init $root/sbin/init
ln -s @bash@/bin/sh $root/bin/sh
ln -s @bash@/bin/bash $root/bin/bash
@ -295,6 +275,7 @@ echo "id:2:initdefault:" >> $root/etc/inittab
echo "si::bootwait:$bootPath/bin/boot.sh" >> $root/etc/inittab
echo "ht:06:wait:$bootPath/bin/halt.sh" >> $root/etc/inittab
echo "1:2345:respawn:$bootPath/bin/login.sh /dev/tty1" >> $root/etc/inittab
echo "2:2345:respawn:$mingetty/sbin/mingetty tty2" >> $root/etc/inittab
#echo "2:2345:respawn:$bootPath/bin/login.sh /dev/ttys/1" >> $root/etc/inittab
echo setting up networking information...
@ -338,7 +319,6 @@ chmod 644 $root/lib/modules/$version/modules.*
### Do funky stuff with grub here.
###
ln -s @sysvinitPath@/sbin/init $root/sbin/init
ln -s @hotplug@/sbin/hotplug $root/sbin/hotplug
ln -s @hotplug@/etc/hotplug $root/etc/hotplug
ln -s @hotplug@/etc/hotplug.d $root/etc/hotplug.d

View File

@ -78,7 +78,7 @@ done
utilLinux=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).utillinux' | $NIX_CMD_PATH/nix-instantiate -)))
coreUtils=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).coreutils' | $NIX_CMD_PATH/nix-instantiate -)))
e2fsProgs=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).e2fsprogs' | $NIX_CMD_PATH/nix-instantiate -)))
e2fsProgs=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).e2fsprogsDiet' | $NIX_CMD_PATH/nix-instantiate -)))
modUtils=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).module_init_tools' | $NIX_CMD_PATH/nix-instantiate -)))
Grub=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).grubWrapper' | $NIX_CMD_PATH/nix-instantiate -)))
#gnuSed=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).gnused' | $NIX_CMD_PATH/nix-instantiate -)))
@ -91,9 +91,10 @@ bash=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).bash' | $NIX_CMD_P
coreutils=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).coreutils' | $NIX_CMD_PATH/nix-instantiate -))
findutils=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).findutilsWrapper' | $NIX_CMD_PATH/nix-instantiate -))
utillinux=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).utillinux' | $NIX_CMD_PATH/nix-instantiate -))
e2fsprogs=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).e2fsprogs' | $NIX_CMD_PATH/nix-instantiate -))
e2fsprogs=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).e2fsprogsDiet' | $NIX_CMD_PATH/nix-instantiate -))
modutils=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).module_init_tools' | $NIX_CMD_PATH/nix-instantiate -))
grub=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).grubWrapper' | $NIX_CMD_PATH/nix-instantiate -))
mingettyWrapper=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).mingettyWrapper' | $NIX_CMD_PATH/nix-instantiate -))
hotplug=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).hotplug' | $NIX_CMD_PATH/nix-instantiate -))
udev=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).udev' | $NIX_CMD_PATH/nix-instantiate -))
dhcp=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).dhcpWrapper' | $NIX_CMD_PATH/nix-instantiate -))
@ -178,6 +179,7 @@ sed -e "s^@sysvinitPath\@^$sysvinitPath^g" \
-e "s^@gnugrep\@^$gnugrep^g" \
-e "s^@which\@^$which^g" \
-e "s^@gnutar\@^$gnutar^g" \
-e "s^@mingetty\@^$mingettyWrapper^g" \
< $fill_disk > $fill_disk.tmp
mv $fill_disk.tmp $fill_disk

View File

@ -1,19 +1,20 @@
rec {
inherit (import /nixpkgs/trunk/pkgs/system/i686-linux.nix)
stdenv kernel bash coreutils findutilsWrapper utillinux sysvinit e2fsprogs
stdenv kernel bash coreutils findutilsWrapper utillinux sysvinit
e2fsprogsDiet e2fsprogs
nettools nix subversion gcc wget which vim less screen openssh binutils
strace shadowutils iputils gnumake curl gnused gnutar gnugrep gzip
mingetty grubWrapper syslinux parted module_init_tools hotplug udev
mingettyWrapper grubWrapper syslinux parted module_init_tools hotplug udev
dhcpWrapper man nano;
boot = (import ./boot) {inherit stdenv kernel bash coreutils findutilsWrapper
utillinux sysvinit e2fsprogs nettools nix subversion gcc wget which vim
less screen openssh binutils strace shadowutils iputils gnumake curl
gnused gnutar gnugrep gzip mingetty grubWrapper parted module_init_tools
gnused gnutar gnugrep gzip mingettyWrapper grubWrapper parted module_init_tools
hotplug udev dhcpWrapper man nano;};
init = (import ./init) {inherit stdenv bash coreutils utillinux e2fsprogs
nix shadowutils mingetty grubWrapper parted module_init_tools hotplug
init = (import ./init) {inherit stdenv bash coreutils utillinux e2fsprogsDiet
nix shadowutils mingettyWrapper grubWrapper parted module_init_tools hotplug
dhcpWrapper man nano;};
everything = [boot sysvinit kernel];