Kenny MacDermid
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Chromecast Irc for discussions: Freenode #teameureka URLs for versions: - [46278](http://cache.pack.google.com/edgedl/googletv-eureka/stable-channel/ota.46278.stable-channel.eureka-b3.ef7fdf1f7153dacecc77b7d1a3bb22a97e27ec7e.zip) - [80438](http://redirector.gvt1.com/edgedl/googletv-eureka/stable-channel/ota.80438.stable-channel.eureka-b3.58634c32e910f395736070dfd0d4146a86d1450d.zip) - [84839](http://redirector.gvt1.com/edgedl/googletv-eureka/stable-channel/ota.84839.stable-channel.eureka-b3.d6f360302fb7115e7825d1402539e725bac905d0.zip) - [88007](http://redirector.gvt1.com/edgedl/googletv-eureka/stable-channel/ota.88007.stable-channel.eureka-b3.21d42fb3e90192f4163119560ab06d0177431041.zip) - [104827](http://redirector.gvt1.com/edgedl/googletv-eureka/stable-channel/ota.104827.stable-channel.eureka-b3.7cd352588b537080bd4f7ee52afb376d0ddf3d0d.zip) - [124602](http://redirector.gvt1.com/edgedl/googletv-eureka/stable-channel/ota.124602.stable-channel.eureka-b3.e1232bf3ebbc71c933b5c215ea2d9bf366a70dac.zip) - [141268](http://redirector.gvt1.com/edgedl/googletv-eureka/stable-channel/ota.141268.stable-channel.eureka-b3.cdde73df6699a2d7694c1e7b30cfa0487171c8aa.zip) - [159268](http://redirector.gvt1.com/edgedl/googletv-eureka/stable-channel/ota.159268.stable-channel.eureka-b3.adf9f4e6b7ad7068e5f85dbb375236d5d933031b.zip) Extracted using [binwalk](https://github.com/devttys0/binwalk) (`binwalk -e `), and then the recover extracted from `_boot.img.extracted/1CC100` using the same. ### Potentially interesting changes: #### Recovery init.rc (_boot.img.extracted/_1CC100.extracted/init.rc) diff -r 80438/recovery/init.rc 84839/recovery/init.rc 64a65,67 > # set KEYSTORE for cast_crypto_keys_marvell.cc > export KEYSTORE /data/netflix/AACS > 65a69,71 > # Load device mapper table > exec /sbin/dmsetup create system -r /dmtable > 68c74 < mount squashfs mtd@rootfs /system ro nodev noatime --- > mount squashfs /dev/mapper/system /system ro nodev noatime 180a187,189 > > # Set kernel configuration > exec /bin/sysctl -p ## Most likely cause of the issue Note the `/dmtable` addition above. It looks like Google is now signing their system image and checking it in the initramfs during boot, and mounting based on it's mapped endpoint. This endpoint is ONLY made if dmsetup is able to verify the signature. You can view this `/dmtable` file at `_boot.img.extracted/_1CC100.extracted/cpio-root/dmtable` #### Contents of `/dmtable` from the initramfs 0 180864 verity 1 /dev/block/mtdblock3 /dev/block/mtdblock3 4096 4096 22608 22608 sha256 c244bdd1892f3cf1b49b6263ada8fc24fdf773e777643506f6a9dcd6f871a4f9 1c93138393bf240ebc47a5b13ba75bdc80c0607f1f8e88391c0b668a531a9322 More reading can be found [Here](https://gitlab.com/cryptsetup/cryptsetup/wikis/DMVerity) on DM Verity. What does this for AutoRoot? Unless a way to edit & repack the initramfs in a systematic and SAFE way can be found, not too much can be done. IF this can be done, solution should be simple unless there are extra hidden tricks: In `/init.rc`, remove: exec /sbin/dmsetup create system -r /dmtable ... mount squashfs /dev/mapper/system /system ro nodev noatime and replace with: # exec /sbin/dmsetup create system -r /dmtable ... mount squashfs mtd@rootfs /system ro nodev noatime #### Kernel (_boot.img.extracted/6AD5) TODO: - [x] Try extracting Config - [x] Try [bindiff](https://security.googleblog.com/2016/03/bindiff-now-available-for-free.html) on both From `strings` on both, the kernel was rebuilt: < Linux version 3.8.13+ (user@host) (gcc version 4.9.x 20150123 (prerelease) (4.9.2_cos_gg_a2bc87a_4.9.2-r128) ) #0 PREEMPT Mon Oct 31 22:17:58 2016 +0000 (bfb4e546) > Linux version 3.8.13+ (user@host) (gcc version 4.9.x 20150123 (prerelease) (4.9.2_cos_gg_4.9.2-r145-41f3 e25635616c067b9ee272304e6f86ac8ee9db_4.9.2-r145) ) #0 PREEMPT Fri Feb 3 09:54:31 2017 -0800 (033bf506) ##### Bootloader 84839 contains a new `bootloader.eureka-b3`. TODO: - [ ] Bindiff/RE the bootloader (tchebb: this won't get you anywhere since bootloader images are encrypted. It's unlikely there have been changes. They re-encrypt the bootloader every OTA even if the code hasn't changed at all) - [ ] Figure out how/where bootloader stored and entry point Bootloader is flashed with (META-INF/com/google/android/updater-script) assert(package_extract_file("bootloader.eureka-b3", "/tmp/bootloader.img"), run_program("/bin/flash_bootloader", "eureka-b3", "/tmp/bootloader.img"), delete("/tmp/bootloader.img")); Rebuild boot.img - Here is how you can unpack/repack a boot.img from chromecast ota.zip file 1. Extract regular android boot image, by removing Marvell Cryptographic Header `dd bs=256 skip=1 if=boot.img of=aboot.img` 2. Use abootimg tool to extract initrd from regular andoroid boot image (initrd.img) `abootimg -x aboot.img` 3. extract conents of initrd ``` mkdir rd; cd rd; xz -d -c ../initrd.img | cpio -i -d -H newc --no-absolute-filenames ``` 4. Re-create initrd after modifications. (kernel does not have crc64 check, so use crc32) (`find .` includes `.` in the archive, use `*` instead) (`--device-independent --no-absolute-filenames`?) `find * | cpio -o -H newc 2>/dev/null | xz --lzma2=dict=64MiB --check=crc32 -z > ../initrd.img` 5. Update regular android boot image ``` cd .. abootimg -u aboot.img -r initrd.img ``` 6. make it bootable for chromecast by adding Marvell cryptographic header `dd bs=256 seek=1 if=aboot.img of=boot.img` If the image is made larger it's possible the crypto header will have to be updated with the new size. See `cc-mangle-bootimg` for an example. Image may not be able to be managed with `cc-mangle-bootimg aboot.img boot.img 0x02` as it removes the `cmdline`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully