Xathrya Sabertooth |
Posted: 26 Sep 2013 09:52 PM PDT Installation of Linux Kernel image is divided into two step. First step deals with the installation of kernel modules and static vmlinuz (kernel image). The way to do it is copying the static vmlinuz and all loadable kernel modules to their appropriate locations. The second step deals with the modification of the boot loader configuration file (GRUB, LILO, etc). Installing Image and ModulesThe ‘make’ command builds all the loadable kernel modules in some temporary directory. All we need to do is copying all those modules to the correct location. The location would be same whether you are in 32-bit system or 64-bit system (at least for now). In our case, it would be /lib/modules/<kernel version>/. However, one can ignore copying these manually and use a command to do it. The process can be automated by simply calling a command from make. Of course you need to do it in the end of compilation on certain kernel (on the root directory tree). make modules_install For installing the static kernel (i.e. vmlinuz), the image should be placed to a location where bootloader program can find and boot it. Usually it is /boot. The process is also can be automated by giving command: make install The static image vmlinuz is copied from certain directory to /boot directory. To make it clear, compilation will compile kernel based on your processor architecture (or if you specify other processor) and store it on the corresponding root directory. For x86 and x86_64, the image will be created as $KERNELDIR/arch/i386/boot/vmlinuz. Boot Loader ConfigurationRemember the process of booting: BIOS -> Boot Loader -> Kernel -> Init. Boot Loader is in the second step which will search the kernel images and boot it. Some boot loader will search for the kernel images in the /boot directory. There are two popular bootloaders we use: GRUB (Grand Unified Bootloader) and LILO (Linux Loader). Configuring GrubThe version we use is Grub2. To use grub2 to boot our new linux kernel, we need to edit grub configuration. However you are not necessary to edit the file manually. Just run the command to make grub update the list, with root privilege of course: update-grub Configuring LILOLinux Loader is considered old but still used on several distribution. To add new kernel image to LILO entry, you can use following template and modify it to your need. You should append it to LILO configuration file, which is /etc/lilo.conf: image=/boot/vmlinuz label=linux read-only root=/dev/hda3 initrd=/boot/initrd-2.4.2-2.img append=" resume=/dev/sda2" So here is the explanation: The image is vmlinuz which located on /boot directory. The entry would be labeled as “linux”. You should make this unique. The root file system is /dev/hda3. Make sure you have a kernel which can read the file system. Especially if your root file system is not usual such as XFS, ZFS, ReiserFS, etc. The initial ramdisk is initrd-2.4.2-2.img which is located on /boot. You can ignore this if your kernel doesn’t need initial ramdisk. Append is used to add several argument to kernel. On that entry, we add capability to hibernate and sleep. For that capability kernel need a swap partition to read and write a temporary data. Therefore we specify /dev/sda2 which is a swap partition. Practical Sample |
Posted: 26 Sep 2013 09:39 PM PDT If you wish to install linux kernel without doing compilation stage, you can then create a package of the binary kernel image. Just take the package to the target machine and install it to machine you want. For creating the build package, while building kernel, instead of giving ‘make’ command alone do one of following command. These commands will creates bzImage and modules and then pack them into a package file. The available commands are: make rpm-pkg make binrpm-pkg make deb-pkg make tar-pkg make rargz-pkg make tarbz2-pkg |
You are subscribed to email updates from Xathrya Sabertooth To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
Tidak ada komentar:
Posting Komentar