From 4c6230b0a6c7e9d52cc8869c2a6c72f198189455 Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Sun, 21 Aug 2005 17:39:47 +0000 Subject: [PATCH] add dhcp package. This doesn't work quite nicely though, needs some resolving... svn path=/nixu/trunk/; revision=3653 --- boot/builder.sh | 1 + boot/default.nix | 6 ++++-- boot/env.sh | 2 +- fill-disk.sh | 12 +++++++++--- init/default.nix | 4 ++-- make-disk.sh | 2 ++ pkgs.nix | 11 +++++++---- 7 files changed, 26 insertions(+), 12 deletions(-) diff --git a/boot/builder.sh b/boot/builder.sh index ae2fdbf32b64..679b18b514a8 100755 --- a/boot/builder.sh +++ b/boot/builder.sh @@ -38,6 +38,7 @@ for i in $boot $halt $login $env; do -e "s^@module_init_tools\@^$module_init_tools^g" \ -e "s^@grub\@^$grub^g" \ -e "s^@udev\@^$udev^g" \ + -e "s^@dhcp\@^$dhcp^g" \ -e "s^@out\@^$out^g" \ < $i > $dst chmod +x $dst diff --git a/boot/default.nix b/boot/default.nix index 0bfc2517361c..28661278cb3e 100644 --- a/boot/default.nix +++ b/boot/default.nix @@ -1,7 +1,8 @@ { stdenv, kernel, bash, coreutils, findutils, 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, udev}: +, gnutar, gzip, mingetty, grubWrapper, parted, module_init_tools, hotplug +, udev, dhcp}: derivation { name = "boot"; @@ -14,5 +15,6 @@ derivation { inherit stdenv kernel bash coreutils findutils 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 udev; + gnutar gnugrep gzip mingetty grubWrapper parted module_init_tools + udev dhcp; } diff --git a/boot/env.sh b/boot/env.sh index 8366f5342134..7564e350d366 100644 --- a/boot/env.sh +++ b/boot/env.sh @@ -1 +1 @@ -export PATH=@nix@/bin:@bash@/bin:@coreutils@/bin:@findutils@/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 +export PATH=@nix@/bin:@bash@/bin:@coreutils@/bin:@findutils@/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:@dhcp@/sbin diff --git a/fill-disk.sh b/fill-disk.sh index 50c335ccc4db..ab8eda71fb1b 100755 --- a/fill-disk.sh +++ b/fill-disk.sh @@ -169,9 +169,9 @@ 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 +#touch_file /etc/passwd +#touch_file /etc/shadow +#touch_file /etc/group rm -f $root/etc/mtab #ln -s /proc/mounts $root/etc/mtab @@ -292,6 +292,12 @@ rm -f $root/etc/hosts echo "127.0.0.1 localhost" >> $root/etc/hosts echo "192.168.150.1 uml" >> $root/etc/hosts +echo setting up initial account information... + +echo "root:x:0:root" > $root/etc/group +echo "root:x:0:0:root:/root:/bin/sh" > $root/etc/passwd +echo "root::12757:0:99999:7:::" > $root/etc/shadow + ### ### Do kernel stuff here. ### diff --git a/init/default.nix b/init/default.nix index 39f8586f7ebd..92c347942877 100644 --- a/init/default.nix +++ b/init/default.nix @@ -1,4 +1,4 @@ -{ stdenv, bash, coreutils, utillinux, e2fsprogs, nix, shadowutils, mingetty, grubWrapper, parted, module_init_tools, hotplug}: +{ stdenv, bash, coreutils, utillinux, e2fsprogs, nix, shadowutils, mingetty, grubWrapper, parted, module_init_tools, hotplug, dhcp}: derivation { name = "init"; @@ -7,5 +7,5 @@ derivation { stage1 = ./prepare-disk.sh; stage2 = ./install-disk.sh; inherit stdenv bash coreutils utillinux e2fsprogs nix shadowutils - mingetty grubWrapper parted module_init_tools; + mingetty grubWrapper parted module_init_tools dhcp; } diff --git a/make-disk.sh b/make-disk.sh index 588f031d3dc7..eb46887a91f3 100755 --- a/make-disk.sh +++ b/make-disk.sh @@ -64,6 +64,7 @@ modutils=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).module_init_to grub=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).grubWrapper' | $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).dhcp' | $NIX_CMD_PATH/nix-instantiate -)) (while read storepath; do cp -fa --parents ${storepath} ${archivesDir} @@ -115,6 +116,7 @@ cp -fau --parents ${SysVinit} ${archivesDir} cp -fau --parents ${BootPath} ${archivesDir} cp -fau --parents ${hotplug} ${archivesDir} cp -fau --parents ${udev} ${archivesDir} +cp -fau --parents ${dhcp} ${archivesDir} bashdeps=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).bash' | $NIX_CMD_PATH/nix-instantiate -))) diff --git a/pkgs.nix b/pkgs.nix index 5a5065bcfe96..a127d31b29a2 100644 --- a/pkgs.nix +++ b/pkgs.nix @@ -3,15 +3,18 @@ rec { stdenv kernel bash coreutils findutils 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 syslinux parted module_init_tools hotplug udev; + mingetty grubWrapper syslinux parted module_init_tools hotplug udev + dhcp; boot = (import ./boot) {inherit stdenv kernel bash coreutils findutils 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 hotplug udev;}; + gnused gnutar gnugrep gzip mingetty grubWrapper parted module_init_tools + hotplug udev dhcp;}; - 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 e2fsprogs + nix shadowutils mingetty grubWrapper parted module_init_tools hotplug + dhcp;}; everything = [boot init sysvinit kernel]; }