!oNSIfazDqEcwhcOjSL:matrix.org

disko

372 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko96 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
10 Aug 2024
@matthewcroughan:defenestrate.itmatthewcroughannot clear how to access the disko vars or what ones to access to get the absolute path to the partition in question, by nix evaluation22:13:25
11 Aug 2024
@matthewcroughan:defenestrate.itmatthewcroughanHere's what I'm talking about, and the best I could come up with14:23:32
@matthewcroughan:defenestrate.itmatthewcroughan
    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:defenestrate.itmatthewcroughan *
...
    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:defenestrate.itmatthewcroughan 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:defenestrate.itmatthewcroughanThis 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

Show newer messages


Back to Room ListRoom Version: 10