Last active
December 7, 2025 20:14
-
-
Save DennisLfromGA/c14b5ec1e2c2de97cca05fdc4e512c59 to your computer and use it in GitHub Desktop.
[BROKEN] Script for ChromeOS Flex to add cros_debug / dev mode option in grub.cfg
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
| ########################################################################## | |
| ### THIS SCRIPT NO LONGER WORKS DUE TO RECENT CHANGES IN CHROMEOS Flex ### | |
| ########################################################################## | |
| ### Script to add cros_debug / dev mode option in grub.cfg | |
| ### ( Each Flex update removes cros_debug / dev mode option | |
| ### Be sure to run this script AFTER each update and BEFORE rebooting ) | |
| ANS= | |
| ROOTDEVICE= | |
| ROOTDEVICEPREFIX= | |
| P12MOUNTPOINT=/var/p12 | |
| GRUBCFGPATH=$P12MOUNTPOINT/efi/boot | |
| GRUBCFGFILE=grub.cfg | |
| # Exits the script with return code $1, spitting out message $@ to stderr | |
| error() { | |
| local ecode="$1" | |
| shift | |
| echo "$*" 1>&2 | |
| return "$ecode" | |
| } | |
| # Find the root device | |
| # Sets: | |
| # - $ROOTDEVICE as the root device (e.g. /dev/sda or /dev/mmcblk0) | |
| # - $ROOTDEVICEPREFIX as a prefix for partitions (/dev/sda, /dev/mmcblk0p) | |
| findrootdevice() { | |
| ROOTDEVICE="`rootdev -d -s`" | |
| if [ -z "$ROOTDEVICE" ]; then | |
| error 1 "Cannot find root device." | |
| fi | |
| if [ ! -b "$ROOTDEVICE" ]; then | |
| error 1 "$ROOTDEVICE is not a block device." | |
| fi | |
| # If $ROOTDEVICE ends with a number (e.g. mmcblk0), partitions are named | |
| # ${ROOTDEVICE}pX (e.g. mmcblk0p1). If not (e.g. sda), they are named | |
| # ${ROOTDEVICE}X (e.g. sda1). | |
| ROOTDEVICEPREFIX="$ROOTDEVICE" | |
| if [ "${ROOTDEVICE%[0-9]}" != "$ROOTDEVICE" ]; then | |
| ROOTDEVICEPREFIX="${ROOTDEVICE}p" | |
| fi | |
| } | |
| findrootdevice | |
| if [ ! -d $P12MOUNTPOINT ]; then | |
| # Make mountpoint | |
| echo "Making directory to mount partition 12" | |
| sudo mkdir -p $P12MOUNTPOINT | |
| elif [ ! -d $GRUBCFGPATH ]; then | |
| # Mount EFI partition | |
| echo "Mounting ${ROOTDEVICEPREFIX}12 on $P12MOUNTPOINT" | |
| sudo mount ${ROOTDEVICEPREFIX}12 $P12MOUNTPOINT | |
| fi | |
| # Check for cros_debug option, need 5 | |
| DEBUGCOUNT="$(grep 'cros_efi cros_debug' $GRUBCFGPATH/$GRUBCFGFILE | wc -l)" | |
| if [ "$DEBUGCOUNT" -eq 5 ]; then | |
| echo "cros_debug has been added to $GRUBCFGFILE, no changes needed." | |
| exit | |
| fi | |
| # grub.cfg needs editing | |
| echo "Editing $GRUBCFGFILE to add 'cros_debug' option." | |
| echo " | |
| PLEASE NOTE: | |
| I claim no responsibility for any damage or harm that may occur to your | |
| device as a result of running this script. PROCEED AT YOR OWN RISK. | |
| " | |
| echo -n "[ press ENTER to continue - Ctrl-C to abort ] "; read ANS | |
| cp $GRUBCFGPATH/$GRUBCFGFILE /tmp | |
| # vi /tmp/$GRUBCFGFILE | |
| sed -e 's/cros_efi /cros_efi cros_debug /' -e 's/cros_efi root/cros_efi cros_debug root/' /tmp/$GRUBCFGFILE | |
| sudo cp $GRUBCFGPATH/$GRUBCFGFILE $GRUBCFGPATH/${GRUBCFGFILE}.bak | |
| sudo cp /tmp/$GRUBCFGFILE $GRUBCFGPATH/ | |
| echo "Done, you can reboot now." | |
| exit |
Author
Yes tried it and it seems that it works thx.
…On Wed, Jul 9, 2025, 19:51 DennisL ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
But i can just edit the grub.cfg with a live linux right?
Possibly, maybe just try it and let us know.
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/DennisLfromGA/c14b5ec1e2c2de97cca05fdc4e512c59#gistcomment-5669200>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEJTZPZX7KMQ5AQQFZITTFD3HU3ADBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTEMBTGQ2DQMRTU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
It looks like Google has removed all kernel blobs (and also GRUB) from the EFI partition and switched to crdyboot-based booting process. The kernel is now located in a separate partition (KERN-A/B) with its cmdline, just like what a normal Chromebook does.
As a result, booting Flex with Linux bootloaders like GRUB is no longer possible.
BTW, I got developer mode working on latest R142 by patching crdyboot itself, check here if anyone are interested :)
Author
Thanx @supechicken, they keep finding ways to make it harder but that just makes it more rewarding when it's defeated. ;-)
Worked for me too for chrome-os-flex 142.0.7444.220 on old Lenovo g700. Yes... much thanks. And surprised the 64-byte SIG files did not have to be changed. ;-)
crosh> uname -a
Linux localhost 6.6.99-08727-gaac38b365d2c #1 SMP PREEMPT_DYNAMIC Wed, 8 Oct 2025 17:51:29 -0700 x86_64 Intel(R) Pentium(R) CPU 2030M @ 2.50GHz GenuineIntel GNU/Linux
crosh> shell
chronos@reven / $ date
Sun Dec 7 15:10:11 EST 2025
chronos@reven / $ uname -a
Linux localhost 6.6.99-08727-gaac38b365d2c #1 SMP PREEMPT_DYNAMIC Wed, 8 Oct 2025 17:51:29 -0700 x86_64 Intel(R) Pentium(R) CPU 2030M @ 2.50GHz GenuineIntel GNU/Linux
chronos@reven / $ cat /etc/lsb-release
CHROMEOS_ARC_ANDROID_SDK_VERSION=33
CHROMEOS_ARC_VERSION=14390219
CHROMEOS_AUSERVER=https://tools.google.com/service/update2
CHROMEOS_BOARD_APPID={C924E0C4-AF80-4B6B-A6F0-DD75EDBCC37C}
CHROMEOS_CANARY_APPID={90F229CE-83E2-4FAF-8479-E368A34938B1}
CHROMEOS_DEVSERVER=
CHROMEOS_RELEASE_APPID={C924E0C4-AF80-4B6B-A6F0-DD75EDBCC37C}
CHROMEOS_RELEASE_BOARD=reven-signed-mp-v8keys
CHROMEOS_RELEASE_BRANCH_NUMBER=57
CHROMEOS_RELEASE_BUILDER_PATH=reven-release/R142-16433.57.0
CHROMEOS_RELEASE_BUILD_NUMBER=16433
CHROMEOS_RELEASE_BUILD_TYPE=Official Build
CHROMEOS_RELEASE_CHROME_MILESTONE=142
CHROMEOS_RELEASE_DESCRIPTION=16433.57.0 (Official Build) stable-channel reven
CHROMEOS_RELEASE_KEYSET=mp-v8
CHROMEOS_RELEASE_NAME=Chrome OS
CHROMEOS_RELEASE_PATCH_NUMBER=0
CHROMEOS_RELEASE_TRACK=stable-channel
CHROMEOS_RELEASE_UNIBUILD=1
CHROMEOS_RELEASE_VERSION=16433.57.0
DEVICETYPE=CHROMEBOOK
GOOGLE_RELEASE=16433.57.0
chronos@reven / $
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Possibly, maybe just try it and let us know.