Skip to content

Instantly share code, notes, and snippets.

@porteusconf
Forked from sj-dan/crosflex_downloader.sh
Created August 8, 2024 06:15
Show Gist options
  • Save porteusconf/b6707b315fb8f45c0e0521090700bdca to your computer and use it in GitHub Desktop.
Save porteusconf/b6707b315fb8f45c0e0521090700bdca to your computer and use it in GitHub Desktop.
Script to fetch and download the latest version of the Chrome OS Flex image
#!/bin/bash
URLs=$(curl "https://dl.google.com/dl/edgedl/chromeos/recovery/cloudready_recovery2.json" \
-s --output - | \
grep "^.*\"url\".*$" | \
sed "s/.*\"url\": \"\(.*\)\".*$/\1/g")
printf "\nPick which channel to download your image from. Channel name is near the end of the URL.\n\n"
select URL in $URLs;
do
if [[ $URL != "" ]]; then
printf "\nDownloading now...\n\n"
curl -L -C - -O $URL && break
else
printf "\nInvalid selection, please pick one of the above displayed numbers.\n\n"
fi
done
printf "\nFinished downloading!\n"
@porteusconf
Copy link
Author

porteusconf commented Aug 8, 2024

As an alternative to shell script, you can download flex recovery images in your browser using this non-google site https://chromeos.exerra.xyz/ It also lets you choose any of these 3: stable (newest), LTC (newer LongTermSupport Candidate, 3-month update) or LTR (older LongTermSupport Release, every 6 months) and shows you for each of the 3, the size, current versions of the recovery image. chrome version, hashes, etc. When I tested it seemed legit and safe as it actually did downloads directly from Google site https://dl.google.com/ with same download URL as the script got (below): for example https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_15662.115.0_reven_recovery_lts-channel_mp-v3.bin.zip

If you want to try the recovery.sh script instead, note that when I tested today, 2024-08-08, the downloads part of the script failed on a Chromebook in dev mode until I added -k option to curl and then I see this:

chronos@reven /mnt/stateful_partition/junk $ bash /usr/local/bin/recovery.sh --config "https://dl.google.com/dl/edgedl/chromeos/recovery/cloudready_recovery2.conf"
Working in /tmp/tmp.crosrec/
Downloading config file from https://dl.google.com/dl/edgedl/chromeos/recovery/cloudready_recovery2.conf

If you know the Model string displayed at the recovery screen,
type some or all of it; otherwise just press Enter:
This may take a few minutes to print the full list...
There are 3 recovery images to choose from:

0 -
1 - ChromeOS Flex
channel: LTC
2 - ChromeOS Flex
channel: LTR
3 - ChromeOS Flex
channel: STABLE

Please select a recovery image to download: 2
...
Unpacking the zipfile
Archive: chromeos_15662.115.0_reven_recovery_lts-channel_mp-v3.bin.zip
skipping: chromeos_15662.115.0_reven_recovery_lts-channel_mp-v3.bin need PK compat. v4.5 (can do v2.1)
The /tmp tmpfs partition on my flex laptop is only 1.9 gig, so it is a good thing the unzip fails because crew installed an ancient 2009 version 6 of unzip. However if you do crew install p7zip you can uncompress the zip file with 7z x chromeos*.zip (after moving to a partition with at least 8-9 gig free space, and able to hold a 9 gig file, (not a fat32 USB, tho maybe ExFAT might work).

@porteusconf
Copy link
Author

Info below about 3 versions available in 2025. (was translated from a russian zeroday website.. hard to find this info elsewhere ;-)

  • S (Stable, stable) — devices are automatically updated to the next stable version every month. Newer than LTC which is newer than LTS.

  • LTC (Long-term support candidate, long-term support candidate) — devices receive LTS functions 3 months before the release of the version on LTS. Devices are automatically updated to the next version of LTC. May have same or newer version of chromeos and chrome as LTS.

  • LTS (aka LTR) (Long-term support, long-term support) — devices are automatically updated to the next version of LTS every 6 months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment