ipq40xx: Support Chromium OS image-type creation
[openwrt/openwrt.git] / target / linux / ipq40xx / image / chromium.mk
1 define Build/cros-gpt
2 cp $@ $@.tmp 2>/dev/null || true
3 ptgen -o $@.tmp -g \
4 -T cros_kernel -N kernel -p $(CONFIG_TARGET_KERNEL_PARTSIZE)m \
5 -N rootfs -p $(CONFIG_TARGET_ROOTFS_PARTSIZE)m
6 cat $@.tmp >> $@
7 rm $@.tmp
8 endef
9
10 define Build/append-kernel-part
11 dd if=$(IMAGE_KERNEL) bs=$(CONFIG_TARGET_KERNEL_PARTSIZE)M conv=sync >> $@
12 endef
13
14 # NB: Chrome OS bootloaders replace the '%U' in command lines with the UUID of
15 # the kernel partition it chooses to boot from. This gives a flexible way to
16 # consistently build and sign kernels that always use the subsequent
17 # (PARTNROFF=1) partition as their rootfs.
18 define Build/cros-vboot
19 $(STAGING_DIR_HOST)/bin/cros-vbutil \
20 -k $@ -c "root=PARTUUID=%U/PARTNROFF=1" -o $@.new
21 @mv $@.new $@
22 endef