[LG Optimus 2x] jamez.tankh:
link below might give some help in partitioning...

http://xdaforums.com/showpost.php?p=30937004&postcount=63

&

this is some ICS information and the differences between GB and ICS of SU660.

GingerBread (v20X firmwares)

# cat /proc/partitions

major minor #blocks name

179 0 15673344 mmcblk0

179 1 524288 mmcblk0p1 => System

179 2 65536 mmcblk0p2 => CACHE

179 3 2048 mmcblk0p3 => MISC

179 4 1 mmcblk0p4 => Extended partition

179 5 8192 mmcblk0p5 => BOOT

179 6 2560 mmcblk0p6

179 7 20480 mmcblk0p7 => Recovery

179 8 2097152 mmcblk0p8 => DATA

179 9 10240 mmcblk0p9

179 10 12938752 mmcblk0p10 => internal Storage

leaked V30a ICS firmware

# cat /proc/partitions

major minor #blocks name

179 0 15673344 mmcblk0

179 1 524288 mmcblk0p1 => SYSTEM

179 2 65024 mmcblk0p2 => CACHE

179 3 1 mmcblk0p3 => Extended Partition

179 4 261632 mmcblk0p4 => new SWAP partition

179 5 2048 mmcblk0p5 => MISC

179 6 8192 mmcblk0p6 => BOOT

179 7 2560 mmcblk0p7

179 8 20480 mmcblk0p8 => Recovery

179 9 2097152 mmcblk0p9 => DATA

179 10 10240 mmcblk0p10

179 11 12674560 mmcblk0p11 => internal Storage

179 12 2048 mmcblk0p12

as you can see some part of the partition numbers are shifted

the 4th partition is the newly added 128MB SWAP partition

so if you want to downgrade from ICS(v30a) to GB(v20X) you should use the "Smartflash"

(it cleanup and repartition all partitions)

and you can also use manual editing method to fix partition mismatches with the fdisk command after downgrade with the KDZ_FW_UPD under CWM Recovery.

additional fdisk info of the Gingerbread

# fdisk /dev/block/mmcblk0

The number of cylinders for this disk is set to 1959168.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/block/mmcblk0: 16.0 GB, 16049504256 bytes

1 heads, 16 sectors/track, 1959168 cylinders

Units = cylinders of 16 * 512 = 8192 bytes

Device Boot Start End Blocks Id System

/dev/block/mmcblk0p1 129 65664 524288 83 Linux

Partition 1 does not end on cylinder boundary

/dev/block/mmcblk0p2 65665 73856 65536 83 Linux

Partition 2 does not end on cylinder boundary

/dev/block/mmcblk0p3 73857 74112 2048 83 Linux

Partition 3 does not end on cylinder boundary

/dev/block/mmcblk0p4 74113 2585347 20089880 5 Extended

Partition 4 does not end on cylinder boundary

/dev/block/mmcblk0p5 74177 75200 8192 83 Linux

/dev/block/mmcblk0p6 75265 75584 2560 83 Linux

/dev/block/mmcblk0p7 75649 78208 20480 83 Linux

/dev/block/mmcblk0p8 78273 340416 2097152 83 Linux

/dev/block/mmcblk0p9 340481 341760 10240 83 Linux

/dev/block/mmcblk0p10 341825 1959168 12938752 83 Linux

(the parted is not work under GB firmwares)

fdisk info of the ICS (v30a)

# fdisk /dev/block/mmcblk0

The number of cylinders for this disk is set to 1959168.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/block/mmcblk0: 16.0 GB, 16049504256 bytes

1 heads, 16 sectors/track, 1959168 cylinders

Units = cylinders of 16 * 512 = 8192 bytes

Device Boot Start End Blocks Id System

/dev/block/mmcblk0p1 129 65664 524288 83 Linux

Partition 1 does not end on cylinder boundary

/dev/block/mmcblk0p2 65665 73792 65024 83 Linux

Partition 2 does not end on cylinder boundary

/dev/block/mmcblk0p3 73793 1926464 14821376 5 Extended

Partition 3 does not end on cylinder boundary

/dev/block/mmcblk0p4 1926465 1959168 261632 83 Linux

Partition 4 does not end on cylinder boundary

/dev/block/mmcblk0p5 73857 74112 2048 83 Linux

/dev/block/mmcblk0p6 74177 75200 8192 83 Linux

/dev/block/mmcblk0p7 75265 75584 2560 83 Linux

/dev/block/mmcblk0p8 75649 78208 20480 83 Linux

/dev/block/mmcblk0p9 78273 340416 2097152 83 Linux

/dev/block/mmcblk0p10 340481 341760 10240 83 Linux

/dev/block/mmcblk0p11 341825 1926144 12674560 83 Linux

/dev/block/mmcblk0p12 1926209 1926464 2048 83 Linux

parted output

# parted /dev/block/mmcblk0

GNU Parted 1.8.8.1.179-aef3

Using /dev/block/mmcblk0

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) u s

u s

(parted) p

p

Model: MMC MMC16G (sd/mmc)

Disk /dev/block/mmcblk0: 31346688s

Sector size (logical/physical): 512B/512B

Partition Table: msdos

Number Start End Size Type File system Flags

1 2048s 1050623s 1048576s primary ext3

2 1050624s 1180671s 130048s primary ext3

3 1180672s 30823423s 29642752s extended

5 1181696s 1185791s 4096s logical ext3

6 1186816s 1203199s 16384s logical

7 1204224s 1209343s 5120s logical ext2

8 1210368s 1251327s 40960s logical

9 1252352s 5446655s 4194304s logical ext3

10 5447680s 5468159s 20480s logical ext2

11 5469184s 30818303s 25349120s logical fat32

12 30819328s 30823423s 4096s logical

4 30823424s 31346687s 523264s primary

modified boot.img info to use the ICS(v30a) system.img with the GB(v20m)

the following method is not perfect and under develop but it is working nicely.

known issues

* vold does not know the internal storage partition.

* somewhat slower than the full flash update.

diff -u r/default.prop r-fix/default.prop

--- r/default.prop 2012-09-01 00:34:22.591470039 +0900

+++ r-fix/default.prop 2012-08-31 21:12:52.689143393 +0900

@@ -1,7 +1,7 @@

#

# ADDITIONAL_DEFAULT_PROPERTIES

#

-ro.secure=1

+ro.secure=0

ro.allow.mock.location=0

ro.debuggable=1

persist.sys.usb.config=pc_suite,adb

Common subdirectories: r/dev and r-fix/dev

diff -u r/init.lge.early.rc r-fix/init.lge.early.rc

--- r/init.lge.early.rc 2012-09-01 00:34:22.595469967 +0900

+++ r-fix/init.lge.early.rc 2012-08-31 22:05:35.635478718 +0900

@@ -2,10 +2,10 @@

# LGE_SECURE BOOT

########################################

###LGE_CHANGE_S[minhyup.park@lge.com]

-on boot

+#on boot

# Application image verification process for LGE secure boot

- exec /sbin/wallpaper -ap

- wait /sbin/wallpaper

+# exec /sbin/wallpaper -ap

+# wait /sbin/wallpaper

##LGE_CHANGE_E[minhyup.park@lge.com]

########################################

diff -u r/init.star.model.rc r-fix/init.star.model.rc

--- r/init.star.model.rc 2012-09-01 00:34:22.596469953 +0900

+++ r-fix/init.star.model.rc 2012-08-31 21:19:26.085949868 +0900

@@ -59,16 +59,18 @@

mount ext4 /dev/block/mmcblk0p1 /system wait ro

# LGE_CHANGE [doyeob.kim@lge.com] 2012-04-25, change that /data mount to mmcblk0p9

-# mount ext3 /dev/block/mmcblk0p8 /data wait noatime

- mount ext3 /dev/block/mmcblk0p9 /data wait noatime

+# mount ext3 /dev/block/mmcblk0p9 /data wait noatime

+ mount ext4 /dev/block/mmcblk0p8 /data wait noatime

mount ext3 /dev/block/mmcblk0p2 /cache wait noatime

#MOBII_CHNANGE_S 20120611 dmoh@mobii.co.kr : For Widevine - Set widevine drm keybox repository

- mount ext3 /dev/block/mmcblk0p7 /persist wait noatime

+# mount ext3 /dev/block/mmcblk0p7 /persist wait noatime

+ mount ext3 /dev/block/mmcblk0p6 /persist wait noatime

#MOBII_CHNANGE_E 20120611 dmoh@mobii.co.kr : For Widevine - Set widevine drm keybox repository

#MOBII_CHNANGE_E 20120611 dmoh@mobii.co.kr : SKT OEM VE, VT service [START]

mkdir /data/ve 0770 radio radio

- mount ext3 /dev/block/mmcblk0p10 /data/ve nosuid nodev noatime

+ #mount ext3 /dev/block/mmcblk0p10 /data/ve nosuid nodev noatime

+ mount ext3 /dev/block/mmcblk0p9 /data/ve nosuid nodev noatime

chown radio radio /data/ve

#MOBII_CHNANGE_E 20120611 dmoh@mobii.co.kr : SKT OEM VE, VT service [END]

diff -u r/init.star.rc r-fix/init.star.rc

--- r/init.star.rc 2012-09-01 00:34:22.597469922 +0900

+++ r-fix/init.star.rc 2012-08-31 23:18:33.857881724 +0900

@@ -39,9 +39,9 @@

chown media_rw media_rw /data/media

# MOBII_CHNANGE_S 20120423 mg.chang@mobii.co.kr : for using nv partition

-# Fixed CTS chmod 0666 /dev/block/mmcblk0p5

- chmod 0660 /dev/block/mmcblk0p5

- chown system radio /dev/block/mmcblk0p5

+# Fixed CTS chmod 0666 /dev/block/mmcblk0p3

+ chmod 0660 /dev/block/mmcblk0p3

+ chown system radio /dev/block/mmcblk0p3

#MOBII_CHNANGE_S 20120611 dmoh@mobii.co.kr : For Widevine - Set widevine drm keybox repository

chown system system /persist

@@ -488,7 +488,7 @@

# Recovery daemon: configure MSC partition

#service recoveryd /system/bin/recoveryd /dev/block/platform/sdhci-tegra.3/by-name/MSC

-service recoveryd /system/bin/recoveryd /dev/block/mmcblk0p5 #MOBII_CHNANGE 20120306 mg.chang@mobii.co.kr : apply factory reset

+service recoveryd /system/bin/recoveryd /dev/block/mmcblk0p3 #MOBII_CHNANGE 20120306 mg.chang@mobii.co.kr : apply factory reset

disabled

class main

user root

diff -u r/ueventd.star.rc r-fix/ueventd.star.rc

--- r/ueventd.star.rc 2012-09-01 00:34:22.642469281 +0900

+++ r-fix/ueventd.star.rc 2012-08-31 23:24:58.981783113 +0900

@@ -57,4 +57,4 @@

#MOBII_CHNANGE_E 20120213 mg.chang@mobii.co.kr : Appy Sensor Porting

#MOBII_CHNANGE 20120712 mg.chang@mobii.co.kr : nv partition

-/dev/block/mmcblk0p5 0660 system radio

+/dev/block/mmcblk0p3 0660 system radio

and the cmdline for the modified boot.img

* base address=0x10000000

mem=512M@0M nvmem=0M@0M android.commchip=0 vmalloc=128M video=tegrafb no_console_suspend=1 debug_uartport=lsport,-3 usbcore.old_scheme_first=1 lp0_vec=8192@0x1dd09000 tegra_fbmem=3073920@0x1dd0d000 muic_state=1 loglevel=8 tegraboot=sdmmc

tegrapart=recovery:4a200:2800:800,boot:48b00:1000: 800,mbr:400:200:800,system:600:40000:800,cache:406 00:7f00:800,misc:48600:400:800,userdata:4cb00:1000 00:800,bcttable:0:600:800,bootloader:100:300:800,d ata/ve:14cc00:1400:800 androidboot.serialno=0123456789 (fake serialno)

and you have to fix some files

* /system/etc/vold.fstab (11 => 10 but the vold does not recognize the internal storage )

* /system/etc/format_fat32.sh (fix p11 to p10)

* remove /system/bin/swap_enable.sh (it create physical swap but the GB firmware do not have any additional physical swap partition)

and I think it is worthwhile to mention that the new bootloader is locked!

you can't modify Boot/Recovery partition at all

(boot.img and recovery.img has additional signing info something like as the OMAP RSA boot lock signings)

credited to wkpark