22 May 2023 |
@nikstur:matrix.org | In reply to @elvishjerricco:matrix.org you should really have your own os directory in the ESP and create a boot entry efi variable for the firmware to see bootctl creates the fallback path though when it doesn't exist. | 16:43:44 |
Arian | hmm systemd-repart seems to want me to run as root even when i provide --image . | 17:19:50 |
Arian | so maybe CopyFiles= is implemented with cheating | 17:20:01 |
Arian | (mounting loopback) | 17:20:06 |
@elvishjerricco:matrix.org | that's surprising | 17:20:12 |
@elvishjerricco:matrix.org | is the necessary mkfs tool on the PATH? | 17:20:37 |
Arian | let me update my unstable channel on my nixos machine first. perhaps this was changed recently (There were quite a few changes to repart) | 17:20:40 |
Arian | $ systemd-repart --empty=create --size=1G --image=image.img --definitions=./defs
Failed to set up loopback device for /home/arian/image.img: Permission denied
| 17:22:16 |
Arian | on 253 | 17:22:37 |
Arian | oooh --image is not the destination image. it's the image to mount to look for definition files | 17:23:52 |
Arian | confusing | 17:23:53 |
@elvishjerricco:matrix.org | Arian: Is --image the right thing? | 17:23:55 |
@elvishjerricco:matrix.org | yea | 17:23:57 |
@elvishjerricco:matrix.org | a bit odd for sure | 17:24:02 |
Arian | [arian@utm:~]$ systemd-repart --empty=create --size=1G --definitions=./defs ./image.img
/home/arian/defs/esp.conf:3: CopyFiles= path is not absolute, ignoring: ./files
Sized './image.img' to 1.0G.
TYPE LABEL UUID FILE NODE SIZE PADDING
esp esp b43a24f9-410d-4604-8d83-3aecf33a7313 esp.conf ./image.img1 → 1022.9M → 0B
Σ = 1022.9M Σ = 0B
| 17:24:20 |
@elvishjerricco:matrix.org | yea I think CopyFiles is supposed to be an absolute path within the --root or --image | 17:25:14 |
Arian | nice!
[arian@utm:~]$ systemd-repart --empty=create --size=1G --definitions=./defs ./image.img
Sized './image.img' to 1.0G.
TYPE LABEL UUID FILE NODE SIZE PADDING
esp esp b43a24f9-410d-4604-8d83-3aecf33a7313 esp.conf ./image.img1 → 1022.9M → 0B
Σ = 1022.9M Σ = 0B
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░
└─ esp.conf
Applying changes.
Wiped block device.
Discarded entire block device.
Successfully wiped file system signatures from future partition 0.
Formatting future partition 0.
mkfs.fat 4.2 (2021-01-31)
Could not find mcopy binary.
now complaining about mcopy
| 17:26:22 |
Arian | works!! woohoo | 17:26:52 |
Arian | Ill make a PR to add the repart definitions file to config.system.build.repartDefitions so that it can be consumed by image builder | 17:54:24 |
Arian | hmm systemd-repart CopyFiles not working in a derivation | 18:12:04 |
Arian | crashes with Failed to create temporary directory: No such file or directory | 18:12:11 |
Arian | time to dive in | 18:12:14 |
@elvishjerricco:matrix.org | Arian: Same thing as this? https://github.com/NixOS/nixpkgs/pull/232533/files#diff-e3878de7d7be6c8d04741535f3ffbed368e3ad379eb804daa12ca0056816b1e5R107-R111 | 18:13:42 |
Arian | yes@@ | 18:14:07 |
Arian | thanks! | 18:14:09 |
Arian | hmm setting TMPDIR=/tmp doesn't seem to help for some reason | 18:15:22 |
Arian | oh wait /tmp doesnt exist in the build sandbox of course | 18:16:08 |
Arian | still same error. darnit | 18:17:42 |
Arian | mkdir -p /build/tmp
TMPDIR=/build/tmp systemd-repart \
--empty=create \
--size=2G \
--definitions ${config.system.build.partitionDefinitions} \
$out
| 18:21:14 |
Arian | it's weird because stdenv alreayd sets TMPDIR=/build by default | 18:23:08 |