During the course of debugging #872, correcting shellcheck errors and warnings, a number of issues presented that made verifying the changes difficult. Examples of this were errors that existed in the master branch (although these may have been unique to using qemu-coreboot-fwwhiptail), needing to unquote variables used as whiptail parameters then adding shellcheck exceptions, as many scripts do not have .sh extensions there stances where it is difficult to determine if a function or script is being invoked, and not owning a Librem/Nitro Key to be able to test and of those scripts. Given how fragile the existing initrd script is, I believe a different approach is needed.
The original plan was to correct shellcheck errors and warning then progress to cleaning up and tightening the scripts. At this time, it seems that these should be done together; focusing on improving, cleaning up, documenting, normalizing individual functionality to minimize the amount of testing and reduce the potential for introducing bugs.
A few suggestions:
Test cases/issues to correct:
During the course of debugging #872, correcting shellcheck errors and warnings, a number of issues presented that made verifying the changes difficult. Examples of this were errors that existed in the master branch (although these may have been unique to using
qemu-coreboot-fwwhiptail), needing to unquote variables used as whiptail parameters then adding shellcheck exceptions, as many scripts do not have.shextensions there stances where it is difficult to determine if a function or script is being invoked, and not owning a Librem/Nitro Key to be able to test and of those scripts. Given how fragile the existing initrd script is, I believe a different approach is needed.The original plan was to correct shellcheck errors and warning then progress to cleaning up and tightening the scripts. At this time, it seems that these should be done together; focusing on improving, cleaning up, documenting, normalizing individual functionality to minimize the amount of testing and reduce the potential for introducing bugs.
A few suggestions:
.shexetension. Be sure to add.shextension to references in the script.#!/bin/bash/etc/profileinstead of/tmp/config(is there a reason?)/initrd/binto be user facing end points to deal with usage menus, basic input validation and proper calling of the appropriate file.Test cases/issues to correct:
mount: mounting /dev/sda1 on /boot failed: invalid argumentinfinitely. Reported in Error loop if Heads is configured and hard drive is missing or replaced #911 .