mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-11 19:24:10 +01:00
39 lines
1.1 KiB
Bash
Executable File
39 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# the following environment variables must be set
|
|
: ${ROOT_DIR?} ${BUILD_DIR?} ${PACKAGE_LBL?} ${PACKAGE_DIR?} ${FW_DIR?}
|
|
|
|
# more variables
|
|
APP_PATH="${BUILD_DIR}/ground/openpilotgcs/bin/OpenPilot GCS.app"
|
|
TEMP_FILE="${PACKAGE_DIR}/OpenPilot-temp.dmg"
|
|
OUT_FILE="${PACKAGE_DIR}/OpenPilot-${PACKAGE_LBL}.dmg"
|
|
VOL_NAME="OpenPilot"
|
|
|
|
# prepare the stage
|
|
rm -f "${TEMP_FILE}"
|
|
rm -f "${OUT_FILE}"
|
|
|
|
hdiutil convert "${ROOT_DIR}/package/osx/OpenPilot.dmg" \
|
|
-format UDRW -o "${TEMP_FILE}"
|
|
device=$(hdiutil attach "${TEMP_FILE}" | \
|
|
egrep '^/dev/' | sed 1q | awk '{print $1}')
|
|
|
|
# packaging goes here
|
|
cp -r "${APP_PATH}" "/Volumes/${VOL_NAME}"
|
|
#cp -r "${FW_DIR}" "/Volumes/${VOL_NAME}/firmware"
|
|
cp "${FW_DIR}/fw_coptercontrol-${PACKAGE_LBL}.opfw" "/Volumes/${VOL_NAME}/firmware"
|
|
|
|
cp "${ROOT_DIR}/HISTORY.txt" "/Volumes/${VOL_NAME}"
|
|
|
|
"${ROOT_DIR}/package/osx/libraries" \
|
|
"/Volumes/${VOL_NAME}/OpenPilot GCS.app" || exit 1
|
|
|
|
hdiutil detach ${device}
|
|
|
|
echo "Resizing dmg"
|
|
hdiutil resize -size 250m ${TEMP_FILE}
|
|
hdiutil convert "${TEMP_FILE}" -format UDZO -o "${OUT_FILE}"
|
|
|
|
# cleanup
|
|
rm "${TEMP_FILE}"
|