Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TARGET_DISK needs robustness. #7

Open
jason-oliveira opened this issue Jul 17, 2022 · 1 comment
Open

TARGET_DISK needs robustness. #7

jason-oliveira opened this issue Jul 17, 2022 · 1 comment

Comments

@jason-oliveira
Copy link

jason-oliveira commented Jul 17, 2022

As referenced in #1, TARGET_DISK has no way of telling between NVME, eMMC, IDE/SATA/SCSI, and virtual drives.

if ROOT_PASSWORD is set, /dev/{sda/nvme0n1/mmcblk0) can be detected via testing with lsblk, and TARGET_DISK can be modified accordingly. else, throw an error if none are found or warn if /dev/vda is found.

@jason-oliveira
Copy link
Author

jason-oliveira commented Jul 18, 2022

After giving this more thought, it would be best to give an unset TARGET_DISK="" at the top of the config, with instructions on default values if they want to override, then later on:

Check value of TARGET_DISK, and if unset:
If ROOT_PASSWORD is also unset, assume /dev/vda.
If ROOT_PASSWORD is set, use lsblk to see what they actually have, and presume the first disk found, unless both sda and either /nvme0n1 or mmcblk0 exist, then assume the latter (sda is usually USB).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant