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/XXXwhich will output all active mountpounts and thus this output must be empty. - currently,
reform-migratejust callsreform-boot-configwithout the--emmcoption (which means it will modify/booton the sd-card) but maybe the person runningreform-migratewants to modify/booton emmc. Thereform-migratescript should either get an--emmcoption itself or ask the user whether they want to modify/booton sd-card or emmc -
reform-setup-encrypted-nvmecallsreform-migratebut again without asking whether/bootfrom sd-card or emmc should be used. After fixing the last point,reform-setup-encrypted-nvmehas to be adjusted in a similar fashion - if the user chooses
--emmcfor/bootin any of the tools, they should be informed that theirDIPswitch has to be set toOFFor otherwise it will boot from the sd-card -
reform-setup-encrypted-nvmemodifies/etc/fstab,/etc/crypttaband/etc/initramfs-tools/conf.d/resumeof the currently running system before runningreform-migrate. Instead,reform-setup-encrypted-nvmeshould first runreform-migrateand then modify those files on the target path. The problem here is thatreform-migratewill already have calledreform-boot-configand after modifying these files we have to runreform-boot-configwhich is just a waste of cpu-cycles. Also it's inelegant to havereform-migratefirst mount and then unmount the target path only such that we have to do the same thing again. Maybereform-setup-encrypted-nvmeshould just copy thersynccall and we accept some code duplication in favour of not runningreform-boot-configmultiple times? -
reform-boot-configcurrently can only switch betweensd,emmcandnvmefor the rootfs and allows overwriting that by setting theROOTPARTenvironment variable. This is not a good interface as it's very confusing to set a root device usingROOTPARTbut 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