Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

Tip: DualBOOT Android 4.4.2 (8GB) + Linux (12GB) - parameter file

138

Credits

20

Prestige

18

Contribution

registered members

Rank: 2

Credits
138

Tip: DualBOOT Android 4.4.2 (8GB) + Linux (12GB) - parameter file

Posted at 7/21/2015 09:06:12      View:7388 | Replies:7        Print      Only Author   [Copy Link] 1#
Last edited by deep In 7/25/2015 20:57 Editor

Basically I start the thread as a help, but after tries and calculations I'm proud to make simple HowTo with parameter file settings and values calculations!

Device: UGOOS-UT3 4 GB RAM 32 GB NAND/ROM RK3288
Goal: To make user adjustable parameter for providing DualBOOT device in my case Android OS sitting on 8 GB partition size and Linux (xUbuntu in my case) with 12 GB space and providing the rest of the space for user (Android) partition (rest of NAND)

-= Basic image explanation and how to calculate SIZE and OFFSET =-

uboot = Boot Loader for my device which has the same hash as FireFly RK3288
misc = Android OS misc partition
resource = ???
kernel = Obsolete Linux kernel partition, not used, keep it for compatibility*
boot = Android OS boot.img(kernel+ramdisk)
recovery = Android recovery/ Linux kernel + ramdisk
factory = ???
backup = Backup partition, we keep it for compatibility
cache = Android OS /cache partition
userdata = Android /data partition
kpanic = For kernel panic dump
system = Android OS /system partition
metadata = ???
linuxroot = For the Linux OS rootfs
user = Android OS internal flash as sdcard for storage (in my case is the rest of the space of the internal NAND)

In my case I put all coresponding files in img directory where Android Tool is located:

..\img\uboot_ugoos_V2.17.02.bin
..\dualboot.data8G.linux12G.parameter
..\img\misc.img
..\img\resource.img
..\img\kernel.img
..\img\boot.img
..\img\boot_linux.img
..\img\recovery.img
..\img\system.img
..\img\linuxroot.img

For that case we need some basic explanations and calculations to provide corresponding size which feet our needs.

SIZE@OFFSET(PARTITION_NAME)    OFFSET=STARTS FROM PREVIOUS TOTAL (?)

SIZE and OFFSET are hex numbers, in unit of 512 bytes (traditional disk sector size)

The formula used in Linux OS console was:
(10x to busybee for the helpfull tip and explanation)

EXAMPLE:

$ echo $(( 0x00180000 * 512 / 1024 / 1024))M [ENTER]
768M

(just copy paste and replace 0x00180000 with your desired value, don't copy $ it means shell)

, so for calculating the value of OFFSET - 0x00092000 the corresponding formula was:

$ echo $((0x00092000 * 512 / 1024 / 1024))M [ENTER]

which will output the result of 292M

Helpful ready to use calculated values

0x0002000  = 4MB
0x0004000  = 8MB
0x0008000  = 16MB
0x00010000 = 32MB
0x00020000 = 64MB
0x00040000 = 128MB
0x00080000 = 256MB
0x00100000 = 512MB
0x00200000 = 1GB
0x00400000 = 2GB
0x00800000 = 4GB
0x01000000 = 8GB
0x01800000 = 12GB
0x02000000 = 16GB
0x04000000 = 32GB

The final result in my case was file named: dualboot.data8G.linux12G.parameter
with the following content:

----------------------BEGIN FILE-----------------
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 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(factory),0x00040000@0x00050000(cache),0x00002000@0x00090000(kpanic),0x00180000@0x00092000(system),0x00002000@0x00212000(metadata),0x01000000@0x00214000(userdata),0x01800000@0x01214000(linuxroot),-@0x2A14000(user)
----------------------END FILE-----------------

Pay atention of the logic used and how to next partition size increases and starts form the sum of the prescending!



Reply

Use props Report

138

Credits

20

Prestige

18

Contribution

registered members

Rank: 2

Credits
138
Posted at 7/22/2015 06:17:17        Only Author  recommend

Calculation in my particular case

Last edited by deep In 7/25/2015 20:55 Editor

Based on the explanation above and what I read I make my parameter file public so anyone which want Android OS to be on 8192 MB (8GB) partition + Linux OS partition of 12288 MB (12GB) and the rest of the space to be used by the userdata, so if you found some error feel free to correct me.

========DroidOS-8GB/Linux-12GB for RK3288 parameter tunning==========
Below are provided values and their calculated value in MBytes

0x00002000@0x00002000(uboot)
4M@4M

0x00002000@0x00004000(misc)
4M@8M

0x00008000@0x00006000(resource)
16M@8M

0x00008000@0x0000E000(kernel)
16M@28M

0x00010000@0x00016000(boot)
32M@44M

0x00010000@0x00026000(recovery)
32M@76M

0x0001A000@0x00036000(backup)
52M@108M

0x00040000@0x00050000(cache)
128M@160M

0x00002000@0x00090000(kpanic)
4M@288M

0x00180000@0x00092000(system)
768M@292M

0x00002000@0x00212000(metadata)
4M@1060M

0x01000000@0x00214000(userdata)
8192M@1064M

----------------Below start the changed part from original parameter file--------
0x01260000@0x00414000(linuxroot) -- Extend to 12GB
9408M@2088M
OLD Linux 9G

NEW resize to 12GB
0x01800000@0x01214000
12288M@9256M
------------------------
-@0x01234000(user) -- To the end of space and using internal NAND as SD card  for user space
9320M
OLD >> NEW
-@0x2A14000(user)
21544M
已有 1评分Prestige +10 Money +11 Contribution +6 Pack up reason
busybee + 10 + 11 + 6 detailed and useful

View all ratings

Reply

Use props Report

403

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
403
Posted at 7/21/2015 11:40:17        Only Author  3#
Reply

Use props Report

403

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
403
Posted at 7/21/2015 11:46:41        Only Author  4#
It's really simple. Every partition has its start and range, which is given at the form below:

    SIZE@OFFSET(PARTITION_NAME)

SIZE and OFFSET are hex numbers, in unit of 512 bytes (traditional disk sector size)

For example, you can find the "CMDLINE" line in parameter file rk3288-3.10-uboot-data1G.parameter.txt, which has the string "system":

0x00180000@0x00092000(system)

This system partition has a size of:

$ echo $(( 0x00180000 * 512 / 1024 / 1024))M
768M

and starts at

$ echo $((0x00092000 * 512 / 1024 / 1024))M
292M

Just pay attention that, the offset of next partion = offset of this partition + size of this partition.

Someony made an excel file which simplified this processs. But I cannot find it now.
已有 1评分Prestige +10 Money +6 Contribution +12 Pack up reason
deep + 10 + 6 + 12

View all ratings

Reply

Use props Report

10

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
10
Posted at 10/27/2015 20:17:40        Only Author  5#
Hello Deep and Busybee,

1st of all, thank you very much for your topic, very usefull for me. I'm a newbie in Android and Ubuntu personalisation, but try to learn with forums.

I got a UGOOS UT3s 4GB RAM and 32GB ROM few weeks ago, and configured it for dualboot. Unfortunately, I was very disapointed when I saw the memory split: only 1GB for Android with apps, and the rest as user files. Most issue is most apps refuses to be installed on ext memory. Despite root and nice apps to force them, this solution is not convenient to me.

So, I was so happy when I discovered your messages, but I should do something wrong as I'm not able to modify the android size despite your explanations.
So, I've a couple of questions:
- here below the base config of the parameter.dualboot.linux9G
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 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(factory),
0x00040000@0x00050000(cache),
0x00002000@0x00090000(kpanic),
0x00180000@0x00092000(system),
0x00002000@0x00212000(metadata),
0x00200000@0x00214000(userdata),
0x01260000@0x00414000(linuxroot),
-@0x01674000(user)

So, I well modified the (linuxroot) and (user) parameters, but it not works, it's just like I did nothing.

- Second question is: shall we modify the adress when we modify the parameter file, as highlighted in yellow in the below capture ?



Thank you very much in advance for your help,
manu
Reply

Use props Report

417

Credits

15

Prestige

16

Contribution

intermediate

Rank: 3Rank: 3

Credits
417
Posted at 11/2/2015 09:20:48        Only Author  6#
Make your life easy and use this tool for 'parameter' file:

http://bbs.t-firefly.com/forum.p ... &extra=page%3D3
Reply

Use props Report

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

This forum Credits Rules

Quick Reply Back to top Back to list