Update efi install cd

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-10-09 11:44:50 -04:00
parent 596a7cbb6d
commit 7f5e4f5eb8
2 changed files with 17 additions and 26 deletions

View File

@ -1,21 +1,14 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ ./installation-cd-minimal.nix ]; # Move into base image once using 3.10 or later
boot.kernelPackages = pkgs.linuxPackages_3_9; require = [ ./installation-cd-minimal.nix ];
boot.vesa = false;
# What follows should probably move into base once the base kernel has the boot.kernelPackages = pkgs.linuxPackages_3_10;
# efi boot stub
# Get a console as soon as the initrd loads fbcon on EFI boot # Get a console as soon as the initrd loads fbcon on EFI boot
# Enable reading EFI variables via sysfs boot.initrd.kernelModules = [ "fbcon" ];
# !!! Needing efivars will only be necessary until http://article.gmane.org/gmane.linux.kernel.efi/773 is merged
boot.initrd.kernelModules = [ "fbcon" "efivars" ];
# efi-related tools
environment.systemPackages = [ pkgs.efibootmgr ];
isoImage.makeEfiBootable = true; isoImage.makeEfiBootable = true;
} }

View File

@ -44,31 +44,31 @@ let
# The efi boot image # The efi boot image
efiImg = pkgs.runCommand "efi-image_eltorito" {} efiImg = pkgs.runCommand "efi-image_eltorito" { buildInputs = [ pkgs.mtools ]; }
'' ''
#Let's hope 10M is enough #Let's hope 10M is enough
dd bs=2048 count=5120 if=/dev/zero of="$out" dd bs=2048 count=5120 if=/dev/zero of="$out"
${pkgs.dosfstools}/sbin/mkfs.vfat "$out" ${pkgs.dosfstools}/sbin/mkfs.vfat "$out"
${pkgs.mtools}/bin/mmd -i "$out" efi mmd -i "$out" efi
${pkgs.mtools}/bin/mmd -i "$out" efi/boot mmd -i "$out" efi/boot
${pkgs.mtools}/bin/mmd -i "$out" efi/nixos mmd -i "$out" efi/nixos
${pkgs.mtools}/bin/mmd -i "$out" loader mmd -i "$out" loader
${pkgs.mtools}/bin/mmd -i "$out" loader/entries mmd -i "$out" loader/entries
${pkgs.mtools}/bin/mcopy -v -i "$out" \ mcopy -v -i "$out" \
${pkgs.gummiboot}/lib/gummiboot/gummiboot${targetArch}.efi \ ${pkgs.gummiboot}/lib/gummiboot/gummiboot${targetArch}.efi \
::efi/boot/boot${targetArch}.efi ::efi/boot/boot${targetArch}.efi
${pkgs.mtools}/bin/mcopy -v -i "$out" \ mcopy -v -i "$out" \
${config.boot.kernelPackages.kernel + "/bzImage"} ::bzImage ${config.boot.kernelPackages.kernel}/bzImage ::bzImage
${pkgs.mtools}/bin/mcopy -v -i "$out" \ mcopy -v -i "$out" \
${config.system.build.initialRamdisk + "/initrd"} ::efi/nixos/initrd ${config.system.build.initialRamdisk}/initrd ::efi/nixos/initrd
echo "title NixOS LiveCD" > boot-params echo "title NixOS LiveCD" > boot-params
echo "linux /bzImage" >> boot-params echo "linux /bzImage" >> boot-params
echo "initrd /efi/nixos/initrd" >> boot-params echo "initrd /efi/nixos/initrd" >> boot-params
echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" >> boot-params echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" >> boot-params
${pkgs.mtools}/bin/mcopy -v -i "$out" boot-params ::loader/entries/nixos-livecd.conf mcopy -v -i "$out" boot-params ::loader/entries/nixos-livecd.conf
echo "default nixos-livecd" > boot-params echo "default nixos-livecd" > boot-params
echo "timeout 5" >> boot-params echo "timeout 5" >> boot-params
${pkgs.mtools}/bin/mcopy -v -i "$out" boot-params ::loader/loader.conf mcopy -v -i "$out" boot-params ::loader/loader.conf
''; '';
targetArch = if pkgs.stdenv.isi686 then targetArch = if pkgs.stdenv.isi686 then
@ -194,8 +194,6 @@ in
boot.initrd.kernelModules = [ "loop" ]; boot.initrd.kernelModules = [ "loop" ];
boot.kernelModules = optional config.isoImage.makeEfiBootable "efivars";
# In stage 1, mount a tmpfs on top of / (the ISO image) and # In stage 1, mount a tmpfs on top of / (the ISO image) and
# /nix/store (the squashfs image) to make this a live CD. # /nix/store (the squashfs image) to make this a live CD.
boot.initrd.postMountCommands = boot.initrd.postMountCommands =