Leandro Dorileo

Dorileo`s web place

You may want to migrante a rails database from a given dbms to another.

Perhaps you started configuring a third-party product built with rails, after sometime you discovered you’ve configured everything and now want to set it up for production environment but, you played initially with sqlite and your production environment runs with mysql. Well you got the idea.

The idea is to use yaml_db, dump from production, configure you test profile env. and load it into. yaml_db is simple plugin, it’s git repo is here: git://github.com/adamwiggins/yaml_db.git

Dumping:

rake db:dump RAILS_ENV=production

Loading:

rake db:load RAILS_ENV=test

Here you find a tutorial teaching step-by-step.


There`s a getpass module that takes care about currently logged user.

import getpass
print getpass.getuser()

getuser() will return of the user.here you can read more about.

Sometimes we need to know(or are curious about) the files installed on you system by a specific package. On Debian systens we do:

dpkg -L <package name>

But for Fedora we can`t find the same feature by default, it`s needed an additional package to help on it, lets see:

yum install yum-utils

yum-utils brings some utilities to help manage installed packages, to accomplish our initial goals we ought use repoquery:

repoquery --list <package name>

I found these photos on flickr, people hacking coreboot. Coreboot Summit - Denver, 2008.

My table arrangement was inspired by some photos from this set. A cut basket with motherboard over it and the power supplier under. Of course my setup is a bit more organized than the the people`s in Denver(well it was a Summit).

ps: this is also a “note to myself” since I may want to show these photos to someone else;

If you want to change your remote repository to point to some arbitrary commit you cold do the following:

1
git push -f origin sha1:branchname

But be careful, you may break someone else`s repository in the case it has being fetched or cloned by someone.

Many people has bloged and written about launchpad release, I would like to be part of the crowd.

Canonical released launchpad source code.

now back to work :D

Well, if you`re using display:table you certainly will face some day a situation where you need to verify/test some attribute in the current register to show or not something(maybe a different situation but you need to verify something).

The fact is, display:table will set an attribute in the PageContext, this attribute name will be based on uid or id(the main difference between uid and id is backward compatibility).

With that(say) you`ve set the id attribute of display:table to row. Verifying an attribute in the current row is as easy as using the #attr.row.

For example:

   <display:table id="row" ...
      <s:if test="#attr.row.you_attribute == 12">
      [....]

That`s it, best luck.

Another monday and I need to write a gsoc-update. It`s two weeks after my last update, I coulnd`t write an update last week since I hadn`t a good progress.

I suppose every body could notice the problems based on the emails I sent to the project`s mentors. I faced problems to run coreboot on my real hardware.

One week later - now - I run coreboot successfully on a real hardware. To express the happenings a bit better I need to tell a kind of story.

  • Flashed coreboot but didn`t get any vga output(did everything correctly but no vga output - now I understand I was doing all right, but wasn`t sure that time);
  • Couldn`t understand why no vga output, went to IRC and asked some questions, some one told me I needed a video rom prepended to my coreboot final image;
  • Asked Jason if he used to prepend a video rom and he confirmed, in that time I thought I should do the same;
  • Reading the coreboot wiki I learnt how to extract a video rom, not hard, but started to try to prepend it to coreboot;
  • I couldn`t understand the semantics behind ROM_SIZE, ROM_IMAGE_SIZE and few other configurations, started to test many combinations. needed to learn and understand how the many ways to build a coreboot image work;
  • Went to source code of buildrom to understand what and how it does, learned it just merges coreboot and the payload;
  • Learnt there`s no reason to have a coreboot image without a payload, so don`t even try to have a coreboot image without a payload, it doesn`t make any sense;
  • Learnt I can use cbfs to build the coreboot image, but not every targets uses it, discovered a bug on cbfstool but didn`t get the chance and time to dig on it;
  • After many tries I understood I couldn`t make any progress without a serial cable and a serial console set up, went to buy a cable and after some time I could see coreboot was being loaded but no vga output;
  • Noticed whatever payload I used it wasn`t being loaded
  • Felt weird the output on my serial console and asked Carl-Daniel to take a look, after some time trying to discover the problem Uwe Hermann appeared on IRC, he asked me if I installed my single memory module on DIMM_B1 slot;
  • I felt it so obvious, and didn`t think this could be my problem once the Award Bios was running properly;
  • Moved the memory module from DIMM_B2 to DIMM_B1 and immediately the payload was loaded and I could see vga output;
  • Uwe Hermann told me I didn`t need to prepend a vga rom to coreboot since my motherboard doesn`t have an onboard vga(in that time I wasn`t even prepending the vga rom I extracted any more, I was watching the serial outputs);
  • With Uwe Hermann help I understood I really didn`t need a vga rom
  • My real problem was a memory module installed in the wrong slot;

I need to be sure of things, so I kept asking people if I was doing the correct thing, if the way I was building coreboot was right, now I can be sure, I was even doing the right thing.

It`s not good to spend so much time on it but I learnt a lot in the process. Thank you everybody who helped me, I appreciate so much your help.

Introduction

The GSoC 2009 has officially started on May 23rd and I haven`t made any update since May 18th when I stated my hardware lacking. I finally got a functional development environment by around June 2nd(last week) when my backup LPC chip arrived to Cuiabá(my living town).

It`s a little difficult to buy some hardwares(specially some old age ones) here in my city. The only hardware I could purchase here was the processor and DDR400 memory. I had to wait about 7-10 days for the other hardwares. I also had funds problems(I didn`t have the whole money to buy everything at once). Now the PCI USB expansion card is the only lacking hardware, but I don`t think it`s blocking the project but I can buy it in the coming days.

Tasks and Code

Few things to point:

  • Option Rom Assembly Link Code:
    I`m using the source code from Darmawan, Jason has also used that. Stefan has mentioned some licensing issues, he said he would ask Darmawan to register his source code to some coreboot compatible license since we may want vendors to include the option ROM in their motherboards. Stefan also said about using his option ROM source code instead. With that I started to work with Stefan`s source code to make it work(I couldn`t run it). Jason may take it over since he`s responsible to the option ROM initialization code and assembly bits.
  • libpayload linking:
    The makefile I`ve copied/modified from FILO source base is theoretically linking the option ROM to libpayload but I couln`t call any function from libpayload yet. I`ve not spent too much time on it, I can fix it in the next days. Jason has faced this problem as well. I used FILO to complete the tests I wanted to do with libpayload API since it`s been successfully linked to libpayload.
  • bootable USB preparation:
    I worked few ours last week to prepare a bootable USB stick.

Comunication and Repos

I`ll keep posting the updates on my blog, I have a dedicated category to that, you can follow that for updates, I`ll not stop mailing all the mentors but a simple mail stating an update will be sent every week.

I would like to remember you that we(Jason and I) have used repositories on my server for hosting the source code we produce.

Update: Jason has just told me he`s rewriting the ldscript we`ve got from Darmawan. So we`ll not need to care about the licensing issues any more.