nixpkgs/nixos/modules/installer/sd-card
Adam Joseph f99e8bafe6 nixos/installer: add sd-image-powerpc64le.nix
This builds on top of nixpkgs mainline 00d8347180
with the following two PRs cherry-picked:

- https://github.com/NixOS/nixpkgs/pull/192670
- https://github.com/NixOS/nixpkgs/pull/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.
2023-02-23 06:18:52 +02:00
..
sd-image-aarch64-installer.nix
sd-image-aarch64-new-kernel-installer.nix
sd-image-aarch64-new-kernel-no-zfs-installer.nix nixos: Add sd_image_minimal_new_kernel_no_zfs 2022-12-22 23:07:19 -05:00
sd-image-aarch64-new-kernel.nix
sd-image-aarch64.nix sd-image-aarch64: deduplicate cm4 section 2022-04-26 20:23:50 -07:00
sd-image-armv7l-multiplatform-installer.nix
sd-image-armv7l-multiplatform.nix
sd-image-powerpc64le.nix nixos/installer: add sd-image-powerpc64le.nix 2023-02-23 06:18:52 +02:00
sd-image-raspberrypi-installer.nix
sd-image-raspberrypi.nix top-level: move linux kernels, packages and related functions to linux-kernels.nix 2021-08-12 12:22:03 +02:00
sd-image-riscv64-qemu-installer.nix sd-image-riscv64: Add an -installer variant like others 2022-01-10 17:30:02 -08:00
sd-image-riscv64-qemu.nix sd-image-x86_64: init 2022-01-06 17:31:17 -08:00
sd-image-x86_64.nix sd-image-x86_64: init 2022-01-06 17:31:17 -08:00
sd-image.nix sd-image: remove unnecessary subshell 2022-10-22 12:11:30 +02:00