some TODO items
While writing reform-handbook#2 and trying out whether I was writing down works I identified some wrinkles in how the tools work. I'm going on holidays for 10 days, starting 2022-06-22, so I'm writing down what I found so that I don't forget and so that maybe others can work on it while I'm away. In https://community.mnt.re/t/encrypted-nvme-boot-from-emmc-confusions/884/12 @megasquid offered to help, so I'm mentioning them here.
- before mounting filesystems and especially before flashing emmc, the tools should check if the partitions or emmc are in use or not and abort if they are in use. One possible way to do this is to run
lsblk --noheadings --output=MOUNTPOINT /dev/XXX
which will output all active mountpounts and thus this output must be empty. - currently,
reform-migrate
just callsreform-boot-config
without the--emmc
option (which means it will modify/boot
on the sd-card) but maybe the person runningreform-migrate
wants to modify/boot
on emmc. Thereform-migrate
script should either get an--emmc
option itself or ask the user whether they want to modify/boot
on sd-card or emmc -
reform-setup-encrypted-nvme
callsreform-migrate
but again without asking whether/boot
from sd-card or emmc should be used. After fixing the last point,reform-setup-encrypted-nvme
has to be adjusted in a similar fashion - if the user chooses
--emmc
for/boot
in any of the tools, they should be informed that theirDIP
switch has to be set toOFF
or otherwise it will boot from the sd-card -
reform-setup-encrypted-nvme
modifies/etc/fstab
,/etc/crypttab
and/etc/initramfs-tools/conf.d/resume
of the currently running system before runningreform-migrate
. Instead,reform-setup-encrypted-nvme
should first runreform-migrate
and then modify those files on the target path. The problem here is thatreform-migrate
will already have calledreform-boot-config
and after modifying these files we have to runreform-boot-config
which is just a waste of cpu-cycles. Also it's inelegant to havereform-migrate
first mount and then unmount the target path only such that we have to do the same thing again. Maybereform-setup-encrypted-nvme
should just copy thersync
call and we accept some code duplication in favour of not runningreform-boot-config
multiple times? -
reform-boot-config
currently can only switch betweensd
,emmc
andnvme
for the rootfs and allows overwriting that by setting theROOTPART
environment variable. This is not a good interface as it's very confusing to set a root device usingROOTPART
but then also putsd
(which will be ignored) as the positional argument. A more intuitive interface would be nice. - u-boot can not only boot from emmc and sd-card but also from a usb-medium. Should the --emmc switch be turned into a --boot={emmc,sd,usb} switch or should we just ignore the fact that in theory we are also able to boot from usb? Maybe we should do the latter and let those users that want to do it for usb go the manual route in favour of keeping the tools simple?
Edited by Johannes Schauer Marin Rodrigues