diff mbox

boot_fat.mk: Rework boot partition creation to use mtools

Message ID 1447108540-29733-1-git-send-email-john.stultz@linaro.org
State New
Headers show

Commit Message

John Stultz Nov. 9, 2015, 10:35 p.m. UTC
Use mtools rather then mounting the partition, in order
to avoid requiring root permissions to build.

Cc: Vishal Bhoj <vishal.bhoj@linaro.org>
Cc: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>

---
 boot_fat.mk | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

-- 
1.9.1
diff mbox

Patch

diff --git a/boot_fat.mk b/boot_fat.mk
index 5d3a0d4..c5cba1e 100644
--- a/boot_fat.mk
+++ b/boot_fat.mk
@@ -2,14 +2,10 @@  REALTOP=$(realpath $(TOP))
 boot_fatimage: bootimage
 	dd if=/dev/zero of=$(PRODUCT_OUT)/boot_fat.uefi.img bs=512 count=98304
 	mkfs.fat -n "BOOT IMG" $(PRODUCT_OUT)/boot_fat.uefi.img
-	mkdir -p $(PRODUCT_OUT)/boot_tmp && sudo mount -o umask=000,loop,rw,sync $(PRODUCT_OUT)/boot_fat.uefi.img $(PRODUCT_OUT)/boot_tmp
-	cp $(PRODUCT_OUT)/kernel $(PRODUCT_OUT)/boot_tmp/Image
-	cp $(PRODUCT_OUT)/hi6220-hikey.dtb $(PRODUCT_OUT)/boot_tmp/hi6220-hikey.dtb
-	cp -r device/linaro/hikey/bootloader/* $(PRODUCT_OUT)/boot_tmp/
-	cp $(PRODUCT_OUT)/ramdisk.img $(PRODUCT_OUT)/boot_tmp/
-	mkdir -p $(PRODUCT_OUT)/boot_tmp/grub/
-	sync
-	sudo umount -f $(PRODUCT_OUT)/boot_fat.uefi.img
+	mcopy -i $(PRODUCT_OUT)/boot_fat.uefi.img $(PRODUCT_OUT)/kernel ::Image
+	mcopy -i $(PRODUCT_OUT)/boot_fat.uefi.img $(PRODUCT_OUT)/hi6220-hikey.dtb ::hi6220-hikey.dtb
+	mcopy -s -i $(PRODUCT_OUT)/boot_fat.uefi.img device/linaro/hikey/bootloader/* ::
+	mcopy -i $(PRODUCT_OUT)/boot_fat.uefi.img  $(PRODUCT_OUT)/ramdisk.img ::ramdisk.img
 
 
 droidcore: boot_fatimage