Custom kernel and initramfs in SDE... to gain rooted android in my Archos 70 Internet

Search This thread

dogmaphobia

Member
Aug 22, 2007
5
2
So I've finally kind of figured out several files in partition mmcblk0p1. Files named custom, init, and recovery are actually kernel and initramfs packed with 256 header. Information at offset 0x94 is length of kernel + header (256 bytes) and offset 0x98 is length of initramfs. Except of file init, contain additional size which I'm not actually understood.

By extracting init file, and modifying extracted initramfs, I can boot to android system with rooted state.
I've experimenting using unionfs got from somewhere in this forum and added files su and superuser.apk. I've added in init file inside initramfs.

Actually analyzing recovery files, we can get information regarding recovery program which mostly in bash script.

I've include my kernel and initramfs extracted from file init in mmcblk0p1. You can try for yourself only in Developer Edition, where you can flash your own kernel and initramfs.
Beware, I don't guarantee it will succeed... try for yourself :D

*Sorry, bad english...
 

Attachments

  • kernel+init.zip
    2.9 MB · Views: 6,237

$aur0n

Senior Member
Nov 27, 2010
1,461
509
Hi,

Is it not pointless to work on this squashfs, when we can use plain file/device partition on SDE (like Angstrom demo)? I guess (it's still theory - since I've just installed SDE) it's enough to create rootfs with copied everything from squashfs and /data - to make it fully writeable and rootable - and boot on it as /.
I'll give it a try later...
 

MoonPhantasm

Senior Member
Dec 1, 2010
78
5
No methods are pointless. Stop saying that. It's a progress to what we can do with the device. :p

Anyway, were you able to make that root work on the main OS, dogma?
 

$aur0n

Senior Member
Nov 27, 2010
1,461
509
No methods are pointless. Stop saying that. It's a progress to what we can do with the device. :p
Ehh ok - but it makes thinks complicated, while we should straight everything up - to make upgrading smooth and easy :)

Anyway, were you able to make that root work on the main OS, dogma?
As far as I can see in files - it should work.
Here's a diff of those init files (what was added)
out# diff init init.old
53,54d52
< CP=/bin/cp
< CHMOD=/bin/chmod
122,130d119
<
< # Create tempfs on /rootfs/home and unionfs with /rootfs/system
< $MOUNT -t tmpfs tmpfs $rootfs_path/home
< $INSMOD /lib/modules/unionfs.ko
< $MOUNT -t unionfs -o dirs=$rootfs_path/home=rw:$rootfs_path/system=ro unionfs $rootfs_path/system
< $CP /home/su $rootfs_path/system/bin/
< $CP /home/superuser.apk $rootfs_path/system/app/
< $CHMOD 6755 $rootfs_path/system/bin/su
< $CHMOD 755 $rootfs_path/system/app/superuser.apk

Booting from normal ext3 device requires some more changes - but gives us no 300MB (or similar) limit, allows to change boot parameters after kernel boots up (now on squashfs partition) etc. etc.
 
  • Like
Reactions: MoonPhantasm

Darkseider

Senior Member
Jun 15, 2010
132
26
I am very excited about the prospects with SDE. Hopefully with some more poking and prodding and with Archos Froyo source released we will see some nice custom ROMs coming down w/ full root and a re-mapped file system in the coming months. I for one am hopeful that the dev community embraces the Gen8's w/ SDE and bakes up a nice serving of Gingerbread! :D
 

dogmaphobia

Member
Aug 22, 2007
5
2
I was thinking that in recovery there's tool to flash initramfs and kernel which formed in file custom in mmcblk0p1. If we can replace destination to init (not custom). I think we can force booting to our new change, without entering to recovery mode first.

But, I still don't want to break anything in partition mmcblk0p1 :D.

Also, if we can modifying squashfs file with new one, without script checking the file (I think is on cramfschecker program); we can have custom rootfs itself replacing androidmerged.squashfs.secure....

Just the thought...
 

chrulri

Senior Member
Dec 7, 2010
895
275
just copied the content of the squashfs in an ext3 image and modified the init and mountpoints.

will report later after some testing
 

$aur0n

Senior Member
Nov 27, 2010
1,461
509
Heh.. I've just did the same - but on ext3 partition of sd card. Not luck yet to full boot... yet... :D
 

chrulri

Senior Member
Dec 7, 2010
895
275
me neither. don't have time for more testing today and tomorrow, but soon I have a lot of spare time :D

edit: currently running kernel and initramfs of dogmaphobia, works great so far
 
Last edited:

nimrodity

Senior Member
Sep 9, 2008
4,398
1,192
www.thedroideffect.com
its too bad i am too dumb to understand all of what you are saying.
Does this mean rhe archos can be booted with root?
is it then rooted on the normal android firmware i use at the moment or on something else?
If yes how exactly do i get this to work and will there be a easier version for people like me who dont know that much about that kind of things.
and sorry again if my questions are dumb,i just want to try to get it.
 

$aur0n

Senior Member
Nov 27, 2010
1,461
509
Does this mean rhe archos can be booted with root?
Yes - but with SDE installed (and voided warranty - unless Archos claims so)

is it then rooted on the normal android firmware i use at the moment or on something else?
We are trying to boot oryginal Archos-Android on writtable disk (then it will be fully rooted - on OS level at least). dogmaphobia prepared initrd (first stage boot - lets say) that mounts part of original dir tree as RW and installs SU (switch to root) tool.

If yes how exactly do i get this to work and will there be a easier version for people like me who dont know that much about that kind of things.
Probably yes, this one is not so hard either - but it's really just a first step, so I recommend to wait.
 

Uejji

Senior Member
Feb 1, 2009
134
101
This is freaking awesome. Since 2.0.71 disabled temproot I haven't been using my 101 very much other than poking around in Angstrom.

I voided the warranty on every other Android device I own for root, and I sure don't mind doing it on my 101 either.
 

nimrodity

Senior Member
Sep 9, 2008
4,398
1,192
www.thedroideffect.com
@$aur0n
thx for the explanation.
Since i am please ight now ho the archos works,i ca wait a while till something new comes up.
so no hurry,we all saw how achos handled that with an unfinished bugged fimware
 

nickwarn

Senior Member
Aug 4, 2010
2,736
580
Ronneby
this is great news, im so looking forward to the future with a fully rooted device. And all the benefits that comes with that,maybe some custom roms maybe even cyanogen mod, A2SD, custom kernels and Gingerbread. If this comes thru it blows this wide open. Keep up the good work
 

chrulri

Senior Member
Dec 7, 2010
895
275
@dogmaphobia you've written kernel size was at 0x94 and initramfs size at 0x98 but I don't get it. 2byte value (db70) at 0x94 results in 56176 and (db700021) ist far too much for kernel size. same weird result for initramfs.

how did you extract initramfs and kernel from this mmcblk0p1/init file? may post a shell script?
 

$aur0n

Senior Member
Nov 27, 2010
1,461
509
I've checked my "custom" file - on pos. 94 i have unsigned 32bit (8 bits) value "2218864" - witch might be ok, since 2218864-256=2218608 - and that's exactly the size of kernel that dogmaphobia send (and it's bootable).

On pos. 98 I have value "833767" (8 bit stream like before) - that's look also quite ok.

ps. and you should be able to extract it with dd (dd if=custom of=whatever bs=1 skip=245 count=2218608) - it's slow with bs=1 but... ;)
 
Last edited:

Unmensch

Member
Dec 7, 2010
37
3
Heym I mounted the rootfs.img as loop, put the two files from dogmaphobia in /boot and copied the image back to internal memory, but wasn't able to boot from this image. Any tips?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    Hey dogmaphobia

    Next firmware has been release, so here is the updated version:
    avos_2.1.02_temproot.zip

    Have fun :cool:
    2
    So I've finally kind of figured out several files in partition mmcblk0p1. Files named custom, init, and recovery are actually kernel and initramfs packed with 256 header. Information at offset 0x94 is length of kernel + header (256 bytes) and offset 0x98 is length of initramfs. Except of file init, contain additional size which I'm not actually understood.

    By extracting init file, and modifying extracted initramfs, I can boot to android system with rooted state.
    I've experimenting using unionfs got from somewhere in this forum and added files su and superuser.apk. I've added in init file inside initramfs.

    Actually analyzing recovery files, we can get information regarding recovery program which mostly in bash script.

    I've include my kernel and initramfs extracted from file init in mmcblk0p1. You can try for yourself only in Developer Edition, where you can flash your own kernel and initramfs.
    Beware, I don't guarantee it will succeed... try for yourself :D

    *Sorry, bad english...
    2
    I really look forward to see some tutorial/script on this SDE booted/permanently rooted Archos firmware.

    It's certainly not a howto - but just few steps that can reproduce (without try and error fun ;) ) what I've did. Of course you do it on your own risk - but it requires a lot of skills to really damage device (it's quite bullet proof) so it's quite safe :D
    This are steps for 2.0.45 Archos Android version With newer one this steps will also work, but it will require modified original initramfs for 2.0.71+.
    - format SDHC card with single ext3 partition (Linux: fdisk and mkfs.ext3)
    - copy ALL data from squashfs Archos disk (atached)
    - copy "su" to /system/bin/, chmod 6755 /system/bin/su (atached)
    - copy superuser.apk to /system/app/, chmod 755 /system/app/superuser.apk
    - flash (kernel+init.rar) from SDE boot menu (reboot, hold up or down volume key), choose "Recovery System"->"Developer Edition Menu"->"Flash Kernel and Initramfs"
    - reboot and hold up or down volume
    - choose "Developer Edition"
    and it should boot with root access. It's going to be slow during first boot....
    Now you should copy /data to your SD card. Get terminal emulator (or ssh daemon) and from shell on Archos
    Code:
    su
    mkdir /data.new
    cd /data
    cp -rp * /data.new/
    poweroff device, and move card to computer. Move /data to /data.old, move /data.new to /data. Edit /init.rc file and change
    Code:
    from
    mount ext3 /dev/block/mmcblk0p4 /data noatime nosuid
    to
    mount ext3 /dev/block/mmcblk0p4 /data.old noatime nosuid

    your done.

    Things to do:
    - more clean up in initramfs (it's quite messy)
    - something to make ext3 partition faster (it's too slow now)
    - automounting daemon on Android claims SD card is unusable (it's just a bit annoying - nothing more)


    Files:
    All files in one
    or separate archives
    Content of rootfs (suqashfs)
    Kernel+initramfs
    su+superuser.apk
    2
    @computerfreek
    here you go: [HOWTO] Root easily your Gen8 device (fw 2.1.02) (including mirror links)
    2
    I wanted to know whether you have any issues with your config. ;-) i know that you arent using what ardatdat created.

    Well yes it was "sluggish" on ext3 from sdcard - that's why I wanted so badly ext4/btrfs.
    I have best results with this conf.:
    * ext4 filesystem,
    * with swap memory (at least 50MB) (so kernel can swap some rarely used stuff),
    * ondemand cpu governor with max cpu freq. set to 1Ghz,
    * Zeam launcher
    * removed some app from /system/app (google voice, archos stuff) - they are loaded every time to memory

    Now I'm trying to make it work everytime (there are some problems :p) - that's why I'm not updating howto.