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

initrd-dropbear.service active in real-root #54

Closed CvRXX closed 4 years ago

CvRXX commented 4 years ago

I tried to making cryptroot booting possible with this tool. Unfortunately I got into the problem of a missing file.

This is the output: ![image](https://user-images.githubusercontent.com/1901850/78420621-0239ea80-7651-11ea-9f28-95ff6d3ccc89.png) hooks: ```HOOKS=(base autodetect modconf block filesystems keyboard systemd systemd-tool)``` I executed: ``` systemctl enable initrd-cryptsetup.path systemctl enable initrd-tinysshd.service systemctl enable initrd-debug-progs.service systemctl enable initrd-sysroot-mount.service ``` /etc/mkinitcpio-systemd-tool/config/crypttab: ``` # This file is part of https://github.com/random-archer/mkinitcpio-systemd-tool # crypttab: mappings for encrypted partitions in initramfs # * file location in initramfs: /etc/crypttab # * file location in real-root: /etc/mkinitcpio-systemd-tool/config/crypttab # crypttab format: # https://wiki.archlinux.org/index.php/Dm-crypt/System_configuration#crypttab # how crypttab is used by systemd: # https://www.freedesktop.org/software/systemd/man/systemd-cryptsetup-generator.html # https://github.com/systemd/systemd/blob/master/src/cryptsetup/cryptsetup-generator.c # note: # * provide here mapper partition UUID (instead of kernel command line) # * use password/keyfile=none to force cryptsetup password agent prompt # * ensure that mapper-path in fstab corresponds to mapper-name in crypttab # * for x-mount options see: https://www.freedesktop.org/software/systemd/man/systemd.mount.html # root UUID=fad4a476-832c-4f4d-ad87-32c6f5ed02d6 none luks # swap UUID={{UUID_SWAP}} none luks ``` /etc/mkinitcpio-systemd-tool/config/fstab: ``` # This file is part of https://github.com/random-archer/mkinitcpio-systemd-tool # fstab: mappings for direct partitions in initramfs: # * file location in initramfs: /etc/fstab # * file location in real-root: /etc/mkinitcpio-systemd-tool/config/fstab # fstab format: # https://wiki.archlinux.org/index.php/Fstab # how fstab is used by systemd: # https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html # https://github.com/systemd/systemd/blob/master/src/fstab-generator/fstab-generator.c # note: # * ensure /sysroot mount folder inside initramfs disk image # * remove "root=/dev/mapper/root" stanza from kernel command line # * provide here root partition mapping (instead of kernel command line) # * ensure that mapper-path in fstab corresponds to mapper-name in crypttab # * for x-mount options see: https://www.freedesktop.org/software/systemd/man/systemd.mount.html # /dev/mapper/root /sysroot auto x-systemd.device-timeout=9999h 0 1 # /dev/mapper/swap none swap x-systemd.device-timeout=9999h 0 0 ```

Any help to resolve this issue will be welcomed!

Andrei-Pozolotin commented 4 years ago

ok, some clarification points:

* did you review output of `mkinitcpio -v -p ...`, errors there ? * are you sure you boot into proper `initrd`? (meaning you produced one with `mkinitcpio`, but then boot into another) * do you still have `root=...` as kernel command line parameters? * can you switch to debug console `Alt+Ctrl+F8`, `Alt+Ctrl+F9` then what is `journalctl -b`, `journalctl -b -t shell` * are you able to recover the system? https://github.com/random-archer/mkinitcpio-systemd-tool/wiki/System-Recovery * can you verify for yourself that when you look at the `initrd` extract ``` lsinitcpio -x /boot/initramfs-linux.img ``` then the layout is as expected: `/usr/lib/systemd/systemd-cryptsetup`, etc, are present?
CvRXX commented 4 years ago

I reinstalled al my packages and now the cryptsetup works. Thanks for the help! Only thing I have to figure out is how to stop the dropbear server after the init process is done so I can use openssh again...

Andrei-Pozolotin commented 4 years ago

now the cryptsetup works

ok, cool

how to stop the dropbear server

https://www.archlinux.org/packages/community/x86_64/dropbear/files/

systemctl disable dropbear.service
systemctl enable initrd-dropbear.service
CvRXX commented 4 years ago
> > now the cryptsetup works > > ok, cool > > > how to stop the dropbear server > > https://www.archlinux.org/packages/community/x86_64/dropbear/files/ > > ``` > systemctl disable dropbear.service > systemctl enable initrd-dropbear.service > ```

I disabled the dropbear.service and enabled the initrd one but when I boot it still runs. When I do sudo systemctl stop initrd-dropbear.service my ssh sessions is killed. This happens after fully booting. Any idea what might be the problem?

Andrei-Pozolotin commented 4 years ago

please:

Andrei-Pozolotin commented 4 years ago

also:

Andrei-Pozolotin commented 4 years ago

also:

Andrei-Pozolotin commented 4 years ago

assume resolved