axeld + bonefish:
Changed the way the VMware image is built. Instead of creating a normal image first and then adding vmdk header and that image, we create the VMware image in one go, now. Therefore "jam update-vmware-image ..." does now actually update the VMware image directly, instead of updating the normal image and recreating the VMware image. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23972 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+7
-12
@@ -588,10 +588,7 @@ AddTargetVariableToScript $(script) : <build>makebootable ;
|
|||||||
AddTargetVariableToScript $(script) : <build>rc ;
|
AddTargetVariableToScript $(script) : <build>rc ;
|
||||||
AddTargetVariableToScript $(script) : <build>resattr ;
|
AddTargetVariableToScript $(script) : <build>resattr ;
|
||||||
AddTargetVariableToScript $(script) : <build>unzip ;
|
AddTargetVariableToScript $(script) : <build>unzip ;
|
||||||
#AddTargetVariableToScript $(script) : $(HAIKU_IMAGE) : imagePath ;
|
AddTargetVariableToScript $(script) : <build>vmdkheader ;
|
||||||
# causes a cyclic dependency
|
|
||||||
AddVariableToScript $(script) : imagePath
|
|
||||||
: [ FDirName $(HAIKU_IMAGE_DIR) $(HAIKU_IMAGE_NAME) ] ;
|
|
||||||
AddVariableToScript $(script) : sourceDirsToCopy
|
AddVariableToScript $(script) : sourceDirsToCopy
|
||||||
: $(HAIKU_INSTALL_SOURCE_DIRS) ;
|
: $(HAIKU_INSTALL_SOURCE_DIRS) ;
|
||||||
|
|
||||||
@@ -607,12 +604,10 @@ CreateHaikuImageCopyFilesScript $(HAIKU_IMAGE_COPY_FILES_SCRIPT) ;
|
|||||||
CreateHaikuImageUnzipFilesScript $(HAIKU_IMAGE_UNZIP_FILES_SCRIPT) ;
|
CreateHaikuImageUnzipFilesScript $(HAIKU_IMAGE_UNZIP_FILES_SCRIPT) ;
|
||||||
|
|
||||||
# Convenience wrapper rule around BuildHaikuImage.
|
# Convenience wrapper rule around BuildHaikuImage.
|
||||||
rule _BuildHaikuImage
|
rule _BuildHaikuImage image : isImage : isVMwareImage
|
||||||
{
|
{
|
||||||
# _BuildHaikuImage <image target> : <isImage> ;
|
# _BuildHaikuImage <image target> : <isImage> : <isVMwareImage> ;
|
||||||
#
|
#
|
||||||
local image = $(1) ;
|
|
||||||
local isImage = $(2) ;
|
|
||||||
|
|
||||||
# build the image
|
# build the image
|
||||||
# HAIKU_IMAGE_EARLY_USER_SCRIPTS, HAIKU_IMAGE_LATE_USER_SCRIPTS can be
|
# HAIKU_IMAGE_EARLY_USER_SCRIPTS, HAIKU_IMAGE_LATE_USER_SCRIPTS can be
|
||||||
@@ -625,6 +620,7 @@ rule _BuildHaikuImage
|
|||||||
$(HAIKU_IMAGE_UNZIP_FILES_SCRIPT)
|
$(HAIKU_IMAGE_UNZIP_FILES_SCRIPT)
|
||||||
$(HAIKU_IMAGE_LATE_USER_SCRIPTS)
|
$(HAIKU_IMAGE_LATE_USER_SCRIPTS)
|
||||||
: $(isImage)
|
: $(isImage)
|
||||||
|
: $(isVMwareImage)
|
||||||
;
|
;
|
||||||
|
|
||||||
# remove the scripts we have generated
|
# remove the scripts we have generated
|
||||||
@@ -641,18 +637,17 @@ _BuildHaikuImage $(HAIKU_IMAGE) : true ;
|
|||||||
NotFile haiku-image ;
|
NotFile haiku-image ;
|
||||||
Depends haiku-image : $(HAIKU_IMAGE) ;
|
Depends haiku-image : $(HAIKU_IMAGE) ;
|
||||||
|
|
||||||
|
|
||||||
# install Haiku into a directory
|
# install Haiku into a directory
|
||||||
NotFile install-haiku ;
|
NotFile install-haiku ;
|
||||||
_BuildHaikuImage install-haiku : 0 ;
|
_BuildHaikuImage install-haiku : 0 ;
|
||||||
|
|
||||||
|
|
||||||
#pragma mark - Build The VMWare Image
|
# build the VMware image
|
||||||
|
|
||||||
HAIKU_VMWARE_IMAGE_NAME ?= haiku.vmdk ;
|
HAIKU_VMWARE_IMAGE_NAME ?= haiku.vmdk ;
|
||||||
HAIKU_VMWARE_IMAGE ?= $(HAIKU_VMWARE_IMAGE_NAME) ;
|
HAIKU_VMWARE_IMAGE ?= $(HAIKU_VMWARE_IMAGE_NAME) ;
|
||||||
MakeLocate $(HAIKU_VMWARE_IMAGE) : $(HAIKU_IMAGE_DIR) ;
|
MakeLocate $(HAIKU_VMWARE_IMAGE) : $(HAIKU_IMAGE_DIR) ;
|
||||||
|
|
||||||
BuildVMWareImage $(HAIKU_VMWARE_IMAGE) : $(HAIKU_IMAGE)
|
_BuildHaikuImage $(HAIKU_VMWARE_IMAGE) : true : true ;
|
||||||
: $(HAIKU_IMAGE_SIZE) ;
|
|
||||||
NotFile haiku-vmware-image ;
|
NotFile haiku-vmware-image ;
|
||||||
Depends haiku-vmware-image : $(HAIKU_VMWARE_IMAGE) ;
|
Depends haiku-vmware-image : $(HAIKU_VMWARE_IMAGE) ;
|
||||||
|
|||||||
+10
-2
@@ -624,9 +624,9 @@ rule CreateHaikuImageUnzipFilesScript script
|
|||||||
CreateContainerUnzipFilesScript $(HAIKU_IMAGE_CONTAINER_NAME) : $(script) ;
|
CreateContainerUnzipFilesScript $(HAIKU_IMAGE_CONTAINER_NAME) : $(script) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule BuildHaikuImage haikuImage : scripts : isImage
|
rule BuildHaikuImage haikuImage : scripts : isImage : isVMwareImage
|
||||||
{
|
{
|
||||||
# BuildHaikuImage <haiku image> : <scripts> : <is image> ;
|
# BuildHaikuImage <haiku image> : <scripts> : <is image> : <isVMwareImage> ;
|
||||||
|
|
||||||
if $(isImage) = 1 || $(isImage) = true {
|
if $(isImage) = 1 || $(isImage) = true {
|
||||||
IS_IMAGE on $(haikuImage) = 1 ;
|
IS_IMAGE on $(haikuImage) = 1 ;
|
||||||
@@ -634,6 +634,12 @@ rule BuildHaikuImage haikuImage : scripts : isImage
|
|||||||
IS_IMAGE on $(haikuImage) = "" ;
|
IS_IMAGE on $(haikuImage) = "" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $(isVMwareImage) = 1 || $(isVMwareImage) = true {
|
||||||
|
IS_VMWARE_IMAGE on $(haikuImage) = 1 ;
|
||||||
|
} else {
|
||||||
|
IS_VMWARE_IMAGE on $(haikuImage) = "" ;
|
||||||
|
}
|
||||||
|
|
||||||
local mainScript = build_haiku_image ;
|
local mainScript = build_haiku_image ;
|
||||||
SEARCH on $(mainScript) = [ FDirName $(HAIKU_TOP) build scripts ] ;
|
SEARCH on $(mainScript) = [ FDirName $(HAIKU_TOP) build scripts ] ;
|
||||||
|
|
||||||
@@ -643,7 +649,9 @@ rule BuildHaikuImage haikuImage : scripts : isImage
|
|||||||
|
|
||||||
actions BuildHaikuImage1
|
actions BuildHaikuImage1
|
||||||
{
|
{
|
||||||
|
export imagePath="$(1)"
|
||||||
export isImage="$(IS_IMAGE)"
|
export isImage="$(IS_IMAGE)"
|
||||||
|
export isVMwareImage="$(IS_VMWARE_IMAGE)"
|
||||||
$(2[1]) $(2[2-])
|
$(2[1]) $(2[2-])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
# sourceDirsToCopy
|
# sourceDirsToCopy
|
||||||
# updateOnly
|
# updateOnly
|
||||||
# dontClearImage
|
# dontClearImage
|
||||||
|
# isVMwareImage
|
||||||
#
|
#
|
||||||
# bfsShell
|
# bfsShell
|
||||||
# copyattr
|
# copyattr
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
# resattr
|
# resattr
|
||||||
# rc
|
# rc
|
||||||
# unzip
|
# unzip
|
||||||
|
# vmdkheader
|
||||||
#
|
#
|
||||||
if [ $# -gt 0 ]; then
|
if [ $# -gt 0 ]; then
|
||||||
. $1
|
. $1
|
||||||
@@ -93,15 +95,30 @@ unzipFile()
|
|||||||
# create the image and mount it
|
# create the image and mount it
|
||||||
if [ $isImage ]; then
|
if [ $isImage ]; then
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
imageOffsetFlags=
|
||||||
|
if [ $isVMwareImage ]; then
|
||||||
|
imageOffsetFlags="--start-offset 65536"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! $updateOnly ]; then
|
if [ ! $updateOnly ]; then
|
||||||
echo "Creating image ..."
|
echo "Creating image ..."
|
||||||
|
|
||||||
|
ddFlags=
|
||||||
|
if [ $isVMwareImage ]; then
|
||||||
|
rm -f $imagePath
|
||||||
|
$vmdkheader -h 64k -i${imageSize}M $imagePath || exit 1
|
||||||
|
ddFlags="conv=notrunc oflag=append"
|
||||||
|
dontClearImage=
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -e $imagePath -o ! "$dontClearImage" ]; then
|
if [ ! -e $imagePath -o ! "$dontClearImage" ]; then
|
||||||
dd if=/dev/zero of=$imagePath bs=1048576 count=$imageSize
|
dd if=/dev/zero of=$imagePath bs=1048576 count=$imageSize $ddFlags
|
||||||
fi
|
fi
|
||||||
$bfsShell --initialize $imagePath Haiku
|
$bfsShell --initialize $imageOffsetFlags $imagePath Haiku
|
||||||
$makebootable $imagePath
|
$makebootable $imageOffsetFlags $imagePath
|
||||||
fi
|
fi
|
||||||
$bfsShell -n $imagePath > /dev/null &
|
$bfsShell -n $imageOffsetFlags $imagePath > /dev/null &
|
||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user