Skip to content

Commit

Permalink
Readme: Rewrite instructions for aarch64 regarding older Alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
jirutka committed Jan 6, 2024
1 parent 2f3f852 commit 585791d
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ ifdef::env-github[]
image:https://github.com/{gh-name}/workflows/CI/badge.svg["Build Status", link="https://github.com/{gh-name}/actions"]
endif::env-github[]

This project provides a script for making customized https://alpinelinux.org/[Alpine Linux] disk images for x86_64 and aarch64 virtual machines.
This project provides a script for making customized https://alpinelinux.org/[Alpine Linux] disk images for x86_64 and aarch64 footnote:[Supported since Alpine Linux v3.19. See <<aarch64-old>>.] virtual machines.
You can choose between BIOS mode (using https://syslinux.org/[Syslinux], only for x86_64) and UEFI mode (using Linux https://docs.kernel.org/admin-guide/efi-stub.html[EFI stub]).
It’s quite simple (400 LoC of shell), fast (~32 seconds on GitHub Actions), requires minimum dependencies (QEMU and filesystem tools).

IMPORTANT: aarch64 currently only works with the kernel (linux-virt or linux-lts) from Alpine edge! See <<aarch64-v3.18>> for more information and a workaround.

TIP: Don’t need VM, just wanna chroot into Alpine Linux?
Try https://github.com/alpinelinux/alpine-chroot-install[alpine-chroot-install]!
Or do you want to create a custom rootfs?
Expand Down Expand Up @@ -51,29 +49,6 @@ Or, if you are on Alpine Linux, you can simply install the https://pkgs.alpineli

== Howtos

[[aarch64-v3.18]]
=== Create Alpine v3.18 (latest-stable) image for aarch64

The Linux kernel (_linux-virt_, _linux-lts_ or _linux-edge_ package) in Alpine v3.18 and earlier doesn’t have https://cateee.net/lkddb/web-lkddb/EFI_ZBOOT.html[EFI_ZBOOT] enabled, so EFI stub cannot load a compressed vmlinuz.
We backported it to v3.18, but then we had to revert it due to a problem with Grub (see https://gitlab.alpinelinux.org/alpine/aports/-/issues/15263[alpine/aports#15263]).

If you want to build an image with a stable branch of Alpine Linux, you can, but you must install the kernel from the edge branch.
This is relatively safe because the kernel package doesn’t have any dynamic dependencies and the version in v3.18 and edge will be in sync at least until v3.19 is released.

. Create a `repositories` file with a pinned main repository from edge, e.g.:
+
[source]
----
@edge https://dl-cdn.alpinelinux.org/alpine/edge/main
https://dl-cdn.alpinelinux.org/alpine/v3.18/main
https://dl-cdn.alpinelinux.org/alpine/v3.18/community
----

. Run {script-name} with the options `--repositories-file ./repositories` and `--packages linux-virt@edge` (or `linux-lts@edge` if you use `--kernel-flavor lts`).

This will first install _linux-virt_ from v3.18, but in the later step it will reinstall it from the edge branch.


=== Create images for aarch64 on x86_64 host

All you need to do is install the https://www.qemu.org/docs/master/user/main.html[QEMU User space emulator] for aarch64 and register it in https://docs.kernel.org/admin-guide/binfmt-misc.html[binfmt_misc] as the interpreter for aarch64 binaries.
Expand Down Expand Up @@ -110,6 +85,29 @@ See link:.github/workflows/ci.yml[] for a complete example.
After that, run {script-name} with the option `--arch aarch64`.


[[aarch64-old]]
=== Create aarch64 image with Alpine v3.18 or older

The Linux kernel (_linux-virt_, _linux-lts_ or _linux-edge_ package) in Alpine v3.18 and earlier doesn’t have https://cateee.net/lkddb/web-lkddb/EFI_ZBOOT.html[EFI_ZBOOT] enabled, so EFI stub cannot load a compressed vmlinuz.
We backported it to v3.18, but then we had to revert it due to a problem with Grub (see https://gitlab.alpinelinux.org/alpine/aports/-/issues/15263[alpine/aports#15263]).

If you want to build an image with an older branch of Alpine Linux, you can, but you must install the kernel from the v3.19 branch (or newer).
This is relatively safe because the kernel package doesn’t have any dynamic dependencies.

. Create a `repositories` file with a pinned main repository from v3.19, e.g.:
+
[source]
----
@v319 https://dl-cdn.alpinelinux.org/alpine/v3.19/main
https://dl-cdn.alpinelinux.org/alpine/v3.18/main
https://dl-cdn.alpinelinux.org/alpine/v3.18/community
----

. Run {script-name} with the options `--repositories-file ./repositories` and `--packages linux-virt@v319` (or `linux-lts@v319` if you use `--kernel-flavor lts`).

This will first install _linux-virt_ from v3.18, but in the later step it will reinstall it from the v3.19 branch.


=== Create image for VMware (ESXi)

VMware and disk images (virtual disks) is one big mess.
Expand Down

0 comments on commit 585791d

Please sign in to comment.