Skip to content

phpStorm IDE review

I’ve used phpStorm for sometime now. I’ve adopted it for FusionPBX under an opensource license in 2012 and I just don’t want to use anything else.
phpStorm is:

    • Fast.
    • Feature rich.
    • Intuitive.

phpStorm has also a very nice auto-complete/suggestion feature.

I’m a vim guy and I do still use it sometimes, but when the codebase starts to grow I usually switch myself to phpStorm very quickly. I don’t feel the need to experiment other IDE at all. The only thing that makes me switch to vim sometimes is it’s powerful regex support. Besides that everything is great.

I also use phpStorm for Lua programming using the lua plugin which is also very nice and overall I think it has everything I usually need.

Productivity has also increased after the switch to phpStorm. All the other PHP/web IDEs that I’ve tried in the last years, say: Aptana, Eclipse And NetBeans might be good, but in the end phpStorm is just better.

Some of the most appreciated features are:

  • enforcement of up to date PHP development practices
  • flexibility
  • fast search
  • easy to use debugger
  • easy to build feature
  • terminal
  • plugin support
  • GIT support.

Just give it a try.

Recursive Find and Replace in Linux

Hello people!
I’ve once again needed to do a recursive find and replace to replace all memcpy in ffmpeg source for memmove since there’s a bug about the optimizations done with memcpy in x86_64 archs.
I thought this tip could be helpfull to others to in future. So here it is, how you can do it too:

find ./ -type f | xargs sed -i 's/string1/string2/g'

And that’s all folks! 😉

DisplayLink on Fedora Linux

I had the opportunity to recently try one of the DisplayLink’s USB 2.0 graphics adapter. This one is supposedly a DL-165 but was bought on eBay as a “USB 2.0 to VGA DVI HDMI Multi-Display Graphic Adapter” for about 35EUR. Its purpose will be the projection of presentations and other e-learning materials in a school by a teacher. It’s a USB to DVI graphics adapter which comes with 2 adapters:

  • 1 x DVI to VGA
  • 1 x DVI to HDMI

     

Linux says it’s a DisplayLink SUNWEIT USB Display Adapter see bellow:

[  122.227846] usb 2-1.3: New USB device found, idVendor=17e9, idProduct=024c
[  122.227853] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  122.227858] usb 2-1.3: Product: SUNWEIT USB Display
[  122.227862] usb 2-1.3: Manufacturer: DisplayLink
[  122.227866] usb 2-1.3: SerialNumber: 00000000-000794

I had several problems to put this to work under Linux as you will see next. I’ve googled around to look for setup instructions and found that starting from kernel 2.6.38 the udlfb driver which drives diplaylink devices under linux has been moved from staging to main kernel tree.
However the latest udlfb driver can also be obtained from here and the latest displaylink X.org driver can be pulled from here.

Now the setup procedure:

  1. I’ve decided to recompile kernel 3.0.4 in order to include udlfb (see my previous post on how to compile your custom vanilla kernel if you need directions here).
  2. I’ve found out somewhere, maybe here that after udlfb driver is correctly installed in your system you should get a green display, so after recompiling kernel 3.0.4 to include udlfb driver i’ve plugged the usb cable and have immediately gotten my green display as seen bellow.
  3. When you get your green screen you will also find a new device under /dev/fb1 see dmesg log bellow
    [ 9937.250452] udlfb: DisplayLink USB device /dev/fb1 attached. 800x600 resolution. Using 1880K framebuffer memory
    [ 9937.250501] usbcore: registered new interface driver udlfb
    
  4. The next step should be compiling the displaylink X.org driver. Start by cloning xf-video-udlfb git repo:
    git clone http://git.plugable.com/webdav/xf-video-udlfb
    cd xf-video-udlfb
    ./configure
    make && make install

    When done you will have two new files under /usr/local/lib/xorg/modules/drivers/

    [root@dell udlfb]# ls -l /usr/local/lib/xorg/modules/drivers/
    total 160
    -rwxr-xr-x 1 root root    993 Sep 19 00:56 displaylink_drv.la
    -rwxr-xr-x 1 root root 157291 Sep 19 00:56 displaylink_drv.so
    
  5. link displaylink_drv.so to /usr/lib64/xorg/modules/drivers/ if under x86_64 arch or /usr/lib/xorg/modules/drivers/ if i386 arch.
    ln -s /usr/local/lib/xorg/modules/drivers/displaylink_drv.so /usr/lib64/xorg/modules/drivers/

    or

    ln -s /usr/local/lib/xorg/modules/drivers/displaylink_drv.so /usr/lib/xorg/modules/drivers/

    You are done for now.

  6. Now it’s time to tailor a custom xorg.conf file for use. Recent Linux distros don’t come with a /etc/X11/xorg.conf file anymore so to generate a starting point issue the following command:
    X -configure

    you will maybe need to change to runlevel 3 to run the previous command successfully, you can do that by running init 3 as root.
    This command will create a xorg.conf.new as a basic starting point. Start by editing it to feet your needs. Remember that the displaylink monitor needs to be primary starting at:

    X.pos 0
    Y.pos 0

    take a look into xorg.conf manual

    man xorg.conf

    to learn more about xorg.conf’s options. You can also look at xf-video-udlfb README file you got previously.
    Bellow you can see how my xorg.conf file become after some tailoring:

    Section "ServerLayout"
    	Identifier     "X.org Configured"
    	Screen      0  "Screen1" 0 0
    	Screen      1  "Screen0" 1024 0
    	InputDevice    "Mouse0" "CorePointer"
    	InputDevice    "Keyboard0" "CoreKeyboard"
    	Option		"Xinerama" "On"
    EndSection
    
    Section "Extensions"
        Option "Composite" "Enable"
    EndSection
    
    Section "Files"
    	ModulePath   "/usr/lib64/xorg/modules"
    	FontPath     "catalogue:/etc/X11/fontpath.d"
    	FontPath     "built-ins"
    EndSection
    
    Section "InputDevice"
    	Identifier  "Keyboard0"
    	Driver      "kbd"
    EndSection
    
    Section "InputDevice"
    	Identifier  "Mouse0"
    	Driver      "mouse"
    	Option	    "Protocol" "auto"
    	Option	    "Device" "/dev/input/mice"
    	Option	    "ZAxisMapping" "4 5 6 7"
    EndSection
    
    Section "Monitor"
    	Identifier   "Monitor0"
    	Option	     "Primary" "true"
    EndSection
    
    Section "Monitor"
    	#DisplaySize 304 228 # mm
    	Identifier "Monitor1"
    	VendorName "SNY"
    	ModelName "SDM-HS53"
    	Option "DPMS"
    	# 1024x768 @ 75.10 Hz (GTF) hsync: 60.23 kHz; pclk: 81.91 MHz
    	Modeline "1024x768_75.10"  81.91  1024 1080 1192 1360  768 769 772 802  -HSync +Vsync
    	Option	     "Primary" "false"
    EndSection
    
    Section "Device"
    	Identifier  "Card0"
    	Driver      "intel"
    	BusID       "PCI:0:2:0"
    EndSection
    
    Section "Device"
    	Identifier  "Card1"
    	Driver      "displaylink"
    	Option "fbdev" "/dev/fb1"
    EndSection
    
    Section "Screen"
    	Identifier "Screen0"
    	Device     "Card0"
    	Monitor    "Monitor0"
    	DefaultDepth 16
    	SubSection "Display"
    		Depth     1
    		Modes     "1440x900"
    	EndSubSection
    	SubSection "Display"
    		Depth     4
    		Modes     "1440x900"
    	EndSubSection
    	SubSection "Display"
    		Depth     8
    		Modes     "1440x900"
    	EndSubSection
    	SubSection "Display"
    		Depth     15
    		Modes     "1440x900"
    	EndSubSection
    	SubSection "Display"
    		Depth     16
    		Modes     "1440x900"
    	EndSubSection
    	SubSection "Display"
    		Depth     24
    		Modes     "1440x900"
    	EndSubSection
    EndSection
    
    Section "Screen"
    	Identifier "Screen1"
    	Device     "Card1"
    	Monitor    "Monitor1"
    	DefaultDepth 16
    	SubSection "Display"
    		Depth     1
    		Modes	  "1024x768_75.10" "1024x768"
    	EndSubSection
    	SubSection "Display"
    		Depth     4
    		Modes	  "1024x768_75.10" "1024x768"
    	EndSubSection
    	SubSection "Display"
    		Depth     8
    		Modes	  "1024x768_75.10" "1024x768"
    	EndSubSection
    	SubSection "Display"
    		Depth     15
    		Modes	  "1024x768_75.10" "1024x768"
    	EndSubSection
    	SubSection "Display"
    		Depth     16
    		Modes	  "1024x768_75.10" "1024x768"
    	EndSubSection
    	SubSection "Display"
    		Depth     24
    		Modes	  "1024x768_75.10" "1024x768"
    	EndSubSection
    EndSection
    

    gtf command can also become handy here

    man gtf
  7. Finally let’s test our setup:
    To do that lets create a new X session, issue the following:

    startx -- :2 -config xorg.conf.new

    If everything went OK you should be now seeing an extended desktop on a new X session with the displaylink monitor set as primary.
    If for some reason this didn’t workout for you, don’t worry you have probably run into some of the issues i have too ;-).
    The rest of this blog post will introduce you to some problems I’ve found and how you can workaround those if you also run into them. You will want to look at /var/log/Xorg.*.log and dmesg logs from time to time to try to understand what’s going on.

Lets now start some debugging

  1. In my case after running
    startx -- :2 -config xorg.conf.new

    i got a segmentation fault WTF? right?
    my log file stated the following

    [   265.190] (--) using VT number 8
    
    [   267.692] (WW) Falling back to old probe method for displaylink
    [   267.692] (II) Loading sub module "fbdevhw"
    [   267.692] (II) LoadModule: "fbdevhw"
    [   267.692] (II) Loading /usr/lib64/xorg/modules/libfbdevhw.so
    [   267.692] (II) Module fbdevhw: vendor="X.Org Foundation"
    [   267.692]    compiled for 1.9.5, module version = 0.0.2
    [   267.692]    ABI class: X.Org Video Driver, version 8.0
    [   267.692] (II) DL(0): using /dev/fb1
    [   267.692] (EE) DL(0): Unknown EDID version 0
    [   267.692] (**) DL(0): Depth 16, (--) framebuffer bpp 16
    [   267.692] (==) DL(0): RGB weight 565
    [   267.692] (==) DL(0): Default visual is TrueColor
    [   267.692] (==) DL(0): Using gamma correction (1.0, 1.0, 1.0)
    [   267.692] (II) DL(0): hardware: udlfb (video memory: 940kB)
    [   267.692] (**) DL(0): Option "fbdev" "/dev/fb1"
    [   267.692] (II) Loading sub module "fb"
    [   267.692] (II) LoadModule: "fb"
    [   267.693] (II) Loading /usr/lib64/xorg/modules/libfb.so
    [   267.693] (II) Module fb: vendor="X.Org Foundation"
    [   267.693]    compiled for 1.9.5, module version = 1.0.0
    [   267.693]    ABI class: X.Org ANSI C Emulation, version 0.4
    [   267.693] (II) DL(0): Output udlfb using monitor section Monitor1
    [   267.693] (**) DL(0): Option "Primary" "false"
    [   267.693] (EE) DL(0): Unknown EDID version 245
    [   267.693] (II) DL(0): EDID for output udlfb
    [   267.693]
    Backtrace:
    [   267.693] 0: /usr/bin/X (xorg_backtrace+0x28) [0x4a0908]
    [   267.694] 1: /usr/bin/X (0x400000+0x60e99) [0x460e99]
    [   267.694] 2: /lib64/libc.so.6 (0x355e200000+0x33140) [0x355e233140]
    [   267.694] 3: /usr/lib64/xorg/modules/drivers/displaylink_drv.so (0x7ff1425d0000+0x382e) [0x7ff1425d382e]
    [   267.694] 4: /usr/bin/X (InitOutput+0x802) [0x470bb2]
    [   267.694] 5: /usr/bin/X (0x400000+0x213cd) [0x4213cd]
    [   267.694] 6: /lib64/libc.so.6 (__libc_start_main+0xfd) [0x355e21ee5d]
    [   267.694] 7: /usr/bin/X (0x400000+0x21129) [0x421129]
    [   267.694] Segmentation fault at address 0x24
    [   267.694]
    Fatal server error:
    [   267.694] Caught signal 11 (Segmentation fault). Server aborting
    

    my problem here was about the EDID. You can learn about EDID here.
    when i’ve looked again into dmesg log i’ve also noticed this particular entry after connecting the displaylink device:

    [  236.494596] udlfb: Unable to get valid EDID from device/display
  2. After some time i found out that this late message was coming from udlfb.c just search for it. It seems that udlfb driver isn’t being able to get the display EDID. As a workaround i’ve connected the monitor to the integrated VGA port on my laptop and ran the following:
    xrandr --prop

    to get myself two 128bit arrays, one for my laptop LCD EDID and a second for the External Monitor connected to the integrated VGA port. Bellow you can see the EDID array for SONY SDM-HS53 Monitor

    EDID:
    		00ffffffffffff004dd9502201010101
    		0b0e01030c1e1778ea8c3ea4584d9124
    		154f51a1080001010101010101010101
    		01010101010164190040410026301888
    		360030e410000018000000fd00393f1c
    		3109000a202020202020000000fc0053
    		444d2d485335330a20202020000000ff
    		00313235333730360a202020202000ce
    

    I’ve also found that fedora provides a set of tools to play with EDIDs. If you are curious and want to try them out issue this:

    yum install monitor-edid

    in the end you can do something like

    xrandr --prop | monitor-parse-edid

    interesting stuff.

  3. As a next step I’ve tailored this hexadecimal array into a C array as follows:
    unsigned char sony_sdmhs53_edid[] = {
    0x00,
    0xff,
    0xff,
    0xff,
    0xff,
    0xff,
    0xff,
    0x00,
    0x4d,
    0xd9,
    0x50,
    0x22,
    0x01,
    0x01,
    0x01,
    0x01,
    0x0b,
    0x0e,
    0x01,
    0x03,
    0x0c,
    0x1e,
    0x17,
    0x78,
    0xea,
    0x8c,
    0x3e,
    0xa4,
    0x58,
    0x4d,
    0x91,
    0x24,
    0x15,
    0x4f,
    0x51,
    0xa1,
    0x08,
    0x00,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x01,
    0x64,
    0x19,
    0x00,
    0x40,
    0x41,
    0x00,
    0x26,
    0x30,
    0x18,
    0x88,
    0x36,
    0x00,
    0x30,
    0xe4,
    0x10,
    0x00,
    0x00,
    0x18,
    0x00,
    0x00,
    0x00,
    0xfd,
    0x00,
    0x39,
    0x3f,
    0x1c,
    0x31,
    0x09,
    0x00,
    0x0a,
    0x20,
    0x20,
    0x20,
    0x20,
    0x20,
    0x20,
    0x00,
    0x00,
    0x00,
    0xfc,
    0x00,
    0x53,
    0x44,
    0x4d,
    0x2d,
    0x48,
    0x53,
    0x35,
    0x33,
    0x0a,
    0x20,
    0x20,
    0x20,
    0x20,
    0x00,
    0x00,
    0x00,
    0xff,
    0x00,
    0x31,
    0x32,
    0x35,
    0x33,
    0x37,
    0x30,
    0x36,
    0x0a,
    0x20,
    0x20,
    0x20,
    0x20,
    0x20,
    0x00,
    0xce,
    };
    

    and added this to udlfb.c

  4. The next step was to hardcode the EDID in udlfb.c since it wasn’t being able to successfully get it dynamically through the USB device.
    Below you can see the changes i’ve made

    Binary files udlfb.git/.git/index and udlfb.new/.git/index differ
    diff -uNrp udlfb.git/.git/logs/HEAD udlfb.new/.git/logs/HEAD
    --- udlfb.git/.git/logs/HEAD	2011-09-23 00:02:10.376129589 +0100
    +++ udlfb.new/.git/logs/HEAD	2011-09-22 04:46:35.000000000 +0100
    @@ -1 +1 @@
    -0000000000000000000000000000000000000000 1811e5c48a29cc925f9b7a49465e06255196a80f Nuno M Reis  1316732530 +0100	clone: from http://git.plugable.com/webdav/udlfb
    +0000000000000000000000000000000000000000 1811e5c48a29cc925f9b7a49465e06255196a80f root  1316663195 +0100	clone: from http://git.plugable.com/webdav/udlfb
    diff -uNrp udlfb.git/.git/logs/refs/heads/master udlfb.new/.git/logs/refs/heads/master
    --- udlfb.git/.git/logs/refs/heads/master	2011-09-23 00:02:10.376129589 +0100
    +++ udlfb.new/.git/logs/refs/heads/master	2011-09-22 04:46:35.000000000 +0100
    @@ -1 +1 @@
    -0000000000000000000000000000000000000000 1811e5c48a29cc925f9b7a49465e06255196a80f Nuno M Reis  1316732530 +0100	clone: from http://git.plugable.com/webdav/udlfb
    +0000000000000000000000000000000000000000 1811e5c48a29cc925f9b7a49465e06255196a80f root  1316663195 +0100	clone: from http://git.plugable.com/webdav/udlfb
    diff -uNrp udlfb.git/udlfb.c udlfb.new/udlfb.c
    --- udlfb.git/udlfb.c	2011-09-23 00:02:10.379129638 +0100
    +++ udlfb.new/udlfb.c	2011-09-22 05:56:36.000000000 +0100
    @@ -75,6 +75,138 @@ static int console = 1; /* Allow fbcon t
     static int fb_defio = 1;  /* Detect mmap writes using page faults */
     static int shadow = 1; /* Optionally disable shadow framebuffer */
     
    +
    +unsigned char sony_sdmhs53_edid[] = {
    +0x00,
    +0xff,
    +0xff,
    +0xff,
    +0xff,
    +0xff,
    +0xff,
    +0x00,
    +0x4d,
    +0xd9,
    +0x50,
    +0x22,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x0b,
    +0x0e,
    +0x01,
    +0x03,
    +0x0c,
    +0x1e,
    +0x17,
    +0x78,
    +0xea,
    +0x8c,
    +0x3e,
    +0xa4,
    +0x58,
    +0x4d,
    +0x91,
    +0x24,
    +0x15,
    +0x4f,
    +0x51,
    +0xa1,
    +0x08,
    +0x00,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x01,
    +0x64,
    +0x19,
    +0x00,
    +0x40,
    +0x41,
    +0x00,
    +0x26,
    +0x30,
    +0x18,
    +0x88,
    +0x36,
    +0x00,
    +0x30,
    +0xe4,
    +0x10,
    +0x00,
    +0x00,
    +0x18,
    +0x00,
    +0x00,
    +0x00,
    +0xfd,
    +0x00,
    +0x39,
    +0x3f,
    +0x1c,
    +0x31,
    +0x09,
    +0x00,
    +0x0a,
    +0x20,
    +0x20,
    +0x20,
    +0x20,
    +0x20,
    +0x20,
    +0x00,
    +0x00,
    +0x00,
    +0xfc,
    +0x00,
    +0x53,
    +0x44,
    +0x4d,
    +0x2d,
    +0x48,
    +0x53,
    +0x35,
    +0x33,
    +0x0a,
    +0x20,
    +0x20,
    +0x20,
    +0x20,
    +0x00,
    +0x00,
    +0x00,
    +0xff,
    +0x00,
    +0x31,
    +0x32,
    +0x35,
    +0x33,
    +0x37,
    +0x30,
    +0x36,
    +0x0a,
    +0x20,
    +0x20,
    +0x20,
    +0x20,
    +0x20,
    +0x00,
    +0xce,
    +};
    +
     /*
      * When building as a separate module against an arbitrary kernel,
      * check on build presence of other kernel modules we have dependencies on.
    @@ -814,6 +946,7 @@ error:
     
     #endif
     
    +/*
     static int dlfb_get_edid(struct dlfb_data *dev, char *edid, int len)
     {
     	int i;
    @@ -841,6 +974,7 @@ static int dlfb_get_edid(struct dlfb_dat
     
     	return i;
     }
    +*/
     
     static int dlfb_ops_ioctl(struct fb_info *info, unsigned int cmd,
     				unsigned long arg)
    @@ -1304,20 +1438,23 @@ static int dlfb_setup_modes(struct dlfb_
     			   struct fb_info *info,
     			   char *default_edid, size_t default_edid_size)
     {
    -	int i;
    +	int i,j;
     	const struct fb_videomode *default_vmode = NULL;
     	int result = 0;
    -	char *edid;
    +	char *edid = NULL;
     	int tries = 3;
     
     	if (info->dev) /* only use mutex if info has been registered */
     		mutex_lock(&info->lock);
    -
    +	
     	edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
     	if (!edid) {
     		result = -ENOMEM;
     		goto error;
     	}
    +	for(j = 0; j < EDID_LENGTH; j++){
    +		edid[j] = sony_sdmhs53_edid[j];
    +	}	
     
     	fb_destroy_modelist(&info->modelist);
     	memset(&info->monspecs, 0, sizeof(info->monspecs));
    @@ -1329,11 +1466,13 @@ static int dlfb_setup_modes(struct dlfb_
     	 */
     	while (tries--) {
     
    -		i = dlfb_get_edid(dev, edid, EDID_LENGTH);
    +		i = 128;
     
    -		if (i >= EDID_LENGTH)
    +		if (i >= EDID_LENGTH){
     			fb_edid_to_monspecs(edid, &info->monspecs);
    -
    +			pr_warn("teste\t%x",edid[8]);
    +			pr_warn("teste\t%x",sony_sdmhs53_edid[8]);
    +		}
     		if (info->monspecs.modedb_len > 0) {
     			dev->edid = edid;
     			dev->edid_size = i;
    @@ -1407,8 +1546,8 @@ static int dlfb_setup_modes(struct dlfb_
     		 * default to resolution safe for projectors
     		 * (since they are most common case without EDID)
     		 */
    -		fb_vmode.xres = 800;
    -		fb_vmode.yres = 600;
    +		fb_vmode.xres = 1024;
    +		fb_vmode.yres = 768;
     		fb_vmode.refresh = 60;
     		default_vmode = fb_find_nearest_mode(&fb_vmode,
     						     &info->modelist);
    

    After applying this changes I’ve get ridden of the message I was getting earlier.

    [  236.494596] udlfb: Unable to get valid EDID from device/display

  5. Let’s go back to step no. 7 above
    startx -- :2 -config xorg.conf.new

    And this time everything worked and i got mayself a new X session running on the displaylink device as primary monitor as seen bellow.

And we are done! 😀
If you intent to use gnome 3 or other 3D features, DisplayLink devices still lack 3D support under Linux. We will have to wait a little bit longer.. :-/

Query wikipedia over DNS

This is a nice one.
Use the following command line to query wikipedia over DNS:

dig +short txt Coimbra.wp.dg.cx

How 2 create a pdf document holding image scan files

Hi all!
Today I’m gonna share with you how to create a pdf document holding several images scan files.
You probably have already asked yourself sometimes on how it would be great if you could easily create a pdf file from a bunch of image files after using you scanner. I have.
Some scanner manufacturers do already provide ways to do multiple scans into a resulting pdf file, if this is your case you can stop reading now.
As a Linux user and as a legacy scanner holder(but still an excellent unit) i found this an excellent way to achieve my task:

  1. You need to install ImageMagick. In fedora you can do that by typing:
    yum install ImageMagick
  2. Next change directory into where you got your scans.
    In my case:

    cd ~/scans

    All my scans are auto-generated names as follows:

    SCAN_001.png
    SCAN_002.png
    ...
    SCAN_012.png
  3. To get your pdf just type:
    convert SCAN_[0-9]{3}.png book.pdf

    and it’s done.

  4. To see the result just open the result book.pdf file.
    I hope you’ve enjoyed this tip.

Compiling kernel 3 vanilla 4 fedora

Hi all!
Today i’ve decided to share with you how to compile a vanilla kernel for use with your fedora box.
I’ll be showing you how to do it for a x86_64 system but it should be similar for i386.

  1. Start by getting your kernel tar here: kernel.org site.
  2. As root issue the following:
    cd /usr/src/kernels
  3. Issue the following to install some dependencies:
    yum install gcc ncurses ncurses-devel kernel-devel -y
  4. After that copy your downloaded kernel there to by issuing:
    cp /<FOLDER_WHERE_YOUR_DOWNLOADED_KERNEL_IS>/linux-<VERSION>.tar.bz2 .
  5. Untar the kernel:
    tar -xvjf linux-<VERSION>.tar.bz2
  6. Change the kernel name to make it more appropriate:
    mv linux-<VERSION> <VERSION>.1-95.$fedoraver.$arch

    Ex:

    mv linux-3.0.4 3.0.4.1-95.fc14.x86_64
    cd <VERSION>.1-95.$fedoraver.$arch
  7. After moving into the kernel folder edit the Makefile as bellow:
    VERSION = 3
    PATCHLEVEL = 0
    SUBLEVEL = 4
    EXTRAVERSION = .1-95.fc14.x86_64
    NAME = Sneaky Weasel

    Save the file.

  8. To complete run:
    make oldconfig
  9. As soon as you start being asked with changes against the new kernel, do an enter everytime. By doing this you will apply the defaults for all items without interfering with the settings.

  10. Editing the kernel options is not mandatory. If you want to compile right after the oldconfig, there’s no problem, jump that part and move straight for the makes. Here you edit accordingly with your box settings.
    make menuconfig

    After finishing save your changes and continue as described bellow:

    make bzImage && make modules && make modules_install

    This will take a while you may go for a coffee break. 😉

  11. After everything finishes, you do the following simple tasks:
    cp arch/x86_64/boot/bzImage /boot/vmlinuz-3.0.4.1-95.fc14.x86_64
    cp System.map /boot/System.map-3.0.4.1-95.fc14.x86_64
    cp .config /boot/config-3.0.4.1-95.fc14.x86_64
  12. Now you generate the image:
    cd /boot
    mkinitrd initramfs-3.0.4.1-95.fc14.x86_64.img 3.0.4.1-95.fc14.x86_64
  13. Now edit grub settings file to boot the new kernel. Just copy the current kernel entry and make the changes to the version numbers setting yours and you are done.
    cd grub
    vi menu.lst

    Here you can see an example:

    title Fedora (3.0.4.1-95.fc14.x86_64)
            root (hd0,5)
            kernel /vmlinuz-3.0.4.1-95.fc14.x86_64 ro root=/dev/mapper/vg_dell-lv_root rd_LVM_LV=vg_dell/lv_root rd_LVM_LV=vg_dell/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=pt-latin1 rhgb quiet intel_iommu=off
            initrd /initramfs-3.0.4.1-95.fc14.x86_64.img
  14. Save the file, recheck to see if you missed something and reboot.
    Enjoy the advantages of your new kernel.
    Good luck!

[U]biquitous [S]ystems project

Last semester I’ve registered myself for ubiquitous systems @dei.uc.pt. My project for the semester was CIT: City Issue Tracker. Take a closer look at it by watching the demo below.