plymouth.encrypt_install 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. build() {
  3. local mod
  4. add_module dm-crypt
  5. if [[ $CRYPTO_MODULES ]]; then
  6. for mod in $CRYPTO_MODULES; do
  7. add_module "$mod"
  8. done
  9. else
  10. add_all_modules '/crypto/'
  11. fi
  12. add_binary "cryptsetup"
  13. add_binary "dmsetup"
  14. add_file "/usr/lib/udev/rules.d/10-dm.rules"
  15. add_file "/usr/lib/udev/rules.d/13-dm-disk.rules"
  16. add_file "/usr/lib/udev/rules.d/95-dm-notify.rules"
  17. add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules"
  18. add_binary "/usr/lib/plymouth/label.so"
  19. add_binary "/usr/lib/plymouth/text.so"
  20. add_file "/usr/share/fonts/TTF/DejaVuSans.ttf"
  21. add_file "/etc/fonts/fonts.conf"
  22. add_file "/etc/fonts/conf.d/60-latin.conf"
  23. # cryptsetup calls pthread_create(), which dlopen()s libgcc_s.so.1
  24. add_binary "/usr/lib/libgcc_s.so.1"
  25. add_runscript
  26. }
  27. help() {
  28. cat <<HELPEOF
  29. This hook allows for an encrypted root device. Users should specify the device
  30. to be unlocked using 'cryptdevice=device:dmname' on the kernel command line,
  31. where 'device' is the path to the raw device, and 'dmname' is the name given to
  32. the device after unlocking, and will be available as /dev/mapper/dmname.
  33. For unlocking via keyfile, 'cryptkey=device:fstype:path' should be specified on
  34. the kernel cmdline, where 'device' represents the raw block device where the key
  35. exists, 'fstype' is the filesystem type of 'device' (or auto), and 'path' is
  36. the absolute path of the keyfile within the device.
  37. Without specifying a keyfile, you will be prompted for the password at runtime.
  38. This means you must have a keyboard available to input it, and you may need
  39. the keymap hook as well to ensure that the keyboard is using the layout you
  40. expect.
  41. HELPEOF
  42. }
  43. # vim: set ft=sh ts=4 sw=4 et: