In Linux system operation, many people don't know much about dmg file, but don't know how to create dmg file. This article will introduce you to Linux using command line to establish dmg. The method of the document, friends who do not understand can come to understand.
What is the DMG file, how to open?
The DMG format is a mirror file on the MAC system. It can also be said to be a compressed file. If you use a PC and do not have MAC OS X for X86, don't bother. If you are using a Mac or installing MAC OS X for X86 on your PC, double-click on the file on the MAC system to unlock it. If you want to burn this file to a DVD, use toast to burn the file to a CD: Dmg=”disc image
Command line creation dmg
Get software version number automatically
APP_NAME=“Soulver”
VERSION=$(/usr /libexec/plistbuddy -c Print:CFBundleShortVersionString: “${APP_NAME}.app/Contents/Info.plist”)
DMG_BACKGROUND_IMG=“Background.png”
VOL_NAME=“ ${APP_NAME} ${VERSION}”
DMG_TMP=“${VOL_NAME}-temp.dmg”
DMG_FINAL=“${VOL_NAME}.dmg”
STAGING_DIR=“. /Install”
Create dmg
#Clean up folders
rm -rf “${STAGING_DIR}” “${DMG_TMP}” “${ DMG_FINAL}”
#Create Folder, Copy, Calculate
mkdir -p “${STAGING_DIR}”
cp -rpf “${APP_NAME} .app” “${STAGING_DIR}”
SIZE=`du -sh “${STAGING_DIR}” |
Sed ‘s/([0-9.]*)M(.*)/1/’`
SIZE=`echo “${SIZE} + 1.0” |
Bc |
Awk ‘{print int($1+0.5)}’`
# Fault-tolerant processing
if [ $? -ne 0 ]; then
echo “Error: Cannot compute size of staging dir”
exit
fi
# Create a temporary dmg file< Br>
hdiutil create -srcfolder “${STAGING_DIR}” -volname “${VOL_NAME}” -fs HFS+
-fsargs “-cc=64,a=16,e =16” -format UDRW -size ${SIZE}M “${DMG_TMP}”
echo “Created DMG: ${DMG_TMP}”
Set dmg
DEVICE=$(hdiutil attach -readwrite -noverify “${DMG_TMP}” |
egrep ‘^/dev/’ |
Sed 1q |
Awk ‘{print $1}’)
sleep 2
Previous12Next Total 2 Pages
We all know that most Linux system operations need to be completed using commands, but the commands
openSUSE Linux is a kernel-based Linux operating system, has been upgraded to version 13.2, how many
libvirt is a virtualization tool under Linux that supports various virtual machine monitors. How do
In the computer system, static routing and dynamic routing are different. Static ro
How to customize the History output format for Linux systems
How Linux lists directories larger than the specified size
How to restart Tomcat regularly on Linux system
How Linux expands the number of file openers
Ubuntu tips for installing Visual Studio Code
How to install and configure Salt
How to set up a Linux system under a RAID array
Linux which command to find files using
Oracle Linux 6.4 accidentally remove VG solution
Linux system novice common command introduction
How to use the cut command to intercept file information in Linux
Win7 system enters the wrong password to lock the computer (a good encryption technique)
Under the Win7 system set QQ, cool dog, PPS in the lower right corner of the computer shows that
What is the new feature of Win10 system OneGet?
Fun in the Windows XP operating system, today you are a dog trainer
Teach you how to uninstall IE9/IE10/IE11 browser
How to set up win10 desktop wallpaper
Win10 opens two methods of the system property window
Set Win8 system sleep wake-up password graphic tutorial