Firefly Open Source Community

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

Making "snapshot"

5

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
5

Making "snapshot"

Posted at 11/19/2014 23:55:41      View:14814 | Replies:23        Print      Only Author   [Copy Link] 1#
I've installed you t-firefly ubuntu and have configured it. Is there a way to make my own image of device (boot, kernel, fs ...) as a backup for "may be" situation of system failure?
Reply

Use props Report

403

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
403
Posted at 11/20/2014 09:18:10        Only Author  2#

This is a brief document about this packing process.


1. Copy following files to your packing directory.

a. Control files
- ATTACHMENT/package-file (describes package content of update.img)
- ATTACHMENT/parameter (parameter for Ubuntu, contains eMMC partition info)
- ATTACHMENT/update-script (not used for Linux, for completion only)
- ATTACHMENT/recovery-script (not used for Linux, for completion only)
- ATTACHMENT/misc-zero.img (boot command, zero will lead to normal boot)

b. RKTools
- RKTools/linux/Linux_Upgrade_Tool_v1.2/rockdev/afptool (RK firmware packing tools)
- RKTools/linux/Linux_Upgrade_Tool_v1.2/rockdev/rkImageMaker (RK image maker)

c. Bootloader and your images
- SDK/RKTools/bootloader/uboot-emmc/RK3288Loader_uboot_V2.17.02.bin, renamed to RKLoader.bin
- Your linux-rootfs.img (ext4 filesystem image, for Linux root)
- Your linux-boot.img (See wiki doc http://wiki.t-firefly.com/index.php/Fir ... _kernel/en to create your own)
- Your resource.img (In SDK/kernel, after successful kernel compilation)

2. do the packing
First, cd to your packing directory. Then run the following commands:

./afptool -pack ./ update_tmp.img
./rkImageMaker -RK32 RKLoader.bin update_tmp.img update.img -os_type:androidos
rm -f update_tmp.img

Now, your update.img is ready to serve.

rk-pack-linux-control-files.zip (1.99 KB, Down times: 12)
Reply

Use props Report

175

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
175
Posted at 12/30/2014 09:10:31        Only Author  3#

Hello busybee,




Thank you , it is working now. great script.




Best regards
Reply

Use props Report

403

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
403
Posted at 12/29/2014 10:18:24        Only Author  4#

Annoying forum attachment which won't accept *.txt, *.sh, except .zip file.




Please uncompress the zip file first.
Reply

Use props Report

175

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
175
Posted at 12/27/2014 04:11:08        Only Author  5#

Hello busybee,




Assume I will be obliged to use the dualboot image in order to overcome the issue of backup.

How can I have the linuxroot partition size as large as 8Gbytes? I tried to look on ways to enlarge it with no luck.

If I can do that then I guess my issue of backing and restoring the partitions will be straight forward.


Reply

Use props Report

175

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
175
Posted at 12/26/2014 18:46:44        Only Author  6#

Hello busybee,




Thank you for the prompt reply, could you please attach the script file ? you missed to attach it to your post.

And where from to get linux-rootfs-ubuntu-14.04.img ?
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  7#

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  8#




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

403

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
403
Posted at 12/24/2014 14:33:13        Only Author  9#
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/24/2014 02:09:43        Only Author  10#

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

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