Bootloader: Difference between revisions

imported>Sfultong
adding instructions for binding virtual file systems
imported>Balsoft
Add tutorial on installing 64-bit system with 32-bit UEFI bootloader.
Line 91: Line 91:


<hr />
<hr />
=== Installing x86_64 NixOS on IA-32 UEFI ===
Some laptops, mostly those based on Intel Atom, have a very strange setup: x86_64 CPU, 2-4GB of RAM, and ia-32 bootloader. They usually come with 64-bit Windows 10, which is slow and jerky on such configurations. Installing Linux on these systems is trivial, because most of the time you can just install 32-bit versions, which come with 32-bit UEFI bootloader, and not lose practically anything as amount of RAM is small enough for 32 bits of address. This is not the case with NixOS, though, because by choosing a 32-bit version you lose the prebuilt packages from nixos cache. To install a full 64-bit system with 32-bit bootloader, you need to take the following steps:
# Download both latest "Minimal installation CD, 32-bit Intel/AMD" and "Minimal installation CD, 64-bit Intel/AMD" from https://nixos.org/nixos/download.html.
# Flash 32-bit version on USB stick and boot it. If it does not boot, then you probably have a 64-bit bootloader and do not need to worry about this tutorial.
# Note: if your system hangs randomly when booted, you can try adding <nowiki>intel_idle.max_cstate=1</nowiki> to kernel parameters before booting (press e when you see systemd-boot prompt to enter editing mode).
# Once booted, install a minimal system as specified in installation manual. Do not forget to install grub as removable. Example configuration:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
boot.kernelParams = [ "intel_idle.max_cstate=1" ]; # In case your laptop hangs randomly
boot.loader = {
  efi = {
    canTouchEfiVariables = false;
  };
  grub = {
    efiSupport = true;
    efiInstallAsRemovable = true;
    device = "nodev";
  };
};
</nowiki>}}
# If everything goes well, reboot and you now should have a bootable 32-bit system. If you do, remove USB stick and flash 64-bit version of NixOS onto it.
# Plug it in your PC and boot into GRUB you have just installed. Now we have to boot a 64-bit system from USB stick manually. To do that:
## Press "c" before your system boots
## <pre>cat (hd0)/isolinux/isolinux.cfg</pre>
## Find ENTRY NIXOS DEFAULT line in the output of previous command. Take kernel parameters from that section.
## <pre>linux (hd0)/boot/bzImage *kernel parameters from the previous stage, including init=...* intel_idle.max_cstate=1</pre>
## <pre>initrd (hd0)/boot/initrd </pre>
## <pre>boot</pre>
# If you did everything correctly, you now should have your x86_64 system booted from USB. Now it's time to install it. Proceed with NixOS installation manual (do not forget to install GRUB, just as with 32-bit system). Add one extra thing to your configuration: i686 GRUB. To do that, add
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
nixpkgs.config.packageOverrides = pkgs: { grub2 = (import <nixpkgs> {system = "i686-linux";}).grub2; }
</nowiki>}}
To your configuration.
If you have some problems with installation, report them on #nixos on freenode.