Skip to content

Commit

Permalink
test: Always use the latest available kernel from Alpine
Browse files Browse the repository at this point in the history
When the kernel package is updated, the old versions are removed. Thus
we have to locate the current version via the index, rather than
relying on a fixed version.
  • Loading branch information
wkz committed Sep 4, 2024
1 parent 7df81b8 commit 4ee4b8e
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ host-aarch64 := aarch64
host-x86_64 := x86_64

al = alpine-minirootfs-3.20.2-$(1)
lx = linux-virt-6.6.47-r0
tc = $(tc-arch-$(1))--musl--bleeding-edge-2024.05-1

al-repo := https://dl-cdn.alpinelinux.org/alpine/v3.20
tc-repo := https://toolchains.bootlin.com/downloads/releases/toolchains

al-tar = $(call al,$(1)).tar.gz
al-url = $(al-repo)/releases/$(1)/$(call al-tar,$(1))
lx-tar = $(lx).apk
lx-url = $(al-repo)/main/$(1)/$(lx-tar)
tc-tar = $(call tc,$(1)).tar.xz
tc-url = $(tc-repo)/$(tc-arch-$(1))/tarballs/$(call tc-tar,$(1))

Expand Down Expand Up @@ -108,11 +105,21 @@ cache/$(call al-tar,$(1)): |cache

# Kernel

work/$(1)-rootfs/boot/vmlinuz-virt: cache/$(lx)-$(1).tar.gz |work/$(1)-rootfs
tar -C work/$(1)-rootfs -maxf $$< 2>/dev/null

cache/$(lx)-$(1).tar.gz: |cache
wget -O $$@ $(call lx-url,$(1))
work/$(1)-rootfs/boot/vmlinuz-virt: |work/$(1)-rootfs
wget -O- $(al-repo)/main/$(1)/APKINDEX.tar.gz \
| gunzip \
| tar -Ox APKINDEX \
| grep -A1 -E "^P:linux-virt$$$$" \
| awk -F: '$$$$1 == "V" { printf("linux-virt-%s", $$$$2); }' \
>cache/lx-$(1)

[ -f cache/$$$$(cat cache/lx-$(1))-$(1).tar.gz ] \
|| wget \
-O cache/$$$$(cat cache/lx-$(1))-$(1).tar.gz \
$(al-repo)/main/$(1)/$$$$(cat cache/lx-$(1)).apk

tar -C work/$(1)-rootfs -maxf \
cache/$$$$(cat cache/lx-$(1))-$(1).tar.gz 2>/dev/null


# Toolchain
Expand Down

0 comments on commit 4ee4b8e

Please sign in to comment.