GithubHelp home page GithubHelp logo

jonnytech / mkosxinstallusb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eprigorodov/mkosxinstallusb

0.0 1.0 0.0 18 KB

Linux shell script that creates USB flash drive booting OS X installer

License: Apache License 2.0

Shell 100.00%

mkosxinstallusb's Introduction

mkosxinstallusb

Linux shell script that creates bootable USB flash drive with OS X installer.

OS X installer application contains a disk image "InstallESD.dmg" that can be used to create a bootable USB flash drive. The procedure is well described in the media, see references below.

This script automates process on Linux platform, doing essentially the following:

mkdir -p /mnt/OSX_InstallESD /mnt/OSX_BaseSystem /mnt/usbstick

# convert installer disk image to raw format
dmg2img "Install OS X <Version>.app/Contents/SharedSupport/InstallESD.dmg" InstallESD.img
kpartx -a InstallESD.img
mount /dev/mapper/loop0p2 /mnt/OSX_InstallESD

# convert base system disk image to raw format
dmg2img /mnt/OSX_InstallESD/BaseSystem.dmg BaseSystem.img
kpartx -a BaseSystem.img
mount /dev/mapper/loop1p1 /mnt/OSX_BaseSystem

# partition the USB flash drive, /dev/sdX
sgdisk -o /dev/sdX
sgdisk -n 1:0:0 -t 1:AF00 -c 1:"disk image" -A 1:set:2 /dev/sdX
mkfs.hfsplus -v "OS X Base System" /dev/sdX1
mount /dev/sdX1 /mnt/usbstick

# copy installer files
rsync -aAEHW /mnt/OSX_BaseSystem/ /mnt/usbstick/
rm -f /mnt/usbstick/System/Installation/Packages
rsync -aAEHW /mnt/OSX_InstallESD/Packages /mnt/usbstick/System/Installation/
rsync -aAEHW /mnt/OSX_InstallESD/BaseSystem.chunklist /mnt/usbstick/
rsync -aAEHW /mnt/OSX_InstallESD/BaseSystem.dmg /mnt/usbstick/
sync

Usage: ./mkosxinstallusb.sh </dev/sdX> "Install OS X <Version>.app", where </dev/sdX> is a block device for target USB flash drive, e.g. /dev/sdb.

Known problems:

References:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.