Closed burnbabyburn closed 6 years ago
Hi Helge,
I tested the CRYPTFS functionality a couple of weeks ago and it was broken (sadly). I tried the default rpi3 stretch and buster releases, building was working fine (I think it required some more busybox packages) but booting the new generated package failed (without useful error messages).
I am currently working on a fix. I will release a update soon that will add ENABLE_QEMU parameter to generate images that can be run in qemu emulator. I hope the debugging of the cryptfs problems will get easier then (it was quite complicated to get the cryptfs functionality running when I added to some years ago but I also haven't used oo tested it for at least one year)
thanks for your message and detailed error descriptions
have a great day
ps. SSH to initramfs or dedicated USB Rubber Ducky Style functionality (to enter or "auto enter" cryptfs password at initramfs/boot) still needs to be implemented.
Hi drtyhlpr,
thanks for your reply.
root@rpi23-gen-image:/home/helge/rpi23-gen-image/images/buster/build/chroot/boot/firmware
lsinitramfs initramfs-4.14.76-v8+ | grep crypt
cryptroot
cryptroot/crypttab
scripts/init-premount/expand_encrypted_rootfs
scripts/local-block/cryptroot
scripts/local-bottom/cryptopensc
scripts/local-top/cryptopensc
scripts/local-top/cryptroot
usr/bin/cryptroot-unlock
usr/lib/modules/4.14.76-v8+/kernel/crypto
usr/lib/modules/4.14.76-v8+/kernel/crypto/xor.ko
usr/lib/modules/4.14.76-v8+/kernel/drivers/block/cryptoloop.ko
Just to be complete here is the error message IF you install above mentioned packets in APT_INCLUDES
0 1 crypt aes-xts-plain64 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0 7:0 4096
+ chroot_exec mkinitramfs -o /boot/firmware/initramfs-4.14.76-v8+ 4.14.76-v8+
+ LANG=C LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot /home/helge/rpi23-gen-image/images/buster/build/chroot mkinitramfs -o /boot/firmware/initramfs-4.14.76-v8+ 4.14.76-v8+
cryptsetup: WARNING: Couldn't determine root device
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries
nor crypto modules. If that's on purpose, you may want to uninstall the
'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs
integration and avoid this warning.
Warning: couldn't identify filesystem type for fsck hook, ignoring.
+ chroot_exec cryptsetup close secure
+ LANG=C LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot /home/helge/rpi23-gen-image/images/buster/build/chroot cryptsetup close secure
+ head -n 3 bootstrap.d/15-rpi-config.sh
adding ,initramfs
to /etc/crypttab
forces include of cryptsetup into initramfs! Fixes the problem of initramfs not including crypsetup.
cat /etc/fstab
crypt /dev/sda1 none luks,initramfs
bootstrap.d/14-fstab.sh
#Add encrypted partition to crypttab and fstab
install_readonly files/mount/crypttab "${ETC_DIR}/crypttab"
echo "${CRYPTFS_MAPPING} /dev/mmcblk0p2 none luks,initramfs" >> "${ETC_DIR}/crypttab"
Results in:
build.log
LANG=C LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot /home/helge/rpi23-gen-image/images/buster/build/chroot mkinitramfs -o /boot/firmware/initramfs-4.14.77-v8+ 4.14.77-v8+
cryptsetup: WARNING: Couldn't determine root device
cryptsetup: ERROR: Couldn't resolve device /dev/sda5
cryptsetup: ERROR: Couldn't resolve device /dev/sda1
Warning: couldn't identify filesystem type for fsck hook, ignoring.
root@rpi23-gen-image:/home/helge/rpi23-gen-image/images/buster/build/chroot/boot/firmware#
lsinitramfs initramfs-4.14.77-v8+ | grep cryptsetup
usr/lib/aarch64-linux-gnu/libcryptsetup.so.12
usr/lib/aarch64-linux-gnu/libcryptsetup.so.12.3.0
usr/lib/cryptsetup
usr/lib/cryptsetup/askpass
usr/lib/cryptsetup/functions
usr/sbin/cryptsetup
thanks for the fix and infos.
here is the fix i am currently working on. untested so far because qemu emulation still gives me trouble :)
APT_INCLUDES="busybox,console-setup" and adding CRYPTSETUP=y to initramfs.conf (in 14-fstab.sh)
ps. adding to crypttab also looks nice+
thx for the continuing support :) But...
and adding CRYPTSETUP=y to initramfs.conf (in 14-fstab.sh)
this is depricated. Better set it in /etc/cryptsetup-initramfs/conf-hook instead https://tracker.pureos.net/w/troubleshooting/cryptsetup_setting_deprecated
Also..
/lib/firmware/brcm/brcmfmac43455-sdio.txt
was missing, but the bin file was there. (specific to pi3b+ i think)
You can get it from https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm/brcmfmac43455-sdio.txtafter updating debian to buster, which has much newer qemu, all errors are gone! (ofc with above fixes applied)
should be fixed. feel free to re open.
Hi, thanks for this project! It makes life a lot easier and more convinient.
I try to compile this project on a Debian 9.5 with the following template:
and get this error in 14-fstab.sh
This behaviour resulting in a non bootable image (no cryptsetup in initramfs to mount root)
If i dont split the image my sd-card can boot up after entering my pw. (with crypto and uboot) Maybe it is a problem with the fake luks device needed to get cryptsetup included in initramfs?
I tried several build configs (no crypt, no split, no uboot and mixing them up) I nearly always encounter the first problem after kernel is up and the next step is to access usbb_hdd to mount root. Most of the time my builds got stuck at boot process after
random: crng init done
I am a full time admin with mediocre linux skills and willing to build some more images if needed. Appreciate your help.
Thanks helge