Created
June 1, 2023 00:24
-
-
Save vishalbelsare/a1d7dcb6ed065f7f9b5766a3c8246299 to your computer and use it in GitHub Desktop.
mkinitcpio build hook for dm-integrity devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
build() { | |
local mod | |
add_module 'dm-integrity' | |
add_module 'dm-bufio' | |
add_module 'dm-mod' | |
add_module 'async_xor' | |
map add_udev_rule \ | |
'10-dm.rules' \ | |
'13-dm-disk.rules' \ | |
'95-dm-notify.rules' \ | |
'/usr/lib/initcpio/udev/11-dm-initramfs.rules' | |
map add_systemd_unit 'integritysetup.target' | |
map add_binary \ | |
'/usr/lib/systemd/system-generators/systemd-integritysetup-generator' \ | |
'/usr/lib/systemd/systemd-integritysetup' | |
# integritysetup calls pthread_create(), which dlopen()s libgcc_s.so.1 | |
add_binary '/usr/lib/libgcc_s.so.1' | |
[[ -f /etc/integritytab.initramfs ]] && add_file '/etc/integritytab.initramfs' '/etc/integritytab' | |
} | |
help() { | |
cat <<HELPEOF | |
This hook allows for a dm-integrity root device with systemd initramfs. | |
See the manpage of systemd-integritysetup-generator(8) for available kernel | |
command line options. Alternatively, if the file /etc/integritytab.initramfs | |
exists, it will be added to the initramfs as /etc/integritytab. See the | |
integritytab(5) manpage for more information on integritytab syntax. | |
HELPEOF | |
} | |
# vim: set ft=sh ts=4 sw=4 et: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment