summaryrefslogtreecommitdiff
path: root/partitions
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-06-25 21:59:49 -0400
committeru <u@billy>2023-11-17 08:46:41 -0500
commita4a4f588d4c0aeb5e1d580196f02c54e75197683 (patch)
treeb05e55aed06844ea229de8e0769ac8ef12026375 /partitions
parent22c2dbf7a19f9e3013016c915bb798d1f60d76a2 (diff)
Store large files in subvolumes
These files should never be mixed into the same directories as source code, since source code should be backed up by filesystem snapshot, and these should not. This change includes file renames in this repository and in two of its submodules.
Diffstat (limited to 'partitions')
-rw-r--r--partitions/Makefile33
-rw-r--r--partitions/part5.conf2
-rw-r--r--partitions/part6.conf2
-rw-r--r--partitions/part7.conf2
-rw-r--r--partitions/part8.conf2
5 files changed, 24 insertions, 17 deletions
diff --git a/partitions/Makefile b/partitions/Makefile
index 1007a5c..91a60d9 100644
--- a/partitions/Makefile
+++ b/partitions/Makefile
@@ -1,29 +1,36 @@
1 1
2.PHONY: all clean 2.PHONY: all clean
3 3
4all: whole.img 4whole = _build/whole.img
5key = _build/key.img
6
7all: $(whole)
5 8
6stage0_efi_file = ../import-grub-bootx64-efi/3/BOOTX64.EFI 9stage0_efi_file = ../import-grub-bootx64-efi/3/BOOTX64.EFI
7$(stage0_efi_file): 10$(stage0_efi_file):
8 make -C ../import-grub-bootx64-efi ver=3 11 make -C ../import-grub-bootx64-efi ver=3
9 12
10whole.img: $(stage0_efi_file) 13$(whole): $(stage0_efi_file)
11 partvi 14 partvi
12 15
13key.img: $(stage0_efi_file) 16$(key): $(stage0_efi_file)
14 partvi key 17 partvi key
15 18
19_liveboot:
20 btrfs subvolume create $@
21
16PERSIST_SIZE=20G 22PERSIST_SIZE=20G
17persist.img: 23PERSIST_FILE=_liveboot/persist.img
24$(PERSIST_FILE): | _liveboot
18 [ ! -e $@ ] 25 [ ! -e $@ ]
19 fallocate -l "$(PERSIST_SIZE)" $@ 26 fallocate -l "$(PERSIST_SIZE)" $@
20 truncate -s 0 $@ 27 truncate -s 0 $@
21 truncate -s "$(PERSIST_SIZE)" $@ 28 truncate -s "$(PERSIST_SIZE)" $@
22 29
23persist := $(shell [ -e persist.img ] && printf %s '-drive file=persist.img,media=disk,driver=raw' || true) 30optional_persist_disk != [ ! -e $(PERSIST_FILE) ] || printf %s '-drive file=$(PERSIST_FILE),media=disk,driver=raw'
24 31
25.PHONY: usb emu key emu-key keymu 32.PHONY: usb emu key emu-key keymu
26usb: whole.img 33usb: $(whole)
27 usb=$$(usb) && sudo dd status=progress if="$<" of="$$usb" 34 usb=$$(usb) && sudo dd status=progress if="$<" of="$$usb"
28 35
29# QEMU_DISPLAY_OPTIONS = -nographic 36# QEMU_DISPLAY_OPTIONS = -nographic
@@ -34,16 +41,16 @@ QEMU_OPTIONS = $(QEMU_BIOS_OPTIONS) $(QEMU_DISPLAY_OPTIONS)
34define emu 41define emu
35 NO_AT_BRIDGE=1 qemu-system-x86_64 ${QEMU_OPTIONS} -m 800 -enable-kvm -boot c \ 42 NO_AT_BRIDGE=1 qemu-system-x86_64 ${QEMU_OPTIONS} -m 800 -enable-kvm -boot c \
36 -drive file=$(1),media=disk,driver=raw \ 43 -drive file=$(1),media=disk,driver=raw \
37 $(persist) 44 $(optional_persist_disk)
38endef 45endef
39 46
40emu: whole.img 47emu: $(whole)
41 $(call emu,$<) 48 $(call emu,$<)
42 49
43emu-key keymu: key.img 50emu-key keymu: $(key)
44 $(call emu,$<) 51 $(call emu,$<)
45 52
46key: key.img 53key: $(key)
47 usb=$$(usb) && \ 54 usb=$$(usb) && \
48 sudo dd status=progress bs=1048576 if="$<" of="$$usb" && \ 55 sudo dd status=progress bs=1048576 if="$<" of="$$usb" && \
49 sudo $(call emu,"$$usb") 56 sudo $(call emu,"$$usb")
@@ -56,9 +63,9 @@ efi-ventoy: ventoy-efi-example.img
56 $(call emu,$<) 63 $(call emu,$<)
57 64
58clean: 65clean:
59 rm -rf _build whole.img key.img 66 rm -rf _build
60 67
61.PHONY: total-destroy 68.PHONY: total-destroy
62total-destroy: clean 69total-destroy: clean
63 rm -f persist.img 70 rm -f $(PERSIST_FILE)
64 $(MAKE) persist.img 71 $(MAKE) $(PERSIST_FILE)
diff --git a/partitions/part5.conf b/partitions/part5.conf
index 08e4196..25d1fdb 100644
--- a/partitions/part5.conf
+++ b/partitions/part5.conf
@@ -1,3 +1,3 @@
1name=samizdat-root-seed 1name=samizdat-root-seed
2type=dm-verity-data 2type=dm-verity-data
3data_path=../rootfs/samizdat.seed.btrfs 3data_path=../rootfs/_filesystem/samizdat.seed.btrfs
diff --git a/partitions/part6.conf b/partitions/part6.conf
index 0075c91..d3f7515 100644
--- a/partitions/part6.conf
+++ b/partitions/part6.conf
@@ -1,3 +1,3 @@
1name=samizdat-root-seed-verity 1name=samizdat-root-seed-verity
2type=dm-verity-hashes 2type=dm-verity-hashes
3data_path=../rootfs/samizdat.seed.btrfs 3data_path=../rootfs/_filesystem/samizdat.seed.btrfs
diff --git a/partitions/part7.conf b/partitions/part7.conf
index 7a77685..aaeee4e 100644
--- a/partitions/part7.conf
+++ b/partitions/part7.conf
@@ -1,3 +1,3 @@
1name=samizdat-rootfs 1name=samizdat-rootfs
2type=dm-verity-data 2type=dm-verity-data
3data_path=../rootfs/samizdat.patch.btrfs 3data_path=../rootfs/_filesystem/samizdat.patch.btrfs
diff --git a/partitions/part8.conf b/partitions/part8.conf
index 8298fd3..9dc22fe 100644
--- a/partitions/part8.conf
+++ b/partitions/part8.conf
@@ -1,3 +1,3 @@
1name=samizdat-root-patch-verity 1name=samizdat-root-patch-verity
2type=dm-verity-hashes 2type=dm-verity-hashes
3data_path=../rootfs/samizdat.patch.btrfs 3data_path=../rootfs/_filesystem/samizdat.patch.btrfs