diff --git a/modules/installer/cd-dvd/iso-image.nix b/modules/installer/cd-dvd/iso-image.nix index 9e39eb48f3d..d775c855ad6 100644 --- a/modules/installer/cd-dvd/iso-image.nix +++ b/modules/installer/cd-dvd/iso-image.nix @@ -129,15 +129,11 @@ let ${pkgs.mtools}/bin/mmd -i "$out" efi/boot ${pkgs.mtools}/bin/mmd -i "$out" efi/nixos ${pkgs.mtools}/bin/mcopy -v -i "$out" \ - ${config.boot.kernelPackages.kernel + "/bzImage"} ::efi/nixos/bzImage + ${config.boot.kernelPackages.kernel + "/bzImage"} ::efi/boot/boot${targetArch}.efi ${pkgs.mtools}/bin/mcopy -v -i "$out" \ ${config.system.build.initialRamdisk + "/initrd"} ::efi/nixos/initrd - echo "\\efi\\nixos\\bzImage initrd=\\efi\\nixos\\initrd init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" | iconv -f utf-8 -t UCS-2 > boot-params - ${pkgs.mtools}/bin/mcopy -v -i "$out" boot-params ::efi/nixos/boot-params - ${pkgs.mtools}/bin/mcopy -v -i "$out" \ - ${import ../efi-boot-stub/nixos-boot-pkg.nix { - inherit (pkgs) edk2 stdenv fetchhg; - }}/*/NixosBoot.efi ::efi/boot/boot${targetArch}.efi + echo "initrd=\\efi\\nixos\\initrd init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" > boot-params + ${pkgs.mtools}/bin/mcopy -v -i "$out" boot-params ::efi/boot/linux.conf ''; targetArch = if pkgs.stdenv.isi686 then diff --git a/modules/installer/efi-boot-stub/efi-boot-stub-builder.sh b/modules/installer/efi-boot-stub/efi-boot-stub-builder.sh index d736fb417a6..9df4cb1fe59 100644 --- a/modules/installer/efi-boot-stub/efi-boot-stub-builder.sh +++ b/modules/installer/efi-boot-stub/efi-boot-stub-builder.sh @@ -78,10 +78,8 @@ addEntry() { if test -n "@installRemovableMediaImage@"; then mkdir -pv "@efiSysMountPoint@"/efi/boot - cp "@removableMediaImage@" \ - "@efiSysMountPoint@"/efi/boot/boot"@targetArch@".efi - iconv -f utf-8 -t UCS-2 < $startup > "@efiSysMountPoint@"/efi/nixos/boot-params - filesCopied["@efiSysMountPoint@"/efi/nixos/boot-params]=1 + cp $kernel "@efiSysMountPoint@"/efi/boot/boot"@targetArch@".efi + sed 's|.*@kernelFile@.efi ||' $startup > "@efiSysMountPoint@"/efi/boot/linux.conf fi if test -n "@installStartupNsh@"; then sed 's|.*@kernelFile@.efi|@kernelFile@.efi|' < $startup > "@efiSysMountPoint@/startup.nsh" diff --git a/modules/installer/efi-boot-stub/efi-boot-stub.nix b/modules/installer/efi-boot-stub/efi-boot-stub.nix index c8236b6fdd8..72b7fa28ac3 100644 --- a/modules/installer/efi-boot-stub/efi-boot-stub.nix +++ b/modules/installer/efi-boot-stub/efi-boot-stub.nix @@ -80,24 +80,20 @@ in ###### implementation let - efiBootStubBuilder = pkgs.substituteAll ({ + efiBootStubBuilder = pkgs.substituteAll { src = ./efi-boot-stub-builder.sh; isExecutable = true; inherit (pkgs) bash; path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.glibc] ++ (pkgs.stdenv.lib.optionals config.boot.loader.efiBootStub.runEfibootmgr [pkgs.efibootmgr pkgs.module_init_tools]); inherit (config.boot.loader.efiBootStub) efiSysMountPoint runEfibootmgr installStartupNsh efiDisk efiPartition installRemovableMediaImage; kernelFile = platform.kernelTarget; - } // pkgs.stdenv.lib.optionalAttrs config.boot.loader.efiBootStub.installRemovableMediaImage rec { - removableMediaImage = ''${import ./nixos-boot-pkg.nix { - inherit (pkgs) edk2 stdenv fetchhg; - }}/${targetArch}/NixosBoot.efi''; targetArch = if pkgs.stdenv.isi686 then "IA32" else if pkgs.stdenv.isx86_64 then "X64" else throw "Unsupported architecture"; - }); + }; # Temporary check, for nixos to cope both with nixpkgs stdenv-updates and trunk platform = pkgs.stdenv.platform; diff --git a/modules/installer/efi-boot-stub/nixos-boot-pkg.nix b/modules/installer/efi-boot-stub/nixos-boot-pkg.nix deleted file mode 100644 index 5bce1789a02..00000000000 --- a/modules/installer/efi-boot-stub/nixos-boot-pkg.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ stdenv, edk2, fetchhg }: - -let - - src = fetchhg { - url = https://bitbucket.org/shlevy/nixosbootpkg; - tag = "1ff4c2891c8c1eb03677a6f8b04b8d05807ec198"; - sha256 = "06zwy0g9a7g2sny7phvn2z76pb3wnw4vm9vsrjjaj7f7nzcsn13k"; - }; - -in - -stdenv.mkDerivation (edk2.setup "NixosBootPkg/NixosBootPkg.dsc" { - name = "NixosBootPkg-2012-03-15"; - - unpackPhase = '' - ln -sv ${src} NixosBootPkg - ln -sv ${edk2.src}/MdePkg . - ''; - - meta = { - description = - "Simple EFI app to load the kernel with NixOS-specific arguments"; - homepage = http://www.shealevy.com; - license = "MIT"; - maintainers = [ stdenv.lib.maintainers.shlevy ]; - platforms = ["x86_64-linux" "i686-linux"]; - }; -})