Try compiling and booting the linux-2.6.32 kernel on Ubuntu 14.04

Source: Internet
Author: User
Tags bz2

Compiling and booting the linux-2.6.32 kernel on Ubuntu 14.04

Environment
$ cat/etc/issue
Ubuntu 14.04.5 LTS \ \l

$ uname-a
Linux Ui386 4.4.0-31-generic #50 ~14.04.1-ubuntu SMP Wed Jul 01:06:37 UTC i686 i686 i686 gnu/linux

[Change gcc-4.8 to gcc-4.4, otherwise there will be some compilation errors]
$ gcc-v
$ cat/proc/version
Linux version 4.4.0-31-generic ([email protected]) (GCC version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)) #50 ~14.04.1-ubunt U SMP Wed Jul 01:06:37 UTC 2016
$ which GCC
$ ls-l/usr/bin/| grep gcc
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install gcc-4.4
$ sudo apt-get install g++-4.4
$ sudo update-alternatives--install/usr/bin/gcc gcc/usr/bin/gcc-4.4--slave/usr/bin/g++ g++/usr/bin/g++-4.4
$ sudo update-alternatives--install/usr/bin/gcc gcc/usr/bin/gcc-4.8--slave/usr/bin/g++ g++/usr/bin/g++-4.8
$ sudo update-alternatives--query gcc
$ sudo update-alternatives--config gcc

$ sudo apt-get install build-essential kernel-package Libncurses5-dev
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.tar.bz2
$ tar jxvf linux-2.6.32.tar.bz2
$ CD linux-2.6.32
$ sudo make Mrproper
$ make Menuconfig//default configuration can be
$ make-j8 >. /log/log2_6_32-1 2>&1
$ make Bzimage
Kernel:arch/x86/boot/bzimage is ready (#2)
$ make Modules
WARNING:modpost:Found 1 section mismatch (es).
To see full details build your kernel with:
' Make config_debug_section_mismatch=y '
$ sudo make Modules_install
Depmod 2.6.32
Depmod:WARNING:could not open/lib/modules/2.6.32/modules.builtin:no such file or directory
$ ls/lib/modules
2.6.32 4.4.0-31-generic
$ ls-l/boot/| Grep-i "2.6.32"
-rw-r--r--1 root root 93547 September 5 14:31 config-2.6.32
-rw-r--r--1 root root 2688277 September 5 14:31 initrd.img-2.6.32
-rw-r--r--1 root root 1744261 September 5 14:31 system.map-2.6.32
-rw-r--r--1 root root 3932352 September 5 14:31 vmlinuz-2.6.32
INITRD.IMG-2.6.32 has been generated and does not need to execute the MKINITRAMFS command.
[Email protected]:~/workspace/ldd3/linux-2.6.32-v1$ grub-install--version
Grub-install (GRUB) 2.02~beta2-9ubuntu1.12
[Email protected]:~/workspace/ldd3/linux-2.6.32-v1$ sudo update-grub
[sudo] password for Fnie:
Generating GRUB configuration file ...
Warning:setting grub_timeout to a Non-zero value when grub_hidden_timeout are set is no longer supported.
Found Linux Image:/boot/vmlinuz-4.4.0-31-generic
Found initrd Image:/boot/initrd.img-4.4.0-31-generic
Found Linux Image:/boot/vmlinuz-2.6.32
Found initrd Image:/boot/initrd.img-2.6.32
Found memtest86+ Image:/boot/memtest86+.elf
Found memtest86+ Image:/boot/memtest86+.bin
Done

Shut down reboot, press and hold SHIFT key, enter recovery mode, select Start 2.6.32,
Loading Linux 2.6.32 ...
Loading Initial RAMDisk ...
Failed to start.

Had to find another way: use Make-kpkg.
$ sudo apt-get install Kernel-package
$ sudo make-kpkg clean
Compile, two files are generated at the end of the parent directory: Linux-image-xxx.deb and Linux-head-xxx.deb
$ sudo make-kpkg--initrd--append-to-version=linux-2.6.10-1 kernel-image kernel-headers
[Email protected]:~/workspace/ldd3/linux-2.6.32$ ls. /
linux-2.6.10 Linux-headers-2.6.32linux-2.6.10-1_2.6.32linux-2.6.10-1-10.00.custom_i386.deb Package
linux-2.6.32 Linux-image-2.6.32linux-2.6.10-1_2.6.32linux-2.6.10-1-10.00.custom_i386.deb
LINUX-2.6.32-V1 Log

Installing the kernel
$ CD.
$ sudo dpkg-i linux-image-2.6.32linux-2.6.10-1_2.6.32linux-2.6.10-1-10.00.custom_i386.deb
$ sudo dpkg-i linux-headers-2.6.32linux-2.6.10-1_2.6.32linux-2.6.10-1-10.00.custom_i386.deb

Detect if the kernel is properly installed
$ ls-l/boot
Shut down reboot, press and hold SHIFT key, enter recovery mode, select Start 2.6.32linux-2.6.10-1,
Loading Linux 2.6.32linux-2.6.10-1 ...
Loading Initial RAMDisk ...

Can not, had to sacrifice a big recruit: Install Ubuntu-6.06.1-desktop-i386.iso, its kernel version is 2.6.15.
Everything goes back to peace ...

Try compiling and booting the linux-2.6.32 kernel on Ubuntu 14.04

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.