diff options
author | Andrew Cady <d@cryptonomic.net> | 2021-02-23 22:05:53 -0500 |
---|---|---|
committer | Andrew Cady <d@cryptonomic.net> | 2021-02-23 22:05:53 -0500 |
commit | c08551a63baa3cab98a6172cb819f7b8b62ba0d0 (patch) | |
tree | 1b835b6dc4fac2c6efeb408be94259ad89b32694 | |
parent | 6889986a93415a55691fb145abe2de4cf959b62e (diff) |
key-only mode for partvi; integrated partvi
These commands are available in sami:
make upgrade
make emu
make key
They use partvi.
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | partitions/Makefile | 12 | ||||
-rwxr-xr-x | src/partvi | 13 |
3 files changed, 26 insertions, 8 deletions
@@ -167,11 +167,10 @@ FORCE: | |||
167 | $(btrfs_images): FORCE | 167 | $(btrfs_images): FORCE |
168 | $(MAKE) -C rootfs $(notdir $@) | 168 | $(MAKE) -C rootfs $(notdir $@) |
169 | 169 | ||
170 | .PHONY: usb key | 170 | .PHONY: usb key emu |
171 | usb: rootfs | 171 | usb emu: rootfs |
172 | sudo ROOTFS=rootfs/$(rootfs) ./src/parted-usb.sh USB | 172 | usb key emu: |
173 | key: | 173 | make -C partitions $@ |
174 | sudo ROOTFS=none ./src/parted-usb.sh USB | ||
175 | 174 | ||
176 | boot: rootfs | 175 | boot: rootfs |
177 | sudo ./src/mkinitramfs-samizdat | 176 | sudo ./src/mkinitramfs-samizdat |
diff --git a/partitions/Makefile b/partitions/Makefile index cf8ac28..a1a7fea 100644 --- a/partitions/Makefile +++ b/partitions/Makefile | |||
@@ -6,12 +6,20 @@ all: whole.img | |||
6 | whole.img: | 6 | whole.img: |
7 | partvi | 7 | partvi |
8 | 8 | ||
9 | .PHONY: usb emu | 9 | key.img: |
10 | partvi key | ||
11 | |||
12 | .PHONY: usb emu key | ||
10 | usb: whole.img | 13 | usb: whole.img |
11 | usb=$$(usb) && dd status=progress if="$<" of="$$usb" | 14 | usb=$$(usb) && sudo dd status=progress if="$<" of="$$usb" |
12 | 15 | ||
13 | emu: whole.img | 16 | emu: whole.img |
14 | qemu-system-x86_64 -m 800 -enable-kvm -boot c "$<" | 17 | qemu-system-x86_64 -m 800 -enable-kvm -boot c "$<" |
15 | 18 | ||
19 | key: key.img | ||
20 | usb=$$(usb) && \ | ||
21 | sudo dd status=progress bs=1048576 if="$<" of="$$usb" && \ | ||
22 | sudo qemu-system-x86_64 -m 800 -enable-kvm -boot c "$$usb" | ||
23 | |||
16 | clean: | 24 | clean: |
17 | rm -rf _build whole.img | 25 | rm -rf _build whole.img |
@@ -207,6 +207,7 @@ create_ptable_conf() | |||
207 | partition-table) start=$((start + devsz)); return;; | 207 | partition-table) start=$((start + devsz)); return;; |
208 | efi-system-partition) typecode=C12A7328-F81F-11D2-BA4B-00A0C93EC93B ;; | 208 | efi-system-partition) typecode=C12A7328-F81F-11D2-BA4B-00A0C93EC93B ;; |
209 | dm-verity-data|dm-verity-hashes) | 209 | dm-verity-data|dm-verity-hashes) |
210 | check_for_key_only_skip || return 0 | ||
210 | case "$name" in | 211 | case "$name" in |
211 | samizdat-rootfs|samizdat-root-patch) typecode=4f68bce3-e8cd-4db1-96e7-fbcaf984b709 ;; | 212 | samizdat-rootfs|samizdat-root-patch) typecode=4f68bce3-e8cd-4db1-96e7-fbcaf984b709 ;; |
212 | samizdat-root-patch-verity) typecode=2c7357ed-ebd2-46d9-aec1-23d437ec2bf5 ;; | 213 | samizdat-root-patch-verity) typecode=2c7357ed-ebd2-46d9-aec1-23d437ec2bf5 ;; |
@@ -319,10 +320,20 @@ pee_on_table() | |||
319 | $sudo sfdisk -Y dos "$dev" < "$DOS_TABLE_FILE" || return | 320 | $sudo sfdisk -Y dos "$dev" < "$DOS_TABLE_FILE" || return |
320 | } | 321 | } |
321 | 322 | ||
323 | check_for_key_only_skip() | ||
324 | { | ||
325 | [ "$KEY_ONLY" ] || return 0 | ||
326 | case "$type" in | ||
327 | dm-verity-data|dm-verity-hashes) false ;; | ||
328 | *) true ;; | ||
329 | esac | ||
330 | } | ||
322 | 331 | ||
323 | clone_parts_to_target() | 332 | clone_parts_to_target() |
324 | { | 333 | { |
325 | f=$(readlink -e _build/"${f%.conf}") || break | 334 | |
335 | check_for_key_only_skip || return 0 | ||
336 | f=$(readlink -e _build/"${f%.conf}") || return | ||
326 | ficlonerange.py "$f" "$target" | 337 | ficlonerange.py "$f" "$target" |
327 | } | 338 | } |
328 | 339 | ||