Scenario: You’ve lost your device. Actually Honest Achmed finds it, and would like to return it to you. However, the label that you had carefully attached to your device was ripped off. How does Achmed know who to return the device to? He attempts to boot the device, but since you use full-disk encryption (you do use full-disk encryption, don’t you?), that doesn’t get him any further than the decryption password prompt. Fortunately, you have arranged for a simple message to be printed before that prompt, which tells Achmed how to contact you about the device he found:
-
Create the file
/etc/initcpio/install/owner
with the following content:#!/bin/bash build() { add_runscript } help() { cat <<HELPEOF This hook prints information about the device's owner, so that someone who finds it can contact the owner to return it. HELPEOF } # vim: set ft=sh ts=4 sw=4 et:
(This file, and the next one, don’t need to be executable: the default file mode works just fine.)
-
Create the file
/etc/initcpio/hooks/owner
with the following content:#!/usr/bin/ash run_hook() { msg 'This device is the property of Lucas Werkmeister <[email protected]>.' } # vim: set ft=sh ts=4 sw=4 et:
(Adjust line 4 to contain your information, of course.)
-
Edit
/etc/mkinitcpio.conf
to insertowner
in theHOOKS
list, somewhere before theencrypt
hook. (I put it betweenblock
andowner
. If you’re feeling adventurous, you can probably try putting it at the very front, before evenbase
, since the hook shouldn’t have any requirements.)