Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable NixOS installer for powerpc64le #192672

Merged
merged 1 commit into from Feb 23, 2023
Merged

enable NixOS installer for powerpc64le #192672

merged 1 commit into from Feb 23, 2023

Conversation

ghost
Copy link

@ghost ghost commented Sep 23, 2022

It boots! And petitboot (the bootloader) even recognizes the syslinux table, so nixos-rebuild switch -p should work.

Screenshots are taken from the machine running minicom, connected to the serial console; all of my PowerPC machines are headless at the moment.

To get the results above, download a statically built nix for powerpc64le and do the following:

nix build -f nixos -L \
  -I nixos-config=nixos/modules/installer/sd-card/sd-image-powerpc64le.nix \
  --argstr system powerpc64le-linux \
  config.system.build.sdImage

zstdcat -d result/sd-image/nixos-sd-image-*.img.zst \
  | pv -ratep \
  > /dev/${YOUR_SD_CARD}

reboot

I built from nixpkgs mainline at 3ad7b8a, but it should work at any commit after that.

Things done

@ghost ghost marked this pull request as draft September 26, 2022 04:25
@ghost ghost changed the title nixos/installer: add sd-image-powerpc64le.nix enable NixOS installer for powerpc64 Sep 26, 2022
@ghost ghost marked this pull request as ready for review September 26, 2022 06:15
@ghost ghost changed the title enable NixOS installer for powerpc64 enable NixOS installer for powerpc64le Sep 26, 2022
@ghost ghost marked this pull request as draft January 5, 2023 09:32
@ofborg ofborg bot requested a review from nh2 January 5, 2023 09:44
@ghost
Copy link
Author

ghost commented Jan 5, 2023

Rebased.

@ghost ghost marked this pull request as ready for review January 5, 2023 11:28
@github-actions github-actions bot added 6.topic: pantheon The Pantheon desktop environment and removed 6.topic: pantheon The Pantheon desktop environment labels Jan 5, 2023
@ghost
Copy link
Author

ghost commented Jan 6, 2023

Rebased past the recent manual-building glitch, dropped the hacky workaround for that.

@ghost ghost marked this pull request as draft January 6, 2023 23:49
@ghost
Copy link
Author

ghost commented Jan 6, 2023

All the dependencies of this PR have merged; I'm rebuilding it once more to make sure it's good to go. Will undraftify once I do that.

Still builds and boots; good to go.

@ghost ghost marked this pull request as ready for review January 7, 2023 03:21
This builds on top of nixpkgs mainline 00d8347
with the following two PRs cherry-picked:

- #192670
- #192668

using the following command:

```
nix build -f nixos -L \
  -I nixos-config=nixos/modules/installer/sd-card/sd-image-powerpc64le.nix \
  config.system.build.sdImage
```

I was able to successfully boot the image, although it boots to a login prompt
rather than a shell, and won't accept the empty password for `root`.  I guess
I'll have to figure out why that is.

To boot the image: `zstd`-decompress the it, mount it, and use `kexec`:

```
cd boot/nixos
kexec -l \
  *-vmlinux \
  --initrd *-initrd \
  --dt-no-old-root \
  --command-line="$(grep APPEND ../extlinux/extlinux.conf | sed 's_^ *APPEND *__')"
```

The machine I used for testing has only one storage device which is completely
allocated to LVM.  It appears that the NixOS ISO loader doesn't look for
partition tables within LVM volumes.  To work aroundn this, I had to extract the
`ext4` image within the partition table within the `sd-card` image and put that
in its own LVM volume.  This likely won't be an obstacle for users who write the
image to a USB stick or similar.
@wegank wegank merged commit b65d2ea into NixOS:master Feb 23, 2023
@ghost ghost deleted the pr/nixos/sd/powerpc64le branch February 23, 2023 05:16
@ghost ghost mentioned this pull request Jul 31, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant