Originally Posted by morchu
Before I send you the files/instruction, do you know whether you have adb enabled on regular boot on your rooted chromecast? That would be the easiest way to transfer the needed files to your rooted chromecast's /data/ folder.
Another method is to reboot to flashcast and transfer it while in flashcast.
Yes, ADB is enabled in the rooted CC (still at last Eureka release 44433.001) and I can successfully connect and adb shell into it.
Update: ADB is not really required if you start from the Eureka 44433 release as you can always easily set up a http server with for example "python3 -m http.server 8000" somewhere on a PC and then use "busybox wget ..." (busybox is included on that release) to pull the files on your CC.
In the meanwhile I copied your loopmount.sh script to /cache on the CC, then downloaded the 159268 OTA to a PC and extracted it ... now waiting for your instructions to get/build the modified initrd.sqfs and system.sqfs. I'd prefer a script to create them myself rather than binaries, but that is your choice.
Update2: Played around a bit, generating unmodified
system and initrd sqashfs images on my PC to test the process:
sudo apt install abootimg
git clone https://github.com/ReFirmLabs/binwalk
sudo python3 ./setup.py install
# real stuff
mkdir -p ~/tmp/chromecast
./adb push ~/tmp/loopmount.sh /cache/
binwalk -e ota.159268.stable-channel.eureka-b3.adf9f4e6b7ad7068e5f85dbb375236d5d933031b.zip
# get the system image
binwalk -e system.img
mksquashfs . ~/tmp/chromecast/system.sqfs -all-root
# test system image
sudo mount -t squashfs -o loop ~/tmp/system.sqfs /mnt/
sudo umount /mnt/
# Now get the initrd
binwalk -e boot.img
dd bs=256 skip=1 if=boot.img of=~/tmp/chromecast/aboot.img
abootimg -x aboot.img
xz -d -c ../initrd.img | cpio -i -d -H newc --no-absolute-filenames
mksquashfs . ~/tmp/chromecast/initrd.sqfs -all-root
# test initrd image
sudo mount -t squashfs -o loop initrd.sqfs /mnt/
sudo umount /mnt/
Copied the images to the CC and executed the loopback.sh script. At first run I recognized that the sequence is wrong, as soon as system mount is overloaded, busybox is no longer available. So corrected loopmount.sh looks like:
/chrome/cast_cli stop cast
mkdir -p /initrd
busybox mount -o loop,ro /cache/initrd.sqfs /initrd
busybox mount -o bind /initrd/lib /lib
busybox mount -o bind /initrd/sbin /sbin
busybox mount -o loop,ro /cache/system.sqfs /system
# cp -a /initrd/root/* /. #### this step is optional
Result: CC was still working a minute or so after the script ran, but then the screen turned black and CC was no longer reachable from Google Home app. Shell login (here: adb shell) still was there, so issued a reboot to verify that nothing is broken. After reboot CC came back up successfully so indeed nothing is broken permanently as expected.
So finally I only need your tweaks to the squashfs images for another attempt