r3dux.org

A number-pimping side project from the valleys in *NEW* upside-down flavour.

  • Home
  • ABOUT
  • OLD SITE
  • SEARCH
  • FEEDBACK

How-To: Install the Liquorix kernel in LMDE

r3dux | September 14, 2011

Just because all GNU/Linux distros come with a kernel, it doesn’t mean that it’s the best kernel to use. This was made quite clear to me recently when I discovered that whenever I safely removed a USB drive from my machine it caused a kernel panic in the present LMDE kernel (2.6.39.2) which promptly hung the machine. I figured out I could work around the issue by unmounting USB drives through gparted, but that’s pretty weak sauce, so I decided to cut to the root of the problem and change kernels.

In the past I’ve spent a long time picking specific kernel options, building the kernel, and then it hasn’t worked at all – so this time I wanted something I was pretty sure would work, and I didn’t want to spend forever on it, so what are the options?

Zen and the art of kernel maintenance

The official Linux kernel lives at kernel.org, and is the reference design if you will for all existing kernels. The new stuff generally gets added to the mainline kernel, and then other kernels add or remove bits and pieces to become their own kernels such as the Ubuntu kernels or the Debian kernels or what have you.

The process of adding or removing bits and pieces is pretty much open ended, and if you don’t know exactly what you’re doing you can spend a long time reading and experimenting, so I’ve opted to pick something pre-customised from the Zen kernels:

From the zen kernel about page:

The Zen Kernel is a the result of a collaborative effort of kernel hackers to provide the best Linux kernel possible for every day systems. We include code that is not included in the mainline kernel in an attempt to create an all-around better kernel for desktops (although it can be compiled otherwise). This is done by including new features, supporting latest hardware, and including various code and optimizations to better suit desktops. Zen is a 100% community oriented project so, as a result, everybody can contribute to the project.

Who mods the modders?

Liquor up front, poker in the rearA chap going by the handle of Damentz, who seems to have the black art of kernel crafting down to a tittle, takes that zen-kernel source and (I think) tweaks it some more to produce the Liquorix kernel.

What does he do exactly? I’ve absolutely no idea – maybe it’s in the forums somewhere, but I think the main thing he does is make it compatible with Debian, and provide a repository so we can grab and use his pre-built pre-modded zen kernel on Debian or any Debian-compatible distro such as LMDE. He’s also nice enough to build both 32-bit and 64-bit kernels so the repo should provide whichever version is appropriate for your system at install time.

Installing the liquorix kernel

Note: It’s a really good idea to make sure you have the dkms package is installed at this point so that any proprietary third-party kernel modules like graphics card drivers (nvidia/ati official drivers), virtualbox modules etc. get rebuilt as part of the kernel install.

1.) Add the liquorix repository to your apt sources file at /etc/apt/sources.list:

# /etc/apt/sources.list.d/liquorix.list
deb http://liquorix.net/debian sid main

2.) Update your system package list:

sudo apt-get update

3.) Get and install the liquorix repository key to authenticate the packages:

sudo apt-get install '^liquorix-([^-]+-)?keyring.?'

4.) Install the liquorix kernel and header sources (you’ll want the sources so that DKMS can automatically rebuild kernel modules for you as required when you update the kernel) – it’s probably best to do this through synaptic/package manager so you can see what’s there:

Liquorix packages

Apart from the keys for package authentication, you really just need the linux-image-liquorix-amd64 and linux-headers-liquorix-amd64 meta-packages (or suitable 32-bit versions) which will then drag in the most recent version of the kernel, whatever that happens to be at the time.

While the packages are installing it’s best to keep an eye on the output to ensure that your dkms modules successfully rebuild – but as long as you’ve opted to install the kernel headers package along with the kernel there shouldn’t be a problem – it’s just nice to be confident that when you reboot you’re not going to be booting into a black screen with a flashing white cursor…

Liquorix DKMS module rebuild successful

Liquorix DKMS module rebuild successful

What now?

Reboot and choose your new kernel from the grub boot menu! (it’ll be the new default). Once you’re up and running you can always run uname -r or uname -a to confirm your kernel version, then take that bad-boy for a spin…

Liquorix uname -r

I only installed mine this morning, but the first thing I did was mount and then unmount a USB drives – and what happened? It kernel panicked. Turns out that the bug seems to be quite widespread among distros (Debian Bug 631187), but you can work around it by manually unmounting using umount (or by using gparted, as I found).

Still, it’s a new, multimedia/gaming optimised kernel (3 series, no less!) – which has its faults, but it seems a lot of kernels at the moment do, and it looks like I’d have to go back to 2.6.38.something to find a kernel which hasn’t had this bug introduced.

I’ve read good things about zen kernels in the past, so I’m glad to finally run one. Once I’ve had a chance to play around with it and that unmount wrinkle’s ironed out I’m sure it’ll be a nice, responsive kernel. And if it isn’t, then I’ll write another post that calls it names =P

Cheers!

Update 21/09/2011: I’ve read on the Liquorix forums that DKMS is not a great package, and although it might do useful things, it does them in bad, non-standard ways, so they highly recommend you uninstall DKMS entirely, and install things like graphics drivers and wifi drivers from the manufacturer’s sites directly (using sgfxi) because if DKMS screws it up, it can get pretty scrappy to fix.

Comments
1 Comment »
Categories
How-To, Linux
Tags
Crash, Debian, Hang, Kernel, Liquorix, LMDE, Panic, Zen
Comments rss Comments rss
Trackback Trackback

Easy E Vs. Johnny Cash – Folsom Prison Gangstaz

r3dux | September 10, 2011
YouTube Preview Image

If you can’t do the time…

Comments
No Comments »
Categories
Music
Tags
Easy E, Folsom, Johnny Cash, Mash-Up, Mix, Prison
Comments rss Comments rss
Trackback Trackback

Simple texture loading with DevIL revisited

r3dux | September 8, 2011

I wrote an article a while back about loading images to use as textures in OpenGL, and in it I’d written my own single line image to texture-handle function because I couldn’t get the built-in ilutGLLoadImage function to work. Since I’ve been getting blank looks and failure to compile reports about it, I thought I’d go and take a look at it again, and this time ilutGLLoadImage seems to work just fine, so let’s document it up properly shall we?

Pre-requisites

You will need:

  • A C++ compiler of your choice (I prefer Code::Blocks)
  • Working OpenGL drivers
  • A copy of DevIL
  • A copy of GLEW (GL Extension Wrangler – to make the functionality in your OpenGL drivers availble for use)
  • A copy of GLFW (GL FrameWork – to quickly and easily set up a OpenGL context)
  • An image to load

Preparation and libraries

Create a new project in your IDE of choice, and link in the following libraries:
DevIL required libraries

You’ll have to figure out where the libraries are on your own system but these are where they are on mine, where a /usr/local/ address indicates packages I’ve build myself, /usr/lib/ indicates standard system installed packages, and no prefix uses any paths defined by the compiler (in this case /usr/ where the lib and include directories are assumed). I’ve also added /usr/local/ to the include path so that any headers in /usr/local/include/ are picked up before any in /usr/include. Yes, library paths are a pain ;)

Also, be sure that your project includes its own directory as the working directory (i.e. the directory to be in when executing) so that you can place your image (in this example, a file called abstract-image.jpg) in the main project directory and it’ll be picked up when we try to load it. The way that you specify the working directory will vary depending on the IDE you’re using, but in Code::Blocks you set it from Project | Properties | Build targets like this:

Code::Blocks Working Directory

Source Code

Create a new project with source code something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#include <iostream>
#include <cstdlib>
 
#include <GL/glew.h>		// Include GLEW, which pulls in OpenGL headers as required
#include <GL/glfw.h>		// Include OpenGL Framework headers
 
#define ILUT_USE_OPENGL		// This MUST be defined before calling the DevIL headers or we don't get OpenGL functionality
#include <IL/il.h>
#include <IL/ilu.h>
#include <IL/ilut.h>
 
GLuint textureHandle;           // Create a uint to store the handle to our texture
 
GLfloat frameCount = 0.0f;
 
void initGL(int width, int height)
{
	//  ----- Initialise GLEW -----
	GLenum err = glewInit();
	if (GLEW_OK != err)
	{
		std::cout << "GLEW initialisation error: " << glewGetErrorString(err) << std::endl;
		exit(-1);
	}
	std::cout << "GLEW intialised successfully. Using GLEW version: " << glewGetString(GLEW_VERSION) << std::endl;
 
	// ----- Window and Projection Settings -----
 
	// Set the window title
	glfwSetWindowTitle("ilutGLLoadImage Test | September 2011 | r3dux.org");
 
	// Setup our viewport to be the entire size of the window
	glViewport(0, 0, (GLsizei)width, (GLsizei)height);
 
	GLfloat ratio = (float)width / (float)height;	// Calculate the window ratio
 
	// Change to the projection matrix, reset the matrix and set up our projection
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluPerspective(45.0f, ratio, 0.1f, 100.0f); // Params: Field-of-Vision, window-ration, near-clip-plane, far-clip-plane
 
	// ----- OpenGL settings -----
 
	glfwSwapInterval(1);                               // Lock to vertical sync of monitor (normally 60Hz, so 60fps)
	glEnable(GL_DEPTH);                                // Enable the depth buffer
	glDepthFunc(GL_LEQUAL);                            // Set our depth function to overwrite if new value less than or equal to current value
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Ask for nicest perspective correction
	glEnable(GL_TEXTURE_2D);                           // Enable 2D textures
 
	// ----- Initialize DevIL libraries -----
 
	// DevIL sanity check
	if ( (iluGetInteger(IL_VERSION_NUM) < IL_VERSION) || (iluGetInteger(ILU_VERSION_NUM) < ILU_VERSION) || (ilutGetInteger(ILUT_VERSION_NUM) < ILUT_VERSION) )
	{
		std::cout << "DevIL versions are different... Exiting." << std::endl;
		exit(-1);
	}
 
	// Initialise all DevIL functionality
	ilInit();
	iluInit();
	ilutInit();
	ilutRenderer(ILUT_OPENGL);	// Tell DevIL that we're using OpenGL for our rendering
}
 
void drawScene()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear the screen and depth buffer
 
	// Reset the matrix to identity
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
 
	glTranslatef(0.0f, 0.0f, -40.0f); // Move things back into the screen
 
	glRotatef(frameCount, 0.1f, 1.0f, 0.3f); // Rotate the MVP matrix orientation
 
	glBindTexture(GL_TEXTURE_2D, textureHandle); // Select the texture to use and bind to it
 
	static float hsize = 15.0f; // Vertical size of the quad
	static float vsize = 10.0f; // Vertical size of the quad
 
	// Draw our textured geometry (just a rectangle in this instance)
	glEnable(GL_TEXTURE_2D);
	glBegin(GL_QUADS);
		glTexCoord2f(0.0, 0.0); glVertex3f(-hsize, -vsize, 0.0f);  // Top left
		glTexCoord2f(0.0, 1.0);	glVertex3f(-hsize,  vsize, 0.0f);  // Bottom left
		glTexCoord2f(1.0, 1.0);	glVertex3f(hsize,   vsize, 0.0f);  // Bottom right
		glTexCoord2f(1.0, 0.0);	glVertex3f(hsize,  -vsize, 0.0f);  // Top right
	glEnd();
	glDisable(GL_TEXTURE_2D);
 
	// ----- Stop Drawing Stuff! ------
 
	glfwSwapBuffers(); // Swap the buffers to display the scene (so we don't have to watch it being drawn!)
	frameCount++;
}
 
int main()
{
	// Window settings
	int width      = 800, height   = 600;
	int redBits    = 8,   greenBits = 8,  blueBits    = 8;
	int alphaBits  = 8,   depthBits = 24, stencilBits = 8;
 
	// Flag to keep our main loop running
	bool running = true;
 
	// Initialise glfw
	glfwInit();
 
	// Create a window
	if(!glfwOpenWindow(width, height, redBits, greenBits, blueBits, alphaBits, depthBits, stencilBits, GLFW_WINDOW))
	{
		std::cout << "Failed to open window!" << std::endl;
		glfwTerminate();
		return 0;
	}
 
	initGL(width, height); 	                        // Call our initGL function to set up our OpenGL options
 
	ILstring imageFilename = "abstract-image.jpg";  // Specify filename
 
	textureHandle = ilutGLLoadImage(imageFilename); // Load image directly to texture
 
	// Output last image loaded properties
	// Available properties list is at: http://www-f9.ijs.si/~matevz/docs/DevIL/il/f00027.htm
	std::cout << "Image width         : " << ilGetInteger(IL_IMAGE_WIDTH)          << std::endl;
	std::cout << "Image height        : " << ilGetInteger(IL_IMAGE_HEIGHT)         << std::endl;
	std::cout << "Image bits per pixel: " << ilGetInteger(IL_IMAGE_BITS_PER_PIXEL) << std::endl;
 
	// Main loop
	while (running == true)
	{
		// Draw our scene
		drawScene();
 
		// exit if ESC was pressed or window was closed
		running = !glfwGetKey(GLFW_KEY_ESC) && glfwGetWindowParam( GLFW_OPENED);
	}
 
	glfwTerminate();
 
	return 0;
}

End Result

If you’ve linked in the libraries and used source code like the above, you should end up with a working texture that looks something like this:
ilutGLLoadImage Example

And information regarding the image being used that looks something like this:
DevIL Image Data

I’ve attached a copy of my Code::Blocks project here for anyone who wants it.

Cheers!

Credits: The wallpaper I used as the texture in this guide is Life by N.Design Studio, which you can find here.

Comments
1 Comment »
Categories
Coding, Imagery
Tags
C++, Code::Blocks, DevIL, GLEW, GLFW, Libraries, OpenGL, Texture
Comments rss Comments rss
Trackback Trackback

Letting Up Despite Great Faults – Teenage Tide

r3dux | September 6, 2011

Letting Up’s new track off their Paper Crush EP is really nice, but unless you’re still a teenager the chances are that the video will make you feel very, very old…

YouTube Preview Image

The flip-side of that particular coin however is that while they may all be glamour-model pretty and positively glowing with health, in true if youth but knew, if age but could manner, they likely know absolutely f****** nothing about anything, and when you tap them on the head it makes that distinctive empty-vessel clang.

Damned beautiful young people cavorting in the sun and giving each-other pouty looks! Get off my f****** lawn! =P


Bitterness aside, when Nash equilibrium enters the equation, we should all completely ignore the girl in the red dress – it’s the only way we all win…

Comments
No Comments »
Categories
Life, Music
Tags
Age, Lawn, Letting Up Despite Great Faults, Teenage Tide, Youth
Comments rss Comments rss
Trackback Trackback

Sebadoh Live

r3dux | September 2, 2011

Home Taping is Killing MusicOne day in 1995, while I was 16 and at school in the UK, I got talking to a guy called Brian Douglas. And we talked about music, and the different bands that we liked. Whilst I was hopelessly mainstream and citing things like U2, Crowded House, and Pearl Jam – this guy was just pulling names out of the air; bands I’d not only not heard, but not even heard of. And two of these (American) bands were Sebadoh and Slint.

To prove what a badass he was (and that he wasn’t just making these names up), he told me that his older brother had gone to the public library (no less), borrowed some vinyl records of these bands, and then tape recorded those mother-lovers. Not only this, but he could do me a copy if I gave him a 90 minute TDK. And lo and behold, I soon had in my grubby mitts a copy of Sebadoh – Bakesale (on side A) and Slint – Spiderland (on side B). In 1995. And I listened to those bad-boys on my walkman. A lot. And I fell in love with them.

Sebadoh - Bakesale album cover

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Fast forward to 2011, 17 years later. I’m 33, living on the other side of the world, and I wake up singing Not Too Amused to myself (the track above).

And just because I’ve woken up with the song in my head, I look up Sebadoh on the mighty Interwebs. And then I find that they’ve just re-issued a remastered version of my beloved Bakesale, so I have a chat with my wife and we nip into town and pick up a copy from JB. And then while listening to it I decide to look up some album reviews for old times sake… and discover that Sebadoh (who disbanded a long time ago) have RE-banded to tour their old album as a farewell. And that they’re playing in Australia. 70Km away from where I live. In 16 days time.

This is genuinely one of those moments where I understand why the phrase the truth is stranger than fiction rings so true – I mean, really – you just couldn’t make it up – I’m absolutely psyched. I was convinced that I’d missed the boat by a good 15 years+ on this one, and that there was no way I could ever experience a Sebadoh concert in the same way that there’s no way I can go back and stand about one foot further to the left of my mate swinging a golf club when I was 10; what’s done is done, and fractured skull be damned.

But this is like going back and fixing a mistake. Like seeing Nirvana or INXS or the Beatles or something – today. Or in 16 days time…


P.S. – Bonus awesome track because you’re unequivocally worth it, and because I can:

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

P.P.S – Also, I still really like the Slint album, it’s just not what I’m writing about today.

Post-Gig Update: It was a great show; a little bit shambolic/bad-luck tinged (gig review: here, PDF of gig review: here), but we had a ball and it was awesome just to be there. Also got a T-Shirt and had it signed by Lou Barlow, so I thought I’d take a pic before the marker washes out!

Sebadoh T-Shirt 2011

Comments
1 Comment »
Categories
Juni, Life, Music
Tags
Gig, Life, Love, Sebadoh, Serendipity, Slint
Comments rss Comments rss
Trackback Trackback

« Previous Entries Next Entries »

Translate

Categories

Archives

Tags

3D ActionScript ActionScript 3.0 Adobe AI Ballarat Bash C++ Class Convert CS4 Effect Error Film Flash GLSL Gnome Hack How-To install Jaunty Java Kinect Linkage Linux Mash-Up Microsoft Motion OpenGL Particle Problem PS3 Remix Retro script Slides Sound Systems Texture Ubuntu Video VirtualBox Wii Windows XBox

Gamercard

OpenR3dux

Misc.

Flattr this

RSS Feed

r3dux twitter feed



“The only way to have a friend is to be one.”

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox