Author: viric
Date: Sun Aug 14 22:01:58 2011
New Revision: 28573
URL: https://svn.nixos.org/websvn/nix/?rev=28573&sc=1
Log:
Trying to make the system tarball for pc closer to PXE boot.
Modified:
nixos/trunk/modules/installer/cd-dvd/system-tarball-pc.nix
nixos/trunk/modules/installer/cd-dvd/system-tarball.nix
Modified: nixos/trunk/modules/installer/cd-dvd/system-tarball-pc.nix
==============================================================================
--- nixos/trunk/modules/installer/cd-dvd/system-tarball-pc.nix Sun Aug 14
16:41:48 2011 (r28572)
+++ nixos/trunk/modules/installer/cd-dvd/system-tarball-pc.nix Sun Aug 14
22:01:58 2011 (r28573)
@@ -9,6 +9,27 @@
pkgs2storeContents = l : map (x: { object = x; symlink = "none"; }) l;
+ # For PXE kernel loading
+ pxeconfig = pkgs.writeText "pxeconfig-default" ''
+ default menu.c32
+ prompt 0
+
+ label bootlocal
+ menu default
+ localboot 0
+ timeout 80
+ TOTALTIMEOUT 9000
+
+ label nixos
+ MENU LABEL ^NixOS base through NFS
+ KERNEL bzImage
+ append initrd=initrd ip=dhcp tnfsroot=IPADDR:/home/pcroot
systemConfig=${config.system.build.toplevel}
init=${config.system.build.toplevel}/initrd
+
+ label memtest
+ MENU LABEL ^Memtest86+
+ KERNEL memtest.bin
+ '';
+
in
{
@@ -28,6 +49,18 @@
[ { source = config.boot.kernelPackages.kernel + "/" +
config.system.boot.loader.kernelFile;
target = "/boot/" + config.system.boot.loader.kernelFile;
}
+ { source = "${pkgs.syslinux}/share/syslinux/pxelinux.0";
+ target = "/boot/pxelinux.0";
+ }
+ { source = "${pkgs.syslinux}/share/syslinux/menu.c32";
+ target = "/boot/menu.c32";
+ }
+ { source = pxeconfig;
+ target = "/boot/pxelinux.cfg/default";
+ }
+ { source = "${pkgs.memtest86}/memtest.bin";
+ target = "/boot/memtest.bin";
+ }
];
# Allow sshd to be started manually through "start sshd". It should
@@ -35,4 +68,46 @@
# default root password is empty.
services.openssh.enable = true;
jobs.openssh.startOn = pkgs.lib.mkOverrideTemplate 50 {} "";
+
+ boot.initrd.postMountCommands = ''
+ for o in $(cat /proc/cmdline); do
+ case $o in
+ tnfsroot=*)
+ set -- $(IFS==; echo $o)
+ # TODO: It cannot mount nfs, as maybe it cannot find 'mount.nfs'
+ mount $2 /mnt-root
+ ;;
+ *) ;;
+ esac
+ done
+ '';
+
+ boot.kernelPackages = pkgs.linuxPackages_2_6_39;
+ nixpkgs.config = {
+ packageOverrides = p: rec {
+ linux_2_6_39 = p.linux_2_6_39.override {
+ extraConfig = ''
+ # Enable drivers in kernel for most NICs.
+ E1000 y
+ # E1000E y
+ # ATH5K y
+ 8139TOO y
+ NE2K_PCI y
+ ATL1 y
+ ATL1E y
+ ATL1C y
+
+ # Enable nfs root boot
+ IP_PNP y
+ IP_PNP_DHCP y
+ NFS_FS y
+ ROOT_NFS y
+
+ # Enable devtmpfs
+ DEVTMPFS y
+ DEVTMPFS_MOUNT y
+ '';
+ };
+ };
+ };
}
Modified: nixos/trunk/modules/installer/cd-dvd/system-tarball.nix
==============================================================================
--- nixos/trunk/modules/installer/cd-dvd/system-tarball.nix Sun Aug 14
16:41:48 2011 (r28572)
+++ nixos/trunk/modules/installer/cd-dvd/system-tarball.nix Sun Aug 14
22:01:58 2011 (r28573)
@@ -40,11 +40,7 @@
# In stage 1 of the boot, mount the CD/DVD as the root FS by label
# so that we don't need to know its device.
- fileSystems =
- [ { mountPoint = "/";
- device = "/dev/sda";
- }
- ];
+ fileSystems = [ ];
# boot.initrd.availableKernelModules = [ "mvsdio" "mmc_block" "reiserfs"
"ext3" "ext4" ];
@@ -80,7 +76,10 @@
''
# After booting, register the contents of the Nix store on the
# CD in the Nix database in the tmpfs.
- ${config.environment.nix}/bin/nix-store --load-db <
/nix-path-registration
+ if [ -f /nix-path-registration ]; then
+ ${config.environment.nix}/bin/nix-store --load-db <
/nix-path-registration &&
+ rm /nix-path/registration
+ fi
# nixos-rebuild also requires a "system" profile and an
# /etc/NIXOS tag.
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits