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 havemkinitcpio-dropbear
package installed.
Get started like so:
- Clone repo into arbitrary path
<repo>
- Make shell scripts executable
chmod +x <repo>/*.sh
- Symlink to hook files, for example
Note that while you may choose arbitrary locations for symlinks the hook files referencesudo 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
/usr/local/bin/pacman-mkinitcpio-dropbear-hook
and.../pacman-mkinitcpio-dropbear-install
, respectively. Change that accordingly if you need to. - 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-outrefactor
: Keeping functionality while streamlining or otherwise improving function flowtest
: Working on test coveragedocs
: 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 fileshook
: Configuring the hook(s)meta
: Affects the project's repo layout, readme content, file names etc.