diff --git a/README.md b/README.md index f8de5ae..0d707f7 100644 --- a/README.md +++ b/README.md @@ -5,20 +5,45 @@ Combination of some codes and applications to create macOS installation media outside Mac app store.\ Thanks me later :3 +## Motivation + +Honestly, the main reason is I've limited Internet. I can't download the whole 8GB, 12GB at one stroke. So, I've to download multiple times and MAS doesn't support it. Moreover, I want to save downloaded installer so that I can use them next time. That's why I made this script. + ## How to Use -it's still in beta. Simply, just edit `MACOS_VERSION` and `TARGET_DISK` variables and run the script. +it's still in beta. Simply just run the script, answer the question and go! -`TARGET_DISK` information can be found in `diskutil` > `table` > `Device`. In this example `disk3`. So, `TARGET_DISK` become `/dev/disk3`. +`DISK SELECTION` information can be found in `diskutil` > `table` > `Device`. In this example `disk3`. So, `TARGET_DISK` become `/dev/disk3`. ![diskutil](screenshots/diskutil.png) ```shell script -$ git clone https://github.com/heinthanth/macos-bootable-usb -$ cd macos-bootable-usb +$ curl -LO https://github.com/heinthanth/macos-bootable-usb/releases/latest/download/macos-booable-usb-creator.sh $ ./creator.sh ``` +Optionally, you can verify the script with this command. + +``` shell script +$ curl -LO https://github.com/heinthanth/macos-bootable-usb/releases/latest/download/SHASUM +$ shasum creator.sh -c SHASUM +``` + +Moreover, if you don't trust `SHASUM` file, go check with `gpg` + +``` +$ curl -LO https://github.com/heinthanth/macos-bootable-usb/releases/latest/download/SHASUM +$ curl -LO https://github.com/heinthanth/macos-bootable-usb/releases/latest/download/SHASUM.gpg +$ gpg --keyserver hkp://keys.gnupg.net --recv-key 46D4B29338EE5105BCA79A142E1082FBF9CB91E9 +$ gpg --verify SHASUM.gpg SHASUM +``` +## Thanks + +Thanks to - + +* +* + ## License This work is licensed under GPLv3. See [License](LICENSE.md) for more information. diff --git a/SHASUM b/SHASUM new file mode 100644 index 0000000..da62a71 --- /dev/null +++ b/SHASUM @@ -0,0 +1 @@ +b471c68e69343b66ea45c15d518a9ce76b0e7428 creator.sh diff --git a/SHASUM.gpg b/SHASUM.gpg new file mode 100644 index 0000000..be304c6 Binary files /dev/null and b/SHASUM.gpg differ diff --git a/creator.sh b/creator.sh index dcf28c5..5b91921 100755 --- a/creator.sh +++ b/creator.sh @@ -108,9 +108,6 @@ else INSTALLATION_FILES=("BaseSystem.chunklist" "InstallInfo.plist" "AppleDiagnostics.dmg" "AppleDiagnostics.chunklist" "BaseSystem.dmg" "InstallESDDmg.pkg") fi -# TODO: REMOVE AFTER DEVELOPMENT -BASE_URL="http://localhost:8000" - OUTPUT_DIR="${MACOS_VERSION}-files" mkdir -p $OUTPUT_DIR printf "\n" @@ -193,10 +190,23 @@ case "$response" in esac # END OF FORMAT DISK -MACOS_VERSION="catalina" - +# CREATION INSTALLER if [[ $MACOS_VERSION == "bigsur" ]]; then - printf "Big Sur stuffs." + if ! sudo -n true 2>/dev/null; then + printf "[*] asking for sudo passwords. " + sudo -v + printf "\n" + fi + sudo installer -pkg "${OUTPUT_DIR}/InstallAssistant.pkg" -target / + printf "\n" + sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --nointeraction --volume /Volumes/"${MACOS_VERSION}-installer/" + if ! sudo -n true 2>/dev/null; then + printf "[*] asking for sudo passwords. " + sudo -v + printf "\n" + fi + sudo chown $USER "${OUTPUT_DIR}/InstallAssistant.pkg" + sudo chmod 755 "${OUTPUT_DIR}/InstallAssistant.pkg" else # RESTORE DISK IMAGE if ! sudo -n true 2>/dev/null; then @@ -222,3 +232,4 @@ else fi printf "\n[*] Installation Media \e[32mOk!\e[31m Just go reboot now!\n\n" +# END OF CREATING INSTALLER