From e75153f3195afd122382ef75dccedc85a017386a Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Tue, 13 Jul 2021 12:31:02 +0200 Subject: [PATCH] feat: Add Alpine hooks blog post --- content/posts/alpine-commit-hooks.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 content/posts/alpine-commit-hooks.md diff --git a/content/posts/alpine-commit-hooks.md b/content/posts/alpine-commit-hooks.md new file mode 100644 index 0000000..929db37 --- /dev/null +++ b/content/posts/alpine-commit-hooks.md @@ -0,0 +1,24 @@ +--- +title: "How to use Alpine Linux commit hooks" +date: 2021-04-18T13:56:06+02:00 +draft: false +--- + + +- 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: +```bash +#!/bin/bash + +if ! mount | grep -q '/boot/efi'; then + mount /boot/efi +fi + +if [[ "$1" == "post-commit" ]]; then + cp /boot/initramfs-renoir /boot/efi/alpine/initramfs-renoir + cp /boot/vmlinuz-renoir /boot/efi/alpine/vmlinuz-renoir +fi +```