Backup

From Openmoko

Revision as of 01:26, 21 July 2008 by Wolfmanjm (Talk | contribs)

Jump to: navigation, search

You will need the Dfu-util to make a backup of your existing image.

As when flashing, you will need to be in U-Boot in the NOR Flash.

THIS WILL TAKE AWHILE. The rootfs will take significantly longer than the kernel.

./dfu-util -a kernel -R -U good-kernel.bin
./dfu-util -a rootfs -R -U good-rootfs.jffs2

Here is what my successful output looked like...

on the host PC:

$ sudo ./dfu-util -a kernel -R -U good-kernel.img
dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Opening USB Device 0x0000:0x0000...
Claiming USB DFU Runtime Interface...
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request...
Resetting USB...
Opening USB Device...
Found Runtime: [0x1d50:0x5119] devnum=12, cfg=0, intf=0, alt=3, name="kernel"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x1000
Resetting USB to switch back to runtime mode
$ sudo ./dfu-util -a rootfs -R -U good-rootfs.jffs2
dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Opening USB Device 0x0000:0x0000...
Found Runtime: [0x1d50:0x5119] devnum=16, cfg=0, intf=0, alt=6, name="rootfs"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuERROR, status = 14
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x1000
Resetting USB to switch back to runtime mode

Despite the fact that there was a device status with state=dfuERROR, everything seems to have worked.

on the FreeRunner:

DFU: Switching to DFU Mode
DEVICE_CONFIGURED: 1
Starting DFU Upload of partition 'kernel'
DEVICE_CONFIGURED: 1
Starting DFU Upload of partition 'rootfs'

I could backup the kernel of my GTA02 but trying to use this method to backup the rootfs failed several times....

dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Opening USB Device 0x0000:0x0000...
Claiming USB DFU Runtime Interface... 
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request...
Resetting USB... 
Opening USB Device...
Found Runtime: [0x1d50:0x5119] devnum=20, cfg=0, intf=0, alt=6, name="rootfs"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x1000
dfu_upload error -110

In demsg I get this error

usb 5-2: usbfs: USBDEVFS_CONTROL failed cmd dfu-util rqt 161 rq 2 len 4096 ret -110

I have not been able to backup rootfs using this method.

Personal tools

You will need the Dfu-util to make a backup of your existing image.

As when flashing, you will need to be in U-Boot in the NOR Flash.

THIS WILL TAKE AWHILE. The rootfs will take significantly longer than the kernel.

./dfu-util -a kernel -R -U good-kernel.bin
./dfu-util -a rootfs -R -U good-rootfs.jffs2

Here is what my successful output looked like...

on the host PC:

$ sudo ./dfu-util -a kernel -R -U good-kernel.img
dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Opening USB Device 0x0000:0x0000...
Claiming USB DFU Runtime Interface...
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request...
Resetting USB...
Opening USB Device...
Found Runtime: [0x1d50:0x5119] devnum=12, cfg=0, intf=0, alt=3, name="kernel"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x1000
Resetting USB to switch back to runtime mode
$ sudo ./dfu-util -a rootfs -R -U good-rootfs.jffs2
dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Opening USB Device 0x0000:0x0000...
Found Runtime: [0x1d50:0x5119] devnum=16, cfg=0, intf=0, alt=6, name="rootfs"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuERROR, status = 14
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x1000
Resetting USB to switch back to runtime mode

Despite the fact that there was a device status with state=dfuERROR, everything seems to have worked.

on the FreeRunner:

DFU: Switching to DFU Mode
DEVICE_CONFIGURED: 1
Starting DFU Upload of partition 'kernel'
DEVICE_CONFIGURED: 1
Starting DFU Upload of partition 'rootfs'

I could backup the kernel of my GTA02 but trying to use this method to backup the rootfs failed several times....

dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Opening USB Device 0x0000:0x0000...
Claiming USB DFU Runtime Interface... 
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request...
Resetting USB... 
Opening USB Device...
Found Runtime: [0x1d50:0x5119] devnum=20, cfg=0, intf=0, alt=6, name="rootfs"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x1000
dfu_upload error -110

In demsg I get this error

usb 5-2: usbfs: USBDEVFS_CONTROL failed cmd dfu-util rqt 161 rq 2 len 4096 ret -110

I have not been able to backup rootfs using this method.