diff options
-rw-r--r-- | Makefile | 23 |
1 files changed, 4 insertions, 19 deletions
@@ -140,8 +140,8 @@ update-submodules: | |||
140 | install-submodules: cmd=install | 140 | install-submodules: cmd=install |
141 | install-submodules: update-submodules $(INSTALL_SUBMODULES) | 141 | install-submodules: update-submodules $(INSTALL_SUBMODULES) |
142 | 142 | ||
143 | rootfs = samizdat.btrfs | 143 | rootfs = samizdat.seed.btrfs |
144 | patchfs = $(patsubst %.btrfs,%.patch.btrfs,$(rootfs)) | 144 | patchfs = $(patsubst %.seed.btrfs,%.patch.btrfs,$(rootfs)) |
145 | rootfs_verity = rootfs/$(rootfs).verity | 145 | rootfs_verity = rootfs/$(rootfs).verity |
146 | 146 | ||
147 | .PHONY: rootfs rootfs-deps | 147 | .PHONY: rootfs rootfs-deps |
@@ -216,7 +216,6 @@ get_min_size="$$(btrfs inspect-internal min-dev-size --id 1 $@.mnt | (read b _; | |||
216 | mv $@~tmp $@ | 216 | mv $@~tmp $@ |
217 | sudo chmod 644 $@ | 217 | sudo chmod 644 $@ |
218 | 218 | ||
219 | |||
220 | root_hash = $(shell sed -ne 's/^Root hash: *//p' < $<.log) | 219 | root_hash = $(shell sed -ne 's/^Root hash: *//p' < $<.log) |
221 | 220 | ||
222 | veritymount: rootfs/samizdat.seed.btrfs.verity.sh | 221 | veritymount: rootfs/samizdat.seed.btrfs.verity.sh |
@@ -228,22 +227,8 @@ veritymount: rootfs/samizdat.seed.btrfs.verity.sh | |||
228 | %.verity.log.asc: %.verity.log | 227 | %.verity.log.asc: %.verity.log |
229 | sudo gpg --armor --detach-sign $^ | 228 | sudo gpg --armor --detach-sign $^ |
230 | 229 | ||
231 | rootfs/samizdat.seed.btrfs: rootfs/samizdat.btrfs | 230 | rootfs/%.btrfs: |
232 | ifneq ($(shell id -u),0) | 231 | $(SUDO_MAKE) -C rootfs $(notdir $@) |
233 | $(SUDO_MAKE) $@ | ||
234 | else | ||
235 | @while umount $$PWD/$@~tmp; do continue; done | ||
236 | cp --reflink $< $@~tmp | ||
237 | btrfstune -f -S0 $@~tmp | ||
238 | test -d $@.mnt || mkdir $@.mnt | ||
239 | mount -t btrfs -o rw $@~tmp $@.mnt | ||
240 | #bash -c "time btrfs fi defrag -c -r $@.mnt" | ||
241 | s=$(get_min_size) && (set -x; btrfs fi resize 1:$$s $@.mnt && truncate -s "$$s" $@~tmp) | ||
242 | umount $@.mnt | ||
243 | losetup -f $< | ||
244 | btrfstune -S1 $@~tmp | ||
245 | mv $@~tmp $@ | ||
246 | endif | ||
247 | 232 | ||
248 | debian_dist := $(shell lsb_release -cs) | 233 | debian_dist := $(shell lsb_release -cs) |
249 | 234 | ||