yucemahmut / android-on-freerunner

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

Fix the freerunner_platform_installer branch #154

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Those steps are required to fix the installer branch:
1) Go to busybox/busybox
 1a) make menuconfig
      BusyBox Settings -> Build Options -> Build BusyBox as static binary (CONFIG_STATIC=y)
         maybe configure other things to reduce size
2) Download Koolu.mk to busybox/Koolu.mk
3) prepare build environment and build installer branch
4) check root/bin:
 4a) file root/bin/busybox should give something like (watch for ARM+statically linked)
        ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked (uses shared libs), for GNU/Linux 2.6.14, stripped
  4b)symlinks to busybox should have been created
5) Test Kernel by replacing uImages in an older daily installer.

My Problems so far: make tells me it uses defaults from .config but does not 
(get dynamically linked busybox)

Original issue reported on code.google.com by sebkuem...@gmail.com on 6 Sep 2010 at 12:41

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
fixed a typo in Koolu.mk

Original comment by sebkuem...@gmail.com on 6 Sep 2010 at 12:54

Attachments:

GoogleCodeExporter commented 9 years ago
hardcoded static linking in LDFLAGS, but still does not seem to read .config

Original comment by sebkuem...@gmail.com on 6 Sep 2010 at 1:11

Attachments:

GoogleCodeExporter commented 9 years ago
ok, seems it DOES read .config, somehow just didn't statically link

Original comment by sebkuem...@gmail.com on 6 Sep 2010 at 1:21

GoogleCodeExporter commented 9 years ago
here a diff

Original comment by sebkuem...@gmail.com on 6 Sep 2010 at 3:42

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Sebkuemmel,

Thanks for all the digging.

A few questions:

- I also did a make menuconfig, but did not change anyhting. Just executing the 
menuconfig allowed further compilation. So is the static binary option 
(CONFIG_STATIC=y) really necessary?

- I changed the ARCH variable in the Koolu.mk to be equal to "arm" and modified 
the HOSTGCC and HOSTG++ variable to have the same values like we need for 
building Cupcake or Master. Wouldn't this be required too?

Thanks clarifying.

Niels.

Original comment by niels.he...@gmail.com on 7 Sep 2010 at 1:28

GoogleCodeExporter commented 9 years ago
We can indeed minimize the size of busybox by taking out some features we do 
not need using the config. I included the CONFIG_STATIC=y via command line 
argument -static in LDFLAGS. Linking busybox dynamically will require the 
libraries to be put into initramfs to make it work.

We should set HOSTGCC and HOSTG++ in the Makefile to pass it to all parts used 
by the installer (kernel, bb, mtd) rather than setting it just for busybox. 
Would be a good time to exchange the Kernel in the installer (not that much 
work i guess?) to only maintain one .29 kernel throughout the project (Ticket 
#152).

Original comment by sebkuem...@gmail.com on 7 Sep 2010 at 5:22

GoogleCodeExporter commented 9 years ago
Hi Sebkuemmel,

Doing a git apply --check I got a warning for trailing white spaces on line 315.

Can clean up your patch?

In addition, when trying to build the installer branch with your patch, I get 
the  error below. This has to do with the openembedded toolchain. By adding the 
/usr/local/openmoko/arm/bin directory to $PATH, the installer branch compiled.

But I find it strange i need to do this, since I don't need to for any other 
part of AoF. This points me to line 10 in your patch. It assumes you executed 
the setup-env from the toolchain. Can you change line 10 to just point to 
/usr/local/openmoko instead of using OMTOOL_DIR? Or are you assuming other 
parts of variables and flags are already set by setup-env?

When executing root/bin/busybox I get:

BusyBox v1.13.3 (Ubuntu 1:1.13.3-1ubuntu11) multi-call binary

I guess this is not good...

Niels.

--

/nhv/aof_installer/busybox/busybox/scripts/gcc-version.sh: line 11: 
arm-angstrom-linux-gnueabi-gcc: command not found
/nhv/aof_installer/busybox/busybox/scripts/gcc-version.sh: line 11: 
arm-angstrom-linux-gnueabi-gcc: command not found
applets/usage.c: In function ‘main’:
applets/usage.c:16: warning: ignoring return value of ‘write’, declared 
with attribute warn_unused_result
/bin/sh: arm-angstrom-linux-gnueabi-gcc: not found

Original comment by niels.he...@gmail.com on 7 Sep 2010 at 8:57

GoogleCodeExporter commented 9 years ago
/usr/local/openmoko instead of using OMTOOL_DIR.
Yes. Seems the rest of the installers Makefiles do it, too.

BusyBox v1.13.3 (Ubuntu 1:1.13.3-1ubuntu11) multi-call binary
this is the current lucid busybox - maybe the system executed its own version. 
Try a `file root/bin/busybox` to get infos about your binary. It should be 
compiled for arm and be version 1.10.2

---

The error seems to be produced by the $(OMTOOL_DIR) not being defined.

----

I didn't adjust the busybox-makefiles (Maybe we should do this after upgrading 
busybox?). By doing so it would be possible to bring the buildprocess in line 
with the rest of the installer (compiled objects go to out/busybox)

---
---

Created a new patch which has the flaws fixed, also invokes make clean for the 
busybox output correctly when cleaning the rest of the installer which was 
missing in the first version.
Worked without setting up a special environment here.

Original comment by sebkuem...@gmail.com on 8 Sep 2010 at 2:31

Attachments:

GoogleCodeExporter commented 9 years ago
Good stuff:

git apply --check patchv2-> OK
git apply patchv2 -> OK
make clean -> OK
make -> OK (entire installer branch now compiles all parts correctly from 
scratch: bootloader, busybox, kernel and mtd)

file root/bin/busybox -> ELF 32-bit LSB executable, ARM, version 1 (SYSV), 
statically linked, for GNU/Linux 2.6.14, stripped -> OK

As far as I'm concerned this patch can be applied to the installer branch.

Jim, can you review the patch and apply it to the installer branch when OK for 
you?

Thanks.

Sebkuemmel, as to the other points mentioned: fixing the busybox output 
location and/or updating the busybox version, we can make that happen in a 
separate issue.

Original comment by niels.he...@gmail.com on 8 Sep 2010 at 7:47

GoogleCodeExporter commented 9 years ago
Patch applied and pushed

Original comment by scarhill on 11 Sep 2010 at 2:09

GoogleCodeExporter commented 9 years ago
I tried a clean sync of the installer branch and don't get the Koolu.mk in the 
busybox directory.

serdar@serdar-dere:~/installer$ ls -l
total 24
-r--r--r--  1 serdar serdar  686 Sep 23 22:46 Makefile
drwxr-xr-x  6 serdar serdar 4096 Sep 23 22:46 bootloader
drwxr-xr-x  4 serdar serdar 4096 Sep 23 22:46 busybox
drwxr-xr-x  4 serdar serdar 4096 Sep 23 22:46 installer
drwxr-xr-x 23 serdar serdar 4096 Sep 23 22:46 kernel
drwxr-xr-x  4 serdar serdar 4096 Sep 23 22:47 mtd-utils
serdar@serdar-dere:~/installer$ ls -l busybox/
total 4
-rw-r--r--  1 serdar serdar    0 Sep 23 22:46 MODULE_LICENSE_GPL
drwxr-xr-x 30 serdar serdar 4096 Sep 23 22:46 busybox

Greetings Serdar

Original comment by seder...@googlemail.com on 23 Sep 2010 at 9:36

GoogleCodeExporter commented 9 years ago
Oops, looks like I didn't push the commits. Give it another try now.

Original comment by scarhill on 24 Sep 2010 at 2:05