How about a ROM DUMP?

Search This thread

Valicore

Senior Member
Feb 21, 2007
184
6
San Jose, California
OK here's the deal. I have enough command line knowledge to get around a command prompt in Windows and a terminal in Linux. I've been playing with the adb and nothing I do on the phone or in the system (that I know how to do) will make adb list it as a device I can issue shell commands to. There is a brightspot - I can open a terminal on the G1 itself and issue commands on it directly. There is however no cp command. dd and mv are there however. Is there anyway to use dd or mv to do the equivalent of copying?
 

beartard

Senior Member
Jun 20, 2008
481
14
Winter Haven, Florida, USA
OK here's the deal. I have enough command line knowledge to get around a command prompt in Windows and a terminal in Linux. I've been playing with the adb and nothing I do on the phone or in the system (that I know how to do) will make adb list it as a device I can issue shell commands to. There is a brightspot - I can open a terminal on the G1 itself and issue commands on it directly. There is however no cp command. dd and mv are there however. Is there anyway to use dd or mv to do the equivalent of copying?
dd is a copy command on a very low level. It would make a raw image of the disk you're copying. It usually just takes the simple:
Code:
dd if=<disk to copy> of=<image name>
where "if" is "input file" (usually a device node like "/dev/sda1") and "of" is "output file" (like "android.img").
 

dzo

Senior Recognized Developer
Apr 3, 2008
2,487
5,086
Auckland
Hi,

I would be keen to have a look at the .apk packages in /system/app, you could copy them to an sdcard by doing this:
Code:
cd /system/app
for i in *.apk; do dd if=$i of=/sdcard/$i; done
pm me if you want any more info.
 
Last edited:

syrusfrost

Senior Member
Nov 10, 2007
94
1
OK here's the deal. I have enough command line knowledge to get around a command prompt in Windows and a terminal in Linux. I've been playing with the adb and nothing I do on the phone or in the system (that I know how to do) will make adb list it as a device I can issue shell commands to. There is a brightspot - I can open a terminal on the G1 itself and issue commands on it directly. There is however no cp command. dd and mv are there however. Is there anyway to use dd or mv to do the equivalent of copying?

YES yes! Alright you're about 2 commands away from dumping our first rom... Hopefully.

In the terminal you open on the phone type:

Code:
~# mount

This will return a listing of all of the mount points on the device. It shows the device that each filesystem is mounted FROM. The root filesystem will be something like /dev/hda or /dev/sda or /dev/***. I haven't had the pleasure so I don't know what you're gonna have there.

I would suggest dumping them all, but hey... do whatever. For each /dev/*** that you want to dump, issue the following command:

Code:
~ # dd if=/dev/*** of=/sdcard/***.g1.dump

At this point you will have some interesting filesystem dumps.

On a normal linux driven system the output of mount might look like:

Code:
~ # mount
/dev/hda3 on / type ext3 (rw,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)
/dev/sdcard on /sdcard type fat (rw,noatime)

If I saw that on my android phone I would then run...

Code:
~ # dd if=/dev/hda3 of=/sdcard/hda3.g1.dump

Now you can transfer this over...

Want to tool around with it a bit prior to uploading it to us?

Fire up any livecd, and transfer the file somewhere into the filesystem... run:

Code:
~ # mkdir /mnt/g1
~ # mount -t [type] /.../hda3.g1.dump /mnt/g1

The [type] will be whatever filesystem type was listed for the g1 when you ran mount on the g1. In my example it was ext3, but I don't know what they're using. The /.../ is where ever you ended up putting the rom.

Ha, and what if they're using a proprietary filesystem? Next we ask you to strip a module from the kernel! Hope that doesn't have to happen.
 
Last edited:

dzo

Senior Recognized Developer
Apr 3, 2008
2,487
5,086
Auckland
Ha, and what if they're using a proprietary filesystem? Next we ask you to strip a module from the kernel! Hope that doesn't have to happen.

It will use yaffs2 so won't mount with most distros, you should be able to mount it in the emulator though.
 

raymondf13

Member
Mar 23, 2008
41
0
YES yes! Alright you're about 2 commands away from dumping our first rom... Hopefully.

In the terminal you open on the phone type:

Code:
~# mount

This will return a listing of all of the mount points on the device. It shows the device that each filesystem is mounted FROM. The root filesystem will be something like /dev/hda or /dev/sda or /dev/***. I haven't had the pleasure so I don't know what you're gonna have there.

I would suggest dumping them all, but hey... do whatever. For each /dev/*** that you want to dump, issue the following command:

Code:
~ # dd if=/dev/*** of=/sdcard/***.g1.dump

At this point you will have some interesting filesystem dumps.

On a normal linux driven system the output of mount might look like:

Code:
~ # mount
/dev/hda3 on / type ext3 (rw,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)
/dev/sdcard on /sdcard type fat (rw,noatime)

If I saw that on my android phone I would then run...

Code:
~ # dd if=/dev/hda3 of=/sdcard/hda3.g1.dump

Now you can transfer this over...

Want to tool around with it a bit prior to uploading it to us?

Fire up any livecd, and transfer the file somewhere into the filesystem... run:

Code:
~ # mkdir /mnt/g1
~ # mount -t [type] /.../hda3.g1.dump /mnt/g1

The [type] will be whatever filesystem type was listed for the g1 when you ran mount on the g1. In my example it was ext3, but I don't know what they're using. The /.../ is where ever you ended up putting the rom.

Ha, and what if they're using a proprietary filesystem? Next we ask you to strip a module from the kernel! Hope that doesn't have to happen.

how do i get to the terminal on the phone??
 

dzo

Senior Recognized Developer
Apr 3, 2008
2,487
5,086
Auckland

piethein

Member
Apr 2, 2007
38
0
There's a simple file manager here:

http://cs-alb-pc3.massey.ac.nz/vogue/Glance.apk

Can you see if you can use it to copy anything from /system to /sdcard. To copy a file press and hold the name and select copy then press and hold on the destination directory and select paste.

Thanks

Today I installed the Android Emulator on my laptop to see how we can solve this problem.

Using the Emulator it's quite easy. Just download the busybox binary to your local machine and upload it to the emulator using the adb commando. The busybox file contains a set of usefull tools which will help us to copy the file system.

To extract the file system from the emulator you need to do this:

download this file http://benno.id.au/android/busybox

Download the SDK and unzip it (download from http://code.google.com/android/download.html )
All the tools you need are located under tools
Create a sdcard rom file using this command (under tools) mksdcard 1024M sdcard1.is
Run the Emulator using this command: emulator.exe -datadir C:\android-sdk\tools\lib\images -sdcard C:\android-sdk\tools\sdcard1.iso

Open a second command prompt and type:
adb.exe shell
# mkdir /data/busybox
# exit


Copy the busybox utility to the android device
adb.exe push c:\android-sdk\downloads\busybox /sdcard/

Install and run the busybox utility
adb.exe shell
# cd /data/busybox
# ./busybox --install
# export PATH=/data/busybox:$PATH


Backup the system directory to the sdcard
# cd /sdcard
# tar -c -f system.tar /system


If you do this you should be able to package the system directory to a tar file.

The only problem is that we need to have shell access on the HTC G1 to do this.

raymondf13,
What will happen if you connect the HTC G1 device with your computer and you fire up the adb command. Is the device listed?


C:\android-sdk\tools>adb.exe devices

List of devices attached
emulator-5554 device

C:\android-sdk\tools>
 
Last edited:

dagentooboy

Senior Member
Feb 16, 2008
544
156
Kansas
If someone finds the drivers and we can connect to the G1 through USB then I think a hacked tether solution is about 2 days from release...
 

raymondf13

Member
Mar 23, 2008
41
0
raymondf13,
What will happen if you connect the HTC G1 device with your computer and you fire up the adb command. Is the device listed?


C:\android-sdk\tools>adb.exe devices

List of devices attached
emulator-5554 device

C:\android-sdk\tools>

To use adb, you must enable USB Debugging in Settings>Applications on the G1.

The device wont list because we need a driver for the USB debugging. The drivers for the SD card access and debugging are not the same.

We pretty much hit a dead end until we can get that driver. Perhaps when the phone actually releases.

Im not saying its impossible at this point so im open to all advice. Please PM me or send me an e-mail.
raymondf13@gmail.com
 

piethein

Member
Apr 2, 2007
38
0
I'm busy with some code; the plan I have is to collect all files and copy them to a backup directory on the sdcard. The code for the backup program I have till now is:
The only thing it does right now is to create a backup directory on the sdcard and put a file "test.txt" there.


package com.android.backup2sdcard;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class Backup2SDCard extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);

try {
new File("/sdcard/backup");
}catch(Exception e) { Log.e("Directory()...Exception", e.toString()); }

try {
// Write test from root file to SD-Card
String file_path=null;
file_path="/text.txt";

//FileInputStream fIn = openFileInput(file_path);
//InputStreamReader isr = new InputStreamReader(fIn);
//char[] inputBuffer = new char[file_path.length()];
//isr.read(inputBuffer);
//String readString = new String(inputBuffer);
//boolean isTheSame = file_path.equals(readString);
//Log.i("File Reading stuff", "success = " + isTheSame);

String file_path_sd=null;
file_path_sd="/sdcard/backup" + file_path;
BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(file_path_sd));
stream.flush();
stream.close();
}catch(Exception e) { Log.e("File()...Exception", e.toString()); }
}
}




All I need to do next is to read all files from the "/" (InputStream) and pass them one by one the to InputStream. If you have some programmings skills and can help please join me!
 
Last edited:

keerttttt

Senior Member
Sep 28, 2007
172
6
Twente
Xiaomi Mi 10
I'm busy with some code; the plan I have is to collect all files and copy them to a backup directory on the sdcard. The code for the backup program I have till now is:
The only thing it does right now is to create a backup directory on the sdcard and put a file "test.txt" there.


package com.android.backup2sdcard;
...


All I need to do next is to read all files from the "/" (InputStream) and pass them one by one the to InputStream. If you have some programmings skills and can help please join me!

If i could, i would in a heartbeat... Good luck! I really want my diamond with the Android OS :p
 

rtanderson2

New member
May 24, 2007
2
0
I've got the Phone in my hands right now as we speak. I'm an employee of T-Mobile and we have been using the G1 for weeks now. I'd be more than happy to provide a ROM dump if someone walks me through how.
 

notacake

Member
Sep 29, 2007
8
0
I'm busy with some code; the plan I have is to collect all files and copy them to a backup directory on the sdcard. The code for the backup program I have till now is:
The only thing it does right now is to create a backup directory on the sdcard and put a file "test.txt" there.

(snip)

All I need to do next is to read all files from the "/" (InputStream) and pass them one by one the to InputStream. If you have some programmings skills and can help please join me!

Made any progress with your code? I'm downloading the Android SDK now, so I'll try and get it working in that. No promises though, my Java is a little rusty :p
 

keerttttt

Senior Member
Sep 28, 2007
172
6
Twente
Xiaomi Mi 10
I've got the Phone in my hands right now as we speak. I'm an employee of T-Mobile and we have been using the G1 for weeks now. I'd be more than happy to provide a ROM dump if someone walks me through how.
Thanks in advance for your efforts, to get a rom dump we most likely need to make a serial connection from your pc with your phone. Read the pages (there are only 4 pages) in this topic and try to get a connection in order to run commands.

The alternative is the java code ppl are writing right now, hopefully you can put that code on a SD Card and run that to back it up in the near future.

Please follow this thread, testers are always welcome and the faster a rom dump get's available the better!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    I felt a necro of this thread was appropriate for the 5th anniversary of the G1 (Dream). Just think of what you get for $399 these days...

    HTC G1 vs LG Nexus 5

    HAPPY 5TH BIRTHDAY G1 !

    Oddly enough the feature missing from a "Google phone" after all these years is expandable storage. :rolleyes:

    Please read this entire thread, it is pretty entertaining to see the beginnings of ROM dumps and such.
    1
    isn't the 5th cache?

    There are 6.
    mtd0 - misc (the bootloader)
    mtd1 - recovery
    mtd2 - boot
    mtd3 - system
    mtd4 - cache
    mtd5 - userdata

    There's actually a radio image too, but I don't know anything about it, other than it's handled differently than the 6 partition above.


    The zip file for the RC29 update has an image file for recovery and boot, plus the entire contents of the system folder. The cache and userdata partitions aren't "critical", in the sense that you can wipe them and the phone will still boot up and function. (I think :))