NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.07k stars 14.12k forks source link

22.11 GUI install on Pinebook Pro fails due to read-only efivarfs / bootctl SIGSEGV #219330

Open klemensn opened 1 year ago

klemensn commented 1 year ago

Describe the bug

First installation attempt failed at the end due to efivarfs being mounted read-only, which I only briefly noted in the GUI installer's text log.

I pasted the logs but they are useless/lost due to https://github.com/NixOS/nixpkgs/issues/219326.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Pinebook Pro with latest tow-boot flashed to SPI
  2. boot latest GNOME 22.11 .iso booted off SD-card
  3. standard GUI install to eMMC as root disk without any manual setup

Expected behavior

Installation finished without errors.

Additional context

I retried the installation and successfully ran mount -t efivarfs -o remount,rw /sys/firmware/efi/efivars prior to starting the GUI installation.

Installation failed again, this time with bootctl receiving SIGSEGV. coredumpctl list is empty.

Inspecting the live system shows that the new installation is still mounted, so I manually ran nixos-install --verbose --root /tmp/calamares-root-... which now hangs at

[...]
installing the boot loader...
setting up /etc...
Copied "/nix/store/[....]/systemd-bootaa64.efi" to "/boot/efi/EFI/systemd/systemd-bootaa64.efi".
Copied "/nix/store/[....]/systemd-bootaa64.efi" to "/boot/efi/EFI/BOOT/BOOTAA64.EFI".
Random seed file /boot/efi/loader/random-seed successfully written (32 bytes).

Nothing has been happening for 30 minutes, top shows bootctl --esp-path=/boot/efi install idling in S state.

klemensn commented 1 year ago

Aborting with ^C and rerunning above nixos-install with --no-bootloader this time seemingly finishes the installation:

[...]
setting up /etc...
setting up /etc...
setting root password...
New password:
Retype new password:
passwd: password updated successfully
installation finished!

(Yes, /etc is set up twice this time.)

klemensn commented 1 year ago

Rebooting into the new installation does not work.

The boot loader complains about missing loader.conf and fails to boot.

klemensn commented 1 year ago

Reinstalling with the latest 23.05 unstable KDE GUI installer as of today looks like it worked, i.e. no error, ticking 'Restart Now' and clicking 'Done'...

but it is stuck in a boot loop:

    EFI Default Loader
[long line of garbled, repeating glyphs]
        Boot in 10 s.

is all I see. It counts down, briefly blanks (might be a boot attempt?) and reenters the same screen. Forever.

ben-kuhn commented 1 year ago

Same here with 23.05 Gnome installer. I am testing a manual install using Grub instead to see if it's bootloader related.

serpent213 commented 1 year ago

but it is stuck in a boot loop:

    EFI Default Loader
[long line of garbled, repeating glyphs]
        Boot in 10 s.

My PBP is stuck in the same spot. Anyone found a solution?

Edit: Got a little bit further by adding pine64/pinebook-pro from the nixos-hardware channel. Now it apparently loads the kernel but then crashes when starting it.

Some screenshots:

IMG_2903 IMG_2904 IMG_2906

Booting from internal NVMe.

serpent213 commented 1 year ago

Even more success using Grub:

IMG_4117

IMG_4116

It cannot find the NVMe, I guess. I added noquiet and debug to the kernel cmdline via Grub but that didn’t yield any more details.

I read there might be issues with s2ram when booting from NVMe. Is that a thing? Might it be better to load the kernel from eMMC?

Edit: Should be initrd.kernelOptions, but no difference.

klemensn commented 1 year ago

I gave up on this hardware and used a real computer again.

tomfitzhenry commented 1 year ago

Here's my [truncated] Pinebook Pro config which has worked fine for months, booting from NVMe:

{ pkgs, ... }:
{
  boot.kernelPackages = pkgs.linuxPackages_latest;
  boot.loader.generic-extlinux-compatible.enable = true;
  boot.loader.grub.enable = false;

  boot.kernelParams = [
    "console=tty0"
    "cma=32M"
    "console=ttyS0,115200n8"
    "console=ttyAMA0,115200n8"
  ];

  boot.initrd.kernelModules = [
    "nvme"
    "pcie_rockchip_host"
    "phy_rockchip_pcie"

    # Rockchip modules
    "rockchip_rga"
    "rockchip_saradc"
    "rockchip_thermal"
    "rockchipdrm"

    # GPU/Display modules
    "analogix_dp"
    "cec"
    "drm"
    "drm_kms_helper"
    "dw_hdmi"
    "dw_mipi_dsi"
    "gpu_sched"
    "panel_edp"
    "panel_simple"
    "panfrost"
    "pwm_bl"

    # USB / Type-C related modules
    "fusb302"
    "tcpm"
    "typec"

    # Misc. modules
    "cw2015_battery"
    "gpio_charger"
    "rtc_rk808"
  ];
}

I recall someone else having difficult with booting NixOS on Pinebook Pro, and that the boot.kernelParams console directives were surprisingly required. YMMV.