UPDATED to kernel 2.6.22.2 -howto
################################
#Donīt do this unless you need a new kernel! #
################################
To begin, you need a working hd install, if you don't yet have, search for "gopher" or look in the Wiki for alternatives.
About this howto:
This is quite long, I tried explaining what needs to be done, and the post should be newbie-friendly.
1. Backup everything important
Iīve had a lot of problems while learning to work with kernel recompiling (newbie of course
). The worst-case-scenario could be a re-install to hd, but usually copying a working vmlinuz to /boot/ is enough to recover and continue trying. Iīm really interested getting feedback how this howto works for others.
2. Download and install necessary files
I'd like state here, that none of the scripts are my work (All credits go to Tomas M and "vstoykov"), I merely figured out, how to use them and how to make the .iso smaller (and some bugs or problems).
Let's get started!
Make a directory for all required files
The name can be anything and be in anywhere, but I use /livecd/ so that I can find it easily and the files don't accidentally get to .iso or live-usb-install.
2.1 Kernel-build-scripts (Author Tomas M, modified by "vstoykov")
Download the modified kernel 2.6.22.2 build script from
http://vslivecd.openfmi.net/slp/kern...AST_v11.tar.gz
to
/livecd/
and unpack it with
Code:
tar zxvf Build_kernel_for_VAST_v11.tar.gz
That should create a directory called "new", although you can rename it if you like to more appropriate name.
Remove the linux-2.6.22.2.tar.bz2 symlink from
/livecd/new/
with
Code:
rm linux-2.6.22.2.tar.bz2
So that you can replace it with the real kernel package.
2.2 Download kernel 2.6.22.2
from
http://www.kernel.org/pub/linux/kern...6.22.2.tar.bz2
and place it in
/livecd/new/
2.3 Download Linux-live-scripts (Author Tomas M)
from
ftp://ftp.slax.org/Linux-Live/linux-live-6.1.0.tar.gz
and unpack it in
/livecd/
with
Code:
tar zxvf linux-live-6.1.0.tar.gz
Note: There are newer versions (currently 6.1.4 is latest), but 6.1.4 has some poweroff-issues, and I don't advice using it, besides it doesn't add anything compared to 6.1.0..
3. Prepare to install kernel
at /usr/src/
and remove everything
Code:
cd /usr/src/
rm -r *
Note: Please check that you're in the right place..
Yes, this will remove alsa and ipw3945 drivers to mention, but alsa can be compiled in kernel and ipw3945 is easy to get later if you need it, or you can move the /usr/src/drivers/ipw3945-1.2.0/ directory to a "safe location", which could be /tmp/ for now.
(if you're already running a modified kernel, you can use your .config as a base to build the new one, but it's safer to use the default one and later tweak it if you like).
4. Install the new kernel
at /livecd/new
modify config with
Code:
kwrite /livecd/new/config
and edit line
CONFIG_BLK_DEV_LOOP=y
to say
CONFIG_BLK_DEV_LOOP=m
and you can also choose a appropriate cpu option in config
For instance, a Centrino Duo requires following (google for appropriate cpu settings for you)
comment out
CONFIG_M586=y
and change
# CONFIG_MPENTIUMM is not set
to
CONFIG_MPENTIUMM=y
When happy with config, proceed with building the new kernel (in /livecd/new/)
The script may still ask you to enter your cpu-type and gives a list of choices.
When completed (~30min), install new kernel
at /tmp/linux-2.6.22.2/
Code:
installpkg linux-2.6.22.2-i686-4.tgz
(the name might alter a little, but you'll manage!)
and REBOOT.
Note: I'm using Grub, if using lilo, you might have to run it again, if the install script doesn't. I'm really not sure.
After rebooting, if you receive some errors about module dependencies, commence
Code:
cd /usr/src/linux
depmod -e -F System.map
and REBOOT again
5. Prepare to compress image
Add/remove/update the tools of your choice
6. .iso size tweaking
We can safely remove some of the stuff that would be otherwise take space from .iso (especially if you're trying to compile a 700MB cd)
at /usr/src/
remove all files and directories but linux symlink and linux-2.6.22.2
at /lib/modules
remove 2.6.20-xxx dir
at /usr/src/linux/
Note: If extra space is really needed, or you wish to modify further the kernel settings without difficult text-editor in step 4. ,recompile kernel and create a smaller kernel and modules-directory by hand-picking all kernel components (with a little trouble easily down to ~650modules or less which means ~25MB less uncompressed size). Then build again as suggested in step 3. "modified kernel" by copying .config from /usr/src/linux to /livecd/new/ and rename it to config (And do all the other steps again)
7. Compress Image
at /livecd/linux-live-6.1.0/
modify .config by
Code:
kwrite /livecd/linux-live-6.1.0/.config
change the line
MKMOD="bin etc home lib lib64 opt root usr sbin srv var"
to
MKMOD="bin etc home lib lib64 opt pentest root usr sbin srv var"
then run
give LiveCD name when prompted, enter The name is very important, otherwise at bootup the live data can't be found. Default path to kernel is ok. The process takes about 30minutes to complete.
7. Install to CD/USB
7.1To make a CD:
at /tmp/live_data_xxxx/BT/
and burn the .iso slowly (some say at 2x-4x)
7.2To make a bootable USB (recommended):Copy linuxcd and boot directories from /tmp/live_data_xxxx/ to your sticks root and then run
at /sticks-root/boot/
the stick is now bootable.
8. What I added/updated
sqlite.3.4.0-module (By Balding_Parrot, BT Wiki)
ruby-gtk2-0.16.0 module
ruby-libglade2-0.16.0 module
medusa v1.3
Aircrack-ng 1.0 dev 664
Ati-proprietary-drivers 8.40.x from www.ati.com
updated framework3 and milw0rm
madwifi-ng drivers
some firefox extensions (fasterfox, fireftp, firefox, downthemall, ablock plus)
some my native language dictionaries
and
The passwd command changes the root password, which is quite nice.. Choose a strong password.
My actual .iso size was 695MB (plenty of space remaining
), but if you update a lot of things, space may be a problem, if you insist on building a liveCD..
EXTRA: IPW3945 INSTALL
The ipw3945 requires (sometimes) the rf kill switch support, you can easily add that to kernel config in step 4. by modifiying config in /livecd/new/ with
"kwrite /livecd/new/config"
and change the line
# CONFIG_RFKILL is not set
to
CONFIG_RFKILL=y
CONFIG_RFKILL_INPUT=y
Then you need to get the new drivers
download http://prdownloads.sourceforge.net/ipw3945/ipw3945-1.2.2.tgz?download
to /tmp/
unpack it with
Code:
tar xvf ipw3945-1.2.2.tgz
and build&install it with
Code:
cd /tmp/ipw3945-1.2.2/
make && make install
and you should be fine. (For monitor mode to work, you need to modify the Makefile)
Note: IF you receive ieee80211 errors while building the driver, you need to get ieee80211 driver, the version 1.2.18 works with new kernel if I recall correctly.
Please don't bother downloading any other stuff for ipw3945 (like firmware), as everything is ready in Backtrack and it should work as it is.
TO ALL READERS:
I will update and modify this post if it's needed (etc more specific instructions), so please give me a holler if something works or doesn't (post or pm, anything goes). Whereas creating "own" modified livecd/usb perhaps isn't really needed for most of the people, there are some who might find this useful, for kernel 2.6.22.2 has better hardware support (including rf kill switch, my ipw3945 works perfectly with it now) and possibly something else (those who need it, probably now because something doesn't work before).
Another reason for me was my Centrino Duo cpu, which showed only one core and I wanted more..
BUT if nothing more, atleast this thread answers the post "How do i change livecd password"
Hope you like,
"Whoawhoawewa!" (Borat)