| 10 Aug 2024 |
matthewcroughan | not clear how to access the disko vars or what ones to access to get the absolute path to the partition in question, by nix evaluation | 22:13:25 |
| 11 Aug 2024 |
matthewcroughan | Here's what I'm talking about, and the best I could come up with | 14:23:32 |
matthewcroughan | devices = {
disk = {
disk1 = rec {
type = "disk";
device = "/dev/disk/by-id/usb-Generic-_SD_MMC_20120501030900000-0:0";
postCreateHook = ''
lsblk
cat ${uboot}/bl2.bin > /dev/disk/by-partlabel/disk-disk1-bl2
cat ${uboot}/fip.bin > /dev/disk/by-partlabel/disk-disk1-fip
sgdisk -A 1:set:2 ${device}
'';
content = {
type = "gpt";
partitions = {
bl2 = {
start = "34";
end = "8191";
priority = 1;
type = "8300";
};
fip = {
start = "8192";
end = "12287";
priority = 2;
type = "8300";
};
| 14:23:35 |
matthewcroughan | * ...
disko.devices = {
disk = {
disk1 = rec {
type = "disk";
device = "/dev/disk/by-id/usb-Generic-_SD_MMC_20120501030900000-0:0";
postCreateHook = ''
lsblk
cat ${uboot}/bl2.bin > /dev/disk/by-partlabel/disk-disk1-bl2
cat ${uboot}/fip.bin > /dev/disk/by-partlabel/disk-disk1-fip
sgdisk -A 1:set:2 ${device}
'';
content = {
type = "gpt";
partitions = {
bl2 = {
start = "34";
end = "8191";
priority = 1;
type = "8300";
};
fip = {
start = "8192";
end = "12287";
priority = 2;
type = "8300";
};
...
| 14:23:44 |
matthewcroughan | notice how I've just guessed the by-partlabel paths and it's not happening by nix evaluation, and how I've had to use a recursive set to get the device path | 14:24:24 |
matthewcroughan | This also won't work in the image builder, it will only work for running the real disko script due to the dependency on the device path which will differ in the VM
| 14:24:49 |