Tuesday, June 30, 2009

Friendship

Want a friend, have a friend,
make a friend, buy a friend.
What's a friend worth these days?

Have you ever felt that you weren't doing friendship correctly?
I do. There's something about friendship I just don't get.

Why is it that I find no pleasure in friendship?

Saturday, June 27, 2009

Linux From Scratch

Last year I successfully built a Linux from scratch system by following the book. The date was April 24th and it took roughly 3 days to complete. I remember the process being relatively laborious. The system is only for those whom want to see how it all fits together.

I haven't touched it since then. Only off and on doing some research into boot disks, root disks, loopback devices, etc. What is interesting to me is the differences between ISOLINUX and my LFS system. I'm intrigued at how a LiveCD can give you roughly the same thing without the "installation" process as a normal distribution. Why install (30 minutes or so) when you can copy? Maybe it takes the same amount of time ... but anyway, it's for the learning experience.

From the grub command:

grub> root (hd0,3)
grub> kernel /boot/isolinux/linux root=iso:/dev/hda4:/root/lfslivecd-x86-6.3-r2160.iso rootfstype=ext2
grub> initrd /boot/isolinux/initramfs_data.cpio.gz
grub> boot

From this command the kernel is loaded into memory, the kernel mounts the initial RAM disk and finally the initial RAM disk performs a pivot root and mounts the ISO image as root and eventually provides you with a terminal. Fascinating. Generally my description is correct but there are gaps in my understanding.

Here is some of the information I've gathered from the process.

1. The second part of the kernel command (grub command), i.e. root=iso: ...
is passed to the kernel to load as a boot parameter. In other words after the kernel is loaded it will look to this boot parameter in which to mount the root filesystem.
2. But the initrd is loaded first as a preliminary root filesystem.
3. Somehow the kernel and the initrd work in tandem to know what to do with the boot parameter that I listed at #1.

How #3 happens I don't know. Reason being is that I've replaced the root=iso: ... part with a simple root filesystem on disk (instead of the ISO). It doesn't work.
Why? What is compiled in the linux kernel from the LFS disk that won't allow it to accept a regular uncompressed root filesystem on disk? What make an ISOLINUX unique from a regular compiled Linux kernel? What does the ISOLINUX kernel have to do with with the ISO9660 El Torito file system?

Maybe I just answered my own question. ISOLINUX kernel understands the El Torito (CD ROM) filesystem. So it knows how to mount the ISO image. Whereas a normal root filesystem is an EXT2 filesystem. In order for our generic ISOLINUX kernel to mount an EXT2 filesystem we would have to tell the init RAM disk how to install the kernel module in order to finally mount the root filesystem.

Once I figure out how to install modules from the init RAM disk environment I will be able to run a generic kernel from anywhere, everywhere I go.

The goal for me is to build a Linux Live USB. And not merely following the instructions provided by a website.

Monday, June 8, 2009

Home repair

I don't know anything about home repair. It's one of those things, that if your lucky, your dad will teach you. My father wasn't so lucky as he grew up in trying times, left home at an early age, and got lucky by making his way to Canada to start a new life.

Well my dad isn't really a handy guy. And neither am I. My father like my grandfather were both readers. Like father like son, I'm a reader too preferring theory over practice, concepts over tools.

On Victoria Day (May 18, 2009), my mom called me down to help outside on the walkway leading to my backyard. My mom and my neighbour have been talking about getting rid of a fence that separated our 2 yards. The fence was put up like 10 years ago. Since then the fence has been warped due to the build up of dirt/sand/gravel on my neighbours side placing alot of pressure on the fence. On Monday I helped remove the planks of the destroyed wooden fence into a van to be disposed of. Byron, a neighbourhood handyman, was hired to do the work. I helped lighten the load.

It was pretty cool. It wasn't just cleaning up the bits. They also wanted to repair the walkway leading to our backyard. I've laid paving stones at the tennis club before (a part-time job that I had throughout my high-school and University days), but I never witnessed destroying something so close to a building. The walkway was made of concrete not slabs of paving stones. It was 4 inches thick and it was almost a single piece. Byron bashed away at it for a good hour (on different sections of the walkway). It was fascinating watching him break it apart because as he was striking the concrete with his sledgehammer (5 lbs.) you could see the house shake!!
It gave me a feeling that my life wasn't really that secure and that one good blow could blow my house down (both literally and figuratively). I realized I need to learn some of these things.



The walkway was dug up from the foreground all the way to the recycle bin (background). It was really falling apart (the walkway) at the foot of this picture.

The backyard is full of piles of rubble.

It was a good time to clean up this mess. When I was a kid the side of our neighbours house (pink siding) was not there. Our neighbour was a Portuguese couple that kept a pigeon coop above a shed. We could hear the cooing of the pigeons every morning as they were being fed. We had a metal fence where pink siding sits now. On both sides of the walkway my mom used to grow vegetables like 冬瓜 and 葱. Our neighbourhood is a nice place to live (if you can afford it).
Posted by Den - 張恩華 at 6:48 PM