random-archer / mkinitcpio-systemd-tool

Provisioning tool for systemd in initramfs (systemd-tool)
https://www.archlinux.org/packages/community/any/mkinitcpio-systemd-tool/
Other
113 stars 27 forks source link

Raspberry Pi kernel modules directory #15

Closed ShapeShifter499 closed 6 years ago

ShapeShifter499 commented 6 years ago

Unhelpful error on systemd-cryptsetup "Failed to activate: Invalid argument"

I've been taking the last few hours trying to set this up so I can have a Full Disk Encryption on my Raspberry PI and be able to remotely decrypt. I now have this error and I don't know why. Attached is a photo of the logs from my raspberry pi 3b+ img_20180508_131700

Andrei-Pozolotin commented 6 years ago
  1. after getting secret > prompt via ssh, switch to menu via CTRL+C, https://github.com/random-archer/mkinitcpio-systemd-tool/blob/master/initrd-shell.sh

    select:
    a) secret agent
    s) sys shell
    r) reboot
    q) quit

    then select "s" for shell. now you can use any provisioned tools: mc, systemctl, journalctl, etc. to help you understand what is going on

  2. using shell, try to mount crypto partition manually to verify basic cryptsetup, see if can reproduce same error https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_a_non-root_file_system#Manual_mounting_and_unmounting

  3. ensure not trying to mount wrong uuid. or perhaps need explicit crypttab <crypto-options> https://wiki.archlinux.org/index.php/Dm-crypt/System_configuration#crypttab

ShapeShifter499 commented 6 years ago

I don't seem to have 'cryptsetup' within the initramfs shell. I did make sure it was installed when I was chrooted in

ShapeShifter499 commented 6 years ago

@Andrei-Pozolotin I tried the following with no luck.

=> /usr/lib/systemd/systemd-cryptsetup attach root /dev/disk/by-uuid/6ea12e98-fe8f-4e55-a0ec-7a348cb96525 none plain,luks
Please enter passphrase for disk root on /sysroot! ************************************************************
Set cipher aes, mode xts-plain64, key size 512 bits for device /dev/disk/by-uuid/6ea12e98-fe8f-4e55-a0ec-7a348cb96525.
Failed to activate: Invalid argument
Andrei-Pozolotin commented 6 years ago
  1. you need to provision cryptsetup (or anything else extra) into initrd by adding a declaration i.e. https://github.com/random-archer/mkinitcpio-systemd-tool/blob/master/initrd-debug-progs.service#L27

    InitrdBinary=/usr/bin/cryptsetup
  2. either way, you need to make crypt-setup work manually first. see if strace helps https://www.systutorials.com/docs/linux/man/1-strace/ https://github.com/random-archer/mkinitcpio-systemd-tool/blob/master/initrd-debug-progs.service#L27

ShapeShifter499 commented 6 years ago

I figured out my issue, it was a problem with my modules directory being incorrect inside of initramfs. I will close this now.