Jump to content


Kernel upgrade for eee for Xandros from stock 2.6.21.4 to 2.6.27.10


17 replies to this topic

#1 s0m3body

    Member

  • Members
  • 12 posts

Posted 25 December 2008 - 11:53 PM

What is this ?

Kernel upgrade. A bit of patching, scripting, to get latest and greatest 2.6.27.10 (with btusb driver, amont others) run without scraping Xandros and going through the pain of 'doing the whole install from scratch'. Backwards compatibility (booting with old stock kernel) is of course there.


Why is this ?

For me it started with btusb driver for my nice tiny BT dongle and GPRS via mobile (yes, it indeed works :-). Plus ath5k driver delivers better performance in my case (too many networks around, win32 driver getting confused and reconnecting every couple of seconds, ath5k can be forced to do what I want).


So why not install new distro from scratch ?

I like what I got with eee. I would not put that distro on my normal PC, but on eee, it looks 'right'. I just wanted a new kernel, with some new drivers. Keeping all the working stuff. For example network connection management I find great. Superior to eee 'on' XP. Especially for the use case of switching between different networks daily ...


Can you do the same ?

Do not expect some nice & tidy howto here. It is not so easy. It took me quite some time, starting from booting new kernel, getting btusb working with my dongle, getting gprs working, etc .... Then a big decision, do I stick with dual boot, or will I get all the hardware working with *my* kernel ? L2 NIC was easy, web cam as well. Aufs and especially ath5k is pain in the neck. Plus as I've said, I wanted to keep network connection mgmt from Xandros, so I *had* my device to be ath0 and not wlan0, etc ...

Anyway - now it all works. Not worse then with the old kernel and original software. I guess it is better :-). And I have a loads of experience to start some cool hacks.

So the question you should ask is - 'Do I have some spare time and do I want to do the same ?'


This post is not a finalized list of instructions. I want to find out if there is anyone around to start some experience exchange / discussion / whatever in (from my point of view) following areas:

- Kernel configuration, boot performance, etc ...

- aufs patch - I took recent aufs kernel module and 'wired it' into the vanilla 2.6.27.10 kernel (had not balls to go with -mm tree) - so that I don't have to mess up with initrd (my eee is using original initrd !) - I did some 'guesses' there, may be good to verify if they are safe enough ...

- sound - vanilla 2.6.27 has some drivers which look like eee's - but they do not work. They offer 0x8330 and 0x831a, but my eee need 8337. I got a patch from Asus for 2.6.21.4 - but quite something changed in the kernel since then ... anyway - with some guesses I got it to compile, I got it to sing. Again, no idea how clean this patch is ...

- BT, mobiles, GPRS - I got mine working. Pairing is still a problem, workaround is BT applet but an easier solution would be great.

- Wifi - I replaced ath_pci with ath5k, with backwards compatibility. That means, I changed some scripts and now my Xandros is using ath5k in the same way as ath_pci. Basically I only touched the part dealing with kernel modules, and forced ath5k to look like ath_pci (device is called ath0 not wlan0, etc ...). From there on, it was a breeze. I put up some changes to make suspend/restore a bit more stable.


Really, if someone wants to try it, I offer answers to all the questions, even if not real time (I have a job guys :-)) -> and he can then write howto for everyone else. I find it really cool, as I stay with Xandros, only with 2.6.27.10, newest hardware drivers, completely opensource ath5k (and working !!!) and for free :-)


NOTE: I have no use for the modem, I have not used it at all, it will not work with my 2.6.27.10 - I can help with getting it running as well but someone has to take initiative here.


Anyway, if someone finds all what I written above interesting, let me know and I will start posting details.

#2 rayhaque

    Senior Member

  • Members
  • 114 posts

Posted 26 December 2008 - 09:51 PM

Sounds like a fun project! I could think of another reason someone might want to do this: to get newer versions of Firefox and the Flash Plugin (v10+) installed. It seems if you want a new version of something tied closely to the kernel ... you need a newer kernel.

This would make a nice project to maintain for the sake of keeping the Xandros install alive. It looks like ASUS is done updating and supporting it. At least for the 701 series.

I do have a question: when you created your .config for the kernel, were you able to copy and keep the options from the existing one (make oldconfig/cloneconfig)?

Thanks,
-Ray

#3 Geeeronimo

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 27 December 2008 - 09:48 AM

I once tried to recompile the kernel to get hyperthreading activated with Xandros, but had many problems, see
http://forum.eeeuser...ic.php?id=48319

I guess I wouldn't try another time without a detailed tutorial ;)

#4 s0m3body

    Member

  • Members
  • 12 posts

Posted 27 December 2008 - 02:03 PM

Ok, so let's start with kernel. I assume that anyone wanting to try this knows about aufs and the trick how to install custom kernel (single user mode, etc ...). Also the grub configuration should be pretty straightforward, just add new entry with the same parameters (including original initrd, as I've said, I managed to get the new kernel working with old initrd with no problems so far).

So I took 2.6.27.10 vanilla sources, did make oldconfig and took defaults for all the options - I revisited the configuration again later to tune it for my purposes. Compiled, installed tried to boot and it almost worked. Of course, the filesystems were not mounted properly as asus' initrd needs aufs (in original .config also unionfs has been enabled - no idea why as it seems not to be needed).

Subsequently I took aufs cvs sources (from 25.12.2008, you see when I had so much spare time, right :-)). Since I didn't wanted to mess around with aufs as a module and hack initrd as well, I decided to compile it directly into a kernel. After replacing fs/aufs with the new one, and a bit of fiddling with fs/Makefile and fs/Kconfig, I got it into compilable state.

In this moment, I got a kernel which was already bootable with initrd and Xandros on my EEE. Of course lots of hardware was not working yet properly so I went on:

- applied asus' snd_hda_intel patch. I had to resolve some conflicts, mainly in patch_realtek.c - it seems that stock 2.6.27.10 has already support for certain EEE models, but it didn't work for me (I needed 0x1043,0x8337 which was not there). I had to comment out certain dupe structures which has been added separately in vanilla sources and also by asus' patch. Finally I got it sorted (after reboot, I had to use alsamixer first as Xandros mini mixer is not controlling all volumes).

- applied atl2-2.6.26-4.patch, went quite well.

- took asus_acpi module sources, applied eeemodules-hal patch, compiled and installed it as a module.

- I spent quite some time trying to get new version of wireless (madwifi) stuff in - fighting with iwe_stream_add_* functions, finally realizing that it is not needed at all, as also the ath5k which is in vanilla 2.6.27.10 already works on my EEE - one only has to use 'new' Generic IEEE 802.11 stack, not the old deprecated one (!!!).

Having this, and fiddling with .config even more to get camera working, I was quite happy with the result. My current config can be found under:

http://hajduch.de/ee...config-20081227

(I used '-m' as local version)

Later on, I can publish full sources, but now I am limited to 115kbit connection via BT and my mobile (which was the main reason why I started all this :-)).

There are some things which could be done better - mainly merging asus' snd_hda_intel (patch_realtek) changes - I did it quite dirty, likely the other EEE modes would not be correctly supported with this version - if I find some more time, I will revisit it again and try to submit a kernel patch to save this bit with next kernel version :-).

#5 s0m3body

    Member

  • Members
  • 12 posts

Posted 27 December 2008 - 03:08 PM

Now couple of OS changes which I done as well:

- chmod 000 /usr/sbin/xangetdevices (was 755) - I got quite some segfaults from xangetdevices in log. I 'disabled' it and found so far no problems. There is a reference to this binary in some scripts, listing USB devices - so I tested if USB key is recognized and action offered - and it still is. God knows what this is actually for - any ideas ? (I haven't tested if everything still works with old kernel though)

- I compiled kernel with cpufreq support, added handler for acpi ac_adapter event and a script which changes governor to 'ondemand' (together with p4 modulation it goes as far as 115mhz in idle status) - cannot say if it improves battery life yet though. The script is also called from startsimple.sh to set up proper governor on startup.

http://hajduch.de/ee..._acpi_events_ac
http://hajduch.de/eee/etc_acpi_ac.sh
http://hajduch.de/ee..._startsimple.sh
http://hajduch.de/eee/etc_modules

(added thermal & p4 modulation modules as well)

#6 s0m3body

    Member

  • Members
  • 12 posts

Posted 27 December 2008 - 03:17 PM

- replaced asus' fastinit with finit-mod. This was done to solve shutdown problems, looks like asus' original fastinit cannot shutdown new kernel properly. Here I had to modify finit-mod.c to additionally mount /home which was not there, plus changed path to openvt from /usr/bin/openvt to /bin/openvt (where it was installed by apt-get).

NOTE: in this case, and also in some others, it is not enough to replace executable or config file in normal mode, as the change needs to go to /dev/sda1. I have been therefore constantly rsyncing parts of /dev/sda2 to /dev/sda1 (I have backup of /dev/sda1 for the case, but do not plan to go back anyway).

http://hajduch.de/eee/finit-mod.c

NOTE2: as I already mentioned, if you want to have console on tty2 accessible, you need to install openvt (package kbd I used) and modify xorg.conf - disable DontVTSwitch in ServerFlags section.

- I also compiled & installed wireless-tools.29, original distro had ver 28 and that was not compatible with new kernel any more. It looked working even without this, only complained about possible problems - but I did it just for sure.

#7 s0m3body

    Member

  • Members
  • 12 posts

Posted 27 December 2008 - 03:23 PM

- in order to get wireless working with original network manager & scripts, I had to modify /etc/acpi/wlan.sh as well. One of the differences between original ath_pci and ath5k which I am using now is different default iface name, ath0 with ath_pci and wlan0 with ath5k. I failed to get this done via udev, so opted for an easy hack and renamed the device in wlan.sh after bringing it up.

http://hajduch.de/eee/etc_acpi_wlan.sh

IMPORTANT: in my wlan.sh, I test for kernel version '2.6.27.10-m' - to load ath5k and do a few things differently. If you named your version differently, you need to adjust this. Or do it in a more clever way :-)

#8 s0m3body

    Member

  • Members
  • 12 posts

Posted 27 December 2008 - 03:34 PM

- used well known 3egprs script and set up bluetooth. First of all, many thanks to the author of 3egprs - it saved me a lots of work. It was not straightforward though. I added startup and shutdown of dbus and bluetooth services to the script, as I see no point of having them on all the time.

The biggest problem I had was with pairing. Putting my pairing PIN didn't work - phone asked for PIN, I entered it and then it refused to pair. At last I found into a post tip with starting up bluetooth-applet - which I did - and that did the trick. After typing in passphrase into popup borught up by applet, I finally paired the phone with my BT adapter, and after setting up correct APN, everything suddenly worked :-)

http://hajduch.de/eee/usr_sbin_gprs

#9 s0m3body

    Member

  • Members
  • 12 posts

Posted 27 December 2008 - 03:44 PM

Well, that's it for now - I did some more changes but they are not directly connected to upgrade to 2.6.27.10 (like removing annoying shutdown confirmations, etc ...)

As far as I can tell, everything works as it should, including suspend to ram, wireless, lan, bluetooth and gprs via BT, camera, sound - and everything based on 'default' Asus' Xandros distro.

If anyone wants to try it and has questions, you can also ask directly (faster response time) via email - martin at hajduch dot de. I will try to answer here in forum though, so that it can help more people.

Have fun :-)

#10 s0m3body

    Member

  • Members
  • 12 posts

Posted 30 December 2008 - 11:32 PM

If you get vanilla 2.6.27.10 and apply this patch: http://wbt.assyst.de...-20081230.patch

then you have it all :-)

#11 pistooli

    Senior Member

  • Members
  • 309 posts
  • LocationBudapest/Hungary

Posted 31 December 2008 - 12:11 PM

Quote

If you get vanilla 2.6.27.10 and apply this patch: http://wbt.assyst.de...-20081230.patch

then you have it all :-)
nice... I will try it after the New Years Eve... thanks!!!
EeePC 901 Black, OSX 10.6.1 (32GB RunCore)

#12 lineeepc

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts

Posted 01 January 2009 - 07:42 AM

Neat post. Might want to add a Wiki. One thing that I was trying to figure out is how come the eeepc kernel sources do not include all the patches that you need to build a fully working kernel for the EEE? I had to patch the eeepc kernel sources with aufs to get it to boot with the EEE initrd. Looks like there are a lot more patches to use with the main kernel sources from kernel.org.

#13 RonaldP

    Senior Member

  • Members
  • 574 posts
  • LocationAmsterdam, Netherlands

Posted 01 January 2009 - 06:45 PM

Building or patching kernels is way beyond my skills, but I wonder if some of the problems you are wrestling with are related to the fact that the Asus Eee Xandros distro is a commercial product and not all of its sources are freely available.
901, 4GB SSD + 64GB RunCore SATA SSD (in place of the original 16GB SSD), BIOS 2103
Ubuntu 9.04 NBR on the 64GB SSD + Array.org kernel 2.6.28-12-netbook-eeepc + eee-control for Jaunty
Intel Core 2 Duo iMac Mountain Lion, PowerBook G4 Tiger, PowerBook 5300 Mac OS 8.6, Apple Airport WiFi network WPA/WPA2

#14 lineeepc

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts

Posted 02 January 2009 - 07:34 AM

Quote

fact that the Asus Eee Xandros distro is a commercial product and not all of its sources are freely available.
Off topic: What is included in the 1.6Gb bundle of source code that is downloadable from support.asus.com/download? Does that not include the Xandros source? I agree that not having the source code could be a problem when trying to get a new kernel to work.

#15 s0m3body

    Member

  • Members
  • 12 posts

Posted 02 January 2009 - 08:22 AM

I would not say you do not have the sources. You can download vanilla 2.6.21.4 and a set of patches from Asus' download page. Combining these two, you get something which behaves more or less exactly as the original kernel. There are plenty of patches included, I used only few of them. And in order to get it just boot, you really need only aufs (which I had to take from aufs' download pages, as the one included in Asus' patchset was simply too old to get it working with 2.6.27.10). The rest is to get NIC, WLAN, ACPI, ... working - but some of those are available in updated versions already, or not needed with 2.6.27.10.

The only piece of software I needed and hasn't been able to get sources for, was fastinit. And the original one was not able to shutdown my machine properly (I tried to unload all the modules, etc, no success). But there is a free alternative in finit, and it gives me even a chance to tweak it to my needs.

#16 lineeepc

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts

Posted 02 January 2009 - 11:56 AM

Quote

a set of patches from Asus' download page. ... There are plenty of patches included, I used only few of them. ... The rest is to get NIC, WLAN, ACPI, ... working
The patches that you are talking about are the files for the 701 on the asus ftp site, at ftp.asus.com? These are dated 11/27/2007. These seem to be the patches that you are supposed to use for all EEE models. There are plenty of files, but many of them in the other directories are user manuals in the various languages.

Have you gotten the wireless lan to work on the new kernel build, and did you use the hsf driver?

#17 s0m3body

    Member

  • Members
  • 12 posts

Posted 03 January 2009 - 10:27 PM

Yes, I've got wireless working using ath5k driver, and patched EEE's original script to work with it (renaming device from wlan0 to ath0, etc ...)

See post #7 for details.

Yes, I mean those patches you described - and as I've said, I actually used only two of them for the snd_intel_hda driver (post #4 has more details) and asus_acpi with additional changes from eeemodules-hal patch.

#18 lineeepc

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts

Posted 04 January 2009 - 05:10 AM

Quote

applied asus' snd_hda_intel patch. I had to resolve some conflicts, mainly in patch_realtek.c
...There are some things which could be done better - mainly merging asus' snd_hda_intel (patch_realtek) changes -
Where did you find the ASUS patch? What is the sound card device name? What were the EEE scripts that you modified for ath0?

Edit: I now have sound working on the 2.6.28 kernel, without the ASUS patch. I used alsamixer with PCM and Front set to 100, then adjusted the volume on the speaker panel icon. Sound works!

Edited by lineeepc, 04 January 2009 - 05:32 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users