[Q] Chromecast command line primer

Search This thread

bobcat987

Senior Member
Mar 31, 2011
70
40
Apologies if this has already been covered but a quick search turned up nothing. I recently rooted and was wondering if there was any resource to describe the ins and outs of the chromecast shell. Specifically I wanted to know if there is a way to define a custom start up script. For the moment I would just like to auto update the PATH env variable to include my own bin directory on /data with some of the more useful busybox commands symlinked and maybe add some cooler stuff later. I've done something similar in dd-wrt with a special nvram variable to point to a script, but I don't know if there is an equivalent here. Thanks.
 

Mape0661

Member
Aug 28, 2014
19
13
Gothenburg
Apologies if this has already been covered but a quick search turned up nothing. I recently rooted and was wondering if there was any resource to describe the ins and outs of the chromecast shell. Specifically I wanted to know if there is a way to define a custom start up script. For the moment I would just like to auto update the PATH env variable to include my own bin directory on /data with some of the more useful busybox commands symlinked and maybe add some cooler stuff later. I've done something similar in dd-wrt with a special nvram variable to point to a script, but I don't know if there is an equivalent here. Thanks.

I think we need to edit /init.rc

but it's write protected =/
 
  • Like
Reactions: bobcat987

ddggttff3

Inactive Recognized Developer
Dec 13, 2009
815
1,543
Minnesota
Apologies if this has already been covered but a quick search turned up nothing. I recently rooted and was wondering if there was any resource to describe the ins and outs of the chromecast shell. Specifically I wanted to know if there is a way to define a custom start up script. For the moment I would just like to auto update the PATH env variable to include my own bin directory on /data with some of the more useful busybox commands symlinked and maybe add some cooler stuff later. I've done something similar in dd-wrt with a special nvram variable to point to a script, but I don't know if there is an equivalent here. Thanks.

I think we need to edit /init.rc

but it's write protected =/

You can, but you would have to do the modifications with an extracted system image, re-squashfs it back up, and then flash it back to the device.
 
  • Like
Reactions: bobcat987

bobcat987

Senior Member
Mar 31, 2011
70
40
Thanks for the replies. If I'm feeling bold this weekend I'll take a look at creating a one-off /system for this.
 

Asphyx

Senior Member
Dec 19, 2007
2,158
378
Android Wear
Google Pixel Watch
You can, but you would have to do the modifications with an extracted system image, re-squashfs it back up, and then flash it back to the device.

Seeing this you guys are making me think (always dangerous!)
Is it possible to code and inject an on device player app that could be inserted into the system (similar to Netflix) that could be triggered by another app for local playback without the need for an Internet connection?

Something like that would really increase the streaming capability for areas where Internet connection is not available.
And if the right code is found could even give local streams DHT capability if we had the ability to add those codecs to the player system.
 

Mape0661

Member
Aug 28, 2014
19
13
Gothenburg
You can, but you would have to do the modifications with an extracted system image, re-squashfs it back up, and then flash it back to the device.

I've been looking at system.img from 19084.001.zip

it seems it only got this then I unsquashfs it

root@debian:~/squashfs-root# ls
bin boot chrome etc lib netflix res usr

I'm I looking in the wrong file?
 

ddggttff3

Inactive Recognized Developer
Dec 13, 2009
815
1,543
Minnesota
I've been looking at system.img from 19084.001.zip

it seems it only got this then I unsquashfs it

root@debian:~/squashfs-root# ls
bin boot chrome etc lib netflix res usr

I'm I looking in the wrong file?

if you want to modify init.rc, then you need to extract the initramfs from the kernel, modify it, repackage the initramfs, compile the kernel from src (as the default one is signed, and can't be merged with a modified initramfs), and then merge the compiled kernel with the initramfs you modified.
 

Mape0661

Member
Aug 28, 2014
19
13
Gothenburg
if you want to modify init.rc, then you need to extract the initramfs from the kernel, modify it, repackage the initramfs, compile the kernel from src (as the default one is signed, and can't be merged with a modified initramfs), and then merge the compiled kernel with the initramfs you modified.

Looks like this gonna be my "children are sleeping" project for some time .-)

Well I extracted initramfs from boot.img and mounted it with cpio. At least I'm looking at the right files. I have never compiled a kernel for this kind of devices before (only for my computer) and I having trubble to cross compile, my arm compiled programs wont run on CC.

Do you got some good pages I can read and learn this stuff from?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Apologies if this has already been covered but a quick search turned up nothing. I recently rooted and was wondering if there was any resource to describe the ins and outs of the chromecast shell. Specifically I wanted to know if there is a way to define a custom start up script. For the moment I would just like to auto update the PATH env variable to include my own bin directory on /data with some of the more useful busybox commands symlinked and maybe add some cooler stuff later. I've done something similar in dd-wrt with a special nvram variable to point to a script, but I don't know if there is an equivalent here. Thanks.

    I think we need to edit /init.rc

    but it's write protected =/
    1
    Apologies if this has already been covered but a quick search turned up nothing. I recently rooted and was wondering if there was any resource to describe the ins and outs of the chromecast shell. Specifically I wanted to know if there is a way to define a custom start up script. For the moment I would just like to auto update the PATH env variable to include my own bin directory on /data with some of the more useful busybox commands symlinked and maybe add some cooler stuff later. I've done something similar in dd-wrt with a special nvram variable to point to a script, but I don't know if there is an equivalent here. Thanks.

    I think we need to edit /init.rc

    but it's write protected =/

    You can, but you would have to do the modifications with an extracted system image, re-squashfs it back up, and then flash it back to the device.