Firefly Open Source Community

   Login   |   Register   |
New_Topic
123
New Topic
Print Previous Topic Next Topic

Making "snapshot"

175

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
175
Posted at 12/21/2014 06:24:50        Only Author  11#

Hello busybee,

Thank you for the instructions.

The results of sudo du -hxs / is 3.2G

I am stuck a the following point : $ sudo mount -o loop new_ubuntu.img /mnt/new

Getting error ?mount: block device /media/firefly/sd31g/new_ubuntu.img is write-protected, mounting read-only
mount: you must specify the filesystem type


The sd card was formatted as file system type=fat32




could you please advice if the command is correct?


Reply

Use props Report

175

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
175
Posted at 12/22/2014 08:07:59        Only Author  12#

Hello,

I was able to make the rkflashkit see my device, I can see the following partitions:

resource, boot, misc, backup

I did backup all of them, but re-flashing them to the other board did not seem to make it identical. actually nothing has changed at all.


Reply

Use props Report

403

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
403
Posted at 12/22/2014 11:07:02        Only Author  13#

Hi tedd77, I've revised the instructions a bit. Please do a mkfs.ext4 before mounting it.


Afer the loop mount, please use a "df -h" command to see if the free space is big enough to hold your Linux rootfs files.


It's best to use rkflashkit to backup in your case.


Here's my output of rkflashkit:

-----------------------8<-------------------8<--------------------------

$ sudo rkflashkit part
Found devices:
0x2207:0x320a

============= 2014-12-22 11:03:55 ============


Loading partition information

PARMxFIRMWARE_VER:4.4.2
MACHINE_MODEL:rk30sdk
MACHINE_ID:007
MANUFACTURER:RK30SDK
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 3066
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
#KERNEL_IMG: 0x62008000
#FDT_NAME: rk-kernel.dtb
#RECOVER_KEY: 1,1,0,20,0
CMDLINE:console=ttyFIQ0 androidboot.hardware=rk30board androidboot.console=ttyFIQ0 board.ap_has_alsa=0 root=/dev/block/mtd/by-name/linuxroot rw rootfstype=ext4 init=/sbin/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00002000@0x00004000(misc),0x00008000@0x00006000(resource),0x00008000@0x0000e000(kernel),0x00010000@0x00016000(boot),0x00010000@0x00026000(recovery),0x0001a000@0x00036000(backup),0x00040000@0x00050000(cache),0x00002000@0x00090000(kpanic),0x00180000@0x00092000(system),0x00002000@0x00212000(metadata),0x00200000@0x00214000(userdata),0x00620000@0x00414000(linuxroot),-@0x00a34000(user)

Partitions:
uboot        (0x00002000 @ 0x00002000)    4 MiB
misc         (0x00002000 @ 0x00004000)    4 MiB
resource     (0x00008000 @ 0x00006000)   16 MiB
kernel       (0x00008000 @ 0x0000e000)   16 MiB
boot         (0x00010000 @ 0x00016000)   32 MiB
recovery     (0x00010000 @ 0x00026000)   32 MiB
backup       (0x0001a000 @ 0x00036000)   52 MiB
cache        (0x00040000 @ 0x00050000)  128 MiB
kpanic       (0x00002000 @ 0x00090000)    4 MiB
system       (0x00180000 @ 0x00092000)  768 MiB
metadata     (0x00002000 @ 0x00212000)    4 MiB
userdata     (0x00200000 @ 0x00214000) 1024 MiB
linuxroot    (0x00620000 @ 0x00414000) 3136 MiB

-----------------------8<-------------------8<--------------------------


You can see the linuxroot partition above, right ? Then you can backup it by issueing command:


    $ sudo rkflashkit backup @linuxroot  mylinuxroot.img

Reply

Use props Report

175

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
175
Posted at 12/22/2014 17:17:53        Only Author  14#

hello busybee,


thank you, I will try again to do the image using your method.

as for the rkflashkit the only partitions I can see are resource, boot, misc, and backup.

============= 2014-12-22 10:11:54 ============


    Loading partition information

    PARM FIRMWARE_VER:4.4.2
    MACHINE_MODEL:rk30sdk
    MACHINE_ID:007
    MANUFACTURER:RK30SDK
    MAGIC: 0x5041524B
    ATAG: 0x60000800
    MACHINE: 3066
    CHECK_MASK: 0x80
    PWR_HLD: 0,0,A,0,1
    #KERNEL_IMG: 0x62008000
    #FDT_NAME: rk-kernel.dtb
    #RECOVER_KEY: 1,1,0,20,0
    CMDLINE:console=ttyFIQ0,115200 root=/dev/block/mtd/by-name/linuxroot rw rootfstype=ext4 init=/sbin/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00008000@0x00002000(resource),0x00008000@0x0000A000(boot),0x00002000@0x00012000(misc),0x0001a000@0x00014000(backup),-@0x0002e000(linuxroot)

Partitions:
resource     (0x00008000 @ 0x00002000)   16 MiB
boot         (0x00008000 @ 0x0000a000)   16 MiB
misc         (0x00002000 @ 0x00012000)    4 MiB
backup       (0x0001a000 @ 0x00014000)   52 MiB

-----------------------

Although the linuxroot is stated in the CMDLINE however I cannot see in the form of a partition in order to be able to backup.


I am using the rkflashkit present under the git clone https://github.com/linuxerwang/rkflashkit

Best regards

Reply

Use props Report

175

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
175
Posted at 12/23/2014 01:07:14        Only Author  15#

hello busybee,




I did the image as per your instructions, when trying to flash with androidtool I get loading firmware failed.

Unless there is another tool to flash back to the board the image we created it not suitable .




I hope my experience will benefit other members.

Please look into it and advise with proper remedie.


Reply

Use props Report

403

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
403
Posted at 12/23/2014 09:41:26        Only Author  16#

Woud you please post the AndroidTool snapshot with failure message?




I personally like to flash individual image with rkflashkit:




sudo rkflashkit flash @linuxroot ?your_linux_root.img




or launch its friendly GUI:

sudo rkflashkit

select the partition and image file and flash.


Reply

Use props Report

175

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
175
Posted at 12/24/2014 02:09:43        Only Author  17#

Hello busybee,




Please find attached the screenshots, as I mentionned in an earlier post I do not see all partitions.

1. Screeshot of the error for the command sudo rkflashkit @linuxroot my_image_path_and_name

2. the sudo rkflashkit part





Reply

Use props Report

403

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
403
Posted at 12/24/2014 14:33:13        Only Author  18#
Ahha, you're using the pure Ubuntu firmware. That's the reason you don't have the system partitiion etc.

The correctly flash command is (fixed in my previous post):

sudo rkflashkit flash @linuxroot your_linux_root.img

and you can get the usage by:

rkflashkit help


Reply

Use props Report

175

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
175
Posted at 12/25/2014 09:41:30        Only Author  19#

Hello busybee,




Attached is the screenshot, yet the command is producing errors.

Yes I am using the ubuntu image only on my firefly board.

The linuxroot is still not recognized.


Reply

Use props Report

403

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
403
Posted at 12/26/2014 16:02:40        Only Author  20#




Sorry, tedd77, I though it just worked, but it didn't.

Especially I've been using rkflashkit and never met your problem.

I did not notice your linuxroot partition is special, in that the size is ommited ('-'), which means to use rest of the storage.

(I spent most of my time in dual firmware.)




But rkflashkit already has the solution, you can specify "SIZE@OFFSET(PART)" instead of "@PART", like:

sudo rkflashkit flash 0x202000@0x0002e000(linuxroot) linux-rootfs-ubuntu-14.04.img reboot




The size and offset are both using units of sector (512 bytes).

Since it is error-proned, I write a script named "flash-linux-root" to do this.

Please save the attachment file "flash-linux-root.txt" as "flash-linux-root.sh", and do a chmod before use:

chmod 755 flash-linux-root.sh




Then run it:

./flash-linux-root.sh /path/to/your/linux-rootfs-ubuntu-14.04.img 0x0002e000




This is my output of running this:

$ ~/flash-linux-root.sh linux-rootfs-ubuntu-14.04.img 0x0002e000
About to run:
sudo rkflashkit flash 0x202000@0x0002e000(linuxroot) linux-rootfs-ubuntu-14.04.img reboot
Press enter to continue...
Found devices:
0x2207:0x320a
[('202000', '0x0002e000')]
============= 2014-12-26 15:49:17 ============

Writing file linux-rootfs-ubuntu-14.04.img to partition 0x00202000@0x0002E000
writing flash memory at offset 0x0002e000
.....




Hope it finally helps. Thanks.





Reply

Use props Report

Return to List
123
You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list