Sep 23, 2012

Setup poky development environment

The following is to setup development environment for working on poky project.
1) Setup a working directory
mkdir data/poky -p

2) Check out the poky source code
cd data/poky
git init
git remote add yocto git://git.yoctoproject.org/poky.git
git remote update
git branch -b denzil yocto/denzil

3) Check out meta-intel for BSP developmen
mkdir data/poky/meta-intel -p
cd data/poky/meta-intel
git init
git remote add meta-intel git://git.yoctoproject.org/meta-intel.git
git remote update
git branch -b denzil meta-intel/denzil

4) Checkout poky-extras for kernel development
mkdir data/poky/poky-extras -p
cd data/poky/poky-extras
git init
git remote add poky-extras git://git.yoctoproject.org/poky-extras
git remote update
git checkout -b denzil poky-extras/denzil

5) Clone the kernel source code
cd data
git clone --bare git://git.yoctoproject.org/linux-yocto-3.2 linux-yocto-3.2.git

6) Then clone a local copy to make change on that kernel
git clone linux-yocto-3.2.git my-linux-yocto-3.2-work

6) Now we can start a yocto build and development. The layout should be
 [hieult@hieuletrung data]$ tree -L 2
.
├── linux-yocto-3.2.git
│   ├── branches
│   ├── config
│   ├── description
│   ├── HEAD
│   ├── hooks
│   ├── info
│   ├── objects
│   ├── packed-refs
│   └── refs
├── my-linux-yocto-3.2-work
│   ├── arch
│   ├── block
│   ├── COPYING
│   ├── CREDITS
│   ├── crypto
│   ├── Documentation
│   ├── drivers
│   ├── firmware
│   ├── fs
│   ├── include
│   ├── init
│   ├── ipc
│   ├── Kbuild
│   ├── Kconfig
│   ├── kernel
│   ├── lib
│   ├── MAINTAINERS
│   ├── Makefile
│   ├── mm
│   ├── net
│   ├── README
│   ├── REPORTING-BUGS
│   ├── samples
│   ├── scripts
│   ├── security
│   ├── sound
│   ├── tools
│   ├── usr
│   └── virt
└── poky
    ├── bitbake
    ├── documentation
    ├── LICENSE
    ├── meta
    ├── meta-demoapps
    ├── meta-hob
    ├── meta-intel
    ├── meta-skeleton
    ├── meta-yocto
    ├── oe-init-build-env
    ├── poky-extras
    ├── README
    ├── README.hardware
    └── scripts


URL:

Aug 4, 2012

Ubuntu 12.04 NVIDIA 6 screens issue

If you've installed Ubuntu 12.04 and has 6 screens issue on nvidia geforce card, follow this guideline http://ubuntuforums.org/showthread.php?t=1967161&page=2 to fix the issue

It works for me on Geforce G210M

Jan 30, 2012

What motivate me?

Working in GCS for many years, I found some facts about GCSers at the moment. When you first join GCS
  • You don't know what should you do, still being with the university mindset or previous company.
  • Be assigned into a project and keep working daily.
  • You found that when you need to submit leave form go to QMS and only for leave form.
  • You don't know the requirement for your current role (i.e. Engineer). - If you know that it's still very ambiguous because it's not example specific and there's no mapping into your daily work.
  • CP4 is something really interested but HOW can you do that?
  • What motivate you to do good job? Salary?
  • Yes, everything is very confuse and you'll need a good leader to guide you :)

I think to solve this:
  • When a person first join GCS, we should have someone describe on their current role, the requirement for that role, who is his/her mentor, who will he/she report to, list of tools/resources that available to his/her job (Wiki?).
  • If he/she joins a project, the project should have a Getting Start Wiki so that everyone can know where to go and what should they do in project.

There's an issue with current EMB hiring model, that the new hired resource might not join a project but for a resource pool. For this we might think about R&D project, I think we should create an "Open Source department" so that,
  • we improve open-source project which is mostly used by us i.e. Android, Beagleboard, or some other open-source libraries...
  • the employee join this model can gain knowledge on specific library which can help him in his future work
For senior engineer, with current development environment inside GCS, we currently don't have a correct model/workflow yet so
  • if we developed on, we should collect all senior and teach them that new workflow so that they can follow up like orientation for new employee.
  • they've long lived so mindset might different from new one, motivation might be missing already :)
  • ask them HOW!
  • re-evaluate their skill so that we can match them with new model.

Is it true for you and your current work?

Jan 25, 2012

OLPC on QEMU

Follow this guideline http://wiki.sugarlabs.org/go/QEMU

If it's not clear, here is it.
  1. Install qemu: yum install qemu
  2. Create a disk image: qemu-image create olpc.img
  3. Download School Server (XS) iso: wget http://xs-dev.laptop.org/xs/OLPC_XS_LATEST.iso
  4. Start qemu and install XS: qemu -hda olpc.img -cdrom OLPC_XS_LATEST.iso -m 512

Linaro development on Fedora

Linaro currently mostly works on Ubuntu as its guideline. Here is some tips, not so much, for working on Fedora with Linaro

Follow this https://wiki.linaro.org/Platform/Android/Toolchain if you're working with Android

or a build from scratch https://wiki.linaro.org/WorkingGroups/ToolChain/Using/GCCNative

Or this https://wiki.linaro.org/WorkingGroups/ToolChain/Using/CrosstoolNg if you want a stand-alone toolchain that can be worked on other platform

Then you can use the toolchain to build the kernel, rootfs i.e. http://www.linaro.org/linaro-blog/2011/09/15/building-a-linaro-android-build-from-source/

Why don't we integrate it into Yocto or buildroot? Hmmm...

BTW, the linaro-image-tools didn't work with Python 2.5 ;-(

Jan 24, 2012

NULL vs. 0

 char * p = 0; /* IS WRONG! DAMMIT! */
 int i = NULL; /* THIS IS WRONG TOO! */
and anybody who writes code like the above either needs to get out of the kernel, or needs to get transported to the 21st century.

NULL is a pointer, while 0 can never be.

LOL :-)

Jan 18, 2012

Tet 2012

Tet holiday is coming here, what should I do?
  1. Read a book
  2. Find a project to contribute: OLPC, clutter, openkinect, glib, gtk, ...
  3. Continue with beagleboard
  4. Continue with CUDA
  5. Doing work for GCS
  6. xxx
Hmmmmmmmmm...let see

Jan 10, 2012

Valgrind XYZ

To understand how things work, this is how valgrind starts up:

  - The valgrind launcher (/usr/bin/valgrind) is run.
  - The launcher decides which tool you want execs it to
    replace the launcher.
  - The tool binary loads at a high address then acts as
    an ELF loader and loads the target program into the
    same process, using LD_PRELOAD to try and inject a
    small amount of code into it.

 
Run "ld --verbose" to see the default linker script, and note the line
   . = 0x08048000 + SIZEOF_HEADERS;
This is the problem.  ld estimates SIZEOF_HEADERS, and sometimes guesses
low by 1 Elf32_Phdr (or by 2 in extremely rare cases).  A workaround is
to capture the default linker script "ld --verbose >script.lds", delete
the header and trailer lines [delimited by '====='], change the initial
address to ". = 0x08048000 + 52 + 8*32;" where 52 is sizeof(Elf32_Ehdr)
and 32 is sizeof(Elf32_Phdr), then use the resulting script to replace 
the default: "ld -T script.lds ..."
 
 
http://plash.beasts.org/wiki/Story16Notes 
 
Here are some things to do:
o Study the info pages that come with ld.
  See ld.info, Node: Builtin Functions, SIZEOF_HEADERS. 
o Compare the elf linker scripts (probably in
  /usr/i486-suse-linux/lib/ldscripts/ on your system) against standard
  ones.  eg. from ftp.varesearch.com/pub/support/hjl/binutils/  If they
  are different, try the standard scripts.
o Delete SIZEOF_HEADERS from your linker script, and replace with a fixed
  number.  Try 1024.
o If all this fails, post a bug report to binutils@sourceware.cygnus.com
 

Jan 2, 2012

Strength of a workplace

Is it true when the "First, Break all the rules" said that, a strength of a workplace can be inside 12 following questions
  1. Do I know what is expected of me at work?
  2. Do I have the materials and equipment I need to do my work right?
  3. At work, do I have opportunity to do what I do best every day?
  4. In the last seven days, have I received recognition or praise for doing good work?
  5. Does my supervisor, or someone at work, seem to care about me as a person?
  6. Is there someone at work who encourages my development?
  7. At work, do my opinions seem to count?
  8. Does the mission/purpose of my company make me feel my job is important?
  9. Are my co-workers committed to doing quality work?
  10. Do I have a best friend at work?
  11. In the last six months, has someone at work talked to me about my progress?
  12. This last year, have I had opportunities at work to learn and grow?
Hmm, nothing about benefits or salary...is it true for my current company, GCS? Maybe there's something to think about...