ghbolivar / android-on-freerunner

Automatically exported from code.google.com/p/android-on-freerunner
0 stars 0 forks source link

Create an SD card installable version #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It would be useful to have a version of android-on-freerunner that installs 
completely on the SD card, without modifying NAND flash in the phone. This 
would be a script that (optionally) partitions the SD card and copies the 
proper images to the various places. It also probably requires changes to 
init.rc to mount the SD card partitions.

Original issue reported on code.google.com by scarhill on 20 Sep 2009 at 1:32

GoogleCodeExporter commented 9 years ago
In addition:
Attached file 1 is repo diff of my working repository - SD based master(froyo).
Attached file 2 is commands for build an archive from out/target/product/fr/.

Original comment by Alexandr...@gmail.com on 20 Aug 2010 at 5:39

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Alexandre,

Could you make a repo diff for cupcake and only containing the changes for the 
SD card install (so not your custom APN entries etc)?

I will give it a go on my local tree here and see how it works out.

Thanks,

Niels.

Original comment by niels.he...@gmail.com on 24 Aug 2010 at 7:57

GoogleCodeExporter commented 9 years ago
Hello

Sorry for delay. I have to check current cupcake. I have not testing it, I am 
testing master(froyo) now. So I have only check that SD-based work for current 
repository of cupcake, but not cupcake itself.   But ~0,5 year of daily use of 
RC1 shows that SD-based cupcake work very well. I get reports of some gays 
about same result.
Find in attachment file1 - repo sync  to get SD-based 
out/target/product/freerunner

Good lack to see how it works out.

Original comment by Alexandr...@gmail.com on 25 Aug 2010 at 5:03

Attachments:

GoogleCodeExporter commented 9 years ago
Serdar,

I've compiled cupcake with the changes and have prepared an archive with the 
new files for testing the script by Alexandre.

My question is: how do I create the userdata.img file and the md5sums files? I 
did not find these on my filesystem...

Thanks.

Niels.

Original comment by niels.he...@gmail.com on 27 Aug 2010 at 9:24

GoogleCodeExporter commented 9 years ago
Hello, Niels.
To avoid any misunderstending:
1) Script from comment 50 for guys, who does not work with repository and whoud 
like to get  SD-base tar.gz-image from ordinary tar.gz  image
2) To prepare SD-base tar.gz-image from repository's 
out/target/product/freerunner files structure use as example commands sequence 
shown in file2 of comment 51. This commands sequence is a part of script from 
comment 50, but more usefull. Fill free to convert this commands sequence to 
script for your working environment. I have one, but it close to my working 
environment.
3) Current ordinary tar.gz  image has empty userdata.img file , so I did not 
use it in my procedure. It possible to change it in future.
4) To create md5sum file use command:  md5sum file > file.md5
Fill free contact me in any question. 
Alexandre.

Original comment by Alexandr...@gmail.com on 28 Aug 2010 at 1:55

GoogleCodeExporter commented 9 years ago
Hi Alexandre,

I'm getting confused here.

So you can create and SD-based image from the build tarballs provided by Serdar 
using the script in comments 50. Without the need of patching with file1 from 
comments 53.

Is my understanding correct?

Or do you still require the special prepared kernel as you call in the script 
using the patch from comments 53?

And for those with a local repository, using file2 of comments 51 should work 
with the special kernelpatch. Correct?

Thanks for letting me know.

Niels.

Original comment by niels.he...@gmail.com on 28 Aug 2010 at 10:31

GoogleCodeExporter commented 9 years ago
Hello

> 
> I'm getting confused here.
> 
> So you can create and SD-based image from the build tarballs provided by 
Serdar using the script in comments 50. Without the need of patching with file1 
from comments 53.
> 
> Is my understanding correct?
> 
> Or do you still require the special prepared kernel as you call in the script 
using the patch from comments 53?
> 
Main problem for SD version is a special kernel build.
Kernel should be build from repository. Serdar daily build has not this special 
build, so you have to create this special kernel build yourself!!!! 
    The kernel change some rarely, so the version of special kernel build from comment 33 is possible use up to now (but not all time!!!)

> And for those with a local repository, using file2 of comments 51 should work 
with the special kernel patch. Correct?
> 

Yes, only patched repository build create  out/target/product/freerunner 
structure, using which commands sequence from comments 51 does SDbased archive 
file.( Some sort of replace of installer. I have not success with installer 
build ) 

> Thanks for letting me know.
> 
> Niels.

Original comment by Alexandr...@gmail.com on 29 Aug 2010 at 4:44

GoogleCodeExporter commented 9 years ago
Menu button not acting as such after creating SD version

I patched the files (patches from file in comment 53 - kernel config and 
init.rc), built it and copied to SD. The system boots and connects to GSM, GPRS 
and WiFi also work (copied old wpa_supplicant.conf), but I cannot get context 
menus when pressing power button quickly. The behaviour is the same as clicking 
AUX quickly - it jumps to previous screen. Does anyone know if this is some bug 
in SD version or if it is a general problem? pressing longer suspends the phone 
and pressing very long brings up menu for flight mode, etc - so this behaviour 
is correct.

Thanks.

Original comment by christia...@gmail.com on 23 Sep 2010 at 10:20

GoogleCodeExporter commented 9 years ago
> Menu button not acting as such after creating SD version
Which repository you use?
Does you build only kernel or full?
 I have check SD-based system with current cupcake repository and does not see any problem with buttons behaviour.

Original comment by Alexandr...@gmail.com on 23 Sep 2010 at 11:40

GoogleCodeExporter commented 9 years ago
Hmmm... looking at the patches for the SD Card build, I can't imagine how this 
issue can be triggered by those patches. It might as well be an isolated 
regression issue, not linked to the actual SD card modifications.

Give the latest cupcake repo a try, without your local SD card changes, and see 
if behaviour is the same.

Niels.

Original comment by niels.he...@gmail.com on 23 Sep 2010 at 11:41

GoogleCodeExporter commented 9 years ago
Repository was 
git://gitorious.org/android-on-freerunner/freerunner_platform_manifest.git -b 
cupcake

freshly updated and first build ever on this system

I patched kernel config and init.rc as mentioned, so the only difference should 
be initrd compared to NAND version.

I copied /root and /system to SD as well as the kernel. I did not make any 
further modifications - is this enough to build a proper SD card AoF?

Trying the prebuilt SD version I do not have this behaviour. It's only the 
context menu part that is wrong. Has anyone else seen this or tried to build a 
recent cupcake for SD? Am I missing something?

If anyone wants to test I can offer my SD version for download.

@niels - I do have a different system in NAND that I do not want to sacrifice 
for testing AoF.

Thanks for you help. Shall I move this to a separate issue?

Original comment by christia...@gmail.com on 23 Sep 2010 at 4:55

GoogleCodeExporter commented 9 years ago
> I copied /root and /system to SD as well as the kernel. I did not make any 
further modifications - is this enough to build a proper SD card AoF?

It is not enough. Please, looks at commands sequence from file2 comment 51.

Original comment by Alexandr...@gmail.com on 23 Sep 2010 at 5:02

GoogleCodeExporter commented 9 years ago
The chmod did the trick! Thanks a lot.

Original comment by christia...@gmail.com on 24 Sep 2010 at 7:28

GoogleCodeExporter commented 9 years ago
Now that my cupcake is running I tried the same with froyo branch but get:

init: Unable to open persistent property directory /data/property errno: 2
and many of these:

init: untracked pid ... exited

Checking SD card after that shows that none of the directories from init.rc got 
created.
Is there anything else needed than the above steps or might this be an issue in 
froyo branch?

Thanks.

Original comment by christia...@gmail.com on 26 Sep 2010 at 9:21

GoogleCodeExporter commented 9 years ago
Hello
Main idea for froyo is same - special kernel build and some changes in init.rc. 
Changes in init.rc a bit differ then in cupcake's init.rc.
I have not chance to create repo diff at moment, but I have create some time 
ago a tar file with changes I have played with froyo, find it below.
Good luck.

Original comment by Alexandr...@gmail.com on 26 Sep 2010 at 9:54

Attachments:

GoogleCodeExporter commented 9 years ago
That contained some useful information, thanks
I installed your versions of the files except for kernel (as the version 
changed).
For the kernel I used the old patch for not using initrd.

I have a repo diff attached here.

The systems boots, I can enter pin but that's it then.

Original comment by christia...@gmail.com on 26 Sep 2010 at 2:16

Attachments:

GoogleCodeExporter commented 9 years ago
Unfortunatly, it is current situation with froyo. Two thing sensible to do 
after first booting:
1) Switch off animation ( run at linux box):
[root@Notebook ~]# cd 
/media/and-data/data/data/com.android.providers.settings/databases/
[root@Notebook databases]# sqlite3 settings.db
SQLite version 3.6.23.1
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> REPLACE INTO "system" VALUES(26,'window_animation_scale','0.0');
sqlite> REPLACE INTO "system" VALUES(27,'transition_animation_scale','0.0');
sqlite> .quit
[root@Notebook databases]# cd

2) Mount SD fat-partition ( run at freerunner ):
# vdc volume mount /mnt/sdcard

Original comment by Alexandr...@gmail.com on 26 Sep 2010 at 3:44

GoogleCodeExporter commented 9 years ago
OK, this made it somewhat usable (no WiFi and no GSM though).

I have a suggestion: why not make a wiki page about how to get it running from 
SD? A collection of all what is here, i.e. which steps to perform from 0 to get 
an SD runnable version of cupcake and froyo. I would volunteer to set up an 
initial version if someone would give me access. What do you think?

Original comment by christia...@gmail.com on 30 Sep 2010 at 8:22

GoogleCodeExporter commented 9 years ago
Christian,

Thanks for offering help.

I've configured the project Wiki so you have the rights to contribute to the 
Wiki.

In case you have any questions related adding your info to the Wiki, just mail 
me directly so we don't pollute the issue tracker.

Thanks again for your support.

Niels.

Original comment by niels.he...@gmail.com on 30 Sep 2010 at 10:10

GoogleCodeExporter commented 9 years ago
Patches for Cupcake and Froyo to build for SD.

Original comment by christia...@gmail.com on 6 Oct 2010 at 7:40

Attachments:

GoogleCodeExporter commented 9 years ago
I applied the patches on new branches: cupcake-sd and froyo-sd. My idea is that 
we can also patch other parts of the build to produce an entire SD image, 
rather than depending on an external script that is run after the build. To use 
the new branches, do a 
repo init -u 
git://gitorious.org/android-on-freerunner/freerunner_platform_manifest.git -b 
cupcake-sd (or froyo-sd)
followed by
repo sync

You should be able to switch back and forth between the two branches without 
doing a make clean, so that you can build both versions relatively easily.

Original comment by scarhill on 7 Oct 2010 at 11:57

GoogleCodeExporter commented 9 years ago
I guess the Wiki pages need to be adapted accordingly. Will try to do so 
tomorrow or Wednesday evening.

Only question I have is when you say we should be able to switch back and forth 
between the two branches without doing a make clean. How would this be done? 
When doing a repo init on a dedicated location in my system, don't you need to 
build the entire SD branch scratch? Or, you I already have a compiled 
cupcake/froyo branch, how do benefit from this (i.e. not recompiling everything 
again)?

Once I understand this a bit better, I can do the updates to the Wiki.

Regards,

Niels.

Original comment by niels.he...@gmail.com on 11 Oct 2010 at 9:32

GoogleCodeExporter commented 9 years ago
Hi,

I just compiled my first froyo for my freerunner for usage on a sd-card.

I found an issue with the new froyo-sd branch:
To successfully boot into froyo, I had to apply the Froyo-sd-card patch 
attached in comment 70 here, seems like it is missing from the branch.

But nevertheless great work, keep it up,
tRAcE 

Original comment by gamble...@gmx.de on 12 Oct 2010 at 7:19

GoogleCodeExporter commented 9 years ago
Hi, I am trying to install android on SD, it's really nice that a clear wiki 
page is now provided (and easy to find), thanks to all the authors.

I followed the guide (including patches from comment 70 in this thread) and 
built Froyo on my computer, found a small glitch during the building process, 
segmentation fault at page-writeback.c:820.

I "solved" it by commenting out line 918 in page-writeback.c:
// BUG_ON(PageWriteback(page));
as advised here 
http://www.idroidproject.org/forum/general-discussion/compiling-kernel-issues/

Copied everything to SD card and tried to boot using U-Boot.
First issue is that U-Boot cannot boot from /boot directory on the same 
(Android system) partition, so I created another small (8MB) partition and put 
the kernel there (to make sure I actually put two identical copies, uImage.bin 
and uImage-GTA02.bin).
Then I created an entry in U-Boot and it seems to work, until it gets to the 
point where it mounts the root filesystem, shortly after the kernel goes into 
panic.

The last few messages before kernel panic are:
devtmpfs: mounted
Freeing init memory: 132K
Kernel panic - not syncing: Attempted to kill init!

Can the problem be due to using U-Boot instead of Qi bootloader? I know there 
is an issue with U-Boot not being able to load images larger than 2MB (and 
Android is 2.1MB). I found in some other mailing list that this can be tweaked 
by setting this in U-Boot:
setenv bootcmd setenv bootargs \${bootargs_base} \${mtdparts}\; nand read.e 
0x32000000 kernel 0x300000\; bootm 0x32000000

which I did but to no avail. If the problem is very likely due to U-Boot and 
can be solved by using Qi I don't mind switching to it. If instead the problem 
is elsewhere I rather keep U-Boot since I already have it setup for other 
distros.

Thanks for any help.

Original comment by marcoj...@gmail.com on 17 Oct 2010 at 4:39

GoogleCodeExporter commented 9 years ago
1)  Qi - is a bootloader for AoF.
2)  To other distros you able to use U-Boot in the NOR:  
http://wiki.openmoko.org/wiki/Booting_the_Neo_FreeRunner  I am doing this way.
  Be patient, froyo is not ready at moment.

Original comment by Alexandr...@gmail.com on 18 Oct 2010 at 5:51

GoogleCodeExporter commented 9 years ago
Thanks for the reply. I know of NOR and how to access it, the problem is that 
it cannot be configured as far as I know, so you can only boot from one or two 
default partitions (i.e. can have one OS in NAND and one on first/second 
partition of SD). If I understand correctly Qi does not show a boot menu, 
instead it tries to boot from partitions on SD first and NAND then. Sure all 
this is not a problem after preparing the right SD/NAND combination and having 
optionally multiple SD cards.

I think I will have a try building and installing cupcake then, since I have no 
experience with android it would help having a more stable system. I can wait 
and try U-Boot first and then switch to Qi in case.

Original comment by marcoj...@gmail.com on 18 Oct 2010 at 10:46

GoogleCodeExporter commented 9 years ago
Updating on 76. I have successfully built and installed cupcake with SD patch. 
Booted through U-Boot (did not install Qi), after setting "setenv bootcmd ..." 
as described in Comment 74. Followed exactly the guide in the wiki and then 
copied uImage-GTA02.img to a different (small, 8 MB) partition. Android seemed 
to run fine, could at least use dialer, but after it hanged once it could not 
register the SIM card anymore (not even after rebooting, removing battery, 
etc.).

Anyway it's a good start! Thanks for all the good work.

Original comment by marcoj...@gmail.com on 20 Oct 2010 at 4:45

GoogleCodeExporter commented 9 years ago
at comment 77:
could help me with the:
"get a copy of Cupcake repo (if not already on your system) " from android on 
sdcard.

Where do I actually get this copy. I checked the build part but haven't figured 
out if I would have to do all the steps described there to fullfil the point: 
"get a copy of Cupcake repo (if not already on your system)"?
Thanks for your help / ps: would you mind to share your sd card partition table?

Original comment by robin.se...@biologie.uni-freiburg.de on 21 Oct 2010 at 11:31

GoogleCodeExporter commented 9 years ago
Robin,

Instructions are on the Build It Wiki page, top paragraph.

Regards,

Niels.
--
BuildIt   

Build your own system and test out your changes.
In general the setup necessary to build Android-on-Freerunner is the same as 
for the main Android project. See the Get Android Source page there for 
instructions on downloading source code and setting up your machine's build 
environment. One important difference: The AoF-specific source code is hosted 
at our Gitorious repository, so to checkout AoF code use the following command 
(not the one on the source.android.com page): 

 $ repo init -u git://gitorious.org/android-on-freerunner/freerunner_platform_manifest.git -b froyoThe -b parameter on the repo command specifies the branch to check out, currently either cupcake or froyo. 

...

Original comment by niels.he...@gmail.com on 22 Oct 2010 at 9:00

GoogleCodeExporter commented 9 years ago
Hi Niels,

thanks for your advise. I still got stuck again, maybe you can give me some 
more hints on what I'm missing. So here one step after the other what I did:
1) made new directory
~/Downloads/AndroidonSD/
2) got curl
~/Downloads/AndroidonSD/curl http://android.git.kernel.org/repo > ./repo
3) created another directory
~/Downloads/AndroidonSD/cupcake
4) went into the cupcake directory and did
~/Downloads/AndroidonSD/cupcake $ ./../repo init -u 
git://gitorious.org/android-on-freerunner/freerunner_platform_manifest.git -b 
cupcake
5) download went fine. 
6) there were some question on my name and email which I regarded not of any 
influence for the installation
7) Downloaded the patch from issue 7 comment 70 into the cupcakedirectory: 
cupcake.patch (on the wiki page it says get the patches though it means get the 
relevant patch for your branch (either cupcake or froyo)
8) tried to apply the patch
~/Downloads/AndroidonSD/cupcake/patch -p1 < cupcake.patch
ERROR:
patching file kernel/arch/arm/configs/gta02_android_defconfig
Hunk #1 FAILED at 67.
1 out of 1 hunk FAILED -- saving rejects to file 
kernel/arch/arm/configs/gta02_android_defconfig.rej
patching file vendor/neo/freerunner/init.rc
Hunk #1 FAILED at 14.
Hunk #2 FAILED at 25.
Hunk #3 FAILED at 35.
3 out of 3 hunks FAILED -- saving rejects to file 
vendor/neo/freerunner/init.rc.rej

Any idea what went wront?

Original comment by robin.se...@biologie.uni-freiburg.de on 22 Oct 2010 at 7:15

GoogleCodeExporter commented 9 years ago
I updated wiki page. You can use the *-sd branches now to build - patches are 
no longer necessary, although this method should still work. So you can 
investigate what went wrong with your patch or just try cupcake-sd branch.

Original comment by christia...@gmail.com on 23 Oct 2010 at 8:19

GoogleCodeExporter commented 9 years ago
I tried to do everything as explained on the android website:
installing repo
getting rep initialized
but when I try to run 
make
or rather
make -j 4 TARGET_PRODUCT=freerunner
as explained on the build website I get
make: *** Keine Targets angegeben und keine »make«-Steuerdatei gefunden.  
Schluss.
which corresponds to something like
make: *** No targets assigned and no make "configure" file. exiting ...

any help appreciated ...

Original comment by robin.se...@biologie.uni-freiburg.de on 5 Nov 2010 at 9:41

GoogleCodeExporter commented 9 years ago
Hello
It seems, that you do make being in wrong directory or directory was not 
prepared correctly. If you do not solve a problem yourself, do ls -a command 
before make to show us a report.

Original comment by Alexandr...@gmail.com on 6 Nov 2010 at 8:07

GoogleCodeExporter commented 9 years ago
Hi Alexandre,
this is my output

repo initialized in /home/linamoti/Downloads/AndroidonSD/cupcake-sd
linamoti@lina-moti-desktop ~/Downloads/AndroidonSD/cupcake-sd $ make -j 4 
TARGET_PRODUCT=freerunner
make: *** Keine Targets angegeben und keine »make«-Steuerdatei gefunden.  
Schluss.
linamoti@lina-moti-desktop ~/Downloads/AndroidonSD/cupcake-sd $ ls -a
.  ..  .repo
linamoti@lina-moti-desktop ~/Downloads/AndroidonSD/cupcake-sd/.repo $ ls -a
.  ..  manifests  manifests.git  manifest.xml  repo

any idea what I am doing wrong?

Original comment by robin.se...@biologie.uni-freiburg.de on 6 Nov 2010 at 1:22

GoogleCodeExporter commented 9 years ago
Yepp, your problem should be solved quite easily...

Just go your cupcake-sd dir and type:
repo sync 

Then get yourself a cup of coffee, that's going to take a while.
This will get you the last sources (repo init just prepares the directory for 
the git repos...).

Now you are ready to compile cupcake-sd.

Have a lot of fun!

Original comment by gamble...@gmx.de on 6 Nov 2010 at 1:31

GoogleCodeExporter commented 9 years ago
Sorry, but I still have problems.
I attached the a log file of how the installation process terminated.
the last line before it dies is:
make: *** 
[out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/gr_iface.o] 
Fehler 1

thanks a lot for the help

Original comment by robin.se...@biologie.uni-freiburg.de on 9 Nov 2010 at 4:41

GoogleCodeExporter commented 9 years ago
Robin,

The error you have is not related to the SD branch or patches. It appears to me 
your build environment has not been configured correctly. I suggest we continue 
the discussion for getting your system configured correctly on the mailinglist.

Please post your message on the ML and we'll take it from there.

Niels.

Original comment by niels.he...@gmail.com on 10 Nov 2010 at 10:02