changes made on 3/11: added support for License Agreement display on mount. optional argument

is an .rsrc binary file which resources will be copied into the disk image using Apple's
ResMerger tool. Also enhanced logging.
*** nightly automation - not part of the regular build ***
----------------------------------------------------------------------
This commit is contained in:
jj%netscape.com 2003-03-18 23:18:11 +00:00
parent 0794975356
commit 6ee9ea8166

View File

@ -39,8 +39,15 @@
# Create a read-only disk image of the contents of a folder # Create a read-only disk image of the contents of a folder
# #
# Usage: make-diskimage <image file> <folder> <volume name> <.dsstore file to use> <background image> # Usage: make-diskimage <image_file>
# <src_folder>
# <volume_name>
# <eula_resource_file>
# <.dsstore_file>
# <background_image_file>
# #
# tip: use '-null-' for <eula-resource-file> if you only want to
# provide <.dsstore_file> and <background_image_file>
DMG_DIRNAME=`dirname $1` DMG_DIRNAME=`dirname $1`
DMG_DIR=`cd $DMG_DIRNAME; pwd` DMG_DIR=`cd $DMG_DIRNAME; pwd`
@ -50,8 +57,9 @@ SRC_FOLDER=`cd $2; pwd`
VOLUME_NAME=$3 VOLUME_NAME=$3
# optional arguments # optional arguments
DMG_DSSTORE=$4 EULA_RSRC=$4
DMG_BKGND_IMG=$5 DMG_DSSTORE=$5
DMG_BKGND_IMG=$6
# Find the size of the folder contents # Find the size of the folder contents
FOLDER_SIZE=`du -s $SRC_FOLDER | sed s/[^0-9].*//` FOLDER_SIZE=`du -s $SRC_FOLDER | sed s/[^0-9].*//`
@ -76,15 +84,14 @@ MOUNT_DIR=`hdid $DMG_TEMP_NAME | grep Apple_HFS | awk '{print $3}'`
# copy content # copy content
echo "copying content to disk image" echo "copying content to disk image"
echo ditto $SRC_FOLDER
ditto -rsrcFork $SRC_FOLDER $MOUNT_DIR ditto -rsrcFork $SRC_FOLDER $MOUNT_DIR
# add optional Finder window layout and background image # add optional Finder window layout and background image
if [ ! -z ${DMG_DSSTORE} ]; then if [ ! -z ${DMG_DSSTORE} ]; then
echo cp ${DMG_DSSTORE} echo "adding .DS_Store"
cp -p ${DMG_DSSTORE} ${MOUNT_DIR}/.DS_Store cp -p ${DMG_DSSTORE} ${MOUNT_DIR}/.DS_Store
fi fi
if [ ! -z ${DMG_BKGND_IMG} ]; then if [ ! -z ${DMG_BKGND_IMG} ]; then
echo cp ${DMG_BKGND_IMG} echo "adding background image"
mkdir ${MOUNT_DIR}/.background mkdir ${MOUNT_DIR}/.background
cp -p ${DMG_BKGND_IMG} ${MOUNT_DIR}/.background/ cp -p ${DMG_BKGND_IMG} ${MOUNT_DIR}/.background/
fi fi
@ -97,8 +104,16 @@ echo "unmounting disk image"
hdiutil detach $DEV_NAME hdiutil detach $DEV_NAME
# convert to read-only image # convert to read-only image
echo converting disk image to read-only echo "converting disk image to read-only"
hdiutil convert $DMG_TEMP_NAME -format UDRO -o ${DMG_DIR}/${DMG_NAME} hdiutil convert $DMG_TEMP_NAME -format UDRO -o ${DMG_DIR}/${DMG_NAME}
rm -f $DMG_TEMP_NAME rm -f $DMG_TEMP_NAME
# adding EULA resources
if [ ! -z "${EULA_RSRC}" -a "${EULA_RSRC}" != "-null-" ]; then
echo "adding EULA resources"
hdiutil unflatten ${DMG_DIR}/${DMG_NAME}
/Developer/Tools/ResMerger -a ${EULA_RSRC} -o ${DMG_DIR}/${DMG_NAME}
hdiutil flatten ${DMG_DIR}/${DMG_NAME}
fi
echo "disk image done" echo "disk image done"