Skip to content

Instantly share code, notes, and snippets.

@wucke13
Last active Apr 12, 2021
Embed
What would you like to do?
Boot Alpine Linux via PXE using `pixiecore`

Boot Alpine Linux via PXE using pixiecore

Running without nix

You can change the SHEBANG to #!/usr/bin/env bash if you don't have nix installed. Just be sure to have pixiecore in your $PATH. To simplify this even more, we've already included the ordinary SHEBANG in line 3. Simply skip the first two lines when copy pasting, and you should be good to go!

No disks found during Installation?

You'll likely have to install linux-lts via

apk add linux-lts

and load the ahci kernel module via

modprobe ahci

for ATA/SATA disks to be detected during the installation. To save yourself from hassle, check the existence of your storage device before starting setup-alpine.

What!? No https in the mirror url?

pixiecore will download via https anyways due to HSTS (if not, something fishy is going on!). Alpine doesn't seem to support https on the kernel command line, therefore we use http. AFAIK apk packages are still signed, so the use of http should be okay-ish here.

#!/usr/bin/env nix-shell
#!nix-shell -i bash --packages pixiecore
#!/usr/bin/env bash
set -e
VERSION="3.13"
MIRROR="http://dl-cdn.alpinelinux.org"
BOOT_CMD="ip=dhcp alpine_repo=${MIRROR}/alpine/v${VERSION}/main/"
KERNEL="${MIRROR}/alpine/v${VERSION}/releases/x86_64/netboot/vmlinuz-lts"
INITRAMFS="${MIRROR}/alpine/v${VERSION}/releases/x86_64/netboot/initramfs-lts"
sudo --validate
echo "starting pixiecore"
sudo pixiecore boot "$KERNEL" "$INITRAMFS" --cmdline "${BOOT_CMD}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment