[G1 Android Development] Scrip:
I have added Firerat's Magpie

update-cm-7-20120318-NIGHTLY-dream_sapphire-signed.zip to give it a try

don't expect me to be uploading new versions

This is a first draft, it is not complete but you should get the idea

I will move this to post 2 when I'm happy with it

feedback on would be nice

Adding apps2sdext

Howto add Firerat's apps2sdext

We will :

Fetch from Firerat's Github

git rebase -i

write a script to keep us synced

Starting in your CM src dir (/Android/CM)

cd dalvik
git remote add Firerat -f -t Magpie-CM7 http://github.com/Firerat/android_dalvik
git rebase -i m/gingerbread Firerat/Magpie-CM7

you should see

pick 9a77a7e Support dex on /sd-ext

# Rebase 55ac5b0..2444f63 onto 55ac5b0

#

# Commands:

# p, pick = use commit

# r, reword = use commit, but edit the commit message

# e, edit = use commit, but stop for amending

# s, squash = use commit, but meld into previous commit

# f, fixup = like "squash", but discard this commit's log message

# x, exec = run command (the rest of the line) using shell

#

# If you remove a line here THAT COMMIT WILL BE LOST.

# However, if you remove everything, the rebase will be aborted.

#

Now for the fun part

we need to know if we want that commit

copy 9a77a7e

open a new terminal (or tab)

[size=-2]

Alternatively put the editor to sleep with ctrl+z

You can return to the editor by using the fg command[/size]​

Assuming you are in /Android/CM/dalvik

git log -p 9a77a7e -n 1

Well we do want that , so return to the editor and save the file

After a short while

to check it did work

git log --pretty=full --graph

if you add a -p you will see a code diff

if you like GUIs sudo apt-get install gitg

so we don't lose anything

git checkout -b Magpie-CM7

Now we need to repeat with

frameworks/base

packages/apps/Settings

frameworks/base

cd /Android/CM/frameworks/base
git remote add Firerat -f -t Magpie-CM7 https://github.com/Firerat/android_frameworks_base
git rebase -i m/gingerbread Firerat/Magpie-CM7

this one takes a little longer

pick dca1ca6 Better ordering of showUsage() now we see error msg without needing to scroll up

pick f6c9aa7 Magpie a2sdext

pick 7a26637 Fix: missed a bit

pick 3cb1a2e fix from Effdee on xda catches users prefered install location much better http://xdaforums.com/showpost.php?p=12765143&postcount=1805

pick b580e6a oops: fix cut'n'paste fail

pick 5e5b7b6 Some additional sd-ext checks

pick cad47f3 reduced boot time instead of unpacking apk's Native Libraries every time only unpack if dexopt was performed

pick 8537c2b Fix for rotation of touch coordinates on the edge of the screen

# Rebase 005755e..8537c2b onto 005755e

#

# Commands:

# p, pick = use commit

# r, reword = use commit, but edit the commit message

# e, edit = use commit, but stop for amending

# s, squash = use commit, but meld into previous commit

# f, fixup = like "squash", but discard this commit's log message

# x, exec = run command (the rest of the line) using shell

#

# If you remove a line here THAT COMMIT WILL BE LOST.

# However, if you remove everything, the rebase will be aborted.

a little more to do in this one

here is what I end up with

pick dca1ca6 Better ordering of showUsage() now we see error msg without needing to scroll up

pick f6c9aa7 Magpie a2sdext

fixup 7a26637 Fix: missed a bit

pick 3cb1a2e fix from Effdee on xda catches users prefered install location much better http://xdaforums.com/showpost.php?p=12765143&postcount=1805

fixup b580e6a oops: fix cut'n'paste fail

pick 5e5b7b6 Some additional sd-ext checks

#pick cad47f3 reduced boot time instead of unpacking apk's Native Libraries every time only unpack if dexopt was performed

#pick 8537c2b Fix for rotation of touch coordinates on the edge of the screen

# Rebase 005755e..8537c2b onto 005755e

#

# Commands:

# p, pick = use commit

# r, reword = use commit, but edit the commit message

# e, edit = use commit, but stop for amending

# s, squash = use commit, but meld into previous commit

# f, fixup = like "squash", but discard this commit's log message

# x, exec = run command (the rest of the line) using shell

#

# If you remove a line here THAT COMMIT WILL BE LOST.

# However, if you remove everything, the rebase will be aborted.

changing pick to fixup on 7a26637 makes it get included in the f6c9aa7 commit which is where it should have been in the first place.

same goes for b580e6a, it should have been part of 3cb1a2e

cad47f3 and 8537c2b are commented out

so we don't lose anything

git checkout -b Magpie-CM7

cd packages/apps/Settings

git remote add Firerat -f -t Magpie-CM7 https://github.com/Firerat/android_packages_apps_Settings
git rebase -i m/gingerbread Firerat/Magpie-CM7

Only one commit

But we have a merge conflict

error: could not apply a8ecc82... Magpie default install location and Apk moving

hint: after resolving the conflicts, mark the corrected paths

hint: with 'git add <paths>' and run 'git rebase --continue'

Recorded preimage for 'res/values-es/arrays.xml'

Recorded preimage for 'src/com/android/settings/applications/InstalledAppDetails.java'

Could not apply a8ecc82... Magpie default install location and Apk moving

git diff

the conflicts are marked with <<<<<< HEAD

1++<<<<<<< HEAD
2 + <item msgid="4498124044785815005">"Elegido por el sistema"</item>
3++=======
4+ <item msgid="8651707593222110014">"sd-ext"</item>
5+ <item msgid="4498124044785815005">"Selección del sistema"</item>
6++>>>>>>> a8ecc82... Magpie default install location and Apk moving

It is not to difficult to edit these by hand

edit res/values-es/arrays.xml and

delete lines 1,3, 5 & 6

move line 4 above line 2

You should end up with

<item msgid="8651707593222110014">"sd-ext"</item>
<item msgid="4498124044785815005">"Elegido por el sistema"</item>

src/com/android/settings/applications/InstalledAppDetails.java is not so interesting

1++<<<<<<< HEAD
2 + if (!allowMoveAllApps && moveDisable || (mAppEntry.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
3 + mMoveAppButton.setEnabled(false);
4++=======
5+ if ((!allowMoveAllApps && moveDisable) || ((mAppEntry.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0)
6+ || ((mAppEntry.info.flags & ApplicationInfo.FLAG_FORWARD_LOCK) != 0)) {
7+ mMoveAppButtonL.setEnabled(false);
8++>>>>>>> a8ecc82... Magpie default install location and Apk moving

delete 1,2,3,4 & 8

git add res/values-es/arrays.xml src/com/android/settings/applications/InstalledAppDetails.java
git rebase --continue

after checking, do a git checkout -b Magpie-CM7

packages/apps/CMParts

Optionally repeat with CMParts

I have not looked at that in detail yet, but it looks messy and I think there is a better solution

quick with no detail​

Edit vendor/cyanogen/prebuilt/common/etc/init.d/10apps2sd

changing setprop cm.a2sd.active 1 to setprop magpie.a2sd.active 1

edit vendor/cyanogen/products/common.mk

uncomment vendor/cyanogen/prebuilt/common/etc/init.d/10apps2sd:system/etc/init.d/10apps2sd

mka bacon

now each time you repo sync you will need to

cd <project>
git rebase Magpie m/gingerbread

that will

checkout your Magpie branch and put the cm changes into it

I need to write a script to deal with that

edit: 2012-03-20

a quick script to keep us synced with CM

cat > ~/bin/rebaseCMagpie.sh << "EOF_"
#!/bin/bash
repo_list () {
cat << "EOF"
dalvik Magpie-CM7 github/gingerbread
frameworks/base Magpie-CM7 github/gingerbread
packages/apps/Settings Magpie-CM7 github/gingerbread
EOF
}

repo_list | while read Project Base Upstream;do
pushd $Project || exit 1
git branch -v
git rebase $Base $Upstream || exit 1
git branch -v -a
popd
done
EOF_
chmod 700 ~/bin/rebaseCMagpie.sh

You must be in the repo root (/Android/CM)

The script is dumb and doesn't check

your repo sync command could now look like

repo sync -j16 -c && rebaseCMagpie.sh

if you wanted you could add repo sync into rebaseCMagpie.sh and rename it

​