It is possible to create a bootable version of Debian in an USB pen drive. Though it might not fulfill all your requirements, it is worth a try.
1) To achieve the bootable version of Debian, you will need to create a new kernel which will boot the system in the desired manner. For creating the base of the kernel, you will need to add some tools that need to work along with it. To do it, enter the following code,
Quote:
| apt-get install build-essential ncurses-base ncurses-dev fakeroot kernel-package |
2) Now you will need to get the
stable boot kernel for booting of your kernel and its features at the startup. After downloading the stable kernel, you will need to unzip it and extract its components for use. You will need to extract the components in the home folder of your operating system.
3) Now you will need to construct a new configuration for the kernel you are developing. You can even use the default configuration that is provided by the system, but it is preferable to create your own custom configuration to get a better control over your kernel. To establish the default configuration on the new kernel, you will need to go into file manager in the/boot folder. There you will need to search for files which have its name beginning with config. Depending on your system, it might show you multiple files with various configurations and attributes. To get the one which you need for your required system will need to be searched by using this command,
Quote:
| cp /boot/config-3.2.0-2.dmz.1-liquorix-amd64 .config |
4) Now that you have create a boot version of your kernel, you will need to create a menu to select the required options and to change its settings if needed. See to it that you keep the menu small and only add items that you need. Type, make menuconfig, in your terminal and it will bring up a little screen on your desktop in which you can add options. It will have some options in it initially; you can remove them, replace them or change them as you want. It is better to have the modules as options in the menu rather than having items that will execute the modules as a part of the menu. Adding the modules to menu directly has its own advantage. If you add a client item, then at the startup the kernel will load every of them. But if modules are added, they won’t be executed at the startup except for few ones. They will only be loaded when required or when system or user demands. Also startup of the kernel will be faster with inclusion of modules. You will also need to prepare a root environment for the kernel. To create it, type the following command in the terminal,
5) Now that you have created booting technique, environment, menu and other required functions for your kernel, you will now need to create it. To create your designed kernel, use the following command,
Quote:
| fakeroot make-kpkg --jobs=2 --initrd --append-to-version=-cobber --revision=20120204 kernel_image kernel_headers modules_image |
This is the base structure of the command for kernel creation which I have provided. It may be possible that this might not work as expected because I have given according to my system. You will need to edit few parameters of it or maybe some structural changes to suit it to your system.
If you notice the command line I have given, then there is a ‘
--jobs=2’ parameter in it. This parameter is used to denote the number of processes that your kernel can request the processor to follow at a time. I am using a dual core system and thus the value is two. If you are using an older processor than dual core, then I suggest you to skip that parameter from the command line. If you will be using this kernel on any other processor which is advanced than dual core ones, like quad core, then set the value of ‘--jobs’ to 4, that is ‘--jobs=4’. Again in the same command line, if you notice, then you will see a ‘
--append-to-version=-cobber’ parameter. This parameter is needed to set the identifier to your kernel. I am using the Cobber as the identifier in my system and also to build the kernel. If you are using a different type of naming system in your system, then you will need to mention its name instead of Cobber in the command line. If in future you will be building another such kernel, then possibilities may be that you will need to modify this same kernel to suit the new needs. To differentiate between the both kernels, you will need to assign a version number to both of them. The parameter ‘
--revision=-20120204’ you see in the command line describes it. You can change the umber that suits you to describe the version number for the kernel.
Now that you have finished making the kernel, let the system finish accepting the changes and do some background processes it needs before finalizing the kernel. The kernel thus created will be saved in same folder that you began in, preferably the home folder of your system. I won’t guarantee you an error free or bug free kernel as its performance and behavior might change from system to system. But you can keep a note of the errors and bug it gives and try correcting them.