Root filesystem image.

Search This thread

zelch

Member
Nov 14, 2010
40
2
Alright, so the root filesystem image is in /mnt/system/androidmerged.squashfs.secure

So do a temp root, copy to /mnt/storage, and then a adb pull gets it over.

The squashfs itself is offset by 256 bytes, so:

losetup -o 256 /dev/loop0 ./androidmerged.squashfs.secure

At this point, the FS can be mounted or unsquashfs can be used to extract it.

So, what's the first 256 bytes? The secure implies some type of signature, but what kind, and what else is in all those bytes?

I'm not feeling brave enough to try just grabbing the first 256 bytes and appending a modified squashfs image to it on my device just yet, but if others try please report back. (On both if it works, and if not what it takes to recover the unit.)
 

chrulri

Senior Member
Dec 7, 2010
895
275
how big is it? can you upload it somewhere? (or would this be illegal?)

damm.. i need my 101! :rolleyes:
 

chrulri

Senior Member
Dec 7, 2010
895
275
how would you replace the root fs image on the device?
 
Last edited:

zelch

Member
Nov 14, 2010
40
2
how would you replace the root fs image on the device?

Connect via ADB, do a temproot, put the file in /mnt/storage, then copy it into /mnt/system overwriting the existing file. /mnt/storage is an ext3 filesystem mounted read/write, however I simply do not know if it will be possible to recover the unit if there is some kind of signature verification and we fail due to a modified image.

Again, someone braver then I should make this attempt and let us know how it goes. ;)

The source did not give all that many hints, but I need to dig through in some more detail.
 

krohnjw

Inactive Recognized Developer
Jul 17, 2007
1,987
534
Plainfield
Connect via ADB, do a temproot, put the file in /mnt/storage, then copy it into /mnt/system overwriting the existing file. /mnt/storage is an ext3 filesystem mounted read/write, however I simply do not know if it will be possible to recover the unit if there is some kind of signature verification and we fail due to a modified image.

Again, someone braver then I should make this attempt and let us know how it goes. ;)

The source did not give all that many hints, but I need to dig through in some more detail.

If the unit will still boot to recovery could a full wipe and reinstall of the base AOS over USB get it back up and running?
 

L0$t$0ul

Member
Jun 28, 2010
48
6
You can do a full system wipe/format from recovery. it's not in any damageable storage by us without flashing a new recovery image.

Interesting about the front 256 bytes. It must be a signature. Not sure what good rebuilding the squashfs will do as it'll still be read only but it's a start. We could at least update the system properly and install the appropriate apps. Maybe in make some of the system dirs symlinks to writable locations possibly.
 

zelch

Member
Nov 14, 2010
40
2
Permroot, giving us a filesystem mounted RW and not no-suid.

Ideally, I'd like to have decent support for the internal storage being ext3 without nosuid, but first we need to be able to replace the root filesystem image.

Other notes..

Looking at the hexdumps, the 256 byte chunk does not contain the start of the md5, sha1, sha224, sha256, sha384, or sha512 checksums.

The most troubling option which comes to mind is that it is the right size for a RSA 2048 bit block, hopefully not.

Anyone have ideas on how to find the initramfs image that the bootloader is feeding the kernel?

For that matter, has anyone tried taking apart the OS update images?
 

zelch

Member
Nov 14, 2010
40
2
Agreed.

It looks like usr/bin/abcbox in the root filesystem has something to do with the update process.

And it definitely is!

On a rooted device:

Code:
/usr/bin # PATH=$PATH:/tmp
/usr/bin # ln -s /usr/bin/abcbox /tmp/cramfschecker
/usr/bin # cramfschecker
USAGE: cramfschecker FILENAME
/usr/bin # cramfschecker /mnt/system/androidmerged.squashfs.secure
cramfschecker : check against 2.0.54

cramfschecker verification OK

Anyone with some ARM disassembly skills feeling up to taking abcbox apart to see how it's doing the signature check?
 

zelch

Member
Nov 14, 2010
40
2
And so I've been digging into this, and it turns out that this is really quite similar to how the Gen 7 Archos 5 IT is locked.

The signature there is a RSA + MD5 signature, which is really the worst case as that means a 2048 bit RSA key, so we're kinda screwed there.

http://strazzere.com/blog/?p=320 has a good description of the situation on the 5IT. Getting a flash_unlock binary should be fairly trivial, so perhaps we can tamper with the key store to add additional keys.
 

chrulri

Senior Member
Dec 7, 2010
895
275
ah zelch, this is good stuff.

i'm gonna diff the archos gpl kernel, looking for changes at mtd stuff. maybe we can build a kernel module which enables r/w access to stage1

edit: or do we already have r/w access?
 

Hexidecimal

Senior Member
Sep 18, 2010
55
2
Pittsburgh
This stuff is all pretty interesting to read, but if I'm reading this correctly (and it is entirely possible I'm not) it looks kind of like this device is going to be a total pain in the ass to root, and it may take a considerable amount of time for us to get there.

Can someone who is more knowledgeable on this sort of thing verify that? Thanks for all your hard work guys. It's appreciated.
 

chrulri

Senior Member
Dec 7, 2010
895
275
its definitly not going to be that easy as other android devices were :( but would it be so interesting if it wouldn't be so hard to root? :D
 

Hexidecimal

Senior Member
Sep 18, 2010
55
2
Pittsburgh
While that's true, it will make it a bigger triumph when it is finally rooted, the tinkerer in me is dying to mess with roms on this device and see what it can really do once it's cracked open. Keep up the great work guys, I'm following with baited breath. :)
 

zelch

Member
Nov 14, 2010
40
2
Write to stage1 appears to exist, and indeed looking at /proc/mounts /mnt/rawfs is mounted rw. Looking at the kernel source, write support should Just Work.

So, looking through /mnt/rawfs avboot is clearly the boot loader which verifies stuff, but we lack source for it.

I have absolutely no knowledge of ARM asm, and screwing this up will absolutely brick your device, quite possibly beyond repair. (And I wouldn't bet on ArchOS being willing to replace it either, I sure wouldn't.)

So, anyone with the right background willing to step in here? :)

I'll keep digging, perhaps we can still find the answers.

Note: avboot has some strings which reference a development kernel, this bears some additional hunting.
 

chrulri

Senior Member
Dec 7, 2010
895
275
I still haven't got my A101, but its finally on its way to my home.
can you please upload these files and give me kind of a tree of the folder structure? :cool:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    And so I've been digging into this, and it turns out that this is really quite similar to how the Gen 7 Archos 5 IT is locked.

    The signature there is a RSA + MD5 signature, which is really the worst case as that means a 2048 bit RSA key, so we're kinda screwed there.

    ... has a good description of the situation on the 5IT. Getting a flash_unlock binary should be fairly trivial, so perhaps we can tamper with the key store to add additional keys.

    just a note of caution, if you write a bad key store or a bad bootloader, you will brick this device permanently. I would advice you to wait for the gen8 "SDE" release that will allow you to run your own kernel and userspace without risk of bricking. SDE should be out in a few days.
    1
    If I'm mistaken please let me know but the SDE looks like the environment that lets you install Angstrom linux. How will that be helpful in loading a rooted android image onto the device? Will it give us the ability to see the encryption on these flash chips so we can build new ROMs without fear of bricking? Just curious. Thanks!

    SDE lets you install a kernel and a user space file system. Angstrom is just a demo, it is not limited to angstrom.
    1
    Thank you _nz_, the information about the coming SDE is quite helpful.

    Are you able to answer specific questions regarding as of yet unreleased firmware, or does ArchOS require that everything come via official press releases?

    Thank you.

    I will not answer questions about unreleased firmwares
    1
    some informations about SDE (for gen7): http://archos.g3nius.org/index.php?...cial_Developer_Edition_firmware_means_to_you?

    so we have to wait for gen8 SDE to make some big steps forward

    @nz excuse me for asking you this kind of "unfriendly" question: does "in a few days" mean within next (two) week(s) or before new year or next year? it would make it a lot easier for me to plan my vacations ;)

    I was told it should get out on monday
    1
    I guess we'll lose access to DRM contents though, which is fortunately not something I care about.

    can't we just backup DRM and restore it later manually as these sectors are only locked in SDE mode?