From 40aa553fa944060fd6bd7b0ac073aaa580be23ca Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Fri, 24 Jan 2014 13:50:46 +0100 Subject: [PATCH] part_blk.run: build components before block image With this patch, the components get built before the creation of the block image to ensure that the 'bin' directory exists. Fixes #1038. --- os/run/part_blk.run | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/os/run/part_blk.run b/os/run/part_blk.run index e7a8275087..6712f8acfe 100644 --- a/os/run/part_blk.run +++ b/os/run/part_blk.run @@ -4,18 +4,9 @@ set block_count 20480 -if { [file exists bin/ata.raw] == 0 } then { - # create empty block device file - catch { exec dd if=/dev/zero of=bin/ata.raw bs=512 count=$block_count } - - if [catch { set sfdisk [ exec which sfdisk ] }] { - puts "sfdisk needs to be installed!" - exit 1 - } - - # create two primary partitions (one is extented) and two logical paritions - puts "using sfdisk to partition disk image, requires root privileges" - catch { exec echo "2048,4096,c\n4096,16386,5\n0,0\n0,0\n6144,4096,c\n12288,8192,c\n" | $sfdisk -uS -f bin/ata.raw } +if [catch { set sfdisk [ exec which sfdisk ] }] { + puts "sfdisk needs to be installed!" + exit 1 } # @@ -29,6 +20,16 @@ build { server/part_blk test/blk/cli } + +if { [file exists bin/ata.raw] == 0 } then { + # create empty block device file + catch { exec dd if=/dev/zero of=bin/ata.raw bs=512 count=$block_count } + + # create two primary partitions (one is extented) and two logical paritions + puts "using sfdisk to partition disk image, requires root privileges" + catch { exec echo "2048,4096,c\n4096,16386,5\n0,0\n0,0\n6144,4096,c\n12288,8192,c\n" | $sfdisk -uS -f bin/ata.raw } +} + create_boot_directory #