Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

Commit

Permalink
Update efi install cd
Browse files Browse the repository at this point in the history
Signed-off-by: Shea Levy <shea@shealevy.com>
  • Loading branch information
shlevy committed Oct 9, 2013
1 parent 596a7cb commit 7f5e4f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
15 changes: 4 additions & 11 deletions modules/installer/cd-dvd/installation-cd-efi.nix
@@ -1,21 +1,14 @@
{ config, pkgs, ... }:

{
imports = [ ./installation-cd-minimal.nix ];
# Move into base image once using 3.10 or later

boot.kernelPackages = pkgs.linuxPackages_3_9;
boot.vesa = false;
require = [ ./installation-cd-minimal.nix ];

# What follows should probably move into base once the base kernel has the
# efi boot stub
boot.kernelPackages = pkgs.linuxPackages_3_10;

# Get a console as soon as the initrd loads fbcon on EFI boot
# Enable reading EFI variables via sysfs
# !!! 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 ];
boot.initrd.kernelModules = [ "fbcon" ];

isoImage.makeEfiBootable = true;
}
28 changes: 13 additions & 15 deletions modules/installer/cd-dvd/iso-image.nix
Expand Up @@ -44,31 +44,31 @@ let


# 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
dd bs=2048 count=5120 if=/dev/zero of="$out"
${pkgs.dosfstools}/sbin/mkfs.vfat "$out"
${pkgs.mtools}/bin/mmd -i "$out" efi
${pkgs.mtools}/bin/mmd -i "$out" efi/boot
${pkgs.mtools}/bin/mmd -i "$out" efi/nixos
${pkgs.mtools}/bin/mmd -i "$out" loader
${pkgs.mtools}/bin/mmd -i "$out" loader/entries
${pkgs.mtools}/bin/mcopy -v -i "$out" \
mmd -i "$out" efi
mmd -i "$out" efi/boot
mmd -i "$out" efi/nixos
mmd -i "$out" loader
mmd -i "$out" loader/entries
mcopy -v -i "$out" \
${pkgs.gummiboot}/lib/gummiboot/gummiboot${targetArch}.efi \
::efi/boot/boot${targetArch}.efi
${pkgs.mtools}/bin/mcopy -v -i "$out" \
${config.boot.kernelPackages.kernel + "/bzImage"} ::bzImage
${pkgs.mtools}/bin/mcopy -v -i "$out" \
${config.system.build.initialRamdisk + "/initrd"} ::efi/nixos/initrd
mcopy -v -i "$out" \
${config.boot.kernelPackages.kernel}/bzImage ::bzImage
mcopy -v -i "$out" \
${config.system.build.initialRamdisk}/initrd ::efi/nixos/initrd
echo "title NixOS LiveCD" > boot-params
echo "linux /bzImage" >> boot-params
echo "initrd /efi/nixos/initrd" >> 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 "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
Expand Down Expand Up @@ -194,8 +194,6 @@ in

boot.initrd.kernelModules = [ "loop" ];

boot.kernelModules = optional config.isoImage.makeEfiBootable "efivars";

# In stage 1, mount a tmpfs on top of / (the ISO image) and
# /nix/store (the squashfs image) to make this a live CD.
boot.initrd.postMountCommands =
Expand Down

0 comments on commit 7f5e4f5

Please sign in to comment.