diff --git a/modules/config/system-path.nix b/modules/config/system-path.nix index 3969be680980..32e8717cbd1c 100644 --- a/modules/config/system-path.nix +++ b/modules/config/system-path.nix @@ -50,7 +50,7 @@ let pkgs.sysvtools pkgs.time pkgs.usbutils - pkgs.utillinux + pkgs.utillinuxCurses extraManpages ]; diff --git a/modules/installer/cd-dvd/installation-cd-new-kernel.nix b/modules/installer/cd-dvd/installation-cd-new-kernel.nix index c7ea5ddfb01b..2c79b68d0a43 100644 --- a/modules/installer/cd-dvd/installation-cd-new-kernel.nix +++ b/modules/installer/cd-dvd/installation-cd-new-kernel.nix @@ -3,6 +3,6 @@ { require = [ ./installation-cd-graphical.nix ]; - boot.kernelPackages = pkgs.linuxPackages_3_2; + boot.kernelPackages = pkgs.linuxPackages_3_7; boot.vesa = false; } diff --git a/modules/installer/cd-dvd/system-tarball-pc-readme.txt b/modules/installer/cd-dvd/system-tarball-pc-readme.txt index c4a0a111cd3a..8f0a8d355c6e 100644 --- a/modules/installer/cd-dvd/system-tarball-pc-readme.txt +++ b/modules/installer/cd-dvd/system-tarball-pc-readme.txt @@ -80,7 +80,7 @@ had booted this nixos. Run: * `grep local-cmds run/current-system/init` Then you can proceed normally subscribing to a nixos channel: - nix-channel --add http://nixos.org/releases/nixos/channels/nixos-unstable + nix-channel --add http://nixos.org/channels/nixos-unstable nix-channel --update Testing: diff --git a/modules/system/boot/loader/grub/grub.nix b/modules/system/boot/loader/grub/grub.nix index 70cfc87220cf..490502c5a360 100644 --- a/modules/system/boot/loader/grub/grub.nix +++ b/modules/system/boot/loader/grub/grub.nix @@ -13,10 +13,11 @@ let grubConfig = pkgs.writeText "grub-config.xml" (builtins.toXML { splashImage = f config.boot.loader.grub.splashImage; grub = f grub; + shell = "${pkgs.stdenv.shell}"; fullVersion = (builtins.parseDrvName config.system.build.grub.name).version; inherit (config.boot.loader.grub) version extraConfig extraPerEntryConfig extraEntries - extraEntriesBeforeNixOS configurationLimit copyKernels timeout + extraEntriesBeforeNixOS extraPrepareConfig configurationLimit copyKernels timeout default devices; path = makeSearchPath "bin" [ pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.findutils pkgs.diffutils ]; }); diff --git a/modules/system/boot/loader/grub/install-grub.pl b/modules/system/boot/loader/grub/install-grub.pl index 1d1958a8fe6a..f06527aaaec2 100644 --- a/modules/system/boot/loader/grub/install-grub.pl +++ b/modules/system/boot/loader/grub/install-grub.pl @@ -30,6 +30,7 @@ sub writeFile { my $grub = get("grub"); my $grubVersion = int(get("version")); my $extraConfig = get("extraConfig"); +my $extraPrepareConfig = get("extraPrepareConfig"); my $extraPerEntryConfig = get("extraPerEntryConfig"); my $extraEntries = get("extraEntries"); my $extraEntriesBeforeNixOS = get("extraEntriesBeforeNixOS") eq "true"; @@ -189,6 +190,8 @@ addEntry("NixOS - Default", $defaultConfig); $conf .= "$extraEntries\n" unless $extraEntriesBeforeNixOS; +# extraEntries could refer to @bootRoot@, which we have to substitute +$conf =~ s/\@bootRoot\@/$bootRoot/g; # Add entries for all previous generations of the system profile. $conf .= "submenu \"NixOS - Old configurations\" {\n" if $grubVersion == 2; @@ -212,6 +215,10 @@ foreach my $link (@links) { $conf .= "}\n" if $grubVersion == 2; +# Run extraPrepareConfig in sh +if ($extraPrepareConfig ne "") { + system((get("shell"), "-c", $extraPrepareConfig)); +} # Atomically update the GRUB config. my $confFile = $grubVersion == 1 ? "/boot/grub/menu.lst" : "/boot/grub/grub.cfg"; diff --git a/modules/system/boot/loader/grub/memtest.nix b/modules/system/boot/loader/grub/memtest.nix index 08eb8a1f41cb..4bd4b69101c9 100644 --- a/modules/system/boot/loader/grub/memtest.nix +++ b/modules/system/boot/loader/grub/memtest.nix @@ -22,17 +22,17 @@ in extraEntries = if config.boot.loader.grub.version == 2 then '' menuentry "${memtest86.name}" { - linux16 $bootRoot/memtest.bin + linux16 @bootRoot@/memtest.bin } '' else '' menuentry "${memtest86.name}" - linux16 $bootRoot/memtest.bin + linux16 @bootRoot@/memtest.bin ''; extraPrepareConfig = '' - cp ${memtest86}/memtest.bin /boot/memtest.bin; + ${pkgs.coreutils}/bin/cp ${memtest86}/memtest.bin /boot/memtest.bin; ''; }; } diff --git a/modules/virtualisation/qemu-vm.nix b/modules/virtualisation/qemu-vm.nix index 0367379b2444..b35b311819a8 100644 --- a/modules/virtualisation/qemu-vm.nix +++ b/modules/virtualisation/qemu-vm.nix @@ -166,6 +166,7 @@ let ${pkgs.vmTools.startSamba} # Start QEMU. + # "-boot menu=on" is there, because I don't know how to make qemu boot from 2nd hd. exec ${pkgs.qemu_kvm}/bin/qemu-kvm \ -name ${vmName} \ -m ${toString config.virtualisation.memorySize} \ @@ -174,8 +175,9 @@ let -chardev socket,id=samba,path=./samba \ -net user,vlan=0,guestfwd=tcp:10.0.2.4:445-chardev:samba''${QEMU_NET_OPTS:+,$QEMU_NET_OPTS} \ ${if cfg.useBootLoader then '' - -drive index=0,file=$NIX_DISK_IMAGE,if=virtio,cache=writeback,werror=report \ - -drive index=1,file=${bootDisk}/disk.img,if=virtio,boot=on,readonly \ + -drive index=0,id=drive1,file=$NIX_DISK_IMAGE,if=virtio,cache=writeback,werror=report \ + -drive index=1,id=drive2,file=${bootDisk}/disk.img,if=virtio,readonly \ + -boot menu=on '' else '' -drive file=$NIX_DISK_IMAGE,if=virtio,cache=writeback,werror=report \ -kernel ${config.system.build.toplevel}/kernel \