michael@0: #!/bin/sh michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: # Create a read-only disk image of the contents of a folder michael@0: # michael@0: # Usage: make-diskimage michael@0: # michael@0: # michael@0: # michael@0: # <.dsstore_file> michael@0: # michael@0: # michael@0: # tip: use '-null-' for if you only want to michael@0: # provide <.dsstore_file> and michael@0: michael@0: DMG_PATH=$1 michael@0: SRC_FOLDER=$2 michael@0: VOLUME_NAME=$3 michael@0: michael@0: # optional arguments michael@0: EULA_RSRC=$4 michael@0: DMG_DSSTORE=$5 michael@0: DMG_BKGND_IMG=$6 michael@0: michael@0: EXTRA_ARGS= michael@0: michael@0: if test -n "$EULA_RSRC" && test "$EULA_RSRC" != "-null-" ; then michael@0: EXTRA_ARGS="--resource $EULA_RSRC" michael@0: fi michael@0: michael@0: if test -n "$DMG_DSSTORE" ; then michael@0: EXTRA_ARGS="$EXTRA_ARGS --copy $DMG_DSSTORE:/.DS_Store" michael@0: fi michael@0: michael@0: if test -n "$DMG_BKGND_IMG" ; then michael@0: EXTRA_ARGS="$EXTRA_ARGS --mkdir /.background --copy $DMG_BKGND_IMG:/.background" michael@0: fi michael@0: michael@0: echo `dirname $0`/pkg-dmg --target "$DMG_PATH" --source "$SRC_FOLDER" \ michael@0: --volname "$VOLUME_NAME" $EXTRA_ARGS michael@0: michael@0: `dirname $0`/pkg-dmg --target "$DMG_PATH" --source "$SRC_FOLDER" \ michael@0: --volname "$VOLUME_NAME" $EXTRA_ARGS michael@0: michael@0: exit $?