Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jirutka committed Sep 13, 2023
1 parent 761c71b commit 51038d2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
--image-format qcow2 \
--image-size 2G \
--repositories-file example/repositories \
--packages "$(cat example/packages)" \
--packages "$(cat example/packages) linux-virt@edge" \
--fs-skel-dir example/rootfs \
--fs-skel-chown root:root \
--script-chroot \
Expand Down
25 changes: 24 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TIP: Don’t need VM, just wanna chroot into Alpine Linux?
Or do you want to create a custom rootfs?
Then https://github.com/alpinelinux/alpine-make-rootfs[alpine-make-rootfs] is for you!

IMPORTANT: aarch64 currently only works with the kernel (linux-virt or linux-lts) from Alpine edge! See https://gitlab.alpinelinux.org/alpine/aports/-/issues/15263[alpine/aports#15263] for more information.
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.


== Requirements
Expand Down Expand Up @@ -51,6 +51,29 @@ 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
1 change: 1 addition & 0 deletions example/repositories
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@edge http://dl-cdn.alpinelinux.org/alpine/edge/main
http://dl-cdn.alpinelinux.org/alpine/latest-stable/main
http://dl-cdn.alpinelinux.org/alpine/latest-stable/community

0 comments on commit 51038d2

Please sign in to comment.