Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Create your own custom usb/livecd from bt2 with kernel

  1. #1
    Join Date
    Aug 2007

    Default Create your own custom usb/livecd from bt2 with kernel

    UPDATED to kernel -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
    cd /
    mkdir livecd
    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 build script from

    and unpack it with
    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- symlink from
    rm linux-
    So that you can replace it with the real kernel package.

    2.2 Download kernel


    and place it in

    2.3 Download Linux-live-scripts (Author Tomas M)

    and unpack it in
    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
    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
    kwrite /livecd/new/config
    and edit line
    to say

    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
    and change
    # CONFIG_MPENTIUMM is not set

    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-
    installpkg linux-
    (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
    cd /usr/src/linux
    depmod -e -F
    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-
    at /lib/modules
    remove 2.6.20-xxx dir
    at /usr/src/linux/
    make clean
    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
    kwrite /livecd/linux-live-6.1.0/.config
    change the line
    MKMOD="bin etc home lib lib64 opt root usr sbin srv var"
    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
    updated framework3 and milw0rm
    madwifi-ng drivers
    some firefox extensions (fasterfox, fireftp, firefox, downthemall, ablock plus)
    some my native language dictionaries
    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..


    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



    Then you need to get the new drivers
    to /tmp/
    unpack it with
    tar xvf ipw3945-1.2.2.tgz
    and build&install it with
    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.

    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 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)

  2. #2
    Join Date
    Mar 2007


    Not for me but great to see afirst time poster giving a tutorial

  3. #3
    Join Date
    Aug 2007


    Yes, surely not a very popular subject, but I found it quite annoying to have only one core available. Couldn't imagine any other reason to recompile current kernel (almost everything is compiled already as modules).

    Could someone explain, why "dbt" cheat code doesn't work (atleast for me), that would render this "horribly complicated method" useless?

    please ignore next message, because I've changed the first thread and the typos no longer apply

    Learn to live, but live to learn, eh?

  4. #4
    Junior Member
    Join Date
    Jul 2007

    Thumbs up

    Good tutorial, I'm now in the middle of building my new modified usb install!
    One tiny typo:

    patch -p1 <  usr/src/squashfs3.2-r2/kernel-patches/linux-2.6.20/squashfs3.2-patch
    should be:

    patch -p1 <  /usr/src/squashfs3.2-r2/kernel-patches/linux-2.6.20/squashfs3.2-patch
    Only a small one, just being picky I know!
    Also these two directories were already built for me:

    mkdir /lib/modules/2.6.20-BT-PwnSauce-NOSMP/kernel/fs/aufs
    mkdir /lib/modules/2.6.20-BT-PwnSauce-NOSMP/kernel/fs/squashfs
    Great tutorial though, have been looking for something like this for a while!

  5. #5

    Default nice work,

    Thanks for posting this guide. We do appreciate it.

    15" MBP 8 gigs o ram 256 gig SSD in drivebay + 256 gig 5400 HD
    1000HE EEE 30 gig SSD 2 gigs Ram

  6. #6
    Developer balding_parrot's Avatar
    Join Date
    May 2007


    Great work, I told you people would like it when you PM'd me asking if you should post it.

  7. #7
    Senior Member imported_spankdidly's Avatar
    Join Date
    Feb 2006


    Awesome! great job!
    I felt like bending the bars back, and ripping out the window frames and eating them. yes, eating them! Leaping, leaping, leaping! Colonics for everyone! All right! You dumb*sses. I'm a mental patient. I'm *supposed* to act out!

  8. #8
    Just burned his ISO lock_n_loll's Avatar
    Join Date
    Jul 2007


    Yeah Thanks alot for your guides
    I'm trying to re-compile my kernel now
    thanks alot
    Damn Am I Late ?
    Mitsubishi AMITY XP P166 MMX 32M HD 6 GB Linksys WPC11 v4 FreeBSD 7.0 + BT2

  9. #9
    Senior Member shamanvirtuel's Avatar
    Join Date
    Mar 2010
    Somewhere in the "Ex" human right country


    BT3 will support smp/nosmp ..... so if you want something stable.....just wait.....
    Watch your back, your packetz will belong to me soon... xD

    BackTrack :
    Giving Machine Guns to Monkeys since 2006

  10. #10
    Join Date
    Aug 2007


    Quote Originally Posted by shamanvirtuel View Post
    BT3 will support smp/nosmp ..... so if you want something stable.....just wait.....
    Kernel Is stable (I think). Yes, I admit, that this procedure is made from bits and bots, but it works (poweroff excluded) The ipw3945 is not such a loss, and I think itīs a problem to be solved (the poweroff-bug will be solved also, Iīm not alone with that one). For those, who want something ready and specificly for bt2, should wait. If one wants to experiment and needs new kernel (hardware support problems?) or a normal live-usb-with-changes (not bad either) isnīt enough, then this could be worth trying. Donīt get me wrong shamanvirtuel, I totally respect your view and especially much longer experience...

    Wasnīt bt2 supposed to support smp too? (doesnīt work for me)

    FIXED: ipw3945 AND poweroff

    Learn to live, but live to learn, eh?

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts