Main Menu
Home
About
Archive
Zen Kernel
Downloads
Satellite
Dish Keys
SURGE
Links
Search
Search Bible
Feed Me!
 

 Subscribe

Add to Google

Add to Pageflakes

Subscribe in Bloglines

Add to My AOL



 




Top Technology blogs




Zen Kernel Packages for Ubuntu and Debian
Saturday, 24 November 2007
Zen-Ubuntu Kernel

Caveats: Reiser4 not working, yet. See the wiki to get the nVidia drivers to work!

NOW ANNOUNCING buildZen

buildZen is a bash script that guides you through the process of building the Zen kernel yourself. It makes it very, very easy! Just follow the prompts as you go along! It is not one time use, as you can run it again, when you are ready to update your source tree and build the kernel again. Just follow the instructions in the prompts, and you will be fine!

This is a beta, but it works. Please tell me of any issues you encounter. You can either download it by clicking here, or you can copy and paste from below. Put it in a text file named buildZen, and chmod +x buildZen after that. Then, to run the script, use sudo sh buildZen and follow the directions. Note that xconfig or gconfig should be used first, as they are easier to use when you get to the configuration step. Note that if you exit the script, you can always leave off from where you left off. Hopefully, this script will be a crutch to teach you how to configure and compile, and you will eventually stop using it and doing it the normal way.

Good luck, and have fun! Make sure to leave one default Ubuntu kernel installed at all times, as a fallback! Don't forget the wiki article, as it will contain information regarding not only buildZen, but other topics, such as firmware for wireless drivers, and nVidia and ATI installation directions.

Fixes: permissions should now be automatically set, and if root isn't running the script, it exits. Furthermore, everything should go nicely.

READ THE DOCUMENTATION ON THE WIKI!

AND SEE THE OFFICIAL ZEN SITE!

ALWAYS KEEP ANOTHER KERNEL INSTALLED TO FALL BACK ON IN THE EVENT THIS ONE MAY FAIL!

Code:
#!/bin/sh

#This script is under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Please attribute it and any part of it you use to Matt Parnell, and #http://www.mattparnell.com/zen/. If you improve or change, or make a fork, please let me know, as well. Contact me at admin@mattparnell.com. To use, chmod +x the script, and then run it by either dropping it into your #/sbin/ dir, or ./buildZen to run it. It pretty well explains everything it's doing. To contact me, or give me #commentary or improvements, see http://www.mattparnell.com/, or email me at admin@mattparnell.com.

if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi

echo -en "
\033[1;32m[INTRODUCTION]
This script will aid you in building the Zen kernel, which you will be building from the git tree. Rerun this script whenever you want to rebuild or update the source tree.

To continue, type \"y\" if you haven't run this script before, \"b\" if you have run this script before, or \"n\" to exit, and hit enter:\033[1;37m

";

read R;

if [ "$R" = "n" ]; then
exit

elif [ "$R" = "y" ]; then
apt-get update;
apt-get -y install kernel-package libncurses5-dev git git-core bzip2 wget;

chmod -R 777 /usr/src/*

echo "

\033[1;32m[CLONE THE SOURCE TREE]
Now, we must clone the sources via git, using the command \"git clone\". The cloning process takes anywhere from 5 to 60 minutes, sometimes more. Go grab a coffee or surf the web. It's worth the wait. May I suggest browsing mattparnell.com ?\033[1;37m";

cd /usr/src/;
git clone git://zen-sources.org/zen/kernel.git;

echo "

\033[1;32mThe source is now cloned on your local drive.\033[1;37m"

else

echo "

\033[1;32m[UPDATE THE SOURCE TREE]
We don't have to wait from now on. We simply update your copy of the source code by using \"git pull\" from your kernel source directory.\033[1;37m";

cd /usr/src/kernel/;
git pull;

echo "

\033[1;32mYour source is now updated!\033[1;37m";

fi

if [ "$R" = "b" ]; then
echo "

\033[1;32m[CONFIGURE THE KERNEL]
Skipping download of base config, so you can keep your past choices and go from there.\033[1;37m";

else

echo "
\033[1;32m[CONFIGURE THE KERNEL]
Only a few steps left! We need to configure the options for your kernel. First, we need to download a base configuration file that is optimized for your processor.\033[1;37m";

echo "
\033[1;32m
1: 64 bit AMD Processors
2: generic 64 bit support
3: 32 bit processors

Note that you can change the processor type, if you see a more specific option when you configure your kernel, you may choose it instead. It is suggested, especially for 32 bit users, that this be done, as your processor family needs to be selected...keep that in mind!

Enter your choice:\033[1;37m";

read ARC;
cd /usr/src/kernel/;
rm .config;

if [ "$ARC" = "1" ]; then
wget http://www.mattparnell.com/zen/prefab/amd64;
mv amd64 .config;
elif [ "$ARC" = "2" ]; then
wget http://www.mattparnell.com/zen/prefab/x86_64;
mv x86_64 .config;
else
wget http://www.mattparnell.com/zen/prefab/x86;
mv x86 .config;
fi
fi

echo "

\033[1;32m[CHANGING CONFIGURATION OPTIONS]
From here the options are all up to your discretion. It is suggested that you deselect any drivers, functions, or other options that you know you will not use. If in doubt, disable it. If something is broken or the kernel does not boot, just remove it, re-enable the option, and build. Make sure to take notes your first few tries, and remember to uninstall your old and broken Zen kernels. Always leave a default Ubuntu kernel installed to fall back on!


To configure your kernel, we need to know what interface you wish to use.

xconfig: 1
gconfig: 2
menuconfig: 3

When finished, save and close the interface you choose to continue on to the building process.

Choice:\033[1;37m"

read I;
cd /usr/src/kernel/;

if [ "$I" = "1" ]; then
make xconfig;
elif [ "$I" = "2" ]; then
make gconfig;
else
make menuconfig;
fi

echo "

\033[1;32m[BUILD THE KERNEL]
Now that that is all over, we are finally ready to build your kernel. Ubuntu has a script that automates the process, in which it builds your kernel into a nice deb package. You can install that, I hope. All that is left is issuing the command to make that package. This will take some time, and will take all of your computing resources. This is a really good time to walk off for 30 minutes to an hour, and do something else.

To continue, enter y. Otherwise, enter n to exit:\033[1;37m";

read BD;
cd /usr/src/kernel/;

if [ "$BD" = "y" ]; then
INSTALL_MOD_STRIP=1 CONCURRENCY_LEVEL=2 make-kpkg --initrd kernel_image kernel_headers;
echo "

[FINISHED]
\033[1;32mDone! Exiting. You should be able to figure out how to install your kernel, the normal way with deb packages.

[SUPPORT]
Read the Zen Kernel entry in the Ubuntu wiki to learn how to install wireless firmware, and setup the TuxOnIce suspend features, among others. To install the nVidia drivers, you will need the nVidia installer, as well as a patch available at http://www.mattparnell.com/zen/PKGBUILD/nvidia/xen.patch.txt .

You may want to see zen-sources.org, as well as the Zen thread on the Gentoo forums, which is linked to at mattparnell.com/zen.html. You can find further support in the Zen thread on Ubuntuforums.\033[1;37m";

else
echo "\033[1;37m"
exit;
fi


 

© Matt Parnell's Brain: Plugged In!