I finally took the time to recompile my EeePC Kernel to include highmem or memory over 1GB. I have the kernel recompiled to support up to 4GB but the EeePC bios only supports up to 2GB. In this article I will show you how it is done, how to do it yourself, and how to take the easy way out and use my pre-compiled kernel. You may also want iptables in your kernel for a firewall. I show you how to add that as well.
STEP 1 (Backup your EeePC):
YOU CAN SKIP THIS STEP IF YOU DON’T CARE TO BACKUP YOUR SYSTEM. IF YOU CHOOSE NOT TO BACKUP AND YOU BRICK YOUR EEE OS YOU WILL HAVE TO RESTORE FROM THE EEEPC CD-ROM. FOR THAT YOU WILL NEED A EXTERNAL USB CD-ROM OR FLASH DEVICE
You may backup your entire SSD by running the (dd) command with (/dev/sda) or individual partitions on your sda. There are 4 individual partitions located on the SSD and they are (sda1, sda2, sda3, and sda4).
My MMC-SD 16GB is using the vfat filesystem. I am mainly concerned with backing up (sda1, and sda2) which sda1=system partition and sda2=user partition because these are the partitions I will be working with and I don’t want to loose my personal settings that I have accumulated over it’s 3 months of use. These locations will differ when you boot to a external distro as seen below. Below will show you how to backup your entire SSD including the partitioning. EVERY BIT.
TO BACKUP INFORMATION TO MMC-SD:
- Create a usb bootable flash stick using slax linux or knoppix
SLAX USB installation tutorial (Using Windows): (Source: Pendrivelinux Slax)
Knoppix USB installation tutorial (Using Windows): (Source: Pendrivelinux Knoppix)
If you prefer to use linux to create a bootable system on USB or Flash use this instead: (Source: Pendrivelinux Knoppix 2)
-Reboot. Press [Esc] at startup and select (USB:NAME OF DEVICE) in my case it is: (USB:SanDisk Cruzer Mini)
-(I used Slax) Once in slax login with: USERNAME: root PASSWORD:toor
-Your USB flash stick and MMC-SD card will be automounted.
-In my case, using the “mount” command I found my SSD at “/dev/hdc” and my MMC-SD at “/dev/sda1″. “/dev/sda1″ is automounted at: “/mnt/sda1_removable”
-To backup my SSD to the MMC-SD I ran:
dd if=/dev/hdc of=/mnt/sda1_removable/eeebackup.img
If you ever have to restore it, just boot back to Slax and run:
dd if=/mnt/sda1_removable/eeebackup.img of=/dev/hdc
It will take a little while to back up the SSD. In my case, it took 2480.21 seconds (41 Minutes) at 1.6 MB/s.
Now that all your hard work has been backed up it is time to start gathering.
STEP 2 (Install Repos and Dependencies):
- begin by following my article on installing repos and apt pinning.
(http://ruckman.net/tech/2007/08/17/eeepc-xandros-added-repositories/)
-Run the following:
apt-get update
apt-get upgrade
apt-get install build-essential gcc cpp libc6-dev libncurses5-dev
STEP 3 (Install Single User Mode):
NOTE: You will need to know how to use the ‘vi’ editor. Tutorial here:
(http://unix.t-a-y-l-o-r.com/Vbasics.html)
Turn on eeePC and hit F9 until GRUB bootloader appears
press ‘e’ to edit the normal boot option
Now you’ll see a screen showing the Grub entries associated with that boot choice. Scroll down to the one that starts with “kernel /boot/vmlinuz….” and then again press the ‘e’ key to edit this line.
Now you’ll be taken to an editor screen that shows you the end of the line you were previously looking at. Add the following to that line: XANDROSBOOTDEBUG=y and then press Enter. You’ll be taken back to the screen showing the 3 lines for this boot option.
Now press ‘b’ to boot. You’ll be taken to a BusyBox shell, with root permissions.
Installing rescue mode (Single User Mode) is simply the process of adding another entry to the Grub boot menu, so you don’t have to make the edits we previously described each time you want to enter single-user mode.
You need to edit the file /boot/grub/menu.lst, and you need to do it as root, and you need to do it single-user mode. So, follow the previous instructions to start single-user mode, then mount /dev/sda1 on /mnt-system:
mount /dev/sda1 /mnt-system
Then use vi to edit /mnt-system/boot/grub/menu.lst:
vi /mnt-system/boot/grub/menu.lst
After opening the file, you’ll see three entries. Type the following entry after the first entry:
title Rescue Console
root (0×80,0)
kernel /boot/vmlinuz-2.6.21.4-eeepc quiet rw irqpoll root=/dev/sda1 XANDROSBOOTDEBUG=y
initrd /boot/initramfs-eeepc.img
(Be careful about the numbers - if the other entries in menu.lst do not have 2.6.21.4, use the one they use.)
Now save your file and close the editor (using Esc :wq in vi). Then power down the Eee PC. Next time you need Rescue Mode, you can select this option.
STEP 4 (Obtain and compile the kernel):
Asus has made the kernel source for the stock hardware available here:
(http://support.asus.com/download/Download.aspx?SLanguage=en-us)
I downloaded and uncompressed it, installing it to /usr/src. (dpkg -i linux-source-2.6.21.4-eeepc_5_all.deb) then extract the files. (tar -xjf linux-source-2.6.21.4-eeepc.tar.bz2)
I got the original kernel configuration file from /boot/config-2.6.21.4-eeepc, and copied this to /usr/src/linux-source-2.6.21.4-eeepc/.config, and ran:
make oldconfig
make prepare
make scripts
I then opened up the config file in a text editor and changed the following:
CONFIG_LOCALVERSION to:
CONFIG_LOCALVERSION=”-eeepc-HIGHMEM”
CONFIG_NOHIGHMEM to:
# CONFIG_NOHIGHMEM is not set
I changed the CONFIG_HIGHMEM4G to:
CONFIG_HIGHMEM4G=y
You may now save that file and run the following command:
make menuconfig
You can accept the defaults or for a more advanced configuration you can add or remove kernel modules. For instance if you wanted iptables you could add netfilter.
For IPTABLES (Netfilter) do make menuconfig and enable “networking > networking options > network packet filtering framework (netfilter)”
And then in the netfilter sub options enable all iptables options as a module <M>.
Device drivers (A list to help you for iptables)
- Networking support
- [y] Networking support
- Networking options
- Network packet filtering
- [y] Network packet filtering
- IP: Netfilter Configuration (*)
- [y/m] Connection tracking
- [y/m] IP tables support
- [y/m] Connection state match support
- [y/m] Connection tracking match support
- [y/m] Packet filtering
- [y/m] Full NAT
- [y/m] LOG target support
FINALLY!
Compile the new kenel (This will take a while):
make bzImage
make modules
make modules_install
Because I changed the name of the “local version”, the modules got copied to a new sub-directory of /lib/modules. If you don’t change the name, and you use the stock source, your existing modules will be overwritten, and this will have weird events when you try to boot your old kernel that will try unsuccessfully to use the new modules.
Note also that I DID NOT run ‘make install’ to put the kernel in /boot!
STEP 5 (Install the kernel):
reboot and switch to single user mode:
Mount the partitions:
mount /dev/sda1 /mnt-system
mount /dev/sda2 /mnt-user
Copy your new kernel to its new home:
cp /mnt-user/usr/src/linux-source-2.6.21.4/arch/i386/boot/bzImage /mnt-system/boot/vmlinuz-2.6.21.4-eeepc-HIGHMEM
edit grub to add new kernel.
vi /mnt-system/boot/grub/menu.lst
Add the following:
title Nornal Boot Highmem
root(0×80,0)
kernel /boot/vmlinuz-2.6.21.4-eeepc-HIGHMEM quiet rw vga=785 irqpoll i8042.noloop=1 root=/dev/sda1
initrd /boot/initramfs-eeepc.img
Also change the default to a different number if needed. 0 would equal the first entry, 1 the second entry to boot by default and so on.
Save the file and return to the root directory.
Unmount the filesystem:
umount /mnt-system
umount /mnt-user
Reboot to test your new kernel.
You also may run into wifi driver issues after a recompile. You can do the following to help resolve them. This will install the updated Madwifi drivers:
wget ‘http://snapshots.madwifi.org/special/madwifi-ng-r2756+ar5007.tar.gz’
tar zxvf madwifi-ng-r2756+ar5007.tar.gz
cd madwifi-ng-r2756+ar5007
make clean
make
sudo make install
reboot
THE EASY WAY:
Now that you have done all that compiling and installing, if you have a 701 4G like me, you can just download my precompiled kernel and do STEP 5. ENJOY!
HIGHMEM KERNEL DOWNLOAD 701 4G KERNEL 2.6.21.4
Note: The easy install kernel supports up to 4GB of memory, but does not support iptables (Netfilter)! Netfilter requires additional modules to be installed which means you must compile the kernel yourself to get iptables working. You must compile and install the additional modules using menuconfig as listed in the steps above. Hopefully Asus will send a update to include iptables in the future for those who are too faint of heart to attempt a kernel recompile on their own.