Created
June 12, 2022 01:22
-
-
Save semenko/3de2c6135687a40bd55fb3dec1411706 to your computer and use it in GitHub Desktop.
Generate NTFS image for Xbox OSU updater
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -x | |
| # By Nick Semenkovich https://nick.semenkovich.com | |
| # | |
| # Largely derived from: | |
| # https://gist.github.com/kumbasar/49906cb704ce9213c972a3e008c74c0c | |
| # I found myself needing to update an Xbox S via USB (with the Offline System Update OSU1 patch) | |
| # See: https://support.xbox.com/en-US/help/hardware-network/console/system-update-solution/offline-system-update | |
| # | |
| # Unfortunately, making an NTFS filesystem on OS X is hard without disabling System Integrity Protection (SIP) | |
| # and installing third party / semi-sketch software & extensions. | |
| # | |
| # Instead, you can use a remote linux machine (I bet Google Cloud Shell would work for free for this), | |
| # and generate an image, then write that image to a flash drive on OS X. | |
| # Download OSU | |
| wget -O osu1.zip https://www.xbox.com/xboxone/osu1 | |
| image="osu1.img" | |
| label="osu" | |
| mntdir=`mktemp -d` | |
| # This will be roughly 7GB -- it must be larger than the osu1.zip contents | |
| sudo dd status=progress if=/dev/zero of=$image bs=4M count=1750 && sync | |
| echo 'type=7' | sudo sfdisk $image | |
| LOOPMOUNT=`sudo losetup --partscan --show --find ${image}` | |
| echo $LOOPMOUNT | |
| sudo mkfs.ntfs -Q -v -F -L ${label} ${LOOPMOUNT}p1 | |
| sudo mount ${LOOPMOUNT}p1 ${mntdir} | |
| # Extract OSU1 into the tmpdir | |
| unzip osu1.zip -d ${mntdir} | |
| # Unmount everything | |
| sudo umount ${mntdir} | |
| sudo losetup -d ${LOOPMOUNT} | |
| # NOTE: | |
| # Now you need to write this on OS X to the flash drive | |
| # Roughly: | |
| # 0. Copy the file to your local mac ($ scp -C remote-machine:osu1.img .) | |
| # 1. Plug in a flash drive | |
| # 2. Find its path ($ mount ) | |
| # 3. Ensure it's unmounted ($ sudo diskutil unmount /Volumes/FLASHNAME/) | |
| # 4. Write the image ($ sudo dd if=osu1.img of=/dev/diskNN bs=4M && sync) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That is the GitHub Gist I was referencing in the previous step! Thank you for providing the full code.
As mentioned, this script is designed for a more complicated scenario (using a remote Linux machine and then transferring the image file to a Mac for final writing).
However, since you have the Linux environment directly on your Chromebook, we can use a simpler, more direct approach that achieves the same result without needing to create and manage the temporary
osu1.imgfile.The simpler, direct approach we previously discussed is less prone to error in your specific Chromebook environment.
Here is a reminder of the direct commands you need to execute, which are simpler than running the entire script above, especially on a Chromebook.
Simplified Direct Commands (No
.imgfile needed)You can skip the entire image creation portion of that script and jump straight to formatting and file transfer.
Phase 1: Format the USB Drive to NTFS
ntfs-3gis installed)/dev/sdb1):sudo fdisk -lsdb1with your actual partition name):sdb1with your actual partition name.)Phase 2: Download and Transfer the OSU File
$SystemUpdatefolder to the root of your USB.)[USB Name]with the name that appears in your Files app.)sudo cp -r $SystemUpdate /mnt/chromeos/removable/[USB Name]/Once this is done, safely unmount and eject the drive. You are ready to proceed with the Offline System Update (OSU) on your Xbox One S.