From f2a3f51996fcedca0e60a6586b82c4915fab33f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 27 Jul 2009 17:11:40 +0000 Subject: [PATCH] jam target to build a flash image. Requires passing UBOOT_IMAGE to jam. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31823 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/u-boot/Jamfile | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/system/boot/platform/u-boot/Jamfile b/src/system/boot/platform/u-boot/Jamfile index 792f4dcae1..0eb0642cf1 100644 --- a/src/system/boot/platform/u-boot/Jamfile +++ b/src/system/boot/platform/u-boot/Jamfile @@ -37,6 +37,34 @@ KernelMergeObject boot_platform_u-boot.o : : -fno-pic ; +# bootable flash image +rule BuildUBootFlashImage image : haikuLoader : uboot_image { + Depends $(image) : $(haikuLoader) ; + #Depends $(image) : $(archive) ; + Depends $(image) : $(uboot_image) ; + LocalClean clean : $(image) ; + FLASH_IMAGE_BLOCK_SIZE on $(image) = 128k ; + FLASH_IMAGE_BLOCK_COUNT on $(image) = 256 ; + #FLASH_IMAGE_UBOOT_OFFSET on $(image) = 0 ; + FLASH_IMAGE_LOADER_OFFSET on $(image) = 248 ; + BuildUBootFlashImage1 $(image) : $(haikuLoader) $(uboot_image) ; +} + + +actions BuildUBootFlashImage1 { + echo "$(1)" + echo "$(2)" + $(RM) $(<) + # make an empty image + dd if=/dev/zero of=$(<) bs=$(FLASH_IMAGE_BLOCK_SIZE) count=$(FLASH_IMAGE_BLOCK_COUNT) + # add u-boot + dd if=$(>[2]) of=$(<) bs=$(FLASH_IMAGE_BLOCK_SIZE) conv=notrunc + # add haiku_loader + dd if=$(>[1]) of=$(<) bs=$(FLASH_IMAGE_BLOCK_SIZE) conv=notrunc seek=$(FLASH_IMAGE_LOADER_OFFSET) +} + +BuildUBootFlashImage haiku_flash_image.bin : haiku_loader : $(UBOOT_IMAGE) ; + SEARCH on [ FGristFiles text_menu.cpp ] = [ FDirName $(HAIKU_TOP) src system boot platform generic ] ;