mkinitcpio-dropbear-pacman-hook

Two pacman hooks that patch Arch Linux package mkinitcpio-dropbear for use in ZFSBootMenu

Setup

Not explicitly listed here as a step but still relevant: These pacman hooks only make sense if you're using ZFSBootMenu images and have mkinitcpio-dropbear package installed.

Get started like so:

  1. Clone repo into arbitrary path <repo>
  2. Make shell scripts executable
    chmod +x <repo>/*.sh
    
  3. Symlink to hook files, for example
    sudo ln -s <repo>/pacman-mkinitcpio-dropbear-hook.sh /usr/local/bin/pacman-mkinitcpio-dropbear-hook
    sudo ln -s <repo>/pacman-mkinitcpio-dropbear-install.sh /usr/local/bin/pacman-mkinitcpio-dropbear-install
    sudo ln -s <repo>/pacman-mkinitcpio-dropbear-hook.hook /usr/share/libalpm/hooks/pacman-mkinitcpio-dropbear-hook.hook
    sudo ln -s <repo>/pacman-mkinitcpio-dropbear-install.hook /usr/share/libalpm/hooks/pacman-mkinitcpio-dropbear-install.hook
    
    Note that while you may choose arbitrary locations for symlinks the hook files reference /usr/local/bin/pacman-mkinitcpio-dropbear-hook and .../pacman-mkinitcpio-dropbear-install, respectively. Change that accordingly if you need to.
  4. Optionally update shell scripts with the repo path you chose. It defaults to:
    /opt/git/quico.space/quico-os-setup/mkinitcpio-dropbear-pacman-hook/branches/main
    

What's it do?

When either the hook or installation script of Arch Linux package mkinitcpio-dropbear changes these hooks apply patches to them.

The installation script /usr/lib/initcpio/install/dropbear gets two additional commands to create a root username and group in initrd; the hook script /usr/lib/initcpio/hooks/dropbear has its Dropbear settings changed to send SSH keepalive messages and to define a custom listening port.

Both actions happen as a PostTransaction in pacman.

Assumptions

Per headline these hooks is intended to work with quico.space/quico-os-setup/arch-zbm. Before using them for any purpose other than an arch-zbm Arch Linux installation please closely review what they do and adapt to your use case as needed.

These hooks manipulate how SSH is done inside a ZFSBootMenu boot loader.

Development

Conventional commits

This project uses Conventional Commits for its commit messages.

Commit types

Commit types besides fix and feat are:

  • build: Project structure, directory layout, build instructions for roll-out
  • refactor: Keeping functionality while streamlining or otherwise improving function flow
  • test: Working on test coverage
  • docs: Documentation for project or components

Commit scopes

The following scopes are known for this project. A Conventional Commits commit message may optionally use one of the following scopes or none:

  • patch: Work related to patch files
  • hook: Configuring the hook(s)
  • meta: Affects the project's repo layout, readme content, file names etc.
Description
Two pacman hooks that patch Arch Linux package mkinitcpio-dropbear for use in ZFSBootMenu
Readme 27 KiB
Languages
Shell 100%