diff --git a/content/posts/alpine-commit-hooks.md b/content/posts/alpine-commit-hooks.md index 929db37..29fb901 100644 --- a/content/posts/alpine-commit-hooks.md +++ b/content/posts/alpine-commit-hooks.md @@ -4,12 +4,14 @@ date: 2021-04-18T13:56:06+02:00 draft: false --- +tl;dr: -- Create directory "/etc/apk/commit_hooks.d" +- Create directory `/etc/apk/commit_hooks.d` - Put your executable files in there - First argument passed to your script is the stage (`pre-commit`/`post-commit`) -Example hook: +### Example hook + ```bash #!/bin/bash @@ -18,7 +20,19 @@ if ! mount | grep -q '/boot/efi'; then fi if [[ "$1" == "post-commit" ]]; then - cp /boot/initramfs-renoir /boot/efi/alpine/initramfs-renoir - cp /boot/vmlinuz-renoir /boot/efi/alpine/vmlinuz-renoir + cp /boot/initramfs-lts /boot/efi/alpine/initramfs-lts + cp /boot/vmlinuz-lts /boot/efi/alpine/vmlinuz-lts fi ``` + +### Why? + +I use [Gummiboot](https://en.wikipedia.org/wiki/Gummiboot_(software)) as my bootloader, +which can boot Linux kernel images directly from the EFI partition. +Alpine packages don't care about EFI though, they just put the stuff in `/boot` +[directly](https://pkgs.alpinelinux.org/contents?file=&path=%2Fboot&name=linux-lts&branch=edge&repo=main&arch=x86_64). +(I mean, the official wiki just says "manually copy them to `/boot/efi/`", which works but I tend to forget about it) + +I didn't want to mount EFI as `/boot`, so I decided that creating a commit hook would be +the easiest way of hotfixing that issue (not ideal, as it runs with _every_ apk commit, +but feasible for my use).