New build system feature to shorten the turn-around times when working
with image files. E.g. jam -q update-image libbe.so kernel_x86 will only build libbe.so and the kernel (if necessary) and copy them onto the already existing Haiku image. The MIME DB will not be reinstalled, and only those source directories will be copied for which the AddSourceDirectoryToHaikuImage rule is given a second argument (e.g. "1"). The image will otherwise remain unchanged. The "update-vmware-image" and "update-install" work similarly for the VMWare image and the directory installation respectively. Note that, due to the way the VMWare image is created (prepending a header to the standard image), the file itself is fully rebuilt, i.e. changes made during the emulation will be lost after updating the VMWare image. The feature requires Haiku's jam. With other jam versions a similar effect can be reached by accordingly setting the HAIKU_IMAGE_UPDATE_ONLY and HAIKU_INCLUDE_IN_IMAGE in the UserBuildConfig file. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20602 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# The first argument is the shell script that initializes the variables.
|
||||
# The first argument is the shell script that initializes the variables:
|
||||
# sourceDir
|
||||
# outputDir
|
||||
# tmpDir
|
||||
@@ -10,6 +10,7 @@
|
||||
# imageSize
|
||||
# addBuildCompatibilityLibDir
|
||||
# sourceDirsToCopy
|
||||
# updateOnly
|
||||
#
|
||||
# bfsShell
|
||||
# copyattr
|
||||
@@ -53,16 +54,20 @@ fi
|
||||
# create the image and mount it
|
||||
if [ $isImage ]; then
|
||||
echo
|
||||
echo "Creating image ..."
|
||||
dd if=/dev/zero of=$imagePath bs=1M count=$imageSize
|
||||
$bfsShell --initialize $imagePath Haiku
|
||||
$makebootable $imagePath
|
||||
if [ ! $updateOnly ]; then
|
||||
echo "Creating image ..."
|
||||
dd if=/dev/zero of=$imagePath bs=1M count=$imageSize
|
||||
$bfsShell --initialize $imagePath Haiku
|
||||
$makebootable $imagePath
|
||||
fi
|
||||
$bfsShell -n $imagePath > /dev/null &
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
$mkindex BEOS:APP_SIG
|
||||
# needed to launch apps via signature
|
||||
# create BEOS:APP_SIG index -- needed to launch apps via signature
|
||||
if [ ! $updateOnly ]; then
|
||||
$mkindex BEOS:APP_SIG
|
||||
fi
|
||||
|
||||
echo "Populating image ..."
|
||||
while [ $# -gt 0 ]; do
|
||||
@@ -73,55 +78,58 @@ done
|
||||
|
||||
# install MIME database
|
||||
# TODO: It should be possible to do that in the build system too.
|
||||
mimeDBSource=$sourceDir/src/data/beos_mime
|
||||
mimeDBDest=${tPrefix}home/config/settings/beos_mime
|
||||
|
||||
echo "Deleting old MIME database ..."
|
||||
if [ ! $updateOnly ]; then
|
||||
mimeDBSource=$sourceDir/src/data/beos_mime
|
||||
mimeDBDest=${tPrefix}home/config/settings/beos_mime
|
||||
|
||||
$rm -rf $mimeDBDest
|
||||
$mkdir -p $mimeDBDest
|
||||
mkdir -p $tmpDir
|
||||
mimeTmpDir=$tmpDir/mime
|
||||
mimeTmpIndex=0
|
||||
echo "Deleting old MIME database ..."
|
||||
|
||||
# create tmp dir for the MIME conversion stuff
|
||||
mkdir -p $mimeTmpDir
|
||||
$rm -rf $mimeDBDest
|
||||
$mkdir -p $mimeDBDest
|
||||
mkdir -p $tmpDir
|
||||
mimeTmpDir=$tmpDir/mime
|
||||
mimeTmpIndex=0
|
||||
|
||||
echo "Installing MIME database ..."
|
||||
# create tmp dir for the MIME conversion stuff
|
||||
mkdir -p $mimeTmpDir
|
||||
|
||||
for inSuperFile in $mimeDBSource/*.super; do
|
||||
superType=$(basename $inSuperFile .super)
|
||||
outSuperDir=$mimeDBDest/$superType
|
||||
echo "Installing MIME database ..."
|
||||
|
||||
# compile rdef to rsrc file and the rsrc file to attributes
|
||||
mimeTmpIndex=$(($mimeTmpIndex + 1))
|
||||
tmpFile=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.rsrc
|
||||
tmpFile2=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.mime
|
||||
$rc -o $tmpFile $inSuperFile
|
||||
mkdir -p $tmpFile2
|
||||
$resattr -O -o $tmpFile2 $tmpFile
|
||||
$cp -r ${sPrefix}$tmpFile2 $outSuperDir
|
||||
for inSuperFile in $mimeDBSource/*.super; do
|
||||
superType=$(basename $inSuperFile .super)
|
||||
outSuperDir=$mimeDBDest/$superType
|
||||
|
||||
# iterate through the sub types
|
||||
for inSubFile in $mimeDBSource/$superType/*; do
|
||||
# check, if the type exists
|
||||
if test -f $inSubFile && grep META:TYPE $inSubFile > /dev/null 2>&1 ; then
|
||||
subType=$(basename $inSubFile)
|
||||
outSubFile=$outSuperDir/$subType
|
||||
# compile rdef to rsrc file and the rsrc file to attributes
|
||||
mimeTmpIndex=$(($mimeTmpIndex + 1))
|
||||
tmpFile=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.rsrc
|
||||
tmpFile2=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.mime
|
||||
$rc -o $tmpFile $inSuperFile
|
||||
mkdir -p $tmpFile2
|
||||
$resattr -O -o $tmpFile2 $tmpFile
|
||||
$cp -r ${sPrefix}$tmpFile2 $outSuperDir
|
||||
|
||||
# compile rdef to rsrc file and the rsrc file to attributes
|
||||
mimeTmpIndex=$(($mimeTmpIndex + 1))
|
||||
tmpFile=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.rsrc
|
||||
tmpFile2=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.mime
|
||||
$rc -o $tmpFile $inSubFile
|
||||
$resattr -O -o $tmpFile2 $tmpFile
|
||||
$cp ${sPrefix}$tmpFile2 $outSubFile
|
||||
fi
|
||||
# iterate through the sub types
|
||||
for inSubFile in $mimeDBSource/$superType/*; do
|
||||
# check, if the type exists
|
||||
if test -f $inSubFile && grep META:TYPE $inSubFile > /dev/null 2>&1 ; then
|
||||
subType=$(basename $inSubFile)
|
||||
outSubFile=$outSuperDir/$subType
|
||||
|
||||
# compile rdef to rsrc file and the rsrc file to attributes
|
||||
mimeTmpIndex=$(($mimeTmpIndex + 1))
|
||||
tmpFile=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.rsrc
|
||||
tmpFile2=$mimeTmpDir/mimedb$$_${mimeTmpIndex}.mime
|
||||
$rc -o $tmpFile $inSubFile
|
||||
$resattr -O -o $tmpFile2 $tmpFile
|
||||
$cp ${sPrefix}$tmpFile2 $outSubFile
|
||||
fi
|
||||
done
|
||||
done
|
||||
done
|
||||
|
||||
# cleanup tmp dir
|
||||
rm -rf $mimeTmpDir
|
||||
# cleanup tmp dir
|
||||
rm -rf $mimeTmpDir
|
||||
fi # ! updateOnly
|
||||
|
||||
|
||||
# install sources
|
||||
|
||||
Reference in New Issue
Block a user