Matt-J.co.uk : Ramblings

Life, Tech and intravenous caffeine.

Sploits :P

I know I still need to write up a load of technical stuff I have been working on;
But just a quick post for anyone that hasnt heard about [LINK FIXED] THIS

A pretty nasty Linux privilege exploit coving kernels upto ” Linux kernel 2.6.24 -rc5″

Users should patch / upgrade. And if you can’t.. At least disable shell logins for anyone other than yourself ;P

3 comments

A quiet month..

Actually I have been damn busy! But that usually means the blog suffers, sorry.

I do have lots of new stuff to talk about, so stay tuned :P

Also, I’m amazed how many comments the petrol prices post is getting :P

–Matt

No comments

Bladdered!

Finally feel a little like im on holiday!

Night out on Friday with some guys from home. Simpy, Adam, Claydon and me went to the hyndburn for a quick four pints before getting a taxi into blackburn.

Was good to see a load of people again, and I don’t think anyone remembers much about the night.

It started in spoons then onto the bridge (I think :S.. it’s somewhere that’s been done up anyways) Then the Malt, then the cellar for a few games of pool. Finally onto liquid/envy for cheap drinks and bad music! :)

Anyway, yes.. Much drinkage! was good fun!

 

//Matt

1 comment

Merry Christmas!

Hello all, and Merry Christmas to anyone that reads this blog!

I’m Back home (Single Bed :( ) for a few days (until the 1st Jan) with the family / catching up with mates up here etc.

Have got a few new things to mention, such as ubuntu 7.10, a fresh look at wine, fully crypted root drives using LUKS and some good news about my final year of uni, but I guess christmas day isn’t really the time to start rambling! Maybe later this week.

Anyway, Have a good day all!

–Matt

No comments

A strange bug relating to Grub

Just something I have noticed while playing around with my solaris box today.

First off, USB keyboards wont work in grub, but that’s probably more my BIOS’s problem (however I can use it for selecting Setup or the boot selection screen :S (f2,f11 etc)

But the main thing I have noticed,

If I press enter to boot the default item in grub (PS2 Kbd as USB wont work), I get the solaris sunOS banner, then a few shared IRQ notices (running Xvm)  and then a blinking cursor, forever.

However, letting grub choose the SAME item itself (allowing the 4 second countdown to expire and boot the item, without pressing anything) it boots fine:

SunOS banner, IRQ notices, Hostname, ZFS config info, Starting GUI.

This is 100% reproducable, and I’m wondering if anyone else has come accross the same thing? Not really a problem, but strange all the same.

–Matt

No comments

xVM Centos5.1 domU on solaris dom0


Runs with xenblk loaded
Originally uploaded by TrX07

Following on from my last post, I finally got the centos 5.1 install running as a guest VM under solaris xVM.

The problem (as expected in the last post), was the initrd-xen ramdisk that was created when I installed the centos kernel-xen package did not have the xennet or xenblk kernel modules needed to run as a xen guest.

However, installing the kernel-xen package HAD installed the needed arch and version specific modules, just had not put them into the xen initrd (I think centos5.1 expects to be run as a dom0).

So, once chrooted into your centos5.1 filesystem, and after installing the kernel-xen package (yum install kernel-xen)

Unpack the initrd image:
gzip -cd < /boot/initrd-2.6.18-53.1.4.el5xen-img | cpio -iv
(would suggest running this in an empty folder, as it makes including the right files when rebuilding the initrd easier]

Next, find the modules needed in the centos filesystem:
find /lib/ | grep xenblk
/lib/modules/2.6.18-53.1.4.el5xen/kernel/drivers/xen/blkfront/xenblk.ko

find /lib/ | grep xennet
/lib/modules/2.6.18-53.1.4.el5xen/kernel/drivers/xen/netfront/xennet.ko

Then add these to the unpacked initrd (under lib dir):
cp /lib/modules/rest_of_path/xennet.ko \
/wherever/extracted/initrd/is/lib/.
cp /lib/modules/rest_of_path/xenblk.ko \
/wherever/extracted/initrd/is/lib/.

Finally, we need to tell the init script of the initrd to load the modules at boot, and re-pack the initrd.
(Im using vi as my editor, you could use nano, emacs etc)

vi /path_to_your_extracted_initrd/init

add 'insmod /lib/xenblk.ko'
and 'insmod /lib/xennet.ko'

before all the other ‘insmod’ lines, and save

Now re-pack your initrd:
cd /path_to_extracted_initrd
find . | cpio -c -o -v | gzip -9 -n > ../newinitrd-xen.img

This will have placed a file called newinitrd-xen.img, one folder back up your directory tree. Now make your xVM / Xen config file point to this .img file for the ‘ramdisk=’ option… and boot!

voila! away it goes!
(as you can see from the image, it does not crap out anymore at the ’switchroot’ stage, and you can see further up my xennet and xenblk modules being loaded)

Anyway, that’s all for now, hope someone finds this useful!
–Matt

4 comments

Back in the UK (and xVM meddlings)

Hey all,

Been back in the UK since last wed morning, and really looking forward to seeing family and drinking with mates at christmas!

Work is going well since I got back, have a whole new appriciation for the GMP building after working in kista, stockholm for a few days (Sorry Hans, but our building rocks! and kst just, well, dosn’t!)

Anyway, Been trying a couple of things on the geeky side of life since I got back. One is that I finally got myself a solaris supported 8xSATA2 PCI-X card (TrendMicro with a marvell chipset) for my NAS

Can finally think about some more disks now (although I still need a new case, as this one just sucks (never spend £16 quid or less on a case :P))

I have also got round to having a look at xVM, (solaris virtualisation) (pretty much Xen.. but well integrated) I decided a few days back I would install a couple of instances of CentOS5.1 and migrate my asterix PBX and scalix MTA/Webmail/calender systems over… Not as simple as it first sounds.

Running the same OS as the guest (domU) as the main os (dom0) is pretty simple, and it’s documented all over, solaris on solaris is a peice of cake, Centos on centos, buntu on buntu, and gentoo on gentoo are all pretty easy and the steps for each can easily be found online.

However, one linux on another linux is slightly more hard work.. and then there is my corner; linux on a solaris Dom0

The idea is pretty simple,
use a spare partition, or a loopback mounted ext2 filesystem and put the linux userspace you want to run in it (first problem… all the tools for cutting out a nice copy of a userspace for centos.. are where? you guessed it, on a centos install.. Not in solaris :P)

I got round this problem with some excellent pre-made xen-ready images of the latest flavours of linux from www.jailtime.org.

Then, you simpy write a quick config showing the xen userspace tools where the OS filesystem is, and where the xen-patched kernel and initrd for the guest os are..

Next problem: I dont have a xen-patched kernel OR initrd for the guest OS.
My first guess was that they would be in the OS image under /boot, and Xen would find them when it mounted the loopback filesystem from jailtime.org.
… Not a chance.

So then I mounted the image on a linux box myself
mount -o loop -t ext2 centos51.img /centos
and had a look in the boot folder.. nothing there.

So my next cunning plan involved the fact I had already mounted this centos environment, I chrooted into it.

mount -t proc proc /centos/proc
mount -o bind dev /centos/dev
chroot /centos /bin/bash
source /etc/profile
echo nameserver x.x.x.x > /etc/resolv.conf

And from here, I used centos’s package manager to install me the xen enabled,patched kernel binary.
yum install kernel-xen

Good news! /boot suddenly had a kernel, and an initrd in it, both with xen in the name. Things were looking up.

I then copied the kernel + initrd over to my solaris box, added their paths to the xen config… and off we go again.

xm create /xvm/centos/centos1.cfg -c

…Wrong again!
This time Xen crapped out about not getting the ELF type it was expecting. It was expecting a 64Bit kernel, and it got a 32bit one.
A bit of googling was required…

Turns out the xen core 3.0 (which is the current one, and therefore shipped in solaris_nevada 77) only supports 32bit guests on 32 bit dom0’s and 64 bit guests on 64bit dom0’s (Xen 3.1 will fix this, if your CPU supports both (amd X64, X2 | intel core, pentiumD etc, but that’s too much of a waste)

Luckily moving between 64 and 32 bit in solaris is INFINATLEY easier than in linux or windows, simply a reboot with some different grub options (remove (/$ISADIR))

And sunos 5.11 is booting, in 32 bit :).. rock on!

So I try to start the vm again..
xm create /xvm/centos/centos1.cfg -c
IT BOOTS!….
Well, for about 4 seconds, then bombs out with some errors trying to mount root devices.

More googleing,
Looks like the kernel and initrd that centos’s installer gets for you when you do a ‘yum install kernel-xen’
is the kernel needed for running centos as a Xen dom0 (master) not a domU (guest) and so lacks two xen libraries in the initrd, which would allow a guest to mount shared /dev devices and access filesystem images and such.

And so that’s where im upto now, trying to find a centos xen DomU initrd, or failing that, extracting my initrd and adding the modules myself.
Will let you know how it goes.

Btw, cheers to James Legg, who got me upto speed with what he had found out about xVM so far!

–Matt

1 comment

A quiet weekend in sweden

This last week has been pretty hectic. Not been on the PC much at work as there has been so much in lab work todo.

It’s getting there tho, Hans hopes we will be finished on schedule by tuesday.

The weekend has been quiet, slept in on saturday morning because I was nackered, and then got the train from sollentuna to the centre of Stockholm in the afternoon to take some pics (Will put them online when I get home as i’m not sure how much data uploads from my phone costs over here)

Spent last night at the hotel bar, as the internet connection here kinda sucks, and I needed to get out of my hotel room (there is only so much pseudo-english tv you can take!)

Got talking to the girl behind the bar who was pretty cool, and it was kinda nice to talk to someone outside of work. Anyway, she said I should come to this bar her and some mates are going to Sunday (tonight)  as it was her night off, so that’s what I’m currently contemplating, can I afford (and be assed) to have a big night out in stockholm?

Will let you know how things go.

–Night!

//Matt

2 comments

Sun a ‘la Sweden!

First off, Please don’t ask me to correct my pseudo French in the title.

Secondly, I’m In sweeden! for 10 days, working for sun to help them with some things going on in the swedish lab.

It has been a weekend of fail’s and denied’s though!;

First of all, on the Sunday (when I was meant to fly) ATC’s computers crashed at the airport, and my flight was cancelled.. typical!
So.. Commence the four hour queue, (all the way from Heathrow T1 to T2) to rebook for the next flight. When I got to the booking’s desk, the next flight available was at 10.30am tomorrow (Monday 26th, today).

At this point, I was given a list of hotels with free rooms, which I was told I could claim back off B.A. for any costs. These hotels were all (by this time, 8pm or thereabouts) charging around 200 quid a night, so I got a taxi back home to fleet (50 quid) under the idea of getting another taxi back in the morning (and i’ll be charging the taxi faires to B.A. instead.. after all, I’m saving them money :P)

So, 5am this morning, I was up, showered, sleepily tripped over our beer bottle art as I walked out of my room (Sorry Mike!) and ready for my taxi at 6.

Checked in, through security (two laptops in one bag confuses the hell out of the X-Ray security staff :P) and into the departure lounge.

The flight went without a hitch, got to sweden arlanda airport, and then, the second problem hit!

Wrong hotel booking :P
I was MEANT to be staying in the Scandic star hotel, however, there are apparently two scandic star hotels in sweden, and lucky me, I picked the wrong one… so wrong, it’s a whole days drive away!

So, from the airport, got a taxi directly into sun’s office, where we sorted new hotels out and cancelled the old booking.

Hans (Who run’s the lab over here) then gave me a lift into the centre of Stockholm (to my newly booked hotel!)
Finally! Hotel! can put my bags down! shower! change of clothes! Lot’s of free exclamation marks!!!!!!!!!!!!!!!!

Then it was off down to the local pub to meet Hans again, and grab some food, and many tasty Swedish ales!

Now I’m back in my hotel room (which looks out over the central street in Stockholm) chilling out before I get some kip.
I get free broadband too, which is an added plus.

Would like to have spaced this post with pictures, but inside the airport looks like any other airport, the photo’s I took from the plane are (understandably) crap, and there’s been much too much to do since I got into Stockholm to take pictures. (Maybe later this week)

Anyway, I’ll keep you all updated! From Sweden, night people!

4 comments

Hidden Goodies!

Nokia recently announced that the N95’s have a 3D acceleromiter in them, and handed out the API;
This means that ‘Iphone-like’ tilting to change the screen layout, Shaking the phone for the next music track, and using the phone like a Wiimote, are all possible.

There is a quick demo app out that show’s the accelerometer in action:

(ignore Mike and his drumkit in the background :P)

This is definalty cool news for N95 owners, can’t wait to controll my music on my PC by flicking my phone :)

No comments

« Previous PageNext Page »

Mexico